diff options
612 files changed, 117965 insertions, 12007 deletions
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 8de1bda12e..0911ff98bf 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -140,10 +140,9 @@ doc_classes/* @godotengine/documentation /platform/android/ @godotengine/android /platform/ios/ @godotengine/ios -/platform/javascript/ @godotengine/html5 /platform/linuxbsd/ @godotengine/linux-bsd /platform/macos/ @godotengine/macos -/platform/uwp/ @godotengine/uwp +/platform/web/ @godotengine/web /platform/windows/ @godotengine/windows # Scene diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 449d2159f1..9169bdd456 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -5,19 +5,25 @@ body: - type: markdown attributes: value: | - - When reporting bugs, you'll make our life simpler (and the fix will come sooner) if you follow the guidelines in this template. + When reporting bugs, please follow the guidelines in this template. This helps identify the problem precisely and thus enables contributors to fix it faster. - Write a descriptive issue title above. - The golden rule is to **always open *one* issue for *one* bug**. If you notice several bugs and want to report them, make sure to create one new issue for each of them. - Search [open](https://github.com/godotengine/godot/issues) and [closed](https://github.com/godotengine/godot/issues?q=is%3Aissue+is%3Aclosed) issues to ensure it has not already been reported. If you don't find a relevant match or if you're unsure, don't hesitate to **open a new issue**. The bugsquad will handle it from there if it's a duplicate. - - Verify that you are using a [supported Godot version](https://docs.godotengine.org/en/stable/about/release_policy.html). + - Verify that you are using a [supported Godot version](https://docs.godotengine.org/en/stable/about/release_policy.html). Please always check if your issue is reproducible in the latest version – it may already have been fixed! + - If you use a custom build, please test if your issue is reproducible in official builds too. Likewise if you use any C++ modules, GDExtensions, or editor plugins, you should check if the bug is reproducible in a project without these. -- type: input +- type: textarea attributes: - label: Godot version - description: > - Specify the Godot version, including the Git commit hash if using a development or non-official build. The exact Godot version (including the commit hash) can be copied by clicking the version shown in the editor (bottom bar) or in the project manager (top bar). - If you use a custom build, please test if your issue is reproducible in official builds too. - placeholder: 3.5.stable, 4.0.dev [3041becc6] + label: Tested versions + description: | + To properly fix a bug, we need to identify if the bug was recently introduced in the engine, or if it was always present. + - Please specify the Godot version you found the issue in, including the **Git commit hash** if using a development or non-official build. The exact Godot version (including the commit hash) can be copied by clicking the version shown in the editor (bottom bar) or in the project manager (top bar). + - If you can, **please test earlier Godot versions** (previous stable branch, and development snapshots of the current feature release) and, if applicable, newer versions (development snapshots for the next feature release). Mention whether the bug is reproducible or not in the versions you tested. You can find all Godot releases in our [download archive](https://godotengine.org/download/archive/). + - The aim is for us to identify whether a bug is a **regression**, i.e. an issue that didn't exist in a previous version, but was introduced later on, breaking existing functionality. For example, if a bug is reproducible in 4.2.stable but not in 4.1.stable, we would like you to test intermediate 4.2 dev and beta snapshots to find which snapshot is the first one where the issue can be reproduced. + placeholder: | + + - Reproducible in: 4.3.dev [d76c1d0e5], 4.2.stable, 4.2.dev5 and later 4.2 snapshots. + - Not reproducible in: 4.1.3.stable, 4.2.dev4 and earlier 4.2 snapshots. validations: required: true @@ -54,12 +60,12 @@ body: - type: textarea attributes: - label: Minimal reproduction project + label: Minimal reproduction project (MRP) description: | - A small Godot project which reproduces the issue, with no unnecessary files included. Be sure to not include the `.godot` folder in the archive (but keep `project.godot`). - - Required, unless the reproduction steps are trivial and don't require any project files to be followed. In this case, write "N/A" in the field. - - Drag and drop a ZIP archive to upload it. **Do not select another field until the project is done uploading.** + - Having an MRP is very important for contributors to be able to reproduce the bug in the same way that you are experiencing it. When testing a potential fix for the issue, contributors will use the MRP to validate that the fix is working as intended. + - If the reproduction steps are not project dependent (e.g. the bug is visible in a brand new project), you can write "N/A" in the field. + - Drag and drop a ZIP archive to upload it (max 10 MB). **Do not select another field until the project is done uploading.** - **Note for C# users:** If your issue is *not* C#-specific, please upload a minimal reproduction project written in GDScript. This will make it easier for contributors to reproduce the issue locally as not everyone has a .NET setup available. - - **If you've been asked by a maintainer to upload a minimal reproduction project, you *must* do so within 7 days.** Otherwise, your bug report will be closed as it'll be considered too difficult to diagnose. validations: required: true diff --git a/.github/workflows/windows_builds.yml b/.github/workflows/windows_builds.yml index 7e8853634a..35ed1a773d 100644 --- a/.github/workflows/windows_builds.yml +++ b/.github/workflows/windows_builds.yml @@ -7,7 +7,7 @@ on: env: # Used for the cache key. Add version suffix to force clean build. GODOT_BASE_BRANCH: master - SCONSFLAGS: verbose=yes warnings=extra werror=yes module_text_server_fb_enabled=yes + SCONSFLAGS: verbose=yes warnings=extra werror=yes module_text_server_fb_enabled=yes d3d12=yes "dxc_path=${{github.workspace}}/dxc" "mesa_libs=${{github.workspace}}/godot-nir-static" SCONS_CACHE_MSVC_CONFIG: true concurrency: @@ -49,6 +49,28 @@ jobs: - name: Setup python and scons uses: ./.github/actions/godot-deps + - name: Download pre-built DirectX Shader Compiler + uses: dsaltares/fetch-gh-release-asset@1.0.0 + with: + repo: Microsoft/DirectXShaderCompiler + version: tags/v1.7.2308 + file: dxc_2023_08_14.zip + target: dxc.zip + + - name: Extract pre-built DirectX Shader Compiler + run: 7z x dxc.zip -o${{github.workspace}}/dxc + + - name: Download pre-built Mesa-NIR + uses: dsaltares/fetch-gh-release-asset@1.0.0 + with: + repo: godotengine/godot-nir-static + version: tags/23.1.0-devel + file: godot-nir-23.1.0-1-devel.zip + target: godot-nir-static.zip + + - name: Extract pre-built Mesa-NIR + run: 7z x godot-nir-static.zip -o${{github.workspace}}/godot-nir-static + - name: Setup MSVC problem matcher uses: ammaraskar/msvc-problem-matcher@master diff --git a/.gitignore b/.gitignore index 61ea171b8b..3c6f279a9c 100644 --- a/.gitignore +++ b/.gitignore @@ -153,6 +153,9 @@ gmon.out # Kdevelop *.kdev4 +# Mypy +.mypy_cache + # Qt Creator *.config *.creator @@ -14,12 +14,14 @@ Ariel Manzur <ariel@godotengine.org> <punto@godotengine.org> Ariel Manzur <ariel@godotengine.org> <ariel@okamstudio.com> Ariel Manzur <ariel@godotengine.org> <punto@Ariels-Mac-mini.local> Ariel Manzur <ariel@godotengine.org> <punto@Ariels-Mac-mini-2.local> +A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> <over999ships@gmail.com> Bastiaan Olij <mux213@gmail.com> Benjamin <mafortion.benjamin@gmail.com> Bernhard Liebl <Bernhard.Liebl@gmx.org> <poke1024@gmx.de> Bernhard Liebl <Bernhard.Liebl@gmx.org> <poke1024@gmx.org> Bruno Lourenço <madequa@users.noreply.github.com> <bmlourenco@gmail.com> Chaosus <chaosus89@gmail.com> +ChibiDenDen <pdaniq@gmail.com> Chris Bradfield <chris@kidscancode.org> <cb@scribe.net> Clay John <claynjohn@gmail.com> Clay John <claynjohn@gmail.com> <clayjohn@shaw.ca> @@ -40,6 +42,7 @@ Fabian <supagu@gmail.com> Ferenc Arn <tagcup@yahoo.com> Ferenc Arn <tagcup@yahoo.com> <tagcup@users.noreply.github.com> FireForge <67974470+fire-forge@users.noreply.github.com> <isaacr.7.2005@gmail.com> +Florian Kothmeier <floriankothmeier@web.de> foxydevloper <12120644+foxydevloper@users.noreply.github.com> Fredia Huya-Kouadio <fhuyakou@gmail.com> Fredia Huya-Kouadio <fhuyakou@gmail.com> <fhuya@google.com> @@ -119,6 +122,7 @@ Nuno Donato <nunodonato@gmail.com> <n.donato@estrelasustentavel.pt> ocean (they/them) <anvilfolk@gmail.com> Pawel Kowal <pkowal1982@gmail.com> Pedro J. Estébanez <pedrojrulez@gmail.com> <RandomShaper@users.noreply.github.com> +Patrick Exner <patrick.exner1@web.de> Patrick <firefly2442@gmail.com> Paul Batty <p_batty@hotmail.co.uk> Paul Batty <p_batty@hotmail.co.uk> <Paulb23@users.noreply.github.com> diff --git a/AUTHORS.md b/AUTHORS.md index bd6bb63ad8..cf53f39cda 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -62,6 +62,7 @@ name is available. Caner Demirer (cdemirer) Carl Olsson (not-surt) Carter Anderson (cart) + ChibiDenDen Chris Bradfield (cbscribe) Clay John (clayjohn) ConteZero @@ -71,6 +72,7 @@ name is available. Daniel Zilberleyb (dzil123) Danil Alexeev (dalexeev) dankan1890 + Darío Banini (DarioSamo) David Cambré (Gallilus) David Sichma (DavidSichma) David Snopek (dsnopek) @@ -95,6 +97,7 @@ name is available. Fabrice Cipolla (fabriceci) Ferenc Arn (tagcup) FireForge (fire-forge) + Florian Kothmeier (Dragoncraft89) follower foxydevloper François Belair (Razoric480) @@ -113,6 +116,7 @@ name is available. Hendrik Brucker (Geometror) hilfazer Hiroshi Ogawa (hi-ogawa) + HolonProduction homer666 hoontee Hugo Locurcio (Calinou) @@ -174,6 +178,7 @@ name is available. marynate Masoud BH (masoudbh3) Mateo Kuruk Miccino (kuruk-mm) + Matias N. Goldberg (darksylinc) Matthew (skyace65) Matthias Hölzl (hoelzl) Max Hilbrunner (mhilbrunner) @@ -190,6 +195,7 @@ name is available. mrezai Muhammad Huri (CakHuri) muiroc + myaaaaaaaaa Nathan Franke (nathanfranke) Nathan Lovato (NathanLovato) Nathan Warden (NathanWarden) @@ -203,6 +209,7 @@ name is available. Omar El Sheikh (The-O-King) Ovnuniarchos Pascal Richter (ShyRed) + Patrick Exner (FlameLizard) Patrick (firefly2442) Paul Batty (Paulb23) Paul Joannon (paulloz) @@ -246,9 +253,11 @@ name is available. smix8 snailrhymer Stijn Hinlopen (hinlopen) + stmSi Swarnim Arun (minraws) TC (floppyhammer) TechnoPorg + Thaddeus Crews (Repiteo) Thakee Nathees (ThakeeNathees) thebestnom Theo Hallenius (TheoXD) @@ -275,4 +284,5 @@ name is available. Zak Stam (zaksnet) Zher Huei Lee (leezh) ZuBsPaCe + 谢天 (jsjtxietian) 风青山 (Rindbee) diff --git a/CHANGELOG.md b/CHANGELOG.md index 735cca7212..a4d95412f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,2887 +1,1947 @@ # Changelog -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - -## [4.1] - 2023-07-06 - -See the [release announcement](https://godotengine.org/article/godot-4-1-is-here) for details. - -### Added - -#### 2D - -- Add "Center View" button to 2D editor ([GH-57252](https://github.com/godotengine/godot/pull/57252)). -- Add proper snapping to tile polygon editor ([GH-70488](https://github.com/godotengine/godot/pull/70488)). - -#### 3D - -- Add the ability to look-at in model-space ([GH-76082](https://github.com/godotengine/godot/pull/76082)). -- Add move control points button to Path3D Editor ([GH-77860](https://github.com/godotengine/godot/pull/77860)). - -#### Animation - -- Implement `AnimationNodeSub2` and allow less or greater value in mathematical `AnimationNode` ([GH-76616](https://github.com/godotengine/godot/pull/76616)). -- Add `TRANS_SPRING` mode to `Tween` ([GH-76899](https://github.com/godotengine/godot/pull/76899)). - -#### Buildsystem - -- Add support for single compilation unit builds ([GH-77170](https://github.com/godotengine/godot/pull/77170)). - -#### C#/.NET - -- Add fine-grained disabling of SourceGenerators ([GH-71049](https://github.com/godotengine/godot/pull/71049)). -- Add global class support ([GH-72619](https://github.com/godotengine/godot/pull/72619)). -- Add `[Obsolete]` attribute to deprecated members ([GH-77904](https://github.com/godotengine/godot/pull/77904)). -- Add version defines to help users deal with breaking changes ([GH-78249](https://github.com/godotengine/godot/pull/78249), [GH-78466](https://github.com/godotengine/godot/pull/78466)). -- Add compatibility overloads ([GH-78452](https://github.com/godotengine/godot/pull/78452)). - -#### Core - -- Add frame delta smoothing option ([GH-52314](https://github.com/godotengine/godot/pull/52314)). -- Refactor Node processing to allow Scene multi-threading ([GH-75901](https://github.com/godotengine/godot/pull/75901)). -- Add a square fill mode to GradientTexture2D ([GH-76151](https://github.com/godotengine/godot/pull/76151)). -- Expose `ProjectSettings.set_as_basic()` to scripting ([GH-77417](https://github.com/godotengine/godot/pull/77417)). -- Expose `ProjectSettings.set_as_internal()` to scripting ([GH-77668](https://github.com/godotengine/godot/pull/77668)). -- Let user scripts disable thread safety checks ([GH-78000](https://github.com/godotengine/godot/pull/78000)). - -#### Editor - -- Add editor setting for spin slider sensibility ([GH-50671](https://github.com/godotengine/godot/pull/50671)). -- Add multi-window code and shader editors ([GH-62378](https://github.com/godotengine/godot/pull/62378)). -- Improve editor state persistence ([GH-72277](https://github.com/godotengine/godot/pull/72277)). -- Properly remember snapping options per-project ([GH-74682](https://github.com/godotengine/godot/pull/74682)). -- Add project tags ([GH-75047](https://github.com/godotengine/godot/pull/75047)). -- Improve editor state initialization ([GH-75563](https://github.com/godotengine/godot/pull/75563)). -- Android: Add the `scale_gizmo_handles` editor setting for touchscreens ([GH-75718](https://github.com/godotengine/godot/pull/75718)). -- Make create folder popup support nested folders ([GH-76084](https://github.com/godotengine/godot/pull/76084)). -- Display enum value descriptions in the editor inspector help tooltips ([GH-76238](https://github.com/godotengine/godot/pull/76238)). -- Add indicator for `StringName` properties ([GH-77521](https://github.com/godotengine/godot/pull/77521)). -- Add relative path support for `EditorPlugin.add_autoload_singleton` ([GH-78109](https://github.com/godotengine/godot/pull/78109)). - -#### Export - -- Allow EditorExportPlugins to provide export options ([GH-72895](https://github.com/godotengine/godot/pull/72895)). -- Add readable descriptions and validation warnings to the export options ([GH-74644](https://github.com/godotengine/godot/pull/74644)). - -#### GDExtension - -- Improve editor support for icons of custom, scripted, and GDExtension classes ([GH-75472](https://github.com/godotengine/godot/pull/75472)). -- Add a backwards compatibility system for GDExtension ([GH-76446](https://github.com/godotengine/godot/pull/76446)). -- Allow GDExtensions to add editor plugins ([GH-77010](https://github.com/godotengine/godot/pull/77010)). -- Add GDExtension `@since` attribute ([GH-78518](https://github.com/godotengine/godot/pull/78518)). - -#### GDScript - -- Allow to reference a class constructor as a `Callable` ([GH-73657](https://github.com/godotengine/godot/pull/73657)). -- Allow boolean operators for all Variant types ([GH-74741](https://github.com/godotengine/godot/pull/74741)). -- Add support for static variables in GDScript ([GH-76264](https://github.com/godotengine/godot/pull/76264)). - -#### GUI - -- Add support for multiline cells to `Tree` ([GH-61714](https://github.com/godotengine/godot/pull/61714)). -- Expose horizontal/vertical `custom_step` as editor property for the `ScrollContainer` ([GH-70868](https://github.com/godotengine/godot/pull/70868)). -- Implement `screen_get_pixel` method for LinuxBSD/X11, macOS and Windows ([GH-74087](https://github.com/godotengine/godot/pull/74087)). -- Implement vertical icon alignment for buttons ([GH-74369](https://github.com/godotengine/godot/pull/74369)). -- Expose all auto-wrap modes in `TextEdit` ([GH-74813](https://github.com/godotengine/godot/pull/74813)). -- Expose `TextServer` justification flags to `Label`, `Label3D`, `TextMesh`, and `RichTextLabel` ([GH-75250](https://github.com/godotengine/godot/pull/75250)). -- Expose dialog parent-and-popup logic to the API ([GH-76025](https://github.com/godotengine/godot/pull/76025)). -- Add support for tab stops to `Label` ([GH-76129](https://github.com/godotengine/godot/pull/76129)). -- Add support for tab stops to `RichTextLabel` ([GH-76401](https://github.com/godotengine/godot/pull/76401)). -- Expose `Window.get_window_id()` ([GH-77288](https://github.com/godotengine/godot/pull/77288)). -- Implement `TreeItem.add_child` ([GH-77446](https://github.com/godotengine/godot/pull/77446)). -- Add method to check if native window is focused ([GH-78262](https://github.com/godotengine/godot/pull/78262)). - -#### Import - -- Expose more compression formats in Image and fix compress check ([GH-76014](https://github.com/godotengine/godot/pull/76014)). -- Add support for extending GLTF with more texture formats and support WebP ([GH-76895](https://github.com/godotengine/godot/pull/76895)). -- Add support for non-standard OBJ vertex entries ([GH-77042](https://github.com/godotengine/godot/pull/77042)). - -#### Input - -- Detect host OS and use macOS keys on Mac hosts on Web ([GH-75451](https://github.com/godotengine/godot/pull/75451)). - -#### Navigation - -- Expose NavigationAgent path postprocessing and pathfinding algorithm options ([GH-75326](https://github.com/godotengine/godot/pull/75326)). -- Add agent pause mode to `NavigationServer` ([GH-75888](https://github.com/godotengine/godot/pull/75888)). -- Add NavigationPolygon `cell_size` property ([GH-78172](https://github.com/godotengine/godot/pull/78172)). - -#### Networking - -- Implement "watched" properties (reliable/on change) ([GH-75467](https://github.com/godotengine/godot/pull/75467)). -- Add support for platform-specific CA bundles ([GH-76836](https://github.com/godotengine/godot/pull/76836)). - -#### Porting - -- Implement and expose `OS.shell_show_in_file_manager()` ([GH-69698](https://github.com/godotengine/godot/pull/69698), [GH-76428](https://github.com/godotengine/godot/pull/76428)). -- Add `audio/general/text_to_speech` project setting to enable/disable TTS ([GH-77132](https://github.com/godotengine/godot/pull/77132)). -- Android: Allow concurrent buffering and dispatch of input events ([GH-76399](https://github.com/godotengine/godot/pull/76399)). -- Android: Add editor setting to control the window used to run the project ([GH-77676](https://github.com/godotengine/godot/pull/77676)). -- Android: Allow exporting release builds without a debug keystore ([GH-78123](https://github.com/godotengine/godot/pull/78123)). -- Linux/BSD: Add a default error handler for X11 to avoid crashes ([GH-75099](https://github.com/godotengine/godot/pull/75099)). - -#### Rendering - -- Add shader cache to GLES3 ([GH-76092](https://github.com/godotengine/godot/pull/76092)). -- Implement Vulkan pipeline caching ([GH-76348](https://github.com/godotengine/godot/pull/76348)). -- Add NoiseTexture3D ([GH-76486](https://github.com/godotengine/godot/pull/76486)). - -#### Shaders - -- Add `EXPOSURE` built-in to spatial shaders ([GH-71364](https://github.com/godotengine/godot/pull/71364)). -- Add `LIGHT_IS_DIRECTIONAL` built-in for spatial shaders ([GH-76290](https://github.com/godotengine/godot/pull/76290)). - -#### XR - -- Add support for getting and setting display refresh rate in WebXR ([GH-72938](https://github.com/godotengine/godot/pull/72938)). - -### Changed - -#### 2D - -- Improve the `Gradient2D` editor ([GH-70940](https://github.com/godotengine/godot/pull/70940)). -- Overhaul the `Curve` editor ([GH-74959](https://github.com/godotengine/godot/pull/74959)). -- Draw materials in tile atlas view ([GH-77909](https://github.com/godotengine/godot/pull/77909)). - -#### Animation - -- Improve SpriteFrameEditor frame addition ordering ([GH-68091](https://github.com/godotengine/godot/pull/68091)). - -#### Buildsystem - -- SCons: Move platform logo/run icon to `export` folder ([GH-78435](https://github.com/godotengine/godot/pull/78435)). - -#### C#/.NET - -- Make include scripts contents an export option ([GH-72896](https://github.com/godotengine/godot/pull/72896)). -- Truncate instead of round in Vector2/3/4 to Vector2I/3I/4I conversion ([GH-75477](https://github.com/godotengine/godot/pull/75477)). - -#### Core - -- The strings returned by `ResourceLoader::get_dependencies()` now include paths in addition to UIDs ([GH-73131](https://github.com/godotengine/godot/pull/73131)). -- Optimize Node children management ([GH-75627](https://github.com/godotengine/godot/pull/75627)). -- Deprecate `NOTIFICATION_MOVED_IN_PARENT` for `NOTIFICATION_CHILD_ORDER_CHANGED` ([GH-75701](https://github.com/godotengine/godot/pull/75701)). -- Optimize `Node::add_child` validation ([GH-75760](https://github.com/godotengine/godot/pull/75760)). -- Replace invalid characters in node names by underscores instead of removing them ([GH-75760](https://github.com/godotengine/godot/pull/75760)). -- Optimize `Object::get_class_name` ([GH-75797](https://github.com/godotengine/godot/pull/75797)). -- Ensure `RID`, `Callable`, and `Signal` are stored as strings ([GH-78517](https://github.com/godotengine/godot/pull/78517)). - -#### Editor - -- Remove constrained view in the 2D editor ([GH-47628](https://github.com/godotengine/godot/pull/47628)). -- Enhance FileSystem dock tooltips ([GH-63263](https://github.com/godotengine/godot/pull/63263)). -- Get rid of mouse wheel switch in scene tabs ([GH-70800](https://github.com/godotengine/godot/pull/70800)). -- Reorganize context menu in FileSystem dock to put more used options higher ([GH-73519](https://github.com/godotengine/godot/pull/73519)). -- Improve file move and copy operations ([GH-75330](https://github.com/godotengine/godot/pull/75330)). -- Preserve scene unique names when saving branch as scene ([GH-76609](https://github.com/godotengine/godot/pull/76609)). -- Allow showing messages from threads in "Editor Log" ([GH-77080](https://github.com/godotengine/godot/pull/77080)). - -#### Export - -- Store sensitive export options in dedicated credentials file ([GH-76165](https://github.com/godotengine/godot/pull/76165)). -- Check if the required texture format is imported in the export dialog ([GH-78456](https://github.com/godotengine/godot/pull/78456)). - -#### GDExtension - -- Rework GDExtension interface from a struct to loading function pointers ([GH-76406](https://github.com/godotengine/godot/pull/76406)). -- Standardize Object ptrcall encoding on `Object **` ([GH-77410](https://github.com/godotengine/godot/pull/77410)). - -#### GDScript - -- Improve GDScript documentation generation & behavior ([GH-72095](https://github.com/godotengine/godot/pull/72095)). -- Sort code autocompletion with rules ([GH-75746](https://github.com/godotengine/godot/pull/75746)). -- Allow `String`s and `StringName`s match each other in a `match` statement ([GH-78389](https://github.com/godotengine/godot/pull/78389)). - -#### GUI - -- Add a warning when accessing theme prematurely and fix surfaced issues ([GH-73475](https://github.com/godotengine/godot/pull/73475)). -- Make main editor window border margin controllable by theme ([GH-74767](https://github.com/godotengine/godot/pull/74767)). -- Make sure to normalize subtags when parsing BBCode ([GH-75622](https://github.com/godotengine/godot/pull/75622)). -- Add an option for ButtonGroups to be unpressed ([GH-76279](https://github.com/godotengine/godot/pull/76279)). -- Make `TextureButton` and `Button` update on texture change ([GH-77159](https://github.com/godotengine/godot/pull/77159)). -- Use defined key mapping for closing popups and dialogs ([GH-77297](https://github.com/godotengine/godot/pull/77297)). - -#### Import - -- Split editor-specific import metadata for textures ([GH-75949](https://github.com/godotengine/godot/pull/75949)). -- Use DXT1 when compressing PNGs with RGB format ([GH-76516](https://github.com/godotengine/godot/pull/76516)). -- Respect `compress_binary_resources` editor setting on scene import ([GH-76630](https://github.com/godotengine/godot/pull/76630)). -- Disable texture format import overrides by default ([GH-77105](https://github.com/godotengine/godot/pull/77105), [GH-78147](https://github.com/godotengine/godot/pull/78147)). -- Ensure that "detect 3D" is only called when using 3D shaders ([GH-78199](https://github.com/godotengine/godot/pull/78199)). - -#### Input - -- Create a virtual mouse move event after moving child nodes in tree ([GH-66625](https://github.com/godotengine/godot/pull/66625)). -- Propagate shortcut events to `SubViewport`s ([GH-76926](https://github.com/godotengine/godot/pull/76926)). -- Improve touchpad and mouse support for the Android editor ([GH-77498](https://github.com/godotengine/godot/pull/77498)). -- Generate missing values instead of disabling options ([GH-77900](https://github.com/godotengine/godot/pull/77900)). - -#### Navigation - -- Rework Navigation avoidance ([GH-69988](https://github.com/godotengine/godot/pull/69988)). -- Make navigation mesh edge connections optional ([GH-75601](https://github.com/godotengine/godot/pull/75601)). -- Prevent unnecessary navigation map synchronizations ([GH-75678](https://github.com/godotengine/godot/pull/75678)). -- Update NavigationObstacle API ([GH-78081](https://github.com/godotengine/godot/pull/78081)). - -#### Networking - -- mbedTLS: Disable weak crypto and TLS versions ([GH-76905](https://github.com/godotengine/godot/pull/76905)). -- Allow `ENetConnection` to send a packet to an arbitrary destination ([GH-77627](https://github.com/godotengine/godot/pull/77627)). - -#### Physics - -- Propagate previously unused `NOTIFICATION_WORLD_2D_CHANGED`, make CanvasItem/CollisionObject2D use it ([GH-57179](https://github.com/godotengine/godot/pull/57179)). - -#### Porting - -- Android: Downgrade android gradle plugin to version 7.2.1 ([GH-76325](https://github.com/godotengine/godot/pull/76325)). -- macOS: Bump min. version to 10.13, and remove deprecated code ([GH-76394](https://github.com/godotengine/godot/pull/76394)). -- Windows: Support long path in file access ([GH-76739](https://github.com/godotengine/godot/pull/76739)). - -#### Rendering - -- Disable NVIDIA's threaded OpenGL optimization on Windows ([GH-71472](https://github.com/godotengine/godot/pull/71472)). -- Use `MODELVIEW_MATRIX` when on double precision ([GH-75462](https://github.com/godotengine/godot/pull/75462)). -- Move sky luminance scaling to before fog is applied ([GH-75812](https://github.com/godotengine/godot/pull/75812)). -- Clamp normal when calculating 2D lighting to avoid artifacts ([GH-76240](https://github.com/godotengine/godot/pull/76240)). -- Rework particle turbulence ([GH-77154](https://github.com/godotengine/godot/pull/77154)). -- (Re-)Implement `Light3D.shadow_reverse_cull_face` ([GH-77238](https://github.com/godotengine/godot/pull/77238)). -- Take 3D resolution scaling into account for mesh LOD ([GH-77294](https://github.com/godotengine/godot/pull/77294)). - -#### Thirdparty - -- astcenc updated to version 4.4.0. -- basis_universal updated to version 1.16.4. -- brotli updated to version ed1995b6b. -- doctest updated to version 2.4.11. -- FreeType updated to version 2.13.0. -- HarfBuzz updated to version 7.3.0. -- ICU4C updated to version 73.1. -- MbedTLS updated to version 2.28.3. -- PCRE2 updated to version 10.42. -- recast updated to version 1.6.0. -- ThorVG updated to version 0.9.0. -- tinyexr updated to version 1.0.5. -- wslay updated to version 0e7d106ff. -- Vulkan and related libraries updated to version 1.3.250.0. -- zstd updated to version 1.5.5. -- CA root certificates updated to 2023-06-02 bundle from Mozilla. - -### Removed - -#### C#/.NET - -- Discontinue `GodotNuGetFallbackFolder` ([GH-73984](https://github.com/godotengine/godot/pull/73984)). - -#### Input - -- Deprecate `push_unhandled_input` ([GH-77452](https://github.com/godotengine/godot/pull/77452)). - -### Fixed +This file lists all changes made between the current feature branch and the +previous feature release. It is equivalent to the listings on our +[interactive changelog](https://godotengine.github.io/godot-interactive-changelog/). + +Changelogs for earlier feature releases are available in their respective Git +branches, and linked at the [end of this file](#Past-releases). + +## 4.2 - 2023-11-30 + +- [Release announcement](https://godotengine.org/article/godot-4-2-arrives-in-style) +- [Migration guide](https://docs.godotengine.org/en/latest/tutorials/migrating/upgrading_to_godot_4.2.html) +- [Interactive changelog](https://godotengine.github.io/godot-interactive-changelog/#4.2) +- [Breaking changes](https://github.com/godotengine/godot/pulls?q=is%3Apr+is%3Amerged+label%3A%22breaks+compat%22+milestone%3A4.2) + +Table of contents: + +- [2D](#2D) +- [3D](#3D) +- [Animation](#Animation) +- [Assetlib](#Assetlib) +- [Audio](#Audio) +- [Buildsystem](#Buildsystem) +- [C#](#C) +- [Codestyle](#Codestyle) +- [Core](#Core) +- [Documentation](#Documentation) +- [Editor](#Editor) +- [Export](#Export) +- [GDExtension](#GDExtension) +- [GDScript](#GDScript) +- [GUI](#GUI) +- [Import](#Import) +- [Input](#Input) +- [Multiplayer](#Multiplayer) +- [Navigation](#Navigation) +- [Network](#Network) +- [Particles](#Particles) +- [Physics](#Physics) +- [Plugin](#Plugin) +- [Porting](#Porting) +- [Rendering](#Rendering) +- [Shaders](#Shaders) +- [Tests](#Tests) +- [Thirdparty](#Thirdparty) +- [XR](#XR) #### 2D -- Fix click-selecting Sprites with repeated texture ([GH-78566](https://github.com/godotengine/godot/pull/78566)). -- Tilemaps: Fix rendering odd-sized tiles ([GH-74814](https://github.com/godotengine/godot/pull/74814)). -- Tilemaps: Fix tile resizing towards atlas boundary ([GH-76152](https://github.com/godotengine/godot/pull/76152)). -- Tilemaps: Fix crashes when painting a large area in a tilemap ([GH-76548](https://github.com/godotengine/godot/pull/76548)). -- Tilemaps: Fix TileMap draw preview when switching CanvasItem editor tool ([GH-78467](https://github.com/godotengine/godot/pull/78467)). -- Tilemaps: Fix TileSet set as local to scene ([GH-78477](https://github.com/godotengine/godot/pull/78477)). -- Tilemaps: Update indices after removing custom data layers ([GH-78492](https://github.com/godotengine/godot/pull/78492)). +- Greatly improve Y-sort performance on TileMaps ([GH-73813](https://github.com/godotengine/godot/pull/73813)). +- Add separate editor plugin for TileMap and TileSet ([GH-74717](https://github.com/godotengine/godot/pull/74717)). +- Cleanup tiles outside the texture ([GH-77986](https://github.com/godotengine/godot/pull/77986)). +- Move TileMap layers to their own class ([GH-78328](https://github.com/godotengine/godot/pull/78328)). +- Add option to swap default Alt+scroll zooming behavior in 2D editor ([GH-78451](https://github.com/godotengine/godot/pull/78451)). +- Add white rect to TileMap selection tool ([GH-78519](https://github.com/godotengine/godot/pull/78519)). +- Improve string drawing in the tiledata editor ([GH-78522](https://github.com/godotengine/godot/pull/78522)). +- Make sure the shortcut key respects the context in `TileSetAtlasSourceEditor` ([GH-78920](https://github.com/godotengine/godot/pull/78920)). +- Fix `Camera2D.rotating` not being converted and reversed properly ([GH-79264](https://github.com/godotengine/godot/pull/79264)). +- Streamline creating tile atlas sources ([GH-79285](https://github.com/godotengine/godot/pull/79285)). +- Rework modifying tile source ID ([GH-79419](https://github.com/godotengine/godot/pull/79419)). +- Allow using floating-point bone sizes and outline widths in the 2D editor ([GH-79434](https://github.com/godotengine/godot/pull/79434)). +- Add option to expand tile polygon editors ([GH-79512](https://github.com/godotengine/godot/pull/79512)). +- Add `is_conformal` method to Basis and Transform2D ([GH-79523](https://github.com/godotengine/godot/pull/79523)). +- Improve message when no tile is selected to edit ([GH-79562](https://github.com/godotengine/godot/pull/79562)). +- Fix crash when deleting tileset terrains ([GH-79618](https://github.com/godotengine/godot/pull/79618)). +- Fix Camera2D crash when edited scene root is null ([GH-79645](https://github.com/godotengine/godot/pull/79645)). +- Auto create tile for multiple atlases ([GH-79678](https://github.com/godotengine/godot/pull/79678)). +- Fix `CanvasModulate` logic for modulating the canvas ([GH-79747](https://github.com/godotengine/godot/pull/79747)). +- Fix `get_cursor_shape()` in tile atlas editor ([GH-79837](https://github.com/godotengine/godot/pull/79837)). +- Fix crash when executing `TileMap.fix_invalid_tiles` ([GH-79851](https://github.com/godotengine/godot/pull/79851)). +- Improve atlas tile size dragging ([GH-79899](https://github.com/godotengine/godot/pull/79899)). +- Add help label about creating multiple/big tiles ([GH-79904](https://github.com/godotengine/godot/pull/79904)). +- Properly clear scene tiles ([GH-79941](https://github.com/godotengine/godot/pull/79941)). +- Edit TileSet source on double click ([GH-80037](https://github.com/godotengine/godot/pull/80037)). +- Fix "a number is required" error when printing RID ([GH-80122](https://github.com/godotengine/godot/pull/80122)). +- Ignore null "id" in tile source proxy ([GH-80135](https://github.com/godotengine/godot/pull/80135)). +- Add per-tile flipping and transposing ([GH-80144](https://github.com/godotengine/godot/pull/80144)). +- Fix multiple usability issues in the texture region editor ([GH-80435](https://github.com/godotengine/godot/pull/80435)). +- Fix TileSet with TileMap handling ([GH-80462](https://github.com/godotengine/godot/pull/80462)). +- Fix TileSet not disappearing on deselecting TileMap ([GH-80529](https://github.com/godotengine/godot/pull/80529)). +- TileMap: Check for possible scenes to be erased ([GH-80658](https://github.com/godotengine/godot/pull/80658)). +- Pass missing arguments to `TileMap::get_used_cells_by_id` ([GH-80729](https://github.com/godotengine/godot/pull/80729)). +- Improve scene tiles workflow ([GH-80754](https://github.com/godotengine/godot/pull/80754)). +- Simplify making texture nodes in 2D editor ([GH-80771](https://github.com/godotengine/godot/pull/80771)). +- Add `px` suffix for TileSet `separation` property ([GH-80934](https://github.com/godotengine/godot/pull/80934)). +- Convert TileSet Atlas Merge input images to RGBA8 to match output, if needed ([GH-80943](https://github.com/godotengine/godot/pull/80943)). +- Call `add_child` after `set_rect` to fix size bug ([GH-80968](https://github.com/godotengine/godot/pull/80968)). +- Added checks to remove meta arrays when creating and undoing guides ([GH-81011](https://github.com/godotengine/godot/pull/81011)). +- Improve TileMap performances by using quadrants only for rendering ([GH-81070](https://github.com/godotengine/godot/pull/81070)). +- Allow configuring primary line X/Ys separately ([GH-81255](https://github.com/godotengine/godot/pull/81255)). +- Fix `TileMap::get_used_rect` incorrectly handling empty layers ([GH-81423](https://github.com/godotengine/godot/pull/81423)). +- Fix rotated 2D movement gizmo ([GH-81735](https://github.com/godotengine/godot/pull/81735)). +- Incorporate min and max zoom limits into the EditorZoomWidget ([GH-81812](https://github.com/godotengine/godot/pull/81812)). +- Fix TileMap editor so that pressing control deselects cells correctly ([GH-81925](https://github.com/godotengine/godot/pull/81925)). +- Don't allow transforming scene tiles ([GH-81971](https://github.com/godotengine/godot/pull/81971)). +- Fix animated tile time-slice calculation accumulating float errors ([GH-82360](https://github.com/godotengine/godot/pull/82360)). +- Fix transform calculations for drag-moving CanvasItems in editor ([GH-82667](https://github.com/godotengine/godot/pull/82667)). +- Prioritize points in polygon editor hover ([GH-82853](https://github.com/godotengine/godot/pull/82853)). +- Fixes undo/redo in tileset polygon editor ([GH-83093](https://github.com/godotengine/godot/pull/83093)). +- Warn users when TileMap is set as Y-sorted but no layer is ([GH-83144](https://github.com/godotengine/godot/pull/83144)). +- Fix tilemap live editing while game is running ([GH-83146](https://github.com/godotengine/godot/pull/83146)). +- Update `TileMap` layer draw index when it's dirty ([GH-83151](https://github.com/godotengine/godot/pull/83151)). +- Swap TileMap and TileSet buttons ([GH-83244](https://github.com/godotengine/godot/pull/83244)). +- Allow disabling the built-in tilemap navigation ([GH-83273](https://github.com/godotengine/godot/pull/83273)). +- Fix cannot update remote after disabling `use_global_coordinates` in `RemoteTransform2D` ([GH-83323](https://github.com/godotengine/godot/pull/83323)). +- Fix screen center position returned for rotated Camera2D ([GH-83427](https://github.com/godotengine/godot/pull/83427)). +- Fix bug where TileMap wouldn't update material correctly on assignment ([GH-83475](https://github.com/godotengine/godot/pull/83475)). +- Allow normal maps on TileMaps that use texture padding ([GH-83489](https://github.com/godotengine/godot/pull/83489)). +- Fix Polygon2D undo on transforming vertices ([GH-83659](https://github.com/godotengine/godot/pull/83659)). +- Fix TileSet painting options appear out of screen ([GH-83790](https://github.com/godotengine/godot/pull/83790)). +- Fix normals in TileSet when using CanvasTextures ([GH-83887](https://github.com/godotengine/godot/pull/83887)). +- Fix TileMap layer reverts and defaults ([GH-83888](https://github.com/godotengine/godot/pull/83888)). +- Fix `get_used_rect`, `get_used_cells` and `get_used_cells_by_id` in TileMap after a call to `clear()` ([GH-83890](https://github.com/godotengine/godot/pull/83890)). +- Fix Y-sort origin not working when set in TileMap runtime updates ([GH-84004](https://github.com/godotengine/godot/pull/84004)). +- Fix 2D bone weight editor not accounting for offset ([GH-84070](https://github.com/godotengine/godot/pull/84070)). +- Prevent crash and error spam related to Sprite2D with a region ([GH-84361](https://github.com/godotengine/godot/pull/84361)). +- TileMap: Fix compatibility code for old `cell_quadrant_size` property name ([GH-85463](https://github.com/godotengine/godot/pull/85463)). #### 3D -- Fix `PathFollow` direction and add Z forward option ([GH-72842](https://github.com/godotengine/godot/pull/72842)). -- Improve CSG robustness ([GH-74771](https://github.com/godotengine/godot/pull/74771)). -- Fix 3D viewport front/rear axis and "Focus" button ([GH-76052](https://github.com/godotengine/godot/pull/76052)). -- Fix infinite loop in CSG `Build2DFaces::_find_edge_intersections` ([GH-76521](https://github.com/godotengine/godot/pull/76521)). -- Fix `CSGPolygon3D` in path mode disappearing at runtime ([GH-77118](https://github.com/godotengine/godot/pull/77118)). +- Re-add a Camera3D icon gizmo to the 3D editor ([GH-53104](https://github.com/godotengine/godot/pull/53104)). +- Implement numeric blender-style transforms ([GH-58389](https://github.com/godotengine/godot/pull/58389)). +- Wrap mouse for blender-style transforms ([GH-59467](https://github.com/godotengine/godot/pull/59467)). +- Improve editing of box collision shapes ([GH-71092](https://github.com/godotengine/godot/pull/71092)). +- Show visual-oriented 3D node gizmos only when selected ([GH-75303](https://github.com/godotengine/godot/pull/75303)). +- Fix Camera3D `project_*` methods not accounting for frustum offset ([GH-75806](https://github.com/godotengine/godot/pull/75806)). +- Avoid reimporting lightmap textures every getter call ([GH-77788](https://github.com/godotengine/godot/pull/77788)). +- Fix 3D viewport grid disappearing on scene tab changes ([GH-78694](https://github.com/godotengine/godot/pull/78694)). +- Fix VoxelGI saving VoxelGIData as a built-in file, despite being prompted to save it to an external file ([GH-78772](https://github.com/godotengine/godot/pull/78772)). +- Expose `compute_convex_mesh_points` function to GDScript ([GH-78871](https://github.com/godotengine/godot/pull/78871)). +- Change property hint range for camera attributes exposure multiplier ([GH-79138](https://github.com/godotengine/godot/pull/79138)). +- Make CSGShape follow curve's tilt in Path mode ([GH-79355](https://github.com/godotengine/godot/pull/79355)). +- Convert some Callables to `callable_mp()` ([GH-79373](https://github.com/godotengine/godot/pull/79373)). +- Initialize View Frame Time estimates to match 120 FPS ([GH-80124](https://github.com/godotengine/godot/pull/80124)). +- Add helper for 3D gizmos and unify box ([GH-80278](https://github.com/godotengine/godot/pull/80278)). +- Add handles to control Curve3D tilt ([GH-80329](https://github.com/godotengine/godot/pull/80329)). +- Allow setting values greater than the maximum in TorusMesh inspector ([GH-80441](https://github.com/godotengine/godot/pull/80441)). +- Add `global_basis` property to `Node3D` ([GH-80512](https://github.com/godotengine/godot/pull/80512)). +- Cleanup MeshLibrary changed signals ([GH-80782](https://github.com/godotengine/godot/pull/80782)). +- Improve Path3D gizmo usability ([GH-80802](https://github.com/godotengine/godot/pull/80802)). +- GridMap: Ensure the visibility is updated when entering the tree ([GH-81106](https://github.com/godotengine/godot/pull/81106)). +- Fix some keys triggering their actions twice in GridMap ([GH-81531](https://github.com/godotengine/godot/pull/81531)). +- Add 3D editor gizmo icons for Decal, LightmapProbe and FogVolume ([GH-81554](https://github.com/godotengine/godot/pull/81554)). +- Fix local 3D translation editing ([GH-81609](https://github.com/godotengine/godot/pull/81609)). +- Fix Curve3D baking up vectors for nontrivial curves ([GH-81885](https://github.com/godotengine/godot/pull/81885)). +- Update mesh list UI immediately after setting mesh library in gridmap ([GH-81914](https://github.com/godotengine/godot/pull/81914)). +- Optimize and tweak some SVGs, improve consistency between icons, and fix broken masks in light mode ([GH-82133](https://github.com/godotengine/godot/pull/82133)). +- Fix grid snapping for box shape gizmos ([GH-82381](https://github.com/godotengine/godot/pull/82381)). +- Make 3D editor gizmos and debug shapes ignore fog ([GH-82413](https://github.com/godotengine/godot/pull/82413)). +- Tweak Camera3D `size` property hint to make dragging more useful ([GH-82604](https://github.com/godotengine/godot/pull/82604)). +- Make gizmo plugin handle `SpriteBase3D` instead of `Sprite3D` ([GH-82901](https://github.com/godotengine/godot/pull/82901)). +- Enable UV2 on primitive meshes when using the MeshInstance3D context menu ([GH-82937](https://github.com/godotengine/godot/pull/82937)). +- Add an editor tool to automatically upgrade and re-save meshes ([GH-83613](https://github.com/godotengine/godot/pull/83613)). +- Fix some `Node3DEditor` snapping issues ([GH-84049](https://github.com/godotengine/godot/pull/84049)). +- Fix PlaneMesh tangents for 'Face X' orientation ([GH-84097](https://github.com/godotengine/godot/pull/84097)). +- Hide CSGShape's `debug_collision_shape` when it is invisible ([GH-84174](https://github.com/godotengine/godot/pull/84174)). #### Animation -- Fix `get_bone_pose_global_no_override()` returning incorrect values ([GH-77194](https://github.com/godotengine/godot/pull/77194)). -- Fix for SkeletonIK3D interpolation and bone roll ([GH-77469](https://github.com/godotengine/godot/pull/77469)). -- Only reset `rest_dirty` after ALL bone transforms have finished update ([GH-78025](https://github.com/godotengine/godot/pull/78025)). +- Skip keyframe creation dialog when holding Shift in the animation editor ([GH-54524](https://github.com/godotengine/godot/pull/54524)). +- Allow changing imported AnimationLibrary names in AnimationPlayer in the editor ([GH-67965](https://github.com/godotengine/godot/pull/67965)). +- Add animation playback preview to scene import settings ([GH-76367](https://github.com/godotengine/godot/pull/76367)). +- Additional cleanup of bone editors ([GH-77096](https://github.com/godotengine/godot/pull/77096)). +- Add `TileSetAtlasSource::TileAnimationMode` options and allow to shuffle tile animations ([GH-77257](https://github.com/godotengine/godot/pull/77257)). +- Include animation frames in tile atlas merge ([GH-77316](https://github.com/godotengine/godot/pull/77316)). +- Fix infinite loop state check in `AnimationStateMachine` ([GH-79141](https://github.com/godotengine/godot/pull/79141)). +- Add 3.x compatibility for animation loop mode ([GH-79155](https://github.com/godotengine/godot/pull/79155)). +- Fix `Animation::subtract_variant` for affine transforms ([GH-79279](https://github.com/godotengine/godot/pull/79279)). +- Fix `AnimationNodeTransition` with negative time scale ([GH-79403](https://github.com/godotengine/godot/pull/79403)). +- Fix `tween_property` on `Basis` to properly update its value ([GH-79426](https://github.com/godotengine/godot/pull/79426)). +- Fix the error when clicking AnimationTree in the editor ([GH-79588](https://github.com/godotengine/godot/pull/79588)). +- Make `AnimationNodeBlendTree` use `RBMap` instead `HashMap` ([GH-79595](https://github.com/godotengine/godot/pull/79595)). +- Fix rename animation in SpriteFramesEditor ([GH-79600](https://github.com/godotengine/godot/pull/79600)). +- SpriteFrames Editor: Fix FPS applied to two animations when switching animation ([GH-79692](https://github.com/godotengine/godot/pull/79692)). +- Make animation name list scroll to new animation in `SpriteEditor` ([GH-79743](https://github.com/godotengine/godot/pull/79743)). +- SpriteFrames Editor: Fix Frame Duration applied to wrong frame when switching frame ([GH-79872](https://github.com/godotengine/godot/pull/79872)). +- Improve and clarify paused Tweens ([GH-79879](https://github.com/godotengine/godot/pull/79879)). +- Avoid emitting signals if the animation is not ready to be processed ([GH-80367](https://github.com/godotengine/godot/pull/80367)). +- Fix initial value with delay in PropertyTweener ([GH-80702](https://github.com/godotengine/godot/pull/80702)). +- Ensure methods skipped by `AnimationPlayer::seek` are not called ([GH-80708](https://github.com/godotengine/godot/pull/80708)). +- Implement `AnimationMixer` as a base class of `AnimationPlayer` and `AnimationTree` ([GH-80813](https://github.com/godotengine/godot/pull/80813)). +- Revive onion skinning ([GH-80939](https://github.com/godotengine/godot/pull/80939)). +- Prevent errors if Tween callback's object is freed ([GH-81127](https://github.com/godotengine/godot/pull/81127)). +- Select node when clicked in AnimationPlayer timeline ([GH-81188](https://github.com/godotengine/godot/pull/81188)). +- Fix incorrect cast when animating `int` ([GH-81296](https://github.com/godotengine/godot/pull/81296)). +- Fix animation keyframes being skipped when played backwards ([GH-81452](https://github.com/godotengine/godot/pull/81452)). +- Check if property exists before tweening ([GH-81525](https://github.com/godotengine/godot/pull/81525)). +- Ignore method track when drawing line between keys ([GH-81563](https://github.com/godotengine/godot/pull/81563)). +- Hide animation toolbar above the viewport correctly when switching scenes ([GH-81606](https://github.com/godotengine/godot/pull/81606)). +- Defer updating the animations Tree in SpriteFramesEditor to avoid crashes ([GH-81643](https://github.com/godotengine/godot/pull/81643)). +- SceneTreeDock: Remove animation tracks with correct indices ([GH-81651](https://github.com/godotengine/godot/pull/81651)). +- Fix BoneAttachment3D signal connection ([GH-81695](https://github.com/godotengine/godot/pull/81695)). +- Fix crash when clicking on "Interpolation Mode" with nonexistent node path ([GH-81779](https://github.com/godotengine/godot/pull/81779)). +- Improve retarget auto-mapping algorithm ([GH-81843](https://github.com/godotengine/godot/pull/81843)). +- Fix theme access and improve UX in AnimationTree editor ([GH-82210](https://github.com/godotengine/godot/pull/82210)). +- Fix `SkeletonIK3D` editor preview when changing active node ([GH-82391](https://github.com/godotengine/godot/pull/82391)). +- Reimport bone attachment fixes ([GH-82471](https://github.com/godotengine/godot/pull/82471)). +- Fix "Some nodes are referenced by animation tracks" when deleting instance ([GH-82486](https://github.com/godotengine/godot/pull/82486)). +- Fix GroupedStateMachine reset ([GH-82563](https://github.com/godotengine/godot/pull/82563)). +- Fix crash when deleting the player in `AnimationPlayerEditorPlugin` ([GH-82573](https://github.com/godotengine/godot/pull/82573)). +- Limit animation audio clip inspector offset sliders to clip length ([GH-82627](https://github.com/godotengine/godot/pull/82627)). +- Tweak AnimationPlayer speed scale property hint to make dragging more useful ([GH-82641](https://github.com/godotengine/godot/pull/82641)). +- Fix `AnimationPlayer::play()` process unwanted start between the same animations ([GH-82898](https://github.com/godotengine/godot/pull/82898)). +- AnimationMixer: Fix non-numeric misc type (`Resource`, `Dictionary` & etc.) values cannot be blended with `UpdateMode.UPDATE_CONTINUOUS` ([GH-83030](https://github.com/godotengine/godot/pull/83030)). +- Move animation slice processing to `_post_fix_animations` ([GH-83036](https://github.com/godotengine/godot/pull/83036)). +- Set new SkeletonRestFixer tracks as imported ([GH-83076](https://github.com/godotengine/godot/pull/83076)). +- Fix editor crash when re-importing GLTF while animation is playing ([GH-83104](https://github.com/godotengine/godot/pull/83104)). +- Show AnimationMixer warning for non-numeric types only when relevant ([GH-83417](https://github.com/godotengine/godot/pull/83417)). +- Fix onion skinning internals activating audio/method/animation tracks ([GH-83430](https://github.com/godotengine/godot/pull/83430)). +- Remove AnimationMixer bindings only bound in the editor ([GH-83440](https://github.com/godotengine/godot/pull/83440)). +- Re-add close button for nodes in `AnimationNodeBlendTree` editor ([GH-83507](https://github.com/godotengine/godot/pull/83507)). +- Automatic reconnection of nodes in blend tree ([GH-83534](https://github.com/godotengine/godot/pull/83534)). +- Add vertical scrolling to bézier track editor ([GH-83776](https://github.com/godotengine/godot/pull/83776)). +- Ensure AnimationPlayer evaluate animations when autoplay is enabled and node becomes ready ([GH-83781](https://github.com/godotengine/godot/pull/83781)). +- Fix animation track paths updated by scene dock ([GH-83934](https://github.com/godotengine/godot/pull/83934)). +- Unpress buttons in AnimationTree when switching to read-only mode ([GH-84052](https://github.com/godotengine/godot/pull/84052)). +- Fix invalid return from some more `_get/_set` ([GH-84060](https://github.com/godotengine/godot/pull/84060)). +- Add descriptive warning for animation track hint fails ([GH-84129](https://github.com/godotengine/godot/pull/84129)). +- Fix AnimationTimeline time not updating when dragged ([GH-84170](https://github.com/godotengine/godot/pull/84170)). +- Avoid popping up dialogs excessively in the Animation editor ([GH-84208](https://github.com/godotengine/godot/pull/84208)). +- Fix perform_node_renames handling of AnimationMixers track paths ([GH-84282](https://github.com/godotengine/godot/pull/84282)). +- Unexpose internal data property of `AnimationLibrary` ([GH-84376](https://github.com/godotengine/godot/pull/84376)). +- Add `PackedArray` to the list of enforcing `Discrete` for `AnimationMixer` ([GH-84390](https://github.com/godotengine/godot/pull/84390)). +- Fix RESET not effective when saving inactive scene ([GH-84405](https://github.com/godotengine/godot/pull/84405)). +- Change AnimationLibEditor's mixer to actual Mixer ([GH-84551](https://github.com/godotengine/godot/pull/84551)). +- Remove AnimatedSprite pointer when clearing editor ([GH-84625](https://github.com/godotengine/godot/pull/84625)). +- Rework blending method in `Variant` animation for `Int`/`Array`/`String` ([GH-84815](https://github.com/godotengine/godot/pull/84815)). +- Fix ValueTrack with Resource is leaking ([GH-84942](https://github.com/godotengine/godot/pull/84942)). +- Fix seeking bug in AnimationPlayerEditor ([GH-85193](https://github.com/godotengine/godot/pull/85193)). +- Clear seeked/started flag after seeking/advancing in AnimationPlayer ([GH-85221](https://github.com/godotengine/godot/pull/85221)). +- Bind `_reset`/`_restore` in AnimationMixer ([GH-85254](https://github.com/godotengine/godot/pull/85254)). +- Fix TrackCache memory crash ([GH-85266](https://github.com/godotengine/godot/pull/85266)). +- Perform safe copies in `AnimatedValuesBackup::get_cache_copy()` ([GH-85302](https://github.com/godotengine/godot/pull/85302)). +- Fix a crash when trying to restore uncopyable animation tracks ([GH-85308](https://github.com/godotengine/godot/pull/85308)). +- Check the seeking if it is processed immediately after playback as a special case ([GH-85366](https://github.com/godotengine/godot/pull/85366)). +- Make AnimationPlaybackTrack keep state when stopping ([GH-85411](https://github.com/godotengine/godot/pull/85411)). +- AnimationMixer: Validate ObjectID before blend in case the object was freed ([GH-85461](https://github.com/godotengine/godot/pull/85461)). + +#### Assetlib + +- Fix long plugin names breaking the UI ([GH-80555](https://github.com/godotengine/godot/pull/80555)). +- Improve handling of archives when installing assets ([GH-81358](https://github.com/godotengine/godot/pull/81358)). +- Allow to specify target folder when installing assets ([GH-81620](https://github.com/godotengine/godot/pull/81620)). #### Audio -- Fix AudioListener2D ignoring rotation for positional audio ([GH-69027](https://github.com/godotengine/godot/pull/69027)). -- Fix trim when importing WAV ([GH-75261](https://github.com/godotengine/godot/pull/75261)). -- Fix crash in the Android editor when creating `AudioStreamMicrophone` ([GH-77686](https://github.com/godotengine/godot/pull/77686)). +- PulseAudio: Remove `get_latency()` caching ([GH-45152](https://github.com/godotengine/godot/pull/45152)). +- Context aware MIDI event printing ([GH-68820](https://github.com/godotengine/godot/pull/68820)). +- Add build option to enable MP1 and MP2 support in minimp3 ([GH-72729](https://github.com/godotengine/godot/pull/72729)). +- Add a `--audio-output-latency` command-line argument ([GH-78013](https://github.com/godotengine/godot/pull/78013)). +- Implement loading OGG files from buffer and file path ([GH-78084](https://github.com/godotengine/godot/pull/78084)). +- Simpler default values for AudioStreamRandomizer ([GH-80171](https://github.com/godotengine/godot/pull/80171)). +- Fix OGG audio loop offset pop ([GH-80452](https://github.com/godotengine/godot/pull/80452)). +- Add project settings for AVAudioSessionCategory on iOS ([GH-81196](https://github.com/godotengine/godot/pull/81196)). +- Remove some dead declarations in `audio_stream_player.h` ([GH-81485](https://github.com/godotengine/godot/pull/81485)). +- Fix audio stream generators getting freed accidentally ([GH-81508](https://github.com/godotengine/godot/pull/81508)). +- Add a `bus_renamed` AudioServer signal ([GH-81641](https://github.com/godotengine/godot/pull/81641)). +- Only warn once about OGG seeking issues ([GH-81704](https://github.com/godotengine/godot/pull/81704)). +- Tweak property order in the inspector for AudioStreamRandomizer ([GH-82411](https://github.com/godotengine/godot/pull/82411)). +- Fix `AudioStreamRandomizer.random_volume_offset_db` not working ([GH-82478](https://github.com/godotengine/godot/pull/82478)). +- Fix pausing stream on entering tree ([GH-83779](https://github.com/godotengine/godot/pull/83779)). +- Fix OGG Vorbis infinite error spam with corrupt file ([GH-84723](https://github.com/godotengine/godot/pull/84723)). -#### C#/.NET +#### Buildsystem -- Fix exception when using base types of extension-based types from C# ([GH-75955](https://github.com/godotengine/godot/pull/75955)). -- Fix C# glue generation for enums with negative values ([GH-77018](https://github.com/godotengine/godot/pull/77018)). -- Mostly fix hash of ManagedCallable ([GH-77199](https://github.com/godotengine/godot/pull/77199)). +- SCons: Add `object_prefix` option ([GH-62652](https://github.com/godotengine/godot/pull/62652)). +- Allow unbundling OpenXR (for Linux distros) ([GH-73443](https://github.com/godotengine/godot/pull/73443)). +- Add a Linux ThreadSanitizer job to CI ([GH-73777](https://github.com/godotengine/godot/pull/73777)). +- libpng: Enable intrinsics on x86/SSE2, ppc64/VSX, and all arm/NEON ([GH-78325](https://github.com/godotengine/godot/pull/78325)). +- Add static check for overzealous .gitignores and fix an example of such ([GH-78908](https://github.com/godotengine/godot/pull/78908)). +- SCons : Add `scu_limit` argument ([GH-78959](https://github.com/godotengine/godot/pull/78959)). +- Linux: Fix build with `use_sowrap=no` and various warnings/errors ([GH-79097](https://github.com/godotengine/godot/pull/79097)). +- Linux: Allow unbundling brotli to use system library ([GH-79101](https://github.com/godotengine/godot/pull/79101)). +- Linux: Link libsquish directly when unbundling, .pc file unreliable ([GH-79105](https://github.com/godotengine/godot/pull/79105)). +- Fix build options configuration for Visual Studio projects ([GH-79238](https://github.com/godotengine/godot/pull/79238)). +- CI: Allow skipping our GHA workflows with `DISABLE_GODOT_CI` variable ([GH-79321](https://github.com/godotengine/godot/pull/79321)). +- Fix `doc_status.py` trying to get removed `version` tag from XML ([GH-79406](https://github.com/godotengine/godot/pull/79406)). +- Have `core_bind.h` Thread type syntax match `core_bind.cpp` ([GH-79466](https://github.com/godotengine/godot/pull/79466)). +- Web: Use `fvisibility=hidden` for side module when `dlink_enabled` ([GH-79578](https://github.com/godotengine/godot/pull/79578)). +- Header formatting commits to `.git-blame-ignore-revs` ([GH-79615](https://github.com/godotengine/godot/pull/79615)). +- Fix gcc builds failing on Windows ([GH-79724](https://github.com/godotengine/godot/pull/79724)). +- Windows: Try using objcopy and strip with prefix and without prefix ([GH-79871](https://github.com/godotengine/godot/pull/79871)). +- CI: Extract godot-cpp testing into its own job ([GH-80091](https://github.com/godotengine/godot/pull/80091)). +- CI: Free disk space on Linux runners ([GH-80115](https://github.com/godotengine/godot/pull/80115)). +- CI: Compare API compatibility against both 4.0 and 4.1 ([GH-80354](https://github.com/godotengine/godot/pull/80354)). +- Suppress NavigationServer race conditions ([GH-80392](https://github.com/godotengine/godot/pull/80392)). +- Fix API validation script on macOS ([GH-80471](https://github.com/godotengine/godot/pull/80471)). +- SCons: Disable misbehaving MSVC incremental linking ([GH-80482](https://github.com/godotengine/godot/pull/80482)). +- SCons: Carry over the `windows_subsystem` setting to the generated vsproj ([GH-80547](https://github.com/godotengine/godot/pull/80547)). +- SCons: Disable C++ exception handling ([GH-80612](https://github.com/godotengine/godot/pull/80612)). +- Fix GCC `-Wmaybe-uninitialized` warnings ([GH-80615](https://github.com/godotengine/godot/pull/80615)). +- SCons: Enable `/WX` on LINKFLAGS for MSVC with `werror=yes` ([GH-80711](https://github.com/godotengine/godot/pull/80711)). +- SCons: Make ktx module require basis_universal ([GH-80789](https://github.com/godotengine/godot/pull/80789)). +- Windows: Add main executable to the console wrapper dependencies to prevent simultaneous linking ([GH-80918](https://github.com/godotengine/godot/pull/80918)). +- Assign extension validation files to the GDExtension and .NET teams in CODEOWNERS ([GH-81116](https://github.com/godotengine/godot/pull/81116)). +- Remove too greedy gcov/lcov ignores from `.gitignore` ([GH-81120](https://github.com/godotengine/godot/pull/81120)). +- SCons: Add option for MSVC incremental linking ([GH-81144](https://github.com/godotengine/godot/pull/81144)). +- CI: Bump version for `actions/checkout@v4` and `actions/setup-dotnet@v3` ([GH-81302](https://github.com/godotengine/godot/pull/81302)). +- CI: Compat checks: Make fetching the reference API more robust ([GH-81337](https://github.com/godotengine/godot/pull/81337)). +- Web: Workaround Emscripten 3.1.42+ LTO regression ([GH-81340](https://github.com/godotengine/godot/pull/81340)). +- UWP: Remove platform port, needs to be redone from scratch for 4.x ([GH-81416](https://github.com/godotengine/godot/pull/81416)). +- Haiku: Remove remnants of past WIP platform port ([GH-81420](https://github.com/godotengine/godot/pull/81420)). +- Web: Fix version check for missing scalbnf LTO workaround ([GH-81869](https://github.com/godotengine/godot/pull/81869)). +- macOS: Workaround Xcode 15 linker bug ([GH-81968](https://github.com/godotengine/godot/pull/81968)). +- SCons: Fix Python 3.12 SyntaxError with regex escape sequences ([GH-82290](https://github.com/godotengine/godot/pull/82290)). +- Windows: Remove `MSVC` define redundant with `_MSC_VER` ([GH-82304](https://github.com/godotengine/godot/pull/82304)). +- Updated compiler version detection ([GH-82325](https://github.com/godotengine/godot/pull/82325)). +- Fix compiler detection ([GH-82352](https://github.com/godotengine/godot/pull/82352)). +- Fix build on MSVC 2017 ([GH-82450](https://github.com/godotengine/godot/pull/82450)). +- iOS: Fix build with Xcode 15 ([GH-82458](https://github.com/godotengine/godot/pull/82458)). +- Web: Fix `dlink_enabled` build ([GH-82633](https://github.com/godotengine/godot/pull/82633)). +- SCons: Change `check_c_headers` from tuple array to dictionary ([GH-82638](https://github.com/godotengine/godot/pull/82638)). +- Validate `code` tags for class and member references ([GH-82691](https://github.com/godotengine/godot/pull/82691)). +- Fix building without GDScript ([GH-82985](https://github.com/godotengine/godot/pull/82985)). +- CI: Switch mesa PPA from kisak-mesa to turtle ([GH-83147](https://github.com/godotengine/godot/pull/83147)). +- CI: Workaround recently broken add-apt-repository on GHA ([GH-83214](https://github.com/godotengine/godot/pull/83214)). +- X11: Fix unused variables warning when `touch` is disabled ([GH-83265](https://github.com/godotengine/godot/pull/83265)). +- Bump the java version to version 17 ([GH-83515](https://github.com/godotengine/godot/pull/83515)). +- SCons: Use CXXFLAGS to disable exceptions, it's only for C++ ([GH-83618](https://github.com/godotengine/godot/pull/83618)). +- Web: Fix closure compiler builds using BIGINT ([GH-83720](https://github.com/godotengine/godot/pull/83720)). +- SCons: Reduce and cleanup verbose output for SCU builds ([GH-83996](https://github.com/godotengine/godot/pull/83996)). +- Use colored output on CI for Doctest ([GH-84100](https://github.com/godotengine/godot/pull/84100)). +- Linux: Remove hardcoded lib path for x86 cross-compilation ([GH-84307](https://github.com/godotengine/godot/pull/84307)). +- Replace the use of the `ANDROID_SDK_ROOT` env variable with `ANDROID_HOME` ([GH-84316](https://github.com/godotengine/godot/pull/84316)). +- CI: Pin Emscripten to 3.1.39 ([GH-84717](https://github.com/godotengine/godot/pull/84717)). +- Donors: Change tiers to match Dev Fund, sync latest data ([GH-84884](https://github.com/godotengine/godot/pull/84884)). +- makerst: Disallow user-contributed notes on the class index page ([GH-85006](https://github.com/godotengine/godot/pull/85006)). +- Use mingw-std-threads in MinGW builds ([GH-85039](https://github.com/godotengine/godot/pull/85039)). +- Avoid conflict between mingw-std-threads and Clang's own ([GH-85208](https://github.com/godotengine/godot/pull/85208)). +- Fix generating vsproj with SCons 4.6.0+ ([GH-85357](https://github.com/godotengine/godot/pull/85357)). +- Add unsigned char cast ifdef ([GH-85500](https://github.com/godotengine/godot/pull/85500)). + +#### C# + +- Allow readonly and writeonly C# properties to be accessed from GDScript ([GH-67304](https://github.com/godotengine/godot/pull/67304)). +- Support exporting for Android ([GH-73257](https://github.com/godotengine/godot/pull/73257)). +- Fix crash with `DisposablesTracker_OnGodotShuttingDown` ([GH-78157](https://github.com/godotengine/godot/pull/78157)). +- Add `PropertyHint.Enum` support to `Array<StringName>` ([GH-78264](https://github.com/godotengine/godot/pull/78264)). +- Check if JetBrains Rider editor path is empty ([GH-78516](https://github.com/godotengine/godot/pull/78516)). +- Automatically generate version defines ([GH-78722](https://github.com/godotengine/godot/pull/78722)). +- Update the RiderPathLocator to support the JetBrains Toolbox 2.0 ([GH-78832](https://github.com/godotengine/godot/pull/78832)). +- Add platform name to the exported data directory ([GH-78846](https://github.com/godotengine/godot/pull/78846)). +- Fix deserialization of delegates that are 0-parameter overloads ([GH-78877](https://github.com/godotengine/godot/pull/78877)). +- Add a Roslyn analyzer for global classes ([GH-79007](https://github.com/godotengine/godot/pull/79007)). +- Add missing `useModelFront` parameter to GodotSharp Basis and Transform ([GH-79082](https://github.com/godotengine/godot/pull/79082)). +- Compare symbol names without null flow state ([GH-79094](https://github.com/godotengine/godot/pull/79094)). +- Add null check before calling `UnregisterGodotObject` ([GH-79151](https://github.com/godotengine/godot/pull/79151)). +- Fix command line exporting ([GH-79173](https://github.com/godotengine/godot/pull/79173)). +- Add a warning about C# differences to the class reference ([GH-79206](https://github.com/godotengine/godot/pull/79206)). +- Document generated members ([GH-79239](https://github.com/godotengine/godot/pull/79239)). +- Print error when MethodBind/Callable call fails ([GH-79249](https://github.com/godotengine/godot/pull/79249)). +- Improve `GD.PushError` and `GD.PushWarning` ([GH-79280](https://github.com/godotengine/godot/pull/79280)). +- Fix MSVC dotnet builds failing if running `dev_mode` ([GH-79351](https://github.com/godotengine/godot/pull/79351)). +- Move build button to EditorRunBar ([GH-79357](https://github.com/godotengine/godot/pull/79357)). +- Fix line in OpenInExternalEditor ([GH-79404](https://github.com/godotengine/godot/pull/79404)). +- Generate instance types for singletons ([GH-79470](https://github.com/godotengine/godot/pull/79470)). +- Suppress NU5128 warning ([GH-79501](https://github.com/godotengine/godot/pull/79501)). +- Fix issues in C# documentation comments ([GH-79748](https://github.com/godotengine/godot/pull/79748)). +- Delegate opening files for Rider to the RiderPathLocator NuGet package ([GH-79958](https://github.com/godotengine/godot/pull/79958)). +- Mono: Avoid dictionary lookup for common colors ([GH-80047](https://github.com/godotengine/godot/pull/80047)). +- Show alert if .NET assemblies dir does not exist ([GH-80212](https://github.com/godotengine/godot/pull/80212)). +- Redesign MSBuild panel ([GH-80260](https://github.com/godotengine/godot/pull/80260)). +- Fix typo in parameter name in documentation ([GH-80303](https://github.com/godotengine/godot/pull/80303)). +- Improve diagnostic messages and add help link ([GH-80489](https://github.com/godotengine/godot/pull/80489)). +- Fix exporting for Android ([GH-80521](https://github.com/godotengine/godot/pull/80521)). +- Generate and use compat methods ([GH-80527](https://github.com/godotengine/godot/pull/80527)). +- Implement `proxy_name` for EnumInterface ([GH-80628](https://github.com/godotengine/godot/pull/80628)). +- Include argument types in generated methods ([GH-80629](https://github.com/godotengine/godot/pull/80629)). +- paramref now properly tagged in documentation ([GH-80630](https://github.com/godotengine/godot/pull/80630)). +- Fixed delegate docstring logic ([GH-80631](https://github.com/godotengine/godot/pull/80631)). +- Dereference editor types in core documentation ([GH-80632](https://github.com/godotengine/godot/pull/80632)). +- CI: Propagate error code when glue generation fails ([GH-80846](https://github.com/godotengine/godot/pull/80846)). +- Updated C# example of AddPropertyInfo ([GH-80851](https://github.com/godotengine/godot/pull/80851)). +- Replace `StringNameCache` with `SNAME` ([GH-81073](https://github.com/godotengine/godot/pull/81073)). +- Add abstract class support ([GH-81101](https://github.com/godotengine/godot/pull/81101)). +- Replace usage of deprecated `project_settings_changed` signal ([GH-81175](https://github.com/godotengine/godot/pull/81175)). +- Fix int's C# documentation ([GH-81227](https://github.com/godotengine/godot/pull/81227)). +- Expose `asinh`, `acosh` and `atanh` in Mathf ([GH-81229](https://github.com/godotengine/godot/pull/81229)). +- Fix double unregistration on dispose of Array ([GH-81230](https://github.com/godotengine/godot/pull/81230)). +- Hide hostfxr not found error ([GH-81690](https://github.com/godotengine/godot/pull/81690)). +- Move `bindings_generator` warnings to `.editorconfig` ([GH-81703](https://github.com/godotengine/godot/pull/81703)). +- Make C# static methods accessible ([GH-81783](https://github.com/godotengine/godot/pull/81783)). +- Fixed VS 2022 Mac compatibility ([GH-81802](https://github.com/godotengine/godot/pull/81802)). +- Add Vector2/3/4i.MAX and MIN ([GH-81819](https://github.com/godotengine/godot/pull/81819)). +- Implemented `{project}` placeholder for external dotnet editor ([GH-81847](https://github.com/godotengine/godot/pull/81847)). +- CS1591 from `NoWarn` to `suggestion` ([GH-81934](https://github.com/godotengine/godot/pull/81934)). +- Use `HashCode.Combine()` for basic composite types instead of xor ([GH-82240](https://github.com/godotengine/godot/pull/82240)). +- Remove compat method that is now generated ([GH-82375](https://github.com/godotengine/godot/pull/82375)). +- Fixed an error in `Vector3.BezierDerivative` in mono module ([GH-82664](https://github.com/godotengine/godot/pull/82664)). +- Fix C# editor dialogs ([GH-82683](https://github.com/godotengine/godot/pull/82683)). +- Add C# iOS support ([GH-82729](https://github.com/godotengine/godot/pull/82729)). +- Add C# compat members for 4.2 changes ([GH-82740](https://github.com/godotengine/godot/pull/82740)). +- Add checks to Android export ([GH-82762](https://github.com/godotengine/godot/pull/82762)). +- Report diagnostic for Node exports in a type that doesn't derive from Node ([GH-82918](https://github.com/godotengine/godot/pull/82918)). +- Fix unresolved `inheritdoc` links in `Compat.cs` ([GH-83001](https://github.com/godotengine/godot/pull/83001)). +- Untyped to typed `ArgumentNullException` ([GH-83051](https://github.com/godotengine/godot/pull/83051)). +- Fix MSVC dotnet `dev_mode` regression ([GH-83114](https://github.com/godotengine/godot/pull/83114)). +- Fix lookup for singleton instance types ([GH-83249](https://github.com/godotengine/godot/pull/83249)). +- Fallback to the latest SDK ([GH-83325](https://github.com/godotengine/godot/pull/83325)). +- Fix converting default Callables to native ([GH-83357](https://github.com/godotengine/godot/pull/83357)). +- Allow exporting games without C# ([GH-83422](https://github.com/godotengine/godot/pull/83422)). +- Clarify C# docs for operators performing `xform_inv` ([GH-83514](https://github.com/godotengine/godot/pull/83514)). +- Fix C# docs to use the proper XML ([GH-83529](https://github.com/godotengine/godot/pull/83529)). +- Fix generated nested class order ([GH-83532](https://github.com/godotengine/godot/pull/83532)). +- Add `NOTIFICATION_PREDELETE_CLEANUP` notification to fix C# `Dispose()` ([GH-83670](https://github.com/godotengine/godot/pull/83670)). +- Free dialogs when exiting the editor ([GH-83809](https://github.com/godotengine/godot/pull/83809)). +- Fix node names of submenu items across the editor ([GH-84617](https://github.com/godotengine/godot/pull/84617)). +- Rename `Vector2/3/4I.Min/Max` to `MinValue/MaxValue` ([GH-84663](https://github.com/godotengine/godot/pull/84663)). +- Fail `callp` silently if script is not valid ([GH-84897](https://github.com/godotengine/godot/pull/84897)). +- iOS: Fix dotnet export ([GH-84945](https://github.com/godotengine/godot/pull/84945)). + +#### Codestyle + +- Made hidden ProjectSettings groups more explicit ([GH-61818](https://github.com/godotengine/godot/pull/61818)). +- Extract StyleBoxFlat, StyleBoxTexture and StyleBoxLine in their own file ([GH-68396](https://github.com/godotengine/godot/pull/68396)). +- Extract and reorganize texture resource classes ([GH-68460](https://github.com/godotengine/godot/pull/68460)). +- Add command-line option to run a `MainLoop` by its global class name ([GH-78045](https://github.com/godotengine/godot/pull/78045)). +- Remove unnecessary value assignments throughout the codebase ([GH-78538](https://github.com/godotengine/godot/pull/78538)). +- Remove uses of `vformat()` with no placeholders ([GH-78797](https://github.com/godotengine/godot/pull/78797)). +- Unify and streamline connecting to Resource changes ([GH-78993](https://github.com/godotengine/godot/pull/78993)). +- Remove unused struct from NavigationMesh ([GH-79713](https://github.com/godotengine/godot/pull/79713)). +- Update NavObstacle creation to new Mutex style ([GH-79916](https://github.com/godotengine/godot/pull/79916)). +- Use compile-time Unicode string conversion ([GH-80362](https://github.com/godotengine/godot/pull/80362)). +- Undefine `typed_array.h` templates after use ([GH-80792](https://github.com/godotengine/godot/pull/80792)). +- Remove debug print ([GH-81129](https://github.com/godotengine/godot/pull/81129)). +- Extract `ScriptInstance` into its own file to simplify includes ([GH-81388](https://github.com/godotengine/godot/pull/81388)). +- Don't use auto where not warranted ([GH-81414](https://github.com/godotengine/godot/pull/81414)). +- Core: Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicable ([GH-81487](https://github.com/godotengine/godot/pull/81487)). +- [Scene,Main] Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicable ([GH-81568](https://github.com/godotengine/godot/pull/81568)). +- [Drivers,Platform] Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicable ([GH-81583](https://github.com/godotengine/godot/pull/81583)). +- Editor: Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicable ([GH-81705](https://github.com/godotengine/godot/pull/81705)). +- Modules: Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicable ([GH-81760](https://github.com/godotengine/godot/pull/81760)). +- Fix typo in `heuristic_euclidian` helper in AStarGrid2D ([GH-82297](https://github.com/godotengine/godot/pull/82297)). +- Servers: Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicable ([GH-82313](https://github.com/godotengine/godot/pull/82313)). +- Fix some typos in source ([GH-82779](https://github.com/godotengine/godot/pull/82779)). +- Replace `sanity` with `safety` for checks ([GH-83002](https://github.com/godotengine/godot/pull/83002)). +- Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicable ([GH-83003](https://github.com/godotengine/godot/pull/83003)). +- Fix incorrect null check ([GH-83068](https://github.com/godotengine/godot/pull/83068)). +- Clean up some Editor, OpenXR, VideoStream code ([GH-83683](https://github.com/godotengine/godot/pull/83683)). +- Solve race condition between AThousandShips and Akien ([GH-83740](https://github.com/godotengine/godot/pull/83740)). +- Don't use TTR/RTR for ERR/WARN prints ([GH-84774](https://github.com/godotengine/godot/pull/84774)). #### Core -- Fix multi-threaded resource loading ([GH-74405](https://github.com/godotengine/godot/pull/74405), [GH-77143](https://github.com/godotengine/godot/pull/77143)). -- Fix recursive `Node.find_children` ([GH-75459](https://github.com/godotengine/godot/pull/75459)). -- Fix invalid 2D global position when read outside tree ([GH-75509](https://github.com/godotengine/godot/pull/75509)). -- Prevent errors when using ViewportTexture ([GH-75751](https://github.com/godotengine/godot/pull/75751)). -- Properly update NodePaths with batch rename ([GH-76376](https://github.com/godotengine/godot/pull/76376)). -- Fix multiple issues in `WorkerThreadPool` ([GH-76945](https://github.com/godotengine/godot/pull/76945), [GH-76999](https://github.com/godotengine/godot/pull/76999)). -- Fix `StringName` comparison ([GH-77197](https://github.com/godotengine/godot/pull/77197)). -- Fix grayscale alpha for `Image::convert` `FORMAT_L8` using REC.709 ([GH-77456](https://github.com/godotengine/godot/pull/77456)). -- Fix external resource ids lost ([GH-77749](https://github.com/godotengine/godot/pull/77749)). +- Check parameter validity in `Object::set_script` ([GH-46125](https://github.com/godotengine/godot/pull/46125)). +- Add `settings_changed` signal to ProjectSettings ([GH-62038](https://github.com/godotengine/godot/pull/62038)). +- Fix the behavior of the resource property of the sub-scene root node on instantiation ([GH-65011](https://github.com/godotengine/godot/pull/65011)). +- Disallow invalid escape sequences in `JSON.parse` ([GH-66170](https://github.com/godotengine/godot/pull/66170)). +- Reimplement Resource.`_setup_local_to_scene` & deprecate signal ([GH-67080](https://github.com/godotengine/godot/pull/67080)). +- Deprecate `Resource.setup_local_to_scene` ([GH-67082](https://github.com/godotengine/godot/pull/67082)). +- Fix crash when saving resources with circular references ([GH-68281](https://github.com/godotengine/godot/pull/68281)). +- Add `type_string()` utility ([GH-69624](https://github.com/godotengine/godot/pull/69624)). +- Add a type conversion method to Variant Utility and expose to scripting ([GH-70080](https://github.com/godotengine/godot/pull/70080)). +- Ensure `MainLoop` and its custom script is set right after it's resolved ([GH-70771](https://github.com/godotengine/godot/pull/70771)). +- Ensure that SceneTree is initialized and finalized at correct time ([GH-72248](https://github.com/godotengine/godot/pull/72248)). +- Avoid sorting CallableCustomMethodPointers by their actual address values ([GH-72346](https://github.com/godotengine/godot/pull/72346)). +- Remove unused `threaded_array_processor.h` ([GH-74012](https://github.com/godotengine/godot/pull/74012)). +- Expose and document `Image.get_mipmap_count()` ([GH-74142](https://github.com/godotengine/godot/pull/74142)). +- Fix `Image.convert()` overwriting custom mipmaps ([GH-74238](https://github.com/godotengine/godot/pull/74238)). +- Support numeric/binary hash comparison for floats derived from Variants (as well as existing semantic comparison) ([GH-74588](https://github.com/godotengine/godot/pull/74588)). +- Expose `_validate_property()` for scripting ([GH-75778](https://github.com/godotengine/godot/pull/75778)). +- Add function `ZIPReader::file_exists` ([GH-76860](https://github.com/godotengine/godot/pull/76860)). +- Add `Node.get_tree_string` and `Node.get_tree_string_pretty` ([GH-77072](https://github.com/godotengine/godot/pull/77072)). +- Add a `--max-fps` command-line argument to set a FPS limit ([GH-78012](https://github.com/godotengine/godot/pull/78012)). +- Make a header for VariantUtilityFunctions ([GH-78108](https://github.com/godotengine/godot/pull/78108)). +- Added `Image::load_svg_from_(buffer|string)` ([GH-78248](https://github.com/godotengine/godot/pull/78248)). +- Add inverse hyperbolic functions `asinh()`, `acosh()` & `atanh()` ([GH-78404](https://github.com/godotengine/godot/pull/78404)). +- Add `String.reverse` method ([GH-78529](https://github.com/godotengine/godot/pull/78529)). +- Refactor CallQueue flushing for clarity ([GH-78612](https://github.com/godotengine/godot/pull/78612)). +- Fix `Object::notification` order ([GH-78634](https://github.com/godotengine/godot/pull/78634)). +- Allow renaming child nodes in `_ready` ([GH-78706](https://github.com/godotengine/godot/pull/78706)). +- Support loading of translations on threads ([GH-78747](https://github.com/godotengine/godot/pull/78747)). +- Fix zero-sized WorkerThreadPool not processing group tasks ([GH-78845](https://github.com/godotengine/godot/pull/78845)). +- Fix `Node::add_sibling` parent check ([GH-78847](https://github.com/godotengine/godot/pull/78847)). +- Fix error when non-ASCII characters in resource pack path ([GH-78935](https://github.com/godotengine/godot/pull/78935)). +- Reimplement scene change ([GH-78988](https://github.com/godotengine/godot/pull/78988)). +- Improve error message for `Node.set_owner` ([GH-79000](https://github.com/godotengine/godot/pull/79000)). +- Fix range error for `Array.slice` ([GH-79103](https://github.com/godotengine/godot/pull/79103)). +- TextServer: Remove excessive Dictionary checks ([GH-79166](https://github.com/godotengine/godot/pull/79166)). +- Fix erroneous `pad_zeros()` warning ([GH-79202](https://github.com/godotengine/godot/pull/79202)). +- Fix `PackedScene::get_last_modified_time()` always returns `0` ([GH-79237](https://github.com/godotengine/godot/pull/79237)). +- Add vararg `call()` method to C++ Callable ([GH-79341](https://github.com/godotengine/godot/pull/79341)). +- Fix byte to float color conversion in `DisplayServerWindows::screen_get_pixel` ([GH-79350](https://github.com/godotengine/godot/pull/79350)). +- Fix recursion level check for array stringification ([GH-79370](https://github.com/godotengine/godot/pull/79370)). +- Fix script name of Hant and Hans ([GH-79654](https://github.com/godotengine/godot/pull/79654)). +- Mention expected resource type in ResourceLoader load error ([GH-79737](https://github.com/godotengine/godot/pull/79737)). +- Add determinant check for minimized windows ([GH-79766](https://github.com/godotengine/godot/pull/79766)). +- FastNoiseLite: Fix cellular jitter using incorrect default value ([GH-79922](https://github.com/godotengine/godot/pull/79922)). +- Disable error condition for accessing safe rect ([GH-79937](https://github.com/godotengine/godot/pull/79937)). +- Fix life cycle of ResourceImporterTexture not tracked properly ([GH-79954](https://github.com/godotengine/godot/pull/79954)). +- String: Fix Unicode parsing error message encoding and related JSON tests ([GH-79980](https://github.com/godotengine/godot/pull/79980)). +- Fix life cycle of ResourceImporterTexture better ([GH-79981](https://github.com/godotengine/godot/pull/79981)). +- Fix global transform validity for `Node2D` and `Control` ([GH-80105](https://github.com/godotengine/godot/pull/80105)). +- Fix typo in modulo error message ([GH-80114](https://github.com/godotengine/godot/pull/80114)). +- Actually store safe-rect in embedder ([GH-80117](https://github.com/godotengine/godot/pull/80117)). +- Usage notes for DEV_ASSERT macro ([GH-80156](https://github.com/godotengine/godot/pull/80156)). +- Avoid crash on exiting due to late prints ([GH-80161](https://github.com/godotengine/godot/pull/80161)). +- Add `rotate_toward` and `angle_difference` methods ([GH-80225](https://github.com/godotengine/godot/pull/80225)). +- Avoid retrieving the object ID of a stack variable if it is nil ([GH-80256](https://github.com/godotengine/godot/pull/80256)). +- Remove `CanvasItem::_invalidate_global_transform` ([GH-80320](https://github.com/godotengine/godot/pull/80320)). +- Use StringName consistently to refer to the Master audio bus name ([GH-80381](https://github.com/godotengine/godot/pull/80381)). +- Deprecate `project_settings_changed` signal ([GH-80450](https://github.com/godotengine/godot/pull/80450)). +- Remove `DDS_INDEXED` from DDSFormat ([GH-80669](https://github.com/godotengine/godot/pull/80669)). +- Allow to get a list of visible embedded `Window`s ([GH-80673](https://github.com/godotengine/godot/pull/80673)). +- Fix CanvasItem notification thread guard ([GH-80752](https://github.com/godotengine/godot/pull/80752)). +- Optimize `String.left()` and `String.right()` ([GH-80824](https://github.com/godotengine/godot/pull/80824)). +- Implement center window function ([GH-81012](https://github.com/godotengine/godot/pull/81012)). +- Fix `JavaScriptBridge.eval()` never returning PackedByteArray ([GH-81015](https://github.com/godotengine/godot/pull/81015)). +- Add check to ensure registered classes are declared ([GH-81020](https://github.com/godotengine/godot/pull/81020)). +- Fix recursion level check for `VariantWriter::write()` with objects ([GH-81123](https://github.com/godotengine/godot/pull/81123)). +- Fix comparison of `Callable`s with binds ([GH-81131](https://github.com/godotengine/godot/pull/81131)). +- Fix consistency of GradientTexture changes ([GH-81137](https://github.com/godotengine/godot/pull/81137)). +- Fix for non-deterministic behavior in PCKPacker ([GH-81280](https://github.com/godotengine/godot/pull/81280)). +- String: Fix string conversion for -0.0 float values ([GH-81328](https://github.com/godotengine/godot/pull/81328)). +- Fix `SIGN(NAN)` returning 1 ([GH-81464](https://github.com/godotengine/godot/pull/81464)). +- Use pass by reference in ZIPPacker & ZIPReader signatures ([GH-81501](https://github.com/godotengine/godot/pull/81501)). +- Add `Vector2/3/4i.MAX` and `MIN` ([GH-81741](https://github.com/godotengine/godot/pull/81741)). +- Crypto: Fix `generate_random_bytes` for large chunks ([GH-81884](https://github.com/godotengine/godot/pull/81884)). +- Fix allocation size overflow check in `CowData` ([GH-81917](https://github.com/godotengine/godot/pull/81917)). +- Remove unnecessary line from `Projection::get_z_far` ([GH-81986](https://github.com/godotengine/godot/pull/81986)). +- Make all render driver project settings require restart ([GH-82008](https://github.com/godotengine/godot/pull/82008)). +- Add support for ImageTexture3D serialization ([GH-82055](https://github.com/godotengine/godot/pull/82055)). +- Made signal handling more uniform during crashes ([GH-82163](https://github.com/godotengine/godot/pull/82163)). +- Replace `radians` range hint with `radians_as_degrees` ([GH-82195](https://github.com/godotengine/godot/pull/82195)). +- Fix not being able to set Node process priority in certain cases ([GH-82358](https://github.com/godotengine/godot/pull/82358)). +- Fix axis getting mixed up when split leaf ([GH-82436](https://github.com/godotengine/godot/pull/82436)). +- Error handling for `FileAccess.get_file_as_*` ([GH-82595](https://github.com/godotengine/godot/pull/82595)). +- Do not replace starting digit with underscore when making identifier ([GH-82786](https://github.com/godotengine/godot/pull/82786)). +- Fix `RBMap`'s, iterator-based, `remove()` ([GH-82797](https://github.com/godotengine/godot/pull/82797)). +- Add missing double-precision flag for Vector4 & Projection in `encode_variant` ([GH-83202](https://github.com/godotengine/godot/pull/83202)). +- Update `triangulate_delaunay()` to avoid needless reallocations ([GH-83434](https://github.com/godotengine/godot/pull/83434)). +- Fix heap-use-after-free when resource loaded with `load_threaded_request` is never fetched ([GH-83782](https://github.com/godotengine/godot/pull/83782)). +- Fix `FastNoiseLite.get_seamless_image` function crash with bad param ([GH-83978](https://github.com/godotengine/godot/pull/83978)). +- Fix invalid return from some `_get/_set` ([GH-84054](https://github.com/godotengine/godot/pull/84054)). +- Prevent `encode_variant` doing `memcpy` from `nullptr` ([GH-84155](https://github.com/godotengine/godot/pull/84155)). +- Fix uninitialized variable in `Image::fix_alpha_edges()` ([GH-84173](https://github.com/godotengine/godot/pull/84173)). +- Fix `FastNoiseLite.get_image` crashes with bad param ([GH-84181](https://github.com/godotengine/godot/pull/84181)). +- Add comment why off-by-one error is hard to fix ([GH-84297](https://github.com/godotengine/godot/pull/84297)). +- Remove unused `NOTIFICATION_NODE_RECACHE_REQUESTED` notification ([GH-84419](https://github.com/godotengine/godot/pull/84419)). +- Keep Variant type after `zero()` ([GH-84597](https://github.com/godotengine/godot/pull/84597)). +- Make languages bookkeeping thread-safe ([GH-84657](https://github.com/godotengine/godot/pull/84657)). +- Fix crash when saving compressed image as JPG & WebP ([GH-84758](https://github.com/godotengine/godot/pull/84758)). +- Fix translation remapping check for imported resources ([GH-84791](https://github.com/godotengine/godot/pull/84791)). +- Let languages init & finish run without locks held ([GH-84847](https://github.com/godotengine/godot/pull/84847)). +- Fix `sizeof` usage for Variant pointers in `alloca` ([GH-84925](https://github.com/godotengine/godot/pull/84925)). +- Let scene replacement benefit from certain late pieces of frame logic ([GH-85184](https://github.com/godotengine/godot/pull/85184)). +- Prevent read-after-free in the queued CallableCustomStaticMethodPointer, fixes `slot >= slot_max` errors in release templates ([GH-85280](https://github.com/godotengine/godot/pull/85280)). + +#### Documentation + +- Document when to use `_unhandled_key_input` over `_unhandled_input` ([GH-42100](https://github.com/godotengine/godot/pull/42100)). +- Overhaul Rect2 & Rect2i Documentation ([GH-69816](https://github.com/godotengine/godot/pull/69816)). +- Improve documentation of `nearest_po2()` ([GH-72091](https://github.com/godotengine/godot/pull/72091)). +- Improve the top docs sections of VFX classes ([GH-78865](https://github.com/godotengine/godot/pull/78865)). +- Fix a typo in the `String.to_float` description ([GH-78989](https://github.com/godotengine/godot/pull/78989)). +- Fix a typo in the TLSOptions documentation ([GH-79048](https://github.com/godotengine/godot/pull/79048)). +- Doctool: Remove version attribute from XML header ([GH-79092](https://github.com/godotengine/godot/pull/79092)). +- Fix incorrect documentation for `Engine.get_architecture_name()` ([GH-79174](https://github.com/godotengine/godot/pull/79174)). +- Fix various typos in documentation ([GH-79223](https://github.com/godotengine/godot/pull/79223)). +- Fix rigid body `contact_monitor` property description ([GH-79250](https://github.com/godotengine/godot/pull/79250)). +- Add performance note for parsing source geometry ([GH-79252](https://github.com/godotengine/godot/pull/79252)). +- Clarify return value of `get_dependencies()` ([GH-79306](https://github.com/godotengine/godot/pull/79306)). +- Clarify `EditorExportPlugin::add_file` only remaps in `_export_file` ([GH-79310](https://github.com/godotengine/godot/pull/79310)). +- Fix documentation for consistency ([GH-79353](https://github.com/godotengine/godot/pull/79353)). +- Add detail to NavigationAgent signal descriptions ([GH-79401](https://github.com/godotengine/godot/pull/79401)). +- Fill in descriptions for import options in the class reference ([GH-79405](https://github.com/godotengine/godot/pull/79405)). +- Clarify the purpose of RichTextLabel text highlight padding ([GH-79571](https://github.com/godotengine/godot/pull/79571)). +- Clarify when the `changed` signal is emitted for `Resource` and `Material` ([GH-79656](https://github.com/godotengine/godot/pull/79656)). +- Fix many typos in documentation ([GH-79661](https://github.com/godotengine/godot/pull/79661)). +- Add detail to emitting docs for particles ([GH-79720](https://github.com/godotengine/godot/pull/79720)). +- Clarify `set_multiplayer_authority` documentation regarding propagation ([GH-79764](https://github.com/godotengine/godot/pull/79764)). +- Fix some mixups between 2D/3D in documentation ([GH-79781](https://github.com/godotengine/godot/pull/79781)). +- Update outdated C# code sample in `AStarGrid2D` documentation ([GH-79794](https://github.com/godotengine/godot/pull/79794)). +- Document `linear_stiffness` in SoftBody3D ([GH-79933](https://github.com/godotengine/godot/pull/79933)). +- Add note about mouse movement input events in `MouseFilter` constants ([GH-79934](https://github.com/godotengine/godot/pull/79934)). +- Update C# example of `tween_method` with a parameter to the lambda method ([GH-79962](https://github.com/godotengine/godot/pull/79962)). +- Avoid punning `[param enabled]` in documentation ([GH-80066](https://github.com/godotengine/godot/pull/80066)). +- Fix invalid use of markdown syntax in classref ([GH-80109](https://github.com/godotengine/godot/pull/80109)). +- Overhaul bool documentation ([GH-80141](https://github.com/godotengine/godot/pull/80141)). +- Fix packet details of ENetConnection `EventType` `EVENT_RECEIVE` documentation ([GH-80182](https://github.com/godotengine/godot/pull/80182)). +- Document that `Input.is_action_*` should not be used during input-handling ([GH-80185](https://github.com/godotengine/godot/pull/80185)). +- Revert incorrect `Rect2.expand` description ([GH-80217](https://github.com/godotengine/godot/pull/80217)). +- Fix various typos in classref ([GH-80243](https://github.com/godotengine/godot/pull/80243)). +- Fix wrong example output of `float*Color` in classref ([GH-80245](https://github.com/godotengine/godot/pull/80245)). +- Clarify relationship between `basis` and `transform` properties of `Node3D` ([GH-80254](https://github.com/godotengine/godot/pull/80254)). +- Clarify `SceneTree.current_scene` functionality ([GH-80264](https://github.com/godotengine/godot/pull/80264)). +- Consistency for NodePath doc code examples ([GH-80443](https://github.com/godotengine/godot/pull/80443)). +- Document `RenderingServer.get_video_adapter_name()` may report a fixed name ([GH-80445](https://github.com/godotengine/godot/pull/80445)). +- Fixed tiny spelling error in NavigationAgent2D docs ([GH-80474](https://github.com/godotengine/godot/pull/80474)). +- Fix example for `Object._set` documentation ([GH-80475](https://github.com/godotengine/godot/pull/80475)). +- Document behavior of the `application/config/version` project setting ([GH-80511](https://github.com/godotengine/godot/pull/80511)). +- Clarify the behavior of CSGMesh using ArrayMesh ([GH-80543](https://github.com/godotengine/godot/pull/80543)). +- Change documentation spelling of macOS key 'Command' to match guidelines ([GH-80567](https://github.com/godotengine/godot/pull/80567)). +- docs: Fix link to two's complement wiki page ([GH-80608](https://github.com/godotengine/godot/pull/80608)). +- Add missing tutorials to documentation classes ([GH-80653](https://github.com/godotengine/godot/pull/80653)). +- Clarify existence of groups ([GH-80677](https://github.com/godotengine/godot/pull/80677)). +- Document `pick_random` for empty arrays ([GH-80694](https://github.com/godotengine/godot/pull/80694)). +- Fix empty XML tag doc in XMLParser.xml ([GH-80698](https://github.com/godotengine/godot/pull/80698)). +- Add missing RenderingDevice method descriptions ([GH-80716](https://github.com/godotengine/godot/pull/80716)). +- Document mouse-picking limit of 64 objects ([GH-80875](https://github.com/godotengine/godot/pull/80875)). +- Fix various typos in classref ([GH-80884](https://github.com/godotengine/godot/pull/80884)). +- Clarify Array class methods that return error ([GH-80936](https://github.com/godotengine/godot/pull/80936)). +- Rephrase ConfigFile class methods error description ([GH-80970](https://github.com/godotengine/godot/pull/80970)). +- Improve XMLParser's documentation ([GH-80997](https://github.com/godotengine/godot/pull/80997)). +- Improve Line2D documentation ([GH-81084](https://github.com/godotengine/godot/pull/81084)). +- Add a note about `SceneTree.create_tween()` method ([GH-81087](https://github.com/godotengine/godot/pull/81087)). +- Improve `MeshDataTool.get_face_vertex()` method description ([GH-81088](https://github.com/godotengine/godot/pull/81088)). +- Improve `Object.get_property_list()` method description ([GH-81093](https://github.com/godotengine/godot/pull/81093)). +- Some grammar and punctuation enhancements in the class reference ([GH-81097](https://github.com/godotengine/godot/pull/81097)). +- Grammatical improvements for the RayCast 2D and 3D class references ([GH-81132](https://github.com/godotengine/godot/pull/81132)). +- Fix typo in WebRTCPeerConnection documentation ([GH-81157](https://github.com/godotengine/godot/pull/81157)). +- Document integer scaling functionality and limitation ([GH-81176](https://github.com/godotengine/godot/pull/81176)). +- Fix typos in NavigationAgent3D documentation ([GH-81190](https://github.com/godotengine/godot/pull/81190)). +- Fix misleading description of `MeshDataTool.get_vertex()` method ([GH-81212](https://github.com/godotengine/godot/pull/81212)). +- Use `[constant]` instead of `[code]` when possible ([GH-81228](https://github.com/godotengine/godot/pull/81228)). +- Fix typos in LineEdit documentation ([GH-81232](https://github.com/godotengine/godot/pull/81232)). +- docs: Update AABB `get_support` description ([GH-81249](https://github.com/godotengine/godot/pull/81249)). +- Improve canvas layer index documentation ([GH-81270](https://github.com/godotengine/godot/pull/81270)). +- Fix unmatched brackets in the documentation ([GH-81330](https://github.com/godotengine/godot/pull/81330)). +- Fix description of dock slot usage in the documentation ([GH-81445](https://github.com/godotengine/godot/pull/81445)). +- Document ScrollContainer signals being emitted for touch events only ([GH-81517](https://github.com/godotengine/godot/pull/81517)). +- Doc: Reference String <-> PackedByteArray conversions from each other ([GH-81564](https://github.com/godotengine/godot/pull/81564)). +- Fix typos in EditorDebuggerPlugin and RDShaderSPIRV classref ([GH-81565](https://github.com/godotengine/godot/pull/81565)). +- Add an example for `Dictionary.merge()`, mention lack of recursion ([GH-81622](https://github.com/godotengine/godot/pull/81622)). +- Add missing `is_deprecated` flag on the `SurfaceTool.generate_lod` function ([GH-81634](https://github.com/godotengine/godot/pull/81634)). +- Add note about format to splash image description ([GH-81672](https://github.com/godotengine/godot/pull/81672)). +- Add missing documentation for `Skeleton3D` methods ([GH-81697](https://github.com/godotengine/godot/pull/81697)). +- Improve VisibleOnScreen classes' docs ([GH-81774](https://github.com/godotengine/godot/pull/81774)). +- Fix required parameter values for 2D textures in `RenderingDevice.texture_clear()` ([GH-81936](https://github.com/godotengine/godot/pull/81936)). +- Fix example in gravity project settings doc ([GH-81967](https://github.com/godotengine/godot/pull/81967)). +- docs: Fix incorrect GL format code for 16 bit float formats ([GH-82050](https://github.com/godotengine/godot/pull/82050)). +- Fix documentation on how to get the keycode string from a `physical_keycode` ([GH-82092](https://github.com/godotengine/godot/pull/82092)). +- Docs: Update and sync Window and DisplayServer window mode descriptions ([GH-82179](https://github.com/godotengine/godot/pull/82179)). +- Document that `resource_name` is not always supported ([GH-82406](https://github.com/godotengine/godot/pull/82406)). +- Clarify difference between surface material and surface override material ([GH-82499](https://github.com/godotengine/godot/pull/82499)). +- Fix metadata name in MovieWriter.xml ([GH-82541](https://github.com/godotengine/godot/pull/82541)). +- Improve SeparationRayShape docs ([GH-82544](https://github.com/godotengine/godot/pull/82544)). +- Fix `RefCounted.unreference()` documentation providing wrong info ([GH-82557](https://github.com/godotengine/godot/pull/82557)). +- Document `get_time_zone_from_system` will return a localized timezone name ([GH-82609](https://github.com/godotengine/godot/pull/82609)). +- Improve `NavigationAgent3D.target_position` documentation readability ([GH-82671](https://github.com/godotengine/godot/pull/82671)). +- Add docs for Node3DGizmo to clarify its link to EditorNode3DGizmo ([GH-82681](https://github.com/godotengine/godot/pull/82681)). +- Clarify `AStarGrid2D.is_in_bounds` functionality ([GH-82724](https://github.com/godotengine/godot/pull/82724)). +- Fix typos in documentation: `than/then` and `loose/lose` ([GH-82748](https://github.com/godotengine/godot/pull/82748)). +- Add a recommendation to turn on type hints with untyped declaration warning ([GH-82801](https://github.com/godotengine/godot/pull/82801)). +- Clarify `change_dir()` and access scopes ([GH-82849](https://github.com/godotengine/godot/pull/82849)). +- Specify the behavior of `get_tree()` when the node is not in the scene tree ([GH-82863](https://github.com/godotengine/godot/pull/82863)). +- Added docs for DRAW_ORDER_REVERSE_LIFETIME constant and minor XR log improvement ([GH-82866](https://github.com/godotengine/godot/pull/82866)). +- Fixed a missing word ([GH-82883](https://github.com/godotengine/godot/pull/82883)). +- Add `sdf_collision` property description to LightOccluder2D ([GH-82906](https://github.com/godotengine/godot/pull/82906)). +- Explain circular references and how to break them ([GH-82942](https://github.com/godotengine/godot/pull/82942)). +- Update `draw_polyline` documentation to clarify negative width behavior ([GH-82991](https://github.com/godotengine/godot/pull/82991)). +- Add documentation on which buttons JOY_BUTTON_START corresponds to ([GH-83013](https://github.com/godotengine/godot/pull/83013)). +- Update SpinBox documentation to include resetting to min/max behavior ([GH-83038](https://github.com/godotengine/godot/pull/83038)). +- Add semicolon to OS documentation case statement ([GH-83066](https://github.com/godotengine/godot/pull/83066)). +- Cleanup various repository documentation files ([GH-83095](https://github.com/godotengine/godot/pull/83095)). +- Make error suggestion less ambiguous ([GH-83327](https://github.com/godotengine/godot/pull/83327)). +- Document UID behavior in ResourceSaver's save function ([GH-83388](https://github.com/godotengine/godot/pull/83388)). +- Docs: Fix link to Android Gradle build tutorial ([GH-83433](https://github.com/godotengine/godot/pull/83433)). +- Document `AudioStreamGeneratorPlayback.get_skips()` ([GH-83435](https://github.com/godotengine/godot/pull/83435)). +- Fix description of `Animation::copy_track` ([GH-83441](https://github.com/godotengine/godot/pull/83441)). +- Clarify docs for operators performing `xform_inv` ([GH-83461](https://github.com/godotengine/godot/pull/83461)). +- Doc: Change return type of `_Set` method from `void` to `bool` in C# code example ([GH-83602](https://github.com/godotengine/godot/pull/83602)). +- Fix Object class C# syntax error ([GH-83609](https://github.com/godotengine/godot/pull/83609)). +- Clarify `NOTIFICATION_SCROLL_BEGIN/END` behavior ([GH-83636](https://github.com/godotengine/godot/pull/83636)). +- Fill remaining global scope constant descriptions ([GH-83652](https://github.com/godotengine/godot/pull/83652)). +- ProjectSettings: Fix description of physics jitter ([GH-83768](https://github.com/godotengine/godot/pull/83768)). +- Add C# Example to ImmediateMesh.xml ([GH-83839](https://github.com/godotengine/godot/pull/83839)). +- Improve documentation related for particle subemitters, collision and attractors ([GH-83916](https://github.com/godotengine/godot/pull/83916)). +- Fill out Material documentation and clarify `render_priority` and `next_pass` sorting ([GH-83931](https://github.com/godotengine/godot/pull/83931)). +- Fixed `window_width_override` description ([GH-84101](https://github.com/godotengine/godot/pull/84101)). +- Fix typo in ConcavePolygonShape2D/3D description ([GH-84111](https://github.com/godotengine/godot/pull/84111)). +- Add missing word in `NOTIFICATION_POST_ENTER_TREE` documentation ([GH-84224](https://github.com/godotengine/godot/pull/84224)). +- Fix documentation in MultiplayerAPIExtension ([GH-84226](https://github.com/godotengine/godot/pull/84226)). +- Add a description for the `velocity_pivot` parameter ([GH-84276](https://github.com/godotengine/godot/pull/84276)). +- Update `add_submenu_item` doc to mention that submenu should already exist ([GH-84283](https://github.com/godotengine/godot/pull/84283)). +- Clarify that `get_time_zone_from_system` will return a localized timezone name ([GH-84301](https://github.com/godotengine/godot/pull/84301)). +- Fix sentence in RandomNumberGenerator.xml ([GH-84322](https://github.com/godotengine/godot/pull/84322)). +- Update the description for the `InputEventMagnifyGesture` and `InputEventPanGesture` gestures ([GH-84408](https://github.com/godotengine/godot/pull/84408)). +- Sync changes between ShapeCast and RayCast class references ([GH-84567](https://github.com/godotengine/godot/pull/84567)). +- Resolve collisions in reference anchors added for methods ([GH-84618](https://github.com/godotengine/godot/pull/84618)). +- Add C# example for the AudioStreamGenerator code snippet ([GH-84648](https://github.com/godotengine/godot/pull/84648)). +- Remove a redundant semicolon from `max_fps` documentation ([GH-84667](https://github.com/godotengine/godot/pull/84667)). +- Clarify that `DisplayServer.window_set_*_callback` aren't supported on Window nodes ([GH-84669](https://github.com/godotengine/godot/pull/84669)). +- Fix link in the docs about ResourceImporterTextureAtlas ([GH-84698](https://github.com/godotengine/godot/pull/84698)). +- Fix a property reference in `EditorSpinSlider` documentation ([GH-84709](https://github.com/godotengine/godot/pull/84709)). +- Fix typo in `TextureServer.font_get_face_index()` description ([GH-84784](https://github.com/godotengine/godot/pull/84784)). +- Link to runtime loading/saving tutorial and improve Image documentation ([GH-84844](https://github.com/godotengine/godot/pull/84844)). +- Mark `SubViewportContainer::_propagate_input_event` experimental ([GH-84911](https://github.com/godotengine/godot/pull/84911)). +- Fix translation po file not found when `make rst LANGARG=zh_CN` ([GH-85073](https://github.com/godotengine/godot/pull/85073)). +- Enhance `SceneTree.change_scene*()` methods' docs ([GH-85279](https://github.com/godotengine/godot/pull/85279)). +- Add changelog for Godot 4.2 ([GH-85510](https://github.com/godotengine/godot/pull/85509)). #### Editor -- Fix "View Owners" dialog not acknowledging that some resources aren't scenes ([GH-68697](https://github.com/godotengine/godot/pull/68697)). -- Fix typed array export ([GH-73256](https://github.com/godotengine/godot/pull/73256)). -- Various fixes to the 3-to-4 project conversion tool ([GH-75002](https://github.com/godotengine/godot/pull/75002), [GH-75900](https://github.com/godotengine/godot/pull/75900), [GH-77615](https://github.com/godotengine/godot/pull/77615), [GH-78097](https://github.com/godotengine/godot/pull/78097)). -- Prevent quoted args in `editor/main_run_args` from being split at spaces ([GH-75444](https://github.com/godotengine/godot/pull/75444)). -- Fix connect signal dialog not allowing Unicode method name ([GH-75814](https://github.com/godotengine/godot/pull/75814)). -- Avoid error spam on first opening of a not yet imported project ([GH-77276](https://github.com/godotengine/godot/pull/77276)). -75900), [GH-77615](https://github.com/godotengine/godot/pull/77615), [GH-78097](https://github.com/godotengine/godot/pull/78097)). +- Replace all flags with one value when holding Ctrl/Cmd in the layers editor ([GH-39364](https://github.com/godotengine/godot/pull/39364)). +- Improve `CodeEdit`'s toggle comments behavior ([GH-44557](https://github.com/godotengine/godot/pull/44557)). +- Document editor import options in the class reference ([GH-49524](https://github.com/godotengine/godot/pull/49524)). +- Reorganize buttons in the project manager ([GH-50674](https://github.com/godotengine/godot/pull/50674)). +- Streamline the project import workflow ([GH-51478](https://github.com/godotengine/godot/pull/51478)). +- Focus current node after connecting ([GH-54071](https://github.com/godotengine/godot/pull/54071)). +- Allow enter key to add properties to replication editor list ([GH-65558](https://github.com/godotengine/godot/pull/65558)). +- Add editor setting to toggle automatic code completion ([GH-68140](https://github.com/godotengine/godot/pull/68140)). +- Replace Ctrl in editor shortcuts with Cmd or Ctrl depending on platform ([GH-71905](https://github.com/godotengine/godot/pull/71905)). +- Overhaul the Gradient Editor ([GH-71915](https://github.com/godotengine/godot/pull/71915)). +- Don't save scripts when exiting editor ([GH-73641](https://github.com/godotengine/godot/pull/73641)). +- Fix Filter Files shortcut input is not properly handled ([GH-73981](https://github.com/godotengine/godot/pull/73981)). +- Fix conversion of hex color strings in project converter ([GH-74026](https://github.com/godotengine/godot/pull/74026)). +- Add coloring for completion of vector components ([GH-74809](https://github.com/godotengine/godot/pull/74809)). +- Expose 'Reimport' on right-click context menu in the FileSystem panel ([GH-75137](https://github.com/godotengine/godot/pull/75137)). +- Added `--gpu-index` to `forwardable_cli_arguments` ([GH-75198](https://github.com/godotengine/godot/pull/75198)). +- Enhance NodePath property editing ([GH-75274](https://github.com/godotengine/godot/pull/75274)). +- Ensure binds are duplicated with `Node` signals ([GH-75382](https://github.com/godotengine/godot/pull/75382)). +- Make `EditorInterface` accessible as a singleton ([GH-75694](https://github.com/godotengine/godot/pull/75694)). +- Apply new input validation method for Create Plugin dialog ([GH-76778](https://github.com/godotengine/godot/pull/76778)). +- Expose `save_all_scenes` method to EditorInterface ([GH-77537](https://github.com/godotengine/godot/pull/77537)). +- Increase vertical size of `CurveEdit` when `Inspector` widens ([GH-77625](https://github.com/godotengine/godot/pull/77625)). +- Allow to pick which Resources will be made unique ([GH-77855](https://github.com/godotengine/godot/pull/77855)). +- Fix batch rename for unique name and empty name ([GH-78292](https://github.com/godotengine/godot/pull/78292)). +- Change light themes default contrast from -0.08 to -0.06 ([GH-78297](https://github.com/godotengine/godot/pull/78297)). +- Auto-update properties when replacing a node ([GH-78300](https://github.com/godotengine/godot/pull/78300)). +- Only display 15 nodes in the Recent section of the Create New Node dialog ([GH-78309](https://github.com/godotengine/godot/pull/78309)). +- Fix tooltip of enum value without description ([GH-78524](https://github.com/godotengine/godot/pull/78524)). +- Speed up closing multiple scripts ([GH-78604](https://github.com/godotengine/godot/pull/78604)). +- Re-enable docs cache with fixes ([GH-78615](https://github.com/godotengine/godot/pull/78615)). +- Use bullet points in shader editor creation dialog ([GH-78631](https://github.com/godotengine/godot/pull/78631)). +- Tweak documentation to use bold font when a class is referencing itself ([GH-78649](https://github.com/godotengine/godot/pull/78649)). +- Fix indentation in script templates ([GH-78675](https://github.com/godotengine/godot/pull/78675)). +- Standardize dialog input validation as a new class ([GH-78744](https://github.com/godotengine/godot/pull/78744)). +- Sort project tags before saving ([GH-78775](https://github.com/godotengine/godot/pull/78775)). +- Project converter: Use same rendering driver as Project Manager ([GH-78795](https://github.com/godotengine/godot/pull/78795)). +- Fix drag-dropping nodes to parent with internal nodes ([GH-78816](https://github.com/godotengine/godot/pull/78816)). +- Fix history mismatch ([GH-78827](https://github.com/godotengine/godot/pull/78827)). +- Improve material and mesh preview buttons ([GH-78858](https://github.com/godotengine/godot/pull/78858)). +- Add icons for 3D texture classes ([GH-78903](https://github.com/godotengine/godot/pull/78903)). +- Fix dropping files from `res://` to `res://` ([GH-78914](https://github.com/godotengine/godot/pull/78914)). +- Do not change a node unique name to the same name ([GH-78925](https://github.com/godotengine/godot/pull/78925)). +- Translate "No match" message in FindReplaceBar ([GH-78938](https://github.com/godotengine/godot/pull/78938)). +- Windows: Always double-quote path when launching explorer.exe to browse ([GH-78963](https://github.com/godotengine/godot/pull/78963)). +- [Terminal Output] Reset text properties after `print_rich` ([GH-79017](https://github.com/godotengine/godot/pull/79017)). +- Fix missing arrows in integer vector properties ([GH-79021](https://github.com/godotengine/godot/pull/79021)). +- Optimize SVG icons and remove unused Transpose icon ([GH-79062](https://github.com/godotengine/godot/pull/79062)). +- Collapse bottom panel if there is no active tab ([GH-79078](https://github.com/godotengine/godot/pull/79078)). +- Fix `ui_cancel` action not closing `FindReplaceBar` ([GH-79079](https://github.com/godotengine/godot/pull/79079)). +- Add tooltip description wrapping in scene tree and plugin settings ([GH-79090](https://github.com/godotengine/godot/pull/79090)). +- Improve user-friendliness of project version mismatch message ([GH-79118](https://github.com/godotengine/godot/pull/79118)). +- Optimize Variant icons and a few others ([GH-79161](https://github.com/godotengine/godot/pull/79161)). +- Don't grab theme icons for scripts ([GH-79203](https://github.com/godotengine/godot/pull/79203)). +- Show only compatible nodes in 'Select a node' window ([GH-79213](https://github.com/godotengine/godot/pull/79213)). +- Assume root when dropping node to unassigned script ([GH-79258](https://github.com/godotengine/godot/pull/79258)). +- Keep `GraphNode` port icons crisp at high zoom levels and remove artifacts ([GH-79262](https://github.com/godotengine/godot/pull/79262)). +- Hide/show `AcceptDialog`'s button spacer on button visibility changed ([GH-79274](https://github.com/godotengine/godot/pull/79274)). +- Change explicit 'Godot 4.0' references to 'Godot 4' ([GH-79277](https://github.com/godotengine/godot/pull/79277)). +- Fix dragged nodes icon size ([GH-79283](https://github.com/godotengine/godot/pull/79283)). +- Improve text in popup warning, remove "upgrade or downgrade" text ([GH-79299](https://github.com/godotengine/godot/pull/79299)). +- Allow adding a custom side menu to EditorFileDialog ([GH-79313](https://github.com/godotengine/godot/pull/79313)). +- Make indentation indicators translatable ([GH-79358](https://github.com/godotengine/godot/pull/79358)). +- Improve signal callback generation ([GH-79366](https://github.com/godotengine/godot/pull/79366)). +- Add missing word to text of the alert dialog ([GH-79381](https://github.com/godotengine/godot/pull/79381)). +- Disable irrelevant scene tab context menu items ([GH-79382](https://github.com/godotengine/godot/pull/79382)). +- Don't use splash minimum display time in editor ([GH-79388](https://github.com/godotengine/godot/pull/79388)). +- Include display server type in "Copy System Info" ([GH-79396](https://github.com/godotengine/godot/pull/79396)). +- Fix rendering driver in Copy System Info for the Compatibility rendering method ([GH-79416](https://github.com/godotengine/godot/pull/79416)). +- Add icons to some placeholder classes ([GH-79431](https://github.com/godotengine/godot/pull/79431)). +- Hide explicitly specified flag value in Inspector ([GH-79457](https://github.com/godotengine/godot/pull/79457)). +- Add a shortcut to paste nodes as sibling of the selected node ([GH-79467](https://github.com/godotengine/godot/pull/79467)). +- Emit `history_changed` on merged UndoRedo actions ([GH-79484](https://github.com/godotengine/godot/pull/79484)). +- Show valid types in SceneTreeDialog ([GH-79593](https://github.com/godotengine/godot/pull/79593)). +- Fix wrong Curve connection ([GH-79609](https://github.com/godotengine/godot/pull/79609)). +- Add Ctrl+/ as a shortcut to toggle comment in addition to Ctrl+K ([GH-79610](https://github.com/godotengine/godot/pull/79610)). +- Make Help.svg not look disabled ([GH-79613](https://github.com/godotengine/godot/pull/79613)). +- Avoid duplicating the "Filters" section ([GH-79650](https://github.com/godotengine/godot/pull/79650)). +- Fix arg count checks in `SceneDebugger` ([GH-79655](https://github.com/godotengine/godot/pull/79655)). +- Add placeholder items to TileSet layer list ([GH-79676](https://github.com/godotengine/godot/pull/79676)). +- Change the text for the flat button preview to follow pattern ([GH-79734](https://github.com/godotengine/godot/pull/79734)). +- Fix typo in ResourceImporterImageFont ([GH-79736](https://github.com/godotengine/godot/pull/79736)). +- In Create New Scene dialog derive the default root node name based on `editor/naming/node_name_casing` ([GH-79756](https://github.com/godotengine/godot/pull/79756)). +- Make the single window mode check more strict ([GH-79793](https://github.com/godotengine/godot/pull/79793)). +- Make blend file importer warnings translatable ([GH-79807](https://github.com/godotengine/godot/pull/79807)). +- Fix undo methods for DELETE in EditorAutoloadSettings ([GH-79832](https://github.com/godotengine/godot/pull/79832)). +- Fix usability issues with scene tabs ([GH-79852](https://github.com/godotengine/godot/pull/79852)). +- Add tooltips to the plugin editor creation dialog ([GH-79891](https://github.com/godotengine/godot/pull/79891)). +- Fix spacing between icon and "Output" button ([GH-79908](https://github.com/godotengine/godot/pull/79908)). +- Fix crash when using "Close All Tabs" ([GH-79917](https://github.com/godotengine/godot/pull/79917)). +- Automatically add path to built-in scripts ([GH-79920](https://github.com/godotengine/godot/pull/79920)). +- Sort system font menu in Inspector ([GH-79928](https://github.com/godotengine/godot/pull/79928)). +- Fix out of bounds access when updating current scene ([GH-79945](https://github.com/godotengine/godot/pull/79945)). +- Uncollapse favorites by default in the editor FileSystem dock ([GH-79971](https://github.com/godotengine/godot/pull/79971)). +- Reverse condition for skipping directories ([GH-79984](https://github.com/godotengine/godot/pull/79984)). +- Fix escaping issues with POT generator ([GH-80058](https://github.com/godotengine/godot/pull/80058)). +- Fix API hash related crash in `EditorSettings` ([GH-80089](https://github.com/godotengine/godot/pull/80089)). +- Add UndoRedo icon ([GH-80102](https://github.com/godotengine/godot/pull/80102)). +- Add FileAccess and DirAccess icons ([GH-80103](https://github.com/godotengine/godot/pull/80103)). +- Add path to missing import texture metadata to error message ([GH-80107](https://github.com/godotengine/godot/pull/80107)). +- Add an icon to the Performance object ([GH-80113](https://github.com/godotengine/godot/pull/80113)). +- Optimize and fix up some SVGs ([GH-80119](https://github.com/godotengine/godot/pull/80119)). +- Add ShaderInclude class icon ([GH-80129](https://github.com/godotengine/godot/pull/80129)). +- Use the gray color for all abstract classes ([GH-80184](https://github.com/godotengine/godot/pull/80184)). +- Horizontal split view for Filesystem Dock ([GH-80241](https://github.com/godotengine/godot/pull/80241)). +- Fix menu items that trigger secondary interface missing ellipsis ([GH-80355](https://github.com/godotengine/godot/pull/80355)). +- Improve Signal Dock for script classes ([GH-80411](https://github.com/godotengine/godot/pull/80411)). +- Add custom color support to project folders ([GH-80440](https://github.com/godotengine/godot/pull/80440)). +- [Editor Log] Clear rich print tags only after the last line ([GH-80476](https://github.com/godotengine/godot/pull/80476)). +- Extract editor scene tabs into their own component ([GH-80490](https://github.com/godotengine/godot/pull/80490)). +- Fixes Scene corruption when child scene is renamed in another directory ([GH-80503](https://github.com/godotengine/godot/pull/80503)). +- Avoid unnecessary inspector updates when loading or switching scenes ([GH-80517](https://github.com/godotengine/godot/pull/80517)). +- Add EditorStringNames singleton ([GH-80573](https://github.com/godotengine/godot/pull/80573)). +- Add CurveXYZTexture icon ([GH-80598](https://github.com/godotengine/godot/pull/80598)). +- Fix crash on exit where `TileSet` calls destroyed `TileSetAtlasSourceEditor` ([GH-80607](https://github.com/godotengine/godot/pull/80607)). +- Fix `TileMapEditorPlugin` crash by storing tilemap ID instead of pointer ([GH-80610](https://github.com/godotengine/godot/pull/80610)). +- Add PortableCompressedTexture2D icon ([GH-80659](https://github.com/godotengine/godot/pull/80659)). +- Make the NavigationAgent3D icon more readable ([GH-80661](https://github.com/godotengine/godot/pull/80661)). +- Recurse into resources to check for changed node paths ([GH-80721](https://github.com/godotengine/godot/pull/80721)). +- Add a RegEx icon ([GH-80724](https://github.com/godotengine/godot/pull/80724)). +- Don't cache script signal descriptions ([GH-80726](https://github.com/godotengine/godot/pull/80726)). +- Disable translation of root name on scene creation ([GH-80811](https://github.com/godotengine/godot/pull/80811)). +- Avoid creating any useless undo action when dragging nodes in place ([GH-80817](https://github.com/godotengine/godot/pull/80817)). +- Unedit nodes early when closing scene tab ([GH-80849](https://github.com/godotengine/godot/pull/80849)). +- Save "Show Built-In Actions" state to project metadata ([GH-80879](https://github.com/godotengine/godot/pull/80879)). +- Differentiate between core and editor-only singletons ([GH-80962](https://github.com/godotengine/godot/pull/80962)). +- Cleanup some `GLOBAL_DEF`s ([GH-80972](https://github.com/godotengine/godot/pull/80972)). +- Add a property hint range to Auto Refresh Interval editor setting ([GH-80975](https://github.com/godotengine/godot/pull/80975)). +- Display time of last save in the unsaved changes confirmation editor dialog ([GH-80976](https://github.com/godotengine/godot/pull/80976)). +- Fix paste value emptying an array on some right click location ([GH-80977](https://github.com/godotengine/godot/pull/80977)). +- Move the new RegEx icons into their respective module ([GH-80998](https://github.com/godotengine/godot/pull/80998)). +- FileSystemDock: Don't update current path on rename when file list has focus ([GH-81007](https://github.com/godotengine/godot/pull/81007)). +- Improve warnings when running scripts in the editor ([GH-81022](https://github.com/godotengine/godot/pull/81022)). +- Properly remember custom text color in scene tree ([GH-81061](https://github.com/godotengine/godot/pull/81061)). +- Fix Quick Open not opening binary resources ([GH-81068](https://github.com/godotengine/godot/pull/81068)). +- Refactor disabling scene tab context menu options ([GH-81072](https://github.com/godotengine/godot/pull/81072)). +- Prevent creating any type of file with a leading dot ([GH-81075](https://github.com/godotengine/godot/pull/81075)). +- Signal Connection Dock improvements ([GH-81092](https://github.com/godotengine/godot/pull/81092)). +- Fix a crash when built-in script is not saved and have syntax error ([GH-81156](https://github.com/godotengine/godot/pull/81156)). +- Use `ui_text_submit` instead of `ui_accept` to confirm and close text prompts ([GH-81189](https://github.com/godotengine/godot/pull/81189)). +- Inspector and Signal docks improvements ([GH-81221](https://github.com/godotengine/godot/pull/81221)). +- Fix `EditorFileDialog` clears the file name on changing directory ([GH-81226](https://github.com/godotengine/godot/pull/81226)). +- Fix clamping logic in `EditorSpinSlider` ([GH-81278](https://github.com/godotengine/godot/pull/81278)). +- Show doc tooltips when hovering properties in the theme editor ([GH-81284](https://github.com/godotengine/godot/pull/81284)). +- Change precedence in rules to make location after proper casing ([GH-81304](https://github.com/godotengine/godot/pull/81304)). +- Fix TextFile not reloading when changed from external editors ([GH-81319](https://github.com/godotengine/godot/pull/81319)). +- Check the native base of scripts when resolving icons ([GH-81336](https://github.com/godotengine/godot/pull/81336)). +- Fix saving editor folder colors ([GH-81344](https://github.com/godotengine/godot/pull/81344)). +- Avoid text substitution in EditorHelp messages ([GH-81346](https://github.com/godotengine/godot/pull/81346)). +- Update folder colors when moving or renaming ([GH-81380](https://github.com/godotengine/godot/pull/81380)). +- Rearrange "Main Menu > Help" items ([GH-81399](https://github.com/godotengine/godot/pull/81399)). +- Remove leftover debug print in `FileSystemDock` ([GH-81407](https://github.com/godotengine/godot/pull/81407)). +- Fix property array tooltip shows wrong ID on later pages ([GH-81408](https://github.com/godotengine/godot/pull/81408)). +- Fix bugs of copying scene root node or pasting node as scene root ([GH-81415](https://github.com/godotengine/godot/pull/81415)). +- Expose `EditorInspector::get_edited_object` to GDScript ([GH-81425](https://github.com/godotengine/godot/pull/81425)). +- Fix unexpected behaviors of using Duplicate To on folders ([GH-81437](https://github.com/godotengine/godot/pull/81437)). +- Fix FindReplaceBar losing focus too early ([GH-81450](https://github.com/godotengine/godot/pull/81450)). +- Ignore empty lines when uncommenting code ([GH-81486](https://github.com/godotengine/godot/pull/81486)). +- SceneTreeDock: Avoid changing the currently edited object when attaching a script ([GH-81510](https://github.com/godotengine/godot/pull/81510)). +- Allow contextual plugins to persist temporarily ([GH-81523](https://github.com/godotengine/godot/pull/81523)). +- Improve undo action names ([GH-81569](https://github.com/godotengine/godot/pull/81569)). +- Make editor support `--fullscreen` command-line argument ([GH-81608](https://github.com/godotengine/godot/pull/81608)). +- Add XML files to default TextFile extensions in the editor ([GH-81625](https://github.com/godotengine/godot/pull/81625)). +- Avoid resetting the code completion popup excessively ([GH-81633](https://github.com/godotengine/godot/pull/81633)). +- Fix dependency handling on move or rename in the filesystem dock ([GH-81657](https://github.com/godotengine/godot/pull/81657)). +- Don't paste nodes as sibling of scene root ([GH-81673](https://github.com/godotengine/godot/pull/81673)). +- Clarify filtering by node type and group in the Scene tree dock ([GH-81675](https://github.com/godotengine/godot/pull/81675)). +- Create a field when Ctrl-dropping a resource into the code editor ([GH-81708](https://github.com/godotengine/godot/pull/81708)). +- Make LineEdit secret character easier to change and enter ([GH-81724](https://github.com/godotengine/godot/pull/81724)). +- Fix folder moving in file system dock ([GH-81725](https://github.com/godotengine/godot/pull/81725)). +- Fix internal `CONNECT_INHERITED` being saved in PackedScene & Make Local ([GH-81737](https://github.com/godotengine/godot/pull/81737)). +- Fix Connection dock's popups always allowing disconnect ([GH-81750](https://github.com/godotengine/godot/pull/81750)). +- Change icon for position key ([GH-81751](https://github.com/godotengine/godot/pull/81751)). +- Add Ctrl+P as shortcut to quick open files in addition to Shift+Alt+O ([GH-81770](https://github.com/godotengine/godot/pull/81770)). +- Make editor camera speed indicator use `m/s` and `m` ([GH-81810](https://github.com/godotengine/godot/pull/81810)). +- Fix grayed out paint icons ([GH-81813](https://github.com/godotengine/godot/pull/81813)). +- Add CanvasTexture icon ([GH-81834](https://github.com/godotengine/godot/pull/81834)). +- Make UIDs clickable in the script editor ([GH-81927](https://github.com/godotengine/godot/pull/81927)). +- Improve the Torus icons ([GH-81978](https://github.com/godotengine/godot/pull/81978)). +- While dragging files don't move not selected cursor item in filesystem-dock ([GH-82045](https://github.com/godotengine/godot/pull/82045)). +- Revamp how documentation tooltips work ([GH-82051](https://github.com/godotengine/godot/pull/82051)). +- Fix several issues with renaming in FileSystem dock ([GH-82075](https://github.com/godotengine/godot/pull/82075)). +- Fix skeleton 3d editor's toolbar ui deleted from wrong container ([GH-82131](https://github.com/godotengine/godot/pull/82131)). +- Fix leak when calling `remove_control_from_menu_panel` ([GH-82171](https://github.com/godotengine/godot/pull/82171)). +- Fix CurveEdit crash when dragging the curve if it is null ([GH-82181](https://github.com/godotengine/godot/pull/82181)). +- Add call validation to CommandPalette ([GH-82194](https://github.com/godotengine/godot/pull/82194)). +- Remove the separator from ItemList's thumbnails mode ([GH-82236](https://github.com/godotengine/godot/pull/82236)). +- Fix missing dependency warning popup ([GH-82244](https://github.com/godotengine/godot/pull/82244)). +- Fix can't unset exported typed array element when the type is set to Node ([GH-82287](https://github.com/godotengine/godot/pull/82287)). +- Fix ScriptCreateDialog not accepting on submit ([GH-82328](https://github.com/godotengine/godot/pull/82328)). +- Add error checks for DirAccess creation ([GH-82347](https://github.com/godotengine/godot/pull/82347)). +- Color match editor log toggles and flat pressed buttons ([GH-82365](https://github.com/godotengine/godot/pull/82365)). +- Fix submenus deleted accidentally ([GH-82371](https://github.com/godotengine/godot/pull/82371)). +- Fix leak when closing theme editor preview tabs ([GH-82442](https://github.com/godotengine/godot/pull/82442)). +- Make terrains peering bit property names translatable ([GH-82509](https://github.com/godotengine/godot/pull/82509)). +- Don't remove favorite files in EditorFileDialog ([GH-82537](https://github.com/godotengine/godot/pull/82537)). +- Use theme icon size when calculating category minimum size ([GH-82540](https://github.com/godotengine/godot/pull/82540)). +- Add more context to some `Window` errors ([GH-82590](https://github.com/godotengine/godot/pull/82590)). +- "Whole Words" search can detect word boundaries inside the search term ([GH-82694](https://github.com/godotengine/godot/pull/82694)). +- Search terms are now highlighted when the bar opens with a selection ([GH-82707](https://github.com/godotengine/godot/pull/82707)). +- Fix node icons appearing too big in some cases ([GH-82728](https://github.com/godotengine/godot/pull/82728)). +- Fix loading floating dock layout ([GH-82742](https://github.com/godotengine/godot/pull/82742)). +- Removes extents to size conversion ([GH-82754](https://github.com/godotengine/godot/pull/82754)). +- Fix checking the visibility condition of selected file in the Godot editor's dock ([GH-82806](https://github.com/godotengine/godot/pull/82806)). +- Fix unsaved changes not getting discarded ([GH-82847](https://github.com/godotengine/godot/pull/82847)). +- Provide translation strings for folder colors ([GH-82858](https://github.com/godotengine/godot/pull/82858)). +- Fix debugger behavior with multi-session debugging ([GH-82868](https://github.com/godotengine/godot/pull/82868)). +- Disable disconnect button for inherited signals ([GH-82875](https://github.com/godotengine/godot/pull/82875)). +- Fix garbled text in editor toasters ([GH-82913](https://github.com/godotengine/godot/pull/82913)). +- Don't apply frame delay project setting to the editor ([GH-82929](https://github.com/godotengine/godot/pull/82929)). +- Tweak metadata property tooltip to avoid being misleading ([GH-82940](https://github.com/godotengine/godot/pull/82940)). +- Fix dependency menu not showing up if scene failed to load ([GH-83024](https://github.com/godotengine/godot/pull/83024)). +- Fix `EditorFileSystemDirectory::get_file_deps()` may return wrong result ([GH-83081](https://github.com/godotengine/godot/pull/83081)). +- Fix some issues with `EditorHelpTooltip` ([GH-83094](https://github.com/godotengine/godot/pull/83094)). +- Fix highlight rect in "Whole search" being slightly offset ([GH-83101](https://github.com/godotengine/godot/pull/83101)). +- Don't auto translate theme type list ([GH-83177](https://github.com/godotengine/godot/pull/83177)). +- Project Manager: Open project when "Enter" is pressed when the search box is focused ([GH-83210](https://github.com/godotengine/godot/pull/83210)). +- Disable port name auto translation in Visual Shader editor ([GH-83233](https://github.com/godotengine/godot/pull/83233)). +- Fix saving wrong edited scene state when switching scene tabs ([GH-83251](https://github.com/godotengine/godot/pull/83251)). +- Don't try updating wrong NodePaths in resources ([GH-83263](https://github.com/godotengine/godot/pull/83263)). +- Keep focus on floating window when showing ProgressDialog ([GH-83290](https://github.com/godotengine/godot/pull/83290)). +- Fix FindReplaceBar focus problems ([GH-83335](https://github.com/godotengine/godot/pull/83335)). +- Remove toggling of unique names in subscenes ([GH-83370](https://github.com/godotengine/godot/pull/83370)). +- Fix multiple comment delimiter break toggle comment shortcut ([GH-83382](https://github.com/godotengine/godot/pull/83382)). +- Disallow 'Make Local' command on inherited nodes ([GH-83386](https://github.com/godotengine/godot/pull/83386)). +- Disable "Edit Transitions..." item if no animations are present ([GH-83402](https://github.com/godotengine/godot/pull/83402)). +- Set `icon_max_width` in the ConnectionsDock tree ([GH-83447](https://github.com/godotengine/godot/pull/83447)). +- Fix close button in FindReplaceBar ([GH-83459](https://github.com/godotengine/godot/pull/83459)). +- Prevent crash when creating custom file tooltip ([GH-83487](https://github.com/godotengine/godot/pull/83487)). +- Mesh instance UV2 unwrapping improvements ([GH-83498](https://github.com/godotengine/godot/pull/83498)). +- Fix StringName leaks in GDExtension, core, and editor themes ([GH-83562](https://github.com/godotengine/godot/pull/83562)). +- Enable new addon after hiding ProjectSettings ([GH-83576](https://github.com/godotengine/godot/pull/83576)). +- Fix ownership bugs in node copy and pasting ([GH-83596](https://github.com/godotengine/godot/pull/83596)). +- Support duplication of foreign nodes ([GH-83597](https://github.com/godotengine/godot/pull/83597)). +- Fix crash on recovered orphaned nodes ([GH-83604](https://github.com/godotengine/godot/pull/83604)). +- Fix StringName leaks in VariantParser ([GH-83619](https://github.com/godotengine/godot/pull/83619)). +- Improve threading in ClassDB and EditorHelp ([GH-83695](https://github.com/godotengine/godot/pull/83695)). +- Fix wrong shader rename in 3-to-4 project converter ([GH-83708](https://github.com/godotengine/godot/pull/83708)). +- Clamp the height of description text for property selectors ([GH-83745](https://github.com/godotengine/godot/pull/83745)). +- Fix "as" capitalization in editor strings ([GH-83815](https://github.com/godotengine/godot/pull/83815)). +- Remove margins from editor scrollbars ([GH-83868](https://github.com/godotengine/godot/pull/83868)). +- Fix potential crash on failed move ([GH-83937](https://github.com/godotengine/godot/pull/83937)). +- Use Hashset for dependency list when moving ([GH-83941](https://github.com/godotengine/godot/pull/83941)). +- Limit custom icons size in various editor widgets ([GH-84011](https://github.com/godotengine/godot/pull/84011)). +- Add read-only info to resource embedded in other scenes ([GH-84048](https://github.com/godotengine/godot/pull/84048)). +- Ignore path error for built-in scripts/shaders ([GH-84077](https://github.com/godotengine/godot/pull/84077)). +- Change dropdown type filter from Texture to Texture2D in certain nodes ([GH-84113](https://github.com/godotengine/godot/pull/84113)). +- Fix file rename crash after toggling split mode ([GH-84217](https://github.com/godotengine/godot/pull/84217)). +- Fix crash on rename collision in thumbnail grid ([GH-84218](https://github.com/godotengine/godot/pull/84218)). +- Make remote inspector groups not foldable ([GH-84257](https://github.com/godotengine/godot/pull/84257)). +- Automatically pick the Android SDK path using environment variables ([GH-84285](https://github.com/godotengine/godot/pull/84285)). +- Fix pressing save in Import Defaults not working ([GH-84291](https://github.com/godotengine/godot/pull/84291)). +- Disconnect `EditorNode` from file dialogs on destruction ([GH-84302](https://github.com/godotengine/godot/pull/84302)). +- Fix CSGShape debug_collision_shape crash ([GH-84338](https://github.com/godotengine/godot/pull/84338)). +- Polish & fix editor help cache generation ([GH-84354](https://github.com/godotengine/godot/pull/84354)). +- Fix inverted condition when unwrapping lightmap ([GH-84374](https://github.com/godotengine/godot/pull/84374)). +- Fix engine configuration icons using old convention ([GH-84404](https://github.com/godotengine/godot/pull/84404)). +- Tweak FastNoiseLite property hints for better slider usability ([GH-84494](https://github.com/godotengine/godot/pull/84494)). +- Fix pressing Enter being ignored in "Create Shader" dialog ([GH-84539](https://github.com/godotengine/godot/pull/84539)). +- Fix for stopping the Undo History being desynchronized from actual Undo queue ([GH-84557](https://github.com/godotengine/godot/pull/84557)). +- Correctly set up shortcut context in the shader editor ([GH-84614](https://github.com/godotengine/godot/pull/84614)). +- Save scene when saving built-in resource ([GH-84630](https://github.com/godotengine/godot/pull/84630)). +- Abort threaded preview generators on exit ([GH-84716](https://github.com/godotengine/godot/pull/84716)). +- Fix texture region editor not selecting restored snap mode ([GH-84762](https://github.com/godotengine/godot/pull/84762)). +- Reduced output spam from rapid property changes ([GH-84795](https://github.com/godotengine/godot/pull/84795)). +- Remove EditorFileDialog warning when skipping project directories ([GH-84797](https://github.com/godotengine/godot/pull/84797)). +- macOS: Cleanup default GL driver setting ([GH-84929](https://github.com/godotengine/godot/pull/84929)). +- Make script/shader editor save shortcuts unique again ([GH-84931](https://github.com/godotengine/godot/pull/84931)). +- Provide more context when scene fails to load ([GH-85083](https://github.com/godotengine/godot/pull/85083)). +- Add Save As... option to EditorResourcePicker ([GH-85150](https://github.com/godotengine/godot/pull/85150)). +- Avoid saving scene while already saving the scene ([GH-85154](https://github.com/godotengine/godot/pull/85154)). +- Fix project name being overwritten every time `show_dialog` is called ([GH-85169](https://github.com/godotengine/godot/pull/85169)). +- Rework the surface upgrade tool to inform users without blocking ([GH-85222](https://github.com/godotengine/godot/pull/85222)). +- Fix crash caused by conflicting menu option IDs ([GH-85227](https://github.com/godotengine/godot/pull/85227)). +- Suppress surface upgrade warnings when showing SurfaceUpgradeTool warning ([GH-85249](https://github.com/godotengine/godot/pull/85249)). +- Save and restore previous window mode when toggling full-screen ([GH-85427](https://github.com/godotengine/godot/pull/85427)). +- Disable a prohibitively slow code branch when reparenting nodes ([GH-85517](https://github.com/godotengine/godot/pull/85517)). #### Export -- Make sure script cache is created after reimport ([GH-75798](https://github.com/godotengine/godot/pull/75798)). +- Add a "version" project setting and use it in new export presets ([GH-35555](https://github.com/godotengine/godot/pull/35555)). +- Implement iOS one-click deploy ([GH-70662](https://github.com/godotengine/godot/pull/70662)). +- Add options to show icon in Android TV and run app as Android launcher ([GH-78164](https://github.com/godotengine/godot/pull/78164)). +- Add a button in the export dialog to fix missing texture formats ([GH-78457](https://github.com/godotengine/godot/pull/78457)). +- iOS: Add `export_project_only` flag ([GH-78641](https://github.com/godotengine/godot/pull/78641)). +- Re-architect how Android plugins are packaged and handled at export time ([GH-78958](https://github.com/godotengine/godot/pull/78958)). +- Fix export options of scripted `EditorExportPlugin`s ([GH-79025](https://github.com/godotengine/godot/pull/79025)). +- Android: Add option to always use WiFi to connect to remote debug ([GH-79504](https://github.com/godotengine/godot/pull/79504)). +- Improve headings for the export mode in the Export dialog ([GH-79725](https://github.com/godotengine/godot/pull/79725)). +- [macOS Export] Disable unpacked .app bundle export on Windows ([GH-79950](https://github.com/godotengine/godot/pull/79950)). +- Fix Windows console wrapper and icon being swapped ([GH-80357](https://github.com/godotengine/godot/pull/80357)). +- Add export setting to control whether to show the Godot app in the app library ([GH-80569](https://github.com/godotengine/godot/pull/80569)). +- Fix redundant enter tree notification in project export texture format ([GH-80967](https://github.com/godotengine/godot/pull/80967)). +- [iOS export] Switch export target extension based on export type ([GH-81365](https://github.com/godotengine/godot/pull/81365)). +- Expose `EditorExportPlatform::get_os_name()` ([GH-81430](https://github.com/godotengine/godot/pull/81430)). +- Fix `SubViewport` with `UPDATE_WHEN_VISIBLE` not working properly in exported project ([GH-81607](https://github.com/godotengine/godot/pull/81607)). +- [macOS export] Fix GDExtension framework `+x` flag errors, allow recursive signing on non macOS platform ([GH-81969](https://github.com/godotengine/godot/pull/81969)). +- Fix TextServer data export ([GH-82103](https://github.com/godotengine/godot/pull/82103)). +- iOS: Fix build on Xcode 14 and older ([GH-83088](https://github.com/godotengine/godot/pull/83088)). +- macOS: Remove deprecated altool notarization support, disable rcodesign for C# version ([GH-83482](https://github.com/godotengine/godot/pull/83482)). +- Use "version" project setting as macOS/iOS "short_version" fallback ([GH-83686](https://github.com/godotengine/godot/pull/83686)). +- Improve app / file version validation ([GH-84296](https://github.com/godotengine/godot/pull/84296)). +- [macOS export] Improve icon generation ([GH-84521](https://github.com/godotengine/godot/pull/84521)). +- Preserve the output from the gradle build command ([GH-84779](https://github.com/godotengine/godot/pull/84779)). +- Prevent the surface upgrade tool from running during export ([GH-85136](https://github.com/godotengine/godot/pull/85136)). +- iOS: Check if Xcode is installed in one-click deploy code ([GH-85168](https://github.com/godotengine/godot/pull/85168)). #### GDExtension -- Fix GDExtension Variant type conversion ([GH-75758](https://github.com/godotengine/godot/pull/75758)). -- Fix wrapping Objects in GDExtension that aren't exposed ([GH-78061](https://github.com/godotengine/godot/pull/78061)). -- Fix `Ref<>.is_valid()` for ScriptInstanceExtension ([GH-78392](https://github.com/godotengine/godot/pull/78392)). -- Use `Uninitialized*Ptr` for constructors/converters using placement new ([GH-78419](https://github.com/godotengine/godot/pull/78419)). - -#### GDScript - -- Fix access to identifiers that are reserved keywords ([GH-62830](https://github.com/godotengine/godot/pull/62830)). -- Fix typed arrays not working with concatenation operator `+` ([GH-73540](https://github.com/godotengine/godot/pull/73540)). -- Fix missing warning for shadowing of built-in types ([GH-74842](https://github.com/godotengine/godot/pull/74842)). - -#### GUI - -- Fix deselecting behavior in Tree ([GH-71307](https://github.com/godotengine/godot/pull/71307), [GH-71405](https://github.com/godotengine/godot/pull/71405)). -- Fix RichTextLabel wrong selection offsets ([GH-71742](https://github.com/godotengine/godot/pull/71742), [GH-71747](https://github.com/godotengine/godot/pull/71747)). -- Fix a blocking black rectangle that appears during color picking ([GH-74962](https://github.com/godotengine/godot/pull/74962)). -- Fix blurry borders on antialiased StyleBoxFlat ([GH-76132](https://github.com/godotengine/godot/pull/76132)). -- Fix `MenuBar` item order in RTL layout ([GH-77519](https://github.com/godotengine/godot/pull/77519)). -- Fix input handling for unfocusable embedded windows ([GH-77842](https://github.com/godotengine/godot/pull/77842)). -- Fix VideoStreamPlayer seamless loop ([GH-77856](https://github.com/godotengine/godot/pull/77856)). -- Fix editor log flicker ([GH-77973](https://github.com/godotengine/godot/pull/77973)). -- Ensure that controls update all their sizing information when required ([GH-78009](https://github.com/godotengine/godot/pull/78009)). -- Fix passive mouse hovering for physics ([GH-78017](https://github.com/godotengine/godot/pull/78017)). - -#### Import - -- Fix Basis Universal compressing with normal maps ([GH-62718](https://github.com/godotengine/godot/pull/62718)). -- Fix OBJ mesh importer smoothing handling ([GH-75315](https://github.com/godotengine/godot/pull/75315)). -- Fix Silhouette used incorrect index ([GH-76499](https://github.com/godotengine/godot/pull/76499)). -- Fix GLTFSkin binding for the `godot_skin` property ([GH-77413](https://github.com/godotengine/godot/pull/77413)). -- Fix exporting MeshInstances without a Skeleton in the GLTF module ([GH-77545](https://github.com/godotengine/godot/pull/77545)). -- Fix center of mass when importing GLTF physics bodies ([GH-77602](https://github.com/godotengine/godot/pull/77602)). - -#### Input - -- Fix guide button detection with XInput and Xbox Series controllers ([GH-73200](https://github.com/godotengine/godot/pull/73200)). -- Fix just pressed and released with short presses ([GH-77055](https://github.com/godotengine/godot/pull/77055)). -- Fix mouse position with screen transform ([GH-77923](https://github.com/godotengine/godot/pull/77923)). -- Fix IME focus in Popup on Windows and macOS ([GH-77977](https://github.com/godotengine/godot/pull/77977), [GH-78029](https://github.com/godotengine/godot/pull/78029)). - -#### Networking - -- Fix incorrect value returned by `HTTPClient.get_response_body_length` on Web ([GH-77648](https://github.com/godotengine/godot/pull/77648)). -- Fix delta variables index decoding ([GH-78709](https://github.com/godotengine/godot/pull/78709)). - -#### Physics - -- Fix various issues with PhysicsDirectBodyState3D contacts ([GH-58880](https://github.com/godotengine/godot/pull/58880)). -- Improve rigid body CCD against moving bodies ([GH-76138](https://github.com/godotengine/godot/pull/76138)). - -#### Porting - -- Android: Fix UI responsiveness to touch taps ([GH-75703](https://github.com/godotengine/godot/pull/75703)). -- Android: Fix double tap & drag on Android ([GH-76791](https://github.com/godotengine/godot/pull/76791)). -- Android: Fix issue causing the last edited project to open while switching to another one ([GH-78129](https://github.com/godotengine/godot/pull/78129)). -- iOS: Fix loading of GDExtension dylibs auto converted to framework ([GH-76510](https://github.com/godotengine/godot/pull/76510)). -- iOS: Fix orientation change in runtime ([GH-78132](https://github.com/godotengine/godot/pull/78132)). -- Linux/BSD: Fix the sliding window problem ([GH-76040](https://github.com/godotengine/godot/pull/76040)). -- Linux/BSD: Fix temporary file permissions ([GH-78347](https://github.com/godotengine/godot/pull/78347)). -- Windows: Fix queuing utterances in rapid succession in TTS ([GH-75880](https://github.com/godotengine/godot/pull/75880)). -- Windows: Fix minimize button missing in non-resizable projects ([GH-77770](https://github.com/godotengine/godot/pull/77770)). - -#### Rendering - -- Fix GLES3 rendering on Android studio emulator ([GH-74945](https://github.com/godotengine/godot/pull/74945)). -- Fix "Light Only" mode of `CanvasItemMaterial` ([GH-75181](https://github.com/godotengine/godot/pull/75181)). -- Fix GLES texture uniform array binding ([GH-75313](https://github.com/godotengine/godot/pull/75313)). -- Fix the limit for interpolation with respect to metallic and calculations in the SSR Fresnel Shlick ([GH-75368](https://github.com/godotengine/godot/pull/75368)). -- Fix GLES3 GPUParticles3D not working in HTML export ([GH-75795](https://github.com/godotengine/godot/pull/75795)). -- Fix voxel GI issues ([GH-76437](https://github.com/godotengine/godot/pull/76437), [GH-76550](https://github.com/godotengine/godot/pull/76550)). -- Fix reflections in mobile renderer ([GH-76692](https://github.com/godotengine/godot/pull/76692)). -- Fix modulation propagation for Y-sorted `CanvasItem`s ([GH-77079](https://github.com/godotengine/godot/pull/77079)). -- Fix LightmapGI dynamic object lighting ([GH-77089](https://github.com/godotengine/godot/pull/77089)). -- Fix calculation of skinned AABB for unused bones ([GH-77265](https://github.com/godotengine/godot/pull/77265)). -- Fix various issues with blend modes in the OpenGL 3 renderer ([GH-77409](https://github.com/godotengine/godot/pull/77409)). -- Fix Subtract blend mode of Forward+ and Mobile renderers ([GH-77520](https://github.com/godotengine/godot/pull/77520)). -- Fix LCD blend mode color caching in OpenGL ([GH-77946](https://github.com/godotengine/godot/pull/77946)). -- Ensure filter/repeat is cached by Viewport texture in GL Compatibility renderer ([GH-78285](https://github.com/godotengine/godot/pull/78285)). -- Copy texture filter/repeat modes when replacing a texture in the GL Compatibility backend ([GH-78287](https://github.com/godotengine/godot/pull/78287)). -- Fix volumetric fog in stereo by projection vertex in combined space ([GH-78436](https://github.com/godotengine/godot/pull/78436)). -- Use a filter with mipmaps when initializing textures with mipmaps in GL Compatibility renderer ([GH-78720](https://github.com/godotengine/godot/pull/78720)). - -#### Shaders - -- Fix shader preprocessor cyclic include handling ([GH-77608](https://github.com/godotengine/godot/pull/77608)). - -#### XR - -- Fix OpenXR Passthrough mode ([GH-78135](https://github.com/godotengine/godot/pull/78135)). -- Apply reprojection in multiview for our cluster lookup ([GH-78499](https://github.com/godotengine/godot/pull/78499)). -- Fix incorrect depth buffer option in OpenXR ([GH-78550](https://github.com/godotengine/godot/pull/78550)). - - -## [4.0] - 2023-03-01 - -The Godot 4.0 release was our biggest released to date, spanning 4 years of -development, more than 12,000 merged Pull Requests, and 1,500 individual -contributors! - -It's so big that the task of writing a detailed, curated changelog of the most -relevant changes like we've done for previous 3.x releases didn't seem -realistic. - -Instead, please refer to following resources: - -- [Release announcement](https://godotengine.org/article/godot-4-0-sets-sail/) -- [Git changelog (by authors)](https://downloads.tuxfamily.org/godotengine/4.0/Godot_v4.0-stable_changelog_authors.txt) -- [Git changelog (chronological)](https://downloads.tuxfamily.org/godotengine/4.0/Godot_v4.0-stable_changelog_chrono.txt) -- [Migration guide for Godot 3 users](https://docs.godotengine.org/en/4.0/tutorials/migrating/upgrading_to_godot_4.html) - - -## [3.5] - 2022-08-05 - -See the [release announcement](https://godotengine.org/article/godot-3-5-cant-stop-wont-stop) for details. - -### Added - -#### 3D - -- Add `process_mode` property to InterpolatedCamera ([GH-41402](https://github.com/godotengine/godot/pull/41402)). -- Add Label3D node and Sprite3D material render priority ([GH-61276](https://github.com/godotengine/godot/pull/61276)). -- Add TextMesh and expose dynamic font vector outlines ([GH-61281](https://github.com/godotengine/godot/pull/61281)). -- Add `global_translation` and `global_rotation` to Spatial ([GH-63058](https://github.com/godotengine/godot/pull/63058)). - -#### Animation - -- Add option to paste animation as duplicate ([GH-60226](https://github.com/godotengine/godot/pull/60226)). -- New SceneTreeTween backported from Godot 4.0's Tween ([GH-60581](https://github.com/godotengine/godot/pull/60581)). - -#### Audio - -- Allow configuring loop mode on WAV import ([GH-59170](https://github.com/godotengine/godot/pull/59170)). -- Add support for 64-bit IEEE float WAV encoding ([GH-61169](https://github.com/godotengine/godot/pull/61169)). - -#### Buildsystem - -- Add support for PowerPC family ([GH-54490](https://github.com/godotengine/godot/pull/54490)). -- Add Visual Studio 2022 support with fallback to 2019 ([GH-57609](https://github.com/godotengine/godot/pull/57609)). -- Add `fast_unsafe` option for faster rebuilds ([GH-57806](https://github.com/godotengine/godot/pull/57806)). -- Refactor Linux linker options with `linker=<bfd|gold|lld|mold>` ([GH-63283](https://github.com/godotengine/godot/pull/63283)). - -#### Core - -- Support deep comparison of Array and Dictionary ([GH-42625](https://github.com/godotengine/godot/pull/42625)). -- Add a project setting to disable the boot splash image ([GH-47568](https://github.com/godotengine/godot/pull/47568)). -- Add `OS.is_process_running()` method ([GH-51682](https://github.com/godotengine/godot/pull/51682)). -- Add `Image.fill_rect()` method ([GH-52457](https://github.com/godotengine/godot/pull/52457)). -- Allow pinning property values + Consistent property defaults ([GH-52943](https://github.com/godotengine/godot/pull/52943)). -- Add a Time singleton ([GH-54056](https://github.com/godotengine/godot/pull/54056)). -- Expose `String.get_slice()` method ([GH-54453](https://github.com/godotengine/godot/pull/54453)). -- Backport some APIs in math structs: `AABB` and `Rect2` `get_center()`, `Vector2` and `Vector3` `limit_length()` ([GH-54614](https://github.com/godotengine/godot/pull/54614)). -- Add GradientTexture2D ([GH-54824](https://github.com/godotengine/godot/pull/54824)). -- Add compile-time options to use handles and tracked handles to RID, to find erroneous usage patterns and leaks ([GH-54907](https://github.com/godotengine/godot/pull/54907), [GH-55719](https://github.com/godotengine/godot/pull/55719)). -- Add `OS.crash()` method for testing system crash handler ([GH-55614](https://github.com/godotengine/godot/pull/55614)). -- Expose `String.join()` method ([GH-56369](https://github.com/godotengine/godot/pull/56369)). -- Add project setting to change scene file casing ([GH-56909](https://github.com/godotengine/godot/pull/56909)). -- Add `OS.has_clipboard()` to check clipboard content ([GH-56950](https://github.com/godotengine/godot/pull/56950)). -- Add a signal to notify when children nodes enter or exit tree ([GH-57541](https://github.com/godotengine/godot/pull/57541), [GH-62241](https://github.com/godotengine/godot/pull/62241)). -- Add visibility to CanvasLayer ([GH-57900](https://github.com/godotengine/godot/pull/57900)). -- Add `OS.get_processor_name()` method ([GH-58157](https://github.com/godotengine/godot/pull/58157)). -- Add optional default value to `get_meta()` ([GH-58608](https://github.com/godotengine/godot/pull/58608)). -- Add `OS.get_screen_refresh_rate()` method ([GH-58812](https://github.com/godotengine/godot/pull/58812)). -- Add `Dictionary.merge()` method ([GH-59883](https://github.com/godotengine/godot/pull/59883)). -- Add `fill()` method to Array and Pool\*Array ([GH-60426](https://github.com/godotengine/godot/pull/60426)). -- Expose `Semaphore.try_wait()` ([GH-60502](https://github.com/godotengine/godot/pull/60502)). -- Add scene unique nodes ([GH-60527](https://github.com/godotengine/godot/pull/60527)). -- Expose `OS.move_to_trash()` ([GH-60542](https://github.com/godotengine/godot/pull/60542)). -- Allow AStar/AStar2D with zero point weight ([GH-60812](https://github.com/godotengine/godot/pull/60812)). -- Add search methods for Pool\*Arrays: `has()`, `count()`, `find()`, `rfind()` ([GH-60856](https://github.com/godotengine/godot/pull/60856)). -- Add interpolation modes to Gradient ([GH-60982](https://github.com/godotengine/godot/pull/60982)). -- Add option to keep or skip carriage return (CR) in `File.get_as_text()`, optimize implementation ([GH-63733](https://github.com/godotengine/godot/pull/63733)). - -#### Editor - -- Allow pinning property values ([GH-52944](https://github.com/godotengine/godot/pull/52944)). -- Add option to only redraw vital updates ([GH-53463](https://github.com/godotengine/godot/pull/53463), [GH-61965](https://github.com/godotengine/godot/pull/61965)). -- Add push, pull, fetch and improved diff view to VCS UI ([GH-53900](https://github.com/godotengine/godot/pull/53900)). -- Implement Alt + Mouse wheel to adjust FOV in the 3D editor viewport ([GH-54207](https://github.com/godotengine/godot/pull/54207)). -- Many fixes to built-in scripts support ([GH-54579](https://github.com/godotengine/godot/pull/54579), [GH-54662](https://github.com/godotengine/godot/pull/54662), [GH-54889](https://github.com/godotengine/godot/pull/54889), [GH-55286](https://github.com/godotengine/godot/pull/55286), [GH-55611](https://github.com/godotengine/godot/pull/55611), [GH-55728](https://github.com/godotengine/godot/pull/55728)). -- Add "Replace in Files" functionality to text editors ([GH-55232](https://github.com/godotengine/godot/pull/55232)). -- Draw the filled part of the slider on float EditorSpinSliders ([GH-55521](https://github.com/godotengine/godot/pull/55521)). -- Sort and group theme properties in docs, improve formatting for theme and enums ([GH-55526](https://github.com/godotengine/godot/pull/55526)). -- Make overridden properties link to parent definition ([GH-55560](https://github.com/godotengine/godot/pull/55560)). -- Add drag and drop for NodePaths ([GH-55761](https://github.com/godotengine/godot/pull/55761)). -- Only show Particles2D visibility rect on selected nodes ([GH-55782](https://github.com/godotengine/godot/pull/55782)). -- Add option to filter the stack variables of GDScript debugger ([GH-58861](https://github.com/godotengine/godot/pull/58861)). -- Add property name style toggle to Inspector ([GH-59313](https://github.com/godotengine/godot/pull/59313)). -- Add option to paste animation as duplicate ([GH-60226](https://github.com/godotengine/godot/pull/60226)). -- Add an inspector preview for BitMap ([GH-60700](https://github.com/godotengine/godot/pull/60700)). -- Add `--debug-server` command line option to listen for incoming connections ([GH-60819](https://github.com/godotengine/godot/pull/60819)). -- Add readable export errors ([GH-61624](https://github.com/godotengine/godot/pull/61624)). - -#### GDNative - -- Add Core API 1.3 with methods: `Dictionary.merge()`, `Pool*Array` `has()` and `sort()`, `PoolStringArray.join()`, `String join()`, `num_uint64()` and `num_uint64_capitalized()` ([GH-55650](https://github.com/godotengine/godot/pull/55650), [GH-55826](https://github.com/godotengine/godot/pull/55826), [GH-63136](https://github.com/godotengine/godot/pull/63136)). - -#### GUI - -- Add option to make selection unique to TextEdit, LineEdit, RichTextLabel ([GH-54353](https://github.com/godotengine/godot/pull/54353), [GH-62221](https://github.com/godotengine/godot/pull/62221)). -- Add drag and drop to TextEdit, LineEdit, RichTextLabel ([GH-55355](https://github.com/godotengine/godot/pull/55355)). -- Add drag start/end signals for Slider ([GH-55775](https://github.com/godotengine/godot/pull/55775)). -- RichTextLabel: Add BBCode `[lb]` and `[rb]` escape sequences for square brackets ([GH-56586](https://github.com/godotengine/godot/pull/56586)). -- Add alignment options to Button icons ([GH-57771](https://github.com/godotengine/godot/pull/57771)). -- Add type variations to Theme ([GH-57942](https://github.com/godotengine/godot/pull/57942)). -- Add FlowContainer ([GH-57960](https://github.com/godotengine/godot/pull/57960)). -- Add WOFF2 font support and brotli decoder ([GH-59522](https://github.com/godotengine/godot/pull/59522)). -- RichTextLabel: Add `deselect()` and `get_selected_text()` methods ([GH-59894](https://github.com/godotengine/godot/pull/59894), [GH-59926](https://github.com/godotengine/godot/pull/59926)). -- LineEdit: Add selection getter methods ([GH-60176](https://github.com/godotengine/godot/pull/60176)). -- Add a skew property to StyleBoxFlat ([GH-60592](https://github.com/godotengine/godot/pull/60592)). - -#### Input - -- Input: Allow for mapping scancodes to current layout ([GH-56015](https://github.com/godotengine/godot/pull/56015)). - -#### Localization - -- Make property paths and categories translatable ([GH-58634](https://github.com/godotengine/godot/pull/58634)). -- Add property name style toggle to Inspector ([GH-59313](https://github.com/godotengine/godot/pull/59313)). -- Add binary MO translation file support ([GH-59522](https://github.com/godotengine/godot/pull/59522)). - -#### Mono (C#) - -- Add support for file-scoped namespace declaration ([GH-56427](https://github.com/godotengine/godot/pull/56427)). - -#### Navigation - -- Add NavigationServer with obstacle avoidance using RVO2 ([GH-48395](https://github.com/godotengine/godot/pull/48395)). -- Lots of fixes and improvements to the new NavigationServer ([Many GitHub PRs](https://github.com/godotengine/godot/pulls?q=is%3Apr+sort%3Aupdated-desc+label%3Atopic%3Anavigation+merged%3A2022-04-01..2022-07-15+is%3Aclosed)). -- Backport more NavigationServer features to make it more flexible ([GH-61996](https://github.com/godotengine/godot/pull/61996)). - -#### Networking - -- Add `set_extra_headers()` to WebSocketServer ([GH-40975](https://github.com/godotengine/godot/pull/40975)). -- Add proxy support for HTTPClient and the editor ([GH-55988](https://github.com/godotengine/godot/pull/55988)). -- Add NetworkedMultiplayerCustom so high-level multiplayer backends can be added from scripts ([GH-63163](https://github.com/godotengine/godot/pull/63163)). - -#### Physics - -- Add fixed timestep interpolation for 3D ([GH-52846](https://github.com/godotengine/godot/pull/52846)). - * The 2D equivalent will be added later on. -- Expose `intersect_point` in 3D physics server ([GH-54577](https://github.com/godotengine/godot/pull/54577)). -- VehicleWheel can now return the surface it's colliding with ([GH-55723](https://github.com/godotengine/godot/pull/55723)). -- Add physics material to GridMap ([GH-56006](https://github.com/godotengine/godot/pull/56006)). -- Add KinematicBody `moving_platform_apply_velocity_on_leave` property ([GH-56569](https://github.com/godotengine/godot/pull/56569)). - -#### Porting - -- Android: Add full support for Android scoped storage ([GH-51815](https://github.com/godotengine/godot/pull/51815)). -- Android: Initial port of the Godot editor ([GH-57747](https://github.com/godotengine/godot/pull/57747)). -- Android: Update editor default display scale, allow resizing windows ([GH-59868](https://github.com/godotengine/godot/pull/59868), [GH-59861](https://github.com/godotengine/godot/pull/59861), [GH-59880](https://github.com/godotengine/godot/pull/59880)). -- Android: Add method to obtain display cutouts ([GH-60552](https://github.com/godotengine/godot/pull/60552)). -- HTML5: Add preliminary support for GDNative+Threads build ([GH-61989](https://github.com/godotengine/godot/pull/61989)). - * Depends on cutting edge Emscripten 3.1.14, no templates provided for this export type for now. -- HTML5: Add support for `Input.vibrate_handheld()` ([GH-63573](https://github.com/godotengine/godot/pull/63573)). -- Linux: Add support for primary clipboard ([GH-54026](https://github.com/godotengine/godot/pull/54026)). -- macOS: Implements ad-hoc signing from Linux/Windows ([GH-51550](https://github.com/godotengine/godot/pull/51550)). -- macOS: Add signing of directory structure when exporting for macOS ([GH-56250](https://github.com/godotengine/godot/pull/56250)). -- Windows: Implement limited surrogate pairs support (better UTF-8 support, emoji fonts) ([GH-54625](https://github.com/godotengine/godot/pull/54625)). -- Windows: Add support for handling network share paths ([GH-61985](https://github.com/godotengine/godot/pull/61985)). -- Add stylus inverted/eraser support to InputEventMouseMotion event (desktop platforms) ([GH-62723](https://github.com/godotengine/godot/pull/62723)). - -#### Rendering - -- Add `material_overlay` property to MeshInstance ([GH-50823](https://github.com/godotengine/godot/pull/50823)). -- Add a Viewport property to use full floating-point precision in HDR ([GH-51708](https://github.com/godotengine/godot/pull/51708)). -- Asynchronous shader compilation + caching (ubershader) ([GH-53411](https://github.com/godotengine/godot/pull/53411)). -- Allow changing directional shadows at runtime ([GH-54165](https://github.com/godotengine/godot/pull/54165)). -- Allow using transparent background Viewports with post processing effects ([GH-54585](https://github.com/godotengine/godot/pull/54585)). -- Add OccluderShapePolygon ([GH-57361](https://github.com/godotengine/godot/pull/57361)). -- Add support for saving multiple Images in BakedLightmap ([GH-58102](https://github.com/godotengine/godot/pull/58102)). -- VisibilityNotifier: Add `max_distance` feature ([GH-61544](https://github.com/godotengine/godot/pull/61544)). - -#### Shaders - -- Expose `VERTEX_ID` and `INSTANCE_ID` to user created shaders ([GH-54751](https://github.com/godotengine/godot/pull/54751)). -- Add `const` qualifier support for function arguments in shaders ([GH-55103](https://github.com/godotengine/godot/pull/55103)). -- Add random initial color feature for all Particles nodes ([GH-55788](https://github.com/godotengine/godot/pull/55788)). -- Add hints and default values to VisualShader uniform nodes ([GH-56466](https://github.com/godotengine/godot/pull/56466)). -- Allow pass varyings as out param to the function, when it's possible ([GH-56478](https://github.com/godotengine/godot/pull/56478)). -- Many improvements backported from `master` ([GH-56794](https://github.com/godotengine/godot/pull/56794)). - -#### XR - -- WebXR: Rendering and touch events now supported on smartphone AR ([GH-55869](https://github.com/godotengine/godot/pull/55869), [GH-56819](https://github.com/godotengine/godot/pull/56819)). -- WebXR: Allow mapping VR controller joystick/button IDs to match other AR/VR interfaces ([GH-59994](https://github.com/godotengine/godot/pull/59994)).### Changed - -### Changed - -#### Audio - -- Instance audio streams before `AudioServer::lock` call ([GH-59413](https://github.com/godotengine/godot/pull/59413)). - -#### Buildsystem - -- Make compilation database generation optional ([GH-57820](https://github.com/godotengine/godot/pull/57820)). -- Default `num_jobs` to max CPUs minus 1 if not specified ([GH-63087](https://github.com/godotengine/godot/pull/63087)). -- [Toolchains update for official builds](https://github.com/godotengine/build-containers/tree/3.5#toolchains). - -#### Core - -- Increase `VARIANT_ARG_MAX` to 8 ([GH-54188](https://github.com/godotengine/godot/pull/54188)). -- Change RID comparison operators to use RID_Data id instead of address ([GH-59234](https://github.com/godotengine/godot/pull/59234)). -- Crash handler: Use `print_error` to include backtrace in logs ([GH-60782](https://github.com/godotengine/godot/pull/60782)). -- Allow AStar/AStar2D zero point weight ([GH-60812](https://github.com/godotengine/godot/pull/60812)). -- Command line arguments `--version` and `--help` return exit code 0 instead of 255 ([GH-62550](https://github.com/godotengine/godot/pull/62550)). -- Sort SpriteFrames animations alphabetically ([GH-62977](https://github.com/godotengine/godot/pull/62977)). - -#### Editor - -- Hide `.gdignore`'d folders in file dialogs ([GH-46638](https://github.com/godotengine/godot/pull/46638)). -- Improve ColorPicker presets ([GH-54439](https://github.com/godotengine/godot/pull/54439)). -- Improved region-select in the 3D editor viewport ([GH-58252](https://github.com/godotengine/godot/pull/58252)). -- Make property paths and categories translatable ([GH-58634](https://github.com/godotengine/godot/pull/58634)). -- Create onready variables when dropping nodes and holding Ctrl ([GH-60879](https://github.com/godotengine/godot/pull/60879)). -- Only switch to node when node dragging it ([GH-61162](https://github.com/godotengine/godot/pull/61162)). -- Increase the editor profiler frame history default and maximum limit ([GH-61482](https://github.com/godotengine/godot/pull/61482)). -- Don't switch to 2D/3D viewports when selecting nodes while in Script Editor ([GH-63344](https://github.com/godotengine/godot/pull/63344)). - -#### Export - -- Improve embedded PCK loading and exporting ([GH-60580](https://github.com/godotengine/godot/pull/60580)). -- Return 0 exit code when command line export succeeds with warnings ([GH-62907](https://github.com/godotengine/godot/pull/62907)). +- Fix GDExtension classes derived from abstract GDExtension classes always being registered as abstract ([GH-67512](https://github.com/godotengine/godot/pull/67512)). +- Add GDExtension support for OpenXR extension wrappers ([GH-68259](https://github.com/godotengine/godot/pull/68259)). +- Allow GDExtension to register unexposed classes ([GH-70329](https://github.com/godotengine/godot/pull/70329)). +- Set vararg methods' ptrcall of builtin classes, and let them can be called without arguments ([GH-76047](https://github.com/godotengine/godot/pull/76047)). +- Add GDExtension function to construct StringName directly from `char*` ([GH-78580](https://github.com/godotengine/godot/pull/78580)). +- Allow implementing `get_class_category` in GDExtension ([GH-78995](https://github.com/godotengine/godot/pull/78995)). +- Allow CallableCustom objects to be created from GDExtensions ([GH-79005](https://github.com/godotengine/godot/pull/79005)). +- Allow resizing Strings from GDExtension ([GH-79156](https://github.com/godotengine/godot/pull/79156)). +- Prevent GDExtensions from trying to remove editor plugins at shutdown ([GH-79492](https://github.com/godotengine/godot/pull/79492)). +- Fix `_get_property_list` not working correctly in parent classes ([GH-79683](https://github.com/godotengine/godot/pull/79683)). +- Add `_bind_compatibility_methods` to Object ([GH-79702](https://github.com/godotengine/godot/pull/79702)). +- Fix incorrect virtual function in `VideoStream.set_paused` ([GH-79710](https://github.com/godotengine/godot/pull/79710)). +- Add support for indexed properties in GDExtension ([GH-79763](https://github.com/godotengine/godot/pull/79763)). +- Add `get_script_instance` to GDExtension ([GH-80040](https://github.com/godotengine/godot/pull/80040)). +- `PtrToArg::convert()` uses const-reference where possible ([GH-80075](https://github.com/godotengine/godot/pull/80075)). +- Fix or workaround recent extension API compatibility issues ([GH-80168](https://github.com/godotengine/godot/pull/80168)). +- Copy DLL to a temp file before opening ([GH-80188](https://github.com/godotengine/godot/pull/80188)). +- CI: Make extension API compatibility check mandatory ([GH-80220](https://github.com/godotengine/godot/pull/80220)). +- Implement reloading of GDExtensions ([GH-80284](https://github.com/godotengine/godot/pull/80284)). +- Add compatibility notice after #78266 ([GH-80374](https://github.com/godotengine/godot/pull/80374)). +- Expose PlaceHolderScriptInstance to GDExtension ([GH-80394](https://github.com/godotengine/godot/pull/80394)). +- Fix version check for GDExtension ([GH-80591](https://github.com/godotengine/godot/pull/80591)). +- Use `String::resize()` and `CharString` in `text_server_adv` again ([GH-80642](https://github.com/godotengine/godot/pull/80642)). +- Add functions for non-ptr style virtual calls in GDExtension ([GH-80671](https://github.com/godotengine/godot/pull/80671)). +- SCons: Fix ThorVG build option in TextServers with #80095 ([GH-80713](https://github.com/godotengine/godot/pull/80713)). +- Remove DLL copy if it fails to load ([GH-80720](https://github.com/godotengine/godot/pull/80720)). +- Godot Android plugin re-architecture ([GH-80740](https://github.com/godotengine/godot/pull/80740)). +- Exclude unexposed classes from the `extension_api.json` ([GH-80852](https://github.com/godotengine/godot/pull/80852)). +- Fix overriding `_export_begin`, `_export_file` and `_export_end` from GDExtension ([GH-80999](https://github.com/godotengine/godot/pull/80999)). +- Allocate `GDExtensionScriptInstanceInfo2` for compatibility on the heap to prevent crash ([GH-81206](https://github.com/godotengine/godot/pull/81206)). +- Use godot-cpp 4.1 for the "Godot CPP" CI workflow to prevent circular dependency ([GH-81238](https://github.com/godotengine/godot/pull/81238)). +- fix `bool` unknown in C ([GH-81247](https://github.com/godotengine/godot/pull/81247)). +- Allow implementing `ScriptInstance::validate_property()` from GDExtension ([GH-81261](https://github.com/godotengine/godot/pull/81261)). +- Fix bindings of `PhysicsServer3DRenderingServerHandler` ([GH-81298](https://github.com/godotengine/godot/pull/81298)). +- Add compatibility methods for RenderingDevice BarrierMask ([GH-81356](https://github.com/godotengine/godot/pull/81356)). +- Allow implementing `Object::_validate_property()` from GDExtension ([GH-81515](https://github.com/godotengine/godot/pull/81515)). +- Fix method hashes with default arguments ([GH-81521](https://github.com/godotengine/godot/pull/81521)). +- Delete left-over DLL copy before making a new copy ([GH-81576](https://github.com/godotengine/godot/pull/81576)). +- Expose `texture_create_from_extension` to GDExtension ([GH-82168](https://github.com/godotengine/godot/pull/82168)). +- Remove redundant method bind hash check ([GH-82191](https://github.com/godotengine/godot/pull/82191)). +- Optionally include documentation in GDExtension API dump ([GH-82331](https://github.com/godotengine/godot/pull/82331)). +- Fix type of `notification_func` ([GH-82332](https://github.com/godotengine/godot/pull/82332)). +- Moved `face_index` field in 3D `RayResult` to end of struct ([GH-82403](https://github.com/godotengine/godot/pull/82403)). +- Fix inconsistent `last_modified_time` handling in GDExtension ([GH-82603](https://github.com/godotengine/godot/pull/82603)). +- Don't deprecate old method of getting script category ([GH-82682](https://github.com/godotengine/godot/pull/82682)). +- Fixes to allow object-less callables throughout Godot ([GH-82695](https://github.com/godotengine/godot/pull/82695)). +- Web: Catch using GDExtensions in a non-dlink build ([GH-82790](https://github.com/godotengine/godot/pull/82790)). +- Convert `validated_call()` to `ptrcall()` (rather than `call()`) ([GH-82794](https://github.com/godotengine/godot/pull/82794)). +- Expose `Object::free_instance_binding()` to GDExtension ([GH-82799](https://github.com/godotengine/godot/pull/82799)). +- Resolve relative icon paths for GDExtensions ([GH-82842](https://github.com/godotengine/godot/pull/82842)). +- Fix extensions loading/initializing even when entry point fails ([GH-82861](https://github.com/godotengine/godot/pull/82861)). +- Remove I/O error popup when failing to load/unload extension ([GH-82907](https://github.com/godotengine/godot/pull/82907)). +- On Linux, favor local symbols when loading a shared library ([GH-82973](https://github.com/godotengine/godot/pull/82973)). +- Use correct return pointer for validated calls that return `Variant` ([GH-83054](https://github.com/godotengine/godot/pull/83054)). +- Fix incorrect error message about vararg methods ([GH-83107](https://github.com/godotengine/godot/pull/83107)). +- Fix missing editor singletons when dumping extension api ([GH-83239](https://github.com/godotengine/godot/pull/83239)). +- Prevent issues with the editor trying to reload GDExtensions through its usual mechanism ([GH-83285](https://github.com/godotengine/godot/pull/83285)). +- Add brief description in GDExtension API dump with docs ([GH-83318](https://github.com/godotengine/godot/pull/83318)). +- Fix comment in `gdextension_interface.h` ([GH-83415](https://github.com/godotengine/godot/pull/83415)). +- Allow coexistence of GDScript and GDExtension virtual methods in the same object ([GH-83583](https://github.com/godotengine/godot/pull/83583)). +- Add `path` option to `ScriptLanguageExtension::_validate` ([GH-83588](https://github.com/godotengine/godot/pull/83588)). +- Fix `variant_iter_get()` actually calling `iter_next()` ([GH-83681](https://github.com/godotengine/godot/pull/83681)). +- Fixed error on loading extensions ([GH-83734](https://github.com/godotengine/godot/pull/83734)). +- Use `ObjectID` when creating custom callable ([GH-83800](https://github.com/godotengine/godot/pull/83800)). +- Linux: Disable `RTLD_DEEPBIND` mode for `dlopen()` in sanitizer builds ([GH-84210](https://github.com/godotengine/godot/pull/84210)). +- Save and compare modification times separately for reload ([GH-84315](https://github.com/godotengine/godot/pull/84315)). +- [iOS, GDExtension] Fix loading and exporting static libraries and xcframeworks ([GH-84493](https://github.com/godotengine/godot/pull/84493)). +- Change `GDExtension`'s `library_path` back to an absolute path ([GH-84620](https://github.com/godotengine/godot/pull/84620)). +- Remove Android specific abis from the export preset feature list ([GH-84720](https://github.com/godotengine/godot/pull/84720)). +- Check that `GDExtensionCompatHashes` are valid when generating `extension_api.json` ([GH-84973](https://github.com/godotengine/godot/pull/84973)). +- iOS: Fix GDExtension init callback array reallocation ([GH-85216](https://github.com/godotengine/godot/pull/85216)). #### GDScript -- Infer variable types on release ([GH-57851](https://github.com/godotengine/godot/pull/57851)). -- Don't coerce default values to the export hint type ([GH-58686](https://github.com/godotengine/godot/pull/58686)). -- Enable method type information on release builds ([GH-59793](https://github.com/godotengine/godot/pull/59793)). -- Keep builtin method info on release builds ([GH-61117](https://github.com/godotengine/godot/pull/61117)). +- Highlight doc comments in a different color ([GH-72751](https://github.com/godotengine/godot/pull/72751)). +- Fix jumping to function definition using `Ctrl+LMB` or the "Lookup Symbol" button ([GH-73196](https://github.com/godotengine/godot/pull/73196)). +- Improve GDScript identifier tokenization ([GH-73226](https://github.com/godotengine/godot/pull/73226)). +- Add code region folding to CodeEdit ([GH-74843](https://github.com/godotengine/godot/pull/74843)). +- Add raw string literals (r-strings) ([GH-74995](https://github.com/godotengine/godot/pull/74995)). +- Show script errors from depended scripts ([GH-75216](https://github.com/godotengine/godot/pull/75216)). +- Fix for not being able to ignore shadowing warnings on class scope ([GH-75620](https://github.com/godotengine/godot/pull/75620)). +- Add a script method to get its class icon ([GH-75656](https://github.com/godotengine/godot/pull/75656)). +- Improve call analysis ([GH-75988](https://github.com/godotengine/godot/pull/75988)). +- Support threads in the script debugger ([GH-76582](https://github.com/godotengine/godot/pull/76582)). +- Fix conflict between property and group names ([GH-78254](https://github.com/godotengine/godot/pull/78254)). +- Add error message when a GDScript resource fails to load ([GH-78540](https://github.com/godotengine/godot/pull/78540)). +- Check `get_node()` shorthand in static functions ([GH-78552](https://github.com/godotengine/godot/pull/78552)). +- Editor: Remove unused Class Name field from Create Script dialog ([GH-78573](https://github.com/godotengine/godot/pull/78573)). +- Fix incorrect error message for utility functions ([GH-78882](https://github.com/godotengine/godot/pull/78882)). +- Add `@deprecated` and `@experimental` doc comment tags ([GH-78941](https://github.com/godotengine/godot/pull/78941)). +- Fix regression with GDScript enum descriptions now showing up in documentation ([GH-78953](https://github.com/godotengine/godot/pull/78953)). +- Add static analysis error reporting in `GDScriptCache::get_full_script()` ([GH-79163](https://github.com/godotengine/godot/pull/79163)). +- Make onready variables created from dropping nodes include custom types ([GH-79198](https://github.com/godotengine/godot/pull/79198)). +- Solve `_populate_class_members()` cyclic dependency problem ([GH-79205](https://github.com/godotengine/godot/pull/79205)). +- Properly track extents of constants ([GH-79301](https://github.com/godotengine/godot/pull/79301)). +- Load global classes when running debug tests ([GH-79425](https://github.com/godotengine/godot/pull/79425)). +- Fix subscript resolution for constant non-metatypes ([GH-79510](https://github.com/godotengine/godot/pull/79510)). +- Change GDScript tests to use InstancePlaceholder as the example abstract class ([GH-79524](https://github.com/godotengine/godot/pull/79524)). +- Highlight comment markers (`TODO`, `FIXME`, etc.) ([GH-79761](https://github.com/godotengine/godot/pull/79761)). +- Fix bug with identifier shadowed below in current scope ([GH-79880](https://github.com/godotengine/godot/pull/79880)). +- Replace ptrcalls on MethodBind to validated calls ([GH-79893](https://github.com/godotengine/godot/pull/79893)). +- Add validation for `@export_node_path` annotation arguments ([GH-79935](https://github.com/godotengine/godot/pull/79935)). +- Optimize operators by assuming the types ([GH-79990](https://github.com/godotengine/godot/pull/79990)). +- Add constant string support for POT generator ([GH-80020](https://github.com/godotengine/godot/pull/80020)). +- Implement pattern guards for match statement ([GH-80085](https://github.com/godotengine/godot/pull/80085)). +- Fix regression with native signal not found ([GH-80165](https://github.com/godotengine/godot/pull/80165)). +- Add static typing for `for` loop variable ([GH-80247](https://github.com/godotengine/godot/pull/80247)). +- Assign temporary path to preloaded resources ([GH-80281](https://github.com/godotengine/godot/pull/80281)). +- Fix completion option location not found ([GH-80283](https://github.com/godotengine/godot/pull/80283)). +- Allow mixed indentation on blank lines ([GH-80365](https://github.com/godotengine/godot/pull/80365)). +- Fix `get_method` from named lambda ([GH-80506](https://github.com/godotengine/godot/pull/80506)). +- Fix "Identifier not found" error when accessing inner class from inside ([GH-80510](https://github.com/godotengine/godot/pull/80510)). +- Fix superfluous `"` in error message ([GH-80568](https://github.com/godotengine/godot/pull/80568)). +- Check if any global script class is shadowed by a variable ([GH-80587](https://github.com/godotengine/godot/pull/80587)). +- Fixes LSP connection error when launched in a separate thread ([GH-80686](https://github.com/godotengine/godot/pull/80686)). +- Improve DocGen ([GH-80745](https://github.com/godotengine/godot/pull/80745)). +- Fix expected argument count for `Callable` call errors ([GH-80844](https://github.com/godotengine/godot/pull/80844)). +- Fix lambda resolution with cyclic references ([GH-80923](https://github.com/godotengine/godot/pull/80923)). +- Allow using local constants as types ([GH-80964](https://github.com/godotengine/godot/pull/80964)). +- Language Server: Improve hovered symbol resolution, fix renaming bugs, implement reference lookup ([GH-80973](https://github.com/godotengine/godot/pull/80973)). +- Fix `_get_debug_tooltip` crash if tooltip string is too large ([GH-81018](https://github.com/godotengine/godot/pull/81018)). +- Fix highlighting of hex numbers with separators ([GH-81039](https://github.com/godotengine/godot/pull/81039)). +- Fix `get_*_list()` methods return incorrect info ([GH-81079](https://github.com/godotengine/godot/pull/81079)). +- Optimize GDScript VM codegen for MSVC ([GH-81200](https://github.com/godotengine/godot/pull/81200)). +- Fix subclass methods not inheriting RPC info ([GH-81201](https://github.com/godotengine/godot/pull/81201)). +- Fix an error when dragging nodes into built-in scripts because script does not inherit Node ([GH-81299](https://github.com/godotengine/godot/pull/81299)). +- Don't make array literal typed in weak type context ([GH-81332](https://github.com/godotengine/godot/pull/81332)). +- Add an optional `untyped_declaration` warning ([GH-81355](https://github.com/godotengine/godot/pull/81355)). +- Remove `REDUNDANT_FOR_VARIABLE_TYPE` warning ([GH-81440](https://github.com/godotengine/godot/pull/81440)). +- Fix compilation of expressions compiling other classes ([GH-81577](https://github.com/godotengine/godot/pull/81577)). +- Fix dumping of signal API parameters ([GH-81599](https://github.com/godotengine/godot/pull/81599)). +- Fix some lambda bugs ([GH-81605](https://github.com/godotengine/godot/pull/81605)). +- Fix lambda hot reloading ([GH-81628](https://github.com/godotengine/godot/pull/81628)). +- Fix POT generator crash on assignee with index ([GH-81653](https://github.com/godotengine/godot/pull/81653)). +- Fix and improve doc comment parsing ([GH-81699](https://github.com/godotengine/godot/pull/81699)). +- Add check for `super()` methods not being implemented ([GH-81808](https://github.com/godotengine/godot/pull/81808)). +- LSP: Fix autocomplete quote handling ([GH-81833](https://github.com/godotengine/godot/pull/81833)). +- LSP: Add `--lsp-port` as a command line argument ([GH-81844](https://github.com/godotengine/godot/pull/81844)). +- Rewrite a small comment in GDScript tokenizer code ([GH-81881](https://github.com/godotengine/godot/pull/81881)). +- Make array literal typed if `for` loop variable type is specified ([GH-82030](https://github.com/godotengine/godot/pull/82030)). +- GDScript DocGen: Fix and improve appearance of metatypes and values ([GH-82067](https://github.com/godotengine/godot/pull/82067)). +- Prevent constructing and inheriting engine singletons ([GH-82098](https://github.com/godotengine/godot/pull/82098)). +- Fix `--gdscript-docs` tool failing when autoloads are used in the project ([GH-82116](https://github.com/godotengine/godot/pull/82116)). +- Add `INFERRED_DECLARATION` warning ([GH-82139](https://github.com/godotengine/godot/pull/82139)). +- Fix duplication of inherited script properties ([GH-82186](https://github.com/godotengine/godot/pull/82186)). +- Fix crash with `GDScriptNativeClass` ([GH-82294](https://github.com/godotengine/godot/pull/82294)). +- Fix for GDScriptHighlighter dictionaries as function arguments ([GH-82326](https://github.com/godotengine/godot/pull/82326)). +- Add return type covariance and parameter type contravariance ([GH-82477](https://github.com/godotengine/godot/pull/82477)). +- Improve highlighting of types ([GH-82516](https://github.com/godotengine/godot/pull/82516)). +- Fix `UNSAFE_CALL_ARGUMENT` warning for `Variant` constructors ([GH-82547](https://github.com/godotengine/godot/pull/82547)). +- Core: Fix `Object::has_method()` for script static methods ([GH-82767](https://github.com/godotengine/godot/pull/82767)). +- Fix `native_type` is empty for autoload without script ([GH-82784](https://github.com/godotengine/godot/pull/82784)). +- Fix unresolved datatype for incomplete binary operator ([GH-82789](https://github.com/godotengine/godot/pull/82789)). +- Add error when exporting node in non `Node`-derived classes ([GH-82843](https://github.com/godotengine/godot/pull/82843)). +- Fixes internal Script Editor crash with External Editor active ([GH-82956](https://github.com/godotengine/godot/pull/82956)). +- Fix external editor hot reload for GDScript ([GH-82986](https://github.com/godotengine/godot/pull/82986)). +- Fix GDScript cache assigning UID as scene path ([GH-83039](https://github.com/godotengine/godot/pull/83039)). +- GDScript DocGen: Fix regression with return metatypes ([GH-83049](https://github.com/godotengine/godot/pull/83049)). +- Deleting unnecessary include in GDScriptParser ([GH-83050](https://github.com/godotengine/godot/pull/83050)). +- Fix modifying base script exports not propagating to derived scripts ([GH-83123](https://github.com/godotengine/godot/pull/83123)). +- Add autocompletion for static variables accessed via class ([GH-83150](https://github.com/godotengine/godot/pull/83150)). +- Code Editor: Fix regression with using doc comments for code regions ([GH-83216](https://github.com/godotengine/godot/pull/83216)). +- Fix unresolved datatype for incomplete expressions ([GH-83257](https://github.com/godotengine/godot/pull/83257)). +- Fix grammar typo in GDScript error message ([GH-83455](https://github.com/godotengine/godot/pull/83455)). +- Fix non-static call is allowed in static var lambda body ([GH-83486](https://github.com/godotengine/godot/pull/83486)). +- Fix `GDScriptCache::get_full_script` eating parsing errors because of early exit ([GH-83540](https://github.com/godotengine/godot/pull/83540)). +- Don't optimize division and modulo on debug ([GH-83569](https://github.com/godotengine/godot/pull/83569)). +- Fix comment typo in `gdscript_parser.h` ([GH-83792](https://github.com/godotengine/godot/pull/83792)). +- SCons: Fix build with GDScript LSP disabled ([GH-84191](https://github.com/godotengine/godot/pull/84191)). +- Fix lambda cross-thread dynamics (take 2) ([GH-85248](https://github.com/godotengine/godot/pull/85248)). +- Fix GDScript thread-exit routine assuming thread-enter was called ([GH-85432](https://github.com/godotengine/godot/pull/85432)). #### GUI -- Make TabContainer's tabs better blend with the panel when using the default theme ([GH-56774](https://github.com/godotengine/godot/pull/56774)). -- Make the menu from Menu/OptionButton have its first option focused when triggered by a keyboard or gamepad ([GH-57643](https://github.com/godotengine/godot/pull/57643)). -- Make Tree once again draw relationship lines for items offscreen ([GH-60282](https://github.com/godotengine/godot/pull/60282)). -- Make various improvements to OptionButton ([GH-61102](https://github.com/godotengine/godot/pull/61102)). -- Improve RichTextLabel table filling ([GH-61904](https://github.com/godotengine/godot/pull/61904)). +- Add option to allow echo events in menu shortcuts ([GH-36493](https://github.com/godotengine/godot/pull/36493)). +- Expose and rename ItemList's `_check_shape_changed` to `force_update_list_size` ([GH-63634](https://github.com/godotengine/godot/pull/63634)). +- Add Duplicate Lines shortcut to CodeTextEditor ([GH-66553](https://github.com/godotengine/godot/pull/66553)). +- Refactor `mouse_entered` and `mouse_exited` signals ([GH-67791](https://github.com/godotengine/godot/pull/67791)). +- Fix cursor behavior for multiselect in Tree while holding CTRL ([GH-71024](https://github.com/godotengine/godot/pull/71024)). +- Fix code completion override of home and end keys ([GH-71519](https://github.com/godotengine/godot/pull/71519)). +- ItemList: Clarify distinction between disabled and selected in sending signals ([GH-74250](https://github.com/godotengine/godot/pull/74250)). +- Add `inner_item_margin_*` Theme constants to the Tree control ([GH-75460](https://github.com/godotengine/godot/pull/75460)). +- Expose finding valid focus neighbors of a `Control` by side ([GH-76027](https://github.com/godotengine/godot/pull/76027)). +- Fix RichTextLabel character line and paragraph index getters ([GH-76759](https://github.com/godotengine/godot/pull/76759)). +- Add a `[pulse]` built-in effect to RichTextLabel ([GH-77117](https://github.com/godotengine/godot/pull/77117)). +- Fix unnecessary break when calculating the height of visible lines ([GH-77280](https://github.com/godotengine/godot/pull/77280)). +- Prevent disappearance of mouse when SpinBox is hidden while dragging ([GH-77804](https://github.com/godotengine/godot/pull/77804)). +- Make it possible to change character transform in RichTextEffect ([GH-77819](https://github.com/godotengine/godot/pull/77819)). +- Add `loop` property to VideoStreamPlayer ([GH-77857](https://github.com/godotengine/godot/pull/77857)). +- Expose VideoStreamPlayer video length ([GH-77858](https://github.com/godotengine/godot/pull/77858)). +- Ensure that `_drop_physics_mouseover` only happens when necessary ([GH-78078](https://github.com/godotengine/godot/pull/78078)). +- Use S, V in hue bar of ColorPicker ([GH-78100](https://github.com/godotengine/godot/pull/78100)). +- Move registration of `fallbacks` property in the base Font class ([GH-78266](https://github.com/godotengine/godot/pull/78266)). +- Add ability to set the tooltip text of a `TreeItem` button ([GH-78393](https://github.com/godotengine/godot/pull/78393)). +- Make GraphEdit's cpp virtuals equal to gdscript ([GH-78426](https://github.com/godotengine/godot/pull/78426)). +- Fix ColorPicker margin theme property ([GH-78468](https://github.com/godotengine/godot/pull/78468)). +- Embedded Popups store their safe_rect in their embedder ([GH-78476](https://github.com/godotengine/godot/pull/78476)). +- Fix text overlapping icon in `Tree` ([GH-78756](https://github.com/godotengine/godot/pull/78756)). +- Enable `InputEvent`-filtering in `SubViewportContainer` ([GH-78762](https://github.com/godotengine/godot/pull/78762)). +- Fix disabled slider highlighting ([GH-78776](https://github.com/godotengine/godot/pull/78776)). +- Fix delay on tab resizing when (un)hovering tabs ([GH-78777](https://github.com/godotengine/godot/pull/78777)). +- Fix invalid minimum size for translated messages in option button ([GH-78835](https://github.com/godotengine/godot/pull/78835)). +- Fix incorrect property names in `FontFile::_get_property_list()` ([GH-78907](https://github.com/godotengine/godot/pull/78907)). +- Add compatibility properties to `TouchScreenButton` ([GH-78940](https://github.com/godotengine/godot/pull/78940)). +- RTL: Add `pop_all`, `push_context` and `pop_context` methods, and use it for `print_rich` to avoid unclosed tags ([GH-79011](https://github.com/godotengine/godot/pull/79011)). +- Move cached values into `color_mode.cpp` and apply fixes to OKHSL ([GH-79037](https://github.com/godotengine/godot/pull/79037)). +- Bind missing default value for `RichTextLabel` methods ([GH-79053](https://github.com/godotengine/godot/pull/79053)). +- Rename `button_pressed` default signal binding to avoid shadowing ([GH-79064](https://github.com/godotengine/godot/pull/79064)). +- Revert "Fix focusloss of non-exclusive `AcceptDialog` with `close_on_escape`" ([GH-79084](https://github.com/godotengine/godot/pull/79084)). +- Allow to focus individual tabs in `TabBar`/`TabContainer` ([GH-79104](https://github.com/godotengine/godot/pull/79104)). +- Enabled missing Tree title button font and font size theme settings ([GH-79165](https://github.com/godotengine/godot/pull/79165)). +- Debug CanvasItem redraw ([GH-79169](https://github.com/godotengine/godot/pull/79169)). +- Deselect curve point with RMB on the empty space ([GH-79175](https://github.com/godotengine/godot/pull/79175)). +- Add `closed` property to Line2D ([GH-79182](https://github.com/godotengine/godot/pull/79182)). +- Update FileDialog button activity when `file_mode` is changed ([GH-79211](https://github.com/godotengine/godot/pull/79211)). +- Make `SubViewportContainer` event propagation aware of focused Control ([GH-79248](https://github.com/godotengine/godot/pull/79248)). +- HarfBuzz: Update to version 8.0.0 ([GH-79260](https://github.com/godotengine/godot/pull/79260)). +- ICU4C: Update to version 73.2 ([GH-79272](https://github.com/godotengine/godot/pull/79272)). +- FreeType: Update to version 2.13.1 ([GH-79273](https://github.com/godotengine/godot/pull/79273)). +- Check `FLAG_POPUP` to close an AcceptDialog when parent is focused ([GH-79293](https://github.com/godotengine/godot/pull/79293)). +- Remove GraphNode's comment property and related functionality ([GH-79307](https://github.com/godotengine/godot/pull/79307)). +- Clean up/refactor GraphEdit ([GH-79308](https://github.com/godotengine/godot/pull/79308)). +- Clean up/refactor GraphNode and make it more flexible ([GH-79311](https://github.com/godotengine/godot/pull/79311)). +- Fix `Tree` performance regression by using cache ([GH-79325](https://github.com/godotengine/godot/pull/79325)). +- macOS: Add `about_to_open` and `popup_hide` callback for the global menus ([GH-79361](https://github.com/godotengine/godot/pull/79361)). +- Add a default theme for unfocused Windows ([GH-79393](https://github.com/godotengine/godot/pull/79393)). +- Fix Button clipping when internal margins exist ([GH-79455](https://github.com/godotengine/godot/pull/79455)). +- Fix native popups auto-closing when interacting with non-client area ([GH-79456](https://github.com/godotengine/godot/pull/79456)). +- Make `OptionButton` resize when disabling "Fit to Longest Item" ([GH-79494](https://github.com/godotengine/godot/pull/79494)). +- Add drag'n'drop text option for `LineEdit` and `RichTextLabel` ([GH-79563](https://github.com/godotengine/godot/pull/79563)). +- macOS: Fix uncapped frame rate for windows in the non-active workspaces ([GH-79572](https://github.com/godotengine/godot/pull/79572)). +- Fix `root_node_layout_direction` project setting being incorrectly exposed as a range ([GH-79611](https://github.com/godotengine/godot/pull/79611)). +- Fix corner radius not scaling with theme scale in the default theme ([GH-79640](https://github.com/godotengine/godot/pull/79640)). +- Snap CharFX offset to nearest pixel when setting is enabled ([GH-79705](https://github.com/godotengine/godot/pull/79705)). +- Remove spaces from input of HTML color in color picker ([GH-79782](https://github.com/godotengine/godot/pull/79782)). +- Correctly display tooltips for buttons in Tree when they overlap cell content ([GH-79792](https://github.com/godotengine/godot/pull/79792)). +- Prevent SubViewportContainer overriding Subviewport's cursor with its own cursor ([GH-79805](https://github.com/godotengine/godot/pull/79805)). +- RichTextLabel: Ensure the `select_all` function selects all items ([GH-79818](https://github.com/godotengine/godot/pull/79818)). +- [Text Server] Fix ellipsis outline drawing ([GH-79844](https://github.com/godotengine/godot/pull/79844)). +- Label: Remove extra line spacing from Label minimum size calculations ([GH-79913](https://github.com/godotengine/godot/pull/79913)). +- Fix Tree check propagation not unchecking parent items ([GH-79946](https://github.com/godotengine/godot/pull/79946)). +- Free submenu children when clearing PopupMenu ([GH-79965](https://github.com/godotengine/godot/pull/79965)). +- Expose `Window`'s `_get_contents_minimum_size()` to scripting ([GH-80178](https://github.com/godotengine/godot/pull/80178)). +- Handle potential platform-specific `Window` mouse-enter/exit bugs gracefully ([GH-80187](https://github.com/godotengine/godot/pull/80187)). +- Add shortcut handling to `OptionButton` ([GH-80203](https://github.com/godotengine/godot/pull/80203)). +- Improve `Window._get_contents_minimum_size()`'s code ([GH-80219](https://github.com/godotengine/godot/pull/80219)). +- Expose the `TabBar` of a `TabContainer` ([GH-80227](https://github.com/godotengine/godot/pull/80227)). +- Fix scrolling `PopupMenu` on keyboard/controller input ([GH-80271](https://github.com/godotengine/godot/pull/80271)). +- Further separate icon from text of buttons in both editor and default themes ([GH-80285](https://github.com/godotengine/godot/pull/80285)). +- Dismiss currently visible or upcoming tooltips when pressing Escape ([GH-80364](https://github.com/godotengine/godot/pull/80364)). +- Fix `OptionButton` minimum size when "Fit Longest Item" is enabled ([GH-80366](https://github.com/godotengine/godot/pull/80366)). +- Fix `Button` text when the overrun behavior is other than "No Trimming" ([GH-80402](https://github.com/godotengine/godot/pull/80402)). +- RTL: Add support for image dynamic updating, padding, tooltips and size in percent ([GH-80410](https://github.com/godotengine/godot/pull/80410)). +- Fix CodeEdit completion being very slow in certain cases ([GH-80472](https://github.com/godotengine/godot/pull/80472)). +- Support other input methods on Popup/Dialogs' `_input_from_window` ([GH-80594](https://github.com/godotengine/godot/pull/80594)). +- [Bitmap fonts] Add support for scaling ([GH-80605](https://github.com/godotengine/godot/pull/80605)). +- RTL: Improve scroll bar responsiveness during updates ([GH-80606](https://github.com/godotengine/godot/pull/80606)). +- Add buttons to reorder inspector array items without dragging ([GH-80617](https://github.com/godotengine/godot/pull/80617)). +- Fix 2D/3D viewport context switching issues when script editor is floating ([GH-80647](https://github.com/godotengine/godot/pull/80647)). +- TextServer: Fix system font fallback and caret/selection behavior for composite characters ([GH-80650](https://github.com/godotengine/godot/pull/80650)). +- Allow comma as a decimal separator for SpinBox ([GH-80699](https://github.com/godotengine/godot/pull/80699)). +- TextServer: Fix issues with character breaks, add more tests ([GH-80777](https://github.com/godotengine/godot/pull/80777)). +- Fix crash when hiding subwindow during popup of new subwindow ([GH-80780](https://github.com/godotengine/godot/pull/80780)). +- Exit early in `TextEdit::_get_column_pos_of_word` to improve highlight performance ([GH-80809](https://github.com/godotengine/godot/pull/80809)). +- Fix "Go to parent folder" in `EditorFileDialog` ([GH-80821](https://github.com/godotengine/godot/pull/80821)). +- RTL: Fix `remove_paragraph` crashes ([GH-80847](https://github.com/godotengine/godot/pull/80847)). +- RTL: Adds "lang" tag to allow overriding language specific text rendering without starting a new paragraph ([GH-80848](https://github.com/godotengine/godot/pull/80848)). +- RTL: Improve performance by using list iterators for item/paragraph removal ([GH-80857](https://github.com/godotengine/godot/pull/80857)). +- Fix ColorPicker deferred mode not working for sliders ([GH-80916](https://github.com/godotengine/godot/pull/80916)). +- TextServer: Store extra spacing of individual font variations ([GH-80954](https://github.com/godotengine/godot/pull/80954)). +- Deselect multi caret when alt clicking on it ([GH-80956](https://github.com/godotengine/godot/pull/80956)). +- FileDialog: Avoid selecting the first item automatically in Open Folder Mode ([GH-81034](https://github.com/godotengine/godot/pull/81034)). +- Fix setting TabContainer's `font_hovered_color` theme property ([GH-81040](https://github.com/godotengine/godot/pull/81040)). +- RTL: Fix character line index for non-visual characters and characters on the line edge ([GH-81064](https://github.com/godotengine/godot/pull/81064)). +- Move default theme files to `scene/theme` ([GH-81065](https://github.com/godotengine/godot/pull/81065)). +- Only allow finite numbers in `Range.value` ([GH-81076](https://github.com/godotengine/godot/pull/81076)). +- Fix SpinBox not clearing text on improper input ([GH-81094](https://github.com/godotengine/godot/pull/81094)). +- TextServer: Fix SVG emoji placement ([GH-81103](https://github.com/godotengine/godot/pull/81103)). +- Fix a crash when plugin tries to call `make_mesh_previews` on enable ([GH-81121](https://github.com/godotengine/godot/pull/81121)). +- Unfocus LineEdit when pressing Escape ([GH-81128](https://github.com/godotengine/godot/pull/81128)). +- Implement a system to contextualize global themes ([GH-81130](https://github.com/godotengine/godot/pull/81130)). +- ItemList: Draw separators before selected style boxes ([GH-81155](https://github.com/godotengine/godot/pull/81155)). +- Fix TreeItem range slider not working properly ([GH-81174](https://github.com/godotengine/godot/pull/81174)). +- Fix ItemList not updating when icon scale changes ([GH-81268](https://github.com/godotengine/godot/pull/81268)). +- Fix ThemeDB initialization in tests ([GH-81305](https://github.com/godotengine/godot/pull/81305)). +- Register theme properties with ThemeDB ([GH-81312](https://github.com/godotengine/godot/pull/81312)). +- Update and properly list versions of the built-in fonts ([GH-81326](https://github.com/godotengine/godot/pull/81326)). +- Fix `TextEdit.get_rect_at_line_column returning` negative pos even though cursor is in viewable area of the control ([GH-81354](https://github.com/godotengine/godot/pull/81354)). +- TextServer: Use locale or first span language to select preferred direction for neutral text ([GH-81361](https://github.com/godotengine/godot/pull/81361)). +- Remove unnecessary validity checks from `Button` and `TextureRect` ([GH-81383](https://github.com/godotengine/godot/pull/81383)). +- Fix TextEdit placeholder with Inherited text direction ([GH-81396](https://github.com/godotengine/godot/pull/81396)). +- TextServer: Pass Dictionary properties by value and check property values instead of references ([GH-81406](https://github.com/godotengine/godot/pull/81406)). +- Fix subpixel layouts in text rendering ([GH-81438](https://github.com/godotengine/godot/pull/81438)). +- LineEdit: Update line edit offset on text delete ([GH-81443](https://github.com/godotengine/godot/pull/81443)). +- Correctly setup tooltip's style as theme variation ([GH-81463](https://github.com/godotengine/godot/pull/81463)). +- Fix submenu alignment with parent menu item ([GH-81477](https://github.com/godotengine/godot/pull/81477)). +- Fix accessing editor theme items throughout the UI ([GH-81516](https://github.com/godotengine/godot/pull/81516)). +- Hide the `dialog_text` property from `FileDialog` ([GH-81546](https://github.com/godotengine/godot/pull/81546)). +- Bind remaining theme properties to their respective classes ([GH-81551](https://github.com/godotengine/godot/pull/81551)). +- Improve the looks of 2D/3D viewport contextual toolbars ([GH-81557](https://github.com/godotengine/godot/pull/81557)). +- Use bound theme properties for documentation ([GH-81573](https://github.com/godotengine/godot/pull/81573)). +- Make `GraphEdit` toolbar more customizable ([GH-81582](https://github.com/godotengine/godot/pull/81582)). +- Fix GraphEdit port valid connections incorrectly checking sides ([GH-81600](https://github.com/godotengine/godot/pull/81600)). +- Expose `PopupMenu` `activate_item_by_event` method ([GH-81621](https://github.com/godotengine/godot/pull/81621)). +- Fix SpinBox will reset unsubmitted text when redrawing ([GH-81638](https://github.com/godotengine/godot/pull/81638)). +- Remove the equality check for `TabBar.set_tab_metadata` ([GH-81648](https://github.com/godotengine/godot/pull/81648)). +- Enable transparent background for GUI tooltips ([GH-81669](https://github.com/godotengine/godot/pull/81669)). +- Connect `CodeHighlighter` with `TextEdit` without friend-access ([GH-81921](https://github.com/godotengine/godot/pull/81921)). +- Replace flat buttons with flat-styled buttons with a visible pressed state ([GH-81939](https://github.com/godotengine/godot/pull/81939)). +- Check for type variations in inherited themes ([GH-82218](https://github.com/godotengine/godot/pull/82218)). +- Fix tooltips behaving incorrectly on `Tree` nodes ([GH-82226](https://github.com/godotengine/godot/pull/82226)). +- Add Font and Mesh icons that aren't grayed out ([GH-82302](https://github.com/godotengine/godot/pull/82302)). +- Rename close requests to delete requests in `GraphEdit` ([GH-82370](https://github.com/godotengine/godot/pull/82370)). +- Make hovered tabs be drawn with the unselected's width at minimum ([GH-82384](https://github.com/godotengine/godot/pull/82384)). +- Document, cleanup and fix some theme properties ([GH-82409](https://github.com/godotengine/godot/pull/82409)). +- TextServer: Store font extra spacing variations without making a full copy of font ([GH-82475](https://github.com/godotengine/godot/pull/82475)). +- FileDialog: Make `set_visible` compatible with native dialogs ([GH-82552](https://github.com/godotengine/godot/pull/82552)). +- Tweak the region folding icons ([GH-82653](https://github.com/godotengine/godot/pull/82653)). +- Fix storing invalid item height values in `ItemList` ([GH-82660](https://github.com/godotengine/godot/pull/82660)). +- SystemFont: Check name when selecting the best matching face from a collection ([GH-82712](https://github.com/godotengine/godot/pull/82712)). +- [File Dialog] Do not open native file dialogs in the edited scene ([GH-82743](https://github.com/godotengine/godot/pull/82743)). +- Organize TextEdit's inspector ([GH-82776](https://github.com/godotengine/godot/pull/82776)). +- Place LineEdit secret in its own section ([GH-82811](https://github.com/godotengine/godot/pull/82811)). +- Accept cancel event when unfocusing LineEdit ([GH-82914](https://github.com/godotengine/godot/pull/82914)). +- Fix right-click menu position for the debugger breakpoint tree ([GH-82924](https://github.com/godotengine/godot/pull/82924)). +- RTL: Remove unnecessary glyph position rounding ([GH-82970](https://github.com/godotengine/godot/pull/82970)). +- Do not apply extra spacing twice ([GH-83062](https://github.com/godotengine/godot/pull/83062)). +- Allow clicking buttons of non-selectable TreeItems ([GH-83065](https://github.com/godotengine/godot/pull/83065)). +- Remove vertical scrollbar padding from line width calc ([GH-83286](https://github.com/godotengine/godot/pull/83286)). +- Fix phantom tab right button ([GH-83296](https://github.com/godotengine/godot/pull/83296)). +- Fix incorrect offset of `PopupMenu` separator icons ([GH-83517](https://github.com/godotengine/godot/pull/83517)). +- Add bulk change guards to successive theme overrides in Editor and GUI ([GH-83626](https://github.com/godotengine/godot/pull/83626)). +- Fix `TabBar` and `TabContainer` dragging issues ([GH-83637](https://github.com/godotengine/godot/pull/83637)). +- Fix missing initial position modes for the main window ([GH-83824](https://github.com/godotengine/godot/pull/83824)). +- TextServerAdvanced: Keep dynamically loaded ICU data in memory ([GH-83827](https://github.com/godotengine/godot/pull/83827)). +- Increase precision of RAW mode in ColorPicker ([GH-83851](https://github.com/godotengine/godot/pull/83851)). +- Fix GraphNode slot index inconsistency ([GH-83892](https://github.com/godotengine/godot/pull/83892)). +- Save current tab in `TabBar` and `TabContainer` ([GH-83893](https://github.com/godotengine/godot/pull/83893)). +- Fix BaseButton `shortcut_feedback`'s timer will raise error when the button is removed from the scene tree ([GH-83925](https://github.com/godotengine/godot/pull/83925)). +- Translate TextEdit placeholder ([GH-83946](https://github.com/godotengine/godot/pull/83946)). +- Ensure input event is valid in `PopupMenu::activate_item_by_event` ([GH-83952](https://github.com/godotengine/godot/pull/83952)). +- [Menu Bar] Update min. size when items are added/removed/changed ([GH-83961](https://github.com/godotengine/godot/pull/83961)). +- Fix disabled tabs being selected when removing the current one ([GH-83963](https://github.com/godotengine/godot/pull/83963)). +- Fix `TabContainer` drag to rearrange issue ([GH-83966](https://github.com/godotengine/godot/pull/83966)). +- Fix TreeItem truncating node names too much when using a custom icon ([GH-84001](https://github.com/godotengine/godot/pull/84001)). +- Add foreign validation warning for rename actions ([GH-84022](https://github.com/godotengine/godot/pull/84022)). +- Include empty type variations in `Theme::get_type_list` ([GH-84127](https://github.com/godotengine/godot/pull/84127)). +- [Text Mesh] Fix incorrectly cached glyph offsets ([GH-84180](https://github.com/godotengine/godot/pull/84180)). +- Fix `activate_item_by_event` infinite recursion crash ([GH-84183](https://github.com/godotengine/godot/pull/84183)). +- TextServer: Fix glyph comparator ambiguous output ([GH-84232](https://github.com/godotengine/godot/pull/84232)). +- RTL: Fix underline/strikethrough line color changes ([GH-84233](https://github.com/godotengine/godot/pull/84233)). +- TextServer: Fix line breaks for dropcap and resizing embedded objects ([GH-84287](https://github.com/godotengine/godot/pull/84287)). +- Fix `ColorPicker` shape icon is invisible until shape is changed ([GH-84535](https://github.com/godotengine/godot/pull/84535)). +- Make mouse enter/exit notifications match mouse events ([GH-84547](https://github.com/godotengine/godot/pull/84547)). +- RTL: Fix list bullet alignment ([GH-84605](https://github.com/godotengine/godot/pull/84605)). +- Warn about autowrapped labels in containers ([GH-84662](https://github.com/godotengine/godot/pull/84662)). +- Allow auto-generated node names in `PopupMenu::add_submenu_item` ([GH-84668](https://github.com/godotengine/godot/pull/84668)). +- Add protection in `RichTextLabel.update_image` to prevent crash ([GH-84833](https://github.com/godotengine/godot/pull/84833)). +- Make Tree's `set_selected` check if the TreeItem belongs to the tree ([GH-84870](https://github.com/godotengine/godot/pull/84870)). +- Fix remapped font reloading on locale change ([GH-84873](https://github.com/godotengine/godot/pull/84873)). +- RTL: Fix excessive underline and table border draw calls ([GH-84874](https://github.com/godotengine/godot/pull/84874)). +- Add GraphEdit connection layer child as internal ([GH-85009](https://github.com/godotengine/godot/pull/85009)). +- Fix crash when hiding a Control during mouse-entering ([GH-85284](https://github.com/godotengine/godot/pull/85284)). +- Fix crash on late mouse enter/exit event arrival ([GH-85418](https://github.com/godotengine/godot/pull/85418)). #### Import -- Remove hardcoded names in generated objects in scene importer ([GH-47279](https://github.com/godotengine/godot/pull/47279)). +- Fix ImageTextureLayered serialization issues ([GH-71394](https://github.com/godotengine/godot/pull/71394)). +- Add support for KTX image format so that we can use Basis Universal for GLTF ([GH-76572](https://github.com/godotengine/godot/pull/76572)). +- Add more physics options to the Scene importer ([GH-77533](https://github.com/godotengine/godot/pull/77533)). +- Fix reimporting files with non lowercase name extension ([GH-78567](https://github.com/godotengine/godot/pull/78567)). +- Add support for GLTF extension KHR_materials_emissive_strength ([GH-78621](https://github.com/godotengine/godot/pull/78621)). +- GLTF: Internal renames in material parsing code ([GH-78622](https://github.com/godotengine/godot/pull/78622)). +- Add layer, shadow and visibility range options to the Scene importer ([GH-78803](https://github.com/godotengine/godot/pull/78803)). +- Allow change import type without restarting editor ([GH-78890](https://github.com/godotengine/godot/pull/78890)). +- Fix property hint class name type string restriction and replace mode ([GH-79139](https://github.com/godotengine/godot/pull/79139)). +- Lossy WebP: Enable sharp RGB to YUV conversion ([GH-79257](https://github.com/godotengine/godot/pull/79257)). +- Add copyright to GLTFState ([GH-79267](https://github.com/godotengine/godot/pull/79267)). +- GLTF: Allow specifying export image format including from extensions ([GH-79314](https://github.com/godotengine/godot/pull/79314)). +- Add `KHR_materials_emissive_strength` extension support for exporting GLTFs ([GH-79421](https://github.com/godotengine/godot/pull/79421)). +- GLTF: Preserve the original bytes when extracting a texture while importing ([GH-79533](https://github.com/godotengine/godot/pull/79533)). +- Add `export_preserialize` to the GLTF export process ([GH-79623](https://github.com/godotengine/godot/pull/79623)). +- Set `base_path` and `filename` during GLTF export when writing to a file ([GH-79636](https://github.com/godotengine/godot/pull/79636)). +- Improve overriding the root type or root name in the scene importer ([GH-79774](https://github.com/godotengine/godot/pull/79774)). +- Cosmetic changes in GLTF node generation code ([GH-79775](https://github.com/godotengine/godot/pull/79775)). +- Improve GLTF export logic for scene root nodes ([GH-79801](https://github.com/godotengine/godot/pull/79801)). +- Fix reimporting scene with default values selected ([GH-79907](https://github.com/godotengine/godot/pull/79907)). +- Update ThorVG to v0.10.0 ([GH-80095](https://github.com/godotengine/godot/pull/80095)). +- Fix error message when reimporting resources with an empty scene open ([GH-80149](https://github.com/godotengine/godot/pull/80149)). +- More cosmetic improvements in the GLTF code ([GH-80205](https://github.com/godotengine/godot/pull/80205)). +- Fix doubly-reserved unique names in GLTF scene name assignment ([GH-80270](https://github.com/godotengine/godot/pull/80270)). +- GLTF: Improve logic for keeping track of the real root node ([GH-80272](https://github.com/godotengine/godot/pull/80272)). +- Use image index instead of texture index for `source_images` ([GH-80314](https://github.com/godotengine/godot/pull/80314)). +- Register and cleanup resource importer singletons in a predictable way ([GH-80377](https://github.com/godotengine/godot/pull/80377)). +- GLTF: Add center of mass property ([GH-80463](https://github.com/godotengine/godot/pull/80463)). +- Limit mesh complexity in LOD generation to prevent crashing ([GH-80467](https://github.com/godotengine/godot/pull/80467)). +- Fixed editor filesystem/import properties not being caught by the doctool ([GH-80576](https://github.com/godotengine/godot/pull/80576)). +- GLTF: Add a comment for skinned mesh tree placement ([GH-80807](https://github.com/godotengine/godot/pull/80807)). +- Fix skeletons when generating multiple Godot scenes from one GLTF ([GH-80831](https://github.com/godotengine/godot/pull/80831)). +- Make DDS loading code only check for R channel bitmask when loading grayscale images ([GH-80862](https://github.com/godotengine/godot/pull/80862)). +- Update Importing 3D scenes links to match splitting PR ([GH-80872](https://github.com/godotengine/godot/pull/80872)). +- Fix "Import Defaults" selector not being initialized incorrectly ([GH-80914](https://github.com/godotengine/godot/pull/80914)). +- Fix grayscale DDS loading ([GH-81134](https://github.com/godotengine/godot/pull/81134)). +- Update Blender export flags for 3.6 ([GH-81194](https://github.com/godotengine/godot/pull/81194)). +- GLTF: Change "Camera3D" generated node name to "Camera" ([GH-81264](https://github.com/godotengine/godot/pull/81264)). +- GLTF: Add root node export options and `GODOT_single_root` extension ([GH-81851](https://github.com/godotengine/godot/pull/81851)). +- Fix ImporterMesh bone weight handling during lightmap unwrap ([GH-81854](https://github.com/godotengine/godot/pull/81854)). +- Disable bounding box shadows for advanced scene importer ([GH-82190](https://github.com/godotengine/godot/pull/82190)). +- Fix GLTF importer forcing vertex colors on all materials ([GH-82272](https://github.com/godotengine/godot/pull/82272)). +- Avoid crash when generating LODs on meshes with non-finite vertices ([GH-82285](https://github.com/godotengine/godot/pull/82285)). +- Fix Image import crash ([GH-82408](https://github.com/godotengine/godot/pull/82408)). +- Avoid import dock cleanup for non-loadable assets ([GH-82490](https://github.com/godotengine/godot/pull/82490)). +- Fix the Advanced Import Settings window's 3D camera ([GH-82591](https://github.com/godotengine/godot/pull/82591)). +- ThorVG: update to v0.11.1 ([GH-83281](https://github.com/godotengine/godot/pull/83281)). +- Make translation importer skip not-supported lang tag, make it more robust ([GH-83600](https://github.com/godotengine/godot/pull/83600)). +- Prevent crash from importing a certain kind of invalid GLTF ([GH-83663](https://github.com/godotengine/godot/pull/83663)). +- Fix infinite loop when importing 3D object named "-colonly" ([GH-83764](https://github.com/godotengine/godot/pull/83764)). +- Fix crash when reimporting with Skeleton3D selected ([GH-83964](https://github.com/godotengine/godot/pull/83964)). +- Add method check for `_notify_skeleton_bones_renamed` ([GH-83986](https://github.com/godotengine/godot/pull/83986)). +- Enhance checks and user experience around tangent arrays in meshes ([GH-84252](https://github.com/godotengine/godot/pull/84252)). +- Implement glTF compatibility system for files imported in older Godot versions ([GH-84271](https://github.com/godotengine/godot/pull/84271)). +- Scan the filesystem in the first frame when using headless mode ([GH-84570](https://github.com/godotengine/godot/pull/84570)). +- Use the Blender file name instead of the generated GLTF file name ([GH-84678](https://github.com/godotengine/godot/pull/84678)). +- Fix Resource Importer use after free ([GH-84872](https://github.com/godotengine/godot/pull/84872)). #### Input -- Increase joystick max button number to 128 ([GH-56666](https://github.com/godotengine/godot/pull/56666)). - * Windows and macOS support up to 128, Linux supports up to 80, and Android supports up to 36. -- Use mouse event relative motion to calculate mouse speed ([GH-56755](https://github.com/godotengine/godot/pull/56755)). -- Drop mouse focus and over when gui input is globally disabled ([GH-59100](https://github.com/godotengine/godot/pull/59100)). - * This is optional and controlled by the `gui/common/drop_mouse_on_gui_input_disabled` project setting. For compatibility, this setting is disabled by default on pre-3.5 projects and enabled by default for new projects. -- Add "(Physical)" label to physical scancodes in `InputEventKey.as_text()` ([GH-62633](https://github.com/godotengine/godot/pull/62633)). -- Re-enable input accumulation disabled by error in 3.4 ([GH-62826](https://github.com/godotengine/godot/pull/62826)). - * If this changes behavior in a way that doesn't fit your project, you can change it back with `Input.use_accumulated_input = false`. - -#### Mono (C#) - -- Don't box params on Native->C# calls with Variant params ([GH-53942](https://github.com/godotengine/godot/pull/53942)). -- `String.Capitalize()` now matches the behavior of the core `String.capitalize()` ([GH-57076](https://github.com/godotengine/godot/pull/57076)). +- Check if input marked handled before processing additional CollisionObjects ([GH-48800](https://github.com/godotengine/godot/pull/48800)). +- Add Unit tests for viewport.cpp Physics 2D Picking ([GH-73477](https://github.com/godotengine/godot/pull/73477)). +- Fix code editor scrolling experience on track pads ([GH-73502](https://github.com/godotengine/godot/pull/73502)). +- Prevent double input events on gamepad when running through steam input ([GH-76045](https://github.com/godotengine/godot/pull/76045)). +- Implement `DisplayServer.keyboard_get_label_from_physical` method ([GH-77993](https://github.com/godotengine/godot/pull/77993)). +- Fix Physics Picking captured Object initialization ([GH-78383](https://github.com/godotengine/godot/pull/78383)). +- Add the ability to get per-platform information for joypads ([GH-78539](https://github.com/godotengine/godot/pull/78539)). +- Mention Xbox menu button by name in Start button description ([GH-78701](https://github.com/godotengine/godot/pull/78701)). +- Android: Set `echo` property for the physical keyboard events ([GH-79089](https://github.com/godotengine/godot/pull/79089)). +- Fix physics passive hovering with `MOUSE_FILTER_IGNORE` ([GH-79443](https://github.com/godotengine/godot/pull/79443)). +- Make GridMap shortcuts editable and not conflict with other plugins ([GH-79529](https://github.com/godotengine/godot/pull/79529)). +- Separate input-handled-state for different events during physics-picking ([GH-79546](https://github.com/godotengine/godot/pull/79546)). +- Fix crash on Windows when closing `Window` ([GH-80142](https://github.com/godotengine/godot/pull/80142)). +- Ensure TileMap editor shortcuts are handled ([GH-80317](https://github.com/godotengine/godot/pull/80317)). +- Fix nodes receiving mouse events in black bars of `Window` ([GH-80334](https://github.com/godotengine/godot/pull/80334)). +- Properly load multiple action sets in XR ([GH-80419](https://github.com/godotengine/godot/pull/80419)). +- Ensure `joy_connection_changed` is emitted on the main thread ([GH-80432](https://github.com/godotengine/godot/pull/80432)). +- Android Stylus pressure and tilt support ([GH-80644](https://github.com/godotengine/godot/pull/80644)). +- Fix GridMap shortcuts that should not be physical ([GH-80774](https://github.com/godotengine/godot/pull/80774)). +- Fix action state when multiple events are assigned ([GH-80859](https://github.com/godotengine/godot/pull/80859)). +- Fix Android input routing logic when using a hardware keyboard ([GH-80932](https://github.com/godotengine/godot/pull/80932)). +- Add missing YEN, SECTION and OPENURL names to keycode mappings ([GH-81054](https://github.com/godotengine/godot/pull/81054)). +- Prevent axis-based actions from getting stuck ([GH-81170](https://github.com/godotengine/godot/pull/81170)). +- Android: Fix joypad trigger value range ([GH-81322](https://github.com/godotengine/godot/pull/81322)). +- Fix `Input.is_action_just_pressed` flicker on joypad axes ([GH-82056](https://github.com/godotengine/godot/pull/82056)). +- Make InputEventShortcut always pressed ([GH-82203](https://github.com/godotengine/godot/pull/82203)). +- Sync controller mappings DB with SDL2 community repo ([GH-82245](https://github.com/godotengine/godot/pull/82245)). +- Add XInput device ID for wireless Series 2 Elite controller ([GH-82508](https://github.com/godotengine/godot/pull/82508)). +- Fix the timeframe when the Android gestures properties are retrieved ([GH-83173](https://github.com/godotengine/godot/pull/83173)). +- Fix Android logic for deferred window input events being inverted ([GH-83301](https://github.com/godotengine/godot/pull/83301)). +- Fix shortcut input for `EditorSceneTabs` ([GH-83501](https://github.com/godotengine/godot/pull/83501)). +- Sync controller mappings DB with SDL2 community repo ([GH-83845](https://github.com/godotengine/godot/pull/83845)). +- Add save shortcut for text shader editor to prevent it propagating to scene ([GH-84064](https://github.com/godotengine/godot/pull/84064)). +- Fix stuck cursor in Advanced Scene Importer ([GH-84661](https://github.com/godotengine/godot/pull/84661)). +- Rework input actions to be reliable ([GH-84685](https://github.com/godotengine/godot/pull/84685)). + +#### Multiplayer + +- Disallow nested custom multiplayers in `SceneTree` ([GH-77829](https://github.com/godotengine/godot/pull/77829)). +- Prevent crash when accessing `Node` Multiplayer from thread ([GH-79332](https://github.com/godotengine/godot/pull/79332)). +- Use `get/set_indexed` in MultiplayerSynchronizer ([GH-79479](https://github.com/godotengine/godot/pull/79479)). +- [Net/ENet] Better handle truncated socket messages ([GH-79699](https://github.com/godotengine/godot/pull/79699)). +- ENet: Properly set transfer flags when using custom channels ([GH-80293](https://github.com/godotengine/godot/pull/80293)). +- Fix watch properties not being correctly removed ([GH-81033](https://github.com/godotengine/godot/pull/81033)). +- Improve SceneReplicationConfig editor UX + optimizations ([GH-81136](https://github.com/godotengine/godot/pull/81136)). +- Various performance optimizations ([GH-82777](https://github.com/godotengine/godot/pull/82777)). +- Copy network authority when instancing placeholders ([GH-82846](https://github.com/godotengine/godot/pull/82846)). +- Fix synchronizer init and reset ([GH-83264](https://github.com/godotengine/godot/pull/83264)). +- Fix "on change" indexed properties ([GH-83279](https://github.com/godotengine/godot/pull/83279)). +- Display multiplayer authority ID in remote debugger ([GH-83437](https://github.com/godotengine/godot/pull/83437)). #### Navigation -- Navigation APIs fully refactored to make use of the new NavigationServer with collision avoidance (see "Added" section). While we aimed to keep the APIs as compatible as possible, this is a **breaking change** and might impact how existing Navigation setups behave. - * The Navigation and Navigation2D nodes were kept for compatibility but are now deprecated. Their functionality is replaced by the NavigationServer and Navigation2DServer. -- Consider gridmap collisions in navigation bake ([GH-57173](https://github.com/godotengine/godot/pull/57173)). - -#### Networking - -- ENet poll optimizations, fragmented unreliable transfer ([GH-53130](https://github.com/godotengine/godot/pull/53130)). -- Make WebSocket hostname resolution non-blocking ([GH-57649](https://github.com/godotengine/godot/pull/57649)). -- Increase the maximum number of concurrent DNS queries from 32 to 256 ([GH-59520](https://github.com/godotengine/godot/pull/59520)). -- Use a floating-point number for the `timeout` property in HTTPRequest ([GH-60402](https://github.com/godotengine/godot/pull/60402)). - -#### Physics - -- Bullet: Return contact points in world space in `collide_shape` ([GH-59470](https://github.com/godotengine/godot/pull/59470)). -- Bullet: Do not set gravity and damping when Custom Integrator is enabled ([GH-62708](https://github.com/godotengine/godot/pull/62708)). - -#### Porting - -- Android: Default target API level updated to 32 ([GH-51815](https://github.com/godotengine/godot/pull/51815)). -- Android: Upgrade NDK to r23 LTS ([GH-61692](https://github.com/godotengine/godot/pull/61692)). -- HTML5: Enable mbedTLS module for Crypto object ([GH-61402](https://github.com/godotengine/godot/pull/61402)). -- iOS: Improve icon / loading screen export ([GH-56861](https://github.com/godotengine/godot/pull/56861)). -- iOS: Vibrate using haptics engine on supported devices ([GH-60398](https://github.com/godotengine/godot/pull/60398)). -- Linux: Use application name as PulseAudio device name ([GH-54654](https://github.com/godotengine/godot/pull/54654)). -- Linux: Read and store joypad events in a separate thread ([GH-56126](https://github.com/godotengine/godot/pull/56126)). -- macOS: Fix translation detection for editor and template ([GH-52945](https://github.com/godotengine/godot/pull/52945), [GH-57577](https://github.com/godotengine/godot/pull/57577)). -- macOS: Redraw window during resize and modal popups ([GH-54757](https://github.com/godotengine/godot/pull/54757)). -- Windows: Improve console handling and execute ([GH-55987](https://github.com/godotengine/godot/pull/55987)). - * This changes the editor console handling to be like on Unix systems (Linux and macOS). So Godot doesn't open with a console by default, but you can see console output if you start it from a console yourself. You can create a batch script or shortcut to automatically start Godot from a console as in previous releases. -- Windows: Keep editor at normal priority ([GH-59665](https://github.com/godotengine/godot/pull/59665)). -- Windows: Try to convert `OS::execute()` output to Unicode ([GH-60920](https://github.com/godotengine/godot/pull/60920)). - -#### Rendering - -- Prevent use of Opaque Pre-Pass's threshold on top of Alpha Scissor ([GH-45372](https://github.com/godotengine/godot/pull/45372)). -- Improve the appearance of simple parallax in SpatialMaterial ([GH-51433](https://github.com/godotengine/godot/pull/51433)). -- Use early bailing to improve 3D shadow filtering performance in GLES3 ([GH-54160](https://github.com/godotengine/godot/pull/54160)). -- Faster editor line drawing - Path2D and `draw_line` ([GH-54377](https://github.com/godotengine/godot/pull/54377)). -- Bind mesh merging functionality in MeshInstance ([GH-57661](https://github.com/godotengine/godot/pull/57661)). -- Sort transparent objects based on camera position when using perspective camera ([GH-60381](https://github.com/godotengine/godot/pull/60381)). -- GLES2: Unpack blend shape arrays when necessary ([GH-60829](https://github.com/godotengine/godot/pull/60829)). -- Portals: Show gridmaps using global mode ([GH-60851](https://github.com/godotengine/godot/pull/60851)). -- CPU lightmapper: Account for ambient light settings when baking lights ([GH-62260](https://github.com/godotengine/godot/pull/62260)). -- GLES3: Ignore support for S3TC texture compression on Android and iOS devices ([GH-62909](https://github.com/godotengine/godot/pull/62909)). - * Few devices support this compression while they all support ETC2. Godot exports ETC2 by default and doesn't take into account that mobile devices could need S3TC. - -#### Thirdparty - -- Bullet updated to version 3.24. -- FreeType updated to version 2.12.1. -- libogg updated to version 1.3.5. -- libvorbis updated to version 1.3.7. -- libwebp updated to version 1.2.2. -- MbedTLS updated to version 2.28.1 (security update). -- PCRE2 updated to version 10.40. -- tinyexr updated to version 1.0.1. -- zlib/minizip updated to version 1.2.12 (security update). -- zstd updated to version 1.5.0. -- CA root certificates updated to 2022-07-19 bundle from Mozilla. -- SDL GameControllerDB updated to 2022-08-02 git snapshot. - -#### XR - -- Updated Meta hand tracking version ([GH-60639](https://github.com/godotengine/godot/pull/60639)). - -### Removed - -#### Porting - -- Android: Drop broken 32-bit framebuffer setting ([GH-54431](https://github.com/godotengine/godot/pull/54431)). - -#### Shaders - -- Removed support for `1f` or `0f` float literal syntax which is invalid in GLSL ([GH-55623](https://github.com/godotengine/godot/pull/55623)). - Floats should be written with a decimal separator (`1.0f` or `0.f`). - -### Fixed - -#### 2D - -- Fixes to Camera2D position and first update ([GH-63084](https://github.com/godotengine/godot/pull/63084), [GH-63581](https://github.com/godotengine/godot/pull/63581)). -- Fix CanvasItem not exiting its canvas group on canvas exit ([GH-63234](https://github.com/godotengine/godot/pull/63234)). - -#### 3D - -- Fix hardcoded raycast distance in viewport object picking ([GH-54369](https://github.com/godotengine/godot/pull/54369)). -- Properly handle CSGShape parent and visibility updates ([GH-58938](https://github.com/godotengine/godot/pull/58938)). - -#### Animation - -- Fix cubic interpolation when looping ([GH-58651](https://github.com/godotengine/godot/pull/58651)). -- Fix AnimatedSprite doesn't emit `animation_finished` when changing playback direction ([GH-61085](https://github.com/godotengine/godot/pull/61085)). - -#### Audio - -- Fix crash in AudioServer when switching audio devices with different audio channels count ([GH-59778](https://github.com/godotengine/godot/pull/59778)). - -#### Core - -- Rationalize Node removals and deletions ([GH-55514](https://github.com/godotengine/godot/pull/55514), [GH-56519](https://github.com/godotengine/godot/pull/56519)). -- Fix incorrect RID cleanup in Rasterizers ([GH-55669](https://github.com/godotengine/godot/pull/55669), [GH-55701](https://github.com/godotengine/godot/pull/55701)). -- Fix wrong RGBA channel mapping when saving OpenEXR ([GH-56715](https://github.com/godotengine/godot/pull/56715)). -- Fix `AtlasTexture` nesting ([GH-56795](https://github.com/godotengine/godot/pull/56795)). -- Clear owners when pruning even out of the tree ([GH-59063](https://github.com/godotengine/godot/pull/59063)). -- Fix `wrapf` to correct wrap values with 0.1 stepping ([GH-61812](https://github.com/godotengine/godot/pull/61812)). -- Fix platform-specific issues with `OS.set_current_screen()` ([GH-63192](https://github.com/godotengine/godot/pull/63192)). - -#### Editor - -- Unify determination of default property values ([GH-52944](https://github.com/godotengine/godot/pull/52944)). -- Ignore external editor for built-in scripts ([GH-54578](https://github.com/godotengine/godot/pull/54578)). -- Fix decoding UTF-8 filenames on unzipping ([GH-56517](https://github.com/godotengine/godot/pull/56517)). -- Fix inspecting nested dictionaries/arrays when debugging ([GH-60737](https://github.com/godotengine/godot/pull/60737)). -- Fix editor-only visibility for lights ([GH-62335](https://github.com/godotengine/godot/pull/62335)). - -#### GDNative - -- Fix StringName equal and less operators ([GH-63104](https://github.com/godotengine/godot/pull/63104)). - -#### GDScript - -- Don't ignore type mismatch in setter function ([GH-54117](https://github.com/godotengine/godot/pull/54117)). -- Clear pending function states when reloading GDScript ([GH-56296](https://github.com/godotengine/godot/pull/56296)). -- Fix variable type inference on release ([GH-57851](https://github.com/godotengine/godot/pull/57851)). -- Fix wrong parentheses for function call autocompletion in LSP ([GH-59482](https://github.com/godotengine/godot/pull/59482)). -- Fix autocompletion showing core class names with an underscore ([GH-62731](https://github.com/godotengine/godot/pull/62731)). - -#### GUI - -- GraphEdit: Fix toggling minimap with `minimap_enabled` ([GH-57239](https://github.com/godotengine/godot/pull/57239)). -- GraphEdit: Fix valid connections being reversed ([GH-60124](https://github.com/godotengine/godot/pull/60124)). -- GridContainer: Fix not ignoring top-level children ([GH-60221](https://github.com/godotengine/godot/pull/60221)). -- Label: Fix autowrap for CJK text ([GH-60294](https://github.com/godotengine/godot/pull/60294)). -- LineEdit: Fix clear button for asymmetric stylebox ([GH-61496](https://github.com/godotengine/godot/pull/61496)). -- Popup: Allow changing `exclusive` when already popped ([GH-61483](https://github.com/godotengine/godot/pull/61483)). -- RichTextLabel: Fix underlines and strikethrough not respecting visible character ([GH-37656](https://github.com/godotengine/godot/pull/37656)). -- RichTextLabel: Fix shadow color when text has transparency ([GH-59054](https://github.com/godotengine/godot/pull/59054)). -- RichTextLabel: Fix implementation of `remove_line()` ([GH-60618](https://github.com/godotengine/godot/pull/60618)). -- TextureButton: Fix focus texture logic ([GH-56472](https://github.com/godotengine/godot/pull/56472)). -- TextureProgress: Fix nine patch in circular mode ([GH-54345](https://github.com/godotengine/godot/pull/54345)). - -#### Import - -- Fix import hints breaking node paths in animations ([GH-56956](https://github.com/godotengine/godot/pull/56956)). -- glTF: Skip unsupported Draco-compressed glTF 3D format ([GH-56613](https://github.com/godotengine/godot/pull/56613)). -- glTF: Fix texture filename decoding ([GH-57685](https://github.com/godotengine/godot/pull/57685)). -- glTF: Allow more than 4 joints but warn and ignore them ([GH-61912](https://github.com/godotengine/godot/pull/61912)). -- glTF: Fix light intensity and attenuation import ([GH-62747](https://github.com/godotengine/godot/pull/62747)). - -#### Input - -- Fix InputEvent action exact match ([GH-54174](https://github.com/godotengine/godot/pull/54174)). - -#### Mono (C#) - -- Fix C# `get_all_delegates` method for generic classes ([GH-55564](https://github.com/godotengine/godot/pull/55564)). -- Fix getting properties state when reloading C# ([GH-56300](https://github.com/godotengine/godot/pull/56300)). -- Fix Android AAB export failing to load native libs ([GH-57420](https://github.com/godotengine/godot/pull/57420)). -- Fix `Transform.Translated` method affecting the original transform ([GH-63685](https://github.com/godotengine/godot/pull/63685)). - -#### Networking - -- Fix HTTP limitation for large `content-length` ([GH-56331](https://github.com/godotengine/godot/pull/56331)). - -#### Physics - -- Bullet: Update Area overlaps when Area properties or shapes change ([GH-42306](https://github.com/godotengine/godot/pull/42306)). -- Bullet: Trigger RigidBody space override updates when Area properties change ([GH-42374](https://github.com/godotengine/godot/pull/42374)). -- Bullet: Add shape data to Area overlap data ([GH-42712](https://github.com/godotengine/godot/pull/42712)). -- Bullet: Fix Continuous Collision Detection being wrongly enabled by default ([GH-43801](https://github.com/godotengine/godot/pull/43801)). -- Bullet: Ignore collision contact points with distance = 0 ([GH-44726](https://github.com/godotengine/godot/pull/44726)). -- Bullet: Fix shape index in multiple physics queries ([GH-55533](https://github.com/godotengine/godot/pull/55533)). -- Bullet: KinematicBody compound shape collision fix ([GH-56801](https://github.com/godotengine/godot/pull/56801)). -- Bullet: Skip compound shapes without child shapes in `recover_from_penetration` ([GH-59864](https://github.com/godotengine/godot/pull/59864)). -- Bullet: Do not set gravity and damping when Custom Integrator is enabled ([GH-62708](https://github.com/godotengine/godot/pull/62708)). - * Fixes a lot of issues with KinematicBody collisions at the intersection between meshes when using Bullet. -- GodotPhysics: Fix Area monitorable in 2D and 3D ([GH-41699](https://github.com/godotengine/godot/pull/41699)). -- GodotPhysics: Handle test body motion with 0 margin ([GH-55762](https://github.com/godotengine/godot/pull/55762)). -- Fix wrong collision reported on `move_and_collide()` ([GH-59439](https://github.com/godotengine/godot/pull/59439)). -- Fix the calculation of the angular velocity ([GH-63190](https://github.com/godotengine/godot/pull/63190)). - -#### Porting - -- Android: Only rotate sensor values for sensors that need them rotated ([GH-55184](https://github.com/godotengine/godot/pull/55184)). -- Android: Fix flickering issues with low processor mode ([GH-59606](https://github.com/godotengine/godot/pull/59606)). -- Android: Fix the logic to restart the Godot application ([GH-61332](https://github.com/godotengine/godot/pull/61332)). -- Android: Fix broken scroll gesture on UI ([GH-62290](https://github.com/godotengine/godot/pull/62290)). -- Android: Address slow copy performance when using the `FileAccessFilesystemJAndroid` implementation ([GH-63223](https://github.com/godotengine/godot/pull/63223), [GH-63480](https://github.com/godotengine/godot/pull/63480)). -- HTML5: Change default cursor from `auto` to `default` ([GH-62608](https://github.com/godotengine/godot/pull/62608)). -- HTML5: Make locale string match other platforms ([GH-63043](https://github.com/godotengine/godot/pull/63043)). -- iOS: Fix simultaneous touches for different touch types ([GH-60224](https://github.com/godotengine/godot/pull/60224)). -- iOS: Flush accumulated input events ([GH-62842](https://github.com/godotengine/godot/pull/62842)). -- Linux: Fix tablet tilt values returning bad values ([GH-56439](https://github.com/godotengine/godot/pull/56439)). -- Linux: Fix `window_maximized` not working reliably ([GH-59767](https://github.com/godotengine/godot/pull/59767)). -- Linux: Properly check for fullscreen toggle made through the Window Manager ([GH-62543](https://github.com/godotengine/godot/pull/62543)). -- macOS: Fix OpenGL color space on HDR displays ([GH-60197](https://github.com/godotengine/godot/pull/60197)). -- UWP: Fix exporting GDNative DLLs ([GH-61262](https://github.com/godotengine/godot/pull/61262)). -- UWP: Flush buffered input events ([GH-63341](https://github.com/godotengine/godot/pull/63341)). -- Windows: Fix wrong OEM key mappings for brackets and braces ([GH-56588](https://github.com/godotengine/godot/pull/56588)). -- Windows: Fix `String.http_escape()` non-standard behavior with MinGW ([GH-61655](https://github.com/godotengine/godot/pull/61655)). -- Improve architecture tags in `OS.has_feature()` and make it work on MSVC ([GH-61740](https://github.com/godotengine/godot/pull/61740)). -- Improve `OS.set_current_screen()` on all desktop platforms ([GH-63192](https://github.com/godotengine/godot/pull/63192)). - -#### Rendering - -- Many fixes to octahedral vertex attribute specification ([GH-54768](https://github.com/godotengine/godot/pull/54768), [GH-56161](https://github.com/godotengine/godot/pull/56161), [GH-58838](https://github.com/godotengine/godot/pull/58838)). -- GLES3: Fix atlassed lightmaps not visible ([GH-55676](https://github.com/godotengine/godot/pull/55676)). -- Fix GPU particles transform feedback error for WebGL 2 ([GH-56465](https://github.com/godotengine/godot/pull/56465)). -- Fixed normals when using smoothed normals on CSG shapes ([GH-58208](https://github.com/godotengine/godot/pull/58208), [GH-59002](https://github.com/godotengine/godot/pull/59002), [GH-59039](https://github.com/godotengine/godot/pull/59039)). -- Fix alpha scissor shadow casting support ([GH-58959](https://github.com/godotengine/godot/pull/58959)). -- GLES3: Unbind vertex buffer before calculating blend shapes ([GH-60832](https://github.com/godotengine/godot/pull/60832)). - -#### Shaders - -- Fix particle texture animation speed when using random lifetime ([GH-55717](https://github.com/godotengine/godot/pull/55717)). -- Fix invalid code generation when using `VisualShaderNodeUniformRef` ([GH-63105](https://github.com/godotengine/godot/pull/63105)). - - -## [3.4] - 2021-11-05 - -See the [release announcement](https://godotengine.org/article/godot-3-4-is-released) for details. - -### Added - -#### 2D - -- Add `Listener2D` node ([GH-53429](https://github.com/godotengine/godot/pull/53429)). -- Add a 2D Viewport scale factor property ([GH-52137](https://github.com/godotengine/godot/pull/52137)). - -#### 3D - -- Implement octahedral map normal/tangent attribute compression ([GH-46800](https://github.com/godotengine/godot/pull/46800)). -- Add a `center_offset` property to both plane primitive and quad primitive ([GH-48763](https://github.com/godotengine/godot/pull/48763)). -- Options to clean/simplify convex hull generated from mesh ([GH-50328](https://github.com/godotengine/godot/pull/50328)). -- Allow unclamped colors in `Sprite3D` ([GH-51462](https://github.com/godotengine/godot/pull/51462)). - -#### Animation - -- Add animation "reset" track feature ([GH-44558](https://github.com/godotengine/godot/pull/44558)). -- Allow renaming bones and blend shapes ([GH-42827](https://github.com/godotengine/godot/pull/42827)). - -#### Core - -- Add frame delta smoothing option ([GH-48390](https://github.com/godotengine/godot/pull/48390)). - * This option is enabled by default (`application/run/delta_smoothing`). -- Add option to sync frame delta after draw ([GH-48555](https://github.com/godotengine/godot/pull/48555)). - * This option is experimental and disabled by default (`application/run/delta_sync_after_draw`). -- Expose OS data directory getter methods ([GH-49732](https://github.com/godotengine/godot/pull/49732)). -- Provide a getter for the project data directory ([GH-52714](https://github.com/godotengine/godot/pull/52714)). -- Add an option to make the project data directory non-hidden ([GH-52556](https://github.com/godotengine/godot/pull/52556), [GH-53779](https://github.com/godotengine/godot/pull/53779)). -- Add support for numeric XML entities to `XMLParser` ([GH-47978](https://github.com/godotengine/godot/pull/47978)). -- Add option for BVH thread safety ([GH-48892](https://github.com/godotengine/godot/pull/48892)). -- Add `Engine.print_error_messages` property to disable printing errors ([GH-50640](https://github.com/godotengine/godot/pull/50640)). -- Implement `OS.get_locale_language()` helper method ([GH-52740](https://github.com/godotengine/godot/pull/52740)). -- Allow using global classes as project `MainLoop` implementation ([GH-52438](https://github.com/godotengine/godot/pull/52438)). -- Add an `Array.pop_at()` method to pop an element at an arbitrary index ([GH-52143](https://github.com/godotengine/godot/pull/52143)). -- Expose enum related methods in ClassDB ([GH-52572](https://github.com/godotengine/godot/pull/52572)). -- Add `Thread.is_alive()` method to check if the thread is still doing work ([GH-53490](https://github.com/godotengine/godot/pull/53490)). -- Allow for platform `Thread` implementation override ([GH-52734](https://github.com/godotengine/godot/pull/52734)). -- Add support for generating `OpenSimplexNoise` noise images with an offset ([GH-48805](https://github.com/godotengine/godot/pull/48805)). - -#### Crypto - -- Add `AESContext`, RSA public keys, encryption, decryption, sign, and verify ([GH-48144](https://github.com/godotengine/godot/pull/48144)). -- Add `HMACContext` ([GH-48869](https://github.com/godotengine/godot/pull/48869)). - -#### Editor - -- Automatic remote debugger port assignment ([GH-37067](https://github.com/godotengine/godot/pull/37067)). -- Auto-reload scripts with external editor ([GH-51828](https://github.com/godotengine/godot/pull/51828)). -- Use QuickOpen to load resources in the inspector ([GH-37228](https://github.com/godotengine/godot/pull/37228)). -- Allow to create a node at specific position ([GH-50242](https://github.com/godotengine/godot/pull/50242)). -- Add the ability to reorder array elements from the inspector ([GH-50651](https://github.com/godotengine/godot/pull/50651)). -- Assign value to property by dropping to scene tree ([GH-50700](https://github.com/godotengine/godot/pull/50700)). -- Allow dropping property path into script editor ([GH-51629](https://github.com/godotengine/godot/pull/51629)). -- Save branch as scene by dropping to filesystem ([GH-52503](https://github.com/godotengine/godot/pull/52503)). -- Allow creating nodes in Animation Blend Tree by dragging from in/out ports ([GH-52966](https://github.com/godotengine/godot/pull/52966)). -- Allow dragging multiple resources onto exported array variable at once ([GH-50718](https://github.com/godotengine/godot/pull/50718)). -- Add zoom support to `SpriteFrames` editor plugin ([GH-48977](https://github.com/godotengine/godot/pull/48977)). -- Add `EditorResourcePicker` and `EditorScriptPicker` classes for plugins (and internal editor use) ([GH-49491](https://github.com/godotengine/godot/pull/49491)). -- Add up/down keys to increment/decrement value in editor spin slider ([GH-53090](https://github.com/godotengine/godot/pull/53090)). -- Implement camera orbiting shortcuts ([GH-51984](https://github.com/godotengine/godot/pull/51984)). -- Add ability to copy group name ([GH-53162](https://github.com/godotengine/godot/pull/53162)). -- Implement a `%command%` placeholder in the Main Run Args setting ([GH-35992](https://github.com/godotengine/godot/pull/35992)). -- Add keyboard shortcuts to the project manager ([GH-47894](https://github.com/godotengine/godot/pull/47894)). -- Add history navigation in the script editor using extra mouse buttons ([GH-53067](https://github.com/godotengine/godot/pull/53067)). - -#### GDScript - -- Allow `warning-ignore` in the same line as the respective warning ([GH-47863](https://github.com/godotengine/godot/pull/47863)). -- LSP: Implement `didSave` notify and rename request ([GH-48616](https://github.com/godotengine/godot/pull/48616)). -- LSP: Add support for custom host setting ([GH-52330](https://github.com/godotengine/godot/pull/52330)). -- LSP: Implement `applyEdit` for signal connecting ([GH-53068](https://github.com/godotengine/godot/pull/53068)). - -#### GUI - -- Button: Add focus font color to `Button` and derivatives ([GH-54264](https://github.com/godotengine/godot/pull/54264)). -- ButtonGroup: Add a `pressed `signal ([GH-48500](https://github.com/godotengine/godot/pull/48500)). -- CheckBox: Add disabled theme icons ([GH-37755](https://github.com/godotengine/godot/pull/37755)). -- ColorPicker: Display previous color and allow selecting it back ([GH-48611](https://github.com/godotengine/godot/pull/48611), [GH-48623](https://github.com/godotengine/godot/pull/48623)). -- DynamicFont: Allow using WOFF fonts ([GH-52052](https://github.com/godotengine/godot/pull/52052)). -- GraphEdit: Make zoom limits and step adjustable ([GH-50526](https://github.com/godotengine/godot/pull/50526)). -- ScrollBar: Add `increment_pressed` and `decrement_pressed` icons ([GH-51805](https://github.com/godotengine/godot/pull/51805)). -- TextureButton: Add `flip_h` and `flip_v` properties ([GH-30424](https://github.com/godotengine/godot/pull/30424)). -- TextureProgress: Add offset for progress texture ([GH-38722](https://github.com/godotengine/godot/pull/38722)). -- Theme: Various improvements to the Theme API ([GH-49487](https://github.com/godotengine/godot/pull/49487)). -- Theme: Add support for partial custom editor themes ([GH-51648](https://github.com/godotengine/godot/pull/51648)). -- Theme: Add API to retrieve the default font, and optimize property change notification ([GH-53397](https://github.com/godotengine/godot/pull/53397)). - -#### Import - -- Backport improved glTF module with scene export support ([GH-49120](https://github.com/godotengine/godot/pull/49120)). -- Implement lossless WebP encoding ([GH-47854](https://github.com/godotengine/godot/pull/47854)). -- Add anisotropic filter option for `TextureArray`s ([GH-51402](https://github.com/godotengine/godot/pull/51402)). -- Add "Normal Map Invert Y" import option for normal maps ([GH-48693](https://github.com/godotengine/godot/pull/48693)). -- Add optional region cropping for `TextureAtlas` importer ([GH-52652](https://github.com/godotengine/godot/pull/52652)). - -#### Input +- Add NavigationRegion function to change navigation map ([GH-77191](https://github.com/godotengine/godot/pull/77191)). +- Add ProjectSettings navigation map default up ([GH-78365](https://github.com/godotengine/godot/pull/78365)). +- Add more basic tests for `NavigationServer3D` ([GH-78480](https://github.com/godotengine/godot/pull/78480)). +- Add advanced `NavigationServer3D` tests ([GH-78667](https://github.com/godotengine/godot/pull/78667)). +- Fix closest possible navigation path position ([GH-79004](https://github.com/godotengine/godot/pull/79004)). +- Add NavigationServer API to enable regions and links ([GH-79129](https://github.com/godotengine/godot/pull/79129)). +- Mark NavigationServer3D.region_bake_navigation_mesh() as deprecated ([GH-79137](https://github.com/godotengine/godot/pull/79137)). +- Add `clear` function to NavigationMesh / NavigationPolygon ([GH-79157](https://github.com/godotengine/godot/pull/79157)). +- Fix pathfinding funnel adding unwanted point ([GH-79228](https://github.com/godotengine/godot/pull/79228)). +- Fix NavigationObstacle2D debug position ([GH-79392](https://github.com/godotengine/godot/pull/79392)). +- Make NavigationRegion3D baking NavMesh on the main thread not finish deferred ([GH-79465](https://github.com/godotengine/godot/pull/79465)). +- Change 2D navigation ProjectSettings from integers to floats ([GH-79483](https://github.com/godotengine/godot/pull/79483)). +- Set default `cell_size` on new TileMap Layer navigation layer maps ([GH-79485](https://github.com/godotengine/godot/pull/79485)). +- Add more hints to navigation map cell size errors ([GH-79489](https://github.com/godotengine/godot/pull/79489)). +- Add a `fill_region` method to the `AStarGrid2D` ([GH-79495](https://github.com/godotengine/godot/pull/79495)). +- Move navigation mesh baking to NavigationServer ([GH-79643](https://github.com/godotengine/godot/pull/79643)). +- Disable NavigationMesh `edge_max_length` property by default ([GH-79786](https://github.com/godotengine/godot/pull/79786)). +- Add multi-threaded NavMesh baking to NavigationServer ([GH-79972](https://github.com/godotengine/godot/pull/79972)). +- Fix NavMesh `map_update_id` returning 0 results in errors ([GH-80189](https://github.com/godotengine/godot/pull/80189)). +- Fix missing include for `NavigationMesh` ([GH-80408](https://github.com/godotengine/godot/pull/80408)). +- Add 2D navigation mesh baking ([GH-80796](https://github.com/godotengine/godot/pull/80796)). +- Suppress expected errors in navigation-related unit tests ([GH-80833](https://github.com/godotengine/godot/pull/80833)). +- Fix compiling with 3D disabled due to unused navigation variable ([GH-81295](https://github.com/godotengine/godot/pull/81295)). +- Core: Some code style improvements to `AStarGrid2D` ([GH-81900](https://github.com/godotengine/godot/pull/81900)). +- Fix typo in dev assert in NavMeshGenerator2D ([GH-82368](https://github.com/godotengine/godot/pull/82368)). +- Update TileMap to use new navigation polygon baking ([GH-82465](https://github.com/godotengine/godot/pull/82465)). +- Fix NavigationObstacle3D debug being affected by rotation and scale ([GH-82593](https://github.com/godotengine/godot/pull/82593)). +- Fix enabling NavigationRegion3D saved disabled ([GH-83365](https://github.com/godotengine/godot/pull/83365)). +- Fix "Navigation map synchronization error" when using NavigationRegion2D ([GH-83568](https://github.com/godotengine/godot/pull/83568)). +- Fix NavRegion sync error messages ([GH-83574](https://github.com/godotengine/godot/pull/83574)). +- Fix NavigationObstacle3D height ([GH-83701](https://github.com/godotengine/godot/pull/83701)). +- Fix NavigationAgent3D stored y-axis velocity and make it optional ([GH-83705](https://github.com/godotengine/godot/pull/83705)). +- Fix NavigationLink enabled toggle ([GH-83709](https://github.com/godotengine/godot/pull/83709)). +- Fix hole in heightmap navigation mesh baking ([GH-83783](https://github.com/godotengine/godot/pull/83783)). +- Fix potential crashes with TileMap navmesh baking ([GH-83891](https://github.com/godotengine/godot/pull/83891)). +- Fix NavigationObstacle3DEditor parenting error ([GH-84055](https://github.com/godotengine/godot/pull/84055)). +- Fix NavigationObstacle elevation ([GH-84830](https://github.com/godotengine/godot/pull/84830)). +- Fix NavigationObstacle height ([GH-84857](https://github.com/godotengine/godot/pull/84857)). -- Add support for physical scancodes, fixes non-latin layout scancodes on Linux ([GH-46764](https://github.com/godotengine/godot/pull/46764)). -- Add `action_get_deadzone()` method to InputMap ([GH-50065](https://github.com/godotengine/godot/pull/50065)). -- Allow getting axis/vector values from multiple actions ([GH-50788](https://github.com/godotengine/godot/pull/50788)). -- Allow checking for exact matches with action events ([GH-50874](https://github.com/godotengine/godot/pull/50874)). -- Exposed setters for sensor values ([GH-53742](https://github.com/godotengine/godot/pull/53742)). -- Expose `Input::flush_buffered_events()` ([GH-53812](https://github.com/godotengine/godot/pull/53812)). -- Allow input echo when changing UI focus ([GH-44456](https://github.com/godotengine/godot/pull/44456)). - -#### Localization - -- Add support for translating the class reference ([GH-53511](https://github.com/godotengine/godot/pull/53511)). - * Includes Chinese (Simplified) and Spanish translations with high completion ratio, and initial translations for French, Japanese, and German. -- Allow overriding `get_message` with virtual method ([GH-53207](https://github.com/godotengine/godot/pull/53207)). - -#### Mono (C#) - -- iOS: Cache AOT compiler output ([GH-51191](https://github.com/godotengine/godot/pull/51191)). -- Add editor keyboard shortcut (<kbd>Alt+B</kbd>) for Mono Build solution button ([GH-52595](https://github.com/godotengine/godot/pull/52595)). -- Add support to export enum strings for `Array<string>` ([GH-52763](https://github.com/godotengine/godot/pull/52763)). -- Support arrays of `NodePath` and `RID` ([GH-53577](https://github.com/godotengine/godot/pull/53577)). -- Support marshaling generic `Godot.Object` ([GH-53582](https://github.com/godotengine/godot/pull/53582)). - -#### Networking - -- Add support for multiple address resolution in DNS requests ([GH-49020](https://github.com/godotengine/godot/pull/49020)). -- Implement `String::parse_url()` for parsing URLs ([GH-48205](https://github.com/godotengine/godot/pull/48205)). -- Add `get_buffered_amount()` to `WebRTCDataChannel` ([GH-50659](https://github.com/godotengine/godot/pull/50659)). -- Add `dtls_hostname` property to ENet ([GH-51434](https://github.com/godotengine/godot/pull/51434)). - -#### Physics - -- Enable setting the number of physics solver iterations ([GH-38387](https://github.com/godotengine/godot/pull/38387), [GH-50257](https://github.com/godotengine/godot/pull/50257)). -- Heightmap collision shape support in Godot Physics 3D ([GH-47349](https://github.com/godotengine/godot/pull/47349)). -- Add support for Dynamic BVH as 2D physics broadphase ([GH-48314](https://github.com/godotengine/godot/pull/48314)). -- Expose `body_test_motion` in 3D physics server ([GH-50103](https://github.com/godotengine/godot/pull/50103)). -- Add option to sync motion to physics in 3D `KinematicBody` ([GH-49446](https://github.com/godotengine/godot/pull/49446)). -- Expose collider RID in 2D/3D kinematic collision ([GH-49476](https://github.com/godotengine/godot/pull/49476)). -- Support for disabling physics on `SoftBody` ([GH-49835](https://github.com/godotengine/godot/pull/49835)). -- Backport new methods for `KinematicBody` and `KinematicCollision` ([GH-52116](https://github.com/godotengine/godot/pull/52116)). -- Expose `SoftBody` pin methods for scripting ([GH-52369](https://github.com/godotengine/godot/pull/52369)). - -#### Porting - -- Android: Add partial support for Android scoped storage ([GH-50359](https://github.com/godotengine/godot/pull/50359)). -- Android: Add initial support for Play Asset Delivery ([GH-52526](https://github.com/godotengine/godot/pull/52526)). -- Android: Implement per-pixel transparency ([GH-51935](https://github.com/godotengine/godot/pull/51935)). -- Android: Add basic user data backup option ([GH-49070](https://github.com/godotengine/godot/pull/49070)). -- Android: Add support for prompting the user to retain app data on uninstall ([GH-51605](https://github.com/godotengine/godot/pull/51605)). -- HTML5: Export as Progressive Web App (PWA) ([GH-48250](https://github.com/godotengine/godot/pull/48250)). -- HTML5: Implement Godot <-> JavaScript interface ([GH-48691](https://github.com/godotengine/godot/pull/48691)). -- HTML5: Implement AudioWorklet without threads ([GH-52650](https://github.com/godotengine/godot/pull/52650)). -- HTML5: Implement video driver selection for Web editor ([GH-53991](https://github.com/godotengine/godot/pull/53991)). -- HTML5: Add easy to use download API ([GH-48929](https://github.com/godotengine/godot/pull/48929)). -- iOS: Add pen pressure support for Apple Pencil ([GH-47469](https://github.com/godotengine/godot/pull/47469)). -- iOS: Add option to automatically generate icons and launch screens ([GH-49464](https://github.com/godotengine/godot/pull/49464)). -- iOS: Support multiple `plist` types in plugin ([GH-49802](https://github.com/godotengine/godot/pull/49802)). -- iOS: Implement missing OS `set`/`get_clipboard()` methods ([GH-52540](https://github.com/godotengine/godot/pull/52540)). -- Linux: Add initial support for the RISC-V architecture ([GH-53509](https://github.com/godotengine/godot/pull/53509)). -- macOS: Add GDNative Framework support, and minimal support for handling Unix symlinks ([GH-46860](https://github.com/godotengine/godot/pull/46860)). -- macOS: Add notarization support when exporting for macOS on a macOS host ([GH-49276](https://github.com/godotengine/godot/pull/49276)). -- Add support for ARM64 architecture for the Embree raycaster (Apple M1, Linux aarch64) ([GH-48455](https://github.com/godotengine/godot/pull/48455)). - * Note that the OIDN denoiser is still not available on this architecture. - -#### Rendering - -- GLES2: Add basic support for CPU blendshapes ([GH-48480](https://github.com/godotengine/godot/pull/48480), [GH-51363](https://github.com/godotengine/godot/pull/51363)). -- GLES2: Allow using clearcoat, anisotropy and refraction in SpatialMaterial ([GH-51967](https://github.com/godotengine/godot/pull/51967)). -- GLES2: Implement `Viewport.keep_3d_linear` for VR applications to convert output to linear color space ([GH-51780](https://github.com/godotengine/godot/pull/51780)). -- GLES3: Allow repeat flag in viewport textures ([GH-34008](https://github.com/godotengine/godot/pull/34008)). -- GLES3: Add support for contrast-adaptive sharpening in 3D ([GH-47416](https://github.com/godotengine/godot/pull/47416)). -- Add an editor setting to configure number of threads for lightmap baking ([GH-52952](https://github.com/godotengine/godot/pull/52952)). -- Add ring emitter for 3D particles ([GH-47801](https://github.com/godotengine/godot/pull/47801)). -- Add rooms and portals-based occlusion culling ([GH-46130](https://github.com/godotengine/godot/pull/46130)). -- Add a new high quality tonemapper: ACES Fitted ([GH-52477](https://github.com/godotengine/godot/pull/52477)). -- Add soft shadows to the CPU lightmapper ([GH-50184](https://github.com/godotengine/godot/pull/50184)). -- Add high quality glow mode ([GH-51491](https://github.com/godotengine/godot/pull/51491)). -- Add new 3D point light attenuation as an option ([GH-52918](https://github.com/godotengine/godot/pull/52918)). -- Import option to split vertex buffer stream in positions and attributes ([GH-46574](https://github.com/godotengine/godot/pull/46574)). -- Add horizon specular occlusion ([GH-51416](https://github.com/godotengine/godot/pull/51416)). - -#### Shaders - -- Add support for structs and fragment-to-light varyings ([GH-48075](https://github.com/godotengine/godot/pull/48075)). -- Add support for global const arrays ([GH-50889](https://github.com/godotengine/godot/pull/50889)). -- Make `TIME` available in custom functions by default ([GH-49509](https://github.com/godotengine/godot/pull/49509)). - -#### VisualScript - -- Allow dropping custom node scripts in VisualScript editor ([GH-50696](https://github.com/godotengine/godot/pull/50696)). -- Expose visual script custom node type hints ([GH-50705](https://github.com/godotengine/godot/pull/50705)). -- Improve and streamline `VisualScriptFuncNode`s `Call` `Set` `Get` ([GH-50709](https://github.com/godotengine/godot/pull/50709)). - -#### XR - -- Add `VIEW_INDEX` variable in shader to know which eye/view we're rendering for ([GH-48011](https://github.com/godotengine/godot/pull/48011)). - -### Changed - -#### 2D - -- Make the most recently added current `Camera2D` take precedence ([GH-50112](https://github.com/godotengine/godot/pull/50112)). - -#### 3D - -- Implement individual mesh transform for `MeshLibrary` items ([GH-52298](https://github.com/godotengine/godot/pull/52298)). - -#### Buildsystem - -- Refactor module defines into a generated header ([GH-50466](https://github.com/godotengine/godot/pull/50466)). - -#### Core - -- Promote object validity checks to release builds ([GH-51796](https://github.com/godotengine/godot/pull/51796)). -- Add detailed error messages to release builds (used to be debug-only) ([GH-53405](https://github.com/godotengine/godot/pull/53405)). -- Add Node name to `print()` of all nodes, makes `Object::to_string()` virtual ([GH-38819](https://github.com/godotengine/godot/pull/38819)). -- Thread callbacks can now take optional parameters ([GH-38078](https://github.com/godotengine/godot/pull/38078), [GH-51093](https://github.com/godotengine/godot/pull/51093)). -- Harmonize output of `OS.get_locale()` between platforms ([GH-40708](https://github.com/godotengine/godot/pull/40708)). -- Optimize hash comparison for integer and string keys in Dictionary ([GH-53557](https://github.com/godotengine/godot/pull/53557)). -- Improve the console error logging appearance: ([GH-49577](https://github.com/godotengine/godot/pull/49577)). -- Implement missing stringification for `PoolByteArray` and `PoolColorArray` ([GH-53655](https://github.com/godotengine/godot/pull/53655)). -- `AStar.get_available_point_id()` returns 0 instead of 1 when empty ([GH-48958](https://github.com/godotengine/godot/pull/48958)). -- Compare connections by object ID, making `.tscn` order deterministic ([GH-52493](https://github.com/godotengine/godot/pull/52493)). - -#### Editor - -- Refactor `Theme` item management in the theme editor ([GH-49512](https://github.com/godotengine/godot/pull/49512)). -- Overhaul the theme editor and improve user experience ([GH-49774](https://github.com/godotengine/godot/pull/49774)). -- Improve 2D editor zoom logic ([GH-50490](https://github.com/godotengine/godot/pull/50490), [GH-50499](https://github.com/godotengine/godot/pull/50499)). -- Make several actions in the Inspector dock more obvious ([GH-50528](https://github.com/godotengine/godot/pull/50528)). -- Improve the editor feature profiles UX ([GH-49643](https://github.com/godotengine/godot/pull/49643)). -- Improve the UI/UX of the Export Template Manager dialog ([GH-50531](https://github.com/godotengine/godot/pull/50531)). -- Improve FileSystem dock sorting ([GH-50565](https://github.com/godotengine/godot/pull/50565)). -- Improve the 3D editor manipulation gizmo ([GH-50597](https://github.com/godotengine/godot/pull/50597)). -- Increase object snapping distances in the 3D editor ([GH-53727](https://github.com/godotengine/godot/pull/53727)). -- Refactor layer property editor grid ([GH-51040](https://github.com/godotengine/godot/pull/51040)). -- Improve the animation bezier editor ([GH-48572](https://github.com/godotengine/godot/pull/48572)). -- Fix logic for showing `TileMap` debug collision shapes ([GH-49075](https://github.com/godotengine/godot/pull/49075)). -- Add custom debug shape thickness and color options to `RayCast` ([GH-49726](https://github.com/godotengine/godot/pull/49726)). -- Handle portrait mode monitors in the automatic editor scale detection ([GH-48597](https://github.com/godotengine/godot/pull/48597)). -- Remove high radiance sizes from the editor due to issues on specific GPUs ([GH-48906](https://github.com/godotengine/godot/pull/48906)). - -#### GUI - -- GraphEdit: Enable zooming with Ctrl + Scroll wheel and related fixes to zoom handling ([GH-47173](https://github.com/godotengine/godot/pull/47173)). -- Button: Don't change hovering during focus events ([GH-47280](https://github.com/godotengine/godot/pull/47280)). -- DynamicFont: Re-add support for kerning ([GH-49377](https://github.com/godotengine/godot/pull/49377)). -- LineEdit: Double click selects words, triple click selects all the content ([GH-46527](https://github.com/godotengine/godot/pull/46527)). -- LinkButton: Button text is now automatically translated like other Controls ([GH-52138](https://github.com/godotengine/godot/pull/52138)). -- Theme: StyleBox fake anti-aliasing improvements ([GH-51589](https://github.com/godotengine/godot/pull/51589)). - -#### Import - -- Optimize image channel detection ([GH-47396](https://github.com/godotengine/godot/pull/47396)). - -#### Localization - -- Only include editor translations above a threshold to save on binary size ([GH-54020](https://github.com/godotengine/godot/pull/54020)). - -#### Mono (C#) - -- macOS: Mono builds are now universal builds with support for both `x86_64` and `arm64` architectures ([GH-49248](https://github.com/godotengine/godot/pull/49248)). -- Improve C# method listing ([GH-52607](https://github.com/godotengine/godot/pull/52607)). -- Avoid modifying `csproj` globbing includes ([GH-54262](https://github.com/godotengine/godot/pull/54262)). -- Deprecate `Xform` methods removed in 4.0, the `*` operator is preferred ([GH-52762](https://github.com/godotengine/godot/pull/52762)). - -#### Networking +#### Network -- Enable range coder compression by default in `NetworkedMultiplayerENet` ([GH-51525](https://github.com/godotengine/godot/pull/51525)). +- Fix `rpc` calls with binds ([GH-78551](https://github.com/godotengine/godot/pull/78551)). +- Web: Fix WebSocket returning empty close-reason ([GH-79407](https://github.com/godotengine/godot/pull/79407)). +- Web: Always return -1 as body length in HTTPClientWeb ([GH-79846](https://github.com/godotengine/godot/pull/79846)). + +#### Particles + +- Add `finished` signal to CPUParticles ([GH-76853](https://github.com/godotengine/godot/pull/76853)). +- Add `finished` signal to GPUParticles ([GH-76859](https://github.com/godotengine/godot/pull/76859)). +- Initialize particles instance buffer in case it is used before being updated ([GH-78852](https://github.com/godotengine/godot/pull/78852)). +- Add option to center image when loading particle emission mask ([GH-78944](https://github.com/godotengine/godot/pull/78944)). +- Unify error condition for particles trail lifetime ([GH-79270](https://github.com/godotengine/godot/pull/79270)). +- Particle internal refactor and additions for more artistic control ([GH-79527](https://github.com/godotengine/godot/pull/79527)). +- Fix particle shader deterministic random values ([GH-80638](https://github.com/godotengine/godot/pull/80638)). +- Add motion vector support for GPU 3D Particles ([GH-80688](https://github.com/godotengine/godot/pull/80688)). +- Implement conversion from `CPUParticles` to `GPUParticles` (3D/2D) ([GH-80779](https://github.com/godotengine/godot/pull/80779)). +- Fix GPUParticles2D offset stutter ([GH-80984](https://github.com/godotengine/godot/pull/80984)). +- Fix z-billboard + y to velocity transform alignment to correctly respect non-uniform scale ([GH-81315](https://github.com/godotengine/godot/pull/81315)). +- Fix errors when freeing GPUParticles ([GH-82431](https://github.com/godotengine/godot/pull/82431)). +- Fixed multiple particle issues: division by zero, color ramp override, scale dependent on amount ratio ([GH-83488](https://github.com/godotengine/godot/pull/83488)). +- Fix typo in particles process material when using emission color texture ([GH-83620](https://github.com/godotengine/godot/pull/83620)). +- Fix massive performance hit due to enabling collision ([GH-83749](https://github.com/godotengine/godot/pull/83749)). +- Fix directed points not working, and fix friction formula ([GH-83831](https://github.com/godotengine/godot/pull/83831)). +- Fix `noise_direction` variable used before initialized in particle shader when using turbulence with collisions ([GH-83881](https://github.com/godotengine/godot/pull/83881)). +- Fix invalid parameter ranges ([GH-84006](https://github.com/godotengine/godot/pull/84006)). +- Fix friction being in the correct if/else branch ([GH-84028](https://github.com/godotengine/godot/pull/84028)). +- Fix damp as friction not updating shader code ([GH-84029](https://github.com/godotengine/godot/pull/84029)). +- Fix wrong rotation matrix for orbit z velocity ([GH-84056](https://github.com/godotengine/godot/pull/84056)). +- Fix turbulence post rework ([GH-84103](https://github.com/godotengine/godot/pull/84103)). +- OpenGL: Fix uninitialized memory usage for GPUParticles `interp_to_end` ([GH-84189](https://github.com/godotengine/godot/pull/84189)). +- Fix several Material texture parameter updates ([GH-84303](https://github.com/godotengine/godot/pull/84303)). +- Fix several ParticleProcessMaterial texture names ([GH-84829](https://github.com/godotengine/godot/pull/84829)). +- Fix radial inwards velocity clamping incorrectly (regression from #83488) ([GH-85252](https://github.com/godotengine/godot/pull/85252)). #### Physics -- Port Bullet's convex hull computer to replace `QuickHull` ([GH-48533](https://github.com/godotengine/godot/pull/48533)). -- Return RID instead of Object ID in `area`-/`body_shape_entered`/-`exited` signals ([GH-42743](https://github.com/godotengine/godot/pull/42743)). -- Optimize area detection and `intersect_shape` queries with concave shapes ([GH-48551](https://github.com/godotengine/godot/pull/48551)). -- Optimize raycast with large Heightmap shape data ([GH-48709](https://github.com/godotengine/godot/pull/48709)). -- Reload kinematic shapes when changing `PhysicsBody` mode to Kinematic ([GH-53118](https://github.com/godotengine/godot/pull/53118)). -- Wake up 2D and 3D bodies in impulse and force functions ([GH-53113](https://github.com/godotengine/godot/pull/53113)). -- Compile Bullet with threadsafe switch on ([GH-53183](https://github.com/godotengine/godot/pull/53183)). +- Add ability to get face index and barycentric coordinates from raycast ([GH-71233](https://github.com/godotengine/godot/pull/71233)). +- Add Mass Distribution, Deactivation, Solver inspector property groups ([GH-77943](https://github.com/godotengine/godot/pull/77943)). +- Correctly set mass for a rigid body with custom inertia and center of mass ([GH-78757](https://github.com/godotengine/godot/pull/78757)). +- Add `hit_back_faces` property to `RayCast3D` ([GH-79330](https://github.com/godotengine/godot/pull/79330)). +- Add state sync after call to `_integrate_forces` in `_body_state_changed` ([GH-79977](https://github.com/godotengine/godot/pull/79977)). +- Fix unit suffix for `HingeJoint3D`'s target velocity ([GH-80523](https://github.com/godotengine/godot/pull/80523)). +- Fix gizmo for `BoxShape3D` ([GH-80689](https://github.com/godotengine/godot/pull/80689)). +- Expose the `get_rid` method of Joint2D and Joint3D ([GH-80736](https://github.com/godotengine/godot/pull/80736)). +- Fix possible crash when Control overrides mouse input on Area2D ([GH-81006](https://github.com/godotengine/godot/pull/81006)). +- Update PinJoint2D API with angle limits and motor speed ([GH-81610](https://github.com/godotengine/godot/pull/81610)). +- Fix missing clear for some `set_exclude*` query parameter methods ([GH-82043](https://github.com/godotengine/godot/pull/82043)). +- Fix performance regression in RigidBody2D/3D and PhysicalBone3D ([GH-82393](https://github.com/godotengine/godot/pull/82393)). +- Fix not refitting upward from leaf nodes ([GH-82482](https://github.com/godotengine/godot/pull/82482)). +- Tweak Gravity Scale property hints to make dragging more useful ([GH-82634](https://github.com/godotengine/godot/pull/82634)). +- Allow TileMap physics/navigation to still work when hidden ([GH-83560](https://github.com/godotengine/godot/pull/83560)). +- Fix unit suffixes for `Generic6DOFJoint` ([GH-83672](https://github.com/godotengine/godot/pull/83672)). +- Ensure SoftBody3D does not use compressed mesh format ([GH-84165](https://github.com/godotengine/godot/pull/84165)). +- Fix rotated tile collision not working at runtime ([GH-84261](https://github.com/godotengine/godot/pull/84261)). +- Fix transform changes in `_integrate_forces` being overwritten ([GH-84799](https://github.com/godotengine/godot/pull/84799)). +- Fix transform sync in `RigidBody*D::_body_state_changed` ([GH-84924](https://github.com/godotengine/godot/pull/84924)). +- Update tilemap physics' World2D on reparenting ([GH-84968](https://github.com/godotengine/godot/pull/84968)). + +#### Plugin + +- Add `_get_unsaved_status()` method to EditorPlugin and implement it for script and shader editors ([GH-67503](https://github.com/godotengine/godot/pull/67503)). +- Expose editor viewports in EditorInterface ([GH-68696](https://github.com/godotengine/godot/pull/68696)). +- Allow changing feature profile via `EditorInterface` ([GH-74382](https://github.com/godotengine/godot/pull/74382)). +- Fix Camera2D is not working inside a MainScreenEditorPlugin ([GH-79867](https://github.com/godotengine/godot/pull/79867)). +- Keep `_export_begin()`'s `path` argument always consistent ([GH-81016](https://github.com/godotengine/godot/pull/81016)). +- Relax restriction on loading v1 Android plugins on Godot 4.2+ ([GH-81368](https://github.com/godotengine/godot/pull/81368)). +- Cleanups and improvements to the Godot Android library api ([GH-82893](https://github.com/godotengine/godot/pull/82893)). +- Editor: Fix `remove_control_from_dock` fails when dock is floating ([GH-83512](https://github.com/godotengine/godot/pull/83512)). #### Porting -- Android: Target API level 30, raise min API level to 19 ([GH-50359](https://github.com/godotengine/godot/pull/50359)). -- Android: Improve input responsiveness on underpowered Android devices ([GH-42220](https://github.com/godotengine/godot/pull/42220)). -- Android: Upgrade Android Gradle to version 7.2, now requires Java 11 ([GH-53610](https://github.com/godotengine/godot/pull/53610)). -- HTML5: Debug HTTP server refactor with SSL support ([GH-48250](https://github.com/godotengine/godot/pull/48250)). -- HTML5: Use 64KiB chunk size in JS `HTTPClient`, for consistency with native platforms ([GH-48501](https://github.com/godotengine/godot/pull/48501)). -- HTML5: Raise default initial memory to 64 MiB ([GH-50422](https://github.com/godotengine/godot/pull/50422)). -- HTML5: Use browser mix rate by default on the Web ([GH-52723](https://github.com/godotengine/godot/pull/52723)). -- HTML5: Refactor event handlers, drop most Emscripten HTML5 dependencies ([GH-52812](https://github.com/godotengine/godot/pull/52812)). -- iOS: Disable half float on GLES2 via platform override ([GH-54229](https://github.com/godotengine/godot/pull/54229)). -- macOS: Prefer .app bundle icon over the default one ([GH-48686](https://github.com/godotengine/godot/pull/48686)). +- [macOS, sandbox] Implement optional native file selection dialog support for sandboxed apps ([GH-47499](https://github.com/godotengine/godot/pull/47499)). +- Add `clipboard_has/get_image` methods to DisplayServer ([GH-63826](https://github.com/godotengine/godot/pull/63826)). +- Refactor Godot Android architecture ([GH-76821](https://github.com/godotengine/godot/pull/76821)). +- Windows: Flash both the window caption and taskbar button on `request_attention` ([GH-78263](https://github.com/godotengine/godot/pull/78263)). +- Add error checks and harmonize behavior of the `set_icon` method ([GH-78437](https://github.com/godotengine/godot/pull/78437)). +- Fix formatting of dlopen error message on Windows ([GH-78802](https://github.com/godotengine/godot/pull/78802)). +- macOS: Fix `set_native_icon` crash with empty or invalid ICNS file ([GH-79010](https://github.com/godotengine/godot/pull/79010)). +- Windows: Fix setting initial non-exclusive window mode ([GH-79016](https://github.com/godotengine/godot/pull/79016)). +- [macOS/iOS] Set MoltenVK logging level based on `--verbose` flag ([GH-79061](https://github.com/godotengine/godot/pull/79061)). +- Fix the fallback logic of `OS::shell_show_in_file_manager` ([GH-79087](https://github.com/godotengine/godot/pull/79087)). +- Avoid freeze when interacting with menus on Wayland by re-aquiring next swapchain image after updating swapchain ([GH-79143](https://github.com/godotengine/godot/pull/79143)). +- Fix Linux `move_to_trash` wrongly reporting files as not found ([GH-79284](https://github.com/godotengine/godot/pull/79284)). +- Fix `ProjectSettings::localize_path` for Windows paths ([GH-79342](https://github.com/godotengine/godot/pull/79342)). +- Windows: Implement native file selection dialog support ([GH-79574](https://github.com/godotengine/godot/pull/79574)). +- Fix NullPointerException when registering the sensors ([GH-79681](https://github.com/godotengine/godot/pull/79681)). +- Windows: Initialize COM as apartment-threaded ([GH-79693](https://github.com/godotengine/godot/pull/79693)). +- Add `proxy_to_pthread` option to `platform=web` ([GH-79711](https://github.com/godotengine/godot/pull/79711)). +- Fix file permissions for the web platform (affects every Unix-like platform) ([GH-79866](https://github.com/godotengine/godot/pull/79866)). +- Use EWMH for `DisplayServerX11::_window_minimize_check()` implementation ([GH-80036](https://github.com/godotengine/godot/pull/80036)). +- Web: Update npm packages ([GH-80092](https://github.com/godotengine/godot/pull/80092)). +- [Linux/Freedesktop] Implement native file selection dialog support ([GH-80104](https://github.com/godotengine/godot/pull/80104)). +- Windows: Do not force redraw window background on mouse pass-through region change ([GH-80153](https://github.com/godotengine/godot/pull/80153)). +- X11: Do not fail DisplayServer init if non-essential extensions are missing ([GH-80240](https://github.com/godotengine/godot/pull/80240)). +- Track hovered `Window` in `DisplayServerX11` ([GH-80279](https://github.com/godotengine/godot/pull/80279)). +- FileAccess: Add methods to get/set "hidden" and "read-only" attributes on macOS/BSD and Windows ([GH-80404](https://github.com/godotengine/godot/pull/80404)). +- DisplayServer: Add method to estimate window title bar size ([GH-80409](https://github.com/godotengine/godot/pull/80409)). +- macOS: Fix missing mouse exit events on window close ([GH-80439](https://github.com/godotengine/godot/pull/80439)). +- Android: Change the default "org.godotengine" package name to "com.example" ([GH-80761](https://github.com/godotengine/godot/pull/80761)). +- [Native File Dialogs] Refocus last focused window on close ([GH-80952](https://github.com/godotengine/godot/pull/80952)). +- Make Windows' safe save more resilient ([GH-81001](https://github.com/godotengine/godot/pull/81001)). +- Fix JavaScript callback memory leak issue ([GH-81105](https://github.com/godotengine/godot/pull/81105)). +- [Native File Dialogs] Improve filter list handling, add selected filter to the callback ([GH-81218](https://github.com/godotengine/godot/pull/81218)). +- macOS: Fix live resize with the latest MoltenVK version ([GH-81339](https://github.com/godotengine/godot/pull/81339)). +- Implement `clipboard_get`/`has_image` for X11 ([GH-81439](https://github.com/godotengine/godot/pull/81439)). +- Web: Disable raycast module by default (no occlusion culling) ([GH-81716](https://github.com/godotengine/godot/pull/81716)). +- Windows: Use clear color for non exclusive fullscreen border, fix maximize for borderless window switching to exclusive fs ([GH-82031](https://github.com/godotengine/godot/pull/82031)). +- macOS: Enforce non-zero window size ([GH-82037](https://github.com/godotengine/godot/pull/82037)). +- X11: Add support for using EGL/GLES instead of GLX ([GH-82101](https://github.com/godotengine/godot/pull/82101)). +- Support dark mode on Android and iOS ([GH-82230](https://github.com/godotengine/godot/pull/82230)). +- macOS: Fix borderless mode on macOS 13.6+ ([GH-82357](https://github.com/godotengine/godot/pull/82357)). +- macOS: Check all exclusive fullscreen windows before setting presentation mode ([GH-82423](https://github.com/godotengine/godot/pull/82423)). +- Web: Clarify that `OS.get_unique_id` is not supported ([GH-82441](https://github.com/godotengine/godot/pull/82441)). +- Fix `godot_js_wrapper_create_cb` regression ([GH-82736](https://github.com/godotengine/godot/pull/82736)). +- macOS: Fix ambiguous method call with older SDKs ([GH-82876](https://github.com/godotengine/godot/pull/82876)). +- Add method to check if filesystem is case sensitive ([GH-82957](https://github.com/godotengine/godot/pull/82957)). +- macOS: Use occlusionState instead of isOnActiveSpace to determine when window is drawable ([GH-83096](https://github.com/godotengine/godot/pull/83096)). +- Web: Improve Emscripten `locateFile` glue ([GH-83165](https://github.com/godotengine/godot/pull/83165)). +- Add error messages to the native menu and file dialogs callback ([GH-83181](https://github.com/godotengine/godot/pull/83181)). +- macOS: Fix crash when using system default menu shortcuts ([GH-83243](https://github.com/godotengine/godot/pull/83243)). +- Linux: Implement `DirAccess.is_case_sensitive` for EXT4 and F2FS ([GH-83266](https://github.com/godotengine/godot/pull/83266)). +- Improve X11 `screen_get_refresh_rate` performance ([GH-83902](https://github.com/godotengine/godot/pull/83902)). +- Add support for EGL 1.4 ([GH-83930](https://github.com/godotengine/godot/pull/83930)). +- Update the `launchMode` for the `GodotApp` activity ([GH-83954](https://github.com/godotengine/godot/pull/83954)). +- Fix freeze when requesting clipboard image from our own window ([GH-83970](https://github.com/godotengine/godot/pull/83970)). +- Fix macOS and Windows build with statically linked ANGLE/EGL ([GH-83988](https://github.com/godotengine/godot/pull/83988)). +- TTS_Linux: Fix size_t template issue on OpenBSD by using int consistently ([GH-84017](https://github.com/godotengine/godot/pull/84017)). +- Fix retrieving command line flags in Android ([GH-84102](https://github.com/godotengine/godot/pull/84102)). +- Fix Android editor crash issue when pressing Back ([GH-84414](https://github.com/godotengine/godot/pull/84414)). +- Fix Android disabling splash screen Show Image ([GH-84491](https://github.com/godotengine/godot/pull/84491)). +- Fix bug where maximized->fullscreen->windowed mode stays maximized ([GH-84504](https://github.com/godotengine/godot/pull/84504)). +- X11: Add fallback from desktop GL to GLES, suppress PRIME detector error spam ([GH-84513](https://github.com/godotengine/godot/pull/84513)). +- macOS: Fix fullscreen <-> exclusive fullscreen transition ([GH-84649](https://github.com/godotengine/godot/pull/84649)). +- macOS: Fix transparent and borderless flags interaction with full-screen mode ([GH-84683](https://github.com/godotengine/godot/pull/84683)). +- macOS: Process events before changing title style to update window frame ([GH-84927](https://github.com/godotengine/godot/pull/84927)). +- Fix issue causing Godot Android apps / games to freeze on close ([GH-85454](https://github.com/godotengine/godot/pull/85454)). +- Fix an issue causing the running project window to loop-restart when closed ([GH-85457](https://github.com/godotengine/godot/pull/85457)). #### Rendering -- `VisualServer` now sorts based on AABB position ([GH-43506](https://github.com/godotengine/godot/pull/43506)). -- Make Blinn and Phong specular consider albedo and specular amount ([GH-51410](https://github.com/godotengine/godot/pull/51410)). +- Fix directional LightmapGI being too dark with static lights ([GH-61910](https://github.com/godotengine/godot/pull/61910)). +- [macOS/Windows] Add optional ANGLE backed OpenGL renderer support (runtime backend selection) ([GH-72831](https://github.com/godotengine/godot/pull/72831)). +- Abort on startup with a visible alert if required Vulkan features are missing ([GH-73999](https://github.com/godotengine/godot/pull/73999)). +- Add content scale stretch modes, implement integer scaling ([GH-75784](https://github.com/godotengine/godot/pull/75784)). +- Draw frustum splices on top of direction shadow atlas for debug purposes ([GH-77085](https://github.com/godotengine/godot/pull/77085)). +- Split raster barrier into vertex and fragment barrier ([GH-77420](https://github.com/godotengine/godot/pull/77420)). +- Implement 3D shadows in the GL Compatibility renderer ([GH-77496](https://github.com/godotengine/godot/pull/77496)). +- Replace sampler arrays with constant sampler elements, simplify and reuse code for all shaders ([GH-77740](https://github.com/godotengine/godot/pull/77740)). +- Add support for GLSL source-level debugging with RenderDoc ([GH-77975](https://github.com/godotengine/godot/pull/77975)). +- Use Gaussian approximation for backbuffer mipmaps in GL Compatibility renderer ([GH-78168](https://github.com/godotengine/godot/pull/78168)). +- Clear specular buffer if sky mode is canvas and screen space effects are used ([GH-78624](https://github.com/godotengine/godot/pull/78624)). +- Fix threading bug in Vulkan rendering device ([GH-78794](https://github.com/godotengine/godot/pull/78794)). +- Fix sanitizers reports about octahedral tangents in RenderingServer ([GH-78902](https://github.com/godotengine/godot/pull/78902)). +- Take eye offset into account for depth in StandardMaterial3D ([GH-79049](https://github.com/godotengine/godot/pull/79049)). +- Expose RenderSceneBuffers(RD) through ClassDB ([GH-79142](https://github.com/godotengine/godot/pull/79142)). +- Clear the previously set state when configuring for a new scene root node ([GH-79201](https://github.com/godotengine/godot/pull/79201)). +- Add custom texture create function ([GH-79288](https://github.com/godotengine/godot/pull/79288)). +- Fix missing `_THREAD_SAFE_METHOD_` missing from `RenderingDeviceVulkan` `submit` and `sync` ([GH-79526](https://github.com/godotengine/godot/pull/79526)). +- Fix crash when calling `get_video_adapter_*` in a thread ([GH-79528](https://github.com/godotengine/godot/pull/79528)). +- GLES3: Reset anisotropic filtering when changing texture filtering mode ([GH-79568](https://github.com/godotengine/godot/pull/79568)). +- Fix bad LOD selection when Camera in Mesh AABB ([GH-79590](https://github.com/godotengine/godot/pull/79590)). +- Fix instance uniform data buffer update delay ([GH-79603](https://github.com/godotengine/godot/pull/79603)). +- ShaderRD compilation groups ([GH-79606](https://github.com/godotengine/godot/pull/79606)). +- Revert the change of the limit for interpolation of F0 for dielectrics and metals for Screen Space Reflections ([GH-79624](https://github.com/godotengine/godot/pull/79624)). +- Fix GLES3 multimesh rendering when using colors or custom data ([GH-79660](https://github.com/godotengine/godot/pull/79660)). +- GLES3: Don't call `glTexParameter*` for invalid filter and repeat modes ([GH-79685](https://github.com/godotengine/godot/pull/79685)). +- Add ability to call code on rendering thread ([GH-79696](https://github.com/godotengine/godot/pull/79696)). +- Unbind the framebuffer when updating meshes ([GH-79772](https://github.com/godotengine/godot/pull/79772)). +- Mobile: Uncomment code required for fog rendering on clear color ([GH-79776](https://github.com/godotengine/godot/pull/79776)). +- Use defaults to initialize sky data in case of no sky ([GH-79812](https://github.com/godotengine/godot/pull/79812)). +- Fix Vulkan multithreaded compute list and GPU particle processing ([GH-79849](https://github.com/godotengine/godot/pull/79849)). +- Fix use of discard in shaders ([GH-79865](https://github.com/godotengine/godot/pull/79865)). +- Lazily allocate RIDs for PlaceholderTextures to avoid allocating GPU resources unless used ([GH-79874](https://github.com/godotengine/godot/pull/79874)). +- Fix transparent viewport backgrounds with custom clear color ([GH-79876](https://github.com/godotengine/godot/pull/79876)). +- Check if shader cache directory is available before using cache ([GH-79883](https://github.com/godotengine/godot/pull/79883)). +- Vulkan: Fix dangling pointers in `_clean_up_swap_chain` ([GH-79884](https://github.com/godotengine/godot/pull/79884)). +- Add exceptions for breakage introduced in RD barriers ([GH-79911](https://github.com/godotengine/godot/pull/79911)). +- Make Fresnel darken SSR instead of blending with specular ([GH-79921](https://github.com/godotengine/godot/pull/79921)). +- Initialize MSDF parameters in BaseMaterial3D with default ([GH-79983](https://github.com/godotengine/godot/pull/79983)). +- Fix uninitialized variable ending up sent to Vulkan ([GH-80034](https://github.com/godotengine/godot/pull/80034)). +- Enable depth writes during shadow pass and depth pass. Disable during color pass ([GH-80070](https://github.com/godotengine/godot/pull/80070)). +- Fix validation layer warnings ([GH-80071](https://github.com/godotengine/godot/pull/80071)). +- Fix GLES3 changing 2D shadow atlas size is broken ([GH-80151](https://github.com/godotengine/godot/pull/80151)). +- Add option to enable HDR rendering in 2D ([GH-80215](https://github.com/godotengine/godot/pull/80215)). +- Initialize shader placeholders up front ([GH-80222](https://github.com/godotengine/godot/pull/80222)). +- Fix motion vectors being corrupted when using `precision=double` ([GH-80257](https://github.com/godotengine/godot/pull/80257)). +- Vulkan: Fix sanitizers error with empty shader name ([GH-80288](https://github.com/godotengine/godot/pull/80288)). +- Enhance Vulkan PSO caching ([GH-80296](https://github.com/godotengine/godot/pull/80296)). +- Use fullscreen tri instead of quad ([GH-80311](https://github.com/godotengine/godot/pull/80311)). +- Fix validation error when enabling SSIL alone ([GH-80315](https://github.com/godotengine/godot/pull/80315)). +- Ensure `POINT_SIZE` takes effect in the canvas item shader ([GH-80323](https://github.com/godotengine/godot/pull/80323)). +- Fix integer underflow when rounding up in VoxelGI ([GH-80356](https://github.com/godotengine/godot/pull/80356)). +- Fix issue with four subpasses always been requested in mobile renderer ([GH-80368](https://github.com/godotengine/godot/pull/80368)). +- Remove GPU readback from `NoiseTexture3D.get_format()` ([GH-80407](https://github.com/godotengine/godot/pull/80407)). +- Improve handling of motion vectors for multimesh instances ([GH-80414](https://github.com/godotengine/godot/pull/80414)). +- Add `buffer_copy` method to RenderingDevice ([GH-80424](https://github.com/godotengine/godot/pull/80424)). +- Clamp Volumetric Fog Length property to prevent rendering issues ([GH-80485](https://github.com/godotengine/godot/pull/80485)). +- Fix tonemapper, incorrect vertex count was specified ([GH-80502](https://github.com/godotengine/godot/pull/80502)). +- Fix critical regressions introduced in PR #80414 ([GH-80552](https://github.com/godotengine/godot/pull/80552)). +- Fix validation error when resizing window ([GH-80571](https://github.com/godotengine/godot/pull/80571)). +- Add motion vector support for animated surfaces ([GH-80618](https://github.com/godotengine/godot/pull/80618)). +- Fallback to linear color texture when using 2D HDR and MSDF font ([GH-80651](https://github.com/godotengine/godot/pull/80651)). +- Fix global shader uniform texture loading ([GH-80654](https://github.com/godotengine/godot/pull/80654)). +- Improve visual feedback when using the motion vectors debug view option ([GH-80723](https://github.com/godotengine/godot/pull/80723)). +- Fix Vulkan texture update ([GH-80781](https://github.com/godotengine/godot/pull/80781)). +- Fix memory access error for `MultiMesh` with GLES3 ([GH-80788](https://github.com/godotengine/godot/pull/80788)). +- Fix Vulkan crash with many Omni/SpotLights, Decals or ReflectionProbes ([GH-80845](https://github.com/godotengine/godot/pull/80845)). +- Implement OpenXR Foveated rendering support ([GH-80881](https://github.com/godotengine/godot/pull/80881)). +- Clear SDFGI textures when created ([GH-80889](https://github.com/godotengine/godot/pull/80889)). +- Fix integer value for `GL_MAX_UNIFORM_BLOCK_SIZE` overflowing ([GH-80909](https://github.com/godotengine/godot/pull/80909)). +- Fix missing decal mask in mobile renderer ([GH-80911](https://github.com/godotengine/godot/pull/80911)). +- Fix clear color on mobile renderer ([GH-80933](https://github.com/godotengine/godot/pull/80933)). +- Fix volumetric fog NaN values in textures from starting at a zero Vector2 ([GH-80992](https://github.com/godotengine/godot/pull/80992)). +- GLES3: Fix `glMapBufferRange` return null when `r_index + last_item_index > max_instance` ([GH-81036](https://github.com/godotengine/godot/pull/81036)). +- Fix missing `EARLY_FRAGMENT_TESTS_BIT` barrier flags ([GH-81059](https://github.com/godotengine/godot/pull/81059)). +- Fix VoxelGI CameraAttributes exposure normalization handling ([GH-81067](https://github.com/godotengine/godot/pull/81067)). +- Flip convention of motion vectors ([GH-81074](https://github.com/godotengine/godot/pull/81074)). +- Fixup special case of cluster render ([GH-81081](https://github.com/godotengine/godot/pull/81081)). +- Fix VoxelGI static light pairing ([GH-81124](https://github.com/godotengine/godot/pull/81124)). +- Vertex and attribute compression ([GH-81138](https://github.com/godotengine/godot/pull/81138)). +- Add render mode to use world coordinates in canvas item shader ([GH-81160](https://github.com/godotengine/godot/pull/81160)). +- Reset SDFGI when changing editor scene tabs ([GH-81167](https://github.com/godotengine/godot/pull/81167)). +- Add FidelityFX Super Resolution 2.2 (FSR 2.2.1) support ([GH-81197](https://github.com/godotengine/godot/pull/81197)). +- Add placeholder RID to GradientTexture1D ([GH-81198](https://github.com/godotengine/godot/pull/81198)). +- vulkan: Update all components to Vulkan SDK 1.3.261.1 ([GH-81219](https://github.com/godotengine/godot/pull/81219)). +- Windows: Fix not applying NVIDIA profile to new executables ([GH-81251](https://github.com/godotengine/godot/pull/81251)). +- Implement render mode `fog_disabled` and BaseMaterial3D setting Disable Fog ([GH-81286](https://github.com/godotengine/godot/pull/81286)). +- Use 16-bit index buffers instead of 32 when unnecessary ([GH-81288](https://github.com/godotengine/godot/pull/81288)). +- Fix `RDPipelineColorBlendState.attachments` setter ([GH-81333](https://github.com/godotengine/godot/pull/81333)). +- Fix mipmap bias behavior by refactoring how samplers are created by Material Storage ([GH-81350](https://github.com/godotengine/godot/pull/81350)). +- Fix clear color's alpha value will affects 2D editor in Compatibility mode ([GH-81395](https://github.com/godotengine/godot/pull/81395)). +- Propagate error correctly when max texture size for lightmaps is too small ([GH-81543](https://github.com/godotengine/godot/pull/81543)). +- Fix LightmapGI baking with GridMap ([GH-81545](https://github.com/godotengine/godot/pull/81545)). +- Fix GLES3 instanced rendering color and custom data defaults ([GH-81575](https://github.com/godotengine/godot/pull/81575)). +- Fix VoxelGI MultiMesh and CSG mesh baking ([GH-81616](https://github.com/godotengine/godot/pull/81616)). +- Improve GLES3 scene renderer compatibility with older devices ([GH-81650](https://github.com/godotengine/godot/pull/81650)). +- Replace OIDN denoiser in Lightmapper with a JNLM denoiser compute shader ([GH-81659](https://github.com/godotengine/godot/pull/81659)). +- Fix validation error when using pipeline cache control ([GH-81771](https://github.com/godotengine/godot/pull/81771)). +- Fix massive validation errors when enabling TAA + MSAA ([GH-81775](https://github.com/godotengine/godot/pull/81775)). +- Opt-in to Vulkan features we actually use ([GH-81827](https://github.com/godotengine/godot/pull/81827)). +- Add half-pixel offset to lightmapper rasterization ([GH-81872](https://github.com/godotengine/godot/pull/81872)). +- Polish a few things in Vulkan RD ([GH-81912](https://github.com/godotengine/godot/pull/81912)). +- Fix LightmapGI shading sometimes being unlit or black ([GH-81951](https://github.com/godotengine/godot/pull/81951)). +- Rewrite the GPU Lightmapper's indirect logic to match Godot 3.5's CPU Lightmapper ([GH-82068](https://github.com/godotengine/godot/pull/82068)). +- Fix ShaderGlobalsOverride property handling ([GH-82100](https://github.com/godotengine/godot/pull/82100)). +- Linux/OpenGL: Don't force vsync in the editor ([GH-82221](https://github.com/godotengine/godot/pull/82221)). +- Fix RaycastOcclusionCull World3D scenario memory leak ([GH-82291](https://github.com/godotengine/godot/pull/82291)). +- Optimizing glow behavior ([GH-82353](https://github.com/godotengine/godot/pull/82353)). +- Add device info to GLES3 shader cache key hash ([GH-82359](https://github.com/godotengine/godot/pull/82359)). +- ANGLE: Add fallback control options and defaults ([GH-82364](https://github.com/godotengine/godot/pull/82364)). +- Clamp ReflectionProbe Max Distance to 262,144 to fix rendering issues ([GH-82415](https://github.com/godotengine/godot/pull/82415)). +- Fix Decal clamping to positive values not being applied to RenderingServer ([GH-82416](https://github.com/godotengine/godot/pull/82416)). +- GLES3: Avoid freeing proxy textures clearing owner's data ([GH-82430](https://github.com/godotengine/godot/pull/82430)). +- Avoid trying to free null RIDs in FSR2 teardown ([GH-82445](https://github.com/godotengine/godot/pull/82445)). +- Fix mismatch between surface vertex array generation inside the function and the caller ([GH-82451](https://github.com/godotengine/godot/pull/82451)). +- Disable `lightmapper_rd` module in non-editor builds (and in Android editor) ([GH-82521](https://github.com/godotengine/godot/pull/82521)). +- Make the lightmapper not dilate before denoising ([GH-82533](https://github.com/godotengine/godot/pull/82533)). +- Use internal texture at internal resolution for calculating luminance (FSR2) ([GH-82534](https://github.com/godotengine/godot/pull/82534)). +- Fix cluster artifacts and negative light ([GH-82546](https://github.com/godotengine/godot/pull/82546)). +- Workaround crash due to null shader when running XR project with `--xr-mode` off ([GH-82679](https://github.com/godotengine/godot/pull/82679)). +- OpenXR: Properly skip frame render when the XR runtime is not yet ready ([GH-82752](https://github.com/godotengine/godot/pull/82752)). +- Forgot to add debanding to config object ([GH-82766](https://github.com/godotengine/godot/pull/82766)). +- Re-add optional OIDN denoise as an external executable ([GH-82832](https://github.com/godotengine/godot/pull/82832)). +- Fog shader: Fix undeclared identifier `global_variables` ([GH-82877](https://github.com/godotengine/godot/pull/82877)). +- Avoid default fallback material when using `world_vertex_coords` ([GH-82886](https://github.com/godotengine/godot/pull/82886)). +- Only perform modelview transform on tangent and binormal when vertex shader is in local space ([GH-82892](https://github.com/godotengine/godot/pull/82892)). +- Directional 2 Split Shadow stabilization fix ([GH-82974](https://github.com/godotengine/godot/pull/82974)). +- Fix VoxelGI bake memory leak ([GH-83035](https://github.com/godotengine/godot/pull/83035)). +- Fix `trace_ray()` function in the lightmapper missing hits with large triangles ([GH-83040](https://github.com/godotengine/godot/pull/83040)). +- Fix incorrect check in `_dict_to_surf` ([GH-83056](https://github.com/godotengine/godot/pull/83056)). +- Fix incorrect vertex data size calculation in `ImmediateMesh` ([GH-83100](https://github.com/godotengine/godot/pull/83100)). +- Fix compatibility shadow size not being initialized ([GH-83141](https://github.com/godotengine/godot/pull/83141)). +- Disable update spinner when debug redraw is active ([GH-83143](https://github.com/godotengine/godot/pull/83143)). +- Fix BaseMaterial3D update with certain material settings ([GH-83145](https://github.com/godotengine/godot/pull/83145)). +- Fix a few cases where surface format is still 32 bits ([GH-83169](https://github.com/godotengine/godot/pull/83169)). +- Sanitize tangents when creating mesh surfaces to avoid triggering the compressed mesh path in the shader ([GH-83179](https://github.com/godotengine/godot/pull/83179)). +- Add an extra backbuffer color texture that can be used when an upscaler is in use ([GH-83192](https://github.com/godotengine/godot/pull/83192)). +- Fix `TextureStorage` not assigning default scale ([GH-83199](https://github.com/godotengine/godot/pull/83199)). +- Cleanup instances of using uint32_t for mesh formats ([GH-83211](https://github.com/godotengine/godot/pull/83211)). +- Fix OpenGL directional shadow last split fading ([GH-83252](https://github.com/godotengine/godot/pull/83252)). +- Optimize lightmapper using triangle clusters on the acceleration structure ([GH-83284](https://github.com/godotengine/godot/pull/83284)). +- Fix disabling depth prepass break opaque materials ([GH-83371](https://github.com/godotengine/godot/pull/83371)). +- Fix Mobile renderer shader instance uniform access ([GH-83400](https://github.com/godotengine/godot/pull/83400)). +- Pass viewport size to shadow pass instead of using Vector2i(1,1) ([GH-83491](https://github.com/godotengine/godot/pull/83491)). +- Ensure that only visible paired lights are used ([GH-83493](https://github.com/godotengine/godot/pull/83493)). +- Bump version of Vulkan RD binary shader format ([GH-83563](https://github.com/godotengine/godot/pull/83563)). +- Fix shadow map debug visualization camera frustum index buffer size ([GH-83639](https://github.com/godotengine/godot/pull/83639)). +- Fixing incorrect normal map when using triplanar world mapping and mesh rotation ([GH-83658](https://github.com/godotengine/godot/pull/83658)). +- Some more fixes for compressed meshes ([GH-83704](https://github.com/godotengine/godot/pull/83704)). +- macOS: Fallback to native OpenGL renderer if ANGLE initialization failed ([GH-83753](https://github.com/godotengine/godot/pull/83753)). +- Fix `GPUParticles3D` on the Meta Quest 2 with OpenGL renderer ([GH-83756](https://github.com/godotengine/godot/pull/83756)). +- Add property hint for 2D shadow size project setting ([GH-83760](https://github.com/godotengine/godot/pull/83760)). +- Ensure `r_aabb` is always used when creating surfaces through the RenderingServer ([GH-83840](https://github.com/godotengine/godot/pull/83840)). +- Fix LightmapGI taking editor-only and sky-only lights into account ([GH-83861](https://github.com/godotengine/godot/pull/83861)). +- Add padding to normal attribute in Compatibility renderer to match the RD renderers ([GH-83906](https://github.com/godotengine/godot/pull/83906)). +- Fix reading shadow filter quality from project settings in compatibility ([GH-83998](https://github.com/godotengine/godot/pull/83998)). +- Fix crash when upgrading meshes from 3.x format ([GH-84047](https://github.com/godotengine/godot/pull/84047)). +- Fix multiple issues with UV compression ([GH-84159](https://github.com/godotengine/godot/pull/84159)). +- Parse OpenGL and Vulkan strings as UTF-8 ([GH-84197](https://github.com/godotengine/godot/pull/84197)). +- Overhaul the SurfaceUpgradeTool ([GH-84200](https://github.com/godotengine/godot/pull/84200)). +- Fix bug with alpha to coverage by enabling depth discard when using alpha to coverage ([GH-84211](https://github.com/godotengine/godot/pull/84211)). +- Fix cubemap downsampler logic ([GH-84223](https://github.com/godotengine/godot/pull/84223)). +- Fix WebXR on desktop emulator by resetting active texture unit ([GH-84267](https://github.com/godotengine/godot/pull/84267)). +- macOS: Improve ANGLE support detection ([GH-84288](https://github.com/godotengine/godot/pull/84288)). +- Use default samplers in base uniform set when rendering to reflection probes ([GH-84317](https://github.com/godotengine/godot/pull/84317)). +- Windows: Add some AMD GPUs to the OpenGL blocklist ([GH-84568](https://github.com/godotengine/godot/pull/84568)). +- Create tangent array if mesh created without tangents ([GH-84576](https://github.com/godotengine/godot/pull/84576)). +- Fix FogMaterial memory leak ([GH-84702](https://github.com/godotengine/godot/pull/84702)). +- GLES3: Protect against bogus `glGetShaderInfoLog` return values ([GH-84741](https://github.com/godotengine/godot/pull/84741)). +- GLES3: Ensure all ShaderData is properly initialized in `set_code` ([GH-84752](https://github.com/godotengine/godot/pull/84752)). +- Ensure optional CopyEffects variants are loaded last ([GH-84883](https://github.com/godotengine/godot/pull/84883)). +- Renderer Viewport correct `sizeof` usage ([GH-84952](https://github.com/godotengine/godot/pull/84952)). +- GLES3: Fix iOS Simulator by removing incorrect `system_fbo` overwrite ([GH-84955](https://github.com/godotengine/godot/pull/84955)). +- Ensure 2D MSAA resolve is performed when 3D content but no 2D content in scene ([GH-84957](https://github.com/godotengine/godot/pull/84957)). +- Prevent crash in `_nvapi_disable_threaded_optimization` when attached to renderdoc ([GH-85121](https://github.com/godotengine/godot/pull/85121)). +- Avoid division by zero in the fix surface compatibility routine ([GH-85138](https://github.com/godotengine/godot/pull/85138)). +- Fix potential double-close of draw command label ([GH-85147](https://github.com/godotengine/godot/pull/85147)). +- Enable non-multiview advanced shader group whenever advanced shaders are requested ([GH-85194](https://github.com/godotengine/godot/pull/85194)). #### Shaders -- Default shader specular render mode to `SCHLICK_GGX` ([GH-51401](https://github.com/godotengine/godot/pull/51401)). +- Improve shader editor templates to be more descriptive ([GH-51863](https://github.com/godotengine/godot/pull/51863)). +- Add more useful Visual Shader nodes ([GH-72664](https://github.com/godotengine/godot/pull/72664)). +- Add DEPTH to the visual shader output (for spatial mode) ([GH-73691](https://github.com/godotengine/godot/pull/73691)). +- Support shader preprocessor concatenation symbol ([GH-74737](https://github.com/godotengine/godot/pull/74737)). +- Make the dragging connections more user-friendly in visual shaders ([GH-78547](https://github.com/godotengine/godot/pull/78547)). +- Fix invalid shader compilation when using `hint_normal_roughness_texture` in mobile backend ([GH-78839](https://github.com/godotengine/godot/pull/78839)). +- Fix using uint suffix at the hex number declaration in shaders ([GH-78906](https://github.com/godotengine/godot/pull/78906)). +- Fix shader language float literal precision truncation ([GH-78972](https://github.com/godotengine/godot/pull/78972)). +- Fix "Create Shader Node" window position when visual shader editor is floating ([GH-78996](https://github.com/godotengine/godot/pull/78996)). +- Allow more hint types for uniform arrays ([GH-79100](https://github.com/godotengine/godot/pull/79100)). +- Make shader preprocessor keyword colors consistent ([GH-79112](https://github.com/godotengine/godot/pull/79112)). +- Fix comments and indentation in `.gdshaderinc` files ([GH-79158](https://github.com/godotengine/godot/pull/79158)). +- Fix shader type detection ([GH-79287](https://github.com/godotengine/godot/pull/79287)). +- Add autocomplete for filter/repeat hints on uniform arrays ([GH-79402](https://github.com/godotengine/godot/pull/79402)). +- Add error for undefined function in shader ([GH-79459](https://github.com/godotengine/godot/pull/79459)). +- Remove debugging print from shader cache ([GH-80125](https://github.com/godotengine/godot/pull/80125)). +- Fix Shader and ShaderInclude resource loading ([GH-80705](https://github.com/godotengine/godot/pull/80705)). +- Fix empty shader resource loading ([GH-81300](https://github.com/godotengine/godot/pull/81300)). +- Fix shader language preprocessor include marker handling ([GH-81381](https://github.com/godotengine/godot/pull/81381)). +- Fix shader text editor include file reloading ([GH-81410](https://github.com/godotengine/godot/pull/81410)). +- Fix int to uint implicit cast error when use mat3 uniform in compatibility renderer ([GH-81494](https://github.com/godotengine/godot/pull/81494)). +- Re-allows constants in global space to be initialized with function call ([GH-81619](https://github.com/godotengine/godot/pull/81619)). +- Implement drop-down list properties to the custom visual shader nodes ([GH-81688](https://github.com/godotengine/godot/pull/81688)). +- Visual Shaders: Make output-ports for vector types expandable by default ([GH-82088](https://github.com/godotengine/godot/pull/82088)). +- Add preprocessor pass on visual shader when showing generated code ([GH-82570](https://github.com/godotengine/godot/pull/82570)). +- Fix typo in `shader_language.cpp` ([GH-83004](https://github.com/godotengine/godot/pull/83004)). +- Close shader in Shader Editor tab when deleting shader file in FileSystem panel ([GH-83137](https://github.com/godotengine/godot/pull/83137)). +- Fix parameter shader node not declared when only connected to a VaryingSetter ([GH-83189](https://github.com/godotengine/godot/pull/83189)). +- Fix bool varying's generated code will be modified with flat ([GH-83194](https://github.com/godotengine/godot/pull/83194)). +- Fix visual shader crash when arranging ([GH-83678](https://github.com/godotengine/godot/pull/83678)). +- Prevent `_allocate_placeholders` crash if `p_version->variants` is null ([GH-83780](https://github.com/godotengine/godot/pull/83780)). +- Fix inability to uncomment code in text shader editor ([GH-83822](https://github.com/godotengine/godot/pull/83822)). +- Fix assign with swizzle in shader not doing varying validation check ([GH-83830](https://github.com/godotengine/godot/pull/83830)). +- Properly rename `INSTANCE_ID` and `VERTEX_ID` in canvas item shaders in the compatibility backend ([GH-84585](https://github.com/godotengine/godot/pull/84585)). +- Don't store shader edit path in metadata ([GH-84628](https://github.com/godotengine/godot/pull/84628)). +- Fix VisualShader Texture2DParameter node filter bug ([GH-84768](https://github.com/godotengine/godot/pull/84768)). +- Fix VisualShader connection use after free ([GH-84832](https://github.com/godotengine/godot/pull/84832)). +- Make `AMOUNT_RATIO` constant in the shader language specification ([GH-85086](https://github.com/godotengine/godot/pull/85086)). +- Set some dialogs in the VisualShader editor to be exclusive ([GH-85205](https://github.com/godotengine/godot/pull/85205)). + +#### Tests + +- Add unit tests for Variant for operator overloading ([GH-76244](https://github.com/godotengine/godot/pull/76244)). +- Add a test suite for TranslationServer ([GH-79331](https://github.com/godotengine/godot/pull/79331)). +- Add unit tests for PackedScene ([GH-79440](https://github.com/godotengine/godot/pull/79440)). +- Add a test suite to InputEvent ([GH-79444](https://github.com/godotengine/godot/pull/79444)). +- Remove use of `std::string` in test ([GH-80422](https://github.com/godotengine/godot/pull/80422)). +- Improve PackedScene unit test for complex scene ([GH-80423](https://github.com/godotengine/godot/pull/80423)). +- Fix errors when testing `Resource` ([GH-81456](https://github.com/godotengine/godot/pull/81456)). +- Adds additional tests for RegEx class ([GH-82225](https://github.com/godotengine/godot/pull/82225)). +- Simplify Geometry3D tests ([GH-82288](https://github.com/godotengine/godot/pull/82288)). +- Fix Variant assignment to Vec2 tests ([GH-83959](https://github.com/godotengine/godot/pull/83959)). #### Thirdparty -- Bullet uppdated to version 3.17. -- Embree updated to version 3.13.0. -- MbedTLS updated to version 2.16.11 (security update). -- NanoSVG updated to 2021-09-03 git snapshot (security update). -- CA root certificates updated to 2021-07-05 bundle from Mozilla. -- SDL GameControllerDB updated to 2021-10-29 git snapshot. +- brotli: Sync with upstream 1.1.0 ([GH-82580](https://github.com/godotengine/godot/pull/82580)). +- freetype: Update to version 2.13.2 ([GH-81110](https://github.com/godotengine/godot/pull/81110)). +- harfbuzz: Update to version 8.2.2 ([GH-84080](https://github.com/godotengine/godot/pull/84080)). +- libpng: Update to upstream 1.6.40 ([GH-80262](https://github.com/godotengine/godot/pull/80262)). +- libwebp: Sync with upstream 1.3.2 ([GH-81663](https://github.com/godotengine/godot/pull/81663)). +- mbedtls: Fix MSVC ARM build after 2.28.3 enabled AES-NI intrinsics ([GH-81405](https://github.com/godotengine/godot/pull/81405)). +- mbedtls: Update to version 2.28.5 ([GH-83721](https://github.com/godotengine/godot/pull/83721)). +- mbedtls: Backport Windows fix to use bcrypt for entropy ([GH-84042](https://github.com/godotengine/godot/pull/84042)). +- miniupnpc: Update to version 2.2.5 ([GH-80382](https://github.com/godotengine/godot/pull/80382)). +- minizip: Fix `ZIPReader` failing to open empty zip files ([GH-73310](https://github.com/godotengine/godot/pull/73310)). +- minizip: Backport patch to fix CVE-2023-45853 ([GH-85509](https://github.com/godotengine/godot/pull/85509)). +- openxr: Sync with upstream 1.0.31, don't build obsolete dispatch table ([GH-83984](https://github.com/godotengine/godot/pull/83984)). +- r128: Update to include latest fix for intrinsics being incorrect included ([GH-84537](https://github.com/godotengine/godot/pull/84537)). +- thorvg: Update to 0.11.2 ([GH-83656](https://github.com/godotengine/godot/pull/83656)). +- tinyexr: Sync with upstream 1.0.7 ([GH-80384](https://github.com/godotengine/godot/pull/80384)). +- zlib/minizip: Update to version 1.3 ([GH-81111](https://github.com/godotengine/godot/pull/81111)). #### XR -- Only update render target directly if ARVR mode is off ([GH-54258](https://github.com/godotengine/godot/pull/54258)). - -### Removed - -#### Porting - -- Android: Remove non-functional native video OS methods ([GH-48537](https://github.com/godotengine/godot/pull/48537)). -- iOS: Remove duplicate orientation setting in the export preset ([GH-48943](https://github.com/godotengine/godot/pull/48943)). - -### Fixed - -#### 2D - -- TileSet: Fix selection of spaced atlas tile when using priority ([GH-50886](https://github.com/godotengine/godot/pull/50886)). - -#### 3D - -- CSGSphere: Fix UV mapping ([GH-49195](https://github.com/godotengine/godot/pull/49195)). -- CSGPolygon: Fix multiple issues ([GH-49314](https://github.com/godotengine/godot/pull/49314)). -- CSGPolygon: Fixes and features: Angle simplification, UV tiling distance, interval type ([GH-52509](https://github.com/godotengine/godot/pull/52509)). -- GridMap: Fix erasing octants in the wrong order ([GH-50052](https://github.com/godotengine/godot/pull/50052)). -- PathFollow: Fix forward calculation for the position at the end of the curve ([GH-50986](https://github.com/godotengine/godot/pull/50986)). -- SphereMesh: Fix the normals when the sphere/hemisphere is oblong ([GH-51995](https://github.com/godotengine/godot/pull/51995)). -- Update mesh AABB when software skinning is used ([GH-53144](https://github.com/godotengine/godot/pull/53144)). - -#### Animation - -- Fix Tween active state and repeat after `stop()` and then `start()` ([GH-47142](https://github.com/godotengine/godot/pull/47142)). -- Fix SkeletonIK root bones being twisted incorrectly when rotated ([GH-48251](https://github.com/godotengine/godot/pull/48251)). -- Fix issues with `BlendSpace2D` `BLEND_MODE_DISCRETE_CARRY` ([GH-48375](https://github.com/godotengine/godot/pull/48375)). -- Fixed issue where bones become detached if multiple SkeletonIK nodes are used ([GH-49031](https://github.com/godotengine/godot/pull/49031)). -- Fix non functional 3D onion skinning ([GH-52664](https://github.com/godotengine/godot/pull/52664)). -- Fix Animation Playback Track not seeking properly ([GH-38107](https://github.com/godotengine/godot/pull/38107)). -- Fix bugs in `AnimationNodeTransition`'s behavior ([GH-52543](https://github.com/godotengine/godot/pull/52543), [GH-52555](https://github.com/godotengine/godot/pull/52555)). -- Fix rendering centered odd-size texture for `AnimatedSprite`/`AnimatedSprite3D` ([GH-53052](https://github.com/godotengine/godot/pull/53052)). - -#### Audio - -- Fix cubic resampling algorithm ([GH-51082](https://github.com/godotengine/godot/pull/51082)). - -#### Core - -- Make all file access 64-bit (`uint64_t`) ([GH-47254](https://github.com/godotengine/godot/pull/47254)). - * This adds support for handling files bigger than 2.1 GiB, including on 32-bit OSes. -- Fix negative delta arguments ([GH-52947](https://github.com/godotengine/godot/pull/52947)). -- Complain if casting a freed object in a debug session ([GH-51095](https://github.com/godotengine/godot/pull/51095)). -- Fix read/write issues with `NaN` and `INF` in VariantParser ([GH-47500](https://github.com/godotengine/godot/pull/47500)). -- Fix sub-resource storing the wrong index in cache ([GH-49625](https://github.com/godotengine/godot/pull/49625)). -- Save binary `ProjectSettings` key length properly ([GH-49649](https://github.com/godotengine/godot/pull/49649)). -- Fix ZIP files being opened with two file descriptors ([GH-42337](https://github.com/godotengine/godot/pull/42337)). -- Fix `Transform::xform(Plane)` functions to handle non-uniform scaling ([GH-50637](https://github.com/godotengine/godot/pull/50637)). -- Fix renaming directories with `Directory.rename()` ([GH-51793](https://github.com/godotengine/godot/pull/51793)). -- Fix path with multiple slashes not being corrected on templates ([GH-52513](https://github.com/godotengine/godot/pull/52513)). -- Fix `String.get_base_dir()` handling of Windows top-level directories ([GH-52744](https://github.com/godotengine/godot/pull/52744)). -- Fix potential crash when creating thread with an invalid target instance ([GH-53060](https://github.com/godotengine/godot/pull/53060)). -- Fix behavior of `CONNECT_REFERENCE_COUNTED` option for signal connections ([GH-47442](https://github.com/godotengine/godot/pull/47442)). -- Fix swapped axes in `OpenSimplexNoise.get_image()` ([GH-30424](https://github.com/godotengine/godot/pull/30424)). - * Breaks compat. If you need to preserve the 3.2 behavior, swap your first and second arguments in `get_image()`. -- Fix loading packed scene with editable children at runtime ([GH-49664](https://github.com/godotengine/godot/pull/49664)). -- Quote and escape `ConfigFile` keys when necessary ([GH-52180](https://github.com/godotengine/godot/pull/52180)). -- Write node groups on a single line when saving a `.tscn` file ([GH-52284](https://github.com/godotengine/godot/pull/52284)). - -#### Editor - -- Rationalize property reversion ([GH-51166](https://github.com/godotengine/godot/pull/51166)). -- Fix Marshalls infinite recursion crash in debugger ([GH-51068](https://github.com/godotengine/godot/pull/51068)). -- Fix slow load/save of scenes with many instances of the same script ([GH-49570](https://github.com/godotengine/godot/pull/49570)). -- Properly update `NodePath`s in the editor in more cases when nodes are moved or renamed ([GH-49812](https://github.com/godotengine/godot/pull/49812)). -- Fix scale sensitivity for 3D objects ([GH-52665](https://github.com/godotengine/godot/pull/52665)). -- Fix preview grid in `SpriteFrames` editor's "Select Frames" dialog ([GH-52461](https://github.com/godotengine/godot/pull/52461)). -- Fix `MeshInstance2D` edit rect ([GH-54070](https://github.com/godotengine/godot/pull/54070)). - -#### GDScript - -- Ignore property groups and categories in GDScript code completion ([GH-54272](https://github.com/godotengine/godot/pull/54272)). -- Fix parsing multi-line `preload` statement ([GH-52521](https://github.com/godotengine/godot/pull/52521)). -- Speedup running very big GDScript files ([GH-53507](https://github.com/godotengine/godot/pull/53507)). -- LSP: Fix `SymbolKind` reporting wrong types and `get_node()` parsing ([GH-50914](https://github.com/godotengine/godot/pull/50914), [GH-51283](https://github.com/godotengine/godot/pull/51283)). -- LSP: Report `new()` as `_init` & fix docstrings on multiline functions ([GH-53094](https://github.com/godotengine/godot/pull/53094)). - -#### GUI - -- GraphNode: Properly handle children with "Expand" flag ([GH-39810](https://github.com/godotengine/godot/pull/39810)). -- Label: Fix valign with stylebox borders ([GH-50478](https://github.com/godotengine/godot/pull/50478)). -- RichTextLabel: Fix auto-wrapping on CJK texts ([GH-49280](https://github.com/godotengine/godot/pull/49280)). -- RichTextLabel: Fix character horizontal offset calculation ([GH-52752](https://github.com/godotengine/godot/pull/52752)). -- RichTextLabel: Honor content margin when drawing font shadow ([GH-54054](https://github.com/godotengine/godot/pull/54054)). -- RichTextLabel: Fix meta link detection when used inside a fill tag ([GH-54114](https://github.com/godotengine/godot/pull/54114)). -- TabContainer: Fix moving dropped tab to incorrect child index ([GH-51177](https://github.com/godotengine/godot/pull/51177)). -- Tabs: Fix invisible tabs not being ignored ([GH-53551](https://github.com/godotengine/godot/pull/53551)). -- TextureProgress: Improve behavior with nine patch ([GH-45815](https://github.com/godotengine/godot/pull/45815)). -- Theme: Fix potential crash with custom themes using BitMap fonts ([GH-53410](https://github.com/godotengine/godot/pull/53410)). - -#### Import - -- Fix loading RLE compressed TGA files ([GH-49603](https://github.com/godotengine/godot/pull/49603)). -- Fix issue in `TextureAtlas` import of images with wrong size ([GH-42103](https://github.com/godotengine/godot/pull/42103)). -- Fix potential crash importing invalid BMP files ([GH-46555](https://github.com/godotengine/godot/pull/46555)). -- glTF: Improved error handling around invalid images and invalid meshes ([GH-48904](https://github.com/godotengine/godot/pull/48904), [GH-48912](https://github.com/godotengine/godot/pull/48912)). -- glTF: Fix incorrect skin deduplication when using named binds ([GH-48913](https://github.com/godotengine/godot/pull/48913)). - -#### Input - -- Fix game controllers ignoring the last listed button ([GH-48934](https://github.com/godotengine/godot/pull/48934)). - -#### Mono (C#) - -- iOS: Fix `P/Invoke` symbols being stripped by the linker, resulting in `EntryPointNotFoundException` crash at runtime ([GH-49248](https://github.com/godotengine/godot/pull/49248)). -- macOS: Automatically enable JIT entitlements for the Mono exports ([GH-50317](https://github.com/godotengine/godot/pull/50317)). -- Fix reloading `tool` scripts in the editor ([GH-52883](https://github.com/godotengine/godot/pull/52883)). -- Fix C# bindings generator for default value types ([GH-49702](https://github.com/godotengine/godot/pull/49702)). -- Ignore paths with invalid chars in `PathWhich` ([GH-50918](https://github.com/godotengine/godot/pull/50918)). -- Fix `List<T>` marshaling ([GH-53628](https://github.com/godotengine/godot/pull/53628)). -- Fix `hint_string` for enum arrays ([GH-53638](https://github.com/godotengine/godot/pull/53638)). -- Keep order for C# exported members ([GH-54199](https://github.com/godotengine/godot/pull/54199)). - -#### Networking - -- Fix parsing some IPv6 URLs for WebSocket ([GH-48205](https://github.com/godotengine/godot/pull/48205)). -- `WebsocketPeer` outbound buffer fixes and buffer size query ([GH-51037](https://github.com/godotengine/godot/pull/51037)). -- Fix IP address resolution incorrectly locking the main thread ([GH-51199](https://github.com/godotengine/godot/pull/51199)). - -#### Physics - -- Fix 2D and 3D moving platform logic ([GH-50166](https://github.com/godotengine/godot/pull/50166), [GH-51458](https://github.com/godotengine/godot/pull/51458)). -- Various fixes to 2D and 3D `KinematicBody` `move_and_slide` and `move_and_collide` ([GH-50495](https://github.com/godotengine/godot/pull/50495)). -- Improved logic for `KinematicBody` collision recovery depth ([GH-53451](https://github.com/godotengine/godot/pull/53451)). -- Fix `RayShape` recovery in `test_body_ray_separation` ([GH-53453](https://github.com/godotengine/godot/pull/53453)). -- Apply infinite inertia checks to Godot Physics 3D ([GH-42637](https://github.com/godotengine/godot/pull/42637)). -- Fix and clean disabled shapes handling in Godot physics servers ([GH-49845](https://github.com/godotengine/godot/pull/49845)). -- Fix `KinematicBody` axis lock ([GH-45176](https://github.com/godotengine/godot/pull/45176)). -- Don't override `KinematicCollision` reference when still in use in script ([GH-52955](https://github.com/godotengine/godot/pull/52955)). -- Fix ragdoll simulation when parent was re-added to scene ([GH-48823](https://github.com/godotengine/godot/pull/48823)). -- Ignore disabled shapes for mass property calculations ([GH-49699](https://github.com/godotengine/godot/pull/49699)). - -#### Porting - -- Android: Add GDNative libraries to Android custom Gradle builds ([GH-49912](https://github.com/godotengine/godot/pull/49912)). -- Android: Resolve issue where the Godot app remains stuck when resuming ([GH-51584](https://github.com/godotengine/godot/pull/51584)). -- Android: Properly validate `godot_project_name_string` for Android special chars ([GH-54255](https://github.com/godotengine/godot/pull/54255)). -- HTML5: Fix bug in AudioWorklet when reading output buffer ([GH-52696](https://github.com/godotengine/godot/pull/52696)). -- HTML5: Release pressed events when the window is blurred on HTML5 platform ([GH-52973](https://github.com/godotengine/godot/pull/52973)). -- Linux: Fix input events random delay on X11 ([GH-54313](https://github.com/godotengine/godot/pull/54313)). -- Linux: Fix implementation of `move_to_trash` ([GH-44021](https://github.com/godotengine/godot/pull/44021)). -- Linux: Fix crash when using ALSA MIDI with PulseAudio ([GH-48350](https://github.com/godotengine/godot/pull/48350)). -- Linux: Fix `Directory::get_space_left()` result ([GH-49222](https://github.com/godotengine/godot/pull/49222)). -- macOS: Allow "on top" windows to enter fullscreen mode ([GH-49017](https://github.com/godotengine/godot/pull/49017)). -- macOS: Fix editor window missing events on macOS Monterey ([GH-54474](https://github.com/godotengine/godot/pull/54474)). -- macOS: Fix custom mouse cursor not set after mouse mode change ([GH-49848](https://github.com/godotengine/godot/pull/49848)). -- macOS: Fix `Directory::get_space_left()` result ([GH-49222](https://github.com/godotengine/godot/pull/49222)). -- macOS: Fix Xbox controllers in Bluetooth mode on macOS ([GH-51117](https://github.com/godotengine/godot/pull/51117)). -- macOS: Fix incorrect mouse position in fullscreen ([GH-52374](https://github.com/godotengine/godot/pull/52374)). -- macOS: Add entitlements required by OIDN JIT for the editor build ([GH-54067](https://github.com/godotengine/godot/pull/54067)). -- Windows: Fix platform file access to allow file sharing with external programs ([GH-51430](https://github.com/godotengine/godot/pull/51430)). -- Windows: Fix code signing with `osslsigncode` from Linux/macOS ([GH-49985](https://github.com/godotengine/godot/pull/49985)). -- Windows: Send error logs to `stderr` instead of `stdout`, like done on other OSes ([GH-39139](https://github.com/godotengine/godot/pull/39139)). -- Windows: Fix `OS.shell_open()` not returning errors ([GH-52842](https://github.com/godotengine/godot/pull/52842)). -- Windows: Allow renaming to change the case of Windows directories ([GH-43068](https://github.com/godotengine/godot/pull/43068)). -- Windows: Disable WebM SIMD optimization with YASM which triggers crashes ([GH-53959](https://github.com/godotengine/godot/pull/53959)). - -#### Rendering - -- GLES2: Fix ambient light flickering with multiple refprobes ([GH-53740](https://github.com/godotengine/godot/pull/53740)). -- GLES3: Fix draw order of transparent materials with multiple directional lights ([GH-47129](https://github.com/godotengine/godot/pull/47129)). -- GLES3: Fix multimesh being colored by other nodes ([GH-47582](https://github.com/godotengine/godot/pull/47582)). -- GLES3: Only add emission on base pass ([GH-53938](https://github.com/godotengine/godot/pull/53938)). -- GLES3: Fudge irradiance map lookup to avoid precision issues ([GH-54197](https://github.com/godotengine/godot/pull/54197)). -- Fixed `rotate_y` property of particle shaders ([GH-46687](https://github.com/godotengine/godot/pull/46687)). -- Fixed behavior of velocity spread in particles ([GH-47310](https://github.com/godotengine/godot/pull/47310)). -- Fixes depth sorting of meshes with transparent textures ([GH-50721](https://github.com/godotengine/godot/pull/50721)). -- Fix flipped binormal in `SpatialMaterial` triplanar mapping ([GH-49950](https://github.com/godotengine/godot/pull/49950)). -- Fix `CanvasItem` bounding rect calculation in some cases ([GH-49160](https://github.com/godotengine/godot/pull/49160)). -- Clamp negative colors regardless of the tonemapper to avoid artifacts ([GH-51439](https://github.com/godotengine/godot/pull/51439)). -- Fix Y billboard shear when rotating camera ([GH-52151](https://github.com/godotengine/godot/pull/52151)). -- Add half frame to `floor()` for animated particles UV to compensate precision errors ([GH-53233](https://github.com/godotengine/godot/pull/53233)). -- Prevent shaders from generating code before the constructor finishes ([GH-52475](https://github.com/godotengine/godot/pull/52475)). - - -## [3.3] - 2021-04-21 - -See the [release announcement](https://godotengine.org/article/godot-3-3-has-arrived) for details. - -### Added - -#### Audio - -- [MP3 loading and playback support](https://github.com/godotengine/godot/pull/43007). -- [Add AudioEffectCapture to access the microphone in real-time](https://github.com/godotengine/godot/pull/45593). - -#### Build system - -- [Add `production=yes` option to set optimal options for production builds](https://github.com/godotengine/godot/pull/45593). - - Users making custom builds should use this option which is equivalent to `use_lto=yes debug_symbols=no use_static_cpp=yes`. - - **Note for Linux builds:** `use_static_cpp=yes` and `udev=yes` are now the default values, so you need `libudev` and `libstdc++-static` development packages to build in optimal conditions. -- [Add `optimize=none` to disable C/C++ compiler optimizations for release builds](https://github.com/godotengine/godot/pull/46966). - - This can be used to speed up compile times when working on the engine itself and when debug checks/features aren't desired. - -#### Core - -- [New dynamic BVH for rendering and the GodotPhysics backends](https://github.com/godotengine/godot/pull/44901). - - If you experience a regression in either physics or rendering, you can try [these Project Settings](https://github.com/godotengine/godot/pull/44901#issuecomment-758618531) to revert back to the previous Octree-based approach and possibly fix the issue. In either case, be sure to report the problem on GitHub. -- [Ability to restore RandomNumberGenerator state](https://github.com/godotengine/godot/pull/45019). -- [TileMap `show_collision` property to show/hide collision shapes in the editor and at run-time](https://github.com/godotengine/godot/pull/46623). -- [`Array.append_array()` method to append an array at the end of another array](https://github.com/godotengine/godot/pull/43398). -- [`OS.get_thread_caller_id()` method to print the ID of the thread the code is currently running on](https://github.com/godotengine/godot/pull/44732). -- [`Image.load_bmp_from_buffer()` method to load BMP images at run-time](https://github.com/godotengine/godot/pull/42947). -- [`Image.resize_to_po2()` now accepts an optional "interpolation" parameter, defaulting to bilinear filtering](https://github.com/godotengine/godot/pull/44460). - - Nearest-neighbor filtering can be used for pixel art textures, and will be used automatically when resizing non-power-of-two textures for non-filtered textures in GLES2. -- [`OS.set_environment()` method to set environment variables](https://github.com/godotengine/godot/pull/46413). -- [`String.to_wchar()` method to get a PoolByteArray corresponding to a string's `wchar` data](https://github.com/godotengine/godot/pull/46343). -- [`String.naturalnocasecmp_to()` method to perform *natural* case-insensitive string comparison for sorting purposes](https://github.com/godotengine/godot/pull/45957). -- [`application/run/flush_stdout_on_print` project setting to enable per-line flushing of the standard output stream in release builds](https://github.com/godotengine/godot/pull/44393). - -#### Editor - -- [Infinite 3D editor grid](https://github.com/godotengine/godot/pull/43206) ([further improvements](https://github.com/godotengine/godot/pull/45594)). -- [New 3D rotation gizmo](https://github.com/godotengine/godot/pull/43016). -- [Support for copy-pasting nodes](https://github.com/godotengine/godot/pull/34892). -- [Detect external modification of scenes and prompt for reloading](https://github.com/godotengine/godot/pull/31747). -- [New editor to configure default import presets](https://github.com/godotengine/godot/pull/46354). -- [The 3D viewport's View Information pane now displays the viewport resolution](https://github.com/godotengine/godot/pull/45596). -- [`EditorInterface.get_editor_scale()` method to retrieve the editor scale factor](https://github.com/godotengine/godot/pull/47622). - - This can be used for hiDPI support in editor plugins. -- [The `EditorInterface.edit_node()` method is now exposed](https://github.com/godotengine/godot/pull/47709). -- **HTML5:** [New web editor](https://godotengine.org/article/godot-web-progress-report-3), available as a [Progressive Web App](https://github.com/godotengine/godot/pull/46796). - -#### GUI - -- [Minimap support in GraphEdit](https://github.com/godotengine/godot/pull/43416). -- [New AspectRatioContainer Control node](https://github.com/godotengine/godot/pull/45129). -- [TextEdit's bookmark, breakpoint and "mark safe line" functions are now exposed to scripting](https://github.com/godotengine/godot/pull/40629). - -#### Import - -- [Rewritten and greatly improved FBX importer](https://godotengine.org/article/fbx-importer-rewritten-for-godot-3-2-4). -- ["Keep" mode to keep files as-is and export them](https://github.com/godotengine/godot/pull/47268). - -#### Input - -- [Support for buttons and D-pads mapped to half axes](https://github.com/godotengine/godot/pull/42800). -- [Support for new SDL game controller keywords (used by PS5 controller support)](https://github.com/godotengine/godot/pull/45798). -- [Add driving joystick type to Windows joystick handling](https://github.com/godotengine/godot/pull/44082). -- [Mouse event pass-through support for the window](https://github.com/godotengine/godot/pull/40205). - -#### Mono (C#) - -- [Reworked solution build output panel](https://github.com/godotengine/godot/pull/42547). - -#### Physics - -- [Support for pause-aware picking](https://github.com/godotengine/godot/pull/39421). - - This breaks compatibility, but is not enabled by default for existing projects. See the project setting `physics/common/enable_pause_aware_picking`. It will be enabled by default for new projects created with 3.3. -- [CollisionObject can now display collision shape meshes](https://github.com/godotengine/godot/pull/45783). -- **Bullet:** [CollisionPolygon `margin` property](https://github.com/godotengine/godot/pull/45855). -- **GodotPhysics:** [Cylinder collision shape support](https://github.com/godotengine/godot/pull/45854). - - This is experimental in 3.3, and will likely receive fixes in future Godot releases. - -#### Porting - -- **Android:** [Support for exporting as Android App Bundle](https://github.com/godotengine/godot-proposals/issues/342). -- **Android:** [Support for subview embedding](https://github.com/godotengine/godot-proposals/issues/1064). -- **Android:** [Support for notch cutouts on Android 9.0 and later](https://github.com/godotengine/godot/pull/43104). -- **Android:** [Support for mouse events](https://github.com/godotengine/godot/pull/42360). -- **Android:** [Support for keyboard modifiers and arrow keys](https://github.com/godotengine/godot/pull/40398). -- **Android:** [Implement `OS.get_screen_orientation()`](https://github.com/godotengine/godot/pull/43022). -- **HTML5:** [AudioWorklet support for multithreaded HTML5 builds](https://github.com/godotengine/godot/pull/43454). -- **HTML5:** [Optional GDNative support](https://github.com/godotengine/godot/pull/44076). -- **HTML5:** [Resizable canvas option to disable viewport resizing](https://github.com/godotengine/godot/pull/42266). -- **HTML5:** [Optional automatic WebGL 2.0 -> 1.0 fallback when WebGL 2.0 support is not available](https://github.com/godotengine/godot/pull/47659). - - To benefit from this feature, enable the **Rendering > Quality > Driver > Fallback To Gles2** project setting as you would on other platforms. -- **HTML5:** [loDPI fallback support for improved performance on hiDPI displays (at the cost of visuals)](https://github.com/godotengine/godot/pull/46802). - - To keep the previous behavior, **Allow Hidpi** must be enabled in the Project Settings before exporting the project. -- **iOS:** [Plugin support](https://github.com/godotengine/godot/pull/41340), with a similar interface to Android plugins. -- **iOS:** [Add a touch delay project setting](https://github.com/godotengine/godot/pull/42457). -- **iOS:** [Implemented native loading screen](https://github.com/godotengine/godot/pull/45693). -- **Linux:** [PulseAudio and ALSA libraries are now dynamically loaded](https://github.com/godotengine/godot/pull/46107), [as well as libudev](https://github.com/godotengine/godot/pull/46117). - - This allows running official Godot binaries on systems that don't have PulseAudio installed. -- **Linux/macOS:** [Implement the `--no-window` command line argument for parity with Windows](https://github.com/godotengine/godot/pull/42276). -- **macOS:** [macOS ARM64 support](https://github.com/godotengine/godot/pull/39788) in official binaries for Apple M1 chip (only standard build for now). - -#### Rendering - -- [2D batching for GLES3](https://github.com/godotengine/godot/pull/42119) (it was implemented for GLES2 in 3.2.2), and improvements to GLES2's batching. -- [New *experimental* buffer orphan/stream project settings to improve 2D performance on specific platforms](https://github.com/godotengine/godot/pull/47864). -- [New software skinning for MeshInstance](https://github.com/godotengine/godot/pull/40313) to replace the slow GPU skinning on devices that don't support the fast GPU skinning (especially mobile). -- [Configurable amount of lights per object](https://github.com/godotengine/godot/pull/43606), now defaulting to 32 instead of 8. -- [New CPU lightmapper](https://github.com/godotengine/godot/pull/44628). - - Uses a raytracing approach with optional denoising. - - Environment lighting is now supported. - - Lightmaps are now stored in an atlas when baking if GLES3 is the current backend at the time of baking. - - Bicubic lightmap sampling is now used to improve the final appearance, both in GLES3 and GLES2. It's enabled by default on desktop platforms. -- [Anisotropic filtering now works when using the GLES2 backend](https://github.com/godotengine/godot/pull/45654). -- [FXAA property in Viewport and associated project setting for GLES3 and GLES2](https://github.com/godotengine/godot/pull/42006). - - Upsides: Faster than MSAA, smooths out alpha-tested materials and specular aliasing. - - Downsides: Lower quality than MSAA and makes the 3D viewport blurrier. -- [Debanding property in Viewport and associated project setting for GLES3](https://github.com/godotengine/godot/pull/42942). - - Significantly reduces visible banding in 3D. The effect is mainly visible on smooth gradients, solid surfaces and in heavy fog. - - Only effective when HDR is enabled in the Project Settings (which is the default). -- [New `METALLIC` built-in for the `light()` function in the shader language](https://github.com/godotengine/godot/pull/42548). - - This is also exposed in the visual shader editor. -- [Add setting for shadow cubemap max size](https://github.com/godotengine/godot/pull/48059). - -#### XR (Augmented Reality / Virtual Reality) - -- [Add a `set_interface()` method](https://github.com/godotengine/godot/pull/46781). -- [Expose the depth buffer to GDNative](https://github.com/godotengine/godot/pull/46781). -- [Allow supplying a depth buffer from an ARVR plugin](https://github.com/godotengine/godot/pull/46781). -- **HTML5:** [WebXR support](https://github.com/godotengine/godot/pull/42397) for VR games. - -### Changed - -#### Core - -- [Deleted object access now raises an error instead of a warning](https://github.com/godotengine/godot/pull/48041). -- [Improved error messages when passing nonexistent node paths to `get_node()`](https://github.com/godotengine/godot/pull/46243). -- [Optimized transform propagation for hidden 3D nodes](https://github.com/godotengine/godot/pull/45583). -- [Modernized multi-threading APIs](https://github.com/godotengine/godot/pull/45618). - - This might cause regressions in projects that use multiple threads. Please report such issues on GitHub. -- [Suggestions are now printed when attempting to use a nonexistent input action name](https://github.com/godotengine/godot/pull/45902). -- [SVG images can now be used as a project icon](https://github.com/godotengine/godot/pull/43369). -- [Tweaked log file names for consistency between Mono and non-Mono builds](https://github.com/godotengine/godot/pull/44148). -- [Tweaked command line `--print-fps` display to display milliseconds per frame timings in addition to FPS](https://github.com/godotengine/godot/pull/47735). -- [OpenSimplexNoise is now guaranteed to give consistent results across platforms](https://github.com/godotengine/godot/issues/47211). - - This change breaks compatibility: you get different results even for the same seed. - -#### Editor - -- [Improved inspector subresource editing visibility](https://github.com/godotengine/godot/pull/45907). -- [Improved the 3D selection box appearance for better visibility](https://github.com/godotengine/godot/pull/43424). - - The 3D selection box color can be changed in the Editor Settings. -- [Increased default opacity for 3D manipulator gizmos for better visibility](https://github.com/godotengine/godot/pull/44384). -- [Improved visibility for the dashed line in the TextureRegion editor](https://github.com/godotengine/godot/pull/45164). -- [Pressed CheckButtons are now colored in blue for easier recognition](https://github.com/godotengine/godot/pull/44556). -- [The autokeying icon in the animation editor is now red when pressed to emphasize its "recording" status](https://github.com/godotengine/godot/pull/42417). -- [Scroll bars are now thicker and have a subtle background to better hint where they start and stop](https://github.com/godotengine/godot/pull/47633). -- [Undo/redo log messages now give more context when performing actions in the 2D editor](https://github.com/godotengine/godot/pull/42229). -- [The editor now uses 75% scaling by default on small displays (such as 1366×768)](https://github.com/godotengine/godot/pull/43611). - - This can be reverted by setting the editor scale to 100% in the Editor Settings. -- [The editor now uses 150% scaling by default on 4K monitors, regardless of their DPI](https://github.com/godotengine/godot/pull/45910). - - This can be adjusted by setting the editor scale to the desired value in the Editor Settings. -- [Rename Node is now bound to <kbd>F2</kbd>](https://github.com/godotengine/godot/pull/38201). - - To account for this change, switching between editors using keyboard shortcuts now requires holding down <kbd>Ctrl</kbd>. - - Editor shortcuts can be changed back to the previous values in the Editor Settings' Shortcuts tab. -- [Changed the Search Help shortcut from <kbd>Shift + F1</kbd> to <kbd>F1</kbd>](https://github.com/godotengine/godot/pull/43773). -- [Changed the FileSystem dock Copy Path shortcut from <kbd>Ctrl + C</kbd> to <kbd>Ctrl + Shift + C</kbd>](https://github.com/godotengine/godot/pull/43397). -- [Changed 3D editor's Primary Grid Steps setting from 10 to 8](https://github.com/godotengine/godot/pull/43754). - - This uses a power-of-two value by default. -- [Increased the default `profiler_frame_max_functions` to 512](https://github.com/godotengine/godot/pull/43697). - - This fixes many instances where functions didn't appear in the script profiler. -- [The inspector now allows using a comma as a decimal separator](https://github.com/godotengine/godot/pull/42376). -- [Editor plugins are now searched for recursively](https://github.com/godotengine/godot/pull/43734). -- [Increased the page size for array/dictionary editors in the inspector from 10 to 20](https://github.com/godotengine/godot/pull/44864). - - The value can now be increased further in the Editor Settings at the cost of slower node switching times in the inspector. -- [The "Auto" editor setting hints for editor scale and font hinting now display the value they apply](https://github.com/godotengine/godot/pull/45270). -- [Tweaked property hints for SpatialMaterial depth properties to allow greater control and quality](https://github.com/godotengine/godot/pull/44130). -- [Pause Mode and Script are no longer collapsed in categories in the inspector](https://github.com/godotengine/godot/pull/43566). -- **Asset library:** [The Retry button now only appears if the download has failed](https://github.com/godotengine/godot/pull/46105). -- **Asset library:** [Search now starts automatically after entering text](https://github.com/godotengine/godot/pull/42402). -- **Asset library:** [Moved the Asset Library API URLs to the Editor Settings](https://github.com/godotengine/godot/pull/45202). -- **Project manager:** [Drag-and-dropping a ZIP archive to the project manager window will now prompt for importing it](https://github.com/godotengine/godot/pull/45706). -- **Project manager:** [Display loading text while the project is opening](https://github.com/godotengine/godot/pull/46026). -- **Project manager:** [The Open Project Folder button is now more visible](https://github.com/godotengine/godot/pull/45642). - -#### GUI - -- [Range now returns a ratio of 1.0 if the minimum and maximum value are equal](https://github.com/godotengine/godot/pull/45220). -- [ColorPicker now keeps the hue value when the saturation or value is set to zero](https://github.com/godotengine/godot/pull/46230). -- [The Control virtual method `_make_custom_tooltip()` should now return a `Control` instead of an `Object`](https://github.com/godotengine/godot/pull/43280). - - Scripts overriding this method will have to be updated. - -#### Import - -- [Allow a greater range of characters in glTF bone names](https://github.com/godotengine/godot/pull/47074). -- [glTF import now uses vertex colors by default](https://github.com/godotengine/godot/pull/41007). -- [Fix ETC compressor `lossy_quality` handling](https://github.com/godotengine/godot/pull/44682). - - High `lossy_quality` values will now incur significantly longer compression times, but will also improve the resulting texture quality. - -#### Mono (C#) - -- [The `copy_mono_root` SCons build option now defaults to `yes`](https://github.com/godotengine/godot/pull/42332). -- Official builds now use Mono 6.12.0.122. - -#### Networking - -- [Increase the default HTTPClient download chunk size to 64 KiB](https://github.com/godotengine/godot/pull/42896). - - This improves download speeds significantly, including for the in-editor export template downloader. - - This change also affects HTTPRequest. - -#### Rendering - -- [Shadows now have a proper soft appearance in GLES2 when using the PCF13 shadow filter](https://github.com/godotengine/godot/pull/46301). -- [The Ensure Correct Normals render mode and associated SpatialMaterial property are now supported in GLES2](https://github.com/godotengine/godot/pull/47540). -- [Real-time lights no longer affect objects that receive baked lighting if Bake Mode is set to All](https://github.com/godotengine/godot/pull/41629). -- [YSort rendering order is now more deterministic](https://github.com/godotengine/godot/pull/42375). - -#### Physics - -- [2D collision shapes are now displayed with outlines when **Debug > Visible Collision Shapes** is enabled](https://github.com/godotengine/godot/pull/46291). - -#### Porting - -- **Android:** [Update logic to sign prebuilt APKs with `apksigner` instead of `jarsigner`, as required for Android API 30](https://github.com/godotengine/godot/pull/44645). -- **Android:** [Disable the `requestLegacyExternalStorage` attribute when there are no storage permissions](https://github.com/godotengine/godot/pull/47954). -- **HTML5:** [Improved gamepad support by using an internal implementation of the Gamepad API](https://github.com/godotengine/godot/pull/45078). -- **HTML5** [Changed HTML shell templates](https://github.com/godotengine/godot/pull/46201). [See updated documentation](https://docs.godotengine.org/en/3.3/tutorials/platform/customizing_html5_shell.html). -- **Linux:** Binaries are now stripped of string and symbol tables, reducing their size significantly. - - Editor: 9 MB less (standard) and 35 MB less (Mono). - - Templates: 5-6 MB less (standard) and 30 MB less (Mono). -- **macOS:** [Add entitlements configuration and export template `.dylib` signing to the export](https://github.com/godotengine/godot/pull/46618). -- **macOS:** [Code signing on export is now enabled by default. If no identity is specified, an *ad hoc* certificate is generated and used automatically](https://github.com/godotengine/godot/pull/46618). - - This is done because applications must be signed to be run on macOS Big Sur, even for private use. - - Self-signed certificates work for private use, but they will be considered untrusted on other people's computers. -- **macOS:** [Add a Replace Existing Signature export option to fix signing on export with broken OSXCross ad-hoc linker signatures](https://github.com/godotengine/godot/pull/47141). - - This is enabled by default. -- **macOS:** [Improve Mono distribution in .app bundle to allow codesigning exported projects](https://github.com/godotengine/godot/pull/43768). -- **macOS:** Binaries are now stripped of string and symbol tables, which reduces their size significantly: - - Editor: 14 MB less (standard) and 9 MB less (Mono). - - Templates: 9-10 MB less (standard) and 6 MB less (Mono). -- **macOS:** Official editor binaries are now signed and notarized. - -### Removed - -#### Import - -- [Removed the now-redundant ResourceImporterCSV importer](https://github.com/godotengine/godot/pull/47301). - - This is superseded by the new ["keep" import mode](https://github.com/godotengine/godot/pull/47268) feature. - -### Fixed - -#### Audio - -- [Use higher-quality resampling for Ogg Vorbis and MP3 sounds](https://github.com/godotengine/godot/pull/46086). - - This fixes bitrate-like artifacts when playing low-frequency sounds. -- [Fix pops when using `play()` in AudioStreamPlayer2D and AudioStreamPlayer3D](https://github.com/godotengine/godot/pull/46151). - -#### Core - -- [Fix Editable Children issues with node renaming, moving, duplicating and instancing](https://github.com/godotengine/godot/pull/39533). -- [Freed Objects no longer delay to `null` in debug builds](https://github.com/godotengine/godot/pull/41866). -- [Various fixes to Variant and Reference pointers](https://github.com/godotengine/godot/pull/43049). -- [Optimized octree and fixed a leak](https://github.com/godotengine/godot/pull/41123). -- [Fix crash when opening a ZIP data pack](https://github.com/godotengine/godot/pull/42196). -- [`OS.delay_msec()` and `OS.delay_usec()` with a negative value no longer freeze the engine and return an error message instead](https://github.com/godotengine/godot/pull/46194). -- Various fixes to CSG mesh generation. There should be less instances of holes being created in CSG meshes. - -#### Editor - -- [Fix exporting if the temporary export directory doesn't exist yet](https://github.com/godotengine/godot/pull/45561). -- [Objects can no longer be added to the Project Settings since they can't be serialized correctly](https://github.com/godotengine/godot/pull/42616). -- [Fix hidden nodes being selectable in the 2D editor in specific cases](https://github.com/godotengine/godot/pull/46261). -- [Implementing clearing of diagnostics in the GDScript language server, fixing issues with errors lingering after files were deleted](https://github.com/godotengine/godot/pull/47553). -- [The Export PCK/ZIP action now obeys the export path configured in the export preset as expected](https://github.com/godotengine/godot/pull/45359). - -#### GDScript - -- [Fix leaks due to cyclic references](https://github.com/godotengine/godot/pull/41931). - -#### GUI - -- [Fix artifacts in DynamicFont when scaling with filtering enabled](https://github.com/godotengine/godot/pull/43171). -- [DynamicFonts are now loaded to memory on all platforms to avoid locking files](https://github.com/godotengine/godot/pull/44117). -- [Fix fallback emoji font color](https://github.com/godotengine/godot/pull/44212). -- [ColorPicker button text and tooltips now appear as expected in exported projects](https://github.com/godotengine/godot/pull/47547). -- [Fix RichTextLabel losing its `text` due to being replaced with empty BBCode when custom effects are defined](https://github.com/godotengine/godot/pull/47486). -- [Fix incorrect editor background color when using a transparent editor theme color](https://github.com/godotengine/godot/pull/36004). - -#### Import - -- [Relax node](https://github.com/godotengine/godot/pull/45545) and [bone naming constraints in glTF](https://github.com/godotengine/godot/pull/47074). - - To preserve compatibility with models imported in 3.2, [a `use_legacy_names` import setting was added](https://github.com/godotengine/godot/pull/48058). -- [Fix parsing Base64-encoded buffer and image data in glTF](https://github.com/godotengine/godot/pull/42501). -- [Fix handling of normalized accessor property in glTF](https://github.com/godotengine/godot/pull/44746). - -#### Mono (C#) - -- [Fix targeting .NETFramework with .NET 5](https://github.com/godotengine/godot/pull/44135). -- [Fix System.Collections.Generic.List marshaling](https://github.com/godotengine/godot/pull/45029). -- [Fix support for Unicode identifiers](https://github.com/godotengine/godot/pull/45310). -- [Fixes to Mono on WebAssembly](https://github.com/godotengine/godot/pull/44374). - -#### Network - -- [Fix UDP ports being silently reused without an error on Linux in PacketPeerUDP](https://github.com/godotengine/godot/pull/43918). - -#### Physics - -- [Multiple fixes to one-way collisions](https://github.com/godotengine/godot/pull/42574). -- [Fix `test_body_motion` recovery and rest info](https://github.com/godotengine/godot/pull/46148). -- **GodotPhysics:** [Fix incorrect moment of inertia calculations for built-in 3D collision shapes](https://github.com/godotengine/godot/pull/47284). -- [Many physics fixes for both 2D and 3D](https://github.com/godotengine/godot/pulls?q=is%3Apr+milestone%3A3.3+label%3Atopic%3Aphysics+is%3Amerged). - -#### Porting - -- **Android:** [Fix splash screen loading](https://github.com/godotengine/godot/pull/42389). -- **iOS:** [Fix multiple issues with PVRTC import, disable ETC1](https://github.com/godotengine/godot/pull/38076). -- **iOS:** [Fixes to keyboard input, including better IME support](https://github.com/godotengine/godot/pull/43560). -- **Linux:** [Fix keyboard input lag and clipboard delay issues](https://github.com/godotengine/godot/pull/42341). -- **Linux:** [Fix audio corruption when using the ALSA driver](https://github.com/godotengine/godot/pull/43928). -- **Linux:** [Fix PRIME hybrid graphics detection on Steam](https://github.com/godotengine/godot/pull/46792). -- **macOS:** [Fix mouse position in captured mode](https://github.com/godotengine/godot/pull/42328). -- **macOS:** [Improve `get_screen_dpi()` reliability for non-integer scaling factors](https://github.com/godotengine/godot/pull/42478). -- **Windows:** [Fix debugger not getting focused on break](https://github.com/godotengine/godot/pull/40555). - -#### Rendering - -- [Various fixes to 3D light culling](https://github.com/godotengine/godot/pull/46694). - - DirectionalLight's Cull Mask property is now effective. -- [Fix large Sprite3D UV wobbling with low-resolution textures](https://github.com/godotengine/godot/pull/42537). -- [Fix impact of `lifetime_randomness` on properties using a curve](https://github.com/godotengine/godot/pull/45496). -- [Fix 2D normal maps when using batching + NVIDIA workaround](https://github.com/godotengine/godot/pull/41323). -- [Fix PanoramaSky artifacts on Android in GLES2](https://github.com/godotengine/godot/pull/44489). -- [Fix glow on devices with only 8 texture slots in GLES2](https://github.com/godotengine/godot/pull/42446). -- [Use a separate texture unit for `light_texture` in GLES2](https://github.com/godotengine/godot/pull/42538). -- [Fix reflection probes in WebGL 1.0 (GLES2 on HTML5)](https://github.com/godotengine/godot/pull/45465). -- [Fix screen-space reflections tracing the environment in GLES3](https://github.com/godotengine/godot/pull/38954). -- [Fade screen-space reflections towards the inner margin in GLES3](https://github.com/godotengine/godot/pull/41892). -- [Ensure Reinhard tonemapping values are positive in GLES3](https://github.com/godotengine/godot/pull/42056). - - -## [3.2] - 2020-01-29 - -### Added - -- Support for [pseudo-3D depth in 2D](https://godotengine.org/article/godot-32-will-get-pseudo-3d-support-2d-engine). -- Support for importing 3D scenes using Assimp. - - Many formats are supported, including FBX. -- [Support for generating audio procedurally and analyzing audio spectrums.](https://godotengine.org/article/godot-32-will-get-new-audio-features) -- WebRTC support. - - Includes support for the high-level multiplayer API. - - Supports NAT traversal using STUN or TURN. -- Support for automatically building Android templates before exporting. - - This makes 3rd-party SDK integration easier. -- Support for [texture atlases in 2D](https://godotengine.org/article/atlas-support-returns-godot-3-2). -- Major improvements to the visual shader system ([News post 1](https://godotengine.org/article/major-update-for-visual-shader-in-godot-3-2), [News post 2](https://godotengine.org/article/major-update-visual-shaders-godot-3-2-part-2)). - - Redesigned visual shader editor with drag-and-drop capability. - - Textures can be dragged from the FileSystem dock to be added as nodes. - - Most functions available in GLSL are now exposed. - - Many constants such as `Pi` or `Tau` can now be used directly. - - Support for boolean uniforms and sampler inputs. - - New Sampler port type. - - New conditional nodes. - - New Expression node, allowing shader code to be written in visual shaders. - - Support for plugins (custom nodes). - - Custom nodes can be drag-and-dropped from the FileSystem dock. - - Ability to copy and paste nodes. - - Ability to delete multiple nodes at once by pressing <kbd>Delete</kbd>. - - The node creation menu is now displayed when dragging a connection to an empty space on the graph. - - GLES3-only functions are now distinguished from others in the creation dialog. - - Ability to preview the code generated by the visual shader. - - Ability to convert visual shaders to text-based shaders. - - See the [complete list of new functions](https://github.com/godotengine/godot/pull/26164). -- Improved visual scripting. - - Visual scripting now uses a unified graph where all functions are represented. - - Nodes can now be edited directly in the graph. - - Support for fuzzy searching. - - The `tool` mode can now be enabled in visual scripts. - - New Deconstruct node to deconstruct a complex value into a scalar value. - - Miscellaneous UI improvements. -- Support for enabling/disabling parts of the editor or specific nodes. - - This is helpful for education, or when working with artists to help prevent inadvertent changes. -- Language server for GDScript. - - This can be used to get better integration with external editors. -- Version control integration in the editor. - - This integration is VCS-agnostic (GDNative plugins provide specific VCS support). -- Improved GridMap editor. - - The copied mesh is now displayed during pasting. - - The duplication/paste indicator is now rotated correctly around the pivot point. - - Ability to cancel paste and selection by pressing <kbd>Escape</kbd>. - - Erasing is now done using <kbd>RMB</kbd> instead of <kbd>Shift + RMB</kbd>. - - Freelook can still be accessed by pressing <kbd>Shift + F</kbd>. -- Improved MeshLibrary generation. - - When appending to an existing MeshLibrary, previews are now only generated for newly-added or modified meshes. - - Tweaked the previews' camera angle and light directions for better results. - - Materials assigned to the MeshInstance instead of the Mesh are now exported to the MeshLibrary. - - This is useful when exporting meshes from an imported scene (such as glTF), as it allows materials to persist across re-imports. -- [Improved Control anchor and margin workflow.](https://github.com/godotengine/godot/pull/27559) -- [Network profiler.](https://github.com/godotengine/godot/pull/31870) -- Improved NavigationMesh generation. - - GridMaps can now be used to bake navigation meshes. - - EditorNavigationMeshGenerator can now be used in `tool` scripts. - - Support for generating navigation meshes from static colliders. - - When using static colliders as a geometry source, a layer mask can be specified to ignore certain colliders. - - The generator no longer relies on the global transform, making it possible to generate navmeshes on nodes that are not in the scene tree. - - Navigation gizmos are now updated after every new bake. -- Support for skinning in 3D skeletons. -- CameraServer singleton to retrieve images from mobile cameras or webcams as textures. -- A crosshair is now displayed when using freelook in the 3D editor. -- Project camera override button at the top of the 2D and 3D editors. - - When enabled, the editor viewport's camera will be replicated in the running project. -- RichTextLabel can now be extended with real-time effects and custom BBCodes. - - Effects are implemented using the ItemFX resource. -- `[img=<width>x<height>]` tag to resize an image displayed in a RichTextLabel. - - If `<width>` or `<height>` is 0, the image will be adjusted to keep its original aspect. -- Revamped node connection dialog for improved ease of use. -- The Signals dock now displays a signal's description in a tooltip when hovering it. -- Input actions can now be reordered by dragging them. -- Animation frames can now be reordered by dragging them. -- Ruler tool to measure distances and angles in the 2D editor. -- "Clear Guides" menu option in the 2D editor to remove all guides. -- The 2D editor grid now displays a "primary" line every 8 lines for easier measurements. - - This value can be adjusted in the Configure Snap dialog. -- Projects can now have a description set in the Project Settings. - - This description is displayed as a tooltip when hovering the project in the Project Manager. -- All Variant types can now be added as project settings using the editor (instead of just `bool`, `int`, `float` and `String`). -- Pressing <kbd>Ctrl + F</kbd> now focuses the search field in the Project Settings and Editor Settings. -- Quick Open dialog (<kbd>Shift + Alt + O</kbd>) to open any resource in the project. - - Unlike the existing dialogs, it's not limited to scenes or scripts. -- Ability to convert a Sprite to a Mesh2D, Polygon2D, CollisionPolygon2D or LightOccluder2D. -- MultiMeshInstance2D node for using MultiMesh in 2D. -- PointMesh primitive. - - Drawn as a rectangle with a constant size on screen, which is cheaper compared to using triangle-based billboards. -- 2D polygon boolean operations and Delaunay triangulation are now available in the Geometry singleton. -- [New convex decomposition](https://godotengine.org/article/godot-3-2-adds-support-convex-decomposition) using the [V-HACD](https://github.com/kmammou/v-hacd) library. - - Can decompose meshes into multiple convex shapes for increased accuracy. -- Support for grouping nodes in the 3D editor. -- "Slow" modifier in freelook (accessed by holding <kbd>Alt</kbd>). -- The 2D editor panning limits can now be disabled in the Editor Settings. -- "Undo Close Tab" option in the scene tabs context menu. -- The editor is now capped to 20 FPS when the window is unfocused. - - This decreases CPU/GPU usage if something causes the editor to redraw continuously (such as particles). -- The editor's FPS cap can now be adjusted in the Editor Settings (both when focused and unfocused). -- Version information is now displayed at the bottom of the editor. - - This is intended to make the Godot version easily visible in video tutorials. -- Support for constants in the shader language. -- Support for local and varying arrays in the shader language. -- Support for `switch` statements in the shader language. -- Support for `do {...} while (...)` loops in the shader language. - - Unlike `while`, the expression in the `do` block will always be run at least once. -- Support for hexadecimal number literals in the shader language. -- Ported several GLES3 shader functions such as `round()` to GLES2. -- `SHADOW_VEC` shader parameter to alter 2D shadow computations in custom shaders. -- Filter search box in the remote scene tree dock. -- Ability to expand/collapse nodes recursively in the scene tree dock by holding <kbd>Shift</kbd> and clicking on a folding arrow. -- Support for depth of field, glow and BCS in the GLES2 renderer. -- MSAA support in the GLES2 renderer. -- Ability to render viewports directly to the screen in the GLES2 renderer. - - This can be faster on low-end devices, but it comes at a convenience cost. -- Project settings to set the maximum number of lights and reflections in the GLES3 renderer. - - Decreasing these values can lead to faster shader compilations, resulting in lower loading times. -- Heightmap collision shape for efficient terrain collisions. -- AStar2D class, making A* use easier in 2D. -- Disabled collision shapes can now be added directly, without having to disable them manually after one step. -- Context menu options to close other scene tabs, scene tabs to the right, or all scene tabs. -- The audio bus volumes can now be snapped by holding <kbd>Ctrl</kbd> while dragging the slider. -- Hovering an audio bus' volume slider now displays its volume in a tooltip. -- Values in the Gradient and Curve editors can now be snapped by holding <kbd>Ctrl</kbd>. - - Precise snapping can be obtained by holding <kbd>Shift</kbd> as well. -- Support for snapping when scaling nodes in the 2D editor. -- Precise snapping in the 3D editor when holding <kbd>Shift</kbd>. -- "Align Rotation with View" in the 3D editor. - - Unlike "Align Transform with View", only the selected node's rotation will be modified. - - "Align Selection with View" has been renamed to "Align Transform with View". -- All 3D gizmos now make use of snapping if enabled. -- CSG shapes are now highlighted with a translucent overlay when selected. - - Shapes in Union mode will use a blue overlay color by default. - - Shapes in Subtraction mode will use an orange overlay color by default. - - Shapes in Intersection mode will use a white overlay color. -- Ability to move a vertex along a single axis when holding <kbd>Shift</kbd> in polygon editors. -- Support for binary literals in GDScript (e.g. `0b101010` for `42`). -- AutoLoads can now be used as a type in GDScript. -- Ability to define script templates on a per-project basis. - - Template files should be placed into a `script_templates/` directory in the project and have an extension that matches the language (`.gd` for GDScript, `.cs` for C#). - - The path to the script templates directory can be changed in the Project Settings. -- Ability to limit the minimum and maximum window size using `OS.set_min_window_size()` and `OS.set_max_window_size()`. -- `Node.process_priority` property to set or get a node's processing priority. - - This was previously only available as `Node.set_process_priority()` (without an associated getter). -- `Node.editor_description` property for documentation purposes. - - When hovering a node with a description in the scene tree dock, the description will be displayed in a tooltip. -- `Button.keep_pressed_outside` property to keep a button pressed when moving the pointer outside while pressed. -- `Button.expand_icon` property to make a button's icon expand/shrink with the button's size. -- `Popup.set_as_minsize()` method to shrink a popup to its minimum size. -- `Tree.get_icon_modulate()` and `Tree.set_icon_modulate()` methods to change an icon's color in a Tree. -- `Tree.call_recursive()` method to call a method on a TreeItem and its children recursively. -- `Light.use_gi_probe` property to exclude specific lights from GIProbe computations. -- TranslationServer method `get_loaded_locales()` to retrieve the list of languages with a translation loaded. -- `FRUSTUM` 3D camera mode to create tilted frustums for mirror or portal effects. -- `CanvasItem.draw_rect()` now has `width` and `antialiased` properties to match `draw_line()`'s functionality. -- `Engine.get_idle_frames()` and `Engine.get_physics_frames()` to get the number of idle and physics frame iterations since the project started. - - Unlike `Engine.get_frames_drawn()`, `Engine.get_idle_frames()` will be incremented even if the render loop is disabled. -- `Engine.get_physics_interpolation_fraction()` to get the fraction through the current physics tick at the time of the current frame. - - This can be used to implement fixed timestep interpolation. -- Support for shadow-to-opacity in 3D to render shadows in augmented reality contexts. -- Ability to change a Position2D gizmo's size. -- New Vector2 and Vector3 methods: - - `move_toward()` to retrieve a vector moved towards another by a specified number of units. - - `direction_to()` to retrieve a normalized vector pointing from a vector to another. - - This is a shorter alternative to `(b - a).normalized()`. -- AStar functions `set_point_disabled()` and `is_point_disabled()` to selectively disable points. -- Tween now emits a `tween_all_completed` signal when all tweens are completed. -- `Input.get_current_cursor_shape()` to retrieve the current cursor shape. -- `InputEventAction` now has a `strength` property to simulate analog inputs. -- `String.repeat()` method to repeat a string several times and return it. -- `String.count()` method to count the number of occurrences of a substring in a string. -- `String.humanize_size()` method to display a file size as an human-readable string. -- `String.strip_escapes()` to strip non-printable escape characters from a string, including tabulations and newlines (but not spaces). -- `String.sha1_text()` and `String.sha1_buffer()` methods to return a string's SHA-1 hash. -- Line2D `clear_points()` method to clear all points. -- Line2D now has a "Width Curve" property to make its width vary at different points. -- `assert()` now accepts an optional second parameter to display a custom message when the assertion fails. -- `posmod()` built-in GDScript function that behaves like `fposmod()`, but returns an integer value. -- `smoothstep()` built-in GDScript function for smooth easing of values. -- `lerp_angle()` built-in GDScript function to interpolate between two angles. -- `ord()` built-in GDScript function to return the Unicode code point of an 1-character string. -- `PoolByteArray.hex_encode()` method to get a string of hexadecimal numbers. -- `Font.get_wordwrap_string_size()` method to return the rectangle size needed to draw a word-wrapped text. -- `Camera.get_camera_rid()` method to retrieve a Camera's RID. -- `Array.slice()` method to duplicate a subset of an Array and return it. -- The GraphEdit box selection colors can now be changed by tweaking the `selection_fill` and `selection_stroke` theme items. -- Toggleable HSV mode for ColorPicker. -- ColorPicker properties to toggle the visibility and editability of presets. -- The default ColorPicker mode (RGB, HSV, RAW) can now be changed in the Editor Settings. -- ColorPicker now displays an indicator to denote "overbright" colors (which can't be displayed as-is in the preview). -- Hovering a Color property in the editor inspector now displays a tooltip with the exact values. -- `Color.transparent` constant (equivalent to `Color(1, 1, 1, 0)`). -- `KinematicBody.get_floor_normal()` and `KinematicBody2D.get_floor_normal()` to retrieve the collided floor's normal. -- `VehicleWheel.get_rpm()` method to retrieve a vehicle wheel's rotations per minute. -- Per-wheel throttle, brake and steering in VehicleBody. -- `GeometryInstance.set_custom_aabb()` to set a custom bounding box (used for view frustum culling). -- `FuncRef.call_funcv()` to call a FuncRef with an array containing arguments. - - In contrast to `FuncRef.call_func()`, only a single array argument is expected. -- `Mesh.get_aabb()` is now exposed to scripting. -- `PhysicalBone.apply_impulse()` and `PhysicalBone.apply_central_impulse()` methods to push ragdolls around. -- `ProjectSettings.load_resource_pack()` now features an optional `replace_files` argument (defaulting to `true`), which controls whether the loaded resource pack can override existing files in the virtual filesystem. -- `SpinBox.apply()` method to evaluate and apply the expression in the SpinBox's value immediately. -- `ConfigFile.erase_section_key()` method to remove a single key from a ConfigFile. -- `OS.execute()` now returns the process' exit code when blocking mode is enabled. -- `OS.is_window_focused()` method that returns `true` if the window is currently focused. - - Tracking the focus state manually using `NOTIFICATION_WM_FOCUS_IN` and `NOTIFICATION_WM_FOCUS_OUT` is no longer needed to achieve this. -- `OS.low_processor_mode_sleep_usec` is now exposed as a property. - - This makes it possible to change its value at runtime, rather than just defining it once in the Project Settings. -- `SceneTree.quit()` now accepts an optional argument with an exit code. - - If set to a value greater than or equal to 0, it will override the `OS.exit_code` property. -- `VisualServer.get_video_adapter_name()` and `VisualServer.get_video_adapter_vendor()` methods to retrieve the user's graphics card model and vendor. -- `VisualServer.multimesh_create()` is now exposed to scripting. -- Ability to override how scripted objects are converted to strings by defining a `_to_string()` method. -- Export hints for 2D and 3D physics/render layers. -- Editor plugins can now add new tabs to the Project Settings. -- Standalone ternary expression warning in GDScript. -- Variable shadowing warning in GDScript. - - Will be displayed if: - - a block variable shadows a member variable, - - a subclass variable shadows a member variable, - - a function argument shadows a member variable. -- Script reflection methods are now exposed to GDScript. - - See `Script.get_script_property_list()`, `Script.get_script_method_list()`, `Script.get_script_signal_list()`, `Script.get_script_constant_map()` and `Script.get_property_default_value()`. -- `randfn(mean, deviation)` method to generate random numbers following a normal Gaussian distribution. -- Ability to read the standard error stream when using `OS.execute()` (disabled by default). -- Option to disable boot splash filtering (nearest-neighbor interpolation). -- The GridMap editor now offers a search field and size slider. -- DynamicFont resources now have a thumbnail in the editor. -- Minimap in the script editor. -- Bookmarks in the script editor for easier code navigation. -- Filter search box for the script list and member list. -- Singletons and `class_name`-declared classes are now highlighted with a separate color in the script editor. -- The editor help now displays class properties' default and overridden values. -- The script editor's Find in Files dialog can now search in user-defined file types (`editor/search_in_file_extensions` in the Project Settings). -- The script editor search now displays the number of matches. -- The script editor search now selects the current match for easier replacing. -- "Evaluate Expression" contextual option in the script editor. - - This option evaluates the selected expression and replaces it (e.g. `2 + 2` becomes `4`). -- Autocompletion support for `change_scene()`. -- Ability to skip breakpoints while debugging. -- Drag-and-drop support in the TileSet editor. -- Ability to attach scripts to nodes by dragging a name from the script list to a node in the scene tree. -- Icons are now displayed next to code completion items, making their type easier to distinguish. -- TileMap property `centered_textures` can be used to center textures on their tile, instead of using the tile's top-left corner as position for the texture. -- "Ignore" flag to ignore specific tiles when autotiling in the TileMap editor. -- Keyboard shortcuts to rotate tiles in the TileMap editor. - - Default shortcuts are <kbd>A</kbd> (rotate left), <kbd>S</kbd> (rotate right), <kbd>X</kbd> (flip horizontally), <kbd>Y</kbd> (flip vertically). -- Ability to keep a node's local transform when reparenting it by holding <kbd>Shift</kbd>. -- Basis constants `IDENTITY`, `FLIP_X`, `FLIP_Y`, `FLIP_Z`. -- Ability to create sprite frames in AnimatedSprite from a sprite sheet. -- `frame_coords` property in Sprite and Sprite3D to set/get the coordinates of the frame to display from the sprite sheet. -- `billboard` property in Sprite3D. -- Reimplemented support for editing multiple keys at once in the animation editor. -- Support for FPS snapping in the Animation editor. -- Autokeying in the Animation editor. - - Keyframes will be created automatically when translating, rotating or scaling nodes if a track exists already. - - Keys must be inserted manually for the first time. -- AnimationNodeBlendTreeEditor improvements. - - Ability to exclude multiple selected nodes at once. - - Context menu to add new nodes (activated by right-clicking). -- The AnimationPlayer Call Method mode is now configurable. - - Method calls can be "deferred" or "immediate", "deferred" being the default. -- OccluderPolygon2D is now draggable in the editor. -- The tooltip position offset is now configurable. -- The default cursor used when hovering RichTextLabels can now be changed. -- "Dialog Autowrap" property in AcceptDialog to wrap the label's text automatically. -- The 2D editor's panning shortcut can now be changed. -- The shortcuts to quit the editor can now be changed. -- Support for emission masks in CPUParticles2D. -- `direction` property in CPUParticles and ParticlesMaterial. -- `lifetime_randomness` property in CPUParticles and ParticlesMaterial. -- CPUParticles now uses a different gizmo icon to distinguish them from Particles. -- "Restart" button to restart particle emission in the editor. -- AnimatedSprites' animations can now be played backwards. -- TextureRects can now have their texture flipped horizontally or vertically. -- StyleBoxFlat shadows can now have an offset. -- StyleBoxFlat now computes UV coordinates for its `canvas_item` vertices, which can be used in custom shaders. -- Profiler data can now be exported to a CSV file. -- The 2D polygon editor now displays vertex numbers when hovering vertices. -- RectangleShapes now have a third handle to drag both axes at once. -- Global class resources are now displayed in the Resource property inspector. -- Double-clicking an easing property in the inspector will now make the editor display a numeric field. - - This makes it easier to enter precise values for properties such as light attenuation. -- `interface/editor/default_float_step` editor setting to configure floating-point values' default step in the Inspector. -- Audio buses are now stylized to look like boxes that can be dragged. -- The default audio bus layout file path can now be changed in the Project Settings. -- The LineEdit and TextEdit controls now display their contextual menu when pressing the <kbd>Menu</kbd> key. -- `shortcut_keys_enabled` and `selecting_enabled` LineEdit and TextEdit properties to disable keyboard shortcuts and selecting text. -- The LineEdit "disabled" font color can now be changed. -- The TextEdit "readonly" font color can now be changed. -- LineEdit can now have its `right_icon` set in scripts. -- The `nine_patch_stretch` TextureProgress property now enables stretching when using a radial fill mode. -- Support for loading and saving encrypted files in ConfigFile. -- `get_path()` and `get_path_absolute()` are now implemented in FileAccessEncrypted. -- "Disabled" attenuation model for AudioStreamPlayer3D, making the sound not fade with distance while keeping it positional. -- AudioEffectPitchShift's FFT size and oversampling are now adjustable. -- TextEdit's tab drawing and folding is now exposed to GDScript. -- Orphan node monitor in the Performance singleton. - - Counts the number of nodes that were created but aren't instanced in the scene tree. -- Ability to change eye height in VR. -- CSV files can now be imported as non-translation files. -- Scene resources such as materials can now be imported as `.tres` files. -- Support for importing 1-bit, 4-bit and 8-bit BMP files. - - Size dimensions must be a multiple of 8 for 1-bit images and 2 for 4-bit images. -- `use_lld=yes` flag to link with [LLD](https://lld.llvm.org/) on Linux when compiling with Clang. - - This results in faster iteration times when developing Godot itself or modules. -- `use_thinlto=yes` flag to link with [ThinLTO](https://clang.llvm.org/docs/ThinLTO.html) when using Clang. -- Multicast support in PacketPeerUDP. -- `NetworkedMultiplayerEnet.server_relay` property to disable server relaying. - - This can be used to increase security when building a fully-authoritative server. -- Automatic timeout for TCP connections (defaults to 30 seconds, can be changed in the Project Settings). -- `HTTPRequest.timeout` property (defaults to 0, which is disabled). -- `HTTPRequest.download_chunk_size` property. - - This value can be adjusted to reduce the allocation overhead and file writes when downloading large files. - - The default value was increased for faster downloads (4 KB → 64 KB). -- WebSocket improvements. - - Support for SSL in WebSocketServer. - - WebSocketClient can now use custom SSL certificates (except on HTML5). - - WebSocketClient can now define custom headers. -- The editor now features a built-in Web server for testing HTML5 projects. -- Button to remove all missing projects in the Project Manager. -- Reimplemented support for embedding project data in the PCK file. -- Ability to take editor screenshots by pressing <kbd>Ctrl + F12</kbd>. -- Editor plugins can now set the current active editor as well as toggle the distraction-free mode. -- **Android:** [Support for adaptive icons.](https://docs.godotengine.org/en/latest/getting_started/workflow/export/exporting_for_android.html#providing-launcher-icons) - - All icon densities are now generated automatically by the exporter. - - Only 3 images now need to be supplied to support all icon formats and densities (legacy icon, adaptive foreground, adaptive background). -- **Android:** Support for the Oculus Mobile SDK. -- **Android:** Support for requesting permissions at runtime. -- **Android:** `NOTIFICATION_APP_PAUSED` and `NOTIFICATION_APP_RESUMED` notifications are now emitted when the app is paused and resumed. -- **Android:** Support for pen input devices. -- **Android/iOS:** Support for vibrating the device. -- [**HTML5:** Partial clipboard support.](https://github.com/godotengine/godot/pull/29298) -- **iOS:** Support for [ARKit](https://developer.apple.com/augmented-reality/). -- **iOS:** `OS.get_model_name()` now returns a value with the device name. -- **iOS:** The Home indicator is now hidden by default to avoid being in the way of the running project. - - It can be restored in the Project Settings. -- **Windows:** Ability to toggle the console window in the Editor Settings. -- **Windows:** Project setting to enable Vsync using the compositor (DWM), disabled by default. - - On some hardware, this may fix stuttering issues when running a project in windowed mode. -- **Windows:** Support for code signing using `signtool` on Windows and `osslsigncode` on other platforms. -- **Windows:** Support for using Clang and ThinLTO when compiling using MinGW. -- **Windows/macOS:** `OS.set_native_icon()` method to set an `.ico` or `.icns` window/taskbar icon at runtime. -- **Windows/macOS/X11:** Support for graphic tablet pen pressure and tilt in InputEventMouseMotion. -- **macOS:** LineEdit now supports keyboard shortcuts commonly available on macOS. -- **macOS:** Multiple instances of the editor can now be opened at once. -- **macOS:** Recent and favorite projects are now listed in the project manager dock menu. -- **macOS:** The list of open scenes is now displayed in the editor dock menu. -- **macOS:** Support for modifying global and dock menus. -- **macOS:** Improved support for code signing when exporting projects. -- **macOS:** Support for defining camera and microphone usage descriptions when exporting a project. -- **macOS/X11:** [A zsh completion file for the editor is now available.](https://github.com/godotengine/godot/blob/master/misc/dist/shell/_godot.zsh-completion) -- **X11:** The instance PID is now set as the `_NET_WM_PID` window attribute, so that external programs can easily access it. -- **Mono:** Support for exporting to Android and HTML5. -- **Mono:** Support for using Rider as an external editor. -- **Mono:** Support for attaching external profilers like dotTrace using the `MONO_ENV_OPTIONS` environment variable. -- **Mono:** New DynamicGodotObject class to access dynamic properties from scripts written in GDScript. -- **Mono:** Support for resource type hints in exported arrays. -- **Mono:** New `mono/unhandled_exception_policy` project setting to keep running after an unhandled exception. -- [**Mono:** New Godot constants to conditionally react to system variables at compile-time.](https://github.com/godotengine/godot/pull/28786) -- **Mono:** Support for Visual Studio 2019's MSBuild. - -### Changed - -- Tween and Timer now display an error message if they are started without being added to the scene tree first. -- Tweaked Timer's wait time property hint to allow values with 3 decimals and above 4096. -- Functions called from a signal can no longer disconnect the node from the signal they're connected to (unless using `call_deferred()`). -- Tabs and space indentation can no longer be mixed in the same GDScript file. - - Each file must now use only tabs or spaces for indentation (not both). -- `assert()` in GDScript must now always be used with parentheses. - - `assert(true)` is still valid, but `assert true` isn't valid anymore. - - This is to account for the optional second parameter that defines a custom message. -- The "Trim" and "Normalize" WAV import options are now disabled by default. - - This makes the default behavior more consistent with Ogg import. -- Ogg samples now have an icon in the editor, like WAV samples. -- Camera2D drag margins are now disabled by default. - - If porting a project from Godot 3.1 where drag margins were used, these must be enabled manually again. -- The Camera2D Offset property now ignores the Limit property. - - To get the old behavior back, move the camera itself instead of changing the offset. -- `Camera.project_position()` now requires a second `depth` argument to determine the distance of the point from the camera. - - To get the old behavior back, pass the Camera's `near` property value as the second argument. -- `Skeleton.set_bone_global_pose()` was replaced by `Skeleton.set_bone_global_pose_override()`. -- UDP broadcasting is now disabled by default and must be enabled by calling `set_broadcast_enabled(true)` on the PacketPeerUDP instance. -- The editor and project manager now open slightly faster. -- Improved the Project Manager user interface. - - New, simpler design with more space available for the project list. - - Improved reporting of missing projects. - - The search field is now focused when starting the Project Manager if there is at least one project in the list. - - The search field now searches in both the project name and path. - - If the search term contains a `/`, the whole path will be used to match the search them. Otherwise, only the last path component will be searched in. -- Refactored the Project Manager to be more efficient, especially with large project lists. -- Images in the Project Manager and Asset Library are now resized with Lanczos filtering for a smoother appearance. -- The editor now uses the font hinting algorithm that best matches the OS' default. - - Hinting is set to "None" on macOS, and set to "Light" on Windows and Linux. - - This can be changed in the Editor Settings. -- The editor window dimming when a popup appears is now less intense (60% → 50%). - - The animation was also removed as it made the editor feel sluggish at lower FPS. -- Several editor menus have been reorganized for consistency and conciseness. -- Undo/Redo now supports more actions throughout the editor. -- Increased the height of the ItemList editor popup. - - This makes it easier to edit large amounts of items. -- Opening a folder in FileDialog will now scroll back to the top. -- Folder icons in FileDialog can now be displayed with a different color using the `folder_icon_modulate` constant, making them easier to distinguish from files. - - Folder icons in editor file dialogs are now tinted with the accent color. -- Improved colors in the light editor theme for better readability and consistency. -- Improved A* performance significantly by using a binary heap and OAHashMap. -- Tweaked the AABB transform algorithm to be ~1.2 times faster. -- Optimized the variant reference function, making complex scripts slightly faster. -- Disabled high-quality voxel cone tracing by default. - - This makes GIProbe much faster out of the box, at the cost of less realistic reflections. -- Lowered the default maximum directional shadow distance (200 → 100). - - This makes directional shadow rendering consistent between the editor and running project when using the default Camera node settings. -- Tweaked the default depth fog maximum distance to be independent of the Camera's `far` value (0..100). - - This makes fog display consistent between the editor and a running project. -- Tweaked the default height fog values to be more logical (0..100 → 10..0). - - This means height fog will be drawn from top-to-bottom, instead of being drawn from bottom-to-top. -- Significantly improved SSAO performance by using a lower sample count. - - SSAO now uses 3×3 blurring by default, resulting in less visible noise patterns. -- When "Keep 3D Linear" is enabled, colors are no longer clamped to [0, 1] when using Linear tonemapping. - - This allows rendering HDR values in floating-point texture targets for further processing or saving HDR data into files. -- The lightmap baker now calculates lightmap sizes dynamically based on surface area. -- Improved 3D KinematicBody performance and reliability. -- Orbiting in the 3D editor can now be done while holding <kbd>Alt</kbd>, for better compatibility with graphics tablets. -- Keys and actions are now released when the window loses focus. -- Tweens can now have a duration of 0. -- Particles and CPUParticles' Sphere emission shape now uses an uniform density sphere. -- `Viewport.size_override_stretch` is now exposed as a property (rather than just setter/getter methods). -- One-click deploy to Android now requires just one click if only one device is connected. -- The Project Manager will now infer a project name from the project path if the name was left to the default value. -- The WebSockets implementation now uses the smaller [wslay](https://tatsuhiro-t.github.io/wslay/) library instead of libwebsockets. -- Box selections in the editor now use a subtle outline for better visibility. -- Most 2D lines are now antialiased in the editor. -- CheckButtons now use a simpler design in the editor. -- Messages originating from the editor are now faded in the editor log. - - This makes messages printed by the project stand out more. -- Folding arrows in the editor inspector are now displayed at the left for consistency with other foldable elements. -- Hovering or dragging guides in the 2D editor will now turn the cursor into a "resizing" shape. -- The editor update spinner is now hidden by default. - - It can be enabled again in the Editor Settings. -- The "Update Always" option is now editor-wide instead of being project-specific. -- ColorPicker, OptionButton and MenuButton now use toggle mode, making them appear pressed when clicked. -- The ColorPicker preview was moved below the picker area to be closer to the sliders. -- Increased the Light2D height range from -100..100 to -2048..2048. - - Lower and higher values can be entered manually too. -- Decreased the `rotation_degrees` range in various nodes to -360..360 to be easier to adjust using the slider. - - Lower and higher values can still be entered manually, which is useful for animation purposes. -- The default RichTextLabel color is now `#ffffff`, matching the default Label color for better consistency. -- SpinBoxes now calculate the entered value using the Expression class. - - For example, writing `2 + 2` in a SpinBox then pressing Enter will result in `4`. -- Saved resources no longer contain dependency indices and metadata such as node folding, resulting in more VCS-friendly files. -- The script editor's line length guideline is now enabled by default. -- The script editor state (such as breakpoints or the current line) is now preserved across editor sessions. -- The script editor's "Auto Brace Complete" setting is now enabled by default. -- The scripts panel toggle button is now located at the bottom-left of the script editor (instead of the File menu). -- Editor plugins can now be enabled without having an init script defined. -- Custom nodes added by plugins now have a translucent script icon in the scene tree dock. -- `EditorInterface.get_current_path()` to get the full path currently displayed in the FileSystem dock in an editor plugin. -- Copy constructors are now allowed for built-in types in GDScript. - - This allows constructs such as `Vector2(Vector2(12, 34))`, which may be useful to simplify code in some cases. -- `weakref(null)` is now allowed in GDScript. - - This makes checking for a valid reference more concise, as `if my_ref.get_ref()` is now sufficient (no need for `if my_ref and my_ref.get_ref()`). -- The number of signal connections and groups is now displayed in a tooltip when hovering the associated buttons in the scene tree dock. -- The right mouse button can now be used to pan in the 2D editor. - - This is to improve usability when using a touchpad. - - The middle mouse button can still be used to pan in the 2D editor. -- Zooming is now allowed while panning in the 2D editor. -- When the "Scroll To Pan" editor setting is enabled, the 2D editor can now be zoomed in by holding <kbd>Ctrl</kbd> and scrolling the mouse wheel. -- Zoom percentages in the 2D editor are now relative to the editor scale if the editor scale is higher than 100%. -- The 2D editor now displays the current zoom percentage. - - The zoom percentage can be clicked to reset the zoom level to 100%. -- Improved sorting options in the Asset Library. -- Images now load faster in the Asset Library. -- A loading placeholder is now displayed while icons are loading in the Asset Library. -- Images failing to load in the Asset Library display a "broken file" icon. -- Improved the Asset Library page loading transitions. -- Tweaked the Asset Library detail page layout for better readability. -- Audio mixer faders now use a non-linear algorithm to better fit human hearing. -- Tooltips now appear faster when hovering elements in the editor (0.7 seconds → 0.5 seconds). -- Increased the low-processor usage mode's default maximum refresh rate (125 FPS → 144 FPS). - - This makes the editor feel slightly smoother on 144 Hz displays. -- Tree scrolling when dragging now uses a larger drag margin, making drag-and-drop more convenient. -- Holding <kbd>Ctrl</kbd> now toggles snapping in GraphEdit. -- Improved the timeline's appearance in the animation editor. -- Improved snapping in the animation editor. - - Snapping can be toggled temporarily by holding the <kbd>Ctrl</kbd> key. - - Snapping can be made more precise by holding the <kbd>Shift</kbd> key. - - Timeline snapping is now toggled by the Snap setting (like when moving keyframes). -- Keyframes are now easier to select in the animation editor. -- Selected keyframes now appear slightly larger in the animation editor. -- Boolean and color keyframe icons are now aligned to other keyframes in the animation editor. -- The Animation editor's line widths are now resized to match the editor scale. -- BPTC compression is now available for all HDR image formats. -- `Image.save_exr()` to save an image in EXR format, which supports high bit depths. -- Improved path and polygon editors. - - New handle icons for path and polygon points. - - Smooth path point and curve tangents now use different icons to be distinguished from sharp points. - - Tangent lines are now gray in the Path2D and Path editors. - - Path2D lines are now antialiased. -- Increased the TileSet and polygon UV editor's maximum zoom levels (400% → 1600%). -- Decreased the maximum allowed StyleBoxFlat corner detail (128 → 20). - - This prevents slowness and glitches caused by using overly detailed corners. -- 3D collision shapes and RayCasts are now drawn in gray when disabled. -- Improved RayCast2D and one-way collision drawing. - - Disabled RayCast2Ds are now displayed in gray. - - One-way collision arrows are now orange by default, making them easier to distinguish them from RayCast2Ds. - - Tweaked RayCast2D and one-way collision line shapes to look more like arrows. -- Improved rendering in the curve editor. - - The grid is now rendered correctly when using a light theme. - - The main line and edge line colors have been swapped for better visibility. - - Tangent line widths are now resized to match the editor scale. -- Improved rendering in the performance monitor. - - Dark colors are now used on light backgrounds for better visibility. - - Graph lines are now thinner and opaque. - - Graph line widths are now resized to match the editor scale. - - Rounded values now display trailing zeroes to make their precision clearer. -- TileMap support for transform operations on cell textures bigger than the cell size has been reworked to properly support isometric tiles. - - Breaks compatibility with some TileMaps from previous Godot versions. An opt-in `compatibility_mode` property can be used to restore the previous behavior. -- Some TileMap editor options were moved to the toolbar. -- The TileMap editor now displays coordinate information in the 2D viewport's bottom-left corner. - - This fixes the TileMap editor width changing when hovering tiles in a small window. -- Brackets are now only inserted when necessary when autocompleting methods in the script editor. -- Improved dialogs when saving or removing an editor layout. -- Whitespace-only selections no longer cause the script editor to highlight all occurrences. -- Saving a script will now add a newline at the end of file if none was present already. -- Reorganized sections in the editor help to be in a more logical order. -- The editor help now uses horizontal margins if the screen is wide enough. - - This makes sure lines keep a reasonable length for better readability. -- Increased line spacing in the editor help and asset library descriptions. -- The editor help now displays bold text using a bold font (instead of using a monospace font). -- The editor help now displays code using a slightly different color to be easier to distinguish. -- The editor help now displays types after parameter names to follow the GDScript static typing syntax. -- Editor help is now accessed using <kbd>Shift + F1</kbd>, for consistency with other applications. - - Contextural help is now accessed using <kbd>Alt + F1</kbd> to accommodate for this change. -- The script editor's Find in Files dialog is now always available, even when no script is opened. -- Pressing <kbd>Shift + Enter</kbd> in the script editor Find dialog will now go to the previous match. -- Improved the node deletion confirmation message. - - If there is only one node to delete, its name is displayed in the message. - - If there is more than one node to delete, the number of nodes to delete is displayed. -- Improved the "Snap Object to Floor" functionality in the 3D editor. - - An error message is now displayed if no nodes could be snapped. - - Increased the maximum snapping height (10 → 20). - - Increased the maximum snapping tolerance (0.1 → 0.2). -- 2D/3D selections, rotations and selected texts are now highlighted with the editor theme's accent color. -- 3D light gizmos are now tinted using the light's color, making navigation easier while using the unshaded display mode. -- Improved the 3D light and AudioStreamPlayer3D gizmos to better represent their depth in the 3D world. -- Tweaked the 3D manipulator gizmo's colors for better visibility. -- Tweaked the 2D and 3D axis colors for consistency with gizmo colors. -- Increased the default 3D manipulator gizmo opacity (0.2 → 0.4). -- The multiline text editor popup dialog's width is now capped on large displays. - - This prevents lines from becoming very long, which could hamper text readability. -- Non-printable escape characters are now stripped when pasting text into a LineEdit. -- The TextEdit caret color now matches the default font color, making it easier to see. -- Empty exported NodePath properties now return `null` instead of `self`. -- Built-in scripts are no longer allowed to use `class_name` as it wasn't working properly. -- The second parameter of `substr()` is now optional and defaults to `-1`. -- More editor actions can now have shortcuts assigned (such as Revert Scene or Export). -- The project export path may now be written in a relative path. - - Directories will be created recursively if the target directory doesn't exist. -- Items in the FileSystem dock can now be deselected by clicking empty space. -- "Set as Main Scene" context option for scenes in the FileSystem dock. -- The unused class variable GDScript warning is now disabled by default due to false positives. -- Warning-ignore comments now allow whitespace after the `#` character. -- Improved error reporting in the Particles emission point creation dialog. -- The number of warnings and errors that can be received in the remote debugger is now capped per second rather than per frame. - - The default limit is 100 errors and 100 warnings per second, making it possible for the script editor to report up to 100 warnings before having messages hidden. -- UTF-8 characters are now supported in input action names. -- All platforms now use the `custom_template` property in each export preset to store the path to the custom export template (instead of `custom_package` for some platforms). -- Tween methods' `trans_type` and `ease_type` arguments are now optional, defaulting to `TRANS_LINEAR` and `EASE_IN_OUT` respectively. -- `PCKPacker.pck_start()` and `PCKPacker.flush()`'s `alignment` and `verbose` arguments (respectively) are now optional, defaulting to `0` and `false`. -- Exported PCK files now contain the Godot patch version in their header. - - This can be used by external tools to detect the Godot version more accurately. -- Exporting a project PCK or ZIP from the command line must now be done with the new `--export-pack` command-line argument. - - This was done to remove the ambiguity when exporting a project to macOS from the command line. -- Updated FreeType to 2.10, which changes how font metrics are calculated. - - This may affect the appearance of some Controls, see [this issue](https://github.com/godotengine/godot/issues/28335) for details. -- The SCons build system now automatically detects the host platform. - - `platform=<platform>` is no longer required when compiling for the host platform. - - `platform=list` can be used to list the supported target platforms. -- **Windows:** Drive letters in file paths are now capitalized. -- **macOS:** <kbd>Control + H</kbd> and <kbd>Control + D</kbd> in TextEdit now delete the character at the left and right of the cursor (respectively). -- **macOS:** <kbd>Command + Left</kbd> in TextEdit now moves the cursor to the first non-whitespace character. -- **macOS:** Non-resizable windows are now allowed to enter fullscreen mode. -- **macOS:** The editor's title bar now uses dark mode on Mojave. -- **X11:** `OS.set_window_postion()` now takes window decorations into account. - -### Removed - -- Unused Panel `panelf` and `panelnc` styles. -- thekla_atlas dependency, as light baking now relies on [xatlas](https://github.com/jpcy/xatlas) for UV unwrapping. -- Rating icons in the Asset Library, as this feature isn't implemented in the backend. -- Some editor languages are no longer available due to missing support for RTL and text shaping in Godot: - - Affected languages are Arabic, Bengali, Persian, Hebrew, Hindi, Malayalam, Sinhalese, Tamil, Telugu and Urdu. - - These languages will be re-added once Godot supports RTL and text shaping. -- **Android:** ARMv6 support. -- **iOS:** ARMv7 support. - - ARMv7 export templates can still be compiled from source to support the iPhone 5 and older. - -### Fixed - -- The Project Manager now remembers the sorting option that was previously set. -- The editor and project manager now have a minimum window size defined. - - This prevents controls from overlapping each other by resizing the window to a very small size. -- Fixed radiance map generation, resulting in improved 3D performance and visual quality. -- Fixed issues with PBR environment mapping. - - Materials should now look closer to what they look like in Substance Designer/Painter. -- Depth of field now affects transparent objects. -- Radiance is now generated when using a clear color sky. -- Contact shadows no longer display when shadow casting is disabled. -- Larger data types can now be constructed by swizzling in the shader language. - - For instance, `vec2 test2 = vec2(0.0, 1.0); vec3 test3 = test2.xxx;` now works as in GLSL. -- The `AMBIENT_LIGHT_DISABLED` and `SHADOWS_DISABLED` flags now work when using the GLES2 renderer. -- The Keep background mode now works when using the GLES2 renderer. -- Several fixes to the GLES2 renderer: - - Fixed transparency order. - - Fixed vertex lighting being too bright. - - Fixed occasional light flickering. - - Fixed shadows cast from transparent materials. - - Fog is no longer computed on unshaded materials. - - This matches the GLES3 renderer's behavior. - - GLES2 shader uniforms now use `highp` precision by default. - - This prevents linking issues on some Android devices. - - Negative OmniLights and SpotLights now work as expected. - - The 3D editor's View Information pane now displays statistics correctly when using the GLES2 renderer. -- Textures compressed with ETC now support transparency by falling back to RGBA4444 or LA8. -- Alternate display modes are now marked as disabled in the editor when using the GLES2 renderer, as these are only supported when using GLES3. -- Fixed several inconsistencies between Particles and CPUParticles. -- Fixed particles scale randomization. -- Particles are now set to emit correctly when restarting. -- CheckBox and CheckButton now use the `check_vadjust` custom constant to adjust the icon Y position as intended. -- Fixed various issues with tab-related icons. -- Fixed issues in WebM colorspace corrections, resulting in better color output. -- CSG is now taken into account when generating navigation meshes. -- Curve2D and Curve3D interpolated values now behave as expected. -- Numeric slider grabbers in the editor inspector now update when scrolling using the mouse wheel. -- Scene modifications are no longer lost when renaming a file in the FileSystem dock. -- "Show in FileSystem" now clears the current search, so that the selected item can be seen immediately. -- LineEdit and TextEdit's context menus no longer display editing options if they are read-only. -- SpinBox mouse events are now correctly triggered by its LineEdit part. -- Per-word navigation in LineEdit and TextEdit now handles UTF-8 characters correctly. -- LineEdit placeholders, Tabs' names and WindowDialog titles now react correctly to translation changes. -- Fixed UI navigation when using gamepad analog sticks. -- Buttons' state is now reset when they exit the scene tree. - - This prevents them from lingering in a "hovered" or "pressed" state. -- Tooltips now disappear when hiding the node they belong to. -- Encoded packet flags are no longer sent in the ENet multiplayer protocol, as ENet itself already sends that data. - - This saves 4 bytes per packet. -- Audio trimming is now less aggressive, cutting at -50 dB instead of -30 dB. -- Audio trimming now has a small fade-out period, preventing audible pops. -- Audio mix rate and output latency settings are now consistently applied on all platforms. -- Fixed multichannel panning for AudioStreamPlayer3D. -- Opening a recent built-in script will now load the associated scene automtaically since doing so is required to edit the script. -- Declaring a class with `class_name` that has the same name as a singleton will now display a clearer error message. -- `script` is no longer allowed as a member variable name in GDScript, as that conflicts with the internal `script` property used by Object. -- Assigning a variable with a function index will no longer evaluate the function twice. - - For instance, doing `a[function()] += 1` will no longer evaluate `function()` twice. - - If the function has side effects, this may change the resulting program behavior. -- GDScript type checks are now enabled in release export templates. -- The Label font shadow now draws the font outline as well (if the base font has one). -- `Font.draw_char()` now draws the font outline as well (if the base font has one). -- The editor no longer redraws continuously when selecting a Control in a Container. -- Added some missing feature tags to the Project Settings "Override For..." menu. -- The `low_processor_mode_sleep_usec` project setting no longer affects the editor. -- Typed arrays and dictionaries no longer have their values shared across instances. -- `self` and object types can now be indexed as a dictionary again (like in Godot 3.0 and prior). -- Fixed `to_lower()` conversion with Cyrillic characters. -- The Find in Files replace dialog now allows empty replacement texts. -- The bottom panel no longer disappears when opening the theme editor on small displays. -- The script editor's color picker now changes only one color if multiple colors are present on the same line. -- The script editor's line length guideline is now drawn behind text. -- The script editor's line length guideline is now drawn at the correct position when font hinting is disabled. -- The script editor now automatically indents a line if the previous one ends with `[` or `(`. - - This makes it possible to wrap arrays or function declarations/calls without pressing <kbd>Tab</kbd> every line. -- Fixed autocompletion in the script editor. - - The script editor can now autocomplete enum values. - - The script editor can now autocomplete node paths starting with `$"` or `$'`. -- Custom script editor templates can now use type hints. -- Shift operators with a number not between 0 and 63 (inclusive) will now result in a compile-time error in GDScript. -- Warnings no longer count towards the "Too many errors!" message. -- AnimationTrackEdit now displays invalid value keys again (as it did in 3.0). -- Fixed the display of function/audio/animation tracks in the blend tree animation filter. -- The editor shortcuts menu no longer displays all unassigned shortcuts when searching for a substring of "None". -- The editor's performance monitor now displays memory/file sizes larger than 2 GB correctly. -- The editor debugger now displays keyboard shortcuts when hovering the "Step Into", "Step Over", "Break" and "Continue" buttons. -- The editor debugger now always handles connections. - - Subsequent connections will be dropped immediately to avoid locking. -- Large rotation offset/snap values no longer appear to be cut off in the Configure Snap dialog. -- Documentation tooltips in the editor now wrap to multiple lines correctly. -- Locked 3D nodes are no longer selectable in the 3D viewport, matching the 2D editor's behavior. -- All 3D gizmos now notify changes correctly, which means the inspector now displays up-to-date properties after using them. -- The 3D manipulator gizmo's size is now capped at low viewport heights, preventing it from outgrowing the viewport's bounds. -- The editor filesystem now refreshes on file changes if the project is located on an exFAT filesystem. -- Fixed many cases of colors not changing correctly when switching the editor from a dark theme to a light theme (or vice versa) without restarting. -- The Show in File Manager context menu option now works with files marked as favorite. -- The random number generator's seed is now properly set up. -- Antialiased and rounded StyleBoxFlat corners now handle different border widths correctly. -- The StyleBox preview now accounts for shadows and content margins. - - This fixes the preview going out of bounds in the inspector. -- Text resources no longer contain an extraneous line break at the end of file. -- Transform's `FLIP_Y` and `FLIP_Z` constants now work as expected. -- Fixed importing BMP images. -- The positional command-line argument is now only considered to be a scene path if it ends with `.scn`, `.tscn` or `.escn`. - - This makes it possible to parse command-line arguments in a standard fashion (`--foo bar` now works, not just `--foo=bar`). - - This also makes it possible to use file associations or drag-and-drop and have the positional argument parsed by the project. -- The `--audio-driver` and `--video-driver` command-line arguments are now validated; an error message will be printed if an invalid value is passed. -- The `--check-only` command-line argument now returns a non-zero exit code if an invalid script is passed using `--script`. -- Exporting a project via the command-line now returns a non-zero exit code if an error occurred during exporting. -- Console output is no longer colored when standard output isn't a TTY. - - This prevents Godot from writing ANSI escape codes when redirecting standard output or standard error to a file. -- **Android:** Gamepads are now correctly detected when the application starts. -- **Android:** Fix some keyboards being detected as gamepads and not working as a result. -- **Android:** The editor now detects if the device is connected using wireless `adb` and will debug using Wi-Fi in this case. -- **HTML5:** Fixed the pointer position on hiDPI displays. -- **HTML5:** `OS.get_system_time_msec()` now returns the correct value like on other platforms. -- **iOS:** On iOS 11 or later, gestures near screen edges are now handled by Godot instead of the OS. -- **Windows:** Line endings are now converted to CRLF when setting clipboard content. -- **Windows:** Getting the path to the Downloads directory using `OS.get_system_dir()` now works correctly. - - This fixes line endings being invisible when pasting into other applications. -- **macOS:** `OS.get_real_window_size()` and `OS.set_window_size()` are now handled correctly on hiDPI displays. -- **X11:** `OS.get_window_position()` now returns absolute coordinates. -- **X11:** Fixed audio playing on the wrong speakers when using PulseAudio on 5.1 setups. -- **X11:** `OS.set_window_maximized()` now gives up after 0.5 seconds. - - This makes the editor no longer freeze on startup when using fvwm. - - -## [3.1] - 2019-03-13 - -### Added - -- OpenGL ES 2.0 renderer. -- [Visual shader editor.](https://godotengine.org/article/visual-shader-editor-back) - - New PBR output nodes. - - Conversion between Vector3 and scalar types is now automatic. - - Ability to create custom nodes via scripting. - - Ports can now be previewed. -- [3D soft body physics.](https://godotengine.org/article/soft-body) -- [3D ragdoll system.](https://godotengine.org/article/godot-ragdoll-system) -- [Constructive solid geometry in 3D.](https://godotengine.org/article/godot-gets-csg-support) -- [2D meshes and skeletal deformation.](https://godotengine.org/article/godot-gets-2d-skeletal-deform) -- [Various improvements to KinematicBody2D.](https://godotengine.org/article/godot-31-will-get-many-improvements-kinematicbody) - - Support for snapping the body to the floor. - - Support for RayCast shapes in kinematic bodies. - - Support for synchronizing kinematic movement to physics, avoiding an one-frame delay. -- WebSockets support using [libwebsockets](https://libwebsockets.org/). -- UPnP support using [MiniUPnP](http://miniupnp.free.fr). -- [Revamped inspector.](https://godotengine.org/article/godot-gets-new-inspector) - - Improved visualization and editing of numeric properties. - - Vector and matrix types can now be edited directly (no pop-ups). - - Subresources can now be edited directly within the same inspector. - - Layer names can now be displayed in the inspector. - - Proper editing of arrays and dictionaries. - - Ability to reset any property to its default value. -- [Improved animation editor.](https://godotengine.org/article/godot-gets-brand-new-animation-editor-cinematic-support) - - Simpler, less cluttered layout. - - New Bezier, Audio and Animation tracks. - - Several key types can be previewed directly in the track editor. - - Tracks can now be grouped and filtered on a per-node basis. - - Copying and pasting tracks between animations is now possible. - - New Capture mode to blend from a node's current value to the first key in a track. -- [Improved animation tree and new state machine.](https://godotengine.org/article/godot-gets-new-animation-tree-state-machine) - - More visual feedback in the blend tree editor. - - 1D and 2D blend spaces are now supported. - - Ability to write custom blending logic. - - Support for root motion. -- [New FileSystem dock.](https://godotengine.org/article/godot-gets-new-filesystem-dock-3-1) - - Unified view of folders and files in the same panel. - - Files can now be marked as favorites, not only folders. - - Files now have icons representing their type, or thumbnail previews when relevant. - - New search field to filter entries in the tree. -- [OpenSimplexNoise and NoiseTexture resources.](https://godotengine.org/article/simplex-noise-lands-godot-31) -- [Optional static typing in GDScript.](https://godotengine.org/article/optional-typing-gdscript) - - Does not currently improve performance, but helps write more robust code. -- Warning system in GDScript. - - Reports potential code issues such as: - - unused variables, - - standalone expressions, - - discarded return values from functions, - - unreachable code after a `return` statement, - - … - - Warnings can be disabled in the Project Settings or by writing special comments. -- [GDScript keyword `class_name` to register scripts as classes.](https://docs.godotengine.org/en/latest/getting_started/step_by_step/scripting_continued.html#register-scripts-as-classes) -- Simple expression language independent from GDScript, used by inspector boxes that accept numeric values. - - Can also be used in projects. -- C# projects can now be exported for Windows, Linux, and macOS targets. -- The `server` platform is back as it was in Godot 2.1. - - It is now again possible to run a headless Godot instance on Linux. -- Support for BPTC texture compression on desktop platforms. -- New properties for SpatialMaterial. - - Dithering-based distance fade, for fading materials without making them transparent. - - Disable ambient light on a per-material basis. -- Option to link Mono statically on Windows. -- Unified class and reference search in the editor. -- Revamped TileSet editor with support for undo/redo operations. -- Various quality-of-life improvements to the Polygon2D and TextureRegion editors. -- RandomNumberGenerator class that allows for multiple instances at once. -- Array methods `min()` and `max()` to return the smallest and largest value respectively. -- Dictionary method `get(key[, default])` where `default` is returned if the key does not exist. -- Node method `print_tree_pretty()` to print a graphical view of the scene tree. -- String methods `trim_prefix()`, `trim_suffix()`, `lstrip()`, `rstrip()`. -- OS methods: - - `get_system_time_msecs()`: Return the system time with milliseconds. - - `get_audio_driver_name()` and `get_audio_driver_count()` to query audio driver information. - - `get_video_driver_count()` and `get_video_driver_name()` to query renderer information. - - `center_window()`: Center the window on the screen. - - `move_window_to_foreground()`: Move the window to the foreground. -- StreamPeerTCP method `set_no_delay()` to enable the `TCP_NODELAY` option. -- EditorPlugin method `remove_control_from_container()`. -- Ability to set Godot windows as "always on top". -- Ability to create windows with per-pixel transparency. -- New GLSL built-in functions in the shader language: - - `radians()` - - `degrees()` - - `asinh()` - - `acosh()` - - `atanh()` - - `exp2()` - - `log2()` - - `roundEven()` -- New command-line options: - - `--build-solutions`: Build C# solutions without starting the editor. - - `--print-fps`: Display frames per second to standard output. - - `--quit`: Quit the engine after the first main loop iteration. -- Debugger button to copy error messages. -- Support for `.escn` scenes has been added for use with the new Blender exporter. -- It is now possible to scale an OBJ mesh when importing. -- `popup_closed` signal for `ColorPickerButton`. -- Methods that are deprecated can now print warnings. -- Input actions can now provide an analog value. -- Input actions can now be mapped to either a specific device or all devices. -- DNS resolution for high-level networking. -- Servers can now kick/disconnect peers in high-level networking. -- Servers can now access IP and port information of peers in high-level networking. -- High-level multiplayer API decoupled from SceneTree (see `SceneTree.multiplayer_api`/`SceneTree.custom_multiplayer_api`), can now be extended. -- `Input.set_default_cursor_shape()` to change the default shape in the viewport. -- Custom cursors can now be as large as 256×256 (needed to be exactly 32×32 before). -- Support for radio-looking items with icon in `PopupMenu`s. -- Drag and drop to rearrange Editor docks. -- TileSet's `TileMode` is now exposed to GDScript. -- `OS.get_ticks_usec()` is now exposed to GDScript. -- Normals can now be flipped when generated via `SurfaceTool`. -- TextureProgress bars can now be bilinear (extending in both directions). -- The character used for masking secrets in LineEdit can now be changed. -- Improved DynamicFont: - - DynamicFonts can now use high-quality outlines generated by FreeType. - - DynamicFonts can now have their anti-aliasing disabled. - - DynamicFonts can now have their hinting tweaked ("Normal", "Light" or "None"). - - Colored glyphs such as emoji are now supported. -- Universal translation of touch input to mouse input. -- AudioStreamPlayer, AudioStreamPlayer2D, and AudioStreamPlayer3D now have a pitch scale property. -- Support for MIDI input. -- Support for audio capture from microphones. -- `GROW_DIRECTION_BOTH` for Controls. -- Selected tiles can be moved in the tile map editor. -- The editor can now be configured to display the project window on the previous or next monitor (relative to the editor). - - If either end is reached, then the project will start on the last or first monitor (respectively). -- Signal in VideoPlayer to notify when the video finished playing. -- `Image.bumpmap_to_normalmap()` to convert bump maps to normal maps. -- `File.get_path()` and `File.get_path_absolute()`. -- Unselected tabs in the editor now have a subtle background for easier identification. -- The depth fog's end distance is now configurable independently of the far plane distance. -- The alpha component of the fog color can now be used to control fog density. -- The 3D editor's information panel now displays the camera's coordinates. -- New options to hide the origin and viewport in the 2D editor. -- Improved 3D editor grid: - - The grid size and number of subdivisions can now be configured. - - Its primary and secondary colors can now also be changed. -- <kbd>Ctrl</kbd> now toggles snapping in the 3D viewport. -- Find & replace in files (<kbd>Ctrl + Shift + F</kbd> by default). -- Batch node renaming tool (<kbd>Ctrl + F2</kbd> by default). -- More editor scaling options to support HiDPI displays. -- Type icons can now be enabled in the editor again. -- Buttons in the editor to open common directories in the OS file manager: - - project data directory, - - user data directory, - - user settings directory. -- Projects can now be sorted by name or modification date in the project manager. -- Projects can now be imported from ZIP archives in the project manager. -- Improved autocompletion. - - Keywords are now present in autocompletion results. -- `editor` and `standalone` feature tags to check whether the project is running from an editor or non-editor binary. -- `android_add_asset_dir("...")` method to Android module Gradle build configuration. -- **iOS:** Support for exporting to the iPhone X. -- **iOS:** Re-added support for in-app purchases. - -### Changed - -- [Built-in vector types now use copy-on-write mode as originally intended](https://godotengine.org/article/why-we-broke-your-pr), resulting in increased engine performance. -- The [mbedtls](https://tls.mbed.org/) library is now used instead of OpenSSL. -- [Renamed several core files](https://github.com/godotengine/godot/pull/25821). - - Third-party modules may have to be updated to reflect this. -- SSL certificates are now bundled in exported projects unless a custom bundle is specified. -- Improved buffer writing performance on Windows and Linux. -- Removed many debugging prints in the console. -- Export templates now display an error dialog if no project was found when starting. -- DynamicFont oversampling is now enabled by default. -- Nodes' internal logic now consistently uses internal physics processing. -- Allow attaching and clearing scripts on multiple nodes at once. -- Default values are no longer saved in scene and resource files. -- The selection rectangle of 2D nodes is now hidden when not pertinent (no more rectangle for collision shapes). -- SSE2 is now enabled in libsquish, resulting in improved S3TC encoding performance. -- Tangent and binormal coordinates are now more consistent across mesh types (primitive/imported), resulting in more predictable normal map and depth map appearance. -- Better defaults for 3D scenes. - - The default procedural sky now has a more neutral blue tone. - - The default SpatialMaterial now has a roughness value of 1 and metallic value of 0. - - The fallback material now uses the same values as the default SpatialMaterial. -- Text editor themes are now sorted alphabetically in the selection dropdown. -- The 3D manipulator gizmo now has a smoother, more detailed appearance. -- The 3D viewport menu button now has a background to make it easier to read. -- QuadMeshes are now built using two triangles (6 vertices) instead of one quad (4 vertices). - - This was done because quads are deprecated in OpenGL. -- Controls inside containers are no longer movable or resizable but can still be selected. -- The `is` GDScript keyword can now be used to compare a value against built-in types. -- Exported variables with type hints are now always initialized. - - For example, `export(int) var a` will be initialized to `0`. -- Named enums in GDScript no longer create script constants. - - This means `enum Name { VALUE }` must now be accessed with `Name.VALUE` instead of `VALUE`. -- Cyclic references to other scripts with `preload()` are no longer allowed. - - `load()` should be used in at least one of the scripts instead. -- `switch`, `case` and `do` are no longer reserved identifiers in GDScript. -- Shadowing variables from parent scopes is no longer allowed in GDScript. -- Function parameters' default values can no longer depend on other parameters in GDScript. -- Indentation guides are now displayed in a more subtle way in the script editor. - - Indentation guides are now displayed when indenting using spaces. -- Multi-line strings are now highlighted as strings rather than as comments in the script editor. - - This is because GDScript does not officially support multiline comments. -- Increased the script editor's line spacing (4 pixels → 6 pixels). -- Increased the caret width in the script editor (1 pixel → 2 pixels). -- The project manager window is now resized to match the editor scale. -- The asset library now makes use of threading, making loading more responsive. -- Line spacing in the script editor, underlines and caret widths are now resized to match the editor scale. -- Replaced editor icons for checkboxes and radio buttons with simpler designs. -- Tweaked the editor's success, error, and warning text colors for better readability and consistency. -- **Android:** Custom permissions are now stored in an array and their amount is no longer limited to 20. - - Custom permissions will have to be redefined in projects imported from older versions. -- **Android:** Provide error details when an in-app purchase fails. -- **Linux:** `OS.alert()` now uses Zenity or KDialog if available instead of xmessage. -- **Mono:** Display stack traces for inner exceptions. -- **Mono:** Bundle `mscorlib.dll` with Godot to improve portability. - -### Removed - -- Removed the RtAudio backend on Windows in favor of WASAPI, which is the default since 3.0. -- **macOS:** Support for 32-bit and fat binaries. - -### Fixed - -- [`move_and_slide()` now behaves differently at low velocities](https://github.com/godotengine/godot/issues/21683), which makes it function as originally intended. -- AnimatedSprite2D's `animation_finished` signal is now triggered at the end of the animation, instead of as soon as the last frame displays. -- Audio buses can now be removed in the editor while they are used by AudioStreamPlayer2D/3D nodes. -- Do not show the project manager unless no project was found at all. -- The animation editor time offset indicator no longer "walks" when resizing the editor. -- Allow creation of a built-in GDScript file even if the filename suggested already exists. -- Show tooltips in the editor when physics object picking is disabled. -- Button shortcuts can now be triggered by gamepad buttons. -- Fix a serialization bug that could cause TSCN files to grow very large. -- Gizmos are now properly hidden on scene load if the object they control is hidden. -- Camera gizmos in the 3D viewport no longer look twice as wide as they actually are. -- Copy/pasting from the editor on X11 will now work more reliably. -- `libgcc_s` and `libstdc++` are now linked statically for better Linux binary portability. -- The FPS cap set by `force_fps` in the Project Settings is no longer applied to the editor. - - Low FPS caps no longer cause the editor to feel sluggish. -- hiDPI is now detected and used if needed in the project manager. -- The Visual Studio Code external editor option now recognizes more binary names such as `code-oss`, making detection more reliable. -- The `-ffast-math` flag is no longer used when compiling Godot, resulting in increased floating-point determinism. -- Fix spelling of `apply_torque_impulse()` and deprecate the misspelled method. -- Escape sequences like `\n` and `\t` are now recognized in CSV translation files. -- Remove spurious errors when using a PanoramaSky without textures. -- The lightmap baker will now use all available cores on Windows. -- Bullet physics now correctly calculates effective gravity on KinematicBodies. -- Setting the color `v` member now correctly sets the `s` member. -- RichTextLabels now correctly determine the baseline for all fonts. -- SpinBoxes now correctly calculate their initial size. -- OGG streams now correctly signal the end of playback. -- Android exporter no longer writes unnecessary permissions to the exported APK. -- Debugger "focus stealing" now works more reliably. -- Subresources are now always saved when saving a scene. -- Many fixes related to importers (glTF, Collada, audio), physics (Bullet), Mono/C#, GDNative, Android/iOS. -- **Mono:** Many fixes and improvements to C# support (including a `[Signal]` attribute). -- **WebAssembly:** Supply proper CORS headers. - -### Security - -- Fixed a security issue relating to deserializing Variants. - - -## [3.0] - 2018-01-29 - -### Added - -- Physically-based renderer using OpenGL ES 3.0. - - Uses the Disney PBR model, with clearcoat, sheen and anisotropy parameters available. - - Uses a forward renderer, supporting multi-sample anti-aliasing (MSAA). - - Parallax occlusion mapping. - - Reflection probes. - - Screen-space reflections. - - Real-time global illumination using voxel cone tracing (GIProbe). - - Proximity fade and distance fade (useful for creating soft particles and various effects). - - [Lightmapper](https://godotengine.org/article/introducing-new-last-minute-lightmapper) for lower-end desktop and mobile platforms, as an alternative to GIProbe. -- New SpatialMaterial resource, replacing FixedMaterial. - - Multiple passes can now be specified (with an optional "grow" property), allowing for effects such as cel shading. -- Brand new 3D post-processing system. - - Depth of field (near and far). - - Fog, supporting light transmittance, sun-oriented fog, depth fog and height fog. - - Tonemapping and Auto-exposure. - - Screen-space ambient occlusion. - - Multi-stage glow and bloom, supporting optional bicubic upscaling for better quality. - - Color grading and various adjustments. -- Rewritten audio engine from scratch. - - Supports audio routing with arbitrary number of channels, including Area-based audio redirection ([video](https://youtu.be/K2XOBaJ5OQ0)). - - More than a dozen of audio effects included. -- Rewritten 3D physics using [Bullet](https://bulletphysics.org/). -- UDP-based high-level networking API using [ENet](http://enet.bespin.org/). -- IPv6 support for all of the engine's networking APIs. -- Visual scripting. -- Rewritten import system. - - Assets are now referenced with their source files, then imported in a transparent manner by the engine. - - Imported assets are now cached in a `.import` directory, making distribution and versioning easier. - - Support for ETC2 compression. - - Support for uncompressed Targa (.tga) textures, allowing for faster importing. -- Rewritten export system. - - GPU-based texture compression can now be tweaked per-target. - - Support for exporting resource packs to build DLC / content addons. -- Improved GDScript. - - Pattern matching using the `match` keyword. - - `$` shorthand for `get_node()`. - - Setters and getters for node properties. - - Underscores in number literals are now allowed for improved readability (for example,`1_000_000`). - - Improved performance (+20% to +40%, based on various benchmarks). -- [Feature tags](https://docs.godotengine.org/en/latest/getting_started/workflow/export/feature_tags.html) in the Project Settings, for custom per-platform settings. -- Full support for the [glTF 2.0](https://www.khronos.org/gltf/) 3D interchange format. -- Freelook and fly navigation to the 3D editor. -- Built-in editor logging (logging standard output to a file), disabled by default. -- Improved, more intuitive file chooser in the editor. -- Smoothed out 3D editor zooming, panning and movement. -- Toggleable rendering information box in the 3D editor viewport. - - FPS display can also be enabled in the editor viewport. -- Ability to render the 3D editor viewport at half resolution to achieve better performance. -- GDNative for binding languages like C++ to Godot as dynamic libraries. - - Community bindings for [D](https://github.com/GodotNativeTools/godot-d), [Nim](https://github.com/pragmagic/godot-nim) and [Python](https://github.com/touilleMan/godot-python) are available. -- Editor settings and export templates are now versioned, making it easier to use several Godot versions on the same system. -- Optional soft shadows for 2D rendering. -- HDR sky support. -- Ability to toggle V-Sync while the project is running. -- Panorama sky support (sphere maps). -- Support for WebM videos (VP8/VP9 with Vorbis/Opus). -- Exporting to HTML5 using WebAssembly. -- C# support using Mono. - - The Mono module is disabled by default, and needs to be compiled in at build-time. - - The latest Mono version (5.4) can be used, fully supporting C# 7.0. -- Support for rasterizing SVG to images on-the-fly, using the nanosvg library. - - Editor icons are now in SVG format, making them better-looking at non-integer scales. - - Due to the library used, only simpler SVGs are well-supported, more complex SVGs may not render correctly. -- Support for oversampling DynamicFonts, keeping them sharp when scaled to high resolutions. -- Improved StyleBoxFlat. - - Border widths can now be set per-corner. - - Support for anti-aliased rounded and beveled corners. - - Support for soft drop shadows. -- VeryLoDPI (75%) and MiDPI (150%) scaling modes for the editor. -- Improved internationalization support for projects. - - Language changes are now effective without reloading the current scene. -- Implemented missing features in the HTML5 platform. - - Cursor style changes. - - Cursor capturing and hiding. -- Improved styling and presentation of HTML5 exports. - - A spinner is now displayed during loading. -- Rewritten the 2D and 3D particle systems. - - Particles are now GPU-based, allowing their use in much higher quantities than before. - - Meshes can now be used as particles. - - Particles can now be emitted from a mesh's shape. - - Properties can now be modified over time using an editable curve. - - Custom particle shaders can now be used. -- New editor theme, with customizable base color, highlight color and contrast. - - A light editor theme option is now available, with icons suited to light backgrounds. - - Alternative dark gray and Arc colors are available out of the box. -- New adaptive text editor theme, adjusting automatically based on the editor colors. -- Support for macOS trackpad gestures in the editor. -- Exporting to macOS now creates a `.dmg` disk image if exporting from an editor running on macOS. - - Signing the macOS export now is possible if running macOS (requires a valid code signing certificate). -- Exporting to Windows now changes the exported project's icon using `rcedit` (requires WINE if exporting from Linux or macOS). -- Improved build system. - - Support for compiling using Visual Studio 2017. - - [SCons](https://scons.org/) 3.0 and Python 3 are now supported (SCons 2.5 and Python 2.7 still work). - - Link-time optimization can now be enabled by passing `use_lto=yes` to the SCons command line. - - Produces faster and sometimes smaller binaries. - - Currently only supported with GCC and MSVC. - - Added a progress percentage when compiling Godot. - - `.zip` archives are automatically created when compiling HTML5 export templates. -- Easier and more powerful way to create editor plugins with EditorPlugin and related APIs. - -### Changed - -- Increased the default low-processor-usage mode FPS limit (60 → 125). - - This makes the editor smoother and more responsive. -- Increased the default 3D editor camera's field of view (55 → 70). -- Increased the default 3D Camera node's field of view (65 → 70). -- Changed the default editor font (Droid Sans → [Noto Sans](https://www.google.com/get/noto/)). -- Changed the default script editor font (Source Code Pro → [Hack](https://sourcefoundry.org/hack/)) -- Renamed `engine.cfg` to `project.godot`. - - This allows users to open a project by double-clicking the file if Godot is associated to `.godot` files. -- Some methods from the `OS` singleton were moved to the new `Engine` singleton. -- Switched from [GLEW](http://glew.sourceforge.net/) to [GLAD](https://glad.dav1d.de/) for OpenGL wrapping. -- Changed the SCons build flag for simple logs (`colored=yes` → `verbose=no`). -- The HTML5 platform now uses WebGL 2.0 (instead of 1.0). -- Redesigned the Godot logo to be more legible at small sizes. - -### Deprecated - -- `opacity` and `self_opacity` are replaced by `modulate` and `self_modulate` in all 2D nodes, allowing for full color changes in addition to opacity changes. - -### Removed - -- Skybox support. - - Replaced with panorama skies, which are easier to import. -- Opus audio codec support. - - This is due to the way the new audio engine is designed. -- HTML5 export using asm.js. - - Only WebAssembly is supported now, since all browsers supporting WebGL 2.0 also support WebAssembly. - - -[4.1]: https://github.com/godotengine/godot/compare/4.0-stable...4.1-stable -[4.0]: https://github.com/godotengine/godot/compare/3.2-stable...4.0-stable -[3.5]: https://github.com/godotengine/godot/compare/3.4-stable...3.5-stable -[3.4]: https://github.com/godotengine/godot/compare/3.3-stable...3.4-stable -[3.3]: https://github.com/godotengine/godot/compare/3.2-stable...3.3-stable -[3.2]: https://github.com/godotengine/godot/compare/3.1-stable...3.2-stable -[3.1]: https://github.com/godotengine/godot/compare/3.0-stable...3.1-stable -[3.0]: https://github.com/godotengine/godot/compare/2.1-stable...3.0-stable +- Expose OpenXR raw hand tracking data ([GH-78032](https://github.com/godotengine/godot/pull/78032)). +- Fix issue with accessing hand tracking without timing info ([GH-78817](https://github.com/godotengine/godot/pull/78817)). +- Change to new PICO interaction profiles ([GH-79570](https://github.com/godotengine/godot/pull/79570)). +- Compile OpenXR into MacOS build ([GH-79614](https://github.com/godotengine/godot/pull/79614)). +- Optimized the XRTracker by reusing XRPose objects to minimize garbage collection overhead in C# ([GH-80198](https://github.com/godotengine/godot/pull/80198)). +- Fix casts of XR handles in OpenXRExtensionWrapperExtension ([GH-80656](https://github.com/godotengine/godot/pull/80656)). +- Remove error print from `XRServer.find_interface` ([GH-80730](https://github.com/godotengine/godot/pull/80730)). +- Ensure OpenXR classes are declared properly ([GH-81037](https://github.com/godotengine/godot/pull/81037)). +- Add XR tracking state-change signals ([GH-81239](https://github.com/godotengine/godot/pull/81239)). +- OpenXR: Fix missing add profile for Huawei ([GH-81534](https://github.com/godotengine/godot/pull/81534)). +- OpenXR: Fix error spam if session hasn't started yet ([GH-81536](https://github.com/godotengine/godot/pull/81536)). +- Fix issue with OpenXR environment blend mode not being applied properly ([GH-81561](https://github.com/godotengine/godot/pull/81561)). +- Add support for the OpenXR Eye gaze interaction extension ([GH-82614](https://github.com/godotengine/godot/pull/82614)). +- OpenXR - add access to hand joint validity flags ([GH-82715](https://github.com/godotengine/godot/pull/82715)). +- OpenXR: Fix small hand tracking issues ([GH-82722](https://github.com/godotengine/godot/pull/82722)). +- Skip 2D rendering if stereo enabled and fix couple of MSAA issues ([GH-83649](https://github.com/godotengine/godot/pull/83649)). +- Revert to `proxy_to_pthread=no` as default ([GH-83837](https://github.com/godotengine/godot/pull/83837)). +- Fix OpenXR sample count ([GH-84099](https://github.com/godotengine/godot/pull/84099)). + +## Past releases + +- [4.1](https://github.com/godotengine/godot/blob/4.1-stable/CHANGELOG.md) +- [4.0](https://github.com/godotengine/godot/blob/4.0-stable/CHANGELOG.md) +- [3.5](https://github.com/godotengine/godot/blob/3.5-stable/CHANGELOG.md) +- [3.4](https://github.com/godotengine/godot/blob/3.4-stable/CHANGELOG.md) +- [3.3](https://github.com/godotengine/godot/blob/3.3-stable/CHANGELOG.md) +- [3.2](https://github.com/godotengine/godot/blob/3.2-stable/CHANGELOG.md) +- [3.1](https://github.com/godotengine/godot/blob/3.1-stable/CHANGELOG.md) +- [3.0](https://github.com/godotengine/godot/blob/f2e19a26f556c42b7202072296dc072aaac2007c/CHANGELOG.md) diff --git a/COPYRIGHT.txt b/COPYRIGHT.txt index fe046863fc..4b8a246df0 100644 --- a/COPYRIGHT.txt +++ b/COPYRIGHT.txt @@ -194,6 +194,16 @@ Copyright: 2018, Eric Lasota 2018, Microsoft Corp. License: Expat +Files: ./thirdparty/d3d12ma/ +Comment: D3D12 Memory Allocator +Copyright: 2019-2022 Advanced Micro Devices, Inc. +License: Expat + +Files: ./thirdparty/directx_headers/ +Comment: DirectX Headers +Copyright: Microsoft Corporation +License: Expat + Files: ./thirdparty/doctest/ Comment: doctest Copyright: 2016-2023, Viktor Kirilov @@ -325,9 +335,14 @@ License: Apache-2.0 Files: ./thirdparty/meshoptimizer/ Comment: meshoptimizer -Copyright: 2016-2022, Arseny Kapoulkine +Copyright: 2016-2023, Arseny Kapoulkine License: Expat +Files: ./thirdparty/mingw-std-threads/ +Comment: mingw-std-threads +Copyright: 2016, Mega Limited +License: BSD-2-clause + Files: ./thirdparty/minimp3/ Comment: MiniMP3 Copyright: lieff @@ -19,6 +19,7 @@ generous deed immortalized in the next stable release of Godot Engine. Heroic Labs <https://heroiclabs.com> Ramatak <https://ramatak.com> + V-Sekai <https://github.com/V-Sekai> W4 Games <https://w4games.com> ## Gold sponsors @@ -40,8 +41,9 @@ generous deed immortalized in the next stable release of Godot Engine. ## Diamond members + Sealow Sylv <https://rankith.itch.io/unnamed-space-idle-prototype> - And 4 anonymous donors + And 5 anonymous donors ## Titanium members @@ -63,7 +65,7 @@ generous deed immortalized in the next stable release of Godot Engine. Sunshower <https://github.com/Phanterm> TrampolineTales <https://trampolinetales.com/> Wilfred James <https://twitter.com/0430agi> - And 7 anonymous donors + And 8 anonymous donors ## Platinum members @@ -74,6 +76,7 @@ generous deed immortalized in the next stable release of Godot Engine. Christoph Woinke Christopher Shifflett Darrin Massena + Druvsaft Edward Flick F*ckedByUnity Golden Skull Art @@ -82,6 +85,7 @@ generous deed immortalized in the next stable release of Godot Engine. Justin McGettigan Justo Delgado Baudí Marek Belski + Matthew Ekenstedt Mike King Nassor Paulino da Silva Neal Gompa (Conan Kudo) @@ -99,11 +103,12 @@ generous deed immortalized in the next stable release of Godot Engine. Vladimír Chvátil iCommitGames nate-wilkins - And 16 anonymous donors + And 18 anonymous donors ## Gold members @reilaos + Antti Vesanen Artur Ilkaev Asher Glick Ashtreighlia @@ -116,8 +121,10 @@ generous deed immortalized in the next stable release of Godot Engine. Bernd Barsuhn Blake Farnsworth Brian Ernst + Brian Levinsen Brut Chen-Pang He (jdh8) + ClarkThyLord Cosmin Munteanu Coy Humphrey Daniel James @@ -130,6 +137,7 @@ generous deed immortalized in the next stable release of Godot Engine. Ed Morley ElektroFox Enclusa Games + Ends Eric Phy Faisal Al-Kubaisi (QatariGameDev) FeralBytes @@ -137,8 +145,12 @@ generous deed immortalized in the next stable release of Godot Engine. GlassBrick Grau Guangzhou Lingchan + HTML5onMobilePLZ Hammster + Hendrik Mans + Here's my 20 cents Iggy Zuk + Illyan Jacob (HACKhalo2 Studios) Jam James Green @@ -162,6 +174,7 @@ generous deed immortalized in the next stable release of Godot Engine. MHDante Malcolm Nixon Manuel Requena + Mark Schramm Martin Agnar Dahl Martin Šenkeřík Matheus Gritz @@ -190,6 +203,7 @@ generous deed immortalized in the next stable release of Godot Engine. ThePolyglotProgrammer Tim Nedvyga Tom Langwaldt + Trevor Slocum Vincent Foulon Weasel Games WuotanStudios.com @@ -197,10 +211,13 @@ generous deed immortalized in the next stable release of Godot Engine. albinaask endaye getIntoGameDev + hiulit + korinVR nezticle ohanaya3 re:thinc tukon + zikes 杨烈胜(zedrun) Alexander Erlemann @@ -589,7 +606,7 @@ generous deed immortalized in the next stable release of Godot Engine. ケルベロス 貴宏 小松 - And 194 anonymous donors + And 241 anonymous donors ## Silver and bronze donors diff --git a/SConstruct b/SConstruct index 534d5bd95d..da2f89fbeb 100644 --- a/SConstruct +++ b/SConstruct @@ -182,6 +182,7 @@ opts.Add(BoolVariable("debug_symbols", "Build with debugging symbols", False)) opts.Add(BoolVariable("separate_debug_symbols", "Extract debugging symbols to a separate file", False)) opts.Add(EnumVariable("lto", "Link-time optimization (production builds)", "none", ("none", "auto", "thin", "full"))) opts.Add(BoolVariable("production", "Set defaults to build Godot for use in production", False)) +opts.Add(BoolVariable("generate_apk", "Generate an APK/AAB after building Android library by calling Gradle", False)) # Components opts.Add(BoolVariable("deprecated", "Enable compatibility code for deprecated and removed features", True)) @@ -191,6 +192,7 @@ opts.Add(BoolVariable("brotli", "Enable Brotli for decompresson and WOFF2 fonts opts.Add(BoolVariable("xaudio2", "Enable the XAudio2 audio driver", False)) opts.Add(BoolVariable("vulkan", "Enable the vulkan rendering driver", True)) opts.Add(BoolVariable("opengl3", "Enable the OpenGL/GLES3 rendering driver", True)) +opts.Add(BoolVariable("d3d12", "Enable the Direct3D 12 rendering driver (Windows only)", False)) opts.Add(BoolVariable("openxr", "Enable the OpenXR driver", True)) opts.Add(BoolVariable("use_volk", "Use the volk library to load the Vulkan loader dynamically", True)) opts.Add(BoolVariable("disable_exceptions", "Force disabling exception handling code", True)) @@ -210,6 +212,7 @@ opts.Add("extra_suffix", "Custom extra suffix added to the base filename of all opts.Add("object_prefix", "Custom prefix added to the base filename of all generated object files", "") opts.Add(BoolVariable("vsproj", "Generate a Visual Studio solution", False)) opts.Add("vsproj_name", "Name of the Visual Studio solution", "godot") +opts.Add("import_env_vars", "A comma-separated list of environment variables to copy from the outer environment.", "") opts.Add(BoolVariable("disable_3d", "Disable 3D nodes for a smaller executable", False)) opts.Add(BoolVariable("disable_advanced_gui", "Disable advanced GUI nodes and behaviors", False)) opts.Add("build_profile", "Path to a file containing a feature build profile", "") @@ -268,6 +271,12 @@ opts.Add("LINKFLAGS", "Custom flags for the linker") # in following code (especially platform and custom_modules). opts.Update(env_base) +# Copy custom environment variables if set. +if env_base["import_env_vars"]: + for env_var in str(env_base["import_env_vars"]).split(","): + if env_var in os.environ: + env_base["ENV"][env_var] = os.environ[env_var] + # Platform selection: validate input, and add options. selected_platform = "" diff --git a/core/config/project_settings.cpp b/core/config/project_settings.cpp index 93934f2320..bf1595b41b 100644 --- a/core/config/project_settings.cpp +++ b/core/config/project_settings.cpp @@ -95,7 +95,7 @@ const PackedStringArray ProjectSettings::_get_supported_features() { features.append(VERSION_FULL_CONFIG); features.append(VERSION_FULL_BUILD); -#ifdef VULKAN_ENABLED +#if defined(VULKAN_ENABLED) || defined(D3D12_ENABLED) features.append("Forward Plus"); features.append("Mobile"); #endif @@ -1399,6 +1399,12 @@ ProjectSettings::ProjectSettings() { GLOBAL_DEF("rendering/rendering_device/staging_buffer/texture_upload_region_size_px", 64); GLOBAL_DEF("rendering/rendering_device/pipeline_cache/save_chunk_size_mb", 3.0); GLOBAL_DEF("rendering/rendering_device/vulkan/max_descriptors_per_pool", 64); + GLOBAL_DEF_RST("rendering/rendering_device/d3d12/max_resource_descriptors_per_frame", 16384); + custom_prop_info["rendering/rendering_device/d3d12/max_resource_descriptors_per_frame"] = PropertyInfo(Variant::INT, "rendering/rendering_device/d3d12/max_resource_descriptors_per_frame", PROPERTY_HINT_RANGE, "512,262144"); + GLOBAL_DEF_RST("rendering/rendering_device/d3d12/max_sampler_descriptors_per_frame", 1024); + custom_prop_info["rendering/rendering_device/d3d12/max_sampler_descriptors_per_frame"] = PropertyInfo(Variant::INT, "rendering/rendering_device/d3d12/max_sampler_descriptors_per_frame", PROPERTY_HINT_RANGE, "256,2048"); + GLOBAL_DEF_RST("rendering/rendering_device/d3d12/max_misc_descriptors_per_frame", 512); + custom_prop_info["rendering/rendering_device/d3d12/max_misc_descriptors_per_frame"] = PropertyInfo(Variant::INT, "rendering/rendering_device/d3d12/max_misc_descriptors_per_frame", PROPERTY_HINT_RANGE, "32,4096"); GLOBAL_DEF_BASIC(PropertyInfo(Variant::INT, "rendering/textures/canvas_textures/default_texture_filter", PROPERTY_HINT_ENUM, "Nearest,Linear,Linear Mipmap,Nearest Mipmap"), 1); GLOBAL_DEF_BASIC(PropertyInfo(Variant::INT, "rendering/textures/canvas_textures/default_texture_repeat", PROPERTY_HINT_ENUM, "Disable,Enable,Mirror"), 0); diff --git a/core/core_bind.cpp b/core/core_bind.cpp index 981d9b0025..d91c659d1e 100644 --- a/core/core_bind.cpp +++ b/core/core_bind.cpp @@ -662,6 +662,7 @@ void OS::_bind_methods() { BIND_ENUM_CONSTANT(RENDERING_DRIVER_VULKAN); BIND_ENUM_CONSTANT(RENDERING_DRIVER_OPENGL3); + BIND_ENUM_CONSTANT(RENDERING_DRIVER_D3D12); BIND_ENUM_CONSTANT(SYSTEM_DIR_DESKTOP); BIND_ENUM_CONSTANT(SYSTEM_DIR_DCIM); diff --git a/core/core_bind.h b/core/core_bind.h index 5f51b64eb7..715e26cf23 100644 --- a/core/core_bind.h +++ b/core/core_bind.h @@ -129,6 +129,7 @@ public: enum RenderingDriver { RENDERING_DRIVER_VULKAN, RENDERING_DRIVER_OPENGL3, + RENDERING_DRIVER_D3D12, }; virtual PackedStringArray get_connected_midi_inputs(); diff --git a/core/extension/extension_api_dump.cpp b/core/extension/extension_api_dump.cpp index f3e988633c..543dabfb16 100644 --- a/core/extension/extension_api_dump.cpp +++ b/core/extension/extension_api_dump.cpp @@ -742,14 +742,19 @@ Dictionary GDExtensionAPIDump::generate_extension_api(bool p_include_docs) { Dictionary d2; String operator_name = Variant::get_operator_name(Variant::Operator(k)); d2["name"] = operator_name; - if (k != Variant::OP_NEGATE && k != Variant::OP_POSITIVE && k != Variant::OP_NOT && k != Variant::OP_BIT_NEGATE) { - d2["right_type"] = get_builtin_or_variant_type_name(Variant::Type(j)); + + String right_type_name = get_builtin_or_variant_type_name(Variant::Type(j)); + bool is_unary = k == Variant::OP_NEGATE || k == Variant::OP_POSITIVE || k == Variant::OP_NOT || k == Variant::OP_BIT_NEGATE; + if (!is_unary) { + d2["right_type"] = right_type_name; } + d2["return_type"] = get_builtin_or_variant_type_name(Variant::get_operator_return_type(Variant::Operator(k), type, Variant::Type(j))); if (p_include_docs && builtin_doc != nullptr) { for (const DocData::MethodDoc &operator_doc : builtin_doc->operators) { - if (operator_doc.name == "operator " + operator_name) { + if (operator_doc.name == "operator " + operator_name && + (is_unary || operator_doc.arguments[0].type == right_type_name)) { d2["description"] = fix_doc_description(operator_doc.description); break; } diff --git a/core/extension/gdextension_compat_hashes.cpp b/core/extension/gdextension_compat_hashes.cpp index 2dac4a3a5d..dd4cd20d09 100644 --- a/core/extension/gdextension_compat_hashes.cpp +++ b/core/extension/gdextension_compat_hashes.cpp @@ -32,6 +32,7 @@ #ifndef DISABLE_DEPRECATED +#include "core/object/class_db.h" #include "core/variant/variant.h" HashMap<StringName, LocalVector<GDExtensionCompatHashes::Mapping>> GDExtensionCompatHashes::mappings; @@ -52,7 +53,7 @@ bool GDExtensionCompatHashes::lookup_current_hash(const StringName &p_class, con return false; } -bool GDExtensionCompatHashes::get_legacy_hashes(const StringName &p_class, const StringName &p_method, Array &r_hashes) { +bool GDExtensionCompatHashes::get_legacy_hashes(const StringName &p_class, const StringName &p_method, Array &r_hashes, bool p_check_valid) { LocalVector<Mapping> *methods = mappings.getptr(p_class); if (!methods) { return false; @@ -61,6 +62,13 @@ bool GDExtensionCompatHashes::get_legacy_hashes(const StringName &p_class, const bool found = false; for (const Mapping &mapping : *methods) { if (mapping.method == p_method) { + if (p_check_valid) { + MethodBind *mb = ClassDB::get_method_with_compatibility(p_class, p_method, mapping.current_hash); + if (!mb) { + WARN_PRINT(vformat("Compatibility hash %d mapped to non-existent hash %d. Please update gdextension_compat_hashes.cpp.", mapping.legacy_hash, mapping.current_hash)); + continue; + } + } r_hashes.push_back(mapping.legacy_hash); found = true; } diff --git a/core/extension/gdextension_compat_hashes.h b/core/extension/gdextension_compat_hashes.h index 29393dcb2d..813859d9e6 100644 --- a/core/extension/gdextension_compat_hashes.h +++ b/core/extension/gdextension_compat_hashes.h @@ -50,7 +50,7 @@ public: static void initialize(); static void finalize(); static bool lookup_current_hash(const StringName &p_class, const StringName &p_method, uint32_t p_legacy_hash, uint32_t *r_current_hash); - static bool get_legacy_hashes(const StringName &p_class, const StringName &p_method, Array &r_hashes); + static bool get_legacy_hashes(const StringName &p_class, const StringName &p_method, Array &r_hashes, bool p_check_valid = true); }; #endif // DISABLE_DEPRECATED diff --git a/core/input/input.cpp b/core/input/input.cpp index 257452b3d8..8f976cbaa3 100644 --- a/core/input/input.cpp +++ b/core/input/input.cpp @@ -143,9 +143,15 @@ void Input::_bind_methods() { ClassDB::bind_method(D_METHOD("set_use_accumulated_input", "enable"), &Input::set_use_accumulated_input); ClassDB::bind_method(D_METHOD("is_using_accumulated_input"), &Input::is_using_accumulated_input); ClassDB::bind_method(D_METHOD("flush_buffered_events"), &Input::flush_buffered_events); + ClassDB::bind_method(D_METHOD("set_emulate_mouse_from_touch", "enable"), &Input::set_emulate_mouse_from_touch); + ClassDB::bind_method(D_METHOD("is_emulating_mouse_from_touch"), &Input::is_emulating_mouse_from_touch); + ClassDB::bind_method(D_METHOD("set_emulate_touch_from_mouse", "enable"), &Input::set_emulate_touch_from_mouse); + ClassDB::bind_method(D_METHOD("is_emulating_touch_from_mouse"), &Input::is_emulating_touch_from_mouse); ADD_PROPERTY(PropertyInfo(Variant::INT, "mouse_mode"), "set_mouse_mode", "get_mouse_mode"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_accumulated_input"), "set_use_accumulated_input", "is_using_accumulated_input"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "emulate_mouse_from_touch"), "set_emulate_mouse_from_touch", "is_emulating_mouse_from_touch"); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "emulate_touch_from_mouse"), "set_emulate_touch_from_mouse", "is_emulating_touch_from_mouse"); BIND_ENUM_CONSTANT(MOUSE_MODE_VISIBLE); BIND_ENUM_CONSTANT(MOUSE_MODE_HIDDEN); @@ -241,8 +247,8 @@ bool Input::is_anything_pressed() const { return true; } - for (const KeyValue<StringName, Input::Action> &E : action_state) { - if (E.value.pressed) { + for (const KeyValue<StringName, Input::ActionState> &E : action_states) { + if (E.value.cache.pressed) { return true; } } @@ -285,12 +291,17 @@ bool Input::is_joy_button_pressed(int p_device, JoyButton p_button) const { bool Input::is_action_pressed(const StringName &p_action, bool p_exact) const { ERR_FAIL_COND_V_MSG(!InputMap::get_singleton()->has_action(p_action), false, InputMap::get_singleton()->suggest_actions(p_action)); - return action_state.has(p_action) && action_state[p_action].pressed > 0 && (p_exact ? action_state[p_action].exact : true); + HashMap<StringName, ActionState>::ConstIterator E = action_states.find(p_action); + if (!E) { + return false; + } + + return E->value.cache.pressed && (p_exact ? E->value.exact : true); } bool Input::is_action_just_pressed(const StringName &p_action, bool p_exact) const { ERR_FAIL_COND_V_MSG(!InputMap::get_singleton()->has_action(p_action), false, InputMap::get_singleton()->suggest_actions(p_action)); - HashMap<StringName, Action>::ConstIterator E = action_state.find(p_action); + HashMap<StringName, ActionState>::ConstIterator E = action_states.find(p_action); if (!E) { return false; } @@ -300,7 +311,7 @@ bool Input::is_action_just_pressed(const StringName &p_action, bool p_exact) con } // Backward compatibility for legacy behavior, only return true if currently pressed. - bool pressed_requirement = legacy_just_pressed_behavior ? E->value.pressed : true; + bool pressed_requirement = legacy_just_pressed_behavior ? E->value.cache.pressed : true; if (Engine::get_singleton()->is_in_physics_frame()) { return pressed_requirement && E->value.pressed_physics_frame == Engine::get_singleton()->get_physics_frames(); @@ -311,7 +322,7 @@ bool Input::is_action_just_pressed(const StringName &p_action, bool p_exact) con bool Input::is_action_just_released(const StringName &p_action, bool p_exact) const { ERR_FAIL_COND_V_MSG(!InputMap::get_singleton()->has_action(p_action), false, InputMap::get_singleton()->suggest_actions(p_action)); - HashMap<StringName, Action>::ConstIterator E = action_state.find(p_action); + HashMap<StringName, ActionState>::ConstIterator E = action_states.find(p_action); if (!E) { return false; } @@ -321,7 +332,7 @@ bool Input::is_action_just_released(const StringName &p_action, bool p_exact) co } // Backward compatibility for legacy behavior, only return true if currently released. - bool released_requirement = legacy_just_pressed_behavior ? !E->value.pressed : true; + bool released_requirement = legacy_just_pressed_behavior ? !E->value.cache.pressed : true; if (Engine::get_singleton()->is_in_physics_frame()) { return released_requirement && E->value.released_physics_frame == Engine::get_singleton()->get_physics_frames(); @@ -332,7 +343,7 @@ bool Input::is_action_just_released(const StringName &p_action, bool p_exact) co float Input::get_action_strength(const StringName &p_action, bool p_exact) const { ERR_FAIL_COND_V_MSG(!InputMap::get_singleton()->has_action(p_action), 0.0, InputMap::get_singleton()->suggest_actions(p_action)); - HashMap<StringName, Action>::ConstIterator E = action_state.find(p_action); + HashMap<StringName, ActionState>::ConstIterator E = action_states.find(p_action); if (!E) { return 0.0f; } @@ -341,12 +352,12 @@ float Input::get_action_strength(const StringName &p_action, bool p_exact) const return 0.0f; } - return E->value.strength; + return E->value.cache.strength; } float Input::get_action_raw_strength(const StringName &p_action, bool p_exact) const { ERR_FAIL_COND_V_MSG(!InputMap::get_singleton()->has_action(p_action), 0.0, InputMap::get_singleton()->suggest_actions(p_action)); - HashMap<StringName, Action>::ConstIterator E = action_state.find(p_action); + HashMap<StringName, ActionState>::ConstIterator E = action_states.find(p_action); if (!E) { return 0.0f; } @@ -355,7 +366,7 @@ float Input::get_action_raw_strength(const StringName &p_action, bool p_exact) c return 0.0f; } - return E->value.raw_strength; + return E->value.cache.raw_strength; } float Input::get_axis(const StringName &p_negative_action, const StringName &p_positive_action) const { @@ -440,6 +451,18 @@ static String _hex_str(uint8_t p_byte) { void Input::joy_connection_changed(int p_idx, bool p_connected, String p_name, String p_guid, Dictionary p_joypad_info) { _THREAD_SAFE_METHOD_ + + // Clear the pressed status if a Joypad gets disconnected. + if (!p_connected) { + for (KeyValue<StringName, ActionState> &E : action_states) { + HashMap<int, ActionState::DeviceState>::Iterator it = E.value.device_states.find(p_idx); + if (it) { + E.value.device_states.remove(it); + _update_action_cache(E.key, E.value); + } + } + } + Joypad js; js.name = p_connected ? p_name : ""; js.uid = p_connected ? p_guid : ""; @@ -699,30 +722,35 @@ void Input::_parse_input_event_impl(const Ref<InputEvent> &p_event, bool p_is_em if (event_index == -1) { continue; } + ERR_FAIL_COND_MSG(event_index >= (int)MAX_EVENT, vformat("Input singleton does not support more than %d events assigned to an action.", MAX_EVENT)); + + int device_id = p_event->get_device(); + bool is_pressed = p_event->is_action_pressed(E.key, true); + ActionState &action_state = action_states[E.key]; + + // Update the action's per-device state. + ActionState::DeviceState &device_state = action_state.device_states[device_id]; + device_state.pressed[event_index] = is_pressed; + device_state.strength[event_index] = p_event->get_action_strength(E.key); + device_state.raw_strength[event_index] = p_event->get_action_raw_strength(E.key); + + // Update the action's global state and cache. + if (!is_pressed) { + action_state.api_pressed = false; // Always release the event from action_press() method. + action_state.api_strength = 0.0; + } + action_state.exact = InputMap::get_singleton()->event_is_action(p_event, E.key, true); - Action &action = action_state[E.key]; - if (!p_event->is_echo()) { - if (p_event->is_action_pressed(E.key)) { - if (!action.pressed) { - action.pressed_physics_frame = Engine::get_singleton()->get_physics_frames(); - action.pressed_process_frame = Engine::get_singleton()->get_process_frames(); - } - action.pressed |= ((uint64_t)1 << event_index); - } else { - action.pressed &= ~((uint64_t)1 << event_index); - action.pressed &= ~(1 << MAX_EVENT); // Always release the event from action_press() method. - - if (!action.pressed) { - action.released_physics_frame = Engine::get_singleton()->get_physics_frames(); - action.released_process_frame = Engine::get_singleton()->get_process_frames(); - } - _update_action_strength(action, MAX_EVENT, 0.0); - _update_action_raw_strength(action, MAX_EVENT, 0.0); - } - action.exact = InputMap::get_singleton()->event_is_action(p_event, E.key, true); + bool was_pressed = action_state.cache.pressed; + _update_action_cache(E.key, action_state); + if (action_state.cache.pressed && !was_pressed) { + action_state.pressed_physics_frame = Engine::get_singleton()->get_physics_frames(); + action_state.pressed_process_frame = Engine::get_singleton()->get_process_frames(); + } + if (!action_state.cache.pressed && was_pressed) { + action_state.released_physics_frame = Engine::get_singleton()->get_physics_frames(); + action_state.released_process_frame = Engine::get_singleton()->get_process_frames(); } - _update_action_strength(action, event_index, p_event->get_action_strength(E.key)); - _update_action_raw_strength(action, event_index, p_event->get_action_raw_strength(E.key)); } if (event_dispatch_function) { @@ -837,32 +865,30 @@ Point2i Input::warp_mouse_motion(const Ref<InputEventMouseMotion> &p_motion, con void Input::action_press(const StringName &p_action, float p_strength) { // Create or retrieve existing action. - Action &action = action_state[p_action]; + ActionState &action_state = action_states[p_action]; - if (!action.pressed) { - action.pressed_physics_frame = Engine::get_singleton()->get_physics_frames(); - action.pressed_process_frame = Engine::get_singleton()->get_process_frames(); + if (!action_state.cache.pressed) { + action_state.pressed_physics_frame = Engine::get_singleton()->get_physics_frames(); + action_state.pressed_process_frame = Engine::get_singleton()->get_process_frames(); } - action.pressed |= 1 << MAX_EVENT; - _update_action_strength(action, MAX_EVENT, p_strength); - _update_action_raw_strength(action, MAX_EVENT, p_strength); - action.exact = true; + action_state.exact = true; + action_state.api_pressed = true; + action_state.api_strength = p_strength; + _update_action_cache(p_action, action_state); } void Input::action_release(const StringName &p_action) { // Create or retrieve existing action. - Action &action = action_state[p_action]; - - action.pressed = 0; - action.strength = 0.0; - action.raw_strength = 0.0; - action.released_physics_frame = Engine::get_singleton()->get_physics_frames(); - action.released_process_frame = Engine::get_singleton()->get_process_frames(); - for (uint64_t i = 0; i <= MAX_EVENT; i++) { - action.strengths[i] = 0.0; - action.raw_strengths[i] = 0.0; - } - action.exact = true; + ActionState &action_state = action_states[p_action]; + action_state.cache.pressed = 0; + action_state.cache.strength = 0.0; + action_state.cache.raw_strength = 0.0; + action_state.released_physics_frame = Engine::get_singleton()->get_physics_frames(); + action_state.released_process_frame = Engine::get_singleton()->get_process_frames(); + action_state.device_states.clear(); + action_state.exact = true; + action_state.api_pressed = false; + action_state.api_strength = 0.0; } void Input::set_emulate_touch_from_mouse(bool p_emulate) { @@ -1020,10 +1046,8 @@ void Input::release_pressed_events() { joy_buttons_pressed.clear(); _joy_axis.clear(); - for (KeyValue<StringName, Input::Action> &E : action_state) { - if (E.value.pressed > 0) { - // Make sure the action is really released. - E.value.pressed = 1; + for (KeyValue<StringName, Input::ActionState> &E : action_states) { + if (E.value.cache.pressed) { action_release(E.key); } } @@ -1190,35 +1214,26 @@ void Input::_axis_event(int p_device, JoyAxis p_axis, float p_value) { parse_input_event(ievent); } -void Input::_update_action_strength(Action &p_action, int p_event_index, float p_strength) { - ERR_FAIL_INDEX(p_event_index, (int)MAX_EVENT + 1); +void Input::_update_action_cache(const StringName &p_action_name, ActionState &r_action_state) { + // Update the action cache, computed from the per-device and per-event states. + r_action_state.cache.pressed = false; + r_action_state.cache.strength = 0.0; + r_action_state.cache.raw_strength = 0.0; - float old_strength = p_action.strengths[p_event_index]; - p_action.strengths[p_event_index] = p_strength; - - if (p_strength > p_action.strength) { - p_action.strength = p_strength; - } else if (Math::is_equal_approx(old_strength, p_action.strength)) { - p_action.strength = p_strength; - for (uint64_t i = 0; i <= MAX_EVENT; i++) { - p_action.strength = MAX(p_action.strength, p_action.strengths[i]); + int max_event = InputMap::get_singleton()->action_get_events(p_action_name)->size(); + for (const KeyValue<int, ActionState::DeviceState> &kv : r_action_state.device_states) { + const ActionState::DeviceState &device_state = kv.value; + for (int i = 0; i < max_event; i++) { + r_action_state.cache.pressed = r_action_state.cache.pressed || device_state.pressed[i]; + r_action_state.cache.strength = MAX(r_action_state.cache.strength, device_state.strength[i]); + r_action_state.cache.raw_strength = MAX(r_action_state.cache.raw_strength, device_state.raw_strength[i]); } } -} - -void Input::_update_action_raw_strength(Action &p_action, int p_event_index, float p_strength) { - ERR_FAIL_INDEX(p_event_index, (int)MAX_EVENT + 1); - float old_strength = p_action.raw_strengths[p_event_index]; - p_action.raw_strengths[p_event_index] = p_strength; - - if (p_strength > p_action.raw_strength) { - p_action.raw_strength = p_strength; - } else if (Math::is_equal_approx(old_strength, p_action.raw_strength)) { - p_action.raw_strength = p_strength; - for (uint64_t i = 0; i <= MAX_EVENT; i++) { - p_action.raw_strength = MAX(p_action.raw_strength, p_action.raw_strengths[i]); - } + if (r_action_state.api_pressed) { + r_action_state.cache.pressed = true; + r_action_state.cache.strength = MAX(r_action_state.cache.strength, r_action_state.api_strength); + r_action_state.cache.raw_strength = MAX(r_action_state.cache.raw_strength, r_action_state.api_strength); // Use the strength as raw_strength for API-pressed states. } } diff --git a/core/input/input.h b/core/input/input.h index dd613c4877..b98406e884 100644 --- a/core/input/input.h +++ b/core/input/input.h @@ -44,7 +44,7 @@ class Input : public Object { static Input *singleton; - static constexpr uint64_t MAX_EVENT = 31; + static constexpr uint64_t MAX_EVENT = 32; public: enum MouseMode { @@ -100,30 +100,31 @@ private: int64_t mouse_window = 0; bool legacy_just_pressed_behavior = false; - struct Action { + struct ActionState { uint64_t pressed_physics_frame = UINT64_MAX; uint64_t pressed_process_frame = UINT64_MAX; uint64_t released_physics_frame = UINT64_MAX; uint64_t released_process_frame = UINT64_MAX; - uint64_t pressed = 0; bool exact = true; - float strength = 0.0f; - float raw_strength = 0.0f; - LocalVector<float> strengths; - LocalVector<float> raw_strengths; - - Action() { - strengths.resize(MAX_EVENT + 1); - raw_strengths.resize(MAX_EVENT + 1); - - for (uint64_t i = 0; i <= MAX_EVENT; i++) { - strengths[i] = 0.0; - raw_strengths[i] = 0.0; - } - } + + struct DeviceState { + bool pressed[MAX_EVENT] = { false }; + float strength[MAX_EVENT] = { 0.0 }; + float raw_strength[MAX_EVENT] = { 0.0 }; + }; + bool api_pressed = false; + float api_strength = 0.0; + HashMap<int, DeviceState> device_states; + + // Cache. + struct ActionStateCache { + bool pressed = false; + float strength = false; + float raw_strength = false; + } cache; }; - HashMap<StringName, Action> action_state; + HashMap<StringName, ActionState> action_states; bool emulate_touch_from_mouse = false; bool emulate_mouse_from_touch = false; @@ -240,8 +241,7 @@ private: JoyAxis _get_output_axis(String output); void _button_event(int p_device, JoyButton p_index, bool p_pressed); void _axis_event(int p_device, JoyAxis p_axis, float p_value); - void _update_action_strength(Action &p_action, int p_event_index, float p_strength); - void _update_action_raw_strength(Action &p_action, int p_event_index, float p_strength); + void _update_action_cache(const StringName &p_action_name, ActionState &r_action_state); void _parse_input_event_impl(const Ref<InputEvent> &p_event, bool p_is_emulated); diff --git a/core/io/file_access_pack.cpp b/core/io/file_access_pack.cpp index 74c5c1c191..265d9ef56c 100644 --- a/core/io/file_access_pack.cpp +++ b/core/io/file_access_pack.cpp @@ -327,7 +327,7 @@ uint64_t FileAccessPack::get_buffer(uint8_t *p_dst, uint64_t p_length) const { to_read = (int64_t)pf.size - (int64_t)pos; } - pos += p_length; + pos += to_read; if (to_read <= 0) { return 0; diff --git a/core/io/image.cpp b/core/io/image.cpp index ce08b417a8..c72064e4f7 100644 --- a/core/io/image.cpp +++ b/core/io/image.cpp @@ -509,6 +509,7 @@ static void _convert(int p_width, int p_height, const uint8_t *p_src, uint8_t *p } void Image::convert(Format p_new_format) { + ERR_FAIL_INDEX_MSG(p_new_format, FORMAT_MAX, "The Image format specified (" + itos(p_new_format) + ") is out of range. See Image's Format enum."); if (data.size() == 0) { return; } diff --git a/core/io/resource_format_binary.cpp b/core/io/resource_format_binary.cpp index 2a33f723dc..20c494516b 100644 --- a/core/io/resource_format_binary.cpp +++ b/core/io/resource_format_binary.cpp @@ -1454,8 +1454,10 @@ Error ResourceFormatLoaderBinary::rename_dependencies(const String &p_path, cons fw.unref(); Ref<DirAccess> da = DirAccess::create(DirAccess::ACCESS_RESOURCES); - da->remove(p_path); - da->rename(p_path + ".depren", p_path); + if (da->exists(p_path + ".depren")) { + da->remove(p_path); + da->rename(p_path + ".depren", p_path); + } return OK; } diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp index 529128b9a2..0c7764392a 100644 --- a/core/io/resource_loader.cpp +++ b/core/io/resource_loader.cpp @@ -340,7 +340,7 @@ void ResourceLoader::_thread_load_function(void *p_userdata) { if (load_task.resource.is_valid()) { if (load_task.cache_mode != ResourceFormatLoader::CACHE_MODE_IGNORE) { - load_task.resource->set_path(load_task.local_path); + load_task.resource->set_path(load_task.local_path, load_task.cache_mode == ResourceFormatLoader::CACHE_MODE_REPLACE); } else if (!load_task.local_path.is_resource_file()) { load_task.resource->set_path_cache(load_task.local_path); } @@ -361,6 +361,17 @@ void ResourceLoader::_thread_load_function(void *p_userdata) { if (_loaded_callback) { _loaded_callback(load_task.resource, load_task.local_path); } + } else if (load_task.cache_mode != ResourceFormatLoader::CACHE_MODE_IGNORE) { + Ref<Resource> existing = ResourceCache::get_ref(load_task.local_path); + if (existing.is_valid()) { + load_task.resource = existing; + load_task.status = THREAD_LOAD_LOADED; + load_task.progress = 1.0; + + if (_loaded_callback) { + _loaded_callback(load_task.resource, load_task.local_path); + } + } } thread_load_mutex.unlock(); @@ -463,7 +474,7 @@ Ref<ResourceLoader::LoadToken> ResourceLoader::_load_start(const String &p_path, load_task.type_hint = p_type_hint; load_task.cache_mode = p_cache_mode; load_task.use_sub_threads = p_thread_mode == LOAD_THREAD_DISTRIBUTE; - if (p_cache_mode != ResourceFormatLoader::CACHE_MODE_IGNORE) { + if (p_cache_mode == ResourceFormatLoader::CACHE_MODE_REUSE) { Ref<Resource> existing = ResourceCache::get_ref(local_path); if (existing.is_valid()) { //referencing is fine @@ -1113,11 +1124,10 @@ bool ResourceLoader::add_custom_resource_format_loader(String script_path) { Ref<Script> s = res; StringName ibt = s->get_instance_base_type(); bool valid_type = ClassDB::is_parent_class(ibt, "ResourceFormatLoader"); - ERR_FAIL_COND_V_MSG(!valid_type, false, "Script does not inherit a CustomResourceLoader: " + script_path + "."); + ERR_FAIL_COND_V_MSG(!valid_type, false, vformat("Failed to add a custom resource loader, script '%s' does not inherit 'ResourceFormatLoader'.", script_path)); Object *obj = ClassDB::instantiate(ibt); - - ERR_FAIL_NULL_V_MSG(obj, false, "Cannot instance script as custom resource loader, expected 'ResourceFormatLoader' inheritance, got: " + String(ibt) + "."); + ERR_FAIL_NULL_V_MSG(obj, false, vformat("Failed to add a custom resource loader, cannot instantiate '%s'.", ibt)); Ref<ResourceFormatLoader> crl = Object::cast_to<ResourceFormatLoader>(obj); crl->set_script(s); diff --git a/core/io/resource_saver.cpp b/core/io/resource_saver.cpp index 564a54b913..1c6c18b015 100644 --- a/core/io/resource_saver.cpp +++ b/core/io/resource_saver.cpp @@ -237,11 +237,10 @@ bool ResourceSaver::add_custom_resource_format_saver(String script_path) { Ref<Script> s = res; StringName ibt = s->get_instance_base_type(); bool valid_type = ClassDB::is_parent_class(ibt, "ResourceFormatSaver"); - ERR_FAIL_COND_V_MSG(!valid_type, false, "Script does not inherit a CustomResourceSaver: " + script_path + "."); + ERR_FAIL_COND_V_MSG(!valid_type, false, vformat("Failed to add a custom resource saver, script '%s' does not inherit 'ResourceFormatSaver'.", script_path)); Object *obj = ClassDB::instantiate(ibt); - - ERR_FAIL_NULL_V_MSG(obj, false, "Cannot instance script as custom resource saver, expected 'ResourceFormatSaver' inheritance, got: " + String(ibt) + "."); + ERR_FAIL_NULL_V_MSG(obj, false, vformat("Failed to add a custom resource saver, cannot instantiate '%s'.", ibt)); Ref<ResourceFormatSaver> crl = Object::cast_to<ResourceFormatSaver>(obj); crl->set_script(s); diff --git a/core/math/aabb.cpp b/core/math/aabb.cpp index 1071df0979..e1d49dacc0 100644 --- a/core/math/aabb.cpp +++ b/core/math/aabb.cpp @@ -117,6 +117,11 @@ AABB AABB::intersection(const AABB &p_aabb) const { return AABB(min, max - min); } +#ifdef MINGW_ENABLED +#undef near +#undef far +#endif + bool AABB::intersects_ray(const Vector3 &p_from, const Vector3 &p_dir, Vector3 *r_clip, Vector3 *r_normal) const { #ifdef MATH_CHECKS if (unlikely(size.x < 0 || size.y < 0 || size.z < 0)) { diff --git a/core/math/basis.cpp b/core/math/basis.cpp index 9796ac59c2..cd8c87b158 100644 --- a/core/math/basis.cpp +++ b/core/math/basis.cpp @@ -89,13 +89,26 @@ Basis Basis::orthogonalized() const { return c; } +// Returns true if the basis vectors are orthogonal (perpendicular), so it has no skew or shear, and can be decomposed into rotation and scale. +// See https://en.wikipedia.org/wiki/Orthogonal_basis bool Basis::is_orthogonal() const { - Basis identity; - Basis m = (*this) * transposed(); + const Vector3 x = get_column(0); + const Vector3 y = get_column(1); + const Vector3 z = get_column(2); + return Math::is_zero_approx(x.dot(y)) && Math::is_zero_approx(x.dot(z)) && Math::is_zero_approx(y.dot(z)); +} - return m.is_equal_approx(identity); +// Returns true if the basis vectors are orthonormal (orthogonal and normalized), so it has no scale, skew, or shear. +// See https://en.wikipedia.org/wiki/Orthonormal_basis +bool Basis::is_orthonormal() const { + const Vector3 x = get_column(0); + const Vector3 y = get_column(1); + const Vector3 z = get_column(2); + return Math::is_equal_approx(x.length_squared(), 1) && Math::is_equal_approx(y.length_squared(), 1) && Math::is_equal_approx(z.length_squared(), 1) && Math::is_zero_approx(x.dot(y)) && Math::is_zero_approx(x.dot(z)) && Math::is_zero_approx(y.dot(z)); } +// Returns true if the basis is conformal (orthogonal, uniform scale, preserves angles and distance ratios). +// See https://en.wikipedia.org/wiki/Conformal_linear_transformation bool Basis::is_conformal() const { const Vector3 x = get_column(0); const Vector3 y = get_column(1); @@ -104,6 +117,7 @@ bool Basis::is_conformal() const { return Math::is_equal_approx(x_len_sq, y.length_squared()) && Math::is_equal_approx(x_len_sq, z.length_squared()) && Math::is_zero_approx(x.dot(y)) && Math::is_zero_approx(x.dot(z)) && Math::is_zero_approx(y.dot(z)); } +// Returns true if the basis only has diagonal elements, so it may only have scale or flip, but no rotation, skew, or shear. bool Basis::is_diagonal() const { return ( Math::is_zero_approx(rows[0][1]) && Math::is_zero_approx(rows[0][2]) && @@ -111,8 +125,9 @@ bool Basis::is_diagonal() const { Math::is_zero_approx(rows[2][0]) && Math::is_zero_approx(rows[2][1])); } +// Returns true if the basis is a pure rotation matrix, so it has no scale, skew, shear, or flip. bool Basis::is_rotation() const { - return Math::is_equal_approx(determinant(), 1, (real_t)UNIT_EPSILON) && is_orthogonal(); + return is_conformal() && Math::is_equal_approx(determinant(), 1, (real_t)UNIT_EPSILON); } #ifdef MATH_CHECKS diff --git a/core/math/basis.h b/core/math/basis.h index adacd1c216..b4d971464e 100644 --- a/core/math/basis.h +++ b/core/math/basis.h @@ -138,6 +138,7 @@ struct _NO_DISCARD_ Basis { _FORCE_INLINE_ Basis operator*(const real_t p_val) const; bool is_orthogonal() const; + bool is_orthonormal() const; bool is_conformal() const; bool is_diagonal() const; bool is_rotation() const; diff --git a/core/math/dynamic_bvh.h b/core/math/dynamic_bvh.h index dbc1cb31de..9b49fcc3c8 100644 --- a/core/math/dynamic_bvh.h +++ b/core/math/dynamic_bvh.h @@ -328,7 +328,8 @@ void DynamicBVH::aabb_query(const AABB &p_box, QueryResult &r_result) { volume.min = p_box.position; volume.max = p_box.position + p_box.size; - const Node **stack = (const Node **)alloca(ALLOCA_STACK_SIZE * sizeof(const Node *)); + const Node **alloca_stack = (const Node **)alloca(ALLOCA_STACK_SIZE * sizeof(const Node *)); + const Node **stack = alloca_stack; stack[0] = bvh_root; int32_t depth = 1; int32_t threshold = ALLOCA_STACK_SIZE - 2; @@ -343,7 +344,8 @@ void DynamicBVH::aabb_query(const AABB &p_box, QueryResult &r_result) { if (depth > threshold) { if (aux_stack.is_empty()) { aux_stack.resize(ALLOCA_STACK_SIZE * 2); - memcpy(aux_stack.ptr(), stack, ALLOCA_STACK_SIZE * sizeof(const Node *)); + memcpy(aux_stack.ptr(), alloca_stack, ALLOCA_STACK_SIZE * sizeof(const Node *)); + alloca_stack = nullptr; } else { aux_stack.resize(aux_stack.size() * 2); } @@ -384,7 +386,8 @@ void DynamicBVH::convex_query(const Plane *p_planes, int p_plane_count, const Ve } } - const Node **stack = (const Node **)alloca(ALLOCA_STACK_SIZE * sizeof(const Node *)); + const Node **alloca_stack = (const Node **)alloca(ALLOCA_STACK_SIZE * sizeof(const Node *)); + const Node **stack = alloca_stack; stack[0] = bvh_root; int32_t depth = 1; int32_t threshold = ALLOCA_STACK_SIZE - 2; @@ -399,7 +402,8 @@ void DynamicBVH::convex_query(const Plane *p_planes, int p_plane_count, const Ve if (depth > threshold) { if (aux_stack.is_empty()) { aux_stack.resize(ALLOCA_STACK_SIZE * 2); - memcpy(aux_stack.ptr(), stack, ALLOCA_STACK_SIZE * sizeof(const Node *)); + memcpy(aux_stack.ptr(), alloca_stack, ALLOCA_STACK_SIZE * sizeof(const Node *)); + alloca_stack = nullptr; } else { aux_stack.resize(aux_stack.size() * 2); } @@ -436,7 +440,8 @@ void DynamicBVH::ray_query(const Vector3 &p_from, const Vector3 &p_to, QueryResu Vector3 bounds[2]; - const Node **stack = (const Node **)alloca(ALLOCA_STACK_SIZE * sizeof(const Node *)); + const Node **alloca_stack = (const Node **)alloca(ALLOCA_STACK_SIZE * sizeof(const Node *)); + const Node **stack = alloca_stack; stack[0] = bvh_root; int32_t depth = 1; int32_t threshold = ALLOCA_STACK_SIZE - 2; @@ -456,7 +461,8 @@ void DynamicBVH::ray_query(const Vector3 &p_from, const Vector3 &p_to, QueryResu if (depth > threshold) { if (aux_stack.is_empty()) { aux_stack.resize(ALLOCA_STACK_SIZE * 2); - memcpy(aux_stack.ptr(), stack, ALLOCA_STACK_SIZE * sizeof(const Node *)); + memcpy(aux_stack.ptr(), alloca_stack, ALLOCA_STACK_SIZE * sizeof(const Node *)); + alloca_stack = nullptr; } else { aux_stack.resize(aux_stack.size() * 2); } diff --git a/core/math/rect2.h b/core/math/rect2.h index 6ccb76cd10..5f403458fd 100644 --- a/core/math/rect2.h +++ b/core/math/rect2.h @@ -285,6 +285,10 @@ struct _NO_DISCARD_ Rect2 { return Rect2(Point2(position.x + MIN(size.x, (real_t)0), position.y + MIN(size.y, (real_t)0)), size.abs()); } + _FORCE_INLINE_ Rect2 round() const { + return Rect2(position.round(), size.round()); + } + Vector2 get_support(const Vector2 &p_normal) const { Vector2 half_extents = size * 0.5f; Vector2 ofs = position + half_extents; diff --git a/core/object/callable_method_pointer.h b/core/object/callable_method_pointer.h index db78b982e4..f8e8c4d7e9 100644 --- a/core/object/callable_method_pointer.h +++ b/core/object/callable_method_pointer.h @@ -81,35 +81,27 @@ template <class T, class... P> class CallableCustomMethodPointer : public CallableCustomMethodPointerBase { struct Data { T *instance; -#ifdef DEBUG_ENABLED uint64_t object_id; -#endif void (T::*method)(P...); } data; public: virtual ObjectID get_object() const { -#ifdef DEBUG_ENABLED if (ObjectDB::get_instance(ObjectID(data.object_id)) == nullptr) { return ObjectID(); } -#endif return data.instance->get_instance_id(); } virtual void call(const Variant **p_arguments, int p_argcount, Variant &r_return_value, Callable::CallError &r_call_error) const { -#ifdef DEBUG_ENABLED ERR_FAIL_NULL_MSG(ObjectDB::get_instance(ObjectID(data.object_id)), "Invalid Object id '" + uitos(data.object_id) + "', can't call method."); -#endif call_with_variant_args(data.instance, data.method, p_arguments, p_argcount, r_call_error); } CallableCustomMethodPointer(T *p_instance, void (T::*p_method)(P...)) { memset(&data, 0, sizeof(Data)); // Clear beforehand, may have padding bytes. data.instance = p_instance; -#ifdef DEBUG_ENABLED data.object_id = p_instance->get_instance_id(); -#endif data.method = p_method; _setup((uint32_t *)&data, sizeof(Data)); } @@ -135,36 +127,28 @@ template <class T, class R, class... P> class CallableCustomMethodPointerRet : public CallableCustomMethodPointerBase { struct Data { T *instance; -#ifdef DEBUG_ENABLED uint64_t object_id; -#endif R(T::*method) (P...); } data; public: virtual ObjectID get_object() const { -#ifdef DEBUG_ENABLED if (ObjectDB::get_instance(ObjectID(data.object_id)) == nullptr) { return ObjectID(); } -#endif return data.instance->get_instance_id(); } virtual void call(const Variant **p_arguments, int p_argcount, Variant &r_return_value, Callable::CallError &r_call_error) const { -#ifdef DEBUG_ENABLED ERR_FAIL_NULL_MSG(ObjectDB::get_instance(ObjectID(data.object_id)), "Invalid Object id '" + uitos(data.object_id) + "', can't call method."); -#endif call_with_variant_args_ret(data.instance, data.method, p_arguments, p_argcount, r_return_value, r_call_error); } CallableCustomMethodPointerRet(T *p_instance, R (T::*p_method)(P...)) { memset(&data, 0, sizeof(Data)); // Clear beforehand, may have padding bytes. data.instance = p_instance; -#ifdef DEBUG_ENABLED data.object_id = p_instance->get_instance_id(); -#endif data.method = p_method; _setup((uint32_t *)&data, sizeof(Data)); } @@ -190,36 +174,28 @@ template <class T, class R, class... P> class CallableCustomMethodPointerRetC : public CallableCustomMethodPointerBase { struct Data { T *instance; -#ifdef DEBUG_ENABLED uint64_t object_id; -#endif R(T::*method) (P...) const; } data; public: virtual ObjectID get_object() const override { -#ifdef DEBUG_ENABLED if (ObjectDB::get_instance(ObjectID(data.object_id)) == nullptr) { return ObjectID(); } -#endif return data.instance->get_instance_id(); } virtual void call(const Variant **p_arguments, int p_argcount, Variant &r_return_value, Callable::CallError &r_call_error) const override { -#ifdef DEBUG_ENABLED ERR_FAIL_NULL_MSG(ObjectDB::get_instance(ObjectID(data.object_id)), "Invalid Object id '" + uitos(data.object_id) + "', can't call method."); -#endif call_with_variant_args_retc(data.instance, data.method, p_arguments, p_argcount, r_return_value, r_call_error); } CallableCustomMethodPointerRetC(T *p_instance, R (T::*p_method)(P...) const) { memset(&data, 0, sizeof(Data)); // Clear beforehand, may have padding bytes. data.instance = p_instance; -#ifdef DEBUG_ENABLED data.object_id = p_instance->get_instance_id(); -#endif data.method = p_method; _setup((uint32_t *)&data, sizeof(Data)); } diff --git a/core/object/make_virtuals.py b/core/object/make_virtuals.py index 79a8df6c8a..ae70981f72 100644 --- a/core/object/make_virtuals.py +++ b/core/object/make_virtuals.py @@ -1,78 +1,74 @@ -proto = """ -#define GDVIRTUAL$VER($RET m_name $ARG) \\ -StringName _gdvirtual_##m_name##_sn = #m_name;\\ -mutable bool _gdvirtual_##m_name##_initialized = false;\\ -mutable void* _gdvirtual_##m_name = nullptr;\\ -template<bool required>\\ -_FORCE_INLINE_ bool _gdvirtual_##m_name##_call($CALLARGS) $CONST { \\ - ScriptInstance *_script_instance = ((Object*)(this))->get_script_instance();\\ - if (_script_instance) {\\ - Callable::CallError ce; \\ - $CALLSIARGS\\ - $CALLSIBEGIN_script_instance->callp(_gdvirtual_##m_name##_sn, $CALLSIARGPASS, ce);\\ - if (ce.error == Callable::CallError::CALL_OK) {\\ - $CALLSIRET\\ +proto = """#define GDVIRTUAL$VER($RET m_name $ARG)\\ + StringName _gdvirtual_##m_name##_sn = #m_name;\\ + mutable bool _gdvirtual_##m_name##_initialized = false;\\ + mutable void *_gdvirtual_##m_name = nullptr;\\ + template <bool required>\\ + _FORCE_INLINE_ bool _gdvirtual_##m_name##_call($CALLARGS) $CONST {\\ + ScriptInstance *_script_instance = ((Object *)(this))->get_script_instance();\\ + if (_script_instance) {\\ + Callable::CallError ce;\\ + $CALLSIARGS\\ + $CALLSIBEGIN_script_instance->callp(_gdvirtual_##m_name##_sn, $CALLSIARGPASS, ce);\\ + if (ce.error == Callable::CallError::CALL_OK) {\\ + $CALLSIRET\\ + return true;\\ + }\\ + }\\ + if (unlikely(_get_extension() && !_gdvirtual_##m_name##_initialized)) {\\ + _gdvirtual_##m_name = nullptr;\\ + if (_get_extension()->get_virtual_call_data && _get_extension()->call_virtual_with_data) {\\ + _gdvirtual_##m_name = _get_extension()->get_virtual_call_data(_get_extension()->class_userdata, &_gdvirtual_##m_name##_sn);\\ + } else if (_get_extension()->get_virtual) {\\ + _gdvirtual_##m_name = (void *)_get_extension()->get_virtual(_get_extension()->class_userdata, &_gdvirtual_##m_name##_sn);\\ + }\\ + GDVIRTUAL_TRACK(_gdvirtual_##m_name, _gdvirtual_##m_name##_initialized);\\ + _gdvirtual_##m_name##_initialized = true;\\ + }\\ + if (_gdvirtual_##m_name) {\\ + $CALLPTRARGS\\ + $CALLPTRRETDEF\\ + if (_get_extension()->get_virtual_call_data && _get_extension()->call_virtual_with_data) {\\ + _get_extension()->call_virtual_with_data(_get_extension_instance(), &_gdvirtual_##m_name##_sn, _gdvirtual_##m_name, $CALLPTRARGPASS, $CALLPTRRETPASS);\\ + $CALLPTRRET\\ + } else {\\ + ((GDExtensionClassCallVirtual)_gdvirtual_##m_name)(_get_extension_instance(), $CALLPTRARGPASS, $CALLPTRRETPASS);\\ + $CALLPTRRET\\ + }\\ return true;\\ - } \\ + }\\ + if (required) {\\ + ERR_PRINT_ONCE("Required virtual method " + get_class() + "::" + #m_name + " must be overridden before calling.");\\ + $RVOID\\ + }\\ + return false;\\ }\\ - if (unlikely(_get_extension() && !_gdvirtual_##m_name##_initialized)) {\\ - _gdvirtual_##m_name = nullptr;\\ - if (_get_extension()->get_virtual_call_data && _get_extension()->call_virtual_with_data) {\\ - _gdvirtual_##m_name = _get_extension()->get_virtual_call_data(_get_extension()->class_userdata, &_gdvirtual_##m_name##_sn);\\ - } else if (_get_extension()->get_virtual) {\\ - _gdvirtual_##m_name = (void *)_get_extension()->get_virtual(_get_extension()->class_userdata, &_gdvirtual_##m_name##_sn);\\ - }\\ - GDVIRTUAL_TRACK(_gdvirtual_##m_name, _gdvirtual_##m_name##_initialized); \\ - _gdvirtual_##m_name##_initialized = true;\\ - }\\ - if (_gdvirtual_##m_name) {\\ - $CALLPTRARGS\\ - $CALLPTRRETDEF\\ - if (_get_extension()->get_virtual_call_data && _get_extension()->call_virtual_with_data) {\\ - _get_extension()->call_virtual_with_data(_get_extension_instance(), &_gdvirtual_##m_name##_sn, _gdvirtual_##m_name, $CALLPTRARGPASS,$CALLPTRRETPASS);\\ - $CALLPTRRET\\ - } else {\\ - ((GDExtensionClassCallVirtual)_gdvirtual_##m_name)(_get_extension_instance(),$CALLPTRARGPASS,$CALLPTRRETPASS);\\ - $CALLPTRRET\\ - }\\ - return true;\\ - }\\ - \\ - if (required) {\\ - ERR_PRINT_ONCE("Required virtual method " + get_class() + "::" + #m_name + " must be overridden before calling.");\\ - $RVOID\\ - }\\ -\\ - return false;\\ -}\\ -_FORCE_INLINE_ bool _gdvirtual_##m_name##_overridden() const { \\ - ScriptInstance *_script_instance = ((Object*)(this))->get_script_instance();\\ - if (_script_instance && _script_instance->has_method(_gdvirtual_##m_name##_sn)) {\\ - return true;\\ - }\\ - if (unlikely(_get_extension() && !_gdvirtual_##m_name##_initialized)) {\\ - _gdvirtual_##m_name = nullptr;\\ - if (_get_extension()->get_virtual_call_data && _get_extension()->call_virtual_with_data) {\\ - _gdvirtual_##m_name = _get_extension()->get_virtual_call_data(_get_extension()->class_userdata, &_gdvirtual_##m_name##_sn);\\ - } else if (_get_extension()->get_virtual) {\\ - _gdvirtual_##m_name = (void *)_get_extension()->get_virtual(_get_extension()->class_userdata, &_gdvirtual_##m_name##_sn);\\ - }\\ - GDVIRTUAL_TRACK(_gdvirtual_##m_name, _gdvirtual_##m_name##_initialized); \\ - _gdvirtual_##m_name##_initialized = true;\\ - }\\ - if (_gdvirtual_##m_name) {\\ - return true;\\ + _FORCE_INLINE_ bool _gdvirtual_##m_name##_overridden() const {\\ + ScriptInstance *_script_instance = ((Object *)(this))->get_script_instance();\\ + if (_script_instance && _script_instance->has_method(_gdvirtual_##m_name##_sn)) {\\ + return true;\\ + }\\ + if (unlikely(_get_extension() && !_gdvirtual_##m_name##_initialized)) {\\ + _gdvirtual_##m_name = nullptr;\\ + if (_get_extension()->get_virtual_call_data && _get_extension()->call_virtual_with_data) {\\ + _gdvirtual_##m_name = _get_extension()->get_virtual_call_data(_get_extension()->class_userdata, &_gdvirtual_##m_name##_sn);\\ + } else if (_get_extension()->get_virtual) {\\ + _gdvirtual_##m_name = (void *)_get_extension()->get_virtual(_get_extension()->class_userdata, &_gdvirtual_##m_name##_sn);\\ + }\\ + GDVIRTUAL_TRACK(_gdvirtual_##m_name, _gdvirtual_##m_name##_initialized);\\ + _gdvirtual_##m_name##_initialized = true;\\ + }\\ + if (_gdvirtual_##m_name) {\\ + return true;\\ + }\\ + return false;\\ }\\ - return false;\\ -}\\ -\\ -_FORCE_INLINE_ static MethodInfo _gdvirtual_##m_name##_get_method_info() { \\ - MethodInfo method_info;\\ - method_info.name = #m_name;\\ - method_info.flags = METHOD_FLAG_VIRTUAL;\\ - $FILL_METHOD_INFO\\ - return method_info;\\ -} + _FORCE_INLINE_ static MethodInfo _gdvirtual_##m_name##_get_method_info() {\\ + MethodInfo method_info;\\ + method_info.name = #m_name;\\ + method_info.flags = $METHOD_FLAGS;\\ + $FILL_METHOD_INFO\\ + return method_info;\\ + } """ @@ -83,22 +79,23 @@ def generate_version(argcount, const=False, returns=False): method_info = "" if returns: sproto += "R" - s = s.replace("$RET", "m_ret, ") + s = s.replace("$RET", "m_ret,") s = s.replace("$RVOID", "(void)r_ret;") # If required, may lead to uninitialized errors s = s.replace("$CALLPTRRETDEF", "PtrToArg<m_ret>::EncodeT ret;") - method_info += "\tmethod_info.return_val = GetTypeInfo<m_ret>::get_class_info();\\\n" - method_info += "\tmethod_info.return_val_metadata = GetTypeInfo<m_ret>::METADATA;\\\n" + method_info += "method_info.return_val = GetTypeInfo<m_ret>::get_class_info();\\\n" + method_info += "\t\tmethod_info.return_val_metadata = GetTypeInfo<m_ret>::METADATA;" else: - s = s.replace("$RET", "") - s = s.replace("$RVOID", "") - s = s.replace("$CALLPTRRETDEF", "") + s = s.replace("$RET ", "") + s = s.replace("\t\t\t$RVOID\\\n", "") + s = s.replace("\t\t\t$CALLPTRRETDEF\\\n", "") if const: sproto += "C" s = s.replace("$CONST", "const") - method_info += "\tmethod_info.flags|=METHOD_FLAG_CONST;\\\n" + s = s.replace("$METHOD_FLAGS", "METHOD_FLAG_VIRTUAL | METHOD_FLAG_CONST") else: - s = s.replace("$CONST", "") + s = s.replace("$CONST ", "") + s = s.replace("$METHOD_FLAGS", "METHOD_FLAG_VIRTUAL") s = s.replace("$VER", sproto) argtext = "" @@ -108,9 +105,9 @@ def generate_version(argcount, const=False, returns=False): callptrargsptr = "" if argcount > 0: argtext += ", " - callsiargs = "Variant vargs[" + str(argcount) + "]={" - callsiargptrs = "\t\tconst Variant *vargptrs[" + str(argcount) + "]={" - callptrargsptr = "\t\tGDExtensionConstTypePtr argptrs[" + str(argcount) + "]={" + callsiargs = f"Variant vargs[{argcount}] = {{ " + callsiargptrs = f"\t\t\tconst Variant *vargptrs[{argcount}] = {{ " + callptrargsptr = f"\t\t\tGDExtensionConstTypePtr argptrs[{argcount}] = {{ " callptrargs = "" for i in range(argcount): if i > 0: @@ -118,52 +115,55 @@ def generate_version(argcount, const=False, returns=False): callargtext += ", " callsiargs += ", " callsiargptrs += ", " - callptrargs += "\t\t" + callptrargs += "\t\t\t" callptrargsptr += ", " - argtext += "m_type" + str(i + 1) - callargtext += "m_type" + str(i + 1) + " arg" + str(i + 1) - callsiargs += "Variant(arg" + str(i + 1) + ")" - callsiargptrs += "&vargs[" + str(i) + "]" + argtext += f"m_type{i + 1}" + callargtext += f"m_type{i + 1} arg{i + 1}" + callsiargs += f"Variant(arg{i + 1})" + callsiargptrs += f"&vargs[{i}]" callptrargs += ( - "PtrToArg<m_type" + str(i + 1) + ">::EncodeT argval" + str(i + 1) + " = arg" + str(i + 1) + ";\\\n" - ) - callptrargsptr += "&argval" + str(i + 1) - method_info += "\tmethod_info.arguments.push_back(GetTypeInfo<m_type" + str(i + 1) + ">::get_class_info());\\\n" - method_info += ( - "\tmethod_info.arguments_metadata.push_back(GetTypeInfo<m_type" + str(i + 1) + ">::METADATA);\\\n" + f"PtrToArg<m_type{i + 1}>::EncodeT argval{i + 1} = (PtrToArg<m_type{i + 1}>::EncodeT)arg{i + 1};\\\n" ) + callptrargsptr += f"&argval{i + 1}" + if method_info: + method_info += "\\\n\t\t" + method_info += f"method_info.arguments.push_back(GetTypeInfo<m_type{i + 1}>::get_class_info());\\\n" + method_info += f"\t\tmethod_info.arguments_metadata.push_back(GetTypeInfo<m_type{i + 1}>::METADATA);" if argcount: - callsiargs += "};\\\n" - callsiargptrs += "};\\\n" + callsiargs += " };\\\n" + callsiargptrs += " };" s = s.replace("$CALLSIARGS", callsiargs + callsiargptrs) - s = s.replace("$CALLSIARGPASS", "(const Variant **)vargptrs," + str(argcount)) - callptrargsptr += "};\\\n" + s = s.replace("$CALLSIARGPASS", f"(const Variant **)vargptrs, {argcount}") + callptrargsptr += " };" s = s.replace("$CALLPTRARGS", callptrargs + callptrargsptr) - s = s.replace("$CALLPTRARGPASS", "reinterpret_cast<GDExtensionConstTypePtr*>(argptrs)") + s = s.replace("$CALLPTRARGPASS", "reinterpret_cast<GDExtensionConstTypePtr *>(argptrs)") else: - s = s.replace("$CALLSIARGS", "") + s = s.replace("\t\t\t$CALLSIARGS\\\n", "") s = s.replace("$CALLSIARGPASS", "nullptr, 0") - s = s.replace("$CALLPTRARGS", "") + s = s.replace("\t\t\t$CALLPTRARGS\\\n", "") s = s.replace("$CALLPTRARGPASS", "nullptr") if returns: if argcount > 0: - callargtext += "," - callargtext += " m_ret& r_ret" + callargtext += ", " + callargtext += "m_ret &r_ret" s = s.replace("$CALLSIBEGIN", "Variant ret = ") s = s.replace("$CALLSIRET", "r_ret = VariantCaster<m_ret>::cast(ret);") s = s.replace("$CALLPTRRETPASS", "&ret") s = s.replace("$CALLPTRRET", "r_ret = (m_ret)ret;") else: s = s.replace("$CALLSIBEGIN", "") - s = s.replace("$CALLSIRET", "") + s = s.replace("\t\t\t\t$CALLSIRET\\\n", "") s = s.replace("$CALLPTRRETPASS", "nullptr") - s = s.replace("$CALLPTRRET", "") + s = s.replace("\t\t\t\t$CALLPTRRET\\\n", "") - s = s.replace("$ARG", argtext) + s = s.replace(" $ARG", argtext) s = s.replace("$CALLARGS", callargtext) - s = s.replace("$FILL_METHOD_INFO", method_info) + if method_info: + s = s.replace("$FILL_METHOD_INFO", method_info) + else: + s = s.replace("\t\t$FILL_METHOD_INFO\\\n", method_info) return s @@ -171,21 +171,21 @@ def generate_version(argcount, const=False, returns=False): def run(target, source, env): max_versions = 12 - txt = """ + txt = """/* THIS FILE IS GENERATED DO NOT EDIT */ #ifndef GDVIRTUAL_GEN_H #define GDVIRTUAL_GEN_H #include "core/object/script_instance.h" #ifdef TOOLS_ENABLED -#define GDVIRTUAL_TRACK(m_virtual, m_initialized) \\ - if (_get_extension()->reloadable) {\\ - VirtualMethodTracker *tracker = memnew(VirtualMethodTracker);\\ - tracker->method = (void **)&m_virtual;\\ - tracker->initialized = &m_initialized;\\ - tracker->next = virtual_method_list;\\ - virtual_method_list = tracker;\\ - } +#define GDVIRTUAL_TRACK(m_virtual, m_initialized)\\ + if (_get_extension()->reloadable) {\\ + VirtualMethodTracker *tracker = memnew(VirtualMethodTracker);\\ + tracker->method = (void **)&m_virtual;\\ + tracker->initialized = &m_initialized;\\ + tracker->next = virtual_method_list;\\ + virtual_method_list = tracker;\\ + } #else #define GDVIRTUAL_TRACK(m_virtual, m_initialized) #endif @@ -193,13 +193,13 @@ def run(target, source, env): """ for i in range(max_versions + 1): - txt += "/* " + str(i) + " Arguments */\n\n" + txt += f"/* {i} Arguments */\n\n" txt += generate_version(i, False, False) txt += generate_version(i, False, True) txt += generate_version(i, True, False) txt += generate_version(i, True, True) - txt += "#endif" + txt += "#endif // GDVIRTUAL_GEN_H\n" with open(target[0], "w") as f: f.write(txt) diff --git a/core/object/message_queue.cpp b/core/object/message_queue.cpp index de71295ee5..a394c957d0 100644 --- a/core/object/message_queue.cpp +++ b/core/object/message_queue.cpp @@ -35,6 +35,8 @@ #include "core/object/class_db.h" #include "core/object/script_language.h" +#include <stdio.h> + #ifdef DEV_ENABLED // Includes safety checks to ensure that a queue set as a thread singleton override // is only ever called from the thread it was set for. @@ -93,7 +95,7 @@ Error CallQueue::push_callablep(const Callable &p_callable, const Variant **p_ar if ((page_bytes[pages_used - 1] + room_needed) > uint32_t(PAGE_SIZE_BYTES)) { if (pages_used == max_pages) { - ERR_PRINT("Failed method: " + p_callable + ". Message queue out of memory. " + error_text); + fprintf(stderr, "Failed method: %s. Message queue out of memory. %s\n", String(p_callable).utf8().get_data(), error_text.utf8().get_data()); statistics(); UNLOCK_MUTEX; return ERR_OUT_OF_MEMORY; @@ -144,7 +146,7 @@ Error CallQueue::push_set(ObjectID p_id, const StringName &p_prop, const Variant if (ObjectDB::get_instance(p_id)) { type = ObjectDB::get_instance(p_id)->get_class(); } - ERR_PRINT("Failed set: " + type + ":" + p_prop + " target ID: " + itos(p_id) + ". Message queue out of memory. " + error_text); + fprintf(stderr, "Failed set: %s: %s target ID: %s. Message queue out of memory. %s\n", type.utf8().get_data(), String(p_prop).utf8().get_data(), itos(p_id).utf8().get_data(), error_text.utf8().get_data()); statistics(); UNLOCK_MUTEX; @@ -181,7 +183,7 @@ Error CallQueue::push_notification(ObjectID p_id, int p_notification) { if ((page_bytes[pages_used - 1] + room_needed) > uint32_t(PAGE_SIZE_BYTES)) { if (pages_used == max_pages) { - ERR_PRINT("Failed notification: " + itos(p_notification) + " target ID: " + itos(p_id) + ". Message queue out of memory. " + error_text); + fprintf(stderr, "Failed notification: %s target ID: %s. Message queue out of memory. %s\n", itos(p_notification).utf8().get_data(), itos(p_id).utf8().get_data(), error_text.utf8().get_data()); statistics(); UNLOCK_MUTEX; return ERR_OUT_OF_MEMORY; diff --git a/core/object/object.cpp b/core/object/object.cpp index 40df13849b..5a776e2106 100644 --- a/core/object/object.cpp +++ b/core/object/object.cpp @@ -1347,12 +1347,10 @@ Error Object::connect(const StringName &p_signal, const Callable &p_callable, ui s = &signal_map[p_signal]; } - Callable target = p_callable; - //compare with the base callable, so binds can be ignored - if (s->slot_map.has(*target.get_base_comparator())) { + if (s->slot_map.has(*p_callable.get_base_comparator())) { if (p_flags & CONNECT_REFERENCE_COUNTED) { - s->slot_map[*target.get_base_comparator()].reference_count++; + s->slot_map[*p_callable.get_base_comparator()].reference_count++; return OK; } else { ERR_FAIL_V_MSG(ERR_INVALID_PARAMETER, "Signal '" + p_signal + "' is already connected to given callable '" + p_callable + "' in that object."); @@ -1364,7 +1362,7 @@ Error Object::connect(const StringName &p_signal, const Callable &p_callable, ui SignalData::Slot slot; Connection conn; - conn.callable = target; + conn.callable = p_callable; conn.signal = ::Signal(this, p_signal); conn.flags = p_flags; slot.conn = conn; @@ -1376,7 +1374,7 @@ Error Object::connect(const StringName &p_signal, const Callable &p_callable, ui } //use callable version as key, so binds can be ignored - s->slot_map[*target.get_base_comparator()] = slot; + s->slot_map[*p_callable.get_base_comparator()] = slot; return OK; } @@ -1397,9 +1395,7 @@ bool Object::is_connected(const StringName &p_signal, const Callable &p_callable ERR_FAIL_V_MSG(false, "Nonexistent signal: " + p_signal + "."); } - Callable target = p_callable; - - return s->slot_map.has(*target.get_base_comparator()); + return s->slot_map.has(*p_callable.get_base_comparator()); } void Object::disconnect(const StringName &p_signal, const Callable &p_callable) { diff --git a/core/object/object.h b/core/object/object.h index 7b53fcaa41..fdd1c0b267 100644 --- a/core/object/object.h +++ b/core/object/object.h @@ -656,7 +656,7 @@ private: friend class RefCounted; bool type_is_reference = false; - std::mutex _instance_binding_mutex; + BinaryMutex _instance_binding_mutex; struct InstanceBinding { void *binding = nullptr; void *token = nullptr; diff --git a/core/object/script_language.cpp b/core/object/script_language.cpp index 086f8a666e..0b2d5e41cf 100644 --- a/core/object/script_language.cpp +++ b/core/object/script_language.cpp @@ -138,6 +138,8 @@ void Script::_bind_methods() { ClassDB::bind_method(D_METHOD("get_base_script"), &Script::get_base_script); ClassDB::bind_method(D_METHOD("get_instance_base_type"), &Script::get_instance_base_type); + ClassDB::bind_method(D_METHOD("get_global_name"), &Script::get_global_name); + ClassDB::bind_method(D_METHOD("has_script_signal", "signal_name"), &Script::has_script_signal); ClassDB::bind_method(D_METHOD("get_script_property_list"), &Script::_get_script_property_list); @@ -631,6 +633,10 @@ bool PlaceHolderScriptInstance::has_method(const StringName &p_method) const { void PlaceHolderScriptInstance::update(const List<PropertyInfo> &p_properties, const HashMap<StringName, Variant> &p_values) { HashSet<StringName> new_values; for (const PropertyInfo &E : p_properties) { + if (E.usage & (PROPERTY_USAGE_GROUP | PROPERTY_USAGE_SUBGROUP | PROPERTY_USAGE_CATEGORY)) { + continue; + } + StringName n = E.name; new_values.insert(n); diff --git a/core/object/worker_thread_pool.cpp b/core/object/worker_thread_pool.cpp index 784acadab4..631767219f 100644 --- a/core/object/worker_thread_pool.cpp +++ b/core/object/worker_thread_pool.cpp @@ -535,6 +535,11 @@ void WorkerThreadPool::wait_for_group_task_completion(GroupID p_group) { task_mutex.unlock(); } +int WorkerThreadPool::get_thread_index() { + Thread::ID tid = Thread::get_caller_id(); + return singleton->thread_ids.has(tid) ? singleton->thread_ids[tid] : -1; +} + void WorkerThreadPool::init(int p_thread_count, bool p_use_native_threads_low_priority, float p_low_priority_task_ratio) { ERR_FAIL_COND(threads.size() > 0); if (p_thread_count < 0) { diff --git a/core/object/worker_thread_pool.h b/core/object/worker_thread_pool.h index f323a979f7..dd56f95cae 100644 --- a/core/object/worker_thread_pool.h +++ b/core/object/worker_thread_pool.h @@ -197,6 +197,8 @@ public: _FORCE_INLINE_ int get_thread_count() const { return threads.size(); } static WorkerThreadPool *get_singleton() { return singleton; } + static int get_thread_index(); + void init(int p_thread_count = -1, bool p_use_native_threads_low_priority = true, float p_low_priority_task_ratio = 0.3); void finish(); WorkerThreadPool(); diff --git a/core/os/condition_variable.h b/core/os/condition_variable.h index 6037ff327d..6a6996019d 100644 --- a/core/os/condition_variable.h +++ b/core/os/condition_variable.h @@ -31,7 +31,14 @@ #ifndef CONDITION_VARIABLE_H #define CONDITION_VARIABLE_H +#ifdef MINGW_ENABLED +#define MINGW_STDTHREAD_REDUNDANCY_WARNING +#include "thirdparty/mingw-std-threads/mingw.condition_variable.h" +#define THREADING_NAMESPACE mingw_stdthread +#else #include <condition_variable> +#define THREADING_NAMESPACE std +#endif // An object one or multiple threads can wait on a be notified by some other. // Normally, you want to use a semaphore for such scenarios, but when the @@ -40,12 +47,12 @@ // own mutex to tie the wait-notify to some other behavior, you need to use this. class ConditionVariable { - mutable std::condition_variable condition; + mutable THREADING_NAMESPACE::condition_variable condition; public: template <class BinaryMutexT> _ALWAYS_INLINE_ void wait(const MutexLock<BinaryMutexT> &p_lock) const { - condition.wait(const_cast<std::unique_lock<std::mutex> &>(p_lock.lock)); + condition.wait(const_cast<THREADING_NAMESPACE::unique_lock<THREADING_NAMESPACE::mutex> &>(p_lock.lock)); } _ALWAYS_INLINE_ void notify_one() const { diff --git a/core/os/mutex.cpp b/core/os/mutex.cpp index 7dbb60590b..5d4e457c5f 100644 --- a/core/os/mutex.cpp +++ b/core/os/mutex.cpp @@ -40,7 +40,7 @@ void _global_unlock() { _global_mutex.unlock(); } -template class MutexImpl<std::recursive_mutex>; -template class MutexImpl<std::mutex>; -template class MutexLock<MutexImpl<std::recursive_mutex>>; -template class MutexLock<MutexImpl<std::mutex>>; +template class MutexImpl<THREADING_NAMESPACE::recursive_mutex>; +template class MutexImpl<THREADING_NAMESPACE::mutex>; +template class MutexLock<MutexImpl<THREADING_NAMESPACE::recursive_mutex>>; +template class MutexLock<MutexImpl<THREADING_NAMESPACE::mutex>>; diff --git a/core/os/mutex.h b/core/os/mutex.h index cee0f8af74..03af48ca7c 100644 --- a/core/os/mutex.h +++ b/core/os/mutex.h @@ -34,7 +34,14 @@ #include "core/error/error_macros.h" #include "core/typedefs.h" +#ifdef MINGW_ENABLED +#define MINGW_STDTHREAD_REDUNDANCY_WARNING +#include "thirdparty/mingw-std-threads/mingw.mutex.h" +#define THREADING_NAMESPACE mingw_stdthread +#else #include <mutex> +#define THREADING_NAMESPACE std +#endif template <class MutexT> class MutexLock; @@ -73,9 +80,9 @@ template <int Tag> class SafeBinaryMutex { friend class MutexLock<SafeBinaryMutex>; - using StdMutexType = std::mutex; + using StdMutexType = THREADING_NAMESPACE::mutex; - mutable std::mutex mutex; + mutable THREADING_NAMESPACE::mutex mutex; static thread_local uint32_t count; public: @@ -115,7 +122,7 @@ template <class MutexT> class MutexLock { friend class ConditionVariable; - std::unique_lock<typename MutexT::StdMutexType> lock; + THREADING_NAMESPACE::unique_lock<typename MutexT::StdMutexType> lock; public: _ALWAYS_INLINE_ explicit MutexLock(const MutexT &p_mutex) : @@ -128,7 +135,7 @@ template <int Tag> class MutexLock<SafeBinaryMutex<Tag>> { friend class ConditionVariable; - std::unique_lock<std::mutex> lock; + THREADING_NAMESPACE::unique_lock<THREADING_NAMESPACE::mutex> lock; public: _ALWAYS_INLINE_ explicit MutexLock(const SafeBinaryMutex<Tag> &p_mutex) : @@ -140,12 +147,12 @@ public: }; }; -using Mutex = MutexImpl<std::recursive_mutex>; // Recursive, for general use -using BinaryMutex = MutexImpl<std::mutex>; // Non-recursive, handle with care +using Mutex = MutexImpl<THREADING_NAMESPACE::recursive_mutex>; // Recursive, for general use +using BinaryMutex = MutexImpl<THREADING_NAMESPACE::mutex>; // Non-recursive, handle with care -extern template class MutexImpl<std::recursive_mutex>; -extern template class MutexImpl<std::mutex>; -extern template class MutexLock<MutexImpl<std::recursive_mutex>>; -extern template class MutexLock<MutexImpl<std::mutex>>; +extern template class MutexImpl<THREADING_NAMESPACE::recursive_mutex>; +extern template class MutexImpl<THREADING_NAMESPACE::mutex>; +extern template class MutexLock<MutexImpl<THREADING_NAMESPACE::recursive_mutex>>; +extern template class MutexLock<MutexImpl<THREADING_NAMESPACE::mutex>>; #endif // MUTEX_H diff --git a/core/os/os.cpp b/core/os/os.cpp index c7390f14ff..26ae286979 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -39,7 +39,15 @@ #include "core/version_generated.gen.h" #include <stdarg.h> + +#ifdef MINGW_ENABLED +#define MINGW_STDTHREAD_REDUNDANCY_WARNING +#include "thirdparty/mingw-std-threads/mingw.thread.h" +#define THREADING_NAMESPACE mingw_stdthread +#else #include <thread> +#define THREADING_NAMESPACE std +#endif OS *OS::singleton = nullptr; uint64_t OS::target_ticks = 0; @@ -359,7 +367,7 @@ String OS::get_unique_id() const { } int OS::get_processor_count() const { - return std::thread::hardware_concurrency(); + return THREADING_NAMESPACE::thread::hardware_concurrency(); } String OS::get_processor_name() const { @@ -618,17 +626,22 @@ String OS::get_benchmark_file() { return benchmark_file; } -void OS::benchmark_begin_measure(const String &p_what) { +void OS::benchmark_begin_measure(const String &p_context, const String &p_what) { #ifdef TOOLS_ENABLED - start_benchmark_from[p_what] = OS::get_singleton()->get_ticks_usec(); + Pair<String, String> mark_key(p_context, p_what); + ERR_FAIL_COND_MSG(benchmark_marks_from.has(mark_key), vformat("Benchmark key '%s:%s' already exists.", p_context, p_what)); + + benchmark_marks_from[mark_key] = OS::get_singleton()->get_ticks_usec(); #endif } -void OS::benchmark_end_measure(const String &p_what) { +void OS::benchmark_end_measure(const String &p_context, const String &p_what) { #ifdef TOOLS_ENABLED - uint64_t total = OS::get_singleton()->get_ticks_usec() - start_benchmark_from[p_what]; - double total_f = double(total) / double(1000000); + Pair<String, String> mark_key(p_context, p_what); + ERR_FAIL_COND_MSG(!benchmark_marks_from.has(mark_key), vformat("Benchmark key '%s:%s' doesn't exist.", p_context, p_what)); - startup_benchmark_json[p_what] = total_f; + uint64_t total = OS::get_singleton()->get_ticks_usec() - benchmark_marks_from[mark_key]; + double total_f = double(total) / double(1000000); + benchmark_marks_final[mark_key] = total_f; #endif } @@ -637,19 +650,33 @@ void OS::benchmark_dump() { if (!use_benchmark) { return; } + if (!benchmark_file.is_empty()) { Ref<FileAccess> f = FileAccess::open(benchmark_file, FileAccess::WRITE); if (f.is_valid()) { + Dictionary benchmark_marks; + for (const KeyValue<Pair<String, String>, double> &E : benchmark_marks_final) { + const String mark_key = vformat("[%s] %s", E.key.first, E.key.second); + benchmark_marks[mark_key] = E.value; + } + Ref<JSON> json; json.instantiate(); - f->store_string(json->stringify(startup_benchmark_json, "\t", false, true)); + f->store_string(json->stringify(benchmark_marks, "\t", false, true)); } } else { - List<Variant> keys; - startup_benchmark_json.get_key_list(&keys); + HashMap<String, String> results; + for (const KeyValue<Pair<String, String>, double> &E : benchmark_marks_final) { + if (E.key.first == "Startup" && !results.has(E.key.first)) { + results.insert(E.key.first, "", true); // Hack to make sure "Startup" always comes first. + } + + results[E.key.first] += vformat("\t\t- %s: %.3f msec.\n", E.key.second, (E.value * 1000)); + } + print_line("BENCHMARK:"); - for (const Variant &K : keys) { - print_line("\t-", K, ": ", startup_benchmark_json[K], +" sec."); + for (const KeyValue<String, String> &E : results) { + print_line(vformat("\t[%s]\n%s", E.key, E.value)); } } #endif diff --git a/core/os/os.h b/core/os/os.h index cc5ebe1bc8..e22514dce3 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -79,8 +79,8 @@ class OS { // For tracking benchmark data bool use_benchmark = false; String benchmark_file; - HashMap<String, uint64_t> start_benchmark_from; - Dictionary startup_benchmark_json; + HashMap<Pair<String, String>, uint64_t, PairHash<String, String>> benchmark_marks_from; + HashMap<Pair<String, String>, double, PairHash<String, String>> benchmark_marks_final; protected: void _set_logger(CompositeLogger *p_logger); @@ -313,8 +313,8 @@ public: bool is_use_benchmark_set(); void set_benchmark_file(const String &p_benchmark_file); String get_benchmark_file(); - virtual void benchmark_begin_measure(const String &p_what); - virtual void benchmark_end_measure(const String &p_what); + virtual void benchmark_begin_measure(const String &p_context, const String &p_what); + virtual void benchmark_end_measure(const String &p_context, const String &p_what); virtual void benchmark_dump(); virtual void process_and_drop_events() {} diff --git a/core/os/rw_lock.h b/core/os/rw_lock.h index a232fcb1ce..e5bb6aec2b 100644 --- a/core/os/rw_lock.h +++ b/core/os/rw_lock.h @@ -33,10 +33,17 @@ #include "core/typedefs.h" +#ifdef MINGW_ENABLED +#define MINGW_STDTHREAD_REDUNDANCY_WARNING +#include "thirdparty/mingw-std-threads/mingw.shared_mutex.h" +#define THREADING_NAMESPACE mingw_stdthread +#else #include <shared_mutex> +#define THREADING_NAMESPACE std +#endif class RWLock { - mutable std::shared_timed_mutex mutex; + mutable THREADING_NAMESPACE::shared_timed_mutex mutex; public: // Lock the RWLock, block if locked by someone else. diff --git a/core/os/semaphore.h b/core/os/semaphore.h index 66dfb3ee02..8bb1529bbd 100644 --- a/core/os/semaphore.h +++ b/core/os/semaphore.h @@ -37,13 +37,21 @@ #include "core/error/error_macros.h" #endif +#ifdef MINGW_ENABLED +#define MINGW_STDTHREAD_REDUNDANCY_WARNING +#include "thirdparty/mingw-std-threads/mingw.condition_variable.h" +#include "thirdparty/mingw-std-threads/mingw.mutex.h" +#define THREADING_NAMESPACE mingw_stdthread +#else #include <condition_variable> #include <mutex> +#define THREADING_NAMESPACE std +#endif class Semaphore { private: - mutable std::mutex mutex; - mutable std::condition_variable condition; + mutable THREADING_NAMESPACE::mutex mutex; + mutable THREADING_NAMESPACE::condition_variable condition; mutable uint32_t count = 0; // Initialized as locked. #ifdef DEBUG_ENABLED mutable uint32_t awaiters = 0; @@ -57,7 +65,7 @@ public: } _ALWAYS_INLINE_ void wait() const { - std::unique_lock lock(mutex); + THREADING_NAMESPACE::unique_lock lock(mutex); #ifdef DEBUG_ENABLED ++awaiters; #endif @@ -116,7 +124,7 @@ public: "A Semaphore object is being destroyed while one or more threads are still waiting on it.\n" "Please call post() on it as necessary to prevent such a situation and so ensure correct cleanup."); // And now, the hacky countermeasure (i.e., leak the condition variable). - new (&condition) std::condition_variable(); + new (&condition) THREADING_NAMESPACE::condition_variable(); } } #endif diff --git a/core/os/thread.cpp b/core/os/thread.cpp index 03e2c5409d..2ba90ba42c 100644 --- a/core/os/thread.cpp +++ b/core/os/thread.cpp @@ -69,8 +69,7 @@ void Thread::callback(ID p_caller_id, const Settings &p_settings, Callback p_cal Thread::ID Thread::start(Thread::Callback p_callback, void *p_user, const Settings &p_settings) { ERR_FAIL_COND_V_MSG(id != UNASSIGNED_ID, UNASSIGNED_ID, "A Thread object has been re-started without wait_to_finish() having been called on it."); id = id_counter.increment(); - std::thread new_thread(&Thread::callback, id, p_settings, p_callback, p_user); - thread.swap(new_thread); + thread = THREADING_NAMESPACE::thread(&Thread::callback, id, p_settings, p_callback, p_user); return id; } @@ -82,8 +81,7 @@ void Thread::wait_to_finish() { ERR_FAIL_COND_MSG(id == UNASSIGNED_ID, "Attempt of waiting to finish on a thread that was never started."); ERR_FAIL_COND_MSG(id == get_caller_id(), "Threads can't wait to finish on themselves, another thread must wait."); thread.join(); - std::thread empty_thread; - thread.swap(empty_thread); + thread = THREADING_NAMESPACE::thread(); id = UNASSIGNED_ID; } diff --git a/core/os/thread.h b/core/os/thread.h index 3e307adfff..cc954678f9 100644 --- a/core/os/thread.h +++ b/core/os/thread.h @@ -42,7 +42,14 @@ #include "core/templates/safe_refcount.h" #include "core/typedefs.h" +#ifdef MINGW_ENABLED +#define MINGW_STDTHREAD_REDUNDANCY_WARNING +#include "thirdparty/mingw-std-threads/mingw.thread.h" +#define THREADING_NAMESPACE mingw_stdthread +#else #include <thread> +#define THREADING_NAMESPACE std +#endif class String; @@ -82,7 +89,7 @@ private: ID id = UNASSIGNED_ID; static SafeNumeric<uint64_t> id_counter; static thread_local ID caller_id; - std::thread thread; + THREADING_NAMESPACE::thread thread; static void callback(ID p_caller_id, const Settings &p_settings, Thread::Callback p_callback, void *p_userdata); diff --git a/core/register_core_types.cpp b/core/register_core_types.cpp index 4ad9dd43c4..2785d1daa5 100644 --- a/core/register_core_types.cpp +++ b/core/register_core_types.cpp @@ -120,7 +120,8 @@ static ResourceUID *resource_uid = nullptr; static bool _is_core_extensions_registered = false; void register_core_types() { - OS::get_singleton()->benchmark_begin_measure("register_core_types"); + OS::get_singleton()->benchmark_begin_measure("Core", "Register Types"); + //consistency check static_assert(sizeof(Callable) <= 16); @@ -296,7 +297,7 @@ void register_core_types() { worker_thread_pool = memnew(WorkerThreadPool); - OS::get_singleton()->benchmark_end_measure("register_core_types"); + OS::get_singleton()->benchmark_end_measure("Core", "Register Types"); } void register_core_settings() { @@ -311,6 +312,8 @@ void register_core_settings() { } void register_core_singletons() { + OS::get_singleton()->benchmark_begin_measure("Core", "Register Singletons"); + GDREGISTER_CLASS(ProjectSettings); GDREGISTER_ABSTRACT_CLASS(IP); GDREGISTER_CLASS(core_bind::Geometry2D); @@ -346,25 +349,35 @@ void register_core_singletons() { Engine::get_singleton()->add_singleton(Engine::Singleton("GDExtensionManager", GDExtensionManager::get_singleton())); Engine::get_singleton()->add_singleton(Engine::Singleton("ResourceUID", ResourceUID::get_singleton())); Engine::get_singleton()->add_singleton(Engine::Singleton("WorkerThreadPool", worker_thread_pool)); + + OS::get_singleton()->benchmark_end_measure("Core", "Register Singletons"); } void register_core_extensions() { + OS::get_singleton()->benchmark_begin_measure("Core", "Register Extensions"); + // Hardcoded for now. GDExtension::initialize_gdextensions(); gdextension_manager->load_extensions(); gdextension_manager->initialize_extensions(GDExtension::INITIALIZATION_LEVEL_CORE); _is_core_extensions_registered = true; + + OS::get_singleton()->benchmark_end_measure("Core", "Register Extensions"); } void unregister_core_extensions() { + OS::get_singleton()->benchmark_begin_measure("Core", "Unregister Extensions"); + if (_is_core_extensions_registered) { gdextension_manager->deinitialize_extensions(GDExtension::INITIALIZATION_LEVEL_CORE); } GDExtension::finalize_gdextensions(); + + OS::get_singleton()->benchmark_end_measure("Core", "Unregister Extensions"); } void unregister_core_types() { - OS::get_singleton()->benchmark_begin_measure("unregister_core_types"); + OS::get_singleton()->benchmark_begin_measure("Core", "Unregister Types"); // Destroy singletons in reverse order to ensure dependencies are not broken. @@ -435,5 +448,5 @@ void unregister_core_types() { CoreStringNames::free(); StringName::cleanup(); - OS::get_singleton()->benchmark_end_measure("unregister_core_types"); + OS::get_singleton()->benchmark_end_measure("Core", "Unregister Types"); } diff --git a/core/string/translation.cpp b/core/string/translation.cpp index a443ed308d..8fcf2b24b5 100644 --- a/core/string/translation.cpp +++ b/core/string/translation.cpp @@ -518,8 +518,12 @@ String TranslationServer::get_country_name(const String &p_country) const { } void TranslationServer::set_locale(const String &p_locale) { - locale = standardize_locale(p_locale); + String new_locale = standardize_locale(p_locale); + if (locale == new_locale) { + return; + } + locale = new_locale; ResourceLoader::reload_translation_remaps(); if (OS::get_singleton()->get_main_loop()) { diff --git a/core/string/ustring.cpp b/core/string/ustring.cpp index 60e2d539f8..a24cff4f11 100644 --- a/core/string/ustring.cpp +++ b/core/string/ustring.cpp @@ -305,7 +305,11 @@ void String::copy_from(const char *p_cstr) { char32_t *dst = this->ptrw(); for (size_t i = 0; i <= len; i++) { +#if CHAR_MIN == 0 + uint8_t c = p_cstr[i]; +#else uint8_t c = p_cstr[i] >= 0 ? p_cstr[i] : uint8_t(256 + p_cstr[i]); +#endif if (c == 0 && i < len) { print_unicode_error("NUL character", true); dst[i] = _replacement_char; @@ -338,7 +342,11 @@ void String::copy_from(const char *p_cstr, const int p_clip_to) { char32_t *dst = this->ptrw(); for (int i = 0; i < len; i++) { +#if CHAR_MIN == 0 + uint8_t c = p_cstr[i]; +#else uint8_t c = p_cstr[i] >= 0 ? p_cstr[i] : uint8_t(256 + p_cstr[i]); +#endif if (c == 0) { print_unicode_error("NUL character", true); dst[i] = _replacement_char; @@ -544,7 +552,11 @@ String &String::operator+=(const char *p_str) { char32_t *dst = ptrw() + lhs_len; for (size_t i = 0; i <= rhs_len; i++) { +#if CHAR_MIN == 0 + uint8_t c = p_str[i]; +#else uint8_t c = p_str[i] >= 0 ? p_str[i] : uint8_t(256 + p_str[i]); +#endif if (c == 0 && i < rhs_len) { print_unicode_error("NUL character", true); dst[i] = _replacement_char; @@ -1814,7 +1826,11 @@ Error String::parse_utf8(const char *p_utf8, int p_len, bool p_skip_cr) { int skip = 0; uint8_t c_start = 0; while (ptrtmp != ptrtmp_limit && *ptrtmp) { +#if CHAR_MIN == 0 + uint8_t c = *ptrtmp; +#else uint8_t c = *ptrtmp >= 0 ? *ptrtmp : uint8_t(256 + *ptrtmp); +#endif if (skip == 0) { if (p_skip_cr && c == '\r') { @@ -1882,7 +1898,11 @@ Error String::parse_utf8(const char *p_utf8, int p_len, bool p_skip_cr) { int skip = 0; uint32_t unichar = 0; while (cstr_size) { +#if CHAR_MIN == 0 + uint8_t c = *p_utf8; +#else uint8_t c = *p_utf8 >= 0 ? *p_utf8 : uint8_t(256 + *p_utf8); +#endif if (skip == 0) { if (p_skip_cr && c == '\r') { @@ -4822,6 +4842,7 @@ String String::sprintf(const Array &values, bool *error) const { bool pad_with_zeros = false; bool left_justified = false; bool show_sign = false; + bool as_unsigned = false; if (error) { *error = true; @@ -4862,16 +4883,27 @@ String String::sprintf(const Array &values, bool *error) const { case 'x': break; case 'X': - base = 16; capitalize = true; break; } // Get basic number. - String str = String::num_int64(ABS(value), base, capitalize); + String str; + if (!as_unsigned) { + str = String::num_int64(ABS(value), base, capitalize); + } else { + uint64_t uvalue = *((uint64_t *)&value); + // In unsigned hex, if the value fits in 32 bits, trim it down to that. + if (base == 16 && value < 0 && value >= INT32_MIN) { + uvalue &= 0xffffffff; + } + str = String::num_uint64(uvalue, base, capitalize); + } int number_len = str.length(); + bool negative = value < 0 && !as_unsigned; + // Padding. - int pad_chars_count = (value < 0 || show_sign) ? min_chars - 1 : min_chars; + int pad_chars_count = (negative || show_sign) ? min_chars - 1 : min_chars; String pad_char = pad_with_zeros ? String("0") : String(" "); if (left_justified) { str = str.rpad(pad_chars_count, pad_char); @@ -4880,8 +4912,8 @@ String String::sprintf(const Array &values, bool *error) const { } // Sign. - if (show_sign || value < 0) { - String sign_char = value < 0 ? "-" : "+"; + if (show_sign || negative) { + String sign_char = negative ? "-" : "+"; if (left_justified) { str = str.insert(0, sign_char); } else { @@ -5074,6 +5106,10 @@ String String::sprintf(const Array &values, bool *error) const { show_sign = true; break; } + case 'u': { // Treat as unsigned (for int/hex). + as_unsigned = true; + break; + } case '0': case '1': case '2': diff --git a/core/templates/hashfuncs.h b/core/templates/hashfuncs.h index 2a212f3dcb..05960292f5 100644 --- a/core/templates/hashfuncs.h +++ b/core/templates/hashfuncs.h @@ -310,7 +310,7 @@ struct HashMapHasherDefault { static _FORCE_INLINE_ uint32_t hash(const char16_t p_uchar) { return hash_fmix32(p_uchar); } static _FORCE_INLINE_ uint32_t hash(const char32_t p_uchar) { return hash_fmix32(p_uchar); } static _FORCE_INLINE_ uint32_t hash(const RID &p_rid) { return hash_one_uint64(p_rid.get_id()); } - static _FORCE_INLINE_ uint32_t hash(const CharString &p_char_string) { return hash_djb2(p_char_string.ptr()); } + static _FORCE_INLINE_ uint32_t hash(const CharString &p_char_string) { return hash_djb2(p_char_string.get_data()); } static _FORCE_INLINE_ uint32_t hash(const StringName &p_string_name) { return p_string_name.hash(); } static _FORCE_INLINE_ uint32_t hash(const NodePath &p_path) { return p_path.hash(); } static _FORCE_INLINE_ uint32_t hash(const ObjectID &p_id) { return hash_one_uint64(p_id); } diff --git a/core/templates/list.h b/core/templates/list.h index 6393b942ff..354e826a43 100644 --- a/core/templates/list.h +++ b/core/templates/list.h @@ -132,6 +132,8 @@ public: data->erase(this); } + void transfer_to_back(List<T, A> *p_dst_list); + _FORCE_INLINE_ Element() {} }; @@ -762,4 +764,41 @@ public: } }; +template <class T, class A> +void List<T, A>::Element::transfer_to_back(List<T, A> *p_dst_list) { + // Detach from current. + + if (data->first == this) { + data->first = data->first->next_ptr; + } + if (data->last == this) { + data->last = data->last->prev_ptr; + } + if (prev_ptr) { + prev_ptr->next_ptr = next_ptr; + } + if (next_ptr) { + next_ptr->prev_ptr = prev_ptr; + } + data->size_cache--; + + // Attach to the back of the new one. + + if (!p_dst_list->_data) { + p_dst_list->_data = memnew_allocator(_Data, A); + p_dst_list->_data->first = this; + p_dst_list->_data->last = nullptr; + p_dst_list->_data->size_cache = 0; + prev_ptr = nullptr; + } else { + p_dst_list->_data->last->next_ptr = this; + prev_ptr = p_dst_list->_data->last; + } + p_dst_list->_data->last = this; + next_ptr = nullptr; + + data = p_dst_list->_data; + p_dst_list->_data->size_cache++; +} + #endif // LIST_H diff --git a/core/variant/callable_bind.cpp b/core/variant/callable_bind.cpp index 9a6380a55f..6d6c60cbd4 100644 --- a/core/variant/callable_bind.cpp +++ b/core/variant/callable_bind.cpp @@ -133,7 +133,7 @@ void CallableCustomBind::get_bound_arguments(Vector<Variant> &r_arguments, int & } void CallableCustomBind::call(const Variant **p_arguments, int p_argcount, Variant &r_return_value, Callable::CallError &r_call_error) const { - const Variant **args = (const Variant **)alloca(sizeof(const Variant **) * (binds.size() + p_argcount)); + const Variant **args = (const Variant **)alloca(sizeof(Variant *) * (binds.size() + p_argcount)); for (int i = 0; i < p_argcount; i++) { args[i] = (const Variant *)p_arguments[i]; } @@ -145,7 +145,7 @@ void CallableCustomBind::call(const Variant **p_arguments, int p_argcount, Varia } Error CallableCustomBind::rpc(int p_peer_id, const Variant **p_arguments, int p_argcount, Callable::CallError &r_call_error) const { - const Variant **args = (const Variant **)alloca(sizeof(const Variant **) * (binds.size() + p_argcount)); + const Variant **args = (const Variant **)alloca(sizeof(Variant *) * (binds.size() + p_argcount)); for (int i = 0; i < p_argcount; i++) { args[i] = (const Variant *)p_arguments[i]; } diff --git a/core/variant/dictionary.cpp b/core/variant/dictionary.cpp index 141ce25fa6..8b61a8993a 100644 --- a/core/variant/dictionary.cpp +++ b/core/variant/dictionary.cpp @@ -150,6 +150,15 @@ Variant Dictionary::get(const Variant &p_key, const Variant &p_default) const { return *result; } +Variant Dictionary::get_or_add(const Variant &p_key, const Variant &p_default) { + const Variant *result = getptr(p_key); + if (!result) { + operator[](p_key) = p_default; + return p_default; + } + return *result; +} + int Dictionary::size() const { return _p->variant_map.size(); } diff --git a/core/variant/dictionary.h b/core/variant/dictionary.h index 8935d35ed9..f94a0da80a 100644 --- a/core/variant/dictionary.h +++ b/core/variant/dictionary.h @@ -58,6 +58,7 @@ public: Variant get_valid(const Variant &p_key) const; Variant get(const Variant &p_key, const Variant &p_default) const; + Variant get_or_add(const Variant &p_key, const Variant &p_default); int size() const; bool is_empty() const; diff --git a/core/variant/variant.cpp b/core/variant/variant.cpp index 4c0212075b..c352d800f9 100644 --- a/core/variant/variant.cpp +++ b/core/variant/variant.cpp @@ -931,7 +931,7 @@ bool Variant::is_zero() const { return *reinterpret_cast<const ::RID *>(_data._mem) == ::RID(); } case OBJECT: { - return _get_obj().obj == nullptr; + return get_validated_object() == nullptr; } case CALLABLE: { return reinterpret_cast<const Callable *>(_data._mem)->is_null(); diff --git a/core/variant/variant.h b/core/variant/variant.h index 21342ae6ef..17e701cf66 100644 --- a/core/variant/variant.h +++ b/core/variant/variant.h @@ -338,6 +338,9 @@ public: _FORCE_INLINE_ bool is_num() const { return type == INT || type == FLOAT; } + _FORCE_INLINE_ bool is_string() const { + return type == STRING || type == STRING_NAME; + } _FORCE_INLINE_ bool is_array() const { return type >= ARRAY; } diff --git a/core/variant/variant_call.cpp b/core/variant/variant_call.cpp index f041d2c95e..7121b4da96 100644 --- a/core/variant/variant_call.cpp +++ b/core/variant/variant_call.cpp @@ -2195,6 +2195,7 @@ static void _register_variant_builtin_methods() { bind_method(Dictionary, values, sarray(), varray()); bind_method(Dictionary, duplicate, sarray("deep"), varray(false)); bind_method(Dictionary, get, sarray("key", "default"), varray(Variant())); + bind_method(Dictionary, get_or_add, sarray("key", "default"), varray(Variant())); bind_method(Dictionary, make_read_only, sarray(), varray()); bind_method(Dictionary, is_read_only, sarray(), varray()); diff --git a/core/variant/variant_internal.h b/core/variant/variant_internal.h index 116210e8de..171074188f 100644 --- a/core/variant/variant_internal.h +++ b/core/variant/variant_internal.h @@ -1302,192 +1302,192 @@ struct VariantInitializer<Object *> { }; template <class T> -struct VariantZeroAssigner { +struct VariantDefaultInitializer { }; template <> -struct VariantZeroAssigner<bool> { - static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_bool(v) = false; } +struct VariantDefaultInitializer<bool> { + static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_bool(v) = false; } }; template <> -struct VariantZeroAssigner<int64_t> { - static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_int(v) = 0; } +struct VariantDefaultInitializer<int64_t> { + static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_int(v) = 0; } }; template <> -struct VariantZeroAssigner<double> { - static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_float(v) = 0.0; } +struct VariantDefaultInitializer<double> { + static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_float(v) = 0.0; } }; template <> -struct VariantZeroAssigner<float> { - static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_float(v) = 0.0; } +struct VariantDefaultInitializer<float> { + static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_float(v) = 0.0; } }; template <> -struct VariantZeroAssigner<String> { - static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_string(v) = String(); } +struct VariantDefaultInitializer<String> { + static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_string(v) = String(); } }; template <> -struct VariantZeroAssigner<Vector2> { - static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_vector2(v) = Vector2(); } +struct VariantDefaultInitializer<Vector2> { + static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_vector2(v) = Vector2(); } }; template <> -struct VariantZeroAssigner<Vector2i> { - static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_vector2i(v) = Vector2i(); } +struct VariantDefaultInitializer<Vector2i> { + static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_vector2i(v) = Vector2i(); } }; template <> -struct VariantZeroAssigner<Rect2> { - static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_rect2(v) = Rect2(); } +struct VariantDefaultInitializer<Rect2> { + static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_rect2(v) = Rect2(); } }; template <> -struct VariantZeroAssigner<Rect2i> { - static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_rect2i(v) = Rect2i(); } +struct VariantDefaultInitializer<Rect2i> { + static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_rect2i(v) = Rect2i(); } }; template <> -struct VariantZeroAssigner<Vector3> { - static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_vector3(v) = Vector3(); } +struct VariantDefaultInitializer<Vector3> { + static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_vector3(v) = Vector3(); } }; template <> -struct VariantZeroAssigner<Vector3i> { - static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_vector3i(v) = Vector3i(); } +struct VariantDefaultInitializer<Vector3i> { + static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_vector3i(v) = Vector3i(); } }; template <> -struct VariantZeroAssigner<Vector4> { - static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_vector4(v) = Vector4(); } +struct VariantDefaultInitializer<Vector4> { + static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_vector4(v) = Vector4(); } }; template <> -struct VariantZeroAssigner<Vector4i> { - static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_vector4i(v) = Vector4i(); } +struct VariantDefaultInitializer<Vector4i> { + static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_vector4i(v) = Vector4i(); } }; template <> -struct VariantZeroAssigner<Transform2D> { - static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_transform2d(v) = Transform2D(); } +struct VariantDefaultInitializer<Transform2D> { + static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_transform2d(v) = Transform2D(); } }; template <> -struct VariantZeroAssigner<Plane> { - static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_plane(v) = Plane(); } +struct VariantDefaultInitializer<Plane> { + static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_plane(v) = Plane(); } }; template <> -struct VariantZeroAssigner<Quaternion> { - static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_quaternion(v) = Quaternion(); } +struct VariantDefaultInitializer<Quaternion> { + static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_quaternion(v) = Quaternion(); } }; template <> -struct VariantZeroAssigner<AABB> { - static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_aabb(v) = AABB(); } +struct VariantDefaultInitializer<AABB> { + static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_aabb(v) = AABB(); } }; template <> -struct VariantZeroAssigner<Basis> { - static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_basis(v) = Basis(); } +struct VariantDefaultInitializer<Basis> { + static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_basis(v) = Basis(); } }; template <> -struct VariantZeroAssigner<Transform3D> { - static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_transform(v) = Transform3D(); } +struct VariantDefaultInitializer<Transform3D> { + static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_transform(v) = Transform3D(); } }; template <> -struct VariantZeroAssigner<Projection> { - static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_projection(v) = Projection(); } +struct VariantDefaultInitializer<Projection> { + static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_projection(v) = Projection(); } }; template <> -struct VariantZeroAssigner<Color> { - static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_color(v) = Color(); } +struct VariantDefaultInitializer<Color> { + static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_color(v) = Color(); } }; template <> -struct VariantZeroAssigner<StringName> { - static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_string_name(v) = StringName(); } +struct VariantDefaultInitializer<StringName> { + static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_string_name(v) = StringName(); } }; template <> -struct VariantZeroAssigner<NodePath> { - static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_node_path(v) = NodePath(); } +struct VariantDefaultInitializer<NodePath> { + static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_node_path(v) = NodePath(); } }; template <> -struct VariantZeroAssigner<::RID> { - static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_rid(v) = RID(); } +struct VariantDefaultInitializer<::RID> { + static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_rid(v) = RID(); } }; template <> -struct VariantZeroAssigner<Callable> { - static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_callable(v) = Callable(); } +struct VariantDefaultInitializer<Callable> { + static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_callable(v) = Callable(); } }; template <> -struct VariantZeroAssigner<Signal> { - static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_signal(v) = Signal(); } +struct VariantDefaultInitializer<Signal> { + static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_signal(v) = Signal(); } }; template <> -struct VariantZeroAssigner<Dictionary> { - static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_dictionary(v) = Dictionary(); } +struct VariantDefaultInitializer<Dictionary> { + static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_dictionary(v) = Dictionary(); } }; template <> -struct VariantZeroAssigner<Array> { - static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_array(v) = Array(); } +struct VariantDefaultInitializer<Array> { + static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_array(v) = Array(); } }; template <> -struct VariantZeroAssigner<PackedByteArray> { - static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_byte_array(v) = PackedByteArray(); } +struct VariantDefaultInitializer<PackedByteArray> { + static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_byte_array(v) = PackedByteArray(); } }; template <> -struct VariantZeroAssigner<PackedInt32Array> { - static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_int32_array(v) = PackedInt32Array(); } +struct VariantDefaultInitializer<PackedInt32Array> { + static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_int32_array(v) = PackedInt32Array(); } }; template <> -struct VariantZeroAssigner<PackedInt64Array> { - static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_int64_array(v) = PackedInt64Array(); } +struct VariantDefaultInitializer<PackedInt64Array> { + static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_int64_array(v) = PackedInt64Array(); } }; template <> -struct VariantZeroAssigner<PackedFloat32Array> { - static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_float32_array(v) = PackedFloat32Array(); } +struct VariantDefaultInitializer<PackedFloat32Array> { + static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_float32_array(v) = PackedFloat32Array(); } }; template <> -struct VariantZeroAssigner<PackedFloat64Array> { - static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_float64_array(v) = PackedFloat64Array(); } +struct VariantDefaultInitializer<PackedFloat64Array> { + static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_float64_array(v) = PackedFloat64Array(); } }; template <> -struct VariantZeroAssigner<PackedStringArray> { - static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_string_array(v) = PackedStringArray(); } +struct VariantDefaultInitializer<PackedStringArray> { + static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_string_array(v) = PackedStringArray(); } }; template <> -struct VariantZeroAssigner<PackedVector2Array> { - static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_vector2_array(v) = PackedVector2Array(); } +struct VariantDefaultInitializer<PackedVector2Array> { + static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_vector2_array(v) = PackedVector2Array(); } }; template <> -struct VariantZeroAssigner<PackedVector3Array> { - static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_vector3_array(v) = PackedVector3Array(); } +struct VariantDefaultInitializer<PackedVector3Array> { + static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_vector3_array(v) = PackedVector3Array(); } }; template <> -struct VariantZeroAssigner<PackedColorArray> { - static _FORCE_INLINE_ void zero(Variant *v) { *VariantInternal::get_color_array(v) = PackedColorArray(); } +struct VariantDefaultInitializer<PackedColorArray> { + static _FORCE_INLINE_ void init(Variant *v) { *VariantInternal::get_color_array(v) = PackedColorArray(); } }; template <class T> @@ -1504,7 +1504,7 @@ struct VariantTypeChanger { VariantInitializer<T>::init(v); } - VariantZeroAssigner<T>::zero(v); + VariantDefaultInitializer<T>::init(v); } }; diff --git a/core/variant/variant_op.h b/core/variant/variant_op.h index 9e6367ab6d..17ad126891 100644 --- a/core/variant/variant_op.h +++ b/core/variant/variant_op.h @@ -549,14 +549,14 @@ public: class OperatorEvaluatorEqualObject { public: static void evaluate(const Variant &p_left, const Variant &p_right, Variant *r_ret, bool &r_valid) { - const Object *a = p_left.get_validated_object(); - const Object *b = p_right.get_validated_object(); + const ObjectID &a = VariantInternal::get_object_id(&p_left); + const ObjectID &b = VariantInternal::get_object_id(&p_right); *r_ret = a == b; r_valid = true; } static inline void validated_evaluate(const Variant *left, const Variant *right, Variant *r_ret) { - const Object *a = left->get_validated_object(); - const Object *b = right->get_validated_object(); + const ObjectID &a = VariantInternal::get_object_id(left); + const ObjectID &b = VariantInternal::get_object_id(right); *VariantGetInternalPtr<bool>::get_ptr(r_ret) = a == b; } static void ptr_evaluate(const void *left, const void *right, void *r_ret) { @@ -568,12 +568,12 @@ public: class OperatorEvaluatorEqualObjectNil { public: static void evaluate(const Variant &p_left, const Variant &p_right, Variant *r_ret, bool &r_valid) { - const Object *a = p_left.get_validated_object(); + const Object *a = p_left.operator Object *(); *r_ret = a == nullptr; r_valid = true; } static inline void validated_evaluate(const Variant *left, const Variant *right, Variant *r_ret) { - const Object *a = left->get_validated_object(); + const Object *a = left->operator Object *(); *VariantGetInternalPtr<bool>::get_ptr(r_ret) = a == nullptr; } static void ptr_evaluate(const void *left, const void *right, void *r_ret) { @@ -585,12 +585,12 @@ public: class OperatorEvaluatorEqualNilObject { public: static void evaluate(const Variant &p_left, const Variant &p_right, Variant *r_ret, bool &r_valid) { - const Object *b = p_right.get_validated_object(); + const Object *b = p_right.operator Object *(); *r_ret = nullptr == b; r_valid = true; } static inline void validated_evaluate(const Variant *left, const Variant *right, Variant *r_ret) { - const Object *b = right->get_validated_object(); + const Object *b = right->operator Object *(); *VariantGetInternalPtr<bool>::get_ptr(r_ret) = nullptr == b; } static void ptr_evaluate(const void *left, const void *right, void *r_ret) { @@ -620,14 +620,14 @@ public: class OperatorEvaluatorNotEqualObject { public: static void evaluate(const Variant &p_left, const Variant &p_right, Variant *r_ret, bool &r_valid) { - Object *a = p_left.get_validated_object(); - Object *b = p_right.get_validated_object(); + const ObjectID &a = VariantInternal::get_object_id(&p_left); + const ObjectID &b = VariantInternal::get_object_id(&p_right); *r_ret = a != b; r_valid = true; } static inline void validated_evaluate(const Variant *left, const Variant *right, Variant *r_ret) { - Object *a = left->get_validated_object(); - Object *b = right->get_validated_object(); + const ObjectID &a = VariantInternal::get_object_id(left); + const ObjectID &b = VariantInternal::get_object_id(right); *VariantGetInternalPtr<bool>::get_ptr(r_ret) = a != b; } static void ptr_evaluate(const void *left, const void *right, void *r_ret) { @@ -639,12 +639,12 @@ public: class OperatorEvaluatorNotEqualObjectNil { public: static void evaluate(const Variant &p_left, const Variant &p_right, Variant *r_ret, bool &r_valid) { - Object *a = p_left.get_validated_object(); + Object *a = p_left.operator Object *(); *r_ret = a != nullptr; r_valid = true; } static inline void validated_evaluate(const Variant *left, const Variant *right, Variant *r_ret) { - Object *a = left->get_validated_object(); + Object *a = left->operator Object *(); *VariantGetInternalPtr<bool>::get_ptr(r_ret) = a != nullptr; } static void ptr_evaluate(const void *left, const void *right, void *r_ret) { @@ -656,12 +656,12 @@ public: class OperatorEvaluatorNotEqualNilObject { public: static void evaluate(const Variant &p_left, const Variant &p_right, Variant *r_ret, bool &r_valid) { - Object *b = p_right.get_validated_object(); + Object *b = p_right.operator Object *(); *r_ret = nullptr != b; r_valid = true; } static inline void validated_evaluate(const Variant *left, const Variant *right, Variant *r_ret) { - Object *b = right->get_validated_object(); + Object *b = right->operator Object *(); *VariantGetInternalPtr<bool>::get_ptr(r_ret) = nullptr != b; } static void ptr_evaluate(const void *left, const void *right, void *r_ret) { diff --git a/core/variant/variant_parser.cpp b/core/variant/variant_parser.cpp index 86e7654090..e35751fd61 100644 --- a/core/variant/variant_parser.cpp +++ b/core/variant/variant_parser.cpp @@ -1026,7 +1026,10 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream, Ref<Resource> res; Error err = p_res_parser->ext_func(p_res_parser->userdata, p_stream, res, line, r_err_str); if (err) { - return err; + // If the file is missing, the error can be ignored. + if (err != ERR_FILE_NOT_FOUND && err != ERR_CANT_OPEN) { + return err; + } } value = res; diff --git a/doc/Makefile b/doc/Makefile index 53c5c7dcb0..722746f366 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -4,7 +4,7 @@ OUTPUTDIR = $(BASEDIR)/_build TOOLSDIR = $(BASEDIR)/tools JSDIR = "$(BASEDIR)/../platform/web" LANGARG ?= en -LANGCMD = -l $(LANGARG) +TOOLSOPT ?= .ONESHELL: @@ -19,7 +19,10 @@ doxygen: rst: rm -rf "$(OUTPUTDIR)/rst" mkdir -p "$(OUTPUTDIR)/rst" - python3 "$(TOOLSDIR)/make_rst.py" -o "$(OUTPUTDIR)/rst" "$(LANGCMD)" $(CLASSES) + python3 "$(TOOLSDIR)/make_rst.py" -o "$(OUTPUTDIR)/rst" -l "$(LANGARG)" $(TOOLSOPT) $(CLASSES) + +xml-check: + python3 "$(TOOLSDIR)/make_rst.py" --dry-run -l "$(LANGARG)" $(TOOLSOPT) $(CLASSES) rstjs: rm -rf "$(OUTPUTDIR)/rstjs" diff --git a/doc/classes/Area2D.xml b/doc/classes/Area2D.xml index 6fa8e4ae9f..98110748ef 100644 --- a/doc/classes/Area2D.xml +++ b/doc/classes/Area2D.xml @@ -6,6 +6,7 @@ <description> [Area2D] is a region of 2D space defined by one or multiple [CollisionShape2D] or [CollisionPolygon2D] child nodes. It detects when other [CollisionObject2D]s enter or exit it, and it also keeps track of which collision objects haven't exited it yet (i.e. which one are overlapping it). This node can also locally alter or override physics parameters (gravity, damping) and route audio to custom audio buses. + [b]Note:[/b] Areas and bodies created with [PhysicsServer2D] might not interact as expected with [Area2D]s, and might not emit signals or track objects correctly. </description> <tutorials> <link title="Using Area2D">$DOCS_URL/tutorials/physics/using_area_2d.html</link> diff --git a/doc/classes/Area3D.xml b/doc/classes/Area3D.xml index 4f89e9b015..918869b83d 100644 --- a/doc/classes/Area3D.xml +++ b/doc/classes/Area3D.xml @@ -6,6 +6,7 @@ <description> [Area3D] is a region of 3D space defined by one or multiple [CollisionShape3D] or [CollisionPolygon3D] child nodes. It detects when other [CollisionObject3D]s enter or exit it, and it also keeps track of which collision objects haven't exited it yet (i.e. which one are overlapping it). This node can also locally alter or override physics parameters (gravity, damping) and route audio to custom audio buses. + [b]Note:[/b] Areas and bodies created with [PhysicsServer3D] might not interact as expected with [Area3D]s, and might not emit signals or track objects correctly. [b]Warning:[/b] Using a [ConcavePolygonShape3D] inside a [CollisionShape3D] child of this node (created e.g. by using the [b]Create Trimesh Collision Sibling[/b] option in the [b]Mesh[/b] menu that appears when selecting a [MeshInstance3D] node) may give unexpected results, since this collision shape is hollow. If this is not desired, it has to be split into multiple [ConvexPolygonShape3D]s or primitive shapes like [BoxShape3D], or in some cases it may be replaceable by a [CollisionPolygon3D]. </description> <tutorials> diff --git a/doc/classes/AudioServer.xml b/doc/classes/AudioServer.xml index 21ad817c6c..5b3fcd67d4 100644 --- a/doc/classes/AudioServer.xml +++ b/doc/classes/AudioServer.xml @@ -311,7 +311,7 @@ Name of the current device for audio output (see [method get_output_device_list]). On systems with multiple audio outputs (such as analog, USB and HDMI audio), this can be used to select the audio output device. The value [code]"Default"[/code] will play audio on the system-wide default audio output. If an invalid device name is set, the value will be reverted back to [code]"Default"[/code]. </member> <member name="playback_speed_scale" type="float" setter="set_playback_speed_scale" getter="get_playback_speed_scale" default="1.0"> - Scales the rate at which audio is played (i.e. setting it to [code]0.5[/code] will make the audio be played at half its speed). + Scales the rate at which audio is played (i.e. setting it to [code]0.5[/code] will make the audio be played at half its speed). See also [member Engine.time_scale] to affect the general simulation speed, which is independent from [member AudioServer.playback_speed_scale]. </member> </members> <signals> diff --git a/doc/classes/BaseMaterial3D.xml b/doc/classes/BaseMaterial3D.xml index c3295d854f..653397ebc3 100644 --- a/doc/classes/BaseMaterial3D.xml +++ b/doc/classes/BaseMaterial3D.xml @@ -501,22 +501,22 @@ Represents the size of the [enum TextureParam] enum. </constant> <constant name="TEXTURE_FILTER_NEAREST" value="0" enum="TextureFilter"> - The texture filter reads from the nearest pixel only. The simplest and fastest method of filtering, but the texture will look pixelized. + The texture filter reads from the nearest pixel only. This makes the texture look pixelated from up close, and grainy from a distance (due to mipmaps not being sampled). </constant> <constant name="TEXTURE_FILTER_LINEAR" value="1" enum="TextureFilter"> - The texture filter blends between the nearest 4 pixels. Use this when you want to avoid a pixelated style, but do not want mipmaps. + The texture filter blends between the nearest 4 pixels. This makes the texture look smooth from up close, and grainy from a distance (due to mipmaps not being sampled). </constant> <constant name="TEXTURE_FILTER_NEAREST_WITH_MIPMAPS" value="2" enum="TextureFilter"> - The texture filter reads from the nearest pixel in the nearest mipmap. The fastest way to read from textures with mipmaps. + The texture filter reads from the nearest pixel and blends between the nearest 2 mipmaps (or uses the nearest mipmap if [member ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter] is [code]true[/code]). This makes the texture look pixelated from up close, and smooth from a distance. </constant> <constant name="TEXTURE_FILTER_LINEAR_WITH_MIPMAPS" value="3" enum="TextureFilter"> - The texture filter blends between the nearest 4 pixels and between the nearest 2 mipmaps. Use this for most cases as mipmaps are important to smooth out pixels that are far from the camera. + The texture filter blends between the nearest 4 pixels and between the nearest 2 mipmaps (or uses the nearest mipmap if [member ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter] is [code]true[/code]). This makes the texture look smooth from up close, and smooth from a distance. </constant> <constant name="TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC" value="4" enum="TextureFilter"> - The texture filter reads from the nearest pixel, but selects a mipmap based on the angle between the surface and the camera view. This reduces artifacts on surfaces that are almost in line with the camera. The anisotropic filtering level can be changed by adjusting [member ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level]. + The texture filter reads from the nearest pixel and blends between 2 mipmaps (or uses the nearest mipmap if [member ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter] is [code]true[/code]) based on the angle between the surface and the camera view. This makes the texture look pixelated from up close, and smooth from a distance. Anisotropic filtering improves texture quality on surfaces that are almost in line with the camera, but is slightly slower. The anisotropic filtering level can be changed by adjusting [member ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level]. </constant> <constant name="TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC" value="5" enum="TextureFilter"> - The texture filter blends between the nearest 4 pixels and selects a mipmap based on the angle between the surface and the camera view. This reduces artifacts on surfaces that are almost in line with the camera. This is the slowest of the filtering options, but results in the highest quality texturing. The anisotropic filtering level can be changed by adjusting [member ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level]. + The texture filter blends between the nearest 4 pixels and blends between 2 mipmaps (or uses the nearest mipmap if [member ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter] is [code]true[/code]) based on the angle between the surface and the camera view. This makes the texture look smooth from up close, and smooth from a distance. Anisotropic filtering improves texture quality on surfaces that are almost in line with the camera, but is slightly slower. The anisotropic filtering level can be changed by adjusting [member ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level]. </constant> <constant name="TEXTURE_FILTER_MAX" value="6" enum="TextureFilter"> Represents the size of the [enum TextureFilter] enum. diff --git a/doc/classes/CameraAttributesPhysical.xml b/doc/classes/CameraAttributesPhysical.xml index 69af64b7ff..faedfee712 100644 --- a/doc/classes/CameraAttributesPhysical.xml +++ b/doc/classes/CameraAttributesPhysical.xml @@ -32,7 +32,7 @@ Only available when [member ProjectSettings.rendering/lights_and_shadows/use_physical_light_units] is enabled. </member> <member name="exposure_shutter_speed" type="float" setter="set_shutter_speed" getter="get_shutter_speed" default="100.0"> - Time for shutter to open and close, measured in seconds. A higher value will let in more light leading to a brighter image, while a lower amount will let in less light leading to a darker image. + Time for shutter to open and close, evaluated as [code]1 / shutter_speed[/code] seconds. A higher value will allow less light (leading to a darker image), while a lower value will allow more light (leading to a brighter image). Only available when [member ProjectSettings.rendering/lights_and_shadows/use_physical_light_units] is enabled. </member> <member name="frustum_far" type="float" setter="set_far" getter="get_far" default="4000.0"> diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index 5a2df0e8a4..2f76f64cff 100644 --- a/doc/classes/CanvasItem.xml +++ b/doc/classes/CanvasItem.xml @@ -660,24 +660,26 @@ The [CanvasItem] will inherit the filter from its parent. </constant> <constant name="TEXTURE_FILTER_NEAREST" value="1" enum="TextureFilter"> - The texture filter reads from the nearest pixel only. The simplest and fastest method of filtering. Useful for pixel art. + The texture filter reads from the nearest pixel only. This makes the texture look pixelated from up close, and grainy from a distance (due to mipmaps not being sampled). </constant> <constant name="TEXTURE_FILTER_LINEAR" value="2" enum="TextureFilter"> - The texture filter blends between the nearest four pixels. Use this for most cases where you want to avoid a pixelated style. + The texture filter blends between the nearest 4 pixels. This makes the texture look smooth from up close, and grainy from a distance (due to mipmaps not being sampled). </constant> <constant name="TEXTURE_FILTER_NEAREST_WITH_MIPMAPS" value="3" enum="TextureFilter"> - The texture filter reads from the nearest pixel in the nearest mipmap. This is the fastest way to read from textures with mipmaps. + The texture filter reads from the nearest pixel and blends between the nearest 2 mipmaps (or uses the nearest mipmap if [member ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter] is [code]true[/code]). This makes the texture look pixelated from up close, and smooth from a distance. + Use this for non-pixel art textures that may be viewed at a low scale (e.g. due to [Camera2D] zoom or sprite scaling), as mipmaps are important to smooth out pixels that are smaller than on-screen pixels. </constant> <constant name="TEXTURE_FILTER_LINEAR_WITH_MIPMAPS" value="4" enum="TextureFilter"> - The texture filter blends between the nearest 4 pixels and between the nearest 2 mipmaps. Use this for non-pixel art textures that may be viewed at a low scale (e.g. due to [Camera2D] zoom), as mipmaps are important to smooth out pixels that are smaller than on-screen pixels. + The texture filter blends between the nearest 4 pixels and between the nearest 2 mipmaps (or uses the nearest mipmap if [member ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter] is [code]true[/code]). This makes the texture look smooth from up close, and smooth from a distance. + Use this for non-pixel art textures that may be viewed at a low scale (e.g. due to [Camera2D] zoom or sprite scaling), as mipmaps are important to smooth out pixels that are smaller than on-screen pixels. </constant> <constant name="TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC" value="5" enum="TextureFilter"> - The texture filter reads from the nearest pixel, but selects a mipmap based on the angle between the surface and the camera view. This reduces artifacts on surfaces that are almost in line with the camera. The anisotropic filtering level can be changed by adjusting [member ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level]. - [b]Note:[/b] This texture filter is rarely useful in 2D projects. [constant TEXTURE_FILTER_NEAREST_WITH_MIPMAPS] is usually more appropriate. + The texture filter reads from the nearest pixel and blends between 2 mipmaps (or uses the nearest mipmap if [member ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter] is [code]true[/code]) based on the angle between the surface and the camera view. This makes the texture look pixelated from up close, and smooth from a distance. Anisotropic filtering improves texture quality on surfaces that are almost in line with the camera, but is slightly slower. The anisotropic filtering level can be changed by adjusting [member ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level]. + [b]Note:[/b] This texture filter is rarely useful in 2D projects. [constant TEXTURE_FILTER_NEAREST_WITH_MIPMAPS] is usually more appropriate in this case. </constant> <constant name="TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC" value="6" enum="TextureFilter"> - The texture filter blends between the nearest 4 pixels and selects a mipmap based on the angle between the surface and the camera view. This reduces artifacts on surfaces that are almost in line with the camera. This is the slowest of the filtering options, but results in the highest quality texturing. The anisotropic filtering level can be changed by adjusting [member ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level]. - [b]Note:[/b] This texture filter is rarely useful in 2D projects. [constant TEXTURE_FILTER_LINEAR_WITH_MIPMAPS] is usually more appropriate. + The texture filter blends between the nearest 4 pixels and blends between 2 mipmaps (or uses the nearest mipmap if [member ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter] is [code]true[/code]) based on the angle between the surface and the camera view. This makes the texture look smooth from up close, and smooth from a distance. Anisotropic filtering improves texture quality on surfaces that are almost in line with the camera, but is slightly slower. The anisotropic filtering level can be changed by adjusting [member ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level]. + [b]Note:[/b] This texture filter is rarely useful in 2D projects. [constant TEXTURE_FILTER_LINEAR_WITH_MIPMAPS] is usually more appropriate in this case. </constant> <constant name="TEXTURE_FILTER_MAX" value="7" enum="TextureFilter"> Represents the size of the [enum TextureFilter] enum. diff --git a/doc/classes/Dictionary.xml b/doc/classes/Dictionary.xml index 955d80fcb7..7a5e51e4ef 100644 --- a/doc/classes/Dictionary.xml +++ b/doc/classes/Dictionary.xml @@ -194,6 +194,14 @@ Returns the corresponding value for the given [param key] in the dictionary. If the [param key] does not exist, returns [param default], or [code]null[/code] if the parameter is omitted. </description> </method> + <method name="get_or_add"> + <return type="Variant" /> + <param index="0" name="key" type="Variant" /> + <param index="1" name="default" type="Variant" default="null" /> + <description> + Gets a value and ensures the key is set. If the [param key] exists in the dictionary, this behaves like [method get]. Otherwise, the [param default] value is inserted into the dictionary and returned. + </description> + </method> <method name="has" qualifiers="const"> <return type="bool" /> <param index="0" name="key" type="Variant" /> diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml index 7f7dc1d288..b8f82accfc 100644 --- a/doc/classes/DisplayServer.xml +++ b/doc/classes/DisplayServer.xml @@ -235,6 +235,9 @@ [codeblock] "_main" - Main menu (macOS). "_dock" - Dock popup menu (macOS). + "_apple" - Apple menu (macOS, custom items added before "Services"). + "_window" - Window menu (macOS, custom items added after "Bring All to Front"). + "_help" - Help menu (macOS). [/codeblock] </description> </method> @@ -258,6 +261,9 @@ [codeblock] "_main" - Main menu (macOS). "_dock" - Dock popup menu (macOS). + "_apple" - Apple menu (macOS, custom items added before "Services"). + "_window" - Window menu (macOS, custom items added after "Bring All to Front"). + "_help" - Help menu (macOS). [/codeblock] </description> </method> @@ -281,6 +287,9 @@ [codeblock] "_main" - Main menu (macOS). "_dock" - Dock popup menu (macOS). + "_apple" - Apple menu (macOS, custom items added before "Services"). + "_window" - Window menu (macOS, custom items added after "Bring All to Front"). + "_help" - Help menu (macOS). [/codeblock] </description> </method> @@ -305,6 +314,9 @@ [codeblock] "_main" - Main menu (macOS). "_dock" - Dock popup menu (macOS). + "_apple" - Apple menu (macOS, custom items added before "Services"). + "_window" - Window menu (macOS, custom items added after "Bring All to Front"). + "_help" - Help menu (macOS). [/codeblock] </description> </method> @@ -327,6 +339,9 @@ [codeblock] "_main" - Main menu (macOS). "_dock" - Dock popup menu (macOS). + "_apple" - Apple menu (macOS, custom items added before "Services"). + "_window" - Window menu (macOS, custom items added after "Bring All to Front"). + "_help" - Help menu (macOS). [/codeblock] </description> </method> @@ -353,6 +368,9 @@ [codeblock] "_main" - Main menu (macOS). "_dock" - Dock popup menu (macOS). + "_apple" - Apple menu (macOS, custom items added before "Services"). + "_window" - Window menu (macOS, custom items added after "Bring All to Front"). + "_help" - Help menu (macOS). [/codeblock] </description> </method> @@ -376,6 +394,9 @@ [codeblock] "_main" - Main menu (macOS). "_dock" - Dock popup menu (macOS). + "_apple" - Apple menu (macOS, custom items added before "Services"). + "_window" - Window menu (macOS, custom items added after "Bring All to Front"). + "_help" - Help menu (macOS). [/codeblock] </description> </method> @@ -391,6 +412,9 @@ [codeblock] "_main" - Main menu (macOS). "_dock" - Dock popup menu (macOS). + "_apple" - Apple menu (macOS, custom items added before "Services"). + "_window" - Window menu (macOS, custom items added after "Bring All to Front"). + "_help" - Help menu (macOS). [/codeblock] </description> </method> @@ -408,6 +432,9 @@ [codeblock] "_main" - Main menu (macOS). "_dock" - Dock popup menu (macOS). + "_apple" - Apple menu (macOS, custom items added before "Services"). + "_window" - Window menu (macOS, custom items added after "Bring All to Front"). + "_help" - Help menu (macOS). [/codeblock] </description> </method> @@ -421,6 +448,9 @@ [codeblock] "_main" - Main menu (macOS). "_dock" - Dock popup menu (macOS). + "_apple" - Apple menu (macOS, custom items added before "Services"). + "_window" - Window menu (macOS, custom items added after "Bring All to Front"). + "_help" - Help menu (macOS). [/codeblock] </description> </method> @@ -549,6 +579,13 @@ [b]Note:[/b] This method is implemented only on macOS. </description> </method> + <method name="global_menu_get_system_menu_roots" qualifiers="const"> + <return type="Dictionary" /> + <description> + Returns Dictionary of supported system menu IDs and names. + [b]Note:[/b] This method is implemented only on macOS. + </description> + </method> <method name="global_menu_is_item_checkable" qualifiers="const"> <return type="bool" /> <param index="0" name="menu_root" type="String" /> diff --git a/doc/classes/EditorSettings.xml b/doc/classes/EditorSettings.xml index 6edd8af7cc..ec051c0545 100644 --- a/doc/classes/EditorSettings.xml +++ b/doc/classes/EditorSettings.xml @@ -665,8 +665,8 @@ <member name="interface/theme/icon_and_font_color" type="int" setter="" getter=""> The icon and font color scheme to use in the editor. - [b]Auto[/b] determines the color scheme to use automatically based on [member interface/theme/base_color]. - - [b]Dark[/b] makes fonts and icons light (suitable for dark themes). - - [b]Light[/b] makes fonts and icons dark (suitable for light themes). Icon colors are automatically converted by the editor following [url=https://github.com/godotengine/godot/blob/master/editor/editor_themes.cpp#L135]this set of rules[/url]. + - [b]Dark[/b] makes fonts and icons dark (suitable for light themes). Icon colors are automatically converted by the editor following the set of rules defined in [url=https://github.com/godotengine/godot/blob/master/editor/editor_themes.cpp]this file[/url]. + - [b]Light[/b] makes fonts and icons light (suitable for dark themes). </member> <member name="interface/theme/icon_saturation" type="float" setter="" getter=""> The saturation to use for editor icons. Higher values result in more vibrant colors. diff --git a/doc/classes/Engine.xml b/doc/classes/Engine.xml index 207cd0bccc..0a544077e4 100644 --- a/doc/classes/Engine.xml +++ b/doc/classes/Engine.xml @@ -307,6 +307,8 @@ </member> <member name="time_scale" type="float" setter="set_time_scale" getter="get_time_scale" default="1.0"> Controls how fast or slow the in-game clock ticks versus the real life one. It defaults to 1.0. A value of 2.0 means the game moves twice as fast as real life, whilst a value of 0.5 means the game moves at half the regular speed. This also affects [Timer] and [SceneTreeTimer] (see [method SceneTree.create_timer] for how to control this). + [b]Note:[/b] This does not affect audio playback speed. Use [member AudioServer.playback_speed_scale] to adjust audio playback speed independently of [member Engine.time_scale]. + [b]Note:[/b] This does not automatically adjust [member physics_ticks_per_second], which means that with time scales above 1.0, physics simulation may become less precise (as each physics tick will stretch over a larger period of engine time). If you're using [member Engine.time_scale] to speed up simulation by a large factor, consider increasing [member physics_ticks_per_second] as well to improve physics reliability. </member> </members> </class> diff --git a/doc/classes/GPUParticles2D.xml b/doc/classes/GPUParticles2D.xml index 2308ec43c5..f4ba305f8b 100644 --- a/doc/classes/GPUParticles2D.xml +++ b/doc/classes/GPUParticles2D.xml @@ -37,6 +37,7 @@ <param index="4" name="flags" type="int" /> <description> Emits a single particle. Whether [param xform], [param velocity], [param color] and [param custom] are applied depends on the value of [param flags]. See [enum EmitFlags]. + The default ParticleProcessMaterial will overwrite [param color] and use the contents of [param custom] as [code](rotation, age, animation, lifetime)[/code]. </description> </method> <method name="restart"> diff --git a/doc/classes/GPUParticles3D.xml b/doc/classes/GPUParticles3D.xml index b5af63a8f4..d1903b85cd 100644 --- a/doc/classes/GPUParticles3D.xml +++ b/doc/classes/GPUParticles3D.xml @@ -35,6 +35,7 @@ <param index="4" name="flags" type="int" /> <description> Emits a single particle. Whether [param xform], [param velocity], [param color] and [param custom] are applied depends on the value of [param flags]. See [enum EmitFlags]. + The default ParticleProcessMaterial will overwrite [param color] and use the contents of [param custom] as [code](rotation, age, animation, lifetime)[/code]. </description> </method> <method name="get_draw_pass_mesh" qualifiers="const"> diff --git a/doc/classes/GraphEdit.xml b/doc/classes/GraphEdit.xml index 410efd6389..9765b10d22 100644 --- a/doc/classes/GraphEdit.xml +++ b/doc/classes/GraphEdit.xml @@ -154,7 +154,7 @@ <method name="get_connection_list" qualifiers="const"> <return type="Dictionary[]" /> <description> - Returns an Array containing the list of connections. A connection consists in a structure of the form [code]{ from_port: 0, from: "GraphNode name 0", to_port: 1, to: "GraphNode name 1" }[/code]. + Returns an Array containing the list of connections. A connection consists in a structure of the form [code]{ from_port: 0, from_node: "GraphNode name 0", to_port: 1, to_node: "GraphNode name 1" }[/code]. </description> </method> <method name="get_menu_hbox"> diff --git a/doc/classes/Input.xml b/doc/classes/Input.xml index 334b04a79c..fc162b0761 100644 --- a/doc/classes/Input.xml +++ b/doc/classes/Input.xml @@ -408,6 +408,12 @@ </method> </methods> <members> + <member name="emulate_mouse_from_touch" type="bool" setter="set_emulate_mouse_from_touch" getter="is_emulating_mouse_from_touch"> + If [code]true[/code], sends mouse input events when tapping or swiping on the touchscreen. See also [member ProjectSettings.input_devices/pointing/emulate_mouse_from_touch]. + </member> + <member name="emulate_touch_from_mouse" type="bool" setter="set_emulate_touch_from_mouse" getter="is_emulating_touch_from_mouse"> + If [code]true[/code], sends touch input events when clicking or dragging the mouse. See also [member ProjectSettings.input_devices/pointing/emulate_touch_from_mouse]. + </member> <member name="mouse_mode" type="int" setter="set_mouse_mode" getter="get_mouse_mode" enum="Input.MouseMode"> Controls the mouse mode. See [enum MouseMode] for more information. </member> diff --git a/doc/classes/Label.xml b/doc/classes/Label.xml index f13f1bdcf4..fda45a42c8 100644 --- a/doc/classes/Label.xml +++ b/doc/classes/Label.xml @@ -45,6 +45,9 @@ <member name="clip_text" type="bool" setter="set_clip_text" getter="is_clipping_text" default="false"> If [code]true[/code], the Label only shows the text that fits inside its bounding rectangle and will clip text horizontally. </member> + <member name="ellipsis_char" type="String" setter="set_ellipsis_char" getter="get_ellipsis_char" default=""…""> + Ellipsis character used for text clipping. + </member> <member name="horizontal_alignment" type="int" setter="set_horizontal_alignment" getter="get_horizontal_alignment" enum="HorizontalAlignment" default="0"> Controls the text's horizontal alignment. Supports left, center, right, and fill, or justify. Set it to one of the [enum HorizontalAlignment] constants. </member> diff --git a/doc/classes/NavigationAgent2D.xml b/doc/classes/NavigationAgent2D.xml index 4df8d4143b..fc7faf9260 100644 --- a/doc/classes/NavigationAgent2D.xml +++ b/doc/classes/NavigationAgent2D.xml @@ -84,8 +84,8 @@ <method name="is_navigation_finished"> <return type="bool" /> <description> - Returns [code]true[/code] if the end of the currently loaded navigation path has been reached. - [b]Note:[/b] While true prefer to stop calling update functions like [method get_next_path_position]. This avoids jittering the standing agent due to calling repeated path updates. + Returns [code]true[/code] if the agent's navigation has finished. If the target is reachable, navigation ends when the target is reached. If the target is unreachable, navigation ends when the last waypoint of the path is reached. + [b]Note:[/b] While [code]true[/code] prefer to stop calling update functions like [method get_next_path_position]. This avoids jittering the standing agent due to calling repeated path updates. </description> </method> <method name="is_target_reachable"> @@ -97,7 +97,7 @@ <method name="is_target_reached" qualifiers="const"> <return type="bool" /> <description> - Returns true if [member target_position] is reached. It may not always be possible to reach the target position. It should always be possible to reach the final position though. See [method get_final_position]. + Returns [code]true[/code] if the agent reached the target, i.e. the agent moved within [member target_desired_distance] of the [member target_position]. It may not always be possible to reach the target but it should always be possible to reach the final position. See [method get_final_position]. </description> </method> <method name="set_avoidance_layer_value"> @@ -180,7 +180,7 @@ The distance to search for other agents. </member> <member name="path_desired_distance" type="float" setter="set_path_desired_distance" getter="get_path_desired_distance" default="20.0"> - The distance threshold before a path point is considered to be reached. This allows agents to not have to hit a path point on the path exactly, but only to reach its general area. If this value is set too high, the NavigationAgent will skip points on the path, which can lead to leaving the navigation mesh. If this value is set too low, the NavigationAgent will be stuck in a repath loop because it will constantly overshoot or undershoot the distance to the next point on each physics frame update. + The distance threshold before a path point is considered to be reached. This allows agents to not have to hit a path point on the path exactly, but only to reach its general area. If this value is set too high, the NavigationAgent will skip points on the path, which can lead to it leaving the navigation mesh. If this value is set too low, the NavigationAgent will be stuck in a repath loop because it will constantly overshoot the distance to the next point on each physics frame update. </member> <member name="path_max_distance" type="float" setter="set_path_max_distance" getter="get_path_max_distance" default="100.0"> The maximum distance the agent is allowed away from the ideal path to the final position. This can happen due to trying to avoid collisions. When the maximum distance is exceeded, it recalculates the ideal path. @@ -199,7 +199,9 @@ Does not affect normal pathfinding. To change an actor's pathfinding radius bake [NavigationMesh] resources with a different [member NavigationMesh.agent_radius] property and use different navigation maps for each actor size. </member> <member name="target_desired_distance" type="float" setter="set_target_desired_distance" getter="get_target_desired_distance" default="10.0"> - The distance threshold before the final target point is considered to be reached. This allows agents to not have to hit the point of the final target exactly, but only to reach its general area. If this value is set too low, the NavigationAgent will be stuck in a repath loop because it will constantly overshoot or undershoot the distance to the final target point on each physics frame update. + The distance threshold before the target is considered to be reached. On reaching the target, [signal target_reached] is emitted and navigation ends (see [method is_navigation_finished] and [signal navigation_finished]). + You can make navigation end early by setting this property to a value greater than [member path_desired_distance] (navigation will end before reaching the last waypoint). + You can also make navigation end closer to the target than each individual path position by setting this property to a value lower than [member path_desired_distance] (navigation won't immediately end when reaching the last waypoint). However, if the value set is too low, the agent will be stuck in a repath loop because it will constantly overshoot the distance to the target on each physics frame update. </member> <member name="target_position" type="Vector2" setter="set_target_position" getter="get_target_position" default="Vector2(0, 0)"> If set, a new navigation path from the current agent position to the [member target_position] is requested from the NavigationServer. @@ -218,7 +220,7 @@ <signal name="link_reached"> <param index="0" name="details" type="Dictionary" /> <description> - Notifies when a navigation link has been reached. + Signals that the agent reached a navigation link. Emitted when the agent moves within [member path_desired_distance] of the next position of the path when that position is a navigation link. The details dictionary may contain the following keys depending on the value of [member path_metadata_flags]: - [code]position[/code]: The start position of the link that was reached. - [code]type[/code]: Always [constant NavigationPathQueryResult2D.PATH_SEGMENT_TYPE_LINK]. @@ -230,7 +232,8 @@ </signal> <signal name="navigation_finished"> <description> - Emitted once per loaded path when the agent internal navigation path index reaches the last index of the loaded path array. The agent internal navigation path index can be received with [method get_current_navigation_path_index]. + Signals that the agent's navigation has finished. If the target is reachable, navigation ends when the target is reached. If the target is unreachable, navigation ends when the last waypoint of the path is reached. This signal is emitted only once per loaded path. + This signal will be emitted just after [signal target_reached] when the target is reachable. </description> </signal> <signal name="path_changed"> @@ -243,7 +246,9 @@ </signal> <signal name="target_reached"> <description> - Emitted once per loaded path when the agent's global position is the first time within [member target_desired_distance] to the [member target_position]. + Signals that the agent reached the target, i.e. the agent moved within [member target_desired_distance] of the [member target_position]. This signal is emitted only once per loaded path. + This signal will be emitted just before [signal navigation_finished] when the target is reachable. + It may not always be possible to reach the target but it should always be possible to reach the final position. See [method get_final_position]. </description> </signal> <signal name="velocity_computed"> @@ -255,7 +260,7 @@ <signal name="waypoint_reached"> <param index="0" name="details" type="Dictionary" /> <description> - Notifies when a waypoint along the path has been reached. + Signals that the agent reached a waypoint. Emitted when the agent moves within [member path_desired_distance] of the next position of the path. The details dictionary may contain the following keys depending on the value of [member path_metadata_flags]: - [code]position[/code]: The position of the waypoint that was reached. - [code]type[/code]: The type of navigation primitive (region or link) that contains this waypoint. diff --git a/doc/classes/NavigationAgent3D.xml b/doc/classes/NavigationAgent3D.xml index ec9f679307..cbcf50bb29 100644 --- a/doc/classes/NavigationAgent3D.xml +++ b/doc/classes/NavigationAgent3D.xml @@ -84,8 +84,8 @@ <method name="is_navigation_finished"> <return type="bool" /> <description> - Returns [code]true[/code] if the end of the currently loaded navigation path has been reached. - [b]Note:[/b] While true prefer to stop calling update functions like [method get_next_path_position]. This avoids jittering the standing agent due to calling repeated path updates. + Returns [code]true[/code] if the agent's navigation has finished. If the target is reachable, navigation ends when the target is reached. If the target is unreachable, navigation ends when the last waypoint of the path is reached. + [b]Note:[/b] While [code]true[/code] prefer to stop calling update functions like [method get_next_path_position]. This avoids jittering the standing agent due to calling repeated path updates. </description> </method> <method name="is_target_reachable"> @@ -97,7 +97,7 @@ <method name="is_target_reached" qualifiers="const"> <return type="bool" /> <description> - Returns true if [member target_position] is reached. It may not always be possible to reach the target position. It should always be possible to reach the final position though. See [method get_final_position]. + Returns [code]true[/code] if the agent reached the target, i.e. the agent moved within [member target_desired_distance] of the [member target_position]. It may not always be possible to reach the target but it should always be possible to reach the final position. See [method get_final_position]. </description> </method> <method name="set_avoidance_layer_value"> @@ -183,7 +183,7 @@ The distance to search for other agents. </member> <member name="path_desired_distance" type="float" setter="set_path_desired_distance" getter="get_path_desired_distance" default="1.0"> - The distance threshold before a path point is considered to be reached. This allows agents to not have to hit a path point on the path exactly, but only to reach its general area. If this value is set too high, the NavigationAgent will skip points on the path, which can lead to leaving the navigation mesh. If this value is set too low, the NavigationAgent will be stuck in a repath loop because it will constantly overshoot or undershoot the distance to the next point on each physics frame update. + The distance threshold before a path point is considered to be reached. This allows agents to not have to hit a path point on the path exactly, but only to reach its general area. If this value is set too high, the NavigationAgent will skip points on the path, which can lead to it leaving the navigation mesh. If this value is set too low, the NavigationAgent will be stuck in a repath loop because it will constantly overshoot the distance to the next point on each physics frame update. </member> <member name="path_height_offset" type="float" setter="set_path_height_offset" getter="get_path_height_offset" default="0.0"> The height offset is subtracted from the y-axis value of any vector path position for this NavigationAgent. The NavigationAgent height offset does not change or influence the navigation mesh or pathfinding query result. Additional navigation maps that use regions with navigation meshes that the developer baked with appropriate agent radius or height values are required to support different-sized agents. @@ -205,7 +205,9 @@ Does not affect normal pathfinding. To change an actor's pathfinding radius bake [NavigationMesh] resources with a different [member NavigationMesh.agent_radius] property and use different navigation maps for each actor size. </member> <member name="target_desired_distance" type="float" setter="set_target_desired_distance" getter="get_target_desired_distance" default="1.0"> - The distance threshold before the final target point is considered to be reached. This allows agents to not have to hit the point of the final target exactly, but only to reach its general area. If this value is set too low, the NavigationAgent will be stuck in a repath loop because it will constantly overshoot or undershoot the distance to the final target point on each physics frame update. + The distance threshold before the target is considered to be reached. On reaching the target, [signal target_reached] is emitted and navigation ends (see [method is_navigation_finished] and [signal navigation_finished]). + You can make navigation end early by setting this property to a value greater than [member path_desired_distance] (navigation will end before reaching the last waypoint). + You can also make navigation end closer to the target than each individual path position by setting this property to a value lower than [member path_desired_distance] (navigation won't immediately end when reaching the last waypoint). However, if the value set is too low, the agent will be stuck in a repath loop because it will constantly overshoot the distance to the target on each physics frame update. </member> <member name="target_position" type="Vector3" setter="set_target_position" getter="get_target_position" default="Vector3(0, 0, 0)"> If set, a new navigation path from the current agent position to the [member target_position] is requested from the NavigationServer. @@ -228,7 +230,7 @@ <signal name="link_reached"> <param index="0" name="details" type="Dictionary" /> <description> - Notifies when a navigation link has been reached. + Signals that the agent reached a navigation link. Emitted when the agent moves within [member path_desired_distance] of the next position of the path when that position is a navigation link. The details dictionary may contain the following keys depending on the value of [member path_metadata_flags]: - [code]position[/code]: The start position of the link that was reached. - [code]type[/code]: Always [constant NavigationPathQueryResult3D.PATH_SEGMENT_TYPE_LINK]. @@ -240,7 +242,8 @@ </signal> <signal name="navigation_finished"> <description> - Emitted once per loaded path when the agent internal navigation path index reaches the last index of the loaded path array. The agent internal navigation path index can be received with [method get_current_navigation_path_index]. + Signals that the agent's navigation has finished. If the target is reachable, navigation ends when the target is reached. If the target is unreachable, navigation ends when the last waypoint of the path is reached. This signal is emitted only once per loaded path. + This signal will be emitted just after [signal target_reached] when the target is reachable. </description> </signal> <signal name="path_changed"> @@ -253,7 +256,9 @@ </signal> <signal name="target_reached"> <description> - Emitted once per loaded path when the agent's global position is the first time within [member target_desired_distance] to the [member target_position]. + Signals that the agent reached the target, i.e. the agent moved within [member target_desired_distance] of the [member target_position]. This signal is emitted only once per loaded path. + This signal will be emitted just before [signal navigation_finished] when the target is reachable. + It may not always be possible to reach the target but it should always be possible to reach the final position. See [method get_final_position]. </description> </signal> <signal name="velocity_computed"> @@ -265,7 +270,7 @@ <signal name="waypoint_reached"> <param index="0" name="details" type="Dictionary" /> <description> - Notifies when a waypoint along the path has been reached. + Signals that the agent reached a waypoint. Emitted when the agent moves within [member path_desired_distance] of the next position of the path. The details dictionary may contain the following keys depending on the value of [member path_metadata_flags]: - [code]position[/code]: The position of the waypoint that was reached. - [code]type[/code]: The type of navigation primitive (region or link) that contains this waypoint. diff --git a/doc/classes/NavigationLink2D.xml b/doc/classes/NavigationLink2D.xml index b12051b4f4..75b691aaf4 100644 --- a/doc/classes/NavigationLink2D.xml +++ b/doc/classes/NavigationLink2D.xml @@ -29,6 +29,12 @@ Returns whether or not the specified layer of the [member navigation_layers] bitmask is enabled, given a [param layer_number] between 1 and 32. </description> </method> + <method name="get_rid" qualifiers="const"> + <return type="RID" /> + <description> + Returns the [RID] of this link on the [NavigationServer2D]. + </description> + </method> <method name="set_global_end_position"> <return type="void" /> <param index="0" name="position" type="Vector2" /> diff --git a/doc/classes/NavigationLink3D.xml b/doc/classes/NavigationLink3D.xml index 90eaaaee6d..711c637dc5 100644 --- a/doc/classes/NavigationLink3D.xml +++ b/doc/classes/NavigationLink3D.xml @@ -29,6 +29,12 @@ Returns whether or not the specified layer of the [member navigation_layers] bitmask is enabled, given a [param layer_number] between 1 and 32. </description> </method> + <method name="get_rid" qualifiers="const"> + <return type="RID" /> + <description> + Returns the [RID] of this link on the [NavigationServer3D]. + </description> + </method> <method name="set_global_end_position"> <return type="void" /> <param index="0" name="position" type="Vector3" /> diff --git a/doc/classes/NavigationRegion2D.xml b/doc/classes/NavigationRegion2D.xml index ef660305f4..089359da7a 100644 --- a/doc/classes/NavigationRegion2D.xml +++ b/doc/classes/NavigationRegion2D.xml @@ -43,7 +43,14 @@ Returns the current navigation map [RID] used by this region. </description> </method> - <method name="get_region_rid" qualifiers="const"> + <method name="get_region_rid" qualifiers="const" is_deprecated="true"> + <return type="RID" /> + <description> + Returns the [RID] of this region on the [NavigationServer2D]. + [i]Deprecated.[/i] Use [method get_rid] instead. + </description> + </method> + <method name="get_rid" qualifiers="const"> <return type="RID" /> <description> Returns the [RID] of this region on the [NavigationServer2D]. Combined with [method NavigationServer2D.map_get_closest_point_owner] can be used to identify the [NavigationRegion2D] closest to a point on the merged navigation map. diff --git a/doc/classes/NavigationRegion3D.xml b/doc/classes/NavigationRegion3D.xml index 3257160485..4415c10210 100644 --- a/doc/classes/NavigationRegion3D.xml +++ b/doc/classes/NavigationRegion3D.xml @@ -36,7 +36,14 @@ Returns the current navigation map [RID] used by this region. </description> </method> - <method name="get_region_rid" qualifiers="const"> + <method name="get_region_rid" qualifiers="const" is_deprecated="true"> + <return type="RID" /> + <description> + Returns the [RID] of this region on the [NavigationServer3D]. + [i]Deprecated.[/i] Use [method get_rid] instead. + </description> + </method> + <method name="get_rid" qualifiers="const"> <return type="RID" /> <description> Returns the [RID] of this region on the [NavigationServer3D]. Combined with [method NavigationServer3D.map_get_closest_point_owner] can be used to identify the [NavigationRegion3D] closest to a point on the merged navigation map. diff --git a/doc/classes/NavigationServer2D.xml b/doc/classes/NavigationServer2D.xml index a25f048df3..e1c79ad8a8 100644 --- a/doc/classes/NavigationServer2D.xml +++ b/doc/classes/NavigationServer2D.xml @@ -445,6 +445,17 @@ Returns the navigation path to reach the destination from the origin. [param navigation_layers] is a bitmask of all region navigation layers that are allowed to be in the path. </description> </method> + <method name="map_get_random_point" qualifiers="const"> + <return type="Vector2" /> + <param index="0" name="map" type="RID" /> + <param index="1" name="navigation_layers" type="int" /> + <param index="2" name="uniformly" type="bool" /> + <description> + Returns a random position picked from all map region polygons with matching [param navigation_layers]. + If [param uniformly] is [code]true[/code], all map regions, polygons, and faces are weighted by their surface area (slower). + If [param uniformly] is [code]false[/code], just a random region and a random polygon are picked (faster). + </description> + </method> <method name="map_get_regions" qualifiers="const"> <return type="RID[]" /> <param index="0" name="map" type="RID" /> @@ -681,6 +692,17 @@ Returns the [code]ObjectID[/code] of the object which manages this region. </description> </method> + <method name="region_get_random_point" qualifiers="const"> + <return type="Vector2" /> + <param index="0" name="region" type="RID" /> + <param index="1" name="navigation_layers" type="int" /> + <param index="2" name="uniformly" type="bool" /> + <description> + Returns a random position picked from all region polygons with matching [param navigation_layers]. + If [param uniformly] is [code]true[/code], all region polygons and faces are weighted by their surface area (slower). + If [param uniformly] is [code]false[/code], just a random polygon and face is picked (faster). + </description> + </method> <method name="region_get_travel_cost" qualifiers="const"> <return type="float" /> <param index="0" name="region" type="RID" /> diff --git a/doc/classes/NavigationServer3D.xml b/doc/classes/NavigationServer3D.xml index b56b86f435..46b6697947 100644 --- a/doc/classes/NavigationServer3D.xml +++ b/doc/classes/NavigationServer3D.xml @@ -502,6 +502,17 @@ Returns the navigation path to reach the destination from the origin. [param navigation_layers] is a bitmask of all region navigation layers that are allowed to be in the path. </description> </method> + <method name="map_get_random_point" qualifiers="const"> + <return type="Vector3" /> + <param index="0" name="map" type="RID" /> + <param index="1" name="navigation_layers" type="int" /> + <param index="2" name="uniformly" type="bool" /> + <description> + Returns a random position picked from all map region polygons with matching [param navigation_layers]. + If [param uniformly] is [code]true[/code], all map regions, polygons, and faces are weighted by their surface area (slower). + If [param uniformly] is [code]false[/code], just a random region and a random polygon are picked (faster). + </description> + </method> <method name="map_get_regions" qualifiers="const"> <return type="RID[]" /> <param index="0" name="map" type="RID" /> @@ -793,6 +804,17 @@ Returns the [code]ObjectID[/code] of the object which manages this region. </description> </method> + <method name="region_get_random_point" qualifiers="const"> + <return type="Vector3" /> + <param index="0" name="region" type="RID" /> + <param index="1" name="navigation_layers" type="int" /> + <param index="2" name="uniformly" type="bool" /> + <description> + Returns a random position picked from all region polygons with matching [param navigation_layers]. + If [param uniformly] is [code]true[/code], all region polygons and faces are weighted by their surface area (slower). + If [param uniformly] is [code]false[/code], just a random polygon and face is picked (faster). + </description> + </method> <method name="region_get_travel_cost" qualifiers="const"> <return type="float" /> <param index="0" name="region" type="RID" /> diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index ad89efb256..44197dbd0c 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -699,6 +699,9 @@ <constant name="RENDERING_DRIVER_OPENGL3" value="1" enum="RenderingDriver"> The OpenGL 3 rendering driver. It uses OpenGL 3.3 Core Profile on desktop platforms, OpenGL ES 3.0 on mobile devices, and WebGL 2.0 on Web. </constant> + <constant name="RENDERING_DRIVER_D3D12" value="2" enum="RenderingDriver"> + The Direct3D 12 rendering driver. + </constant> <constant name="SYSTEM_DIR_DESKTOP" value="0" enum="SystemDir"> Desktop directory path. </constant> diff --git a/doc/classes/PanoramaSkyMaterial.xml b/doc/classes/PanoramaSkyMaterial.xml index 0d041b9b90..9e579cc7e5 100644 --- a/doc/classes/PanoramaSkyMaterial.xml +++ b/doc/classes/PanoramaSkyMaterial.xml @@ -11,6 +11,9 @@ <tutorials> </tutorials> <members> + <member name="energy_multiplier" type="float" setter="set_energy_multiplier" getter="get_energy_multiplier" default="1.0"> + The sky's overall brightness multiplier. Higher values result in a brighter sky. + </member> <member name="filter" type="bool" setter="set_filtering_enabled" getter="is_filtering_enabled" default="true"> A boolean value to determine if the background texture should be filtered or not. </member> diff --git a/doc/classes/PopupMenu.xml b/doc/classes/PopupMenu.xml index 3f4ec1b677..40d5a9f4a2 100644 --- a/doc/classes/PopupMenu.xml +++ b/doc/classes/PopupMenu.xml @@ -346,6 +346,12 @@ Returns [code]true[/code] if the specified item's shortcut is disabled. </description> </method> + <method name="is_system_menu" qualifiers="const"> + <return type="bool" /> + <description> + Returns [code]true[/code] if the menu is bound to the special system menu. + </description> + </method> <method name="remove_item"> <return type="void" /> <param index="0" name="index" type="int" /> @@ -566,6 +572,9 @@ <member name="submenu_popup_delay" type="float" setter="set_submenu_popup_delay" getter="get_submenu_popup_delay" default="0.3"> Sets the delay time in seconds for the submenu item to popup on mouse hovering. If the popup menu is added as a child of another (acting as a submenu), it will inherit the delay time of the parent menu item. </member> + <member name="system_menu_root" type="String" setter="set_system_menu_root" getter="get_system_menu_root" default=""""> + If set to one of the values returned by [method DisplayServer.global_menu_get_system_menu_roots], this [PopupMenu] is bound to the special system menu. Only one [PopupMenu] can be bound to each special menu at a time. + </member> </members> <signals> <signal name="id_focused"> diff --git a/doc/classes/ProceduralSkyMaterial.xml b/doc/classes/ProceduralSkyMaterial.xml index 54bffd009f..3fb9f9059c 100644 --- a/doc/classes/ProceduralSkyMaterial.xml +++ b/doc/classes/ProceduralSkyMaterial.xml @@ -11,6 +11,9 @@ <tutorials> </tutorials> <members> + <member name="energy_multiplier" type="float" setter="set_energy_multiplier" getter="get_energy_multiplier" default="1.0"> + The sky's overall brightness multiplier. Higher values result in a brighter sky. + </member> <member name="ground_bottom_color" type="Color" setter="set_ground_bottom_color" getter="get_ground_bottom_color" default="Color(0.2, 0.169, 0.133, 1)"> Color of the ground at the bottom. Blends with [member ground_horizon_color]. </member> diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 3fc9e94427..ab92916320 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -2616,6 +2616,18 @@ <member name="rendering/renderer/rendering_method.web" type="String" setter="" getter="" default=""gl_compatibility""> Override for [member rendering/renderer/rendering_method] on web. </member> + <member name="rendering/rendering_device/d3d12/max_misc_descriptors_per_frame" type="int" setter="" getter="" default="512"> + The number of entries in the miscellaneous descriptors heap the Direct3D 12 rendering driver uses each frame, used for various operations like clearing a texture. + Depending on the complexity of scenes, this value may be lowered or may need to be raised. + </member> + <member name="rendering/rendering_device/d3d12/max_resource_descriptors_per_frame" type="int" setter="" getter="" default="16384"> + The number of entries in the resource descriptors heap the Direct3D 12 rendering driver uses each frame, used for most rendering operations. + Depending on the complexity of scenes, this value may be lowered or may need to be raised. + </member> + <member name="rendering/rendering_device/d3d12/max_sampler_descriptors_per_frame" type="int" setter="" getter="" default="1024"> + The number of entries in the sampler descriptors heap the Direct3D 12 rendering driver uses each frame, used for most rendering operations. + Depending on the complexity of scenes, this value may be lowered or may need to be raised. + </member> <member name="rendering/rendering_device/driver" type="String" setter="" getter=""> Sets the driver to be used by the renderer when using a RenderingDevice-based renderer like the clustered renderer or the mobile renderer. This property can not be edited directly, instead, set the driver using the platform-specific overrides. </member> @@ -2778,9 +2790,11 @@ </member> <member name="xr/openxr/foveation_dynamic" type="bool" setter="" getter="" default="false"> If true and foveation is supported, will automatically adjust foveation level based on framerate up to the level set on [member xr/openxr/foveation_level]. + [b]Note:[/b] Only works on compatibility renderer. </member> <member name="xr/openxr/foveation_level" type="int" setter="" getter="" default=""0""> Applied foveation level if supported: 0 = off, 1 = low, 2 = medium, 3 = high. + [b]Note:[/b] Only works on compatibility renderer. </member> <member name="xr/openxr/reference_space" type="int" setter="" getter="" default=""1""> Specify the default reference space. diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml index da07582773..6bbef47763 100644 --- a/doc/classes/RenderingServer.xml +++ b/doc/classes/RenderingServer.xml @@ -925,6 +925,14 @@ [b]Note:[/b] When using the OpenGL backend or when running in headless mode, this function always returns [code]null[/code]. </description> </method> + <method name="debug_canvas_item_get_rect"> + <return type="Rect2" /> + <param index="0" name="item" type="RID" /> + <description> + Returns the bounding rectangle for a canvas item in local space, as calculated by the renderer. This bound is used internally for culling. + [b]Warning:[/b] This function is intended for debugging in the editor, and will pass through and return a zero [Rect2] in exported projects. + </description> + </method> <method name="decal_create"> <return type="RID" /> <description> @@ -1362,7 +1370,7 @@ <param index="0" name="swap_buffers" type="bool" default="true" /> <param index="1" name="frame_step" type="float" default="0.0" /> <description> - Forces redrawing of all viewports at once. + Forces redrawing of all viewports at once. Must be called from the main thread. </description> </method> <method name="force_sync"> @@ -4686,7 +4694,10 @@ <constant name="VIEWPORT_RENDER_INFO_TYPE_SHADOW" value="1" enum="ViewportRenderInfoType"> Shadow render pass. Objects will be rendered several times depending on the number of amounts of lights with shadows and the number of directional shadow splits. </constant> - <constant name="VIEWPORT_RENDER_INFO_TYPE_MAX" value="2" enum="ViewportRenderInfoType"> + <constant name="VIEWPORT_RENDER_INFO_TYPE_CANVAS" value="2" enum="ViewportRenderInfoType"> + Canvas item rendering. This includes all 2D rendering. + </constant> + <constant name="VIEWPORT_RENDER_INFO_TYPE_MAX" value="3" enum="ViewportRenderInfoType"> Represents the size of the [enum ViewportRenderInfoType] enum. </constant> <constant name="VIEWPORT_DEBUG_DRAW_DISABLED" value="0" enum="ViewportDebugDraw"> @@ -5130,22 +5141,26 @@ Uses the default filter mode for this [Viewport]. </constant> <constant name="CANVAS_ITEM_TEXTURE_FILTER_NEAREST" value="1" enum="CanvasItemTextureFilter"> - The texture filter reads from the nearest pixel only. The simplest and fastest method of filtering, but the texture will look pixelized. + The texture filter reads from the nearest pixel only. This makes the texture look pixelated from up close, and grainy from a distance (due to mipmaps not being sampled). </constant> <constant name="CANVAS_ITEM_TEXTURE_FILTER_LINEAR" value="2" enum="CanvasItemTextureFilter"> - The texture filter blends between the nearest 4 pixels. Use this when you want to avoid a pixelated style, but do not want mipmaps. + The texture filter blends between the nearest 4 pixels. This makes the texture look smooth from up close, and grainy from a distance (due to mipmaps not being sampled). </constant> <constant name="CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS" value="3" enum="CanvasItemTextureFilter"> - The texture filter reads from the nearest pixel in the nearest mipmap. The fastest way to read from textures with mipmaps. + The texture filter reads from the nearest pixel and blends between the nearest 2 mipmaps (or uses the nearest mipmap if [member ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter] is [code]true[/code]). This makes the texture look pixelated from up close, and smooth from a distance. + Use this for non-pixel art textures that may be viewed at a low scale (e.g. due to [Camera2D] zoom or sprite scaling), as mipmaps are important to smooth out pixels that are smaller than on-screen pixels. </constant> <constant name="CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS" value="4" enum="CanvasItemTextureFilter"> - The texture filter blends between the nearest 4 pixels and between the nearest 2 mipmaps. + The texture filter blends between the nearest 4 pixels and between the nearest 2 mipmaps (or uses the nearest mipmap if [member ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter] is [code]true[/code]). This makes the texture look smooth from up close, and smooth from a distance. + Use this for non-pixel art textures that may be viewed at a low scale (e.g. due to [Camera2D] zoom or sprite scaling), as mipmaps are important to smooth out pixels that are smaller than on-screen pixels. </constant> <constant name="CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC" value="5" enum="CanvasItemTextureFilter"> - The texture filter reads from the nearest pixel, but selects a mipmap based on the angle between the surface and the camera view. This reduces artifacts on surfaces that are almost in line with the camera. + The texture filter reads from the nearest pixel and blends between 2 mipmaps (or uses the nearest mipmap if [member ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter] is [code]true[/code]) based on the angle between the surface and the camera view. This makes the texture look pixelated from up close, and smooth from a distance. Anisotropic filtering improves texture quality on surfaces that are almost in line with the camera, but is slightly slower. The anisotropic filtering level can be changed by adjusting [member ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level]. + [b]Note:[/b] This texture filter is rarely useful in 2D projects. [constant CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS] is usually more appropriate in this case. </constant> <constant name="CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC" value="6" enum="CanvasItemTextureFilter"> - The texture filter blends between the nearest 4 pixels and selects a mipmap based on the angle between the surface and the camera view. This reduces artifacts on surfaces that are almost in line with the camera. This is the slowest of the filtering options, but results in the highest quality texturing. + The texture filter blends between the nearest 4 pixels and blends between 2 mipmaps (or uses the nearest mipmap if [member ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter] is [code]true[/code]) based on the angle between the surface and the camera view. This makes the texture look smooth from up close, and smooth from a distance. Anisotropic filtering improves texture quality on surfaces that are almost in line with the camera, but is slightly slower. The anisotropic filtering level can be changed by adjusting [member ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level]. + [b]Note:[/b] This texture filter is rarely useful in 2D projects. [constant CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS] is usually more appropriate in this case. </constant> <constant name="CANVAS_ITEM_TEXTURE_FILTER_MAX" value="7" enum="CanvasItemTextureFilter"> Max value for [enum CanvasItemTextureFilter] enum. diff --git a/doc/classes/Resource.xml b/doc/classes/Resource.xml index c8146bb48f..49db3f81b4 100644 --- a/doc/classes/Resource.xml +++ b/doc/classes/Resource.xml @@ -4,8 +4,9 @@ Base class for serializable objects. </brief_description> <description> - Resource is the base class for all Godot-specific resource types, serving primarily as data containers. Since they inherit from [RefCounted], resources are reference-counted and freed when no longer in use. They can also be nested within other resources, and saved on disk. Once loaded from disk, further attempts to load a resource by [member resource_path] returns the same reference. [PackedScene], one of the most common [Object]s in a Godot project, is also a resource, uniquely capable of storing and instantiating the [Node]s it contains as many times as desired. + Resource is the base class for all Godot-specific resource types, serving primarily as data containers. Since they inherit from [RefCounted], resources are reference-counted and freed when no longer in use. They can also be nested within other resources, and saved on disk. [PackedScene], one of the most common [Object]s in a Godot project, is also a resource, uniquely capable of storing and instantiating the [Node]s it contains as many times as desired. In GDScript, resources can loaded from disk by their [member resource_path] using [method @GDScript.load] or [method @GDScript.preload]. + The engine keeps a global cache of all loaded resources, referenced by paths (see [method ResourceLoader.has_cached]). A resource will be cached when loaded for the first time and removed from cache once all references are released. When a resource is cached, subsequent loads using its path will return the cached reference. [b]Note:[/b] In C#, resources will not be freed instantly after they are no longer in use. Instead, garbage collection will run periodically and will free resources that are no longer in use. This means that unused resources will linger on for a while before being removed. </description> <tutorials> diff --git a/doc/classes/ResourceLoader.xml b/doc/classes/ResourceLoader.xml index 267594edcb..54e95d8c30 100644 --- a/doc/classes/ResourceLoader.xml +++ b/doc/classes/ResourceLoader.xml @@ -28,6 +28,7 @@ <description> Returns whether a recognized resource exists for the given [param path]. An optional [param type_hint] can be used to further specify the [Resource] type that should be handled by the [ResourceFormatLoader]. Anything that inherits from [Resource] can be used as a type hint, for example [Image]. + [b]Note:[/b] If you use [method Resource.take_over_path], this method will return [code]true[/code] for the taken path even if the resource wasn't saved (i.e. exists only in resource cache). </description> </method> <method name="get_dependencies"> @@ -137,10 +138,13 @@ The resource was loaded successfully and can be accessed via [method load_threaded_get]. </constant> <constant name="CACHE_MODE_IGNORE" value="0" enum="CacheMode"> + The resource is always loaded from disk, even if a cache entry exists for its path, and the newly loaded copy will not be cached. Instances loaded with this mode will exist independently. </constant> <constant name="CACHE_MODE_REUSE" value="1" enum="CacheMode"> + If a resource is cached, returns the cached reference. Otherwise it's loaded from disk. </constant> <constant name="CACHE_MODE_REPLACE" value="2" enum="CacheMode"> + The resource is always loaded from disk, even if a cache entry exists for its path. The cached entry will be replaced by the newly loaded copy. </constant> </constants> </class> diff --git a/doc/classes/SceneTree.xml b/doc/classes/SceneTree.xml index da23eadfd1..1a846140e5 100644 --- a/doc/classes/SceneTree.xml +++ b/doc/classes/SceneTree.xml @@ -42,7 +42,7 @@ <description> Changes the running scene to the one at the given [param path], after loading it into a [PackedScene] and creating a new instance. Returns [constant OK] on success, [constant ERR_CANT_OPEN] if the [param path] cannot be loaded into a [PackedScene], or [constant ERR_CANT_CREATE] if that scene cannot be instantiated. - [b]Note:[/b] The new scene node is added to the tree at the end of the frame. This ensures that both scenes aren't running at the same time, while still freeing the previous scene in a safe way similar to [method Node.queue_free]. As such, you won't be able to access the loaded scene immediately after the [method change_scene_to_file] call. + [b]Note:[/b] See [method change_scene_to_packed] for details on the order of operations. </description> </method> <method name="change_scene_to_packed"> @@ -51,7 +51,10 @@ <description> Changes the running scene to a new instance of the given [PackedScene] (which must be valid). Returns [constant OK] on success, [constant ERR_CANT_CREATE] if the scene cannot be instantiated, or [constant ERR_INVALID_PARAMETER] if the scene is invalid. - [b]Note:[/b] The new scene node is added to the tree at the end of the frame. You won't be able to access it immediately after the [method change_scene_to_packed] call. + [b]Note:[/b] Operations happen in the following order when [method change_scene_to_packed] is called: + 1. The current scene node is immediately removed from the tree. From that point, [method Node.get_tree] called on the current (outgoing) scene will return [code]null[/code]. [member current_scene] will be [code]null[/code], too, because the new scene is not available yet. + 2. At the end of the frame, the formerly current scene, already removed from the tree, will be deleted (freed from memory) and then the new scene will be instantiated and added to the tree. [method Node.get_tree] and [member current_scene] will be back to working as usual. + This ensures that both scenes aren't running at the same time, while still freeing the previous scene in a safe way similar to [method Node.queue_free]. </description> </method> <method name="create_timer"> @@ -119,6 +122,13 @@ Returns the number of nodes in this [SceneTree]. </description> </method> + <method name="get_node_count_in_group" qualifiers="const"> + <return type="int" /> + <param index="0" name="group" type="StringName" /> + <description> + Returns the number of nodes assigned to the given group. + </description> + </method> <method name="get_nodes_in_group"> <return type="Node[]" /> <param index="0" name="group" type="StringName" /> diff --git a/doc/classes/Script.xml b/doc/classes/Script.xml index 28d763585d..fa8e4ef5f2 100644 --- a/doc/classes/Script.xml +++ b/doc/classes/Script.xml @@ -24,6 +24,27 @@ Returns the script directly inherited by this script. </description> </method> + <method name="get_global_name" qualifiers="const"> + <return type="StringName" /> + <description> + Returns the class name associated with the script, if there is one. Returns an empty string otherwise. + To give the script a global name, you can use the [code]class_name[/code] keyword in GDScript and the [code][GlobalClass][/code] attribute in C#. + [codeblocks] + [gdscript] + class_name MyNode + extends Node + [/gdscript] + [csharp] + using Godot; + + [GlobalClass] + public partial class MyNode : Node + { + } + [/csharp] + [/codeblocks] + </description> + </method> <method name="get_instance_base_type" qualifiers="const"> <return type="StringName" /> <description> diff --git a/doc/classes/Sprite2D.xml b/doc/classes/Sprite2D.xml index 8eb9e26a83..f8622d8f38 100644 --- a/doc/classes/Sprite2D.xml +++ b/doc/classes/Sprite2D.xml @@ -60,13 +60,13 @@ If [code]true[/code], texture is flipped vertically. </member> <member name="frame" type="int" setter="set_frame" getter="get_frame" default="0"> - Current frame to display from sprite sheet. [member hframes] or [member vframes] must be greater than 1. + Current frame to display from sprite sheet. [member hframes] or [member vframes] must be greater than 1. This property is automatically adjusted when [member hframes] or [member vframes] are changed to keep pointing to the same visual frame (same column and row). If that's impossible, this value is reset to [code]0[/code]. </member> <member name="frame_coords" type="Vector2i" setter="set_frame_coords" getter="get_frame_coords" default="Vector2i(0, 0)"> Coordinates of the frame to display from sprite sheet. This is as an alias for the [member frame] property. [member hframes] or [member vframes] must be greater than 1. </member> <member name="hframes" type="int" setter="set_hframes" getter="get_hframes" default="1"> - The number of columns in the sprite sheet. + The number of columns in the sprite sheet. When this property is changed, [member frame] is adjusted so that the same visual frame is maintained (same row and column). If that's impossible, [member frame] is reset to [code]0[/code]. </member> <member name="offset" type="Vector2" setter="set_offset" getter="get_offset" default="Vector2(0, 0)"> The texture's drawing offset. @@ -84,7 +84,7 @@ [Texture2D] object to draw. </member> <member name="vframes" type="int" setter="set_vframes" getter="get_vframes" default="1"> - The number of rows in the sprite sheet. + The number of rows in the sprite sheet. When this property is changed, [member frame] is adjusted so that the same visual frame is maintained (same row and column). If that's impossible, [member frame] is reset to [code]0[/code]. </member> </members> <signals> diff --git a/doc/classes/Sprite3D.xml b/doc/classes/Sprite3D.xml index 9733c5f48a..4b4421aeba 100644 --- a/doc/classes/Sprite3D.xml +++ b/doc/classes/Sprite3D.xml @@ -10,13 +10,13 @@ </tutorials> <members> <member name="frame" type="int" setter="set_frame" getter="get_frame" default="0"> - Current frame to display from sprite sheet. [member hframes] or [member vframes] must be greater than 1. + Current frame to display from sprite sheet. [member hframes] or [member vframes] must be greater than 1. This property is automatically adjusted when [member hframes] or [member vframes] are changed to keep pointing to the same visual frame (same column and row). If that's impossible, this value is reset to [code]0[/code]. </member> <member name="frame_coords" type="Vector2i" setter="set_frame_coords" getter="get_frame_coords" default="Vector2i(0, 0)"> Coordinates of the frame to display from sprite sheet. This is as an alias for the [member frame] property. [member hframes] or [member vframes] must be greater than 1. </member> <member name="hframes" type="int" setter="set_hframes" getter="get_hframes" default="1"> - The number of columns in the sprite sheet. + The number of columns in the sprite sheet. When this property is changed, [member frame] is adjusted so that the same visual frame is maintained (same row and column). If that's impossible, [member frame] is reset to [code]0[/code]. </member> <member name="region_enabled" type="bool" setter="set_region_enabled" getter="is_region_enabled" default="false"> If [code]true[/code], the sprite will use [member region_rect] and display only the specified part of its texture. @@ -28,7 +28,7 @@ [Texture2D] object to draw. If [member GeometryInstance3D.material_override] is used, this will be overridden. The size information is still used. </member> <member name="vframes" type="int" setter="set_vframes" getter="get_vframes" default="1"> - The number of rows in the sprite sheet. + The number of rows in the sprite sheet. When this property is changed, [member frame] is adjusted so that the same visual frame is maintained (same row and column). If that's impossible, [member frame] is reset to [code]0[/code]. </member> </members> <signals> diff --git a/doc/classes/SubViewportContainer.xml b/doc/classes/SubViewportContainer.xml index e7d7883c78..e47e27c0ce 100644 --- a/doc/classes/SubViewportContainer.xml +++ b/doc/classes/SubViewportContainer.xml @@ -11,7 +11,7 @@ <tutorials> </tutorials> <methods> - <method name="_propagate_input_event" qualifiers="virtual const"> + <method name="_propagate_input_event" qualifiers="virtual const" is_experimental="true"> <return type="bool" /> <param index="0" name="event" type="InputEvent" /> <description> diff --git a/doc/classes/TextLine.xml b/doc/classes/TextLine.xml index e65006716d..2e4a3f7e4c 100644 --- a/doc/classes/TextLine.xml +++ b/doc/classes/TextLine.xml @@ -151,6 +151,9 @@ <member name="direction" type="int" setter="set_direction" getter="get_direction" enum="TextServer.Direction" default="0"> Text writing direction. </member> + <member name="ellipsis_char" type="String" setter="set_ellipsis_char" getter="get_ellipsis_char" default=""…""> + Ellipsis character used for text clipping. + </member> <member name="flags" type="int" setter="set_flags" getter="get_flags" enum="TextServer.JustificationFlag" is_bitfield="true" default="3"> Line alignment rules. For more info see [TextServer]. </member> diff --git a/doc/classes/TextParagraph.xml b/doc/classes/TextParagraph.xml index a8a4c3a764..541078ed22 100644 --- a/doc/classes/TextParagraph.xml +++ b/doc/classes/TextParagraph.xml @@ -274,6 +274,9 @@ <member name="direction" type="int" setter="set_direction" getter="get_direction" enum="TextServer.Direction" default="0"> Text writing direction. </member> + <member name="ellipsis_char" type="String" setter="set_ellipsis_char" getter="get_ellipsis_char" default=""…""> + Ellipsis character used for text clipping. + </member> <member name="justification_flags" type="int" setter="set_justification_flags" getter="get_justification_flags" enum="TextServer.JustificationFlag" is_bitfield="true" default="163"> Line fill alignment rules. For more info see [enum TextServer.JustificationFlag]. </member> diff --git a/doc/classes/TextServer.xml b/doc/classes/TextServer.xml index f4246a8c50..09f484f523 100644 --- a/doc/classes/TextServer.xml +++ b/doc/classes/TextServer.xml @@ -1243,6 +1243,13 @@ Returns array of the composite character boundaries. </description> </method> + <method name="shaped_text_get_custom_ellipsis" qualifiers="const"> + <return type="int" /> + <param index="0" name="shaped" type="RID" /> + <description> + Returns ellipsis character used for text clipping. + </description> + </method> <method name="shaped_text_get_custom_punctuation" qualifiers="const"> <return type="String" /> <param index="0" name="shaped" type="RID" /> @@ -1547,6 +1554,14 @@ Override ranges should cover full source text without overlaps. BiDi algorithm will be used on each range separately. </description> </method> + <method name="shaped_text_set_custom_ellipsis"> + <return type="void" /> + <param index="0" name="shaped" type="RID" /> + <param index="1" name="char" type="int" /> + <description> + Sets ellipsis character used for text clipping. + </description> + </method> <method name="shaped_text_set_custom_punctuation"> <return type="void" /> <param index="0" name="shaped" type="RID" /> diff --git a/doc/classes/TextServerExtension.xml b/doc/classes/TextServerExtension.xml index 267e0b65cb..9555718b26 100644 --- a/doc/classes/TextServerExtension.xml +++ b/doc/classes/TextServerExtension.xml @@ -1073,6 +1073,12 @@ <description> </description> </method> + <method name="_shaped_text_get_custom_ellipsis" qualifiers="virtual const"> + <return type="int" /> + <param index="0" name="shaped" type="RID" /> + <description> + </description> + </method> <method name="_shaped_text_get_custom_punctuation" qualifiers="virtual const"> <return type="String" /> <param index="0" name="shaped" type="RID" /> @@ -1329,6 +1335,13 @@ <description> </description> </method> + <method name="_shaped_text_set_custom_ellipsis" qualifiers="virtual"> + <return type="void" /> + <param index="0" name="shaped" type="RID" /> + <param index="1" name="char" type="int" /> + <description> + </description> + </method> <method name="_shaped_text_set_custom_punctuation" qualifiers="virtual"> <return type="void" /> <param index="0" name="shaped" type="RID" /> diff --git a/doc/classes/TileData.xml b/doc/classes/TileData.xml index 8aa5f1398a..9e833e0236 100644 --- a/doc/classes/TileData.xml +++ b/doc/classes/TileData.xml @@ -70,15 +70,23 @@ <method name="get_navigation_polygon" qualifiers="const"> <return type="NavigationPolygon" /> <param index="0" name="layer_id" type="int" /> + <param index="1" name="flip_h" type="bool" default="false" /> + <param index="2" name="flip_v" type="bool" default="false" /> + <param index="3" name="transpose" type="bool" default="false" /> <description> Returns the navigation polygon of the tile for the TileSet navigation layer with index [param layer_id]. + [param flip_h], [param flip_v], and [param transpose] allow transforming the returned polygon. </description> </method> <method name="get_occluder" qualifiers="const"> <return type="OccluderPolygon2D" /> <param index="0" name="layer_id" type="int" /> + <param index="1" name="flip_h" type="bool" default="false" /> + <param index="2" name="flip_v" type="bool" default="false" /> + <param index="3" name="transpose" type="bool" default="false" /> <description> Returns the occluder polygon of the tile for the TileSet occlusion layer with index [param layer_id]. + [param flip_h], [param flip_v], and [param transpose] allow transforming the returned polygon. </description> </method> <method name="get_terrain_peering_bit" qualifiers="const"> diff --git a/doc/classes/VideoStreamPlayer.xml b/doc/classes/VideoStreamPlayer.xml index 0d8776b0b7..f903f171d1 100644 --- a/doc/classes/VideoStreamPlayer.xml +++ b/doc/classes/VideoStreamPlayer.xml @@ -6,7 +6,6 @@ <description> A control used for playback of [VideoStream] resources. Supported video formats are [url=https://www.theora.org/]Ogg Theora[/url] ([code].ogv[/code], [VideoStreamTheora]) and any format exposed via a GDExtension plugin. - [b]Note:[/b] Due to a bug, VideoStreamPlayer does not support localization remapping yet. [b]Warning:[/b] On Web, video playback [i]will[/i] perform poorly due to missing architecture-specific assembly optimizations. </description> <tutorials> diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml index 1b5f7148ac..4d0f453fe0 100644 --- a/doc/classes/Viewport.xml +++ b/doc/classes/Viewport.xml @@ -128,6 +128,13 @@ Returns the [Control] having the focus within this viewport. If no [Control] has the focus, returns null. </description> </method> + <method name="gui_get_hovered_control" qualifiers="const"> + <return type="Control" /> + <description> + Returns the [Control] that the mouse is currently hovering over in this viewport. If no [Control] has the cursor, returns null. + Typically the leaf [Control] node or deepest level of the subtree which claims hover. This is very useful when used together with [method Node.is_ancestor_of] to find if the mouse is within a control tree. + </description> + </method> <method name="gui_is_drag_successful" qualifiers="const"> <return type="bool" /> <description> @@ -560,16 +567,18 @@ Draws the internal resolution buffer of the scene before post-processing is applied. </constant> <constant name="DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_NEAREST" value="0" enum="DefaultCanvasItemTextureFilter"> - The texture filter reads from the nearest pixel only. The simplest and fastest method of filtering, but the texture will look pixelized. + The texture filter reads from the nearest pixel only. This makes the texture look pixelated from up close, and grainy from a distance (due to mipmaps not being sampled). </constant> <constant name="DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_LINEAR" value="1" enum="DefaultCanvasItemTextureFilter"> - The texture filter blends between the nearest 4 pixels. Use this when you want to avoid a pixelated style, but do not want mipmaps. + The texture filter blends between the nearest 4 pixels. This makes the texture look smooth from up close, and grainy from a distance (due to mipmaps not being sampled). </constant> <constant name="DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS" value="2" enum="DefaultCanvasItemTextureFilter"> - The texture filter reads from the nearest pixel in the nearest mipmap. The fastest way to read from textures with mipmaps. + The texture filter blends between the nearest 4 pixels and between the nearest 2 mipmaps (or uses the nearest mipmap if [member ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter] is [code]true[/code]). This makes the texture look smooth from up close, and smooth from a distance. + Use this for non-pixel art textures that may be viewed at a low scale (e.g. due to [Camera2D] zoom or sprite scaling), as mipmaps are important to smooth out pixels that are smaller than on-screen pixels. </constant> <constant name="DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS" value="3" enum="DefaultCanvasItemTextureFilter"> - The texture filter blends between the nearest 4 pixels and between the nearest 2 mipmaps. + The texture filter reads from the nearest pixel and blends between the nearest 2 mipmaps (or uses the nearest mipmap if [member ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter] is [code]true[/code]). This makes the texture look pixelated from up close, and smooth from a distance. + Use this for non-pixel art textures that may be viewed at a low scale (e.g. due to [Camera2D] zoom or sprite scaling), as mipmaps are important to smooth out pixels that are smaller than on-screen pixels. </constant> <constant name="DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_MAX" value="4" enum="DefaultCanvasItemTextureFilter"> Max value for [enum DefaultCanvasItemTextureFilter] enum. diff --git a/doc/classes/VisualShaderNodeTextureParameter.xml b/doc/classes/VisualShaderNodeTextureParameter.xml index 79a0657156..aa64016746 100644 --- a/doc/classes/VisualShaderNodeTextureParameter.xml +++ b/doc/classes/VisualShaderNodeTextureParameter.xml @@ -57,24 +57,26 @@ Sample the texture using the filter determined by the node this shader is attached to. </constant> <constant name="FILTER_NEAREST" value="1" enum="TextureFilter"> - The texture filter reads from the nearest pixel only. The simplest and fastest method of filtering, but the texture will look pixelized. + The texture filter reads from the nearest pixel only. This makes the texture look pixelated from up close, and grainy from a distance (due to mipmaps not being sampled). </constant> <constant name="FILTER_LINEAR" value="2" enum="TextureFilter"> - The texture filter blends between the nearest four pixels. Use this for most cases where you want to avoid a pixelated style. + The texture filter blends between the nearest 4 pixels. This makes the texture look smooth from up close, and grainy from a distance (due to mipmaps not being sampled). </constant> <constant name="FILTER_NEAREST_MIPMAP" value="3" enum="TextureFilter"> - The texture filter reads from the nearest pixel in the nearest mipmap. This is the fastest way to read from textures with mipmaps. + The texture filter reads from the nearest pixel and blends between the nearest 2 mipmaps (or uses the nearest mipmap if [member ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter] is [code]true[/code]). This makes the texture look pixelated from up close, and smooth from a distance. + Use this for non-pixel art textures that may be viewed at a low scale (e.g. due to [Camera2D] zoom or sprite scaling), as mipmaps are important to smooth out pixels that are smaller than on-screen pixels. </constant> <constant name="FILTER_LINEAR_MIPMAP" value="4" enum="TextureFilter"> - The texture filter blends between the nearest 4 pixels and between the nearest 2 mipmaps. Use this for non-pixel art textures that may be viewed at a low scale (e.g. due to [Camera2D] zoom), as mipmaps are important to smooth out pixels that are smaller than on-screen pixels. + The texture filter blends between the nearest 4 pixels and between the nearest 2 mipmaps (or uses the nearest mipmap if [member ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter] is [code]true[/code]). This makes the texture look smooth from up close, and smooth from a distance. + Use this for non-pixel art textures that may be viewed at a low scale (e.g. due to [Camera2D] zoom or sprite scaling), as mipmaps are important to smooth out pixels that are smaller than on-screen pixels. </constant> <constant name="FILTER_NEAREST_MIPMAP_ANISOTROPIC" value="5" enum="TextureFilter"> - The texture filter reads from the nearest pixel, but selects a mipmap based on the angle between the surface and the camera view. This reduces artifacts on surfaces that are almost in line with the camera. The anisotropic filtering level can be changed by adjusting [member ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level]. - [b]Note:[/b] This texture filter is rarely useful in 2D projects. [constant FILTER_LINEAR_MIPMAP] is usually more appropriate. + The texture filter reads from the nearest pixel and blends between 2 mipmaps (or uses the nearest mipmap if [member ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter] is [code]true[/code]) based on the angle between the surface and the camera view. This makes the texture look pixelated from up close, and smooth from a distance. Anisotropic filtering improves texture quality on surfaces that are almost in line with the camera, but is slightly slower. The anisotropic filtering level can be changed by adjusting [member ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level]. + [b]Note:[/b] This texture filter is rarely useful in 2D projects. [constant FILTER_NEAREST_MIPMAP] is usually more appropriate in this case. </constant> <constant name="FILTER_LINEAR_MIPMAP_ANISOTROPIC" value="6" enum="TextureFilter"> - The texture filter blends between the nearest 4 pixels and selects a mipmap based on the angle between the surface and the camera view. This reduces artifacts on surfaces that are almost in line with the camera. This is the slowest of the filtering options, but results in the highest quality texturing. The anisotropic filtering level can be changed by adjusting [member ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level]. - [b]Note:[/b] This texture filter is rarely useful in 2D projects. [constant FILTER_LINEAR_MIPMAP] is usually more appropriate. + The texture filter blends between the nearest 4 pixels and blends between 2 mipmaps (or uses the nearest mipmap if [member ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter] is [code]true[/code]) based on the angle between the surface and the camera view. This makes the texture look smooth from up close, and smooth from a distance. Anisotropic filtering improves texture quality on surfaces that are almost in line with the camera, but is slightly slower. The anisotropic filtering level can be changed by adjusting [member ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level]. + [b]Note:[/b] This texture filter is rarely useful in 2D projects. [constant FILTER_LINEAR_MIPMAP] is usually more appropriate in this case. </constant> <constant name="FILTER_MAX" value="7" enum="TextureFilter"> Represents the size of the [enum TextureFilter] enum. diff --git a/doc/tools/make_rst.py b/doc/tools/make_rst.py index 6db11e4b29..c3a21f3d7b 100755 --- a/doc/tools/make_rst.py +++ b/doc/tools/make_rst.py @@ -1361,7 +1361,7 @@ def make_enum(t: str, is_bitfield: bool, state: State) -> str: if is_bitfield: if not state.classes[c].enums[e].is_bitfield: print_error(f'{state.current_class}.xml: Enum "{t}" is not bitfield.', state) - return f"|bitfield|\<:ref:`{e}<enum_{c}_{e}>`\>" + return f"|bitfield|\\<:ref:`{e}<enum_{c}_{e}>`\\>" else: return f":ref:`{e}<enum_{c}_{e}>`" @@ -1536,8 +1536,9 @@ def make_rst_index(grouped_classes: Dict[str, List[str]], dry_run: bool, output_ else: f = open(os.path.join(output_dir, "index.rst"), "w", encoding="utf-8") - # Remove the "Edit on Github" button from the online docs page. - f.write(":github_url: hide\n\n") + # Remove the "Edit on Github" button from the online docs page, and disallow user-contributed notes + # on the index page. User-contributed notes are allowed on individual class pages. + f.write(":github_url: hide\n:allow_comments: False\n\n") # Warn contributors not to edit this file directly. # Also provide links to the source files for reference. @@ -1551,16 +1552,11 @@ def make_rst_index(grouped_classes: Dict[str, List[str]], dry_run: bool, output_ f.write(".. _doc_class_reference:\n\n") - main_title = translate("All classes") - f.write(f"{main_title}\n") - f.write(f"{'=' * len(main_title)}\n\n") + f.write(make_heading("All classes", "=")) for group_name in CLASS_GROUPS: if group_name in grouped_classes: - group_title = translate(CLASS_GROUPS[group_name]) - - f.write(f"{group_title}\n") - f.write(f"{'=' * len(group_title)}\n\n") + f.write(make_heading(CLASS_GROUPS[group_name], "=")) f.write(".. toctree::\n") f.write(" :maxdepth: 1\n") @@ -2081,9 +2077,9 @@ def format_text_block( post_text = text[endurl_pos + 6 :] if pre_text and pre_text[-1] not in MARKUP_ALLOWED_PRECEDENT: - pre_text += "\ " + pre_text += "\\ " if post_text and post_text[0] not in MARKUP_ALLOWED_SUBSEQUENT: - post_text = "\ " + post_text + post_text = "\\ " + post_text text = pre_text + tag_text + post_text pos = len(pre_text) + len(tag_text) @@ -2161,9 +2157,9 @@ def format_text_block( # Properly escape things like `[Node]s` if escape_pre and pre_text and pre_text[-1] not in MARKUP_ALLOWED_PRECEDENT: - pre_text += "\ " + pre_text += "\\ " if escape_post and post_text and post_text[0] not in MARKUP_ALLOWED_SUBSEQUENT: - post_text = "\ " + post_text + post_text = "\\ " + post_text next_brac_pos = post_text.find("[", 0) iter_pos = 0 @@ -2171,7 +2167,7 @@ def format_text_block( iter_pos = post_text.find("*", iter_pos, next_brac_pos) if iter_pos == -1: break - post_text = f"{post_text[:iter_pos]}\*{post_text[iter_pos + 1 :]}" + post_text = f"{post_text[:iter_pos]}\\*{post_text[iter_pos + 1 :]}" iter_pos += 2 iter_pos = 0 @@ -2180,7 +2176,7 @@ def format_text_block( if iter_pos == -1: break if not post_text[iter_pos + 1].isalnum(): # don't escape within a snake_case word - post_text = f"{post_text[:iter_pos]}\_{post_text[iter_pos + 1 :]}" + post_text = f"{post_text[:iter_pos]}\\_{post_text[iter_pos + 1 :]}" iter_pos += 2 else: iter_pos += 1 @@ -2221,7 +2217,7 @@ def escape_rst(text: str, until_pos: int = -1) -> str: pos = text.find("*", pos, until_pos) if pos == -1: break - text = f"{text[:pos]}\*{text[pos + 1 :]}" + text = f"{text[:pos]}\\*{text[pos + 1 :]}" pos += 2 # Escape _ character at the end of a word to avoid interpreting it as an inline hyperlink @@ -2231,7 +2227,7 @@ def escape_rst(text: str, until_pos: int = -1) -> str: if pos == -1: break if not text[pos + 1].isalnum(): # don't escape within a snake_case word - text = f"{text[:pos]}\_{text[pos + 1 :]}" + text = f"{text[:pos]}\\_{text[pos + 1 :]}" pos += 2 else: pos += 1 diff --git a/doc/translations/de.po b/doc/translations/de.po index 7536065eb4..d6aad893bb 100644 --- a/doc/translations/de.po +++ b/doc/translations/de.po @@ -6,7 +6,7 @@ # Jaigskim <filzstift112@gmail.com>, 2020. # So Wieso <sowieso@dukun.de>, 2020, 2022, 2023. # artism90 <artism90@googlemail.com>, 2020. -# HugeGameArt <hugegameartgd@gmail.com>, 2020. +# HugeGameArt <hugegameartgd@gmail.com>, 2020, 2023. # Günther Bohn <ciscouser@gmx.de>, 2020, 2021. # Rémi Verschelde <akien@godotengine.org>, 2020. # Julian Pritzi <julian.pritzi@gmail.com>, 2020. @@ -76,12 +76,13 @@ # Cerno_b <cerno.b@gmail.com>, 2023. # Janosch Lion <janorico@posteo.de>, 2023. # Tobias Mohr <tobias_mohr_1991@gmx.de>, 2023. +# Florian Schaupp <fschaupp@hotmail.com>, 2023. msgid "" msgstr "" "Project-Id-Version: Godot Engine class reference\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" -"PO-Revision-Date: 2023-11-09 22:40+0000\n" -"Last-Translator: Tobias Mohr <tobias_mohr_1991@gmx.de>\n" +"PO-Revision-Date: 2023-12-02 19:36+0000\n" +"Last-Translator: Florian Schaupp <fschaupp@hotmail.com>\n" "Language-Team: German <https://hosted.weblate.org/projects/godot-engine/godot-" "class-reference/de/>\n" "Language: de\n" @@ -89,7 +90,16 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8-bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.2-dev\n" +"X-Generator: Weblate 5.3-dev\n" + +msgid "All classes" +msgstr "Alle Klassen" + +msgid "Nodes" +msgstr "Nodes" + +msgid "Resources" +msgstr "Ressourcen" msgid "Description" msgstr "Beschreibung" @@ -896,6 +906,81 @@ msgstr "" "zu einem Laufzeitfehler." msgid "" +"Mark the following property as exported (editable in the Inspector dock and " +"saved to disk). To control the type of the exported property, use the type " +"hint notation.\n" +"[codeblock]\n" +"extends Node\n" +"\n" +"enum Direction {LEFT, RIGHT, UP, DOWN}\n" +"\n" +"# Built-in types.\n" +"@export var string = \"\"\n" +"@export var int_number = 5\n" +"@export var float_number: float = 5\n" +"\n" +"# Enums.\n" +"@export var type: Variant.Type\n" +"@export var format: Image.Format\n" +"@export var direction: Direction\n" +"\n" +"# Resources.\n" +"@export var image: Image\n" +"@export var custom_resource: CustomResource\n" +"\n" +"# Nodes.\n" +"@export var node: Node\n" +"@export var custom_node: CustomNode\n" +"\n" +"# Typed arrays.\n" +"@export var int_array: Array[int]\n" +"@export var direction_array: Array[Direction]\n" +"@export var image_array: Array[Image]\n" +"@export var node_array: Array[Node]\n" +"[/codeblock]\n" +"[b]Note:[/b] Custom resources and nodes must be registered as global classes " +"using [code]class_name[/code].\n" +"[b]Note:[/b] Node export is only supported in [Node]-derived classes and has " +"a number of other limitations." +msgstr "" +"Markiere die folgende Eigenschaft als exportiert (editierbar im Inspector " +"Dock und auf der Festplatte gespeichert). Man kann die Art der exportierten " +"Eigenschaft mit der Typ-Hinweis Notation überprüfen.\n" +"[codeblock]\n" +"extends Node\n" +"\n" +"enum Direction {LEFT, RIGHT, UP, DOWN}\n" +"\n" +"# Built-in types.\n" +"@export var string = \"\"\n" +"@export var int_number = 5\n" +"@export var float_number: float = 5\n" +"\n" +"# Enums.\n" +"@export var type: Variant.Type\n" +"@export var format: Image.Format\n" +"@export var direction: Direction\n" +"\n" +"# Resources.\n" +"@export var image: Image\n" +"@export var custom_resource: CustomResource\n" +"\n" +"# Nodes.\n" +"@export var node: Node\n" +"@export var custom_node: CustomNode\n" +"\n" +"# Typed arrays.\n" +"@export var int_array: Array[int]\n" +"@export var direction_array: Array[Direction]\n" +"@export var image_array: Array[Image]\n" +"@export var node_array: Array[Node]\n" +"[/codeblock]\n" +"[b]Note:[/b] Custom resources and nodes must be registered as global classes " +"using [code]class_name[/code].\n" +"[b]Note:[/b] Node export is only supported in [Node]-derived classes and has " +"a number of other limitations." + +msgid "" "Define a new category for the following exported properties. This helps to " "organize properties in the Inspector dock.\n" "See also [constant PROPERTY_USAGE_CATEGORY].\n" @@ -3745,6 +3830,52 @@ msgstr "" "[/codeblock]" msgid "" +"Returns a human-readable name of the given [param type], using the [enum " +"Variant.Type] values.\n" +"[codeblock]\n" +"print(TYPE_INT) # Prints 2.\n" +"print(type_string(TYPE_INT)) # Prints \"int\".\n" +"print(type_string(TYPE_STRING)) # Prints \"String\".\n" +"[/codeblock]\n" +"See also [method typeof]." +msgstr "" +"Gibt einen lesbaren Namen des gegebenen [param-type] und verwendet dafür die " +"Werte aus [Variant.Type].\n" +"[codeblock]\n" +"print(TYPE_INT) # Gibt 2 aus.\n" +"print(type_string(TYPE_INT)) # Gibt einen \"int\" aus.\n" +"print(type_string(TYPE_STRING)) # Gibt einen \"String\" aus.\n" +"[/codeblock]\n" +"Siehe auch: [method typeof]." + +msgid "" +"Returns the internal type of the given [param variable], using the [enum " +"Variant.Type] values.\n" +"[codeblock]\n" +"var json = JSON.new()\n" +"json.parse('[\"a\", \"b\", \"c\"]')\n" +"var result = json.get_data()\n" +"if typeof(result) == TYPE_ARRAY:\n" +" print(result[0]) # Prints a\n" +"else:\n" +" print(\"Unexpected result\")\n" +"[/codeblock]\n" +"See also [method type_string]." +msgstr "" +"Gibt den internen Typ der angegebenen [param variable] zurück, unter " +"Verwendung der [enum Variant.Type]-Werte.\n" +"[codeblock]\n" +"var json = JSON.new()\n" +"json.parse('[\"a\", \"b\", \"c\"]')\n" +"var result = json.get_data()\n" +"if typeof(result) == TYPE_ARRAY:\n" +" print(result[0]) # Prints a\n" +"else:\n" +" print(\"Unexpected result\")\n" +"[/codeblock]\n" +"Siehe auch [method type_string]." + +msgid "" "Encodes a [Variant] value to a byte array, without encoding objects. " "Deserialization can be done with [method bytes_to_var].\n" "[b]Note:[/b] If you need object serialization, see [method " @@ -3812,25 +3943,6 @@ msgstr "" "ihren Daten." msgid "" -"Returns a weak reference to an object, or [code]null[/code] if [param obj] is " -"invalid.\n" -"A weak reference to an object is not enough to keep the object alive: when " -"the only remaining references to a referent are weak references, garbage " -"collection is free to destroy the referent and reuse its memory for something " -"else. However, until the object is actually destroyed the weak reference may " -"return the object even if there are no strong references to it." -msgstr "" -"Gibt einen schwachen Verweis auf ein Objekt zurück, oder [code]null[/code], " -"wenn [param obj] ungültig ist.\n" -"Eine schwache Referenz auf ein Objekt reicht nicht aus, um das Objekt am " -"Leben zu erhalten: Wenn die einzigen verbleibenden Referenzen auf einen " -"Referenten schwache Referenzen sind, steht es der Garbage Collection frei, " -"den Referenten zu zerstören und seinen Speicher für etwas anderes zu " -"verwenden. Bis zur tatsächlichen Zerstörung des Objekts kann die schwache " -"Referenz das Objekt jedoch zurückgeben, auch wenn es keine starken Referenzen " -"auf das Objekt gibt." - -msgid "" "Wraps the [Variant] [param value] between [param min] and [param max]. Can be " "used for creating loop-alike behavior or infinite surfaces.\n" "Variant types [int] and [float] are supported. If any of the arguments is " @@ -5687,6 +5799,14 @@ msgstr "" "bearbeitbar)." msgid "" +"Hints that the property's value is an object encoded as object ID, with its " +"type specified in the hint string. Used by the debugger." +msgstr "" +"Weist darauf hin, dass der Wert einer Eigenschaft ein Objekt ID eines " +"Objektes ist. Der Hinweisstring ist der Typ des Objektes. Wird vom Debugger " +"genutzt." + +msgid "" "If a property is [String], hints that the property represents a particular " "type (class). This allows to select a type from the create dialog. The " "property will store the selected type as a string.\n" @@ -5867,6 +5987,32 @@ msgstr "" "Typen korrekt zu erkennen." msgid "" +"[i]Deprecated.[/i] This hint is not used anywhere and will be removed in the " +"future." +msgstr "" +"[i]Obsolet.[/i] Dieser Hinweis ist nicht mehr in Verwendung und wird in " +"Zukunft entfernt." + +msgid "Hints that an object is too big to be sent via the debugger." +msgstr "" +"Weist darauf hin, dass ein Objekt zu groß ist, um über den Debugger gesendet " +"zu werden." + +msgid "" +"Hints that the hint string specifies valid node types for property of type " +"[NodePath]." +msgstr "" +"Weist darauf hin, dass der Hinweis-String bestimmt, welche Node-Typen für " +"[NodePath]-Eigenschaften gültig sind." + +msgid "" +"Hints that a property is an [Array] with the stored type specified in the " +"hint string." +msgstr "" +"Weist darauf hin, dass eine Eigenschaft ein [Array] ist, dessen Typ im " +"Hinweis-String festgelegt wird." + +msgid "" "Hints that a string property is a locale code. Editing it will show a locale " "dialog for picking language and country." msgstr "" @@ -5936,6 +6082,13 @@ msgstr "" "Dient dazu, Eigenschaften im Editor in einer Untergruppe (unter einer Gruppe) " "zusammenzufassen. Siehe [EditorInspector]." +msgid "" +"The property is a bitfield, i.e. it contains multiple flags represented as " +"bits." +msgstr "" +"Die Eigenschaft ist ein Bitfeld und repräsentiert daher beispielsweise " +"mehrere Flags als Bits." + msgid "The property does not save its state in [PackedScene]." msgstr "Die Eigenschaft speichert ihren Zustand nicht in [PackedScene]." @@ -5951,6 +6104,33 @@ msgstr "" "Die Eigenschaft ist eine Skriptvariable, die serialisiert und in der " "Szenendatei gespeichert werden soll." +msgid "If this property is modified, all inspector fields will be refreshed." +msgstr "" +"Wenn diese Eigenschaft geändert wird, werden alle Inspektor Felder " +"aktualisiert." + +msgid "" +"Signifies a default value from a placeholder script instance.\n" +"[i]Deprecated.[/i] This hint is not used anywhere and will be removed in the " +"future." +msgstr "" +"Beschreibt einen Default-Wert aus einer Platzhalter Skript-Instanz.\n" +"[i]Obsolet.[/i] Dieser Hinweis ist nicht in Verwendung und wird zukünftig " +"entfernt." + +msgid "" +"The property is an enum, i.e. it only takes named integer constants from its " +"associated enumeration." +msgstr "" +"Die Eigenschaft ist ein Enum, d.h. sie nimmt nur benannte Integer Konstanten " +"aus der zugehörigen Enumeration an." + +msgid "" +"If property has [code]nil[/code] as default value, its type will be [Variant]." +msgstr "" +"Wenn diese Eigenschaft [code]nil[/code] als Default Wert hat, ist sie vom Typ " +"[Variant]." + msgid "The property is an array." msgstr "Die Eigenschaft ist ein Array." @@ -5981,6 +6161,47 @@ msgstr "" "Die Eigenschaft wird im Editor nur angezeigt, wenn moderne Renderer " "unterstützt werden (die Rendering-Methode Kompatibilität ist ausgeschlossen)." +msgid "" +"The [NodePath] property will always be relative to the scene's root. Mostly " +"useful for local resources." +msgstr "" +"Die Eigenschaft [NodePath] ist immer relativ zur Szenen-Verzeichnis. Meist " +"für lokale Ressourcen hilfreich." + +msgid "" +"Inserting an animation key frame of this property will automatically " +"increment the value, allowing to easily keyframe multiple values in a row." +msgstr "" +"Das Setzen eines Animations-Keyframes auf diese Eigenschaft erhöht den Wert " +"automatisch. Dies ermöglicht die Verwendung von Keyframes auf mehreren Werten " +"einer Zeile." + +msgid "" +"When loading, the resource for this property can be set at the end of " +"loading.\n" +"[i]Deprecated.[/i] This hint is not used anywhere and will be removed in the " +"future." +msgstr "" +"Während dem Ladevorgang kann die Ressource der Eigenschaft auch am Ende " +"dessen gesetzt werden.\n" +"[i]Obsolet.[/i] Dieser Hinweis ist nicht in Verwendung und wird zukünftig " +"entfernt." + +msgid "" +"When this property is a [Resource] and base object is a [Node], a resource " +"instance will be automatically created whenever the node is created in the " +"editor." +msgstr "" +"Ist die Eigenschaft eine [Resource] und das Basisobjekt ein [Node], so wird " +"die Ressource instantiiert, sobald der Node im Editor erzeugt wird." + +msgid "" +"The property is considered a basic setting and will appear even when advanced " +"mode is disabled. Used for project settings." +msgstr "" +"Die Eigenschaft wird als Grundeinstellung gesehen, wodurch diese auch im " +"Standardmodus erscheint. Sie wird für Projekteinstellungen verwendet." + msgid "The property is read-only in the [EditorInspector]." msgstr "Die Eigenschaft ist im [EditorInspector] schreibgeschützt." @@ -6429,6 +6650,26 @@ msgstr "" "stattdessen [method is_equal_approx] verwenden, das zuverlässiger ist." msgid "" +"Inversely transforms (multiplies) the [AABB] by the given [Transform3D] " +"transformation matrix, under the assumption that the transformation basis is " +"orthonormal (i.e. rotation/reflection is fine, scaling/skew is not).\n" +"[code]aabb * transform[/code] is equivalent to [code]transform.inverse() * " +"aabb[/code]. See [method Transform3D.inverse].\n" +"For transforming by inverse of an affine transformation (e.g. with scaling) " +"[code]transform.affine_inverse() * aabb[/code] can be used instead. See " +"[method Transform3D.affine_inverse]." +msgstr "" +"Transformiert (multipliziert) die [AABB] invers mit der gegebenen " +"[Transform3D]-Transformationsmatrix, unter der Annahme, dass die " +"Transformationsbasis orthonormal ist (d. h. Drehung/Reflexion ist in Ordnung, " +"Skalierung/Skew nicht).\n" +"[code]aabb * transform[/code] ist äquivalent zu [code]transform.inverse() * " +"aabb[/code]. Siehe [Methode Transform3D.inverse].\n" +"Für die Transformation durch die Inverse einer affinen Transformation (z.B. " +"mit Skalierung) kann stattdessen [code]transform.affine_inverse() * aabb[/" +"code] verwendet werden. Siehe [Methode Transform3D.affine_inverse]." + +msgid "" "Returns [code]true[/code] if the AABBs are exactly equal.\n" "[b]Note:[/b] Due to floating-point precision errors, consider using [method " "is_equal_approx] instead, which is more reliable." @@ -8046,6 +8287,13 @@ msgstr "" "Dummy [AnimationPlayer] im Animationsplayer-Editor zu aktualisieren." msgid "" +"Process animation during process frames (see [constant Node." +"NOTIFICATION_INTERNAL_PROCESS])." +msgstr "" +"Verarbeite Animation während Prozess-Frames (siehe [constant Node. " +"NOTIFICATION_INTERNAL_PROCESS])." + +msgid "" "Do not process animation. Use [method advance] to process the animation " "manually." msgstr "" @@ -8481,6 +8729,129 @@ msgid "The specified connection already exists." msgstr "Die angegebene Verbindung existiert bereits." msgid "" +"A resource to add to an [AnimationNodeBlendTree]. This animation node will " +"execute a sub-animation and return once it finishes. Blend times for fading " +"in and out can be customized, as well as filters.\n" +"After setting the request and changing the animation playback, the one-shot " +"node automatically clears the request on the next process frame by setting " +"its [code]request[/code] value to [constant ONE_SHOT_REQUEST_NONE].\n" +"[codeblocks]\n" +"[gdscript]\n" +"# Play child animation connected to \"shot\" port.\n" +"animation_tree.set(\"parameters/OneShot/request\", AnimationNodeOneShot." +"ONE_SHOT_REQUEST_FIRE)\n" +"# Alternative syntax (same result as above).\n" +"animation_tree[\"parameters/OneShot/request\"] = AnimationNodeOneShot." +"ONE_SHOT_REQUEST_FIRE\n" +"\n" +"# Abort child animation connected to \"shot\" port.\n" +"animation_tree.set(\"parameters/OneShot/request\", AnimationNodeOneShot." +"ONE_SHOT_REQUEST_ABORT)\n" +"# Alternative syntax (same result as above).\n" +"animation_tree[\"parameters/OneShot/request\"] = AnimationNodeOneShot." +"ONE_SHOT_REQUEST_ABORT\n" +"\n" +"# Abort child animation with fading out connected to \"shot\" port.\n" +"animation_tree.set(\"parameters/OneShot/request\", AnimationNodeOneShot." +"ONE_SHOT_REQUEST_FADE_OUT)\n" +"# Alternative syntax (same result as above).\n" +"animation_tree[\"parameters/OneShot/request\"] = AnimationNodeOneShot." +"ONE_SHOT_REQUEST_FADE_OUT\n" +"\n" +"# Get current state (read-only).\n" +"animation_tree.get(\"parameters/OneShot/active\")\n" +"# Alternative syntax (same result as above).\n" +"animation_tree[\"parameters/OneShot/active\"]\n" +"\n" +"# Get current internal state (read-only).\n" +"animation_tree.get(\"parameters/OneShot/internal_active\")\n" +"# Alternative syntax (same result as above).\n" +"animation_tree[\"parameters/OneShot/internal_active\"]\n" +"[/gdscript]\n" +"[csharp]\n" +"// Play child animation connected to \"shot\" port.\n" +"animationTree.Set(\"parameters/OneShot/request\", (int)AnimationNodeOneShot." +"OneShotRequest.Fire);\n" +"\n" +"// Abort child animation connected to \"shot\" port.\n" +"animationTree.Set(\"parameters/OneShot/request\", (int)AnimationNodeOneShot." +"OneShotRequest.Abort);\n" +"\n" +"// Abort child animation with fading out connected to \"shot\" port.\n" +"animationTree.Set(\"parameters/OneShot/request\", (int)AnimationNodeOneShot." +"OneShotRequest.FadeOut);\n" +"\n" +"// Get current state (read-only).\n" +"animationTree.Get(\"parameters/OneShot/active\");\n" +"\n" +"// Get current internal state (read-only).\n" +"animationTree.Get(\"parameters/OneShot/internal_active\");\n" +"[/csharp]\n" +"[/codeblocks]" +msgstr "" +"Eine Ressource zu einem [AnimationNodeBlendTree] hinzufügen. Dieser " +"Animationsknoten führt eine Unteranimation aus und kehrt zurück, sobald er " +"fertig ist. Mischzeiten für Ein- und Ausblenden können angepasst werden, " +"sowie Filter.\n" +"Nach der Einstellung der Anfrage und der Änderung der Animationswiedergabe " +"löscht der Ein-Schuss-Knoten automatisch die Anfrage auf dem nächsten " +"Prozessrahmen, indem er seinen [code]Request[/code]-Wert auf [constant " +"ONE_SHOT_REQUEST_NONE] einstellt.\n" +"[codeblocks]\n" +"[gdscript]\n" +"# Spielen der Kinderanimation verbunden mit \"shot\" Port.\n" +"Animation_tree.set(\"parameter/OneShot/request\", AnimationNodeOneShot." +"ONE_SHOT_REQUEST_FIRE)\n" +"# Alternative Syntax (gleiches Ergebnis wie oben).\n" +"Animation_tree[\"parameter/OneShot/request\"] = AnimationNodeOneShot." +"ONE_SHOT_REQUEST_FIRE\n" +"\n" +"# Abbrechen der Kinderanimation verbunden mit \"shot\" Port.\n" +"Animation_tree.set(\"parameter/OneShot/request\", AnimationNodeOneShot." +"ONE_SHOT_REQUEST_ABORT)\n" +"# Alternative Syntax (gleiches Ergebnis wie oben).\n" +"Animation_tree[\"parameter/OneShot/request\"] = AnimationNodeOneShot." +"ONE_SHOT_REQUEST_ABORT\n" +"\n" +"# Abbrechen der Kinderanimation mit Fading out verbunden mit \"shot\" Port.\n" +"Animation_tree.set(\"parameter/OneShot/request\", AnimationNodeOneShot." +"ONE_SHOT_REQUEST_FADE_OUT)\n" +"# Alternative Syntax (gleiches Ergebnis wie oben).\n" +"Animation_tree[\"parameter/OneShot/request\"] = AnimationNodeOneShot." +"ONE_SHOT_REQUEST_FADE_OUT\n" +"\n" +"# Erhalten Sie den aktuellen Zustand (nur lesen).\n" +"animation_tree.get(\"parameter/OneShot/active\")\n" +"# Alternative Syntax (gleiches Ergebnis wie oben).\n" +"Animation_tree[\"parameter/OneShot/active\"]\n" +"\n" +"# Erhalten Sie den aktuellen internen Zustand (nur lesen).\n" +"animation_tree.get(\"parameter/OneShot/internal_active\")\n" +"# Alternative Syntax (gleiches Ergebnis wie oben).\n" +"Animation_tree[\"parameter/OneShot/internal_active\"]\n" +"[/gdscript]\n" +"[csharp]\n" +"// Kinderanimation mit \"Schuss\"-Port verbinden.\n" +"animationTree.Set(\"parameter/OneShot/request\", (int)AnimationNodeOneShot." +"OneShotRequest.Fire);\n" +"\n" +"// Abbrechen kinderanimation verbunden mit \"shot\" port.\n" +"animationTree.Set(\"parameter/OneShot/request\", (int)AnimationNodeOneShot." +"OneShotRequest.Abort);\n" +"\n" +"// Abbrechen kinderanimation mit ausblenden verbunden mit \"shot\" port.\n" +"animationTree.Set(\"parameter/OneShot/request\", (int)AnimationNodeOneShot." +"OneShotRequest.Fout);\n" +"\n" +"// Erhalten Sie aktuellen Zustand (nur lesen).\n" +"AnimationTree.Get(\"parameter/OneShot/active\");\n" +"\n" +"// Erhalten Sie aktuellen internen Zustand (nur lesen).\n" +"AnimationTree.Get(\"parameter/OneShot/internal_active\");\n" +"[/csharp]\n" +"[/codeblocks]" + +msgid "" "If [code]true[/code], the sub-animation will restart automatically after " "finishing.\n" "In other words, to start auto restarting, the animation must be played once " @@ -8755,6 +9126,13 @@ msgid "Returns [code]true[/code] if an animation is playing." msgstr "Gibt [code]true[/code] zurück, wenn eine Animation abgespielt wird." msgid "" +"If there is a next path by travel or auto advance, immediately transitions " +"from the current state to the next state." +msgstr "" +"Wenn es einen nächsten Weg durch Springen oder Autovorschub gibt, gehe sofort " +"vom aktuellen Zustand in den nächsten Zustand über." + +msgid "" "Starts playing the given animation.\n" "If [param reset] is [code]true[/code], the animation is played from the " "beginning." @@ -11479,7 +11857,7 @@ msgstr "" "Einrichten der Verdeckungsausblendung." msgid "Occlusion culling" -msgstr "Occlusion culling" +msgstr "Occlusion Culling" msgid "" "Sets [member indices] and [member vertices], while updating the final " @@ -12757,6 +13135,25 @@ msgstr "" "Tiefpassfilter für Rückkopplung, in Hz. Frequenzen unterhalb dieses Wertes " "werden aus dem Quellsignal herausgefiltert." +msgid "First tap delay time in milliseconds." +msgstr "Erste Tap-Verzögerungszeit in Millisekunden." + +msgid "Sound level for the first tap." +msgstr "Geräuschstufe für den ersten Click." + +msgid "" +"Pan position for the first tap. Value can range from -1 (fully left) to 1 " +"(fully right)." +msgstr "" +"Schwenkposition für den ersten Click. Der Wert kann von -1 (ganz links) bis 1 " +"(ganz rechts) reichen." + +msgid "Second tap delay time in milliseconds." +msgstr "Zweite Tap-Verzögerungszeit in Millisekunden." + +msgid "Sound level for the second tap." +msgstr "Geräuschstufe für den zweiten Click." + msgid "" "Different types are available: clip, tan, lo-fi (bit crushing), overdrive, or " "waveshape.\n" @@ -13704,6 +14101,147 @@ msgid "An audio stream with utilities for procedural sound generation." msgstr "Ein Audiostrom mit Hilfsprogrammen für die prozedurale Klangerzeugung." msgid "" +"[AudioStreamGenerator] is a type of audio stream that does not play back " +"sounds on its own; instead, it expects a script to generate audio data for " +"it. See also [AudioStreamGeneratorPlayback].\n" +"Here's a sample on how to use it to generate a sine wave:\n" +"[codeblocks]\n" +"[gdscript]\n" +"var playback # Will hold the AudioStreamGeneratorPlayback.\n" +"@onready var sample_hz = $AudioStreamPlayer.stream.mix_rate\n" +"var pulse_hz = 440.0 # The frequency of the sound wave.\n" +"\n" +"func _ready():\n" +" $AudioStreamPlayer.play()\n" +" playback = $AudioStreamPlayer.get_stream_playback()\n" +" fill_buffer()\n" +"\n" +"func fill_buffer():\n" +" var phase = 0.0\n" +" var increment = pulse_hz / sample_hz\n" +" var frames_available = playback.get_frames_available()\n" +"\n" +" for i in range(frames_available):\n" +" playback.push_frame(Vector2.ONE * sin(phase * TAU))\n" +" phase = fmod(phase + increment, 1.0)\n" +"[/gdscript]\n" +"[csharp]\n" +"[Export] public AudioStreamPlayer Player { get; set; }\n" +"\n" +"private AudioStreamGeneratorPlayback _playback; // Will hold the " +"AudioStreamGeneratorPlayback.\n" +"private float _sampleHz;\n" +"private float _pulseHz = 440.0f; // The frequency of the sound wave.\n" +"\n" +"public override void _Ready()\n" +"{\n" +" if (Player.Stream is AudioStreamGenerator generator) // Type as a " +"generator to access MixRate.\n" +" {\n" +" _sampleHz = generator.MixRate;\n" +" Player.Play();\n" +" _playback = (AudioStreamGeneratorPlayback)Player." +"GetStreamPlayback();\n" +" FillBuffer();\n" +" }\n" +"}\n" +"\n" +"public void FillBuffer()\n" +"{\n" +" double phase = 0.0;\n" +" float increment = _pulseHz / _sampleHz;\n" +" int framesAvailable = _playback.GetFramesAvailable();\n" +"\n" +" for (int i = 0; i < framesAvailable; i++)\n" +" {\n" +" _playback.PushFrame(Vector2.One * (float)Mathf.Sin(phase * Mathf." +"Tau));\n" +" phase = Mathf.PosMod(phase + increment, 1.0);\n" +" }\n" +"}\n" +"[/csharp]\n" +"[/codeblocks]\n" +"In the example above, the \"AudioStreamPlayer\" node must use an " +"[AudioStreamGenerator] as its stream. The [code]fill_buffer[/code] function " +"provides audio data for approximating a sine wave.\n" +"See also [AudioEffectSpectrumAnalyzer] for performing real-time audio " +"spectrum analysis.\n" +"[b]Note:[/b] Due to performance constraints, this class is best used from C# " +"or from a compiled language via GDExtension. If you still want to use this " +"class from GDScript, consider using a lower [member mix_rate] such as 11,025 " +"Hz or 22,050 Hz." +msgstr "" +"[AudioStreamGenerator] ist ein Typ von Audiostream, der nicht von sich aus " +"Töne abspielt, sondern ein Skript erwartet, das Audiodaten für ihn erzeugt. " +"Siehe auch [AudioStreamGeneratorPlayback].\n" +"Hier ist ein Beispiel, wie man damit eine Sinuswelle erzeugt:\n" +"[codeblocks]\n" +"[gdscript]\n" +"var playback # Will hold the AudioStreamGeneratorPlayback.\n" +"@onready var sample_hz = $AudioStreamPlayer.stream.mix_rate\n" +"var pulse_hz = 440.0 # The frequency of the sound wave.\n" +"\n" +"func _ready():\n" +" $AudioStreamPlayer.play()\n" +" playback = $AudioStreamPlayer.get_stream_playback()\n" +" fill_buffer()\n" +"\n" +"func fill_buffer():\n" +" var phase = 0.0\n" +" var increment = pulse_hz / sample_hz\n" +" var frames_available = playback.get_frames_available()\n" +"\n" +" for i in range(frames_available):\n" +" playback.push_frame(Vector2.ONE * sin(phase * TAU))\n" +" phase = fmod(phase + increment, 1.0)\n" +"[/gdscript]\n" +"[csharp]\n" +"[Export] public AudioStreamPlayer Player { get; set; }\n" +"\n" +"private AudioStreamGeneratorPlayback _playback; // Will hold the " +"AudioStreamGeneratorPlayback.\n" +"private float _sampleHz;\n" +"private float _pulseHz = 440.0f; // The frequency of the sound wave.\n" +"\n" +"public override void _Ready()\n" +"{\n" +" if (Player.Stream is AudioStreamGenerator generator) // Type as a " +"generator to access MixRate.\n" +" {\n" +" _sampleHz = generator.MixRate;\n" +" Player.Play();\n" +" _playback = (AudioStreamGeneratorPlayback)Player." +"GetStreamPlayback();\n" +" FillBuffer();\n" +" }\n" +"}\n" +"\n" +"public void FillBuffer()\n" +"{\n" +" double phase = 0.0;\n" +" float increment = _pulseHz / _sampleHz;\n" +" int framesAvailable = _playback.GetFramesAvailable();\n" +"\n" +" for (int i = 0; i < framesAvailable; i++)\n" +" {\n" +" _playback.PushFrame(Vector2.One * (float)Mathf.Sin(phase * Mathf." +"Tau));\n" +" phase = Mathf.PosMod(phase + increment, 1.0);\n" +" }\n" +"}\n" +"[/csharp]\n" +"[/codeblocks]\n" +"Im obigen Beispiel muss der Knoten \"AudioStreamPlayer\" einen " +"[AudioStreamGenerator] als Stream verwenden. Die Funktion [code]fill_buffer[/" +"code] liefert Audiodaten zur Annäherung an eine Sinuswelle.\n" +"Siehe auch [AudioEffectSpectrumAnalyzer] zur Durchführung einer Echtzeit-" +"Audio-Spektrum-Analyse.\n" +"[b]Hinweis:[/b] Aufgrund von Performance-Beschränkungen wird diese Klasse am " +"besten von C# oder von einer kompilierten Sprache über GDExtension verwendet. " +"Wenn Sie diese Klasse dennoch über GDScript verwenden möchten, sollten Sie " +"eine niedrigere [member mix_rate] wie 11.025 Hz oder 22.050 Hz verwenden." + +msgid "" "The length of the buffer to generate (in seconds). Lower values result in " "less latency, but require the script to generate audio data faster, resulting " "in increased CPU usage and more risk for audio cracking if the CPU can't keep " @@ -13773,6 +14311,14 @@ msgstr "" "[code]0[/code] ist, ist der Puffer voll." msgid "" +"Returns the number of times the playback skipped due to a buffer underrun in " +"the audio sample data. This value is reset at the start of the playback." +msgstr "" +"Gibt die Anzahl der Zeiten einer Wiedergabe zurück, die aufgrund eines " +"Pufferunterlaufs in den Audioprobendaten übersprungen wurden. Dieser Wert " +"wird zu Beginn der Wiedergabe zurückgesetzt." + +msgid "" "Pushes several audio data frames to the buffer. This is usually more " "efficient than [method push_frame] in C# and compiled languages via " "GDExtension, but [method push_buffer] may be [i]less[/i] efficient in " @@ -14690,6 +15236,13 @@ msgstr "" "Der Bereich, der von der [BackBufferCopy] abgedeckt wird. Wird nur verwendet, " "wenn [member copy_mode] die [Konstante COPY_MODE_RECT] ist." +msgid "" +"Disables the buffering mode. This means the [BackBufferCopy] node will " +"directly use the portion of screen it covers." +msgstr "" +"Deaktiviert den Buffer-Modus. Das bedeutet, dass der [BackBufferCopy]-Knoten " +"den Ausschnitt des Bildschirms benutzen wird, den er abdeckt." + msgid "[BackBufferCopy] buffers a rectangular region." msgstr "[BackBufferCopy] speichert eine rechteckige Region zwischen." @@ -14737,6 +15290,22 @@ msgstr "" "noch nicht verlassen hat." msgid "" +"Changes the [member button_pressed] state of the button, without emitting " +"[signal toggled]. Use when you just want to change the state of the button " +"without sending the pressed event (e.g. when initializing scene). Only works " +"if [member toggle_mode] is [code]true[/code].\n" +"[b]Note:[/b] This method doesn't unpress other buttons in [member " +"button_group]." +msgstr "" +"Ändert den Zustand des Buttons [member button_pressed], ohne dass [signal " +"toggled] aufgerufen wird. Verwenden Sie es nur, wenn Sie den Zustand des " +"Buttons ändern möchten, ohne das Gedrückt-Ereignis zu senden (z.B. wenn Sie " +"Szene initialisieren). Nur funktioniert, wenn [member toggle_mode] " +"[code]true[/code] ist.\n" +"[b]Anmerkung:[/b] Diese Methode druckt keine anderen Tasten in [member " +"button_group]." + +msgid "" "Determines when the button is considered clicked, one of the [enum " "ActionMode] constants." msgstr "" @@ -14765,6 +15334,100 @@ msgstr "" "[code]MOUSE_BUTTON_MASK_LEFT | MOUSE_BUTTON_MASK_RIGHT[/code]." msgid "" +"If [code]true[/code], the button's state is pressed. Means the button is " +"pressed down or toggled (if [member toggle_mode] is active). Only works if " +"[member toggle_mode] is [code]true[/code].\n" +"[b]Note:[/b] Setting [member button_pressed] will result in [signal toggled] " +"to be emitted. If you want to change the pressed state without emitting that " +"signal, use [method set_pressed_no_signal]." +msgstr "" +"Wenn [code]true[/code], wird der Zustand des Buttons gedrückt. Bedeutet, dass " +"die Taste nach unten gedrückt oder angeschaltet wird (wenn [member " +"toggle_mode] aktiv ist). Funktioniert nur, wenn [member toggle_mode] " +"[code]true[/code] ist.\n" +"[b]Hinweis:[/b] Die Einstellung [member button_pressed] führt dazu, dass " +"[signal toggled] aufgerufen wird. Wenn Sie den gedrückten Zustand ändern " +"möchten, ohne dieses Signal zu emittieren, verwenden Sie [Method " +"set_pressed_no_signal]." + +msgid "" +"If [code]true[/code], the button is in disabled state and can't be clicked or " +"toggled." +msgstr "" +"Wenn [code]true[/code], ist der Button im deaktivierten Zustand und kann " +"nicht angeklickt oder umgeschaltet werden." + +msgid "" +"If [code]true[/code], the button stays pressed when moving the cursor outside " +"the button while pressing it.\n" +"[b]Note:[/b] This property only affects the button's visual appearance. " +"Signals will be emitted at the same moment regardless of this property's " +"value." +msgstr "" +"Wenn [code]true[/code], bleibt der Button gedrückt, wenn Sie den Cursor vom " +"Button weg bewegen, während Sie diesen drücken.\n" +"[b]Anmerkung:[/b] Diese Eigenschaft beeinflusst nur das visuelle " +"Erscheinungsbild des Buttons. Signale werden im gleichen Moment unabhängig " +"von dem Wert dieser Eigenschaft aufgerufen." + +msgid "[Shortcut] associated to the button." +msgstr "[Shortcut] der Schaltfläche zugeordnet." + +msgid "" +"If [code]true[/code], the button will highlight for a short amount of time " +"when its shortcut is activated. If [code]false[/code] and [member " +"toggle_mode] is [code]false[/code], the shortcut will activate without any " +"visual feedback." +msgstr "" +"Wenn [code]true[/code], wird der Button für eine kurze Zeit, wenn ihre " +"Verknüpfung aktiviert wird, markiert. Wenn [code]false[/code] und [member " +"toggle_mode] [code]false[/code] ist, wird die Verknüpfung ohne visuelles " +"Feedback aktiviert." + +msgid "" +"If [code]true[/code], the button will add information about its shortcut in " +"the tooltip." +msgstr "" +"Wenn [code]true[/code], wird der Button Informationen über ihre Verknüpfung " +"im Tooltip hinzufügen." + +msgid "" +"If [code]true[/code], the button is in toggle mode. Makes the button flip " +"state between pressed and unpressed each time its area is clicked." +msgstr "" +"Wenn [code]true[/code], ist der Button im Umschaltmodus. Macht den Knopf-Flip-" +"Zustand zwischen gedrückt und gedrückt jedes Mal, wenn sein Bereich " +"angeklickt wird." + +msgid "Emitted when the button starts being held down." +msgstr "Aufgerufen, sobald der Button nach unten gehalten wird." + +msgid "Emitted when the button stops being held down." +msgstr "Aufgerufen, sobald der Button nicht mehr nach unten gehalten wird." + +msgid "" +"Emitted when the button is toggled or pressed. This is on [signal " +"button_down] if [member action_mode] is [constant ACTION_MODE_BUTTON_PRESS] " +"and on [signal button_up] otherwise.\n" +"If you need to know the button's pressed state (and [member toggle_mode] is " +"active), use [signal toggled] instead." +msgstr "" +"Aufgerufen, wenn der Button umgeschaltet oder gedrückt wird. Dies ist der " +"Fall bei [signal button_down], wenn [member action_mode] [constant " +"ACTION_MODE_BUTTON_PRESS] gilt oder [signal button_up] andernfalls.\n" +"Wenn Sie den gedrückten Zustand des Buttons kennen müssen (und [member " +"toggle_mode] aktiv ist), verwenden Sie stattdessen [signal toggled]." + +msgid "" +"Emitted when the button was just toggled between pressed and normal states " +"(only if [member toggle_mode] is active). The new state is contained in the " +"[param toggled_on] argument." +msgstr "" +"Aufgerufen, wenn der Button nur zwischen gedrückten und normalen Zuständen " +"umgeschaltet wurde (nur, wenn [member toggle_mode] aktiv ist). Der neue " +"Zustand ist im [param toggled_on] Argument enthalten." + +msgid "" "The normal state (i.e. not pressed, not hovered, not toggled and enabled) of " "buttons." msgstr "" @@ -14774,9 +15437,15 @@ msgstr "" msgid "The state of buttons are pressed." msgstr "Der Zustand der gedrückten Buttons." +msgid "The state of buttons are hovered." +msgstr "Der Zustand der Knöpfe sind schwebend." + msgid "The state of buttons are disabled." msgstr "Der Status der Buttons ist deaktiviert." +msgid "The state of buttons are both hovered and pressed." +msgstr "Der Zustand der Knöpfe sind sowohl schwebend als auch gedrückt." + msgid "Require just a press to consider the button clicked." msgstr "Es genügt ein Druck, um den Button als angeklickt zu betrachten." @@ -14825,6 +15494,22 @@ msgstr "" "gesetzt wird." msgid "" +"If [code]true[/code], enables the specified flag. Flags are optional behavior " +"that can be turned on and off. Only one flag can be enabled at a time with " +"this function, the flag enumerators cannot be bit-masked together to enable " +"or disable multiple flags at once. Flags can also be enabled by setting the " +"corresponding member to [code]true[/code]. See [enum Flags] enumerator for " +"options." +msgstr "" +"Wenn [code]true[/code], wird das angegebene Flag aktiviert. Flags sind " +"optionales Verhalten, die ein- und ausgeschaltet werden können. Mit dieser " +"Funktion kann nur eine Flagge gleichzeitig aktiviert werden, die " +"Flaggenenumeratoren können nicht zusammen Bit maskiert werden, um mehrere " +"Flags gleichzeitig zu aktivieren oder zu deaktivieren. Flags können auch " +"aktiviert werden, indem das entsprechende Mitglied auf [code]true[/code] " +"gesetzt wird. Siehe [enum Flags] Enumerator für Optionen." + +msgid "" "The material's base color.\n" "[b]Note:[/b] If [member detail_enabled] is [code]true[/code] and a [member " "detail_albedo] texture is specified, [member albedo_color] will [i]not[/i] " @@ -14872,6 +15557,14 @@ msgstr "" "albedo_texture_force_srgb] [code]false[/code] ist, wenn es nicht sein sollte, " "wird die Textur zu hell erscheinen." +msgid "" +"Enables multichannel signed distance field rendering shader. Use [member " +"msdf_pixel_range] and [member msdf_outline_size] to configure MSDF parameters." +msgstr "" +"Ermöglicht einen mehrkanaligen signierten Distanzfeld Rendering Shader. " +"Verwenden Sie [member msdf_pixel_range] und [member msdf_outline_size], um " +"MSDF-Parameter zu konfigurieren." + msgid "Threshold at which antialiasing will be applied on the alpha channel." msgstr "" "Schwellenwert, bei dem das Antialiasing auf den Alphakanal angewendet wird." @@ -14881,6 +15574,18 @@ msgstr "" "Der Typ des anzuwendenden Alpha-Antialiasing. Siehe [enum AlphaAntiAliasing]." msgid "" +"Threshold at which the alpha scissor will discard values. Higher values will " +"result in more pixels being discarded. If the material becomes too opaque at " +"a distance, try increasing [member alpha_scissor_threshold]. If the material " +"disappears at a distance, try decreasing [member alpha_scissor_threshold]." +msgstr "" +"Schwelle, bei der die Werte der alpha-Schere verworfen werden. Höhere Werte " +"führen dazu, dass mehr Pixel verworfen werden. Wenn das Material in einer " +"Entfernung zu durchsichtig wird, versuchen Sie, [member " +"alpha_scissor_threshold] zu erhöhen. Wenn das Material in einer Entfernung " +"verschwindet, versuchen Sie, [Mitglied alpha_scissor_threshold] zu verringern." + +msgid "" "The strength of the anisotropy effect. This is multiplied by [member " "anisotropy_flowmap]'s alpha channel if a texture is defined there and the " "texture contains an alpha channel." @@ -14890,6 +15595,618 @@ msgstr "" "ist und die Textur einen Alphakanal enthält." msgid "" +"If [code]true[/code], anisotropy is enabled. Anisotropy changes the shape of " +"the specular blob and aligns it to tangent space. This is useful for brushed " +"aluminium and hair reflections.\n" +"[b]Note:[/b] Mesh tangents are needed for anisotropy to work. If the mesh " +"does not contain tangents, the anisotropy effect will appear broken.\n" +"[b]Note:[/b] Material anisotropy should not to be confused with anisotropic " +"texture filtering, which can be enabled by setting [member texture_filter] to " +"[constant TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC]." +msgstr "" +"Wenn [code]true[/code] aktiviert ist, wird Anisotropie aktiviert. Anisotropie " +"verändert die Form des spekulären Blobs und richtet es zum tangenten Raum " +"aus. Dies ist nützlich für gebürstetes Aluminium und Haarreflexionen.\n" +"[b]Anmerkung:[/b] Mesh-Tantigen werden benötigt, um anisotropie zu arbeiten. " +"Wenn das Netz keine Tangenten enthält, erscheint der Anisotropieeffekt " +"gebrochen.\n" +"[b]Anmerkung:[/b] Materialanisotropie sollte nicht mit anisotroper " +"Texturfilterung verwechselt werden, die durch Einstellung [member " +"textur_filter] auf [constant TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC] " +"aktiviert werden kann." + +msgid "" +"Texture that offsets the tangent map for anisotropy calculations and " +"optionally controls the anisotropy effect (if an alpha channel is present). " +"The flowmap texture is expected to be a derivative map, with the red channel " +"representing distortion on the X axis and green channel representing " +"distortion on the Y axis. Values below 0.5 will result in negative " +"distortion, whereas values above 0.5 will result in positive distortion.\n" +"If present, the texture's alpha channel will be used to multiply the strength " +"of the [member anisotropy] effect. Fully opaque pixels will keep the " +"anisotropy effect's original strength while fully transparent pixels will " +"disable the anisotropy effect entirely. The flowmap texture's blue channel is " +"ignored." +msgstr "" +"Textur, welche die tangente Karte für Anisotropieberechnungen versetzt und " +"optional den Anisotropieeffekt steuert (wenn ein alpha-Kanal vorhanden ist). " +"Die Flowmap-Textur soll eine Derivatkarte sein, wobei der rote Kanal " +"Verzerrung auf der X-Achse und grüne Kanalverzerrung auf der Y-Achse " +"darstellt. Werte unter 0,5 werden zu negativen Verzerrungen führen, während " +"Werte über 0,5 zu positiven Verzerrungen führen.\n" +"Wenn vorhanden, wird der alpha-Kanal der Textur verwendet, um die Stärke des " +"[member anisotropy]-Effekts zu multiplizieren. Vollständig opake Pixel halten " +"die ursprüngliche Stärke der Anisotropie-Effekt, während volltransparente " +"Pixel den Anisotropie-Effekt vollständig deaktivieren. Der blaue Kanal der " +"Flowmap Textur wird ignoriert." + +msgid "" +"If [code]true[/code], ambient occlusion is enabled. Ambient occlusion darkens " +"areas based on the [member ao_texture]." +msgstr "" +"Wenn [code]true[/code], ist die Umgebungsocclusion aktiviert. Ambient " +"occlusion verdunkelt Bereiche abhängig von der [member ao_texture]." + +msgid "" +"Amount that ambient occlusion affects lighting from lights. If [code]0[/" +"code], ambient occlusion only affects ambient light. If [code]1[/code], " +"ambient occlusion affects lights just as much as it affects ambient light. " +"This can be used to impact the strength of the ambient occlusion effect, but " +"typically looks unrealistic." +msgstr "" +"Stärke, inwieweit die Beleuchtung von Licht durch Ambient Occlusion " +"beeinflusst wird. Wenn [code]0[/code], wirkt die Umgebungsocclusion nur auf " +"Umgebungslicht. Wenn [code]1[/code], wirkt Umgebungs-Occlusion auf Lichter " +"genauso stark wie Umgebungslicht. Dies kann verwendet werden, um die Stärke " +"des Ambient Occlusion Effektes zu beeinflussen, sieht aber typischerweise " +"unrealistisch aus." + +msgid "" +"If [code]true[/code], use [code]UV2[/code] coordinates to look up from the " +"[member ao_texture]." +msgstr "" +"Wenn [code]true[/code] verwendet [code]UV2[/code] Koordinaten, um aus der " +"[member ao_texture] zu suchen." + +msgid "" +"Texture that defines the amount of ambient occlusion for a given point on the " +"object." +msgstr "" +"Textur, die für einen bestimmten Punkt auf dem Objekt die Menge der ambient " +"occlusion definiert." + +msgid "" +"Specifies the channel of the [member ao_texture] in which the ambient " +"occlusion information is stored. This is useful when you store the " +"information for multiple effects in a single texture. For example if you " +"stored metallic in the red channel, roughness in the blue, and ambient " +"occlusion in the green you could reduce the number of textures you use." +msgstr "" +"Gibt den Kanal der [member ao_texture] an, in dem die Umgebungs-" +"Occlusionsinformationen gespeichert sind. Dies ist nützlich, wenn Sie die " +"Informationen für mehrere Effekte in einer einzigen Textur speichern. Zum " +"Beispiel, wenn Sie Metallic im roten Kanal gespeichert, Rauheit in der blauen " +"und Umgebung Okklusion in der grünen Sie könnte die Anzahl der Texturen, die " +"Sie verwenden." + +msgid "" +"The color used by the backlight effect. Represents the light passing through " +"an object." +msgstr "" +"Die Farbe der Hintergrundbeleuchtung. Stellt das durch ein Objekt " +"hindurchtretende Licht dar." + +msgid "" +"Texture used to control the backlight effect per-pixel. Added to [member " +"backlight]." +msgstr "" +"Textur, die verwendet wird, um den Hintergrund-Effekt pro Pixel zu steuern. " +"Hinzugefügt zu [member backlight]." + +msgid "" +"Controls how the object faces the camera. See [enum BillboardMode].\n" +"[b]Note:[/b] Billboard mode is not suitable for VR because the left-right " +"vector of the camera is not horizontal when the screen is attached to your " +"head instead of on the table. See [url=https://github.com/godotengine/godot/" +"issues/41567]GitHub issue #41567[/url] for details." +msgstr "" +"Kontrolliert, wie das Objekt der Kamera zugewandt ist. Siehe [enum " +"BillboardMode].\n" +"[b]Anmerkung:[/b] Billboard-Modus ist nicht für VR geeignet, da der linke " +"rechte Vektor der Kamera nicht horizontal ist, wenn der Bildschirm statt auf " +"dem Tisch an Ihrem Kopf angebracht ist. Siehe [url=https://github.com/" +"godotengine/godot/issues/41567]GitHub Ausgabe #41567[/url] für Details." + +msgid "" +"The material's blend mode.\n" +"[b]Note:[/b] Values other than [code]Mix[/code] force the object into the " +"transparent pipeline. See [enum BlendMode]." +msgstr "" +"Der Mix-Modus des Materials.\n" +"[b]Anmerkung:[/b] Andere Werte als [code]Mix[/code] zwingen das Objekt in die " +"transparente Pipeline. Siehe [enum BlendMode]." + +msgid "" +"Sets the strength of the clearcoat effect. Setting to [code]0[/code] looks " +"the same as disabling the clearcoat effect." +msgstr "" +"Setzt die Stärke des Klarlackeffekts. Das Einstellen auf [code]0[/code] sieht " +"genauso aus wie das Deaktivieren des Klarlackeffekts." + +msgid "" +"If [code]true[/code], clearcoat rendering is enabled. Adds a secondary " +"transparent pass to the lighting calculation resulting in an added specular " +"blob. This makes materials appear as if they have a clear layer on them that " +"can be either glossy or rough.\n" +"[b]Note:[/b] Clearcoat rendering is not visible if the material's [member " +"shading_mode] is [constant SHADING_MODE_UNSHADED]." +msgstr "" +"Wenn [code]true[/code] aktiviert ist, wird die Klarlackierung aktiviert. Fügt " +"einen sekundären transparenten Pass zur Lichtberechnung hinzu, der zu einem " +"zusätzlichen spekulären Blob führt. Dadurch erscheinen Materialien, als ob " +"sie eine klare Schicht auf ihne[/code]n haben, die glänzend oder rau sein " +"kann.\n" +"[b]Anmerkung:[/b] Klarlack-Rendering ist nicht sichtbar, wenn das Material " +"[member shading_mode] [constant] ist SHADING_MODE_UNSHADED]." + +msgid "" +"Sets the roughness of the clearcoat pass. A higher value results in a rougher " +"clearcoat while a lower value results in a smoother clearcoat." +msgstr "" +"Setzt die Rauhigkeit des Klarlackpasses. Ein höherer Wert führt zu einem " +"raueren Klarlack, während ein niedrigerer Wert zu einem glatteren Klarlack " +"führt." + +msgid "" +"Texture that defines the strength of the clearcoat effect and the glossiness " +"of the clearcoat. Strength is specified in the red channel while glossiness " +"is specified in the green channel." +msgstr "" +"Textur, welche die Stärke des Klarlackeffekts und die Glanzigkeit des " +"Klarlacks definiert. Stärke wird im roten Kanal angegeben, während Glanz im " +"grünen Kanal angegeben wird." + +msgid "" +"Determines which side of the triangle to cull depending on whether the " +"triangle faces towards or away from the camera. See [enum CullMode]." +msgstr "" +"Bestimmt, welche Seite des Dreiecks gecullt wird in Abhängigkeit davon, ob " +"das Dreieck zu oder von der Kamera zugewandt ist. Siehe [enum CullMode]." + +msgid "" +"Determines when depth rendering takes place. See [enum DepthDrawMode]. See " +"also [member transparency]." +msgstr "" +"Bestimmt, wenn die Tiefenwiedergabe erfolgt. Siehe [enum DepthDrawMode]. " +"Siehe auch [Teil Transparenz]." + +msgid "" +"Texture that specifies the color of the detail overlay. [member " +"detail_albedo]'s alpha channel is used as a mask, even when the material is " +"opaque. To use a dedicated texture as a mask, see [member detail_mask].\n" +"[b]Note:[/b] [member detail_albedo] is [i]not[/i] modulated by [member " +"albedo_color]." +msgstr "" +"Textur, welche die Farbe der Detailauflage angibt. [member detail_albedo] " +"Alpha-Kanal wird als Maske verwendet, auch wenn das Material undurchsichtig " +"ist. Um eine dedizierte Textur als Maske zu verwenden, siehe [member " +"detail_mask].\n" +"[b]Anmerkung:[/b] [member detail_albedo] ist [i]nicht[/i] moduliert durch " +"[member albedo_color]." + +msgid "" +"Specifies how the [member detail_albedo] should blend with the current " +"[code]ALBEDO[/code]. See [enum BlendMode] for options." +msgstr "" +"Gibt an, wie der [member detail_albedo] mit dem aktuellen [code]ALBEDO[/code] " +"mischen sollte. Siehe [enum BlendMode] für Optionen." + +msgid "" +"If [code]true[/code], enables the detail overlay. Detail is a second texture " +"that gets mixed over the surface of the object based on [member detail_mask] " +"and [member detail_albedo]'s alpha channel. This can be used to add variation " +"to objects, or to blend between two different albedo/normal textures." +msgstr "" +"Wenn [code]true[/code] die Detailauflage ermöglicht. Detail ist eine zweite " +"Textur, die über die Oberfläche des Objekts gemischt wird, basierend auf " +"[member detail_mask] und [member detail_albedo] Alpha-Kanal. Dies kann " +"verwendet werden, um Variationen zu Objekten hinzuzufügen oder zwischen zwei " +"verschiedenen albedo/normalen Texturen zu vermischen." + +msgid "" +"Texture used to specify how the detail textures get blended with the base " +"textures. [member detail_mask] can be used together with [member " +"detail_albedo]'s alpha channel (if any)." +msgstr "" +"Textur verwendet, um festzulegen, wie die Detailtexturen mit den " +"Basistexturen vermischt werden. [member detail_mask] kann zusammen mit " +"[member detail_albedo]'s alpha-Kanal (falls vorhanden) verwendet werden." + +msgid "" +"Texture that specifies the per-pixel normal of the detail overlay. The " +"[member detail_normal] texture only uses the red and green channels; the blue " +"and alpha channels are ignored. The normal read from [member detail_normal] " +"is oriented around the surface normal provided by the [Mesh].\n" +"[b]Note:[/b] Godot expects the normal map to use X+, Y+, and Z+ coordinates. " +"See [url=http://wiki.polycount.com/wiki/" +"Normal_Map_Technical_Details#Common_Swizzle_Coordinates]this page[/url] for a " +"comparison of normal map coordinates expected by popular engines." +msgstr "" +"Textur, welche die Per-Pixel-Norm der Detailauflage angibt. Die [member " +"detail_normal] Textur verwendet nur die roten und grünen Kanäle; die blauen " +"und alpha-Kanäle werden ignoriert. Die normale Auslesung von [member " +"detail_normal] wird um die von der [Mesh] bereitgestellte Oberflächennormale " +"ausgerichtet.\n" +"[b]Anmerkung:[/b] Godot erwartet, dass die normale Karte X+, Y+ und Z+ " +"Koordinaten verwendet. Siehe [url=http://wiki.polycount.com/wiki/" +"Normal_Map_Technical_Details#Common_Swizzle_Coordinates] diese Seite[/url] " +"für einen Vergleich von normalen Kartenkoordinaten, die von beliebten Motoren " +"erwartet werden." + +msgid "" +"Specifies whether to use [code]UV[/code] or [code]UV2[/code] for the detail " +"layer. See [enum DetailUV] for options." +msgstr "" +"Gibt an, ob für die Detailschicht [code]UV[/code] oder [code]UV2[/code] " +"verwendet werden soll. Siehe [enum DetailUV] für Optionen." + +msgid "The algorithm used for diffuse light scattering. See [enum DiffuseMode]." +msgstr "" +"Der Algorithmus, welcher zur diffusen Lichtstreuung verwendet wird. Siehe " +"[enum DiffuseMode]." + +msgid "If [code]true[/code], the object receives no ambient light." +msgstr "Wenn [code]true[/code], erhält das Objekt kein Umgebungslicht." + +msgid "" +"If [code]true[/code], the object will not be affected by fog (neither " +"volumetric nor depth fog). This is useful for unshaded or transparent " +"materials (e.g. particles), which without this setting will be affected even " +"if fully transparent." +msgstr "" +"Wenn [code]true[/code], wird das Objekt nicht durch Nebel (weder " +"volumetrischer noch Tiefennebel) beeinflusst. Dies ist für ungeschirmte oder " +"transparente Materialien (z.B. Partikel) sinnvoll, die ohne diese Einstellung " +"auch bei volltransparenter Transparenz beeinträchtigt werden." + +msgid "" +"If [code]true[/code], the object receives no shadow that would otherwise be " +"cast onto it." +msgstr "" +"Wenn [code]true[/code], erhält das Objekt keinen Schatten, welcher sonst auf " +"ihn geworfen würde." + +msgid "" +"Distance at which the object appears fully opaque.\n" +"[b]Note:[/b] If [member distance_fade_max_distance] is less than [member " +"distance_fade_min_distance], the behavior will be reversed. The object will " +"start to fade away at [member distance_fade_max_distance] and will fully " +"disappear once it reaches [member distance_fade_min_distance]." +msgstr "" +"Entfernung, bei der das Objekt vollständig opak erscheint.\n" +"[b]Hinweis:[/b] Wenn [mit Abstand_fade_max_distanz] kleiner als [mit " +"Abstand_fade_min_distanz] ist, wird das Verhalten umgekehrt. Das Objekt wird " +"beginnen, in [member Distance_fade_max_distanz] wegzufallen und wird nach dem " +"Erreichen [member Distance_fade_min_distanz] vollständig verschwinden." + +msgid "" +"Distance at which the object starts to become visible. If the object is less " +"than this distance away, it will be invisible.\n" +"[b]Note:[/b] If [member distance_fade_min_distance] is greater than [member " +"distance_fade_max_distance], the behavior will be reversed. The object will " +"start to fade away at [member distance_fade_max_distance] and will fully " +"disappear once it reaches [member distance_fade_min_distance]." +msgstr "" +"Entfernung, bei der das Objekt sichtbar wird. Ist das Objekt weniger als " +"dieser Abstand entfernt, wird es unsichtbar sein.\n" +"[b]Hinweis:[/b] Wenn [Mitglied Distance_fade_min_entfernung] größer ist als " +"[Mitglied Distance_fade_max_entfernung], wird das Verhalten umgekehrt. Das " +"Objekt wird beginnen, in [member Distance_fade_max_distanz] wegzufallen und " +"wird nach dem Erreichen [member Distance_fade_min_distanz] vollständig " +"verschwinden." + +msgid "" +"Specifies which type of fade to use. Can be any of the [enum " +"DistanceFadeMode]s." +msgstr "" +"Gibt an, welche Art von Fade verwendet werden soll. Kann eines der [enum " +"DistanceFadeMode]s sein." + +msgid "The emitted light's color. See [member emission_enabled]." +msgstr "Die Farbe des emittierten Lichts. Siehe [member emissions_enabled]." + +msgid "" +"If [code]true[/code], the body emits light. Emitting light makes the object " +"appear brighter. The object can also cast light on other objects if a " +"[VoxelGI], SDFGI, or [LightmapGI] is used and this object is used in baked " +"lighting." +msgstr "" +"Wenn [code]true[/code], emittiert der Körper Licht. Leuchtendes Licht macht " +"das Objekt heller. Das Objekt kann auch Licht auf andere Objekte werfen, wenn " +"ein [VoxelGI], SDFGI oder [LightmapGI] verwendet wird und dieses Objekt in " +"gebackener Beleuchtung verwendet wird." + +msgid "Multiplier for emitted light. See [member emission_enabled]." +msgstr "Multiplikator für emittiertes Licht. Siehe [member emissions_enabled]." + +msgid "" +"Luminance of emitted light, measured in nits (candela per square meter). Only " +"available when [member ProjectSettings.rendering/lights_and_shadows/" +"use_physical_light_units] is enabled. The default is roughly equivalent to an " +"indoor lightbulb." +msgstr "" +"Leuchtstärke des emittierten Lichts, gemessen in nits (candela pro " +"Quadratmeter). Nur verfügbar, wenn [member ProjectSettings.rendering/" +"lights_and_shadows/use_physical_light_units] aktiviert ist. Die " +"Standardeinstellung entspricht etwa einem Innenlichtbogen." + +msgid "Use [code]UV2[/code] to read from the [member emission_texture]." +msgstr "" +"Verwenden Sie [code]UV2[/code], um aus der [member emissions_texture] zu " +"lesen." + +msgid "" +"Sets how [member emission] interacts with [member emission_texture]. Can " +"either add or multiply. See [enum EmissionOperator] for options." +msgstr "" +"Legt fest, wie [member emission] mit [member emission_texture] interagiert. " +"Kann entweder hinzufügen oder multiplizieren. Siehe [enum EmissionOperator] " +"für Optionen." + +msgid "Texture that specifies how much surface emits light at a given point." +msgstr "" +"Textur, die spezifiziert, wie viel Oberfläche Licht an einem bestimmten Punkt " +"emittiert." + +msgid "" +"If [code]true[/code], the object is rendered at the same size regardless of " +"distance." +msgstr "" +"Wenn [code]true[/code], wird das Objekt unabhängig von der Entfernung gleich " +"groß gemacht." + +msgid "" +"If [code]true[/code], enables the vertex grow setting. This can be used to " +"create mesh-based outlines using a second material pass and its [member " +"cull_mode] set to [constant CULL_FRONT]. See also [member grow_amount].\n" +"[b]Note:[/b] Vertex growth cannot create new vertices, which means that " +"visible gaps may occur in sharp corners. This can be alleviated by designing " +"the mesh to use smooth normals exclusively using [url=https://wiki.polycount." +"com/wiki/Face_weighted_normals]face weighted normals[/url] in the 3D " +"authoring software. In this case, grow will be able to join every outline " +"together, just like in the original mesh." +msgstr "" +"Wenn [code]true[/code], wird die Einstellung des Vertex-Wachstums aktiviert. " +"Dies kann verwendet werden, um netzbasierte Umrisse mit einem zweiten " +"Materialpass zu erstellen und dessen [member cull_mode] auf [member " +"CULL_FRONT] eingestellt. Siehe auch [member grow_amount].\n" +"[b]Anmerkung:[/b] Vertex-Wachstum kann keine neuen Vertices erzeugen, was " +"bedeutet, dass sichtbare Lücken in scharfen Ecken auftreten können. Dies kann " +"dadurch gemildert werden, dass das Mesh ausschließlich mit [url=https://wiki." +"polycount.com/wiki/Face_weighted_normals]face gewichteten Normalen[/url] in " +"der 3D-Autorisierungssoftware verwendet wird. In diesem Fall wird das " +"Wachstum in der Lage sein, jeden Umriss zusammenzufügen, genau wie im " +"ursprünglichen Mesh." + +msgid "" +"Grows object vertices in the direction of their normals. Only effective if " +"[member grow] is [code]true[/code]." +msgstr "" +"Wächst Objektvertikale in Richtung ihrer Normalen. Nur wirksam, wenn [member " +"grow] [code]true[/code] ist." + +msgid "" +"If [code]true[/code], uses parallax occlusion mapping to represent depth in " +"the material instead of simple offset mapping (see [member " +"heightmap_enabled]). This results in a more convincing depth effect, but is " +"much more expensive on the GPU. Only enable this on materials where it makes " +"a significant visual difference." +msgstr "" +"Wenn [code]true[/code], wird Parallax-Occlusion Mapping verwendet, um Tiefe " +"in dem Material anstelle von einfachem Offset Mapping (siehe [member " +"heightmap_enabled]) zu repräsentieren. Dies führt zu einem überzeugenderen " +"Tiefeneffekt, ist aber auf der GPU viel teurer. Ermöglichen Sie dies nur auf " +"Materialien, bei denen es einen erheblichen visuellen Unterschied macht." + +msgid "" +"If [code]true[/code], height mapping is enabled (also called \"parallax " +"mapping\" or \"depth mapping\"). See also [member normal_enabled]. Height " +"mapping is a demanding feature on the GPU, so it should only be used on " +"materials where it makes a significant visual difference.\n" +"[b]Note:[/b] Height mapping is not supported if triplanar mapping is used on " +"the same material. The value of [member heightmap_enabled] will be ignored if " +"[member uv1_triplanar] is enabled." +msgstr "" +"Wenn [code]true[/code] aktiviert ist, wird die Höhenmapping aktiviert (auch " +"\"parallax mapping\" oder \"tiefe mapping\" genannt). Siehe auch [teil " +"normal_enabled]. Die Höhenkartierung ist eine anspruchsvolle Funktion auf der " +"GPU, so sollte es nur auf Materialien verwendet werden, wo es einen " +"erheblichen visuellen Unterschied macht.\n" +"[b]Anmerkung:[/b] Die Höhenkartierung wird nicht unterstützt, wenn die " +"Triplanarkartierung auf demselben Material verwendet wird. Der Wert von " +"[member heightmap_enabled] wird ignoriert, wenn [member uv1_triplanar] " +"aktiviert ist." + +msgid "" +"If [code]true[/code], flips the mesh's binormal vectors when interpreting the " +"height map. If the heightmap effect looks strange when the camera moves (even " +"with a reasonable [member heightmap_scale]), try setting this to [code]true[/" +"code]." +msgstr "" +"Wenn [code]true[/code], kippt die binormalen Vektoren des Netzes bei der " +"Interpretation der Höhenkarte. Wenn der Höhenkarte-Effekt seltsam aussieht, " +"wenn sich die Kamera bewegt (auch mit einem vernünftigen [member " +"highmap_scale]), versuchen Sie, dies auf [code]true[/code] einzustellen." + +msgid "" +"If [code]true[/code], flips the mesh's tangent vectors when interpreting the " +"height map. If the heightmap effect looks strange when the camera moves (even " +"with a reasonable [member heightmap_scale]), try setting this to [code]true[/" +"code]." +msgstr "" +"Wenn [code]true[/code] die Tangentenvektoren des Netzes bei der " +"Interpretation der Höhenkarte umkippt. Wenn der Höhenkarte-Effekt seltsam " +"aussieht, wenn sich die Kamera bewegt (auch mit einem vernünftigen [member " +"highmap_scale]), versuchen Sie, dies auf [code]true[/code] einzustellen." + +msgid "" +"If [code]true[/code], interprets the height map texture as a depth map, with " +"brighter values appearing to be \"lower\" in altitude compared to darker " +"values.\n" +"This can be enabled for compatibility with some materials authored for Godot " +"3.x. This is not necessary if the Invert import option was used to invert the " +"depth map in Godot 3.x, in which case [member heightmap_flip_texture] should " +"remain [code]false[/code]." +msgstr "" +"Wenn [code]true[/code] die Textur der Höhenkarte als Tiefenkarte " +"interpretiert, wobei die helleren Werte im Vergleich zu dunkleren Werten " +"\"unter\" erscheinen.\n" +"Dies kann für die Kompatibilität mit einigen Materialien, die für Godot 3.x. " +"Dies ist nicht erforderlich, wenn die Option Invert Import verwendet wurde, " +"um die Tiefenkarte in Godot 3.x invertieren, in welchem Fall [member " +"highmap_flip_texture] bleiben sollte [code]false[/code]." + +msgid "" +"The number of layers to use for parallax occlusion mapping when the camera is " +"up close to the material. Higher values result in a more convincing depth " +"effect, especially in materials that have steep height changes. Higher values " +"have a significant cost on the GPU, so it should only be increased on " +"materials where it makes a significant visual difference.\n" +"[b]Note:[/b] Only effective if [member heightmap_deep_parallax] is " +"[code]true[/code]." +msgstr "" +"Die Anzahl der Schichten für die Parallax-Occlusion-Mapping, wenn die Kamera " +"in der Nähe des Materials. Höhere Werte führen zu einem überzeugenderen " +"Tiefeneffekt, insbesondere bei Materialien, die steile Höhenänderungen " +"aufweisen. Höhere Werte haben erhebliche Kosten für die GPU, so sollte es nur " +"auf Materialien erhöht werden, wo es einen erheblichen visuellen Unterschied " +"macht.\n" +"[b]Anmerkung:[/b] Nur wirksam, wenn [member highmap_deep_parallax] " +"[code]true[/code] ist." + +msgid "" +"The number of layers to use for parallax occlusion mapping when the camera is " +"far away from the material. Higher values result in a more convincing depth " +"effect, especially in materials that have steep height changes. Higher values " +"have a significant cost on the GPU, so it should only be increased on " +"materials where it makes a significant visual difference.\n" +"[b]Note:[/b] Only effective if [member heightmap_deep_parallax] is " +"[code]true[/code]." +msgstr "" +"Die Anzahl der Schichten für die Parallax-Occlusion-Mapping, wenn die Kamera " +"weit vom Material entfernt ist. Höhere Werte führen zu einem überzeugenderen " +"Tiefeneffekt, insbesondere bei Materialien, die steile Höhenänderungen " +"aufweisen. Höhere Werte haben erhebliche Kosten für die GPU, so sollte es nur " +"auf Materialien erhöht werden, wo es einen erheblichen visuellen Unterschied " +"macht.\n" +"[b]Hinweis:[/b] Nur wirksam, wenn [member highmap_deep_parallax] [code]true[/" +"code] ist." + +msgid "" +"The heightmap scale to use for the parallax effect (see [member " +"heightmap_enabled]). The default value is tuned so that the highest point " +"(value = 255) appears to be 5 cm higher than the lowest point (value = 0). " +"Higher values result in a deeper appearance, but may result in artifacts " +"appearing when looking at the material from oblique angles, especially when " +"the camera moves. Negative values can be used to invert the parallax effect, " +"but this is different from inverting the texture using [member " +"heightmap_flip_texture] as the material will also appear to be \"closer\" to " +"the camera. In most cases, [member heightmap_scale] should be kept to a " +"positive value.\n" +"[b]Note:[/b] If the height map effect looks strange regardless of this value, " +"try adjusting [member heightmap_flip_binormal] and [member " +"heightmap_flip_tangent]. See also [member heightmap_texture] for " +"recommendations on authoring heightmap textures, as the way the heightmap " +"texture is authored affects how [member heightmap_scale] behaves." +msgstr "" +"Die heightmap Skalierung für den Parallax-Effekt (siehe [member " +"heightmap_enabled]). Der Standardwert wird so eingestellt, dass der höchste " +"Punkt (Wert = 255) 5 cm höher erscheint als der niedrigste Punkt (Wert = 0). " +"Höhere Werte führen zu einem tieferen Erscheinungsbild, können aber zu " +"Artefakten führen, die beim Betrachten des Materials aus schrägen Winkeln " +"auftreten, insbesondere wenn sich die Kamera bewegt. Negative Werte können " +"verwendet werden, um den Parallax-Effekt invertieren, aber dies unterscheidet " +"sich von der Invertierung der Textur mit [member highmap_flip_texture], da " +"das Material auch als \"Closer\" zur Kamera erscheint. In den meisten Fällen " +"sollte [Personenhöhemap_scale] auf einen positiven Wert gehalten werden.\n" +"[b]Anmerkung:[/b] Wenn der Höhenkarte-Effekt unabhängig von diesem Wert " +"seltsam aussieht, versuchen Sie, die Anpassung [member highmap_flip_binormal] " +"und [member highmap_flip_tangent]. Siehe auch [member highmap_texture] für " +"Empfehlungen zur Autorisierung von highmap-texturen, da die Art und Weise, " +"wie die Heightmap-Textur verfasst wird, Auswirkungen darauf hat, wie sich " +"[member highmap_scale] verhält." + +msgid "" +"The texture to use as a height map. See also [member heightmap_enabled].\n" +"For best results, the texture should be normalized (with [member " +"heightmap_scale] reduced to compensate). In [url=https://gimp.org]GIMP[/url], " +"this can be done using [b]Colors > Auto > Equalize[/b]. If the texture only " +"uses a small part of its available range, the parallax effect may look " +"strange, especially when the camera moves.\n" +"[b]Note:[/b] To reduce memory usage and improve loading times, you may be " +"able to use a lower-resolution heightmap texture as most heightmaps are only " +"comprised of low-frequency data." +msgstr "" +"Die Textur zur Verwendung als HeightMap. Siehe auch [Mitglied " +"highmap_enabled].\n" +"Für beste Ergebnisse sollte die Textur normalisiert werden (mit [member " +"highmap_scale] reduziert, um zu kompensieren). In [url=https://gimp.org]GIMP[/" +"url] kann dies mit [b]Colors > Auto > Equalize[/b] geschehen. Wenn die Textur " +"nur einen kleinen Teil ihrer verfügbaren Reichweite verwendet, kann der " +"Parallax-Effekt seltsam aussehen, insbesondere wenn sich die Kamera bewegt.\n" +"[b]Anmerkung:[/b] Um die Speichernutzung zu reduzieren und Ladezeiten zu " +"verbessern, wäre es für Sie möglich, eine HeightMap Textur mit niedrigerer " +"Auflösung zu verwenden, da die meisten Höhenkarten nur aus niederfrequenten " +"Daten bestehen." + +msgid "" +"A high value makes the material appear more like a metal. Non-metals use " +"their albedo as the diffuse color and add diffuse to the specular reflection. " +"With non-metals, the reflection appears on top of the albedo color. Metals " +"use their albedo as a multiplier to the specular reflection and set the " +"diffuse color to black resulting in a tinted reflection. Materials work " +"better when fully metal or fully non-metal, values between [code]0[/code] and " +"[code]1[/code] should only be used for blending between metal and non-metal " +"sections. To alter the amount of reflection use [member roughness]." +msgstr "" +"Ein hoher Wert macht das Material mehr wie ein Metall erscheinen. " +"Nichtmetalle verwenden ihren Albedo als diffuse Farbe und addieren diffus zur " +"spekulären Reflexion. Bei Nichtmetallen erscheint die Reflexion über der " +"Albedofarbe. Metalle verwenden ihren Albedo als Multiplikator zur spekulären " +"Reflexion und setzen die diffuse Farbe auf Schwarz, was zu einer getönten " +"Reflexion führt. Materialien arbeiten besser, wenn vollmetallisch oder " +"vollständig nichtmetallisch, Werte zwischen [code]0[/code] und [code]1[/code] " +"nur für die Mischung zwischen Metall- und Nichtmetallabschnitten verwendet " +"werden. Um die Menge der Reflexion zu ändern, verwenden Sie [Teile Rauheit]." + +msgid "" +"Adjusts the strength of specular reflections. Specular reflections are " +"composed of scene reflections and the specular lobe which is the bright spot " +"that is reflected from light sources. When set to [code]0.0[/code], no " +"specular reflections will be visible. This differs from the [constant " +"SPECULAR_DISABLED] [enum SpecularMode] as [constant SPECULAR_DISABLED] only " +"applies to the specular lobe from the light source.\n" +"[b]Note:[/b] Unlike [member metallic], this is not energy-conserving, so it " +"should be left at [code]0.5[/code] in most cases. See also [member roughness]." +msgstr "" +"Passt die Stärke der specular Reflexionen an. Specular Reflexionen bestehen " +"aus Szenenreflexionen und der Spekularkeule, die der helle Fleck ist, der aus " +"Lichtquellen reflektiert wird. Wenn auf [code]0.0[/code] eingestellt, werden " +"keine Specular Reflexionen sichtbar. Dies unterscheidet sich vom [constant " +"SPECULAR_DISABLED] [enum SpecularMode], da [constant SPECULAR_DISABLED] nur " +"für die specular Leisten aus der Lichtquelle gilt.\n" +"[b]Anmerkung:[/b] Im Gegensatz zu [member metallic] ist dies nicht " +"energiesparend, also sollte es in den meisten Fällen bei [code]0,5[/code] " +"liegen. Siehe auch [member roughness]." + +msgid "" +"Texture used to specify metallic for an object. This is multiplied by [member " +"metallic]." +msgstr "" +"Textur, die verwendet wird, um metallische Eigenschaften für ein Objekt " +"anzugeben. Dies wird mit [member Metallic] multipliziert." + +msgid "" "If [code]true[/code], triplanar mapping for [code]UV[/code] is calculated in " "world space rather than object local space. See also [member uv1_triplanar]." msgstr "" @@ -14959,6 +16276,9 @@ msgstr "" "gültigen Methodennamen zugewiesen hat oder wenn es sich um ein " "benutzerdefiniertes Callable handelt." +msgid "Physical light and camera units" +msgstr "Physikalische Licht- und Kameraeinheiten" + msgid "Unspecified position." msgstr "Nicht spezifizierte Position." @@ -15682,7 +17002,7 @@ msgid "Emitted when the [ColorPicker] is closed." msgstr "Wird ausgegeben, wenn der [ColorPicker] geschlossen wird." msgid "Control node gallery" -msgstr "Galerie der Kontrollknoten (Kontroll-Nodes)" +msgstr "Galerie der Control-Nodes" msgid "Multiple resolutions" msgstr "Mehrere Auflösungen" @@ -15983,9 +17303,19 @@ msgstr "" msgid "Constructs an empty [Dictionary]." msgstr "Konstruiert ein leeres [Dictionary]." +msgid "" +"Returns [code]true[/code] if the dictionary is empty (its size is [code]0[/" +"code]). See also [method size]." +msgstr "" +"Gibt [code]true[/code] zurück, wenn das Wörterbuch leer ist (seine Größe ist " +"[code]0[/code]). Siehe auch [Methode size]." + msgid "File system" msgstr "Dateisystem" +msgid "Faking global illumination" +msgstr "Vortäuschen von Global Illumination" + msgid "" "Returns OS theme accent color. Returns [code]Color(0, 0, 0, 0)[/code], if " "accent color is unknown.\n" @@ -16546,6 +17876,9 @@ msgstr "" "Ermöglicht es einer Anwendung, die persönlichen Profildaten des Benutzers zu " "lesen." +msgid "Allows an application to read the user dictionary." +msgstr "Ermöglicht es einer Anwendung, das Benutzerwörterbuch zu lesen." + msgid "Deprecated in API level 15." msgstr "Veraltet in API-Level 15." @@ -16681,6 +18014,9 @@ msgstr "" msgid "Emitted after any editor setting has changed." msgstr "Gesendet wenn das Rechteck Element geändert wurde." +msgid "Version control systems" +msgstr "Versionsverwaltungssysteme" + msgid "" "Returns [code]true[/code] if the peer is currently active (i.e. the " "associated [ENetConnection] is still valid)." @@ -16783,6 +18119,9 @@ msgstr "" "andere Zahlen. Daher sind die Ergebnisse dieses Operators möglicherweise " "nicht genau, wenn NaNs enthalten sind." +msgid "Volumetric fog and fog volumes" +msgstr "Volumetrischer Nebel und Nebelvolumen" + msgid "Removes all font sizes from the cache entry" msgstr "Entfernt alle Schriftgrößen aus dem Cache-Eintrag" @@ -16804,6 +18143,9 @@ msgstr "" "Polygon] liegt oder wenn er genau [i]auf[/i] der Polygongrenze liegt, " "andernfalls [code]false[/code]." +msgid "Visibility ranges (HLOD)" +msgstr "Reichweitenbasierte Sichtbarkeit (HLOD)" + msgid "Cubic interpolation." msgstr "Kubische Interpolation." @@ -16857,6 +18199,9 @@ msgstr "Spiegelt das Bild horizontal." msgid "Flips the image vertically." msgstr "Spiegelt das Bild vertikal." +msgid "Using ImmediateMesh" +msgstr "Verwenden von ImmediateMesh" + msgid "" "The [Input] singleton handles key presses, mouse buttons and movement, " "gamepads, and input actions. Actions and their events can be set in the " @@ -16892,14 +18237,18 @@ msgid "" "[b]Note:[/b] Due to keyboard ghosting, [method is_action_just_pressed] may " "return [code]false[/code] even if one of the action's keys is pressed. See " "[url=$DOCS_URL/tutorials/inputs/input_examples.html#keyboard-events]Input " -"examples[/url] in the documentation for more information." +"examples[/url] in the documentation for more information.\n" +"[b]Note:[/b] During input handling (e.g. [method Node._input]), use [method " +"InputEvent.is_action_pressed] instead to query the action state of the " +"current event." msgstr "" "Gibt [code]true[/code] zurück, wenn der Benutzer [i]begonnen hat[/i], das " "Aktionsereignis im aktuellen Frame oder Physik-Tick zu drücken. Es wird nur " "[code]true[/code] in dem Frame oder Tick zurückgegeben, in dem der Benutzer " -"die Taste gedrückt hat.\n" +"die Aktion gedrückt hat.\n" "Dies ist nützlich für Code, der nur einmal ausgeführt werden muss, wenn eine " -"Aktion gedrückt wird, anstatt bei jedem Frame, während sie gedrückt wird.\n" +"Aktion gedrückt wird, anstatt bei jedem Frame, während sie gedrückt gelassen " +"wird.\n" "Wenn [param exact_match] [code]false[/code] ist, werden zusätzliche " "Eingabemodifikatoren für [InputEventKey]- und [InputEventMouseButton]-" "Ereignisse sowie die Richtung für [InputEventJoypadMotion]-Ereignisse " @@ -16912,7 +18261,40 @@ msgstr "" "is_action_just_pressed] auch dann [code]false[/code] zurückgeben, wenn eine " "der Tasten der Aktion gedrückt ist. Siehe [url=$DOCS_URL/tutorials/inputs/" "input_examples.html#keyboard-events]Eingabebeispiele[/url] in der " -"Dokumentation für weitere Informationen." +"Dokumentation für weitere Informationen.\n" +"[b]Hinweis:[/b] Verwenden Sie bei der Eingabeverarbeitung (z.B. [Methode Node." +"_input]) stattdessen [Methode InputEvent.is_action_pressed], um den " +"Aktionsstatus des aktuellen Ereignisses abzufragen." + +msgid "" +"Returns [code]true[/code] when the user [i]stops[/i] pressing the action " +"event in the current frame or physics tick. It will only return [code]true[/" +"code] on the frame or tick that the user releases the button.\n" +"[b]Note:[/b] Returning [code]true[/code] does not imply that the action is " +"[i]still[/i] not pressed. An action can be released and pressed again " +"rapidly, and [code]true[/code] will still be returned so as not to miss " +"input.\n" +"If [param exact_match] is [code]false[/code], it ignores additional input " +"modifiers for [InputEventKey] and [InputEventMouseButton] events, and the " +"direction for [InputEventJoypadMotion] events.\n" +"[b]Note:[/b] During input handling (e.g. [method Node._input]), use [method " +"InputEvent.is_action_released] instead to query the action state of the " +"current event." +msgstr "" +"Gibt [code]true[/code] zurück, wenn der Benutzer [i]aufhört[/i], das Aktions-" +"Event im aktuellen Frame oder Physik-Tick zu drücken. Es wird nur dann " +"[code]true[/code] zurückgegeben, wenn der Benutzer die Taste loslässt.\n" +"[b]Hinweis:[/b] Die Rückgabe von [code]true[/code] bedeutet nicht, dass die " +"Aktion [i]noch[/i] nicht gedrückt ist. Eine Aktion kann schnell losgelassen " +"und wieder gedrückt werden, und [code]true[/code] wird trotzdem " +"zurückgegeben, um keine Eingabe zu verpassen.\n" +"Wenn [param exact_match] [code]false[/code] ist, werden zusätzliche " +"Eingabemodifikatoren für die Ereignisse [InputEventKey] und " +"[InputEventMouseButton] sowie die Richtung für die Ereignisse " +"[InputEventJoypadMotion] ignoriert.\n" +"[b]Hinweis:[/b] Verwenden Sie bei der Eingabeverarbeitung (z.B. [method Node." +"_input]) stattdessen [method InputEvent.is_action_released], um den " +"Aktionsstatus des aktuellen Ereignisses abzufragen." msgid "" "Returns [code]true[/code] if you are pressing the action event.\n" @@ -17202,6 +18584,9 @@ msgstr "" msgid "Represents the size of the [enum ArrayType] enum." msgstr "Stellt die Größe der Aufzählung [enum ArrayType] dar." +msgid "Using the MeshDataTool" +msgstr "Verwendung des MeshDataTools" + msgid "" "Returns the number of blend shapes available. Produces an error if [member " "mesh] is [code]null[/code]." @@ -17619,6 +19004,21 @@ msgstr "" "distance matching[/url] in Zstandard." msgid "" +"When set to [code]warn[/code] or [code]error[/code], produces a warning or an " +"error respectively when a variable or parameter has no static type, or if a " +"function has no static return type.\n" +"[b]Note:[/b] This warning is recommended together with [member EditorSettings." +"text_editor/completion/add_type_hints] to help achieve type safety." +msgstr "" +"Wenn auf [code]warn[/code] oder [code]error[/code] gesetzt, wird eine Warnung " +"bzw. ein Fehler ausgegeben, wenn eine Variable oder ein Parameter keinen " +"statischen Typ hat oder wenn eine Funktion keinen statischen Rückgabetyp " +"hat.\n" +"[b]Hinweis:[/b] Diese Warnung wird zusammen mit [member EditorSettings." +"text_editor/completion/add_type_hints] empfohlen, um Typsicherheit zu " +"erreichen." + +msgid "" "Constructs a quaternion that will rotate around the given axis by the " "specified angle. The axis must be a normalized vector." msgstr "" @@ -18430,6 +19830,16 @@ msgstr "" msgid "Playing videos" msgstr "Abspielen von Videos" +msgid "Using VisualShaders" +msgstr "Verwendung von VisualShaders" + +msgid "" +"Has only one output port and no inputs.\n" +"Translated to [code skip-lint]bool[/code] in the shader language." +msgstr "" +"Hat nur einen Ausgangs-Port und keine Eingänge.\n" +"Wird in der Shader-Sprache in [code skip-lint]bool[/code] übersetzt." + msgid "" "Constrains a value to lie between [code]min[/code] and [code]max[/code] " "values." diff --git a/doc/translations/es.po b/doc/translations/es.po index a6dd326941..2ef586679c 100644 --- a/doc/translations/es.po +++ b/doc/translations/es.po @@ -65,12 +65,14 @@ # Jorge González <jlexgog@gmail.com>, 2023. # Jorge Julio Torres <jjulio.tlg.89@gmail.com>, 2023. # simomi 073 <arcemoyanomanuel@gmail.com>, 2023. +# Alejandro Ruiz Esclapez <ruizesa24@gmail.com>, 2023. +# Carlos Cortes Garcia <carlos.cortes.games@gmail.com>, 2023. msgid "" msgstr "" "Project-Id-Version: Godot Engine class reference\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" -"PO-Revision-Date: 2023-10-25 16:15+0000\n" -"Last-Translator: Jorge Julio Torres <jjulio.tlg.89@gmail.com>\n" +"PO-Revision-Date: 2023-12-11 21:00+0000\n" +"Last-Translator: Carlos Cortes Garcia <carlos.cortes.games@gmail.com>\n" "Language-Team: Spanish <https://hosted.weblate.org/projects/godot-engine/" "godot-class-reference/es/>\n" "Language: es\n" @@ -78,7 +80,28 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8-bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.1.1\n" +"X-Generator: Weblate 5.3-dev\n" + +msgid "All classes" +msgstr "Todas las clases" + +msgid "Globals" +msgstr "Globales" + +msgid "Nodes" +msgstr "Nodos" + +msgid "Resources" +msgstr "Recursos" + +msgid "Editor-only" +msgstr "Exclusivo-Editor" + +msgid "Other objects" +msgstr "Otros objetos" + +msgid "Variant types" +msgstr "Tipo de variantes" msgid "Description" msgstr "Descripción" @@ -110,6 +133,9 @@ msgstr "Enumeraciones" msgid "Constants" msgstr "Constantes" +msgid "Annotations" +msgstr "Anotaciones" + msgid "Property Descriptions" msgstr "Descripciones de Propiedades" @@ -132,14 +158,11 @@ msgid "Inherited By:" msgstr "Heredado por:" msgid "(overrides %s)" -msgstr "(sobreescribe %s)" +msgstr "(sobrescribe %s)" msgid "Default" msgstr "Predeterminado" -msgid "Setter" -msgstr "Regulador o fijador" - msgid "value" msgstr "valor" @@ -149,7 +172,7 @@ msgstr "Método de Acceso al Valor o Getter" msgid "" "This method should typically be overridden by the user to have any effect." msgstr "" -"Típicamente, este método debería ser sobreescrito por el usuario para que " +"Normalmente, este método debería ser sobrescrito por el usuario para que " "tenga algún efecto." msgid "" @@ -1398,6 +1421,16 @@ msgstr "" msgid "Random number generation" msgstr "Generación de números aleatorios" +msgid "" +"Returns the difference between the two angles, in the range of [code][-PI, " +"+PI][/code]. When [param from] and [param to] are opposite, returns [code]-" +"PI[/code] if [param from] is smaller than [param to], or [code]PI[/code] " +"otherwise." +msgstr "" +"Devuelve la diferencia entre dos ángulos, entre [code][-PI,+PI][/code]. " +"Cuando [param from] y [param to] son contrarios, devuelve [code]-PI[/code] si " +"[param from] es menor que [param to], o [code]PI[/code] si no lo es." + msgid "Converts from decibels to linear energy (audio)." msgstr "Convierte de decibeles a energía lineal (audio)." @@ -6833,9 +6866,6 @@ msgstr "" msgid "Particles are drawn in the order emitted." msgstr "Las partículas se dibujan en el orden en que se emiten." -msgid "Particles are drawn in order of remaining lifetime." -msgstr "Las partículas se dibujan en orden según el tiempo de vida restante." - msgid "Represents the size of the [enum Parameter] enum." msgstr "Representa el tamaño del enumerado [enum Parameter]." @@ -10386,28 +10416,15 @@ msgstr "Carga una imagen del contenido binario de un archivo JPEG." msgid "Loads an image from the binary contents of a PNG file." msgstr "Carga una imagen del contenido binario de un archivo PNG." -msgid "Loads an image from the binary contents of a TGA file." -msgstr "Carga una imagen del contenido binario de un archivo TGA." - msgid "Loads an image from the binary contents of a WebP file." msgstr "Carga una imagen del contenido binario de un archivo WebP." msgid "" -"Multiplies color values with alpha values. Resulting color values for a pixel " -"are [code](color * alpha)/256[/code]." -msgstr "" -"Multiplica los valores de color por los valores alfa. Los valores de color " -"resultantes para un píxel son [code](color * alfa)/256[/code]." - -msgid "" "Converts a standard RGBE (Red Green Blue Exponent) image to an sRGB image." msgstr "" "Convierte una imagen estándar RGBE (Red Green Blue Exponent) en una imagen " "sRGB." -msgid "Shrinks the image by a factor of 2." -msgstr "Reduce la imagen en un factor de 2." - msgid "Converts the raw data from the sRGB colorspace to a linear scale." msgstr "" "Convierte los datos en bruto del espacio de color sRGB a una escala lineal." @@ -12630,9 +12647,6 @@ msgstr "" "Devuelve [code]true[/code] si se trata de un marcador de posición de carga de " "instancia. Ver [InstancePlaceholder]." -msgid "Returns the [SceneTree] that contains this node." -msgstr "Devuelve el [SceneTree] que contiene este nodo." - msgid "Returns the node's [Viewport]." msgstr "Devuelve el [Viewport] del nodo." @@ -15058,13 +15072,6 @@ msgstr "" "Administrador de Proyectos cuando se pasa el cursor por encima del proyecto." msgid "" -"Forces a delay between frames in the main loop (in milliseconds). This may be " -"useful if you plan to disable vertical synchronization." -msgstr "" -"Fuerza un retardo entre fotogramas en el bucle principal (en milisegundos). " -"Esto puede ser útil si planea deshabilitar la sincronización vertical." - -msgid "" "If [code]true[/code], enables low-processor usage mode. This setting only " "works on desktop platforms. The screen is not redrawn if nothing changes " "visually. This is meant for writing applications and editors, but is pretty " @@ -16515,9 +16522,6 @@ msgid "Draw particles in the order that they appear in the particles array." msgstr "" "Dibuja las partículas en el orden en que aparecen en el array de partículas." -msgid "Sort particles based on their lifetime." -msgstr "Clasificar las partículas en función de su vida útil." - msgid "Sort particles based on their distance to the camera." msgstr "Clasifica las partículas según su distancia a la cámara." @@ -16676,9 +16680,6 @@ msgstr "" "El hardware soporta el multihilo. Este enum no se usa actualmente en Godot 3." "x." -msgid "Resources" -msgstr "Recursos" - msgid "Loads a specific resource type from a file." msgstr "Carga un tipo de recurso específico de un archivo." diff --git a/doc/translations/fr.po b/doc/translations/fr.po index 758dde4907..3d97e832b5 100644 --- a/doc/translations/fr.po +++ b/doc/translations/fr.po @@ -87,13 +87,14 @@ # Benjamin Brasseur <benjamin.brasseur85@gmail.com>, 2023. # Rertsyd <rertsyd@outlook.com>, 2023. # Calimelo <melo.j@lilo.org>, 2023. +# Roskai <angel.du.2558@gmail.com>, 2023. msgid "" msgstr "" "Project-Id-Version: Godot Engine class reference\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-11-03 04:56+0000\n" -"Last-Translator: Calimelo <melo.j@lilo.org>\n" +"PO-Revision-Date: 2023-11-14 03:37+0000\n" +"Last-Translator: Rertsyd <rertsyd@outlook.com>\n" "Language-Team: French <https://hosted.weblate.org/projects/godot-engine/godot-" "class-reference/fr/>\n" "Language: fr\n" @@ -103,6 +104,9 @@ msgstr "" "Plural-Forms: nplurals=2; plural=n > 1;\n" "X-Generator: Weblate 5.2-dev\n" +msgid "Resources" +msgstr "Ressources" + msgid "Description" msgstr "Description" @@ -1406,6 +1410,16 @@ msgstr "" "[/codeblock]" msgid "" +"Returns the difference between the two angles, in the range of [code][-PI, " +"+PI][/code]. When [param from] and [param to] are opposite, returns [code]-" +"PI[/code] if [param from] is smaller than [param to], or [code]PI[/code] " +"otherwise." +msgstr "" +"Retourne la différence entre deux angles, dans l'intervalle [code][-PI, +PI][/" +"code]. Quand [param from] et [param to ] sont opposé, est retourné [code]-PI[/" +"code] si [param from] est plus petit que [param to], ou sinon [code]PI[/code]." + +msgid "" "Rounds [param x] upward (towards positive infinity), returning the smallest " "whole number that is not less than [param x].\n" "A type-safe version of [method ceil], returning a [float]." @@ -5157,6 +5171,15 @@ msgstr "" "Construit la matrice d'une base de rotation seulement depuis le quaternion " "donné." +msgid "" +"Returns the basis's rotation in the form of a quaternion. See [method " +"get_euler] if you need Euler angles, but keep in mind quaternions should " +"generally be preferred to Euler angles." +msgstr "" +"Retourne la rotation de la base sous la forme d'un quaternion. Voir [method " +"get_euler] si vous avez besoin d'angles d'Euler, mais gardez à l'esprit que " +"les quaternions devraient être préférés aux angles d'Euler." + msgid "Returns the inverse of the matrix." msgstr "Retourne l'inverse de la matrice." @@ -7002,6 +7025,21 @@ msgstr "Émis quand le nœud reçoit un [InputEvent]." msgid "Emitted when the node's minimum size changes." msgstr "Émis quand la taille minimale du nœud change." +msgid "" +"Emitted when the mouse cursor enters the control's (or any child control's) " +"visible area, that is not occluded behind other Controls or Windows, provided " +"its [member mouse_filter] lets the event reach it and regardless if it's " +"currently focused or not.\n" +"[b]Note:[/b] [member CanvasItem.z_index] doesn't affect, which Control " +"receives the signal." +msgstr "" +"Émis quand le curseur de la souris entre dans la zone visible du contrôle (ou " +"un de ses enfants), qui n'est pas masqué derrière d'autres Contrôles ou " +"Fenêtres, fourni son [member mouse_filter], laisse l’événement l'atteindre, " +"et peu importe s’il est actuellement ciblé ou non.\n" +"[b]Note:[/b] [member CanvasItem.z_index] n'affecte pas quel Contrôle reçoit " +"le signal." + msgid "Emitted when the control changes size." msgstr "Émis lorsque le contrôle change de taille." @@ -7022,6 +7060,72 @@ msgstr "" "Le nœud ne reçoit le focus que pour les clics de la souris. À utiliser avec " "[membre focus_mode]." +msgid "" +"Sent when the mouse cursor enters the control's (or any child control's) " +"visible area, that is not occluded behind other Controls or Windows, provided " +"its [member mouse_filter] lets the event reach it and regardless if it's " +"currently focused or not.\n" +"[b]Note:[/b] [member CanvasItem.z_index] doesn't affect which Control " +"receives the notification.\n" +"See also [constant NOTIFICATION_MOUSE_ENTER_SELF]." +msgstr "" +"Envoyé quand le curseur de la souris entre dans la zone visible du contrôle " +"(ou un de ses enfants), qui n'est pas masqué derrière d'autres Contrôles ou " +"Fenêtres, fourni son [member mouse_filter], laisse l’événement l'atteindre, " +"et peu importe s’il est actuellement ciblé ou non.\n" +"[b]Note:[/b] [member CanvasItem.z_index] n'affecte pas quel Contrôle reçoit " +"la notification.\n" +"Voir aussi [constant NOTIFICATION_MOUSE_ENTER_SELF]." + +msgid "" +"Sent when the mouse cursor leaves the control's (and all child control's) " +"visible area, that is not occluded behind other Controls or Windows, provided " +"its [member mouse_filter] lets the event reach it and regardless if it's " +"currently focused or not.\n" +"[b]Note:[/b] [member CanvasItem.z_index] doesn't affect which Control " +"receives the notification.\n" +"See also [constant NOTIFICATION_MOUSE_EXIT_SELF]." +msgstr "" +"Envoyé quand le curseur de la souris sort de la zone visible du contrôle (ou " +"un de ses enfants), qui n'est pas masqué derrière d'autres Contrôles ou " +"Fenêtres, fourni son [member mouse_filter], laisse l’événement l'atteindre, " +"et peu importe s’il est actuellement ciblé ou non.\n" +"[b]Note:[/b] [member CanvasItem.z_index] n'affecte pas quel Contrôle reçoit " +"la notification.\n" +"Voir aussi [constant NOTIFICATION_MOUSE_EXIT_SELF]." + +msgid "" +"Sent when the mouse cursor enters the control's visible area, that is not " +"occluded behind other Controls or Windows, provided its [member mouse_filter] " +"lets the event reach it and regardless if it's currently focused or not.\n" +"[b]Note:[/b] [member CanvasItem.z_index] doesn't affect which Control " +"receives the notification.\n" +"See also [constant NOTIFICATION_MOUSE_ENTER]." +msgstr "" +"Envoyé quand le curseur de la souris entre dans la zone visible du contrôle, " +"qui n'est pas masqué derrière d'autres Contrôles ou Fenêtres, fourni son " +"[member mouse_filter], laisse l’événement l'atteindre, et peu importe s’il " +"est actuellement ciblé ou non.\n" +"[b]Note:[/b] [member CanvasItem.z_index] n'affecte pas quel Contrôle reçoit " +"la notification.\n" +"Voir aussi [constant NOTIFICATION_MOUSE_ENTER]." + +msgid "" +"Sent when the mouse cursor leaves the control's visible area, that is not " +"occluded behind other Controls or Windows, provided its [member mouse_filter] " +"lets the event reach it and regardless if it's currently focused or not.\n" +"[b]Note:[/b] [member CanvasItem.z_index] doesn't affect which Control " +"receives the notification.\n" +"See also [constant NOTIFICATION_MOUSE_EXIT]." +msgstr "" +"Envoyé quand le curseur de la souris sort de la zone visible du contrôle, qui " +"n'est pas masqué derrière d'autres Contrôles ou Fenêtres, fourni son [member " +"mouse_filter], laisse l’événement l'atteindre, et peu importe s’il est " +"actuellement ciblé ou non.\n" +"[b]Note:[/b] [member CanvasItem.z_index] n'affecte pas quel Contrôle reçoit " +"la notification.\n" +"Voir aussi [constant NOTIFICATION_MOUSE_EXIT]." + msgid "Sent when the node grabs focus." msgstr "Envoyé lorsque le nœud reçoit le focus." @@ -7524,9 +7628,6 @@ msgid "Particles are drawn in the order emitted." msgstr "" "Les particules sont affichées dans l'ordre dans lequel elles ont été émises." -msgid "Particles are drawn in order of remaining lifetime." -msgstr "Les particules sont affichées dans l'ordre de la durée de vie restante." - msgid "Represents the size of the [enum Parameter] enum." msgstr "Représente la taille de l'énumération [enum Parameter]." @@ -10977,9 +11078,6 @@ msgstr "Retourne [code]true[/code] si l'image est compressée." msgid "Returns [code]true[/code] if the image has no data." msgstr "Retourne [code]true[/code] si l'image n'a aucun donnée." -msgid "Loads an image from the binary contents of a TGA file." -msgstr "Charge une image à partir du contenu binaire d’un fichier TGA." - msgid "Loads an image from the binary contents of a WebP file." msgstr "Charge une image depuis le contenu binaire d'un fichier WebP." @@ -10988,9 +11086,6 @@ msgid "" msgstr "" "Convertit une image RGBE (« Red Green Blue Exponent ») standard en image sRGB." -msgid "Shrinks the image by a factor of 2." -msgstr "Réduit la taille de l'image par 2." - msgid "Converts the raw data from the sRGB colorspace to a linear scale." msgstr "" "Convertit des données brutes depuis l'espace de couleur sRGB en linéaire." @@ -13312,9 +13407,6 @@ msgstr "" "Retourne [code]true[/code] si c'est une instance fictive pour charger un " "scène. Voir [InstancePlaceholder]." -msgid "Returns the [SceneTree] that contains this node." -msgstr "Retourne le [SceneTree] qui contient ce nœud." - msgid "Returns the node's [Viewport]." msgstr "Retourne le [Viewport] du nœud." @@ -13876,6 +13968,9 @@ msgstr "" msgid "Add an action set." msgstr "Ajouter un ensemble d'actions." +msgid "Add an interaction profile." +msgstr "Ajouter un profil d'interaction." + msgid "" "Generates and sets an optimized translation from the given [Translation] " "resource." @@ -16387,9 +16482,6 @@ msgstr "" msgid "Draw particles in the order that they appear in the particles array." msgstr "Affiche les particules dans leur ordre dans la liste des particules." -msgid "Sort particles based on their lifetime." -msgstr "Trier les particules par durée de vie." - msgid "Sort particles based on their distance to the camera." msgstr "Trier les particules suivant leur distance à la caméra." @@ -16516,9 +16608,6 @@ msgstr "" "L'appareil supporte plusieurs fils d'exécution. Cette énumération est " "actuellement inutilisée dans Godot 3.x." -msgid "Resources" -msgstr "Ressources" - msgid "Loads a specific resource type from a file." msgstr "Charge un type de ressource spécifique depuis un fichier." diff --git a/doc/translations/zh_CN.po b/doc/translations/zh_CN.po index c61bdbf3d9..0b5e9239a1 100644 --- a/doc/translations/zh_CN.po +++ b/doc/translations/zh_CN.po @@ -86,8 +86,8 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine class reference\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" -"PO-Revision-Date: 2023-11-10 08:03+0000\n" -"Last-Translator: Haoyu Qiu <timothyqiu32@gmail.com>\n" +"PO-Revision-Date: 2023-12-07 14:59+0000\n" +"Last-Translator: 风青山 <idleman@yeah.net>\n" "Language-Team: Chinese (Simplified) <https://hosted.weblate.org/projects/" "godot-engine/godot-class-reference/zh_Hans/>\n" "Language: zh_CN\n" @@ -95,7 +95,28 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8-bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Weblate 5.2-dev\n" +"X-Generator: Weblate 5.3-dev\n" + +msgid "All classes" +msgstr "所有类" + +msgid "Globals" +msgstr "全局" + +msgid "Nodes" +msgstr "节点" + +msgid "Resources" +msgstr "资源" + +msgid "Editor-only" +msgstr "编辑器专用" + +msgid "Other objects" +msgstr "其他对象" + +msgid "Variant types" +msgstr "变体类型" msgid "Description" msgstr "描述" @@ -127,6 +148,9 @@ msgstr "枚举" msgid "Constants" msgstr "常量" +msgid "Annotations" +msgstr "注解" + msgid "Property Descriptions" msgstr "属性说明" @@ -823,6 +847,79 @@ msgstr "" "code] 除以 [code]0[/code] 不会得到 [constant NAN],而是会产生运行时错误。" msgid "" +"Mark the following property as exported (editable in the Inspector dock and " +"saved to disk). To control the type of the exported property, use the type " +"hint notation.\n" +"[codeblock]\n" +"extends Node\n" +"\n" +"enum Direction {LEFT, RIGHT, UP, DOWN}\n" +"\n" +"# Built-in types.\n" +"@export var string = \"\"\n" +"@export var int_number = 5\n" +"@export var float_number: float = 5\n" +"\n" +"# Enums.\n" +"@export var type: Variant.Type\n" +"@export var format: Image.Format\n" +"@export var direction: Direction\n" +"\n" +"# Resources.\n" +"@export var image: Image\n" +"@export var custom_resource: CustomResource\n" +"\n" +"# Nodes.\n" +"@export var node: Node\n" +"@export var custom_node: CustomNode\n" +"\n" +"# Typed arrays.\n" +"@export var int_array: Array[int]\n" +"@export var direction_array: Array[Direction]\n" +"@export var image_array: Array[Image]\n" +"@export var node_array: Array[Node]\n" +"[/codeblock]\n" +"[b]Note:[/b] Custom resources and nodes must be registered as global classes " +"using [code]class_name[/code].\n" +"[b]Note:[/b] Node export is only supported in [Node]-derived classes and has " +"a number of other limitations." +msgstr "" +"将后续的属性标记为导出属性(可以在检查器面板中编辑并保存至磁盘)。要控制导出属" +"性的类型,请使用类型提示标记。\n" +"[codeblock]\n" +"extends Node\n" +"\n" +"enum Direction {LEFT, RIGHT, UP, DOWN}\n" +"\n" +"# 内置类型。\n" +"@export var string = \"\"\n" +"@export var int_number = 5\n" +"@export var float_number: float = 5\n" +"\n" +"# 枚举。\n" +"@export var type: Variant.Type\n" +"@export var format: Image.Format\n" +"@export var direction: Direction\n" +"\n" +"# 资源。\n" +"@export var image: Image\n" +"@export var custom_resource: CustomResource\n" +"\n" +"# 节点。\n" +"@export var node: Node\n" +"@export var custom_node: CustomNode\n" +"\n" +"# 类型数组。\n" +"@export var int_array: Array[int]\n" +"@export var direction_array: Array[Direction]\n" +"@export var image_array: Array[Image]\n" +"@export var node_array: Array[Node]\n" +"[/codeblock]\n" +"[b]注意:[/b]自定义资源和自定义节点必须使用 [code]class_name[/code] 注册为全局" +"类。\n" +"[b]注意:[/b]节点的导出只有派生自 [Node] 的类才支持,并且还有一些其他限制。" + +msgid "" "Define a new category for the following exported properties. This helps to " "organize properties in the Inspector dock.\n" "See also [constant PROPERTY_USAGE_CATEGORY].\n" @@ -1355,6 +1452,31 @@ msgstr "" "组,类似地,后续的子分组也会打断之前的子分组。" msgid "" +"Add a custom icon to the current script. The icon specified at [param " +"icon_path] is displayed in the Scene dock for every node of that class, as " +"well as in various editor dialogs.\n" +"[codeblock]\n" +"@icon(\"res://path/to/class/icon.svg\")\n" +"[/codeblock]\n" +"[b]Note:[/b] Only the script can have a custom icon. Inner classes are not " +"supported.\n" +"[b]Note:[/b] As annotations describe their subject, the [annotation @icon] " +"annotation must be placed before the class definition and inheritance.\n" +"[b]Note:[/b] Unlike other annotations, the argument of the [annotation @icon] " +"annotation must be a string literal (constant expressions are not supported)." +msgstr "" +"为当前脚本添加自定义图标。[param icon_path] 所指定的图标会在“场景”面板中该类的" +"所有节点上显示,也会显示在各种编辑器对话框中。\n" +"[codeblock]\n" +"@icon(\"res://path/to/class/icon.svg\")\n" +"[/codeblock]\n" +"[b]注意:[/b]只有脚本可以有自定义的图标。不支持内部类。\n" +"[b]注意:[/b]由于注解描述的是它们的对象,[annotation @icon] 注解必须放在类定义" +"和继承之前。\n" +"[b]注意:[/b]不同于其他注解,[annotation @icon] 注解的参数必须是字符串字面量" +"(不支持常量表达式)。" + +msgid "" "Mark the following property as assigned when the [Node] is ready. Values for " "these properties are not assigned immediately when the node is initialized " "([method Object._init]), and instead are computed and stored right before " @@ -1454,6 +1576,27 @@ msgstr "" "变量将恢复为默认值。" msgid "" +"Mark the current script as a tool script, allowing it to be loaded and " +"executed by the editor. See [url=$DOCS_URL/tutorials/plugins/" +"running_code_in_the_editor.html]Running code in the editor[/url].\n" +"[codeblock]\n" +"@tool\n" +"extends Node\n" +"[/codeblock]\n" +"[b]Note:[/b] As annotations describe their subject, the [annotation @tool] " +"annotation must be placed before the class definition and inheritance." +msgstr "" +"将当前脚本标记为工具脚本,允许它被编辑器加载和执行。见[url=$DOCS_URL/" +"tutorials/plugins/running_code_in_the_editor.html]《在编辑器中运行代码》[/" +"url]。\n" +"[codeblock]\n" +"@tool\n" +"extends Node\n" +"[/codeblock]\n" +"[b]注意:[/b]因为注解描述对象的关系,必须把 [annotation @tool] 注解放在类定义" +"和继承之前。" + +msgid "" "Mark the following statement to ignore the specified [param warning]. See " "[url=$DOCS_URL/tutorials/scripting/gdscript/warning_system.html]GDScript " "warning system[/url].\n" @@ -1661,6 +1804,27 @@ msgstr "" "[/codeblock]" msgid "" +"Returns the arc tangent of [param x] in radians. Use it to get the angle from " +"an angle's tangent in trigonometry.\n" +"The method cannot know in which quadrant the angle should fall. See [method " +"atan2] if you have both [code]y[/code] and [code skip-lint]x[/code].\n" +"[codeblock]\n" +"var a = atan(0.5) # a is 0.463648\n" +"[/codeblock]\n" +"If [param x] is between [code]-PI / 2[/code] and [code]PI / 2[/code] " +"(inclusive), [code]atan(tan(x))[/code] is equal to [param x]." +msgstr "" +"返回 [param x] 的反正切值,单位是弧度。在三角函数中用它来得到一个角上切线的角" +"度。\n" +"该方法无法确定角度应该落在哪个象限。如果你同时拥有 [code]y[/code] 和 [code " +"skip-lint]x[/code],请参见 [method atan2]。\n" +"[codeblock]\n" +"var a = atan(0.5) # a=0.463648\n" +"[/codeblock]\n" +"如果 [param x] 在 [code]-PI/2[/code] 和 [code]PI/2[/code](包括)之间," +"[code]atan(tan(x))[/code] 等于 [param x]。" + +msgid "" "Returns the arc tangent of [code]y/x[/code] in radians. Use to get the angle " "of tangent [code]y/x[/code]. To compute the value, the method takes into " "account the sign of both arguments in order to determine the quadrant.\n" @@ -1746,6 +1910,30 @@ msgstr "" msgid "" "Rounds [param x] upward (towards positive infinity), returning the smallest " +"whole number that is not less than [param x]. Supported types: [int], " +"[float], [Vector2], [Vector2i], [Vector3], [Vector3i], [Vector4], " +"[Vector4i].\n" +"[codeblock]\n" +"var i = ceil(1.45) # i is 2.0\n" +"i = ceil(1.001) # i is 2.0\n" +"[/codeblock]\n" +"See also [method floor], [method round], and [method snapped].\n" +"[b]Note:[/b] For better type safety, use [method ceilf], [method ceili], " +"[method Vector2.ceil], [method Vector3.ceil], or [method Vector4.ceil]." +msgstr "" +"向上舍入 [param x](朝正无穷大方向),返回不小于 [param x] 的最小整数。支持的" +"类型:[int]、[float]、[Vector2]、[Vector2i]、[Vector3]、[Vector3i]、" +"[Vector4]、[Vector4i]。\n" +"[codeblock]\n" +"var i = ceil(1.45) # i 为 2.0\n" +"i = ceil(1.001) # i 为 2.0\n" +"[/codeblock]\n" +"另见 [method floor]、[method round]、[method snapped]。\n" +"[b]注意:[/b]为了更好的类型安全,使用 [method ceilf]、[method ceili]、[method " +"Vector2.ceil]、[method Vector3.ceil] 或 [method Vector4.ceil]。" + +msgid "" +"Rounds [param x] upward (towards positive infinity), returning the smallest " "whole number that is not less than [param x].\n" "A type-safe version of [method ceil], returning a [float]." msgstr "" @@ -1887,7 +2075,7 @@ msgid "" "Cubic interpolates between two values by the factor defined in [param weight] " "with [param pre] and [param post] values." msgstr "" -"根据 [param weight] 中定义的因子以及 [param pre] 和 [param post] 值,在两个值" +"根据 [param weight] 定义的系数,以及 [param pre] 和 [param post] 值,在两个值" "之间进行三次插值。" msgid "" @@ -1895,8 +2083,19 @@ msgid "" "factor defined in [param weight] with [param pre] and [param post] values. " "See also [method lerp_angle]." msgstr "" -"根据 [param weight] 中定义的因子以及 [param pre] 和 [param post] 值,在具有最" -"短路径的两个旋转值之间三次插值 。另见 [method lerp_angle]。" +"根据 [param weight] 定义的系数,以及 [param pre] 和 [param post] 值,在两个旋" +"转值之间的最短路径进行三次插值 。另见 [method lerp_angle]。" + +msgid "" +"Cubic interpolates between two rotation values with shortest path by the " +"factor defined in [param weight] with [param pre] and [param post] values. " +"See also [method lerp_angle].\n" +"It can perform smoother interpolation than [method cubic_interpolate] by the " +"time values." +msgstr "" +"根据 [param weight] 定义的系数,以及 [param pre] 和 [param post] 值,在两个旋" +"转值之间的最短路径进行三次插值。另见 [method lerp_angle]。\n" +"它可以根据时间值执行比 [method cubic_interpolate] 更平滑的插值。" msgid "" "Cubic interpolates between two values by the factor defined in [param weight] " @@ -1904,7 +2103,7 @@ msgid "" "It can perform smoother interpolation than [method cubic_interpolate] by the " "time values." msgstr "" -"根据 [param weight] 中定义的因子以及 [param pre] 和 [param post] 值,在两个值" +"根据 [param weight] 定义的系数,以及 [param pre] 和 [param post] 值,在两个值" "之间进行三次插值。\n" "它可以根据时间值执行比 [method cubic_interpolate] 更平滑的插值。" @@ -1993,6 +2192,30 @@ msgstr "" msgid "" "Rounds [param x] downward (towards negative infinity), returning the largest " +"whole number that is not more than [param x]. Supported types: [int], " +"[float], [Vector2], [Vector2i], [Vector3], [Vector3i], [Vector4], " +"[Vector4i].\n" +"[codeblock]\n" +"var a = floor(2.99) # a is 2.0\n" +"a = floor(-2.99) # a is -3.0\n" +"[/codeblock]\n" +"See also [method ceil], [method round], and [method snapped].\n" +"[b]Note:[/b] For better type safety, use [method floorf], [method floori], " +"[method Vector2.floor], [method Vector3.floor], or [method Vector4.floor]." +msgstr "" +"向下舍入 [param x](朝负无穷大),返回不大于 [param x] 的最大整数。支持的类" +"型:[int]、[float]、[Vector2]、[Vector2i]、[Vector3]、[Vector3i]、[Vector4]、" +"[Vector4i]。\n" +"[codeblock]\n" +"var a = floor(2.99) # a 为 2.0\n" +"a = floor(-2.99) # a 为 -3.0\n" +"[/codeblock]\n" +"另见 [method ceil]、[method round]、[method snapped]。\n" +"[b]注意:[/b]为了更好的类型安全,请使用 [method floorf]、[method floori]、" +"[method Vector2.floor]、[method Vector3.floor] 或 [method Vector4.floor]。" + +msgid "" +"Rounds [param x] downward (towards negative infinity), returning the largest " "whole number that is not more than [param x].\n" "A type-safe version of [method floor], returning a [float]." msgstr "" @@ -2696,6 +2919,76 @@ msgstr "" "目的的打印消息区分开来,同时还会在打印错误或警告时显示堆栈跟踪。" msgid "" +"Converts one or more arguments of any type to string in the best way possible " +"and prints them to the console.\n" +"The following BBCode tags are supported: [code]b[/code], [code]i[/code], " +"[code]u[/code], [code]s[/code], [code]indent[/code], [code]code[/code], " +"[code]url[/code], [code]center[/code], [code]right[/code], [code]color[/" +"code], [code]bgcolor[/code], [code]fgcolor[/code].\n" +"Color tags only support the following named colors: [code]black[/code], " +"[code]red[/code], [code]green[/code], [code]yellow[/code], [code]blue[/code], " +"[code]magenta[/code], [code]pink[/code], [code]purple[/code], [code]cyan[/" +"code], [code]white[/code], [code]orange[/code], [code]gray[/code]. " +"Hexadecimal color codes are not supported.\n" +"URL tags only support URLs wrapped by a URL tag, not URLs with a different " +"title.\n" +"When printing to standard output, the supported subset of BBCode is converted " +"to ANSI escape codes for the terminal emulator to display. Support for ANSI " +"escape codes varies across terminal emulators, especially for italic and " +"strikethrough. In standard output, [code]code[/code] is represented with " +"faint text but without any font change. Unsupported tags are left as-is in " +"standard output.\n" +"[codeblocks]\n" +"[gdscript skip-lint]\n" +"print_rich(\"[color=green][b]Hello world![/b][/color]\") # Prints out \"Hello " +"world!\" in green with a bold font\n" +"[/gdscript]\n" +"[csharp skip-lint]\n" +"GD.PrintRich(\"[color=green][b]Hello world![/b][/color]\"); // Prints out " +"\"Hello world!\" in green with a bold font\n" +"[/csharp]\n" +"[/codeblocks]\n" +"[b]Note:[/b] Consider using [method push_error] and [method push_warning] to " +"print error and warning messages instead of [method print] or [method " +"print_rich]. This distinguishes them from print messages used for debugging " +"purposes, while also displaying a stack trace when an error or warning is " +"printed.\n" +"[b]Note:[/b] On Windows, only Windows 10 and later correctly displays ANSI " +"escape codes in standard output." +msgstr "" +"以尽可能最佳的方式将一个或多个任意类型的参数转换为字符串,并将其打印到控制" +"台。\n" +"支持以下 BBCode 标签: [code]b[/code]、[code]i[/code]、[code]u[/code]、" +"[code]s[/code]、[code]indent[/code]、[code]code[/code]、[code]url[/code]、" +"[code]center[/code]、[code]right[/code]、[code]color[/code]、[code]bgcolor[/" +"code]、[code]fgcolor[/code]。\n" +"颜色标签仅支持以下颜色名称:[code]black[/code]、[code]red[/code]、" +"[code]green[/code]、[code]yellow[/code]、[code]blue[/code]、[code]magenta[/" +"code]、[code]pink[/code]、[code]purple[/code]、[code]cyan[/code]、" +"[code]white[/code]、[code]orange[/code]、[code]gray[/code]。不支持十六进制颜色" +"代码。\n" +"URL 标签仅支持在 URL 标签中包含 URL,不支持使用不同标题的 URL。\n" +"当打印到标准输出时,支持的 BBCode 子集被转换为 ANSI 转义码以供终端仿真器显示。" +"对 ANSI 转义码的支持可能因终端仿真器而异,尤其是斜体和删除线。在标准输出中," +"[code]code[/code] 会使用较弱的文本表示,但字体不变。不支持的标签在标准输出中会" +"原样保留。\n" +"[codeblocks]\n" +"[gdscript skip-lint]\n" +"print_rich(\"[color=green][b]Hello world![/b][/color]\") # 输出绿色的粗" +"体“Hello world!”\n" +"[/gdscript]\n" +"[csharp skip-lint]\n" +"GD.PrintRich(\"[color=green][b]Hello world![/b][/color]\"); // 输出绿色的粗" +"体“Hello world!”\n" +"[/csharp]\n" +"[/codeblocks]\n" +"[b]注意:[/b]请考虑使用 [method push_error] 和 [method push_warning] 来打印错" +"误和警告消息,而不是 [method print] 或 [method print_rich]。这将它们与用于调试" +"目的的打印消息区分开来,同时还会在打印错误或警告时显示堆栈跟踪。\n" +"[b]注意:[/b]在 Windows 中,只有 Windows 10 及后续版本能够在标准输出中正确显" +"示 ANSI 转义码。" + +msgid "" "If verbose mode is enabled ([method OS.is_stdout_verbose] returning " "[code]true[/code]), converts one or more arguments of any type to string in " "the best way possible and prints them to the console." @@ -3082,6 +3375,31 @@ msgstr "" msgid "" "Rounds [param x] to the nearest whole number, with halfway cases rounded away " +"from 0. Supported types: [int], [float], [Vector2], [Vector2i], [Vector3], " +"[Vector3i], [Vector4], [Vector4i].\n" +"[codeblock]\n" +"round(2.4) # Returns 2\n" +"round(2.5) # Returns 3\n" +"round(2.6) # Returns 3\n" +"[/codeblock]\n" +"See also [method floor], [method ceil], and [method snapped].\n" +"[b]Note:[/b] For better type safety, use [method roundf], [method roundi], " +"[method Vector2.round], [method Vector3.round], or [method Vector4.round]." +msgstr "" +"将 [param x] 舍入到最接近的整数,中间情况远离 0 舍入。支持的类型:[int]、" +"[float]、[Vector2]、[Vector2i]、[Vector3]、[Vector3i]、[Vector4]、" +"[Vector4i]。\n" +"[codeblock]\n" +"round(2.4) # 返回 2\n" +"round(2.5) # 返回 3\n" +"round(2.6) # 返回 3\n" +"[/codeblock]\n" +"另见 [method floor]、[method ceil]、[method snapped]。\n" +"[b]注意:[/b]为了更好的类型安全,使用 [method roundf]、[method roundi]、" +"[method Vector2.round]、[method Vector3.round] 或 [method Vector4.round]。" + +msgid "" +"Rounds [param x] to the nearest whole number, with halfway cases rounded away " "from 0.\n" "A type-safe version of [method round], returning a [float]." msgstr "" @@ -3465,6 +3783,85 @@ msgstr "" "[/codeblock]" msgid "" +"Converts the given [param variant] to the given [param type], using the [enum " +"Variant.Type] values. This method is generous with how it handles types, it " +"can automatically convert between array types, convert numeric [String]s to " +"[int], and converting most things to [String].\n" +"If the type conversion cannot be done, this method will return the default " +"value for that type, for example converting [Rect2] to [Vector2] will always " +"return [constant Vector2.ZERO]. This method will never show error messages as " +"long as [param type] is a valid Variant type.\n" +"The returned value is a [Variant], but the data inside and the [enum Variant." +"Type] will be the same as the requested type.\n" +"[codeblock]\n" +"type_convert(\"Hi!\", TYPE_INT) # Returns 0\n" +"type_convert(\"123\", TYPE_INT) # Returns 123\n" +"type_convert(123.4, TYPE_INT) # Returns 123\n" +"type_convert(5, TYPE_VECTOR2) # Returns (0, 0)\n" +"type_convert(\"Hi!\", TYPE_NIL) # Returns null\n" +"[/codeblock]" +msgstr "" +"使用 [enum Variant.Type] 值将给定的 [param variant] 转换为给定的 [param " +"type]。此方法对类型的处理十分宽松,可以在数组类型之间自动转换,将数值的 " +"[String] 转换为 [int],也可以将大多数内容转换为 [String]。\n" +"如果无法完成类型转换,此方法将返回该类型的默认值,例如 [Rect2] 转换为 " +"[Vector2] 时将总是返回 [constant Vector2.ZERO]。只要 [param type] 是一个有效" +"的 Variant 类型,此方法就永远不会显示错误消息。\n" +"返回的值是一个 [Variant],但是其中的数据以及 [enum Variant.Type] 将会与请求的" +"类型相同。\n" +"[codeblock]\n" +"type_convert(\"Hi!\", TYPE_INT) # 返回 0\n" +"type_convert(\"123\", TYPE_INT) # 返回 123\n" +"type_convert(123.4, TYPE_INT) # 返回 123\n" +"type_convert(5, TYPE_VECTOR2) # 返回 (0, 0)\n" +"type_convert(\"Hi!\", TYPE_NIL) # 返回 null\n" +"[/codeblock]" + +msgid "" +"Returns a human-readable name of the given [param type], using the [enum " +"Variant.Type] values.\n" +"[codeblock]\n" +"print(TYPE_INT) # Prints 2.\n" +"print(type_string(TYPE_INT)) # Prints \"int\".\n" +"print(type_string(TYPE_STRING)) # Prints \"String\".\n" +"[/codeblock]\n" +"See also [method typeof]." +msgstr "" +"返回类型 [param type] 的人类可读名称,参数使用 [enum Variant.Type] 的值。\n" +"[codeblock]\n" +"print(TYPE_INT) # 输出 2。\n" +"print(type_string(TYPE_INT)) # 输出“int”。\n" +"print(type_string(TYPE_STRING)) # 输出“String”。\n" +"[/codeblock]\n" +"另见 [method typeof]。" + +msgid "" +"Returns the internal type of the given [param variable], using the [enum " +"Variant.Type] values.\n" +"[codeblock]\n" +"var json = JSON.new()\n" +"json.parse('[\"a\", \"b\", \"c\"]')\n" +"var result = json.get_data()\n" +"if typeof(result) == TYPE_ARRAY:\n" +" print(result[0]) # Prints a\n" +"else:\n" +" print(\"Unexpected result\")\n" +"[/codeblock]\n" +"See also [method type_string]." +msgstr "" +"返回变量 [param variable] 的内部类型,使用的是 [enum Variant.Type] 中的值。\n" +"[codeblock]\n" +"var json = JSON.new()\n" +"json.parse('[\"a\", \"b\", \"c\"]')\n" +"var result = json.get_data()\n" +"if typeof(result) == TYPE_ARRAY:\n" +" print(result[0]) # 输出 a\n" +"else:\n" +" print(\"出乎意料的结果\")\n" +"[/codeblock]\n" +"另见 [method type_string]。" + +msgid "" "Encodes a [Variant] value to a byte array, without encoding objects. " "Deserialization can be done with [method bytes_to_var].\n" "[b]Note:[/b] If you need object serialization, see [method " @@ -3528,15 +3925,20 @@ msgstr "" "都是空值。" msgid "" -"Returns a weak reference to an object, or [code]null[/code] if [param obj] is " -"invalid.\n" +"Returns a [WeakRef] instance holding a weak reference to [param obj]. Returns " +"an empty [WeakRef] instance if [param obj] is [code]null[/code]. Prints an " +"error and returns [code]null[/code] if [param obj] is neither [Object]-" +"derived nor [code]null[/code].\n" "A weak reference to an object is not enough to keep the object alive: when " "the only remaining references to a referent are weak references, garbage " "collection is free to destroy the referent and reuse its memory for something " "else. However, until the object is actually destroyed the weak reference may " "return the object even if there are no strong references to it." msgstr "" -"返回对某个对象的弱引用,如果 [param obj] 无效,则返回 [code]null[/code]。\n" +"返回一个 [WeakRef] 实例,其中包含对 [param obj] 的弱引用。如果 [param obj] 为 " +"[code]null[/code],则返回空的 [WeakRef] 实例。如果 [param obj] 既不是 " +"[Object] 派生实例,也不是 [code]null[/code],则打印错误并返回 [code]null[/" +"code]。\n" "对对象的弱引用不足以使对象保持存活:当对引用对象的剩余引用都是弱引用时,垃圾回" "收可以自由销毁该引用对象并将其内存重新用于其他用途。但是,在对象实际被销毁之" "前,弱引用可能会返回该对象,即使不存在对它的强引用也是如此。" @@ -3573,6 +3975,44 @@ msgstr "" "[/codeblock]" msgid "" +"Wraps the float [param value] between [param min] and [param max]. Can be " +"used for creating loop-alike behavior or infinite surfaces.\n" +"[codeblock]\n" +"# Infinite loop between 5.0 and 9.9\n" +"value = wrapf(value + 0.1, 5.0, 10.0)\n" +"[/codeblock]\n" +"[codeblock]\n" +"# Infinite rotation (in radians)\n" +"angle = wrapf(angle + 0.1, 0.0, TAU)\n" +"[/codeblock]\n" +"[codeblock]\n" +"# Infinite rotation (in radians)\n" +"angle = wrapf(angle + 0.1, -PI, PI)\n" +"[/codeblock]\n" +"[b]Note:[/b] If [param min] is [code]0[/code], this is equivalent to [method " +"fposmod], so prefer using that instead.\n" +"[method wrapf] is more flexible than using the [method fposmod] approach by " +"giving the user control over the minimum value." +msgstr "" +"在 [param min] 和 [param max] 之间将浮点数 [param value] 循环。可用于创建类似" +"循环的行为或无限曲面。\n" +"[codeblock]\n" +"# 在 5.0 和 9.9 之间无限循环\n" +"value = wrapf(value + 0.1, 5.0, 10.0)\n" +"[/codeblock]\n" +"[codeblock]\n" +"# 无限旋转(弧度)\n" +"angle = wrapf(angle + 0.1, 0.0, TAU)\n" +"[/codeblock]\n" +"[codeblock]\n" +"# 无限旋转(弧度)\n" +"angle = wrapf(angle + 0.1, -PI, PI)\n" +"[/codeblock]\n" +"[b]注意:[/b]如果 [param min] 为 [code]0[/code],则相当于 [method fposmod],因" +"此请改用它。\n" +"通过让用户控制最小值,[method wrapf] 比使用 [method fposmod] 方法更灵活。" + +msgid "" "Wraps the integer [param value] between [param min] and [param max]. Can be " "used for creating loop-alike behavior or infinite surfaces.\n" "[codeblock]\n" @@ -4610,7 +5050,7 @@ msgid "" "Game controller SDL back button. Corresponds to the Sony Select, Xbox Back, " "Nintendo - button." msgstr "" -"游戏控制器 SDL back按钮。对应于 Sony Select、Xbox Back、Nintendo - 按钮。" +"游戏控制器 SDL back 按钮。对应于 Sony Select、Xbox Back、Nintendo - 按钮。" msgid "" "Game controller SDL guide button. Corresponds to the Sony PS, Xbox Home " @@ -4618,6 +5058,12 @@ msgid "" msgstr "游戏控制器 SDL guide 按钮。对应于索尼 PS、Xbox 的 Home 键。" msgid "" +"Game controller SDL start button. Corresponds to the Sony Options, Xbox Menu, " +"Nintendo + button." +msgstr "" +"游戏控制器 SDL start 按钮。对应于 Sony Options、Xbox Menu、Nintendo + 按钮。" + +msgid "" "Game controller SDL left stick button. Corresponds to the Sony L3, Xbox L/LS " "button." msgstr "游戏控制器 SDL 左摇杆按钮。对应于 Sony L3、Xbox L/LS 按钮。" @@ -5210,6 +5656,13 @@ msgstr "" "提示一个 [Color] 属性在编辑时不能影响其透明度([member Color.a] 不可编辑)。" msgid "" +"Hints that the property's value is an object encoded as object ID, with its " +"type specified in the hint string. Used by the debugger." +msgstr "" +"提示该属性的值是一个被编码为对象 ID 的对象,其类型在提示字符串中指定。被用于调" +"试器。" + +msgid "" "If a property is [String], hints that the property represents a particular " "type (class). This allows to select a type from the create dialog. The " "property will store the selected type as a string.\n" @@ -5379,6 +5832,57 @@ msgstr "" "[b]注意:[/b]后缀冒号是必须的,否则无法正确识别内置类型。" msgid "" +"[i]Deprecated.[/i] This hint is not used anywhere and will be removed in the " +"future." +msgstr "[i]已废弃。[/i]该提示未被用于任何地方,将来会被移除。" + +msgid "Hints that an object is too big to be sent via the debugger." +msgstr "提示对象太大而无法通过调试器发送。" + +msgid "" +"Hints that the hint string specifies valid node types for property of type " +"[NodePath]." +msgstr "提示该提示字符串为类型 [NodePath] 的属性指定有效的节点类型。" + +msgid "" +"Hints that a [String] property is a path to a file. Editing it will show a " +"file dialog for picking the path for the file to be saved at. The dialog has " +"access to the project's directory. The hint string can be a set of filters " +"with wildcards like [code]\"*.png,*.jpg\"[/code]. See also [member FileDialog." +"filters]." +msgstr "" +"提示 [String] 属性是文件的路径。编辑它将显示一个文件对话框,用于选择文件要保存" +"的路径。该对话框可以访问项目的目录。该提示字符串可以是一组带有通配符的筛选器," +"例如 [code]\"*.png,*.jpg\"[/code]。另请参阅 [member FileDialog.filters]。" + +msgid "" +"Hints that a [String] property is a path to a file. Editing it will show a " +"file dialog for picking the path for the file to be saved at. The dialog has " +"access to the entire filesystem. The hint string can be a set of filters with " +"wildcards like [code]\"*.png,*.jpg\"[/code]. See also [member FileDialog." +"filters]." +msgstr "" +"提示 [String] 属性是文件的路径。编辑它将显示一个文件对话框,用于选择文件要保存" +"的路径。该对话框可以访问整个文件系统。该提示字符串可以是一组带有通配符的筛选" +"器,例如 [code]\"*.png,*.jpg\"[/code]。另请参阅 [member FileDialog.filters]。" + +msgid "" +"Hints that an [int] property is an object ID.\n" +"[i]Deprecated.[/i] This hint is not used anywhere and will be removed in the " +"future." +msgstr "" +"提示 [int] 属性是对象 ID。\n" +"[i]已废弃。[/i]该提示不会用于任何地方,将来会被移除。" + +msgid "Hints that an [int] property is a pointer. Used by GDExtension." +msgstr "提示 [int] 属性是一个指针。用于 GDExtension。" + +msgid "" +"Hints that a property is an [Array] with the stored type specified in the " +"hint string." +msgstr "提示属性是一个 [Array],其存储类型在提示字符串中指定。" + +msgid "" "Hints that a string property is a locale code. Editing it will show a locale " "dialog for picking language and country." msgstr "" @@ -5392,6 +5896,14 @@ msgstr "" "提示一个字典属性是字符串翻译映射。字典的键是区域设置代码,值是翻译后的字符串。" msgid "" +"Hints that a property is an instance of a [Node]-derived type, optionally " +"specified via the hint string (e.g. [code]\"Node2D\"[/code]). Editing it will " +"show a dialog for picking a node from the scene." +msgstr "" +"提示属性是 [Node] 派生类型的实例,可以选择通过提示字符串指定(例如 " +"[code]\"Node2D\"[/code])。编辑它将显示一个用于从场景中选取节点的对话框。" + +msgid "" "Hints that a quaternion property should disable the temporary euler editor." msgstr "提示四元数属性应当禁用临时欧拉值编辑器。" @@ -5435,6 +5947,11 @@ msgid "" msgstr "" "用于在子组(一个组下)中将编辑器中的属性编组在一起。请参阅 [EditorInspector]。" +msgid "" +"The property is a bitfield, i.e. it contains multiple flags represented as " +"bits." +msgstr "该属性是一个位字段,即它包含多个被表示为位的标志。" + msgid "The property does not save its state in [PackedScene]." msgstr "该属性不在 [PackedScene] 中保存其状态。" @@ -5446,6 +5963,31 @@ msgid "" "scene file." msgstr "该属性是一个脚本变量,应该被序列化并保存在场景文件中。" +msgid "" +"The property value of type [Object] will be stored even if its value is " +"[code]null[/code]." +msgstr "即使 [Object] 类型的属性值为 [code]null[/code],也会被存储。" + +msgid "If this property is modified, all inspector fields will be refreshed." +msgstr "如果该属性被修改,则所有检查器字段都将被刷新。" + +msgid "" +"Signifies a default value from a placeholder script instance.\n" +"[i]Deprecated.[/i] This hint is not used anywhere and will be removed in the " +"future." +msgstr "" +"表示占位符脚本实例的默认值。\n" +"[i]已废弃。[/i]该提示不会用于任何地方,将来会被移除。" + +msgid "" +"The property is an enum, i.e. it only takes named integer constants from its " +"associated enumeration." +msgstr "该属性是一个枚举,即它仅从其关联的枚举中获取被命名的整数常量。" + +msgid "" +"If property has [code]nil[/code] as default value, its type will be [Variant]." +msgstr "如果属性将 [code]nil[/code] 作为默认值,则其类型将为 [Variant]。" + msgid "The property is an array." msgstr "该属性为数组。" @@ -5471,6 +6013,48 @@ msgid "" "(the Compatibility rendering method is excluded)." msgstr "只有在支持现代渲染器(不包含 GLES3)的情况下该属性才会在编辑器中显示。" +msgid "" +"The [NodePath] property will always be relative to the scene's root. Mostly " +"useful for local resources." +msgstr "[NodePath] 属性将始终相对于场景根。对于本地资源来说最有用。" + +msgid "" +"Use when a resource is created on the fly, i.e. the getter will always return " +"a different instance. [ResourceSaver] needs this information to properly save " +"such resources." +msgstr "" +"在动态创建资源时使用,即 Getter 将始终返回一个不同的实例。[ResourceSaver] 需要" +"该信息来正确保存这种资源。" + +msgid "" +"Inserting an animation key frame of this property will automatically " +"increment the value, allowing to easily keyframe multiple values in a row." +msgstr "" +"插入该属性的动画关键帧将自动增加该值,从而可以轻松地为一行中的多个值设置关键" +"帧。" + +msgid "" +"When loading, the resource for this property can be set at the end of " +"loading.\n" +"[i]Deprecated.[/i] This hint is not used anywhere and will be removed in the " +"future." +msgstr "" +"加载时,可以在加载结束时设置该属性的资源。\n" +"[i]已废弃。[/i]该提示不会用于任何地方,将来会被移除。" + +msgid "" +"When this property is a [Resource] and base object is a [Node], a resource " +"instance will be automatically created whenever the node is created in the " +"editor." +msgstr "" +"当该属性为 [Resource] 且基础对象为 [Node] 时,则每当该节点是在编辑器中创建的," +"都会自动创建一个资源实例。" + +msgid "" +"The property is considered a basic setting and will appear even when advanced " +"mode is disabled. Used for project settings." +msgstr "该属性被视为基本设置,即使禁用高级模式时也会显现。用于项目设置。" + msgid "The property is read-only in the [EditorInspector]." msgstr "该属性在 [EditorInspector] 中只读。" @@ -5819,8 +6403,7 @@ msgstr "返回该 [AABB] 归一化后的最短轴。" msgid "" "Returns the index of the shortest axis of the [AABB] (according to [Vector3]::" "AXIS* enum)." -msgstr "" -"返回该 [AABB] 最短轴的索引(根据 [Vector3] 的 [code]AXIS_*[/code] 常量)。" +msgstr "返回该 [AABB] 最短轴的索引(根据 [Vector3]::AXIS* 常量)。" msgid "Returns the scalar length of the shortest axis of the [AABB]." msgstr "返回该 [AABB] 最短轴的标量长度。" @@ -5938,6 +6521,23 @@ msgstr "" "靠。" msgid "" +"Inversely transforms (multiplies) the [AABB] by the given [Transform3D] " +"transformation matrix, under the assumption that the transformation basis is " +"orthonormal (i.e. rotation/reflection is fine, scaling/skew is not).\n" +"[code]aabb * transform[/code] is equivalent to [code]transform.inverse() * " +"aabb[/code]. See [method Transform3D.inverse].\n" +"For transforming by inverse of an affine transformation (e.g. with scaling) " +"[code]transform.affine_inverse() * aabb[/code] can be used instead. See " +"[method Transform3D.affine_inverse]." +msgstr "" +"假设该变换的基是正交的(即旋转/反射可以,缩放/倾斜则不行),将 [AABB] 逆向变换" +"(乘以)给定的 [Transform3D] 变换矩阵。\n" +"[code]aabb * transform[/code] 相当于 [code]transform.inverse() * aabb[/code]。" +"见 [method Transform3D.inverse]。\n" +"对于通过仿射变换的逆进行的变换(例如,缩放),可以使用 [code]transform." +"affine_inverse() * aabb[/code] 代替。见 [method Transform3D.affine_inverse]。" + +msgid "" "Returns [code]true[/code] if the AABBs are exactly equal.\n" "[b]Note:[/b] Due to floating-point precision errors, consider using [method " "is_equal_approx] instead, which is more reliable." @@ -6945,6 +7545,12 @@ msgstr "" "要时才使用压缩动画。" msgid "" +"Adds a new track to [param to_animation] that is a copy of the given track " +"from this animation." +msgstr "" +"向 [param to_animation] 添加一个新轨道,该轨道是该动画中给定轨道的副本。" + +msgid "" "Returns the index of the specified track. If the track is not found, return " "-1." msgstr "返回指定轨迹的索引。如果没有找到,返回 -1。" @@ -12169,6 +12775,123 @@ msgid "" msgstr "A* 的一种实现,用于寻找 3D 空间中连接图中的两个顶点之间的最短路径。" msgid "" +"A* (A star) is a computer algorithm used in pathfinding and graph traversal, " +"the process of plotting short paths among vertices (points), passing through " +"a given set of edges (segments). It enjoys widespread use due to its " +"performance and accuracy. Godot's A* implementation uses points in 3D space " +"and Euclidean distances by default.\n" +"You must add points manually with [method add_point] and create segments " +"manually with [method connect_points]. Once done, you can test if there is a " +"path between two points with the [method are_points_connected] function, get " +"a path containing indices by [method get_id_path], or one containing actual " +"coordinates with [method get_point_path].\n" +"It is also possible to use non-Euclidean distances. To do so, create a class " +"that extends [AStar3D] and override methods [method _compute_cost] and " +"[method _estimate_cost]. Both take two indices and return a length, as is " +"shown in the following example.\n" +"[codeblocks]\n" +"[gdscript]\n" +"class MyAStar:\n" +" extends AStar3D\n" +"\n" +" func _compute_cost(u, v):\n" +" return abs(u - v)\n" +"\n" +" func _estimate_cost(u, v):\n" +" return min(0, abs(u - v) - 1)\n" +"[/gdscript]\n" +"[csharp]\n" +"public partial class MyAStar : AStar3D\n" +"{\n" +" public override float _ComputeCost(long fromId, long toId)\n" +" {\n" +" return Mathf.Abs((int)(fromId - toId));\n" +" }\n" +"\n" +" public override float _EstimateCost(long fromId, long toId)\n" +" {\n" +" return Mathf.Min(0, Mathf.Abs((int)(fromId - toId)) - 1);\n" +" }\n" +"}\n" +"[/csharp]\n" +"[/codeblocks]\n" +"[method _estimate_cost] should return a lower bound of the distance, i.e. " +"[code]_estimate_cost(u, v) <= _compute_cost(u, v)[/code]. This serves as a " +"hint to the algorithm because the custom [method _compute_cost] might be " +"computation-heavy. If this is not the case, make [method _estimate_cost] " +"return the same value as [method _compute_cost] to provide the algorithm with " +"the most accurate information.\n" +"If the default [method _estimate_cost] and [method _compute_cost] methods are " +"used, or if the supplied [method _estimate_cost] method returns a lower bound " +"of the cost, then the paths returned by A* will be the lowest-cost paths. " +"Here, the cost of a path equals the sum of the [method _compute_cost] results " +"of all segments in the path multiplied by the [code]weight_scale[/code]s of " +"the endpoints of the respective segments. If the default methods are used and " +"the [code]weight_scale[/code]s of all points are set to [code]1.0[/code], " +"then this equals the sum of Euclidean distances of all segments in the path." +msgstr "" +"A*(A 星)是一种计算机算法,用于寻路和图遍历,即穿过一组给定的边(线段),在顶" +"点(点)之间绘制短路径的过程。由于其性能和准确性,它被广泛使用。Godot 的 A* 实" +"现默认使用 3D 空间中的点和欧几里德距离。\n" +"你需要使用 [method add_point] 手动添加点,并使用 [method connect_points] 手动" +"创建线段。完成后,可以使用 [method are_points_connected] 函数,测试两点之间是" +"否存在路径,通过 [method get_id_path] 获取包含索引的路径,或使用 [method " +"get_point_path] 获取包含实际坐标的路径。\n" +"也可以使用非欧几里德距离。为此,创建一个扩展 [AStar3D] 的类,并覆盖方法 " +"[method _compute_cost] 和 [method _estimate_cost]。两者都接受两个索引并返回一" +"个长度,如以下示例所示。\n" +"[codeblocks]\n" +"[gdscript]\n" +"class MyAStar:\n" +" extends AStar3D\n" +"\n" +" func _compute_cost(u, v):\n" +" return abs(u - v)\n" +"\n" +" func _estimate_cost(u, v):\n" +" return min(0, abs(u - v) - 1)\n" +"[/gdscript]\n" +"[csharp]\n" +"public partial class MyAStar : AStar3D\n" +"{\n" +" public override float _ComputeCost(long fromId, long toId)\n" +" {\n" +" return Mathf.Abs((int)(fromId - toId));\n" +" }\n" +"\n" +" public override float _EstimateCost(long fromId, long toId)\n" +" {\n" +" return Mathf.Min(0, Mathf.Abs((int)(fromId - toId)) - 1);\n" +" }\n" +"}\n" +"[/csharp]\n" +"[/codeblocks]\n" +"[method _estimate_cost] 应该返回距离的下限,即 [code]_estimate_cost(u, v) <= " +"_compute_cost(u, v)[/code]。这可以作为算法的提示,因为自定义 [method " +"_compute_cost] 可能计算量很大。如果不是这种情况,请使 [method _estimate_cost] " +"返回与 [method _compute_cost] 相同的值,以便为算法提供最准确的信息。\n" +"如果使用默认的 [method _estimate_cost] 和 [method _compute_cost] 方法,或者如" +"果提供的 [method _estimate_cost] 方法返回成本的下限,则 A* 返回的路径将是成本" +"最低的路径。这里,路径的代价等于路径中所有段的 [method _compute_cost] 结果乘以" +"各个段端点的权重 [code]weight_scale[/code] 之和。如果使用默认方法,并且所有点" +"的 [code]weight_scale[/code] 设置为 [code]1.0[/code],则这等于路径中所有段的欧" +"几里德距离之和。" + +msgid "" +"Called when computing the cost between two connected points.\n" +"Note that this function is hidden in the default [AStar3D] class." +msgstr "" +"计算两个连接点之间的成本时调用。\n" +"注意这个函数隐藏在默认的 [AStar3D] 类中。" + +msgid "" +"Called when estimating the cost between a point and the path's ending point.\n" +"Note that this function is hidden in the default [AStar3D] class." +msgstr "" +"估计一个点和路径终点之间的成本时调用。\n" +"注意这个函数隐藏在默认的 [AStar3D] 类中。" + +msgid "" "Adds a new point at the given position with the given identifier. The [param " "id] must be 0 or larger, and the [param weight_scale] must be 0.0 or " "greater.\n" @@ -12516,6 +13239,20 @@ msgstr "" "要从寻路网格中移除某个点,必须使用 [method set_point_solid] 将其设置为“实心”。" msgid "" +"Called when computing the cost between two connected points.\n" +"Note that this function is hidden in the default [AStarGrid2D] class." +msgstr "" +"计算两个连接点之间的成本时调用。\n" +"注意这个函数隐藏在默认的 [AStarGrid2D] 类中。" + +msgid "" +"Called when estimating the cost between a point and the path's ending point.\n" +"Note that this function is hidden in the default [AStarGrid2D] class." +msgstr "" +"估计一个点和路径终点之间的成本时调用。\n" +"注意这个函数隐藏在默认的 [AStarGrid2D] 类中。" + +msgid "" "Clears the grid and sets the [member region] to [code]Rect2i(0, 0, 0, 0)[/" "code]." msgstr "清空网格并将 [member region] 设置为 [code]Rect2i(0, 0, 0, 0)[/code]。" @@ -12547,11 +13284,40 @@ msgstr "" "径的起点到终点排序。" msgid "" +"Returns an array with the points that are in the path found by [AStarGrid2D] " +"between the given points. The array is ordered from the starting point to the " +"ending point of the path.\n" +"[b]Note:[/b] This method is not thread-safe. If called from a [Thread], it " +"will return an empty [PackedVector3Array] and will print an error message." +msgstr "" +"返回一个数组,其中包含 [AStarGrid2D] 在给定点之间找到的路径上的点。数组从路径" +"的起点到终点排序。\n" +"[b]注意:[/b]该方法不是线程安全的。如果从 [Thread] 中调用它,它将返回一个空的 " +"[PackedVector3Array] 并打印一条错误消息。" + +msgid "" "Indicates that the grid parameters were changed and [method update] needs to " "be called." msgstr "表示网格参数发生改变,需要调用 [method update]。" msgid "" +"Returns [code]true[/code] if the [param x] and [param y] is a valid grid " +"coordinate (id), i.e. if it is inside [member region]. Equivalent to " +"[code]region.has_point(Vector2i(x, y))[/code]." +msgstr "" +"如果 [param x] 和 [param y] 是有效的网格坐标(ID),即如果它位于 [member " +"region] 内部,则返回 [code]true[/code]。相当于 [code]region." +"has_point(Vector2i(x, y))[/code]。" + +msgid "" +"Returns [code]true[/code] if the [param id] vector is a valid grid " +"coordinate, i.e. if it is inside [member region]. Equivalent to [code]region." +"has_point(id)[/code]." +msgstr "" +"如果 [param id] 向量是有效的网格坐标,即如果它位于 [member region] 内部,则返" +"回 [code]true[/code]。相当于 [code]region.has_point(id)[/code]。" + +msgid "" "Returns [code]true[/code] if a point is disabled for pathfinding. By default, " "all points are enabled." msgstr "" @@ -13836,11 +14602,9 @@ msgid "" "[b]Note:[/b] This can be expensive; it is not recommended to call [method " "get_output_latency] every frame." msgstr "" -"返回音频驱动程序的有效输出延迟。该方法基于 [ 成员 ProjectSettings.audio/" -"driver/output_latency],但精确的返回值将依赖操作系统和音频驱动程序而有所不" -"同。\n" -"[b] 注意:[/b] 该方法可能存在大量性能开销;不建议逐帧调用 [ 方法 " -"get_output_latency]。" +"返回音频驱动的实际输出延迟。基于 [member ProjectSettings.audio/driver/" +"output_latency],但实际的返回值取决于操作系统和音频驱动。\n" +"[b]注意:[/b]可能开销较大;不建议每帧都调用 [method get_output_latency]。" msgid "Returns the speaker configuration." msgstr "返回扬声器的配置。" @@ -14016,6 +14780,143 @@ msgid "An audio stream with utilities for procedural sound generation." msgstr "提供程序式声音生成工具的音频流。" msgid "" +"[AudioStreamGenerator] is a type of audio stream that does not play back " +"sounds on its own; instead, it expects a script to generate audio data for " +"it. See also [AudioStreamGeneratorPlayback].\n" +"Here's a sample on how to use it to generate a sine wave:\n" +"[codeblocks]\n" +"[gdscript]\n" +"var playback # Will hold the AudioStreamGeneratorPlayback.\n" +"@onready var sample_hz = $AudioStreamPlayer.stream.mix_rate\n" +"var pulse_hz = 440.0 # The frequency of the sound wave.\n" +"\n" +"func _ready():\n" +" $AudioStreamPlayer.play()\n" +" playback = $AudioStreamPlayer.get_stream_playback()\n" +" fill_buffer()\n" +"\n" +"func fill_buffer():\n" +" var phase = 0.0\n" +" var increment = pulse_hz / sample_hz\n" +" var frames_available = playback.get_frames_available()\n" +"\n" +" for i in range(frames_available):\n" +" playback.push_frame(Vector2.ONE * sin(phase * TAU))\n" +" phase = fmod(phase + increment, 1.0)\n" +"[/gdscript]\n" +"[csharp]\n" +"[Export] public AudioStreamPlayer Player { get; set; }\n" +"\n" +"private AudioStreamGeneratorPlayback _playback; // Will hold the " +"AudioStreamGeneratorPlayback.\n" +"private float _sampleHz;\n" +"private float _pulseHz = 440.0f; // The frequency of the sound wave.\n" +"\n" +"public override void _Ready()\n" +"{\n" +" if (Player.Stream is AudioStreamGenerator generator) // Type as a " +"generator to access MixRate.\n" +" {\n" +" _sampleHz = generator.MixRate;\n" +" Player.Play();\n" +" _playback = (AudioStreamGeneratorPlayback)Player." +"GetStreamPlayback();\n" +" FillBuffer();\n" +" }\n" +"}\n" +"\n" +"public void FillBuffer()\n" +"{\n" +" double phase = 0.0;\n" +" float increment = _pulseHz / _sampleHz;\n" +" int framesAvailable = _playback.GetFramesAvailable();\n" +"\n" +" for (int i = 0; i < framesAvailable; i++)\n" +" {\n" +" _playback.PushFrame(Vector2.One * (float)Mathf.Sin(phase * Mathf." +"Tau));\n" +" phase = Mathf.PosMod(phase + increment, 1.0);\n" +" }\n" +"}\n" +"[/csharp]\n" +"[/codeblocks]\n" +"In the example above, the \"AudioStreamPlayer\" node must use an " +"[AudioStreamGenerator] as its stream. The [code]fill_buffer[/code] function " +"provides audio data for approximating a sine wave.\n" +"See also [AudioEffectSpectrumAnalyzer] for performing real-time audio " +"spectrum analysis.\n" +"[b]Note:[/b] Due to performance constraints, this class is best used from C# " +"or from a compiled language via GDExtension. If you still want to use this " +"class from GDScript, consider using a lower [member mix_rate] such as 11,025 " +"Hz or 22,050 Hz." +msgstr "" +"[AudioStreamGenerator] 是一种音频流,它自己并不播放声音,而是要用脚本来为它生" +"成音频数据。另见 [AudioStreamGeneratorPlayback]。\n" +"以下是用它来生成正弦波的例子:\n" +"[codeblocks]\n" +"[gdscript]\n" +"var playback # 存放 AudioStreamGeneratorPlayback。\n" +"@onready var sample_hz = $AudioStreamPlayer.stream.mix_rate\n" +"var pulse_hz = 440.0 # 声音波形的频率。\n" +"\n" +"func _ready():\n" +" $AudioStreamPlayer.play()\n" +" playback = $AudioStreamPlayer.get_stream_playback()\n" +" fill_buffer()\n" +"\n" +"func fill_buffer():\n" +" var phase = 0.0\n" +" var increment = pulse_hz / sample_hz\n" +" var frames_available = playback.get_frames_available()\n" +"\n" +" for i in range(frames_available):\n" +" playback.push_frame(Vector2.ONE * sin(phase * TAU))\n" +" phase = fmod(phase + increment, 1.0)\n" +"[/gdscript]\n" +"[csharp]\n" +"[Export] public AudioStreamPlayer Player { get; set; }\n" +"\n" +"private AudioStreamGeneratorPlayback _playback; // 存放 " +"AudioStreamGeneratorPlayback。\n" +"private float _sampleHz;\n" +"private float _pulseHz = 440.0f; // 音频波形的频率。\n" +"\n" +"public override void _Ready()\n" +"{\n" +" if (Player.Stream is AudioStreamGenerator generator) // Type as a " +"generator to access MixRate.\n" +" {\n" +" _sampleHz = generator.MixRate;\n" +" Player.Play();\n" +" _playback = (AudioStreamGeneratorPlayback)Player." +"GetStreamPlayback();\n" +" FillBuffer();\n" +" }\n" +"}\n" +"\n" +"public void FillBuffer()\n" +"{\n" +" double phase = 0.0;\n" +" float increment = _pulseHz / _sampleHz;\n" +" int framesAvailable = _playback.GetFramesAvailable();\n" +"\n" +" for (int i = 0; i < framesAvailable; i++)\n" +" {\n" +" _playback.PushFrame(Vector2.One * (float)Mathf.Sin(phase * Mathf." +"Tau));\n" +" phase = Mathf.PosMod(phase + increment, 1.0);\n" +" }\n" +"}\n" +"[/csharp]\n" +"[/codeblocks]\n" +"上面的例子中,“AudioStreamPlayer”节点必须使用 [AudioStreamGenerator] 作为其" +"流。[code]fill_buffer[/code] 函数负责提供模拟正弦波的音频数据。\n" +"要执行实时音频频谱分析,见 [AudioEffectSpectrumAnalyzer]。\n" +"[b]注意:[/b]由于性能的限制,这个类最好在 C# 或者在利用 GDExtension 的编译语言" +"中使用。如果你仍然想要在 GDScript 中使用这个类,请考虑使用 11,025 Hz 或 " +"22,050 Hz 等较低的 [member mix_rate]。" + +msgid "" "The length of the buffer to generate (in seconds). Lower values result in " "less latency, but require the script to generate audio data faster, resulting " "in increased CPU usage and more risk for audio cracking if the CPU can't keep " @@ -14075,6 +14976,12 @@ msgstr "" "code],则缓冲区已满。" msgid "" +"Returns the number of times the playback skipped due to a buffer underrun in " +"the audio sample data. This value is reset at the start of the playback." +msgstr "" +"返回由于音频样本数据中缓冲区不足而导致播放跳过的次数。该值在播放开始时重置。" + +msgid "" "Pushes several audio data frames to the buffer. This is usually more " "efficient than [method push_frame] in C# and compiled languages via " "GDExtension, but [method push_buffer] may be [i]less[/i] efficient in " @@ -14183,9 +15090,12 @@ msgid "" "This class is part of the audio stream system, which also supports WAV files " "through the [AudioStreamWAV] class." msgstr "" -"AudioStreamOggVorbis 类是专用于处理 Ogg Vorbis 文件格式的 [ 音频流 ] 类。它提" -"供加载和播放 Ogg Vorbis 文件以及管理循环和其他播放属性的功能。该类是音频流系统" -"的一部分,该系统还通过 [AudioStreamWAV] 类支持 WAV 系统。" +"AudioStreamOggVorbis 类是专用于处理 Ogg Vorbis 文件格式的 [AudioStream] 类。它" +"提供加载和播放 Ogg Vorbis 文件以及管理循环和其他播放属性的功能。该类是音频流系" +"统的一部分,该系统还通过 [AudioStreamWAV] 类支持 WAV 系统。" + +msgid "Runtime file loading and saving" +msgstr "运行时文件加载与保存" msgid "" "Creates a new AudioStreamOggVorbis instance from the given buffer. The buffer " @@ -14206,8 +15116,8 @@ msgid "" "loop_offset] once it is done playing. Useful for ambient sounds and " "background music." msgstr "" -"如果为 [code]true[/code],则音频播放完成后将从 [ 成员 loop_offset] 指定的位置" -"再次播放。该方法对环境声音和背景音乐很有用。" +"如果为 [code]true[/code],则音频播放完成后将从 [member loop_offset] 指定的位置" +"再次播放。可用于环境声音和背景音乐。" msgid "Contains the raw Ogg data for this stream." msgstr "包含用于这个流的原始 Ogg 数据。" @@ -15480,6 +16390,33 @@ msgid "" msgstr "如果为 [code]true[/code],则对象不会收到投射到其上的阴影。" msgid "" +"Distance at which the object appears fully opaque.\n" +"[b]Note:[/b] If [member distance_fade_max_distance] is less than [member " +"distance_fade_min_distance], the behavior will be reversed. The object will " +"start to fade away at [member distance_fade_max_distance] and will fully " +"disappear once it reaches [member distance_fade_min_distance]." +msgstr "" +"物体看起来完全不透明的距离。\n" +"[b]注意:[/b]如果 [member distance_fade_max_distance] 小于 [member " +"distance_fade_min_distance],则行为相反。物体将在 [member " +"distance_fade_max_distance] 处开始逐渐消失,并在到达 [member " +"distance_fade_min_distance] 时完全消失。" + +msgid "" +"Distance at which the object starts to become visible. If the object is less " +"than this distance away, it will be invisible.\n" +"[b]Note:[/b] If [member distance_fade_min_distance] is greater than [member " +"distance_fade_max_distance], the behavior will be reversed. The object will " +"start to fade away at [member distance_fade_max_distance] and will fully " +"disappear once it reaches [member distance_fade_min_distance]." +msgstr "" +"物体开始变得可见的距离。如果物体的距离小于这个距离,它将是不可见的。\n" +"[b]注意:[/b]如果 [member distance_fade_min_distance] 大于 [member " +"distance_fade_max_distance],则行为将相反。物体将在 [member " +"distance_fade_max_distance] 处开始逐渐消失,并在到达 [member " +"distance_fade_min_distance] 时完全消失。" + +msgid "" "Specifies which type of fade to use. Can be any of the [enum " "DistanceFadeMode]s." msgstr "指定要使用的淡入淡出类型。可以是任何一个 [enum DistanceFadeMode]。" @@ -16254,58 +17191,81 @@ msgid "Represents the size of the [enum TextureParam] enum." msgstr "代表 [enum TextureParam] 枚举的大小。" msgid "" -"The texture filter reads from the nearest pixel only. The simplest and " -"fastest method of filtering, but the texture will look pixelized." +"The texture filter reads from the nearest pixel only. This makes the texture " +"look pixelated from up close, and grainy from a distance (due to mipmaps not " +"being sampled)." msgstr "" -"纹理过滤器仅读取最邻近的像素。最简单快速的过滤方法,但纹理看起来会像素化。" +"纹理过滤仅从最近的像素读取。这使得纹理从近距离看是像素化的,从远处看是颗粒状的" +"(由于多级渐远纹理没有被采样)。" msgid "" -"The texture filter blends between the nearest 4 pixels. Use this when you " -"want to avoid a pixelated style, but do not want mipmaps." +"The texture filter blends between the nearest 4 pixels. This makes the " +"texture look smooth from up close, and grainy from a distance (due to mipmaps " +"not being sampled)." msgstr "" -"纹理过滤器在最邻近的 4 个像素之间混合。如果你想要避免像素化风格,但又不想使用 " -"mipmap,那么请使用这个选项。" +"纹理过滤在最近的 4 个像素之间进行混合。这使得纹理从近处看起来很平滑,从远处看" +"起来却有颗粒感(由于多级渐远纹理没有被采样)。" msgid "" -"The texture filter reads from the nearest pixel in the nearest mipmap. The " -"fastest way to read from textures with mipmaps." +"The texture filter reads from the nearest pixel and blends between the " +"nearest 2 mipmaps (or uses the nearest mipmap if [member ProjectSettings." +"rendering/textures/default_filters/use_nearest_mipmap_filter] is [code]true[/" +"code]). This makes the texture look pixelated from up close, and smooth from " +"a distance." msgstr "" -"纹理过滤器读取最邻近的 mipmap 中的最邻近的像素。带有 mipmap 的纹理的最快读取方" -"法。" +"纹理过滤从最近的像素读取并在最近的 2 个多级渐远纹理之间进行混合(或者如果 " +"[member ProjectSettings.rendering/textures/default_filters/" +"use_nearest_mipmap_filter] 为 [code]true[/code],则使用最近的多级渐远纹理)。" +"这使得纹理从近处看起来像素化,从远处看起来平滑。" msgid "" "The texture filter blends between the nearest 4 pixels and between the " -"nearest 2 mipmaps. Use this for most cases as mipmaps are important to smooth " -"out pixels that are far from the camera." +"nearest 2 mipmaps (or uses the nearest mipmap if [member ProjectSettings." +"rendering/textures/default_filters/use_nearest_mipmap_filter] is [code]true[/" +"code]). This makes the texture look smooth from up close, and smooth from a " +"distance." msgstr "" -"纹理过滤器在最邻近的 4 个像素和最邻近的 2 个 mipmap 之间混合。请在大多数情况下" -"使用,因为 mipmap 对于平滑远离相机的像素很重要。" - -msgid "" -"The texture filter reads from the nearest pixel, but selects a mipmap based " -"on the angle between the surface and the camera view. This reduces artifacts " -"on surfaces that are almost in line with the camera. The anisotropic " -"filtering level can be changed by adjusting [member ProjectSettings.rendering/" -"textures/default_filters/anisotropic_filtering_level]." +"纹理过滤在最近的 4 个像素和最近的 2 个多级渐远纹理之间进行混合(或者如果 " +"[member ProjectSettings.rendering/textures/default_filters/" +"use_nearest_mipmap_filter] 为 [code]true[/code],则使用最近的多级渐远纹理)。" +"这使得纹理从近处看起来平滑,从远处看起来也平滑。" + +msgid "" +"The texture filter reads from the nearest pixel and blends between 2 mipmaps " +"(or uses the nearest mipmap if [member ProjectSettings.rendering/textures/" +"default_filters/use_nearest_mipmap_filter] is [code]true[/code]) based on the " +"angle between the surface and the camera view. This makes the texture look " +"pixelated from up close, and smooth from a distance. Anisotropic filtering " +"improves texture quality on surfaces that are almost in line with the camera, " +"but is slightly slower. The anisotropic filtering level can be changed by " +"adjusting [member ProjectSettings.rendering/textures/default_filters/" +"anisotropic_filtering_level]." msgstr "" -"纹理过滤器读取最邻近的像素,但会根据表面和相机视图之间的夹角选择 mipmap。可以" -"减少几乎与相机成一直线的表面的不自然情况。各向异性过滤级别可以通过调整 " +"纹理过滤从最近的像素读取并根据表面和相机视图之间的角度在 2 个多级渐远纹理之间" +"进行混合(或者如果 [member ProjectSettings.rendering/textures/default_filters/" +"use_nearest_mipmap_filter] 为 [code]true[/code],则使用最近的多级渐远纹理)。" +"这使得纹理从近处看起来像素化,从远处看起来平滑。各向异性过滤提高了几乎与相机位" +"于一条线上的表面上的纹理质量,但速度稍慢。各向异性过滤级别可以通过调整 " "[member ProjectSettings.rendering/textures/default_filters/" "anisotropic_filtering_level] 来改变。" msgid "" -"The texture filter blends between the nearest 4 pixels and selects a mipmap " -"based on the angle between the surface and the camera view. This reduces " -"artifacts on surfaces that are almost in line with the camera. This is the " -"slowest of the filtering options, but results in the highest quality " -"texturing. The anisotropic filtering level can be changed by adjusting " -"[member ProjectSettings.rendering/textures/default_filters/" -"anisotropic_filtering_level]." -msgstr "" -"纹理过滤器在最邻近的 4 个像素之间进行混合,并会根据表面和相机视图之间的夹角选" -"择 mipmap。可以减少几乎与相机成一直线的表面的不自然情况。这是过滤选项中最慢的" -"一个,但可以得到最高质量的纹理。各向异性过滤级别可以通过调整 [member " -"ProjectSettings.rendering/textures/default_filters/" +"The texture filter blends between the nearest 4 pixels and blends between 2 " +"mipmaps (or uses the nearest mipmap if [member ProjectSettings.rendering/" +"textures/default_filters/use_nearest_mipmap_filter] is [code]true[/code]) " +"based on the angle between the surface and the camera view. This makes the " +"texture look smooth from up close, and smooth from a distance. Anisotropic " +"filtering improves texture quality on surfaces that are almost in line with " +"the camera, but is slightly slower. The anisotropic filtering level can be " +"changed by adjusting [member ProjectSettings.rendering/textures/" +"default_filters/anisotropic_filtering_level]." +msgstr "" +"纹理过滤在最近的 4 个像素之间进行混合,并基于表面与相机视图之间的角度在 2 个多" +"级渐远纹理之间进行混合 (或者如果 [member ProjectSettings.rendering/textures/" +"default_filters/use_nearest_mipmap_filter] 为 [code]true[/code],则使用最近的" +"多级渐远纹理)。这使得纹理从近处看起来平滑,从远处看起来也平滑。各向异性过滤提" +"高了几乎与相机位于一条线的表面上的纹理质量,但速度稍慢。各向异性过滤级别可以通" +"过调整 [member ProjectSettings.rendering/textures/default_filters/" "anisotropic_filtering_level] 来改变。" msgid "Represents the size of the [enum TextureFilter] enum." @@ -16642,6 +17602,19 @@ msgstr "对象的 Z 轴将始终面向相机。" msgid "The object's X axis will always face the camera." msgstr "对象的 X 轴将始终面向相机。" +msgid "" +"Used for particle systems when assigned to [GPUParticles3D] and " +"[CPUParticles3D] nodes (flipbook animation). Enables [code]particles_anim_*[/" +"code] properties.\n" +"The [member ParticleProcessMaterial.anim_speed_min] or [member CPUParticles3D." +"anim_speed_min] should also be set to a value bigger than zero for the " +"animation to play." +msgstr "" +"分配给 [GPUParticles3D] 和 [CPUParticles3D] 节点时被用于粒子系统(翻页动画)。" +"启用 [code]particles_anim_*[/code] 属性。\n" +"[member ParticleProcessMaterial.anim_speed_min] 或 [member CPUParticles3D." +"anim_speed_min] 也应设置为大于零的值,以便播放动画。" + msgid "Used to read from the red channel of a texture." msgstr "用来读取纹理的红色通道。" @@ -16805,6 +17778,17 @@ msgid "Returns the inverse of the matrix." msgstr "返回矩阵的逆值。" msgid "" +"Returns [code]true[/code] if the basis is conformal, meaning it preserves " +"angles and distance ratios, and may only be composed of rotation and uniform " +"scale. Returns [code]false[/code] if the basis has non-uniform scale or shear/" +"skew. This can be used to validate if the basis is non-distorted, which is " +"important for physics and other use cases." +msgstr "" +"如果该基是共形的,则返回[code]true[/code],这意味着它保留角度和距离比率,并且" +"只能由旋转和均匀缩放组成。如果该基具有不均匀的缩放或剪切/倾斜,则返回 " +"[code]false[/code]。这可以用来验证该基是否不失真,这对于物理和其他用例很重要。" + +msgid "" "Returns [code]true[/code] if this basis and [param b] are approximately " "equal, by calling [method @GlobalScope.is_equal_approx] on all vector " "components." @@ -16892,6 +17876,16 @@ msgid "" msgstr "基矩阵的 Z 向量(第 2 列)。相当于数组索引 [code]2[/code]。" msgid "" +"The identity basis, with no rotation or scaling applied.\n" +"This is identical to creating [constructor Basis] without any parameters. " +"This constant can be used to make your code clearer, and for consistency with " +"C#." +msgstr "" +"恒等基,未应用旋转或缩放。\n" +"这与不带任何参数调用 [constructor Basis] 来创建是一样的。这个常量可以用来让你" +"的代码更清晰,并与 C# 保持一致。" + +msgid "" "The basis that will flip something along the X axis when used in a " "transformation." msgstr "在变换中使用时,会沿 X 轴翻转某物的基。" @@ -17089,6 +18083,13 @@ msgid "Returns the length of the bone in the [Bone2D] node." msgstr "返回 [Bone2D] 节点中骨骼的长度。" msgid "" +"Returns the node's [member rest] [Transform2D] if it doesn't have a parent, " +"or its rest pose relative to its parent." +msgstr "" +"如果节点没有父节点,返回节点的 [member rest] [Transform2D],或者返回它相对于父" +"节点的放松姿势。" + +msgid "" "When set to [code]true[/code], the [Bone2D] node will attempt to " "automatically calculate the bone angle and length using the first child " "[Bone2D] node, if one exists. If none exist, the [Bone2D] cannot " @@ -17771,6 +18772,10 @@ msgstr "该 [Button] 文本的 [Font]。" msgid "Font size of the [Button]'s text." msgstr "该 [Button] 文本的字体大小。" +msgid "" +"Default icon for the [Button]. Appears only if [member icon] is not assigned." +msgstr "该 [Button] 的默认图标。仅在未指定 [member icon] 时显示。" + msgid "[StyleBox] used when the [Button] is disabled." msgstr "该 [Button] 处于禁用状态时使用的 [StyleBox]。" @@ -17778,6 +18783,22 @@ msgid "" "[StyleBox] used when the [Button] is disabled (for right-to-left layouts)." msgstr "该 [Button] 处于禁用状态时使用的 [StyleBox](用于从右至左布局)。" +msgid "" +"[StyleBox] used when the [Button] is focused. The [theme_item focus] " +"[StyleBox] is displayed [i]over[/i] the base [StyleBox], so a partially " +"transparent [StyleBox] should be used to ensure the base [StyleBox] remains " +"visible. A [StyleBox] that represents an outline or an underline works well " +"for this purpose. To disable the focus visual effect, assign a " +"[StyleBoxEmpty] resource. Note that disabling the focus visual effect will " +"harm keyboard/controller navigation usability, so this is not recommended for " +"accessibility reasons." +msgstr "" +"该 [Button] 处于聚焦状态时使用的 [StyleBox]。[theme_item focus] [StyleBox] 显" +"示在基础 [StyleBox] [i]之上[/i],所以应该使用部分透明的 [StyleBox],确保基础 " +"[StyleBox] 仍然可见。代表轮廓或下划线的 [StyleBox] 可以很好地实现这个目的。要" +"禁用聚焦的视觉效果,请指定 [StyleBoxEmpty] 资源。请注意,禁用聚焦的视觉效果会" +"影响使用键盘/手柄进行导航的可用性,所以出于可访问性的原因,不建议这样做。" + msgid "[StyleBox] used when the [Button] is being hovered." msgstr "该 [Button] 处于悬停状态时使用的 [StyleBox]。" @@ -18194,6 +19215,21 @@ msgid "Calls the specified method after optional delay." msgstr "在可选的延迟之后调用指定的方法。" msgid "" +"[CallbackTweener] is used to call a method in a tweening sequence. See " +"[method Tween.tween_callback] for more usage information.\n" +"The tweener will finish automatically if the callback's target object is " +"freed.\n" +"[b]Note:[/b] [method Tween.tween_callback] is the only correct way to create " +"[CallbackTweener]. Any [CallbackTweener] created manually will not function " +"correctly." +msgstr "" +"[CallbackTweener] 可用于在补间序列中调用方法。更多用法信息请参阅 [method " +"Tween.tween_callback]。\n" +"如果回调的目标对象被释放,该补间将自动结束。\n" +"[b]注意:[/b]创建 [CallbackTweener] 的唯一正确方法是 [method Tween." +"tween_callback]。任何手动创建的 [CallbackTweener] 都无法正常工作。" + +msgid "" "Makes the callback call delayed by given time in seconds.\n" "[b]Example:[/b]\n" "[codeblock]\n" @@ -18647,6 +19683,30 @@ msgstr "" "位置。" msgid "" +"Returns [code]true[/code] if the given position is behind the camera (the " +"blue part of the linked diagram). [url=https://raw.githubusercontent.com/" +"godotengine/godot-docs/master/img/camera3d_position_frustum.png]See this " +"diagram[/url] for an overview of position query methods.\n" +"[b]Note:[/b] A position which returns [code]false[/code] may still be outside " +"the camera's field of view." +msgstr "" +"如果给定位置在相机后面(链接图的蓝色部分),则返回 [code]true[/code]。" +"[url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/" +"camera3d_position_frustum.png]查看此图[/url]以了解位置查询方法的概述。\n" +"[b]注意:[/b]返回 [code]false[/code] 的位置可能仍然在相机的视野之外。" + +msgid "" +"Returns [code]true[/code] if the given position is inside the camera's " +"frustum (the green part of the linked diagram). [url=https://raw." +"githubusercontent.com/godotengine/godot-docs/master/img/" +"camera3d_position_frustum.png]See this diagram[/url] for an overview of " +"position query methods." +msgstr "" +"如果给定位置在相机的视锥内(位于链接图中的绿色部分),则返回 [code]true[/" +"code]。[url=https://raw.githubusercontent.com/godotengine/godot-docs/master/" +"img/camera3d_position_frustum.png]查看此图[/url]以了解位置查询方法的概述。" + +msgid "" "Makes this camera the current camera for the [Viewport] (see class " "description). If the camera node is outside the scene tree, it will attempt " "to become current once it's added." @@ -18824,6 +19884,25 @@ msgstr "" "[member far] 如果会导致对象被部分或完全剔除,则可以提高性能。" msgid "" +"The camera's field of view angle (in degrees). Only applicable in perspective " +"mode. Since [member keep_aspect] locks one axis, [member fov] sets the other " +"axis' field of view angle.\n" +"For reference, the default vertical field of view value ([code]75.0[/code]) " +"is equivalent to a horizontal FOV of:\n" +"- ~91.31 degrees in a 4:3 viewport\n" +"- ~101.67 degrees in a 16:10 viewport\n" +"- ~107.51 degrees in a 16:9 viewport\n" +"- ~121.63 degrees in a 21:9 viewport" +msgstr "" +"相机的视野角度(单位为度)。仅适用于透视模式。由于 [member keep_aspect] 锁定一" +"个轴,因此 [member fov] 设置另一个轴的视角。\n" +"作为参考,默认的垂直视野值([code]70.0[/code])相当于以下水平 FOV:\n" +"- 在 4:3 视口中约 91.31 度\n" +"- 在 16:10 视口中约 101.67 度\n" +"- 在 16:9 视口中约 107.51 度\n" +"- 在 21:9 视口中约 121.63 度" + +msgid "" "The camera's frustum offset. This can be changed from the default to create " "\"tilted frustum\" effects such as [url=https://zdoom.org/wiki/Y-shearing]Y-" "shearing[/url].\n" @@ -19082,15 +20161,16 @@ msgstr "" "use_physical_light_units] 时可用。" msgid "" -"Time for shutter to open and close, measured in seconds. A higher value will " -"let in more light leading to a brighter image, while a lower amount will let " -"in less light leading to a darker image.\n" +"Time for shutter to open and close, evaluated as [code]1 / shutter_speed[/" +"code] seconds. A higher value will allow less light (leading to a darker " +"image), while a lower value will allow more light (leading to a brighter " +"image).\n" "Only available when [member ProjectSettings.rendering/lights_and_shadows/" "use_physical_light_units] is enabled." msgstr "" -"快门打开和关闭的时间,单位:秒。较高的值将使更多的光线进入,从而使图像更亮;而" -"较低的值将使更少的光线进入,从而使图像更暗。\n" -"仅在启用 [member ProjectSettings.rendering/lights_and_shadows/" +"快门打开和关闭的时间,计算方式为 [code]1 / shutter_speed[/code] 秒。较高的值将" +"允许较少的光线(导致图像较暗),而较低的值将允许更多的光线(导致图像较亮)。\n" +"仅当启用 [member ProjectSettings.rendering/lights_and_shadows/" "use_physical_light_units] 时可用。" msgid "" @@ -19482,6 +20562,43 @@ msgstr "" msgid "Abstract base class for everything in 2D space." msgstr "2D 空间中所有对象的抽象基类。" +msgid "" +"Abstract base class for everything in 2D space. Canvas items are laid out in " +"a tree; children inherit and extend their parent's transform. [CanvasItem] is " +"extended by [Control] for GUI-related nodes, and by [Node2D] for 2D game " +"objects.\n" +"Any [CanvasItem] can draw. For this, [method queue_redraw] is called by the " +"engine, then [constant NOTIFICATION_DRAW] will be received on idle time to " +"request a redraw. Because of this, canvas items don't need to be redrawn on " +"every frame, improving the performance significantly. Several functions for " +"drawing on the [CanvasItem] are provided (see [code]draw_*[/code] functions). " +"However, they can only be used inside [method _draw], its corresponding " +"[method Object._notification] or methods connected to the [signal draw] " +"signal.\n" +"Canvas items are drawn in tree order on their canvas layer. By default, " +"children are on top of their parents, so a root [CanvasItem] will be drawn " +"behind everything. This behavior can be changed on a per-item basis.\n" +"A [CanvasItem] can be hidden, which will also hide its children. By adjusting " +"various other properties of a [CanvasItem], you can also modulate its color " +"(via [member modulate] or [member self_modulate]), change its Z-index, blend " +"mode, and more." +msgstr "" +"2D 空间中所有对象的抽象基类。画布项目以树状排列;子节点继承并扩展其父节点的变" +"换。[CanvasItem] 由 [Control] 扩展为 GUI 相关的节点,由 [Node2D] 扩展为 2D 游" +"戏对象。\n" +"任何 [CanvasItem] 都可以进行绘图。绘图时,引擎会调用 [method queue_redraw],然" +"后 [constant NOTIFICATION_DRAW] 就会在空闲时被接收到以请求重绘。因此,画布项目" +"不需要每一帧都重绘,这显著提升了性能。这个类还提供了几个用于在 [CanvasItem] 上" +"绘图的函数(见 [code]draw_*[/code] 函数)。不过这些函数都只能在 [method " +"_draw] 及其对应的 [method Object._notification] 或连接到 [signal draw] 的方法" +"内使用。\n" +"画布项目在其画布层上是按树状顺序绘制的。默认情况下,子项目位于其父项目的上方," +"因此根 [CanvasItem] 将被画在所有项目的后面。这种行为可以针对每个画布项目进行更" +"改。\n" +"[CanvasItem] 可以隐藏,隐藏时也会隐藏其子项目。通过调整 [CanvasItem] 的各种其" +"它属性,你还可以调制它的颜色(通过 [member modulate] 或 [member " +"self_modulate])、更改 Z 索引、混合模式等。" + msgid "Viewport and canvas transforms" msgstr "Viewport 和画布变换" @@ -19506,6 +20623,34 @@ msgstr "" "后续的绘制命令将被忽略,除非它们位于指定的动画切片内。这是实现在背景上循环而不" "是不断重绘的动画的更快方法。" +msgid "" +"Draws an unfilled arc between the given angles with a uniform [param color] " +"and [param width] and optional antialiasing (supported only for positive " +"[param width]). The larger the value of [param point_count], the smoother the " +"curve. See also [method draw_circle].\n" +"If [param width] is negative, it will be ignored and the arc will be drawn " +"using [constant RenderingServer.PRIMITIVE_LINE_STRIP]. This means that when " +"the CanvasItem is scaled, the arc will remain thin. If this behavior is not " +"desired, then pass a positive [param width] like [code]1.0[/code].\n" +"The arc is drawn from [param start_angle] towards the value of [param " +"end_angle] so in clockwise direction if [code]start_angle < end_angle[/code] " +"and counter-clockwise otherwise. Passing the same angles but in reversed " +"order will produce the same arc. If absolute difference of [param " +"start_angle] and [param end_angle] is greater than [constant @GDScript.TAU] " +"radians, then a full circle arc is drawn (i.e. arc will not overlap itself)." +msgstr "" +"使用一个 uniform [param color] 和 [param width] 以及可选的抗锯齿(仅支持正 " +"[param width] ),在给定的角度之间绘制一条未填充的弧线。[param point_count] 的" +"值越大,该曲线越平滑。另见 [method draw_circle]。\n" +"如果 [param width] 为负,则它将被忽略,并使用 [constant RenderingServer." +"PRIMITIVE_LINE_STRIP] 绘制该弧线。这意味着当缩放 CanvasItem 时,弧线将保持细" +"长。如果不需要此行为,请传递一个正的 [param width],如 [code]1.0[/code]。\n" +"如果 [code]start_angle < end_angle[/code] ,则圆弧是从 [param start_angle] 朝" +"向 [param end_angle] 的值绘制的,即是顺时针方向;否则为逆时针方向。以相反的顺" +"序传递相同的角度,将产生相同的弧线。如果 [param start_angle] 和 [param " +"end_angle] 的差的绝对值大于 [constant @GDScript.TAU] 弧度,则绘制一个完整的圆" +"弧(即弧线不会与自身重叠)。" + msgid "Draws a string first character using a custom font." msgstr "使用自定义字体绘制字符串的第一个字符。" @@ -19703,6 +20848,51 @@ msgstr "" "canvas_item_add_triangle_array]。" msgid "" +"Draws interconnected line segments with a uniform [param color] and [param " +"width] and optional antialiasing (supported only for positive [param width]). " +"When drawing large amounts of lines, this is faster than using individual " +"[method draw_line] calls. To draw disconnected lines, use [method " +"draw_multiline] instead. See also [method draw_polygon].\n" +"If [param width] is negative, it will be ignored and the polyline will be " +"drawn using [constant RenderingServer.PRIMITIVE_LINE_STRIP]. This means that " +"when the CanvasItem is scaled, the polyline will remain thin. If this " +"behavior is not desired, then pass a positive [param width] like [code]1.0[/" +"code]." +msgstr "" +"使用一致的 [param color] 和 [param width] 以及可选的抗锯齿(仅支持正 [param " +"width] ),绘制相互连接的线段。绘制大量线条时,这比使用单独的 [method " +"draw_line] 调用更快。要绘制不相连的的线段,请改用 [method draw_multiline]。另" +"见 [method draw_polygon]。\n" +"如果 [param width] 为负,则它将被忽略,并使用 [constant RenderingServer." +"PRIMITIVE_LINE_STRIP] 绘制该折线。这意味着当 CanvasItem 被缩放时,折线将保持为" +"细线。如果不需要该行为,请传入一个正的 [param width],如 [code]1.0[/code]。" + +msgid "" +"Draws interconnected line segments with a uniform [param width], point-by-" +"point coloring, and optional antialiasing (supported only for positive [param " +"width]). Colors assigned to line points match by index between [param points] " +"and [param colors], i.e. each line segment is filled with a gradient between " +"the colors of the endpoints. When drawing large amounts of lines, this is " +"faster than using individual [method draw_line] calls. To draw disconnected " +"lines, use [method draw_multiline_colors] instead. See also [method " +"draw_polygon].\n" +"If [param width] is negative, it will be ignored and the polyline will be " +"drawn using [constant RenderingServer.PRIMITIVE_LINE_STRIP]. This means that " +"when the CanvasItem is scaled, the polyline will remain thin. If this " +"behavior is not desired, then pass a positive [param width] like [code]1.0[/" +"code]." +msgstr "" +"绘制相连的线段,使用一致的宽度 [param width],按点指定颜色,还可以开启抗锯齿" +"(仅支持正的 [param width])。将颜色与线段上的点匹配时,使用的是 [param " +"points] 和 [param colors] 的索引,即每条线段填充的都是在两个端点之间颜色的渐变" +"色。绘制大量线段时,这种方法比使用 [method draw_line] 一条条画要快。要绘制不相" +"连的线段,请改用 [method draw_multiline_colors]。另见 [method " +"draw_polygon]。\n" +"如果 [param width] 为负,则它将被忽略,并使用 [constant RenderingServer." +"PRIMITIVE_LINE_STRIP] 绘制该折线。这意味着当 CanvasItem 被缩放时,折线将保持为" +"细线。如果不需要该行为,请传入一个正的 [param width],如 [code]1.0[/code]。" + +msgid "" "Draws a custom primitive. 1 point for a point, 2 points for a line, 3 points " "for a triangle, and 4 points for a quad. If 0 points or more than 4 points " "are specified, nothing will be drawn and an error message will be printed. " @@ -20204,67 +21394,84 @@ msgid "The [CanvasItem] will inherit the filter from its parent." msgstr "该 [CanvasItem] 将从其父级继承过滤器。" msgid "" -"The texture filter reads from the nearest pixel only. The simplest and " -"fastest method of filtering. Useful for pixel art." -msgstr "纹理过滤器仅读取最邻近的像素。最简单、最快的过滤方法。可用于像素画。" - -msgid "" -"The texture filter blends between the nearest four pixels. Use this for most " -"cases where you want to avoid a pixelated style." -msgstr "" -"纹理过滤器在最邻近的四个像素之间混合。如果想要避免像素化样式,大多数情况下请使" -"用此选项。" - -msgid "" -"The texture filter reads from the nearest pixel in the nearest mipmap. This " -"is the fastest way to read from textures with mipmaps." +"The texture filter reads from the nearest pixel and blends between the " +"nearest 2 mipmaps (or uses the nearest mipmap if [member ProjectSettings." +"rendering/textures/default_filters/use_nearest_mipmap_filter] is [code]true[/" +"code]). This makes the texture look pixelated from up close, and smooth from " +"a distance.\n" +"Use this for non-pixel art textures that may be viewed at a low scale (e.g. " +"due to [Camera2D] zoom or sprite scaling), as mipmaps are important to smooth " +"out pixels that are smaller than on-screen pixels." msgstr "" -"纹理过滤器读取最邻近的 mipmap 中的最邻近像素。这是使用 mipmap 从纹理中读取的最" -"快方法。" +"纹理过滤从最近的像素读取并在最近的 2 个多级渐远纹理之间进行混合(或者如果 " +"[member ProjectSettings.rendering/textures/default_filters/" +"use_nearest_mipmap_filter] 为 [code]true[/code],则使用最近的多级渐远纹理)。" +"这使得纹理从近处看起来像素化,从远处看起来平滑。\n" +"将此用于可能以低缩放查看的非像素艺术纹理(例如,由于 [Camera2D] 缩放或精灵缩" +"放),因为多级渐远纹理对于平滑小于屏幕像素的像素很重要。" msgid "" "The texture filter blends between the nearest 4 pixels and between the " -"nearest 2 mipmaps. Use this for non-pixel art textures that may be viewed at " -"a low scale (e.g. due to [Camera2D] zoom), as mipmaps are important to smooth " +"nearest 2 mipmaps (or uses the nearest mipmap if [member ProjectSettings." +"rendering/textures/default_filters/use_nearest_mipmap_filter] is [code]true[/" +"code]). This makes the texture look smooth from up close, and smooth from a " +"distance.\n" +"Use this for non-pixel art textures that may be viewed at a low scale (e.g. " +"due to [Camera2D] zoom or sprite scaling), as mipmaps are important to smooth " "out pixels that are smaller than on-screen pixels." msgstr "" -"纹理过滤器在最邻近的 4 个像素和最邻近的 2 个 mipmap 之间混合。请用于可能以低缩" -"放率查看的非像素画纹理(例如由 [Camera2D] 缩放造成),因为 mipmap 对于平滑小于" -"屏幕像素的像素很重要。" - -msgid "" -"The texture filter reads from the nearest pixel, but selects a mipmap based " -"on the angle between the surface and the camera view. This reduces artifacts " -"on surfaces that are almost in line with the camera. The anisotropic " -"filtering level can be changed by adjusting [member ProjectSettings.rendering/" -"textures/default_filters/anisotropic_filtering_level].\n" +"纹理过滤在最近的 4 个像素和最近的 2 个多级渐远纹理之间进行混合(或者如果 " +"[member ProjectSettings.rendering/textures/default_filters/" +"use_nearest_mipmap_filter] 为 [code]true[/code],则使用最近的多级渐远纹理)。" +"这使得纹理从近处看起来平滑,从远处看起来也平滑。\n" +"将此用于可能以低缩放查看的非像素艺术纹理(例如,由于 [Camera2D] 缩放或精灵缩" +"放),因为多级渐远纹理对于平滑小于屏幕像素的像素很重要。" + +msgid "" +"The texture filter reads from the nearest pixel and blends between 2 mipmaps " +"(or uses the nearest mipmap if [member ProjectSettings.rendering/textures/" +"default_filters/use_nearest_mipmap_filter] is [code]true[/code]) based on the " +"angle between the surface and the camera view. This makes the texture look " +"pixelated from up close, and smooth from a distance. Anisotropic filtering " +"improves texture quality on surfaces that are almost in line with the camera, " +"but is slightly slower. The anisotropic filtering level can be changed by " +"adjusting [member ProjectSettings.rendering/textures/default_filters/" +"anisotropic_filtering_level].\n" "[b]Note:[/b] This texture filter is rarely useful in 2D projects. [constant " -"TEXTURE_FILTER_NEAREST_WITH_MIPMAPS] is usually more appropriate." +"TEXTURE_FILTER_NEAREST_WITH_MIPMAPS] is usually more appropriate in this case." msgstr "" -"纹理过滤器读取最邻近的像素,但会根据表面和相机视图之间的角度选择 mipmap。可以" -"减少几乎与相机成一直线的表面的伪影。各向异性过滤级别可以通过调整 [member " +"纹理过滤从最近的像素读取并根据表面和相机视图之间的角度在 2 个多级渐远纹理之间" +"进行混合(或者如果 [member ProjectSettings.rendering/textures/default_filters/" +"use_nearest_mipmap_filter] 为 [code]true[/code],则使用最近的多级渐远纹理)。" +"这使得纹理从近处看起来像素化,从远处看起来平滑。各向异性过滤提高了几乎与相机位" +"于一条线的表面上的纹理质量,但速度稍慢。各向异性过滤级别可以通过调整 [member " "ProjectSettings.rendering/textures/default_filters/" "anisotropic_filtering_level] 来改变。\n" -"[b]注意:[/b]这个纹理过滤器很少用于 2D 项目。[constant " -"TEXTURE_FILTER_NEAREST_WITH_MIPMAPS] 通常更合适。" - -msgid "" -"The texture filter blends between the nearest 4 pixels and selects a mipmap " -"based on the angle between the surface and the camera view. This reduces " -"artifacts on surfaces that are almost in line with the camera. This is the " -"slowest of the filtering options, but results in the highest quality " -"texturing. The anisotropic filtering level can be changed by adjusting " -"[member ProjectSettings.rendering/textures/default_filters/" -"anisotropic_filtering_level].\n" +"[b]注意:[/b]该纹理过滤在 2D 项目中很少有用。[constant " +"TEXTURE_FILTER_NEAREST_WITH_MIPMAPS] 在这种情况下通常更合适。" + +msgid "" +"The texture filter blends between the nearest 4 pixels and blends between 2 " +"mipmaps (or uses the nearest mipmap if [member ProjectSettings.rendering/" +"textures/default_filters/use_nearest_mipmap_filter] is [code]true[/code]) " +"based on the angle between the surface and the camera view. This makes the " +"texture look smooth from up close, and smooth from a distance. Anisotropic " +"filtering improves texture quality on surfaces that are almost in line with " +"the camera, but is slightly slower. The anisotropic filtering level can be " +"changed by adjusting [member ProjectSettings.rendering/textures/" +"default_filters/anisotropic_filtering_level].\n" "[b]Note:[/b] This texture filter is rarely useful in 2D projects. [constant " -"TEXTURE_FILTER_LINEAR_WITH_MIPMAPS] is usually more appropriate." -msgstr "" -"纹理过滤器在最邻近的 4 个像素之间进行混合,并会根据表面和相机视图之间的角度选" -"择 mipmap。可以减少几乎与相机成一直线的表面的伪影。这是最慢的过滤选项,但可以" -"得到最高质量的纹理。各向异性过滤级别可以通过调整 [member ProjectSettings." -"rendering/textures/default_filters/anisotropic_filtering_level] 来改变。\n" -"[b]注意:[/b]这个纹理过滤器很少用于 2D 项目。[constant " -"TEXTURE_FILTER_NEAREST_WITH_MIPMAPS] 通常更合适。" +"TEXTURE_FILTER_LINEAR_WITH_MIPMAPS] is usually more appropriate in this case." +msgstr "" +"纹理过滤在最近的 4 个像素之间进行混合,并基于表面与相机视图之间的角度在 2 个多" +"级渐远纹理之间进行混合(或者如果 [member ProjectSettings.rendering/textures/" +"default_filters/use_nearest_mipmap_filter] 为 [code]true[/code],则使用最近的" +"多级渐远纹理)。这使得纹理从近处看起来平滑,从远处看起来也平滑。各向异性过滤提" +"高了几乎与相机位于一条线的表面上的纹理质量,但速度稍慢。各向异性过滤级别可以通" +"过调整 [member ProjectSettings.rendering/textures/default_filters/" +"anisotropic_filtering_level] 来改变。\n" +"[b]注意:[/b]该纹理过滤在 2D 项目中很少有用。[constant " +"TEXTURE_FILTER_LINEAR_WITH_MIPMAPS] 在这种情况下通常更合适。" msgid "Texture will not repeat." msgstr "纹理不会重复。" @@ -20715,6 +21922,16 @@ msgstr "" "[code]true[/code] 时这个函数什么都不做。" msgid "" +"Returns the floor's collision angle at the last collision point according to " +"[param up_direction], which is [constant Vector2.UP] by default. This value " +"is always positive and only valid after calling [method move_and_slide] and " +"when [method is_on_floor] returns [code]true[/code]." +msgstr "" +"返回地板在最近一次碰撞点的碰撞角度,依据为 [param up_direction],默认为 " +"[constant Vector2.UP]。该值始终为正数,只有在调用了 [method move_and_slide] 并" +"且 [method is_on_floor] 返回值为 [code]true[/code] 时才有效。" + +msgid "" "Returns the surface normal of the floor at the last collision point. Only " "valid after calling [method move_and_slide] and when [method is_on_floor] " "returns [code]true[/code]." @@ -21029,6 +22246,18 @@ msgstr "" "code],则会停止并垂直下落。" msgid "" +"Vector pointing upwards, used to determine what is a wall and what is a floor " +"(or a ceiling) when calling [method move_and_slide]. Defaults to [constant " +"Vector2.UP]. As the vector will be normalized it can't be equal to [constant " +"Vector2.ZERO], if you want all collisions to be reported as walls, consider " +"using [constant MOTION_MODE_FLOATING] as [member motion_mode]." +msgstr "" +"指向上方的向量,用于在调用 [method move_and_slide] 时决定什么是墙壁、什么是地" +"板(或者天花板)。默认为 [constant Vector2.UP]。因为会对该向量进行归一化,所以" +"不能等于 [constant Vector2.ZERO],如果你想要让所有碰撞都被报告为墙壁,请考虑使" +"用 [constant MOTION_MODE_FLOATING] 作为 [member motion_mode]。" + +msgid "" "Current velocity vector in pixels per second, used and modified during calls " "to [method move_and_slide]." msgstr "" @@ -21101,6 +22330,16 @@ msgstr "" "配置。" msgid "" +"Returns the floor's collision angle at the last collision point according to " +"[param up_direction], which is [constant Vector3.UP] by default. This value " +"is always positive and only valid after calling [method move_and_slide] and " +"when [method is_on_floor] returns [code]true[/code]." +msgstr "" +"返回地板在最近一次碰撞点的碰撞角度,依据为 [param up_direction],默认为 " +"[constant Vector3.UP]。该值始终为正数,只有在调用了 [method move_and_slide] 并" +"且 [method is_on_floor] 返回值为 [code]true[/code] 时才有效。" + +msgid "" "Returns the last motion applied to the [CharacterBody3D] during the last call " "to [method move_and_slide]. The movement can be split into multiple motions " "when sliding occurs, and this method return the last one, which is useful to " @@ -21177,6 +22416,18 @@ msgstr "" "平台。默认情况下会忽略所有墙壁物体。" msgid "" +"Vector pointing upwards, used to determine what is a wall and what is a floor " +"(or a ceiling) when calling [method move_and_slide]. Defaults to [constant " +"Vector3.UP]. As the vector will be normalized it can't be equal to [constant " +"Vector3.ZERO], if you want all collisions to be reported as walls, consider " +"using [constant MOTION_MODE_FLOATING] as [member motion_mode]." +msgstr "" +"指向上方的向量,用于在调用 [method move_and_slide] 时决定什么是墙壁、什么是地" +"板(或者天花板)。默认为 [constant Vector3.UP]。因为会对该向量进行归一化,所以" +"不能等于 [constant Vector3.ZERO],如果你想要让所有碰撞都被报告为墙壁,请考虑使" +"用 [constant MOTION_MODE_FLOATING] 作为 [member motion_mode]。" + +msgid "" "Current velocity vector (typically meters per second), used and modified " "during calls to [method move_and_slide]." msgstr "" @@ -21701,6 +22952,13 @@ msgid "Removes all string delimiters." msgstr "移除所有字符串分隔符。" msgid "" +"Inserts the selected entry into the text. If [param replace] is true, any " +"existing text is replaced rather than merged." +msgstr "" +"将选定的条目插入到文本中。如果 [param replace] 为真,任何现有的文本都会被替" +"换,而不是被合并。" + +msgid "" "Converts the indents of lines between [param from_line] and [param to_line] " "to tabs or spaces as set by [member indent_use_spaces].\n" "Values of [code]-1[/code] convert the entire text." @@ -21710,10 +22968,36 @@ msgstr "" "值均为 [code]-1[/code] 将转换整个文本。" msgid "" +"Creates a new code region with the selection. At least one single line " +"comment delimiter have to be defined (see [method add_comment_delimiter]).\n" +"A code region is a part of code that is highlighted when folded and can help " +"organize your script.\n" +"Code region start and end tags can be customized (see [method " +"set_code_region_tags]).\n" +"Code regions are delimited using start and end tags (respectively " +"[code]region[/code] and [code]endregion[/code] by default) preceded by one " +"line comment delimiter. (eg. [code]#region[/code] and [code]#endregion[/code])" +msgstr "" +"使用选区创建一个新的代码区块。必须至少定义一个单行注释分隔符(见 [method " +"add_comment_delimiter])。\n" +"代码区块是代码的一部分,它在折叠时会高亮显示,且可以帮助组织脚本。\n" +"代码区块的开始和结束标记可以被自定义(见 [method set_code_region_tags])。\n" +"代码区块使用开始和结束标记(默认情况下分别为 [code]region[/code] 和 " +"[code]endregion[/code])进行分隔,前面有一个行注释分隔符。(例如 " +"[code]#region[/code] 和 [code]#endregion[/code])" + +msgid "" "Perform an indent as if the user activated the \"ui_text_indent\" action." msgstr "执行一个缩进,就像用户触发了“ui_text_indent”动作一样。" msgid "" +"Duplicates all lines currently selected with any caret. Duplicates the entire " +"line beneath the current one no matter where the caret is within the line." +msgstr "" +"复制当前使用任何文本光标选择的所有行。无论文本光标位于行内的哪个位置,复制当前" +"行所在的整行。" + +msgid "" "Folds all lines that are possible to be folded (see [method can_fold_line])." msgstr "折叠所有可能被折叠的行(参见 [method can_fold_line])。" @@ -21756,6 +23040,12 @@ msgstr "获取所有补全选项,返回值见 [method get_code_completion_opti msgid "Gets the index of the current selected completion option." msgstr "获取当前已选定补全项的索引。" +msgid "Returns the code region end tag (without comment delimiter)." +msgstr "返回代码区块结束标签(不带注释分隔符)。" + +msgid "Returns the code region start tag (without comment delimiter)." +msgstr "返回代码区块开始标签(不带注释分隔符)。" + msgid "Gets the end key for a string or comment region index." msgstr "获取字符串或注释块索引的结束键。" @@ -21836,6 +23126,12 @@ msgstr "返回指定索引处的行是否添加了书签。" msgid "Returns whether the line at the specified index is breakpointed or not." msgstr "返回指定索引处的行是否有断点。" +msgid "Returns whether the line at the specified index is a code region end." +msgstr "返回指定索引处的行是否是代码区块末尾。" + +msgid "Returns whether the line at the specified index is a code region start." +msgstr "返回指定索引处的行是否是代码区块开始。" + msgid "" "Returns whether the line at the specified index is marked as executing or not." msgstr "返回指定索引处的行是否标记为正在执行。" @@ -21899,6 +23195,16 @@ msgstr "" "解除所选行的缩进,或者在没有选择的情况下,将光标行缩进一个。与触" "发“ui_text_unindent ”动作相同。" +msgid "" +"Submits all completion options added with [method " +"add_code_completion_option]. Will try to force the autocomplete menu to " +"popup, if [param force] is [code]true[/code].\n" +"[b]Note:[/b] This will replace all current candidates." +msgstr "" +"提交所有用 [method add_code_completion_option] 添加的补全选项。如果 [param " +"force] 是 [code]true[/code],将尝试强制弹出自动补全菜单 。\n" +"[b]注意:[/b]这将取代所有当前的候补选项。" + msgid "Sets whether brace pairs should be autocompleted." msgstr "设置括号对是否应自动补全。" @@ -21954,6 +23260,13 @@ msgstr "设置是否启用自动缩进,如果找到前缀或括号,这将添 msgid "Prefixes to trigger an automatic indent." msgstr "触发自动缩进的前缀。" +msgid "" +"Size of the tabulation indent (one [kbd]Tab[/kbd] press) in characters. If " +"[member indent_use_spaces] is enabled the number of spaces to use." +msgstr "" +"制表缩进的大小(按一次 [kbd]Tab[/kbd]),以字符为单位。如果启用 [member " +"indent_use_spaces],则代表使用的空格数。" + msgid "Use spaces instead of tabs for indentation." msgstr "使用空格代替制表符进行缩进。" @@ -22099,6 +23412,11 @@ msgid "" "Max number of options to display in the code completion popup at any one time." msgstr "同时在代码补全弹出窗口中显示的最大选项数。" +msgid "" +"Max width of options in the code completion popup. Options longer than this " +"will be cut off." +msgstr "代码补全弹出窗口中选项的最大宽度。超过此长度的选项将被截断。" + msgid "Width of the scrollbar in the code completion popup." msgstr "代码补全弹出窗口中滚动条的宽度。" @@ -22116,6 +23434,11 @@ msgid "" "be folded." msgstr "设置可折叠行的自定义 [Texture2D],会在折叠行栏中绘制。" +msgid "" +"Sets a custom [Texture2D] to draw in the line folding gutter when a code " +"region can be folded." +msgstr "设置一个自定义 [Texture2D],以在代码区块可以折叠时在行折叠栏中绘制。" + msgid "Icon to draw in the executing gutter for executing lines." msgstr "执行行的图标,会在执行栏中绘制。" @@ -22123,7 +23446,14 @@ msgid "" "Sets a custom [Texture2D] to draw in the line folding gutter when a line is " "folded and can be unfolded." msgstr "" -"当行被折叠且可以展开时,设置要在行折叠装订线中绘制的一个自定义 [Texture2D]。" +"设置一个自定义 [Texture2D],以在行被折叠且可以展开时,在行折叠边栏中绘制。" + +msgid "" +"Sets a custom [Texture2D] to draw in the line folding gutter when a code " +"region is folded and can be unfolded." +msgstr "" +"设置一个自定义 [Texture2D],以在代码区块被折叠且可以展开时,在行折叠边栏中绘" +"制。" msgid "Sets a custom [Texture2D] to draw at the end of a folded line." msgstr "设置要绘制在折叠行末尾的一个自定义 [Texture2D]。" @@ -22267,6 +23597,18 @@ msgstr "" "[CanvasLayer])。不同画布中的对象之间的碰撞行为是未定义的。" msgid "" +"Accepts unhandled [InputEvent]s. [param shape_idx] is the child index of the " +"clicked [Shape2D]. Connect to [signal input_event] to easily pick up these " +"events.\n" +"[b]Note:[/b] [method _input_event] requires [member input_pickable] to be " +"[code]true[/code] and at least one [member collision_layer] bit to be set." +msgstr "" +"接收未处理的 [InputEvent]。[param shape_idx] 是被点击的 [Shape2D] 的子索引。连" +"接到 [signal input_event] 即可轻松获取这些事件。\n" +"[b]注意:[/b][method _input_event] 要求 [member input_pickable] 为 " +"[code]true[/code],并且至少要设置一个 [member collision_layer] 位。" + +msgid "" "Called when the mouse pointer enters any of this object's shapes. Requires " "[member input_pickable] to be [code]true[/code] and at least one [member " "collision_layer] bit to be set. Note that moving between different shapes " @@ -22748,6 +24090,21 @@ msgstr "" msgid "A node that provides a polygon shape to a [CollisionObject2D] parent." msgstr "向 [CollisionObject2D] 父级提供多边形形状的节点。" +msgid "" +"A node that provides a thickened polygon shape (a prism) to a " +"[CollisionObject2D] parent and allows to edit it. The polygon can be concave " +"or convex. This can give a detection shape to an [Area2D] or turn " +"[PhysicsBody2D] into a solid object.\n" +"[b]Warning:[/b] A non-uniformly scaled [CollisionShape2D] will likely not " +"behave as expected. Make sure to keep its scale the same on all axes and " +"adjust its shape resource instead." +msgstr "" +"一个节点,为 [CollisionObject2D] 父级提供加厚多边形形状(角柱体)并允许对其进" +"行编辑。该多边形可以是凹的或凸的。这可以为 [Area2D] 提供检测形状,也能够将 " +"[PhysicsBody2D] 转变为实体对象。\n" +"[b]警告:[/b]非均匀缩放的 [CollisionShape2D] 可能不会按预期运行。可改为确保在" +"所有轴上保持其缩放相同,并调整其形状资源。" + msgid "Collision build mode. Use one of the [enum BuildMode] constants." msgstr "碰撞构建模式。使用 [enum BuildMode] 常量之一。" @@ -22836,6 +24193,18 @@ msgid "" "for more details." msgstr "生成的 [Shape3D] 的碰撞边距。详情见 [member Shape3D.margin]。" +msgid "" +"Array of vertices which define the 2D polygon in the local XY plane.\n" +"[b]Note:[/b] The returned value is a copy of the original. Methods which " +"mutate the size or properties of the return value will not impact the " +"original polygon. To change properties of the polygon, assign it to a " +"temporary variable and make changes before reassigning the class property." +msgstr "" +"顶点数组,定义局部 XY 平面上的 2D 多边形。\n" +"[b]注意:[/b]返回值为原始值的副本。修改返回值大小或属性的方法不会影响原始的多" +"边形。要修改该多边形的属性,请先将其赋值给临时变量,修改完成后再重新赋值给该类" +"属性。" + msgid "A node that provides a [Shape2D] to a [CollisionObject2D] parent." msgstr "向 [CollisionObject2D] 父级提供 [Shape2D] 的节点。" @@ -22911,7 +24280,7 @@ msgid "" msgstr "将碰撞形状的形状设置为其所有凸面 [MeshInstance3D] 兄弟几何体的相加。" msgid "[i]Obsoleted.[/i] Use [signal Resource.changed] instead." -msgstr "[i]已废弃 [/i] 请改用 [signal Resource.changed] 。" +msgstr "[i]已废弃。[/i]请改用 [signal Resource.changed] 。" msgid "A disabled collision shape has no effect in the world." msgstr "禁用的碰撞形状对世界没有任何影响。" @@ -22919,6 +24288,42 @@ msgstr "禁用的碰撞形状对世界没有任何影响。" msgid "A color represented in RGBA format." msgstr "以 RGBA 格式表示的颜色。" +msgid "" +"A color represented in RGBA format by a red ([member r]), green ([member g]), " +"blue ([member b]), and alpha ([member a]) component. Each component is a 16-" +"bit floating-point value, usually ranging from [code]0.0[/code] to [code]1.0[/" +"code]. Some properties (such as [member CanvasItem.modulate]) may support " +"values greater than [code]1.0[/code], for overbright or HDR (High Dynamic " +"Range) colors.\n" +"Colors can be created in various ways: By the various [Color] constructors, " +"by static methods such as [method from_hsv], and by using a name from the set " +"of standardized colors based on [url=https://en.wikipedia.org/wiki/" +"X11_color_names]X11 color names[/url] with the addition of [constant " +"TRANSPARENT]. GDScript also provides [method @GDScript.Color8], which uses " +"integers from [code]0[/code] to [code]255[/code] and doesn't support " +"overbright colors.\n" +"[b]Note:[/b] In a boolean context, a Color will evaluate to [code]false[/" +"code] if it is equal to [code]Color(0, 0, 0, 1)[/code] (opaque black). " +"Otherwise, a Color will always evaluate to [code]true[/code].\n" +"[url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/" +"color_constants.png]Color constants cheatsheet[/url]" +msgstr "" +"由红([member r])、绿([member g])、蓝([member b])和 alpha([member a])分" +"量表示的 RGBA 格式的颜色。每个分量都是一个 16 位浮点值,通常介于 [code]0.0[/" +"code] 到 [code]1.0[/code] 之间。某些属性(例如 [member CanvasItem.modulate])" +"可能支持大于 [code]1.0[/code] 的值,用于表示过亮或 HDR(High Dynamic Range,高" +"动态范围)颜色。\n" +"创建颜色的方法有很多:可以使用 [Color] 的各种构造函数,[method from_hsv] 等静" +"态方法,以及使用基于 [url=https://en.wikipedia.org/wiki/X11_color_names]X11 颜" +"色名称[/url]的标准化颜色集外加 [constant TRANSPARENT]。GDScript 还提供了 " +"[method @GDScript.Color8],使用的是 [code]0[/code] 到 [code]255[/code] 之间的" +"整数,且不支持过亮的颜色。\n" +"[b]注意:[/b]在布尔上下文中,等于 [code]Color(0, 0, 0, 1)[/code](不透明的黑" +"色)的 Color 将被评估为 [code]false[/code]。否则,Color 将始终被评估为 " +"[code]true[/code]。\n" +"[url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/" +"color_constants.png]Color 常量速查表[/url]" + msgid "2D GD Paint Demo" msgstr "2D GD 画图演示" @@ -23260,6 +24665,57 @@ msgstr "" "[/codeblocks]" msgid "" +"Returns [code]true[/code] if [param color] is a valid HTML hexadecimal color " +"string. The string must be a hexadecimal value (case-insensitive) of either " +"3, 4, 6 or 8 digits, and may be prefixed by a hash sign ([code]#[/code]). " +"This method is identical to [method String.is_valid_html_color].\n" +"[codeblocks]\n" +"[gdscript]\n" +"Color.html_is_valid(\"#55aaFF\") # Returns true\n" +"Color.html_is_valid(\"#55AAFF20\") # Returns true\n" +"Color.html_is_valid(\"55AAFF\") # Returns true\n" +"Color.html_is_valid(\"#F2C\") # Returns true\n" +"\n" +"Color.html_is_valid(\"#AABBC\") # Returns false\n" +"Color.html_is_valid(\"#55aaFF5\") # Returns false\n" +"[/gdscript]\n" +"[csharp]\n" +"Color.HtmlIsValid(\"#55AAFF\"); // Returns true\n" +"Color.HtmlIsValid(\"#55AAFF20\"); // Returns true\n" +"Color.HtmlIsValid(\"55AAFF\"); // Returns true\n" +"Color.HtmlIsValid(\"#F2C\"); // Returns true\n" +"\n" +"Color.HtmlIsValid(\"#AABBC\"); // Returns false\n" +"Color.HtmlIsValid(\"#55aaFF5\"); // Returns false\n" +"[/csharp]\n" +"[/codeblocks]" +msgstr "" +"如果 [param color] 是一个有效的 HTML 十六进制颜色字符串,则返回 [code]true[/" +"code]。该字符串必须是一个由 3、4、6 或 8 位数字组成的十六进制值(不区分大小" +"写),并且可以以井号 ([code]#[/code]) 作为前缀。该方法与 [method String." +"is_valid_html_color] 相同。\n" +"[codeblocks]\n" +"[gdscript]\n" +"Color.html_is_valid(\"#55aaFF\") # 返回 true\n" +"Color.html_is_valid(\"#55AAFF20\") # 返回 true\n" +"Color.html_is_valid(\"55AAFF\") # 返回 true\n" +"Color.html_is_valid(\"#F2C\") # 返回 true\n" +"\n" +"Color.html_is_valid(\"#AABBC\") # 返回 false\n" +"Color.html_is_valid(\"#55aaFF5\") # 返回 false\n" +"[/gdscript]\n" +"[csharp]\n" +"Color.HtmlIsValid(\"#55AAFF\"); // 返回 true\n" +"Color.HtmlIsValid(\"#55AAFF20\"); // 返回 true\n" +"Color.HtmlIsValid(\"55AAFF\"); // 返回 true\n" +"Color.HtmlIsValid(\"#F2C\"); // 返回 true\n" +"\n" +"Color.HtmlIsValid(\"#AABBC\"); // 返回 false\n" +"Color.HtmlIsValid(\"#55aaFF5\"); // 返回 false\n" +"[/csharp]\n" +"[/codeblocks]" + +msgid "" "Returns the color with its [member r], [member g], and [member b] components " "inverted ([code](1 - r, 1 - g, 1 - b, a)[/code]).\n" "[codeblocks]\n" @@ -24284,6 +25740,11 @@ msgid "" "selected from the shapes popup." msgstr "色彩空间形状和形状选择按钮被隐藏。不能从形状弹出窗口中选择。" +msgid "" +"Overrides the [theme_item Slider.center_grabber] theme property of the " +"sliders." +msgstr "覆盖滑块的 [theme_item Slider.center_grabber] 主题属性。" + msgid "The width of the hue selection slider." msgstr "色相选择滑块的宽度。" @@ -24633,6 +26094,49 @@ msgid "A 2D polyline shape used for physics collision." msgstr "用于物理碰撞的 2D 多线段形状。" msgid "" +"A 2D polyline shape, intended for use in physics. Used internally in " +"[CollisionPolygon2D] when it's in [constant CollisionPolygon2D." +"BUILD_SEGMENTS] mode.\n" +"Being just a collection of interconnected line segments, " +"[ConcavePolygonShape2D] is the most freely configurable single 2D shape. It " +"can be used to form polygons of any nature, or even shapes that don't enclose " +"an area. However, [ConcavePolygonShape2D] is [i]hollow[/i] even if the " +"interconnected line segments do enclose an area, which often makes it " +"unsuitable for physics or detection.\n" +"[b]Note:[/b] When used for collision, [ConcavePolygonShape2D] is intended to " +"work with static [CollisionShape2D] nodes like [StaticBody2D] and will likely " +"not behave well for [CharacterBody2D]s or [RigidBody2D]s in a mode other than " +"Static.\n" +"[b]Warning:[/b] Physics bodies that are small have a chance to clip through " +"this shape when moving fast. This happens because on one frame, the physics " +"body may be on the \"outside\" of the shape, and on the next frame it may be " +"\"inside\" it. [ConcavePolygonShape2D] is hollow, so it won't detect a " +"collision.\n" +"[b]Performance:[/b] Due to its complexity, [ConcavePolygonShape2D] is the " +"slowest 2D collision shape to check collisions against. Its use should " +"generally be limited to level geometry. If the polyline is closed, " +"[CollisionPolygon2D]'s [constant CollisionPolygon2D.BUILD_SOLIDS] mode can be " +"used, which decomposes the polygon into convex ones; see " +"[ConvexPolygonShape2D]'s documentation for instructions." +msgstr "" +"一种 2D 折线形状,用于物理运算。当 [CollisionPolygon2D] 处于 [constant " +"CollisionPolygon2D.BUILD_SEGMENTS] 模式时,会在其内部使用。\n" +"作为一组相互连接线段,[ConcavePolygonShape2D] 是最自由的可配置的单一 2D 形状。" +"它可以用于形成任何性质的多边形,甚至是不封闭区域的形状。然而,即使相互连接的线" +"段确实封闭了一个区域,[ConcavePolygonShape2D] 仍然是[i]中空的[/i],这常常使其" +"不适用于物理模拟或碰撞检测。\n" +"[b]注意:[/b]当用于碰撞计算时,[ConcavePolygonShape2D] 旨在与 [StaticBody2D] " +"等静态 [CollisionShape2D] 节点一起使用,并且对于 [CharacterBody2D] 或 " +"[RigidBody2D],在除静态模式之外的其他模式下可能表现不佳。\n" +"[b]警告:[/b]较小的物理物体在快速移动时有机会穿过该形状。发生这种情况是因为在" +"一帧上,物理物体可能位于形状的“外部”,而在下一帧上,它可能位于形状的“内部”。由" +"于[ConcavePolygonShape2D] 是中空的,因此它不会检测到碰撞。\n" +"[b]性能:[/b]由于其复杂性, [ConcavePolygonShape2D] 是检测碰撞最慢的 2D 碰撞形" +"状。它的使用一般仅限于关卡几何体。如果折线是闭合的,可以使用 " +"[CollisionPolygon2D] 的 [constant CollisionPolygon2D.BUILD_SOLIDS] 模式,它会" +"将多边形分解成凸多边形;相关说明请参阅 [ConvexPolygonShape2D] 文档。" + +msgid "" "The array of points that make up the [ConcavePolygonShape2D]'s line segments. " "The array (of length divisible by two) is naturally divided into pairs (one " "pair for each segment); each pair consists of the starting point of a segment " @@ -24645,6 +26149,49 @@ msgid "A 3D trimesh shape used for physics collision." msgstr "用于物理碰撞的 3D 三角网格形状。" msgid "" +"A 3D trimesh shape, intended for use in physics. Usually used to provide a " +"shape for a [CollisionShape3D].\n" +"Being just a collection of interconnected triangles, [ConcavePolygonShape3D] " +"is the most freely configurable single 3D shape. It can be used to form " +"polyhedra of any nature, or even shapes that don't enclose a volume. However, " +"[ConcavePolygonShape3D] is [i]hollow[/i] even if the interconnected triangles " +"do enclose a volume, which often makes it unsuitable for physics or " +"detection.\n" +"[b]Note:[/b] When used for collision, [ConcavePolygonShape3D] is intended to " +"work with static [CollisionShape3D] nodes like [StaticBody3D] and will likely " +"not behave well for [CharacterBody3D]s or [RigidBody3D]s in a mode other than " +"Static.\n" +"[b]Warning:[/b] Physics bodies that are small have a chance to clip through " +"this shape when moving fast. This happens because on one frame, the physics " +"body may be on the \"outside\" of the shape, and on the next frame it may be " +"\"inside\" it. [ConcavePolygonShape3D] is hollow, so it won't detect a " +"collision.\n" +"[b]Performance:[/b] Due to its complexity, [ConcavePolygonShape3D] is the " +"slowest 3D collision shape to check collisions against. Its use should " +"generally be limited to level geometry. For convex geometry, " +"[ConvexPolygonShape3D] should be used. For dynamic physics bodies that need " +"concave collision, several [ConvexPolygonShape3D]s can be used to represent " +"its collision by using convex decomposition; see [ConvexPolygonShape3D]'s " +"documentation for instructions." +msgstr "" +"一种用于物理模拟的 3D 三角网格形状。通常用于为 [CollisionShape3D] 提供形状。\n" +"作为一组相互连接的三角形, [ConcavePolygonShape3D] 是最自由的可配置的单一 3D " +"形状。它可以用于形成任何性质的多面体,甚至是不封闭体积的形状。然而,即使相互连" +"接的三角形封闭了一个体积, [ConvexPolygonShape3D] 仍然是[i]中空[/i]的,这常常" +"使其不适用于物理模拟或碰撞检测。\n" +"[b]注意:[/b]当用于碰撞计算时, [ConcavePolygonShape3D] 旨在与 [StaticBody3D] " +"等静态 [CollisionShape3D] 节点一起使用 。并且对于 [CharacterBody3D] 或 " +"[RigidBody3D],在除静态模式之外的其他模式下可能表现不佳。\n" +"[b]警告:[/b]较小的物理物体在快速移动时有机会穿过该形状。发生这种情况是因为在" +"一帧上,物理物体可能位于形状的“外部”,而在下一帧上,它可能位于形状的“内部”。由" +"于[ConcavePolygonShape3D] 是中空的,因此它不会检测到碰撞。\n" +"[b]性能:[/b]由于其复杂性, [ConcavePolygonShape3D] 是检测碰撞最慢的 3D 碰撞形" +"状。它的使用一般仅限于关卡几何体。对于凸几何体,应使用 " +"[ConvexPolygonShape3D] 。对于需要凹碰撞的动态物体,可以使用多个 " +"[ConvexPolygonShape3D] 通过凸分解来表示其碰撞;相关说明请参阅 " +"[ConvexPolygonShape3D] 文档。" + +msgid "" "Returns the faces of the trimesh shape as an array of vertices. The array (of " "length divisible by three) is naturally divided into triples; each triple of " "vertices defines a triangle." @@ -24978,6 +26525,80 @@ msgid "Returns [code]true[/code] if the specified section-key pair exists." msgstr "如果指定的小节-键对存在,则返回 [code]true[/code]。" msgid "" +"Loads the config file specified as a parameter. The file's contents are " +"parsed and loaded in the [ConfigFile] object which the method was called on.\n" +"Returns [constant OK] on success, or one of the other [enum Error] values if " +"the operation failed." +msgstr "" +"加载指定为参数的配置文件。解析文件的内容并将其加载到调用该方法的 [ConfigFile] " +"对象中。\n" +"成功时返回 [constant OK];如果操作失败,则返回其他 [enum Error] 值。" + +msgid "" +"Loads the encrypted config file specified as a parameter, using the provided " +"[param key] to decrypt it. The file's contents are parsed and loaded in the " +"[ConfigFile] object which the method was called on.\n" +"Returns [constant OK] on success, or one of the other [enum Error] values if " +"the operation failed." +msgstr "" +"加载指定为参数的加密配置文件,使用提供的 [param key] 对其解密。解析文件的内容" +"并将其加载到调用该方法的 [ConfigFile] 对象中。\n" +"成功时返回 [constant OK];如果操作失败,则返回其他 [enum Error] 值。" + +msgid "" +"Loads the encrypted config file specified as a parameter, using the provided " +"[param password] to decrypt it. The file's contents are parsed and loaded in " +"the [ConfigFile] object which the method was called on.\n" +"Returns [constant OK] on success, or one of the other [enum Error] values if " +"the operation failed." +msgstr "" +"加载作为参数的加密配置文件,使用提供的 [param password] 解密。该文件的内容被解" +"析并加载到调用该方法的 [ConfigFile] 对象中。\n" +"成功时返回 [constant OK];如果操作失败,则返回其他 [enum Error] 值。" + +msgid "" +"Parses the passed string as the contents of a config file. The string is " +"parsed and loaded in the ConfigFile object which the method was called on.\n" +"Returns [constant OK] on success, or one of the other [enum Error] values if " +"the operation failed." +msgstr "" +"将传递的字符串解析为配置文件的内容。该字符串被解析并加载到调用该方法的 " +"ConfigFile 对象中。\n" +"成功时返回 [constant OK];如果操作失败,则返回其他 [enum Error] 值。" + +msgid "" +"Saves the contents of the [ConfigFile] object to the file specified as a " +"parameter. The output file uses an INI-style structure.\n" +"Returns [constant OK] on success, or one of the other [enum Error] values if " +"the operation failed." +msgstr "" +"将 [ConfigFile] 对象的内容保存到指定为参数的文件中。输出文件使用 INI 样式的结" +"构。\n" +"成功时返回 [constant OK];如果操作失败,则返回其他 [enum Error] 值。" + +msgid "" +"Saves the contents of the [ConfigFile] object to the AES-256 encrypted file " +"specified as a parameter, using the provided [param key] to encrypt it. The " +"output file uses an INI-style structure.\n" +"Returns [constant OK] on success, or one of the other [enum Error] values if " +"the operation failed." +msgstr "" +"使用提供的 [param key] 将 [ConfigFile] 对象的内容保存到作为参数指定的 AES-256 " +"加密文件中。输出文件使用 INI 样式的结构。\n" +"成功时返回 [constant OK];如果操作失败,则返回其他 [enum Error] 值。" + +msgid "" +"Saves the contents of the [ConfigFile] object to the AES-256 encrypted file " +"specified as a parameter, using the provided [param password] to encrypt it. " +"The output file uses an INI-style structure.\n" +"Returns [constant OK] on success, or one of the other [enum Error] values if " +"the operation failed." +msgstr "" +"将 [ConfigFile] 对象的内容保存到作为参数指定的 AES-256 加密文件中,使用提供的 " +"[param password] 进行加密。输出文件使用 INI 风格的结构。\n" +"成功时返回 [constant OK];如果操作失败,则返回其他 [enum Error] 值。" + +msgid "" "Assigns a value to the specified key of the specified section. If either the " "section or the key do not exist, they are created. Passing a [code]null[/" "code] value deletes the specified key if it exists, and deletes the section " @@ -25769,6 +27390,16 @@ msgid "" msgstr "找到上一个可以接受焦点的 [Control],在树的上方。" msgid "" +"Finds the next [Control] that can receive the focus on the specified [enum " +"Side].\n" +"[b]Note:[/b] This is different from [method get_focus_neighbor], which " +"returns the path of a specified focus neighbor." +msgstr "" +"查找指定 [enum Side] 上可以接收焦点的下一个 [Control]。\n" +"[b]注意:[/b]这与 [method get_focus_neighbor] 不同,后者返回指定焦点邻居的路" +"径。" + +msgid "" "Forces drag and bypasses [method _get_drag_data] and [method " "set_drag_preview] by passing [param data] and [param preview]. Drag will " "start even if the mouse is neither over nor pressed on this control.\n" @@ -25811,6 +27442,19 @@ msgid "Returns [member offset_right] and [member offset_bottom]." msgstr "返回 [member offset_right] 和 [member offset_bottom]。" msgid "" +"Returns the focus neighbor for the specified [enum Side]. A getter method for " +"[member focus_neighbor_bottom], [member focus_neighbor_left], [member " +"focus_neighbor_right] and [member focus_neighbor_top].\n" +"[b]Note:[/b] To find the next [Control] on the specific [enum Side], even if " +"a neighbor is not assigned, use [method find_valid_focus_neighbor]." +msgstr "" +"返回指定 [enum Side] 的焦点邻居。用于 [member focus_neighbor_bottom]、[member " +"focus_neighbor_left]、[member focus_neighbor_right]、和 [member " +"focus_neighbor_top] 的取值方法。\n" +"[b]注意:[/b]要查找特定 [enum Side] 上的下一个 [Control],即使未指定邻居,也请" +"使用 [method find_valid_focus_neighbor]。" + +msgid "" "Returns the position and size of the control relative to the containing " "canvas. See [member global_position] and [member size].\n" "[b]Note:[/b] If the node itself or any parent [CanvasItem] between the node " @@ -26874,6 +28518,35 @@ msgstr "" "[b]注意:[/b]除非 [Window] 为嵌入式,否则窗口样式无效。" msgid "" +"The name of a theme type variation used by this [Control] to look up its own " +"theme items. When empty, the class name of the node is used (e.g. [code skip-" +"lint]Button[/code] for the [Button] control), as well as the class names of " +"all parent classes (in order of inheritance).\n" +"When set, this property gives the highest priority to the type of the " +"specified name. This type can in turn extend another type, forming a " +"dependency chain. See [method Theme.set_type_variation]. If the theme item " +"cannot be found using this type or its base types, lookup falls back on the " +"class names.\n" +"[b]Note:[/b] To look up [Control]'s own items use various [code]get_theme_*[/" +"code] methods without specifying [code]theme_type[/code].\n" +"[b]Note:[/b] Theme items are looked for in the tree order, from branch to " +"root, where each [Control] node is checked for its [member theme] property. " +"The earliest match against any type/class name is returned. The project-level " +"Theme and the default Theme are checked last." +msgstr "" +"该 [Control] 用于查找其自有的主题项的主题类型变体的名称。当为空时,将使用节点" +"的类名(例如 [code skip-lint]Button[/code] 用于 [Button] 控件),以及所有父类" +"的类名(按继承顺序)。\n" +"设置后,该属性将最高优先级赋予指定名称的类型。这种类型又可以扩展另一种类型,形" +"成依赖链。参见 [method Theme.set_type_variation]。如果使用该类型或其基类型无法" +"找到主题项,则查找会回退到依赖类名查找。\n" +"[b]注意:[/b]要查找 [Control] 自有的项目,请使用各种 [code]get_theme_*[/code] " +"方法且无需指定 [code]theme_type[/code]。\n" +"[b]注意:[/b]主题项按树状顺序查找,从分支到根,其中每个 [Control] 节点的 " +"[member theme] 属性都将被检查。最早匹配任意类型名称/类名称的项将被返回。最后检" +"查项目级的主题和默认主题。" + +msgid "" "The default tooltip text. The tooltip appears when the user's mouse cursor " "stays idle over this control for a few moments, provided that the [member " "mouse_filter] property is not [constant MOUSE_FILTER_IGNORE]. The time " @@ -26945,6 +28618,46 @@ msgstr "当节点收到 [InputEvent] 时发出。" msgid "Emitted when the node's minimum size changes." msgstr "当节点的最小大小更改时发出。" +msgid "" +"Emitted when the mouse cursor enters the control's (or any child control's) " +"visible area, that is not occluded behind other Controls or Windows, provided " +"its [member mouse_filter] lets the event reach it and regardless if it's " +"currently focused or not.\n" +"[b]Note:[/b] [member CanvasItem.z_index] doesn't affect, which Control " +"receives the signal." +msgstr "" +"当鼠标光标进入控件(或任何子控件)的可见区域时发出,可见区域即未被其他 " +"Control 和 Window 遮挡的区域,需要 [member mouse_filter] 允许事件达到,与控件" +"是否持有焦点无关。\n" +"[b]注意:[/b][member CanvasItem.z_index] 不影响哪个 Control 会收到信号。" + +msgid "" +"Emitted when the mouse cursor leaves the control's (and all child control's) " +"visible area, that is not occluded behind other Controls or Windows, provided " +"its [member mouse_filter] lets the event reach it and regardless if it's " +"currently focused or not.\n" +"[b]Note:[/b] [member CanvasItem.z_index] doesn't affect, which Control " +"receives the signal.\n" +"[b]Note:[/b] If you want to check whether the mouse truly left the area, " +"ignoring any top nodes, you can use code like this:\n" +"[codeblock]\n" +"func _on_mouse_exited():\n" +" if not Rect2(Vector2(), size).has_point(get_local_mouse_position()):\n" +" # Not hovering over area.\n" +"[/codeblock]" +msgstr "" +"当鼠标光标离开控件(或任何子控件)的可见区域时发出,可见区域即未被其他 " +"Control 和 Window 遮挡的区域,需要 [member mouse_filter] 允许事件达到,与控件" +"是否持有焦点无关。\n" +"[b]注意:[/b][member CanvasItem.z_index] 不影响哪个 Control 会收到信号。\n" +"[b]注意:[/b]如果要忽略任何顶部节点,检查鼠标是否真的离开了该区域,可以使用如" +"下代码:\n" +"[codeblock]\n" +"func _on_mouse_exited():\n" +" if not Rect2(Vector2(), size).has_point(get_local_mouse_position()):\n" +" # 未悬停在区域上。\n" +"[/codeblock]" + msgid "Emitted when the control changes size." msgstr "当控件更改大小时发出。" @@ -26977,6 +28690,62 @@ msgstr "" msgid "Sent when the node changes size. Use [member size] to get the new size." msgstr "当节点改变大小时发送。请使用 [member size] 获取新大小。" +msgid "" +"Sent when the mouse cursor enters the control's (or any child control's) " +"visible area, that is not occluded behind other Controls or Windows, provided " +"its [member mouse_filter] lets the event reach it and regardless if it's " +"currently focused or not.\n" +"[b]Note:[/b] [member CanvasItem.z_index] doesn't affect which Control " +"receives the notification.\n" +"See also [constant NOTIFICATION_MOUSE_ENTER_SELF]." +msgstr "" +"当鼠标光标进入控件(或任何子控件)的可见区域时发送,可见区域即未被其他 " +"Control 和 Window 遮挡的区域,需要 [member mouse_filter] 允许事件达到,与控件" +"是否持有焦点无关。\n" +"[b]注意:[/b][member CanvasItem.z_index] 不影响哪个 Control 会收到该通知。\n" +"另见 [constant NOTIFICATION_MOUSE_ENTER_SELF]。" + +msgid "" +"Sent when the mouse cursor leaves the control's (and all child control's) " +"visible area, that is not occluded behind other Controls or Windows, provided " +"its [member mouse_filter] lets the event reach it and regardless if it's " +"currently focused or not.\n" +"[b]Note:[/b] [member CanvasItem.z_index] doesn't affect which Control " +"receives the notification.\n" +"See also [constant NOTIFICATION_MOUSE_EXIT_SELF]." +msgstr "" +"当鼠标光标离开控件(以及所有子控件)的可见区域时发送,可见区域即未被其他 " +"Control 和 Window 遮挡的区域,需要 [member mouse_filter] 允许事件达到,与控件" +"是否持有焦点无关。\n" +"[b]注意:[/b][member CanvasItem.z_index] 不影响哪个 Control 会收到该通知。\n" +"另见 [constant NOTIFICATION_MOUSE_EXIT_SELF]。" + +msgid "" +"Sent when the mouse cursor enters the control's visible area, that is not " +"occluded behind other Controls or Windows, provided its [member mouse_filter] " +"lets the event reach it and regardless if it's currently focused or not.\n" +"[b]Note:[/b] [member CanvasItem.z_index] doesn't affect which Control " +"receives the notification.\n" +"See also [constant NOTIFICATION_MOUSE_ENTER]." +msgstr "" +"当鼠标光标进入控件的可见区域时发送,可见区域即未被其他 Control 和 Window 遮挡" +"的区域,需要 [member mouse_filter] 允许事件达到,与控件是否持有焦点无关。\n" +"[b]注意:[/b][member CanvasItem.z_index] 不影响哪个 Control 会收到该通知。\n" +"另见 [constant NOTIFICATION_MOUSE_ENTER]。" + +msgid "" +"Sent when the mouse cursor leaves the control's visible area, that is not " +"occluded behind other Controls or Windows, provided its [member mouse_filter] " +"lets the event reach it and regardless if it's currently focused or not.\n" +"[b]Note:[/b] [member CanvasItem.z_index] doesn't affect which Control " +"receives the notification.\n" +"See also [constant NOTIFICATION_MOUSE_EXIT]." +msgstr "" +"当鼠标光标离开控件的可见区域时发送,可见区域即未被其他 Control 和 Window 遮挡" +"的区域,需要 [member mouse_filter] 允许事件达到,与控件是否持有焦点无关。\n" +"[b]注意:[/b][member CanvasItem.z_index] 不影响哪个 Control 会收到该通知。\n" +"另见 [constant NOTIFICATION_MOUSE_EXIT]。" + msgid "Sent when the node grabs focus." msgstr "当节点获得焦点时发送。" @@ -27003,6 +28772,36 @@ msgstr "" "[b]注意:[/b]作为一种优化,当该节点在场景树之外时,发生的更改不会发送该通知。" "相反,所有的主题项更新可以在该节点进入场景树时一次性应用。" +msgid "" +"Sent when this node is inside a [ScrollContainer] which has begun being " +"scrolled when dragging the scrollable area [i]with a touch event[/i]. This " +"notification is [i]not[/i] sent when scrolling by dragging the scrollbar, " +"scrolling with the mouse wheel or scrolling with keyboard/gamepad events.\n" +"[b]Note:[/b] This signal is only emitted on Android or iOS, or on desktop/web " +"platforms when [member ProjectSettings.input_devices/pointing/" +"emulate_touch_from_mouse] is enabled." +msgstr "" +"当该节点位于 [ScrollContainer] 内部时发送,该容器在通过[i]触摸事件[/i]拖动该可" +"滚动区域时已开始滚动。通过拖动滚动条滚动、使用鼠标滚轮滚动、或使用键盘/游戏手" +"柄事件滚动时,[i]不[/i]会发送该通知。\n" +"[b]注意:[/b]该信号仅在在 Android 或 iOS 上、或当启用 [member ProjectSettings." +"input_devices/pointing/emulate_touch_from_mouse] 时的桌面/Web 平台上发出。" + +msgid "" +"Sent when this node is inside a [ScrollContainer] which has stopped being " +"scrolled when dragging the scrollable area [i]with a touch event[/i]. This " +"notification is [i]not[/i] sent when scrolling by dragging the scrollbar, " +"scrolling with the mouse wheel or scrolling with keyboard/gamepad events.\n" +"[b]Note:[/b] This signal is only emitted on Android or iOS, or on desktop/web " +"platforms when [member ProjectSettings.input_devices/pointing/" +"emulate_touch_from_mouse] is enabled." +msgstr "" +"当该节点位于 [ScrollContainer] 内部时发送,该容器在通过[i]触摸事件[/i]拖动该可" +"滚动区域时已停止滚动。通过拖动滚动条滚动、使用鼠标滚轮滚动、或使用键盘/游戏手" +"柄事件滚动时,[i]不[/i]会发送该通知。\n" +"[b]注意:[/b]该信号仅在在 Android 或 iOS 上、或当启用 [member ProjectSettings." +"input_devices/pointing/emulate_touch_from_mouse] 时的桌面/Web 平台上发出。" + msgid "Sent when control layout direction is changed." msgstr "当控件的布局方向改变时发送。" @@ -27320,6 +29119,52 @@ msgstr "" "size_flags_vertical] 一起使用。" msgid "" +"The control will receive mouse movement input events and mouse button input " +"events if clicked on through [method _gui_input]. And the control will " +"receive the [signal mouse_entered] and [signal mouse_exited] signals. These " +"events are automatically marked as handled, and they will not propagate " +"further to other controls. This also results in blocking signals in other " +"controls." +msgstr "" +"在控件上点击时,将通过 [method _gui_input] 收到鼠标移动输入事件和鼠标按钮输入" +"事件。控件能够接收到 [signal mouse_entered] 和 [signal mouse_exited] 信号。这" +"些事件将自动被标记为已处理,不会进一步传播到其他控件。这也会导致其他控件中的信" +"号被阻止。" + +msgid "" +"The control will receive mouse movement input events and mouse button input " +"events if clicked on through [method _gui_input]. And the control will " +"receive the [signal mouse_entered] and [signal mouse_exited] signals. If this " +"control does not handle the event, the parent control (if any) will be " +"considered, and so on until there is no more parent control to potentially " +"handle it. This also allows signals to fire in other controls. If no control " +"handled it, the event will be passed to [method Node._shortcut_input] for " +"further processing." +msgstr "" +"在控件上点击时,将通过 [method _gui_input] 收到鼠标移动输入事件和鼠标按钮输入" +"事件。并且控件能够接收到 [signal mouse_entered] 和 [signal mouse_exited] 信" +"号。如果此控件不处理事件,则将考虑其父控件(如果有的话),依此类推,直到没有更" +"多的父控件可以处理该事件。这也允许信号在其他控件中触发。如果没有控件处理它,该" +"事件将被传递到 [method Node._shortcut_input] 进行进一步处理。" + +msgid "" +"The control will not receive mouse movement input events and mouse button " +"input events if clicked on through [method _gui_input]. The control will also " +"not receive the [signal mouse_entered] nor [signal mouse_exited] signals. " +"This will not block other controls from receiving these events or firing the " +"signals. Ignored events will not be handled automatically.\n" +"[b]Note:[/b] If the control has received [signal mouse_entered] but not " +"[signal mouse_exited], changing the [member mouse_filter] to [constant " +"MOUSE_FILTER_IGNORE] will cause [signal mouse_exited] to be emitted." +msgstr "" +"在控件上点击时,不会通过 [method _gui_input] 收到鼠标移动输入事件和鼠标按钮输" +"入事件,也不会接收到 [signal mouse_entered] 和 [signal mouse_exited] 信号。这" +"不会阻止其他控件接收这些事件或触发信号。被忽略的事件将不会被自动处理。\n" +"[b]注意:[/b]如果控件已收到 [signal mouse_entered] 但未收到 [signal " +"mouse_exited],则将 [member mouse_filter] 更改为 [constant " +"MOUSE_FILTER_IGNORE] 将导致发出 [signal mouse_exited]。" + +msgid "" "The control will grow to the left or top to make up if its minimum size is " "changed to be greater than its current size on the respective axis." msgstr "" @@ -27392,6 +29237,40 @@ msgid "A 2D convex polygon shape used for physics collision." msgstr "用于物理碰撞的 2D 凸多边形形状。" msgid "" +"A 2D convex polygon shape, intended for use in physics. Used internally in " +"[CollisionPolygon2D] when it's in [constant CollisionPolygon2D.BUILD_SOLIDS] " +"mode.\n" +"[ConvexPolygonShape2D] is [i]solid[/i], which means it detects collisions " +"from objects that are fully inside it, unlike [ConcavePolygonShape2D] which " +"is hollow. This makes it more suitable for both detection and physics.\n" +"[b]Convex decomposition:[/b] A concave polygon can be split up into several " +"convex polygons. This allows dynamic physics bodies to have complex concave " +"collisions (at a performance cost) and can be achieved by using several " +"[ConvexPolygonShape2D] nodes or by using the [CollisionPolygon2D] node in " +"[constant CollisionPolygon2D.BUILD_SOLIDS] mode. To generate a collision " +"polygon from a sprite, select the [Sprite2D] node, go to the [b]Sprite2D[/b] " +"menu that appears above the viewport, and choose [b]Create Polygon2D Sibling[/" +"b].\n" +"[b]Performance:[/b] [ConvexPolygonShape2D] is faster to check collisions " +"against compared to [ConcavePolygonShape2D], but it is slower than primitive " +"collision shapes such as [CircleShape2D] and [RectangleShape2D]. Its use " +"should generally be limited to medium-sized objects that cannot have their " +"collision accurately represented by primitive shapes." +msgstr "" +"2D 凸多边形形状,旨在用于物理。[CollisionPolygon2D] 为 [constant " +"CollisionPolygon2D.BUILD_SOLIDS] 模式时内部会使用这个类。\n" +"[ConvexPolygonShape2D] 是[i]实心[/i]的,与空心的 [ConcavePolygonShape2D] 不" +"同,如果对象完全位于其内部,也能够检测到碰撞。因此更适于检测和物理。\n" +"[b]凸分解:[/b]凹多边形可以拆分为多个凸多边形。这样就能够让动态物理体拥有复杂" +"的凹碰撞(以消耗性能为代价),做法是使用多个 [ConvexPolygonShape3D] 节点,或者" +"使用 [constant CollisionPolygon2D.BUILD_SOLIDS] 模式的 [CollisionPolygon2D] 节" +"点。要根据精灵生成碰撞多边形,请选中 [Sprite2D] 节点,前往出现在视口上方的 " +"[b]Sprite2D[/b] 菜单,然后选择[b]创建 Polygon2D 同级[/b]。\n" +"[b]性能:[/b][ConvexPolygonShape2D] 检查碰撞的速度比 [ConcavePolygonShape2D] " +"要快,但比 [CircleShape2D]、[RectangleShape2D] 等基本碰撞形状要慢。通常应该仅" +"限于中等大小的对象,在无法使用基本形状精确表示碰撞时使用。" + +msgid "" "Based on the set of points provided, this assigns the [member points] " "property using the convex hull algorithm, removing all unneeded points. See " "[method Geometry2D.convex_hull] for details." @@ -27635,6 +29514,20 @@ msgstr "" "半径。" msgid "" +"If [code]true[/code], particles are being emitted. [member emitting] can be " +"used to start and stop particles from emitting. However, if [member one_shot] " +"is [code]true[/code] setting [member emitting] to [code]true[/code] will not " +"restart the emission cycle until after all active particles finish " +"processing. You can use the [signal finished] signal to be notified once all " +"active particles finish processing." +msgstr "" +"如果为 [code]true[/code],则正在发射粒子。[member emitting] 可用于启动和停止粒" +"子发射。但是,如果 [member one_shot] 为 [code]true[/code],则将 [member " +"emitting] 设置为 [code]true[/code] 将不会重新启动该发射循环,直到所有活动粒子" +"完成处理为止。一旦所有活动粒子完成处理,你可以使用 [signal finished] 信号来收" +"取通知。" + +msgid "" "How rapidly particles in an emission cycle are emitted. If greater than " "[code]0[/code], there will be a gap in emissions before the next cycle begins." msgstr "" @@ -27809,11 +29702,21 @@ msgstr "[member tangential_accel_max] 的对应最小值。" msgid "Particle texture. If [code]null[/code], particles will be squares." msgstr "粒子纹理。如果为 [code]null[/code],则粒子将为正方形。" +msgid "" +"Emitted when all active particles have finished processing. When [member " +"one_shot] is disabled, particles will process continuously, so this is never " +"emitted." +msgstr "" +"当所有活动粒子完成处理时发出。当 [member one_shot] 被禁用时,粒子将连续处理," +"因此它永远不会触发。" + msgid "Particles are drawn in the order emitted." msgstr "粒子按发射顺序绘制。" -msgid "Particles are drawn in order of remaining lifetime." -msgstr "粒子按剩余寿命的顺序绘制。" +msgid "" +"Particles are drawn in order of remaining lifetime. In other words, the " +"particle with the highest lifetime is drawn at the front." +msgstr "粒子按照剩余寿命的顺序绘制。换句话说,寿命最长的粒子被绘制在前面。" msgid "" "Use with [method set_param_min], [method set_param_max], and [method " @@ -28691,6 +30594,27 @@ msgstr "" msgid "The [Material] used in drawing the CSG shape." msgstr "用于绘制 CSG 形状的 [Material]。" +msgid "" +"The [Mesh] resource to use as a CSG shape.\n" +"[b]Note:[/b] When using an [ArrayMesh], all vertex attributes except " +"[constant Mesh.ARRAY_VERTEX], [constant Mesh.ARRAY_NORMAL] and [constant Mesh." +"ARRAY_TEX_UV] are left unused. Only [constant Mesh.ARRAY_VERTEX] and " +"[constant Mesh.ARRAY_TEX_UV] will be passed to the GPU.\n" +"[constant Mesh.ARRAY_NORMAL] is only used to determine which faces require " +"the use of flat shading. By default, CSGMesh will ignore the mesh's vertex " +"normals, recalculate them for each vertex and use a smooth shader. If a flat " +"shader is required for a face, ensure that all vertex normals of the face are " +"approximately equal." +msgstr "" +"用作 CSG 形状的 [Mesh] 资源。\n" +"[b]注意:[/b]使用 [ArrayMesh] 时,除 [constant Mesh.ARRAY_VERTEX]、[constant " +"Mesh.ARRAY_NORMAL] 和 [constant Mesh.ARRAY_TEX_UV] 之外的所有顶点属性均保持未" +"被使用的状态。只有 [constant Mesh.ARRAY_VERTEX] 和 [constant Mesh." +"ARRAY_TEX_UV] 会被传递到 GPU。\n" +"[constant Mesh.ARRAY_NORMAL] 仅被用于确定哪些面需要使用平直着色。默认情况下," +"CSGMesh 将忽略该网格的顶点法线,为每个顶点重新计算它们并使用一个平滑着色器。如" +"果面需要平直着色器,请确保面的所有顶点法线大致相等。" + msgid "Extrudes a 2D polygon shape to create a 3D mesh." msgstr "拉伸 2D 多边形形状以创建 3D 网格。" @@ -29103,6 +31027,11 @@ msgid "Returns a new instance of the script." msgstr "返回该脚本的新实例。" msgid "" +"Six square textures representing the faces of a cube. Commonly used as a " +"skybox." +msgstr "代表立方体面的六个正方形纹理。通常用作天空盒。" + +msgid "" "A cubemap is made of 6 textures organized in layers. They are typically used " "for faking reflections in 3D rendering (see [ReflectionProbe]). It can be " "used to make an object look as if it's reflecting its surroundings. This " @@ -29130,6 +31059,39 @@ msgstr "" msgid "Creates a placeholder version of this resource ([PlaceholderCubemap])." msgstr "创建该资源的占位符版本([PlaceholderCubemap])。" +msgid "An array of [Cubemap]s, stored together and with a single reference." +msgstr "[Cubemap] 数组,存储在一起并使用单个引用。" + +msgid "" +"[CubemapArray]s are made of an array of [Cubemap]s. Like [Cubemap]s, they are " +"made of multiple textures, the amount of which must be divisible by 6 (one " +"for each face of the cube). The primary benefit of [CubemapArray]s is that " +"they can be accessed in shader code using a single texture reference. In " +"other words, you can pass multiple [Cubemap]s into a shader using a single " +"[CubemapArray].\n" +"Moreover, [Cubemap]s are allocated in adjacent cache regions on the GPU. This " +"makes [CubemapArray]s the most efficient way to store multiple [Cubemap]s.\n" +"Internally, Godot uses [CubemapArray]s for many effects, including the [Sky] " +"if you set [member ProjectSettings.rendering/reflections/sky_reflections/" +"texture_array_reflections] to [code]true[/code].\n" +"To create such a texture file yourself, reimport your image files using the " +"import presets of the File System dock.\n" +"[b]Note:[/b] [CubemapArray] is not supported in the OpenGL 3 rendering " +"backend." +msgstr "" +"[CubemapArray] 由一组 [Cubemap] 组成。它们像 [Cubemap] 一样是由多个纹理组成" +"的,其纹理的数量必须能被 6 整除(立方体的每个面都有一个)。[CubemapArray] 的主" +"要好处是可以使用单个纹理引用在着色器代码中访问它们。换句话说,可以使用单个 " +"[CubemapArray] 将多个 [Cubemap] 传入着色器。\n" +"此外,[Cubemap] 被分配在 GPU 上相邻的缓存区块中。这使得 [CubemapArray] 成为存" +"储多个 [Cubemap] 的最有效方式。\n" +"如果将 [member ProjectSettings.rendering/reflections/sky_reflections/" +"texture_array_reflections] 设置为 [code]true[/code],Godot 在内部会将 " +"[CubemapArray] 用于多种效果,包括 [Sky]。\n" +"要想自己创建这样的纹理文件,请使用文件系统停靠面板的导入预设重新导入你的图像文" +"件。\n" +"[b]注意:[/b][CubemapArray] 在 OpenGL 3 渲染后端中不受支持。" + msgid "" "Creates a placeholder version of this resource ([PlaceholderCubemapArray])." msgstr "创建该资源的占位符版本([PlaceholderCubemapArray])。" @@ -29138,6 +31100,19 @@ msgid "A mathematical curve." msgstr "数学曲线。" msgid "" +"This resource describes a mathematical curve by defining a set of points and " +"tangents at each point. By default, it ranges between [code]0[/code] and " +"[code]1[/code] on the Y axis and positions points relative to the [code]0.5[/" +"code] Y position.\n" +"See also [Gradient] which is designed for color interpolation. See also " +"[Curve2D] and [Curve3D]." +msgstr "" +"该资源通过定义一组点和每个点的切线来描述数学曲线。默认情况下,它在 Y 轴上的范" +"围在 [code]0[/code] 到 [code]1[/code] 之间,并且位置点相对于 [code]0.5[/code] " +"Y 位置。\n" +"另请参阅为颜色插值设计的 [Gradient]。另请参阅 [Curve2D] 和 [Curve3D]。" + +msgid "" "Adds a point to the curve. For each side, if the [code]*_mode[/code] is " "[constant TANGENT_LINEAR], the [code]*_tangent[/code] angle (in degrees) uses " "the slope of the curve halfway to the adjacent point. Allows custom " @@ -29569,6 +31544,49 @@ msgstr "" "code]。" msgid "" +"Returns a point within the curve at position [param offset], where [param " +"offset] is measured as a distance in 3D units along the curve. To do that, it " +"finds the two cached points where the [param offset] lies between, then " +"interpolates the values. This interpolation is cubic if [param cubic] is set " +"to [code]true[/code], or linear if set to [code]false[/code].\n" +"Cubic interpolation tends to follow the curves better, but linear is faster " +"(and often, precise enough)." +msgstr "" +"返回曲线内位于 [param offset] 位置的一个点,其中 [param offset] 为沿曲线的 3D " +"单位测量距离。为此,它会找到 [param offset] 位于其间的两个缓存点,然后对值进行" +"插值。如果 [param cubic] 被设置为 [code]true[/code],则该插值是立方插值;如果" +"被设置为 [code]false[/code],则该插值是线性插值。\n" +"立方插值往往能更好地跟随曲线,但线性插值速度更快(而且通常足够精确)。" + +msgid "" +"Returns an up vector within the curve at position [param offset], where " +"[param offset] is measured as a distance in 3D units along the curve. To do " +"that, it finds the two cached up vectors where the [param offset] lies " +"between, then interpolates the values. If [param apply_tilt] is [code]true[/" +"code], an interpolated tilt is applied to the interpolated up vector.\n" +"If the curve has no up vectors, the function sends an error to the console, " +"and returns [code](0, 1, 0)[/code]." +msgstr "" +"返回曲线内位于 [param offset] 位置的向上向量,其中 [param offset] 为沿曲线的 " +"3D 单位测量距离。为此,它会找到 [param offset] 位于其间的两个缓存向上向量,然" +"后对值进行插值。如果 [param apply_tilt] 为 [code]true[/code],则对插值后的向上" +"向量应用插值后的倾斜。\n" +"如果曲线没有向上向量,则该函数将向控制台发送一个错误,并返回 [code](0, 1, 0)[/" +"code]。" + +msgid "" +"Returns a [Transform3D] with [code]origin[/code] as point position, " +"[code]basis.x[/code] as sideway vector, [code]basis.y[/code] as up vector, " +"[code]basis.z[/code] as forward vector. When the curve length is 0, there is " +"no reasonable way to calculate the rotation, all vectors aligned with global " +"space axes. See also [method sample_baked]." +msgstr "" +"返回一个 [Transform3D],其中 [code]origin[/code] 作为点位置,[code]basis.x[/" +"code] 作为横向向量,[code]basis.y[/code] 作为向上向量,[code]basis.z[/code] 作" +"为前向向量。当曲线长度为 0 时,将没有合理的方法来计算旋转,所有向量都会与全局" +"空间轴对齐。另请参见 [method sample_baked]。" + +msgid "" "Sets the tilt angle in radians for the point [param idx]. If the index is out " "of bounds, the function sends an error to the console.\n" "The tilt controls the rotation along the look-at axis an object traveling the " @@ -29601,6 +31619,22 @@ msgstr "" "rotation_mode] 被设置为 [constant PathFollow3D.ROTATION_ORIENTED] 时使用。更改" "它会强制缓存被重新计算。" +msgid "A 1D texture where pixel brightness corresponds to points on a curve." +msgstr "一维纹理,其中像素亮度对应于曲线上的点。" + +msgid "" +"A 1D texture where pixel brightness corresponds to points on a [Curve] " +"resource, either in grayscale or in red. This visual representation " +"simplifies the task of saving curves as image files.\n" +"If you need to store up to 3 curves within a single texture, use " +"[CurveXYZTexture] instead. See also [GradientTexture1D] and " +"[GradientTexture2D]." +msgstr "" +"1D 纹理,其中像素亮度对应于 [Curve] 资源上的点(以灰度或红色来表示)。这种视觉" +"表示简化了将曲线保存为图像文件的任务。\n" +"如果需要在单个纹理中,存储最多 3 条曲线,请改用 [CurveXYZTexture]。另见 " +"[GradientTexture1D] 和 [GradientTexture2D]。" + msgid "The [Curve] that is rendered onto the texture." msgstr "渲染到纹理上的 [Curve]。" @@ -29638,6 +31672,18 @@ msgid "" "points on 3 curves." msgstr "一维纹理,其中红色、绿色和蓝色通道分别对应 3 条曲线上的点。" +msgid "" +"A 1D texture where the red, green, and blue color channels correspond to " +"points on 3 [Curve] resources. Compared to using separate [CurveTexture]s, " +"this further simplifies the task of saving curves as image files.\n" +"If you only need to store one curve within a single texture, use " +"[CurveTexture] instead. See also [GradientTexture1D] and [GradientTexture2D]." +msgstr "" +"1D 纹理,其中红色、绿色和蓝色通道对应于 3 条 [Curve] 资源上的点。与使用单独的 " +"[CurveTexture] 相比,这进一步简化了将曲线保存为图像文件的任务。\n" +"如果只需要在单个纹理中存储一条曲线,请改用 [CurveTexture]。另见 " +"[GradientTexture1D] 和 [GradientTexture2D]。" + msgid "The [Curve] that is rendered onto the texture's red channel." msgstr "渲染到该纹理红色通道上的 [Curve]。" @@ -29725,6 +31771,20 @@ msgstr "" msgid "A 3D cylinder shape used for physics collision." msgstr "用于物理碰撞的 3D 圆柱体形状。" +msgid "" +"A 3D cylinder shape, intended for use in physics. Usually used to provide a " +"shape for a [CollisionShape3D].\n" +"[b]Note:[/b] There are several known bugs with cylinder collision shapes. " +"Using [CapsuleShape3D] or [BoxShape3D] instead is recommended.\n" +"[b]Performance:[/b] [CylinderShape3D] is fast to check collisions against, " +"but it is slower than [CapsuleShape3D], [BoxShape3D], and [SphereShape3D]." +msgstr "" +"3D 圆柱体形状,旨在用于物理学。通常用于为 [CollisionShape3D] 提供形状。\n" +"[b]注意:[/b]圆柱体碰撞形状有若干已知的问题。建议改用 [CapsuleShape3D] 或 " +"[BoxShape3D]。\n" +"[b]性能:[/b][CylinderShape3D] 可以快速检查碰撞,但比 [CapsuleShape3D]、" +"[BoxShape3D] 和 [SphereShape3D] 慢。" + msgid "The cylinder's height." msgstr "圆柱体的高度。" @@ -29743,6 +31803,16 @@ msgstr "" "的弹簧。" msgid "" +"The spring joint's damping ratio. A value between [code]0[/code] and [code]1[/" +"code]. When the two bodies move into different directions the system tries to " +"align them to the spring axis again. A high [member damping] value forces the " +"attached bodies to align faster." +msgstr "" +"弹簧关节的阻尼比。值在 [code]0[/code] 和 [code]1[/code] 之间。当两个实体移动到" +"不同的方向时,系统会尝试将它们再次对准弹簧轴。高的 [member damping] 值迫使连接" +"的实体更快地对齐。" + +msgid "" "The spring joint's maximum length. The two attached bodies cannot stretch it " "past this value." msgstr "弹簧关节的最大长度。两个连接体不能超过这个值。" @@ -30546,6 +32616,49 @@ msgstr "" "[/codeblock]" msgid "" +"Returns a hashed 32-bit integer value representing the dictionary contents.\n" +"[codeblocks]\n" +"[gdscript]\n" +"var dict1 = {\"A\": 10, \"B\": 2}\n" +"var dict2 = {\"A\": 10, \"B\": 2}\n" +"\n" +"print(dict1.hash() == dict2.hash()) # Prints true\n" +"[/gdscript]\n" +"[csharp]\n" +"var dict1 = new Godot.Collections.Dictionary{{\"A\", 10}, {\"B\", 2}};\n" +"var dict2 = new Godot.Collections.Dictionary{{\"A\", 10}, {\"B\", 2}};\n" +"\n" +"// Godot.Collections.Dictionary has no Hash() method. Use GD.Hash() instead.\n" +"GD.Print(GD.Hash(dict1) == GD.Hash(dict2)); // Prints true\n" +"[/csharp]\n" +"[/codeblocks]\n" +"[b]Note:[/b] Dictionaries with the same entries but in a different order will " +"not have the same hash.\n" +"[b]Note:[/b] Dictionaries with equal hash values are [i]not[/i] guaranteed to " +"be the same, because of hash collisions. On the contrary, dictionaries with " +"different hash values are guaranteed to be different." +msgstr "" +"返回代表该字典内容的 32 位整数哈希值。\n" +"[codeblocks]\n" +"[gdscript]\n" +"var dict1 = {\"A\": 10, \"B\": 2}\n" +"var dict2 = {\"A\": 10, \"B\": 2}\n" +"\n" +"print(dict1.hash() == dict2.hash()) # 输出 true\n" +"[/gdscript]\n" +"[csharp]\n" +"var dict1 = new Godot.Collections.Dictionary{{\"A\", 10}, {\"B\", 2}};\n" +"var dict2 = new Godot.Collections.Dictionary{{\"A\", 10}, {\"B\", 2}};\n" +"\n" +"// Godot.Collections.Dictionary 没有 Hash() 方法。请改用 GD.Hash()。\n" +"GD.Print(GD.Hash(dict1) == GD.Hash(dict2)); // 输出 true\n" +"[/csharp]\n" +"[/codeblocks]\n" +"[b]注意:[/b]如果两个字典条目相同,但顺序不同,则哈希值也不同。\n" +"[b]注意:[/b]哈希值相同的字典[i]不保证[/i]相同,因为可能存在哈希碰撞。相对地," +"哈希值不同的字典保证不同。" + +msgid "" "Returns [code]true[/code] if the dictionary is empty (its size is [code]0[/" "code]). See also [method size]." msgstr "" @@ -30571,6 +32684,97 @@ msgstr "" "使该字典只读,即禁用字典内容的修改。不适用于嵌套内容,例如内嵌字典的内容。" msgid "" +"Adds entries from [param dictionary] to this dictionary. By default, " +"duplicate keys are not copied over, unless [param overwrite] is [code]true[/" +"code].\n" +"[codeblocks]\n" +"[gdscript]\n" +"var dict = { \"item\": \"sword\", \"quantity\": 2 }\n" +"var other_dict = { \"quantity\": 15, \"color\": \"silver\" }\n" +"\n" +"# Overwriting of existing keys is disabled by default.\n" +"dict.merge(other_dict)\n" +"print(dict) # { \"item\": \"sword\", \"quantity\": 2, \"color\": " +"\"silver\" }\n" +"\n" +"# With overwriting of existing keys enabled.\n" +"dict.merge(other_dict, true)\n" +"print(dict) # { \"item\": \"sword\", \"quantity\": 15, \"color\": " +"\"silver\" }\n" +"[/gdscript]\n" +"[csharp]\n" +"var dict = new Godot.Collections.Dictionary\n" +"{\n" +" [\"item\"] = \"sword\",\n" +" [\"quantity\"] = 2,\n" +"};\n" +"\n" +"var otherDict = new Godot.Collections.Dictionary\n" +"{\n" +" [\"quantity\"] = 15,\n" +" [\"color\"] = \"silver\",\n" +"};\n" +"\n" +"// Overwriting of existing keys is disabled by default.\n" +"dict.Merge(otherDict);\n" +"GD.Print(dict); // { \"item\": \"sword\", \"quantity\": 2, \"color\": " +"\"silver\" }\n" +"\n" +"// With overwriting of existing keys enabled.\n" +"dict.Merge(otherDict, true);\n" +"GD.Print(dict); // { \"item\": \"sword\", \"quantity\": 15, \"color\": " +"\"silver\" }\n" +"[/csharp]\n" +"[/codeblocks]\n" +"[b]Note:[/b] [method merge] is [i]not[/i] recursive. Nested dictionaries are " +"considered as keys that can be overwritten or not depending on the value of " +"[param overwrite], but they will never be merged together." +msgstr "" +"将 [param dictionary] 中的条目添加到该字典中。默认情况下,不会复制重复的键,除" +"非 [param overwrite] 为 [code]true[/code]。\n" +"[codeblocks]\n" +"[gdscript]\n" +"var dict = { \"item\": \"sword\", \"quantity\": 2 }\n" +"var other_dict = { \"quantity\": 15, \"color\": \"silver\" }\n" +"\n" +"# 默认情况下禁用覆盖已有键。\n" +"dict.merge(other_dict)\n" +"print(dict) # { \"item\": \"sword\", \"quantity\": 2, \"color\": " +"\"silver\" }\n" +"\n" +"# 启用覆盖已有键。\n" +"dict.merge(other_dict, true)\n" +"print(dict) # { \"item\": \"sword\", \"quantity\": 15, \"color\": " +"\"silver\" }\n" +"[/gdscript]\n" +"[csharp]\n" +"var dict = new Godot.Collections.Dictionary\n" +"{\n" +" [\"item\"] = \"sword\",\n" +" [\"quantity\"] = 2,\n" +"};\n" +"\n" +"var otherDict = new Godot.Collections.Dictionary\n" +"{\n" +" [\"quantity\"] = 15,\n" +" [\"color\"] = \"silver\",\n" +"};\n" +"\n" +"// 默认情况下禁用覆盖已有键。\n" +"dict.Merge(otherDict);\n" +"GD.Print(dict); // { \"item\": \"sword\", \"quantity\": 2, \"color\": " +"\"silver\" }\n" +"\n" +"// 启用覆盖已有键。\n" +"dict.Merge(otherDict, true);\n" +"GD.Print(dict); // { \"item\": \"sword\", \"quantity\": 15, \"color\": " +"\"silver\" }\n" +"[/csharp]\n" +"[/codeblocks]\n" +"[b]注意:[/b][method merge] [i]不[/i]是递归的。嵌套的字典是否可被视为键可以被" +"覆盖,具体取决于 [param overwrite] 的值,但它们永远不会被合并在一起。" + +msgid "" "Returns the number of entries in the dictionary. Empty dictionaries ([code]{ }" "[/code]) always return [code]0[/code]. See also [method is_empty]." msgstr "" @@ -30736,6 +32940,25 @@ msgid "File system" msgstr "文件系统" msgid "" +"Changes the currently opened directory to the one passed as an argument. The " +"argument can be relative to the current directory (e.g. [code]newdir[/code] " +"or [code]../newdir[/code]), or an absolute path (e.g. [code]/tmp/newdir[/" +"code] or [code]res://somedir/newdir[/code]).\n" +"Returns one of the [enum Error] code constants ([constant OK] on success).\n" +"[b]Note:[/b] The new directory must be within the same scope, e.g. when you " +"had opened a directory inside [code]res://[/code], you can't change it to " +"[code]user://[/code] directory. If you need to open a directory in another " +"access scope, use [method open] to create a new instance instead." +msgstr "" +"将当前打开的目录改为作为参数传递的目录。该参数可以是相对于当前目录的(例如 " +"[code]newdir[/code] 或 [code]../newdir[/code]),也可以是绝对路径(例如 " +"[code]/tmp/newdir[/code] 或 [code]res://somedir/newdir[/code])。\n" +"返回 [enum Error] 错误码常量之一(成功时为 [constant OK])。\n" +"[b]注意:[/b]新目录必须在相同范围内,例如当在 [code]res://[/code] 中打开目录" +"时,无法将其更改为 [code]user://[/code] 目录。如果需要在另一个访问范围中打开目" +"录,请使用 [method open] 创建一个新实例。" + +msgid "" "Copies the [param from] file to the [param to] destination. Both arguments " "should be paths to files, either relative or absolute. If the destination " "file exists and is not access-protected, it will be overwritten.\n" @@ -30895,6 +33118,17 @@ msgstr "" "则返回 [code]0[/code]。" msgid "" +"Returns [code]true[/code] if the file system or directory use case sensitive " +"file names.\n" +"[b]Note:[/b] This method is implemented on macOS, Linux (for EXT4 and F2FS " +"filesystems only) and Windows. On other platforms, it always returns " +"[code]true[/code]." +msgstr "" +"如果文件系统或目录使用区分大小写的文件名,则返回 [code]true[/code]。\n" +"[b]注意:[/b]该方法在 macOS、Linux(仅对于 EXT4 和 F2FS 文件系统)和 Windows " +"上实现。在其他平台上,它始终返回 [code]true[/code]。" + +msgid "" "Initializes the stream used to list all files and directories using the " "[method get_next] function, closing the currently opened stream if needed. " "Once the stream has been processed, it should typically be closed with " @@ -31122,9 +33356,9 @@ msgid "" "Reducing the pancake size can help. Setting the size to [code]0[/code] turns " "off the pancaking effect." msgstr "" -"设置定向阴影斑点的大小。 斑点偏移了阴影的相机视锥体的起点,为阴影提供更高的有" -"效深度分辨率。但是,较大的斑点尺寸会导致靠近视锥体边缘的大型物体的阴影出现伪" -"影。减少斑点的大小会有所帮助。将大小设置为 [code]0[/code] 会关闭斑点效果。" +"设置定向阴影圆斑的大小。该圆斑偏移了阴影的相机视锥体的起点,为阴影提供更高的有" +"效深度分辨率。但是,较大的圆斑大小会导致靠近视锥体边缘的大型物体的阴影出现伪" +"影。减少该圆斑的大小会有所帮助。将大小设置为 [code]0[/code] 会关闭该圆斑效果。" msgid "" "The distance from camera to shadow split 1. Relative to [member " @@ -31226,6 +33460,9 @@ msgstr "" msgid "Returns the user's clipboard as a string if possible." msgstr "如果可能,将用户的剪贴板作为字符串返回。" +msgid "Returns the user's clipboard as an image if possible." +msgstr "如果可能,将用户的剪贴板作为图像返回。" + msgid "" "Returns the user's [url=https://unix.stackexchange.com/questions/139191/whats-" "the-difference-between-primary-selection-and-clipboard-buffer]primary[/url] " @@ -31242,6 +33479,15 @@ msgstr "" "序中,通过点击鼠标中键来粘贴该剪贴板数据。\n" "[b]注意:[/b]这个方法只在 Linux(X11)上实现。" +msgid "" +"Returns [code]true[/code] if there is a text content on the user's clipboard." +msgstr "如果用户的剪贴板中有文本内容,则返回 [code]true[/code]。" + +msgid "" +"Returns [code]true[/code] if there is an image content on the user's " +"clipboard." +msgstr "如果用户的剪贴板中有图像内容,则返回 [code]true[/code]。" + msgid "Sets the user's clipboard content to the given string." msgstr "将用户的剪贴板内容设置为给定的字符串。" @@ -31318,6 +33564,34 @@ msgstr "" "[b]注意:[/b]该方法仅在 Windows 上实现。" msgid "" +"Displays OS native dialog for selecting files or directories in the file " +"system.\n" +"Callbacks have the following arguments: [code]bool status, PackedStringArray " +"selected_paths, int selected_filter_index[/code].\n" +"[b]Note:[/b] This method is implemented if the display server has the " +"[constant FEATURE_NATIVE_DIALOG] feature.\n" +"[b]Note:[/b] This method is implemented on Linux, Windows and macOS.\n" +"[b]Note:[/b] [param current_directory] might be ignored.\n" +"[b]Note:[/b] On Linux, [param show_hidden] is ignored.\n" +"[b]Note:[/b] On macOS, native file dialogs have no title.\n" +"[b]Note:[/b] On macOS, sandboxed apps will save security-scoped bookmarks to " +"retain access to the opened folders across multiple sessions. Use [method OS." +"get_granted_permissions] to get a list of saved bookmarks." +msgstr "" +"显示操作系统原生对话框,用于选择文件系统中的文件或目录。\n" +"回调具有以下参数:[code]bool status, PackedStringArray selected_paths, int " +"selected_filter_index[/code]。\n" +"[b]注意:[/b]如果显示服务器具有 [constant FEATURE_NATIVE_DIALOG] 功能,则该方" +"法已被实现。\n" +"[b]注意:[/b]该方法在 Linux、Windows 和 macOS 上实现。\n" +"[b]注意:[/b][param current_directory] 可能会被忽略。\n" +"[b]注意:[/b]在 Linux 上,[param show_hidden] 被忽略。\n" +"[b]注意:[/b]在 macOS 上,原生文件对话框没有标题。\n" +"[b]注意:[/b]在 macOS 上,沙盒应用程序将保存安全范围的书签,以保留对多个会话中" +"打开的文件夹的访问权限。使用 [method OS.get_granted_permissions] 获取已保存书" +"签的列表。" + +msgid "" "Forces window manager processing while ignoring all [InputEvent]s. See also " "[method process_events].\n" "[b]Note:[/b] This method is implemented on Windows and macOS." @@ -31389,6 +33663,20 @@ msgid "Returns index of the screen which contains specified rectangle." msgstr "返回包含指定矩形的屏幕的索引。" msgid "" +"Returns [code]true[/code] if positions of [b]OK[/b] and [b]Cancel[/b] buttons " +"are swapped in dialogs. This is enabled by default on Windows to follow " +"interface conventions, and be toggled by changing [member ProjectSettings.gui/" +"common/swap_cancel_ok].\n" +"[b]Note:[/b] This doesn't affect native dialogs such as the ones spawned by " +"[method DisplayServer.dialog_show]." +msgstr "" +"如果对话框中的[b]确定[/b]和[b]取消[/b]按钮进行了交换,则返回 [code]true[/" +"code]。在 Windows 上默认启用,从而遵循界面规范,可以使用 [member " +"ProjectSettings.gui/common/swap_cancel_ok] 开关。\n" +"[b]注意:[/b]由 [method DisplayServer.dialog_show] 等生成的原生对话框不受影" +"响。" + +msgid "" "Returns the ID of the window at the specified screen [param position] (in " "pixels). On multi-monitor setups, the screen position is relative to the " "virtual desktop area. On multi-monitor setups with different screen " @@ -31900,6 +34188,16 @@ msgstr "" "[b]注意:[/b]该方法仅在 macOS 上实现。" msgid "" +"Returns [code]true[/code] if the item at index [param idx] is hidden.\n" +"See [method global_menu_set_item_hidden] for more info on how to hide an " +"item.\n" +"[b]Note:[/b] This method is implemented only on macOS." +msgstr "" +"如果索引为 [param idx] 的菜单项被隐藏,则返回 [code]true[/code]。\n" +"关于如何隐藏菜单项的更多信息见 [method global_menu_set_item_hidden]。\n" +"[b]注意:[/b]该方法仅在 macOS 上实现。" + +msgid "" "Returns [code]true[/code] if the item at index [param idx] has radio button-" "style checkability.\n" "[b]Note:[/b] This is purely cosmetic; you must add the logic for checking/" @@ -31971,6 +34269,28 @@ msgstr "" "[b]注意:[/b]该方法仅在 macOS 上实现。" msgid "" +"Hides/shows the item at index [param idx]. When it is hidden, an item does " +"not appear in a menu and its action cannot be invoked.\n" +"[b]Note:[/b] This method is implemented only on macOS." +msgstr "" +"隐藏/显示索引为 [param idx] 的菜单项。当它被隐藏时,项目不会出现在菜单中,并且" +"无法调用其操作。\n" +"[b]注意:[/b]该方法仅在 macOS 上实现。" + +msgid "" +"Sets the callback of the item at index [param idx]. The callback is emitted " +"when an item is hovered.\n" +"[b]Note:[/b] The [param callback] Callable needs to accept exactly one " +"Variant parameter, the parameter passed to the Callable will be the value " +"passed to the [code]tag[/code] parameter when the menu item was created.\n" +"[b]Note:[/b] This method is implemented only on macOS." +msgstr "" +"设置索引为 [param idx] 的菜单项的回调。回调会在菜单项被悬停时发出。\n" +"[b]注意:[/b][param callback] Callable 需要接受一个 Variant 参数,传入 " +"Callable 的参数是创建菜单项时传给 [code]tag[/code] 参数的值。\n" +"[b]注意:[/b]该方法仅在 macOS 上实现。" + +msgid "" "Replaces the [Texture2D] icon of the specified [param idx].\n" "[b]Note:[/b] This method is implemented only on macOS.\n" "[b]Note:[/b] This method is not supported by macOS \"_dock\" menu items." @@ -32061,6 +34381,11 @@ msgstr "" "[b]注意:[/b]该方法仅在 macOS 上实现。" msgid "" +"Registers callables to emit when the menu is respectively about to show or " +"closed." +msgstr "注册当菜单分别即将显示或关闭时发出的可调用对象。" + +msgid "" "Returns [code]true[/code] if the specified [param feature] is supported by " "the current [DisplayServer], [code]false[/code] otherwise." msgstr "" @@ -32089,6 +34414,22 @@ msgstr "" "[b]注意:[/b]该方法仅在 macOS 上实现。" msgid "" +"Returns [code]true[/code] if OS is using dark mode.\n" +"[b]Note:[/b] This method is implemented on Android, iOS, macOS, Windows, and " +"Linux (X11)." +msgstr "" +"如果操作系统正在使用暗黑模式,则返回 [code]true[/code]。\n" +"[b]注意:[/b]该方法在 Android、iOS、macOS、Windows 和 Linux(X11)上实现。" + +msgid "" +"Returns [code]true[/code] if OS supports dark mode.\n" +"[b]Note:[/b] This method is implemented on Android, iOS, macOS, Windows, and " +"Linux (X11)." +msgstr "" +"如果操作系统支持暗黑模式,则返回 [code]true[/code]。\n" +"[b]注意:[/b]该方法在 Android、iOS、macOS、Windows 和 Linux(X11)上实现。" + +msgid "" "Returns [code]true[/code] if touch events are available (Android or iOS), the " "capability is detected on the Web platform or if [member ProjectSettings." "input_devices/pointing/emulate_touch_from_mouse] is [code]true[/code]." @@ -32113,6 +34454,15 @@ msgstr "" "[b]注意:[/b]本方法在 Linux(X11)、macOS 和 Windows 上实现。" msgid "" +"Converts a physical (US QWERTY) [param keycode] to localized label printed on " +"the key in the active keyboard layout.\n" +"[b]Note:[/b] This method is implemented on Linux (X11), macOS and Windows." +msgstr "" +"将物理(美式 QWERTY)键码 [param keycode] 转换为活动键盘布局中的按键上印刷的本" +"地化标签。\n" +"[b]注意:[/b]该方法在 Linux(X11)、macOS 和 Windows 上实现。" + +msgid "" "Returns the number of keyboard layouts.\n" "[b]Note:[/b] This method is implemented on Linux (X11), macOS and Windows." msgstr "" @@ -32403,6 +34753,42 @@ msgstr "" "[b]注意:[/b]该方法仅在 Windows 上实现。" msgid "" +"Returns an [Array] of voice information dictionaries.\n" +"Each [Dictionary] contains two [String] entries:\n" +"- [code]name[/code] is voice name.\n" +"- [code]id[/code] is voice identifier.\n" +"- [code]language[/code] is language code in [code]lang_Variant[/code] format. " +"The [code]lang[/code] part is a 2 or 3-letter code based on the ISO-639 " +"standard, in lowercase. The [code skip-lint]Variant[/code] part is an engine-" +"dependent string describing country, region or/and dialect.\n" +"Note that Godot depends on system libraries for text-to-speech functionality. " +"These libraries are installed by default on Windows and macOS, but not on all " +"Linux distributions. If they are not present, this method will return an " +"empty list. This applies to both Godot users on Linux, as well as end-users " +"on Linux running Godot games that use text-to-speech.\n" +"[b]Note:[/b] This method is implemented on Android, iOS, Web, Linux (X11), " +"macOS, and Windows.\n" +"[b]Note:[/b] [member ProjectSettings.audio/general/text_to_speech] should be " +"[code]true[/code] to use text-to-speech." +msgstr "" +"返回语音信息字典的 [Array]。\n" +"每个 [Dictionary] 包含两个 [String] 条目:\n" +"- [code]name[/code] 是语音名称。\n" +"- [code]id[/code] 是语音标识符。\n" +"- [code]language[/code] 是语言代码,格式为 [code]lang_Variant[/code] 。" +"[code]lang[/code] 部分是小写的基于 ISO-639 标准的 2 或 3 字母代码。而 [code " +"skip-lint]Variant[/code] 部分是一个依赖于引擎的字符串,描述国家、地区或/和方" +"言。\n" +"请注意,Godot 依赖于系统库来实现文本到语音的功能。这些库在 Windows 和 MacOS 上" +"是默认安装的,但并非安装在所有 Linux 发行版上。如果它们不存在,此方法将返回一" +"个空列表。这适用于 Linux 上的 Godot 用户,以及在 Linux 上运行使用文本到语音的 " +"Godot 游戏的最终用户。\n" +"[b]注意:[/b]这个方法在 Android、iOS、Web、Linux(X11)、macOS 和 Windows 上实" +"现。\n" +"[b]注意:[/b][member ProjectSettings.audio/general/text_to_speech] 应当为 " +"[code]true[/code] 才能够使用文本到语音功能。" + +msgid "" "Returns an [PackedStringArray] of voice identifiers for the [param " "language].\n" "[b]Note:[/b] This method is implemented on Android, iOS, Web, Linux (X11), " @@ -32701,6 +35087,16 @@ msgstr "" "返回窗口的大小(单位为像素),包含操作系统绘制的边框,该窗口由 [param " "window_id] 指定。另见 [method window_get_size]。" +msgid "" +"Returns the estimated window title bar size (including text and window " +"buttons) for the window specified by [param window_id] (in pixels). This " +"method does not change the window title.\n" +"[b]Note:[/b] This method is implemented on macOS and Windows." +msgstr "" +"返回由 [param window_id] 指定的窗口的估计窗口标题栏大小(包括文本和窗口按钮)" +"(单位:像素)。该方法不会更改窗口标题。\n" +"[b]注意:[/b]该方法在 macOS 和 Windows 上实现。" + msgid "Returns the V-Sync mode of the given window." msgstr "返回给定窗口的垂直同步模式。" @@ -32754,6 +35150,21 @@ msgstr "" "[method window_get_current_screen]。" msgid "" +"Sets the [param callback] that should be called when files are dropped from " +"the operating system's file manager to the window specified by [param " +"window_id].\n" +"[b]Warning:[/b] Advanced users only! Adding such a callback to a [Window] " +"node will override its default implementation, which can introduce bugs.\n" +"[b]Note:[/b] This method is implemented on Windows, macOS, Linux (X11) and " +"Web." +msgstr "" +"设置回调 [param callback],将文件从操作系统的文件管理器拖放到由 [param " +"window_id] 指定的窗口中时会进行调用。\n" +"[b]警告:[/b]仅限高级用户!将这样的回调添加到 [Window] 节点将覆盖其默认实现," +"这可能会引入错误。\n" +"[b]注意:[/b]这个方法在 Windows、macOS、Linux(X11)、Web 上实现。" + +msgid "" "If set to [code]true[/code], this window will always stay on top of its " "parent window, parent window will ignore input while this window is opened.\n" "[b]Note:[/b] On macOS, exclusive windows are confined to the same space " @@ -32793,6 +35204,28 @@ msgstr "" "window_id] 的 [method window_set_ime_active] 为 [code]true[/code] 时有效。" msgid "" +"Sets the [param callback] that should be called when any [InputEvent] is sent " +"to the window specified by [param window_id].\n" +"[b]Warning:[/b] Advanced users only! Adding such a callback to a [Window] " +"node will override its default implementation, which can introduce bugs." +msgstr "" +"设置回调 [param callback],向由 [param window_id] 指定的窗口发送任何 " +"[InputEvent] 时会进行回调。\n" +"[b]警告:[/b]仅限高级用户!将这样的回调添加到 [Window] 节点将覆盖其默认实现," +"这可能会引入错误。" + +msgid "" +"Sets the [param callback] that should be called when text is entered using " +"the virtual keyboard to the window specified by [param window_id].\n" +"[b]Warning:[/b] Advanced users only! Adding such a callback to a [Window] " +"node will override its default implementation, which can introduce bugs." +msgstr "" +"设置回调 [param callback],使用虚拟键盘向由 [param window_id] 指定的窗口输入文" +"本时会进行回调。\n" +"[b]警告:[/b]仅限高级用户!将这样的回调添加到 [Window] 节点将覆盖其默认实现," +"这可能会引入错误。" + +msgid "" "Sets the maximum size of the window specified by [param window_id] in pixels. " "Normally, the user will not be able to drag the window to make it smaller " "than the specified size. See also [method window_get_max_size].\n" @@ -32940,6 +35373,17 @@ msgstr "" "[b]注意:[/b]建议改用 [member Window.position] 更改此值。" msgid "" +"Sets the [param callback] that will be called when the window specified by " +"[param window_id] is moved or resized.\n" +"[b]Warning:[/b] Advanced users only! Adding such a callback to a [Window] " +"node will override its default implementation, which can introduce bugs." +msgstr "" +"设置回调 [param callback],由 [param window_id] 指定的窗口发生移动或调整大小时" +"会进行回调。\n" +"[b]警告:[/b]仅限高级用户!将这样的回调添加到 [Window] 节点将覆盖其默认实现," +"这可能会引入错误。" + +msgid "" "Sets the size of the given window to [param size] (in pixels). See also " "[method window_get_size] and [method window_get_position].\n" "[b]Note:[/b] It's recommended to change this value using [member Window.size] " @@ -33005,6 +35449,17 @@ msgstr "" "[b]注意:[/b]这个标志仅在 macOS 上实现。" msgid "" +"Sets the [param callback] that will be called when an event occurs in the " +"window specified by [param window_id].\n" +"[b]Warning:[/b] Advanced users only! Adding such a callback to a [Window] " +"node will override its default implementation, which can introduce bugs." +msgstr "" +"设置回调 [param callback],由 [param window_id] 指定的窗口发生事件时会进行回" +"调。\n" +"[b]警告:[/b]仅限高级用户!将这样的回调添加到 [Window] 节点将覆盖其默认实现," +"这可能会引入错误。" + +msgid "" "Display server supports global menu. This allows the application to display " "its menu items in the operating system's top bar. [b]macOS[/b]" msgstr "" @@ -33387,6 +35842,23 @@ msgstr "" msgid "Represents the size of the [enum CursorShape] enum." msgstr "代表 [enum CursorShape] 枚举的大小。" +msgid "The native file dialog allows selecting one, and only one file." +msgstr "该原生对话框只允许选择一个文件。" + +msgid "The native file dialog allows selecting multiple files." +msgstr "该原生对话框允许选择多个文件。" + +msgid "" +"The native file dialog only allows selecting a directory, disallowing the " +"selection of any file." +msgstr "该原生对话框只允许选择一个目录,不允许选择任何文件。" + +msgid "The native file dialog allows selecting one file or directory." +msgstr "该原生对话框允许选择一个文件或目录。" + +msgid "The native file dialog will warn when a file exists." +msgstr "当文件存在时,原生对话框会发出警告。" + msgid "" "Windowed mode, i.e. [Window] doesn't occupy the whole screen (unless set to " "the size of the screen)." @@ -33408,6 +35880,56 @@ msgstr "" "常发生在按下最大化按钮时。" msgid "" +"Full screen mode with full multi-window support.\n" +"Full screen window covers the entire display area of a screen and has no " +"decorations. The display's video mode is not changed.\n" +"[b]On Windows:[/b] Multi-window full-screen mode has a 1px border of the " +"[member ProjectSettings.rendering/environment/defaults/default_clear_color] " +"color.\n" +"[b]On macOS:[/b] A new desktop is used to display the running project.\n" +"[b]Note:[/b] Regardless of the platform, enabling full screen will change the " +"window size to match the monitor's size. Therefore, make sure your project " +"supports [url=$DOCS_URL/tutorials/rendering/multiple_resolutions." +"html]multiple resolutions[/url] when enabling full screen mode." +msgstr "" +"具有完整多窗口支持的全屏模式。\n" +"全屏窗口覆盖屏幕的整个显示区域,且没有任何装饰。显示的视频模式没有更改。\n" +"[b]在 Windows 上:[/b]多窗口全屏模式具有 1px 宽的颜色为 [member " +"ProjectSettings.rendering/environment/defaults/default_clear_color] 的边框。\n" +"[b]在 macOS 上:[/b]使用新桌面来显示正在运行的项目。\n" +"[b]注意:[/b]无论平台如何,启用全屏都会更改窗口大小以匹配显示器的大小。因此," +"请确保你的项目在启用全屏模式时支持[url=$DOCS_URL/tutorials/rendering/" +"multiple_resolutions.html]多种分辨率[/url]。" + +msgid "" +"A single window full screen mode. This mode has less overhead, but only one " +"window can be open on a given screen at a time (opening a child window or " +"application switching will trigger a full screen transition).\n" +"Full screen window covers the entire display area of a screen and has no " +"border or decorations. The display's video mode is not changed.\n" +"[b]On Windows:[/b] Depending on video driver, full screen transition might " +"cause screens to go black for a moment.\n" +"[b]On macOS:[/b] A new desktop is used to display the running project. " +"Exclusive full screen mode prevents Dock and Menu from showing up when the " +"mouse pointer is hovering the edge of the screen.\n" +"[b]On Linux (X11):[/b] Exclusive full screen mode bypasses compositor.\n" +"[b]Note:[/b] Regardless of the platform, enabling full screen will change the " +"window size to match the monitor's size. Therefore, make sure your project " +"supports [url=$DOCS_URL/tutorials/rendering/multiple_resolutions." +"html]multiple resolutions[/url] when enabling full screen mode." +msgstr "" +"单窗口全屏模式。这种模式开销较小,但一次只能在给定屏幕上打开一个窗口(打开子窗" +"口或切换应用程序会触发全屏过渡)。\n" +"全屏窗口会覆盖屏幕的整个显示区域,没有边框或装饰。显示视频模式没有改变。\n" +"[b]在 Windows 上:[/b]取决于视频驱动程序,全屏过渡可能会导致屏幕暂时变黑。\n" +"[b]在 macOS 上:[/b]一个新的桌面用于显示正在运行的项目。当鼠标指针悬停在屏幕边" +"缘时,独占全屏模式会阻止 Dock 和 Menu 出现。\n" +"[b]在 Linux(X11)上:[/b]独占全屏模式会绕过合成器。\n" +"[b]注意:[/b]无论平台如何,启用全屏都会更改窗口大小以匹配显示器的大小。因此," +"确保你的项目在启用全屏模式时支持[url=$DOCS_URL/tutorials/rendering/" +"multiple_resolutions.html]多个分辨率[/url]。" + +msgid "" "The window can't be resized by dragging its resize grip. It's still possible " "to resize the window using [method window_set_size]. This flag is ignored for " "full screen windows." @@ -33482,6 +36004,93 @@ msgstr "所有鼠标事件都被传递到同一应用程序的底层窗口。" msgid "Max value of the [enum WindowFlags]." msgstr "[enum WindowFlags] 的最大值。" +msgid "Sent when the mouse pointer enters the window." +msgstr "当鼠标指针进入该窗口时发送。" + +msgid "Sent when the mouse pointer exits the window." +msgstr "当鼠标指针退出该窗口时发送。" + +msgid "Sent when the window grabs focus." +msgstr "当窗口获得焦点时发送。" + +msgid "Sent when the window loses focus." +msgstr "当窗口失去焦点时发送。" + +msgid "" +"Sent when the user has attempted to close the window (e.g. close button is " +"pressed)." +msgstr "当用户试图关闭该窗口时发送(例如按下关闭按钮)。" + +msgid "" +"Sent when the device \"Back\" button is pressed.\n" +"[b]Note:[/b] This event is implemented only on Android." +msgstr "" +"当按下设备的“后退”按钮时发送。\n" +"[b]注意:[/b]该事件仅在 Android 上实现。" + +msgid "" +"Sent when the window is moved to the display with different DPI, or display " +"DPI is changed.\n" +"[b]Note:[/b] This flag is implemented only on macOS." +msgstr "" +"当窗口被移动到具有不同 DPI 的显示器上,或者显示器的 DPI 更改时发送。\n" +"[b]注意:[/b]该标志仅在 macOS 上实现。" + +msgid "" +"Sent when the window title bar decoration is changed (e.g. [constant " +"WINDOW_FLAG_EXTEND_TO_TITLE] is set or window entered/exited full screen " +"mode).\n" +"[b]Note:[/b] This flag is implemented only on macOS." +msgstr "" +"当窗口标题栏的装饰改变时发送(例如 [constant WINDOW_FLAG_EXTEND_TO_TITLE] 被设" +"置或窗口进入/退出全屏模式)。\n" +"[b]注意:[/b]该标志仅在 macOS 上实现。" + +msgid "" +"No vertical synchronization, which means the engine will display frames as " +"fast as possible (tearing may be visible). Framerate is unlimited " +"(notwithstanding [member Engine.max_fps])." +msgstr "" +"没有垂直同步,这意味着引擎将尽可能快地显示帧(可能会有可见的撕裂)。帧速率是未" +"限制的(不考虑 [member Engine.max_fps])。" + +msgid "" +"Default vertical synchronization mode, the image is displayed only on " +"vertical blanking intervals (no tearing is visible). Framerate is limited by " +"the monitor refresh rate (notwithstanding [member Engine.max_fps])." +msgstr "" +"默认的垂直同步模式,图像只在垂直消隐间隔显示(没有可见的撕裂)。帧速率受显示器" +"刷新率的限制(不考虑 [member Engine.max_fps])。" + +msgid "" +"Behaves like [constant VSYNC_DISABLED] when the framerate drops below the " +"screen's refresh rate to reduce stuttering (tearing may be visible). " +"Otherwise, vertical synchronization is enabled to avoid tearing. Framerate is " +"limited by the monitor refresh rate (notwithstanding [member Engine." +"max_fps]). Behaves like [constant VSYNC_ENABLED] when using the Compatibility " +"rendering method." +msgstr "" +"当帧速率降至屏幕刷新率以下以减少卡顿(可能有可见的撕裂)时,行为类似于 " +"[constant VSYNC_DISABLED]。否则,启用垂直同步以避免撕裂。帧速率受显示器刷新率" +"的限制(不考虑 [member Engine.max_fps])。使用兼容渲染方法时表现得像 " +"[constant VSYNC_ENABLED]。" + +msgid "" +"Displays the most recent image in the queue on vertical blanking intervals, " +"while rendering to the other images (no tearing is visible). Framerate is " +"unlimited (notwithstanding [member Engine.max_fps]).\n" +"Although not guaranteed, the images can be rendered as fast as possible, " +"which may reduce input lag (also called \"Fast\" V-Sync mode). [constant " +"VSYNC_MAILBOX] works best when at least twice as many frames as the display " +"refresh rate are rendered. Behaves like [constant VSYNC_ENABLED] when using " +"the Compatibility rendering method." +msgstr "" +"在垂直消隐间隔显示队列中的最新图像,同时对其他图像渲染(没有可见的撕裂)。帧速" +"率是未限制的(不考虑 [member Engine.max_fps])。\n" +"虽然不能保证,但可以尽可能快地渲染图像,这可能会减少输入滞后(也称为“快速”V-" +"Sync 模式)。[constant VSYNC_MAILBOX] 在渲染的帧数至少是显示器刷新率的两倍时效" +"果最佳。使用兼容渲染方法时表现得像 [constant VSYNC_ENABLED]。" + msgid "" "Display handle:\n" "- Linux (X11): [code]X11::Display*[/code] for the display.\n" @@ -33518,6 +36127,23 @@ msgstr "" "- macOS:窗口主视图的 [code]NSView*[/code]。\n" "- iOS:窗口主视图的 [code]UIView*[/code]。" +msgid "" +"OpenGL context (only with the GL Compatibility renderer):\n" +"- Windows: [code]HGLRC[/code] for the window (native GL), or " +"[code]EGLContext[/code] for the window (ANGLE).\n" +"- Linux: [code]GLXContext*[/code] for the window.\n" +"- macOS: [code]NSOpenGLContext*[/code] for the window (native GL), or " +"[code]EGLContext[/code] for the window (ANGLE).\n" +"- Android: [code]EGLContext[/code] for the window." +msgstr "" +"OpenGL 上下文(仅适用于 GL 兼容性渲染器):\n" +"- Windows:窗口的 [code]HGLRC[/code](原生 GL)或窗口的 [code]EGLContext[/" +"code](ANGLE)。\n" +"- Linux:窗口的 [code]GLXContext*[/code]。\n" +"- macOS:窗口的 [code]NSOpenGLContext*[/code](原生 GL)或窗口的 " +"[code]EGLContext[/code](ANGLE)。\n" +"- Android:窗口的 [code]EGLContext[/code]。" + msgid "Utterance has begun to be spoken." msgstr "发言开始。" @@ -33866,6 +36492,54 @@ msgid "Godot editor's command palette." msgstr "Godot 编辑器的命令面板。" msgid "" +"Object that holds all the available Commands and their shortcuts text. These " +"Commands can be accessed through [b]Editor > Command Palette[/b] menu.\n" +"Command key names use slash delimiters to distinguish sections, for example: " +"[code]\"example/command1\"[/code] then [code]example[/code] will be the " +"section name.\n" +"[codeblocks]\n" +"[gdscript]\n" +"var command_palette = EditorInterface.get_command_palette()\n" +"# external_command is a function that will be called with the command is " +"executed.\n" +"var command_callable = Callable(self, \"external_command\").bind(arguments)\n" +"command_palette.add_command(\"command\", \"test/command\",command_callable)\n" +"[/gdscript]\n" +"[csharp]\n" +"EditorCommandPalette commandPalette = EditorInterface.Singleton." +"GetCommandPalette();\n" +"// ExternalCommand is a function that will be called with the command is " +"executed.\n" +"Callable commandCallable = new Callable(this, MethodName.ExternalCommand);\n" +"commandPalette.AddCommand(\"command\", \"test/command\", commandCallable)\n" +"[/csharp]\n" +"[/codeblocks]\n" +"[b]Note:[/b] This class shouldn't be instantiated directly. Instead, access " +"the singleton using [method EditorInterface.get_command_palette]." +msgstr "" +"该对象包含所有可用命令及其快捷方式文本。这些命令可以通过 [b]Editor > 命令面板" +"[/b] 菜单访问。\n" +"命令键名使用斜杠分隔符来区分部分,例如:[code]\"example/command1\"[/code],那" +"么 [code]example[/code] 将是部分名称。\n" +"[codeblocks]\n" +"[gdscript]\n" +"var command_palette = EditorInterface.get_command_palette()\n" +"# external_command 是将在命令执行时调用的函数。\n" +"var command_callable = Callable(self, \"external_command\").bind(arguments)\n" +"command_palette.add_command(\"command\", \"test/command\",command_callable)\n" +"[/gdscript]\n" +"[csharp]\n" +"EditorCommandPalette commandPalette = EditorInterface.Singleton." +"GetCommandPalette();\n" +"// ExternalCommand 是将在命令执行时调用的函数。\n" +"Callable commandCallable = new Callable(this, MethodName.ExternalCommand);\n" +"commandPalette.AddCommand(\"command\", \"test/command\", commandCallable)\n" +"[/csharp]\n" +"[/codeblocks]\n" +"[b]注意:[/b]不应直接实例化此类。相反,使用 [method EditorInterface." +"get_command_palette] 访问单例。" + +msgid "" "Adds a custom command to EditorCommandPalette.\n" "- [param command_name]: [String] (Name of the [b]Command[/b]. This is " "displayed to the user.)\n" @@ -34122,12 +36796,25 @@ msgstr "" msgid "$DOCS_URL/tutorials/platform/consoles.html" msgstr "$DOCS_URL/tutorials/platform/consoles.html" +msgid "" +"Returns the name of the export operating system handled by this " +"[EditorExportPlatform] class, as a friendly string. Possible return values " +"are [code]Windows[/code], [code]Linux[/code], [code]macOS[/code], " +"[code]Android[/code], [code]iOS[/code], and [code]Web[/code]." +msgstr "" +"以友好字符串的形式,返回由该 [EditorExportPlatform] 类处理的导出操作系统的名" +"称。可能的返回值为 [code]Windows[/code]、[code]Linux[/code]、[code]macOS[/" +"code]、[code]Android[/code]、[code]iOS[/code]、和 [code]Web[/code]。" + msgid "Exporter for Android." msgstr "适用于 Android 的导出器。" msgid "Exporting for Android" msgstr "为 Android 导出" +msgid "Gradle builds for Android" +msgstr "适用于 Android 的 Gradle 构建" + msgid "Android plugins documentation index" msgstr "Android 插件文档索引" @@ -34298,6 +36985,23 @@ msgid "" msgstr "" "如果为 [code]true[/code],当用户卸载应用程序时,将显示保留应用程序数据的提示。" +msgid "" +"If [code]true[/code], the user will be able to set this app as the system " +"launcher in Android preferences." +msgstr "" +"如果为 [code]true[/code],用户将能够在 Android 首选项中将该应用程序设置为系统" +"启动器。" + +msgid "If [code]true[/code], this app will show in Android TV launcher UI." +msgstr "如果为 [code]true[/code],该应用将显示在 Android TV 启动器 UI 中。" + +msgid "" +"If [code]true[/code], this app will show in the device's app library.\n" +"[b]Note:[/b] This is [code]true[/code] by default." +msgstr "" +"如果为 [code]true[/code],则该应用程序将显示在设备的应用程序库中。\n" +"[b]注意:[/b]默认情况下为 [code]true[/code]。" + msgid "If [code]true[/code], package signing is enabled." msgstr "如果为 [code]true[/code],则包签名被启用。" @@ -35408,6 +38112,13 @@ msgid "" msgstr "" "机器可读的应用程序版本。每向 Play Store 推送一个新版本,该版本都必须递增。" +msgid "" +"Application version visible to the user. Falls back to [member " +"ProjectSettings.application/config/version] if left empty." +msgstr "" +"用户可见的应用程序版本。如果留空,则将回退到 [member ProjectSettings." +"application/config/version]。" + msgid "Exporter for iOS." msgstr "iOS 导出器。" @@ -35445,6 +38156,18 @@ msgstr "应用程序分发目标(调试导出)。" msgid "Application distribution target (release export)." msgstr "应用程序分发目标(发布导出)。" +msgid "" +"If [code]true[/code], exports iOS project files without building an XCArchive " +"or [code].ipa[/code] file. If [code]false[/code], exports iOS project files " +"and builds an XCArchive and [code].ipa[/code] file at the same time. When " +"combining Godot with Fastlane or other build pipelines, you may want to set " +"this to [code]true[/code]." +msgstr "" +"如果为 [code]true[/code],则导出 iOS 项目文件而不构建一份 XCArchive 或 [code]." +"ipa[/code] 文件。如果为 [code]false[/code],则导出 iOS 项目文件并同时构建一份 " +"XCArchive 和 [code].ipa[/code] 文件。将 Godot 与 Fastlane 或其他构建管道结合使" +"用时,你可能需要将其设置为 [code]true[/code]。" + msgid "Interpolation method used to resize application icon." msgstr "用于调整应用程序图标大小的插值方法。" @@ -35478,6 +38201,15 @@ msgstr "" "可以使用环境变量 [code]GODOT_IOS_PROVISIONING_PROFILE_UUID_RELEASE[/code] 覆" "盖。" +msgid "" +"Application version visible to the user, can only contain numeric characters " +"([code]0-9[/code]) and periods ([code].[/code]). Falls back to [member " +"ProjectSettings.application/config/version] if left empty." +msgstr "" +"用户可见的应用程序版本,只能包含数字字符([code]0-9[/code])和句点([code].[/" +"code])。如果留空,则回退到 [member ProjectSettings.application/config/" +"version]。" + msgid "A four-character creator code that is specific to the bundle. Optional." msgstr "特定于该捆绑包的四字符创建者码。可选的。" @@ -35485,6 +38217,16 @@ msgid "Supported device family." msgstr "支持的设备家族。" msgid "" +"Machine-readable application version, in the [code]major.minor.patch[/code] " +"format, can only contain numeric characters ([code]0-9[/code]) and periods " +"([code].[/code]). This must be incremented on every new release pushed to the " +"App Store." +msgstr "" +"机器可读的应用程序版本,采用 [code]major.minor.patch[/code] 格式,只能包含数字" +"字符([code]0-9[/code])和句点([code].[/code])。该值必须在被推送到 App " +"Store 的每个新版本中递增。" + +msgid "" "If [code]true[/code], networking features related to Wi-Fi access are " "enabled. See [url=https://developer.apple.com/support/required-device-" "capabilities/]Required Device Capabilities[/url]." @@ -35826,6 +38568,16 @@ msgid "Copyright notice for the bundle visible to the user (localized)." msgstr "捆绑包的(本地化)版权声明,用户可见。" msgid "" +"If set to [code]1[/code], ANGLE libraries are exported with the exported " +"application. If set to [code]0[/code], ANGLE libraries are exported only if " +"[member ProjectSettings.rendering/gl_compatibility/driver] is set to " +"[code]\"opengl3_angle\"[/code]." +msgstr "" +"如果设置为 [code]1[/code],ANGLE 库将随导出的应用程序一起导出。如果设置为 " +"[code]0[/code],则仅当 [member ProjectSettings.rendering/gl_compatibility/" +"driver] 被设置为 [code]\"opengl3_angle\"[/code] 时才会导出 ANGLE 库。" + +msgid "" "Application icon file. If left empty, it will fallback to [member " "ProjectSettings.application/config/macos_native_icon], and then to [member " "ProjectSettings.application/config/icon]." @@ -35879,6 +38631,20 @@ msgid "" msgstr "要额外传给代码签名工具的命令行参数的数组。" msgid "" +"Enable to allow access to contacts in the user's address book, if it's " +"enabled you should also provide usage message in the [member privacy/" +"address_book_usage_description] option. See [url=https://developer.apple.com/" +"documentation/bundleresources/entitlements/com_apple_security_personal-" +"information_addressbook]com.apple.security.personal-information.addressbook[/" +"url]." +msgstr "" +"启用后允许访问用户地址簿中的联系人,如果启用,还应该在 [member privacy/" +"address_book_usage_description] 选项中提供用途信息。请参阅 [url=https://" +"developer.apple.com/documentation/bundleresources/entitlements/" +"com_apple_security_personal-information_addressbook]com.apple.security." +"personal-information.addressbook[/url]。" + +msgid "" "Allows app to use dynamic linker environment variables to inject code. If you " "are using add-ons with dynamic or self-modifying native code, enable them " "according to the add-on documentation. See [url=https://developer.apple.com/" @@ -35999,6 +38765,17 @@ msgstr "" "pictures.read-write[/url]。" msgid "" +"Allows read or write access to the locations the user has selected using a " +"native file dialog. See [url=https://developer.apple.com/documentation/" +"bundleresources/entitlements/com_apple_security_files_user-selected_read-" +"write]com.apple.security.files.user-selected.read-write[/url]." +msgstr "" +"允许对用户使用原生文件对话框选择的位置进行读或写访问。请参阅 [url=https://" +"developer.apple.com/documentation/bundleresources/entitlements/" +"com_apple_security_files_user-selected_read-write]com.apple.security.files." +"user-selected.read-write[/url]。" + +msgid "" "List of helper executables to embedded to the app bundle. Sandboxed app are " "limited to execute only these executable. See [url=https://developer.apple." "com/documentation/xcode/embedding-a-helper-tool-in-a-sandboxed-app]Embedding " @@ -36038,6 +38815,43 @@ msgstr "" "apple-events[/url]。" msgid "" +"Enable if you need to use the microphone or other audio input sources, if " +"it's enabled you should also provide usage message in the [member privacy/" +"microphone_usage_description] option. See [url=https://developer.apple.com/" +"documentation/bundleresources/entitlements/com_apple_security_device_audio-" +"input]com.apple.security.device.audio-input[/url]." +msgstr "" +"需要使用麦克风或其他音频输入源时启用,启用时还应在 [member privacy/" +"microphone_usage_description] 选项中提供用途信息。请参阅 [url=https://" +"developer.apple.com/documentation/bundleresources/entitlements/" +"com_apple_security_device_audio-input]com.apple.security.device.audio-input[/" +"url]。" + +msgid "" +"Enable to allow access to the user's calendar, if it's enabled you should " +"also provide usage message in the [member privacy/calendar_usage_description] " +"option. See [url=https://developer.apple.com/documentation/bundleresources/" +"entitlements/com_apple_security_personal-information_calendars]com.apple." +"security.personal-information.calendars[/url]." +msgstr "" +"启用后允许访问用户的日历,启用时还应在 [member privacy/" +"calendar_usage_description] 选项中提供用途信息。请参阅 [url=https://developer." +"apple.com/documentation/bundleresources/entitlements/" +"com_apple_security_personal-information_calendars]com.apple.security.personal-" +"information.calendars[/url]。" + +msgid "" +"Enable if you need to use the camera, if it's enabled you should also provide " +"usage message in the [member privacy/camera_usage_description] option. See " +"[url=https://developer.apple.com/documentation/bundleresources/entitlements/" +"com_apple_security_device_camera]com.apple.security.device.camera[/url]." +msgstr "" +"需要使用相机时启用,启用时还应在 [member privacy/camera_usage_description] 选" +"项中提供用途信息。请参阅 [url=https://developer.apple.com/documentation/" +"bundleresources/entitlements/com_apple_security_device_camera]com.apple." +"security.device.camera[/url]。" + +msgid "" "Custom entitlements [code].plist[/code] file, if specified the rest of " "entitlements in the export config are ignored." msgstr "" @@ -36070,6 +38884,33 @@ msgstr "" "library-validation]com.apple.security.cs.disable-library-validation[/url]。" msgid "" +"Enable if you need to use location information from Location Services, if " +"it's enabled you should also provide usage message in the [member privacy/" +"location_usage_description] option. See [url=https://developer.apple.com/" +"documentation/bundleresources/entitlements/com_apple_security_personal-" +"information_location]com.apple.security.personal-information.location[/url]." +msgstr "" +"需要使用位置服务中的位置信息时启用,启用时还应在 [member privacy/" +"location_usage_description] 选项中提供用途信息。请参阅 [url=https://developer." +"apple.com/documentation/bundleresources/entitlements/" +"com_apple_security_personal-information_location]com.apple.security.personal-" +"information.location[/url]。" + +msgid "" +"Enable to allow access to the user's Photos library, if it's enabled you " +"should also provide usage message in the [member privacy/" +"photos_library_usage_description] option. See [url=https://developer.apple." +"com/documentation/bundleresources/entitlements/com_apple_security_personal-" +"information_photos-library]com.apple.security.personal-information.photos-" +"library[/url]." +msgstr "" +"启用后允许访问用户的照片库,启用时还应在 [member privacy/" +"photos_library_usage_description] 选项中提供用途消息。请参阅 [url=https://" +"developer.apple.com/documentation/bundleresources/entitlements/" +"com_apple_security_personal-information_photos-library]com.apple.security." +"personal-information.photos-library[/url]。" + +msgid "" "The \"Full Name\", \"Common Name\" or SHA-1 hash of the signing identity used " "to sign [code].app[/code] bundle." msgstr "" @@ -36105,6 +38946,14 @@ msgstr "" "启用后,会在导出后的应用程序旁创建一个封装程序,可以用来以带命令行输出的形式运" "行该应用程序。" +msgid "" +"If [code]true[/code], the application is rendered at native display " +"resolution, otherwise it is always rendered at loDPI resolution and upscaled " +"by OS when required." +msgstr "" +"如果为 [code]true[/code],则应用程序使用原生显示器分辨率渲染,否则始终使用 " +"loDPI 分辨率渲染,必要时由操作系统放大。" + msgid "Application distribution target." msgstr "应用程序分发目标。" @@ -36310,6 +39159,15 @@ msgstr "" "win32/menurc/stringfileinfo-block]StringFileInfo[/url]。" msgid "" +"Version number of the file. Falls back to [member ProjectSettings.application/" +"config/version] if left empty. See [url=https://learn.microsoft.com/en-us/" +"windows/win32/menurc/stringfileinfo-block]StringFileInfo[/url]." +msgstr "" +"文件的版本号。如果留空,则回退到 [member ProjectSettings.application/config/" +"version]。请参阅 [url=https://learn.microsoft.com/en-us/windows/win32/menurc/" +"stringfileinfo-block]StringFileInfo[/url]。" + +msgid "" "Application icon file. If left empty, it will fallback to [member " "ProjectSettings.application/config/windows_native_icon], and then to [member " "ProjectSettings.application/config/icon]." @@ -36333,6 +39191,16 @@ msgstr "" "menurc/stringfileinfo-block]StringFileInfo[/url]。" msgid "" +"Application version visible to the user. Falls back to [member " +"ProjectSettings.application/config/version] if left empty. See [url=https://" +"learn.microsoft.com/en-us/windows/win32/menurc/stringfileinfo-" +"block]StringFileInfo[/url]." +msgstr "" +"用户可见的应用程序版本。如果留空,则回退到 [member ProjectSettings." +"application/config/version]。请参阅 [url=https://learn.microsoft.com/en-us/" +"windows/win32/menurc/stringfileinfo-block]StringFileInfo[/url]。" + +msgid "" "Trademarks and registered trademarks that apply to the file. Optional. See " "[url=https://learn.microsoft.com/en-us/windows/win32/menurc/stringfileinfo-" "block]StringFileInfo[/url]." @@ -36485,6 +39353,18 @@ msgstr "" "如果 [method _begin_customize_resources] 返回 [code]true[/code],则需要实现该" "方法。" +msgid "" +"Customize a scene. If changes are made to it, return the same or a new scene. " +"Otherwise, return [code]null[/code]. If a new scene is returned, it is up to " +"you to dispose of the old one.\n" +"Implementing this method is required if [method _begin_customize_scenes] " +"returns [code]true[/code]." +msgstr "" +"定制一个场景。如果对其进行了修改,则返回相同的或新的场景。否则,返回 " +"[code]null[/code] 。如果返回一个新的场景,则由你来处理旧的场景。\n" +"如果 [method _begin_customize_scenes] 返回 [code]true[/code],则需要实现该方" +"法。" + msgid "This is called when the customization process for resources ends." msgstr "资源的自定义处理完成时调用。" @@ -36524,6 +39404,104 @@ msgstr "" "在此回调中调用[method skip]将使文件不包含在导出中。" msgid "" +"Virtual method to be overridden by the user. This is called to retrieve the " +"set of Android dependencies provided by this plugin. Each returned Android " +"dependency should have the format of an Android remote binary dependency: " +"[code]org.godot.example:my-plugin:0.0.0[/code]\n" +"For more information see [url=https://developer.android.com/build/" +"dependencies?agpversion=4.1#dependency-types]Android documentation on " +"dependencies[/url].\n" +"[b]Note:[/b] Only supported on Android and requires [member " +"EditorExportPlatformAndroid.gradle_build/use_gradle_build] to be enabled." +msgstr "" +"由用户覆盖的虚方法。调用该函数是为了检索该插件提供的 Android 依赖项集。每个返" +"回的 Android 依赖项应具有 Android 远程二进制依赖项的格式:[code]org.godot." +"example:my-plugin:0.0.0[/code]\n" +"有关详细信息,请参阅 [url=https://developer.android.com/build/dependencies?" +"agpversion=4.1#dependency-types]有关依赖项的 Android 文档[/url]。\n" +"[b]注意:[/b]仅在 Android 上受支持,并且需要启用 [member " +"EditorExportPlatformAndroid.gradle_build/use_gradle_build]。" + +msgid "" +"Virtual method to be overridden by the user. This is called to retrieve the " +"URLs of Maven repositories for the set of Android dependencies provided by " +"this plugin.\n" +"For more information see [url=https://docs.gradle.org/current/userguide/" +"dependency_management.html#sec:maven_repo]Gradle documentation on dependency " +"management[/url].\n" +"[b]Note:[/b] Google's Maven repo and the Maven Central repo are already " +"included by default.\n" +"[b]Note:[/b] Only supported on Android and requires [member " +"EditorExportPlatformAndroid.gradle_build/use_gradle_build] to be enabled." +msgstr "" +"由用户覆盖的虚方法。调用该函数是为了检索该插件提供的 Android 依赖项集的 Maven " +"存储库的 URL。\n" +"有关更多信息,请参阅 [url=https://docs.gradle.org/current/userguide/" +"dependency_management.html#sec:maven_repo]有关依赖管理的 Gradle 文档[/url]。\n" +"[b]注意:[/b]Google 的 Maven 存储库和 Maven Central 存储库默认已包含在内。\n" +"[b]注意:[/b]仅在 Android 上受支持,并且需要启用 [member " +"EditorExportPlatformAndroid.gradle_build/use_gradle_build]。" + +msgid "" +"Virtual method to be overridden by the user. This is called to retrieve the " +"local paths of the Android libraries archive (AAR) files provided by this " +"plugin.\n" +"[b]Note:[/b] Relative paths [b]must[/b] be relative to Godot's [code]res://" +"addons/[/code] directory. For example, an AAR file located under [code]res://" +"addons/hello_world_plugin/HelloWorld.release.aar[/code] can be returned as an " +"absolute path using [code]res://addons/hello_world_plugin/HelloWorld.release." +"aar[/code] or a relative path using [code]hello_world_plugin/HelloWorld." +"release.aar[/code].\n" +"[b]Note:[/b] Only supported on Android and requires [member " +"EditorExportPlatformAndroid.gradle_build/use_gradle_build] to be enabled." +msgstr "" +"由用户覆盖的虚方法。调用该函数是为了检索该插件提供的 Android 库存档(AAR)文件" +"的本地路径。\n" +"[b]注意:[/b]相对路径[b]必须[/b]相对于 Godot 的 [code]res://addons/[/code] 目" +"录。例如,位于 [code]res://addons/hello_world_plugin/HelloWorld.release.aar[/" +"code] 下的 AAR 文件,可以使用 [code]res://addons/hello_world_plugin/" +"HelloWorld.release.aar[/code] 作为绝对路径,或使用 [code]hello_world_plugin/" +"HelloWorld.release.aar[/code] 作为相对路径返回。\n" +"[b]注意:[/b]仅在 Android 上受支持,并且需要启用 [member " +"EditorExportPlatformAndroid.gradle_build/use_gradle_build]。" + +msgid "" +"Virtual method to be overridden by the user. This is used at export time to " +"update the contents of the [code]activity[/code] element in the generated " +"Android manifest.\n" +"[b]Note:[/b] Only supported on Android and requires [member " +"EditorExportPlatformAndroid.gradle_build/use_gradle_build] to be enabled." +msgstr "" +"由用户覆盖的虚方法。这在导出时用于更新生成的 Android 清单中的 [code]activity[/" +"code] 元素的内容。\n" +"[b]注意:[/b]仅在 Android 上受支持,并且需要启用 [member " +"EditorExportPlatformAndroid.gradle_build/use_gradle_build]。" + +msgid "" +"Virtual method to be overridden by the user. This is used at export time to " +"update the contents of the [code]application[/code] element in the generated " +"Android manifest.\n" +"[b]Note:[/b] Only supported on Android and requires [member " +"EditorExportPlatformAndroid.gradle_build/use_gradle_build] to be enabled." +msgstr "" +"由用户覆盖的虚方法。这在导出时用于更新生成的 Android 清单中的 " +"[code]application[/code] 元素的内容。\n" +"[b]注意:[/b]仅在 Android 上受支持,并且需要启用 [member " +"EditorExportPlatformAndroid.gradle_build/use_gradle_build]。" + +msgid "" +"Virtual method to be overridden by the user. This is used at export time to " +"update the contents of the [code]manifest[/code] element in the generated " +"Android manifest.\n" +"[b]Note:[/b] Only supported on Android and requires [member " +"EditorExportPlatformAndroid.gradle_build/use_gradle_build] to be enabled." +msgstr "" +"由用户覆盖的虚方法。这在导出时用于更新生成的 Android 清单中的 [code]manifest[/" +"code] 元素的内容。\n" +"[b]注意:[/b]仅在 Android 上受支持,并且需要启用 [member " +"EditorExportPlatformAndroid.gradle_build/use_gradle_build]。" + +msgid "" "Return a hash based on the configuration passed (for both scenes and " "resources). This helps keep separate caches for separate export " "configurations.\n" @@ -36543,6 +39521,14 @@ msgstr "" "[PackedStringArray]。" msgid "" +"Check the requirements for the given [param option] and return a non-empty " +"warning string if they are not met.\n" +"[b]Note:[/b] Use [method get_option] to check the value of the export options." +msgstr "" +"检查给定 [param option] 的要求,如果不满足则返回非空警告字符串。\n" +"[b]注意:[/b]使用 [method get_option] 检查导出选项的值。" + +msgid "" "Return a list of export options that can be configured for this export " "plugin.\n" "Each element in the return value is a [Dictionary] with the following keys:\n" @@ -36578,6 +39564,10 @@ msgstr "" "导出预设的选项需要更新,则返回 [code]true[/code]。" msgid "" +"Return [code]true[/code] if the plugin supports the given [param platform]." +msgstr "如果插件支持给定的 [param platform],则返回 [code]true[/code]。" + +msgid "" "Adds a custom file to be exported. [param path] is the virtual path that can " "be used to load the file, [param file] is the binary data of the file.\n" "When called inside [method _export_file] and [param remap] is [code]true[/" @@ -36602,6 +39592,20 @@ msgstr "" "的。" msgid "" +"Adds a dynamic library (*.dylib, *.framework) to Linking Phase in iOS's Xcode " +"project and embeds it into resulting binary.\n" +"[b]Note:[/b] For static libraries (*.a) works in same way as [method " +"add_ios_framework].\n" +"[b]Note:[/b] This method should not be used for System libraries as they are " +"already present on the device." +msgstr "" +"将动态库(*.dylib、*.framework)添加到 iOS 的 Xcode 项目的链接阶段,并将其嵌入" +"到生成的二进制文件中。\n" +"[b]注意:[/b]对于静态库(*.a),该方法的工作方式与 [method add_ios_framework] " +"相同。\n" +"[b]注意:[/b]此方法不该用于系统库,因为它们已经存在于设备上。" + +msgid "" "Adds a static library (*.a) or dynamic library (*.dylib, *.framework) to " "Linking Phase in iOS's Xcode project." msgstr "" @@ -36709,6 +39713,36 @@ msgstr "" "将从编辑器中完全消失。" msgid "" +"Loads an editor feature profile from a file. The file must follow the JSON " +"format obtained by using the feature profile manager's [b]Export[/b] button " +"or the [method save_to_file] method.\n" +"[b]Note:[/b] Feature profiles created via the user interface are loaded from " +"the [code]feature_profiles[/code] directory, as a file with the [code]." +"profile[/code] extension. The editor configuration folder can be found by " +"using [method EditorPaths.get_config_dir]." +msgstr "" +"从文件加载编辑器功能配置文件。该文件必须遵循使用功能配置文件管理器的[b]导出[/" +"b]按钮或 [method save_to_file] 方法获取的 JSON 格式。\n" +"[b]注意:[/b]通过用户界面创建的功能配置文件将从 [code]feature_profiles[/code] " +"目录中的扩展名为 [code].profile[/code] 的文件加载。可以使用 [method " +"EditorPaths.get_config_dir] 找到编辑器配置文件夹。" + +msgid "" +"Saves the editor feature profile to a file in JSON format. It can then be " +"imported using the feature profile manager's [b]Import[/b] button or the " +"[method load_from_file] method.\n" +"[b]Note:[/b] Feature profiles created via the user interface are saved in the " +"[code]feature_profiles[/code] directory, as a file with the [code].profile[/" +"code] extension. The editor configuration folder can be found by using " +"[method EditorPaths.get_config_dir]." +msgstr "" +"将编辑器功能配置文件保存到一个 JSON 格式的文件中。然后可以使用功能配置文件管理" +"器的[b]导入[/b]按钮或 [method load_from_file] 方法导入它。\n" +"[b]注意:[/b]通过用户界面创建的功能配置文件,将作为扩展名为 [code].profile[/" +"code] 的文件,保存在 [code]feature_profiles[/code] 目录中。可以使用 [method " +"EditorPaths.get_config_dir] 找到编辑器配置文件夹。" + +msgid "" "If [param disable] is [code]true[/code], disables the class specified by " "[param class_name]. When disabled, the class won't appear in the Create New " "Node dialog." @@ -36817,6 +39851,13 @@ msgstr "" "例如,[code]\"*.tscn, *.scn\"[/code] 的 [param filter] 和 [code]\"场景\"[/" "code] 的 [param description] 会产生过滤文本“场景 (* .tscn, *.scn)”。" +msgid "" +"Adds the given [param menu] to the side of the file dialog with the given " +"[param title] text on top. Only one side menu is allowed." +msgstr "" +"将给定的 [param menu] 添加到文件对话框的侧边,在顶部显示标题文本 [param " +"title]。仅支持一个侧边菜单。" + msgid "Removes all filters except for \"All Files (*)\"." msgstr "移除“All Files(*)”筛选器之外的所有筛选器。" @@ -36831,6 +39872,16 @@ msgstr "" "藏它或其任何子项,请使用它们的 [member CanvasItem.visible] 属性。" msgid "" +"Returns the [VBoxContainer] used to display the file system.\n" +"[b]Warning:[/b] This is a required internal node, removing and freeing it may " +"cause a crash. If you wish to hide it or any of its children, use their " +"[member CanvasItem.visible] property." +msgstr "" +"返回用于显示文件系统的 [VBoxContainer]。\n" +"[b]警告:[/b]这是一个必需的内部节点,移除和释放它可能会导致崩溃。如果你想隐藏" +"它或它的任何子节点,请使用 [member CanvasItem.visible] 属性。" + +msgid "" "Notify the [EditorFileDialog] that its view of the data is no longer " "accurate. Updates the view contents on next view update." msgstr "" @@ -37533,6 +40584,28 @@ msgstr "" "组。\n" "必须重写这个方法才能完成实际的导入工作。参阅本类的描述以了解如何重写该方法。" +msgid "" +"This function can only be called during the [method _import] callback and it " +"allows manually importing resources from it. This is useful when the imported " +"file generates external resources that require importing (as example, " +"images). Custom parameters for the \".import\" file can be passed via the " +"[param custom_options]. Additionally, in cases where multiple importers can " +"handle a file, the [param custom_importer] ca be specified to force a " +"specific one. This function performs a resource import and returns " +"immediately with a success or error code. [param generator_parameters] " +"defines optional extra metadata which will be stored as [code skip-" +"lint]generator_parameters[/code] in the [code]remap[/code] section of the " +"[code].import[/code] file, for example to store a md5 hash of the source data." +msgstr "" +"该函数只能在 [method _import] 回调期间调用,它允许从中手动导入资源。当导入的文" +"件生成需要导入的外部资源(例如图像)时,这很有用。“.import”文件的自定义参数可" +"以通过 [param custom_options] 传递。此外,在多个导入器可以处理一个文件的情况" +"下,可以指定 [param custom_importer] 以强制使用某个特定的导入器。该函数会执行" +"一次资源导入并立即返回成功或错误代码。[param generator_parameters] 定义可选的" +"额外元数据,这些元数据将作为 [code skip-lint]generator_parameters[/code] 存储" +"在 [code].import[/code] 文件的 [code]remap[/code] 小节中,例如存储源数据的一" +"个 md5 散列值。" + msgid "A control used to edit properties of an object." msgstr "用于编辑对象属性的控件。" @@ -37592,6 +40665,9 @@ msgstr "" "据分组创建的部分的名称进行首字母大写。因此,包含分组用法的属性通常使用首字母大" "写的名称,而不是 snake_case。" +msgid "Returns the object currently selected in this inspector." +msgstr "返回当前在该检查器中选择的对象。" + msgid "Gets the path of the currently selected property." msgstr "获取当前选定属性的路径。" @@ -37806,6 +40882,24 @@ msgstr "" "返回 [FileSystemDock] 中当前正在查看的目录。如果选择了一个文件,则将使用 " "[method String.get_base_dir] 返回其基本目录。" +msgid "" +"Returns the name of the currently activated feature profile. If the default " +"profile is currently active, an empty string is returned instead.\n" +"In order to get a reference to the [EditorFeatureProfile], you must load the " +"feature profile using [method EditorFeatureProfile.load_from_file].\n" +"[b]Note:[/b] Feature profiles created via the user interface are loaded from " +"the [code]feature_profiles[/code] directory, as a file with the [code]." +"profile[/code] extension. The editor configuration folder can be found by " +"using [method EditorPaths.get_config_dir]." +msgstr "" +"返回当前激活的功能配置文件的名称。如果默认配置文件当前处于活动状态,则返回空字" +"符串。\n" +"为了获取对 [EditorFeatureProfile] 的引用,你必须使用 [method " +"EditorFeatureProfile.load_from_file] 加载该功能配置文件。\n" +"[b]注意:[/b]通过用户界面创建的功能配置文件将从 [code]feature_profiles[/code] " +"目录中的扩展名为 [code].profile[/code] 的文件加载。可以使用 [method " +"EditorPaths.get_config_dir] 找到编辑器配置文件夹。" + msgid "Returns the current path being viewed in the [FileSystemDock]." msgstr "返回在 [FileSystemDock] 中查看的当前路径。" @@ -38010,11 +41104,48 @@ msgid "Saves all opened scenes in the editor." msgstr "保存编辑器中打开的所有场景。" msgid "" +"Saves the currently active scene. Returns either [constant OK] or [constant " +"ERR_CANT_CREATE]." +msgstr "保存当前活动场景。返回 [constant OK] 或 [constant ERR_CANT_CREATE]。" + +msgid "Saves the currently active scene as a file at [param path]." +msgstr "将当前活动场景保存为 [param path] 处的文件。" + +msgid "" "Selects the file, with the path provided by [param file], in the FileSystem " "dock." msgstr "在文件系统面板中选中文件,路径由 [param file] 提供。" msgid "" +"Selects and activates the specified feature profile with the given [param " +"profile_name]. Set [param profile_name] to an empty string to reset to the " +"default feature profile.\n" +"A feature profile can be created programmatically using the " +"[EditorFeatureProfile] class.\n" +"[b]Note:[/b] The feature profile that gets activated must be located in the " +"[code]feature_profiles[/code] directory, as a file with the [code].profile[/" +"code] extension. If a profile could not be found, an error occurs. The editor " +"configuration folder can be found by using [method EditorPaths." +"get_config_dir]." +msgstr "" +"使用给定的 [param profile_name] 选择并激活指定的功能配置文件。将 [param " +"profile_name] 设置为空字符串以重置为默认功能配置文件。\n" +"可以使用 [EditorFeatureProfile] 类以编程方式创建功能配置文件。\n" +"[b]注意:[/b]激活的功能配置文件必须位于 [code]feature_profiles[/code] 目录中," +"且该文件的扩展名为 [code].profile[/code]。如果找不到配置文件,则会发生错误。可" +"以使用 [method EditorPaths.get_config_dir] 找到编辑器配置文件夹。" + +msgid "" +"Sets the editor's current main screen to the one specified in [param name]. " +"[param name] must match the title of the tab in question exactly (e.g. " +"[code]2D[/code], [code]3D[/code], [code skip-lint]Script[/code], or " +"[code]AssetLib[/code] for default tabs)." +msgstr "" +"将编辑器的当前主屏幕设置为 [param name] 中指定的屏幕。[param name] 必须与相关" +"选项卡的文本完全匹配([code]2D[/code]、[code]3D[/code]、[code skip-" +"lint]Script[/code]、[code]AssetLib[/code])。" + +msgid "" "Sets the enabled status of a plugin. The plugin name is the same as its " "directory name." msgstr "设置插件的启用状态。插件名称与其目录名称相同。" @@ -38036,6 +41167,19 @@ msgstr "" "如果为 [code]true[/code],则编辑器启用了 Movie Maker 模式。详见 " "[MovieWriter]。" +msgid "Gizmo for editing [Node3D] objects." +msgstr "用于编辑 [Node3D] 对象的小工具。" + +msgid "" +"Gizmo that is used for providing custom visualization and editing (handles " +"and subgizmos) for [Node3D] objects. Can be overridden to create custom " +"gizmos, but for simple gizmos creating a [EditorNode3DGizmoPlugin] is usually " +"recommended." +msgstr "" +"小工具可用于为 [Node3D] 对象提供自定义可视化和编辑功能(控柄和子小工具)。可以" +"被重写以创建自定义小工具,但对于简单的小工具而言,通常建议创建 " +"[EditorNode3DGizmoPlugin]。" + msgid "" "Override this method to commit a handle being edited (handles must have been " "previously added by [method add_handles]). This usually means creating an " @@ -38135,6 +41279,32 @@ msgstr "" "信息,请参阅 [method add_handles])。" msgid "" +"Override this method to update the node properties during subgizmo editing " +"(see [method _subgizmos_intersect_ray] and [method " +"_subgizmos_intersect_frustum]). The [param transform] is given in the " +"[Node3D]'s local coordinate system." +msgstr "" +"覆盖该方法,以在子小工具编辑期间更新节点属性(参见 [method " +"_subgizmos_intersect_ray] 和 [method _subgizmos_intersect_frustum])。[param " +"transform] 是在 [Node3D] 的局部坐标系中给出的。" + +msgid "" +"Override this method to allow selecting subgizmos using mouse drag box " +"selection. Given a [param camera] and a [param frustum], this method should " +"return which subgizmos are contained within the frustum. The [param frustum] " +"argument consists of an array with all the [Plane]s that make up the " +"selection frustum. The returned value should contain a list of unique " +"subgizmo identifiers, which can have any non-negative value and will be used " +"in other virtual methods like [method _get_subgizmo_transform] or [method " +"_commit_subgizmos]." +msgstr "" +"覆盖该方法,以允许使用鼠标拖动框选来选择子小工具。给定一个 [param camera] 和一" +"个 [param frustum],这个方法应该返回哪些子小工具包含在锥体中。[param frustum] " +"参数由一个数组组成,其中包含构成选择锥体的所有 [Plane]。返回的值应该包含一个唯" +"一的子小工具标识符列表,它可以有任何非负值,并将用于其他虚方法,如 [method " +"_get_subgizmo_transform] 或 [method _commit_subgizmos]。" + +msgid "" "Override this method to allow selecting subgizmos using mouse clicks. Given a " "[param camera] and a [param point] in screen coordinates, this method should " "return which subgizmo should be selected. The returned value should be a " @@ -38162,6 +41332,29 @@ msgstr "" "在 [method _redraw] 期间调用该方法。" msgid "" +"Adds a list of handles (points) which can be used to edit the properties of " +"the gizmo's [Node3D]. The [param ids] argument can be used to specify a " +"custom identifier for each handle, if an empty array is passed, the ids will " +"be assigned automatically from the [param handles] argument order.\n" +"The [param secondary] argument marks the added handles as secondary, meaning " +"they will normally have lower selection priority than regular handles. When " +"the user is holding the shift key secondary handles will switch to have " +"higher priority than regular handles. This change in priority can be used to " +"place multiple handles at the same point while still giving the user control " +"on their selection.\n" +"There are virtual methods which will be called upon editing of these handles. " +"Call this method during [method _redraw]." +msgstr "" +"添加可用于编辑该小工具的 [Node3D] 属性的一组控柄(点)。[param ids] 参数可用于" +"为每个控柄指定一个自定义的标识符,如果传递了一个空的数组,id 将按照 [param " +"handles] 参数顺序自动分配。\n" +"[param secondary] 参数将添加的控柄标记为次要控柄,这意味着它们通常比普通控柄具" +"有更低的选择优先级。当用户按住 Shift 键时,次要控柄将被切换为比普通控柄具有更" +"高的优先级。这种优先级的变化可用于在同一点放置多个控柄,同时仍让用户控制他们的" +"选择。\n" +"这些虚方法将在编辑这些控柄时被调用。在 [method _redraw] 期间将调用该方法。" + +msgid "" "Adds lines to the gizmo (as sets of 2 points), with a given material. The " "lines are used for visualizing the gizmo. Call this method during [method " "_redraw]." @@ -38414,6 +41607,23 @@ msgstr "" "transform] 在 Node3D 的局部坐标系中给出。为该插件的活动小工具而调用。" msgid "" +"Override this method to allow selecting subgizmos using mouse drag box " +"selection. Given a [param camera] and [param frustum_planes], this method " +"should return which subgizmos are contained within the frustums. The [param " +"frustum_planes] argument consists of an array with all the [Plane]s that make " +"up the selection frustum. The returned value should contain a list of unique " +"subgizmo identifiers, these identifiers can have any non-negative value and " +"will be used in other virtual methods like [method _get_subgizmo_transform] " +"or [method _commit_subgizmos]. Called for this plugin's active gizmos." +msgstr "" +"覆盖该方法,以允许使用鼠标拖动框选来选择子小工具。给定一个 [param camera] 和 " +"[param frustum_planes],该方法应返回哪些子小工具包含在视锥体中。[param " +"frustum_planes] 参数由一个构成选择视锥体的所有 [Plane] 的数组组成。返回的值应" +"该包含一个唯一的子小工具标识符列表,这些标识符可以有任何非负值,并将用于其他虚" +"方法,如 [method _get_subgizmo_transform] 或 [method _commit_subgizmos]。为该" +"插件的活动小工具而调用。" + +msgid "" "Override this method to allow selecting subgizmos using mouse clicks. Given a " "[param camera] and a [param screen_pos] in screen coordinates, this method " "should return which subgizmo should be selected. The returned value should be " @@ -38621,6 +41831,21 @@ msgstr "" msgid "Used by the editor to extend its functionality." msgstr "由编辑器使用,用于扩展其功能。" +msgid "" +"Plugins are used by the editor to extend functionality. The most common types " +"of plugins are those which edit a given node or resource type, import plugins " +"and export plugins. See also [EditorScript] to add functions to the editor.\n" +"[b]Note:[/b] Some names in this class contain \"left\" or \"right\" (e.g. " +"[constant DOCK_SLOT_LEFT_UL]). These APIs assume left-to-right layout, and " +"would be backwards when using right-to-left layout. These names are kept for " +"compatibility reasons." +msgstr "" +"编辑器使用插件来扩展功能。最常见的插件类型是编辑给定的节点或资源类型的插件、导" +"入插件和导出插件。另见 [EditorScript],能够向编辑器添加功能。\n" +"[b]注意:[/b]这个类中的部分名称中包含“left”和“right”(例如 [constant " +"DOCK_SLOT_LEFT_UL])。这些 API 假设的是从左至右的布局,使用从右至左布局时是反" +"的。保留这些名称是出于兼容的原因。" + msgid "Editor plugins documentation index" msgstr "编辑器插件文档索引" @@ -39026,6 +42251,61 @@ msgstr "" "code])的断点的列表,例如:[code]res://path_to_script.gd:25[/code]。" msgid "" +"Override this method in your plugin to return a [Texture2D] in order to give " +"it an icon.\n" +"For main screen plugins, this appears at the top of the screen, to the right " +"of the \"2D\", \"3D\", \"Script\", and \"AssetLib\" buttons.\n" +"Ideally, the plugin icon should be white with a transparent background and " +"16x16 pixels in size.\n" +"[codeblocks]\n" +"[gdscript]\n" +"func _get_plugin_icon():\n" +" # You can use a custom icon:\n" +" return preload(\"res://addons/my_plugin/my_plugin_icon.svg\")\n" +" # Or use a built-in icon:\n" +" return EditorInterface.get_editor_theme().get_icon(\"Node\", " +"\"EditorIcons\")\n" +"[/gdscript]\n" +"[csharp]\n" +"public override Texture2D _GetPluginIcon()\n" +"{\n" +" // You can use a custom icon:\n" +" return ResourceLoader.Load<Texture2D>(\"res://addons/my_plugin/" +"my_plugin_icon.svg\");\n" +" // Or use a built-in icon:\n" +" return EditorInterface.Singleton.GetEditorTheme().GetIcon(\"Node\", " +"\"EditorIcons\");\n" +"}\n" +"[/csharp]\n" +"[/codeblocks]" +msgstr "" +"在插件中覆盖该方法,以返回一个 [Texture2D] 以便为插件提供一个图标。\n" +"对于主界面插件,它出现在屏幕顶部,“2D”、“3D”、“脚本”和 “AssetLib” 按钮的右" +"侧。\n" +"理想情况下,插件图标应为透明背景的白色,大小为 16x16 像素。\n" +"[codeblocks]\n" +"[gdscript]\n" +"func _get_plugin_icon():\n" +" # 你可以使用一个自定义的图标:\n" +" return preload(\"res://addons/my_plugin/my_plugin_icon.svg\")\n" +" # 或者使用一个内置的图标:\n" +" return EditorInterface.get_editor_theme().get_icon(\"Node\", " +"\"EditorIcons\")\n" +"[/gdscript]\n" +"[csharp]\n" +"public override Texture2D _GetPluginIcon()\n" +"{\n" +" // 你可以使用一个自定义的图标:\n" +" return ResourceLoader.Load<Texture2D>(\"res://addons/my_plugin/" +"my_plugin_icon.svg\");\n" +" // 或者使用一个内置的图标:\n" +" return EditorInterface.Singleton.GetEditorTheme().GetIcon(\"Node\", " +"\"EditorIcons\");\n" +"}\n" +"[/csharp]\n" +"[/codeblocks]" + +msgid "" "Override this method in your plugin to provide the name of the plugin when " "displayed in the Godot editor.\n" "For main screen plugins, this appears at the top of the screen, to the right " @@ -39068,6 +42348,64 @@ msgstr "" "[/codeblock]" msgid "" +"Override this method to provide a custom message that lists unsaved changes. " +"The editor will call this method when exiting or when closing a scene, and " +"display the returned string in a confirmation dialog. Return empty string if " +"the plugin has no unsaved changes.\n" +"When closing a scene, [param for_scene] is the path to the scene being " +"closed. You can use it to handle built-in resources in that scene.\n" +"If the user confirms saving, [method _save_external_data] will be called, " +"before closing the editor.\n" +"[codeblock]\n" +"func _get_unsaved_status(for_scene):\n" +" if not unsaved:\n" +" return \"\"\n" +"\n" +" if for_scene.is_empty():\n" +" return \"Save changes in MyCustomPlugin before closing?\"\n" +" else:\n" +" return \"Scene %s has changes from MyCustomPlugin. Save before " +"closing?\" % for_scene.get_file()\n" +"\n" +"func _save_external_data():\n" +" unsaved = false\n" +"[/codeblock]\n" +"If the plugin has no scene-specific changes, you can ignore the calls when " +"closing scenes:\n" +"[codeblock]\n" +"func _get_unsaved_status(for_scene):\n" +" if not for_scene.is_empty():\n" +" return \"\"\n" +"[/codeblock]" +msgstr "" +"覆盖该方法以提供列出未保存更改的自定义消息。编辑器将在退出或关闭场景时调用该方" +"法,并在确认对话框中显示返回的字符串。如果该插件没有未保存的更改,则返回空字符" +"串。\n" +"关闭场景时,[param for_scene] 是正在关闭的场景的路径。你可以使用它来处理该场景" +"中的内置资源。\n" +"如果用户确认保存,将在关闭编辑器之前将调用 [method _save_external_data]。\n" +"[codeblock]\n" +"func _get_unsaved_status(for_scene):\n" +" if not unsaved:\n" +" return \"\"\n" +"\n" +" if for_scene.is_empty():\n" +" return \"Save changes in MyCustomPlugin before closing?\"\n" +" else:\n" +" return \"Scene %s has changes from MyCustomPlugin. Save before " +"closing?\" % for_scene.get_file()\n" +"\n" +"func _save_external_data():\n" +" unsaved = false\n" +"[/codeblock]\n" +"如果该插件没有特定于场景的更改,则可以在关闭场景时忽略这些调用:\n" +"[codeblock]\n" +"func _get_unsaved_status(for_scene):\n" +" if not for_scene.is_empty():\n" +" return \"\"\n" +"[/codeblock]" + +msgid "" "Override this method to provide the GUI layout of the plugin or any other " "data you want to be stored. This is used to save the project's editor layout " "when [method queue_save_layout] is called or the editor layout was changed " @@ -39094,6 +42432,85 @@ msgstr "" "[/codeblock]" msgid "" +"Implement this function if your plugin edits a specific type of object " +"(Resource or Node). If you return [code]true[/code], then you will get the " +"functions [method _edit] and [method _make_visible] called when the editor " +"requests them. If you have declared the methods [method " +"_forward_canvas_gui_input] and [method _forward_3d_gui_input] these will be " +"called too.\n" +"[b]Note:[/b] Each plugin should handle only one type of objects at a time. If " +"a plugin handes more types of objects and they are edited at the same time, " +"it will result in errors." +msgstr "" +"如果插件会编辑特定类型的对象(资源或节点),则请实现该函数。如果返回 " +"[code]true[/code],则将在编辑器请求时,调用函数 [method _edit] 和 [method " +"_make_visible]。如果已经声明了方法 [method _forward_canvas_gui_input] 和 " +"[method _forward_3d_gui_input],则它们也会被调用。\n" +"[b]注意:[/b]每个插件一次只应处理一种类型的对象。如果一个插件处理多种类型的对" +"象并且同时编辑这些对象,则会导致错误。" + +msgid "" +"Returns [code]true[/code] if this is a main screen editor plugin (it goes in " +"the workspace selector together with [b]2D[/b], [b]3D[/b], [b]Script[/b] and " +"[b]AssetLib[/b]).\n" +"When the plugin's workspace is selected, other main screen plugins will be " +"hidden, but your plugin will not appear automatically. It needs to be added " +"as a child of [method EditorInterface.get_base_control] and made visible " +"inside [method _make_visible].\n" +"Use [method _get_plugin_name] and [method _get_plugin_icon] to customize the " +"plugin button's appearance.\n" +"[codeblock]\n" +"var plugin_control\n" +"\n" +"func _enter_tree():\n" +" plugin_control = preload(\"my_plugin_control.tscn\").instantiate()\n" +" EditorInterface.get_editor_main_screen().add_child(plugin_control)\n" +" plugin_control.hide()\n" +"\n" +"func _has_main_screen():\n" +" return true\n" +"\n" +"func _make_visible(visible):\n" +" plugin_control.visible = visible\n" +"\n" +"func _get_plugin_name():\n" +" return \"My Super Cool Plugin 3000\"\n" +"\n" +"func _get_plugin_icon():\n" +" return EditorInterface.get_editor_theme().get_icon(\"Node\", " +"\"EditorIcons\")\n" +"[/codeblock]" +msgstr "" +"如果这是一个主屏幕编辑器插件,则返回 [code]true[/code](它与 [b]2D[/b]、" +"[b]3D[/b]、[b]Script[/b] 和 [b]AssetLib[/b] 一起进入工作区选择器)。\n" +"当该插件的工作区被选中时,其他主屏幕插件将被隐藏,但你的插件不会自动出现。它需" +"要被添加为 [method EditorInterface.get_base_control] 的子节点,并在 [method " +"_make_visible] 中使其可见。\n" +"使用 [method _get_plugin_name] 和 [method _get_plugin_icon] 自定义插件按钮的外" +"观。\n" +"[codeblock]\n" +"var plugin_control\n" +"\n" +"func _enter_tree():\n" +" plugin_control = preload(\"my_plugin_control.tscn\").instantiate()\n" +" EditorInterface.get_editor_main_screen().add_child(plugin_control)\n" +" plugin_control.hide()\n" +"\n" +"func _has_main_screen():\n" +" return true\n" +"\n" +"func _make_visible(visible):\n" +" plugin_control.visible = visible\n" +"\n" +"func _get_plugin_name():\n" +" return \"My Super Cool Plugin 3000\"\n" +"\n" +"func _get_plugin_icon():\n" +" return EditorInterface.get_editor_theme().get_icon(\"Node\", " +"\"EditorIcons\")\n" +"[/codeblock]" + +msgid "" "This function will be called when the editor is requested to become visible. " "It is used for plugins that edit a specific object type.\n" "Remember that you have to manage the visibility of all your editor controls " @@ -39345,6 +42762,14 @@ msgstr "" "的 [param callable]。" msgid "" +"Adds a custom [PopupMenu] submenu under [b]Project > Tools >[/b] [param " +"name]. Use [method remove_tool_menu_item] on plugin clean up to remove the " +"menu." +msgstr "" +"在[b]项目 > 工具[/b]中添加名为 [param name] 的自定义 [PopupMenu] 子菜单。请在" +"清理插件时调用 [method remove_tool_menu_item] 移除该菜单。" + +msgid "" "Registers a custom translation parser plugin for extracting translatable " "strings from custom files." msgstr "注册一个自定义翻译解析器插件,用于从自定义文件中提取可翻译的字符串。" @@ -39366,10 +42791,23 @@ msgstr "" "[code]new_value[/code]。它们分别是检查器使用的 [UndoRedo] 对象、当前修改的对" "象、修改的属性的名称、和该属性即将采用的新值。" +msgid "" +"Returns the [EditorInterface] singleton instance.\n" +"[i]Deprecated.[/i] [EditorInterface] is a global singleton and can be " +"accessed directly by its name." +msgstr "" +"返回 [EditorInterface] 单例实例。\n" +"[i]已废弃。[/i][EditorInterface] 是全局单例,可以使用其名称直接访问。" + msgid "Returns the [PopupMenu] under [b]Scene > Export As...[/b]." msgstr "返回[b]场景 > 另存为...[/b]下的 [PopupMenu]。" msgid "" +"Provide the version of the plugin declared in the [code]plugin.cfg[/code] " +"config file." +msgstr "提供在 [code]plugin.cfg[/code] 配置文件中声明的插件版本。" + +msgid "" "Gets the Editor's dialog used for making scripts.\n" "[b]Note:[/b] Users can configure it before use.\n" "[b]Warning:[/b] Removing and freeing this node will render a part of the " @@ -39505,6 +42943,13 @@ msgstr "" "当用户改变工作空间([b]2D[/b]、[b]3D[/b]、[b]Script[/b]、[b]AssetLib[/b])时发" "出。也适用于由插件定义的自定义屏幕。" +msgid "" +"Emitted when any project setting has changed.\n" +"[i]Deprecated.[/i] Use [signal ProjectSettings.settings_changed] instead." +msgstr "" +"当任意项目设置发生改变时发出。\n" +"[i]已废弃。[/i]请改用 [signal ProjectSettings.settings_changed]。" + msgid "Emitted when the given [param resource] was saved on disc." msgstr "给定的资源 [param resource] 保存到磁盘时发出。" @@ -40069,6 +43514,51 @@ msgstr "" "如果插件要处理给定的 [Resource] 类型 [param type],则返回 [code]true[/code]。" msgid "" +"Create and return a tooltip that will be displayed when the user hovers a " +"resource under the given [param path] in filesystem dock.\n" +"The [param metadata] dictionary is provided by preview generator (see [method " +"EditorResourcePreviewGenerator._generate]).\n" +"[param base] is the base default tooltip, which is a [VBoxContainer] with a " +"file name, type and size labels. If another plugin handled the same file " +"type, [param base] will be output from the previous plugin. For best result, " +"make sure the base tooltip is part of the returned [Control].\n" +"[b]Note:[/b] It's unadvised to use [method ResourceLoader.load], especially " +"with heavy resources like models or textures, because it will make the editor " +"unresponsive when creating the tooltip. You can use [method " +"request_thumbnail] if you want to display a preview in your tooltip.\n" +"[b]Note:[/b] If you decide to discard the [param base], make sure to call " +"[method Node.queue_free], because it's not freed automatically.\n" +"[codeblock]\n" +"func _make_tooltip_for_path(path, metadata, base):\n" +" var t_rect = TextureRect.new()\n" +" request_thumbnail(path, t_rect)\n" +" base.add_child(t_rect) # The TextureRect will appear at the bottom of the " +"tooltip.\n" +" return base\n" +"[/codeblock]" +msgstr "" +"创建并返回工具提示,会在用户悬停在文件系统面板上路径为 [param path] 的资源上时" +"显示。\n" +"元数据字典 [param metadata] 由预览生成器提供(见 [method " +"EditorResourcePreviewGenerator._generate])。\n" +"[param base] 是基础的默认工具提示,是一个包含文件名、类型、大小标签的 " +"[VBoxContainer]。如果其他插件也能够处理相同的文件类型,那么 [param base] 就是" +"上一个插件的输出。为了达到最佳效果,请确保基础工具提示是返回的 [Control] 的一" +"部分。\n" +"[b]注意:[/b]不建议使用 [method ResourceLoader.load],尤其是模型、纹理等开销较" +"大的资源,否则会在创建工具提示时让编辑器失去响应。如果想要在工具提示中显示预" +"览,可以使用 [method request_thumbnail]。\n" +"[b]注意:[/b]如果你决定要丢弃 [param base],请确保调用了 [method Node." +"queue_free],否则不会自动释放。\n" +"[codeblock]\n" +"func _make_tooltip_for_path(path, metadata, base):\n" +" var t_rect = TextureRect.new()\n" +" request_thumbnail(path, t_rect)\n" +" base.add_child(t_rect) # TextureRect 会出现在工具提示的底部。\n" +" return base\n" +"[/codeblock]" + +msgid "" "Requests a thumbnail for the given [TextureRect]. The thumbnail is created " "asynchronously by [EditorResourcePreview] and automatically set when " "available." @@ -40243,6 +43733,9 @@ msgstr "" "[/csharp]\n" "[/codeblocks]" +msgid "Importing 3D scenes: Configuration: Using import scripts for automation" +msgstr "导入 3D 场景:配置:使用导入脚本进行自动化" + msgid "" "Called after the scene was imported. This method must return the modified " "version of the scene." @@ -40479,6 +43972,71 @@ msgid "Object that holds the project-independent editor settings." msgstr "保存编辑器设置的对象,这些设置与项目无关。" msgid "" +"Object that holds the project-independent editor settings. These settings are " +"generally visible in the [b]Editor > Editor Settings[/b] menu.\n" +"Property names use slash delimiters to distinguish sections. Setting values " +"can be of any [Variant] type. It's recommended to use [code]snake_case[/code] " +"for editor settings to be consistent with the Godot editor itself.\n" +"Accessing the settings can be done using the following methods, such as:\n" +"[codeblocks]\n" +"[gdscript]\n" +"var settings = EditorInterface.get_editor_settings()\n" +"# `settings.set(\"some/property\", 10)` also works as this class overrides " +"`_set()` internally.\n" +"settings.set_setting(\"some/property\", 10)\n" +"# `settings.get(\"some/property\")` also works as this class overrides " +"`_get()` internally.\n" +"settings.get_setting(\"some/property\")\n" +"var list_of_settings = settings.get_property_list()\n" +"[/gdscript]\n" +"[csharp]\n" +"EditorSettings settings = EditorInterface.Singleton.GetEditorSettings();\n" +"// `settings.set(\"some/property\", value)` also works as this class " +"overrides `_set()` internally.\n" +"settings.SetSetting(\"some/property\", Value);\n" +"// `settings.get(\"some/property\", value)` also works as this class " +"overrides `_get()` internally.\n" +"settings.GetSetting(\"some/property\");\n" +"Godot.Collections.Array<Godot.Collections.Dictionary> listOfSettings = " +"settings.GetPropertyList();\n" +"[/csharp]\n" +"[/codeblocks]\n" +"[b]Note:[/b] This class shouldn't be instantiated directly. Instead, access " +"the singleton using [method EditorInterface.get_editor_settings]." +msgstr "" +"保存编辑器设置的对象,这些设置与项目无关,通常在[b]编辑器 > 编辑器设置[/b]菜单" +"中可见。\n" +"属性名称中使用斜线分隔符来区分不同的部分。设置的值可以是任何 [Variant] 类型。" +"编辑器设置的名称建议使用 [code]snake_case[/code] 形式,与 Godot 编辑器本身保持" +"一致。\n" +"可以使用以下方法访问设置,例如:\n" +"[codeblocks]\n" +"[gdscript]\n" +"var settings = EditorInterface.get_editor_settings()\n" +"# 也可以写 `settings.set(\"some/property\", 10)`,因为这个类内部覆盖了 " +"`_set()`。\n" +"settings.set_setting(\"some/property\", 10)\n" +"# 也可以写 `settings.get(\"some/property\")` ,因为这个类内部覆盖了 " +"`_get()`。\n" +"settings.get_setting(\"some/property\")\n" +"var list_of_settings = settings.get_property_list()\n" +"[/gdscript]\n" +"[csharp]\n" +"EditorSettings settings = EditorInterface.Singleton.GetEditorSettings();\n" +"// 也可以写 `settings.set(\"some/property\", 10)`,因为这个类内部覆盖了 " +"`_set()`。\n" +"settings.SetSetting(\"some/property\", Value);\n" +"// 也可以写 `settings.get(\"some/property\")` ,因为这个类内部覆盖了 " +"`_get()`。\n" +"settings.GetSetting(\"some/property\");\n" +"Godot.Collections.Array<Godot.Collections.Dictionary> listOfSettings = " +"settings.GetPropertyList();\n" +"[/csharp]\n" +"[/codeblocks]\n" +"[b]注意:[/b]不能直接实例化这个类。请改用 [method EditorInterface." +"get_editor_settings] 访问单例。" + +msgid "" "Adds a custom property info to a property. The dictionary must contain:\n" "- [code]name[/code]: [String] (the name of the property)\n" "- [code]type[/code]: [int] (see [enum Variant.Type])\n" @@ -40781,12 +44339,34 @@ msgstr "" "bone_selected_color]。" msgid "" +"The outline size in the 2D skeleton editor (in pixels). See also [member " +"editors/2d/bone_width].\n" +"[b]Note:[/b] Changes to this value only apply after modifying a [Bone2D] node " +"in any way, or closing and reopening the scene." +msgstr "" +"2D 骨架编辑器中轮廓的大小(单位为像素)。另见 [member editors/2d/" +"bone_width]。\n" +"[b]注意:[/b]对此值的更改只有在以任何方式修改 [Bone2D] 节点,或者关闭并重新打" +"开场景后才会生效。" + +msgid "" "The color to use for selected bones in the 2D skeleton editor. See also " "[member editors/2d/bone_outline_color]." msgstr "" "2D 骨架编辑器中,用于已选中骨骼的颜色。另见 [member editors/2d/" "bone_outline_color]。" +msgid "" +"The bone width in the 2D skeleton editor (in pixels). See also [member " +"editors/2d/bone_outline_size].\n" +"[b]Note:[/b] Changes to this value only apply after modifying a [Bone2D] node " +"in any way, or closing and reopening the scene." +msgstr "" +"2D 骨架编辑器中的骨骼宽度(单位为像素)。另见 [member editors/2d/" +"bone_outline_size]。\n" +"[b]注意:[/b]对此值的更改只有在以任何方式修改 [Bone2D] 节点,或者关闭并重新打" +"开场景后才会生效。" + msgid "The grid color to use in the 2D editor." msgstr "2D 编辑器使用的栅格颜色。" @@ -40805,6 +44385,15 @@ msgstr "" "项”菜单中启用智能吸附,则移动 2D 节点时智能吸附线将自动显示。" msgid "" +"If [code]true[/code], the 2D editor will snap to integer zoom values while " +"not holding the [kbd]Alt[/kbd] key and powers of two while holding it. If " +"[code]false[/code], this behavior is swapped." +msgstr "" +"如果为 [code]true[/code],2D 编辑器将在不按住 [kbd]Alt[/kbd] 键的情况下吸附到" +"整数缩放值,并在按住时吸附到 2 的幂。如果为 [code]false[/code],则交换这种行" +"为。" + +msgid "" "The color of the viewport border in the 2D editor. This border represents the " "viewport's size at the base resolution defined in the Project Settings. " "Objects placed outside this border will not be visible unless a [Camera2D] " @@ -41456,6 +45045,24 @@ msgstr "" "blender/enabled]。" msgid "" +"The port number used for Remote Procedure Call (RPC) communication with " +"Godot's created process of the blender executable.\n" +"Setting this to 0 effectively disables communication with Godot and the " +"blender process, making performance slower." +msgstr "" +"用于与 Godot 创建的 Blender 可执行文件进程进行远程过程调用(RPC)通信的端口" +"号。\n" +"将其设置为 0 会有效禁用与 Godot 的通信和 Blender 进程,从而降低性能。" + +msgid "" +"The maximum idle uptime (in seconds) of the Blender process.\n" +"This prevents Godot from having to create a new process for each import " +"within the given seconds." +msgstr "" +"Blender 进程的最大空闲运行时间(单位为秒)。\n" +"能够在给定的秒数内,防止 Godot 每次导入都创建一个新的进程。" + +msgid "" "The path to the FBX2glTF executable used for converting Autodesk FBX 3D scene " "files [code].fbx[/code] to glTF 2.0 format during import.\n" "To enable this feature for your specific project, use [member ProjectSettings." @@ -41486,6 +45093,20 @@ msgstr "" "情况下,可能必须将其设置为 [code]false[/code],以防止出现文件锁定问题。" msgid "" +"The path to the directory containing the Open Image Denoise (OIDN) " +"executable, used optionally for denoising lightmaps. It can be downloaded " +"from [url=https://www.openimagedenoise.org/downloads.html]openimagedenoise." +"org[/url].\n" +"To enable this feature for your specific project, use [member ProjectSettings." +"rendering/lightmapping/denoising/denoiser]." +msgstr "" +"包含开放图像去噪(OIDN)可执行文件的目录路径,可选择用于去噪光照贴图。它可以" +"从 [url=https://www.openimagedenoise.org/downloads.html]openimagedenoise.org[/" +"url] 下载。\n" +"要为特定项目启用该功能,请使用 [member ProjectSettings.rendering/lightmapping/" +"denoising/denoiser]。" + +msgid "" "How to position the Cancel and OK buttons in the editor's [AcceptDialog]s. " "Different platforms have different standard behaviors for this, which can be " "overridden using this setting. This is useful if you use Godot both on " @@ -41920,19 +45541,19 @@ msgid "" "The icon and font color scheme to use in the editor.\n" "- [b]Auto[/b] determines the color scheme to use automatically based on " "[member interface/theme/base_color].\n" -"- [b]Dark[/b] makes fonts and icons light (suitable for dark themes).\n" -"- [b]Light[/b] makes fonts and icons dark (suitable for light themes). Icon " -"colors are automatically converted by the editor following [url=https://" -"github.com/godotengine/godot/blob/master/editor/editor_themes.cpp#L135]this " -"set of rules[/url]." +"- [b]Dark[/b] makes fonts and icons dark (suitable for light themes). Icon " +"colors are automatically converted by the editor following the set of rules " +"defined in [url=https://github.com/godotengine/godot/blob/master/editor/" +"editor_themes.cpp]this file[/url].\n" +"- [b]Light[/b] makes fonts and icons light (suitable for dark themes)." msgstr "" "在编辑器中使用的图标和字体的配色方案。\n" "- [b]Auto[/b] 根据 [member interface/theme/base_color] 自动确定要使用的配色方" "案。\n" -"- [b]Dark[/b] 使字体和图标变亮(适合深色主题)。\n" -"- [b]Light[/b] 使字体和图标变暗(适合浅色主题)。图标颜色由编辑器按照" +"- [b]Dark[/b] 使字体和图标变暗(适合浅色主题)。图标颜色由编辑器按照" "[url=https://github.com/godotengine/godot/blob/master/editor/editor_themes." -"cpp#L135]这组规则[/url]自动转换。" +"cpp]该文件[/url]中定义的一组规则自动转换。\n" +"- [b]Light[/b] 使字体和图标变亮(适合深色主题)。" msgid "" "The saturation to use for editor icons. Higher values result in more vibrant " @@ -42406,6 +46027,23 @@ msgid "" msgstr "用户停止输入后,应显示自动补全建议的延迟时间(以秒为单位)。" msgid "" +"If [code]true[/code], code completion will be triggered automatically after " +"[member text_editor/completion/code_complete_delay]. If [code]false[/code], " +"you can still trigger completion manually by pressing [kbd]Ctrl + Space[/kbd] " +"([kbd]Cmd + Space[/kbd] on macOS)." +msgstr "" +"如果为 [code]true[/code],代码补全将在 [member text_editor/completion/" +"code_complete_delay] 之后自动触发。如果为 [code]false[/code],你仍然可以通过" +"按 [kbd]Ctrl + Space[/kbd](在 macOS 上为 [kbd]Cmd + Space[/kbd])手动触发补" +"全。" + +msgid "" +"If [code]true[/code] enables the coloring for some items in the " +"autocompletion suggestions, like vector components." +msgstr "" +"如果为 [code]true[/code],则启用自动补全建议中某些项目的着色,例如向量分量。" + +msgid "" "If [code]true[/code], provides autocompletion suggestions for file paths in " "methods such as [code]load()[/code] and [code]preload()[/code]." msgstr "" @@ -42598,6 +46236,14 @@ msgstr "" "mark_color]。" msgid "" +"The script editor's documentation comment color. In GDScript, this is used " +"for comments starting with [code]##[/code]. In C#, this is used for comments " +"starting with [code]///[/code] or [code]/**[/code]." +msgstr "" +"脚本编辑器的文档注释颜色。在 GDScript 中,这被用于以 [code]##[/code] 开头的注" +"释。在 C# 中,这被用于以 [code]///[/code] 或 [code]/**[/code] 开头的注释。" + +msgid "" "The script editor's engine type color ([Vector2], [Vector3], [Color], ...)." msgstr "脚本编辑器中,引擎类型的颜色([Vector2]、[Vector3]、[Color]……)。" @@ -42607,6 +46253,10 @@ msgid "" msgstr "脚本编辑器中,调试器执行行图标(显示在装订线中)的颜色。" msgid "" +"The script editor's background line highlighting color for folded code region." +msgstr "脚本编辑器的背景行高亮颜色,用于折叠代码区块。" + +msgid "" "The script editor's function call color.\n" "[b]Note:[/b] When using the GDScript syntax highlighter, this is replaced by " "the function definition color configured in the syntax theme for function " @@ -42732,9 +46382,26 @@ msgstr "" msgid "Godot editor's control for editing numeric values." msgstr "Godot 编辑器用于编辑数值的控件。" +msgid "" +"This [Control] node is used in the editor's Inspector dock to allow editing " +"of numeric values. Can be used with [EditorInspectorPlugin] to recreate the " +"same behavior.\n" +"If the [member Range.step] value is [code]1[/code], the [EditorSpinSlider] " +"will display up/down arrows, similar to [SpinBox]. If the [member Range.step] " +"value is not [code]1[/code], a slider will be displayed instead." +msgstr "" +"这个 [Control] 节点在编辑器的检查器面板中使用,允许编辑数值。可以与 " +"[EditorInspectorPlugin] 一起使用,以重新创建相同的行为。\n" +"如果 [member Range.step] 值为 [code]1[/code],则 [EditorSpinSlider] 将显示向" +"上/向下箭头,类似于 [SpinBox]。如果 [member Range.step] 值不是 [code]1[/" +"code],则会显示一个滑块。" + msgid "If [code]true[/code], the slider will not draw background." msgstr "如果为 [code]true[/code],则滑块不会绘制背景。" +msgid "If [code]true[/code], the slider and up/down arrows are hidden." +msgstr "如果为 [code]true[/code],则隐藏滑块和向上/向下箭头。" + msgid "The text that displays to the left of the value." msgstr "在值的左侧显示的文本。" @@ -43444,6 +47111,13 @@ msgid "" "a file." msgstr "辅助函数,用于创建被编辑器用来读取文件状态的 [Dictionary]。" +msgid "" +"Pops up an error message in the editor which is shown as coming from the " +"underlying VCS. Use this to show VCS specific error messages." +msgstr "" +"在编辑器中弹出一条错误消息,显示为来自底层 VCS。使用它来显示 VCS 特定的错误消" +"息。" + msgid "A new file has been added." msgstr "添加了新文件。" @@ -43738,6 +47412,14 @@ msgstr "" "成时,生成该事件。该数组将包含断开连接的对等体。数据字段包含用户提供的描述断开" "连接的数据,如果没有可用的数据,则为 0。" +msgid "" +"A packet has been received from a peer. The array will contain the peer which " +"sent the packet and the channel number upon which the packet was received. " +"The received packet will be queued to the associated [ENetPacketPeer]." +msgstr "" +"已从对等体接收到一个数据包。该数组将包含发送数据包的对等体和接收数据包的通道" +"号。接收到的数据包将被排队到关联的 [ENetPacketPeer]。" + msgid "Total data sent." msgstr "发送数据的总数。" @@ -44928,6 +48610,30 @@ msgstr "" "前的等级没有启用。" msgid "" +"The global brightness value of the rendered scene. Effective only if [member " +"adjustment_enabled] is [code]true[/code]." +msgstr "" +"渲染场景的全局亮度值。只有当 [member adjustment_enabled] 为 [code]true[/code] " +"时才有效。" + +msgid "" +"The [Texture2D] or [Texture3D] lookup table (LUT) to use for the built-in " +"post-process color grading. Can use a [GradientTexture1D] for a 1-dimensional " +"LUT, or a [Texture3D] for a more complex LUT. Effective only if [member " +"adjustment_enabled] is [code]true[/code]." +msgstr "" +"用于内置后处理颜色分级的 [Texture2D] 或 [Texture3D] 查找表(LUT)。可以将 " +"[GradientTexture1D] 用于一维 LUT,或将 [Texture3D] 用于更复杂的 LUT。仅当 " +"[member adjustment_enabled] 为 [code]true[/code] 时有效。" + +msgid "" +"The global contrast value of the rendered scene (default value is 1). " +"Effective only if [member adjustment_enabled] is [code]true[/code]." +msgstr "" +"渲染场景的全局对比度值(默认值为 1)。只有当 [member adjustment_enabled] 为 " +"[code]true[/code] 时才有效。" + +msgid "" "If [code]true[/code], enables the [code]adjustment_*[/code] properties " "provided by this resource. If [code]false[/code], modifications to the " "[code]adjustment_*[/code] properties will have no effect on the rendered " @@ -44941,6 +48647,13 @@ msgstr "" "[b]注意:[/b]调整仅支持 Forward+ 和 Mobile 渲染方式,不支持 Compatibility。" msgid "" +"The global color saturation value of the rendered scene (default value is 1). " +"Effective only if [member adjustment_enabled] is [code]true[/code]." +msgstr "" +"渲染场景的全局色彩饱和度值(默认值为 1)。只有在 [member adjustment_enabled] " +"为 [code]true[/code] 时才有效。" + +msgid "" "The ambient light's [Color]. Only effective if [member " "ambient_light_sky_contribution] is lower than [code]1.0[/code] (exclusive)." msgstr "" @@ -46028,6 +49741,19 @@ msgid "Generates noise using the FastNoiseLite library." msgstr "使用 FastNoiseLite 库生成噪声。" msgid "" +"This class generates noise using the FastNoiseLite library, which is a " +"collection of several noise algorithms including Cellular, Perlin, Value, and " +"more.\n" +"Most generated noise values are in the range of [code][-1, 1][/code], but not " +"always. Some of the cellular noise algorithms return results above [code]1[/" +"code]." +msgstr "" +"该类使用 FastNoiseLite 库生成噪声,该库是多种噪声算法的集合,包括 Cellular、" +"Perlin、Value 等。\n" +"大多数生成的噪声值都在 [code][-1, 1][/code] 范围内,但并非总是如此。一些蜂窝噪" +"声算法返回高于 [code]1[/code] 的结果。" + +msgid "" "Determines how the distance to the nearest/second-nearest point is computed. " "See [enum CellularDistanceFunction] for options." msgstr "" @@ -46534,9 +50260,36 @@ msgstr "" "返回试图执行操作时发生的最后一个错误。请与 [enum Error] 中的 " "[code]ERR_FILE_*[/code] 常量比较。" +msgid "" +"Returns the whole [param path] file contents as a [PackedByteArray] without " +"any decoding.\n" +"Returns an empty [PackedByteArray] if an error occurred while opening the " +"file. You can use [method get_open_error] to check the error that occurred." +msgstr "" +"将整个 [param path] 文件内容作为 [PackedByteArray] 返回,无需任何解码。\n" +"如果打开文件时发生错误,则返回空的 [PackedByteArray]。你可以使用 [method " +"get_open_error] 来检查发生的错误。" + +msgid "" +"Returns the whole [param path] file contents as a [String]. Text is " +"interpreted as being UTF-8 encoded.\n" +"Returns an empty [String] if an error occurred while opening the file. You " +"can use [method get_open_error] to check the error that occurred." +msgstr "" +"将整个 [param path] 文件内容以 [String] 形式返回。文本被解释为 UTF-8 编码。\n" +"如果打开文件时发生错误,则返回空 [String]。可以使用 [method get_open_error] 来" +"检查发生的错误。" + msgid "Returns the next 32 bits from the file as a floating-point number." msgstr "将文件中接下来的 32 位作为浮点数返回。" +msgid "" +"Returns [code]true[/code], if file [code]hidden[/code] attribute is set.\n" +"[b]Note:[/b] This method is implemented on iOS, BSD, macOS, and Windows." +msgstr "" +"如果文件 [code]hidden[/code] 属性已设置,则返回 [code]true[/code]。\n" +"[b]注意:[/b]该方法在 iOS、BSD、macOS 和 Windows 上实现。" + msgid "Returns the size of the file in bytes." msgstr "返回该文件的大小,单位为字节。" @@ -46553,6 +50306,14 @@ msgid "" msgstr "返回一个给定路径文件的 MD5 字符串,如果失败则返回一个空的 [String]。" msgid "" +"Returns the last time the [param file] was modified in Unix timestamp format, " +"or [code]0[/code] on error. This Unix timestamp can be converted to another " +"format using the [Time] singleton." +msgstr "" +"返回 [param file] 的最后修改时间,使用 Unix 时间戳格式,出错时返回 [code]0[/" +"code]。这个 Unix 时间戳可以用 [Time] 单例转换为其他格式。" + +msgid "" "Returns a [String] saved in Pascal format from the file.\n" "Text is interpreted as being UTF-8 encoded." msgstr "" @@ -46568,6 +50329,13 @@ msgstr "返回当前打开的文件的绝对路径为[String]。" msgid "Returns the file cursor's position." msgstr "返回文件光标的位置。" +msgid "" +"Returns [code]true[/code], if file [code]read only[/code] attribute is set.\n" +"[b]Note:[/b] This method is implemented on iOS, BSD, macOS, and Windows." +msgstr "" +"如果文件 [code]read only[/code] 属性已设置,则返回 [code]true[/code]。\n" +"[b]注意:[/b]此方法在 iOS、BSD、macOS 和 Windows 上实现。" + msgid "Returns the next bits from the file as a floating-point number." msgstr "将文件中接下来的若干位以浮点数形式返回。" @@ -46578,6 +50346,13 @@ msgstr "" "返回一个给定路径的文件的 SHA-256 字符串,如果失败则返回一个空的 [String]。" msgid "" +"Returns file UNIX permissions.\n" +"[b]Note:[/b] This method is implemented on iOS, Linux/BSD, and macOS." +msgstr "" +"返回文件的 UNIX 权限。\n" +"[b]注意:[/b]该方法在 iOS、Linux/BSD 和 macOS 上实现。" + +msgid "" "Returns the next [Variant] value from the file. If [param allow_objects] is " "[code]true[/code], decoding objects is allowed.\n" "Internally, this uses the same decoding mechanism as the [method @GlobalScope." @@ -46660,6 +50435,27 @@ msgstr "" "[b]注意:[/b]这是一个偏移量,所以你应该使用负数,否则光标会在文件的末端。" msgid "" +"Sets file [b]hidden[/b] attribute.\n" +"[b]Note:[/b] This method is implemented on iOS, BSD, macOS, and Windows." +msgstr "" +"设置文件 [b]hidden[/b] 属性。\n" +"[b]注意:[/b]该方法在 iOS、BSD、macOS 和 Windows 上实现。" + +msgid "" +"Sets file [b]read only[/b] attribute.\n" +"[b]Note:[/b] This method is implemented on iOS, BSD, macOS, and Windows." +msgstr "" +"设置文件 [b]read only[/b] 属性。\n" +"[b]注意:[/b]该方法在 iOS、BSD、macOS 和 Windows 上实现。" + +msgid "" +"Sets file UNIX permissions.\n" +"[b]Note:[/b] This method is implemented on iOS, Linux/BSD, and macOS." +msgstr "" +"设置文件的 UNIX 权限。\n" +"[b]注意:[/b]该方法在 iOS、Linux/BSD 和 macOS 上实现。" + +msgid "" "Stores an integer as 8 bits in the file.\n" "[b]Note:[/b] The [param value] should lie in the interval [code][0, 255][/" "code]. Any other value will overflow and wrap around.\n" @@ -47053,6 +50849,18 @@ msgstr "" msgid "If [code]true[/code], the dialog will show hidden files." msgstr "如果为 [code]true[/code],对话框将显示出隐藏文件。" +msgid "" +"If [code]true[/code], [member access] is set to [constant ACCESS_FILESYSTEM], " +"and it is supported by the current [DisplayServer], OS native dialog will be " +"used instead of custom one.\n" +"[b]Note:[/b] On macOS, sandboxed apps always use native dialogs to access " +"host filesystem." +msgstr "" +"如果为 [code]true[/code],[member access] 被设置为[constant " +"ACCESS_FILESYSTEM],并且它被当前的 [DisplayServer] 支持,则将使用操作系统原生" +"对话框而不是自定义对话框。\n" +"[b]注意:[/b]在 macOS 上,沙盒应用程序始终使用原生对话框来访问主机文件系统。" + msgid "Emitted when the user selects a directory." msgstr "当用户选择一个目录时触发的。" @@ -47187,6 +50995,34 @@ msgstr "外部资源 [param resource] 的对应文件被移除时发出。" msgid "A built-in type for floating point numbers." msgstr "浮点数内置类型。" +msgid "" +"The [float] built-in type is a 64-bit double-precision floating-point number, " +"equivalent to [code]double[/code] in C++. This type has 14 reliable decimal " +"digits of precision. The maximum value of [float] is approximately " +"[code]1.79769e308[/code], and the minimum is approximately " +"[code]-1.79769e308[/code].\n" +"Many methods and properties in the engine use 32-bit single-precision " +"floating-point numbers instead, equivalent to [code skip-lint]float[/code] in " +"C++, which have 6 reliable decimal digits of precision. For data structures " +"such as [Vector2] and [Vector3], Godot uses 32-bit floating-point numbers by " +"default, but it can be changed to use 64-bit doubles if Godot is compiled " +"with the [code]precision=double[/code] option.\n" +"Math done using the [float] type is not guaranteed to be exact and will often " +"result in small errors. You should usually use the [method @GlobalScope." +"is_equal_approx] and [method @GlobalScope.is_zero_approx] methods instead of " +"[code]==[/code] to compare [float] values for equality." +msgstr "" +"[float] 内置类型是 64 位双精度浮点数,相当于 C++ 中的 [code]double[/code]。这" +"个类型有 14 个可靠的十进制小数位精度。[float] 的最大值约为 [code]1.79769e308[/" +"code],最小值约为 [code]-1.79769e308[/code]。\n" +"不过引擎中的许多方法和属性默认使用的都是 32 位单精度浮点数,相当于 C++ 中的 " +"[code skip-lint]float[/code],有 6 位可靠的十进制小数位精度。Godot 在 " +"[Vector2] 和 [Vector3] 等数据结构中默认使用 32 位浮点数,但如果 Godot 编译时使" +"用了 [code]precision=double[/code] 选项,就会改为 64 位的 double。\n" +"使用 [float] 类型进行的数学运算无法保证精确与稳定,经常会产生较小的误差。你通" +"常应该使用 [method @GlobalScope.is_equal_approx] 和 [method @GlobalScope." +"is_zero_approx] 方法来比较 [float] 值是否相等,不应该用 [code]==[/code]。" + msgid "Wikipedia: Double-precision floating-point format" msgstr "维基百科:双精度浮点数格式" @@ -47233,6 +51069,18 @@ msgid "" msgstr "如果整数的值与浮点数不同,则返回 [code]true[/code]。" msgid "" +"Multiplies each component of the [Color], including the alpha, by the given " +"[float].\n" +"[codeblock]\n" +"print(1.5 * Color(0.5, 0.5, 0.5)) # Prints \"(0.75, 0.75, 0.75, 1.5)\"\n" +"[/codeblock]" +msgstr "" +"将该 [Color] 的每个分量乘以给定的 [float],包括 Alpha。\n" +"[codeblock]\n" +"print(1.5 * Color(0.5, 0.5, 0.5)) # 输出“(0.75, 0.75, 0.75, 1.5)”\n" +"[/codeblock]" + +msgid "" "Multiplies each component of the [Quaternion] by the given [float]. This " "operation is not meaningful on its own, but it can be used as a part of a " "larger expression." @@ -47456,6 +51304,11 @@ msgid "The vertical separation of children nodes." msgstr "子节点的垂直分隔量。" msgid "" +"A material that controls how volumetric fog is rendered, to be assigned to a " +"[FogVolume]." +msgstr "控制体积雾渲染方式的材质,可被分配给 [FogVolume]。" + +msgid "" "A [Material] resource that can be used by [FogVolume]s to draw volumetric " "effects.\n" "If you need more advanced effects, use a custom [url=$DOCS_URL/tutorials/" @@ -47525,6 +51378,11 @@ msgstr "" "度阈值由关联的 [FogVolume] 的高度决定。" msgid "" +"A region that contributes to the default volumetric fog from the world " +"environment." +msgstr "影响世界环境中默认体积雾的区块。" + +msgid "" "[FogVolume]s are used to add localized fog into the global volumetric fog " "effect. [FogVolume]s can also remove volumetric fog from specific areas if " "using a [FogMaterial] with a negative [member FogMaterial.density].\n" @@ -47938,6 +51796,16 @@ msgid "Sets LRU cache capacity for [code]draw_*[/code] methods." msgstr "为 [code]draw_*[/code] 方法设置 LRU 缓存容量。" msgid "" +"Array of fallback [Font]s to use as a substitute if a glyph is not found in " +"this current [Font].\n" +"If this array is empty in a [FontVariation], the [member FontVariation." +"base_font]'s fallbacks are used instead." +msgstr "" +"回退 [Font] 数组,会在这个当前 [Font] 中无法找到某个字形时用作替换。\n" +"如果 [FontVariation] 中的这个数组为空,则会改用 [member FontVariation." +"base_font] 的回退字体。" + +msgid "" "Holds font source data and prerendered glyph cache, imported from a dynamic " "or a bitmap font." msgstr "存放字体源数据和预渲染字形的缓存,从动态字体或位图字体导入。" @@ -48067,6 +51935,16 @@ msgid "" msgstr "返回加粗强度,如果不等于零,则加粗字体轮廓。负值会减小轮廓粗细。" msgid "" +"Returns spacing for [param spacing] (see [enum TextServer.SpacingType]) in " +"pixels (not relative to the font size)." +msgstr "" +"返回 [param spacing] 的间距(见 [enum TextServer.SpacingType]),单位为像素" +"(与字体大小无关)。" + +msgid "Returns an active face index in the TrueType / OpenType collection." +msgstr "返回 TrueType / OpenType 集合中的活动字体索引。" + +msgid "" "Returns glyph advance (offset of the next glyph).\n" "[b]Note:[/b] Advance for glyphs outlines is the same as the base glyph " "advance and is not saved." @@ -48116,6 +51994,12 @@ msgstr "如果为 [param script] 启用了支持覆盖,则返回 [code]true[/c msgid "Returns list of script support overrides." msgstr "返回文字支持覆盖的列表。" +msgid "" +"Returns list of the font sizes in the cache. Each size is [Vector2i] with " +"font size and outline size." +msgstr "" +"返回缓存中字体大小的列表。每个大小都是由字体大小和轮廓大小组成的 [Vector2i]。" + msgid "Returns number of textures used by font cache entry." msgstr "返回字体缓存条目所使用的纹理数。" @@ -48218,6 +52102,13 @@ msgid "" "Negative values reduce the outline thickness." msgstr "设置加粗强度,如果不等于零,则会加粗字体的轮廓。负值会减小轮廓的厚度。" +msgid "" +"Sets the spacing for [param spacing] (see [enum TextServer.SpacingType]) to " +"[param value] in pixels (not relative to the font size)." +msgstr "" +"将 [param spacing] 的间距(见 [enum TextServer.SpacingType])设置为 [param " +"value],单位为像素(与字体大小无关)。" + msgid "Sets an active face index in the TrueType / OpenType collection." msgstr "在 TrueType / OpenType 集合中设置活动字体索引。" @@ -48282,6 +52173,11 @@ msgstr "动态字体源文件的内容。" msgid "Font size, used only for the bitmap fonts." msgstr "字体大小,仅用于位图字体。" +msgid "" +"Scaling mode, used only for the bitmap fonts with [member fixed_size] greater " +"than zero." +msgstr "缩放模式,只有 [member fixed_size] 大于零的位图字体会使用。" + msgid "Font family name." msgstr "字体家族名称。" @@ -48491,6 +52387,31 @@ msgid "Active face index in the TrueType / OpenType collection file." msgstr "在 TrueType / OpenType 集合文件中的活动字体索引。" msgid "" +"Font OpenType variation coordinates. More info: [url=https://docs.microsoft." +"com/en-us/typography/opentype/spec/dvaraxisreg]OpenType variation tags[/" +"url].\n" +"[b]Note:[/b] This [Dictionary] uses OpenType tags as keys. Variation axes can " +"be identified both by tags ([int], e.g. [code]0x77678674[/code]) and names " +"([String], e.g. [code]wght[/code]). Some axes might be accessible by multiple " +"names. For example, [code]wght[/code] refers to the same axis as " +"[code]weight[/code]. Tags on the other hand are unique. To convert between " +"names and tags, use [method TextServer.name_to_tag] and [method TextServer." +"tag_to_name].\n" +"[b]Note:[/b] To get available variation axes of a font, use [method Font." +"get_supported_variation_list]." +msgstr "" +"字体 OpenType 变体坐标。详见:[url=https://docs.microsoft.com/en-us/" +"typography/opentype/spec/dvaraxisreg]OpenType 变体标签[/url]。\n" +"[b]注意:[/b]这个 [Dictionary] 使用 OpenType 标签作为键。变体轴既可以用标签来" +"标识([int],例如 [code]0x77678674[/code]),也可以用名称来标识([String],例" +"如 [code]wght[/code])。有些轴可以通过多个名称来访问。例如,[code]wght[/code] " +"和 [code]weight[/code] 引用的是同一个轴。而标签则是唯一的。要在名称和标签之间" +"转换,请使用 [method TextServer.name_to_tag] 和 [method TextServer." +"tag_to_name]。\n" +"[b]注意:[/b]要获取字体的可用变体轴,请使用 [method Font." +"get_supported_variation_list]。" + +msgid "" "2D transform, applied to the font outlines, can be used for slanting, " "flipping and rotating glyphs.\n" "For example, to simulate italic typeface by slanting, apply the following " @@ -48500,6 +52421,9 @@ msgstr "" "例如,要通过倾斜来模拟斜体字体,请应用以下变换 [code]Transform2D(1.0, slant, " "0.0, 1.0, 0.0, 0.0)[/code]。" +msgid "Emitted after the editor has automatically reloaded any extensions." +msgstr "在编辑器自动重新加载任何扩展后发出。" + msgid "A script implemented in the GDScript programming language." msgstr "用 GDScript 编程语言实现的脚本。" @@ -49315,6 +53239,11 @@ msgstr "" "多边形的点。" msgid "" +"Calculates and returns all the vertex points of a convex shape defined by an " +"array of [param planes]." +msgstr "计算并返回由一组 [param planes] 定义的凸形状的所有顶点。" + +msgid "" "Returns the 3D point on the 3D segment ([param s1], [param s2]) that is " "closest to [param point]. The returned point will always be inside the " "specified segment." @@ -49343,6 +53272,22 @@ msgstr "" "[param q1]) 和 ([param p2], [param q2]) 上的点。" msgid "" +"Returns a [Vector3] containing weights based on how close a 3D position " +"([param point]) is to a triangle's different vertices ([param a], [param b] " +"and [param c]). This is useful for interpolating between the data of " +"different vertices in a triangle. One example use case is using this to " +"smoothly rotate over a mesh instead of relying solely on face normals.\n" +"[url=https://en.wikipedia.org/wiki/Barycentric_coordinate_system]Here is a " +"more detailed explanation of barycentric coordinates.[/url]" +msgstr "" +"返回一个 [Vector3],其中包含基于 3D 位置([param point])与三角形不同顶点" +"([param a]、[param b] 和 [param c])的接近程度的权重。这对于在三角形中不同顶" +"点的数据之间进行插值非常有用。一个示例用例是使用它在网格上平滑旋转,而不是仅仅" +"依赖于面法线。\n" +"[url=https://en.wikipedia.org/wiki/Barycentric_coordinate_system]这里是重心坐" +"标的更详细解释。[/url]" + +msgid "" "Tests if the 3D ray starting at [param from] with the direction of [param " "dir] intersects the triangle specified by [param a], [param b] and [param c]. " "If yes, returns the point of intersection as [Vector3]. If no intersection " @@ -49818,6 +53763,34 @@ msgstr "" "Godot 使用的是直径的米数。映射到 GLTF 的 [code]ymag[/code] 属性。只在正交相机" "中使用,即 [member perspective] 为 false 时。" +msgid "Class for importing and exporting glTF files in and out of Godot." +msgstr "用于在 Godot 中导入和导出 glTF 文件的类。" + +msgid "" +"GLTFDocument supports reading data from a glTF file, buffer, or Godot scene. " +"This data can then be written to the filesystem, buffer, or used to create a " +"Godot scene.\n" +"All of the data in a GLTF scene is stored in the [GLTFState] class. " +"GLTFDocument processes state objects, but does not contain any scene data " +"itself. GLTFDocument has member variables to store export configuration " +"settings such as the image format, but is otherwise stateless. Multiple " +"scenes can be processed with the same settings using the same GLTFDocument " +"object and different [GLTFState] objects.\n" +"GLTFDocument can be extended with arbitrary functionality by extending the " +"[GLTFDocumentExtension] class and registering it with GLTFDocument via " +"[method register_gltf_document_extension]. This allows for custom data to be " +"imported and exported." +msgstr "" +"GLTFDocument 支持从 glTF 文件、缓冲区、或 Godot 场景中读取数据。然后可以将该数" +"据写入文件系统、缓冲区、或用于创建 Godot 场景。\n" +"GLTF 场景中的所有数据都存储在 [GLTFState] 类中。GLTFDocument 处理状态对象,但" +"本身不包含任何场景数据。GLTFDocument 有成员变量来存储如图像格式等导出配置设" +"置,但在其他方面是无状态的。可以使用相同的 GLTFDocument 对象和不同的 " +"[GLTFState] 对象以相同的设置处理多个场景。\n" +"通过扩展 [GLTFDocumentExtension] 类并通过 [method " +"register_gltf_document_extension] 将其注册到 GLTFDocument,则可以使用任意功能" +"来扩展 GLTFDocument。这允许自定义数据被导入和导出。" + msgid "glTF 'What the duck?' guide" msgstr "glTF '鸭子是什么?' 指南" @@ -49896,6 +53869,73 @@ msgstr "" "[b]注意:[/b]glTF 文件的扩展名决定了它是一个 .glb 二进制文件还是一个 .gltf 文" "件。" +msgid "" +"The user-friendly name of the export image format. This is used when " +"exporting the GLTF file, including writing to a file and writing to a byte " +"array.\n" +"By default, Godot allows the following options: \"None\", \"PNG\", \"JPEG\", " +"\"Lossless WebP\", and \"Lossy WebP\". Support for more image formats can be " +"added in [GLTFDocumentExtension] classes." +msgstr "" +"导出图像格式的用户友好名称。这被用于导出 GLTF 文件,包括写入文件和写入字节数" +"组。\n" +"默认情况下,Godot 允许以下选项:“无”、“PNG”、“JPEG”、“无损 WebP”、和“有损 " +"WebP”。可以使用 [GLTFDocumentExtension] 类添加对更多图像格式的支持。" + +msgid "" +"If [member image_format] is a lossy image format, this determines the lossy " +"quality of the image. On a range of [code]0.0[/code] to [code]1.0[/code], " +"where [code]0.0[/code] is the lowest quality and [code]1.0[/code] is the " +"highest quality. A lossy quality of [code]1.0[/code] is not the same as " +"lossless." +msgstr "" +"如果 [member image_format] 是有损图像格式,则这决定了该图像的有损质量。在 " +"[code]0.0[/code] 到 [code]1.0[/code] 范围内,其中 [code]0.0[/code] 是最低质" +"量,[code]1.0[/code] 是最高质量。[code]1.0[/code] 的有损质量不同于无损质量。" + +msgid "" +"How to process the root node during export. See [enum RootNodeMode] for " +"details. The default and recommended value is [constant " +"ROOT_NODE_MODE_SINGLE_ROOT].\n" +"[b]Note:[/b] Regardless of how the glTF file is exported, when importing, the " +"root node type and name can be overridden in the scene import settings tab." +msgstr "" +"导出时如何处理根节点。详见 [enum RootNodeMode]。默认和推荐值为 [constant " +"ROOT_NODE_MODE_SINGLE_ROOT]。\n" +"[b]注意:[/b]无论 glTF 文件如何导出,导入时,根节点类型和名称都可以在场景导入" +"设置选项卡中被覆盖。" + +msgid "" +"Treat the Godot scene's root node as the root node of the glTF file, and mark " +"it as the single root node via the [code]GODOT_single_root[/code] glTF " +"extension. This will be parsed the same as [constant " +"ROOT_NODE_MODE_KEEP_ROOT] if the implementation does not support " +"[code]GODOT_single_root[/code]." +msgstr "" +"将 Godot 场景的根节点视为 glTF 文件的根节点,并通过 [code]GODOT_single_root[/" +"code] glTF 扩展将其标记为单根节点。如果实现不支持 [code]GODOT_single_root[/" +"code],这将与 [constant ROOT_NODE_MODE_KEEP_ROOT] 进行相同的解析。" + +msgid "" +"Treat the Godot scene's root node as the root node of the glTF file, but do " +"not mark it as anything special. An extra root node will be generated when " +"importing into Godot. This uses only vanilla glTF features. This is " +"equivalent to the behavior in Godot 4.1 and earlier." +msgstr "" +"将 Godot 场景的根节点视为 glTF 文件的根节点,但不要将其标记为任何特殊的东西。" +"导入 Godot 时会生成一个额外的根节点。这仅使用普通 glTF 功能。这相当于 Godot " +"4.1 及更早版本中的行为。" + +msgid "" +"Treat the Godot scene's root node as the name of the glTF scene, and add all " +"of its children as root nodes of the glTF file. This uses only vanilla glTF " +"features. This avoids an extra root node, but only the name of the Godot " +"scene's root node will be preserved, as it will not be saved as a node." +msgstr "" +"将 Godot 场景的根节点视为 glTF 场景的名称,并将其所有子节点添加为 glTF 文件的" +"根节点。这仅使用普通 glTF 功能。这避免了额外的根节点,但只会保留 Godot 场景根" +"节点的名称,因为它不会被保存为节点。" + msgid "[GLTFDocument] extension class." msgstr "[GLTFDocument] 扩展类。" @@ -49920,6 +53960,30 @@ msgstr "" "[code]set_additional_data[/code] 和 [code]get_additional_data[/code] 方法。" msgid "" +"Part of the export process. This method is run after [method " +"_export_preflight] and before [method _export_preserialize].\n" +"Runs when converting the data from a Godot scene node. This method can be " +"used to process the Godot scene node data into a format that can be used by " +"[method _export_node]." +msgstr "" +"导出过程的一部分。该方法在 [method _export_preflight] 之后和 [method " +"_export_preserialize] 之前运行。\n" +"在转换来自 Godot 场景节点的数据时运行。该方法可用于将 Godot 场景节点的数据,处" +"理成可以被 [method _export_node] 使用的格式。" + +msgid "" +"Part of the export process. This method is run after [method " +"_get_saveable_image_formats] and before [method _export_post]. If this " +"[GLTFDocumentExtension] is used for exporting images, this runs after [method " +"_serialize_texture_json].\n" +"This method can be used to modify the final JSON of each node." +msgstr "" +"导出过程的一部分。该方法在 [method _get_saveable_image_formats] 之后 [method " +"_export_post] 之前运行。如果该 [GLTFDocumentExtension] 用于导出图像,则会在 " +"[method _serialize_texture_json] 之后运行。\n" +"该方法可用于修改每个节点的最终 JSON。" + +msgid "" "Part of the export process. This method is run last, after all other parts of " "the export process.\n" "This method can be used to modify the final JSON of the generated GLTF file." @@ -49941,6 +54005,69 @@ msgstr "" "没有被重写,则返回 [constant OK]。" msgid "" +"Part of the export process. This method is run after [method " +"_convert_scene_node] and before [method _get_saveable_image_formats].\n" +"This method can be used to alter the state before performing serialization. " +"It runs every time when generating a buffer with [method GLTFDocument." +"generate_buffer] or writing to the file system with [method GLTFDocument." +"write_to_filesystem]." +msgstr "" +"导入过程的一部分。该方法在 [method _convert_scene_node] 之后 [method " +"_get_saveable_image_formats] 之前运行。\n" +"该方法可用于在执行序列化之前更改状态。每次使用 [method GLTFDocument." +"generate_buffer] 生成缓冲区或使用[method GLTFDocument.write_to_filesystem]写入" +"文件系统时,它都会运行。" + +msgid "" +"Part of the import process. This method is run after [method " +"_import_post_parse] and before [method _import_node].\n" +"Runs when generating a Godot scene node from a GLTFNode. The returned node " +"will be added to the scene tree. Multiple nodes can be generated in this step " +"if they are added as a child of the returned node.\n" +"[b]Note:[/b] The [param scene_parent] parameter may be null if this is the " +"single root node." +msgstr "" +"导入过程的一部分。该方法在 [method _import_post_parse] 之后 [method " +"_import_node] 之前运行。\n" +"当从 GLTFNode 生成一个 Godot 场景节点时运行。返回的节点将被添加到场景树中。如" +"果将多个节点添加为返回节点的子节点,则可以在该步骤中生成这些节点。\n" +"[b]注意:[/b]如果这是单个根节点,则 [param scene_parent] 参数可以为 null。" + +msgid "" +"Returns the file extension to use for saving image data into, for example, " +"[code]\".png\"[/code]. If defined, when this extension is used to handle " +"images, and the images are saved to a separate file, the image bytes will be " +"copied to a file with this extension. If this is set, there should be a " +"[ResourceImporter] class able to import the file. If not defined or empty, " +"Godot will save the image into a PNG file." +msgstr "" +"返回用于保存图像数据的文件的文件扩展名,例如 [code]\".png\"[/code]。如果定义" +"了,当使用该扩展名处理图像并将图像保存到单独的文件时,图像字节将被复制到具有该" +"扩展名的文件中。如果设置了该选项,则应该有一个能够导入该文件的 " +"[ResourceImporter] 类。如果未定义或为空,则 Godot 会将该图像保存到 PNG 文件" +"中。" + +msgid "" +"Part of the export process. This method is run after [method " +"_convert_scene_node] and before [method _export_node].\n" +"Returns an array of the image formats that can be saved/exported by this " +"extension. This extension will only be selected as the image exporter if the " +"[GLTFDocument]'s [member GLTFDocument.image_format] is in this array. If this " +"[GLTFDocumentExtension] is selected as the image exporter, one of the [method " +"_save_image_at_path] or [method _serialize_image_to_bytes] methods will run " +"next, otherwise [method _export_node] will run next. If the format name " +"contains [code]\"Lossy\"[/code], the lossy quality slider will be displayed." +msgstr "" +"导出过程的一部分。该方法在 [method _convert_scene_node] 之后和 [method " +"_export_node] 之前运行。\n" +"返回可以由该扩展保存/导出的图像格式的数组。仅当 [GLTFDocument] 的 [member " +"GLTFDocument.image_format] 在该数组中时,才会选择该扩展作为图像导出器。如果选" +"择该 [GLTFDocumentExtension] 作为图像导出器,则接下来将运行 [method " +"_save_image_at_path] 或 [method _serialize_image_to_bytes] 方法之一,否则接下" +"来将运行 [method _export_node]。如果格式名称包含 [code]\"Lossy\"[/code],则会" +"显示有损质量滑块。" + +msgid "" "Part of the import process. This method is run after [method " "_import_preflight] and before [method _parse_node_extensions].\n" "Returns an array of the GLTF extensions supported by this " @@ -49953,6 +54080,16 @@ msgstr "" "一个具有所需扩展名的 GLTF 文件。" msgid "" +"Part of the import process. This method is run after [method " +"_generate_scene_node] and before [method _import_post].\n" +"This method can be used to make modifications to each of the generated Godot " +"scene nodes." +msgstr "" +"导入过程的一部分。该方法在 [method _generate_scene_node] 之后 [method " +"_import_post] 之前运行。\n" +"该方法可用于对生成的每个 Godot 场景节点进行修改。" + +msgid "" "Part of the import process. This method is run last, after all other parts of " "the import process.\n" "This method can be used to modify the final Godot scene generated by the " @@ -49962,6 +54099,17 @@ msgstr "" "该方法可用于修改导入过程生成的最终 Godot 场景。" msgid "" +"Part of the import process. This method is run after [method " +"_parse_node_extensions] and before [method _generate_scene_node].\n" +"This method can be used to modify any of the data imported so far, including " +"any scene nodes, before running the final per-node import step." +msgstr "" +"导入过程的一部分。该方法在 [method _parse_node_extensions] 之后 [method " +"_generate_scene_node] 之前运行。\n" +"在运行最终的各节点导入步骤之前,该方法可用于修改到目前为止导入的任何数据,包括" +"任何场景节点。" + +msgid "" "Part of the import process. This method is run first, before all other parts " "of the import process.\n" "The return value is used to determine if this [GLTFDocumentExtension] " @@ -49987,6 +54135,20 @@ msgstr "" msgid "" "Part of the import process. This method is run after [method " +"_get_supported_extensions] and before [method _import_post_parse].\n" +"Runs when parsing the node extensions of a GLTFNode. This method can be used " +"to process the extension JSON data into a format that can be used by [method " +"_generate_scene_node]. The return value should be a member of the [enum " +"Error] enum." +msgstr "" +"导入过程的一部分。该方法在 [method _get_supported_extensions] 之后和 [method " +"_import_post_parse] 之前运行。\n" +"在解析 GLTFNode 的节点扩展时运行。该方法可用于将扩展 JSON 数据,处理成可被 " +"[method _generate_scene_node] 使用的格式。该返回值应该是 [enum Error] 枚举中的" +"一个成员。" + +msgid "" +"Part of the import process. This method is run after [method " "_parse_image_data] and before [method _generate_scene_node].\n" "Runs when parsing the texture JSON from the GLTF textures array. This can be " "used to set the source image index to use as the texture." @@ -49995,6 +54157,59 @@ msgstr "" "_generate_scene_node] 之前运行。\n" "从 GLTF 纹理数组中解析纹理 JSON 时运行。可用于设置用作纹理的源图像索引。" +msgid "" +"Part of the export process. This method is run after [method " +"_get_saveable_image_formats] and before [method _serialize_texture_json].\n" +"This method is run when saving images separately from the GLTF file. When " +"images are embedded, [method _serialize_image_to_bytes] runs instead. Note " +"that these methods only run when this [GLTFDocumentExtension] is selected as " +"the image exporter." +msgstr "" +"导入过程的一部分。该方法在 [method _get_saveable_image_formats] 之后 [method " +"_serialize_texture_json] 之前运行。\n" +"当与 GLTF 文件分开保存图像时运行该方法。嵌入图像时,将运行 [method " +"_serialize_image_to_bytes]。请注意,这些方法仅在选择该 " +"[GLTFDocumentExtension] 作为图像导出器时运行。" + +msgid "" +"Part of the export process. This method is run after [method " +"_get_saveable_image_formats] and before [method _serialize_texture_json].\n" +"This method is run when embedding images in the GLTF file. When images are " +"saved separately, [method _save_image_at_path] runs instead. Note that these " +"methods only run when this [GLTFDocumentExtension] is selected as the image " +"exporter.\n" +"This method must set the image MIME type in the [param image_dict] with the " +"[code]\"mimeType\"[/code] key. For example, for a PNG image, it would be set " +"to [code]\"image/png\"[/code]. The return value must be a [PackedByteArray] " +"containing the image data." +msgstr "" +"导出过程的一部分。该方法在 [method _get_saveable_image_formats] 之后和 " +"[method _serialize_texture_json] 之前运行。\n" +"在 GLTF 文件中嵌入图像时运行该方法。当图像单独保存时,将运行 [method " +"_save_image_at_path]。请注意,这些方法仅在选择该 [GLTFDocumentExtension] 作为" +"图像导出器时运行。\n" +"该方法必须使用 [code]\"mimeType\"[/code] 键在 [param image_dict] 中设置该图像" +"的 MIME 类型。例如,对于 PNG 图像,它将被设置为 [code]\"image/png\"[/code]。该" +"返回值必须是包含该图像数据的 [PackedByteArray]。" + +msgid "" +"Part of the export process. This method is run after [method " +"_save_image_at_path] or [method _serialize_image_to_bytes], and before " +"[method _export_node]. Note that this method only runs when this " +"[GLTFDocumentExtension] is selected as the image exporter.\n" +"This method can be used to set up the extensions for the texture JSON by " +"editing [param texture_json]. The extension must also be added as used " +"extension with [method GLTFState.add_used_extension], be sure to set " +"[code]required[/code] to [code]true[/code] if you are not providing a " +"fallback." +msgstr "" +"导出过程的一部分。该方法在 [method _save_image_at_path] 或 [method " +"_serialize_image_to_bytes] 之后、[method _export_node] 之前运行。请注意,该方" +"法仅在选择该 [GLTFDocumentExtension] 作为图像导出器时运行。\n" +"该方法可用于通过编辑 [param texture_json] 设置该纹理 JSON 的扩展。还必须使用 " +"[method GLTFState.add_used_extension] 将该扩展添加为使用的扩展,如果你不提供后" +"备,请务必将 [code]required[/code] 设置为 [code]true[/code]。" + msgid "Represents a GLTF light." msgstr "代表 GLTF 灯光。" @@ -50235,6 +54450,20 @@ msgstr "" "该物理体的角速度,单位为弧度每秒。仅在物体类型为“rigid”或“vehicle”时使用。" msgid "" +"The type of the body. When importing, this controls what type of " +"[CollisionObject3D] node Godot should generate. Valid values are \"static\", " +"\"kinematic\", \"character\", \"rigid\", \"vehicle\", and \"trigger\"." +msgstr "" +"该物体的类型。导入时,控制 Godot 应该生成何种类型的 [CollisionObject3D] 节点。" +"有效值有“static”“kinematic”“character”“rigid”“vehicle”“trigger”。" + +msgid "" +"The center of mass of the body, in meters. This is in local space relative to " +"the body. By default, the center of the mass is the body's origin." +msgstr "" +"该物体的质心,单位为米。使用相对于物体的局部空间。质心默认为物体的原点。" + +msgid "" "The inertia tensor of the physics body, in kilogram meter squared (kg⋅m²). " "This is only used when the body type is \"rigid\" or \"vehicle\".\n" "When converted to a Godot [RigidBody3D] node, if this value is zero, then the " @@ -50648,6 +54877,33 @@ msgid "" msgstr "设置该状态中的唯一节点名称。这用于导入过程和导出过程。" msgid "" +"The folder path associated with this GLTF data. This is used to find other " +"files the GLTF file references, like images or binary buffers. This will be " +"set during import when appending from a file, and will be set during export " +"when writing to a file." +msgstr "" +"与该 GLTF 数据关联的文件夹路径。这用于查找该 GLTF 文件引用的其他文件,例如图像" +"或二进制缓冲区。这将在导入期间从文件追加时设置,并将在导出期间写入文件时设置。" + +msgid "" +"The copyright string in the asset header of the GLTF file. This is set during " +"import if present and export if non-empty. See the GLTF asset header " +"documentation for more information." +msgstr "" +"该 GLTF 文件的资产标头中的版权字符串。如果存在,则在导入期间设置;如果非空则在" +"导出期间设置。详见 GLTF 资产标头文档。" + +msgid "" +"The file name associated with this GLTF data. If it ends with [code].gltf[/" +"code], this is text-based GLTF, otherwise this is binary GLB. This will be " +"set during import when appending from a file, and will be set during export " +"when writing to a file. If writing to a buffer, this will be an empty string." +msgstr "" +"与该 GLTF 数据关联的文件名。如果它以 [code].gltf[/code] 结尾,则这是基于文本" +"的 GLTF,否则这是二进制 GLB。这将在导入期间从文件追加时设置,并将在导出期间写" +"入文件时设置。如果写入到缓冲区,这将是一个空字符串。" + +msgid "" "The root nodes of the GLTF file. Typically, a GLTF file will only have one " "scene, and therefore one root node. However, a GLTF file may have multiple " "scenes and therefore multiple root nodes, which will be generated as siblings " @@ -50746,6 +55002,24 @@ msgstr "" msgid "A 2D particle emitter." msgstr "2D 粒子发射器。" +msgid "" +"2D particle node used to create a variety of particle systems and effects. " +"[GPUParticles2D] features an emitter that generates some number of particles " +"at a given rate.\n" +"Use the [member process_material] property to add a [ParticleProcessMaterial] " +"to configure particle appearance and behavior. Alternatively, you can add a " +"[ShaderMaterial] which will be applied to all particles.\n" +"2D particles can optionally collide with [LightOccluder2D], but they don't " +"collide with [PhysicsBody2D] nodes." +msgstr "" +"2D 粒子节点,用于创建各种粒子系统和效果。[GPUParticles2D] 是一个发射器,特点是" +"以给定的速度生成一定数量的粒子。\n" +"使用 [member process_material] 属性来添加一个配置粒子的外观和行为的 " +"[ParticleProcessMaterial]。或者,你可以添加一个应用于所有粒子的 " +"[ShaderMaterial]。\n" +"2D 粒子可以选择与 [LightOccluder2D] 碰撞,但它们不会与 [PhysicsBody2D] 节点碰" +"撞。" + msgid "2D Particles Demo" msgstr "2D 粒子演示" @@ -50754,6 +55028,18 @@ msgid "" msgstr "2D Dodge The Creeps 演示(玩家身后的拖尾使用的是 GPUParticles2D)" msgid "" +"Returns a rectangle containing the positions of all existing particles.\n" +"[b]Note:[/b] When using threaded rendering this method synchronizes the " +"rendering thread. Calling it often may have a negative impact on performance." +msgstr "" +"返回一个包含所有已有粒子位置的矩形。\n" +"[b]注意:[/b]当使用线程渲染时,该方法会同步渲染线程。经常调用它可能会对性能产" +"生负面影响。" + +msgid "Sets this node's properties to match a given [CPUParticles2D] node." +msgstr "设置该节点的属性以匹配给定的 [CPUParticles2D] 节点。" + +msgid "" "Emits a single particle. Whether [param xform], [param velocity], [param " "color] and [param custom] are applied depends on the value of [param flags]. " "See [enum EmitFlags]." @@ -50765,11 +55051,84 @@ msgid "Restarts all the existing particles." msgstr "重新启动所有现有的粒子。" msgid "" +"The number of particles to emit in one emission cycle. The effective emission " +"rate is [code](amount * amount_ratio) / lifetime[/code] particles per second. " +"Higher values will increase GPU requirements, even if not all particles are " +"visible at a given time or if [member amount_ratio] is decreased.\n" +"[b]Note:[/b] Changing this value will cause the particle system to restart. " +"To avoid this, change [member amount_ratio] instead." +msgstr "" +"一个发射周期内发射的粒子数。有效发射速率为每秒 [code](amount * " +"amount_ratio) / lifetime[/code] 个粒子。较高的值会增加 GPU 要求,即使在给定时" +"间并非所有粒子都可见或 [member amount_ratio] 减少。\n" +"[b]注意:[/b]更改该值将导致粒子系统重新启动。为了避免这种情况,请更改 [member " +"amount_ratio]。" + +msgid "" +"The ratio of particles that should actually be emitted. If set to a value " +"lower than [code]1.0[/code], this will set the amount of emitted particles " +"throughout the lifetime to [code]amount * amount_ratio[/code]. Unlike " +"changing [member amount], changing [member amount_ratio] while emitting does " +"not affect already-emitted particles and doesn't cause the particle system to " +"restart. [member amount_ratio] can be used to create effects that make the " +"number of emitted particles vary over time.\n" +"[b]Note:[/b] Reducing the [member amount_ratio] has no performance benefit, " +"since resources need to be allocated and processed for the total [member " +"amount] of particles regardless of the [member amount_ratio]. If you don't " +"intend to change the number of particles emitted while the particles are " +"emitting, make sure [member amount_ratio] is set to [code]1[/code] and change " +"[member amount] to your liking instead." +msgstr "" +"实际应该发射的粒子的比率。如果被设置为低于 [code]1.0[/code] 的值,则会将整个生" +"命周期内发射的粒子数量设置为 [code]amount * amount_ratio[/code]。与更改 " +"[member amount] 不同,发射时更改 [member amount_ratio] 不会影响已发射的粒子," +"也不会导致粒子系统重新启动。[member amount_ratio] 可用于创建使发射粒子的数量随" +"时间变化的效果。\n" +"[b]注意:[/b]减少 [member amount_ratio] 不会带来性能优势,因为无论 [member " +"amount_ratio] 是多少,都需要为粒子总数 [member amount] 分配和处理资源。如果你" +"不打算在粒子发射时更改发射的粒子数量,请确保将 [member amount_ratio] 设置为 " +"[code]1[/code] 并根据你的喜好更改 [member amount]。" + +msgid "" +"Multiplier for particle's collision radius. [code]1.0[/code] corresponds to " +"the size of the sprite. If particles appear to sink into the ground when " +"colliding, increase this value. If particles appear to float when colliding, " +"decrease this value. Only effective if [member ParticleProcessMaterial." +"collision_mode] is [constant ParticleProcessMaterial.COLLISION_RIGID] or " +"[constant ParticleProcessMaterial.COLLISION_HIDE_ON_CONTACT].\n" +"[b]Note:[/b] Particles always have a spherical collision shape." +msgstr "" +"粒子碰撞半径的乘数。[code]1.0[/code] 对应于该精灵的大小。如果碰撞时粒子似乎沉" +"入地下,请增加该值。如果粒子在碰撞时出现漂浮,请减小该值。仅当 [member " +"ParticleProcessMaterial.collision_mode] 为 [constant ParticleProcessMaterial." +"COLLISION_RIGID] 或 [constant ParticleProcessMaterial." +"COLLISION_HIDE_ON_CONTACT] 时有效。\n" +"[b]注意:[/b]粒子始终具有球形碰撞形状。" + +msgid "" +"Causes all the particles in this node to interpolate towards the end of their " +"lifetime.\n" +"[b]Note:[/b] This only works when used with a [ParticleProcessMaterial]. It " +"needs to be manually implemented for custom process shaders." +msgstr "" +"导致该节点中的所有粒子插值到其生命周期结束时。\n" +"[b]注意:[/b]这仅在与 [ParticleProcessMaterial] 一起使用时才有效。对于自定义进" +"程着色器,需要手动实现。" + +msgid "" "Enables particle interpolation, which makes the particle movement smoother " "when their [member fixed_fps] is lower than the screen refresh rate." msgstr "启用粒子插值,当[member fixed_fps] 低于屏幕刷新率时,使粒子运动更平滑。" msgid "" +"The amount of time each particle will exist (in seconds). The effective " +"emission rate is [code](amount * amount_ratio) / lifetime[/code] particles " +"per second." +msgstr "" +"每个粒子存在的时间(以秒为单位)。有效发射速率为每秒 [code](amount * " +"amount_ratio) / lifetime[/code] 个粒子。" + +msgid "" "If [code]true[/code], particles use the parent node's coordinate space (known " "as local coordinates). This will cause particles to move and rotate along the " "[GPUParticles2D] node (and its parents) when it is moved or rotated. If " @@ -50790,6 +55149,38 @@ msgstr "" "[ShaderMaterial] 。" msgid "" +"Path to another [GPUParticles2D] node that will be used as a subemitter (see " +"[member ParticleProcessMaterial.sub_emitter_mode]). Subemitters can be used " +"to achieve effects such as fireworks, sparks on collision, bubbles popping " +"into water drops, and more.\n" +"[b]Note:[/b] When [member sub_emitter] is set, the target [GPUParticles2D] " +"node will no longer emit particles on its own." +msgstr "" +"到将被用作子发射器(请参阅 [member ParticleProcessMaterial.sub_emitter_mode])" +"的另一个 [GPUParticles2D] 节点的路径。子发射器可被用于实现烟花、碰撞火花、气泡" +"弹出水滴等效果。\n" +"[b]注意:[/b]当 [member sub_emitter] 被设置时,该目标 [GPUParticles2D] 节点将" +"不再自行发射粒子。" + +msgid "" +"Particle texture. If [code]null[/code], particles will be squares with a size " +"of 1×1 pixels.\n" +"[b]Note:[/b] To use a flipbook texture, assign a new [CanvasItemMaterial] to " +"the [GPUParticles2D]'s [member CanvasItem.material] property, then enable " +"[member CanvasItemMaterial.particles_animation] and set [member " +"CanvasItemMaterial.particles_anim_h_frames], [member CanvasItemMaterial." +"particles_anim_v_frames], and [member CanvasItemMaterial.particles_anim_loop] " +"to match the flipbook texture." +msgstr "" +"粒子纹理。如果为 [code]null[/code],则粒子将是大小为 1×1 像素的正方形。\n" +"[b]注意:[/b]要使用翻页纹理,请将新的 [CanvasItemMaterial] 分配给 " +"[GPUParticles2D] 的 [member CanvasItem.material] 属性,然后启用 [member " +"CanvasItemMaterial.particles_animation] 并设置 [member CanvasItemMaterial." +"particles_anim_h_frames]、[member CanvasItemMaterial." +"particles_anim_v_frames]、和 [member CanvasItemMaterial.particles_anim_loop] " +"来匹配该翻页纹理。" + +msgid "" "If [code]true[/code], enables particle trails using a mesh skinning system.\n" "[b]Note:[/b] Unlike [GPUParticles3D], the number of trail sections and " "subdivisions is set with the [member trail_sections] and [member " @@ -50837,6 +55228,22 @@ msgstr "" "如果当节点进入/退出屏幕时粒子突然出现/消失,则增长矩形。[Rect2] 可以通过代码或" "使用 [b]Particles → Generate Visibility Rect[/b] 编辑器工具生成。" +msgid "" +"Emitted when all active particles have finished processing. When [member " +"one_shot] is disabled, particles will process continuously, so this is never " +"emitted.\n" +"[b]Note:[/b] Due to the particles being computed on the GPU there might be a " +"delay before the signal gets emitted." +msgstr "" +"当所有活动粒子完成处理时发出。当 [member one_shot] 被禁用时,粒子将连续处理," +"因此它永远不会发出。\n" +"[b]注意:[/b]由于粒子是在 GPU 上计算的,因此在该信号发出之前可能会有延迟。" + +msgid "" +"Particles are drawn in reverse order of remaining lifetime. In other words, " +"the particle with the lowest lifetime is drawn at the front." +msgstr "粒子按照剩余寿命的相反顺序绘制。换句话说,寿命最短的粒子被绘制在前面。" + msgid "Particle starts at the specified position." msgstr "粒子在指定位置开始。" @@ -50857,6 +55264,20 @@ msgstr "粒子以指定的 [code]CUSTOM[/code] 数据开始。" msgid "A 3D particle emitter." msgstr "3D 粒子发射器。" +msgid "" +"3D particle node used to create a variety of particle systems and effects. " +"[GPUParticles3D] features an emitter that generates some number of particles " +"at a given rate.\n" +"Use [member process_material] to add a [ParticleProcessMaterial] to configure " +"particle appearance and behavior. Alternatively, you can add a " +"[ShaderMaterial] which will be applied to all particles." +msgstr "" +"3D 粒子节点,用于创建各种粒子系统和效果。[GPUParticles3D] 的特点是,发射器以给" +"定的速度产生一定数量的粒子。\n" +"使用 [member process_material] 属性来添加一个配置粒子外观和行为的 " +"[ParticleProcessMaterial]。或者,你可以添加一个应用于所有粒子的 " +"[ShaderMaterial]。" + msgid "Controlling thousands of fish with Particles" msgstr "用粒子控制数千条鱼" @@ -50865,6 +55286,9 @@ msgid "" "are active in the current frame." msgstr "返回包含当前帧中所有活动粒子的轴对齐边界框。" +msgid "Sets this node's properties to match a given [CPUParticles3D] node." +msgstr "设置该节点的属性以匹配给定的 [CPUParticles3D] 节点。" + msgid "Returns the [Mesh] that is drawn at index [param pass]." msgstr "返回在索引 [param pass] 处绘制的 [Mesh] 。" @@ -50874,6 +55298,31 @@ msgstr "重新发射粒子,清除现有的粒子。" msgid "Sets the [Mesh] that is drawn at index [param pass]." msgstr "设置在索引 [param pass] 处绘制的 [Mesh] 。" +msgid "" +"The base diameter for particle collision in meters. If particles appear to " +"sink into the ground when colliding, increase this value. If particles appear " +"to float when colliding, decrease this value. Only effective if [member " +"ParticleProcessMaterial.collision_mode] is [constant ParticleProcessMaterial." +"COLLISION_RIGID] or [constant ParticleProcessMaterial." +"COLLISION_HIDE_ON_CONTACT].\n" +"[b]Note:[/b] Particles always have a spherical collision shape." +msgstr "" +"粒子碰撞的基本直径(以米为单位)。如果碰撞时粒子似乎沉入地下,请增加该值。如果" +"粒子在碰撞时出现漂浮,请减小该值。仅当 [member ParticleProcessMaterial." +"collision_mode] 为 [constant ParticleProcessMaterial.COLLISION_RIGID] 或 " +"[constant ParticleProcessMaterial.COLLISION_HIDE_ON_CONTACT] 时有效。\n" +"[b]注意:[/b]粒子始终具有球形碰撞形状。" + +msgid "" +"Particle draw order. Uses [enum DrawOrder] values.\n" +"[b]Note:[/b] [constant DRAW_ORDER_INDEX] is the only option that supports " +"motion vectors for effects like TAA. It is suggested to use this draw order " +"if the particles are opaque to fix ghosting artifacts." +msgstr "" +"粒子绘制顺序。使用 [enum DrawOrder] 值。\n" +"[b]注意:[/b][constant DRAW_ORDER_INDEX] 是支持 TAA 等效果的运动向量的唯一选" +"项。如果粒子不透明,建议使用该绘制顺序来修复重影伪影。" + msgid "[Mesh] that is drawn for the first draw pass." msgstr "第一绘制阶段所绘制的 [Mesh]。" @@ -50910,6 +55359,11 @@ msgstr "" "[GPUParticles3D] 节点(及其父节点)移动或旋转。" msgid "" +"If [code]true[/code], only the number of particles equal to [member amount] " +"will be emitted." +msgstr "如果为 [code]true[/code],将只发出 [member amount] 数量的粒子。" + +msgid "" "Amount of time to preprocess the particles before animation starts. Lets you " "start the animation some time after particles have started emitting." msgstr "" @@ -50924,6 +55378,20 @@ msgid "" msgstr "速度缩放比例。[code]0[/code] 的值可被用于暂停粒子。" msgid "" +"Path to another [GPUParticles3D] node that will be used as a subemitter (see " +"[member ParticleProcessMaterial.sub_emitter_mode]). Subemitters can be used " +"to achieve effects such as fireworks, sparks on collision, bubbles popping " +"into water drops, and more.\n" +"[b]Note:[/b] When [member sub_emitter] is set, the target [GPUParticles3D] " +"node will no longer emit particles on its own." +msgstr "" +"到将被用作子发射器(请参阅 [member ParticleProcessMaterial.sub_emitter_mode])" +"的另一个 [GPUParticles3D] 节点的路径。子发射器可被用于实现烟花、碰撞火花、气泡" +"弹出水滴等效果。\n" +"[b]注意:[/b]当 [member sub_emitter] 被设置时,该目标 [GPUParticles3D] 节点将" +"不再自行发射粒子。" + +msgid "" "If [code]true[/code], enables particle trails using a mesh skinning system. " "Designed to work with [RibbonTrailMesh] and [TubeTrailMesh].\n" "[b]Note:[/b] [member BaseMaterial3D.use_particle_trails] must also be enabled " @@ -50941,9 +55409,32 @@ msgstr "" "[b]注意:[/b]与 [GPUParticles2D] 不同,尾迹部分及其细分的数量是在 " "[RibbonTrailMesh] 或 [TubeTrailMesh] 的属性中设置的。" +msgid "" +"The [AABB] that determines the node's region which needs to be visible on " +"screen for the particle system to be active. [member GeometryInstance3D." +"extra_cull_margin] is added on each of the AABB's axes. Particle collisions " +"and attraction will only occur within this area.\n" +"Grow the box if particles suddenly appear/disappear when the node enters/" +"exits the screen. The [AABB] can be grown via code or with the [b]Particles → " +"Generate AABB[/b] editor tool.\n" +"[b]Note:[/b] [member visibility_aabb] is overridden by [member " +"GeometryInstance3D.custom_aabb] if that property is set to a non-default " +"value." +msgstr "" +"[AABB] 确定节点的区域,该区域需要在屏幕上可见,才能使粒子系统处于活动状态。" +"[member GeometryInstance3D.extra_cull_margin] 被添加到 AABB 的每个轴上。粒子碰" +"撞和吸引只会发生在该区域内。\n" +"如果在节点进入/退出屏幕时,粒子突然出现/消失,则应该增大矩形。[AABB] 可以通过" +"代码,或使用 [b]粒子 → 生成 AABB[/b] 编辑器工具生成。\n" +"[b]注意:[/b]如果该属性被设置为非默认值,[member visibility_aabb] 会被 " +"[member GeometryInstance3D.custom_aabb] 覆盖。" + msgid "Maximum number of draw passes supported." msgstr "支持的最大绘制阶段数。" +msgid "Abstract base class for 3D particle attractors." +msgstr "3D 粒子吸引器的抽象基类。" + msgid "" "Particle attractors can be used to attract particles towards the attractor's " "origin, or to push them away from the attractor's origin.\n" @@ -51007,10 +55498,63 @@ msgstr "" "[b]注意:[/b]如果 [member directionality] 大于 [code]0.0[/code],则可以通过旋" "转 [GPUParticlesAttractor3D] 节点,来改变粒子推送的方向。" +msgid "" +"Adjusts the strength of the attractor. If [member strength] is negative, " +"particles will be pushed in the opposite direction. Particles will be pushed " +"[i]away[/i] from the attractor's origin if [member directionality] is " +"[code]0.0[/code], or towards local +Z if [member directionality] is greater " +"than [code]0.0[/code]." +msgstr "" +"调整吸引器的强度。如果 [member strength] 为负,则粒子将被反向推动。如果 " +"[member directionality] 为 [code]0.0[/code],则粒子将被推[i]离[/i]吸引器的原" +"点;如果 [member directionality] 大于 [code]0.0[/code],则粒子将被推向局部 " +"+Z。" + +msgid "" +"A box-shaped attractor that influences particles from [GPUParticles3D] nodes." +msgstr "影响来自 [GPUParticles3D] 节点的粒子的盒形吸引器。" + +msgid "" +"A box-shaped attractor that influences particles from [GPUParticles3D] nodes. " +"Can be used to attract particles towards its origin, or to push them away " +"from its origin.\n" +"Particle attractors work in real-time and can be moved, rotated and scaled " +"during gameplay. Unlike collision shapes, non-uniform scaling of attractors " +"is also supported.\n" +"[b]Note:[/b] Particle attractors only affect [GPUParticles3D], not " +"[CPUParticles3D]." +msgstr "" +"影响来自 [GPUParticles3D] 节点的粒子的盒形吸引器。可用于将粒子吸引到其原点,或" +"将它们推离其原点。\n" +"粒子吸引器是实时工作的,可以在游戏过程中进行移动、旋转、缩放。与碰撞形状不同," +"吸引器还支持不统一的缩放。\n" +"[b]注意:[/b]粒子吸引器只会影响 [GPUParticles3D],不影响 [CPUParticles3D]。" + msgid "The attractor box's size in 3D units." msgstr "吸引器盒的尺寸,使用 3D 单位。" msgid "" +"A spheroid-shaped attractor that influences particles from [GPUParticles3D] " +"nodes." +msgstr "影响来自 [GPUParticles3D] 节点的粒子的球形吸引器。" + +msgid "" +"A spheroid-shaped attractor that influences particles from [GPUParticles3D] " +"nodes. Can be used to attract particles towards its origin, or to push them " +"away from its origin.\n" +"Particle attractors work in real-time and can be moved, rotated and scaled " +"during gameplay. Unlike collision shapes, non-uniform scaling of attractors " +"is also supported.\n" +"[b]Note:[/b] Particle attractors only affect [GPUParticles3D], not " +"[CPUParticles3D]." +msgstr "" +"影响来自 [GPUParticles3D] 节点的粒子的球形吸引器。可用于将粒子吸引到其原点,或" +"将它们推离其原点。\n" +"粒子吸引器是实时工作的,可以在游戏过程中进行移动、旋转、缩放。与碰撞形状不同," +"吸引器还支持不统一的缩放。\n" +"[b]注意:[/b]粒子吸引器只会影响 [GPUParticles3D],不影响 [CPUParticles3D]。" + +msgid "" "The attractor sphere's radius in 3D units.\n" "[b]Note:[/b] Stretched ellipses can be obtained by using non-uniform scaling " "on the [GPUParticlesAttractorSphere3D] node." @@ -51019,6 +55563,36 @@ msgstr "" "[b]注意:[/b]要得到拉伸椭圆形,可以对 [GPUParticlesAttractorSphere3D] 节点使用" "非统一缩放。" +msgid "" +"A box-shaped attractor with varying directions and strengths defined in it " +"that influences particles from [GPUParticles3D] nodes." +msgstr "" +"盒形吸引器,其中定义了不同的方向和强度,会影响来自 [GPUParticles3D] 节点的粒" +"子。" + +msgid "" +"A box-shaped attractor with varying directions and strengths defined in it " +"that influences particles from [GPUParticles3D] nodes.\n" +"Unlike [GPUParticlesAttractorBox3D], [GPUParticlesAttractorVectorField3D] " +"uses a [member texture] to affect attraction strength within the box. This " +"can be used to create complex attraction scenarios where particles travel in " +"different directions depending on their location. This can be useful for " +"weather effects such as sandstorms.\n" +"Particle attractors work in real-time and can be moved, rotated and scaled " +"during gameplay. Unlike collision shapes, non-uniform scaling of attractors " +"is also supported.\n" +"[b]Note:[/b] Particle attractors only affect [GPUParticles3D], not " +"[CPUParticles3D]." +msgstr "" +"盒形吸引器,其中定义了不同的方向和强度,会影响来自 [GPUParticles3D] 节点的粒" +"子。\n" +"与 [GPUParticlesAttractorBox3D] 不同,[GPUParticlesAttractorVectorField3D] 使" +"用 [member texture] 来影响盒子内的吸引力强度。可用于创建复杂的吸引场景,其中粒" +"子根据其位置向不同方向移动。这对于沙尘暴等天气影响很有用。\n" +"粒子吸引器是实时工作的,可以在游戏过程中进行移动、旋转、缩放。与碰撞形状不同," +"吸引器还支持不统一的缩放。\n" +"[b]注意:[/b]粒子吸引器只会影响 [GPUParticles3D],不影响 [CPUParticles3D]。" + msgid "The size of the vector field box in 3D units." msgstr "向量场盒子的尺寸,使用 3D 单位。" @@ -51036,6 +55610,42 @@ msgstr "" "64×64×64。" msgid "" +"Abstract base class for 3D particle collision shapes affecting " +"[GPUParticles3D] nodes." +msgstr "影响 [GPUParticles3D] 节点的 3D 粒子碰撞形状的抽象基类。" + +msgid "" +"Particle collision shapes can be used to make particles stop or bounce " +"against them.\n" +"Particle collision shapes work in real-time and can be moved, rotated and " +"scaled during gameplay. Unlike attractors, non-uniform scaling of collision " +"shapes is [i]not[/i] supported.\n" +"Particle collision shapes can be temporarily disabled by hiding them.\n" +"[b]Note:[/b] [member ParticleProcessMaterial.collision_mode] must be " +"[constant ParticleProcessMaterial.COLLISION_RIGID] or [constant " +"ParticleProcessMaterial.COLLISION_HIDE_ON_CONTACT] on the [GPUParticles3D]'s " +"process material for collision to work.\n" +"[b]Note:[/b] Particle collision only affects [GPUParticles3D], not " +"[CPUParticles3D].\n" +"[b]Note:[/b] Particles pushed by a collider that is being moved will not be " +"interpolated, which can result in visible stuttering. This can be alleviated " +"by setting [member GPUParticles3D.fixed_fps] to [code]0[/code] or a value " +"that matches or exceeds the target framerate." +msgstr "" +"粒子碰撞形状可用于使粒子停止或对其反弹。\n" +"粒子碰撞形状是实时工作的,在游戏过程中可以移动、旋转和缩放。与吸引器不同,碰撞" +"形状的非均匀缩放[i]不[/i]受支持。\n" +"粒子碰撞形状可以通过隐藏而暂时禁用。\n" +"[b]注意:[/b]在 [GPUParticles3D] 的处理材质上,[member " +"ParticleProcessMaterial.collision_mode] 必须是 [constant " +"ParticleProcessMaterial.COLLISION_RIGID] 或 [constant ParticleProcessMaterial." +"COLLISION_HIDE_ON_CONTACT],才能使碰撞生效。\n" +"[b]注意:[/b]粒子碰撞只影响 [GPUParticles3D],不影响 [CPUParticles3D]。\n" +"[b]注意:[/b]由正在移动的碰撞器推动的粒子不会被插值,这可能会导致可见的卡顿。" +"这可以通过将 [member GPUParticles3D.fixed_fps] 设置为 [code]0[/code] 或一个符" +"合或超过目标帧速率的值来缓解。" + +msgid "" "The particle rendering layers ([member VisualInstance3D.layers]) that will be " "affected by the collision shape. By default, all particles that have [member " "ParticleProcessMaterial.collision_mode] set to [constant " @@ -51060,10 +55670,71 @@ msgstr "" "通过在 [GPUParticles3D] 节点上设置 [member ParticleProcessMaterial." "attractor_interaction_enabled],也可以在每个进程材质的基础上禁用粒子吸引。" +msgid "" +"A box-shaped 3D particle collision shape affecting [GPUParticles3D] nodes." +msgstr "影响 [GPUParticles3D] 节点的盒形 3D 粒子碰撞形状。" + +msgid "" +"A box-shaped 3D particle collision shape affecting [GPUParticles3D] nodes.\n" +"Particle collision shapes work in real-time and can be moved, rotated and " +"scaled during gameplay. Unlike attractors, non-uniform scaling of collision " +"shapes is [i]not[/i] supported.\n" +"[b]Note:[/b] [member ParticleProcessMaterial.collision_mode] must be " +"[constant ParticleProcessMaterial.COLLISION_RIGID] or [constant " +"ParticleProcessMaterial.COLLISION_HIDE_ON_CONTACT] on the [GPUParticles3D]'s " +"process material for collision to work.\n" +"[b]Note:[/b] Particle collision only affects [GPUParticles3D], not " +"[CPUParticles3D]." +msgstr "" +"影响 [GPUParticles3D] 节点的盒形 3D 粒子碰撞形状。\n" +"粒子碰撞形状是实时工作的,可以在游戏过程中进行移动、旋转、缩放。与吸引器不同," +"碰撞形状的非均匀缩放[i]不[/i]被支持。\n" +"[b]注意:[/b][GPUParticles3D] 的处理材质上的 [member ParticleProcessMaterial." +"collision_mode] 必须为 [constant ParticleProcessMaterial.COLLISION_RIGID] 或 " +"[constant ParticleProcessMaterial.COLLISION_HIDE_ON_CONTACT],碰撞才能发挥作" +"用。\n" +"[b]注意:[/b]粒子碰撞只会影响 [GPUParticles3D],不影响 [CPUParticles3D]。" + msgid "The collision box's size in 3D units." msgstr "碰撞框的范围,使用 3D 单位。" msgid "" +"A real-time heightmap-shaped 3D particle collision shape affecting " +"[GPUParticles3D] nodes." +msgstr "影响 [GPUParticles3D] 节点的实时高度图形状 3D 粒子碰撞形状。" + +msgid "" +"A real-time heightmap-shaped 3D particle collision shape affecting " +"[GPUParticles3D] nodes.\n" +"Heightmap shapes allow for efficiently representing collisions for convex and " +"concave objects with a single \"floor\" (such as terrain). This is less " +"flexible than [GPUParticlesCollisionSDF3D], but it doesn't require a baking " +"step.\n" +"[GPUParticlesCollisionHeightField3D] can also be regenerated in real-time " +"when it is moved, when the camera moves, or even continuously. This makes " +"[GPUParticlesCollisionHeightField3D] a good choice for weather effects such " +"as rain and snow and games with highly dynamic geometry. However, this class " +"is limited since heightmaps cannot represent overhangs (e.g. indoors or " +"caves).\n" +"[b]Note:[/b] [member ParticleProcessMaterial.collision_mode] must be " +"[code]true[/code] on the [GPUParticles3D]'s process material for collision to " +"work.\n" +"[b]Note:[/b] Particle collision only affects [GPUParticles3D], not " +"[CPUParticles3D]." +msgstr "" +"影响 [GPUParticles3D] 节点的实时高度图形状的 3D 粒子碰撞形状。\n" +"高度图形状允许有效地表示凸面和凹面对象与单个“地板”(例如地形)的碰撞。它不如 " +"[GPUParticlesCollisionSDF3D] 灵活,但不需要烘焙步骤。\n" +"也可以在移动时、相机移动时、甚至连续时,实时重新生成 " +"[GPUParticlesCollisionHeightField3D]。这对雨雪等天气效果、以及具有高度动态几何" +"体的游戏来说,[GPUParticlesCollisionHeightField3D] 是一个不错的选择。但是,该" +"类有限制,因为高度图无法表示悬垂(例如室内或洞穴)。\n" +"[b]注意:[/b]在 [GPUParticles3D] 的处理材质上,[member " +"ParticleProcessMaterial.collision_mode] 必须为 [code]true[/code],才能使碰撞生" +"效。\n" +"[b]注意:[/b]粒子碰撞只影响 [GPUParticles3D],不影响 [CPUParticles3D]。" + +msgid "" "If [code]true[/code], the [GPUParticlesCollisionHeightField3D] will follow " "the current camera in global space. The [GPUParticlesCollisionHeightField3D] " "does not need to be a child of the [Camera3D] node for this to work.\n" @@ -51151,6 +55822,50 @@ msgstr "" "生显著变化时,才应使用该更新选项。" msgid "" +"A baked signed distance field 3D particle collision shape affecting " +"[GPUParticles3D] nodes." +msgstr "影响 [GPUParticles3D] 节点的烘焙的带符号距离场 3D 粒子碰撞形状。" + +msgid "" +"A baked signed distance field 3D particle collision shape affecting " +"[GPUParticles3D] nodes.\n" +"Signed distance fields (SDF) allow for efficiently representing approximate " +"collision shapes for convex and concave objects of any shape. This is more " +"flexible than [GPUParticlesCollisionHeightField3D], but it requires a baking " +"step.\n" +"[b]Baking:[/b] The signed distance field texture can be baked by selecting " +"the [GPUParticlesCollisionSDF3D] node in the editor, then clicking [b]Bake " +"SDF[/b] at the top of the 3D viewport. Any [i]visible[/i] [MeshInstance3D]s " +"within the [member size] will be taken into account for baking, regardless of " +"their [member GeometryInstance3D.gi_mode].\n" +"[b]Note:[/b] Baking a [GPUParticlesCollisionSDF3D]'s [member texture] is only " +"possible within the editor, as there is no bake method exposed for use in " +"exported projects. However, it's still possible to load pre-baked " +"[Texture3D]s into its [member texture] property in an exported project.\n" +"[b]Note:[/b] [member ParticleProcessMaterial.collision_mode] must be " +"[constant ParticleProcessMaterial.COLLISION_RIGID] or [constant " +"ParticleProcessMaterial.COLLISION_HIDE_ON_CONTACT] on the [GPUParticles3D]'s " +"process material for collision to work.\n" +"[b]Note:[/b] Particle collision only affects [GPUParticles3D], not " +"[CPUParticles3D]." +msgstr "" +"影响 [GPUParticles3D] 节点的烘焙的带符号距离场 3D 粒子碰撞形状。\n" +"有符号的距离场(SDF)允许有效地表示任何形状的凸面和凹面对象的近似碰撞形状。它" +"比 [GPUParticlesCollisionHeightField3D] 更灵活,但需要一个烘焙步骤。\n" +"[b]烘焙:[/b]可以通过在编辑器中选择 [GPUParticlesCollisionSDF3D] 节点,然后点" +"击 3D 视口顶部的[b]烘焙 SDF[/b],来烘焙有符号的距离场纹理。[member size] 内的" +"任何[i]可见[/i] [MeshInstance3D],无论它们的 [member GeometryInstance3D." +"gi_mode] 如何,都将被考虑用于烘焙。\n" +"[b]注意:[/b]烘焙 [GPUParticlesCollisionSDF3D] 的 [member texture] 只能在编辑" +"器中进行,因为没有公开的烘焙方法可用于导出的游戏项目中。但是,在导出的游戏项目" +"中,仍然可以将预先烘焙的 [Texture3D] 加载到 [member texture] 属性中。\n" +"[b]注意:[/b]在 [GPUParticles3D] 的处理材质上,[member " +"ParticleProcessMaterial.collision_mode] 必须是 [constant " +"ParticleProcessMaterial.COLLISION_RIGID] 或 [constant ParticleProcessMaterial." +"COLLISION_HIDE_ON_CONTACT],才能使碰撞生效。\n" +"[b]注意:[/b]粒子碰撞只影响 [GPUParticles3D],不影响 [CPUParticles3D]。" + +msgid "" "Returns whether or not the specified layer of the [member bake_mask] is " "enabled, given a [param layer_number] between 1 and 32." msgstr "" @@ -51233,12 +55948,50 @@ msgid "" "also the most precise." msgstr "烘焙 512×512×512 的有符号距离场。这是最慢的选项,但也是最精确的。" +msgid "" +"A sphere-shaped 3D particle collision shape affecting [GPUParticles3D] nodes." +msgstr "影响 [GPUParticles3D] 节点的球形 3D 粒子碰撞形状。" + +msgid "" +"A sphere-shaped 3D particle collision shape affecting [GPUParticles3D] " +"nodes.\n" +"Particle collision shapes work in real-time and can be moved, rotated and " +"scaled during gameplay. Unlike attractors, non-uniform scaling of collision " +"shapes is [i]not[/i] supported.\n" +"[b]Note:[/b] [member ParticleProcessMaterial.collision_mode] must be " +"[constant ParticleProcessMaterial.COLLISION_RIGID] or [constant " +"ParticleProcessMaterial.COLLISION_HIDE_ON_CONTACT] on the [GPUParticles3D]'s " +"process material for collision to work.\n" +"[b]Note:[/b] Particle collision only affects [GPUParticles3D], not " +"[CPUParticles3D]." +msgstr "" +"影响 [GPUParticles3D] 节点的球形 3D 粒子碰撞形状。\n" +"粒子碰撞形状是实时工作的,可以在游戏过程中进行移动、旋转、缩放。与吸引器不同," +"碰撞形状的非均匀缩放[i]不[/i]被支持。\n" +"[b]注意:[/b][GPUParticles3D] 的处理材质上的 [member ParticleProcessMaterial." +"collision_mode] 必须为 [constant ParticleProcessMaterial.COLLISION_RIGID] 或 " +"[constant ParticleProcessMaterial.COLLISION_HIDE_ON_CONTACT],碰撞才能发挥作" +"用。\n" +"[b]注意:[/b]粒子碰撞只会影响 [GPUParticles3D],不影响 [CPUParticles3D]。" + msgid "The collision sphere's radius in 3D units." msgstr "碰撞球的半径,以 3D 单位表示。" msgid "A color transition." msgstr "颜色过渡。" +msgid "" +"This resource describes a color transition by defining a set of colored " +"points and how to interpolate between them.\n" +"See also [Curve] which supports more complex easing methods, but does not " +"support colors." +msgstr "" +"该资源通过定义一组彩色点以及如何在它们之间进行插值来描述颜色过渡。\n" +"另见 [Curve],它支持更复杂的缓动方法,但不支持颜色。" + +msgid "Adds the specified color to the gradient, with the specified offset." +msgstr "使用指定的偏移,将指定的颜色添加到该渐变中。" + msgid "Returns the color of the gradient color at index [param point]." msgstr "返回渐变色在索引 [param point] 处的颜色。" @@ -51336,6 +56089,20 @@ msgstr "" "[url=https://bottosson.github.io/posts/oklab/]Oklab[/url] 色彩空间。该色彩空间" "能够在不同颜色之间进行平滑、外观统一的过渡。" +msgid "A 1D texture that uses colors obtained from a [Gradient]." +msgstr "使用从 [Gradient] 获得的颜色的一维纹理。" + +msgid "" +"A 1D texture that obtains colors from a [Gradient] to fill the texture data. " +"The texture is filled by sampling the gradient for each pixel. Therefore, the " +"texture does not necessarily represent an exact copy of the gradient, as it " +"may miss some colors if there are not enough pixels. See also " +"[GradientTexture2D], [CurveTexture] and [CurveXYZTexture]." +msgstr "" +"从 [Gradient] 获取颜色来填充纹理数据的一维纹理。通过为每个像素采样渐变来填充纹" +"理。因此,该纹理不一定代表渐变的精确副本,因为如果没有足够的像素,它可能会丢失" +"一些颜色。另见 [GradientTexture2D]、[CurveTexture] 和 [CurveXYZTexture]。" + msgid "The [Gradient] used to fill the texture." msgstr "用于填充纹理的 [Gradient]。" @@ -51355,6 +56122,23 @@ msgid "The number of color samples that will be obtained from the [Gradient]." msgstr "将从 [Gradient] 中获得的颜色样本的数量。" msgid "" +"A 2D texture that creates a pattern with colors obtained from a [Gradient]." +msgstr "使用从 [Gradient] 获得的颜色创建图案的 2D 纹理。" + +msgid "" +"A 2D texture that obtains colors from a [Gradient] to fill the texture data. " +"This texture is able to transform a color transition into different patterns " +"such as a linear or a radial gradient. The gradient is sampled individually " +"for each pixel so it does not necessarily represent an exact copy of the " +"gradient(see [member width] and [member height]). See also " +"[GradientTexture1D], [CurveTexture] and [CurveXYZTexture]." +msgstr "" +"2D纹理,从一个 [Gradient] 中获取颜色来填充纹理数据。该纹理能够将颜色过渡转换为" +"不同的图案,例如线性或径向渐变。渐变是针对每个像素单独采样的,因此它不一定代表" +"渐变的精确副本(请参阅 [member width] 和 [member height])。另见 " +"[GradientTexture1D]、[CurveTexture] 和 [CurveXYZTexture]。" + +msgid "" "The gradient fill type, one of the [enum Fill] values. The texture is filled " "by interpolating colors starting from [member fill_from] to [member fill_to] " "offsets." @@ -51419,10 +56203,107 @@ msgid "An editor for graph-like structures, using [GraphNode]s." msgstr "图结构编辑器,使用 [GraphNode]。" msgid "" +"[GraphEdit] provides tools for creation, manipulation, and display of various " +"graphs. Its main purpose in the engine is to power the visual programming " +"systems, such as visual shaders, but it is also available for use in user " +"projects.\n" +"[GraphEdit] by itself is only an empty container, representing an infinite " +"grid where [GraphNode]s can be placed. Each [GraphNode] represents a node in " +"the graph, a single unit of data in the connected scheme. [GraphEdit], in " +"turn, helps to control various interactions with nodes and between nodes. " +"When the user attempts to connect, disconnect, or delete a [GraphNode], a " +"signal is emitted in the [GraphEdit], but no action is taken by default. It " +"is the responsibility of the programmer utilizing this control to implement " +"the necessary logic to determine how each request should be handled.\n" +"[b]Performance:[/b] It is greatly advised to enable low-processor usage mode " +"(see [member OS.low_processor_usage_mode]) when using GraphEdits." +msgstr "" +"[GraphEdit] 提供了用于对各种图进行创建、操作、显示的工具。它在引擎中的主要目的" +"是驱动可视化编程系统,例如可视化着色器,但也可以在用户项目中使用。\n" +"[GraphEdit] 本身只是一个空容器,表示一个可以放置 [GraphNode] 的无限栅格。每个 " +"[GraphNode] 代表图中的一个节点,是连接方案中的单个数据单元。而 [GraphEdit] 则" +"有助于控制节点和节点之间的各种交互。当用户尝试连接、断开或删除一个 " +"[GraphNode] 时,[GraphEdit] 中会发出对应的信号,但默认情况下不执行任何动作。使" +"用此控件的程序员负责实现必要的逻辑,来确定应如何处理每个请求。\n" +"[b]性能:[/b]强烈建议在使用 GraphEdit 时启用低处理器使用模式(见 [member OS." +"low_processor_usage_mode])。" + +msgid "" "Virtual method which can be overridden to customize how connections are drawn." msgstr "可以重写的虚方法,以自定义如何绘制连接。" msgid "" +"Returns whether the [param mouse_position] is in the input hot zone.\n" +"By default, a hot zone is a [Rect2] positioned such that its center is at " +"[param in_node].[method GraphNode.get_input_port_position]([param in_port]) " +"(For output's case, call [method GraphNode.get_output_port_position] " +"instead). The hot zone's width is twice the Theme Property " +"[code]port_grab_distance_horizontal[/code], and its height is twice the " +"[code]port_grab_distance_vertical[/code].\n" +"Below is a sample code to help get started:\n" +"[codeblock]\n" +"func _is_in_input_hotzone(in_node, in_port, mouse_position):\n" +" var port_size: Vector2 = " +"Vector2(get_theme_constant(\"port_grab_distance_horizontal\"), " +"get_theme_constant(\"port_grab_distance_vertical\"))\n" +" var port_pos: Vector2 = in_node.get_position() + in_node." +"get_input_port_position(in_port) - port_size / 2\n" +" var rect = Rect2(port_pos, port_size)\n" +"\n" +" return rect.has_point(mouse_position)\n" +"[/codeblock]" +msgstr "" +"返回 [param mouse_position] 是否在输入热区。\n" +"默认情况下,热区是一个 [Rect2],其中心位于 [param in_node].[method GraphNode." +"get_input_port_position]([param in_port])(对于输出的情况,请改为调用 [method " +"GraphNode.get_output_port_position])。热区的宽度是主题属性 " +"[code]port_grab_distance_horizontal[/code] 的两倍,高度是 " +"[code]port_grab_distance_vertical[/code] 的两倍。\n" +"下面是一个示例代码,以帮助入门:\n" +"[codeblock]\n" +"func _is_in_input_hotzone(in_node, in_port, mouse_position):\n" +" var port_size: Vector2 = " +"Vector2(get_theme_constant(\"port_grab_distance_horizontal\"), " +"get_theme_constant(\"port_grab_distance_vertical\"))\n" +" var port_pos: Vector2 = in_node.get_position() + in_node." +"get_input_port_position(in_port) - port_size / 2\n" +" var rect = Rect2(port_pos, port_size)\n" +"\n" +" return rect.has_point(mouse_position)\n" +"[/codeblock]" + +msgid "" +"Returns whether the [param mouse_position] is in the output hot zone. For " +"more information on hot zones, see [method _is_in_input_hotzone].\n" +"Below is a sample code to help get started:\n" +"[codeblock]\n" +"func _is_in_output_hotzone(in_node, in_port, mouse_position):\n" +" var port_size: Vector2 = " +"Vector2(get_theme_constant(\"port_grab_distance_horizontal\"), " +"get_theme_constant(\"port_grab_distance_vertical\"))\n" +" var port_pos: Vector2 = in_node.get_position() + in_node." +"get_output_port_position(in_port) - port_size / 2\n" +" var rect = Rect2(port_pos, port_size)\n" +"\n" +" return rect.has_point(mouse_position)\n" +"[/codeblock]" +msgstr "" +"返回 [param mouse_position] 是否在输出热区。有关热区的更多信息,请参阅 " +"[method _is_in_input_hotzone]。\n" +"下面是一个示例代码,以帮助入门:\n" +"[codeblock]\n" +"func _is_in_output_hotzone(in_node, in_port, mouse_position):\n" +" var port_size: Vector2 = " +"Vector2(get_theme_constant(\"port_grab_distance_horizontal\"), " +"get_theme_constant(\"port_grab_distance_vertical\"))\n" +" var port_pos: Vector2 = in_node.get_position() + in_node." +"get_output_port_position(in_port) - port_size / 2\n" +" var rect = Rect2(port_pos, port_size)\n" +"\n" +" return rect.has_point(mouse_position)\n" +"[/codeblock]" + +msgid "" "This virtual method can be used to insert additional error detection while " "the user is dragging a connection over a valid port.\n" "Return [code]true[/code] if the connection is indeed valid or return " @@ -51614,6 +56495,17 @@ msgstr "" "点的连接。使用该方法来禁用以前使用 [method add_valid_right_disconnect_type] 允" "许的断开连接。" +msgid "" +"Sets the coloration of the connection between [param from_node]'s [param " +"from_port] and [param to_node]'s [param to_port] with the color provided in " +"the [theme_item activity] theme property. The color is linearly interpolated " +"between the connection color and the activity color using [param amount] as " +"weight." +msgstr "" +"使用 [theme_item activity] 主题属性中提供的颜色,设置 [param from_node] 的 " +"[param from_port] 和 [param to_node] 的 [param to_port] 之间的连接的颜色。使" +"用 [param amount] 作为权重,在连接颜色和活动颜色之间线性插值颜色。" + msgid "Sets the specified [param node] as the one selected." msgstr "将指定的 [param node] 节点设置为选中的节点。" @@ -51650,12 +56542,40 @@ msgstr "" msgid "The scroll offset." msgstr "滚动偏移量。" +msgid "" +"If [code]true[/code], the button to automatically arrange graph nodes is " +"visible." +msgstr "如果为 [code]true[/code],则自动排列图形节点的按钮可见。" + msgid "If [code]true[/code], the grid is visible." msgstr "如果为 [code]true[/code],则该网格可见。" +msgid "" +"If [code]true[/code], buttons that allow to configure grid and snapping " +"options are visible." +msgstr "如果为 [code]true[/code],则允许配置栅格和吸附选项的按钮可见。" + msgid "If [code]true[/code], the menu toolbar is visible." msgstr "如果为 [code]true[/code],则菜单栏可见。" +msgid "If [code]true[/code], the button to toggle the minimap is visible." +msgstr "如果为 [code]true[/code],则切换小地图的按钮可见。" + +msgid "" +"If [code]true[/code], buttons that allow to change and reset the zoom level " +"are visible." +msgstr "如果为 [code]true[/code],则允许更改和重置缩放级别的按钮可见。" + +msgid "" +"If [code]true[/code], the label with the current zoom level is visible. The " +"zoom level is displayed in percents." +msgstr "" +"如果为 [code]true[/code],则使带有当前缩放级别的标签可见。缩放级别以百分比显" +"示。" + +msgid "The snapping distance in pixels, also determines the grid line distance." +msgstr "吸附距离,单位为像素,也决定了栅格线距离。" + msgid "If [code]true[/code], enables snapping." msgstr "如果为 [code]true[/code],启用自动吸附。" @@ -51702,6 +56622,14 @@ msgid "Emitted when the user presses [kbd]Ctrl + C[/kbd]." msgstr "当用户按下 [kbd]Ctrl + C[/kbd] 时发出。" msgid "" +"Emitted when attempting to remove a GraphNode from the GraphEdit. Provides a " +"list of node names to be removed (all selected nodes, excluding nodes without " +"closing button)." +msgstr "" +"当尝试从该 GraphEdit 中移除一个 GraphNode 时触发。提供要移除的节点名称列表(所" +"有选中的节点,除去不包含关闭按钮的节点)。" + +msgid "" "Emitted to the GraphEdit when the connection between [param from_port] of " "[param from_node] [GraphNode] and [param to_port] of [param to_node] " "[GraphNode] is attempted to be removed." @@ -51744,6 +56672,10 @@ msgid "" "zoom." msgstr "[kbd]鼠标滚轮[/kbd]进行视图的移动,[kbd]Ctrl + 鼠标滚轮[/kbd]进行缩放。" +msgid "" +"Color of the connection's activity (see [method set_connection_activity])." +msgstr "该连接活动的颜色(请参阅 [method set_connection_activity])。" + msgid "Color of major grid lines." msgstr "主要栅格线的颜色。" @@ -51765,6 +56697,9 @@ msgstr "能够抓取端口的(外侧)横向范围。" msgid "The icon for the grid toggle button." msgstr "网格开关按钮的图标。" +msgid "The icon for the layout button for auto-arranging the graph." +msgstr "用于自动排列图形的布局按钮的图标。" + msgid "The icon for the minimap toggle button." msgstr "小地图开关按钮的图标。" @@ -51783,6 +56718,21 @@ msgstr "缩放重置按钮的图标。" msgid "The background drawn under the grid." msgstr "绘制在栅格下方的背景。" +msgid "" +"A container that represents a basic element that can be placed inside a " +"[GraphEdit] control." +msgstr "表示可以放置在 [GraphEdit] 控件内的基本元素的容器。" + +msgid "" +"[GraphElement] allows to create custom elements for a [GraphEdit] graph. By " +"default such elements can be selected, resized, and repositioned, but they " +"cannot be connected. For a graph element that allows for connections see " +"[GraphNode]." +msgstr "" +"[GraphElement] 允许为 [GraphEdit] 图表创建自定义元素。默认情况下,可以此类元素" +"可以被选择、调整大小、和重新定位,但它们无法被连接。对于允许连接的图形元素,请" +"参阅 [GraphNode]。" + msgid "If [code]true[/code], the user can drag the GraphElement." msgstr "如果为 [code]true[/code],则用户能够拖动该 GraphElement。" @@ -51835,6 +56785,10 @@ msgstr "" "当 GraphElement 被要求调整大小时发出。在拖动调整器手柄时发生(见 [member " "resizable])。" +msgid "" +"The icon used for the resizer, visible when [member resizable] is enabled." +msgstr "用于调整大小的图标,在 [member resizable] 被启用时可见。" + msgid "A container with connection ports, representing a node in a [GraphEdit]." msgstr "带有连接端口的容器,代表 [GraphEdit] 中的一个节点。" @@ -52027,6 +56981,38 @@ msgid "" "slot_index]." msgstr "开关索引为 [param slot_index] 的插槽的背景 [StyleBox]。" +msgid "" +"Toggles the left (input) side of the slot with the given [param slot_index]. " +"If [param enable] is [code]true[/code], a port will appear on the left side " +"and the slot will be able to be connected from this side." +msgstr "" +"切换给定插槽 [param slot_index] 的左侧(输入)端口。如果 [param enable] 为 " +"[code]true[/code],则左侧会出现一个端口,并且该插槽可以从这一侧连接。" + +msgid "" +"Toggles the right (output) side of the slot with the given [param " +"slot_index]. If [param enable] is [code]true[/code], a port will appear on " +"the right side and the slot will be able to be connected from this side." +msgstr "" +"切换给定插槽 [param slot_index] 的右侧(输出)端口。如果 [param enable] 为 " +"[code]true[/code],则右侧会出现一个端口,并且该插槽可以从这一侧连接。" + +msgid "" +"Sets the left (input) type of the slot with the given [param slot_index] to " +"[param type]. If the value is negative, all connections will be disallowed to " +"be created via user inputs." +msgstr "" +"将给定插槽 [param slot_index] 的左侧(输入)类型设置为 [param type]。如果该值" +"为负,则所有的连接将不允许通过用户输入来创建。" + +msgid "" +"Sets the right (output) type of the slot with the given [param slot_index] to " +"[param type]. If the value is negative, all connections will be disallowed to " +"be created via user inputs." +msgstr "" +"将给定插槽 [param slot_index] 的右侧(输出)类型设置为 [param type]。如果该值" +"为负,则所有的连接将不允许通过用户输入来创建。" + msgid "The text displayed in the GraphNode's title bar." msgstr "显示在 GraphNode 标题栏中的文本。" @@ -52045,9 +57031,22 @@ msgstr "端口之间的垂直距离。" msgid "The icon used for representing ports." msgstr "该图标用于表示端口。" +msgid "The default background for the slot area of the [GraphNode]." +msgstr "[GraphNode] 槽区域的默认背景。" + +msgid "The [StyleBox] used for the slot area when selected." +msgstr "用于被选中时的插槽区域的 [StyleBox]。" + msgid "The [StyleBox] used for each slot of the [GraphNode]." msgstr "用于 [GraphNode] 的每个插槽的 [StyleBox]。" +msgid "The [StyleBox] used for the title bar of the [GraphNode]." +msgstr "用于该 [GraphNode] 标题栏的 [StyleBox]。" + +msgid "" +"The [StyleBox] used for the title bar of the [GraphNode] when it is selected." +msgstr "当 [GraphNode] 被选中时,用于其标题栏的 [StyleBox]。" + msgid "A container that arranges its child controls in a grid layout." msgstr "将子控件按照网格布局排列的容器。" @@ -52292,6 +57291,9 @@ msgstr "覆盖整个 [GridMap] 的默认摩擦力和反弹物理属性。" msgid "Emitted when [member cell_size] changes." msgstr "当 [member cell_size] 改变时触发。" +msgid "Emitted when the [MeshLibrary] of this GridMap changes." +msgstr "该 GridMap 的 [MeshLibrary] 发生改变时发出。" + msgid "" "Invalid cell item that can be used in [method set_cell_item] to clear cells " "(or represent an empty cell in [method get_cell_item])." @@ -52837,6 +57839,19 @@ msgstr "" "信任的证书颁发机构,或者使用 HTTPS 时的通用名称验证。请参阅 [method " "TLSOptions.client] 和 [method TLSOptions.client_unsafe]。" +msgid "" +"Returns the response's body length.\n" +"[b]Note:[/b] Some Web servers may not send a body length. In this case, the " +"value returned will be [code]-1[/code]. If using chunked transfer encoding, " +"the body length will also be [code]-1[/code].\n" +"[b]Note:[/b] This function always returns [code]-1[/code] on the Web platform " +"due to browsers limitations." +msgstr "" +"返回响应体长度。\n" +"[b]注意:[/b]部分 Web 服务器可能不发送响应体长度,此时返回值将为 [code]-1[/" +"code]。如果使用分块传输编码,响应体的长度也将为 [code]-1[/code]。\n" +"[b]注意:[/b]由于浏览器的限制,该函数在 Web 平台上始终返回 [code]-1[/code]。" + msgid "Returns the response's HTTP status code." msgstr "返回响应的 HTTP 状态码。" @@ -54101,6 +59116,30 @@ msgstr "" "设置连接到 HTTPS 服务器时使用的 [TLSOptions]。见 [method TLSOptions.client]。" msgid "" +"If [code]true[/code], this header will be added to each request: [code]Accept-" +"Encoding: gzip, deflate[/code] telling servers that it's okay to compress " +"response bodies.\n" +"Any Response body declaring a [code]Content-Encoding[/code] of either " +"[code]gzip[/code] or [code]deflate[/code] will then be automatically " +"decompressed, and the uncompressed bytes will be delivered via [signal " +"request_completed].\n" +"If the user has specified their own [code]Accept-Encoding[/code] header, then " +"no header will be added regardless of [member accept_gzip].\n" +"If [code]false[/code] no header will be added, and no decompression will be " +"performed on response bodies. The raw bytes of the response body will be " +"returned via [signal request_completed]." +msgstr "" +"如果为 [code]true[/code],这个报头会被添加到每个请求中:[code]Accept-" +"Encoding: gzip, deflate[/code] 告诉服务器可以压缩响应正文。\n" +"任何声明 [code]gzip[/code] 或 [code]deflate[/code] 的 [code]Content-Encoding[/" +"code] 的响应正文,将被自动解压缩,并且未压缩的字节将通过 [signal " +"request_completed] 被传递。\n" +"如果用户指定了自己的 [code]Accept-Encoding[/code] 报头,那么无论 [member " +"accept_gzip] 是什么,都不会添加任何报头。\n" +"如果为 [code]false[/code],这将不会添加报头,并且不会对响应正文执行任何解压" +"缩。响应正文的原始字节将通过 [signal request_completed] 返回。" + +msgid "" "Maximum allowed size for response bodies. If the response body is compressed, " "this will be used as the maximum allowed size for the decompressed body." msgstr "" @@ -54193,6 +59232,25 @@ msgstr "" msgid "Image datatype." msgstr "图像数据类型。" +msgid "" +"Native image datatype. Contains image data which can be converted to an " +"[ImageTexture] and provides commonly used [i]image processing[/i] methods. " +"The maximum width and height for an [Image] are [constant MAX_WIDTH] and " +"[constant MAX_HEIGHT].\n" +"An [Image] cannot be assigned to a texture property of an object directly " +"(such as [member Sprite2D.texture]), and has to be converted manually to an " +"[ImageTexture] first.\n" +"[b]Note:[/b] The maximum image size is 16384×16384 pixels due to graphics " +"hardware limitations. Larger images may fail to import." +msgstr "" +"本机图像数据类型。包含可以被转换为 [ImageTexture] 的图像数据,并提供常用的[i]" +"图像处理[/i]方法。[Image] 的最大宽度和高度为 [constant MAX_WIDTH] 和 " +"[constant MAX_HEIGHT]。\n" +"[Image] 不能被直接分配给对象的纹理属性(例如 [member Sprite2D.texture]),必须" +"先手动转换为 [ImageTexture]。\n" +"[b]注意:[/b]由于图形硬件限制,最大图像大小为 16384×16384 像素。较大的图像可能" +"无法导入。" + msgid "Importing images" msgstr "导入图像" @@ -54374,18 +59432,21 @@ msgid "" "scaled down when rendered. They help improve image quality and performance " "when rendering. This method returns an error if the image is compressed, in a " "custom format, or if the image's width/height is [code]0[/code]. Enabling " -"[param renormalize] when generating mipmaps for normal textures will make " +"[param renormalize] when generating mipmaps for normal map textures will make " "sure all resulting vector values are normalized.\n" "It is possible to check if the image has mipmaps by calling [method " -"has_mipmaps] or [method get_mipmap_count]." +"has_mipmaps] or [method get_mipmap_count]. Calling [method generate_mipmaps] " +"on an image that already has mipmaps will replace existing mipmaps in the " +"image." msgstr "" -"为图像生成 Mipmap。Mipmap 是预先计算好的图像的低分辨率副本,如果图像在渲染时需" -"要按比例缩小,则会自动使用这些副本。它们有助于在渲染时提高图像质量和性能。如果" -"图像被压缩,或采用自定义格式,或图像的宽度或高度为 [code]0[/code],则该方法返" -"回错误。在为法线纹理生成 mipmap 时启用 [param renormalize] 能够确保得到的所有" -"向量值都是归一化的。\n" -"调用 [method has_mipmaps] 或 [method get_mipmap_count] 能够检查图像是否使用 " -"mipmap。" +"为图像生成多级渐远纹理(Mipmap)。多级渐远纹理是预先计算好的图像的低分辨率副" +"本,如果图像在渲染时需要按比例缩小,则会自动使用这些副本。它们有助于在渲染时提" +"高图像质量和性能。如果图像被压缩,或采用自定义格式,或图像的宽度或高度为 " +"[code]0[/code],则该方法返回错误。在为法线纹理生成多级渐远纹理时启用 [param " +"renormalize] 能够确保得到的所有向量值都是归一化的。\n" +"调用 [method has_mipmaps] 或 [method get_mipmap_count] 能够检查图像是否使用多" +"级渐远纹理。在已拥有多级渐远纹理的图像上调用 [method generate_mipmaps] 将替换" +"该图像中已有的多级渐远纹理。" msgid "Returns a copy of the image's raw data." msgstr "返回图像原始数据的副本。" @@ -54397,6 +59458,22 @@ msgid "Returns the image's height." msgstr "返回图像的高度。" msgid "" +"Returns the number of mipmap levels or 0 if the image has no mipmaps. The " +"largest main level image is not counted as a mipmap level by this method, so " +"if you want to include it you can add 1 to this count." +msgstr "" +"返回多级渐远纹理级别数;如果该图像没有多级渐远纹理,则返回 0。该方法不会将最大" +"的主要级别图像计为一个多级渐远纹理级别,因此如果你想将其包括在内,可以在该计数" +"中加 1。" + +msgid "" +"Returns the offset where the image's mipmap with index [param mipmap] is " +"stored in the [member data] dictionary." +msgstr "" +"返回存储在图像的 [member data] 字典中的索引为 [param mipmap] 的多级渐远纹理的" +"偏移量。" + +msgid "" "Returns the color of the pixel at [code](x, y)[/code].\n" "This is the same as [method get_pixelv], but with two integer arguments " "instead of a [Vector2i] argument." @@ -54466,11 +59543,17 @@ msgstr "" msgid "" "Loads an image from the binary contents of a BMP file.\n" "[b]Note:[/b] Godot's BMP module doesn't support 16-bit per pixel images. Only " -"1-bit, 4-bit, 8-bit, 24-bit, and 32-bit per pixel images are supported." -msgstr "" -"从 BMP 文件的二进制内容中加载图像。\n" -"[b]注意:[/b]Godot 的 BMP 模块不支持 16 位像素的图像。只支持 1 位、4 位、8 " -"位、24 位和 32 位像素的图像。" +"1-bit, 4-bit, 8-bit, 24-bit, and 32-bit per pixel images are supported.\n" +"[b]Note:[/b] This method is only available in engine builds with the BMP " +"module enabled. By default, the BMP module is enabled, but it can be disabled " +"at build-time using the [code]module_bmp_enabled=no[/code] SCons option." +msgstr "" +"从 BMP 文件的二进制内容加载图像。\n" +"[b]注意:[/b]Godot 的 BMP 模块不支持每像素 16 位的图像。仅支持每像素 1 位、4 " +"位、8 位、24 位和 32 位的图像。\n" +"[b]注意:[/b]该方法仅在启用了 BMP 模块的引擎版本中可用。默认情况下,BMP 模块是" +"启用的,但可以在构建时使用 [code]module_bmp_enabled=no[/code] SCons 选项禁用" +"它。" msgid "Creates a new [Image] and loads data from the specified file." msgstr "创建一个新的 [Image] 并从指定文件加载数据。" @@ -54478,11 +59561,64 @@ msgstr "创建一个新的 [Image] 并从指定文件加载数据。" msgid "Loads an image from the binary contents of a JPEG file." msgstr "从 JPEG 文件的二进制内容加载图像。" +msgid "" +"Loads an image from the binary contents of a [url=https://github.com/" +"KhronosGroup/KTX-Software]KTX[/url] file. Unlike most image formats, KTX can " +"store VRAM-compressed data and embed mipmaps.\n" +"[b]Note:[/b] Godot's libktx implementation only supports 2D images. Cubemaps, " +"texture arrays, and de-padding are not supported.\n" +"[b]Note:[/b] This method is only available in engine builds with the KTX " +"module enabled. By default, the KTX module is enabled, but it can be disabled " +"at build-time using the [code]module_ktx_enabled=no[/code] SCons option." +msgstr "" +"从 [url=https://github.com/KhronosGroup/KTX-Software]KTX[/url] 文件的二进制内" +"容加载图像。与大多数图像格式不同,KTX 可以存储 VRAM 压缩数据并嵌入 mipmap。\n" +"[b]注意:[/b]Godot 的 libktx 实现仅支持 2D 图像。不支持立方体贴图、纹理数组、" +"和去填充。\n" +"[b]注意:[/b]该方法仅在启用了 KTX 模块的引擎版本中可用。默认情况下,KTX 模块是" +"启用的,但可以在构建时使用 [code]module_ktx_enabled=no[/code] SCons 选项禁用" +"它。" + msgid "Loads an image from the binary contents of a PNG file." msgstr "从 PNG 文件的二进制内容加载图像。" -msgid "Loads an image from the binary contents of a TGA file." -msgstr "从 TGA 文件的二进制内容加载图像。" +msgid "" +"Loads an image from the UTF-8 binary contents of an [b]uncompressed[/b] SVG " +"file ([b].svg[/b]).\n" +"[b]Note:[/b] Beware when using compressed SVG files (like [b].svgz[/b]), they " +"need to be [code]decompressed[/code] before loading.\n" +"[b]Note:[/b] This method is only available in engine builds with the SVG " +"module enabled. By default, the SVG module is enabled, but it can be disabled " +"at build-time using the [code]module_svg_enabled=no[/code] SCons option." +msgstr "" +"从[b]未压缩[/b] SVG 文件([b].svg[/b])的 UTF-8 二进制内容加载图像。\n" +"[b]注意:[/b]使用压缩的 SVG 文件(如 [b].svgz[/b])时请注意,在加载之前需要对" +"其进行 [code]decompressed[/code]。\n" +"[b]注意:[/b]该方法仅在启用了 SVG 模块的引擎版本中可用。默认情况下,SVG 模块是" +"启用的,但可以在构建时使用 [code]module_svg_enabled=no[/code] SCons 选项禁用" +"它。" + +msgid "" +"Loads an image from the string contents of a SVG file ([b].svg[/b]).\n" +"[b]Note:[/b] This method is only available in engine builds with the SVG " +"module enabled. By default, the SVG module is enabled, but it can be disabled " +"at build-time using the [code]module_svg_enabled=no[/code] SCons option." +msgstr "" +"从 SVG 文件([b].svg[/b])的字符串内容加载图像。\n" +"[b]注意:[/b]该方法仅在启用了 SVG 模块的引擎版本中可用。默认情况下,SVG 模块是" +"启用的,但可以在构建时使用 [code]module_svg_enabled=no[/code] SCons 选项禁用" +"它。" + +msgid "" +"Loads an image from the binary contents of a TGA file.\n" +"[b]Note:[/b] This method is only available in engine builds with the TGA " +"module enabled. By default, the TGA module is enabled, but it can be disabled " +"at build-time using the [code]module_tga_enabled=no[/code] SCons option." +msgstr "" +"从 TGA 文件的二进制内容加载图像。\n" +"[b]注意:[/b]该方法仅在启用了 TGA 模块的引擎版本中可用。默认情况下,TGA 模块是" +"启用的,但可以在构建时使用 [code]module_tga_enabled=no[/code] SCons 选项禁用" +"它。" msgid "Loads an image from the binary contents of a WebP file." msgstr "从 WebP 文件的二进制内容加载图像。" @@ -54497,9 +59633,11 @@ msgstr "" msgid "" "Multiplies color values with alpha values. Resulting color values for a pixel " -"are [code](color * alpha)/256[/code]." +"are [code](color * alpha)/256[/code]. See also [member CanvasItemMaterial." +"blend_mode]." msgstr "" -"将颜色值与 Alpha 值相乘。像素的结果颜色值为 [code](color * alpha)/256[/code]。" +"将颜色值与 Alpha 值相乘。像素的最终颜色值为 [code](color * alpha)/256[/code]。" +"另见 [member CanvasItemMaterial.blend_mode]。" msgid "" "Resizes the image to the given [param width] and [param height]. New pixels " @@ -54617,20 +59755,29 @@ msgid "" "Saves the image as a WebP (Web Picture) file to the file at [param path]. By " "default it will save lossless. If [param lossy] is true, the image will be " "saved lossy, using the [param quality] setting between 0.0 and 1.0 " -"(inclusive)." +"(inclusive). Lossless WebP offers more efficient compression than PNG.\n" +"[b]Note:[/b] The WebP format is limited to a size of 16383×16383 pixels, " +"while PNG can save larger images." msgstr "" "将该图像作为 WebP(Web 图片)文件保存到 [param path] 中的文件中。默认情况下," "它将无损保存。如果 [param lossy] 为真,则该图像将使用介于 0.0 和 1.0(包含)之" -"间的 [param quality] 设置进行有损保存。" +"间的 [param quality] 设置进行有损保存。无损 WebP 提供比 PNG 更有效的压缩。\n" +"[b]注意:[/b]WebP 格式的大小限制为 16383×16383 像素,而 PNG 可以保存更大的图" +"像。" msgid "" "Saves the image as a WebP (Web Picture) file to a byte array. By default it " "will save lossless. If [param lossy] is true, the image will be saved lossy, " -"using the [param quality] setting between 0.0 and 1.0 (inclusive)." +"using the [param quality] setting between 0.0 and 1.0 (inclusive). Lossless " +"WebP offers more efficient compression than PNG.\n" +"[b]Note:[/b] The WebP format is limited to a size of 16383×16383 pixels, " +"while PNG can save larger images." msgstr "" "将该图像作为 WebP(Web 图片)文件保存到字节数组中。默认情况下,它将无损保存。" "如果 [param lossy] 为真,则该图像将使用介于 0.0 和 1.0(包含)之间的 [param " -"quality] 设置进行有损保存。" +"quality] 设置进行有损保存。无损 WebP 提供比 PNG 更有效的压缩。\n" +"[b]注意:[/b]WebP 格式的大小限制为 16383×16383 像素,而 PNG 可以保存更大的图" +"像。" msgid "" "Overwrites data of an existing [Image]. Non-static equivalent of [method " @@ -54724,8 +59871,10 @@ msgstr "" "[/codeblocks]\n" "这与 [method set_pixel] 相同,只是使用一个 [Vector2i] 参数而不是两个整数参数。" -msgid "Shrinks the image by a factor of 2." -msgstr "将图像缩小 2 倍。" +msgid "" +"Shrinks the image by a factor of 2 on each axis (this divides the pixel count " +"by 4)." +msgstr "在每个轴上将图像缩小 2 倍(这会将像素数除以 4)。" msgid "Converts the raw data from the sRGB colorspace to a linear scale." msgstr "将原始数据从 sRGB 色彩空间转换为线性比例。" @@ -54810,6 +59959,33 @@ msgstr "" "点值。" msgid "" +"OpenGL texture format [code]GL_R16F[/code] where there's one component, a 16-" +"bit \"half-precision\" floating-point value." +msgstr "" +"OpenGL 纹理格式 [code]GL_R16F[/code],其中有一个分量,即 16 位“半精度”浮点值。" + +msgid "" +"OpenGL texture format [code]GL_RG16F[/code] where there are two components, " +"each a 16-bit \"half-precision\" floating-point value." +msgstr "" +"OpenGL 纹理格式 [code]GL_RG16F[/code],其中有两个分量,每个分量都是 16 位“半精" +"度”浮点值。" + +msgid "" +"OpenGL texture format [code]GL_RGB16F[/code] where there are three " +"components, each a 16-bit \"half-precision\" floating-point value." +msgstr "" +"OpenGL 纹理格式 [code]GL_RGB16F[/code],其中有三个分量,每个分量都是 16 位“半" +"精度”浮点值。" + +msgid "" +"OpenGL texture format [code]GL_RGBA16F[/code] where there are four " +"components, each a 16-bit \"half-precision\" floating-point value." +msgstr "" +"OpenGL 纹理格式 [code]GL_RGBA16F[/code],其中有四个分量,每个都是 16 位“半精" +"度”浮点值。" + +msgid "" "A special OpenGL texture format where the three color components have 9 bits " "of precision and all three share a single 5-bit exponent." msgstr "" @@ -55355,9 +60531,74 @@ msgstr "" "其他图像[i]必须[/i]具有相同的宽度、高度、图像格式和 mipmapping 设置。\n" "每个 [Image] 代表一个 [code]layer[/code]。" +msgid "" +"Replaces the existing [Image] data at the given [param layer] with this new " +"image.\n" +"The given [Image] must have the same width, height, image format, and " +"mipmapping flag as the rest of the referenced images.\n" +"If the image format is unsupported, it will be decompressed and converted to " +"a similar and supported [enum Image.Format].\n" +"The update is immediate: it's synchronized with drawing." +msgstr "" +"用这个新图像替换给定 [param layer] 的现有 [Image] 数据。\n" +"给定的 [Image] 必须与其余引用的图像具有相同的宽度、高度、图像格式、和多级渐远" +"纹理标志。\n" +"如果图像格式不受支持,它将被解压缩并转换为一个相似且受支持的 [enum Image." +"Format]。\n" +"更新是即时的:它与绘制同步。" + msgid "Mesh optimized for creating geometry manually." msgstr "为手动创建几何体,而优化的网格。" +msgid "" +"A mesh type optimized for creating geometry manually, similar to OpenGL 1.x " +"immediate mode.\n" +"Here's a sample on how to generate a triangular face:\n" +"[codeblocks]\n" +"[gdscript]\n" +"var mesh = ImmediateMesh.new()\n" +"mesh.surface_begin(Mesh.PRIMITIVE_TRIANGLES)\n" +"mesh.surface_add_vertex(Vector3.LEFT)\n" +"mesh.surface_add_vertex(Vector3.FORWARD)\n" +"mesh.surface_add_vertex(Vector3.ZERO)\n" +"mesh.surface_end()\n" +"[/gdscript]\n" +"[csharp]\n" +"var mesh = new ImmediateMesh();\n" +"mesh.SurfaceBegin(Mesh.PrimitiveType.Triangles);\n" +"mesh.SurfaceAddVertex(Vector3.Left);\n" +"mesh.SurfaceAddVertex(Vector3.Forward);\n" +"mesh.SurfaceAddVertex(Vector3.Zero);\n" +"mesh.SurfaceEnd();\n" +"[/csharp]\n" +"[/codeblocks]\n" +"[b]Note:[/b] Generating complex geometries with [ImmediateMesh] is highly " +"inefficient. Instead, it is designed to generate simple geometry that changes " +"often." +msgstr "" +"针对手动创建几何体优化的网格类型,与 OpenGL 1.x 的立即模式类似。\n" +"以下是生成三角形面的示例:\n" +"[codeblocks]\n" +"[gdscript]\n" +"var mesh = ImmediateMesh.new()\n" +"mesh.surface_begin(Mesh.PRIMITIVE_TRIANGLES)\n" +"mesh.surface_add_vertex(Vector3.LEFT)\n" +"mesh.surface_add_vertex(Vector3.FORWARD)\n" +"mesh.surface_add_vertex(Vector3.ZERO)\n" +"mesh.surface_end()\n" +"[/gdscript]\n" +"[csharp]\n" +"var mesh = new ImmediateMesh();\n" +"mesh.SurfaceBegin(Mesh.PrimitiveType.Triangles);\n" +"mesh.SurfaceAddVertex(Vector3.Left);\n" +"mesh.SurfaceAddVertex(Vector3.Forward);\n" +"mesh.SurfaceAddVertex(Vector3.Zero);\n" +"mesh.SurfaceEnd();\n" +"[/csharp]\n" +"[/codeblocks]\n" +"[b]注意:[/b]使用 [ImmediateMesh] 生成复杂的几何体极其低效。这种网格的设计目的" +"是用来生成经常变化的简单几何体。" + msgid "Using ImmediateMesh" msgstr "使用 ImmediateMesh" @@ -55476,6 +60717,11 @@ msgstr "" "改变。" msgid "" +"Returns the arrays for the vertices, normals, UVs, etc. that make up the " +"requested surface. See [method add_surface]." +msgstr "返回构成请求表面的顶点、法线、UV 等的数组。参见 [method add_surface]。" + +msgid "" "Returns a single set of blend shape arrays for the requested blend shape " "index for a surface." msgstr "为一个表面请求的混合形状索引,返回一组混合形状数组。" @@ -55575,6 +60821,22 @@ msgstr "" "理时间的高级情况下,这可能是有用的。" msgid "" +"Returns the acceleration in m/s² of the device's accelerometer sensor, if the " +"device has one. Otherwise, the method returns [constant Vector3.ZERO].\n" +"Note this method returns an empty [Vector3] when running from the editor even " +"when your device has an accelerometer. You must export your project to a " +"supported device to read values from the accelerometer.\n" +"[b]Note:[/b] This method only works on Android and iOS. On other platforms, " +"it always returns [constant Vector3.ZERO]." +msgstr "" +"如果设备有加速度计传感器,则返回该设备加速度计传感器的加速度,单位为 m/s²。否" +"则,该方法返回 [constant Vector3.ZERO]。\\\n" +"请注意,即使你的设备具有一个加速度计,在从编辑器运行时,该方法也会返回一个空" +"的 [Vector3]。必须将项目导出到一个支持的设备上,才能从加速度计读取值。\n" +"[b]注意:[/b]该方法仅适用于 Android 和 iOS。在其他平台上,它总是返回 " +"[constant Vector3.ZERO]。" + +msgid "" "Returns a value between 0 and 1 representing the raw intensity of the given " "action, ignoring the action's deadzone. In most cases, you should use [method " "get_action_strength] instead.\n" @@ -55589,6 +60851,23 @@ msgstr "" "件的方向。" msgid "" +"Returns a value between 0 and 1 representing the intensity of the given " +"action. In a joypad, for example, the further away the axis (analog sticks or " +"L2, R2 triggers) is from the dead zone, the closer the value will be to 1. If " +"the action is mapped to a control that has no axis such as the keyboard, the " +"value returned will be 0 or 1.\n" +"If [param exact_match] is [code]false[/code], it ignores additional input " +"modifiers for [InputEventKey] and [InputEventMouseButton] events, and the " +"direction for [InputEventJoypadMotion] events." +msgstr "" +"返回一个介于 0 和 1 之间的值,表示给定动作的强度。例如,在游戏手柄中,轴(模拟" +"摇杆或 L2、R2 触发器)离死区越远,该值将越接近 1。如果动作被映射到一个如键盘一" +"样没有轴的控制器时,返回值将为 0 或 1。\n" +"如果 [param exact_match] 为 [code]false[/code],它会忽略 [InputEventKey] 和 " +"[InputEventMouseButton] 事件的额外输入修饰键,以及 [InputEventJoypadMotion] 事" +"件的方向。" + +msgid "" "Get axis input by specifying two actions, one negative and one positive.\n" "This is a shorthand for writing [code]Input." "get_action_strength(\"positive_action\") - Input." @@ -55698,6 +60977,18 @@ msgstr "" "因此,鼠标速度将滞后于鼠标移动。" msgid "" +"Returns the magnetic field strength in micro-Tesla for all axes of the " +"device's magnetometer sensor, if the device has one. Otherwise, the method " +"returns [constant Vector3.ZERO].\n" +"[b]Note:[/b] This method only works on Android and iOS. On other platforms, " +"it always returns [constant Vector3.ZERO]." +msgstr "" +"如果设备有磁力传感器,则返回设备所有轴的磁场强度,单位为微特斯拉。否则,该方法" +"返回 [constant Vector3.ZERO]。\n" +"[b]注意:[/b]该方法仅适用于 Android 和 iOS。在其他平台上,它总是返回 " +"[constant Vector3.ZERO]。" + +msgid "" "Returns mouse buttons as a bitmask. If multiple mouse buttons are pressed at " "the same time, the bits are added together. Equivalent to [method " "DisplayServer.mouse_get_button_state]." @@ -55737,7 +61028,10 @@ msgid "" "[b]Note:[/b] Due to keyboard ghosting, [method is_action_just_pressed] may " "return [code]false[/code] even if one of the action's keys is pressed. See " "[url=$DOCS_URL/tutorials/inputs/input_examples.html#keyboard-events]Input " -"examples[/url] in the documentation for more information." +"examples[/url] in the documentation for more information.\n" +"[b]Note:[/b] During input handling (e.g. [method Node._input]), use [method " +"InputEvent.is_action_pressed] instead to query the action state of the " +"current event." msgstr "" "当用户在当前帧或物理周期中[i]开始[/i]按下动作事件时返回 [code]true[/code]。只" "在用户按下按钮的那一帧或周期中为 [code]true[/code]。\n" @@ -55752,7 +61046,9 @@ msgstr "" "[b]注意:[/b]由于键盘重影,即便该动作的某个键处于按下状态,[method " "is_action_just_pressed] 仍可能会返回 [code]false[/code]。详情见文档中的" "[url=$DOCS_URL/tutorials/inputs/input_examples.html#keyboard-events]《输入示" -"例》[/url]。" +"例》[/url]。\n" +"[b]注意:[/b]在输入处理期间(例如 [method Node._input]),请使用 [method " +"InputEvent.is_action_pressed] 来查询当前事件的动作状态。" msgid "" "Returns [code]true[/code] when the user [i]stops[/i] pressing the action " @@ -55764,7 +61060,10 @@ msgid "" "input.\n" "If [param exact_match] is [code]false[/code], it ignores additional input " "modifiers for [InputEventKey] and [InputEventMouseButton] events, and the " -"direction for [InputEventJoypadMotion] events." +"direction for [InputEventJoypadMotion] events.\n" +"[b]Note:[/b] During input handling (e.g. [method Node._input]), use [method " +"InputEvent.is_action_released] instead to query the action state of the " +"current event." msgstr "" "当用户在当前帧或物理周期中[i]停止[/i]按下动作事件时返回 [code]true[/code]。只" "在用户松开按钮的那一帧或周期中为 [code]true[/code]。\n" @@ -55773,7 +61072,28 @@ msgstr "" "[code]true[/code]。\n" "如果 [param exact_match] 为 [code]false[/code],则会忽略 [InputEventKey] 和 " "[InputEventMouseButton] 事件的额外输入修饰键,以及 [InputEventJoypadMotion] 事" -"件的方向。" +"件的方向。\n" +"[b]注意:[/b]在输入处理期间(例如 [method Node._input]),请使用 [method " +"InputEvent.is_action_released] 来查询当前事件的动作状态。" + +msgid "" +"Returns [code]true[/code] if you are pressing the action event.\n" +"If [param exact_match] is [code]false[/code], it ignores additional input " +"modifiers for [InputEventKey] and [InputEventMouseButton] events, and the " +"direction for [InputEventJoypadMotion] events.\n" +"[b]Note:[/b] Due to keyboard ghosting, [method is_action_pressed] may return " +"[code]false[/code] even if one of the action's keys is pressed. See " +"[url=$DOCS_URL/tutorials/inputs/input_examples.html#keyboard-events]Input " +"examples[/url] in the documentation for more information." +msgstr "" +"如果正在按下操作事件,则返回 [code]true[/code]。\n" +"如果 [param exact_match] 为 [code]false[/code],则它会忽略 [InputEventKey] 和 " +"[InputEventMouseButton] 事件的额外输入修饰键,以及 [InputEventJoypadMotion] 事" +"件的方向。\n" +"[b]注意:[/b]由于键盘重影,[method is_action_pressed] 可能会返回 [code]false[/" +"code],即使动作的某个键被按下时也是如此。有关详细信息,请参阅文档中的 " +"[url=$DOCS_URL/tutorials/inputs/input_examples.html#keyboard-events]《输入示" +"例》[/url]。" msgid "" "Returns [code]true[/code] if any action, key, joypad button, or mouse button " @@ -55994,6 +61314,23 @@ msgstr "" "[b]注意:[/b]在 Android 和 iOS 上,这个值可立即被硬件传感器的值所覆盖。" msgid "" +"Queries whether an input device should be ignored or not. Devices can be " +"ignored by setting the environment variable " +"[code]SDL_GAMECONTROLLER_IGNORE_DEVICES[/code]. Read the [url=https://wiki." +"libsdl.org/SDL2]SDL documentation[/url] for more information.\n" +"[b]Note:[/b] Some 3rd party tools can contribute to the list of ignored " +"devices. For example, [i]SteamInput[/i] creates virtual devices from physical " +"devices for remapping purposes. To avoid handling the same input device " +"twice, the original device is added to the ignore list." +msgstr "" +"查询输入设备是否应被忽略。可以通过设置环境变量 " +"[code]SDL_GAMECONTROLLER_IGNORE_DEVICES[/code] 来忽略设备。请阅读 " +"[url=https://wiki.libsdl.org/SDL2]SDL 文档[/url]了解更多信息。\n" +"[b]注意:[/b]某些第三方工具可以添加忽略设备列表。例如,[i]SteamInput[/i] 从物" +"理设备创建虚拟设备以进行重新映射。为了避免两次处理相同的输入设备,原始设备被添" +"加到忽略列表中。" + +msgid "" "Starts to vibrate the joypad. Joypads usually come with two rumble motors, a " "strong and a weak one. [param weak_magnitude] is the strength of the weak " "motor (between 0 and 1) and [param strong_magnitude] is the strength of the " @@ -56614,6 +61951,58 @@ msgstr "" "[/codeblock]" msgid "" +"Represents the physical location of a key on the 101/102-key US QWERTY " +"keyboard, which corresponds to one of the [enum Key] constants.\n" +"To get a human-readable representation of the [InputEventKey], use [method OS." +"get_keycode_string] in combination with [method DisplayServer." +"keyboard_get_keycode_from_physical]:\n" +"[codeblocks]\n" +"[gdscript]\n" +"func _input(event):\n" +" if event is InputEventKey:\n" +" var keycode = DisplayServer.keyboard_get_keycode_from_physical(event." +"physical_keycode)\n" +" print(OS.get_keycode_string(keycode))\n" +"[/gdscript]\n" +"[csharp]\n" +"public override void _Input(InputEvent @event)\n" +"{\n" +" if (@event is InputEventKey inputEventKey)\n" +" {\n" +" var keycode = DisplayServer." +"KeyboardGetKeycodeFromPhysical(inputEventKey.PhysicalKeycode);\n" +" GD.Print(OS.GetKeycodeString(keycode));\n" +" }\n" +"}\n" +"[/csharp]\n" +"[/codeblocks]" +msgstr "" +"代表按键在 101/102 键的美式键盘上的物理位置,对应一个 [enum Key] 常量。\n" +"要获取 [InputEventKey] 的人类可读表示,请搭配使用 [method OS." +"get_keycode_string] 和 [method DisplayServer." +"keyboard_get_keycode_from_physical]:\n" +"[codeblocks]\n" +"[gdscript]\n" +"func _input(event):\n" +" if event is InputEventKey:\n" +" var keycode = DisplayServer.keyboard_get_keycode_from_physical(event." +"physical_keycode)\n" +" print(OS.get_keycode_string(keycode))\n" +"[/gdscript]\n" +"[csharp]\n" +"public override void _Input(InputEvent @event)\n" +"{\n" +" if (@event is InputEventKey inputEventKey)\n" +" {\n" +" var keycode = DisplayServer." +"KeyboardGetKeycodeFromPhysical(inputEventKey.PhysicalKeycode);\n" +" GD.Print(OS.GetKeycodeString(keycode));\n" +" }\n" +"}\n" +"[/csharp]\n" +"[/codeblocks]" + +msgid "" "If [code]true[/code], the key's state is pressed. If [code]false[/code], the " "key's state is released." msgstr "" @@ -56634,6 +62023,18 @@ msgid "Represents a magnifying touch gesture." msgstr "代表放大触摸手势。" msgid "" +"Stores the factor of a magnifying touch gesture. This is usually performed " +"when the user pinches the touch screen and used for zooming in/out.\n" +"[b]Note:[/b] On Android, this requires the [member ProjectSettings." +"input_devices/pointing/android/enable_pan_and_scale_gestures] project setting " +"to be enabled." +msgstr "" +"存储放大触摸手势的系数。通常用户在触摸屏上将双指捏合,就执行了放大手势,可用于" +"缩放。\n" +"[b]注意:[/b]在 Android 上,这需要启用 [member ProjectSettings.input_devices/" +"pointing/android/enable_pan_and_scale_gestures] 项目设置。" + +msgid "" "The amount (or delta) of the event. This value is closer to [code]1.0[/code] " "the slower the gesture is performed." msgstr "事件的量(或增量)。这个值越接近 [code]1.0[/code],手势执行地越快。" @@ -56999,6 +62400,19 @@ msgstr "鼠标速度,以像素每秒为单位。" msgid "Represents a panning touch gesture." msgstr "代表平移触摸手势。" +msgid "" +"Stores information about pan gestures. A pan gesture is performed when the " +"user swipes the touch screen with two fingers. It's typically used for " +"panning/scrolling.\n" +"[b]Note:[/b] On Android, this requires the [member ProjectSettings." +"input_devices/pointing/android/enable_pan_and_scale_gestures] project setting " +"to be enabled." +msgstr "" +"存储与平移手势相关的信息。用户在触摸屏上滑动双指,就执行了平移手势。一般用于平" +"移/滚动。\n" +"[b]注意:[/b]在 Android 上,这需要启用 [member ProjectSettings.input_devices/" +"pointing/android/enable_pan_and_scale_gestures] 项目设置。" + msgid "Panning amount since last pan event." msgstr "上一次平移事件以来的平移量。" @@ -57092,9 +62506,27 @@ msgstr "" msgid "Returns the keycode combination of modifier keys." msgstr "返回修饰键的键码组合。" +msgid "" +"On macOS, returns [code]true[/code] if [kbd]Meta[/kbd] ([kbd]Cmd[/kbd]) is " +"pressed.\n" +"On other platforms, returns [code]true[/code] if [kbd]Ctrl[/kbd] is pressed." +msgstr "" +"在 macOS 上,如果 [kbd]Meta[/kbd]([kbd]Cmd[/kbd])是按下状态,则返回 " +"[code]true[/code] 。\n" +"在其他平台上,如果 [kbd]Ctrl[/kbd] 是按下状态,则返回 [code]true[/code] 。" + msgid "State of the [kbd]Alt[/kbd] modifier." msgstr "[kbd]Alt[/kbd] 修饰键的状态。" +msgid "" +"Automatically use [kbd]Meta[/kbd] ([kbd]Cmd[/kbd]) on macOS and [kbd]Ctrl[/" +"kbd] on other platforms. If [code]true[/code], [member ctrl_pressed] and " +"[member meta_pressed] cannot be set." +msgstr "" +"自动在 macOS 上使用 [kbd]Meta[/kbd]([kbd]Cmd[/kbd]),在其他平台上使用 " +"[kbd]Ctrl[/kbd]。如果为 [code]true[/code],则无法设置 [member ctrl_pressed] " +"和 [member meta_pressed]。" + msgid "State of the [kbd]Ctrl[/kbd] modifier." msgstr "[kbd]Ctrl[/kbd] 修饰键的状态。" @@ -57882,6 +63314,16 @@ msgid "" msgstr "确保当前选择可见,根据需要调整滚动位置。" msgid "" +"Forces an update to the list size based on its items. This happens " +"automatically whenever size of the items, or other relevant settings like " +"[member auto_height], change. The method can be used to trigger the update " +"ahead of next drawing pass." +msgstr "" +"根据列表项强制更新该列表大小。每当项目的大小或其他相关设置(例如 [member " +"auto_height])发生变化时,这种情况就会自动发生。该方法可被用于在下一次绘制阶段" +"之前触发更新。" + +msgid "" "Returns the item index at the given [param position].\n" "When there is no item at that point, -1 will be returned if [param exact] is " "[code]true[/code], and the closest item index will be returned otherwise.\n" @@ -58326,6 +63768,19 @@ msgstr "" "载。" msgid "" +"Execute the string [param code] as JavaScript code within the browser window. " +"This is a call to the actual global JavaScript function [code skip-lint]eval()" +"[/code].\n" +"If [param use_global_execution_context] is [code]true[/code], the code will " +"be evaluated in the global execution context. Otherwise, it is evaluated in " +"the execution context of a function within the engine's runtime environment." +msgstr "" +"在浏览器窗口中将字符串 [param code] 作为 JavaScript 代码执行。这是对实际的全" +"局 JavaScript 函数 [code skip-lint]eval()[/code] 的调用。\n" +"如果 [param use_global_execution_context] 为 [code]true[/code],则代码将在全局" +"执行上下文中被求值。否则,它将在引擎运行时环境中的函数的执行上下文中进行求值。" + +msgid "" "Force synchronization of the persistent file system (when enabled).\n" "[b]Note:[/b] This is only useful for modules or extensions that can't use " "[FileAccess] to write files." @@ -58481,6 +63936,20 @@ msgid "Returns the joint's [RID]." msgstr "返回关节的 [RID]。" msgid "" +"When [member node_a] and [member node_b] move in different directions the " +"[member bias] controls how fast the joint pulls them back to their original " +"position. The lower the [member bias] the more the two bodies can pull on the " +"joint.\n" +"When set to [code]0[/code], the default value from [member ProjectSettings." +"physics/2d/solver/default_constraint_bias] is used." +msgstr "" +"当 [member node_a] 和 [member node_b] 向不同方向移动时,[member bias] 控制关节" +"将它们拉回到原始位置的速度。[member bias] 越低,两个实体对该关节的拉力就越" +"大。\n" +"当被设置为 [code]0[/code] 时,使用来自 [member ProjectSettings.physics/2d/" +"solver/default_constraint_bias] 的默认值。" + +msgid "" "If [code]true[/code], [member node_a] and [member node_b] can not collide." msgstr "" "如果为 [code]true[/code],则 [member node_a] 和 [member node_b] 无法碰撞。" @@ -59063,6 +64532,11 @@ msgid "" "Takes priority over theme properties." msgstr "[LabelSettings] 资源,可以在多个 [Label] 节点之间共享。优先于主题属性。" +msgid "" +"The number of the lines ignored and not displayed from the start of the " +"[member text] value." +msgstr "从 [member text] 值的开头开始忽略且不显示的行数。" + msgid "Limits the lines of text the node shows on screen." msgstr "限制节点在屏幕上显示的文本行数。" @@ -59636,6 +65110,15 @@ msgstr "" "shadow_enabled] 为 [code]true[/code] 时有效。" msgid "" +"If [code]true[/code], the light only appears in the editor and will not be " +"visible at runtime. If [code]true[/code], the light will never be baked in " +"[LightmapGI] regardless of its [member light_bake_mode]." +msgstr "" +"如果为 [code]true[/code],灯光只在编辑器中出现,在运行时将不可见。如果为 " +"[code]true[/code],则无论其 [member light_bake_mode] 如何,灯光都不会在 " +"[LightmapGI] 中进行烘焙。" + +msgid "" "The light's angular size in degrees. Increasing this will make shadows softer " "at greater distances (also called percentage-closer soft shadows, or PCSS). " "Only available for [DirectionalLight3D]s. For reference, the Sun from the " @@ -59987,6 +65470,22 @@ msgstr "" "响烘焙 [VoxelGI] 和 SDFGI(请参阅 [member Environment.sdfgi_enabled])。" msgid "" +"Light is taken into account in static baking ([VoxelGI], [LightmapGI], SDFGI " +"([member Environment.sdfgi_enabled])). The light can be moved around or " +"modified, but its global illumination will not update in real-time. This is " +"suitable for subtle changes (such as flickering torches), but generally not " +"large changes such as toggling a light on and off.\n" +"[b]Note:[/b] The light is not baked in [LightmapGI] if [member editor_only] " +"is [code]true[/code]." +msgstr "" +"在静态烘焙([VoxelGI]、[LightmapGI]、SDFGI([member Environment." +"sdfgi_enabled]))时,考虑了灯光。灯光可以四处移动或修改,但其全局照明不会实时" +"更新。这适用于细微的变化(例如闪烁的手电筒),但通常不适用于大的变化,例如打开" +"和关闭灯光。\n" +"[b]注意:[/b]如果 [member editor_only] 为 [code]true[/code],则灯光不会在 " +"[LightmapGI] 中烘焙。" + +msgid "" "Light is taken into account in dynamic baking ([VoxelGI] and SDFGI ([member " "Environment.sdfgi_enabled]) only). The light can be moved around or modified " "with global illumination updating in real-time. The light's global " @@ -60065,6 +65564,23 @@ msgstr "" "[member bias] 属性的影响。" msgid "" +"The energy multiplier for each bounce. Higher values will make indirect " +"lighting brighter. A value of [code]1.0[/code] represents physically accurate " +"behavior, but higher values can be used to make indirect lighting propagate " +"more visibly when using a low number of bounces. This can be used to speed up " +"bake times by lowering the number of [member bounces] then increasing [member " +"bounce_indirect_energy].\n" +"[b]Note:[/b] [member bounce_indirect_energy] only has an effect if [member " +"bounces] is set to a value greater than or equal to [code]1[/code]." +msgstr "" +"每次反弹的能量乘数。较高的值将使间接照明更亮。值 [code]1.0[/code] 代表物理上准" +"确的行为,但较高的值可用于在使用少量反弹时使间接照明传播更明显。这可以通过减" +"少 [member bounces] 数量,然后增加 [member bounce_indirect_energy] 来加速烘焙" +"时间。\n" +"[b]注意:[/b][member bounce_indirect_energy] 仅在 [member bounces] 被设置为大" +"于或等于 [code]1[/code] 的值时才有效。" + +msgid "" "Number of light bounces that are taken into account during baking. Higher " "values result in brighter, more realistic lighting, at the cost of longer " "bake times. If set to [code]0[/code], only environment lighting, direct light " @@ -60085,6 +65601,38 @@ msgstr "" "现带状伪影,或可能出现过度曝光伪影。" msgid "" +"The strength of denoising step applied to the generated lightmaps. Only " +"effective if [member use_denoiser] is [code]true[/code] and [member " +"ProjectSettings.rendering/lightmapping/denoising/denoiser] is set to JNLM." +msgstr "" +"应用于生成的光照贴图的去噪步骤的强度。仅当 [member use_denoiser] 为 " +"[code]true[/code] 且 [member ProjectSettings.rendering/lightmapping/denoising/" +"denoiser] 被设置为 JNLM 时有效。" + +msgid "" +"If [code]true[/code], bakes lightmaps to contain directional information as " +"spherical harmonics. This results in more realistic lighting appearance, " +"especially with normal mapped materials and for lights that have their direct " +"light baked ([member Light3D.light_bake_mode] set to [constant Light3D." +"BAKE_STATIC] and with [member Light3D.editor_only] set to [code]false[/" +"code]). The directional information is also used to provide rough reflections " +"for static and dynamic objects. This has a small run-time performance cost as " +"the shader has to perform more work to interpret the direction information " +"from the lightmap. Directional lightmaps also take longer to bake and result " +"in larger file sizes.\n" +"[b]Note:[/b] The property's name has no relationship with " +"[DirectionalLight3D]. [member directional] works with all light types." +msgstr "" +"如果为 [code]true[/code],烘焙光照贴图以包含作为球谐函数的方向信息。这会产生更" +"逼真的光照外观,尤其是使用法线贴图材质和烘焙了直射光的灯光([member Light3D." +"light_bake_mode] 设置为 [constant Light3D.BAKE_STATIC] 并将 [member Light3D." +"editor_only] 设置为 [code]false[/code])。方向信息还用于为静态和动态对象提供粗" +"略的反射。这有一个小的运行时性能成本,因为着色器必须执行更多的工作,来解释来自" +"光照贴图的方向信息。定向光照贴图也需要更长的时间来烘焙并产生更大的文件大小。\n" +"[b]注意:[/b]属性的名称与 [DirectionalLight3D] 没有关系。[member directional] " +"适用于所有灯光类型。" + +msgid "" "The color to use for environment lighting. Only effective if [member " "environment_mode] is [constant ENVIRONMENT_MODE_CUSTOM_COLOR]." msgstr "" @@ -60159,6 +65707,34 @@ msgstr "" "use_denoiser]、并增加 3D 场景的光照贴图纹素大小。" msgid "" +"If [code]true[/code], uses a GPU-based denoising algorithm on the generated " +"lightmap. This eliminates most noise within the generated lightmap at the " +"cost of longer bake times. File sizes are generally not impacted " +"significantly by the use of a denoiser, although lossless compression may do " +"a better job at compressing a denoised image." +msgstr "" +"如果为 [code]true[/code],则在生成的光照贴图上,使用基于 GPU 的降噪算法。这以" +"更长的烘焙时间为代价,消除了生成的光照贴图中的大部分噪点。尽管无损压缩在压缩降" +"噪图像方面可能做得更好,但使用降噪器通常不会显著影响文件大小。" + +msgid "" +"If [code]true[/code], a texture with the lighting information will be " +"generated to speed up the generation of indirect lighting at the cost of some " +"accuracy. The geometry might exhibit extra light leak artifacts when using " +"low resolution lightmaps or UVs that stretch the lightmap significantly " +"across surfaces. Leave [member use_texture_for_bounces] at its default value " +"of [code]true[/code] if unsure.\n" +"[b]Note:[/b] [member use_texture_for_bounces] only has an effect if [member " +"bounces] is set to a value greater than or equal to [code]1[/code]." +msgstr "" +"如果为 [code]true[/code],将生成带有照明信息的纹理,以加快间接照明的生成速度," +"但会牺牲一定的精度。当使用低分辨率光照贴图或在表面上显著拉伸光照贴图的 UV 时," +"几何体可能会出现额外的漏光伪影。如果不确定,请将 [member " +"use_texture_for_bounces] 保留为其默认值 [code]true[/code]。\n" +"[b]注意:[/b][member use_texture_for_bounces] 仅在 [member bounces] 被设置为大" +"于或等于 [code]1[/code] 的值时才有效。" + +msgid "" "Low bake quality (fastest bake times). The quality of this preset can be " "adjusted by changing [member ProjectSettings.rendering/lightmapping/" "bake_quality/low_quality_ray_count] and [member ProjectSettings.rendering/" @@ -60268,6 +65844,12 @@ msgid "" msgstr "" "用户中止了光照贴图烘焙操作(通常通过点击进度对话框中的[b]取消[/b]按钮)。" +msgid "" +"Lightmap baking failed as the maximum texture size is too small to fit some " +"of the meshes marked for baking." +msgstr "" +"光照贴图烘焙失败,因为最大纹理尺寸太小,无法容纳某些被标记为烘焙的网格。" + msgid "Ignore environment lighting when baking lightmaps." msgstr "烘焙光照贴图时忽略环境光照。" @@ -60343,6 +65925,18 @@ msgstr "" "烘焙光照贴图之前,材质外观将看起来不正确,在这种情况下,此处设置的值将被丢弃," "因为整个 [LightmapGIData] 资源被光照贴图器替换。" +msgid "" +"The lightmap atlas texture generated by the lightmapper.\n" +"[i]Deprecated.[/i] The lightmap atlas can now have multiple textures. See " +"[member lightmap_textures]." +msgstr "" +"由光照贴图器生成的光照贴图图集纹理。\n" +"[i]已弃用。[/i]光照贴图图集现在可以有多个纹理。请参阅 [member " +"lightmap_textures]。" + +msgid "The lightmap atlas textures generated by the lightmapper." +msgstr "由光照贴图器生成的光照贴图图集纹理。" + msgid "Abstract class extended by lightmappers, for use in [LightmapGI]." msgstr "由光照贴图器扩展的抽象类,用于 [LightmapGI]。" @@ -60418,15 +66012,211 @@ msgstr "" "LightOccluder2D 的遮挡器光照掩码。LightOccluder2D 将仅从具有相同光照掩码的 " "Light2D 投射阴影。" +msgid "" +"If enabled, the occluder will be part of a real-time generated signed " +"distance field that can be used in custom shaders." +msgstr "" +"如果启用,该遮挡器将成为实时生成的带符号距离场的一部分,可被用于自定义着色器" +"中。" + +msgid "A 2D polyline that can optionally be textured." +msgstr "可以选择设置纹理的 2D 折线。" + +msgid "" +"This node draws a 2D polyline, i.e. a shape consisting of several points " +"connected by segments. [Line2D] is not a mathematical polyline, i.e. the " +"segments are not infinitely thin. It is intended for rendering and it can be " +"colored and optionally textured.\n" +"[b]Warning:[/b] Certain configurations may be impossible to draw nicely, such " +"as very sharp angles. In these situations, the node uses fallback drawing " +"logic to look decent.\n" +"[b]Note:[/b] [Line2D] is drawn using a 2D mesh." +msgstr "" +"该节点绘制一条 2D 折线,即由多个线段连接的点组成的形状。[Line2D] 不是数学折" +"线,即线段不是无限细的。它用于渲染,且可以被着色,也可以选择纹理。\n" +"[b]警告:[/b]某些配置可能无法很好地绘制,例如非常锐利的角度。在这些情况下,节" +"点使用后备绘制逻辑来看起来不错。\n" +"[b]注意:[/b][Line2D] 使用 2D 网格进行绘制。" + +msgid "" +"Adds a point with the specified [param position] relative to the polyline's " +"own position. If no [param index] is provided, the new point will be added to " +"the end of the points array.\n" +"If [param index] is given, the new point is inserted before the existing " +"point identified by index [param index]. The indices of the points after the " +"new point get increased by 1. The provided [param index] must not exceed the " +"number of existing points in the polyline. See [method get_point_count]." +msgstr "" +"在指定的位置 [param position] 添加一个点,该位置相对于该线段自身的位置。如果未" +"提供 [param index],则新的点将被添加到点数组的末尾。\n" +"如果给出 [param index],则将新点插入到由索引 [param index] 标识的已有点之前。" +"该新点之后的点的索引增加 1。提供的 [param index] 不得超过折线中已有点的数量。" +"请参阅 [method get_point_count]。" + +msgid "Removes all points from the polyline, making it empty." +msgstr "从折线中移除所有点,使其为空。" + +msgid "Returns the number of points in the polyline." +msgstr "返回该折线中的点的数量。" + msgid "Returns the position of the point at index [param index]." msgstr "返回索引为 [param index] 的点的位置。" +msgid "Removes the point at index [param index] from the polyline." +msgstr "移除该折线中索引为 [param index] 的点。" + +msgid "" +"Overwrites the position of the point at the given [param index] with the " +"supplied [param position]." +msgstr "用提供的 [param position] 覆盖给定索引 [param index] 处的点的位置。" + +msgid "" +"If [code]true[/code], the polyline's border will be anti-aliased.\n" +"[b]Note:[/b] [Line2D] is not accelerated by batching when being anti-aliased." +msgstr "" +"如果为 [code]true[/code],则折线的边界将使用抗锯齿。\n" +"[b]注意:[/b][Line2D] 在使用抗锯齿时,不会通过批处理来加速。" + +msgid "" +"The style of the beginning of the polyline, if [member closed] is " +"[code]false[/code]. Use [enum LineCapMode] constants." +msgstr "" +"[member closed] 为 [code]false[/code] 时的折线开头样式。使用 [enum " +"LineCapMode] 常量。" + +msgid "" +"If [code]true[/code] and the polyline has more than 2 points, the last point " +"and the first one will be connected by a segment.\n" +"[b]Note:[/b] The shape of the closing segment is not guaranteed to be " +"seamless if a [member width_curve] is provided.\n" +"[b]Note:[/b] The joint between the closing segment and the first segment is " +"drawn first and it samples the [member gradient] and the [member width_curve] " +"at the beginning. This is an implementation detail that might change in a " +"future version." +msgstr "" +"如果为 [code]true[/code] 并且折线有超过2个点,则最后一个点和第一个点将通过线段" +"连接。\n" +"[b]注意:[/b]如果提供了 [member width_curve],则不保证闭合线段的形状是无缝" +"的。\n" +"[b]注意:[/b]首先绘制结束线段和第一条线段之间的连接点,并在开始时对 [member " +"gradient] 和 [member width_curve] 进行采样。这是在未来版本中可能会更改的实现细" +"节。" + +msgid "The color of the polyline. Will not be used if a gradient is set." +msgstr "折线的颜色。如果设置了渐变,则不会被使用。" + +msgid "" +"The style of the end of the polyline, if [member closed] is [code]false[/" +"code]. Use [enum LineCapMode] constants." +msgstr "" +"[member closed] 为 [code]false[/code] 时的折线末端样式。使用 [enum " +"LineCapMode] 常量。" + +msgid "" +"The gradient is drawn through the whole line from start to finish. The " +"[member default_color] will not be used if this property is set." +msgstr "" +"渐变是从头到尾贯穿整条线绘制的。如果该属性被设置,则 [member default_color] 不" +"会被使用。" + +msgid "" +"The style of the connections between segments of the polyline. Use [enum " +"LineJointMode] constants." +msgstr "折线段之间的连接样式。使用 [enum LineJointMode] 常量。" + +msgid "" +"The points of the polyline, interpreted in local 2D coordinates. Segments are " +"drawn between the adjacent points in this array." +msgstr "折线的点,以局部 2D 坐标解释。在该数组中的相邻点之间绘制线段。" + +msgid "" +"The smoothness used for rounded joints and caps. Higher values result in " +"smoother corners, but are more demanding to render and update." +msgstr "" +"用于圆形接头和端盖的光滑度。值越高,边角越平滑,但对渲染和更新的要求更高。" + +msgid "" +"Determines the miter limit of the polyline. Normally, when [member " +"joint_mode] is set to [constant LINE_JOINT_SHARP], sharp angles fall back to " +"using the logic of [constant LINE_JOINT_BEVEL] joints to prevent very long " +"miters. Higher values of this property mean that the fallback to a bevel " +"joint will happen at sharper angles." +msgstr "" +"确定该折线的斜接限制。通常,当 [member joint_mode] 被设置为 [constant " +"LINE_JOINT_SHARP] 时,锐角会回退到使用 [constant LINE_JOINT_BEVEL] 关节的逻辑" +"来防止过长的斜接。该属性的值越高意味着倒角接头的回退将以更锐利的角度发生。" + +msgid "" +"The texture used for the polyline. Uses [member texture_mode] for drawing " +"style." +msgstr "用于折线的纹理。使用 [member texture_mode] 作为绘图样式。" + +msgid "" +"The style to render the [member texture] of the polyline. Use [enum " +"LineTextureMode] constants." +msgstr "" +"渲染该折线的 [member texture] 的样式。使用 [enum LineTextureMode] 常量。" + msgid "The polyline's width." msgstr "多边形的宽度。" +msgid "" +"The polyline's width curve. The width of the polyline over its length will be " +"equivalent to the value of the width curve over its domain." +msgstr "该折线的宽度曲线。该折线在其长度上的宽度将等于宽度曲线在其域上的值。" + +msgid "" +"Makes the polyline's joints pointy, connecting the sides of the two segments " +"by extending them until they intersect. If the rotation of a joint is too big " +"(based on [member sharp_limit]), the joint falls back to [constant " +"LINE_JOINT_BEVEL] to prevent very long miters." +msgstr "" +"使该折线的接头变尖,通过延伸两条线段直至它们相交来连接它们的侧面。如果关节的旋" +"转太大(基于 [member sharp_limit]),关节将回落到 [constant LINE_JOINT_BEVEL] " +"以防止出现过长的斜角。" + +msgid "" +"Makes the polyline's joints bevelled/chamfered, connecting the sides of the " +"two segments with a simple line." +msgstr "使折线的接头倾斜/倒角,用一条简单的线连接两个线段的侧面。" + +msgid "" +"Makes the polyline's joints rounded, connecting the sides of the two segments " +"with an arc. The detail of this arc depends on [member round_precision]." +msgstr "" +"使该折线的接头变圆,用圆弧连接两条线段的侧面。该弧的细节取决于 [member " +"round_precision]。" + msgid "Draws no line cap." msgstr "不绘制线条端点。" +msgid "Draws the line cap as a box, slightly extending the first/last segment." +msgstr "将线帽绘制为方框,稍微延伸第一段/最后一段。" + +msgid "Draws the line cap as a semicircle attached to the first/last segment." +msgstr "将线帽绘制为连接到第一条/最后一条线段的半圆。" + +msgid "" +"Takes the left pixels of the texture and renders them over the whole polyline." +msgstr "获取纹理的左侧像素并将它们渲染在整条折线上。" + +msgid "" +"Tiles the texture over the polyline. [member CanvasItem.texture_repeat] of " +"the [Line2D] node must be [constant CanvasItem.TEXTURE_REPEAT_ENABLED] or " +"[constant CanvasItem.TEXTURE_REPEAT_MIRROR] for it to work properly." +msgstr "" +"将纹理平铺在该折线上。该 [Line2D] 节点的 [member CanvasItem.texture_repeat] 必" +"须为 [constant CanvasItem.TEXTURE_REPEAT_ENABLED] 或 [constant CanvasItem." +"TEXTURE_REPEAT_MIRROR],才能正常工作。" + +msgid "" +"Stretches the texture across the polyline. [member CanvasItem.texture_repeat] " +"of the [Line2D] node must be [constant CanvasItem.TEXTURE_REPEAT_DISABLED] " +"for best results." +msgstr "" +"沿该折线拉伸纹理。为了获得最佳效果,[Line2D] 节点的 [member CanvasItem." +"texture_repeat] 必须为 [constant CanvasItem.TEXTURE_REPEAT_DISABLED]。" + msgid "An input field for single-line text." msgstr "单行文本的输入字段。" @@ -60739,6 +66529,14 @@ msgstr "" "如果为 [code]true[/code],则 [LineEdit] 宽度将增加到比 [member text] 长。如果 " "[member text] 被缩短,它将[b]不[/b]压缩。" +msgid "If [code]true[/code], the [LineEdit] doesn't display decoration." +msgstr "如果为 [code]true[/code],则 [LineEdit] 不显示装饰。" + +msgid "" +"Language code used for line-breaking and text shaping algorithms. If left " +"empty, current locale is used instead." +msgstr "语言代码,用于断行和文本塑形算法。如果留空则使用当前区域设置。" + msgid "" "Maximum number of characters that can be entered inside the [LineEdit]. If " "[code]0[/code], there is no limit.\n" @@ -60827,6 +66625,14 @@ msgstr "" "secret_character])。" msgid "" +"The character to use to mask secret input. Only a single character can be " +"used as the secret character. If it is longer than one character, only the " +"first one will be used. If it is empty, a space will be used instead." +msgstr "" +"用于掩盖秘密输入的字符。只能用单个字符作为秘密字符。如果长度超过一个字符,则仅" +"使用第一个字符。如果为空,则使用空格代替。" + +msgid "" "If [code]true[/code], the [LineEdit] will select the whole text when it gains " "focus." msgstr "如果为 [code]true[/code],则在获得焦点时会全选文本。" @@ -61125,6 +66931,9 @@ msgstr "LinkButton 永远不会在其文本底部显示下划线。" msgid "Default text [Color] of the [LinkButton]." msgstr "[LinkButton] 默认的字体颜色 [Color]。" +msgid "Text [Color] used when the [LinkButton] is disabled." +msgstr "该 [LinkButton] 处于禁用状态时,使用的文本 [Color]。" + msgid "" "Text [Color] used when the [LinkButton] is focused. Only replaces the normal " "text color of the button. Disabled, hovered, and pressed states take " @@ -61136,6 +66945,9 @@ msgstr "" msgid "Text [Color] used when the [LinkButton] is being hovered." msgstr "当 [LinkButton] 被悬停时使用的文本颜色 [Color]。" +msgid "Text [Color] used when the [LinkButton] is being hovered and pressed." +msgstr "该 [LinkButton] 处于悬停并按下状态时,使用的文本 [Color]。" + msgid "The tint of text outline of the [LinkButton]." msgstr "[LinkButton] 的文本轮廓的色调。" @@ -61151,6 +66963,23 @@ msgstr "该 [LinkButton] 文本的字体 [Font]。" msgid "Font size of the [LinkButton]'s text." msgstr "该 [LinkButton] 文本的字体大小。" +msgid "" +"[StyleBox] used when the [LinkButton] is focused. The [theme_item focus] " +"[StyleBox] is displayed [i]over[/i] the base [StyleBox], so a partially " +"transparent [StyleBox] should be used to ensure the base [StyleBox] remains " +"visible. A [StyleBox] that represents an outline or an underline works well " +"for this purpose. To disable the focus visual effect, assign a " +"[StyleBoxEmpty] resource. Note that disabling the focus visual effect will " +"harm keyboard/controller navigation usability, so this is not recommended for " +"accessibility reasons." +msgstr "" +"该 [LinkButton] 处于聚焦状态时使用的 [StyleBox]。[theme_item focus] " +"[StyleBox] 显示在基础 [StyleBox] [i]之上[/i],所以应该使用部分透明的 " +"[StyleBox],确保基础 [StyleBox] 仍然可见。代表轮廓或下划线的 [StyleBox] 可以很" +"好地实现这个目的。要禁用聚焦的视觉效果,请指定 [StyleBoxEmpty] 资源。请注意," +"禁用聚焦的视觉效果会影响使用键盘/手柄进行导航的可用性,所以出于可访问性的原" +"因,不建议这样做。" + msgid "Abstract base class for the game's main loop." msgstr "游戏主循环的抽象基类。" @@ -61442,6 +67271,26 @@ msgstr "" "[/csharp]\n" "[/codeblocks]" +msgid "" +"Offsets towards the inside direct children of the container by this amount of " +"pixels from the bottom." +msgstr "从底部向容器的内部直接子项偏移一定量的像素。" + +msgid "" +"Offsets towards the inside direct children of the container by this amount of " +"pixels from the left." +msgstr "从左侧向容器的内部直接子项偏移一定量的像素。" + +msgid "" +"Offsets towards the inside direct children of the container by this amount of " +"pixels from the right." +msgstr "从右侧向容器的内部直接子项偏移一定量的像素。" + +msgid "" +"Offsets towards the inside direct children of the container by this amount of " +"pixels from the top." +msgstr "从顶部向容器的内部直接子项偏移一定量的像素。" + msgid "Generic 2D position hint for editing." msgstr "通用 2D 位置提示,用于编辑。" @@ -61516,9 +67365,101 @@ msgstr "" "full_objects] 为 [code]true[/code],则允许将对象进行编码(有可能包括代码)。\n" "内部实现时,使用的编码机制与 [method @GlobalScope.var_to_bytes] 方法相同。" +msgid "" +"Virtual base class for applying visual properties to an object, such as color " +"and roughness." +msgstr "用于将如颜色、粗糙度等视觉属性应用于对象的虚拟基类。" + +msgid "" +"[Material] is a base resource used for coloring and shading geometry. All " +"materials inherit from it and almost all [VisualInstance3D] derived nodes " +"carry a [Material]. A few flags and parameters are shared between all " +"material types and are configured here.\n" +"Importantly, you can inherit from [Material] to create your own custom " +"material type in script or in GDExtension." +msgstr "" +"[Material] 即材质,是一种基础资源,能够为几何体着色。所有的材质都继承自它,几" +"乎所有从 [VisualInstance3D] 派生的节点都带有 [Material]。有一些标志和参数是在" +"所有材质类型之间共享的,可以在这里进行配置。\n" +"重要的是,你可以继承 [Material] 以在脚本或 GDExtension 中创建你自己的自定义材" +"质类型。" + +msgid "" +"Only exposed for the purpose of overriding. You cannot call this function " +"directly. Used internally to determine if [member next_pass] should be shown " +"in the editor or not." +msgstr "" +"仅出于覆盖目的而暴露。你不能直接调用该函数。在内部用于确定 [member next_pass] " +"是否应显示在编辑器中。" + +msgid "" +"Only exposed for the purpose of overriding. You cannot call this function " +"directly. Used internally to determine if [member render_priority] should be " +"shown in the editor or not." +msgstr "" +"仅出于覆盖目的而暴露。你不能直接调用该函数。在内部用于确定 [member " +"render_priority] 是否应显示在编辑器中。" + +msgid "" +"Only exposed for the purpose of overriding. You cannot call this function " +"directly. Used internally by various editor tools." +msgstr "仅出于覆盖目的而暴露。你不能直接调用该函数。由各种编辑器工具内部使用。" + +msgid "" +"Only exposed for the purpose of overriding. You cannot call this function " +"directly. Used internally by various editor tools. Used to access the RID of " +"the [Material]'s [Shader]." +msgstr "" +"仅出于覆盖目的而暴露。你不能直接调用该函数。由各种编辑器工具内部使用。用于访" +"问 [Material] 的 [Shader] 的 RID。" + msgid "Creates a placeholder version of this resource ([PlaceholderMaterial])." msgstr "创建该资源的占位符版本([PlaceholderMaterial])。" +msgid "" +"Only available when running in the editor. Opens a popup that visualizes the " +"generated shader code, including all variants and internal shader code." +msgstr "" +"仅在编辑器中运行时可用。打开一个弹出窗口,其中可视化生成的着色器代码,包括所有" +"变体和内部着色器代码。" + +msgid "" +"Sets the [Material] to be used for the next pass. This renders the object " +"again using a different material.\n" +"[b]Note:[/b] [member next_pass] materials are not necessarily drawn " +"immediately after the source [Material]. Draw order is determined by material " +"properties, [member render_priority], and distance to camera.\n" +"[b]Note:[/b] This only applies to [StandardMaterial3D]s and [ShaderMaterial]s " +"with type \"Spatial\"." +msgstr "" +"设置下一阶段使用的 [Material]。这将使用不同的材质再次渲染对象。\n" +"[b]注意:[/b][member next_pass] 材质不一定是紧接在源 [Material] 之后绘制的。绘" +"制顺序由材质属性、[member render_priority] 和到相机的距离决定。\n" +"[b]注意:[/b]仅适用于 [StandardMaterial3D] 和“Spatial”类型的 " +"[ShaderMaterial]。" + +msgid "" +"Sets the render priority for objects in 3D scenes. Higher priority objects " +"will be sorted in front of lower priority objects. In other words, all " +"objects with [member render_priority] [code]1[/code] will render before all " +"objects with [member render_priority] [code]0[/code]).\n" +"[b]Note:[/b] This only applies to [StandardMaterial3D]s and [ShaderMaterial]s " +"with type \"Spatial\".\n" +"[b]Note:[/b] This will not impact how transparent objects are sorted relative " +"to opaque objects or how dynamic meshes will be sorted relative to other " +"opaque meshes. This is because all transparent objects are drawn after all " +"opaque objects and all dynamic opaque meshes are drawn before other opaque " +"meshes." +msgstr "" +"设置 3D 场景中物体的渲染优先级。优先级高的物体将被排序在优先级低的物体前面。换" +"句话说,所有具有 [member render_priority] [code]1[/code] 的对象,将在所有具有 " +"[member render_priority] [code]0[/code] 的对象之前渲染。\n" +"[b]注意:[/b]仅适用于 [StandardMaterial3D] 和“Spatial”类型的 " +"[ShaderMaterial]。\n" +"[b]注意:[/b]这不会影响透明对象相对于不透明对象的排序方式,或动态网格体相对于" +"其他不透明网格体的排序方式。这是因为所有透明对象都是在所有不透明对象之后绘制" +"的,并且所有动态不透明网格都是在其他不透明网格之前绘制的。" + msgid "Maximum value for the [member render_priority] parameter." msgstr "[member render_priority] 参数的最大值。" @@ -61703,6 +67644,15 @@ msgstr "" "调整该 [MenuButton] 的弹出位置和大小,然后显示该 [PopupMenu]。请优先使用此方" "法,而不是使用 [code]get_popup().popup()[/code]。" +msgid "" +"If [code]true[/code], when the cursor hovers above another [MenuButton] " +"within the same parent which also has [member switch_on_hover] enabled, it " +"will close the current [MenuButton] and open the other one." +msgstr "" +"如果为 [code]true[/code],当光标悬停在同一父级中也启用了 [member " +"switch_on_hover] 的另一个 [MenuButton] 上方时,它将关闭当前的 [MenuButton] 并" +"打开另一个。" + msgid "Emitted when the [PopupMenu] of this MenuButton is about to show." msgstr "该 MenuButton 的 [PopupMenu] 即将显示时发出。" @@ -61849,9 +67799,44 @@ msgstr "" "返回 [Mesh] 中存放的表面的数量。相当于 [method MeshInstance3D." "get_surface_override_material_count]。" +msgid "" +"Returns the arrays for the vertices, normals, UVs, etc. that make up the " +"requested surface (see [method ArrayMesh.add_surface_from_arrays])." +msgstr "" +"返回构成请求表面的顶点、法线、UV 等数组。(见 [method ArrayMesh." +"add_surface_from_arrays])。" + msgid "Returns the blend shape arrays for the requested surface." msgstr "返回请求表面的混合形状数组。" +msgid "" +"Returns a [Material] in a given surface. Surface is rendered using this " +"material.\n" +"[b]Note:[/b] This returns the material within the [Mesh] resource, not the " +"[Material] associated to the [MeshInstance3D]'s Surface Material Override " +"properties. To get the [Material] associated to the [MeshInstance3D]'s " +"Surface Material Override properties, use [method MeshInstance3D." +"get_surface_override_material] instead." +msgstr "" +"返回给定表面中的 [Material]。表面是使用该材质渲染的。\n" +"[b]注意:[/b]这将返回 [Mesh] 资源中的材质,而不是与 [MeshInstance3D] 的表面材" +"质覆盖属性关联的 [Material]。要获取与 [MeshInstance3D] 的表面材质覆盖属性关联" +"的 [Material],请改用 [method MeshInstance3D.get_surface_override_material]。" + +msgid "" +"Sets a [Material] for a given surface. Surface will be rendered using this " +"material.\n" +"[b]Note:[/b] This assigns the material within the [Mesh] resource, not the " +"[Material] associated to the [MeshInstance3D]'s Surface Material Override " +"properties. To set the [Material] associated to the [MeshInstance3D]'s " +"Surface Material Override properties, use [method MeshInstance3D." +"set_surface_override_material] instead." +msgstr "" +"为给定表面设置 [Material]。表面将使用该材质进行渲染。\n" +"[b]注意:[/b]这会分配 [Mesh] 资源中的材质,而不是与 [MeshInstance3D] 的表面材" +"质覆盖属性关联的 [Material]。要设置与 [MeshInstance3D] 的表面材质覆盖属性关联" +"的 [Material],请改用 [method MeshInstance3D.set_surface_override_material]。" + msgid "Sets a hint to be used for lightmap resolution." msgstr "设置用于光照贴图分辨率的提示。" @@ -61964,6 +67949,26 @@ msgstr "" "code] 到 [code]1.0[/code](闭区间)。每个顶点包含 4 个还是 8 个数字取决于是否" "存在 [constant ARRAY_FLAG_USE_8_BONE_WEIGHTS] 标志。" +msgid "" +"[PackedInt32Array] of integers used as indices referencing vertices, colors, " +"normals, tangents, and textures. All of those arrays must have the same " +"number of elements as the vertex array. No index can be beyond the vertex " +"array size. When this index array is present, it puts the function into " +"\"index mode,\" where the index selects the [i]i[/i]'th vertex, normal, " +"tangent, color, UV, etc. This means if you want to have different normals or " +"colors along an edge, you have to duplicate the vertices.\n" +"For triangles, the index array is interpreted as triples, referring to the " +"vertices of each triangle. For lines, the index array is in pairs indicating " +"the start and end of each line." +msgstr "" +"整数的 [PackedInt32Array],用作引用顶点、颜色、法线、切线、和纹理的索引。所有" +"这些数组必须具有与顶点数组相同数量的元素。任何索引都不能超过顶点数组的大小。当" +"该索引数组存在时,它会将函数置于“索引模式”,其中索引选择第 [i]i[/i] 个顶点、法" +"线、切线、颜色、UV 等。这意味着,如果想要沿着一条边有不同的法线或颜色,则必须" +"复制这些顶点。\n" +"对于三角形,索引数组被解释为三元组,指代每个三角形的顶点。对于线条,索引数组成" +"对表示每条线的开始和结束。" + msgid "Represents the size of the [enum ArrayType] enum." msgstr "代表 [enum ArrayType] 枚举的大小。" @@ -62119,6 +68124,24 @@ msgstr "" msgid "Flag used to mark that the mesh intentionally contains no vertex array." msgstr "用于标记网格有意不包含顶点数组的标志。" +msgid "" +"Flag used to mark that a mesh is using compressed attributes (vertices, " +"normals, tangents, UVs). When this form of compression is enabled, vertex " +"positions will be packed into an RGBA16UNORM attribute and scaled in the " +"vertex shader. The normal and tangent will be packed into an RG16UNORM " +"representing an axis, and a 16-bit float stored in the A-channel of the " +"vertex. UVs will use 16-bit normalized floats instead of full 32-bit signed " +"floats. When using this compression mode you must use either vertices, " +"normals, and tangents or only vertices. You cannot use normals without " +"tangents. Importers will automatically enable this compression if they can." +msgstr "" +"用于标记网格正在使用的压缩的属性(顶点、法线、切线、UV)的标志。启用这种形式的" +"压缩后,顶点位置将被打包到 RGBA16UNORM 属性中,并在顶点着色器中进行缩放。法线" +"和切线将被打包到表示一个轴的 RG16UNORM 中,并在顶点的 A 通道中存储一个 16 位浮" +"点数。UV 将使用 16 位标准化浮点数而不是完整的 32 位有符号浮点数。使用该压缩模" +"式时,必须使用顶点、法线、和切线或仅使用顶点。你无法使用没有切线的法线。如果可" +"以的话,导入器将自动启用这种压缩。" + msgid "Blend shapes are normalized." msgstr "混合形状是被归一化了的。" @@ -62355,6 +68378,44 @@ msgid "Calculates and returns the face normal of the given face." msgstr "计算并返回给定面的面法线。" msgid "" +"Returns the specified vertex index of the given face.\n" +"Vertex argument must be either 0, 1, or 2 because faces contain three " +"vertices.\n" +"[b]Example:[/b]\n" +"[codeblocks]\n" +"[gdscript]\n" +"var index = mesh_data_tool.get_face_vertex(0, 1) # Gets the index of the " +"second vertex of the first face.\n" +"var position = mesh_data_tool.get_vertex(index)\n" +"var normal = mesh_data_tool.get_vertex_normal(index)\n" +"[/gdscript]\n" +"[csharp]\n" +"int index = meshDataTool.GetFaceVertex(0, 1); // Gets the index of the second " +"vertex of the first face.\n" +"Vector3 position = meshDataTool.GetVertex(index);\n" +"Vector3 normal = meshDataTool.GetVertexNormal(index);\n" +"[/csharp]\n" +"[/codeblocks]" +msgstr "" +"返回给定面的指定顶点索引。\n" +"顶点参数必须为 0、1 或 2,因为面包含三个顶点。\n" +"[b]示例:[/b]\n" +"[codeblocks]\n" +"[gdscript]\n" +"var index = mesh_data_tool.get_face_vertex(0, 1) # 获取第一个面的第二个顶点的" +"索引。\n" +"var position = mesh_data_tool.get_vertex(index)\n" +"var normal = mesh_data_tool.get_vertex_normal(index)\n" +"[/gdscript]\n" +"[csharp]\n" +"int index = meshDataTool.GetFaceVertex(0, 1); // 获取第一个面的第二个顶点的索" +"引。\n" +"Vector3 position = meshDataTool.GetVertex(index);\n" +"Vector3 normal = meshDataTool.GetVertexNormal(index);\n" +"[/csharp]\n" +"[/codeblocks]" + +msgid "" "Returns the [Mesh]'s format. Format is an integer made up of [Mesh] format " "flags combined together. For example, a mesh containing both vertices and " "normals would return a format of [code]3[/code] because [constant Mesh." @@ -62371,6 +68432,9 @@ msgstr "" msgid "Returns the material assigned to the [Mesh]." msgstr "返回分配给该 [Mesh] 的材质。" +msgid "Returns the position of the given vertex." +msgstr "返回给定顶点的位置。" + msgid "Returns the bones of the given vertex." msgstr "返回给定顶点的骨骼。" @@ -62569,6 +68633,28 @@ msgstr "" "个错误。" msgid "" +"Returns the override [Material] for the specified [param surface] of the " +"[Mesh] resource. See also [method get_surface_override_material_count].\n" +"[b]Note:[/b] This returns the [Material] associated to the [MeshInstance3D]'s " +"Surface Material Override properties, not the material within the [Mesh] " +"resource. To get the material within the [Mesh] resource, use [method Mesh." +"surface_get_material] instead." +msgstr "" +"返回 [Mesh] 资源的指定 [param surface] 的覆盖 [Material]。另见 [method " +"get_surface_override_material_count]。\n" +"[b]注意:[/b]这将返回与 [MeshInstance3D] 的表面材质覆盖属性关联的 [Material]," +"而不是 [Mesh] 资源内的材质。要获取 [Mesh] 资源中的材质,请改用 [method Mesh." +"surface_get_material]。" + +msgid "" +"Returns the number of surface override materials. This is equivalent to " +"[method Mesh.get_surface_count]. See also [method " +"get_surface_override_material]." +msgstr "" +"返回表面覆盖材质的数量。相当于 [method Mesh.get_surface_count]。另见 [method " +"get_surface_override_material]。" + +msgid "" "Sets the value of the blend shape at [param blend_shape_idx] to [param " "value]. Produces an error if [member mesh] is [code]null[/code] or doesn't " "have a blend shape at that index." @@ -62576,6 +68662,21 @@ msgstr "" "将 [param blend_shape_idx] 处的混合形状的值设置为 [param value]。如果 [member " "mesh] 为 [code]null[/code],或在该索引处没有混合形状,则会产生一个错误。" +msgid "" +"Sets the override [param material] for the specified [param surface] of the " +"[Mesh] resource. This material is associated with this [MeshInstance3D] " +"rather than with [member mesh].\n" +"[b]Note:[/b] This assigns the [Material] associated to the [MeshInstance3D]'s " +"Surface Material Override properties, not the material within the [Mesh] " +"resource. To set the material within the [Mesh] resource, use [method Mesh." +"surface_get_material] instead." +msgstr "" +"设置 [Mesh] 资源的指定 [param surface] 的覆盖 [param material]。该材质与该 " +"[MeshInstance3D] 关联,而不是与 [member mesh] 关联。\n" +"[b]注意:[/b]这将分配与 [MeshInstance3D] 的表面材质覆盖属性关联的 [Material]," +"而不是 [Mesh] 资源内的材质。要在 [Mesh] 资源中设置材质,请改用 [method Mesh." +"surface_get_material]。" + msgid "The [Mesh] resource for the instance." msgstr "该实例的 [Mesh] 资源。" @@ -62716,6 +68817,22 @@ msgid "" msgstr "对抽象值进行插值,并将其提供给一个持续调用的方法。" msgid "" +"[MethodTweener] is similar to a combination of [CallbackTweener] and " +"[PropertyTweener]. It calls a method providing an interpolated value as a " +"parameter. See [method Tween.tween_method] for more usage information.\n" +"The tweener will finish automatically if the callback's target object is " +"freed.\n" +"[b]Note:[/b] [method Tween.tween_method] is the only correct way to create " +"[MethodTweener]. Any [MethodTweener] created manually will not function " +"correctly." +msgstr "" +"[MethodTweener] 类似于 [CallbackTweener] 和 [PropertyTweener] 的组合,会将插值" +"后的值作为调用方法时的参数。更多用法信息请参阅 [method Tween.tween_method]。\n" +"如果回调的目标对象被释放,该补间将自动完成。\n" +"[b]注意:[/b]创建 [MethodTweener] 的唯一正确方法是 [method Tween." +"tween_method]。任何手动创建的 [MethodTweener] 都无法正常工作。" + +msgid "" "Sets the time in seconds after which the [MethodTweener] will start " "interpolating. By default there's no delay." msgstr "设置该 [MethodTweener] 开始插值的时间,单位为秒。默认无延迟。" @@ -62837,6 +68954,79 @@ msgid "Abstract class for non-real-time video recording encoders." msgstr "非实时视频录制编码器的抽象类。" msgid "" +"Godot can record videos with non-real-time simulation. Like the [code]--fixed-" +"fps[/code] [url=$DOCS_URL/tutorials/editor/command_line_tutorial.html]command " +"line argument[/url], this forces the reported [code]delta[/code] in [method " +"Node._process] functions to be identical across frames, regardless of how " +"long it actually took to render the frame. This can be used to record high-" +"quality videos with perfect frame pacing regardless of your hardware's " +"capabilities.\n" +"Godot has 2 built-in [MovieWriter]s:\n" +"- AVI container with MJPEG for video and uncompressed audio ([code].avi[/" +"code] file extension). Lossy compression, medium file sizes, fast encoding. " +"The lossy compression quality can be adjusted by changing [member " +"ProjectSettings.editor/movie_writer/mjpeg_quality]. The resulting file can be " +"viewed in most video players, but it must be converted to another format for " +"viewing on the web or by Godot with [VideoStreamPlayer]. MJPEG does not " +"support transparency. AVI output is currently limited to a file of 4 GB in " +"size at most.\n" +"- PNG image sequence for video and WAV for audio ([code].png[/code] file " +"extension). Lossless compression, large file sizes, slow encoding. Designed " +"to be encoded to a video file with another tool such as [url=https://ffmpeg." +"org/]FFmpeg[/url] after recording. Transparency is currently not supported, " +"even if the root viewport is set to be transparent.\n" +"If you need to encode to a different format or pipe a stream through third-" +"party software, you can extend the [MovieWriter] class to create your own " +"movie writers. This should typically be done using GDExtension for " +"performance reasons.\n" +"[b]Editor usage:[/b] A default movie file path can be specified in [member " +"ProjectSettings.editor/movie_writer/movie_file]. Alternatively, for running " +"single scenes, a [code]movie_file[/code] metadata can be added to the root " +"node, specifying the path to a movie file that will be used when recording " +"that scene. Once a path is set, click the video reel icon in the top-right " +"corner of the editor to enable Movie Maker mode, then run any scene as usual. " +"The engine will start recording as soon as the splash screen is finished, and " +"it will only stop recording when the engine quits. Click the video reel icon " +"again to disable Movie Maker mode. Note that toggling Movie Maker mode does " +"not affect project instances that are already running.\n" +"[b]Note:[/b] MovieWriter is available for use in both the editor and exported " +"projects, but it is [i]not[/i] designed for use by end users to record videos " +"while playing. Players wishing to record gameplay videos should install tools " +"such as [url=https://obsproject.com/]OBS Studio[/url] or [url=https://www." +"maartenbaert.be/simplescreenrecorder/]SimpleScreenRecorder[/url] instead." +msgstr "" +"Godot 能够使用非实时模拟技术录制视频。与 [code]--fixed-fps[/code] " +"[url=$DOCS_URL/tutorials/editor/command_line_tutorial.html]命令行参数[/url]类" +"似,会强制让 [method Node._process] 等函数每一帧都收到相同的 [code]delta[/" +"code],无论实际渲染花费了多长的时间。这个技术可用于录制高画质的视频,无论你的" +"硬件性能如何,帧率始终都是恒定的。\n" +"Godot 内置的 [MovieWriter] 有两个:\n" +"- 使用 MJPEG 视频和未压缩音频的 AVI 容器(文件扩展名为 [code].avi[/code])。有" +"损压缩、文件大小中等、编码速度较快。有损压缩质量可以通过修改 [member " +"ProjectSettings.editor/movie_writer/mjpeg_quality] 来调整。生成的文件可以使用" +"大多数视频播放器查看,但如果要在 Web 上查看或者用 Godot 的 " +"[VideoStreamPlayer] 查看,则必须先进行格式的转换。MJPEG 不支持透明度。AVI 输出" +"的文件目前最多为 4 GB 大小。\n" +"- 视频使用 PNG 图像序列、音频使用 WAV(文件扩展名为 [code].png[/code])。无损" +"压缩、文件大小较大、编码速度较慢。旨在录制后使用 [url=https://ffmpeg." +"org/]FFmpeg[/url] 等其他工具编码为视频文件。目前不支持透明度,即便将根视口设为" +"透明。\n" +"如果你需要编码为其他格式,或者将流导入到第三方软件中,你可以扩展 " +"[MovieWriter] 类,创建自己的影片写入器。出于性能考虑,一般应该使用 " +"GDExtension 实现。\n" +"[b]编辑器使用:[/b]默认影片文件路径可以在 [member ProjectSettings.editor/" +"movie_writer/movie_file] 指定。或者在运行单个场景时,也可以在根节点上添加元数" +"据 [code]movie_file[/code],可以指定录制该场景时所使用的影片文件路径。设置路径" +"后,请点击编辑器右上角的电影胶卷图标,启动 Movie Maker 模式,然后和平常一样运" +"行场景即可。引擎会在启动画面结束后开始录制,只会在引擎退出时停止录制。再次点击" +"电影胶卷图标可以禁用 Movie Maker 模式。请注意,Movie Maker 模式的开关不会影响" +"正在运行的项目实例。\n" +"[b]注意:[/b]MovieWriter 既可以在编辑器中使用,也可以在导出的项目中使用,但这" +"个功能[i]不应[/i]用来让最终用户录制游戏视频。希望录制游戏视频的玩家应该安装 " +"[url=https://obsproject.com/]OBS Studio[/url] 或 [url=https://www." +"maartenbaert.be/simplescreenrecorder/]SimpleScreenRecorder[/url] 等工具。" + +msgid "" "Called when the audio sample rate used for recording the audio is requested " "by the engine. The value returned must be specified in Hz. Defaults to 48000 " "Hz if [method _get_audio_mix_rate] is not overridden." @@ -63348,6 +69538,169 @@ msgstr "" msgid "Base class used for extending the [MultiplayerAPI]." msgstr "用于扩展 [MultiplayerAPI] 的基类。" +msgid "" +"This class can be used to augment or replace the default [MultiplayerAPI] " +"implementation via script or extensions.\n" +"The following example augment the default implementation ([SceneMultiplayer]) " +"by logging every RPC being made, and every object being configured for " +"replication.\n" +"[codeblocks]\n" +"[gdscript]\n" +"extends MultiplayerAPIExtension\n" +"class_name LogMultiplayer\n" +"\n" +"# We want to augment the default SceneMultiplayer.\n" +"var base_multiplayer = SceneMultiplayer.new()\n" +"\n" +"func _init():\n" +" # Just passthrough base signals (copied to var to avoid cyclic " +"reference)\n" +" var cts = connected_to_server\n" +" var cf = connection_failed\n" +" var pc = peer_connected\n" +" var pd = peer_disconnected\n" +" base_multiplayer.connected_to_server.connect(func(): cts.emit())\n" +" base_multiplayer.connection_failed.connect(func(): cf.emit())\n" +" base_multiplayer.peer_connected.connect(func(id): pc.emit(id))\n" +" base_multiplayer.peer_disconnected.connect(func(id): pd.emit(id))\n" +"\n" +"func _poll():\n" +" return base_multiplayer.poll()\n" +"\n" +"# Log RPC being made and forward it to the default multiplayer.\n" +"func _rpc(peer: int, object: Object, method: StringName, args: Array) -> " +"Error:\n" +" print(\"Got RPC for %d: %s::%s(%s)\" % [peer, object, method, args])\n" +" return base_multiplayer.rpc(peer, object, method, args)\n" +"\n" +"# Log configuration add. E.g. root path (nullptr, NodePath), replication " +"(Node, Spawner|Synchronizer), custom.\n" +"func _object_configuration_add(object, config: Variant) -> Error:\n" +" if config is MultiplayerSynchronizer:\n" +" print(\"Adding synchronization configuration for %s. Synchronizer: " +"%s\" % [object, config])\n" +" elif config is MultiplayerSpawner:\n" +" print(\"Adding node %s to the spawn list. Spawner: %s\" % [object, " +"config])\n" +" return base_multiplayer.object_configuration_add(object, config)\n" +"\n" +"# Log configuration remove. E.g. root path (nullptr, NodePath), replication " +"(Node, Spawner|Synchronizer), custom.\n" +"func _object_configuration_remove(object, config: Variant) -> Error:\n" +" if config is MultiplayerSynchronizer:\n" +" print(\"Removing synchronization configuration for %s. Synchronizer: " +"%s\" % [object, config])\n" +" elif config is MultiplayerSpawner:\n" +" print(\"Removing node %s from the spawn list. Spawner: %s\" % " +"[object, config])\n" +" return base_multiplayer.object_configuration_remove(object, config)\n" +"\n" +"# These can be optional, but in our case we want to augment SceneMultiplayer, " +"so forward everything.\n" +"func _set_multiplayer_peer(p_peer: MultiplayerPeer):\n" +" base_multiplayer.multiplayer_peer = p_peer\n" +"\n" +"func _get_multiplayer_peer() -> MultiplayerPeer:\n" +" return base_multiplayer.multiplayer_peer\n" +"\n" +"func _get_unique_id() -> int:\n" +" return base_multiplayer.get_unique_id()\n" +"\n" +"func _get_peer_ids() -> PackedInt32Array:\n" +" return base_multiplayer.get_peers()\n" +"[/gdscript]\n" +"[/codeblocks]\n" +"Then in your main scene or in an autoload call [method SceneTree." +"set_multiplayer] to start using your custom [MultiplayerAPI]:\n" +"[codeblocks]\n" +"[gdscript]\n" +"# autoload.gd\n" +"func _enter_tree():\n" +" # Sets our custom multiplayer as the main one in SceneTree.\n" +"get_tree().set_multiplayer(LogMultiplayer.new())\n" +"[/gdscript]\n" +"[/codeblocks]\n" +"Native extensions can alternatively use the [method MultiplayerAPI." +"set_default_interface] method during initialization to configure themselves " +"as the default implementation." +msgstr "" +"该类可用于通过脚本或扩展来增强或替换默认的 [MultiplayerAPI] 实现。\n" +"下面的例子通过记录每一个正在进行的 RPC 和为复制而配置的每一个对象,增强了默认" +"的实现([SceneMultiplayer])。\n" +"[codeblocks]\n" +"[gdscript]\n" +"extends MultiplayerAPIExtension\n" +"class_name LogMultiplayer\n" +"\n" +"# 我们想增强默认的 SceneMultiplayer。\n" +"var base_multiplayer = SceneMultiplayer.new()\n" +"\n" +"func _init():\n" +" # 仅传递基本信号(复制到 var 以避免循环引用)\n" +" var cts = connected_to_server\n" +" var cf = connection_failed\n" +" var pc = peer_connected\n" +" var pd = peer_disconnected\n" +" base_multiplayer.connected_to_server.connect(func(): cts.emit())\n" +" base_multiplayer.connection_failed.connect(func(): cf.emit())\n" +" base_multiplayer.peer_connected.connect(func(id): pc.emit(id))\n" +" base_multiplayer.peer_disconnected.connect(func(id): pd.emit(id))\n" +"\n" +"func _poll():\n" +" return base_multiplayer.poll()\n" +"\n" +"# 记录正在进行的 RPC 并将其转发到默认的多人游戏。\n" +"func _rpc(peer: int, object: Object, method: StringName, args: Array) -> " +"Error:\n" +" print(\"获取用于 %d 的 RPC:%s::%s(%s)\" % [peer, object, method, args])\n" +" return base_multiplayer.rpc(peer, object, method, args)\n" +"\n" +"# 记录配置添加。例如,根路径(nullptr、NodePath),复制(Node、Spawner|" +"Synchronizer),自定义。\n" +"func _object_configuration_add(object, config: Variant) -> Error:\n" +" if config is MultiplayerSynchronizer:\n" +" print(\"添加用于 %s 的同步配置。同步器:%s\" % [object, config])\n" +" elif config is MultiplayerSpawner:\n" +" print(\"将节点 %s 添加到出生列表。出生器:%s\" % [object, config])\n" +" return base_multiplayer.object_configuration_add(object, config)\n" +"\n" +"# 记录配置移除。例如,根路径(nullptr、NodePath),复制(Node、Spawner|" +"Synchronizer),自定义。\n" +"func _object_configuration_remove(object, config: Variant) -> Error:\n" +" if config is MultiplayerSynchronizer:\n" +" print(\"移除用于 %s 的同步配置。同步器:%s\" % [object, config])\n" +" elif config is MultiplayerSpawner:\n" +" print(\"将节点 %s 从出生列表移除。出生器:%s\" % [object, config])\n" +" return base_multiplayer.object_configuration_remove(object, config)\n" +"\n" +"# 这些可以是可选的,但在我们的例子中,我们想要增强 SceneMultiplayer,所以转发" +"所有内容。\n" +"func _set_multiplayer_peer(p_peer: MultiplayerPeer):\n" +" base_multiplayer.multiplayer_peer = p_peer\n" +"\n" +"func _get_multiplayer_peer() -> MultiplayerPeer:\n" +" return base_multiplayer.multiplayer_peer\n" +"\n" +"func _get_unique_id() -> int:\n" +" return base_multiplayer.get_unique_id()\n" +"\n" +"func _get_peer_ids() -> PackedInt32Array:\n" +" return base_multiplayer.get_peers()\n" +"[/gdscript]\n" +"[/codeblocks]\n" +"然后在你的主场景或在自动加载中调用 [method SceneTree.set_multiplayer],以开始" +"使用你的自定义 [MultiplayerAPI]:\n" +"[codeblocks]\n" +"[gdscript]\n" +"# autoload.gd\n" +"func _enter_tree():\n" +" # 将我们的自定义多人游戏设置为 SceneTree 中的主要的多人游戏。\n" +"get_tree().set_multiplayer(LogMultiplayer.new())\n" +"[/gdscript]\n" +"[/codeblocks]\n" +"原生扩展也可以在初始化期间,使用 [method MultiplayerAPI." +"set_default_interface] 方法将自己配置为默认实现。" + msgid "Called when the [member MultiplayerAPI.multiplayer_peer] is retrieved." msgstr "在检索到 [member MultiplayerAPI.multiplayer_peer] 时调用。" @@ -64110,6 +70463,14 @@ msgid "" msgstr "返回该代理目前正在使用的路径所对应的路径查询结果。" msgid "" +"Returns the reachable final position of the current navigation path in global " +"coordinates. This position can change if the agent needs to update the " +"navigation path which makes the agent emit the [signal path_changed] signal." +msgstr "" +"返回当前导航路径上可到达的最终位置的全局坐标。如果该代理需要更新导航路径,从而" +"使该代理发出 [signal path_changed] 信号,则该位置可能会发生变化。" + +msgid "" "Returns whether or not the specified layer of the [member navigation_layers] " "bitmask is enabled, given a [param layer_number] between 1 and 32." msgstr "" @@ -64146,6 +70507,24 @@ msgid "Returns the [RID] of this agent on the [NavigationServer2D]." msgstr "返回这个代理在 [NavigationServer2D] 上的 [RID]。" msgid "" +"Returns [code]true[/code] if the end of the currently loaded navigation path " +"has been reached.\n" +"[b]Note:[/b] While true prefer to stop calling update functions like [method " +"get_next_path_position]. This avoids jittering the standing agent due to " +"calling repeated path updates." +msgstr "" +"如果已到达当前加载的导航路径的末尾,则返回 [code]true[/code]。\n" +"[b]注意:[/b]虽然 true 更喜欢停止调用更新函数,例如 [method " +"get_next_path_position]。这避免了由于调用重复的路径更新而使常设代理抖动。" + +msgid "" +"Returns [code]true[/code] if [method get_final_position] is within [member " +"target_desired_distance] of the [member target_position]." +msgstr "" +"如果 [method get_final_position] 位于 [member target_position] 的 [member " +"target_desired_distance] 范围内,则返回 [code]true[/code]。" + +msgid "" "Returns true if [member target_position] is reached. It may not always be " "possible to reach the target position. It should always be possible to reach " "the final position though. See [method get_final_position]." @@ -64343,6 +70722,13 @@ msgstr "" "入重新寻路的死循环,因为它在每次物理帧更新后都会超过或者到达不了最终目标点。" msgid "" +"If set, a new navigation path from the current agent position to the [member " +"target_position] is requested from the NavigationServer." +msgstr "" +"设置后,会向 NavigationServer 请求一条新的从当前代理位置到 [member " +"target_position] 的导航路径。" + +msgid "" "The minimal amount of time for which this agent's velocities, that are " "computed with the collision avoidance algorithm, are safe with respect to " "other agents. The larger the number, the sooner the agent will respond to " @@ -64406,6 +70792,34 @@ msgstr "" "个 [NavigationLink2D],它将包含代理正在退出时的链接点的全局位置。" msgid "" +"Emitted once per loaded path when the agent internal navigation path index " +"reaches the last index of the loaded path array. The agent internal " +"navigation path index can be received with [method " +"get_current_navigation_path_index]." +msgstr "" +"当代理内部导航路径索引到达加载路径数组的最后一个索引时,每个加载路径发出一次。" +"可以使用 [method get_current_navigation_path_index] 接收代理内部导航路径索引。" + +msgid "" +"Emitted when the agent had to update the loaded path:\n" +"- because path was previously empty.\n" +"- because navigation map has changed.\n" +"- because agent pushed further away from the current path segment than the " +"[member path_max_distance]." +msgstr "" +"当该代理必须更新加载的路径时发出:\n" +"- 因为路径以前是空的。\n" +"- 因为导航地图已经改变。\n" +"- 因为代理从当前路径段推得比 [member path_max_distance] 更远。" + +msgid "" +"Emitted once per loaded path when the agent's global position is the first " +"time within [member target_desired_distance] to the [member target_position]." +msgstr "" +"当代理的全局位置第一次在 [member target_desired_distance] 内到达 [member " +"target_position] 时,每个加载路径发出一次。" + +msgid "" "Notifies when the collision avoidance velocity is calculated. Emitted when " "[member velocity] is set. Only emitted when [member avoidance_enabled] is " "true." @@ -64487,6 +70901,16 @@ msgstr "" "或障碍物。3D 避障时只使用半径球体,该设置无效。" msgid "" +"If [code]true[/code], and the agent uses 2D avoidance, it will remember the " +"set y-axis velocity and reapply it after the avoidance step. While 2D " +"avoidance has no y-axis and simulates on a flat plane this setting can help " +"mitigate the most obvious clipping on uneven 3D geometry." +msgstr "" +"如果为 [code]true[/code],并且代理使用 2D 避障,它将记住设置的 y 轴速度并在避" +"障步进后重新应用它。虽然 2D 避障没有 y 轴并在平坦平面上进行模拟,但该设置可以" +"帮助减轻不均匀 3D 几何体上最明显的裁剪。" + +msgid "" "The height offset is subtracted from the y-axis value of any vector path " "position for this NavigationAgent. The NavigationAgent height offset does not " "change or influence the navigation mesh or pathfinding query result. " @@ -64521,6 +70945,35 @@ msgstr "" "与 [member height] 之和则会被忽略。" msgid "" +"Notifies when a navigation link has been reached.\n" +"The details dictionary may contain the following keys depending on the value " +"of [member path_metadata_flags]:\n" +"- [code]position[/code]: The start position of the link that was reached.\n" +"- [code]type[/code]: Always [constant NavigationPathQueryResult3D." +"PATH_SEGMENT_TYPE_LINK].\n" +"- [code]rid[/code]: The [RID] of the link.\n" +"- [code]owner[/code]: The object which manages the link (usually " +"[NavigationLink3D]).\n" +"- [code]link_entry_position[/code]: If [code]owner[/code] is available and " +"the owner is a [NavigationLink3D], it will contain the global position of the " +"link's point the agent is entering.\n" +"- [code]link_exit_position[/code]: If [code]owner[/code] is available and the " +"owner is a [NavigationLink3D], it will contain the global position of the " +"link's point which the agent is exiting." +msgstr "" +"当到达一个导航链接时通知。\n" +"根据 [member path_metadata_flags] 的值,详细信息字典可能包含以下键:\n" +"- [code]position[/code]:到达的链接的起始位置。\n" +"- [code]type[/code]:总是 [constant NavigationPathQueryResult3D." +"PATH_SEGMENT_TYPE_LINK]。\n" +"- [code]rid[/code]:链接的 [RID]。\n" +"- [code]owner[/code]:管理该链接的对象(通常是[NavigationLink3D])。\n" +"- [code]link_entry_position[/code]:如果 [code]owner[/code] 可用且该所有者是一" +"个 [NavigationLink3D],它将包含代理正在进入时的链接点的全局位置。\n" +"- [code]link_exit_position[/code]:如果 [code]owner[/code] 可用且该所有者是一" +"个 [NavigationLink3D],它将包含代理正在退出时的链接点的全局位置。" + +msgid "" "A link between two positions on [NavigationRegion2D]s that agents can be " "routed through." msgstr "" @@ -64551,6 +71004,9 @@ msgid "" "position." msgstr "返回该链接的 [member start_position] 的全局位置。" +msgid "Returns the [RID] of this link on the [NavigationServer2D]." +msgstr "返回 [NavigationServer2D] 上该链接的 [RID]。" + msgid "" "Sets the [member end_position] that is relative to the link from a global " "[param position]." @@ -64640,6 +71096,9 @@ msgstr "" "接可以用来表达沿着导航网格表面行进以外的导航方法,例如滑锁、传送、跳过沟壑等" "等。" +msgid "Returns the [RID] of this link on the [NavigationServer3D]." +msgstr "返回 [NavigationServer3D] 上该链接的 [RID]。" + msgid "" "Whether this link is currently active. If [code]false[/code], [method " "NavigationServer3D.map_get_path] will ignore this link." @@ -64701,6 +71160,9 @@ msgid "" "get_vertices]." msgstr "使用调用 [method get_vertices] 得到的顶点的索引添加一个多边形。" +msgid "Clears the internal arrays for vertices and polygon indices." +msgstr "清除顶点和多边形索引的内部数组。" + msgid "" "Clears the array of polygons, but it doesn't clear the array of vertices." msgstr "清除多边形数组,但不清除顶点数组。" @@ -64807,6 +71269,15 @@ msgid "" msgstr "简化轮廓的边界边缘偏离原始轮廓的最大距离。" msgid "" +"The maximum allowed length for contour edges along the border of the mesh. A " +"value of [code]0.0[/code] disables this feature.\n" +"[b]Note:[/b] While baking, this value will be rounded up to the nearest " +"multiple of [member cell_size]." +msgstr "" +"沿网格边界的轮廓的最大允许长度。值为 [code]0.0[/code] 将禁用该功能。\n" +"[b]注意:[/b]烘焙时,这个值会向上取整到最接近的 [member cell_size] 的倍数。" + +msgid "" "If the baking [AABB] has a volume the navigation mesh baking will be " "restricted to its enclosing area." msgstr "如果烘焙 [AABB] 存在体积,对该导航网格的烘焙会被限制在其内部区域中。" @@ -65079,9 +71550,65 @@ msgid "" "Container for parsed source geometry data used in navigation mesh baking." msgstr "存放解析所得的源几何体数据的容器,用于导航网格的烘焙。" +msgid "Adds the outline points of a shape as obstructed area." +msgstr "添加形状的轮廓点作为遮挡区域。" + +msgid "Adds the outline points of a shape as traversable area." +msgstr "添加形状的轮廓点作为可遍历区域。" + msgid "Clears the internal data." msgstr "清除内部数据。" +msgid "Returns all the obstructed area outlines arrays." +msgstr "返回所有遮挡区域轮廓数组。" + +msgid "Returns all the traversable area outlines arrays." +msgstr "返回所有可遍历区域轮廓数组。" + +msgid "Returns [code]true[/code] when parsed source geometry data exists." +msgstr "当解析的源几何数据存在时,返回 [code]true[/code]。" + +msgid "Sets all the obstructed area outlines arrays." +msgstr "设置所有遮挡区域轮廓数组。" + +msgid "Sets all the traversable area outlines arrays." +msgstr "设置所有可遍历区域轮廓数组。" + +msgid "" +"Adds an array of vertex positions to the geometry data for navigation mesh " +"baking to form triangulated faces. For each face the array must have three " +"vertex positions in clockwise winding order. Since [NavigationMesh] resources " +"have no transform, all vertex positions need to be offset by the node's " +"transform using [param xform]." +msgstr "" +"向用于导航网格烘焙的几何体数据中添加一组顶点位置,以形成三角形面。对于每个面," +"数组中必须有三个使用顺时针缠绕顺序的顶点位置。由于 [NavigationMesh] 资源本身没" +"有变换,因此所有顶点位置都需要使用 [param xform] 参数使用节点的变换进行偏移。" + +msgid "" +"Adds the geometry data of a [Mesh] resource to the navigation mesh baking " +"data. The mesh must have valid triangulated mesh data to be considered. Since " +"[NavigationMesh] resources have no transform, all vertex positions need to be " +"offset by the node's transform using [param xform]." +msgstr "" +"向导航网格烘焙数据中添加 [Mesh] 资源的几何体数据。网格中必须存在有效的三角形网" +"格数据才会被使用。因为 [NavigationMesh] 资源本身没有变换,所有顶点位置都需要使" +"用 [param xform] 参数使用节点的变换进行偏移。" + +msgid "" +"Adds an [Array] the size of [constant Mesh.ARRAY_MAX] and with vertices at " +"index [constant Mesh.ARRAY_VERTEX] and indices at index [constant Mesh." +"ARRAY_INDEX] to the navigation mesh baking data. The array must have valid " +"triangulated mesh data to be considered. Since [NavigationMesh] resources " +"have no transform, all vertex positions need to be offset by the node's " +"transform using [param xform]." +msgstr "" +"向导航网格烘焙数据中添加一个 [Array],大小为 [constant Mesh.ARRAY_MAX],顶点数" +"据位于索引 [constant Mesh.ARRAY_VERTEX],索引数据位于索引 [constant Mesh." +"ARRAY_INDEX]。数组中必须存在有效的三角形网格数据才会被使用。因为 " +"[NavigationMesh] 资源本身没有变换,所有顶点位置都需要使用 [param xform] 参数使" +"用节点的变换进行偏移。" + msgid "Returns the parsed source geometry data indices array." msgstr "返回解析得到的源几何体数据索引数据。" @@ -65167,6 +71694,12 @@ msgstr "" msgid "If [code]true[/code] the obstacle affects avoidance using agents." msgstr "如果为 [code]true[/code],则该障碍物会影响使用代理的避障。" +msgid "" +"A bitfield determining the avoidance layers for this obstacle. Agents with a " +"matching bit on the their avoidance mask will avoid this obstacle." +msgstr "" +"决定该障碍物的避障层的位字段。避障掩码中存在匹配位的代理会躲避该障碍物。" + msgid "Sets the avoidance radius for the obstacle." msgstr "设置该障碍物的避障半径。" @@ -65253,6 +71786,9 @@ msgstr "" msgid "Using NavigationPathQueryObjects" msgstr "使用 NavigationPathQueryObject" +msgid "The navigation map [RID] used in the path query." +msgstr "在路径查询中使用的导航地图 [RID]。" + msgid "Additional information to include with the navigation path." msgstr "包含在导航路径中的额外信息。" @@ -65379,10 +71915,123 @@ msgstr "" "导航查询的路径数组结果。所有的路径数组位置都使用全局坐标。未自定义查询参数时," "与 [method NavigationServer3D.map_get_path] 返回的路径相同。" +msgid "" +"A 2D navigation mesh that describes a traversable surface for pathfinding." +msgstr "2D 导航网格,描述用于寻路的可穿越表面。" + +msgid "" +"A navigation mesh can be created either by baking it with the help of the " +"[NavigationServer2D], or by adding vertices and convex polygon indices arrays " +"manually.\n" +"To bake a navigation mesh at least one outline needs to be added that defines " +"the outer bounds of the baked area.\n" +"[codeblocks]\n" +"[gdscript]\n" +"var new_navigation_mesh = NavigationPolygon.new()\n" +"var bounding_outline = PackedVector2Array([Vector2(0, 0), Vector2(0, 50), " +"Vector2(50, 50), Vector2(50, 0)])\n" +"new_navigation_mesh.add_outline(bounding_outline)\n" +"NavigationServer2D.bake_from_source_geometry_data(new_navigation_mesh, " +"NavigationMeshSourceGeometryData2D.new());\n" +"$NavigationRegion2D.navigation_polygon = new_navigation_mesh\n" +"[/gdscript]\n" +"[csharp]\n" +"var newNavigationMesh = new NavigationPolygon();\n" +"var boundingOutline = new Vector2[] { new Vector2(0, 0), new Vector2(0, 50), " +"new Vector2(50, 50), new Vector2(50, 0) };\n" +"newNavigationMesh.AddOutline(boundingOutline);\n" +"NavigationServer2D.BakeFromSourceGeometryData(newNavigationMesh, new " +"NavigationMeshSourceGeometryData2D());\n" +"GetNode<NavigationRegion2D>(\"NavigationRegion2D\").NavigationPolygon = " +"newNavigationMesh;\n" +"[/csharp]\n" +"[/codeblocks]\n" +"Adding vertices and polygon indices manually.\n" +"[codeblocks]\n" +"[gdscript]\n" +"var new_navigation_mesh = NavigationPolygon.new()\n" +"var new_vertices = PackedVector2Array([Vector2(0, 0), Vector2(0, 50), " +"Vector2(50, 50), Vector2(50, 0)])\n" +"new_navigation_mesh.vertices = new_vertices\n" +"var new_polygon_indices = PackedInt32Array([0, 1, 2, 3])\n" +"new_navigation_mesh.add_polygon(new_polygon_indices)\n" +"$NavigationRegion2D.navigation_polygon = new_navigation_mesh\n" +"[/gdscript]\n" +"[csharp]\n" +"var newNavigationMesh = new NavigationPolygon();\n" +"var newVertices = new Vector2[] { new Vector2(0, 0), new Vector2(0, 50), new " +"Vector2(50, 50), new Vector2(50, 0) };\n" +"newNavigationMesh.Vertices = newVertices;\n" +"var newPolygonIndices = new int[] { 0, 1, 2, 3 };\n" +"newNavigationMesh.AddPolygon(newPolygonIndices);\n" +"GetNode<NavigationRegion2D>(\"NavigationRegion2D\").NavigationPolygon = " +"newNavigationMesh;\n" +"[/csharp]\n" +"[/codeblocks]" +msgstr "" +"导航网格可以通过在 [NavigationServer2D] 的帮助下烘焙它来创建,也可以通过手动添" +"加顶点和凸多边形索引数组来创建。\n" +"要烘焙导航网格,至少需要添加一个轮廓来定义烘焙区域的外部边界。\n" +"[codeblocks]\n" +"[gdscript]\n" +"var new_navigation_mesh = NavigationPolygon.new()\n" +"var bounding_outline = PackedVector2Array([Vector2(0, 0), Vector2(0, 50), " +"Vector2(50, 50), Vector2(50, 0)])\n" +"new_navigation_mesh.add_outline(bounding_outline)\n" +"NavigationServer2D.bake_from_source_geometry_data(new_navigation_mesh, " +"NavigationMeshSourceGeometryData2D.new());\n" +"$NavigationRegion2D.navigation_polygon = new_navigation_mesh\n" +"[/gdscript]\n" +"[csharp]\n" +"var newNavigationMesh = new NavigationPolygon();\n" +"var boundingOutline = new Vector2[] { new Vector2(0, 0), new Vector2(0, 50), " +"new Vector2(50, 50), new Vector2(50, 0) };\n" +"newNavigationMesh.AddOutline(boundingOutline);\n" +"NavigationServer2D.BakeFromSourceGeometryData(newNavigationMesh, new " +"NavigationMeshSourceGeometryData2D());\n" +"GetNode<NavigationRegion2D>(\"NavigationRegion2D\").NavigationPolygon = " +"newNavigationMesh;\n" +"[/csharp]\n" +"[/codeblocks]\n" +"手动添加顶点和多边形索引。\n" +"[codeblocks]\n" +"[gdscript]\n" +"var new_navigation_mesh = NavigationPolygon.new()\n" +"var new_vertices = PackedVector2Array([Vector2(0, 0), Vector2(0, 50), " +"Vector2(50, 50), Vector2(50, 0)])\n" +"new_navigation_mesh.vertices = new_vertices\n" +"var new_polygon_indices = PackedInt32Array([0, 1, 2, 3])\n" +"new_navigation_mesh.add_polygon(new_polygon_indices)\n" +"$NavigationRegion2D.navigation_polygon = new_navigation_mesh\n" +"[/gdscript]\n" +"[csharp]\n" +"var newNavigationMesh = new NavigationPolygon();\n" +"var newVertices = new Vector2[] { new Vector2(0, 0), new Vector2(0, 50), new " +"Vector2(50, 50), new Vector2(50, 0) };\n" +"newNavigationMesh.Vertices = newVertices;\n" +"var newPolygonIndices = new int[] { 0, 1, 2, 3 };\n" +"newNavigationMesh.AddPolygon(newPolygonIndices);\n" +"GetNode<NavigationRegion2D>(\"NavigationRegion2D\").NavigationPolygon = " +"newNavigationMesh;\n" +"[/csharp]\n" +"[/codeblocks]" + msgid "2D Navigation Demo" msgstr "2D 导航演示" msgid "" +"Appends a [PackedVector2Array] that contains the vertices of an outline to " +"the internal array that contains all the outlines." +msgstr "将包含轮廓顶点的 [PackedVector2Array] 追加到包含所有轮廓的内部数组。" + +msgid "" +"Adds a [PackedVector2Array] that contains the vertices of an outline to the " +"internal array that contains all the outlines at a fixed position." +msgstr "" +"将一个包含轮廓顶点的 [PackedVector2Array] 添加到包含固定位置处的所有轮廓的内部" +"数组。" + +msgid "" "Clears the array of the outlines, but it doesn't clear the vertices and the " "polygons that were created by them." msgstr "清除轮廓数组,但不清除顶点和由顶点创建的多边形。" @@ -65412,6 +72061,14 @@ msgid "" "Returns the number of outlines that were created in the editor or by script." msgstr "返回在编辑器或脚本中创建的轮廓的数量。" +msgid "" +"Returns whether or not the specified layer of the [member " +"parsed_collision_mask] is enabled, given a [param layer_number] between 1 and " +"32." +msgstr "" +"返回 [member parsed_collision_mask] 中是否启用了指定的层,给定的 [param " +"layer_number] 应在 1 和 32 之间。" + msgid "Returns the count of all polygons." msgstr "返回多边形的数量。" @@ -65421,6 +72078,17 @@ msgid "" msgstr "返回一个 [PackedVector2Array],其中包含用于创建多边形的所有顶点。" msgid "" +"Creates polygons from the outlines added in the editor or by script.\n" +"[i]Deprecated.[/i] This function is deprecated, and might be removed in a " +"future release. Use [method NavigationServer2D.parse_source_geometry_data] " +"and [method NavigationServer2D.bake_from_source_geometry_data] instead." +msgstr "" +"从编辑器中或通过脚本添加的轮廓创建多边形。\n" +"[i]已弃用。[/i]该函数已弃用,并且可能会在将来的版本中移除。请改用 [method " +"NavigationServer2D.parse_source_geometry_data] 和 [method NavigationServer2D." +"bake_from_source_geometry_data]。" + +msgid "" "Removes an outline created in the editor or by script. You have to call " "[method make_polygons_from_outlines] for the polygons to update." msgstr "" @@ -65435,12 +72103,74 @@ msgstr "" "make_polygons_from_outlines] 来更新多边形。" msgid "" +"Based on [param value], enables or disables the specified layer in the " +"[member parsed_collision_mask], given a [param layer_number] between 1 and 32." +msgstr "" +"根据 [param value],启用或禁用 [member parsed_collision_mask] 中指定的层,给定" +"的 [param layer_number] 应在 1 和 32 之间。" + +msgid "" +"The distance to erode/shrink the walkable surface when baking the navigation " +"mesh." +msgstr "烘焙导航网格时侵蚀/收缩可行走表面的距离。" + +msgid "" "The cell size used to rasterize the navigation mesh vertices. Must match with " "the cell size on the navigation map." msgstr "" "用于将导航网格顶点栅格化的单元格大小。必须与导航地图上的单元格大小相匹配。" msgid "" +"The physics layers to scan for static colliders.\n" +"Only used when [member parsed_geometry_type] is [constant " +"PARSED_GEOMETRY_STATIC_COLLIDERS] or [constant PARSED_GEOMETRY_BOTH]." +msgstr "" +"用于扫描静态碰撞器的物理层。\n" +"仅在 [member parsed_geometry_type] 是 [constant " +"PARSED_GEOMETRY_STATIC_COLLIDERS] 或 [constant PARSED_GEOMETRY_BOTH] 时才使" +"用。" + +msgid "" +"The group name of nodes that should be parsed for baking source geometry.\n" +"Only used when [member source_geometry_mode] is [constant " +"SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN] or [constant " +"SOURCE_GEOMETRY_GROUPS_EXPLICIT]." +msgstr "" +"应被解析以烘焙源几何体的节点的组名称。\n" +"只有当 [member source_geometry_mode] 是 [constant " +"SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN] 或 [constant " +"SOURCE_GEOMETRY_GROUPS_EXPLICIT] 时才使用。" + +msgid "" +"Parses mesh instances as obstruction geometry. This includes [Polygon2D], " +"[MeshInstance2D], [MultiMeshInstance2D], and [TileMap] nodes.\n" +"Meshes are only parsed when they use a 2D vertices surface format." +msgstr "" +"将网格实例解析为障碍几何体。这包括 [Polygon2D]、[MeshInstance2D]、" +"[MultiMeshInstance2D] 和 [TileMap] 节点。\n" +"仅当网格使用 2D 顶点表面格式时才会对其进行解析。" + +msgid "" +"Parses [StaticBody2D] and [TileMap] colliders as obstruction geometry. The " +"collider should be in any of the layers specified by [member " +"parsed_collision_mask]." +msgstr "" +"将 [StaticBody2D] 和 [TileMap] 碰撞器解析为障碍几何体。碰撞器应在由 [member " +"parsed_collision_mask] 指定的层中。" + +msgid "" +"Scans nodes in a group and their child nodes recursively for geometry. The " +"group is specified by [member source_geometry_group_name]." +msgstr "" +"以递归方式扫描组中的节点及其子节点以获取几何图形。该组由 [member " +"source_geometry_group_name] 指定。" + +msgid "" +"Uses nodes in a group for geometry. The group is specified by [member " +"source_geometry_group_name]." +msgstr "将组中的节点用于几何。该组由 [member source_geometry_group_name] 指定。" + +msgid "" "A traversable 2D region that [NavigationAgent2D]s can use for pathfinding." msgstr "可达的 2D 地区,[NavigationAgent2D] 能够将其用于寻路。" @@ -65477,6 +72207,23 @@ msgid "Using NavigationRegions" msgstr "使用 NavigationRegion" msgid "" +"Bakes the [NavigationPolygon]. If [param on_thread] is set to [code]true[/" +"code] (default), the baking is done on a separate thread." +msgstr "" +"烘焙该 [NavigationPolygon]。如果 [param on_thread] 被设置为 [code]true[/code]" +"(默认),则烘焙将在单独的线程上完成。" + +msgid "Returns the current navigation map [RID] used by this region." +msgstr "返回该区块使用的当前导航地图 [RID]。" + +msgid "" +"Returns the [RID] of this region on the [NavigationServer2D].\n" +"[i]Deprecated.[/i] Use [method get_rid] instead." +msgstr "" +"返回 [NavigationServer2D] 上该区块的 [RID]。\n" +"[i]已废弃。[/i]请改用 [method get_rid]。" + +msgid "" "Returns the [RID] of this region on the [NavigationServer2D]. Combined with " "[method NavigationServer2D.map_get_closest_point_owner] can be used to " "identify the [NavigationRegion2D] closest to a point on the merged navigation " @@ -65486,6 +72233,14 @@ msgstr "" "map_get_closest_point_owner] 可用于识别合并导航地图上离某点最近的 " "[NavigationRegion2D]。" +msgid "" +"Sets the [RID] of the navigation map this region should use. By default the " +"region will automatically join the [World2D] default navigation map so this " +"function is only required to override the default map." +msgstr "" +"设置该区块应使用的导航地图的 [RID]。默认情况下,该区块会自动加入 [World2D] 默" +"认导航地图,因此该函数只需要覆盖默认地图即可。" + msgid "A bitfield determining all avoidance layers for the avoidance constrain." msgstr "位域,确定避障约束的所有避障层。" @@ -65510,6 +72265,14 @@ msgid "Determines if the [NavigationRegion2D] is enabled or disabled." msgstr "决定该 [NavigationRegion2D] 是启用还是禁用。" msgid "" +"When pathfinding enters this region's navigation mesh from another regions " +"navigation mesh the [member enter_cost] value is added to the path distance " +"for determining the shortest path." +msgstr "" +"当寻路从另一个区块的导航网格进入该区块的导航网格时,[member enter_cost] 值将被" +"加到路径距离,以确定最短路径。" + +msgid "" "A bitfield determining all navigation layers the region belongs to. These " "navigation layers can be checked upon when requesting a path with [method " "NavigationServer2D.map_get_path]." @@ -65521,6 +72284,14 @@ msgid "The [NavigationPolygon] resource to use." msgstr "使用的 [NavigationPolygon] 资源。" msgid "" +"When pathfinding moves inside this region's navigation mesh the traveled " +"distances are multiplied with [member travel_cost] for determining the " +"shortest path." +msgstr "" +"当寻路在该区块的导航网格内移动时,将行进距离乘以 [member travel_cost] 以确定最" +"短路径。" + +msgid "" "If enabled the navigation region will use edge connections to connect with " "other navigation regions within proximity of the navigation map edge " "connection margin." @@ -65528,6 +72299,14 @@ msgstr "" "如果启用,导航区块将使用边缘连接来与位于导航地图连接边距范围内的其他导航区块相" "连接。" +msgid "Emitted when a navigation polygon bake operation is completed." +msgstr "当导航多边形烘焙操作完成时触发。" + +msgid "" +"Emitted when the used navigation polygon is replaced or changes to the " +"internals of the current navigation polygon are committed." +msgstr "当使用的导航多边形被替换或对当前导航多边形内部的更改被提交时发出。" + msgid "" "A traversable 3D region that [NavigationAgent3D]s can use for pathfinding." msgstr "可达的 3D 地区,[NavigationAgent3D] 能够将其用于寻路。" @@ -65579,6 +72358,13 @@ msgstr "" "用独立线程烘焙。" msgid "" +"Returns the [RID] of this region on the [NavigationServer3D].\n" +"[i]Deprecated.[/i] Use [method get_rid] instead." +msgstr "" +"返回 [NavigationServer3D] 上该区块的 [RID]。\n" +"[i]已废弃。[/i]请改用 [method get_rid]。" + +msgid "" "Returns the [RID] of this region on the [NavigationServer3D]. Combined with " "[method NavigationServer3D.map_get_closest_point_owner] can be used to " "identify the [NavigationRegion3D] closest to a point on the merged navigation " @@ -65588,6 +72374,14 @@ msgstr "" "map_get_closest_point_owner] 可用于识别距离该合并导航地图上的点最近的 " "[NavigationRegion3D]。" +msgid "" +"Sets the [RID] of the navigation map this region should use. By default the " +"region will automatically join the [World3D] default navigation map so this " +"function is only required to override the default map." +msgstr "" +"设置该区块应使用的导航地图的 [RID]。默认情况下,该区块会自动加入 [World3D] 默" +"认导航地图,因此该函数只需要覆盖默认地图即可。" + msgid "Determines if the [NavigationRegion3D] is enabled or disabled." msgstr "决定该 [NavigationRegion3D] 是启用还是禁用。" @@ -65799,6 +72593,23 @@ msgstr "" "至新的较远的位置时,应该在同一帧里使用这个函数。频繁调用这个函数可能让代理卡" "住。" +msgid "" +"Bakes the provided [param navigation_polygon] with the data from the provided " +"[param source_geometry_data]. After the process is finished the optional " +"[param callback] will be called." +msgstr "" +"使用提供的 [param source_geometry_data] 中的数据烘焙提供的 [param " +"navigation_polygon]。该过程完成后,将调用可选的 [param callback]。" + +msgid "" +"Bakes the provided [param navigation_polygon] with the data from the provided " +"[param source_geometry_data] as an async task running on a background thread. " +"After the process is finished the optional [param callback] will be called." +msgstr "" +"使用提供的 [param source_geometry_data] 中的数据烘焙提供的 [param " +"navigation_polygon],并作为在后台线程上运行的异步任务。该过程完成后,将调用可" +"选的 [param callback]。" + msgid "Destroys the given RID." msgstr "销毁给定的 RID。" @@ -65816,6 +72627,9 @@ msgstr "" msgid "Create a new link between two positions on a map." msgstr "在地图上新建两个地点之间的链接。" +msgid "Returns [code]true[/code] if the specified [param link] is enabled." +msgstr "如果指定的 [param link] 已启用,则返回 [code]true[/code]。" + msgid "Returns the ending position of this [param link]." msgstr "返回链接 [param link] 的结束位置。" @@ -66006,6 +72820,16 @@ msgid "" "polygons." msgstr "设置该地图用于连接链接和导航多边形的链接连接半径。" +msgid "" +"Set the navigation [param map] edge connection use. If [param enabled] is " +"[code]true[/code], the navigation map allows navigation regions to use edge " +"connections to connect with other navigation regions within proximity of the " +"navigation map edge connection margin." +msgstr "" +"设置导航地图 [param map] 的边缘连接使用情况。如果 [param enabled] 为 " +"[code]true[/code],则导航地图允许导航区块使用边缘连接与位于导航地图边缘连接边" +"距范围内的其他导航区块相连接。" + msgid "Creates a new navigation obstacle." msgstr "新建导航障碍物。" @@ -66022,6 +72846,13 @@ msgstr "返回请求的障碍物 [param obstacle] 当前分配的导航地图 [R msgid "Returns [code]true[/code] if the specified [param obstacle] is paused." msgstr "如果指定的 [param obstacle] 被暂停,则返回 [code]true[/code]。" +msgid "" +"If [param enabled] is [code]true[/code], the provided [param obstacle] " +"affects avoidance using agents." +msgstr "" +"如果 [param enabled] 为 [code]true[/code],则提供的障碍物 [param obstacle] 会" +"影响使用代理的避障。" + msgid "Set the obstacles's [code]avoidance_layers[/code] bitmask." msgstr "设置障碍物的避障层 [code]avoidance_layers[/code] 位掩码。" @@ -66058,6 +72889,30 @@ msgstr "" "推挤。" msgid "" +"Parses the [SceneTree] for source geometry according to the properties of " +"[param navigation_polygon]. Updates the provided [param source_geometry_data] " +"resource with the resulting data. The resource can then be used to bake a " +"navigation mesh with [method bake_from_source_geometry_data]. After the " +"process is finished the optional [param callback] will be called.\n" +"[b]Note:[/b] This function needs to run on the main thread or with a deferred " +"call as the SceneTree is not thread-safe.\n" +"[b]Performance:[/b] While convenient, reading data arrays from [Mesh] " +"resources can affect the frame rate negatively. The data needs to be received " +"from the GPU, stalling the [RenderingServer] in the process. For performance " +"prefer the use of e.g. collision shapes or creating the data arrays entirely " +"in code." +msgstr "" +"根据 [param navigation_polygon] 的属性解析 [SceneTree] 中的源几何体。会使用解" +"析的结果数据对提供的 [param source_geometry_data] 资源进行更新。后续可以在使" +"用 [method bake_from_source_geometry_data] 烘焙导航网格时使用该资源。解析过程" +"完成后,会调用可选的 [param callback]。\n" +"[b]注意:[/b]因为 SceneTree 并不是线程安全的,所以这个函数需要在主线程执行或使" +"用延迟调用。\n" +"[b]性能:[/b]从 [Mesh] 资源读取数据数组虽然很方便,但会对帧率造成负面影响。这" +"些数据需要从 GPU 获取,卡住正在处理的 [RenderingServer]。出于性能考量,请优先" +"使用碰撞形状或在完全在代码中创建数据数组。" + +msgid "" "Queries a path in a given navigation map. Start and target position and other " "parameters are defined through [NavigationPathQueryParameters2D]. Updates the " "provided [NavigationPathQueryResult2D] result object with the path among " @@ -66089,6 +72944,9 @@ msgid "" "the map." msgstr "返回 [param region] 地区与其他地区在地图上有多少连接。" +msgid "Returns [code]true[/code] if the specified [param region] is enabled." +msgstr "如果指定的 [param region] 已启用,则返回 [code]true[/code]。" + msgid "Returns the enter cost of this [param region]." msgstr "返回 [param region] 地区的进入消耗。" @@ -66171,6 +73029,14 @@ msgstr "设置该地区的全局变换。" msgid "Sets the [param travel_cost] for this [param region]." msgstr "设置 [param region] 地区的移动消耗 [param travel_cost]。" +msgid "" +"If [param enabled] is [code]true[/code], the navigation [param region] will " +"use edge connections to connect with other navigation regions within " +"proximity of the navigation map edge connection margin." +msgstr "" +"如果 [param enabled] 为 [code]true[/code],则导航区块 [param region] 将使用边" +"缘连接来与位于导航地图边缘连接边距范围内的其他导航区块相连接。" + msgid "If [code]true[/code] enables debug mode on the NavigationServer." msgstr "如果为 [code]true[/code],则该 NavigationServer 启用了调试模式。" @@ -66187,6 +73053,53 @@ msgid "A server interface for low-level 3D navigation access." msgstr "用于访问低阶 3D 导航的服务器接口。" msgid "" +"NavigationServer3D is the server that handles navigation maps, regions and " +"agents. It does not handle A* navigation from [AStar3D].\n" +"Maps are made up of regions, which are made of navigation meshes. Together, " +"they define the navigable areas in the 3D world.\n" +"[b]Note:[/b] Most [NavigationServer3D] changes take effect after the next " +"physics frame and not immediately. This includes all changes made to maps, " +"regions or agents by navigation-related nodes in the scene tree or made " +"through scripts.\n" +"For two regions to be connected to each other, they must share a similar " +"edge. An edge is considered connected to another if both of its two vertices " +"are at a distance less than [code]edge_connection_margin[/code] to the " +"respective other edge's vertex.\n" +"You may assign navigation layers to regions with [method NavigationServer3D." +"region_set_navigation_layers], which then can be checked upon when requesting " +"a path with [method NavigationServer3D.map_get_path]. This can be used to " +"allow or deny certain areas for some objects.\n" +"To use the collision avoidance system, you may use agents. You can set an " +"agent's target velocity, then the servers will emit a callback with a " +"modified velocity.\n" +"[b]Note:[/b] The collision avoidance system ignores regions. Using the " +"modified velocity directly may move an agent outside of the traversable area. " +"This is a limitation of the collision avoidance system, any more complex " +"situation may require the use of the physics engine.\n" +"This server keeps tracks of any call and executes them during the sync phase. " +"This means that you can request any change to the map, using any thread, " +"without worrying." +msgstr "" +"NavigationServer3D 是处理导航地图、区块、代理的服务器。它不处理来自 [AStar3D] " +"的 A* 导航。\n" +"地图由区块组成,区块由导航网格组成。它们共同定义了 3D 空间中的可达区域。\n" +"[b]注意:[/b]大多数 [NavigationServer3D] 的更改都是在下一个物理帧进行的,不会" +"立即生效。包括所有对地图、区块、代理的更改,无论是通过场景树中导航相关的节点作" +"出的更改,还是通过脚本作出的更改。\n" +"两个区块必须共享一条相似的边才能相连。如果一条边的两个顶点与另一条边上相应顶点" +"的距离都小于 [code]edge_connection_margin[/code],那么就会认为这两条边是相连" +"的。\n" +"可以使用 [method NavigationServer3D.region_set_navigation_layers] 为区块分配导" +"航层,使用 [method NavigationServer3D.map_get_path] 请求路径时会对导航层进行检" +"查。可用于针对某些对象允许或禁止特定的区域。\n" +"使用碰撞躲避系统就需要使用代理。你可以为代理设置目标速度,然后服务器就会发出回" +"调,提供修改后的速度。\n" +"[b]注意:[/b]碰撞躲避系统会忽略区块。直接使用修改后的速度可能会将代理移动到可" +"达区域之外。这是碰撞躲避系统的缺陷,更复杂的场合可能需要使用物理引擎。\n" +"服务器会对所有调用进行跟踪,并在同步阶段执行。这意味着你可以放心地从任何线程请" +"求对地图作出任何修改。" + +msgid "" "Returns [code]true[/code] if the provided [param agent] has avoidance enabled." msgstr "如果指定代理 [param agent] 启用了避障,则返回 [code]true[/code]。" @@ -66257,6 +73170,15 @@ msgstr "" "至新的位置时,应该在同一帧里使用这个函数。频繁调用这个函数可能让代理卡住。" msgid "" +"Bakes the provided [param navigation_mesh] with the data from the provided " +"[param source_geometry_data] as an async task running on a background thread. " +"After the process is finished the optional [param callback] will be called." +msgstr "" +"使用提供的 [param source_geometry_data] 中的数据烘焙提供的 [param " +"navigation_mesh],并作为在后台线程上运行的异步任务。该过程完成后,将调用可选" +"的 [param callback]。" + +msgid "" "Returns information about the current state of the NavigationServer. See " "[enum ProcessInfo] for a list of available states." msgstr "" @@ -66362,6 +73284,25 @@ msgstr "" "供的 [NavigationPathQueryResult3D]。" msgid "" +"Bakes the [param navigation_mesh] with bake source geometry collected " +"starting from the [param root_node].\n" +"[i]Deprecated.[/i] This function is deprecated due to core threading changes. " +"To upgrade existing code, first create a [NavigationMeshSourceGeometryData3D] " +"resource. Use this resource with [method parse_source_geometry_data] to parse " +"the SceneTree for nodes that should contribute to the navigation mesh baking. " +"The SceneTree parsing needs to happen on the main thread. After the parsing " +"is finished use the resource with [method bake_from_source_geometry_data] to " +"bake a navigation mesh." +msgstr "" +"使用从 [param root_node] 开始收集的烘焙源几何体来烘焙 [param " +"navigation_mesh]。\n" +"[i]已弃用。[/i] 由于核心线程更改,该函数已弃用。要更新现有代码,请先创建一个 " +"[NavigationMeshSourceGeometryData3D] 资源。将该资源与 [method " +"parse_source_geometry_data] 结合使用来解析 SceneTree 以查找有助于导航网格烘焙" +"的节点。SceneTree 解析需要在主线程上进行。解析完成后,请在调用 [method " +"bake_from_source_geometry_data] 时使用该资源对导航网格进行烘焙。" + +msgid "" "Returns true if the navigation [param region] is set to use edge connections " "to connect with other navigation regions within proximity of the navigation " "map edge connection margin." @@ -66791,6 +73732,32 @@ msgstr "" "是“孤儿”)。" msgid "" +"Called when the node is \"ready\", i.e. when both the node and its children " +"have entered the scene tree. If the node has children, their [method _ready] " +"callbacks get triggered first, and the parent node will receive the ready " +"notification afterwards.\n" +"Corresponds to the [constant NOTIFICATION_READY] notification in [method " +"Object._notification]. See also the [code]@onready[/code] annotation for " +"variables.\n" +"Usually used for initialization. For even earlier initialization, [method " +"Object._init] may be used. See also [method _enter_tree].\n" +"[b]Note:[/b] [method _ready] may be called only once for each node. After " +"removing a node from the scene tree and adding it again, [method _ready] will " +"not be called a second time. This can be bypassed by requesting another call " +"with [method request_ready], which may be called anywhere before adding the " +"node again." +msgstr "" +"当节点“就绪”时被调用,即当节点及其子节点都已经进入场景树时。如果该节点有子节" +"点,将首先触发子节点的 [method _ready] 回调,稍后父节点将收到就绪通知。\n" +"对应 [method Object._notification] 中的 [constant NOTIFICATION_READY] 通知。另" +"请参阅用于变量的 [code]@onready[/code] 注解。\n" +"通常用于初始化。对于更早的初始化,可以使用 [method Object._init]。另见 " +"[method _enter_tree]。\n" +"[b]注意:[/b]对于每个节点可能仅调用一次 [method _ready]。从场景树中移除一个节" +"点后,并再次添加该节点时,将不会第二次调用 [method _ready]。这时可以通过使用 " +"[method request_ready],它可以在再次添加节点之前的任何地方被调用。" + +msgid "" "Called when an [InputEventKey] or [InputEventShortcut] hasn't been consumed " "by [method _input] or any GUI [Control] item. It is called before [method " "_unhandled_key_input] and [method _unhandled_input]. The input event " @@ -67500,8 +74467,67 @@ msgstr "" "如果这是一个实例加载占位符,则返回 [code]true[/code]。见 " "[InstancePlaceholder]。" -msgid "Returns the [SceneTree] that contains this node." -msgstr "返回包含该节点的 [SceneTree]。" +msgid "" +"Returns the [SceneTree] that contains this node. Returns [code]null[/code] " +"and prints an error if this node is not inside the scene tree. See also " +"[method is_inside_tree]." +msgstr "" +"返回包含该节点的 [SceneTree]。如果该节点不在场景树内,则返回 [code]null[/" +"code] 并打印错误。另见 [method is_inside_tree]。" + +msgid "" +"Returns the tree as a [String]. Used mainly for debugging purposes. This " +"version displays the path relative to the current node, and is good for copy/" +"pasting into the [method get_node] function. It also can be used in game UI/" +"UX.\n" +"[b]Example output:[/b]\n" +"[codeblock]\n" +"TheGame\n" +"TheGame/Menu\n" +"TheGame/Menu/Label\n" +"TheGame/Menu/Camera2D\n" +"TheGame/SplashScreen\n" +"TheGame/SplashScreen/Camera2D\n" +"[/codeblock]" +msgstr "" +"将树以 [String] 的形式返回。主要用于调试。这个版本显示相对于当前节点的路径,适" +"合复制/粘贴到 [method get_node] 函数中。也可以用于游戏中的 UI/UX。\n" +"[b]示例输出:[/b]\n" +"[codeblock]\n" +"TheGame\n" +"TheGame/Menu\n" +"TheGame/Menu/Label\n" +"TheGame/Menu/Camera2D\n" +"TheGame/SplashScreen\n" +"TheGame/SplashScreen/Camera2D\n" +"[/codeblock]" + +msgid "" +"Similar to [method get_tree_string], this returns the tree as a [String]. " +"This version displays a more graphical representation similar to what is " +"displayed in the Scene Dock. It is useful for inspecting larger trees.\n" +"[b]Example output:[/b]\n" +"[codeblock]\n" +" ┖╴TheGame\n" +" ┠╴Menu\n" +" ┃ ┠╴Label\n" +" ┃ ┖╴Camera2D\n" +" ┖╴SplashScreen\n" +" ┖╴Camera2D\n" +"[/codeblock]" +msgstr "" +"类似于 [method get_tree_string],会将树以 [String] 的形式返回。这个版本使用的" +"是一种更加图形化的呈现方式,类似于在“场景”面板中显示的内容。非常适合检查较大的" +"树。\n" +"[b]输出示例:[/b]\n" +"[codeblock]\n" +" ┖╴TheGame\n" +" ┠╴Menu\n" +" ┃ ┠╴Label\n" +" ┃ ┖╴Camera2D\n" +" ┖╴SplashScreen\n" +" ┖╴Camera2D\n" +"[/codeblock]" msgid "Returns the node's [Viewport]." msgstr "返回节点的 [Viewport]。" @@ -67802,6 +74828,19 @@ msgstr "" "者使用 [method Object.free] 释放它。" msgid "" +"Requests that [method _ready] be called again. Note that the method won't be " +"called immediately, but is scheduled for when the node is added to the scene " +"tree again. [method _ready] is called only for the node which requested it, " +"which means that you need to request ready for each child if you want them to " +"call [method _ready] too (in which case, [method _ready] will be called in " +"the same order as it would normally)." +msgstr "" +"请求再次调用 [method _ready]。注意,该方法不会被立即调用,而是被安排在该节点再" +"次被添加到场景树时。只会为进行了请求的节点调用 [method _ready],也就是说,如果" +"你想让每个子节点都调用 [method _ready],就需要为它们分别进行就绪请求(在这种情" +"况下,[method _ready] 的调用顺序与正常情况下相同)。" + +msgid "" "Sends a remote procedure call request for the given [param method] to peers " "on the network (and locally), optionally sending all additional arguments as " "arguments to the method called by the RPC. The call request will only be " @@ -67884,6 +74923,29 @@ msgstr "" "具。" msgid "" +"Sets the node's multiplayer authority to the peer with the given peer ID. The " +"multiplayer authority is the peer that has authority over the node on the " +"network. Useful in conjunction with [method rpc_config] and the " +"[MultiplayerAPI]. Defaults to peer ID 1 (the server). If [param recursive], " +"the given peer is recursively set as the authority for all children of this " +"node.\n" +"[b]Warning:[/b] This does [b]not[/b] automatically replicate the new " +"authority to other peers. It is developer's responsibility to do so. You can " +"propagate the information about the new authority using [member " +"MultiplayerSpawner.spawn_function], an RPC, or using a " +"[MultiplayerSynchronizer]. Also, the parent's authority does [b]not[/b] " +"propagate to newly added children." +msgstr "" +"将该节点的多人游戏控制方设置为具有给定对等体 ID 的对等体。多人游戏控制方是对网" +"络上的节点具有控制权限的对等体。可以与 [method rpc_config] 和 " +"[MultiplayerAPI] 结合使用。默认为对等体 ID 1(服务器)。如果 [param " +"recursive],则给定的对等体会被递归设置为该节点所有子节点的控制方。\n" +"[b]警告:[/b]这样做[b]不会[/b]自动将新的控制方复制给其他对等体。开发者需要自己" +"负责。你可以使用 [member MultiplayerSpawner.spawn_function]、RPC、" +"[MultiplayerSynchronizer] 等方法将这个信息传播出去。另外,父节点的控制方[b]不" +"会[/b]传播给新添加的子节点。" + +msgid "" "Enables or disables physics (i.e. fixed framerate) processing. When a node is " "being processed, it will receive a [constant NOTIFICATION_PHYSICS_PROCESS] at " "a fixed (usually 60 FPS, see [member Engine.physics_ticks_per_second] to " @@ -68003,6 +75065,17 @@ msgstr "" "工具提示中。" msgid "" +"The [MultiplayerAPI] instance associated with this node. See [method " +"SceneTree.get_multiplayer].\n" +"[b]Note:[/b] Renaming the node, or moving it in the tree, will not move the " +"[MultiplayerAPI] to the new path, you will have to update this manually." +msgstr "" +"与该节点关联的 [MultiplayerAPI] 实例。见 [method SceneTree." +"get_multiplayer]。\n" +"[b]注意:[/b]将节点重命名或者在树中移动都不会将 [MultiplayerAPI] 移动至新的路" +"径,你需要手动进行更新。" + +msgid "" "The name of the node. This name is unique among the siblings (other child " "nodes from the same parent). When set to an existing name, the node will be " "automatically renamed.\n" @@ -68329,6 +75402,14 @@ msgstr "" "set_physics_process_internal])。" msgid "" +"Notification received when the node is ready, just before [constant " +"NOTIFICATION_READY] is received. Unlike the latter, it's sent every time the " +"node enters the tree, instead of only once." +msgstr "" +"当该节点就绪,在收到 [constant NOTIFICATION_READY] 之前收到的通知。与后者不" +"同,该节点每次进入树时都会发送,而不是只发送一次。" + +msgid "" "Notification received when the node is disabled. See [constant " "PROCESS_MODE_DISABLED]." msgstr "当该节点被禁用时收到的通知。见 [constant PROCESS_MODE_DISABLED]。" @@ -68421,6 +75502,26 @@ msgid "" msgstr "当屏幕的 DPI 发生更改时,从操作系统受到的通知。仅在 macOS 上实现。" msgid "" +"Notification received when the mouse cursor enters the [Viewport]'s visible " +"area, that is not occluded behind other [Control]s or [Window]s, provided its " +"[member Viewport.gui_disable_input] is [code]false[/code] and regardless if " +"it's currently focused or not." +msgstr "" +"当鼠标指针进入 [Viewport] 的可见区域时收到的通知,可见区域指没有被其他 " +"[Control] 和 [Window] 遮挡的区域,并且需要 [member Viewport." +"gui_disable_input] 为 [code]false[/code],与当前是否持有焦点无关。" + +msgid "" +"Notification received when the mouse cursor leaves the [Viewport]'s visible " +"area, that is not occluded behind other [Control]s or [Window]s, provided its " +"[member Viewport.gui_disable_input] is [code]false[/code] and regardless if " +"it's currently focused or not." +msgstr "" +"当鼠标指针离开 [Viewport] 的可见区域时收到的通知,可见区域指没有被其他 " +"[Control] 和 [Window] 遮挡的区域,并且需要 [member Viewport." +"gui_disable_input] 为 [code]false[/code],与当前是否持有焦点无关。" + +msgid "" "Inherits process mode from the node's parent. For the root node, it is " "equivalent to [constant PROCESS_MODE_PAUSABLE]. Default." msgstr "" @@ -68651,6 +75752,35 @@ msgstr "局部 [Transform2D]。" msgid "Most basic 3D game object, parent of all 3D-related nodes." msgstr "最基本的 3D 游戏对象,所有 3D 相关节点的父类。" +msgid "" +"Most basic 3D game object, with a [Transform3D] and visibility settings. All " +"other 3D game objects inherit from [Node3D]. Use [Node3D] as a parent node to " +"move, scale, rotate and show/hide children in a 3D project.\n" +"Affine operations (rotate, scale, translate) happen in parent's local " +"coordinate system, unless the [Node3D] object is set as top-level. Affine " +"operations in this coordinate system correspond to direct affine operations " +"on the [Node3D]'s transform. The word local below refers to this coordinate " +"system. The coordinate system that is attached to the [Node3D] object itself " +"is referred to as object-local coordinate system.\n" +"[b]Note:[/b] Unless otherwise specified, all methods that have angle " +"parameters must have angles specified as [i]radians[/i]. To convert degrees " +"to radians, use [method @GlobalScope.deg_to_rad].\n" +"[b]Note:[/b] Be aware that \"Spatial\" nodes are now called \"Node3D\" " +"starting with Godot 4. Any Godot 3.x references to \"Spatial\" nodes refer to " +"\"Node3D\" in Godot 4." +msgstr "" +"最基本的 3D 游戏对象,具有 [Transform3D] 和可见性设置。所有其他的 3D 游戏对象" +"都继承自 [Node3D]。在 3D 项目中,请使用 [Node3D] 作为父节点对子节点进行移动、" +"缩放、旋转和显示/隐藏。\n" +"除非该 [Node3D] 对象被设置为顶层,否则仿射操作(旋转、缩放、平移)会在父节点的" +"本地坐标系中进行。在这个坐标系中的仿射操作对应于对 [Node3D] 变换的直接仿射运" +"算。下文中的本地一词指的就是这个坐标系。附加到 [Node3D] 对象本身的坐标系被称为" +"对象本地坐标系。\n" +"[b]注意:[/b]除非另有规定,所有有角度参数的方法必须将角度指定为[i]弧度[/i]。请" +"使用 [method @GlobalScope.deg_to_rad] 将度数转换为弧度。\n" +"[b]注意:[/b]请注意,从 Godot 4 开始,“Spatial”节点现在被称为“Node3D”。Godot " +"3.x 中指的“Spatial”节点,均指的是 Godot 4 中的“Node3D”。" + msgid "Introduction to 3D" msgstr "3D 简介" @@ -68658,12 +75788,28 @@ msgid "All 3D Demos" msgstr "所有 3D 演示" msgid "" +"Attach an editor gizmo to this [Node3D].\n" +"[b]Note:[/b] The gizmo object would typically be an instance of " +"[EditorNode3DGizmo], but the argument type is kept generic to avoid creating " +"a dependency on editor classes in [Node3D]." +msgstr "" +"将编辑器小工具附加到该 [Node3D]。\n" +"[b]注意:[/b]小工具对象通常是 [EditorNode3DGizmo] 的一个实例,但参数类型保持通" +"用以避免在 [Node3D] 中创建对编辑器类的依赖。" + +msgid "Clear all gizmos attached to this [Node3D]." +msgstr "清除附加于该 [Node3D] 的所有小工具。" + +msgid "" "Clears subgizmo selection for this node in the editor. Useful when subgizmo " "IDs become invalid after a property change." msgstr "" "在编辑器中,清除该节点的子小工具选择。在一个属性更改后,子小工具 ID 变得无效时" "很有用。" +msgid "Returns all the gizmos attached to this [Node3D]." +msgstr "返回附加到该 [Node3D] 的所有小工具。" + msgid "" "Returns the parent [Node3D], or an empty [Object] if no parent exists or " "parent is not of type [Node3D]." @@ -68822,6 +75968,16 @@ msgstr "" "于编辑器上下文中,并且存在有效的小工具。" msgid "" +"Set subgizmo selection for this node in the editor.\n" +"[b]Note:[/b] The gizmo object would typically be an instance of " +"[EditorNode3DGizmo], but the argument type is kept generic to avoid creating " +"a dependency on editor classes in [Node3D]." +msgstr "" +"在编辑器中为该节点设置子小工具选区。\n" +"[b]注意:[/b]小工具对象通常是 [EditorNode3DGizmo] 的一个实例,但参数类型保持通" +"用以避免在 [Node3D] 中创建对编辑器类的依赖。" + +msgid "" "Enables rendering of this node. Changes [member visible] to [code]true[/code]." msgstr "启用此节点的呈现。将 [member visible] 更改为 [code]true[/code]。" @@ -68849,6 +76005,9 @@ msgid "" "Changes the node's position by the given offset [Vector3] in local space." msgstr "通过给定的局部空间偏移量 [Vector3] 改变该节点的位置。" +msgid "Updates all the [Node3D] gizmos attached to this node." +msgstr "更新附加于该节点的所有 [Node3D] 小工具。" + msgid "Direct access to the 3x3 basis of the [member transform] property." msgstr "直接访问 [member transform] 属性的 3x3 基。" @@ -68982,6 +76141,44 @@ msgstr "" msgid "Emitted when node visibility changes." msgstr "当节点可见性更改时触发。" +msgid "" +"[Node3D] nodes receive this notification when their global transform changes. " +"This means that either the current or a parent node changed its transform.\n" +"In order for [constant NOTIFICATION_TRANSFORM_CHANGED] to work, users first " +"need to ask for it, with [method set_notify_transform]. The notification is " +"also sent if the node is in the editor context and it has at least one valid " +"gizmo." +msgstr "" +"[Node3D] 节点在自己的全局变换发生改变时,会收到这个通知。这意味着当前节点或者" +"某个父节点的变换发生了改变。\n" +"用户需要使用 [method set_notify_transform] 手动申请才能够收到 [constant " +"NOTIFICATION_TRANSFORM_CHANGED]。如果该节点在编辑器环境中,并且拥有至少一个有" +"效的小工具,则也会发送这个通知。" + +msgid "" +"[Node3D] nodes receive this notification when they are registered to new " +"[World3D] resource." +msgstr "[Node3D] 节点在注册到新的 [World3D] 资源时,会收到这个通知。" + +msgid "" +"[Node3D] nodes receive this notification when they are unregistered from " +"current [World3D] resource." +msgstr "[Node3D] 节点从当前的 [World3D] 资源中取消注册时,会收到这个通知。" + +msgid "[Node3D] nodes receive this notification when their visibility changes." +msgstr "[Node3D] 节点在其可见性发生变化时,会收到该通知。" + +msgid "" +"[Node3D] nodes receive this notification when their local transform changes. " +"This is not received when the transform of a parent node is changed.\n" +"In order for [constant NOTIFICATION_LOCAL_TRANSFORM_CHANGED] to work, users " +"first need to ask for it, with [method set_notify_local_transform]." +msgstr "" +"[Node3D] 节点在其局部变换发生改变时,会收到这个通知。父节点的变换发生改变时不" +"会收到这个通知。\n" +"为了使 [constant NOTIFICATION_LOCAL_TRANSFORM_CHANGED] 起作用,用户首先需要使" +"用 [method set_notify_local_transform] 请求它。" + msgid "The rotation is edited using [Vector3] Euler angles." msgstr "旋转量以 [Vector3] 欧拉角的形式编辑。" @@ -68993,9 +76190,94 @@ msgid "" "edited separately." msgstr "旋转量以 [Basis] 的形式编辑。此模式下无法单独编辑 [member scale]。" +msgid "Abstract class to expose editor gizmos for [Node3D]." +msgstr "用于公开 [Node3D] 编辑器小工具的抽象类。" + +msgid "" +"This abstract class helps connect the [Node3D] scene with the editor-specific " +"[EditorNode3DGizmo] class.\n" +"[Node3DGizmo] by itself has no exposed API, refer to [method Node3D." +"add_gizmo] and pass it an [EditorNode3DGizmo] instance." +msgstr "" +"该抽象类有助于将 [Node3D] 场景与特定于编辑器的 [EditorNode3DGizmo] 类连接起" +"来。\n" +"[Node3DGizmo] 本身没有公开的 API,请参考 [method Node3D.add_gizmo] 并向其传递" +"一个 [EditorNode3DGizmo] 实例。" + msgid "A pre-parsed scene tree path." msgstr "预先解析的场景树路径。" +msgid "" +"A pre-parsed relative or absolute path in a scene tree, for use with [method " +"Node.get_node] and similar functions. It can reference a node, a resource " +"within a node, or a property of a node or resource. For example, " +"[code]\"Path2D/PathFollow2D/Sprite2D:texture:size\"[/code] would refer to the " +"[code]size[/code] property of the [code]texture[/code] resource on the node " +"named [code]\"Sprite2D\"[/code], which is a child of the other named nodes in " +"the path.\n" +"You will usually just pass a string to [method Node.get_node] and it will be " +"automatically converted, but you may occasionally want to parse a path ahead " +"of time with [NodePath] or the literal syntax [code]^\"path\"[/code]. " +"Exporting a [NodePath] variable will give you a node selection widget in the " +"properties panel of the editor, which can often be useful.\n" +"A [NodePath] is composed of a list of slash-separated node names (like a " +"filesystem path) and an optional colon-separated list of \"subnames\" which " +"can be resources or properties.\n" +"Some examples of NodePaths include the following:\n" +"[codeblock]\n" +"# No leading slash means it is relative to the current node.\n" +"^\"A\" # Immediate child A\n" +"^\"A/B\" # A's child B\n" +"^\".\" # The current node.\n" +"^\"..\" # The parent node.\n" +"^\"../C\" # A sibling node C.\n" +"^\"../..\" # The grandparent node.\n" +"# A leading slash means it is absolute from the SceneTree.\n" +"^\"/root\" # Equivalent to get_tree().get_root().\n" +"^\"/root/Main\" # If your main scene's root node were named \"Main\".\n" +"^\"/root/MyAutoload\" # If you have an autoloaded node or scene.\n" +"[/codeblock]\n" +"See also [StringName], which is a similar concept for general-purpose string " +"interning.\n" +"[b]Note:[/b] In the editor, [NodePath] properties are automatically updated " +"when moving, renaming or deleting a node in the scene tree, but they are " +"never updated at runtime.\n" +"[b]Note:[/b] In a boolean context, a [NodePath] will evaluate to [code]false[/" +"code] if it is empty ([code]NodePath(\"\")[/code]). Otherwise, a [NodePath] " +"will always evaluate to [code]true[/code]." +msgstr "" +"场景树中预先解析的相对或绝对路径,用于 [method Node.get_node] 和类似函数。它可" +"以引用节点、节点内的资源、或节点或资源的属性。例如,[code]\"Path2D/" +"PathFollow2D/Sprite2D:texture:size\"[/code] 将引用名为 [code]\"Sprite2D\"[/" +"code] 节点上的 [code]texture[/code] 资源的 [code]size[/code] 属性,该节点是路" +"径中其他命名节点的一个子节点。\n" +"通常只需将一个字符串传递给 [method Node.get_node],它将会被自动转换,但可能偶" +"尔想要使用 [NodePath] 或文字语法 [code]^\"path\"[/code] 提前解析路径。导出 " +"[NodePath] 变量会在编辑器的属性面板中,为你提供一个节点选择小部件,这通常很有" +"用。\n" +"[NodePath] 由斜线分隔的节点名称列表(如文件系统路径)和可选的冒号分隔的“子名" +"称”列表组成,这些“子名称”可以是资源或属性。\n" +"NodePath 的一些示例包括:\n" +"[codeblock]\n" +"# 没有前导斜杠意味着它是相对于当前节点的。\n" +"^\"A\" # 直接子节点 A\n" +"^\"A/B\" # A 的子节点 B\n" +"^\".\" # 当前节点。\n" +"^\"..\" # 父节点。\n" +"^\"../C\" # 兄弟节点 C。\n" +"^\"../..\" # 祖父节点。\n" +"# 前导斜杠意味着它是来自 SceneTree 的绝对路径。\n" +"^\"/root\" # 等同于 get_tree().get_root()。\n" +"^\"/root/Main\" # 如果你的主场景的根节点被命名为“Main”。\n" +"^\"/root/MyAutoload\" # 如果你有一个自动加载的节点或场景。\n" +"[/codeblock]\n" +"另见 [StringName],它是通用字符串的类似概念。\n" +"[b]注意:[/b]在编辑器中,[NodePath] 属性在场景树中移动、重命名或删除节点时会自" +"动更新,但它们不会在运行时更新。\n" +"[b]注意:[/b]在布尔上下文中,如果 [NodePath] 为空([code]NodePath(\"\")[/" +"code]),则它将评估为 [code]false[/code]。否则,[NodePath] 将始终评估为 " +"[code]true[/code]。" + msgid "2D Role Playing Game Demo" msgstr "2D 角色扮演游戏演示" @@ -69108,6 +76390,35 @@ msgstr "" "返回所有以斜杠字符([code]/[/code])作为分隔符连接的且不带子名称的路径。" msgid "" +"Returns all subnames concatenated with a colon character ([code]:[/code]) as " +"separator, i.e. the right side of the first colon in a node path.\n" +"[codeblocks]\n" +"[gdscript]\n" +"var node_path = NodePath(\"Path2D/PathFollow2D/Sprite2D:texture:load_path\")\n" +"print(node_path.get_concatenated_subnames()) # texture:load_path\n" +"[/gdscript]\n" +"[csharp]\n" +"var nodePath = new NodePath(\"Path2D/PathFollow2D/Sprite2D:texture:" +"load_path\");\n" +"GD.Print(nodePath.GetConcatenatedSubnames()); // texture:load_path\n" +"[/csharp]\n" +"[/codeblocks]" +msgstr "" +"返回所有以冒号字符([code]:[/code])作为分隔符连接的子名称,即节点路径中第一个" +"冒号的右侧。\n" +"[codeblocks]\n" +"[gdscript]\n" +"var node_path = NodePath(\"Path2D/PathFollow2D/Sprite2D:texture:load_path\")\n" +"print(node_path.get_concatenated_subnames()) # texture:load_path\n" +"[/gdscript]\n" +"[csharp]\n" +"var nodePath = new NodePath(\"Path2D/PathFollow2D/Sprite2D:texture:" +"load_path\");\n" +"GD.Print(nodePath.GetConcatenatedSubnames()); // texture:load_path\n" +"[/csharp]\n" +"[/codeblocks]" + +msgid "" "Gets the node name indicated by [param idx] (0 to [method get_name_count] - " "1).\n" "[codeblocks]\n" @@ -69227,6 +76538,22 @@ msgid "Abstract base class for noise generators." msgstr "噪声生成器的抽象基类。" msgid "" +"This class defines the interface for noise generation libraries to inherit " +"from.\n" +"A default [method get_seamless_image] implementation is provided for " +"libraries that do not provide seamless noise. This function requests a larger " +"image from the [method get_image] method, reverses the quadrants of the " +"image, then uses the strips of extra width to blend over the seams.\n" +"Inheriting noise classes can optionally override this function to provide a " +"more optimal algorithm." +msgstr "" +"该类定义了噪声生成库要继承的接口。\n" +"为不提供无缝噪声的库提供一个默认的 [method get_seamless_image] 实现。该函数从 " +"[method get_image] 请求更大的图像,反转该图像的象限,然后使用额外宽度的条带在" +"接缝处混合。\n" +"继承的噪声类可以选择性地覆盖该函数,以提供更优化的算法。" + +msgid "" "Returns an [Image] containing 2D noise values.\n" "[b]Note:[/b] With [param normalize] set to [code]false[/code], the default " "implementation expects the noise generator to return values in the range " @@ -69279,6 +76606,38 @@ msgstr "" "[b]注意:[/b][param normalize] 为 [code]false[/code] 时,默认实现要求噪声生成" "器返回 [code]-1.0[/code] 到 [code]1.0[/code] 之间的值。" +msgid "A 2D texture filled with noise generated by a [Noise] object." +msgstr "由 [Noise] 对象生成的噪声所填充的 2D 纹理。" + +msgid "" +"Uses the [FastNoiseLite] library or other noise generators to fill the " +"texture data of your desired size. [NoiseTexture2D] can also generate normal " +"map textures.\n" +"The class uses [Thread]s to generate the texture data internally, so [method " +"Texture2D.get_image] may return [code]null[/code] if the generation process " +"has not completed yet. In that case, you need to wait for the texture to be " +"generated before accessing the image and the generated byte data:\n" +"[codeblock]\n" +"var texture = NoiseTexture2D.new()\n" +"texture.noise = FastNoiseLite.new()\n" +"await texture.changed\n" +"var image = texture.get_image()\n" +"var data = image.get_data()\n" +"[/codeblock]" +msgstr "" +"使用 [FastNoiseLite] 库或其他噪声生成器来填充所需大小的纹理数据。" +"[NoiseTexture2D] 还能生成法线贴图纹理。\n" +"该类在内部使用 [Thread] 生成纹理数据,因此如果生成过程尚未完成,[method " +"Texture2D.get_image] 可能会返回 [code]null[/code]。在这种情况下,需要等待纹理" +"生成后再访问图像和生成的字节数据:\n" +"[codeblock]\n" +"var texture = NoiseTexture2D.new()\n" +"texture.noise = FastNoiseLite.new()\n" +"await texture.changed\n" +"var image = texture.get_image()\n" +"var data = image.get_data()\n" +"[/codeblock]" + msgid "" "If [code]true[/code], the resulting texture contains a normal map created " "from the original noise interpreted as a bump map." @@ -69374,6 +76733,34 @@ msgstr "" msgid "Width of the generated texture (in pixels)." msgstr "生成的纹理的宽度(单位为像素)。" +msgid "A 3D texture filled with noise generated by a [Noise] object." +msgstr "由 [Noise] 对象生成的噪声所填充的 3D 纹理。" + +msgid "" +"Uses the [FastNoiseLite] library or other noise generators to fill the " +"texture data of your desired size.\n" +"The class uses [Thread]s to generate the texture data internally, so [method " +"Texture3D.get_data] may return [code]null[/code] if the generation process " +"has not completed yet. In that case, you need to wait for the texture to be " +"generated before accessing the image:\n" +"[codeblock]\n" +"var texture = NoiseTexture3D.new()\n" +"texture.noise = FastNoiseLite.new()\n" +"await texture.changed\n" +"var data = texture.get_data()\n" +"[/codeblock]" +msgstr "" +"使用 [FastNoiseLite] 库或其他噪声生成器来填充所需大小的纹理数据。\n" +"该类在内部使用 [Thread] 生成纹理数据,因此如果生成过程尚未完成,[method " +"Texture3D.get_data] 可能会返回 [code]null[/code]。在这种情况下,需要等待纹理生" +"成后再访问图像:\n" +"[codeblock]\n" +"var texture = NoiseTexture3D.new()\n" +"texture.noise = FastNoiseLite.new()\n" +"await texture.changed\n" +"var data = texture.get_data()\n" +"[/codeblock]" + msgid "Depth of the generated texture (in pixels)." msgstr "生成的纹理的深度(单位为像素)。" @@ -69414,6 +76801,103 @@ msgstr "" msgid "Base class for all other classes in the engine." msgstr "引擎中所有其他类的基类。" +msgid "" +"An advanced [Variant] type. All classes in the engine inherit from Object. " +"Each class may define new properties, methods or signals, which are available " +"to all inheriting classes. For example, a [Sprite2D] instance is able to call " +"[method Node.add_child] because it inherits from [Node].\n" +"You can create new instances, using [code]Object.new()[/code] in GDScript, or " +"[code]new GodotObject[/code] in C#.\n" +"To delete an Object instance, call [method free]. This is necessary for most " +"classes inheriting Object, because they do not manage memory on their own, " +"and will otherwise cause memory leaks when no longer in use. There are a few " +"classes that perform memory management. For example, [RefCounted] (and by " +"extension [Resource]) deletes itself when no longer referenced, and [Node] " +"deletes its children when freed.\n" +"Objects can have a [Script] attached to them. Once the [Script] is " +"instantiated, it effectively acts as an extension to the base class, allowing " +"it to define and inherit new properties, methods and signals.\n" +"Inside a [Script], [method _get_property_list] may be overridden to customize " +"properties in several ways. This allows them to be available to the editor, " +"display as lists of options, sub-divide into groups, save on disk, etc. " +"Scripting languages offer easier ways to customize properties, such as with " +"the [annotation @GDScript.@export] annotation.\n" +"Godot is very dynamic. An object's script, and therefore its properties, " +"methods and signals, can be changed at run-time. Because of this, there can " +"be occasions where, for example, a property required by a method may not " +"exist. To prevent run-time errors, see methods such as [method set], [method " +"get], [method call], [method has_method], [method has_signal], etc. Note that " +"these methods are [b]much[/b] slower than direct references.\n" +"In GDScript, you can also check if a given property, method, or signal name " +"exists in an object with the [code]in[/code] operator:\n" +"[codeblock]\n" +"var node = Node.new()\n" +"print(\"name\" in node) # Prints true\n" +"print(\"get_parent\" in node) # Prints true\n" +"print(\"tree_entered\" in node) # Prints true\n" +"print(\"unknown\" in node) # Prints false\n" +"[/codeblock]\n" +"Notifications are [int] constants commonly sent and received by objects. For " +"example, on every rendered frame, the [SceneTree] notifies nodes inside the " +"tree with a [constant Node.NOTIFICATION_PROCESS]. The nodes receive it and " +"may call [method Node._process] to update. To make use of notifications, see " +"[method notification] and [method _notification].\n" +"Lastly, every object can also contain metadata (data about data). [method " +"set_meta] can be useful to store information that the object itself does not " +"depend on. To keep your code clean, making excessive use of metadata is " +"discouraged.\n" +"[b]Note:[/b] Unlike references to a [RefCounted], references to an object " +"stored in a variable can become invalid without being set to [code]null[/" +"code]. To check if an object has been deleted, do [i]not[/i] compare it " +"against [code]null[/code]. Instead, use [method @GlobalScope." +"is_instance_valid]. It's also recommended to inherit from [RefCounted] for " +"classes storing data instead of [Object].\n" +"[b]Note:[/b] The [code]script[/code] is not exposed like most properties. To " +"set or get an object's [Script] in code, use [method set_script] and [method " +"get_script], respectively." +msgstr "" +"一种高级的 [Variant] 类型。引擎中的所有类都继承自 Object。每个类都可以定义新的" +"属性、方法或信号,并且这些对所有继承的类都可用。例如,一个 [Sprite2D] 实例能够" +"调用 [method Node.add_child] 因为它继承自 [Node]。\n" +"可以使用 GDScript 中的 [code]Object.new()[/code] 或 C# 中的 [code]new " +"GodotObject[/code] 来创建新实例。\n" +"要删除一个 Object 实例,请调用 [method free]。这对于大多数继承 Object 的类来说" +"是必须的,因为它们本身并不管理内存,如果不调用该方法的话,在不再使用时会造成内" +"存泄漏。有几个类会执行内存管理。例如,[RefCounted](以及扩展的 [Resource])在" +"不再被引用时删除自身,而 [Node] 在释放时会删除其子节点。\n" +"对象可以附加一个 [Script]。一旦该 [Script] 被实例化,它就有效地充当了基类的扩" +"展,允许它定义和继承新的属性、方法和信号。\n" +"在 [Script] 中,[method _get_property_list] 可以被可以重写,以通过多种方式自定" +"义属性。这允许它们对编辑器可用,显示为选项列表,细分为组,保存在磁盘上,等等。" +"脚本语言提供更简单的方式来自定义属性,例如使用 [annotation @GDScript.@export] " +"注解。\n" +"Godot 是非常动态的。一个对象的脚本,以及它的属性、方法和信号,都可以在运行时改" +"变。正因为如此,可能会出现这样的情况,例如,一个方法所需的属性可能不存在。为了" +"防止运行时出错,可以参考 [method set]、[method get]、[method call]、[method " +"has_method]、[method has_signal] 等方法。请注意,这些方法比直接引用慢[b]得多[/" +"b]。\n" +"在 GDScript 中,还可以使用 [code]in[/code] 运算符来检查对象中是否存在给定的属" +"性、方法或信号名称:\n" +"[codeblock]\n" +"var node = Node.new()\n" +"print(\"name\" in node) # 输出 true\n" +"print(\"get_parent\" in node) # 输出 true\n" +"print(\"tree_entered\" in node) # 输出 true\n" +"print(\"unknown\" in node) # 输出 false\n" +"[/codeblock]\n" +"通知是 [int] 常量,通常由对象发送和接收。例如,在每个渲染帧上,[SceneTree] 使" +"用 [constant Node.NOTIFICATION_PROCESS] 通知树内的节点。节点收到它后,可以调" +"用 [method Node._process] 进行更新。要使用通知,请参阅 [method notification] " +"和 [method _notification]。\n" +"最后,每个对象还可以包含元数据(关于数据的数据)。[method set_meta] 可用于存储" +"对象本身不依赖的信息。为了保持代码整洁,不鼓励过度使用元数据。\n" +"[b]注意:[/b]与对 [RefCounted] 的引用不同,对存储在变量中的对象的引用,可能会" +"在未被设置为 [code]null[/code] 的情况下变得无效。要检查对象是否已被删除,请[i]" +"不要[/i]将其与 [code]null[/code] 进行比较。而是使用 [method @GlobalScope." +"is_instance_valid]。存储数据的类,建议从 [RefCounted] 继承而不是 [Object]。\n" +"[b]注意:[/b][code]script[/code] 不像大多数属性那样公开。要在代码中设置或获取" +"一个对象的 [Script],请分别使用 [method set_script] 和 [method get_script]。" + msgid "Object class introduction" msgstr "Object 类介绍" @@ -69424,6 +76908,95 @@ msgid "Object notifications" msgstr "对象通知" msgid "" +"Override this method to customize the behavior of [method get]. Should return " +"the given [param property]'s value, or [code]null[/code] if the [param " +"property] should be handled normally.\n" +"Combined with [method _set] and [method _get_property_list], this method " +"allows defining custom properties, which is particularly useful for editor " +"plugins. Note that a property must be present in [method get_property_list], " +"otherwise this method will not be called.\n" +"[codeblocks]\n" +"[gdscript]\n" +"func _get(property):\n" +" if property == \"fake_property\":\n" +" print(\"Getting my property!\")\n" +" return 4\n" +"\n" +"func _get_property_list():\n" +" return [\n" +" { \"name\": \"fake_property\", \"type\": TYPE_INT }\n" +" ]\n" +"[/gdscript]\n" +"[csharp]\n" +"public override Variant _Get(StringName property)\n" +"{\n" +" if (property == \"FakeProperty\")\n" +" {\n" +" GD.Print(\"Getting my property!\");\n" +" return 4;\n" +" }\n" +" return default;\n" +"}\n" +"\n" +"public override Godot.Collections.Array<Godot.Collections.Dictionary> " +"_GetPropertyList()\n" +"{\n" +" return new Godot.Collections.Array<Godot.Collections.Dictionary>()\n" +" {\n" +" new Godot.Collections.Dictionary()\n" +" {\n" +" { \"name\", \"FakeProperty\" },\n" +" { \"type\", (int)Variant.Type.Int }\n" +" }\n" +" };\n" +"}\n" +"[/csharp]\n" +"[/codeblocks]" +msgstr "" +"覆盖该方法以自定义 [method get] 的行为。应该返回给定的 [param property] 的值," +"或者 [param property] 应该被正常处理时返回 [code]null[/code]。\n" +"结合 [method _set] 和 [method _get_property_list],该方法允许定义自定义属性," +"这对编辑器插件特别有用。请注意,属性必须存在于 [method get_property_list] 中," +"否则该方法不会被调用。\n" +"[codeblocks]\n" +"[gdscript]\n" +"func _get(property):\n" +" if property == \"fake_property\":\n" +" print(\"正在获取我的属性!\")\n" +" return 4\n" +"\n" +"func _get_property_list():\n" +" return [\n" +" { \"name\": \"fake_property\", \"type\": TYPE_INT }\n" +" ]\n" +"[/gdscript]\n" +"[csharp]\n" +"public override Variant _Get(StringName property)\n" +"{\n" +" if (property == \"FakeProperty\")\n" +" {\n" +" GD.Print(\"正在获取我的属性!\");\n" +" return 4;\n" +" }\n" +" return default;\n" +"}\n" +"\n" +"public override Godot.Collections.Array<Godot.Collections.Dictionary> " +"_GetPropertyList()\n" +"{\n" +" return new Godot.Collections.Array<Godot.Collections.Dictionary>()\n" +" {\n" +" new Godot.Collections.Dictionary()\n" +" {\n" +" { \"name\", \"FakeProperty\" },\n" +" { \"type\", (int)Variant.Type.Int }\n" +" }\n" +" };\n" +"}\n" +"[/csharp]\n" +"[/codeblocks]" + +msgid "" "Override this method to customize how script properties should be handled by " "the engine.\n" "Should return a property list, as an [Array] of dictionaries. The result is " @@ -69602,6 +77175,24 @@ msgstr "" "器中不会被调用。" msgid "" +"Called when the object's script is instantiated, oftentimes after the object " +"is initialized in memory (through [code]Object.new()[/code] in GDScript, or " +"[code]new GodotObject[/code] in C#). It can be also defined to take in " +"parameters. This method is similar to a constructor in most programming " +"languages.\n" +"[b]Note:[/b] If [method _init] is defined with [i]required[/i] parameters, " +"the Object with script may only be created directly. If any other means (such " +"as [method PackedScene.instantiate] or [method Node.duplicate]) are used, the " +"script's initialization will fail." +msgstr "" +"实例化对象的脚本时调用,通常是在对象在内存中初始化之后(通过 GDScript 中的 " +"[code]Object.new()[/code] 或 C# 中的 [code]new GodotObject[/code])。也可以将" +"其定义为接受参数的形式。该方法类似于大多数编程语言中的构造函数。\n" +"[b]注意:[/b]如果为 [method _init] 定义了[i]必填的[/i]参数,则带脚本的 Object " +"只能直接创建。使用任何其他方式(例如 [method PackedScene.instantiate] 或 " +"[method Node.duplicate])创建时,该脚本的初始化都将失败。" + +msgid "" "Called when the object receives a notification, which can be identified in " "[param what] by comparing it with a constant. See also [method " "notification].\n" @@ -69675,6 +77266,117 @@ msgstr "" "[b]注意:[/b][method _property_can_revert] 也必须被覆盖,该方法才能被调用。" msgid "" +"Override this method to customize the behavior of [method set]. Should set " +"the [param property] to [param value] and return [code]true[/code], or " +"[code]false[/code] if the [param property] should be handled normally. The " +"[i]exact[/i] way to set the [param property] is up to this method's " +"implementation.\n" +"Combined with [method _get] and [method _get_property_list], this method " +"allows defining custom properties, which is particularly useful for editor " +"plugins. Note that a property [i]must[/i] be present in [method " +"get_property_list], otherwise this method will not be called.\n" +"[codeblocks]\n" +"[gdscript]\n" +"var internal_data = {}\n" +"\n" +"func _set(property, value):\n" +" if property == \"fake_property\":\n" +" # Storing the value in the fake property.\n" +" internal_data[\"fake_property\"] = value\n" +" return true\n" +" return false\n" +"\n" +"func _get_property_list():\n" +" return [\n" +" { \"name\": \"fake_property\", \"type\": TYPE_INT }\n" +" ]\n" +"[/gdscript]\n" +"[csharp]\n" +"private Godot.Collections.Dictionary _internalData = new Godot.Collections." +"Dictionary();\n" +"\n" +"public override bool _Set(StringName property, Variant value)\n" +"{\n" +" if (property == \"FakeProperty\")\n" +" {\n" +" // Storing the value in the fake property.\n" +" _internalData[\"FakeProperty\"] = value;\n" +" return true;\n" +" }\n" +"\n" +" return false;\n" +"}\n" +"\n" +"public override Godot.Collections.Array<Godot.Collections.Dictionary> " +"_GetPropertyList()\n" +"{\n" +" return new Godot.Collections.Array<Godot.Collections.Dictionary>()\n" +" {\n" +" new Godot.Collections.Dictionary()\n" +" {\n" +" { \"name\", \"FakeProperty\" },\n" +" { \"type\", (int)Variant.Type.Int }\n" +" }\n" +" };\n" +"}\n" +"[/csharp]\n" +"[/codeblocks]" +msgstr "" +"覆盖该方法以自定义 [method set] 的行为。应将 [param property] 设置为 [param " +"value] 并返回 [code]true[/code],如果 [param property] 正常处理则返回 " +"[code]false[/code]。设置 [param property] 的[i]确切[/i]方式取决于该方法的实" +"现。\n" +"结合 [method _get] 和 [method _get_property_list],该方法允许定义自定义属性," +"这对编辑器插件特别有用。注意属性[i]必须[/i]在 [method get_property_list] 中存" +"在,否则该方法将不会被调用。\n" +"[codeblocks]\n" +"[gdscript]\n" +"var internal_data = {}\n" +"\n" +"func _set(property, value):\n" +" if property == \"fake_property\":\n" +" # 在冒牌属性中存值。\n" +" internal_data[\"fake_property\"] = value\n" +" return true\n" +" return false\n" +"\n" +"func _get_property_list():\n" +" return [\n" +" { \"name\": \"fake_property\", \"type\": TYPE_INT }\n" +" ]\n" +"[/gdscript]\n" +"[csharp]\n" +"private Godot.Collections.Dictionary _internalData = new Godot.Collections." +"Dictionary();\n" +"\n" +"public override bool _Set(StringName property, Variant value)\n" +"{\n" +" if (property == \"FakeProperty\")\n" +" {\n" +" // 在冒牌属性中存值。\n" +" _internalData[\"FakeProperty\"] = value;\n" +" return true;\n" +" }\n" +"\n" +" return false;\n" +"}\n" +"\n" +"public override Godot.Collections.Array<Godot.Collections.Dictionary> " +"_GetPropertyList()\n" +"{\n" +" return new Godot.Collections.Array<Godot.Collections.Dictionary>()\n" +" {\n" +" new Godot.Collections.Dictionary()\n" +" {\n" +" { \"name\", \"FakeProperty\" },\n" +" { \"type\", (int)Variant.Type.Int }\n" +" }\n" +" };\n" +"}\n" +"[/csharp]\n" +"[/codeblocks]" + +msgid "" "Override this method to customize the return value of [method to_string], and " "therefore the object's representation as a [String].\n" "[codeblock]\n" @@ -69698,6 +77400,112 @@ msgstr "" "[/codeblock]" msgid "" +"Override this method to customize existing properties. Every property info " +"goes through this method. The dictionary contents is the same as in [method " +"_get_property_list].\n" +"[codeblocks]\n" +"[gdscript]\n" +"@tool\n" +"extends Node\n" +"\n" +"@export var is_number_editable: bool:\n" +" set(value):\n" +" is_number_editable = value\n" +" notify_property_list_changed()\n" +"@export var number: int\n" +"\n" +"func _validate_property(property: Dictionary):\n" +" if property.name == \"number\" and not is_number_editable:\n" +" property.usage |= PROPERTY_USAGE_READ_ONLY\n" +"[/gdscript]\n" +"[csharp]\n" +"[Tool]\n" +"public partial class MyNode : Node\n" +"{\n" +" private bool _isNumberEditable;\n" +"\n" +" [Export]\n" +" public bool IsNumberEditable\n" +" {\n" +" get => _isNumberEditable;\n" +" set\n" +" {\n" +" _isNumberEditable = value;\n" +" NotifyPropertyListChanged();\n" +" }\n" +" }\n" +"\n" +" [Export]\n" +" public int Number { get; set; }\n" +"\n" +" public override void _ValidateProperty(Godot.Collections.Dictionary " +"property)\n" +" {\n" +" if (property[\"name\"].AsStringName() == PropertyName.Number && " +"IsNumberEditable)\n" +" {\n" +" var usage = property[\"usage\"].As>PropertyUsageFlags<() | " +"PropertyUsageFlags.ReadOnly;\n" +" property[\"usage\"] = (int)usage;\n" +" }\n" +" }\n" +"}\n" +"[/csharp]\n" +"[/codeblocks]" +msgstr "" +"覆盖该方法以自定义已有属性。每个属性信息都经过该方法。字典内容与 [method " +"_get_property_list] 中的相同。\n" +"[codeblocks]\n" +"[gdscript]\n" +"@tool\n" +"extends Node\n" +"\n" +"@export var is_number_editable: bool:\n" +" set(value):\n" +" is_number_editable = value\n" +" notify_property_list_changed()\n" +"@export var number: int\n" +"\n" +"func _validate_property(property: Dictionary):\n" +" if property.name == \"number\" and not is_number_editable:\n" +" property.usage |= PROPERTY_USAGE_READ_ONLY\n" +"[/gdscript]\n" +"[csharp]\n" +"[Tool]\n" +"public partial class MyNode : Node\n" +"{\n" +" private bool _isNumberEditable;\n" +"\n" +" [Export]\n" +" public bool IsNumberEditable\n" +" {\n" +" get => _isNumberEditable;\n" +" set\n" +" {\n" +" _isNumberEditable = value;\n" +" NotifyPropertyListChanged();\n" +" }\n" +" }\n" +"\n" +" [Export]\n" +" public int Number { get; set; }\n" +"\n" +" public override void _ValidateProperty(Godot.Collections.Dictionary " +"property)\n" +" {\n" +" if (property[\"name\"].AsStringName() == PropertyName.Number && " +"IsNumberEditable)\n" +" {\n" +" var usage = property[\"usage\"].As>PropertyUsageFlags<() | " +"PropertyUsageFlags.ReadOnly;\n" +" property[\"usage\"] = (int)usage;\n" +" }\n" +" }\n" +"}\n" +"[/csharp]\n" +"[/codeblocks]" + +msgid "" "Adds a user-defined [param signal]. Optional arguments for the signal can be " "added as an [Array] of dictionaries, each defining a [code]name[/code] " "[String] and a [code]type[/code] [int] (see [enum Variant.Type]). See also " @@ -69917,6 +77725,337 @@ msgstr "" "对象。" msgid "" +"Connects a [param signal] by name to a [param callable]. Optional [param " +"flags] can be also added to configure the connection's behavior (see [enum " +"ConnectFlags] constants).\n" +"A signal can only be connected once to the same [Callable]. If the signal is " +"already connected, this method returns [constant ERR_INVALID_PARAMETER] and " +"pushes an error message, unless the signal is connected with [constant " +"CONNECT_REFERENCE_COUNTED]. To prevent this, use [method is_connected] first " +"to check for existing connections.\n" +"If the [param callable]'s object is freed, the connection will be lost.\n" +"[b]Examples with recommended syntax:[/b]\n" +"Connecting signals is one of the most common operations in Godot and the API " +"gives many options to do so, which are described further down. The code block " +"below shows the recommended approach.\n" +"[codeblocks]\n" +"[gdscript]\n" +"func _ready():\n" +" var button = Button.new()\n" +" # `button_down` here is a Signal variant type, and we thus call the " +"Signal.connect() method, not Object.connect().\n" +" # See discussion below for a more in-depth overview of the API.\n" +" button.button_down.connect(_on_button_down)\n" +"\n" +" # This assumes that a `Player` class exists, which defines a `hit` " +"signal.\n" +" var player = Player.new()\n" +" # We use Signal.connect() again, and we also use the Callable.bind() " +"method,\n" +" # which returns a new Callable with the parameter binds.\n" +" player.hit.connect(_on_player_hit.bind(\"sword\", 100))\n" +"\n" +"func _on_button_down():\n" +" print(\"Button down!\")\n" +"\n" +"func _on_player_hit(weapon_type, damage):\n" +" print(\"Hit with weapon %s for %d damage.\" % [weapon_type, damage])\n" +"[/gdscript]\n" +"[csharp]\n" +"public override void _Ready()\n" +"{\n" +" var button = new Button();\n" +" // C# supports passing signals as events, so we can use this idiomatic " +"construct:\n" +" button.ButtonDown += OnButtonDown;\n" +"\n" +" // This assumes that a `Player` class exists, which defines a `Hit` " +"signal.\n" +" var player = new Player();\n" +" // We can use lambdas when we need to bind additional parameters.\n" +" player.Hit += () => OnPlayerHit(\"sword\", 100);\n" +"}\n" +"\n" +"private void OnButtonDown()\n" +"{\n" +" GD.Print(\"Button down!\");\n" +"}\n" +"\n" +"private void OnPlayerHit(string weaponType, int damage)\n" +"{\n" +" GD.Print($\"Hit with weapon {weaponType} for {damage} damage.\");\n" +"}\n" +"[/csharp]\n" +"[/codeblocks]\n" +"[b][code skip-lint]Object.connect()[/code] or [code skip-lint]Signal.connect()" +"[/code]?[/b]\n" +"As seen above, the recommended method to connect signals is not [method " +"Object.connect]. The code block below shows the four options for connecting " +"signals, using either this legacy method or the recommended [method Signal." +"connect], and using either an implicit [Callable] or a manually defined one.\n" +"[codeblocks]\n" +"[gdscript]\n" +"func _ready():\n" +" var button = Button.new()\n" +" # Option 1: Object.connect() with an implicit Callable for the defined " +"function.\n" +" button.connect(\"button_down\", _on_button_down)\n" +" # Option 2: Object.connect() with a constructed Callable using a target " +"object and method name.\n" +" button.connect(\"button_down\", Callable(self, \"_on_button_down\"))\n" +" # Option 3: Signal.connect() with an implicit Callable for the defined " +"function.\n" +" button.button_down.connect(_on_button_down)\n" +" # Option 4: Signal.connect() with a constructed Callable using a target " +"object and method name.\n" +" button.button_down.connect(Callable(self, \"_on_button_down\"))\n" +"\n" +"func _on_button_down():\n" +" print(\"Button down!\")\n" +"[/gdscript]\n" +"[csharp]\n" +"public override void _Ready()\n" +"{\n" +" var button = new Button();\n" +" // Option 1: In C#, we can use signals as events and connect with this " +"idiomatic syntax:\n" +" button.ButtonDown += OnButtonDown;\n" +" // Option 2: GodotObject.Connect() with a constructed Callable from a " +"method group.\n" +" button.Connect(Button.SignalName.ButtonDown, Callable." +"From(OnButtonDown));\n" +" // Option 3: GodotObject.Connect() with a constructed Callable using a " +"target object and method name.\n" +" button.Connect(Button.SignalName.ButtonDown, new Callable(this, " +"MethodName.OnButtonDown));\n" +"}\n" +"\n" +"private void OnButtonDown()\n" +"{\n" +" GD.Print(\"Button down!\");\n" +"}\n" +"[/csharp]\n" +"[/codeblocks]\n" +"While all options have the same outcome ([code]button[/code]'s [signal " +"BaseButton.button_down] signal will be connected to [code]_on_button_down[/" +"code]), [b]option 3[/b] offers the best validation: it will print a compile-" +"time error if either the [code]button_down[/code] [Signal] or the " +"[code]_on_button_down[/code] [Callable] are not defined. On the other hand, " +"[b]option 2[/b] only relies on string names and will only be able to validate " +"either names at runtime: it will print a runtime error if " +"[code]\"button_down\"[/code] doesn't correspond to a signal, or if " +"[code]\"_on_button_down\"[/code] is not a registered method in the object " +"[code]self[/code]. The main reason for using options 1, 2, or 4 would be if " +"you actually need to use strings (e.g. to connect signals programmatically " +"based on strings read from a configuration file). Otherwise, option 3 is the " +"recommended (and fastest) method.\n" +"[b]Binding and passing parameters:[/b]\n" +"The syntax to bind parameters is through [method Callable.bind], which " +"returns a copy of the [Callable] with its parameters bound.\n" +"When calling [method emit_signal], the signal parameters can be also passed. " +"The examples below show the relationship between these signal parameters and " +"bound parameters.\n" +"[codeblocks]\n" +"[gdscript]\n" +"func _ready():\n" +" # This assumes that a `Player` class exists, which defines a `hit` " +"signal.\n" +" var player = Player.new()\n" +" # Using Callable.bind().\n" +" player.hit.connect(_on_player_hit.bind(\"sword\", 100))\n" +"\n" +" # Parameters added when emitting the signal are passed first.\n" +" player.emit_signal(\"hit\", \"Dark lord\", 5)\n" +"\n" +"# We pass two arguments when emitting (`hit_by`, `level`),\n" +"# and bind two more arguments when connecting (`weapon_type`, `damage`).\n" +"func _on_player_hit(hit_by, level, weapon_type, damage):\n" +" print(\"Hit by %s (level %d) with weapon %s for %d damage.\" % [hit_by, " +"level, weapon_type, damage])\n" +"[/gdscript]\n" +"[csharp]\n" +"public override void _Ready()\n" +"{\n" +" // This assumes that a `Player` class exists, which defines a `Hit` " +"signal.\n" +" var player = new Player();\n" +" // Using lambda expressions that create a closure that captures the " +"additional parameters.\n" +" // The lambda only receives the parameters defined by the signal's " +"delegate.\n" +" player.Hit += (hitBy, level) => OnPlayerHit(hitBy, level, \"sword\", " +"100);\n" +"\n" +" // Parameters added when emitting the signal are passed first.\n" +" player.EmitSignal(SignalName.Hit, \"Dark lord\", 5);\n" +"}\n" +"\n" +"// We pass two arguments when emitting (`hit_by`, `level`),\n" +"// and bind two more arguments when connecting (`weapon_type`, `damage`).\n" +"private void OnPlayerHit(string hitBy, int level, string weaponType, int " +"damage)\n" +"{\n" +" GD.Print($\"Hit by {hitBy} (level {level}) with weapon {weaponType} for " +"{damage} damage.\");\n" +"}\n" +"[/csharp]\n" +"[/codeblocks]" +msgstr "" +"按名称将 [param signal] 连接到 [param callable]。还可以添加可选的 [param " +"flags] 来配置该连接的行为(请参阅 [enum ConnectFlags] 常量)。\n" +"一个信号只能连接到同一个 [Callable] 一次。如果该信号已经连接,除非该信号是使" +"用 [constant CONNECT_REFERENCE_COUNTED] 连接的,否则该方法会返回 [constant " +"ERR_INVALID_PARAMETER] 并推送一条错误消息。为防止这种情况,请首先使用 [method " +"is_connected] 检查已存在的连接。\n" +"如果 [param callable] 的对象被释放,则该连接将会丢失。\n" +"[b]推荐语法的示例:[/b]\n" +"连接信号是 Godot 中最常见的操作之一,API 提供了许多这样做的选项,这些选项将在" +"下面进一步介绍。下面的代码块显示了推荐的方法。\n" +"[codeblocks]\n" +"[gdscript]\n" +"func _ready():\n" +" var button = Button.new()\n" +" # 这里的 `button_down` 是一个 Signal 变体类型,因此我们调用 Signal." +"connect() 方法,而不是 Object.connect()。\n" +" # 请参阅下面的讨论以更深入地了解该 API。\n" +" button.button_down.connect(_on_button_down)\n" +"\n" +" # 这假设存在一个“Player”类,它定义了一个“hit”信号。\n" +" var player = Player.new()\n" +" # 我们再次使用 Signal.connect() ,并且我们还使用了 Callable.bind() 方" +"法,\n" +" # 它返回一个带有参数绑定的新 Callable。\n" +" player.hit.connect(_on_player_hit.bind(\"剑\", 100))\n" +"\n" +"func _on_button_down():\n" +" print(\"按钮按下!\")\n" +"\n" +"func _on_player_hit(weapon_type, damage):\n" +" print(\"用武器 %s 击中,造成 %d 伤害。\" % [weapon_type, damage])\n" +"[/gdscript]\n" +"[csharp]\n" +"public override void _Ready()\n" +"{\n" +" var button = new Button();\n" +" // C# 支持将信号作为事件传递,因此我们可以使用这个惯用的构造:\n" +" button.ButtonDown += OnButtonDown;\n" +"\n" +" // 这假设存在一个“Player”类,它定义了一个“Hit”信号。\n" +" var player = new Player();\n" +" // 当我们需要绑定额外的参数时,我们可以使用 Lambda 表达式。\n" +" player.Hit += () => OnPlayerHit(\"剑\", 100);\n" +"}\n" +"\n" +"private void OnButtonDown()\n" +"{\n" +" GD.Print(\"按钮按下!\");\n" +"}\n" +"\n" +"private void OnPlayerHit(string weaponType, int damage)\n" +"{\n" +" GD.Print($\"用武器 {weaponType} 击中,造成 {damage} 伤害。\");\n" +"}\n" +"[/csharp]\n" +"[/codeblocks]\n" +"[b][code skip-lint]Object.connect()[/code] 还是 [code skip-lint]Signal." +"connect()[/code]?[/b]\n" +"如上所示,推荐的连接信号的方法不是 [method Object.connect]。下面的代码块显示了" +"连接信号的四个选项,使用该传统方法或推荐的 [method Signal.connect],并使用一个" +"隐式的 [Callable] 或手动定义的 [Callable]。\n" +"[codeblocks]\n" +"[gdscript]\n" +"func _ready():\n" +" var button = Button.new()\n" +" # 选项 1:Object.connect() 并使用已定义的函数的隐式 Callable。\n" +" button.connect(\"button_down\", _on_button_down)\n" +" # 选项 2:Object.connect() 并使用由目标对象和方法名称构造的 Callable。\n" +" button.connect(\"button_down\", Callable(self, \"_on_button_down\"))\n" +" # 选项 3:Signal.connect() 并使用已定义的函数的隐式 Callable。\n" +" button.button_down.connect(_on_button_down)\n" +" # 选项 4:Signal.connect() 并使用由目标对象和方法名称构造的 Callable。\n" +" button.button_down.connect(Callable(self, \"_on_button_down\"))\n" +"\n" +"func _on_button_down():\n" +" print(\"按钮按下!\")\n" +"[/gdscript]\n" +"[csharp]\n" +"public override void _Ready()\n" +"{\n" +" var button = new Button();\n" +" // 选项 1:在 C# 中,我们可以将信号用作事件并使用以下惯用语法进行连接:\n" +" button.ButtonDown += OnButtonDown;\n" +" // 选项 2:GodotObject.Connect() 并使用从方法组构造的 Callable。\n" +" button.Connect(Button.SignalName.ButtonDown, Callable." +"From(OnButtonDown));\n" +" // 选项 3:GodotObject.Connect() 并使用由目标对象和方法名称构造的 " +"Callable。\n" +" button.Connect(Button.SignalName.ButtonDown, new Callable(this, " +"MethodName.OnButtonDown));\n" +"}\n" +"\n" +"private void OnButtonDown()\n" +"{\n" +" GD.Print(\"按钮按下!\");\n" +"}\n" +"[/csharp]\n" +"[/codeblocks]\n" +"虽然所有选项都有相同的结果([code]button[/code] 的 [signal BaseButton." +"button_down] 信号将被连接到 [code]_on_button_down[/code]),但[b]选项 3[/b] 提" +"供了最好的验证:如果 [code]button_down[/code] [Signal] 或 " +"[code]_on_button_down[/code] [Callable] 没有被定义,它将打印一个编译时错误。另" +"一方面,[b]选项 2[/b] 只依赖于字符串名称,并且只能在运行时验证这两个名称:如" +"果 [code]\"button_down\"[/code] 不对应于一个信号,或者如果 " +"[code]\"_on_button_down\"[/code] 不是对象 [code]self[/code] 中的注册方法,它将" +"打印一个运行时错误。使用选项 1、2 或 4 的主要原因,是你是否确实需要使用字符串" +"(例如,根据从配置文件读取的字符串,以编程的方式连接信号)。否则,选项 3 是推" +"荐的(也是最快的)方法。\n" +"[b]绑定和传递参数:[/b]\n" +"绑定参数的语法是通过 [method Callable.bind],它返回一个绑定了参数的 " +"[Callable] 的副本。\n" +"当调用 [method emit_signal] 时,信号参数也可以被传递。下面的示例显示了这些信号" +"参数和绑定参数之间的关系。\n" +"[codeblocks]\n" +"[gdscript]\n" +"func _ready():\n" +" # 这假设存在一个 `Player` 类,它定义了一个 `hit` 信号。\n" +" var player = Player.new()\n" +" # 使用 Callable.bind()。\n" +" player.hit.connect(_on_player_hit.bind(\"剑\", 100))\n" +"\n" +" # 发出信号时添加的参数首先被传递。\n" +" player.emit_signal(\"hit\", \"黑暗领主\", 5)\n" +"\n" +"# 我们在发出时传递两个参数(`hit_by`,`level`),\n" +"# 并在连接时再绑定两个参数(`weapon_type`、`damage`)。\n" +"func _on_player_hit(hit_by, level, weapon_type, damage):\n" +" print(\"被 %s(等级 %d)用武器 %s 击中,造成 %d 伤害。\" % [hit_by, " +"level, weapon_type, damage])\n" +"[/gdscript]\n" +"[csharp]\n" +"public override void _Ready()\n" +"{\n" +" // 这假设存在一个 `Player` 类,它定义了一个 `Hit` 信号。\n" +" var player = new Player();\n" +" // 使用 lambda 表达式创建一个闭包来捕获额外的参数。\n" +" // lambda 仅接收由信号委托定义的参数。\n" +" player.Hit += (hitBy, level) => OnPlayerHit(hitBy, level, \"剑\", 100);\n" +"\n" +" // 发出信号时添加的参数首先被传递。\n" +" player.EmitSignal(SignalName.Hit, \"黑暗领主\", 5);\n" +"}\n" +"\n" +"// 我们在发出时传递两个参数(`hit_by`,`level`),\n" +"// 并在连接时再绑定两个参数(`weapon_type`、`damage`)。\n" +"private void OnPlayerHit(string hitBy, int level, string weaponType, int " +"damage)\n" +"{\n" +" GD.Print($\"被 {hitBy}(等级 {level})用武器 {weaponType} 击中,造成 " +"{damage} 伤害。\");\n" +"}\n" +"[/csharp]\n" +"[/codeblocks]" + +msgid "" "Disconnects a [param signal] by name from a given [param callable]. If the " "connection does not exist, generates an error. Use [method is_connected] to " "make sure that the connection exists." @@ -70098,6 +78237,25 @@ msgstr "" "返回该对象的唯一实例 ID。该 ID 可以保存在 [EncodedObjectAsID] 中,并可用于 " "[method @GlobalScope.instance_from_id],来检索该对象实例。" +msgid "" +"Returns the object's metadata value for the given entry [param name]. If the " +"entry does not exist, returns [param default]. If [param default] is " +"[code]null[/code], an error is also generated.\n" +"[b]Note:[/b] A metadata's name must be a valid identifier as per [method " +"StringName.is_valid_identifier] method.\n" +"[b]Note:[/b] Metadata that has a name starting with an underscore ([code]_[/" +"code]) is considered editor-only. Editor-only metadata is not displayed in " +"the Inspector and should not be edited, although it can still be found by " +"this method." +msgstr "" +"返回该对象的元数据中名称为 [param name] 的条目。如果不存在该条目,则返回 " +"[param default]。如果 [param default] 为 [code]null[/code],则还会生成错误。\n" +"[b]注意:[/b]元数据的名称必须是符合 [method StringName.is_valid_identifier] 的" +"有效标识符。\n" +"[b]注意:[/b]名称以下划线([code]_[/code])开头的元数据仅供编辑器使用。仅供编" +"辑器使用的元数据不会在“检查器”中显示,虽然仍然能够被这个方法找到,但是不应该进" +"行编辑。" + msgid "Returns the object's metadata entry names as a [PackedStringArray]." msgstr "将该对象的元数据作为 [PackedStringArray] 返回。" @@ -70128,12 +78286,53 @@ msgstr "" "get_property_list] 的结果相同,但不会用到所有条目。" msgid "" +"Returns the object's property list as an [Array] of dictionaries. Each " +"[Dictionary] contains the following entries:\n" +"- [code]name[/code] is the property's name, as a [String];\n" +"- [code]class_name[/code] is an empty [StringName], unless the property is " +"[constant TYPE_OBJECT] and it inherits from a class;\n" +"- [code]type[/code] is the property's type, as an [int] (see [enum Variant." +"Type]);\n" +"- [code]hint[/code] is [i]how[/i] the property is meant to be edited (see " +"[enum PropertyHint]);\n" +"- [code]hint_string[/code] depends on the hint (see [enum PropertyHint]);\n" +"- [code]usage[/code] is a combination of [enum PropertyUsageFlags].\n" +"[b]Note:[/b] In GDScript, all class members are treated as properties. In C# " +"and GDExtension, it may be necessary to explicitly mark class members as " +"Godot properties using decorators or attributes." +msgstr "" +"以字典 [Array] 的形式返回该对象的属性列表。每个 [Dictionary] 中都包含如下条" +"目:\n" +"- [code]name[/code] 是该属性的名称,类型为 [String];\n" +"- [code]class_name[/code] 为空 [StringName],除非该属性为 [constant " +"TYPE_OBJECT] 并继承自某个类;\n" +"- [code]type[/code] 是该属性的类型,类型为 [int](见 [enum Variant.Type]);\n" +"- [code]hint[/code] 是应当[i]如何[/i]编辑该属性(见 [enum PropertyHint]);\n" +"- [code]hint_string[/code] 取决于 hint(见 [enum PropertyHint]);\n" +"- [code]usage[/code] 是 [enum PropertyUsageFlags] 的组合。\n" +"[b]注意:[/b]在 GDScript 中,类的所有成员都被视为属性。在 C# 和 GDExtension " +"中,则需要使用装饰器或特性将类的成员显式标记为 Godot 属性。" + +msgid "" "Returns the object's [Script] instance, or [code]null[/code] if no script is " "attached." msgstr "" "返回该对象的 [Script] 实例,如果没有附加脚本,则返回 [code]null[/code]。" msgid "" +"Returns an [Array] of connections for the given [param signal] name. Each " +"connection is represented as a [Dictionary] that contains three entries:\n" +"- [code skip-lint]signal[/code] is a reference to the [Signal];\n" +"- [code]callable[/code] is a reference to the connected [Callable];\n" +"- [code]flags[/code] is a combination of [enum ConnectFlags]." +msgstr "" +"返回给定 [param signal] 名称的连接的 [Array]。每个连接都被表示为包含三个条目" +"的 [Dictionary]:\n" +"- [code skip-lint]signal[/code] 是对 [Signal] 的引用;\n" +"- [code]callable[/code] 是对已连接 [Callable] 的引用;\n" +"- [code]flags[/code] 是 [enum ConnectFlags] 的组合。" + +msgid "" "Returns the list of existing signals as an [Array] of dictionaries.\n" "[b]Note:[/b] Due of the implementation, each [Dictionary] is formatted very " "similarly to the returned values of [method get_method_list]." @@ -70143,6 +78342,25 @@ msgstr "" "get_method_list] 的返回值非常相似。" msgid "" +"Returns [code]true[/code] if a metadata entry is found with the given [param " +"name]. See also [method get_meta], [method set_meta] and [method " +"remove_meta].\n" +"[b]Note:[/b] A metadata's name must be a valid identifier as per [method " +"StringName.is_valid_identifier] method.\n" +"[b]Note:[/b] Metadata that has a name starting with an underscore ([code]_[/" +"code]) is considered editor-only. Editor-only metadata is not displayed in " +"the Inspector and should not be edited, although it can still be found by " +"this method." +msgstr "" +"如果找到名称为 [param name] 的元数据条目,则返回 [code]true[/code]。另请参阅 " +"[method get_meta]、[method set_meta] 和 [method remove_meta]。\n" +"[b]注意:[/b]元数据的名称必须是符合 [method StringName.is_valid_identifier] 的" +"有效标识符。\n" +"[b]注意:[/b]名称以下划线([code]_[/code])开头的元数据仅供编辑器使用。仅供编" +"辑器使用的元数据不会在“检查器”中显示,虽然仍然能够被这个方法找到,但是不应该进" +"行编辑。" + +msgid "" "Returns [code]true[/code] if the given [param method] name exists in the " "object.\n" "[b]Note:[/b] In C#, [param method] must be in snake_case when referring to " @@ -70333,6 +78551,24 @@ msgstr "" "_property_get_revert],则这个方法返回 [code]null[/code]。" msgid "" +"Removes the given entry [param name] from the object's metadata. See also " +"[method has_meta], [method get_meta] and [method set_meta].\n" +"[b]Note:[/b] A metadata's name must be a valid identifier as per [method " +"StringName.is_valid_identifier] method.\n" +"[b]Note:[/b] Metadata that has a name starting with an underscore ([code]_[/" +"code]) is considered editor-only. Editor-only metadata is not displayed in " +"the Inspector and should not be edited, although it can still be found by " +"this method." +msgstr "" +"从对象的元数据中移除名称为 [param name] 的条目。另请参阅 [method has_meta]、" +"[method get_meta]、和 [method set_meta]。\n" +"[b]注意:[/b]元数据的名称必须是符合 [method StringName.is_valid_identifier] 的" +"有效标识符。\n" +"[b]注意:[/b]名称以下划线([code]_[/code])开头的元数据仅供编辑器使用。仅供编" +"辑器使用的元数据不会在“检查器”中显示,虽然仍然能够被这个方法找到,但是不应该进" +"行编辑。" + +msgid "" "Assigns [param value] to the given [param property]. If the property does not " "exist or the given [param value]'s type doesn't match, nothing happens.\n" "[codeblocks]\n" @@ -70490,6 +78726,30 @@ msgstr "" "消息。该属性默认启用。另请参阅 [method can_translate_messages]。" msgid "" +"Adds or changes the entry [param name] inside the object's metadata. The " +"metadata [param value] can be any [Variant], although some types cannot be " +"serialized correctly.\n" +"If [param value] is [code]null[/code], the entry is removed. This is the " +"equivalent of using [method remove_meta]. See also [method has_meta] and " +"[method get_meta].\n" +"[b]Note:[/b] A metadata's name must be a valid identifier as per [method " +"StringName.is_valid_identifier] method.\n" +"[b]Note:[/b] Metadata that has a name starting with an underscore ([code]_[/" +"code]) is considered editor-only. Editor-only metadata is not displayed in " +"the Inspector and should not be edited, although it can still be found by " +"this method." +msgstr "" +"添加或更改对象元数据中名称为 [param name] 的条目。元数据值 [param value] 可以" +"是任何 [Variant],尽管某些类型无法正确序列化。\n" +"如果 [param value] 为 [code]null[/code],则该条目被移除。等价于使用 [method " +"remove_meta]。另见 [method has_meta] 和 [method get_meta]。\n" +"[b]注意:[/b]元数据的名称必须是符合 [method StringName.is_valid_identifier] 的" +"有效标识符。\n" +"[b]注意:[/b]名称以下划线([code]_[/code])开头的元数据仅供编辑器使用。仅供编" +"辑器使用的元数据不会在“检查器”中显示,虽然仍然能够被这个方法找到,但是不应该进" +"行编辑。" + +msgid "" "Attaches [param script] to the object, and instantiates it. As a result, the " "script's [method _init] is called. A [Script] is used to extend the object's " "functionality.\n" @@ -71067,6 +79327,19 @@ msgstr "该动作集的优先级。" msgid "Makes the OpenXR API available for GDExtension." msgstr "为 GDExtension 提供 OpenXR API。" +msgid "" +"[OpenXRAPIExtension] makes OpenXR available for GDExtension. It provides the " +"OpenXR API to GDExtension through the [method get_instance_proc_addr] method, " +"and the OpenXR instance through [method get_instance].\n" +"It also provides methods for querying the status of OpenXR initialization, " +"and helper methods for ease of use of the API with GDExtension." +msgstr "" +"[OpenXRAPIExtension] 使 OpenXR 可用于 GDExtension。它通过 [method " +"get_instance_proc_addr] 方法向 GDExtension 提供 OpenXR API,并通过 [method " +"get_instance] 提供 OpenXR 实例。\n" +"它还提供了用于查询 OpenXR 初始化状态的方法,以及便于通过 GDExtension 使用 API " +"的辅助方法。" + msgid "XrResult documentation" msgstr "XrResult 文档" @@ -71089,6 +79362,12 @@ msgid "XrPosef documentation" msgstr "XrPosef 文档" msgid "" +"Returns [code]true[/code] if OpenXR is initialized for rendering with an XR " +"viewport." +msgstr "" +"如果 OpenXR 已为使用 XR 视口进行渲染而初始化,则返回 [code]true[/code]。" + +msgid "" "Returns an error string for the given [url=https://registry.khronos.org/" "OpenXR/specs/1.0/man/html/XrResult.html]XrResult[/url]." msgstr "" @@ -71103,9 +79382,58 @@ msgstr "" "返回 OpenXR API 初始化过程中创建的 [url=https://registry.khronos.org/OpenXR/" "specs/1.0/man/html/XrInstance.html]XrInstance[/url]。" +msgid "" +"Returns the function pointer of the OpenXR function with the specified name, " +"cast to an integer. If the function with the given name does not exist, the " +"method returns [code]0[/code].\n" +"[b]Note:[/b] [code]openxr/util.h[/code] contains utility macros for acquiring " +"OpenXR functions, e.g. [code]GDEXTENSION_INIT_XR_FUNC_V(xrCreateAction)[/" +"code]." +msgstr "" +"返回具有指定名称的 OpenXR 函数的函数指针,转换为整数。如果给定名称的函数不存" +"在,该方法返回 [code]0[/code]。\n" +"[b]注意:[/b][code]openxr/util.h[/code] 包含用于获取 OpenXR 函数的实用宏,例" +"如, [code]GDEXTENSION_INIT_XR_FUNC_V(xrCreateAction)[/code]。" + +msgid "Returns the timing for the next frame." +msgstr "返回下一帧的时间。" + +msgid "" +"Returns the play space, which is an [url=https://registry.khronos.org/OpenXR/" +"specs/1.0/man/html/XrSpace.html]XrSpace[/url] cast to an integer." +msgstr "" +"返回播放空间,它是一个被转换为整数的 [url=https://registry.khronos.org/OpenXR/" +"specs/1.0/man/html/XrSpace.html]XrSpace[/url]。" + +msgid "" +"Returns the OpenXR session, which is an [url=https://registry.khronos.org/" +"OpenXR/specs/1.0/man/html/XrSession.html]XrSession[/url] cast to an integer." +msgstr "" +"返回该 OpenXR 会话,它是一个被转换为整数的 [url=https://registry.khronos.org/" +"OpenXR/specs/1.0/man/html/XrSession.html]XrSession[/url]。" + +msgid "Returns the name of the specified swapchain format." +msgstr "返回指定交换链格式的名称。" + +msgid "" +"Returns the id of the system, which is a [url=https://registry.khronos.org/" +"OpenXR/specs/1.0/man/html/XrSystemId.html]XrSystemId[/url] cast to an integer." +msgstr "" +"返回系统的 id,它是一个被转换为整数的 [url=https://registry.khronos.org/" +"OpenXR/specs/1.0/man/html/XrSystemId.html]XrSystemId[/url]。" + msgid "Returns [code]true[/code] if OpenXR is initialized." msgstr "如果 OpenXR 已初始化,则返回 [code]true[/code]。" +msgid "" +"Returns [code]true[/code] if OpenXR is running ([url=https://registry.khronos." +"org/OpenXR/specs/1.0/man/html/xrBeginSession.html]xrBeginSession[/url] was " +"successfully called and the swapchains were created)." +msgstr "" +"如果 OpenXR 正在运行,则返回 [code]true[/code]([url=https://registry.khronos." +"org/OpenXR/specs/1.0/man/html/xrBeginSession.html]xrBeginSession[/url] 已被成" +"功调用并且交换链已被创建)。" + msgid "Returns [code]true[/code] if OpenXR is enabled." msgstr "如果启用 OpenXR,则返回 [code]true[/code]。" @@ -71116,6 +79444,152 @@ msgstr "" "从 [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrPosef." "html]XrPosef[/url] 创建一个 [Transform3D] 。" +msgid "" +"Returns [code]true[/code] if the provided [url=https://registry.khronos.org/" +"OpenXR/specs/1.0/man/html/XrResult.html]XrResult[/url] (cast to an integer) " +"is successful. Otherwise returns [code]false[/code] and prints the " +"[url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/XrResult." +"html]XrResult[/url] converted to a string, with the specified additional " +"information." +msgstr "" +"如果提供的 [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/" +"XrResult.html]XrResult[/url](转换为整数)是成功的,则返回 [code]true[/code]。" +"否则返回 [code]false[/code] 并打印被转换为字符串的 [url=https://registry." +"khronos.org/OpenXR/specs/1.0/man/html/XrResult.html]XrResult[/url] ,以及指定" +"的附加信息。" + +msgid "Allows clients to implement OpenXR extensions with GDExtension." +msgstr "允许客户端使用 GDExtension 实现 OpenXR 扩展。" + +msgid "" +"[OpenXRExtensionWrapperExtension] allows clients to implement OpenXR " +"extensions with GDExtension. The extension should be registered with [method " +"register_extension_wrapper]." +msgstr "" +"[OpenXRExtensionWrapperExtension] 允许客户端使用 GDExtension 实现 OpenXR 扩" +"展。扩展应该使用 [method register_extension_wrapper] 注册。" + +msgid "" +"Returns a [Dictionary] of OpenXR extensions related to this extension. The " +"[Dictionary] should contain the name of the extension, mapped to a [code]bool " +"*[/code] cast to an integer:\n" +"- If the [code]bool *[/code] is a [code]nullptr[/code] this extension is " +"mandatory.\n" +"- If the [code]bool *[/code] points to a boolean, the boolean will be updated " +"to [code]true[/code] if the extension is enabled." +msgstr "" +"返回与该扩展相关的 OpenXR 扩展的 [Dictionary]。该 [Dictionary] 应包含扩展名," +"映射到 [code]bool *[/code] 转换为整数:\n" +"- 如果 [code]bool *[/code] 是 [code]nullptr[/code],则该扩展是强制性的。\n" +"- 如果 [code]bool *[/code] 指向布尔值,则在启用扩展的情况下,该布尔值将更新为 " +"[code]true[/code]。" + +msgid "Called before the OpenXR instance is created." +msgstr "在创建 OpenXR 实例之前调用。" + +msgid "" +"Called when there is an OpenXR event to process. When implementing, return " +"[code]true[/code] if the event was handled, return [code]false[/code] " +"otherwise." +msgstr "" +"当有 OpenXR 事件需要处理时调用。实现时,如果事件已被处理,则返回 [code]true[/" +"code],否则返回 [code]false[/code]。" + +msgid "Called right after the OpenXR instance is created." +msgstr "在创建 OpenXR 实例后立即调用。" + +msgid "Called right before the OpenXR instance is destroyed." +msgstr "在 OpenXR 实例被销毁之前调用。" + +msgid "Called right before the XR viewports begin their rendering step." +msgstr "在 XR 视口开始其渲染步进之前调用。" + +msgid "" +"Called as part of the OpenXR process handling. This happens right before " +"general and physics processing steps of the main loop. During this step " +"controller data is queried and made available to game logic." +msgstr "" +"作为 OpenXR 进程处理的一部分调用。这发生在主循环的一般和物理处理步进之前。在该" +"步进中,控制器数据被查询并可供游戏逻辑使用。" + +msgid "" +"Allows extensions to register additional controller metadata. This function " +"is called even when the OpenXR API is not constructed as the metadata needs " +"to be available to the editor.\n" +"Extensions should also provide metadata regardless of whether they are " +"supported on the host system. The controller data is used to setup action " +"maps for users who may have access to the relevant hardware." +msgstr "" +"允许扩展注册额外的控制器元数据。即使 OpenXR API 未被构造,也会调用该函数,因为" +"元数据需要可供编辑器使用。\n" +"扩展还应该提供元数据,无论主机系统是否支持它们。控制器数据用于为可以访问相关硬" +"件的用户设置动作映射。" + +msgid "Called right after the OpenXR session is created." +msgstr "在创建 OpenXR 会话后立即调用。" + +msgid "Called right before the OpenXR session is destroyed." +msgstr "在 OpenXR 会话被销毁之前调用。" + +msgid "Called when the OpenXR session state is changed to exiting." +msgstr "当 OpenXR 会话状态被更改为退出时调用。" + +msgid "" +"Called when the OpenXR session state is changed to focused. This state is the " +"active state when the game runs." +msgstr "当 OpenXR 会话状态被更改为聚焦时调用。该状态是游戏运行时的活动状态。" + +msgid "Called when the OpenXR session state is changed to idle." +msgstr "当 OpenXR 会话状态被更改为空闲时调用。" + +msgid "Called when the OpenXR session state is changed to loss pending." +msgstr "当 OpenXR 会话状态被更改为丢失挂起时调用。" + +msgid "" +"Called when the OpenXR session state is changed to ready. This means OpenXR " +"is ready to set up the session." +msgstr "" +"当 OpenXR 会话状态被更改为就绪时调用。这意味着 OpenXR 已准备好建立会话。" + +msgid "Called when the OpenXR session state is changed to stopping." +msgstr "当 OpenXR 会话状态被更改为停止时调用。" + +msgid "" +"Called when the OpenXR session state is changed to synchronized. OpenXR also " +"returns to this state when the application loses focus." +msgstr "" +"当 OpenXR 会话状态被更改为同步时调用。当应用程序失去焦点时,OpenXR 也会返回到" +"该状态。" + +msgid "" +"Called when the OpenXR session state is changed to visible. This means OpenXR " +"is now ready to receive frames." +msgstr "" +"当 OpenXR 会话状态被更改为可见时调用。这意味着 OpenXR 现在已准备好接收帧。" + +msgid "Adds additional data structures when the OpenXR instance is created." +msgstr "创建 OpenXR 实例时添加额外的数据结构。" + +msgid "Adds additional data structures when the OpenXR session is created." +msgstr "创建 OpenXR 会话时添加额外的数据结构。" + +msgid "Adds additional data structures when creating OpenXR swapchains." +msgstr "创建 OpenXR 交换链时添加额外的数据结构。" + +msgid "" +"Adds additional data structures when interogating OpenXR system abilities." +msgstr "在询问 OpenXR 系统功能时添加额外的数据结构。" + +msgid "" +"Returns the created [OpenXRAPIExtension], which can be used to access the " +"OpenXR API." +msgstr "返回创建的 [OpenXRAPIExtension],可用于访问 OpenXR API。" + +msgid "" +"Registers the extension. This should happen at core module initialization " +"level." +msgstr "注册扩展程序。这应该发生在核心模块初始化级别。" + msgid "Node supporting finger tracking in OpenXR." msgstr "在 OpenXR 中提供手指跟踪的节点。" @@ -71162,6 +79636,20 @@ msgstr "最大支持的运动范围。" msgid "Suggested bindings object for OpenXR." msgstr "用于 OpenXR 的建议绑定对象。" +msgid "" +"This object stores suggested bindings for an interaction profile. Interaction " +"profiles define the metadata for a tracked XR device such as an XR " +"controller.\n" +"For more information see the [url=https://www.khronos.org/registry/OpenXR/" +"specs/1.0/html/xrspec.html#semantic-path-interaction-profiles]interaction " +"profiles info in the OpenXR specification[/url]." +msgstr "" +"此对象存储用于一个交互配置的建议绑定。交互配置定义了一个被跟踪的 XR 设备(例如" +"一个 XR 控制器)的元数据。\n" +"有关更多信息,请参阅[url=https://www.khronos.org/registry/OpenXR/specs/1.0/" +"html/xrspec.html#semantic-path-interaction-profiles]《OpenXR 规范中的交互配置" +"信息》[/url]。" + msgid "Retrieve the binding at this index." msgstr "检索在该索引处的绑定。" @@ -71174,6 +79662,87 @@ msgstr "用于该交互配置的动作绑定。" msgid "The interaction profile path identifying the XR device." msgstr "标识该 XR 设备的交互配置路径。" +msgid "Meta class registering supported devices in OpenXR." +msgstr "在 OpenXR 中注册受支持设备的元类。" + +msgid "" +"This class allows OpenXR core and extensions to register metadata relating to " +"supported interaction devices such as controllers, trackers, haptic devices, " +"etc. It is primarily used by the action map editor and to sanitize any action " +"map by removing extension-dependent entries when applicable." +msgstr "" +"该类允许 OpenXR 核心和扩展注册与受支持的交互设备(例如控制器、跟踪器、触觉设备" +"等)相关的元数据。它主要由动作映射编辑器使用,并在适用时通过移除依赖于扩展的条" +"目来清理任何动作映射。" + +msgid "" +"Registers an interaction profile using its OpenXR designation (e.g. [code]/" +"interaction_profiles/khr/simple_controller[/code] is the profile for OpenXR's " +"simple controller profile).\n" +"[param display_name] is the description shown to the user. [param " +"openxr_path] is the interaction profile path being registered. [param " +"openxr_extension_name] optionally restricts this profile to the given " +"extension being enabled/available. If the extension is not available, the " +"profile and all related entries used in an action map are filtered out." +msgstr "" +"使用 OpenXR 名称注册交互配置文件(例如 [code]/interaction_profiles/khr/" +"simple_controller[/code] 是 OpenXR 简单控制器配置文件的配置文件)。\n" +"[param display_name] 是向用户显示的描述。[param openxr_path] 是正被注册的交互" +"配置文件路径。[param openxr_extension_name] 可以选择将该配置文件限制为对给定扩" +"展启用/可用。如果该扩展不可用,则动作映射中使用的配置文件和所有相关条目都会被" +"过滤掉。" + +msgid "" +"Registers an input/output path for the given [param interaction_profile]. The " +"profile should previously have been registered using [method " +"register_interaction_profile]. [param display_name] is the description shown " +"to the user. [param toplevel_path] specifies the bind path this input/output " +"can be bound to (e.g. [code]/user/hand/left[/code] or [code]/user/hand/right[/" +"code]). [param openxr_path] is the action input/output being registered (e.g. " +"[code]/user/hand/left/input/aim/pose[/code]). [param openxr_extension_name] " +"restricts this input/output to an enabled/available extension, this doesn't " +"need to repeat the extension on the profile but relates to overlapping " +"extension (e.g. [code]XR_EXT_palm_pose[/code] that introduces [code]…/input/" +"palm_ext/pose[/code] input paths). [param action_type] defines the type of " +"input or output provided by OpenXR." +msgstr "" +"为给定的 [param interaction_profile] 注册输入/输出路径。该配置文件之前应已使" +"用 [method register_interaction_profile] 注册。[param display_name] 是向用户显" +"示的描述。[param toplevel_path] 指定该输入/输出可以被绑定到的绑定路径(例如 " +"[code]/user/hand/left[/code] 或 [code]/user/hand/right[/code])。[param " +"openxr_path] 是正被注册的动作输入/输出(例如 [code]/user/hand/left/input/aim/" +"pose[/code])。[param openxr_extension_name] 将该输入/输出限制为启用的/可用的" +"扩展,这不需要在配置文件上重复该扩展,但与重叠扩展相关(例如引入 [code]…/" +"input/palm_ext/pose[/code] 输入路径的 [code]XR_EXT_palm_pose[/code])。[param " +"action_type] 定义 OpenXR 提供的输入或输出的类型。" + +msgid "" +"Allows for renaming old interaction profile paths to new paths to maintain " +"backwards compatibility with older action maps." +msgstr "" +"允许将旧的交互配置文件路径重命名为新路径,以保持与旧动作映射的向后兼容性。" + +msgid "" +"Registers a top level path to which profiles can be bound. For instance " +"[code]/user/hand/left[/code] refers to the bind point for the player's left " +"hand. Extensions can register additional top level paths, for instance a " +"haptic vest extension might register [code]/user/body/vest[/code].\n" +"[param display_name] is the name shown to the user. [param openxr_path] is " +"the top level path being registered. [param openxr_extension_name] is " +"optional and ensures the top level path is only used if the specified " +"extension is available/enabled.\n" +"When a top level path ends up being bound by OpenXR, a [XRPositionalTracker] " +"is instantiated to manage the state of the device." +msgstr "" +"注册配置文件可以被绑定到的顶级路径。例如 [code]/user/hand/left[/code] 指的是玩" +"家左手的绑定点。扩展可以注册额外的顶级路径,例如触觉背心扩展可以注册 [code]/" +"user/body/vest[/code]。\n" +"[param display_name] 是向用户显示的名称。[param openxr_path] 是正被注册的顶级" +"路径。[param openxr_extension_name] 是可选的,可确保仅在指定的扩展可用/启用时" +"才使用顶级路径。\n" +"当顶级路径最终被 OpenXR 绑定时,[XRPositionalTracker] 被实例化以管理该设备的状" +"态。" + msgid "Our OpenXR interface." msgstr "OpenXR 接口。" @@ -71210,13 +79779,100 @@ msgstr "" "返回当前 HMD 支持的显示刷新率。仅当 OpenXR 运行时支持该功能并且接口已被初始化" "后才会返回。" +msgid "" +"If handtracking is enabled, returns the angular velocity of a joint ([param " +"joint]) of a hand ([param hand]) as provided by OpenXR. This is relative to " +"[XROrigin3D]!" +msgstr "" +"如果启用了手部跟踪,则返回 OpenXR 提供的手([param hand])的关节([param " +"joint])的角速度。这是相对于 [XROrigin3D] 而言的!" + +msgid "" +"If handtracking is enabled, returns flags that inform us of the validity of " +"the tracking data." +msgstr "如果启用了手动跟踪,则返回通知我们跟踪数据有效性的标志。" + +msgid "" +"If handtracking is enabled, returns the linear velocity of a joint ([param " +"joint]) of a hand ([param hand]) as provided by OpenXR. This is relative to " +"[XROrigin3D] without worldscale applied!" +msgstr "" +"如果启用了手部跟踪,则返回 OpenXR 提供的手([param hand])的关节([param " +"joint])的线速度。这是相对于没有应用世界尺度的 [XROrigin3D] 而言的!" + +msgid "" +"If handtracking is enabled, returns the position of a joint ([param joint]) " +"of a hand ([param hand]) as provided by OpenXR. This is relative to " +"[XROrigin3D] without worldscale applied!" +msgstr "" +"如果启用了手部跟踪,则返回 OpenXR 提供的手([param hand])的关节([param " +"joint])的位置。这是相对于没有应用世界尺度的 [XROrigin3D] 而言的!" + +msgid "" +"If handtracking is enabled, returns the radius of a joint ([param joint]) of " +"a hand ([param hand]) as provided by OpenXR. This is without worldscale " +"applied!" +msgstr "" +"如果启用了手部跟踪,则返回 OpenXR 提供的手([param hand])的关节([param " +"joint])的半径。这是没有应用世界尺度的情况!" + +msgid "" +"If handtracking is enabled, returns the rotation of a joint ([param joint]) " +"of a hand ([param hand]) as provided by OpenXR." +msgstr "" +"如果启用了手部跟踪,则返回 OpenXR 提供的手([param hand])的关节([param " +"joint])的旋转。" + +msgid "" +"If handtracking is enabled and motion range is supported, gets the currently " +"configured motion range for [param hand]." +msgstr "" +"如果启用了手部跟踪并且支持运动范围,则获取 [param hand] 当前配置的运动范围。" + msgid "Returns [code]true[/code] if the given action set is active." msgstr "如果给定的动作集处于活动状态,则返回 [code]true[/code]。" +msgid "" +"Returns the capabilities of the eye gaze interaction extension.\n" +"[b]Note:[/b] This only returns a valid value after OpenXR has been " +"initialized." +msgstr "" +"返回眼睛注视交互扩展的功能。\n" +"[b]注意:[/b]这仅在 OpenXR 被初始化后返回一个有效值。" + +msgid "" +"Returns [code]true[/code] if OpenXR's foveation extension is supported, the " +"interface must be initialized before this returns a valid value.\n" +"[b]Note:[/b] This feature is only available on the compatibility renderer and " +"currently only available on some stand alone headsets. For Vulkan set [member " +"Viewport.vrs_mode] to [code]VRS_XR[/code] on desktop." +msgstr "" +"如果支持 OpenXR 的注视点扩展,则返回 [code]true[/code],在返回有效值之前必须初" +"始化该接口。\n" +"[b]注意:[/b]该功能仅在兼容性渲染器上可用,并且目前仅在某些独立头戴设备上可" +"用。对于 Vulkan,在桌面上将 [member Viewport.vrs_mode] 设置为 [code]VRS_XR[/" +"code]。" + +msgid "" +"Returns [code]true[/code] if OpenXR's hand tracking is supported and " +"enabled.\n" +"[b]Note:[/b] This only returns a valid value after OpenXR has been " +"initialized." +msgstr "" +"如果支持且已启用 OpenXR 的手部跟踪,则返回 [code]true[/code]。\n" +"[b]注意:[/b]这仅在 OpenXR 已被初始化后返回一个有效值。" + msgid "Sets the given action set as active or inactive." msgstr "将给定的动作集设置为活动或非活动。" msgid "" +"If handtracking is enabled and motion range is supported, sets the currently " +"configured motion range for [param hand] to [param motion_range]." +msgstr "" +"如果启用了手部跟踪并且支持运动范围,请将 [param hand] 当前配置的运动范围设置" +"为 [param motion_range]。" + +msgid "" "The display refresh rate for the current HMD. Only functional if this feature " "is supported by the OpenXR runtime and after the interface has been " "initialized." @@ -71225,6 +79881,21 @@ msgstr "" "效。" msgid "" +"Enable dynamic foveation adjustment, the interface must be initialized before " +"this is accessible. If enabled foveation will automatically adjusted between " +"low and [member foveation_level]." +msgstr "" +"启用动态注视点调整,必须先初始化接口才能访问该功能。如果启用,注视点将在低和 " +"[member foveation_level] 之间自动调整。" + +msgid "" +"Set foveation level from 0 (off) to 3 (high), the interface must be " +"initialized before this is accessible." +msgstr "" +"将注视点级别设置为从 0(关闭)到 3(高),必须先初始化接口,然后才能访问该接" +"口。" + +msgid "" "The render size multiplier for the current HMD. Must be set before the " "interface has been initialized." msgstr "当前 HMD 的渲染大小乘数。必须在接触初始化之前设置。" @@ -71251,6 +79922,9 @@ msgstr "左手。" msgid "Right hand." msgstr "右手。" +msgid "Maximum value for the hand enum." +msgstr "手部枚举的最大值。" + msgid "Palm joint." msgstr "掌关节。" @@ -71329,6 +80003,42 @@ msgstr "小指远端关节。" msgid "Little tip joint." msgstr "小指尖端关节。" +msgid "Maximum value for the hand joint enum." +msgstr "手关节枚举的最大值。" + +msgid "No flags are set." +msgstr "没有标志被设置。" + +msgid "" +"If set, the orientation data is valid, otherwise, the orientation data is " +"unreliable and should not be used." +msgstr "如果设置,则方向数据有效;否则,方向数据不可靠,且不应被使用。" + +msgid "" +"If set, the orientation data comes from tracking data, otherwise, the " +"orientation data contains predicted data." +msgstr "如果设置,则方向数据来自跟踪数据;否则,该方向数据包含预测数据。" + +msgid "" +"If set, the positional data is valid, otherwise, the positional data is " +"unreliable and should not be used." +msgstr "如果设置,则位置数据有效;否则,该位置数据不可靠,且不应被使用。" + +msgid "" +"If set, the positional data comes from tracking data, otherwise, the " +"positional data contains predicted data." +msgstr "如果设置,则位置数据来自跟踪数据;否则,该位置数据包含预测数据。" + +msgid "" +"If set, our linear velocity data is valid, otherwise, the linear velocity " +"data is unreliable and should not be used." +msgstr "如果设置,则线速度数据有效;否则,线速度数据不可靠,且不应被使用。" + +msgid "" +"If set, our angular velocity data is valid, otherwise, the angular velocity " +"data is unreliable and should not be used." +msgstr "如果设置,则角速度数据是有效的;否则,角速度数据不可靠,且不应被使用。" + msgid "Defines a binding between an [OpenXRAction] and an XR input or output." msgstr "定义 [OpenXRAction] 和 XR 输入或输出之间的绑定。" @@ -71380,6 +80090,28 @@ msgid "A button that brings up a dropdown with selectable options when pressed." msgstr "按下时弹出下拉菜单的按钮。" msgid "" +"[OptionButton] is a type of button that brings up a dropdown with selectable " +"items when pressed. The item selected becomes the \"current\" item and is " +"displayed as the button text.\n" +"See also [BaseButton] which contains common properties and methods associated " +"with this node.\n" +"[b]Note:[/b] The ID values used for items are limited to 32 bits, not full 64 " +"bits of [int]. This has a range of [code]-2^32[/code] to [code]2^32 - 1[/" +"code], i.e. [code]-2147483648[/code] to [code]2147483647[/code].\n" +"[b]Note:[/b] The [member Button.text] and [member Button.icon] properties are " +"set automatically based on the selected item. They shouldn't be changed " +"manually." +msgstr "" +"[OptionButton] 是一种按下时弹出下拉菜单的按钮。选中的菜单项会成为“当前”菜单" +"项,作为按钮文本显示。\n" +"另见 [BaseButton],其中包含与此节点相关联的通用属性和方法。\n" +"[b]注意:[/b]菜单项的 ID 值有 32 位的限制,并不是完整的 64 位 [int]。取值范围" +"为 [code]-2^32[/code] 到 [code]2^32 - 1[/code],即 [code]-2147483648[/code] " +"到 [code]2147483647[/code]。\n" +"[b]注意:[/b][member Button.text] 和 [member Button.icon] 属性会根据当前所选菜" +"单项自动设置。不应该手动更改。" + +msgid "" "Adds an item, with a [param texture] icon, text [param label] and " "(optionally) [param id]. If no [param id] is passed, the item index will be " "used as the item's ID. New items are appended at the end." @@ -71560,6 +80292,11 @@ msgid "The arrow icon to be drawn on the right end of the button." msgstr "要绘制在按钮右侧的箭头图标。" msgid "" +"A PBR (Physically Based Rendering) material to be used on 3D objects. Uses an " +"ORM texture." +msgstr "用于 3D 对象的 PBR(基于物理的渲染)材质。使用一个 ORM 纹理。" + +msgid "" "ORMMaterial3D's properties are inherited from [BaseMaterial3D]. Unlike " "[StandardMaterial3D], ORMMaterial3D uses a single texture for ambient " "occlusion, roughness and metallic maps, known as an ORM texture." @@ -72058,6 +80795,17 @@ msgstr "" "文件的路径。" msgid "" +"On Android devices: With this function, you can get the list of dangerous " +"permissions that have been granted.\n" +"On macOS (sandboxed applications only): This function returns the list of " +"user selected folders accessible to the application. Use native file dialog " +"to request folder access permission." +msgstr "" +"在 Android 设备上:通过该功能,你可以获取已被授予的危险权限列表。\n" +"在 macOS 上(仅限沙盒应用程序):该函数返回应用程序可访问的用户选择的文件夹列" +"表。使用原生文件对话框请求文件夹访问权限。" + +msgid "" "Returns the given keycode as a string (e.g. Return values: [code]\"Escape\"[/" "code], [code]\"Shift+Escape\"[/code]).\n" "See also [member InputEventKey.keycode] and [method InputEventKey." @@ -72069,6 +80817,36 @@ msgstr "" "get_keycode_with_modifiers]。" msgid "" +"Returns the host OS locale as a string of the form " +"[code]language_Script_COUNTRY_VARIANT@extra[/code]. If you want only the " +"language code and not the fully specified locale from the OS, you can use " +"[method get_locale_language].\n" +"[code]language[/code] - 2 or 3-letter [url=https://en.wikipedia.org/wiki/" +"List_of_ISO_639-1_codes]language code[/url], in lower case.\n" +"[code skip-lint]Script[/code] - optional, 4-letter [url=https://en.wikipedia." +"org/wiki/ISO_15924]script code[/url], in title case.\n" +"[code]COUNTRY[/code] - optional, 2 or 3-letter [url=https://en.wikipedia.org/" +"wiki/ISO_3166-1]country code[/url], in upper case.\n" +"[code]VARIANT[/code] - optional, language variant, region and sort order. " +"Variant can have any number of underscored keywords.\n" +"[code]extra[/code] - optional, semicolon separated list of additional key " +"words. Currency, calendar, sort order and numbering system information." +msgstr "" +"将主机操作系统区域设置为 [code]language_Script_COUNTRY_VARIANT@extra[/code] 形" +"式的字符串。如果你只想要语言代码而不是操作系统中完全指定的语言环境,可以使用 " +"[method get_locale_language]。\n" +"[code]language[/code] - 2 个或 3 个字母的[url=https://en.wikipedia.org/wiki/" +"List_of_ISO_639-1_codes]语言代码[/url],小写。\n" +"[code skip-lint]Script[/code] - 可选,4 个字母的[url=https://en.wikipedia.org/" +"wiki/ISO_15924]文字代码[/url],首字母大写。\n" +"[code]COUNTRY[/code] - 可选,2 个或 3 个字母的[url=https://en.wikipedia.org/" +"wiki/ISO_3166-1]国家地区代码[/url],大写。\n" +"[code]VARIANT[/code] - 可选,语言变体,地区和排序顺序。变体可以有任意数量的带" +"下划线的关键字。\n" +"[code]extra[/code] - 可选,分号分隔的附加关键字列表。货币、日历、排序顺序和编" +"号系统信息。" + +msgid "" "Returns the host OS locale's 2 or 3-letter [url=https://en.wikipedia.org/wiki/" "List_of_ISO_639-1_codes]language code[/url] as a string which should be " "consistent on all platforms. This is equivalent to extracting the " @@ -72133,6 +80911,120 @@ msgstr "" "[code]\"GenericDevice\"[/code]。" msgid "" +"Returns the name of the host OS.\n" +"On Windows, this is [code]\"Windows\"[/code].\n" +"On macOS, this is [code]\"macOS\"[/code].\n" +"On Linux-based operating systems, this is [code]\"Linux\"[/code].\n" +"On BSD-based operating systems, this is [code]\"FreeBSD\"[/code], " +"[code]\"NetBSD\"[/code], [code]\"OpenBSD\"[/code], or [code]\"BSD\"[/code] as " +"a fallback.\n" +"On Android, this is [code]\"Android\"[/code].\n" +"On iOS, this is [code]\"iOS\"[/code].\n" +"On the web, this is [code]\"Web\"[/code].\n" +"[b]Note:[/b] Custom builds of the engine may support additional platforms, " +"such as consoles, yielding other return values.\n" +"[codeblocks]\n" +"[gdscript]\n" +"match OS.get_name():\n" +" \"Windows\":\n" +" print(\"Windows\")\n" +" \"macOS\":\n" +" print(\"macOS\")\n" +" \"Linux\", \"FreeBSD\", \"NetBSD\", \"OpenBSD\", \"BSD\":\n" +" print(\"Linux/BSD\")\n" +" \"Android\":\n" +" print(\"Android\")\n" +" \"iOS\":\n" +" print(\"iOS\")\n" +" \"Web\":\n" +" print(\"Web\")\n" +"[/gdscript]\n" +"[csharp]\n" +"switch (OS.GetName())\n" +"{\n" +" case \"Windows\":\n" +" GD.Print(\"Windows\");\n" +" break;\n" +" case \"macOS\":\n" +" GD.Print(\"macOS\");\n" +" break;\n" +" case \"Linux\":\n" +" case \"FreeBSD\":\n" +" case \"NetBSD\":\n" +" case \"OpenBSD\":\n" +" case \"BSD\":\n" +" GD.Print(\"Linux/BSD\");\n" +" break;\n" +" case \"Android\":\n" +" GD.Print(\"Android\");\n" +" break;\n" +" case \"iOS\":\n" +" GD.Print(\"iOS\");\n" +" break;\n" +" case \"Web\":\n" +" GD.Print(\"Web\");\n" +" break;\n" +"}\n" +"[/csharp]\n" +"[/codeblocks]" +msgstr "" +"返回主机操作系统的名称。\n" +"在 Windows 上为 [code]\"Windows\"[/code]。\n" +"在 macOS 上为 [code]\"macOS\"[/code]。\n" +"在基于 Linux 的操作系统上为 [code]\"Linux\"[/code]。\n" +"在基于 BSD 的操作系统上为 [code]\"FreeBSD\"[/code]、[code]\"NetBSD\"[/code]、" +"[code]\"OpenBSD\"[/code], 会使用 [code]\"BSD\"[/code] 作为回退方案。\n" +"在 Android 上为 [code]\"Android\"[/code]。\n" +"在 iOS 上为 [code]\"iOS\"[/code]。\n" +"在 Web 上为 [code]\"Web\"[/code]。\n" +"[b]注意:[/b]自定义构建的引擎可能支持其他平台,例如游戏主机,可能返回其他" +"值。\n" +"[codeblocks]\n" +"[gdscript]\n" +"match OS.get_name():\n" +" \"Windows\":\n" +" print(\"Windows\")\n" +" \"macOS\":\n" +" print(\"macOS\")\n" +" \"Linux\", \"FreeBSD\", \"NetBSD\", \"OpenBSD\", \"BSD\":\n" +" print(\"Linux/BSD\")\n" +" \"Android\":\n" +" print(\"Android\")\n" +" \"iOS\":\n" +" print(\"iOS\")\n" +" \"Web\":\n" +" print(\"Web\")\n" +"[/gdscript]\n" +"[csharp]\n" +"switch (OS.GetName())\n" +"{\n" +" case \"Windows\":\n" +" GD.Print(\"Windows\");\n" +" break;\n" +" case \"macOS\":\n" +" GD.Print(\"macOS\");\n" +" break;\n" +" case \"Linux\":\n" +" case \"FreeBSD\":\n" +" case \"NetBSD\":\n" +" case \"OpenBSD\":\n" +" case \"BSD\":\n" +" GD.Print(\"Linux/BSD\");\n" +" break;\n" +" case \"Android\":\n" +" GD.Print(\"Android\");\n" +" break;\n" +" case \"iOS\":\n" +" GD.Print(\"iOS\");\n" +" break;\n" +" case \"Web\":\n" +" GD.Print(\"Web\");\n" +" break;\n" +"}\n" +"[/csharp]\n" +"[/codeblocks]" + +msgid "" "Returns the project's process ID.\n" "[b]Note:[/b] This method is implemented on Android, iOS, Linux, macOS and " "Windows." @@ -72149,6 +81041,17 @@ msgstr "" "i] CPU 核心数大。" msgid "" +"Returns the name of the CPU model on the host machine (e.g. \"Intel(R) " +"Core(TM) i7-6700K CPU @ 4.00GHz\").\n" +"[b]Note:[/b] This method is only implemented on Windows, macOS, Linux and " +"iOS. On Android and Web, [method get_processor_name] returns an empty string." +msgstr "" +"返回主机 CPU 型号的名称(例如 \"Intel(R) Core(TM) i7-6700K CPU @ " +"4.00GHz\")。\n" +"[b]注意:[/b]该方法仅在 Windows、macOS、Linux 和 iOS 上实现。在 Android 和 " +"Web 上,[method get_processor_name] 返回空字符串。" + +msgid "" "Returns the list of command line arguments that will be used when the project " "automatically restarts using [method set_restart_on_exit]. See also [method " "is_restart_on_exit_set]." @@ -72238,6 +81141,24 @@ msgstr "" "[b]注意:[/b]线程 ID 不是确定的,也许会在应用程序重新启动时被重复使用。" msgid "" +"Returns a string that is unique to the device.\n" +"[b]Note:[/b] This string may change without notice if the user reinstalls/" +"upgrades their operating system or changes their hardware. This means it " +"should generally not be used to encrypt persistent data as the data saved " +"before an unexpected ID change would become inaccessible. The returned string " +"may also be falsified using external programs, so do not rely on the string " +"returned by [method get_unique_id] for security purposes.\n" +"[b]Note:[/b] Returns an empty string and prints an error on Web, as this " +"method cannot be implemented on this platform." +msgstr "" +"返回特定于该设备的一个字符串。\n" +"[b]注意:[/b]如果用户重新安装/升级他们的操作系统或更改他们的硬件,该字符串可能" +"会更改,恕不另行通知。这意味着它通常不应用于加密持久数据,因为在意外的 ID 更改" +"会使之前保存的数据将变得不可访问。返回的字符串也可能会被外部程序伪造,因此出于" +"安全目的,不要依赖 [method get_unique_id] 返回的字符串。\n" +"[b]注意:[/b]在 Web 上返回一个空字符串,因为该方法尚未在该平台上实现。" + +msgid "" "Returns the absolute directory path where user data is written ([code]user://" "[/code]).\n" "On Windows, this is [code]%AppData%\\Godot\\app_userdata\\[project_name][/" @@ -72278,6 +81199,34 @@ msgstr "" "主目录。" msgid "" +"Returns the exact production and build version of the operating system. This " +"is different from the branded version used in marketing. This helps to " +"distinguish between different releases of operating systems, including minor " +"versions, and insider and custom builds.\n" +"For Windows, the major and minor version are returned, as well as the build " +"number. For example, the returned string can look like [code]10.0.9926[/code] " +"for a build of Windows 10, and it can look like [code]6.1.7601[/code] for a " +"build of Windows 7 SP1.\n" +"For rolling distributions, such as Arch Linux, an empty string is returned.\n" +"For macOS and iOS, the major and minor version are returned, as well as the " +"patch number.\n" +"For Android, the SDK version and the incremental build number are returned. " +"If it's a custom ROM, it attempts to return its version instead.\n" +"[b]Note:[/b] This method is not supported on the web platform. It returns an " +"empty string." +msgstr "" +"返回操作系统的确切生产和构建版本。这与营销中使用的品牌版本不同。这有助于区分操" +"作系统的不同版本,包括次要版本、内部版本和自定义版本。\n" +"对于 Windows,返回主要和次要版本,以及构建号。例如,对于 Windows 10 版本,返回" +"的字符串可能看起来像 [code]10.0.9926[/code],对于 Windows 7 SP1 版本,它可能看" +"起来像 [code]6.1.7601[/code]。\n" +"对于滚动发行版,例如 Arch Linux,会返回一个空字符串。\n" +"对于 macOS 和 iOS,会返回主要和次要版本,以及补丁号。\n" +"对于 Android,会返回 SDK 版本和增量构建号。如果是自定义的 ROM,将会尝试返回其" +"版本。\n" +"[b]注意:[/b]该方法在 web 平台上不被支持。它将返回一个空字符串。" + +msgid "" "Returns the video adapter driver name and version for the user's currently " "active graphics card. See also [method RenderingServer." "get_video_adapter_api_version].\n" @@ -72311,6 +81260,31 @@ msgstr "" "外的所有平台上都区分大小写。" msgid "" +"Returns [code]true[/code] if the feature for the given feature tag is " +"supported in the currently running instance, depending on the platform, " +"build, etc. Can be used to check whether you're currently running a debug " +"build, on a certain platform or arch, etc. Refer to the [url=$DOCS_URL/" +"tutorials/export/feature_tags.html]Feature Tags[/url] documentation for more " +"details.\n" +"[b]Note:[/b] Tag names are case-sensitive.\n" +"[b]Note:[/b] On the web platform, one of the following additional tags is " +"defined to indicate host platform: [code]web_android[/code], [code]web_ios[/" +"code], [code]web_linuxbsd[/code], [code]web_macos[/code], or " +"[code]web_windows[/code].\n" +"[b]Note:[/b] On the iOS simulator, the additional [code]simulator[/code] tag " +"is defined." +msgstr "" +"如果当前运行的实例支持给定功能标签的功能,则返回 [code]true[/code],具体取决于" +"平台、构建等。可用于检查当前是否正在运行调试构建,是否在某个平台或架构上,等" +"等。详情见[url=$DOCS_URL/tutorials/export/feature_tags.html]《功能标签》[/url]" +"文档。\n" +"[b]注意:[/b]标签名称区分大小写。\n" +"[b]注意:[/b]在 Web 平台上,会定义 [code]web_android[/code]、[code]web_ios[/" +"code]、[code]web_linuxbsd[/code]、[code]web_macos[/code]、[code]web_windows[/" +"code] 的其中之一,表示宿主平台。\n" +"[b]注意:[/b]在 iOS 模拟器中,还会定义 [code]simulator[/code] 标签。" + +msgid "" "Returns [code]true[/code] if the Godot binary used to run the project is a " "[i]debug[/i] export template, or when running in the editor.\n" "Returns [code]false[/code] if the Godot binary used to run the project is a " @@ -72353,6 +81327,13 @@ msgstr "" "get_restart_on_exit_arguments]。" msgid "" +"Returns [code]true[/code] if application is running in the sandbox.\n" +"[b]Note:[/b] This method is implemented on macOS and Linux." +msgstr "" +"如果应用程序在沙箱中运行,则返回 [code]true[/code]。\n" +"[b]注意:[/b]该方法在 macOS 和 Linux 上实现。" + +msgid "" "Returns [code]true[/code] if the engine was executed with the [code]--" "verbose[/code] or [code]-v[/code] command line argument, or if [member " "ProjectSettings.debug/settings/stdout/verbose_stdout] is [code]true[/code]. " @@ -72461,6 +81442,13 @@ msgstr "" "[b]注意:[/b]该方法仅在 Android 上实现。" msgid "" +"On macOS (sandboxed applications only), this function clears list of user " +"selected folders accessible to the application." +msgstr "" +"在 macOS(仅限沙盒应用程序)上,该功能会清除应用程序可访问的用户选择的文件夹列" +"表。" + +msgid "" "Sets the value of the environment variable [param variable] to [param value]. " "The environment variable will be set for the Godot process and any process " "executed with [method execute] after running [method set_environment]. The " @@ -72798,6 +81786,29 @@ msgstr "" "返回新的 [PackedByteArray],其中的数据已解压。请将 [param buffer_size] 设置为" "数据解压后的大小。请将压缩模式设置为 [enum FileAccess.CompressionMode] 常量。" +msgid "" +"Returns a new [PackedByteArray] with the data decompressed. Set the " +"compression mode using one of [enum FileAccess.CompressionMode]'s constants. " +"[b]This method only accepts brotli, gzip, and deflate compression modes.[/b]\n" +"This method is potentially slower than [method decompress], as it may have to " +"re-allocate its output buffer multiple times while decompressing, whereas " +"[method decompress] knows it's output buffer size from the beginning.\n" +"GZIP has a maximal compression ratio of 1032:1, meaning it's very possible " +"for a small compressed payload to decompress to a potentially very large " +"output. To guard against this, you may provide a maximum size this function " +"is allowed to allocate in bytes via [param max_output_size]. Passing -1 will " +"allow for unbounded output. If any positive value is passed, and the " +"decompression exceeds that amount in bytes, then an error will be returned." +msgstr "" +"返回新的 [PackedByteArray],其中的数据已解压。请将压缩模式设置为 [enum " +"FileAccess.CompressionMode] 常量。[b]这个方法只接受 brotli、gzip 和 deflate 压" +"缩模式。[/b]\n" +"这个方法可能比 [method decompress] 慢,因为在解压时可能需要多次重新分配输出缓" +"冲区,而 [method decompress] 则在一开始就知道输出缓冲区的大小。\n" +"GZIP 的最大压缩率为 1032:1,这意味着较小的压缩后负载很有可能解压出非常巨大的输" +"出。为了防止这种情况,你可以通过 [param max_output_size] 提供允许这个函数分配" +"的最大字节数。传入 -1 则不限制输出。传入正数且解压超过该字节数时,会返回错误。" + msgid "Creates a copy of the array, and returns it." msgstr "创建该数组的副本,并将该副本返回。" @@ -73043,6 +82054,21 @@ msgid "Sorts the elements of the array in ascending order." msgstr "将该数组中的元素按升序排列。" msgid "" +"Returns a copy of the data converted to a [PackedFloat32Array], where each " +"block of 4 bytes has been converted to a 32-bit float (C++ [code skip-" +"lint]float[/code]).\n" +"The size of the input array must be a multiple of 4 (size of 32-bit float). " +"The size of the new array will be [code]byte_array.size() / 4[/code].\n" +"If the original data can't be converted to 32-bit floats, the resulting data " +"is undefined." +msgstr "" +"返回将数据转换为 [PackedFloat32Array] 的副本,每 4 个字节块转换为一个 32 位浮" +"点数(C++ 的 [code skip-lint]float[/code])。\n" +"输入数组的大小必须为 4 的倍数(32 位浮点数的大小)。新数组的大小为 " +"[code]byte_array.size() / 4[/code]。\n" +"如果原始数据无法转换为 32 位浮点数,则最终的数据未定义。" + +msgid "" "Returns a copy of the data converted to a [PackedFloat64Array], where each " "block of 8 bytes has been converted to a 64-bit float (C++ [code]double[/" "code], Godot [float]).\n" @@ -73739,9 +82765,169 @@ msgstr "" msgid "An abstraction of a serialized scene." msgstr "对序列化场景的抽象。" +msgid "" +"A simplified interface to a scene file. Provides access to operations and " +"checks that can be performed on the scene resource itself.\n" +"Can be used to save a node to a file. When saving, the node as well as all " +"the nodes it owns get saved (see [member Node.owner] property).\n" +"[b]Note:[/b] The node doesn't need to own itself.\n" +"[b]Example of loading a saved scene:[/b]\n" +"[codeblocks]\n" +"[gdscript]\n" +"# Use load() instead of preload() if the path isn't known at compile-time.\n" +"var scene = preload(\"res://scene.tscn\").instantiate()\n" +"# Add the node as a child of the node the script is attached to.\n" +"add_child(scene)\n" +"[/gdscript]\n" +"[csharp]\n" +"// C# has no preload, so you have to always use ResourceLoader." +"Load<PackedScene>().\n" +"var scene = ResourceLoader.Load<PackedScene>(\"res://scene.tscn\")." +"Instantiate();\n" +"// Add the node as a child of the node the script is attached to.\n" +"AddChild(scene);\n" +"[/csharp]\n" +"[/codeblocks]\n" +"[b]Example of saving a node with different owners:[/b] The following example " +"creates 3 objects: [Node2D] ([code]node[/code]), [RigidBody2D] ([code]body[/" +"code]) and [CollisionObject2D] ([code]collision[/code]). [code]collision[/" +"code] is a child of [code]body[/code] which is a child of [code]node[/code]. " +"Only [code]body[/code] is owned by [code]node[/code] and [method pack] will " +"therefore only save those two nodes, but not [code]collision[/code].\n" +"[codeblocks]\n" +"[gdscript]\n" +"# Create the objects.\n" +"var node = Node2D.new()\n" +"var body = RigidBody2D.new()\n" +"var collision = CollisionShape2D.new()\n" +"\n" +"# Create the object hierarchy.\n" +"body.add_child(collision)\n" +"node.add_child(body)\n" +"\n" +"# Change owner of `body`, but not of `collision`.\n" +"body.owner = node\n" +"var scene = PackedScene.new()\n" +"\n" +"# Only `node` and `body` are now packed.\n" +"var result = scene.pack(node)\n" +"if result == OK:\n" +" var error = ResourceSaver.save(scene, \"res://path/name.tscn\") # Or " +"\"user://...\"\n" +" if error != OK:\n" +" push_error(\"An error occurred while saving the scene to disk.\")\n" +"[/gdscript]\n" +"[csharp]\n" +"// Create the objects.\n" +"var node = new Node2D();\n" +"var body = new RigidBody2D();\n" +"var collision = new CollisionShape2D();\n" +"\n" +"// Create the object hierarchy.\n" +"body.AddChild(collision);\n" +"node.AddChild(body);\n" +"\n" +"// Change owner of `body`, but not of `collision`.\n" +"body.Owner = node;\n" +"var scene = new PackedScene();\n" +"\n" +"// Only `node` and `body` are now packed.\n" +"Error result = scene.Pack(node);\n" +"if (result == Error.Ok)\n" +"{\n" +" Error error = ResourceSaver.Save(scene, \"res://path/name.tscn\"); // Or " +"\"user://...\"\n" +" if (error != Error.Ok)\n" +" {\n" +" GD.PushError(\"An error occurred while saving the scene to disk.\");\n" +" }\n" +"}\n" +"[/csharp]\n" +"[/codeblocks]" +msgstr "" +"场景文件的简化接口。提供可以对场景资源本身进行的操作和检查。\n" +"可以用来将某个节点保存到文件中。保存时,会将该节点和它所拥有的所有节点一起保存" +"(见 [member Node.owner] 属性)。\n" +"[b]注意:[/b]该节点不必自我拥有。\n" +"[b]加载保存场景的示例:[/b]\n" +"[codeblocks]\n" +"[gdscript]\n" +"# 如果路径在编译期不可知,请使用 load() 而不是 preload()。\n" +"var scene = preload(\"res://scene.tscn\").instantiate()\n" +"# 将该节点添加为脚本附加节点的子节点。\n" +"add_child(scene)\n" +"[/gdscript]\n" +"[csharp]\n" +"// C# 没有 preload,所以你使用的永远是 ResourceLoader.Load<PackedScene>()。\n" +"var scene = ResourceLoader.Load<PackedScene>(\"res://scene.tscn\")." +"Instantiate();\n" +"// 将该节点添加为脚本附加节点的子节点。\n" +"AddChild(scene);\n" +"[/csharp]\n" +"[/codeblocks]\n" +"[b]保存不同所有者的节点的示例:[/b]下面的粒子会创建 3 个对象:[Node2D]" +"([code]node[/code])、[RigidBody2D]([code]body[/code])、[CollisionObject2D]" +"([code]collision[/code]))。[code]node[/code] 的下一级是 [code]body[/code]," +"再下一级是 [code]collision[/code]。只有 [code]body[/code] 被 [code]node[/" +"code] 拥有,因此 [method pack] 只会保存两个节点,不会保存 [code]collision[/" +"code]。\n" +"[codeblocks]\n" +"[gdscript]\n" +"# 创建对象。\n" +"var node = Node2D.new()\n" +"var body = RigidBody2D.new()\n" +"var collision = CollisionShape2D.new()\n" +"\n" +"# 创建对象架构。\n" +"body.add_child(collision)\n" +"node.add_child(body)\n" +"\n" +"# 修改 `body` 的拥有者,但不修改 `collision` 的拥有者。\n" +"body.owner = node\n" +"var scene = PackedScene.new()\n" +"\n" +"# 只会打包 `node` 和 `body`。\n" +"var result = scene.pack(node)\n" +"if result == OK:\n" +" var error = ResourceSaver.save(scene, \"res://path/name.tscn\") # Or " +"\"user://...\"\n" +" if error != OK:\n" +" push_error(\"将场景保存到磁盘时出错。\")\n" +"[/gdscript]\n" +"[csharp]\n" +"// 创建对象。\n" +"var node = new Node2D();\n" +"var body = new RigidBody2D();\n" +"var collision = new CollisionShape2D();\n" +"\n" +"// 创建对象架构。\n" +"body.AddChild(collision);\n" +"node.AddChild(body);\n" +"\n" +"// 修改 `body` 的拥有者,但不修改 `collision` 的拥有者。\n" +"body.Owner = node;\n" +"var scene = new PackedScene();\n" +"\n" +"// 只会打包 `node` 和 `body`。\n" +"Error result = scene.Pack(node);\n" +"if (result == Error.Ok)\n" +"{\n" +" Error error = ResourceSaver.Save(scene, \"res://path/name.tscn\"); // Or " +"\"user://...\"\n" +" if (error != Error.Ok)\n" +" {\n" +" GD.PushError(\"将场景保存到磁盘时出错。\");\n" +" }\n" +"}\n" +"[/csharp]\n" +"[/codeblocks]" + msgid "Returns [code]true[/code] if the scene file has nodes." msgstr "如果场景文件有节点,返回 [code]true[/code]。" +msgid "Returns the [SceneState] representing the scene file contents." +msgstr "返回代表场景文件内容的 [SceneState]。" + msgid "" "Instantiates the scene's node hierarchy. Triggers child scene " "instantiation(s). Triggers a [constant Node.NOTIFICATION_SCENE_INSTANTIATED] " @@ -74027,6 +83213,26 @@ msgid "Returns a [PackedByteArray] with each vector encoded as bytes." msgstr "返回 [PackedByteArray],每个向量都被编码为字节。" msgid "" +"Returns a new [PackedVector2Array] with all vectors in this array inversely " +"transformed (multiplied) by the given [Transform2D] transformation matrix, " +"under the assumption that the transformation basis is orthonormal (i.e. " +"rotation/reflection is fine, scaling/skew is not).\n" +"[code]array * transform[/code] is equivalent to [code]transform.inverse() * " +"array[/code]. See [method Transform2D.inverse].\n" +"For transforming by inverse of an affine transformation (e.g. with scaling) " +"[code]transform.affine_inverse() * array[/code] can be used instead. See " +"[method Transform2D.affine_inverse]." +msgstr "" +"返回一个新的 [PackedVector2Array],该数组中的所有向量都通过给定的 " +"[Transform2D] 变换矩阵进行逆变换(乘以),假设该变换的基是正交的(即旋转/反射" +"可以,缩放/倾斜则不然)。\n" +"[code]array * transform[/code] 相当于 [code]transform.inverse() * array[/" +"code]。请参阅 [method Transform2D.inverse]。\n" +"对于通过仿射变换的逆进行变换(例如缩放),可以使用 [code]transform." +"affine_inverse() * array[/code] 代替。请参阅 [method Transform2D." +"affine_inverse]。" + +msgid "" "Returns a new [PackedVector2Array] with contents of [param right] added at " "the end of this array. For better performance, consider using [method " "append_array] instead." @@ -74111,6 +83317,26 @@ msgstr "" "slice(0, -2)[/code] 是 [code]arr.slice(0, arr.size() - 2)[/code] 的简写)。" msgid "" +"Returns a new [PackedVector3Array] with all vectors in this array inversely " +"transformed (multiplied) by the given [Transform3D] transformation matrix, " +"under the assumption that the transformation basis is orthonormal (i.e. " +"rotation/reflection is fine, scaling/skew is not).\n" +"[code]array * transform[/code] is equivalent to [code]transform.inverse() * " +"array[/code]. See [method Transform3D.inverse].\n" +"For transforming by inverse of an affine transformation (e.g. with scaling) " +"[code]transform.affine_inverse() * array[/code] can be used instead. See " +"[method Transform3D.affine_inverse]." +msgstr "" +"返回一个新的 [PackedVector3Array],该数组中的所有向量都通过给定的 " +"[Transform3D] 变换矩阵进行逆变换(乘以),假设该变换的基是正交的(即旋转/反射" +"可以,缩放/倾斜则不然)。\n" +"[code]array * transform[/code] 相当于 [code]transform.inverse() * array[/" +"code]。请参阅 [method Transform3D.inverse]。\n" +"对于通过仿射变换的逆进行变换(例如缩放),可以使用 [code]transform." +"affine_inverse() * array[/code] 代替。请参阅 [method Transform3D." +"affine_inverse]。" + +msgid "" "Returns a new [PackedVector3Array] with contents of [param right] added at " "the end of this array. For better performance, consider using [method " "append_array] instead." @@ -74195,6 +83421,20 @@ msgstr "" "则允许将对象编码(其中可能包含代码)。\n" "在内部,这使用与 [method @GlobalScope.var_to_bytes] 方法相同的编码机制。" +msgid "" +"Maximum buffer size allowed when encoding [Variant]s. Raise this value to " +"support heavier memory allocations.\n" +"The [method put_var] method allocates memory on the stack, and the buffer " +"used will grow automatically to the closest power of two to match the size of " +"the [Variant]. If the [Variant] is bigger than [member " +"encode_buffer_max_size], the method will error out with [constant " +"ERR_OUT_OF_MEMORY]." +msgstr "" +"编码 [Variant] 时允许的最大缓冲区大小。提高此值以支持更大的内存分配。\n" +"[method put_var] 方法在栈上分配内存,使用的缓冲区将自动增长到最接近的二次方," +"以匹配 [Variant] 的大小。如果 [Variant] 大于 [member encode_buffer_max_size]," +"则该方法将以 [constant ERR_OUT_OF_MEMORY] 出错。" + msgid "DTLS packet peer." msgstr "DTLS 数据包客户端。" @@ -74520,6 +83760,30 @@ msgid "The style of [PanelContainer]'s background." msgstr "[PanelContainer] 的背景样式。" msgid "" +"A material that provides a special texture to a [Sky], usually an HDR " +"panorama." +msgstr "为 [Sky] 提供特殊纹理的材质,通常是 HDR 全景图。" + +msgid "" +"A resource referenced in a [Sky] that is used to draw a background. " +"[PanoramaSkyMaterial] functions similar to skyboxes in other engines, except " +"it uses an equirectangular sky map instead of a [Cubemap].\n" +"Using an HDR panorama is strongly recommended for accurate, high-quality " +"reflections. Godot supports the Radiance HDR ([code].hdr[/code]) and OpenEXR " +"([code].exr[/code]) image formats for this purpose.\n" +"You can use [url=https://danilw.github.io/GLSL-howto/cubemap_to_panorama_js/" +"cubemap_to_panorama.html]this tool[/url] to convert a cubemap to an " +"equirectangular sky map." +msgstr "" +"在 [Sky] 中引用的用于绘制背景的资源。[PanoramaSkyMaterial] 的功能类似于其他引" +"擎的天空盒,区别在于它使用的是等距圆柱投影的天空贴图而不是 [Cubemap]。\n" +"强烈建议使用 HDR 全景图,能够得到准确、高质量的反射。为此,Godot 支持 " +"Radiance HDR([code].hdr[/code])和 OpenEXR([code].exr[/code])图像格式。\n" +"你可以使用[url=https://danilw.github.io/GLSL-howto/cubemap_to_panorama_js/" +"cubemap_to_panorama.html]这个工具[/url]将立方体贴图转换为等距圆柱投影的天空贴" +"图。" + +msgid "" "A boolean value to determine if the background texture should be filtered or " "not." msgstr "布尔值,用于确定背景纹理是否应被过滤。" @@ -74632,6 +83896,23 @@ msgid "" "it will not scroll." msgstr "复制视差图层的运动。如果一个轴被设置为 [code]0[/code],它将不会滚动。" +msgid "" +"Holds a particle configuration for [GPUParticles2D] or [GPUParticles3D] nodes." +msgstr "保存用于 [GPUParticles2D] 或 [GPUParticles3D] 节点的粒子配置。" + +msgid "" +"[ParticleProcessMaterial] defines particle properties and behavior. It is " +"used in the [code]process_material[/code] of the [GPUParticles2D] and " +"[GPUParticles3D] nodes. Some of this material's properties are applied to " +"each particle when emitted, while others can have a [CurveTexture] or a " +"[GradientTexture1D] applied to vary numerical or color values over the " +"lifetime of the particle." +msgstr "" +"[ParticleProcessMaterial] 定义了粒子的属性和行为。[GPUParticles3D] 和 " +"[GPUParticles2D] 节点的 [code]process_material[/code] 会使用这种材质。这种材质" +"的有些属性是在粒子发射时应用的,有些则会应用 [CurveTexture] 或 " +"[GradientTexture1D] 让数值或颜色值在粒子的生命周期中不断变化。" + msgid "Returns the [Texture2D] used by the specified parameter." msgstr "返回指定参数所使用的 [Texture2D]。" @@ -74657,6 +83938,11 @@ msgid "" msgstr "" "如果为 [code]true[/code],则启用指定的粒子标志。选项见 [enum ParticleFlags]。" +msgid "" +"The alpha value of each particle's color will be multiplied by this " +"[CurveTexture] over its lifetime." +msgstr "每个粒子颜色的 alpha 值将在其生命周期内乘以该 [CurveTexture]。" + msgid "Each particle's rotation will be animated along this [CurveTexture]." msgstr "每个粒子的旋转将沿着这个 [CurveTexture] 动画。" @@ -74698,6 +83984,14 @@ msgid "Each particle's animation speed will vary along this [CurveTexture]." msgstr "每个粒子的动画速度将沿着这个 [CurveTexture] 变化。" msgid "" +"If [code]true[/code], interaction with particle attractors is enabled. In 3D, " +"attraction only occurs within the area defined by the [GPUParticles3D] node's " +"[member GPUParticles3D.visibility_aabb]." +msgstr "" +"如果为 [code]true[/code],则启用与粒子吸引器的交互。在 3D 中,吸引力仅发生在 " +"[GPUParticles3D] 节点的 [member GPUParticles3D.visibility_aabb] 定义的区域内。" + +msgid "" "The particles' bounciness. Values range from [code]0[/code] (no bounce) to " "[code]1[/code] (full bounciness). Only effective if [member collision_mode] " "is [constant COLLISION_RIGID]." @@ -74713,6 +84007,34 @@ msgstr "" "粒子的摩擦。值范围从 [code]0[/code](无摩擦)到 [code]1[/code](最大摩擦)。" msgid "" +"The particles' collision mode.\n" +"[b]Note:[/b] 3D Particles can only collide with [GPUParticlesCollision3D] " +"nodes, not [PhysicsBody3D] nodes. To make particles collide with various " +"objects, you can add [GPUParticlesCollision3D] nodes as children of " +"[PhysicsBody3D] nodes. In 3D, collisions only occur within the area defined " +"by the [GPUParticles3D] node's [member GPUParticles3D.visibility_aabb].\n" +"[b]Note:[/b] 2D Particles can only collide with [LightOccluder2D] nodes, not " +"[PhysicsBody2D] nodes." +msgstr "" +"粒子的碰撞模式。\n" +"[b]注意:[/b]3D 粒子只能与 [GPUParticlesCollision3D] 节点碰撞,无法与 " +"[PhysicsBody3D] 节点碰撞。要使粒子与不同的物体碰撞,可以将 " +"[GPUParticlesCollision3D] 节点添加为 [PhysicsBody3D] 节点的子节点。在 3D 中," +"碰撞仅发生在 [GPUParticles3D] 节点的 [member GPUParticles3D.visibility_aabb] " +"定义的区域内。\n" +"[b]注意:[/b]2D 粒子只能与 [LightOccluder2D] 节点碰撞,无法与 [PhysicsBody2D] " +"节点碰撞。" + +msgid "" +"If [code]true[/code], [member GPUParticles3D.collision_base_size] is " +"multiplied by the particle's effective scale (see [member scale_min], [member " +"scale_max], [member scale_curve], and [member scale_over_velocity_curve])." +msgstr "" +"如果为 [code]true[/code],[member GPUParticles3D.collision_base_size] 乘以粒子" +"的有效缩放(请参阅 [member scale_min]、[member scale_max]、[member " +"scale_curve]、和 [member scale_over_velocity_curve])。" + +msgid "" "Each particle's initial color. If the [GPUParticles2D]'s [code]texture[/code] " "is defined, it will be multiplied by this color.\n" "[b]Note:[/b] [member color] multiplies the particle mesh's vertex colors. To " @@ -74734,6 +84056,43 @@ msgid "Damping will vary along this [CurveTexture]." msgstr "阻尼将沿着这个 [CurveTexture] 变化。" msgid "" +"A curve that specifies the velocity along each of the axes of the particle " +"system along its lifetime.\n" +"[b]Note:[/b] Animated velocities will not be affected by damping, use [member " +"velocity_limit_curve] instead." +msgstr "" +"一条曲线,指定粒子系统在其生命周期内沿每个轴的速度。\n" +"[b]注意:[/b]动画速度不会受到阻尼的影响,请使用 [member velocity_limit_curve] " +"代替。" + +msgid "" +"Maximum directional velocity value, which is multiplied by [member " +"directional_velocity_curve].\n" +"[b]Note:[/b] Animated velocities will not be affected by damping, use [member " +"velocity_limit_curve] instead." +msgstr "" +"最大方向速度值,乘以 [member directional_velocity_curve]。\n" +"[b]注意:[/b]动画速度不会受到阻尼的影响,请使用 [member velocity_limit_curve] " +"代替。" + +msgid "" +"Minimum directional velocity value, which is multiplied by [member " +"directional_velocity_curve].\n" +"[b]Note:[/b] Animated velocities will not be affected by damping, use [member " +"velocity_limit_curve] instead." +msgstr "" +"最小方向速度值,乘以 [member directional_velocity_curve]。\n" +"[b]注意:[/b]动画速度不会受到阻尼的影响,请使用 [member velocity_limit_curve] " +"代替。" + +msgid "" +"The box's extents if [member emission_shape] is set to [constant " +"EMISSION_SHAPE_BOX]." +msgstr "" +"[member emission_shape] 被设置为 [constant EMISSION_SHAPE_BOX] 时,该框的范" +"围。" + +msgid "" "Particle color will be modulated by color determined by sampling this texture " "at the same point as the [member emission_point_texture].\n" "[b]Note:[/b] [member emission_color_texture] multiplies the particle mesh's " @@ -74753,6 +84112,15 @@ msgstr "" "有可见效果。" msgid "" +"Each particle's color will be multiplied by this [CurveTexture] over its " +"lifetime.\n" +"[b]Note:[/b] This property won't have a visible effect unless the render " +"material is marked as unshaded." +msgstr "" +"每个粒子的颜色将在其生命周期内乘以该 [CurveTexture]。\n" +"[b]注意:[/b]除非渲染材质被标记为无阴影,否则该属性不会产生可见效果。" + +msgid "" "Particle velocity and rotation will be set by sampling this texture at the " "same point as the [member emission_point_texture]. Used only in [constant " "EMISSION_SHAPE_DIRECTED_POINTS]. Can be created automatically from mesh or " @@ -74764,6 +84132,13 @@ msgstr "" "择工具栏中 \"粒子 \"工具下的 \"从网格/节点创建发射点\",从网格或节点自动创建。" msgid "" +"The number of emission points if [member emission_shape] is set to [constant " +"EMISSION_SHAPE_POINTS] or [constant EMISSION_SHAPE_DIRECTED_POINTS]." +msgstr "" +"[member emission_shape] 被设置为 [constant EMISSION_SHAPE_POINTS] 或 " +"[constant EMISSION_SHAPE_DIRECTED_POINTS] 时,发射点的数量。" + +msgid "" "Particles will be emitted at positions determined by sampling this texture at " "a random position. Used with [constant EMISSION_SHAPE_POINTS] and [constant " "EMISSION_SHAPE_DIRECTED_POINTS]. Can be created automatically from mesh or " @@ -74779,6 +84154,12 @@ msgid "" "constants for values." msgstr "粒子将在这个区域内发射。使用[enum EmissionShape]常量作为值。" +msgid "The offset for the [member emission_shape], in local space." +msgstr "[member emission_shape] 在局部空间中的偏移量。" + +msgid "The scale of the [member emission_shape], in local space." +msgstr "局部空间中 [member emission_shape] 的缩放。" + msgid "Amount of [member spread] along the Y axis." msgstr "沿 Y 轴的 [member spread] 量。" @@ -74786,6 +84167,12 @@ msgid "Each particle's hue will vary along this [CurveTexture]." msgstr "每个粒子的色调将沿着这个 [CurveTexture] 变化。" msgid "" +"Percentage of the velocity of the respective [GPUParticles2D] or " +"[GPUParticles3D] inherited by each particle when spawning." +msgstr "" +"每个粒子在生成时继承的相应 [GPUParticles2D] 或 [GPUParticles3D] 的速度百分比。" + +msgid "" "Particle lifetime randomness ratio. The equation for the lifetime of a " "particle is [code]lifetime * (1.0 - randf() * lifetime_randomness)[/code]. " "For example, a [member lifetime_randomness] of [code]0.4[/code] scales the " @@ -74798,6 +84185,43 @@ msgstr "" msgid "Each particle's linear acceleration will vary along this [CurveTexture]." msgstr "每个粒子的线性加速度将沿着这个 [CurveTexture] 变化。" +msgid "" +"Each particle's orbital velocity will vary along this [CurveTexture].\n" +"[b]Note:[/b] For 3D orbital velocity, use a [CurveXYZTexture].\n" +"[b]Note:[/b] Animated velocities will not be affected by damping, use [member " +"velocity_limit_curve] instead." +msgstr "" +"每个粒子的轨道速度将沿着该 [CurveTexture] 变化。\n" +"[b]注意:[/b]对于 3D 轨道速度,请使用 [CurveXYZTexture]。\n" +"[b]注意:[/b]动画速度不会受到阻尼的影响,请使用 [member velocity_limit_curve] " +"代替。" + +msgid "" +"Maximum orbital velocity applied to each particle. Makes the particles circle " +"around origin. Specified in number of full rotations around origin per " +"second.\n" +"[b]Note:[/b] Animated velocities will not be affected by damping, use [member " +"velocity_limit_curve] instead." +msgstr "" +"应用于每个粒子的最大轨道速度。使粒子围绕原点环绕。以每秒围绕原点的完整旋转次数" +"指定。\n" +"[b]注意:[/b]动画速度不会受到阻尼的影响,请使用 [member velocity_limit_curve] " +"代替。" + +msgid "" +"Minimum equivalent of [member orbit_velocity_max].\n" +"[b]Note:[/b] Animated velocities will not be affected by damping, use [member " +"velocity_limit_curve] instead." +msgstr "" +"[member orbit_velocity_max] 的最小等效值。\n" +"[b]注意:[/b]动画速度不会受到阻尼的影响,请使用 [member velocity_limit_curve] " +"代替。" + +msgid "" +"Changes the behavior of the damping properties from a linear deceleration to " +"a deceleration based on speed percentage." +msgstr "将阻尼属性的行为从线性减速度更改为基于速度百分比的减速度。" + msgid "If [code]true[/code], particles will not move on the z axis." msgstr "如果为 [code]true[/code],则粒子将不会在 z 轴上移动。" @@ -74805,6 +84229,39 @@ msgid "Each particle's radial acceleration will vary along this [CurveTexture]." msgstr "每个粒子的径向加速度将沿着这个 [CurveTexture] 变化。" msgid "" +"A [CurveTexture] that defines the velocity over the particle's lifetime away " +"(or toward) the [member velocity_pivot].\n" +"[b]Note:[/b] Animated velocities will not be affected by damping, use [member " +"velocity_limit_curve] instead." +msgstr "" +"一个 [CurveTexture],定义粒子生命周期中远离(或朝向)[member velocity_pivot] " +"的速度。\n" +"[b]注意:[/b]动画速度不会受到阻尼的影响,请使用 [member velocity_limit_curve] " +"代替。" + +msgid "" +"Maximum radial velocity applied to each particle. Makes particles move away " +"from the [member velocity_pivot], or toward it if negative.\n" +"[b]Note:[/b] Animated velocities will not be affected by damping, use [member " +"velocity_limit_curve] instead." +msgstr "" +"应用于每个粒子的最大径向速度。使粒子远离 [member velocity_pivot],如果为负则朝" +"它移动。\n" +"[b]注意:[/b]动画速度不会受到阻尼的影响,请使用 [member velocity_limit_curve] " +"代替。" + +msgid "" +"Minimum radial velocity applied to each particle. Makes particles move away " +"from the [member velocity_pivot], or toward it if negative.\n" +"[b]Note:[/b] Animated velocities will not be affected by damping, use [member " +"velocity_limit_curve] instead." +msgstr "" +"应用于每个粒子的最小径向速度。使粒子远离 [member velocity_pivot],如果为负则朝" +"它移动。\n" +"[b]注意:[/b]动画速度不会受到阻尼的影响,请使用 [member velocity_limit_curve] " +"代替。" + +msgid "" "Each particle's scale will vary along this [CurveTexture]. If a " "[CurveXYZTexture] is supplied instead, the scale will be separated per-axis." msgstr "" @@ -74815,6 +84272,87 @@ msgid "Minimum equivalent of [member scale_max]." msgstr "[member scale_max] 对应的最小值。" msgid "" +"Either a [CurveTexture] or a [CurveXYZTexture] that scales each particle " +"based on its velocity." +msgstr "根据 [CurveTexture] 或 [CurveXYZTexture] 缩放每个粒子的速度。" + +msgid "" +"Maximum velocity value reference for [member scale_over_velocity_curve].\n" +"[member scale_over_velocity_curve] will be interpolated between [member " +"scale_over_velocity_min] and [member scale_over_velocity_max]." +msgstr "" +"[member scale_over_velocity_curve] 的最大速度参考值。\n" +"[member scale_over_velocity_curve] 将在 [member scale_over_velocity_min] 和 " +"[member scale_over_velocity_max] 之间插值。" + +msgid "" +"Minimum velocity value reference for [member scale_over_velocity_curve].\n" +"[member scale_over_velocity_curve] will be interpolated between [member " +"scale_over_velocity_min] and [member scale_over_velocity_max]." +msgstr "" +"[member scale_over_velocity_curve] 的最小速度参考值。\n" +"[member scale_over_velocity_curve] 将在 [member scale_over_velocity_min] 和 " +"[member scale_over_velocity_max] 之间插值。" + +msgid "" +"The amount of particles to spawn from the subemitter node when a collision " +"occurs. When combined with [constant COLLISION_HIDE_ON_CONTACT] on the main " +"particles material, this can be used to achieve effects such as raindrops " +"hitting the ground.\n" +"[b]Note:[/b] This value shouldn't exceed [member GPUParticles2D.amount] or " +"[member GPUParticles3D.amount] defined on the [i]subemitter node[/i] (not the " +"main node), relative to the subemitter's particle lifetime. If the number of " +"particles is exceeded, no new particles will spawn from the subemitter until " +"enough particles have expired." +msgstr "" +"发生碰撞时从子发射器节点生成的粒子数量。当与主要粒子材质上的 [constant " +"COLLISION_HIDE_ON_CONTACT] 结合使用时,可以用来实现雨滴撞击地面等效果。\n" +"[b]注意:[/b]该值不应超过[i]子发射器节点[/i](不是主节点)上定义的 [member " +"GPUParticles2D.amount] 或 [member GPUParticles3D.amount],相对于子发射器的粒子" +"寿命。如果超过粒子数量,则在足够的粒子过期之前,不会从子发射器中产生新的粒子。" + +msgid "" +"The amount of particles to spawn from the subemitter node when the particle " +"expires.\n" +"[b]Note:[/b] This value shouldn't exceed [member GPUParticles2D.amount] or " +"[member GPUParticles3D.amount] defined on the [i]subemitter node[/i] (not the " +"main node), relative to the subemitter's particle lifetime. If the number of " +"particles is exceeded, no new particles will spawn from the subemitter until " +"enough particles have expired." +msgstr "" +"粒子过期时从子发射器节点生成的粒子数量。\n" +"[b]注意:[/b]该值不应超过[i]子发射器节点[/i](不是主节点)上定义的 [member " +"GPUParticles2D.amount] 或 [member GPUParticles3D.amount],相对于子发射器的粒子" +"寿命。如果超过粒子数量,则在足够的粒子过期之前,不会从子发射器中产生新的粒子。" + +msgid "" +"The frequency at which particles should be emitted from the subemitter node. " +"One particle will be spawned every [member sub_emitter_frequency] seconds.\n" +"[b]Note:[/b] This value shouldn't exceed [member GPUParticles2D.amount] or " +"[member GPUParticles3D.amount] defined on the [i]subemitter node[/i] (not the " +"main node), relative to the subemitter's particle lifetime. If the number of " +"particles is exceeded, no new particles will spawn from the subemitter until " +"enough particles have expired." +msgstr "" +"从子发射器节点发射粒子的频率。每 [member sub_emitter_frequency] 秒就会产生一个" +"粒子。\n" +"[b]注意:[/b]该值不应超过[i]子发射器节点[/i](不是主节点)上定义的 [member " +"GPUParticles2D.amount] 或 [member GPUParticles3D.amount],相对于子发射器的粒子" +"寿命。如果超过粒子数量,则在足够的粒子过期之前,不会从子发射器中产生新的粒子。" + +msgid "" +"If [code]true[/code], the subemitter inherits the parent particle's velocity " +"when it spawns." +msgstr "如果为 [code]true[/code],则子发射器在其生成时继承父粒子的速度。" + +msgid "" +"The particle subemitter mode (see [member GPUParticles2D.sub_emitter] and " +"[member GPUParticles3D.sub_emitter])." +msgstr "" +"粒子子发射器模式(参见 [member GPUParticles2D.sub_emitter] 和 [member " +"GPUParticles3D.sub_emitter])。" + +msgid "" "Each particle's tangential acceleration will vary along this [CurveTexture]." msgstr "每个粒子的切向加速度将沿着这个 [CurveTexture] 变化。" @@ -74920,6 +84458,15 @@ msgid "" msgstr "湍流噪声强度。增加此值将导致更强烈、对比度更高的噪声图案。" msgid "" +"A [CurveTexture] that defines the maximum velocity of a particle during its " +"lifetime." +msgstr "定义粒子在其生命周期内的最大速度的 [CurveTexture]。" + +msgid "" +"A pivot point used to calculate radial and orbital velocity of particles." +msgstr "用于计算粒子的径向速度和轨道速度的轴心点。" + +msgid "" "Use with [method set_param_min], [method set_param_max], and [method " "set_param_texture] to set initial velocity properties." msgstr "" @@ -75004,6 +84551,27 @@ msgstr "" "set_param_texture] 一起使用,设置动画偏移属性。" msgid "" +"Use with [method set_param_min], [method set_param_max], and [method " +"set_param_texture] to set radial velocity properties." +msgstr "" +"与 [method set_param_min]、[method set_param_max] 和 [method " +"set_param_texture] 一起使用来设置径向速度属性。" + +msgid "" +"Use with [method set_param_min], [method set_param_max], and [method " +"set_param_texture] to set directional velocity properties." +msgstr "" +"与 [method set_param_min]、[method set_param_max] 和 [method " +"set_param_texture] 一起使用来设置定向速度属性。" + +msgid "" +"Use with [method set_param_min], [method set_param_max], and [method " +"set_param_texture] to set scale over velocity properties." +msgstr "" +"与 [method set_param_min]、[method set_param_max] 和 [method " +"set_param_texture] 一起使用来设置速度属性的缩放。" + +msgid "" "Particles will be emitted at a position determined by sampling a random point " "on the [member emission_point_texture]. Particle color will be modulated by " "[member emission_color_texture]." @@ -75687,6 +85255,14 @@ msgid "Number of islands in the 3D physics engine. [i]Lower is better.[/i]" msgstr "3D 物理引擎中孤岛的数量。[i]越低越好。[/i]" msgid "" +"Output latency of the [AudioServer]. Equivalent to calling [method " +"AudioServer.get_output_latency], it is not recommended to call this every " +"frame." +msgstr "" +"[AudioServer] 的输出延迟。相当于调用 [method AudioServer.get_output_latency]," +"不建议每帧都调用该方法。" + +msgid "" "Number of active navigation maps in the [NavigationServer3D]. This also " "includes the two empty default navigation maps created by World2D and World3D." msgstr "" @@ -75954,6 +85530,11 @@ msgid "" msgstr "在这种模式下,物体的阻尼值将替换掉区域中设置的任何值或默认值。" msgid "" +"A material that defines a sky for a [Sky] resource by a set of physical " +"properties." +msgstr "通过一组物理属性定义 [Sky] 资源的天空的材质。" + +msgid "" "The [PhysicalSkyMaterial] uses the Preetham analytic daylight model to draw a " "sky based on physical properties. This results in a substantially more " "realistic sky than the [ProceduralSkyMaterial], but it is slightly slower and " @@ -77205,8 +86786,8 @@ msgstr "" "对其状态进行查询,获取碰撞和相交信息,并且可以修改部分仿真参数。\n" "- [i]Shape(形状)[/i]是圆形、矩形、胶囊形、多边形等几何形状。加入到实体/区域" "中就可以用来进行碰撞检测,还可以带有相对于实体/区域原点的额外变换。实体/区域中" -"可以添加多个(变换后的)形状,同一个形状可以使用不同的局部变换添加到实体/区域" -"中。\n" +"可以添加多个(变换后的)形状,并且可以使用不同的局部变换将单个形状多次添加到实" +"体/区域中。\n" "- [i]Body(实体)[/i]是物理对象,可以处于静态、运动学或刚性模式。可以对其状态" "进行查询和更新(例如位置、速度等)。可以设置力的集成回调,自定义实体的物理特" "性。\n" @@ -77306,6 +86887,11 @@ msgid "" "area's array of shapes." msgstr "返回该区域的形状数组中给定索引的形状的局部变换矩阵。" +msgid "" +"Returns the [RID] of the space assigned to the area. Returns an empty [RID] " +"if no space is assigned." +msgstr "返回分配给该区域的空间 [RID]。如果没有分配空间,则返回空 [RID]。" + msgid "Returns the transform matrix of the area." msgstr "返回该区域的变换矩阵。" @@ -77667,6 +87253,11 @@ msgid "Returns the number of shapes added to the body." msgstr "返回添加至该物体的形状的数量。" msgid "" +"Returns the [RID] of the space assigned to the body. Returns an empty [RID] " +"if no space is assigned." +msgstr "返回分配给该实体的空间的 [RID]。如果没有分配空间,则返回空 [RID]。" + +msgid "" "Returns the value of the given state of the body. See [enum BodyState] for " "the list of available states." msgstr "返回该实体给定状态的值。有关可用状态的列表,请参阅 [enum BodyState]。" @@ -77985,15 +87576,33 @@ msgid "Makes the joint a groove joint." msgstr "使关节成为凹槽关节。" msgid "" +"Makes the joint a pin joint. If [param body_b] is an empty [RID], then [param " +"body_a] is pinned to the point [param anchor] (given in global coordinates); " +"otherwise, [param body_a] is pinned to [param body_b] at the point [param " +"anchor] (given in global coordinates). To set the parameters which are " +"specific to the pin joint, see [method pin_joint_set_param]." +msgstr "" +"使关节成为一个销关节。如果 [param body_b] 是一个空 [RID],则 [param body_a] 被" +"固定到点 [param anchor](在全局坐标中给出); 否则,[param body_a] 在 [param " +"anchor] 点被固定到 [param body_b](在全局坐标中给出)。要设置特定于销关节的参" +"数,请参阅 [method pin_joint_set_param]。" + +msgid "" "Sets the value of the given joint parameter. See [enum JointParam] for the " "list of available parameters." msgstr "设置给定关节参数的值。可用参数的列表见 [enum JointParam]。" +msgid "Gets a pin joint flag (see [enum PinJointFlag] constants)." +msgstr "获取销关节标志(请参阅 [enum PinJointFlag] 常量)。" + msgid "" "Returns the value of a pin joint parameter. See [enum PinJointParam] for a " "list of available parameters." msgstr "返回销关节参数的值。有关可用参数列表,请参阅 [enum PinJointParam]。" +msgid "Sets a pin joint flag (see [enum PinJointFlag] constants)." +msgstr "设置销关节标志(请参阅 [enum PinJointFlag] 常量)。" + msgid "" "Sets a pin joint parameter. See [enum PinJointParam] for a list of available " "parameters." @@ -78044,6 +87653,60 @@ msgid "Returns the shape's type (see [enum ShapeType])." msgstr "返回该形状的类型(见 [enum ShapeType])。" msgid "" +"Sets the shape data that defines the configuration of the shape. The [param " +"data] to be passed depends on the shape's type (see [method " +"shape_get_type]):\n" +"- [constant SHAPE_WORLD_BOUNDARY]: an array of length two containing a " +"[Vector2] [code]normal[/code] direction and a [float] distance [code]d[/" +"code],\n" +"- [constant SHAPE_SEPARATION_RAY]: a dictionary containing the key " +"[code]length[/code] with a [float] value and the key [code]slide_on_slope[/" +"code] with a [bool] value,\n" +"- [constant SHAPE_SEGMENT]: a [Rect2] [code]rect[/code] containing the first " +"point of the segment in [code]rect.position[/code] and the second point of " +"the segment in [code]rect.size[/code],\n" +"- [constant SHAPE_CIRCLE]: a [float] [code]radius[/code],\n" +"- [constant SHAPE_RECTANGLE]: a [Vector2] [code]half_extents[/code],\n" +"- [constant SHAPE_CAPSULE]: an array of length two (or a [Vector2]) " +"containing a [float] [code]height[/code] and a [float] [code]radius[/code],\n" +"- [constant SHAPE_CONVEX_POLYGON]: either a [PackedVector2Array] of points " +"defining a convex polygon in counterclockwise order (the clockwise outward " +"normal of each segment formed by consecutive points is calculated " +"internally), or a [PackedFloat32Array] of length divisible by four so that " +"every 4-tuple of [float]s contains the coordinates of a point followed by the " +"coordinates of the clockwise outward normal vector to the segment between the " +"current point and the next point,\n" +"- [constant SHAPE_CONCAVE_POLYGON]: a [PackedVector2Array] of length " +"divisible by two (each pair of points forms one segment).\n" +"[b]Warning:[/b] In the case of [constant SHAPE_CONVEX_POLYGON], this method " +"does not check if the points supplied actually form a convex polygon (unlike " +"the [member CollisionPolygon2D.polygon] property)." +msgstr "" +"设置定义形状配置的形状数据。要传递的 [param data] 取决于形状的类型(参见 " +"[method shape_get_type]):\n" +"- [constant SHAPE_WORLD_BOUNDARY]:长度为 2 的数组,包含 [Vector2] 类型的 " +"[code]normal[/code] 方向和 [float] 类型的距离 [code]d[/code],\n" +"- [constant SHAPE_SEPARATION_RAY]:字典,包含键 [code]length[/code] 和 " +"[float] 值、以及键 [code]slide_on_slope[/code] 和 [bool] 值,\n" +"- [constant SHAPE_SEGMENT]:[Rect2] 类型的 [code]rect[/code],以 [code]rect." +"position[/code] 表示线段中的第一个点,并以 [code]rect.size[/code] 表示线段中的" +"第二个点,\n" +"- [constant SHAPE_CIRCLE]:[float] 类型的 [code]radius[/code],\n" +"- [constant SHAPE_RECTANGLE]:[Vector2] 类型的 [code]half_extents[/code],\n" +"- [constant SHAPE_CAPSULE]:长度为 2 的数组(或一个 [Vector2]),包含一个 " +"[float] 类型的 [code]height[/code] 和一个 [float] 类型的 [code]radius[/" +"code],\n" +"- [constant SHAPE_CONVEX_POLYGON]:按逆时针顺序定义凸多边形的点的 " +"[PackedVector2Array](在内部使用由连续点形成的每个线段的顺时针向外法线计算);" +"或一个长度可被 4 整除的 [PackedFloat32Array],以便每个 4 元组的 [float] 包含一" +"个点的坐标,后跟一个向量的坐标表示,该向量是当前点和下一个点之间的线段的顺时针" +"向外法向量,\n" +"- [constant SHAPE_CONCAVE_POLYGON]:长度可被 2 整除的 [PackedVector2Array](每" +"对点形成一个线段)。\n" +"[b]警告:[/b]在 [constant SHAPE_CONVEX_POLYGON] 的情况下,该方法不检查提供的点" +"是否能够形成凸多边形(与 [member CollisionPolygon2D.polygon] 属性不同)。" + +msgid "" "Creates a 2D space in the physics server, and returns the [RID] that " "identifies it. A space contains bodies and areas, and controls the stepping " "of the physics simulation of the objects in it." @@ -78548,6 +88211,21 @@ msgstr "" "常量,用于设置/获取销关节的纽带可以弯曲多少。该参数的默认值为 [code]0.0[/" "code]。" +msgid "The maximum rotation around the pin." +msgstr "绕该销的最大旋转。" + +msgid "The minimum rotation around the pin." +msgstr "绕该销的最小旋转。" + +msgid "Target speed for the motor. In radians per second." +msgstr "马达的目标速度。单位为弧度每秒。" + +msgid "If [code]true[/code], the pin has a maximum and a minimum rotation." +msgstr "如果为 [code]true[/code],则销关节具有最大和最小旋转。" + +msgid "If [code]true[/code], a motor turns the pin." +msgstr "如果为 [code]true[/code],则马达将转动该销。" + msgid "" "Sets the resting length of the spring joint. The joint will always try to go " "to back this length when pulled apart. The default value of this parameter is " @@ -78660,6 +88338,66 @@ msgid "A server interface for low-level 3D physics access." msgstr "用于访问低阶 3D 物理的服务器接口。" msgid "" +"PhysicsServer3D is the server responsible for all 3D physics. It can directly " +"create and manipulate all physics objects:\n" +"- A [i]space[/i] is a self-contained world for a physics simulation. It " +"contains bodies, areas, and joints. Its state can be queried for collision " +"and intersection information, and several parameters of the simulation can be " +"modified.\n" +"- A [i]shape[/i] is a geometric shape such as a sphere, a box, a cylinder, or " +"a polygon. It can be used for collision detection by adding it to a body/" +"area, possibly with an extra transformation relative to the body/area's " +"origin. Bodies/areas can have multiple (transformed) shapes added to them, " +"and a single shape can be added to bodies/areas multiple times with different " +"local transformations.\n" +"- A [i]body[/i] is a physical object which can be in static, kinematic, or " +"rigid mode. Its state (such as position and velocity) can be queried and " +"updated. A force integration callback can be set to customize the body's " +"physics.\n" +"- An [i]area[/i] is a region in space which can be used to detect bodies and " +"areas entering and exiting it. A body monitoring callback can be set to " +"report entering/exiting body shapes, and similarly an area monitoring " +"callback can be set. Gravity and damping can be overridden within the area by " +"setting area parameters.\n" +"- A [i]joint[/i] is a constraint, either between two bodies or on one body " +"relative to a point. Parameters such as the joint bias and the rest length of " +"a spring joint can be adjusted.\n" +"Physics objects in [PhysicsServer3D] may be created and manipulated " +"independently; they do not have to be tied to nodes in the scene tree.\n" +"[b]Note:[/b] All the 3D physics nodes use the physics server internally. " +"Adding a physics node to the scene tree will cause a corresponding physics " +"object to be created in the physics server. A rigid body node registers a " +"callback that updates the node's transform with the transform of the " +"respective body object in the physics server (every physics update). An area " +"node registers a callback to inform the area node about overlaps with the " +"respective area object in the physics server. The raycast node queries the " +"direct state of the relevant space in the physics server." +msgstr "" +"PhysicsServer3D 是负责所有 3D 物理的服务器。它可以直接创建和操作所有物理对" +"象:\n" +"- [i]Space(空间)[/i]是用于物理仿真的自包含世界。它包含实体、区域和关节。可以" +"对其状态进行查询,获取碰撞和相交信息,并且可以修改部分仿真参数。\n" +"- [i]Shape(形状)[/i]是球形、盒形、圆柱形、多边形等几何形状。加入到实体/区域" +"中就可以用来进行碰撞检测,还可以带有相对于实体/区域原点的额外变换。实体/区域中" +"可以添加多个(变换后的)形状,并且可以使用不同的局部变换将单个形状多次添加到实" +"体/区域中。\n" +"- [i]Body(实体)[/i]是物理对象,可以处于静态、运动学或刚性模式。可以对其状态" +"进行查询和更新(例如位置、速度等)。可以设置力的集成回调,自定义实体的物理特" +"性。\n" +"- [i]Area(区域)[/i]是空间中的区块,可用于检测进入和离开它的实体和区域。可以" +"设置实体的监视回调,报告进入/离开的实体形状,同样可以设置区域的监视回调。通过" +"设置区域参数,可以在区域内覆盖重力和阻尼。\n" +"- [i]Joint(关节)[/i]是两个实体之间或一个实体相对于某个点的约束。可以调整关节" +"偏置和弹簧关节的放松长度等参数。\n" +"[PhysicsServer3D] 中的物理对象可以独立创建和操作;不必将它们绑定到场景树中的节" +"点。\n" +"[b]注意:[/b]所有 3D 物理节点都在内部使用这个物理服务器。将物理节点添加到场景" +"树,就会导致在物理服务器中创建相应的物理对象。刚体节点会注册回调,该回调会(在" +"每次物理更新时)使用物理服务器中相应实体对象的变换更新该节点的变换。区域节点会" +"注册回调,用来通知区域节点与物理服务器中相应区域对象的重叠。射线投射节点会查询" +"物理服务器中相关空间的直接状态。" + +msgid "" "Adds a shape to the area, along with a transform matrix. Shapes are usually " "referenced by their index, so you should track which shape has a given index." msgstr "" @@ -78961,6 +88699,21 @@ msgstr "" "连续碰撞检测尝试预测运动物体碰撞的位置,而不是在碰撞时移动物体并纠正其运动。" msgid "" +"Sets the function used to calculate physics for an object, if that object " +"allows it (see [method body_set_omit_force_integration]). The force " +"integration function takes 2 arguments:\n" +"- [code]state[/code] — [PhysicsDirectBodyState3D] used to retrieve and modify " +"the body's state.\n" +"- [code skip-lint]userdata[/code] — optional user data passed to [method " +"body_set_force_integration_callback]." +msgstr "" +"如果对象允许的话,设置用于计算该对象物理的函数(见 [method " +"body_set_omit_force_integration])。力的积分函数有 2 个参数:\n" +"[code]state[/code] — [PhysicsDirectBodyState3D] 用于检索和修改物体的状态。\n" +"[code skip-lint]userdata[/code] — 可选的用户数据,如果在调用 [method " +"body_set_force_integration_callback] 时被传递。" + +msgid "" "Sets the maximum contacts to report. Bodies can keep a log of the contacts " "with other bodies. This is enabled by setting the maximum number of contacts " "reported to a number greater than 0." @@ -79593,6 +89346,45 @@ msgstr "" "供柔体渲染处理器的类。" msgid "" +"Called by the [PhysicsServer3D] to set the bounding box for the [SoftBody3D]." +msgstr "由 [PhysicsServer3D] 调用以设置 [SoftBody3D] 的边界框。" + +msgid "" +"Called by the [PhysicsServer3D] to set the normal for the [SoftBody3D] vertex " +"at the index specified by [param vertex_id].\n" +"[b]Note:[/b] The [param normal] parameter used to be of type [code]const " +"void*[/code] prior to Godot 4.2." +msgstr "" +"由 [PhysicsServer3D] 调用,以在 [param vertex_id] 指定的索引处设置 " +"[SoftBody3D] 顶点的法线。\n" +"[b]注意:[/b]在 Godot 4.2 之前,[param normal] 参数的类型为 [code]const " +"void*[/code]。" + +msgid "" +"Called by the [PhysicsServer3D] to set the position for the [SoftBody3D] " +"vertex at the index specified by [param vertex_id].\n" +"[b]Note:[/b] The [param vertex] parameter used to be of type [code]const " +"void*[/code] prior to Godot 4.2." +msgstr "" +"由 [PhysicsServer3D] 调用,以在 [param vertex_id] 指定的索引处设置 " +"[SoftBody3D] 顶点的位置。\n" +"[b]注意:[/b]在 Godot 4.2 之前,[param vertex] 参数的类型为 [code]const " +"void*[/code]。" + +msgid "Sets the bounding box for the [SoftBody3D]." +msgstr "设置该 [SoftBody3D] 的边界框。" + +msgid "" +"Sets the normal for the [SoftBody3D] vertex at the index specified by [param " +"vertex_id]." +msgstr "在由 [param vertex_id] 指定的索引处设置该 [SoftBody3D] 顶点的法线。" + +msgid "" +"Sets the position for the [SoftBody3D] vertex at the index specified by " +"[param vertex_id]." +msgstr "在由 [param vertex_id] 指定的索引处设置该 [SoftBody3D] 顶点的位置。" + +msgid "" "Provides parameters for [method PhysicsDirectSpaceState2D.intersect_shape]." msgstr "为 [method PhysicsDirectSpaceState2D.intersect_shape] 提供参数。" @@ -80034,6 +89826,30 @@ msgstr "" "将两个 2D 物理体通过单点进行连接的物理关节,能够让它们自由旋转。例如可以将 " "[RigidBody2D] 连接到 [StaticBody2D] 上,从而创建钟摆或跷跷板。" +msgid "" +"If [code]true[/code], the pin maximum and minimum rotation, defined by " +"[member angular_limit_lower] and [member angular_limit_upper] are applied." +msgstr "" +"如果为 [code]true[/code],则应用由 [member angular_limit_lower] 和 [member " +"angular_limit_upper] 定义的销的最大和最小旋转。" + +msgid "" +"The minimum rotation. Only active if [member angular_limit_enabled] is " +"[code]true[/code]." +msgstr "" +"最小的旋转量。只有在 [member angular_limit_enabled] 为 [code]true[/code] 时才" +"有效。" + +msgid "" +"The maximum rotation. Only active if [member angular_limit_enabled] is " +"[code]true[/code]." +msgstr "" +"最大的旋转量。只有在 [member angular_limit_enabled] 为 [code]true[/code] 时才" +"有效。" + +msgid "When activated, a motor turns the pin." +msgstr "激活后,马达会转动该销。" + msgid "The higher this value, the more the bond to the pinned partner can flex." msgstr "这个值越高,与被牵制的两个物体之间的的联系就越灵活。" @@ -80043,6 +89859,14 @@ msgid "" msgstr "将两个 3D 物理体通过单点进行连接的物理关节,能够让它们自由旋转。" msgid "" +"A physics joint that attaches two 3D physics bodies at a single point, " +"allowing them to freely rotate. For example, a [RigidBody3D] can be attached " +"to a [StaticBody3D] to create a pendulum or a seesaw." +msgstr "" +"将两个 3D 物理体通过单点进行连接的物理关节,能够让它们自由旋转。例如,可以将 " +"[RigidBody3D] 连接到 [StaticBody3D] 上,从而创建钟摆或跷跷板。" + +msgid "" "The force with which the pinned objects stay in positional relation to each " "other. The higher, the stronger." msgstr "被钉在一起的物体之间保持位置关系的力,越高越强。" @@ -80060,9 +89884,41 @@ msgstr "如果大于 0,则这个值是此 Joint3D 产生的冲量的最大值 msgid "A [Cubemap] without image data." msgstr "没有图像数据的 [Cubemap] 。" +msgid "" +"This class replaces a [Cubemap] or a [Cubemap]-derived class in 2 " +"conditions:\n" +"- In dedicated server mode, where the image data shouldn't affect game logic. " +"This allows reducing the exported PCK's size significantly.\n" +"- When the [Cubemap]-derived class is missing, for example when using a " +"different engine version.\n" +"[b]Note:[/b] This class is not intended for rendering or for use in shaders. " +"Operations like calculating UV are not guaranteed to work." +msgstr "" +"该类在以下两种情况下替换 [Cubemap] 或 [Cubemap] 派生类:\n" +"- 在专用服务器模式下,图像数据不应影响游戏逻辑。这样能够显著减小导出的 PCK 的" +"大小。\n" +"- 当 [Cubemap] 派生类丢失时,例如使用不同的引擎版本时。\n" +"[b]注意:[/b]该类不适用于渲染或在着色器中使用。不保证计算 UV 之类的操作有效。" + msgid "A [CubemapArray] without image data." msgstr "没有图像数据的 [CubemapArray] 。" +msgid "" +"This class replaces a [CubemapArray] or a [CubemapArray]-derived class in 2 " +"conditions:\n" +"- In dedicated server mode, where the image data shouldn't affect game logic. " +"This allows reducing the exported PCK's size significantly.\n" +"- When the [CubemapArray]-derived class is missing, for example when using a " +"different engine version.\n" +"[b]Note:[/b] This class is not intended for rendering or for use in shaders. " +"Operations like calculating UV are not guaranteed to work." +msgstr "" +"该类在以下两种情况下替换 [CubemapArray] 或 [CubemapArray] 派生类:\n" +"- 在专用服务器模式下,图像数据不应影响游戏逻辑。这样能够显著减小导出的 PCK 的" +"大小。\n" +"- 当 [CubemapArray] 派生类丢失时,例如使用不同的引擎版本时。\n" +"[b]注意:[/b]该类不适用于渲染或在着色器中使用。不保证计算 UV 之类的操作有效。" + msgid "Placeholder class for a material." msgstr "材质的占位类。" @@ -80305,6 +90161,34 @@ msgid "" "Returns the orthogonal projection of [param point] into a point in the plane." msgstr "返回 [param point] 在该平面中的正交投影。" +msgid "" +"The distance from the origin to the plane, expressed in terms of [member " +"normal] (according to its direction and magnitude). Actual absolute distance " +"from the origin to the plane can be calculated as [code]abs(d) / normal." +"length()[/code] (if [member normal] has zero length then this [Plane] does " +"not represent a valid plane).\n" +"In the scalar equation of the plane [code]ax + by + cz = d[/code], this is " +"[code skip-lint]d[/code], while the [code](a, b, c)[/code] coordinates are " +"represented by the [member normal] property." +msgstr "" +"从原点到平面的距离,按照 [member normal] 取值(根据其方向和长度)。原点与平面" +"的实际绝对距离可以通过 [code]abs(d) / normal.length()[/code] 计算(如果 " +"[member normal] 长度为零,则该 [Plane] 表示的不是有效平面)。\n" +"在平面 [code]ax + by + cz = d[/code] 的标量方程中,这是 [code skip-lint]d[/" +"code],而 [code](a, b, c)[/code] 坐标由 [member normal] 属性表示。" + +msgid "" +"The normal of the plane, typically a unit vector. Shouldn't be a zero vector " +"as [Plane] with such [member normal] does not represent a valid plane.\n" +"In the scalar equation of the plane [code]ax + by + cz = d[/code], this is " +"the vector [code](a, b, c)[/code], where [code skip-lint]d[/code] is the " +"[member d] property." +msgstr "" +"该平面的法线,通常为单位向量。不应该为零向量,因为 [member normal] 为零的 " +"[Plane] 代表的不是有效平面。\n" +"在平面 [code]ax + by + cz = d[/code] 的标量方程中,这是向量 [code](a, b, c)[/" +"code],其中 [code skip-lint]d[/code] 是 [member d] 属性。" + msgid "The X component of the plane's [member normal] vector." msgstr "平面法向量 [member normal] 的 X 分量。" @@ -80333,6 +90217,16 @@ msgstr "" "靠。" msgid "" +"Inversely transforms (multiplies) the [Plane] by the given [Transform3D] " +"transformation matrix.\n" +"[code]plane * transform[/code] is equivalent to [code]transform." +"affine_inverse() * plane[/code]. See [method Transform3D.affine_inverse]." +msgstr "" +"将 [Plane] 逆向变换(乘以)给定的 [Transform3D] 变换矩阵。\n" +"[code]plane * transform[/code] 相当于 [code]transform.affine_inverse() * " +"plane[/code]。请参阅 [method Transform3D.affine_inverse]。" + +msgid "" "Returns [code]true[/code] if the planes are exactly equal.\n" "[b]Note:[/b] Due to floating-point precision errors, consider using [method " "is_equal_approx] instead, which is more reliable." @@ -80498,6 +90392,14 @@ msgstr "" "分配的 [member skeleton] 所使用的 [Bone2D] 节点的内部列表。使用 Polygon2D 编辑" "器编辑(顶部工具栏的“UV”按钮)。" +msgid "" +"The polygon's fill color. If [member texture] is set, it will be multiplied " +"by this color. It will also be the default color for vertices not set in " +"[member vertex_colors]." +msgstr "" +"该多边形的填充颜色。如果设置了 [member texture],它将乘以该颜色。它也将是未在 " +"[member vertex_colors] 中设置的顶点的默认颜色。" + msgid "Number of internal vertices, used for UV mapping." msgstr "内部顶点的数量,用于 UV 映射。" @@ -80547,10 +90449,44 @@ msgstr "" "指向 [Skeleton2D] 节点的路径,用于对这个多边形进行基于骨架的变形。如果为空或无" "效,则不会使用骨架变形。" +msgid "The polygon's fill texture. Use [member uv] to set texture coordinates." +msgstr "该多边形的填充纹理。使用 [member uv] 设置纹理坐标。" + +msgid "" +"Amount to offset the polygon's [member texture]. If set to [code]Vector2(0, 0)" +"[/code], the texture's origin (its top-left corner) will be placed at the " +"polygon's position." +msgstr "" +"多边形的 [member texture] 纹理的偏移量。如果设置为 [code]Vector2(0, 0)[/" +"code],则纹理的原点(其左上角)将放置在该多边形的位置。" + msgid "The texture's rotation in radians." msgstr "纹理的旋转弧度。" msgid "" +"Amount to multiply the [member uv] coordinates when using [member texture]. " +"Larger values make the texture smaller, and vice versa." +msgstr "" +"使用 [member texture] 时乘以 [member uv] 坐标的量。值越大,纹理越小,反之亦" +"然。" + +msgid "" +"Texture coordinates for each vertex of the polygon. There should be one UV " +"value per polygon vertex. If there are fewer, undefined vertices will use " +"[code]Vector2(0, 0)[/code]." +msgstr "" +"多边形每个顶点的纹理坐标。每个多边形顶点应该有一个 UV 值。如果数量少,则未定义" +"的顶点将使用 [code]Vector2(0, 0)[/code]。" + +msgid "" +"Color for each vertex. Colors are interpolated between vertices, resulting in " +"smooth gradients. There should be one per polygon vertex. If there are fewer, " +"undefined vertices will use [member color]." +msgstr "" +"每个顶点的颜色。颜色在顶点之间插值,从而产生平滑的渐变。每个多边形顶点应该有一" +"个。如果数量较少,则未定义的顶点将使用 [member color]。" + +msgid "" "Flat 2D polygon shape for use with occlusion culling in [OccluderInstance3D]." msgstr "平面 2D 多边形形状,用于 [OccluderInstance3D] 的遮挡剔除。" @@ -80649,6 +90585,21 @@ msgstr "" "[code]2147483647[/code]。" msgid "" +"Checks the provided [param event] against the [PopupMenu]'s shortcuts and " +"accelerators, and activates the first item with matching events. If [param " +"for_global_only] is [code]true[/code], only shortcuts and accelerators with " +"[code]global[/code] set to [code]true[/code] will be called.\n" +"Returns [code]true[/code] if an item was successfully activated.\n" +"[b]Note:[/b] Certain [Control]s, such as [MenuButton], will call this method " +"automatically." +msgstr "" +"根据 [PopupMenu] 的快捷键和加速器检查提供的 [param event],并激活匹配事件的第" +"一个项目。如果 [param for_global_only] 为 [code]true[/code],则仅调用 " +"[code]global[/code] 被设置为 [code]true[/code] 的快捷键和加速器。\n" +"如果项目已成功激活,则返回 [code]true[/code]。\n" +"[b]注意:[/b]某些 [Control],例如 [MenuButton],会自动调用该方法。" + +msgid "" "Adds a new checkable item with text [param label].\n" "An [param id] can optionally be provided, as well as an accelerator ([param " "accel]). If no [param id] is provided, one will be created from the index. If " @@ -80741,6 +90692,19 @@ msgid "Same as [method add_icon_check_shortcut], but uses a radio check button." msgstr "与 [method add_icon_check_shortcut] 相同,但使用一个单选按钮。" msgid "" +"Adds a new item and assigns the specified [Shortcut] and icon [param texture] " +"to it. Sets the label of the checkbox to the [Shortcut]'s name.\n" +"An [param id] can optionally be provided. If no [param id] is provided, one " +"will be created from the index.\n" +"If [param allow_echo] is [code]true[/code], the shortcut can be activated " +"with echo events." +msgstr "" +"添加新的菜单项,并为其分配指定的 [Shortcut] 和图标 [param texture]。复选框的标" +"签会被设为 [Shortcut] 的名称。\n" +"还可以提供 [param id]。如果没有提供 [param id],则会根据索引来创建。\n" +"如果 [param allow_echo] 为 [code]true[/code],则快捷键可以被回响事件激活。" + +msgid "" "Adds a new item with text [param label].\n" "An [param id] can optionally be provided, as well as an accelerator ([param " "accel]). If no [param id] is provided, one will be created from the index. If " @@ -80828,6 +90792,39 @@ msgstr "" "还可以提供 [param label],会在分隔线的中间位置显示。" msgid "" +"Adds a [Shortcut].\n" +"An [param id] can optionally be provided. If no [param id] is provided, one " +"will be created from the index.\n" +"If [param allow_echo] is [code]true[/code], the shortcut can be activated " +"with echo events." +msgstr "" +"添加 [Shortcut]。\n" +"还可以提供 [param id]。如果没有提供 [param id],则会根据索引来创建。\n" +"如果 [param allow_echo] 为 [code]true[/code],则快捷键可以被回响事件激活。" + +msgid "" +"Adds an item that will act as a submenu of the parent [PopupMenu] node when " +"clicked. The [param submenu] argument must be the name of an existing " +"[PopupMenu] that has been added as a child to this node. This submenu will be " +"shown when the item is clicked, hovered for long enough, or activated using " +"the [code]ui_select[/code] or [code]ui_right[/code] input actions.\n" +"An [param id] can optionally be provided. If no [param id] is provided, one " +"will be created from the index." +msgstr "" +"添加菜单项,点击时会作为父级 [PopupMenu] 节点的子菜单。[param submenu] 参数必" +"须是已作为子节点添加到此节点的现有 [PopupMenu] 的名称。当点击该项目、悬停足够" +"长的时间、或使用 [code]ui_select[/code] 或 [code]ui_right[/code] 输入操作激活" +"该子菜单时,将显示该子菜单。\n" +"还可以提供 [param id]。如果没有提供 [param id],则会根据索引来创建。" + +msgid "" +"Removes all items from the [PopupMenu]. If [param free_submenus] is " +"[code]true[/code], the submenu nodes are automatically freed." +msgstr "" +"移除 [PopupMenu] 中的所有项目。如果 [param free_submenus] 为 [code]true[/" +"code],则自动释放子菜单节点。" + +msgid "" "Returns the index of the currently focused item. Returns [code]-1[/code] if " "no item is focused." msgstr "返回当前焦点项目的索引。如果没有焦点,则返回 [code]-1[/code]。" @@ -81421,6 +91418,39 @@ msgstr "沿 Y 轴添加的边循环数。" msgid "Number of added edge loops along the X axis." msgstr "沿 X 轴添加的边循环数。" +msgid "A material that defines a simple sky for a [Sky] resource." +msgstr "一种材质,可为 [Sky] 资源定义简单天空。" + +msgid "" +"[ProceduralSkyMaterial] provides a way to create an effective background " +"quickly by defining procedural parameters for the sun, the sky and the " +"ground. The sky and ground are defined by a main color, a color at the " +"horizon, and an easing curve to interpolate between them. Suns are described " +"by a position in the sky, a color, and a max angle from the sun at which the " +"easing curve ends. The max angle therefore defines the size of the sun in the " +"sky.\n" +"[ProceduralSkyMaterial] supports up to 4 suns, using the color, and energy, " +"direction, and angular distance of the first four [DirectionalLight3D] nodes " +"in the scene. This means that the suns are defined individually by the " +"properties of their corresponding [DirectionalLight3D]s and globally by " +"[member sun_angle_max] and [member sun_curve].\n" +"[ProceduralSkyMaterial] uses a lightweight shader to draw the sky and is " +"therefore suited for real time updates. This makes it a great option for a " +"sky that is simple and computationally cheap, but unrealistic. If you need a " +"more realistic procedural option, use [PhysicalSkyMaterial]." +msgstr "" +"[ProceduralSkyMaterial] 提供了一种通过为太阳、天空、和地面定义程序参数,来快速" +"创建一个有效背景的方法。天空和地面由主颜色、地平线颜色、以及在它们之间插值的缓" +"动曲线定义。太阳通过天空中的位置、颜色、以及缓动曲线结束时距太阳的最大角度来描" +"述。因此,最大角度定义了天空中太阳的大小。\n" +"[ProceduralSkyMaterial] 支持最多 4 个太阳,它们使用场景中前四个 " +"[DirectionalLight3D] 节点的颜色、能量、方向、和角距离。这意味着太阳由其相应的 " +"[DirectionalLight3D] 的属性单独定义,并由 [member sun_angle_max] 和 [member " +"sun_curve] 全局定义。\n" +"[ProceduralSkyMaterial] 使用轻量级着色器来绘制天空,因此适合实时更新。这使得它" +"成为简单、低计算成本且不切实际的天空的绝佳选择。如果你需要更真实的程序化选项," +"请使用 [PhysicalSkyMaterial]。" + msgid "" "Color of the ground at the bottom. Blends with [member ground_horizon_color]." msgstr "地面底部的颜色。会与 [member ground_horizon_color] 混合。" @@ -82494,11 +92524,15 @@ msgstr "" "仅在重新启动应用程序时才会应用此设置的更改。" msgid "" -"Forces a delay between frames in the main loop (in milliseconds). This may be " -"useful if you plan to disable vertical synchronization." +"Forces a [i]constant[/i] delay between frames in the main loop (in " +"milliseconds). In most situations, [member application/run/max_fps] should be " +"preferred as an FPS limiter as it's more precise.\n" +"This setting can be overridden using the [code]--frame-delay <ms;>[/code] " +"command line argument." msgstr "" -"强制主循环中帧之间的延迟(以毫秒为单位)。如果你计划禁用垂直同步,这可能很有" -"用。" +"强制主循环中的帧之间有[i]恒定的[/i]延迟(以毫秒为单位)。在大多数情况下,应首" +"选 [member application/run/max_fps] 作为 FPS 限制器,因为它更精确。\n" +"可以使用 [code]--frame-delay <ms;>[/code] 命令行参数覆盖该设置。" msgid "" "If [code]true[/code], enables low-processor usage mode. This setting only " @@ -82522,6 +92556,55 @@ msgid "Path to the main scene file that will be loaded when the project runs." msgstr "项目运行时将加载的主场景文件的路径。" msgid "" +"Maximum number of frames per second allowed. A value of [code]0[/code] means " +"\"no limit\". The actual number of frames per second may still be below this " +"value if the CPU or GPU cannot keep up with the project logic and rendering.\n" +"Limiting the FPS can be useful to reduce system power consumption, which " +"reduces heat and noise emissions (and improves battery life on mobile " +"devices).\n" +"If [member display/window/vsync/vsync_mode] is set to [code]Enabled[/code] or " +"[code]Adaptive[/code], it takes precedence and the forced FPS number cannot " +"exceed the monitor's refresh rate.\n" +"If [member display/window/vsync/vsync_mode] is [code]Enabled[/code], on " +"monitors with variable refresh rate enabled (G-Sync/FreeSync), using a FPS " +"limit a few frames lower than the monitor's refresh rate will [url=https://" +"blurbusters.com/howto-low-lag-vsync-on/]reduce input lag while avoiding " +"tearing[/url].\n" +"If [member display/window/vsync/vsync_mode] is [code]Disabled[/code], " +"limiting the FPS to a high value that can be consistently reached on the " +"system can reduce input lag compared to an uncapped framerate. Since this " +"works by ensuring the GPU load is lower than 100%, this latency reduction is " +"only effective in GPU-bottlenecked scenarios, not CPU-bottlenecked " +"scenarios.\n" +"See also [member physics/common/physics_ticks_per_second].\n" +"This setting can be overridden using the [code]--max-fps <fps>[/code] command " +"line argument (including with a value of [code]0[/code] for unlimited " +"framerate).\n" +"[b]Note:[/b] This property is only read when the project starts. To change " +"the rendering FPS cap at runtime, set [member Engine.max_fps] instead." +msgstr "" +"每秒允许的最大帧数。[code]0[/code] 表示“不限制”。如果 CPU 或 GPU 无法满足项目" +"逻辑和渲染,则实际每秒的帧数可能仍然比这个值小。\n" +"限制 FPS 可以降低系统对电源的消耗,能够降低发热、减少噪音(延长移动设备的电池" +"寿命)。\n" +"[member display/window/vsync/vsync_mode] 为 [code]Enabled[/code] 或 " +"[code]Adaptive[/code] 时,该设置优先生效,强制的 FPS 数无法超过显示器的刷新" +"率。\n" +"[member display/window/vsync/vsync_mode] 为 [code]Enabled[/code] 时,在启用了" +"可变刷新率(G-Sync/FreeSync)的显示器上使用比显示器刷新率略低几帧的 FPS 限制会" +"[url=https://blurbusters.com/howto-low-lag-vsync-on/]降低输入延迟,避免画面撕" +"裂[/url]。\n" +"[member display/window/vsync/vsync_mode] 为 [code]Disabled[/code] 时,与不限制" +"帧率相比,将 FPS 限制设为系统所能达到的较高值能够降低输入延迟。因为原理是确保 " +"GPU 负载低于 100%,所以只有在 GPU 为瓶颈时才会降低延迟,无法缓解 CPU 瓶颈导致" +"的延迟。\n" +"另见 [member physics/common/physics_ticks_per_second]。\n" +"这个设置可以使用 [code]--max-fps <fps>[/code] 命令行参数覆盖(设为 [code]0[/" +"code] 则是不限制帧率)。\n" +"[b]注意:[/b]这个属性仅在项目启动时读取。要在运行时修改渲染 FPS 上限,请改为设" +"置 [member Engine.max_fps]。" + +msgid "" "Audio buses will disable automatically when sound goes below a given dB " "threshold for a given time. This saves CPU as effects assigned to that bus " "will no longer do any processing." @@ -82650,6 +92733,30 @@ msgstr "" "的值效果更好,因为与耳机相比,扬声器的立体声分离度较低。" msgid "" +"Sets the [url=https://developer.apple.com/documentation/avfaudio/" +"avaudiosession/categoryoptions/1616611-mixwithothers]mixWithOthers[/url] " +"option for the AVAudioSession on iOS. This will override the mix behavior, if " +"the category is set to [code]Play and Record[/code], [code]Playback[/code], " +"or [code]Multi Route[/code].\n" +"[code]Ambient[/code] always has this set per default." +msgstr "" +"设置 iOS 的 AVAudioSession 的 [url=https://developer.apple.com/documentation/" +"avfaudio/avaudiosession/categoryoptions/1616611-mixwithothers]mixWithOthers[/" +"url] 选项。当类别为 [code]Play and Record[/code]、[code]Playback[/code]、" +"[code]Multi Route[/code] 时会覆盖混音行为。\n" +"[code]Ambient[/code] 默认会设置这个选项。" + +msgid "" +"Sets the [url=https://developer.apple.com/documentation/avfaudio/" +"avaudiosessioncategory]AVAudioSessionCategory[/url] on iOS. Use the " +"[code]Playback[/code] category to get sound output, even if the phone is in " +"silent mode." +msgstr "" +"设置 iOS 的 [url=https://developer.apple.com/documentation/avfaudio/" +"avaudiosessioncategory]AVAudioSessionCategory[/url]。如果需要让手机在静音模式" +"时也进行声音输出,请使用 [code]Playback[/code] 类别。" + +msgid "" "If [code]true[/code], text-to-speech support is enabled, see [method " "DisplayServer.tts_get_voices] and [method DisplayServer.tts_speak].\n" "[b]Note:[/b] Enabling TTS can cause addition idle CPU usage and interfere " @@ -82720,6 +92827,17 @@ msgstr "" "使用 Zstandard 的长距离匹配进行压缩时,允许的最大大小限制(2 的幂)。更高的值" "可以产生更好的压缩,但是在压缩和解压缩时需要更多的内存。" +msgid "" +"If canvas item redraw debugging is active, this color will be flashed on " +"canvas items when they redraw." +msgstr "如果画布项重绘调试处于活动状态,则画布项重绘时会使用这个颜色进行闪光。" + +msgid "" +"If canvas item redraw debugging is active, this will be the time the flash " +"will last each time they redraw." +msgstr "" +"如果画布项重绘调试处于活动状态,则这个选项表示画布项每次重绘时闪光的持续时间。" + msgid "If [code]true[/code], logs all output to files." msgstr "如果为 [code]true[/code],将所有输出记录到文件中。" @@ -82762,6 +92880,22 @@ msgstr "" msgid "" "When set to [code]warn[/code] or [code]error[/code], produces a warning or an " +"error respectively when an identifier declared in the nested block has the " +"same name as an identifier declared below in the parent block." +msgstr "" +"设为 [code]warn[/code] 或 [code]error[/code] 时,会在嵌套块中声明的标识符与父" +"块中下面声明的标识符同名时,分别产生警告或错误。" + +msgid "" +"When set to [code]warn[/code] or [code]error[/code], produces a warning or an " +"error respectively when an identifier that will be shadowed below in the " +"block is used." +msgstr "" +"设为 [code]warn[/code] 或 [code]error[/code] 时,会在该块下的一个将被隐藏的标" +"识符被使用时,分别产生警告或错误。" + +msgid "" +"When set to [code]warn[/code] or [code]error[/code], produces a warning or an " "error respectively when a constant is used as a function." msgstr "" "设为 [code]warn[/code] 或 [code]error[/code] 时,会在将常量当作函数使用时对应" @@ -82833,6 +92967,23 @@ msgstr "" msgid "" "When set to [code]warn[/code] or [code]error[/code], produces a warning or an " +"error respectively when a variable, constant, or parameter has an implicitly " +"inferred static type.\n" +"[b]Note:[/b] This warning is recommended [i]in addition[/i] to [member debug/" +"gdscript/warnings/untyped_declaration] if you want to always specify the type " +"explicitly. Having [code]INFERRED_DECLARATION[/code] warning level higher " +"than [code]UNTYPED_DECLARATION[/code] warning level makes little sense and is " +"not recommended." +msgstr "" +"设置为 [code]warn[/code] 或 [code]error[/code] 时,当变量、常量、或参数具有隐" +"式推断的静态类型时,分别产生警告或错误。\n" +"[b]注意:[/b]如果你希望始终显式指定类型,则推荐该警告,[i]除了[/i] [member " +"debug/gdscript/warnings/untyped_declaration]。使 [code]INFERRED_DECLARATION[/" +"code] 警告级别高于 [code]UNTYPED_DECLARATION[/code] 警告级别意义不大,且不被推" +"荐。" + +msgid "" +"When set to [code]warn[/code] or [code]error[/code], produces a warning or an " "error respectively when trying to use an integer as an enum without an " "explicit cast." msgstr "" @@ -83046,6 +93197,18 @@ msgstr "" msgid "" "When set to [code]warn[/code] or [code]error[/code], produces a warning or an " +"error respectively when a variable or parameter has no static type, or if a " +"function has no static return type.\n" +"[b]Note:[/b] This warning is recommended together with [member EditorSettings." +"text_editor/completion/add_type_hints] to help achieve type safety." +msgstr "" +"设置为 [code]warn[/code] 或 [code]error[/code] 时,当变量或参数没有静态类型," +"或函数没有静态返回类型时,会分别产生一个警告或一个错误。\n" +"[b]注意:[/b]建议将该警告与 [member EditorSettings.text_editor/completion/" +"add_type_hints] 一起使用,以帮助实现类型安全。" + +msgid "" +"When set to [code]warn[/code] or [code]error[/code], produces a warning or an " "error respectively when a local constant is never used." msgstr "" "设置为 [code]warn[/code] 或 [code]error[/code] 时,当一个局部常量从未被使用" @@ -83620,6 +93783,21 @@ msgstr "" "这个设置。" msgid "" +"On desktop platforms, overrides the game's initial window width. See also " +"[member display/window/size/window_height_override], [member display/window/" +"size/viewport_width] and [member display/window/size/viewport_height].\n" +"[b]Note:[/b] By default, or when set to [code]0[/code], the initial window " +"width is the [member display/window/size/viewport_width]. This setting is " +"ignored on iOS, Android, and Web." +msgstr "" +"在桌面平台上,覆盖游戏的初始窗口宽度。另见 [member display/window/size/" +"window_height_override]、[member display/window/size/viewport_width] 和 " +"[member display/window/size/viewport_height]。\n" +"[b]注意:[/b]默认情况下,或者当设置为 [code]0[/code] 时,初始窗口宽度为 " +"[member display/window/size/viewport_width]。在 iOS、Android 和 Web 上会忽略该" +"设置。" + +msgid "" "Defines how the base size is stretched to fit the resolution of the window or " "screen.\n" "[b]\"disabled\"[/b]: No stretching happens. One unit in the scene corresponds " @@ -83662,6 +93840,31 @@ msgstr "" "定的最终缩放系数相乘。如果使用的是 [b]Disabled[/b] 拉伸模式,那么这个缩放系数" "是原样使用的。可以通过调节这个数值来让 UI 则某些屏幕上更易于阅读。" +msgid "" +"The policy to use to determine the final scale factor for 2D elements. This " +"affects how [member display/window/stretch/scale] is applied, in addition to " +"the automatic scale factor determined by [member display/window/stretch/" +"mode].\n" +"[b]\"fractional\"[/b]: The scale factor will not be modified.\n" +"[b]\"integer\"[/b]: The scale factor will be floored to an integer value, " +"which means that the screen size will always be an integer multiple of the " +"base viewport size. This provides a crisp pixel art appearance.\n" +"[b]Note:[/b] When using integer scaling with a stretch mode, resizing the " +"window to be smaller than the base viewport size will clip the contents. " +"Consider preventing that by setting [member Window.min_size] to the same " +"value as the base viewport size defined in [member display/window/size/" +"viewport_width] and [member display/window/size/viewport_height]." +msgstr "" +"决定 2D 元素最终缩放系数的策略。会影响 [member display/window/stretch/scale] " +"的使用,与 [member display/window/stretch/mode] 决定的自动缩放系数共同生效。\n" +"[b]\"fractional\"[/b]:小数。不改变缩放系数。\n" +"[b]\"integer\"[/b]:整数。将缩放系数向下取整,屏幕大小始终为基础视口大小的整数" +"倍。能够显示锐利的像素风画面。\n" +"[b]注意:[/b]使用整数缩放并设置拉伸模式时,将窗口大小调整得比基础视口大小更小" +"会将内容进行裁剪。请考虑将 [member Window.min_size] 设为与 [member display/" +"window/size/viewport_width] 和 [member display/window/size/viewport_height] 定" +"义的基础视口大小一致,避免这种情况的发生。" + msgid "If [code]true[/code] subwindows are embedded in the main window." msgstr "如果为 [code]true[/code] 则子窗口是嵌入到主窗口中的。" @@ -83698,6 +93901,14 @@ msgstr "" "name]),这样将来进行修改时就不会影响 .NET 程序集。" msgid "" +"Number of times to attempt assembly reloading after rebuilding .NET " +"assemblies. Effectively also the timeout in seconds to wait for unloading of " +"script assemblies to finish." +msgstr "" +"重新构建 .NET 程序集后尝试重新加载程序集的次数。实际也是等待脚本程序集卸载完成" +"的超时秒数。" + +msgid "" "Directory that contains the [code].sln[/code] file. By default, the [code]." "sln[/code] files is in the root of the project directory, next to the " "[code]project.godot[/code] and [code].csproj[/code] files.\n" @@ -84899,6 +95110,18 @@ msgid "Override for [member input_devices/pen_tablet/driver] on Windows." msgstr "[member input_devices/pen_tablet/driver] 针对 Windows 的覆盖项。" msgid "" +"If [code]true[/code], long press events on an Android touchscreen are " +"transformed into right click events." +msgstr "" +"如果为 [code]true[/code],则在 Android 触摸屏上的长按事件会被转换为右键单击事" +"件。" + +msgid "" +"If [code]true[/code], multi-touch pan and scale gestures are enabled on " +"Android devices." +msgstr "如果为 [code]true[/code],则会在 Android 设备上启用多点平移和缩放手势。" + +msgid "" "If [code]true[/code], sends mouse input events when tapping or swiping on the " "touchscreen." msgstr "如果为 [code]true[/code],则在点击或滑动触摸屏时发送鼠标输入事件。" @@ -86612,6 +96835,31 @@ msgstr "" "数,请改为设置 [member Engine.max_physics_steps_per_frame]。" msgid "" +"Controls how much physics ticks are synchronized with real time. For 0 or " +"less, the ticks are synchronized. Such values are recommended for network " +"games, where clock synchronization matters. Higher values cause higher " +"deviation of in-game clock and real clock, but allows smoothing out framerate " +"jitters. The default value of 0.5 should be fine for most; values above 2 " +"could cause the game to react to dropped frames with a noticeable delay and " +"are not recommended.\n" +"[b]Note:[/b] For best results, when using a custom physics interpolation " +"solution, the physics jitter fix should be disabled by setting [member " +"physics/common/physics_jitter_fix] to [code]0[/code].\n" +"[b]Note:[/b] This property is only read when the project starts. To change " +"the physics jitter fix at runtime, set [member Engine.physics_jitter_fix] " +"instead." +msgstr "" +"控制物理周期与真实时间的同步程度。小于等于 0 时,周期是同步的。对时钟同步有要" +"求的网络游戏建议使用此类值。较高的值会导致游戏内时钟和真实时钟的较大偏差,但可" +"以平滑帧率抖动。大多数情况下,默认值 0.5 应该没问题;大于 2 的值可能导致游戏对" +"丢帧作出明显延迟的反应,因此不推荐使用。\n" +"[b]注意:[/b]为了获得最佳的结果,使用自定义物理插值解决方案时,应通过将 " +"[member physics/common/physics_jitter_fix] 设置为 [code]0[/code] 来禁用物理抖" +"动修复。\n" +"[b]注意:[/b]该属性仅在项目启动时读取。 要在运行时更改物理抖动修复,请改为设" +"置 [member Engine.physics_jitter_fix]。" + +msgid "" "The number of fixed iterations per second. This controls how often physics " "simulation and [method Node._physics_process] methods are run. See also " "[member application/run/max_fps].\n" @@ -87177,6 +97425,48 @@ msgid "Windows override for [member rendering/gl_compatibility/driver]." msgstr "[member rendering/gl_compatibility/driver] 在 Windows 的覆盖项。" msgid "" +"If [code]true[/code], the compatibility renderer will fall back to ANGLE if " +"native OpenGL is not supported or the device is listed in [member rendering/" +"gl_compatibility/force_angle_on_devices].\n" +"[b]Note:[/b] This setting is implemented only on Windows." +msgstr "" +"为 [code]true[/code] 时,如果原生 OpenGL 不受支持或设备被列在 [member " +"rendering/gl_compatibility/force_angle_on_devices] 中,则兼容性渲染器将回退到 " +"ANGLE。\n" +"[b]注意:[/b]该设置仅在 Windows 上实现。" + +msgid "" +"If [code]true[/code], the compatibility renderer will fall back to OpenGLES " +"if desktop OpenGL is not supported.\n" +"[b]Note:[/b] This setting is implemented only on Linux/X11." +msgstr "" +"为 [code]true[/code] 时,如果桌面 OpenGL 不被支持,则兼容性渲染器将回退到 " +"OpenGLES。\n" +"[b]注意:[/b]该设置仅在 Linux/X11 上实现。" + +msgid "" +"If [code]true[/code], the compatibility renderer will fall back to native " +"OpenGL if ANGLE over Metal is not supported.\n" +"[b]Note:[/b] This setting is implemented only on macOS." +msgstr "" +"如果为 [code]true[/code],如果 ANGLE 乃至 Metal 不被支持,则兼容性渲染器将回退" +"到原生 OpenGL。\n" +"[b]注意:[/b]该设置仅在 macOS 上实现。" + +msgid "" +"An [Array] of devices which should always use the ANGLE renderer.\n" +"Each entry is a [Dictionary] with the following keys: [code]vendor[/code] and " +"[code]name[/code]. [code]name[/code] can be set to [code]*[/code] to add all " +"devices with the specified [code]vendor[/code].\n" +"[b]Note:[/b] This setting is implemented only on Windows." +msgstr "" +"应始终使用 ANGLE 渲染器的设备的 [Array]。\n" +"每个条目都是一个带有以下键的 [Dictionary]:[code]vendor[/code] 和 [code]name[/" +"code]。[code]name[/code] 可以被设置为 [code]*[/code] 以添加所有带有指定 " +"[code]vendor[/code] 的设备。\n" +"[b]注意:[/b]该设置仅在 Windows 上实现。" + +msgid "" "Maximum number of canvas items commands that can be drawn in a single " "viewport update. If more render commands are issued they will be ignored. " "Decreasing this limit may improve performance on bandwidth limited devices. " @@ -87378,6 +97668,38 @@ msgstr "" "时,用于使用 [LightmapGI] 烘焙光照贴图的光线数。" msgid "" +"Denoiser tool used for denoising lightmaps.\n" +"Using [url=https://www.openimagedenoise.org/]OpenImageDenoise[/url] (OIDN) " +"requires configuring a path to an OIDN executable in the editor settings at " +"[member EditorSettings.filesystem/tools/oidn/oidn_denoise_path]. OIDN can be " +"downloaded from [url=https://www.openimagedenoise.org/downloads." +"html]OpenImageDenoise's downloads page[/url].\n" +"OIDN will use GPU acceleration when available. Unlike JNLM which uses compute " +"shaders for acceleration, OIDN uses vendor-specific acceleration methods. For " +"GPU acceleration to be available, the following libraries must be installed " +"on the system depending on your GPU:\n" +"- NVIDIA GPUs: CUDA libraries\n" +"- AMD GPUs: HIP libraries\n" +"- Intel GPUs: SYCL libraries\n" +"If no GPU acceleration is configured on the system, multi-threaded CPU-based " +"denoising will be performed instead. This CPU-based denoising is " +"significantly slower than the JNLM denoiser in most cases." +msgstr "" +"用于对光照贴图进行降噪的降噪器工具。\n" +"使用 [url=https://www.openimagedenoise.org/]OpenImageDenoise[/url](OIDN)需要" +"在 [member EditorSettings.filesystem/tools/oidn/oidn_denoise_path] 的编辑器设" +"置中配置 OIDN 可执行文件的路径。OIDN 可以从 [url=https://www.openimagedenoise." +"org/downloads.html]OpenImageDenoise 的下载页面[/url]下载。\n" +"OIDN 将在可用时使用 GPU 加速。与使用计算着色器进行加速的 JNLM 不同,OIDN 使用" +"特定于供应商的加速方法。要使 GPU 加速可用,必须根据你的 GPU 在系统上安装以下" +"库:\n" +"- NVIDIA GPU:CUDA 库\n" +"- AMD GPU:HIP 库\n" +"- Intel GPU:SYCL 库\n" +"如果系统上没有配置 GPU 加速,则会执行基于 CPU 的多线程去噪。在大多数情况下,这" +"种基于 CPU 的降噪明显慢于 JNLM 降噪器。" + +msgid "" "The texel_size that is used to calculate the [member Mesh.lightmap_size_hint] " "on [PrimitiveMesh] resources if [member PrimitiveMesh.add_uv2] is enabled." msgstr "" @@ -87964,6 +98286,35 @@ msgstr "" "[b]注意:[/b]只有在项目启动时该属性才会被读取。目前无法在运行时更改该设置。" msgid "" +"Affects the final texture sharpness by reading from a lower or higher mipmap " +"(also called \"texture LOD bias\"). Negative values make mipmapped textures " +"sharper but grainier when viewed at a distance, while positive values make " +"mipmapped textures blurrier (even when up close).\n" +"Enabling temporal antialiasing ([member rendering/anti_aliasing/quality/" +"use_taa]) will automatically apply a [code]-0.5[/code] offset to this value, " +"while enabling FXAA ([member rendering/anti_aliasing/quality/" +"screen_space_aa]) will automatically apply a [code]-0.25[/code] offset to " +"this value. If both TAA and FXAA are enabled at the same time, an offset of " +"[code]-0.75[/code] is applied to this value.\n" +"[b]Note:[/b] If [member rendering/scaling_3d/scale] is lower than [code]1.0[/" +"code] (exclusive), [member rendering/textures/default_filters/" +"texture_mipmap_bias] is used to adjust the automatic mipmap bias which is " +"calculated internally based on the scale factor. The formula for this is " +"[code]log2(scaling_3d_scale) + mipmap_bias[/code]." +msgstr "" +"通过从更低或更高的 mipmap 中读取数据影响最终纹理的锐度(也叫“纹理 LOD 偏" +"置”)。负值会让 mipmap 纹理更锐利,但从较远处观察时颗粒更明显,而正值会让 " +"mipmap 纹理更模糊(即便凑近看也一样)。\n" +"启用时间抗锯齿([member rendering/anti_aliasing/quality/use_taa])会对这个值应" +"用 [code]-0.5[/code] 的偏移量,而启用 FXAA([member rendering/anti_aliasing/" +"quality/screen_space_aa])则会对这个值应用 [code]-0.25[/code] 的偏移量。如果同" +"时启用 TAA 和 FXAA,则会对这个值应用 [code]-0.75[/code] 的偏移量。\n" +"[b]注意:[/b]如果 [member rendering/scaling_3d/scale] 比 [code]1.0[/code] 小" +"(包含),则会使用 [member rendering/textures/default_filters/" +"texture_mipmap_bias] 自动调整 mipmap 偏置,内部会根据缩放系数进行计算。公式为 " +"[code]log2(scaling_3d_scale) + mipmap_bias[/code]。" + +msgid "" "If [code]true[/code], uses nearest-neighbor mipmap filtering when using " "mipmaps (also called \"bilinear filtering\"), which will result in visible " "seams appearing between mipmap stages. This may increase performance in " @@ -88146,9 +98497,28 @@ msgstr "" "像。" msgid "" +"Specify whether to enable eye tracking for this project. Depending on the " +"platform, additional export configuration may be needed." +msgstr "指定是否为该项目启用眼动追踪。根据平台的不同,可能需要额外的导出配置。" + +msgid "If true we enable the hand tracking extension if available." +msgstr "如果为 true,则将启用手部跟踪扩展(如果可用)。" + +msgid "" "Specify whether OpenXR should be configured for an HMD or a hand held device." msgstr "指定是否应为 HMD 或手持设备配置 OpenXR。" +msgid "" +"If true and foveation is supported, will automatically adjust foveation level " +"based on framerate up to the level set on [member xr/openxr/foveation_level]." +msgstr "" +"如果为 true 并且支持注视点,将根据帧速率自动调整注视点级别,直至达到 [member " +"xr/openxr/foveation_level] 上设置的级别。" + +msgid "" +"Applied foveation level if supported: 0 = off, 1 = low, 2 = medium, 3 = high." +msgstr "应用的注视点级别(如果支持):0 = 关闭、1 = 低、2 = 中、3 = 高。" + msgid "Specify the default reference space." msgstr "指定默认参照空间。" @@ -88421,6 +98791,17 @@ msgstr "" "的 [param weight] 进行球面三次插值。" msgid "" +"Performs a spherical cubic interpolation between quaternions [param pre_a], " +"this vector, [param b], and [param post_b], by the given amount [param " +"weight].\n" +"It can perform smoother interpolation than [method " +"spherical_cubic_interpolate] by the time values." +msgstr "" +"在四元数 [param pre_a]、该向量、[param b] 和 [param post_b] 之间,按给定量 " +"[param weight] 执行三次球面插值。\n" +"它可以根据时间值执行比 [method spherical_cubic_interpolate] 更平滑的插值。" + +msgid "" "W component of the quaternion (real part).\n" "Quaternion components should usually not be manipulated directly." msgstr "" @@ -88596,6 +98977,14 @@ msgstr "" "返回在 [param from] 和 [param to] 之间(含端点)的伪随机 32 位无符号整数。" msgid "" +"Sets up a time-based seed for this [RandomNumberGenerator] instance. Unlike " +"the [@GlobalScope] random number generation functions, different " +"[RandomNumberGenerator] instances can use different seeds." +msgstr "" +"为这个 [RandomNumberGenerator] 实例设置基于时间的种子。与 [@GlobalScope] 随机" +"数生成函数不同,不同的 [RandomNumberGenerator] 实例可以使用不同的种子。" + +msgid "" "Initializes the random number generator state based on the given seed value. " "A given seed will give a reproducible sequence of pseudo-random numbers.\n" "[b]Note:[/b] The RNG does not have an avalanche effect, and can output " @@ -88958,6 +99347,14 @@ msgid "" msgstr "添加碰撞例外,这样射线就不会报告与指定 [CollisionObject3D] 节点的碰撞。" msgid "" +"Returns the collision object's face index at the collision point, or " +"[code]-1[/code] if the shape intersecting the ray is not a " +"[ConcavePolygonShape3D]." +msgstr "" +"返回碰撞点处碰撞对象的面索引,如果与射线相交的形状不是 " +"[ConcavePolygonShape3D],则返回 [code]-1[/code]。" + +msgid "" "Returns the normal of the intersecting object's shape at the collision point, " "or [code]Vector3(0, 0, 0)[/code] if the ray starts inside the shape and " "[member hit_from_inside] is [code]true[/code]." @@ -89007,6 +99404,13 @@ msgid "" msgstr "如果为 [code]true[/code],则该 RayCast3D 的直接父级的碰撞将被忽略。" msgid "" +"If [code]true[/code], the ray will hit back faces with concave polygon shapes " +"with back face enabled or heightmap shapes." +msgstr "" +"如果为 [code]true[/code],射线将命中背部面,这些背部面是启用了背面的凹多边形形" +"状,或高度图形状。" + +msgid "" "If [code]true[/code], the ray will detect a hit when starting inside shapes. " "In this case the collision normal will be [code]Vector3(0, 0, 0)[/code]. Does " "not affect shapes with no volume like concave polygon or heightmap." @@ -89669,6 +100073,23 @@ msgstr "" "SPIR-V 中间表示,是 [RDShaderFile] 的一部分(由 [RenderingDevice] 使用)。" msgid "" +"[RDShaderSPIRV] represents a [RDShaderFile]'s [url=https://www.khronos.org/" +"spir/]SPIR-V[/url] code for various shader stages, as well as possible " +"compilation error messages. SPIR-V is a low-level intermediate shader " +"representation. This intermediate representation is not used directly by GPUs " +"for rendering, but it can be compiled into binary shaders that GPUs can " +"understand. Unlike compiled shaders, SPIR-V is portable across GPU models and " +"driver versions.\n" +"This object is used by [RenderingDevice]." +msgstr "" +"[RDShaderSPIRV] 代表 [RDShaderFile] 不同着色器阶段的 [url=https://www.khronos." +"org/spir/]SPIR-V[/url] 代码,以及可能的编译错误消息。SPIR-V 是一种低阶着色器中" +"间表示。这种中间表示无法直接用于 GPU 渲染,但可以被编译为 GPU 能够理解的二进制" +"着色器。与编译后的着色器不同,SPIR-V 可以在不同 GPU 型号以及驱动版本之间移" +"植。\n" +"这个对象由 [RenderingDevice] 使用。" + +msgid "" "Equivalent to getting one of [member bytecode_compute], [member " "bytecode_fragment], [member bytecode_tesselation_control], [member " "bytecode_tesselation_evaluation], [member bytecode_vertex]." @@ -89838,6 +100259,32 @@ msgid "A 2D axis-aligned bounding box using floating-point coordinates." msgstr "使用浮点数坐标的 2D 轴对齐边界框。" msgid "" +"The [Rect2] built-in [Variant] type represents an axis-aligned rectangle in a " +"2D space. It is defined by its [member position] and [member size], which are " +"[Vector2]. It is frequently used for fast overlap tests (see [method " +"intersects]). Although [Rect2] itself is axis-aligned, it can be combined " +"with [Transform2D] to represent a rotated or skewed rectangle.\n" +"For integer coordinates, use [Rect2i]. The 3D equivalent to [Rect2] is " +"[AABB].\n" +"[b]Note:[/b] Negative values for [member size] are not supported. With " +"negative size, most [Rect2] methods do not work correctly. Use [method abs] " +"to get an equivalent [Rect2] with a non-negative size.\n" +"[b]Note:[/b] In a boolean context, a [Rect2] evaluates to [code]false[/code] " +"if both [member position] and [member size] are zero (equal to [constant " +"Vector2.ZERO]). Otherwise, it always evaluates to [code]true[/code]." +msgstr "" +"[Rect2] 内置 [Variant] 类型表示 2D 空间中的轴对齐矩形。它由其 [member " +"position] 和 [member size] 定义,皆为 [Vector2] 类型。它经常被用于快速重叠测试" +"(参见 [method intersects])。虽然 [Rect2] 本身是轴对齐的,但它可以与 " +"[Transform2D] 组合来表示旋转或倾斜的矩形。\n" +"对于整数坐标,请使用 [Rect2i]。[Rect2] 的 3D 等效体是 [AABB]。\n" +"[b]注意:[/b]不支持负的 [member size]。对于负大小,大多数 [Rect2] 方法都无法正" +"常工作。使用 [method abs] 获取具有非负大小的等效 [Rect2]。\n" +"[b]注意:[/b]在布尔上下文中,如果 [member position] 和 [member size] 均为零" +"(等于 [constant Vector2.ZERO]),则 [Rect2] 的计算结果为 [code]false[/code]。" +"否则,它的计算结果始终为 [code]true[/code]。" + +msgid "" "Constructs a [Rect2] with its [member position] and [member size] set to " "[constant Vector2.ZERO]." msgstr "" @@ -89860,10 +100307,312 @@ msgstr "" "构造 [Rect2],将 [member position] 设置为 ([param x], [param y]),将 [member " "size] 设置为 ([param width], [param height])。" +msgid "" +"Returns a [Rect2] equivalent to this rectangle, with its width and height " +"modified to be non-negative values, and with its [member position] being the " +"top-left corner of the rectangle.\n" +"[codeblocks]\n" +"[gdscript]\n" +"var rect = Rect2(25, 25, -100, -50)\n" +"var absolute = rect.abs() # absolute is Rect2(-75, -25, 100, 50)\n" +"[/gdscript]\n" +"[csharp]\n" +"var rect = new Rect2(25, 25, -100, -50);\n" +"var absolute = rect.Abs(); // absolute is Rect2(-75, -25, 100, 50)\n" +"[/csharp]\n" +"[/codeblocks]\n" +"[b]Note:[/b] It's recommended to use this method when [member size] is " +"negative, as most other methods in Godot assume that the [member position] is " +"the top-left corner, and the [member end] is the bottom-right corner." +msgstr "" +"返回一个与该矩形等效的 [Rect2],其宽度和高度被修改为非负值,其 [member " +"position] 为矩形的左上角。\n" +"[codeblocks]\n" +"[gdscript]\n" +"var rect = Rect2(25, 25, -100, -50)\n" +"var absolute = rect.abs() # 绝对值为 Rect2(-75, -25, 100, 50)\n" +"[/gdscript]\n" +"[csharp]\n" +"var rect = new Rect2(25, 25, -100, -50);\n" +"var absolute = rect.Abs(); // 绝对值为 Rect2(-75, -25, 100, 50)\n" +"[/csharp]\n" +"[/codeblocks]\n" +"[b]注意:[/b]当 [member size] 为负时,建议使用该方法,因为 Godot 中的大多数其" +"他方法都假设 [member position] 是左上角,[member end] 是右下角。" + +msgid "" +"Returns [code]true[/code] if this rectangle [i]completely[/i] encloses the " +"[param b] rectangle." +msgstr "如果该矩形[i]完全[/i]包含 [param b] 矩形,则返回 [code]true[/code]。" + +msgid "" +"Returns a copy of this rectangle expanded to align the edges with the given " +"[param to] point, if necessary.\n" +"[codeblocks]\n" +"[gdscript]\n" +"var rect = Rect2(0, 0, 5, 2)\n" +"\n" +"rect = rect.expand(Vector2(10, 0)) # rect is Rect2(0, 0, 10, 2)\n" +"rect = rect.expand(Vector2(-5, 5)) # rect is Rect2(-5, 0, 10, 5)\n" +"[/gdscript]\n" +"[csharp]\n" +"var rect = new Rect2(0, 0, 5, 2);\n" +"\n" +"rect = rect.Expand(new Vector2(10, 0)); // rect is Rect2(0, 0, 10, 2)\n" +"rect = rect.Expand(new Vector2(-5, 5)); // rect is Rect2(-5, 0, 10, 5)\n" +"[/csharp]\n" +"[/codeblocks]" +msgstr "" +"返回该矩形的副本,如有必要,该矩形被扩展为将边缘与给定的 [param to] 点对齐。\n" +"[codeblocks]\n" +"[gdscript]\n" +"var rect = Rect2(0, 0, 5, 2)\n" +"\n" +"rect = rect.expand(Vector2(10, 0)) # rect 为 Rect2(0, 0, 10, 2)\n" +"rect = rect.expand(Vector2(-5, 5)) # rect 为 Rect2(-5, 0, 10, 5)\n" +"[/gdscript]\n" +"[csharp]\n" +"var rect = new Rect2(0, 0, 5, 2);\n" +"\n" +"rect = rect.Expand(new Vector2(10, 0)); // rect 为 Rect2(0, 0, 10, 2)\n" +"rect = rect.Expand(new Vector2(-5, 5)); // rect 为 Rect2(-5, 0, 10, 5)\n" +"[/csharp]\n" +"[/codeblocks]" + +msgid "" +"Returns the rectangle's area. This is equivalent to [code]size.x * size.y[/" +"code]. See also [method has_area]." +msgstr "" +"返回该矩形的面积。这相当于 [code]size.x * size.y[/code]。另请参阅 [method " +"has_area]。" + +msgid "" +"Returns the center point of the rectangle. This is the same as [code]position " +"+ (size / 2.0)[/code]." +msgstr "返回该矩形的中心点。这与 [code]position + (size / 2.0)[/code] 相同。" + +msgid "" +"Returns a copy of this rectangle extended on all sides by the given [param " +"amount]. A negative [param amount] shrinks the rectangle instead. See also " +"[method grow_individual] and [method grow_side].\n" +"[codeblocks]\n" +"[gdscript]\n" +"var a = Rect2(4, 4, 8, 8).grow(4) # a is Rect2(0, 0, 16, 16)\n" +"var b = Rect2(0, 0, 8, 4).grow(2) # b is Rect2(-2, -2, 12, 8)\n" +"[/gdscript]\n" +"[csharp]\n" +"var a = new Rect2(4, 4, 8, 8).Grow(4); // a is Rect2(0, 0, 16, 16)\n" +"var b = new Rect2(0, 0, 8, 4).Grow(2); // b is Rect2(-2, -2, 12, 8)\n" +"[/csharp]\n" +"[/codeblocks]" +msgstr "" +"返回该矩形的副本,该矩形在所有边上扩展给定的 [param amount]。负的 [param " +"amount] 会缩小该矩形。另见 [method grow_individual] and [method grow_side]。\n" +"[codeblocks]\n" +"[gdscript]\n" +"var a = Rect2(4, 4, 8, 8).grow(4) # a 为 Rect2(0, 0, 16, 16)\n" +"var b = Rect2(0, 0, 8, 4).grow(2) # b 为 Rect2(-2, -2, 12, 8)\n" +"[/gdscript]\n" +"[csharp]\n" +"var a = new Rect2(4, 4, 8, 8).Grow(4); // a 为 Rect2(0, 0, 16, 16)\n" +"var b = new Rect2(0, 0, 8, 4).Grow(2); // b 为 Rect2(-2, -2, 12, 8)\n" +"[/csharp]\n" +"[/codeblocks]" + +msgid "" +"Returns a copy of this rectangle with its [param left], [param top], [param " +"right], and [param bottom] sides extended by the given amounts. Negative " +"values shrink the sides, instead. See also [method grow] and [method " +"grow_side]." +msgstr "" +"返回该矩形的副本,其 [param left]、[param top]、[param right]、和 [param " +"bottom] 边扩展了给定的量。相反,负值会缩小边。另见 [method grow] and [method " +"grow_side]。" + +msgid "" +"Returns a copy of this rectangle with its [param side] extended by the given " +"[param amount] (see [enum Side] constants). A negative [param amount] shrinks " +"the rectangle, instead. See also [method grow] and [method grow_individual]." +msgstr "" +"返回该矩形的副本,其 [param side] 按给定的 [param amount] 扩展(请参阅 [enum " +"Side] 常量)。相反,负的 [param amount] 会缩小该矩形。另见 [method grow] 和 " +"[method grow_individual]。" + +msgid "" +"Returns [code]true[/code] if this rectangle has positive width and height. " +"See also [method get_area]." +msgstr "" +"如果该矩形具有正的宽度和高度,则返回 [code]true[/code]。另见 [method " +"get_area]。" + +msgid "" +"Returns [code]true[/code] if the rectangle contains the given [param point]. " +"By convention, points on the right and bottom edges are [b]not[/b] included.\n" +"[b]Note:[/b] This method is not reliable for [Rect2] with a [i]negative[/i] " +"[member size]. Use [method abs] first to get a valid rectangle." +msgstr "" +"如果该矩形包含给定的 [param point],则返回 [code]true[/code]。依照惯例,[b]不" +"[/b]包括右侧和底部边缘上的点。\n" +"[b]注意:[/b]对于[i]大小为负[/i]的 [Rect2],该方法并不可靠。请首先使用 " +"[method abs] 获取一个有效的矩形。" + +msgid "" +"Returns the intersection between this rectangle and [param b]. If the " +"rectangles do not intersect, returns an empty [Rect2].\n" +"[codeblocks]\n" +"[gdscript]\n" +"var rect1 = Rect2(0, 0, 5, 10)\n" +"var rect2 = Rect2(2, 0, 8, 4)\n" +"\n" +"var a = rect1.intersection(rect2) # a is Rect2(2, 0, 3, 4)\n" +"[/gdscript]\n" +"[csharp]\n" +"var rect1 = new Rect2(0, 0, 5, 10);\n" +"var rect2 = new Rect2(2, 0, 8, 4);\n" +"\n" +"var a = rect1.Intersection(rect2); // a is Rect2(2, 0, 3, 4)\n" +"[/csharp]\n" +"[/codeblocks]\n" +"[b]Note:[/b] If you only need to know whether two rectangles are overlapping, " +"use [method intersects], instead." +msgstr "" +"返回该矩形与 [param b] 之间的交集。如果该矩形不相交,则返回空的 [Rect2]。\n" +"[codeblocks]\n" +"[gdscript]\n" +"var rect1 = Rect2(0, 0, 5, 10)\n" +"var rect2 = Rect2(2, 0, 8, 4)\n" +"\n" +"var a = rect1.intersection(rect2) # a 为 Rect2(2, 0, 3, 4)\n" +"[/gdscript]\n" +"[csharp]\n" +"var rect1 = new Rect2(0, 0, 5, 10);\n" +"var rect2 = new Rect2(2, 0, 8, 4);\n" +"\n" +"var a = rect1.Intersection(rect2); // a 为 Rect2(2, 0, 3, 4)\n" +"[/csharp]\n" +"[/codeblocks]\n" +"[b]注意:[/b]如果你只需要知道两个矩形是否重叠,请改用 [method intersects]。" + +msgid "" +"Returns [code]true[/code] if this rectangle overlaps with the [param b] " +"rectangle. The edges of both rectangles are excluded, unless [param " +"include_borders] is [code]true[/code]." +msgstr "" +"如果该矩形与 [param b] 矩形重叠,则返回 [code]true[/code]。除非 [param " +"include_borders] 为 [code]true[/code],否则两个矩形的边缘均被排除。" + +msgid "" +"Returns [code]true[/code] if this rectangle and [param rect] are " +"approximately equal, by calling [method Vector2.is_equal_approx] on the " +"[member position] and the [member size]." +msgstr "" +"如果该矩形和 [param rect] 近似相等,判断方法是通过在 [member position] 和 " +"[member size] 上调用 [method Vector2.is_equal_approx],则返回 [code]true[/" +"code]。" + +msgid "" +"Returns [code]true[/code] if this rectangle's values are finite, by calling " +"[method Vector2.is_finite] on the [member position] and the [member size]." +msgstr "" +"如果该矩形是有限的,则返回 [code]true[/code],判断方法是对 [member position] " +"和 [member size] 调用 [method Vector2.is_finite]。" + +msgid "" +"Returns a [Rect2] that encloses both this rectangle and [param b] around the " +"edges. See also [method encloses]." +msgstr "返回边界包围该矩形和 [param b] 的 [Rect2]。另见 [method encloses]。" + +msgid "" +"The ending point. This is usually the bottom-right corner of the rectangle, " +"and is equivalent to [code]position + size[/code]. Setting this point affects " +"the [member size]." +msgstr "" +"终点。通常为矩形的右下角,等价于 [code]position + size[/code]。设置该点会影响 " +"[member size]。" + +msgid "The origin point. This is usually the top-left corner of the rectangle." +msgstr "原点。通常为矩形的左上角。" + +msgid "" +"The rectangle's width and height, starting from [member position]. Setting " +"this value also affects the [member end] point.\n" +"[b]Note:[/b] It's recommended setting the width and height to non-negative " +"values, as most methods in Godot assume that the [member position] is the top-" +"left corner, and the [member end] is the bottom-right corner. To get an " +"equivalent rectangle with non-negative size, use [method abs]." +msgstr "" +"矩形的宽和高,相对于 [member position]。设置该值会影响终点 [member end]。\n" +"[b]注意:[/b]建议将宽和高设置为非负数,因为 Godot 中的大多数方法假设 [member " +"position] 为左上角、[member end] 为右下角。要获取等价且大小非负的矩形,请使用 " +"[method abs]。" + +msgid "" +"Returns [code]true[/code] if the [member position] or [member size] of both " +"rectangles are not equal.\n" +"[b]Note:[/b] Due to floating-point precision errors, consider using [method " +"is_equal_approx] instead, which is more reliable." +msgstr "" +"如果两个矩形的 [member position] 不相等或 [member size] 不相等,则返回 " +"[code]true[/code]。\n" +"[b]注意:[/b]由于浮点数精度误差,请考虑改用 [method is_equal_approx],会更可" +"靠。" + +msgid "" +"Inversely transforms (multiplies) the [Rect2] by the given [Transform2D] " +"transformation matrix, under the assumption that the transformation basis is " +"orthonormal (i.e. rotation/reflection is fine, scaling/skew is not).\n" +"[code]rect * transform[/code] is equivalent to [code]transform.inverse() * " +"rect[/code]. See [method Transform2D.inverse].\n" +"For transforming by inverse of an affine transformation (e.g. with scaling) " +"[code]transform.affine_inverse() * rect[/code] can be used instead. See " +"[method Transform2D.affine_inverse]." +msgstr "" +"假设该变换的基是正交的(即旋转/反射可以,缩放/倾斜则不然),将 [Rect2] 逆向变" +"换(乘以)给定的 [Transform2D] 变换矩阵。\n" +"[code]rect * transform[/code] 相当于 [code]transform.inverse() * rect[/code]。" +"请参阅 [method Transform2D.inverse]。\n" +"对于通过仿射变换的逆变换(例如,通过缩放)进行变换,可以使用 [code]transform." +"affine_inverse() * rect[/code] 来代替。请参阅 [method Transform2D." +"affine_inverse]。" + +msgid "" +"Returns [code]true[/code] if both [member position] and [member size] of the " +"rectangles are exactly equal, respectively.\n" +"[b]Note:[/b] Due to floating-point precision errors, consider using [method " +"is_equal_approx] instead, which is more reliable." +msgstr "" +"如果两个矩形的 [member position] 完全相等且 [member size] 完全相等,则返回 " +"[code]true[/code]。\n" +"[b]注意:[/b]由于浮点数精度误差,请考虑改用 [method is_equal_approx],会更可" +"靠。" + msgid "A 2D axis-aligned bounding box using integer coordinates." msgstr "使用整数坐标的 2D 轴对齐边界框。" msgid "" +"The [Rect2i] built-in [Variant] type represents an axis-aligned rectangle in " +"a 2D space, using integer coordinates. It is defined by its [member position] " +"and [member size], which are [Vector2i]. Because it does not rotate, it is " +"frequently used for fast overlap tests (see [method intersects]).\n" +"For floating-point coordinates, see [Rect2].\n" +"[b]Note:[/b] Negative values for [member size] are not supported. With " +"negative size, most [Rect2i] methods do not work correctly. Use [method abs] " +"to get an equivalent [Rect2i] with a non-negative size.\n" +"[b]Note:[/b] In a boolean context, a [Rect2i] evaluates to [code]false[/code] " +"if both [member position] and [member size] are zero (equal to [constant " +"Vector2i.ZERO]). Otherwise, it always evaluates to [code]true[/code]." +msgstr "" +"[Rect2i] 是内置的 [Variant] 类型,代表 2D 空间中与轴对齐的矩形,使用整数坐标。" +"由 [member position] 和 [member size] 定义,它们都是 [Vector2i]。因为这个矩形" +"不会旋转,所以可以进行快速的重合检查(见 [method intersects])。\n" +"浮点数坐标的版本见 [Rect2]。\n" +"[b]注意:[/b]不支持负数的 [member size]。如果大小为负数,[Rect2i] 的大多数方法" +"都无法正常工作。请使用 [method abs] 获取等价且大小非负的 [Rect2i]。\n" +"[b]注意:[/b]在布尔值上下文中,[member position] 和 [member size] 均为零(等" +"于 [constant Vector2i.ZERO])的 [Rect2i] 会得到 [code]false[/code]。否则得到 " +"[code]true[/code]。" + +msgid "" "Constructs a [Rect2i] with its [member position] and [member size] set to " "[constant Vector2i.ZERO]." msgstr "" @@ -89889,9 +100638,188 @@ msgstr "" "size] 设置为 ([param width], [param height])。" msgid "" +"Returns a [Rect2i] equivalent to this rectangle, with its width and height " +"modified to be non-negative values, and with its [member position] being the " +"top-left corner of the rectangle.\n" +"[codeblocks]\n" +"[gdscript]\n" +"var rect = Rect2i(25, 25, -100, -50)\n" +"var absolute = rect.abs() # absolute is Rect2i(-75, -25, 100, 50)\n" +"[/gdscript]\n" +"[csharp]\n" +"var rect = new Rect2I(25, 25, -100, -50);\n" +"var absolute = rect.Abs(); // absolute is Rect2I(-75, -25, 100, 50)\n" +"[/csharp]\n" +"[/codeblocks]\n" +"[b]Note:[/b] It's recommended to use this method when [member size] is " +"negative, as most other methods in Godot assume that the [member position] is " +"the top-left corner, and the [member end] is the bottom-right corner." +msgstr "" +"返回一个与该矩形等效的 [Rect2i],其宽度和高度被修改为非负值,其 [member " +"position] 为该矩形的左上角。\n" +"[codeblocks]\n" +"[gdscript]\n" +"var rect = Rect2i(25, 25, -100, -50)\n" +"var absolute = rect.abs() # 绝对值为 Rect2i(-75, -25, 100, 50)\n" +"[/gdscript]\n" +"[csharp]\n" +"var rect = new Rect2I(25, 25, -100, -50);\n" +"var absolute = rect.Abs(); // 绝对值为 Rect2I(-75, -25, 100, 50)\n" +"[/csharp]\n" +"[/codeblocks]\n" +"[b]注意:[/b]当 [member size] 为负时,建议使用该方法,因为 Godot 中的大多数其" +"他方法都假设 [member position] 是左上角,[member end] 是右下角。" + +msgid "" "Returns [code]true[/code] if this [Rect2i] completely encloses another one." msgstr "如果该 [Rect2i] 完全包含另一个,则返回 [code]true[/code]。" +msgid "" +"Returns a copy of this rectangle expanded to align the edges with the given " +"[param to] point, if necessary.\n" +"[codeblocks]\n" +"[gdscript]\n" +"var rect = Rect2i(0, 0, 5, 2)\n" +"\n" +"rect = rect.expand(Vector2i(10, 0)) # rect is Rect2i(0, 0, 10, 2)\n" +"rect = rect.expand(Vector2i(-5, 5)) # rect is Rect2i(-5, 0, 10, 5)\n" +"[/gdscript]\n" +"[csharp]\n" +"var rect = new Rect2I(0, 0, 5, 2);\n" +"\n" +"rect = rect.Expand(new Vector2I(10, 0)); // rect is Rect2I(0, 0, 10, 2)\n" +"rect = rect.Expand(new Vector2I(-5, 5)); // rect is Rect2I(-5, 0, 10, 5)\n" +"[/csharp]\n" +"[/codeblocks]" +msgstr "" +"返回该矩形的副本,如有必要,该矩形被扩展为将边缘与给定的 [param to] 点对齐。\n" +"[codeblocks]\n" +"[gdscript]\n" +"var rect = Rect2i(0, 0, 5, 2)\n" +"\n" +"rect = rect.expand(Vector2i(10, 0)) # rect 为 Rect2i(0, 0, 10, 2)\n" +"rect = rect.expand(Vector2i(-5, 5)) # rect 为 Rect2i(-5, 0, 10, 5)\n" +"[/gdscript]\n" +"[csharp]\n" +"var rect = new Rect2I(0, 0, 5, 2);\n" +"\n" +"rect = rect.Expand(new Vector2I(10, 0)); // rect 为 Rect2I(0, 0, 10, 2)\n" +"rect = rect.Expand(new Vector2I(-5, 5)); // rect 为 Rect2I(-5, 0, 10, 5)\n" +"[/csharp]\n" +"[/codeblocks]" + +msgid "" +"Returns the center point of the rectangle. This is the same as [code]position " +"+ (size / 2)[/code].\n" +"[b]Note:[/b] If the [member size] is odd, the result will be rounded towards " +"[member position]." +msgstr "" +"返回该矩形的中心点。这与 [code]position + (size / 2)[/code] 相同。\n" +"[b]注意:[/b]如果 [member size] 为奇数,则结果将向 [member position] 舍入。" + +msgid "" +"Returns a copy of this rectangle extended on all sides by the given [param " +"amount]. A negative [param amount] shrinks the rectangle instead. See also " +"[method grow_individual] and [method grow_side].\n" +"[codeblocks]\n" +"[gdscript]\n" +"var a = Rect2i(4, 4, 8, 8).grow(4) # a is Rect2i(0, 0, 16, 16)\n" +"var b = Rect2i(0, 0, 8, 4).grow(2) # b is Rect2i(-2, -2, 12, 8)\n" +"[/gdscript]\n" +"[csharp]\n" +"var a = new Rect2I(4, 4, 8, 8).Grow(4); // a is Rect2I(0, 0, 16, 16)\n" +"var b = new Rect2I(0, 0, 8, 4).Grow(2); // b is Rect2I(-2, -2, 12, 8)\n" +"[/csharp]\n" +"[/codeblocks]" +msgstr "" +"返回该矩形的副本,该矩形在所有边上扩展给定的 [param amount]。负的 [param " +"amount] 会缩小该矩形。另见 [method grow_individual] 和 [method grow_side]。\n" +"[codeblocks]\n" +"[gdscript]\n" +"var a = Rect2i(4, 4, 8, 8).grow(4) # a 为 Rect2i(0, 0, 16, 16)\n" +"var b = Rect2i(0, 0, 8, 4).grow(2) # b 为 Rect2i(-2, -2, 12, 8)\n" +"[/gdscript]\n" +"[csharp]\n" +"var a = new Rect2I(4, 4, 8, 8).Grow(4); // a 为 Rect2I(0, 0, 16, 16)\n" +"var b = new Rect2I(0, 0, 8, 4).Grow(2); // b 为 Rect2I(-2, -2, 12, 8)\n" +"[/csharp]\n" +"[/codeblocks]" + +msgid "" +"Returns [code]true[/code] if the rectangle contains the given [param point]. " +"By convention, points on the right and bottom edges are [b]not[/b] included.\n" +"[b]Note:[/b] This method is not reliable for [Rect2i] with a [i]negative[/i] " +"[member size]. Use [method abs] first to get a valid rectangle." +msgstr "" +"如果该矩形包含给定的 [param point],则返回 [code]true[/code]。依照惯例,[b]不" +"[/b]包括右侧和底部边缘上的点。\n" +"[b]注意:[/b]对于[i]大小为负[/i]的 [Rect2i],该方法并不可靠。请首先使用 " +"[method abs] 获取一个有效的矩形。" + +msgid "" +"Returns the intersection between this rectangle and [param b]. If the " +"rectangles do not intersect, returns an empty [Rect2i].\n" +"[codeblocks]\n" +"[gdscript]\n" +"var a = Rect2i(0, 0, 5, 10)\n" +"var b = Rect2i(2, 0, 8, 4)\n" +"\n" +"var c = a.intersection(b) # c is Rect2i(2, 0, 3, 4)\n" +"[/gdscript]\n" +"[csharp]\n" +"var a = new Rect2I(0, 0, 5, 10);\n" +"var b = new Rect2I(2, 0, 8, 4);\n" +"\n" +"var c = rect1.Intersection(rect2); // c is Rect2I(2, 0, 3, 4)\n" +"[/csharp]\n" +"[/codeblocks]\n" +"[b]Note:[/b] If you only need to know whether two rectangles are overlapping, " +"use [method intersects], instead." +msgstr "" +"返回该矩形与 [param b] 之间的交集。如果矩形不相交,则返回空的 [Rect2i]。\n" +"[codeblocks]\n" +"[gdscript]\n" +"var a = Rect2i(0, 0, 5, 10)\n" +"var b = Rect2i(2, 0, 8, 4)\n" +"\n" +"var c = a.intersection(b) # c 为 Rect2i(2, 0, 3, 4)\n" +"[/gdscript]\n" +"[csharp]\n" +"var a = new Rect2I(0, 0, 5, 10);\n" +"var b = new Rect2I(2, 0, 8, 4);\n" +"\n" +"var c = rect1.Intersection(rect2); // c 为 Rect2I(2, 0, 3, 4)\n" +"[/csharp]\n" +"[/codeblocks]\n" +"[b]注意:[/b]如果你只需要知道两个矩形是否重叠,请改用 [method intersects]。" + +msgid "" +"Returns [code]true[/code] if this rectangle overlaps with the [param b] " +"rectangle. The edges of both rectangles are excluded." +msgstr "" +"如果该矩形与 [param b] 矩形重叠,则返回 [code]true[/code]。两个矩形的边缘均被" +"排除。" + +msgid "" +"Returns a [Rect2i] that encloses both this rectangle and [param b] around the " +"edges. See also [method encloses]." +msgstr "" +"返回一个包含该矩形和边缘周围的 [param b] 的 [Rect2i]。另见 [method encloses]。" + +msgid "" +"Returns [code]true[/code] if the [member position] or [member size] of both " +"rectangles are not equal." +msgstr "" +"如果两个矩形的 [member position] 或 [member size] 不相等,则返回 [code]true[/" +"code]。" + +msgid "" +"Returns [code]true[/code] if both [member position] and [member size] of the " +"rectangles are equal, respectively." +msgstr "" +"如果该矩形的 [member position] 和 [member size] 分别相等,则返回 [code]true[/" +"code]。" + msgid "A 2D rectangle shape used for physics collision." msgstr "2D 矩形,旨在用于物理学。" @@ -89918,6 +100846,13 @@ msgid "" "so that they are automatically released when no longer in use, and only then. " "[RefCounted]s therefore do not need to be freed manually with [method Object." "free].\n" +"[RefCounted] instances caught in a cyclic reference will [b]not[/b] be freed " +"automatically. For example, if a node holds a reference to instance [code]A[/" +"code], which directly or indirectly holds a reference back to [code]A[/code], " +"[code]A[/code]'s reference count will be 2. Destruction of the node will " +"leave [code]A[/code] dangling with a reference count of 1, and there will be " +"a memory leak. To prevent this, one of the references in the cycle can be " +"made weak with [method @GlobalScope.weakref].\n" "In the vast majority of use cases, instantiating and using [RefCounted]-" "derived types is all you need to do. The methods provided in this class are " "only for advanced users, and can cause issues if misused.\n" @@ -89931,6 +100866,11 @@ msgstr "" "与其他 [Object] 类型不同,[RefCounted] 保留一个内部引用计数器,以便它们在不再" "使用时自动释放,并且仅在那时才会如此。因此,[RefCounted] 不需要使用 [method " "Object.free] 手动释放。\n" +"陷入循环引用的 [RefCounted] 实例将[b]不会[/b]自动释放。例如,如果节点持有对实" +"例 [code]A[/code] 的引用,而该实例直接或间接持有对 [code]A[/code] 的引用,则 " +"[code]A[/code] 的引用计数将为 2。该节点的销毁将使 [code]A[/code] 悬空,引用计" +"数为 1,并且会出现内存泄漏。为了防止这种情况,可以使用 [method @GlobalScope." +"weakref] 将循环中的引用之一设置为弱引用。\n" "在绝大多数用例中,只需实例化和使用 [RefCounted] 派生类型即可。该类中提供的方法" "仅适用于高级用户,如果使用不当可能会导致问题。\n" "[b]注意:[/b]在 C# 中,引用计数的对象在不再使用后不会立即被释放。相反,垃圾收" @@ -89957,6 +100897,16 @@ msgstr "" "内部引用增量计数器。只有在你真的知道你在做什么的时候才使用这个。\n" "如果增量成功,返回 [code]true[/code],否则返回 [code]false[/code]。" +msgid "" +"Decrements the internal reference counter. Use this only if you really know " +"what you are doing.\n" +"Returns [code]true[/code] if the object should be freed after the decrement, " +"[code]false[/code] otherwise." +msgstr "" +"内部引用减量计数器。只有在你真的知道你在做什么的时候才使用这个。\n" +"如果该对象在递减后应被释放,则返回 [code]true[/code],否则返回 [code]false[/" +"code]。" + msgid "A rectangle hint for designing UIs." msgstr "设计 UI 使用的矩形提示。" @@ -90215,6 +101165,133 @@ msgid "Class for searching text for patterns using regular expressions." msgstr "使用正则表达式搜索文本的类。" msgid "" +"A regular expression (or regex) is a compact language that can be used to " +"recognize strings that follow a specific pattern, such as URLs, email " +"addresses, complete sentences, etc. For example, a regex of [code]ab[0-9][/" +"code] would find any string that is [code]ab[/code] followed by any number " +"from [code]0[/code] to [code]9[/code]. For a more in-depth look, you can " +"easily find various tutorials and detailed explanations on the Internet.\n" +"To begin, the RegEx object needs to be compiled with the search pattern using " +"[method compile] before it can be used.\n" +"[codeblock]\n" +"var regex = RegEx.new()\n" +"regex.compile(\"\\\\w-(\\\\d+)\")\n" +"[/codeblock]\n" +"The search pattern must be escaped first for GDScript before it is escaped " +"for the expression. For example, [code]compile(\"\\\\d+\")[/code] would be " +"read by RegEx as [code]\\d+[/code]. Similarly, [code]compile(\"\\\"(?:\\\\\\" +"\\.|[^\\\"])*\\\"\")[/code] would be read as [code]\"(?:\\\\.|[^\"])*\"[/" +"code]. In GDScript, you can also use raw string literals (r-strings). For " +"example, [code]compile(r'\"(?:\\\\.|[^\"])*\"')[/code] would be read the " +"same.\n" +"Using [method search], you can find the pattern within the given text. If a " +"pattern is found, [RegExMatch] is returned and you can retrieve details of " +"the results using methods such as [method RegExMatch.get_string] and [method " +"RegExMatch.get_start].\n" +"[codeblock]\n" +"var regex = RegEx.new()\n" +"regex.compile(\"\\\\w-(\\\\d+)\")\n" +"var result = regex.search(\"abc n-0123\")\n" +"if result:\n" +" print(result.get_string()) # Would print n-0123\n" +"[/codeblock]\n" +"The results of capturing groups [code]()[/code] can be retrieved by passing " +"the group number to the various methods in [RegExMatch]. Group 0 is the " +"default and will always refer to the entire pattern. In the above example, " +"calling [code]result.get_string(1)[/code] would give you [code]0123[/code].\n" +"This version of RegEx also supports named capturing groups, and the names can " +"be used to retrieve the results. If two or more groups have the same name, " +"the name would only refer to the first one with a match.\n" +"[codeblock]\n" +"var regex = RegEx.new()\n" +"regex.compile(\"d(?<digit>[0-9]+)|x(?<digit>[0-9a-f]+)\")\n" +"var result = regex.search(\"the number is x2f\")\n" +"if result:\n" +" print(result.get_string(\"digit\")) # Would print 2f\n" +"[/codeblock]\n" +"If you need to process multiple results, [method search_all] generates a list " +"of all non-overlapping results. This can be combined with a [code]for[/code] " +"loop for convenience.\n" +"[codeblock]\n" +"for result in regex.search_all(\"d01, d03, d0c, x3f and x42\"):\n" +" print(result.get_string(\"digit\"))\n" +"# Would print 01 03 0 3f 42\n" +"[/codeblock]\n" +"[b]Example of splitting a string using a RegEx:[/b]\n" +"[codeblock]\n" +"var regex = RegEx.new()\n" +"regex.compile(\"\\\\S+\") # Negated whitespace character class.\n" +"var results = []\n" +"for result in regex.search_all(\"One Two \\n\\tThree\"):\n" +" results.push_back(result.get_string())\n" +"# The `results` array now contains \"One\", \"Two\", \"Three\".\n" +"[/codeblock]\n" +"[b]Note:[/b] Godot's regex implementation is based on the [url=https://www." +"pcre.org/]PCRE2[/url] library. You can view the full pattern reference " +"[url=https://www.pcre.org/current/doc/html/pcre2pattern.html]here[/url].\n" +"[b]Tip:[/b] You can use [url=https://regexr.com/]Regexr[/url] to test regular " +"expressions online." +msgstr "" +"正则表达式(或称 regex)是一种紧凑的语言,可用于识别遵循特定模式的字符串,如 " +"URL、电子邮件地址、完整句子等。例如正则表达式 [code]ab[0-9][/code] 可以找到 " +"[code]ab[/code] 后面跟着 [code]0[/code] 到 [code]9[/code] 的任何数字的字符串。" +"要想更深入地了解,你可以很容易地在互联网上找到各种教程和详细解释。\n" +"首先,在使用 RegEx 对象之前,需要用 [method compile] 对其进行搜索模式的编" +"译。\n" +"[codeblock]\n" +"var regex = RegEx.new()\n" +"regex.compile(\"\\\\w-(\\\\d+)\")\n" +"[/codeblock]\n" +"在为表达式转义之前,必须先为 GDScript 转义搜索模式。例如,[code]compile(\"\\" +"\\d+\")[/code] 会被 RegEx 读成 [code]\\d+[/code]。同样,[code]compile(\"\\" +"\"(?:\\\\\\\\.|[^\\\"])*\\\")[/code] 会被读作 [code]\"(?:\\.|[^\"])*\"[/" +"code]。在 GDScript 中,你还可以使用原始字符串文字(r-字符串)。例如," +"[code]compile(r'\"(?:\\\\.|[^\"])*\"')[/code] 将被读取为相同的。\n" +"使用 [method search],你可以在给定的文本中匹配模式。如果匹配到一个模式,将返" +"回 [RegExMatch],你可以使用 [method RegExMatch.get_string] 和 [method " +"RegExMatch.get_start] 等方法检索结果的细节。\n" +"[codeblock]\n" +"var regex = RegEx.new()\n" +"regex.compile(\"\\\\w-(\\\\d+)\")\n" +"var result = regex.search(\"abc n-0123\")\n" +"if result:\n" +" print(result.get_string()) # 会输出 n-0123\n" +"[/codeblock]\n" +"捕获组的结果 [code]()[/code] 可以通过向 [RegExMatch] 中的各种方法传递组号来检" +"索。默认是组 0,并且将总是指整个模式。在上面的例子中,调用 [code]result." +"get_string(1)[/code] 会得到 [code]0123[/code]。\n" +"这个版本的 RegEx 也支持命名的捕获组,名称可以用来检索结果。如果两个或更多的组" +"有相同的名称,那么这个名称将只指第一个有匹配的组。\n" +"[codeblock]\n" +"var regex = RegEx.new()\n" +"regex.compile(\"d(?<digit>[0-9]+)|x(?<digit>[0-9a-f]+)\")\n" +"var result = regex.search(\"数字是 x2f\")\n" +"if result:\n" +" print(result.get_string(\"digit\")) # 会输出 2f\n" +"[/codeblock]\n" +"如果你需要处理多个结果,[method search_all] 会生成一个所有不重叠的结果列表。为" +"了方便起见,这可以和一个 [code]for[/code] 循环结合起来。\n" +"[codeblock]\n" +"for result in regex.search_all(\"d01, d03, d0c, x3f and x42\"):\n" +" print(result.get_string(\"digit\"))\n" +"# 会输出 01 03 0 3f 42\n" +"[/codeblock]\n" +"[b]使用 RegEx 分割字符串的例子:[/b]\n" +"[codeblock]\n" +"var regex = RegEx.new()\n" +"regex.compile(\"\\\\S+\") # 非空白字符类。\n" +"var results = []\n" +"for result in regex.search_all(\"One Two \\n\\tThree\"):\n" +" results.push_back(result.get_string())\n" +"# `results` 数组包含 \"One\"、\"Two\"、\"Three\"。\n" +"[/codeblock]\n" +"[b]注意:[/b]Godot 的 regex 实现基于的是 [url=https://www.pcre.org/]PCRE2[/" +"url]。你可以查看完整的模式参考[url=https://www.pcre.org/current/doc/html/" +"pcre2pattern.html]这里[/url]。\n" +"[b]提示:[/b]你可以使用 [url=https://regexr.com/]Regexr[/url] 来在线测试正则表" +"达式。" + +msgid "" "This method resets the state of the object, as if it was freshly created. " "Namely, it unassigns the regular expression of this object." msgstr "" @@ -90510,6 +101587,24 @@ msgstr "" "full_barrier],可能更适合调试。" msgid "" +"Clears the contents of the [param buffer], clearing [param size_bytes] bytes, " +"starting at [param offset]. Always raises a memory barrier.\n" +"Prints an error if:\n" +"- the size isn't a multiple of four\n" +"- the region specified by [param offset] + [param size_bytes] exceeds the " +"buffer\n" +"- a draw list is currently active (created by [method draw_list_begin])\n" +"- a compute list is currently active (created by [method compute_list_begin])" +msgstr "" +"清除 [param buffer] 的内容,清除 [param size_bytes] 字节,从 [param offset] 开" +"始。总是会造成内存障碍。\n" +"如果出现以下情况,则打印错误:\n" +"- 大小不是四的倍数\n" +"- [param offset] + [param size_bytes] 指定的区域超出缓冲区\n" +"- 绘制列表当前处于活动状态(由 [method draw_list_begin] 创建)\n" +"- 计算列表当前处于活动状态(由 [method compute_list_begin] 创建)" + +msgid "" "Returns a copy of the data of the specified [param buffer], optionally [param " "offset_bytes] and [param size_bytes] can be set to copy only a portion of the " "buffer." @@ -90518,6 +101613,24 @@ msgstr "" "[param size_bytes],仅复制缓冲区的某一部分。" msgid "" +"Updates a region of [param size_bytes] bytes, starting at [param offset], in " +"the buffer, with the specified [param data]. Raises a memory barrier except " +"when [param post_barrier] is set to [constant BARRIER_MASK_NO_BARRIER].\n" +"Prints an error if:\n" +"- the region specified by [param offset] + [param size_bytes] exceeds the " +"buffer\n" +"- a draw list is currently active (created by [method draw_list_begin])\n" +"- a compute list is currently active (created by [method compute_list_begin])" +msgstr "" +"使用指定的 [param data] 更新缓冲区中从 [param offset] 开始的 [param " +"size_bytes] 字节区块。引发一个内存屏障,除非 [param post_barrier] 被设置为 " +"[constant BARRIER_MASK_NO_BARRIER]。\n" +"如果出现以下情况,则打印错误:\n" +"- [param offset] + [param size_bytes] 指定的区块超出该缓冲区\n" +"- 绘制列表当前处于活动状态(由 [method draw_list_begin] 创建)\n" +"- 计算列表当前处于活动状态(由 [method compute_list_begin] 创建)" + +msgid "" "Creates a timestamp marker with the specified [param name]. This is used for " "performance reporting with the [method get_captured_timestamp_cpu_time], " "[method get_captured_timestamp_gpu_time] and [method " @@ -90527,6 +101640,9 @@ msgstr "" "get_captured_timestamp_cpu_time]、[method get_captured_timestamp_gpu_time]、" "[method get_captured_timestamp_name] 等方法的性能汇报。" +msgid "Raises a Vulkan compute barrier in the specified [param compute_list]." +msgstr "在指定的 [param compute_list] 中引发 Vulkan 计算屏障。" + msgid "" "Starts a list of compute commands created with the [code]compute_*[/code] " "methods. The returned value should be passed to other [code]compute_list_*[/" @@ -90582,6 +101698,26 @@ msgstr "" "[/codeblock]" msgid "" +"Tells the GPU what compute pipeline to use when processing the compute list. " +"If the shader has changed since the last time this function was called, Godot " +"will unbind all descriptor sets and will re-bind them inside [method " +"compute_list_dispatch]." +msgstr "" +"告诉 GPU 在处理计算列表时使用什么计算管道。如果自上次调用该函数以来着色器发生" +"了更改,Godot 将取消绑定所有描述符集,并在 [method compute_list_dispatch] 中重" +"新绑定它们。" + +msgid "" +"Binds the [param uniform_set] to this [param compute_list]. Godot ensures " +"that all textures in the uniform set have the correct Vulkan access masks. If " +"Godot had to change access masks of textures, it will raise a Vulkan image " +"memory barrier." +msgstr "" +"将 [param uniform_set] 绑定到该 [param compute_list]。Godot 确保统一集中的所有" +"纹理都具有正确的 Vulkan 访问蒙版。如果 Godot 必须更改纹理的访问蒙版,则会引发 " +"Vulkan 图像内存障碍。" + +msgid "" "Submits the compute list for processing on the GPU. This is the compute " "equivalent to [method draw_list_draw]." msgstr "将计算列表提交给 GPU 处理。相当于是计算版本的 [method draw_list_draw]。" @@ -90722,6 +101858,20 @@ msgstr "" "[/codeblock]" msgid "" +"High-level variant of [method draw_list_begin], with the parameters " +"automatically being adjusted for drawing onto the window specified by the " +"[param screen] ID.\n" +"[b]Note:[/b] Cannot be used with local RenderingDevices, as these don't have " +"a screen. If called on a local RenderingDevice, [method " +"draw_list_begin_for_screen] returns [constant INVALID_ID]." +msgstr "" +"[method draw_list_begin] 的高阶变体,会针对绘制到 [param screen] ID 指定的窗口" +"上自动调整参数。\n" +"[b]注意:[/b]局部 RenderingDevice 没有屏幕,所以无法使用。如果在局部 " +"RenderingDevice 上调用,[method draw_list_begin_for_screen] 会返回 [constant " +"INVALID_ID]。" + +msgid "" "Variant of [method draw_list_begin] with support for multiple splits. The " "[param splits] parameter determines how many splits are created." msgstr "" @@ -91191,6 +102341,25 @@ msgstr "" "shader_create_from_bytecode]。" msgid "" +"Create a placeholder RID by allocating an RID without initializing it for use " +"in [method shader_create_from_bytecode]. This allows you to create an RID for " +"a shader and pass it around, but defer compiling the shader to a later time." +msgstr "" +"通过分配 RID 来创建占位符 RID,而不对其进行初始化以供在 [method " +"shader_create_from_bytecode] 中使用。这允许你为着色器创建 RID 并传递它,但将着" +"色器的编译推迟到以后的时间。" + +msgid "" +"Returns the internal vertex input mask. Internally, the vertex input mask is " +"an unsigned integer consisting of the locations (specified in GLSL via. " +"[code]layout(location = ...)[/code]) of the input variables (specified in " +"GLSL by the [code]in[/code] keyword)." +msgstr "" +"返回内部顶点输入掩码。在内部,顶点输入掩码是一个无符号整数,由输入变量(在 " +"GLSL 中通过 [code]in[/code] 关键字指定)的位置(在 GLSL 中通过 " +"[code]layout(location = ...)[/code] 指定)组成。" + +msgid "" "Creates a [url=https://vkguide.dev/docs/chapter-4/storage_buffers/]storage " "buffer[/url] with the specified [param data] and [param usage]. It can be " "accessed with the RID that is returned.\n" @@ -91233,6 +102402,29 @@ msgstr "" "RID 使用结束后,应该使用 RenderingServer 的 [method free_rid] 方法进行释放。" msgid "" +"Clears the specified [param texture] by replacing all of its pixels with the " +"specified [param color]. [param base_mipmap] and [param mipmap_count] " +"determine which mipmaps of the texture are affected by this clear operation, " +"while [param base_layer] and [param layer_count] determine which layers of a " +"3D texture (or texture array) are affected by this clear operation. For 2D " +"textures (which only have one layer by design), [param base_layer] must be " +"[code]0[/code] and [param layer_count] must be [code]1[/code].\n" +"[b]Note:[/b] [param texture] can't be cleared while a draw list that uses it " +"as part of a framebuffer is being created. Ensure the draw list is finalized " +"(and that the color/depth texture using it is not set to [constant " +"FINAL_ACTION_CONTINUE]) to clear this texture." +msgstr "" +"将指定的 [param texture] 清屏,将所有像素替换为指定的颜色 [param color]。" +"[param base_mipmap] 和 [param mipmap_count] 决定该清屏操作影响纹理的哪些 " +"mipmap,而 [param base_layer] 和 [param layer_count] 决定该清屏操作影响 3D 纹" +"理(或纹理数组)的哪几层。如果是 2D 纹理(本来就只有一层),则 [param " +"base_layer] 必须为 [code]0[/code],[param layer_count] 必须为 [code]1[/" +"code]。\n" +"[b]注意:[/b]如果使用 [param texture] 的绘图列表是创建的帧缓冲的一部分,则该纹" +"理不能被清屏。确保绘图列表释放后(并且使用它的颜色和深度纹理没有被设为 " +"[constant FINAL_ACTION_CONTINUE])才能对该纹理做清屏操作。" + +msgid "" "Copies the [param from_texture] to [param to_texture] with the specified " "[param from_pos], [param to_pos] and [param size] coordinates. The Z axis of " "the [param from_pos], [param to_pos] and [param size] must be [code]0[/code] " @@ -91289,6 +102481,17 @@ msgstr "" "的是 Godot 专属的 [Texture2D] 资源,不是图形 API 自己的纹理类型。" msgid "" +"Returns an RID for an existing [param image] ([code]VkImage[/code]) with the " +"given [param type], [param format], [param samples], [param usage_flags], " +"[param width], [param height], [param depth], and [param layers]. This can be " +"used to allow Godot to render onto foreign images." +msgstr "" +"使用给定的 [param type]、[param format]、[param samples]、[param " +"usage_flags]、[param width]、[param height]、[param depth]、和 [param layers] " +"返回已有 [param image]([code]VkImage[/code])的 RID。这可被用于允许 Godot 渲" +"染到外部图像上。" + +msgid "" "Creates a shared texture using the specified [param view] and the texture " "information from [param with_texture]." msgstr "" @@ -91335,6 +102538,9 @@ msgstr "" "[b]注意:[/b][param texture] 纹理需要获取 [constant " "TEXTURE_USAGE_CAN_COPY_FROM_BIT]。否则会输出错误并返回空的 [PackedByteArray]。" +msgid "Returns the data format used to create this texture." +msgstr "返回用于创建该纹理的数据格式。" + msgid "" "Returns the internal graphics handle for this texture object. For use when " "communicating with third-party APIs mostly with GDExtension.\n" @@ -94523,6 +105729,18 @@ msgstr "" "BakeChannels] 中指定的材质属性的 [Image] 数组。" msgid "" +"As the RenderingServer actual logic may run on an separate thread, accessing " +"its internals from the main (or any other) thread will result in errors. To " +"make it easier to run code that can safely access the rendering internals " +"(such as [RenderingDevice] and similar RD classes), push a callable via this " +"function so it will be executed on the render thread." +msgstr "" +"由于 RenderingServer 实际逻辑可能在单独的线程上运行,因此从主(或任何其他)线" +"程访问其内部将导致错误。为了更轻松地运行可以安全访问渲染内部的代码(例如 " +"[RenderingDevice] 和类似的 RD 类),请通过该函数推送一个可调用对象,以便它将在" +"渲染线程上执行。" + +msgid "" "Creates a camera attributes object and adds it to the RenderingServer. It can " "be accessed with the RID that is returned. This RID will be used in all " "[code]camera_attributes_[/code] RenderingServer functions.\n" @@ -95705,6 +106923,20 @@ msgstr "" "[b]注意:[/b]当运行无头或服务器可执行文件时,该函数返回一个空字符串。" msgid "" +"Returns the name of the video adapter (e.g. \"GeForce GTX 1080/PCIe/SSE2\").\n" +"[b]Note:[/b] When running a headless or server binary, this function returns " +"an empty string.\n" +"[b]Note:[/b] On the web platform, some browsers such as Firefox may report a " +"different, fixed GPU name such as \"GeForce GTX 980\" (regardless of the " +"user's actual GPU model). This is done to make fingerprinting more difficult." +msgstr "" +"返回视频适配器的名称(例如“GeForce GTX 1080/PCIe/SSE2”)。\n" +"[b]注意:[/b]运行无头或服务器二进制文件时,该函数返回空字符串。\n" +"[b]注意:[/b]在 web 平台上,某些浏览器(例如 Firefox)可能会报告不同的固定 " +"GPU 名称,例如“GeForce GTX 980”(无论用户的实际 GPU 型号如何)。这样做是为了使" +"指纹识别更加困难。" + +msgid "" "Returns the type of the video adapter. Since dedicated graphics cards from a " "given generation will [i]usually[/i] be significantly faster than integrated " "graphics made in the same generation, the device type can be used as a basis " @@ -96370,6 +107602,39 @@ msgstr "返回网格表面的缓冲区数组。" msgid "Returns a mesh's surface's arrays for blend shapes." msgstr "返回网格表面的混合形状数组。" +msgid "" +"Returns the stride of the attribute buffer for a mesh with given [param " +"format]." +msgstr "返回具有给定 [param format] 的网格的属性缓冲区的步幅。" + +msgid "" +"Returns the stride of the combined normals and tangents for a mesh with given " +"[param format]. Note importantly that, while normals and tangents are in the " +"vertex buffer with vertices, they are only interleaved with each other and so " +"have a different stride than vertex positions." +msgstr "" +"返回具有给定 [param format] 的网格的组合法线和切线的步幅。重要的是请注意,虽然" +"法线和切线位于带有顶点的顶点缓冲区中,但它们仅彼此交错,因此具有与顶点位置不同" +"的步幅。" + +msgid "" +"Returns the offset of a given attribute by [param array_index] in the start " +"of its respective buffer." +msgstr "返回由 [param array_index] 给定属性在其各自缓冲区开头的偏移量。" + +msgid "" +"Returns the stride of the skin buffer for a mesh with given [param format]." +msgstr "返回具有给定 [param format] 的网格的皮肤缓冲区的步幅。" + +msgid "" +"Returns the stride of the vertex positions for a mesh with given [param " +"format]. Note importantly that vertex positions are stored consecutively and " +"are not interleaved with the other attributes in the vertex buffer (normals " +"and tangents)." +msgstr "" +"返回具有给定 [param format] 的网格的顶点位置的步幅。请注意,重要的是,顶点位置" +"是连续存储的,并且不与顶点缓冲区中的其他属性(法线和切线)交错。" + msgid "Returns a mesh's surface's material." msgstr "返回网格表面的材质。" @@ -96744,6 +108009,12 @@ msgstr "" "amount]。" msgid "" +"Sets the amount ratio for particles to be emitted. Equivalent to [member " +"GPUParticles3D.amount_ratio]." +msgstr "" +"设置要被发射的粒子的数量比率。相当于 [member GPUParticles3D.amount_ratio]。" + +msgid "" "Sets a custom axis-aligned bounding box for the particle system. Equivalent " "to [member GPUParticles3D.visibility_aabb]." msgstr "" @@ -96779,6 +108050,13 @@ msgid "" msgstr "设置粒子首次发射时使用的 [Transform3D]。" msgid "" +"Sets the velocity of a particle node, that will be used by [member " +"ParticleProcessMaterial.inherit_velocity_ratio]." +msgstr "" +"设置粒子节点的速度,将由 [member ParticleProcessMaterial." +"inherit_velocity_ratio] 使用。" + +msgid "" "If [code]true[/code], particles will emit over time. Setting to false does " "not reset the particles, but only stops their emission. Equivalent to [member " "GPUParticles3D.emitting]." @@ -96804,6 +108082,11 @@ msgstr "" "GPUParticles3D.fract_delta]。" msgid "" +"Sets the value that informs a [ParticleProcessMaterial] to rush all particles " +"towards the end of their lifetime." +msgstr "设置通知 [ParticleProcessMaterial] 将所有粒子冲向其生命周期终点的值。" + +msgid "" "Sets the lifetime of each particle in the system. Equivalent to [member " "GPUParticles3D.lifetime]." msgstr "设置系统中每个粒子的生命周期。相当于 [member GPUParticles3D.lifetime]。" @@ -97383,6 +108666,9 @@ msgstr "" "会输出错误,不会修改原始纹理。如果你需要使用不同的宽度、高度或格式,请改用 " "[method texture_replace]。" +msgid "Returns the [enum Image.Format] for the texture." +msgstr "返回该纹理的 [enum Image.Format]。" + msgid "Returns a texture [RID] that can be used with [RenderingDevice]." msgstr "返回可用于 [RenderingDevice] 的纹理 [RID]。" @@ -97400,6 +108686,14 @@ msgstr "" "[i]已废弃。[/i]ProxyTexture 已在 Godot 4 中移除,所以这个方法无法再使用。" msgid "" +"Creates a new texture object based on a texture created directly on the " +"[RenderingDevice]. If the texture contains layers, [param layer_type] is used " +"to define the layer type." +msgstr "" +"基于直接在 [RenderingDevice] 上创建的纹理创建新的纹理对象。如果该纹理包含图" +"层,则 [param layer_type] 被用于定义图层类型。" + +msgid "" "Replaces [param texture]'s texture data by the texture specified by the " "[param by_texture] RID, without changing [param texture]'s RID." msgstr "" @@ -97871,6 +109165,35 @@ msgstr "" "ProjectSettings.rendering/anti_aliasing/quality/use_debanding]。" msgid "" +"If [code]true[/code], 2D rendering will use a high dynamic range (HDR) format " +"framebuffer matching the bit depth of the 3D framebuffer. When using the " +"Forward+ renderer this will be a [code]RGBA16[/code] framebuffer, while when " +"using the Mobile renderer it will be a [code]RGB10_A2[/code] framebuffer. " +"Additionally, 2D rendering will take place in linear color space and will be " +"converted to sRGB space immediately before blitting to the screen (if the " +"Viewport is attached to the screen). Practically speaking, this means that " +"the end result of the Viewport will not be clamped into the [code]0-1[/code] " +"range and can be used in 3D rendering without color space adjustments. This " +"allows 2D rendering to take advantage of effects requiring high dynamic range " +"(e.g. 2D glow) as well as substantially improves the appearance of effects " +"requiring highly detailed gradients. This setting has the same effect as " +"[member Viewport.use_hdr_2d].\n" +"[b]Note:[/b] This setting will have no effect when using the GL Compatibility " +"renderer as the GL Compatibility renderer always renders in low dynamic range " +"for performance reasons." +msgstr "" +"如果为 [code]true[/code],2D 渲染将使用与 3D 帧缓冲区的位深度匹配的高动态范围" +"(HDR)格式帧缓冲区。当使用 Forward+ 渲染器时,这将是一个 [code]RGBA16[/code] " +"帧缓冲区,而当使用 Mobile 渲染器时,它将是一个 [code]RGB10_A2[/code] 帧缓冲" +"区。此外,2D 渲染将在线性色彩空间中进行,并在位块传输到屏幕之前(如果视口被连" +"接到屏幕)立即转换为 sRGB 空间。实际上,这意味着视口的最终结果不会被钳制在 " +"[code]0-1[/code] 范围内,并且可以在不进行色彩空间调整的情况下被用于 3D 渲染。" +"这使得 2D 渲染能够利用需要高动态范围的效果(例如 2D 辉光),并显著改善需要高度" +"详细渐变的效果的外观。该设置与 [member Viewport.use_hdr_2d] 效果相同。\n" +"[b]注意:[/b]使用 GL 兼容渲染器时,该设置无效,因为出于性能原因,GL 兼容渲染器" +"始终在低动态范围内渲染。" + +msgid "" "If [code]true[/code], enables occlusion culling on the specified viewport. " "Equivalent to [member ProjectSettings.rendering/occlusion_culling/" "use_occlusion_culling]." @@ -98242,6 +109565,52 @@ msgstr "用于标记重量数组的标记。" msgid "Flag used to mark an index array." msgstr "用于标记索引数组的标志。" +msgid "Flag used to mark that the array uses 8 bone weights instead of 4." +msgstr "用于标记数组使用 8 个骨骼权重而不是 4 个的标志。" + +msgid "" +"Flag used to mark that the mesh does not have a vertex array and instead will " +"infer vertex positions in the shader using indices and other information." +msgstr "" +"用于标记网格没有顶点数组,而是使用索引和其他信息推断着色器中的顶点位置的标志。" + +msgid "Flag used to mark the start of the bits used to store the mesh version." +msgstr "用于标记被用于存储网格版本的位的起始的标志。" + +msgid "" +"Flag used to shift a mesh format int to bring the version into the lowest " +"digits." +msgstr "用于移动网格格式 int,以将版本带入最低位的标志。" + +msgid "" +"Flag used to record the format used by prior mesh versions before the " +"introduction of a version." +msgstr "用于记录版本引入之前先前网格版本所使用的格式的标志。" + +msgid "" +"Flag used to record the second iteration of the mesh version flag. The " +"primary difference between this and [constant ARRAY_FLAG_FORMAT_VERSION_1] is " +"that this version supports [constant ARRAY_FLAG_COMPRESS_ATTRIBUTES] and in " +"this version vertex positions are de-interleaved from normals and tangents." +msgstr "" +"用于记录第二次迭代的网格版本标志的标志。该版本与 [constant " +"ARRAY_FLAG_FORMAT_VERSION_1] 之间的主要区别在于,该版本支持 [constant " +"ARRAY_FLAG_COMPRESS_ATTRIBUTES],并且在该版本中,顶点位置与法线和切线去交错。" + +msgid "" +"Flag used to record the current version that the engine expects. Currently " +"this is the same as [constant ARRAY_FLAG_FORMAT_VERSION_2]." +msgstr "" +"用于记录引擎期望的当前版本的标志。目前这与 [constant " +"ARRAY_FLAG_FORMAT_VERSION_2] 相同。" + +msgid "" +"Flag used to isolate the bits used for mesh version after using [constant " +"ARRAY_FLAG_FORMAT_VERSION_SHIFT] to shift them into place." +msgstr "" +"使用 [constant ARRAY_FLAG_FORMAT_VERSION_SHIFT] 将用于网格版本的位转移到位后," +"用于隔离这些位的标志。" + msgid "Primitive to draw consists of points." msgstr "绘制的图元由点组成。" @@ -98680,8 +110049,16 @@ msgstr "3D 粒子。" msgid "Draw particles in the order that they appear in the particles array." msgstr "按照粒子数组中出现的顺序绘制粒子。" -msgid "Sort particles based on their lifetime." -msgstr "根据粒子的寿命对其进行分类。" +msgid "" +"Sort particles based on their lifetime. In other words, the particle with the " +"highest lifetime is drawn at the front." +msgstr "根据粒子的寿命对其进行排序。换句话说,寿命最长的粒子被绘制在前面。" + +msgid "" +"Sort particles based on the inverse of their lifetime. In other words, the " +"particle with the lowest lifetime is drawn at the front." +msgstr "" +"根据粒子寿命的倒数对粒子进行排序。换句话说,寿命最短的粒子被绘制在前面。" msgid "Sort particles based on their distance to the camera." msgstr "根据粒子与相机的距离对其进行排序。" @@ -98749,6 +110126,19 @@ msgstr "" "FSR 放大视口。不支持大于 [code]1.0[/code] 的值,将改用双线性降采样。" "[code]1.0[/code] 的值将禁用缩放。" +msgid "" +"Use AMD FidelityFX Super Resolution 2.2 upscaling for the viewport's 3D " +"buffer. The amount of scaling can be set using [member Viewport." +"scaling_3d_scale]. Values less than [code]1.0[/code] will be result in the " +"viewport being upscaled using FSR2. Values greater than [code]1.0[/code] are " +"not supported and bilinear downsampling will be used instead. A value of " +"[code]1.0[/code] will use FSR2 at native resolution as a TAA solution." +msgstr "" +"对视口的 3D 缓冲区使用 AMD FidelityFX 超分辨率 2.2 放大。可以使用 [member " +"Viewport.scaling_3d_scale] 设置缩放量。小于 [code]1.0[/code] 的值将导致使用 " +"FSR2 放大视口。不支持大于 [code]1.0[/code] 的值,将改用双线性降采样。" +"[code]1.0[/code] 的值将使用原生分辨率下的 FSR2 作为 TAA 解决方案。" + msgid "Represents the size of the [enum ViewportScaling3DMode] enum." msgstr "代表 [enum ViewportScaling3DMode] 枚举的大小。" @@ -98983,6 +110373,24 @@ msgstr "" "阴影图集。" msgid "" +"Draws the shadow atlas that stores shadows from [DirectionalLight3D]s in the " +"upper left quadrant of the [Viewport].\n" +"The slice of the camera frustum related to the shadow map cascade is " +"superimposed to visualize coverage. The color of each slice matches the " +"colors used for [constant VIEWPORT_DEBUG_DRAW_PSSM_SPLITS]. When shadow " +"cascades are blended the overlap is taken into account when drawing the " +"frustum slices.\n" +"The last cascade shows all frustum slices to illustrate the coverage of all " +"slices." +msgstr "" +"绘制阴影图集,该阴影图集存储 [Viewport] 左上象限中 [DirectionalLight3D] 的阴" +"影。\n" +"与阴影贴图级联相关的相机视锥体切片被叠加以可视化覆盖范围。每个切片的颜色与 " +"[constant VIEWPORT_DEBUG_DRAW_PSSM_SPLITS] 使用的颜色匹配。当混合阴影级联时," +"绘制视锥体切片时会考虑重叠。\n" +"最后一个级联显示了所有视锥体切片,以说明所有切片的覆盖范围。" + +msgid "" "Draws the estimated scene luminance. This is a 1×1 texture that is generated " "when autoexposure is enabled to control the scene's exposure." msgstr "" @@ -99084,6 +110492,12 @@ msgid "" "correct for motion that occurs during gameplay." msgstr "绘制运动向量缓冲。由时间抗锯齿使用,能够修正在游戏过程中发生的运动。" +msgid "" +"Internal buffer is drawn instead of regular scene so you can see the per-" +"pixel output that will be used by post-processing effects." +msgstr "" +"绘制内部缓冲区而不是常规场景,因此可以看到将被后处理效果使用的每像素输出。" + msgid "Variable rate shading is disabled." msgstr "可变速率着色已禁用。" @@ -99575,28 +110989,52 @@ msgid "Uses the default filter mode for this [Viewport]." msgstr "为 [Viewport] 使用默认过滤模式。" msgid "" -"The texture filter blends between the nearest 4 pixels and between the " -"nearest 2 mipmaps." -msgstr "纹理过滤在最近的 4 个像素之间和最近的 2 个 mipmap 之间混合。" - -msgid "" -"The texture filter reads from the nearest pixel, but selects a mipmap based " -"on the angle between the surface and the camera view. This reduces artifacts " -"on surfaces that are almost in line with the camera." -msgstr "" -"纹理过滤从最近的像素读取,但根据表面和相机视图之间的角度选择一个 mipmap。这减" -"少了几乎与相机共线的表面上的伪影。" - -msgid "" -"The texture filter blends between the nearest 4 pixels and selects a mipmap " -"based on the angle between the surface and the camera view. This reduces " -"artifacts on surfaces that are almost in line with the camera. This is the " -"slowest of the filtering options, but results in the highest quality " -"texturing." -msgstr "" -"纹理过滤在最近的 4 个像素之间进行混合,并根据表面和相机视图之间的角度选择一个 " -"mipmap。这减少了几乎与相机共线的表面上的伪影。这是最慢的过滤选项,但会产生最高" -"质量的纹理。" +"The texture filter reads from the nearest pixel and blends between 2 mipmaps " +"(or uses the nearest mipmap if [member ProjectSettings.rendering/textures/" +"default_filters/use_nearest_mipmap_filter] is [code]true[/code]) based on the " +"angle between the surface and the camera view. This makes the texture look " +"pixelated from up close, and smooth from a distance. Anisotropic filtering " +"improves texture quality on surfaces that are almost in line with the camera, " +"but is slightly slower. The anisotropic filtering level can be changed by " +"adjusting [member ProjectSettings.rendering/textures/default_filters/" +"anisotropic_filtering_level].\n" +"[b]Note:[/b] This texture filter is rarely useful in 2D projects. [constant " +"CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS] is usually more appropriate " +"in this case." +msgstr "" +"纹理过滤从最近的像素读取并根据表面和相机视图之间的角度在 2 个多级渐远纹理之间" +"进行混合(或者如果 [member ProjectSettings.rendering/textures/default_filters/" +"use_nearest_mipmap_filter] 为 [code]true[/code],则使用最近的多级渐远纹理)。" +"这使得纹理从近处看起来像素化,从远处看起来平滑。各向异性过滤提高了几乎与相机位" +"于一条线的表面上的纹理质量,但速度稍慢。各向异性过滤级别可以通过调整 [member " +"ProjectSettings.rendering/textures/default_filters/" +"anisotropic_filtering_level] 来改变。\n" +"[b]注意:[/b]该纹理过滤在 2D 项目中很少有用。[constant " +"CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS] 在这种情况下通常更合适。" + +msgid "" +"The texture filter blends between the nearest 4 pixels and blends between 2 " +"mipmaps (or uses the nearest mipmap if [member ProjectSettings.rendering/" +"textures/default_filters/use_nearest_mipmap_filter] is [code]true[/code]) " +"based on the angle between the surface and the camera view. This makes the " +"texture look smooth from up close, and smooth from a distance. Anisotropic " +"filtering improves texture quality on surfaces that are almost in line with " +"the camera, but is slightly slower. The anisotropic filtering level can be " +"changed by adjusting [member ProjectSettings.rendering/textures/" +"default_filters/anisotropic_filtering_level].\n" +"[b]Note:[/b] This texture filter is rarely useful in 2D projects. [constant " +"CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS] is usually more appropriate " +"in this case." +msgstr "" +"纹理过滤在最近的 4 个像素之间进行混合,并基于表面与相机视图之间的角度在 2 个多" +"级渐远纹理之间进行混合(或者如果 [member ProjectSettings.rendering/textures/" +"default_filters/use_nearest_mipmap_filter] 为 [code]true[/code],则使用最近的" +"多级渐远纹理)。这使得纹理从近处看起来平滑,从远处看起来也平滑。各向异性过滤提" +"高了几乎与相机位于一条线的表面上的纹理质量,但速度稍慢。各向异性过滤级别可以通" +"过调整 [member ProjectSettings.rendering/textures/default_filters/" +"anisotropic_filtering_level] 来改变。\n" +"[b]注意:[/b]该纹理过滤在 2D 项目中很少有用。[constant " +"CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS] 在这种情况下通常更合适。" msgid "Max value for [enum CanvasItemTextureFilter] enum." msgstr "[enum CanvasItemTextureFilter] 枚举的最大值。" @@ -99879,6 +111317,59 @@ msgid "" "Hardware supports multithreading. This enum is currently unused in Godot 3.x." msgstr "硬件支持多线程。这个枚举目前在 Godot 3.x 中没有使用。" +msgid "" +"Abstract scene buffers object, created for each viewport for which 3D " +"rendering is done." +msgstr "抽象场景缓冲对象,为完成 3D 渲染的每个视口创建。" + +msgid "" +"Abstract scene buffers object, created for each viewport for which 3D " +"rendering is done. It manages any additional buffers used during rendering " +"and will discard buffers when the viewport is resized.\n" +"[b]Note:[/b] this is an internal rendering server object only exposed for " +"GDExtension plugins." +msgstr "" +"抽象场景缓冲对象,为完成 3D 渲染的每个视口创建。它管理渲染期间使用的任何额外缓" +"冲区,并在调整视口大小时丢弃缓冲区。\n" +"[b]注意:[/b]这是一个仅为 GDExtension 插件公开的内部渲染服务器对象。" + +msgid "" +"This method is called by the rendering server when the associated viewports " +"configuration is changed. It will discard the old buffers and recreate the " +"internal buffers used." +msgstr "" +"当关联的视口配置更改时,渲染服务器会调用该方法。它将丢弃旧的缓冲区并重新创建使" +"用的内部缓冲区。" + +msgid "Configuration object used to setup a [RenderSceneBuffers] object." +msgstr "用于设置 [RenderSceneBuffers] 对象的配置对象。" + +msgid "" +"This configuration object is created and populated by the render engine on a " +"viewport change and used to (re)configure a [RenderSceneBuffers] object." +msgstr "" +"该配置对象由渲染引擎在视口更改时创建和填充,并用于(重新)配置 " +"[RenderSceneBuffers] 对象。" + +msgid "FSR Sharpness applicable if FSR upscaling is used." +msgstr "如果使用 FSR 放大,则 FSR 锐度适用。" + +msgid "The size of the 3D render buffer used for rendering." +msgstr "用于渲染的 3D 渲染缓冲区的大小。" + +msgid "The MSAA mode we're using for 3D rendering." +msgstr "用于 3D 渲染的 MSAA 模式。" + +msgid "The render target associated with these buffer." +msgstr "与这些缓冲区关联的渲染目标。" + +msgid "" +"The requested scaling mode with which we upscale/downscale if [member " +"internal_size] and [member target_size] are not equal." +msgstr "" +"如果 [member internal_size] 和 [member target_size] 不相等,则将使用所请求的缩" +"放模式进行放大/缩小。" + msgid "The requested screen space AA applied in post processing." msgstr "请求在后期处理中应用的屏幕空间抗锯齿。" @@ -99891,12 +111382,111 @@ msgstr "应用于 mipmap 的偏置。" msgid "The number of views we're rendering." msgstr "渲染的视图数。" +msgid "" +"This class allows for a RenderSceneBuffer implementation to be made in " +"GDExtension." +msgstr "该类允许在 GDExtension 中实现 RenderSceneBuffer。" + +msgid "Implement this in GDExtension to handle the (re)sizing of a viewport." +msgstr "在 GDExtension 中实现它来处理视口的(重新)大小调整。" + +msgid "Implement this in GDExtension to record a new FSR sharpness value." +msgstr "在 GDExtension 中实现该功能以记录新的 FSR 锐度值。" + +msgid "Implement this in GDExtension to change the texture mipmap bias." +msgstr "在 GDExtension 中实现该功能以更改纹理多级渐远纹理偏置。" + +msgid "Implement this in GDExtension to react to the debanding flag changing." +msgstr "在 GDExtension 中实现该功能以对去色带标志的更改做出反应。" + +msgid "" +"Abstract render scene buffer implementation for the RenderingDevice based " +"renderers." +msgstr "RenderingDevice 基于的渲染器的抽象渲染场景缓冲区实现。" + +msgid "" +"This object manages all 3D rendering buffers for the rendering device based " +"renderers. An instance of this object is created for every viewport that has " +"3D rendering enabled.\n" +"All buffers are organized in [b]contexts[/b]. The default context is called " +"[b]render_buffers[/b] and can contain amongst others the color buffer, depth " +"buffer, velocity buffers, VRS density map and MSAA variants of these " +"buffers.\n" +"Buffers are only guaranteed to exist during rendering of the viewport.\n" +"[b]Note:[/b] this is an internal rendering server object only exposed for " +"GDExtension plugins." +msgstr "" +"该对象管理基于渲染设备的渲染器的所有 3D 渲染缓冲区。为每个启用 3D 渲染的视口创" +"建该对象的实例。\n" +"所有缓冲区都被组织在[b]上下文[/b]中。默认上下文被称为 [b]render_buffers[/b]," +"可以包含颜色缓冲区、深度缓冲区、速度缓冲区、VRS 密度图和这些缓冲区的 MSAA 变体" +"等。\n" +"缓冲区仅保证在视口渲染期间存在。\n" +"[b]注意:[/b]这是一个仅为 GDExtension 插件公开的内部渲染服务器对象。" + msgid "Frees all buffers related to this context." msgstr "释放与这个上下文相关的所有缓冲。" +msgid "" +"Create a new texture with the given definition and cache this under the given " +"name. Will return the existing texture if it already exists." +msgstr "" +"使用给定的定义创建一个新纹理,并将其缓存在给定的名称下。如果已有纹理已经存在," +"则返回该已有纹理。" + +msgid "" +"Create a new texture using the given format and view and cache this under the " +"given name. Will return the existing texture if it already exists." +msgstr "" +"使用给定的格式创建一个新纹理,并在给定的名称下查看和缓存它。如果已有纹理已经存" +"在,则返回该已有纹理。" + +msgid "" +"Create a new texture view for an existing texture and cache this under the " +"given view_name. Will return the existing teture view if it already exists. " +"Will error if the source texture doesn't exist." +msgstr "" +"为已有纹理创建一个新的纹理视图,并将其缓存在给定的 view_name 下。如果已有的纹" +"理视图已经存在,则返回该视图。如果源纹理不存在,将会出错。" + +msgid "" +"Returns the specified layer from the color texture we are rendering 3D " +"content to." +msgstr "从渲染 3D 内容的颜色纹理返回指定的图层。" + +msgid "" +"Returns the color texture we are rendering 3D content to. If multiview is " +"used this will be a texture array with all views." +msgstr "" +"返回渲染 3D 内容的颜色纹理。如果使用多视图,这将是一个包含所有视图的纹理数组。" + +msgid "" +"Returns the specified layer from the depth texture we are rendering 3D " +"content to." +msgstr "从渲染 3D 内容的深度纹理返回指定的图层。" + +msgid "" +"Returns the depth texture we are rendering 3D content to. If multiview is " +"used this will be a texture array with all views." +msgstr "" +"返回渲染 3D 内容的深度纹理。如果使用多视图,这将是一个包含所有视图的纹理数组。" + +msgid "" +"Returns the internal size of the render buffer (size before upscaling) with " +"which textures are created by default." +msgstr "返回默认情况下创建纹理的渲染缓冲区的内部大小(放大之前的大小)。" + +msgid "Returns the render target associated with this buffers object." +msgstr "返回与该缓冲区对象关联的渲染目标。" + msgid "Returns a cached texture with this name." msgstr "返回具有该名称的缓存纹理。" +msgid "" +"Returns the texture format information with which a cached texture was " +"created." +msgstr "返回用于创建缓存纹理的纹理格式信息。" + msgid "Returns a specific slice (layer or mipmap) for a cached texture." msgstr "返回缓存纹理的指定切片(层或 mipmap)。" @@ -99910,6 +111500,17 @@ msgstr "返回缓存纹理的指定切片视图(层或 mipmap)。" msgid "Returns [code]true[/code] if TAA is enabled." msgstr "如果启用 TAA,则返回 [code]true[/code]。" +msgid "" +"Returns the specified layer from the velocity texture we are rendering 3D " +"content to." +msgstr "从渲染 3D 内容的速度纹理返回指定的图层。" + +msgid "" +"Returns the velocity texture we are rendering 3D content to. If multiview is " +"used this will be a texture array with all views." +msgstr "" +"返回渲染 3D 内容的速度纹理。如果使用多视图,这将是一个包含所有视图的纹理数组。" + msgid "Returns the view count for the associated viewport." msgstr "返回关联视口的视图数。" @@ -99945,14 +111546,38 @@ msgstr "" "[b]注意:[/b]在 C# 中,资源不再被使用后不会立即被释放。相反,垃圾回收将定期运" "行,并释放不再使用的资源。这意味着未使用的资源在被删除之前会停留一段时间。" -msgid "Resources" -msgstr "资源" - msgid "" "Override this method to return a custom [RID] when [method get_rid] is called." msgstr "可以覆盖此方法,从而在调用 [method get_rid] 时返回自定义 [RID]。" msgid "" +"Override this method to customize the newly duplicated resource created from " +"[method PackedScene.instantiate], if the original's [member " +"resource_local_to_scene] is set to [code]true[/code].\n" +"[b]Example:[/b] Set a random [code]damage[/code] value to every local " +"resource from an instantiated scene.\n" +"[codeblock]\n" +"extends Resource\n" +"\n" +"var damage = 0\n" +"\n" +"func _setup_local_to_scene():\n" +" damage = randi_range(10, 40)\n" +"[/codeblock]" +msgstr "" +"如果原始资源的 [member resource_local_to_scene] 被设置为 [code]true[/code],则" +"覆盖该方法以自定义从 [method PackedScene.instantiate] 创建的新复制的资源。\n" +"[b]示例:[/b]为实例化场景中的每个本地资源设置随机 [code]damage[/code] 值。\n" +"[codeblock]\n" +"extends Resource\n" +"\n" +"var damage = 0\n" +"\n" +"func _setup_local_to_scene():\n" +" damage = randi_range(10, 40)\n" +"[/codeblock]" + +msgid "" "Duplicates this resource, returning a new resource with its [code]export[/" "code]ed or [constant PROPERTY_USAGE_STORAGE] properties copied from the " "original.\n" @@ -99981,6 +111606,32 @@ msgstr "" "数,则此方法会失败。" msgid "" +"Emits the [signal changed] signal. This method is called automatically for " +"some built-in resources.\n" +"[b]Note:[/b] For custom resources, it's recommended to call this method " +"whenever a meaningful change occurs, such as a modified property. This " +"ensures that custom [Object]s depending on the resource are properly " +"updated.\n" +"[codeblock]\n" +"var damage:\n" +" set(new_value):\n" +" if damage != new_value:\n" +" damage = new_value\n" +" emit_changed()\n" +"[/codeblock]" +msgstr "" +"发出 [signal changed] 更改信号。某些内置资源会自动调用此方法。\n" +"[b]注意:[/b]对于自定义资源,推荐在发生任何有意义的变化时都调用此方法,例如修" +"改属性时。这样能够保证依赖于此资源的自定义 [Object] 能够正确更新其属性。\n" +"[codeblock]\n" +"var damage:\n" +" set(new_value):\n" +" if damage != new_value:\n" +" damage = new_value\n" +" emit_changed()\n" +"[/codeblock]" + +msgid "" "If [member resource_local_to_scene] is set to [code]true[/code] and the " "resource has been loaded from a [PackedScene] instantiation, returns the root " "[Node] of the scene where this resource is used. Otherwise, returns " @@ -100001,6 +111652,20 @@ msgstr "" "个函数将返回原始的 [RID]。" msgid "" +"Calls [method _setup_local_to_scene]. If [member resource_local_to_scene] is " +"set to [code]true[/code], this method is automatically called from [method " +"PackedScene.instantiate] by the newly duplicated resource within the scene " +"instance.\n" +"[i]Deprecated.[/i] This method should only be called internally. Override " +"[method _setup_local_to_scene] instead." +msgstr "" +"调用 [method _setup_local_to_scene]。如果 [member resource_local_to_scene] 被" +"设置为 [code]true[/code],则场景实例中新复制的资源会自动从 [method " +"PackedScene.instantiate] 中调用该方法。\n" +"[i]已弃用。[/i]该方法只能被内部调用。使用覆盖 [method _setup_local_to_scene] " +"代替。" + +msgid "" "Sets the [member resource_path] to [param path], potentially overriding an " "existing cache entry for this path. Further attempts to load an overridden " "resource by path will instead return this resource." @@ -100021,6 +111686,21 @@ msgstr "" "[b]注意:[/b]运行时,在已创建副本的资源上修改该属性不会有效果。" msgid "" +"An optional name for this resource. When defined, its value is displayed to " +"represent the resource in the Inspector dock. For built-in scripts, the name " +"is displayed as part of the tab name in the script editor.\n" +"[b]Note:[/b] Some resource formats do not support resource names. You can " +"still set the name in the editor or via code, but it will be lost when the " +"resource is reloaded. For example, only built-in scripts can have a resource " +"name, while scripts stored in separate files cannot." +msgstr "" +"这个资源的可选名称。定义后会在“检查器”面板中显示这个值来代表该资源。对于内置脚" +"本,该名称会在脚本编辑器中作为选项卡名称的一部分显示。\n" +"[b]注意:[/b]某些资源格式不支持资源名称。仍然可以在编辑器中或通过代码设置名" +"称,但重新加载资源时该名称将会丢失。例如,只有内置的脚本可以有资源名称,而存储" +"在单独文件中的脚本则不能。" + +msgid "" "The unique path to this resource. If it has been saved to disk, the value " "will be its filepath. If the resource is exclusively contained within a " "scene, the value will be the [PackedScene]'s filepath, followed by a unique " @@ -100046,6 +111726,17 @@ msgstr "" "[b]注意:[/b]自定义资源的属性不会自动发出此信号。如有必要,需要创建一个 " "setter 来触发。" +msgid "" +"Emitted by a newly duplicated resource with [member resource_local_to_scene] " +"set to [code]true[/code]. \n" +"[i]Deprecated.[/i] This signal is only emitted when the resource is created. " +"Override [method _setup_local_to_scene] instead." +msgstr "" +"由新复制的资源发出,并将 [member resource_local_to_scene] 设置为 [code]true[/" +"code]。\n" +"[i]已弃用。[/i]该信号仅在创建资源时发出。改为覆盖 [method " +"_setup_local_to_scene]。" + msgid "Loads a specific resource type from a file." msgstr "从文件中加载特定资源类型。" @@ -100247,19 +111938,264 @@ msgstr "" "导入器的导入顺序一般应低于[code]100[/code],以避免导入依赖自定义资源的场景时出" "现问题。" +msgid "Imports a [BitMap] resource (2D array of boolean values)." +msgstr "导入 [BitMap] 资源(布尔值的 2D 数组)。" + +msgid "" +"[BitMap] resources are typically used as click masks in [TextureButton] and " +"[TouchScreenButton]." +msgstr "" +"[BitMap] 资源通常被用作 [TextureButton] 和 [TouchScreenButton] 的点击遮罩。" + +msgid "" +"The data source to use for generating the bitmap.\n" +"[b]Black & White:[/b] Pixels whose HSV value is greater than the [member " +"threshold] will be considered as \"enabled\" (bit is [code]true[/code]). If " +"the pixel is lower than or equal to the threshold, it will be considered as " +"\"disabled\" (bit is [code]false[/code]).\n" +"[b]Alpha:[/b] Pixels whose alpha value is greater than the [member threshold] " +"will be considered as \"enabled\" (bit is [code]true[/code]). If the pixel is " +"lower than or equal to the threshold, it will be considered as " +"\"disabled\" (bit is [code]false[/code])." +msgstr "" +"用于生成位图的数据源。\n" +"[b]黑白:[/b]HSV 值大于 [member threshold] 的像素将被视为“启用”(位为 " +"[code]true[/code])。如果像素低于或等于阈值,则将被视为“禁用”(位为 " +"[code]false[/code])。\n" +"[b]Alpha:[/b]Alpha值大于 [member threshold] 的像素将被视为“启用”(位为 " +"[code]true[/code])。如果像素低于或等于阈值,则将被视为“禁用”(位为 " +"[code]false[/code])。" + +msgid "" +"The threshold to use to determine which bits should be considered enabled or " +"disabled. See also [member create_from]." +msgstr "用于确定哪些位应被视为启用或禁用的阈值。另见 [member create_from]。" + +msgid "Imports a bitmap font in the BMFont ([code].fnt[/code]) format." +msgstr "导入 BMFont([code].fnt[/code])格式的位图字体。" + +msgid "" +"The BMFont format is a format created by the [url=https://www.angelcode.com/" +"products/bmfont/]BMFont[/url] program. Many BMFont-compatible programs also " +"exist, like [url=https://www.bmglyph.com/]BMGlyph[/url].\n" +"Compared to [ResourceImporterImageFont], [ResourceImporterBMFont] supports " +"bitmap fonts with varying glyph widths/heights.\n" +"See also [ResourceImporterDynamicFont]." +msgstr "" +"BMFont 格式是由 [url=https://www.angelcode.com/products/bmfont/]BMFont[/url] " +"程序创建的格式。也存在许多与 BMFont 兼容的程序,例如 [url=https://www.bmglyph." +"com/]BMGlyph[/url]。\n" +"与 [ResourceImporterImageFont] 相比,[ResourceImporterBMFont] 能够支持不同字形" +"宽高的位图字体。\n" +"另见 [ResourceImporterDynamicFont]。" + msgid "Bitmap fonts - Using fonts" msgstr "位图字体——使用字体" +msgid "If [code]true[/code], uses lossless compression for the resulting font." +msgstr "如果为 [code]true[/code],则会对得到的字体使用无损压缩。" + +msgid "" +"List of font fallbacks to use if a glyph isn't found in this bitmap font. " +"Fonts at the beginning of the array are attempted first." +msgstr "" +"回退字体列表,在这个位图字体中未找到某个字形时使用。优先尝试靠前的字体。" + +msgid "Font scaling mode." +msgstr "字体缩放模式。" + msgid "Imports comma-separated values" msgstr "导入 CSV" +msgid "" +"Comma-separated values are a plain text table storage format. The format's " +"simplicity makes it easy to edit in any text editor or spreadsheet software. " +"This makes it a common choice for game localization.\n" +"[b]Example CSV file:[/b]\n" +"[codeblock]\n" +"keys,en,es,ja\n" +"GREET,\"Hello, friend!\",\"Hola, amigo!\",こんにちは\n" +"ASK,How are you?,Cómo está?,元気ですか\n" +"BYE,Goodbye,Adiós,さようなら\n" +"QUOTE,\"\"\"Hello\"\" said the man.\",\"\"\"Hola\"\" dijo el hombre.\",「こん" +"にちは」男は言いました\n" +"[/codeblock]" +msgstr "" +"逗号分隔值是纯文本表格存储格式。该格式的简单性使其可以轻松地在任何文本编辑器或" +"电子表格软件中进行编辑。这使其成为游戏本地化的常见选择。\n" +"[b]示例 CSV 文件:[/b]\n" +"[codeblock]\n" +"keys,en,es,ja\n" +"GREET,\"Hello, friend!\",\"Hola, amigo!\",こんにちは\n" +"ASK,How are you?,Cómo está?,元気ですか\n" +"BYE,Goodbye,Adiós,さようなら\n" +"QUOTE,\"\"\"Hello\"\" said the man.\",\"\"\"Hola\"\" dijo el hombre.\",「こん" +"にちは」男は言いました\n" +"[/codeblock]" + msgid "Importing translations" msgstr "导入翻译" +msgid "" +"If [code]true[/code], creates an [OptimizedTranslation] instead of a " +"[Translation]. This makes the resulting file smaller at the cost of a small " +"CPU overhead." +msgstr "" +"如果为 [code]true[/code],则会创建 [OptimizedTranslation] 而不是 " +"[Translation]。这样得到的文件会更小,但代价是 CPU 会消耗得稍多一些。" + +msgid "" +"The delimiter to use in the CSV file. The default value matches the common " +"CSV convention. Tab-separated values are sometimes called TSV files." +msgstr "" +"在 CSV 文件中使用的分隔符。该默认值符合常见的 CSV 约定。制表符分隔值有时被称" +"为 TSV 文件。" + +msgid "" +"Imports a TTF, TTC, OTF, OTC, WOFF or WOFF2 font file for font rendering that " +"adapts to any size." +msgstr "" +"导入 TTF、TTC、OTF、OTC、WOFF、WOFF2 字体文件,用于能够适配任何大小的字体渲" +"染。" + +msgid "" +"Unlike bitmap fonts, dynamic fonts can be resized to any size and still look " +"crisp. Dynamic fonts also optionally support MSDF font rendering, which " +"allows for run-time scale changes with no re-rasterization cost.\n" +"While WOFF and especially WOFF2 tend to result in smaller file sizes, there " +"is no universally \"better\" font format. In most situations, it's " +"recommended to use the font format that was shipped on the font developer's " +"website.\n" +"See also [ResourceImporterBMFont] and [ResourceImporterImageFont]." +msgstr "" +"与位图字体不同,动态字体可以被调整为任意大小,并且看起来仍然清晰。动态字体还可" +"以选择支持 MSDF 字体渲染,从而允许运行时缩放更改,且没有重新光栅化成本。\n" +"虽然 WOFF(尤其是 WOFF2)往往会产生较小的文件大小,但不存在普遍“更好”的字体格" +"式。在大多数情况下,建议使用字体开发人员网站上提供的字体格式。\n" +"另请参见 [ResourceImporterBMFont] 和 [ResourceImporterImageFont]。" + msgid "Dynamic fonts - Using fonts" msgstr "动态字体——使用字体" msgid "" +"If [code]true[/code], automatically use system fonts as a fallback if a glyph " +"isn't found in this dynamic font. This makes supporting CJK characters or " +"emoji more straightforward, as you don't need to include a CJK/emoji font in " +"your project. See also [member fallbacks].\n" +"[b]Note:[/b] The appearance of system fonts varies across platforms. Loading " +"system fonts is only supported on Windows, macOS, Linux, Android and iOS." +msgstr "" +"为 [code]true[/code] 时,如果在该动态字体中找不到字形,则自动使用系统字体作为" +"后备。这使得支持 CJK 字符或表情符号更加简单,因为你不需要在项目中包含 CJK/表情" +"符号字体。另请参阅 [member fallbacks]。\n" +"[b]注意:[/b]系统字体的外观因平台而异。仅 Windows、macOS、Linux、Android 和 " +"iOS 支持加载系统字体。" + +msgid "" +"The font antialiasing method to use.\n" +"[b]Disabled:[/b] Most suited for pixel art fonts, although you do not " +"[i]have[/i] to change the antialiasing from the default [b]Grayscale[/b] if " +"the font file was well-created and the font is used at an integer multiple of " +"its intended size. If pixel art fonts have a bad appearance at their intended " +"size, try setting [member subpixel_positioning] to [b]Disabled[/b] instead.\n" +"[b]Grayscale:[/b] Use grayscale antialiasing. This is the approach used by " +"the operating system on macOS, Android and iOS.\n" +"[b]LCD Subpixel:[/b] Use antialiasing with subpixel patterns to make fonts " +"sharper on LCD displays. This is the approach used by the operating system on " +"Windows and most Linux distributions. The downside is that this can introduce " +"\"fringing\" on edges, especially on display technologies that don't use " +"standard RGB subpixels (such as OLED displays). The LCD subpixel layout is " +"globally controlled by [member ProjectSettings.gui/theme/" +"lcd_subpixel_layout], which also allows falling back to grayscale " +"antialiasing." +msgstr "" +"要使用的字体抗锯齿方法。\n" +"[b]禁用:[/b]最适合像素艺术字体,如果字体文件创建良好并且字体以其预期大小的整" +"数倍使用,则你不[i]必[/i]更改默认的[b]灰度[/b]抗锯齿。如果像素艺术字体在其预期" +"大小下外观不佳,请尝试将 [member subpixel_positioning] 设置为 [b]Disabled[/" +"b]。\n" +"[b]灰度:[/b]使用灰度抗锯齿。这是 macOS、Android 和 iOS 上的操作系统使用的方" +"法。\n" +"[b]LCD 子像素:[/b]使用子像素模式的抗锯齿,使 LCD 显示器上的字体更加清晰。这" +"是 Windows 和大多数 Linux 发行版上的操作系统使用的方法。缺点是这可能会在边缘产" +"生“边缘”,尤其是在不使用标准 RGB 子像素的显示技术上(例如 OLED 显示器)。LCD " +"子像素布局由 [member ProjectSettings.gui/theme/lcd_subpixel_layout] 全局控制," +"这也允许回退到灰度抗锯齿。" + +msgid "" +"List of font fallbacks to use if a glyph isn't found in this dynamic font. " +"Fonts at the beginning of the array are attempted first, but fallback fonts " +"that don't support the glyph's language and script are attempted last (see " +"[member language_support] and [member script_support]). See also [member " +"allow_system_fallback]." +msgstr "" +"如果在该动态字体中找不到字形,则要使用的字体后备列表。首先尝试位于数组开头的字" +"体,最后尝试不支持字形语言和脚本的后备字体(请参阅 [member language_support] " +"和 [member script_support])。另请参阅 [member allow_system_fallback]。" + +msgid "" +"If [code]true[/code], forces generation of hinting data for the font using " +"[url=https://freetype.org/]FreeType[/url]'s autohinter. This will make " +"[member hinting] effective with fonts that don't include hinting data." +msgstr "" +"如果为 [code]true[/code],则使用 [url=https://freetype.org/]FreeType[/url] 的" +"自动提示器强制生成字体的提示数据。这将使 [member hinting] 对不包含提示数据的字" +"体有效。" + +msgid "" +"If [code]true[/code], this font will have mipmaps generated. This prevents " +"text from looking grainy when a [Control] is scaled down, or when a [Label3D] " +"is viewed from a long distance (if [member Label3D.texture_filter] is set to " +"a mode that displays mipmaps).\n" +"Enabling [member generate_mipmaps] increases font generation time and memory " +"usage. Only enable this setting if you actually need it." +msgstr "" +"如果为 [code]true[/code],则该字体将生成 mipmap。这样可以防止文本在 [Control] " +"被按比例缩小或从远距离查看 [Label3D] 时看起来有颗粒感(如果 [member Label3D." +"texture_filter] 被设置为显示 mipmap 的模式)。\n" +"启用 [member generate_mipmaps] 会增加字体生成时间和内存使用量。请只在你确实需" +"要时才启用此设置。" + +msgid "" +"The hinting mode to use. This controls how aggressively glyph edges should be " +"snapped to pixels when rasterizing the font. Depending on personal " +"preference, you may prefer using one hinting mode over the other. Hinting " +"modes other than [b]None[/b] are only effective if the font contains hinting " +"data (see [member force_autohinter]).\n" +"[b]None:[/b] Smoothest appearance, which can make the font look blurry at " +"small sizes.\n" +"[b]Light:[/b] Sharp result by snapping glyph edges to pixels on the Y axis " +"only.\n" +"[b]Full:[/b] Sharpest by snapping glyph edges to pixels on both X and Y axes." +msgstr "" +"要使用的提示模式。这控制在光栅化字体时应如何积极地将字形边缘吸附到像素。根据个" +"人喜好,你可能更喜欢使用一种提示模式而不是另一种。除 [b]None[/b] 之外的提示模" +"式仅在字体包含提示数据时才有效(请参阅 [member force_autohinter])。\n" +"[b]None:[/b]最平滑的外观,这会使字体在小尺寸下看起来模糊。\n" +"[b]Light:[/b]通过仅将字形边缘吸附到 Y 轴上的像素来获得清晰的结果。\n" +"[b]Full:[/b]通过将字形边缘吸附到 X 轴和 Y 轴上的像素获得最清晰的结果。" + +msgid "" +"Override the list of languages supported by this font. If left empty, this is " +"supplied by the font metadata. There is usually no need to change this. See " +"also [member script_support]." +msgstr "" +"覆盖该字体支持的语言列表。如果留空,则由字体元数据提供。通常无需更改该设置。另" +"见 [member script_support]。" + +msgid "" +"The width of the range around the shape between the minimum and maximum " +"representable signed distance. If using font outlines, [member " +"msdf_pixel_range] must be set to at least [i]twice[/i] the size of the " +"largest font outline. The default [member msdf_pixel_range] value of [code]8[/" +"code] allows outline sizes up to [code]4[/code] to look correct." +msgstr "" +"最小和最大可表示的有符号距离之间的形状周围的范围宽度。如果使用字体轮廓," +"[member msdf_pixel_range] 必须至少设置为最大字体轮廓大小的[i]两倍[/i]。" +"[member msdf_pixel_range] 的默认值为 [code]8[/code],允许大小最大到 [code]4[/" +"code] 的轮廓看起来正确。" + +msgid "" "Source font size used to generate MSDF textures. Higher values allow for more " "precision, but are slower to render and require more memory. Only increase " "this value if you notice a visible lack of precision in glyph rendering. Only " @@ -100305,12 +112241,994 @@ msgstr "" "体物理大小的前提下,使用比原计划更高或更低的分辨率渲染。大多数情况下应该保持" "为 [code]0.0[/code]。" +msgid "" +"The glyph ranges to prerender. This can avoid stuttering during gameplay when " +"new characters need to be rendered, especially if [member " +"subpixel_positioning] is enabled. The downside of using preloading is that " +"initial project load times will increase, as well as memory usage." +msgstr "" +"要预渲染的字形范围。这可以避免在游戏过程中需要渲染新角色时出现卡顿,特别是在启" +"用 [member subpixel_positioning] 的情况下。使用预加载的缺点是初始项目加载时间" +"会增加,内存使用量也会增加。" + +msgid "" +"Override the list of language scripts supported by this font. If left empty, " +"this is supplied by the font metadata. There is usually no need to change " +"this. See also [member language_support]." +msgstr "" +"覆盖该字体支持的语言脚本列表。如果留空,则由字体元数据提供。通常无需更改该设" +"置。另见 [member language_support]。" + +msgid "" +"Subpixel positioning improves font rendering appearance, especially at " +"smaller font sizes. The downside is that it takes more time to initially " +"render the font, which can cause stuttering during gameplay, especially if " +"used with large font sizes. This should be set to [b]Disabled[/b] for fonts " +"with a pixel art appearance.\n" +"[b]Disabled:[/b] No subpixel positioning. Lowest quality, fastest rendering.\n" +"[b]Auto:[/b] Use subpixel positioning at small font sizes (the chosen quality " +"varies depending on font size). Large fonts will not use subpixel " +"positioning. This is a good tradeoff between performance and quality.\n" +"[b]One Half of a Pixel:[/b] Always perform intermediate subpixel positioning " +"regardless of font size. High quality, slow rendering.\n" +"[b]One Quarter of a Pixel:[/b] Always perform precise subpixel positioning " +"regardless of font size. Highest quality, slowest rendering." +msgstr "" +"子像素定位可改善字体渲染外观,尤其是在较小的字体大小下。缺点是初始渲染字体需要" +"更多时间,这可能会导致游戏过程中出现卡顿,特别是在使用大字体时。对于具有像素艺" +"术外观的字体,应将其设置为[b]禁用[/b]。\n" +"[b]禁用:[/b]无子像素定位。质量最低,渲染最快。\n" +"[b]自动:[/b]在小字体大小下使用子像素定位(所选质量根据字体大小而变化)。大字" +"体不会使用子像素定位。这是性能和质量之间的良好权衡。\n" +"[b]半像素:[/b]无论字体大小如何,始终执行中间子像素定位。质量高,渲染速度" +"慢。\n" +"[b]四分之一像素:[/b]无论字体大小如何,始终执行精确的子像素定位。质量最高,渲" +"染最慢。" + +msgid "Imports a image for use in scripting, with no rendering capabilities." +msgstr "导入图像以用于脚本编写,但不具有渲染功能。" + +msgid "" +"This importer imports [Image] resources, as opposed to [CompressedTexture2D]. " +"If you need to render the image in 2D or 3D, use [ResourceImporterTexture] " +"instead." +msgstr "" +"该导入器导入 [Image] 资源,而不是 [CompressedTexture2D]。如果你需要以 2D 或 " +"3D 方式渲染图像,请改用 [ResourceImporterTexture]。" + +msgid "" +"Imports a fixed-width bitmap font where all glyphs have the same width and " +"height." +msgstr "导入等宽位图字体,所有字形使用的都是相同的宽高。" + +msgid "" +"This image-based workflow can be easier to use than [ResourceImporterBMFont], " +"but it requires all glyphs to have the same width and height. This makes " +"[ResourceImporterImageFont] most suited to fixed-width fonts.\n" +"See also [ResourceImporterDynamicFont]." +msgstr "" +"这种基于图像的工作流程比 [ResourceImporterBMFont] 更易于使用,但它要求所有字形" +"具有相同的宽度和高度。这使得 [ResourceImporterImageFont] 最适合固定宽度字" +"体。\n" +"另请参见 [ResourceImporterDynamicFont]。" + +msgid "" +"Margin applied around every imported glyph. If your font image contains " +"guides (in the form of lines between glyphs) or if spacing between characters " +"appears incorrect, try adjusting [member character_margin]." +msgstr "" +"在每个导入的字形周围应用边距。如果你的字体图像包含参考线(以字形之间的线的形" +"式)或者字符之间的间距看起来不正确,请尝试调整 [member character_margin]。" + +msgid "" +"The character ranges to import from the font image. This is an array that " +"maps each position on the image (in tile coordinates, not pixels). The font " +"atlas is traversed from left to right and top to bottom. Characters can be " +"specified with decimal numbers (127), hexadecimal numbers ([code]0x007f[/" +"code]) or between single quotes ([code]'~'[/code]). Ranges can be specified " +"with a hyphen between characters.\n" +"For instance, [code]0-127[/code] (or [code]0x0000-0x007f[/code]) denotes the " +"full ASCII range. As another example, [code]' '-'~'[/code] is equivalent to " +"[code]32-127[/code] and denotes the range of printable (visible) ASCII " +"characters.\n" +"Make sure [member character_ranges] doesn't exceed the number of [member " +"columns] * [member rows] defined. Otherwise, the font will fail to import." +msgstr "" +"从字体图像导入的字符范围。这是一个映射图像上每个位置的数组(以图块坐标,而不是" +"像素映射)。字体图集是从左到右、从上到下遍历的。可以使用十进制数字(127)、十" +"六进制数字([code]0x007f[/code])、或单引号之间([code]'~'[/code])指定字符。" +"可以使用字符之间的连字符指定范围。\n" +"例如,[code]0-127[/code](或 [code]0x0000-0x007f[/code])表示完整的 ASCII 范" +"围。再比如,[code]' '-'~'[/code] 等价于 [code]32-127[/code],表示可打印(可" +"见)ASCII 字符的范围。\n" +"确保 [member character_ranges] 不超过定义的 [member columns] * [member rows] " +"的数量。否则,该字体将无法导入。" + +msgid "Number of columns in the font image. See also [member rows]." +msgstr "字体图像中的列数。另见 [member rows]。" + +msgid "" +"Margin to cut on the sides of the entire image. This can be used to cut parts " +"of the image that contain attribution information or similar." +msgstr "" +"整个图像两侧的裁减边距。这可被用于裁减该图像包含属性信息或类似信息的部分。" + +msgid "Number of rows in the font image. See also [member columns]." +msgstr "字体图像中的行数。另见 [member columns]。" + +msgid "" +"Imports a 3-dimensional texture ([Texture3D]), a [Texture2DArray], a " +"[Cubemap] or a [CubemapArray]." +msgstr "" +"导入 3 维纹理([Texture3D])、[Texture2DArray]、[Cubemap] 或 [CubemapArray]。" + +msgid "" +"This imports a 3-dimensional texture, which can then be used in custom " +"shaders, as a [FogMaterial] density map or as a " +"[GPUParticlesAttractorVectorField3D]. See also [ResourceImporterTexture] and " +"[ResourceImporterTextureAtlas]." +msgstr "" +"这会导入一个三维纹理,然后可以在自定义着色器中将其用作 [FogMaterial] 密度图或 " +"[GPUParticlesAttractorVectorField3D]。另请参见 [ResourceImporterTexture] 和 " +"[ResourceImporterTextureAtlas]。" + +msgid "" +"Controls how color channels should be used in the imported texture.\n" +"[b]sRGB Friendly:[/b], prevents the RG color format from being used, as it " +"does not support sRGB color.\n" +"[b]Optimized:[/b], allows the RG color format to be used if the texture does " +"not use the blue channel. This reduces memory usage if the texture's blue " +"channel can be discarded (all pixels must have a blue value of [code]0[/" +"code]).\n" +"[b]Normal Map (RG Channels):[/b] This forces all layers from the texture to " +"be imported with the RG color format to reduce memory usage, with only the " +"red and green channels preserved. This only has an effect on textures with " +"the VRAM Compressed or Basis Universal compression modes. This mode is only " +"available in layered textures ([Cubemap], [CubemapArray], [Texture2DArray] " +"and [Texture3D])." +msgstr "" +"控制在导入的纹理中应如何使用颜色通道。\n" +"[b]sRGB 友好:[/b]阻止使用 RG 颜色格式,因为它不支持 sRGB 颜色。\n" +"[b]优化:[/b]如果纹理不使用蓝色通道,则允许使用 RG 颜色格式。如果可以丢弃纹理" +"的蓝色通道(所有像素的蓝色值必须为 [code]0[/code]),则可以减少内存使用量。\n" +"[b]法线贴图(RG 通道):[/b]这会强制使用 RG 颜色格式导入纹理中的所有图层,以减" +"少内存使用量,仅保留红色和绿色通道。这仅对具有 VRAM 压缩或 Basis Universal 压" +"缩模式的纹理有影响。该模式仅适用于分层纹理([Cubemap]、[CubemapArray]、" +"[Texture2DArray] 和 [Texture3D])。" + +msgid "" +"Controls how VRAM compression should be performed for HDR images.\n" +"[b]Disabled:[/b] Never use VRAM compression for HDR textures, regardless of " +"whether they're opaque or transparent. Instead, the texture is converted to " +"RGBE9995 (9-bits per channel + 5-bit exponent = 32 bits per pixel) to reduce " +"memory usage compared to a half-float or single-precision float image " +"format.\n" +"[b]Opaque Only:[/b] Only uses VRAM compression for opaque HDR textures. This " +"is due to a limitation of HDR formats, as there is no VRAM-compressed HDR " +"format that supports transparency at the same time.\n" +"[b]Always:[/b] Force VRAM compression even for HDR textures with an alpha " +"channel. To perform this, the alpha channel is discarded on import.\n" +"[b]Note:[/b] Only effective on Radiance HDR ([code].hdr[/code]) and OpenEXR " +"([code].exr[/code]) images." +msgstr "" +"控制如何对 HDR 图像执行 VRAM 压缩。\n" +"[b]禁用:[/b]永远不要对 HDR 纹理使用 VRAM 压缩,无论它们是否透明。相反,该纹理" +"会被转换为 RGBE9995(每通道 9 位 + 5 位指数 = 每像素 32 位),与半浮点或单精度" +"浮点图像格式相比,会减少内存使用量。\n" +"[b]仅不透明:[/b]仅对不透明 HDR 纹理使用 VRAM 压缩。这是由于 HDR 格式的限制," +"因为没有支持 VRAM 压缩且同时支持透明度的 HDR 格式。\n" +"[b]始终:[/b]强制 VRAM 压缩,即使对于具有 Alpha 通道的 HDR 纹理也是如此。为" +"此,在导入时将丢弃 Alpha 通道。\n" +"[b]注意:[/b]仅对 Radiance HDR([code].hdr[/code])和 OpenEXR([code].exr[/" +"code])图像有效。" + +msgid "" +"If [code]true[/code], uses BPTC compression on desktop platforms and ASTC " +"compression on mobile platforms. When using BPTC, BC7 is used for SDR " +"textures and BC6H is used for HDR textures.\n" +"If [code]false[/code], uses the faster but lower-quality S3TC compression on " +"desktop platforms and ETC2 on mobile/web platforms. When using S3TC, DXT1 " +"(BC1) is used for opaque textures and DXT5 (BC3) is used for transparent or " +"normal map (RGTC) textures.\n" +"BPTC and ASTC support VRAM compression for HDR textures, but S3TC and ETC2 do " +"not (see [member compress/hdr_compression])." +msgstr "" +"如果为 [code]true[/code],则在桌面平台上使用 BPTC 压缩,在移动平台上使用 ASTC " +"压缩。使用 BPTC 时,BC7 被用于 SDR 纹理,BC6H 被用于 HDR 纹理。\n" +"如果为 [code]false[/code],则在桌面平台上使用速度更快但质量较低的 S3TC 压缩," +"在移动/Web 平台上使用 ETC2。使用 S3TC 时,DXT1 (BC1) 被用于不透明纹理,DXT5 " +"(BC3) 被用于透明或法线贴图(RGTC)纹理。\n" +"BPTC 和 ASTC 支持 HDR 纹理的 VRAM 压缩,但 S3TC 和 ETC2 不支持(请参阅 " +"[member compress/hdr_compression])。" + +msgid "" +"The quality to use when using the [b]Lossy[/b] compression mode. Higher " +"values result in better quality, at the cost of larger file sizes. Lossy " +"quality does not affect memory usage of the imported texture, only its file " +"size on disk." +msgstr "" +"使用[b]有损[/b]压缩模式时使用的质量。值越高,质量越好,但文件大小越大。有损质" +"量不会影响导入纹理的内存使用情况,只会影响它在磁盘上的文件大小。" + +msgid "" +"The compression mode to use. Each compression mode provides a different " +"tradeoff:\n" +"[b]Lossless[/b]: Original quality, high memory usage, high size on disk, fast " +"import.\n" +"[b]Lossy:[/b] Reduced quality, high memory usage, low size on disk, fast " +"import.\n" +"[b]VRAM Compressed:[/b] Reduced quality, low memory usage, low size on disk, " +"slowest import. Only use for textures in 3D scenes, not for 2D elements.\n" +"[b]VRAM Uncompressed:[/b] Original quality, high memory usage, highest size " +"on disk, fastest import.\n" +"[b]Basis Universal:[/b] Reduced quality, low memory usage, lowest size on " +"disk, slow import. Only use for textures in 3D scenes, not for 2D elements.\n" +"See [url=$DOCS_URL/tutorials/assets_pipeline/importing_images.html#compress-" +"mode]Compress mode[/url] in the manual for more details." +msgstr "" +"要使用的压缩模式。每种压缩模式都提供不同的权衡:\n" +"[b]无损:[/b]原始质量、高内存占用、高磁盘占用、导入速度快。\n" +"[b]有损:[/b]质量降低、高内存占用、低磁盘占用、导入速度快。\n" +"[b]VRAM 压缩:[/b]质量降低、低内存占用、低磁盘占用、导入速度最慢。仅适用于 3D " +"场景中的纹理,不适用于 2D 元素。\n" +"[b]VRAM 未压缩:[/b]原始质量、高内存占用、最高磁盘占用、导入速度最快。\n" +"[b]Basis Universal:[/b]质量降低、低内存占用、最低磁盘占用、导入速度慢。仅适用" +"于 3D 场景中的纹理,不适用于 2D 元素。\n" +"有关更多详细信息,请参阅手册中的 [url=$DOCS_URL/tutorials/assets_pipeline/" +"importing_images.html#compress-mode]压缩模式[/url]。" + +msgid "" +"If [code]true[/code], smaller versions of the texture are generated on " +"import. For example, a 64×64 texture will generate 6 mipmaps (32×32, 16×16, " +"8×8, 4×4, 2×2, 1×1). This has several benefits:\n" +"- Textures will not become grainy in the distance (in 3D), or if scaled down " +"due to [Camera2D] zoom or [CanvasItem] scale (in 2D).\n" +"- Performance will improve if the texture is displayed in the distance, since " +"sampling smaller versions of the original texture is faster and requires less " +"memory bandwidth.\n" +"The downside of mipmaps is that they increase memory usage by roughly 33% " +"(for [Texture2DArray], [Cubemap] and [CubemapArray]) or 14% (for " +"[Texture3D]).\n" +"It's recommended to enable mipmaps in 3D. However, in 2D, this should only be " +"enabled if your project visibly benefits from having mipmaps enabled. If the " +"camera never zooms out significantly, there won't be a benefit to enabling " +"mipmaps but memory usage will increase." +msgstr "" +"如果为 [code]true[/code],则在导入时生成较小版本的纹理。例如,64×64 纹理将生" +"成 6 个多级渐远纹理(32×32、16×16、8×8、4×4、2×2、1×1)。这样做有几个好处:\n" +"- 纹理在远处(3D 中)或由于 [Camera2D] 缩放或 [CanvasItem] 缩放(2D 中)而缩小" +"时不会变得具有颗粒感。\n" +"- 如果纹理显示在远处,性能将会提高,因为对原始纹理的较小版本进行采样速度更快并" +"且需要更少的内存带宽。\n" +"多级渐远纹理的缺点是它们使内存占用增加大约 33%(对于 [Texture2DArray]、" +"[Cubemap] 和 [CubemapArray])或 14%(对于 [Texture3D])。\n" +"建议在 3D 中启用多级渐远纹理。但是,在 2D 中,仅当你的项目明显受益于启用多级渐" +"远纹理 时才应启用该功能。如果相机从不大幅缩小,启用多级渐远纹理不会有任何好" +"处,但内存占用会增加。" + +msgid "Unimplemented. This currently has no effect when changed." +msgstr "未实现。目前,更改后没有效果。" + +msgid "" +"Controls how the cubemap's texture is internally laid out. When using high-" +"resolution cubemaps, [b]2×3[/b] and [b]3×2[/b] are less prone to exceeding " +"hardware texture size limits compared to [b]1×6[/b] and [b]6×1[/b]." +msgstr "" +"控制立方体贴图纹理的内部布局方式。使用高分辨率立方体贴图时,与 [b]1×6[/b] 和 " +"[b]6×1[/b] 相比,[b]2×3[/b] and [b]3×2[/b] 不太容易超出硬件纹理大小限制。" + +msgid "Imports a MP3 audio file for playback." +msgstr "导入 MP3 音频文件进行播放。" + +msgid "" +"MP3 is a lossy audio format, with worse audio quality compared to " +"[ResourceImporterOggVorbis] at a given bitrate.\n" +"In most cases, it's recommended to use Ogg Vorbis over MP3. However, if " +"you're using a MP3 sound source with no higher quality source available, then " +"it's recommended to use the MP3 file directly to avoid double lossy " +"compression.\n" +"MP3 requires more CPU to decode than [ResourceImporterWAV]. If you need to " +"play a lot of simultaneous sounds, it's recommended to use WAV for those " +"sounds instead, especially if targeting low-end devices." +msgstr "" +"MP3 是一种有损音频格式,在给定比特率下,与 [ResourceImporterOggVorbis] 相比," +"音频质量较差。\n" +"在大多数情况下,建议使用 Ogg Vorbis 而不是 MP3。但是,如果你使用的 MP3 音源没" +"有更高质量的可用源,则建议直接使用 MP3 文件以避免两次有损压缩。\n" +"MP3 比 [ResourceImporterWAV] 需要更多的 CPU 来解码。如果你需要同时播放很多声" +"音,建议对这些声音使用 WAV,特别是针对低端设备。" + msgid "Importing audio samples" msgstr "导入音频样本" +msgid "" +"The number of bars within a single beat in the audio track. This is only " +"relevant for music that wishes to make use of interactive music functionality " +"(not implemented yet), not sound effects.\n" +"A more convenient editor for [member bar_beats] is provided in the " +"[b]Advanced Import Settings[/b] dialog, as it lets you preview your changes " +"without having to reimport the audio." +msgstr "" +"音轨中单个节拍内的小节数。这仅与希望利用交互式音乐功能(尚未实现)的音乐相关," +"与声音效果无关。\n" +"[b]高级导入设置[/b]对话框中为 [member bar_beats] 提供了更方便的编辑器,因为它" +"可以让你预览更改,且无需重新导入音频。" + +msgid "" +"The beat count of the audio track. This is only relevant for music that " +"wishes to make use of interactive music functionality (not implemented yet), " +"not sound effects.\n" +"A more convenient editor for [member beat_count] is provided in the " +"[b]Advanced Import Settings[/b] dialog, as it lets you preview your changes " +"without having to reimport the audio." +msgstr "" +"该音轨的节拍数。这仅与希望利用交互式音乐功能(尚未实现)的音乐相关,与声音效果" +"无关。\n" +"[b]高级导入设置[/b]对话框中为 [member beat_count] 提供了更方便的编辑器,因为它" +"可以让你预览更改,且无需重新导入音频。" + +msgid "" +"The Beats Per Minute of the audio track. This should match the BPM measure " +"that was used to compose the track. This is only relevant for music that " +"wishes to make use of interactive music functionality (not implemented yet), " +"not sound effects.\n" +"A more convenient editor for [member bpm] is provided in the [b]Advanced " +"Import Settings[/b] dialog, as it lets you preview your changes without " +"having to reimport the audio." +msgstr "" +"音轨的每分钟节拍数。这应该与用于创作曲目的 BPM 测量相匹配。这仅与希望利用交互" +"式音乐功能(尚未实现)的音乐相关,与声音效果无关。\n" +"[b]高级导入设置[/b]对话框中为 [member bpm] 提供了更方便的编辑器,因为它可以让" +"你预览更改,且无需重新导入音频。" + +msgid "" +"If enabled, the audio will begin playing at the beginning after playback ends " +"by reaching the end of the audio.\n" +"[b]Note:[/b] In [AudioStreamPlayer], the [signal AudioStreamPlayer.finished] " +"signal won't be emitted for looping audio when it reaches the end of the " +"audio file, as the audio will keep playing indefinitely." +msgstr "" +"如果启用,音频将在播放因到达音频末尾而结束后从头开始播放。\n" +"[b]注意:[/b]在 [AudioStreamPlayer] 中,当循环音频到达音频文件末尾时,不会发" +"出 [signal AudioStreamPlayer.finished] 信号,因为音频将无限期地继续播放。" + +msgid "" +"Determines where audio will start to loop after playback reaches the end of " +"the audio. This can be used to only loop a part of the audio file, which is " +"useful for some ambient sounds or music. The value is determined in seconds " +"relative to the beginning of the audio. A value of [code]0.0[/code] will loop " +"the entire audio file.\n" +"Only has an effect if [member loop] is [code]true[/code].\n" +"A more convenient editor for [member loop_offset] is provided in the " +"[b]Advanced Import Settings[/b] dialog, as it lets you preview your changes " +"without having to reimport the audio." +msgstr "" +"确定播放到达音频结尾后音频将开始循环的位置。这可用于仅循环音频文件的一部分,这" +"对于某些环境音或音乐很有用。该值以相对于音频开头的秒数确定。值为 [code]0.0[/" +"code] 将循环整个音频文件。\n" +"仅当 [member loop] 为 [code]true[/code] 时才有效。\n" +"[b]高级导入设置[/b]对话框中为 [member loop_offset] 提供了更方便的编辑器,因为" +"它可以让你预览更改,且无需重新导入音频。" + +msgid "Imports an OBJ 3D model as a standalone [Mesh] or scene." +msgstr "将 OBJ 3D 模型导入为独立 [Mesh] 或场景。" + +msgid "" +"Unlike [ResourceImporterScene], [ResourceImporterOBJ] will import a single " +"[Mesh] resource by default instead of importing a [PackedScene]. This makes " +"it easier to use the [Mesh] resource in nodes that expect direct [Mesh] " +"resources, such as [GridMap], [GPUParticles3D] or [CPUParticles3D]. Note that " +"it is still possible to save mesh resources from 3D scenes using the " +"[b]Advanced Import Settings[/b] dialog, regardless of the source format.\n" +"See also [ResourceImporterScene], which is used for more advanced 3D formats " +"such as glTF." +msgstr "" +"与 [ResourceImporterScene] 不同,[ResourceImporterOBJ] 默认情况下会导入单个 " +"[Mesh] 资源,而不是导入一个 [PackedScene]。这使得在需要直接 [Mesh] 资源的节点" +"(例如 [GridMap]、[GPUParticles3D] 或 [CPUParticles3D])中使用 [Mesh] 资源变得" +"更加容易。请注意,无论源格式如何,仍然可以使用[b]高级导入设置[/b]对话框保存 " +"3D 场景中的网格资源。\n" +"另请参见 [ResourceImporterScene],它被用于更高级的 3D 格式,例如 glTF。" + msgid "Importing 3D scenes" msgstr "导入 3D 场景" +msgid "" +"If [code]true[/code], mesh compression will not be used. Consider enabling if " +"you notice blocky artifacts in your mesh normals or UVs, or if you have " +"meshes that are larger than a few thousand meters in each direction." +msgstr "" +"如果为 [code]true[/code],则不会使用网格压缩。如果你在网格法线或 UV 中发现块状" +"伪影,或者如果你的网格在每个方向都大于几千米,请考虑启用。" + +msgid "" +"If [code]true[/code], generate vertex tangents using [url=http://www." +"mikktspace.com/]Mikktspace[/url] if the source mesh doesn't have tangent " +"data. When possible, it's recommended to let the 3D modeling software " +"generate tangents on export instead on relying on this option. Tangents are " +"required for correct display of normal and height maps, along with any " +"material/shader features that require tangents.\n" +"If you don't need material features that require tangents, disabling this can " +"reduce output file size and speed up importing if the source 3D file doesn't " +"contain tangents." +msgstr "" +"如果为 [code]true[/code],如果源网格没有切线数据,则使用 [url=http://www." +"mikktspace.com/]Mikktspace[/url] 生成顶点切线。如果可能,建议让 3D 建模软件在" +"导出时生成切线,而不是依赖该选项。正确显示法线和高度贴图,以及任何需要切线的材" +"质/着色器功能都需要切线。\n" +"如果你不需要那些需要切线的材质特性,则禁用该功能可以减少输出文件大小,并在源 " +"3D 文件不包含切线的情况下加快导入速度。" + +msgid "" +"Offsets the mesh's data by the specified value. This can be used to work " +"around misaligned meshes without having to modify the source file." +msgstr "将网格数据偏移指定值。这可被用于解决未对齐的网格,而无需修改源文件。" + +msgid "Unused parameter. This currently has no effect." +msgstr "未使用的参数。这目前没有效果。" + +msgid "" +"Scales the mesh's data by the specified value. This can be used to work " +"around misscaled meshes without having to modify the source file." +msgstr "按指定值缩放网格数据。这可被用于解决缩放错误的网格,而无需修改源文件。" + +msgid "Imports an Ogg Vorbis audio file for playback." +msgstr "导入 Ogg Vorbis 音频文件进行播放。" + +msgid "" +"Ogg Vorbis is a lossy audio format, with better audio quality compared to " +"[ResourceImporterMP3] at a given bitrate.\n" +"In most cases, it's recommended to use Ogg Vorbis over MP3. However, if " +"you're using a MP3 sound source with no higher quality source available, then " +"it's recommended to use the MP3 file directly to avoid double lossy " +"compression.\n" +"Ogg Vorbis requires more CPU to decode than [ResourceImporterWAV]. If you " +"need to play a lot of simultaneous sounds, it's recommended to use WAV for " +"those sounds instead, especially if targeting low-end devices." +msgstr "" +"Ogg Vorbis 是一种有损音频格式,在给定比特率下,与 [ResourceImporterMP3] 相比具" +"有更好的音频质量。\n" +"在大多数情况下,建议使用 Ogg Vorbis 而不是 MP3。但是,如果你使用的 MP3 音源没" +"有更高质量的可用音源,则建议直接使用 MP3 文件以避免两次有损压缩。\n" +"Ogg Vorbis 比 [ResourceImporterWAV] 需要更多的 CPU 来解码。如果你需要同时播放" +"很多声音,建议对这些声音使用 WAV,特别是针对低端设备。" + +msgid "" +"This method loads audio data from a PackedByteArray buffer into an " +"AudioStreamOggVorbis object." +msgstr "" +"该方法将音频数据从 PackedByteArray 缓冲区加载到 AudioStreamOggVorbis 对象中。" + +msgid "" +"This method loads audio data from a file into an AudioStreamOggVorbis object. " +"The file path is provided as a string." +msgstr "" +"该方法将音频数据从文件加载到 AudioStreamOggVorbis 对象中。文件路径以字符串形式" +"提供。" + +msgid "Imports a glTF, FBX, Collada or Blender 3D scene." +msgstr "导入 glTF、FBX、Collada 或 Blender 3D 场景。" + +msgid "" +"See also [ResourceImporterOBJ], which is used for OBJ models that can be " +"imported as a standalone [Mesh] or a scene.\n" +"Additional options (such as extracting individual meshes or materials to " +"files) are available in the [b]Advanced Import Settings[/b] dialog. This " +"dialog can be accessed by double-clicking a 3D scene in the FileSystem dock " +"or by selecting a 3D scene in the FileSystem dock, going to the Import dock " +"and choosing [b]Advanced[/b].\n" +"[b]Note:[/b] [ResourceImporterScene] is [i]not[/i] used for [PackedScene]s, " +"such as [code].tscn[/code] and [code].scn[/code] files." +msgstr "" +"另请参见 [ResourceImporterOBJ],它被用于可作为独立 [Mesh] 或场景导入的 OBJ 模" +"型。\n" +"[b]高级导入设置[/b] 对话框中提供了其他选项(例如将单个网格或材质提取到文件)。" +"可以通过双击文件系统停靠面板中的 3D 场景或通过选择文件系统停靠面板中的 3D 场" +"景,转至导入停靠面板并选择[b]高级[/b]来访问该对话框。\n" +"[b]注意:[/b][ResourceImporterScene] [i]未[/i]被用于 [PackedScene],例如 " +"[code].tscn[/code] 和 [code].scn[/code] 文件 。" + +msgid "" +"Contains properties for the scene's subresources. This is an internal option " +"which is not visible in the Import dock." +msgstr "包含场景子资源的属性。这是一个内部选项,在导入停靠面板中不可见。" + +msgid "" +"The number of frames per second to use for baking animation curves to a " +"series of points with linear interpolation. It's recommended to configure " +"this value to match the value you're using as a baseline in your 3D modeling " +"software. Higher values result in more precise animation with fast movement " +"changes, at the cost of higher file sizes and memory usage. Thanks to " +"interpolation, there is usually not much benefit in going above 30 FPS (as " +"the animation will still appear smooth at higher rendering framerates)." +msgstr "" +"用于通过线性插值将动画曲线烘焙为一系列点的每秒帧数。建议配置该值以匹配你在 3D " +"建模软件中用作基线的值。较高的值会导致更精确的快速运动变化的动画,但代价是文件" +"大小和内存占用更大。由于插值,超过 30 FPS 通常不会有太大好处(因为动画在更高的" +"渲染帧速率下仍然会显得平滑)。" + +msgid "If [code]true[/code], import animations from the 3D scene." +msgstr "如果为 [code]true[/code],则从 3D 场景导入动画。" + +msgid "" +"If [code]true[/code], remove animation tracks that only contain default " +"values. This can reduce output file size and memory usage with certain 3D " +"scenes, depending on the contents of their animation tracks." +msgstr "" +"如果为 [code]true[/code],则移除仅包含默认值的动画轨道。这可以减少某些 3D 场景" +"的输出文件大小和内存占用,具体取决于其动画轨道的内容。" + +msgid "" +"If [code]true[/code], trim the beginning and end of animations if there are " +"no keyframe changes. This can reduce output file size and memory usage with " +"certain 3D scenes, depending on the contents of their animation tracks." +msgstr "" +"如果为 [code]true[/code],如果没有关键帧更改,则修剪动画的开头和结尾。这可以减" +"少某些 3D 场景的输出文件大小和内存占用,具体取决于其动画轨道的内容。" + +msgid "" +"Path to an import script, which can run code after the import process has " +"completed for custom processing. See [url=$DOCS_URL/tutorials/assets_pipeline/" +"importing_3d_scenes/import_configuration.html#using-import-scripts-for-" +"automation]Using import scripts for automation[/url] for more information." +msgstr "" +"导入脚本的路径,该脚本可以在导入过程完成后运行代码以进行自定义处理。有关详细信" +"息,请参阅 [url=$DOCS_URL/tutorials/assets_pipeline/importing_3d_scenes/" +"import_configuration.html#using-import-scripts-for-automation]使用导入脚本进行" +"自动化[/url]。" + +msgid "" +"If [code]true[/code], enables the generation of shadow meshes on import. This " +"optimizes shadow rendering without reducing quality by welding vertices " +"together when possible. This in turn reduces the memory bandwidth required to " +"render shadows. Shadow mesh generation currently doesn't support using a " +"lower detail level than the source mesh (but shadow rendering will make use " +"of LODs when relevant)." +msgstr "" +"如果为 [code]true[/code],则在导入时启用阴影网格体的生成。这可以通过在可能的情" +"况下将顶点焊接在一起来优化阴影渲染,且不会降低质量。这反过来又减少了渲染阴影所" +"需的内存带宽。阴影网格生成当前不支持使用比源网格更低的细节级别(但阴影渲染将在" +"相关时使用 LOD)。" + +msgid "" +"If [code]true[/code], generate vertex tangents using [url=http://www." +"mikktspace.com/]Mikktspace[/url] if the input meshes don't have tangent data. " +"When possible, it's recommended to let the 3D modeling software generate " +"tangents on export instead on relying on this option. Tangents are required " +"for correct display of normal and height maps, along with any material/shader " +"features that require tangents.\n" +"If you don't need material features that require tangents, disabling this can " +"reduce output file size and speed up importing if the source 3D file doesn't " +"contain tangents." +msgstr "" +"如果为 [code]true[/code],如果输入网格没有切线数据,则使用 [url=http://www." +"mikktspace.com/]Mikktspace[/url] 生成顶点切线。如果可能,建议让 3D 建模软件在" +"导出时生成切线,而不是依赖于该选项。正确显示法线和高度贴图,以及任何需要切线的" +"材质/着色器功能都需要切线。\n" +"如果你不需要那些需要切线的材质特性,则禁用该功能可以减少输出文件大小,并在源 " +"3D 文件不包含切线的情况下加快导入速度。" + +msgid "" +"If [code]true[/code], generates lower detail variants of the mesh which will " +"be displayed in the distance to improve rendering performance. Not all meshes " +"benefit from LOD, especially if they are never rendered from far away. " +"Disabling this can reduce output file size and speed up importing. See " +"[url=$DOCS_URL/tutorials/3d/mesh_lod.html#doc-mesh-lod]Mesh level of detail " +"(LOD)[/url] for more information." +msgstr "" +"如果为 [code]true[/code],则生成网格的较低细节变体,这些变体将显示在远处以提高" +"渲染性能。并非所有网格体都受益于 LOD,特别是如果它们从未从远处渲染。禁用该功能" +"可以减少输出文件大小并加快导入速度。有关详细信息,请参阅 [url=$DOCS_URL/" +"tutorials/3d/mesh_lod.html#doc-mesh-lod]网格细节级别(LOD)[/url]。" + +msgid "" +"Configures the meshes' [member GeometryInstance3D.gi_mode] in the 3D scene. " +"If set to [b]Static Lightmaps[/b], sets the meshes' GI mode to Static and " +"generates UV2 on import for [LightmapGI] baking." +msgstr "" +"在 3D 场景中配置网格体的 [member GeometryInstance3D.gi_mode]。如果被设置为[b]" +"静态光照贴图[/b],则将网格体的 GI 模式设置为静态并在导入时生成 UV2 以进行 " +"[LightmapGI] 烘焙。" + +msgid "" +"Controls the size of each texel on the baked lightmap. A smaller value " +"results in more precise lightmaps, at the cost of larger lightmap sizes and " +"longer bake times.\n" +"[b]Note:[/b] Only effective if [member meshes/light_baking] is set to " +"[b]Static Lightmaps[/b]." +msgstr "" +"控制烘焙光照贴图上每个纹素的大小。较小的值会产生更精确的光照贴图,但代价是更大" +"的光照贴图大小和更长的烘焙时间。\n" +"[b]注意:[/b]仅当 [member meshes/light_baking] 被设置为[b]静态光照贴图[/b]时有" +"效。" + +msgid "" +"If [code]true[/code], [member nodes/root_scale] will be applied to the " +"descendant nodes, meshes, animations, bones, etc. This means that if you add " +"a child node later on within the imported scene, it won't be scaled. If " +"[code]false[/code], [member nodes/root_scale] will multiply the scale of the " +"root node instead." +msgstr "" +"如果为 [code]true[/code],[member nodes/root_scale] 将被应用于后代节点、网格、" +"动画、骨骼等。这意味着,如果你稍后在导入的场景中添加子节点,它将不会被缩放。如" +"果为 [code]false[/code],[member nodes/root_scale] 将乘以该根节点的缩放。" + +msgid "" +"Override for the root node name. If empty, the root node will use what the " +"scene specifies, or the file name if the scene does not specify a root name." +msgstr "" +"覆盖根节点名称。如果为空,则根节点将使用场景指定的内容;如果场景未指定根名称," +"则根节点将使用该文件名。" + +msgid "" +"The uniform scale to use for the scene root. The default value of [code]1.0[/" +"code] will not perform any rescaling. See [member nodes/apply_root_scale] for " +"details of how this scale is applied." +msgstr "" +"用于场景根的统一缩放。默认值 [code]1.0[/code] 不会执行任何重新缩放。有关如何应" +"用该缩放的详细信息,请参阅 [member nodes/apply_root_scale]。" + +msgid "" +"Override for the root node type. If empty, the root node will use what the " +"scene specifies, or [Node3D] if the scene does not specify a root type. Using " +"a node type that inherits from [Node3D] is recommended. Otherwise, you'll " +"lose the ability to position the node directly in the 3D editor." +msgstr "" +"覆盖该根节点类型。如果为空,则根节点将使用场景指定的内容,如果场景未指定根类" +"型,则根节点将使用 [Node3D]。建议使用继承自 [Node3D] 的节点类型。否则,你将无" +"法直接在 3D 编辑器中定位节点。" + +msgid "" +"If checked, use named [Skin]s for animation. The [MeshInstance3D] node " +"contains 3 properties of relevance here: a skeleton [NodePath] pointing to " +"the [Skeleton3D] node (usually [code]..[/code]), a mesh, and a skin:\n" +"- The [Skeleton3D] node contains a list of bones with names, their pose and " +"rest, a name and a parent bone.\n" +"- The mesh is all of the raw vertex data needed to display a mesh. In terms " +"of the mesh, it knows how vertices are weight-painted and uses some internal " +"numbering often imported from 3D modeling software.\n" +"- The skin contains the information necessary to bind this mesh onto this " +"Skeleton3D. For every one of the internal bone IDs chosen by the 3D modeling " +"software, it contains two things. Firstly, a matrix known as the Bind Pose " +"Matrix, Inverse Bind Matrix, or IBM for short. Secondly, the [Skin] contains " +"each bone's name (if [member skins/use_named_skins] is [code]true[/code]), or " +"the bone's index within the [Skeleton3D] list (if [member skins/" +"use_named_skins] is [code]false[/code]).\n" +"Together, this information is enough to tell Godot how to use the bone poses " +"in the [Skeleton3D] node to render the mesh from each [MeshInstance3D]. Note " +"that each [MeshInstance3D] may share binds, as is common in models exported " +"from Blender, or each [MeshInstance3D] may use a separate [Skin] object, as " +"is common in models exported from other tools such as Maya." +msgstr "" +"如果勾选,则为动画使用命名的 [Skin]。[MeshInstance3D] 节点包含 3 个相关属性:" +"指向 [Skeleton3D] 节点的骨架 [NodePath](通常为 [code]..[/code])、网格、和皮" +"肤:\n" +"- [Skeleton3D] 节点包含骨骼列表,其中包含名称、姿势和休息、名称和父骨骼。\n" +"- 网格是显示网格所需的所有原始顶点数据。就网格而言,它知道如何对顶点进行权重绘" +"制,并使用通常从 3D 建模软件导入的某些内部编号。\n" +"- 皮肤包含将该网格绑定到该 Skeleton3D 上所必需的信息。对于 3D 建模软件选择的每" +"一个内部骨骼 ID,它都包含两件事。首先是一个名为绑定姿势矩阵、逆绑定矩阵、或简" +"称为 IBM 的矩阵。其次,该 [Skin] 包含每个骨骼的名称(如果 [member skins/" +"use_named_skins] 为 [code]true[/code]),或者骨骼在 [Skeleton3D] 列表中的索引" +"(如果 [member skins/use_named_skins] 为 [code]false[/code])。\n" +"总之,这些信息足以告诉 Godot 如何使用 [Skeleton3D] 节点中的骨骼姿势来渲染每个 " +"[MeshInstance3D] 的网格。请注意,每个 [MeshInstance3D] 可以共享绑定,这在从 " +"Blender 导出的模型中很常见;或者每个 [MeshInstance3D] 可以使用单独的 [Skin] 对" +"象,这在从其他工具(例如 Maya)导出的模型中很常见。" + +msgid "Imports native GLSL shaders (not Godot shaders) as a [RDShaderFile]." +msgstr "将原生 GLSL 着色器(不是 Godot 着色器)导入为 [RDShaderFile]。" + +msgid "" +"This imports native GLSL shaders as [RDShaderFile] resources, for use with " +"low-level [RenderingDevice] operations. This importer does [i]not[/i] handle " +"[code].gdshader[/code] files." +msgstr "" +"这会将原生 GLSL 着色器导入为 [RDShaderFile] 资源,以与低级 [RenderingDevice] " +"操作一起使用。该导入器[i]不[/i]处理 [code].gdshader[/code] 文件。" + +msgid "Imports an image for use in 2D or 3D rendering." +msgstr "导入图像以用于 2D 或 3D 渲染。" + +msgid "" +"This importer imports [CompressedTexture2D] resources. If you need to process " +"the image in scripts in a more convenient way, use [ResourceImporterImage] " +"instead. See also [ResourceImporterLayeredTexture]." +msgstr "" +"该导入器导入 [CompressedTexture2D] 资源。如果你需要以更方便的方式处理脚本中的" +"图像,请改用 [ResourceImporterImage]。另见 [ResourceImporterLayeredTexture]。" + +msgid "" +"Controls how color channels should be used in the imported texture.\n" +"[b]sRGB Friendly:[/b] Prevents the RG color format from being used, as it " +"does not support sRGB color.\n" +"[b]Optimized:[/b] Allows the RG color format to be used if the texture does " +"not use the blue channel. This reduces memory usage if the texture's blue " +"channel can be discarded (all pixels must have a blue value of [code]0[/" +"code])." +msgstr "" +"控制在导入的纹理中应如何使用颜色通道。\n" +"[b]sRGB 友好:[/b]阻止使用 RG 颜色格式,因为它不支持 sRGB 颜色。\n" +"[b]优化:[/b]如果纹理不使用蓝色通道,则允许使用 RG 颜色格式。如果可以丢弃纹理" +"的蓝色通道(所有像素的蓝色值必须为 [code]0[/code]),则可以减少内存占用。" + +msgid "" +"When using a texture as normal map, only the red and green channels are " +"required. Given regular texture compression algorithms produce artifacts that " +"don't look that nice in normal maps, the RGTC compression format is the best " +"fit for this data. Forcing this option to Enable will make Godot import the " +"image as RGTC compressed. By default, it's set to Detect. This means that if " +"the texture is ever detected to be used as a normal map, it will be changed " +"to Enable and reimported automatically.\n" +"Note that RGTC compression affects the resulting normal map image. You will " +"have to adjust custom shaders that use the normal map's blue channel to take " +"this into account. Built-in material shaders already ignore the blue channel " +"in a normal map (regardless of the actual normal map's contents)." +msgstr "" +"当使用纹理作为法线贴图时,仅需要红色和绿色通道。鉴于常规纹理压缩算法会产生在法" +"线贴图中看起来不太好的伪像,因此 RGTC 压缩格式最适合该数据。 强制该选项启用将" +"使 Godot 以 RGTC 压缩形式导入图像。默认情况下,它被设置为“检测”。这意味着,如" +"果纹理被检测到用作法线贴图,它将被更改为“启用”并自动重新导入。\n" +"请注意,RGTC 压缩会影响生成的法线贴图图像。你必须调整使用法线贴图的蓝色通道的" +"自定义着色器才能考虑到这一点。内置材质着色器已经忽略法线贴图中的蓝色通道(无论" +"实际法线贴图的内容如何)。" + +msgid "" +"This changes the [member compress/mode] option that is used when a texture is " +"detected as being used in 3D.\n" +"Changing this import option only has an effect if a texture is detected as " +"being used in 3D. Changing this to [b]Disabled[/b] then reimporting will not " +"change the existing compress mode on a texture (if it's detected to be used " +"in 3D), but choosing [b]VRAM Compressed[/b] or [b]Basis Universal[/b] will." +msgstr "" +"这会更改检测到纹理在 3D 中使用时使用的 [member compress/mode] 选项。\n" +"仅当检测到纹理正在 3D 中使用时,更改该导入选项才会生效。将其更改为[b]禁用[/" +"b],然后重新导入不会更改纹理上的已有压缩模式(如果被检测到在 3D 中使用),但选" +"择 [b]VRAM 压缩[/b]或 [b]Basis Universal[/b] 却会。" + +msgid "" +"If [code]true[/code], converts the imported image's colors to match [member " +"EditorSettings.interface/theme/icon_and_font_color]. This assumes the image " +"uses the exact same colors as [url=$DOCS_URL/contributing/development/editor/" +"creating_icons.html]Godot's own color palette for editor icons[/url], with " +"the source file designed for a dark editor theme. This should be enabled for " +"editor plugin icons and custom class icons, but should be left disabled " +"otherwise.\n" +"[b]Note:[/b] Only available for SVG images." +msgstr "" +"如果为 [code]true[/code],则转换导入图像的颜色以匹配 [member EditorSettings." +"interface/theme/icon_and_font_color]。这假设该图像使用与 [url=$DOCS_URL/" +"contributing/development/editor/creating_icons.html]Godot 自己的编辑器图标调色" +"板[/url]完全相同的颜色,源文件是为深色编辑器主题设计的。应该为编辑器插件图标和" +"自定义类图标启用该功能,否则应保持禁用状态。\n" +"[b]注意:[/b]仅适用于 SVG 图像。" + +msgid "" +"If [code]true[/code], scales the imported image to match [member " +"EditorSettings.interface/editor/custom_display_scale]. This should be enabled " +"for editor plugin icons and custom class icons, but should be left disabled " +"otherwise.\n" +"[b]Note:[/b] Only available for SVG images." +msgstr "" +"如果为 [code]true[/code],则缩放导入的图像以匹配 [member EditorSettings." +"interface/editor/custom_display_scale]。应该为编辑器插件图标和自定义类图标启用" +"该功能,否则应保持禁用状态。\n" +"[b]注意:[/b]仅适用于 SVG 图像。" + +msgid "" +"If [code]true[/code], smaller versions of the texture are generated on " +"import. For example, a 64×64 texture will generate 6 mipmaps (32×32, 16×16, " +"8×8, 4×4, 2×2, 1×1). This has several benefits:\n" +"- Textures will not become grainy in the distance (in 3D), or if scaled down " +"due to [Camera2D] zoom or [CanvasItem] scale (in 2D).\n" +"- Performance will improve if the texture is displayed in the distance, since " +"sampling smaller versions of the original texture is faster and requires less " +"memory bandwidth.\n" +"The downside of mipmaps is that they increase memory usage by roughly 33%.\n" +"It's recommended to enable mipmaps in 3D. However, in 2D, this should only be " +"enabled if your project visibly benefits from having mipmaps enabled. If the " +"camera never zooms out significantly, there won't be a benefit to enabling " +"mipmaps but memory usage will increase." +msgstr "" +"如果为 [code]true[/code],则在导入时生成较小版本的纹理。例如,64×64 纹理将生" +"成 6 个多级渐远纹理(32×32、16×16、8×8、4×4、2×2、1×1)。这样做有几个好处:\n" +"- 纹理在远处(在 3D 中)或由于 [Camera2D] 缩放或 [CanvasItem] 缩放(在 2D 中)" +"而缩小时不会变得具有颗粒感。\n" +"- 如果纹理显示在远处,性能将会提高,因为对原始纹理的较小版本进行采样速度更快并" +"且需要更少的内存带宽。\n" +"多级渐远纹理的缺点是它们会增加大约 33% 的内存占用。\n" +"建议在 3D 中启用多级渐远纹理。但是,在 2D 中,仅当你的项目明显受益于启用多级渐" +"远纹理时才应启用该功能。如果相机从不大幅缩小,启用多级渐远纹理不会有任何好处," +"但内存占用会增加。" + +msgid "" +"If [code]true[/code], puts pixels of the same surrounding color in transition " +"from transparent to opaque areas. For textures displayed with bilinear " +"filtering, this helps mitigate the outline effect when exporting images from " +"an image editor.\n" +"It's recommended to leave this enabled (as it is by default), unless this " +"causes issues for a particular image." +msgstr "" +"如果为 [code]true[/code],则将相同周围颜色的像素置于从透明区域到不透明区域的过" +"渡中。对于使用双线性过滤显示的纹理,这有助于减轻从图像编辑器导出图像时的轮廓效" +"果。\n" +"建议启用该功能(默认情况下),除非这会导致特定图像出现问题。" + +msgid "" +"Some HDR images you can find online may be broken and contain sRGB color data " +"(instead of linear color data). It is advised not to use those files. If you " +"absolutely have to, enabling [member process/hdr_as_srgb] will make them look " +"correct.\n" +"[b]Warning:[/b] Enabling [member process/hdr_as_srgb] on well-formatted HDR " +"images will cause the resulting image to look too dark, so leave this on " +"[code]false[/code] if unsure." +msgstr "" +"你在网上可以找到的一些 HDR 图像可能已损坏并包含 sRGB 颜色数据(而不是线性颜色" +"数据)。建议不要使用这些文件。 如果你一定要这样做,启用 [member process/" +"hdr_as_srgb] 将使它们看起来正确。\n" +"[b]警告:[/b]在格式良好的 HDR 图像上启用 [member process/hdr_as_srgb] 将导致生" +"成的图像看起来太暗,因此如果不确定,请将其保留为 [code]false[/code]。" + +msgid "" +"If [code]true[/code], clamps exposure in the imported high dynamic range " +"images using a smart clamping formula (without introducing [i]visible[/i] " +"clipping).\n" +"Some HDR panorama images you can find online may contain extremely bright " +"pixels, due to being taken from real life sources without any clipping.\n" +"While these HDR panorama images are accurate to real life, this can cause the " +"radiance map generated by Godot to contain sparkles when used as a background " +"sky. This can be seen in material reflections (even on rough materials in " +"extreme cases). Enabling [member process/hdr_clamp_exposure] can resolve this." +msgstr "" +"如果为 [code]true[/code],则使用智能钳制公式钳制导入的高动态范围图像中的曝光" +"(而不引入[i]可见的[/i]裁剪)。\n" +"你在网上可以找到的一些 HDR 全景图像可能包含非常明亮的像素,因为这些图像取自现" +"实生活来源,没有任何裁剪。\n" +"虽然这些 HDR 全景图像准确反映现实生活,但这可能会导致 Godot 生成的辐射图在用作" +"背景天空时包含闪光。这可以在材质反射中看到(即使在极端情况下的粗糙材质上)。启" +"用 [member process/hdr_clamp_exposure] 可以解决该问题。" + +msgid "" +"If [code]true[/code], convert the normal map from Y- (DirectX-style) to Y+ " +"(OpenGL-style) by inverting its green color channel. This is the normal map " +"convention expected by Godot.\n" +"More information about normal maps (including a coordinate order table for " +"popular engines) can be found [url=http://wiki.polycount.com/wiki/" +"Normal_Map_Technical_Details]here[/url]." +msgstr "" +"如果为 [code]true[/code],则通过反转其绿色通道将法线贴图从 Y-(DirectX 风格)" +"转换为 Y+(OpenGL 风格)。这是 Godot 所期望的法线贴图约定。\n" +"有关法线贴图(包括流行引擎的坐标顺序表)的更多信息,可以在[url=http://wiki." +"polycount.com/wiki/Normal_Map_Technical_Details]这里[/url]找到。" + +msgid "" +"An alternative to fixing darkened borders with [member process/" +"fix_alpha_border] is to use premultiplied alpha. By enabling this option, the " +"texture will be converted to this format. A premultiplied alpha texture " +"requires specific materials to be displayed correctly:\n" +"- In 2D, a [CanvasItemMaterial] will need to be created and configured to use " +"the [constant CanvasItemMaterial.BLEND_MODE_PREMULT_ALPHA] blend mode on " +"[CanvasItem]s that use this texture.\n" +"- In 3D, there is no support for premultiplied alpha blend mode yet, so this " +"option is only suited for 2D." +msgstr "" +"使用 [member process/fix_alpha_border] 修复黑色边框的另一种方法是使用预乘 " +"Alpha。通过启用该选项,纹理将被转换为该格式。预乘 Alpha 纹理需要特定材质才能正" +"确显示:\n" +"- 在 2D 中,需要创建并配置 [CanvasItemMaterial],以便在使用该纹理的 " +"[CanvasItem] 上使用 [constant CanvasItemMaterial.BLEND_MODE_PREMULT_ALPHA] 混" +"合模式。\n" +"- 在 3D 中,尚不支持预乘 Alpha 混合模式,因此该选项仅适用于 2D。" + +msgid "" +"If set to a value greater than [code]0[/code], the size of the texture is " +"limited on import to a value smaller than or equal to the value specified " +"here. For non-square textures, the size limit affects the longer dimension, " +"with the shorter dimension scaled to preserve aspect ratio. Resizing is " +"performed using cubic interpolation.\n" +"This can be used to reduce memory usage without affecting the source images, " +"or avoid issues with textures not displaying on mobile/web platforms (as " +"these usually can't display textures larger than 4096×4096)." +msgstr "" +"如果被设置为大于 [code]0[/code] 的值,则导入时纹理的大小将被限制为小于或等于此" +"处指定的值。对于非方形纹理,大小限制会影响较长的尺寸,而较短的尺寸会被缩放以保" +"持纵横比。调整大小是使用三次插值来执行的。\n" +"这可被用于减少内存占用而不影响源图像,或避免纹理在移动/Web 平台上不显示的问题" +"(因为这些平台通常无法显示大于 4096×4096 的纹理)。" + +msgid "" +"The color channel to consider as a roughness map in this texture. Only " +"effective if Roughness > Src Normal is not empty." +msgstr "" +"将该纹理视为粗糙度贴图的颜色通道。仅当粗糙度 > Src Normal 不为空时才有效。" + +msgid "" +"The path to the texture to consider as a normal map for roughness filtering " +"on import. Specifying this can help decrease specular aliasing slightly in " +"3D.\n" +"Roughness filtering on import is only used in 3D rendering, not 2D." +msgstr "" +"纹理的路径被视为导入时粗糙度过滤的法线贴图。指定该项有助于稍微减少 3D 中的镜面" +"锯齿。\n" +"导入时的粗糙度过滤仅被用于 3D 渲染,不适用于 2D。" + +msgid "" +"The scale the SVG should be rendered at, with [code]1.0[/code] being the " +"original design size. Higher values result in a larger image. Note that " +"unlike font oversampling, this affects the size the SVG is rendered at in 2D. " +"See also [member editor/scale_with_editor_scale].\n" +"[b]Note:[/b] Only available for SVG images." +msgstr "" +"SVG 应渲染的比例,[code]1.0[/code] 是原始设计尺寸。值越高,图像越大。请注意," +"与字体过采样不同,这会影响 SVG 在 2D 中渲染的大小。另请参阅 [member editor/" +"scale_with_editor_scale]。\n" +"[b]注意:[/b]仅适用于 SVG 图像。" + +msgid "" +"Imports a collection of textures from a PNG image into an optimized " +"[AtlasTexture] for 2D rendering." +msgstr "将 PNG 图像中的纹理集合导入到优化的 [AtlasTexture] 中以进行 2D 渲染。" + +msgid "" +"This imports a collection of textures from a PNG image into an [AtlasTexture] " +"or 2D [ArrayMesh]. This can be used to save memory when importing 2D " +"animations from spritesheets. Texture atlases are only supported in 2D " +"rendering, not 3D. See also [ResourceImporterTexture] and " +"[ResourceImporterLayeredTexture].\n" +"[b]Note:[/b] [ResourceImporterTextureAtlas] does not handle importing " +"[TileSetAtlasSource], which is created using the [TileSet] editor instead." +msgstr "" +"这会将 PNG 图像中的纹理集合导入到 [AtlasTexture] 或 2D [ArrayMesh] 中。从精灵" +"表导入 2D 动画时,这可被用于节省内存。纹理图集仅支持在 2D 中渲染,不支持 3D。" +"另请参见 [ResourceImporterTexture] 和 [ResourceImporterLayeredTexture]。\n" +"[b]注意:[/b][ResourceImporterTextureAtlas] 不处理导入 [TileSetAtlasSource]," +"它是使用 [TileSet] 编辑器创建的。" + +msgid "" +"Path to the atlas spritesheet. This [i]must[/i] be set to valid path to a PNG " +"image. Otherwise, the atlas will fail to import." +msgstr "" +"图集精灵表的路径。该属性[i]必须[/i]被设置为 PNG 图像的有效路径。否则,图集将无" +"法导入。" + +msgid "" +"If [code]true[/code], discards empty areas from the atlas. This only affects " +"final sprite positioning, not storage. See also [member " +"trim_alpha_border_from_region].\n" +"[b]Note:[/b] Only effective if [member import_mode] is [b]Region[/b]." +msgstr "" +"如果为 [code]true[/code],则丢弃图集中的空白区域。这仅影响最终的精灵定位,而不" +"影响存储。另请参见 [member trim_alpha_border_from_region]。\n" +"[b]注意:[/b]仅当 [member import_mode] 为[b]区块[/b]时有效。" + +msgid "" +"[b]Region:[/b] Imports the atlas in an [AtlasTexture] resource, which is " +"rendered as a rectangle. This is fast to render, but transparent areas still " +"have to be rendered if they can't be trimmed effectively by [member " +"trim_alpha_border_from_region]. This can reduce performance when rendering " +"large sprites on screen.\n" +"[b]Mesh:[/b] Imports the atlas as an [ArrayMesh] resource, keeping the " +"original bitmap visible (but rendered as a polygon). This can be used to " +"reduce fill rate when rendering large transparent sprites, at the cost of " +"slower rendering if there are little to no transparent areas in the sprite." +msgstr "" +"[b]区块:[/b]将图集导入到 [AtlasTexture] 资源中,该资源被渲染为矩形。这渲染速" +"度很快,但如果 [member trim_alpha_border_from_region] 无法有效修剪透明区域,则" +"仍然必须渲染透明区域。 在屏幕上渲染大型精灵时,这会降低性能。\n" +"[b]网格:[/b]将图集导入为 [ArrayMesh] 资源,保持原始位图可见(但被渲染为多边" +"形)。这可被用于在渲染大型透明精灵时降低填充率,但代价是如果精灵中几乎没有透明" +"区域,则渲染速度会变慢。" + +msgid "" +"If [code]true[/code], trims the region to exclude fully transparent pixels " +"using a clipping rectangle (which is never rotated). This can be used to save " +"memory. See also [member crop_to_region].\n" +"[b]Note:[/b] Only effective if [member import_mode] is [b]Region[/b]." +msgstr "" +"如果为 [code]true[/code],则使用裁剪矩形(从不旋转)修剪区块以排除完全透明的像" +"素。这可以被用来节省内存。另请参见 [member crop_to_region]。\n" +"[b]注意:[/b]仅当 [member import_mode] 为[b]区块[/b]时有效。" + msgid "Imports a WAV audio file for playback." msgstr "导入 WAV 音频文件,用于播放。" @@ -100703,6 +113621,24 @@ msgstr "返回可用于保存给定类型的资源的扩展列表。" msgid "Unregisters the given [ResourceFormatSaver]." msgstr "取消注册给定的 [ResourceFormatSaver]。" +msgid "" +"Saves a resource to disk to the given path, using a [ResourceFormatSaver] " +"that recognizes the resource object. If [param path] is empty, " +"[ResourceSaver] will try to use [member Resource.resource_path].\n" +"The [param flags] bitmask can be specified to customize the save behavior " +"using [enum SaverFlags] flags.\n" +"Returns [constant OK] on success.\n" +"[b]Note:[/b] When the project is running, any generated UID associated with " +"the resource will not be saved as the required code is only executed in " +"editor mode." +msgstr "" +"使用识别资源对象的 [ResourceFormatSaver] 将资源保存到给定路径。如果 [param " +"path] 为空,则 [ResourceSaver] 将尝试使用 [member Resource.resource_path]。\n" +"可以指定 [param flags] 位掩码以使用 [enum SaverFlags] 标志自定义保存行为。\n" +"成功时返回 [constant OK]。\n" +"[b]注意:[/b]项目正运行时,任何生成的与资源关联的 UID 都不会被保存,因为所需的" +"代码仅在编辑器模式下执行。" + msgid "No resource saving option." msgstr "没有资源保存选项。" @@ -100881,6 +113817,42 @@ msgid "A custom effect for a [RichTextLabel]." msgstr "[RichTextLabel] 的自定义效果。" msgid "" +"A custom effect for a [RichTextLabel].\n" +"[b]Note:[/b] For a [RichTextEffect] to be usable, a BBCode tag must be " +"defined as a member variable called [code]bbcode[/code] in the script.\n" +"[codeblocks]\n" +"[gdscript skip-lint]\n" +"# The RichTextEffect will be usable like this: `[example]Some text[/" +"example]`\n" +"var bbcode = \"example\"\n" +"[/gdscript]\n" +"[csharp skip-lint]\n" +"// The RichTextEffect will be usable like this: `[example]Some text[/" +"example]`\n" +"string bbcode = \"example\";\n" +"[/csharp]\n" +"[/codeblocks]\n" +"[b]Note:[/b] As soon as a [RichTextLabel] contains at least one " +"[RichTextEffect], it will continuously process the effect unless the project " +"is paused. This may impact battery life negatively." +msgstr "" +"[RichTextLabel] 的自定义效果。\n" +"[b]注意:[/b]要使用 [RichTextEffect],必须在脚本中定义名为 [code]bbcode[/" +"code] 的成员变量作为 BBCode 标签。\n" +"[codeblocks]\n" +"[gdscript skip-lint]\n" +"# 使用 RichTextEffect 的方式是这样的:`[example]Some text[/example]`\n" +"var bbcode = \"example\"\n" +"[/gdscript]\n" +"[csharp skip-lint]\n" +"// 使用 RichTextEffect 的方式是这样的:`[example]Some text[/example]`\n" +"string bbcode = \"example\";\n" +"[/csharp]\n" +"[/codeblocks]\n" +"[b]注意:[/b]只要 [RichTextLabel] 包含至少一个 [RichTextEffect],它就会持续处" +"理效果,除非项目暂停。这可能会对电池寿命产生负面影响。" + +msgid "" "Override this method to modify properties in [param char_fx]. The method must " "return [code]true[/code] if the character could be transformed successfully. " "If the method returns [code]false[/code], it will skip transformation to " @@ -100895,9 +113867,75 @@ msgid "" "and basic formatting." msgstr "用于显示文本的控件,文本中能够包含不同的字体样式、图片以及基础格式。" +msgid "" +"A control for displaying text that can contain custom fonts, images, and " +"basic formatting. [RichTextLabel] manages these as an internal tag stack. It " +"also adapts itself to given width/heights.\n" +"[b]Note:[/b] Assignments to [member text] clear the tag stack and reconstruct " +"it from the property's contents. Any edits made to [member text] will erase " +"previous edits made from other manual sources such as [method append_text] " +"and the [code]push_*[/code] / [method pop] methods.\n" +"[b]Note:[/b] RichTextLabel doesn't support entangled BBCode tags. For " +"example, instead of using [code skip-lint][b]bold[i]bold italic[/b]italic[/i]" +"[/code], use [code skip-lint][b]bold[i]bold italic[/i][/b][i]italic[/i][/" +"code].\n" +"[b]Note:[/b] [code]push_*/pop_*[/code] functions won't affect BBCode.\n" +"[b]Note:[/b] Unlike [Label], [RichTextLabel] doesn't have a [i]property[/i] " +"to horizontally align text to the center. Instead, enable [member " +"bbcode_enabled] and surround the text in a [code skip-lint][center][/code] " +"tag as follows: [code skip-lint][center]Example[/center][/code]. There is " +"currently no built-in way to vertically align text either, but this can be " +"emulated by relying on anchors/containers and the [member fit_content] " +"property." +msgstr "" +"用于显示文本的控件,文本中能够包含自定义字体、图片以及基础格式。" +"[RichTextLabel] 使用内部标签栈管理这些内容。它还可以适应给定的宽度和高度。\n" +"[b]注意:[/b]对 [member text] 赋值会将标签栈清空并根据该属性的内容重建。对 " +"[member text] 所做的任何编辑都将擦除之前从 [method append_text] 和 " +"[code]push_*[/code] / [method pop] 方法等其他手动来源所做的编辑。\n" +"[b]注意:[/b]RichTextLabel 不支持纠缠的 BBCode 标签。例如,请不要使用 [code " +"skip-lint][b]加粗[i]加粗斜体[/b]斜体[/i][/code],请改为 [code skip-lint][b]加" +"粗[i]加粗斜体[/i][/b][i]斜体[/i][/code]。\n" +"[b]注意:[/b][code]push_*/pop[/code] 函数不会影响 BBCode。\n" +"[b]注意:[/b]与 [Label] 不同,[RichTextLabel] 没有使文本水平居中的[i]属性[/" +"i]。请启用 [member bbcode_enabled] 并将文本包围在 [code skip-lint][center][/" +"code] 标签中,类似:[code skip-lint][center]示例[/center][/code]。目前也没有垂" +"直对齐文本的内置方法,但这可以通过使用锚点/容器和 [member fit_content] 属性来" +"模拟。" + msgid "GUI Rich Text/BBcode Demo" msgstr "GUI 富文本/BBcode 演示" +msgid "" +"Adds an image's opening and closing tags to the tag stack, optionally " +"providing a [param width] and [param height] to resize the image, a [param " +"color] to tint the image and a [param region] to only use parts of the " +"image.\n" +"If [param width] or [param height] is set to 0, the image size will be " +"adjusted in order to keep the original aspect ratio.\n" +"If [param width] and [param height] are not set, but [param region] is, the " +"region's rect will be used.\n" +"[param key] is an optional identifier, that can be used to modify the image " +"via [method update_image].\n" +"If [param pad] is set, and the image is smaller than the size specified by " +"[param width] and [param height], the image padding is added to match the " +"size instead of upscaling.\n" +"If [param size_in_percent] is set, [param width] and [param height] values " +"are percentages of the control width instead of pixels." +msgstr "" +"将图像的开始和结束标签添加到标签栈中,可选择提供 [param width] 和 [param " +"height] 来调整图像大小,提供 [param color] 来给图像混色, [param region] 只使" +"用图像的一部分。\n" +"如果 [param width] 或 [param height] 被设置为 0,图像的大小将被调整以保持原始" +"长宽比。\n" +"如果未设置 [param width] 和 [param height],但设置了 [param region],则将使用" +"该区域的矩形。\n" +"[param key] 是一个可选标识符,可用于通过 [method update_image] 修改图像。\n" +"如果设置了 [param pad],并且该图像小于 [param width] 和 [param height] 指定的" +"大小,则添加图像填充以匹配大小而不是放大图像。\n" +"如果设置了 [param size_in_percent],则 [param width] 和 [param height] 值是控" +"件宽度的百分比而不是像素。" + msgid "Adds raw non-BBCode-parsed text to the tag stack." msgstr "将非 BBCode 解析的原始文本添加到标签栈中。" @@ -101171,6 +114209,46 @@ msgstr "" "终止当前标签。使用 [code]push_*[/code] 方法之后手动关闭 BBCodes。不需要遵循 " "[code]add_*[/code] 方法。" +msgid "Terminates all tags opened by [code]push_*[/code] methods." +msgstr "终止由 [code]push_*[/code] 方法打开的所有标签。" + +msgid "" +"Terminates tags opened after the last [method push_context] call (including " +"context marker), or all tags if there's no context marker on the stack." +msgstr "" +"终止上一次 [method push_context] 调用后打开的标签(包括上下文标记);或者如果" +"堆栈上没有上下文标记,则终止所有标签。" + +msgid "Adds a [code skip-lint][bgcolor][/code] tag to the tag stack." +msgstr "向标签栈中添加 [code skip-lint][bgcolor][/code] 标签。" + +msgid "" +"Adds a [code skip-lint][font][/code] tag with a bold font to the tag stack. " +"This is the same as adding a [code skip-lint][b][/code] tag if not currently " +"in a [code skip-lint][i][/code] tag." +msgstr "" +"在标签栈中添加 [code skip-lint][font][/code] 标签,字体为黑体。如果当前没有 " +"[code skip-lint][i][/code] 标签,则与添加 [code skip-lint][b][/code] 标签相" +"同。" + +msgid "" +"Adds a [code skip-lint][font][/code] tag with a bold italics font to the tag " +"stack." +msgstr "在标签栈中添加 [code skip-lint][font][/code] 标签,字体为粗斜体。" + +msgid "" +"Adds a [code skip-lint][cell][/code] tag to the tag stack. Must be inside a " +"[code skip-lint][table][/code] tag. See [method push_table] for details." +msgstr "" +"在标签栈中添加 [code skip-lint][cell][/code] 标签。必须位于 [code skip-lint]" +"[table][/code] 标签内。详见 [method push_table]。" + +msgid "Adds a [code skip-lint][color][/code] tag to the tag stack." +msgstr "在标签栈中添加 [code skip-lint][color][/code] 标签。" + +msgid "Adds a context marker to the tag stack. See [method pop_context]." +msgstr "将上下文标记添加到标记堆栈。请参阅 [method pop_context]。" + msgid "" "Adds a custom effect tag to the tag stack. The effect does not need to be in " "[member custom_effects]. The environment is directly passed to the effect." @@ -101179,6 +114257,115 @@ msgstr "" "境被直接传入给效果。" msgid "" +"Adds a [code skip-lint][dropcap][/code] tag to the tag stack. Drop cap " +"(dropped capital) is a decorative element at the beginning of a paragraph " +"that is larger than the rest of the text." +msgstr "" +"将 [code skip-lint][dropcap][/code] 标签添加到标签堆栈中。首字下沉是一种装饰性" +"元素,位于段落开头,比其余文本要大。" + +msgid "Adds a [code skip-lint][fgcolor][/code] tag to the tag stack." +msgstr "向标签栈中添加 [code skip-lint][fgcolor][/code] 标签。" + +msgid "" +"Adds a [code skip-lint][font][/code] tag to the tag stack. Overrides default " +"fonts for its duration.\n" +"Passing [code]0[/code] to [param font_size] will use the existing default " +"font size." +msgstr "" +"在标签栈中添加 [code skip-lint][font][/code] 标签。在其有效期内覆盖默认字" +"体。\n" +"将 [param font_size] 设置为 [code]0[/code] 会使用默认字体大小。" + +msgid "" +"Adds a [code skip-lint][font_size][/code] tag to the tag stack. Overrides " +"default font size for its duration." +msgstr "" +"在标签栈中添加 [code skip-lint][font_size][/code] 标签。在其有效期内覆盖默认字" +"体大小。" + +msgid "" +"Adds a [code skip-lint][hint][/code] tag to the tag stack. Same as BBCode " +"[code skip-lint][hint=something]{text}[/hint][/code]." +msgstr "" +"向标签栈中添加 [code skip-lint][hint][/code] 标签。类似于 BBCode 的 [code " +"skip-lint][hint=something]{text}[/hint][/code]。" + +msgid "" +"Adds an [code skip-lint][indent][/code] tag to the tag stack. Multiplies " +"[param level] by current [member tab_size] to determine new margin length." +msgstr "" +"添加一个 [code skip-lint][indent][/code] 标签到标签栈。将 [param level] 乘以当" +"前 [member tab_size] 以确定新的边距长度。" + +msgid "" +"Adds a [code skip-lint][font][/code] tag with an italics font to the tag " +"stack. This is the same as adding an [code skip-lint][i][/code] tag if not " +"currently in a [code skip-lint][b][/code] tag." +msgstr "" +"在标签栈中添加 [code skip-lint][font][/code] 标签,字体为斜体。如果当前不在 " +"[code skip-lint][b][/code] 标签中,则与添加 [code skip-lint][i][/code] 标签相" +"同。" + +msgid "" +"Adds language code used for text shaping algorithm and Open-Type font " +"features." +msgstr "添加用于文本塑形算法和 Open-Type 字体功能的语言代码。" + +msgid "" +"Adds [code skip-lint][ol][/code] or [code skip-lint][ul][/code] tag to the " +"tag stack. Multiplies [param level] by current [member tab_size] to determine " +"new margin length." +msgstr "" +"将 [code skip-lint][ol][/code] 或 [code skip-lint][ul][/code] 标签添加到标签堆" +"栈中。将 [param level] 乘以当前 [member tab_size] 来确定新的边距长度。" + +msgid "" +"Adds a meta tag to the tag stack. Similar to the BBCode [code skip-lint]" +"[url=something]{text}[/url][/code], but supports non-[String] metadata types." +msgstr "" +"在标签栈中添加元标签。类似于 BBCode 的 [code skip-lint][url=something]{text}[/" +"url][/code],但支持非 [String] 元数据类型。" + +msgid "" +"Adds a [code skip-lint][font][/code] tag with a monospace font to the tag " +"stack." +msgstr "在标签栈中添加 [code skip-lint][font][/code] 标签,该标签为等宽字体。" + +msgid "" +"Adds a [code skip-lint][font][/code] tag with a normal font to the tag stack." +msgstr "在标签栈中添加具有正常字体的 [code skip-lint][font][/code] 标签。" + +msgid "" +"Adds a [code skip-lint][outline_color][/code] tag to the tag stack. Adds text " +"outline for its duration." +msgstr "" +"在标签栈中添加 [code skip-lint][outline_color][/code] 标签。在其有效期内为文本" +"添加轮廓。" + +msgid "" +"Adds a [code skip-lint][outline_size][/code] tag to the tag stack. Overrides " +"default text outline size for its duration." +msgstr "" +"在标签栈中添加 [code skip-lint][outline_size][/code] 标签。在其有效期内覆盖默" +"认的文本轮廓大小。" + +msgid "Adds a [code skip-lint][p][/code] tag to the tag stack." +msgstr "向标签栈中添加 [code skip-lint][p][/code] 标签。" + +msgid "Adds a [code skip-lint][s][/code] tag to the tag stack." +msgstr "向标签栈中添加 [code skip-lint][s][/code] 标签。" + +msgid "" +"Adds a [code skip-lint][table=columns,inline_align][/code] tag to the tag " +"stack." +msgstr "" +"向标签栈中添加 [code skip-lint][table=columns,inline_align][/code] 标签。" + +msgid "Adds a [code skip-lint][u][/code] tag to the tag stack." +msgstr "向标签栈中添加 [code skip-lint][u][/code] 标签。" + +msgid "" "Removes a paragraph of content from the label. Returns [code]true[/code] if " "the paragraph exists.\n" "The [param paragraph] argument is the index of the paragraph to remove, it " @@ -101235,6 +114422,13 @@ msgstr "" "如果 [param expand] 为 [code]false[/code],则该列将不会对总比率产生影响。" msgid "" +"Updates the existing images with the key [param key]. Only properties " +"specified by [param mask] bits are updated. See [method add_image]." +msgstr "" +"使用键 [param key] 更新已有图像。仅更新 [param mask] 位指定的属性。请参阅 " +"[method add_image]。" + +msgid "" "If set to something other than [constant TextServer.AUTOWRAP_OFF], the text " "gets wrapped inside the node's bounding rectangle. To see how each mode " "behaves, see [enum TextServer.AutowrapMode]." @@ -101264,6 +114458,20 @@ msgstr "" "的行为相匹配。" msgid "" +"If [code]true[/code], the label underlines hint tags such as [code skip-lint]" +"[hint=description]{text}[/hint][/code]." +msgstr "" +"如果为 [code]true[/code],则该标签节点会在 hint 标记下,加下划线,例如 [code " +"skip-lint][hint=description]{text}[/hint][/code]。" + +msgid "" +"If [code]true[/code], the label underlines meta tags such as [code skip-lint]" +"[url]{text}[/url][/code]." +msgstr "" +"如果为 [code]true[/code],则会在元标签下划线,例如 [code skip-lint][url]{text}" +"[/url][/code]。" + +msgid "" "The delay after which the loading progress bar is displayed, in milliseconds. " "Set to [code]-1[/code] to disable progress bar entirely.\n" "[b]Note:[/b] Progress bar is displayed only if [member threaded] is enabled." @@ -101301,12 +114509,44 @@ msgstr "" "与单个制表符长度关联的空格数。不影响文本标签中的 [code]\\t[/code],只影响缩进" "标签。" +msgid "" +"The label's text in BBCode format. Is not representative of manual " +"modifications to the internal tag stack. Erases changes made by other methods " +"when edited.\n" +"[b]Note:[/b] If [member bbcode_enabled] is [code]true[/code], it is unadvised " +"to use the [code]+=[/code] operator with [member text] (e.g. [code]text += " +"\"some string\"[/code]) as it replaces the whole text and can cause " +"slowdowns. It will also erase all BBCode that was added to stack using " +"[code]push_*[/code] methods. Use [method append_text] for adding text " +"instead, unless you absolutely need to close a tag that was opened in an " +"earlier method call." +msgstr "" +"该标签的在 BBCode 格式中的文本。不代表对内部标签堆栈的手动修改。编辑时擦除通过" +"其他方法所做的更改。\n" +"[b]注意:[/b]如果 [member bbcode_enabled] 为 [code]true[/code],则不建议将 " +"[code]+=[/code] 运算符与 [member text] 一起使用(例如 [code]text += \"some " +"string\"[/code])因为它会替换整个文本并可能导致速度变慢。它还将擦除使用 " +"[code]push_*[/code] 方法添加到堆栈中的所有 BBCode。请改用 [method " +"append_text] 添加文本,除非你绝对需要关闭在之前的方法调用中打开的标签。" + msgid "If [code]true[/code], text processing is done in a background thread." msgstr "如果为 [code]true[/code],则文本处理在后台线程中完成。" msgid "Triggered when the document is fully loaded." msgstr "当文档完全加载时触发。" +msgid "" +"Triggered when the user clicks on content between meta tags. If the meta is " +"defined in text, e.g. [code skip-lint][url={\"data\"=\"hi\"}]hi[/url][/code], " +"then the parameter for this signal will be a [String] type. If a particular " +"type or an object is desired, the [method push_meta] method must be used to " +"manually insert the data into the tag stack." +msgstr "" +"当用户点击元标记之间的内容时触发。如果元是在文本中定义的,例如 [code skip-" +"lint][url={\"data\"=\"hi\"}]hi[/url][/code],则该信号的参数为 [String] 类型。" +"如果需要特定类型或对象,则必须使用 [method push_meta] 方法将数据手动插入标签" +"栈。" + msgid "Triggers when the mouse exits a meta tag." msgstr "当鼠标退出元标签时触发。" @@ -101328,6 +114568,33 @@ msgstr "每个列表项都有实心圆标记。" msgid "Selects the whole [RichTextLabel] text." msgstr "全选 [TextEdit] 文本。" +msgid "If this bit is set, [method update_image] changes image texture." +msgstr "如果设置了该位,[method update_image] 会更改图像纹理。" + +msgid "If this bit is set, [method update_image] changes image size." +msgstr "如果设置了该位,[method update_image] 会更改图像大小。" + +msgid "If this bit is set, [method update_image] changes image color." +msgstr "如果设置了该位,[method update_image] 会更改图像颜色。" + +msgid "" +"If this bit is set, [method update_image] changes image inline alignment." +msgstr "如果设置了该位,[method update_image] 会更改图像内联对齐方式。" + +msgid "If this bit is set, [method update_image] changes image texture region." +msgstr "如果设置了该位,[method update_image] 会更改图像纹理区块。" + +msgid "If this bit is set, [method update_image] changes image padding." +msgstr "如果设置了该位,[method update_image] 会更改图像填充。" + +msgid "If this bit is set, [method update_image] changes image tooltip." +msgstr "如果设置了该位,[method update_image] 会更改图像工具提示。" + +msgid "" +"If this bit is set, [method update_image] changes image width from/to " +"percents." +msgstr "如果设置了该位,[method update_image] 会将图像宽度更改自/为百分比。" + msgid "The default text color." msgstr "默认文本颜色。" @@ -101372,6 +114639,22 @@ msgstr "表中元素的水平间距。" msgid "The vertical separation of elements in a table." msgstr "表中元素的垂直间距。" +msgid "" +"The horizontal padding around boxes drawn by the [code][fgcolor][/code] and " +"[code][bgcolor][/code] tags. This does not affect the appearance of text " +"selection." +msgstr "" +"由 [code][fgcolor][/code] 和 [code][bgcolor][/code] 标记绘制的框周围的水平填" +"充。这不会影响文本选择的外观。" + +msgid "" +"The vertical padding around boxes drawn by the [code][fgcolor][/code] and " +"[code][bgcolor][/code] tags. This does not affect the appearance of text " +"selection." +msgstr "" +"由 [code][fgcolor][/code] 和 [code][bgcolor][/code] 标记绘制的框周围的垂直填" +"充。这不会影响文本选择的外观。" + msgid "The font used for bold text." msgstr "用于粗体字的字体。" @@ -101402,6 +114685,22 @@ msgstr "用于等宽文本的字体大小。" msgid "The default text font size." msgstr "默认文本字体大小。" +msgid "" +"The background used when the [RichTextLabel] is focused. The [theme_item " +"focus] [StyleBox] is displayed [i]over[/i] the base [StyleBox], so a " +"partially transparent [StyleBox] should be used to ensure the base [StyleBox] " +"remains visible. A [StyleBox] that represents an outline or an underline " +"works well for this purpose. To disable the focus visual effect, assign a " +"[StyleBoxEmpty] resource. Note that disabling the focus visual effect will " +"harm keyboard/controller navigation usability, so this is not recommended for " +"accessibility reasons." +msgstr "" +"该 [RichTextLabel] 处于聚焦状态时使用的背景。[theme_item focus] [StyleBox] 显" +"示在基础 [StyleBox] [i]之上[/i],所以应该使用部分透明的 [StyleBox],确保基础 " +"[StyleBox] 仍然可见。代表轮廓或下划线的 [StyleBox] 可以很好地实现这个目的。要" +"禁用聚焦的视觉效果,请指定 [StyleBoxEmpty] 资源。请注意,禁用聚焦的视觉效果会" +"影响使用键盘/手柄进行导航的可用性,所以出于可访问性的原因,不建议这样做。" + msgid "The normal background for the [RichTextLabel]." msgstr "[RichTextLabel] 的正常背景。" @@ -102115,6 +115414,69 @@ msgstr "" "为 0.5 将施加一半重力到该对象。" msgid "" +"The body's moment of inertia. This is like mass, but for rotation: it " +"determines how much torque it takes to rotate the body on each axis. The " +"moment of inertia is usually computed automatically from the mass and the " +"shapes, but this property allows you to set a custom value.\n" +"If set to [constant Vector3.ZERO], inertia is automatically computed (default " +"value).\n" +"[b]Note:[/b] This value does not change when inertia is automatically " +"computed. Use [PhysicsServer3D] to get the computed inertia.\n" +"[codeblocks]\n" +"[gdscript]\n" +"@onready var ball = $Ball\n" +"\n" +"func get_ball_inertia():\n" +" return PhysicsServer3D.body_get_direct_state(ball.get_rid())." +"inverse_inertia.inverse()\n" +"[/gdscript]\n" +"[csharp]\n" +"private RigidBody3D _ball;\n" +"\n" +"public override void _Ready()\n" +"{\n" +" _ball = GetNode<RigidBody3D>(\"Ball\");\n" +"}\n" +"\n" +"private Vector3 GetBallInertia()\n" +"{\n" +" return PhysicsServer3D.BodyGetDirectState(_ball.GetRid()).InverseInertia." +"Inverse();\n" +"}\n" +"[/csharp]\n" +"[/codeblocks]" +msgstr "" +"该物体的惯性力矩。与质量类似,但适用于旋转:用于确定各个轴上需要施加多少扭矩才" +"能让该物体旋转。通常会自动根据质量和形状计算惯性力矩,但这个属性能够让你设置自" +"定义的值。\n" +"设置为 [constant Vector3.ZERO] 时,会自动计算惯性(默认值)。\n" +"[b]注意:[/b]自动计算出惯性后,这个值不会改变。请使用 [PhysicsServer3D] 获取计" +"算出的惯性。\n" +"[codeblocks]\n" +"[gdscript]\n" +"@onready var ball = $Ball\n" +"\n" +"func get_ball_inertia():\n" +" return PhysicsServer3D.body_get_direct_state(ball.get_rid())." +"inverse_inertia.inverse()\n" +"[/gdscript]\n" +"[csharp]\n" +"private RigidBody3D _ball;\n" +"\n" +"public override void _Ready()\n" +"{\n" +" _ball = GetNode<RigidBody3D>(\"Ball\");\n" +"}\n" +"\n" +"private Vector3 GetBallInertia()\n" +"{\n" +" return PhysicsServer3D.BodyGetDirectState(_ball.GetRid()).InverseInertia." +"Inverse();\n" +"}\n" +"[/csharp]\n" +"[/codeblocks]" + +msgid "" "Emitted when a collision with another [PhysicsBody3D] or [GridMap] occurs. " "Requires [member contact_monitor] to be set to [code]true[/code] and [member " "max_contacts_reported] to be set high enough to detect all the collisions. " @@ -102212,9 +115574,31 @@ msgstr "" "[Shape3D] 的索引。该 [CollisionShape3D] 节点可以使用 [code]self." "shape_owner_get_owner(self.shape_find_owner(local_shape_index))[/code] 获取。" +msgid "Editor-only helper for setting up root motion in [AnimationMixer]." +msgstr "仅限编辑器的帮助程序,用于在 [AnimationMixer] 中设置根运动。" + +msgid "" +"[i]Root motion[/i] refers to an animation technique where a mesh's skeleton " +"is used to give impulse to a character. When working with 3D animations, a " +"popular technique is for animators to use the root skeleton bone to give " +"motion to the rest of the skeleton. This allows animating characters in a way " +"where steps actually match the floor below. It also allows precise " +"interaction with objects during cinematics. See also [AnimationMixer].\n" +"[b]Note:[/b] [RootMotionView] is only visible in the editor. It will be " +"hidden automatically in the running project." +msgstr "" +"[i]根运动[/i]是指一种动画技术,通过使用网格的骨架为角色提供冲量。在处理 3D 动" +"画时,动画师的一种流行技术是使用根骨架骨骼为骨架的其余部分提供运动。这允许以脚" +"步实际与下面的地板匹配的方式对角色进行动画处理。它还允许在过场动画期间与对象进" +"行精确交互。另请参阅 [AnimationMixer]。\n" +"[b]注意:[/b][RootMotionView] 仅在编辑器中可见。在运行的项目中将自动隐藏。" + msgid "Using AnimationTree - Root motion" msgstr "使用 AnimationTree - 根运动" +msgid "Path to an [AnimationMixer] node to use as a basis for root motion." +msgstr "用作根运动的基的 [AnimationMixer] 节点的路径。" + msgid "The grid's cell size in 3D units." msgstr "以 3D 单位表示的网格单元大小。" @@ -102468,11 +115852,34 @@ msgid "Finds the index of the given [param path]." msgstr "查找给定 [param path] 的索引。" msgid "" +"Returns the replication mode for the property identified by the given [param " +"path]. See [enum ReplicationMode]." +msgstr "" +"返回给定 [param path] 标识的属性的复制模式。请参阅 [enum ReplicationMode]。" + +msgid "" "Returns whether the property identified by the given [param path] is " "configured to be synchronized on spawn." msgstr "返回属性是否配置为在出生时同步,该属性由 [param path] 指定。" msgid "" +"Returns whether the property identified by the given [param path] is " +"configured to be synchronized on process.\n" +"[i]Deprecated.[/i] Use [method property_get_replication_mode] instead." +msgstr "" +"返回属性是否配置为在处理时同步,该属性由[param path] 指定。\n" +"[i]已废弃。[/i]请改用 [method property_get_replication_mode]。" + +msgid "" +"Returns whether the property identified by the given [param path] is " +"configured to be reliably synchronized when changes are detected on process.\n" +"[i]Deprecated.[/i] Use [method property_get_replication_mode] instead." +msgstr "" +"返回属性是否配置为在处理中检测到变化时进行可靠同步,该属性由 [param path] 指" +"定。\n" +"[i]已废弃。[/i]请改用 [method property_get_replication_mode]。" + +msgid "" "Sets the synchronization mode for the property identified by the given [param " "path]. See [enum ReplicationMode]." msgstr "为路径为 [param path] 的属性设置同步模式。见 [enum ReplicationMode]。" @@ -102773,20 +116180,15 @@ msgid "" "Returns [constant OK] on success, [constant ERR_CANT_OPEN] if the [param " "path] cannot be loaded into a [PackedScene], or [constant ERR_CANT_CREATE] if " "that scene cannot be instantiated.\n" -"[b]Note:[/b] The new scene node is added to the tree at the end of the frame. " -"This ensures that both scenes aren't running at the same time, while still " -"freeing the previous scene in a safe way similar to [method Node.queue_free]. " -"As such, you won't be able to access the loaded scene immediately after the " -"[method change_scene_to_file] call." +"[b]Note:[/b] See [method change_scene_to_packed] for details on the order of " +"operations." msgstr "" "将位于给定路径 [param path] 的场景加载进一个 [PackedScene] 并新建其实例,然后" "将正在运行的场景修改为这个场景。\n" -"成功时返回 [constant OK],如果 [param path] 不能被加载到一个 [PackedScene] " +"成功时返回 [constant OK];如果 [param path] 不能被加载到一个 [PackedScene] " "中,则返回 [constant ERR_CANT_OPEN];如果该场景无法被实例化,则返回 [constant " "ERR_CANT_CREATE]。\n" -"[b]注意:[/b]新的场景节点是在该帧的末尾添加的。这确保了两个场景永远不会同时加" -"载,如果场景太大或在内存受限的环境中运行,这会耗尽系统资源。因此,无法在 " -"[method change_scene_to_file] 调用后,立即访问到被加载的场景。" +"[b]注意:[/b]有关操作顺序的详细信息,请参阅 [method change_scene_to_packed]。" msgid "" "Changes the running scene to a new instance of the given [PackedScene] (which " @@ -102794,15 +116196,32 @@ msgid "" "Returns [constant OK] on success, [constant ERR_CANT_CREATE] if the scene " "cannot be instantiated, or [constant ERR_INVALID_PARAMETER] if the scene is " "invalid.\n" -"[b]Note:[/b] The new scene node is added to the tree at the end of the frame. " -"You won't be able to access it immediately after the [method " -"change_scene_to_packed] call." -msgstr "" -"将正在运行的场景改变为给定 [PackedScene] (必须有效)的一个新实例。\n" -"成功时返回 [constant OK],场景无法实例化时返回 [constant ERR_CANT_CREATE],场" -"景无效时返回 [constant ERR_INVALID_PARAMETER]。\n" -"[b]注意:[/b]新的场景节点会在当前帧的末尾添加到场景树中。无法在调用 [method " -"change_scene_to_packed] 后立即访问到它。" +"[b]Note:[/b] Operations happen in the following order when [method " +"change_scene_to_packed] is called:\n" +"1. The current scene node is immediately removed from the tree. From that " +"point, [method Node.get_tree] called on the current (outgoing) scene will " +"return [code]null[/code]. [member current_scene] will be [code]null[/code], " +"too, because the new scene is not available yet.\n" +"2. At the end of the frame, the formerly current scene, already removed from " +"the tree, will be deleted (freed from memory) and then the new scene will be " +"instantiated and added to the tree. [method Node.get_tree] and [member " +"current_scene] will be back to working as usual.\n" +"This ensures that both scenes aren't running at the same time, while still " +"freeing the previous scene in a safe way similar to [method Node.queue_free]." +msgstr "" +"将正在运行的场景更改为给定 [PackedScene] 的新实例(新实例必须有效)。\n" +"成功时返回 [constant OK],场景无法被实例化时返回 [constant ERR_CANT_CREATE]," +"场景无效时返回 [constant ERR_INVALID_PARAMETER]。\n" +"[b]注意:[/b]当 [method change_scene_to_packed] 被调用时,操作按以下顺序发" +"生:\n" +"1. 当前场景节点被立即从树中移除。从那时起,在当前(传出)场景上调用的 [method " +"Node.get_tree] 将返回 [code]null[/code]。[member current_scene] 也将变为 " +"[code]null[/code],因为新场景尚不可用。\n" +"2. 在帧末尾时,已从树中移除的、之前的当前场景将被删除(从内存中释放),然后新" +"场景将被实例化并添加到树中。[method Node.get_tree] 和 [member current_scene] " +"将恢复正常工作。\n" +"这确保了两个场景不会同时运行,并且仍然会以类似于 [method Node.queue_free] 的安" +"全方式释放之前的场景。" msgid "" "Returns a [SceneTreeTimer] which will emit [signal SceneTreeTimer.timeout] " @@ -102898,6 +116317,16 @@ msgid "" "application started." msgstr "返回当前的帧数,即自应用程序启动以来的总帧数。" +msgid "" +"Searches for the [MultiplayerAPI] configured for the given path, if one does " +"not exist it searches the parent paths until one is found. If the path is " +"empty, or none is found, the default one is returned. See [method " +"set_multiplayer]." +msgstr "" +"搜索为给定路径配置的 [MultiplayerAPI],如果不存在,则会搜索父路径,直到找到为" +"止。如果路径为空,或者没有找到,则返回默认路径。参见 [method " +"set_multiplayer]。" + msgid "Returns the number of nodes in this [SceneTree]." msgstr "返回此 [SceneTree] 中的节点数。" @@ -103011,6 +116440,21 @@ msgstr "" "[constant GROUP_CALL_DEFERRED] 标志,则属性将在该帧的末尾再设置,类似于 " "[method Object.call_deferred]。" +msgid "" +"Sets a custom [MultiplayerAPI] with the given [param root_path] (controlling " +"also the relative subpaths), or override the default one if [param root_path] " +"is empty.\n" +"[b]Note:[/b] No [MultiplayerAPI] must be configured for the subpath " +"containing [param root_path], nested custom multiplayers are not allowed. I." +"e. if one is configured for [code]\"/root/Foo\"[/code] setting one for " +"[code]\"/root/Foo/Bar\"[/code] will cause an error." +msgstr "" +"用给定的 [param root_path] 设置自定义的 [MultiplayerAPI](同时控制相对的子路" +"径),如果 [param root_path] 为空,则会覆盖默认值。\n" +"[b]注意:[/b][MultiplayerAPI] 不能为包含 [param root_path] 的子路径配置,嵌套" +"的自定义多人游戏是不被允许的。例如,如果为 [code]\"/root/Foo\"[/code] 配置了一" +"项,则为 [code]\"/root/Foo/Bar\"[/code] 设置一项将导致错误。" + msgid "If a current scene is loaded, calling this method will unload it." msgstr "如果当前场景已加载,调用此方法将进行卸载。" @@ -103514,12 +116958,26 @@ msgstr "" msgid "Emitted when the scrollbar is being scrolled." msgstr "当滚动条滚动时发出。" +msgid "" +"Icon used as a button to scroll the [ScrollBar] left/up. Supports custom step " +"using the [member ScrollBar.custom_step] property." +msgstr "" +"用作向左/向上滚动 [ScrollBar] 的按钮的图标。使用 [member ScrollBar." +"custom_step] 属性支持自定义步长。" + msgid "Displayed when the mouse cursor hovers over the decrement button." msgstr "当鼠标指针悬停在递减按钮上时显示。" msgid "Displayed when the decrement button is being pressed." msgstr "在按下递减按钮时显示。" +msgid "" +"Icon used as a button to scroll the [ScrollBar] right/down. Supports custom " +"step using the [member ScrollBar.custom_step] property." +msgstr "" +"用作向右/向下滚动 [ScrollBar] 的按钮的图标。使用 [member ScrollBar." +"custom_step] 属性支持自定义步长。" + msgid "Displayed when the mouse cursor hovers over the increment button." msgstr "当鼠标指针悬停在增量按钮上时显示。" @@ -103620,6 +117078,26 @@ msgid "" msgstr "触摸滚动的死区。较低的死区使滚动更加敏感。" msgid "" +"The current horizontal scroll value.\n" +"[b]Note:[/b] If you are setting this value in the [method Node._ready] " +"function or earlier, it needs to be wrapped with [method Object." +"set_deferred], since scroll bar's [member Range.max_value] is not initialized " +"yet.\n" +"[codeblock]\n" +"func _ready():\n" +" set_deferred(\"scroll_horizontal\", 600)\n" +"[/codeblock]" +msgstr "" +"当前的水平滚动值。\n" +"[b]注意:[/b]如果在 [method Node._ready] 函数或更早的函数中设置该值,则需要用 " +"[method Object.set_deferred] 包装,因为滚动条的 [member Range.max_value] 此时" +"尚未初始化。\n" +"[codeblock]\n" +"func _ready():\n" +" set_deferred(\"scroll_horizontal\", 600)\n" +"[/codeblock]" + +msgid "" "Overrides the [member ScrollBar.custom_step] used when clicking the internal " "scroll bar's horizontal increment and decrement buttons or when using arrow " "keys when the [ScrollBar] is focused." @@ -103656,6 +117134,34 @@ msgid "" "visible. See [enum ScrollMode] for options." msgstr "控制垂直滚动条是否可用、应该何时可见。选项见 [enum ScrollMode]。" +msgid "" +"Emitted when scrolling stops when dragging the scrollable area [i]with a " +"touch event[/i]. This signal is [i]not[/i] emitted when scrolling by dragging " +"the scrollbar, scrolling with the mouse wheel or scrolling with keyboard/" +"gamepad events.\n" +"[b]Note:[/b] This signal is only emitted on Android or iOS, or on desktop/web " +"platforms when [member ProjectSettings.input_devices/pointing/" +"emulate_touch_from_mouse] is enabled." +msgstr "" +"当[i]通过触摸事件[/i]拖动可滚动区域而导致滚动停止时发出。当通过拖动滚动条滚" +"动、使用鼠标滚轮滚动、或使用键盘/游戏手柄事件滚动时,[i]不[/i]会发出该信号。\n" +"[b]注意:[/b]该信号仅在 Android 或 iOS 上,或在启用 [member ProjectSettings." +"input_devices/pointing/emulate_touch_from_mouse] 时的桌面/Web 平台上发出。" + +msgid "" +"Emitted when scrolling starts when dragging the scrollable area w[i]ith a " +"touch event[/i]. This signal is [i]not[/i] emitted when scrolling by dragging " +"the scrollbar, scrolling with the mouse wheel or scrolling with keyboard/" +"gamepad events.\n" +"[b]Note:[/b] This signal is only emitted on Android or iOS, or on desktop/web " +"platforms when [member ProjectSettings.input_devices/pointing/" +"emulate_touch_from_mouse] is enabled." +msgstr "" +"当[i]通过触摸事件[/i]拖动可滚动区域而导致滚动开始时发出。当通过拖动滚动条滚" +"动、使用鼠标滚轮滚动、或使用键盘/游戏手柄事件滚动时,[i]不[/i]会发出该信号。\n" +"[b]注意:[/b]该信号仅在 Android 或 iOS 上,或在启用 [member ProjectSettings." +"input_devices/pointing/emulate_touch_from_mouse] 时的桌面/Web 平台上发出。" + msgid "Scrolling disabled, scrollbar will be invisible." msgstr "禁用滚动,滚动条不可见。" @@ -103731,6 +117237,18 @@ msgid "" "any collider." msgstr "用于物理碰撞的 2D 射线形状,会尝试将自己与其他碰撞体分开。" +msgid "" +"A 2D ray shape, intended for use in physics. Usually used to provide a shape " +"for a [CollisionShape2D]. When a [SeparationRayShape2D] collides with an " +"object, it tries to separate itself from it by moving its endpoint to the " +"collision point. For example, a [SeparationRayShape2D] next to a character " +"can allow it to instantly move up when touching stairs." +msgstr "" +"2D 射线形状,旨在用于物理。通常用来为 [CollisionShape2D] 提供形状。" +"[SeparationRayShape2D] 与某个对象发生碰撞时,会尝试将其端点移动至碰撞点,来将" +"自己与该对象分离。例如,角色旁边的 [SeparationRayShape2D] 可以让角色在接触楼梯" +"时立即向上移动。" + msgid "The ray's length." msgstr "射线的长度。" @@ -103750,6 +117268,18 @@ msgid "" "any collider." msgstr "用于物理碰撞的 3D 射线形状,会尝试将自己与其他碰撞体分开。" +msgid "" +"A 3D ray shape, intended for use in physics. Usually used to provide a shape " +"for a [CollisionShape3D]. When a [SeparationRayShape3D] collides with an " +"object, it tries to separate itself from it by moving its endpoint to the " +"collision point. For example, a [SeparationRayShape3D] next to a character " +"can allow it to instantly move up when touching stairs." +msgstr "" +"3D 射线形状,旨在用于物理。通常用来为 [CollisionShape3D] 提供形状。" +"[SeparationRayShape3D] 与某个对象发生碰撞时,会尝试将其端点移动至碰撞点,来将" +"自己与该对象分离。例如,角色旁边的 [SeparationRayShape3D] 可以让角色在接触楼梯" +"时立即向上移动。" + msgid "Abstract base class for separators." msgstr "分隔线的抽象基类。" @@ -103760,6 +117290,18 @@ msgstr "" "分隔线的抽象基类,用于分隔其他控件。[Separator] 只提供视觉上的分隔,通常用 " "[StyleBoxLine] 绘制。" +msgid "" +"The size of the area covered by the separator. Effectively works like a " +"minimum width/height." +msgstr "分隔器所覆盖区域的大小。其作用类似于最小宽度/高度。" + +msgid "" +"The style for the separator line. Works best with [StyleBoxLine] (remember to " +"enable [member StyleBoxLine.vertical] for [VSeparator])." +msgstr "" +"分隔线的样式。与 [StyleBoxLine] 一起使用效果最好(请记住为 [VSeparator] 启用 " +"[member StyleBoxLine.vertical])。" + msgid "A shader implemented in the Godot shading language." msgstr "用 Godot 着色语言实现的着色器。" @@ -103906,6 +117448,30 @@ msgstr "" "代码。" msgid "" +"A material defined by a custom [Shader] program and the values of its shader " +"parameters." +msgstr "由自定义 [Shader] 程序定义的材质及其着色器参数的值。" + +msgid "" +"A material that uses a custom [Shader] program to render visual items (canvas " +"items, meshes, skies, fog), or to process particles. Compared to other " +"materials, [ShaderMaterial] gives deeper control over the generated shader " +"code. For more information, see the shaders documentation index below.\n" +"Multiple [ShaderMaterial]s can use the same shader and configure different " +"values for the shader uniforms.\n" +"[b]Note:[/b] For performance reasons, the [signal Resource.changed] signal is " +"only emitted when the [member Resource.resource_name] changes. Only in " +"editor, it is also emitted for [member shader] changes." +msgstr "" +"使用自定义 [Shader] 程序来渲染可见项目(画布项目、网格、天空、雾)或处理粒子的" +"材质。与其他材质相比,[ShaderMaterial] 可以更深入地控制生成的着色器代码。有关" +"更多信息,请参阅下面的着色器文档索引。\n" +"多个 [ShaderMaterial] 可以使用相同的着色器并为着色器 uniform 配置不同的值。\n" +"[b]注意:[/b]出于性能原因,仅当 [member Resource.resource_name] 更改时才会发" +"出 [signal Resource.changed] 信号。仅在编辑器中,它也会针对 [member shader] 更" +"改而发出。" + +msgid "" "Returns the current value set for this material of a uniform in the shader." msgstr "返回在着色器中此 uniform 材质的当前值。" @@ -104127,6 +117693,16 @@ msgid "Removes all collision exceptions for this shape." msgstr "移除该形状的所有碰撞例外。" msgid "" +"Updates the collision information for the shape immediately, without waiting " +"for the next [code]_physics_process[/code] call. Use this method, for " +"example, when the shape or its parent has changed state.\n" +"[b]Note:[/b] [code]enabled == true[/code] is not required for this to work." +msgstr "" +"立即更新形状的碰撞信息,不等待下一次的 [code]_physics_process[/code] 调用。例" +"如,请在形状或其父级更改状态后使用该方法。\n" +"[b]注意:[/b]不需要 [code]enabled == true[/code] 即可生效。" + +msgid "" "The fraction from the [ShapeCast2D]'s origin to its [member target_position] " "(between 0 and 1) of how far the shape can move without triggering a " "collision." @@ -104690,6 +118266,24 @@ msgstr "" msgid "Returns the pose transform of the specified bone." msgstr "返回指定骨骼的姿势变换。" +msgid "" +"Returns the pose position of the bone at [param bone_idx]. The returned " +"[Vector3] is in the local coordinate space of the [Skeleton3D] node." +msgstr "" +"返回骨骼在 [param bone_idx]处的姿势位置。返回的 [Vector3] 位于 [Skeleton3D] 节" +"点的局部坐标空间中。" + +msgid "" +"Returns the pose rotation of the bone at [param bone_idx]. The returned " +"[Quaternion] is local to the bone with respect to the rotation of any parent " +"bones." +msgstr "" +"返回 [param bone_idx] 处骨骼的姿势旋转。返回的 [Quaternion] 是局部于该骨骼的," +"且相对于任何父骨骼的旋转。" + +msgid "Returns the pose scale of the bone at [param bone_idx]." +msgstr "返回 [param bone_idx] 处骨骼的姿态缩放。" + msgid "Returns the rest transform for a bone [param bone_idx]." msgstr "返回骨骼 [param bone_idx] 的放松变换。" @@ -104787,6 +118381,25 @@ msgstr "" "-1,则该骨骼没有父级。\n" "[b]注意:[/b][param parent_idx] 必须小于 [param bone_idx]。" +msgid "" +"Sets the pose position of the bone at [param bone_idx] to [param position]. " +"[param position] is a [Vector3] describing a position local to the " +"[Skeleton3D] node." +msgstr "" +"将 [param bone_idx] 处的骨骼姿势位置设置为 [param position]。[param position] " +"是一个 [Vector3],描述局部于 [Skeleton3D] 节点的位置。" + +msgid "" +"Sets the pose rotation of the bone at [param bone_idx] to [param rotation]. " +"[param rotation] is a [Quaternion] describing a rotation in the bone's local " +"coordinate space with respect to the rotation of any parent bones." +msgstr "" +"将 [param bone_idx] 处骨骼的姿势旋转设置为 [param rotation]。[param rotation] " +"是一个 [Quaternion],描述该骨骼局部坐标空间中相对于任何父骨骼的旋转的旋转。" + +msgid "Sets the pose scale of the bone at [param bone_idx] to [param scale]." +msgstr "将 [param bone_idx] 处骨骼的姿势缩放设置为 [param scale]。" + msgid "Sets the rest transform for bone [param bone_idx]." msgstr "设置骨骼 [param bone_idx] 的放松变换。" @@ -106037,6 +119650,16 @@ msgstr "" "针对人体优化的 [SkeletonProfile] 预设。存在的意义是进行标准化,所以所有参数都" "是只读的。" +msgid "Defines a 3D environment's background by using a [Material]." +msgstr "使用 [Material] 定义 3D 环境的背景。" + +msgid "" +"The [Sky] class uses a [Material] to render a 3D environment's background and " +"the light it emits by updating the reflection/radiance cubemaps." +msgstr "" +"[Sky] 类使用 [Material] 来渲染 3D 环境的背景及其通过更新反射/辐射立方体贴图发" +"出的光。" + msgid "" "Sets the method for generating the radiance map from the sky. The radiance " "map is a cubemap with increasingly blurry versions of the sky corresponding " @@ -106198,6 +119821,9 @@ msgstr "" "布尔常量。如果为 [code]1[/code],则会忽略抓取器纹理的大小,根据其中心位置将其" "缩放到滚动条的边界。" +msgid "Vertical or horizontal offset of the grabber." +msgstr "抓取器的垂直或水平偏移量。" + msgid "The texture for the grabber (the draggable element)." msgstr "用作拖动条的纹理(可拖动的元素)。" @@ -106212,6 +119838,19 @@ msgid "" "than 0." msgstr "刻度的纹理。当 [member Slider.tick_count] 大于 0 时可见。" +msgid "The background of the area to the left or bottom of the grabber." +msgstr "抓取器左侧或底部区域的背景。" + +msgid "" +"The background of the area to the left or bottom of the grabber that displays " +"when it's being hovered or focused." +msgstr "抓取器被悬停或聚焦时,显示的左侧或底部区域的背景。" + +msgid "" +"The background for the whole slider. Affects the height or width of the " +"[theme_item grabber_area]." +msgstr "整个滑动条的背景。影响 [theme_item grabber_area] 的高度或宽度。" + msgid "" "A physics joint that restricts the movement of a 3D physics body along an " "axis relative to another physics body." @@ -106326,6 +119965,14 @@ msgstr "" "physics_introduction.html#collision-layers-and-masks]《碰撞层与掩码》[/url]。" msgid "" +"Higher values will result in a stiffer body, while lower values will increase " +"the body's ability to bend. The value can be between [code]0.0[/code] and " +"[code]1.0[/code] (inclusive)." +msgstr "" +"值越大得到的物体约坚硬,较低的值会提高物体的弯曲能力。取值范围为 [code]0.0[/" +"code] 到 [code]1.0[/code] 之间(含端点)。" + +msgid "" "[NodePath] to a [CollisionObject3D] this SoftBody3D should avoid clipping." msgstr "" "指向 [CollisionObject3D] 的 [NodePath],这个 SoftBody3D 应该避免穿过它。" @@ -106409,6 +120056,65 @@ msgstr "球体的半径。形状的直径是半径的两倍。" msgid "An input field for numbers." msgstr "数字的输入字段。" +msgid "" +"[SpinBox] is a numerical input text field. It allows entering integers and " +"floating point numbers.\n" +"[b]Example:[/b]\n" +"[codeblocks]\n" +"[gdscript]\n" +"var spin_box = SpinBox.new()\n" +"add_child(spin_box)\n" +"var line_edit = spin_box.get_line_edit()\n" +"line_edit.context_menu_enabled = false\n" +"spin_box.horizontal_alignment = LineEdit.HORIZONTAL_ALIGNMENT_RIGHT\n" +"[/gdscript]\n" +"[csharp]\n" +"var spinBox = new SpinBox();\n" +"AddChild(spinBox);\n" +"var lineEdit = spinBox.GetLineEdit();\n" +"lineEdit.ContextMenuEnabled = false;\n" +"spinBox.AlignHorizontal = LineEdit.HorizontalAlignEnum.Right;\n" +"[/csharp]\n" +"[/codeblocks]\n" +"The above code will create a [SpinBox], disable context menu on it and set " +"the text alignment to right.\n" +"See [Range] class for more options over the [SpinBox].\n" +"[b]Note:[/b] With the [SpinBox]'s context menu disabled, you can right-click " +"the bottom half of the spinbox to set the value to its minimum, while right-" +"clicking the top half sets the value to its maximum.\n" +"[b]Note:[/b] [SpinBox] relies on an underlying [LineEdit] node. To theme a " +"[SpinBox]'s background, add theme items for [LineEdit] and customize them.\n" +"[b]Note:[/b] If you want to implement drag and drop for the underlying " +"[LineEdit], you can use [method Control.set_drag_forwarding] on the node " +"returned by [method get_line_edit]." +msgstr "" +"[SpinBox] 是一种用于输入数值的文本字段,允许输入整数和浮点数。\n" +"[b]示例:[/b]\n" +"[codeblocks]\n" +"[gdscript]\n" +"var spin_box = SpinBox.new()\n" +"add_child(spin_box)\n" +"var line_edit = spin_box.get_line_edit()\n" +"line_edit.context_menu_enabled = false\n" +"spin_box.horizontal_alignment = LineEdit.HORIZONTAL_ALIGNMENT_RIGHT\n" +"[/gdscript]\n" +"[csharp]\n" +"var spinBox = new SpinBox();\n" +"AddChild(spinBox);\n" +"var lineEdit = spinBox.GetLineEdit();\n" +"lineEdit.ContextMenuEnabled = false;\n" +"spinBox.AlignHorizontal = LineEdit.HorizontalAlignEnum.Right;\n" +"[/csharp]\n" +"[/codeblocks]\n" +"上面的代码会创建一个 [SpinBox],禁用其中的上下文菜单,并将文本设置为右对齐。\n" +"[SpinBox] 的更多选项见 [Range] 类。\n" +"[b]注意:[/b][SpinBox] 的上下文菜单被禁用时,右键单击微调框的下半部分可以将取" +"值设置最小值,右键单击上半部分可以将取值设置最大值。\n" +"[b]注意:[/b][SpinBox] 依赖底层的 [LineEdit] 节点。要为 [SpinBox] 的背景设置主" +"题,请为 [LineEdit] 添加主题项目并进行自定义。\n" +"[b]注意:[/b]如果你想要为底层的 [LineEdit] 实现拖放,可以对 [method " +"get_line_edit] 所返回的节点使用 [method Control.set_drag_forwarding]。" + msgid "Applies the current value of this [SpinBox]." msgstr "应用此 [SpinBox] 的当前值。" @@ -106428,12 +120134,24 @@ msgid "Changes the alignment of the underlying [LineEdit]." msgstr "更改底层 [LineEdit] 的对齐方式。" msgid "" +"If not [code]0[/code], [member Range.value] will always be rounded to a " +"multiple of [member custom_arrow_step] when interacting with the arrow " +"buttons of the [SpinBox]." +msgstr "" +"如果不是 [code]0[/code],则在与 [SpinBox] 的箭头按钮交互时,[member Range." +"value] 将始终四舍五入为 [member custom_arrow_step] 的倍数。" + +msgid "" "If [code]true[/code], the [SpinBox] will be editable. Otherwise, it will be " "read only." msgstr "" "如果为 [code]true[/code],则 [SpinBox] 将是可编辑的。否则,它将是只读的。" msgid "" +"Adds the specified prefix string before the numerical value of the [SpinBox]." +msgstr "在 [SpinBox] 的数值前添加指定的前缀字符串。" + +msgid "" "If [code]true[/code], the [SpinBox] will select the whole text when the " "[LineEdit] gains focus. Clicking the up and down arrows won't trigger this " "behavior." @@ -106442,6 +120160,10 @@ msgstr "" "本。点击上下箭头不会触发这种行为。" msgid "" +"Adds the specified suffix string after the numerical value of the [SpinBox]." +msgstr "在 [SpinBox] 的数值后添加指定的后缀字符串。" + +msgid "" "Sets the value of the [Range] for this [SpinBox] when the [LineEdit] text is " "[i]changed[/i] instead of [i]submitted[/i]. See [signal LineEdit." "text_changed] and [signal LineEdit.text_submitted]." @@ -107104,6 +120826,9 @@ msgstr "" "设置 [param anim] 动画中索引为 [param idx] 的帧的纹理 [param texture] 和持续时" "间 [param duration]。" +msgid "A PBR (Physically Based Rendering) material to be used on 3D objects." +msgstr "用于 3D 对象的 PBR(基于物理的渲染)材质。" + msgid "" "[StandardMaterial3D]'s properties are inherited from [BaseMaterial3D]. " "[StandardMaterial3D] uses separate textures for ambient occlusion, roughness " @@ -107120,6 +120845,30 @@ msgid "" msgstr "无法被外力移动的 2D 物理物体。手动移动时不会影响路径上的其他物体。" msgid "" +"A static 2D physics body. It can't be moved by external forces or contacts, " +"but can be moved manually by other means such as code, [AnimationMixer]s " +"(with [member AnimationMixer.callback_mode_process] set to [constant " +"AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_PHYSICS]), and " +"[RemoteTransform2D].\n" +"When [StaticBody2D] is moved, it is teleported to its new position without " +"affecting other physics bodies in its path. If this is not desired, use " +"[AnimatableBody2D] instead.\n" +"[StaticBody2D] is useful for completely static objects like floors and walls, " +"as well as moving surfaces like conveyor belts and circular revolving " +"platforms (by using [member constant_linear_velocity] and [member " +"constant_angular_velocity])." +msgstr "" +"静态 2D 物理体。无法因外力或接触而移动,但可以通过代码、[AnimationMixer]" +"([member AnimationMixer.callback_mode_process] 设为 [constant AnimationMixer." +"ANIMATION_CALLBACK_MODE_PROCESS_PHYSICS])、[RemoteTransform2D] 等方法手动移" +"动。\n" +"[StaticBody2D] 发生移动时,是传送到新位置上的,不会影响路径上的其他物理体。如" +"果不想要这样的行为,请改用 [AnimatableBody2D]。\n" +"[StaticBody2D] 常用于完全静态的地板、墙壁等对象,也可以用于传送带、圆形回转平" +"台等移动的表面(使用 [member constant_linear_velocity] 和 [member " +"constant_angular_velocity])。" + +msgid "" "The body's constant angular velocity. This does not rotate the body, but " "affects touching bodies, as if it were rotating." msgstr "" @@ -107138,6 +120887,30 @@ msgid "" "manually, it doesn't affect other bodies in its path." msgstr "无法被外力移动的 3D 物理物体。手动移动时不会影响路径上的其他物体。" +msgid "" +"A static 3D physics body. It can't be moved by external forces or contacts, " +"but can be moved manually by other means such as code, [AnimationMixer]s " +"(with [member AnimationMixer.callback_mode_process] set to [constant " +"AnimationMixer.ANIMATION_CALLBACK_MODE_PROCESS_PHYSICS]), and " +"[RemoteTransform3D].\n" +"When [StaticBody3D] is moved, it is teleported to its new position without " +"affecting other physics bodies in its path. If this is not desired, use " +"[AnimatableBody3D] instead.\n" +"[StaticBody3D] is useful for completely static objects like floors and walls, " +"as well as moving surfaces like conveyor belts and circular revolving " +"platforms (by using [member constant_linear_velocity] and [member " +"constant_angular_velocity])." +msgstr "" +"静态 3D 物理体。无法因外力或接触而移动,但可以通过代码、[AnimationMixer]" +"([member AnimationMixer.callback_mode_process] 设为 [constant AnimationMixer." +"ANIMATION_CALLBACK_MODE_PROCESS_PHYSICS])、[RemoteTransform3D] 等方法手动移" +"动。\n" +"[StaticBody3D] 发生移动时,是传送到新位置上的,不会影响路径上的其他物理体。如" +"果不想要这样的行为,请改用 [AnimatableBody3D]。\n" +"[StaticBody3D] 常用于完全静态的地板、墙壁等对象,也可以用于传送带、圆形回转平" +"台等移动的表面(使用 [member constant_linear_velocity] 和 [member " +"constant_angular_velocity])。" + msgid "Abstract base class for interacting with streams." msgstr "与流交互的抽象基类。" @@ -109746,6 +123519,35 @@ msgid "Test a position in a rectangle, return whether it passes the mask test." msgstr "测试矩形中的一个位置,返回它是否通过掩码测试。" msgid "" +"The bottom margin for the contents of this style box. Increasing this value " +"reduces the space available to the contents from the bottom.\n" +"If this value is negative, it is ignored and a child-specific margin is used " +"instead. For example, for [StyleBoxFlat], the border thickness (if any) is " +"used instead.\n" +"It is up to the code using this style box to decide what these contents are: " +"for example, a [Button] respects this content margin for the textual contents " +"of the button.\n" +"[method get_margin] should be used to fetch this value as consumer instead of " +"reading these properties directly. This is because it correctly respects " +"negative values and the fallback mentioned above." +msgstr "" +"该样式盒内容的底边距。增加该值会从底部减少内容的可用空间。\n" +"如果该值为负,则忽略该值并使用特定于子项的边距。例如,对于 [StyleBoxFlat]," +"(如果有厚度的话)将使用边框厚度。\n" +"内容是什么由使用该样式盒的代码决定:例如,[Button] 会为其文本内容设置该内容边" +"距。\n" +"应使用 [method get_margin] 作为消费者获取该值,而不是直接读取这些属性。这是因" +"为它能够正确地尊重负值和上面提到的后备值。" + +msgid "" +"The left margin for the contents of this style box. Increasing this value " +"reduces the space available to the contents from the left.\n" +"Refer to [member content_margin_bottom] for extra considerations." +msgstr "" +"该样式盒内容的左边距。增加该值会从左侧减少内容的可用空间。\n" +"额外的注意事项请参阅 [member content_margin_bottom]。" + +msgid "" "The right margin for the contents of this style box. Increasing this value " "reduces the space available to the contents from the right.\n" "Refer to [member content_margin_bottom] for extra considerations." @@ -110323,6 +124125,16 @@ msgstr "" "口。" msgid "" +"Virtual method to be implemented by the user. If it returns [code]true[/" +"code], the [param event] is propagated to [SubViewport] children. Propagation " +"doesn't happen if it returns [code]false[/code]. If the function is not " +"implemented, all events are propagated to SubViewports." +msgstr "" +"由用户实现的虚方法。如果它返回 [code]true[/code],则 [param event] 将被传播到 " +"[SubViewport] 子级。如果返回 [code]false[/code],则传播不会发生。如果未实现该" +"功能,则所有事件都会被传播到子视口。" + +msgid "" "If [code]true[/code], the sub-viewport will be automatically resized to the " "control's size.\n" "[b]Note:[/b] If [code]true[/code], this will prohibit changing [member " @@ -111003,6 +124815,20 @@ msgid "Removes the tab at index [param tab_idx]." msgstr "删除索引 [param tab_idx] 处的选项卡。" msgid "" +"Selects the first available tab with greater index than the currently " +"selected. Returns [code]true[/code] if tab selection changed." +msgstr "" +"选择索引大于当前所选选项卡索引的第一个可用选项卡。如果选项卡选择发生改变,则返" +"回 [code]true[/code]。" + +msgid "" +"Selects the first available tab with lower index than the currently selected. " +"Returns [code]true[/code] if tab selection changed." +msgstr "" +"选择索引低于当前所选选项卡索引的第一个可用选项卡。如果选项卡选择发生改变,则返" +"回 [code]true[/code]。" + +msgid "" "Sets an [param icon] for the button of the tab at index [param tab_idx] " "(located to the right, before the close button), making it visible and " "clickable (See [signal tab_button_pressed]). Giving it a [code]null[/code] " @@ -111165,6 +124991,13 @@ msgid "" "Emitted when a tab is right-clicked. [member select_with_rmb] must be enabled." msgstr "右键单击选项卡时发出。必须启用 [member select_with_rmb]。" +msgid "" +"Emitted when a tab is selected via click, directional input, or script, even " +"if it is the current tab." +msgstr "" +"通过点击、定向输入、或脚本选中某个选项卡时发出,即便该选项卡本来就是当前选项" +"卡。" + msgid "Places tabs to the left." msgstr "将选项卡置于左侧。" @@ -111290,6 +125123,31 @@ msgstr "选项卡和关闭按钮的背景,处于按下状态时使用。" msgid "The style of disabled tabs." msgstr "选项卡处于禁用状态时的样式。" +msgid "" +"[StyleBox] used when the [TabBar] is focused. The [theme_item tab_focus] " +"[StyleBox] is displayed [i]over[/i] the base [StyleBox] of the selected tab, " +"so a partially transparent [StyleBox] should be used to ensure the base " +"[StyleBox] remains visible. A [StyleBox] that represents an outline or an " +"underline works well for this purpose. To disable the focus visual effect, " +"assign a [StyleBoxEmpty] resource. Note that disabling the focus visual " +"effect will harm keyboard/controller navigation usability, so this is not " +"recommended for accessibility reasons." +msgstr "" +"该 [TabBar] 处于聚焦状态时使用的 [StyleBox]。[theme_item tab_focus] " +"[StyleBox] 显示在基础 [StyleBox] [i]之上[/i],所以应该使用部分透明的 " +"[StyleBox],确保基础 [StyleBox] 仍然可见。代表轮廓或下划线的 [StyleBox] 可以很" +"好地实现这个目的。要禁用聚焦的视觉效果,请指定 [StyleBoxEmpty] 资源。请注意," +"禁用聚焦的视觉效果会影响使用键盘/手柄进行导航的可用性,所以出于可访问性的原" +"因,不建议这样做。" + +msgid "" +"The style of the currently hovered tab. Does not apply to the selected tab.\n" +"[b]Note:[/b] This style will be drawn with the same width as [theme_item " +"tab_unselected] at minimum." +msgstr "" +"当前悬停选项卡的样式。不适用于选择的选项卡。\n" +"[b]注意:[/b]该样式将以至少与 [theme_item tab_unselected] 相同的宽度绘制。" + msgid "The style of the currently selected tab." msgstr "当前选中的选项卡的样式。" @@ -111487,6 +125345,14 @@ msgstr "当光标悬停时菜单按钮的图标(见 [method set_popup])。" msgid "The style for the background fill." msgstr "背景填充的样式。" +msgid "" +"The style of the currently hovered tab.\n" +"[b]Note:[/b] This style will be drawn with the same width as [theme_item " +"tab_unselected] at minimum." +msgstr "" +"当前悬停的选项卡的样式。\n" +"[b]注意:[/b]该样式将至少以与 [theme_item tab_unselected] 相同的宽度绘制。" + msgid "The style for the background fill of the [TabBar] area." msgstr "[TabBar] 区域的背景填充样式。" @@ -112403,6 +126269,9 @@ msgstr "如果有一个水平滚动条,这决定了当前的水平滚动值, msgid "Allow scrolling past the last line into \"virtual\" space." msgstr "允许滚动过最后一行,进入“虚拟”空间。" +msgid "Scroll smoothly over the text rather than jumping to the next location." +msgstr "在文本上平滑滚动,而不是跳到下一个位置。" + msgid "" "Sets the scroll speed with the minimap or when [member scroll_smooth] is " "enabled." @@ -112600,6 +126469,22 @@ msgstr "为空格文本字符,设置一个自定义 [Texture2D]。" msgid "Sets a custom [Texture2D] for tab text characters." msgstr "为制表符文本字符,设置一个自定义 [Texture2D]。" +msgid "" +"Sets the [StyleBox] when in focus. The [theme_item focus] [StyleBox] is " +"displayed [i]over[/i] the base [StyleBox], so a partially transparent " +"[StyleBox] should be used to ensure the base [StyleBox] remains visible. A " +"[StyleBox] that represents an outline or an underline works well for this " +"purpose. To disable the focus visual effect, assign a [StyleBoxEmpty] " +"resource. Note that disabling the focus visual effect will harm keyboard/" +"controller navigation usability, so this is not recommended for accessibility " +"reasons." +msgstr "" +"设置当获得焦点时的 [StyleBox]。该 [theme_item focus] [StyleBox] 显示在基础 " +"[StyleBox] [i]之上[/i],因此应使用部分透明的 [StyleBox] 以确保基础 [StyleBox] " +"保持可见。表示轮廓或下划线的 [StyleBox] 非常适合此目的。要禁用焦点视觉效果,请" +"指定一个 [StyleBoxEmpty] 资源。请注意,禁用焦点视觉效果会破坏键盘 / 控制器导航" +"的可用性,出于可访问性原因,不建议这样做。" + msgid "Sets the [StyleBox] of this [TextEdit]." msgstr "设置这个 [TextEdit] 的 [StyleBox]。" @@ -112924,6 +126809,14 @@ msgstr "" "新建空的字体缓存条目资源。要释放生成的资源,请使用 [method free_rid] 方法。" msgid "" +"Creates a new variation existing font which is reusing the same glyph cache " +"and font data. To free the resulting resource, use the [method free_rid] " +"method." +msgstr "" +"创建一个新的已有的字体变体,该字体重用相同的字形缓存和字体数据。要释放生成的资" +"源,请使用 [method free_rid] 方法。" + +msgid "" "Creates new buffer for complex text layout, with the given [param direction] " "and [param orientation]. To free the resulting buffer, use [method free_rid] " "method.\n" @@ -113006,12 +126899,12 @@ msgstr "" msgid "Returns font embolden strength." msgstr "返回字体的加粗力度。" -msgid "Recturns an active face index in the TrueType / OpenType collection." -msgstr "返回 TrueType / OpenType 集合中的活动字体索引。" - msgid "Returns bitmap font fixed size." msgstr "返回位图字体的固定大小。" +msgid "Returns bitmap font scaling mode." +msgstr "返回位图字体的缩放模式。" + msgid "Returns [code]true[/code] if font texture mipmap generation is enabled." msgstr "如果启用了字体纹理 mipmap 生成,则返回 [code]true[/code]。" @@ -113019,6 +126912,32 @@ msgid "" "Returns the font oversampling factor, shared by all fonts in the TextServer." msgstr "返回字体过采样系数,由 TextServer 中的所有字体共享。" +msgid "" +"Returns outline contours of the glyph as a [Dictionary] with the following " +"contents:\n" +"[code]points[/code] - [PackedVector3Array], containing outline " +"points. [code]x[/code] and [code]y[/code] are point coordinates. [code]z[/" +"code] is the type of the point, using the [enum ContourPointTag] values.\n" +"[code]contours[/code] - [PackedInt32Array], containing indices the end " +"points of each contour.\n" +"[code]orientation[/code] - [bool], contour orientation. If [code]true[/" +"code], clockwise contours must be filled." +msgstr "" +"将字形的轮廓线轮廓返回为具有以下内容的 [Dictionary]:\n" +"[code]points[/code] - [PackedVector3Array],包含轮廓点。[code]x[/" +"code] 和 [code]y[/code] 是点坐标。[code]z[/code] 是点的类型,使用 [enum " +"ContourPointTag] 值。\n" +"[code]contours[/code] - [PackedInt32Array],包含每个轮廓端点的索引。\n" +"[code]orientation[/code] - [bool],轮廓方向。如果为 [code]true[/code],则顺" +"时针轮廓必须被填充。" + +msgid "" +"Returns the glyph index of a [param char], optionally modified by the [param " +"variation_selector]. See [method font_get_char_from_glyph_index]." +msgstr "" +"返回 [param char] 的字形索引,可以选择由 [param variation_selector] 进行修改。" +"见 [method font_get_char_from_glyph_index]。" + msgid "Returns size of the glyph." msgstr "返回该字形的大小。" @@ -113153,6 +127072,12 @@ msgstr "" "条目。" msgid "" +"Sets bitmap font scaling mode. This property is used only if " +"[code]fixed_size[/code] is greater than zero." +msgstr "" +"设置位图字体缩放模式。仅当 [code]fixed_size[/code] 大于零时才使用该属性。" + +msgid "" "If set to [code]true[/code] auto-hinting is preferred over font built-in " "hinting." msgstr "" @@ -114176,12 +128101,30 @@ msgstr "文件路径的 BiDi 覆盖。" msgid "BiDi override for email." msgstr "电子邮件的 BiDi 覆盖。" +msgid "" +"BiDi override for lists. Structured text options: list separator [String]." +msgstr "列表的 BiDi 覆盖。结构化文本选项:列表分隔符 [String]。" + msgid "BiDi override for GDScript." msgstr "GDScript 的 BiDi 覆盖。" msgid "User defined structured text BiDi override function." msgstr "用户定义的结构化文本 BiDi 覆盖函数。" +msgid "Bitmap font is not scaled." +msgstr "位图字体未被缩放。" + +msgid "" +"Bitmap font is scaled to the closest integer multiple of the font's fixed " +"size. This is the recommended option for pixel art fonts." +msgstr "" +"位图字体被缩放至字体固定大小的最接近整数倍。这是像素艺术字体的推荐选项。" + +msgid "" +"Bitmap font is scaled to an arbitrary (fractional) size. This is the " +"recommended option for non-pixel art fonts." +msgstr "位图字体被缩放为任意(分数)大小。这是非像素艺术字体的推荐选项。" + msgid "" "An advanced text server with support for BiDi, complex text layout, and " "contextual OpenType features. Used in Godot by default." @@ -114477,9 +128420,23 @@ msgid "" msgstr "用于 2D 的纹理数组,与 [RenderingDevice] 上创建的纹理绑定。" msgid "" +"This texture array class allows you to use a 2D array texture created " +"directly on the [RenderingDevice] as a texture for materials, meshes, etc." +msgstr "" +"该纹理数组类允许你使用直接在 [RenderingDevice] 上创建的 2D 数组纹理作为材质、" +"网格等的纹理。" + +msgid "" "Texture for 2D that is bound to a texture created on the [RenderingDevice]." msgstr "用于 2D 的纹理,与 [RenderingDevice] 上创建的纹理绑定。" +msgid "" +"This texture class allows you to use a 2D texture created directly on the " +"[RenderingDevice] as a texture for materials, meshes, etc." +msgstr "" +"该纹理类允许你使用直接在 [RenderingDevice] 上创建的 2D 纹理作为材质、网格等的" +"纹理。" + msgid "The RID of the texture object created on the [RenderingDevice]." msgstr "[RenderingDevice] 上创建的纹理对象的 RID。" @@ -114556,6 +128513,17 @@ msgid "Returns [code]true[/code] if the [Texture3D] has generated mipmaps." msgstr "如果该 [Texture3D] 已生成 mipmap,则返回 [code]true[/code]。" msgid "" +"Texture for 3D that is bound to a texture created on the [RenderingDevice]." +msgstr "被绑定到在 [RenderingDevice] 上创建的纹理的 3D 的纹理。" + +msgid "" +"This texture class allows you to use a 3D texture created directly on the " +"[RenderingDevice] as a texture for materials, meshes, etc." +msgstr "" +"该纹理类允许你使用直接在 [RenderingDevice] 上创建的 3D 纹理作为材质、网格等的" +"纹理。" + +msgid "" "Texture-based button. Supports Pressed, Hover, Disabled and Focused states." msgstr "基于纹理的按钮。支持按下、悬停、停用和焦点状态。" @@ -114667,6 +128635,30 @@ msgid "" msgstr "缩放纹理,使较短的一边适应边界矩形。另一边则裁剪到节点的界限内。" msgid "" +"Texture Array for Cubemaps that is bound to a texture created on the " +"[RenderingDevice]." +msgstr "立方体贴图的纹理数组,被绑定到在 [RenderingDevice] 上创建的纹理。" + +msgid "" +"This texture class allows you to use a cubemap array texture created directly " +"on the [RenderingDevice] as a texture for materials, meshes, etc." +msgstr "" +"该纹理类允许你使用直接在 [RenderingDevice] 上创建的立方体贴图数组纹理作为材" +"质、网格等的纹理。" + +msgid "" +"Texture for Cubemap that is bound to a texture created on the " +"[RenderingDevice]." +msgstr "被绑定到在 [RenderingDevice] 上创建的纹理的立方体贴图的纹理。" + +msgid "" +"This texture class allows you to use a cubemap texture created directly on " +"the [RenderingDevice] as a texture for materials, meshes, etc." +msgstr "" +"该纹理类允许你使用直接在 [RenderingDevice] 上创建的立方体贴图纹理作为材质、网" +"格等的纹理。" + +msgid "" "Base class for texture types which contain the data of multiple [Image]s. " "Each image is of the same size and format." msgstr "包含多个 [Image] 的纹理类型的基类。每个图像的大小和格式都是一样的。" @@ -114746,6 +128738,17 @@ msgstr "纹理为 [Cubemap],每一面都有自己的层(共 6 层)。" msgid "Texture is a [CubemapArray], with each cubemap being made of 6 layers." msgstr "纹理为 [CubemapArray],每个立方体贴图都由 6 层组成。" +msgid "Abstract base class for layered texture RD types." +msgstr "分层纹理 RD 类型的抽象基类。" + +msgid "" +"Base class for [Texture2DArrayRD], [TextureCubemapRD] and " +"[TextureCubemapArrayRD]. Cannot be used directly, but contains all the " +"functions necessary for accessing the derived resource types." +msgstr "" +"[Texture2DArrayRD]、[TextureCubemapRD] 和 [TextureCubemapArrayRD] 的基类。不能" +"直接使用,但包含了访问派生资源类型所需的所有函数。" + msgid "" "Texture-based progress bar. Useful for loading screens and life or stamina " "bars." @@ -114861,6 +128864,20 @@ msgstr "" msgid "[Texture2D] that draws under the progress bar. The bar's background." msgstr "在进度条下绘制的 [Texture2D]。该进度条的背景。" +msgid "" +"Multiplies the color of the bar's [member texture_over] texture. The effect " +"is similar to [member CanvasItem.modulate], except it only affects this " +"specific texture instead of the entire node." +msgstr "" +"将与该进度条的 [member texture_over] 纹理的颜色相乘。其效果类似于 [member " +"CanvasItem.modulate] ,只是它只影响这个特定的纹理,而不是整个节点。" + +msgid "Multiplies the color of the bar's [member texture_progress] texture." +msgstr "将与该进度条的 [member texture_progress] 纹理的颜色相乘。" + +msgid "Multiplies the color of the bar's [member texture_under] texture." +msgstr "将与该进度条的 [member texture_under] 纹理的颜色相乘。" + msgid "The [member texture_progress] fills from left to right." msgstr "[member texture_progress] 从左到右填充。" @@ -115748,6 +129765,27 @@ msgid "A unit of execution in a process." msgstr "进程中的执行单元。" msgid "" +"A unit of execution in a process. Can run methods on [Object]s " +"simultaneously. The use of synchronization via [Mutex] or [Semaphore] is " +"advised if working with shared objects.\n" +"[b]Warning:[/b]\n" +"To ensure proper cleanup without crashes or deadlocks, when a [Thread]'s " +"reference count reaches zero and it is therefore destroyed, the following " +"conditions must be met:\n" +"- It must not have any [Mutex] objects locked.\n" +"- It must not be waiting on any [Semaphore] objects.\n" +"- [method wait_to_finish] should have been called on it." +msgstr "" +"进程中的执行单元。可以让任意 [Object] 上的任意方法同时运行。如果使用共享对象," +"建议通过 [Mutex] 或 [Semaphore] 进行同步。\n" +"[b]警告:[/b]\n" +"为了确保能够正确清理,避免崩溃和死锁,[Thread] 的引用计数变为零进行销毁时,必" +"须满足以下条件:\n" +"- 必须没有任何上锁的 [Mutex] 对象。\n" +"- 必须没有在任何 [Semaphore] 对象上等待。\n" +"- 必须已调用过它的 [method wait_to_finish]。" + +msgid "" "Returns the current [Thread]'s ID, uniquely identifying it among all threads. " "If the [Thread] has not started running or if [method wait_to_finish] has " "been called, this returns an empty string." @@ -116038,6 +130076,22 @@ msgstr "任何属性发生变化时发出。" msgid "Node for 2D tile-based maps." msgstr "基于 2D 图块的地图节点。" +msgid "" +"Node for 2D tile-based maps. Tilemaps use a [TileSet] which contain a list of " +"tiles which are used to create grid-based maps. A TileMap may have several " +"layers, layouting tiles on top of each other.\n" +"For performance reasons, all TileMap updates are batched at the end of a " +"frame. Notably, this means that scene tiles from a " +"[TileSetScenesCollectionSource] may be initialized after their parent.\n" +"To force an update earlier on, call [method update_internals]." +msgstr "" +"基于 2D 图块的地图节点。Tilemap(图块地图)使用 [TileSet],其中包含了图块的列" +"表,用于创建基于栅格的地图。TileMap 可以有若干图层,可以将图块布局在彼此之" +"上。\n" +"出于性能原因,所有 TileMap 更新都会在一帧结束时进行批处理。值得注意的是,这意" +"味着 [TileSetScenesCollectionSource] 中的场景图块可能会在其父级之后初始化。\n" +"要提前强制更新,请调用 [method update_internals]。" + msgid "Using Tilemaps" msgstr "使用 Tilemap" @@ -116045,6 +130099,43 @@ msgid "2D Hexagonal Demo" msgstr "2D 六边形演示" msgid "" +"Called with a TileData object about to be used internally by the TileMap, " +"allowing its modification at runtime.\n" +"This method is only called if [method _use_tile_data_runtime_update] is " +"implemented and returns [code]true[/code] for the given tile [param coords] " +"and [param layer].\n" +"[b]Warning:[/b] The [param tile_data] object's sub-resources are the same as " +"the one in the TileSet. Modifying them might impact the whole TileSet. " +"Instead, make sure to duplicate those resources.\n" +"[b]Note:[/b] If the properties of [param tile_data] object should change over " +"time, use [method notify_runtime_tile_data_update] to notify the TileMap it " +"needs an update." +msgstr "" +"会使用 TileMap 内部即将使用的 TileData 对象来调用,从而实现运行时修改。\n" +"这个方法被调用的前提是:实现了 [method _use_tile_data_runtime_update],并且对" +"给定的图块坐标 [param coords] 和层 [param layer] 返回 [code]true[/code] 。\n" +"[b]警告:[/b]该 [param tile_data] 对象的子资源和 TileSet 中的子资源是一样的。" +"对它们进行修改可能会影响整个 TileSet。请确保制作这些资源的副本再进行修改。\n" +"[b]注意:[/b]如果 [param tile_data] 对象的属性要随时间变化,请使用 [method " +"notify_runtime_tile_data_update] 来通知该 TileMap 它需要更新。" + +msgid "" +"Should return [code]true[/code] if the tile at coordinates [param coords] on " +"layer [param layer] requires a runtime update.\n" +"[b]Warning:[/b] Make sure this function only return [code]true[/code] when " +"needed. Any tile processed at runtime without a need for it will imply a " +"significant performance penalty.\n" +"[b]Note:[/b] If the result of this function should changed, use [method " +"notify_runtime_tile_data_update] to notify the TileMap it needs an update." +msgstr "" +"如果位于层 [param layer] 坐标 [param coords] 的图块需要运行时更新,则应返回 " +"[code]true[/code]。\n" +"[b]警告:[/b]请确保这个函数只在需要时返回 [code]true[/code]。任何在没有需要的" +"情况下在运行时处理的图块都将导致显著的性能损失。\n" +"[b]注意:[/b]如果该函数的结果发生变化,请使用 [method " +"notify_runtime_tile_data_update] 通知 TileMap 它需要更新。" + +msgid "" "Adds a layer at the given position [param to_position] in the array. If " "[param to_position] is negative, the position is counted from the end, with " "[code]-1[/code] adding the layer at the end of the array." @@ -116286,6 +130377,9 @@ msgstr "" "返回某个图层是否已启用。\n" "如果 [param layer] 为负,则从最后一个图层开始访问。" +msgid "Returns if a layer's built-in navigation regions generation is enabled." +msgstr "返回是否启用图层的内置导航区块生成。" + msgid "" "Returns if a layer Y-sorts its tiles.\n" "If [param layer] is negative, the layers are accessed from the last one." @@ -116333,6 +130427,29 @@ msgid "" msgstr "" "将索引 [param layer] 处的图层移动到数组中给定的位置 [param to_position]。" +msgid "" +"Notifies the TileMap node that calls to [method " +"_use_tile_data_runtime_update] or [method _tile_data_runtime_update] will " +"lead to different results. This will thus trigger a TileMap update.\n" +"If [param layer] is provided, only notifies changes for the given layer. " +"Providing the [param layer] argument (when applicable) is usually preferred " +"for performance reasons.\n" +"[b]Warning:[/b] Updating the TileMap is computationally expensive and may " +"impact performance. Try to limit the number of calls to this function to " +"avoid unnecessary update.\n" +"[b]Note:[/b] This does not trigger a direct update of the TileMap, the update " +"will be done at the end of the frame as usual (unless you call [method " +"update_internals])." +msgstr "" +"通知 TileMap 节点调用 [method _use_tile_data_runtime_update] 或 [method " +"_tile_data_runtime_update] 将导致不同的结果。这将因此触发 TileMap 更新。\n" +"如果提供了 [param layer],则仅通知给定层的更改。出于性能原因,通常首选提供 " +"[param layer] 参数(如果适用)。\n" +"[b]警告:[/b]更新 TileMap 的计算成本很高,并且可能会影响性能。尝试限制该函数的" +"调用次数,以避免不必要的更新。\n" +"[b]注意:[/b]这不会触发 TileMap 的直接更新,该更新将照常在帧结束时完成(除非你" +"调用 [method update_internals])。" + msgid "Removes the layer at index [param layer]." msgstr "移除索引为 [param layer] 的层。" @@ -116441,6 +130558,14 @@ msgstr "" "如果 [param layer] 为负,则逆序访问图层。" msgid "" +"Enables or disables a layer's built-in navigation regions generation. Disable " +"this if you need to bake navigation regions from a TileMap using a " +"[NavigationRegion2D] node." +msgstr "" +"启用或禁用图层的内置导航区块生成。如果你需要使用 [NavigationRegion2D] 节点根" +"据 TileMap 烘焙导航区块,请禁用此项。" + +msgid "" "Assigns a [NavigationServer2D] navigation map [RID] to the specified TileMap " "[param layer].\n" "By default the TileMap uses the default [World2D] navigation map for the " @@ -116788,6 +130913,13 @@ msgstr "返回给定 TileSet 导航层的(导航服务器中的)导航层。 msgid "Returns the navigation layers count." msgstr "返回导航层的数量。" +msgid "" +"Returns a new unused source ID. This generated ID is the same that a call to " +"[method add_source] would return." +msgstr "" +"返回新的未使用的源 ID。这个生成的 ID 与调用 [method add_source] 将返回的 ID 相" +"同。" + msgid "Returns the light mask of the occlusion layer." msgstr "返回遮挡层的光照掩码。" @@ -117272,6 +131404,15 @@ msgid "" msgstr "在坐标 [param atlas_coords] 处新建给定大小 [param size] 的图块。" msgid "" +"Returns the atlas grid size, which depends on how many tiles can fit in the " +"texture. It thus depends on the [member texture]'s size, the atlas [member " +"margins], and the tiles' [member texture_region_size]." +msgstr "" +"返回图集栅格大小,这取决于纹理中可以容纳多少个图块。因此,它取决于 [member " +"texture] 的大小,该图集的 [member margins]、和该图块的 [member " +"texture_region_size]。" + +msgid "" "Returns the alternative ID a following call to [method " "create_alternative_tile] would return." msgstr "返回后续调用 [method create_alternative_tile] 时将返回的备选 ID。" @@ -117749,6 +131890,23 @@ msgid "" msgstr "将给定的 Unix 时间戳转换为 ISO 8601 日期字符串(YYYY-MM-DD)。" msgid "" +"Converts the given ISO 8601 date and time string (YYYY-MM-DDTHH:MM:SS) to a " +"dictionary of keys: [code]year[/code], [code]month[/code], [code]day[/code], " +"[code skip-lint]weekday[/code], [code]hour[/code], [code]minute[/code], and " +"[code]second[/code].\n" +"If [param weekday] is [code]false[/code], then the [code skip-lint]weekday[/" +"code] entry is excluded (the calculation is relatively expensive).\n" +"[b]Note:[/b] Any decimal fraction in the time string will be ignored silently." +msgstr "" +"将给定的 ISO 8601 日期和时间字符串(YYYY-MM-DDTHH:MM:SS)转换为字典,包含的键" +"为:[code]year[/code]、[code]month[/code]、[code]day[/code]、[code skip-" +"lint]weekday[/code]、[code]hour[/code]、[code]minute[/code]、[code]second[/" +"code]。\n" +"当 [param weekday] 为 [code]false[/code] 时,不包含 [code skip-lint]weekday[/" +"code] 记录(计算花费相对较大)。\n" +"[b]注意:[/b]时间字符串中的小数会被静默忽略。" + +msgid "" "Returns the current date as a dictionary of keys: [code]year[/code], " "[code]month[/code], [code]day[/code], [code]weekday[/code], [code]hour[/" "code], [code]minute[/code], [code]second[/code], and [code]dst[/code] " @@ -117874,6 +132032,20 @@ msgid "Converts the given Unix timestamp to an ISO 8601 time string (HH:MM:SS)." msgstr "将给定的 Unix 时间戳转换为 ISO 8601 时间字符串(HH:MM:SS)。" msgid "" +"Returns the current time zone as a dictionary of keys: [code]bias[/code] and " +"[code]name[/code]. \n" +"- [code]bias[/code] is the offset from UTC in minutes, since not all time " +"zones are multiples of an hour from UTC.\n" +"- [code]name[/code] is the localized name of the time zone, according to the " +"OS locale settings of the current user." +msgstr "" +"以字典的形式返回当前时区,包含的键为:[code]bias[/code] 和 [code]name[/" +"code]。\n" +"- [code]bias[/code] 是相对于 UTC 的偏移量,单位为分钟,因为并不是所有时区与 " +"UTC 的时间差都是整数倍小时。\n" +"- [code]name[/code] 是时区的本地化名称,取决于当前用户的操作系统区域设置。" + +msgid "" "Converts a dictionary of time values to a Unix timestamp.\n" "The given dictionary can be populated with the following keys: [code]year[/" "code], [code]month[/code], [code]day[/code], [code]hour[/code], [code]minute[/" @@ -118125,6 +132297,23 @@ msgstr "" "[/codeblocks]" msgid "" +"Creates a TLS client configuration which validates certificates and their " +"common names (fully qualified domain names).\n" +"You can specify a custom [param trusted_chain] of certification authorities " +"(the default CA list will be used if [code]null[/code]), and optionally " +"provide a [param common_name_override] if you expect the certificate to have " +"a common name other than the server FQDN.\n" +"[b]Note:[/b] On the Web platform, TLS verification is always enforced against " +"the CA list of the web browser. This is considered a security feature." +msgstr "" +"创建 TLS 客户端配置,验证证书及其通用名称(完整域名)。\n" +"你可以指定自定义的证书颁发机构信任链 [param trusted_chain](如果为 " +"[code]null[/code] 则使用默认 CA 列表)。如果你希望证书拥有服务器 FQDN 之外的通" +"用名称,还可以提供通用名称覆盖 [param common_name_override]。\n" +"[b]注意:[/b]在 Web 平台上,TLS 验证始终强制使用 Web 浏览器的 CA 列表。这是一" +"种安全特性。" + +msgid "" "Creates an [b]unsafe[/b] TLS client configuration where certificate " "validation is optional. You can optionally provide a valid [param " "trusted_chain], but the common name of the certificates will never be " @@ -118269,6 +132458,37 @@ msgstr "" "构建变换。" msgid "" +"Returns the inverse of the transform, under the assumption that the basis is " +"invertible (must have non-zero determinant)." +msgstr "假设该基可逆(必须具有非零行列式),返回该变换的逆。" + +msgid "" +"Returns a vector transformed (multiplied) by the basis matrix.\n" +"This method does not account for translation (the [member origin] vector)." +msgstr "" +"返回经过基矩阵变换(相乘)的向量。\n" +"该方法不考虑平移([member origin] 向量)。" + +msgid "" +"Returns a vector transformed (multiplied) by the inverse basis matrix, under " +"the assumption that the basis is orthonormal (i.e. rotation/reflection is " +"fine, scaling/skew is not).\n" +"This method does not account for translation (the [member origin] vector).\n" +"[code]transform.basis_xform_inv(vector)[/code] is equivalent to " +"[code]transform.inverse().basis_xform(vector)[/code]. See [method inverse].\n" +"For non-orthonormal transforms (e.g. with scaling) [code]transform." +"affine_inverse().basis_xform(vector)[/code] can be used instead. See [method " +"affine_inverse]." +msgstr "" +"返回一个由逆基矩阵变换(乘以)的向量,假设该基是正交的(即旋转/反射可以,缩放/" +"倾斜不行)。\n" +"该方法不考虑翻译([member origin] 向量)。\n" +"[code]transform.basis_xform_inv(vector)[/code] 性当于 [code]transform." +"inverse().basis_xform(vector)[/code]。请参阅 [method inverse]。\n" +"对于非正交变换(例如缩放),可以使用 [code]transform.affine_inverse()." +"basis_xform(vector)[/code] 代替。请参阅 [method affine_inverse]。" + +msgid "" "Returns the determinant of the basis matrix. If the basis is uniformly " "scaled, then its determinant equals the square of the scale factor.\n" "A negative determinant means the basis was flipped, so one part of the scale " @@ -118299,6 +132519,36 @@ msgstr "" "0.0 到 1.0)。" msgid "" +"Returns the inverse of the transform, under the assumption that the " +"transformation basis is orthonormal (i.e. rotation/reflection is fine, " +"scaling/skew is not). Use [method affine_inverse] for non-orthonormal " +"transforms (e.g. with scaling)." +msgstr "" +"返回变换的逆,假设该变换的基是正交的(即旋转/反射可以,缩放/倾斜不行)。使用 " +"[method affine_inverse] 进行非正交变换(例如缩放)。" + +msgid "" +"Returns [code]true[/code] if the transform's basis is conformal, meaning it " +"preserves angles and distance ratios, and may only be composed of rotation " +"and uniform scale. Returns [code]false[/code] if the transform's basis has " +"non-uniform scale or shear/skew. This can be used to validate if the " +"transform is non-distorted, which is important for physics and other use " +"cases." +msgstr "" +"如果该变换的基是共形的,则返回 [code]true[/code],这意味着它保留角度和距离比" +"率,并且只能由旋转和统一缩放组成。如果该变换的基具有不均匀的缩放或剪切/倾斜," +"则返回 [code]false[/code]。这可被用于验证该变换是否失真,这对于物理和其他用例" +"很重要。" + +msgid "" +"Returns [code]true[/code] if this transform and [param xform] are " +"approximately equal, by running [method @GlobalScope.is_equal_approx] on each " +"component." +msgstr "" +"如果通过在每个分量上运行 [method @GlobalScope.is_equal_approx],该变换和 " +"[param xform] 近似相等,则返回 [code]true[/code]。" + +msgid "" "Returns [code]true[/code] if this transform is finite, by calling [method " "@GlobalScope.is_finite] on each component." msgstr "" @@ -118445,6 +132695,13 @@ msgid "Transforms (multiplies) the [Vector2] by the given [Transform2D] matrix." msgstr "使用给定的 [Transform2D] 矩阵将该 [Vector2] 进行变换(相乘)。" msgid "" +"This operator multiplies all components of the [Transform2D], including the " +"[member origin] vector, which scales it uniformly." +msgstr "" +"该运算符将 [Transform2D] 的所有分量相乘,包括 [member origin] 向量,从而对其进" +"行统一缩放。" + +msgid "" "Returns [code]true[/code] if the transforms are exactly equal.\n" "[b]Note:[/b] Due to floating-point precision errors, consider using [method " "is_equal_approx] instead, which is more reliable." @@ -118458,7 +132715,7 @@ msgid "" "equivalent to [code]t.x[/code], [code]t[1][/code] is equivalent to [code]t.y[/" "code], and [code]t[2][/code] is equivalent to [code]t.origin[/code]." msgstr "" -"使用其索引访问变换的分量。[code]t[0][/code] 相当于 [code]t.x[/code]," +"使用变换分量的索引访问变换的分量。[code]t[0][/code] 相当于 [code]t.x[/code]," "[code]t[1][/code] 相当于 [code]t.y[/code],[code]t[2][/code] 相当于 [code]t." "origin[/code]。" @@ -118604,6 +132861,13 @@ msgid "Transforms (multiplies) the [Vector3] by the given [Transform3D] matrix." msgstr "使用给定的 [Transform3D] 矩阵对 [Vector3] 进行变换(相乘)。" msgid "" +"This operator multiplies all components of the [Transform3D], including the " +"[member origin] vector, which scales it uniformly." +msgstr "" +"该运算符将 [Transform3D] 的所有分量相乘,包括 [member origin] 向量,从而对其进" +"行统一缩放。" + +msgid "" "A language translation that maps a collection of strings to their individual " "translations." msgstr "语言翻译,能够将一组字符串映射到对应的翻译。" @@ -119289,6 +133553,13 @@ msgstr "使用鼠标按钮选中某一项时发出。" msgid "Emitted when an item is selected." msgstr "选中某一项时发出。" +msgid "" +"Emitted instead of [signal item_selected] if [member select_mode] is set to " +"[constant SELECT_MULTI]." +msgstr "" +"如果 [member select_mode] 被设置为 [constant SELECT_MULTI],则代替 [signal " +"item_selected] 发出。" + msgid "Emitted when a left mouse button click does not select any item." msgstr "鼠标左键未选中任一项时发出。" @@ -119487,6 +133758,11 @@ msgid "" "right margin." msgstr "滚动条的右侧边距。为负数时会使用 [theme_item panel] 的右侧边距。" +msgid "" +"The top margin of the vertical scrollbar. When negative, uses [theme_item " +"panel] top margin." +msgstr "垂直滚动条的顶部边距。为负数时会使用 [theme_item panel] 的顶部边距。" + msgid "The vertical separation of tree content and scrollbar." msgstr "树中内容与滚动条的垂直间距。" @@ -119498,6 +133774,9 @@ msgstr "每个项内的垂直填充,即项内容与上或下边框之间的距 msgid "[Font] of the title button's text." msgstr "标题按钮文本的 [Font] 字体。" +msgid "Font size of the title button's text." +msgstr "标题按钮文本的字体大小。" + msgid "The arrow icon used when a foldable item is not collapsed." msgstr "箭头图标,可折叠项未折叠时使用。" @@ -119835,6 +134114,14 @@ msgstr "返回给定列的文本。" msgid "Returns the given column's text alignment." msgstr "返回给定列的文本对齐方式。" +msgid "" +"Returns the clipping behavior when the text exceeds the item's bounding " +"rectangle in the given [param column]. By default it is [constant TextServer." +"OVERRUN_TRIM_ELLIPSIS]." +msgstr "" +"返回当给定 [param column] 中文本超出项目的边界矩形时的裁剪行为。默认情况下它" +"是 [constant TextServer.OVERRUN_TRIM_ELLIPSIS]。" + msgid "Returns the given column's tooltip text." msgstr "设置给定列的工具提示文本。" @@ -119951,6 +134238,12 @@ msgstr "" "button_index] 的按钮。" msgid "" +"Sets the tooltip text for the button at index [param button_index] in the " +"given [param column]." +msgstr "" +"设置给定 [param column] 中索引 [param button_index] 处按钮的工具提示文本。" + +msgid "" "Sets the given column's cell mode to [param mode]. See [enum TreeCellMode] " "constants." msgstr "将给定列的单元格模式设置为 [param mode]。见 [enum TreeCellMode] 常量。" @@ -120083,6 +134376,11 @@ msgid "" "possible values." msgstr "设置给定列的文本对齐方式。可能的值见 [enum HorizontalAlignment]。" +msgid "" +"Sets the clipping behavior when the text exceeds the item's bounding " +"rectangle in the given [param column]." +msgstr "设置当文本超出给定 [param column] 中项目的边界矩形时的裁剪行为。" + msgid "Sets the given column's tooltip text." msgstr "设置给定列的工具提示文本。" @@ -120200,6 +134498,264 @@ msgid "" msgstr "通过脚本进行通用动画的轻量级对象,使用 [Tweener]。" msgid "" +"Tweens are mostly useful for animations requiring a numerical property to be " +"interpolated over a range of values. The name [i]tween[/i] comes from [i]in-" +"betweening[/i], an animation technique where you specify [i]keyframes[/i] and " +"the computer interpolates the frames that appear between them. Animating " +"something with a [Tween] is called tweening.\n" +"[Tween] is more suited than [AnimationPlayer] for animations where you don't " +"know the final values in advance. For example, interpolating a dynamically-" +"chosen camera zoom value is best done with a [Tween]; it would be difficult " +"to do the same thing with an [AnimationPlayer] node. Tweens are also more " +"light-weight than [AnimationPlayer], so they are very much suited for simple " +"animations or general tasks that don't require visual tweaking provided by " +"the editor. They can be used in a fire-and-forget manner for some logic that " +"normally would be done by code. You can e.g. make something shoot " +"periodically by using a looped [CallbackTweener] with a delay.\n" +"A [Tween] can be created by using either [method SceneTree.create_tween] or " +"[method Node.create_tween]. [Tween]s created manually (i.e. by using " +"[code]Tween.new()[/code]) are invalid and can't be used for tweening values.\n" +"A tween animation is created by adding [Tweener]s to the [Tween] object, " +"using [method tween_property], [method tween_interval], [method " +"tween_callback] or [method tween_method]:\n" +"[codeblocks]\n" +"[gdscript]\n" +"var tween = get_tree().create_tween()\n" +"tween.tween_property($Sprite, \"modulate\", Color.RED, 1)\n" +"tween.tween_property($Sprite, \"scale\", Vector2(), 1)\n" +"tween.tween_callback($Sprite.queue_free)\n" +"[/gdscript]\n" +"[csharp]\n" +"Tween tween = GetTree().CreateTween();\n" +"tween.TweenProperty(GetNode(\"Sprite\"), \"modulate\", Colors.Red, 1.0f);\n" +"tween.TweenProperty(GetNode(\"Sprite\"), \"scale\", Vector2.Zero, 1.0f);\n" +"tween.TweenCallback(Callable.From(GetNode(\"Sprite\").QueueFree));\n" +"[/csharp]\n" +"[/codeblocks]\n" +"This sequence will make the [code]$Sprite[/code] node turn red, then shrink, " +"before finally calling [method Node.queue_free] to free the sprite. " +"[Tweener]s are executed one after another by default. This behavior can be " +"changed using [method parallel] and [method set_parallel].\n" +"When a [Tweener] is created with one of the [code]tween_*[/code] methods, a " +"chained method call can be used to tweak the properties of this [Tweener]. " +"For example, if you want to set a different transition type in the above " +"example, you can use [method set_trans]:\n" +"[codeblocks]\n" +"[gdscript]\n" +"var tween = get_tree().create_tween()\n" +"tween.tween_property($Sprite, \"modulate\", Color.RED, 1).set_trans(Tween." +"TRANS_SINE)\n" +"tween.tween_property($Sprite, \"scale\", Vector2(), 1).set_trans(Tween." +"TRANS_BOUNCE)\n" +"tween.tween_callback($Sprite.queue_free)\n" +"[/gdscript]\n" +"[csharp]\n" +"Tween tween = GetTree().CreateTween();\n" +"tween.TweenProperty(GetNode(\"Sprite\"), \"modulate\", Colors.Red, 1.0f)." +"SetTrans(Tween.TransitionType.Sine);\n" +"tween.TweenProperty(GetNode(\"Sprite\"), \"scale\", Vector2.Zero, 1.0f)." +"SetTrans(Tween.TransitionType.Bounce);\n" +"tween.TweenCallback(Callable.From(GetNode(\"Sprite\").QueueFree));\n" +"[/csharp]\n" +"[/codeblocks]\n" +"Most of the [Tween] methods can be chained this way too. In the following " +"example the [Tween] is bound to the running script's node and a default " +"transition is set for its [Tweener]s:\n" +"[codeblocks]\n" +"[gdscript]\n" +"var tween = get_tree().create_tween().bind_node(self).set_trans(Tween." +"TRANS_ELASTIC)\n" +"tween.tween_property($Sprite, \"modulate\", Color.RED, 1)\n" +"tween.tween_property($Sprite, \"scale\", Vector2(), 1)\n" +"tween.tween_callback($Sprite.queue_free)\n" +"[/gdscript]\n" +"[csharp]\n" +"var tween = GetTree().CreateTween().BindNode(this).SetTrans(Tween." +"TransitionType.Elastic);\n" +"tween.TweenProperty(GetNode(\"Sprite\"), \"modulate\", Colors.Red, 1.0f);\n" +"tween.TweenProperty(GetNode(\"Sprite\"), \"scale\", Vector2.Zero, 1.0f);\n" +"tween.TweenCallback(Callable.From(GetNode(\"Sprite\").QueueFree));\n" +"[/csharp]\n" +"[/codeblocks]\n" +"Another interesting use for [Tween]s is animating arbitrary sets of objects:\n" +"[codeblocks]\n" +"[gdscript]\n" +"var tween = create_tween()\n" +"for sprite in get_children():\n" +" tween.tween_property(sprite, \"position\", Vector2(0, 0), 1)\n" +"[/gdscript]\n" +"[csharp]\n" +"Tween tween = CreateTween();\n" +"foreach (Node sprite in GetChildren())\n" +" tween.TweenProperty(sprite, \"position\", Vector2.Zero, 1.0f);\n" +"[/csharp]\n" +"[/codeblocks]\n" +"In the example above, all children of a node are moved one after another to " +"position (0, 0).\n" +"You should avoid using more than one [Tween] per object's property. If two or " +"more tweens animate one property at the same time, the last one created will " +"take priority and assign the final value. If you want to interrupt and " +"restart an animation, consider assigning the [Tween] to a variable:\n" +"[codeblocks]\n" +"[gdscript]\n" +"var tween\n" +"func animate():\n" +" if tween:\n" +" tween.kill() # Abort the previous animation.\n" +" tween = create_tween()\n" +"[/gdscript]\n" +"[csharp]\n" +"private Tween _tween;\n" +"\n" +"public void Animate()\n" +"{\n" +" if (_tween != null)\n" +" _tween.Kill(); // Abort the previous animation\n" +" _tween = CreateTween();\n" +"}\n" +"[/csharp]\n" +"[/codeblocks]\n" +"Some [Tweener]s use transitions and eases. The first accepts a [enum " +"TransitionType] constant, and refers to the way the timing of the animation " +"is handled (see [url=https://easings.net/]easings.net[/url] for some " +"examples). The second accepts an [enum EaseType] constant, and controls where " +"the [code]trans_type[/code] is applied to the interpolation (in the " +"beginning, the end, or both). If you don't know which transition and easing " +"to pick, you can try different [enum TransitionType] constants with [constant " +"EASE_IN_OUT], and use the one that looks best.\n" +"[url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/" +"tween_cheatsheet.webp]Tween easing and transition types cheatsheet[/url]\n" +"[b]Note:[/b] Tweens are not designed to be re-used and trying to do so " +"results in an undefined behavior. Create a new Tween for each animation and " +"every time you replay an animation from start. Keep in mind that Tweens start " +"immediately, so only create a Tween when you want to start animating.\n" +"[b]Note:[/b] The tween is processed after all of the nodes in the current " +"frame, i.e. node's [method Node._process] method would be called before the " +"tween (or [method Node._physics_process] depending on the value passed to " +"[method set_process_mode])." +msgstr "" +"Tween 主要用于需要将一个数值属性插值到一系列值的动画。[i]tween[/i] 这个名字来" +"自 [i]in-betweening[/i],这是一种动画技术,可以在其中指定 [i]关键帧[/i],然后" +"计算机会插入出现在它们之间的帧。使用 [Tween] 制作动画被称为补间动画。\n" +"[Tween] 比 [AnimationPlayer] 更适合事先不知道最终值的动画。例如,插入动态选择" +"的相机缩放值最好使用 [Tween] 完成;很难使用 [AnimationPlayer] 节点做同样的事" +"情。Tween 也比 [AnimationPlayer] 更轻量级,因此它们非常适合简单的动画,或不需" +"要编辑器提供的视觉调整的通用任务。对于通常由代码完成的某些逻辑,它们可以以即用" +"即弃的方式使用。例如,可以使用带延迟的循环 [CallbackTweener] 定期射击。\n" +"可以使用 [method SceneTree.create_tween] 或 [method Node.create_tween] 创建 " +"[Tween]。手动创建的 [Tween](即使用 [code]Tween.new()[/code])无效,不能用于对" +"值进行补间。\n" +"通过使用 [method tween_property]、[method tween_interval]、[method " +"tween_callback]、或 [method tween_method],可将 [Tweener] 添加到 [Tween] 对象" +"来创建一个补间动画:\n" +"[codeblocks]\n" +"[gdscript]\n" +"var tween = get_tree().create_tween()\n" +"tween.tween_property($Sprite, \"modulate\", Color.RED, 1)\n" +"tween.tween_property($Sprite, \"scale\", Vector2(), 1)\n" +"tween.tween_callback($Sprite.queue_free)\n" +"[/gdscript]\n" +"[csharp]\n" +"Tween tween = GetTree().CreateTween();\n" +"tween.TweenProperty(GetNode(\"Sprite\"), \"modulate\", Colors.Red, 1.0f);\n" +"tween.TweenProperty(GetNode(\"Sprite\"), \"scale\", Vector2.Zero, 1.0f);\n" +"tween.TweenCallback(Callable.From(GetNode(\"Sprite\").QueueFree));\n" +"[/csharp]\n" +"[/codeblocks]\n" +"该序列将使 [code]$Sprite[/code] 节点变红,然后缩小,最后调用 [method Node." +"queue_free] 来释放该精灵。默认情况下,[Tweener] 一个接一个地执行。这种行为可以" +"使用 [method parallel] 和 [method set_parallel] 来更改。\n" +"当使用 [code]tween_*[/code] 方法之一创建 [Tweener] 时,可以使用链式方法调用来" +"调整该 [Tweener] 的属性。例如,如果想在上面的例子中设置一个不同的过渡类型,可" +"以使用 [method set_trans]:\n" +"[codeblocks]\n" +"[gdscript]\n" +"var tween = get_tree().create_tween()\n" +"tween.tween_property($Sprite, \"modulate\", Color.RED, 1).set_trans(Tween." +"TRANS_SINE)\n" +"tween.tween_property($Sprite, \"scale\", Vector2(), 1).set_trans(Tween." +"TRANS_BOUNCE)\n" +"tween.tween_callback($Sprite.queue_free)\n" +"[/gdscript]\n" +"[csharp]\n" +"Tween tween = GetTree().CreateTween();\n" +"tween.TweenProperty(GetNode(\"Sprite\"), \"modulate\", Colors.Red, 1.0f)." +"SetTrans(Tween.TransitionType.Sine);\n" +"tween.TweenProperty(GetNode(\"Sprite\"), \"scale\", Vector2.Zero, 1.0f)." +"SetTrans(Tween.TransitionType.Bounce);\n" +"tween.TweenCallback(Callable.From(GetNode(\"Sprite\").QueueFree));\n" +"[/csharp]\n" +"[/codeblocks]\n" +"大多数 [Tween] 方法也可以这样链式调用。在下面的示例中,[Tween] 被绑定到运行脚" +"本的节点,并为其 [Tweener] 设置了默认过渡:\n" +"[codeblocks]\n" +"[gdscript]\n" +"var tween = get_tree().create_tween().bind_node(self).set_trans(Tween." +"TRANS_ELASTIC)\n" +"tween.tween_property($Sprite, \"modulate\", Color.RED, 1)\n" +"tween.tween_property($Sprite, \"scale\", Vector2(), 1)\n" +"tween.tween_callback($Sprite.queue_free)\n" +"[/gdscript]\n" +"[csharp]\n" +"var tween = GetTree().CreateTween().BindNode(this).SetTrans(Tween." +"TransitionType.Elastic);\n" +"tween.TweenProperty(GetNode(\"Sprite\"), \"modulate\", Colors.Red, 1.0f);\n" +"tween.TweenProperty(GetNode(\"Sprite\"), \"scale\", Vector2.Zero, 1.0f);\n" +"tween.TweenCallback(Callable.From(GetNode(\"Sprite\").QueueFree));\n" +"[/csharp]\n" +"[/codeblocks]\n" +"[Tween] 的另一个有趣用途是动画化任意对象集:\n" +"[codeblocks]\n" +"[gdscript]\n" +"var tween = create_tween()\n" +"for sprite in get_children():\n" +" tween.tween_property(sprite, \"position\", Vector2(0, 0), 1)\n" +"[/gdscript]\n" +"[csharp]\n" +"Tween tween = CreateTween();\n" +"foreach (Node sprite in GetChildren())\n" +" tween.TweenProperty(sprite, \"position\", Vector2.Zero, 1.0f);\n" +"[/csharp]\n" +"[/codeblocks]\n" +"在上面的示例中,一个节点的所有子节点都被依次移动到位置 (0, 0)。\n" +"应该避免为对象的同一属性使用多个 [Tween]。如果两个或多个补间同时为同一个属性设" +"置动画,则最后创建的补间将优先使用,并分配最终值。如果要中断并重新启动动画,请" +"考虑将 [Tween] 赋给变量:\n" +"[codeblocks]\n" +"[gdscript]\n" +"var tween\n" +"func animate():\n" +" if tween:\n" +" tween.kill() # 终止之前的补间动画。\n" +" tween = create_tween()\n" +"[/gdscript]\n" +"[csharp]\n" +"private Tween _tween;\n" +"\n" +"public void Animate()\n" +"{\n" +" if (_tween != null)\n" +" _tween.Kill(); // 终止之前的补间动画。\n" +" _tween = CreateTween();\n" +"}\n" +"[/csharp]\n" +"[/codeblocks]\n" +"一些 [Tweener] 会使用过渡和缓动。第一个接受一个 [enum TransitionType] 常量,指" +"的是处理动画时间的方式(相关示例见 [url=https://easings.net/]easings.net[/" +"url])。第二个接受一个 [enum EaseType] 常量,并控制 [code]trans_type[/code] 应" +"用于插值的位置(在开头、结尾、或两者)。如果不知道该选择哪种过渡和缓动,可以尝" +"试使用 [constant EASE_IN_OUT] 并配合不同 [enum TransitionType] 常量,并使用看" +"起来最好的那个。\n" +"[url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/" +"tween_cheatsheet.webp]补间缓动与过渡类型速查表[/url]\n" +"[b]注意:[/b]Tween 并不是针对重用设计的,尝试重用会造成未定义行为。每次从头开" +"始重新播放每个动画都请新建一个 Tween。请记住,Tween 是会立即开始的,所以请只在" +"需要开始动画时创建 Tween。\n" +"[b]注意:[/b]该补间在当前帧中的所有节点之后进行处理,即节点的 [method Node." +"_process] 方法(或 [method Node._physics_process],具体取决于传递给 [method " +"set_process_mode] 的值)会在补间之前被调用。" + +msgid "" "Binds this [Tween] with the given [param node]. [Tween]s are processed " "directly by the [SceneTree], so they run independently of the animated nodes. " "When you bind a [Node] with the [Tween], the [Tween] will halt the animation " @@ -120374,6 +134930,18 @@ msgstr "" "该示例中的所有 [Tweener] 都会同时执行。\n" "你可以通过使用 [method set_parallel] 让该 [Tween] 默认并行。" +msgid "" +"Pauses the tweening. The animation can be resumed by using [method play].\n" +"[b]Note:[/b] If a Tween is paused and not bound to any node, it will exist " +"indefinitely until manually started or invalidated. If you lose a reference " +"to such Tween, you can retrieve it using [method SceneTree." +"get_processed_tweens]." +msgstr "" +"暂停该补间。可以使用 [method play] 恢复动画。\n" +"[b]注意:[/b]如果一个 Tween 被暂停并且没有被绑定到任何节点,它将无限期地存在," +"直到手动启动或失效。如果丢失了对这种 Tween 的引用,可以使用 [method SceneTree." +"get_processed_tweens] 检索它。" + msgid "Resumes a paused or stopped [Tween]." msgstr "恢复已暂停或已停止的 [Tween]。" @@ -120447,6 +135015,19 @@ msgstr "" "如果未指定,则默认值为 [constant TRANS_LINEAR]。" msgid "" +"Stops the tweening and resets the [Tween] to its initial state. This will not " +"remove any appended [Tweener]s.\n" +"[b]Note:[/b] If a Tween is stopped and not bound to any node, it will exist " +"indefinitely until manually started or invalidated. If you lose a reference " +"to such Tween, you can retrieve it using [method SceneTree." +"get_processed_tweens]." +msgstr "" +"停止该补间并将该 [Tween] 重置为其初始状态。这不会移除任何附加的 [Tweener]。\n" +"[b]注意:[/b]如果一个 Tween 被停止并且没有被绑定到任何节点,它将无限期地存在," +"直到手动启动或失效。如果丢失了对这种 Tween 的引用,可以使用 [method SceneTree." +"get_processed_tweens]。" + +msgid "" "Creates and appends a [CallbackTweener]. This method can be used to call an " "arbitrary method in any object. Use [method Callable.bind] to bind additional " "arguments for the call.\n" @@ -120594,6 +135175,104 @@ msgstr "" "[/codeblocks]" msgid "" +"Creates and appends a [MethodTweener]. This method is similar to a " +"combination of [method tween_callback] and [method tween_property]. It calls " +"a method over time with a tweened value provided as an argument. The value is " +"tweened between [param from] and [param to] over the time specified by [param " +"duration], in seconds. Use [method Callable.bind] to bind additional " +"arguments for the call. You can use [method MethodTweener.set_ease] and " +"[method MethodTweener.set_trans] to tweak the easing and transition of the " +"value or [method MethodTweener.set_delay] to delay the tweening.\n" +"[b]Example:[/b] Making a 3D object look from one point to another point:\n" +"[codeblocks]\n" +"[gdscript]\n" +"var tween = create_tween()\n" +"tween.tween_method(look_at.bind(Vector3.UP), Vector3(-1, 0, -1), Vector3(1, " +"0, -1), 1) # The look_at() method takes up vector as second argument.\n" +"[/gdscript]\n" +"[csharp]\n" +"Tween tween = CreateTween();\n" +"tween.TweenMethod(Callable.From((Vector3 target) => LookAt(target, Vector3." +"Up)), new Vector3(-1.0f, 0.0f, -1.0f), new Vector3(1.0f, 0.0f, -1.0f), " +"1.0f); // Use lambdas to bind additional arguments for the call.\n" +"[/csharp]\n" +"[/codeblocks]\n" +"[b]Example:[/b] Setting the text of a [Label], using an intermediate method " +"and after a delay:\n" +"[codeblocks]\n" +"[gdscript]\n" +"func _ready():\n" +" var tween = create_tween()\n" +" tween.tween_method(set_label_text, 0, 10, 1).set_delay(1)\n" +"\n" +"func set_label_text(value: int):\n" +" $Label.text = \"Counting \" + str(value)\n" +"[/gdscript]\n" +"[csharp]\n" +"public override void _Ready()\n" +"{\n" +" base._Ready();\n" +"\n" +" Tween tween = CreateTween();\n" +" tween.TweenMethod(Callable.From<int>(SetLabelText), 0.0f, 10.0f, 1.0f)." +"SetDelay(1.0f);\n" +"}\n" +"\n" +"private void SetLabelText(int value)\n" +"{\n" +" GetNode<Label>(\"Label\").Text = $\"Counting {value}\";\n" +"}\n" +"[/csharp]\n" +"[/codeblocks]" +msgstr "" +"创建并追加一个 [MethodTweener]。这个方法与 [method tween_callback] 和 [method " +"tween_property] 的组合类似,会使用补间后的值作为参数去持续调用某个方法。该值是" +"从 [param from] 到 [param to] 进行补间的,时长为 [param duration] 秒。请使用 " +"[method Callable.bind] 绑定额外的调用参数。你可以使用 [method MethodTweener." +"set_ease] 和 [method MethodTweener.set_trans] 来调整该值的缓动和过渡,可以使" +"用 [method MethodTweener.set_delay] 来延迟补间。\n" +"[b]示例:[/b]让 3D 对象面向另一个点:\n" +"[codeblocks]\n" +"[gdscript]\n" +"var tween = create_tween()\n" +"tween.tween_method(look_at.bind(Vector3.UP), Vector3(-1, 0, -1), Vector3(1, " +"0, -1), 1) # look_at() 方法的第二个参数接受的是上向量。\n" +"[/gdscript]\n" +"[csharp]\n" +"Tween tween = CreateTween();\n" +"tween.TweenMethod(Callable.From((Vector3 target) => LookAt(target, Vector3." +"Up)), new Vector3(-1.0f, 0.0f, -1.0f), new Vector3(1.0f, 0.0f, -1.0f), " +"1.0f); // 使用 lambda 为调用绑定附加参数。\n" +"[/csharp]\n" +"[/codeblocks]\n" +"[b]示例:[/b]在一段延迟后,使用中间方法来设置 [Label] 的文本:\n" +"[codeblocks]\n" +"[gdscript]\n" +"func _ready():\n" +" var tween = create_tween()\n" +" tween.tween_method(set_label_text, 0, 10, 1).set_delay(1)\n" +"\n" +"func set_label_text(value: int):\n" +" $Label.text = \"Counting \" + str(value)\n" +"[/gdscript]\n" +"[csharp]\n" +"public override void _Ready()\n" +"{\n" +" base._Ready();\n" +"\n" +" Tween tween = CreateTween();\n" +" tween.TweenMethod(Callable.From<int>(SetLabelText), 0.0f, 10.0f, 1.0f)." +"SetDelay(1.0f);\n" +"}\n" +"\n" +"private void SetLabelText(int value)\n" +"{\n" +" GetNode<Label>(\"Label\").Text = $\"Counting {value}\";\n" +"}\n" +"[/csharp]\n" +"[/codeblocks]" + +msgid "" "Creates and appends a [PropertyTweener]. This method tweens a [param " "property] of an [param object] between an initial value and [param final_val] " "in a span of time equal to [param duration], in seconds. The initial value by " @@ -121992,6 +136671,216 @@ msgstr "内存分配错误。" msgid "The most important data type in Godot." msgstr "Godot 中最重要的数据类型。" +msgid "" +"In computer programming, a Variant class is a class that is designed to store " +"a variety of other types. Dynamic programming languages like PHP, Lua, " +"JavaScript and GDScript like to use them to store variables' data on the " +"backend. With these Variants, properties are able to change value types " +"freely.\n" +"[codeblocks]\n" +"[gdscript]\n" +"var foo = 2 # foo is dynamically an integer\n" +"foo = \"Now foo is a string!\"\n" +"foo = RefCounted.new() # foo is an Object\n" +"var bar: int = 2 # bar is a statically typed integer.\n" +"# bar = \"Uh oh! I can't make static variables become a different type!\"\n" +"[/gdscript]\n" +"[csharp]\n" +"// C# is statically typed. Once a variable has a type it cannot be changed. " +"You can use the `var` keyword to let the compiler infer the type " +"automatically.\n" +"var foo = 2; // Foo is a 32-bit integer (int). Be cautious, integers in " +"GDScript are 64-bit and the direct C# equivalent is `long`.\n" +"// foo = \"foo was and will always be an integer. It cannot be turned into a " +"string!\";\n" +"var boo = \"Boo is a string!\";\n" +"var ref = new RefCounted(); // var is especially useful when used together " +"with a constructor.\n" +"\n" +"// Godot also provides a Variant type that works like a union of all the " +"Variant-compatible types.\n" +"Variant fooVar = 2; // fooVar is dynamically an integer (stored as a `long` " +"in the Variant type).\n" +"fooVar = \"Now fooVar is a string!\";\n" +"fooVar = new RefCounted(); // fooVar is a GodotObject.\n" +"[/csharp]\n" +"[/codeblocks]\n" +"Godot tracks all scripting API variables within Variants. Without even " +"realizing it, you use Variants all the time. When a particular language " +"enforces its own rules for keeping data typed, then that language is applying " +"its own custom logic over the base Variant scripting API.\n" +"- GDScript automatically wrap values in them. It keeps all data in plain " +"Variants by default and then optionally enforces custom static typing rules " +"on variable types.\n" +"- C# is statically typed, but uses its own implementation of the Variant type " +"in place of Godot's [Variant] class when it needs to represent a dynamic " +"value. C# Variant can be assigned any compatible type implicitly but " +"converting requires an explicit cast.\n" +"The global [method @GlobalScope.typeof] function returns the enumerated value " +"of the Variant type stored in the current variable (see [enum Variant." +"Type]).\n" +"[codeblocks]\n" +"[gdscript]\n" +"var foo = 2\n" +"match typeof(foo):\n" +" TYPE_NIL:\n" +" print(\"foo is null\")\n" +" TYPE_INTEGER:\n" +" print(\"foo is an integer\")\n" +" TYPE_OBJECT:\n" +" # Note that Objects are their own special category.\n" +" # To get the name of the underlying Object type, you need the " +"`get_class()` method.\n" +" print(\"foo is a(n) %s\" % foo.get_class()) # inject the class name " +"into a formatted string.\n" +" # Note also that there is not yet any way to get a script's " +"`class_name` string easily.\n" +" # To fetch that value, you can use ProjectSettings." +"get_global_class_list().\n" +"[/gdscript]\n" +"[csharp]\n" +"Variant foo = 2;\n" +"switch (foo.VariantType)\n" +"{\n" +" case Variant.Type.Nil:\n" +" GD.Print(\"foo is null\");\n" +" break;\n" +" case Variant.Type.Int:\n" +" GD.Print(\"foo is an integer\");\n" +" break;\n" +" case Variant.Type.Object:\n" +" // Note that Objects are their own special category.\n" +" // You can convert a Variant to a GodotObject and use reflection to " +"get its name.\n" +" GD.Print($\"foo is a(n) {foo.AsGodotObject().GetType().Name}\");\n" +" break;\n" +"}\n" +"[/csharp]\n" +"[/codeblocks]\n" +"A Variant takes up only 20 bytes and can store almost any engine datatype " +"inside of it. Variants are rarely used to hold information for long periods " +"of time. Instead, they are used mainly for communication, editing, " +"serialization and moving data around.\n" +"Godot has specifically invested in making its Variant class as flexible as " +"possible; so much so that it is used for a multitude of operations to " +"facilitate communication between all of Godot's systems.\n" +"A Variant:\n" +"- Can store almost any datatype.\n" +"- Can perform operations between many variants. GDScript uses Variant as its " +"atomic/native datatype.\n" +"- Can be hashed, so it can be compared quickly to other variants.\n" +"- Can be used to convert safely between datatypes.\n" +"- Can be used to abstract calling methods and their arguments. Godot exports " +"all its functions through variants.\n" +"- Can be used to defer calls or move data between threads.\n" +"- Can be serialized as binary and stored to disk, or transferred via " +"network.\n" +"- Can be serialized to text and use it for printing values and editable " +"settings.\n" +"- Can work as an exported property, so the editor can edit it universally.\n" +"- Can be used for dictionaries, arrays, parsers, etc.\n" +"[b]Containers (Array and Dictionary):[/b] Both are implemented using " +"variants. A [Dictionary] can match any datatype used as key to any other " +"datatype. An [Array] just holds an array of Variants. Of course, a Variant " +"can also hold a [Dictionary] and an [Array] inside, making it even more " +"flexible.\n" +"Modifications to a container will modify all references to it. A [Mutex] " +"should be created to lock it if multi-threaded access is desired." +msgstr "" +"在计算机编程中,Variant(变体)类是用来存储各种其他类型的类。像 PHP、 Lua、 " +"JavaScript 和 GDScript 这样的动态编程语言喜欢用它们在后端存储变量数据。使用 " +"Variant,属性可以自由地更改值类型。\n" +"[codeblocks]\n" +"[gdscript]\n" +"var foo = 2 # foo 是动态类型的整数\n" +"foo = \"现在 foo 是字符串!\"\n" +"foo = RefCounted.new() # foo 是 Object\n" +"var bar: int = 2 # bar 是静态类型的整数。\n" +"# bar = \"诶呀!我没法让静态类型的变量变成其他类型!\"\n" +"[/gdscript]\n" +"[csharp]\n" +"// C# 是静态类型的。变量设置类型后无法改变。你可以用 `var` 关键字让编译器自动" +"推断类型。\n" +"var foo = 2; // foo 是 32 位整数(int)。请注意,GDScript 中的整数是 64 位的," +"在 C# 中与之等价的是 `long`。\n" +"// foo = \"foo 过去、现在、将来都是整数,没法变成字符串!\";\n" +"var boo = \"boo 是字符串!\";\n" +"var ref = new RefCounted(); // var 非常适合与构造函数配合使用。\n" +"\n" +"// Godot 也提供了 Variant 类,类似于一个与所有 Variant 兼容类型的联合体。\n" +"Variant fooVar = 2; // fooVar 是动态类型的整数(在 Variant 类型中存储为 " +"`long`)。\n" +"fooVar = \"现在 fooVar 是字符串!\";\n" +"fooVar = new RefCounted(); // fooVar 是 GodotObject。\n" +"[/csharp]\n" +"[/codeblocks]\n" +"Godot 在 Variant 中跟踪所有脚本 API 变量。你一直在无意中使用 Variant。某种语言" +"为保持数据类型而执行自己的规则时,那么就是该语言在基础 Variant 脚本 API 上应用" +"了自定义的逻辑。\n" +"- GDScript 会自动将数值进行包装。默认情况下会将所有数据保存在普通的 Variant " +"中,也可以选择对变量类型执行自定义的静态类型规则。\n" +"- C# 是静态类型的,但是当它需要表示动态值时,就会在需要 Godot 的 Variant 类的" +"地方使用它自己实现的 [Variant] 类型。C# Variant 可以用任意兼容类型隐式赋值,但" +"反之则需要显式类型转换。\n" +"全局函数 [method @GlobalScope.typeof] 返回的是枚举类型的值,表示当前变量中所存" +"储的 Variant 类型(见 [enum Variant.Type])。\n" +"[codeblocks]\n" +"[gdscript]\n" +"var foo = 2\n" +"match typeof(foo):\n" +" TYPE_NIL:\n" +" print(\"foo 为 null\")\n" +" TYPE_INTEGER:\n" +" print(\"foo 为整数\")\n" +" TYPE_OBJECT:\n" +" # 请注意,Object 有自己的特殊分类。\n" +" # 要获取实际的 Object 类型名称,你需要使用 `get_class()` 方法。\n" +" print(\"foo is a(n) %s\" % foo.get_class()) # 将类名注入格式字符串" +"中。\n" +" # 另外请注意,目前没有比较方便的方法来获取脚本的 `class_name` 字符" +"串。\n" +" # 如果要获取,你可以使用 ProjectSettings.get_global_class_list()。\n" +"[/gdscript]\n" +"[csharp]\n" +"Variant foo = 2;\n" +"switch (foo.VariantType)\n" +"{\n" +" case Variant.Type.Nil:\n" +" GD.Print(\"foo 为 null\");\n" +" break;\n" +" case Variant.Type.Int:\n" +" GD.Print(\"foo 为整数\");\n" +" break;\n" +" case Variant.Type.Object:\n" +" // 请注意,Object 有自己的特殊分类。\n" +" // 可以将 Variant 转换为 GodotObject,通过反射获取名称。\n" +" GD.Print($\"foo is a(n) {foo.AsGodotObject().GetType().Name}\");\n" +" break;\n" +"}\n" +"[/csharp]\n" +"[/codeblocks]\n" +"Variant 只占 20 个字节,可以在其中存储几乎所有的引擎数据类型。Variant 很少用于" +"长期保存信息,主要还是用于通信、编辑、序列化和移动数据。\n" +"Godot 特别致力于使其 Variant 类尽可能灵活;以使它可被用于各种操作,促进 Godot " +"所有系统之间的联系。\n" +"Variant:\n" +"- 可以存储几乎任何数据类型。\n" +"- 可以在许多 Variant 之间执行操作。GDScript 使用 Variant 作为其原子/原生数据类" +"型。\n" +"- 可以被哈希,所以可以快速与其他 Variant 进行比较。\n" +"- 可以用于数据类型之间的安全转换。\n" +"- 可以用来抽象调用方法和它们的参数。Godot 通过 Variant 导出所有函数。\n" +"- 可以用来推迟调用或在线程之间移动数据。\n" +"- 可以序列化为二进制并存储到磁盘,或通过网络传输。\n" +"- 可以序列化为文本,用于打印数值和可编辑设置项。\n" +"- 可以作为一个导出的属性工作,所以编辑器可以通用地进行编辑。\n" +"- 可以用于字典、数组、解析器等。\n" +"[b]容器(数组和字典):[/b]它们都是用 Variant 来实现的。[Dictionary] 可以将任" +"何作为键的数据类型匹配到到任何其他数据类型。[Array] 就是持有 Variant 的数组。" +"当然,Variant 也可以在里面再容纳 [Dictionary] 和 [Array],使其更加灵活。\n" +"对容器的修改会修改所有对它的引用。如果需要多线程访问,应该创建 [Mutex] 来对它" +"进行锁定。" + msgid "Variant class introduction" msgstr "Variant 类简介" @@ -122051,6 +136940,50 @@ msgid "" msgstr "返回一个新向量,其所有分量都是绝对值,即正值。" msgid "" +"Returns this vector's angle with respect to the positive X axis, or [code](1, " +"0)[/code] vector, in radians.\n" +"For example, [code]Vector2.RIGHT.angle()[/code] will return zero, " +"[code]Vector2.DOWN.angle()[/code] will return [code]PI / 2[/code] (a quarter " +"turn, or 90 degrees), and [code]Vector2(1, -1).angle()[/code] will return " +"[code]-PI / 4[/code] (a negative eighth turn, or -45 degrees).\n" +"[url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/" +"vector2_angle.png]Illustration of the returned angle.[/url]\n" +"Equivalent to the result of [method @GlobalScope.atan2] when called with the " +"vector's [member y] and [member x] as parameters: [code]atan2(y, x)[/code]." +msgstr "" +"返回该向量与 X 轴正方向的夹角,单位为弧度。X 轴正方向为 [code](1, 0)[/code] 向" +"量。\n" +"例如,[code]Vector2.RIGHT.angle()[/code] 将返回 0,[code]Vector2.DOWN.angle()" +"[/code] 将返回 [code]PI / 2[/code](四分之一圈,即 90 度),[code]Vector2(1, " +"-1).angle()[/code] 将返回 [code]-PI / 4[/code](负八分之一圈,即 -45 度)。\n" +"[url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/" +"vector2_angle.png]返回夹角图示。[/url]\n" +"相当于使用该向量的 [member y] 和 [member x] 作为参数对 [method @GlobalScope." +"atan2] 进行调用的结果:[code]atan2(y, x)[/code]。" + +msgid "" +"Returns the angle to the given vector, in radians.\n" +"[url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/" +"vector2_angle_to.png]Illustration of the returned angle.[/url]" +msgstr "" +"返回与给定向量的夹角,单位为弧度。\n" +"[url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/" +"vector2_angle_to.png]返回夹角示意图。[/url]" + +msgid "" +"Returns the angle between the line connecting the two points and the X axis, " +"in radians.\n" +"[code]a.angle_to_point(b)[/code] is equivalent of doing [code](b - a).angle()" +"[/code].\n" +"[url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/" +"vector2_angle_to_point.png]Illustration of the returned angle.[/url]" +msgstr "" +"返回连接两点的直线与 X 轴之间的夹角,单位为弧度。\n" +"[code]a.angle_to_point(b)[/code] 等价于 [code](b - a).angle()[/code]。\n" +"[url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/" +"vector2_angle_to_point.png]返回夹角示意图。[/url]" + +msgid "" "Returns the aspect ratio of this vector, the ratio of [member x] to [member " "y]." msgstr "返回该向量的长宽比,即 [member x] 与 [member y] 的比例。" @@ -122118,6 +137051,19 @@ msgstr "" "表插值的量。" msgid "" +"Performs a cubic interpolation between this vector and [param b] using [param " +"pre_a] and [param post_b] as handles, and returns the result at position " +"[param weight]. [param weight] is on the range of 0.0 to 1.0, representing " +"the amount of interpolation.\n" +"It can perform smoother interpolation than [method cubic_interpolate] by the " +"time values." +msgstr "" +"返回该向量和 [param b] 之间进行三次插值 [param weight] 处的结果,使用 [param " +"pre_a] 和 [param post_b] 作为控制柄。[param weight] 在 0.0 到 1.0 的范围内,代" +"表插值的量。\n" +"通过使用时间值,可以比 [method cubic_interpolate] 进行更平滑的插值。" + +msgid "" "Returns the normalized vector pointing from this vector to [param to]. This " "is equivalent to using [code](b - a).normalized()[/code]." msgstr "" @@ -122402,6 +137348,24 @@ msgstr "" "此,如果包含 NaN,则这个方法的结果可能不准确。" msgid "" +"Inversely transforms (multiplies) the [Vector2] by the given [Transform2D] " +"transformation matrix, under the assumption that the transformation basis is " +"orthonormal (i.e. rotation/reflection is fine, scaling/skew is not).\n" +"[code]vector * transform[/code] is equivalent to [code]transform.inverse() * " +"vector[/code]. See [method Transform2D.inverse].\n" +"For transforming by inverse of an affine transformation (e.g. with scaling) " +"[code]transform.affine_inverse() * vector[/code] can be used instead. See " +"[method Transform2D.affine_inverse]." +msgstr "" +"假设该变换的基是正交的(即旋转/反射可以,缩放/倾斜不行),将 [Vector2] 逆向变" +"换(乘以)给定的 [Transform2D] 变换矩阵。\n" +"[code]vector * transform[/code] 相当于 [code]transform.inverse() * vector[/" +"code]。请参阅 [method Transform2D.inverse]。\n" +"对于通过仿射变换的逆进行的变换(例如缩放),可以使用 [code]transform." +"affine_inverse() * vector[/code] 代替。请参阅 [method Transform2D." +"affine_inverse]。" + +msgid "" "Multiplies each component of the [Vector2] by the components of the given " "[Vector2].\n" "[codeblock]\n" @@ -122611,6 +137575,20 @@ msgid "" msgstr "" "返回新的向量,每个分量都吸附到了与 [param step] 中对应分量最接近的倍数。" +msgid "" +"Min vector, a vector with all components equal to [code]INT32_MIN[/code]. Can " +"be used as a negative integer equivalent of [constant Vector2.INF]." +msgstr "" +"最小向量,所有分量等于 [code]INT32_MIN[/code] 的向量。可用作 [constant " +"Vector2.INF] 的负整数等价物。" + +msgid "" +"Max vector, a vector with all components equal to [code]INT32_MAX[/code]. Can " +"be used as an integer equivalent of [constant Vector2.INF]." +msgstr "" +"最大向量,所有分量等于 [code]INT32_MAX[/code] 的向量。可用作 [constant " +"Vector2.INF] 的整数等价物。" + msgid "Returns [code]true[/code] if the vectors are not equal." msgstr "如果向量不相等,则返回 [code]true[/code]。" @@ -122959,6 +137937,50 @@ msgid "Unit vector pointing towards the rear side (back) of imported 3D assets." msgstr "指向导入后 3D 资产背面(后方)的单位向量。" msgid "" +"Inversely transforms (multiplies) the [Vector3] by the given [Basis] matrix, " +"under the assumption that the basis is orthonormal (i.e. rotation/reflection " +"is fine, scaling/skew is not).\n" +"[code]vector * basis[/code] is equivalent to [code]basis.transposed() * " +"vector[/code]. See [method Basis.transposed].\n" +"For transforming by inverse of a non-orthonormal basis (e.g. with scaling) " +"[code]basis.inverse() * vector[/code] can be used instead. See [method Basis." +"inverse]." +msgstr "" +"假设该基是正交的(即旋转/反射可以,缩放/倾斜则不然),将 [Vector3] 逆向变换" +"(乘以)给定的 [Basis] 矩阵。\n" +"[code]vector * basis[/code] 性当于 [code]basis.transposed() * vector[/code]。" +"请参阅 [method Basis.transposed]。\n" +"对于通过非正交的基的逆进行的变换(例如使用缩放),可以使用 [code]basis." +"inverse() * vector[/code] 代替。请参阅 [method Basis.inverse]。" + +msgid "" +"Inversely transforms (multiplies) the [Vector3] by the given [Quaternion].\n" +"[code]vector * quaternion[/code] is equivalent to [code]quaternion.inverse() " +"* vector[/code]. See [method Quaternion.inverse]." +msgstr "" +"将 [Vector3] 与给定的 [Quaternion] 进行逆向变换(相乘)。\n" +"[code]vector * quaternion[/code] 相当于 [code]quaternion.inverse() * vector[/" +"code]。请参阅 [method Quaternion.inverse]。" + +msgid "" +"Inversely transforms (multiplies) the [Vector3] by the given [Transform3D] " +"transformation matrix, under the assumption that the transformation basis is " +"orthonormal (i.e. rotation/reflection is fine, scaling/skew is not).\n" +"[code]vector * transform[/code] is equivalent to [code]transform.inverse() * " +"vector[/code]. See [method Transform3D.inverse].\n" +"For transforming by inverse of an affine transformation (e.g. with scaling) " +"[code]transform.affine_inverse() * vector[/code] can be used instead. See " +"[method Transform3D.affine_inverse]." +msgstr "" +"假设该变换的基是正交的(即旋转/反射可以,缩放/倾斜不行),将 [Vector3] 逆向变" +"换(乘以)给定的 [Transform3D] 变换矩阵。\n" +"[code]vector * transform[/code] 相当于 [code]transform.inverse() * vector[/" +"code]。请参阅 [method Transform3D.inverse]。\n" +"对于通过仿射变换的逆进行的变换(例如缩放),可以使用 [code]transform." +"affine_inverse() * vector[/code] 代替。请参阅 [method Transform3D." +"affine_inverse]。" + +msgid "" "Multiplies each component of the [Vector3] by the components of the given " "[Vector3].\n" "[codeblock]\n" @@ -123141,6 +138163,20 @@ msgid "Returns a [Vector3i] with the given components." msgstr "返回具有给定分量的 [Vector3i]。" msgid "" +"Min vector, a vector with all components equal to [code]INT32_MIN[/code]. Can " +"be used as a negative integer equivalent of [constant Vector3.INF]." +msgstr "" +"最小向量,所有分量等于 [code]INT32_MIN[/code] 的向量。可用作 [constant " +"Vector3.INF] 的负整数等价物。" + +msgid "" +"Max vector, a vector with all components equal to [code]INT32_MAX[/code]. Can " +"be used as an integer equivalent of [constant Vector3.INF]." +msgstr "" +"最大向量,所有分量等于 [code]INT32_MAX[/code] 的向量。可用作 [constant " +"Vector3.INF] 的整数等价物。" + +msgid "" "Forward unit vector. Represents the local direction of forward, and the " "global direction of north." msgstr "前单位向量。代表局部的前方向,全局的北方向。" @@ -123374,6 +138410,16 @@ msgstr "" "W 轴的枚举值。由 [method max_axis_index] 和 [method min_axis_index] 返回。" msgid "" +"Transforms (multiplies) the [Vector4] by the transpose of the given " +"[Projection] matrix.\n" +"For transforming by inverse of a projection [code]projection.inverse() * " +"vector[/code] can be used instead. See [method Projection.inverse]." +msgstr "" +"通过给定 [Projection] 矩阵的转置变换(乘以)该 [Vector4]。\n" +"对于通过投影的逆进行的变换,可以使用 [code]projection.inverse() * vector[/" +"code] 代替。请参阅 [method Projection.inverse]。" + +msgid "" "Multiplies each component of the [Vector4] by the components of the given " "[Vector4].\n" "[codeblock]\n" @@ -123585,6 +138631,20 @@ msgid "Returns a [Vector4i] with the given components." msgstr "返回具有给定分量的 [Vector4i]。" msgid "" +"Min vector, a vector with all components equal to [code]INT32_MIN[/code]. Can " +"be used as a negative integer equivalent of [constant Vector4.INF]." +msgstr "" +"最小向量,所有分量等于 [code]INT32_MIN[/code] 的向量。可用作 [constant " +"Vector4.INF] 的负整数等价物。" + +msgid "" +"Max vector, a vector with all components equal to [code]INT32_MAX[/code]. Can " +"be used as an integer equivalent of [constant Vector4.INF]." +msgstr "" +"最大向量,所有分量等于 [code]INT32_MAX[/code] 的向量。可用作 [constant " +"Vector4.INF] 的整数等价物。" + +msgid "" "Gets the remainder of each component of the [Vector4i] with the components of " "the given [Vector4i]. This operation uses truncated division, which is often " "not desired as it does not work well with negative numbers. Consider using " @@ -124159,19 +139219,27 @@ msgid "" "Supported video formats are [url=https://www.theora.org/]Ogg Theora[/url] " "([code].ogv[/code], [VideoStreamTheora]) and any format exposed via a " "GDExtension plugin.\n" -"[b]Note:[/b] Due to a bug, VideoStreamPlayer does not support localization " -"remapping yet.\n" "[b]Warning:[/b] On Web, video playback [i]will[/i] perform poorly due to " "missing architecture-specific assembly optimizations." msgstr "" "用于播放 [VideoStream] 资源的控件。\n" "支持的视频格式有 [url=https://www.theora.org/]Ogg Theora[/url]([code].ogv[/" "code],[VideoStreamTheora])以及任何通过 GDExtension 插件公开的格式。\n" -"[b]注意:[/b]由于一个错误,VideoStreamPlayer 还不支持本地化重映射。\n" "[b]警告:[/b]在 Web 上,视频播放[i]会[/i]由于缺少特定于体系结构的汇编优化而表" "现不佳。" msgid "" +"The length of the current stream, in seconds.\n" +"[b]Note:[/b] For [VideoStreamTheora] streams (the built-in format supported " +"by Godot), this value will always be zero, as getting the stream length is " +"not implemented yet. The feature may be supported by video formats " +"implemented by a GDExtension add-on." +msgstr "" +"当前流的长度,单位:秒。\n" +"[b]注意:[/b]对于 [VideoStreamTheora] 流(Godot 支持的内置格式),该值将始终为" +"零,因为获取流长度尚未实现。GDExtension 插件实现的视频格式可能会支持该功能。" + +msgid "" "Returns the video stream's name, or [code]\"<No Stream>\"[/code] if no video " "stream is assigned." msgstr "" @@ -124220,6 +139288,9 @@ msgstr "" "如果为 [code]true[/code],视频会缩放到控件的尺寸。否则,控件的最小尺寸将被自动" "调整以匹配视频流的尺寸。" +msgid "If [code]true[/code], the video restarts when it reaches its end." +msgstr "如果为 [code]true[/code],该视频将在到达末尾时重新开始。" + msgid "If [code]true[/code], the video is paused." msgstr "如果为 [code]true[/code],则暂停视频。" @@ -124313,6 +139384,13 @@ msgid "Returns an individual bit on the rendering layer mask." msgstr "返回渲染层遮罩上的某个比特位。" msgid "" +"Returns a list of the visible embedded [Window]s inside the viewport.\n" +"[b]Note:[/b] [Window]s inside other viewports will not be listed." +msgstr "" +"返回该视口内可见的嵌入 [Window] 的列表。\n" +"[b]注意:[/b]其他视口内的 [Window] 不会被列出。" + +msgid "" "Returns the transform from the viewport's coordinate system to the embedder's " "coordinate system." msgstr "返回从该视口的坐标系到嵌入器坐标系统的变换。" @@ -124417,6 +139495,49 @@ msgstr "" "第一个本地处理输入的父级视口,并返回该视口的 [method is_input_handled]。" msgid "" +"Triggers the given [param event] in this [Viewport]. This can be used to pass " +"an [InputEvent] between viewports, or to locally apply inputs that were sent " +"over the network or saved to a file.\n" +"If [param in_local_coords] is [code]false[/code], the event's position is in " +"the embedder's coordinates and will be converted to viewport coordinates. If " +"[param in_local_coords] is [code]true[/code], the event's position is in " +"viewport coordinates.\n" +"While this method serves a similar purpose as [method Input." +"parse_input_event], it does not remap the specified [param event] based on " +"project settings like [member ProjectSettings.input_devices/pointing/" +"emulate_touch_from_mouse].\n" +"Calling this method will propagate calls to child nodes for following methods " +"in the given order:\n" +"- [method Node._input]\n" +"- [method Control._gui_input] for [Control] nodes\n" +"- [method Node._shortcut_input]\n" +"- [method Node._unhandled_key_input]\n" +"- [method Node._unhandled_input]\n" +"If an earlier method marks the input as handled via [method " +"set_input_as_handled], any later method in this list will not be called.\n" +"If none of the methods handle the event and [member physics_object_picking] " +"is [code]true[/code], the event is used for physics object picking." +msgstr "" +"在该 [Viewport] 中触发给定的 [param event] 事件。可用于在不同视口之间传递 " +"[InputEvent],或者在本地应用通过网络传输或保存在文件中的事件。\n" +"如果 [param in_local_coords] 为 [code]false[/code],则该事件中的位置使用的是嵌" +"入器坐标系,会被转换至视口坐标系。如果 [param in_local_coords] 为 [code]true[/" +"code],则该事件的位置使用的是视口坐标系。\n" +"虽然这个方法的用途和 [method Input.parse_input_event] 类似,但不会根据 " +"[member ProjectSettings.input_devices/pointing/emulate_touch_from_mouse] 等项" +"目设置对指定的 [param event] 进行重映射。\n" +"调用这个方法会将调用传播至子节点,按照以下顺序调用:\n" +"- [method Node._input]\n" +"- [method Control._gui_input] 仅用于 [Control] 节点\n" +"- [method Node._shortcut_input]\n" +"- [method Node._unhandled_key_input]\n" +"- [method Node._unhandled_input]\n" +"如果某个方法使用 [method set_input_as_handled] 将输入标记为已处理,则列表中的" +"后续方法均不会被调用。\n" +"如果没有任何方法处理该事件,并且 [member physics_object_picking] 为 " +"[code]true[/code],则该事件将用于物理对象的拾取。" + +msgid "" "Helper method which calls the [code]set_text()[/code] method on the currently " "focused [Control], provided that it is defined (e.g. if the focused Control " "is [Button] or [LineEdit])." @@ -124425,6 +139546,50 @@ msgstr "" "件上定义了这个方法(例如聚焦 Control 为 [Button] 或 [LineEdit])。" msgid "" +"Triggers the given [InputEvent] in this [Viewport]. This can be used to pass " +"input events between viewports, or to locally apply inputs that were sent " +"over the network or saved to a file.\n" +"If [param in_local_coords] is [code]false[/code], the event's position is in " +"the embedder's coordinates and will be converted to viewport coordinates. If " +"[param in_local_coords] is [code]true[/code], the event's position is in " +"viewport coordinates.\n" +"While this method serves a similar purpose as [method Input." +"parse_input_event], it does not remap the specified [param event] based on " +"project settings like [member ProjectSettings.input_devices/pointing/" +"emulate_touch_from_mouse].\n" +"Calling this method will propagate calls to child nodes for following methods " +"in the given order:\n" +"- [method Node._shortcut_input]\n" +"- [method Node._unhandled_key_input]\n" +"- [method Node._unhandled_input]\n" +"If an earlier method marks the input as handled via [method " +"set_input_as_handled], any later method in this list will not be called.\n" +"If none of the methods handle the event and [member physics_object_picking] " +"is [code]true[/code], the event is used for physics object picking.\n" +"[b]Note:[/b] This method doesn't propagate input events to embedded [Window]s " +"or [SubViewport]s.\n" +"[i]Deprecated.[/i] Use [method push_input] instead." +msgstr "" +"在该 [Viewport] 中触发给定的 [param event] 事件。可用于在不同视口之间传递 " +"[InputEvent],或者在本地应用通过网络传输或保存在文件中的事件。\n" +"如果 [param in_local_coords] 为 [code]false[/code],则该事件中的位置使用的是嵌" +"入器坐标系,会被转换至视口坐标系。如果 [param in_local_coords] 为 [code]true[/" +"code],则该事件的位置使用的是视口坐标系。\n" +"虽然这个方法的用途和 [method Input.parse_input_event] 类似,但不会根据 " +"[member ProjectSettings.input_devices/pointing/emulate_touch_from_mouse] 等项" +"目设置对指定的 [param event] 进行重映射。\n" +"调用这个方法会将调用传播至子节点,按照以下顺序调用:\n" +"- [method Node._shortcut_input]\n" +"- [method Node._unhandled_key_input]\n" +"- [method Node._unhandled_input]\n" +"如果某个方法使用 [method set_input_as_handled] 将输入标记为已处理,则列表中的" +"后续方法均不会被调用。\n" +"如果上述方法均未处理事件,并且 [member physics_object_picking] 为 [code]true[/" +"code],则该事件将用于物理对象的拾取。\n" +"[b]注意:[/b]这个方法不会将输入事件传播至嵌入的 [Window] 和 [SubViewport]。\n" +"[i]已弃用。[/i]请改用 [method push_input]。" + +msgid "" "Set/clear individual bits on the rendering layer mask. This simplifies " "editing this [Viewport]'s layers." msgstr "设置或清除碰撞掩码上的比特位。可以简化 [Viewport] 层的编辑。" @@ -125059,6 +140224,11 @@ msgid "" "upper left quadrant of the [Viewport]." msgstr "在 [Viewport] 的左上象限中绘制 [Decal] 使用的贴花和光投影仪的纹理。" +msgid "" +"Draws the internal resolution buffer of the scene before post-processing is " +"applied." +msgstr "在应用后处理之前绘制场景的内部分辨率缓冲区。" + msgid "Max value for [enum DefaultCanvasItemTextureFilter] enum." msgstr "[enum DefaultCanvasItemTextureFilter] 枚举的最大值。" @@ -125084,6 +140254,24 @@ msgid "Provides the content of a [Viewport] as a dynamic texture." msgstr "以动态纹理的形式提供 [Viewport] 的内容。" msgid "" +"Provides the content of a [Viewport] as a dynamic [Texture2D]. This can be " +"used to mix controls, 2D game objects, and 3D game objects in the same " +"scene.\n" +"To create a [ViewportTexture] in code, use the [method Viewport.get_texture] " +"method on the target viewport.\n" +"[b]Note:[/b] A [ViewportTexture] is always local to its scene (see [member " +"Resource.resource_local_to_scene]). If the scene root is not ready, it may " +"return incorrect data (see [signal Node.ready])." +msgstr "" +"以动态 [Texture2D] 的形式提供 [Viewport] 的内容。可用于在同一场景中混合控件、" +"2D 游戏对象和 3D 游戏对象。\n" +"要在代码中创建 [ViewportTexture],请在目标视口上使用 [method Viewport." +"get_texture] 方法。\n" +"[b]注意:[/b][ViewportTexture] 始终是局部于其场景的(请参阅 [member Resource." +"resource_local_to_scene])。如果该场景根没有准备好,它可能会返回不正确的数据" +"(参见 [signal Node.ready])。" + +msgid "" "The path to the [Viewport] node to display. This is relative to the scene " "root, not to the node that uses the texture.\n" "[b]Note:[/b] In the editor, this path is automatically updated when the " @@ -125095,6 +140283,52 @@ msgstr "" "[b]注意:[/b]在编辑器中,目标视口或其祖级节点发生重命名或移动时会自动更新这个" "路径。在运行时,该路径可能无法自动更新,因为无法确定场景的根节点。" +msgid "" +"A rectangular region of 2D space that, when visible on screen, enables a " +"target node." +msgstr "二维空间的矩形区块,当在屏幕上可见时,启用目标节点。" + +msgid "" +"[VisibleOnScreenEnabler2D] contains a rectangular region of 2D space and a " +"target node. The target node will be automatically enabled (via its [member " +"Node.process_mode] property) when any part of this region becomes visible on " +"the screen, and automatically disabled otherwise. This can for example be " +"used to activate enemies only when the player approaches them.\n" +"See [VisibleOnScreenNotifier2D] if you only want to be notified when the " +"region is visible on screen.\n" +"[b]Note:[/b] [VisibleOnScreenEnabler2D] uses the render culling code to " +"determine whether it's visible on screen, so it won't function unless [member " +"CanvasItem.visible] is set to [code]true[/code]." +msgstr "" +"[VisibleOnScreenEnabler2D] 包含 2D 空间的矩形区块和目标节点。当该区块的任何部" +"分在屏幕上可见时,目标节点将自动启用(通过其 [member Node.process_mode] 属" +"性),否则将自动禁用。例如,这可以被用于仅在玩家接近敌人时激活敌人。\n" +"如果你只想在该区块在屏幕上可见时收到通知,请参阅 " +"[VisibleOnScreenNotifier2D]。\n" +"[b]注意:[/b][VisibleOnScreenEnabler2D] 使用渲染剔除代码来确定它在屏幕上是否可" +"见,因此除非 [member CanvasItem.visible] 被设置为 [code]true[/code],否则它不" +"会起作用。" + +msgid "" +"Determines how the target node is enabled. Corresponds to [enum Node." +"ProcessMode]. When the node is disabled, it always uses [constant Node." +"PROCESS_MODE_DISABLED]." +msgstr "" +"确定如何启用目标节点。对应于 [enum Node.ProcessMode]。当该节点被禁用时,它始终" +"使用 [constant Node.PROCESS_MODE_DISABLED]。" + +msgid "" +"The path to the target node, relative to the [VisibleOnScreenEnabler2D]. The " +"target node is cached; it's only assigned when setting this property (if the " +"[VisibleOnScreenEnabler2D] is inside the scene tree) and every time the " +"[VisibleOnScreenEnabler2D] enters the scene tree. If the path is invalid, an " +"error will be printed in the editor and no node will be affected." +msgstr "" +"目标节点的路径,相对于 [VisibleOnScreenEnabler2D]。目标节点会被缓存;只有在设" +"置这个属性时([VisibleOnScreenEnabler2D] 位于场景树中),以及 " +"[VisibleOnScreenEnabler2D] 进入场景树时会进行赋值。如果路径无效,在编辑器中将" +"打印一条错误,并且不会影响任何节点。" + msgid "Corresponds to [constant Node.PROCESS_MODE_INHERIT]." msgstr "对应 [constant Node.PROCESS_MODE_INHERIT]。" @@ -125104,6 +140338,81 @@ msgstr "对应 [constant Node.PROCESS_MODE_ALWAYS]。" msgid "Corresponds to [constant Node.PROCESS_MODE_WHEN_PAUSED]." msgstr "对应 [constant Node.PROCESS_MODE_WHEN_PAUSED]。" +msgid "" +"A box-shaped region of 3D space that, when visible on screen, enables a " +"target node." +msgstr "3D 空间的盒形区块,当在屏幕上可见时,启用目标节点。" + +msgid "" +"[VisibleOnScreenEnabler3D] contains a box-shaped region of 3D space and a " +"target node. The target node will be automatically enabled (via its [member " +"Node.process_mode] property) when any part of this region becomes visible on " +"the screen, and automatically disabled otherwise. This can for example be " +"used to activate enemies only when the player approaches them.\n" +"See [VisibleOnScreenNotifier3D] if you only want to be notified when the " +"region is visible on screen.\n" +"[b]Note:[/b] [VisibleOnScreenEnabler3D] uses an approximate heuristic that " +"doesn't take walls and other occlusion into account, unless occlusion culling " +"is used. It also won't function unless [member Node3D.visible] is set to " +"[code]true[/code]." +msgstr "" +"[VisibleOnScreenEnabler3D] 包含 3D 空间的盒形区块和目标节点。当该区域的任何部" +"分在屏幕上可见时,目标节点将自动启用(通过其 [member Node.process_mode] 属" +"性),否则将自动禁用。例如,这可以被用于仅在玩家接近敌人时激活敌人。\n" +"如果你只想在该区块在屏幕上可见时收到通知,请参阅 " +"[VisibleOnScreenNotifier3D]。\n" +"[b]注意:[/b][VisibleOnScreenEnabler3D] 使用近似启发式,不考虑墙壁和其他遮挡," +"除非使用遮挡剔除。除非将 [member Node3D.visible] 设置为 [code]true[/code],否" +"则它也不会起作用。" + +msgid "" +"The path to the target node, relative to the [VisibleOnScreenEnabler3D]. The " +"target node is cached; it's only assigned when setting this property (if the " +"[VisibleOnScreenEnabler3D] is inside the scene tree) and every time the " +"[VisibleOnScreenEnabler3D] enters the scene tree. If the path is invalid, an " +"error will be printed in the editor and no node will be affected." +msgstr "" +"目标节点的路径,相对于 [VisibleOnScreenEnabler3D]。目标节点会被缓存;只有在设" +"置这个属性时([VisibleOnScreenEnabler3D] 位于场景树中),以及 " +"[VisibleOnScreenEnabler3D] 进入场景树时会进行赋值。如果路径无效,在编辑器中将" +"打印一条错误,并且不会影响任何节点。" + +msgid "" +"A rectangular region of 2D space that detects whether it is visible on screen." +msgstr "2D 空间的矩形区域,用于检测其在屏幕上是否可见。" + +msgid "" +"[VisibleOnScreenEnabler2D] represents a rectangular region of 2D space. When " +"any part of this region becomes visible on screen or in a viewport, it will " +"emit a [signal screen_entered] signal, and likewise it will emit a [signal " +"screen_exited] signal when no part of it remains visible.\n" +"If you want a node to be enabled automatically when this region is visible on " +"screen, use [VisibleOnScreenEnabler2D].\n" +"[b]Note:[/b] [VisibleOnScreenNotifier2D] uses the render culling code to " +"determine whether it's visible on screen, so it won't function unless [member " +"CanvasItem.visible] is set to [code]true[/code]." +msgstr "" +"[VisibleOnScreenEnabler2D] 表示 2D 空间的矩形区块。当该区块的任何部分在屏幕或" +"视口中可见时,它将发出 [signal screen_entered] 信号,同样,当其任何部分都不可" +"见时,它将发出 [signal screen_exited] 信号。\n" +"如果希望当该区块在屏幕上可见时自动启用节点,请使用 " +"[VisibleOnScreenEnabler2D]。\n" +"[b]注意:[/b][VisibleOnScreenNotifier2D] 使用渲染剔除代码来确定它在屏幕上是否" +"可见,因此除非 [member CanvasItem.visible] 被设置为 [code]true[/code],否则它" +"不会起作用。" + +msgid "" +"If [code]true[/code], the bounding rectangle is on the screen.\n" +"[b]Note:[/b] It takes one frame for the [VisibleOnScreenNotifier2D]'s " +"visibility to be determined once added to the scene tree, so this method will " +"always return [code]false[/code] right after it is instantiated, before the " +"draw pass." +msgstr "" +"如果为 [code]true[/code],则边界矩形在屏幕上。\n" +"[b]注意:[/b][VisibleOnScreenNotifier2D] 被添加到场景树后需要一帧才能确定其可" +"见性,因此该方法在它被实例化后,在绘制阶段之前,将始终返回 [code]false[/" +"code] 。" + msgid "The VisibleOnScreenNotifier2D's bounding rectangle." msgstr "该 VisibleOnScreenNotifier2D 的边界矩形。" @@ -125113,6 +140422,50 @@ msgstr "当该 VisibleOnScreenNotifier2D 进入屏幕时发出。" msgid "Emitted when the VisibleOnScreenNotifier2D exits the screen." msgstr "当该 VisibleOnScreenNotifier2D 退出屏幕时发出。" +msgid "" +"A box-shaped region of 3D space that detects whether it is visible on screen." +msgstr "3D 空间的盒形区块,用于检测其在屏幕上是否可见。" + +msgid "" +"[VisibleOnScreenEnabler3D] represents a box-shaped region of 3D space. When " +"any part of this region becomes visible on screen or in a [Camera3D]'s view, " +"it will emit a [signal screen_entered] signal, and likewise it will emit a " +"[signal screen_exited] signal when no part of it remains visible.\n" +"If you want a node to be enabled automatically when this region is visible on " +"screen, use [VisibleOnScreenEnabler3D].\n" +"[b]Note:[/b] [VisibleOnScreenNotifier3D] uses an approximate heuristic that " +"doesn't take walls and other occlusion into account, unless occlusion culling " +"is used. It also won't function unless [member Node3D.visible] is set to " +"[code]true[/code]." +msgstr "" +"[VisibleOnScreenEnabler3D] 表示 3D 空间的盒形区块。当该区块的任何部分在屏幕或 " +"[Camera3D] 视图中可见时,它将发出 [signal screen_entered] 信号;同样,当其任何" +"部分都不可见时,它将发出 [signal screen_exited] 信号。\n" +"如果你希望当该区块在屏幕上可见时自动启用节点,请使用 " +"[VisibleOnScreenEnabler3D]。\n" +"[b]注意:[/b][VisibleOnScreenNotifier3D] 使用近似启发式,不考虑墙壁和其他遮" +"挡,除非使用遮挡剔除。除非将 [member Node3D.visible] 设置为 [code]true[/" +"code],否则它也不会起作用。" + +msgid "" +"Returns [code]true[/code] if the bounding box is on the screen.\n" +"[b]Note:[/b] It takes one frame for the [VisibleOnScreenNotifier3D]'s " +"visibility to be assessed once added to the scene tree, so this method will " +"always return [code]false[/code] right after it is instantiated." +msgstr "" +"如果为 [code]true[/code],则边界框在屏幕上。\n" +"[b]注意:[/b][VisibleOnScreenNotifier3D] 被添加到场景树后需要一帧来评估其可见" +"性,因此该方法在实例化后将始终返回 [code]false[/code] 。" + +msgid "The [VisibleOnScreenNotifier3D]'s bounding box." +msgstr "该 [VisibleOnScreenNotifier3D] 的边界框。" + +msgid "Emitted when the [VisibleOnScreenNotifier3D] enters the screen." +msgstr "当该 [VisibleOnScreenNotifier3D] 进入屏幕时发出。" + +msgid "Emitted when the [VisibleOnScreenNotifier3D] exits the screen." +msgstr "当该 [VisibleOnScreenNotifier3D] 退出屏幕时发出。" + msgid "Parent of all visual 3D nodes." msgstr "所有可视 3D 节点的父节点。" @@ -125237,6 +140590,17 @@ msgstr "" msgid "A custom shader program with a visual editor." msgstr "带有可视化编辑器的自定义着色器程序。" +msgid "" +"This class provides a graph-like visual editor for creating a [Shader]. " +"Although [VisualShader]s do not require coding, they share the same logic " +"with script shaders. They use [VisualShaderNode]s that can be connected to " +"each other to control the flow of the shader. The visual shader graph is " +"converted to a script shader behind the scenes." +msgstr "" +"该类提供了一个类似图形的可视化编辑器,用于创建 [Shader]。尽管 [VisualShader] " +"不需要编码,但它们与脚本着色器共享相同的逻辑。它们使用可以相互连接的 " +"[VisualShaderNode] 来控制着色器的流。可视化着色器图在幕后被转换为脚本着色器。" + msgid "Using VisualShaders" msgstr "使用可视化着色器" @@ -125395,10 +140759,28 @@ msgstr "表示 [VisualShader] 的输出节点。" msgid "Base class for [VisualShader] nodes. Not related to scene nodes." msgstr "[VisualShader] 节点的基类。与场景节点无关。" +msgid "" +"Visual shader graphs consist of various nodes. Each node in the graph is a " +"separate object and they are represented as a rectangular boxes with title " +"and a set of properties. Each node also has connection ports that allow to " +"connect it to another nodes and control the flow of the shader." +msgstr "" +"可视化着色器图由各种节点组成。图中的每个节点都是一个独立的对象,它们被表示为带" +"有标题和一系列属性的矩形框。每个节点还有连接端口,可以将其连接到另一个节点并控" +"制着色器的流程。" + msgid "Clears the default input ports value." msgstr "清除默认输入端口值。" msgid "" +"Returns the input port which should be connected by default when this node is " +"created as a result of dragging a connection from an existing node to the " +"empty space on the graph." +msgstr "" +"返回输入端口,当由于将连接从已有节点拖动到图形上的空白区域而创建节点时,默认情" +"况下应连接该输入端口。" + +msgid "" "Returns an [Array] containing default values for all of the input ports of " "the node in the form [code][index0, value0, index1, value1, ...][/code]." msgstr "" @@ -125430,6 +140812,49 @@ msgstr "" "开进行预览。" msgid "" +"Floating-point scalar. Translated to [code skip-lint]float[/code] type in " +"shader code." +msgstr "" +"浮点数类型。在着色器代码中,会被翻译为 [code skip-lint]float[/code] 类型。" + +msgid "" +"Integer scalar. Translated to [code skip-lint]int[/code] type in shader code." +msgstr "整数标量。在着色器代码中,会被翻译为 [code skip-lint]int[/code] 类型。" + +msgid "" +"Unsigned integer scalar. Translated to [code skip-lint]uint[/code] type in " +"shader code." +msgstr "" +"无符号整数标量。在着色器代码中,会被翻译为 [code skip-lint]uint[/code] 类型。" + +msgid "" +"2D vector of floating-point values. Translated to [code skip-lint]vec2[/code] " +"type in shader code." +msgstr "" +"浮点数 2D 向量。在着色器代码中,会被翻译为 [code skip-lint]vec2[/code] 类型。" + +msgid "" +"3D vector of floating-point values. Translated to [code skip-lint]vec3[/code] " +"type in shader code." +msgstr "" +"浮点数 3D 向量。在着色器代码中,会被翻译为 [code skip-lint]vec3[/code] 类型。" + +msgid "" +"4D vector of floating-point values. Translated to [code skip-lint]vec4[/code] " +"type in shader code." +msgstr "" +"浮点数 4D 向量。在着色器代码中,会被翻译为 [code skip-lint]vec4[/code] 类型。" + +msgid "" +"Boolean type. Translated to [code skip-lint]bool[/code] type in shader code." +msgstr "" +"布尔值类型。在着色器代码中,会被翻译为 [code skip-lint]bool[/code] 类型。" + +msgid "" +"Transform type. Translated to [code skip-lint]mat4[/code] type in shader code." +msgstr "变换类型。在着色器代码中,会被翻译为 [code skip-lint]mat4[/code] 类型。" + +msgid "" "Sampler type. Translated to reference of sampler uniform in shader code. Can " "only be used for input ports in non-uniform nodes." msgstr "" @@ -125479,6 +140904,13 @@ msgstr "代表 [enum BillboardType] 枚举的大小。" msgid "A boolean constant to be used within the visual shader graph." msgstr "在可视化着色器图中使用的布尔常量。" +msgid "" +"Has only one output port and no inputs.\n" +"Translated to [code skip-lint]bool[/code] in the shader language." +msgstr "" +"只有一个输出端口,没有输入。\n" +"在着色器语言中被转换成 [code skip-lint]bool[/code]。" + msgid "A boolean constant which represents a state of this node." msgstr "布尔常量,表示该节点的状态。" @@ -126023,6 +141455,17 @@ msgstr "" "[b]必须[/b]定义这个方法。" msgid "" +"Override this method to define the input port which should be connected by " +"default when this node is created as a result of dragging a connection from " +"an existing node to the empty space on the graph.\n" +"Defining this method is [b]optional[/b]. If not overridden, the connection " +"will be created to the first valid port." +msgstr "" +"覆盖该方法来定义当由于将连接从已有节点拖动到图形上的空白区域而创建节点时应默认" +"连接的输入端口。\n" +"定义这个方法是[b]可选的[/b],如果未被覆盖,将创建到第一个有效端口的连接。" + +msgid "" "Override this method to define the description of the associated custom node " "in the Visual Shader Editor's members dialog.\n" "Defining this method is [b]optional[/b]." @@ -126079,6 +141522,17 @@ msgstr "" "定义该方法是[b]必需的[/b]。如果没有被覆盖,则该节点没有输入端口。" msgid "" +"Override this method to define the default value for the specified input " +"port. Prefer use this over [method VisualShaderNode." +"set_input_port_default_value].\n" +"Defining this method is [b]required[/b]. If not overridden, the node has no " +"default values for their input ports." +msgstr "" +"覆盖该方法可以定义指定输入端口的默认值。优先使用该方法而不是 [method " +"VisualShaderNode.set_input_port_default_value]。\n" +"定义该方法是[b]必需的[/b]。如果没有被覆盖,则该节点的输入端口没有默认值。" + +msgid "" "Override this method to define the names of input ports of the associated " "custom node. The names are used both for the input slots in the editor and as " "identifiers in the shader code, and are passed in the [code]input_vars[/code] " @@ -126151,6 +141605,37 @@ msgstr "" "[constant VisualShaderNode.PORT_TYPE_SCALAR]类型。" msgid "" +"Override this method to define the number of the properties.\n" +"Defining this method is [b]optional[/b]." +msgstr "" +"覆盖这个方法来定义属性的数量。\n" +"定义这个方法是[b]可选[/b]的。" + +msgid "" +"Override this method to define the default index of the property of the " +"associated custom node.\n" +"Defining this method is [b]optional[/b]." +msgstr "" +"覆盖这个方法可以定义关联的自定义节点的属性的默认索引。\n" +"定义这个方法是[b]可选[/b]的。" + +msgid "" +"Override this method to define the names of the property of the associated " +"custom node.\n" +"Defining this method is [b]optional[/b]." +msgstr "" +"覆盖这个方法可以定义关联的自定义节点的属性的名称。\n" +"定义这个方法是[b]可选[/b]的。" + +msgid "" +"Override this method to define the options inside the drop-down list property " +"of the associated custom node.\n" +"Defining this method is [b]optional[/b]." +msgstr "" +"覆盖这个方法可以定义关联的自定义节点的下拉列表属性内的选项。\n" +"定义这个方法是[b]可选[/b]的。" + +msgid "" "Override this method to define the return icon of the associated custom node " "in the Visual Shader Editor's members dialog.\n" "Defining this method is [b]optional[/b]. If not overridden, no return icon is " @@ -126179,6 +141664,14 @@ msgstr "" "覆盖这个方法可以在 Visual Shader 编辑器的成员对话框中启用高端标记。\n" "定义这个方法是[b]可选[/b]的。未覆盖时为 [code]false[/code]。" +msgid "" +"Returns the selected index of the drop-down list option within a graph. You " +"may use this function to define the specific behavior in the [method " +"_get_code] or [method _get_global_code]." +msgstr "" +"返回图表中下拉列表选项的选定索引。你可以使用该函数来定义 [method _get_code] " +"或 [method _get_global_code] 中的特定行为。" + msgid "Calculates a derivative within the visual shader graph." msgstr "在可视化着色器图中,计算导数。" @@ -126313,6 +141806,9 @@ msgid "" "A scalar floating-point constant to be used within the visual shader graph." msgstr "可视化着色器图中使用的浮点数标量常量。" +msgid "Translated to [code skip-lint]float[/code] in the shader language." +msgstr "翻译为着色器语言中的 [code skip-lint]float[/code]。" + msgid "A floating-point constant which represents a state of this node." msgstr "代表该节点状态的浮点数常量。" @@ -126780,6 +142276,11 @@ msgstr "" "[/code] ,参阅[method add_output_port]。" msgid "" +"Outputs a 3D vector based on the result of a floating point comparison within " +"the visual shader graph." +msgstr "根据可视化着色器图中浮点比较的结果输出 3D 向量。" + +msgid "" "This visual shader node has six input ports. Port 1 and 2 provide the two " "floating point numbers [code]a[/code] and [code]b[/code] that will be " "compared. Port 3 is the tolerance, which allows similar floating point number " @@ -126826,6 +142327,9 @@ msgstr "通过 [member input_name] 更改输入时发出。" msgid "A scalar integer constant to be used within the visual shader graph." msgstr "标量整数常量,在可视化着色器图中使用。" +msgid "Translated to [code skip-lint]int[/code] in the shader language." +msgstr "翻译为着色器语言中的 [code skip-lint]int[/code]。" + msgid "An integer constant which represents a state of this node." msgstr "整数常量,代表该节点的状态。" @@ -127324,6 +142828,13 @@ msgid "" msgstr "可视化着色器节点,使用旋转矩阵修改对象的旋转。" msgid "" +"RotationByAxis node will transform the vertices of a mesh with specified axis " +"and angle in radians. It can be used to rotate an object in an arbitrary axis." +msgstr "" +"RotationByAxis 节点将使用指定的轴和弧度角度变换网格的顶点。它可被用于沿任意轴" +"旋转对象。" + +msgid "" "A base node for nodes which samples 3D textures in the visual shader graph." msgstr "可视化着色器图中,对 3D 纹理进行采样的节点的基础节点。" @@ -127430,6 +142941,13 @@ msgstr "" msgid "A selector function for use within the visual shader graph." msgstr "可视化着色器中使用的选择器函数。" +msgid "" +"Returns an associated value of the [member op_type] type if the provided " +"boolean value is [code]true[/code] or [code]false[/code]." +msgstr "" +"如果提供的布尔值为 [code]true[/code] 或 [code]false[/code],则返回 [member " +"op_type] 类型的一个关联值。" + msgid "A transform type." msgstr "变换类型。" @@ -127596,38 +143114,50 @@ msgid "" msgstr "使用由该着色器所附加到的节点决定的过滤器对纹理进行采样。" msgid "" -"The texture filter reads from the nearest pixel, but selects a mipmap based " -"on the angle between the surface and the camera view. This reduces artifacts " -"on surfaces that are almost in line with the camera. The anisotropic " -"filtering level can be changed by adjusting [member ProjectSettings.rendering/" -"textures/default_filters/anisotropic_filtering_level].\n" -"[b]Note:[/b] This texture filter is rarely useful in 2D projects. [constant " -"FILTER_LINEAR_MIPMAP] is usually more appropriate." -msgstr "" -"纹理过滤从最近的像素读取,但根据表面和相机视图之间的角度选择一个 mipmap。这减" -"少了几乎与相机对齐的表面上的伪影。可以通过调整 [member ProjectSettings." -"rendering/textures/default_filters/anisotropic_filtering_level],来更改各向异" -"性过滤级别。\n" -"[b]注意:[/b]这种纹理过滤在 2D 项目中很少有用。[constant " -"FILTER_LINEAR_MIPMAP] 通常更合适。" - -msgid "" -"The texture filter blends between the nearest 4 pixels and selects a mipmap " -"based on the angle between the surface and the camera view. This reduces " -"artifacts on surfaces that are almost in line with the camera. This is the " -"slowest of the filtering options, but results in the highest quality " -"texturing. The anisotropic filtering level can be changed by adjusting " -"[member ProjectSettings.rendering/textures/default_filters/" +"The texture filter reads from the nearest pixel and blends between 2 mipmaps " +"(or uses the nearest mipmap if [member ProjectSettings.rendering/textures/" +"default_filters/use_nearest_mipmap_filter] is [code]true[/code]) based on the " +"angle between the surface and the camera view. This makes the texture look " +"pixelated from up close, and smooth from a distance. Anisotropic filtering " +"improves texture quality on surfaces that are almost in line with the camera, " +"but is slightly slower. The anisotropic filtering level can be changed by " +"adjusting [member ProjectSettings.rendering/textures/default_filters/" "anisotropic_filtering_level].\n" "[b]Note:[/b] This texture filter is rarely useful in 2D projects. [constant " -"FILTER_LINEAR_MIPMAP] is usually more appropriate." +"FILTER_NEAREST_MIPMAP] is usually more appropriate in this case." msgstr "" -"纹理过滤在最近的 4 个像素之间进行混合,并根据表面和相机视图之间的角度选择一个 " -"mipmap。这减少了几乎与相机对齐的表面上的伪影。这是最慢的过滤选项,但会产生最高" -"质量的纹理。可以通过调整 [member ProjectSettings.rendering/textures/" -"default_filters/anisotropic_filtering_level],来更改各向异性过滤级别。\n" -"[b]注意:[/b]这种纹理过滤在 2D 项目中很少有用。[constant " -"FILTER_LINEAR_MIPMAP] 通常更合适。" +"纹理过滤从最近的像素读取并根据表面和相机视图之间的角度在 2 个多级渐远纹理之间" +"进行混合(或者如果 [member ProjectSettings.rendering/textures/default_filters/" +"use_nearest_mipmap_filter] 为 [code]true[/code],则使用最近的多级渐远纹理)。" +"这使得纹理从近处看起来像素化,从远处看起来平滑。各向异性过滤提高了几乎与相机位" +"于一条线的表面上的纹理质量,但速度稍慢。各向异性过滤级别可以通过调整 [member " +"ProjectSettings.rendering/textures/default_filters/" +"anisotropic_filtering_level] 来改变。\n" +"[b]注意:[/b]该纹理过滤在 2D 项目中很少有用。[constant FILTER_NEAREST_MIPMAP] " +"在这种情况下通常更合适。" + +msgid "" +"The texture filter blends between the nearest 4 pixels and blends between 2 " +"mipmaps (or uses the nearest mipmap if [member ProjectSettings.rendering/" +"textures/default_filters/use_nearest_mipmap_filter] is [code]true[/code]) " +"based on the angle between the surface and the camera view. This makes the " +"texture look smooth from up close, and smooth from a distance. Anisotropic " +"filtering improves texture quality on surfaces that are almost in line with " +"the camera, but is slightly slower. The anisotropic filtering level can be " +"changed by adjusting [member ProjectSettings.rendering/textures/" +"default_filters/anisotropic_filtering_level].\n" +"[b]Note:[/b] This texture filter is rarely useful in 2D projects. [constant " +"FILTER_LINEAR_MIPMAP] is usually more appropriate in this case." +msgstr "" +"纹理过滤在最近的 4 个像素之间进行混合,并基于表面与相机视图之间的角度在 2 个多" +"级渐远纹理之间进行混合(或者如果 [member ProjectSettings.rendering/textures/" +"default_filters/use_nearest_mipmap_filter] 为 [code]true[/code],则使用最近的" +"多级渐远纹理)。这使得纹理从近处看起来平滑,从远处看起来也平滑。各向异性过滤提" +"高了几乎与相机位于一条线的表面上的纹理质量,但速度稍慢。各向异性过滤级别可以通" +"过调整 [member ProjectSettings.rendering/textures/default_filters/" +"anisotropic_filtering_level] 来改变。\n" +"[b]注意:[/b]该纹理过滤在 2D 项目中很少有用。[constant FILTER_LINEAR_MIPMAP] " +"在这种情况下通常更合适。" msgid "" "Sample the texture using the repeat mode determined by the node this shader " @@ -128232,6 +143762,19 @@ msgstr "" "在着色器语言中转换成 [code]refract(I, N, eta)[/code],其中 [code]I[/code] 是入" "射向量,[code]N[/code] 是法线向量,[code]eta[/code] 是折射的比率。" +msgid "" +"A visual shader node that calculates the position of the pixel in world space " +"using the depth texture." +msgstr "可视化着色器节点,使用深度纹理计算像素在世界空间中的位置。" + +msgid "" +"The WorldPositionFromDepth node reconstructs the depth position of the pixel " +"in world space. This can be used to obtain world space UVs for projection " +"mapping like Caustics." +msgstr "" +"WorldPositionFromDepth 节点重建世界空间中像素的深度位置。这可被用于获取用于投" +"影映射(如焦散)的世界空间 UV。" + msgid "Real-time global illumination (GI) probe." msgstr "实时全局光照(GI)探测。" @@ -130103,6 +145646,17 @@ msgid "" "Requests an update of the [Window] size to fit underlying [Control] nodes." msgstr "请求更新 [Window] 大小以适应底层 [Control] 节点。" +msgid "" +"Returns the combined minimum size from the child [Control] nodes of the " +"window. Use [method child_controls_changed] to update it when children nodes " +"have changed.\n" +"The value returned by this method can be overridden with [method " +"_get_contents_minimum_size]." +msgstr "" +"返回该窗口子 [Control] 节点最小尺寸的合并大小。请在子节点发生改变时使用 " +"[method child_controls_changed] 进行更新。\n" +"这个方法的返回值可以使用 [method _get_contents_minimum_size] 覆盖。" + msgid "Returns [code]true[/code] if the [param flag] is set." msgstr "如果设置了标志 [param flag],则返回 [code]true[/code]。" @@ -130517,7 +146071,7 @@ msgid "" "automatic scale factor determined by [member content_scale_size]." msgstr "" "决定 2D 元素最终缩放系数的策略。会影响 [member content_scale_factor] 的使用," -"与 [member display/window/stretch/mode] 决定的自动缩放系数共同生效。" +"与 [member content_scale_size] 决定的自动缩放系数共同生效。" msgid "The screen the window is currently on." msgstr "该窗口当前所在的屏幕。" @@ -130549,6 +146103,12 @@ msgid "" msgstr "指定该 [Window] 的初始位置类型。见 [enum WindowInitialPosition] 常量。" msgid "" +"If [code]true[/code], the [Window] width is expanded to keep the title bar " +"text fully visible." +msgstr "" +"如果为 [code]true[/code],则该 [Window] 宽度被扩展以保持标题栏文本完全可见。" + +msgid "" "If non-zero, the [Window] can't be resized to be bigger than this size.\n" "[b]Note:[/b] This property will be ignored if the value is lower than [member " "min_size]." @@ -130821,6 +146381,26 @@ msgstr "" "(例如在 Android 上按下“返回”按钮)。" msgid "" +"Emitted when the mouse cursor enters the [Window]'s visible area, that is not " +"occluded behind other [Control]s or windows, provided its [member Viewport." +"gui_disable_input] is [code]false[/code] and regardless if it's currently " +"focused or not." +msgstr "" +"当鼠标光标进入 [Window] 的可见区域时发出,该区域未被其他 [Control] 或窗口遮" +"挡,只要其 [member Viewport.gui_disable_input] 为 [code]false[/code] 并且无论" +"它当前聚焦与否。" + +msgid "" +"Emitted when the mouse cursor leaves the [Window]'s visible area, that is not " +"occluded behind other [Control]s or windows, provided its [member Viewport." +"gui_disable_input] is [code]false[/code] and regardless if it's currently " +"focused or not." +msgstr "" +"当鼠标光标离开 [Window] 的可见区域时发出,该区域未被其他 [Control] 或窗口遮" +"挡,只要其 [member Viewport.gui_disable_input] 为 [code]false[/code] 并且无论" +"它当前聚焦与否。" + +msgid "" "Emitted when window title bar decorations are changed, e.g. macOS window " "enter/exit full screen mode, or extend-to-title flag is changed." msgstr "" @@ -131374,6 +146954,14 @@ msgstr "" "在直线 [code]ax + by = d[/code] 的标量方程中,这是 [code]d[/code],而 [code]" "(a, b)[/code] 坐标由 [member normal] 属性表示。" +msgid "" +"The line's normal, typically a unit vector. Its direction indicates the non-" +"colliding half-plane. Can be of any length but zero. Defaults to [constant " +"Vector2.UP]." +msgstr "" +"该直线的法线,通常是一个单位向量。它的方向表示非碰撞半平面。可以是任意长度,但" +"不能为零。默认为 [constant Vector2.UP]。" + msgid "A 3D world boundary (half-space) shape used for physics collision." msgstr "用于物理碰撞的 3D 空间边界(半空间)形状。" @@ -132033,6 +147621,14 @@ msgstr "关闭接口。" msgid "On an AR interface, [code]true[/code] if anchor detection is enabled." msgstr "在 AR 接口上,如果启用锚点检测,则为 [code]true[/code]。" +msgid "" +"Specify how XR should blend in the environment. This is specific to certain " +"AR and passthrough devices where camera images are blended in by the XR " +"compositor." +msgstr "" +"指定 XR 应如何融入环境。这是特定于某些 AR 和直通设备的,其中相机图像由 XR 合成" +"器混合。" + msgid "[code]true[/code] if this is the primary interface." msgstr "[code]true[/code] 如果这是个主接口。" @@ -132354,6 +147950,14 @@ msgstr "" "Godot 定义了许多标准跟踪器,例如 [code]left_hand[/code] 和 [code]right_hand[/" "code],但也可以在给定的 [XRInterface] 中配置其他跟踪器。" +msgid "" +"Emitted when the [member tracker] starts or stops receiving updated tracking " +"data for the [member pose] being tracked. The [param tracking] argument " +"indicates whether the tracker is getting updated tracking data." +msgstr "" +"当 [member tracker] 开始或停止接收正被跟踪的 [member pose] 的更新跟踪数据时发" +"出。[param tracking] 参数指示跟踪器是否正在获取更新的跟踪数据。" + msgid "The origin point in AR/VR." msgstr "AR/VR 的原点。" @@ -132514,6 +148118,14 @@ msgstr "" "code]。" msgid "" +"Marks this pose as invalid, we don't clear the last reported state but it " +"allows users to decide if trackers need to be hidden if we lose tracking or " +"just remain at their last known position." +msgstr "" +"将此姿势标记为无效,我们不会清除最后报告的状态,但如果我们失去追踪,它允许用户" +"决定是否需要隐藏追踪器,或仅保留在其最后一个已知位置。" + +msgid "" "Changes the value for the given input. This method is called by a " "[XRInterface] implementation and should not be used directly." msgstr "更改给定输入的值。此方法由一个 [XRInterface] 实现调用,不应直接使用。" @@ -132574,6 +148186,11 @@ msgstr "当该追踪器上的一个拇指杆或拇指板移动时发出。" msgid "Emitted when the state of a pose tracked by this tracker changes." msgstr "当被此追踪器追踪的一个姿势状态发生变化时发出。" +msgid "" +"Emitted when a pose tracked by this tracker stops getting updated tracking " +"data." +msgstr "当被该追踪器追踪的一个姿势停止获取更新的跟踪数据时发出。" + msgid "Emitted when the profile of our tracker changes." msgstr "当我们的追踪器的配置发生变化时发出。" diff --git a/doc/translations/zh_TW.po b/doc/translations/zh_TW.po index 7a5a3e99b6..4f8eb7c8af 100644 --- a/doc/translations/zh_TW.po +++ b/doc/translations/zh_TW.po @@ -29,8 +29,8 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine class reference\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" -"PO-Revision-Date: 2023-11-06 00:36+0000\n" -"Last-Translator: longhjues <longhjues@gmail.com>\n" +"PO-Revision-Date: 2023-11-22 07:45+0000\n" +"Last-Translator: Haoyu Qiu <timothyqiu32@gmail.com>\n" "Language-Team: Chinese (Traditional) <https://hosted.weblate.org/projects/" "godot-engine/godot-class-reference/zh_Hant/>\n" "Language: zh_TW\n" @@ -38,7 +38,10 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8-bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 5.2-dev\n" +"X-Generator: Weblate 5.2\n" + +msgid "Resources" +msgstr "資源" msgid "Description" msgstr "說明" @@ -3465,20 +3468,6 @@ msgstr "" "都是空值。" msgid "" -"Returns a weak reference to an object, or [code]null[/code] if [param obj] is " -"invalid.\n" -"A weak reference to an object is not enough to keep the object alive: when " -"the only remaining references to a referent are weak references, garbage " -"collection is free to destroy the referent and reuse its memory for something " -"else. However, until the object is actually destroyed the weak reference may " -"return the object even if there are no strong references to it." -msgstr "" -"返回對某個對象的弱引用,如果 [param obj] 無效,則返回 [code]null[/code]。\n" -"對物件的弱引用不足以使對象保持存活:當對引用對象的剩餘引用都是弱引用時,垃圾回" -"收可以自由銷毀該引用物件並將其記憶體重新用於其他用途。但是,在物件實際被銷毀之" -"前,弱引用可能會返回該物件,即使不存在對它的強引用也是如此。" - -msgid "" "Wraps the [Variant] [param value] between [param min] and [param max]. Can be " "used for creating loop-alike behavior or infinite surfaces.\n" "Variant types [int] and [float] are supported. If any of the arguments is " @@ -9311,7 +9300,7 @@ msgid "Returns a list of the animation keys that are currently queued to play." msgstr "返回目前排隊播放的動畫鍵列表。" msgid "For backward compatibility. See [member AnimationMixer.root_node]." -msgstr "為了向後相容。請參閱[成員AnimationMixer.root_node]。" +msgstr "為了向後相容。請參閱[member AnimationMixer.root_node]。" msgid "" "Pauses the currently playing animation. The [member " @@ -13773,7 +13762,7 @@ msgid "" "[b]Note:[/b] This can be expensive; it is not recommended to call [method " "get_output_latency] every frame." msgstr "" -"傳回音訊驅動程式的有效輸出延遲。這是基於[成員ProjectSettings.audio/driver/" +"傳回音訊驅動程式的有效輸出延遲。這是基於[member ProjectSettings.audio/driver/" "output_latency],但確切的傳回值將根據作業系統和音訊驅動程式的不同而有所不" "同。\n" "[b]注意:[/b]這可能很昂貴;不建議每影格呼叫[method get_output_latency]。" @@ -14143,8 +14132,8 @@ msgid "" "loop_offset] once it is done playing. Useful for ambient sounds and " "background music." msgstr "" -"如果[code]true[/code],音訊播放完畢後將從指定的[成員loop_offset]再次播放。對於" -"環境聲音和背景音樂很有用。 ,“ “,““,“錯誤的”,”,”,”,”" +"如果[code]true[/code],音訊播放完畢後將從指定的[member loop_offset]再次播放。" +"對於環境聲音和背景音樂很有用。 ,“ “,““,“錯誤的”,”,”,”,”" msgid "Contains the raw Ogg data for this stream." msgstr "包含用於這個流的原始 Ogg 資料。" @@ -16189,61 +16178,6 @@ msgstr "保存環境光遮蔽、粗糙度和金屬度資訊的紋理。" msgid "Represents the size of the [enum TextureParam] enum." msgstr "代表 [enum TextureParam] 列舉的大小。" -msgid "" -"The texture filter reads from the nearest pixel only. The simplest and " -"fastest method of filtering, but the texture will look pixelized." -msgstr "" -"紋理篩檢程式僅讀取最鄰近的圖元。最簡單快速的篩選方法,但紋理看起來會圖元化。" - -msgid "" -"The texture filter blends between the nearest 4 pixels. Use this when you " -"want to avoid a pixelated style, but do not want mipmaps." -msgstr "" -"紋理篩檢程式在最鄰近的 4 個圖元之間混合。如果你想要避免圖元化風格,但又不想使" -"用 mipmap,那麼請使用這個選項。" - -msgid "" -"The texture filter reads from the nearest pixel in the nearest mipmap. The " -"fastest way to read from textures with mipmaps." -msgstr "" -"紋理篩檢程式讀取最鄰近的 mipmap 中的最鄰近的圖元。帶有 mipmap 的紋理的最快讀取" -"方法。" - -msgid "" -"The texture filter blends between the nearest 4 pixels and between the " -"nearest 2 mipmaps. Use this for most cases as mipmaps are important to smooth " -"out pixels that are far from the camera." -msgstr "" -"紋理篩檢程式在最鄰近的 4 個圖元和最鄰近的 2 個 mipmap 之間混合。請在大多數情況" -"下使用,因為 mipmap 對於平滑遠離相機的圖元很重要。" - -msgid "" -"The texture filter reads from the nearest pixel, but selects a mipmap based " -"on the angle between the surface and the camera view. This reduces artifacts " -"on surfaces that are almost in line with the camera. The anisotropic " -"filtering level can be changed by adjusting [member ProjectSettings.rendering/" -"textures/default_filters/anisotropic_filtering_level]." -msgstr "" -"紋理篩檢程式讀取最鄰近的圖元,但會根據表面和相機視圖之間的夾角選擇 mipmap。可" -"以減少幾乎與相機成一直線的表面的不自然情況。各向異性篩選級別可以通過調整 " -"[member ProjectSettings.rendering/textures/default_filters/" -"anisotropic_filtering_level] 來改變。" - -msgid "" -"The texture filter blends between the nearest 4 pixels and selects a mipmap " -"based on the angle between the surface and the camera view. This reduces " -"artifacts on surfaces that are almost in line with the camera. This is the " -"slowest of the filtering options, but results in the highest quality " -"texturing. The anisotropic filtering level can be changed by adjusting " -"[member ProjectSettings.rendering/textures/default_filters/" -"anisotropic_filtering_level]." -msgstr "" -"紋理篩檢程式在最鄰近的 4 個圖元之間進行混合,並會根據表面和相機視圖之間的夾角" -"選擇 mipmap。可以減少幾乎與相機成一直線的表面的不自然情況。這是篩選選項中最慢" -"的一個,但可以得到最高品質的紋理。各向異性篩選級別可以通過調整 [member " -"ProjectSettings.rendering/textures/default_filters/" -"anisotropic_filtering_level] 來改變。" - msgid "Represents the size of the [enum TextureFilter] enum." msgstr "代表 [enum TextureFilter] 列舉的大小。" @@ -17308,7 +17242,7 @@ msgstr "" "wiki/Short-Circuit_evaluation]短路評估[/url],可用於避免在某些性能關鍵的情況下" "評估昂貴的條件。\n" "[b]注意:[/b] 依照慣例,傳回布林值的內建方法和屬性通常定義為是非問題、單一形容" -"詞或類似的([method String.is_empty]、[method Node.can_process]、 [成員" +"詞或類似的([method String.is_empty]、[method Node.can_process]、 [member " "Camera2D. enabled]等)。" msgid "Constructs a [bool] set to [code]false[/code]." @@ -19064,18 +18998,6 @@ msgstr "" "use_physical_light_units] 時可用。" msgid "" -"Time for shutter to open and close, measured in seconds. A higher value will " -"let in more light leading to a brighter image, while a lower amount will let " -"in less light leading to a darker image.\n" -"Only available when [member ProjectSettings.rendering/lights_and_shadows/" -"use_physical_light_units] is enabled." -msgstr "" -"快門打開和關閉的時間,單位:秒。較高的值將使更多的光線進入,從而使圖像更亮;而" -"較低的值將使更少的光線進入,從而使圖像更暗。\n" -"僅在啟用 [member ProjectSettings.rendering/lights_and_shadows/" -"use_physical_light_units] 時可用。" - -msgid "" "Override value for [member Camera3D.far]. Used internally when calculating " "depth of field. When attached to a [Camera3D] as its [member Camera3D." "attributes], it will override the [member Camera3D.far] property." @@ -20221,69 +20143,6 @@ msgstr "該 [CanvasItem] 的活動 [World2D] 已更改。" msgid "The [CanvasItem] will inherit the filter from its parent." msgstr "該 [CanvasItem] 將從其父級繼承篩檢程式。" -msgid "" -"The texture filter reads from the nearest pixel only. The simplest and " -"fastest method of filtering. Useful for pixel art." -msgstr "紋理篩檢程式僅讀取最鄰近的圖元。最簡單、最快的篩選方法。可用於圖元畫。" - -msgid "" -"The texture filter blends between the nearest four pixels. Use this for most " -"cases where you want to avoid a pixelated style." -msgstr "" -"紋理篩檢程式在最鄰近的四個圖元之間混合。如果想要避免圖元化樣式,大多數情況下請" -"使用此選項。" - -msgid "" -"The texture filter reads from the nearest pixel in the nearest mipmap. This " -"is the fastest way to read from textures with mipmaps." -msgstr "" -"紋理篩檢程式讀取最鄰近的 mipmap 中的最鄰近圖元。這是使用 mipmap 從紋理中讀取的" -"最快方法。" - -msgid "" -"The texture filter blends between the nearest 4 pixels and between the " -"nearest 2 mipmaps. Use this for non-pixel art textures that may be viewed at " -"a low scale (e.g. due to [Camera2D] zoom), as mipmaps are important to smooth " -"out pixels that are smaller than on-screen pixels." -msgstr "" -"紋理篩檢程式在最鄰近的 4 個圖元和最鄰近的 2 個 mipmap 之間混合。請用於可能以低" -"縮放率查看的非圖元畫紋理(例如由 [Camera2D] 縮放造成),因為 mipmap 對於平滑小" -"於螢幕圖元的圖元很重要。" - -msgid "" -"The texture filter reads from the nearest pixel, but selects a mipmap based " -"on the angle between the surface and the camera view. This reduces artifacts " -"on surfaces that are almost in line with the camera. The anisotropic " -"filtering level can be changed by adjusting [member ProjectSettings.rendering/" -"textures/default_filters/anisotropic_filtering_level].\n" -"[b]Note:[/b] This texture filter is rarely useful in 2D projects. [constant " -"TEXTURE_FILTER_NEAREST_WITH_MIPMAPS] is usually more appropriate." -msgstr "" -"紋理篩檢程式讀取最鄰近的圖元,但會根據表面和相機視圖之間的角度選擇 mipmap。可" -"以減少幾乎與相機成一直線的表面的偽影。各向異性篩選級別可以通過調整 [member " -"ProjectSettings.rendering/textures/default_filters/" -"anisotropic_filtering_level] 來改變。\n" -"[b]注意:[/b]這個紋理篩檢程式很少用於 2D 專案。[constant " -"TEXTURE_FILTER_NEAREST_WITH_MIPMAPS] 通常更合適。" - -msgid "" -"The texture filter blends between the nearest 4 pixels and selects a mipmap " -"based on the angle between the surface and the camera view. This reduces " -"artifacts on surfaces that are almost in line with the camera. This is the " -"slowest of the filtering options, but results in the highest quality " -"texturing. The anisotropic filtering level can be changed by adjusting " -"[member ProjectSettings.rendering/textures/default_filters/" -"anisotropic_filtering_level].\n" -"[b]Note:[/b] This texture filter is rarely useful in 2D projects. [constant " -"TEXTURE_FILTER_LINEAR_WITH_MIPMAPS] is usually more appropriate." -msgstr "" -"紋理篩檢程式在最鄰近的 4 個圖元之間進行混合,並會根據表面和相機視圖之間的角度" -"選擇 mipmap。可以減少幾乎與相機成一直線的表面的偽影。這是最慢的篩選選項,但可" -"以得到最高品質的紋理。各向異性篩選級別可以通過調整 [member ProjectSettings." -"rendering/textures/default_filters/anisotropic_filtering_level] 來改變。\n" -"[b]注意:[/b]這個紋理篩檢程式很少用於 2D 專案。[constant " -"TEXTURE_FILTER_NEAREST_WITH_MIPMAPS] 通常更合適。" - msgid "Texture will not repeat." msgstr "紋理不會重複。" @@ -22153,7 +22012,7 @@ msgid "[Color] of the executing icon for executing lines." msgstr "執行行執行圖示的 [Color]。" msgid "[Color] of background line highlight for folded code region." -msgstr "折疊程式碼區域的背景線所反白的[顏色]。" +msgstr "折疊程式碼區域的背景線所反白的[Color]。" msgid "" "[Color] of the main line length guideline, secondary guidelines will have 50% " @@ -27990,10 +27849,10 @@ msgid "" "processing. You can use the [signal finished] signal to be notified once all " "active particles finish processing." msgstr "" -"如果 [code]true[/code],則正在發射粒子。[成員發射] 可用於啟動和停止粒子發射。" -"但是,如果 [成員 one_shot] 為 [code]true [/code] 將[成員發射] 設為[code]true[/" -"code] 直到所有活動粒子完成處理後才會重新啟動發射週期。一旦所有活動粒子都完成," -"您可以使用[signal finish] 訊號來通知粒子完成處理。" +"如果 [code]true[/code],則正在發射粒子。[member emitting] 可用於啟動和停止粒子" +"發射。但是,如果 [member one_shot] 為 [code]true [/code] 將[member emitting] " +"設為[code]true[/code] 直到所有活動粒子完成處理後才會重新啟動發射週期。一旦所有" +"活動粒子都完成,您可以使用[signal finish] 訊號來通知粒子完成處理。" msgid "" "How rapidly particles in an emission cycle are emitted. If greater than " @@ -28181,9 +28040,6 @@ msgstr "" msgid "Particles are drawn in the order emitted." msgstr "粒子按發射順序繪製。" -msgid "Particles are drawn in order of remaining lifetime." -msgstr "粒子按剩餘壽命的順序繪製。" - msgid "" "Use with [method set_param_min], [method set_param_max], and [method " "set_param_curve] to set initial velocity properties." @@ -36198,7 +36054,7 @@ msgstr "" "如果 [code]true[/code],匯出 iOS專案檔案而不建構 XCArchive 或 [code].ipa[/" "code] 檔案。如果 [code]false[/code],匯出iOS 專案檔案並同時建置XCArchive 和" "[code].ipa[/code] 檔案。當Godot 與Fastlane 或其他建置管道結合使用時,您可能需" -"要將其設為[code]true[/程式碼]。" +"要將其設為[code]true[/code]。" msgid "Interpolation method used to resize application icon." msgstr "用於調整套用程式圖示大小的插值方法。" @@ -37369,7 +37225,7 @@ msgstr "" "example:my-plugin:0.0.0[/code]\n" "有關更多信息,請參閱 [url=https://developer.android.com/build/dependency?" "agpversion=4.1#dependency-types]有關依賴項的 Android 文件[/url]。\n" -"[b]注意:[/b] 僅在 Android 上受支援,並且需要啟用 [成員 " +"[b]注意:[/b] 僅在 Android 上受支援,並且需要啟用 [member " "EditorExportPlatformAndroid.gradle_build/use_gradle_build]。" msgid "" @@ -37389,7 +37245,7 @@ msgstr "" "有關更多信息,請參閱 [url=https://docs.gradle.org/current/userguide/" "dependency_management.html#sec:maven_repo]有關依賴管理的 Gradle 檔案[/url]。\n" "[b]注意:[/b] Google 的 Maven 儲存庫和 Maven Central 儲存庫已預設包含在內。\n" -"[b]注意:[/b] 僅在 Android 上受支援,並且需要啟用 [成員 " +"[b]注意:[/b] 僅在 Android 上受支援,並且需要啟用 [member " "EditorExportPlatformAndroid.gradle_build/use_gradle_build]。" msgid "" @@ -37412,7 +37268,7 @@ msgstr "" "code] 下的 AAR 檔案可以使用 [code]res://addons/hello_world_plugin/HelloWorld." "release 作為絕對路徑返回.aar[/code] 或使用[code]hello_world_plugin/HelloWorld." "release.aar[/code] 的相對路徑。\n" -"[b] 注意:[/b] 僅在 Android 上受支援,並且需要啟用 [成員 " +"[b] 注意:[/b] 僅在 Android 上受支援,並且需要啟用 [member " "EditorExportPlatformAndroid.gradle_build/use_gradle_build]。" msgid "" @@ -37424,7 +37280,7 @@ msgid "" msgstr "" "由使用者重寫的虛擬方法。這在匯出時用於更新生成的 Android 列表中的 " "[code]activity[/code] 元素的內容。\n" -"[b]注意:[/b] 僅在 Android 上受支援,並且需要啟用 [成員 " +"[b]注意:[/b] 僅在 Android 上受支援,並且需要啟用 [member " "EditorExportPlatformAndroid.gradle_build/use_gradle_build]。" msgid "" @@ -37436,7 +37292,7 @@ msgid "" msgstr "" "由使用者重寫的虛擬方法。這在匯出時用於更新生成的 Android 列表中的 " "[code]application[/code] 元素的內容。\n" -"[b]注意:[/b] 僅在 Android 上受支援,並且需要啟用 [成員 " +"[b]注意:[/b] 僅在 Android 上受支援,並且需要啟用 [member " "EditorExportPlatformAndroid.gradle_build/use_gradle_build]。" msgid "" @@ -37448,7 +37304,7 @@ msgid "" msgstr "" "由使用者重寫的虛擬方法。這在匯出時用於更新生成的 Android 列表中的 " "[code]manifest[/code] 元素的內容。\n" -"[b]注意:[/b] 僅在 Android 上受支援,並且需要啟用 [成員 " +"[b]注意:[/b] 僅在 Android 上受支援,並且需要啟用 [member " "EditorExportPlatformAndroid.gradle_build/use_gradle_build]。" msgid "" @@ -37475,7 +37331,7 @@ msgid "" "warning string if they are not met.\n" "[b]Note:[/b] Use [method get_option] to check the value of the export options." msgstr "" -"檢查給定[參數選項]的要求,如果不滿足則傳回非空警告字串。\n" +"檢查給定 [param option] 的要求,如果不滿足則傳回非空警告字串。\n" "[b]注意:[/b] 使用 [method get_option] 檢查匯出選項的值。" msgid "" @@ -42848,7 +42704,7 @@ msgid "" msgstr "" "包含Blender 執行檔的目錄路徑,用於在匯入期間將Blender 3D 場景檔案[code]." "blend[/code] 轉換為glTF 2.0 格式。需要Blender 3.0 或更高版本。\n" -"若要為您的特定專案啟用此功能,請使用[成員 ProjectSettings.filesystem/import/" +"若要為您的特定專案啟用此功能,請使用[member ProjectSettings.filesystem/import/" "blender/enabled]。" msgid "" @@ -42877,7 +42733,7 @@ msgid "" msgstr "" "FBX2glTF 執行檔的路徑,用於在匯入期間將 Autodesk FBX 3D 場景檔案 [code].fbx[/" "code] 轉換為 glTF 2.0 格式。\n" -"若要為您的特定專案啟用此功能,請使用[成員 ProjectSettings.filesystem/import/" +"若要為您的特定專案啟用此功能,請使用[member ProjectSettings.filesystem/import/" "fbx/enabled]。" msgid "If [code]true[/code], uses lossless compression for binary resources." @@ -43331,24 +43187,6 @@ msgstr "" "[b]Black (OLED)[/b]主題預設時該項會自動啟用,因為該主題預設使用全黑背景。" msgid "" -"The icon and font color scheme to use in the editor.\n" -"- [b]Auto[/b] determines the color scheme to use automatically based on " -"[member interface/theme/base_color].\n" -"- [b]Dark[/b] makes fonts and icons light (suitable for dark themes).\n" -"- [b]Light[/b] makes fonts and icons dark (suitable for light themes). Icon " -"colors are automatically converted by the editor following [url=https://" -"github.com/godotengine/godot/blob/master/editor/editor_themes.cpp#L135]this " -"set of rules[/url]." -msgstr "" -"在編輯器中使用的圖示和字形的配色方案。\n" -"- [b]Auto[/b] 根據 [member interface/theme/base_color] 自動確定要使用的配色方" -"案。\n" -"- [b]Dark[/b] 使字形和圖示變亮(適合深色主題)。\n" -"- [b]Light[/b] 使字形和圖示變暗(適合淺色主題)。圖示顏色由編輯器按照" -"[url=https://github.com/godotengine/godot/blob/master/editor/editor_themes." -"cpp#L135]這組規則[/url]自動轉換。" - -msgid "" "The saturation to use for editor icons. Higher values result in more vibrant " "colors.\n" "[b]Note:[/b] The default editor icon saturation was increased by 30% in Godot " @@ -48547,8 +48385,8 @@ msgid "" "[b]Note:[/b] On macOS, sandboxed apps always use native dialogs to access " "host filesystem." msgstr "" -"如果[code]true[/code],[成員存取]設定為[constant ACCESS_FILESYSTEM],且目前" -"[DisplayServer]支援,則將使用作業系統本機對話方塊而非定制的。\n" +"如果[code]true[/code],[member access]設定為[constant ACCESS_FILESYSTEM],且目" +"前[DisplayServer]支援,則將使用作業系統本機對話方塊而非定制的。\n" "[b]注意:[/b] 在 macOS 上,沙盒應用程式始終使用本機對話方塊存取主機檔案系統。" msgid "Emitted when the user selects a directory." @@ -50865,7 +50703,7 @@ msgstr "" msgid "" "Calculates and returns all the vertex points of a convex shape defined by an " "array of [param planes]." -msgstr "計算並傳回所有由 [參數平面] 陣列定義的凸形狀的頂點。" +msgstr "計算並傳回所有由 [param planes] 陣列定義的凸形狀的頂點。" msgid "" "Returns the 3D point on the 3D segment ([param s1], [param s2]) that is " @@ -51681,7 +51519,7 @@ msgid "" msgstr "" "匯出過程的一部分。此方法在 [method _convert_scene_node] 之後和 [method " "_export_node] 之前執行。\n" -"傳回可以由此擴充保存/匯出的影像格式的陣列。只有當 [GLTFDocument] 的 [member " +"傳回可以由此擴充保存/匯出的影像格式的陣列。只有當 [GLTFDocument] 的 [member " "GLTFDocument.image_format] 在此陣列中時,才會選擇此擴充功能作為影像匯出器。如" "果選擇此 [GLTFDocumentExtension] 作為映像匯出器,則接下來將執行 [method " "_save_image_at_path] 或 [method _serialize_image_to_bytes] 方法之一,否則接下" @@ -53531,7 +53369,7 @@ msgstr "" "能夠在不同顏色之間進行平滑、外觀均勻的過渡。" msgid "A 1D texture that uses colors obtained from a [Gradient]." -msgstr "使用從 [漸層] 獲得的顏色的 1D 紋理。" +msgstr "使用從 [Gradient] 獲得的顏色的 1D 紋理。" msgid "" "A 1D texture that obtains colors from a [Gradient] to fill the texture data. " @@ -56805,25 +56643,6 @@ msgstr "水平翻轉圖像。" msgid "Flips the image vertically." msgstr "垂直翻轉圖像。" -msgid "" -"Generates mipmaps for the image. Mipmaps are precalculated lower-resolution " -"copies of the image that are automatically used if the image needs to be " -"scaled down when rendered. They help improve image quality and performance " -"when rendering. This method returns an error if the image is compressed, in a " -"custom format, or if the image's width/height is [code]0[/code]. Enabling " -"[param renormalize] when generating mipmaps for normal textures will make " -"sure all resulting vector values are normalized.\n" -"It is possible to check if the image has mipmaps by calling [method " -"has_mipmaps] or [method get_mipmap_count]." -msgstr "" -"為圖像生成 Mipmap。Mipmap 是預先計算好的圖像的低解析度副本,如果圖像在渲染時需" -"要按比例縮小,則會自動使用這些副本。它們有助於在渲染時提高圖像品質和性能。如果" -"圖像被壓縮,或採用自訂格式,或圖像的寬度或高度為 [code]0[/code],則該方法返回" -"錯誤。在為法線紋理生成 mipmap 時啟用 [param renormalize] 能夠確保得到的所有向" -"量值都是正規化的。\n" -"呼叫 [method has_mipmaps] 或 [method get_mipmap_count] 能夠檢查圖像是否使用 " -"mipmap。" - msgid "Returns a copy of the image's raw data." msgstr "返回圖像原始資料的副本。" @@ -56908,24 +56727,12 @@ msgstr "" "於 [code]user://[/code] 目錄的圖像,並且可能不適用於匯出的專案。\n" "另請參閱 [ImageTexture] 說明,以獲取使用範例。" -msgid "" -"Loads an image from the binary contents of a BMP file.\n" -"[b]Note:[/b] Godot's BMP module doesn't support 16-bit per pixel images. Only " -"1-bit, 4-bit, 8-bit, 24-bit, and 32-bit per pixel images are supported." -msgstr "" -"從 BMP 檔的二進位內容中載入圖像。\n" -"[b]注意:[/b]Godot 的 BMP 模組不支援 16 位元圖元的圖像。只支援 1 位、4 位、8 " -"位、24 位和 32 位元圖元的圖像。" - msgid "Creates a new [Image] and loads data from the specified file." msgstr "建立一個新的 [Image] 並從指定檔載入資料。" msgid "Loads an image from the binary contents of a JPEG file." msgstr "從 JPEG 檔的二進位內容載入圖像。" -msgid "Loads an image from the binary contents of a KTX file." -msgstr "從 TGA 檔的二進位內容載入圖像。" - msgid "Loads an image from the binary contents of a PNG file." msgstr "從 PNG 檔的二進位內容載入圖像。" @@ -56956,9 +56763,6 @@ msgstr "" "於啟用狀態,但可以使用 [code]module_svg_enabled=no[/code] SCons 選項在建置時停" "用它。" -msgid "Loads an image from the binary contents of a TGA file." -msgstr "從 TGA 檔的二進位內容載入圖像。" - msgid "Loads an image from the binary contents of a WebP file." msgstr "從 WebP 檔的二進位內容載入圖像。" @@ -56971,12 +56775,6 @@ msgstr "" "可以在不增加多邊形數量的情況下向 3D 表面新增大量細節。" msgid "" -"Multiplies color values with alpha values. Resulting color values for a pixel " -"are [code](color * alpha)/256[/code]." -msgstr "" -"將顏色值與 Alpha 值相乘。圖元的結果顏色值為 [code](color * alpha)/256[/code]。" - -msgid "" "Resizes the image to the given [param width] and [param height]. New pixels " "are calculated using the [param interpolation] mode defined via [enum " "Interpolation] constants." @@ -57089,25 +56887,6 @@ msgid "Saves the image as a PNG file to a byte array." msgstr "將該圖像作為 PNG 檔保存到位元組陣列中。" msgid "" -"Saves the image as a WebP (Web Picture) file to the file at [param path]. By " -"default it will save lossless. If [param lossy] is true, the image will be " -"saved lossy, using the [param quality] setting between 0.0 and 1.0 " -"(inclusive)." -msgstr "" -"將該圖像作為 WebP(Web 圖片)檔保存到 [param path] 中的檔中。預設情況下,它將" -"無損保存。如果 [param lossy] 為真,則該圖像將使用介於 0.0 和 1.0(包含)之間" -"的 [param quality] 設定進行有損保存。" - -msgid "" -"Saves the image as a WebP (Web Picture) file to a byte array. By default it " -"will save lossless. If [param lossy] is true, the image will be saved lossy, " -"using the [param quality] setting between 0.0 and 1.0 (inclusive)." -msgstr "" -"將該圖像作為 WebP(Web 圖片)檔保存到位元組陣列中。預設情況下,它將無損保存。" -"如果 [param lossy] 為真,則該圖像將使用介於 0.0 和 1.0(包含)之間的 [param " -"quality] 設定進行有損保存。" - -msgid "" "Overwrites data of an existing [Image]. Non-static equivalent of [method " "create_from_data]." msgstr "覆蓋現有 [Image] 的資料。[method create_from_data] 的非靜態等價物。" @@ -57199,9 +56978,6 @@ msgstr "" "[/codeblocks]\n" "這與 [method set_pixel] 相同,只是使用一個 [Vector2i] 參數而不是兩個整數參數。" -msgid "Shrinks the image by a factor of 2." -msgstr "將圖像縮小 2 倍。" - msgid "Converts the raw data from the sRGB colorspace to a linear scale." msgstr "將原始資料從 sRGB 色彩空間轉換為線性比例。" @@ -58253,60 +58029,6 @@ msgstr "" "要的值(在 0 到 1 的範圍內)。" msgid "" -"Returns [code]true[/code] when the user has [i]started[/i] pressing the " -"action event in the current frame or physics tick. It will only return " -"[code]true[/code] on the frame or tick that the user pressed down the " -"button.\n" -"This is useful for code that needs to run only once when an action is " -"pressed, instead of every frame while it's pressed.\n" -"If [param exact_match] is [code]false[/code], it ignores additional input " -"modifiers for [InputEventKey] and [InputEventMouseButton] events, and the " -"direction for [InputEventJoypadMotion] events.\n" -"[b]Note:[/b] Returning [code]true[/code] does not imply that the action is " -"[i]still[/i] pressed. An action can be pressed and released again rapidly, " -"and [code]true[/code] will still be returned so as not to miss input.\n" -"[b]Note:[/b] Due to keyboard ghosting, [method is_action_just_pressed] may " -"return [code]false[/code] even if one of the action's keys is pressed. See " -"[url=$DOCS_URL/tutorials/inputs/input_examples.html#keyboard-events]Input " -"examples[/url] in the documentation for more information." -msgstr "" -"當使用者在目前影格或物理週期中[i]開始[/i]按下動作事件時返回 [code]true[/" -"code]。只在使用者按下按鈕的那一影格或週期中為 [code]true[/code]。\n" -"如果程式碼只需要在動作按下時執行一次,而不是只要處於按下狀態就每影格都需要執" -"行,那麼這個方法就很有用。\n" -"如果 [param exact_match] 為 [code]false[/code],則會忽略 [InputEventKey] 和 " -"[InputEventMouseButton] 事件的額外輸入修飾鍵,以及 [InputEventJoypadMotion] 事" -"件的方向。\n" -"[b]注意:[/b]返回 [code]true[/code] 並不意味著該動作[i]仍然[/i]處於按下狀態。" -"動作在按下後是可以很快再釋放的,為了不丟失輸入,這種情況下仍然會返回 " -"[code]true[/code]。\n" -"[b]注意:[/b]由於鍵盤重影,即便該動作的某個鍵處於按下狀態,[method " -"is_action_just_pressed] 仍可能會返回 [code]false[/code]。詳情見文件中的" -"[url=$DOCS_URL/tutorials/inputs/input_examples.html#keyboard-events]《輸入示" -"例》[/url]。" - -msgid "" -"Returns [code]true[/code] when the user [i]stops[/i] pressing the action " -"event in the current frame or physics tick. It will only return [code]true[/" -"code] on the frame or tick that the user releases the button.\n" -"[b]Note:[/b] Returning [code]true[/code] does not imply that the action is " -"[i]still[/i] not pressed. An action can be released and pressed again " -"rapidly, and [code]true[/code] will still be returned so as not to miss " -"input.\n" -"If [param exact_match] is [code]false[/code], it ignores additional input " -"modifiers for [InputEventKey] and [InputEventMouseButton] events, and the " -"direction for [InputEventJoypadMotion] events." -msgstr "" -"當使用者在目前影格或物理週期中[i]停止[/i]按下動作事件時返回 [code]true[/" -"code]。只在使用者鬆開按鈕的那一影格或週期中為 [code]true[/code]。\n" -"[b]注意:[/b]返回 [code]true[/code] 並不意味著該動作[i]仍然[/i]處於鬆開狀態。" -"動作在鬆開後是可以很快再按下的,為了不丟失輸入,這種情況下仍然會返回 " -"[code]true[/code]。\n" -"如果 [param exact_match] 為 [code]false[/code],則會忽略 [InputEventKey] 和 " -"[InputEventMouseButton] 事件的額外輸入修飾鍵,以及 [InputEventJoypadMotion] 事" -"件的方向。" - -msgid "" "Returns [code]true[/code] if you are pressing the action event.\n" "If [param exact_match] is [code]false[/code], it ignores additional input " "modifiers for [InputEventKey] and [InputEventMouseButton] events, and the " @@ -58557,7 +58279,7 @@ msgid "" msgstr "" "查詢是否要忽略輸入裝置。可以透過設定環境變數 " "[code]SDL_GAMECONTROLLER_IGNORE_DEVICES[/code] 來忽略裝置。閱讀 [url=https://" -"wiki .libsdl.org/SDL2 ]SDL 檔案[/url] 以了解更多資訊。\n" +"wiki .libsdl.org/SDL2]SDL 檔案[/url] 以了解更多資訊。\n" "[b]注意:[/b] 某些第三方工具可以新增忽略裝置列表。例如,[i]SteamInput[/i] 從實" "體裝置建立虛擬裝置以進行重新對應。為了避免處理相同輸入裝置兩次,原始裝置將新增" "到忽略列表中。" @@ -63112,8 +62834,8 @@ msgstr "" "接。\n" "[b]注意:[/b]如果提供了[member width_curve],則不保證閉合線段的形狀是無縫" "的。\n" -"[b]注意:[/b]首先繪製結束線段和第一線段之間的連接點,並在開始時對[member 梯度]" -"和[member 寬度曲線]進行取樣。這是未來版本中可能會變更的實作細節。" +"[b]注意:[/b]首先繪製結束線段和第一線段之間的連接點,並在開始時對[member " +"gradient]和[member width_curve]進行取樣。這是未來版本中可能會變更的實作細節。" msgid "The color of the polyline. Will not be used if a gradient is set." msgstr "線條的顏色。如果設定了漸變,則不會生效。" @@ -63176,8 +62898,8 @@ msgid "" "LINE_JOINT_BEVEL] to prevent very long miters." msgstr "" "使折線的關節成為尖頭,透過延伸兩個線段的側面直到它們相交來連接它們。如果關節的" -"旋轉太大(基於[member Sharp_limit]),則關節回落到[constant " -"LINE_JOINT_BEVEL] 以防止過長的斜接。" +"旋轉太大(基於[member sharp_limit]),則關節回落到[constant LINE_JOINT_BEVEL] " +"以防止過長的斜接。" msgid "" "Makes the polyline's joints bevelled/chamfered, connecting the sides of the " @@ -64673,10 +64395,11 @@ msgid "" "Surface Material Override properties, use [method MeshInstance3D." "get_surface_override_material] instead." msgstr "" -"傳回給定表面中的[材質]。表面是使用此材質渲染的。\n" +"傳回給定表面中的[Material]。表面是使用此材質渲染的。\n" "[b]注意:[/b] 這將傳回 [Mesh] 資源中的材質,而不是與 [MeshInstance3D] 的表面材" -"質覆蓋屬性關聯的 [材質]。若要取得與 [MeshInstance3D] 的表面材質覆蓋屬性相關的 " -"[材質],請改用 [method MeshInstance3D.get_surface_override_material]。" +"質覆蓋屬性關聯的 [Material]。若要取得與 [MeshInstance3D] 的表面材質覆蓋屬性相" +"關的 [Material],請改用 [method MeshInstance3D." +"get_surface_override_material]。" msgid "" "Sets a [Material] for a given surface. Surface will be rendered using this " @@ -64687,10 +64410,11 @@ msgid "" "Surface Material Override properties, use [method MeshInstance3D." "set_surface_override_material] instead." msgstr "" -"設定為給定表面[材質]。表面將使用此材質渲染。\n" +"設定為給定表面[Material]。表面將使用此材質渲染。\n" "[b]注意:[/b] 這會分配 [Mesh] 資源中的材質,而不是與 [MeshInstance3D] 的表面材" -"質覆蓋屬性關聯的 [材質]。若要設定與 [MeshInstance3D] 的表面材質覆蓋屬性相關的 " -"[材質],請使用 [method MeshInstance3D.set_surface_override_material]。" +"質覆蓋屬性關聯的 [Material]。若要設定與 [MeshInstance3D] 的表面材質覆蓋屬性相" +"關的 [Material],請使用 [method MeshInstance3D." +"set_surface_override_material]。" msgid "Sets a hint to be used for lightmap resolution." msgstr "設定用於光照貼圖解析度的提示。" @@ -65479,9 +65203,9 @@ msgid "" msgstr "" "傳回 [Mesh] 資源的指定 [param surface] 的覆寫 [Material]。另請參閱 [method " "get_surface_override_material_count]。\n" -"[b]注意:[/b] 這將傳回與 [MeshInstance3D] 的表面材質覆蓋屬性關聯的 [材質],而" -"不是 [Mesh] 資源內的材質。若要取得 [Mesh] 資源中的材質,請使用 [method Mesh." -"surface_get_material]。" +"[b]注意:[/b] 這將傳回與 [MeshInstance3D] 的表面材質覆蓋屬性關聯的 " +"[Material],而不是 [Mesh] 資源內的材質。若要取得 [Mesh] 資源中的材質,請使用 " +"[method Mesh.surface_get_material]。" msgid "" "Returns the number of surface override materials. This is equivalent to " @@ -65506,11 +65230,11 @@ msgid "" "resource. To set the material within the [Mesh] resource, use [method Mesh." "surface_get_material] instead." msgstr "" -"為 [Mesh] 資源的指定 [參數表面] 設定覆蓋 [參數材質]。此材質與此 " -"[MeshInstance3D] 關聯,而不是與 [member 網格] 關聯。\n" -"[b]注意:[/b] 這將分配與 [MeshInstance3D] 的表面材質覆蓋屬性關聯的 [材質],而" -"不是 [Mesh] 資源內的材質。若要在 [Mesh] 資源中設定材質,請改用 [Mesh." -"surface_get_material] 方法。" +"為 [Mesh] 資源的指定 [param surface] 設定覆蓋 [param material]。此材質與此 " +"[MeshInstance3D] 關聯,而不是與 [member mesh] 關聯。\n" +"[b]注意:[/b] 這將分配與 [MeshInstance3D] 的表面材質覆蓋屬性關聯的 " +"[Material],而不是 [Mesh] 資源內的材質。若要在 [Mesh] 資源中設定材質,請改用 " +"[Mesh.surface_get_material] 方法。" msgid "The [Mesh] resource for the instance." msgstr "該實例的 [Mesh] 資源。" @@ -67480,7 +67204,7 @@ msgstr "" "當代理程式必須更新已載入的路徑時發出:\n" "- 因為路徑以前是空的。\n" "- 因為導覽地圖已經改變。\n" -"- 因為代理推離目前路徑段比 [member path_max_distance] 更遠。" +"- 因為代理推離目前路徑段比 [member path_max_distance] 更遠。" msgid "" "Emitted once per loaded path when the agent's global position is the first " @@ -71024,9 +70748,6 @@ msgstr "" "如果這是一個實例載入預留位置,則返回 [code]true[/code]。見 " "[InstancePlaceholder]。" -msgid "Returns the [SceneTree] that contains this node." -msgstr "返回包含該節點的 [SceneTree]。" - msgid "Returns the node's [Viewport]." msgstr "返回節點的 [Viewport]。" @@ -71988,8 +71709,8 @@ msgid "" "it's currently focused or not." msgstr "" "當滑鼠遊標進入[Viewport]可見的區域時收到的通知,該區域沒有被其他[Control]或" -"[Window]遮擋,只要其[member Viewport.gui_disable_input ] 為[code]false[/" -"code],不論目前是否獲得焦點。" +"[Window]遮擋,只要其[member Viewport.gui_disable_input] 為[code]false[/code]," +"不論目前是否獲得焦點。" msgid "" "Notification received when the mouse cursor leaves the [Viewport]'s visible " @@ -71998,8 +71719,8 @@ msgid "" "it's currently focused or not." msgstr "" "當滑鼠遊標離開[Viewport]可見的區域時收到的通知,該區域沒有被其他[Control]或" -"[Window]遮擋,只要其[member Viewport.gui_disable_input ] 為[code]false[/" -"code],不論目前是否獲得焦點。" +"[Window]遮擋,只要其[member Viewport.gui_disable_input] 為[code]false[/code]," +"不論目前是否獲得焦點。" msgid "" "Inherits process mode from the node's parent. For the root node, it is " @@ -75183,7 +74904,7 @@ msgid "" "code]." msgstr "" "傳回指定名稱的OpenXR函式的函式指針,轉換為整數。如果指定名稱的函式不存在,則該" -"方法傳回[code]0[/程式碼]。\n" +"方法傳回[code]0[/code]。\n" "[b]注意:[/b] [code]openxr/util.h[/code] 包含用於取得OpenXR 函式的實用宏,例如" "[code]GDEXTENSION_INIT_XR_FUNC_V(xrCreateAction)[/code]。" @@ -75244,10 +74965,10 @@ msgid "" "html]XrResult[/url] converted to a string, with the specified additional " "information." msgstr "" -"如果提供的[url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/" -"XrResult,則回傳[code]true[/code ]。html] XrResult[/url](轉換為整數)成功。否" -"則返回 [code]false[/code] 並列印 [url=https://registry.khronos.org/OpenXR/" -"specs/1.0/man/ html /XrResult.html]XrResult[/url] 轉換為字串,帶有指定的附加資" +"如果提供的 [url=https://registry.khronos.org/OpenXR/specs/1.0/man/html/" +"XrResult.html]XrResult[/url](轉換為整數)成功則回傳[code]true[/code]。否則返" +"回 [code]false[/code] 並列印 [url=https://registry.khronos.org/OpenXR/" +"specs/1.0/man/html/XrResult.html]XrResult[/url] 轉換為字串,帶有指定的附加資" "訊。" msgid "Allows clients to implement OpenXR extensions with GDExtension." @@ -75578,7 +75299,7 @@ msgid "" "[XROrigin3D]!" msgstr "" "如果啟用了手部追踪,則返回由 OpenXR 提供的手 ([param hand]) 的關節 ([param " -"joint]) 的角速度。這是相對於 [XROrigin3D ]!" +"joint]) 的角速度。這是相對於 [XROrigin3D]!" msgid "" "If handtracking is enabled, returns the linear velocity of a joint ([param " @@ -75586,7 +75307,7 @@ msgid "" "[XROrigin3D] without worldscale applied!" msgstr "" "如果啟用手部追踪,則返回由 OpenXR 提供的手 ([param hand]) 的關節 ([param " -"joint]) 的線速度。這是相對於 [XROrigin3D ] 沒有應用世界尺度!" +"joint]) 的線速度。這是相對於 [XROrigin3D] 沒有應用世界尺度!" msgid "" "If handtracking is enabled, returns the position of a joint ([param joint]) " @@ -75594,7 +75315,7 @@ msgid "" "[XROrigin3D] without worldscale applied!" msgstr "" "如果啟用手部追踪,則返回 OpenXR 提供的手 ([param hand]) 的關節 ([param " -"joint]) 的位置。這是相對於 [XROrigin3D ] 沒有應用世界尺度!" +"joint]) 的位置。這是相對於 [XROrigin3D] 沒有應用世界尺度!" msgid "" "If handtracking is enabled, returns the radius of a joint ([param joint]) of " @@ -75620,6 +75341,18 @@ msgstr "" msgid "Returns [code]true[/code] if the given action set is active." msgstr "如果給定的動作集處於活動狀態,則返回 [code]true[/code]。" +msgid "" +"Returns [code]true[/code] if OpenXR's foveation extension is supported, the " +"interface must be initialized before this returns a valid value.\n" +"[b]Note:[/b] This feature is only available on the compatibility renderer and " +"currently only available on some stand alone headsets. For Vulkan set [member " +"Viewport.vrs_mode] to [code]VRS_XR[/code] on desktop." +msgstr "" +"傳回 [code]true[/code] 如果支援 OpenXRs foveation 擴充,則必須在傳回有效值之前" +"初始化介面。\n" +"[b]注意:[/b] 此功能僅在相容性渲染器上可用,並且目前僅在某些獨立耳機上可用。對" +"於 Vulkan,在桌面上將 [member Viewport.vrs_mode] 設定為 [code]VRS_XR[/code]。" + msgid "Sets the given action set as active or inactive." msgstr "將給定的動作集設定為活動或非活動。" @@ -79063,7 +78796,7 @@ msgstr "[PanelContainer] 的背景樣式。" msgid "" "A material that provides a special texture to a [Sky], usually an HDR " "panorama." -msgstr "提供[天空]特殊紋理的材質,通常是 HDR 全景圖。" +msgstr "提供[Sky]特殊紋理的材質,通常是 HDR 全景圖。" msgid "" "A resource referenced in a [Sky] that is used to draw a background. " @@ -87356,13 +87089,6 @@ msgstr "" "僅在重新開機套用程式時才會套用此設定的更改。" msgid "" -"Forces a delay between frames in the main loop (in milliseconds). This may be " -"useful if you plan to disable vertical synchronization." -msgstr "" -"強制主迴圈中影格之間的延遲(以毫秒為單位)。如果你計畫禁用垂直同步,這可能很有" -"用。" - -msgid "" "If [code]true[/code], enables low-processor usage mode. This setting only " "works on desktop platforms. The screen is not redrawn if nothing changes " "visually. This is meant for writing applications and editors, but is pretty " @@ -88553,9 +88279,9 @@ msgid "" "[b]Disabled[/b] stretch mode, this scale factor is applied as-is. This can be " "adjusted to make the UI easier to read on certain displays." msgstr "" -"用於2D 元素的比例因子乘數。這將乘以由[member 顯示/視窗/拉伸/模式] 確定的最終比" -"例因子。如果使用[b]Disabled[/b ] 拉伸模式,此比例因子按原樣應用。可以對其進行" -"調整以使UI 在某些顯示器上更易於閱讀。" +"用於2D 元素的比例因子乘數。這將乘以由[member display/window/stretch/mode] 確定" +"的最終比例因子。如果使用[b]Disabled[/b] 拉伸模式,此比例因子按原樣應用。可以對" +"其進行調整以使UI 在某些顯示器上更易於閱讀。" msgid "If [code]true[/code] subwindows are embedded in the main window." msgstr "如果為 [code]true[/code] 則子視窗是嵌入到主視窗中的。" @@ -88935,9 +88661,9 @@ msgid "" "project. Use the [b]Import[/b] dock for that instead (see [member " "ResourceImporterDynamicFont.antialiasing])." msgstr "" -"預設專案字形的字形抗鋸齒模式。請參閱[member FontFile.antialiasing]。\n" +"預設專案字形的字形抗鋸齒模式。請參閱[member FontFile.antialiasing]。\n" "[b]注意:[/b] 此設定不會影響專案中使用的自訂[字型]。請使用 [b]Import[/b] 停靠" -"列(請參閱[member ResourceImporterDynamicFont.antialiasing])。" +"列(請參閱[member ResourceImporterDynamicFont.antialiasing])。" msgid "" "If set to [code]true[/code], the default font will have mipmaps generated. " @@ -88965,9 +88691,9 @@ msgid "" "project. Use the [b]Import[/b] dock for that instead (see [member " "ResourceImporterDynamicFont.hinting])." msgstr "" -"預設專案字型的字型提示模式。請參閱[member FontFile.hinting]。\n" +"預設專案字型的字型提示模式。請參閱[member FontFile.hinting]。\n" "[b]注意:[/b] 此設定不會影響專案中使用的自訂[字型]。請使用 [b]Import[/b] 停靠" -"列(請參閱[member ResourceImporterDynamicFont.hinting])。" +"列(請參閱[member ResourceImporterDynamicFont.hinting])。" msgid "" "If set to [code]true[/code], the default font will use multichannel signed " @@ -88998,10 +88724,10 @@ msgid "" "project. Use the [b]Import[/b] dock for that instead (see [member " "ResourceImporterDynamicFont.subpixel_positioning])." msgstr "" -"預設專案字型的字型字字形子像素定位模式。請參閱[member FontFile." +"預設專案字型的字型字字形子像素定位模式。請參閱[member FontFile." "subpixel_positioning]。\n" "[b]注意:[/b] 此設定不會影響專案中使用的自訂[字型]。請使用 [b]Import[/b] 停靠" -"列(請參閱[member ResourceImporterDynamicFont.subpixel_positioning])。" +"列(請參閱[member ResourceImporterDynamicFont.subpixel_positioning])。" msgid "" "The default scale factor for [Control]s, when not overridden by a [Theme].\n" @@ -94799,7 +94525,7 @@ msgstr "" "對於整數座標,請使用 [Rect2i]。與 [Rect2] 等效的 3D 是 [AABB]。\n" "[b]注意:[/b] 不支援 [member size] 的負值。對於負大小,大多數 [Rect2] 方法都無" "法正常運作。使用 [method abs] 取得具有非負大小的等效 [Rect2]。\n" -"[b]注意:[/b] 在布林本文中,如果[member 位置] 和[member 大小] 均為零(等於" +"[b]注意:[/b] 在布林本文中,如果[member position] 和[member size] 均為零(等於" "[constant Vector2.ZERO]),則[Rect2] 的計算結果為[code]false[/code] )。否則," "它的計算結果始終為 [code]true[/code]。" @@ -94821,8 +94547,8 @@ msgid "" "Constructs a [Rect2] by setting its [member position] to ([param x], [param " "y]), and its [member size] to ([param width], [param height])." msgstr "" -"透過將 [member 位置] 設定為 ([param x], [param y]) 並將其 [member 大小] 設定" -"為 ([param width], [參數高度]) 。" +"透過將 [member position] 設定為 ([param x], [param y]) 並將其 [member 大小] 設" +"定為 ([param width], [param height]) 。" msgid "" "Returns a [Rect2] equivalent to this rectangle, with its width and height " @@ -94842,8 +94568,8 @@ msgid "" "negative, as most other methods in Godot assume that the [member position] is " "the top-left corner, and the [member end] is the bottom-right corner." msgstr "" -"傳回與此矩形等效的[Rect2],其寬度和高度修改為非負值,其[member 位置]為矩形的左" -"上角。\n" +"傳回與此矩形等效的[Rect2],其寬度和高度修改為非負值,其[member position]為矩形" +"的左上角。\n" "[codeblocks]\n" "[gdscript]\n" "var rect = Rect2(25, 25, -100, -50)\n" @@ -94855,7 +94581,7 @@ msgstr "" "[/csharp]\n" "[/codeblocks]\n" "[b]注意:[/b]當[member 大小]為負數時,建議使用此方法,因為Godot中的大多數其他" -"方法都假設[member 位置]是左上角,[member 結束]是右下角。" +"方法都假設[member position]是左上角,[member end]是右下角。" msgid "" "Returns [code]true[/code] if this rectangle [i]completely[/i] encloses the " @@ -94924,7 +94650,7 @@ msgid "" "[/codeblocks]" msgstr "" "傳回給定的[param amount] 在所有邊上擴充的此矩形的副本。負的[param amount] 會縮" -"小矩形。另請參閱[method Growth_individual] 和[method Growth_side] ]。\n" +"小矩形。另請參閱[method Growth_individual] 和[method Growth_side]。\n" "[codeblocks]\n" "[gdscript]\n" "var a = Rect2(4, 4, 8, 8).grow(4) # a is Rect2(0, 0, 16, 16)\n" @@ -95057,10 +94783,11 @@ msgid "" "left corner, and the [member end] is the bottom-right corner. To get an " "equivalent rectangle with non-negative size, use [method abs]." msgstr "" -"矩形的寬度和高度,從 [member 位置] 開始。設定此值也會影響 [member 結束] 點。\n" +"矩形的寬度和高度,從 [member position] 開始。設定此值也會影響 [member 結束] " +"點。\n" "[b]注意:[/b]建議將寬度和高度設為非負值,因為Godot中的大多數方法都假設[member " -"位置]是左上角,[member 結束]是底部-右上角。若要獲得非負大小的等效矩形,請使用" -"[method abs]。" +"position]是左上角,[member end]是底部-右上角。若要獲得非負大小的等效矩形,請使" +"用[method abs]。" msgid "" "Returns [code]true[/code] if the [member position] or [member size] of both " @@ -95099,12 +94826,12 @@ msgid "" "Vector2i.ZERO]). Otherwise, it always evaluates to [code]true[/code]." msgstr "" "[Rect2i] 內建 [Variant] 型別表示 2D 空間中的軸對齊矩形,使用整數座標。它由其 " -"[member 位置] 和 [member 大小] 定義],即[Vector2i ],由於它不會旋轉,所以常用" -"於快速重疊測試(參見[method intersects])。\n" +"[member position] 和 [member size] 定義,即[Vector2i],由於它不會旋轉,所以常" +"用於快速重疊測試(參見[method intersects])。\n" "浮點座標,請參見[Rect2]。\n" "[b]注意:[/b] 不支援 [member size] 的負值。對於負大小,大多數 [Rect2i] 方法都" "無法正常運作。使用 [method abs] 獲得具有非負大小的等效 [Rect2i]。\n" -"[b]注意:[/b] 在布林本文中,如果[member 位置] 和[member 大小] 均為零(等於" +"[b]注意:[/b] 在布林本文中,如果[member position] 和[member size] 均為零(等於" "[constant Vector2i.ZERO]),則[Rect2i] 的計算結果為[code]false[/code] )。否" "則,它的計算結果始終為 [code]true[/code]。" @@ -95129,8 +94856,8 @@ msgid "" "Constructs a [Rect2i] by setting its [member position] to ([param x], [param " "y]), and its [member size] to ([param width], [param height])." msgstr "" -"透過將 [member 位置] 設定為 ([param x], [param y]) 並將其 [member 大小] 設為 " -"([param width], [參數高度]) 。" +"透過將 [member position] 設定為 ([param x], [param y]) 並將其 [member size] 設" +"為 ([param width], [param height]) 。" msgid "" "Returns a [Rect2i] equivalent to this rectangle, with its width and height " @@ -95150,8 +94877,8 @@ msgid "" "negative, as most other methods in Godot assume that the [member position] is " "the top-left corner, and the [member end] is the bottom-right corner." msgstr "" -"傳回與此矩形等效的[Rect2i],其寬度和高度修改為非負值,其[member 位置]為矩形的" -"左上角。\n" +"傳回與此矩形等效的[Rect2i],其寬度和高度修改為非負值,其[member position]為矩" +"形的左上角。\n" "[codeblocks]\n" "[gdscript]\n" "var rect = Rect2i(25, 25, -100, -50)\n" @@ -95162,8 +94889,8 @@ msgstr "" "var absolute = rect.Abs(); // absolute is Rect2I(-75, -25, 100, 50)\n" "[/csharp]\n" "[/codeblocks]\n" -"[b]注意:[/b]當[member 大小]為負數時,建議使用此方法,因為Godot中的大多數其他" -"方法都假設[member 位置]是左上角,[member 結束]是右下角。" +"[b]注意:[/b]當[member size]為負數時,建議使用此方法,因為Godot中的大多數其他" +"方法都假設[member position]是左上角,[member end]是右下角。" msgid "" "Returns [code]true[/code] if this [Rect2i] completely encloses another one." @@ -95228,7 +94955,7 @@ msgid "" "[/codeblocks]" msgstr "" "傳回給定的[param amount] 在所有邊上擴充的此矩形的副本。負的[param amount] 會縮" -"小矩形。另請參閱[method Growth_individual] 和[method Growth_side] ]。\n" +"小矩形。另請參閱[method Growth_individual] 和[method Growth_side]。\n" "[codeblocks]\n" "[gdscript]\n" "var a = Rect2i(4, 4, 8, 8).grow(4) # a is Rect2i(0, 0, 16, 16)\n" @@ -95330,32 +95057,6 @@ msgstr "該矩形的寬度和高度。" msgid "Base class for reference-counted objects." msgstr "引用計數物件的基底類別。" -msgid "" -"Base class for any object that keeps a reference count. [Resource] and many " -"other helper objects inherit this class.\n" -"Unlike other [Object] types, [RefCounted]s keep an internal reference counter " -"so that they are automatically released when no longer in use, and only then. " -"[RefCounted]s therefore do not need to be freed manually with [method Object." -"free].\n" -"In the vast majority of use cases, instantiating and using [RefCounted]-" -"derived types is all you need to do. The methods provided in this class are " -"only for advanced users, and can cause issues if misused.\n" -"[b]Note:[/b] In C#, reference-counted objects will not be freed instantly " -"after they are no longer in use. Instead, garbage collection will run " -"periodically and will free reference-counted objects that are no longer in " -"use. This means that unused ones will linger on for a while before being " -"removed." -msgstr "" -"所有保持引用計數的物件的基底類別。[Resource] 和許多其他輔助物件繼承該類。\n" -"與其他 [Object] 型別不同,[RefCounted] 保留一個內部引用計數器,以便它們在不再" -"使用時自動釋放,並且僅在那時才會如此。因此,[RefCounted] 不需要使用 [method " -"Object.free] 手動釋放。\n" -"在絕大多數用例中,只需產生實體和使用 [RefCounted] 衍生型別即可。該類中提供的方" -"法僅適用於高級使用者,如果使用不當可能會導致問題。\n" -"[b]注意:[/b]在 C# 中,引用計數的物件在不再使用後不會立即被釋放。相反,垃圾收" -"集將定期運作,並釋放不再使用的引用計數物件。這意味著未使用的引用計數物件會在被" -"移除之前停留一段時間。" - msgid "Returns the current reference count." msgstr "返回目前的引用計數。" @@ -96931,9 +96632,9 @@ msgid "" "[param width], [param height], [param depth], and [param layers]. This can be " "used to allow Godot to render onto foreign images." msgstr "" -"使用給定的[參數型別]、[參數格式]、[參數樣本]、[傳回現有[參數影像] ([程式" -"碼]VkImage[/程式碼])的RID參數usage_flags]、[參數寬度]、[參數高度]、[參數深度]" -"和[參數層]。這可用於允許Godot渲染到外部圖像上。" +"使用給定的[param type]、[param format]、[param samples]、傳回現有[param " +"image] ([code]VkImage[/code])的RID[param usage_flags]、[param width]、[param " +"height]、[param depth]和[param layers]。這可用於允許Godot渲染到外部圖像上。" msgid "" "Creates a shared texture using the specified [param view] and the texture " @@ -103587,7 +103288,7 @@ msgstr "" "Viewport 附加到螢幕)。實際上,這表示Viewport 的最終結果不會被限制在" "[code]0-1[/code] 範圍內,並且可以使用在 3D 渲染中無需調整色彩空間。這允許 2D " "渲染利用需要高動態範圍的效果(例如 2D 發光),並顯著改善需要高度詳細漸變的效果" -"的外觀。此設定與 [member 視窗. use_hdr_2d]。\n" +"的外觀。此設定與 [member Viewport.use_hdr_2d]。\n" "[b]注意:[/b] 使用GL 相容性渲染器時,此設定無效,因為出於效能原因,GL 相容性渲" "染器始終在低動態範圍內渲染。" @@ -104405,9 +104106,6 @@ msgstr "3D 粒子。" msgid "Draw particles in the order that they appear in the particles array." msgstr "按照粒子陣列中出現的順序繪製粒子。" -msgid "Sort particles based on their lifetime." -msgstr "根據粒子的壽命對其進行分類。" - msgid "Sort particles based on their distance to the camera." msgstr "根據粒子與相機的距離對其進行排序。" @@ -105335,30 +105033,6 @@ msgstr "九宮格在需要的地方填充圖塊,並在需要時將它們拉伸 msgid "Uses the default filter mode for this [Viewport]." msgstr "為 [Viewport] 使用預設篩選模式。" -msgid "" -"The texture filter blends between the nearest 4 pixels and between the " -"nearest 2 mipmaps." -msgstr "紋理篩選在最近的 4 個圖元之間和最近的 2 個 mipmap 之間混合。" - -msgid "" -"The texture filter reads from the nearest pixel, but selects a mipmap based " -"on the angle between the surface and the camera view. This reduces artifacts " -"on surfaces that are almost in line with the camera." -msgstr "" -"紋理篩選從最近的圖元讀取,但根據表面和相機視圖之間的角度選擇一個 mipmap。這減" -"少了幾乎與相機共線的表面上的偽影。" - -msgid "" -"The texture filter blends between the nearest 4 pixels and selects a mipmap " -"based on the angle between the surface and the camera view. This reduces " -"artifacts on surfaces that are almost in line with the camera. This is the " -"slowest of the filtering options, but results in the highest quality " -"texturing." -msgstr "" -"紋理篩選在最近的 4 個圖元之間進行混合,並根據表面和相機視圖之間的角度選擇一個 " -"mipmap。這減少了幾乎與相機共線的表面上的偽影。這是最慢的篩選選項,但會產生最高" -"品質的紋理。" - msgid "Max value for [enum CanvasItemTextureFilter] enum." msgstr "[enum CanvasItemTextureFilter] 列舉的最大值。" @@ -105877,9 +105551,6 @@ msgstr "" "[b]注意:[/b]在 C# 中,資源不再被使用後不會立即被釋放。相反,垃圾回收將定期運" "行,並釋放不再使用的資源。這意味著未使用的資源在被刪除之前會停留一段時間。" -msgid "Resources" -msgstr "資源" - msgid "" "Override this method to return a custom [RID] when [method get_rid] is called." msgstr "可以覆蓋此方法,從而在呼叫 [method get_rid] 時返回自訂 [RID]。" @@ -106278,10 +105949,10 @@ msgid "" "\"disabled\" (bit is [code]false[/code])." msgstr "" "用於產生點陣圖的資料來源。\n" -"[b]黑白:[/b] HSV 值大於[member 閾值]的像素將被視為「已啟用」(位元為" +"[b]黑白:[/b] HSV 值大於[member threshold]的像素將被視為「已啟用」(位元為" "[code]true[/code])。如果像素低於或等於閾值,則將被視為「停用」(位元為" "[code]false[/code])。\n" -"[b]Alpha:[/b] Alpha 值大於[member 閾值]的像素將被視為「啟用」(位元為" +"[b]Alpha:[/b] Alpha 值大於[member threshold]的像素將被視為「啟用」(位元為" "[code]true[/code])。如果像素低於或等於閾值,則將被視為“已停用”(位元為 " "[code]false[/code])。" @@ -106403,7 +106074,7 @@ msgid "" msgstr "" "如果[code]true[/code],如果在此動態字形中找不到字形,則自動使用系統字形作為後" "備。這使得支援CJK 字元或表情符號更加簡單,因為您不需要在專案中包含 CJK/emoji " -"字形。另請參閱[member 後備]。\n" +"字形。另請參閱[member fallbacks]。\n" "[b]注意:[/b] 系統字形的外觀會因平台而異。僅 Windows、macOS、Linux、Android " "和 iOS 支援載入系統字形。" @@ -106435,8 +106106,8 @@ msgstr "" "[b]LCD 子像素:[/b] 使用子像素模式的抗鋸齒功能使 LCD 顯示器上的字形更加清晰。" "這是 Windows 和大多數 Linux 發行版上的作業系統所使用的方法。缺點是這可能會在邊" "緣引入“邊緣”,尤其是在不使用標準 RGB 子像素的顯示技術(例如 OLED 顯示器)上。 " -"LCD 子像素佈局由 [member ProjectSettings.gui/theme/lcd_subpixel_layout] 全域" -"控制,這也允許退回到灰階抗鋸齒。" +"LCD 子像素佈局由 [member ProjectSettings.gui/theme/lcd_subpixel_layout] 全域控" +"制,這也允許退回到灰階抗鋸齒。" msgid "" "List of font fallbacks to use if a glyph isn't found in this dynamic font. " @@ -106455,7 +106126,7 @@ msgid "" "[member hinting] effective with fonts that don't include hinting data." msgstr "" "如果 [code]true[/code],則使用 [url=https://freetype.org/]FreeType[/url] 的自" -"動提示器強制產生字型的提示資料。這將使[member 提示]對不包含提示資料的字形有" +"動提示器強制產生字型的提示資料。這將使[member hinting]對不包含提示資料的字形有" "效。" msgid "" @@ -106573,7 +106244,7 @@ msgid "" "this. See also [member language_support]." msgstr "" "覆寫此字形支援的語言腳本列表。如果留空,則由字形元資料提供。通常不需要更改它。" -"另請參閱[member language_support]。" +"另請參閱[member language_support]。" msgid "" "Subpixel positioning improves font rendering appearance, especially at " @@ -106658,8 +106329,8 @@ msgstr "" "例如,[code]0-127[/code](或[code]0x0000-0x007f[/code])表示完整的 ASCII 範" "圍。再例如,[code]' '-'~'[/code] 等價於 [code]32-127[/code],表示可列印(可" "見)ASCII 字元的範圍。\n" -"確保 [member 字元範圍] 不超過定義的 [member 列] * [member 行] 的數量。否則,字" -"形將無法匯入。" +"確保 [member character_ranges] 不超過定義的 [member columns] * [member rows] " +"的數量。否則,字形將無法匯入。" msgid "Number of columns in the font image. See also [member rows]." msgstr "精靈表中的列數。" @@ -106671,7 +106342,7 @@ msgstr "" "在整個影像兩側進行剪切的邊距。這可用於剪切包含屬性資訊或類似資訊的影像部分。" msgid "Number of rows in the font image. See also [member columns]." -msgstr "字型映像中的行數。另請參閱 [member 列]。" +msgstr "字型映像中的行數。另請參閱 [member columns]。" msgid "" "Imports a 3-dimensional texture ([Texture3D]), a [Texture2DArray], a " @@ -106687,7 +106358,7 @@ msgid "" msgstr "" "這會匯入 3 維紋理,然後可以在自訂著色器中將其用作 [FogMaterial] 密度圖或 " "[GPUParticlesAttractorVectorField3D]。另請參閱 [ResourceImporterTexture] 和 " -"[ReureImporterText; ]。" +"[ResourceImporterTextureAtlas]。" msgid "" "Controls how color channels should be used in the imported texture.\n" @@ -106756,8 +106427,8 @@ msgstr "" "如果 [code]false[/code],則在桌面平台上使用速度更快但品質較低的 S3TC 壓縮,在" "行動裝置/Web 平台上使用 ETC2。使用 S3TC 時,DXT1 (BC1) 用於不透明紋理,DXT5 " "(BC3) 用於透明或法線貼圖 (RGTC) 紋理。\n" -"BPTC 和 ASTC 支援 HDR 紋理的 VRAM 壓縮,但 S3TC 和 ETC2 不支援(請參閱" -"[member compress/hdr_compression])。" +"BPTC 和 ASTC 支援 HDR 紋理的 VRAM 壓縮,但 S3TC 和 ETC2 不支援(請參閱[member " +"compress/hdr_compression])。" msgid "" "The quality to use when using the [b]Lossy[/b] compression mode. Higher " @@ -106869,8 +106540,8 @@ msgid "" msgstr "" "音軌中單一節拍內的小節數量。這僅與希望利用互動音樂功能(尚未實作)的音樂相關," "與音效無關。\n" -"[b]進階匯入設定[/b]對話方塊中提供了更方便的[member bar_beats] 編輯器,因為它" -"可以讓您預覽變更而無需重新匯入音訊。" +"[b]進階匯入設定[/b]對話方塊中提供了更方便的[member bar_beats] 編輯器,因為它可" +"以讓您預覽變更而無需重新匯入音訊。" msgid "" "The beat count of the audio track. This is only relevant for music that " @@ -106924,12 +106595,12 @@ msgstr "" "確定播放到音訊結尾後音訊將開始循環的位置。這可用於僅循環音訊檔案的一部分,這對" "於某些環境聲音很有用或音樂。該值以相對於音訊開頭的秒數確定。[code]0.0[/code] " "值將循環整個音訊檔案。\n" -"僅當[member 循環]為[code]true[/code]時才有效。\n" +"僅當[member loop]為[code]true[/code]時才有效。\n" "[b]進階匯入設定[/b]對話方塊中提供了更方便的[member loop_offset]編輯器,因為它" "可以讓您預覽變更而無需重新匯入音訊。" msgid "Imports an OBJ 3D model as a standalone [Mesh] or scene." -msgstr "將 OBJ 3D 模型獨立 [網格] 或場景匯入。" +msgstr "將 OBJ 3D 模型獨立 [Mesh] 或場景匯入。" msgid "" "Unlike [ResourceImporterScene], [ResourceImporterOBJ] will import a single " @@ -107119,7 +106790,7 @@ msgstr "" "如果[code]true[/code],則產生網格的較低細節變體,這些變體將顯示在遠處以提高渲" "染效能。並非所有網格都受益於LOD,特別是如果它們永遠不會從遠處渲染。停用此功能" "可以減少輸出檔案大小並加快匯入速度。請參閱[url=$DOCS_URL/tutorials/3d/" -"mesh_lod.html#doc-mesh-lod]網格細節等級(LOD)[/url ] 了解更多。" +"mesh_lod.html#doc-mesh-lod]網格細節等級(LOD)[/url] 了解更多。" msgid "" "Configures the meshes' [member GeometryInstance3D.gi_mode] in the 3D scene. " @@ -107138,7 +106809,7 @@ msgid "" msgstr "" "控制烘焙光照貼圖上每個紋素的大小。較小的值會導致更精確的光照貼圖,但代價是更大" "的光照貼圖大小和更長的烘焙時間。\n" -"[b]注意:[/b]僅當[member 網格/light_baking]設定為[b]靜態光照貼圖[/b]時有效。" +"[b]注意:[/b]僅當[member meshes/light_baking]設定為[b]靜態光照貼圖[/b]時有效。" msgid "" "If [code]true[/code], [member nodes/root_scale] will be applied to the " @@ -107147,9 +106818,9 @@ msgid "" "[code]false[/code], [member nodes/root_scale] will multiply the scale of the " "root node instead." msgstr "" -"如果[code]true[/code],[member 節點/root_scale]將套用於後代節點、網格、動畫、" +"如果[code]true[/code],[member nodes/root_scale]將套用於後代節點、網格、動畫、" "骨骼等。這表示如果您新增稍後在匯入的場景中新增子節點時,它將不會縮放。如果" -"[code]false[/code],[member 節點/root_scale] 將乘以根節點的縮放比例。" +"[code]false[/code],[member nodes/root_scale] 將乘以根節點的縮放比例。" msgid "" "Override for the root node name. If empty, the root node will use what the " @@ -107164,7 +106835,7 @@ msgid "" "details of how this scale is applied." msgstr "" "用於場景根的均勻比例。[code]1.0[/code]的預設值將不會執行任何重新縮放。有關如何" -"執行的詳細信息,請參閱[member 節點/apply_root_scale]套用此比例。" +"執行的詳細信息,請參閱[member nodes/apply_root_scale]套用此比例。" msgid "" "Override for the root node type. If empty, the root node will use what the " @@ -107199,8 +106870,8 @@ msgid "" "is common in models exported from other tools such as Maya." msgstr "" "如果選中,則使用命名的 [Skin] 進行動畫。[MeshInstance3D] 節點包含 3 個相關屬" -"性:指向 [Skeleton3D] 節點的骨架 [NodePath](通常是 [ code] ..[/code])、網格和" -"皮膚:\n" +"性:指向 [Skeleton3D] 節點的骨架 [NodePath](通常是 [code]..[/code])、網格和皮" +"膚:\n" "- [Skeleton3D] 節點包含骨骼列表,其中包含名稱、姿勢和休息、名稱和父骨骼。\n" "- 網格是顯示網格所需的所有原始頂點資料。就網格而言,它知道如何對頂點進行權重繪" "製,並使用通常從 3D 建模軟體匯入的一些內部編號。\n" @@ -107208,7 +106879,7 @@ msgstr "" "每一個內部骨骼 ID,它都包含兩件事。首先是一個稱為綁定姿勢矩陣、逆綁定矩陣或簡" "稱 IBM 的矩陣。其次,[Skin] 包含每個骨骼的名稱(如果[member Skins/" "use_named_skins] 為[code]true[/code]),或骨骼在[Skeleton3D] 列表中的索引(如" -"果[member Skins/use_named_skins] 為[ code] ]假[/程式碼])。\n" +"果[member Skins/use_named_skins] 為[code]false[/code])。\n" "總而言之,這些資訊足以告訴 Godot 如何使用 [Skeleton3D] 節點中的骨骼姿勢來渲染" "每個 [MeshInstance3D] 的網格。請注意,每個[MeshInstance3D] 可以共享綁定,這在" "從Blender 匯出的模型中很常見,或者每個[MeshInstance3D] 可以使用單獨的[Skin] 對" @@ -107279,10 +106950,10 @@ msgid "" "change the existing compress mode on a texture (if it's detected to be used " "in 3D), but choosing [b]VRAM Compressed[/b] or [b]Basis Universal[/b] will." msgstr "" -"這會變更偵測到紋理在 3D 中使用時所使用的 [member 壓縮/模式] 選項。\n" +"這會變更偵測到紋理在 3D 中使用時所使用的 [member compress/mode] 選項。\n" "只有當偵測到紋理正在 3D 中使用時,變更此匯入選項才會生效。將其變更為[b]停用[/" "b],然後重新匯入不會變更紋理上的現有壓縮模式(如果偵測到在3D 中使用),但選擇" -"[b]VRAM 壓縮[/b] 或[b ]Basis通用[/b]將。" +"[b]VRAM 壓縮[/b] 或[b]Basis Universal[/b]將。" msgid "" "If [code]true[/code], converts the imported image's colors to match [member " @@ -107295,9 +106966,9 @@ msgid "" "[b]Note:[/b] Only available for SVG images." msgstr "" "如果[code]true[/code],則將匯入影像的顏色轉換為符合[member EditorSettings." -"interface/theme/icon_and_font_color]。這假設影像使用與[完全相同的顏色] " -"url=$DOCS_URL/contributing/development/editor/creating_icons.html]Godot 自己的" -"編輯器圖示調色板[/url],來源檔案是為深色編輯器主題設計的。應該為編輯器插件圖示" +"interface/theme/icon_and_font_color]。這假設影像使用與[url=$DOCS_URL/" +"contributing/development/editor/creating_icons.html]Godot 自己的編輯器圖示調色" +"板[/url]完全相同的顏色,來源檔案是為深色編輯器主題設計的。應該為編輯器插件圖示" "和自訂類別圖示啟用此功能,但否則應停用。\n" "[b]注意:[/b] 僅適用於 SVG 影像。" @@ -107363,8 +107034,8 @@ msgstr "" "您可以在網路上找到的一些 HDR 映像可能已損壞並包含 sRGB 顏色資料(而不是線性顏" "色資料)。建議不要使用這些檔案。如果絕對必要,請啟用[member process/" "hdr_as_srgb] 將使它們看起來正確。\n" -"[b]警告:[/b]在格式良好的HDR 影像上啟用[member 程序/hdr_as_srgb] 將導致產生的" -"影像看起來太暗,因此如果不確定,請將其保留在[code]false[/code ] 上。" +"[b]警告:[/b]在格式良好的HDR 影像上啟用[member process/hdr_as_srgb] 將導致產生" +"的影像看起來太暗,因此如果不確定,請將其保留在[code]false[/code] 上。" msgid "" "If [code]true[/code], clamps exposure in the imported high dynamic range " @@ -107383,7 +107054,7 @@ msgstr "" "現實生活來源,沒有任何剪輯。\n" "雖然這些 HDR 全景影像準確反映現實生活,但這可能會導致 Godot 產生的輻射圖在用作" "背景天空時包含閃光。這可以在材料反射中看到(即使在極端情況下在粗糙材料上)。啟" -"用[member 流程/hdr_clamp_exposure]可以解決此問題。" +"用[member process/hdr_clamp_exposure]可以解決此問題。" msgid "" "If [code]true[/code], convert the normal map from Y- (DirectX-style) to Y+ " @@ -107547,8 +107218,8 @@ msgid "" "[b]Ping-Pong[/b] or [b]Backward[/b]. This is set in seconds after the " "beginning of the audio file." msgstr "" -"當 [member edit/loop_mode] 為 [b]Forward[/b]、[b]Ping-Pong[/b] 或 [b]Backward " -"時所使用的起始循環點[ /b]。這是在音訊檔案開始後的幾秒鐘內設定的。" +"當 [member edit/loop_mode] 為 [b]Forward[/b]、[b]Ping-Pong[/b] 或 " +"[b]Backward[/b] 時所使用的起始循環點。這是在音訊檔案開始後的幾秒鐘內設定的。" msgid "" "The end loop point to use when [member edit/loop_mode] is [b]Forward[/b], " @@ -107556,9 +107227,9 @@ msgid "" "beginning of the audio file. A value of [code]-1[/code] uses the end of the " "audio file as the end loop point." msgstr "" -"當 [member edit/loop_mode] 為 [b]Forward[/b]、[b]Ping-Pong[/b] 或 [b]Backward " -"時所使用的結束循環點[ /b]。此設定以音訊檔案開始後的秒為單位。[code]-1[/code] " -"值使用音訊檔案的結尾作為結束循環點。" +"當 [member edit/loop_mode] 為 [b]Forward[/b]、[b]Ping-Pong[/b] 或 " +"[b]Backward[/b] 時所使用的結束循環點。此設定以音訊檔案開始後的秒為單位。" +"[code]-1[/code] 值使用音訊檔案的結尾作為結束循環點。" msgid "" "Controls how audio should loop. This is automatically read from the WAV " @@ -107601,9 +107272,9 @@ msgid "" "trimming to avoid audible pops." msgstr "" "如果[code]true[/code],如果標準化後音訊低於-50 dB,則自動修剪音訊的開頭和結尾" -"(請參閱[member 編輯/標準化])。這防止檔案在開頭或結尾處靜音,這不必要地增加了" -"檔案的大小,並增加了播放時的延遲。在修剪過程中還使用了 500 個樣本的淡入/淡出週" -"期,以避免聽到爆音。" +"(請參閱[member edit/normalize])。這防止檔案在開頭或結尾處靜音,這不必要地增" +"加了檔案的大小,並增加了播放時的延遲。在修剪過程中還使用了 500 個樣本的淡入/淡" +"出週期,以避免聽到爆音。" msgid "" "If [code]true[/code], forces the imported audio to use 8-bit quantization if " @@ -110091,44 +109762,6 @@ msgstr "" "set_deferred] 類似。" msgid "" -"Changes the running scene to the one at the given [param path], after loading " -"it into a [PackedScene] and creating a new instance.\n" -"Returns [constant OK] on success, [constant ERR_CANT_OPEN] if the [param " -"path] cannot be loaded into a [PackedScene], or [constant ERR_CANT_CREATE] if " -"that scene cannot be instantiated.\n" -"[b]Note:[/b] The new scene node is added to the tree at the end of the frame. " -"This ensures that both scenes aren't running at the same time, while still " -"freeing the previous scene in a safe way similar to [method Node.queue_free]. " -"As such, you won't be able to access the loaded scene immediately after the " -"[method change_scene_to_file] call." -msgstr "" -"將位於給定路徑 [param path] 的場景載入進一個 [PackedScene] 並新建其實例,然後" -"將正在運作的場景修改為這個場景。\n" -"成功時返回 [constant OK],如果 [param path] 不能被載入到一個 [PackedScene] " -"中,則返回 [constant ERR_CANT_OPEN];如果該場景無法被產生實體,則返回 " -"[constant ERR_CANT_CREATE]。\n" -"[b]注意:[/b]場景改變是延遲的,即新的場景節點是在該影格的末尾新增的。這確保了" -"兩個場景永遠不會同時載入,如果場景太大或在記憶體受限的環境中運作,這會耗盡系統" -"資源。因此,無法在 [method change_scene_to_file] 呼叫後,立即存取到被載入的場" -"景。" - -msgid "" -"Changes the running scene to a new instance of the given [PackedScene] (which " -"must be valid).\n" -"Returns [constant OK] on success, [constant ERR_CANT_CREATE] if the scene " -"cannot be instantiated, or [constant ERR_INVALID_PARAMETER] if the scene is " -"invalid.\n" -"[b]Note:[/b] The new scene node is added to the tree at the end of the frame. " -"You won't be able to access it immediately after the [method " -"change_scene_to_packed] call." -msgstr "" -"將正在運作的場景改變為給定 [PackedScene] (必須有效)的一個新實例。\n" -"成功時返回 [constant OK],場景無法產生實體時返回 [constant ERR_CANT_CREATE]," -"場景無效時返回 [constant ERR_INVALID_PARAMETER]。\n" -"[b]注意:[/b]場景改變是延遲的,即新的場景節點會在目前影格的末尾新增到場景樹" -"中。無法在呼叫 [method change_scene_to_packed] 後立即存取到它。" - -msgid "" "Returns a [SceneTreeTimer] which will emit [signal SceneTreeTimer.timeout] " "after the given time in seconds elapsed in this [SceneTree].\n" "If [param process_always] is set to [code]false[/code], pausing the " @@ -111349,7 +110982,7 @@ msgstr "" "制。有關更多信息,請參閱下面的著色器檔案索引。\n" "多個[ShaderMaterial]可以使用相同的著色器並為著色器製服配置不同的值。\n" "[b]注意:[/b]基於效能原因,僅當[member Resource.resource_name]變更時才會發出" -"[訊號Resource.changed]訊號。僅在編輯器中,它也會針對 [member 著色器] 變更發" +"[signal Resource.changed]訊號。僅在編輯器中,它也會針對 [member shader] 變更發" "出。" msgid "" @@ -113485,7 +113118,7 @@ msgstr "" "是唯讀的。" msgid "Defines a 3D environment's background by using a [Material]." -msgstr "使用 [材質] 定義 3D 環境的背景。" +msgstr "使用 [Material] 定義 3D 環境的背景。" msgid "" "The [Sky] class uses a [Material] to render a 3D environment's background and " @@ -113786,7 +113419,7 @@ msgid "" "[code]1.0[/code] (inclusive)." msgstr "" "較高的值會導致身體更僵硬,而較低的值將增加身體的彎曲能力。該值可在[code]0.0[/" -"code] 和[code]1.0 [ /code](包含)。" +"code] 和[code]1.0 [/code](包含)。" msgid "" "[NodePath] to a [CollisionObject3D] this SoftBody3D should avoid clipping." @@ -120584,9 +120217,6 @@ msgstr "" msgid "Returns font embolden strength." msgstr "返回字形的加粗力度。" -msgid "Recturns an active face index in the TrueType / OpenType collection." -msgstr "返回 TrueType / OpenType 集合中的活動字形索引。" - msgid "Returns bitmap font fixed size." msgstr "返回點陣字型的固定大小。" @@ -124057,8 +123687,8 @@ msgstr "" "通知呼叫[method _use_tile_data_runtime_update]或[method " "_tile_data_runtime_update]的TileMap節點將導致不同的結果。這將因此觸發TileMap更" "新。\n" -"如果提供了[參數層],則僅通知給定層的變更。出於效能原因,通常首選提供 [param " -"layer] 參數(如果適用)。\n" +"如果提供了 [param layer],則僅通知給定層的變更。出於效能原因,通常首選提供 " +"[param layer] 參數(如果適用)。\n" "[b]警告:[/b] 更新 TileMap 的運算成本很高,並且可能會影響效能。盡量限制該函式" "的呼叫次數,以避免不必要的更新。\n" "[b]注意:[/b]這不會觸發 TileMap 的直接更新,更新將照常在影格末尾完成(除非您呼" @@ -124289,8 +123919,8 @@ msgid "" "TileMap's local coordinate system." msgstr "" "TileMap 的象限大小。象限是在單一畫布專案上繪製在一起的一組圖塊,用於優化目的。" -"[member 渲染_quadrant_size] 定義正方形邊長,以形成象限的地圖座標系。因此,預設" -"象限大小將[code]16 * 16 = 256[/code] 個圖塊組合在一起。\n" +"[member rendering_quadrant_size] 定義正方形邊長,以形成象限的地圖座標系。因" +"此,預設象限大小將[code]16 * 16 = 256[/code] 個圖塊組合在一起。\n" "象限大小不適用於 Y 排序圖層,因為在這種情況下,圖塊會依 Y 位置群組。\n" "[b]注意:[/b] 由於象限是根據地圖坐標系建立的,因此象限的“正方形形狀”在 " "TileMap 的本地坐標系中可能看起來不像正方形。" @@ -132384,23 +132014,6 @@ msgid "A control used for video playback." msgstr "用於播放影片的控制項。" msgid "" -"A control used for playback of [VideoStream] resources.\n" -"Supported video formats are [url=https://www.theora.org/]Ogg Theora[/url] " -"([code].ogv[/code], [VideoStreamTheora]) and any format exposed via a " -"GDExtension plugin.\n" -"[b]Note:[/b] Due to a bug, VideoStreamPlayer does not support localization " -"remapping yet.\n" -"[b]Warning:[/b] On Web, video playback [i]will[/i] perform poorly due to " -"missing architecture-specific assembly optimizations." -msgstr "" -"用於播放 [VideoStream] 資源的控制項。\n" -"支援的影片格式有 [url=https://www.theora.org/]Ogg Theora[/url]([code].ogv[/" -"code],[VideoStreamTheora])以及任何通過 GDExtension 外掛程式公開的格式。\n" -"[b]注意:[/b]由於一個錯誤,VideoStreamPlayer 還不支援當地語系化重對應。\n" -"[b]警告:[/b]在 Web 上,影片播放[i]會[/i]由於缺少特定於體系結構的組合優化而表" -"現不佳。" - -msgid "" "The length of the current stream, in seconds.\n" "[b]Note:[/b] For [VideoStreamTheora] streams (the built-in format supported " "by Godot), this value will always be zero, as getting the stream length is " @@ -132560,7 +132173,7 @@ msgid "" "[b]Note:[/b] [Window]s inside other viewports will not be listed." msgstr "" "傳回視窗內可見嵌入 [Window] 的列表。\n" -"[b]注意:[/b] 其他視窗內的[視窗]不會列出。" +"[b]注意:[/b] 其他視窗內的[Window]不會列出。" msgid "" "Returns the transform from the viewport's coordinate system to the embedder's " @@ -133605,7 +133218,7 @@ msgid "" "converted to a script shader behind the scenes." msgstr "" "這類提供了一個類似圖形的視覺化編輯器,用於建立[Shader]。雖然[VisualShader] 不" -"需要編碼,但它們與腳本著色器共用相同的邏輯。它們使用[VisualShaderNode ] 可以相" +"需要編碼,但它們與腳本著色器共用相同的邏輯。它們使用[VisualShaderNode] 可以相" "互連接以控制著色器的流程。視覺著色器圖在幕後轉換為腳本著色器。" msgid "Using VisualShaders" @@ -136054,40 +135667,6 @@ msgid "" msgstr "使用由該著色器所附加到的節點決定的篩檢程式對紋理進行取樣。" msgid "" -"The texture filter reads from the nearest pixel, but selects a mipmap based " -"on the angle between the surface and the camera view. This reduces artifacts " -"on surfaces that are almost in line with the camera. The anisotropic " -"filtering level can be changed by adjusting [member ProjectSettings.rendering/" -"textures/default_filters/anisotropic_filtering_level].\n" -"[b]Note:[/b] This texture filter is rarely useful in 2D projects. [constant " -"FILTER_LINEAR_MIPMAP] is usually more appropriate." -msgstr "" -"紋理篩選從最近的圖元讀取,但根據表面和相機視圖之間的角度選擇一個 mipmap。這減" -"少了幾乎與相機對齊的表面上的偽影。可以通過調整 [member ProjectSettings." -"rendering/textures/default_filters/anisotropic_filtering_level],來更改各向異" -"性篩選級別。\n" -"[b]注意:[/b]這種紋理篩選在 2D 專案中很少有用。[constant " -"FILTER_LINEAR_MIPMAP] 通常更合適。" - -msgid "" -"The texture filter blends between the nearest 4 pixels and selects a mipmap " -"based on the angle between the surface and the camera view. This reduces " -"artifacts on surfaces that are almost in line with the camera. This is the " -"slowest of the filtering options, but results in the highest quality " -"texturing. The anisotropic filtering level can be changed by adjusting " -"[member ProjectSettings.rendering/textures/default_filters/" -"anisotropic_filtering_level].\n" -"[b]Note:[/b] This texture filter is rarely useful in 2D projects. [constant " -"FILTER_LINEAR_MIPMAP] is usually more appropriate." -msgstr "" -"紋理篩選在最近的 4 個圖元之間進行混合,並根據表面和相機視圖之間的角度選擇一個 " -"mipmap。這減少了幾乎與相機對齊的表面上的偽影。這是最慢的篩選選項,但會產生最高" -"品質的紋理。可以通過調整 [member ProjectSettings.rendering/textures/" -"default_filters/anisotropic_filtering_level],來更改各向異性篩選級別。\n" -"[b]注意:[/b]這種紋理篩選在 2D 專案中很少有用。[constant " -"FILTER_LINEAR_MIPMAP] 通常更合適。" - -msgid "" "Sample the texture using the repeat mode determined by the node this shader " "is attached to." msgstr "使用由該著色器所附加到的節點決定的重複模式對該紋理進行取樣。" @@ -139001,9 +138580,8 @@ msgid "" "affects how [member content_scale_factor] is applied, in addition to the " "automatic scale factor determined by [member content_scale_size]." msgstr "" -"用於確定 2D 元素的最終比例因子的策略。除了由 [member content_scale_size] 確定" -"的自動比例因子之外,這還會影響 [member content_scale_factor] 的應用方" -"式。 ,““,““,“錯誤的”,””,”,”" +"用於確定 2D 元素的最終比例因子的策略。除了由 [member content_scale_size] 確定" +"的自動比例因子之外,這還會影響 [member content_scale_factor] 的應用方式。" msgid "The screen the window is currently on." msgstr "該視窗目前所在的螢幕。" @@ -139313,8 +138891,8 @@ msgid "" "focused or not." msgstr "" "當滑鼠遊標進入[Window]的可見區域時發出,該區域未被其他[Control]或視窗遮擋,前" -"提是其[member Viewport.gui_disable_input]為[code ]false [/code],不論目前是否" -"處於焦點狀態。" +"提是其[member Viewport.gui_disable_input]為[code]false [/code],不論目前是否處" +"於焦點狀態。" msgid "" "Emitted when the mouse cursor leaves the [Window]'s visible area, that is not " @@ -139323,8 +138901,8 @@ msgid "" "focused or not." msgstr "" "當滑鼠遊標離開[Window]的可見區域時發出,該區域未被其他[Control]或視窗遮擋,前" -"提是其[member Viewport.gui_disable_input]為[code ]false [/code],不論目前是否" -"處於焦點狀態。" +"提是其[member Viewport.gui_disable_input]為[code]false [/code],不論目前是否處" +"於焦點狀態。" msgid "" "Emitted when window title bar decorations are changed, e.g. macOS window " @@ -140874,8 +140452,8 @@ msgid "" "data for the [member pose] being tracked. The [param tracking] argument " "indicates whether the tracker is getting updated tracking data." msgstr "" -"\"當[member 追蹤器]開始或停止接收正在追蹤的[member 姿勢]的更新追蹤資料時發出。" -"[參數追蹤]參數指示追蹤器是否正在取得更新的追蹤資料。" +"當[member tracker]開始或停止接收正在追蹤的[member pose]的更新追蹤資料時發出。" +"[param tracking]參數指示追蹤器是否正在取得更新的追蹤資料。" msgid "The origin point in AR/VR." msgstr "AR/VR 的原點。" diff --git a/drivers/SCsub b/drivers/SCsub index c633a0591b..9c8b16d3e5 100644 --- a/drivers/SCsub +++ b/drivers/SCsub @@ -25,6 +25,8 @@ SConscript("winmidi/SCsub") # Graphics drivers if env["vulkan"]: SConscript("vulkan/SCsub") +if env["d3d12"]: + SConscript("d3d12/SCsub") if env["opengl3"]: SConscript("gl_context/SCsub") SConscript("gles3/SCsub") diff --git a/drivers/d3d12/SCsub b/drivers/d3d12/SCsub new file mode 100644 index 0000000000..ce7134fb77 --- /dev/null +++ b/drivers/d3d12/SCsub @@ -0,0 +1,151 @@ +#!/usr/bin/env python + +import os +from pathlib import Path + +Import("env") + +env_d3d12_rd = env.Clone() + +thirdparty_obj = [] + + +# DirectX Headers (must take precedence over Windows SDK's). + +env.Prepend(CPPPATH=["#thirdparty/directx_headers"]) +env_d3d12_rd.Prepend(CPPPATH=["#thirdparty/directx_headers"]) + + +# Direct3D 12 Memory Allocator. + +env.Append(CPPPATH=["#thirdparty/d3d12ma"]) +env_d3d12_rd.Append(CPPPATH=["#thirdparty/d3d12ma"]) + + +# Agility SDK. + +if env["agility_sdk_path"] != "": + env_d3d12_rd.Append(CPPDEFINES=["AGILITY_SDK_ENABLED"]) + if env["agility_sdk_multiarch"]: + env_d3d12_rd.Append(CPPDEFINES=["AGILITY_SDK_MULTIARCH_ENABLED"]) + + +# PIX. + +if env["pix_path"] != "": + env_d3d12_rd.Append(CPPDEFINES=["PIX_ENABLED"]) + env_d3d12_rd.Append(CPPPATH=[env["pix_path"] + "/Include"]) + + +# Mesa (SPIR-V to DXIL functionality). + +mesa_dir = (env["mesa_libs"] + "/godot-mesa").replace("\\", "/") +mesa_gen_dir = (env["mesa_libs"] + "/godot-mesa/generated").replace("\\", "/") +mesa_absdir = Dir(mesa_dir).abspath +mesa_gen_absdir = Dir(mesa_dir + "/generated").abspath + +custom_build_steps = [ + [ + "src/compiler", + "glsl/ir_expression_operation.py enum > %s/ir_expression_operation.h", + "ir_expression_operation.h", + ], + ["src/compiler/nir", "nir_builder_opcodes_h.py > %s/nir_builder_opcodes.h", "nir_builder_opcodes.h"], + ["src/compiler/nir", "nir_constant_expressions.py > %s/nir_constant_expressions.c", "nir_constant_expressions.c"], + ["src/compiler/nir", "nir_intrinsics_h.py --outdir %s", "nir_intrinsics.h"], + ["src/compiler/nir", "nir_intrinsics_c.py --outdir %s", "nir_intrinsics.c"], + ["src/compiler/nir", "nir_intrinsics_indices_h.py --outdir %s", "nir_intrinsics_indices.h"], + ["src/compiler/nir", "nir_opcodes_h.py > %s/nir_opcodes.h", "nir_opcodes.h"], + ["src/compiler/nir", "nir_opcodes_c.py > %s/nir_opcodes.c", "nir_opcodes.c"], + ["src/compiler/nir", "nir_opt_algebraic.py > %s/nir_opt_algebraic.c", "nir_opt_algebraic.c"], + ["src/compiler/spirv", "vtn_generator_ids_h.py spir-v.xml %s/vtn_generator_ids.h", "vtn_generator_ids.h"], + [ + "src/microsoft/compiler", + "dxil_nir_algebraic.py -p ../../../src/compiler/nir > %s/dxil_nir_algebraic.c", + "dxil_nir_algebraic.c", + ], + ["src/util", "format_srgb.py > %s/format_srgb.c", "format_srgb.c"], + ["src/util/format", "u_format_table.py u_format.csv --header > %s/u_format_pack.h", "u_format_pack.h"], + ["src/util/format", "u_format_table.py u_format.csv > %s/u_format_table.c", "u_format_table.c"], +] + +mesa_gen_include_paths = [mesa_gen_dir + "/src"] + +# See update_mesa.sh for explanation. +for v in custom_build_steps: + subdir = v[0] + cmd = v[1] + gen_filename = v[2] + + in_dir = str(Path(mesa_absdir + "/" + subdir)) + out_full_path = mesa_dir + "/generated/" + subdir + out_file_full_path = out_full_path + "/" + gen_filename + + if gen_filename.endswith(".h"): + mesa_gen_include_paths += [out_full_path.replace("\\", "/")] + +mesa_private_inc_paths = [v[0] for v in os.walk(mesa_absdir)] +mesa_private_inc_paths = [v.replace(mesa_absdir, mesa_dir) for v in mesa_private_inc_paths] +mesa_private_inc_paths = [v.replace("\\", "/") for v in mesa_private_inc_paths] +# Avoid build results depending on if generated files already exist. +mesa_private_inc_paths = [v for v in mesa_private_inc_paths if not v.startswith(mesa_gen_dir)] +mesa_private_inc_paths.sort() +# Include the list of the generated ones now, so out-of-the-box sources can include generated headers. +mesa_private_inc_paths += mesa_gen_include_paths +# We have to blacklist some because we are bindly adding every Mesa directory +# to the include path and in some cases that causes the wrong header to be included. +mesa_blacklist_inc_paths = [ + "src/c11", +] +mesa_blacklist_inc_paths = [mesa_dir + "/" + v for v in mesa_blacklist_inc_paths] +mesa_private_inc_paths = [v for v in mesa_private_inc_paths if v not in mesa_blacklist_inc_paths] + +# Added by ourselves. +extra_defines = [ + "WINDOWS_NO_FUTEX", +] + +# These defines are inspired by the Meson build scripts in the original repo. +extra_defines += [ + "__STDC_CONSTANT_MACROS", + "__STDC_FORMAT_MACROS", + "__STDC_LIMIT_MACROS", + ("PACKAGE_VERSION", '\\"' + Path(mesa_absdir + "/VERSION").read_text().strip() + '\\"'), + ("PACKAGE_BUGREPORT", '\\"https://gitlab.freedesktop.org/mesa/mesa/-/issues\\"'), + "PIPE_SUBSYSTEM_WINDOWS_USER", + ("_Static_assert", "static_assert"), +] + +if env.msvc: + extra_defines += [ + "_USE_MATH_DEFINES", + "VC_EXTRALEAN", + "_CRT_SECURE_NO_WARNINGS", + "_CRT_SECURE_NO_DEPRECATE", + "_SCL_SECURE_NO_WARNINGS", + "_SCL_SECURE_NO_DEPRECATE", + "_ALLOW_KEYWORD_MACROS", + ("_HAS_EXCEPTIONS", 0), + "NOMINMAX", + "HAVE_STRUCT_TIMESPEC", + ] + +# This is needed since rendering_device_d3d12.cpp needs to include some Mesa internals. +env_d3d12_rd.Prepend(CPPPATH=mesa_private_inc_paths) +# For the same reason as above, the defines must be the same as in the 3rd-party code itself. +env_d3d12_rd.Append(CPPDEFINES=extra_defines) + + +# Add all. + +env.drivers_sources += thirdparty_obj + + +# Godot source files. + +driver_obj = [] +env_d3d12_rd.add_source_files(driver_obj, "*.cpp") +env.drivers_sources += driver_obj + +# Needed to force rebuilding the driver files when the thirdparty code is updated. +env.Depends(driver_obj, thirdparty_obj) diff --git a/drivers/d3d12/d3d12_context.cpp b/drivers/d3d12/d3d12_context.cpp new file mode 100644 index 0000000000..6933089208 --- /dev/null +++ b/drivers/d3d12/d3d12_context.cpp @@ -0,0 +1,1067 @@ +/**************************************************************************/ +/* d3d12_context.cpp */ +/**************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/**************************************************************************/ +/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ +/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/**************************************************************************/ + +#include "d3d12_context.h" + +#include "core/config/engine.h" +#include "core/config/project_settings.h" +#include "core/string/ustring.h" +#include "core/templates/local_vector.h" +#include "core/version.h" +#include "servers/rendering/rendering_device.h" + +#include "dxcapi.h" + +extern "C" { +char godot_nir_arch_name[32]; + +#ifdef AGILITY_SDK_ENABLED +__declspec(dllexport) extern const UINT D3D12SDKVersion = 610; +#ifdef AGILITY_SDK_MULTIARCH_ENABLED +#if defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC) +__declspec(dllexport) extern const char *D3D12SDKPath = "\\.\\arm64"; +#else +__declspec(dllexport) extern const char *D3D12SDKPath = "\\.\\x86_64"; +#endif +#else +__declspec(dllexport) extern const char *D3D12SDKPath = "\\."; +#endif // AGILITY_SDK_MULTIARCH +#endif // AGILITY_SDK_ENABLED +} + +#ifdef PIX_ENABLED +#define USE_PIX +#include "WinPixEventRuntime/pix3.h" +#endif + +#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) + +void D3D12Context::_debug_message_func( + D3D12_MESSAGE_CATEGORY p_category, + D3D12_MESSAGE_SEVERITY p_severity, + D3D12_MESSAGE_ID p_id, + LPCSTR p_description, + void *p_context) { + String type_string; + switch (p_category) { + case D3D12_MESSAGE_CATEGORY_APPLICATION_DEFINED: + type_string = "APPLICATION_DEFINED"; + break; + case D3D12_MESSAGE_CATEGORY_MISCELLANEOUS: + type_string = "MISCELLANEOUS"; + break; + case D3D12_MESSAGE_CATEGORY_INITIALIZATION: + type_string = "INITIALIZATION"; + break; + case D3D12_MESSAGE_CATEGORY_CLEANUP: + type_string = "CLEANUP"; + break; + case D3D12_MESSAGE_CATEGORY_COMPILATION: + type_string = "COMPILATION"; + break; + case D3D12_MESSAGE_CATEGORY_STATE_CREATION: + type_string = "STATE_CREATION"; + break; + case D3D12_MESSAGE_CATEGORY_STATE_SETTING: + type_string = "STATE_SETTING"; + break; + case D3D12_MESSAGE_CATEGORY_STATE_GETTING: + type_string = "STATE_GETTING"; + break; + case D3D12_MESSAGE_CATEGORY_RESOURCE_MANIPULATION: + type_string = "RESOURCE_MANIPULATION"; + break; + case D3D12_MESSAGE_CATEGORY_EXECUTION: + type_string = "EXECUTION"; + break; + case D3D12_MESSAGE_CATEGORY_SHADER: + type_string = "SHADER"; + break; + } + + String error_message(type_string + + " - Message Id Number: " + String::num_int64(p_id) + + "\n\t" + p_description); + + // Convert D3D12 severity to our own log macros. + switch (p_severity) { + case D3D12_MESSAGE_SEVERITY_MESSAGE: + print_verbose(error_message); + break; + case D3D12_MESSAGE_SEVERITY_INFO: + print_line(error_message); + break; + case D3D12_MESSAGE_SEVERITY_WARNING: + WARN_PRINT(error_message); + break; + case D3D12_MESSAGE_SEVERITY_ERROR: + case D3D12_MESSAGE_SEVERITY_CORRUPTION: + ERR_PRINT(error_message); + CRASH_COND_MSG(Engine::get_singleton()->is_abort_on_gpu_errors_enabled(), + "Crashing, because abort on GPU errors is enabled."); + break; + } +} + +uint32_t D3D12Context::SubgroupCapabilities::supported_stages_flags_rd() const { + // If there's a way to check exactly which are supported, I have yet to find it. + return ( + RenderingDevice::ShaderStage::SHADER_STAGE_FRAGMENT_BIT | + RenderingDevice::ShaderStage::SHADER_STAGE_COMPUTE_BIT); +} + +uint32_t D3D12Context::SubgroupCapabilities::supported_operations_flags_rd() const { + if (!wave_ops_supported) { + return 0; + } else { + return ( + RenderingDevice::SubgroupOperations::SUBGROUP_BASIC_BIT | + RenderingDevice::SubgroupOperations::SUBGROUP_BALLOT_BIT | + RenderingDevice::SubgroupOperations::SUBGROUP_VOTE_BIT | + RenderingDevice::SubgroupOperations::SUBGROUP_SHUFFLE_BIT | + RenderingDevice::SubgroupOperations::SUBGROUP_SHUFFLE_RELATIVE_BIT | + RenderingDevice::SubgroupOperations::SUBGROUP_QUAD_BIT | + RenderingDevice::SubgroupOperations::SUBGROUP_ARITHMETIC_BIT | + RenderingDevice::SubgroupOperations::SUBGROUP_CLUSTERED_BIT); + } +} + +Error D3D12Context::_check_capabilities() { + // Assume not supported until proven otherwise. + vrs_capabilities.draw_call_supported = false; + vrs_capabilities.primitive_supported = false; + vrs_capabilities.primitive_in_multiviewport = false; + vrs_capabilities.ss_image_supported = false; + vrs_capabilities.ss_image_tile_size = 1; + vrs_capabilities.additional_rates_supported = false; + multiview_capabilities.is_supported = false; + multiview_capabilities.geometry_shader_is_supported = false; + multiview_capabilities.tessellation_shader_is_supported = false; + multiview_capabilities.max_view_count = 0; + multiview_capabilities.max_instance_count = 0; + multiview_capabilities.is_supported = false; + subgroup_capabilities.size = 0; + subgroup_capabilities.wave_ops_supported = false; + shader_capabilities.shader_model = D3D_SHADER_MODEL_6_0; + shader_capabilities.native_16bit_ops = false; + storage_buffer_capabilities.storage_buffer_16_bit_access_is_supported = false; + format_capabilities.relaxed_casting_supported = false; + + { + D3D12_FEATURE_DATA_SHADER_MODEL shader_model = {}; + shader_model.HighestShaderModel = MIN(D3D_HIGHEST_SHADER_MODEL, D3D_SHADER_MODEL_6_6); + HRESULT res = md.device->CheckFeatureSupport(D3D12_FEATURE_SHADER_MODEL, &shader_model, sizeof(shader_model)); + ERR_FAIL_COND_V_MSG(res, ERR_CANT_CREATE, "CheckFeatureSupport failed with error " + vformat("0x%08ux", res) + "."); + shader_capabilities.shader_model = shader_model.HighestShaderModel; + } + print_verbose("- Shader:"); + print_verbose(" model: " + itos(shader_capabilities.shader_model >> 4) + "." + itos(shader_capabilities.shader_model & 0xf)); + + D3D12_FEATURE_DATA_D3D12_OPTIONS options = {}; + HRESULT res = md.device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS, &options, sizeof(options)); + if (SUCCEEDED(res)) { + storage_buffer_capabilities.storage_buffer_16_bit_access_is_supported = options.TypedUAVLoadAdditionalFormats; + } + + D3D12_FEATURE_DATA_D3D12_OPTIONS1 options1 = {}; + res = md.device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS1, &options1, sizeof(options1)); + if (SUCCEEDED(res)) { + subgroup_capabilities.size = options1.WaveLaneCountMin; + subgroup_capabilities.wave_ops_supported = options1.WaveOps; + } + + D3D12_FEATURE_DATA_D3D12_OPTIONS3 options3 = {}; + res = md.device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS3, &options3, sizeof(options3)); + if (SUCCEEDED(res)) { + // https://docs.microsoft.com/en-us/windows/win32/api/d3d12/ne-d3d12-d3d12_view_instancing_tier + // https://microsoft.github.io/DirectX-Specs/d3d/ViewInstancing.html#sv_viewid + if (options3.ViewInstancingTier >= D3D12_VIEW_INSTANCING_TIER_1) { + multiview_capabilities.is_supported = true; + multiview_capabilities.geometry_shader_is_supported = options3.ViewInstancingTier >= D3D12_VIEW_INSTANCING_TIER_3; + multiview_capabilities.tessellation_shader_is_supported = options3.ViewInstancingTier >= D3D12_VIEW_INSTANCING_TIER_3; + multiview_capabilities.max_view_count = D3D12_MAX_VIEW_INSTANCE_COUNT; + multiview_capabilities.max_instance_count = UINT32_MAX; + } + } + + D3D12_FEATURE_DATA_D3D12_OPTIONS6 options6 = {}; + res = md.device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS6, &options6, sizeof(options6)); + if (SUCCEEDED(res)) { + if (options6.VariableShadingRateTier >= D3D12_VARIABLE_SHADING_RATE_TIER_1) { + vrs_capabilities.draw_call_supported = true; + if (options6.VariableShadingRateTier >= D3D12_VARIABLE_SHADING_RATE_TIER_2) { + vrs_capabilities.primitive_supported = true; + vrs_capabilities.primitive_in_multiviewport = options6.PerPrimitiveShadingRateSupportedWithViewportIndexing; + vrs_capabilities.ss_image_supported = true; + vrs_capabilities.ss_image_tile_size = options6.ShadingRateImageTileSize; + vrs_capabilities.additional_rates_supported = options6.AdditionalShadingRatesSupported; + } + } + } + + D3D12_FEATURE_DATA_D3D12_OPTIONS12 options12 = {}; + res = md.device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS12, &options12, sizeof(options12)); + if (SUCCEEDED(res)) { + format_capabilities.relaxed_casting_supported = options12.RelaxedFormatCastingSupported; + } + + if (vrs_capabilities.draw_call_supported || vrs_capabilities.primitive_supported || vrs_capabilities.ss_image_supported) { + print_verbose("- D3D12 Variable Rate Shading supported:"); + if (vrs_capabilities.draw_call_supported) { + print_verbose(" Draw call"); + } + if (vrs_capabilities.primitive_supported) { + print_verbose(String(" Per-primitive (multi-viewport: ") + (vrs_capabilities.primitive_in_multiviewport ? "yes" : "no") + ")"); + } + if (vrs_capabilities.ss_image_supported) { + print_verbose(String(" Screen-space image (tile size: ") + itos(vrs_capabilities.ss_image_tile_size) + ")"); + } + if (vrs_capabilities.additional_rates_supported) { + print_verbose(String(" Additional rates: ") + (vrs_capabilities.additional_rates_supported ? "yes" : "no")); + } + } else { + print_verbose("- D3D12 Variable Rate Shading not supported"); + } + + if (multiview_capabilities.is_supported) { + print_verbose("- D3D12 multiview supported:"); + print_verbose(" max view count: " + itos(multiview_capabilities.max_view_count)); + //print_verbose(" max instances: " + itos(multiview_capabilities.max_instance_count)); // Hardcoded; not very useful at the moment. + } else { + print_verbose("- D3D12 multiview not supported"); + } + + if (format_capabilities.relaxed_casting_supported) { + print_verbose("- Relaxed casting supported"); + } else { + print_verbose("- Relaxed casting not supported"); + } + + return OK; +} + +Error D3D12Context::_initialize_debug_layers() { + ComPtr<ID3D12Debug> debug_controller; + HRESULT res = D3D12GetDebugInterface(IID_PPV_ARGS(&debug_controller)); + ERR_FAIL_COND_V(res, ERR_QUERY_FAILED); + debug_controller->EnableDebugLayer(); + return OK; +} + +Error D3D12Context::_select_adapter(int &r_index) { + { + UINT flags = _use_validation_layers() ? DXGI_CREATE_FACTORY_DEBUG : 0; + HRESULT res = CreateDXGIFactory2(flags, IID_PPV_ARGS(&dxgi_factory)); + ERR_FAIL_COND_V(!SUCCEEDED(res), ERR_CANT_CREATE); + } + + ComPtr<IDXGIFactory6> factory6; + dxgi_factory.As(&factory6); + + // TODO: Use IDXCoreAdapterList, which gives more comprehensive information. + LocalVector<IDXGIAdapter1 *> adapters; + while (true) { + IDXGIAdapter1 *curr_adapter = nullptr; + if (factory6) { + if (factory6->EnumAdapterByGpuPreference(adapters.size(), DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE, IID_PPV_ARGS(&curr_adapter)) == DXGI_ERROR_NOT_FOUND) { + break; + } + } else { + if (dxgi_factory->EnumAdapters1(adapters.size(), &curr_adapter) == DXGI_ERROR_NOT_FOUND) { + break; + } + } + adapters.push_back(curr_adapter); + } + + ERR_FAIL_COND_V_MSG(adapters.size() == 0, ERR_CANT_CREATE, "Adapters enumeration reported zero accessible devices."); + + // The device should really be a preference, but for now choosing a discrete GPU over the + // integrated one is better than the default. + + int32_t adapter_index = -1; + int type_selected = -1; + LocalVector<RenderingDevice::DeviceType> adapter_types; + print_verbose("D3D12 devices:"); + for (uint32_t i = 0; i < adapters.size(); ++i) { + DXGI_ADAPTER_DESC1 desc = {}; + adapters[i]->GetDesc1(&desc); + + String name = desc.Description; + String dev_type; + RenderingDevice::DeviceType type = {}; + if (((desc.Flags & DXGI_ADAPTER_FLAG_SOFTWARE))) { + type = RenderingDevice::DEVICE_TYPE_CPU; + } else { + type = desc.DedicatedVideoMemory ? RenderingDevice::DEVICE_TYPE_DISCRETE_GPU : RenderingDevice::DEVICE_TYPE_INTEGRATED_GPU; + } + adapter_types.push_back(type); + + switch (type) { + case RenderingDevice::DEVICE_TYPE_DISCRETE_GPU: { + dev_type = "Discrete"; + } break; + case RenderingDevice::DEVICE_TYPE_INTEGRATED_GPU: { + dev_type = "Integrated"; + } break; + case RenderingDevice::DEVICE_TYPE_VIRTUAL_GPU: { + dev_type = "Virtual"; + } break; + case RenderingDevice::DEVICE_TYPE_CPU: { + dev_type = "CPU"; + } break; + default: { + dev_type = "Other"; + } break; + } + print_verbose(" #" + itos(i) + ": " + name + ", " + dev_type); + + switch (type) { + case RenderingDevice::DEVICE_TYPE_DISCRETE_GPU: { + if (type_selected < 4) { + type_selected = 4; + adapter_index = i; + } + } break; + case RenderingDevice::DEVICE_TYPE_INTEGRATED_GPU: { + if (type_selected < 3) { + type_selected = 3; + adapter_index = i; + } + } break; + case RenderingDevice::DEVICE_TYPE_VIRTUAL_GPU: { + if (type_selected < 2) { + type_selected = 2; + adapter_index = i; + } + } break; + case RenderingDevice::DEVICE_TYPE_CPU: { + if (type_selected < 1) { + type_selected = 1; + adapter_index = i; + } + } break; + default: { + if (type_selected < 0) { + type_selected = 0; + adapter_index = i; + } + } break; + } + } + + int32_t user_adapter_index = Engine::get_singleton()->get_gpu_index(); // Force user selected GPU. + if (user_adapter_index >= 0 && user_adapter_index < (int32_t)adapters.size()) { + adapter_index = user_adapter_index; + } + + ERR_FAIL_COND_V_MSG(adapter_index == -1, ERR_CANT_CREATE, "None of D3D12 devices supports hardware rendering."); + + gpu = adapters[adapter_index]; + for (uint32_t i = 0; i < adapters.size(); ++i) { + adapters[i]->Release(); + } + + adapter_type = adapter_types[adapter_index]; + + ComPtr<IDXGIFactory5> factory5; + dxgi_factory.As(&factory5); + if (factory5) { + BOOL result = FALSE; // sizeof(bool) != sizeof(BOOL), in general. + HRESULT res = factory5->CheckFeatureSupport(DXGI_FEATURE_PRESENT_ALLOW_TEARING, &result, sizeof(result)); + if (SUCCEEDED(res)) { + tearing_supported = result; + } else { + ERR_PRINT("CheckFeatureSupport failed with error " + vformat("0x%08ux", res) + "."); + } + } + + r_index = adapter_index; + + return OK; +} + +void D3D12Context::_dump_adapter_info(int p_index) { + { + const D3D_FEATURE_LEVEL FEATURE_LEVELS[] = { + D3D_FEATURE_LEVEL_11_0, + D3D_FEATURE_LEVEL_11_1, + D3D_FEATURE_LEVEL_12_0, + D3D_FEATURE_LEVEL_12_1, + D3D_FEATURE_LEVEL_12_2, + }; + + D3D12_FEATURE_DATA_FEATURE_LEVELS feat_levels = {}; + feat_levels.NumFeatureLevels = ARRAY_SIZE(FEATURE_LEVELS); + feat_levels.pFeatureLevelsRequested = FEATURE_LEVELS; + + HRESULT res = md.device->CheckFeatureSupport(D3D12_FEATURE_FEATURE_LEVELS, &feat_levels, sizeof(feat_levels)); + ERR_FAIL_COND_MSG(res, "CheckFeatureSupport failed with error " + vformat("0x%08ux", res) + "."); + + // Example: D3D_FEATURE_LEVEL_12_1 = 0xc100. + uint32_t feat_level_major = feat_levels.MaxSupportedFeatureLevel >> 12; + uint32_t feat_level_minor = (feat_levels.MaxSupportedFeatureLevel >> 16) & 0xff; + feature_level = feat_level_major * 10 + feat_level_minor; + } + + String rendering_method; + if (OS::get_singleton()->get_current_rendering_method() == "mobile") { + rendering_method = "Forward Mobile"; + } else { + rendering_method = "Forward+"; + } + + static const struct { + uint32_t id; + const char *name; + } vendor_names[] = { + { 0x1002, "AMD" }, + { 0x1010, "ImgTec" }, + { 0x106B, "Apple" }, + { 0x10DE, "NVIDIA" }, + { 0x13B5, "ARM" }, + { 0x1414, "Microsoft" }, + { 0x5143, "Qualcomm" }, + { 0x8086, "Intel" }, + { 0, nullptr }, + }; + + DXGI_ADAPTER_DESC gpu_desc = {}; + gpu->GetDesc(&gpu_desc); + + adapter_name = gpu_desc.Description; + pipeline_cache_id = String::hex_encode_buffer((uint8_t *)&gpu_desc.AdapterLuid, sizeof(LUID)); + pipeline_cache_id += "-driver-" + itos(gpu_desc.Revision); + { + adapter_vendor = "Unknown"; + uint32_t vendor_idx = 0; + while (vendor_names[vendor_idx].name != nullptr) { + if (gpu_desc.VendorId == vendor_names[vendor_idx].id) { + adapter_vendor = vendor_names[vendor_idx].name; + break; + } + vendor_idx++; + } + } + + print_line(vformat("D3D12 feature level %s - %s - Using D3D12 Adapter #%d: %s", get_device_api_version(), rendering_method, p_index, adapter_name)); +} + +Error D3D12Context::_create_device(DeviceBasics &r_basics) { + HRESULT res = D3D12CreateDevice(gpu.Get(), D3D_FEATURE_LEVEL_11_0, IID_PPV_ARGS(r_basics.device.GetAddressOf())); + ERR_FAIL_COND_V_MSG(res, ERR_CANT_CREATE, "D3D12CreateDevice failed with error " + vformat("0x%08ux", res) + "."); + + // Create direct command queue. + D3D12_COMMAND_QUEUE_DESC queue_desc = {}; + queue_desc.Flags = D3D12_COMMAND_QUEUE_FLAG_NONE; + queue_desc.Type = D3D12_COMMAND_LIST_TYPE_DIRECT; + res = r_basics.device->CreateCommandQueue(&queue_desc, IID_PPV_ARGS(r_basics.queue.GetAddressOf())); + ERR_FAIL_COND_V(res, ERR_CANT_CREATE); + + // Create sync objects. + res = r_basics.device->CreateFence(0, D3D12_FENCE_FLAG_NONE, IID_PPV_ARGS(r_basics.fence.GetAddressOf())); + ERR_FAIL_COND_V(res, ERR_CANT_CREATE); + r_basics.fence_event = CreateEvent(nullptr, FALSE, FALSE, nullptr); + ERR_FAIL_NULL_V(r_basics.fence_event, ERR_CANT_CREATE); + + if (_use_validation_layers()) { + ComPtr<ID3D12InfoQueue> info_queue; + res = r_basics.device.As(&info_queue); + ERR_FAIL_COND_V(res, ERR_CANT_CREATE); + +#if 0 // This causes crashes. Needs investigation. + ComPtr<ID3D12InfoQueue1> info_queue_1; + device.As(&info_queue_1); + if (info_queue_1) { + // Custom printing supported (added in Windows 10 Release Preview build 20236). + + info_queue_1->SetMuteDebugOutput(TRUE); + + res = info_queue_1->RegisterMessageCallback(&_debug_message_func, D3D12_MESSAGE_CALLBACK_IGNORE_FILTERS, nullptr, 0); + ERR_FAIL_COND_V(res, ERR_CANT_CREATE); + } else +#endif + { + // Rely on D3D12's own debug printing. + + if (Engine::get_singleton()->is_abort_on_gpu_errors_enabled()) { + res = info_queue->SetBreakOnSeverity(D3D12_MESSAGE_SEVERITY_WARNING, TRUE); + ERR_FAIL_COND_V(res, ERR_CANT_CREATE); + } + } + D3D12_MESSAGE_SEVERITY severities_to_mute[] = { + D3D12_MESSAGE_SEVERITY_INFO, + }; + + D3D12_MESSAGE_ID messages_to_mute[] = { + D3D12_MESSAGE_ID_CLEARRENDERTARGETVIEW_MISMATCHINGCLEARVALUE, + D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_MISMATCHINGCLEARVALUE, + // These happen due to how D3D12MA manages buffers; seem bening. + D3D12_MESSAGE_ID_HEAP_ADDRESS_RANGE_HAS_NO_RESOURCE, + D3D12_MESSAGE_ID_HEAP_ADDRESS_RANGE_INTERSECTS_MULTIPLE_BUFFERS, + }; + + D3D12_INFO_QUEUE_FILTER filter = {}; + filter.DenyList.NumSeverities = ARRAY_SIZE(severities_to_mute); + filter.DenyList.pSeverityList = severities_to_mute; + filter.DenyList.NumIDs = ARRAY_SIZE(messages_to_mute); + filter.DenyList.pIDList = messages_to_mute; + + res = info_queue->PushStorageFilter(&filter); + ERR_FAIL_COND_V(res, ERR_CANT_CREATE); + } + + return OK; +} + +Error D3D12Context::_get_device_limits() { + D3D12_FEATURE_DATA_D3D12_OPTIONS options = {}; + HRESULT res = md.device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS, &options, sizeof(options)); + ERR_FAIL_COND_V_MSG(res, ERR_UNAVAILABLE, "CheckFeatureSupport failed with error " + vformat("0x%08ux", res) + "."); + + // https://docs.microsoft.com/en-us/windows/win32/direct3d12/hardware-support + gpu_limits.max_srvs_per_shader_stage = options.ResourceBindingTier == D3D12_RESOURCE_BINDING_TIER_1 ? 128 : UINT64_MAX; + gpu_limits.max_cbvs_per_shader_stage = options.ResourceBindingTier <= D3D12_RESOURCE_BINDING_TIER_2 ? 14 : UINT64_MAX; + gpu_limits.max_samplers_across_all_stages = options.ResourceBindingTier == D3D12_RESOURCE_BINDING_TIER_1 ? 16 : 2048; + if (options.ResourceBindingTier == D3D12_RESOURCE_BINDING_TIER_1) { + gpu_limits.max_uavs_across_all_stages = feature_level <= 110 ? 8 : 64; + } else if (options.ResourceBindingTier == D3D12_RESOURCE_BINDING_TIER_2) { + gpu_limits.max_uavs_across_all_stages = 64; + } else { + gpu_limits.max_uavs_across_all_stages = UINT64_MAX; + } + + md.queue->GetTimestampFrequency(&gpu_limits.timestamp_frequency); + + return OK; +} + +bool D3D12Context::_use_validation_layers() { + return Engine::get_singleton()->is_validation_layers_enabled(); +} + +Error D3D12Context::window_create(DisplayServer::WindowID p_window_id, DisplayServer::VSyncMode p_vsync_mode, HWND p_window, HINSTANCE p_instance, int p_width, int p_height) { + ERR_FAIL_COND_V(windows.has(p_window_id), ERR_INVALID_PARAMETER); + + Window window; + window.hwnd = p_window; + window.width = p_width; + window.height = p_height; + window.vsync_mode = p_vsync_mode; + Error err = _update_swap_chain(&window); + ERR_FAIL_COND_V(err != OK, ERR_CANT_CREATE); + + windows[p_window_id] = window; + return OK; +} + +void D3D12Context::window_resize(DisplayServer::WindowID p_window, int p_width, int p_height) { + ERR_FAIL_COND(!windows.has(p_window)); + windows[p_window].width = p_width; + windows[p_window].height = p_height; + _update_swap_chain(&windows[p_window]); +} + +int D3D12Context::window_get_width(DisplayServer::WindowID p_window) { + ERR_FAIL_COND_V(!windows.has(p_window), -1); + return windows[p_window].width; +} + +int D3D12Context::window_get_height(DisplayServer::WindowID p_window) { + ERR_FAIL_COND_V(!windows.has(p_window), -1); + return windows[p_window].height; +} + +bool D3D12Context::window_is_valid_swapchain(DisplayServer::WindowID p_window) { + ERR_FAIL_COND_V(!windows.has(p_window), false); + Window *w = &windows[p_window]; + return (bool)w->swapchain; +} + +CD3DX12_CPU_DESCRIPTOR_HANDLE D3D12Context::window_get_framebuffer_rtv_handle(DisplayServer::WindowID p_window) { + ERR_FAIL_COND_V(!windows.has(p_window), CD3DX12_CPU_DESCRIPTOR_HANDLE(CD3DX12_DEFAULT())); + ERR_FAIL_COND_V(!buffers_prepared, CD3DX12_CPU_DESCRIPTOR_HANDLE(CD3DX12_DEFAULT())); + Window *w = &windows[p_window]; + CD3DX12_CPU_DESCRIPTOR_HANDLE rtv_handle( + w->rtv_heap->GetCPUDescriptorHandleForHeapStart(), + w->current_buffer, + md.device->GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_RTV)); + return rtv_handle; +} + +ID3D12Resource *D3D12Context::window_get_framebuffer_texture(DisplayServer::WindowID p_window) { + ERR_FAIL_COND_V(!windows.has(p_window), nullptr); + ERR_FAIL_COND_V(!buffers_prepared, nullptr); + Window *w = &windows[p_window]; + if (w->swapchain) { + return w->render_targets[w->current_buffer].Get(); + } else { + return nullptr; + } +} + +void D3D12Context::window_destroy(DisplayServer::WindowID p_window_id) { + ERR_FAIL_COND(!windows.has(p_window_id)); + _wait_for_idle_queue(md.queue.Get()); + windows.erase(p_window_id); +} + +Error D3D12Context::_update_swap_chain(Window *window) { + if (window->width == 0 || window->height == 0) { + // Likely window minimized, no swapchain created. + return ERR_SKIP; + } + + DisplayServer::VSyncMode curr_vsync_mode = window->vsync_mode; + bool vsync_mode_available = false; + UINT swapchain_flags = 0; + do { + switch (window->vsync_mode) { + case DisplayServer::VSYNC_MAILBOX: { + window->sync_interval = 1; + window->present_flags = DXGI_PRESENT_RESTART; + swapchain_flags = 0; + vsync_mode_available = true; + } break; + case DisplayServer::VSYNC_ADAPTIVE: { + vsync_mode_available = false; // I don't know how to set this up. + } break; + case DisplayServer::VSYNC_ENABLED: { + window->sync_interval = 1; + window->present_flags = 0; + swapchain_flags = 0; + vsync_mode_available = true; + } break; + case DisplayServer::VSYNC_DISABLED: { + window->sync_interval = 0; + window->present_flags = tearing_supported ? DXGI_PRESENT_ALLOW_TEARING : 0; + swapchain_flags = tearing_supported ? DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING : 0; + vsync_mode_available = true; + } break; + } + + // Set the windows swap effect if it is available, otherwise FLIP_DISCARD is used. + if (vsync_mode_available) { + if (window->vsync_mode != curr_vsync_mode || !window->swapchain) { + window->vsync_mode = curr_vsync_mode; + print_verbose("Using swapchain flags: " + itos(swapchain_flags) + ", sync interval: " + itos(window->sync_interval) + ", present flags: " + itos(window->present_flags)); + } + } else { + String present_mode_string; + switch (window->vsync_mode) { + case DisplayServer::VSYNC_MAILBOX: + present_mode_string = "Mailbox"; + break; + case DisplayServer::VSYNC_ADAPTIVE: + present_mode_string = "Adaptive"; + break; + case DisplayServer::VSYNC_ENABLED: + present_mode_string = "Enabled"; + break; + case DisplayServer::VSYNC_DISABLED: + present_mode_string = "Disabled"; + break; + } + WARN_PRINT(vformat("The requested V-Sync mode %s is not available. Falling back to V-Sync mode Enabled.", present_mode_string)); + window->vsync_mode = DisplayServer::VSYNC_ENABLED; // Set to default. + } + } while (!vsync_mode_available); + + if (window->swapchain) { + _wait_for_idle_queue(md.queue.Get()); + for (uint32_t i = 0; i < IMAGE_COUNT; i++) { + window->render_targets[i].Reset(); + } + window->rtv_heap.Reset(); + + // D3D12 docs: "IDXGISwapChain::ResizeBuffers can't be used to add or remove this flag." + bool allow_tearing_flag_changed = (swapchain_flags & DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING) != (window->swapchain_flags & DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING); + if (allow_tearing_flag_changed) { + window->swapchain.Reset(); + } + } + + if (!window->swapchain) { + DXGI_SWAP_CHAIN_DESC1 swapchain_desc = {}; + swapchain_desc.BufferCount = IMAGE_COUNT; + swapchain_desc.Width = 0; + swapchain_desc.Height = 0; + swapchain_desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; + swapchain_desc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; + swapchain_desc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_DISCARD; + swapchain_desc.SampleDesc.Count = 1; + swapchain_desc.Flags = swapchain_flags; + swapchain_desc.Scaling = DXGI_SCALING_NONE; + + ComPtr<IDXGISwapChain1> swapchain; + HRESULT res = dxgi_factory->CreateSwapChainForHwnd(md.queue.Get(), window->hwnd, &swapchain_desc, nullptr, nullptr, swapchain.GetAddressOf()); + ERR_FAIL_COND_V(res, ERR_CANT_CREATE); + swapchain.As(&window->swapchain); + ERR_FAIL_NULL_V(window->swapchain, ERR_CANT_CREATE); + + format = swapchain_desc.Format; + + res = dxgi_factory->MakeWindowAssociation(window->hwnd, DXGI_MWA_NO_ALT_ENTER | DXGI_MWA_NO_WINDOW_CHANGES); + ERR_FAIL_COND_V(res, ERR_CANT_CREATE); + + res = window->swapchain->GetDesc1(&swapchain_desc); + ERR_FAIL_COND_V(res, ERR_CANT_CREATE); + ERR_FAIL_COND_V(swapchain_desc.BufferCount != IMAGE_COUNT, ERR_BUG); + window->width = swapchain_desc.Width; + window->height = swapchain_desc.Height; + + } else { + HRESULT res = window->swapchain->ResizeBuffers(IMAGE_COUNT, window->width, window->height, DXGI_FORMAT_UNKNOWN, swapchain_flags); + ERR_FAIL_COND_V(res, ERR_UNAVAILABLE); + } + + window->swapchain_flags = swapchain_flags; + window->current_buffer = window->swapchain->GetCurrentBackBufferIndex(); + + // Describe and create a render target view (RTV) descriptor heap. + D3D12_DESCRIPTOR_HEAP_DESC rtv_heap_desc = {}; + rtv_heap_desc.NumDescriptors = IMAGE_COUNT; + rtv_heap_desc.Type = D3D12_DESCRIPTOR_HEAP_TYPE_RTV; + rtv_heap_desc.Flags = D3D12_DESCRIPTOR_HEAP_FLAG_NONE; + HRESULT res = md.device->CreateDescriptorHeap(&rtv_heap_desc, IID_PPV_ARGS(window->rtv_heap.GetAddressOf())); + ERR_FAIL_COND_V(res, ERR_CANT_CREATE); + + CD3DX12_CPU_DESCRIPTOR_HANDLE rtv_handle(window->rtv_heap->GetCPUDescriptorHandleForHeapStart()); + + for (uint32_t i = 0; i < IMAGE_COUNT; i++) { + res = window->swapchain->GetBuffer(i, IID_PPV_ARGS(&window->render_targets[i])); + ERR_FAIL_COND_V(res, ERR_CANT_CREATE); + + md.device->CreateRenderTargetView(window->render_targets[i].Get(), nullptr, rtv_handle); + rtv_handle.Offset(1, md.device->GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_RTV)); + } + + return OK; +} + +Error D3D12Context::initialize() { + if (_use_validation_layers()) { + Error err = _initialize_debug_layers(); + ERR_FAIL_COND_V(err, ERR_CANT_CREATE); + } + + int adapter_index = 0; + + Error err = _select_adapter(adapter_index); + ERR_FAIL_COND_V(err, ERR_CANT_CREATE); + + err = _create_device(md); + ERR_FAIL_COND_V(err, ERR_CANT_CREATE); + + _dump_adapter_info(adapter_index); + + err = _check_capabilities(); + ERR_FAIL_COND_V(err, ERR_CANT_CREATE); + + err = _get_device_limits(); + ERR_FAIL_COND_V(err, ERR_CANT_CREATE); + + { + HRESULT res = md.device->CreateFence(0, D3D12_FENCE_FLAG_NONE, IID_PPV_ARGS(frame_fence.GetAddressOf())); + ERR_FAIL_COND_V(res, ERR_CANT_CREATE); + frame_fence_event = CreateEvent(nullptr, FALSE, FALSE, nullptr); + ERR_FAIL_NULL_V(frame_fence_event, ERR_CANT_CREATE); + } + + { // Initialize allocator. + D3D12MA::ALLOCATOR_DESC allocator_desc = {}; + allocator_desc.pDevice = md.device.Get(); + allocator_desc.pAdapter = gpu.Get(); + + HRESULT res = D3D12MA::CreateAllocator(&allocator_desc, &allocator); + ERR_FAIL_COND_V_MSG(res, ERR_CANT_CREATE, "D3D12MA::CreateAllocator failed with error " + vformat("0x%08ux", res) + "."); + } + + return OK; +} + +void D3D12Context::set_setup_list(ID3D12CommandList *p_command_list) { + command_list_queue.write[0] = p_command_list; +} + +void D3D12Context::append_command_list(ID3D12CommandList *p_command_list) { + if (command_list_queue.size() <= command_list_count) { + command_list_queue.resize(command_list_count + 1); + } + + command_list_queue.write[command_list_count] = p_command_list; + command_list_count++; +} + +void D3D12Context::_wait_for_idle_queue(ID3D12CommandQueue *p_queue) { + md.fence_value++; + p_queue->Signal(md.fence.Get(), md.fence_value); + md.fence->SetEventOnCompletion(md.fence_value, md.fence_event); + WaitForSingleObjectEx(md.fence_event, INFINITE, FALSE); +#ifdef PIX_ENABLED + PIXNotifyWakeFromFenceSignal(md.fence_event); +#endif +} + +void D3D12Context::flush(bool p_flush_setup, bool p_flush_pending) { + if (p_flush_setup && command_list_queue[0]) { + md.queue->ExecuteCommandLists(1, command_list_queue.ptr()); + command_list_queue.write[0] = nullptr; + } + + if (p_flush_pending && command_list_count > 1) { + md.queue->ExecuteCommandLists(command_list_count - 1, command_list_queue.ptr() + 1); + command_list_count = 1; + } + + if (p_flush_setup || p_flush_pending) { + _wait_for_idle_queue(md.queue.Get()); + } +} + +void D3D12Context::prepare_buffers(ID3D12GraphicsCommandList *p_command_list) { + // Ensure no more than FRAME_LAG renderings are outstanding. + if (frame >= IMAGE_COUNT) { + UINT64 min_value = frame - IMAGE_COUNT; + if (frame_fence->GetCompletedValue() < min_value) { + frame_fence->SetEventOnCompletion(min_value, frame_fence_event); + WaitForSingleObjectEx(frame_fence_event, INFINITE, FALSE); +#ifdef PIX_ENABLED + PIXNotifyWakeFromFenceSignal(frame_fence_event); +#endif + } + } + + D3D12_RESOURCE_BARRIER *barriers = (D3D12_RESOURCE_BARRIER *)alloca(windows.size() * sizeof(D3D12_RESOURCE_BARRIER)); + + uint32_t n = 0; + for (KeyValue<int, Window> &E : windows) { + Window *w = &E.value; + w->current_buffer = w->swapchain->GetCurrentBackBufferIndex(); + barriers[n++] = CD3DX12_RESOURCE_BARRIER::Transition(w->render_targets[w->current_buffer].Get(), D3D12_RESOURCE_STATE_PRESENT, D3D12_RESOURCE_STATE_RENDER_TARGET); + } + + p_command_list->ResourceBarrier(n, barriers); + + buffers_prepared = true; +} + +void D3D12Context::postpare_buffers(ID3D12GraphicsCommandList *p_command_list) { + D3D12_RESOURCE_BARRIER *barriers = (D3D12_RESOURCE_BARRIER *)alloca(windows.size() * sizeof(D3D12_RESOURCE_BARRIER)); + + uint32_t n = 0; + for (KeyValue<int, Window> &E : windows) { + Window *w = &E.value; + barriers[n++] = CD3DX12_RESOURCE_BARRIER::Transition(w->render_targets[w->current_buffer].Get(), D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_PRESENT); + } + + p_command_list->ResourceBarrier(n, barriers); +} + +Error D3D12Context::swap_buffers() { + ID3D12CommandList *const *commands_ptr = nullptr; + UINT commands_to_submit = 0; + + if (command_list_queue[0] == nullptr) { + // No setup command, but commands to submit, submit from the first and skip command. + if (command_list_count > 1) { + commands_ptr = command_list_queue.ptr() + 1; + commands_to_submit = command_list_count - 1; + } + } else { + commands_ptr = command_list_queue.ptr(); + commands_to_submit = command_list_count; + } + + md.queue->ExecuteCommandLists(commands_to_submit, commands_ptr); + + command_list_queue.write[0] = nullptr; + command_list_count = 1; + + for (KeyValue<int, Window> &E : windows) { + Window *w = &E.value; + + if (!w->swapchain) { + continue; + } + HRESULT res = w->swapchain->Present(w->sync_interval, w->present_flags); + if (res) { + print_verbose("D3D12: Presenting swapchain of window " + itos(E.key) + " failed with error " + vformat("0x%08ux", res) + "."); + } + } + + md.queue->Signal(frame_fence.Get(), frame); + frame++; + + buffers_prepared = false; + return OK; +} + +void D3D12Context::resize_notify() { +} + +ComPtr<ID3D12Device> D3D12Context::get_device() { + return md.device; +} + +ComPtr<IDXGIAdapter> D3D12Context::get_adapter() { + return gpu; +} + +D3D12MA::Allocator *D3D12Context::get_allocator() { + return allocator.Get(); +} + +int D3D12Context::get_swapchain_image_count() const { + return IMAGE_COUNT; +} + +DXGI_FORMAT D3D12Context::get_screen_format() const { + return format; +} + +D3D12Context::DeviceLimits D3D12Context::get_device_limits() const { + return gpu_limits; +} + +RID D3D12Context::local_device_create() { + LocalDevice ld; + _create_device(ld); + return local_device_owner.make_rid(ld); +} + +ComPtr<ID3D12Device> D3D12Context::local_device_get_d3d12_device(RID p_local_device) { + LocalDevice *ld = local_device_owner.get_or_null(p_local_device); + return ld->device; +} + +void D3D12Context::local_device_push_command_lists(RID p_local_device, ID3D12CommandList *const *p_lists, int p_count) { + LocalDevice *ld = local_device_owner.get_or_null(p_local_device); + ERR_FAIL_COND(ld->waiting); + + ld->queue->ExecuteCommandLists(p_count, p_lists); + + ld->waiting = true; +} + +void D3D12Context::local_device_sync(RID p_local_device) { + LocalDevice *ld = local_device_owner.get_or_null(p_local_device); + ERR_FAIL_COND(!ld->waiting); + + ld->fence_value++; + ld->queue->Signal(ld->fence.Get(), ld->fence_value); + ld->fence->SetEventOnCompletion(ld->fence_value, ld->fence_event); + WaitForSingleObjectEx(ld->fence_event, INFINITE, FALSE); +#ifdef PIX_ENABLED + PIXNotifyWakeFromFenceSignal(ld->fence_event); +#endif + + ld->waiting = false; +} + +void D3D12Context::local_device_free(RID p_local_device) { + LocalDevice *ld = local_device_owner.get_or_null(p_local_device); + + CloseHandle(ld->fence_event); + + local_device_owner.free(p_local_device); +} + +void D3D12Context::command_begin_label(ID3D12GraphicsCommandList *p_command_list, String p_label_name, const Color p_color) { +#ifdef PIX_ENABLED + PIXBeginEvent(p_command_list, p_color.to_argb32(), p_label_name.utf8().get_data()); +#endif +} + +void D3D12Context::command_insert_label(ID3D12GraphicsCommandList *p_command_list, String p_label_name, const Color p_color) { +#ifdef PIX_ENABLED + PIXSetMarker(p_command_list, p_color.to_argb32(), p_label_name.utf8().get_data()); +#endif +} + +void D3D12Context::command_end_label(ID3D12GraphicsCommandList *p_command_list) { +#ifdef PIX_ENABLED + PIXEndEvent(p_command_list); +#endif +} + +void D3D12Context::set_object_name(ID3D12Object *p_object, String p_object_name) { + ERR_FAIL_NULL(p_object); + int name_len = p_object_name.size(); + WCHAR *name_w = (WCHAR *)alloca(sizeof(WCHAR) * (name_len + 1)); + MultiByteToWideChar(CP_UTF8, 0, p_object_name.utf8().get_data(), -1, name_w, name_len); + p_object->SetName(name_w); +} + +String D3D12Context::get_device_vendor_name() const { + return adapter_vendor; +} +String D3D12Context::get_device_name() const { + return adapter_name; +} + +RenderingDevice::DeviceType D3D12Context::get_device_type() const { + return adapter_type; +} + +String D3D12Context::get_device_api_version() const { + return vformat("%d_%d", feature_level / 10, feature_level % 10); +} + +String D3D12Context::get_device_pipeline_cache_uuid() const { + return pipeline_cache_id; +} + +DisplayServer::VSyncMode D3D12Context::get_vsync_mode(DisplayServer::WindowID p_window) const { + ERR_FAIL_COND_V_MSG(!windows.has(p_window), DisplayServer::VSYNC_ENABLED, "Could not get V-Sync mode for window with WindowID " + itos(p_window) + " because it does not exist."); + return windows[p_window].vsync_mode; +} + +void D3D12Context::set_vsync_mode(DisplayServer::WindowID p_window, DisplayServer::VSyncMode p_mode) { + ERR_FAIL_COND_MSG(!windows.has(p_window), "Could not set V-Sync mode for window with WindowID " + itos(p_window) + " because it does not exist."); + windows[p_window].vsync_mode = p_mode; + _update_swap_chain(&windows[p_window]); +} + +D3D12Context::D3D12Context() { + command_list_queue.resize(1); // First one is always the setup command. + command_list_queue.write[0] = nullptr; + + strcpy(godot_nir_arch_name, Engine::get_singleton()->get_architecture_name().ascii().get_data()); +} + +D3D12Context::~D3D12Context() { + if (md.fence_event) { + CloseHandle(md.fence_event); + } + if (frame_fence_event) { + CloseHandle(frame_fence_event); + } +} diff --git a/drivers/d3d12/d3d12_context.h b/drivers/d3d12/d3d12_context.h new file mode 100644 index 0000000000..31e75affd0 --- /dev/null +++ b/drivers/d3d12/d3d12_context.h @@ -0,0 +1,248 @@ +/**************************************************************************/ +/* d3d12_context.h */ +/**************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/**************************************************************************/ +/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ +/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/**************************************************************************/ + +#ifndef D3D12_CONTEXT_H +#define D3D12_CONTEXT_H + +#include "core/error/error_list.h" +#include "core/os/mutex.h" +#include "core/string/ustring.h" +#include "core/templates/rb_map.h" +#include "core/templates/rid_owner.h" +#include "servers/display_server.h" +#include "servers/rendering/rendering_device.h" + +#include "d3dx12.h" +#include <dxgi1_6.h> +#define D3D12MA_D3D12_HEADERS_ALREADY_INCLUDED +#include "D3D12MemAlloc.h" + +#include <wrl/client.h> +using Microsoft::WRL::ComPtr; + +class D3D12Context { +public: + struct DeviceLimits { + uint64_t max_srvs_per_shader_stage; + uint64_t max_cbvs_per_shader_stage; + uint64_t max_samplers_across_all_stages; + uint64_t max_uavs_across_all_stages; + uint64_t timestamp_frequency; + }; + + struct SubgroupCapabilities { + uint32_t size; + bool wave_ops_supported; + uint32_t supported_stages_flags_rd() const; + uint32_t supported_operations_flags_rd() const; + }; + + // Following VulkanContext definition. + struct MultiviewCapabilities { + bool is_supported; + bool geometry_shader_is_supported; + bool tessellation_shader_is_supported; + uint32_t max_view_count; + uint32_t max_instance_count; + }; + + struct VRSCapabilities { + bool draw_call_supported; // We can specify our fragment rate on a draw call level. + bool primitive_supported; // We can specify our fragment rate on each drawcall. + bool primitive_in_multiviewport; + bool ss_image_supported; // We can provide a density map attachment on our framebuffer. + uint32_t ss_image_tile_size; + bool additional_rates_supported; + }; + + struct ShaderCapabilities { + D3D_SHADER_MODEL shader_model; + bool native_16bit_ops; + }; + + struct StorageBufferCapabilities { + bool storage_buffer_16_bit_access_is_supported; + }; + + struct FormatCapabilities { + bool relaxed_casting_supported; + }; + +private: + enum { + FRAME_LAG = 2, + IMAGE_COUNT = FRAME_LAG + 1, + }; + + ComPtr<IDXGIFactory2> dxgi_factory; + ComPtr<IDXGIAdapter> gpu; + DeviceLimits gpu_limits = {}; + struct DeviceBasics { + ComPtr<ID3D12Device> device; + ComPtr<ID3D12CommandQueue> queue; + ComPtr<ID3D12Fence> fence; + HANDLE fence_event = nullptr; + UINT64 fence_value = 0; + } md; // 'Main device', as opposed to local device. + + uint32_t feature_level = 0; // Major * 10 + minor. + bool tearing_supported = false; + SubgroupCapabilities subgroup_capabilities; + MultiviewCapabilities multiview_capabilities; + VRSCapabilities vrs_capabilities; + ShaderCapabilities shader_capabilities; + StorageBufferCapabilities storage_buffer_capabilities; + FormatCapabilities format_capabilities; + + String adapter_vendor; + String adapter_name; + RenderingDevice::DeviceType adapter_type = {}; + String pipeline_cache_id; + + ComPtr<D3D12MA::Allocator> allocator; + + bool buffers_prepared = false; + + DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN; + uint32_t frame = 0; + ComPtr<ID3D12Fence> frame_fence; + HANDLE frame_fence_event = nullptr; + + struct Window { + HWND hwnd = nullptr; + ComPtr<IDXGISwapChain3> swapchain; + UINT swapchain_flags = 0; + UINT sync_interval = 1; + UINT present_flags = 0; + ComPtr<ID3D12Resource> render_targets[IMAGE_COUNT]; + uint32_t current_buffer = 0; + int width = 0; + int height = 0; + DisplayServer::VSyncMode vsync_mode = DisplayServer::VSYNC_ENABLED; + ComPtr<ID3D12DescriptorHeap> rtv_heap; + }; + + struct LocalDevice : public DeviceBasics { + bool waiting = false; + HANDLE fence_event = nullptr; + UINT64 fence_value = 0; + }; + + RID_Owner<LocalDevice, true> local_device_owner; + + HashMap<DisplayServer::WindowID, Window> windows; + + // Commands. + + Vector<ID3D12CommandList *> command_list_queue; + int command_list_count = 1; + + static void _debug_message_func( + D3D12_MESSAGE_CATEGORY p_category, + D3D12_MESSAGE_SEVERITY p_severity, + D3D12_MESSAGE_ID p_id, + LPCSTR p_description, + void *p_context); + + Error _initialize_debug_layers(); + + Error _select_adapter(int &r_index); + void _dump_adapter_info(int p_index); + Error _create_device(DeviceBasics &r_basics); + Error _get_device_limits(); + Error _check_capabilities(); + + Error _update_swap_chain(Window *window); + + void _wait_for_idle_queue(ID3D12CommandQueue *p_queue); + +protected: + virtual bool _use_validation_layers(); + +public: + uint32_t get_feat_level_major() const { return feature_level / 10; }; + uint32_t get_feat_level_minor() const { return feature_level % 10; }; + const SubgroupCapabilities &get_subgroup_capabilities() const { return subgroup_capabilities; }; + const MultiviewCapabilities &get_multiview_capabilities() const { return multiview_capabilities; }; + const VRSCapabilities &get_vrs_capabilities() const { return vrs_capabilities; }; + const ShaderCapabilities &get_shader_capabilities() const { return shader_capabilities; }; + const StorageBufferCapabilities &get_storage_buffer_capabilities() const { return storage_buffer_capabilities; }; + const FormatCapabilities &get_format_capabilities() const { return format_capabilities; }; + + ComPtr<ID3D12Device> get_device(); + ComPtr<IDXGIAdapter> get_adapter(); + D3D12MA::Allocator *get_allocator(); + int get_swapchain_image_count() const; + Error window_create(DisplayServer::WindowID p_window_id, DisplayServer::VSyncMode p_vsync_mode, HWND p_window, HINSTANCE p_instance, int p_width, int p_height); + void window_resize(DisplayServer::WindowID p_window_id, int p_width, int p_height); + int window_get_width(DisplayServer::WindowID p_window = 0); + int window_get_height(DisplayServer::WindowID p_window = 0); + bool window_is_valid_swapchain(DisplayServer::WindowID p_window = 0); + void window_destroy(DisplayServer::WindowID p_window_id); + CD3DX12_CPU_DESCRIPTOR_HANDLE window_get_framebuffer_rtv_handle(DisplayServer::WindowID p_window = 0); + ID3D12Resource *window_get_framebuffer_texture(DisplayServer::WindowID p_window = 0); + + RID local_device_create(); + ComPtr<ID3D12Device> local_device_get_d3d12_device(RID p_local_device); + void local_device_push_command_lists(RID p_local_device, ID3D12CommandList *const *p_lists, int p_count); + void local_device_sync(RID p_local_device); + void local_device_free(RID p_local_device); + + DXGI_FORMAT get_screen_format() const; + DeviceLimits get_device_limits() const; + + void set_setup_list(ID3D12CommandList *p_command_list); + void append_command_list(ID3D12CommandList *p_command_list); + void resize_notify(); + void flush(bool p_flush_setup = false, bool p_flush_pending = false); + void prepare_buffers(ID3D12GraphicsCommandList *p_command_list); + void postpare_buffers(ID3D12GraphicsCommandList *p_command_list); + Error swap_buffers(); + Error initialize(); + + void command_begin_label(ID3D12GraphicsCommandList *p_command_list, String p_label_name, const Color p_color); + void command_insert_label(ID3D12GraphicsCommandList *p_command_list, String p_label_name, const Color p_color); + void command_end_label(ID3D12GraphicsCommandList *p_command_list); + void set_object_name(ID3D12Object *p_object, String p_object_name); + + String get_device_vendor_name() const; + String get_device_name() const; + RenderingDevice::DeviceType get_device_type() const; + String get_device_api_version() const; + String get_device_pipeline_cache_uuid() const; + + void set_vsync_mode(DisplayServer::WindowID p_window, DisplayServer::VSyncMode p_mode); + DisplayServer::VSyncMode get_vsync_mode(DisplayServer::WindowID p_window = 0) const; + + D3D12Context(); + virtual ~D3D12Context(); +}; + +#endif // D3D12_CONTEXT_H diff --git a/drivers/d3d12/d3d12_godot_nir_bridge.h b/drivers/d3d12/d3d12_godot_nir_bridge.h new file mode 100644 index 0000000000..f66c4edf89 --- /dev/null +++ b/drivers/d3d12/d3d12_godot_nir_bridge.h @@ -0,0 +1,60 @@ +/**************************************************************************/ +/* d3d12_godot_nir_bridge.h */ +/**************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/**************************************************************************/ +/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ +/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/**************************************************************************/ + +#ifndef D3D12_GODOT_NIR_BRIDGE_H +#define D3D12_GODOT_NIR_BRIDGE_H + +#include <stdint.h> + +#ifdef __cplusplus +extern "C" { +#endif + +// This one leaves room for potentially extremely copious bindings in a set. +static const uint32_t GODOT_NIR_DESCRIPTOR_SET_MULTIPLIER = 100000000; +// This one leaves room for potentially big sized arrays. +static const uint32_t GODOT_NIR_BINDING_MULTIPLIER = 100000; + +static const uint64_t GODOT_NIR_SC_SENTINEL_MAGIC = 0x45678900; // This must be as big as to be VBR-ed as a 32 bits number. +static const uint64_t GODOT_NIR_SC_SENTINEL_MAGIC_MASK = 0xffffffffffffff00; +static const uint64_t GODOT_NIR_SC_SENTINEL_ID_MASK = 0x00000000000000ff; + +typedef struct GodotNirCallbacks { + void *data; + void (*report_resource)(uint32_t p_register, uint32_t p_space, uint32_t p_dxil_type, void *p_data); + void (*report_sc_bit_offset_fn)(uint32_t p_sc_id, uint64_t p_bit_offset, void *p_data); + void (*report_bitcode_bit_offset_fn)(uint64_t p_bit_offset, void *p_data); +} GodotNirCallbacks; + +#ifdef __cplusplus +} +#endif + +#endif // D3D12_GODOT_NIR_BRIDGE_H diff --git a/drivers/d3d12/d3d12ma.cpp b/drivers/d3d12/d3d12ma.cpp new file mode 100644 index 0000000000..0ac2f71074 --- /dev/null +++ b/drivers/d3d12/d3d12ma.cpp @@ -0,0 +1,34 @@ +/**************************************************************************/ +/* d3d12ma.cpp */ +/**************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/**************************************************************************/ +/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ +/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/**************************************************************************/ + +#include "d3d12_context.h" + +#pragma warning(disable : 4189 4324 4505) +#include "thirdparty/d3d12ma/D3D12MemAlloc.cpp" diff --git a/drivers/d3d12/rendering_device_d3d12.cpp b/drivers/d3d12/rendering_device_d3d12.cpp new file mode 100644 index 0000000000..839bcf6bc7 --- /dev/null +++ b/drivers/d3d12/rendering_device_d3d12.cpp @@ -0,0 +1,9480 @@ +/**************************************************************************/ +/* rendering_device_d3d12.cpp */ +/**************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/**************************************************************************/ +/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ +/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/**************************************************************************/ + +#include "rendering_device_d3d12.h" + +#include "core/config/project_settings.h" +#include "core/io/compression.h" +#include "core/io/file_access.h" +#include "core/io/marshalls.h" +#include "core/object/worker_thread_pool.h" +#include "core/os/os.h" +#include "core/templates/hashfuncs.h" +#include "d3d12_godot_nir_bridge.h" +#include "modules/regex/regex.h" +#include "thirdparty/zlib/zlib.h" + +#ifdef DEV_ENABLED +#include "core/crypto/hashing_context.h" +#endif + +// No point in fighting warnings in Mesa. +#pragma warning(push) +#pragma warning(disable : 4200) // "nonstandard extension used: zero-sized array in struct/union". +#pragma warning(disable : 4806) // "'&': unsafe operation: no value of type 'bool' promoted to type 'uint32_t' can equal the given constant". +#include "dxil_validator.h" +#include "nir_spirv.h" +#include "nir_to_dxil.h" +#include "spirv_to_dxil.h" +extern "C" { +#include "dxil_spirv_nir.h" +} +#pragma warning(pop) + +#define ALIGN(m_number, m_alignment) ((((m_number) + ((m_alignment)-1)) / (m_alignment)) * (m_alignment)) + +#ifdef USE_SMALL_ALLOCS_POOL +static const uint32_t SMALL_ALLOCATION_MAX_SIZE = 4096; +#endif + +static const D3D12_RANGE VOID_RANGE = {}; + +static const uint32_t MAX_VULKAN_SETS = 16; +static const uint32_t ROOT_CONSTANT_SPACE = MAX_VULKAN_SETS + 1; +static const uint32_t ROOT_CONSTANT_REGISTER = 0; +static const uint32_t RUNTIME_DATA_SPACE = MAX_VULKAN_SETS + 2; +static const uint32_t RUNTIME_DATA_REGISTER = 0; + +static const uint32_t MAX_IMAGE_FORMAT_PLANES = 2; + +#ifdef DEV_ENABLED +//#define DEBUG_COUNT_BARRIERS +#endif + +RenderingDeviceD3D12::Buffer *RenderingDeviceD3D12::_get_buffer_from_owner(RID p_buffer) { + Buffer *buffer = nullptr; + if (vertex_buffer_owner.owns(p_buffer)) { + buffer = vertex_buffer_owner.get_or_null(p_buffer); + } else if (index_buffer_owner.owns(p_buffer)) { + buffer = index_buffer_owner.get_or_null(p_buffer); + } else if (uniform_buffer_owner.owns(p_buffer)) { + buffer = uniform_buffer_owner.get_or_null(p_buffer); + } else if (texture_buffer_owner.owns(p_buffer)) { + buffer = &texture_buffer_owner.get_or_null(p_buffer)->buffer; + } else if (storage_buffer_owner.owns(p_buffer)) { + buffer = storage_buffer_owner.get_or_null(p_buffer); + } + return buffer; +} + +void RenderingDeviceD3D12::_add_dependency(RID p_id, RID p_depends_on) { + if (!dependency_map.has(p_depends_on)) { + dependency_map[p_depends_on] = HashSet<RID>(); + } + + dependency_map[p_depends_on].insert(p_id); + + if (!reverse_dependency_map.has(p_id)) { + reverse_dependency_map[p_id] = HashSet<RID>(); + } + + reverse_dependency_map[p_id].insert(p_depends_on); +} + +void RenderingDeviceD3D12::_free_dependencies(RID p_id) { + // Direct dependencies must be freed. + + HashMap<RID, HashSet<RID>>::Iterator E = dependency_map.find(p_id); + if (E) { + while (E->value.size()) { + free(*E->value.begin()); + } + dependency_map.remove(E); + } + + // Reverse dependencies must be unreferenced. + E = reverse_dependency_map.find(p_id); + + if (E) { + for (const RID &F : E->value) { + HashMap<RID, HashSet<RID>>::Iterator G = dependency_map.find(F); + ERR_CONTINUE(!G); + ERR_CONTINUE(!G->value.has(p_id)); + G->value.erase(p_id); + } + + reverse_dependency_map.remove(E); + } +} + +// NOTE: RD's packed format names are reversed in relation to DXGI's; e.g.:. +// - DATA_FORMAT_A8B8G8R8_UNORM_PACK32 -> DXGI_FORMAT_R8G8B8A8_UNORM (packed; note ABGR vs. RGBA). +// - DATA_FORMAT_B8G8R8A8_UNORM -> DXGI_FORMAT_B8G8R8A8_UNORM (not packed; note BGRA order matches). +// TODO: Add YUV formats properly, which would require better support for planes in the RD API. +const RenderingDeviceD3D12::D3D12Format RenderingDeviceD3D12::d3d12_formats[RenderingDevice::DATA_FORMAT_MAX] = { + /* DATA_FORMAT_R4G4_UNORM_PACK8 */ {}, + /* DATA_FORMAT_R4G4B4A4_UNORM_PACK16 */ { DXGI_FORMAT_B4G4R4A4_UNORM, DXGI_FORMAT_B4G4R4A4_UNORM, D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING(1, 2, 3, 0) }, + /* DATA_FORMAT_B4G4R4A4_UNORM_PACK16 */ { DXGI_FORMAT_B4G4R4A4_UNORM, DXGI_FORMAT_B4G4R4A4_UNORM, D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING(3, 2, 1, 0) }, + /* DATA_FORMAT_R5G6B5_UNORM_PACK16 */ { DXGI_FORMAT_B5G6R5_UNORM, DXGI_FORMAT_B5G6R5_UNORM }, + /* DATA_FORMAT_B5G6R5_UNORM_PACK16 */ { DXGI_FORMAT_B5G6R5_UNORM, DXGI_FORMAT_B5G6R5_UNORM, D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING(2, 1, 0, 3) }, + /* DATA_FORMAT_R5G5B5A1_UNORM_PACK16 */ { DXGI_FORMAT_B5G6R5_UNORM, DXGI_FORMAT_B5G5R5A1_UNORM, D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING(1, 2, 3, 0) }, + /* DATA_FORMAT_B5G5R5A1_UNORM_PACK16 */ { DXGI_FORMAT_B5G6R5_UNORM, DXGI_FORMAT_B5G5R5A1_UNORM, D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING(3, 2, 1, 0) }, + /* DATA_FORMAT_A1R5G5B5_UNORM_PACK16 */ { DXGI_FORMAT_B5G6R5_UNORM, DXGI_FORMAT_B5G5R5A1_UNORM }, + /* DATA_FORMAT_R8_UNORM */ { DXGI_FORMAT_R8_TYPELESS, DXGI_FORMAT_R8_UNORM }, + /* DATA_FORMAT_R8_SNORM */ { DXGI_FORMAT_R8_TYPELESS, DXGI_FORMAT_R8_SNORM }, + /* DATA_FORMAT_R8_USCALED */ { DXGI_FORMAT_R8_TYPELESS, DXGI_FORMAT_R8_UINT }, + /* DATA_FORMAT_R8_SSCALED */ { DXGI_FORMAT_R8_TYPELESS, DXGI_FORMAT_R8_SINT }, + /* DATA_FORMAT_R8_UINT */ { DXGI_FORMAT_R8_TYPELESS, DXGI_FORMAT_R8_UINT }, + /* DATA_FORMAT_R8_SINT */ { DXGI_FORMAT_R8_TYPELESS, DXGI_FORMAT_R8_SINT }, + /* DATA_FORMAT_R8_SRGB */ {}, + /* DATA_FORMAT_R8G8_UNORM */ { DXGI_FORMAT_R8G8_TYPELESS, DXGI_FORMAT_R8G8_UNORM }, + /* DATA_FORMAT_R8G8_SNORM */ { DXGI_FORMAT_R8G8_TYPELESS, DXGI_FORMAT_R8G8_SNORM }, + /* DATA_FORMAT_R8G8_USCALED */ { DXGI_FORMAT_R8G8_TYPELESS, DXGI_FORMAT_R8G8_UINT }, + /* DATA_FORMAT_R8G8_SSCALED */ { DXGI_FORMAT_R8G8_TYPELESS, DXGI_FORMAT_R8G8_SINT }, + /* DATA_FORMAT_R8G8_UINT */ { DXGI_FORMAT_R8G8_TYPELESS, DXGI_FORMAT_R8G8_UINT }, + /* DATA_FORMAT_R8G8_SINT */ { DXGI_FORMAT_R8G8_TYPELESS, DXGI_FORMAT_R8G8_SINT }, + /* DATA_FORMAT_R8G8_SRGB */ {}, + /* DATA_FORMAT_R8G8B8_UNORM */ {}, + /* DATA_FORMAT_R8G8B8_SNORM */ {}, + /* DATA_FORMAT_R8G8B8_USCALED */ {}, + /* DATA_FORMAT_R8G8B8_SSCALED */ {}, + /* DATA_FORMAT_R8G8B8_UINT */ {}, + /* DATA_FORMAT_R8G8B8_SINT */ {}, + /* DATA_FORMAT_R8G8B8_SRGB */ {}, + /* DATA_FORMAT_B8G8R8_UNORM */ {}, + /* DATA_FORMAT_B8G8R8_SNORM */ {}, + /* DATA_FORMAT_B8G8R8_USCALED */ {}, + /* DATA_FORMAT_B8G8R8_SSCALED */ {}, + /* DATA_FORMAT_B8G8R8_UINT */ {}, + /* DATA_FORMAT_B8G8R8_SINT */ {}, + /* DATA_FORMAT_B8G8R8_SRGB */ {}, + /* DATA_FORMAT_R8G8B8A8_UNORM */ { DXGI_FORMAT_R8G8B8A8_TYPELESS, DXGI_FORMAT_R8G8B8A8_UNORM }, + /* DATA_FORMAT_R8G8B8A8_SNORM */ { DXGI_FORMAT_R8G8B8A8_TYPELESS, DXGI_FORMAT_R8G8B8A8_SNORM }, + /* DATA_FORMAT_R8G8B8A8_USCALED */ { DXGI_FORMAT_R8G8B8A8_TYPELESS, DXGI_FORMAT_R8G8B8A8_UINT }, + /* DATA_FORMAT_R8G8B8A8_SSCALED */ { DXGI_FORMAT_R8G8B8A8_TYPELESS, DXGI_FORMAT_R8G8B8A8_SINT }, + /* DATA_FORMAT_R8G8B8A8_UINT */ { DXGI_FORMAT_R8G8B8A8_TYPELESS, DXGI_FORMAT_R8G8B8A8_UINT }, + /* DATA_FORMAT_R8G8B8A8_SINT */ { DXGI_FORMAT_R8G8B8A8_TYPELESS, DXGI_FORMAT_R8G8B8A8_SINT }, + /* DATA_FORMAT_R8G8B8A8_SRGB */ { DXGI_FORMAT_R8G8B8A8_TYPELESS, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB }, + /* DATA_FORMAT_B8G8R8A8_UNORM */ { DXGI_FORMAT_B8G8R8A8_TYPELESS, DXGI_FORMAT_B8G8R8A8_UNORM }, + /* DATA_FORMAT_B8G8R8A8_SNORM */ { DXGI_FORMAT_R8G8B8A8_TYPELESS, DXGI_FORMAT_R8G8B8A8_SNORM }, + /* DATA_FORMAT_B8G8R8A8_USCALED */ { DXGI_FORMAT_R8G8B8A8_TYPELESS, DXGI_FORMAT_R8G8B8A8_UINT }, + /* DATA_FORMAT_B8G8R8A8_SSCALED */ { DXGI_FORMAT_R8G8B8A8_TYPELESS, DXGI_FORMAT_R8G8B8A8_SINT }, + /* DATA_FORMAT_B8G8R8A8_UINT */ { DXGI_FORMAT_R8G8B8A8_TYPELESS, DXGI_FORMAT_R8G8B8A8_UINT }, + /* DATA_FORMAT_B8G8R8A8_SINT */ { DXGI_FORMAT_R8G8B8A8_TYPELESS, DXGI_FORMAT_R8G8B8A8_SINT }, + /* DATA_FORMAT_B8G8R8A8_SRGB */ { DXGI_FORMAT_B8G8R8A8_TYPELESS, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB }, + /* DATA_FORMAT_A8B8G8R8_UNORM_PACK32 */ { DXGI_FORMAT_R8G8B8A8_TYPELESS, DXGI_FORMAT_R8G8B8A8_UNORM }, + /* DATA_FORMAT_A8B8G8R8_SNORM_PACK32 */ { DXGI_FORMAT_R8G8B8A8_TYPELESS, DXGI_FORMAT_R8G8B8A8_SNORM }, + /* DATA_FORMAT_A8B8G8R8_USCALED_PACK32 */ { DXGI_FORMAT_R8G8B8A8_TYPELESS, DXGI_FORMAT_R8G8B8A8_UINT }, + /* DATA_FORMAT_A8B8G8R8_SSCALED_PACK32 */ { DXGI_FORMAT_R8G8B8A8_TYPELESS, DXGI_FORMAT_R8G8B8A8_SINT }, + /* DATA_FORMAT_A8B8G8R8_UINT_PACK32 */ { DXGI_FORMAT_R8G8B8A8_TYPELESS, DXGI_FORMAT_R8G8B8A8_UINT }, + /* DATA_FORMAT_A8B8G8R8_SINT_PACK32 */ { DXGI_FORMAT_R8G8B8A8_TYPELESS, DXGI_FORMAT_R8G8B8A8_SINT }, + /* DATA_FORMAT_A8B8G8R8_SRGB_PACK32 */ { DXGI_FORMAT_B8G8R8A8_TYPELESS, DXGI_FORMAT_B8G8R8A8_UNORM_SRGB }, + /* DATA_FORMAT_A2R10G10B10_UNORM_PACK32 */ { DXGI_FORMAT_R10G10B10A2_TYPELESS, DXGI_FORMAT_R10G10B10A2_UNORM, D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING(2, 1, 0, 3) }, + /* DATA_FORMAT_A2R10G10B10_SNORM_PACK32 */ {}, + /* DATA_FORMAT_A2R10G10B10_USCALED_PACK32 */ { DXGI_FORMAT_R10G10B10A2_TYPELESS, DXGI_FORMAT_R10G10B10A2_UINT, D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING(2, 1, 0, 3) }, + /* DATA_FORMAT_A2R10G10B10_SSCALED_PACK32 */ {}, + /* DATA_FORMAT_A2R10G10B10_UINT_PACK32 */ { DXGI_FORMAT_R10G10B10A2_TYPELESS, DXGI_FORMAT_R10G10B10A2_UINT, D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING(2, 1, 0, 3) }, + /* DATA_FORMAT_A2R10G10B10_SINT_PACK32 */ {}, + /* DATA_FORMAT_A2B10G10R10_UNORM_PACK32 */ { DXGI_FORMAT_R10G10B10A2_TYPELESS, DXGI_FORMAT_R10G10B10A2_UNORM }, + /* DATA_FORMAT_A2B10G10R10_SNORM_PACK32 */ {}, + /* DATA_FORMAT_A2B10G10R10_USCALED_PACK32 */ { DXGI_FORMAT_R10G10B10A2_TYPELESS, DXGI_FORMAT_R10G10B10A2_UINT }, + /* DATA_FORMAT_A2B10G10R10_SSCALED_PACK32 */ {}, + /* DATA_FORMAT_A2B10G10R10_UINT_PACK32 */ { DXGI_FORMAT_R10G10B10A2_TYPELESS, DXGI_FORMAT_R10G10B10A2_UINT }, + /* DATA_FORMAT_A2B10G10R10_SINT_PACK32 */ {}, + /* DATA_FORMAT_R16_UNORM */ { DXGI_FORMAT_R16_TYPELESS, DXGI_FORMAT_R16_UNORM }, + /* DATA_FORMAT_R16_SNORM */ { DXGI_FORMAT_R16_TYPELESS, DXGI_FORMAT_R16_SNORM }, + /* DATA_FORMAT_R16_USCALED */ { DXGI_FORMAT_R16_TYPELESS, DXGI_FORMAT_R16_UINT }, + /* DATA_FORMAT_R16_SSCALED */ { DXGI_FORMAT_R16_TYPELESS, DXGI_FORMAT_R16_SINT }, + /* DATA_FORMAT_R16_UINT */ { DXGI_FORMAT_R16_TYPELESS, DXGI_FORMAT_R16_UINT }, + /* DATA_FORMAT_R16_SINT */ { DXGI_FORMAT_R16_TYPELESS, DXGI_FORMAT_R16_SINT }, + /* DATA_FORMAT_R16_SFLOAT */ { DXGI_FORMAT_R16_TYPELESS, DXGI_FORMAT_R16_FLOAT }, + /* DATA_FORMAT_R16G16_UNORM */ { DXGI_FORMAT_R16G16_TYPELESS, DXGI_FORMAT_R16G16_UNORM }, + /* DATA_FORMAT_R16G16_SNORM */ { DXGI_FORMAT_R16G16_TYPELESS, DXGI_FORMAT_R16G16_SNORM }, + /* DATA_FORMAT_R16G16_USCALED */ { DXGI_FORMAT_R16G16_TYPELESS, DXGI_FORMAT_R16G16_UINT }, + /* DATA_FORMAT_R16G16_SSCALED */ { DXGI_FORMAT_R16G16_TYPELESS, DXGI_FORMAT_R16G16_SINT }, + /* DATA_FORMAT_R16G16_UINT */ { DXGI_FORMAT_R16G16_TYPELESS, DXGI_FORMAT_R16G16_UINT }, + /* DATA_FORMAT_R16G16_SINT */ { DXGI_FORMAT_R16G16_TYPELESS, DXGI_FORMAT_R16G16_SINT }, + /* DATA_FORMAT_R16G16_SFLOAT */ { DXGI_FORMAT_R16G16_TYPELESS, DXGI_FORMAT_R16G16_FLOAT }, + /* DATA_FORMAT_R16G16B16_UNORM */ {}, + /* DATA_FORMAT_R16G16B16_SNORM */ {}, + /* DATA_FORMAT_R16G16B16_USCALED */ {}, + /* DATA_FORMAT_R16G16B16_SSCALED */ {}, + /* DATA_FORMAT_R16G16B16_UINT */ {}, + /* DATA_FORMAT_R16G16B16_SINT */ {}, + /* DATA_FORMAT_R16G16B16_SFLOAT */ {}, + /* DATA_FORMAT_R16G16B16A16_UNORM */ { DXGI_FORMAT_R16G16B16A16_TYPELESS, DXGI_FORMAT_R16G16B16A16_UNORM }, + /* DATA_FORMAT_R16G16B16A16_SNORM */ { DXGI_FORMAT_R16G16B16A16_TYPELESS, DXGI_FORMAT_R16G16B16A16_SNORM }, + /* DATA_FORMAT_R16G16B16A16_USCALED */ { DXGI_FORMAT_R16G16B16A16_TYPELESS, DXGI_FORMAT_R16G16B16A16_UINT }, + /* DATA_FORMAT_R16G16B16A16_SSCALED */ { DXGI_FORMAT_R16G16B16A16_TYPELESS, DXGI_FORMAT_R16G16B16A16_SINT }, + /* DATA_FORMAT_R16G16B16A16_UINT */ { DXGI_FORMAT_R16G16B16A16_TYPELESS, DXGI_FORMAT_R16G16B16A16_UINT }, + /* DATA_FORMAT_R16G16B16A16_SINT */ { DXGI_FORMAT_R16G16B16A16_TYPELESS, DXGI_FORMAT_R16G16B16A16_SINT }, + /* DATA_FORMAT_R16G16B16A16_SFLOAT */ { DXGI_FORMAT_R16G16B16A16_TYPELESS, DXGI_FORMAT_R16G16B16A16_FLOAT }, + /* DATA_FORMAT_R32_UINT */ { DXGI_FORMAT_R32_TYPELESS, DXGI_FORMAT_R32_UINT }, + /* DATA_FORMAT_R32_SINT */ { DXGI_FORMAT_R32_TYPELESS, DXGI_FORMAT_R32_SINT }, + /* DATA_FORMAT_R32_SFLOAT */ { DXGI_FORMAT_R32_TYPELESS, DXGI_FORMAT_R32_FLOAT }, + /* DATA_FORMAT_R32G32_UINT */ { DXGI_FORMAT_R32G32_TYPELESS, DXGI_FORMAT_R32G32_UINT }, + /* DATA_FORMAT_R32G32_SINT */ { DXGI_FORMAT_R32G32_TYPELESS, DXGI_FORMAT_R32G32_SINT }, + /* DATA_FORMAT_R32G32_SFLOAT */ { DXGI_FORMAT_R32G32_TYPELESS, DXGI_FORMAT_R32G32_FLOAT }, + /* DATA_FORMAT_R32G32B32_UINT */ { DXGI_FORMAT_R32G32B32_TYPELESS, DXGI_FORMAT_R32G32B32_UINT }, + /* DATA_FORMAT_R32G32B32_SINT */ { DXGI_FORMAT_R32G32B32_TYPELESS, DXGI_FORMAT_R32G32B32_SINT }, + /* DATA_FORMAT_R32G32B32_SFLOAT */ { DXGI_FORMAT_R32G32B32_TYPELESS, DXGI_FORMAT_R32G32B32_FLOAT }, + /* DATA_FORMAT_R32G32B32A32_UINT */ { DXGI_FORMAT_R32G32B32A32_TYPELESS, DXGI_FORMAT_R32G32B32A32_UINT }, + /* DATA_FORMAT_R32G32B32A32_SINT */ { DXGI_FORMAT_R32G32B32A32_TYPELESS, DXGI_FORMAT_R32G32B32A32_SINT }, + /* DATA_FORMAT_R32G32B32A32_SFLOAT */ { DXGI_FORMAT_R32G32B32A32_TYPELESS, DXGI_FORMAT_R32G32B32A32_FLOAT }, + /* DATA_FORMAT_R64_UINT */ {}, + /* DATA_FORMAT_R64_SINT */ {}, + /* DATA_FORMAT_R64_SFLOAT */ {}, + /* DATA_FORMAT_R64G64_UINT */ {}, + /* DATA_FORMAT_R64G64_SINT */ {}, + /* DATA_FORMAT_R64G64_SFLOAT */ {}, + /* DATA_FORMAT_R64G64B64_UINT */ {}, + /* DATA_FORMAT_R64G64B64_SINT */ {}, + /* DATA_FORMAT_R64G64B64_SFLOAT */ {}, + /* DATA_FORMAT_R64G64B64A64_UINT */ {}, + /* DATA_FORMAT_R64G64B64A64_SINT */ {}, + /* DATA_FORMAT_R64G64B64A64_SFLOAT */ {}, + /* DATA_FORMAT_B10G11R11_UFLOAT_PACK32 */ { DXGI_FORMAT_R11G11B10_FLOAT, DXGI_FORMAT_R11G11B10_FLOAT }, + /* DATA_FORMAT_E5B9G9R9_UFLOAT_PACK32 */ { DXGI_FORMAT_R9G9B9E5_SHAREDEXP, DXGI_FORMAT_R9G9B9E5_SHAREDEXP }, + /* DATA_FORMAT_D16_UNORM */ { DXGI_FORMAT_R16_TYPELESS, DXGI_FORMAT_R16_UNORM, 0, DXGI_FORMAT_D16_UNORM }, + /* DATA_FORMAT_X8_D24_UNORM_PACK32 */ { DXGI_FORMAT_R24G8_TYPELESS, DXGI_FORMAT_UNKNOWN, 0, DXGI_FORMAT_D24_UNORM_S8_UINT }, + /* DATA_FORMAT_D32_SFLOAT */ { DXGI_FORMAT_R32_TYPELESS, DXGI_FORMAT_R32_FLOAT, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING, DXGI_FORMAT_D32_FLOAT }, + /* DATA_FORMAT_S8_UINT */ {}, + /* DATA_FORMAT_D16_UNORM_S8_UINT */ {}, + /* DATA_FORMAT_D24_UNORM_S8_UINT */ { DXGI_FORMAT_R24G8_TYPELESS, DXGI_FORMAT_UNKNOWN, 0, DXGI_FORMAT_D24_UNORM_S8_UINT }, + /* DATA_FORMAT_D32_SFLOAT_S8_UINT */ { DXGI_FORMAT_R32G8X24_TYPELESS, DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING, DXGI_FORMAT_D32_FLOAT_S8X24_UINT }, + /* DATA_FORMAT_BC1_RGB_UNORM_BLOCK */ { DXGI_FORMAT_BC1_TYPELESS, DXGI_FORMAT_BC1_UNORM, D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING(0, 1, 2, D3D12_SHADER_COMPONENT_MAPPING_FORCE_VALUE_1) }, + /* DATA_FORMAT_BC1_RGB_SRGB_BLOCK */ { DXGI_FORMAT_BC1_TYPELESS, DXGI_FORMAT_BC1_UNORM_SRGB, D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING(0, 1, 2, D3D12_SHADER_COMPONENT_MAPPING_FORCE_VALUE_1) }, + /* DATA_FORMAT_BC1_RGBA_UNORM_BLOCK */ { DXGI_FORMAT_BC1_TYPELESS, DXGI_FORMAT_BC1_UNORM }, + /* DATA_FORMAT_BC1_RGBA_SRGB_BLOCK */ { DXGI_FORMAT_BC1_TYPELESS, DXGI_FORMAT_BC1_UNORM_SRGB }, + /* DATA_FORMAT_BC2_UNORM_BLOCK */ { DXGI_FORMAT_BC2_TYPELESS, DXGI_FORMAT_BC2_UNORM }, + /* DATA_FORMAT_BC2_SRGB_BLOCK */ { DXGI_FORMAT_BC2_TYPELESS, DXGI_FORMAT_BC2_UNORM_SRGB }, + /* DATA_FORMAT_BC3_UNORM_BLOCK */ { DXGI_FORMAT_BC3_TYPELESS, DXGI_FORMAT_BC3_UNORM }, + /* DATA_FORMAT_BC3_SRGB_BLOCK */ { DXGI_FORMAT_BC3_TYPELESS, DXGI_FORMAT_BC3_UNORM_SRGB }, + /* DATA_FORMAT_BC4_UNORM_BLOCK */ { DXGI_FORMAT_BC4_TYPELESS, DXGI_FORMAT_BC4_UNORM }, + /* DATA_FORMAT_BC4_SNORM_BLOCK */ { DXGI_FORMAT_BC4_TYPELESS, DXGI_FORMAT_BC4_SNORM }, + /* DATA_FORMAT_BC5_UNORM_BLOCK */ { DXGI_FORMAT_BC5_TYPELESS, DXGI_FORMAT_BC5_UNORM }, + /* DATA_FORMAT_BC5_SNORM_BLOCK */ { DXGI_FORMAT_BC5_TYPELESS, DXGI_FORMAT_BC5_SNORM }, + /* DATA_FORMAT_BC6H_UFLOAT_BLOCK */ { DXGI_FORMAT_BC6H_TYPELESS, DXGI_FORMAT_BC6H_UF16 }, + /* DATA_FORMAT_BC6H_SFLOAT_BLOCK */ { DXGI_FORMAT_BC6H_TYPELESS, DXGI_FORMAT_BC6H_SF16 }, + /* DATA_FORMAT_BC7_UNORM_BLOCK */ { DXGI_FORMAT_BC7_TYPELESS, DXGI_FORMAT_BC7_UNORM }, + /* DATA_FORMAT_BC7_SRGB_BLOCK */ { DXGI_FORMAT_BC7_TYPELESS, DXGI_FORMAT_BC7_UNORM_SRGB }, + /* DATA_FORMAT_ETC2_R8G8B8_UNORM_BLOCK */ {}, + /* DATA_FORMAT_ETC2_R8G8B8_SRGB_BLOCK */ {}, + /* DATA_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK */ {}, + /* DATA_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK */ {}, + /* DATA_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK */ {}, + /* DATA_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK */ {}, + /* DATA_FORMAT_EAC_R11_UNORM_BLOCK */ {}, + /* DATA_FORMAT_EAC_R11_SNORM_BLOCK */ {}, + /* DATA_FORMAT_EAC_R11G11_UNORM_BLOCK */ {}, + /* DATA_FORMAT_EAC_R11G11_SNORM_BLOCK */ {}, + /* DATA_FORMAT_ASTC_4x4_UNORM_BLOCK */ {}, + /* DATA_FORMAT_ASTC_4x4_SRGB_BLOCK */ {}, + /* DATA_FORMAT_ASTC_5x4_UNORM_BLOCK */ {}, + /* DATA_FORMAT_ASTC_5x4_SRGB_BLOCK */ {}, + /* DATA_FORMAT_ASTC_5x5_UNORM_BLOCK */ {}, + /* DATA_FORMAT_ASTC_5x5_SRGB_BLOCK */ {}, + /* DATA_FORMAT_ASTC_6x5_UNORM_BLOCK */ {}, + /* DATA_FORMAT_ASTC_6x5_SRGB_BLOCK */ {}, + /* DATA_FORMAT_ASTC_6x6_UNORM_BLOCK */ {}, + /* DATA_FORMAT_ASTC_6x6_SRGB_BLOCK */ {}, + /* DATA_FORMAT_ASTC_8x5_UNORM_BLOCK */ {}, + /* DATA_FORMAT_ASTC_8x5_SRGB_BLOCK */ {}, + /* DATA_FORMAT_ASTC_8x6_UNORM_BLOCK */ {}, + /* DATA_FORMAT_ASTC_8x6_SRGB_BLOCK */ {}, + /* DATA_FORMAT_ASTC_8x8_UNORM_BLOCK */ {}, + /* DATA_FORMAT_ASTC_8x8_SRGB_BLOCK */ {}, + /* DATA_FORMAT_ASTC_10x5_UNORM_BLOCK */ {}, + /* DATA_FORMAT_ASTC_10x5_SRGB_BLOCK */ {}, + /* DATA_FORMAT_ASTC_10x6_UNORM_BLOCK */ {}, + /* DATA_FORMAT_ASTC_10x6_SRGB_BLOCK */ {}, + /* DATA_FORMAT_ASTC_10x8_UNORM_BLOCK */ {}, + /* DATA_FORMAT_ASTC_10x8_SRGB_BLOCK */ {}, + /* DATA_FORMAT_ASTC_10x10_UNORM_BLOCK */ {}, + /* DATA_FORMAT_ASTC_10x10_SRGB_BLOCK */ {}, + /* DATA_FORMAT_ASTC_12x10_UNORM_BLOCK */ {}, + /* DATA_FORMAT_ASTC_12x10_SRGB_BLOCK */ {}, + /* DATA_FORMAT_ASTC_12x12_UNORM_BLOCK */ {}, + /* DATA_FORMAT_ASTC_12x12_SRGB_BLOCK */ {}, + /* DATA_FORMAT_G8B8G8R8_422_UNORM */ {}, + /* DATA_FORMAT_B8G8R8G8_422_UNORM */ {}, + /* DATA_FORMAT_G8_B8_R8_3PLANE_420_UNORM */ {}, + /* DATA_FORMAT_G8_B8R8_2PLANE_420_UNORM */ {}, + /* DATA_FORMAT_G8_B8_R8_3PLANE_422_UNORM */ {}, + /* DATA_FORMAT_G8_B8R8_2PLANE_422_UNORM */ {}, + /* DATA_FORMAT_G8_B8_R8_3PLANE_444_UNORM */ {}, + /* DATA_FORMAT_R10X6_UNORM_PACK16 */ {}, + /* DATA_FORMAT_R10X6G10X6_UNORM_2PACK16 */ {}, + /* DATA_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16 */ {}, + /* DATA_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16 */ {}, + /* DATA_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16 */ {}, + /* DATA_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16 */ {}, + /* DATA_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16 */ {}, + /* DATA_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16 */ {}, + /* DATA_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16 */ {}, + /* DATA_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16 */ {}, + /* DATA_FORMAT_R12X4_UNORM_PACK16 */ {}, + /* DATA_FORMAT_R12X4G12X4_UNORM_2PACK16 */ {}, + /* DATA_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16 */ {}, + /* DATA_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16 */ {}, + /* DATA_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16 */ {}, + /* DATA_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16 */ {}, + /* DATA_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16 */ {}, + /* DATA_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16 */ {}, + /* DATA_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16 */ {}, + /* DATA_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16 */ {}, + /* DATA_FORMAT_G16B16G16R16_422_UNORM */ {}, + /* DATA_FORMAT_B16G16R16G16_422_UNORM */ {}, + /* DATA_FORMAT_G16_B16_R16_3PLANE_420_UNORM */ {}, + /* DATA_FORMAT_G16_B16R16_2PLANE_420_UNORM */ {}, + /* DATA_FORMAT_G16_B16_R16_3PLANE_422_UNORM */ {}, + /* DATA_FORMAT_G16_B16R16_2PLANE_422_UNORM */ {}, + /* DATA_FORMAT_G16_B16_R16_3PLANE_444_UNORM */ {}, +}; + +const char *RenderingDeviceD3D12::named_formats[RenderingDevice::DATA_FORMAT_MAX] = { + "R4G4_Unorm_Pack8", + "R4G4B4A4_Unorm_Pack16", + "B4G4R4A4_Unorm_Pack16", + "R5G6B5_Unorm_Pack16", + "B5G6R5_Unorm_Pack16", + "R5G5B5A1_Unorm_Pack16", + "B5G5R5A1_Unorm_Pack16", + "A1R5G5B5_Unorm_Pack16", + "R8_Unorm", + "R8_Snorm", + "R8_Uscaled", + "R8_Sscaled", + "R8_Uint", + "R8_Sint", + "R8_Srgb", + "R8G8_Unorm", + "R8G8_Snorm", + "R8G8_Uscaled", + "R8G8_Sscaled", + "R8G8_Uint", + "R8G8_Sint", + "R8G8_Srgb", + "R8G8B8_Unorm", + "R8G8B8_Snorm", + "R8G8B8_Uscaled", + "R8G8B8_Sscaled", + "R8G8B8_Uint", + "R8G8B8_Sint", + "R8G8B8_Srgb", + "B8G8R8_Unorm", + "B8G8R8_Snorm", + "B8G8R8_Uscaled", + "B8G8R8_Sscaled", + "B8G8R8_Uint", + "B8G8R8_Sint", + "B8G8R8_Srgb", + "R8G8B8A8_Unorm", + "R8G8B8A8_Snorm", + "R8G8B8A8_Uscaled", + "R8G8B8A8_Sscaled", + "R8G8B8A8_Uint", + "R8G8B8A8_Sint", + "R8G8B8A8_Srgb", + "B8G8R8A8_Unorm", + "B8G8R8A8_Snorm", + "B8G8R8A8_Uscaled", + "B8G8R8A8_Sscaled", + "B8G8R8A8_Uint", + "B8G8R8A8_Sint", + "B8G8R8A8_Srgb", + "A8B8G8R8_Unorm_Pack32", + "A8B8G8R8_Snorm_Pack32", + "A8B8G8R8_Uscaled_Pack32", + "A8B8G8R8_Sscaled_Pack32", + "A8B8G8R8_Uint_Pack32", + "A8B8G8R8_Sint_Pack32", + "A8B8G8R8_Srgb_Pack32", + "A2R10G10B10_Unorm_Pack32", + "A2R10G10B10_Snorm_Pack32", + "A2R10G10B10_Uscaled_Pack32", + "A2R10G10B10_Sscaled_Pack32", + "A2R10G10B10_Uint_Pack32", + "A2R10G10B10_Sint_Pack32", + "A2B10G10R10_Unorm_Pack32", + "A2B10G10R10_Snorm_Pack32", + "A2B10G10R10_Uscaled_Pack32", + "A2B10G10R10_Sscaled_Pack32", + "A2B10G10R10_Uint_Pack32", + "A2B10G10R10_Sint_Pack32", + "R16_Unorm", + "R16_Snorm", + "R16_Uscaled", + "R16_Sscaled", + "R16_Uint", + "R16_Sint", + "R16_Sfloat", + "R16G16_Unorm", + "R16G16_Snorm", + "R16G16_Uscaled", + "R16G16_Sscaled", + "R16G16_Uint", + "R16G16_Sint", + "R16G16_Sfloat", + "R16G16B16_Unorm", + "R16G16B16_Snorm", + "R16G16B16_Uscaled", + "R16G16B16_Sscaled", + "R16G16B16_Uint", + "R16G16B16_Sint", + "R16G16B16_Sfloat", + "R16G16B16A16_Unorm", + "R16G16B16A16_Snorm", + "R16G16B16A16_Uscaled", + "R16G16B16A16_Sscaled", + "R16G16B16A16_Uint", + "R16G16B16A16_Sint", + "R16G16B16A16_Sfloat", + "R32_Uint", + "R32_Sint", + "R32_Sfloat", + "R32G32_Uint", + "R32G32_Sint", + "R32G32_Sfloat", + "R32G32B32_Uint", + "R32G32B32_Sint", + "R32G32B32_Sfloat", + "R32G32B32A32_Uint", + "R32G32B32A32_Sint", + "R32G32B32A32_Sfloat", + "R64_Uint", + "R64_Sint", + "R64_Sfloat", + "R64G64_Uint", + "R64G64_Sint", + "R64G64_Sfloat", + "R64G64B64_Uint", + "R64G64B64_Sint", + "R64G64B64_Sfloat", + "R64G64B64A64_Uint", + "R64G64B64A64_Sint", + "R64G64B64A64_Sfloat", + "B10G11R11_Ufloat_Pack32", + "E5B9G9R9_Ufloat_Pack32", + "D16_Unorm", + "X8_D24_Unorm_Pack32", + "D32_Sfloat", + "S8_Uint", + "D16_Unorm_S8_Uint", + "D24_Unorm_S8_Uint", + "D32_Sfloat_S8_Uint", + "Bc1_Rgb_Unorm_Block", + "Bc1_Rgb_Srgb_Block", + "Bc1_Rgba_Unorm_Block", + "Bc1_Rgba_Srgb_Block", + "Bc2_Unorm_Block", + "Bc2_Srgb_Block", + "Bc3_Unorm_Block", + "Bc3_Srgb_Block", + "Bc4_Unorm_Block", + "Bc4_Snorm_Block", + "Bc5_Unorm_Block", + "Bc5_Snorm_Block", + "Bc6H_Ufloat_Block", + "Bc6H_Sfloat_Block", + "Bc7_Unorm_Block", + "Bc7_Srgb_Block", + "Etc2_R8G8B8_Unorm_Block", + "Etc2_R8G8B8_Srgb_Block", + "Etc2_R8G8B8A1_Unorm_Block", + "Etc2_R8G8B8A1_Srgb_Block", + "Etc2_R8G8B8A8_Unorm_Block", + "Etc2_R8G8B8A8_Srgb_Block", + "Eac_R11_Unorm_Block", + "Eac_R11_Snorm_Block", + "Eac_R11G11_Unorm_Block", + "Eac_R11G11_Snorm_Block", + "Astc_4X4_Unorm_Block", + "Astc_4X4_Srgb_Block", + "Astc_5X4_Unorm_Block", + "Astc_5X4_Srgb_Block", + "Astc_5X5_Unorm_Block", + "Astc_5X5_Srgb_Block", + "Astc_6X5_Unorm_Block", + "Astc_6X5_Srgb_Block", + "Astc_6X6_Unorm_Block", + "Astc_6X6_Srgb_Block", + "Astc_8X5_Unorm_Block", + "Astc_8X5_Srgb_Block", + "Astc_8X6_Unorm_Block", + "Astc_8X6_Srgb_Block", + "Astc_8X8_Unorm_Block", + "Astc_8X8_Srgb_Block", + "Astc_10X5_Unorm_Block", + "Astc_10X5_Srgb_Block", + "Astc_10X6_Unorm_Block", + "Astc_10X6_Srgb_Block", + "Astc_10X8_Unorm_Block", + "Astc_10X8_Srgb_Block", + "Astc_10X10_Unorm_Block", + "Astc_10X10_Srgb_Block", + "Astc_12X10_Unorm_Block", + "Astc_12X10_Srgb_Block", + "Astc_12X12_Unorm_Block", + "Astc_12X12_Srgb_Block", + "G8B8G8R8_422_Unorm", + "B8G8R8G8_422_Unorm", + "G8_B8_R8_3Plane_420_Unorm", + "G8_B8R8_2Plane_420_Unorm", + "G8_B8_R8_3Plane_422_Unorm", + "G8_B8R8_2Plane_422_Unorm", + "G8_B8_R8_3Plane_444_Unorm", + "R10X6_Unorm_Pack16", + "R10X6G10X6_Unorm_2Pack16", + "R10X6G10X6B10X6A10X6_Unorm_4Pack16", + "G10X6B10X6G10X6R10X6_422_Unorm_4Pack16", + "B10X6G10X6R10X6G10X6_422_Unorm_4Pack16", + "G10X6_B10X6_R10X6_3Plane_420_Unorm_3Pack16", + "G10X6_B10X6R10X6_2Plane_420_Unorm_3Pack16", + "G10X6_B10X6_R10X6_3Plane_422_Unorm_3Pack16", + "G10X6_B10X6R10X6_2Plane_422_Unorm_3Pack16", + "G10X6_B10X6_R10X6_3Plane_444_Unorm_3Pack16", + "R12X4_Unorm_Pack16", + "R12X4G12X4_Unorm_2Pack16", + "R12X4G12X4B12X4A12X4_Unorm_4Pack16", + "G12X4B12X4G12X4R12X4_422_Unorm_4Pack16", + "B12X4G12X4R12X4G12X4_422_Unorm_4Pack16", + "G12X4_B12X4_R12X4_3Plane_420_Unorm_3Pack16", + "G12X4_B12X4R12X4_2Plane_420_Unorm_3Pack16", + "G12X4_B12X4_R12X4_3Plane_422_Unorm_3Pack16", + "G12X4_B12X4R12X4_2Plane_422_Unorm_3Pack16", + "G12X4_B12X4_R12X4_3Plane_444_Unorm_3Pack16", + "G16B16G16R16_422_Unorm", + "B16G16R16G16_422_Unorm", + "G16_B16_R16_3Plane_420_Unorm", + "G16_B16R16_2Plane_420_Unorm", + "G16_B16_R16_3Plane_422_Unorm", + "G16_B16R16_2Plane_422_Unorm", + "G16_B16_R16_3Plane_444_Unorm", +}; + +int RenderingDeviceD3D12::get_format_vertex_size(DataFormat p_format) { + switch (p_format) { + case DATA_FORMAT_R8_UNORM: + case DATA_FORMAT_R8_SNORM: + case DATA_FORMAT_R8_UINT: + case DATA_FORMAT_R8_SINT: + case DATA_FORMAT_R8G8_UNORM: + case DATA_FORMAT_R8G8_SNORM: + case DATA_FORMAT_R8G8_UINT: + case DATA_FORMAT_R8G8_SINT: + case DATA_FORMAT_R8G8B8_UNORM: + case DATA_FORMAT_R8G8B8_SNORM: + case DATA_FORMAT_R8G8B8_UINT: + case DATA_FORMAT_R8G8B8_SINT: + case DATA_FORMAT_B8G8R8_UNORM: + case DATA_FORMAT_B8G8R8_SNORM: + case DATA_FORMAT_B8G8R8_UINT: + case DATA_FORMAT_B8G8R8_SINT: + case DATA_FORMAT_R8G8B8A8_UNORM: + case DATA_FORMAT_R8G8B8A8_SNORM: + case DATA_FORMAT_R8G8B8A8_UINT: + case DATA_FORMAT_R8G8B8A8_SINT: + case DATA_FORMAT_B8G8R8A8_UNORM: + case DATA_FORMAT_B8G8R8A8_SNORM: + case DATA_FORMAT_B8G8R8A8_UINT: + case DATA_FORMAT_B8G8R8A8_SINT: + case DATA_FORMAT_A2B10G10R10_UNORM_PACK32: + return 4; + case DATA_FORMAT_R16_UNORM: + case DATA_FORMAT_R16_SNORM: + case DATA_FORMAT_R16_UINT: + case DATA_FORMAT_R16_SINT: + case DATA_FORMAT_R16_SFLOAT: + return 4; + case DATA_FORMAT_R16G16_UNORM: + case DATA_FORMAT_R16G16_SNORM: + case DATA_FORMAT_R16G16_UINT: + case DATA_FORMAT_R16G16_SINT: + case DATA_FORMAT_R16G16_SFLOAT: + return 4; + case DATA_FORMAT_R16G16B16_UNORM: + case DATA_FORMAT_R16G16B16_SNORM: + case DATA_FORMAT_R16G16B16_UINT: + case DATA_FORMAT_R16G16B16_SINT: + case DATA_FORMAT_R16G16B16_SFLOAT: + return 8; + case DATA_FORMAT_R16G16B16A16_UNORM: + case DATA_FORMAT_R16G16B16A16_SNORM: + case DATA_FORMAT_R16G16B16A16_UINT: + case DATA_FORMAT_R16G16B16A16_SINT: + case DATA_FORMAT_R16G16B16A16_SFLOAT: + return 8; + case DATA_FORMAT_R32_UINT: + case DATA_FORMAT_R32_SINT: + case DATA_FORMAT_R32_SFLOAT: + return 4; + case DATA_FORMAT_R32G32_UINT: + case DATA_FORMAT_R32G32_SINT: + case DATA_FORMAT_R32G32_SFLOAT: + return 8; + case DATA_FORMAT_R32G32B32_UINT: + case DATA_FORMAT_R32G32B32_SINT: + case DATA_FORMAT_R32G32B32_SFLOAT: + return 12; + case DATA_FORMAT_R32G32B32A32_UINT: + case DATA_FORMAT_R32G32B32A32_SINT: + case DATA_FORMAT_R32G32B32A32_SFLOAT: + return 16; + case DATA_FORMAT_R64_UINT: + case DATA_FORMAT_R64_SINT: + case DATA_FORMAT_R64_SFLOAT: + return 8; + case DATA_FORMAT_R64G64_UINT: + case DATA_FORMAT_R64G64_SINT: + case DATA_FORMAT_R64G64_SFLOAT: + return 16; + case DATA_FORMAT_R64G64B64_UINT: + case DATA_FORMAT_R64G64B64_SINT: + case DATA_FORMAT_R64G64B64_SFLOAT: + return 24; + case DATA_FORMAT_R64G64B64A64_UINT: + case DATA_FORMAT_R64G64B64A64_SINT: + case DATA_FORMAT_R64G64B64A64_SFLOAT: + return 32; + default: + return 0; + } +} + +uint32_t RenderingDeviceD3D12::get_image_format_pixel_size(DataFormat p_format) { + switch (p_format) { + case DATA_FORMAT_R4G4_UNORM_PACK8: + return 1; + case DATA_FORMAT_R4G4B4A4_UNORM_PACK16: + case DATA_FORMAT_B4G4R4A4_UNORM_PACK16: + case DATA_FORMAT_R5G6B5_UNORM_PACK16: + case DATA_FORMAT_B5G6R5_UNORM_PACK16: + case DATA_FORMAT_R5G5B5A1_UNORM_PACK16: + case DATA_FORMAT_B5G5R5A1_UNORM_PACK16: + case DATA_FORMAT_A1R5G5B5_UNORM_PACK16: + return 2; + case DATA_FORMAT_R8_UNORM: + case DATA_FORMAT_R8_SNORM: + case DATA_FORMAT_R8_USCALED: + case DATA_FORMAT_R8_SSCALED: + case DATA_FORMAT_R8_UINT: + case DATA_FORMAT_R8_SINT: + case DATA_FORMAT_R8_SRGB: + return 1; + case DATA_FORMAT_R8G8_UNORM: + case DATA_FORMAT_R8G8_SNORM: + case DATA_FORMAT_R8G8_USCALED: + case DATA_FORMAT_R8G8_SSCALED: + case DATA_FORMAT_R8G8_UINT: + case DATA_FORMAT_R8G8_SINT: + case DATA_FORMAT_R8G8_SRGB: + return 2; + case DATA_FORMAT_R8G8B8_UNORM: + case DATA_FORMAT_R8G8B8_SNORM: + case DATA_FORMAT_R8G8B8_USCALED: + case DATA_FORMAT_R8G8B8_SSCALED: + case DATA_FORMAT_R8G8B8_UINT: + case DATA_FORMAT_R8G8B8_SINT: + case DATA_FORMAT_R8G8B8_SRGB: + case DATA_FORMAT_B8G8R8_UNORM: + case DATA_FORMAT_B8G8R8_SNORM: + case DATA_FORMAT_B8G8R8_USCALED: + case DATA_FORMAT_B8G8R8_SSCALED: + case DATA_FORMAT_B8G8R8_UINT: + case DATA_FORMAT_B8G8R8_SINT: + case DATA_FORMAT_B8G8R8_SRGB: + return 3; + case DATA_FORMAT_R8G8B8A8_UNORM: + case DATA_FORMAT_R8G8B8A8_SNORM: + case DATA_FORMAT_R8G8B8A8_USCALED: + case DATA_FORMAT_R8G8B8A8_SSCALED: + case DATA_FORMAT_R8G8B8A8_UINT: + case DATA_FORMAT_R8G8B8A8_SINT: + case DATA_FORMAT_R8G8B8A8_SRGB: + case DATA_FORMAT_B8G8R8A8_UNORM: + case DATA_FORMAT_B8G8R8A8_SNORM: + case DATA_FORMAT_B8G8R8A8_USCALED: + case DATA_FORMAT_B8G8R8A8_SSCALED: + case DATA_FORMAT_B8G8R8A8_UINT: + case DATA_FORMAT_B8G8R8A8_SINT: + case DATA_FORMAT_B8G8R8A8_SRGB: + return 4; + case DATA_FORMAT_A8B8G8R8_UNORM_PACK32: + case DATA_FORMAT_A8B8G8R8_SNORM_PACK32: + case DATA_FORMAT_A8B8G8R8_USCALED_PACK32: + case DATA_FORMAT_A8B8G8R8_SSCALED_PACK32: + case DATA_FORMAT_A8B8G8R8_UINT_PACK32: + case DATA_FORMAT_A8B8G8R8_SINT_PACK32: + case DATA_FORMAT_A8B8G8R8_SRGB_PACK32: + case DATA_FORMAT_A2R10G10B10_UNORM_PACK32: + case DATA_FORMAT_A2R10G10B10_SNORM_PACK32: + case DATA_FORMAT_A2R10G10B10_USCALED_PACK32: + case DATA_FORMAT_A2R10G10B10_SSCALED_PACK32: + case DATA_FORMAT_A2R10G10B10_UINT_PACK32: + case DATA_FORMAT_A2R10G10B10_SINT_PACK32: + case DATA_FORMAT_A2B10G10R10_UNORM_PACK32: + case DATA_FORMAT_A2B10G10R10_SNORM_PACK32: + case DATA_FORMAT_A2B10G10R10_USCALED_PACK32: + case DATA_FORMAT_A2B10G10R10_SSCALED_PACK32: + case DATA_FORMAT_A2B10G10R10_UINT_PACK32: + case DATA_FORMAT_A2B10G10R10_SINT_PACK32: + return 4; + case DATA_FORMAT_R16_UNORM: + case DATA_FORMAT_R16_SNORM: + case DATA_FORMAT_R16_USCALED: + case DATA_FORMAT_R16_SSCALED: + case DATA_FORMAT_R16_UINT: + case DATA_FORMAT_R16_SINT: + case DATA_FORMAT_R16_SFLOAT: + return 2; + case DATA_FORMAT_R16G16_UNORM: + case DATA_FORMAT_R16G16_SNORM: + case DATA_FORMAT_R16G16_USCALED: + case DATA_FORMAT_R16G16_SSCALED: + case DATA_FORMAT_R16G16_UINT: + case DATA_FORMAT_R16G16_SINT: + case DATA_FORMAT_R16G16_SFLOAT: + return 4; + case DATA_FORMAT_R16G16B16_UNORM: + case DATA_FORMAT_R16G16B16_SNORM: + case DATA_FORMAT_R16G16B16_USCALED: + case DATA_FORMAT_R16G16B16_SSCALED: + case DATA_FORMAT_R16G16B16_UINT: + case DATA_FORMAT_R16G16B16_SINT: + case DATA_FORMAT_R16G16B16_SFLOAT: + return 6; + case DATA_FORMAT_R16G16B16A16_UNORM: + case DATA_FORMAT_R16G16B16A16_SNORM: + case DATA_FORMAT_R16G16B16A16_USCALED: + case DATA_FORMAT_R16G16B16A16_SSCALED: + case DATA_FORMAT_R16G16B16A16_UINT: + case DATA_FORMAT_R16G16B16A16_SINT: + case DATA_FORMAT_R16G16B16A16_SFLOAT: + return 8; + case DATA_FORMAT_R32_UINT: + case DATA_FORMAT_R32_SINT: + case DATA_FORMAT_R32_SFLOAT: + return 4; + case DATA_FORMAT_R32G32_UINT: + case DATA_FORMAT_R32G32_SINT: + case DATA_FORMAT_R32G32_SFLOAT: + return 8; + case DATA_FORMAT_R32G32B32_UINT: + case DATA_FORMAT_R32G32B32_SINT: + case DATA_FORMAT_R32G32B32_SFLOAT: + return 12; + case DATA_FORMAT_R32G32B32A32_UINT: + case DATA_FORMAT_R32G32B32A32_SINT: + case DATA_FORMAT_R32G32B32A32_SFLOAT: + return 16; + case DATA_FORMAT_R64_UINT: + case DATA_FORMAT_R64_SINT: + case DATA_FORMAT_R64_SFLOAT: + return 8; + case DATA_FORMAT_R64G64_UINT: + case DATA_FORMAT_R64G64_SINT: + case DATA_FORMAT_R64G64_SFLOAT: + return 16; + case DATA_FORMAT_R64G64B64_UINT: + case DATA_FORMAT_R64G64B64_SINT: + case DATA_FORMAT_R64G64B64_SFLOAT: + return 24; + case DATA_FORMAT_R64G64B64A64_UINT: + case DATA_FORMAT_R64G64B64A64_SINT: + case DATA_FORMAT_R64G64B64A64_SFLOAT: + return 32; + case DATA_FORMAT_B10G11R11_UFLOAT_PACK32: + case DATA_FORMAT_E5B9G9R9_UFLOAT_PACK32: + return 4; + case DATA_FORMAT_D16_UNORM: + return 2; + case DATA_FORMAT_X8_D24_UNORM_PACK32: + return 4; + case DATA_FORMAT_D32_SFLOAT: + return 4; + case DATA_FORMAT_S8_UINT: + return 1; + case DATA_FORMAT_D16_UNORM_S8_UINT: + return 4; + case DATA_FORMAT_D24_UNORM_S8_UINT: + return 4; + case DATA_FORMAT_D32_SFLOAT_S8_UINT: + return 5; // ? + case DATA_FORMAT_BC1_RGB_UNORM_BLOCK: + case DATA_FORMAT_BC1_RGB_SRGB_BLOCK: + case DATA_FORMAT_BC1_RGBA_UNORM_BLOCK: + case DATA_FORMAT_BC1_RGBA_SRGB_BLOCK: + case DATA_FORMAT_BC2_UNORM_BLOCK: + case DATA_FORMAT_BC2_SRGB_BLOCK: + case DATA_FORMAT_BC3_UNORM_BLOCK: + case DATA_FORMAT_BC3_SRGB_BLOCK: + case DATA_FORMAT_BC4_UNORM_BLOCK: + case DATA_FORMAT_BC4_SNORM_BLOCK: + case DATA_FORMAT_BC5_UNORM_BLOCK: + case DATA_FORMAT_BC5_SNORM_BLOCK: + case DATA_FORMAT_BC6H_UFLOAT_BLOCK: + case DATA_FORMAT_BC6H_SFLOAT_BLOCK: + case DATA_FORMAT_BC7_UNORM_BLOCK: + case DATA_FORMAT_BC7_SRGB_BLOCK: + return 1; + case DATA_FORMAT_ETC2_R8G8B8_UNORM_BLOCK: + case DATA_FORMAT_ETC2_R8G8B8_SRGB_BLOCK: + case DATA_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK: + case DATA_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK: + case DATA_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK: + case DATA_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK: + return 1; + case DATA_FORMAT_EAC_R11_UNORM_BLOCK: + case DATA_FORMAT_EAC_R11_SNORM_BLOCK: + case DATA_FORMAT_EAC_R11G11_UNORM_BLOCK: + case DATA_FORMAT_EAC_R11G11_SNORM_BLOCK: + return 1; + case DATA_FORMAT_ASTC_4x4_UNORM_BLOCK: + case DATA_FORMAT_ASTC_4x4_SRGB_BLOCK: + case DATA_FORMAT_ASTC_5x4_UNORM_BLOCK: + case DATA_FORMAT_ASTC_5x4_SRGB_BLOCK: + case DATA_FORMAT_ASTC_5x5_UNORM_BLOCK: + case DATA_FORMAT_ASTC_5x5_SRGB_BLOCK: + case DATA_FORMAT_ASTC_6x5_UNORM_BLOCK: + case DATA_FORMAT_ASTC_6x5_SRGB_BLOCK: + case DATA_FORMAT_ASTC_6x6_UNORM_BLOCK: + case DATA_FORMAT_ASTC_6x6_SRGB_BLOCK: + case DATA_FORMAT_ASTC_8x5_UNORM_BLOCK: + case DATA_FORMAT_ASTC_8x5_SRGB_BLOCK: + case DATA_FORMAT_ASTC_8x6_UNORM_BLOCK: + case DATA_FORMAT_ASTC_8x6_SRGB_BLOCK: + case DATA_FORMAT_ASTC_8x8_UNORM_BLOCK: + case DATA_FORMAT_ASTC_8x8_SRGB_BLOCK: + case DATA_FORMAT_ASTC_10x5_UNORM_BLOCK: + case DATA_FORMAT_ASTC_10x5_SRGB_BLOCK: + case DATA_FORMAT_ASTC_10x6_UNORM_BLOCK: + case DATA_FORMAT_ASTC_10x6_SRGB_BLOCK: + case DATA_FORMAT_ASTC_10x8_UNORM_BLOCK: + case DATA_FORMAT_ASTC_10x8_SRGB_BLOCK: + case DATA_FORMAT_ASTC_10x10_UNORM_BLOCK: + case DATA_FORMAT_ASTC_10x10_SRGB_BLOCK: + case DATA_FORMAT_ASTC_12x10_UNORM_BLOCK: + case DATA_FORMAT_ASTC_12x10_SRGB_BLOCK: + case DATA_FORMAT_ASTC_12x12_UNORM_BLOCK: + case DATA_FORMAT_ASTC_12x12_SRGB_BLOCK: + return 1; + case DATA_FORMAT_G8B8G8R8_422_UNORM: + case DATA_FORMAT_B8G8R8G8_422_UNORM: + return 4; + case DATA_FORMAT_G8_B8_R8_3PLANE_420_UNORM: + case DATA_FORMAT_G8_B8R8_2PLANE_420_UNORM: + case DATA_FORMAT_G8_B8_R8_3PLANE_422_UNORM: + case DATA_FORMAT_G8_B8R8_2PLANE_422_UNORM: + case DATA_FORMAT_G8_B8_R8_3PLANE_444_UNORM: + return 4; + case DATA_FORMAT_R10X6_UNORM_PACK16: + case DATA_FORMAT_R10X6G10X6_UNORM_2PACK16: + case DATA_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16: + case DATA_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16: + case DATA_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16: + case DATA_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16: + case DATA_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16: + case DATA_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16: + case DATA_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16: + case DATA_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16: + case DATA_FORMAT_R12X4_UNORM_PACK16: + case DATA_FORMAT_R12X4G12X4_UNORM_2PACK16: + case DATA_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16: + case DATA_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16: + case DATA_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16: + case DATA_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16: + case DATA_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16: + case DATA_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16: + case DATA_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16: + case DATA_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16: + return 2; + case DATA_FORMAT_G16B16G16R16_422_UNORM: + case DATA_FORMAT_B16G16R16G16_422_UNORM: + case DATA_FORMAT_G16_B16_R16_3PLANE_420_UNORM: + case DATA_FORMAT_G16_B16R16_2PLANE_420_UNORM: + case DATA_FORMAT_G16_B16_R16_3PLANE_422_UNORM: + case DATA_FORMAT_G16_B16R16_2PLANE_422_UNORM: + case DATA_FORMAT_G16_B16_R16_3PLANE_444_UNORM: + return 8; + default: { + ERR_PRINT("Format not handled, bug"); + } + } + + return 1; +} + +// https://www.khronos.org/registry/DataFormat/specs/1.1/dataformat.1.1.pdf + +void RenderingDeviceD3D12::get_compressed_image_format_block_dimensions(DataFormat p_format, uint32_t &r_w, uint32_t &r_h) { + switch (p_format) { + case DATA_FORMAT_BC1_RGB_UNORM_BLOCK: + case DATA_FORMAT_BC1_RGB_SRGB_BLOCK: + case DATA_FORMAT_BC1_RGBA_UNORM_BLOCK: + case DATA_FORMAT_BC1_RGBA_SRGB_BLOCK: + case DATA_FORMAT_BC2_UNORM_BLOCK: + case DATA_FORMAT_BC2_SRGB_BLOCK: + case DATA_FORMAT_BC3_UNORM_BLOCK: + case DATA_FORMAT_BC3_SRGB_BLOCK: + case DATA_FORMAT_BC4_UNORM_BLOCK: + case DATA_FORMAT_BC4_SNORM_BLOCK: + case DATA_FORMAT_BC5_UNORM_BLOCK: + case DATA_FORMAT_BC5_SNORM_BLOCK: + case DATA_FORMAT_BC6H_UFLOAT_BLOCK: + case DATA_FORMAT_BC6H_SFLOAT_BLOCK: + case DATA_FORMAT_BC7_UNORM_BLOCK: + case DATA_FORMAT_BC7_SRGB_BLOCK: + case DATA_FORMAT_ETC2_R8G8B8_UNORM_BLOCK: + case DATA_FORMAT_ETC2_R8G8B8_SRGB_BLOCK: + case DATA_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK: + case DATA_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK: + case DATA_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK: + case DATA_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK: + case DATA_FORMAT_EAC_R11_UNORM_BLOCK: + case DATA_FORMAT_EAC_R11_SNORM_BLOCK: + case DATA_FORMAT_EAC_R11G11_UNORM_BLOCK: + case DATA_FORMAT_EAC_R11G11_SNORM_BLOCK: + case DATA_FORMAT_ASTC_4x4_UNORM_BLOCK: // Again, not sure about astc. + case DATA_FORMAT_ASTC_4x4_SRGB_BLOCK: + case DATA_FORMAT_ASTC_5x4_UNORM_BLOCK: + case DATA_FORMAT_ASTC_5x4_SRGB_BLOCK: + case DATA_FORMAT_ASTC_5x5_UNORM_BLOCK: + case DATA_FORMAT_ASTC_5x5_SRGB_BLOCK: + case DATA_FORMAT_ASTC_6x5_UNORM_BLOCK: + case DATA_FORMAT_ASTC_6x5_SRGB_BLOCK: + case DATA_FORMAT_ASTC_6x6_UNORM_BLOCK: + case DATA_FORMAT_ASTC_6x6_SRGB_BLOCK: + case DATA_FORMAT_ASTC_8x5_UNORM_BLOCK: + case DATA_FORMAT_ASTC_8x5_SRGB_BLOCK: + case DATA_FORMAT_ASTC_8x6_UNORM_BLOCK: + case DATA_FORMAT_ASTC_8x6_SRGB_BLOCK: + case DATA_FORMAT_ASTC_8x8_UNORM_BLOCK: + case DATA_FORMAT_ASTC_8x8_SRGB_BLOCK: + case DATA_FORMAT_ASTC_10x5_UNORM_BLOCK: + case DATA_FORMAT_ASTC_10x5_SRGB_BLOCK: + case DATA_FORMAT_ASTC_10x6_UNORM_BLOCK: + case DATA_FORMAT_ASTC_10x6_SRGB_BLOCK: + case DATA_FORMAT_ASTC_10x8_UNORM_BLOCK: + case DATA_FORMAT_ASTC_10x8_SRGB_BLOCK: + case DATA_FORMAT_ASTC_10x10_UNORM_BLOCK: + case DATA_FORMAT_ASTC_10x10_SRGB_BLOCK: + case DATA_FORMAT_ASTC_12x10_UNORM_BLOCK: + case DATA_FORMAT_ASTC_12x10_SRGB_BLOCK: + case DATA_FORMAT_ASTC_12x12_UNORM_BLOCK: + case DATA_FORMAT_ASTC_12x12_SRGB_BLOCK: + r_w = 4; + r_h = 4; + return; + default: { + r_w = 1; + r_h = 1; + } + } +} + +uint32_t RenderingDeviceD3D12::get_compressed_image_format_block_byte_size(DataFormat p_format) { + switch (p_format) { + case DATA_FORMAT_BC1_RGB_UNORM_BLOCK: + case DATA_FORMAT_BC1_RGB_SRGB_BLOCK: + case DATA_FORMAT_BC1_RGBA_UNORM_BLOCK: + case DATA_FORMAT_BC1_RGBA_SRGB_BLOCK: + return 8; + case DATA_FORMAT_BC2_UNORM_BLOCK: + case DATA_FORMAT_BC2_SRGB_BLOCK: + return 16; + case DATA_FORMAT_BC3_UNORM_BLOCK: + case DATA_FORMAT_BC3_SRGB_BLOCK: + return 16; + case DATA_FORMAT_BC4_UNORM_BLOCK: + case DATA_FORMAT_BC4_SNORM_BLOCK: + return 8; + case DATA_FORMAT_BC5_UNORM_BLOCK: + case DATA_FORMAT_BC5_SNORM_BLOCK: + return 16; + case DATA_FORMAT_BC6H_UFLOAT_BLOCK: + case DATA_FORMAT_BC6H_SFLOAT_BLOCK: + return 16; + case DATA_FORMAT_BC7_UNORM_BLOCK: + case DATA_FORMAT_BC7_SRGB_BLOCK: + return 16; + case DATA_FORMAT_ETC2_R8G8B8_UNORM_BLOCK: + case DATA_FORMAT_ETC2_R8G8B8_SRGB_BLOCK: + return 8; + case DATA_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK: + case DATA_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK: + return 8; + case DATA_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK: + case DATA_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK: + return 16; + case DATA_FORMAT_EAC_R11_UNORM_BLOCK: + case DATA_FORMAT_EAC_R11_SNORM_BLOCK: + return 8; + case DATA_FORMAT_EAC_R11G11_UNORM_BLOCK: + case DATA_FORMAT_EAC_R11G11_SNORM_BLOCK: + return 16; + case DATA_FORMAT_ASTC_4x4_UNORM_BLOCK: // Again, not sure about astc. + case DATA_FORMAT_ASTC_4x4_SRGB_BLOCK: + case DATA_FORMAT_ASTC_5x4_UNORM_BLOCK: + case DATA_FORMAT_ASTC_5x4_SRGB_BLOCK: + case DATA_FORMAT_ASTC_5x5_UNORM_BLOCK: + case DATA_FORMAT_ASTC_5x5_SRGB_BLOCK: + case DATA_FORMAT_ASTC_6x5_UNORM_BLOCK: + case DATA_FORMAT_ASTC_6x5_SRGB_BLOCK: + case DATA_FORMAT_ASTC_6x6_UNORM_BLOCK: + case DATA_FORMAT_ASTC_6x6_SRGB_BLOCK: + case DATA_FORMAT_ASTC_8x5_UNORM_BLOCK: + case DATA_FORMAT_ASTC_8x5_SRGB_BLOCK: + case DATA_FORMAT_ASTC_8x6_UNORM_BLOCK: + case DATA_FORMAT_ASTC_8x6_SRGB_BLOCK: + case DATA_FORMAT_ASTC_8x8_UNORM_BLOCK: + case DATA_FORMAT_ASTC_8x8_SRGB_BLOCK: + case DATA_FORMAT_ASTC_10x5_UNORM_BLOCK: + case DATA_FORMAT_ASTC_10x5_SRGB_BLOCK: + case DATA_FORMAT_ASTC_10x6_UNORM_BLOCK: + case DATA_FORMAT_ASTC_10x6_SRGB_BLOCK: + case DATA_FORMAT_ASTC_10x8_UNORM_BLOCK: + case DATA_FORMAT_ASTC_10x8_SRGB_BLOCK: + case DATA_FORMAT_ASTC_10x10_UNORM_BLOCK: + case DATA_FORMAT_ASTC_10x10_SRGB_BLOCK: + case DATA_FORMAT_ASTC_12x10_UNORM_BLOCK: + case DATA_FORMAT_ASTC_12x10_SRGB_BLOCK: + case DATA_FORMAT_ASTC_12x12_UNORM_BLOCK: + case DATA_FORMAT_ASTC_12x12_SRGB_BLOCK: + return 8; // Wrong. + default: { + } + } + return 1; +} + +uint32_t RenderingDeviceD3D12::get_compressed_image_format_pixel_rshift(DataFormat p_format) { + switch (p_format) { + case DATA_FORMAT_BC1_RGB_UNORM_BLOCK: // These formats are half byte size, so rshift is 1. + case DATA_FORMAT_BC1_RGB_SRGB_BLOCK: + case DATA_FORMAT_BC1_RGBA_UNORM_BLOCK: + case DATA_FORMAT_BC1_RGBA_SRGB_BLOCK: + case DATA_FORMAT_BC4_UNORM_BLOCK: + case DATA_FORMAT_BC4_SNORM_BLOCK: + case DATA_FORMAT_ETC2_R8G8B8_UNORM_BLOCK: + case DATA_FORMAT_ETC2_R8G8B8_SRGB_BLOCK: + case DATA_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK: + case DATA_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK: + case DATA_FORMAT_EAC_R11_UNORM_BLOCK: + case DATA_FORMAT_EAC_R11_SNORM_BLOCK: + return 1; + default: { + } + } + + return 0; +} + +uint32_t RenderingDeviceD3D12::get_image_format_plane_count(DataFormat p_format) { + uint32_t planes = 1; + switch (p_format) { + case DATA_FORMAT_D16_UNORM_S8_UINT: + case DATA_FORMAT_D24_UNORM_S8_UINT: + case DATA_FORMAT_D32_SFLOAT_S8_UINT: { + planes = 2; + } + default: { + } + } + DEV_ASSERT(planes <= MAX_IMAGE_FORMAT_PLANES); + return planes; +} + +uint32_t RenderingDeviceD3D12::get_image_format_required_size(DataFormat p_format, uint32_t p_width, uint32_t p_height, uint32_t p_depth, uint32_t p_mipmaps, uint32_t *r_blockw, uint32_t *r_blockh, uint32_t *r_depth) { + ERR_FAIL_COND_V(p_mipmaps == 0, 0); + uint32_t w = p_width; + uint32_t h = p_height; + uint32_t d = p_depth; + + uint32_t size = 0; + + uint32_t pixel_size = get_image_format_pixel_size(p_format); + uint32_t pixel_rshift = get_compressed_image_format_pixel_rshift(p_format); + uint32_t blockw, blockh; + get_compressed_image_format_block_dimensions(p_format, blockw, blockh); + + for (uint32_t i = 0; i < p_mipmaps; i++) { + uint32_t bw = w % blockw != 0 ? w + (blockw - w % blockw) : w; + uint32_t bh = h % blockh != 0 ? h + (blockh - h % blockh) : h; + + uint32_t s = bw * bh; + + s *= pixel_size; + s >>= pixel_rshift; + size += s * d; + if (r_blockw) { + *r_blockw = bw; + } + if (r_blockh) { + *r_blockh = bh; + } + if (r_depth) { + *r_depth = d; + } + w = MAX(blockw, w >> 1); + h = MAX(blockh, h >> 1); + d = MAX(1u, d >> 1); + } + + return size; +} + +uint32_t RenderingDeviceD3D12::get_image_required_mipmaps(uint32_t p_width, uint32_t p_height, uint32_t p_depth) { + // Formats and block size don't really matter here since they can all go down to 1px (even if block is larger). + uint32_t w = p_width; + uint32_t h = p_height; + uint32_t d = p_depth; + + uint32_t mipmaps = 1; + + while (true) { + if (w == 1 && h == 1 && d == 1) { + break; + } + + w = MAX(1u, w >> 1); + h = MAX(1u, h >> 1); + d = MAX(1u, d >> 1); + + mipmaps++; + } + + return mipmaps; +} + +/////////////////////// + +const D3D12_COMPARISON_FUNC RenderingDeviceD3D12::compare_operators[RenderingDevice::COMPARE_OP_MAX] = { + D3D12_COMPARISON_FUNC_NEVER, + D3D12_COMPARISON_FUNC_LESS, + D3D12_COMPARISON_FUNC_EQUAL, + D3D12_COMPARISON_FUNC_LESS_EQUAL, + D3D12_COMPARISON_FUNC_GREATER, + D3D12_COMPARISON_FUNC_NOT_EQUAL, + D3D12_COMPARISON_FUNC_GREATER_EQUAL, + D3D12_COMPARISON_FUNC_ALWAYS, +}; + +const D3D12_STENCIL_OP RenderingDeviceD3D12::stencil_operations[RenderingDevice::STENCIL_OP_MAX] = { + D3D12_STENCIL_OP_KEEP, + D3D12_STENCIL_OP_ZERO, + D3D12_STENCIL_OP_REPLACE, + D3D12_STENCIL_OP_INCR_SAT, + D3D12_STENCIL_OP_DECR_SAT, + D3D12_STENCIL_OP_INVERT, + D3D12_STENCIL_OP_INCR, + D3D12_STENCIL_OP_DECR, +}; + +const UINT RenderingDeviceD3D12::rasterization_sample_count[RenderingDevice::TEXTURE_SAMPLES_MAX] = { + 1, + 2, + 4, + 8, + 16, + 32, + 64, +}; + +const D3D12_LOGIC_OP RenderingDeviceD3D12::logic_operations[RenderingDevice::LOGIC_OP_MAX] = { + D3D12_LOGIC_OP_CLEAR, + D3D12_LOGIC_OP_AND, + D3D12_LOGIC_OP_AND_REVERSE, + D3D12_LOGIC_OP_COPY, + D3D12_LOGIC_OP_AND_INVERTED, + D3D12_LOGIC_OP_NOOP, + D3D12_LOGIC_OP_XOR, + D3D12_LOGIC_OP_OR, + D3D12_LOGIC_OP_NOR, + D3D12_LOGIC_OP_EQUIV, + D3D12_LOGIC_OP_INVERT, + D3D12_LOGIC_OP_OR_REVERSE, + D3D12_LOGIC_OP_COPY_INVERTED, + D3D12_LOGIC_OP_OR_INVERTED, + D3D12_LOGIC_OP_NAND, + D3D12_LOGIC_OP_SET, +}; + +const D3D12_BLEND RenderingDeviceD3D12::blend_factors[RenderingDevice::BLEND_FACTOR_MAX] = { + D3D12_BLEND_ZERO, + D3D12_BLEND_ONE, + D3D12_BLEND_SRC_COLOR, + D3D12_BLEND_INV_SRC_COLOR, + D3D12_BLEND_DEST_COLOR, + D3D12_BLEND_INV_DEST_COLOR, + D3D12_BLEND_SRC_ALPHA, + D3D12_BLEND_INV_SRC_ALPHA, + D3D12_BLEND_DEST_ALPHA, + D3D12_BLEND_INV_DEST_ALPHA, + D3D12_BLEND_BLEND_FACTOR, + D3D12_BLEND_INV_BLEND_FACTOR, + D3D12_BLEND_BLEND_FACTOR, + D3D12_BLEND_INV_BLEND_FACTOR, + D3D12_BLEND_SRC_ALPHA_SAT, + D3D12_BLEND_SRC1_COLOR, + D3D12_BLEND_INV_SRC1_COLOR, + D3D12_BLEND_SRC1_ALPHA, + D3D12_BLEND_INV_SRC1_ALPHA, +}; + +const D3D12_BLEND_OP RenderingDeviceD3D12::blend_operations[RenderingDevice::BLEND_OP_MAX] = { + D3D12_BLEND_OP_ADD, + D3D12_BLEND_OP_SUBTRACT, + D3D12_BLEND_OP_REV_SUBTRACT, + D3D12_BLEND_OP_MIN, + D3D12_BLEND_OP_MAX, +}; + +const D3D12_TEXTURE_ADDRESS_MODE RenderingDeviceD3D12::address_modes[RenderingDevice::SAMPLER_REPEAT_MODE_MAX] = { + D3D12_TEXTURE_ADDRESS_MODE_WRAP, + D3D12_TEXTURE_ADDRESS_MODE_MIRROR, + D3D12_TEXTURE_ADDRESS_MODE_CLAMP, + D3D12_TEXTURE_ADDRESS_MODE_BORDER, + D3D12_TEXTURE_ADDRESS_MODE_MIRROR_ONCE, +}; + +const FLOAT RenderingDeviceD3D12::sampler_border_colors[RenderingDevice::SAMPLER_BORDER_COLOR_MAX][4] = { + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 1 }, + { 0, 0, 0, 1 }, + { 1, 1, 1, 1 }, + { 1, 1, 1, 1 }, +}; + +const D3D12_RESOURCE_DIMENSION RenderingDeviceD3D12::d3d12_texture_dimension[RenderingDevice::TEXTURE_TYPE_MAX] = { + D3D12_RESOURCE_DIMENSION_TEXTURE1D, + D3D12_RESOURCE_DIMENSION_TEXTURE2D, + D3D12_RESOURCE_DIMENSION_TEXTURE3D, + D3D12_RESOURCE_DIMENSION_TEXTURE2D, + D3D12_RESOURCE_DIMENSION_TEXTURE1D, + D3D12_RESOURCE_DIMENSION_TEXTURE2D, + D3D12_RESOURCE_DIMENSION_TEXTURE2D, +}; + +/******************/ +/**** RESOURCE ****/ +/******************/ + +static const D3D12_RESOURCE_STATES RESOURCE_READ_STATES = + D3D12_RESOURCE_STATE_VERTEX_AND_CONSTANT_BUFFER | + D3D12_RESOURCE_STATE_INDEX_BUFFER | + D3D12_RESOURCE_STATE_DEPTH_READ | + D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE | + D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE | + D3D12_RESOURCE_STATE_INDIRECT_ARGUMENT | + D3D12_RESOURCE_STATE_COPY_SOURCE | + D3D12_RESOURCE_STATE_RESOLVE_SOURCE | + D3D12_RESOURCE_STATE_SHADING_RATE_SOURCE; + +static const D3D12_RESOURCE_STATES RESOURCE_WRITE_STATES = + D3D12_RESOURCE_STATE_RENDER_TARGET | + D3D12_RESOURCE_STATE_DEPTH_WRITE | + D3D12_RESOURCE_STATE_COPY_DEST | + D3D12_RESOURCE_STATE_RESOLVE_DEST; + +static const D3D12_RESOURCE_STATES RESOURCE_RW_STATES = + D3D12_RESOURCE_STATE_UNORDERED_ACCESS; + +void RenderingDeviceD3D12::ResourceState::extend(D3D12_RESOURCE_STATES p_states_to_add) { + states |= p_states_to_add; + +#ifdef DEV_ENABLED + if ((states & RESOURCE_RW_STATES)) { + if ((states & RESOURCE_READ_STATES)) { + // Thanks to [[SRV_UAV_AMBIGUITY]], this is not necessarily an error. + } + if ((states & RESOURCE_WRITE_STATES)) { + ERR_PRINT("Error in new state mask: has R/W state plus some W/O state(s)."); + } + } else { + if ((states & RESOURCE_WRITE_STATES)) { + if ((states & RESOURCE_READ_STATES)) { + ERR_PRINT("Error in new state mask: mixes R/O and W/O states."); + } else { + uint32_t num_w_states = 0; + for (uint32_t i = 0; i < sizeof(D3D12_RESOURCE_STATES) * 8; i++) { + num_w_states += ((states & RESOURCE_WRITE_STATES) & (1 << i)) ? 1 : 0; + } + ERR_PRINT("Error in new state mask: has multiple W/O states."); + } + } + } +#endif +} + +void RenderingDeviceD3D12::_resource_transition_batch(Resource *p_resource, uint32_t p_subresource, uint32_t p_num_planes, D3D12_RESOURCE_STATES p_new_state, ID3D12Resource *p_resource_override) { + DEV_ASSERT(p_subresource != UINT32_MAX); // We don't support an "all-resources" command here. + DEV_ASSERT(p_new_state != D3D12_RESOURCE_STATE_COMMON); // No need to support this for now. + +#ifdef DEBUG_COUNT_BARRIERS + uint64_t start = OS::get_singleton()->get_ticks_usec(); +#endif + + Resource::States *res_states = p_resource->get_states_ptr(); + D3D12_RESOURCE_STATES *curr_state = &res_states->subresource_states[p_subresource]; + + ID3D12Resource *res_to_transition = p_resource_override ? p_resource_override : p_resource->resource; + + bool redundant_transition = ((*curr_state) & p_new_state) == p_new_state; + if (redundant_transition) { + bool just_written = *curr_state == D3D12_RESOURCE_STATE_UNORDERED_ACCESS; + bool needs_uav_barrier = just_written && res_states->last_batch_with_uav_barrier != res_barriers_batch; + if (needs_uav_barrier) { + if (res_barriers.size() < res_barriers_count + 1) { + res_barriers.resize(res_barriers_count + 1); + } + res_barriers[res_barriers_count] = CD3DX12_RESOURCE_BARRIER::UAV(res_to_transition); + res_barriers_count++; + res_states->last_batch_with_uav_barrier = res_barriers_batch; + } + } else { + uint64_t subres_mask_piece = ((uint64_t)1 << (p_subresource & 0b111111)); + uint8_t subres_qword = p_subresource >> 6; + + if (res_barriers_requests.has(res_states)) { + BarrierRequest &br = res_barriers_requests.get(res_states); + DEV_ASSERT(br.dx_resource == res_to_transition); + DEV_ASSERT(br.subres_mask_qwords == ALIGN(res_states->subresource_states.size(), 64) / 64); + DEV_ASSERT(br.planes == p_num_planes); + + // First, find if the subresource already has a barrier scheduled. + uint8_t curr_group_idx = 0; + bool same_transition_scheduled = false; + for (curr_group_idx = 0; curr_group_idx < br.groups_count; curr_group_idx++) { + if (unlikely(br.groups[curr_group_idx].state.get_state_mask() == BarrierRequest::DELETED_GROUP)) { + continue; + } + if ((br.groups[curr_group_idx].subres_mask[subres_qword] & subres_mask_piece)) { + uint32_t state_mask = br.groups[curr_group_idx].state.get_state_mask(); + same_transition_scheduled = (state_mask & (uint32_t)p_new_state) == (uint32_t)p_new_state; + break; + } + } + if (!same_transition_scheduled) { + bool subres_already_there = curr_group_idx != br.groups_count; + ResourceState final_state; + if (subres_already_there) { + final_state = br.groups[curr_group_idx].state; + final_state.extend(p_new_state); + bool subres_alone = true; + for (uint8_t i = 0; i < br.subres_mask_qwords; i++) { + if (i == subres_qword) { + if (br.groups[curr_group_idx].subres_mask[i] != subres_mask_piece) { + subres_alone = false; + break; + } + } else { + if (br.groups[curr_group_idx].subres_mask[i] != 0) { + subres_alone = false; + break; + } + } + } + bool relocated = false; + if (subres_alone) { + // Subresource is there by itself. + for (uint8_t i = 0; i < br.groups_count; i++) { + if (unlikely(i == curr_group_idx)) { + continue; + } + if (unlikely(br.groups[i].state.get_state_mask() == BarrierRequest::DELETED_GROUP)) { + continue; + } + // There's another group with the final state; relocate to it. + if (br.groups[i].state.get_state_mask() == final_state.get_state_mask()) { + br.groups[curr_group_idx].subres_mask[subres_qword] &= ~subres_mask_piece; + relocated = true; + break; + } + } + if (relocated) { + // Let's delete the group where it used to be by itself. + if (curr_group_idx == br.groups_count - 1) { + br.groups_count--; + } else { + br.groups[curr_group_idx].state = ResourceState(BarrierRequest::DELETED_GROUP); + } + } else { + // Its current group, where it's alone, can extend its state. + br.groups[curr_group_idx].state = final_state; + } + } else { + // Already there, but not by itself and the state mask is different, so it now belongs to a different group. + br.groups[curr_group_idx].subres_mask[subres_qword] &= ~subres_mask_piece; + subres_already_there = false; + } + } else { + final_state = p_new_state; + } + if (!subres_already_there) { + // See if it fits exactly the state of some of the groups to fit it there. + for (uint8_t i = 0; i < br.groups_count; i++) { + if (unlikely(i == curr_group_idx)) { + continue; + } + if (unlikely(br.groups[i].state.get_state_mask() == BarrierRequest::DELETED_GROUP)) { + continue; + } + if (br.groups[i].state.get_state_mask() == final_state.get_state_mask()) { + br.groups[i].subres_mask[subres_qword] |= subres_mask_piece; + subres_already_there = true; + break; + } + } + if (!subres_already_there) { + // Add a new group to accommodate this subresource. + uint8_t group_to_fill = 0; + if (br.groups_count < BarrierRequest::MAX_GROUPS) { + // There are still free groups. + group_to_fill = br.groups_count; + br.groups_count++; + } else { + // Let's try to take over a deleted one. + for (; group_to_fill < br.groups_count; group_to_fill++) { + if (unlikely(br.groups[group_to_fill].state.get_state_mask() == BarrierRequest::DELETED_GROUP)) { + break; + } + } + CRASH_COND(group_to_fill == br.groups_count); + } + + br.groups[group_to_fill].state = final_state; + for (uint8_t i = 0; i < br.subres_mask_qwords; i++) { + if (unlikely(i == subres_qword)) { + br.groups[group_to_fill].subres_mask[i] = subres_mask_piece; + } else { + br.groups[group_to_fill].subres_mask[i] = 0; + } + } + } + } + } + } else { + BarrierRequest &br = res_barriers_requests[res_states]; + br.dx_resource = res_to_transition; + br.subres_mask_qwords = ALIGN(p_resource->get_states_ptr()->subresource_states.size(), 64) / 64; + CRASH_COND(p_resource->get_states_ptr()->subresource_states.size() > BarrierRequest::MAX_SUBRESOURCES); + br.planes = p_num_planes; + br.groups[0].state = p_new_state; + for (uint8_t i = 0; i < br.subres_mask_qwords; i++) { + if (unlikely(i == subres_qword)) { + br.groups[0].subres_mask[i] = subres_mask_piece; + } else { + br.groups[0].subres_mask[i] = 0; + } + } + br.groups_count = 1; + } + } + + if (p_new_state == D3D12_RESOURCE_STATE_UNORDERED_ACCESS) { + res_states->last_batch_transitioned_to_uav = res_barriers_batch; + } + +#ifdef DEBUG_COUNT_BARRIERS + frame_barriers_cpu_time += OS::get_singleton()->get_ticks_usec() - start; +#endif +} + +void RenderingDeviceD3D12::_resource_transitions_flush(ID3D12GraphicsCommandList *p_command_list) { +#ifdef DEBUG_COUNT_BARRIERS + uint64_t start = OS::get_singleton()->get_ticks_usec(); +#endif + + for (const KeyValue<Resource::States *, BarrierRequest> &E : res_barriers_requests) { + Resource::States *res_states = E.key; + const BarrierRequest &br = E.value; + + uint32_t num_subresources = res_states->subresource_states.size(); + + // When there's not a lot of subresources, the empirical finding is that it's better + // to avoid attempting the single-barrier optimization. + static const uint32_t SINGLE_BARRIER_ATTEMPT_MAX_NUM_SUBRESOURCES = 48; + + bool may_do_single_barrier = br.groups_count == 1 && num_subresources * br.planes >= SINGLE_BARRIER_ATTEMPT_MAX_NUM_SUBRESOURCES; + if (may_do_single_barrier) { + // A single group means we may be able to do a single all-subresources barrier. + + { + // First requisite is that all subresources are involved. + + uint8_t subres_mask_full_qwords = num_subresources / 64; + for (uint32_t i = 0; i < subres_mask_full_qwords; i++) { + if (br.groups[0].subres_mask[i] != UINT64_MAX) { + may_do_single_barrier = false; + break; + } + } + if (may_do_single_barrier) { + if (num_subresources % 64) { + DEV_ASSERT(br.subres_mask_qwords == subres_mask_full_qwords + 1); + uint64_t mask_tail_qword = 0; + for (uint8_t i = 0; i < num_subresources % 64; i++) { + mask_tail_qword |= ((uint64_t)1 << i); + } + if ((br.groups[0].subres_mask[subres_mask_full_qwords] & mask_tail_qword) != mask_tail_qword) { + may_do_single_barrier = false; + } + } + } + } + + if (may_do_single_barrier) { + // Second requisite is that the source state is the same for all. + + for (uint32_t i = 1; i < num_subresources; i++) { + if (res_states->subresource_states[i] != res_states->subresource_states[0]) { + may_do_single_barrier = false; + break; + } + } + + if (may_do_single_barrier) { + // Hurray!, we can do a single barrier (plus maybe a UAV one, too). + + bool just_written = res_states->subresource_states[0] == D3D12_RESOURCE_STATE_UNORDERED_ACCESS; + bool needs_uav_barrier = just_written && res_states->last_batch_with_uav_barrier != res_barriers_batch; + + uint32_t needed_barriers = (needs_uav_barrier ? 1 : 0) + 1; + if (res_barriers.size() < res_barriers_count + needed_barriers) { + res_barriers.resize(res_barriers_count + needed_barriers); + } + + if (needs_uav_barrier) { + res_barriers[res_barriers_count] = CD3DX12_RESOURCE_BARRIER::UAV(br.dx_resource); + res_barriers_count++; + res_states->last_batch_with_uav_barrier = res_barriers_batch; + } + + if (res_states->subresource_states[0] != br.groups[0].state.get_state_mask()) { + res_barriers[res_barriers_count] = CD3DX12_RESOURCE_BARRIER::Transition(br.dx_resource, res_states->subresource_states[0], br.groups[0].state.get_state_mask(), D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES); + res_barriers_count++; + } + + for (uint32_t i = 0; i < num_subresources; i++) { + res_states->subresource_states[i] = br.groups[0].state.get_state_mask(); + } + } + } + } + + if (!may_do_single_barrier) { + for (uint8_t i = 0; i < br.groups_count; i++) { + const BarrierRequest::Group &g = E.value.groups[i]; + + if (unlikely(g.state.get_state_mask() == BarrierRequest::DELETED_GROUP)) { + continue; + } + + uint32_t subresource = 0; + do { + uint64_t subres_mask_piece = ((uint64_t)1 << (subresource % 64)); + uint8_t subres_qword = subresource / 64; + + if (likely(g.subres_mask[subres_qword] == 0)) { + subresource += 64; + continue; + } + + if (likely(!(g.subres_mask[subres_qword] & subres_mask_piece))) { + subresource++; + continue; + } + + D3D12_RESOURCE_STATES *curr_state = &res_states->subresource_states[subresource]; + + bool just_written = *curr_state == D3D12_RESOURCE_STATE_UNORDERED_ACCESS; + bool needs_uav_barrier = just_written && res_states->last_batch_with_uav_barrier != res_barriers_batch; + + uint32_t needed_barriers = (needs_uav_barrier ? 1 : 0) + br.planes; + if (res_barriers.size() < res_barriers_count + needed_barriers) { + res_barriers.resize(res_barriers_count + needed_barriers); + } + + if (needs_uav_barrier) { + res_barriers[res_barriers_count] = CD3DX12_RESOURCE_BARRIER::UAV(br.dx_resource); + res_barriers_count++; + res_states->last_batch_with_uav_barrier = res_barriers_batch; + } + + if (*curr_state != g.state.get_state_mask()) { + for (uint8_t k = 0; k < br.planes; k++) { + res_barriers[res_barriers_count] = CD3DX12_RESOURCE_BARRIER::Transition(br.dx_resource, *curr_state, g.state.get_state_mask(), subresource + k * num_subresources); + res_barriers_count++; + } + } + + *curr_state = g.state.get_state_mask(); + + subresource++; + } while (subresource < num_subresources); + } + } + } + + if (res_barriers_count) { + p_command_list->ResourceBarrier(res_barriers_count, res_barriers.ptr()); + res_barriers_requests.clear(); + } + +#ifdef DEBUG_COUNT_BARRIERS + frame_barriers_count += res_barriers_count; + frame_barriers_batches_count++; + frame_barriers_cpu_time += OS::get_singleton()->get_ticks_usec() - start; +#endif + + res_barriers_count = 0; + res_barriers_batch++; +} + +/***************************/ +/**** BUFFER MANAGEMENT ****/ +/***************************/ + +Error RenderingDeviceD3D12::_buffer_allocate(Buffer *p_buffer, uint32_t p_size, D3D12_RESOURCE_STATES p_usage, D3D12_HEAP_TYPE p_heap_type) { + ERR_FAIL_COND_V(p_heap_type != D3D12_HEAP_TYPE_DEFAULT && p_heap_type != D3D12_HEAP_TYPE_READBACK, ERR_INVALID_PARAMETER); + + // D3D12 debug layers complain at CBV creation time if the size is not multiple of the value per the spec + // but also if you give a rounded size at that point because it will extend beyond the + // memory of the resource. Therefore, it seems the only way is to create it with a + // rounded size. + CD3DX12_RESOURCE_DESC resource_desc = CD3DX12_RESOURCE_DESC::Buffer(ALIGN(p_size, D3D12_CONSTANT_BUFFER_DATA_PLACEMENT_ALIGNMENT)); + if ((p_usage & D3D12_RESOURCE_STATE_UNORDERED_ACCESS)) { + resource_desc.Flags |= D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS; + } + + D3D12MA::ALLOCATION_DESC allocation_desc = {}; + allocation_desc.HeapType = p_heap_type; +#ifdef USE_SMALL_ALLOCS_POOL + if (p_size <= SMALL_ALLOCATION_MAX_SIZE) { + allocation_desc.CustomPool = _find_or_create_small_allocs_pool(p_heap_type, D3D12_HEAP_FLAG_ALLOW_ONLY_BUFFERS); + } +#endif + + HRESULT res = context->get_allocator()->CreateResource( + &allocation_desc, + &resource_desc, + D3D12_RESOURCE_STATE_COPY_DEST, + nullptr, + &p_buffer->allocation, + IID_PPV_ARGS(&p_buffer->resource)); + ERR_FAIL_COND_V_MSG(res, ERR_CANT_CREATE, "Can't create buffer of size: " + itos(p_size) + ", error " + vformat("0x%08ux", res) + "."); + + p_buffer->size = p_size; + p_buffer->usage = p_usage; + p_buffer->own_states.subresource_states.push_back(D3D12_RESOURCE_STATE_COPY_DEST); + + buffer_memory += p_size; + + return OK; +} + +Error RenderingDeviceD3D12::_buffer_free(Buffer *p_buffer) { + ERR_FAIL_COND_V(p_buffer->size == 0, ERR_INVALID_PARAMETER); + + buffer_memory -= p_buffer->size; + + p_buffer->resource->Release(); + p_buffer->resource = nullptr; + p_buffer->allocation->Release(); + p_buffer->allocation = nullptr; + p_buffer->size = 0; + + return OK; +} + +Error RenderingDeviceD3D12::_insert_staging_block() { + StagingBufferBlock block; + + D3D12_RESOURCE_DESC resource_desc = {}; + resource_desc.Dimension = D3D12_RESOURCE_DIMENSION_BUFFER; + resource_desc.Alignment = 0; + resource_desc.Width = staging_buffer_block_size; + resource_desc.Height = 1; + resource_desc.DepthOrArraySize = 1; + resource_desc.MipLevels = 1; + resource_desc.Format = DXGI_FORMAT_UNKNOWN; + resource_desc.SampleDesc.Count = 1; + resource_desc.SampleDesc.Quality = 0; + resource_desc.Layout = D3D12_TEXTURE_LAYOUT_ROW_MAJOR; + resource_desc.Flags = D3D12_RESOURCE_FLAG_NONE; + + D3D12MA::ALLOCATION_DESC allocation_desc = {}; + allocation_desc.HeapType = D3D12_HEAP_TYPE_UPLOAD; + + HRESULT res = context->get_allocator()->CreateResource( + &allocation_desc, + &resource_desc, + D3D12_RESOURCE_STATE_GENERIC_READ, + NULL, + &block.allocation, + IID_PPV_ARGS(&block.resource)); + ERR_FAIL_COND_V_MSG(res, ERR_CANT_CREATE, "CreateResource failed with error " + vformat("0x%08ux", res) + "."); + + staging_buffer_blocks.insert(staging_buffer_current, block); + return OK; +} + +Error RenderingDeviceD3D12::_staging_buffer_allocate(uint32_t p_amount, uint32_t p_required_align, uint32_t &r_alloc_offset, uint32_t &r_alloc_size, bool p_can_segment) { + // Determine a block to use. + + r_alloc_size = p_amount; + + while (true) { + r_alloc_offset = 0; + + // See if we can use current block. + if (staging_buffer_blocks[staging_buffer_current].frame_used == frames_drawn) { + // We used this block this frame, let's see if there is still room. + + uint32_t write_from = staging_buffer_blocks[staging_buffer_current].fill_amount; + + { + uint32_t align_remainder = write_from % p_required_align; + if (align_remainder != 0) { + write_from += p_required_align - align_remainder; + } + } + + int32_t available_bytes = int32_t(staging_buffer_block_size) - int32_t(write_from); + + if ((int32_t)p_amount < available_bytes) { + // All is good, we should be ok, all will fit. + r_alloc_offset = write_from; + } else if (p_can_segment && available_bytes >= (int32_t)p_required_align) { + // Ok all won't fit but at least we can fit a chunkie. + // All is good, update what needs to be written to. + r_alloc_offset = write_from; + r_alloc_size = available_bytes - (available_bytes % p_required_align); + + } else { + // Can't fit it into this buffer. + // Will need to try next buffer. + + staging_buffer_current = (staging_buffer_current + 1) % staging_buffer_blocks.size(); + + // Before doing anything, though, let's check that we didn't manage to fill all functions. + // Possible in a single frame. + if (staging_buffer_blocks[staging_buffer_current].frame_used == frames_drawn) { + // Guess we did.. ok, let's see if we can insert a new block. + if ((uint64_t)staging_buffer_blocks.size() * staging_buffer_block_size < staging_buffer_max_size) { + // We can, so we are safe. + Error err = _insert_staging_block(); + if (err) { + return err; + } + // Claim for this frame. + staging_buffer_blocks.write[staging_buffer_current].frame_used = frames_drawn; + } else { + // Ok, worst case scenario, all the staging buffers belong to this frame + // and this frame is not even done + // If this is the main thread, it means the user is likely loading a lot of resources at once,. + // Otherwise, the thread should just be blocked until the next frame (currently unimplemented). + + if (false) { // Separate thread from render. + + //block_until_next_frame() + continue; + } else { + // Flush EVERYTHING including setup commands. IF not immediate, also need to flush the draw commands. + _flush(true); + + // Clear the whole staging buffer. + for (int i = 0; i < staging_buffer_blocks.size(); i++) { + staging_buffer_blocks.write[i].frame_used = 0; + staging_buffer_blocks.write[i].fill_amount = 0; + } + // Claim current. + staging_buffer_blocks.write[staging_buffer_current].frame_used = frames_drawn; + } + } + + } else { + // Not from current frame, so continue and try again. + continue; + } + } + + } else if (staging_buffer_blocks[staging_buffer_current].frame_used <= frames_drawn - frame_count) { + // This is an old block, which was already processed, let's reuse. + staging_buffer_blocks.write[staging_buffer_current].frame_used = frames_drawn; + staging_buffer_blocks.write[staging_buffer_current].fill_amount = 0; + } else { + // This block may still be in use, let's not touch it unless we have to, so.. can we create a new one? + if ((uint64_t)staging_buffer_blocks.size() * staging_buffer_block_size < staging_buffer_max_size) { + // We are still allowed to create a new block, so let's do that and insert it for current pos. + Error err = _insert_staging_block(); + if (err) { + return err; + } + // Claim for this frame. + staging_buffer_blocks.write[staging_buffer_current].frame_used = frames_drawn; + } else { + // Oops, we are out of room and we can't create more. + // Let's flush older frames. + // The logic here is that if a game is loading a lot of data from the main thread, it will need to be stalled anyway. + // If loading from a separate thread, we can block that thread until next frame when more room is made (not currently implemented, though). + + if (false) { + // Separate thread from render. + //block_until_next_frame() + continue; // And try again. + } else { + _flush(false); + + for (int i = 0; i < staging_buffer_blocks.size(); i++) { + // Clear all functions but the ones from this frame. + int block_idx = (i + staging_buffer_current) % staging_buffer_blocks.size(); + if (staging_buffer_blocks[block_idx].frame_used == frames_drawn) { + break; // Ok, we reached something from this frame, abort. + } + + staging_buffer_blocks.write[block_idx].frame_used = 0; + staging_buffer_blocks.write[block_idx].fill_amount = 0; + } + + // Claim for current frame. + staging_buffer_blocks.write[staging_buffer_current].frame_used = frames_drawn; + } + } + } + + // All was good, break. + break; + } + + staging_buffer_used = true; + + return OK; +} + +Error RenderingDeviceD3D12::_buffer_update(Buffer *p_buffer, size_t p_offset, const uint8_t *p_data, size_t p_data_size, bool p_use_draw_command_list, uint32_t p_required_align) { + // Submitting may get chunked for various reasons, so convert this to a task. + size_t to_submit = p_data_size; + size_t submit_from = 0; + + while (to_submit > 0) { + uint32_t block_write_offset; + uint32_t block_write_amount; + + Error err = _staging_buffer_allocate(MIN(to_submit, staging_buffer_block_size), p_required_align, block_write_offset, block_write_amount); + if (err) { + return err; + } + + // Map staging buffer. + + void *data_ptr = nullptr; + { + HRESULT res = staging_buffer_blocks[staging_buffer_current].resource->Map(0, &VOID_RANGE, &data_ptr); + ERR_FAIL_COND_V_MSG(res, ERR_CANT_CREATE, "Map failed with error " + vformat("0x%08ux", res) + "."); + } + + // Copy to staging buffer. + memcpy(((uint8_t *)data_ptr) + block_write_offset, p_data + submit_from, block_write_amount); + + // Unmap. + staging_buffer_blocks[staging_buffer_current].resource->Unmap(0, &VOID_RANGE); + + // Insert a command to copy this. + ID3D12GraphicsCommandList *command_list = (p_use_draw_command_list ? frames[frame].draw_command_list : frames[frame].setup_command_list).Get(); + command_list->CopyBufferRegion(p_buffer->resource, submit_from + p_offset, staging_buffer_blocks[staging_buffer_current].resource, block_write_offset, block_write_amount); + + staging_buffer_blocks.write[staging_buffer_current].fill_amount = block_write_offset + block_write_amount; + + to_submit -= block_write_amount; + submit_from += block_write_amount; + } + + return OK; +} + +/*****************/ +/**** TEXTURE ****/ +/*****************/ + +RID RenderingDeviceD3D12::texture_create(const TextureFormat &p_format, const TextureView &p_view, const Vector<Vector<uint8_t>> &p_data) { + _THREAD_SAFE_METHOD_ + + D3D12_RESOURCE_DESC1 resource_desc = {}; // Using D3D12_RESOURCE_DESC1. Thanks to the layout, it's sliceable down to D3D12_RESOURCE_DESC if needed. + resource_desc.Alignment = 0; // D3D12MA will override this to use a smaller alignment than the default if possible. + + Vector<DataFormat> allowed_formats; + if (p_format.shareable_formats.size()) { + ERR_FAIL_COND_V_MSG(p_format.shareable_formats.find(p_format.format) == -1, RID(), + "If supplied a list of shareable formats, the current format must be present in the list"); + ERR_FAIL_COND_V_MSG(p_view.format_override != DATA_FORMAT_MAX && p_format.shareable_formats.find(p_view.format_override) == -1, RID(), + "If supplied a list of shareable formats, the current view format override must be present in the list"); + allowed_formats = p_format.shareable_formats; + } else { + allowed_formats.push_back(p_format.format); + if (p_view.format_override != DATA_FORMAT_MAX) { + allowed_formats.push_back(p_view.format_override); + } + } + + ERR_FAIL_INDEX_V(p_format.texture_type, TEXTURE_TYPE_MAX, RID()); + + resource_desc.Dimension = d3d12_texture_dimension[p_format.texture_type]; + + ERR_FAIL_COND_V_MSG(p_format.width < 1, RID(), "Width must be equal or greater than 1 for all textures"); + + resource_desc.Format = d3d12_formats[p_format.format].family; + + resource_desc.Width = p_format.width; + if (resource_desc.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D || resource_desc.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE2D) { + ERR_FAIL_COND_V_MSG(p_format.height < 1, RID(), "Height must be equal or greater than 1 for 2D and 3D textures"); + resource_desc.Height = p_format.height; + } else { + resource_desc.Height = 1; + } + + if (resource_desc.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D) { + ERR_FAIL_COND_V_MSG(p_format.depth < 1, RID(), "Depth must be equal or greater than 1 for 3D textures"); + resource_desc.DepthOrArraySize = p_format.depth; + } else { + resource_desc.DepthOrArraySize = 1; + } + + ERR_FAIL_COND_V(p_format.mipmaps < 1, RID()); + + resource_desc.MipLevels = p_format.mipmaps; + + if (p_format.texture_type == TEXTURE_TYPE_1D_ARRAY || p_format.texture_type == TEXTURE_TYPE_2D_ARRAY || p_format.texture_type == TEXTURE_TYPE_CUBE_ARRAY || p_format.texture_type == TEXTURE_TYPE_CUBE) { + ERR_FAIL_COND_V_MSG(p_format.array_layers < 1, RID(), + "Amount of layers must be equal or greater than 1 for arrays and cubemaps."); + ERR_FAIL_COND_V_MSG((p_format.texture_type == TEXTURE_TYPE_CUBE_ARRAY || p_format.texture_type == TEXTURE_TYPE_CUBE) && (p_format.array_layers % 6) != 0, RID(), + "Cubemap and cubemap array textures must provide a layer number that is multiple of 6"); + resource_desc.DepthOrArraySize *= p_format.array_layers; + } + + ERR_FAIL_INDEX_V(p_format.samples, TEXTURE_SAMPLES_MAX, RID()); + + // Usage. + + if ((p_format.usage_bits & TEXTURE_USAGE_COLOR_ATTACHMENT_BIT)) { + resource_desc.Flags |= D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET; + } else { + if ((p_format.usage_bits & TEXTURE_USAGE_CAN_COPY_TO_BIT)) { + resource_desc.Flags |= D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS; // For clearing via UAV. + } + } + + if (p_format.usage_bits & TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) { + resource_desc.Flags |= D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL; + } + + if (p_format.usage_bits & TEXTURE_USAGE_STORAGE_BIT) { + resource_desc.Flags |= D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS; + } + + resource_desc.SampleDesc = {}; + DXGI_FORMAT format_to_test = (resource_desc.Flags & D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL) ? d3d12_formats[p_format.format].dsv_format : d3d12_formats[p_format.format].general_format; + if (!(resource_desc.Flags & D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS)) { + resource_desc.SampleDesc.Count = MIN( + _find_max_common_supported_sample_count(&format_to_test, 1), + rasterization_sample_count[p_format.samples]); + } else { + // No MSAA in D3D12 if storage. May have become possible recently where supported, though. + resource_desc.SampleDesc.Count = 1; + } + resource_desc.SampleDesc.Quality = resource_desc.SampleDesc.Count == 1 ? 0 : DXGI_STANDARD_MULTISAMPLE_QUALITY_PATTERN; + + uint32_t required_mipmaps = get_image_required_mipmaps(p_format.width, p_format.height, p_format.depth); + + ERR_FAIL_COND_V_MSG(required_mipmaps < p_format.mipmaps, RID(), + "Too many mipmaps requested for texture format and dimensions (" + itos(p_format.mipmaps) + "), maximum allowed: (" + itos(required_mipmaps) + ")."); + + if (p_data.size()) { + ERR_FAIL_COND_V_MSG(!(p_format.usage_bits & TEXTURE_USAGE_CAN_UPDATE_BIT), RID(), + "Texture needs the TEXTURE_USAGE_CAN_UPDATE_BIT usage flag in order to be updated at initialization or later"); + + int expected_images = p_format.array_layers; + ERR_FAIL_COND_V_MSG(p_data.size() != expected_images, RID(), + "Default supplied data for image format is of invalid length (" + itos(p_data.size()) + "), should be (" + itos(expected_images) + ")."); + + for (uint32_t i = 0; i < p_format.array_layers; i++) { + uint32_t required_size = get_image_format_required_size(p_format.format, p_format.width, p_format.height, p_format.depth, p_format.mipmaps); + ERR_FAIL_COND_V_MSG((uint32_t)p_data[i].size() != required_size, RID(), + "Data for slice index " + itos(i) + " (mapped to layer " + itos(i) + ") differs in size (supplied: " + itos(p_data[i].size()) + ") than what is required by the format (" + itos(required_size) + ")."); + } + } + + // Validate that this image is supported for the intended use. + + // If views of different families are wanted, special setup is needed for proper sharing among them. + // Two options here: + // 1. If ID3DDevice10 is present and driver reports relaxed casting is, leverage its new extended resource creation API (via D3D12MA). + // 2. Otherwise, fall back to an approach based on abusing aliasing, hoping for the best. + bool cross_family_sharing = false; + ComPtr<ID3D12Device10> device10; + device.As(&device10); + bool relaxed_casting_available = device10.Get() && context->get_format_capabilities().relaxed_casting_supported; + LocalVector<DXGI_FORMAT> castable_formats; + + HashMap<DataFormat, D3D12_RESOURCE_FLAGS> aliases_forbidden_flags; + D3D12_RESOURCE_FLAGS accum_forbidden_flags = {}; + for (DataFormat curr_format : allowed_formats) { + // For now, we'll validate usages only the main format, to match what Vulkan RD does. + // TODO: The aliasing trick assumes the main format is the only writable one. We should either validate for that or handle a different order gracefully. + bool checking_main_format = curr_format == p_format.format; + + String format_text = "'" + String(named_formats[p_format.format]) + "'"; + + ERR_FAIL_COND_V_MSG(d3d12_formats[curr_format].family == DXGI_FORMAT_UNKNOWN, RID(), "Format " + format_text + " is not supported."); + + if (d3d12_formats[curr_format].family != d3d12_formats[allowed_formats[0]].family) { + cross_family_sharing = true; + } + if (relaxed_casting_available) { + castable_formats.push_back(d3d12_formats[curr_format].general_format); + } + + D3D12_FEATURE_DATA_FORMAT_SUPPORT srv_rtv_support = {}; + srv_rtv_support.Format = d3d12_formats[curr_format].general_format; + HRESULT res = device->CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT, &srv_rtv_support, sizeof(srv_rtv_support)); + ERR_FAIL_COND_V_MSG(res, RID(), "CheckFeatureSupport failed with error " + vformat("0x%08ux", res) + "."); + + D3D12_FEATURE_DATA_FORMAT_SUPPORT uav_support = srv_rtv_support; // Fine for now. + + D3D12_FEATURE_DATA_FORMAT_SUPPORT dsv_support = {}; + dsv_support.Format = d3d12_formats[curr_format].dsv_format; + res = device->CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT, &dsv_support, sizeof(dsv_support)); + ERR_FAIL_COND_V_MSG(res, RID(), "CheckFeatureSupport failed with error " + vformat("0x%08ux", res) + "."); + + if (checking_main_format) { + if ((p_format.usage_bits & (TEXTURE_USAGE_SAMPLING_BIT | TEXTURE_USAGE_COLOR_ATTACHMENT_BIT))) { + if (p_format.mipmaps && !(srv_rtv_support.Support1 & D3D12_FORMAT_SUPPORT1_MIP)) { + ERR_FAIL_V_MSG(RID(), "Format " + format_text + " does not support mip.maps."); + } + } + + // Per https://docs.microsoft.com/en-us/windows/win32/api/d3d12/ne-d3d12-d3d12_format_support1, + // as long as the resource can be used as a texture, Sample() will work with point filter at least. + // However, we've empirically found that checking for at least D3D12_FORMAT_SUPPORT1_SHADER_LOAD is needed. + // That's almost good for integer formats. The problem is that theoretically there may be + // float formats that support LOAD but not SAMPLE fully, so this check will not detect + // such a flaw in the format. Linearly interpolated sampling would just not work on them. + // [[IMPLICIT_SAMPLE]] + if ((p_format.usage_bits & TEXTURE_USAGE_SAMPLING_BIT) && !(srv_rtv_support.Support1 & (D3D12_FORMAT_SUPPORT1_SHADER_LOAD | D3D12_FORMAT_SUPPORT1_SHADER_SAMPLE))) { + ERR_FAIL_V_MSG(RID(), "Format " + format_text + " does not support usage as a sampled texture."); + } + + if ((p_format.usage_bits & TEXTURE_USAGE_SAMPLING_BIT) && d3d12_formats[curr_format].general_format == DXGI_FORMAT_UNKNOWN) { + ERR_FAIL_V_MSG(RID(), "Format " + format_text + " does not support usage as a sampled texture."); + } + + if ((p_format.usage_bits & TEXTURE_USAGE_COLOR_ATTACHMENT_BIT) && !(srv_rtv_support.Support1 & D3D12_FORMAT_SUPPORT1_RENDER_TARGET)) { + ERR_FAIL_V_MSG(RID(), "Format " + format_text + " does not support usage as color attachment."); + } + } + + if ((p_format.usage_bits & TEXTURE_USAGE_CAN_COPY_TO_BIT)) { + // We need to check if the texture can be cleared; if it's not flagged for color attachment , we have to see if it's possible via a UAV. + if (!(p_format.usage_bits & TEXTURE_USAGE_COLOR_ATTACHMENT_BIT)) { + if (!(uav_support.Support1 & D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW)) { + if (checking_main_format) { + ERR_FAIL_V_MSG(RID(), "Format " + format_text + " does not support usage as a copy-to texture, because clearing it is not supported."); + } else { + aliases_forbidden_flags[curr_format] |= D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS; + accum_forbidden_flags |= D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS; + } + } + } + } + + if ((p_format.usage_bits & TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) && !(dsv_support.Support1 & D3D12_FORMAT_SUPPORT1_DEPTH_STENCIL)) { + if (checking_main_format) { + printf("dxgiformat: %x\n", resource_desc.Format); + ERR_FAIL_V_MSG(RID(), "Format " + format_text + " does not support usage as depth-stencil attachment."); + } else { + aliases_forbidden_flags[curr_format] |= D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL; + accum_forbidden_flags |= D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL; + } + } + + if ((p_format.usage_bits & TEXTURE_USAGE_STORAGE_BIT)) { + if (!(uav_support.Support1 & D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW)) { // Maybe check LOAD/STORE, too? + if (checking_main_format) { + ERR_FAIL_V_MSG(RID(), "Format " + format_text + " does not support usage as storage image."); + } else { + aliases_forbidden_flags[curr_format] |= D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS; + accum_forbidden_flags |= D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS; + } + } + } + + if (checking_main_format) { + if ((p_format.usage_bits & TEXTURE_USAGE_STORAGE_ATOMIC_BIT) && !(uav_support.Support2 & D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_ADD)) { // Check a basic atomic at least. + ERR_FAIL_V_MSG(RID(), "Format " + format_text + " does not support usage as atomic storage image."); + } + + if ((p_format.usage_bits & TEXTURE_USAGE_VRS_ATTACHMENT_BIT) && d3d12_formats[curr_format].general_format != DXGI_FORMAT_R8_UINT) { + ERR_FAIL_V_MSG(RID(), "Format " + format_text + " does not support usage as VRS attachment."); + } + } + } + + if (cross_family_sharing && !relaxed_casting_available) { + // At least guarantee the same layout among aliases. + resource_desc.Layout = D3D12_TEXTURE_LAYOUT_64KB_UNDEFINED_SWIZZLE; + + // Per https://docs.microsoft.com/en-us/windows/win32/api/d3d12/ne-d3d12-d3d12_texture_layout. + if (p_format.texture_type == TEXTURE_TYPE_1D) { + ERR_FAIL_V_MSG(RID(), "This texture's views require aliasing, but that's not supported for a 1D texture."); + } + if (p_format.samples != TEXTURE_SAMPLES_1) { + ERR_FAIL_V_MSG(RID(), "This texture's views require aliasing, but that's not supported for a multi-sample texture."); + } + if ((p_format.usage_bits & TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT)) { + ERR_FAIL_V_MSG(RID(), "This texture's views require aliasing, but that's not supported for a depth-stencil texture."); + } + if (d3d12_formats[p_format.format].family == DXGI_FORMAT_R32G32B32_TYPELESS) { + ERR_FAIL_V_MSG(RID(), "This texture's views require aliasing, but that's not supported for an R32G32B32 texture."); + } + } else { + resource_desc.Layout = D3D12_TEXTURE_LAYOUT_UNKNOWN; + } + + if ((p_format.usage_bits & TEXTURE_USAGE_VRS_ATTACHMENT_BIT)) { + // For VRS images we can't use the typeless format. + resource_desc.Format = DXGI_FORMAT_R8_UINT; + } + + // Some view validation. + + if (p_view.format_override != DATA_FORMAT_MAX) { + ERR_FAIL_INDEX_V(p_view.format_override, DATA_FORMAT_MAX, RID()); + } + ERR_FAIL_INDEX_V(p_view.swizzle_r, TEXTURE_SWIZZLE_MAX, RID()); + ERR_FAIL_INDEX_V(p_view.swizzle_g, TEXTURE_SWIZZLE_MAX, RID()); + ERR_FAIL_INDEX_V(p_view.swizzle_b, TEXTURE_SWIZZLE_MAX, RID()); + ERR_FAIL_INDEX_V(p_view.swizzle_a, TEXTURE_SWIZZLE_MAX, RID()); + + // Allocate memory. + + D3D12MA::ALLOCATION_DESC allocation_desc = {}; + if (cross_family_sharing && !relaxed_casting_available) { + allocation_desc.Flags = D3D12MA::ALLOCATION_FLAG_CAN_ALIAS; + } + allocation_desc.HeapType = (p_format.usage_bits & TEXTURE_USAGE_CPU_READ_BIT) ? D3D12_HEAP_TYPE_READBACK : D3D12_HEAP_TYPE_DEFAULT; + if ((resource_desc.Flags & (D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET | D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL))) { + if (!(accum_forbidden_flags & (D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET | D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL))) { + allocation_desc.ExtraHeapFlags = D3D12_HEAP_FLAG_ALLOW_ONLY_RT_DS_TEXTURES; + } + } else { + allocation_desc.ExtraHeapFlags = D3D12_HEAP_FLAG_ALLOW_ONLY_NON_RT_DS_TEXTURES; + } + if ((resource_desc.Flags & D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS)) { + if (!(accum_forbidden_flags & D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS)) { + allocation_desc.ExtraHeapFlags |= D3D12_HEAP_FLAG_ALLOW_SHADER_ATOMICS; + } + } + +#ifdef USE_SMALL_ALLOCS_POOL + uint32_t width, height; + uint32_t image_size = get_image_format_required_size(p_format.format, p_format.width, p_format.height, p_format.depth, p_format.mipmaps, &width, &height); + if (image_size <= SMALL_ALLOCATION_MAX_SIZE) { + allocation_desc.CustomPool = _find_or_create_small_allocs_pool(allocation_desc.HeapType, allocation_desc.ExtraHeapFlags); + } +#endif + + Texture texture; + + D3D12_RESOURCE_STATES initial_state = p_data.size() || (p_format.usage_bits & TEXTURE_USAGE_CPU_READ_BIT) ? D3D12_RESOURCE_STATE_COPY_DEST : D3D12_RESOURCE_STATE_ALL_SHADER_RESOURCE; + FLOAT black[4] = {}; + D3D12_CLEAR_VALUE clear_value = CD3DX12_CLEAR_VALUE(d3d12_formats[p_format.format].general_format, black); + D3D12_CLEAR_VALUE *clear_value_ptr = (resource_desc.Flags & D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET) ? &clear_value : nullptr; + HRESULT res = {}; + if (cross_family_sharing && relaxed_casting_available) { + res = context->get_allocator()->CreateResource3( + &allocation_desc, + &resource_desc, + D3D12_BARRIER_LAYOUT_COMMON, // Needed for barrier interop. + clear_value_ptr, + castable_formats.size(), + castable_formats.ptr(), + &texture.allocation, + IID_PPV_ARGS(&texture.owner_resource)); + initial_state = D3D12_RESOURCE_STATE_COMMON; // Needed for barrier interop. + } else { + res = context->get_allocator()->CreateResource( + &allocation_desc, + (D3D12_RESOURCE_DESC *)&resource_desc, + initial_state, + clear_value_ptr, + &texture.allocation, + IID_PPV_ARGS(&texture.owner_resource)); + } + ERR_FAIL_COND_V_MSG(res, RID(), "CreateResource failed with error " + vformat("0x%08ux", res) + "."); + texture.resource = texture.owner_resource; + image_memory += texture.allocation->GetSize(); + texture.type = p_format.texture_type; + texture.format = p_format.format; + texture.planes = get_image_format_plane_count(p_format.format); + texture.width = p_format.width; + texture.height = p_format.height; + texture.depth = p_format.depth; + texture.layers = p_format.array_layers; + texture.mipmaps = p_format.mipmaps; + texture.owner_layers = texture.layers; + texture.owner_mipmaps = texture.mipmaps; + texture.base_mipmap = 0; + texture.base_layer = 0; + texture.is_resolve_buffer = p_format.is_resolve_buffer; + texture.usage_flags = p_format.usage_bits; + texture.samples = p_format.samples; + texture.allowed_shared_formats = p_format.shareable_formats; + texture.own_states.subresource_states.resize(texture.mipmaps * texture.layers); + for (uint32_t i = 0; i < texture.own_states.subresource_states.size(); i++) { + texture.own_states.subresource_states[i] = initial_state; + } + texture.bound = false; + + // Describe view. + + static const D3D12_SRV_DIMENSION view_dimensions[TEXTURE_TYPE_MAX] = { + D3D12_SRV_DIMENSION_TEXTURE1D, + D3D12_SRV_DIMENSION_TEXTURE2D, + D3D12_SRV_DIMENSION_TEXTURE3D, + D3D12_SRV_DIMENSION_TEXTURECUBE, + D3D12_SRV_DIMENSION_TEXTURE1DARRAY, + D3D12_SRV_DIMENSION_TEXTURE2DARRAY, + D3D12_SRV_DIMENSION_TEXTURECUBEARRAY, + }; + static const D3D12_SRV_DIMENSION view_dimensions_ms[TEXTURE_TYPE_MAX] = { + D3D12_SRV_DIMENSION_UNKNOWN, + D3D12_SRV_DIMENSION_TEXTURE2DMS, + D3D12_SRV_DIMENSION_UNKNOWN, + D3D12_SRV_DIMENSION_UNKNOWN, + D3D12_SRV_DIMENSION_UNKNOWN, + D3D12_SRV_DIMENSION_TEXTURE2DMSARRAY, + D3D12_SRV_DIMENSION_UNKNOWN, + }; + static const D3D12_UAV_DIMENSION uav_dimensions[TEXTURE_TYPE_MAX] = { + D3D12_UAV_DIMENSION_TEXTURE1D, + D3D12_UAV_DIMENSION_TEXTURE2D, + D3D12_UAV_DIMENSION_TEXTURE3D, + D3D12_UAV_DIMENSION_TEXTURE2DARRAY, + D3D12_UAV_DIMENSION_TEXTURE1DARRAY, + D3D12_UAV_DIMENSION_TEXTURE2DARRAY, + D3D12_UAV_DIMENSION_TEXTURE2DARRAY, + }; + + texture.srv_desc.ViewDimension = p_format.samples == TEXTURE_SAMPLES_1 ? view_dimensions[p_format.texture_type] : view_dimensions_ms[p_format.texture_type]; + + texture.owner_uav_desc.Format = d3d12_formats[p_format.format].general_format; + texture.owner_uav_desc.ViewDimension = p_format.samples == TEXTURE_SAMPLES_1 ? uav_dimensions[p_format.texture_type] : D3D12_UAV_DIMENSION_UNKNOWN; + + UINT base_swizzle = D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING; + if (p_view.format_override == DATA_FORMAT_MAX) { + texture.srv_desc.Format = d3d12_formats[p_format.format].general_format; + base_swizzle = d3d12_formats[p_format.format].swizzle; + } else { + texture.srv_desc.Format = d3d12_formats[p_view.format_override].general_format; + base_swizzle = d3d12_formats[p_view.format_override].swizzle; + } + + // Apply requested swizzle (component mapping) on top of the one from the format database. + + D3D12_SHADER_COMPONENT_MAPPING component_swizzles[TEXTURE_SWIZZLE_MAX] = { + D3D12_SHADER_COMPONENT_MAPPING_FORCE_VALUE_0, // Unused. + D3D12_SHADER_COMPONENT_MAPPING_FORCE_VALUE_0, + D3D12_SHADER_COMPONENT_MAPPING_FORCE_VALUE_1, + // These will be D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_*. + D3D12_DECODE_SHADER_4_COMPONENT_MAPPING(0, base_swizzle), + D3D12_DECODE_SHADER_4_COMPONENT_MAPPING(1, base_swizzle), + D3D12_DECODE_SHADER_4_COMPONENT_MAPPING(2, base_swizzle), + D3D12_DECODE_SHADER_4_COMPONENT_MAPPING(3, base_swizzle), + }; + + texture.srv_desc.Shader4ComponentMapping = D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING( + p_view.swizzle_r == TEXTURE_SWIZZLE_IDENTITY ? component_swizzles[TEXTURE_SWIZZLE_R] : component_swizzles[p_view.swizzle_r], + p_view.swizzle_g == TEXTURE_SWIZZLE_IDENTITY ? component_swizzles[TEXTURE_SWIZZLE_G] : component_swizzles[p_view.swizzle_g], + p_view.swizzle_b == TEXTURE_SWIZZLE_IDENTITY ? component_swizzles[TEXTURE_SWIZZLE_B] : component_swizzles[p_view.swizzle_b], + p_view.swizzle_a == TEXTURE_SWIZZLE_IDENTITY ? component_swizzles[TEXTURE_SWIZZLE_A] : component_swizzles[p_view.swizzle_a]); + + switch (texture.srv_desc.ViewDimension) { + case D3D12_SRV_DIMENSION_TEXTURE1D: { + texture.srv_desc.Texture1D.MipLevels = p_format.mipmaps; + } break; + case D3D12_SRV_DIMENSION_TEXTURE1DARRAY: { + texture.srv_desc.Texture1DArray.MipLevels = p_format.mipmaps; + texture.srv_desc.Texture1DArray.ArraySize = p_format.array_layers; + } break; + case D3D12_SRV_DIMENSION_TEXTURE2D: { + texture.srv_desc.Texture2D.MipLevels = p_format.mipmaps; + } break; + case D3D12_SRV_DIMENSION_TEXTURE2DMS: { + } break; + case D3D12_SRV_DIMENSION_TEXTURE2DARRAY: { + texture.srv_desc.Texture2DArray.MipLevels = p_format.mipmaps; + texture.srv_desc.Texture2DArray.ArraySize = p_format.array_layers; + } break; + case D3D12_SRV_DIMENSION_TEXTURE2DMSARRAY: { + texture.srv_desc.Texture2DMSArray.ArraySize = p_format.array_layers; + } break; + case D3D12_SRV_DIMENSION_TEXTURECUBEARRAY: { + texture.srv_desc.TextureCubeArray.MipLevels = p_format.mipmaps; + texture.srv_desc.TextureCubeArray.NumCubes = p_format.array_layers / 6; + } break; + case D3D12_SRV_DIMENSION_TEXTURE3D: { + texture.srv_desc.Texture3D.MipLevels = p_format.mipmaps; + } break; + case D3D12_SRV_DIMENSION_TEXTURECUBE: { + texture.srv_desc.TextureCube.MipLevels = p_format.mipmaps; + } break; + } + + switch (texture.owner_uav_desc.ViewDimension) { + case D3D12_UAV_DIMENSION_TEXTURE1DARRAY: { + texture.owner_uav_desc.Texture1DArray.ArraySize = p_format.array_layers; + } break; + case D3D12_UAV_DIMENSION_TEXTURE2DARRAY: { + // Either for an actual 2D texture array, cubemap or cubemap array. + texture.owner_uav_desc.Texture2DArray.ArraySize = p_format.array_layers; + } break; + case D3D12_UAV_DIMENSION_TEXTURE3D: { + texture.owner_uav_desc.Texture3D.WSize = p_format.depth; + } break; + default: { + } + } + + texture.uav_desc = texture.owner_uav_desc; + if (p_view.format_override != DATA_FORMAT_MAX) { + texture.uav_desc.Format = d3d12_formats[p_view.format_override].general_format; + } + + if (cross_family_sharing && !relaxed_casting_available) { + D3D12_RESOURCE_DESC resource_desc_backup = *(D3D12_RESOURCE_DESC *)&resource_desc; + D3D12MA::ALLOCATION_DESC allocation_desc_backup = allocation_desc; + + texture.aliases.resize(texture.allowed_shared_formats.size()); + for (int i = 0; i < texture.allowed_shared_formats.size(); i++) { + DataFormat curr_format = texture.allowed_shared_formats[i]; + + DXGI_FORMAT format_family = d3d12_formats[curr_format].family; + if (format_family == d3d12_formats[p_format.format].family) { + texture.aliases[i] = nullptr; + continue; + } + + D3D12_RESOURCE_DESC alias_resource_desc = *(D3D12_RESOURCE_DESC *)&resource_desc; + alias_resource_desc.Format = format_family; + if (aliases_forbidden_flags.has(curr_format)) { + alias_resource_desc.Flags &= ~aliases_forbidden_flags[curr_format]; + } + clear_value.Format = format_family; + res = context->get_allocator()->CreateAliasingResource( + texture.allocation, + 0, + &alias_resource_desc, + initial_state, + (alias_resource_desc.Flags & D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET) ? clear_value_ptr : nullptr, + IID_PPV_ARGS(&texture.aliases[i])); + ERR_FAIL_COND_V_MSG(res, RID(), "CreateAliasingResource failed with error " + vformat("0x%08ux", res) + "."); + + if (curr_format == p_view.format_override) { + texture.resource = texture.aliases[i]; + } + } + } + + RID id = texture_owner.make_rid(texture); +#ifdef DEV_ENABLED + set_resource_name(id, "RID:" + itos(id.get_id())); +#endif + + if (p_data.size()) { + Texture *texture_ptr = texture_owner.get_or_null(id); + ERR_FAIL_NULL_V(texture_ptr, RID()); + + ID3D12GraphicsCommandList *command_list = frames[frame].setup_command_list.Get(); + + for (uint32_t i = 0; i < p_format.array_layers; i++) { + _texture_update(texture_ptr, i, p_data[i], RD::BARRIER_MASK_ALL_BARRIERS, command_list); + } + } + return id; +} + +RID RenderingDeviceD3D12::texture_create_shared(const TextureView &p_view, RID p_with_texture) { + _THREAD_SAFE_METHOD_ + + Texture *src_texture = texture_owner.get_or_null(p_with_texture); + ERR_FAIL_NULL_V(src_texture, RID()); + + if (src_texture->owner.is_valid()) { // Ahh this is a share. + p_with_texture = src_texture->owner; + src_texture = texture_owner.get_or_null(src_texture->owner); + ERR_FAIL_NULL_V(src_texture, RID()); // This is a bug. + } + + // Describe view. + + Texture texture = *src_texture; + texture.own_states.subresource_states.clear(); + texture.states = &src_texture->own_states; + + UINT base_swizzle = D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING; + if (p_view.format_override == DATA_FORMAT_MAX || p_view.format_override == texture.format) { + texture.srv_desc.Format = d3d12_formats[texture.format].general_format; + base_swizzle = d3d12_formats[texture.format].swizzle; + texture.uav_desc.Format = d3d12_formats[texture.format].general_format; + } else { + ERR_FAIL_INDEX_V(p_view.format_override, DATA_FORMAT_MAX, RID()); + + ERR_FAIL_COND_V_MSG(texture.allowed_shared_formats.find(p_view.format_override) == -1, RID(), + "Format override is not in the list of allowed shareable formats for original texture."); + texture.srv_desc.Format = d3d12_formats[p_view.format_override].general_format; + base_swizzle = d3d12_formats[p_view.format_override].swizzle; + texture.uav_desc.Format = d3d12_formats[p_view.format_override].general_format; + + if (texture.aliases.size()) { + for (int i = 0; i < texture.allowed_shared_formats.size(); i++) { + if (texture.allowed_shared_formats[i] == p_view.format_override) { + texture.resource = texture.aliases[i]; + break; + } + } + } + } + + // Apply requested swizzle (component mapping) on top of the one from the format database. + + D3D12_SHADER_COMPONENT_MAPPING component_swizzles[TEXTURE_SWIZZLE_MAX] = { + D3D12_SHADER_COMPONENT_MAPPING_FORCE_VALUE_0, // Unused. + D3D12_SHADER_COMPONENT_MAPPING_FORCE_VALUE_0, + D3D12_SHADER_COMPONENT_MAPPING_FORCE_VALUE_1, + // These will be D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_*. + D3D12_DECODE_SHADER_4_COMPONENT_MAPPING(0, base_swizzle), + D3D12_DECODE_SHADER_4_COMPONENT_MAPPING(1, base_swizzle), + D3D12_DECODE_SHADER_4_COMPONENT_MAPPING(2, base_swizzle), + D3D12_DECODE_SHADER_4_COMPONENT_MAPPING(3, base_swizzle), + }; + + texture.srv_desc.Shader4ComponentMapping = D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING( + p_view.swizzle_r == TEXTURE_SWIZZLE_IDENTITY ? component_swizzles[TEXTURE_SWIZZLE_R] : component_swizzles[p_view.swizzle_r], + p_view.swizzle_g == TEXTURE_SWIZZLE_IDENTITY ? component_swizzles[TEXTURE_SWIZZLE_G] : component_swizzles[p_view.swizzle_g], + p_view.swizzle_b == TEXTURE_SWIZZLE_IDENTITY ? component_swizzles[TEXTURE_SWIZZLE_B] : component_swizzles[p_view.swizzle_b], + p_view.swizzle_a == TEXTURE_SWIZZLE_IDENTITY ? component_swizzles[TEXTURE_SWIZZLE_A] : component_swizzles[p_view.swizzle_a]); + + texture.owner = p_with_texture; + RID id = texture_owner.make_rid(texture); +#ifdef DEV_ENABLED + set_resource_name(id, "RID:" + itos(id.get_id())); +#endif + _add_dependency(id, p_with_texture); + + return id; +} + +RID RenderingDeviceD3D12::texture_create_from_extension(TextureType p_type, DataFormat p_format, TextureSamples p_samples, BitField<RenderingDevice::TextureUsageBits> p_flags, uint64_t p_image, uint64_t p_width, uint64_t p_height, uint64_t p_depth, uint64_t p_layers) { + ERR_FAIL_V_MSG(RID(), "Unimplemented!"); +} + +RID RenderingDeviceD3D12::texture_create_shared_from_slice(const TextureView &p_view, RID p_with_texture, uint32_t p_layer, uint32_t p_mipmap, uint32_t p_mipmaps, TextureSliceType p_slice_type, uint32_t p_layers) { + _THREAD_SAFE_METHOD_ + + Texture *src_texture = texture_owner.get_or_null(p_with_texture); + ERR_FAIL_NULL_V(src_texture, RID()); + + if (src_texture->owner.is_valid()) { // Ahh this is a share. + p_with_texture = src_texture->owner; + src_texture = texture_owner.get_or_null(src_texture->owner); + ERR_FAIL_NULL_V(src_texture, RID()); // This is a bug. + } + + ERR_FAIL_COND_V_MSG(p_slice_type == TEXTURE_SLICE_CUBEMAP && (src_texture->type != TEXTURE_TYPE_CUBE && src_texture->type != TEXTURE_TYPE_CUBE_ARRAY), RID(), + "Can only create a cubemap slice from a cubemap or cubemap array mipmap"); + + ERR_FAIL_COND_V_MSG(p_slice_type == TEXTURE_SLICE_3D && src_texture->type != TEXTURE_TYPE_3D, RID(), + "Can only create a 3D slice from a 3D texture"); + + ERR_FAIL_COND_V_MSG(p_slice_type == TEXTURE_SLICE_2D_ARRAY && (src_texture->type != TEXTURE_TYPE_2D_ARRAY), RID(), + "Can only create an array slice from a 2D array mipmap"); + + // Describe view. + + ERR_FAIL_UNSIGNED_INDEX_V(p_mipmap, src_texture->mipmaps, RID()); + ERR_FAIL_COND_V(p_mipmap + p_mipmaps > src_texture->mipmaps, RID()); + ERR_FAIL_UNSIGNED_INDEX_V(p_layer, src_texture->layers, RID()); + + int slice_layers = 1; + if (p_layers != 0) { + ERR_FAIL_COND_V_MSG(p_layers > 1 && p_slice_type != TEXTURE_SLICE_2D_ARRAY, RID(), "layer slicing only supported for 2D arrays"); + ERR_FAIL_COND_V_MSG(p_layer + p_layers > src_texture->layers, RID(), "layer slice is out of bounds"); + slice_layers = p_layers; + } else if (p_slice_type == TEXTURE_SLICE_2D_ARRAY) { + ERR_FAIL_COND_V_MSG(p_layer != 0, RID(), "layer must be 0 when obtaining a 2D array mipmap slice"); + slice_layers = src_texture->layers; + } else if (p_slice_type == TEXTURE_SLICE_CUBEMAP) { + slice_layers = 6; + } + + Texture texture = *src_texture; + get_image_format_required_size(texture.format, texture.width, texture.height, texture.depth, p_mipmap + 1, &texture.width, &texture.height); + texture.mipmaps = p_mipmaps; + texture.layers = slice_layers; + texture.base_mipmap = p_mipmap; + texture.base_layer = p_layer; + texture.own_states.subresource_states.clear(); + texture.states = &src_texture->own_states; + + UINT base_swizzle = D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING; + if (p_view.format_override == DATA_FORMAT_MAX || p_view.format_override == texture.format) { + texture.srv_desc.Format = d3d12_formats[texture.format].general_format; + base_swizzle = d3d12_formats[texture.format].swizzle; + texture.uav_desc.Format = d3d12_formats[texture.format].general_format; + } else { + ERR_FAIL_INDEX_V(p_view.format_override, DATA_FORMAT_MAX, RID()); + + ERR_FAIL_COND_V_MSG(texture.allowed_shared_formats.find(p_view.format_override) == -1, RID(), + "Format override is not in the list of allowed shareable formats for original texture."); + texture.srv_desc.Format = d3d12_formats[p_view.format_override].general_format; + base_swizzle = d3d12_formats[p_view.format_override].swizzle; + texture.uav_desc.Format = d3d12_formats[p_view.format_override].general_format; + + if (texture.aliases.size()) { + for (int i = 0; i < texture.allowed_shared_formats.size(); i++) { + if (texture.allowed_shared_formats[i] == p_view.format_override) { + texture.resource = texture.aliases[i]; + break; + } + } + } + } + + // Apply requested swizzle (component mapping) on top of the one from the format database. + + D3D12_SHADER_COMPONENT_MAPPING component_swizzles[TEXTURE_SWIZZLE_MAX] = { + D3D12_SHADER_COMPONENT_MAPPING_FORCE_VALUE_0, // Unused. + D3D12_SHADER_COMPONENT_MAPPING_FORCE_VALUE_0, + D3D12_SHADER_COMPONENT_MAPPING_FORCE_VALUE_1, + // These will be D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_*. + D3D12_DECODE_SHADER_4_COMPONENT_MAPPING(0, base_swizzle), + D3D12_DECODE_SHADER_4_COMPONENT_MAPPING(1, base_swizzle), + D3D12_DECODE_SHADER_4_COMPONENT_MAPPING(2, base_swizzle), + D3D12_DECODE_SHADER_4_COMPONENT_MAPPING(3, base_swizzle), + }; + + texture.srv_desc.Shader4ComponentMapping = D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING( + p_view.swizzle_r == TEXTURE_SWIZZLE_IDENTITY ? component_swizzles[TEXTURE_SWIZZLE_R] : component_swizzles[p_view.swizzle_r], + p_view.swizzle_g == TEXTURE_SWIZZLE_IDENTITY ? component_swizzles[TEXTURE_SWIZZLE_G] : component_swizzles[p_view.swizzle_g], + p_view.swizzle_b == TEXTURE_SWIZZLE_IDENTITY ? component_swizzles[TEXTURE_SWIZZLE_B] : component_swizzles[p_view.swizzle_b], + p_view.swizzle_a == TEXTURE_SWIZZLE_IDENTITY ? component_swizzles[TEXTURE_SWIZZLE_A] : component_swizzles[p_view.swizzle_a]); + + if (p_slice_type == TEXTURE_SLICE_CUBEMAP) { + ERR_FAIL_COND_V_MSG(p_layer >= src_texture->layers, RID(), + "Specified layer is invalid for cubemap"); + ERR_FAIL_COND_V_MSG((p_layer % 6) != 0, RID(), + "Specified layer must be a multiple of 6."); + } + + // Leveraging aliasing in members of the union as much as possible. + + texture.srv_desc.Texture1D.MostDetailedMip = p_mipmap; + texture.srv_desc.Texture1D.MipLevels = 1; + + texture.uav_desc.Texture1D.MipSlice = p_mipmap; + + switch (p_slice_type) { + case TEXTURE_SLICE_2D: { + if (texture.srv_desc.ViewDimension == D3D12_SRV_DIMENSION_TEXTURE2D && p_layer == 0) { + CRASH_COND(texture.uav_desc.ViewDimension != D3D12_UAV_DIMENSION_TEXTURE2D); + } else if (texture.srv_desc.ViewDimension == D3D12_SRV_DIMENSION_TEXTURE2DMS && p_layer == 0) { + CRASH_COND(texture.uav_desc.ViewDimension != D3D12_UAV_DIMENSION_UNKNOWN); + } else if ((texture.srv_desc.ViewDimension == D3D12_SRV_DIMENSION_TEXTURE2DARRAY || (texture.srv_desc.ViewDimension == D3D12_SRV_DIMENSION_TEXTURE2D && p_layer)) || texture.srv_desc.ViewDimension == D3D12_SRV_DIMENSION_TEXTURECUBE || texture.srv_desc.ViewDimension == D3D12_SRV_DIMENSION_TEXTURECUBEARRAY) { + texture.srv_desc.ViewDimension = D3D12_SRV_DIMENSION_TEXTURE2DARRAY; + texture.srv_desc.Texture2DArray.FirstArraySlice = p_layer; + texture.srv_desc.Texture2DArray.ArraySize = 1; + texture.srv_desc.Texture2DArray.PlaneSlice = 0; + texture.srv_desc.Texture2DArray.ResourceMinLODClamp = 0.0f; + + texture.uav_desc.ViewDimension = D3D12_UAV_DIMENSION_TEXTURE2DARRAY; + texture.uav_desc.Texture2DArray.FirstArraySlice = p_layer; + texture.uav_desc.Texture2DArray.ArraySize = 1; + texture.uav_desc.Texture2DArray.PlaneSlice = 0; + } else if ((texture.srv_desc.ViewDimension == D3D12_SRV_DIMENSION_TEXTURE2DMSARRAY || (texture.srv_desc.ViewDimension == D3D12_SRV_DIMENSION_TEXTURE2DMS && p_layer))) { + texture.srv_desc.ViewDimension = D3D12_SRV_DIMENSION_TEXTURE2DARRAY; + texture.srv_desc.Texture2DMSArray.FirstArraySlice = p_layer; + texture.srv_desc.Texture2DMSArray.ArraySize = 1; + + texture.uav_desc.ViewDimension = D3D12_UAV_DIMENSION_UNKNOWN; + } else { + CRASH_NOW(); + } + } break; + case TEXTURE_SLICE_CUBEMAP: { + if (texture.srv_desc.ViewDimension == D3D12_SRV_DIMENSION_TEXTURECUBE) { + CRASH_COND(texture.uav_desc.ViewDimension != D3D12_UAV_DIMENSION_TEXTURE2DARRAY); + } else if (texture.srv_desc.ViewDimension == D3D12_SRV_DIMENSION_TEXTURECUBE || p_layer == 0) { + texture.srv_desc.ViewDimension = D3D12_SRV_DIMENSION_TEXTURECUBE; + + CRASH_COND(texture.uav_desc.ViewDimension != D3D12_UAV_DIMENSION_TEXTURE2DARRAY); + texture.uav_desc.ViewDimension = D3D12_UAV_DIMENSION_TEXTURE2DARRAY; + texture.uav_desc.Texture2DArray.FirstArraySlice = 0; + texture.uav_desc.Texture2DArray.ArraySize = 6; + texture.uav_desc.Texture2DArray.PlaneSlice = 0; + } else if (texture.srv_desc.ViewDimension == D3D12_SRV_DIMENSION_TEXTURECUBEARRAY || p_layer != 0) { + texture.srv_desc.ViewDimension = D3D12_SRV_DIMENSION_TEXTURECUBEARRAY; + texture.srv_desc.TextureCubeArray.First2DArrayFace = p_layer; + texture.srv_desc.TextureCubeArray.NumCubes = 1; + texture.srv_desc.TextureCubeArray.ResourceMinLODClamp = 0.0f; + + CRASH_COND(texture.uav_desc.ViewDimension != D3D12_UAV_DIMENSION_TEXTURE2DARRAY); + texture.uav_desc.ViewDimension = D3D12_UAV_DIMENSION_TEXTURE2DARRAY; + texture.uav_desc.Texture2DArray.FirstArraySlice = p_layer; + texture.uav_desc.Texture2DArray.ArraySize = 6; + texture.uav_desc.Texture2DArray.PlaneSlice = 0; + } else { + CRASH_NOW(); + } + } break; + case TEXTURE_SLICE_3D: { + CRASH_COND(texture.srv_desc.ViewDimension != D3D12_SRV_DIMENSION_TEXTURE3D); + CRASH_COND(texture.uav_desc.ViewDimension != D3D12_UAV_DIMENSION_TEXTURE3D); + texture.uav_desc.Texture3D.WSize = -1; + } break; + case TEXTURE_SLICE_2D_ARRAY: { + CRASH_COND(texture.srv_desc.ViewDimension != D3D12_SRV_DIMENSION_TEXTURE2DARRAY); + texture.srv_desc.Texture2DArray.FirstArraySlice = p_layer; + texture.srv_desc.Texture2DArray.ArraySize = slice_layers; + + CRASH_COND(texture.uav_desc.ViewDimension != D3D12_UAV_DIMENSION_TEXTURE2DARRAY); + texture.uav_desc.Texture2DArray.FirstArraySlice = p_layer; + texture.uav_desc.Texture2DArray.ArraySize = slice_layers; + } break; + } + + texture.owner = p_with_texture; + RID id = texture_owner.make_rid(texture); +#ifdef DEV_ENABLED + set_resource_name(id, "RID:" + itos(id.get_id())); +#endif + _add_dependency(id, p_with_texture); + + return id; +} + +Error RenderingDeviceD3D12::texture_update(RID p_texture, uint32_t p_layer, const Vector<uint8_t> &p_data, BitField<BarrierMask> p_post_barrier) { + ERR_FAIL_COND_V_MSG((draw_list || compute_list), ERR_INVALID_PARAMETER, + "Updating textures is forbidden during creation of a draw or compute list"); + + Texture *texture = texture_owner.get_or_null(p_texture); + ERR_FAIL_NULL_V(texture, ERR_INVALID_PARAMETER); + + if (texture->owner != RID()) { + texture = texture_owner.get_or_null(texture->owner); + ERR_FAIL_NULL_V(texture, ERR_BUG); // This is a bug. + } + + ID3D12GraphicsCommandList *command_list = frames[frame].draw_command_list.Get(); + + uint32_t subresource = D3D12CalcSubresource(0, p_layer, 0, texture->mipmaps, texture->layers); + _resource_transition_batch(texture, subresource, texture->planes, D3D12_RESOURCE_STATE_COPY_DEST); + _resource_transitions_flush(command_list); + Error err = _texture_update(texture, p_layer, p_data, p_post_barrier, command_list); + + return err; +} + +static _ALWAYS_INLINE_ void _copy_region(uint8_t const *__restrict p_src, uint8_t *__restrict p_dst, uint32_t p_src_x, uint32_t p_src_y, uint32_t p_src_w, uint32_t p_src_h, uint32_t p_src_full_w, uint32_t p_dst_pitch, uint32_t p_unit_size) { + uint32_t src_offset = (p_src_y * p_src_full_w + p_src_x) * p_unit_size; + uint32_t dst_offset = 0; + for (uint32_t y = p_src_h; y > 0; y--) { + uint8_t const *__restrict src = p_src + src_offset; + uint8_t *__restrict dst = p_dst + dst_offset; + for (uint32_t x = p_src_w * p_unit_size; x > 0; x--) { + *dst = *src; + src++; + dst++; + } + src_offset += p_src_full_w * p_unit_size; + dst_offset += p_dst_pitch; + } +} + +Error RenderingDeviceD3D12::_texture_update(Texture *p_texture, uint32_t p_layer, const Vector<uint8_t> &p_data, BitField<BarrierMask> p_post_barrier, ID3D12GraphicsCommandList *p_command_list) { + _THREAD_SAFE_METHOD_ + + ERR_FAIL_COND_V_MSG(p_texture->bound, ERR_CANT_ACQUIRE_RESOURCE, + "Texture can't be updated while a render pass that uses it is being created. Ensure render pass is finalized (and that it was created with RENDER_PASS_CONTENTS_FINISH) to unbind this texture."); + + ERR_FAIL_COND_V_MSG(!(p_texture->usage_flags & TEXTURE_USAGE_CAN_UPDATE_BIT), ERR_INVALID_PARAMETER, + "Texture requires the TEXTURE_USAGE_CAN_UPDATE_BIT in order to be updatable."); + + uint32_t layer_count = p_texture->layers; + if (p_texture->type == TEXTURE_TYPE_CUBE || p_texture->type == TEXTURE_TYPE_CUBE_ARRAY) { + layer_count *= 6; + } + ERR_FAIL_COND_V(p_layer >= layer_count, ERR_INVALID_PARAMETER); + + uint32_t width, height; + uint32_t image_size = get_image_format_required_size(p_texture->format, p_texture->width, p_texture->height, p_texture->depth, p_texture->mipmaps, &width, &height); + uint32_t required_size = image_size; + uint32_t required_align = get_compressed_image_format_block_byte_size(p_texture->format); + if (required_align == 1) { + required_align = get_image_format_pixel_size(p_texture->format); + } + if ((required_align % 4) != 0) { // Alignment rules are really strange. + required_align *= 4; + } + + required_align = ALIGN(required_align, D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT); + + ERR_FAIL_COND_V_MSG(required_size != (uint32_t)p_data.size(), ERR_INVALID_PARAMETER, + "Required size for texture update (" + itos(required_size) + ") does not match data supplied size (" + itos(p_data.size()) + ")."); + + uint32_t region_size = texture_upload_region_size_px; + + const uint8_t *r = p_data.ptr(); + + uint32_t mipmap_offset = 0; + + uint32_t logic_width = p_texture->width; + uint32_t logic_height = p_texture->height; + + for (uint32_t mm_i = 0; mm_i < p_texture->mipmaps; mm_i++) { + uint32_t depth; + uint32_t image_total = get_image_format_required_size(p_texture->format, p_texture->width, p_texture->height, p_texture->depth, mm_i + 1, &width, &height, &depth); + + const uint8_t *read_ptr_mipmap = r + mipmap_offset; + image_size = image_total - mipmap_offset; + + UINT dst_subresource = D3D12CalcSubresource(mm_i, p_layer, 0, p_texture->mipmaps, p_texture->layers); + CD3DX12_TEXTURE_COPY_LOCATION copy_dst(p_texture->resource, dst_subresource); + + for (uint32_t z = 0; z < depth; z++) { // For 3D textures, depth may be > 0. + + const uint8_t *read_ptr = read_ptr_mipmap + image_size * z / depth; + + for (uint32_t y = 0; y < height; y += region_size) { + for (uint32_t x = 0; x < width; x += region_size) { + uint32_t region_w = MIN(region_size, width - x); + uint32_t region_h = MIN(region_size, height - y); + + uint32_t pixel_size = get_image_format_pixel_size(p_texture->format); + uint32_t block_w, block_h; + get_compressed_image_format_block_dimensions(p_texture->format, block_w, block_h); + + uint32_t region_pitch = (region_w * pixel_size * block_w) >> get_compressed_image_format_pixel_rshift(p_texture->format); + region_pitch = ALIGN(region_pitch, D3D12_TEXTURE_DATA_PITCH_ALIGNMENT); + uint32_t to_allocate = region_pitch * region_h; + + uint32_t alloc_offset, alloc_size; + Error err = _staging_buffer_allocate(to_allocate, required_align, alloc_offset, alloc_size, false); + ERR_FAIL_COND_V(err, ERR_CANT_CREATE); + + uint8_t *write_ptr; + + { // Map. + void *data_ptr = nullptr; + HRESULT res = staging_buffer_blocks[staging_buffer_current].resource->Map(0, &VOID_RANGE, &data_ptr); + ERR_FAIL_COND_V_MSG(res, ERR_CANT_CREATE, "Map failed with error " + vformat("0x%08ux", res) + "."); + write_ptr = (uint8_t *)data_ptr; + write_ptr += alloc_offset; + } + + ERR_FAIL_COND_V(region_w % block_w, ERR_BUG); + ERR_FAIL_COND_V(region_pitch % block_w, ERR_BUG); + ERR_FAIL_COND_V(region_h % block_h, ERR_BUG); + + if (block_w != 1 || block_h != 1) { + // Compressed image (functions). + // Must copy a block region. + + uint32_t block_size = get_compressed_image_format_block_byte_size(p_texture->format); + // Re-create current variables in blocky format. + uint32_t xb = x / block_w; + uint32_t yb = y / block_h; + uint32_t wb = width / block_w; + // Uint32_t hb = height / block_h;. + uint32_t region_wb = region_w / block_w; + uint32_t region_hb = region_h / block_h; + _copy_region(read_ptr, write_ptr, xb, yb, region_wb, region_hb, wb, region_pitch, block_size); + } else { + // Regular image (pixels). + // Must copy a pixel region. + _copy_region(read_ptr, write_ptr, x, y, region_w, region_h, width, region_pitch, pixel_size); + } + + { // Unmap. + staging_buffer_blocks[staging_buffer_current].resource->Unmap(0, &VOID_RANGE); + } + + D3D12_PLACED_SUBRESOURCE_FOOTPRINT src_footprint = {}; + src_footprint.Offset = alloc_offset; + src_footprint.Footprint = CD3DX12_SUBRESOURCE_FOOTPRINT( + d3d12_formats[p_texture->format].family, + region_w, + region_h, + 1, + region_pitch); + CD3DX12_TEXTURE_COPY_LOCATION copy_src(staging_buffer_blocks[staging_buffer_current].resource, src_footprint); + + CD3DX12_BOX src_box(0, 0, region_w, region_h); + p_command_list->CopyTextureRegion(©_dst, x, y, z, ©_src, &src_box); + + staging_buffer_blocks.write[staging_buffer_current].fill_amount = alloc_offset + alloc_size; + } + } + } + + mipmap_offset = image_total; + logic_width = MAX(1u, logic_width >> 1); + logic_height = MAX(1u, logic_height >> 1); + } + + return OK; +} + +Vector<uint8_t> RenderingDeviceD3D12::_texture_get_data_from_image(Texture *tex, uint32_t p_layer, bool p_2d) { + uint32_t width, height, depth; + uint32_t image_size = get_image_format_required_size(tex->format, tex->width, tex->height, p_2d ? 1 : tex->depth, tex->mipmaps, &width, &height, &depth); + + Vector<uint8_t> image_data; + image_data.resize(image_size); + + D3D12_RESOURCE_DESC res_desc = tex->resource->GetDesc(); + + uint32_t blockw, blockh; + get_compressed_image_format_block_dimensions(tex->format, blockw, blockh); + uint32_t block_size = get_compressed_image_format_block_byte_size(tex->format); + uint32_t pixel_size = get_image_format_pixel_size(tex->format); + + { + uint8_t *w = image_data.ptrw(); + + uint32_t mipmap_offset = 0; + for (uint32_t mm_i = 0; mm_i < tex->mipmaps; mm_i++) { + uint32_t image_total = get_image_format_required_size(tex->format, tex->width, tex->height, p_2d ? 1 : tex->depth, mm_i + 1, &width, &height, &depth); + + uint8_t *write_ptr_mipmap = w + mipmap_offset; + image_size = image_total - mipmap_offset; + + UINT subresource = 0; + + uint64_t image_total_src = 0; + D3D12_PLACED_SUBRESOURCE_FOOTPRINT layout = {}; + device->GetCopyableFootprints( + &res_desc, + subresource, + 1, + 0, + &layout, + nullptr, + nullptr, + &image_total_src); + + void *img_mem; + HRESULT res = tex->resource->Map(subresource, nullptr, &img_mem); + ERR_FAIL_COND_V_MSG(res, Vector<uint8_t>(), "Map failed with error " + vformat("0x%08ux", res) + "."); + + for (uint32_t z = 0; z < depth; z++) { + uint8_t *write_ptr = write_ptr_mipmap + z * image_size / depth; + const uint8_t *slice_read_ptr = ((uint8_t *)img_mem) + layout.Offset + z * image_total_src / depth; + + if (block_size > 1) { + // Compressed. + uint32_t line_width = (block_size * (width / blockw)); + for (uint32_t y = 0; y < height / blockh; y++) { + const uint8_t *rptr = slice_read_ptr + y * layout.Footprint.RowPitch; + uint8_t *wptr = write_ptr + y * line_width; + + memcpy(wptr, rptr, line_width); + } + + } else { + // Uncompressed. + for (uint32_t y = 0; y < height; y++) { + const uint8_t *rptr = slice_read_ptr + y * layout.Footprint.RowPitch; + uint8_t *wptr = write_ptr + y * pixel_size * width; + memcpy(wptr, rptr, (uint64_t)pixel_size * width); + } + } + } + + tex->resource->Unmap(subresource, nullptr); + + mipmap_offset = image_total; + } + } + + return image_data; +} + +Vector<uint8_t> RenderingDeviceD3D12::texture_get_data(RID p_texture, uint32_t p_layer) { + _THREAD_SAFE_METHOD_ + + Texture *tex = texture_owner.get_or_null(p_texture); + ERR_FAIL_NULL_V(tex, Vector<uint8_t>()); + + ERR_FAIL_COND_V_MSG(tex->bound, Vector<uint8_t>(), + "Texture can't be retrieved while a render pass that uses it is being created. Ensure render pass is finalized (and that it was created with RENDER_PASS_CONTENTS_FINISH) to unbind this texture."); + ERR_FAIL_COND_V_MSG(!(tex->usage_flags & TEXTURE_USAGE_CAN_COPY_FROM_BIT), Vector<uint8_t>(), + "Texture requires the TEXTURE_USAGE_CAN_COPY_FROM_BIT in order to be retrieved."); + + uint32_t layer_count = tex->layers; + if (tex->type == TEXTURE_TYPE_CUBE || tex->type == TEXTURE_TYPE_CUBE_ARRAY) { + layer_count *= 6; + } + ERR_FAIL_COND_V(p_layer >= layer_count, Vector<uint8_t>()); + + if (tex->usage_flags & TEXTURE_USAGE_CPU_READ_BIT) { + // Does not need anything fancy, map and read. + return _texture_get_data_from_image(tex, p_layer); + } else { + // Compute total image size. + uint32_t width, height, depth; + uint32_t final_buffer_size = get_image_format_required_size(tex->format, tex->width, tex->height, tex->depth, tex->mipmaps, &width, &height, &depth); + + uint32_t block_w, block_h; + get_compressed_image_format_block_dimensions(tex->format, block_w, block_h); + uint32_t alignment = D3D12_TEXTURE_DATA_PITCH_ALIGNMENT; + + // We'll use a potentially bigger buffer to account for mip sizes in which we need to use a bigger pitch to keep D3D12 happy. + uint32_t buffer_size = 0; + { + uint32_t computed_h = tex->height; + uint32_t computed_d = tex->depth; + + uint32_t prev_size = 0; + for (uint32_t i = 0; i < tex->mipmaps; i++) { + uint32_t image_size = get_image_format_required_size(tex->format, tex->width, tex->height, tex->depth, i + 1); + uint32_t inferred_row_pitch = image_size / (computed_h * computed_d) * block_h; + uint32_t adjusted_row_pitch = ALIGN(inferred_row_pitch, alignment); + uint32_t adjusted_image_size = adjusted_row_pitch / block_h * computed_h * tex->depth; + uint32_t size = adjusted_image_size - prev_size; + prev_size = image_size; + + buffer_size = ALIGN(buffer_size + size, D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT); + + computed_h = MAX(1u, computed_h >> 1); + computed_d = MAX(1u, computed_d >> 1); + } + } + + // Allocate buffer. + ID3D12GraphicsCommandList *command_list = frames[frame].draw_command_list.Get(); // Makes more sense to retrieve. + + Buffer tmp_buffer; + Error err = _buffer_allocate(&tmp_buffer, buffer_size, D3D12_RESOURCE_STATE_COPY_DEST, D3D12_HEAP_TYPE_READBACK); + ERR_FAIL_COND_V(err != OK, Vector<uint8_t>()); + + for (uint32_t i = 0; i < tex->mipmaps; i++) { + uint32_t subresource = D3D12CalcSubresource(i, p_layer, 0, tex->owner_mipmaps, tex->owner_layers); + _resource_transition_batch(tex, subresource, tex->planes, D3D12_RESOURCE_STATE_COPY_SOURCE); + } + _resource_transitions_flush(command_list); + + uint32_t computed_w = tex->width; + uint32_t computed_h = tex->height; + uint32_t computed_d = tex->depth; + + uint32_t prev_size = 0; + uint32_t offset = 0; + for (uint32_t i = 0; i < tex->mipmaps; i++) { + uint32_t image_size = get_image_format_required_size(tex->format, tex->width, tex->height, tex->depth, i + 1); + uint32_t size = image_size - prev_size; + prev_size = image_size; + + D3D12_PLACED_SUBRESOURCE_FOOTPRINT dst_footprint = {}; + dst_footprint.Offset = offset; + dst_footprint.Footprint.Width = MAX(block_w, computed_w); + dst_footprint.Footprint.Height = MAX(block_h, computed_h); + dst_footprint.Footprint.Depth = computed_d; + uint32_t inferred_row_pitch = size / (dst_footprint.Footprint.Height * computed_d) * block_h; + dst_footprint.Footprint.RowPitch = inferred_row_pitch; + dst_footprint.Footprint.Format = d3d12_formats[tex->format].family; + CD3DX12_TEXTURE_COPY_LOCATION copy_dst(tmp_buffer.resource, dst_footprint); + + UINT src_subresource = D3D12CalcSubresource(i, p_layer, 0, tex->owner_mipmaps, tex->owner_layers); + CD3DX12_TEXTURE_COPY_LOCATION copy_src(tex->resource, src_subresource); + + if (dst_footprint.Footprint.RowPitch % alignment) { + // Dammit! Now we must copy with an imposed pitch and then adjust row by row. + copy_dst.PlacedFootprint.Offset = ALIGN(offset, D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT); + + uint32_t adjusted_row_pitch = ALIGN(inferred_row_pitch, alignment); + copy_dst.PlacedFootprint.Footprint.RowPitch = adjusted_row_pitch; + command_list->CopyTextureRegion(©_dst, 0, 0, 0, ©_src, nullptr); + _flush(true); + + void *buffer_mem; + uint32_t adjusted_size = adjusted_row_pitch / block_h * dst_footprint.Footprint.Height * computed_d; + CD3DX12_RANGE range(offset, copy_dst.PlacedFootprint.Offset + adjusted_size); + HRESULT res = tmp_buffer.resource->Map(0, &range, &buffer_mem); + ERR_FAIL_COND_V_MSG(res, Vector<uint8_t>(), "Map failed with error " + vformat("0x%08ux", res) + "."); + + for (uint32_t j = 0; j < dst_footprint.Footprint.Height / block_h * computed_d; j++) { + memmove((uint8_t *)buffer_mem + offset + j * inferred_row_pitch, (uint8_t *)buffer_mem + copy_dst.PlacedFootprint.Offset + j * adjusted_row_pitch, inferred_row_pitch); + } + + tmp_buffer.resource->Unmap(0, nullptr); + } else if (offset % D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT) { + // Row pitch is fine, but offset alignment is not good. + copy_dst.PlacedFootprint.Offset = ALIGN(offset, D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT); + + command_list->CopyTextureRegion(©_dst, 0, 0, 0, ©_src, nullptr); + _flush(true); + + void *buffer_mem; + CD3DX12_RANGE range(copy_dst.PlacedFootprint.Offset, size); + HRESULT res = tmp_buffer.resource->Map(0, &range, &buffer_mem); + ERR_FAIL_COND_V_MSG(res, Vector<uint8_t>(), "Map failed with error " + vformat("0x%08ux", res) + "."); + + memmove((uint8_t *)buffer_mem + offset, (uint8_t *)buffer_mem + copy_dst.PlacedFootprint.Offset, size); + + tmp_buffer.resource->Unmap(0, nullptr); + } else { + command_list->CopyTextureRegion(©_dst, 0, 0, 0, ©_src, nullptr); + } + + computed_w = MAX(1u, computed_w >> 1); + computed_h = MAX(1u, computed_h >> 1); + computed_d = MAX(1u, computed_d >> 1); + offset += size; + } + + _flush(true); + + void *buffer_mem; + CD3DX12_RANGE range(0, final_buffer_size); + HRESULT res = tmp_buffer.resource->Map(0, &range, &buffer_mem); + ERR_FAIL_COND_V_MSG(res, Vector<uint8_t>(), "Map failed with error " + vformat("0x%08ux", res) + "."); + + Vector<uint8_t> buffer_data; + buffer_data.resize(final_buffer_size); + { + uint8_t *w = buffer_data.ptrw(); + memcpy(w, buffer_mem, final_buffer_size); + } + + tmp_buffer.resource->Unmap(0, nullptr); + + _buffer_free(&tmp_buffer); + + return buffer_data; + } +} + +bool RenderingDeviceD3D12::texture_is_shared(RID p_texture) { + _THREAD_SAFE_METHOD_ + + Texture *tex = texture_owner.get_or_null(p_texture); + ERR_FAIL_NULL_V(tex, false); + return tex->owner.is_valid(); +} + +bool RenderingDeviceD3D12::texture_is_valid(RID p_texture) { + return texture_owner.owns(p_texture); +} + +RenderingDevice::TextureFormat RenderingDeviceD3D12::texture_get_format(RID p_texture) { + _THREAD_SAFE_METHOD_ + + Texture *tex = texture_owner.get_or_null(p_texture); + ERR_FAIL_NULL_V(tex, TextureFormat()); + + TextureFormat tf; + + tf.format = tex->format; + tf.width = tex->width; + tf.height = tex->height; + tf.depth = tex->depth; + tf.array_layers = tex->layers; + tf.mipmaps = tex->mipmaps; + tf.texture_type = tex->type; + tf.samples = tex->samples; + tf.usage_bits = tex->usage_flags; + tf.shareable_formats = tex->allowed_shared_formats; + tf.is_resolve_buffer = tex->is_resolve_buffer; + + return tf; +} + +Size2i RenderingDeviceD3D12::texture_size(RID p_texture) { + _THREAD_SAFE_METHOD_ + + Texture *tex = texture_owner.get_or_null(p_texture); + ERR_FAIL_NULL_V(tex, Size2i()); + return Size2i(tex->width, tex->height); +} + +uint64_t RenderingDeviceD3D12::texture_get_native_handle(RID p_texture) { + _THREAD_SAFE_METHOD_ + + Texture *tex = texture_owner.get_or_null(p_texture); + ERR_FAIL_NULL_V(tex, 0); + + return (uint64_t)tex->resource; +} + +Error RenderingDeviceD3D12::texture_copy(RID p_from_texture, RID p_to_texture, const Vector3 &p_from, const Vector3 &p_to, const Vector3 &p_size, uint32_t p_src_mipmap, uint32_t p_dst_mipmap, uint32_t p_src_layer, uint32_t p_dst_layer, BitField<BarrierMask> p_post_barrier) { + _THREAD_SAFE_METHOD_ + + Texture *src_tex = texture_owner.get_or_null(p_from_texture); + ERR_FAIL_NULL_V(src_tex, ERR_INVALID_PARAMETER); + + ERR_FAIL_COND_V_MSG(src_tex->bound, ERR_INVALID_PARAMETER, + "Source texture can't be copied while a render pass that uses it is being created. Ensure render pass is finalized (and that it was created with RENDER_PASS_CONTENTS_FINISH) to unbind this texture."); + ERR_FAIL_COND_V_MSG(!(src_tex->usage_flags & TEXTURE_USAGE_CAN_COPY_FROM_BIT), ERR_INVALID_PARAMETER, + "Source texture requires the TEXTURE_USAGE_CAN_COPY_FROM_BIT in order to be retrieved."); + + uint32_t src_layer_count = src_tex->layers; + uint32_t src_width, src_height, src_depth; + get_image_format_required_size(src_tex->format, src_tex->width, src_tex->height, src_tex->depth, p_src_mipmap + 1, &src_width, &src_height, &src_depth); + if (src_tex->type == TEXTURE_TYPE_CUBE || src_tex->type == TEXTURE_TYPE_CUBE_ARRAY) { + src_layer_count *= 6; + } + + ERR_FAIL_COND_V(p_from.x < 0 || p_from.x + p_size.x > src_width, ERR_INVALID_PARAMETER); + ERR_FAIL_COND_V(p_from.y < 0 || p_from.y + p_size.y > src_height, ERR_INVALID_PARAMETER); + ERR_FAIL_COND_V(p_from.z < 0 || p_from.z + p_size.z > src_depth, ERR_INVALID_PARAMETER); + ERR_FAIL_COND_V(p_src_mipmap >= src_tex->mipmaps, ERR_INVALID_PARAMETER); + ERR_FAIL_COND_V(p_src_layer >= src_layer_count, ERR_INVALID_PARAMETER); + + Texture *dst_tex = texture_owner.get_or_null(p_to_texture); + ERR_FAIL_NULL_V(dst_tex, ERR_INVALID_PARAMETER); + + ERR_FAIL_COND_V_MSG(dst_tex->bound, ERR_INVALID_PARAMETER, + "Destination texture can't be copied while a render pass that uses it is being created. Ensure render pass is finalized (and that it was created with RENDER_PASS_CONTENTS_FINISH) to unbind this texture."); + ERR_FAIL_COND_V_MSG(!(dst_tex->usage_flags & TEXTURE_USAGE_CAN_COPY_TO_BIT), ERR_INVALID_PARAMETER, + "Destination texture requires the TEXTURE_USAGE_CAN_COPY_TO_BIT in order to be retrieved."); + + uint32_t dst_layer_count = dst_tex->layers; + uint32_t dst_width, dst_height, dst_depth; + get_image_format_required_size(dst_tex->format, dst_tex->width, dst_tex->height, dst_tex->depth, p_dst_mipmap + 1, &dst_width, &dst_height, &dst_depth); + if (dst_tex->type == TEXTURE_TYPE_CUBE || dst_tex->type == TEXTURE_TYPE_CUBE_ARRAY) { + dst_layer_count *= 6; + } + + ERR_FAIL_COND_V(p_to.x < 0 || p_to.x + p_size.x > dst_width, ERR_INVALID_PARAMETER); + ERR_FAIL_COND_V(p_to.y < 0 || p_to.y + p_size.y > dst_height, ERR_INVALID_PARAMETER); + ERR_FAIL_COND_V(p_to.z < 0 || p_to.z + p_size.z > dst_depth, ERR_INVALID_PARAMETER); + ERR_FAIL_COND_V(p_dst_mipmap >= dst_tex->mipmaps, ERR_INVALID_PARAMETER); + ERR_FAIL_COND_V(p_dst_layer >= dst_layer_count, ERR_INVALID_PARAMETER); + + ERR_FAIL_COND_V_MSG((src_tex->usage_flags & TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) != (dst_tex->usage_flags & TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT), ERR_INVALID_PARAMETER, + "Source and destination texture must be of the same type (color or depth)."); + + ID3D12GraphicsCommandList *command_list = frames[frame].draw_command_list.Get(); + + uint32_t src_subresource = D3D12CalcSubresource(p_src_mipmap, p_src_layer, 0, src_tex->owner_mipmaps, src_tex->owner_layers); + _resource_transition_batch(src_tex, src_subresource, src_tex->planes, D3D12_RESOURCE_STATE_COPY_SOURCE); + + uint32_t dst_subresource = D3D12CalcSubresource(p_dst_mipmap, p_dst_layer, 0, dst_tex->owner_mipmaps, dst_tex->owner_layers); + _resource_transition_batch(dst_tex, dst_subresource, dst_tex->planes, D3D12_RESOURCE_STATE_COPY_DEST); + + _resource_transitions_flush(command_list); + + { + CD3DX12_TEXTURE_COPY_LOCATION src_location(src_tex->resource, src_subresource); + CD3DX12_BOX src_box(p_from.x, p_from.y, p_from.z, p_from.x + p_size.x, p_from.y + p_size.y, p_from.z + p_size.z); + CD3DX12_TEXTURE_COPY_LOCATION dst_location(dst_tex->resource, dst_subresource); + command_list->CopyTextureRegion( + &dst_location, + p_to.x, p_to.y, p_to.z, + &src_location, + &src_box); + } + + return OK; +} + +Error RenderingDeviceD3D12::texture_resolve_multisample(RID p_from_texture, RID p_to_texture, BitField<BarrierMask> p_post_barrier) { + _THREAD_SAFE_METHOD_ + + Texture *src_tex = texture_owner.get_or_null(p_from_texture); + ERR_FAIL_NULL_V(src_tex, ERR_INVALID_PARAMETER); + + ERR_FAIL_COND_V_MSG(src_tex->bound, ERR_INVALID_PARAMETER, + "Source texture can't be copied while a render pass that uses it is being created. Ensure render pass is finalized (and that it was created with RENDER_PASS_CONTENTS_FINISH) to unbind this texture."); + ERR_FAIL_COND_V_MSG(!(src_tex->usage_flags & TEXTURE_USAGE_CAN_COPY_FROM_BIT), ERR_INVALID_PARAMETER, + "Source texture requires the TEXTURE_USAGE_CAN_COPY_FROM_BIT in order to be retrieved."); + + ERR_FAIL_COND_V_MSG(src_tex->type != TEXTURE_TYPE_2D, ERR_INVALID_PARAMETER, "Source texture must be 2D (or a slice of a 3D/Cube texture)"); + ERR_FAIL_COND_V_MSG(src_tex->samples == TEXTURE_SAMPLES_1, ERR_INVALID_PARAMETER, "Source texture must be multisampled."); + + Texture *dst_tex = texture_owner.get_or_null(p_to_texture); + ERR_FAIL_NULL_V(dst_tex, ERR_INVALID_PARAMETER); + + ERR_FAIL_COND_V_MSG(dst_tex->bound, ERR_INVALID_PARAMETER, + "Destination texture can't be copied while a render pass that uses it is being created. Ensure render pass is finalized (and that it was created with RENDER_PASS_CONTENTS_FINISH) to unbind this texture."); + ERR_FAIL_COND_V_MSG(!(dst_tex->usage_flags & TEXTURE_USAGE_CAN_COPY_TO_BIT), ERR_INVALID_PARAMETER, + "Destination texture requires the TEXTURE_USAGE_CAN_COPY_TO_BIT in order to be retrieved."); + + ERR_FAIL_COND_V_MSG(dst_tex->type != TEXTURE_TYPE_2D, ERR_INVALID_PARAMETER, "Destination texture must be 2D (or a slice of a 3D/Cube texture)."); + ERR_FAIL_COND_V_MSG(dst_tex->samples != TEXTURE_SAMPLES_1, ERR_INVALID_PARAMETER, "Destination texture must not be multisampled."); + + ERR_FAIL_COND_V_MSG(src_tex->format != dst_tex->format, ERR_INVALID_PARAMETER, "Source and Destination textures must be the same format."); + ERR_FAIL_COND_V_MSG(src_tex->width != dst_tex->width && src_tex->height != dst_tex->height && src_tex->depth != dst_tex->depth, ERR_INVALID_PARAMETER, "Source and Destination textures must have the same dimensions."); + + ERR_FAIL_COND_V_MSG((src_tex->usage_flags & TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) != (dst_tex->usage_flags & TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT), ERR_INVALID_PARAMETER, + "Source and destination texture must be of the same type (color or depth)."); + + ID3D12GraphicsCommandList *command_list = frames[frame].draw_command_list.Get(); + + uint32_t src_subresource = D3D12CalcSubresource(src_tex->base_mipmap, src_tex->base_layer, 0, src_tex->owner_mipmaps, src_tex->owner_layers); + _resource_transition_batch(src_tex, src_subresource, src_tex->planes, D3D12_RESOURCE_STATE_RESOLVE_SOURCE); + + uint32_t dst_subresource = D3D12CalcSubresource(dst_tex->base_mipmap, dst_tex->base_layer, 0, dst_tex->owner_mipmaps, dst_tex->owner_layers); + _resource_transition_batch(dst_tex, dst_subresource, dst_tex->planes, D3D12_RESOURCE_STATE_RESOLVE_DEST); + + _resource_transitions_flush(command_list); + + command_list->ResolveSubresource(dst_tex->resource, dst_subresource, src_tex->resource, src_subresource, d3d12_formats[src_tex->format].general_format); + + return OK; +} + +Error RenderingDeviceD3D12::texture_clear(RID p_texture, const Color &p_color, uint32_t p_base_mipmap, uint32_t p_mipmaps, uint32_t p_base_layer, uint32_t p_layers, BitField<BarrierMask> p_post_barrier) { + _THREAD_SAFE_METHOD_ + + Texture *src_tex = texture_owner.get_or_null(p_texture); + ERR_FAIL_NULL_V(src_tex, ERR_INVALID_PARAMETER); + + ERR_FAIL_COND_V_MSG(src_tex->bound, ERR_INVALID_PARAMETER, + "Source texture can't be cleared while a render pass that uses it is being created. Ensure render pass is finalized (and that it was created with RENDER_PASS_CONTENTS_FINISH) to unbind this texture."); + + ERR_FAIL_COND_V(p_layers == 0, ERR_INVALID_PARAMETER); + ERR_FAIL_COND_V(p_mipmaps == 0, ERR_INVALID_PARAMETER); + + ERR_FAIL_COND_V_MSG(!(src_tex->usage_flags & TEXTURE_USAGE_CAN_COPY_TO_BIT), ERR_INVALID_PARAMETER, + "Source texture requires the TEXTURE_USAGE_CAN_COPY_TO_BIT in order to be cleared."); + + uint32_t src_layer_count = src_tex->layers; + if (src_tex->type == TEXTURE_TYPE_CUBE || src_tex->type == TEXTURE_TYPE_CUBE_ARRAY) { + src_layer_count *= 6; + } + + ERR_FAIL_COND_V(p_base_mipmap + p_mipmaps > src_tex->mipmaps, ERR_INVALID_PARAMETER); + ERR_FAIL_COND_V(p_base_layer + p_layers > src_layer_count, ERR_INVALID_PARAMETER); + + if ((src_tex->usage_flags & TEXTURE_USAGE_COLOR_ATTACHMENT_BIT)) { + // Clear via RTV. + + if (frames[frame].desc_heap_walkers.rtv.is_at_eof()) { + if (!frames[frame].desc_heaps_exhausted_reported.rtv) { + frames[frame].desc_heaps_exhausted_reported.rtv = true; + ERR_FAIL_V_MSG(ERR_BUSY, + "Cannot clear texture because there's no enough room in current frame's RENDER TARGET descriptors heap.\n" + "Please increase the value of the rendering/rendering_device/d3d12/max_misc_descriptors_per_frame project setting."); + } else { + return ERR_BUSY; + } + } + + D3D12_RENDER_TARGET_VIEW_DESC rtv_desc = _make_rtv_for_texture(src_tex, p_base_mipmap, p_base_layer, p_layers); + rtv_desc.Format = src_tex->owner_uav_desc.Format; + + ID3D12GraphicsCommandList *command_list = frames[frame].draw_command_list.Get(); + + for (uint32_t i = 0; i < p_layers; i++) { + for (uint32_t j = 0; j < p_mipmaps; j++) { + uint32_t subresource = D3D12CalcSubresource(src_tex->base_mipmap + p_base_mipmap + j, src_tex->base_layer + p_base_layer + i, 0, src_tex->owner_mipmaps, src_tex->owner_layers); + _resource_transition_batch(src_tex, subresource, src_tex->planes, D3D12_RESOURCE_STATE_RENDER_TARGET, src_tex->owner_resource); + } + } + _resource_transitions_flush(command_list); + + device->CreateRenderTargetView( + src_tex->owner_resource, + &rtv_desc, + frames[frame].desc_heap_walkers.rtv.get_curr_cpu_handle()); + command_list->ClearRenderTargetView( + frames[frame].desc_heap_walkers.rtv.get_curr_cpu_handle(), + p_color.components, + 0, + nullptr); + frames[frame].desc_heap_walkers.rtv.advance(); + } else { + // Clear via UAV. + + if (frames[frame].desc_heap_walkers.resources.is_at_eof()) { + if (!frames[frame].desc_heaps_exhausted_reported.resources) { + frames[frame].desc_heaps_exhausted_reported.resources = true; + ERR_FAIL_V_MSG(ERR_BUSY, + "Cannot clear texture because there's no enough room in current frame's RESOURCE descriptors heap.\n" + "Please increase the value of the rendering/rendering_device/d3d12/max_resource_descriptors_per_frame project setting."); + } else { + return ERR_BUSY; + } + } + if (frames[frame].desc_heap_walkers.aux.is_at_eof()) { + if (!frames[frame].desc_heaps_exhausted_reported.aux) { + frames[frame].desc_heaps_exhausted_reported.aux = true; + ERR_FAIL_V_MSG(ERR_BUSY, + "Cannot clear texture because there's no enough room in current frame's AUX descriptors heap.\n" + "Please increase the value of the rendering/rendering_device/d3d12/max_misc_descriptors_per_frame project setting."); + } else { + return ERR_BUSY; + } + } + + ID3D12GraphicsCommandList *command_list = frames[frame].draw_command_list.Get(); + + for (uint32_t i = 0; i < p_layers; i++) { + for (uint32_t j = 0; j < p_mipmaps; j++) { + uint32_t subresource = D3D12CalcSubresource(src_tex->base_mipmap + p_base_mipmap + j, src_tex->base_layer + p_base_layer + i, 0, src_tex->owner_mipmaps, src_tex->owner_layers); + _resource_transition_batch(src_tex, subresource, src_tex->planes, D3D12_RESOURCE_STATE_UNORDERED_ACCESS, src_tex->owner_resource); + } + } + _resource_transitions_flush(command_list); + + device->CreateUnorderedAccessView( + src_tex->owner_resource, + nullptr, + &src_tex->owner_uav_desc, + frames[frame].desc_heap_walkers.aux.get_curr_cpu_handle()); + + device->CopyDescriptorsSimple( + 1, + frames[frame].desc_heap_walkers.resources.get_curr_cpu_handle(), + frames[frame].desc_heap_walkers.aux.get_curr_cpu_handle(), + D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV); + + UINT values[4] = { + (UINT)p_color.get_r8(), + (UINT)p_color.get_g8(), + (UINT)p_color.get_b8(), + (UINT)p_color.get_a8(), + }; + command_list->ClearUnorderedAccessViewUint( + frames[frame].desc_heap_walkers.resources.get_curr_gpu_handle(), + frames[frame].desc_heap_walkers.aux.get_curr_cpu_handle(), + src_tex->owner_resource, + values, + 0, + nullptr); + + frames[frame].desc_heap_walkers.resources.advance(); + frames[frame].desc_heap_walkers.aux.advance(); + } + + return OK; +} + +bool RenderingDeviceD3D12::texture_is_format_supported_for_usage(DataFormat p_format, BitField<RenderingDevice::TextureUsageBits> p_usage) const { + ERR_FAIL_INDEX_V(p_format, DATA_FORMAT_MAX, false); + + _THREAD_SAFE_METHOD_ + + D3D12_FEATURE_DATA_FORMAT_SUPPORT srv_rtv_support = {}; + srv_rtv_support.Format = d3d12_formats[p_format].general_format; + HRESULT res = device->CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT, &srv_rtv_support, sizeof(srv_rtv_support)); + ERR_FAIL_COND_V_MSG(res, false, "CheckFeatureSupport failed with error " + vformat("0x%08ux", res) + "."); + + D3D12_FEATURE_DATA_FORMAT_SUPPORT &uav_support = srv_rtv_support; // Fine for now. + + D3D12_FEATURE_DATA_FORMAT_SUPPORT dsv_support = {}; + dsv_support.Format = d3d12_formats[p_format].dsv_format; + res = device->CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT, &dsv_support, sizeof(dsv_support)); + ERR_FAIL_COND_V_MSG(res, false, "CheckFeatureSupport failed with error " + vformat("0x%08ux", res) + "."); + + if ((p_usage & TEXTURE_USAGE_SAMPLING_BIT) && !(srv_rtv_support.Support1 & (D3D12_FORMAT_SUPPORT1_SHADER_LOAD | D3D12_FORMAT_SUPPORT1_SHADER_SAMPLE)) && d3d12_formats[p_format].general_format != DXGI_FORMAT_UNKNOWN) { + return false; + } + + if ((p_usage & TEXTURE_USAGE_SAMPLING_BIT) && d3d12_formats[p_format].general_format == DXGI_FORMAT_UNKNOWN) { + return false; + } + + if ((p_usage & TEXTURE_USAGE_COLOR_ATTACHMENT_BIT) && !(srv_rtv_support.Support1 & D3D12_FORMAT_SUPPORT1_RENDER_TARGET)) { + return false; + } + + if ((p_usage & TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) && !(dsv_support.Support1 & D3D12_FORMAT_SUPPORT1_DEPTH_STENCIL)) { + printf("dxgiformat: %x\n", d3d12_formats[p_format].dsv_format); + return false; + } + + if ((p_usage & TEXTURE_USAGE_STORAGE_BIT) && !(uav_support.Support1 & D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW)) { // Maybe check LOAD/STORE, too? + return false; + } + + if ((p_usage & TEXTURE_USAGE_STORAGE_ATOMIC_BIT) && !(uav_support.Support2 & D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_ADD)) { // Check a basic atomic at least. + return false; + } + + if ((p_usage & TEXTURE_USAGE_VRS_ATTACHMENT_BIT) && d3d12_formats[p_format].general_format != DXGI_FORMAT_R8_UINT) { + return false; + } + + return true; +} + +/********************/ +/**** ATTACHMENT ****/ +/********************/ + +bool RenderingDeviceD3D12::_framebuffer_format_preprocess(FramebufferFormat *p_fb_format, uint32_t p_view_count) { + const Vector<AttachmentFormat> &attachments = p_fb_format->attachments; + + LocalVector<int32_t> attachment_last_pass; + attachment_last_pass.resize(attachments.size()); + + if (p_view_count > 1) { + const D3D12Context::MultiviewCapabilities &capabilities = context->get_multiview_capabilities(); + + // This only works with multiview! + ERR_FAIL_COND_V_MSG(!capabilities.is_supported, false, "Multiview not supported"); + + // Make sure we limit this to the number of views we support. + ERR_FAIL_COND_V_MSG(p_view_count > capabilities.max_view_count, false, "Hardware does not support requested number of views for Multiview render pass"); + } + + int attachment_count = 0; + HashSet<DXGI_FORMAT> ms_attachment_formats; + for (int i = 0; i < attachments.size(); i++) { + if (attachments[i].usage_flags == AttachmentFormat::UNUSED_ATTACHMENT) { + continue; + } + + ERR_FAIL_INDEX_V(attachments[i].format, DATA_FORMAT_MAX, false); + ERR_FAIL_INDEX_V(attachments[i].samples, TEXTURE_SAMPLES_MAX, false); + ERR_FAIL_COND_V_MSG(!(attachments[i].usage_flags & (TEXTURE_USAGE_COLOR_ATTACHMENT_BIT | TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT | TEXTURE_USAGE_INPUT_ATTACHMENT_BIT | TEXTURE_USAGE_VRS_ATTACHMENT_BIT)), + ERR_INVALID_PARAMETER, "Texture format for index (" + itos(i) + ") requires an attachment (color, depth-stencil, input or VRS) bit set."); + + attachment_last_pass[i] = -1; + attachment_count++; + + if (attachments[i].samples != TEXTURE_SAMPLES_1) { + if ((attachments[i].usage_flags & TEXTURE_USAGE_COLOR_ATTACHMENT_BIT)) { + ms_attachment_formats.insert(d3d12_formats[attachments[i].format].general_format); + } else if ((attachments[i].usage_flags & TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT)) { + ms_attachment_formats.insert(d3d12_formats[attachments[i].format].dsv_format); + } + } + } + + Vector<FramebufferPass> &passes = p_fb_format->passes; + for (int i = 0; i < passes.size(); i++) { + FramebufferPass *pass = &passes.write[i]; + + TextureSamples texture_samples = TEXTURE_SAMPLES_1; + bool is_multisample_first = true; + + ERR_FAIL_COND_V(pass->color_attachments.size() > D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT, false); + for (int j = 0; j < pass->color_attachments.size(); j++) { + int32_t attachment = pass->color_attachments[j]; + if (attachment != FramebufferPass::ATTACHMENT_UNUSED) { + ERR_FAIL_INDEX_V_MSG(attachment, attachments.size(), false, "Invalid framebuffer format attachment(" + itos(attachment) + "), in pass (" + itos(i) + "), color attachment (" + itos(j) + ")."); + ERR_FAIL_COND_V_MSG(!(attachments[attachment].usage_flags & TEXTURE_USAGE_COLOR_ATTACHMENT_BIT), false, "Invalid framebuffer format attachment(" + itos(attachment) + "), in pass (" + itos(i) + "), it's marked as depth, but it's not usable as color attachment."); + ERR_FAIL_COND_V_MSG(attachment_last_pass[attachment] == i, false, "Invalid framebuffer format attachment(" + itos(attachment) + "), in pass (" + itos(i) + "), it already was used for something else before in this pass."); + + if (is_multisample_first) { + texture_samples = attachments[attachment].samples; + is_multisample_first = false; + } else { + ERR_FAIL_COND_V_MSG(texture_samples != attachments[attachment].samples, false, "Invalid framebuffer format attachment(" + itos(attachment) + "), in pass (" + itos(i) + "), if an attachment is marked as multisample, all of them should be multisample and use the same number of samples."); + } + attachment_last_pass[attachment] = i; + } + } + + for (int j = 0; j < pass->input_attachments.size(); j++) { + int32_t attachment = pass->input_attachments[j]; + if (attachment != FramebufferPass::ATTACHMENT_UNUSED) { + ERR_FAIL_INDEX_V_MSG(attachment, attachments.size(), false, "Invalid framebuffer format attachment(" + itos(attachment) + "), in pass (" + itos(i) + "), input attachment (" + itos(j) + ")."); + ERR_FAIL_COND_V_MSG(!(attachments[attachment].usage_flags & TEXTURE_USAGE_INPUT_ATTACHMENT_BIT), false, "Invalid framebuffer format attachment(" + itos(attachment) + "), in pass (" + itos(i) + "), it isn't marked as an input texture."); + ERR_FAIL_COND_V_MSG(attachment_last_pass[attachment] == i, false, "Invalid framebuffer format attachment(" + itos(attachment) + "), in pass (" + itos(i) + "), it already was used for something else before in this pass."); + + if ((attachments[attachment].usage_flags & TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT)) { + ERR_FAIL_V_MSG(false, "Invalid framebuffer format attachment(" + itos(attachment) + "), in pass (" + itos(i) + "), the D3D12 driver doesn't yet support using depth-stencil targets as input attachments."); + } + + attachment_last_pass[attachment] = i; + } + } + + if (pass->resolve_attachments.size() > 0) { + ERR_FAIL_COND_V_MSG(pass->resolve_attachments.size() != pass->color_attachments.size(), false, "The amount of resolve attachments (" + itos(pass->resolve_attachments.size()) + ") must match the number of color attachments (" + itos(pass->color_attachments.size()) + ")."); + ERR_FAIL_COND_V_MSG(texture_samples == TEXTURE_SAMPLES_1, false, "Resolve attachments specified, but color attachments are not multisample."); + } + for (int j = 0; j < pass->resolve_attachments.size(); j++) { + int32_t attachment = pass->resolve_attachments[j]; + if (attachment != FramebufferPass::ATTACHMENT_UNUSED) { + ERR_FAIL_INDEX_V_MSG(attachment, attachments.size(), false, "Invalid framebuffer format attachment(" + itos(attachment) + "), in pass (" + itos(i) + "), resolve attachment (" + itos(j) + ")."); + ERR_FAIL_COND_V_MSG(pass->color_attachments[j] == FramebufferPass::ATTACHMENT_UNUSED, false, "Invalid framebuffer format attachment(" + itos(attachment) + "), in pass (" + itos(i) + "), resolve attachment (" + itos(j) + "), the respective color attachment is marked as unused."); + ERR_FAIL_COND_V_MSG(!(attachments[attachment].usage_flags & TEXTURE_USAGE_COLOR_ATTACHMENT_BIT), false, "Invalid framebuffer format attachment(" + itos(attachment) + "), in pass (" + itos(i) + "), resolve attachment, it isn't marked as a color texture."); + ERR_FAIL_COND_V_MSG(attachment_last_pass[attachment] == i, false, "Invalid framebuffer format attachment(" + itos(attachment) + "), in pass (" + itos(i) + "), it already was used for something else before in this pass."); + bool multisample = attachments[attachment].samples > TEXTURE_SAMPLES_1; + ERR_FAIL_COND_V_MSG(multisample, false, "Invalid framebuffer format attachment(" + itos(attachment) + "), in pass (" + itos(i) + "), resolve attachments can't be multisample."); + attachment_last_pass[attachment] = i; + } + } + + if (pass->depth_attachment != FramebufferPass::ATTACHMENT_UNUSED) { + int32_t attachment = pass->depth_attachment; + ERR_FAIL_INDEX_V_MSG(attachment, attachments.size(), false, "Invalid framebuffer depth format attachment(" + itos(attachment) + "), in pass (" + itos(i) + "), depth attachment."); + ERR_FAIL_COND_V_MSG(!(attachments[attachment].usage_flags & TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT), false, "Invalid framebuffer depth format attachment(" + itos(attachment) + "), in pass (" + itos(i) + "), it's marked as depth, but it's not a depth attachment."); + ERR_FAIL_COND_V_MSG(attachment_last_pass[attachment] == i, false, "Invalid framebuffer depth format attachment(" + itos(attachment) + "), in pass (" + itos(i) + "), it already was used for something else before in this pass."); + attachment_last_pass[attachment] = i; + + if (is_multisample_first) { + texture_samples = attachments[attachment].samples; + is_multisample_first = false; + } else { + ERR_FAIL_COND_V_MSG(texture_samples != attachments[attachment].samples, false, "Invalid framebuffer depth format attachment(" + itos(attachment) + "), in pass (" + itos(i) + "), if an attachment is marked as multisample, all of them should be multisample and use the same number of samples including the depth."); + } + } + + if (context->get_vrs_capabilities().ss_image_supported && pass->vrs_attachment != FramebufferPass::ATTACHMENT_UNUSED) { + int32_t attachment = pass->vrs_attachment; + ERR_FAIL_INDEX_V_MSG(attachment, attachments.size(), false, "Invalid framebuffer VRS format attachment(" + itos(attachment) + "), in pass (" + itos(i) + "), VRS attachment."); + ERR_FAIL_COND_V_MSG(!(attachments[attachment].usage_flags & TEXTURE_USAGE_VRS_ATTACHMENT_BIT), false, "Invalid framebuffer VRS format attachment(" + itos(attachment) + "), in pass (" + itos(i) + "), it's marked as VRS, but it's not a VRS attachment."); + ERR_FAIL_COND_V_MSG(attachment_last_pass[attachment] == i, false, "Invalid framebuffer VRS attachment(" + itos(attachment) + "), in pass (" + itos(i) + "), it already was used for something else before in this pass."); + attachment_last_pass[attachment] = i; + } + + for (int j = 0; j < pass->preserve_attachments.size(); j++) { + int32_t attachment = pass->preserve_attachments[j]; + + ERR_FAIL_COND_V_MSG(attachment == FramebufferPass::ATTACHMENT_UNUSED, false, "Invalid framebuffer format attachment(" + itos(attachment) + "), in pass (" + itos(i) + "), preserve attachment (" + itos(j) + "). Preserve attachments can't be unused."); + + ERR_FAIL_INDEX_V_MSG(attachment, attachments.size(), false, "Invalid framebuffer format attachment(" + itos(attachment) + "), in pass (" + itos(i) + "), preserve attachment (" + itos(j) + ")."); + + if (attachment_last_pass[attachment] != i) { + // Preserve can still be used to keep depth or color from being discarded after use. + attachment_last_pass[attachment] = i; + } + } + + p_fb_format->pass_samples.push_back(texture_samples); + } + + if (p_fb_format->view_count > 1) { + const D3D12Context::MultiviewCapabilities capabilities = context->get_multiview_capabilities(); + + // For now this only works with multiview! + ERR_FAIL_COND_V_MSG(!capabilities.is_supported, ERR_UNAVAILABLE, "Multiview not supported"); + + // Make sure we limit this to the number of views we support. + ERR_FAIL_COND_V_MSG(p_fb_format->view_count > capabilities.max_view_count, ERR_UNAVAILABLE, "Hardware does not support requested number of views for Multiview render pass"); + } + + if (!ms_attachment_formats.is_empty()) { + LocalVector<DXGI_FORMAT> formats; + for (DXGI_FORMAT f : ms_attachment_formats) { + formats.push_back(f); + } + p_fb_format->max_supported_sample_count = _find_max_common_supported_sample_count(formats.ptr(), formats.size()); + } + + return true; +} + +uint32_t RenderingDeviceD3D12::_find_max_common_supported_sample_count(const DXGI_FORMAT *p_formats, uint32_t p_num_formats) { + uint32_t common = UINT32_MAX; + + for (uint32_t i = 0; i < p_num_formats; i++) { + if (format_sample_counts_mask_cache.has(p_formats[i])) { + common &= format_sample_counts_mask_cache[p_formats[i]]; + } else { + D3D12_FEATURE_DATA_MULTISAMPLE_QUALITY_LEVELS msql = {}; + msql.Format = p_formats[i]; + uint32_t mask = 0; + for (int samples = 1 << (TEXTURE_SAMPLES_MAX - 1); samples >= 1; samples /= 2) { + msql.SampleCount = (UINT)samples; + HRESULT res = device->CheckFeatureSupport(D3D12_FEATURE_MULTISAMPLE_QUALITY_LEVELS, &msql, sizeof(msql)); + if (SUCCEEDED(res) && msql.NumQualityLevels) { + int bit = get_shift_from_power_of_2(samples); + ERR_FAIL_COND_V(bit == -1, 1); + mask |= (uint32_t)(1 << bit); + } + } + format_sample_counts_mask_cache.insert(p_formats[i], mask); + common &= mask; + } + } + if (common == UINT32_MAX) { + return 1; + } else { + return (uint32_t)1 << nearest_shift(common); + } +} + +RenderingDevice::FramebufferFormatID RenderingDeviceD3D12::framebuffer_format_create(const Vector<AttachmentFormat> &p_format, uint32_t p_view_count) { + FramebufferPass pass; + for (int i = 0; i < p_format.size(); i++) { + if (p_format[i].usage_flags & TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) { + pass.depth_attachment = i; + } else { + pass.color_attachments.push_back(i); + } + } + + Vector<FramebufferPass> passes; + passes.push_back(pass); + return framebuffer_format_create_multipass(p_format, passes, p_view_count); +} + +RenderingDevice::FramebufferFormatID RenderingDeviceD3D12::framebuffer_format_create_multipass(const Vector<AttachmentFormat> &p_attachments, const Vector<FramebufferPass> &p_passes, uint32_t p_view_count) { + _THREAD_SAFE_METHOD_ + + FramebufferFormat fb_format; + fb_format.attachments = p_attachments; + fb_format.passes = p_passes; + fb_format.view_count = p_view_count; + if (!_framebuffer_format_preprocess(&fb_format, p_view_count)) { + return INVALID_ID; + } + + FramebufferFormatID id = FramebufferFormatID(framebuffer_formats.size()) | (FramebufferFormatID(ID_TYPE_FRAMEBUFFER_FORMAT) << FramebufferFormatID(ID_BASE_SHIFT)); + framebuffer_formats[id] = fb_format; + return id; +} + +RenderingDevice::FramebufferFormatID RenderingDeviceD3D12::framebuffer_format_create_empty(TextureSamples p_samples) { + _THREAD_SAFE_METHOD_ + + FramebufferFormat fb_format; + fb_format.passes.push_back(FramebufferPass()); + fb_format.pass_samples.push_back(p_samples); + + FramebufferFormatID id = FramebufferFormatID(framebuffer_formats.size()) | (FramebufferFormatID(ID_TYPE_FRAMEBUFFER_FORMAT) << FramebufferFormatID(ID_BASE_SHIFT)); + framebuffer_formats[id] = fb_format; + return id; +} + +RenderingDevice::TextureSamples RenderingDeviceD3D12::framebuffer_format_get_texture_samples(FramebufferFormatID p_format, uint32_t p_pass) { + HashMap<FramebufferFormatID, FramebufferFormat>::Iterator E = framebuffer_formats.find(p_format); + ERR_FAIL_NULL_V(E, TEXTURE_SAMPLES_1); + ERR_FAIL_COND_V(p_pass >= uint32_t(E->value.pass_samples.size()), TEXTURE_SAMPLES_1); + + return E->value.pass_samples[p_pass]; +} + +/***********************/ +/**** RENDER TARGET ****/ +/***********************/ + +RID RenderingDeviceD3D12::framebuffer_create_empty(const Size2i &p_size, TextureSamples p_samples, FramebufferFormatID p_format_check) { + _THREAD_SAFE_METHOD_ + Framebuffer framebuffer; + framebuffer.format_id = framebuffer_format_create_empty(p_samples); + ERR_FAIL_COND_V(p_format_check != INVALID_FORMAT_ID && framebuffer.format_id != p_format_check, RID()); + framebuffer.size = p_size; + + return framebuffer_owner.make_rid(framebuffer); +} + +RID RenderingDeviceD3D12::framebuffer_create(const Vector<RID> &p_texture_attachments, FramebufferFormatID p_format_check, uint32_t p_view_count) { + _THREAD_SAFE_METHOD_ + + FramebufferPass pass; + + for (int i = 0; i < p_texture_attachments.size(); i++) { + Texture *texture = texture_owner.get_or_null(p_texture_attachments[i]); + + ERR_FAIL_COND_V_MSG(texture && texture->layers != p_view_count, RID(), "Layers of our texture doesn't match view count for this framebuffer"); + + if (texture && texture->usage_flags & TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) { + pass.depth_attachment = i; + } else if (texture && texture->usage_flags & TEXTURE_USAGE_VRS_ATTACHMENT_BIT) { + pass.vrs_attachment = i; + } else { + if (texture && texture->is_resolve_buffer) { + pass.resolve_attachments.push_back(i); + } else { + pass.color_attachments.push_back(texture ? i : FramebufferPass::ATTACHMENT_UNUSED); + } + } + } + + Vector<FramebufferPass> passes; + passes.push_back(pass); + + return framebuffer_create_multipass(p_texture_attachments, passes, p_format_check, p_view_count); +} + +D3D12_RENDER_TARGET_VIEW_DESC RenderingDeviceD3D12::_make_rtv_for_texture(const RenderingDeviceD3D12::Texture *p_texture, uint32_t p_mipmap_offset, uint32_t p_layer_offset, uint32_t p_layers) { + D3D12_RENDER_TARGET_VIEW_DESC rtv_desc = {}; + rtv_desc.Format = p_texture->srv_desc.Format; + + switch (p_texture->srv_desc.ViewDimension) { + case D3D12_SRV_DIMENSION_TEXTURE1D: { + rtv_desc.ViewDimension = D3D12_RTV_DIMENSION_TEXTURE1D; + rtv_desc.Texture1D.MipSlice = p_texture->srv_desc.Texture1D.MostDetailedMip + p_mipmap_offset; + } break; + case D3D12_SRV_DIMENSION_TEXTURE1DARRAY: { + rtv_desc.ViewDimension = D3D12_RTV_DIMENSION_TEXTURE1DARRAY; + rtv_desc.Texture1DArray.MipSlice = p_texture->srv_desc.Texture1DArray.MostDetailedMip + p_mipmap_offset; + rtv_desc.Texture1DArray.FirstArraySlice = p_texture->srv_desc.Texture1DArray.FirstArraySlice + p_layer_offset; + rtv_desc.Texture1DArray.ArraySize = p_layers == UINT32_MAX ? p_texture->srv_desc.Texture1DArray.ArraySize : p_layers; + } break; + case D3D12_SRV_DIMENSION_TEXTURE2D: { + rtv_desc.ViewDimension = D3D12_RTV_DIMENSION_TEXTURE2D; + rtv_desc.Texture2D.MipSlice = p_texture->srv_desc.Texture2D.MostDetailedMip + p_mipmap_offset; + rtv_desc.Texture2D.PlaneSlice = p_texture->srv_desc.Texture2D.PlaneSlice; + } break; + case D3D12_SRV_DIMENSION_TEXTURE2DARRAY: { + rtv_desc.ViewDimension = D3D12_RTV_DIMENSION_TEXTURE2DARRAY; + rtv_desc.Texture2DArray.MipSlice = p_texture->srv_desc.Texture2DArray.MostDetailedMip + p_mipmap_offset; + rtv_desc.Texture2DArray.FirstArraySlice = p_texture->srv_desc.Texture2DArray.FirstArraySlice + p_layer_offset; + rtv_desc.Texture2DArray.ArraySize = p_layers == UINT32_MAX ? p_texture->srv_desc.Texture2DArray.ArraySize : p_layers; + rtv_desc.Texture2DArray.PlaneSlice = p_texture->srv_desc.Texture2DArray.PlaneSlice; + } break; + case D3D12_SRV_DIMENSION_TEXTURE2DMS: { + rtv_desc.ViewDimension = D3D12_RTV_DIMENSION_TEXTURE2DMS; + } break; + case D3D12_SRV_DIMENSION_TEXTURE2DMSARRAY: { + rtv_desc.ViewDimension = D3D12_RTV_DIMENSION_TEXTURE2DMSARRAY; + rtv_desc.Texture2DMSArray.FirstArraySlice = p_texture->srv_desc.Texture2DMSArray.FirstArraySlice + p_layer_offset; + rtv_desc.Texture2DMSArray.ArraySize = p_layers == UINT32_MAX ? p_texture->srv_desc.Texture2DMSArray.ArraySize : p_layers; + } break; + case D3D12_SRV_DIMENSION_TEXTURE3D: { + rtv_desc.ViewDimension = D3D12_RTV_DIMENSION_TEXTURE3D; + rtv_desc.Texture3D.MipSlice = p_texture->srv_desc.Texture3D.MostDetailedMip + p_mipmap_offset; + rtv_desc.Texture3D.FirstWSlice = 0; + rtv_desc.Texture3D.WSize = p_texture->depth; + } break; + default: { + ERR_FAIL_V_MSG(D3D12_RENDER_TARGET_VIEW_DESC(), "Can't create an RTV from an SRV whose view dimension is " + itos(p_texture->srv_desc.ViewDimension) + "."); + } + } + + return rtv_desc; +} + +D3D12_DEPTH_STENCIL_VIEW_DESC RenderingDeviceD3D12::_make_dsv_for_texture(const RenderingDeviceD3D12::Texture *p_texture) { + D3D12_DEPTH_STENCIL_VIEW_DESC dsv_desc = {}; + dsv_desc.Format = d3d12_formats[p_texture->format].dsv_format; + dsv_desc.Flags = D3D12_DSV_FLAG_NONE; + + switch (p_texture->srv_desc.ViewDimension) { + case D3D12_SRV_DIMENSION_TEXTURE1D: { + dsv_desc.ViewDimension = D3D12_DSV_DIMENSION_TEXTURE1D; + dsv_desc.Texture1D.MipSlice = p_texture->srv_desc.Texture1D.MostDetailedMip; + } break; + case D3D12_SRV_DIMENSION_TEXTURE1DARRAY: { + dsv_desc.ViewDimension = D3D12_DSV_DIMENSION_TEXTURE1DARRAY; + dsv_desc.Texture1DArray.MipSlice = p_texture->srv_desc.Texture1DArray.MostDetailedMip; + dsv_desc.Texture1DArray.FirstArraySlice = p_texture->srv_desc.Texture1DArray.FirstArraySlice; + dsv_desc.Texture1DArray.ArraySize = p_texture->srv_desc.Texture1DArray.ArraySize; + } break; + case D3D12_SRV_DIMENSION_TEXTURE2D: { + dsv_desc.ViewDimension = D3D12_DSV_DIMENSION_TEXTURE2D; + dsv_desc.Texture2D.MipSlice = p_texture->srv_desc.Texture2D.MostDetailedMip; + } break; + case D3D12_SRV_DIMENSION_TEXTURE2DARRAY: { + dsv_desc.ViewDimension = D3D12_DSV_DIMENSION_TEXTURE2DARRAY; + dsv_desc.Texture2DArray.MipSlice = p_texture->srv_desc.Texture2DArray.MostDetailedMip; + dsv_desc.Texture2DArray.FirstArraySlice = p_texture->srv_desc.Texture2DArray.FirstArraySlice; + dsv_desc.Texture2DArray.ArraySize = p_texture->srv_desc.Texture2DArray.ArraySize; + } break; + case D3D12_SRV_DIMENSION_TEXTURE2DMS: { + dsv_desc.ViewDimension = D3D12_DSV_DIMENSION_TEXTURE2DMS; + dsv_desc.Texture2DMS.UnusedField_NothingToDefine = p_texture->srv_desc.Texture2DMS.UnusedField_NothingToDefine; + } break; + case D3D12_SRV_DIMENSION_TEXTURE2DMSARRAY: { + dsv_desc.ViewDimension = D3D12_DSV_DIMENSION_TEXTURE2DMSARRAY; + dsv_desc.Texture2DMSArray.FirstArraySlice = p_texture->srv_desc.Texture2DMSArray.FirstArraySlice; + dsv_desc.Texture2DMSArray.ArraySize = p_texture->srv_desc.Texture2DMSArray.ArraySize; + } break; + default: { + ERR_FAIL_V_MSG(D3D12_DEPTH_STENCIL_VIEW_DESC(), "Can't create an RTV from an SRV whose view dimension is " + itos(p_texture->srv_desc.ViewDimension) + "."); + } + } + + return dsv_desc; +} + +RID RenderingDeviceD3D12::framebuffer_create_multipass(const Vector<RID> &p_texture_attachments, const Vector<FramebufferPass> &p_passes, FramebufferFormatID p_format_check, uint32_t p_view_count) { + _THREAD_SAFE_METHOD_ + + Vector<AttachmentFormat> attachments; + attachments.resize(p_texture_attachments.size()); + Vector<uint32_t> attachments_handle_inds; + attachments_handle_inds.resize(p_texture_attachments.size()); + Size2i size; + bool size_set = false; + int num_color = 0; + int num_depth = 0; + for (int i = 0; i < p_texture_attachments.size(); i++) { + AttachmentFormat af; + Texture *texture = texture_owner.get_or_null(p_texture_attachments[i]); + if (!texture) { + af.usage_flags = AttachmentFormat::UNUSED_ATTACHMENT; + attachments_handle_inds.write[i] = UINT32_MAX; + } else { + ERR_FAIL_COND_V_MSG(texture->layers != p_view_count, RID(), "Layers of our texture doesn't match view count for this framebuffer"); + + if (!size_set) { + size.width = texture->width; + size.height = texture->height; + size_set = true; + } else if (texture->usage_flags & TEXTURE_USAGE_VRS_ATTACHMENT_BIT) { + // If this is not the first attachment we assume this is used as the VRS attachment. + // In this case this texture will be 1/16th the size of the color attachment. + // So we skip the size check. + } else { + ERR_FAIL_COND_V_MSG((uint32_t)size.width != texture->width || (uint32_t)size.height != texture->height, RID(), + "All textures in a framebuffer should be the same size."); + } + + af.format = texture->format; + af.samples = texture->samples; + af.usage_flags = texture->usage_flags; + + bool is_vrs = texture->usage_flags & TEXTURE_USAGE_VRS_ATTACHMENT_BIT && i == p_passes[0].vrs_attachment; + if (is_vrs) { + } else if ((texture->usage_flags & TEXTURE_USAGE_COLOR_ATTACHMENT_BIT)) { + attachments_handle_inds.write[i] = num_color; + num_color++; + } else if ((texture->usage_flags & TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT)) { + attachments_handle_inds.write[i] = num_depth; + num_depth++; + } else { + attachments_handle_inds.write[i] = UINT32_MAX; + } + } + attachments.write[i] = af; + } + + ERR_FAIL_COND_V_MSG(!size_set, RID(), "All attachments unused."); + + FramebufferFormatID format_id = framebuffer_format_create_multipass(attachments, p_passes, p_view_count); + if (format_id == INVALID_ID) { + return RID(); + } + + ERR_FAIL_COND_V_MSG(p_format_check != INVALID_ID && format_id != p_format_check, RID(), + "The format used to check this framebuffer differs from the intended framebuffer format."); + + Framebuffer framebuffer; + framebuffer.format_id = format_id; + framebuffer.texture_ids = p_texture_attachments; + framebuffer.attachments_handle_inds = attachments_handle_inds; + framebuffer.size = size; + framebuffer.view_count = p_view_count; + + { + if (num_color) { + Error err = framebuffer.rtv_heap.allocate(device.Get(), D3D12_DESCRIPTOR_HEAP_TYPE_RTV, num_color, false); + ERR_FAIL_COND_V(err, RID()); + } + DescriptorsHeap::Walker rtv_heap_walker = framebuffer.rtv_heap.make_walker(); + + if (num_depth) { + Error err = framebuffer.dsv_heap.allocate(device.Get(), D3D12_DESCRIPTOR_HEAP_TYPE_DSV, num_depth, false); + ERR_FAIL_COND_V(err, RID()); + } + DescriptorsHeap::Walker dsv_heap_walker = framebuffer.dsv_heap.make_walker(); + + for (int i = 0; i < p_texture_attachments.size(); i++) { + Texture *texture = texture_owner.get_or_null(p_texture_attachments[i]); + if (!texture) { + continue; + } + + bool is_vrs = texture->usage_flags & TEXTURE_USAGE_VRS_ATTACHMENT_BIT && i == p_passes[0].vrs_attachment; + if (is_vrs) { + } else if ((texture->usage_flags & TEXTURE_USAGE_COLOR_ATTACHMENT_BIT)) { + D3D12_RENDER_TARGET_VIEW_DESC rtv_desc = _make_rtv_for_texture(texture); + device->CreateRenderTargetView(texture->resource, &rtv_desc, rtv_heap_walker.get_curr_cpu_handle()); + rtv_heap_walker.advance(); + } else if ((texture->usage_flags & TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT)) { + D3D12_DEPTH_STENCIL_VIEW_DESC dsv_desc = _make_dsv_for_texture(texture); + device->CreateDepthStencilView(texture->resource, &dsv_desc, dsv_heap_walker.get_curr_cpu_handle()); + dsv_heap_walker.advance(); + } + } + + DEV_ASSERT(rtv_heap_walker.is_at_eof()); + DEV_ASSERT(dsv_heap_walker.is_at_eof()); + } + + RID id = framebuffer_owner.make_rid(framebuffer); + + for (int i = 0; i < p_texture_attachments.size(); i++) { + if (p_texture_attachments[i].is_valid()) { + _add_dependency(id, p_texture_attachments[i]); + } + } + + return id; +} + +RenderingDevice::FramebufferFormatID RenderingDeviceD3D12::framebuffer_get_format(RID p_framebuffer) { + _THREAD_SAFE_METHOD_ + + Framebuffer *framebuffer = framebuffer_owner.get_or_null(p_framebuffer); + ERR_FAIL_NULL_V(framebuffer, INVALID_ID); + + return framebuffer->format_id; +} + +bool RenderingDeviceD3D12::framebuffer_is_valid(RID p_framebuffer) const { + _THREAD_SAFE_METHOD_ + + return framebuffer_owner.owns(p_framebuffer); +} + +void RenderingDeviceD3D12::framebuffer_set_invalidation_callback(RID p_framebuffer, InvalidationCallback p_callback, void *p_userdata) { + _THREAD_SAFE_METHOD_ + + Framebuffer *framebuffer = framebuffer_owner.get_or_null(p_framebuffer); + ERR_FAIL_NULL(framebuffer); + + framebuffer->invalidated_callback = p_callback; + framebuffer->invalidated_callback_userdata = p_userdata; +} + +/*****************/ +/**** SAMPLER ****/ +/*****************/ + +RID RenderingDeviceD3D12::sampler_create(const SamplerState &p_state) { + _THREAD_SAFE_METHOD_ + + D3D12_SAMPLER_DESC sampler_desc = {}; + + if (p_state.use_anisotropy) { + sampler_desc.Filter = D3D12_ENCODE_ANISOTROPIC_FILTER(D3D12_FILTER_REDUCTION_TYPE_STANDARD); + sampler_desc.MaxAnisotropy = p_state.anisotropy_max; + } else { + static const D3D12_FILTER_TYPE d3d12_filter_types[] = { + D3D12_FILTER_TYPE_POINT, // SAMPLER_FILTER_NEAREST. + D3D12_FILTER_TYPE_LINEAR, // SAMPLER_FILTER_LINEAR. + }; + sampler_desc.Filter = D3D12_ENCODE_BASIC_FILTER( + d3d12_filter_types[p_state.min_filter], + d3d12_filter_types[p_state.mag_filter], + d3d12_filter_types[p_state.mip_filter], + p_state.enable_compare ? D3D12_FILTER_REDUCTION_TYPE_COMPARISON : D3D12_FILTER_REDUCTION_TYPE_STANDARD); + } + + ERR_FAIL_INDEX_V(p_state.repeat_u, SAMPLER_REPEAT_MODE_MAX, RID()); + sampler_desc.AddressU = address_modes[p_state.repeat_u]; + ERR_FAIL_INDEX_V(p_state.repeat_v, SAMPLER_REPEAT_MODE_MAX, RID()); + sampler_desc.AddressV = address_modes[p_state.repeat_v]; + ERR_FAIL_INDEX_V(p_state.repeat_w, SAMPLER_REPEAT_MODE_MAX, RID()); + sampler_desc.AddressW = address_modes[p_state.repeat_w]; + + ERR_FAIL_INDEX_V(p_state.border_color, SAMPLER_BORDER_COLOR_MAX, RID()); + for (int i = 0; i < 4; i++) { + sampler_desc.BorderColor[i] = sampler_border_colors[p_state.border_color][i]; + } + + sampler_desc.MinLOD = p_state.min_lod; + sampler_desc.MaxLOD = p_state.max_lod; + sampler_desc.MipLODBias = p_state.lod_bias; + + ERR_FAIL_INDEX_V(p_state.compare_op, COMPARE_OP_MAX, RID()); + sampler_desc.ComparisonFunc = p_state.enable_compare ? compare_operators[p_state.compare_op] : D3D12_COMPARISON_FUNC_NEVER; + + // TODO: Emulate somehow? + if (p_state.unnormalized_uvw) { + WARN_PRINT("Creating a sampler with unnormalized UVW, which is not supported."); + } + + return sampler_owner.make_rid(sampler_desc); +} + +bool RenderingDeviceD3D12::sampler_is_format_supported_for_filter(DataFormat p_format, SamplerFilter p_sampler_filter) const { + ERR_FAIL_INDEX_V(p_format, DATA_FORMAT_MAX, false); + + _THREAD_SAFE_METHOD_ + + D3D12_FEATURE_DATA_FORMAT_SUPPORT srv_rtv_support = {}; + srv_rtv_support.Format = d3d12_formats[p_format].general_format; + HRESULT res = device->CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT, &srv_rtv_support, sizeof(srv_rtv_support)); + ERR_FAIL_COND_V_MSG(res, false, "CheckFeatureSupport failed with error " + vformat("0x%08ux", res) + "."); + + return (srv_rtv_support.Support1 & D3D12_FORMAT_SUPPORT1_SHADER_SAMPLE); +} + +/**********************/ +/**** VERTEX ARRAY ****/ +/**********************/ + +RID RenderingDeviceD3D12::vertex_buffer_create(uint32_t p_size_bytes, const Vector<uint8_t> &p_data, bool p_use_as_storage) { + _THREAD_SAFE_METHOD_ + + ERR_FAIL_COND_V(p_data.size() && (uint32_t)p_data.size() != p_size_bytes, RID()); + + Buffer buffer; + D3D12_RESOURCE_STATES usage = D3D12_RESOURCE_STATE_VERTEX_AND_CONSTANT_BUFFER; + if (p_use_as_storage) { + usage |= D3D12_RESOURCE_STATE_UNORDERED_ACCESS; + } + Error err = _buffer_allocate(&buffer, p_size_bytes, usage, D3D12_HEAP_TYPE_DEFAULT); + ERR_FAIL_COND_V(err != OK, RID()); + + if (p_data.size()) { + uint64_t data_size = p_data.size(); + const uint8_t *r = p_data.ptr(); + _buffer_update(&buffer, 0, r, data_size); + } + + RID id = vertex_buffer_owner.make_rid(buffer); +#ifdef DEV_ENABLED + set_resource_name(id, "RID:" + itos(id.get_id())); +#endif + return id; +} + +// Internally reference counted, this ID is warranted to be unique for the same description, but needs to be freed as many times as it was allocated. +RenderingDevice::VertexFormatID RenderingDeviceD3D12::vertex_format_create(const Vector<VertexAttribute> &p_vertex_formats) { + _THREAD_SAFE_METHOD_ + + VertexDescriptionKey key; + key.vertex_formats = p_vertex_formats; + + VertexFormatID *idptr = vertex_format_cache.getptr(key); + if (idptr) { + return *idptr; + } + + // Does not exist, create one and cache it. + VertexDescriptionCache vdcache; + vdcache.elements_desc.resize(p_vertex_formats.size()); + + HashSet<int> used_locations; + for (int i = 0; i < p_vertex_formats.size(); i++) { + ERR_CONTINUE(p_vertex_formats[i].format >= DATA_FORMAT_MAX); + ERR_FAIL_COND_V(used_locations.has(p_vertex_formats[i].location), INVALID_ID); + + ERR_FAIL_COND_V_MSG(get_format_vertex_size(p_vertex_formats[i].format) == 0, INVALID_ID, + "Data format for attachment (" + itos(i) + "), '" + named_formats[p_vertex_formats[i].format] + "', is not valid for a vertex array."); + + // SPIRV-Cross maps `layout(location = <N>) in` to `TEXCOORD<N>`. + vdcache.elements_desc.write[i].SemanticName = "TEXCOORD"; // SPIRV-Cross will apply TEXCOORD semantic to vertex attributes. + vdcache.elements_desc.write[i].SemanticIndex = p_vertex_formats[i].location; + vdcache.elements_desc.write[i].Format = d3d12_formats[p_vertex_formats[i].format].general_format; + vdcache.elements_desc.write[i].InputSlot = i; // TODO: Can the same slot be used if data comes from the same buffer (regardless format)? + vdcache.elements_desc.write[i].AlignedByteOffset = p_vertex_formats[i].offset; + if (p_vertex_formats[i].frequency == VERTEX_FREQUENCY_INSTANCE) { + vdcache.elements_desc.write[i].InputSlotClass = D3D12_INPUT_CLASSIFICATION_PER_INSTANCE_DATA; + vdcache.elements_desc.write[i].InstanceDataStepRate = 1; + } else { + vdcache.elements_desc.write[i].InputSlotClass = D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA; + vdcache.elements_desc.write[i].InstanceDataStepRate = 0; + } + used_locations.insert(p_vertex_formats[i].location); + } + + vdcache.vertex_formats = p_vertex_formats; + + VertexFormatID id = VertexFormatID(vertex_format_cache.size()) | (VertexFormatID(ID_TYPE_VERTEX_FORMAT) << ID_BASE_SHIFT); + vertex_format_cache[key] = id; + vertex_formats[id] = vdcache; + return id; +} + +RID RenderingDeviceD3D12::vertex_array_create(uint32_t p_vertex_count, VertexFormatID p_vertex_format, const Vector<RID> &p_src_buffers, const Vector<uint64_t> &p_offsets) { + _THREAD_SAFE_METHOD_ + + ERR_FAIL_COND_V(!vertex_formats.has(p_vertex_format), RID()); + const VertexDescriptionCache &vd = vertex_formats[p_vertex_format]; + + ERR_FAIL_COND_V(vd.vertex_formats.size() != p_src_buffers.size(), RID()); + + for (int i = 0; i < p_src_buffers.size(); i++) { + ERR_FAIL_COND_V(!vertex_buffer_owner.owns(p_src_buffers[i]), RID()); + } + + VertexArray vertex_array; + + if (!p_offsets.is_empty()) { + ERR_FAIL_COND_V(p_offsets.size() != p_src_buffers.size(), RID()); + } + + vertex_array.vertex_count = p_vertex_count; + vertex_array.description = p_vertex_format; + vertex_array.max_instances_allowed = 0xFFFFFFFF; // By default as many as you want. + HashSet<Buffer *> unique_buffers; + for (int i = 0; i < p_src_buffers.size(); i++) { + Buffer *buffer = vertex_buffer_owner.get_or_null(p_src_buffers[i]); + + const VertexAttribute &atf = vd.vertex_formats[i]; + + // Validate with buffer. + { + uint32_t element_size = get_format_vertex_size(atf.format); + ERR_FAIL_COND_V(element_size == 0, RID()); // Should never happens since this was prevalidated. + + if (atf.frequency == VERTEX_FREQUENCY_VERTEX) { + // Validate size for regular drawing. + uint64_t total_size = uint64_t(atf.stride) * (p_vertex_count - 1) + atf.offset + element_size; + ERR_FAIL_COND_V_MSG(total_size > buffer->size, RID(), + "Attachment (" + itos(i) + ") will read past the end of the buffer."); + + } else { + // Validate size for instances drawing. + uint64_t available = buffer->size - atf.offset; + ERR_FAIL_COND_V_MSG(available < element_size, RID(), + "Attachment (" + itos(i) + ") uses instancing, but it's just too small."); + + uint32_t instances_allowed = available / atf.stride; + vertex_array.max_instances_allowed = MIN(instances_allowed, vertex_array.max_instances_allowed); + } + } + + unique_buffers.insert(buffer); + + D3D12_VERTEX_BUFFER_VIEW view = {}; + uint64_t data_offset = p_offsets.is_empty() ? 0 : p_offsets[i]; + view.BufferLocation = buffer->resource->GetGPUVirtualAddress() + data_offset; + view.SizeInBytes = buffer->size; + view.StrideInBytes = atf.stride; + vertex_array.views.push_back(view); + } + + for (Buffer *buffer : unique_buffers) { + vertex_array.unique_buffers.push_back(buffer); + } + + RID id = vertex_array_owner.make_rid(vertex_array); + for (int i = 0; i < p_src_buffers.size(); i++) { + _add_dependency(id, p_src_buffers[i]); + } + + return id; +} + +RID RenderingDeviceD3D12::index_buffer_create(uint32_t p_index_count, IndexBufferFormat p_format, const Vector<uint8_t> &p_data, bool p_use_restart_indices) { + _THREAD_SAFE_METHOD_ + + ERR_FAIL_COND_V(p_index_count == 0, RID()); + + IndexBuffer index_buffer; + index_buffer.index_format = (p_format == INDEX_BUFFER_FORMAT_UINT16) ? DXGI_FORMAT_R16_UINT : DXGI_FORMAT_R32_UINT; + index_buffer.supports_restart_indices = p_use_restart_indices; + index_buffer.index_count = p_index_count; + uint32_t size_bytes = p_index_count * ((p_format == INDEX_BUFFER_FORMAT_UINT16) ? 2 : 4); +#ifdef DEBUG_ENABLED + if (p_data.size()) { + index_buffer.max_index = 0; + ERR_FAIL_COND_V_MSG((uint32_t)p_data.size() != size_bytes, RID(), + "Default index buffer initializer array size (" + itos(p_data.size()) + ") does not match format required size (" + itos(size_bytes) + ")."); + const uint8_t *r = p_data.ptr(); + if (p_format == INDEX_BUFFER_FORMAT_UINT16) { + const uint16_t *index16 = (const uint16_t *)r; + for (uint32_t i = 0; i < p_index_count; i++) { + if (p_use_restart_indices && index16[i] == 0xFFFF) { + continue; // Restart index, ignore. + } + index_buffer.max_index = MAX(index16[i], index_buffer.max_index); + } + } else { + const uint32_t *index32 = (const uint32_t *)r; + for (uint32_t i = 0; i < p_index_count; i++) { + if (p_use_restart_indices && index32[i] == 0xFFFFFFFF) { + continue; // Restart index, ignore. + } + index_buffer.max_index = MAX(index32[i], index_buffer.max_index); + } + } + } else { + index_buffer.max_index = 0xFFFFFFFF; + } +#else + index_buffer.max_index = 0xFFFFFFFF; +#endif + Error err = _buffer_allocate(&index_buffer, size_bytes, D3D12_RESOURCE_STATE_INDEX_BUFFER, D3D12_HEAP_TYPE_DEFAULT); + ERR_FAIL_COND_V(err != OK, RID()); + + if (p_data.size()) { + uint64_t data_size = p_data.size(); + const uint8_t *r = p_data.ptr(); + _buffer_update(&index_buffer, 0, r, data_size); + } + RID id = index_buffer_owner.make_rid(index_buffer); +#ifdef DEV_ENABLED + set_resource_name(id, "RID:" + itos(id.get_id())); +#endif + return id; +} + +RID RenderingDeviceD3D12::index_array_create(RID p_index_buffer, uint32_t p_index_offset, uint32_t p_index_count) { + _THREAD_SAFE_METHOD_ + + ERR_FAIL_COND_V(!index_buffer_owner.owns(p_index_buffer), RID()); + + IndexBuffer *index_buffer = index_buffer_owner.get_or_null(p_index_buffer); + + ERR_FAIL_COND_V(p_index_count == 0, RID()); + ERR_FAIL_COND_V(p_index_offset + p_index_count > index_buffer->index_count, RID()); + + IndexArray index_array; + index_array.buffer = index_buffer; + index_array.max_index = index_buffer->max_index; + index_array.offset = p_index_offset; + index_array.indices = p_index_count; + index_array.supports_restart_indices = index_buffer->supports_restart_indices; + index_array.view.BufferLocation = index_buffer->resource->GetGPUVirtualAddress(); + index_array.view.SizeInBytes = p_index_count * (index_buffer->index_format == DXGI_FORMAT_R16_UINT ? 2 : 4); + index_array.view.Format = index_buffer->index_format; + + RID id = index_array_owner.make_rid(index_array); + _add_dependency(id, p_index_buffer); + return id; +} + +/****************/ +/**** SHADER ****/ +/****************/ + +static const char *shader_uniform_names[RenderingDevice::UNIFORM_TYPE_MAX + 1] = { + "Sampler", "CombinedSampler", "Texture", "Image", "TextureBuffer", "SamplerTextureBuffer", "ImageBuffer", "UniformBuffer", "StorageBuffer", "InputAttachment", "N/A" +}; + +static uint32_t shader_stage_bit_offset_indices[RenderingDevice::SHADER_STAGE_MAX] = { + /* SHADER_STAGE_VERTEX */ 0, + /* SHADER_STAGE_FRAGMENT */ 1, + /* SHADER_STAGE_TESSELATION_CONTROL */ UINT32_MAX, + /* SHADER_STAGE_TESSELATION_EVALUATION */ UINT32_MAX, + /* SHADER_STAGE_COMPUTE */ 2, +}; + +String RenderingDeviceD3D12::_shader_uniform_debug(RID p_shader, int p_set) { + String ret; + const Shader *shader = shader_owner.get_or_null(p_shader); + ERR_FAIL_NULL_V(shader, String()); + for (int i = 0; i < shader->sets.size(); i++) { + if (p_set >= 0 && i != p_set) { + continue; + } + for (int j = 0; j < shader->sets[i].uniforms.size(); j++) { + const UniformInfo &ui = shader->sets[i].uniforms[j].info; + if (!ret.is_empty()) { + ret += "\n"; + } + ret += "Set: " + itos(i) + " Binding: " + itos(ui.binding) + " Type: " + shader_uniform_names[ui.type] + " Writable: " + (ui.writable ? "Y" : "N") + " Length: " + itos(ui.length); + } + } + return ret; +} + +uint32_t RenderingDeviceD3D12::_shader_patch_dxil_specialization_constant( + PipelineSpecializationConstantType p_type, + const void *p_value, + const uint64_t (&p_stages_bit_offsets)[D3D12_BITCODE_OFFSETS_NUM_STAGES], + HashMap<ShaderStage, Vector<uint8_t>> &r_stages_bytecodes, + bool p_is_first_patch) { + uint32_t patch_val = 0; + switch (p_type) { + case PIPELINE_SPECIALIZATION_CONSTANT_TYPE_INT: { + uint32_t int_value = *((const int *)p_value); + ERR_FAIL_COND_V(int_value & (1 << 31), 0); + patch_val = int_value; + } break; + case PIPELINE_SPECIALIZATION_CONSTANT_TYPE_BOOL: { + bool bool_value = *((const bool *)p_value); + patch_val = (uint32_t)bool_value; + } break; + case PIPELINE_SPECIALIZATION_CONSTANT_TYPE_FLOAT: { + uint32_t int_value = *((const int *)p_value); + ERR_FAIL_COND_V(int_value & (1 << 31), 0); + patch_val = (int_value >> 1); + } break; + } + // For VBR encoding to encode the number of bits we expect (32), we need to set the MSB unconditionally. + // However, signed VBR moves the MSB to the LSB, so setting the MSB to 1 wouldn't help. Therefore, + // the bit we set to 1 is the one at index 30. + patch_val |= (1 << 30); + patch_val <<= 1; // What signed VBR does. + + auto tamper_bits = [](uint8_t *p_start, uint64_t p_bit_offset, uint64_t p_value) -> uint64_t { + uint64_t original = 0; + uint32_t curr_input_byte = p_bit_offset / 8; + uint8_t curr_input_bit = p_bit_offset % 8; + auto get_curr_input_bit = [&]() -> bool { + return ((p_start[curr_input_byte] >> curr_input_bit) & 1); + }; + auto move_to_next_input_bit = [&]() { + if (curr_input_bit == 7) { + curr_input_bit = 0; + curr_input_byte++; + } else { + curr_input_bit++; + } + }; + auto tamper_input_bit = [&](bool p_new_bit) { + p_start[curr_input_byte] &= ~((uint8_t)1 << curr_input_bit); + if (p_new_bit) { + p_start[curr_input_byte] |= (uint8_t)1 << curr_input_bit; + } + }; + uint8_t value_bit_idx = 0; + for (uint32_t i = 0; i < 5; i++) { // 32 bits take 5 full bytes in VBR. + for (uint32_t j = 0; j < 7; j++) { + bool input_bit = get_curr_input_bit(); + original |= (uint64_t)(input_bit ? 1 : 0) << value_bit_idx; + tamper_input_bit((p_value >> value_bit_idx) & 1); + move_to_next_input_bit(); + value_bit_idx++; + } +#ifdef DEV_ENABLED + bool input_bit = get_curr_input_bit(); + DEV_ASSERT(i < 4 && input_bit || i == 4 && !input_bit); +#endif + move_to_next_input_bit(); + } + return original; + }; + uint32_t stages_patched_mask = 0; + for (int stage = 0; stage < SHADER_STAGE_MAX; stage++) { + if (!r_stages_bytecodes.has((ShaderStage)stage)) { + continue; + } + + uint64_t offset = p_stages_bit_offsets[shader_stage_bit_offset_indices[stage]]; + if (offset == 0) { + // This constant does not appear at this stage. + continue; + } + + Vector<uint8_t> &bytecode = r_stages_bytecodes[(ShaderStage)stage]; +#ifdef DEV_ENABLED + uint64_t orig_patch_val = tamper_bits(bytecode.ptrw(), offset, patch_val); + // Checking against the value the NIR patch should have set. + DEV_ASSERT(!p_is_first_patch || ((orig_patch_val >> 1) & GODOT_NIR_SC_SENTINEL_MAGIC_MASK) == GODOT_NIR_SC_SENTINEL_MAGIC); + uint64_t readback_patch_val = tamper_bits(bytecode.ptrw(), offset, patch_val); + DEV_ASSERT(readback_patch_val == patch_val); +#else + tamper_bits(bytecode.ptrw(), offset, patch_val); +#endif + + stages_patched_mask |= (1 << stage); + } + return stages_patched_mask; +} + +bool RenderingDeviceD3D12::_shader_sign_dxil_bytecode(ShaderStage p_stage, Vector<uint8_t> &r_dxil_blob) { + dxil_validator *validator = get_dxil_validator_for_current_thread(); + + char *err = nullptr; + bool res = dxil_validate_module(validator, r_dxil_blob.ptrw(), r_dxil_blob.size(), &err); + if (!res) { + if (err) { + ERR_FAIL_COND_V_MSG(!res, false, "Shader signing invocation at stage " + String(shader_stage_names[p_stage]) + " failed:\n" + String(err)); + } else { + ERR_FAIL_COND_V_MSG(!res, false, "Shader signing invocation at stage " + String(shader_stage_names[p_stage]) + " failed."); + } + } + + return true; +} + +// Version 1: Initial. +// Version 2: 64-bit vertex input mask. +#define SHADER_BINARY_VERSION 2 + +String RenderingDeviceD3D12::shader_get_binary_cache_key() const { + return "D3D12-SV" + itos(SHADER_BINARY_VERSION); +} + +enum RootSignatureLocationType { + RS_LOC_TYPE_RESOURCE, + RS_LOC_TYPE_SAMPLER, +}; + +enum ResourceClass { + RES_CLASS_INVALID, + RES_CLASS_CBV, + RES_CLASS_SRV, + RES_CLASS_UAV, +}; + +// Phase 1: SPIR-V reflection, where the Vulkan/RD interface of the shader is discovered. +// Phase 2: SPIR-V to DXIL translation, where the DXIL interface is discovered, which may have gaps due to optimizations. + +struct RenderingDeviceD3D12ShaderBinaryDataBinding { + // - Phase 1. + uint32_t type; + uint32_t binding; + uint32_t stages; + uint32_t length; // Size of arrays (in total elements), or ubos (in bytes * total elements). + uint32_t writable; + // - Phase 2. + uint32_t res_class; + uint32_t has_sampler; + uint32_t dxil_stages; + struct RootSignatureLocation { + uint32_t root_param_idx = UINT32_MAX; // UINT32_MAX if unused. + uint32_t range_idx = UINT32_MAX; // UINT32_MAX if unused. + }; + RootSignatureLocation root_sig_locations[2]; // Index is RootSignatureLocationType. + + // We need to sort these to fill the root signature locations properly. + bool operator<(const RenderingDeviceD3D12ShaderBinaryDataBinding &p_other) const { + return binding < p_other.binding; + } +}; + +struct RenderingDeviceD3D12ShaderBinarySpecializationConstant { + // - Phase 1. + uint32_t type; + uint32_t constant_id; + union { + uint32_t int_value; + float float_value; + bool bool_value; + }; + // - Phase 2. + uint64_t stages_bit_offsets[D3D12_BITCODE_OFFSETS_NUM_STAGES]; +}; + +struct RenderingDeviceD3D12ShaderBinaryData { + uint64_t vertex_input_mask; + uint32_t fragment_output_mask; + uint32_t specialization_constants_count; + uint32_t spirv_specialization_constants_ids_mask; + uint32_t is_compute; + uint32_t compute_local_size[3]; + uint32_t set_count; + uint32_t push_constant_size; + uint32_t dxil_push_constant_stages; // Phase 2. + uint32_t nir_runtime_data_root_param_idx; // Phase 2. + uint32_t stage_count; + uint32_t shader_name_len; + uint32_t root_signature_len; + uint32_t root_signature_crc; +}; + +Vector<uint8_t> RenderingDeviceD3D12::shader_compile_binary_from_spirv(const Vector<ShaderStageSPIRVData> &p_spirv, const String &p_shader_name) { + SpirvReflectionData spirv_data; + if (_reflect_spirv(p_spirv, spirv_data) != OK) { + return Vector<uint8_t>(); + } + + // Collect reflection data into binary data. + RenderingDeviceD3D12ShaderBinaryData binary_data = {}; + Vector<Vector<RenderingDeviceD3D12ShaderBinaryDataBinding>> uniform_info; + Vector<RenderingDeviceD3D12ShaderBinarySpecializationConstant> specialization_constants; + { + binary_data.vertex_input_mask = spirv_data.vertex_input_mask; + binary_data.fragment_output_mask = spirv_data.fragment_output_mask; + binary_data.specialization_constants_count = spirv_data.specialization_constants.size(); + binary_data.is_compute = spirv_data.is_compute; + binary_data.compute_local_size[0] = spirv_data.compute_local_size[0]; + binary_data.compute_local_size[1] = spirv_data.compute_local_size[1]; + binary_data.compute_local_size[2] = spirv_data.compute_local_size[2]; + binary_data.set_count = spirv_data.uniforms.size(); + binary_data.push_constant_size = spirv_data.push_constant_size; + binary_data.nir_runtime_data_root_param_idx = UINT32_MAX; + binary_data.stage_count = p_spirv.size(); + + for (const Vector<SpirvReflectionData::Uniform> &spirv_set : spirv_data.uniforms) { + Vector<RenderingDeviceD3D12ShaderBinaryDataBinding> set_bindings; + for (const SpirvReflectionData::Uniform &spirv_uniform : spirv_set) { + RenderingDeviceD3D12ShaderBinaryDataBinding binding{}; + binding.type = (uint32_t)spirv_uniform.type; + binding.binding = spirv_uniform.binding; + binding.stages = (uint32_t)spirv_uniform.stages_mask; + binding.length = spirv_uniform.length; + binding.writable = (uint32_t)spirv_uniform.writable; + set_bindings.push_back(binding); + } + uniform_info.push_back(set_bindings); + } + + for (const SpirvReflectionData::SpecializationConstant &spirv_sc : spirv_data.specialization_constants) { + RenderingDeviceD3D12ShaderBinarySpecializationConstant spec_constant{}; + spec_constant.type = (uint32_t)spirv_sc.type; + spec_constant.constant_id = spirv_sc.constant_id; + spec_constant.int_value = spirv_sc.int_value; + specialization_constants.push_back(spec_constant); + + binary_data.spirv_specialization_constants_ids_mask |= (1 << spirv_sc.constant_id); + } + } + + // Translate SPIR-V shaders to DXIL, and collect shader info from the new representation. + HashMap<ShaderStage, Vector<uint8_t>> dxil_blobs; + BitField<ShaderStage> stages_processed; + { + HashMap<int, nir_shader *> stages_nir_shaders; + + auto free_nir_shaders = [&]() { + for (KeyValue<int, nir_shader *> &E : stages_nir_shaders) { + ralloc_free(E.value); + } + stages_nir_shaders.clear(); + }; + + // This is based on spirv2dxil.c. May need updates when it changes. + // Also, this has to stay around until after linking. + nir_shader_compiler_options nir_options = *dxil_get_nir_compiler_options(); + nir_options.lower_base_vertex = false; + + dxil_spirv_runtime_conf dxil_runtime_conf = {}; + dxil_runtime_conf.runtime_data_cbv.register_space = RUNTIME_DATA_SPACE; + dxil_runtime_conf.runtime_data_cbv.base_shader_register = RUNTIME_DATA_REGISTER; + dxil_runtime_conf.push_constant_cbv.register_space = ROOT_CONSTANT_SPACE; + dxil_runtime_conf.push_constant_cbv.base_shader_register = ROOT_CONSTANT_REGISTER; + dxil_runtime_conf.zero_based_vertex_instance_id = true; + dxil_runtime_conf.zero_based_compute_workgroup_id = true; + dxil_runtime_conf.declared_read_only_images_as_srvs = true; + // Making this explicit to let maintainers know that in practice this didn't improve performance, + // probably because data generated by one shader and consumed by another one forces the resource + // to transition from UAV to SRV, and back, instead of being an UAV all the time. + // In case someone wants to try, care must be taken so in case of incompatible bindings across stages + // happen as a result, all the stages are re-translated. That can happen if, for instance, a stage only + // uses an allegedly writable resource only for reading but the next stage doesn't. + dxil_runtime_conf.inferred_read_only_images_as_srvs = false; + + // - Translate SPIR-V to NIR. + for (int i = 0; i < p_spirv.size(); i++) { + ShaderStage stage = (ShaderStage)p_spirv[i].shader_stage; + ShaderStage stage_flag = (ShaderStage)(1 << p_spirv[i].shader_stage); + + stages_processed.set_flag(stage_flag); + + { + char *entry_point = "main"; + + static const gl_shader_stage SPIRV_TO_MESA_STAGES[SHADER_STAGE_MAX] = { + /* SHADER_STAGE_VERTEX */ MESA_SHADER_VERTEX, + /* SHADER_STAGE_FRAGMENT */ MESA_SHADER_FRAGMENT, + /* SHADER_STAGE_TESSELATION_CONTROL */ MESA_SHADER_TESS_CTRL, + /* SHADER_STAGE_TESSELATION_EVALUATION */ MESA_SHADER_TESS_EVAL, + /* SHADER_STAGE_COMPUTE */ MESA_SHADER_COMPUTE, + }; + + nir_shader *nir_shader = spirv_to_nir( + (const uint32_t *)p_spirv[i].spir_v.ptr(), + p_spirv[i].spir_v.size() / sizeof(uint32_t), + nullptr, + 0, + SPIRV_TO_MESA_STAGES[stage], + entry_point, + dxil_spirv_nir_get_spirv_options(), &nir_options); + if (!nir_shader) { + free_nir_shaders(); + ERR_FAIL_V_MSG(Vector<uint8_t>(), "Shader translation (step 1) at stage " + String(shader_stage_names[stage]) + " failed."); + } + +#ifdef DEV_ENABLED + nir_validate_shader(nir_shader, "Validate before feeding NIR to the DXIL compiler"); +#endif + + if (stage == SHADER_STAGE_VERTEX) { + dxil_runtime_conf.yz_flip.y_mask = 0xffff; + dxil_runtime_conf.yz_flip.mode = DXIL_SPIRV_Y_FLIP_UNCONDITIONAL; + } else { + dxil_runtime_conf.yz_flip.y_mask = 0; + dxil_runtime_conf.yz_flip.mode = DXIL_SPIRV_YZ_FLIP_NONE; + } + + // This is based on spirv2dxil.c. May need updates when it changes. + dxil_spirv_nir_prep(nir_shader); + bool requires_runtime_data = {}; + dxil_spirv_nir_passes(nir_shader, &dxil_runtime_conf, &requires_runtime_data); + + stages_nir_shaders[stage] = nir_shader; + } + } + + // - Link NIR shaders. + for (int i = SHADER_STAGE_MAX - 1; i >= 0; i--) { + if (!stages_nir_shaders.has(i)) { + continue; + } + nir_shader *shader = stages_nir_shaders[i]; + nir_shader *prev_shader = nullptr; + for (int j = i - 1; j >= 0; j--) { + if (stages_nir_shaders.has(j)) { + prev_shader = stages_nir_shaders[j]; + break; + } + } + if (prev_shader) { + bool requires_runtime_data = {}; + dxil_spirv_nir_link(shader, prev_shader, &dxil_runtime_conf, &requires_runtime_data); + } + } + + // - Translate NIR to DXIL. + for (int i = 0; i < p_spirv.size(); i++) { + ShaderStage stage = (ShaderStage)p_spirv[i].shader_stage; + + struct ShaderData { + ShaderStage stage; + RenderingDeviceD3D12ShaderBinaryData &binary_data; + Vector<Vector<RenderingDeviceD3D12ShaderBinaryDataBinding>> &uniform_info; + Vector<RenderingDeviceD3D12ShaderBinarySpecializationConstant> &specialization_constants; + } shader_data{ stage, binary_data, uniform_info, specialization_constants }; + + GodotNirCallbacks godot_nir_callbacks = {}; + godot_nir_callbacks.data = &shader_data; + + godot_nir_callbacks.report_resource = [](uint32_t p_register, uint32_t p_space, uint32_t p_dxil_type, void *p_data) { + ShaderData &shader_data = *(ShaderData *)p_data; + + // Types based on Mesa's dxil_container.h. + static const uint32_t DXIL_RES_SAMPLER = 1; + static const ResourceClass DXIL_TYPE_TO_CLASS[] = { + /* DXIL_RES_INVALID */ RES_CLASS_INVALID, + /* DXIL_RES_SAMPLER */ RES_CLASS_INVALID, // Handling sampler as a flag. + /* DXIL_RES_CBV */ RES_CLASS_CBV, + /* DXIL_RES_SRV_TYPED */ RES_CLASS_SRV, + /* DXIL_RES_SRV_RAW */ RES_CLASS_SRV, + /* DXIL_RES_SRV_STRUCTURED */ RES_CLASS_SRV, + /* DXIL_RES_UAV_TYPED */ RES_CLASS_UAV, + /* DXIL_RES_UAV_RAW */ RES_CLASS_UAV, + /* DXIL_RES_UAV_STRUCTURED */ RES_CLASS_UAV, + /* DXIL_RES_UAV_STRUCTURED_WITH_COUNTER */ RES_CLASS_INVALID, + }; + DEV_ASSERT(p_dxil_type < ARRAY_SIZE(DXIL_TYPE_TO_CLASS)); + ResourceClass res_class = DXIL_TYPE_TO_CLASS[p_dxil_type]; + + if (p_register == ROOT_CONSTANT_REGISTER && p_space == ROOT_CONSTANT_SPACE) { + DEV_ASSERT(res_class == RES_CLASS_CBV); + shader_data.binary_data.dxil_push_constant_stages |= (1 << shader_data.stage); + } else if (p_register == RUNTIME_DATA_REGISTER && p_space == RUNTIME_DATA_SPACE) { + DEV_ASSERT(res_class == RES_CLASS_CBV); + shader_data.binary_data.nir_runtime_data_root_param_idx = 1; // Temporary, to be determined later. + } else { + DEV_ASSERT(p_space == 0); + + uint32_t set = p_register / GODOT_NIR_DESCRIPTOR_SET_MULTIPLIER; + uint32_t binding = (p_register % GODOT_NIR_DESCRIPTOR_SET_MULTIPLIER) / GODOT_NIR_BINDING_MULTIPLIER; + + DEV_ASSERT(set < (uint32_t)shader_data.uniform_info.size()); + bool found = false; + for (int i = 0; i < shader_data.uniform_info[set].size(); i++) { + if (shader_data.uniform_info[set][i].binding != binding) { + continue; + } + + RenderingDeviceD3D12ShaderBinaryDataBinding &binding_info = shader_data.uniform_info.write[set].write[i]; + + binding_info.dxil_stages |= (1 << shader_data.stage); + + if (res_class != RES_CLASS_INVALID) { + DEV_ASSERT(binding_info.res_class == (uint32_t)RES_CLASS_INVALID || binding_info.res_class == (uint32_t)res_class); + binding_info.res_class = res_class; + } else if (p_dxil_type == DXIL_RES_SAMPLER) { + binding_info.has_sampler = (uint32_t) true; + } else { + CRASH_NOW(); + } + + found = true; + break; + } + DEV_ASSERT(found); + } + }; + + godot_nir_callbacks.report_sc_bit_offset_fn = [](uint32_t p_sc_id, uint64_t p_bit_offset, void *p_data) { + ShaderData &shader_data = *(ShaderData *)p_data; + + bool found = false; + for (int i = 0; i < shader_data.specialization_constants.size(); i++) { + if (shader_data.specialization_constants[i].constant_id != p_sc_id) { + continue; + } + + uint32_t offset_idx = shader_stage_bit_offset_indices[shader_data.stage]; + DEV_ASSERT(shader_data.specialization_constants.write[i].stages_bit_offsets[offset_idx] == 0); + shader_data.specialization_constants.write[i].stages_bit_offsets[offset_idx] = p_bit_offset; + + found = true; + break; + } + DEV_ASSERT(found); + }; + + godot_nir_callbacks.report_bitcode_bit_offset_fn = [](uint64_t p_bit_offset, void *p_data) { + DEV_ASSERT(p_bit_offset % 8 == 0); + ShaderData &shader_data = *(ShaderData *)p_data; + uint32_t offset_idx = shader_stage_bit_offset_indices[shader_data.stage]; + for (int i = 0; i < shader_data.specialization_constants.size(); i++) { + if (shader_data.specialization_constants.write[i].stages_bit_offsets[offset_idx] == 0) { + // This SC has been optimized out from this stage. + continue; + } + shader_data.specialization_constants.write[i].stages_bit_offsets[offset_idx] += p_bit_offset; + } + }; + + auto shader_model_d3d_to_dxil = [](D3D_SHADER_MODEL p_d3d_shader_model) -> dxil_shader_model { + static_assert(SHADER_MODEL_6_0 == 0x60000); + static_assert(SHADER_MODEL_6_3 == 0x60003); + static_assert(D3D_SHADER_MODEL_6_0 == 0x60); + static_assert(D3D_SHADER_MODEL_6_3 == 0x63); + return (dxil_shader_model)((p_d3d_shader_model >> 4) * 0x10000 + (p_d3d_shader_model & 0xf)); + }; + + nir_to_dxil_options nir_to_dxil_options = {}; + nir_to_dxil_options.environment = DXIL_ENVIRONMENT_VULKAN; + nir_to_dxil_options.shader_model_max = shader_model_d3d_to_dxil(context->get_shader_capabilities().shader_model); + nir_to_dxil_options.validator_version_max = dxil_get_validator_version(get_dxil_validator_for_current_thread()); + nir_to_dxil_options.godot_nir_callbacks = &godot_nir_callbacks; + + dxil_logger logger = {}; + logger.log = [](void *p_priv, const char *p_msg) { +#ifdef DEBUG_ENABLED + print_verbose(p_msg); +#endif + }; + + blob dxil_blob = {}; + bool ok = nir_to_dxil(stages_nir_shaders[stage], &nir_to_dxil_options, &logger, &dxil_blob); + ralloc_free(stages_nir_shaders[stage]); + stages_nir_shaders.erase(stage); + if (!ok) { + free_nir_shaders(); + ERR_FAIL_V_MSG(Vector<uint8_t>(), "Shader translation at stage " + String(shader_stage_names[stage]) + " failed."); + } + + Vector<uint8_t> blob_copy; + blob_copy.resize(dxil_blob.size); + memcpy(blob_copy.ptrw(), dxil_blob.data, dxil_blob.size); + blob_finish(&dxil_blob); + dxil_blobs.insert(stage, blob_copy); + } + } + +#if 0 + if (dxil_blobs.has(SHADER_STAGE_FRAGMENT)) { + Ref<FileAccess> f = FileAccess::open("res://1.dxil", FileAccess::WRITE); + f->store_buffer(dxil_blobs[SHADER_STAGE_FRAGMENT].ptr(), dxil_blobs[SHADER_STAGE_FRAGMENT].size()); + } +#endif + + // Patch with default values of specialization constants. + if (specialization_constants.size()) { + for (const RenderingDeviceD3D12ShaderBinarySpecializationConstant &sc : specialization_constants) { + _shader_patch_dxil_specialization_constant((PipelineSpecializationConstantType)sc.type, &sc.int_value, sc.stages_bit_offsets, dxil_blobs, true); + } +#if 0 + if (dxil_blobs.has(SHADER_STAGE_FRAGMENT)) { + Ref<FileAccess> f = FileAccess::open("res://2.dxil", FileAccess::WRITE); + f->store_buffer(dxil_blobs[SHADER_STAGE_FRAGMENT].ptr(), dxil_blobs[SHADER_STAGE_FRAGMENT].size()); + } +#endif + } + + // Sign. + for (KeyValue<ShaderStage, Vector<uint8_t>> &E : dxil_blobs) { + ShaderStage stage = E.key; + Vector<uint8_t> &dxil_blob = E.value; + bool sign_ok = _shader_sign_dxil_bytecode(stage, dxil_blob); + ERR_FAIL_COND_V(!sign_ok, Vector<uint8_t>()); + } + + // Build the root signature. + ComPtr<ID3DBlob> root_sig_blob; + { + auto stages_to_d3d12_visibility = [](uint32_t p_stages_mask) -> D3D12_SHADER_VISIBILITY { + switch (p_stages_mask) { + case SHADER_STAGE_VERTEX_BIT: { + return D3D12_SHADER_VISIBILITY_VERTEX; + } + case SHADER_STAGE_FRAGMENT_BIT: { + return D3D12_SHADER_VISIBILITY_PIXEL; + } + default: { + return D3D12_SHADER_VISIBILITY_ALL; + } + } + }; + + LocalVector<D3D12_ROOT_PARAMETER1> root_params; + + // Root (push) constants. + if (binary_data.dxil_push_constant_stages) { + CD3DX12_ROOT_PARAMETER1 push_constant; + push_constant.InitAsConstants( + binary_data.push_constant_size / sizeof(uint32_t), + ROOT_CONSTANT_REGISTER, + ROOT_CONSTANT_SPACE, + stages_to_d3d12_visibility(binary_data.dxil_push_constant_stages)); + root_params.push_back(push_constant); + } + + // NIR-DXIL runtime data. + if (binary_data.nir_runtime_data_root_param_idx == 1) { // Set above to 1 when discovering runtime data is needed. + DEV_ASSERT(!binary_data.is_compute); // Could be supported if needed, but it's pointless as of now. + binary_data.nir_runtime_data_root_param_idx = root_params.size(); + CD3DX12_ROOT_PARAMETER1 nir_runtime_data; + nir_runtime_data.InitAsConstants( + sizeof(dxil_spirv_vertex_runtime_data) / sizeof(uint32_t), + RUNTIME_DATA_REGISTER, + RUNTIME_DATA_SPACE, + D3D12_SHADER_VISIBILITY_VERTEX); + root_params.push_back(nir_runtime_data); + } + + // Descriptor tables (up to two per uniform set, for resources and/or samplers). + + // These have to stay around until serialization! + struct TraceableDescriptorTable { + uint32_t stages_mask = {}; + Vector<D3D12_DESCRIPTOR_RANGE1> ranges; + Vector<RenderingDeviceD3D12ShaderBinaryDataBinding::RootSignatureLocation *> root_sig_locations; + }; + Vector<TraceableDescriptorTable> resource_tables_maps; + Vector<TraceableDescriptorTable> sampler_tables_maps; + + for (int set = 0; set < uniform_info.size(); set++) { + bool first_resource_in_set = true; + bool first_sampler_in_set = true; + uniform_info.write[set].sort(); + for (int i = 0; i < uniform_info[set].size(); i++) { + const RenderingDeviceD3D12ShaderBinaryDataBinding &binding = uniform_info[set][i]; + + bool really_used = binding.dxil_stages != 0; +#ifdef DEV_ENABLED + bool anybody_home = (ResourceClass)binding.res_class != RES_CLASS_INVALID || binding.has_sampler; + DEV_ASSERT(anybody_home == really_used); +#endif + if (!really_used) { + continue; // Existed in SPIR-V; went away in DXIL. + } + + auto insert_range = [](D3D12_DESCRIPTOR_RANGE_TYPE p_range_type, + uint32_t p_num_descriptors, + uint32_t p_dxil_register, + uint32_t p_dxil_stages_mask, + RenderingDeviceD3D12ShaderBinaryDataBinding::RootSignatureLocation(&p_root_sig_locations), + Vector<TraceableDescriptorTable> &r_tables, + bool &r_first_in_set) { + if (r_first_in_set) { + r_tables.resize(r_tables.size() + 1); + r_first_in_set = false; + } + TraceableDescriptorTable &table = r_tables.write[r_tables.size() - 1]; + table.stages_mask |= p_dxil_stages_mask; + + CD3DX12_DESCRIPTOR_RANGE1 range; + // Due to the aliasing hack for SRV-UAV of different families, + // we can be causing an unintended change of data (sometimes the validation layers catch it). + D3D12_DESCRIPTOR_RANGE_FLAGS flags = D3D12_DESCRIPTOR_RANGE_FLAG_NONE; + if (p_range_type == D3D12_DESCRIPTOR_RANGE_TYPE_SRV || p_range_type == D3D12_DESCRIPTOR_RANGE_TYPE_UAV) { + flags = D3D12_DESCRIPTOR_RANGE_FLAG_DATA_VOLATILE; + } else if (p_range_type == D3D12_DESCRIPTOR_RANGE_TYPE_CBV) { + flags = D3D12_DESCRIPTOR_RANGE_FLAG_DATA_STATIC_WHILE_SET_AT_EXECUTE; + } + range.Init(p_range_type, p_num_descriptors, p_dxil_register, 0, flags); + + table.ranges.push_back(range); + table.root_sig_locations.push_back(&p_root_sig_locations); + }; + + uint32_t num_descriptors = 1; + + D3D12_DESCRIPTOR_RANGE_TYPE resource_range_type = {}; + switch ((ResourceClass)binding.res_class) { + case RES_CLASS_INVALID: { + num_descriptors = binding.length; + DEV_ASSERT(binding.has_sampler); + } break; + case RES_CLASS_CBV: { + resource_range_type = D3D12_DESCRIPTOR_RANGE_TYPE_CBV; + DEV_ASSERT(!binding.has_sampler); + } break; + case RES_CLASS_SRV: { + resource_range_type = D3D12_DESCRIPTOR_RANGE_TYPE_SRV; + num_descriptors = MAX(1u, binding.length); // An unbound R/O buffer is reflected as zero-size. + } break; + case RES_CLASS_UAV: { + resource_range_type = D3D12_DESCRIPTOR_RANGE_TYPE_UAV; + num_descriptors = MAX(1u, binding.length); // An unbound R/W buffer is reflected as zero-size. + DEV_ASSERT(!binding.has_sampler); + } break; + } + + uint32_t dxil_register = set * GODOT_NIR_DESCRIPTOR_SET_MULTIPLIER + binding.binding * GODOT_NIR_BINDING_MULTIPLIER; + + if (binding.res_class != RES_CLASS_INVALID) { + insert_range( + resource_range_type, + num_descriptors, + dxil_register, + uniform_info[set][i].dxil_stages, + uniform_info.write[set].write[i].root_sig_locations[RS_LOC_TYPE_RESOURCE], + resource_tables_maps, + first_resource_in_set); + } + if (binding.has_sampler) { + insert_range( + D3D12_DESCRIPTOR_RANGE_TYPE_SAMPLER, + num_descriptors, + dxil_register, + uniform_info[set][i].dxil_stages, + uniform_info.write[set].write[i].root_sig_locations[RS_LOC_TYPE_SAMPLER], + sampler_tables_maps, + first_sampler_in_set); + } + } + } + + auto make_descriptor_tables = [&root_params, &stages_to_d3d12_visibility](const Vector<TraceableDescriptorTable> &p_tables) { + for (const TraceableDescriptorTable &table : p_tables) { + D3D12_SHADER_VISIBILITY visibility = stages_to_d3d12_visibility(table.stages_mask); + DEV_ASSERT(table.ranges.size() == table.root_sig_locations.size()); + for (int i = 0; i < table.ranges.size(); i++) { + // By now we know very well which root signature location corresponds to the pointed uniform. + table.root_sig_locations[i]->root_param_idx = root_params.size(); + table.root_sig_locations[i]->range_idx = i; + } + + CD3DX12_ROOT_PARAMETER1 root_table; + root_table.InitAsDescriptorTable(table.ranges.size(), table.ranges.ptr(), visibility); + root_params.push_back(root_table); + } + }; + + make_descriptor_tables(resource_tables_maps); + make_descriptor_tables(sampler_tables_maps); + + CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC root_sig_desc = {}; + D3D12_ROOT_SIGNATURE_FLAGS root_sig_flags = + D3D12_ROOT_SIGNATURE_FLAG_DENY_HULL_SHADER_ROOT_ACCESS | + D3D12_ROOT_SIGNATURE_FLAG_DENY_DOMAIN_SHADER_ROOT_ACCESS | + D3D12_ROOT_SIGNATURE_FLAG_DENY_GEOMETRY_SHADER_ROOT_ACCESS | + D3D12_ROOT_SIGNATURE_FLAG_DENY_AMPLIFICATION_SHADER_ROOT_ACCESS | + D3D12_ROOT_SIGNATURE_FLAG_DENY_MESH_SHADER_ROOT_ACCESS; + if (!stages_processed.has_flag(SHADER_STAGE_VERTEX_BIT)) { + root_sig_flags |= D3D12_ROOT_SIGNATURE_FLAG_DENY_VERTEX_SHADER_ROOT_ACCESS; + } + if (!stages_processed.has_flag(SHADER_STAGE_FRAGMENT_BIT)) { + root_sig_flags |= D3D12_ROOT_SIGNATURE_FLAG_DENY_PIXEL_SHADER_ROOT_ACCESS; + } + if (binary_data.vertex_input_mask) { + root_sig_flags |= D3D12_ROOT_SIGNATURE_FLAG_ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT; + } + root_sig_desc.Init_1_1(root_params.size(), root_params.ptr(), 0, nullptr, root_sig_flags); + + ComPtr<ID3DBlob> error_blob; + HRESULT res = D3DX12SerializeVersionedRootSignature(&root_sig_desc, D3D_ROOT_SIGNATURE_VERSION_1_1, root_sig_blob.GetAddressOf(), error_blob.GetAddressOf()); + ERR_FAIL_COND_V_MSG(res, Vector<uint8_t>(), + "Serialization of root signature failed with error " + vformat("0x%08ux", res) + " and the following message:\n" + String((char *)error_blob->GetBufferPointer(), error_blob->GetBufferSize())); + + binary_data.root_signature_crc = crc32(0, nullptr, 0); + binary_data.root_signature_crc = crc32(binary_data.root_signature_crc, (const Bytef *)root_sig_blob->GetBufferPointer(), root_sig_blob->GetBufferSize()); + } + + Vector<Vector<uint8_t>> compressed_stages; + Vector<uint32_t> zstd_size; + + uint32_t stages_binary_size = 0; + + for (int i = 0; i < p_spirv.size(); i++) { + Vector<uint8_t> zstd; + Vector<uint8_t> &dxil_blob = dxil_blobs[p_spirv[i].shader_stage]; + zstd.resize(Compression::get_max_compressed_buffer_size(dxil_blob.size(), Compression::MODE_ZSTD)); + int dst_size = Compression::compress(zstd.ptrw(), dxil_blob.ptr(), dxil_blob.size(), Compression::MODE_ZSTD); + + zstd_size.push_back(dst_size); + zstd.resize(dst_size); + compressed_stages.push_back(zstd); + + uint32_t s = compressed_stages[i].size(); + if (s % 4 != 0) { + s += 4 - (s % 4); + } + stages_binary_size += s; + } + + CharString shader_name_utf = p_shader_name.utf8(); + + binary_data.shader_name_len = shader_name_utf.length(); + + uint32_t total_size = sizeof(uint32_t) * 3; // Header + version + main datasize;. + total_size += sizeof(RenderingDeviceD3D12ShaderBinaryData); + + total_size += binary_data.shader_name_len; + if ((binary_data.shader_name_len % 4) != 0) { // Alignment rules are really strange. + total_size += 4 - (binary_data.shader_name_len % 4); + } + + for (int i = 0; i < uniform_info.size(); i++) { + total_size += sizeof(uint32_t); + total_size += uniform_info[i].size() * sizeof(RenderingDeviceD3D12ShaderBinaryDataBinding); + } + + total_size += sizeof(RenderingDeviceD3D12ShaderBinarySpecializationConstant) * specialization_constants.size(); + + total_size += compressed_stages.size() * sizeof(uint32_t) * 3; // Sizes. + total_size += stages_binary_size; + + binary_data.root_signature_len = root_sig_blob->GetBufferSize(); + total_size += binary_data.root_signature_len; + + Vector<uint8_t> ret; + ret.resize(total_size); + { + uint32_t offset = 0; + uint8_t *binptr = ret.ptrw(); + binptr[0] = 'G'; + binptr[1] = 'S'; + binptr[2] = 'B'; + binptr[3] = 'D'; // Godot shader binary data. + offset += 4; + encode_uint32(SHADER_BINARY_VERSION, binptr + offset); + offset += sizeof(uint32_t); + encode_uint32(sizeof(RenderingDeviceD3D12ShaderBinaryData), binptr + offset); + offset += sizeof(uint32_t); + memcpy(binptr + offset, &binary_data, sizeof(RenderingDeviceD3D12ShaderBinaryData)); + offset += sizeof(RenderingDeviceD3D12ShaderBinaryData); + + if (binary_data.shader_name_len > 0) { + memcpy(binptr + offset, shader_name_utf.ptr(), binary_data.shader_name_len); + offset += binary_data.shader_name_len; + + if ((binary_data.shader_name_len % 4) != 0) { // Alignment rules are really strange. + offset += 4 - (binary_data.shader_name_len % 4); + } + } + + for (int i = 0; i < uniform_info.size(); i++) { + int count = uniform_info[i].size(); + encode_uint32(count, binptr + offset); + offset += sizeof(uint32_t); + if (count > 0) { + memcpy(binptr + offset, uniform_info[i].ptr(), sizeof(RenderingDeviceD3D12ShaderBinaryDataBinding) * count); + offset += sizeof(RenderingDeviceD3D12ShaderBinaryDataBinding) * count; + } + } + + if (specialization_constants.size()) { + memcpy(binptr + offset, specialization_constants.ptr(), sizeof(RenderingDeviceD3D12ShaderBinarySpecializationConstant) * specialization_constants.size()); + offset += sizeof(RenderingDeviceD3D12ShaderBinarySpecializationConstant) * specialization_constants.size(); + } + + for (int i = 0; i < compressed_stages.size(); i++) { + encode_uint32(p_spirv[i].shader_stage, binptr + offset); + offset += sizeof(uint32_t); + encode_uint32(dxil_blobs[p_spirv[i].shader_stage].size(), binptr + offset); + offset += sizeof(uint32_t); + encode_uint32(zstd_size[i], binptr + offset); + offset += sizeof(uint32_t); + memcpy(binptr + offset, compressed_stages[i].ptr(), compressed_stages[i].size()); + + uint32_t s = compressed_stages[i].size(); + + if (s % 4 != 0) { + s += 4 - (s % 4); + } + + offset += s; + } + + memcpy(binptr + offset, root_sig_blob->GetBufferPointer(), root_sig_blob->GetBufferSize()); + offset += root_sig_blob->GetBufferSize(); + + ERR_FAIL_COND_V(offset != (uint32_t)ret.size(), Vector<uint8_t>()); + } + + return ret; +} + +RID RenderingDeviceD3D12::shader_create_from_bytecode(const Vector<uint8_t> &p_shader_binary, RID p_placeholder) { + const uint8_t *binptr = p_shader_binary.ptr(); + uint32_t binsize = p_shader_binary.size(); + + uint32_t read_offset = 0; + // Consistency check. + ERR_FAIL_COND_V(binsize < sizeof(uint32_t) * 3 + sizeof(RenderingDeviceD3D12ShaderBinaryData), RID()); + ERR_FAIL_COND_V(binptr[0] != 'G' || binptr[1] != 'S' || binptr[2] != 'B' || binptr[3] != 'D', RID()); + + uint32_t bin_version = decode_uint32(binptr + 4); + ERR_FAIL_COND_V(bin_version != SHADER_BINARY_VERSION, RID()); + + uint32_t bin_data_size = decode_uint32(binptr + 8); + + const RenderingDeviceD3D12ShaderBinaryData &binary_data = *(reinterpret_cast<const RenderingDeviceD3D12ShaderBinaryData *>(binptr + 12)); + + uint64_t vertex_input_mask = binary_data.vertex_input_mask; + + uint32_t fragment_output_mask = binary_data.fragment_output_mask; + + bool is_compute = binary_data.is_compute; + + const uint32_t compute_local_size[3] = { binary_data.compute_local_size[0], binary_data.compute_local_size[1], binary_data.compute_local_size[2] }; + + read_offset += sizeof(uint32_t) * 3 + bin_data_size; + + String name; + + if (binary_data.shader_name_len) { + name.parse_utf8((const char *)(binptr + read_offset), binary_data.shader_name_len); + read_offset += binary_data.shader_name_len; + if ((binary_data.shader_name_len % 4) != 0) { // Alignment rules are really strange. + read_offset += 4 - (binary_data.shader_name_len % 4); + } + } + + Vector<Shader::Set> set_info; + set_info.resize(binary_data.set_count); + + for (uint32_t i = 0; i < binary_data.set_count; i++) { + ERR_FAIL_COND_V(read_offset + sizeof(uint32_t) >= binsize, RID()); + uint32_t set_count = decode_uint32(binptr + read_offset); + read_offset += sizeof(uint32_t); + const RenderingDeviceD3D12ShaderBinaryDataBinding *set_ptr = reinterpret_cast<const RenderingDeviceD3D12ShaderBinaryDataBinding *>(binptr + read_offset); + uint32_t set_size = set_count * sizeof(RenderingDeviceD3D12ShaderBinaryDataBinding); + ERR_FAIL_COND_V(read_offset + set_size >= binsize, RID()); + + for (uint32_t j = 0; j < set_count; j++) { + Shader::ShaderUniformInfo sui; + + sui.info.type = UniformType(set_ptr[j].type); + sui.info.writable = set_ptr[j].writable; + sui.info.length = set_ptr[j].length; + sui.info.binding = set_ptr[j].binding; + + sui.binding.stages = set_ptr[j].dxil_stages; + sui.binding.res_class = (ResourceClass)set_ptr[j].res_class; + static_assert(sizeof(UniformBindingInfo::root_sig_locations) == sizeof(RenderingDeviceD3D12ShaderBinaryDataBinding::root_sig_locations)); + memcpy(&sui.binding.root_sig_locations, &set_ptr[j].root_sig_locations, sizeof(UniformBindingInfo::root_sig_locations)); + + set_info.write[i].uniforms.push_back(sui); + + if (sui.binding.root_sig_locations.resource.root_param_idx != UINT32_MAX) { + set_info.write[i].num_root_params.resources++; + } + if (sui.binding.root_sig_locations.sampler.root_param_idx != UINT32_MAX) { + set_info.write[i].num_root_params.samplers++; + } + } + + read_offset += set_size; + } + + ERR_FAIL_COND_V(read_offset + binary_data.specialization_constants_count * sizeof(RenderingDeviceD3D12ShaderBinarySpecializationConstant) >= binsize, RID()); + + Vector<Shader::SpecializationConstant> specialization_constants; + + for (uint32_t i = 0; i < binary_data.specialization_constants_count; i++) { + const RenderingDeviceD3D12ShaderBinarySpecializationConstant &src_sc = *(reinterpret_cast<const RenderingDeviceD3D12ShaderBinarySpecializationConstant *>(binptr + read_offset)); + Shader::SpecializationConstant sc; + sc.constant.int_value = src_sc.int_value; + sc.constant.type = PipelineSpecializationConstantType(src_sc.type); + sc.constant.constant_id = src_sc.constant_id; + memcpy(sc.stages_bit_offsets, src_sc.stages_bit_offsets, sizeof(sc.stages_bit_offsets)); + specialization_constants.push_back(sc); + + read_offset += sizeof(RenderingDeviceD3D12ShaderBinarySpecializationConstant); + } + + HashMap<ShaderStage, Vector<uint8_t>> stages_bytecode; + + for (uint32_t i = 0; i < binary_data.stage_count; i++) { + ERR_FAIL_COND_V(read_offset + sizeof(uint32_t) * 3 >= binsize, RID()); + uint32_t stage = decode_uint32(binptr + read_offset); + read_offset += sizeof(uint32_t); + uint32_t dxil_size = decode_uint32(binptr + read_offset); + read_offset += sizeof(uint32_t); + uint32_t zstd_size = decode_uint32(binptr + read_offset); + read_offset += sizeof(uint32_t); + + // Decompress. + Vector<uint8_t> dxil; + dxil.resize(dxil_size); + int dec_dxil_size = Compression::decompress(dxil.ptrw(), dxil.size(), binptr + read_offset, zstd_size, Compression::MODE_ZSTD); + ERR_FAIL_COND_V(dec_dxil_size != (int32_t)dxil_size, RID()); + stages_bytecode[ShaderStage(stage)] = dxil; + + if (zstd_size % 4 != 0) { + zstd_size += 4 - (zstd_size % 4); + } + + ERR_FAIL_COND_V(read_offset + zstd_size > binsize, RID()); + + read_offset += zstd_size; + } + + const uint8_t *root_sig_data_ptr = binptr + read_offset; + + ComPtr<ID3D12RootSignatureDeserializer> root_sig_deserializer; + HRESULT res = D3D12CreateRootSignatureDeserializer(root_sig_data_ptr, binary_data.root_signature_len, IID_PPV_ARGS(root_sig_deserializer.GetAddressOf())); + ERR_FAIL_COND_V_MSG(res, RID(), "D3D12CreateRootSignatureDeserializer failed with error " + vformat("0x%08ux", res) + "."); + read_offset += binary_data.root_signature_len; + + ERR_FAIL_COND_V(read_offset != binsize, RID()); + + // TODO: Need to lock? + _THREAD_SAFE_METHOD_ + + ComPtr<ID3D12RootSignature> root_signature; + res = device->CreateRootSignature(0, root_sig_data_ptr, binary_data.root_signature_len, IID_PPV_ARGS(root_signature.GetAddressOf())); + ERR_FAIL_COND_V_MSG(res, RID(), "CreateRootSignature failed with error " + vformat("0x%08ux", res) + "."); + + RID id; + if (p_placeholder.is_null()) { + id = shader_owner.make_rid(); + } else { + id = p_placeholder; + } + + Shader *shader = shader_owner.get_or_null(id); + ERR_FAIL_NULL_V(shader, RID()); + + shader->vertex_input_mask = vertex_input_mask; + shader->fragment_output_mask = fragment_output_mask; + shader->spirv_push_constant_size = binary_data.push_constant_size; + shader->dxil_push_constant_size = binary_data.dxil_push_constant_stages ? binary_data.push_constant_size : 0; + shader->nir_runtime_data_root_param_idx = binary_data.nir_runtime_data_root_param_idx; + shader->is_compute = is_compute; + shader->compute_local_size[0] = compute_local_size[0]; + shader->compute_local_size[1] = compute_local_size[1]; + shader->compute_local_size[2] = compute_local_size[2]; + shader->specialization_constants = specialization_constants; + shader->spirv_specialization_constants_ids_mask = binary_data.spirv_specialization_constants_ids_mask; + shader->name = name; + shader->root_signature = root_signature; + shader->root_signature_deserializer = root_sig_deserializer; + shader->root_signature_desc = root_sig_deserializer->GetRootSignatureDesc(); + shader->root_signature_crc = binary_data.root_signature_crc; + shader->stages_bytecode = stages_bytecode; + + // Proceed to create descriptor sets. + for (uint32_t i = 0; i < binary_data.set_count; i++) { + uint32_t format = 0; // No format, default. + + Shader::Set &set = set_info.write[i]; + if (set.uniforms.size()) { + // Has data, needs an actual format;. + UniformSetFormat usformat; + usformat.uniform_info.resize(set.uniforms.size()); + for (int j = 0; j < set.uniforms.size(); j++) { + usformat.uniform_info.write[j] = set.uniforms[j].info; + } + RBMap<UniformSetFormat, uint32_t>::Element *E = uniform_set_format_cache.find(usformat); + if (E) { + format = E->get(); + } else { + format = uniform_set_format_cache.size() + 1; + E = uniform_set_format_cache.insert(usformat, format); + uniform_set_format_cache_reverse.push_back(E); + DEV_ASSERT(uniform_set_format_cache_reverse.size() == uniform_set_format_cache.size()); + } + } + + shader->sets.push_back(set); + shader->set_formats.push_back(format); + } + +#ifdef DEV_ENABLED + set_resource_name(id, "RID:" + itos(id.get_id())); +#endif + return id; +} + +RID RenderingDeviceD3D12::shader_create_placeholder() { + Shader shader; + return shader_owner.make_rid(shader); +} + +uint64_t RenderingDeviceD3D12::shader_get_vertex_input_attribute_mask(RID p_shader) { + _THREAD_SAFE_METHOD_ + + const Shader *shader = shader_owner.get_or_null(p_shader); + ERR_FAIL_NULL_V(shader, 0); + return shader->vertex_input_mask; +} + +/******************/ +/**** UNIFORMS ****/ +/******************/ + +RID RenderingDeviceD3D12::uniform_buffer_create(uint32_t p_size_bytes, const Vector<uint8_t> &p_data) { + _THREAD_SAFE_METHOD_ + + ERR_FAIL_COND_V(p_data.size() && (uint32_t)p_data.size() != p_size_bytes, RID()); + + Buffer buffer; + Error err = _buffer_allocate(&buffer, p_size_bytes, D3D12_RESOURCE_STATE_VERTEX_AND_CONSTANT_BUFFER, D3D12_HEAP_TYPE_DEFAULT); + ERR_FAIL_COND_V(err != OK, RID()); + + if (p_data.size()) { + uint64_t data_size = p_data.size(); + const uint8_t *r = p_data.ptr(); + _buffer_update(&buffer, 0, r, data_size); + } + RID id = uniform_buffer_owner.make_rid(buffer); +#ifdef DEV_ENABLED + set_resource_name(id, "RID:" + itos(id.get_id())); +#endif + return id; +} + +RID RenderingDeviceD3D12::storage_buffer_create(uint32_t p_size_bytes, const Vector<uint8_t> &p_data, BitField<StorageBufferUsage> p_usage) { + _THREAD_SAFE_METHOD_ + + ERR_FAIL_COND_V(p_data.size() && (uint32_t)p_data.size() != p_size_bytes, RID()); + + Buffer buffer; + D3D12_RESOURCE_STATES states = D3D12_RESOURCE_STATE_COPY_SOURCE | D3D12_RESOURCE_STATE_COPY_DEST | D3D12_RESOURCE_STATE_UNORDERED_ACCESS; + if (p_usage.has_flag(STORAGE_BUFFER_USAGE_DISPATCH_INDIRECT)) { + states |= D3D12_RESOURCE_STATE_INDIRECT_ARGUMENT; + } + Error err = _buffer_allocate(&buffer, p_size_bytes, states, D3D12_HEAP_TYPE_DEFAULT); + ERR_FAIL_COND_V(err != OK, RID()); + + if (p_data.size()) { + uint64_t data_size = p_data.size(); + const uint8_t *r = p_data.ptr(); + _buffer_update(&buffer, 0, r, data_size); + } + return storage_buffer_owner.make_rid(buffer); +} + +RID RenderingDeviceD3D12::texture_buffer_create(uint32_t p_size_elements, DataFormat p_format, const Vector<uint8_t> &p_data) { + _THREAD_SAFE_METHOD_ + + uint32_t element_size = get_format_vertex_size(p_format); + ERR_FAIL_COND_V_MSG(element_size == 0, RID(), "Format requested is not supported for texture buffers"); + uint64_t size_bytes = uint64_t(element_size) * p_size_elements; + + ERR_FAIL_COND_V(p_data.size() && (uint32_t)p_data.size() != size_bytes, RID()); + + TextureBuffer texture_buffer; + Error err = _buffer_allocate(&texture_buffer.buffer, size_bytes, D3D12_RESOURCE_STATE_ALL_SHADER_RESOURCE, D3D12_HEAP_TYPE_DEFAULT); + ERR_FAIL_COND_V(err != OK, RID()); + + if (p_data.size()) { + uint64_t data_size = p_data.size(); + const uint8_t *r = p_data.ptr(); + _buffer_update(&texture_buffer.buffer, 0, r, data_size); + } + + // Allocate the view. + RID id = texture_buffer_owner.make_rid(texture_buffer); +#ifdef DEV_ENABLED + set_resource_name(id, "RID:" + itos(id.get_id())); +#endif + return id; +} + +Error RenderingDeviceD3D12::DescriptorsHeap::allocate(ID3D12Device *p_device, D3D12_DESCRIPTOR_HEAP_TYPE p_type, uint32_t p_descriptor_count, bool p_for_gpu) { + ERR_FAIL_COND_V(heap, ERR_ALREADY_EXISTS); + ERR_FAIL_COND_V(p_descriptor_count == 0, ERR_INVALID_PARAMETER); + + handle_size = p_device->GetDescriptorHandleIncrementSize(p_type); + + desc.Type = p_type; + desc.NumDescriptors = p_descriptor_count; + desc.Flags = p_for_gpu ? D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE : D3D12_DESCRIPTOR_HEAP_FLAG_NONE; + HRESULT res = p_device->CreateDescriptorHeap(&desc, IID_PPV_ARGS(heap.GetAddressOf())); + ERR_FAIL_COND_V_MSG(res, ERR_CANT_CREATE, "CreateDescriptorHeap failed with error " + vformat("0x%08ux", res) + "."); + + return OK; +} + +RenderingDeviceD3D12::DescriptorsHeap::Walker RenderingDeviceD3D12::DescriptorsHeap::make_walker() const { + Walker walker; + walker.handle_size = handle_size; + walker.handle_count = desc.NumDescriptors; + if (heap) { + walker.first_cpu_handle = heap->GetCPUDescriptorHandleForHeapStart(); + if ((desc.Flags & D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE)) { + walker.first_gpu_handle = heap->GetGPUDescriptorHandleForHeapStart(); + } + } + return walker; +} + +void RenderingDeviceD3D12::DescriptorsHeap::Walker::advance(uint32_t p_count) { + ERR_FAIL_COND_MSG(handle_index + p_count > handle_count, "Would advance past EOF."); + handle_index += p_count; +} + +D3D12_CPU_DESCRIPTOR_HANDLE RenderingDeviceD3D12::DescriptorsHeap::Walker::get_curr_cpu_handle() { + ERR_FAIL_COND_V_MSG(is_at_eof(), D3D12_CPU_DESCRIPTOR_HANDLE(), "Heap walker is at EOF."); + return D3D12_CPU_DESCRIPTOR_HANDLE{ first_cpu_handle.ptr + handle_index * handle_size }; +} + +D3D12_GPU_DESCRIPTOR_HANDLE RenderingDeviceD3D12::DescriptorsHeap::Walker::get_curr_gpu_handle() { + ERR_FAIL_COND_V_MSG(!first_gpu_handle.ptr, D3D12_GPU_DESCRIPTOR_HANDLE(), "Can't provide a GPU handle from a non-GPU descriptors heap."); + ERR_FAIL_COND_V_MSG(is_at_eof(), D3D12_GPU_DESCRIPTOR_HANDLE(), "Heap walker is at EOF."); + return D3D12_GPU_DESCRIPTOR_HANDLE{ first_gpu_handle.ptr + handle_index * handle_size }; +} + +static void _add_descriptor_count_for_uniform(RenderingDevice::UniformType p_type, uint32_t p_binding_length, bool p_dobule_srv_uav_ambiguous, uint32_t &r_num_resources, uint32_t &r_num_samplers, bool &r_srv_uav_ambiguity) { + r_srv_uav_ambiguity = false; + + // Some resource types can be SRV or UAV, depending on what NIR-DXIL decided for a specific shader variant. + // The goal is to generate both SRV and UAV for the descriptor sets' heaps and copy only the relevant one + // to the frame descriptor heap at binding time. + // [[SRV_UAV_AMBIGUITY]] + + switch (p_type) { + case RenderingDevice::UNIFORM_TYPE_SAMPLER: { + r_num_samplers += p_binding_length; + } break; + case RenderingDevice::UNIFORM_TYPE_SAMPLER_WITH_TEXTURE: + case RenderingDevice::UNIFORM_TYPE_SAMPLER_WITH_TEXTURE_BUFFER: { + r_num_resources += p_binding_length; + r_num_samplers += p_binding_length; + } break; + case RenderingDevice::UNIFORM_TYPE_UNIFORM_BUFFER: { + r_num_resources += 1; + } break; + case RenderingDevice::UNIFORM_TYPE_STORAGE_BUFFER: { + r_num_resources += p_dobule_srv_uav_ambiguous ? 2 : 1; + r_srv_uav_ambiguity = true; + } break; + case RenderingDevice::UNIFORM_TYPE_IMAGE: { + r_num_resources += p_binding_length * (p_dobule_srv_uav_ambiguous ? 2 : 1); + r_srv_uav_ambiguity = true; + } break; + default: { + r_num_resources += p_binding_length; + } + } +} + +RID RenderingDeviceD3D12::uniform_set_create(const Vector<Uniform> &p_uniforms, RID p_shader, uint32_t p_shader_set) { + _THREAD_SAFE_METHOD_ + + ERR_FAIL_COND_V(p_uniforms.size() == 0, RID()); + + Shader *shader = shader_owner.get_or_null(p_shader); + ERR_FAIL_NULL_V(shader, RID()); + + ERR_FAIL_COND_V_MSG(p_shader_set >= (uint32_t)shader->sets.size() || shader->sets[p_shader_set].uniforms.size() == 0, RID(), + "Desired set (" + itos(p_shader_set) + ") not used by shader."); + // See that all sets in shader are satisfied. + + const Shader::Set &set = shader->sets[p_shader_set]; + + uint32_t uniform_count = p_uniforms.size(); + const Uniform *uniforms = p_uniforms.ptr(); + + uint32_t set_uniform_count = set.uniforms.size(); + const Shader::ShaderUniformInfo *set_uniforms = set.uniforms.ptr(); + + // Do a first pass to count resources and samplers, and error checking. + uint32_t num_resource_descs = 0; + uint32_t num_sampler_descs = 0; + LocalVector<int> uniform_indices; + uniform_indices.resize(set_uniform_count); + for (uint32_t i = 0; i < set_uniform_count; i++) { + const UniformInfo &set_uniform = set_uniforms[i].info; + int uniform_idx = -1; + for (int j = 0; j < (int)uniform_count; j++) { + if (uniforms[j].binding == set_uniform.binding) { + uniform_idx = j; + } + } + ERR_FAIL_COND_V_MSG(uniform_idx == -1, RID(), + "All the shader bindings for the given set must be covered by the uniforms provided. Binding (" + itos(set_uniform.binding) + "), set (" + itos(p_shader_set) + ") was not provided."); + uniform_indices[i] = uniform_idx; + + const Uniform &uniform = uniforms[uniform_idx]; + ERR_FAIL_COND_V_MSG(uniform.uniform_type != set_uniform.type, RID(), + "Mismatch uniform type for binding (" + itos(set_uniform.binding) + "), set (" + itos(p_shader_set) + "). Expected '" + shader_uniform_names[set_uniform.type] + "', supplied: '" + shader_uniform_names[uniform.uniform_type] + "'."); + + // Since the uniform set may be created for a shader different than the one that will be actually bound, + // which may have a different set of uniforms optimized out, the stages mask we can check now is not reliable. + // Therefore, we can't make any assumptions here about descriptors that we may not need to create, + // pixel or vertex-only shader resource states, etc. + + bool srv_uav_ambiguity = false; + _add_descriptor_count_for_uniform(uniform.uniform_type, set_uniform.length, true, num_resource_descs, num_sampler_descs, srv_uav_ambiguity); + } + + struct { + DescriptorsHeap resources; + DescriptorsHeap samplers; + } desc_heaps; +#ifdef DEV_ENABLED + LocalVector<UniformSet::ResourceDescInfo> resources_desc_info; +#endif + + if (num_resource_descs) { + Error err = desc_heaps.resources.allocate(device.Get(), D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, num_resource_descs, false); + ERR_FAIL_COND_V(err, RID()); + } + if (num_sampler_descs) { + Error err = desc_heaps.samplers.allocate(device.Get(), D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER, num_sampler_descs, false); + ERR_FAIL_COND_V(err, RID()); + } + struct { + DescriptorsHeap::Walker resources; + DescriptorsHeap::Walker samplers; + } desc_heap_walkers; + desc_heap_walkers.resources = desc_heaps.resources.make_walker(); + desc_heap_walkers.samplers = desc_heaps.samplers.make_walker(); + + // Used for verification to make sure a uniform set does not use a framebuffer bound texture. + LocalVector<UniformSet::AttachableTexture> attachable_textures; + struct RIDState { + bool is_buffer = false; + uint64_t shader_uniform_idx_mask = 0; + ResourceState state; + }; + HashMap<Resource *, RIDState> resource_states; + + for (uint32_t i = 0; i < set_uniform_count; i++) { + const Shader::ShaderUniformInfo &set_uniform = set_uniforms[i]; + const Uniform &uniform = uniforms[uniform_indices[i]]; + + // Stages defined in the shader may be missing for a uniform due to the optimizer, + // but the opposite (extraneous stages present in the uniform stages mask) would be an error. + DEV_ASSERT(!(shader->is_compute && (set_uniform.binding.stages & (SHADER_STAGE_VERTEX_BIT | SHADER_STAGE_FRAGMENT_BIT)))); + DEV_ASSERT(!(!shader->is_compute && (set_uniform.binding.stages & SHADER_STAGE_COMPUTE_BIT))); + + switch (uniform.uniform_type) { + case UNIFORM_TYPE_SAMPLER: { + if (uniform.get_id_count() != (uint32_t)set_uniform.info.length) { + if (set_uniform.info.length > 1) { + ERR_FAIL_V_MSG(RID(), "Sampler (binding: " + itos(uniform.binding) + ") is an array of (" + itos(set_uniform.info.length) + ") sampler elements, so it should be provided equal number of sampler IDs to satisfy it (IDs provided: " + itos(uniform.get_id_count()) + ")."); + } else { + ERR_FAIL_V_MSG(RID(), "Sampler (binding: " + itos(uniform.binding) + ") should provide one ID referencing a sampler (IDs provided: " + itos(uniform.get_id_count()) + ")."); + } + } + + for (uint32_t j = 0; j < uniform.get_id_count(); j++) { + D3D12_SAMPLER_DESC *sampler_desc = sampler_owner.get_or_null(uniform.get_id(j)); + ERR_FAIL_COND_V_MSG(!sampler_desc, RID(), "Sampler (binding: " + itos(uniform.binding) + ", index " + itos(j) + ") is not a valid sampler."); + + device->CreateSampler(sampler_desc, desc_heap_walkers.samplers.get_curr_cpu_handle()); + desc_heap_walkers.samplers.advance(); + } + } break; + case UNIFORM_TYPE_SAMPLER_WITH_TEXTURE: { + if (uniform.get_id_count() != (uint32_t)set_uniform.info.length * 2) { + if (set_uniform.info.length > 1) { + ERR_FAIL_V_MSG(RID(), "SamplerTexture (binding: " + itos(uniform.binding) + ") is an array of (" + itos(set_uniform.info.length) + ") sampler&texture elements, so it should provided twice the amount of IDs (sampler,texture pairs) to satisfy it (IDs provided: " + itos(uniform.get_id_count()) + ")."); + } else { + ERR_FAIL_V_MSG(RID(), "SamplerTexture (binding: " + itos(uniform.binding) + ") should provide two IDs referencing a sampler and then a texture (IDs provided: " + itos(uniform.get_id_count()) + ")."); + } + } + + for (uint32_t j = 0; j < uniform.get_id_count(); j += 2) { + D3D12_SAMPLER_DESC *sampler_desc = sampler_owner.get_or_null(uniform.get_id(j)); + ERR_FAIL_COND_V_MSG(!sampler_desc, RID(), "SamplerTexture (binding: " + itos(uniform.binding) + ", index " + itos(j) + ") is not a valid sampler."); + + RID rid = uniform.get_id(j + 1); + Texture *texture = texture_owner.get_or_null(rid); + ERR_FAIL_COND_V_MSG(!texture, RID(), "SamplerTexture (binding: " + itos(uniform.binding) + ", index " + itos(j) + ") is not a valid texture."); + + ERR_FAIL_COND_V_MSG(!(texture->usage_flags & TEXTURE_USAGE_SAMPLING_BIT), RID(), + "Texture (binding: " + itos(uniform.binding) + ", index " + itos(j) + ") needs the TEXTURE_USAGE_SAMPLING_BIT usage flag set in order to be used as uniform."); + + device->CreateSampler(sampler_desc, desc_heap_walkers.samplers.get_curr_cpu_handle()); + desc_heap_walkers.samplers.advance(); + device->CreateShaderResourceView(texture->resource, &texture->srv_desc, desc_heap_walkers.resources.get_curr_cpu_handle()); +#ifdef DEV_ENABLED + resources_desc_info.push_back({ D3D12_DESCRIPTOR_RANGE_TYPE_SRV, texture->srv_desc.ViewDimension }); +#endif + desc_heap_walkers.resources.advance(); + + RIDState &rs = resource_states[texture]; + rs.shader_uniform_idx_mask |= ((uint64_t)1 << i); + rs.state.extend(D3D12_RESOURCE_STATE_ALL_SHADER_RESOURCE); + + if (texture->usage_flags & (TEXTURE_USAGE_COLOR_ATTACHMENT_BIT | TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT | TEXTURE_USAGE_INPUT_ATTACHMENT_BIT)) { + UniformSet::AttachableTexture attachable_texture; + attachable_texture.bind = set_uniform.info.binding; + attachable_texture.texture = texture->owner.is_valid() ? texture->owner : uniform.get_id(j + 1); + attachable_textures.push_back(attachable_texture); + } + + DEV_ASSERT(!texture->owner.is_valid() || texture_owner.get_or_null(texture->owner)); + } + } break; + case UNIFORM_TYPE_TEXTURE: { + if (uniform.get_id_count() != (uint32_t)set_uniform.info.length) { + if (set_uniform.info.length > 1) { + ERR_FAIL_V_MSG(RID(), "Texture (binding: " + itos(uniform.binding) + ") is an array of (" + itos(set_uniform.info.length) + ") textures, so it should be provided equal number of texture IDs to satisfy it (IDs provided: " + itos(uniform.get_id_count()) + ")."); + } else { + ERR_FAIL_V_MSG(RID(), "Texture (binding: " + itos(uniform.binding) + ") should provide one ID referencing a texture (IDs provided: " + itos(uniform.get_id_count()) + ")."); + } + } + + for (uint32_t j = 0; j < uniform.get_id_count(); j++) { + RID rid = uniform.get_id(j); + Texture *texture = texture_owner.get_or_null(rid); + ERR_FAIL_COND_V_MSG(!texture, RID(), "Texture (binding: " + itos(uniform.binding) + ", index " + itos(j) + ") is not a valid texture."); + + ERR_FAIL_COND_V_MSG(!(texture->usage_flags & TEXTURE_USAGE_SAMPLING_BIT), RID(), + "Texture (binding: " + itos(uniform.binding) + ", index " + itos(j) + ") needs the TEXTURE_USAGE_SAMPLING_BIT usage flag set in order to be used as uniform."); + + device->CreateShaderResourceView(texture->resource, &texture->srv_desc, desc_heap_walkers.resources.get_curr_cpu_handle()); +#ifdef DEV_ENABLED + resources_desc_info.push_back({ D3D12_DESCRIPTOR_RANGE_TYPE_SRV, texture->srv_desc.ViewDimension }); +#endif + desc_heap_walkers.resources.advance(); + + RIDState &rs = resource_states[texture]; + rs.shader_uniform_idx_mask |= ((uint64_t)1 << i); + rs.state.extend(D3D12_RESOURCE_STATE_ALL_SHADER_RESOURCE); + + if ((texture->usage_flags & (TEXTURE_USAGE_COLOR_ATTACHMENT_BIT | TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT | TEXTURE_USAGE_INPUT_ATTACHMENT_BIT))) { + UniformSet::AttachableTexture attachable_texture; + attachable_texture.bind = set_uniform.info.binding; + attachable_texture.texture = texture->owner.is_valid() ? texture->owner : uniform.get_id(j); + attachable_textures.push_back(attachable_texture); + } + + DEV_ASSERT(!texture->owner.is_valid() || texture_owner.get_or_null(texture->owner)); + } + } break; + case UNIFORM_TYPE_IMAGE: { + if (uniform.get_id_count() != (uint32_t)set_uniform.info.length) { + if (set_uniform.info.length > 1) { + ERR_FAIL_V_MSG(RID(), "Image (binding: " + itos(uniform.binding) + ") is an array of (" + itos(set_uniform.info.length) + ") textures, so it should be provided equal number of texture IDs to satisfy it (IDs provided: " + itos(uniform.get_id_count()) + ")."); + } else { + ERR_FAIL_V_MSG(RID(), "Image (binding: " + itos(uniform.binding) + ") should provide one ID referencing a texture (IDs provided: " + itos(uniform.get_id_count()) + ")."); + } + } + + for (uint32_t j = 0; j < uniform.get_id_count(); j++) { + RID rid = uniform.get_id(j); + Texture *texture = texture_owner.get_or_null(rid); + + ERR_FAIL_COND_V_MSG(!texture, RID(), + "Image (binding: " + itos(uniform.binding) + ", index " + itos(j) + ") is not a valid texture."); + + ERR_FAIL_COND_V_MSG(!(texture->usage_flags & TEXTURE_USAGE_STORAGE_BIT), RID(), + "Image (binding: " + itos(uniform.binding) + ", index " + itos(j) + ") needs the TEXTURE_USAGE_STORAGE_BIT usage flag set in order to be used as uniform."); + + RIDState &rs = resource_states[texture]; + rs.shader_uniform_idx_mask |= ((uint64_t)1 << i); + rs.state.extend(D3D12_RESOURCE_STATE_ALL_SHADER_RESOURCE | D3D12_RESOURCE_STATE_UNORDERED_ACCESS); + } + + // SRVs first. [[SRV_UAV_AMBIGUITY]] + for (uint32_t j = 0; j < uniform.get_id_count(); j++) { + RID rid = uniform.get_id(j); + Texture *texture = texture_owner.get_or_null(rid); + + ERR_FAIL_COND_V_MSG(!texture, RID(), + "Image (binding: " + itos(uniform.binding) + ", index " + itos(j) + ") is not a valid texture."); + + ERR_FAIL_COND_V_MSG(!(texture->usage_flags & TEXTURE_USAGE_STORAGE_BIT), RID(), + "Image (binding: " + itos(uniform.binding) + ", index " + itos(j) + ") needs the TEXTURE_USAGE_STORAGE_BIT usage flag set in order to be used as uniform."); + + device->CreateShaderResourceView(texture->resource, &texture->srv_desc, desc_heap_walkers.resources.get_curr_cpu_handle()); +#ifdef DEV_ENABLED + resources_desc_info.push_back({ D3D12_DESCRIPTOR_RANGE_TYPE_SRV, texture->srv_desc.ViewDimension }); +#endif + desc_heap_walkers.resources.advance(); + + DEV_ASSERT(!texture->owner.is_valid() || texture_owner.get_or_null(texture->owner)); + } + + // UAVs then. [[SRV_UAV_AMBIGUITY]] + for (uint32_t j = 0; j < uniform.get_id_count(); j++) { + RID rid = uniform.get_id(j); + Texture *texture = texture_owner.get_or_null(rid); + + device->CreateUnorderedAccessView(texture->resource, nullptr, &texture->uav_desc, desc_heap_walkers.resources.get_curr_cpu_handle()); +#ifdef DEV_ENABLED + resources_desc_info.push_back({ D3D12_DESCRIPTOR_RANGE_TYPE_UAV, {} }); +#endif + desc_heap_walkers.resources.advance(); + } + } break; + case UNIFORM_TYPE_TEXTURE_BUFFER: { + if (uniform.get_id_count() != (uint32_t)set_uniform.info.length) { + if (set_uniform.info.length > 1) { + ERR_FAIL_V_MSG(RID(), "Buffer (binding: " + itos(uniform.binding) + ") is an array of (" + itos(set_uniform.info.length) + ") texture buffer elements, so it should be provided equal number of texture buffer IDs to satisfy it (IDs provided: " + itos(uniform.get_id_count()) + ")."); + } else { + ERR_FAIL_V_MSG(RID(), "Buffer (binding: " + itos(uniform.binding) + ") should provide one ID referencing a texture buffer (IDs provided: " + itos(uniform.get_id_count()) + ")."); + } + } + + for (uint32_t j = 0; j < uniform.get_id_count(); j++) { + TextureBuffer *buffer = texture_buffer_owner.get_or_null(uniform.get_id(j)); + ERR_FAIL_COND_V_MSG(!buffer, RID(), "Texture Buffer (binding: " + itos(uniform.binding) + ", index " + itos(j) + ") is not a valid texture buffer."); + + CRASH_NOW_MSG("Unimplemented!"); + } + } break; + case UNIFORM_TYPE_SAMPLER_WITH_TEXTURE_BUFFER: { + CRASH_NOW(); + if (uniform.get_id_count() != (uint32_t)set_uniform.info.length * 2) { + if (set_uniform.info.length > 1) { + ERR_FAIL_V_MSG(RID(), "SamplerBuffer (binding: " + itos(uniform.binding) + ") is an array of (" + itos(set_uniform.info.length) + ") sampler buffer elements, so it should provided twice the amount of IDs (sampler,buffer pairs) to satisfy it (IDs provided: " + itos(uniform.get_id_count()) + ")."); + } else { + ERR_FAIL_V_MSG(RID(), "SamplerBuffer (binding: " + itos(uniform.binding) + ") should provide two IDs referencing a sampler and then a texture buffer (IDs provided: " + itos(uniform.get_id_count()) + ")."); + } + } + + for (uint32_t j = 0; j < uniform.get_id_count(); j += 2) { + D3D12_SAMPLER_DESC *sampler_desc = sampler_owner.get_or_null(uniform.get_id(j)); + ERR_FAIL_COND_V_MSG(!sampler_desc, RID(), "SamplerBuffer (binding: " + itos(uniform.binding) + ", index " + itos(j + 1) + ") is not a valid sampler."); + + TextureBuffer *buffer = texture_buffer_owner.get_or_null(uniform.get_id(j + 1)); + ERR_FAIL_COND_V_MSG(!buffer, RID(), "SamplerBuffer (binding: " + itos(uniform.binding) + ", index " + itos(j + 1) + ") is not a valid texture buffer."); + + device->CreateSampler(sampler_desc, desc_heap_walkers.samplers.get_curr_cpu_handle()); + desc_heap_walkers.samplers.advance(); + + CRASH_NOW_MSG("Unimplemented!"); + } + } break; + case UNIFORM_TYPE_IMAGE_BUFFER: { + // Todo. + + } break; + case UNIFORM_TYPE_UNIFORM_BUFFER: { + ERR_FAIL_COND_V_MSG(uniform.get_id_count() != 1, RID(), + "Uniform buffer supplied (binding: " + itos(uniform.binding) + ") must provide one ID (" + itos(uniform.get_id_count()) + " provided)."); + + RID rid = uniform.get_id(0); + Buffer *buffer = uniform_buffer_owner.get_or_null(rid); + ERR_FAIL_COND_V_MSG(!buffer, RID(), "Uniform buffer supplied (binding: " + itos(uniform.binding) + ") is invalid."); + + ERR_FAIL_COND_V_MSG(buffer->size < (uint32_t)set_uniform.info.length, RID(), + "Uniform buffer supplied (binding: " + itos(uniform.binding) + ") size (" + itos(buffer->size) + " is smaller than size of shader uniform: (" + itos(set_uniform.info.length) + ")."); + + D3D12_CONSTANT_BUFFER_VIEW_DESC cbv_desc = {}; + cbv_desc.BufferLocation = buffer->resource->GetGPUVirtualAddress(); + cbv_desc.SizeInBytes = ALIGN(buffer->size, 256); + device->CreateConstantBufferView(&cbv_desc, desc_heap_walkers.resources.get_curr_cpu_handle()); + desc_heap_walkers.resources.advance(); +#ifdef DEV_ENABLED + resources_desc_info.push_back({ D3D12_DESCRIPTOR_RANGE_TYPE_CBV, {} }); +#endif + + RIDState &rs = resource_states[buffer]; + rs.is_buffer = true; + rs.shader_uniform_idx_mask |= ((uint64_t)1 << i); + rs.state.extend(D3D12_RESOURCE_STATE_VERTEX_AND_CONSTANT_BUFFER); + } break; + case UNIFORM_TYPE_STORAGE_BUFFER: { + ERR_FAIL_COND_V_MSG(uniform.get_id_count() != 1, RID(), + "Storage buffer supplied (binding: " + itos(uniform.binding) + ") must provide one ID (" + itos(uniform.get_id_count()) + " provided)."); + + RID rid = uniform.get_id(0); + Buffer *buffer = nullptr; + + if (storage_buffer_owner.owns(rid)) { + buffer = storage_buffer_owner.get_or_null(rid); + } else if (vertex_buffer_owner.owns(rid)) { + buffer = vertex_buffer_owner.get_or_null(rid); + // Due to [[SRV_UAV_AMBIGUITY]] we can't make this check because it wouldn't make sense in the case of an SRV (r/o storage buffer). + //ERR_FAIL_COND_V_MSG(!(buffer->usage & D3D12_RESOURCE_STATE_UNORDERED_ACCESS), RID(), "Vertex buffer supplied (binding: " + itos(uniform.binding) + ") was not created with storage flag."); + } + ERR_FAIL_COND_V_MSG(!buffer, RID(), "Storage buffer supplied (binding: " + itos(uniform.binding) + ") is invalid."); + + // If 0, then it's sized at link time. + ERR_FAIL_COND_V_MSG(set_uniform.info.length > 0 && buffer->size != (uint32_t)set_uniform.info.length, RID(), + "Storage buffer supplied (binding: " + itos(uniform.binding) + ") size (" + itos(buffer->size) + " does not match size of shader uniform: (" + itos(set_uniform.info.length) + ")."); + + RIDState &rs = resource_states[buffer]; + rs.shader_uniform_idx_mask |= ((uint64_t)1 << i); + rs.is_buffer = true; + rs.state.extend(D3D12_RESOURCE_STATE_ALL_SHADER_RESOURCE | D3D12_RESOURCE_STATE_UNORDERED_ACCESS); + + // SRV first. [[SRV_UAV_AMBIGUITY]] + { + D3D12_SHADER_RESOURCE_VIEW_DESC srv_desc = {}; + srv_desc.Format = DXGI_FORMAT_R32_TYPELESS; + srv_desc.ViewDimension = D3D12_SRV_DIMENSION_BUFFER; + srv_desc.Shader4ComponentMapping = D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING; + srv_desc.Buffer.FirstElement = 0; + srv_desc.Buffer.NumElements = (buffer->size + 3) / 4; + srv_desc.Buffer.StructureByteStride = 0; + srv_desc.Buffer.Flags = D3D12_BUFFER_SRV_FLAG_RAW; + device->CreateShaderResourceView(buffer->resource, &srv_desc, desc_heap_walkers.resources.get_curr_cpu_handle()); +#ifdef DEV_ENABLED + resources_desc_info.push_back({ D3D12_DESCRIPTOR_RANGE_TYPE_SRV, srv_desc.ViewDimension }); +#endif + desc_heap_walkers.resources.advance(); + } + + // UAV then. [[SRV_UAV_AMBIGUITY]] + { + if ((buffer->usage & D3D12_RESOURCE_STATE_UNORDERED_ACCESS)) { + D3D12_UNORDERED_ACCESS_VIEW_DESC uav_desc = {}; + uav_desc.Format = DXGI_FORMAT_R32_TYPELESS; + uav_desc.ViewDimension = D3D12_UAV_DIMENSION_BUFFER; + uav_desc.Buffer.FirstElement = 0; + uav_desc.Buffer.NumElements = (buffer->size + 3) / 4; + uav_desc.Buffer.StructureByteStride = 0; + uav_desc.Buffer.CounterOffsetInBytes = 0; + uav_desc.Buffer.Flags = D3D12_BUFFER_UAV_FLAG_RAW; + device->CreateUnorderedAccessView(buffer->resource, nullptr, &uav_desc, desc_heap_walkers.resources.get_curr_cpu_handle()); +#ifdef DEV_ENABLED + resources_desc_info.push_back({ D3D12_DESCRIPTOR_RANGE_TYPE_UAV, {} }); +#endif + } else { + // If can't transition to UAV, leave this one empty since it won't be + // used, and trying to create an UAV view would trigger a validation error. + } + + desc_heap_walkers.resources.advance(); + } + } break; + case UNIFORM_TYPE_INPUT_ATTACHMENT: { + ERR_FAIL_COND_V_MSG(shader->is_compute, RID(), "InputAttachment (binding: " + itos(uniform.binding) + ") supplied for compute shader (this is not allowed)."); + + if (uniform.get_id_count() != (uint32_t)set_uniform.info.length) { + if (set_uniform.info.length > 1) { + ERR_FAIL_V_MSG(RID(), "InputAttachment (binding: " + itos(uniform.binding) + ") is an array of (" + itos(set_uniform.info.length) + ") textures, so it should be provided equal number of texture IDs to satisfy it (IDs provided: " + itos(uniform.get_id_count()) + ")."); + } else { + ERR_FAIL_V_MSG(RID(), "InputAttachment (binding: " + itos(uniform.binding) + ") should provide one ID referencing a texture (IDs provided: " + itos(uniform.get_id_count()) + ")."); + } + } + + for (uint32_t j = 0; j < uniform.get_id_count(); j++) { + RID rid = uniform.get_id(j); + Texture *texture = texture_owner.get_or_null(rid); + ERR_FAIL_COND_V_MSG(!texture, RID(), + "InputAttachment (binding: " + itos(uniform.binding) + ", index " + itos(j) + ") is not a valid texture."); + + ERR_FAIL_COND_V_MSG(!(texture->usage_flags & TEXTURE_USAGE_SAMPLING_BIT), RID(), + "InputAttachment (binding: " + itos(uniform.binding) + ", index " + itos(j) + ") needs the TEXTURE_USAGE_SAMPLING_BIT usage flag set in order to be used as uniform."); + + device->CreateShaderResourceView(texture->resource, &texture->srv_desc, desc_heap_walkers.resources.get_curr_cpu_handle()); +#ifdef DEV_ENABLED + resources_desc_info.push_back({ D3D12_DESCRIPTOR_RANGE_TYPE_SRV, texture->srv_desc.ViewDimension }); +#endif + desc_heap_walkers.resources.advance(); + + RIDState &rs = resource_states[texture]; + rs.shader_uniform_idx_mask |= ((uint64_t)1 << i); + rs.state.extend(D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE); + + DEV_ASSERT(!texture->owner.is_valid() || texture_owner.get_or_null(texture->owner)); + } + } break; + default: { + } + } + } + + DEV_ASSERT(desc_heap_walkers.resources.is_at_eof()); + DEV_ASSERT(desc_heap_walkers.samplers.is_at_eof()); + + UniformSet uniform_set; + uniform_set.desc_heaps.resources = desc_heaps.resources; + uniform_set.desc_heaps.samplers = desc_heaps.samplers; + uniform_set.format = shader->set_formats[p_shader_set]; + uniform_set.attachable_textures = attachable_textures; + uniform_set.shader_set = p_shader_set; + uniform_set.shader_id = p_shader; +#ifdef DEV_ENABLED + uniform_set._resources_desc_info = resources_desc_info; + uniform_set._shader = shader; +#endif + + { + uniform_set.resource_states.resize(resource_states.size()); + uint32_t i = 0; + for (const KeyValue<Resource *, RIDState> &E : resource_states) { + UniformSet::StateRequirement sr; + sr.resource = E.key; + sr.is_buffer = E.value.is_buffer; + sr.states = E.value.state.get_state_mask(); + sr.shader_uniform_idx_mask = E.value.shader_uniform_idx_mask; + uniform_set.resource_states.write[i] = sr; + i++; + } + } + + RID id = uniform_set_owner.make_rid(uniform_set); + // Add dependencies. + _add_dependency(id, p_shader); + for (uint32_t i = 0; i < uniform_count; i++) { + const Uniform &uniform = uniforms[i]; + int id_count = uniform.get_id_count(); + for (int j = 0; j < id_count; j++) { + _add_dependency(id, uniform.get_id(j)); + } + } + + return id; +} + +bool RenderingDeviceD3D12::uniform_set_is_valid(RID p_uniform_set) { + return uniform_set_owner.owns(p_uniform_set); +} + +void RenderingDeviceD3D12::uniform_set_set_invalidation_callback(RID p_uniform_set, InvalidationCallback p_callback, void *p_userdata) { + UniformSet *us = uniform_set_owner.get_or_null(p_uniform_set); + ERR_FAIL_NULL(us); + us->invalidated_callback = p_callback; + us->invalidated_callback_userdata = p_userdata; +} + +Error RenderingDeviceD3D12::buffer_copy(RID p_src_buffer, RID p_dst_buffer, uint32_t p_src_offset, uint32_t p_dst_offset, uint32_t p_size, BitField<BarrierMask> p_post_barrier) { + _THREAD_SAFE_METHOD_ + + ERR_FAIL_COND_V_MSG(draw_list, ERR_INVALID_PARAMETER, + "Copying buffers is forbidden during creation of a draw list"); + ERR_FAIL_COND_V_MSG(compute_list, ERR_INVALID_PARAMETER, + "Copying buffers is forbidden during creation of a compute list"); + + Buffer *src_buffer = _get_buffer_from_owner(p_src_buffer); + if (!src_buffer) { + ERR_FAIL_V_MSG(ERR_INVALID_PARAMETER, "Source buffer argument is not a valid buffer of any type."); + } + + Buffer *dst_buffer = _get_buffer_from_owner(p_dst_buffer); + if (!dst_buffer) { + ERR_FAIL_V_MSG(ERR_INVALID_PARAMETER, "Destination buffer argument is not a valid buffer of any type."); + } + + // Validate the copy's dimensions for both buffers. + ERR_FAIL_COND_V_MSG((p_size + p_src_offset) > src_buffer->size, ERR_INVALID_PARAMETER, "Size is larger than the source buffer."); + ERR_FAIL_COND_V_MSG((p_size + p_dst_offset) > dst_buffer->size, ERR_INVALID_PARAMETER, "Size is larger than the destination buffer."); + + // Perform the copy. + + ID3D12GraphicsCommandList *command_list = frames[frame].draw_command_list.Get(); + + _resource_transition_batch(src_buffer, 0, 1, D3D12_RESOURCE_STATE_COPY_SOURCE); + _resource_transition_batch(src_buffer, 0, 1, D3D12_RESOURCE_STATE_COPY_DEST); + _resource_transitions_flush(command_list); + + command_list->CopyBufferRegion(dst_buffer->resource, p_dst_offset, src_buffer->resource, p_src_offset, p_size); + + return OK; +} + +Error RenderingDeviceD3D12::buffer_update(RID p_buffer, uint32_t p_offset, uint32_t p_size, const void *p_data, BitField<BarrierMask> p_post_barrier) { + _THREAD_SAFE_METHOD_ + + ERR_FAIL_COND_V_MSG(draw_list, ERR_INVALID_PARAMETER, + "Updating buffers is forbidden during creation of a draw list"); + ERR_FAIL_COND_V_MSG(compute_list, ERR_INVALID_PARAMETER, + "Updating buffers is forbidden during creation of a compute list"); + + Buffer *buffer = _get_buffer_from_owner(p_buffer); + if (!buffer) { + ERR_FAIL_V_MSG(ERR_INVALID_PARAMETER, "Buffer argument is not a valid buffer of any type."); + } + + ERR_FAIL_COND_V_MSG(p_offset + p_size > buffer->size, ERR_INVALID_PARAMETER, + "Attempted to write buffer (" + itos((p_offset + p_size) - buffer->size) + " bytes) past the end."); + + ID3D12GraphicsCommandList *command_list = frames[frame].draw_command_list.Get(); + + _resource_transition_batch(buffer, 0, 1, D3D12_RESOURCE_STATE_COPY_DEST); + _resource_transitions_flush(command_list); + + Error err = _buffer_update(buffer, p_offset, (uint8_t *)p_data, p_size, p_post_barrier); + if (err) { + return err; + } + + return OK; +} + +Error RenderingDeviceD3D12::buffer_clear(RID p_buffer, uint32_t p_offset, uint32_t p_size, BitField<BarrierMask> p_post_barrier) { + _THREAD_SAFE_METHOD_ + + ERR_FAIL_COND_V_MSG((p_size % 4) != 0, ERR_INVALID_PARAMETER, + "Size must be a multiple of four"); + ERR_FAIL_COND_V_MSG(draw_list, ERR_INVALID_PARAMETER, + "Updating buffers in is forbidden during creation of a draw list"); + ERR_FAIL_COND_V_MSG(compute_list, ERR_INVALID_PARAMETER, + "Updating buffers is forbidden during creation of a compute list"); + + Buffer *buffer = _get_buffer_from_owner(p_buffer); + if (!buffer) { + ERR_FAIL_V_MSG(ERR_INVALID_PARAMETER, "Buffer argument is not a valid buffer of any type."); + } + + ERR_FAIL_COND_V_MSG(p_offset + p_size > buffer->size, ERR_INVALID_PARAMETER, + "Attempted to write buffer (" + itos((p_offset + p_size) - buffer->size) + " bytes) past the end."); + + if (frames[frame].desc_heap_walkers.resources.is_at_eof()) { + if (!frames[frame].desc_heaps_exhausted_reported.resources) { + frames[frame].desc_heaps_exhausted_reported.resources = true; + ERR_FAIL_V_MSG(ERR_BUSY, + "Cannot clear buffer because there's no enough room in current frame's RESOURCE descriptors heap.\n" + "Please increase the value of the rendering/rendering_device/d3d12/max_resource_descriptors_per_frame project setting."); + } else { + return ERR_BUSY; + } + } + if (frames[frame].desc_heap_walkers.aux.is_at_eof()) { + if (!frames[frame].desc_heaps_exhausted_reported.aux) { + frames[frame].desc_heaps_exhausted_reported.aux = true; + ERR_FAIL_V_MSG(ERR_BUSY, + "Cannot clear buffer because there's no enough room in current frame's AUX descriptors heap.\n" + "Please increase the value of the rendering/rendering_device/d3d12/max_misc_descriptors_per_frame project setting."); + } else { + return ERR_BUSY; + } + } + + ID3D12GraphicsCommandList *command_list = frames[frame].draw_command_list.Get(); + + _resource_transition_batch(buffer, 0, 1, D3D12_RESOURCE_STATE_UNORDERED_ACCESS); + _resource_transitions_flush(command_list); + + D3D12_UNORDERED_ACCESS_VIEW_DESC uav_desc = {}; + uav_desc.Format = DXGI_FORMAT_R32_TYPELESS; + uav_desc.ViewDimension = D3D12_UAV_DIMENSION_BUFFER; + uav_desc.Buffer.FirstElement = 0; + uav_desc.Buffer.NumElements = (buffer->size + 3) / 4; + uav_desc.Buffer.StructureByteStride = 0; + uav_desc.Buffer.CounterOffsetInBytes = 0; + uav_desc.Buffer.Flags = D3D12_BUFFER_UAV_FLAG_RAW; + device->CreateUnorderedAccessView( + buffer->resource, + nullptr, + &uav_desc, + frames[frame].desc_heap_walkers.aux.get_curr_cpu_handle()); + + device->CopyDescriptorsSimple( + 1, + frames[frame].desc_heap_walkers.resources.get_curr_cpu_handle(), + frames[frame].desc_heap_walkers.aux.get_curr_cpu_handle(), + D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV); + + static const UINT values[4] = {}; + command_list->ClearUnorderedAccessViewUint( + frames[frame].desc_heap_walkers.resources.get_curr_gpu_handle(), + frames[frame].desc_heap_walkers.aux.get_curr_cpu_handle(), + buffer->resource, + values, + 0, + nullptr); + + frames[frame].desc_heap_walkers.resources.advance(); + frames[frame].desc_heap_walkers.aux.advance(); + + return OK; +} + +Vector<uint8_t> RenderingDeviceD3D12::buffer_get_data(RID p_buffer, uint32_t p_offset, uint32_t p_size) { + _THREAD_SAFE_METHOD_ + + // Get the vulkan buffer and the potential stage/access possible. + Buffer *buffer = _get_buffer_from_owner(p_buffer); + if (!buffer) { + ERR_FAIL_V_MSG(Vector<uint8_t>(), "Buffer is either invalid or this type of buffer can't be retrieved. Only Index and Vertex buffers allow retrieving."); + } + + ID3D12GraphicsCommandList *command_list = frames[frame].draw_command_list.Get(); + + // Size of buffer to retrieve. + if (!p_size) { + p_size = buffer->size; + } else { + ERR_FAIL_COND_V_MSG(p_size + p_offset > buffer->size, Vector<uint8_t>(), + "Size is larger than the buffer."); + } + + _resource_transition_batch(buffer, 0, 1, D3D12_RESOURCE_STATE_COPY_SOURCE); + _resource_transitions_flush(command_list); + + Buffer tmp_buffer; + Error err = _buffer_allocate(&tmp_buffer, p_size, D3D12_RESOURCE_STATE_COPY_DEST, D3D12_HEAP_TYPE_READBACK); + ERR_FAIL_COND_V(err != OK, Vector<uint8_t>()); + + command_list->CopyBufferRegion(tmp_buffer.resource, 0, buffer->resource, p_offset, p_size); + + // Flush everything so memory can be safely mapped. + _flush(true); + + void *buffer_mem; + HRESULT res = tmp_buffer.resource->Map(0, &VOID_RANGE, &buffer_mem); + ERR_FAIL_COND_V_MSG(res, Vector<uint8_t>(), "Map failed with error " + vformat("0x%08ux", res) + "."); + + Vector<uint8_t> buffer_data; + { + buffer_data.resize(buffer->size); + uint8_t *w = buffer_data.ptrw(); + memcpy(w, buffer_mem, buffer->size); + } + + tmp_buffer.resource->Unmap(0, &VOID_RANGE); + + _buffer_free(&tmp_buffer); + + return buffer_data; +} + +/*******************/ +/**** PIPELINES ****/ +/*******************/ + +Error RenderingDeviceD3D12::_apply_specialization_constants( + const Shader *p_shader, + const Vector<PipelineSpecializationConstant> &p_specialization_constants, + HashMap<ShaderStage, Vector<uint8_t>> &r_final_stages_bytecode) { + // If something needs to be patched, COW will do the trick. + r_final_stages_bytecode = p_shader->stages_bytecode; + uint32_t stages_re_sign_mask = 0; + for (const PipelineSpecializationConstant &psc : p_specialization_constants) { + if (!(p_shader->spirv_specialization_constants_ids_mask & (1 << psc.constant_id))) { + // This SC wasn't even in the original SPIR-V shader. + continue; + } + for (const Shader::SpecializationConstant &sc : p_shader->specialization_constants) { + if (psc.constant_id == sc.constant.constant_id) { + ERR_FAIL_COND_V_MSG(psc.type != sc.constant.type, ERR_INVALID_PARAMETER, "Specialization constant provided for id (" + itos(sc.constant.constant_id) + ") is of the wrong type."); + if (psc.int_value != sc.constant.int_value) { + stages_re_sign_mask |= _shader_patch_dxil_specialization_constant(psc.type, &psc.int_value, sc.stages_bit_offsets, r_final_stages_bytecode, false); + } + break; + } + } + } + // Re-sign patched stages. + for (KeyValue<ShaderStage, Vector<uint8_t>> &E : r_final_stages_bytecode) { + ShaderStage stage = E.key; + if ((stages_re_sign_mask & (1 << stage))) { + Vector<uint8_t> &bytecode = E.value; + bool sign_ok = _shader_sign_dxil_bytecode(stage, bytecode); + ERR_FAIL_COND_V(!sign_ok, ERR_QUERY_FAILED); + } + } + + return OK; +} + +#ifdef DEV_ENABLED +String RenderingDeviceD3D12::_build_pipeline_blob_filename( + const Vector<uint8_t> &p_blob, + const Shader *p_shader, + const Vector<PipelineSpecializationConstant> &p_specialization_constants, + const String &p_extra_name_suffix, + const String &p_forced_id) { + String id; + if (p_forced_id == "") { + HashingContext hc; + hc.start(HashingContext::HASH_MD5); + hc.update(p_blob); + Vector<uint8_t> hash_bin = hc.finish(); + String hash_str = String::hex_encode_buffer(hash_bin.ptr(), hash_bin.size()); + } else { + id = p_forced_id; + } + + Vector<String> sc_str_pieces; + for (const Shader::SpecializationConstant &sc : p_shader->specialization_constants) { + uint32_t int_value = sc.constant.int_value; + for (const PipelineSpecializationConstant &psc : p_specialization_constants) { + if (psc.constant_id == sc.constant.constant_id) { + int_value = psc.int_value; + break; + } + } + sc_str_pieces.push_back(itos(sc.constant.constant_id) + "=" + itos(int_value)); + } + + String res = p_shader->name.replace(":", "-"); + res += "." + id; + res += "." + String("_").join(sc_str_pieces); + if (p_extra_name_suffix != "") { + res += "." + p_extra_name_suffix; + } + return res; +} + +void RenderingDeviceD3D12::_save_pso_blob( + ID3D12PipelineState *p_pso, + const Shader *p_shader, + const Vector<PipelineSpecializationConstant> &p_specialization_constants) { + ComPtr<ID3DBlob> pso_blob; + p_pso->GetCachedBlob(pso_blob.GetAddressOf()); + Vector<uint8_t> pso_vector; + pso_vector.resize(pso_blob->GetBufferSize()); + memcpy(pso_vector.ptrw(), pso_blob->GetBufferPointer(), pso_blob->GetBufferSize()); + + String base_filename = _build_pipeline_blob_filename(pso_vector, p_shader, p_specialization_constants); + + Ref<FileAccess> fa = FileAccess::open("pso." + base_filename + ".bin", FileAccess::WRITE); + fa->store_buffer((const uint8_t *)pso_blob->GetBufferPointer(), pso_blob->GetBufferSize()); +} + +void RenderingDeviceD3D12::_save_stages_bytecode( + const HashMap<ShaderStage, Vector<uint8_t>> &p_stages_bytecode, + const Shader *p_shader, + const RID p_shader_rid, + const Vector<PipelineSpecializationConstant> &p_specialization_constants) { + for (const KeyValue<ShaderStage, Vector<uint8_t>> &E : p_stages_bytecode) { + ShaderStage stage = E.key; + const Vector<uint8_t> &bytecode = E.value; + + String base_filename = _build_pipeline_blob_filename(bytecode, p_shader, p_specialization_constants, shader_stage_names[stage], itos(p_shader_rid.get_id())); + + Ref<FileAccess> fa = FileAccess::open("dxil." + base_filename + ".bin", FileAccess::WRITE); + fa->store_buffer(bytecode.ptr(), bytecode.size()); + } +} +#endif + +/*************************/ +/**** RENDER PIPELINE ****/ +/*************************/ + +RID RenderingDeviceD3D12::render_pipeline_create(RID p_shader, FramebufferFormatID p_framebuffer_format, VertexFormatID p_vertex_format, RenderPrimitive p_render_primitive, const PipelineRasterizationState &p_rasterization_state, const PipelineMultisampleState &p_multisample_state, const PipelineDepthStencilState &p_depth_stencil_state, const PipelineColorBlendState &p_blend_state, BitField<PipelineDynamicStateFlags> p_dynamic_state_flags, uint32_t p_for_render_pass, const Vector<PipelineSpecializationConstant> &p_specialization_constants) { +#ifdef DEV_ENABLED +//#define DEBUG_CREATE_DEBUG_PSO +//#define DEBUG_SAVE_PSO_BLOBS +//#define DEBUG_SAVE_DXIL_BLOBS +#endif + _THREAD_SAFE_METHOD_ + + // Needs a shader. + Shader *shader = shader_owner.get_or_null(p_shader); + ERR_FAIL_NULL_V(shader, RID()); + + ERR_FAIL_COND_V_MSG(shader->is_compute, RID(), + "Compute shaders can't be used in render pipelines"); + + if (p_framebuffer_format == INVALID_ID) { + // If nothing provided, use an empty one (no attachments). + p_framebuffer_format = framebuffer_format_create(Vector<AttachmentFormat>()); + } + ERR_FAIL_COND_V(!framebuffer_formats.has(p_framebuffer_format), RID()); + const FramebufferFormat &fb_format = framebuffer_formats[p_framebuffer_format]; + const FramebufferPass &pass = fb_format.passes[p_for_render_pass]; + + { // Validate shader vs framebuffer. + + ERR_FAIL_COND_V_MSG(p_for_render_pass >= uint32_t(fb_format.passes.size()), RID(), "Render pass requested for pipeline creation (" + itos(p_for_render_pass) + ") is out of bounds"); + uint32_t output_mask = 0; + for (int i = 0; i < pass.color_attachments.size(); i++) { + if (pass.color_attachments[i] != FramebufferPass::ATTACHMENT_UNUSED) { + output_mask |= 1 << i; + } + } + ERR_FAIL_COND_V_MSG(shader->fragment_output_mask != output_mask, RID(), + "Mismatch fragment shader output mask (" + itos(shader->fragment_output_mask) + ") and framebuffer color output mask (" + itos(output_mask) + ") when binding both in render pipeline."); + } + + CD3DX12_PIPELINE_STATE_STREAM pipeline_desc; + RenderPipeline::DynamicParams dyn_params; + + // Attachment formats. + { + for (int i = 0; i < pass.color_attachments.size(); i++) { + int32_t attachment = pass.color_attachments[i]; + if (attachment == FramebufferPass::ATTACHMENT_UNUSED) { + (&pipeline_desc.RTVFormats)->RTFormats[i] = DXGI_FORMAT_UNKNOWN; + } else { + (&pipeline_desc.RTVFormats)->RTFormats[i] = d3d12_formats[fb_format.attachments[attachment].format].general_format; + } + } + (&pipeline_desc.RTVFormats)->NumRenderTargets = pass.color_attachments.size(); + + if (pass.depth_attachment == FramebufferPass::ATTACHMENT_UNUSED) { + pipeline_desc.DSVFormat = DXGI_FORMAT_UNKNOWN; + } else { + pipeline_desc.DSVFormat = d3d12_formats[fb_format.attachments[pass.depth_attachment].format].dsv_format; + } + } + + // Vertex. + if (p_vertex_format != INVALID_ID) { + // Uses vertices, else it does not. + ERR_FAIL_COND_V(!vertex_formats.has(p_vertex_format), RID()); + const VertexDescriptionCache &vd = vertex_formats[p_vertex_format]; + + (&pipeline_desc.InputLayout)->pInputElementDescs = vd.elements_desc.ptr(); + (&pipeline_desc.InputLayout)->NumElements = vd.elements_desc.size(); + + // Validate with inputs. + for (uint32_t i = 0; i < 64; i++) { + if (!(shader->vertex_input_mask & (1ULL << i))) { + continue; + } + bool found = false; + for (int j = 0; j < vd.vertex_formats.size(); j++) { + if (vd.vertex_formats[j].location == i) { + found = true; + } + } + + ERR_FAIL_COND_V_MSG(!found, RID(), + "Shader vertex input location (" + itos(i) + ") not provided in vertex input description for pipeline creation."); + } + + } else { + // Does not use vertices. + + ERR_FAIL_COND_V_MSG(shader->vertex_input_mask != 0, RID(), + "Shader contains vertex inputs, but no vertex input description was provided for pipeline creation."); + } + + // Input assembly & tessellation. + + ERR_FAIL_INDEX_V(p_render_primitive, RENDER_PRIMITIVE_MAX, RID()); + + static const D3D12_PRIMITIVE_TOPOLOGY_TYPE topology_types[RENDER_PRIMITIVE_MAX] = { + D3D12_PRIMITIVE_TOPOLOGY_TYPE_POINT, + D3D12_PRIMITIVE_TOPOLOGY_TYPE_LINE, + D3D12_PRIMITIVE_TOPOLOGY_TYPE_LINE, + D3D12_PRIMITIVE_TOPOLOGY_TYPE_LINE, + D3D12_PRIMITIVE_TOPOLOGY_TYPE_LINE, + D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE, + D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE, + D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE, + D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE, + D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE, + D3D12_PRIMITIVE_TOPOLOGY_TYPE_PATCH, + }; + + static const D3D12_PRIMITIVE_TOPOLOGY topologies[RENDER_PRIMITIVE_MAX] = { + D3D_PRIMITIVE_TOPOLOGY_POINTLIST, + D3D_PRIMITIVE_TOPOLOGY_LINELIST, + D3D_PRIMITIVE_TOPOLOGY_LINELIST_ADJ, + D3D_PRIMITIVE_TOPOLOGY_LINESTRIP, + D3D_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ, + D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST, + D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ, + D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP, + D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ, + D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP, + D3D_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST, + }; + + pipeline_desc.PrimitiveTopologyType = topology_types[p_render_primitive]; + if (p_render_primitive == RENDER_PRIMITIVE_TESSELATION_PATCH) { + ERR_FAIL_COND_V(p_rasterization_state.patch_control_points < 1 || p_rasterization_state.patch_control_points > 32, RID()); // Is there any way to get the true point count limit? + dyn_params.primitive_topology = (D3D12_PRIMITIVE_TOPOLOGY)((int)D3D_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST + p_rasterization_state.patch_control_points); + } else { + dyn_params.primitive_topology = topologies[p_render_primitive]; + } + if (p_render_primitive == RENDER_PRIMITIVE_TRIANGLE_STRIPS_WITH_RESTART_INDEX) { + // TODO: This is right for 16-bit indices; for 32-bit there's a different enum value to set, but we don't know at this point. + pipeline_desc.IBStripCutValue = D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_0xFFFF; + } else { + pipeline_desc.IBStripCutValue = D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_DISABLED; + } + + // Rasterization. + (&pipeline_desc.RasterizerState)->DepthClipEnable = !p_rasterization_state.enable_depth_clamp; + // In D3D12, discard can be supported with some extra effort (empty pixel shader + disable depth/stencil test); that said, unsupported by now. + ERR_FAIL_COND_V(p_rasterization_state.discard_primitives, RID()); + (&pipeline_desc.RasterizerState)->FillMode = p_rasterization_state.wireframe ? D3D12_FILL_MODE_WIREFRAME : D3D12_FILL_MODE_SOLID; + static const D3D12_CULL_MODE cull_mode[3] = { + D3D12_CULL_MODE_NONE, + D3D12_CULL_MODE_FRONT, + D3D12_CULL_MODE_BACK, + }; + + ERR_FAIL_INDEX_V(p_rasterization_state.cull_mode, 3, RID()); + (&pipeline_desc.RasterizerState)->CullMode = cull_mode[p_rasterization_state.cull_mode]; + (&pipeline_desc.RasterizerState)->FrontCounterClockwise = p_rasterization_state.front_face == POLYGON_FRONT_FACE_COUNTER_CLOCKWISE; + // In D3D12, there's still a point in setting up depth bias with no depth buffer, but just zeroing (disabling) it all in such case is closer to Vulkan. + if (p_rasterization_state.depth_bias_enabled && fb_format.passes[p_for_render_pass].depth_attachment != FramebufferPass::ATTACHMENT_UNUSED) { + (&pipeline_desc.RasterizerState)->DepthBias = p_rasterization_state.depth_bias_constant_factor; + (&pipeline_desc.RasterizerState)->DepthBiasClamp = p_rasterization_state.depth_bias_clamp; + (&pipeline_desc.RasterizerState)->SlopeScaledDepthBias = p_rasterization_state.depth_bias_slope_factor; + } else { + (&pipeline_desc.RasterizerState)->DepthBias = 0; + (&pipeline_desc.RasterizerState)->DepthBiasClamp = 0.0f; + (&pipeline_desc.RasterizerState)->SlopeScaledDepthBias = 0.0f; + } + + (&pipeline_desc.RasterizerState)->ForcedSampleCount = 0; + (&pipeline_desc.RasterizerState)->ConservativeRaster = D3D12_CONSERVATIVE_RASTERIZATION_MODE_OFF; + (&pipeline_desc.RasterizerState)->MultisampleEnable = rasterization_sample_count[p_multisample_state.sample_count] != 1; + (&pipeline_desc.RasterizerState)->AntialiasedLineEnable = true; + + // In D3D12, there's no line width. + ERR_FAIL_COND_V(!Math::is_equal_approx(p_rasterization_state.line_width, 1.0f), RID()); + + // Multisample. + ERR_FAIL_COND_V(p_multisample_state.enable_sample_shading, RID()); // How one enables this in D3D12? + if ((&pipeline_desc.RTVFormats)->NumRenderTargets || pipeline_desc.DSVFormat != DXGI_FORMAT_UNKNOWN) { + uint32_t sample_count = MIN( + fb_format.max_supported_sample_count, + rasterization_sample_count[p_multisample_state.sample_count]); + (&pipeline_desc.SampleDesc)->Count = sample_count; + } else { + (&pipeline_desc.SampleDesc)->Count = 1; + } + if ((&pipeline_desc.SampleDesc)->Count > 1) { + (&pipeline_desc.SampleDesc)->Quality = DXGI_STANDARD_MULTISAMPLE_QUALITY_PATTERN; + } else { + (&pipeline_desc.SampleDesc)->Quality = 0; + } + if (p_multisample_state.sample_mask.size()) { + // Use sample mask. + ERR_FAIL_COND_V(rasterization_sample_count[p_multisample_state.sample_count] != (uint32_t)p_multisample_state.sample_mask.size(), RID()); + for (int i = 1; i < p_multisample_state.sample_mask.size(); i++) { + // In D3D12 there's a single sample mask for every pixel. + ERR_FAIL_COND_V(p_multisample_state.sample_mask[i] != p_multisample_state.sample_mask[0], RID()); + } + pipeline_desc.SampleMask = p_multisample_state.sample_mask[0]; + } else { + pipeline_desc.SampleMask = 0xffffffff; + } + + // Depth stencil. + + if (pass.depth_attachment == FramebufferPass::ATTACHMENT_UNUSED) { + (&pipeline_desc.DepthStencilState)->DepthEnable = false; + (&pipeline_desc.DepthStencilState)->StencilEnable = false; + } else { + (&pipeline_desc.DepthStencilState)->DepthEnable = p_depth_stencil_state.enable_depth_test; + (&pipeline_desc.DepthStencilState)->DepthWriteMask = p_depth_stencil_state.enable_depth_write ? D3D12_DEPTH_WRITE_MASK_ALL : D3D12_DEPTH_WRITE_MASK_ZERO; + ERR_FAIL_INDEX_V(p_depth_stencil_state.depth_compare_operator, COMPARE_OP_MAX, RID()); + (&pipeline_desc.DepthStencilState)->DepthFunc = compare_operators[p_depth_stencil_state.depth_compare_operator]; + (&pipeline_desc.DepthStencilState)->DepthBoundsTestEnable = p_depth_stencil_state.enable_depth_range; + (&pipeline_desc.DepthStencilState)->StencilEnable = p_depth_stencil_state.enable_stencil; + + // In D3D12 some elements can't be different across front and back. + ERR_FAIL_COND_V(p_depth_stencil_state.front_op.compare_mask != p_depth_stencil_state.back_op.compare_mask, RID()); + ERR_FAIL_COND_V(p_depth_stencil_state.front_op.write_mask != p_depth_stencil_state.back_op.write_mask, RID()); + ERR_FAIL_COND_V(p_depth_stencil_state.front_op.reference != p_depth_stencil_state.back_op.reference, RID()); + (&pipeline_desc.DepthStencilState)->StencilReadMask = p_depth_stencil_state.front_op.compare_mask; + (&pipeline_desc.DepthStencilState)->StencilWriteMask = p_depth_stencil_state.front_op.write_mask; + + ERR_FAIL_INDEX_V(p_depth_stencil_state.front_op.fail, STENCIL_OP_MAX, RID()); + (&pipeline_desc.DepthStencilState)->FrontFace.StencilFailOp = stencil_operations[p_depth_stencil_state.front_op.fail]; + ERR_FAIL_INDEX_V(p_depth_stencil_state.front_op.pass, STENCIL_OP_MAX, RID()); + (&pipeline_desc.DepthStencilState)->FrontFace.StencilPassOp = stencil_operations[p_depth_stencil_state.front_op.pass]; + ERR_FAIL_INDEX_V(p_depth_stencil_state.front_op.depth_fail, STENCIL_OP_MAX, RID()); + (&pipeline_desc.DepthStencilState)->FrontFace.StencilDepthFailOp = stencil_operations[p_depth_stencil_state.front_op.depth_fail]; + ERR_FAIL_INDEX_V(p_depth_stencil_state.front_op.compare, COMPARE_OP_MAX, RID()); + (&pipeline_desc.DepthStencilState)->FrontFace.StencilFunc = compare_operators[p_depth_stencil_state.front_op.compare]; + + ERR_FAIL_INDEX_V(p_depth_stencil_state.back_op.fail, STENCIL_OP_MAX, RID()); + (&pipeline_desc.DepthStencilState)->BackFace.StencilFailOp = stencil_operations[p_depth_stencil_state.back_op.fail]; + ERR_FAIL_INDEX_V(p_depth_stencil_state.back_op.pass, STENCIL_OP_MAX, RID()); + (&pipeline_desc.DepthStencilState)->BackFace.StencilPassOp = stencil_operations[p_depth_stencil_state.back_op.pass]; + ERR_FAIL_INDEX_V(p_depth_stencil_state.back_op.depth_fail, STENCIL_OP_MAX, RID()); + (&pipeline_desc.DepthStencilState)->BackFace.StencilDepthFailOp = stencil_operations[p_depth_stencil_state.back_op.depth_fail]; + ERR_FAIL_INDEX_V(p_depth_stencil_state.back_op.compare, COMPARE_OP_MAX, RID()); + (&pipeline_desc.DepthStencilState)->BackFace.StencilFunc = compare_operators[p_depth_stencil_state.back_op.compare]; + + dyn_params.depth_bounds_min = p_depth_stencil_state.enable_depth_range ? p_depth_stencil_state.depth_range_min : 0.0f; + dyn_params.depth_bounds_max = p_depth_stencil_state.enable_depth_range ? p_depth_stencil_state.depth_range_max : 1.0f; + dyn_params.stencil_reference = p_depth_stencil_state.front_op.reference; + } + + // Blend state. + (&pipeline_desc.BlendState)->AlphaToCoverageEnable = p_multisample_state.enable_alpha_to_coverage; + { + ERR_FAIL_COND_V(p_blend_state.attachments.size() < pass.color_attachments.size(), RID()); + + bool all_attachments_same_blend = true; + for (int i = 0; i < pass.color_attachments.size(); i++) { + const PipelineColorBlendState::Attachment &bs = p_blend_state.attachments[i]; + D3D12_RENDER_TARGET_BLEND_DESC &bd = (&pipeline_desc.BlendState)->RenderTarget[i]; + + bd.BlendEnable = bs.enable_blend; + bd.LogicOpEnable = p_blend_state.enable_logic_op; + bd.LogicOp = logic_operations[p_blend_state.logic_op]; + + ERR_FAIL_INDEX_V(bs.src_color_blend_factor, BLEND_FACTOR_MAX, RID()); + bd.SrcBlend = blend_factors[bs.src_color_blend_factor]; + ERR_FAIL_INDEX_V(bs.dst_color_blend_factor, BLEND_FACTOR_MAX, RID()); + bd.DestBlend = blend_factors[bs.dst_color_blend_factor]; + ERR_FAIL_INDEX_V(bs.color_blend_op, BLEND_OP_MAX, RID()); + bd.BlendOp = blend_operations[bs.color_blend_op]; + + ERR_FAIL_INDEX_V(bs.src_alpha_blend_factor, BLEND_FACTOR_MAX, RID()); + bd.SrcBlendAlpha = blend_factors[bs.src_alpha_blend_factor]; + ERR_FAIL_INDEX_V(bs.dst_alpha_blend_factor, BLEND_FACTOR_MAX, RID()); + bd.DestBlendAlpha = blend_factors[bs.dst_alpha_blend_factor]; + ERR_FAIL_INDEX_V(bs.alpha_blend_op, BLEND_OP_MAX, RID()); + bd.BlendOpAlpha = blend_operations[bs.alpha_blend_op]; + + if (bs.write_r) { + bd.RenderTargetWriteMask |= D3D12_COLOR_WRITE_ENABLE_RED; + } + if (bs.write_g) { + bd.RenderTargetWriteMask |= D3D12_COLOR_WRITE_ENABLE_GREEN; + } + if (bs.write_b) { + bd.RenderTargetWriteMask |= D3D12_COLOR_WRITE_ENABLE_BLUE; + } + if (bs.write_a) { + bd.RenderTargetWriteMask |= D3D12_COLOR_WRITE_ENABLE_ALPHA; + } + + if (i > 0 && all_attachments_same_blend) { + all_attachments_same_blend = &(&pipeline_desc.BlendState)->RenderTarget[i] == &(&pipeline_desc.BlendState)->RenderTarget[0]; + } + } + + // Per D3D12 docs, if logic op used, independent blending is not supported. + ERR_FAIL_COND_V(p_blend_state.enable_logic_op && !all_attachments_same_blend, RID()); + + (&pipeline_desc.BlendState)->IndependentBlendEnable = !all_attachments_same_blend; + } + + dyn_params.blend_constant = p_blend_state.blend_constant; + + // Stages bytecodes + specialization constants. + + pipeline_desc.pRootSignature = shader->root_signature.Get(); + +#ifdef DEBUG_CREATE_DEBUG_PSO + pipeline_desc.Flags = D3D12_PIPELINE_STATE_FLAG_TOOL_DEBUG; +#endif + + HashMap<ShaderStage, Vector<uint8_t>> final_stages_bytecode; + Error err = _apply_specialization_constants(shader, p_specialization_constants, final_stages_bytecode); + ERR_FAIL_COND_V(err, RID()); + +#ifdef DEV_ENABLED + // Ensure signing worked. + for (KeyValue<ShaderStage, Vector<uint8_t>> &E : final_stages_bytecode) { + bool any_non_zero = false; + for (int j = 0; j < 16; j++) { + if (E.value.ptr()[4 + j]) { + any_non_zero = true; + break; + } + } + DEV_ASSERT(any_non_zero); + } +#endif + + if (shader->stages_bytecode.has(SHADER_STAGE_VERTEX)) { + pipeline_desc.VS = D3D12_SHADER_BYTECODE{ + final_stages_bytecode[SHADER_STAGE_VERTEX].ptr(), + (SIZE_T)final_stages_bytecode[SHADER_STAGE_VERTEX].size() + }; + } + if (shader->stages_bytecode.has(SHADER_STAGE_FRAGMENT)) { + pipeline_desc.PS = D3D12_SHADER_BYTECODE{ + final_stages_bytecode[SHADER_STAGE_FRAGMENT].ptr(), + (SIZE_T)final_stages_bytecode[SHADER_STAGE_FRAGMENT].size() + }; + } + + RenderPipeline pipeline; + { + ComPtr<ID3D12Device2> device2; + device.As(&device2); + HRESULT res = {}; + if (device2) { + D3D12_PIPELINE_STATE_STREAM_DESC pssd = {}; + pssd.pPipelineStateSubobjectStream = &pipeline_desc; + pssd.SizeInBytes = sizeof(pipeline_desc); + res = device2->CreatePipelineState(&pssd, IID_PPV_ARGS(pipeline.pso.GetAddressOf())); + } else { + // Some features won't be available (like depth bounds). + // TODO: Check and/or report error then? + D3D12_GRAPHICS_PIPELINE_STATE_DESC desc = pipeline_desc.GraphicsDescV0(); + res = device->CreateGraphicsPipelineState(&desc, IID_PPV_ARGS(pipeline.pso.GetAddressOf())); + } + ERR_FAIL_COND_V_MSG(res, RID(), "CreateGraphicsPipelineState failed with error " + vformat("0x%08ux", res) + " for shader '" + shader->name + "'."); + +#ifdef DEBUG_SAVE_PSO_BLOBS + _save_pso_blob(pipeline.pso.Get(), shader, p_specialization_constants); +#endif +#ifdef DEBUG_SAVE_DXIL_BLOBS + _save_stages_bytecode(final_stages_bytecode, shader, p_shader, p_specialization_constants); +#endif + } + + { + Vector<Vector<UniformBindingInfo>> bindings; + bindings.resize(shader->sets.size()); + for (int i = 0; i < shader->sets.size(); i++) { + bindings.write[i].resize(shader->sets[i].uniforms.size()); + for (int j = 0; j < shader->sets[i].uniforms.size(); j++) { + bindings.write[i].write[j] = shader->sets[i].uniforms[j].binding; + } + } + pipeline_bindings[next_pipeline_binding_id] = bindings; + pipeline.bindings_id = next_pipeline_binding_id; + next_pipeline_binding_id++; + } + + pipeline.root_signature_crc = shader->root_signature_crc; + pipeline.set_formats = shader->set_formats; + pipeline.shader = p_shader; + pipeline.spirv_push_constant_size = shader->spirv_push_constant_size; + pipeline.dxil_push_constant_size = shader->dxil_push_constant_size; + pipeline.nir_runtime_data_root_param_idx = shader->nir_runtime_data_root_param_idx; + pipeline.dyn_params = dyn_params; + +#ifdef DEBUG_ENABLED + pipeline.validation.dynamic_state = p_dynamic_state_flags; + pipeline.validation.framebuffer_format = p_framebuffer_format; + pipeline.validation.render_pass = p_for_render_pass; + pipeline.validation.vertex_format = p_vertex_format; + pipeline.validation.uses_restart_indices = pipeline_desc.IBStripCutValue != D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_DISABLED; + + static const uint32_t primitive_divisor[RENDER_PRIMITIVE_MAX] = { + 1, 2, 1, 1, 1, 3, 1, 1, 1, 1, 1 + }; + pipeline.validation.primitive_divisor = primitive_divisor[p_render_primitive]; + static const uint32_t primitive_minimum[RENDER_PRIMITIVE_MAX] = { + 1, + 2, + 2, + 2, + 2, + 3, + 3, + 3, + 3, + 3, + 1, + }; + pipeline.validation.primitive_minimum = primitive_minimum[p_render_primitive]; +#endif + // Create ID to associate with this pipeline. + RID id = render_pipeline_owner.make_rid(pipeline); +#ifdef DEV_ENABLED + set_resource_name(id, "RID:" + itos(id.get_id())); +#endif + // Now add all the dependencies. + _add_dependency(id, p_shader); + return id; +} + +bool RenderingDeviceD3D12::render_pipeline_is_valid(RID p_pipeline) { + _THREAD_SAFE_METHOD_ + return render_pipeline_owner.owns(p_pipeline); +} + +/**************************/ +/**** COMPUTE PIPELINE ****/ +/**************************/ + +RID RenderingDeviceD3D12::compute_pipeline_create(RID p_shader, const Vector<PipelineSpecializationConstant> &p_specialization_constants) { +#ifdef DEV_ENABLED +//#define DEBUG_CREATE_DEBUG_PSO +//#define DEBUG_SAVE_PSO_BLOBS +//#define DEBUG_SAVE_DXIL_BLOBS +#endif + _THREAD_SAFE_METHOD_ + + // Needs a shader. + Shader *shader = shader_owner.get_or_null(p_shader); + ERR_FAIL_NULL_V(shader, RID()); + + ERR_FAIL_COND_V_MSG(!shader->is_compute, RID(), + "Non-compute shaders can't be used in compute pipelines"); + + CD3DX12_PIPELINE_STATE_STREAM pipeline_desc = {}; + + // Stages bytecodes + specialization constants. + + pipeline_desc.pRootSignature = shader->root_signature.Get(); + +#ifdef DEBUG_CREATE_DEBUG_PSO + pipeline_desc.Flags = D3D12_PIPELINE_STATE_FLAG_TOOL_DEBUG; +#endif + + HashMap<ShaderStage, Vector<uint8_t>> final_stages_bytecode; + Error err = _apply_specialization_constants(shader, p_specialization_constants, final_stages_bytecode); + ERR_FAIL_COND_V(err, RID()); + + pipeline_desc.CS = D3D12_SHADER_BYTECODE{ + final_stages_bytecode[SHADER_STAGE_COMPUTE].ptr(), + (SIZE_T)final_stages_bytecode[SHADER_STAGE_COMPUTE].size() + }; + + ComputePipeline pipeline; + { + ComPtr<ID3D12Device2> device2; + device.As(&device2); + HRESULT res = {}; + if (device2) { + D3D12_PIPELINE_STATE_STREAM_DESC pssd = {}; + pssd.pPipelineStateSubobjectStream = &pipeline_desc; + pssd.SizeInBytes = sizeof(pipeline_desc); + res = device2->CreatePipelineState(&pssd, IID_PPV_ARGS(pipeline.pso.GetAddressOf())); + } else { + D3D12_COMPUTE_PIPELINE_STATE_DESC desc = pipeline_desc.ComputeDescV0(); + res = device->CreateComputePipelineState(&desc, IID_PPV_ARGS(pipeline.pso.GetAddressOf())); + } + ERR_FAIL_COND_V_MSG(res, RID(), "CreateComputePipelineState failed with error " + vformat("0x%08ux", res) + " for shader '" + shader->name + "'."); + +#ifdef DEBUG_SAVE_PSO_BLOBS + _save_pso_blob(pipeline.pso.Get(), shader, p_specialization_constants); +#endif +#ifdef DEBUG_SAVE_DXIL_BLOBS + _save_stages_bytecode(final_stages_bytecode, shader, p_shader, p_specialization_constants); +#endif + } + + { + Vector<Vector<UniformBindingInfo>> bindings; + bindings.resize(shader->sets.size()); + for (int i = 0; i < shader->sets.size(); i++) { + bindings.write[i].resize(shader->sets[i].uniforms.size()); + for (int j = 0; j < shader->sets[i].uniforms.size(); j++) { + bindings.write[i].write[j] = shader->sets[i].uniforms[j].binding; + } + } + pipeline_bindings[next_pipeline_binding_id] = bindings; + pipeline.bindings_id = next_pipeline_binding_id; + next_pipeline_binding_id++; + } + + pipeline.root_signature_crc = shader->root_signature_crc; + pipeline.set_formats = shader->set_formats; + pipeline.shader = p_shader; + pipeline.spirv_push_constant_size = shader->spirv_push_constant_size; + pipeline.dxil_push_constant_size = shader->dxil_push_constant_size; + pipeline.local_group_size[0] = shader->compute_local_size[0]; + pipeline.local_group_size[1] = shader->compute_local_size[1]; + pipeline.local_group_size[2] = shader->compute_local_size[2]; + + // Create ID to associate with this pipeline. + RID id = compute_pipeline_owner.make_rid(pipeline); +#ifdef DEV_ENABLED + set_resource_name(id, "RID:" + itos(id.get_id())); +#endif + // Now add all the dependencies. + _add_dependency(id, p_shader); + return id; +} + +bool RenderingDeviceD3D12::compute_pipeline_is_valid(RID p_pipeline) { + return compute_pipeline_owner.owns(p_pipeline); +} + +/****************/ +/**** SCREEN ****/ +/****************/ + +int RenderingDeviceD3D12::screen_get_width(DisplayServer::WindowID p_screen) const { + _THREAD_SAFE_METHOD_ + ERR_FAIL_COND_V_MSG(local_device.is_valid(), -1, "Local devices have no screen"); + return context->window_get_width(p_screen); +} + +int RenderingDeviceD3D12::screen_get_height(DisplayServer::WindowID p_screen) const { + _THREAD_SAFE_METHOD_ + ERR_FAIL_COND_V_MSG(local_device.is_valid(), -1, "Local devices have no screen"); + + return context->window_get_height(p_screen); +} + +RenderingDevice::FramebufferFormatID RenderingDeviceD3D12::screen_get_framebuffer_format() const { + _THREAD_SAFE_METHOD_ + ERR_FAIL_COND_V_MSG(local_device.is_valid(), INVALID_ID, "Local devices have no screen"); + + // Very hacky, but not used often per frame so I guess ok. + DXGI_FORMAT d3d12_format = context->get_screen_format(); + DataFormat format = DATA_FORMAT_MAX; + for (int i = 0; i < DATA_FORMAT_MAX; i++) { + if (d3d12_format == d3d12_formats[i].general_format) { + format = DataFormat(i); + break; + } + } + + ERR_FAIL_COND_V(format == DATA_FORMAT_MAX, INVALID_ID); + + AttachmentFormat attachment; + attachment.format = format; + attachment.samples = TEXTURE_SAMPLES_1; + attachment.usage_flags = TEXTURE_USAGE_COLOR_ATTACHMENT_BIT; + Vector<AttachmentFormat> screen_attachment; + screen_attachment.push_back(attachment); + return const_cast<RenderingDeviceD3D12 *>(this)->framebuffer_format_create(screen_attachment); +} + +/*******************/ +/**** DRAW LIST ****/ +/*******************/ + +RenderingDevice::DrawListID RenderingDeviceD3D12::draw_list_begin_for_screen(DisplayServer::WindowID p_screen, const Color &p_clear_color) { + _THREAD_SAFE_METHOD_ + ERR_FAIL_COND_V_MSG(local_device.is_valid(), INVALID_ID, "Local devices have no screen"); + + ERR_FAIL_COND_V_MSG(draw_list != nullptr, INVALID_ID, "Only one draw list can be active at the same time."); + ERR_FAIL_COND_V_MSG(compute_list != nullptr, INVALID_ID, "Only one draw/compute list can be active at the same time."); + + if (!context->window_is_valid_swapchain(p_screen)) { + return INVALID_ID; + } + + Size2i size = Size2i(context->window_get_width(p_screen), context->window_get_height(p_screen)); + + _draw_list_allocate(Rect2i(Vector2i(), size), 0, 0); + + Vector<Color> clear_colors; + clear_colors.push_back(p_clear_color); + + curr_screen_framebuffer = Framebuffer(); + curr_screen_framebuffer.window_id = p_screen; + curr_screen_framebuffer.format_id = screen_get_framebuffer_format(); + curr_screen_framebuffer.size = size; + curr_screen_framebuffer.screen_rtv_handle = context->window_get_framebuffer_rtv_handle(p_screen); + + ID3D12GraphicsCommandList *command_list = frames[frame].draw_command_list.Get(); + Error err = _draw_list_render_pass_begin(&curr_screen_framebuffer, INITIAL_ACTION_CLEAR, FINAL_ACTION_READ, INITIAL_ACTION_DROP, FINAL_ACTION_DISCARD, clear_colors, 0.0f, 0, Rect2i(), Point2i(), size, command_list, Vector<RID>()); + + if (err != OK) { + return INVALID_ID; + } + + return int64_t(ID_TYPE_DRAW_LIST) << ID_BASE_SHIFT; +} + +Error RenderingDeviceD3D12::_draw_list_render_pass_begin(Framebuffer *framebuffer, InitialAction p_initial_color_action, FinalAction p_final_color_action, InitialAction p_initial_depth_action, FinalAction p_final_depth_action, const Vector<Color> &p_clear_colors, float p_clear_depth, uint32_t p_clear_stencil, const Rect2 &p_region, Point2i viewport_offset, Point2i viewport_size, ID3D12GraphicsCommandList *command_list, const Vector<RID> &p_storage_textures) { + const FramebufferFormat &fb_format = framebuffer_formats[framebuffer->format_id]; + + bool is_screen = framebuffer->window_id != DisplayServer::INVALID_WINDOW_ID; + if (!is_screen) { + ERR_FAIL_COND_V(fb_format.attachments.size() != framebuffer->texture_ids.size(), ERR_BUG); + } + + CD3DX12_RECT region_rect(0, 0, framebuffer->size.x, framebuffer->size.y); + if (p_region != Rect2() && p_region != Rect2(Vector2(), viewport_size)) { // Check custom region. + Rect2i viewport(viewport_offset, viewport_size); + Rect2i regioni = p_region; + if (!viewport.encloses(regioni)) { + ERR_FAIL_V_MSG(ERR_INVALID_PARAMETER, "When supplying a custom region, it must be contained within the framebuffer rectangle"); + } + viewport_offset = regioni.position; + viewport_size = regioni.size; + + region_rect = CD3DX12_RECT( + p_region.position.x, + p_region.position.y, + p_region.position.x + p_region.size.x, + p_region.position.y + p_region.size.y); + } + + if (p_initial_color_action == INITIAL_ACTION_CLEAR) { // Check clear values. + int color_count = 0; + if (is_screen) { + color_count = 1; + + } else { + for (int i = 0; i < framebuffer->texture_ids.size(); i++) { + Texture *texture = texture_owner.get_or_null(framebuffer->texture_ids[i]); + if (!texture || (!(texture->usage_flags & TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) && !(i != 0 && texture->usage_flags & TEXTURE_USAGE_VRS_ATTACHMENT_BIT))) { + if (!texture || !texture->is_resolve_buffer) { + color_count++; + } + } + } + } + ERR_FAIL_COND_V_MSG(p_clear_colors.size() != color_count, ERR_INVALID_PARAMETER, + "Clear color values supplied (" + itos(p_clear_colors.size()) + ") differ from the amount required for framebuffer color attachments (" + itos(color_count) + ")."); + } + + struct SetupInfo { + enum { + ACTION_NONE, + ACTION_DISCARD, + ACTION_CLEAR, + } action = ACTION_NONE; + UINT num_rects = 0; + D3D12_RECT *rect_ptr = nullptr; + D3D12_RESOURCE_STATES new_state = {}; + + SetupInfo(InitialAction p_action, D3D12_RECT *p_region_rect, bool p_is_color) { + switch (p_action) { + case INITIAL_ACTION_CLEAR: { + action = ACTION_CLEAR; + } break; + case INITIAL_ACTION_CLEAR_REGION: { + action = ACTION_CLEAR; + num_rects = 1; + rect_ptr = p_region_rect; + } break; + case INITIAL_ACTION_CLEAR_REGION_CONTINUE: { + action = ACTION_CLEAR; + num_rects = 1; + rect_ptr = p_region_rect; + } break; + case INITIAL_ACTION_KEEP: { + } break; + case INITIAL_ACTION_DROP: { + action = ACTION_DISCARD; // TODO: Are we really intended to do a resource Discard() as initial action, when final action can already do? + } break; + case INITIAL_ACTION_CONTINUE: { + } break; + } + } + }; + + SetupInfo setup_color(p_initial_color_action, ®ion_rect, true); + SetupInfo setup_depth(p_initial_depth_action, ®ion_rect, false); + + draw_list_bound_textures.clear(); + draw_list_unbind_color_textures = p_final_color_action != FINAL_ACTION_CONTINUE; + draw_list_unbind_depth_textures = p_final_depth_action != FINAL_ACTION_CONTINUE; + + ID3D12Resource **discards = (ID3D12Resource **)alloca(sizeof(ID3D12Resource *) * fb_format.attachments.size()); + uint32_t num_discards = 0; + + struct RTVClear { + D3D12_CPU_DESCRIPTOR_HANDLE handle; + Color color; + }; + RTVClear *rtv_clears = (RTVClear *)alloca(sizeof(RTVClear) * fb_format.attachments.size()); + uint32_t num_rtv_clears = 0; + + bool dsv_clear = false; + + DescriptorsHeap::Walker rtv_heap_walker = framebuffer->rtv_heap.make_walker(); + + int color_index = 0; + for (int i = 0; i < fb_format.attachments.size(); i++) { + RID texture_rid; + Texture *texture = nullptr; + if (!is_screen) { + texture_rid = framebuffer->texture_ids[i]; + if (texture_rid.is_null()) { + color_index++; + continue; + } + + texture = texture_owner.get_or_null(texture_rid); + ERR_FAIL_NULL_V(texture, ERR_BUG); + + texture->bound = true; + draw_list_bound_textures.push_back(texture_rid); + } + + // We can setup a framebuffer where we write to our VRS texture to set it up. + // We make the assumption here that if our texture is actually used as our VRS attachment, + // it is used as such for each subpass. This is fairly certain seeing the restrictions on subpasses (in Vulkan). + // [[VRS_EVERY_SUBPASS_OR_NONE]] + bool is_vrs = fb_format.attachments[i].usage_flags & TEXTURE_USAGE_VRS_ATTACHMENT_BIT && i == fb_format.passes[0].vrs_attachment; + if (is_vrs) { + DEV_ASSERT(!is_screen); + + DEV_ASSERT(texture->owner_mipmaps == 1); + DEV_ASSERT(texture->owner_layers == 1); + _resource_transition_batch(texture, 0, texture->planes, D3D12_RESOURCE_STATE_SHADING_RATE_SOURCE); + } else { + if ((fb_format.attachments[i].usage_flags & TEXTURE_USAGE_COLOR_ATTACHMENT_BIT)) { + if (!is_screen) { // Screen backbuffers are transitioned in prepare_buffers(). + for (uint32_t j = 0; j < texture->layers; j++) { + for (uint32_t k = 0; k < texture->mipmaps; k++) { + uint32_t subresource = D3D12CalcSubresource(texture->base_mipmap + k, texture->base_layer + j, 0, texture->owner_mipmaps, texture->owner_layers); + _resource_transition_batch(texture, subresource, texture->planes, D3D12_RESOURCE_STATE_RENDER_TARGET); + } + } + } + + if (setup_color.action == SetupInfo::ACTION_DISCARD) { + ID3D12Resource *resource = is_screen ? context->window_get_framebuffer_texture(framebuffer->window_id) : texture->resource; + discards[num_discards++] = resource; + } else if (setup_color.action == SetupInfo::ACTION_CLEAR) { + D3D12_CPU_DESCRIPTOR_HANDLE handle = is_screen ? framebuffer->screen_rtv_handle : rtv_heap_walker.get_curr_cpu_handle(); + Color clear_color = color_index < p_clear_colors.size() ? p_clear_colors[color_index] : Color(); + rtv_clears[num_rtv_clears++] = RTVClear{ handle, clear_color }; + } + + color_index++; + if (!is_screen) { + rtv_heap_walker.advance(); + } + } else if ((fb_format.attachments[i].usage_flags & TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT)) { + DEV_ASSERT(!is_screen); + + for (uint32_t j = 0; j < texture->layers; j++) { + for (uint32_t k = 0; k < texture->mipmaps; k++) { + uint32_t subresource = D3D12CalcSubresource(texture->base_mipmap + k, texture->base_layer + j, 0, texture->owner_mipmaps, texture->owner_layers); + _resource_transition_batch(texture, subresource, texture->planes, D3D12_RESOURCE_STATE_DEPTH_WRITE); + } + } + + if (setup_depth.action == SetupInfo::ACTION_DISCARD) { + discards[num_discards++] = texture->resource; + } else if (setup_depth.action == SetupInfo::ACTION_CLEAR) { + dsv_clear = true; + } + } + } + } + + for (int i = 0; i < p_storage_textures.size(); i++) { + Texture *texture = texture_owner.get_or_null(p_storage_textures[i]); + if (!texture) { + continue; + } + ERR_CONTINUE_MSG(!(texture->usage_flags & TEXTURE_USAGE_STORAGE_BIT), "Supplied storage texture " + itos(i) + " for draw list is not set to be used for storage."); + } + + _resource_transitions_flush(frames[frame].draw_command_list.Get()); + + for (uint32_t i = 0; i < num_discards; i++) { + command_list->DiscardResource(discards[i], nullptr); + } + for (uint32_t i = 0; i < num_rtv_clears; i++) { + command_list->ClearRenderTargetView( + rtv_clears[i].handle, + rtv_clears[i].color.components, + setup_color.num_rects, + setup_color.rect_ptr); + } + + if (dsv_clear) { + command_list->ClearDepthStencilView( + framebuffer->dsv_heap.get_heap()->GetCPUDescriptorHandleForHeapStart(), + D3D12_CLEAR_FLAG_DEPTH | D3D12_CLEAR_FLAG_STENCIL, + p_clear_depth, + p_clear_stencil, + setup_depth.num_rects, + setup_depth.rect_ptr); + } + + { + CD3DX12_VIEWPORT viewport( + viewport_offset.x, + viewport_offset.y, + viewport_size.x, + viewport_size.y, + 0.0f, + 1.0f); + command_list->RSSetViewports(1, &viewport); + + CD3DX12_RECT scissor( + viewport_offset.x, + viewport_offset.y, + viewport_offset.x + viewport_size.x, + viewport_offset.y + viewport_size.y); + command_list->RSSetScissorRects(1, &scissor); + } + + draw_list_subpass_count = fb_format.passes.size(); + draw_list_current_subpass = 0; + draw_list_final_color_action = p_final_color_action; + draw_list_final_depth_action = p_final_depth_action; + draw_list_framebuffer = framebuffer; + draw_list_viewport_size = viewport_size; + + _draw_list_subpass_begin(); + + return OK; +} + +RenderingDevice::DrawListID RenderingDeviceD3D12::draw_list_begin(RID p_framebuffer, InitialAction p_initial_color_action, FinalAction p_final_color_action, InitialAction p_initial_depth_action, FinalAction p_final_depth_action, const Vector<Color> &p_clear_color_values, float p_clear_depth, uint32_t p_clear_stencil, const Rect2 &p_region, const Vector<RID> &p_storage_textures) { + _THREAD_SAFE_METHOD_ + + ERR_FAIL_COND_V_MSG(draw_list != nullptr, INVALID_ID, "Only one draw list can be active at the same time."); + ERR_FAIL_COND_V_MSG(compute_list != nullptr && !compute_list->state.allow_draw_overlap, INVALID_ID, "Only one draw/compute list can be active at the same time."); + + Framebuffer *framebuffer = framebuffer_owner.get_or_null(p_framebuffer); + ERR_FAIL_NULL_V(framebuffer, INVALID_ID); + + ID3D12GraphicsCommandList *command_list = frames[frame].draw_command_list.Get(); + Error err = _draw_list_render_pass_begin(framebuffer, p_initial_color_action, p_final_color_action, p_initial_depth_action, p_final_depth_action, p_clear_color_values, p_clear_depth, p_clear_stencil, p_region, Point2i(), framebuffer->size, command_list, p_storage_textures); + + if (err != OK) { + return INVALID_ID; + } + + _draw_list_allocate(Rect2i(Point2i(), framebuffer->size), 0, 0); + + return int64_t(ID_TYPE_DRAW_LIST) << ID_BASE_SHIFT; +} + +Error RenderingDeviceD3D12::draw_list_begin_split(RID p_framebuffer, uint32_t p_splits, DrawListID *r_split_ids, InitialAction p_initial_color_action, FinalAction p_final_color_action, InitialAction p_initial_depth_action, FinalAction p_final_depth_action, const Vector<Color> &p_clear_color_values, float p_clear_depth, uint32_t p_clear_stencil, const Rect2 &p_region, const Vector<RID> &p_storage_textures) { + _THREAD_SAFE_METHOD_ + + ERR_FAIL_COND_V_MSG(draw_list != nullptr, ERR_BUSY, "Only one draw list can be active at the same time."); + ERR_FAIL_COND_V_MSG(compute_list != nullptr && !compute_list->state.allow_draw_overlap, ERR_BUSY, "Only one draw/compute list can be active at the same time."); + + ERR_FAIL_COND_V(p_splits < 1, ERR_INVALID_DECLARATION); + + Framebuffer *framebuffer = framebuffer_owner.get_or_null(p_framebuffer); + ERR_FAIL_NULL_V(framebuffer, ERR_INVALID_DECLARATION); + + ID3D12GraphicsCommandList *frame_command_list = frames[frame].draw_command_list.Get(); + Error err = _draw_list_render_pass_begin(framebuffer, p_initial_color_action, p_final_color_action, p_initial_depth_action, p_final_depth_action, p_clear_color_values, p_clear_depth, p_clear_stencil, p_region, Point2i(), framebuffer->size, frame_command_list, p_storage_textures); + + if (err != OK) { + return ERR_CANT_CREATE; + } + + err = _draw_list_allocate(Rect2i(Point2i(), framebuffer->size), p_splits, 0); + if (err != OK) { + return err; + } + + for (uint32_t i = 0; i < p_splits; i++) { + // In Vulkan, we'd be setting viewports and scissors for each split here; + // D3D12 doesn't need it (it's even forbidden, for that matter). + + r_split_ids[i] = (int64_t(ID_TYPE_SPLIT_DRAW_LIST) << ID_BASE_SHIFT) + i; + } + + return OK; +} + +RenderingDeviceD3D12::DrawList *RenderingDeviceD3D12::_get_draw_list_ptr(DrawListID p_id) { + if (p_id < 0) { + return nullptr; + } + + if (!draw_list) { + return nullptr; + } else if (p_id == (int64_t(ID_TYPE_DRAW_LIST) << ID_BASE_SHIFT)) { + if (draw_list_split) { + return nullptr; + } + return draw_list; + } else if (p_id >> DrawListID(ID_BASE_SHIFT) == ID_TYPE_SPLIT_DRAW_LIST) { + if (!draw_list_split) { + return nullptr; + } + + uint64_t index = p_id & ((DrawListID(1) << DrawListID(ID_BASE_SHIFT)) - 1); // Mask. + + if (index >= draw_list_count) { + return nullptr; + } + + return &draw_list[index]; + } else { + return nullptr; + } +} + +void RenderingDeviceD3D12::draw_list_set_blend_constants(DrawListID p_list, const Color &p_color) { + DrawList *dl = _get_draw_list_ptr(p_list); + ERR_FAIL_NULL(dl); +#ifdef DEBUG_ENABLED + ERR_FAIL_COND_MSG(!dl->validation.active, "Submitted Draw Lists can no longer be modified."); +#endif + + dl->command_list->OMSetBlendFactor(p_color.components); +} + +void RenderingDeviceD3D12::draw_list_bind_render_pipeline(DrawListID p_list, RID p_render_pipeline) { + DrawList *dl = _get_draw_list_ptr(p_list); + ERR_FAIL_NULL(dl); +#ifdef DEBUG_ENABLED + ERR_FAIL_COND_MSG(!dl->validation.active, "Submitted Draw Lists can no longer be modified."); +#endif + + const RenderPipeline *pipeline = render_pipeline_owner.get_or_null(p_render_pipeline); + ERR_FAIL_NULL(pipeline); +#ifdef DEBUG_ENABLED + ERR_FAIL_COND(pipeline->validation.framebuffer_format != draw_list_framebuffer->format_id && pipeline->validation.render_pass != draw_list_current_subpass); +#endif + + if (p_render_pipeline == dl->state.pipeline) { + return; // Redundant state, return. + } + + dl->state.pipeline = p_render_pipeline; + dl->state.pso = pipeline->pso.Get(); + + dl->command_list->IASetPrimitiveTopology(pipeline->dyn_params.primitive_topology); + dl->command_list->OMSetBlendFactor(pipeline->dyn_params.blend_constant.components); + dl->command_list->OMSetStencilRef(pipeline->dyn_params.stencil_reference); + + ID3D12GraphicsCommandList1 *command_list_1 = nullptr; + dl->command_list->QueryInterface<ID3D12GraphicsCommandList1>(&command_list_1); + if (command_list_1) { + command_list_1->OMSetDepthBounds(pipeline->dyn_params.depth_bounds_min, pipeline->dyn_params.depth_bounds_max); + command_list_1->Release(); + } + + Shader *shader = shader_owner.get_or_null(pipeline->shader); + + if (dl->state.pipeline_shader != pipeline->shader) { + if (dl->state.root_signature_crc != pipeline->root_signature_crc) { + dl->command_list->SetGraphicsRootSignature(shader->root_signature.Get()); + dl->state.root_signature_crc = pipeline->root_signature_crc; + + // Root signature changed, so current descriptor set bindings become invalid. + for (uint32_t i = 0; i < dl->state.set_count; i++) { + dl->state.sets[i].bound = false; + } + + if (pipeline->nir_runtime_data_root_param_idx != UINT32_MAX) { + // Set the viewport size part of the DXIL-NIR runtime data, which is the only we know to need currently. + constexpr dxil_spirv_vertex_runtime_data dummy_data = {}; + uint32_t offset = constexpr((char *)&dummy_data.viewport_width - (char *)&dummy_data) / 4; + dl->command_list->SetGraphicsRoot32BitConstants(pipeline->nir_runtime_data_root_param_idx, 2, &draw_list_viewport_size, offset); + } + } + + const uint32_t *pformats = pipeline->set_formats.ptr(); // Pipeline set formats. + dl->state.set_count = pipeline->set_formats.size(); // Update set count. + for (uint32_t i = 0; i < dl->state.set_count; i++) { + dl->state.sets[i].pipeline_expected_format = pformats[i]; +#ifdef DEV_ENABLED + dl->state.sets[i]._pipeline_expected_format = pformats[i] ? &uniform_set_format_cache_reverse[pformats[i] - 1]->key().uniform_info : nullptr; +#endif + } + + if (pipeline->spirv_push_constant_size) { +#ifdef DEBUG_ENABLED + dl->validation.pipeline_push_constant_supplied = false; +#endif + } + + dl->state.pipeline_shader = pipeline->shader; + dl->state.pipeline_dxil_push_constant_size = pipeline->dxil_push_constant_size; + dl->state.pipeline_bindings_id = pipeline->bindings_id; +#ifdef DEV_ENABLED + dl->state._shader = shader; +#endif + } + +#ifdef DEBUG_ENABLED + // Update render pass pipeline info. + dl->validation.pipeline_active = true; + dl->validation.pipeline_dynamic_state = pipeline->validation.dynamic_state; + dl->validation.pipeline_vertex_format = pipeline->validation.vertex_format; + dl->validation.pipeline_uses_restart_indices = pipeline->validation.uses_restart_indices; + dl->validation.pipeline_primitive_divisor = pipeline->validation.primitive_divisor; + dl->validation.pipeline_primitive_minimum = pipeline->validation.primitive_minimum; + dl->validation.pipeline_spirv_push_constant_size = pipeline->spirv_push_constant_size; +#endif +} + +void RenderingDeviceD3D12::draw_list_bind_uniform_set(DrawListID p_list, RID p_uniform_set, uint32_t p_index) { + DrawList *dl = _get_draw_list_ptr(p_list); + ERR_FAIL_NULL(dl); + +#ifdef DEBUG_ENABLED + ERR_FAIL_COND_MSG(!dl->validation.active, "Submitted Draw Lists can no longer be modified."); +#endif + + const UniformSet *uniform_set = uniform_set_owner.get_or_null(p_uniform_set); + ERR_FAIL_NULL(uniform_set); + + if (p_index > dl->state.set_count) { + dl->state.set_count = p_index; + } + + dl->state.sets[p_index].bound = false; // Needs rebind. + dl->state.sets[p_index].uniform_set_format = uniform_set->format; + dl->state.sets[p_index].uniform_set = p_uniform_set; +#ifdef DEV_ENABLED + dl->state.sets[p_index]._uniform_set = uniform_set_owner.get_or_null(p_uniform_set); +#endif + +#ifdef DEBUG_ENABLED + { // Validate that textures bound are not attached as framebuffer bindings. + uint32_t attachable_count = uniform_set->attachable_textures.size(); + const UniformSet::AttachableTexture *attachable_ptr = uniform_set->attachable_textures.ptr(); + uint32_t bound_count = draw_list_bound_textures.size(); + const RID *bound_ptr = draw_list_bound_textures.ptr(); + for (uint32_t i = 0; i < attachable_count; i++) { + for (uint32_t j = 0; j < bound_count; j++) { + ERR_FAIL_COND_MSG(attachable_ptr[i].texture == bound_ptr[j], + "Attempted to use the same texture in framebuffer attachment and a uniform (set: " + itos(p_index) + ", binding: " + itos(attachable_ptr[i].bind) + "), this is not allowed."); + } + } + } +#endif +} + +void RenderingDeviceD3D12::draw_list_bind_vertex_array(DrawListID p_list, RID p_vertex_array) { + DrawList *dl = _get_draw_list_ptr(p_list); + ERR_FAIL_NULL(dl); +#ifdef DEBUG_ENABLED + ERR_FAIL_COND_MSG(!dl->validation.active, "Submitted Draw Lists can no longer be modified."); +#endif + + const VertexArray *vertex_array = vertex_array_owner.get_or_null(p_vertex_array); + ERR_FAIL_NULL(vertex_array); + + if (dl->state.vertex_array == p_vertex_array) { + return; // Already set. + } + + dl->state.vertex_array = p_vertex_array; + +#ifdef DEBUG_ENABLED + dl->validation.vertex_format = vertex_array->description; + dl->validation.vertex_max_instances_allowed = vertex_array->max_instances_allowed; +#endif + dl->validation.vertex_array_size = vertex_array->vertex_count; + + for (Buffer *buffer : vertex_array->unique_buffers) { + _resource_transition_batch(buffer, 0, 1, D3D12_RESOURCE_STATE_VERTEX_AND_CONSTANT_BUFFER); + } + _resource_transitions_flush(dl->command_list); + + dl->command_list->IASetVertexBuffers(0, vertex_array->views.size(), vertex_array->views.ptr()); +} + +void RenderingDeviceD3D12::draw_list_bind_index_array(DrawListID p_list, RID p_index_array) { + DrawList *dl = _get_draw_list_ptr(p_list); + ERR_FAIL_NULL(dl); +#ifdef DEBUG_ENABLED + ERR_FAIL_COND_MSG(!dl->validation.active, "Submitted Draw Lists can no longer be modified."); +#endif + + const IndexArray *index_array = index_array_owner.get_or_null(p_index_array); + ERR_FAIL_NULL(index_array); + + if (dl->state.index_array == p_index_array) { + return; // Already set. + } + + dl->state.index_array = p_index_array; +#ifdef DEBUG_ENABLED + dl->validation.index_array_max_index = index_array->max_index; +#endif + dl->validation.index_array_size = index_array->indices; + dl->validation.index_array_offset = index_array->offset; + + _resource_transition_batch(index_array->buffer, 0, 1, D3D12_RESOURCE_STATE_INDEX_BUFFER); + _resource_transitions_flush(dl->command_list); + + dl->command_list->IASetIndexBuffer(&index_array->view); +} + +void RenderingDeviceD3D12::draw_list_set_line_width(DrawListID p_list, float p_width) { + DrawList *dl = _get_draw_list_ptr(p_list); + ERR_FAIL_NULL(dl); +#ifdef DEBUG_ENABLED + ERR_FAIL_COND_MSG(!dl->validation.active, "Submitted Draw Lists can no longer be modified."); +#endif + + if (!Math::is_equal_approx(p_width, 1.0f)) { + ERR_FAIL_MSG("Setting line widths other than 1.0 is not supported by the Direct3D 12 rendering driver."); + } +} + +void RenderingDeviceD3D12::_bind_uniform_set(UniformSet *p_uniform_set, const Shader::Set &p_shader_set, const Vector<UniformBindingInfo> &p_bindings, ID3D12GraphicsCommandList *p_command_list, bool p_for_compute) { + using SetRootDescriptorTableFn = void (STDMETHODCALLTYPE ID3D12GraphicsCommandList::*)(UINT, D3D12_GPU_DESCRIPTOR_HANDLE); + SetRootDescriptorTableFn set_root_desc_table_fn = p_for_compute ? &ID3D12GraphicsCommandList::SetComputeRootDescriptorTable : &ID3D12GraphicsCommandList1::SetGraphicsRootDescriptorTable; + + // If this set's descriptors have already been set for the current execution and a compatible root signature, reuse! + uint32_t root_sig_crc = p_for_compute ? compute_list->state.root_signature_crc : draw_list->state.root_signature_crc; + UniformSet::RecentBind *last_bind = nullptr; + for (int i = 0; i < ARRAY_SIZE(p_uniform_set->recent_binds); i++) { + if (p_uniform_set->recent_binds[i].execution_index == frames[frame].execution_index) { + if (p_uniform_set->recent_binds[i].root_signature_crc == root_sig_crc) { + for (const RootDescriptorTable &table : p_uniform_set->recent_binds[i].root_tables.resources) { + (p_command_list->*set_root_desc_table_fn)(table.root_param_idx, table.start_gpu_handle); + } + for (const RootDescriptorTable &table : p_uniform_set->recent_binds[i].root_tables.samplers) { + (p_command_list->*set_root_desc_table_fn)(table.root_param_idx, table.start_gpu_handle); + } +#ifdef DEV_ENABLED + p_uniform_set->recent_binds[i].uses++; + frames[frame].uniform_set_reused++; +#endif + return; + } else { + if (!last_bind || p_uniform_set->recent_binds[i].uses < last_bind->uses) { + // Prefer this one since it's been used less or we still haven't a better option. + last_bind = &p_uniform_set->recent_binds[i]; + } + } + } else { + // Prefer this one since it's unused. + last_bind = &p_uniform_set->recent_binds[i]; + last_bind->uses = 0; + } + } + + struct { + DescriptorsHeap::Walker *resources = nullptr; + DescriptorsHeap::Walker *samplers = nullptr; + } frame_heap_walkers; + frame_heap_walkers.resources = &frames[frame].desc_heap_walkers.resources; + frame_heap_walkers.samplers = &frames[frame].desc_heap_walkers.samplers; + + struct { + DescriptorsHeap::Walker resources; + DescriptorsHeap::Walker samplers; + } set_heap_walkers; + set_heap_walkers.resources = p_uniform_set->desc_heaps.resources.make_walker(); + set_heap_walkers.samplers = p_uniform_set->desc_heaps.samplers.make_walker(); + +#ifdef DEV_ENABLED + // Whether we have stages where the uniform is actually used should match + // whether we have any root signature locations for it. + for (int i = 0; i < p_shader_set.uniforms.size(); i++) { + bool has_rs_locations = false; + if (p_bindings[i].root_sig_locations.resource.root_param_idx != UINT32_MAX || + p_bindings[i].root_sig_locations.sampler.root_param_idx != UINT32_MAX) { + has_rs_locations = true; + break; + } + + bool has_stages = p_bindings[i].stages; + + DEV_ASSERT(has_rs_locations == has_stages); + } +#endif + + last_bind->root_tables.resources.reserve(p_shader_set.num_root_params.resources); + last_bind->root_tables.resources.clear(); + last_bind->root_tables.samplers.reserve(p_shader_set.num_root_params.samplers); + last_bind->root_tables.samplers.clear(); + last_bind->uses++; + + struct { + RootDescriptorTable *resources = nullptr; + RootDescriptorTable *samplers = nullptr; + } tables; + for (int i = 0; i < p_shader_set.uniforms.size(); i++) { + const Shader::ShaderUniformInfo &uniform_info = p_shader_set.uniforms[i]; + + uint32_t num_resource_descs = 0; + uint32_t num_sampler_descs = 0; + bool srv_uav_ambiguity = false; + _add_descriptor_count_for_uniform(uniform_info.info.type, uniform_info.info.length, false, num_resource_descs, num_sampler_descs, srv_uav_ambiguity); + + bool resource_used = false; + if (p_bindings[i].stages) { + { + const UniformBindingInfo::RootSignatureLocation &rs_loc_resource = p_bindings[i].root_sig_locations.resource; + if (rs_loc_resource.root_param_idx != UINT32_MAX) { // Location used? + DEV_ASSERT(num_resource_descs); + DEV_ASSERT(!(srv_uav_ambiguity && (p_bindings[i].res_class != RES_CLASS_SRV && p_bindings[i].res_class != RES_CLASS_UAV))); // [[SRV_UAV_AMBIGUITY]] + + bool must_flush_table = tables.resources && rs_loc_resource.root_param_idx != tables.resources->root_param_idx; + if (must_flush_table) { + // Check the root signature data has been filled ordered. + DEV_ASSERT(rs_loc_resource.root_param_idx > tables.resources->root_param_idx); + + (p_command_list->*set_root_desc_table_fn)(tables.resources->root_param_idx, tables.resources->start_gpu_handle); + tables.resources = nullptr; + } + + if (unlikely(frame_heap_walkers.resources->get_free_handles() < num_resource_descs)) { + if (!frames[frame].desc_heaps_exhausted_reported.resources) { + frames[frame].desc_heaps_exhausted_reported.resources = true; + ERR_FAIL_MSG("Cannot bind uniform set because there's no enough room in current frame's RESOURCES descriptor heap.\n" + "Please increase the value of the rendering/rendering_device/d3d12/max_resource_descriptors_per_frame project setting."); + } else { + return; + } + } + + if (!tables.resources) { + DEV_ASSERT(last_bind->root_tables.resources.size() < last_bind->root_tables.resources.get_capacity()); + last_bind->root_tables.resources.resize(last_bind->root_tables.resources.size() + 1); + tables.resources = &last_bind->root_tables.resources[last_bind->root_tables.resources.size() - 1]; + tables.resources->root_param_idx = rs_loc_resource.root_param_idx; + tables.resources->start_gpu_handle = frame_heap_walkers.resources->get_curr_gpu_handle(); + } + + // If there is ambiguity and it didn't clarify as SRVs, skip them, which come first. [[SRV_UAV_AMBIGUITY]] + if (srv_uav_ambiguity && p_bindings[i].res_class != RES_CLASS_SRV) { + set_heap_walkers.resources.advance(num_resource_descs); + } + + // TODO: Batch to avoid multiple calls where possible (in any case, flush before setting root descriptor tables, or even batch that as well). + device->CopyDescriptorsSimple( + num_resource_descs, + frame_heap_walkers.resources->get_curr_cpu_handle(), + set_heap_walkers.resources.get_curr_cpu_handle(), + D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV); + frame_heap_walkers.resources->advance(num_resource_descs); + + // If there is ambiguity and it didn't clarify as UAVs, skip them, which come later. [[SRV_UAV_AMBIGUITY]] + if (srv_uav_ambiguity && p_bindings[i].res_class != RES_CLASS_UAV) { + set_heap_walkers.resources.advance(num_resource_descs); + } + + resource_used = true; + } + } + + { + const UniformBindingInfo::RootSignatureLocation &rs_loc_sampler = p_bindings[i].root_sig_locations.sampler; + if (rs_loc_sampler.root_param_idx != UINT32_MAX) { // Location used? + DEV_ASSERT(num_sampler_descs); + DEV_ASSERT(!srv_uav_ambiguity); // [[SRV_UAV_AMBIGUITY]] + + bool must_flush_table = tables.samplers && rs_loc_sampler.root_param_idx != tables.samplers->root_param_idx; + if (must_flush_table) { + // Check the root signature data has been filled ordered. + DEV_ASSERT(rs_loc_sampler.root_param_idx > tables.samplers->root_param_idx); + + (p_command_list->*set_root_desc_table_fn)(tables.samplers->root_param_idx, tables.samplers->start_gpu_handle); + tables.samplers = nullptr; + } + + if (unlikely(frame_heap_walkers.samplers->get_free_handles() < num_sampler_descs)) { + if (!frames[frame].desc_heaps_exhausted_reported.samplers) { + frames[frame].desc_heaps_exhausted_reported.samplers = true; + ERR_FAIL_MSG("Cannot bind uniform set because there's no enough room in current frame's SAMPLERS descriptors heap.\n" + "Please increase the value of the rendering/rendering_device/d3d12/max_sampler_descriptors_per_frame project setting."); + } else { + return; + } + } + + if (!tables.samplers) { + DEV_ASSERT(last_bind->root_tables.samplers.size() < last_bind->root_tables.samplers.get_capacity()); + last_bind->root_tables.samplers.resize(last_bind->root_tables.samplers.size() + 1); + tables.samplers = &last_bind->root_tables.samplers[last_bind->root_tables.samplers.size() - 1]; + tables.samplers->root_param_idx = rs_loc_sampler.root_param_idx; + tables.samplers->start_gpu_handle = frame_heap_walkers.samplers->get_curr_gpu_handle(); + } + + // TODO: Batch to avoid multiple calls where possible (in any case, flush before setting root descriptor tables, or even batch that as well). + device->CopyDescriptorsSimple( + num_sampler_descs, + frame_heap_walkers.samplers->get_curr_cpu_handle(), + set_heap_walkers.samplers.get_curr_cpu_handle(), + D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER); + frame_heap_walkers.samplers->advance(num_sampler_descs); + } + } + } + + // Uniform set descriptor heaps are always full (descriptors are created for every uniform in them) despite + // the shader variant a given set is created upon may not need all of them due to DXC optimizations. + // Therefore, at this point we have to advance through the descriptor set descriptor's heap unconditionally. + + set_heap_walkers.resources.advance(num_resource_descs); + if (srv_uav_ambiguity) { + DEV_ASSERT(num_resource_descs); + if (!resource_used) { + set_heap_walkers.resources.advance(num_resource_descs); // Additional skip, since both SRVs and UAVs have to be bypassed. + } + } + + set_heap_walkers.samplers.advance(num_sampler_descs); + } + + DEV_ASSERT(set_heap_walkers.resources.is_at_eof()); + DEV_ASSERT(set_heap_walkers.samplers.is_at_eof()); + + { + bool must_flush_table = tables.resources; + if (must_flush_table) { + (p_command_list->*set_root_desc_table_fn)(tables.resources->root_param_idx, tables.resources->start_gpu_handle); + } + } + { + bool must_flush_table = tables.samplers; + if (must_flush_table) { + (p_command_list->*set_root_desc_table_fn)(tables.samplers->root_param_idx, tables.samplers->start_gpu_handle); + } + } + + last_bind->root_signature_crc = root_sig_crc; + last_bind->execution_index = frames[frame].execution_index; +} + +void RenderingDeviceD3D12::_apply_uniform_set_resource_states(const UniformSet *p_uniform_set, const Shader::Set &p_shader_set) { + for (const UniformSet::StateRequirement &sr : p_uniform_set->resource_states) { +#ifdef DEV_ENABLED + { + uint32_t stages = 0; + D3D12_RESOURCE_STATES wanted_state = {}; + bool writable = false; + // Doing the full loop for debugging since the real one below may break early, + // but we want an exhaustive check + uint64_t inv_uniforms_mask = ~sr.shader_uniform_idx_mask; // Inverting the mask saves operations. + for (uint8_t bit = 0; inv_uniforms_mask != UINT64_MAX; bit++) { + uint64_t bit_mask = ((uint64_t)1 << bit); + if (likely((inv_uniforms_mask & bit_mask))) { + continue; + } + inv_uniforms_mask |= bit_mask; + + const Shader::ShaderUniformInfo &info = p_shader_set.uniforms[bit]; + if (unlikely(!info.binding.stages)) { + continue; + } + + D3D12_RESOURCE_STATES required_states = sr.states; + + // Resolve a case of SRV/UAV ambiguity now. [[SRV_UAV_AMBIGUITY]] + if ((required_states & D3D12_RESOURCE_STATE_ALL_SHADER_RESOURCE) && (required_states & D3D12_RESOURCE_STATE_UNORDERED_ACCESS)) { + if (info.binding.res_class == RES_CLASS_SRV) { + required_states &= ~D3D12_RESOURCE_STATE_UNORDERED_ACCESS; + } else { + required_states = D3D12_RESOURCE_STATE_UNORDERED_ACCESS; + } + } + + if (stages) { // Second occurrence at least? + CRASH_COND_MSG(info.info.writable != writable, "A resource is used in the same uniform set both as R/O and R/W. That's not supported and shouldn't happen."); + CRASH_COND_MSG(required_states != wanted_state, "A resource is used in the same uniform set with different resource states. The code needs to be enhanced to support that."); + } else { + wanted_state = required_states; + stages |= info.binding.stages; + writable = info.info.writable; + } + + DEV_ASSERT((wanted_state == D3D12_RESOURCE_STATE_UNORDERED_ACCESS) == (bool)(wanted_state & D3D12_RESOURCE_STATE_UNORDERED_ACCESS)); + + if (wanted_state == D3D12_RESOURCE_STATE_UNORDERED_ACCESS || wanted_state == D3D12_RESOURCE_STATE_RENDER_TARGET) { + if (!sr.is_buffer) { + Texture *texture = (Texture *)sr.resource; + CRASH_COND_MSG(texture->resource != texture->owner_resource, "The texture format used for UAV or RTV must be the main one."); + } + } + } + } +#endif + + // We may have assumed D3D12_RESOURCE_STATE_ALL_SHADER_RESOURCE for a resource, + // because at uniform set creation time we couldn't know for sure which stages + // it would be used in (due to the fact that a set can be created against a different, + // albeit compatible, shader, which may make a different usage in the end). + // However, now we know and can exclude up to one unneeded state. + + // TODO: If subresources involved already in the needed state, or scheduled for it, + // maybe it's more optimal not to do anything here + + uint32_t stages = 0; + D3D12_RESOURCE_STATES wanted_state = {}; + uint64_t inv_uniforms_mask = ~sr.shader_uniform_idx_mask; // Inverting the mask saves operations. + for (uint8_t bit = 0; inv_uniforms_mask != UINT64_MAX; bit++) { + uint64_t bit_mask = ((uint64_t)1 << bit); + if (likely((inv_uniforms_mask & bit_mask))) { + continue; + } + inv_uniforms_mask |= bit_mask; + + const Shader::ShaderUniformInfo &info = p_shader_set.uniforms[bit]; + if (unlikely(!info.binding.stages)) { + continue; + } + + if (!stages) { + D3D12_RESOURCE_STATES required_states = sr.states; + + // Resolve a case of SRV/UAV ambiguity now. [[SRV_UAV_AMBIGUITY]] + if ((required_states & D3D12_RESOURCE_STATE_ALL_SHADER_RESOURCE) && (required_states & D3D12_RESOURCE_STATE_UNORDERED_ACCESS)) { + if (info.binding.res_class == RES_CLASS_SRV) { + required_states &= ~D3D12_RESOURCE_STATE_UNORDERED_ACCESS; + } else { + required_states = D3D12_RESOURCE_STATE_UNORDERED_ACCESS; + } + } + + wanted_state = required_states; + + if (!(wanted_state & D3D12_RESOURCE_STATE_ALL_SHADER_RESOURCE)) { + // By now, we already know the resource is used, and with no PS/NON_PS disjuntive; no need to check further. + break; + } + } + + stages |= info.binding.stages; + + if (stages == (SHADER_STAGE_VERTEX_BIT | SHADER_STAGE_FRAGMENT_BIT) || stages == SHADER_STAGE_COMPUTE_BIT) { + // By now, we already know the resource is used, and as both PS/NON_PS; no need to check further. + break; + } + } + + if (likely(wanted_state)) { + if ((wanted_state & D3D12_RESOURCE_STATE_ALL_SHADER_RESOURCE)) { + if (stages == SHADER_STAGE_VERTEX_BIT || stages == SHADER_STAGE_COMPUTE_BIT) { + D3D12_RESOURCE_STATES unneeded_states = D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE; + wanted_state &= ~unneeded_states; + } else if (stages == SHADER_STAGE_FRAGMENT_BIT) { + D3D12_RESOURCE_STATES unneeded_states = D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE; + wanted_state &= ~unneeded_states; + } + } + + if (likely(wanted_state)) { + if (sr.is_buffer) { + _resource_transition_batch(sr.resource, 0, 1, wanted_state); + } else { + Texture *texture = (Texture *)sr.resource; + for (uint32_t i = 0; i < texture->layers; i++) { + for (uint32_t j = 0; j < texture->mipmaps; j++) { + uint32_t subresource = D3D12CalcSubresource(texture->base_mipmap + j, texture->base_layer + i, 0, texture->owner_mipmaps, texture->owner_layers); + _resource_transition_batch(texture, subresource, texture->planes, wanted_state, texture->owner_resource); + } + } + } + } + } + } +} + +void RenderingDeviceD3D12::draw_list_set_push_constant(DrawListID p_list, const void *p_data, uint32_t p_data_size) { + DrawList *dl = _get_draw_list_ptr(p_list); + ERR_FAIL_NULL(dl); + +#ifdef DEBUG_ENABLED + ERR_FAIL_COND_MSG(!dl->validation.active, "Submitted Draw Lists can no longer be modified."); +#endif + +#ifdef DEBUG_ENABLED + ERR_FAIL_COND_MSG(p_data_size != dl->validation.pipeline_spirv_push_constant_size, + "This render pipeline requires (" + itos(dl->validation.pipeline_spirv_push_constant_size) + ") bytes of push constant data, supplied: (" + itos(p_data_size) + ")"); +#endif + if (dl->state.pipeline_dxil_push_constant_size) { + dl->command_list->SetGraphicsRoot32BitConstants(0, p_data_size / sizeof(uint32_t), p_data, 0); + } +#ifdef DEBUG_ENABLED + dl->validation.pipeline_push_constant_supplied = true; +#endif +} + +void RenderingDeviceD3D12::draw_list_draw(DrawListID p_list, bool p_use_indices, uint32_t p_instances, uint32_t p_procedural_vertices) { + DrawList *dl = _get_draw_list_ptr(p_list); + ERR_FAIL_NULL(dl); +#ifdef DEBUG_ENABLED + ERR_FAIL_COND_MSG(!dl->validation.active, "Submitted Draw Lists can no longer be modified."); +#endif + +#ifdef DEBUG_ENABLED + ERR_FAIL_COND_MSG(!dl->validation.pipeline_active, + "No render pipeline was set before attempting to draw."); + if (dl->validation.pipeline_vertex_format != INVALID_ID) { + // Pipeline uses vertices, validate format. + ERR_FAIL_COND_MSG(dl->validation.vertex_format == INVALID_ID, + "No vertex array was bound, and render pipeline expects vertices."); + // Make sure format is right. + ERR_FAIL_COND_MSG(dl->validation.pipeline_vertex_format != dl->validation.vertex_format, + "The vertex format used to create the pipeline does not match the vertex format bound."); + // Make sure number of instances is valid. + ERR_FAIL_COND_MSG(p_instances > dl->validation.vertex_max_instances_allowed, + "Number of instances requested (" + itos(p_instances) + " is larger than the maximum number supported by the bound vertex array (" + itos(dl->validation.vertex_max_instances_allowed) + ")."); + } + + if (dl->validation.pipeline_spirv_push_constant_size) { + // Using push constants, check that they were supplied. + ERR_FAIL_COND_MSG(!dl->validation.pipeline_push_constant_supplied, + "The shader in this pipeline requires a push constant to be set before drawing, but it's not present."); + } +#endif + + // Bind descriptor sets. + + Shader *shader = shader_owner.get_or_null(dl->state.pipeline_shader); + struct SetToBind { + uint32_t set; + UniformSet *uniform_set; + const Shader::Set *shader_set; + }; + SetToBind *sets_to_bind = (SetToBind *)alloca(sizeof(SetToBind) * dl->state.set_count); + uint32_t num_sets_to_bind = 0; + for (uint32_t i = 0; i < dl->state.set_count; i++) { + if (dl->state.sets[i].pipeline_expected_format == 0) { + continue; // Nothing expected by this pipeline. + } +#ifdef DEBUG_ENABLED + if (dl->state.sets[i].pipeline_expected_format != dl->state.sets[i].uniform_set_format) { + if (dl->state.sets[i].uniform_set_format == 0) { + ERR_FAIL_MSG("Uniforms were never supplied for set (" + itos(i) + ") at the time of drawing, which are required by the pipeline"); + } else if (uniform_set_owner.owns(dl->state.sets[i].uniform_set)) { + UniformSet *us = uniform_set_owner.get_or_null(dl->state.sets[i].uniform_set); + ERR_FAIL_MSG("Uniforms supplied for set (" + itos(i) + "):\n" + _shader_uniform_debug(us->shader_id, us->shader_set) + "\nare not the same format as required by the pipeline shader. Pipeline shader requires the following bindings:\n" + _shader_uniform_debug(dl->state.pipeline_shader)); + } else { + ERR_FAIL_MSG("Uniforms supplied for set (" + itos(i) + ", which was was just freed) are not the same format as required by the pipeline shader. Pipeline shader requires the following bindings:\n" + _shader_uniform_debug(dl->state.pipeline_shader)); + } + } +#endif + UniformSet *uniform_set = uniform_set_owner.get_or_null(dl->state.sets[i].uniform_set); + const Shader::Set &shader_set = shader->sets[i]; + _apply_uniform_set_resource_states(uniform_set, shader_set); + if (!dl->state.sets[i].bound) { + sets_to_bind[num_sets_to_bind].set = i; + sets_to_bind[num_sets_to_bind].uniform_set = uniform_set; + sets_to_bind[num_sets_to_bind].shader_set = &shader_set; + num_sets_to_bind++; + dl->state.sets[i].bound = true; + } + } + + _resource_transitions_flush(dl->command_list); + + for (uint32_t i = 0; i < num_sets_to_bind; i++) { + _bind_uniform_set(sets_to_bind[i].uniform_set, *sets_to_bind[i].shader_set, pipeline_bindings[dl->state.pipeline_bindings_id][sets_to_bind[i].set], dl->command_list, false); + } + + if (dl->state.bound_pso != dl->state.pso) { + dl->command_list->SetPipelineState(dl->state.pso); + dl->state.bound_pso = dl->state.pso; + } + if (p_use_indices) { +#ifdef DEBUG_ENABLED + ERR_FAIL_COND_MSG(p_procedural_vertices > 0, + "Procedural vertices can't be used together with indices."); + + ERR_FAIL_COND_MSG(!dl->validation.index_array_size, + "Draw command requested indices, but no index buffer was set."); + + ERR_FAIL_COND_MSG(dl->validation.pipeline_uses_restart_indices != dl->validation.index_buffer_uses_restart_indices, + "The usage of restart indices in index buffer does not match the render primitive in the pipeline."); +#endif + uint32_t to_draw = dl->validation.index_array_size; + +#ifdef DEBUG_ENABLED + ERR_FAIL_COND_MSG(to_draw < dl->validation.pipeline_primitive_minimum, + "Too few indices (" + itos(to_draw) + ") for the render primitive set in the render pipeline (" + itos(dl->validation.pipeline_primitive_minimum) + ")."); + + ERR_FAIL_COND_MSG((to_draw % dl->validation.pipeline_primitive_divisor) != 0, + "Index amount (" + itos(to_draw) + ") must be a multiple of the amount of indices required by the render primitive (" + itos(dl->validation.pipeline_primitive_divisor) + ")."); +#endif + + dl->command_list->DrawIndexedInstanced(to_draw, p_instances, dl->validation.index_array_offset, 0, 0); + } else { + uint32_t to_draw; + + if (p_procedural_vertices > 0) { +#ifdef DEBUG_ENABLED + ERR_FAIL_COND_MSG(dl->validation.pipeline_vertex_format != INVALID_ID, + "Procedural vertices requested, but pipeline expects a vertex array."); +#endif + to_draw = p_procedural_vertices; + } else { +#ifdef DEBUG_ENABLED + ERR_FAIL_COND_MSG(dl->validation.pipeline_vertex_format == INVALID_ID, + "Draw command lacks indices, but pipeline format does not use vertices."); +#endif + to_draw = dl->validation.vertex_array_size; + } + +#ifdef DEBUG_ENABLED + ERR_FAIL_COND_MSG(to_draw < dl->validation.pipeline_primitive_minimum, + "Too few vertices (" + itos(to_draw) + ") for the render primitive set in the render pipeline (" + itos(dl->validation.pipeline_primitive_minimum) + ")."); + + ERR_FAIL_COND_MSG((to_draw % dl->validation.pipeline_primitive_divisor) != 0, + "Vertex amount (" + itos(to_draw) + ") must be a multiple of the amount of vertices required by the render primitive (" + itos(dl->validation.pipeline_primitive_divisor) + ")."); +#endif + + dl->command_list->DrawInstanced(to_draw, p_instances, 0, 0); + } +} + +void RenderingDeviceD3D12::draw_list_enable_scissor(DrawListID p_list, const Rect2 &p_rect) { + DrawList *dl = _get_draw_list_ptr(p_list); + + ERR_FAIL_NULL(dl); +#ifdef DEBUG_ENABLED + ERR_FAIL_COND_MSG(!dl->validation.active, "Submitted Draw Lists can no longer be modified."); +#endif + Rect2i rect = p_rect; + rect.position += dl->viewport.position; + + rect = dl->viewport.intersection(rect); + + if (rect.get_area() == 0) { + return; + } + CD3DX12_RECT scissor( + rect.position.x, + rect.position.y, + rect.position.x + rect.size.width, + rect.position.y + rect.size.height); + + dl->command_list->RSSetScissorRects(1, &scissor); +} + +void RenderingDeviceD3D12::draw_list_disable_scissor(DrawListID p_list) { + DrawList *dl = _get_draw_list_ptr(p_list); + ERR_FAIL_NULL(dl); +#ifdef DEBUG_ENABLED + ERR_FAIL_COND_MSG(!dl->validation.active, "Submitted Draw Lists can no longer be modified."); +#endif + + CD3DX12_RECT scissor( + dl->viewport.position.x, + dl->viewport.position.y, + dl->viewport.position.x + dl->viewport.size.width, + dl->viewport.position.y + dl->viewport.size.height); + dl->command_list->RSSetScissorRects(1, &scissor); +} + +uint32_t RenderingDeviceD3D12::draw_list_get_current_pass() { + return draw_list_current_subpass; +} + +void RenderingDeviceD3D12::_draw_list_subpass_begin() { // [[MANUAL_SUBPASSES]] + const FramebufferFormat &fb_format = framebuffer_formats[draw_list_framebuffer->format_id]; + const FramebufferPass &pass = fb_format.passes[draw_list_current_subpass]; + + ID3D12GraphicsCommandList *command_list = frames[frame].draw_command_list.Get(); + + bool is_screen = draw_list_framebuffer->window_id != DisplayServer::INVALID_WINDOW_ID; + + if (is_screen) { + DEV_ASSERT(!draw_list_framebuffer->dsv_heap.get_descriptor_count()); + command_list->OMSetRenderTargets(1, &draw_list_framebuffer->screen_rtv_handle, true, nullptr); + } else { + D3D12_CPU_DESCRIPTOR_HANDLE *rtv_handles = (D3D12_CPU_DESCRIPTOR_HANDLE *)alloca(sizeof(D3D12_CPU_DESCRIPTOR_HANDLE) * pass.color_attachments.size()); + DescriptorsHeap::Walker rtv_heap_walker = draw_list_framebuffer->rtv_heap.make_walker(); + for (int i = 0; i < pass.color_attachments.size(); i++) { + uint32_t attachment = pass.color_attachments[i]; + if (attachment == FramebufferPass::ATTACHMENT_UNUSED) { + if (!frames[frame].null_rtv_handle.ptr) { + // No null descriptor-handle created for this frame yet. + + if (frames[frame].desc_heap_walkers.rtv.is_at_eof()) { + if (!frames[frame].desc_heaps_exhausted_reported.rtv) { + frames[frame].desc_heaps_exhausted_reported.rtv = true; + ERR_FAIL_MSG("Cannot begin subpass because there's no enough room in current frame's RENDER TARGET descriptors heap.\n" + "Please increase the value of the rendering/rendering_device/d3d12/max_misc_descriptors_per_frame project setting."); + } else { + return; + } + } + + D3D12_RENDER_TARGET_VIEW_DESC rtv_desc_null = {}; + rtv_desc_null.Format = DXGI_FORMAT_R8_UINT; + rtv_desc_null.ViewDimension = D3D12_RTV_DIMENSION_TEXTURE2D; + frames[frame].null_rtv_handle = frames[frame].desc_heap_walkers.rtv.get_curr_cpu_handle(); + device->CreateRenderTargetView(nullptr, &rtv_desc_null, frames[frame].null_rtv_handle); + frames[frame].desc_heap_walkers.rtv.advance(); + } + rtv_handles[i] = frames[frame].null_rtv_handle; + } else { + uint32_t rt_index = draw_list_framebuffer->attachments_handle_inds[attachment]; + rtv_heap_walker.rewind(); + rtv_heap_walker.advance(rt_index); + rtv_handles[i] = rtv_heap_walker.get_curr_cpu_handle(); + } + } + + D3D12_CPU_DESCRIPTOR_HANDLE dsv_handle = {}; + { + DescriptorsHeap::Walker dsv_heap_walker = draw_list_framebuffer->dsv_heap.make_walker(); + if (pass.depth_attachment != FramebufferPass::ATTACHMENT_UNUSED) { + uint32_t ds_index = draw_list_framebuffer->attachments_handle_inds[pass.depth_attachment]; + dsv_heap_walker.rewind(); + dsv_heap_walker.advance(ds_index); + dsv_handle = dsv_heap_walker.get_curr_cpu_handle(); + } + } + + command_list->OMSetRenderTargets(pass.color_attachments.size(), rtv_handles, false, dsv_handle.ptr ? &dsv_handle : nullptr); + + // [[VRS_EVERY_SUBPASS_OR_NONE]] + if (context->get_vrs_capabilities().ss_image_supported && draw_list_current_subpass == 0) { + if (execution_index != vrs_state_execution_index) { + vrs_state = {}; + } + + Texture *vrs_texture = nullptr; + RID vrs_texture_id; + if (pass.vrs_attachment != FramebufferPass::ATTACHMENT_UNUSED) { + vrs_texture_id = draw_list_framebuffer->texture_ids[pass.vrs_attachment]; + vrs_texture = texture_owner.get_or_null(vrs_texture_id); + if (!vrs_texture) { + vrs_texture_id = RID(); + } + } + + if (vrs_texture_id != vrs_state.texture_bound) { + ID3D12GraphicsCommandList5 *command_list_5 = nullptr; + command_list->QueryInterface<ID3D12GraphicsCommandList5>(&command_list_5); + DEV_ASSERT(command_list_5); + + if (vrs_texture_id.is_valid()) { + if (!vrs_state.configured) { + static const D3D12_SHADING_RATE_COMBINER combiners[D3D12_RS_SET_SHADING_RATE_COMBINER_COUNT] = { + D3D12_SHADING_RATE_COMBINER_PASSTHROUGH, + D3D12_SHADING_RATE_COMBINER_OVERRIDE, + }; + command_list_5->RSSetShadingRate(D3D12_SHADING_RATE_1X1, combiners); + vrs_state.configured = true; + + command_list_5->RSSetShadingRateImage(vrs_texture->resource); + vrs_state.texture_bound = vrs_texture_id; + } + } else { + command_list_5->RSSetShadingRateImage(nullptr); + vrs_state.texture_bound = RID(); + } + + command_list_5->Release(); + } + + vrs_state_execution_index = execution_index; + } + } +} + +void RenderingDeviceD3D12::_draw_list_subpass_end() { // [[MANUAL_SUBPASSES]] + const FramebufferFormat &fb_format = framebuffer_formats[draw_list_framebuffer->format_id]; + const FramebufferPass &pass = fb_format.passes[draw_list_current_subpass]; + + ID3D12GraphicsCommandList *command_list = frames[frame].draw_command_list.Get(); + + struct Resolve { + ID3D12Resource *src_res; + uint32_t src_subres; + ID3D12Resource *dst_res; + uint32_t dst_subres; + DXGI_FORMAT format; + }; + Resolve *resolves = (Resolve *)alloca(sizeof(Resolve) * pass.resolve_attachments.size()); + uint32_t num_resolves = 0; + + for (int i = 0; i < pass.resolve_attachments.size(); i++) { + int32_t color_index = pass.color_attachments[i]; + int32_t resolve_index = pass.resolve_attachments[i]; + DEV_ASSERT((color_index == FramebufferPass::ATTACHMENT_UNUSED) == (resolve_index == FramebufferPass::ATTACHMENT_UNUSED)); + if (color_index == FramebufferPass::ATTACHMENT_UNUSED || draw_list_framebuffer->texture_ids[color_index].is_null()) { + continue; + } + + Texture *src_tex = texture_owner.get_or_null(draw_list_framebuffer->texture_ids[color_index]); + uint32_t src_subresource = D3D12CalcSubresource(src_tex->base_mipmap, src_tex->base_layer, 0, src_tex->owner_mipmaps, src_tex->owner_layers); + _resource_transition_batch(src_tex, src_subresource, src_tex->planes, D3D12_RESOURCE_STATE_RESOLVE_SOURCE); + + Texture *dst_tex = texture_owner.get_or_null(draw_list_framebuffer->texture_ids[resolve_index]); + uint32_t dst_subresource = D3D12CalcSubresource(dst_tex->base_mipmap, dst_tex->base_layer, 0, dst_tex->owner_mipmaps, dst_tex->owner_layers); + _resource_transition_batch(dst_tex, dst_subresource, dst_tex->planes, D3D12_RESOURCE_STATE_RESOLVE_DEST); + + resolves[num_resolves].src_res = src_tex->resource; + resolves[num_resolves].src_subres = src_subresource; + resolves[num_resolves].dst_res = dst_tex->resource; + resolves[num_resolves].dst_subres = dst_subresource; + resolves[num_resolves].format = d3d12_formats[src_tex->format].general_format; + num_resolves++; + } + + _resource_transitions_flush(command_list); + + for (uint32_t i = 0; i < num_resolves; i++) { + command_list->ResolveSubresource(resolves[i].dst_res, resolves[i].dst_subres, resolves[i].src_res, resolves[i].src_subres, resolves[i].format); + } +} + +RenderingDevice::DrawListID RenderingDeviceD3D12::draw_list_switch_to_next_pass() { + _THREAD_SAFE_METHOD_ + ERR_FAIL_COND_V(draw_list == nullptr, INVALID_ID); + ERR_FAIL_COND_V(draw_list_current_subpass >= draw_list_subpass_count - 1, INVALID_FORMAT_ID); + + _draw_list_subpass_end(); + draw_list_current_subpass++; + _draw_list_subpass_begin(); + + Rect2i viewport; + _draw_list_free(&viewport); + + _draw_list_allocate(viewport, 0, draw_list_current_subpass); + + return int64_t(ID_TYPE_DRAW_LIST) << ID_BASE_SHIFT; +} + +Error RenderingDeviceD3D12::draw_list_switch_to_next_pass_split(uint32_t p_splits, DrawListID *r_split_ids) { + _THREAD_SAFE_METHOD_ + ERR_FAIL_COND_V(draw_list == nullptr, ERR_INVALID_PARAMETER); + ERR_FAIL_COND_V(draw_list_current_subpass >= draw_list_subpass_count - 1, ERR_INVALID_PARAMETER); + + _draw_list_subpass_end(); + draw_list_current_subpass++; + _draw_list_subpass_begin(); + + Rect2i viewport; + _draw_list_free(&viewport); + + _draw_list_allocate(viewport, p_splits, draw_list_current_subpass); + + for (uint32_t i = 0; i < p_splits; i++) { + r_split_ids[i] = (int64_t(ID_TYPE_SPLIT_DRAW_LIST) << ID_BASE_SHIFT) + i; + } + + return OK; +} + +Error RenderingDeviceD3D12::_draw_list_allocate(const Rect2i &p_viewport, uint32_t p_splits, uint32_t p_subpass) { + if (p_splits == 0) { + draw_list = memnew(DrawList); + draw_list->command_list = frames[frame].draw_command_list.Get(); + draw_list->viewport = p_viewport; + draw_list_count = 0; + draw_list_split = false; + } else { + if (p_splits > (uint32_t)split_draw_list_allocators.size()) { + uint32_t from = split_draw_list_allocators.size(); + split_draw_list_allocators.resize(p_splits); + for (uint32_t i = from; i < p_splits; i++) { + HRESULT res = device->CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_BUNDLE, IID_PPV_ARGS(&split_draw_list_allocators.write[i].command_allocator)); + ERR_FAIL_COND_V_MSG(res, ERR_CANT_CREATE, "CreateCommandAllocator failed with error " + vformat("0x%08ux", res) + "."); + + for (int j = 0; j < frame_count; j++) { + ID3D12GraphicsCommandList *command_list = nullptr; + + res = device->CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_BUNDLE, split_draw_list_allocators[i].command_allocator, nullptr, IID_PPV_ARGS(&command_list)); + ERR_FAIL_COND_V_MSG(res, ERR_CANT_CREATE, "CreateCommandList failed with error " + vformat("0x%08ux", res) + "."); + + split_draw_list_allocators.write[i].command_lists.push_back(command_list); + } + } + } + draw_list = memnew_arr(DrawList, p_splits); + draw_list_count = p_splits; + draw_list_split = true; + + for (uint32_t i = 0; i < p_splits; i++) { + ID3D12GraphicsCommandList *command_list = split_draw_list_allocators[i].command_lists[frame]; + + HRESULT res = frames[frame].setup_command_allocator->Reset(); + ERR_FAIL_COND_V_MSG(ERR_CANT_CREATE, ERR_CANT_CREATE, "Command allocator Reset failed with error " + vformat("0x%08ux", res) + "."); + res = command_list->Reset(split_draw_list_allocators[i].command_allocator, nullptr); + if (res) { + memdelete_arr(draw_list); + draw_list = nullptr; + ERR_FAIL_V_MSG(ERR_CANT_CREATE, "Command allocator Reset failed with error " + vformat("0x%08ux", res) + "."); + } + + draw_list[i].command_list = command_list; + draw_list[i].viewport = p_viewport; + } + } + + return OK; +} + +void RenderingDeviceD3D12::_draw_list_free(Rect2i *r_last_viewport) { + if (draw_list_split) { + // Send all command buffers. + for (uint32_t i = 0; i < draw_list_count; i++) { + draw_list[i].command_list->Close(); + frames[frame].draw_command_list->ExecuteBundle(draw_list[i].command_list); + if (r_last_viewport) { + if (i == 0 || draw_list[i].viewport_set) { + *r_last_viewport = draw_list[i].viewport; + } + } + } + + memdelete_arr(draw_list); + draw_list = nullptr; + + } else { + if (r_last_viewport) { + *r_last_viewport = draw_list->viewport; + } + // Just end the list. + memdelete(draw_list); + draw_list = nullptr; + } + + draw_list_count = 0; +} + +void RenderingDeviceD3D12::draw_list_end(BitField<BarrierMask> p_post_barrier) { + _THREAD_SAFE_METHOD_ + + ERR_FAIL_COND_MSG(!draw_list, "Immediate draw list is already inactive."); + + _draw_list_subpass_end(); + + const FramebufferFormat &fb_format = framebuffer_formats[draw_list_framebuffer->format_id]; + bool is_screen = draw_list_framebuffer->window_id != DisplayServer::INVALID_WINDOW_ID; + + ID3D12GraphicsCommandList *command_list = frames[frame].draw_command_list.Get(); + + for (int i = 0; i < fb_format.attachments.size(); i++) { + Texture *texture = nullptr; + if (!is_screen) { + texture = texture_owner.get_or_null(draw_list_framebuffer->texture_ids[i]); + } + if ((fb_format.attachments[i].usage_flags & TEXTURE_USAGE_COLOR_ATTACHMENT_BIT)) { + switch (draw_list_final_color_action) { + case FINAL_ACTION_READ: { + // Nothing to do now. + } break; + case FINAL_ACTION_DISCARD: { + ID3D12Resource *resource = is_screen ? context->window_get_framebuffer_texture(draw_list_framebuffer->window_id) : texture->resource; + command_list->DiscardResource(resource, nullptr); + } break; + case FINAL_ACTION_CONTINUE: { + ERR_FAIL_COND(draw_list_unbind_color_textures); // Bug! + } break; + } + } else if ((fb_format.attachments[i].usage_flags & TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT)) { + ERR_FAIL_COND(is_screen); // Bug! + switch (draw_list_final_depth_action) { + case FINAL_ACTION_READ: { + // Nothing to do now. + } break; + case FINAL_ACTION_DISCARD: { + ID3D12Resource *resource = is_screen ? context->window_get_framebuffer_texture(draw_list_framebuffer->window_id) : texture->resource; + command_list->DiscardResource(resource, nullptr); + } break; + case FINAL_ACTION_CONTINUE: { + ERR_FAIL_COND(draw_list_unbind_depth_textures); // Bug! + } break; + } + } + } + + draw_list_subpass_count = 0; + draw_list_current_subpass = 0; + draw_list_framebuffer = nullptr; + + _draw_list_free(); + + for (int i = 0; i < draw_list_bound_textures.size(); i++) { + Texture *texture = texture_owner.get_or_null(draw_list_bound_textures[i]); + ERR_CONTINUE(!texture); // Wtf. + if (draw_list_unbind_color_textures && (texture->usage_flags & TEXTURE_USAGE_COLOR_ATTACHMENT_BIT)) { + texture->bound = false; + } + if (draw_list_unbind_depth_textures && (texture->usage_flags & TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT)) { + texture->bound = false; + } + } + draw_list_bound_textures.clear(); +} + +/***********************/ +/**** COMPUTE LISTS ****/ +/***********************/ + +RenderingDevice::ComputeListID RenderingDeviceD3D12::compute_list_begin(bool p_allow_draw_overlap) { + _THREAD_SAFE_METHOD_ + + ERR_FAIL_COND_V_MSG(!p_allow_draw_overlap && draw_list != nullptr, INVALID_ID, "Only one draw list can be active at the same time."); + ERR_FAIL_COND_V_MSG(compute_list != nullptr, INVALID_ID, "Only one draw/compute list can be active at the same time."); + + compute_list = memnew(ComputeList); + compute_list->command_list = frames[frame].draw_command_list.Get(); + compute_list->state.allow_draw_overlap = p_allow_draw_overlap; + + return ID_TYPE_COMPUTE_LIST; +} + +void RenderingDeviceD3D12::compute_list_bind_compute_pipeline(ComputeListID p_list, RID p_compute_pipeline) { + // Must be called within a compute list, the class mutex is locked during that time + + ERR_FAIL_COND(p_list != ID_TYPE_COMPUTE_LIST); + ERR_FAIL_NULL(compute_list); + + ComputeList *cl = compute_list; + + const ComputePipeline *pipeline = compute_pipeline_owner.get_or_null(p_compute_pipeline); + ERR_FAIL_NULL(pipeline); + + if (p_compute_pipeline == cl->state.pipeline) { + return; // Redundant state, return. + } + + cl->state.pipeline = p_compute_pipeline; + cl->state.pso = pipeline->pso.Get(); + + Shader *shader = shader_owner.get_or_null(pipeline->shader); + + if (cl->state.pipeline_shader != pipeline->shader) { + if (cl->state.root_signature_crc != pipeline->root_signature_crc) { + cl->command_list->SetComputeRootSignature(shader->root_signature.Get()); + cl->state.root_signature_crc = pipeline->root_signature_crc; + // Root signature changed, so current descriptor set bindings become invalid. + for (uint32_t i = 0; i < cl->state.set_count; i++) { + cl->state.sets[i].bound = false; + } + } + + const uint32_t *pformats = pipeline->set_formats.ptr(); // Pipeline set formats. + cl->state.set_count = pipeline->set_formats.size(); // Update set count. + for (uint32_t i = 0; i < cl->state.set_count; i++) { + cl->state.sets[i].pipeline_expected_format = pformats[i]; +#ifdef DEV_ENABLED + cl->state.sets[i]._pipeline_expected_format = pformats[i] ? &uniform_set_format_cache_reverse[pformats[i] - 1]->key().uniform_info : nullptr; +#endif + } + + if (pipeline->spirv_push_constant_size) { +#ifdef DEBUG_ENABLED + cl->validation.pipeline_push_constant_supplied = false; +#endif + } + + cl->state.pipeline_shader = pipeline->shader; + cl->state.pipeline_dxil_push_constant_size = pipeline->dxil_push_constant_size; + cl->state.pipeline_bindings_id = pipeline->bindings_id; + cl->state.local_group_size[0] = pipeline->local_group_size[0]; + cl->state.local_group_size[1] = pipeline->local_group_size[1]; + cl->state.local_group_size[2] = pipeline->local_group_size[2]; +#ifdef DEV_ENABLED + cl->state._shader = shader; +#endif + } + +#ifdef DEBUG_ENABLED + // Update compute pass pipeline info. + cl->validation.pipeline_active = true; + cl->validation.pipeline_spirv_push_constant_size = pipeline->spirv_push_constant_size; +#endif +} + +void RenderingDeviceD3D12::compute_list_bind_uniform_set(ComputeListID p_list, RID p_uniform_set, uint32_t p_index) { + // Must be called within a compute list, the class mutex is locked during that time + + ERR_FAIL_COND(p_list != ID_TYPE_COMPUTE_LIST); + ERR_FAIL_NULL(compute_list); + + ComputeList *cl = compute_list; + +#ifdef DEBUG_ENABLED + ERR_FAIL_COND_MSG(!cl->validation.active, "Submitted Compute Lists can no longer be modified."); +#endif + + UniformSet *uniform_set = uniform_set_owner.get_or_null(p_uniform_set); + ERR_FAIL_NULL(uniform_set); + + if (p_index > cl->state.set_count) { + cl->state.set_count = p_index; + } + + cl->state.sets[p_index].bound = false; // Needs rebind. + cl->state.sets[p_index].uniform_set_format = uniform_set->format; + cl->state.sets[p_index].uniform_set = p_uniform_set; +#ifdef DEV_ENABLED + cl->state.sets[p_index]._uniform_set = uniform_set_owner.get_or_null(p_uniform_set); +#endif +} + +void RenderingDeviceD3D12::compute_list_set_push_constant(ComputeListID p_list, const void *p_data, uint32_t p_data_size) { + ERR_FAIL_COND(p_list != ID_TYPE_COMPUTE_LIST); + ERR_FAIL_NULL(compute_list); + + ComputeList *cl = compute_list; + +#ifdef DEBUG_ENABLED + ERR_FAIL_COND_MSG(!cl->validation.active, "Submitted Compute Lists can no longer be modified."); +#endif + +#ifdef DEBUG_ENABLED + ERR_FAIL_COND_MSG(p_data_size != cl->validation.pipeline_spirv_push_constant_size, + "This render pipeline requires (" + itos(cl->validation.pipeline_spirv_push_constant_size) + ") bytes of push constant data, supplied: (" + itos(p_data_size) + ")"); +#endif + if (cl->state.pipeline_dxil_push_constant_size) { + cl->command_list->SetComputeRoot32BitConstants(0, p_data_size / sizeof(uint32_t), p_data, 0); + } +#ifdef DEBUG_ENABLED + cl->validation.pipeline_push_constant_supplied = true; +#endif +} + +void RenderingDeviceD3D12::compute_list_dispatch(ComputeListID p_list, uint32_t p_x_groups, uint32_t p_y_groups, uint32_t p_z_groups) { + // Must be called within a compute list, the class mutex is locked during that time + + ERR_FAIL_COND(p_list != ID_TYPE_COMPUTE_LIST); + ERR_FAIL_NULL(compute_list); + + ComputeList *cl = compute_list; + +#ifdef DEBUG_ENABLED + ERR_FAIL_COND_MSG(p_x_groups == 0, "Dispatch amount of X compute groups (" + itos(p_x_groups) + ") is zero."); + ERR_FAIL_COND_MSG(p_z_groups == 0, "Dispatch amount of Z compute groups (" + itos(p_z_groups) + ") is zero."); + ERR_FAIL_COND_MSG(p_y_groups == 0, "Dispatch amount of Y compute groups (" + itos(p_y_groups) + ") is zero."); + ERR_FAIL_COND_MSG(p_x_groups > D3D12_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, + "Dispatch amount of X compute groups (" + itos(p_x_groups) + ") is larger than device limit (" + itos(D3D12_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION) + ")"); + ERR_FAIL_COND_MSG(p_y_groups > D3D12_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, + "Dispatch amount of Y compute groups (" + itos(p_x_groups) + ") is larger than device limit (" + itos(D3D12_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION) + ")"); + ERR_FAIL_COND_MSG(p_z_groups > D3D12_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION, + "Dispatch amount of Z compute groups (" + itos(p_x_groups) + ") is larger than device limit (" + itos(D3D12_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION) + ")"); + + ERR_FAIL_COND_MSG(!cl->validation.active, "Submitted Compute Lists can no longer be modified."); +#endif + +#ifdef DEBUG_ENABLED + + ERR_FAIL_COND_MSG(!cl->validation.pipeline_active, "No compute pipeline was set before attempting to draw."); + + if (cl->validation.pipeline_spirv_push_constant_size) { + // Using push constants, check that they were supplied. + ERR_FAIL_COND_MSG(!cl->validation.pipeline_push_constant_supplied, + "The shader in this pipeline requires a push constant to be set before drawing, but it's not present."); + } + +#endif + + // Bind descriptor sets. + Shader *shader = shader_owner.get_or_null(cl->state.pipeline_shader); + struct SetToBind { + uint32_t set; + UniformSet *uniform_set; + const Shader::Set *shader_set; + }; + SetToBind *sets_to_bind = (SetToBind *)alloca(sizeof(SetToBind) * cl->state.set_count); + uint32_t num_sets_to_bind = 0; + for (uint32_t i = 0; i < cl->state.set_count; i++) { + if (cl->state.sets[i].pipeline_expected_format == 0) { + continue; // Nothing expected by this pipeline. + } +#ifdef DEBUG_ENABLED + if (cl->state.sets[i].pipeline_expected_format != cl->state.sets[i].uniform_set_format) { + if (cl->state.sets[i].uniform_set_format == 0) { + ERR_FAIL_MSG("Uniforms were never supplied for set (" + itos(i) + ") at the time of drawing, which are required by the pipeline"); + } else if (uniform_set_owner.owns(cl->state.sets[i].uniform_set)) { + UniformSet *us = uniform_set_owner.get_or_null(cl->state.sets[i].uniform_set); + ERR_FAIL_MSG("Uniforms supplied for set (" + itos(i) + "):\n" + _shader_uniform_debug(us->shader_id, us->shader_set) + "\nare not the same format as required by the pipeline shader. Pipeline shader requires the following bindings:\n" + _shader_uniform_debug(cl->state.pipeline_shader)); + } else { + ERR_FAIL_MSG("Uniforms supplied for set (" + itos(i) + ", which was was just freed) are not the same format as required by the pipeline shader. Pipeline shader requires the following bindings:\n" + _shader_uniform_debug(cl->state.pipeline_shader)); + } + } +#endif + UniformSet *uniform_set = uniform_set_owner.get_or_null(cl->state.sets[i].uniform_set); + const Shader::Set &shader_set = shader->sets[i]; + _apply_uniform_set_resource_states(uniform_set, shader_set); + if (!cl->state.sets[i].bound) { + sets_to_bind[num_sets_to_bind].set = i; + sets_to_bind[num_sets_to_bind].uniform_set = uniform_set; + sets_to_bind[num_sets_to_bind].shader_set = &shader_set; + num_sets_to_bind++; + cl->state.sets[i].bound = true; + } + } + + _resource_transitions_flush(cl->command_list); + + for (uint32_t i = 0; i < num_sets_to_bind; i++) { + _bind_uniform_set(sets_to_bind[i].uniform_set, *sets_to_bind[i].shader_set, pipeline_bindings[cl->state.pipeline_bindings_id][sets_to_bind[i].set], cl->command_list, true); + } + + if (cl->state.bound_pso != cl->state.pso) { + cl->command_list->SetPipelineState(cl->state.pso); + cl->state.bound_pso = cl->state.pso; + } + cl->command_list->Dispatch(p_x_groups, p_y_groups, p_z_groups); +} + +void RenderingDeviceD3D12::compute_list_dispatch_threads(ComputeListID p_list, uint32_t p_x_threads, uint32_t p_y_threads, uint32_t p_z_threads) { + ERR_FAIL_COND(p_list != ID_TYPE_COMPUTE_LIST); + ERR_FAIL_NULL(compute_list); + +#ifdef DEBUG_ENABLED + ERR_FAIL_COND_MSG(p_x_threads == 0, "Dispatch amount of X compute threads (" + itos(p_x_threads) + ") is zero."); + ERR_FAIL_COND_MSG(p_y_threads == 0, "Dispatch amount of Y compute threads (" + itos(p_y_threads) + ") is zero."); + ERR_FAIL_COND_MSG(p_z_threads == 0, "Dispatch amount of Z compute threads (" + itos(p_z_threads) + ") is zero."); +#endif + + ComputeList *cl = compute_list; + +#ifdef DEBUG_ENABLED + + ERR_FAIL_COND_MSG(!cl->validation.pipeline_active, "No compute pipeline was set before attempting to draw."); + + if (cl->validation.pipeline_spirv_push_constant_size) { + // Using push constants, check that they were supplied. + ERR_FAIL_COND_MSG(!cl->validation.pipeline_push_constant_supplied, + "The shader in this pipeline requires a push constant to be set before drawing, but it's not present."); + } + +#endif + + compute_list_dispatch(p_list, (p_x_threads - 1) / cl->state.local_group_size[0] + 1, (p_y_threads - 1) / cl->state.local_group_size[1] + 1, (p_z_threads - 1) / cl->state.local_group_size[2] + 1); +} + +void RenderingDeviceD3D12::compute_list_dispatch_indirect(ComputeListID p_list, RID p_buffer, uint32_t p_offset) { + ERR_FAIL_COND(p_list != ID_TYPE_COMPUTE_LIST); + ERR_FAIL_NULL(compute_list); + + ComputeList *cl = compute_list; + Buffer *buffer = storage_buffer_owner.get_or_null(p_buffer); + ERR_FAIL_NULL(buffer); + + ERR_FAIL_COND_MSG(!(buffer->usage & D3D12_RESOURCE_STATE_INDIRECT_ARGUMENT), "Buffer provided was not created to do indirect dispatch."); + + ERR_FAIL_COND_MSG(p_offset + 12 > buffer->size, "Offset provided (+12) is past the end of buffer."); + +#ifdef DEBUG_ENABLED + + ERR_FAIL_COND_MSG(!cl->validation.pipeline_active, "No compute pipeline was set before attempting to draw."); + + if (cl->validation.pipeline_spirv_push_constant_size) { + // Using push constants, check that they were supplied. + ERR_FAIL_COND_MSG(!cl->validation.pipeline_push_constant_supplied, + "The shader in this pipeline requires a push constant to be set before drawing, but it's not present."); + } + +#endif + + // Bind descriptor sets. + + Shader *shader = shader_owner.get_or_null(cl->state.pipeline_shader); + struct SetToBind { + uint32_t set; + UniformSet *uniform_set; + const Shader::Set *shader_set; + }; + SetToBind *sets_to_bind = (SetToBind *)alloca(sizeof(SetToBind) * cl->state.set_count); + uint32_t num_sets_to_bind = 0; + for (uint32_t i = 0; i < cl->state.set_count; i++) { + if (cl->state.sets[i].pipeline_expected_format == 0) { + continue; // Nothing expected by this pipeline. + } +#ifdef DEBUG_ENABLED + if (cl->state.sets[i].pipeline_expected_format != cl->state.sets[i].uniform_set_format) { + if (cl->state.sets[i].uniform_set_format == 0) { + ERR_FAIL_MSG("Uniforms were never supplied for set (" + itos(i) + ") at the time of drawing, which are required by the pipeline"); + } else if (uniform_set_owner.owns(cl->state.sets[i].uniform_set)) { + UniformSet *us = uniform_set_owner.get_or_null(cl->state.sets[i].uniform_set); + ERR_FAIL_MSG("Uniforms supplied for set (" + itos(i) + "):\n" + _shader_uniform_debug(us->shader_id, us->shader_set) + "\nare not the same format as required by the pipeline shader. Pipeline shader requires the following bindings:\n" + _shader_uniform_debug(cl->state.pipeline_shader)); + } else { + ERR_FAIL_MSG("Uniforms supplied for set (" + itos(i) + ", which was was just freed) are not the same format as required by the pipeline shader. Pipeline shader requires the following bindings:\n" + _shader_uniform_debug(cl->state.pipeline_shader)); + } + } +#endif + UniformSet *uniform_set = uniform_set_owner.get_or_null(cl->state.sets[i].uniform_set); + const Shader::Set &shader_set = shader->sets[i]; + _apply_uniform_set_resource_states(uniform_set, shader_set); + if (!cl->state.sets[i].bound) { + sets_to_bind[num_sets_to_bind].set = i; + sets_to_bind[num_sets_to_bind].uniform_set = uniform_set; + sets_to_bind[num_sets_to_bind].shader_set = &shader_set; + num_sets_to_bind++; + cl->state.sets[i].bound = true; + } + } + + _resource_transition_batch(buffer, 0, 1, D3D12_RESOURCE_STATE_INDIRECT_ARGUMENT); + + _resource_transitions_flush(cl->command_list); + + for (uint32_t i = 0; i < num_sets_to_bind; i++) { + _bind_uniform_set(sets_to_bind[i].uniform_set, *sets_to_bind[i].shader_set, pipeline_bindings[cl->state.pipeline_bindings_id][sets_to_bind[i].set], cl->command_list, true); + } + + if (cl->state.bound_pso != cl->state.pso) { + cl->command_list->SetPipelineState(cl->state.pso); + cl->state.bound_pso = cl->state.pso; + } + cl->command_list->ExecuteIndirect(indirect_dispatch_cmd_sig.Get(), 1, buffer->resource, p_offset, nullptr, 0); +} + +void RenderingDeviceD3D12::compute_list_add_barrier(ComputeListID p_list) { + // Must be called within a compute list, the class mutex is locked during that time + +#ifdef FORCE_FULL_BARRIER + full_barrier(); +#else + // Due to D3D12 resource-wise barriers, this is no op. +#endif +} + +void RenderingDeviceD3D12::compute_list_end(BitField<BarrierMask> p_post_barrier) { + ERR_FAIL_NULL(compute_list); + +#ifdef FORCE_FULL_BARRIER + full_barrier(); +#endif + + memdelete(compute_list); + compute_list = nullptr; +} + +void RenderingDeviceD3D12::barrier(BitField<BarrierMask> p_from, BitField<BarrierMask> p_to) { + // Due to D3D12 resource-wise barriers, this is no op. +} + +void RenderingDeviceD3D12::full_barrier() { +#ifndef DEBUG_ENABLED + ERR_PRINT("Full barrier is debug-only, should not be used in production"); +#endif + + // In the resource barriers world, we can force a full barrier by discarding some resource, as per + // https://microsoft.github.io/DirectX-Specs/d3d/D3D12EnhancedBarriers.html#synchronous-copy-discard-and-resolve. + frames[frame].draw_command_list->DiscardResource(texture_owner.get_or_null(aux_resource)->resource, nullptr); +} + +void RenderingDeviceD3D12::_free_internal(RID p_id) { +#ifdef DEV_ENABLED + String resource_name; + if (resource_names.has(p_id)) { + resource_name = resource_names[p_id]; + resource_names.erase(p_id); + } +#endif + + // Push everything so it's disposed of next time this frame index is processed (means, it's safe to do it). + if (texture_owner.owns(p_id)) { + Texture *texture = texture_owner.get_or_null(p_id); + frames[frame].textures_to_dispose_of.push_back(*texture); + texture_owner.free(p_id); + } else if (framebuffer_owner.owns(p_id)) { + Framebuffer *framebuffer = framebuffer_owner.get_or_null(p_id); + frames[frame].framebuffers_to_dispose_of.push_back(*framebuffer); + + if (framebuffer->invalidated_callback != nullptr) { + framebuffer->invalidated_callback(framebuffer->invalidated_callback_userdata); + } + framebuffer_owner.free(p_id); + } else if (sampler_owner.owns(p_id)) { + sampler_owner.free(p_id); + } else if (vertex_buffer_owner.owns(p_id)) { + Buffer *vertex_buffer = vertex_buffer_owner.get_or_null(p_id); + frames[frame].buffers_to_dispose_of.push_back(*vertex_buffer); + vertex_buffer_owner.free(p_id); + } else if (vertex_array_owner.owns(p_id)) { + vertex_array_owner.free(p_id); + } else if (index_buffer_owner.owns(p_id)) { + IndexBuffer *index_buffer = index_buffer_owner.get_or_null(p_id); + frames[frame].buffers_to_dispose_of.push_back(*index_buffer); + index_buffer_owner.free(p_id); + } else if (index_array_owner.owns(p_id)) { + index_array_owner.free(p_id); + } else if (shader_owner.owns(p_id)) { + Shader *shader = shader_owner.get_or_null(p_id); + frames[frame].shaders_to_dispose_of.push_back(*shader); + shader_owner.free(p_id); + } else if (uniform_buffer_owner.owns(p_id)) { + Buffer *uniform_buffer = uniform_buffer_owner.get_or_null(p_id); + frames[frame].buffers_to_dispose_of.push_back(*uniform_buffer); + uniform_buffer_owner.free(p_id); + } else if (texture_buffer_owner.owns(p_id)) { + TextureBuffer *texture_buffer = texture_buffer_owner.get_or_null(p_id); + frames[frame].buffers_to_dispose_of.push_back(texture_buffer->buffer); + texture_buffer_owner.free(p_id); + } else if (storage_buffer_owner.owns(p_id)) { + Buffer *storage_buffer = storage_buffer_owner.get_or_null(p_id); + frames[frame].buffers_to_dispose_of.push_back(*storage_buffer); + storage_buffer_owner.free(p_id); + } else if (uniform_set_owner.owns(p_id)) { + UniformSet *uniform_set = uniform_set_owner.get_or_null(p_id); + uniform_set_owner.free(p_id); + + if (uniform_set->invalidated_callback != nullptr) { + uniform_set->invalidated_callback(uniform_set->invalidated_callback_userdata); + } + } else if (render_pipeline_owner.owns(p_id)) { + RenderPipeline *pipeline = render_pipeline_owner.get_or_null(p_id); + frames[frame].render_pipelines_to_dispose_of.push_back(*pipeline); + render_pipeline_owner.free(p_id); + } else if (compute_pipeline_owner.owns(p_id)) { + ComputePipeline *pipeline = compute_pipeline_owner.get_or_null(p_id); + frames[frame].compute_pipelines_to_dispose_of.push_back(*pipeline); + compute_pipeline_owner.free(p_id); + } else { +#ifdef DEV_ENABLED + ERR_PRINT("Attempted to free invalid ID: " + itos(p_id.get_id()) + " " + resource_name); +#else + ERR_PRINT("Attempted to free invalid ID: " + itos(p_id.get_id())); +#endif + } +} + +void RenderingDeviceD3D12::free(RID p_id) { + _THREAD_SAFE_METHOD_ + + _free_dependencies(p_id); // Recursively erase dependencies first, to avoid potential API problems. + _free_internal(p_id); +} + +void RenderingDeviceD3D12::set_resource_name(RID p_id, const String p_name) { + if (texture_owner.owns(p_id)) { + Texture *texture = texture_owner.get_or_null(p_id); + // Don't set the source texture's name when calling on a texture view. + if (texture->owner.is_null()) { + context->set_object_name(texture->resource, p_name); + } + } else if (framebuffer_owner.owns(p_id)) { + // No D3D12 object to name. + } else if (sampler_owner.owns(p_id)) { + // No D3D12 object to name. + } else if (shader_owner.owns(p_id)) { + Shader *shader = shader_owner.get_or_null(p_id); + context->set_object_name(shader->root_signature.Get(), p_name + " Root Signature"); + } else if (uniform_set_owner.owns(p_id)) { + // No D3D12 object to name. + } else if (render_pipeline_owner.owns(p_id)) { + RenderPipeline *pipeline = render_pipeline_owner.get_or_null(p_id); + context->set_object_name(pipeline->pso.Get(), p_name); + } else if (compute_pipeline_owner.owns(p_id)) { + ComputePipeline *pipeline = compute_pipeline_owner.get_or_null(p_id); + context->set_object_name(pipeline->pso.Get(), p_name); + } else { + Buffer *buffer = _get_buffer_from_owner(p_id); + if (buffer) { + context->set_object_name(buffer->resource, p_name); + } else { + ERR_PRINT("Attempted to name invalid ID: " + itos(p_id.get_id())); + return; + } + } +#ifdef DEV_ENABLED + resource_names[p_id] = p_name; +#endif +} + +void RenderingDeviceD3D12::draw_command_begin_label(String p_label_name, const Color p_color) { + _THREAD_SAFE_METHOD_ + context->command_begin_label(frames[frame].draw_command_list.Get(), p_label_name, p_color); +} + +void RenderingDeviceD3D12::draw_command_insert_label(String p_label_name, const Color p_color) { + _THREAD_SAFE_METHOD_ + context->command_insert_label(frames[frame].draw_command_list.Get(), p_label_name, p_color); +} + +void RenderingDeviceD3D12::draw_command_end_label() { + _THREAD_SAFE_METHOD_ + context->command_end_label(frames[frame].draw_command_list.Get()); +} + +String RenderingDeviceD3D12::get_device_vendor_name() const { + return context->get_device_vendor_name(); +} + +String RenderingDeviceD3D12::get_device_name() const { + return context->get_device_name(); +} + +RenderingDevice::DeviceType RenderingDeviceD3D12::get_device_type() const { + return context->get_device_type(); +} + +String RenderingDeviceD3D12::get_device_api_version() const { + return context->get_device_api_version(); +} + +String RenderingDeviceD3D12::get_device_pipeline_cache_uuid() const { + return context->get_device_pipeline_cache_uuid(); +} + +void RenderingDeviceD3D12::_finalize_command_bufers() { + if (draw_list) { + ERR_PRINT("Found open draw list at the end of the frame, this should never happen (further drawing will likely not work)."); + } + + if (compute_list) { + ERR_PRINT("Found open compute list at the end of the frame, this should never happen (further compute will likely not work)."); + } + + { // Complete the setup buffer (that needs to be processed before anything else). + frames[frame].setup_command_list->Close(); + frames[frame].draw_command_list->Close(); + } +} + +void RenderingDeviceD3D12::_begin_frame() { + // Erase pending resources. + _free_pending_resources(frame); + + HRESULT res = frames[frame].setup_command_allocator->Reset(); + ERR_FAIL_COND_MSG(res, "Command allocator Reset failed with error " + vformat("0x%08ux", res) + "."); + res = frames[frame].setup_command_list->Reset(frames[frame].setup_command_allocator.Get(), nullptr); + ERR_FAIL_COND_MSG(res, "Command list Reset failed with error " + vformat("0x%08ux", res) + "."); + res = frames[frame].draw_command_allocator->Reset(); + ERR_FAIL_COND_MSG(res, "Command allocator Reset failed with error " + vformat("0x%08ux", res) + "."); + res = frames[frame].draw_command_list->Reset(frames[frame].draw_command_allocator.Get(), nullptr); + ERR_FAIL_COND_MSG(res, "Command list Reset failed with error " + vformat("0x%08ux", res) + "."); + + ID3D12DescriptorHeap *heaps[] = { + frames[frame].desc_heaps.resources.get_heap(), + frames[frame].desc_heaps.samplers.get_heap(), + }; + frames[frame].draw_command_list->SetDescriptorHeaps(2, heaps); + + frames[frame].desc_heap_walkers.resources.rewind(); + frames[frame].desc_heap_walkers.samplers.rewind(); + frames[frame].desc_heap_walkers.aux.rewind(); + frames[frame].desc_heap_walkers.rtv.rewind(); + frames[frame].desc_heaps_exhausted_reported = {}; + frames[frame].null_rtv_handle = {}; + +#ifdef DEBUG_COUNT_BARRIERS + print_verbose(vformat("Last frame: %d barriers (%d batches); %.1f ms", frame_barriers_count, frame_barriers_batches_count, frame_barriers_cpu_time * 0.001f)); + frame_barriers_count = 0; + frame_barriers_batches_count = 0; + frame_barriers_cpu_time = 0; +#endif + + if (local_device.is_null()) { + context->append_command_list(frames[frame].draw_command_list.Get()); + context->set_setup_list(frames[frame].setup_command_list.Get()); // Append now so it's added before everything else. + } + + // Advance current frame. + frames_drawn++; + // Advance staging buffer if used. + if (staging_buffer_used) { + staging_buffer_current = (staging_buffer_current + 1) % staging_buffer_blocks.size(); + staging_buffer_used = false; + } + + context->get_allocator()->SetCurrentFrameIndex(Engine::get_singleton()->get_frames_drawn()); + if (frames[frame].timestamp_count) { + frames[frame].setup_command_list->ResolveQueryData(frames[frame].timestamp_heap.Get(), D3D12_QUERY_TYPE_TIMESTAMP, 0, frames[frame].timestamp_count, frames[frame].timestamp_result_values_buffer.resource, 0); + uint64_t *gpu_timestamps = nullptr; + res = frames[frame].timestamp_result_values_buffer.resource->Map(0, nullptr, (void **)&gpu_timestamps); + if (SUCCEEDED(res)) { + memcpy(frames[frame].timestamp_result_values.ptr(), gpu_timestamps, sizeof(uint64_t) * frames[frame].timestamp_count); + frames[frame].timestamp_result_values_buffer.resource->Unmap(0, nullptr); + } + SWAP(frames[frame].timestamp_names, frames[frame].timestamp_result_names); + SWAP(frames[frame].timestamp_cpu_values, frames[frame].timestamp_cpu_result_values); + } + + frames[frame].timestamp_result_count = frames[frame].timestamp_count; + frames[frame].timestamp_count = 0; + frames[frame].index = Engine::get_singleton()->get_frames_drawn(); + frames[frame].execution_index = execution_index; +#ifdef DEV_ENABLED + frames[frame].uniform_set_reused = 0; +#endif +} + +void RenderingDeviceD3D12::swap_buffers() { + ERR_FAIL_COND_MSG(local_device.is_valid(), "Local devices can't swap buffers."); + _THREAD_SAFE_METHOD_ + + context->postpare_buffers(frames[frame].draw_command_list.Get()); + screen_prepared = false; + + _finalize_command_bufers(); + + context->swap_buffers(); + execution_index++; + + frame = (frame + 1) % frame_count; + + _begin_frame(); +} + +void RenderingDeviceD3D12::submit() { + _THREAD_SAFE_METHOD_ + + ERR_FAIL_COND_MSG(local_device.is_null(), "Only local devices can submit and sync."); + ERR_FAIL_COND_MSG(local_device_processing, "device already submitted, call sync to wait until done."); + + _finalize_command_bufers(); + + ID3D12CommandList *command_lists[2] = { frames[frame].setup_command_list.Get(), frames[frame].draw_command_list.Get() }; + context->local_device_push_command_lists(local_device, command_lists, 2); + execution_index++; + + local_device_processing = true; +} + +void RenderingDeviceD3D12::sync() { + _THREAD_SAFE_METHOD_ + + ERR_FAIL_COND_MSG(local_device.is_null(), "Only local devices can submit and sync."); + ERR_FAIL_COND_MSG(!local_device_processing, "sync can only be called after a submit"); + + context->local_device_sync(local_device); + _begin_frame(); + local_device_processing = false; +} + +#ifdef USE_SMALL_ALLOCS_POOL +D3D12MA::Pool *RenderingDeviceD3D12::_find_or_create_small_allocs_pool(D3D12_HEAP_TYPE p_heap_type, D3D12_HEAP_FLAGS p_heap_flags) { + D3D12_HEAP_FLAGS effective_heap_flags = p_heap_flags; + if (context->get_allocator()->GetD3D12Options().ResourceHeapTier != D3D12_RESOURCE_HEAP_TIER_1) { + // Heap tier 2 allows mixing resource types liberally. + effective_heap_flags &= ~(D3D12_HEAP_FLAG_ALLOW_ONLY_BUFFERS | D3D12_HEAP_FLAG_ALLOW_ONLY_NON_RT_DS_TEXTURES | D3D12_HEAP_FLAG_ALLOW_ONLY_RT_DS_TEXTURES); + } + + AllocPoolKey pool_key; + pool_key.heap_type = p_heap_type; + pool_key.heap_flags = effective_heap_flags; + if (small_allocs_pools.has(pool_key.key)) { + return small_allocs_pools[pool_key.key].Get(); + } + +#ifdef DEV_ENABLED + print_verbose("Creating D3D12MA small objects pool for heap type " + itos(p_heap_type) + " and heap flags " + itos(p_heap_flags)); +#endif + + D3D12MA::POOL_DESC poolDesc = {}; + poolDesc.HeapProperties.Type = p_heap_type; + poolDesc.HeapFlags = effective_heap_flags; + + ComPtr<D3D12MA::Pool> pool; + HRESULT res = context->get_allocator()->CreatePool(&poolDesc, pool.GetAddressOf()); + small_allocs_pools[pool_key.key] = pool; // Don't try to create it again if failed the first time. + ERR_FAIL_COND_V_MSG(res, nullptr, "CreatePool failed with error " + vformat("0x%08ux", res) + "."); + + return pool.Get(); +} +#endif + +void RenderingDeviceD3D12::_free_pending_resources(int p_frame) { + // Free in dependency usage order, so nothing weird happens. + // Pipelines. + while (frames[p_frame].render_pipelines_to_dispose_of.front()) { + RenderPipeline *rp = &frames[p_frame].render_pipelines_to_dispose_of.front()->get(); + pipeline_bindings.erase(rp->bindings_id); + frames[p_frame].render_pipelines_to_dispose_of.pop_front(); + } + while (frames[p_frame].compute_pipelines_to_dispose_of.front()) { + ComputePipeline *cp = &frames[p_frame].compute_pipelines_to_dispose_of.front()->get(); + pipeline_bindings.erase(cp->bindings_id); + frames[p_frame].compute_pipelines_to_dispose_of.pop_front(); + } + + // Shaders. + frames[p_frame].shaders_to_dispose_of.clear(); + + // Framebuffers. + frames[p_frame].framebuffers_to_dispose_of.clear(); + + // Textures. + while (frames[p_frame].textures_to_dispose_of.front()) { + Texture *texture = &frames[p_frame].textures_to_dispose_of.front()->get(); + + if (texture->bound) { + WARN_PRINT("Deleted a texture while it was bound."); + } + if (texture->owner.is_null()) { + // Actually owns the image and the allocation too. + image_memory -= texture->allocation->GetSize(); + for (uint32_t i = 0; i < texture->aliases.size(); i++) { + if (texture->aliases[i]) { + texture->aliases[i]->Release(); + } + } + texture->resource->Release(); + texture->resource = nullptr; + texture->allocation->Release(); + texture->allocation = nullptr; + } + frames[p_frame].textures_to_dispose_of.pop_front(); + } + + // Buffers. + while (frames[p_frame].buffers_to_dispose_of.front()) { + _buffer_free(&frames[p_frame].buffers_to_dispose_of.front()->get()); + + frames[p_frame].buffers_to_dispose_of.pop_front(); + } +} + +void RenderingDeviceD3D12::prepare_screen_for_drawing() { + _THREAD_SAFE_METHOD_ + context->prepare_buffers(frames[frame].draw_command_list.Get()); + screen_prepared = true; +} + +uint32_t RenderingDeviceD3D12::get_frame_delay() const { + return frame_count; +} + +uint64_t RenderingDeviceD3D12::get_memory_usage(MemoryType p_type) const { + if (p_type == MEMORY_BUFFERS) { + return buffer_memory; + } else if (p_type == MEMORY_TEXTURES) { + return image_memory; + } else { + D3D12MA::TotalStatistics stats; + context->get_allocator()->CalculateStatistics(&stats); + return stats.Total.Stats.BlockBytes; + } +} + +void RenderingDeviceD3D12::_flush(bool p_flush_current_frame) { + if (local_device.is_valid() && !p_flush_current_frame) { + return; // Flushing previous frames has no effect with local device. + } + + if (p_flush_current_frame) { + frames[frame].setup_command_list->Close(); + frames[frame].draw_command_list->Close(); + } + + if (local_device.is_valid()) { + ID3D12CommandList *command_lists[2] = { frames[frame].setup_command_list.Get(), frames[frame].draw_command_list.Get() }; + context->local_device_push_command_lists(local_device, command_lists, 2); + execution_index++; + context->local_device_sync(local_device); + + HRESULT res = frames[frame].setup_command_allocator->Reset(); + ERR_FAIL_COND_MSG(res, "Command allocator Reset failed with error " + vformat("0x%08ux", res) + "."); + res = frames[frame].setup_command_list->Reset(frames[frame].setup_command_allocator.Get(), nullptr); + ERR_FAIL_COND_MSG(res, "Command allocator Reset failed with error " + vformat("0x%08ux", res) + "."); + res = frames[frame].draw_command_allocator->Reset(); + ERR_FAIL_COND_MSG(res, "Command allocator Reset failed with error " + vformat("0x%08ux", res) + "."); + res = frames[frame].draw_command_list->Reset(frames[frame].draw_command_allocator.Get(), nullptr); + ERR_FAIL_COND_MSG(res, "Command allocator Reset failed with error " + vformat("0x%08ux", res) + "."); + + ID3D12DescriptorHeap *heaps[] = { + frames[frame].desc_heaps.resources.get_heap(), + frames[frame].desc_heaps.samplers.get_heap(), + }; + frames[frame].draw_command_list->SetDescriptorHeaps(2, heaps); + frames[frame].desc_heap_walkers.resources.rewind(); + frames[frame].desc_heap_walkers.samplers.rewind(); + frames[frame].desc_heap_walkers.aux.rewind(); + frames[frame].desc_heap_walkers.rtv.rewind(); + frames[frame].desc_heaps_exhausted_reported = {}; + frames[frame].null_rtv_handle = {}; + frames[frame].execution_index = execution_index; + } else { + context->flush(p_flush_current_frame, p_flush_current_frame); + // Re-create the setup command. + if (p_flush_current_frame) { + execution_index++; + + HRESULT res = frames[frame].setup_command_allocator->Reset(); + ERR_FAIL_COND_MSG(res, "Command allocator Reset failed with error " + vformat("0x%08ux", res) + "."); + res = frames[frame].draw_command_allocator->Reset(); + ERR_FAIL_COND_MSG(res, "Command allocator Reset failed with error " + vformat("0x%08ux", res) + "."); + res = frames[frame].setup_command_list->Reset(frames[frame].setup_command_allocator.Get(), nullptr); + ERR_FAIL_COND_MSG(res, "Command list Reset failed with error " + vformat("0x%08ux", res) + "."); + res = frames[frame].draw_command_list->Reset(frames[frame].draw_command_allocator.Get(), nullptr); + ERR_FAIL_COND_MSG(res, "Command list Reset failed with error " + vformat("0x%08ux", res) + "."); + + ID3D12DescriptorHeap *heaps[] = { + frames[frame].desc_heaps.resources.get_heap(), + frames[frame].desc_heaps.samplers.get_heap(), + }; + frames[frame].draw_command_list->SetDescriptorHeaps(2, heaps); + + frames[frame].desc_heap_walkers.resources.rewind(); + frames[frame].desc_heap_walkers.samplers.rewind(); + frames[frame].desc_heap_walkers.aux.rewind(); + frames[frame].desc_heap_walkers.rtv.rewind(); + frames[frame].desc_heaps_exhausted_reported = {}; + frames[frame].null_rtv_handle = {}; + frames[frame].execution_index = execution_index; + + context->set_setup_list(frames[frame].setup_command_list.Get()); // Append now so it's added before everything else. + context->append_command_list(frames[frame].draw_command_list.Get()); + } + } +} + +void RenderingDeviceD3D12::initialize(D3D12Context *p_context, bool p_local_device) { + // Get our device capabilities. + { + device_capabilities.version_major = p_context->get_feat_level_major(); + device_capabilities.version_minor = p_context->get_feat_level_minor(); + } + + context = p_context; + device = p_context->get_device(); + if (p_local_device) { + frame_count = 1; + local_device = p_context->local_device_create(); + device = p_context->local_device_get_d3d12_device(local_device); + } else { + frame_count = p_context->get_swapchain_image_count() + 1; + } + limits = p_context->get_device_limits(); + max_timestamp_query_elements = 256; + + { // Create command signature for indirect dispatch. + D3D12_INDIRECT_ARGUMENT_DESC iarg_desc = {}; + iarg_desc.Type = D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH; + D3D12_COMMAND_SIGNATURE_DESC cs_desc = {}; + cs_desc.ByteStride = sizeof(D3D12_DISPATCH_ARGUMENTS); + cs_desc.NumArgumentDescs = 1; + cs_desc.pArgumentDescs = &iarg_desc; + cs_desc.NodeMask = 0; + HRESULT res = device->CreateCommandSignature(&cs_desc, nullptr, IID_PPV_ARGS(indirect_dispatch_cmd_sig.GetAddressOf())); + ERR_FAIL_COND_MSG(res, "CreateCommandSignature failed with error " + vformat("0x%08ux", res) + "."); + } + + uint32_t resource_descriptors_per_frame = GLOBAL_DEF("rendering/rendering_device/d3d12/max_resource_descriptors_per_frame", 16384); + uint32_t sampler_descriptors_per_frame = GLOBAL_DEF("rendering/rendering_device/d3d12/max_sampler_descriptors_per_frame", 1024); + uint32_t misc_descriptors_per_frame = GLOBAL_DEF("rendering/rendering_device/d3d12/max_misc_descriptors_per_frame", 512); + + frames.resize(frame_count); + frame = 0; + // Create setup and frame buffers. + for (int i = 0; i < frame_count; i++) { + frames[i].index = 0; + + { // Create descriptor heaps. + Error err = frames[i].desc_heaps.resources.allocate(device.Get(), D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, resource_descriptors_per_frame, true); + ERR_FAIL_COND_MSG(err, "Creating the frame's RESOURCE descriptors heap failed."); + + err = frames[i].desc_heaps.samplers.allocate(device.Get(), D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER, sampler_descriptors_per_frame, true); + ERR_FAIL_COND_MSG(err, "Creating the frame's SAMPLER descriptors heap failed."); + + err = frames[i].desc_heaps.aux.allocate(device.Get(), D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, misc_descriptors_per_frame, false); + ERR_FAIL_COND_MSG(err, "Creating the frame's AUX descriptors heap failed."); + + err = frames[i].desc_heaps.rtv.allocate(device.Get(), D3D12_DESCRIPTOR_HEAP_TYPE_RTV, misc_descriptors_per_frame, false); + ERR_FAIL_COND_MSG(err, "Creating the frame's RENDER TARGET descriptors heap failed."); + + frames[i].desc_heap_walkers.resources = frames[i].desc_heaps.resources.make_walker(); + frames[i].desc_heap_walkers.samplers = frames[i].desc_heaps.samplers.make_walker(); + frames[i].desc_heap_walkers.aux = frames[i].desc_heaps.aux.make_walker(); + frames[i].desc_heap_walkers.rtv = frames[i].desc_heaps.rtv.make_walker(); + } + + { // Create command allocators. + HRESULT res = device->CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_DIRECT, IID_PPV_ARGS(frames[i].setup_command_allocator.GetAddressOf())); + ERR_CONTINUE_MSG(res, "CreateCommandAllocator failed with error " + vformat("0x%08ux", res) + "."); + + res = device->CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_DIRECT, IID_PPV_ARGS(frames[i].draw_command_allocator.GetAddressOf())); + ERR_CONTINUE_MSG(res, "CreateCommandAllocator failed with error " + vformat("0x%08ux", res) + "."); + } + + { // Create command lists. + HRESULT res = device->CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_DIRECT, frames[i].setup_command_allocator.Get(), nullptr, IID_PPV_ARGS(frames[i].setup_command_list.GetAddressOf())); + ERR_CONTINUE_MSG(res, "CreateCommandList failed with error " + vformat("0x%08ux", res) + "."); + + res = device->CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_DIRECT, frames[i].draw_command_allocator.Get(), nullptr, IID_PPV_ARGS(frames[i].draw_command_list.GetAddressOf())); + ERR_CONTINUE_MSG(res, "CreateCommandList failed with error " + vformat("0x%08ux", res) + "."); + + if (i > 0) { + frames[i].setup_command_list->Close(); + frames[i].draw_command_list->Close(); + } + } + + if (i == 0) { + ID3D12DescriptorHeap *heaps[] = { + frames[frame].desc_heaps.resources.get_heap(), + frames[frame].desc_heaps.samplers.get_heap(), + }; + frames[frame].draw_command_list->SetDescriptorHeaps(2, heaps); + } + + { + // Create query heap. + D3D12_QUERY_HEAP_DESC qh_desc = {}; + qh_desc.Type = D3D12_QUERY_HEAP_TYPE_TIMESTAMP; + qh_desc.Count = max_timestamp_query_elements; + qh_desc.NodeMask = 0; + HRESULT res = device->CreateQueryHeap(&qh_desc, IID_PPV_ARGS(frames[i].timestamp_heap.GetAddressOf())); + ERR_CONTINUE_MSG(res, "CreateQueryHeap failed with error " + vformat("0x%08ux", res) + "."); + + frames[i].timestamp_names.resize(max_timestamp_query_elements); + frames[i].timestamp_cpu_values.resize(max_timestamp_query_elements); + frames[i].timestamp_count = 0; + frames[i].timestamp_result_names.resize(max_timestamp_query_elements); + frames[i].timestamp_cpu_result_values.resize(max_timestamp_query_elements); + frames[i].timestamp_result_values.resize(max_timestamp_query_elements); + Error err = _buffer_allocate(&frames[i].timestamp_result_values_buffer, sizeof(uint64_t) * max_timestamp_query_elements, D3D12_RESOURCE_STATE_COMMON, D3D12_HEAP_TYPE_READBACK); + ERR_CONTINUE(err); + frames[i].timestamp_result_count = 0; + } + } + + if (local_device.is_null()) { + context->set_setup_list(frames[0].setup_command_list.Get()); // Append now so it's added before everything else. + context->append_command_list(frames[0].draw_command_list.Get()); + } + + staging_buffer_block_size = GLOBAL_GET("rendering/rendering_device/staging_buffer/block_size_kb"); + staging_buffer_block_size = MAX(4u, staging_buffer_block_size); + staging_buffer_block_size *= 1024; // Kb -> bytes. + staging_buffer_max_size = GLOBAL_GET("rendering/rendering_device/staging_buffer/max_size_mb"); + staging_buffer_max_size = MAX(1u, staging_buffer_max_size); + staging_buffer_max_size *= 1024 * 1024; + + if (staging_buffer_max_size < staging_buffer_block_size * 4) { + // Validate enough functions. + staging_buffer_max_size = staging_buffer_block_size * 4; + } + texture_upload_region_size_px = GLOBAL_GET("rendering/rendering_device/staging_buffer/texture_upload_region_size_px"); + texture_upload_region_size_px = nearest_power_of_2_templated(texture_upload_region_size_px); + + frames_drawn = frame_count; // Start from frame count, so everything else is immediately old. + execution_index = 1; + + // Ensure current staging block is valid and at least one per frame exists. + staging_buffer_current = 0; + staging_buffer_used = false; + + for (int i = 0; i < frame_count; i++) { + // Staging was never used, create a block. + Error err = _insert_staging_block(); + ERR_CONTINUE(err != OK); + } + + { + aux_resource = texture_create(TextureFormat(), TextureView()); + ERR_FAIL_COND(!aux_resource.is_valid()); + } + + draw_list = nullptr; + draw_list_count = 0; + draw_list_split = false; + + vrs_state_execution_index = 0; + vrs_state = {}; + + compute_list = nullptr; + + glsl_type_singleton_init_or_ref(); +} + +dxil_validator *RenderingDeviceD3D12::get_dxil_validator_for_current_thread() { + MutexLock lock(dxil_mutex); + + int thread_idx = WorkerThreadPool::get_singleton()->get_thread_index(); + if (dxil_validators.has(thread_idx)) { + return dxil_validators[thread_idx]; + } + +#ifdef DEV_ENABLED + print_verbose("Creating DXIL validator for worker thread index " + itos(thread_idx)); +#endif + + dxil_validator *dxil_validator = dxil_create_validator(nullptr); + CRASH_COND(!dxil_validator); + + dxil_validators.insert(thread_idx, dxil_validator); + return dxil_validator; +} + +template <class T> +void RenderingDeviceD3D12::_free_rids(T &p_owner, const char *p_type) { + List<RID> owned; + p_owner.get_owned_list(&owned); + if (owned.size()) { + if (owned.size() == 1) { + WARN_PRINT(vformat("1 RID of type \"%s\" was leaked.", p_type)); + } else { + WARN_PRINT(vformat("%d RIDs of type \"%s\" were leaked.", owned.size(), p_type)); + } + for (const RID &E : owned) { +#ifdef DEV_ENABLED + if (resource_names.has(E)) { + print_line(String(" - ") + resource_names[E]); + } +#endif + free(E); + } + } +} + +void RenderingDeviceD3D12::capture_timestamp(const String &p_name) { + ERR_FAIL_COND_MSG(draw_list != nullptr, "Capturing timestamps during draw list creation is not allowed. Offending timestamp was: " + p_name); + ERR_FAIL_COND(frames[frame].timestamp_count >= max_timestamp_query_elements); + + // This should be optional for profiling, else it will slow things down. + full_barrier(); + + frames[frame].draw_command_list->EndQuery(frames[frame].timestamp_heap.Get(), D3D12_QUERY_TYPE_TIMESTAMP, frames[frame].timestamp_count); + frames[frame].timestamp_names[frames[frame].timestamp_count] = p_name; + frames[frame].timestamp_cpu_values[frames[frame].timestamp_count] = OS::get_singleton()->get_ticks_usec(); + frames[frame].timestamp_count++; +} + +uint64_t RenderingDeviceD3D12::get_driver_resource(DriverResource p_resource, RID p_rid, uint64_t p_index) { + _THREAD_SAFE_METHOD_ + return 0; +} + +uint32_t RenderingDeviceD3D12::get_captured_timestamps_count() const { + return frames[frame].timestamp_result_count; +} + +uint64_t RenderingDeviceD3D12::get_captured_timestamps_frame() const { + return frames[frame].index; +} + +uint64_t RenderingDeviceD3D12::get_captured_timestamp_gpu_time(uint32_t p_index) const { + ERR_FAIL_UNSIGNED_INDEX_V(p_index, frames[frame].timestamp_result_count, 0); + + return frames[frame].timestamp_result_values[p_index] / (double)limits.timestamp_frequency * 1000000000.0; +} + +uint64_t RenderingDeviceD3D12::get_captured_timestamp_cpu_time(uint32_t p_index) const { + ERR_FAIL_UNSIGNED_INDEX_V(p_index, frames[frame].timestamp_result_count, 0); + return frames[frame].timestamp_cpu_result_values[p_index]; +} + +String RenderingDeviceD3D12::get_captured_timestamp_name(uint32_t p_index) const { + ERR_FAIL_UNSIGNED_INDEX_V(p_index, frames[frame].timestamp_result_count, String()); + return frames[frame].timestamp_result_names[p_index]; +} + +uint64_t RenderingDeviceD3D12::limit_get(Limit p_limit) const { + switch (p_limit) { + case LIMIT_MAX_TEXTURES_PER_SHADER_STAGE: + return limits.max_srvs_per_shader_stage; + case LIMIT_MAX_UNIFORM_BUFFER_SIZE: + return 65536; + case LIMIT_MAX_VIEWPORT_DIMENSIONS_X: + case LIMIT_MAX_VIEWPORT_DIMENSIONS_Y: + return 16384; // Based on max. texture size. Maybe not correct. + case LIMIT_MAX_COMPUTE_WORKGROUP_COUNT_X: + return D3D12_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION; + case LIMIT_MAX_COMPUTE_WORKGROUP_COUNT_Y: + return D3D12_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION; + case LIMIT_MAX_COMPUTE_WORKGROUP_COUNT_Z: + return D3D12_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION; + case LIMIT_MAX_COMPUTE_WORKGROUP_SIZE_X: + return D3D12_CS_THREAD_GROUP_MAX_X; + case LIMIT_MAX_COMPUTE_WORKGROUP_SIZE_Y: + return D3D12_CS_THREAD_GROUP_MAX_Y; + case LIMIT_MAX_COMPUTE_WORKGROUP_SIZE_Z: + return D3D12_CS_THREAD_GROUP_MAX_Z; + case LIMIT_SUBGROUP_SIZE: + // Note in min/max. Shader model 6.6 supports it (see https://microsoft.github.io/DirectX-Specs/d3d/HLSL_SM_6_6_WaveSize.html), + // but at this time I don't know the implications on the transpilation to DXIL, etc. + case LIMIT_SUBGROUP_MIN_SIZE: + case LIMIT_SUBGROUP_MAX_SIZE: { + D3D12Context::SubgroupCapabilities subgroup_capabilities = context->get_subgroup_capabilities(); + return subgroup_capabilities.size; + } + case LIMIT_SUBGROUP_IN_SHADERS: { + D3D12Context::SubgroupCapabilities subgroup_capabilities = context->get_subgroup_capabilities(); + return subgroup_capabilities.supported_stages_flags_rd(); + } + case LIMIT_SUBGROUP_OPERATIONS: { + D3D12Context::SubgroupCapabilities subgroup_capabilities = context->get_subgroup_capabilities(); + return subgroup_capabilities.supported_operations_flags_rd(); + } + case LIMIT_VRS_TEXEL_WIDTH: + case LIMIT_VRS_TEXEL_HEIGHT: { + return context->get_vrs_capabilities().ss_image_tile_size; + } + default: + // It's important to return a number that at least won't overflow any typical integer type. +#ifdef DEV_ENABLED + WARN_PRINT("Returning maximum value for unknown limit " + itos(p_limit) + "."); +#endif + return (uint64_t)1 << 30; + } +} + +bool RenderingDeviceD3D12::has_feature(const Features p_feature) const { + switch (p_feature) { + case SUPPORTS_MULTIVIEW: { + D3D12Context::MultiviewCapabilities multiview_capabilies = context->get_multiview_capabilities(); + return multiview_capabilies.is_supported && multiview_capabilies.max_view_count > 1; + } break; + case SUPPORTS_FSR_HALF_FLOAT: { + return context->get_shader_capabilities().native_16bit_ops && context->get_storage_buffer_capabilities().storage_buffer_16_bit_access_is_supported; + } break; + case SUPPORTS_ATTACHMENT_VRS: { + D3D12Context::VRSCapabilities vrs_capabilities = context->get_vrs_capabilities(); + return vrs_capabilities.ss_image_supported; + } break; + case SUPPORTS_FRAGMENT_SHADER_WITH_ONLY_SIDE_EFFECTS: { + return true; + } break; + default: { + return false; + } + } +} + +void RenderingDeviceD3D12::finalize() { + // Free all resources. + + _flush(false); + + free(aux_resource); + + _free_rids(render_pipeline_owner, "Pipeline"); + _free_rids(compute_pipeline_owner, "Compute"); + _free_rids(uniform_set_owner, "UniformSet"); + _free_rids(texture_buffer_owner, "TextureBuffer"); + _free_rids(storage_buffer_owner, "StorageBuffer"); + _free_rids(uniform_buffer_owner, "UniformBuffer"); + _free_rids(shader_owner, "Shader"); + _free_rids(index_array_owner, "IndexArray"); + _free_rids(index_buffer_owner, "IndexBuffer"); + _free_rids(vertex_array_owner, "VertexArray"); + _free_rids(vertex_buffer_owner, "VertexBuffer"); + _free_rids(framebuffer_owner, "Framebuffer"); + _free_rids(sampler_owner, "Sampler"); + { + // For textures it's a bit more difficult because they may be shared. + List<RID> owned; + texture_owner.get_owned_list(&owned); + if (owned.size()) { + if (owned.size() == 1) { + WARN_PRINT("1 RID of type \"Texture\" was leaked."); + } else { + WARN_PRINT(vformat("%d RIDs of type \"Texture\" were leaked.", owned.size())); + } + // Free shared first. + for (List<RID>::Element *E = owned.front(); E;) { + List<RID>::Element *N = E->next(); + if (texture_is_shared(E->get())) { +#ifdef DEV_ENABLED + if (resource_names.has(E->get())) { + print_line(String(" - ") + resource_names[E->get()]); + } +#endif + free(E->get()); + owned.erase(E); + } + E = N; + } + // Free non shared second, this will avoid an error trying to free unexisting textures due to dependencies. + for (const RID &E : owned) { +#ifdef DEV_ENABLED + if (resource_names.has(E)) { + print_line(String(" - ") + resource_names[E]); + } +#endif + free(E); + } + } + } + + // Free everything pending. + for (int i = 0; i < frame_count; i++) { + int f = (frame + i) % frame_count; + _free_pending_resources(f); + frames[i].timestamp_result_values_buffer.allocation->Release(); + frames[i].timestamp_result_values_buffer.resource->Release(); + } + + frames.clear(); + + pipeline_bindings.clear(); + next_pipeline_binding_id = 1; + + for (int i = 0; i < split_draw_list_allocators.size(); i++) { + for (int j = 0; i < split_draw_list_allocators[i].command_lists.size(); j++) { + split_draw_list_allocators[i].command_lists[j]->Release(); + } + split_draw_list_allocators[i].command_allocator->Release(); + } + + res_barriers_requests.clear(); + res_barriers.clear(); + + for (int i = 0; i < staging_buffer_blocks.size(); i++) { + staging_buffer_blocks[i].allocation->Release(); + staging_buffer_blocks[i].resource->Release(); + } +#ifdef USE_SMALL_ALLOCS_POOL + small_allocs_pools.clear(); +#endif + + indirect_dispatch_cmd_sig.Reset(); + + vertex_formats.clear(); + + framebuffer_formats.clear(); + + // All these should be clear at this point. + ERR_FAIL_COND(dependency_map.size()); + ERR_FAIL_COND(reverse_dependency_map.size()); + + { + MutexLock lock(dxil_mutex); + for (const KeyValue<int, dxil_validator *> &E : dxil_validators) { + dxil_destroy_validator(E.value); + } + } + + glsl_type_singleton_decref(); +} + +RenderingDevice *RenderingDeviceD3D12::create_local_device() { + RenderingDeviceD3D12 *rd = memnew(RenderingDeviceD3D12); + rd->initialize(context, true); + return rd; +} + +RenderingDeviceD3D12::RenderingDeviceD3D12() { + device_capabilities.device_family = DEVICE_DIRECTX; +} + +RenderingDeviceD3D12::~RenderingDeviceD3D12() { + if (local_device.is_valid()) { + finalize(); + context->local_device_free(local_device); + } +} diff --git a/drivers/d3d12/rendering_device_d3d12.h b/drivers/d3d12/rendering_device_d3d12.h new file mode 100644 index 0000000000..92ae2f78fb --- /dev/null +++ b/drivers/d3d12/rendering_device_d3d12.h @@ -0,0 +1,1277 @@ +/**************************************************************************/ +/* rendering_device_d3d12.h */ +/**************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/**************************************************************************/ +/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ +/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/**************************************************************************/ + +#ifndef RENDERING_DEVICE_D3D12_H +#define RENDERING_DEVICE_D3D12_H + +#include "core/os/thread_safe.h" +#include "core/templates/local_vector.h" +#include "core/templates/oa_hash_map.h" +#include "core/templates/rid_owner.h" +#include "drivers/d3d12/d3d12_context.h" +#include "servers/rendering/rendering_device.h" + +#include <wrl/client.h> + +using Microsoft::WRL::ComPtr; + +#define D3D12_BITCODE_OFFSETS_NUM_STAGES 3 + +struct dxil_validator; + +class RenderingDeviceD3D12 : public RenderingDevice { + _THREAD_SAFE_CLASS_ + // Miscellaneous tables that map + // our enums to enums used + // by DXGI/D3D12. + + D3D12Context::DeviceLimits limits = {}; + struct D3D12Format { + DXGI_FORMAT family = DXGI_FORMAT_UNKNOWN; + DXGI_FORMAT general_format = DXGI_FORMAT_UNKNOWN; + UINT swizzle = D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING; + DXGI_FORMAT dsv_format = DXGI_FORMAT_UNKNOWN; + }; + static const D3D12Format d3d12_formats[DATA_FORMAT_MAX]; + static const char *named_formats[DATA_FORMAT_MAX]; + static const D3D12_COMPARISON_FUNC compare_operators[COMPARE_OP_MAX]; + static const D3D12_STENCIL_OP stencil_operations[STENCIL_OP_MAX]; + static const UINT rasterization_sample_count[TEXTURE_SAMPLES_MAX]; + static const D3D12_LOGIC_OP logic_operations[RenderingDevice::LOGIC_OP_MAX]; + static const D3D12_BLEND blend_factors[RenderingDevice::BLEND_FACTOR_MAX]; + static const D3D12_BLEND_OP blend_operations[RenderingDevice::BLEND_OP_MAX]; + static const D3D12_TEXTURE_ADDRESS_MODE address_modes[SAMPLER_REPEAT_MODE_MAX]; + static const FLOAT sampler_border_colors[SAMPLER_BORDER_COLOR_MAX][4]; + static const D3D12_RESOURCE_DIMENSION d3d12_texture_dimension[TEXTURE_TYPE_MAX]; + + // Functions used for format + // validation, and ensures the + // user passes valid data. + + static int get_format_vertex_size(DataFormat p_format); + static uint32_t get_image_format_pixel_size(DataFormat p_format); + static void get_compressed_image_format_block_dimensions(DataFormat p_format, uint32_t &r_w, uint32_t &r_h); + uint32_t get_compressed_image_format_block_byte_size(DataFormat p_format); + static uint32_t get_compressed_image_format_pixel_rshift(DataFormat p_format); + static uint32_t get_image_format_plane_count(DataFormat p_format); + static uint32_t get_image_format_required_size(DataFormat p_format, uint32_t p_width, uint32_t p_height, uint32_t p_depth, uint32_t p_mipmaps, uint32_t *r_blockw = nullptr, uint32_t *r_blockh = nullptr, uint32_t *r_depth = nullptr); + static uint32_t get_image_required_mipmaps(uint32_t p_width, uint32_t p_height, uint32_t p_depth); + static bool format_has_stencil(DataFormat p_format); + + Mutex dxil_mutex; + HashMap<int, dxil_validator *> dxil_validators; // One per WorkerThreadPool thread used for shader compilation, plus one (-1) for all the other. + + dxil_validator *get_dxil_validator_for_current_thread(); + + class DescriptorsHeap { + D3D12_DESCRIPTOR_HEAP_DESC desc = {}; + ComPtr<ID3D12DescriptorHeap> heap; + uint32_t handle_size = 0; + + public: + class Walker { // Texas Ranger. + friend class DescriptorsHeap; + + uint32_t handle_size = 0; + uint32_t handle_count = 0; + D3D12_CPU_DESCRIPTOR_HANDLE first_cpu_handle = {}; + D3D12_GPU_DESCRIPTOR_HANDLE first_gpu_handle = {}; + uint32_t handle_index = 0; + + public: + D3D12_CPU_DESCRIPTOR_HANDLE get_curr_cpu_handle(); + D3D12_GPU_DESCRIPTOR_HANDLE get_curr_gpu_handle(); + _FORCE_INLINE_ void rewind() { handle_index = 0; } + void advance(uint32_t p_count = 1); + uint32_t get_current_handle_index() const { return handle_index; } + uint32_t get_free_handles() { return handle_count - handle_index; } + bool is_at_eof() { return handle_index == handle_count; } + }; + + Error allocate(ID3D12Device *m_device, D3D12_DESCRIPTOR_HEAP_TYPE m_type, uint32_t m_descriptor_count, bool p_for_gpu); + uint32_t get_descriptor_count() const { return desc.NumDescriptors; } + ID3D12DescriptorHeap *get_heap() const { return heap.Get(); } + + Walker make_walker() const; + }; + + /***************************/ + /**** ID INFRASTRUCTURE ****/ + /***************************/ + + enum IDType { + ID_TYPE_FRAMEBUFFER_FORMAT, + ID_TYPE_VERTEX_FORMAT, + ID_TYPE_DRAW_LIST, + ID_TYPE_SPLIT_DRAW_LIST, + ID_TYPE_COMPUTE_LIST, + ID_TYPE_MAX, + ID_BASE_SHIFT = 58 // 5 bits for ID types. + }; + + ComPtr<ID3D12Device> device; + + HashMap<RID, HashSet<RID>> dependency_map; // IDs to IDs that depend on it. + HashMap<RID, HashSet<RID>> reverse_dependency_map; // Same as above, but in reverse. + + void _add_dependency(RID p_id, RID p_depends_on); + void _free_dependencies(RID p_id); + + /******************/ + /**** RESOURCE ****/ + /******************/ + + class ResourceState { + D3D12_RESOURCE_STATES states = D3D12_RESOURCE_STATE_COMMON; + + public: + void extend(D3D12_RESOURCE_STATES p_states_to_add); + D3D12_RESOURCE_STATES get_state_mask() const { return states; } + + ResourceState() {} + ResourceState(D3D12_RESOURCE_STATES p_states) : + states(p_states) {} + }; + + struct Resource { + struct States { + // As many subresources as mipmaps * layers; planes (for depth-stencil) are tracked together. + LocalVector<D3D12_RESOURCE_STATES> subresource_states; // Used only if not a view. + uint32_t last_batch_transitioned_to_uav = 0; + uint32_t last_batch_with_uav_barrier = 0; + }; + + ID3D12Resource *resource = nullptr; + D3D12MA::Allocation *allocation = nullptr; + + States own_states; // Used only if not a view. + States *states = nullptr; // Non-null only if a view. + + States *get_states_ptr() { return states ? states : &own_states; } + }; + + struct BarrierRequest { + static const uint32_t MAX_GROUPS = 4; + // Maybe this is too much data to have it locally. Benchmarking may reveal that + // cache would be used better by having a maximum of local subresource masks and beyond + // that have an allocated vector with the rest. + static const uint32_t MAX_SUBRESOURCES = 4096; // Must be multiple of 64. + ID3D12Resource *dx_resource; + uint8_t subres_mask_qwords; + uint8_t planes; + struct Group { + ResourceState state; + uint64_t subres_mask[MAX_SUBRESOURCES / 64]; + } groups[MAX_GROUPS]; + uint8_t groups_count; + static const D3D12_RESOURCE_STATES DELETED_GROUP = D3D12_RESOURCE_STATE_COMMON; + }; + HashMap<Resource::States *, BarrierRequest> res_barriers_requests; + + LocalVector<D3D12_RESOURCE_BARRIER> res_barriers; + uint32_t res_barriers_count = 0; + uint32_t res_barriers_batch = 0; +#ifdef DEV_ENABLED + int frame_barriers_count = 0; + int frame_barriers_batches_count = 0; + uint64_t frame_barriers_cpu_time = 0; +#endif + + void _resource_transition_batch(Resource *p_resource, uint32_t p_subresource, uint32_t p_num_planes, D3D12_RESOURCE_STATES p_new_state, ID3D12Resource *p_resource_override = nullptr); + void _resource_transitions_flush(ID3D12GraphicsCommandList *p_command_list); + + /*****************/ + /**** TEXTURE ****/ + /*****************/ + + struct Texture : Resource { + D3D12_SHADER_RESOURCE_VIEW_DESC srv_desc = {}; + D3D12_UNORDERED_ACCESS_VIEW_DESC uav_desc = {}; + D3D12_UNORDERED_ACCESS_VIEW_DESC owner_uav_desc = {}; // [[CROSS_FAMILY_ALIASING]]. + + TextureType type; + DataFormat format; + uint32_t planes = 1; + TextureSamples samples; + uint32_t width = 0; + uint32_t height = 0; + uint32_t depth = 0; + uint32_t layers = 0; + uint32_t mipmaps = 0; + uint32_t owner_layers = 0; + uint32_t owner_mipmaps = 0; + uint32_t usage_flags = 0; + uint32_t base_mipmap = 0; + uint32_t base_layer = 0; + + Vector<DataFormat> allowed_shared_formats; + TightLocalVector<ID3D12Resource *> aliases; // [[CROSS_FAMILY_ALIASING]]. + ID3D12Resource *owner_resource = nullptr; // Always the one of the main format passed to creation. [[CROSS_FAMILY_ALIASING]]. + + bool is_resolve_buffer = false; + + bool bound = false; // Bound to framebffer. + RID owner; + }; + + RID_Owner<Texture, true> texture_owner; + uint32_t texture_upload_region_size_px = 0; + + Vector<uint8_t> _texture_get_data_from_image(Texture *tex, uint32_t p_layer, bool p_2d = false); + Error _texture_update(Texture *p_texture, uint32_t p_layer, const Vector<uint8_t> &p_data, BitField<BarrierMask> p_post_barrier, ID3D12GraphicsCommandList *p_command_list); + + /*****************/ + /**** SAMPLER ****/ + /*****************/ + + RID_Owner<D3D12_SAMPLER_DESC> sampler_owner; + + /***************************/ + /**** BUFFER MANAGEMENT ****/ + /***************************/ + + // These are temporary buffers on CPU memory that hold + // the information until the CPU fetches it and places it + // either on GPU buffers, or images (textures). It ensures + // updates are properly synchronized with whatever the + // GPU is doing. + // + // The logic here is as follows, only 3 of these + // blocks are created at the beginning (one per frame) + // they can each belong to a frame (assigned to current when + // used) and they can only be reused after the same frame is + // recycled. + // + // When CPU requires to allocate more than what is available, + // more of these buffers are created. If a limit is reached, + // then a fence will ensure will wait for blocks allocated + // in previous frames are processed. If that fails, then + // another fence will ensure everything pending for the current + // frame is processed (effectively stalling). + // + // See the comments in the code to understand better how it works. + + struct StagingBufferBlock { + ID3D12Resource *resource = nullptr; // Owned, but ComPtr would have too much overhead in a Vector. + D3D12MA::Allocation *allocation = nullptr; + uint64_t frame_used = 0; + uint32_t fill_amount = 0; + }; + + Vector<StagingBufferBlock> staging_buffer_blocks; + int staging_buffer_current = 0; + uint32_t staging_buffer_block_size = 0; + uint64_t staging_buffer_max_size = 0; + bool staging_buffer_used = false; + + Error _staging_buffer_allocate(uint32_t p_amount, uint32_t p_required_align, uint32_t &r_alloc_offset, uint32_t &r_alloc_size, bool p_can_segment = true); + Error _insert_staging_block(); + + struct Buffer : Resource { + uint32_t size = 0; + D3D12_RESOURCE_STATES usage = {}; + uint32_t last_execution = 0; + }; + + Error _buffer_allocate(Buffer *p_buffer, uint32_t p_size, D3D12_RESOURCE_STATES p_usage, D3D12_HEAP_TYPE p_heap_type); + Error _buffer_free(Buffer *p_buffer); + Error _buffer_update(Buffer *p_buffer, size_t p_offset, const uint8_t *p_data, size_t p_data_size, bool p_use_draw_command_list = false, uint32_t p_required_align = 32); + + /*********************/ + /**** FRAMEBUFFER ****/ + /*********************/ + + static D3D12_RENDER_TARGET_VIEW_DESC _make_rtv_for_texture(const RenderingDeviceD3D12::Texture *p_texture, uint32_t p_mipmap_offset = 0, uint32_t p_layer_offset = 0, uint32_t p_layers = UINT32_MAX); + static D3D12_DEPTH_STENCIL_VIEW_DESC _make_dsv_for_texture(const RenderingDeviceD3D12::Texture *p_texture); + + // In Vulkan we'd create some structures the driver uses for render pass based rendering. + // (Dynamic rendering is supported on Vulkan 1.3+, though, but Godot is not using it.) + // In contrast, in D3D12 we'll go the dynamic rendering way, since it's more convenient + // and render pass based render setup is not available on every version. + // Therefore, we just need to keep the data at hand and use it where appropriate. + + struct FramebufferFormat { + Vector<AttachmentFormat> attachments; + Vector<FramebufferPass> passes; + Vector<TextureSamples> pass_samples; + uint32_t view_count = 1; + uint32_t max_supported_sample_count = 1; + }; + + bool _framebuffer_format_preprocess(FramebufferFormat *p_fb_format, uint32_t p_view_count); + + HashMap<FramebufferFormatID, FramebufferFormat> framebuffer_formats; + + struct Framebuffer { + DisplayServer::WindowID window_id = DisplayServer::INVALID_WINDOW_ID; + FramebufferFormatID format_id = 0; + Vector<RID> texture_ids; // Empty if for screen. + InvalidationCallback invalidated_callback = nullptr; + void *invalidated_callback_userdata = nullptr; + Vector<uint32_t> attachments_handle_inds; // RTV heap index for color; DSV heap index for DSV. + Size2 size; + uint32_t view_count = 1; + DescriptorsHeap rtv_heap; // Used only if not for screen and some color attachments. + D3D12_CPU_DESCRIPTOR_HANDLE screen_rtv_handle = {}; // Used only if for screen. + DescriptorsHeap dsv_heap; // Used only if not for screen and some depth-stencil attachments. + }; + + RID_Owner<Framebuffer, true> framebuffer_owner; + + /***********************/ + /**** VERTEX BUFFER ****/ + /***********************/ + + RID_Owner<Buffer, true> vertex_buffer_owner; + + struct VertexDescriptionKey { + Vector<VertexAttribute> vertex_formats; + bool operator==(const VertexDescriptionKey &p_key) const { + int vdc = vertex_formats.size(); + int vdck = p_key.vertex_formats.size(); + + if (vdc != vdck) { + return false; + } else { + const VertexAttribute *a_ptr = vertex_formats.ptr(); + const VertexAttribute *b_ptr = p_key.vertex_formats.ptr(); + for (int i = 0; i < vdc; i++) { + const VertexAttribute &a = a_ptr[i]; + const VertexAttribute &b = b_ptr[i]; + + if (a.location != b.location) { + return false; + } + if (a.offset != b.offset) { + return false; + } + if (a.format != b.format) { + return false; + } + if (a.stride != b.stride) { + return false; + } + if (a.frequency != b.frequency) { + return false; + } + } + return true; // They are equal. + } + } + + uint32_t hash() const { + int vdc = vertex_formats.size(); + uint32_t h = hash_murmur3_one_32(vdc); + const VertexAttribute *ptr = vertex_formats.ptr(); + for (int i = 0; i < vdc; i++) { + const VertexAttribute &vd = ptr[i]; + h = hash_murmur3_one_32(vd.location, h); + h = hash_murmur3_one_32(vd.offset, h); + h = hash_murmur3_one_32(vd.format, h); + h = hash_murmur3_one_32(vd.stride, h); + h = hash_murmur3_one_32(vd.frequency, h); + } + return hash_fmix32(h); + } + }; + + struct VertexDescriptionHash { + static _FORCE_INLINE_ uint32_t hash(const VertexDescriptionKey &p_key) { + return p_key.hash(); + } + }; + + // This is a cache and it's never freed, it ensures that + // ID used for a specific format always remain the same. + HashMap<VertexDescriptionKey, VertexFormatID, VertexDescriptionHash> vertex_format_cache; + + struct VertexDescriptionCache { + Vector<VertexAttribute> vertex_formats; + Vector<D3D12_INPUT_ELEMENT_DESC> elements_desc; + }; + + HashMap<VertexFormatID, VertexDescriptionCache> vertex_formats; + + struct VertexArray { + Vector<Buffer *> unique_buffers; + VertexFormatID description = 0; + int vertex_count = 0; + uint32_t max_instances_allowed = 0; + Vector<D3D12_VERTEX_BUFFER_VIEW> views; + }; + + RID_Owner<VertexArray, true> vertex_array_owner; + + struct IndexBuffer : public Buffer { + uint32_t max_index = 0; // Used for validation. + uint32_t index_count = 0; + DXGI_FORMAT index_format = {}; + bool supports_restart_indices = false; + }; + + RID_Owner<IndexBuffer, true> index_buffer_owner; + + struct IndexArray { + IndexBuffer *buffer = nullptr; + uint32_t max_index = 0; // Remember the maximum index here too, for validation. + uint32_t offset = 0; + uint32_t indices = 0; + bool supports_restart_indices = false; + D3D12_INDEX_BUFFER_VIEW view = {}; + }; + + RID_Owner<IndexArray, true> index_array_owner; + + /****************/ + /**** SHADER ****/ + /****************/ + + static const uint32_t ROOT_SIGNATURE_SIZE = 256; + static const uint32_t PUSH_CONSTANT_SIZE = 128; // Mimicking Vulkan. + + enum { + // We can only aim to set a maximum here, since depending on the shader + // there may be more or less root signature free for descriptor tables. + // Therefore, we'll have to rely on the final check at runtime, when building + // the root signature structure for a given shader. + // To be precise, these may be present or not, and their size vary statically: + // - Push constant (we'll assume this is always present to avoid reserving much + // more space for descriptor sets than needed for almost any imaginable case, + // given that most shader templates feature push constants). + // - NIR-DXIL runtime data. + MAX_UNIFORM_SETS = (ROOT_SIGNATURE_SIZE - PUSH_CONSTANT_SIZE) / sizeof(uint32_t), + }; + + enum ResourceClass { + RES_CLASS_INVALID, + RES_CLASS_CBV, + RES_CLASS_SRV, + RES_CLASS_UAV, + }; + + struct UniformBindingInfo { + uint32_t stages = 0; // Actual shader stages using the uniform (0 if totally optimized out). + ResourceClass res_class = RES_CLASS_INVALID; + struct RootSignatureLocation { + uint32_t root_param_idx = UINT32_MAX; + uint32_t range_idx = UINT32_MAX; + }; + struct { + RootSignatureLocation resource; + RootSignatureLocation sampler; + } root_sig_locations; + }; + + struct UniformInfo { + UniformType type = UniformType::UNIFORM_TYPE_MAX; + bool writable = false; + int binding = 0; + int length = 0; // Size of arrays (in total elements), or ubos (in bytes * total elements). + + bool operator!=(const UniformInfo &p_info) const { + return (binding != p_info.binding || type != p_info.type || writable != p_info.writable || length != p_info.length); + } + + bool operator<(const UniformInfo &p_info) const { + if (binding != p_info.binding) { + return binding < p_info.binding; + } + if (type != p_info.type) { + return type < p_info.type; + } + if (writable != p_info.writable) { + return writable < p_info.writable; + } + return length < p_info.length; + } + }; + + struct UniformSetFormat { + Vector<UniformInfo> uniform_info; + bool operator<(const UniformSetFormat &p_format) const { + uint32_t size = uniform_info.size(); + uint32_t psize = p_format.uniform_info.size(); + + if (size != psize) { + return size < psize; + } + + const UniformInfo *infoptr = uniform_info.ptr(); + const UniformInfo *pinfoptr = p_format.uniform_info.ptr(); + + for (uint32_t i = 0; i < size; i++) { + if (infoptr[i] != pinfoptr[i]) { + return infoptr[i] < pinfoptr[i]; + } + } + + return false; + } + }; + + // Always grows, never shrinks, ensuring unique IDs, but we assume + // the amount of formats will never be a problem, as the amount of shaders + // in a game is limited. + RBMap<UniformSetFormat, uint32_t> uniform_set_format_cache; + Vector<RBMap<UniformSetFormat, uint32_t>::Element *> uniform_set_format_cache_reverse; + + struct Shader { + struct ShaderUniformInfo { + UniformInfo info; + UniformBindingInfo binding; + + bool operator<(const ShaderUniformInfo &p_info) const { + return *((UniformInfo *)this) < (const UniformInfo &)p_info; + } + }; + struct Set { + Vector<ShaderUniformInfo> uniforms; + struct { + uint32_t resources = 0; + uint32_t samplers = 0; + } num_root_params; + }; + + uint64_t vertex_input_mask = 0; // Inputs used, this is mostly for validation. + uint32_t fragment_output_mask = 0; + + uint32_t spirv_push_constant_size = 0; + uint32_t dxil_push_constant_size = 0; + uint32_t nir_runtime_data_root_param_idx = UINT32_MAX; + + uint32_t compute_local_size[3] = { 0, 0, 0 }; + + struct SpecializationConstant { + PipelineSpecializationConstant constant; + uint64_t stages_bit_offsets[D3D12_BITCODE_OFFSETS_NUM_STAGES]; + }; + + bool is_compute = false; + Vector<Set> sets; + Vector<uint32_t> set_formats; + Vector<SpecializationConstant> specialization_constants; + uint32_t spirv_specialization_constants_ids_mask = 0; + HashMap<ShaderStage, Vector<uint8_t>> stages_bytecode; + String name; // Used for debug. + + ComPtr<ID3D12RootSignature> root_signature; + ComPtr<ID3D12RootSignatureDeserializer> root_signature_deserializer; + const D3D12_ROOT_SIGNATURE_DESC *root_signature_desc = nullptr; // Owned by the deserializer. + uint32_t root_signature_crc = 0; + }; + + String _shader_uniform_debug(RID p_shader, int p_set = -1); + + RID_Owner<Shader, true> shader_owner; + + uint32_t _shader_patch_dxil_specialization_constant( + PipelineSpecializationConstantType p_type, + const void *p_value, + const uint64_t (&p_stages_bit_offsets)[D3D12_BITCODE_OFFSETS_NUM_STAGES], + HashMap<ShaderStage, Vector<uint8_t>> &r_stages_bytecodes, + bool p_is_first_patch); + bool _shader_sign_dxil_bytecode(ShaderStage p_stage, Vector<uint8_t> &r_dxil_blob); + + /******************/ + /**** UNIFORMS ****/ + /******************/ + + RID_Owner<Buffer, true> uniform_buffer_owner; + RID_Owner<Buffer, true> storage_buffer_owner; + + // Texture buffer needs a view. + struct TextureBuffer { + Buffer buffer; + }; + + RID_Owner<TextureBuffer, true> texture_buffer_owner; + + struct RootDescriptorTable { + uint32_t root_param_idx = UINT32_MAX; + D3D12_GPU_DESCRIPTOR_HANDLE start_gpu_handle = {}; + }; + + // This structure contains the descriptor set. They _need_ to be allocated + // for a shader (and will be erased when this shader is erased), but should + // work for other shaders as long as the hash matches. This covers using + // them in shader variants. + // + // Keep also in mind that you can share buffers between descriptor sets, so + // the above restriction is not too serious. + + struct UniformSet { + uint32_t format = 0; + RID shader_id; + uint32_t shader_set = 0; + struct { + DescriptorsHeap resources; + DescriptorsHeap samplers; + } desc_heaps; + struct StateRequirement { + Resource *resource; + bool is_buffer; + D3D12_RESOURCE_STATES states; + uint64_t shader_uniform_idx_mask; + }; + struct AttachableTexture { + uint32_t bind; + RID texture; + }; + + struct RecentBind { + uint64_t execution_index = 0; + uint32_t root_signature_crc = 0; + struct { + LocalVector<RootDescriptorTable> resources; + LocalVector<RootDescriptorTable> samplers; + } root_tables; + int uses = 0; + } recent_binds[4]; // A better amount may be empirically found. + + LocalVector<AttachableTexture> attachable_textures; // Used for validation. + Vector<StateRequirement> resource_states; + InvalidationCallback invalidated_callback = nullptr; + void *invalidated_callback_userdata = nullptr; + +#ifdef DEV_ENABLED + // Filthy, but useful for dev. + struct ResourceDescInfo { + D3D12_DESCRIPTOR_RANGE_TYPE type; + D3D12_SRV_DIMENSION srv_dimension; + }; + LocalVector<ResourceDescInfo> _resources_desc_info; + const Shader *_shader = nullptr; +#endif + }; + + RID_Owner<UniformSet, true> uniform_set_owner; + + void _bind_uniform_set(UniformSet *p_uniform_set, const Shader::Set &p_shader_set, const Vector<UniformBindingInfo> &p_bindings, ID3D12GraphicsCommandList *p_command_list, bool p_for_compute); + void _apply_uniform_set_resource_states(const UniformSet *p_uniform_set, const Shader::Set &p_shader_set); + + /*******************/ + /**** PIPELINES ****/ + /*******************/ + + Error _apply_specialization_constants( + const Shader *p_shader, + const Vector<PipelineSpecializationConstant> &p_specialization_constants, + HashMap<ShaderStage, Vector<uint8_t>> &r_final_stages_bytecode); +#ifdef DEV_ENABLED + String _build_pipeline_blob_filename( + const Vector<uint8_t> &p_blob, + const Shader *p_shader, + const Vector<PipelineSpecializationConstant> &p_specialization_constants, + const String &p_extra_name_suffix = "", + const String &p_forced_id = ""); + void _save_pso_blob( + ID3D12PipelineState *p_pso, + const Shader *p_shader, + const Vector<PipelineSpecializationConstant> &p_specialization_constants); + void _save_stages_bytecode( + const HashMap<ShaderStage, Vector<uint8_t>> &p_stages_bytecode, + const Shader *p_shader, + const RID p_shader_rid, + const Vector<PipelineSpecializationConstant> &p_specialization_constants); +#endif + + // Render pipeline contains ALL the + // information required for drawing. + // This includes all the rasterizer state + // as well as shader used, framebuffer format, + // etc. + // Some parameters aren't fixed in D3D12, + // so they are stored in an ancillary + // dynamic parameters structure to be set + // on pipeline activation via several calls. + + struct RenderPipeline { + // Cached values for validation. +#ifdef DEBUG_ENABLED + struct Validation { + FramebufferFormatID framebuffer_format = 0; + uint32_t render_pass = 0; + uint32_t dynamic_state = 0; + VertexFormatID vertex_format = 0; + bool uses_restart_indices = false; + uint32_t primitive_minimum = 0; + uint32_t primitive_divisor = 0; + } validation; +#endif + RID shader; + Vector<uint32_t> set_formats; + uint32_t bindings_id = 0; + ComPtr<ID3D12PipelineState> pso; + uint32_t root_signature_crc = 0; + uint32_t spirv_push_constant_size = 0; + uint32_t dxil_push_constant_size = 0; + uint32_t nir_runtime_data_root_param_idx = UINT32_MAX; + struct DynamicParams { + D3D12_PRIMITIVE_TOPOLOGY primitive_topology = {}; + Color blend_constant; + float depth_bounds_min = 0.0f; + float depth_bounds_max = 0.0f; + uint32_t stencil_reference = 0; + } dyn_params; + }; + + HashMap<uint32_t, Vector<Vector<UniformBindingInfo>>> pipeline_bindings; + uint32_t next_pipeline_binding_id = 1; + + RID_Owner<RenderPipeline, true> render_pipeline_owner; + + struct ComputePipeline { + RID shader; + Vector<uint32_t> set_formats; + uint32_t bindings_id = 0; + ComPtr<ID3D12PipelineState> pso; + uint32_t root_signature_crc = 0; + uint32_t spirv_push_constant_size = 0; + uint32_t dxil_push_constant_size = 0; + uint32_t local_group_size[3] = { 0, 0, 0 }; + }; + + RID_Owner<ComputePipeline, true> compute_pipeline_owner; + + /*******************/ + /**** DRAW LIST ****/ + /*******************/ + + // Draw list contains both the command buffer + // used for drawing as well as a LOT of + // information used for validation. This + // validation is cheap so most of it can + // also run in release builds. + + // When using split command lists, this is + // implemented internally using bundles. + // As they can be created in threads, + // each needs its own command allocator. + + struct SplitDrawListAllocator { + // All pointers are owned, but not using ComPtr to avoid overhead in the vector. + ID3D12CommandAllocator *command_allocator = nullptr; + Vector<ID3D12GraphicsCommandList *> command_lists; // One for each frame. + }; + + Vector<SplitDrawListAllocator> split_draw_list_allocators; + + struct DrawList { + ID3D12GraphicsCommandList *command_list = nullptr; // If persistent, this is owned, otherwise it's shared with the ringbuffer. + Rect2i viewport; + bool viewport_set = false; + + struct SetState { + uint32_t pipeline_expected_format = 0; + uint32_t uniform_set_format = 0; + RID uniform_set; + bool bound = false; +#ifdef DEV_ENABLED + // Filthy, but useful for dev. + const Vector<UniformInfo> *_pipeline_expected_format = nullptr; + const UniformSet *_uniform_set = nullptr; +#endif + }; + + struct State { + SetState sets[MAX_UNIFORM_SETS]; + uint32_t set_count = 0; + RID pipeline; + ID3D12PipelineState *pso = nullptr; + ID3D12PipelineState *bound_pso = nullptr; + RID pipeline_shader; + uint32_t pipeline_dxil_push_constant_size = 0; + uint32_t pipeline_bindings_id = 0; + uint32_t root_signature_crc = 0; + RID vertex_array; + RID index_array; +#ifdef DEV_ENABLED + // Filthy, but useful for dev. + Shader *_shader = nullptr; +#endif + } state; + +#ifdef DEBUG_ENABLED + struct Validation { + bool active = true; // Means command buffer was not closed, so you can keep adding things. + // Actual render pass values. + uint32_t dynamic_state = 0; + VertexFormatID vertex_format = INVALID_ID; + uint32_t vertex_array_size = 0; + uint32_t vertex_max_instances_allowed = 0xFFFFFFFF; + bool index_buffer_uses_restart_indices = false; + uint32_t index_array_size = 0; + uint32_t index_array_max_index = 0; + uint32_t index_array_offset = 0; + Vector<uint32_t> set_formats; + Vector<bool> set_bound; + Vector<RID> set_rids; + // Last pipeline set values. + bool pipeline_active = false; + uint32_t pipeline_dynamic_state = 0; + VertexFormatID pipeline_vertex_format = INVALID_ID; + RID pipeline_shader; + bool pipeline_uses_restart_indices = false; + uint32_t pipeline_primitive_divisor = 0; + uint32_t pipeline_primitive_minimum = 0; + uint32_t pipeline_spirv_push_constant_size = 0; + bool pipeline_push_constant_supplied = false; + } validation; +#else + struct Validation { + uint32_t vertex_array_size = 0; + uint32_t index_array_size = 0; + uint32_t index_array_offset; + } validation; +#endif + }; + + DrawList *draw_list = nullptr; // One for regular draw lists, multiple for split. + uint32_t draw_list_subpass_count = 0; + uint32_t draw_list_count = 0; + Framebuffer curr_screen_framebuffer; // Only valid while a screen draw list is open. + Framebuffer *draw_list_framebuffer = nullptr; + FinalAction draw_list_final_color_action = FINAL_ACTION_DISCARD; + FinalAction draw_list_final_depth_action = FINAL_ACTION_DISCARD; + Vector2 draw_list_viewport_size = {}; + uint32_t draw_list_current_subpass = 0; + + bool draw_list_split = false; + Vector<RID> draw_list_bound_textures; + bool draw_list_unbind_color_textures = false; + bool draw_list_unbind_depth_textures = false; + + struct { + RID texture_bound; + bool configured = false; + } vrs_state; + uint32_t vrs_state_execution_index = 0; + + Error _draw_list_render_pass_begin(Framebuffer *framebuffer, InitialAction p_initial_color_action, FinalAction p_final_color_action, InitialAction p_initial_depth_action, FinalAction p_final_depth_action, const Vector<Color> &p_clear_colors, float p_clear_depth, uint32_t p_clear_stencil, const Rect2 &p_region, Point2i viewport_offset, Point2i viewport_size, ID3D12GraphicsCommandList *command_list, const Vector<RID> &p_storage_textures); + _FORCE_INLINE_ DrawList *_get_draw_list_ptr(DrawListID p_id); + Buffer *_get_buffer_from_owner(RID p_buffer); + Error _draw_list_allocate(const Rect2i &p_viewport, uint32_t p_splits, uint32_t p_subpass); + void _draw_list_free(Rect2i *r_last_viewport = nullptr); + void _draw_list_subpass_begin(); + void _draw_list_subpass_end(); + + /**********************/ + /**** COMPUTE LIST ****/ + /**********************/ + + struct ComputeList { + ID3D12GraphicsCommandList *command_list = nullptr; // If persistent, this is owned, otherwise it's shared with the ringbuffer. + + struct SetState { + uint32_t pipeline_expected_format = 0; + uint32_t uniform_set_format = 0; + RID uniform_set; + bool bound = false; +#ifdef DEV_ENABLED + // Filthy, but useful for dev. + const Vector<UniformInfo> *_pipeline_expected_format = nullptr; + const UniformSet *_uniform_set = nullptr; +#endif + }; + + struct State { + HashSet<Texture *> textures_to_sampled_layout; + SetState sets[MAX_UNIFORM_SETS]; + uint32_t set_count = 0; + RID pipeline; + ID3D12PipelineState *pso = nullptr; + ID3D12PipelineState *bound_pso = nullptr; + RID pipeline_shader; + uint32_t pipeline_dxil_push_constant_size = 0; + uint32_t pipeline_bindings_id = 0; + uint32_t root_signature_crc = 0; + uint32_t local_group_size[3] = { 0, 0, 0 }; + bool allow_draw_overlap; +#ifdef DEV_ENABLED + // Filthy, but useful for dev. + Shader *_shader = nullptr; +#endif + } state; + +#ifdef DEBUG_ENABLED + struct Validation { + bool active = true; // Means command buffer was not closed, so you can keep adding things. + Vector<uint32_t> set_formats; + Vector<bool> set_bound; + Vector<RID> set_rids; + // Last pipeline set values. + bool pipeline_active = false; + RID pipeline_shader; + uint32_t pipeline_spirv_push_constant_size = 0; + bool pipeline_push_constant_supplied = false; + } validation; +#endif + }; + + ComputeList *compute_list = nullptr; + + /**************************/ + /**** FRAME MANAGEMENT ****/ + /**************************/ + + // This is the frame structure. There are normally + // 3 of these (used for triple buffering), or 2 + // (double buffering). They are cycled constantly. + // + // It contains two command buffers, one that is + // used internally for setting up (creating stuff) + // and another used mostly for drawing. + // + // They also contains a list of things that need + // to be disposed of when deleted, which can't + // happen immediately due to the asynchronous + // nature of the GPU. They will get deleted + // when the frame is cycled. + + struct Frame { + // List in usage order, from last to free to first to free. + List<Buffer> buffers_to_dispose_of; + List<Texture> textures_to_dispose_of; + List<Framebuffer> framebuffers_to_dispose_of; + List<Shader> shaders_to_dispose_of; + List<RenderPipeline> render_pipelines_to_dispose_of; + List<ComputePipeline> compute_pipelines_to_dispose_of; + struct { + DescriptorsHeap resources; + DescriptorsHeap samplers; + DescriptorsHeap aux; + DescriptorsHeap rtv; + } desc_heaps; + struct { + DescriptorsHeap::Walker resources; + DescriptorsHeap::Walker samplers; + DescriptorsHeap::Walker aux; + DescriptorsHeap::Walker rtv; + } desc_heap_walkers; + struct { + bool resources; + bool samplers; + bool aux; + bool rtv; + } desc_heaps_exhausted_reported; + CD3DX12_CPU_DESCRIPTOR_HANDLE null_rtv_handle = {}; // For [[MANUAL_SUBPASSES]]. + + ComPtr<ID3D12CommandAllocator> setup_command_allocator; + ComPtr<ID3D12CommandAllocator> draw_command_allocator; + ComPtr<ID3D12GraphicsCommandList> setup_command_list; // Used at the beginning of every frame for set-up. + ComPtr<ID3D12GraphicsCommandList> draw_command_list; + + struct Timestamp { + String description; + uint64_t value = 0; + }; + + ComPtr<ID3D12QueryHeap> timestamp_heap; + + TightLocalVector<String> timestamp_names; + TightLocalVector<uint64_t> timestamp_cpu_values; + uint32_t timestamp_count = 0; + TightLocalVector<String> timestamp_result_names; + TightLocalVector<uint64_t> timestamp_cpu_result_values; + Buffer timestamp_result_values_buffer; + TightLocalVector<uint64_t> timestamp_result_values; + uint32_t timestamp_result_count = 0; + uint64_t index = 0; + uint64_t execution_index = 0; +#ifdef DEV_ENABLED + uint32_t uniform_set_reused = 0; +#endif + }; + + uint32_t max_timestamp_query_elements = 0; + + TightLocalVector<Frame> frames; // Frames available, for main device they are cycled (usually 3), for local devices only 1. + int frame = 0; // Current frame. + int frame_count = 0; // Total amount of frames. + uint64_t frames_drawn = 0; + uint32_t execution_index = 0; // Gets incremented on every call to ExecuteCommandLists (each frame and each flush). + RID local_device; + bool local_device_processing = false; + + void _free_pending_resources(int p_frame); + +//#define USE_SMALL_ALLOCS_POOL // Disabled by now; seems not to be beneficial as it is in Vulkan. +#ifdef USE_SMALL_ALLOCS_POOL + union AllocPoolKey { + struct { + D3D12_HEAP_TYPE heap_type; + D3D12_HEAP_FLAGS heap_flags; + }; + uint64_t key; + }; + HashMap<uint64_t, ComPtr<D3D12MA::Pool>> small_allocs_pools; + D3D12MA::Pool *_find_or_create_small_allocs_pool(D3D12_HEAP_TYPE p_heap_type, D3D12_HEAP_FLAGS p_heap_flags); +#endif + + ComPtr<ID3D12CommandSignature> indirect_dispatch_cmd_sig; + RID aux_resource; // Used for causing full barriers. + + D3D12Context *context = nullptr; + + uint64_t image_memory = 0; + uint64_t buffer_memory = 0; + + void _free_internal(RID p_id); + void _flush(bool p_flush_current_frame); + + bool screen_prepared = false; + + template <class T> + void _free_rids(T &p_owner, const char *p_type); + + void _finalize_command_bufers(); + void _begin_frame(); + +#ifdef DEV_ENABLED + HashMap<RID, String> resource_names; +#endif + + HashMap<DXGI_FORMAT, uint32_t> format_sample_counts_mask_cache; + uint32_t _find_max_common_supported_sample_count(const DXGI_FORMAT *p_formats, uint32_t p_num_formats); + +public: + virtual RID texture_create(const TextureFormat &p_format, const TextureView &p_view, const Vector<Vector<uint8_t>> &p_data = Vector<Vector<uint8_t>>()); + virtual RID texture_create_shared(const TextureView &p_view, RID p_with_texture); + virtual RID texture_create_from_extension(TextureType p_type, DataFormat p_format, TextureSamples p_samples, BitField<RenderingDevice::TextureUsageBits> p_flags, uint64_t p_image, uint64_t p_width, uint64_t p_height, uint64_t p_depth, uint64_t p_layers); + + virtual RID texture_create_shared_from_slice(const TextureView &p_view, RID p_with_texture, uint32_t p_layer, uint32_t p_mipmap, uint32_t p_mipmaps = 1, TextureSliceType p_slice_type = TEXTURE_SLICE_2D, uint32_t p_layers = 0); + virtual Error texture_update(RID p_texture, uint32_t p_layer, const Vector<uint8_t> &p_data, BitField<BarrierMask> p_post_barrier = BARRIER_MASK_ALL_BARRIERS); + virtual Vector<uint8_t> texture_get_data(RID p_texture, uint32_t p_layer); + + virtual bool texture_is_format_supported_for_usage(DataFormat p_format, BitField<RenderingDevice::TextureUsageBits> p_usage) const; + virtual bool texture_is_shared(RID p_texture); + virtual bool texture_is_valid(RID p_texture); + virtual TextureFormat texture_get_format(RID p_texture); + virtual Size2i texture_size(RID p_texture); + virtual uint64_t texture_get_native_handle(RID p_texture); + + virtual Error texture_copy(RID p_from_texture, RID p_to_texture, const Vector3 &p_from, const Vector3 &p_to, const Vector3 &p_size, uint32_t p_src_mipmap, uint32_t p_dst_mipmap, uint32_t p_src_layer, uint32_t p_dst_layer, BitField<BarrierMask> p_post_barrier = BARRIER_MASK_ALL_BARRIERS); + virtual Error texture_clear(RID p_texture, const Color &p_color, uint32_t p_base_mipmap, uint32_t p_mipmaps, uint32_t p_base_layer, uint32_t p_layers, BitField<BarrierMask> p_post_barrier = BARRIER_MASK_ALL_BARRIERS); + virtual Error texture_resolve_multisample(RID p_from_texture, RID p_to_texture, BitField<BarrierMask> p_post_barrier = BARRIER_MASK_ALL_BARRIERS); + + /*********************/ + /**** FRAMEBUFFER ****/ + /*********************/ + + virtual FramebufferFormatID framebuffer_format_create(const Vector<AttachmentFormat> &p_format, uint32_t p_view_count = 1); + virtual FramebufferFormatID framebuffer_format_create_multipass(const Vector<AttachmentFormat> &p_attachments, const Vector<FramebufferPass> &p_passes, uint32_t p_view_count = 1); + virtual FramebufferFormatID framebuffer_format_create_empty(TextureSamples p_samples = TEXTURE_SAMPLES_1); + virtual TextureSamples framebuffer_format_get_texture_samples(FramebufferFormatID p_format, uint32_t p_pass = 0); + + virtual RID framebuffer_create(const Vector<RID> &p_texture_attachments, FramebufferFormatID p_format_check = INVALID_ID, uint32_t p_view_count = 1); + virtual RID framebuffer_create_multipass(const Vector<RID> &p_texture_attachments, const Vector<FramebufferPass> &p_passes, FramebufferFormatID p_format_check = INVALID_ID, uint32_t p_view_count = 1); + virtual RID framebuffer_create_empty(const Size2i &p_size, TextureSamples p_samples = TEXTURE_SAMPLES_1, FramebufferFormatID p_format_check = INVALID_ID); + virtual bool framebuffer_is_valid(RID p_framebuffer) const; + virtual void framebuffer_set_invalidation_callback(RID p_framebuffer, InvalidationCallback p_callback, void *p_userdata); + + virtual FramebufferFormatID framebuffer_get_format(RID p_framebuffer); + + /*****************/ + /**** SAMPLER ****/ + /*****************/ + + virtual RID sampler_create(const SamplerState &p_state); + virtual bool sampler_is_format_supported_for_filter(DataFormat p_format, SamplerFilter p_sampler_filter) const; + + /**********************/ + /**** VERTEX ARRAY ****/ + /**********************/ + + virtual RID vertex_buffer_create(uint32_t p_size_bytes, const Vector<uint8_t> &p_data = Vector<uint8_t>(), bool p_use_as_storage = false); + + // Internally reference counted, this ID is warranted to be unique for the same description, but needs to be freed as many times as it was allocated. + virtual VertexFormatID vertex_format_create(const Vector<VertexAttribute> &p_vertex_formats); + virtual RID vertex_array_create(uint32_t p_vertex_count, VertexFormatID p_vertex_format, const Vector<RID> &p_src_buffers, const Vector<uint64_t> &p_offsets = Vector<uint64_t>()); + + virtual RID index_buffer_create(uint32_t p_size_indices, IndexBufferFormat p_format, const Vector<uint8_t> &p_data = Vector<uint8_t>(), bool p_use_restart_indices = false); + + virtual RID index_array_create(RID p_index_buffer, uint32_t p_index_offset, uint32_t p_index_count); + + /****************/ + /**** SHADER ****/ + /****************/ + + virtual String shader_get_binary_cache_key() const; + virtual Vector<uint8_t> shader_compile_binary_from_spirv(const Vector<ShaderStageSPIRVData> &p_spirv, const String &p_shader_name = ""); + + virtual RID shader_create_from_bytecode(const Vector<uint8_t> &p_shader_binary, RID p_placeholder = RID()); + virtual RID shader_create_placeholder(); + + virtual uint64_t shader_get_vertex_input_attribute_mask(RID p_shader); + + /*****************/ + /**** UNIFORM ****/ + /*****************/ + + virtual RID uniform_buffer_create(uint32_t p_size_bytes, const Vector<uint8_t> &p_data = Vector<uint8_t>()); + virtual RID storage_buffer_create(uint32_t p_size_bytes, const Vector<uint8_t> &p_data = Vector<uint8_t>(), BitField<StorageBufferUsage> p_usage = 0); + virtual RID texture_buffer_create(uint32_t p_size_elements, DataFormat p_format, const Vector<uint8_t> &p_data = Vector<uint8_t>()); + + virtual RID uniform_set_create(const Vector<Uniform> &p_uniforms, RID p_shader, uint32_t p_shader_set); + virtual bool uniform_set_is_valid(RID p_uniform_set); + virtual void uniform_set_set_invalidation_callback(RID p_uniform_set, InvalidationCallback p_callback, void *p_userdata); + + virtual Error buffer_copy(RID p_src_buffer, RID p_dst_buffer, uint32_t p_src_offset, uint32_t p_dst_offset, uint32_t p_size, BitField<BarrierMask> p_post_barrier = BARRIER_MASK_ALL_BARRIERS); + virtual Error buffer_update(RID p_buffer, uint32_t p_offset, uint32_t p_size, const void *p_data, BitField<BarrierMask> p_post_barrier = BARRIER_MASK_ALL_BARRIERS); // Works for any buffer. + virtual Error buffer_clear(RID p_buffer, uint32_t p_offset, uint32_t p_size, BitField<BarrierMask> p_post_barrier = BARRIER_MASK_ALL_BARRIERS); + virtual Vector<uint8_t> buffer_get_data(RID p_buffer, uint32_t p_offset = 0, uint32_t p_size = 0); + + /*************************/ + /**** RENDER PIPELINE ****/ + /*************************/ + + virtual RID render_pipeline_create(RID p_shader, FramebufferFormatID p_framebuffer_format, VertexFormatID p_vertex_format, RenderPrimitive p_render_primitive, const PipelineRasterizationState &p_rasterization_state, const PipelineMultisampleState &p_multisample_state, const PipelineDepthStencilState &p_depth_stencil_state, const PipelineColorBlendState &p_blend_state, BitField<PipelineDynamicStateFlags> p_dynamic_state_flags = 0, uint32_t p_for_render_pass = 0, const Vector<PipelineSpecializationConstant> &p_specialization_constants = Vector<PipelineSpecializationConstant>()); + virtual bool render_pipeline_is_valid(RID p_pipeline); + + /**************************/ + /**** COMPUTE PIPELINE ****/ + /**************************/ + + virtual RID compute_pipeline_create(RID p_shader, const Vector<PipelineSpecializationConstant> &p_specialization_constants = Vector<PipelineSpecializationConstant>()); + virtual bool compute_pipeline_is_valid(RID p_pipeline); + + /****************/ + /**** SCREEN ****/ + /****************/ + + virtual int screen_get_width(DisplayServer::WindowID p_screen = 0) const; + virtual int screen_get_height(DisplayServer::WindowID p_screen = 0) const; + virtual FramebufferFormatID screen_get_framebuffer_format() const; + + /********************/ + /**** DRAW LISTS ****/ + /********************/ + + virtual DrawListID draw_list_begin_for_screen(DisplayServer::WindowID p_screen = 0, const Color &p_clear_color = Color()); + virtual DrawListID draw_list_begin(RID p_framebuffer, InitialAction p_initial_color_action, FinalAction p_final_color_action, InitialAction p_initial_depth_action, FinalAction p_final_depth_action, const Vector<Color> &p_clear_color_values = Vector<Color>(), float p_clear_depth = 1.0, uint32_t p_clear_stencil = 0, const Rect2 &p_region = Rect2(), const Vector<RID> &p_storage_textures = Vector<RID>()); + virtual Error draw_list_begin_split(RID p_framebuffer, uint32_t p_splits, DrawListID *r_split_ids, InitialAction p_initial_color_action, FinalAction p_final_color_action, InitialAction p_initial_depth_action, FinalAction p_final_depth_action, const Vector<Color> &p_clear_color_values = Vector<Color>(), float p_clear_depth = 1.0, uint32_t p_clear_stencil = 0, const Rect2 &p_region = Rect2(), const Vector<RID> &p_storage_textures = Vector<RID>()); + + virtual void draw_list_set_blend_constants(DrawListID p_list, const Color &p_color); + virtual void draw_list_bind_render_pipeline(DrawListID p_list, RID p_render_pipeline); + virtual void draw_list_bind_uniform_set(DrawListID p_list, RID p_uniform_set, uint32_t p_index); + virtual void draw_list_bind_vertex_array(DrawListID p_list, RID p_vertex_array); + virtual void draw_list_bind_index_array(DrawListID p_list, RID p_index_array); + virtual void draw_list_set_line_width(DrawListID p_list, float p_width); + virtual void draw_list_set_push_constant(DrawListID p_list, const void *p_data, uint32_t p_data_size); + + virtual void draw_list_draw(DrawListID p_list, bool p_use_indices, uint32_t p_instances = 1, uint32_t p_procedural_vertices = 0); + + virtual void draw_list_enable_scissor(DrawListID p_list, const Rect2 &p_rect); + virtual void draw_list_disable_scissor(DrawListID p_list); + + virtual uint32_t draw_list_get_current_pass(); + virtual DrawListID draw_list_switch_to_next_pass(); + virtual Error draw_list_switch_to_next_pass_split(uint32_t p_splits, DrawListID *r_split_ids); + + virtual void draw_list_end(BitField<BarrierMask> p_post_barrier = BARRIER_MASK_ALL_BARRIERS); + + /***********************/ + /**** COMPUTE LISTS ****/ + /***********************/ + + virtual ComputeListID compute_list_begin(bool p_allow_draw_overlap = false); + virtual void compute_list_bind_compute_pipeline(ComputeListID p_list, RID p_compute_pipeline); + virtual void compute_list_bind_uniform_set(ComputeListID p_list, RID p_uniform_set, uint32_t p_index); + virtual void compute_list_set_push_constant(ComputeListID p_list, const void *p_data, uint32_t p_data_size); + virtual void compute_list_add_barrier(ComputeListID p_list); + + virtual void compute_list_dispatch(ComputeListID p_list, uint32_t p_x_groups, uint32_t p_y_groups, uint32_t p_z_groups); + virtual void compute_list_dispatch_threads(ComputeListID p_list, uint32_t p_x_threads, uint32_t p_y_threads, uint32_t p_z_threads); + virtual void compute_list_dispatch_indirect(ComputeListID p_list, RID p_buffer, uint32_t p_offset); + virtual void compute_list_end(BitField<BarrierMask> p_post_barrier = BARRIER_MASK_ALL_BARRIERS); + + virtual void barrier(BitField<BarrierMask> p_from = BARRIER_MASK_ALL_BARRIERS, BitField<BarrierMask> p_to = BARRIER_MASK_ALL_BARRIERS); + virtual void full_barrier(); + + /**************/ + /**** FREE ****/ + /**************/ + + virtual void free(RID p_id); + + /****************/ + /**** Timing ****/ + /****************/ + + virtual void capture_timestamp(const String &p_name); + virtual uint32_t get_captured_timestamps_count() const; + virtual uint64_t get_captured_timestamps_frame() const; + virtual uint64_t get_captured_timestamp_gpu_time(uint32_t p_index) const; + virtual uint64_t get_captured_timestamp_cpu_time(uint32_t p_index) const; + virtual String get_captured_timestamp_name(uint32_t p_index) const; + + /****************/ + /**** Limits ****/ + /****************/ + + virtual uint64_t limit_get(Limit p_limit) const; + + virtual void prepare_screen_for_drawing(); + + void initialize(D3D12Context *p_context, bool p_local_device = false); + void finalize(); + + virtual void swap_buffers(); // For main device. + + virtual void submit(); // For local device. + virtual void sync(); // For local device. + + virtual uint32_t get_frame_delay() const; + + virtual RenderingDevice *create_local_device(); + + virtual uint64_t get_memory_usage(MemoryType p_type) const; + + virtual void set_resource_name(RID p_id, const String p_name); + + virtual void draw_command_begin_label(String p_label_name, const Color p_color = Color(1, 1, 1, 1)); + virtual void draw_command_insert_label(String p_label_name, const Color p_color = Color(1, 1, 1, 1)); + virtual void draw_command_end_label(); + + virtual String get_device_vendor_name() const; + virtual String get_device_name() const; + virtual RenderingDevice::DeviceType get_device_type() const; + virtual String get_device_api_version() const; + virtual String get_device_pipeline_cache_uuid() const; + + virtual uint64_t get_driver_resource(DriverResource p_resource, RID p_rid = RID(), uint64_t p_index = 0); + + virtual bool has_feature(const Features p_feature) const; + + RenderingDeviceD3D12(); + ~RenderingDeviceD3D12(); +}; + +#endif // RENDERING_DEVICE_D3D12_H diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp index 2db17e96f7..5d6cef6e05 100644 --- a/drivers/gles3/rasterizer_canvas_gles3.cpp +++ b/drivers/gles3/rasterizer_canvas_gles3.cpp @@ -104,7 +104,7 @@ void RasterizerCanvasGLES3::_update_transform_to_mat4(const Transform3D &p_trans p_mat4[15] = 1; } -void RasterizerCanvasGLES3::canvas_render_items(RID p_to_render_target, Item *p_item_list, const Color &p_modulate, Light *p_light_list, Light *p_directional_light_list, const Transform2D &p_canvas_transform, RS::CanvasItemTextureFilter p_default_filter, RS::CanvasItemTextureRepeat p_default_repeat, bool p_snap_2d_vertices_to_pixel, bool &r_sdf_used) { +void RasterizerCanvasGLES3::canvas_render_items(RID p_to_render_target, Item *p_item_list, const Color &p_modulate, Light *p_light_list, Light *p_directional_light_list, const Transform2D &p_canvas_transform, RS::CanvasItemTextureFilter p_default_filter, RS::CanvasItemTextureRepeat p_default_repeat, bool p_snap_2d_vertices_to_pixel, bool &r_sdf_used, RenderingMethod::RenderInfo *r_render_info) { GLES3::TextureStorage *texture_storage = GLES3::TextureStorage::get_singleton(); GLES3::MaterialStorage *material_storage = GLES3::MaterialStorage::get_singleton(); GLES3::MeshStorage *mesh_storage = GLES3::MeshStorage::get_singleton(); @@ -459,7 +459,7 @@ void RasterizerCanvasGLES3::canvas_render_items(RID p_to_render_target, Item *p_ update_skeletons = false; } // Canvas group begins here, render until before this item - _render_items(p_to_render_target, item_count, canvas_transform_inverse, p_light_list, r_sdf_used); + _render_items(p_to_render_target, item_count, canvas_transform_inverse, p_light_list, r_sdf_used, false, r_render_info); item_count = 0; if (ci->canvas_group_owner->canvas_group->mode != RS::CANVAS_GROUP_MODE_TRANSPARENT) { @@ -490,7 +490,7 @@ void RasterizerCanvasGLES3::canvas_render_items(RID p_to_render_target, Item *p_ mesh_storage->update_mesh_instances(); update_skeletons = false; } - _render_items(p_to_render_target, item_count, canvas_transform_inverse, p_light_list, r_sdf_used, true); + _render_items(p_to_render_target, item_count, canvas_transform_inverse, p_light_list, r_sdf_used, true, r_render_info); item_count = 0; if (ci->canvas_group->blur_mipmaps) { @@ -514,7 +514,7 @@ void RasterizerCanvasGLES3::canvas_render_items(RID p_to_render_target, Item *p_ } //render anything pending, including clearing if no items - _render_items(p_to_render_target, item_count, canvas_transform_inverse, p_light_list, r_sdf_used); + _render_items(p_to_render_target, item_count, canvas_transform_inverse, p_light_list, r_sdf_used, false, r_render_info); item_count = 0; texture_storage->render_target_copy_to_back_buffer(p_to_render_target, back_buffer_rect, backbuffer_gen_mipmaps); @@ -544,7 +544,7 @@ void RasterizerCanvasGLES3::canvas_render_items(RID p_to_render_target, Item *p_ mesh_storage->update_mesh_instances(); update_skeletons = false; } - _render_items(p_to_render_target, item_count, canvas_transform_inverse, p_light_list, r_sdf_used, canvas_group_owner != nullptr); + _render_items(p_to_render_target, item_count, canvas_transform_inverse, p_light_list, r_sdf_used, canvas_group_owner != nullptr, r_render_info); //then reset item_count = 0; } @@ -564,7 +564,7 @@ void RasterizerCanvasGLES3::canvas_render_items(RID p_to_render_target, Item *p_ state.current_instance_buffer_index = 0; } -void RasterizerCanvasGLES3::_render_items(RID p_to_render_target, int p_item_count, const Transform2D &p_canvas_transform_inverse, Light *p_lights, bool &r_sdf_used, bool p_to_backbuffer) { +void RasterizerCanvasGLES3::_render_items(RID p_to_render_target, int p_item_count, const Transform2D &p_canvas_transform_inverse, Light *p_lights, bool &r_sdf_used, bool p_to_backbuffer, RenderingMethod::RenderInfo *r_render_info) { GLES3::MaterialStorage *material_storage = GLES3::MaterialStorage::get_singleton(); canvas_begin(p_to_render_target, p_to_backbuffer); @@ -661,6 +661,11 @@ void RasterizerCanvasGLES3::_render_items(RID p_to_render_target, int p_item_cou state.current_tex = RID(); for (uint32_t i = 0; i <= state.current_batch_index; i++) { + // Skipping when there is no instances. + if (state.canvas_instance_batches[i].instance_count == 0) { + continue; + } + //setup clip if (current_clip != state.canvas_instance_batches[i].clip) { current_clip = state.canvas_instance_batches[i].clip; @@ -767,7 +772,7 @@ void RasterizerCanvasGLES3::_render_items(RID p_to_render_target, int p_item_cou last_blend_color = blend_color; } - _render_batch(p_lights, i); + _render_batch(p_lights, i, r_render_info); } state.current_batch_index = 0; @@ -1235,7 +1240,13 @@ void RasterizerCanvasGLES3::_record_item_commands(const Item *p_item, RID p_rend } } -void RasterizerCanvasGLES3::_render_batch(Light *p_lights, uint32_t p_index) { +_FORCE_INLINE_ static uint32_t _indices_to_primitives(RS::PrimitiveType p_primitive, uint32_t p_indices) { + static const uint32_t divisor[RS::PRIMITIVE_MAX] = { 1, 2, 1, 3, 1 }; + static const uint32_t subtractor[RS::PRIMITIVE_MAX] = { 0, 0, 1, 0, 1 }; + return (p_indices - subtractor[p_primitive]) / divisor[p_primitive]; +} + +void RasterizerCanvasGLES3::_render_batch(Light *p_lights, uint32_t p_index, RenderingMethod::RenderInfo *r_render_info) { ERR_FAIL_NULL(state.canvas_instance_batches[state.current_batch_index].command); // Used by Polygon and Mesh. @@ -1254,6 +1265,12 @@ void RasterizerCanvasGLES3::_render_batch(Light *p_lights, uint32_t p_index) { glDrawElementsInstanced(GL_TRIANGLES, 6, GL_UNSIGNED_INT, 0, state.canvas_instance_batches[p_index].instance_count); glBindVertexArray(0); + if (r_render_info) { + r_render_info->info[RS::VIEWPORT_RENDER_INFO_TYPE_CANVAS][RS::VIEWPORT_RENDER_INFO_OBJECTS_IN_FRAME] += state.canvas_instance_batches[p_index].instance_count; + r_render_info->info[RS::VIEWPORT_RENDER_INFO_TYPE_CANVAS][RS::VIEWPORT_RENDER_INFO_PRIMITIVES_IN_FRAME] += 2 * state.canvas_instance_batches[p_index].instance_count; + r_render_info->info[RS::VIEWPORT_RENDER_INFO_TYPE_CANVAS][RS::VIEWPORT_RENDER_INFO_DRAW_CALLS_IN_FRAME]++; + } + } break; case Item::Command::TYPE_POLYGON: { @@ -1283,6 +1300,12 @@ void RasterizerCanvasGLES3::_render_batch(Light *p_lights, uint32_t p_index) { // Reset so this doesn't pollute other draw calls. glVertexAttrib4f(RS::ARRAY_COLOR, 1.0, 1.0, 1.0, 1.0); } + + if (r_render_info) { + r_render_info->info[RS::VIEWPORT_RENDER_INFO_TYPE_CANVAS][RS::VIEWPORT_RENDER_INFO_OBJECTS_IN_FRAME]++; + r_render_info->info[RS::VIEWPORT_RENDER_INFO_TYPE_CANVAS][RS::VIEWPORT_RENDER_INFO_PRIMITIVES_IN_FRAME] += _indices_to_primitives(polygon->primitive, pb->count); + r_render_info->info[RS::VIEWPORT_RENDER_INFO_TYPE_CANVAS][RS::VIEWPORT_RENDER_INFO_DRAW_CALLS_IN_FRAME]++; + } } break; case Item::Command::TYPE_PRIMITIVE: { @@ -1297,6 +1320,12 @@ void RasterizerCanvasGLES3::_render_batch(Light *p_lights, uint32_t p_index) { if (instance_count >= 1) { glDrawArraysInstanced(primitive[state.canvas_instance_batches[p_index].primitive_points], 0, state.canvas_instance_batches[p_index].primitive_points, instance_count); } + if (r_render_info) { + const RenderingServer::PrimitiveType rs_primitive[5] = { RS::PRIMITIVE_POINTS, RS::PRIMITIVE_POINTS, RS::PRIMITIVE_LINES, RS::PRIMITIVE_TRIANGLES, RS::PRIMITIVE_TRIANGLES }; + r_render_info->info[RS::VIEWPORT_RENDER_INFO_TYPE_CANVAS][RS::VIEWPORT_RENDER_INFO_OBJECTS_IN_FRAME] += instance_count; + r_render_info->info[RS::VIEWPORT_RENDER_INFO_TYPE_CANVAS][RS::VIEWPORT_RENDER_INFO_PRIMITIVES_IN_FRAME] += _indices_to_primitives(rs_primitive[state.canvas_instance_batches[p_index].primitive_points], state.canvas_instance_batches[p_index].primitive_points) * instance_count; + r_render_info->info[RS::VIEWPORT_RENDER_INFO_TYPE_CANVAS][RS::VIEWPORT_RENDER_INFO_DRAW_CALLS_IN_FRAME]++; + } } break; @@ -1383,7 +1412,7 @@ void RasterizerCanvasGLES3::_render_batch(Light *p_lights, uint32_t p_index) { GLuint vertex_array_gl = 0; GLuint index_array_gl = 0; - uint64_t input_mask = 0; // 2D meshes always use the same vertex format. + uint64_t input_mask = RS::ARRAY_FORMAT_VERTEX | RS::ARRAY_FORMAT_COLOR | RS::ARRAY_FORMAT_TEX_UV; // 2D meshes always use the same vertex format. if (mesh_instance.is_valid()) { mesh_storage->mesh_instance_surface_get_vertex_arrays_and_format(mesh_instance, j, input_mask, vertex_array_gl); } else { @@ -1432,10 +1461,12 @@ void RasterizerCanvasGLES3::_render_batch(Light *p_lights, uint32_t p_index) { GLenum primitive_gl = prim[int(primitive)]; + uint32_t vertex_count = mesh_storage->mesh_surface_get_vertices_drawn_count(surface); + if (use_index_buffer) { - glDrawElementsInstanced(primitive_gl, mesh_storage->mesh_surface_get_vertices_drawn_count(surface), mesh_storage->mesh_surface_get_index_type(surface), 0, instance_count); + glDrawElementsInstanced(primitive_gl, vertex_count, mesh_storage->mesh_surface_get_index_type(surface), 0, instance_count); } else { - glDrawArraysInstanced(primitive_gl, 0, mesh_storage->mesh_surface_get_vertices_drawn_count(surface), instance_count); + glDrawArraysInstanced(primitive_gl, 0, vertex_count, instance_count); } glBindBuffer(GL_ARRAY_BUFFER, 0); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); @@ -1445,6 +1476,12 @@ void RasterizerCanvasGLES3::_render_batch(Light *p_lights, uint32_t p_index) { glDisableVertexAttribArray(7); glDisableVertexAttribArray(8); } + if (r_render_info) { + // Meshes, Particles, and MultiMesh are always just one object with one draw call. + r_render_info->info[RS::VIEWPORT_RENDER_INFO_TYPE_CANVAS][RS::VIEWPORT_RENDER_INFO_OBJECTS_IN_FRAME]++; + r_render_info->info[RS::VIEWPORT_RENDER_INFO_TYPE_CANVAS][RS::VIEWPORT_RENDER_INFO_PRIMITIVES_IN_FRAME] += _indices_to_primitives(primitive, vertex_count) * instance_count; + r_render_info->info[RS::VIEWPORT_RENDER_INFO_TYPE_CANVAS][RS::VIEWPORT_RENDER_INFO_DRAW_CALLS_IN_FRAME]++; + } } } break; diff --git a/drivers/gles3/rasterizer_canvas_gles3.h b/drivers/gles3/rasterizer_canvas_gles3.h index 94c771cde7..552b2afd6b 100644 --- a/drivers/gles3/rasterizer_canvas_gles3.h +++ b/drivers/gles3/rasterizer_canvas_gles3.h @@ -354,10 +354,10 @@ public: void _bind_canvas_texture(RID p_texture, RS::CanvasItemTextureFilter p_base_filter, RS::CanvasItemTextureRepeat p_base_repeat); void _prepare_canvas_texture(RID p_texture, RS::CanvasItemTextureFilter p_base_filter, RS::CanvasItemTextureRepeat p_base_repeat, uint32_t &r_index, Size2 &r_texpixel_size); - void canvas_render_items(RID p_to_render_target, Item *p_item_list, const Color &p_modulate, Light *p_light_list, Light *p_directional_list, const Transform2D &p_canvas_transform, RS::CanvasItemTextureFilter p_default_filter, RS::CanvasItemTextureRepeat p_default_repeat, bool p_snap_2d_vertices_to_pixel, bool &r_sdf_used) override; - void _render_items(RID p_to_render_target, int p_item_count, const Transform2D &p_canvas_transform_inverse, Light *p_lights, bool &r_sdf_used, bool p_to_backbuffer = false); + void canvas_render_items(RID p_to_render_target, Item *p_item_list, const Color &p_modulate, Light *p_light_list, Light *p_directional_list, const Transform2D &p_canvas_transform, RS::CanvasItemTextureFilter p_default_filter, RS::CanvasItemTextureRepeat p_default_repeat, bool p_snap_2d_vertices_to_pixel, bool &r_sdf_used, RenderingMethod::RenderInfo *r_render_info = nullptr) override; + void _render_items(RID p_to_render_target, int p_item_count, const Transform2D &p_canvas_transform_inverse, Light *p_lights, bool &r_sdf_used, bool p_to_backbuffer = false, RenderingMethod::RenderInfo *r_render_info = nullptr); void _record_item_commands(const Item *p_item, RID p_render_target, const Transform2D &p_canvas_transform_inverse, Item *¤t_clip, GLES3::CanvasShaderData::BlendMode p_blend_mode, Light *p_lights, uint32_t &r_index, bool &r_break_batch, bool &r_sdf_used); - void _render_batch(Light *p_lights, uint32_t p_index); + void _render_batch(Light *p_lights, uint32_t p_index, RenderingMethod::RenderInfo *r_render_info = nullptr); bool _bind_material(GLES3::CanvasMaterialData *p_material_data, CanvasShaderGLES3::ShaderVariant p_variant, uint64_t p_specialization); void _new_batch(bool &r_batch_broken); void _add_to_batch(uint32_t &r_index, bool &r_batch_broken); diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp index 205f9a552e..a646b1ec7d 100644 --- a/drivers/gles3/rasterizer_scene_gles3.cpp +++ b/drivers/gles3/rasterizer_scene_gles3.cpp @@ -130,9 +130,27 @@ void RasterizerSceneGLES3::GeometryInstanceGLES3::_mark_dirty() { } void RasterizerSceneGLES3::GeometryInstanceGLES3::set_use_lightmap(RID p_lightmap_instance, const Rect2 &p_lightmap_uv_scale, int p_lightmap_slice_index) { + lightmap_instance = p_lightmap_instance; + lightmap_uv_scale = p_lightmap_uv_scale; + lightmap_slice_index = p_lightmap_slice_index; + + _mark_dirty(); } void RasterizerSceneGLES3::GeometryInstanceGLES3::set_lightmap_capture(const Color *p_sh9) { + if (p_sh9) { + if (lightmap_sh == nullptr) { + lightmap_sh = memnew(GeometryInstanceLightmapSH); + } + + memcpy(lightmap_sh->sh, p_sh9, sizeof(Color) * 9); + } else { + if (lightmap_sh != nullptr) { + memdelete(lightmap_sh); + lightmap_sh = nullptr; + } + } + _mark_dirty(); } void RasterizerSceneGLES3::_update_dirty_geometry_instances() { @@ -958,10 +976,10 @@ void RasterizerSceneGLES3::_update_sky_radiance(RID p_env, const Projection &p_p glDisable(GL_BLEND); glDepthMask(GL_FALSE); glDisable(GL_DEPTH_TEST); + scene_state.current_depth_test = GLES3::SceneShaderData::DEPTH_TEST_DISABLED; glDisable(GL_SCISSOR_TEST); - glCullFace(GL_BACK); - glEnable(GL_CULL_FACE); - scene_state.cull_mode = GLES3::SceneShaderData::CULL_BACK; + glDisable(GL_CULL_FACE); + scene_state.cull_mode = GLES3::SceneShaderData::CULL_DISABLED; for (int i = 0; i < 6; i++) { Basis local_view = Basis::looking_at(view_normals[i], view_up[i]); @@ -982,6 +1000,14 @@ void RasterizerSceneGLES3::_update_sky_radiance(RID p_env, const Projection &p_p sky->reflection_dirty = false; } else { if (sky_mode == RS::SKY_MODE_INCREMENTAL && sky->processing_layer < max_processing_layer) { + glDisable(GL_BLEND); + glDepthMask(GL_FALSE); + glDisable(GL_DEPTH_TEST); + scene_state.current_depth_test = GLES3::SceneShaderData::DEPTH_TEST_DISABLED; + glDisable(GL_SCISSOR_TEST); + glDisable(GL_CULL_FACE); + scene_state.cull_mode = GLES3::SceneShaderData::CULL_DISABLED; + _filter_sky_radiance(sky, sky->processing_layer); sky->processing_layer++; } @@ -1271,12 +1297,15 @@ void RasterizerSceneGLES3::_fill_render_list(RenderListType p_render_list, const int32_t shadow_id = GLES3::LightStorage::get_singleton()->light_instance_get_shadow_id(light_instance); if (GLES3::LightStorage::get_singleton()->light_has_shadow(light) && shadow_id >= 0) { - GeometryInstanceGLES3::LightPass pass; - pass.light_id = GLES3::LightStorage::get_singleton()->light_instance_get_gl_id(light_instance); - pass.shadow_id = shadow_id; - pass.light_instance_rid = light_instance; - pass.is_omni = true; - inst->light_passes.push_back(pass); + // Skip static lights when a lightmap is used. + if (!inst->lightmap_instance.is_valid() || GLES3::LightStorage::get_singleton()->light_get_bake_mode(light) != RenderingServer::LIGHT_BAKE_STATIC) { + GeometryInstanceGLES3::LightPass pass; + pass.light_id = GLES3::LightStorage::get_singleton()->light_instance_get_gl_id(light_instance); + pass.shadow_id = shadow_id; + pass.light_instance_rid = light_instance; + pass.is_omni = true; + inst->light_passes.push_back(pass); + } } else { // Lights without shadow can all go in base pass. inst->omni_light_gl_cache.push_back((uint32_t)GLES3::LightStorage::get_singleton()->light_instance_get_gl_id(light_instance)); @@ -1294,11 +1323,14 @@ void RasterizerSceneGLES3::_fill_render_list(RenderListType p_render_list, const int32_t shadow_id = GLES3::LightStorage::get_singleton()->light_instance_get_shadow_id(light_instance); if (GLES3::LightStorage::get_singleton()->light_has_shadow(light) && shadow_id >= 0) { - GeometryInstanceGLES3::LightPass pass; - pass.light_id = GLES3::LightStorage::get_singleton()->light_instance_get_gl_id(light_instance); - pass.shadow_id = shadow_id; - pass.light_instance_rid = light_instance; - inst->light_passes.push_back(pass); + // Skip static lights when a lightmap is used. + if (!inst->lightmap_instance.is_valid() || GLES3::LightStorage::get_singleton()->light_get_bake_mode(light) != RenderingServer::LIGHT_BAKE_STATIC) { + GeometryInstanceGLES3::LightPass pass; + pass.light_id = GLES3::LightStorage::get_singleton()->light_instance_get_gl_id(light_instance); + pass.shadow_id = shadow_id; + pass.light_instance_rid = light_instance; + inst->light_passes.push_back(pass); + } } else { // Lights without shadow can all go in base pass. inst->spot_light_gl_cache.push_back((uint32_t)GLES3::LightStorage::get_singleton()->light_instance_get_gl_id(light_instance)); @@ -1610,6 +1642,8 @@ void RasterizerSceneGLES3::_setup_lights(const RenderDataGLES3 *p_render_data, b light_data.direction[1] = direction.y; light_data.direction[2] = direction.z; + light_data.bake_mode = light_storage->light_get_bake_mode(base); + float sign = light_storage->light_is_negative(base) ? -1 : 1; light_data.energy = sign * light_storage->light_get_param(base, RS::LIGHT_PARAM_ENERGY); @@ -1758,6 +1792,8 @@ void RasterizerSceneGLES3::_setup_lights(const RenderDataGLES3 *p_render_data, b light_data.position[1] = pos.y; light_data.position[2] = pos.z; + light_data.bake_mode = light_storage->light_get_bake_mode(base); + float radius = MAX(0.001, light_storage->light_get_param(base, RS::LIGHT_PARAM_RANGE)); light_data.inv_radius = 1.0 / radius; @@ -2238,9 +2274,7 @@ void RasterizerSceneGLES3::render_scene(const Ref<RenderSceneBuffers> &p_render_ bool fb_cleared = false; - Size2i screen_size; - screen_size.x = rb->width; - screen_size.y = rb->height; + Size2i screen_size = rb->internal_size; bool use_wireframe = get_debug_draw_mode() == RS::VIEWPORT_DEBUG_DRAW_WIREFRAME; @@ -2360,8 +2394,10 @@ void RasterizerSceneGLES3::render_scene(const Ref<RenderSceneBuffers> &p_render_ } } - glBindFramebuffer(GL_FRAMEBUFFER, rt->fbo); - glViewport(0, 0, rb->width, rb->height); + GLuint fbo = rb->get_render_fbo(); + + glBindFramebuffer(GL_FRAMEBUFFER, fbo); + glViewport(0, 0, rb->internal_size.x, rb->internal_size.y); glCullFace(GL_BACK); glEnable(GL_CULL_FACE); @@ -2463,25 +2499,48 @@ void RasterizerSceneGLES3::render_scene(const Ref<RenderSceneBuffers> &p_render_ } if (scene_state.used_screen_texture || scene_state.used_depth_texture) { - texture_storage->copy_scene_to_backbuffer(rt, scene_state.used_screen_texture, scene_state.used_depth_texture); - glBindFramebuffer(GL_READ_FRAMEBUFFER, rt->fbo); - glReadBuffer(GL_COLOR_ATTACHMENT0); - glBindFramebuffer(GL_DRAW_FRAMEBUFFER, rt->backbuffer_fbo); - if (scene_state.used_screen_texture) { - glBlitFramebuffer(0, 0, rt->size.x, rt->size.y, - 0, 0, rt->size.x, rt->size.y, - GL_COLOR_BUFFER_BIT, GL_NEAREST); - glActiveTexture(GL_TEXTURE0 + config->max_texture_image_units - 5); - glBindTexture(GL_TEXTURE_2D, rt->backbuffer); - } - if (scene_state.used_depth_texture) { - glBlitFramebuffer(0, 0, rt->size.x, rt->size.y, - 0, 0, rt->size.x, rt->size.y, - GL_DEPTH_BUFFER_BIT, GL_NEAREST); - glActiveTexture(GL_TEXTURE0 + config->max_texture_image_units - 6); - glBindTexture(GL_TEXTURE_2D, rt->backbuffer_depth); - } - glBindFramebuffer(GL_FRAMEBUFFER, rt->fbo); + Size2i size; + GLuint backbuffer_fbo = 0; + GLuint backbuffer = 0; + GLuint backbuffer_depth = 0; + + if (rb->get_scaling_3d_mode() == RS::VIEWPORT_SCALING_3D_MODE_OFF) { + texture_storage->check_backbuffer(rt, scene_state.used_screen_texture, scene_state.used_depth_texture); // note, badly names, this just allocates! + + size = rt->size; + backbuffer_fbo = rt->backbuffer_fbo; + backbuffer = rt->backbuffer; + backbuffer_depth = rt->backbuffer_depth; + } else { + rb->check_backbuffer(scene_state.used_screen_texture, scene_state.used_depth_texture); + size = rb->get_internal_size(); + backbuffer_fbo = rb->get_backbuffer_fbo(); + backbuffer = rb->get_backbuffer(); + backbuffer_depth = rb->get_backbuffer_depth(); + } + + if (backbuffer_fbo != 0) { + glBindFramebuffer(GL_READ_FRAMEBUFFER, fbo); + glReadBuffer(GL_COLOR_ATTACHMENT0); + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, backbuffer_fbo); + if (scene_state.used_screen_texture) { + glBlitFramebuffer(0, 0, size.x, size.y, + 0, 0, size.x, size.y, + GL_COLOR_BUFFER_BIT, GL_NEAREST); + glActiveTexture(GL_TEXTURE0 + config->max_texture_image_units - 5); + glBindTexture(GL_TEXTURE_2D, backbuffer); + } + if (scene_state.used_depth_texture) { + glBlitFramebuffer(0, 0, size.x, size.y, + 0, 0, size.x, size.y, + GL_DEPTH_BUFFER_BIT, GL_NEAREST); + glActiveTexture(GL_TEXTURE0 + config->max_texture_image_units - 6); + glBindTexture(GL_TEXTURE_2D, backbuffer_depth); + } + } + + // Bound framebuffer may have changed, so change it back + glBindFramebuffer(GL_FRAMEBUFFER, fbo); } RENDER_TIMESTAMP("Render 3D Transparent Pass"); @@ -2498,14 +2557,110 @@ void RasterizerSceneGLES3::render_scene(const Ref<RenderSceneBuffers> &p_render_ } if (rb.is_valid()) { - _render_buffers_debug_draw(rb, p_shadow_atlas); + _render_buffers_debug_draw(rb, p_shadow_atlas, fbo); } glDisable(GL_BLEND); + + _render_post_processing(&render_data); + texture_storage->render_target_disable_clear_request(rb->render_target); glActiveTexture(GL_TEXTURE0); } +void RasterizerSceneGLES3::_render_post_processing(const RenderDataGLES3 *p_render_data) { + GLES3::TextureStorage *texture_storage = GLES3::TextureStorage::get_singleton(); + Ref<RenderSceneBuffersGLES3> rb = p_render_data->render_buffers; + ERR_FAIL_COND(rb.is_null()); + + RID render_target = rb->get_render_target(); + Size2i internal_size = rb->get_internal_size(); + Size2i target_size = rb->get_target_size(); + uint32_t view_count = rb->get_view_count(); + + // bool msaa2d_needs_resolve = texture_storage->render_target_get_msaa(render_target) != RS::VIEWPORT_MSAA_DISABLED && !GLES3::Config::get_singleton()->rt_msaa_supported; + bool msaa3d_needs_resolve = rb->get_msaa_needs_resolve(); + GLuint fbo_msaa_3d = rb->get_msaa3d_fbo(); + GLuint fbo_int = rb->get_internal_fbo(); + GLuint fbo_rt = texture_storage->render_target_get_fbo(render_target); // TODO if MSAA 2D is enabled and we're not using rt_msaa, get 2D render target here. + + if (view_count == 1) { + // Resolve if needed. + if (fbo_msaa_3d != 0 && msaa3d_needs_resolve) { + // We can use blit to copy things over + glBindFramebuffer(GL_READ_FRAMEBUFFER, fbo_msaa_3d); + + if (fbo_int != 0) { + // We can't combine resolve and scaling, so resolve into our internal buffer + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo_int); + } else { + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo_rt); + } + glBlitFramebuffer(0, 0, internal_size.x, internal_size.y, 0, 0, internal_size.x, internal_size.y, GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT, GL_NEAREST); + } + + if (fbo_int != 0) { + // TODO If we have glow or other post processing, we upscale only depth here, post processing will also do scaling. + glBindFramebuffer(GL_READ_FRAMEBUFFER, fbo_int); + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo_rt); + glBlitFramebuffer(0, 0, internal_size.x, internal_size.y, 0, 0, target_size.x, target_size.y, GL_COLOR_BUFFER_BIT, GL_LINEAR); + glBlitFramebuffer(0, 0, internal_size.x, internal_size.y, 0, 0, target_size.x, target_size.y, GL_DEPTH_BUFFER_BIT, GL_NEAREST); + } + + glBindFramebuffer(GL_FRAMEBUFFER, fbo_rt); + } else if ((fbo_msaa_3d != 0 && msaa3d_needs_resolve) || (fbo_int != 0)) { + // TODO investigate if it's smarter to cache these FBOs + GLuint fbos[2]; // read and write + glGenFramebuffers(2, fbos); + + glBindFramebuffer(GL_READ_FRAMEBUFFER, fbos[0]); + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbos[1]); + + if (fbo_msaa_3d != 0 && msaa3d_needs_resolve) { + GLuint read_color = rb->get_msaa3d_color(); + GLuint read_depth = rb->get_msaa3d_depth(); + GLuint write_color = 0; + GLuint write_depth = 0; + + if (fbo_int != 0) { + write_color = rb->get_internal_color(); + write_depth = rb->get_internal_depth(); + } else { + write_color = texture_storage->render_target_get_color(render_target); + write_depth = texture_storage->render_target_get_depth(render_target); + } + + for (uint32_t v = 0; v < view_count; v++) { + glFramebufferTextureLayer(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, read_color, 0, v); + glFramebufferTextureLayer(GL_READ_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, read_depth, 0, v); + glFramebufferTextureLayer(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, write_color, 0, v); + glFramebufferTextureLayer(GL_DRAW_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, write_depth, 0, v); + glBlitFramebuffer(0, 0, internal_size.x, internal_size.y, 0, 0, internal_size.x, internal_size.y, GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT, GL_NEAREST); + } + } + + if (fbo_int != 0) { + GLuint read_color = rb->get_internal_color(); + GLuint read_depth = rb->get_internal_depth(); + GLuint write_color = texture_storage->render_target_get_color(render_target); + GLuint write_depth = texture_storage->render_target_get_depth(render_target); + + for (uint32_t v = 0; v < view_count; v++) { + glFramebufferTextureLayer(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, read_color, 0, v); + glFramebufferTextureLayer(GL_READ_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, read_depth, 0, v); + glFramebufferTextureLayer(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, write_color, 0, v); + glFramebufferTextureLayer(GL_DRAW_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, write_depth, 0, v); + + glBlitFramebuffer(0, 0, internal_size.x, internal_size.y, 0, 0, target_size.x, target_size.y, GL_COLOR_BUFFER_BIT, GL_LINEAR); + glBlitFramebuffer(0, 0, internal_size.x, internal_size.y, 0, 0, target_size.x, target_size.y, GL_DEPTH_BUFFER_BIT, GL_NEAREST); + } + } + + glBindFramebuffer(GL_FRAMEBUFFER, fbo_rt); + glDeleteFramebuffers(2, fbos); + } +} + template <PassMode p_pass_mode> void RasterizerSceneGLES3::_render_list_template(RenderListParameters *p_params, const RenderDataGLES3 *p_render_data, uint32_t p_from_element, uint32_t p_to_element, bool p_alpha_pass) { GLES3::MeshStorage *mesh_storage = GLES3::MeshStorage::get_singleton(); @@ -2621,6 +2776,7 @@ void RasterizerSceneGLES3::_render_list_template(RenderListParameters *p_params, bool uses_additive_lighting = (inst->light_passes.size() + p_render_data->directional_shadow_count) > 0; uses_additive_lighting = uses_additive_lighting && !shader->unshaded; + // TODOS /* * Still a bug when atlas space is limited. Somehow need to evict light when it doesn't have a spot on the atlas, current check isn't enough @@ -2650,6 +2806,12 @@ void RasterizerSceneGLES3::_render_list_template(RenderListParameters *p_params, // Shadow wasn't able to get a spot on the atlas. So skip it. continue; } + } else if (pass > 0) { + uint32_t shadow_id = MAX_DIRECTIONAL_LIGHTS - 1 - (pass - int32_t(inst->light_passes.size())); + if (inst->lightmap_instance.is_valid() && scene_state.directional_lights[shadow_id].bake_mode == RenderingServer::LIGHT_BAKE_STATIC) { + // Skip shadows for static lights on meshes with a lightmap. + continue; + } } } @@ -2738,12 +2900,16 @@ void RasterizerSceneGLES3::_render_list_template(RenderListParameters *p_params, GLuint vertex_array_gl = 0; GLuint index_array_gl = 0; + uint64_t vertex_input_mask = shader->vertex_input_mask; + if (inst->lightmap_instance.is_valid()) { + vertex_input_mask |= 1 << RS::ARRAY_TEX_UV2; + } - //skeleton and blend shape + // Skeleton and blend shapes. if (surf->owner->mesh_instance.is_valid()) { - mesh_storage->mesh_instance_surface_get_vertex_arrays_and_format(surf->owner->mesh_instance, surf->surface_index, shader->vertex_input_mask, vertex_array_gl); + mesh_storage->mesh_instance_surface_get_vertex_arrays_and_format(surf->owner->mesh_instance, surf->surface_index, vertex_input_mask, vertex_array_gl); } else { - mesh_storage->mesh_surface_get_vertex_arrays_and_format(mesh_surface, shader->vertex_input_mask, vertex_array_gl); + mesh_storage->mesh_surface_get_vertex_arrays_and_format(mesh_surface, vertex_input_mask, vertex_array_gl); } index_array_gl = mesh_storage->mesh_surface_get_index_buffer(mesh_surface, surf->lod_index); @@ -2758,6 +2924,15 @@ void RasterizerSceneGLES3::_render_list_template(RenderListParameters *p_params, prev_index_array_gl = 0; } + bool use_wireframe = false; + if (p_params->force_wireframe) { + GLuint wireframe_index_array_gl = mesh_storage->mesh_surface_get_index_buffer_wireframe(mesh_surface); + if (wireframe_index_array_gl) { + index_array_gl = wireframe_index_array_gl; + use_wireframe = true; + } + } + bool use_index_buffer = index_array_gl != 0; if (prev_index_array_gl != index_array_gl) { if (index_array_gl != 0) { @@ -2803,12 +2978,28 @@ void RasterizerSceneGLES3::_render_list_template(RenderListParameters *p_params, if (p_render_data->directional_light_count == p_render_data->directional_shadow_count) { spec_constants |= SceneShaderGLES3::DISABLE_LIGHT_DIRECTIONAL; } + + if (inst->lightmap_instance.is_valid()) { + spec_constants |= SceneShaderGLES3::USE_LIGHTMAP; + + GLES3::LightmapInstance *li = GLES3::LightStorage::get_singleton()->get_lightmap_instance(inst->lightmap_instance); + GLES3::Lightmap *lm = GLES3::LightStorage::get_singleton()->get_lightmap(li->lightmap); + + if (lm->uses_spherical_harmonics) { + spec_constants |= SceneShaderGLES3::USE_SH_LIGHTMAP; + } + } else if (inst->lightmap_sh) { + spec_constants |= SceneShaderGLES3::USE_LIGHTMAP_CAPTURE; + } else { + spec_constants |= SceneShaderGLES3::DISABLE_LIGHTMAP; + } } else { // Only base pass uses the radiance map. spec_constants &= ~SceneShaderGLES3::USE_RADIANCE_MAP; spec_constants |= SceneShaderGLES3::DISABLE_LIGHT_OMNI; spec_constants |= SceneShaderGLES3::DISABLE_LIGHT_SPOT; spec_constants |= SceneShaderGLES3::DISABLE_LIGHT_DIRECTIONAL; + spec_constants |= SceneShaderGLES3::DISABLE_LIGHTMAP; } if (uses_additive_lighting) { @@ -2831,6 +3022,10 @@ void RasterizerSceneGLES3::_render_list_template(RenderListParameters *p_params, // Render directional lights. uint32_t shadow_id = MAX_DIRECTIONAL_LIGHTS - 1 - (pass - int32_t(inst->light_passes.size())); + if (pass == 0 && inst->lightmap_instance.is_valid() && scene_state.directional_lights[shadow_id].bake_mode == RenderingServer::LIGHT_BAKE_STATIC) { + // Disable additive lighting with a static light and a lightmap. + spec_constants &= ~SceneShaderGLES3::USE_ADDITIVE_LIGHTING; + } if (scene_state.directional_shadows[shadow_id].shadow_split_offsets[0] == scene_state.directional_shadows[shadow_id].shadow_split_offsets[1]) { // Orthogonal, do nothing. } else if (scene_state.directional_shadows[shadow_id].shadow_split_offsets[1] == scene_state.directional_shadows[shadow_id].shadow_split_offsets[2]) { @@ -2920,6 +3115,46 @@ void RasterizerSceneGLES3::_render_list_template(RenderListParameters *p_params, glUniform1uiv(material_storage->shaders.scene_shader.version_get_uniform(SceneShaderGLES3::SPOT_LIGHT_INDICES, shader->version, instance_variant, spec_constants), inst->spot_light_gl_cache.size(), inst->spot_light_gl_cache.ptr()); } + if (inst->lightmap_instance.is_valid()) { + GLES3::LightmapInstance *li = GLES3::LightStorage::get_singleton()->get_lightmap_instance(inst->lightmap_instance); + GLES3::Lightmap *lm = GLES3::LightStorage::get_singleton()->get_lightmap(li->lightmap); + + GLuint tex = GLES3::TextureStorage::get_singleton()->texture_get_texid(lm->light_texture); + glActiveTexture(GL_TEXTURE0 + config->max_texture_image_units - 4); + glBindTexture(GL_TEXTURE_2D_ARRAY, tex); + + material_storage->shaders.scene_shader.version_set_uniform(SceneShaderGLES3::LIGHTMAP_SLICE, inst->lightmap_slice_index, shader->version, instance_variant, spec_constants); + + Vector4 uv_scale(inst->lightmap_uv_scale.position.x, inst->lightmap_uv_scale.position.y, inst->lightmap_uv_scale.size.x, inst->lightmap_uv_scale.size.y); + material_storage->shaders.scene_shader.version_set_uniform(SceneShaderGLES3::LIGHTMAP_UV_SCALE, uv_scale, shader->version, instance_variant, spec_constants); + + float exposure_normalization = 1.0; + if (p_render_data->camera_attributes.is_valid()) { + float enf = RSG::camera_attributes->camera_attributes_get_exposure_normalization_factor(p_render_data->camera_attributes); + exposure_normalization = enf / lm->baked_exposure; + } + material_storage->shaders.scene_shader.version_set_uniform(SceneShaderGLES3::LIGHTMAP_EXPOSURE_NORMALIZATION, exposure_normalization, shader->version, instance_variant, spec_constants); + + if (lm->uses_spherical_harmonics) { + Basis to_lm = li->transform.basis.inverse() * p_render_data->cam_transform.basis; + to_lm = to_lm.inverse().transposed(); + GLfloat matrix[9] = { + (GLfloat)to_lm.rows[0][0], + (GLfloat)to_lm.rows[1][0], + (GLfloat)to_lm.rows[2][0], + (GLfloat)to_lm.rows[0][1], + (GLfloat)to_lm.rows[1][1], + (GLfloat)to_lm.rows[2][1], + (GLfloat)to_lm.rows[0][2], + (GLfloat)to_lm.rows[1][2], + (GLfloat)to_lm.rows[2][2], + }; + glUniformMatrix3fv(material_storage->shaders.scene_shader.version_get_uniform(SceneShaderGLES3::LIGHTMAP_NORMAL_XFORM, shader->version, instance_variant, spec_constants), 1, GL_FALSE, matrix); + } + } else if (inst->lightmap_sh) { + glUniform4fv(material_storage->shaders.scene_shader.version_get_uniform(SceneShaderGLES3::LIGHTMAP_CAPTURES, shader->version, instance_variant, spec_constants), 9, reinterpret_cast<const GLfloat *>(inst->lightmap_sh->sh)); + } + prev_inst = inst; } } @@ -2938,6 +3173,8 @@ void RasterizerSceneGLES3::_render_list_template(RenderListParameters *p_params, } } + material_storage->shaders.scene_shader.version_set_uniform(SceneShaderGLES3::MODEL_FLAGS, inst->flags_cache, shader->version, instance_variant, spec_constants); + // Can be index count or vertex count uint32_t count = 0; if (surf->lod_index > 0) { @@ -2946,6 +3183,11 @@ void RasterizerSceneGLES3::_render_list_template(RenderListParameters *p_params, count = mesh_storage->mesh_surface_get_vertices_drawn_count(mesh_surface); } + if (use_wireframe) { + // In this case we are using index count, and we need double the indices for the wireframe mesh. + count = count * 2; + } + if constexpr (p_pass_mode != PASS_MODE_DEPTH) { // Don't count draw calls during depth pre-pass to match the RD renderers. if (p_render_data->render_info) { @@ -3000,17 +3242,25 @@ void RasterizerSceneGLES3::_render_list_template(RenderListParameters *p_params, glVertexAttribI4ui(15, default_color, default_color, default_custom, default_custom); } - if (use_index_buffer) { - glDrawElementsInstanced(primitive_gl, count, mesh_storage->mesh_surface_get_index_type(mesh_surface), 0, inst->instance_count); + if (use_wireframe) { + glDrawElementsInstanced(GL_LINES, count, GL_UNSIGNED_INT, 0, inst->instance_count); } else { - glDrawArraysInstanced(primitive_gl, 0, count, inst->instance_count); + if (use_index_buffer) { + glDrawElementsInstanced(primitive_gl, count, mesh_storage->mesh_surface_get_index_type(mesh_surface), 0, inst->instance_count); + } else { + glDrawArraysInstanced(primitive_gl, 0, count, inst->instance_count); + } } } else { // Using regular Mesh. - if (use_index_buffer) { - glDrawElements(primitive_gl, count, mesh_storage->mesh_surface_get_index_type(mesh_surface), 0); + if (use_wireframe) { + glDrawElements(GL_LINES, count, GL_UNSIGNED_INT, 0); } else { - glDrawArrays(primitive_gl, 0, count); + if (use_index_buffer) { + glDrawElements(primitive_gl, count, mesh_storage->mesh_surface_get_index_type(mesh_surface), 0); + } else { + glDrawArrays(primitive_gl, 0, count); + } } } @@ -3123,7 +3373,7 @@ Ref<RenderSceneBuffers> RasterizerSceneGLES3::render_buffers_create() { return rb; } -void RasterizerSceneGLES3::_render_buffers_debug_draw(Ref<RenderSceneBuffersGLES3> p_render_buffers, RID p_shadow_atlas) { +void RasterizerSceneGLES3::_render_buffers_debug_draw(Ref<RenderSceneBuffersGLES3> p_render_buffers, RID p_shadow_atlas, GLuint p_fbo) { GLES3::TextureStorage *texture_storage = GLES3::TextureStorage::get_singleton(); GLES3::LightStorage *light_storage = GLES3::LightStorage::get_singleton(); GLES3::CopyEffects *copy_effects = GLES3::CopyEffects::get_singleton(); @@ -3200,8 +3450,11 @@ void RasterizerSceneGLES3::_render_buffers_debug_draw(Ref<RenderSceneBuffersGLES } } } - glBindFramebuffer(GL_FRAMEBUFFER, rt->fbo); - glViewport(0, 0, rt->size.width, rt->size.height); + + // Set back to FBO + glBindFramebuffer(GL_FRAMEBUFFER, p_fbo); + Size2i size = p_render_buffers->get_internal_size(); + glViewport(0, 0, size.width, size.height); glBindTexture(GL_TEXTURE_2D, shadow_atlas_texture); copy_effects->copy_to_rect(Rect2(Vector2(), Vector2(0.5, 0.5))); diff --git a/drivers/gles3/rasterizer_scene_gles3.h b/drivers/gles3/rasterizer_scene_gles3.h index 7d3c8896da..a860793c21 100644 --- a/drivers/gles3/rasterizer_scene_gles3.h +++ b/drivers/gles3/rasterizer_scene_gles3.h @@ -170,6 +170,9 @@ private: float cos_spot_angle; float specular_amount; float shadow_opacity; + + float pad[3]; + uint32_t bake_mode; }; static_assert(sizeof(LightData) % 16 == 0, "LightData size must be a multiple of 16 bytes"); @@ -181,7 +184,7 @@ private: float size; uint32_t enabled; // For use by SkyShaders - float pad; + uint32_t bake_mode; float shadow_opacity; float specular; }; @@ -269,6 +272,10 @@ private: GeometryInstanceGLES3 *owner = nullptr; }; + struct GeometryInstanceLightmapSH { + Color sh[9]; + }; + class GeometryInstanceGLES3 : public RenderGeometryInstanceBase { public: //used during rendering @@ -296,6 +303,11 @@ private: LocalVector<uint32_t> omni_light_gl_cache; LocalVector<uint32_t> spot_light_gl_cache; + RID lightmap_instance; + Rect2 lightmap_uv_scale; + uint32_t lightmap_slice_index; + GeometryInstanceLightmapSH *lightmap_sh = nullptr; + // Used during setup. GeometryInstanceSurface *surface_caches = nullptr; SelfList<GeometryInstanceGLES3> dirty_list_element; @@ -518,6 +530,7 @@ private: void _fill_render_list(RenderListType p_render_list, const RenderDataGLES3 *p_render_data, PassMode p_pass_mode, bool p_append = false); void _render_shadows(const RenderDataGLES3 *p_render_data, const Size2i &p_viewport_size = Size2i(1, 1)); void _render_shadow_pass(RID p_light, RID p_shadow_atlas, int p_pass, const PagedArray<RenderGeometryInstance *> &p_instances, const Plane &p_camera_plane = Plane(), float p_lod_distance_multiplier = 0, float p_screen_mesh_lod_threshold = 0.0, RenderingMethod::RenderInfo *p_render_info = nullptr, const Size2i &p_viewport_size = Size2i(1, 1)); + void _render_post_processing(const RenderDataGLES3 *p_render_data); template <PassMode p_pass_mode> _FORCE_INLINE_ void _render_list_template(RenderListParameters *p_params, const RenderDataGLES3 *p_render_data, uint32_t p_from_element, uint32_t p_to_element, bool p_alpha_pass = false); @@ -530,7 +543,7 @@ protected: float screen_space_roughness_limiter_amount = 0.25; float screen_space_roughness_limiter_limit = 0.18; - void _render_buffers_debug_draw(Ref<RenderSceneBuffersGLES3> p_render_buffers, RID p_shadow_atlas); + void _render_buffers_debug_draw(Ref<RenderSceneBuffersGLES3> p_render_buffers, RID p_shadow_atlas, GLuint p_fbo); /* Camera Attributes */ diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl index e0f8e83373..1d9ba623c4 100644 --- a/drivers/gles3/shaders/scene.glsl +++ b/drivers/gles3/shaders/scene.glsl @@ -1,7 +1,7 @@ /* clang-format off */ #[modes] -mode_color = +mode_color = mode_color_instancing = \n#define USE_INSTANCING mode_depth = #define MODE_RENDER_DEPTH mode_depth_instancing = #define MODE_RENDER_DEPTH \n#define USE_INSTANCING @@ -14,6 +14,9 @@ DISABLE_LIGHT_OMNI = false DISABLE_LIGHT_SPOT = false DISABLE_FOG = false USE_RADIANCE_MAP = true +USE_LIGHTMAP = false +USE_SH_LIGHTMAP = false +USE_LIGHTMAP_CAPTURE = false USE_MULTIVIEW = false RENDER_SHADOWS = false RENDER_SHADOWS_LINEAR = false @@ -139,6 +142,8 @@ layout(location = 14) in highp vec4 instance_xform2; layout(location = 15) in highp uvec4 instance_color_custom_data; // Color packed into xy, Custom data into zw. #endif +#define FLAGS_NON_UNIFORM_SCALE (1 << 4) + layout(std140) uniform GlobalShaderUniformData { //ubo:1 vec4 global_shader_uniforms[MAX_GLOBAL_SHADER_UNIFORMS]; }; @@ -242,6 +247,8 @@ uniform highp vec3 compressed_aabb_position; uniform highp vec3 compressed_aabb_size; uniform highp vec4 uv_scale; +uniform highp uint model_flags; + /* Varyings */ out highp vec3 vertex_interp; @@ -310,7 +317,14 @@ void main() { #ifdef NORMAL_USED vec3 normal = oct_to_vec3(axis_tangent_attrib.xy * 2.0 - 1.0); #endif - highp mat3 model_normal_matrix = mat3(model_matrix); + + highp mat3 model_normal_matrix; + + if (bool(model_flags & uint(FLAGS_NON_UNIFORM_SCALE))) { + model_normal_matrix = transpose(inverse(mat3(model_matrix))); + } else { + model_normal_matrix = mat3(model_matrix); + } #if defined(NORMAL_USED) || defined(TANGENT_USED) || defined(NORMAL_MAP_USED) || defined(LIGHT_ANISOTROPY_USED) @@ -665,6 +679,10 @@ multiview_data; /* clang-format on */ +#define LIGHT_BAKE_DISABLED 0u +#define LIGHT_BAKE_STATIC 1u +#define LIGHT_BAKE_DYNAMIC 2u + #ifndef MODE_RENDER_DEPTH // Directional light data. #if !defined(DISABLE_LIGHT_DIRECTIONAL) || (!defined(ADDITIVE_OMNI) && !defined(ADDITIVE_SPOT)) @@ -674,7 +692,8 @@ struct DirectionalLightData { mediump float energy; mediump vec3 color; mediump float size; - mediump vec2 pad; + lowp uint unused; + lowp uint bake_mode; mediump float shadow_opacity; mediump float specular; }; @@ -707,6 +726,9 @@ struct LightData { // This structure needs to be as packed as possible. mediump float cone_angle; mediump float specular_amount; mediump float shadow_opacity; + + lowp vec3 pad; + lowp uint bake_mode; }; #if !defined(DISABLE_LIGHT_OMNI) || defined(ADDITIVE_OMNI) @@ -823,6 +845,23 @@ float sample_shadow(highp sampler2DShadow shadow, float shadow_pixel_size, vec4 #endif // !MODE_RENDER_DEPTH +#ifndef DISABLE_LIGHTMAP +#ifdef USE_LIGHTMAP +uniform mediump sampler2DArray lightmap_textures; //texunit:-4 +uniform lowp uint lightmap_slice; +uniform highp vec4 lightmap_uv_scale; +uniform float lightmap_exposure_normalization; + +#ifdef USE_SH_LIGHTMAP +uniform mediump mat3 lightmap_normal_xform; +#endif // USE_SH_LIGHTMAP +#endif // USE_LIGHTMAP + +#ifdef USE_LIGHTMAP_CAPTURE +uniform mediump vec4[9] lightmap_captures; +#endif // USE_LIGHTMAP_CAPTURE +#endif // !DISABLE_LIGHTMAP + #ifdef USE_MULTIVIEW uniform highp sampler2DArray depth_buffer; // texunit:-6 uniform highp sampler2DArray color_buffer; // texunit:-5 @@ -1395,7 +1434,6 @@ void main() { #endif // Calculate Reflection probes - // Calculate Lightmaps #if defined(CUSTOM_RADIANCE_USED) specular_light = mix(specular_light, custom_radiance.rgb, custom_radiance.a); @@ -1420,6 +1458,61 @@ void main() { ambient_light = mix(ambient_light, custom_irradiance.rgb, custom_irradiance.a); #endif // CUSTOM_IRRADIANCE_USED +#ifndef DISABLE_LIGHTMAP +#ifdef USE_LIGHTMAP_CAPTURE + { + vec3 wnormal = mat3(scene_data.inv_view_matrix) * normal; + const float c1 = 0.429043; + const float c2 = 0.511664; + const float c3 = 0.743125; + const float c4 = 0.886227; + const float c5 = 0.247708; + ambient_light += (c1 * lightmap_captures[8].rgb * (wnormal.x * wnormal.x - wnormal.y * wnormal.y) + + c3 * lightmap_captures[6].rgb * wnormal.z * wnormal.z + + c4 * lightmap_captures[0].rgb - + c5 * lightmap_captures[6].rgb + + 2.0 * c1 * lightmap_captures[4].rgb * wnormal.x * wnormal.y + + 2.0 * c1 * lightmap_captures[7].rgb * wnormal.x * wnormal.z + + 2.0 * c1 * lightmap_captures[5].rgb * wnormal.y * wnormal.z + + 2.0 * c2 * lightmap_captures[3].rgb * wnormal.x + + 2.0 * c2 * lightmap_captures[1].rgb * wnormal.y + + 2.0 * c2 * lightmap_captures[2].rgb * wnormal.z) * + scene_data.emissive_exposure_normalization; + } +#else +#ifdef USE_LIGHTMAP + { + vec3 uvw; + uvw.xy = uv2 * lightmap_uv_scale.zw + lightmap_uv_scale.xy; + uvw.z = float(lightmap_slice); + +#ifdef USE_SH_LIGHTMAP + uvw.z *= 4.0; // SH textures use 4 times more data. + vec3 lm_light_l0 = textureLod(lightmap_textures, uvw + vec3(0.0, 0.0, 0.0), 0.0).rgb; + vec3 lm_light_l1n1 = textureLod(lightmap_textures, uvw + vec3(0.0, 0.0, 1.0), 0.0).rgb; + vec3 lm_light_l1_0 = textureLod(lightmap_textures, uvw + vec3(0.0, 0.0, 2.0), 0.0).rgb; + vec3 lm_light_l1p1 = textureLod(lightmap_textures, uvw + vec3(0.0, 0.0, 3.0), 0.0).rgb; + + vec3 n = normalize(lightmap_normal_xform * normal); + + ambient_light += lm_light_l0 * 0.282095f; + ambient_light += lm_light_l1n1 * 0.32573 * n.y * lightmap_exposure_normalization; + ambient_light += lm_light_l1_0 * 0.32573 * n.z * lightmap_exposure_normalization; + ambient_light += lm_light_l1p1 * 0.32573 * n.x * lightmap_exposure_normalization; + if (metallic > 0.01) { // Since the more direct bounced light is lost, we can kind of fake it with this trick. + vec3 r = reflect(normalize(-vertex), normal); + specular_light += lm_light_l1n1 * 0.32573 * r.y * lightmap_exposure_normalization; + specular_light += lm_light_l1_0 * 0.32573 * r.z * lightmap_exposure_normalization; + specular_light += lm_light_l1p1 * 0.32573 * r.x * lightmap_exposure_normalization; + } +#else + ambient_light += textureLod(lightmap_textures, uvw, 0.0).rgb * lightmap_exposure_normalization; +#endif + } +#endif // USE_LIGHTMAP +#endif // USE_LIGHTMAP_CAPTURE +#endif // !DISABLE_LIGHTMAP + { #if defined(AMBIENT_LIGHT_DISABLED) ambient_light = vec3(0.0, 0.0, 0.0); @@ -1455,6 +1548,11 @@ void main() { #ifndef DISABLE_LIGHT_DIRECTIONAL for (uint i = uint(0); i < scene_data.directional_light_count; i++) { +#if defined(USE_LIGHTMAP) && !defined(DISABLE_LIGHTMAP) + if (directional_lights[i].bake_mode == LIGHT_BAKE_STATIC) { + continue; + } +#endif light_compute(normal, normalize(directional_lights[i].direction), normalize(view), directional_lights[i].size, directional_lights[i].color * directional_lights[i].energy, true, 1.0, f0, roughness, metallic, 1.0, albedo, alpha, #ifdef LIGHT_BACKLIGHT_USED backlight, @@ -1479,6 +1577,11 @@ void main() { if (i >= omni_light_count) { break; } +#if defined(USE_LIGHTMAP) && !defined(DISABLE_LIGHTMAP) + if (omni_lights[omni_light_indices[i]].bake_mode == LIGHT_BAKE_STATIC) { + continue; + } +#endif light_process_omni(omni_light_indices[i], vertex, view, normal, f0, roughness, metallic, 1.0, albedo, alpha, #ifdef LIGHT_BACKLIGHT_USED backlight, @@ -1502,6 +1605,11 @@ void main() { if (i >= spot_light_count) { break; } +#if defined(USE_LIGHTMAP) && !defined(DISABLE_LIGHTMAP) + if (spot_lights[spot_light_indices[i]].bake_mode == LIGHT_BAKE_STATIC) { + continue; + } +#endif light_process_spot(spot_light_indices[i], vertex, view, normal, f0, roughness, metallic, 1.0, albedo, alpha, #ifdef LIGHT_BACKLIGHT_USED backlight, @@ -1600,6 +1708,8 @@ void main() { #if !defined(ADDITIVE_OMNI) && !defined(ADDITIVE_SPOT) +#ifndef SHADOWS_DISABLED + // Orthogonal shadows #if !defined(LIGHT_USE_PSSM2) && !defined(LIGHT_USE_PSSM4) float directional_shadow = sample_shadow(directional_shadow_atlas, directional_shadows[directional_shadow_index].shadow_atlas_pixel_size, shadow_coord); @@ -1706,6 +1816,9 @@ void main() { directional_shadow = mix(directional_shadow, 1.0, smoothstep(directional_shadows[directional_shadow_index].fade_from, directional_shadows[directional_shadow_index].fade_to, vertex.z)); directional_shadow = mix(1.0, directional_shadow, directional_lights[directional_shadow_index].shadow_opacity); +#else + float directional_shadow = 1.0f; +#endif // SHADOWS_DISABLED light_compute(normal, normalize(directional_lights[directional_shadow_index].direction), normalize(view), directional_lights[directional_shadow_index].size, directional_lights[directional_shadow_index].color * directional_lights[directional_shadow_index].energy, true, directional_shadow, f0, roughness, metallic, 1.0, albedo, alpha, #ifdef LIGHT_BACKLIGHT_USED backlight, @@ -1725,11 +1838,12 @@ void main() { #endif // !defined(ADDITIVE_OMNI) && !defined(ADDITIVE_SPOT) #ifdef ADDITIVE_OMNI + float omni_shadow = 1.0f; +#ifndef SHADOWS_DISABLED vec3 light_ray = ((positional_shadows[positional_shadow_index].shadow_matrix * vec4(shadow_coord.xyz, 1.0))).xyz; - - float omni_shadow = texture(omni_shadow_texture, vec4(light_ray, length(light_ray) * omni_lights[omni_light_index].inv_radius)); + omni_shadow = texture(omni_shadow_texture, vec4(light_ray, length(light_ray) * omni_lights[omni_light_index].inv_radius)); omni_shadow = mix(1.0, omni_shadow, omni_lights[omni_light_index].shadow_opacity); - +#endif // SHADOWS_DISABLED light_process_omni(omni_light_index, vertex, view, normal, f0, roughness, metallic, omni_shadow, albedo, alpha, #ifdef LIGHT_BACKLIGHT_USED backlight, @@ -1748,9 +1862,11 @@ void main() { #endif // ADDITIVE_OMNI #ifdef ADDITIVE_SPOT - float spot_shadow = sample_shadow(spot_shadow_texture, positional_shadows[positional_shadow_index].shadow_atlas_pixel_size, shadow_coord); + float spot_shadow = 1.0f; +#ifndef SHADOWS_DISABLED + spot_shadow = sample_shadow(spot_shadow_texture, positional_shadows[positional_shadow_index].shadow_atlas_pixel_size, shadow_coord); spot_shadow = mix(1.0, spot_shadow, spot_lights[spot_light_index].shadow_opacity); - +#endif // SHADOWS_DISABLED light_process_spot(spot_light_index, vertex, view, normal, f0, roughness, metallic, spot_shadow, albedo, alpha, #ifdef LIGHT_BACKLIGHT_USED backlight, diff --git a/drivers/gles3/storage/config.cpp b/drivers/gles3/storage/config.cpp index 4bf6165fe9..5d01ab0346 100644 --- a/drivers/gles3/storage/config.cpp +++ b/drivers/gles3/storage/config.cpp @@ -92,14 +92,55 @@ Config::Config() { anisotropic_level = MIN(float(1 << int(GLOBAL_GET("rendering/textures/default_filters/anisotropic_filtering_level"))), anisotropic_level); } - multiview_supported = extensions.has("GL_OVR_multiview2") || extensions.has("GL_OVR_multiview"); + glGetIntegerv(GL_MAX_SAMPLES, &msaa_max_samples); +#ifdef WEB_ENABLED + msaa_supported = (msaa_max_samples > 0); +#else + msaa_supported = extensions.has("GL_EXT_framebuffer_multisample"); +#endif +#ifndef IOS_ENABLED +#ifdef WEB_ENABLED + msaa_multiview_supported = extensions.has("OCULUS_multiview"); + rt_msaa_multiview_supported = msaa_multiview_supported; +#else + msaa_multiview_supported = extensions.has("GL_EXT_multiview_texture_multisample"); +#endif + + multiview_supported = extensions.has("OCULUS_multiview") || extensions.has("GL_OVR_multiview2") || extensions.has("GL_OVR_multiview"); +#endif + #ifdef ANDROID_ENABLED + // These are GLES only + rt_msaa_supported = extensions.has("GL_EXT_multisampled_render_to_texture"); + rt_msaa_multiview_supported = extensions.has("GL_OVR_multiview_multisampled_render_to_texture"); + if (multiview_supported) { eglFramebufferTextureMultiviewOVR = (PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC)eglGetProcAddress("glFramebufferTextureMultiviewOVR"); if (eglFramebufferTextureMultiviewOVR == nullptr) { multiview_supported = false; } } + + if (msaa_multiview_supported) { + eglTexStorage3DMultisample = (PFNGLTEXSTORAGE3DMULTISAMPLEPROC)eglGetProcAddress("glTexStorage3DMultisample"); + if (eglTexStorage3DMultisample == nullptr) { + msaa_multiview_supported = false; + } + } + + if (rt_msaa_supported) { + eglFramebufferTexture2DMultisampleEXT = (PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC)eglGetProcAddress("glFramebufferTexture2DMultisampleEXT"); + if (eglFramebufferTexture2DMultisampleEXT == nullptr) { + rt_msaa_supported = false; + } + } + + if (rt_msaa_multiview_supported) { + eglFramebufferTextureMultisampleMultiviewOVR = (PFNGLFRAMEBUFFERTEXTUREMULTISAMPLEMULTIVIEWOVRPROC)eglGetProcAddress("glFramebufferTextureMultisampleMultiviewOVR"); + if (eglFramebufferTextureMultisampleMultiviewOVR == nullptr) { + rt_msaa_multiview_supported = false; + } + } #endif force_vertex_shading = false; //GLOBAL_GET("rendering/quality/shading/force_vertex_shading"); diff --git a/drivers/gles3/storage/config.h b/drivers/gles3/storage/config.h index b2dd98f025..1c0a5178bd 100644 --- a/drivers/gles3/storage/config.h +++ b/drivers/gles3/storage/config.h @@ -42,6 +42,9 @@ #ifdef ANDROID_ENABLED typedef void (*PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC)(GLenum, GLenum, GLuint, GLint, GLint, GLsizei); +typedef void (*PFNGLTEXSTORAGE3DMULTISAMPLEPROC)(GLenum, GLsizei, GLenum, GLsizei, GLsizei, GLsizei, GLboolean); +typedef void (*PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC)(GLenum, GLenum, GLenum, GLuint, GLint, GLsizei); +typedef void (*PFNGLFRAMEBUFFERTEXTUREMULTISAMPLEMULTIVIEWOVRPROC)(GLenum, GLenum, GLuint, GLint, GLsizei, GLint, GLsizei); #endif namespace GLES3 { @@ -63,8 +66,7 @@ public: int64_t max_renderable_lights = 0; int64_t max_lights_per_object = 0; - // TODO implement wireframe in OpenGL - // bool generate_wireframes; + bool generate_wireframes = false; HashSet<String> extensions; @@ -82,9 +84,18 @@ public: bool support_anisotropic_filter = false; float anisotropic_level = 0.0f; + GLint msaa_max_samples = 0; + bool msaa_supported = false; + bool msaa_multiview_supported = false; + bool rt_msaa_supported = false; + bool rt_msaa_multiview_supported = false; bool multiview_supported = false; + #ifdef ANDROID_ENABLED PFNGLFRAMEBUFFERTEXTUREMULTIVIEWOVRPROC eglFramebufferTextureMultiviewOVR = nullptr; + PFNGLTEXSTORAGE3DMULTISAMPLEPROC eglTexStorage3DMultisample = nullptr; + PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC eglFramebufferTexture2DMultisampleEXT = nullptr; + PFNGLFRAMEBUFFERTEXTUREMULTISAMPLEMULTIVIEWOVRPROC eglFramebufferTextureMultisampleMultiviewOVR = nullptr; #endif static Config *get_singleton() { return singleton; }; diff --git a/drivers/gles3/storage/light_storage.cpp b/drivers/gles3/storage/light_storage.cpp index 6d4d23bd10..2607a133d6 100644 --- a/drivers/gles3/storage/light_storage.cpp +++ b/drivers/gles3/storage/light_storage.cpp @@ -569,69 +569,171 @@ void LightStorage::lightmap_initialize(RID p_rid) { void LightStorage::lightmap_free(RID p_rid) { Lightmap *lightmap = lightmap_owner.get_or_null(p_rid); + ERR_FAIL_NULL(lightmap); lightmap->dependency.deleted_notify(p_rid); lightmap_owner.free(p_rid); } void LightStorage::lightmap_set_textures(RID p_lightmap, RID p_light, bool p_uses_spherical_haromics) { + Lightmap *lightmap = lightmap_owner.get_or_null(p_lightmap); + ERR_FAIL_NULL(lightmap); + lightmap->light_texture = p_light; + lightmap->uses_spherical_harmonics = p_uses_spherical_haromics; + + GLuint tex = GLES3::TextureStorage::get_singleton()->texture_get_texid(lightmap->light_texture); + glBindTexture(GL_TEXTURE_2D_ARRAY, tex); + glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glBindTexture(GL_TEXTURE_2D_ARRAY, 0); } void LightStorage::lightmap_set_probe_bounds(RID p_lightmap, const AABB &p_bounds) { + Lightmap *lightmap = lightmap_owner.get_or_null(p_lightmap); + ERR_FAIL_NULL(lightmap); + lightmap->bounds = p_bounds; } void LightStorage::lightmap_set_probe_interior(RID p_lightmap, bool p_interior) { + Lightmap *lightmap = lightmap_owner.get_or_null(p_lightmap); + ERR_FAIL_NULL(lightmap); + lightmap->interior = p_interior; } void LightStorage::lightmap_set_probe_capture_data(RID p_lightmap, const PackedVector3Array &p_points, const PackedColorArray &p_point_sh, const PackedInt32Array &p_tetrahedra, const PackedInt32Array &p_bsp_tree) { + Lightmap *lightmap = lightmap_owner.get_or_null(p_lightmap); + ERR_FAIL_NULL(lightmap); + + if (p_points.size()) { + ERR_FAIL_COND(p_points.size() * 9 != p_point_sh.size()); + ERR_FAIL_COND((p_tetrahedra.size() % 4) != 0); + ERR_FAIL_COND((p_bsp_tree.size() % 6) != 0); + } + + lightmap->points = p_points; + lightmap->point_sh = p_point_sh; + lightmap->tetrahedra = p_tetrahedra; + lightmap->bsp_tree = p_bsp_tree; } void LightStorage::lightmap_set_baked_exposure_normalization(RID p_lightmap, float p_exposure) { + Lightmap *lightmap = lightmap_owner.get_or_null(p_lightmap); + ERR_FAIL_NULL(lightmap); + + lightmap->baked_exposure = p_exposure; } PackedVector3Array LightStorage::lightmap_get_probe_capture_points(RID p_lightmap) const { - return PackedVector3Array(); + Lightmap *lightmap = lightmap_owner.get_or_null(p_lightmap); + ERR_FAIL_NULL_V(lightmap, PackedVector3Array()); + return lightmap->points; } PackedColorArray LightStorage::lightmap_get_probe_capture_sh(RID p_lightmap) const { - return PackedColorArray(); + Lightmap *lightmap = lightmap_owner.get_or_null(p_lightmap); + ERR_FAIL_NULL_V(lightmap, PackedColorArray()); + return lightmap->point_sh; } PackedInt32Array LightStorage::lightmap_get_probe_capture_tetrahedra(RID p_lightmap) const { - return PackedInt32Array(); + Lightmap *lightmap = lightmap_owner.get_or_null(p_lightmap); + ERR_FAIL_NULL_V(lightmap, PackedInt32Array()); + return lightmap->tetrahedra; } PackedInt32Array LightStorage::lightmap_get_probe_capture_bsp_tree(RID p_lightmap) const { - return PackedInt32Array(); + Lightmap *lightmap = lightmap_owner.get_or_null(p_lightmap); + ERR_FAIL_NULL_V(lightmap, PackedInt32Array()); + return lightmap->bsp_tree; } AABB LightStorage::lightmap_get_aabb(RID p_lightmap) const { - return AABB(); + Lightmap *lightmap = lightmap_owner.get_or_null(p_lightmap); + ERR_FAIL_NULL_V(lightmap, AABB()); + return lightmap->bounds; } void LightStorage::lightmap_tap_sh_light(RID p_lightmap, const Vector3 &p_point, Color *r_sh) { + Lightmap *lm = lightmap_owner.get_or_null(p_lightmap); + ERR_FAIL_NULL(lm); + + for (int i = 0; i < 9; i++) { + r_sh[i] = Color(0, 0, 0, 0); + } + + if (!lm->points.size() || !lm->bsp_tree.size() || !lm->tetrahedra.size()) { + return; + } + + static_assert(sizeof(Lightmap::BSP) == 24); + + const Lightmap::BSP *bsp = (const Lightmap::BSP *)lm->bsp_tree.ptr(); + int32_t node = 0; + while (node >= 0) { + if (Plane(bsp[node].plane[0], bsp[node].plane[1], bsp[node].plane[2], bsp[node].plane[3]).is_point_over(p_point)) { +#ifdef DEBUG_ENABLED + ERR_FAIL_COND(bsp[node].over >= 0 && bsp[node].over < node); +#endif + + node = bsp[node].over; + } else { +#ifdef DEBUG_ENABLED + ERR_FAIL_COND(bsp[node].under >= 0 && bsp[node].under < node); +#endif + node = bsp[node].under; + } + } + + if (node == Lightmap::BSP::EMPTY_LEAF) { + return; // Nothing could be done. + } + + node = ABS(node) - 1; + + uint32_t *tetrahedron = (uint32_t *)&lm->tetrahedra[node * 4]; + Vector3 points[4] = { lm->points[tetrahedron[0]], lm->points[tetrahedron[1]], lm->points[tetrahedron[2]], lm->points[tetrahedron[3]] }; + const Color *sh_colors[4]{ &lm->point_sh[tetrahedron[0] * 9], &lm->point_sh[tetrahedron[1] * 9], &lm->point_sh[tetrahedron[2] * 9], &lm->point_sh[tetrahedron[3] * 9] }; + Color barycentric = Geometry3D::tetrahedron_get_barycentric_coords(points[0], points[1], points[2], points[3], p_point); + + for (int i = 0; i < 4; i++) { + float c = CLAMP(barycentric[i], 0.0, 1.0); + for (int j = 0; j < 9; j++) { + r_sh[j] += sh_colors[i][j] * c; + } + } } bool LightStorage::lightmap_is_interior(RID p_lightmap) const { - return false; + Lightmap *lightmap = lightmap_owner.get_or_null(p_lightmap); + ERR_FAIL_NULL_V(lightmap, false); + return lightmap->interior; } void LightStorage::lightmap_set_probe_capture_update_speed(float p_speed) { + lightmap_probe_capture_update_speed = p_speed; } float LightStorage::lightmap_get_probe_capture_update_speed() const { - return 0; + return lightmap_probe_capture_update_speed; } /* LIGHTMAP INSTANCE */ RID LightStorage::lightmap_instance_create(RID p_lightmap) { - return RID(); + LightmapInstance li; + li.lightmap = p_lightmap; + return lightmap_instance_owner.make_rid(li); } void LightStorage::lightmap_instance_free(RID p_lightmap) { + lightmap_instance_owner.free(p_lightmap); } void LightStorage::lightmap_instance_set_transform(RID p_lightmap, const Transform3D &p_transform) { + LightmapInstance *li = lightmap_instance_owner.get_or_null(p_lightmap); + ERR_FAIL_NULL(li); + li->transform = p_transform; } /* SHADOW ATLAS API */ @@ -1019,6 +1121,7 @@ void LightStorage::update_directional_shadow_atlas() { glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, directional_shadow.depth, 0); } + glUseProgram(0); glDepthMask(GL_TRUE); glBindFramebuffer(GL_FRAMEBUFFER, directional_shadow.fbo); RasterizerGLES3::clear_depth(1.0); diff --git a/drivers/gles3/storage/light_storage.h b/drivers/gles3/storage/light_storage.h index 2fb4dcaeca..7ab0286098 100644 --- a/drivers/gles3/storage/light_storage.h +++ b/drivers/gles3/storage/light_storage.h @@ -155,6 +155,11 @@ struct Lightmap { Dependency dependency; }; +struct LightmapInstance { + RID lightmap; + Transform3D transform; +}; + class LightStorage : public RendererLightStorage { public: enum ShadowAtlastQuadrant { @@ -179,9 +184,14 @@ private: /* LIGHTMAP */ Vector<RID> lightmap_textures; + float lightmap_probe_capture_update_speed = 4; mutable RID_Owner<Lightmap, true> lightmap_owner; + /* LIGHTMAP INSTANCE */ + + mutable RID_Owner<LightmapInstance> lightmap_instance_owner; + /* SHADOW ATLAS */ // Note: The ShadowAtlas in the OpenGL is virtual. Each light gets assigned its @@ -622,6 +632,9 @@ public: /* LIGHTMAP INSTANCE */ + LightmapInstance *get_lightmap_instance(RID p_rid) { return lightmap_instance_owner.get_or_null(p_rid); }; + bool owns_lightmap_instance(RID p_rid) { return lightmap_instance_owner.owns(p_rid); }; + virtual RID lightmap_instance_create(RID p_lightmap) override; virtual void lightmap_instance_free(RID p_lightmap) override; virtual void lightmap_instance_set_transform(RID p_lightmap, const Transform3D &p_transform) override; diff --git a/drivers/gles3/storage/material_storage.cpp b/drivers/gles3/storage/material_storage.cpp index b7a42141fd..13ab05c0a0 100644 --- a/drivers/gles3/storage/material_storage.cpp +++ b/drivers/gles3/storage/material_storage.cpp @@ -2968,17 +2968,17 @@ void SceneShaderData::set_code(const String &p_code) { depth_test = DepthTest(depth_testi); cull_mode = Cull(cull_modei); - vertex_input_mask = uint64_t(uses_normal); - vertex_input_mask |= uses_tangent << 1; - vertex_input_mask |= uses_color << 2; - vertex_input_mask |= uses_uv << 3; - vertex_input_mask |= uses_uv2 << 4; - vertex_input_mask |= uses_custom0 << 5; - vertex_input_mask |= uses_custom1 << 6; - vertex_input_mask |= uses_custom2 << 7; - vertex_input_mask |= uses_custom3 << 8; - vertex_input_mask |= uses_bones << 9; - vertex_input_mask |= uses_weights << 10; + vertex_input_mask = RS::ARRAY_FORMAT_VERTEX | RS::ARRAY_FORMAT_NORMAL; // We can always read vertices and normals. + vertex_input_mask |= uses_tangent << RS::ARRAY_TANGENT; + vertex_input_mask |= uses_color << RS::ARRAY_COLOR; + vertex_input_mask |= uses_uv << RS::ARRAY_TEX_UV; + vertex_input_mask |= uses_uv2 << RS::ARRAY_TEX_UV2; + vertex_input_mask |= uses_custom0 << RS::ARRAY_CUSTOM0; + vertex_input_mask |= uses_custom1 << RS::ARRAY_CUSTOM1; + vertex_input_mask |= uses_custom2 << RS::ARRAY_CUSTOM2; + vertex_input_mask |= uses_custom3 << RS::ARRAY_CUSTOM3; + vertex_input_mask |= uses_bones << RS::ARRAY_BONES; + vertex_input_mask |= uses_weights << RS::ARRAY_WEIGHTS; uses_screen_texture = gen_code.uses_screen_texture; uses_screen_texture_mipmaps = gen_code.uses_screen_texture_mipmaps; @@ -3000,10 +3000,6 @@ void SceneShaderData::set_code(const String &p_code) { WARN_PRINT_ONCE_ED("Transmittance is only available when using the Forward+ rendering backend."); } - if (uses_depth_texture) { - WARN_PRINT_ONCE_ED("Reading from the depth texture is not supported when using the GL Compatibility backend yet. Support will be added in a future release."); - } - if (uses_normal_texture) { WARN_PRINT_ONCE_ED("Reading from the normal-roughness texture is only available when using the Forward+ or Mobile rendering backends."); } diff --git a/drivers/gles3/storage/mesh_storage.cpp b/drivers/gles3/storage/mesh_storage.cpp index 88ee749ed6..e5080b39a3 100644 --- a/drivers/gles3/storage/mesh_storage.cpp +++ b/drivers/gles3/storage/mesh_storage.cpp @@ -31,6 +31,7 @@ #ifdef GLES3_ENABLED #include "mesh_storage.h" +#include "config.h" #include "material_storage.h" #include "utilities.h" @@ -285,8 +286,72 @@ void MeshStorage::mesh_add_surface(RID p_mesh, const RS::SurfaceData &p_surface) ERR_FAIL_COND_MSG(!new_surface.index_count && !new_surface.vertex_count, "Meshes must contain a vertex array, an index array, or both"); + if (GLES3::Config::get_singleton()->generate_wireframes && s->primitive == RS::PRIMITIVE_TRIANGLES) { + // Generate wireframes. This is mostly used by the editor. + s->wireframe = memnew(Mesh::Surface::Wireframe); + Vector<uint32_t> wf_indices; + uint32_t &wf_index_count = s->wireframe->index_count; + uint32_t *wr = nullptr; + + if (new_surface.format & RS::ARRAY_FORMAT_INDEX) { + wf_index_count = s->index_count * 2; + wf_indices.resize(wf_index_count); + + Vector<uint8_t> ir = new_surface.index_data; + wr = wf_indices.ptrw(); + + if (new_surface.vertex_count < (1 << 16)) { + // Read 16 bit indices. + const uint16_t *src_idx = (const uint16_t *)ir.ptr(); + for (uint32_t i = 0; i + 5 < wf_index_count; i += 6) { + // We use GL_LINES instead of GL_TRIANGLES for drawing these primitives later, + // so we need double the indices for each triangle. + wr[i + 0] = src_idx[i / 2]; + wr[i + 1] = src_idx[i / 2 + 1]; + wr[i + 2] = src_idx[i / 2 + 1]; + wr[i + 3] = src_idx[i / 2 + 2]; + wr[i + 4] = src_idx[i / 2 + 2]; + wr[i + 5] = src_idx[i / 2]; + } + + } else { + // Read 32 bit indices. + const uint32_t *src_idx = (const uint32_t *)ir.ptr(); + for (uint32_t i = 0; i + 5 < wf_index_count; i += 6) { + wr[i + 0] = src_idx[i / 2]; + wr[i + 1] = src_idx[i / 2 + 1]; + wr[i + 2] = src_idx[i / 2 + 1]; + wr[i + 3] = src_idx[i / 2 + 2]; + wr[i + 4] = src_idx[i / 2 + 2]; + wr[i + 5] = src_idx[i / 2]; + } + } + } else { + // Not using indices. + wf_index_count = s->vertex_count * 2; + wf_indices.resize(wf_index_count); + wr = wf_indices.ptrw(); + + for (uint32_t i = 0; i + 5 < wf_index_count; i += 6) { + wr[i + 0] = i / 2; + wr[i + 1] = i / 2 + 1; + wr[i + 2] = i / 2 + 1; + wr[i + 3] = i / 2 + 2; + wr[i + 4] = i / 2 + 2; + wr[i + 5] = i / 2; + } + } + + s->wireframe->index_buffer_size = wf_index_count * sizeof(uint32_t); + glGenBuffers(1, &s->wireframe->index_buffer); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, s->wireframe->index_buffer); + GLES3::Utilities::get_singleton()->buffer_allocate_data(GL_ELEMENT_ARRAY_BUFFER, s->wireframe->index_buffer, s->wireframe->index_buffer_size, wr, GL_STATIC_DRAW, "Mesh wireframe index buffer"); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); // unbind + } + s->aabb = new_surface.aabb; s->bone_aabbs = new_surface.bone_aabbs; //only really useful for returning them. + s->mesh_to_skeleton_xform = p_surface.mesh_to_skeleton_xform; s->uv_scale = new_surface.uv_scale; @@ -508,6 +573,7 @@ RS::SurfaceData MeshStorage::mesh_get_surface(RID p_mesh, int p_surface) const { } sd.bone_aabbs = s.bone_aabbs; + sd.mesh_to_skeleton_xform = s.mesh_to_skeleton_xform; if (mesh->blend_shape_count) { sd.blend_shape_data = Vector<uint8_t>(); @@ -561,15 +627,16 @@ AABB MeshStorage::mesh_get_aabb(RID p_mesh, RID p_skeleton) { for (uint32_t i = 0; i < mesh->surface_count; i++) { AABB laabb; - if ((mesh->surfaces[i]->format & RS::ARRAY_FORMAT_BONES) && mesh->surfaces[i]->bone_aabbs.size()) { - int bs = mesh->surfaces[i]->bone_aabbs.size(); - const AABB *skbones = mesh->surfaces[i]->bone_aabbs.ptr(); + const Mesh::Surface &surface = *mesh->surfaces[i]; + if ((surface.format & RS::ARRAY_FORMAT_BONES) && surface.bone_aabbs.size()) { + int bs = surface.bone_aabbs.size(); + const AABB *skbones = surface.bone_aabbs.ptr(); int sbs = skeleton->size; ERR_CONTINUE(bs > sbs); const float *baseptr = skeleton->data.ptr(); - bool first = true; + bool found_bone_aabb = false; if (skeleton->use_2d) { for (int j = 0; j < bs; j++) { @@ -589,11 +656,13 @@ AABB MeshStorage::mesh_get_aabb(RID p_mesh, RID p_skeleton) { mtx.basis.rows[1][1] = dataptr[5]; mtx.origin.y = dataptr[7]; - AABB baabb = mtx.xform(skbones[j]); + // Transform bounds to skeleton's space before applying animation data. + AABB baabb = surface.mesh_to_skeleton_xform.xform(skbones[j]); + baabb = mtx.xform(baabb); - if (first) { + if (!found_bone_aabb) { laabb = baabb; - first = false; + found_bone_aabb = true; } else { laabb.merge_with(baabb); } @@ -621,21 +690,29 @@ AABB MeshStorage::mesh_get_aabb(RID p_mesh, RID p_skeleton) { mtx.basis.rows[2][2] = dataptr[10]; mtx.origin.z = dataptr[11]; - AABB baabb = mtx.xform(skbones[j]); - if (first) { + // Transform bounds to skeleton's space before applying animation data. + AABB baabb = surface.mesh_to_skeleton_xform.xform(skbones[j]); + baabb = mtx.xform(baabb); + + if (!found_bone_aabb) { laabb = baabb; - first = false; + found_bone_aabb = true; } else { laabb.merge_with(baabb); } } } + if (found_bone_aabb) { + // Transform skeleton bounds back to mesh's space if any animated AABB applied. + laabb = surface.mesh_to_skeleton_xform.affine_inverse().xform(laabb); + } + if (laabb.size == Vector3()) { - laabb = mesh->surfaces[i]->aabb; + laabb = surface.aabb; } } else { - laabb = mesh->surfaces[i]->aabb; + laabb = surface.aabb; } if (i == 0) { @@ -712,6 +789,11 @@ void MeshStorage::mesh_clear(RID p_mesh) { memfree(s.versions); //reallocs, so free with memfree. } + if (s.wireframe) { + GLES3::Utilities::get_singleton()->buffer_free_data(s.wireframe->index_buffer); + memdelete(s.wireframe); + } + if (s.lod_count) { for (uint32_t j = 0; j < s.lod_count; j++) { if (s.lods[j].index_buffer != 0) { @@ -764,14 +846,17 @@ void MeshStorage::_mesh_surface_generate_version_for_input_mask(Mesh::Surface::V int skin_stride = 0; for (int i = 0; i < RS::ARRAY_INDEX; i++) { + attribs[i].enabled = false; + attribs[i].integer = false; if (!(s->format & (1ULL << i))) { - attribs[i].enabled = false; - attribs[i].integer = false; continue; } - attribs[i].enabled = true; - attribs[i].integer = false; + if ((p_input_mask & (1ULL << i))) { + // Only enable if it matches input mask. + // Iterate over all anyway, so we can calculate stride. + attribs[i].enabled = true; + } switch (i) { case RS::ARRAY_VERTEX: { @@ -1108,8 +1193,6 @@ void MeshStorage::_blend_shape_bind_mesh_instance_buffer(MeshInstance *p_mi, uin } void MeshStorage::_compute_skeleton(MeshInstance *p_mi, Skeleton *p_sk, uint32_t p_surface) { - glBindBuffer(GL_ARRAY_BUFFER, 0); - // Add in the bones and weights. glBindBuffer(GL_ARRAY_BUFFER, p_mi->mesh->surfaces[p_surface]->skin_buffer); @@ -1200,9 +1283,8 @@ void MeshStorage::update_mesh_instances() { glBindBuffer(GL_ARRAY_BUFFER, 0); GLuint vertex_array_gl = 0; - uint64_t mask = ((1 << 10) - 1) << 3; // Mask from ARRAY_FORMAT_COLOR to ARRAY_FORMAT_INDEX. - mask = ~mask; - uint64_t format = mi->surfaces[i].format_cache & mask; // Format should only have vertex, normal, tangent (as necessary) + compressions. + uint64_t mask = RS::ARRAY_FORMAT_VERTEX | RS::ARRAY_FORMAT_NORMAL | RS::ARRAY_FORMAT_VERTEX; + uint64_t format = mi->mesh->surfaces[i]->format & mask; // Format should only have vertex, normal, tangent (as necessary). mesh_surface_get_vertex_arrays_and_format(mi->mesh->surfaces[i], format, vertex_array_gl); glBindVertexArray(vertex_array_gl); glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, mi->surfaces[i].vertex_buffers[0]); @@ -1315,9 +1397,8 @@ void MeshStorage::update_mesh_instances() { skeleton_shader.shader.version_set_uniform(SkeletonShaderGLES3::INVERSE_TRANSFORM_OFFSET, inverse_transform[2], skeleton_shader.shader_version, variant, specialization); GLuint vertex_array_gl = 0; - uint64_t mask = ((1 << 10) - 1) << 3; // Mask from ARRAY_FORMAT_COLOR to ARRAY_FORMAT_INDEX. - mask = ~mask; - uint64_t format = mi->surfaces[i].format_cache & mask; // Format should only have vertex, normal, tangent (as necessary) + compressions. + uint64_t mask = RS::ARRAY_FORMAT_VERTEX | RS::ARRAY_FORMAT_NORMAL | RS::ARRAY_FORMAT_VERTEX; + uint64_t format = mi->mesh->surfaces[i]->format & mask; // Format should only have vertex, normal, tangent (as necessary). mesh_surface_get_vertex_arrays_and_format(mi->mesh->surfaces[i], format, vertex_array_gl); glBindVertexArray(vertex_array_gl); _compute_skeleton(mi, sk, i); diff --git a/drivers/gles3/storage/mesh_storage.h b/drivers/gles3/storage/mesh_storage.h index 25b15ab6a6..217c4dabf0 100644 --- a/drivers/gles3/storage/mesh_storage.h +++ b/drivers/gles3/storage/mesh_storage.h @@ -84,6 +84,14 @@ struct Mesh { uint32_t index_count = 0; uint32_t index_buffer_size = 0; + struct Wireframe { + GLuint index_buffer = 0; + uint32_t index_count = 0; + uint32_t index_buffer_size = 0; + }; + + Wireframe *wireframe = nullptr; + struct LOD { float edge_length = 0.0; uint32_t index_count = 0; @@ -98,6 +106,10 @@ struct Mesh { Vector<AABB> bone_aabbs; + // Transform used in runtime bone AABBs compute. + // As bone AABBs are saved in Mesh space, but bones animation is in Skeleton space. + Transform3D mesh_to_skeleton_xform; + Vector4 uv_scale; struct BlendShape { @@ -376,6 +388,16 @@ public: } } + _FORCE_INLINE_ GLuint mesh_surface_get_index_buffer_wireframe(void *p_surface) const { + Mesh::Surface *s = reinterpret_cast<Mesh::Surface *>(p_surface); + + if (s->wireframe) { + return s->wireframe->index_buffer; + } + + return 0; + } + _FORCE_INLINE_ GLenum mesh_surface_get_index_type(void *p_surface) const { Mesh::Surface *s = reinterpret_cast<Mesh::Surface *>(p_surface); diff --git a/drivers/gles3/storage/render_scene_buffers_gles3.cpp b/drivers/gles3/storage/render_scene_buffers_gles3.cpp index 829574cae0..33bb808856 100644 --- a/drivers/gles3/storage/render_scene_buffers_gles3.cpp +++ b/drivers/gles3/storage/render_scene_buffers_gles3.cpp @@ -31,30 +31,536 @@ #ifdef GLES3_ENABLED #include "render_scene_buffers_gles3.h" +#include "config.h" #include "texture_storage.h" +#include "utilities.h" + +#ifdef ANDROID_ENABLED +#define glFramebufferTextureMultiviewOVR GLES3::Config::get_singleton()->eglFramebufferTextureMultiviewOVR +#define glTexStorage3DMultisample GLES3::Config::get_singleton()->eglTexStorage3DMultisample +#define glFramebufferTexture2DMultisampleEXT GLES3::Config::get_singleton()->eglFramebufferTexture2DMultisampleEXT +#define glFramebufferTextureMultisampleMultiviewOVR GLES3::Config::get_singleton()->eglFramebufferTextureMultisampleMultiviewOVR +#endif // ANDROID_ENABLED + +// Will only be defined if GLES 3.2 headers are included +#ifndef GL_TEXTURE_2D_MULTISAMPLE_ARRAY +#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 +#endif RenderSceneBuffersGLES3::~RenderSceneBuffersGLES3() { free_render_buffer_data(); } +void RenderSceneBuffersGLES3::_rt_attach_textures(GLuint p_color, GLuint p_depth, GLsizei p_samples, uint32_t p_view_count) { + if (p_view_count > 1) { + if (p_samples > 1) { +#if defined(ANDROID_ENABLED) || defined(WEB_ENABLED) + glFramebufferTextureMultisampleMultiviewOVR(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, p_color, 0, p_samples, 0, p_view_count); + glFramebufferTextureMultisampleMultiviewOVR(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, p_depth, 0, p_samples, 0, p_view_count); +#else + ERR_PRINT_ONCE("Multiview MSAA isn't supported on this platform."); +#endif + } else { +#ifndef IOS_ENABLED + glFramebufferTextureMultiviewOVR(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, p_color, 0, 0, p_view_count); + glFramebufferTextureMultiviewOVR(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, p_depth, 0, 0, p_view_count); +#else + ERR_PRINT_ONCE("Multiview isn't supported on this platform."); +#endif + } + } else { + if (p_samples > 1) { +#ifdef ANDROID_ENABLED + glFramebufferTexture2DMultisampleEXT(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, p_color, 0, p_samples); + glFramebufferTexture2DMultisampleEXT(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, p_depth, 0, p_samples); +#else + ERR_PRINT_ONCE("MSAA via EXT_multisampled_render_to_texture isn't supported on this platform."); +#endif + } else { + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, p_color, 0); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, p_depth, 0); + } + } +} + +GLuint RenderSceneBuffersGLES3::_rt_get_cached_fbo(GLuint p_color, GLuint p_depth, GLsizei p_samples, uint32_t p_view_count) { + FBDEF new_fbo; + +#if defined(ANDROID_ENABLED) || defined(WEB_ENABLED) + // There shouldn't be more then 3 entries in this... + for (const FBDEF &cached_fbo : msaa3d.cached_fbos) { + if (cached_fbo.color == p_color && cached_fbo.depth == p_depth) { + return cached_fbo.fbo; + } + } + + new_fbo.color = p_color; + new_fbo.depth = p_depth; + + glGenFramebuffers(1, &new_fbo.fbo); + glBindFramebuffer(GL_FRAMEBUFFER, new_fbo.fbo); + + _rt_attach_textures(p_color, p_depth, p_samples, p_view_count); + + GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); + if (status != GL_FRAMEBUFFER_COMPLETE) { + WARN_PRINT("Could not create 3D MSAA framebuffer, status: " + GLES3::TextureStorage::get_singleton()->get_framebuffer_error(status)); + + glDeleteFramebuffers(1, &new_fbo.fbo); + + new_fbo.fbo = 0; + } else { + // cache it! + msaa3d.cached_fbos.push_back(new_fbo); + } + + glBindFramebuffer(GL_FRAMEBUFFER, 0); +#endif + + return new_fbo.fbo; +} + void RenderSceneBuffersGLES3::configure(const RenderSceneBuffersConfiguration *p_config) { - //internal_size.x = p_config->get_internal_size().x; // ignore for now - //internal_size.y = p_config->get_internal_size().y; - width = p_config->get_target_size().x; - height = p_config->get_target_size().y; - //scaling_3d_mode = p_config->get_scaling_3d_mode() + GLES3::TextureStorage *texture_storage = GLES3::TextureStorage::get_singleton(); + GLES3::Config *config = GLES3::Config::get_singleton(); + + free_render_buffer_data(); + + internal_size = p_config->get_internal_size(); + target_size = p_config->get_target_size(); + scaling_3d_mode = p_config->get_scaling_3d_mode(); //fsr_sharpness = p_config->get_fsr_sharpness(); //texture_mipmap_bias = p_config->get_texture_mipmap_bias(); render_target = p_config->get_render_target(); - //msaa = p_config->get_msaa_3d(); + msaa3d.mode = p_config->get_msaa_3d(); //screen_space_aa = p_config->get_screen_space_aa(); //use_debanding = p_config->get_use_debanding(); - view_count = p_config->get_view_count(); + view_count = config->multiview_supported ? p_config->get_view_count() : 1; - free_render_buffer_data(); + ERR_FAIL_COND(view_count == 0); + bool use_multiview = view_count > 1; + + // Check our scaling mode + if (scaling_3d_mode != RS::VIEWPORT_SCALING_3D_MODE_OFF && internal_size.x == 0 && internal_size.y == 0) { + // Disable, no size set. + scaling_3d_mode = RS::VIEWPORT_SCALING_3D_MODE_OFF; + } else if (scaling_3d_mode != RS::VIEWPORT_SCALING_3D_MODE_OFF && internal_size == target_size) { + // If size matches, we won't use scaling. + scaling_3d_mode = RS::VIEWPORT_SCALING_3D_MODE_OFF; + } else if (scaling_3d_mode != RS::VIEWPORT_SCALING_3D_MODE_OFF && scaling_3d_mode != RS::VIEWPORT_SCALING_3D_MODE_BILINEAR) { + // We only support bilinear scaling atm. + WARN_PRINT_ONCE("GLES only supports bilinear scaling."); + scaling_3d_mode = RS::VIEWPORT_SCALING_3D_MODE_BILINEAR; + } + + bool use_internal_buffer = scaling_3d_mode != RS::VIEWPORT_SCALING_3D_MODE_OFF; // TODO also need this if doing post processing like glow + if (use_internal_buffer) { + // Setup our internal buffer. + bool is_transparent = texture_storage->render_target_get_transparent(render_target); + GLuint color_internal_format = is_transparent ? GL_RGBA8 : GL_RGB10_A2; + GLuint color_format = GL_RGBA; + GLuint color_type = is_transparent ? GL_UNSIGNED_BYTE : GL_UNSIGNED_INT_2_10_10_10_REV; + + GLenum texture_target = use_multiview ? GL_TEXTURE_2D_ARRAY : GL_TEXTURE_2D; + + // Create our color buffer. + glGenTextures(1, &internal3d.color); + glBindTexture(texture_target, internal3d.color); + + if (use_multiview) { + glTexImage3D(texture_target, 0, color_internal_format, internal_size.x, internal_size.y, view_count, 0, color_format, color_type, nullptr); + } else { + glTexImage2D(texture_target, 0, color_internal_format, internal_size.x, internal_size.y, 0, color_format, color_type, nullptr); + } + + glTexParameteri(texture_target, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(texture_target, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(texture_target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(texture_target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + + GLES3::Utilities::get_singleton()->texture_allocated_data(internal3d.color, internal_size.x * internal_size.y * view_count * 4, "3D color texture"); + + // Create our depth buffer. + glGenTextures(1, &internal3d.depth); + glBindTexture(texture_target, internal3d.depth); + + if (use_multiview) { + glTexImage3D(texture_target, 0, GL_DEPTH_COMPONENT24, internal_size.x, internal_size.y, view_count, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, nullptr); + } else { + glTexImage2D(texture_target, 0, GL_DEPTH_COMPONENT24, internal_size.x, internal_size.y, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, nullptr); + } + + glTexParameteri(texture_target, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(texture_target, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(texture_target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(texture_target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + + GLES3::Utilities::get_singleton()->texture_allocated_data(internal3d.depth, internal_size.x * internal_size.y * view_count * 3, "3D depth texture"); + + // Create our internal 3D FBO. + // Note that if MSAA is used and our rt_msaa_* extensions are available, this is only used for blitting and effects. + glGenFramebuffers(1, &internal3d.fbo); + glBindFramebuffer(GL_FRAMEBUFFER, internal3d.fbo); + +#ifndef IOS_ENABLED + if (use_multiview) { + glFramebufferTextureMultiviewOVR(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, internal3d.color, 0, 0, view_count); + glFramebufferTextureMultiviewOVR(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, internal3d.depth, 0, 0, view_count); + } else { +#else + { +#endif + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, texture_target, internal3d.color, 0); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, texture_target, internal3d.depth, 0); + } + + GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); + if (status != GL_FRAMEBUFFER_COMPLETE) { + _clear_intermediate_buffers(); + WARN_PRINT("Could not create 3D buffers, status: " + texture_storage->get_framebuffer_error(status)); + } + + glBindTexture(texture_target, 0); + glBindFramebuffer(GL_FRAMEBUFFER, 0); + } + + // Check if we support MSAA. + if (msaa3d.mode != RS::VIEWPORT_MSAA_DISABLED && internal_size.x == 0 && internal_size.y == 0) { + // Disable, no size set. + msaa3d.mode = RS::VIEWPORT_MSAA_DISABLED; + } else if (!use_multiview && msaa3d.mode != RS::VIEWPORT_MSAA_DISABLED && !config->msaa_supported && !config->rt_msaa_supported) { + WARN_PRINT_ONCE("MSAA is not supported on this device."); + msaa3d.mode = RS::VIEWPORT_MSAA_DISABLED; + } else if (use_multiview && msaa3d.mode != RS::VIEWPORT_MSAA_DISABLED && !config->msaa_multiview_supported && !config->rt_msaa_multiview_supported) { + WARN_PRINT_ONCE("Multiview MSAA is not supported on this device."); + msaa3d.mode = RS::VIEWPORT_MSAA_DISABLED; + } + + if (msaa3d.mode != RS::VIEWPORT_MSAA_DISABLED) { + // Setup MSAA. + const GLsizei samples[] = { 1, 2, 4, 8 }; + msaa3d.samples = samples[msaa3d.mode]; + + // Constrain by limits of OpenGL driver. + if (msaa3d.samples > config->msaa_max_samples) { + msaa3d.samples = config->msaa_max_samples; + } + + if (!use_multiview && !config->rt_msaa_supported) { + // Render to texture extensions not supported? fall back to MSAA framebuffer through GL_EXT_framebuffer_multisample. + // Note, if 2D MSAA matches 3D MSAA and we're not scaling, it would be ideal if we reuse our 2D MSAA buffer here. + // We can't however because we don't trigger a change in configuration if 2D MSAA changes. + // We'll accept the overhead in this situation. + + msaa3d.needs_resolve = true; + msaa3d.check_fbo_cache = false; + + bool is_transparent = texture_storage->render_target_get_transparent(render_target); + GLuint color_internal_format = is_transparent ? GL_RGBA8 : GL_RGB10_A2; + + // Create our color buffer. + glGenRenderbuffers(1, &msaa3d.color); + glBindRenderbuffer(GL_RENDERBUFFER, msaa3d.color); + + glRenderbufferStorageMultisample(GL_RENDERBUFFER, msaa3d.samples, color_internal_format, internal_size.x, internal_size.y); + GLES3::Utilities::get_singleton()->render_buffer_allocated_data(msaa3d.color, internal_size.x * internal_size.y * view_count * 4 * msaa3d.samples, "MSAA 3D color render buffer"); + + // Create our depth buffer. + glGenRenderbuffers(1, &msaa3d.depth); + glBindRenderbuffer(GL_RENDERBUFFER, msaa3d.depth); + + glRenderbufferStorageMultisample(GL_RENDERBUFFER, msaa3d.samples, GL_DEPTH_COMPONENT24, internal_size.x, internal_size.y); + GLES3::Utilities::get_singleton()->render_buffer_allocated_data(msaa3d.depth, internal_size.x * internal_size.y * view_count * 3 * msaa3d.samples, "MSAA 3D depth render buffer"); + + // Create our MSAA 3D FBO. + glGenFramebuffers(1, &msaa3d.fbo); + glBindFramebuffer(GL_FRAMEBUFFER, msaa3d.fbo); + + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, msaa3d.color); + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, msaa3d.depth); + + GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); + if (status != GL_FRAMEBUFFER_COMPLETE) { + _clear_msaa3d_buffers(); + WARN_PRINT("Could not create 3D MSAA buffers, status: " + texture_storage->get_framebuffer_error(status)); + } + + glBindRenderbuffer(GL_RENDERBUFFER, 0); + glBindFramebuffer(GL_FRAMEBUFFER, 0); +#if !defined(IOS_ENABLED) && !defined(WEB_ENABLED) + } else if (use_multiview && !config->rt_msaa_multiview_supported) { + // Render to texture extensions not supported? fall back to MSAA textures through GL_EXT_multiview_texture_multisample. + msaa3d.needs_resolve = true; + msaa3d.check_fbo_cache = false; + + bool is_transparent = texture_storage->render_target_get_transparent(render_target); + GLuint color_internal_format = is_transparent ? GL_RGBA8 : GL_RGB10_A2; + + // Create our color buffer. + glGenTextures(1, &msaa3d.color); + glBindTexture(GL_TEXTURE_2D_MULTISAMPLE_ARRAY, msaa3d.color); + +#ifdef ANDROID_ENABLED + glTexStorage3DMultisample(GL_TEXTURE_2D_MULTISAMPLE_ARRAY, msaa3d.samples, color_internal_format, internal_size.x, internal_size.y, view_count, GL_TRUE); +#else + glTexImage3DMultisample(GL_TEXTURE_2D_MULTISAMPLE_ARRAY, msaa3d.samples, color_internal_format, internal_size.x, internal_size.y, view_count, GL_TRUE); +#endif + + GLES3::Utilities::get_singleton()->texture_allocated_data(msaa3d.color, internal_size.x * internal_size.y * view_count * 4 * msaa3d.samples, "MSAA 3D color texture"); + + // Create our depth buffer. + glGenTextures(1, &msaa3d.depth); + glBindTexture(GL_TEXTURE_2D_MULTISAMPLE_ARRAY, msaa3d.depth); + +#ifdef ANDROID_ENABLED + glTexStorage3DMultisample(GL_TEXTURE_2D_MULTISAMPLE_ARRAY, msaa3d.samples, GL_DEPTH_COMPONENT24, internal_size.x, internal_size.y, view_count, GL_TRUE); +#else + glTexImage3DMultisample(GL_TEXTURE_2D_MULTISAMPLE_ARRAY, msaa3d.samples, GL_DEPTH_COMPONENT24, internal_size.x, internal_size.y, view_count, GL_TRUE); +#endif + + GLES3::Utilities::get_singleton()->texture_allocated_data(msaa3d.depth, internal_size.x * internal_size.y * view_count * msaa3d.samples, "MSAA 3D depth texture"); + + // Create our MSAA 3D FBO. + glGenFramebuffers(1, &msaa3d.fbo); + glBindFramebuffer(GL_FRAMEBUFFER, msaa3d.fbo); + + glFramebufferTextureMultiviewOVR(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, msaa3d.color, 0, 0, view_count); + glFramebufferTextureMultiviewOVR(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, msaa3d.depth, 0, 0, view_count); + + GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); + if (status != GL_FRAMEBUFFER_COMPLETE) { + _clear_msaa3d_buffers(); + WARN_PRINT("Could not create 3D MSAA buffers, status: " + texture_storage->get_framebuffer_error(status)); + } + + glBindTexture(GL_TEXTURE_2D_MULTISAMPLE_ARRAY, 0); + glBindFramebuffer(GL_FRAMEBUFFER, 0); +#endif +#if defined(ANDROID_ENABLED) || defined(WEB_ENABLED) // Only supported on OpenGLES! + } else if (!use_internal_buffer) { + // We are going to render directly into our render target textures, + // these can change from frame to frame as we cycle through swapchains, + // hence we'll use our FBO cache here. + msaa3d.needs_resolve = false; + msaa3d.check_fbo_cache = true; + } else if (use_internal_buffer) { + // We can combine MSAA and scaling/effects. + msaa3d.needs_resolve = false; + msaa3d.check_fbo_cache = false; + + // We render to our internal textures, MSAA is only done in tile memory only. + // On mobile this means MSAA never leaves tile memory = efficiency! + glGenFramebuffers(1, &msaa3d.fbo); + glBindFramebuffer(GL_FRAMEBUFFER, msaa3d.fbo); + + _rt_attach_textures(internal3d.color, internal3d.depth, msaa3d.samples, view_count); + + GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); + if (status != GL_FRAMEBUFFER_COMPLETE) { + _clear_msaa3d_buffers(); + WARN_PRINT("Could not create 3D MSAA framebuffer, status: " + texture_storage->get_framebuffer_error(status)); + } + + glBindFramebuffer(GL_FRAMEBUFFER, 0); +#endif + } else { + // HUH? how did we get here? + WARN_PRINT_ONCE("MSAA is not supported on this device."); + msaa3d.mode = RS::VIEWPORT_MSAA_DISABLED; + msaa3d.samples = 1; + msaa3d.check_fbo_cache = false; + } + } else { + msaa3d.samples = 1; + msaa3d.check_fbo_cache = false; + } +} + +void RenderSceneBuffersGLES3::_clear_msaa3d_buffers() { + for (const FBDEF &cached_fbo : msaa3d.cached_fbos) { + GLuint fbo = cached_fbo.fbo; + glDeleteFramebuffers(1, &fbo); + } + msaa3d.cached_fbos.clear(); + + if (msaa3d.fbo) { + glDeleteFramebuffers(1, &msaa3d.fbo); + msaa3d.fbo = 0; + } + + if (msaa3d.color != 0) { + if (view_count == 1) { + GLES3::Utilities::get_singleton()->render_buffer_free_data(msaa3d.color); + } else { + GLES3::Utilities::get_singleton()->texture_free_data(msaa3d.color); + } + msaa3d.color = 0; + } + + if (msaa3d.depth != 0) { + if (view_count == 1) { + GLES3::Utilities::get_singleton()->render_buffer_free_data(msaa3d.depth); + } else { + GLES3::Utilities::get_singleton()->texture_free_data(msaa3d.depth); + } + msaa3d.depth = 0; + } +} + +void RenderSceneBuffersGLES3::_clear_intermediate_buffers() { + if (internal3d.fbo) { + glDeleteFramebuffers(1, &internal3d.fbo); + internal3d.fbo = 0; + } + + if (internal3d.color != 0) { + GLES3::Utilities::get_singleton()->texture_free_data(internal3d.color); + internal3d.color = 0; + } + + if (internal3d.depth != 0) { + GLES3::Utilities::get_singleton()->texture_free_data(internal3d.depth); + internal3d.depth = 0; + } +} + +void RenderSceneBuffersGLES3::check_backbuffer(bool p_need_color, bool p_need_depth) { + GLES3::TextureStorage *texture_storage = GLES3::TextureStorage::get_singleton(); + + // Setup our back buffer + + if (backbuffer3d.fbo == 0) { + glGenFramebuffers(1, &backbuffer3d.fbo); + } + + glBindFramebuffer(GL_FRAMEBUFFER, backbuffer3d.fbo); + + bool is_transparent = texture_storage->render_target_get_transparent(render_target); + GLuint color_internal_format = is_transparent ? GL_RGBA8 : GL_RGB10_A2; + GLuint color_format = GL_RGBA; + GLuint color_type = is_transparent ? GL_UNSIGNED_BYTE : GL_UNSIGNED_INT_2_10_10_10_REV; + + bool use_multiview = view_count > 1 && GLES3::Config::get_singleton()->multiview_supported; + GLenum texture_target = use_multiview ? GL_TEXTURE_2D_ARRAY : GL_TEXTURE_2D; + + if (backbuffer3d.color == 0 && p_need_color) { + glGenTextures(1, &backbuffer3d.color); + glBindTexture(texture_target, backbuffer3d.color); + + if (use_multiview) { + glTexImage3D(texture_target, 0, color_internal_format, internal_size.x, internal_size.y, view_count, 0, color_format, color_type, nullptr); + } else { + glTexImage2D(texture_target, 0, color_internal_format, internal_size.x, internal_size.y, 0, color_format, color_type, nullptr); + } + + glTexParameteri(texture_target, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(texture_target, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(texture_target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(texture_target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + + GLES3::Utilities::get_singleton()->texture_allocated_data(backbuffer3d.color, internal_size.x * internal_size.y * view_count * 4, "3D Back buffer color texture"); + +#ifndef IOS_ENABLED + if (use_multiview) { + glFramebufferTextureMultiviewOVR(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, backbuffer3d.color, 0, 0, view_count); + } else { +#else + { +#endif + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, texture_target, backbuffer3d.color, 0); + } + } + + if (backbuffer3d.depth == 0 && p_need_depth) { + glGenTextures(1, &backbuffer3d.depth); + glBindTexture(texture_target, backbuffer3d.depth); + + if (use_multiview) { + glTexImage3D(texture_target, 0, GL_DEPTH_COMPONENT24, internal_size.x, internal_size.y, view_count, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, nullptr); + } else { + glTexImage2D(texture_target, 0, GL_DEPTH_COMPONENT24, internal_size.x, internal_size.y, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, nullptr); + } + + glTexParameteri(texture_target, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(texture_target, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(texture_target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(texture_target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + + GLES3::Utilities::get_singleton()->texture_allocated_data(backbuffer3d.depth, internal_size.x * internal_size.y * view_count * 3, "3D back buffer depth texture"); + +#ifndef IOS_ENABLED + if (use_multiview) { + glFramebufferTextureMultiviewOVR(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, backbuffer3d.depth, 0, 0, view_count); + } else { +#else + { +#endif + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, texture_target, backbuffer3d.depth, 0); + } + } + + GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); + if (status != GL_FRAMEBUFFER_COMPLETE) { + _clear_back_buffers(); + WARN_PRINT("Could not create 3D back buffers, status: " + texture_storage->get_framebuffer_error(status)); + } + + glBindTexture(texture_target, 0); + glBindFramebuffer(GL_FRAMEBUFFER, 0); +} + +void RenderSceneBuffersGLES3::_clear_back_buffers() { + if (backbuffer3d.fbo) { + glDeleteFramebuffers(1, &backbuffer3d.fbo); + backbuffer3d.fbo = 0; + } + + if (backbuffer3d.color != 0) { + GLES3::Utilities::get_singleton()->texture_free_data(backbuffer3d.color); + backbuffer3d.color = 0; + } + + if (backbuffer3d.depth != 0) { + GLES3::Utilities::get_singleton()->texture_free_data(backbuffer3d.depth); + backbuffer3d.depth = 0; + } } void RenderSceneBuffersGLES3::free_render_buffer_data() { + _clear_msaa3d_buffers(); + _clear_intermediate_buffers(); + _clear_back_buffers(); +} + +GLuint RenderSceneBuffersGLES3::get_render_fbo() { + GLES3::TextureStorage *texture_storage = GLES3::TextureStorage::get_singleton(); + GLuint rt_fbo = 0; + + if (msaa3d.check_fbo_cache) { + GLuint color = texture_storage->render_target_get_color(render_target); + GLuint depth = texture_storage->render_target_get_depth(render_target); + + rt_fbo = _rt_get_cached_fbo(color, depth, msaa3d.samples, view_count); + } else if (msaa3d.fbo != 0) { + // We have an MSAA fbo, render to our MSAA buffer + return msaa3d.fbo; + } else if (internal3d.fbo != 0) { + // We have an internal buffer, render to our internal buffer! + return internal3d.fbo; + } else { + rt_fbo = texture_storage->render_target_get_fbo(render_target); + } + + if (texture_storage->render_target_is_reattach_textures(render_target)) { + GLuint color = texture_storage->render_target_get_color(render_target); + GLuint depth = texture_storage->render_target_get_depth(render_target); + + glBindFramebuffer(GL_FRAMEBUFFER, rt_fbo); + _rt_attach_textures(color, depth, msaa3d.samples, view_count); + glBindFramebuffer(GL_FRAMEBUFFER, texture_storage->system_fbo); + } + + return rt_fbo; } #endif // GLES3_ENABLED diff --git a/drivers/gles3/storage/render_scene_buffers_gles3.h b/drivers/gles3/storage/render_scene_buffers_gles3.h index 543e1aeb15..7a6811bf3c 100644 --- a/drivers/gles3/storage/render_scene_buffers_gles3.h +++ b/drivers/gles3/storage/render_scene_buffers_gles3.h @@ -41,21 +41,40 @@ class RenderSceneBuffersGLES3 : public RenderSceneBuffers { GDCLASS(RenderSceneBuffersGLES3, RenderSceneBuffers); public: - // Original implementation, need to investigate which ones we'll keep like this and what we'll change... - - int internal_width = 0; - int internal_height = 0; - int width = 0; - int height = 0; + Size2i internal_size; // Size of the buffer we render 3D content to. + Size2i target_size; // Size of our output buffer (render target). + RS::ViewportScaling3DMode scaling_3d_mode = RS::VIEWPORT_SCALING_3D_MODE_OFF; //float fsr_sharpness = 0.2f; - RS::ViewportMSAA msaa = RS::VIEWPORT_MSAA_DISABLED; //RS::ViewportScreenSpaceAA screen_space_aa = RS::VIEWPORT_SCREEN_SPACE_AA_DISABLED; + //bool use_taa = false; //bool use_debanding = false; uint32_t view_count = 1; RID render_target; - //built-in textures used for ping pong image processing and blurring + struct FBDEF { + GLuint color = 0; + GLuint depth = 0; + GLuint fbo = 0; + }; + + struct RTMSAA3D { + RS::ViewportMSAA mode = RS::VIEWPORT_MSAA_DISABLED; + bool needs_resolve = false; + GLsizei samples = 1; + GLuint color = 0; + GLuint depth = 0; + GLuint fbo = 0; + + bool check_fbo_cache = false; + Vector<FBDEF> cached_fbos; + } msaa3d; // MSAA buffers used to render 3D + + FBDEF internal3d; // buffers used to either render 3D (scaled/post) or to resolve MSAA into + + FBDEF backbuffer3d; // our back buffer + + // Built-in textures used for ping pong image processing and blurring. struct Blur { RID texture; @@ -72,6 +91,13 @@ public: Blur blur[2]; //the second one starts from the first mipmap private: + void _clear_msaa3d_buffers(); + void _clear_intermediate_buffers(); + void _clear_back_buffers(); + + void _rt_attach_textures(GLuint p_color, GLuint p_depth, GLsizei p_samples, uint32_t p_view_count); + GLuint _rt_get_cached_fbo(GLuint p_color, GLuint p_depth, GLsizei p_samples, uint32_t p_view_count); + public: virtual ~RenderSceneBuffersGLES3(); virtual void configure(const RenderSceneBuffersConfiguration *p_config) override; @@ -81,6 +107,33 @@ public: virtual void set_use_debanding(bool p_use_debanding) override{}; void free_render_buffer_data(); + + void check_backbuffer(bool p_need_color, bool p_need_depth); // check if we need to initialise our backbuffer + + GLuint get_render_fbo(); + GLuint get_msaa3d_fbo() const { return msaa3d.fbo; } + GLuint get_msaa3d_color() const { return msaa3d.color; } + GLuint get_msaa3d_depth() const { return msaa3d.depth; } + bool get_msaa_needs_resolve() const { return msaa3d.needs_resolve; } + GLuint get_internal_fbo() const { return internal3d.fbo; } + GLuint get_internal_color() const { return internal3d.color; } + GLuint get_internal_depth() const { return internal3d.depth; } + GLuint get_backbuffer_fbo() const { return backbuffer3d.fbo; } + GLuint get_backbuffer() const { return backbuffer3d.color; } + GLuint get_backbuffer_depth() const { return backbuffer3d.depth; } + + // Getters + + _FORCE_INLINE_ RID get_render_target() const { return render_target; } + _FORCE_INLINE_ uint32_t get_view_count() const { return view_count; } + _FORCE_INLINE_ Size2i get_internal_size() const { return internal_size; } + _FORCE_INLINE_ Size2i get_target_size() const { return target_size; } + _FORCE_INLINE_ RS::ViewportScaling3DMode get_scaling_3d_mode() const { return scaling_3d_mode; } + //_FORCE_INLINE_ float get_fsr_sharpness() const { return fsr_sharpness; } + _FORCE_INLINE_ RS::ViewportMSAA get_msaa_3d() const { return msaa3d.mode; } + //_FORCE_INLINE_ RS::ViewportScreenSpaceAA get_screen_space_aa() const { return screen_space_aa; } + //_FORCE_INLINE_ bool get_use_taa() const { return use_taa; } + //_FORCE_INLINE_ bool get_use_debanding() const { return use_debanding; } }; #endif // GLES3_ENABLED diff --git a/drivers/gles3/storage/texture_storage.cpp b/drivers/gles3/storage/texture_storage.cpp index fcc1dee3e2..4e34fbcf0a 100644 --- a/drivers/gles3/storage/texture_storage.cpp +++ b/drivers/gles3/storage/texture_storage.cpp @@ -61,8 +61,6 @@ static const GLenum _cube_side_enum[6] = { TextureStorage::TextureStorage() { singleton = this; - system_fbo = 0; - { //create default textures { // White Textures @@ -1734,7 +1732,7 @@ void TextureStorage::_update_render_target(RenderTarget *rt) { #else { #endif - glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, rt->color, 0); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, texture_target, rt->color, 0); } // depth @@ -1767,7 +1765,7 @@ void TextureStorage::_update_render_target(RenderTarget *rt) { #else { #endif - glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, rt->depth, 0); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, texture_target, rt->depth, 0); } GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); @@ -1876,7 +1874,7 @@ void TextureStorage::_create_render_target_backbuffer(RenderTarget *rt) { glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); } } -void GLES3::TextureStorage::copy_scene_to_backbuffer(RenderTarget *rt, const bool uses_screen_texture, const bool uses_depth_texture) { +void GLES3::TextureStorage::check_backbuffer(RenderTarget *rt, const bool uses_screen_texture, const bool uses_depth_texture) { if (rt->backbuffer != 0 && rt->backbuffer_depth != 0) { return; } @@ -1937,7 +1935,7 @@ void GLES3::TextureStorage::copy_scene_to_backbuffer(RenderTarget *rt, const boo } } void TextureStorage::_clear_render_target(RenderTarget *rt) { - // there is nothing to clear when DIRECT_TO_SCREEN is used + // there is nothing else to clear when DIRECT_TO_SCREEN is used if (rt->direct_to_screen) { return; } @@ -2231,6 +2229,7 @@ void TextureStorage::render_target_clear_used(RID p_render_target) { void TextureStorage::render_target_set_msaa(RID p_render_target, RS::ViewportMSAA p_msaa) { RenderTarget *rt = render_target_owner.get_or_null(p_render_target); ERR_FAIL_NULL(rt); + ERR_FAIL_COND(rt->direct_to_screen); if (p_msaa == rt->msaa) { return; } @@ -2286,6 +2285,55 @@ void TextureStorage::render_target_do_clear_request(RID p_render_target) { glBindFramebuffer(GL_FRAMEBUFFER, system_fbo); } +GLuint TextureStorage::render_target_get_fbo(RID p_render_target) const { + RenderTarget *rt = render_target_owner.get_or_null(p_render_target); + ERR_FAIL_NULL_V(rt, 0); + + return rt->fbo; +} + +GLuint TextureStorage::render_target_get_color(RID p_render_target) const { + RenderTarget *rt = render_target_owner.get_or_null(p_render_target); + ERR_FAIL_NULL_V(rt, 0); + + if (rt->overridden.color.is_valid()) { + Texture *texture = get_texture(rt->overridden.color); + ERR_FAIL_NULL_V(texture, 0); + + return texture->tex_id; + } else { + return rt->color; + } +} + +GLuint TextureStorage::render_target_get_depth(RID p_render_target) const { + RenderTarget *rt = render_target_owner.get_or_null(p_render_target); + ERR_FAIL_NULL_V(rt, 0); + + if (rt->overridden.depth.is_valid()) { + Texture *texture = get_texture(rt->overridden.depth); + ERR_FAIL_NULL_V(texture, 0); + + return texture->tex_id; + } else { + return rt->depth; + } +} + +void TextureStorage::render_target_set_reattach_textures(RID p_render_target, bool p_reattach_textures) const { + RenderTarget *rt = render_target_owner.get_or_null(p_render_target); + ERR_FAIL_NULL(rt); + + rt->reattach_textures = p_reattach_textures; +} + +bool TextureStorage::render_target_is_reattach_textures(RID p_render_target) const { + RenderTarget *rt = render_target_owner.get_or_null(p_render_target); + ERR_FAIL_NULL_V(rt, false); + + return rt->reattach_textures; +} + void TextureStorage::render_target_set_sdf_size_and_scale(RID p_render_target, RS::ViewportSDFOversize p_size, RS::ViewportSDFScale p_scale) { RenderTarget *rt = render_target_owner.get_or_null(p_render_target); ERR_FAIL_NULL(rt); diff --git a/drivers/gles3/storage/texture_storage.h b/drivers/gles3/storage/texture_storage.h index 87a07ebb36..a4e5eb260e 100644 --- a/drivers/gles3/storage/texture_storage.h +++ b/drivers/gles3/storage/texture_storage.h @@ -365,6 +365,7 @@ struct RenderTarget { bool used_in_frame = false; RS::ViewportMSAA msaa = RS::VIEWPORT_MSAA_DISABLED; + bool reattach_textures = false; struct RTOverridden { bool is_overridden = false; @@ -484,7 +485,7 @@ public: /* Texture API */ - Texture *get_texture(RID p_rid) { + Texture *get_texture(RID p_rid) const { Texture *texture = texture_owner.get_or_null(p_rid); if (texture && texture->is_proxy) { return texture_owner.get_or_null(texture->proxy_to); @@ -602,7 +603,7 @@ public: RenderTarget *get_render_target(RID p_rid) { return render_target_owner.get_or_null(p_rid); }; bool owns_render_target(RID p_rid) { return render_target_owner.owns(p_rid); }; - void copy_scene_to_backbuffer(RenderTarget *rt, const bool uses_screen_texture, const bool uses_depth_texture); + void check_backbuffer(RenderTarget *rt, const bool uses_screen_texture, const bool uses_depth_texture); virtual RID render_target_create() override; virtual void render_target_free(RID p_rid) override; @@ -619,6 +620,9 @@ public: void render_target_clear_used(RID p_render_target); virtual void render_target_set_msaa(RID p_render_target, RS::ViewportMSAA p_msaa) override; virtual RS::ViewportMSAA render_target_get_msaa(RID p_render_target) const override; + virtual void render_target_set_msaa_needs_resolve(RID p_render_target, bool p_needs_resolve) override {} + virtual bool render_target_get_msaa_needs_resolve(RID p_render_target) const override { return false; } + virtual void render_target_do_msaa_resolve(RID p_render_target) override {} virtual void render_target_set_use_hdr(RID p_render_target, bool p_use_hdr_2d) override {} virtual bool render_target_is_using_hdr(RID p_render_target) const override { return false; } @@ -633,6 +637,12 @@ public: void render_target_disable_clear_request(RID p_render_target) override; void render_target_do_clear_request(RID p_render_target) override; + GLuint render_target_get_fbo(RID p_render_target) const; + GLuint render_target_get_color(RID p_render_target) const; + GLuint render_target_get_depth(RID p_render_target) const; + void render_target_set_reattach_textures(RID p_render_target, bool p_reattach_textures) const; + bool render_target_is_reattach_textures(RID p_render_target) const; + virtual void render_target_set_sdf_size_and_scale(RID p_render_target, RS::ViewportSDFOversize p_size, RS::ViewportSDFScale p_scale) override; virtual Rect2i render_target_get_sdf_rect(RID p_render_target) const override; GLuint render_target_get_sdf_texture(RID p_render_target); diff --git a/drivers/gles3/storage/utilities.cpp b/drivers/gles3/storage/utilities.cpp index 72bcbe879c..8a9e61c725 100644 --- a/drivers/gles3/storage/utilities.cpp +++ b/drivers/gles3/storage/utilities.cpp @@ -85,6 +85,21 @@ Utilities::~Utilities() { } } + if (render_buffer_mem_cache) { + uint32_t leaked_data_size = 0; + for (const KeyValue<GLuint, ResourceAllocation> &E : render_buffer_allocs_cache) { +#ifdef DEV_ENABLED + ERR_PRINT(E.value.name + ": leaked " + itos(E.value.size) + " bytes."); +#else + ERR_PRINT("Render buffer with GL ID of " + itos(E.key) + ": leaked " + itos(E.value.size) + " bytes."); +#endif + leaked_data_size += E.value.size; + } + if (leaked_data_size < render_buffer_mem_cache) { + ERR_PRINT("Render buffer cache is not empty. There may be an additional render buffer leak of " + itos(render_buffer_mem_cache - leaked_data_size) + " bytes."); + } + } + if (buffer_mem_cache) { uint32_t leaked_data_size = 0; @@ -327,6 +342,8 @@ void Utilities::update_dirty_resources() { } void Utilities::set_debug_generate_wireframes(bool p_generate) { + Config *config = Config::get_singleton(); + config->generate_wireframes = p_generate; } bool Utilities::has_os_feature(const String &p_feature) const { @@ -362,11 +379,11 @@ void Utilities::update_memory_info() { uint64_t Utilities::get_rendering_info(RS::RenderingInfo p_info) { if (p_info == RS::RENDERING_INFO_TEXTURE_MEM_USED) { - return texture_mem_cache; + return texture_mem_cache + render_buffer_mem_cache; // Add render buffer memory to our texture mem. } else if (p_info == RS::RENDERING_INFO_BUFFER_MEM_USED) { return buffer_mem_cache; } else if (p_info == RS::RENDERING_INFO_VIDEO_MEM_USED) { - return texture_mem_cache + buffer_mem_cache; + return texture_mem_cache + buffer_mem_cache + render_buffer_mem_cache; } return 0; } diff --git a/drivers/gles3/storage/utilities.h b/drivers/gles3/storage/utilities.h index 76e4d510de..ea7bf4a4c2 100644 --- a/drivers/gles3/storage/utilities.h +++ b/drivers/gles3/storage/utilities.h @@ -50,9 +50,11 @@ private: uint32_t size = 0; }; HashMap<GLuint, ResourceAllocation> buffer_allocs_cache; + HashMap<GLuint, ResourceAllocation> render_buffer_allocs_cache; HashMap<GLuint, ResourceAllocation> texture_allocs_cache; uint64_t buffer_mem_cache = 0; + uint64_t render_buffer_mem_cache = 0; uint64_t texture_mem_cache = 0; public: @@ -88,6 +90,26 @@ public: buffer_allocs_cache.erase(p_id); } + _FORCE_INLINE_ void render_buffer_allocated_data(GLuint p_id, uint32_t p_size, String p_name = "") { + render_buffer_mem_cache += p_size; +#ifdef DEV_ENABLED + ERR_FAIL_COND_MSG(render_buffer_allocs_cache.has(p_id), "trying to allocate render buffer with name " + p_name + " but ID already used by " + render_buffer_allocs_cache[p_id].name); +#endif + ResourceAllocation resource_allocation; + resource_allocation.size = p_size; +#ifdef DEV_ENABLED + resource_allocation.name = p_name + ": " + itos((uint64_t)p_id); +#endif + render_buffer_allocs_cache[p_id] = resource_allocation; + } + + _FORCE_INLINE_ void render_buffer_free_data(GLuint p_id) { + ERR_FAIL_COND(!render_buffer_allocs_cache.has(p_id)); + glDeleteRenderbuffers(1, &p_id); + render_buffer_mem_cache -= render_buffer_allocs_cache[p_id].size; + render_buffer_allocs_cache.erase(p_id); + } + // Records that data was allocated for state tracking purposes. _FORCE_INLINE_ void texture_allocated_data(GLuint p_id, uint32_t p_size, String p_name = "") { texture_mem_cache += p_size; diff --git a/drivers/vulkan/rendering_device_vulkan.cpp b/drivers/vulkan/rendering_device_vulkan.cpp index c3a365a3b8..04aeac2bfc 100644 --- a/drivers/vulkan/rendering_device_vulkan.cpp +++ b/drivers/vulkan/rendering_device_vulkan.cpp @@ -1365,6 +1365,9 @@ Error RenderingDeviceVulkan::_buffer_allocate(Buffer *p_buffer, uint32_t p_size, allocInfo.memoryTypeBits = 0; allocInfo.pool = nullptr; allocInfo.pUserData = nullptr; + if (p_mem_usage == VMA_MEMORY_USAGE_AUTO_PREFER_HOST) { + allocInfo.requiredFlags = VK_MEMORY_PROPERTY_HOST_COHERENT_BIT | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT; + } if (p_size <= SMALL_ALLOCATION_MAX_SIZE) { uint32_t mem_type_index = 0; vmaFindMemoryTypeIndexForBufferInfo(allocator, &bufferInfo, &allocInfo, &mem_type_index); @@ -1410,7 +1413,7 @@ Error RenderingDeviceVulkan::_insert_staging_block() { VmaAllocationCreateInfo allocInfo; allocInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT; allocInfo.usage = VMA_MEMORY_USAGE_AUTO_PREFER_HOST; - allocInfo.requiredFlags = 0; + allocInfo.requiredFlags = VK_MEMORY_PROPERTY_HOST_COHERENT_BIT | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT; allocInfo.preferredFlags = 0; allocInfo.memoryTypeBits = 0; allocInfo.pool = nullptr; @@ -5995,7 +5998,7 @@ Error RenderingDeviceVulkan::buffer_update(RID p_buffer, uint32_t p_offset, uint // No barrier should be needed here. // _buffer_memory_barrier(buffer->buffer, p_offset, p_size, dst_stage_mask, VK_PIPELINE_STAGE_TRANSFER_BIT, dst_access, VK_ACCESS_TRANSFER_WRITE_BIT, true); - Error err = _buffer_update(buffer, p_offset, (uint8_t *)p_data, p_size, p_post_barrier); + Error err = _buffer_update(buffer, p_offset, (uint8_t *)p_data, p_size, true); if (err) { return err; } @@ -6841,24 +6844,24 @@ Error RenderingDeviceVulkan::_draw_list_setup_framebuffer(Framebuffer *p_framebu return OK; } -Error RenderingDeviceVulkan::_draw_list_render_pass_begin(Framebuffer *framebuffer, InitialAction p_initial_color_action, FinalAction p_final_color_action, InitialAction p_initial_depth_action, FinalAction p_final_depth_action, const Vector<Color> &p_clear_colors, float p_clear_depth, uint32_t p_clear_stencil, Point2i viewport_offset, Point2i viewport_size, VkFramebuffer vkframebuffer, VkRenderPass render_pass, VkCommandBuffer command_buffer, VkSubpassContents subpass_contents, const Vector<RID> &p_storage_textures) { +Error RenderingDeviceVulkan::_draw_list_render_pass_begin(Framebuffer *framebuffer, InitialAction p_initial_color_action, FinalAction p_final_color_action, InitialAction p_initial_depth_action, FinalAction p_final_depth_action, const Vector<Color> &p_clear_colors, float p_clear_depth, uint32_t p_clear_stencil, Point2i viewport_offset, Point2i viewport_size, VkFramebuffer vkframebuffer, VkRenderPass render_pass, VkCommandBuffer command_buffer, VkSubpassContents subpass_contents, const Vector<RID> &p_storage_textures, bool p_constrained_to_region) { VkRenderPassBeginInfo render_pass_begin; render_pass_begin.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO; render_pass_begin.pNext = nullptr; render_pass_begin.renderPass = render_pass; render_pass_begin.framebuffer = vkframebuffer; - /* - * Given how API works, it makes sense to always fully operate on the whole framebuffer. - * This allows better continue operations for operations like shadowmapping. - render_pass_begin.renderArea.extent.width = viewport_size.width; - render_pass_begin.renderArea.extent.height = viewport_size.height; - render_pass_begin.renderArea.offset.x = viewport_offset.x; - render_pass_begin.renderArea.offset.y = viewport_offset.y; - */ - render_pass_begin.renderArea.extent.width = framebuffer->size.width; - render_pass_begin.renderArea.extent.height = framebuffer->size.height; - render_pass_begin.renderArea.offset.x = 0; - render_pass_begin.renderArea.offset.y = 0; + + if (p_constrained_to_region) { + render_pass_begin.renderArea.extent.width = viewport_size.width; + render_pass_begin.renderArea.extent.height = viewport_size.height; + render_pass_begin.renderArea.offset.x = viewport_offset.x; + render_pass_begin.renderArea.offset.y = viewport_offset.y; + } else { + render_pass_begin.renderArea.extent.width = framebuffer->size.width; + render_pass_begin.renderArea.extent.height = framebuffer->size.height; + render_pass_begin.renderArea.offset.x = 0; + render_pass_begin.renderArea.offset.y = 0; + } Vector<VkClearValue> clear_values; clear_values.resize(framebuffer->texture_ids.size()); @@ -7008,6 +7011,7 @@ RenderingDevice::DrawListID RenderingDeviceVulkan::draw_list_begin(RID p_framebu Point2i viewport_offset; Point2i viewport_size = framebuffer->size; + bool constrained_to_region = false; bool needs_clear_color = false; bool needs_clear_depth = false; @@ -7022,21 +7026,30 @@ RenderingDevice::DrawListID RenderingDeviceVulkan::draw_list_begin(RID p_framebu viewport_offset = regioni.position; viewport_size = regioni.size; - if (p_initial_color_action == INITIAL_ACTION_CLEAR_REGION_CONTINUE) { - needs_clear_color = true; - p_initial_color_action = INITIAL_ACTION_CONTINUE; - } - if (p_initial_depth_action == INITIAL_ACTION_CLEAR_REGION_CONTINUE) { - needs_clear_depth = true; - p_initial_depth_action = INITIAL_ACTION_CONTINUE; - } - if (p_initial_color_action == INITIAL_ACTION_CLEAR_REGION) { - needs_clear_color = true; - p_initial_color_action = INITIAL_ACTION_KEEP; - } - if (p_initial_depth_action == INITIAL_ACTION_CLEAR_REGION) { - needs_clear_depth = true; - p_initial_depth_action = INITIAL_ACTION_KEEP; + + // If clearing regions both in color and depth, we can switch to a fast path where we let Vulkan to the clears + // and we constrain the render area to the region. + if (p_initial_color_action == INITIAL_ACTION_CLEAR_REGION && p_initial_depth_action == INITIAL_ACTION_CLEAR_REGION) { + constrained_to_region = true; + p_initial_color_action = INITIAL_ACTION_CLEAR; + p_initial_depth_action = INITIAL_ACTION_CLEAR; + } else { + if (p_initial_color_action == INITIAL_ACTION_CLEAR_REGION_CONTINUE) { + needs_clear_color = true; + p_initial_color_action = INITIAL_ACTION_CONTINUE; + } + if (p_initial_depth_action == INITIAL_ACTION_CLEAR_REGION_CONTINUE) { + needs_clear_depth = true; + p_initial_depth_action = INITIAL_ACTION_CONTINUE; + } + if (p_initial_color_action == INITIAL_ACTION_CLEAR_REGION) { + needs_clear_color = true; + p_initial_color_action = INITIAL_ACTION_KEEP; + } + if (p_initial_depth_action == INITIAL_ACTION_CLEAR_REGION) { + needs_clear_depth = true; + p_initial_depth_action = INITIAL_ACTION_KEEP; + } } } @@ -7063,7 +7076,7 @@ RenderingDevice::DrawListID RenderingDeviceVulkan::draw_list_begin(RID p_framebu ERR_FAIL_COND_V(err != OK, INVALID_ID); VkCommandBuffer command_buffer = frames[frame].draw_command_buffer; - err = _draw_list_render_pass_begin(framebuffer, p_initial_color_action, p_final_color_action, p_initial_depth_action, p_final_depth_action, p_clear_color_values, p_clear_depth, p_clear_stencil, viewport_offset, viewport_size, vkframebuffer, render_pass, command_buffer, VK_SUBPASS_CONTENTS_INLINE, p_storage_textures); + err = _draw_list_render_pass_begin(framebuffer, p_initial_color_action, p_final_color_action, p_initial_depth_action, p_final_depth_action, p_clear_color_values, p_clear_depth, p_clear_stencil, viewport_offset, viewport_size, vkframebuffer, render_pass, command_buffer, VK_SUBPASS_CONTENTS_INLINE, p_storage_textures, constrained_to_region); if (err != OK) { return INVALID_ID; @@ -7079,6 +7092,7 @@ RenderingDevice::DrawListID RenderingDeviceVulkan::draw_list_begin(RID p_framebu draw_list_current_subpass = 0; if (needs_clear_color || needs_clear_depth) { + DEV_ASSERT(!constrained_to_region); _draw_list_insert_clear_region(draw_list, framebuffer, viewport_offset, viewport_size, needs_clear_color, p_clear_color_values, needs_clear_depth, p_clear_depth, p_clear_stencil); } @@ -7117,6 +7131,7 @@ Error RenderingDeviceVulkan::draw_list_begin_split(RID p_framebuffer, uint32_t p Point2i viewport_offset; Point2i viewport_size = framebuffer->size; + bool constrained_to_region = false; bool needs_clear_color = false; bool needs_clear_depth = false; @@ -7132,13 +7147,29 @@ Error RenderingDeviceVulkan::draw_list_begin_split(RID p_framebuffer, uint32_t p viewport_offset = regioni.position; viewport_size = regioni.size; - if (p_initial_color_action == INITIAL_ACTION_CLEAR_REGION) { - needs_clear_color = true; - p_initial_color_action = INITIAL_ACTION_KEEP; - } - if (p_initial_depth_action == INITIAL_ACTION_CLEAR_REGION) { - needs_clear_depth = true; - p_initial_depth_action = INITIAL_ACTION_KEEP; + // If clearing regions both in color and depth, we can switch to a fast path where we let Vulkan to the clears + // and we constrain the render area to the region. + if (p_initial_color_action == INITIAL_ACTION_CLEAR_REGION && p_initial_depth_action == INITIAL_ACTION_CLEAR_REGION) { + constrained_to_region = true; + p_initial_color_action = INITIAL_ACTION_CLEAR; + p_initial_depth_action = INITIAL_ACTION_CLEAR; + } else { + if (p_initial_color_action == INITIAL_ACTION_CLEAR_REGION_CONTINUE) { + needs_clear_color = true; + p_initial_color_action = INITIAL_ACTION_CONTINUE; + } + if (p_initial_depth_action == INITIAL_ACTION_CLEAR_REGION_CONTINUE) { + needs_clear_depth = true; + p_initial_depth_action = INITIAL_ACTION_CONTINUE; + } + if (p_initial_color_action == INITIAL_ACTION_CLEAR_REGION) { + needs_clear_color = true; + p_initial_color_action = INITIAL_ACTION_KEEP; + } + if (p_initial_depth_action == INITIAL_ACTION_CLEAR_REGION) { + needs_clear_depth = true; + p_initial_depth_action = INITIAL_ACTION_KEEP; + } } } @@ -7164,7 +7195,7 @@ Error RenderingDeviceVulkan::draw_list_begin_split(RID p_framebuffer, uint32_t p ERR_FAIL_COND_V(err != OK, ERR_CANT_CREATE); VkCommandBuffer frame_command_buffer = frames[frame].draw_command_buffer; - err = _draw_list_render_pass_begin(framebuffer, p_initial_color_action, p_final_color_action, p_initial_depth_action, p_final_depth_action, p_clear_color_values, p_clear_depth, p_clear_stencil, viewport_offset, viewport_size, vkframebuffer, render_pass, frame_command_buffer, VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS, p_storage_textures); + err = _draw_list_render_pass_begin(framebuffer, p_initial_color_action, p_final_color_action, p_initial_depth_action, p_final_depth_action, p_clear_color_values, p_clear_depth, p_clear_stencil, viewport_offset, viewport_size, vkframebuffer, render_pass, frame_command_buffer, VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS, p_storage_textures, constrained_to_region); if (err != OK) { return ERR_CANT_CREATE; @@ -7184,6 +7215,7 @@ Error RenderingDeviceVulkan::draw_list_begin_split(RID p_framebuffer, uint32_t p } if (needs_clear_color || needs_clear_depth) { + DEV_ASSERT(!constrained_to_region); _draw_list_insert_clear_region(&draw_list[0], framebuffer, viewport_offset, viewport_size, needs_clear_color, p_clear_color_values, needs_clear_depth, p_clear_depth, p_clear_stencil); } diff --git a/drivers/vulkan/rendering_device_vulkan.h b/drivers/vulkan/rendering_device_vulkan.h index 7c514c11f8..e8ad0e4f45 100644 --- a/drivers/vulkan/rendering_device_vulkan.h +++ b/drivers/vulkan/rendering_device_vulkan.h @@ -43,7 +43,7 @@ #define _DEBUG #endif #endif -#include "vk_mem_alloc.h" +#include "thirdparty/vulkan/vk_mem_alloc.h" #ifdef USE_VOLK #include <volk.h> @@ -159,7 +159,7 @@ class RenderingDeviceVulkan : public RenderingDevice { RID owner; }; - RID_Owner<Texture, true> texture_owner; + RID_Owner<Texture> texture_owner; uint32_t texture_upload_region_size_px = 0; Vector<uint8_t> _texture_get_data_from_image(Texture *tex, VkImage p_image, VmaAllocation p_allocation, uint32_t p_layer, bool p_2d = false); @@ -409,7 +409,7 @@ class RenderingDeviceVulkan : public RenderingDevice { uint32_t view_count; }; - RID_Owner<Framebuffer, true> framebuffer_owner; + RID_Owner<Framebuffer> framebuffer_owner; /***********************/ /**** VERTEX BUFFER ****/ @@ -424,7 +424,7 @@ class RenderingDeviceVulkan : public RenderingDevice { // This mapping is done here internally, and it's not // exposed. - RID_Owner<Buffer, true> vertex_buffer_owner; + RID_Owner<Buffer> vertex_buffer_owner; struct VertexDescriptionKey { Vector<VertexAttribute> vertex_formats; @@ -506,7 +506,7 @@ class RenderingDeviceVulkan : public RenderingDevice { Vector<VkDeviceSize> offsets; }; - RID_Owner<VertexArray, true> vertex_array_owner; + RID_Owner<VertexArray> vertex_array_owner; struct IndexBuffer : public Buffer { uint32_t max_index = 0; // Used for validation. @@ -515,7 +515,7 @@ class RenderingDeviceVulkan : public RenderingDevice { bool supports_restart_indices = false; }; - RID_Owner<IndexBuffer, true> index_buffer_owner; + RID_Owner<IndexBuffer> index_buffer_owner; struct IndexArray { uint32_t max_index = 0; // Remember the maximum index here too, for validation. @@ -526,7 +526,7 @@ class RenderingDeviceVulkan : public RenderingDevice { bool supports_restart_indices = false; }; - RID_Owner<IndexArray, true> index_array_owner; + RID_Owner<IndexArray> index_array_owner; /****************/ /**** SHADER ****/ @@ -649,7 +649,7 @@ class RenderingDeviceVulkan : public RenderingDevice { String _shader_uniform_debug(RID p_shader, int p_set = -1); - RID_Owner<Shader, true> shader_owner; + RID_Owner<Shader> shader_owner; /******************/ /**** UNIFORMS ****/ @@ -713,8 +713,8 @@ class RenderingDeviceVulkan : public RenderingDevice { DescriptorPool *_descriptor_pool_allocate(const DescriptorPoolKey &p_key); void _descriptor_pool_free(const DescriptorPoolKey &p_key, DescriptorPool *p_pool); - RID_Owner<Buffer, true> uniform_buffer_owner; - RID_Owner<Buffer, true> storage_buffer_owner; + RID_Owner<Buffer> uniform_buffer_owner; + RID_Owner<Buffer> storage_buffer_owner; // Texture buffer needs a view. struct TextureBuffer { @@ -722,7 +722,7 @@ class RenderingDeviceVulkan : public RenderingDevice { VkBufferView view = VK_NULL_HANDLE; }; - RID_Owner<TextureBuffer, true> texture_buffer_owner; + RID_Owner<TextureBuffer> texture_buffer_owner; // This structure contains the descriptor set. They _need_ to be allocated // for a shader (and will be erased when this shader is erased), but should @@ -752,7 +752,7 @@ class RenderingDeviceVulkan : public RenderingDevice { void *invalidated_callback_userdata = nullptr; }; - RID_Owner<UniformSet, true> uniform_set_owner; + RID_Owner<UniformSet> uniform_set_owner; /*******************/ /**** PIPELINES ****/ @@ -791,7 +791,7 @@ class RenderingDeviceVulkan : public RenderingDevice { uint32_t push_constant_stages_mask = 0; }; - RID_Owner<RenderPipeline, true> render_pipeline_owner; + RID_Owner<RenderPipeline> render_pipeline_owner; struct PipelineCacheHeader { uint32_t magic; @@ -830,7 +830,7 @@ class RenderingDeviceVulkan : public RenderingDevice { uint32_t local_group_size[3] = { 0, 0, 0 }; }; - RID_Owner<ComputePipeline, true> compute_pipeline_owner; + RID_Owner<ComputePipeline> compute_pipeline_owner; /*******************/ /**** DRAW LIST ****/ @@ -931,7 +931,7 @@ class RenderingDeviceVulkan : public RenderingDevice { void _draw_list_insert_clear_region(DrawList *p_draw_list, Framebuffer *p_framebuffer, Point2i p_viewport_offset, Point2i p_viewport_size, bool p_clear_color, const Vector<Color> &p_clear_colors, bool p_clear_depth, float p_depth, uint32_t p_stencil); Error _draw_list_setup_framebuffer(Framebuffer *p_framebuffer, InitialAction p_initial_color_action, FinalAction p_final_color_action, InitialAction p_initial_depth_action, FinalAction p_final_depth_action, VkFramebuffer *r_framebuffer, VkRenderPass *r_render_pass, uint32_t *r_subpass_count); - Error _draw_list_render_pass_begin(Framebuffer *framebuffer, InitialAction p_initial_color_action, FinalAction p_final_color_action, InitialAction p_initial_depth_action, FinalAction p_final_depth_action, const Vector<Color> &p_clear_colors, float p_clear_depth, uint32_t p_clear_stencil, Point2i viewport_offset, Point2i viewport_size, VkFramebuffer vkframebuffer, VkRenderPass render_pass, VkCommandBuffer command_buffer, VkSubpassContents subpass_contents, const Vector<RID> &p_storage_textures); + Error _draw_list_render_pass_begin(Framebuffer *framebuffer, InitialAction p_initial_color_action, FinalAction p_final_color_action, InitialAction p_initial_depth_action, FinalAction p_final_depth_action, const Vector<Color> &p_clear_colors, float p_clear_depth, uint32_t p_clear_stencil, Point2i viewport_offset, Point2i viewport_size, VkFramebuffer vkframebuffer, VkRenderPass render_pass, VkCommandBuffer command_buffer, VkSubpassContents subpass_contents, const Vector<RID> &p_storage_textures, bool p_constrained_to_region); _FORCE_INLINE_ DrawList *_get_draw_list_ptr(DrawListID p_id); Buffer *_get_buffer_from_owner(RID p_buffer, VkPipelineStageFlags &dst_stage_mask, VkAccessFlags &dst_access, BitField<BarrierMask> p_post_barrier); Error _draw_list_allocate(const Rect2i &p_viewport, uint32_t p_splits, uint32_t p_subpass); @@ -1015,8 +1015,13 @@ class RenderingDeviceVulkan : public RenderingDevice { List<ComputePipeline> compute_pipelines_to_dispose_of; VkCommandPool command_pool = VK_NULL_HANDLE; - VkCommandBuffer setup_command_buffer = VK_NULL_HANDLE; // Used at the beginning of every frame for set-up. - VkCommandBuffer draw_command_buffer = VK_NULL_HANDLE; // Used at the beginning of every frame for set-up. + // Used for filling up newly created buffers with data provided on creation. + // Primarily intended to be accessed by worker threads. + // Ideally this cmd buffer should use an async transfer queue. + VkCommandBuffer setup_command_buffer = VK_NULL_HANDLE; + // The main cmd buffer for drawing and compute. + // Primarily intended to be used by the main thread to do most stuff. + VkCommandBuffer draw_command_buffer = VK_NULL_HANDLE; struct Timestamp { String description; diff --git a/editor/action_map_editor.cpp b/editor/action_map_editor.cpp index d47b315c40..ab923f99fe 100644 --- a/editor/action_map_editor.cpp +++ b/editor/action_map_editor.cpp @@ -168,7 +168,7 @@ void ActionMapEditor::_tree_button_pressed(Object *p_item, int p_column, int p_i current_action_name = item->get_meta("__name"); current_action_event_index = -1; - event_config_dialog->popup_and_configure(); + event_config_dialog->popup_and_configure(Ref<InputEvent>(), current_action_name); } break; case ActionMapEditor::BUTTON_EDIT_EVENT: { // Action and Action name is located on the parent of the event. @@ -179,7 +179,7 @@ void ActionMapEditor::_tree_button_pressed(Object *p_item, int p_column, int p_i Ref<InputEvent> ie = item->get_meta("__event"); if (ie.is_valid()) { - event_config_dialog->popup_and_configure(ie); + event_config_dialog->popup_and_configure(ie, current_action_name); } } break; case ActionMapEditor::BUTTON_REMOVE_ACTION: { diff --git a/editor/animation_bezier_editor.cpp b/editor/animation_bezier_editor.cpp index d6d3e34678..08306256f1 100644 --- a/editor/animation_bezier_editor.cpp +++ b/editor/animation_bezier_editor.cpp @@ -1672,7 +1672,7 @@ void AnimationBezierTrackEdit::_bind_methods() { ClassDB::bind_method(D_METHOD("_update_locked_tracks_after"), &AnimationBezierTrackEdit::_update_locked_tracks_after); ClassDB::bind_method(D_METHOD("_bezier_track_insert_key"), &AnimationBezierTrackEdit::_bezier_track_insert_key); - ADD_SIGNAL(MethodInfo("timeline_changed", PropertyInfo(Variant::FLOAT, "position"), PropertyInfo(Variant::BOOL, "drag"))); + ADD_SIGNAL(MethodInfo("timeline_changed", PropertyInfo(Variant::FLOAT, "position"))); ADD_SIGNAL(MethodInfo("remove_request", PropertyInfo(Variant::INT, "track"))); ADD_SIGNAL(MethodInfo("insert_key", PropertyInfo(Variant::FLOAT, "offset"))); ADD_SIGNAL(MethodInfo("select_key", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::BOOL, "single"), PropertyInfo(Variant::INT, "track"))); diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index cf36a42be4..8268cf10ae 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -306,10 +306,14 @@ bool AnimationTrackKeyEdit::_set(const StringName &p_name, const Variant &p_valu setting = true; undo_redo->create_action(TTR("Animation Change Keyframe Value"), UndoRedo::MERGE_ENDS); - int prev = animation->bezier_track_get_key_handle_mode(track, key); - undo_redo->add_do_method(this, "_bezier_track_set_key_handle_mode", animation.ptr(), track, key, value); - undo_redo->add_undo_method(this, "_bezier_track_set_key_handle_mode", animation.ptr(), track, key, prev); + int prev_mode = animation->bezier_track_get_key_handle_mode(track, key); + Vector2 prev_in_handle = animation->bezier_track_get_key_in_handle(track, key); + Vector2 prev_out_handle = animation->bezier_track_get_key_out_handle(track, key); + undo_redo->add_do_method(editor, "_bezier_track_set_key_handle_mode", animation.ptr(), track, key, value); undo_redo->add_do_method(this, "_update_obj", animation); + undo_redo->add_undo_method(editor, "_bezier_track_set_key_handle_mode", animation.ptr(), track, key, prev_mode); + undo_redo->add_undo_method(animation.ptr(), "bezier_track_set_key_in_handle", track, key, prev_in_handle); + undo_redo->add_undo_method(animation.ptr(), "bezier_track_set_key_out_handle", track, key, prev_out_handle); undo_redo->add_undo_method(this, "_update_obj", animation); undo_redo->commit_action(); @@ -857,8 +861,8 @@ bool AnimationMultiTrackKeyEdit::_set(const StringName &p_name, const Variant &p undo_redo->create_action(TTR("Animation Multi Change Keyframe Value"), UndoRedo::MERGE_ENDS); } Vector2 prev = animation->bezier_track_get_key_in_handle(track, key); - undo_redo->add_do_method(this, "_bezier_track_set_key_in_handle", track, key, value); - undo_redo->add_undo_method(this, "_bezier_track_set_key_in_handle", track, key, prev); + undo_redo->add_do_method(animation.ptr(), "bezier_track_set_key_in_handle", track, key, value); + undo_redo->add_undo_method(animation.ptr(), "bezier_track_set_key_in_handle", track, key, prev); update_obj = true; } else if (name == "out_handle") { const Variant &value = p_value; @@ -878,9 +882,13 @@ bool AnimationMultiTrackKeyEdit::_set(const StringName &p_name, const Variant &p setting = true; undo_redo->create_action(TTR("Animation Multi Change Keyframe Value"), UndoRedo::MERGE_ENDS); } - int prev = animation->bezier_track_get_key_handle_mode(track, key); - undo_redo->add_do_method(this, "_bezier_track_set_key_handle_mode", animation.ptr(), track, key, value); - undo_redo->add_undo_method(this, "_bezier_track_set_key_handle_mode", animation.ptr(), track, key, prev); + int prev_mode = animation->bezier_track_get_key_handle_mode(track, key); + Vector2 prev_in_handle = animation->bezier_track_get_key_in_handle(track, key); + Vector2 prev_out_handle = animation->bezier_track_get_key_out_handle(track, key); + undo_redo->add_do_method(editor, "_bezier_track_set_key_handle_mode", animation.ptr(), track, key, value); + undo_redo->add_undo_method(editor, "_bezier_track_set_key_handle_mode", animation.ptr(), track, key, prev_mode); + undo_redo->add_undo_method(animation.ptr(), "bezier_track_set_key_in_handle", track, key, prev_in_handle); + undo_redo->add_undo_method(animation.ptr(), "bezier_track_set_key_out_handle", track, key, prev_out_handle); update_obj = true; } } break; @@ -1683,7 +1691,7 @@ void AnimationTimelineEdit::gui_input(const Ref<InputEvent> &p_event) { int x = mb->get_position().x - get_name_limit(); float ofs = x / get_zoom_scale() + get_value(); - emit_signal(SNAME("timeline_changed"), ofs, false, mb->is_alt_pressed()); + emit_signal(SNAME("timeline_changed"), ofs, mb->is_alt_pressed()); dragging_timeline = true; } } @@ -1705,7 +1713,7 @@ void AnimationTimelineEdit::gui_input(const Ref<InputEvent> &p_event) { if (dragging_timeline) { int x = mm->get_position().x - get_name_limit(); float ofs = x / get_zoom_scale() + get_value(); - emit_signal(SNAME("timeline_changed"), ofs, false, mm->is_alt_pressed()); + emit_signal(SNAME("timeline_changed"), ofs, mm->is_alt_pressed()); } } } @@ -1748,7 +1756,7 @@ void AnimationTimelineEdit::_track_added(int p_track) { void AnimationTimelineEdit::_bind_methods() { ADD_SIGNAL(MethodInfo("zoom_changed")); ADD_SIGNAL(MethodInfo("name_limit_changed")); - ADD_SIGNAL(MethodInfo("timeline_changed", PropertyInfo(Variant::FLOAT, "position"), PropertyInfo(Variant::BOOL, "drag"), PropertyInfo(Variant::BOOL, "timeline_only"))); + ADD_SIGNAL(MethodInfo("timeline_changed", PropertyInfo(Variant::FLOAT, "position"), PropertyInfo(Variant::BOOL, "timeline_only"))); ADD_SIGNAL(MethodInfo("track_added", PropertyInfo(Variant::INT, "track"))); ADD_SIGNAL(MethodInfo("length_changed", PropertyInfo(Variant::FLOAT, "size"))); @@ -3148,7 +3156,7 @@ void AnimationTrackEdit::append_to_selection(const Rect2 &p_box, bool p_deselect } void AnimationTrackEdit::_bind_methods() { - ADD_SIGNAL(MethodInfo("timeline_changed", PropertyInfo(Variant::FLOAT, "position"), PropertyInfo(Variant::BOOL, "drag"), PropertyInfo(Variant::BOOL, "timeline_only"))); + ADD_SIGNAL(MethodInfo("timeline_changed", PropertyInfo(Variant::FLOAT, "position"), PropertyInfo(Variant::BOOL, "timeline_only"))); ADD_SIGNAL(MethodInfo("remove_request", PropertyInfo(Variant::INT, "track"))); ADD_SIGNAL(MethodInfo("dropped", PropertyInfo(Variant::INT, "from_track"), PropertyInfo(Variant::INT, "to_track"))); ADD_SIGNAL(MethodInfo("insert_key", PropertyInfo(Variant::FLOAT, "offset"))); @@ -3468,8 +3476,8 @@ void AnimationTrackEditor::_name_limit_changed() { _redraw_tracks(); } -void AnimationTrackEditor::_timeline_changed(float p_new_pos, bool p_drag, bool p_timeline_only) { - emit_signal(SNAME("timeline_changed"), p_new_pos, p_drag, p_timeline_only); +void AnimationTrackEditor::_timeline_changed(float p_new_pos, bool p_timeline_only) { + emit_signal(SNAME("timeline_changed"), p_new_pos, p_timeline_only); } void AnimationTrackEditor::_track_remove_request(int p_track) { @@ -5175,6 +5183,7 @@ void AnimationTrackEditor::_update_key_edit() { key_edit->animation_read_only = read_only; key_edit->track = selection.front()->key().track; key_edit->use_fps = timeline->is_using_fps(); + key_edit->editor = this; int key_id = selection.front()->key().key; if (key_id >= animation->track_get_key_count(key_edit->track)) { @@ -5194,6 +5203,7 @@ void AnimationTrackEditor::_update_key_edit() { multi_key_edit = memnew(AnimationMultiTrackKeyEdit); multi_key_edit->animation = animation; multi_key_edit->animation_read_only = read_only; + multi_key_edit->editor = this; RBMap<int, List<float>> key_ofs_map; RBMap<int, NodePath> base_map; @@ -5575,7 +5585,7 @@ void AnimationTrackEditor::goto_prev_step(bool p_from_mouse_event) { pos = 0; } set_anim_pos(pos); - emit_signal(SNAME("timeline_changed"), pos, true, false); + emit_signal(SNAME("timeline_changed"), pos, false); } void AnimationTrackEditor::goto_next_step(bool p_from_mouse_event, bool p_timeline_only) { @@ -5602,7 +5612,7 @@ void AnimationTrackEditor::goto_next_step(bool p_from_mouse_event, bool p_timeli } set_anim_pos(pos); - emit_signal(SNAME("timeline_changed"), pos, true, p_timeline_only); + emit_signal(SNAME("timeline_changed"), pos, p_timeline_only); } void AnimationTrackEditor::_edit_menu_pressed(int p_option) { @@ -6374,7 +6384,7 @@ void AnimationTrackEditor::_bind_methods() { ClassDB::bind_method(D_METHOD("_bezier_track_set_key_handle_mode", "animation", "track_idx", "key_idx", "key_handle_mode", "key_handle_set_mode"), &AnimationTrackEditor::_bezier_track_set_key_handle_mode, DEFVAL(Animation::HANDLE_SET_MODE_NONE)); - ADD_SIGNAL(MethodInfo("timeline_changed", PropertyInfo(Variant::FLOAT, "position"), PropertyInfo(Variant::BOOL, "drag"), PropertyInfo(Variant::BOOL, "timeline_only"))); + ADD_SIGNAL(MethodInfo("timeline_changed", PropertyInfo(Variant::FLOAT, "position"), PropertyInfo(Variant::BOOL, "timeline_only"))); ADD_SIGNAL(MethodInfo("keying_changed")); ADD_SIGNAL(MethodInfo("animation_len_changed", PropertyInfo(Variant::FLOAT, "len"))); ADD_SIGNAL(MethodInfo("animation_step_changed", PropertyInfo(Variant::FLOAT, "step"))); diff --git a/editor/animation_track_editor.h b/editor/animation_track_editor.h index 5592d43ffe..4b9849b26c 100644 --- a/editor/animation_track_editor.h +++ b/editor/animation_track_editor.h @@ -68,6 +68,7 @@ public: PropertyInfo hint; NodePath base; bool use_fps = false; + AnimationTrackEditor *editor = nullptr; bool _hide_script_from_inspector() { return true; } bool _hide_metadata_from_inspector() { return true; } @@ -105,6 +106,7 @@ public: Node *root_path = nullptr; bool use_fps = false; + AnimationTrackEditor *editor = nullptr; bool _hide_script_from_inspector() { return true; } bool _hide_metadata_from_inspector() { return true; } @@ -409,7 +411,7 @@ class AnimationTrackEditor : public VBoxContainer { void _check_bezier_exist(); void _name_limit_changed(); - void _timeline_changed(float p_new_pos, bool p_drag, bool p_timeline_only); + void _timeline_changed(float p_new_pos, bool p_timeline_only); void _track_remove_request(int p_track); void _animation_track_remove_request(int p_track, Ref<Animation> p_from_animation); void _track_grab_focus(int p_track); diff --git a/editor/animation_track_editor_plugins.cpp b/editor/animation_track_editor_plugins.cpp index 91a0f213ec..390b722b7b 100644 --- a/editor/animation_track_editor_plugins.cpp +++ b/editor/animation_track_editor_plugins.cpp @@ -973,8 +973,7 @@ bool AnimationTrackEditTypeAudio::can_drop_data(const Point2 &p_point, const Var Vector<String> files = drag_data["files"]; if (files.size() == 1) { - String file = files[0]; - Ref<AudioStream> res = ResourceLoader::load(file); + Ref<AudioStream> res = ResourceLoader::load(files[0]); if (res.is_valid()) { return true; } @@ -995,8 +994,7 @@ void AnimationTrackEditTypeAudio::drop_data(const Point2 &p_point, const Variant Vector<String> files = drag_data["files"]; if (files.size() == 1) { - String file = files[0]; - stream = ResourceLoader::load(file); + stream = ResourceLoader::load(files[0]); } } diff --git a/editor/dependency_editor.h b/editor/dependency_editor.h index 0979606716..d43b12f1d2 100644 --- a/editor/dependency_editor.h +++ b/editor/dependency_editor.h @@ -68,6 +68,10 @@ public: DependencyEditor(); }; +#ifdef MINGW_ENABLED +#undef FILE_OPEN +#endif + class DependencyEditorOwners : public AcceptDialog { GDCLASS(DependencyEditorOwners, AcceptDialog); diff --git a/editor/editor_about.cpp b/editor/editor_about.cpp index f6360db569..672697bab0 100644 --- a/editor/editor_about.cpp +++ b/editor/editor_about.cpp @@ -39,29 +39,25 @@ // The metadata key used to store and retrieve the version text to copy to the clipboard. const String EditorAbout::META_TEXT_TO_COPY = "text_to_copy"; -void EditorAbout::_theme_changed() { - const Ref<Font> font = get_theme_font(SNAME("source"), EditorStringName(EditorFonts)); - const int font_size = get_theme_font_size(SNAME("source_size"), EditorStringName(EditorFonts)); - - _tpl_text->begin_bulk_theme_override(); - _tpl_text->add_theme_font_override("normal_font", font); - _tpl_text->add_theme_font_size_override("normal_font_size", font_size); - _tpl_text->add_theme_constant_override("line_separation", 4 * EDSCALE); - _tpl_text->end_bulk_theme_override(); - - _license_text->begin_bulk_theme_override(); - _license_text->add_theme_font_override("normal_font", font); - _license_text->add_theme_font_size_override("normal_font_size", font_size); - _license_text->add_theme_constant_override("line_separation", 4 * EDSCALE); - _license_text->end_bulk_theme_override(); - - _logo->set_texture(get_editor_theme_icon(SNAME("Logo"))); -} - void EditorAbout::_notification(int p_what) { switch (p_what) { - case NOTIFICATION_ENTER_TREE: { - _theme_changed(); + case NOTIFICATION_THEME_CHANGED: { + const Ref<Font> font = get_theme_font(SNAME("source"), EditorStringName(EditorFonts)); + const int font_size = get_theme_font_size(SNAME("source_size"), EditorStringName(EditorFonts)); + + _tpl_text->begin_bulk_theme_override(); + _tpl_text->add_theme_font_override("normal_font", font); + _tpl_text->add_theme_font_size_override("normal_font_size", font_size); + _tpl_text->add_theme_constant_override("line_separation", 4 * EDSCALE); + _tpl_text->end_bulk_theme_override(); + + _license_text->begin_bulk_theme_override(); + _license_text->add_theme_font_override("normal_font", font); + _license_text->add_theme_font_size_override("normal_font_size", font_size); + _license_text->add_theme_constant_override("line_separation", 4 * EDSCALE); + _license_text->end_bulk_theme_override(); + + _logo->set_texture(get_editor_theme_icon(SNAME("Logo"))); } break; } } @@ -128,12 +124,12 @@ EditorAbout::EditorAbout() { set_hide_on_ok(true); VBoxContainer *vbc = memnew(VBoxContainer); - vbc->connect("theme_changed", callable_mp(this, &EditorAbout::_theme_changed)); + add_child(vbc); + HBoxContainer *hbc = memnew(HBoxContainer); hbc->set_h_size_flags(Control::SIZE_EXPAND_FILL); hbc->set_alignment(BoxContainer::ALIGNMENT_CENTER); hbc->add_theme_constant_override("separation", 30 * EDSCALE); - add_child(vbc); vbc->add_child(hbc); _logo = memnew(TextureRect); diff --git a/editor/editor_about.h b/editor/editor_about.h index 0bc863e3c1..22b5f3ded0 100644 --- a/editor/editor_about.h +++ b/editor/editor_about.h @@ -64,8 +64,6 @@ private: RichTextLabel *_tpl_text = nullptr; TextureRect *_logo = nullptr; - void _theme_changed(); - protected: void _notification(int p_what); static void _bind_methods(); diff --git a/editor/editor_audio_buses.cpp b/editor/editor_audio_buses.cpp index f244bc0da8..f4a9e0a2ef 100644 --- a/editor/editor_audio_buses.cpp +++ b/editor/editor_audio_buses.cpp @@ -912,6 +912,7 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) { vb->add_child(effects); effects->connect("item_edited", callable_mp(this, &EditorAudioBus::_effect_edited)); effects->connect("cell_selected", callable_mp(this, &EditorAudioBus::_effect_selected)); + effects->connect("focus_exited", callable_mp(effects, &Tree::deselect_all)); effects->set_edit_checkbox_cell_only_when_checkbox_is_pressed(true); SET_DRAG_FORWARDING_GCD(effects, EditorAudioBus); effects->connect("item_mouse_selected", callable_mp(this, &EditorAudioBus::_effect_rmb)); @@ -1192,7 +1193,7 @@ void EditorAudioBuses::_server_save() { } void EditorAudioBuses::_select_layout() { - FileSystemDock::get_singleton()->select_file(edited_path); + FileSystemDock::get_singleton()->navigate_to_path(edited_path); } void EditorAudioBuses::_save_as_layout() { diff --git a/editor/editor_autoload_settings.cpp b/editor/editor_autoload_settings.cpp index be05bfea68..204b717296 100644 --- a/editor/editor_autoload_settings.cpp +++ b/editor/editor_autoload_settings.cpp @@ -407,31 +407,30 @@ Node *EditorAutoloadSettings::_create_autoload(const String &p_path) { scn.instantiate(); scn->set_path(p_path); scn->reload_from_file(); - ERR_FAIL_COND_V_MSG(!scn.is_valid(), nullptr, vformat("Can't autoload: %s.", p_path)); + ERR_FAIL_COND_V_MSG(!scn.is_valid(), nullptr, vformat("Failed to create an autoload, can't load from path: %s.", p_path)); if (scn.is_valid()) { n = scn->instantiate(); } } else { Ref<Resource> res = ResourceLoader::load(p_path); - ERR_FAIL_COND_V_MSG(res.is_null(), nullptr, vformat("Can't autoload: %s.", p_path)); + ERR_FAIL_COND_V_MSG(res.is_null(), nullptr, vformat("Failed to create an autoload, can't load from path: %s.", p_path)); Ref<Script> scr = res; if (scr.is_valid()) { StringName ibt = scr->get_instance_base_type(); bool valid_type = ClassDB::is_parent_class(ibt, "Node"); - ERR_FAIL_COND_V_MSG(!valid_type, nullptr, vformat("Script does not inherit from Node: %s.", p_path)); + ERR_FAIL_COND_V_MSG(!valid_type, nullptr, vformat("Failed to create an autoload, script '%s' does not inherit from 'Node'.", p_path)); Object *obj = ClassDB::instantiate(ibt); - - ERR_FAIL_NULL_V_MSG(obj, nullptr, vformat("Cannot instance script for Autoload, expected 'Node' inheritance, got: %s.", ibt)); + ERR_FAIL_NULL_V_MSG(obj, nullptr, vformat("Failed to create an autoload, cannot instantiate '%s'.", ibt)); n = Object::cast_to<Node>(obj); n->set_script(scr); } } - ERR_FAIL_NULL_V_MSG(n, nullptr, vformat("Path in Autoload not a node or script: %s.", p_path)); + ERR_FAIL_NULL_V_MSG(n, nullptr, vformat("Failed to create an autoload, path is not pointing to a scene or a script: %s.", p_path)); return n; } diff --git a/editor/editor_command_palette.cpp b/editor/editor_command_palette.cpp index da970980eb..6626251ee6 100644 --- a/editor/editor_command_palette.cpp +++ b/editor/editor_command_palette.cpp @@ -129,8 +129,8 @@ void EditorCommandPalette::_update_command_search(const String &search_text) { section->set_text(0, item_name); section->set_selectable(0, false); section->set_selectable(1, false); - section->set_custom_bg_color(0, search_options->get_theme_color(SNAME("prop_subsection"), EditorStringName(Editor))); - section->set_custom_bg_color(1, search_options->get_theme_color(SNAME("prop_subsection"), EditorStringName(Editor))); + section->set_custom_bg_color(0, get_theme_color(SNAME("prop_subsection"), EditorStringName(Editor))); + section->set_custom_bg_color(1, get_theme_color(SNAME("prop_subsection"), EditorStringName(Editor))); sections[section_name] = section; } @@ -164,6 +164,10 @@ void EditorCommandPalette::_notification(int p_what) { was_showed = true; } } break; + + case NOTIFICATION_THEME_CHANGED: { + command_search_box->set_right_icon(get_editor_theme_icon(SNAME("Search"))); + } break; } } @@ -303,10 +307,6 @@ Ref<Shortcut> EditorCommandPalette::add_shortcut_command(const String &p_command return p_shortcut; } -void EditorCommandPalette::_theme_changed() { - command_search_box->set_right_icon(search_options->get_editor_theme_icon(SNAME("Search"))); -} - void EditorCommandPalette::_save_history() const { Dictionary command_history; @@ -330,7 +330,6 @@ EditorCommandPalette::EditorCommandPalette() { connect("confirmed", callable_mp(this, &EditorCommandPalette::_confirmed)); VBoxContainer *vbc = memnew(VBoxContainer); - vbc->connect("theme_changed", callable_mp(this, &EditorCommandPalette::_theme_changed)); add_child(vbc); command_search_box = memnew(LineEdit); diff --git a/editor/editor_command_palette.h b/editor/editor_command_palette.h index d2f25f6ec5..01fa6896a9 100644 --- a/editor/editor_command_palette.h +++ b/editor/editor_command_palette.h @@ -83,10 +83,9 @@ class EditorCommandPalette : public ConfirmationDialog { float _score_path(const String &p_search, const String &p_path); void _sbox_input(const Ref<InputEvent> &p_ie); void _confirmed(); - void _update_command_keys(); void _add_command(String p_command_name, String p_key_name, Callable p_binded_action, String p_shortcut_text = "None"); - void _theme_changed(); void _save_history() const; + EditorCommandPalette(); protected: diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp index e4f198a529..fe8c42ea3b 100644 --- a/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -283,7 +283,7 @@ void EditorData::copy_object_params(Object *p_object) { p_object->get_property_list(&pinfo); for (const PropertyInfo &E : pinfo) { - if (!(E.usage & PROPERTY_USAGE_EDITOR) || E.name == "script" || E.name == "scripts") { + if (!(E.usage & PROPERTY_USAGE_EDITOR) || E.name == "script" || E.name == "scripts" || E.name == "resource_path") { continue; } diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index e81f71e0e0..6d1e1eaaa0 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -2154,6 +2154,9 @@ Error EditorFileSystem::_reimport_file(const String &p_file, const HashMap<Strin } } + // Update cpos, newly created files could've changed the index of the reimported p_file. + _find_file(p_file, &fs, cpos); + //update modified times, to avoid reimport fs->files[cpos]->modified_time = FileAccess::get_modified_time(p_file); fs->files[cpos]->import_modified_time = FileAccess::get_modified_time(p_file + ".import"); diff --git a/editor/editor_fonts.cpp b/editor/editor_fonts.cpp index 6c51be8361..1e1dff61b9 100644 --- a/editor/editor_fonts.cpp +++ b/editor/editor_fonts.cpp @@ -107,7 +107,7 @@ Ref<FontVariation> make_bold_font(const Ref<Font> &p_font, double p_embolden, Ty } void editor_register_fonts(Ref<Theme> p_theme) { - OS::get_singleton()->benchmark_begin_measure("editor_register_fonts"); + OS::get_singleton()->benchmark_begin_measure("EditorTheme", "Register Fonts"); Ref<DirAccess> dir = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); TextServer::FontAntialiasing font_antialiasing = (TextServer::FontAntialiasing)(int)EDITOR_GET("interface/editor/font_antialiasing"); @@ -445,5 +445,5 @@ void editor_register_fonts(Ref<Theme> p_theme) { p_theme->set_font_size("status_source_size", EditorStringName(EditorFonts), default_font_size); p_theme->set_font("status_source", EditorStringName(EditorFonts), mono_other_fc); - OS::get_singleton()->benchmark_end_measure("editor_register_fonts"); + OS::get_singleton()->benchmark_end_measure("EditorTheme", "Register Fonts"); } diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index 10ab733c2b..2b1ab4ca02 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -2360,6 +2360,7 @@ void EditorHelp::_add_text(const String &p_bbcode) { _add_text_to_rt(p_bbcode, class_desc, this, edited_class); } +int EditorHelp::doc_generation_count = 0; String EditorHelp::doc_version_hash; Thread EditorHelp::worker_thread; @@ -2392,6 +2393,8 @@ void EditorHelp::_load_doc_thread(void *p_udata) { // We have to go back to the main thread to start from scratch, bypassing any possibly existing cache. callable_mp_static(&EditorHelp::generate_doc).bind(false).call_deferred(); } + + OS::get_singleton()->benchmark_end_measure("EditorHelp", vformat("Generate Documentation (Run %d)", doc_generation_count)); } void EditorHelp::_gen_doc_thread(void *p_udata) { @@ -2417,6 +2420,8 @@ void EditorHelp::_gen_doc_thread(void *p_udata) { if (err) { ERR_PRINT("Cannot save editor help cache (" + get_cache_full_path() + ")."); } + + OS::get_singleton()->benchmark_end_measure("EditorHelp", vformat("Generate Documentation (Run %d)", doc_generation_count)); } void EditorHelp::_gen_extensions_docs() { @@ -2424,7 +2429,8 @@ void EditorHelp::_gen_extensions_docs() { } void EditorHelp::generate_doc(bool p_use_cache) { - OS::get_singleton()->benchmark_begin_measure("EditorHelp::generate_doc"); + doc_generation_count++; + OS::get_singleton()->benchmark_begin_measure("EditorHelp", vformat("Generate Documentation (Run %d)", doc_generation_count)); // In case not the first attempt. _wait_for_thread(); @@ -2444,8 +2450,6 @@ void EditorHelp::generate_doc(bool p_use_cache) { doc->generate(); worker_thread.start(_gen_doc_thread, nullptr); } - - OS::get_singleton()->benchmark_end_measure("EditorHelp::generate_doc"); } void EditorHelp::_toggle_scripts_pressed() { diff --git a/editor/editor_help.h b/editor/editor_help.h index d2d05a8603..ff440a679a 100644 --- a/editor/editor_help.h +++ b/editor/editor_help.h @@ -187,6 +187,7 @@ class EditorHelp : public VBoxContainer { String _fix_constant(const String &p_constant) const; void _toggle_scripts_pressed(); + static int doc_generation_count; static String doc_version_hash; static Thread worker_thread; diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 207f524194..c514ca7ba7 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -627,7 +627,7 @@ void EditorNode::_notification(int p_what) { if (requested_first_scan) { requested_first_scan = false; - OS::get_singleton()->benchmark_begin_measure("editor_scan_and_import"); + OS::get_singleton()->benchmark_begin_measure("Editor", "First Scan"); if (run_surface_upgrade_tool) { run_surface_upgrade_tool = false; @@ -974,6 +974,9 @@ void EditorNode::_fs_changed() { } else { // Normal project export. String config_error; bool missing_templates; + if (export_defer.android_build_template) { + export_template_manager->install_android_template(); + } if (!platform->can_export(export_preset, config_error, missing_templates, export_defer.debug)) { ERR_PRINT(vformat("Cannot export project with preset \"%s\" due to configuration errors:\n%s", preset_name, config_error)); err = missing_templates ? ERR_FILE_NOT_FOUND : ERR_UNCONFIGURED; @@ -1023,6 +1026,12 @@ void EditorNode::_resources_reimported(const Vector<String> &p_resources) { } } + // Editor may crash when related animation is playing while re-importing GLTF scene, stop it in advance. + AnimationPlayer *ap = AnimationPlayerEditor::get_singleton()->get_player(); + if (ap && scenes.size() > 0) { + ap->stop(true); + } + for (const String &E : scenes) { reload_scene(E); reload_instances_with_path_in_edited_scenes(E); @@ -1035,31 +1044,32 @@ void EditorNode::_sources_changed(bool p_exist) { if (waiting_for_first_scan) { waiting_for_first_scan = false; - OS::get_singleton()->benchmark_end_measure("editor_scan_and_import"); + OS::get_singleton()->benchmark_end_measure("Editor", "First Scan"); // Reload the global shader variables, but this time // loading textures, as they are now properly imported. RenderingServer::get_singleton()->global_shader_parameters_load_settings(true); - // Start preview thread now that it's safe. - if (!singleton->cmdline_export_mode) { - EditorResourcePreview::get_singleton()->start(); - } - _load_editor_layout(); if (!defer_load_scene.is_empty()) { - OS::get_singleton()->benchmark_begin_measure("editor_load_scene"); + OS::get_singleton()->benchmark_begin_measure("Editor", "Load Scene"); + load_scene(defer_load_scene); defer_load_scene = ""; - OS::get_singleton()->benchmark_end_measure("editor_load_scene"); + OS::get_singleton()->benchmark_end_measure("Editor", "Load Scene"); OS::get_singleton()->benchmark_dump(); } if (SurfaceUpgradeTool::get_singleton()->is_show_requested()) { SurfaceUpgradeTool::get_singleton()->show_popup(); } + + // Start preview thread now that it's safe. + if (!singleton->cmdline_export_mode) { + EditorResourcePreview::get_singleton()->start(); + } } } @@ -1755,6 +1765,10 @@ static void _reset_animation_mixers(Node *p_node, List<Pair<AnimationMixer *, Re } void EditorNode::_save_scene(String p_file, int idx) { + if (!saving_scene.is_empty() && saving_scene == p_file) { + return; + } + Node *scene = editor_data.get_edited_scene_root(idx); if (!scene) { @@ -1811,7 +1825,9 @@ void EditorNode::_save_scene(String p_file, int idx) { emit_signal(SNAME("scene_saved"), p_file); _save_external_resources(); + saving_scene = p_file; // Some editors may save scenes of built-in resources as external data, so avoid saving this scene again. editor_data.save_editor_external_data(); + saving_scene = ""; for (Pair<AnimationMixer *, Ref<AnimatedValuesBackup>> &E : anim_backups) { E.first->restore(E.second); @@ -2931,8 +2947,13 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) { feature_profile_manager->popup_centered_clamped(Size2(900, 800) * EDSCALE, 0.8); } break; case SETTINGS_TOGGLE_FULLSCREEN: { - DisplayServer::get_singleton()->window_set_mode(DisplayServer::get_singleton()->window_get_mode() == DisplayServer::WINDOW_MODE_FULLSCREEN ? DisplayServer::WINDOW_MODE_WINDOWED : DisplayServer::WINDOW_MODE_FULLSCREEN); - + DisplayServer::WindowMode mode = DisplayServer::get_singleton()->window_get_mode(); + if (mode == DisplayServer::WINDOW_MODE_FULLSCREEN || mode == DisplayServer::WINDOW_MODE_EXCLUSIVE_FULLSCREEN) { + DisplayServer::get_singleton()->window_set_mode(prev_mode); + } else { + prev_mode = mode; + DisplayServer::get_singleton()->window_set_mode(DisplayServer::WINDOW_MODE_FULLSCREEN); + } } break; case EDITOR_SCREENSHOT: { screenshot_timer->start(); @@ -3042,6 +3063,9 @@ void EditorNode::_tool_menu_option(int p_idx) { case TOOLS_ORPHAN_RESOURCES: { orphan_resources->show(); } break; + case TOOLS_SURFACE_UPGRADE: { + surface_upgrade_dialog->popup_on_demand(); + } break; case TOOLS_CUSTOM: { if (tool_menu->get_item_submenu(p_idx) == "") { Callable callback = tool_menu->get_item_metadata(p_idx); @@ -3439,13 +3463,13 @@ void EditorNode::set_addon_plugin_enabled(const String &p_addon, bool p_enabled, } // Plugin init scripts must inherit from EditorPlugin and be tools. - if (String(scr->get_instance_base_type()) != "EditorPlugin") { - show_warning(vformat(TTR("Unable to load addon script from path: '%s' Base type is not EditorPlugin."), script_path)); + if (!ClassDB::is_parent_class(scr->get_instance_base_type(), "EditorPlugin")) { + show_warning(vformat(TTR("Unable to load addon script from path: '%s'. Base type is not 'EditorPlugin'."), script_path)); return; } if (!scr->is_tool()) { - show_warning(vformat(TTR("Unable to load addon script from path: '%s' Script is not in tool mode."), script_path)); + show_warning(vformat(TTR("Unable to load addon script from path: '%s'. Script is not in tool mode."), script_path)); return; } } @@ -3668,7 +3692,7 @@ void EditorNode::_set_current_scene_nocheck(int p_idx) { _edit_current(true); _update_title(); - scene_tabs->update_scene_tabs(); + callable_mp(scene_tabs, &EditorSceneTabs::update_scene_tabs).call_deferred(); if (tabs_to_close.is_empty()) { call_deferred(SNAME("_set_main_scene_state"), state, get_edited_scene()); // Do after everything else is done setting up. @@ -3677,8 +3701,9 @@ void EditorNode::_set_current_scene_nocheck(int p_idx) { void EditorNode::setup_color_picker(ColorPicker *p_picker) { p_picker->set_editor_settings(EditorSettings::get_singleton()); - int default_color_mode = EDITOR_GET("interface/inspector/default_color_picker_mode"); - int picker_shape = EDITOR_GET("interface/inspector/default_color_picker_shape"); + int default_color_mode = EditorSettings::get_singleton()->get_project_metadata("color_picker", "color_mode", EDITOR_GET("interface/inspector/default_color_picker_mode")); + int picker_shape = EditorSettings::get_singleton()->get_project_metadata("color_picker", "picker_shape", EDITOR_GET("interface/inspector/default_color_picker_shape")); + p_picker->set_color_mode((ColorPicker::ColorModeType)default_color_mode); p_picker->set_picker_shape((ColorPicker::PickerShapeType)picker_shape); } @@ -4645,7 +4670,7 @@ void EditorNode::_begin_first_scan() { // In headless mode, scan right away. // This allows users to continue using `godot --headless --editor --quit` to prepare a project. if (!DisplayServer::get_singleton()->window_can_draw()) { - OS::get_singleton()->benchmark_begin_measure("editor_scan_and_import"); + OS::get_singleton()->benchmark_begin_measure("Editor", "First Scan"); EditorFileSystem::get_singleton()->scan(); return; } @@ -4656,15 +4681,20 @@ void EditorNode::_begin_first_scan() { requested_first_scan = true; } -Error EditorNode::export_preset(const String &p_preset, const String &p_path, bool p_debug, bool p_pack_only) { +Error EditorNode::export_preset(const String &p_preset, const String &p_path, bool p_debug, bool p_pack_only, bool p_android_build_template) { export_defer.preset = p_preset; export_defer.path = p_path; export_defer.debug = p_debug; export_defer.pack_only = p_pack_only; + export_defer.android_build_template = p_android_build_template; cmdline_export_mode = true; return OK; } +bool EditorNode::is_project_exporting() const { + return project_export && project_export->is_exporting(); +} + void EditorNode::show_accept(const String &p_text, const String &p_title) { current_menu_option = -1; if (accept) { @@ -4704,14 +4734,15 @@ void EditorNode::_dock_floating_close_request(WindowWrapper *p_wrapper) { // Give back the dock to the original owner. Control *dock = p_wrapper->release_wrapped_control(); + int target_index = MIN(dock_slot_index, dock_slot[dock_slot_num]->get_tab_count()); dock_slot[dock_slot_num]->add_child(dock); - dock_slot[dock_slot_num]->move_child(dock, MIN(dock_slot_index, dock_slot[dock_slot_num]->get_tab_count())); - dock_slot[dock_slot_num]->set_current_tab(dock_slot_index); + dock_slot[dock_slot_num]->move_child(dock, target_index); + dock_slot[dock_slot_num]->set_current_tab(target_index); floating_docks.erase(p_wrapper); p_wrapper->queue_free(); - _update_dock_containers(); + _update_dock_slots_visibility(true); _edit_current(); } @@ -4755,38 +4786,13 @@ void EditorNode::_dock_make_float(Control *p_dock, int p_slot_index, bool p_show wrapper->restore_window(Rect2i(dock_screen_pos, dock_size), get_window()->get_current_screen()); } - _update_dock_containers(); + _update_dock_slots_visibility(true); floating_docks.push_back(wrapper); _edit_current(); } -void EditorNode::_update_dock_containers() { - for (int i = 0; i < DOCK_SLOT_MAX; i++) { - if (dock_slot[i]->get_tab_count() == 0 && dock_slot[i]->is_visible()) { - dock_slot[i]->hide(); - } - if (dock_slot[i]->get_tab_count() > 0 && !dock_slot[i]->is_visible()) { - dock_slot[i]->show(); - } - } - for (int i = 0; i < vsplits.size(); i++) { - bool in_use = dock_slot[i * 2 + 0]->get_tab_count() || dock_slot[i * 2 + 1]->get_tab_count(); - if (in_use) { - vsplits[i]->show(); - } else { - vsplits[i]->hide(); - } - } - - if (right_l_vsplit->is_visible() || right_r_vsplit->is_visible()) { - right_hsplit->show(); - } else { - right_hsplit->hide(); - } -} - void EditorNode::_dock_select_input(const Ref<InputEvent> &p_input) { Ref<InputEventMouse> me = p_input; @@ -4825,7 +4831,7 @@ void EditorNode::_dock_select_input(const Ref<InputEvent> &p_input) { dock_slot[nrect]->show(); dock_select->queue_redraw(); - _update_dock_containers(); + _update_dock_slots_visibility(true); _edit_current(); _save_editor_layout(); @@ -5115,83 +5121,44 @@ void EditorNode::_update_dock_slots_visibility(bool p_keep_selected_tabs) { right_hsplit->hide(); } else { for (int i = 0; i < DOCK_SLOT_MAX; i++) { - int tabs_visible = 0; + int first_tab_visible = -1; for (int j = 0; j < dock_slot[i]->get_tab_count(); j++) { if (!dock_slot[i]->is_tab_hidden(j)) { - tabs_visible++; + first_tab_visible = j; + break; } } - if (tabs_visible) { + if (first_tab_visible >= 0) { dock_slot[i]->show(); + if (p_keep_selected_tabs) { + int current_tab = dock_slot[i]->get_current_tab(); + if (dock_slot[i]->is_tab_hidden(current_tab)) { + dock_slot[i]->set_block_signals(true); + dock_slot[i]->select_next_available(); + dock_slot[i]->set_block_signals(false); + } + } else { + dock_slot[i]->set_block_signals(true); + dock_slot[i]->set_current_tab(first_tab_visible); + dock_slot[i]->set_block_signals(false); + } } else { dock_slot[i]->hide(); } } for (int i = 0; i < vsplits.size(); i++) { - bool in_use = dock_slot[i * 2 + 0]->get_tab_count() || dock_slot[i * 2 + 1]->get_tab_count(); - if (in_use) { - vsplits[i]->show(); - } else { - vsplits[i]->hide(); - } + bool in_use = dock_slot[i * 2 + 0]->is_visible() || dock_slot[i * 2 + 1]->is_visible(); + vsplits[i]->set_visible(in_use); } - if (!p_keep_selected_tabs) { - for (int i = 0; i < DOCK_SLOT_MAX; i++) { - if (dock_slot[i]->is_visible() && dock_slot[i]->get_tab_count()) { - dock_slot[i]->set_current_tab(0); - } - } - } - - if (right_l_vsplit->is_visible() || right_r_vsplit->is_visible()) { - right_hsplit->show(); - } else { - right_hsplit->hide(); - } + right_hsplit->set_visible(right_l_vsplit->is_visible() || right_r_vsplit->is_visible()); } } void EditorNode::_dock_tab_changed(int p_tab) { // Update visibility but don't set current tab. - - if (!docks_visible) { - for (int i = 0; i < DOCK_SLOT_MAX; i++) { - dock_slot[i]->hide(); - } - - for (int i = 0; i < vsplits.size(); i++) { - vsplits[i]->hide(); - } - - right_hsplit->hide(); - bottom_panel->hide(); - } else { - for (int i = 0; i < DOCK_SLOT_MAX; i++) { - if (dock_slot[i]->get_tab_count()) { - dock_slot[i]->show(); - } else { - dock_slot[i]->hide(); - } - } - - for (int i = 0; i < vsplits.size(); i++) { - bool in_use = dock_slot[i * 2 + 0]->get_tab_count() || dock_slot[i * 2 + 1]->get_tab_count(); - if (in_use) { - vsplits[i]->show(); - } else { - vsplits[i]->hide(); - } - } - bottom_panel->show(); - - if (right_l_vsplit->is_visible() || right_r_vsplit->is_visible()) { - right_hsplit->show(); - } else { - right_hsplit->hide(); - } - } + _update_dock_slots_visibility(true); } void EditorNode::_restore_floating_dock(const Dictionary &p_dock_dump, Control *p_dock, int p_slot_index) { @@ -5260,20 +5227,14 @@ void EditorNode::_load_docks_from_config(Ref<ConfigFile> p_layout, const String if (atidx == i) { dock_slot[i]->move_child(node, 0); } else if (atidx != -1) { - dock_slot[atidx]->remove_child(node); - - if (dock_slot[atidx]->get_tab_count() == 0) { - dock_slot[atidx]->hide(); - } - dock_slot[i]->add_child(node); - dock_slot[i]->move_child(node, 0); - dock_slot[i]->set_tab_title(0, TTRGET(node->get_name())); - dock_slot[i]->show(); + dock_slot[i]->move_tab_from_tab_container(dock_slot[atidx], dock_slot[atidx]->get_tab_idx_from_control(node), 0); } WindowWrapper *wrapper = Object::cast_to<WindowWrapper>(node); if (restore_window_on_load && floating_docks_dump.has(name)) { - _restore_floating_dock(floating_docks_dump[name], node, i); + if (!dock_slot[i]->is_tab_hidden(dock_slot[i]->get_tab_idx_from_control(node))) { + _restore_floating_dock(floating_docks_dump[name], node, i); + } } else if (wrapper) { wrapper->set_window_enabled(false); } @@ -5306,26 +5267,7 @@ void EditorNode::_load_docks_from_config(Ref<ConfigFile> p_layout, const String hsplits[i]->set_split_offset(ofs); } - for (int i = 0; i < vsplits.size(); i++) { - bool in_use = dock_slot[i * 2 + 0]->get_tab_count() || dock_slot[i * 2 + 1]->get_tab_count(); - if (in_use) { - vsplits[i]->show(); - } else { - vsplits[i]->hide(); - } - } - - if (right_l_vsplit->is_visible() || right_r_vsplit->is_visible()) { - right_hsplit->show(); - } else { - right_hsplit->hide(); - } - - for (int i = 0; i < DOCK_SLOT_MAX; i++) { - if (dock_slot[i]->is_visible() && dock_slot[i]->get_tab_count()) { - dock_slot[i]->set_current_tab(0); - } - } + _update_dock_slots_visibility(false); // FileSystemDock. @@ -6210,8 +6152,7 @@ void EditorNode::reload_instances_with_path_in_edited_scenes(const String &p_ins if (edited_scene_map.size() > 0) { // Reload the new instance. Error err; - Ref<PackedScene> instance_scene_packed_scene = ResourceLoader::load(p_instance_path, "", ResourceFormatLoader::CACHE_MODE_IGNORE, &err); - instance_scene_packed_scene->set_path(p_instance_path, true); + Ref<PackedScene> instance_scene_packed_scene = ResourceLoader::load(p_instance_path, "", ResourceFormatLoader::CACHE_MODE_REPLACE, &err); ERR_FAIL_COND(err != OK); ERR_FAIL_COND(instance_scene_packed_scene.is_null()); @@ -6318,8 +6259,7 @@ void EditorNode::reload_instances_with_path_in_edited_scenes(const String &p_ins // be properly updated. for (String path : required_load_paths) { if (!local_scene_cache.find(path)) { - current_packed_scene = ResourceLoader::load(path, "", ResourceFormatLoader::CACHE_MODE_IGNORE, &err); - current_packed_scene->set_path(path, true); + current_packed_scene = ResourceLoader::load(path, "", ResourceFormatLoader::CACHE_MODE_REPLACE, &err); local_scene_cache[path] = current_packed_scene; } else { current_packed_scene = local_scene_cache[path]; @@ -6633,6 +6573,23 @@ void EditorNode::_renderer_selected(int p_which) { _update_renderer_color(); } +void EditorNode::_add_renderer_entry(const String &p_renderer_name, bool p_mark_overridden) { + String item_text; + if (p_renderer_name == "forward_plus") { + item_text = TTR("Forward+"); + } + if (p_renderer_name == "mobile") { + item_text = TTR("Mobile"); + } + if (p_renderer_name == "gl_compatibility") { + item_text = TTR("Compatibility"); + } + if (p_mark_overridden) { + item_text += " " + TTR("(Overridden)"); + } + renderer->add_item(item_text); +} + void EditorNode::_resource_saved(Ref<Resource> p_resource, const String &p_path) { if (singleton->saving_resources_in_path.has(p_resource)) { // This is going to be handled by save_resource_in_path when the time is right. @@ -6652,6 +6609,10 @@ void EditorNode::_resource_loaded(Ref<Resource> p_resource, const String &p_path void EditorNode::_feature_profile_changed() { Ref<EditorFeatureProfile> profile = feature_profile_manager->get_current_profile(); + // FIXME: Close all floating docks to avoid crash. + for (WindowWrapper *wrapper : floating_docks) { + wrapper->set_window_enabled(false); + } TabContainer *import_tabs = cast_to<TabContainer>(ImportDock::get_singleton()->get_parent()); TabContainer *node_tabs = cast_to<TabContainer>(NodeDock::get_singleton()->get_parent()); TabContainer *fs_tabs = cast_to<TabContainer>(FileSystemDock::get_singleton()->get_parent()); @@ -6981,15 +6942,15 @@ EditorNode::EditorNode() { { Ref<EditorSceneFormatImporterCollada> import_collada; import_collada.instantiate(); - ResourceImporterScene::add_importer(import_collada); + ResourceImporterScene::add_scene_importer(import_collada); Ref<EditorOBJImporter> import_obj2; import_obj2.instantiate(); - ResourceImporterScene::add_importer(import_obj2); + ResourceImporterScene::add_scene_importer(import_obj2); Ref<EditorSceneFormatImporterESCN> import_escn; import_escn.instantiate(); - ResourceImporterScene::add_importer(import_escn); + ResourceImporterScene::add_scene_importer(import_escn); } Ref<ResourceImporterBitMap> import_bitmap; @@ -7311,13 +7272,13 @@ EditorNode::EditorNode() { project_settings_editor = memnew(ProjectSettingsEditor(&editor_data)); gui_base->add_child(project_settings_editor); - scene_import_settings = memnew(SceneImportSettings); + scene_import_settings = memnew(SceneImportSettingsDialog); gui_base->add_child(scene_import_settings); - audio_stream_import_settings = memnew(AudioStreamImportSettings); + audio_stream_import_settings = memnew(AudioStreamImportSettingsDialog); gui_base->add_child(audio_stream_import_settings); - fontdata_import_settings = memnew(DynamicFontImportSettings); + fontdata_import_settings = memnew(DynamicFontImportSettingsDialog); gui_base->add_child(fontdata_import_settings); export_template_manager = memnew(ExportTemplateManager); @@ -7396,6 +7357,20 @@ EditorNode::EditorNode() { file_menu->add_shortcut(ED_SHORTCUT_AND_COMMAND("editor/file_quit", TTR("Quit"), KeyModifierMask::CMD_OR_CTRL + Key::Q), FILE_QUIT, true); } + ED_SHORTCUT_AND_COMMAND("editor/editor_settings", TTR("Editor Settings...")); + ED_SHORTCUT_OVERRIDE("editor/editor_settings", "macos", KeyModifierMask::META + Key::COMMA); +#ifdef MACOS_ENABLED + if (global_menu) { + apple_menu = memnew(PopupMenu); + apple_menu->set_system_menu_root("_apple"); + main_menu->add_child(apple_menu); + + apple_menu->add_shortcut(ED_GET_SHORTCUT("editor/editor_settings"), SETTINGS_PREFERENCES); + apple_menu->add_separator(); + apple_menu->connect("id_pressed", callable_mp(this, &EditorNode::_menu_option)); + } +#endif + project_menu = memnew(PopupMenu); project_menu->set_name(TTR("Project")); main_menu->add_child(project_menu); @@ -7423,6 +7398,7 @@ EditorNode::EditorNode() { project_menu->add_child(tool_menu); project_menu->add_submenu_item(TTR("Tools"), "Tools"); tool_menu->add_item(TTR("Orphan Resource Explorer..."), TOOLS_ORPHAN_RESOURCES); + tool_menu->add_item(TTR("Upgrade Mesh Surfaces..."), TOOLS_SURFACE_UPGRADE); project_menu->add_separator(); project_menu->add_shortcut(ED_SHORTCUT("editor/reload_current_project", TTR("Reload Current Project")), RELOAD_CURRENT_PROJECT); @@ -7460,9 +7436,13 @@ EditorNode::EditorNode() { settings_menu->set_name(TTR("Editor")); main_menu->add_child(settings_menu); - ED_SHORTCUT_AND_COMMAND("editor/editor_settings", TTR("Editor Settings...")); - ED_SHORTCUT_OVERRIDE("editor/editor_settings", "macos", KeyModifierMask::META + Key::COMMA); +#ifdef MACOS_ENABLED + if (!global_menu) { + settings_menu->add_shortcut(ED_GET_SHORTCUT("editor/editor_settings"), SETTINGS_PREFERENCES); + } +#else settings_menu->add_shortcut(ED_GET_SHORTCUT("editor/editor_settings"), SETTINGS_PREFERENCES); +#endif settings_menu->add_shortcut(ED_SHORTCUT("editor/command_palette", TTR("Command Palette..."), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::P), HELP_COMMAND_PALETTE); settings_menu->add_separator(); @@ -7509,6 +7489,7 @@ EditorNode::EditorNode() { help_menu = memnew(PopupMenu); help_menu->set_name(TTR("Help")); + help_menu->set_system_menu_root("_help"); main_menu->add_child(help_menu); help_menu->connect("id_pressed", callable_mp(this, &EditorNode::_menu_option)); @@ -7552,7 +7533,6 @@ EditorNode::EditorNode() { renderer->set_flat(true); renderer->set_fit_to_longest_item(false); renderer->set_focus_mode(Control::FOCUS_NONE); - renderer->connect("item_selected", callable_mp(this, &EditorNode::_renderer_selected)); renderer->add_theme_font_override("font", theme->get_font(SNAME("bold"), EditorStringName(EditorFonts))); renderer->add_theme_font_size_override("font_size", theme->get_font_size(SNAME("bold_size"), EditorStringName(EditorFonts))); renderer->set_tooltip_text(TTR("Choose a renderer.")); @@ -7566,36 +7546,33 @@ EditorNode::EditorNode() { title_bar->add_child(right_menu_spacer); } - String current_renderer = GLOBAL_GET("rendering/renderer/rendering_method"); - - PackedStringArray renderers = ProjectSettings::get_singleton()->get_custom_property_info().get(StringName("rendering/renderer/rendering_method")).hint_string.split(",", false); - - // As we are doing string comparisons, keep in standard case to prevent problems with capitals - // "vulkan" in particular uses lowercase "v" in the code, and uppercase in the UI. - current_renderer = current_renderer.to_lower(); - - for (int i = 0; i < renderers.size(); i++) { - String rendering_method = renderers[i]; - - // Add the renderers name to the UI. - if (rendering_method == "forward_plus") { - renderer->add_item(TTR("Forward+")); - } - if (rendering_method == "mobile") { - renderer->add_item(TTR("Mobile")); - } - if (rendering_method == "gl_compatibility") { - renderer->add_item(TTR("Compatibility")); - } - renderer->set_item_metadata(i, rendering_method); - - // Lowercase for standard comparison. - rendering_method = rendering_method.to_lower(); + String current_renderer_ps = GLOBAL_GET("rendering/renderer/rendering_method"); + current_renderer_ps = current_renderer_ps.to_lower(); + String current_renderer_os = OS::get_singleton()->get_current_rendering_method().to_lower(); - if (current_renderer == rendering_method) { - renderer->select(i); - renderer_current = i; + // Add the renderers name to the UI. + if (current_renderer_ps == current_renderer_os) { + renderer->connect("item_selected", callable_mp(this, &EditorNode::_renderer_selected)); + // As we are doing string comparisons, keep in standard case to prevent problems with capitals + // "vulkan" in particular uses lowercase "v" in the code, and uppercase in the UI. + PackedStringArray renderers = ProjectSettings::get_singleton()->get_custom_property_info().get(StringName("rendering/renderer/rendering_method")).hint_string.split(",", false); + for (int i = 0; i < renderers.size(); i++) { + String rendering_method = renderers[i]; + _add_renderer_entry(rendering_method, false); + renderer->set_item_metadata(i, rendering_method); + // Lowercase for standard comparison. + rendering_method = rendering_method.to_lower(); + if (current_renderer_ps == rendering_method) { + renderer->select(i); + renderer_current = i; + } } + } else { + // It's an CLI-overridden rendering method. + _add_renderer_entry(current_renderer_os, true); + renderer->set_item_metadata(0, current_renderer_os); + renderer->select(0); + renderer_current = 0; } _update_renderer_color(); @@ -7762,6 +7739,9 @@ EditorNode::EditorNode() { orphan_resources = memnew(OrphanResourcesDialog); gui_base->add_child(orphan_resources); + surface_upgrade_dialog = memnew(SurfaceUpgradeDialog); + gui_base->add_child(surface_upgrade_dialog); + confirmation = memnew(ConfirmationDialog); gui_base->add_child(confirmation); confirmation->connect("confirmed", callable_mp(this, &EditorNode::_menu_confirm_current)); @@ -8091,6 +8071,7 @@ EditorNode::EditorNode() { // Extend menu bar to window title. if (can_expand) { + DisplayServer::get_singleton()->process_events(); DisplayServer::get_singleton()->window_set_flag(DisplayServer::WINDOW_FLAG_EXTEND_TO_TITLE, true, DisplayServer::MAIN_WINDOW_ID); title_bar->set_can_move_window(true); } diff --git a/editor/editor_node.h b/editor/editor_node.h index 0ee2330927..c72a8f9324 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -68,12 +68,12 @@ class VBoxContainer; class VSplitContainer; class Window; -class AudioStreamImportSettings; +class AudioStreamImportSettingsDialog; class AudioStreamPreviewGenerator; class BackgroundProgress; class DependencyEditor; class DependencyErrorDialog; -class DynamicFontImportSettings; +class DynamicFontImportSettingsDialog; class EditorAbout; class EditorBuildProfileManager; class EditorCommandPalette; @@ -111,9 +111,10 @@ class ProgressDialog; class ProjectExportDialog; class ProjectSettingsEditor; class RunSettingsDialog; -class SceneImportSettings; +class SceneImportSettingsDialog; class ScriptCreateDialog; class SurfaceUpgradeTool; +class SurfaceUpgradeDialog; class WindowWrapper; class EditorNode : public Node { @@ -192,6 +193,7 @@ private: EDIT_RELOAD_SAVED_SCENE, TOOLS_ORPHAN_RESOURCES, TOOLS_BUILD_PROFILE_MANAGER, + TOOLS_SURFACE_UPGRADE, TOOLS_CUSTOM, RESOURCE_SAVE, RESOURCE_SAVE_AS, @@ -262,6 +264,7 @@ private: String path; bool debug = false; bool pack_only = false; + bool android_build_template = false; } export_defer; static EditorNode *singleton; @@ -330,6 +333,7 @@ private: bool exiting = false; bool dimmed = false; + DisplayServer::WindowMode prev_mode = DisplayServer::WINDOW_MODE_MAXIMIZED; int old_split_ofs = 0; VSplitContainer *top_split = nullptr; HBoxContainer *bottom_hb = nullptr; @@ -342,6 +346,7 @@ private: EditorRunBar *project_run_bar = nullptr; VBoxContainer *main_screen_vbox = nullptr; MenuBar *main_menu = nullptr; + PopupMenu *apple_menu = nullptr; PopupMenu *file_menu = nullptr; PopupMenu *project_menu = nullptr; PopupMenu *debug_menu = nullptr; @@ -479,10 +484,11 @@ private: String _tmp_import_path; String external_file; String open_navigate; + String saving_scene; - DynamicFontImportSettings *fontdata_import_settings = nullptr; - SceneImportSettings *scene_import_settings = nullptr; - AudioStreamImportSettings *audio_stream_import_settings = nullptr; + DynamicFontImportSettingsDialog *fontdata_import_settings = nullptr; + SceneImportSettingsDialog *scene_import_settings = nullptr; + AudioStreamImportSettingsDialog *audio_stream_import_settings = nullptr; String import_reload_fn; @@ -496,6 +502,7 @@ private: HashMap<String, Ref<Texture2D>> icon_type_cache; SurfaceUpgradeTool *surface_upgrade_tool = nullptr; + SurfaceUpgradeDialog *surface_upgrade_dialog = nullptr; bool run_surface_upgrade_tool = false; static EditorBuildCallback build_callbacks[MAX_BUILD_CALLBACKS]; @@ -607,6 +614,7 @@ private: void _renderer_selected(int); void _update_renderer_color(); + void _add_renderer_entry(const String &p_renderer_name, bool p_mark_overridden); void _exit_editor(int p_exit_code); @@ -626,8 +634,6 @@ private: bool _find_scene_in_use(Node *p_node, const String &p_path) const; - void _update_dock_containers(); - void _dock_select_input(const Ref<InputEvent> &p_input); void _dock_move_left(); void _dock_move_right(); @@ -711,6 +717,9 @@ public: bool call_build(); + // This is a very naive estimation, but we need something now. Will be reworked later. + bool is_editor_ready() const { return is_inside_tree() && !waiting_for_first_scan; } + static EditorNode *get_singleton() { return singleton; } static EditorLog *get_log() { return singleton->log; } @@ -874,7 +883,8 @@ public: void _copy_warning(const String &p_str); - Error export_preset(const String &p_preset, const String &p_path, bool p_debug, bool p_pack_only); + Error export_preset(const String &p_preset, const String &p_path, bool p_debug, bool p_pack_only, bool p_android_build_template); + bool is_project_exporting() const; Control *get_gui_base() { return gui_base; } diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp index b43e7eba9c..94a49166b8 100644 --- a/editor/editor_plugin.cpp +++ b/editor/editor_plugin.cpp @@ -443,12 +443,12 @@ void EditorPlugin::remove_inspector_plugin(const Ref<EditorInspectorPlugin> &p_p void EditorPlugin::add_scene_format_importer_plugin(const Ref<EditorSceneFormatImporter> &p_importer, bool p_first_priority) { ERR_FAIL_COND(!p_importer.is_valid()); - ResourceImporterScene::add_importer(p_importer, p_first_priority); + ResourceImporterScene::add_scene_importer(p_importer, p_first_priority); } void EditorPlugin::remove_scene_format_importer_plugin(const Ref<EditorSceneFormatImporter> &p_importer) { ERR_FAIL_COND(!p_importer.is_valid()); - ResourceImporterScene::remove_importer(p_importer); + ResourceImporterScene::remove_scene_importer(p_importer); } void EditorPlugin::add_scene_post_import_plugin(const Ref<EditorScenePostImportPlugin> &p_plugin, bool p_first_priority) { diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 2d35d4e9ac..f891bfbff7 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -56,6 +56,7 @@ #include "scene/resources/font.h" #include "scene/resources/mesh.h" #include "scene/resources/packed_scene.h" +#include "scene/resources/visual_shader_nodes.h" ///////////////////// Nil ///////////////////////// @@ -2929,6 +2930,14 @@ bool EditorPropertyNodePath::is_drop_valid(const Dictionary &p_drag_data) const if (dropped_node->is_class(E) || EditorNode::get_singleton()->is_object_of_custom_type(dropped_node, E)) { return true; + } else { + Ref<Script> dropped_node_script = dropped_node->get_script(); + while (dropped_node_script.is_valid()) { + if (dropped_node_script->get_path() == E) { + return true; + } + dropped_node_script = dropped_node_script->get_base_script(); + } } } @@ -3196,6 +3205,13 @@ void EditorPropertyResource::_resource_changed(const Ref<Resource> &p_resource) Ref<ViewportTexture> vpt = p_resource; if (vpt.is_valid()) { r = Object::cast_to<Resource>(get_edited_object()); + if (Object::cast_to<VisualShaderNodeTexture>(r)) { + EditorNode::get_singleton()->show_warning(TTR("Can't create a ViewportTexture in a Texture2D node because the texture will not be bound to a scene.\nUse a Texture2DParameter node instead and set the texture in the \"Shader Parameters\" tab.")); + emit_changed(get_edited_property(), Ref<Resource>()); + update_property(); + return; + } + if (r && r->get_path().is_resource_file()) { EditorNode::get_singleton()->show_warning(TTR("Can't create a ViewportTexture on resources saved as a file.\nResource needs to belong to a scene.")); emit_changed(get_edited_property(), Ref<Resource>()); diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp index 3fad85c95c..0a9d35fe64 100644 --- a/editor/editor_properties_array_dict.cpp +++ b/editor/editor_properties_array_dict.cpp @@ -198,6 +198,10 @@ void EditorPropertyArray::_property_changed(const String &p_property, Variant p_ return; } + if (p_value.get_type() == Variant::OBJECT && p_value.is_null()) { + p_value = Variant(); // `EditorResourcePicker` resets to `Ref<Resource>()`. See GH-82716. + } + int index; if (p_property.begins_with("metadata/")) { index = p_property.get_slice("/", 2).to_int(); @@ -726,6 +730,10 @@ EditorPropertyArray::EditorPropertyArray() { ///////////////////// DICTIONARY /////////////////////////// void EditorPropertyDictionary::_property_changed(const String &p_property, Variant p_value, const String &p_name, bool p_changing) { + if (p_value.get_type() == Variant::OBJECT && p_value.is_null()) { + p_value = Variant(); // `EditorResourcePicker` resets to `Ref<Resource>()`. See GH-82716. + } + if (p_property == "new_item_key") { object->set_new_item_key(p_value); } else if (p_property == "new_item_value") { diff --git a/editor/editor_quick_open.cpp b/editor/editor_quick_open.cpp index 82313c12e2..965d0269d6 100644 --- a/editor/editor_quick_open.cpp +++ b/editor/editor_quick_open.cpp @@ -250,23 +250,22 @@ void EditorQuickOpen::_notification(int p_what) { } } break; + case NOTIFICATION_THEME_CHANGED: { + search_box->set_right_icon(get_editor_theme_icon(SNAME("Search"))); + } break; + case NOTIFICATION_EXIT_TREE: { disconnect("confirmed", callable_mp(this, &EditorQuickOpen::_confirmed)); } break; } } -void EditorQuickOpen::_theme_changed() { - search_box->set_right_icon(search_options->get_editor_theme_icon(SNAME("Search"))); -} - void EditorQuickOpen::_bind_methods() { ADD_SIGNAL(MethodInfo("quick_open")); } EditorQuickOpen::EditorQuickOpen() { VBoxContainer *vbc = memnew(VBoxContainer); - vbc->connect("theme_changed", callable_mp(this, &EditorQuickOpen::_theme_changed)); add_child(vbc); search_box = memnew(LineEdit); diff --git a/editor/editor_quick_open.h b/editor/editor_quick_open.h index 2b64efb151..ec8ce0175e 100644 --- a/editor/editor_quick_open.h +++ b/editor/editor_quick_open.h @@ -72,8 +72,6 @@ class EditorQuickOpen : public ConfirmationDialog { void _sbox_input(const Ref<InputEvent> &p_ie); void _text_changed(const String &p_newtext); - void _theme_changed(); - protected: void _notification(int p_what); static void _bind_methods(); diff --git a/editor/editor_resource_picker.cpp b/editor/editor_resource_picker.cpp index 3b7cce60bf..ed20e50685 100644 --- a/editor/editor_resource_picker.cpp +++ b/editor/editor_resource_picker.cpp @@ -233,11 +233,12 @@ void EditorResourcePicker::_update_menu_items() { } edit_menu->add_icon_item(get_editor_theme_icon(SNAME("Save")), TTR("Save"), OBJ_MENU_SAVE); + edit_menu->add_icon_item(get_editor_theme_icon(SNAME("Save")), TTR("Save As..."), OBJ_MENU_SAVE_AS); } if (edited_resource->get_path().is_resource_file()) { edit_menu->add_separator(); - edit_menu->add_item(TTR("Show in FileSystem"), OBJ_MENU_SHOW_IN_FILE_SYSTEM); + edit_menu->add_icon_item(get_editor_theme_icon(SNAME("ShowInFileSystem")), TTR("Show in FileSystem"), OBJ_MENU_SHOW_IN_FILE_SYSTEM); } } @@ -400,6 +401,13 @@ void EditorResourcePicker::_edit_menu_cbk(int p_which) { EditorNode::get_singleton()->save_resource(edited_resource); } break; + case OBJ_MENU_SAVE_AS: { + if (edited_resource.is_null()) { + return; + } + EditorNode::get_singleton()->save_resource_as(edited_resource); + } break; + case OBJ_MENU_COPY: { EditorSettings::get_singleton()->set_resource_clipboard(edited_resource); } break; @@ -418,16 +426,7 @@ void EditorResourcePicker::_edit_menu_cbk(int p_which) { } break; case OBJ_MENU_SHOW_IN_FILE_SYSTEM: { - FileSystemDock *file_system_dock = FileSystemDock::get_singleton(); - file_system_dock->navigate_to_path(edited_resource->get_path()); - - // Ensure that the FileSystem dock is visible. - if (file_system_dock->get_window() == get_tree()->get_root()) { - TabContainer *tab_container = (TabContainer *)file_system_dock->get_parent_control(); - tab_container->set_current_tab(tab_container->get_tab_idx_from_control(file_system_dock)); - } else { - file_system_dock->get_window()->grab_focus(); - } + FileSystemDock::get_singleton()->navigate_to_path(edited_resource->get_path()); } break; default: { @@ -653,8 +652,7 @@ bool EditorResourcePicker::_is_drop_valid(const Dictionary &p_drag_data) const { // TODO: Extract the typename of the dropped filepath's resource in a more performant way, without fully loading it. if (files.size() == 1) { - String file = files[0]; - res = ResourceLoader::load(file); + res = ResourceLoader::load(files[0]); } } @@ -719,8 +717,7 @@ void EditorResourcePicker::drop_data_fw(const Point2 &p_point, const Variant &p_ Vector<String> files = drag_data["files"]; if (files.size() == 1) { - String file = files[0]; - dropped_resource = ResourceLoader::load(file); + dropped_resource = ResourceLoader::load(files[0]); } } diff --git a/editor/editor_resource_picker.h b/editor/editor_resource_picker.h index 856ef974d3..35703bcbeb 100644 --- a/editor/editor_resource_picker.h +++ b/editor/editor_resource_picker.h @@ -72,6 +72,7 @@ class EditorResourcePicker : public HBoxContainer { OBJ_MENU_MAKE_UNIQUE, OBJ_MENU_MAKE_UNIQUE_RECURSIVE, OBJ_MENU_SAVE, + OBJ_MENU_SAVE_AS, OBJ_MENU_COPY, OBJ_MENU_PASTE, OBJ_MENU_SHOW_IN_FILE_SYSTEM, @@ -145,8 +146,8 @@ class EditorScriptPicker : public EditorResourcePicker { GDCLASS(EditorScriptPicker, EditorResourcePicker); enum ExtraMenuOption { - OBJ_MENU_NEW_SCRIPT = 10, - OBJ_MENU_EXTEND_SCRIPT = 11 + OBJ_MENU_NEW_SCRIPT = 50, + OBJ_MENU_EXTEND_SCRIPT = 51 }; Node *script_owner = nullptr; @@ -168,7 +169,7 @@ class EditorShaderPicker : public EditorResourcePicker { GDCLASS(EditorShaderPicker, EditorResourcePicker); enum ExtraMenuOption { - OBJ_MENU_NEW_SHADER = 10, + OBJ_MENU_NEW_SHADER = 50, }; ShaderMaterial *edited_material = nullptr; diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 1eaeee97a5..6f52793e32 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -884,6 +884,10 @@ bool EditorSettings::_is_default_text_editor_theme(String p_theme_name) { return p_theme_name == "default" || p_theme_name == "godot 2" || p_theme_name == "custom"; } +const String EditorSettings::_get_project_metadata_path() const { + return EditorPaths::get_singleton()->get_project_settings_dir().path_join("project_metadata.cfg"); +} + // PUBLIC METHODS EditorSettings *EditorSettings::get_singleton() { @@ -1171,24 +1175,31 @@ void EditorSettings::add_property_hint(const PropertyInfo &p_hint) { // Metadata void EditorSettings::set_project_metadata(const String &p_section, const String &p_key, Variant p_data) { - Ref<ConfigFile> cf = memnew(ConfigFile); - String path = EditorPaths::get_singleton()->get_project_settings_dir().path_join("project_metadata.cfg"); - Error err; - err = cf->load(path); - ERR_FAIL_COND_MSG(err != OK && err != ERR_FILE_NOT_FOUND, "Cannot load editor settings from file '" + path + "'."); - cf->set_value(p_section, p_key, p_data); - err = cf->save(path); - ERR_FAIL_COND_MSG(err != OK, "Cannot save editor settings to file '" + path + "'."); + const String path = _get_project_metadata_path(); + + if (project_metadata.is_null()) { + project_metadata.instantiate(); + + Error err = project_metadata->load(path); + if (err != OK && err != ERR_FILE_NOT_FOUND) { + ERR_PRINT("Cannot load project metadata from file '" + path + "'."); + } + } + project_metadata->set_value(p_section, p_key, p_data); + + Error err = project_metadata->save(path); + ERR_FAIL_COND_MSG(err != OK, "Cannot save project metadata to file '" + path + "'."); } Variant EditorSettings::get_project_metadata(const String &p_section, const String &p_key, Variant p_default) const { - Ref<ConfigFile> cf = memnew(ConfigFile); - String path = EditorPaths::get_singleton()->get_project_settings_dir().path_join("project_metadata.cfg"); - Error err = cf->load(path); - if (err != OK) { - return p_default; + if (project_metadata.is_null()) { + project_metadata.instantiate(); + + const String path = _get_project_metadata_path(); + Error err = project_metadata->load(path); + ERR_FAIL_COND_V_MSG(err != OK && err != ERR_FILE_NOT_FOUND, p_default, "Cannot load project metadata from file '" + path + "'."); } - return cf->get_value(p_section, p_key, p_default); + return project_metadata->get_value(p_section, p_key, p_default); } void EditorSettings::set_favorites(const Vector<String> &p_favorites) { diff --git a/editor/editor_settings.h b/editor/editor_settings.h index 660a9501a2..c3ce790e0e 100644 --- a/editor/editor_settings.h +++ b/editor/editor_settings.h @@ -79,6 +79,7 @@ private: HashSet<String> changed_settings; + mutable Ref<ConfigFile> project_metadata; HashMap<String, PropertyInfo> hints; HashMap<String, VariantContainer> props; int last_order; @@ -106,6 +107,7 @@ private: void _load_godot2_text_editor_theme(); bool _save_text_editor_theme(String p_file); bool _is_default_text_editor_theme(String p_theme_name); + const String _get_project_metadata_path() const; protected: static void _bind_methods(); diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index 0dd787f0ea..96d2abf202 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -403,7 +403,9 @@ float get_gizmo_handle_scale(const String &gizmo_handle_name = "") { } void editor_register_and_generate_icons(Ref<Theme> p_theme, bool p_dark_theme, float p_icon_saturation, int p_thumb_size, bool p_only_thumbs = false) { - OS::get_singleton()->benchmark_begin_measure("editor_register_and_generate_icons_" + String((p_only_thumbs ? "with_only_thumbs" : "all"))); + const String benchmark_key = vformat("Generate Icons (%s)", (p_only_thumbs ? "Only Thumbs" : "All")); + OS::get_singleton()->benchmark_begin_measure("EditorTheme", benchmark_key); + // Before we register the icons, we adjust their colors and saturation. // Most icons follow the standard rules for color conversion to follow the editor // theme's polarity (dark/light). We also adjust the saturation for most icons, @@ -531,11 +533,11 @@ void editor_register_and_generate_icons(Ref<Theme> p_theme, bool p_dark_theme, f p_theme->set_icon(editor_icons_names[index], EditorStringName(EditorIcons), icon); } } - OS::get_singleton()->benchmark_end_measure("editor_register_and_generate_icons_" + String((p_only_thumbs ? "with_only_thumbs" : "all"))); + OS::get_singleton()->benchmark_end_measure("EditorTheme", benchmark_key); } Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { - OS::get_singleton()->benchmark_begin_measure("create_editor_theme"); + OS::get_singleton()->benchmark_begin_measure("EditorTheme", "Create Editor Theme"); Ref<EditorTheme> theme = memnew(EditorTheme); // Controls may rely on the scale for their internal drawing logic. @@ -2360,15 +2362,16 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_color("search_result_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/search_result_color")); theme->set_color("search_result_border_color", "CodeEdit", EDITOR_GET("text_editor/theme/highlighting/search_result_border_color")); - OS::get_singleton()->benchmark_end_measure("create_editor_theme"); + OS::get_singleton()->benchmark_end_measure("EditorTheme", "Create Editor Theme"); return theme; } Ref<Theme> create_custom_theme(const Ref<Theme> p_theme) { - OS::get_singleton()->benchmark_begin_measure("create_custom_theme"); Ref<Theme> theme = create_editor_theme(p_theme); + OS::get_singleton()->benchmark_begin_measure("EditorTheme", "Create Custom Theme"); + const String custom_theme_path = EDITOR_GET("interface/theme/custom_theme"); if (!custom_theme_path.is_empty()) { Ref<Theme> custom_theme = ResourceLoader::load(custom_theme_path); @@ -2377,7 +2380,7 @@ Ref<Theme> create_custom_theme(const Ref<Theme> p_theme) { } } - OS::get_singleton()->benchmark_end_measure("create_custom_theme"); + OS::get_singleton()->benchmark_end_measure("EditorTheme", "Create Custom Theme"); return theme; } diff --git a/editor/export/editor_export_platform.cpp b/editor/export/editor_export_platform.cpp index c492589e63..ab2ada9ae4 100644 --- a/editor/export/editor_export_platform.cpp +++ b/editor/export/editor_export_platform.cpp @@ -93,7 +93,7 @@ bool EditorExportPlatform::fill_log_messages(RichTextLabel *p_log, Error p_err) } p_log->add_newline(); - if (msg_count) { + if (msg_count > 0) { p_log->push_table(2); p_log->set_table_column_expand(0, false); p_log->set_table_column_expand(1, true); @@ -133,8 +133,37 @@ bool EditorExportPlatform::fill_log_messages(RichTextLabel *p_log, Error p_err) } p_log->pop(); p_log->add_newline(); + } else if (p_err != OK) { + // We failed but don't show any user-facing messages. This is bad and should not + // be allowed, but just in case this happens, let's give the user something at least. + p_log->push_table(2); + p_log->set_table_column_expand(0, false); + p_log->set_table_column_expand(1, true); + + { + Color color = p_log->get_theme_color(SNAME("error_color"), EditorStringName(Editor)); + Ref<Texture> icon = p_log->get_editor_theme_icon(SNAME("Error")); + + p_log->push_cell(); + p_log->add_text("\t"); + if (icon.is_valid()) { + p_log->add_image(icon); + } + p_log->pop(); + + p_log->push_cell(); + p_log->push_color(color); + p_log->add_text(vformat("[%s]: %s", TTR("Unknown Error"), vformat(TTR("Export failed with error code %d."), p_err))); + p_log->pop(); + p_log->pop(); + } + + p_log->pop(); + p_log->add_newline(); } + p_log->add_newline(); + return has_messages; } @@ -1431,7 +1460,7 @@ void EditorExportPlatform::zip_folder_recursive(zipFile &p_zip, const String &p_ nullptr, 0, 0x0314, // "version made by", 0x03 - Unix, 0x14 - ZIP specification version 2.0, required to store Unix file permissions - 0); + 1 << 11); // Bit 11 is the language encoding flag. When set, filename and comment fields must be encoded using UTF-8. String target = da->read_link(f); zipWriteInFileInZip(p_zip, target.utf8().get_data(), target.utf8().size()); @@ -1475,7 +1504,7 @@ void EditorExportPlatform::zip_folder_recursive(zipFile &p_zip, const String &p_ nullptr, 0, 0x0314, // "version made by", 0x03 - Unix, 0x14 - ZIP specification version 2.0, required to store Unix file permissions - 0); + 1 << 11); // Bit 11 is the language encoding flag. When set, filename and comment fields must be encoded using UTF-8. Ref<FileAccess> fa = FileAccess::open(dir.path_join(f), FileAccess::READ); if (fa.is_null()) { diff --git a/editor/export/editor_export_platform_pc.cpp b/editor/export/editor_export_platform_pc.cpp index ec34ffd1df..42df0d93f6 100644 --- a/editor/export/editor_export_platform_pc.cpp +++ b/editor/export/editor_export_platform_pc.cpp @@ -161,6 +161,7 @@ Error EditorExportPlatformPC::prepare_template(const Ref<EditorExportPreset> &p_ } if (err != OK) { add_message(EXPORT_MESSAGE_ERROR, TTR("Prepare Template"), TTR("Failed to copy export template.")); + return err; } return err; diff --git a/editor/export/project_export.cpp b/editor/export/project_export.cpp index 05f012e5fb..f2c5eeb2ed 100644 --- a/editor/export/project_export.cpp +++ b/editor/export/project_export.cpp @@ -90,11 +90,6 @@ ProjectExportTextureFormatError::ProjectExportTextureFormatError() { fix_texture_format_button->connect("pressed", callable_mp(this, &ProjectExportTextureFormatError::_on_fix_texture_format_pressed)); } -void ProjectExportDialog::_theme_changed() { - duplicate_preset->set_icon(presets->get_editor_theme_icon(SNAME("Duplicate"))); - delete_preset->set_icon(presets->get_editor_theme_icon(SNAME("Remove"))); -} - void ProjectExportDialog::_notification(int p_what) { switch (p_what) { case NOTIFICATION_VISIBILITY_CHANGED: { @@ -103,6 +98,11 @@ void ProjectExportDialog::_notification(int p_what) { } } break; + case NOTIFICATION_THEME_CHANGED: { + duplicate_preset->set_icon(presets->get_editor_theme_icon(SNAME("Duplicate"))); + delete_preset->set_icon(presets->get_editor_theme_icon(SNAME("Remove"))); + } break; + case NOTIFICATION_READY: { duplicate_preset->set_icon(presets->get_editor_theme_icon(SNAME("Duplicate"))); delete_preset->set_icon(presets->get_editor_theme_icon(SNAME("Remove"))); @@ -1076,11 +1076,13 @@ void ProjectExportDialog::_export_project_to_path(const String &p_path) { EditorSettings::get_singleton()->set_project_metadata("export_options", "default_filename", default_filename); Ref<EditorExportPreset> current = get_current_preset(); - ERR_FAIL_COND(current.is_null()); + ERR_FAIL_COND_MSG(current.is_null(), "Failed to start the export: current preset is invalid."); Ref<EditorExportPlatform> platform = current->get_platform(); - ERR_FAIL_COND(platform.is_null()); + ERR_FAIL_COND_MSG(platform.is_null(), "Failed to start the export: current preset has no valid platform."); current->set_export_path(p_path); + exporting = true; + platform->clear_messages(); Error err = platform->export_project(current, export_debug->is_pressed(), current->get_export_path(), 0); result_dialog_log->clear(); @@ -1089,6 +1091,8 @@ void ProjectExportDialog::_export_project_to_path(const String &p_path) { result_dialog->popup_centered_ratio(0.5); } } + + exporting = false; } void ProjectExportDialog::_export_all_dialog() { @@ -1105,34 +1109,48 @@ void ProjectExportDialog::_export_all_dialog_action(const String &p_str) { } void ProjectExportDialog::_export_all(bool p_debug) { - String export_target = p_debug ? TTR("Debug") : TTR("Release"); - EditorProgress ep("exportall", TTR("Exporting All") + " " + export_target, EditorExport::get_singleton()->get_export_preset_count(), true); - + exporting = true; bool show_dialog = false; - result_dialog_log->clear(); - for (int i = 0; i < EditorExport::get_singleton()->get_export_preset_count(); i++) { - Ref<EditorExportPreset> preset = EditorExport::get_singleton()->get_export_preset(i); - ERR_FAIL_COND(preset.is_null()); - Ref<EditorExportPlatform> platform = preset->get_platform(); - ERR_FAIL_COND(platform.is_null()); - ep.step(preset->get_name(), i); + { // Scope for the editor progress, we must free it before showing the dialog at the end. + String export_target = p_debug ? TTR("Debug") : TTR("Release"); + EditorProgress ep("exportall", TTR("Exporting All") + " " + export_target, EditorExport::get_singleton()->get_export_preset_count(), true); - platform->clear_messages(); - Error err = platform->export_project(preset, p_debug, preset->get_export_path(), 0); - if (err == ERR_SKIP) { - return; + result_dialog_log->clear(); + for (int i = 0; i < EditorExport::get_singleton()->get_export_preset_count(); i++) { + Ref<EditorExportPreset> preset = EditorExport::get_singleton()->get_export_preset(i); + if (preset.is_null()) { + exporting = false; + ERR_FAIL_MSG("Failed to start the export: one of the presets is invalid."); + } + + Ref<EditorExportPlatform> platform = preset->get_platform(); + if (platform.is_null()) { + exporting = false; + ERR_FAIL_MSG("Failed to start the export: one of the presets has no valid platform."); + } + + ep.step(preset->get_name(), i); + + platform->clear_messages(); + Error err = platform->export_project(preset, p_debug, preset->get_export_path(), 0); + if (err == ERR_SKIP) { + exporting = false; + return; + } + bool has_messages = platform->fill_log_messages(result_dialog_log, err); + show_dialog = show_dialog || has_messages; } - bool has_messages = platform->fill_log_messages(result_dialog_log, err); - show_dialog = show_dialog || has_messages; } + if (show_dialog) { result_dialog->popup_centered_ratio(0.5); } + + exporting = false; } void ProjectExportDialog::_bind_methods() { - ClassDB::bind_method("_export_all", &ProjectExportDialog::_export_all); ClassDB::bind_method("set_export_path", &ProjectExportDialog::set_export_path); ClassDB::bind_method("get_export_path", &ProjectExportDialog::get_export_path); ClassDB::bind_method("get_current_preset", &ProjectExportDialog::get_current_preset); @@ -1145,8 +1163,8 @@ ProjectExportDialog::ProjectExportDialog() { set_clamp_to_embedder(true); VBoxContainer *main_vb = memnew(VBoxContainer); - main_vb->connect("theme_changed", callable_mp(this, &ProjectExportDialog::_theme_changed)); add_child(main_vb); + HSplitContainer *hbox = memnew(HSplitContainer); main_vb->add_child(hbox); hbox->set_v_size_flags(Control::SIZE_EXPAND_FILL); diff --git a/editor/export/project_export.h b/editor/export/project_export.h index 219f45f59b..1a359b08da 100644 --- a/editor/export/project_export.h +++ b/editor/export/project_export.h @@ -70,7 +70,6 @@ public: class ProjectExportDialog : public ConfirmationDialog { GDCLASS(ProjectExportDialog, ConfirmationDialog); -private: TabContainer *sections = nullptr; MenuButton *add_preset = nullptr; @@ -118,6 +117,8 @@ private: String default_filename; + bool exporting = false; + void _runnable_pressed(); void _update_parameters(const String &p_edited_property); void _name_changed(const String &p_string); @@ -187,7 +188,6 @@ private: void _tab_changed(int); protected: - void _theme_changed(); void _notification(int p_what); static void _bind_methods(); @@ -199,6 +199,8 @@ public: Ref<EditorExportPreset> get_current_preset() const; + bool is_exporting() const { return exporting; }; + ProjectExportDialog(); ~ProjectExportDialog(); }; diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp index 944da47242..1b966fced1 100644 --- a/editor/filesystem_dock.cpp +++ b/editor/filesystem_dock.cpp @@ -47,7 +47,7 @@ #include "editor/editor_string_names.h" #include "editor/gui/editor_dir_dialog.h" #include "editor/gui/editor_scene_tabs.h" -#include "editor/import/resource_importer_scene.h" +#include "editor/import/scene_import_settings.h" #include "editor/import_dock.h" #include "editor/plugins/editor_resource_tooltip_plugins.h" #include "editor/scene_create_dialog.h" @@ -756,6 +756,14 @@ void FileSystemDock::_navigate_to_path(const String &p_path, bool p_select_in_fa void FileSystemDock::navigate_to_path(const String &p_path) { file_list_search_box->clear(); _navigate_to_path(p_path); + + // Ensure that the FileSystem dock is visible. + if (get_window() == get_tree()->get_root()) { + TabContainer *tab_container = (TabContainer *)get_parent_control(); + tab_container->set_current_tab(tab_container->get_tab_idx_from_control((Control *)this)); + } else { + get_window()->grab_focus(); + } } void FileSystemDock::_file_list_thumbnail_done(const String &p_path, const Ref<Texture2D> &p_preview, const Ref<Texture2D> &p_small_preview, const Variant &p_udata) { @@ -1192,32 +1200,12 @@ void FileSystemDock::_select_file(const String &p_path, bool p_select_in_favorit String resource_type = ResourceLoader::get_resource_type(fpath); - if (resource_type == "PackedScene") { - bool is_imported = false; - - { - List<String> importer_exts; - ResourceImporterScene::get_scene_singleton()->get_recognized_extensions(&importer_exts); - String extension = fpath.get_extension(); - for (const String &E : importer_exts) { - if (extension.nocasecmp_to(E) == 0) { - is_imported = true; - break; - } - } - } - - if (is_imported) { - ResourceImporterScene::get_scene_singleton()->show_advanced_options(fpath); - } else { - EditorNode::get_singleton()->open_request(fpath); - } - } else if (resource_type == "AnimationLibrary") { + if (resource_type == "PackedScene" || resource_type == "AnimationLibrary") { bool is_imported = false; { List<String> importer_exts; - ResourceImporterScene::get_animation_singleton()->get_recognized_extensions(&importer_exts); + ResourceImporterScene::get_scene_importer_extensions(&importer_exts); String extension = fpath.get_extension(); for (const String &E : importer_exts) { if (extension.nocasecmp_to(E) == 0) { @@ -1228,7 +1216,7 @@ void FileSystemDock::_select_file(const String &p_path, bool p_select_in_favorit } if (is_imported) { - ResourceImporterScene::get_animation_singleton()->show_advanced_options(fpath); + SceneImportSettingsDialog::get_singleton()->open_settings(p_path, resource_type == "AnimationLibrary"); } else { EditorNode::get_singleton()->open_request(fpath); } @@ -1308,6 +1296,13 @@ void FileSystemDock::_fs_changed() { _update_file_list(true); } + if (!select_after_scan.is_empty()) { + _navigate_to_path(select_after_scan); + select_after_scan.clear(); + import_dock_needs_update = true; + _update_import_dock(); + } + set_process(false); } @@ -1487,8 +1482,6 @@ void FileSystemDock::_try_duplicate_item(const FileOrFolder &p_item, const Strin EditorNode::get_singleton()->add_io_error(TTR("Cannot move a folder into itself.") + "\n" + old_path + "\n"); return; } - const_cast<FileSystemDock *>(this)->current_path = new_path; - Ref<DirAccess> da = DirAccess::create(DirAccess::ACCESS_RESOURCES); if (p_item.is_file) { @@ -1595,6 +1588,9 @@ void FileSystemDock::_update_dependencies_after_move(const HashMap<String, Strin // The following code assumes that the following holds: // 1) EditorFileSystem contains the old paths/folder structure from before the rename/move. // 2) ResourceLoader can use the new paths without needing to call rescan. + + // The currently edited scene should be reloaded first, so get it's path (GH-82652). + const String &edited_scene_path = EditorNode::get_editor_data().get_scene_path(EditorNode::get_editor_data().get_edited_scene()); List<String> scenes_to_reload; for (const String &E : p_file_owners) { // Because we haven't called a rescan yet the found remap might still be an old path itself. @@ -1604,7 +1600,11 @@ void FileSystemDock::_update_dependencies_after_move(const HashMap<String, Strin const Error err = ResourceLoader::rename_dependencies(file, p_renames); if (err == OK) { if (ResourceLoader::get_resource_type(file) == "PackedScene") { - scenes_to_reload.push_back(file); + if (file == edited_scene_path) { + scenes_to_reload.push_front(file); + } else { + scenes_to_reload.push_back(file); + } } } else { EditorNode::get_singleton()->add_io_error(TTR("Unable to update dependencies for:") + "\n" + E + "\n"); @@ -1921,6 +1921,7 @@ void FileSystemDock::_move_operation_confirm(const String &p_to_path, bool p_cop for (int i = 0; i < to_move.size(); i++) { if (to_move[i].path != new_paths[i]) { _try_duplicate_item(to_move[i], new_paths[i]); + select_after_scan = new_paths[i]; is_copied = true; } } @@ -3477,6 +3478,14 @@ void FileSystemDock::_file_sort_popup(int p_id) { set_file_sort((FileSortOption)p_id); } +const HashMap<String, Color> &FileSystemDock::get_folder_colors() const { + return folder_colors; +} + +Dictionary FileSystemDock::get_assigned_folder_colors() const { + return assigned_folder_colors; +} + MenuButton *FileSystemDock::_create_file_menu_button() { MenuButton *button = memnew(MenuButton); button->set_flat(true); diff --git a/editor/filesystem_dock.h b/editor/filesystem_dock.h index 1cde735cb8..f70afaa65e 100644 --- a/editor/filesystem_dock.h +++ b/editor/filesystem_dock.h @@ -225,6 +225,7 @@ private: int history_max_size; String current_path; + String select_after_scan; bool initialized = false; @@ -369,6 +370,9 @@ protected: static void _bind_methods(); public: + const HashMap<String, Color> &get_folder_colors() const; + Dictionary get_assigned_folder_colors() const; + Vector<String> get_selected_paths() const; Vector<String> get_uncollapsed_paths() const; diff --git a/editor/groups_editor.cpp b/editor/groups_editor.cpp index 09e5fe790d..d083bc294a 100644 --- a/editor/groups_editor.cpp +++ b/editor/groups_editor.cpp @@ -117,7 +117,7 @@ void GroupDialog::_load_nodes(Node *p_current) { if (!can_edit(p_current, selected_group)) { node->set_selectable(0, false); - node->set_custom_color(0, groups->get_theme_color(SNAME("disabled_font_color"), EditorStringName(Editor))); + node->set_custom_color(0, get_theme_color(SNAME("disabled_font_color"), EditorStringName(Editor))); } } @@ -211,8 +211,8 @@ void GroupDialog::_add_group(String p_name) { TreeItem *new_group = groups->create_item(groups_root); new_group->set_text(0, name); - new_group->add_button(0, groups->get_editor_theme_icon(SNAME("Remove")), DELETE_GROUP); - new_group->add_button(0, groups->get_editor_theme_icon(SNAME("ActionCopy")), COPY_GROUP); + new_group->add_button(0, get_editor_theme_icon(SNAME("Remove")), DELETE_GROUP); + new_group->add_button(0, get_editor_theme_icon(SNAME("ActionCopy")), COPY_GROUP); new_group->set_editable(0, true); new_group->select(0); groups->ensure_cursor_is_visible(); @@ -391,20 +391,17 @@ void GroupDialog::_notification(int p_what) { switch (p_what) { case NOTIFICATION_TRANSLATION_CHANGED: case Control::NOTIFICATION_LAYOUT_DIRECTION_CHANGED: - case NOTIFICATION_ENTER_TREE: case NOTIFICATION_THEME_CHANGED: { if (is_layout_rtl()) { - add_button->set_icon(groups->get_editor_theme_icon(SNAME("Back"))); - remove_button->set_icon(groups->get_editor_theme_icon(SNAME("Forward"))); + add_button->set_icon(get_editor_theme_icon(SNAME("Back"))); + remove_button->set_icon(get_editor_theme_icon(SNAME("Forward"))); } else { - add_button->set_icon(groups->get_editor_theme_icon(SNAME("Forward"))); - remove_button->set_icon(groups->get_editor_theme_icon(SNAME("Back"))); + add_button->set_icon(get_editor_theme_icon(SNAME("Forward"))); + remove_button->set_icon(get_editor_theme_icon(SNAME("Back"))); } - add_filter->set_right_icon(groups->get_editor_theme_icon(SNAME("Search"))); - add_filter->set_clear_button_enabled(true); - remove_filter->set_right_icon(groups->get_editor_theme_icon(SNAME("Search"))); - remove_filter->set_clear_button_enabled(true); + add_filter->set_right_icon(get_editor_theme_icon(SNAME("Search"))); + remove_filter->set_right_icon(get_editor_theme_icon(SNAME("Search"))); } break; } } @@ -512,6 +509,7 @@ GroupDialog::GroupDialog() { add_filter = memnew(LineEdit); add_filter->set_h_size_flags(Control::SIZE_EXPAND_FILL); add_filter->set_placeholder(TTR("Filter Nodes")); + add_filter->set_clear_button_enabled(true); add_filter_hbc->add_child(add_filter); add_filter->connect("text_changed", callable_mp(this, &GroupDialog::_add_filter_changed)); @@ -562,6 +560,7 @@ GroupDialog::GroupDialog() { remove_filter = memnew(LineEdit); remove_filter->set_h_size_flags(Control::SIZE_EXPAND_FILL); remove_filter->set_placeholder(TTR("Filter Nodes")); + remove_filter->set_clear_button_enabled(true); remove_filter_hbc->add_child(remove_filter); remove_filter->connect("text_changed", callable_mp(this, &GroupDialog::_remove_filter_changed)); diff --git a/editor/gui/editor_file_dialog.cpp b/editor/gui/editor_file_dialog.cpp index 22761d3773..fad7e29be7 100644 --- a/editor/gui/editor_file_dialog.cpp +++ b/editor/gui/editor_file_dialog.cpp @@ -40,6 +40,7 @@ #include "editor/editor_resource_preview.h" #include "editor/editor_scale.h" #include "editor/editor_settings.h" +#include "editor/filesystem_dock.h" #include "scene/gui/center_container.h" #include "scene/gui/label.h" #include "scene/gui/margin_container.h" @@ -766,6 +767,35 @@ void EditorFileDialog::update_file_name() { } } +// TODO: Could use a unit test. +Color EditorFileDialog::get_dir_icon_color(const String &p_dir_path) { + if (!FileSystemDock::get_singleton()) { // This dialog can be called from the project manager. + return theme_cache.folder_icon_color; + } + + const HashMap<String, Color> &folder_colors = FileSystemDock::get_singleton()->get_folder_colors(); + Dictionary assigned_folder_colors = FileSystemDock::get_singleton()->get_assigned_folder_colors(); + + Color folder_icon_color = theme_cache.folder_icon_color; + + // Check for a folder color to inherit (if one is assigned). + String parent_dir = ProjectSettings::get_singleton()->localize_path(p_dir_path); + while (!parent_dir.is_empty() && parent_dir != "res://") { + if (!parent_dir.ends_with("/")) { + parent_dir += "/"; + } + if (assigned_folder_colors.has(parent_dir)) { + folder_icon_color = folder_colors[assigned_folder_colors[parent_dir]]; + if (folder_icon_color != theme_cache.folder_icon_color) { + break; + } + } + parent_dir = parent_dir.trim_suffix("/").get_base_dir(); + } + + return folder_icon_color; +} + // DO NOT USE THIS FUNCTION UNLESS NEEDED, CALL INVALIDATE() INSTEAD. void EditorFileDialog::update_file_list() { int thumbnail_size = EDITOR_GET("filesystem/file_dialog/thumbnail_size"); @@ -859,7 +889,7 @@ void EditorFileDialog::update_file_list() { d["dir"] = true; item_list->set_item_metadata(-1, d); - item_list->set_item_icon_modulate(-1, theme_cache.folder_icon_color); + item_list->set_item_icon_modulate(-1, get_dir_icon_color(String(d["path"]))); dirs.pop_front(); } @@ -1435,7 +1465,7 @@ void EditorFileDialog::_update_favorites() { for (int i = 0; i < favorited_paths.size(); i++) { favorites->add_item(favorited_names[i], theme_cache.folder); favorites->set_item_metadata(-1, favorited_paths[i]); - favorites->set_item_icon_modulate(-1, theme_cache.folder_icon_color); + favorites->set_item_icon_modulate(-1, get_dir_icon_color(favorited_paths[i])); if (i == current_favorite) { favorite->set_pressed(true); @@ -1518,7 +1548,7 @@ void EditorFileDialog::_update_recent() { for (int i = 0; i < recentd_paths.size(); i++) { recent->add_item(recentd_names[i], theme_cache.folder); recent->set_item_metadata(-1, recentd_paths[i]); - recent->set_item_icon_modulate(-1, theme_cache.folder_icon_color); + recent->set_item_icon_modulate(-1, get_dir_icon_color(recentd_paths[i])); } EditorSettings::get_singleton()->set_recent_dirs(recentd); } diff --git a/editor/gui/editor_file_dialog.h b/editor/gui/editor_file_dialog.h index 913b48a10b..e0f53ace96 100644 --- a/editor/gui/editor_file_dialog.h +++ b/editor/gui/editor_file_dialog.h @@ -239,6 +239,8 @@ protected: static void _bind_methods(); public: + Color get_dir_icon_color(const String &p_dir_path); + // Public for use with callable_mp. void _file_submitted(const String &p_file); diff --git a/editor/gui/editor_scene_tabs.cpp b/editor/gui/editor_scene_tabs.cpp index 1fe8eee6d7..7c74432ee9 100644 --- a/editor/gui/editor_scene_tabs.cpp +++ b/editor/gui/editor_scene_tabs.cpp @@ -165,7 +165,7 @@ void EditorSceneTabs::_update_context_menu() { if (tab_id >= 0) { scene_tabs_context_menu->add_separator(); - scene_tabs_context_menu->add_item(TTR("Show in FileSystem"), EditorNode::FILE_SHOW_IN_FILESYSTEM); + scene_tabs_context_menu->add_icon_item(get_editor_theme_icon(SNAME("ShowInFileSystem")), TTR("Show in FileSystem"), EditorNode::FILE_SHOW_IN_FILESYSTEM); _disable_menu_option_if(EditorNode::FILE_SHOW_IN_FILESYSTEM, !ResourceLoader::exists(EditorNode::get_editor_data().get_scene_path(tab_id))); scene_tabs_context_menu->add_item(TTR("Play This Scene"), EditorNode::FILE_RUN_SCENE); _disable_menu_option_if(EditorNode::FILE_RUN_SCENE, no_root_node); @@ -190,16 +190,38 @@ void EditorSceneTabs::_disable_menu_option_if(int p_option, bool p_condition) { } } -// TODO: This REALLY should be done in a better way than replacing all tabs after almost EVERY action. void EditorSceneTabs::update_scene_tabs() { tab_preview_panel->hide(); - bool show_rb = EDITOR_GET("interface/scene_tabs/show_script_button"); + if (scene_tabs->get_tab_count() == EditorNode::get_editor_data().get_edited_scene_count()) { + _update_tab_titles(); + return; + } if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_GLOBAL_MENU)) { DisplayServer::get_singleton()->global_menu_clear("_dock"); } + scene_tabs->set_block_signals(true); + scene_tabs->set_tab_count(EditorNode::get_editor_data().get_edited_scene_count()); + scene_tabs->set_block_signals(false); + + if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_GLOBAL_MENU)) { + for (int i = 0; i < EditorNode::get_editor_data().get_edited_scene_count(); i++) { + int global_menu_index = DisplayServer::get_singleton()->global_menu_add_item("_dock", EditorNode::get_editor_data().get_scene_title(i), callable_mp(this, &EditorSceneTabs::_global_menu_scene), Callable(), i); + scene_tabs->set_tab_metadata(i, global_menu_index); + } + + DisplayServer::get_singleton()->global_menu_add_separator("_dock"); + DisplayServer::get_singleton()->global_menu_add_item("_dock", TTR("New Window"), callable_mp(this, &EditorSceneTabs::_global_menu_new_window)); + } + + _update_tab_titles(); +} + +void EditorSceneTabs::_update_tab_titles() { + bool show_rb = EDITOR_GET("interface/scene_tabs/show_script_button"); + // Get all scene names, which may be ambiguous. Vector<String> disambiguated_scene_names; Vector<String> full_path_names; @@ -207,13 +229,8 @@ void EditorSceneTabs::update_scene_tabs() { disambiguated_scene_names.append(EditorNode::get_editor_data().get_scene_title(i)); full_path_names.append(EditorNode::get_editor_data().get_scene_path(i)); } - EditorNode::disambiguate_filenames(full_path_names, disambiguated_scene_names); - // Workaround to ignore the tab_changed signal from the first added tab. - scene_tabs->disconnect("tab_changed", callable_mp(this, &EditorSceneTabs::_scene_tab_changed)); - - scene_tabs->clear_tabs(); Ref<Texture2D> script_icon = get_editor_theme_icon(SNAME("Script")); for (int i = 0; i < EditorNode::get_editor_data().get_edited_scene_count(); i++) { Node *type_node = EditorNode::get_editor_data().get_edited_scene_root(i); @@ -221,28 +238,35 @@ void EditorSceneTabs::update_scene_tabs() { if (type_node) { icon = EditorNode::get_singleton()->get_object_icon(type_node, "Node"); } + scene_tabs->set_tab_icon(i, icon); bool unsaved = EditorUndoRedoManager::get_singleton()->is_history_unsaved(EditorNode::get_editor_data().get_scene_history_id(i)); - scene_tabs->add_tab(disambiguated_scene_names[i] + (unsaved ? "(*)" : ""), icon); + scene_tabs->set_tab_title(i, disambiguated_scene_names[i] + (unsaved ? "(*)" : "")); if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_GLOBAL_MENU)) { - DisplayServer::get_singleton()->global_menu_add_item("_dock", EditorNode::get_editor_data().get_scene_title(i) + (unsaved ? "(*)" : ""), callable_mp(this, &EditorSceneTabs::_global_menu_scene), Callable(), i); + int global_menu_index = scene_tabs->get_tab_metadata(i); + DisplayServer::get_singleton()->global_menu_set_item_text("_dock", global_menu_index, EditorNode::get_editor_data().get_scene_title(i) + (unsaved ? "(*)" : "")); + DisplayServer::get_singleton()->global_menu_set_item_tag("_dock", global_menu_index, i); } if (show_rb && EditorNode::get_editor_data().get_scene_root_script(i).is_valid()) { scene_tabs->set_tab_button_icon(i, script_icon); + } else { + scene_tabs->set_tab_button_icon(i, nullptr); } } - if (DisplayServer::get_singleton()->has_feature(DisplayServer::FEATURE_GLOBAL_MENU)) { - DisplayServer::get_singleton()->global_menu_add_separator("_dock"); - DisplayServer::get_singleton()->global_menu_add_item("_dock", TTR("New Window"), callable_mp(this, &EditorSceneTabs::_global_menu_new_window)); + int current_tab = EditorNode::get_editor_data().get_edited_scene(); + if (scene_tabs->get_tab_count() > 0 && scene_tabs->get_current_tab() != current_tab) { + scene_tabs->set_block_signals(true); + scene_tabs->set_current_tab(current_tab); + scene_tabs->set_block_signals(false); } - if (scene_tabs->get_tab_count() > 0) { - scene_tabs->set_current_tab(EditorNode::get_editor_data().get_edited_scene()); - } + _scene_tabs_resized(); +} +void EditorSceneTabs::_scene_tabs_resized() { const Size2 add_button_size = Size2(scene_tab_add->get_size().x, scene_tabs->get_size().y); if (scene_tabs->get_offset_buttons_visible()) { // Move the add button to a fixed position. @@ -271,9 +295,6 @@ void EditorSceneTabs::update_scene_tabs() { scene_tab_add->set_rect(Rect2(Point2(last_tab.position.x + last_tab.size.width + hsep, last_tab.position.y), add_button_size)); } } - - // Reconnect after everything is done. - scene_tabs->connect("tab_changed", callable_mp(this, &EditorSceneTabs::_scene_tab_changed)); } void EditorSceneTabs::_tab_preview_done(const String &p_path, const Ref<Texture2D> &p_preview, const Ref<Texture2D> &p_small_preview, const Variant &p_udata) { @@ -365,7 +386,7 @@ EditorSceneTabs::EditorSceneTabs() { scene_tabs->connect("mouse_exited", callable_mp(this, &EditorSceneTabs::_scene_tab_exit)); scene_tabs->connect("gui_input", callable_mp(this, &EditorSceneTabs::_scene_tab_input)); scene_tabs->connect("active_tab_rearranged", callable_mp(this, &EditorSceneTabs::_reposition_active_tab)); - scene_tabs->connect("resized", callable_mp(this, &EditorSceneTabs::update_scene_tabs)); + scene_tabs->connect("resized", callable_mp(this, &EditorSceneTabs::_scene_tabs_resized)); scene_tabs_context_menu = memnew(PopupMenu); tabbar_container->add_child(scene_tabs_context_menu); diff --git a/editor/gui/editor_scene_tabs.h b/editor/gui/editor_scene_tabs.h index 88e5b35364..770114835a 100644 --- a/editor/gui/editor_scene_tabs.h +++ b/editor/gui/editor_scene_tabs.h @@ -63,7 +63,9 @@ class EditorSceneTabs : public MarginContainer { void _scene_tab_hovered(int p_tab); void _scene_tab_exit(); void _scene_tab_input(const Ref<InputEvent> &p_input); + void _scene_tabs_resized(); + void _update_tab_titles(); void _reposition_active_tab(int p_to_index); void _update_context_menu(); void _disable_menu_option_if(int p_option, bool p_condition); diff --git a/editor/gui/scene_tree_editor.cpp b/editor/gui/scene_tree_editor.cpp index 056e4f8d9d..327b73f993 100644 --- a/editor/gui/scene_tree_editor.cpp +++ b/editor/gui/scene_tree_editor.cpp @@ -50,7 +50,7 @@ #include "scene/main/window.h" #include "scene/resources/packed_scene.h" -Node *SceneTreeEditor::get_scene_node() { +Node *SceneTreeEditor::get_scene_node() const { ERR_FAIL_COND_V(!is_inside_tree(), nullptr); return get_tree()->get_edited_scene_root(); @@ -498,6 +498,18 @@ void SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) { EditorNode::get_singleton()->is_object_of_custom_type(p_node, E)) { valid = true; break; + } else { + Ref<Script> node_script = p_node->get_script(); + while (node_script.is_valid()) { + if (node_script->get_path() == E) { + valid = true; + break; + } + node_script = node_script->get_base_script(); + } + if (valid) { + break; + } } } @@ -656,6 +668,18 @@ bool SceneTreeEditor::_update_filter(TreeItem *p_parent, bool p_scroll_to_select EditorNode::get_singleton()->is_object_of_custom_type(n, E)) { selectable = true; break; + } else { + Ref<Script> node_script = n->get_script(); + while (node_script.is_valid()) { + if (node_script->get_path() == E) { + selectable = true; + break; + } + node_script = node_script->get_base_script(); + } + if (selectable) { + break; + } } } } @@ -1218,11 +1242,8 @@ Variant SceneTreeEditor::get_drag_data_fw(const Point2 &p_point, Control *p_from Node *n = get_node(np); if (n) { - // Only allow selection if not part of an instantiated scene. - if (!n->get_owner() || n->get_owner() == get_scene_node() || n->get_owner()->get_scene_file_path().is_empty()) { - selected_nodes.push_back(n); - icons.push_back(next->get_icon(0)); - } + selected_nodes.push_back(n); + icons.push_back(next->get_icon(0)); } next = tree->get_next_selected(next); } @@ -1305,8 +1326,7 @@ bool SceneTreeEditor::can_drop_data_fw(const Point2 &p_point, const Variant &p_d bool scene_drop = true; for (int i = 0; i < files.size(); i++) { - String file = files[i]; - String ftype = EditorFileSystem::get_singleton()->get_file_type(file); + String ftype = EditorFileSystem::get_singleton()->get_file_type(files[i]); if (ftype != "PackedScene") { scene_drop = false; break; @@ -1336,7 +1356,21 @@ bool SceneTreeEditor::can_drop_data_fw(const Point2 &p_point, const Variant &p_d } } - return String(d["type"]) == "nodes" && filter.is_empty(); + if (filter.is_empty() && String(d["type"]) == "nodes") { + Array nodes = d["nodes"]; + + for (int i = 0; i < nodes.size(); i++) { + Node *n = get_node(nodes[i]); + // Nodes from an instantiated scene can't be rearranged. + if (n && n->get_owner() && n->get_owner() != get_scene_node() && !n->get_owner()->get_scene_file_path().is_empty()) { + return false; + } + } + + return true; + } + + return false; } void SceneTreeEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) { @@ -1548,16 +1582,29 @@ void SceneTreeDialog::set_valid_types(const Vector<StringName> &p_valid) { HBoxContainer *hb = memnew(HBoxContainer); hflow->add_child(hb); + // Attempt to get the correct name and icon for script path types. + String name = type; + Ref<Texture2D> icon = EditorNode::get_singleton()->get_class_icon(type); + + // If we can't find a global class icon, try to find one for the script. + if (icon.is_null() && ResourceLoader::exists(type, "Script")) { + Ref<Script> node_script = ResourceLoader::load(type); + if (node_script.is_valid()) { + name = name.get_file(); + icon = EditorNode::get_singleton()->get_object_icon(node_script.ptr()); + } + } + TextureRect *trect = memnew(TextureRect); hb->add_child(trect); trect->set_expand_mode(TextureRect::EXPAND_IGNORE_SIZE); trect->set_stretch_mode(TextureRect::STRETCH_KEEP_ASPECT_CENTERED); - trect->set_meta("type", type); + trect->set_meta("icon", icon); valid_type_icons.push_back(trect); Label *label = memnew(Label); hb->add_child(label); - label->set_text(type); + label->set_text(name); label->set_auto_translate(false); } @@ -1583,7 +1630,7 @@ void SceneTreeDialog::_notification(int p_what) { filter->set_right_icon(get_editor_theme_icon(SNAME("Search"))); for (TextureRect *trect : valid_type_icons) { trect->set_custom_minimum_size(Vector2(get_theme_constant(SNAME("class_icon_size"), EditorStringName(Editor)), 0)); - trect->set_texture(EditorNode::get_singleton()->get_class_icon(trect->get_meta("type"))); + trect->set_texture(trect->get_meta("icon")); } } break; diff --git a/editor/gui/scene_tree_editor.h b/editor/gui/scene_tree_editor.h index 0df0c3a1c3..96d6d065f6 100644 --- a/editor/gui/scene_tree_editor.h +++ b/editor/gui/scene_tree_editor.h @@ -120,7 +120,7 @@ class SceneTreeEditor : public Control { void _set_item_custom_color(TreeItem *p_item, Color p_color); void _selection_changed(); - Node *get_scene_node(); + Node *get_scene_node() const; Variant get_drag_data_fw(const Point2 &p_point, Control *p_from); bool can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const; diff --git a/editor/icons/ShowInFileSystem.svg b/editor/icons/ShowInFileSystem.svg new file mode 100644 index 0000000000..9cfeaf48d2 --- /dev/null +++ b/editor/icons/ShowInFileSystem.svg @@ -0,0 +1 @@ +<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M1 1v2.25h6v4.5h3v4.5h5V10h-2.75V7.75H15V5.5H9.25V3.25H15V1z" fill="#e0e0e0"/><path d="M5.04 8.04c-1.534 0-3.475 1.169-4.173 3.423a.6.6 0 0 0 0 .33c.67 2.374 2.673 3.447 4.173 3.447s3.502-1.073 4.177-3.435a.6.6 0 0 0 0-.33C8.557 9.201 6.572 8.04 5.04 8.04zm0 1.2a2.4 2.4 0 0 1 0 4.8 2.4 2.4 0 0 1 0-4.8zm0 1.2a1.2 1.2 0 0 0 0 2.4 1.2 1.2 0 0 0 0-2.4z" fill="#5fb2ff"/></svg> diff --git a/editor/icons/SnapGrid.svg b/editor/icons/SnapGrid.svg index feb4206e81..070a842a4e 100644 --- a/editor/icons/SnapGrid.svg +++ b/editor/icons/SnapGrid.svg @@ -1 +1 @@ -<svg height="16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="M2 0v2H0v1h2v4H0v1h2v4H0v1h2v2h1v-2h3v-1H3V8h4l1-1V3h4v3h1V3h2V2h-2V0h-1v2H8V0H7v2H3V0zm1 3h4v4H3zm4 10v2h2v-2zm6 0v2h2v-2z" fill="#def"/><path d="M7 13h2v-2a2 2 0 0 1 4 0v2h2v-2a4 4 0 0 0-8 0z" fill="#def" fill-opacity=".8"/></svg> +<svg height="16" width="16" xmlns="http://www.w3.org/2000/svg"><path d="M2 0v2H0v1h2v4H0v1h2v4H0v1h2v2h1v-2h3v-1H3V8h4l1-1V3h4v3h1V3h2V2h-2V0h-1v2H8V0H7v2H3V0zm1 3h4v4H3zm4 10v2h2v-2zm6 0v2h2v-2z" fill="#e0e0e0"/><path d="M7 13h2v-2a2 2 0 0 1 4 0v2h2v-2a4 4 0 0 0-8 0z" fill="#e0e0e0" fill-opacity=".8"/></svg> diff --git a/editor/icons/Texture2D.svg b/editor/icons/Texture2D.svg new file mode 100644 index 0000000000..635547ba03 --- /dev/null +++ b/editor/icons/Texture2D.svg @@ -0,0 +1 @@ +<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><g fill="#808080"><path d="M2 1a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1zm1 2h10v8H3z"/><path d="M3.5 3.5h9v7h-9" fill-opacity=".2"/></g></svg> diff --git a/editor/icons/Texture3D.svg b/editor/icons/Texture3D.svg new file mode 100644 index 0000000000..208fa41b61 --- /dev/null +++ b/editor/icons/Texture3D.svg @@ -0,0 +1 @@ +<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><g fill="gray"><path d="M1 14a1 1 0 0 0 1 1h9.5a1 1 0 0 0 .707-.293l2.5-2.5A1 1 0 0 0 15 11.5V2a1 1 0 0 0-1-1H4.5a1 1 0 0 0-.707.293l-2.5 2.5A1 1 0 0 0 1 4.5zm1.25-9H11v7H2.25zm10 6.25v-6.5L14 3v6.5zm-1-7.5H3L4.75 2H13z"/><path d="M2.75 5.5h7.75v6H2.75" fill-opacity=".2"/></g></svg> diff --git a/editor/import/audio_stream_import_settings.cpp b/editor/import/audio_stream_import_settings.cpp index d86b064549..5414c6e74b 100644 --- a/editor/import/audio_stream_import_settings.cpp +++ b/editor/import/audio_stream_import_settings.cpp @@ -35,13 +35,13 @@ #include "editor/editor_string_names.h" #include "scene/gui/check_box.h" -AudioStreamImportSettings *AudioStreamImportSettings::singleton = nullptr; +AudioStreamImportSettingsDialog *AudioStreamImportSettingsDialog::singleton = nullptr; -void AudioStreamImportSettings::_notification(int p_what) { +void AudioStreamImportSettingsDialog::_notification(int p_what) { switch (p_what) { case NOTIFICATION_READY: { - AudioStreamPreviewGenerator::get_singleton()->connect("preview_updated", callable_mp(this, &AudioStreamImportSettings::_preview_changed)); - connect("confirmed", callable_mp(this, &AudioStreamImportSettings::_reimport)); + AudioStreamPreviewGenerator::get_singleton()->connect("preview_updated", callable_mp(this, &AudioStreamImportSettingsDialog::_preview_changed)); + connect("confirmed", callable_mp(this, &AudioStreamImportSettingsDialog::_reimport)); } break; case NOTIFICATION_THEME_CHANGED: { @@ -82,7 +82,7 @@ void AudioStreamImportSettings::_notification(int p_what) { } } -void AudioStreamImportSettings::_draw_preview() { +void AudioStreamImportSettingsDialog::_draw_preview() { Rect2 rect = _preview->get_rect(); Size2 rect_size = rect.size; int width = rect_size.width; @@ -173,13 +173,13 @@ void AudioStreamImportSettings::_draw_preview() { } } -void AudioStreamImportSettings::_preview_changed(ObjectID p_which) { +void AudioStreamImportSettingsDialog::_preview_changed(ObjectID p_which) { if (stream.is_valid() && stream->get_instance_id() == p_which) { _preview->queue_redraw(); } } -void AudioStreamImportSettings::_preview_zoom_in() { +void AudioStreamImportSettingsDialog::_preview_zoom_in() { if (!stream.is_valid()) { return; } @@ -191,7 +191,7 @@ void AudioStreamImportSettings::_preview_zoom_in() { _indicator->queue_redraw(); } -void AudioStreamImportSettings::_preview_zoom_out() { +void AudioStreamImportSettingsDialog::_preview_zoom_out() { if (!stream.is_valid()) { return; } @@ -203,7 +203,7 @@ void AudioStreamImportSettings::_preview_zoom_out() { _indicator->queue_redraw(); } -void AudioStreamImportSettings::_preview_zoom_reset() { +void AudioStreamImportSettingsDialog::_preview_zoom_reset() { if (!stream.is_valid()) { return; } @@ -214,12 +214,12 @@ void AudioStreamImportSettings::_preview_zoom_reset() { _indicator->queue_redraw(); } -void AudioStreamImportSettings::_preview_zoom_offset_changed(double) { +void AudioStreamImportSettingsDialog::_preview_zoom_offset_changed(double) { _preview->queue_redraw(); _indicator->queue_redraw(); } -void AudioStreamImportSettings::_audio_changed() { +void AudioStreamImportSettingsDialog::_audio_changed() { if (!is_visible()) { return; } @@ -228,7 +228,7 @@ void AudioStreamImportSettings::_audio_changed() { color_rect->queue_redraw(); } -void AudioStreamImportSettings::_play() { +void AudioStreamImportSettingsDialog::_play() { if (_player->is_playing()) { // '_pausing' variable indicates that we want to pause the audio player, not stop it. See '_on_finished()'. _pausing = true; @@ -242,7 +242,7 @@ void AudioStreamImportSettings::_play() { } } -void AudioStreamImportSettings::_stop() { +void AudioStreamImportSettingsDialog::_stop() { _player->stop(); _play_button->set_icon(get_editor_theme_icon(SNAME("MainPlay"))); _current = 0; @@ -250,7 +250,7 @@ void AudioStreamImportSettings::_stop() { set_process(false); } -void AudioStreamImportSettings::_on_finished() { +void AudioStreamImportSettingsDialog::_on_finished() { _play_button->set_icon(get_editor_theme_icon(SNAME("MainPlay"))); if (!_pausing) { _current = 0; @@ -261,7 +261,7 @@ void AudioStreamImportSettings::_on_finished() { set_process(false); } -void AudioStreamImportSettings::_draw_indicator() { +void AudioStreamImportSettingsDialog::_draw_indicator() { if (!stream.is_valid()) { return; } @@ -314,12 +314,12 @@ void AudioStreamImportSettings::_draw_indicator() { _current_label->set_text(String::num(_current, 2).pad_decimals(2) + " /"); } -void AudioStreamImportSettings::_on_indicator_mouse_exited() { +void AudioStreamImportSettingsDialog::_on_indicator_mouse_exited() { _hovering_beat = -1; _indicator->queue_redraw(); } -void AudioStreamImportSettings::_on_input_indicator(Ref<InputEvent> p_event) { +void AudioStreamImportSettingsDialog::_on_input_indicator(Ref<InputEvent> p_event) { const Ref<InputEventMouseButton> mb = p_event; if (mb.is_valid() && mb->get_button_index() == MouseButton::LEFT) { if (stream->get_bpm() > 0) { @@ -369,7 +369,7 @@ void AudioStreamImportSettings::_on_input_indicator(Ref<InputEvent> p_event) { } } -int AudioStreamImportSettings::_get_beat_at_pos(real_t p_x) { +int AudioStreamImportSettingsDialog::_get_beat_at_pos(real_t p_x) { float ofs_sec = zoom_bar->get_value() + p_x * zoom_bar->get_page() / _preview->get_size().width; ofs_sec = CLAMP(ofs_sec, 0, stream->get_length()); float beat_size = 60 / float(stream->get_bpm()); @@ -381,7 +381,7 @@ int AudioStreamImportSettings::_get_beat_at_pos(real_t p_x) { return beat; } -void AudioStreamImportSettings::_set_beat_len_to(real_t p_x) { +void AudioStreamImportSettingsDialog::_set_beat_len_to(real_t p_x) { int beat = _get_beat_at_pos(p_x); if (beat < 1) { beat = 1; // Because 0 is disable. @@ -393,16 +393,16 @@ void AudioStreamImportSettings::_set_beat_len_to(real_t p_x) { _settings_changed(); } -void AudioStreamImportSettings::_seek_to(real_t p_x) { +void AudioStreamImportSettingsDialog::_seek_to(real_t p_x) { _current = zoom_bar->get_value() + p_x / _preview->get_rect().size.x * zoom_bar->get_page(); _current = CLAMP(_current, 0, stream->get_length()); _player->seek(_current); _indicator->queue_redraw(); } -void AudioStreamImportSettings::edit(const String &p_path, const String &p_importer, const Ref<AudioStream> &p_stream) { +void AudioStreamImportSettingsDialog::edit(const String &p_path, const String &p_importer, const Ref<AudioStream> &p_stream) { if (!stream.is_null()) { - stream->disconnect_changed(callable_mp(this, &AudioStreamImportSettings::_audio_changed)); + stream->disconnect_changed(callable_mp(this, &AudioStreamImportSettingsDialog::_audio_changed)); } importer = p_importer; @@ -415,7 +415,7 @@ void AudioStreamImportSettings::edit(const String &p_path, const String &p_impor _duration_label->set_text(text); if (!stream.is_null()) { - stream->connect_changed(callable_mp(this, &AudioStreamImportSettings::_audio_changed)); + stream->connect_changed(callable_mp(this, &AudioStreamImportSettingsDialog::_audio_changed)); _preview->queue_redraw(); _indicator->queue_redraw(); color_rect->queue_redraw(); @@ -464,7 +464,7 @@ void AudioStreamImportSettings::edit(const String &p_path, const String &p_impor } } -void AudioStreamImportSettings::_settings_changed() { +void AudioStreamImportSettingsDialog::_settings_changed() { if (updating_settings) { return; } @@ -515,7 +515,7 @@ void AudioStreamImportSettings::_settings_changed() { color_rect->queue_redraw(); } -void AudioStreamImportSettings::_reimport() { +void AudioStreamImportSettingsDialog::_reimport() { params["loop"] = loop->is_pressed(); params["loop_offset"] = loop_offset->get_value(); params["bpm"] = bpm_enabled->is_pressed() ? double(bpm_edit->get_value()) : double(0); @@ -525,7 +525,7 @@ void AudioStreamImportSettings::_reimport() { EditorFileSystem::get_singleton()->reimport_file_with_custom_parameters(path, importer, params); } -AudioStreamImportSettings::AudioStreamImportSettings() { +AudioStreamImportSettingsDialog::AudioStreamImportSettingsDialog() { get_ok_button()->set_text(TTR("Reimport")); get_cancel_button()->set_text(TTR("Close")); @@ -537,7 +537,7 @@ AudioStreamImportSettings::AudioStreamImportSettings() { loop = memnew(CheckBox); loop->set_text(TTR("Enable")); loop->set_tooltip_text(TTR("Enable looping.")); - loop->connect("toggled", callable_mp(this, &AudioStreamImportSettings::_settings_changed).unbind(1)); + loop->connect("toggled", callable_mp(this, &AudioStreamImportSettingsDialog::_settings_changed).unbind(1)); loop_hb->add_child(loop); loop_hb->add_spacer(); loop_hb->add_child(memnew(Label(TTR("Offset:")))); @@ -546,7 +546,7 @@ AudioStreamImportSettings::AudioStreamImportSettings() { loop_offset->set_step(0.001); loop_offset->set_suffix("sec"); loop_offset->set_tooltip_text(TTR("Loop offset (from beginning). Note that if BPM is set, this setting will be ignored.")); - loop_offset->connect("value_changed", callable_mp(this, &AudioStreamImportSettings::_settings_changed).unbind(1)); + loop_offset->connect("value_changed", callable_mp(this, &AudioStreamImportSettingsDialog::_settings_changed).unbind(1)); loop_hb->add_child(loop_offset); main_vbox->add_margin_child(TTR("Loop:"), loop_hb); @@ -554,23 +554,23 @@ AudioStreamImportSettings::AudioStreamImportSettings() { interactive_hb->add_theme_constant_override("separation", 4 * EDSCALE); bpm_enabled = memnew(CheckBox); bpm_enabled->set_text((TTR("BPM:"))); - bpm_enabled->connect("toggled", callable_mp(this, &AudioStreamImportSettings::_settings_changed).unbind(1)); + bpm_enabled->connect("toggled", callable_mp(this, &AudioStreamImportSettingsDialog::_settings_changed).unbind(1)); interactive_hb->add_child(bpm_enabled); bpm_edit = memnew(SpinBox); bpm_edit->set_max(400); bpm_edit->set_step(0.01); bpm_edit->set_tooltip_text(TTR("Configure the Beats Per Measure (tempo) used for the interactive streams.\nThis is required in order to configure beat information.")); - bpm_edit->connect("value_changed", callable_mp(this, &AudioStreamImportSettings::_settings_changed).unbind(1)); + bpm_edit->connect("value_changed", callable_mp(this, &AudioStreamImportSettingsDialog::_settings_changed).unbind(1)); interactive_hb->add_child(bpm_edit); interactive_hb->add_spacer(); beats_enabled = memnew(CheckBox); beats_enabled->set_text(TTR("Beat Count:")); - beats_enabled->connect("toggled", callable_mp(this, &AudioStreamImportSettings::_settings_changed).unbind(1)); + beats_enabled->connect("toggled", callable_mp(this, &AudioStreamImportSettingsDialog::_settings_changed).unbind(1)); interactive_hb->add_child(beats_enabled); beats_edit = memnew(SpinBox); beats_edit->set_tooltip_text(TTR("Configure the amount of Beats used for music-aware looping. If zero, it will be autodetected from the length.\nIt is recommended to set this value (either manually or by clicking on a beat number in the preview) to ensure looping works properly.")); beats_edit->set_max(99999); - beats_edit->connect("value_changed", callable_mp(this, &AudioStreamImportSettings::_settings_changed).unbind(1)); + beats_edit->connect("value_changed", callable_mp(this, &AudioStreamImportSettingsDialog::_settings_changed).unbind(1)); interactive_hb->add_child(beats_edit); bar_beats_label = memnew(Label(TTR("Bar Beats:"))); interactive_hb->add_child(bar_beats_label); @@ -578,7 +578,7 @@ AudioStreamImportSettings::AudioStreamImportSettings() { bar_beats_edit->set_tooltip_text(TTR("Configure the Beats Per Bar. This used for music-aware transitions between AudioStreams.")); bar_beats_edit->set_min(2); bar_beats_edit->set_max(32); - bar_beats_edit->connect("value_changed", callable_mp(this, &AudioStreamImportSettings::_settings_changed).unbind(1)); + bar_beats_edit->connect("value_changed", callable_mp(this, &AudioStreamImportSettingsDialog::_settings_changed).unbind(1)); interactive_hb->add_child(bar_beats_edit); interactive_hb->add_spacer(); main_vbox->add_margin_child(TTR("Music Playback:"), interactive_hb); @@ -590,7 +590,7 @@ AudioStreamImportSettings::AudioStreamImportSettings() { color_rect->set_v_size_flags(Control::SIZE_EXPAND_FILL); _player = memnew(AudioStreamPlayer); - _player->connect("finished", callable_mp(this, &AudioStreamImportSettings::_on_finished)); + _player->connect("finished", callable_mp(this, &AudioStreamImportSettingsDialog::_on_finished)); color_rect->add_child(_player); VBoxContainer *vbox = memnew(VBoxContainer); @@ -600,7 +600,7 @@ AudioStreamImportSettings::AudioStreamImportSettings() { _preview = memnew(ColorRect); _preview->set_v_size_flags(Control::SIZE_EXPAND_FILL); - _preview->connect("draw", callable_mp(this, &AudioStreamImportSettings::_draw_preview)); + _preview->connect("draw", callable_mp(this, &AudioStreamImportSettingsDialog::_draw_preview)); _preview->set_v_size_flags(Control::SIZE_EXPAND_FILL); vbox->add_child(_preview); @@ -618,17 +618,17 @@ AudioStreamImportSettings::AudioStreamImportSettings() { zoom_hbox->add_child(zoom_out); zoom_hbox->add_child(zoom_reset); zoom_hbox->add_child(zoom_in); - zoom_in->connect("pressed", callable_mp(this, &AudioStreamImportSettings::_preview_zoom_in)); - zoom_reset->connect("pressed", callable_mp(this, &AudioStreamImportSettings::_preview_zoom_reset)); - zoom_out->connect("pressed", callable_mp(this, &AudioStreamImportSettings::_preview_zoom_out)); - zoom_bar->connect("value_changed", callable_mp(this, &AudioStreamImportSettings::_preview_zoom_offset_changed)); + zoom_in->connect("pressed", callable_mp(this, &AudioStreamImportSettingsDialog::_preview_zoom_in)); + zoom_reset->connect("pressed", callable_mp(this, &AudioStreamImportSettingsDialog::_preview_zoom_reset)); + zoom_out->connect("pressed", callable_mp(this, &AudioStreamImportSettingsDialog::_preview_zoom_out)); + zoom_bar->connect("value_changed", callable_mp(this, &AudioStreamImportSettingsDialog::_preview_zoom_offset_changed)); vbox->add_child(zoom_hbox); _indicator = memnew(Control); _indicator->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT); - _indicator->connect("draw", callable_mp(this, &AudioStreamImportSettings::_draw_indicator)); - _indicator->connect("gui_input", callable_mp(this, &AudioStreamImportSettings::_on_input_indicator)); - _indicator->connect("mouse_exited", callable_mp(this, &AudioStreamImportSettings::_on_indicator_mouse_exited)); + _indicator->connect("draw", callable_mp(this, &AudioStreamImportSettingsDialog::_draw_indicator)); + _indicator->connect("gui_input", callable_mp(this, &AudioStreamImportSettingsDialog::_on_input_indicator)); + _indicator->connect("mouse_exited", callable_mp(this, &AudioStreamImportSettingsDialog::_on_indicator_mouse_exited)); _preview->add_child(_indicator); HBoxContainer *hbox = memnew(HBoxContainer); @@ -639,13 +639,13 @@ AudioStreamImportSettings::AudioStreamImportSettings() { _play_button->set_flat(true); hbox->add_child(_play_button); _play_button->set_focus_mode(Control::FOCUS_NONE); - _play_button->connect("pressed", callable_mp(this, &AudioStreamImportSettings::_play)); + _play_button->connect("pressed", callable_mp(this, &AudioStreamImportSettingsDialog::_play)); _stop_button = memnew(Button); _stop_button->set_flat(true); hbox->add_child(_stop_button); _stop_button->set_focus_mode(Control::FOCUS_NONE); - _stop_button->connect("pressed", callable_mp(this, &AudioStreamImportSettings::_stop)); + _stop_button->connect("pressed", callable_mp(this, &AudioStreamImportSettingsDialog::_stop)); _current_label = memnew(Label); _current_label->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_RIGHT); diff --git a/editor/import/audio_stream_import_settings.h b/editor/import/audio_stream_import_settings.h index 939dcd9769..da6344adb9 100644 --- a/editor/import/audio_stream_import_settings.h +++ b/editor/import/audio_stream_import_settings.h @@ -40,8 +40,8 @@ class CheckBox; -class AudioStreamImportSettings : public ConfirmationDialog { - GDCLASS(AudioStreamImportSettings, ConfirmationDialog); +class AudioStreamImportSettingsDialog : public ConfirmationDialog { + GDCLASS(AudioStreamImportSettingsDialog, ConfirmationDialog); CheckBox *bpm_enabled = nullptr; SpinBox *bpm_edit = nullptr; @@ -81,7 +81,7 @@ class AudioStreamImportSettings : public ConfirmationDialog { void _audio_changed(); - static AudioStreamImportSettings *singleton; + static AudioStreamImportSettingsDialog *singleton; void _settings_changed(); @@ -109,9 +109,9 @@ protected: public: void edit(const String &p_path, const String &p_importer, const Ref<AudioStream> &p_stream); - static AudioStreamImportSettings *get_singleton() { return singleton; } + static AudioStreamImportSettingsDialog *get_singleton() { return singleton; } - AudioStreamImportSettings(); + AudioStreamImportSettingsDialog(); }; #endif // AUDIO_STREAM_IMPORT_SETTINGS_H diff --git a/editor/import/dynamic_font_import_settings.cpp b/editor/import/dynamic_font_import_settings.cpp index 9e584cd417..5564726594 100644 --- a/editor/import/dynamic_font_import_settings.cpp +++ b/editor/import/dynamic_font_import_settings.cpp @@ -427,7 +427,7 @@ static UniRange unicode_ranges[] = { { 0x10FFFF, 0x10FFFF, String() } }; -void DynamicFontImportSettings::_add_glyph_range_item(int32_t p_start, int32_t p_end, const String &p_name) { +void DynamicFontImportSettingsDialog::_add_glyph_range_item(int32_t p_start, int32_t p_end, const String &p_name) { const int page_size = 512; int pages = (p_end - p_start) / page_size; int remain = (p_end - p_start) % page_size; @@ -456,7 +456,7 @@ void DynamicFontImportSettings::_add_glyph_range_item(int32_t p_start, int32_t p /* Page 1 callbacks: Rendering Options */ /*************************************************************************/ -void DynamicFontImportSettings::_main_prop_changed(const String &p_edited_property) { +void DynamicFontImportSettingsDialog::_main_prop_changed(const String &p_edited_property) { // Update font preview. if (font_preview.is_valid()) { @@ -494,7 +494,7 @@ void DynamicFontImportSettings::_main_prop_changed(const String &p_edited_proper /* Page 2 callbacks: Configurations */ /*************************************************************************/ -void DynamicFontImportSettings::_variation_add() { +void DynamicFontImportSettingsDialog::_variation_add() { TreeItem *vars_item = vars_list->create_item(vars_list_root); ERR_FAIL_NULL(vars_item); @@ -522,7 +522,7 @@ void DynamicFontImportSettings::_variation_add() { _variations_validate(); } -void DynamicFontImportSettings::_variation_selected() { +void DynamicFontImportSettingsDialog::_variation_selected() { TreeItem *vars_item = vars_list->get_selected(); if (vars_item) { Ref<DynamicFontImportSettingsData> import_variation_data = vars_item->get_metadata(0); @@ -543,7 +543,7 @@ void DynamicFontImportSettings::_variation_selected() { } } -void DynamicFontImportSettings::_variation_remove(Object *p_item, int p_column, int p_id, MouseButton p_button) { +void DynamicFontImportSettingsDialog::_variation_remove(Object *p_item, int p_column, int p_id, MouseButton p_button) { if (p_button != MouseButton::LEFT) { return; } @@ -574,11 +574,11 @@ void DynamicFontImportSettings::_variation_remove(Object *p_item, int p_column, } } -void DynamicFontImportSettings::_variation_changed(const String &p_edited_property) { +void DynamicFontImportSettingsDialog::_variation_changed(const String &p_edited_property) { _variations_validate(); } -void DynamicFontImportSettings::_variations_validate() { +void DynamicFontImportSettingsDialog::_variations_validate() { String warn; if (!vars_list_root->get_first_child()) { warn = TTR("Warning: There are no configurations specified, no glyphs will be pre-rendered."); @@ -621,7 +621,7 @@ void DynamicFontImportSettings::_variations_validate() { /* Page 2.1 callbacks: Text to select glyphs */ /*************************************************************************/ -void DynamicFontImportSettings::_change_text_opts() { +void DynamicFontImportSettingsDialog::_change_text_opts() { Ref<DynamicFontImportSettingsData> import_variation_data; TreeItem *vars_item = vars_list->get_selected(); @@ -644,7 +644,7 @@ void DynamicFontImportSettings::_change_text_opts() { text_edit->add_theme_font_override("font", font_main_text); } -void DynamicFontImportSettings::_glyph_update_lbl() { +void DynamicFontImportSettingsDialog::_glyph_update_lbl() { Ref<DynamicFontImportSettingsData> import_variation_data; TreeItem *vars_item = vars_list->get_selected(); @@ -665,7 +665,7 @@ void DynamicFontImportSettings::_glyph_update_lbl() { label_glyphs->set_text(vformat(TTR("Preloaded glyphs: %d"), unlinked_glyphs + import_variation_data->selected_chars.size())); } -void DynamicFontImportSettings::_glyph_clear() { +void DynamicFontImportSettingsDialog::_glyph_clear() { Ref<DynamicFontImportSettingsData> import_variation_data; TreeItem *vars_item = vars_list->get_selected(); @@ -681,7 +681,7 @@ void DynamicFontImportSettings::_glyph_clear() { _range_selected(); } -void DynamicFontImportSettings::_glyph_text_selected() { +void DynamicFontImportSettingsDialog::_glyph_text_selected() { Ref<DynamicFontImportSettingsData> import_variation_data; TreeItem *vars_item = vars_list->get_selected(); @@ -713,7 +713,7 @@ void DynamicFontImportSettings::_glyph_text_selected() { /* Page 2.2 callbacks: Character map */ /*************************************************************************/ -void DynamicFontImportSettings::_glyph_selected() { +void DynamicFontImportSettingsDialog::_glyph_selected() { Ref<DynamicFontImportSettingsData> import_variation_data; TreeItem *vars_item = vars_list->get_selected(); @@ -768,14 +768,14 @@ void DynamicFontImportSettings::_glyph_selected() { } } -void DynamicFontImportSettings::_range_edited() { +void DynamicFontImportSettingsDialog::_range_edited() { TreeItem *item = glyph_tree->get_selected(); ERR_FAIL_NULL(item); Vector2i range = item->get_metadata(0); _range_update(range.x, range.y); } -void DynamicFontImportSettings::_range_selected() { +void DynamicFontImportSettingsDialog::_range_selected() { TreeItem *item = glyph_tree->get_selected(); if (item) { Vector2i range = item->get_metadata(0); @@ -783,7 +783,7 @@ void DynamicFontImportSettings::_range_selected() { } } -void DynamicFontImportSettings::_edit_range(int32_t p_start, int32_t p_end) { +void DynamicFontImportSettingsDialog::_edit_range(int32_t p_start, int32_t p_end) { Ref<DynamicFontImportSettingsData> import_variation_data; TreeItem *vars_item = vars_list->get_selected(); @@ -845,7 +845,7 @@ void DynamicFontImportSettings::_edit_range(int32_t p_start, int32_t p_end) { _glyph_update_lbl(); } -bool DynamicFontImportSettings::_char_update(int32_t p_char) { +bool DynamicFontImportSettingsDialog::_char_update(int32_t p_char) { Ref<DynamicFontImportSettingsData> import_variation_data; TreeItem *vars_item = vars_list->get_selected(); @@ -868,7 +868,7 @@ bool DynamicFontImportSettings::_char_update(int32_t p_char) { } } -void DynamicFontImportSettings::_range_update(int32_t p_start, int32_t p_end) { +void DynamicFontImportSettingsDialog::_range_update(int32_t p_start, int32_t p_end) { Ref<DynamicFontImportSettingsData> import_variation_data; TreeItem *vars_item = vars_list->get_selected(); @@ -912,17 +912,17 @@ void DynamicFontImportSettings::_range_update(int32_t p_start, int32_t p_end) { /* Common */ /*************************************************************************/ -DynamicFontImportSettings *DynamicFontImportSettings::singleton = nullptr; +DynamicFontImportSettingsDialog *DynamicFontImportSettingsDialog::singleton = nullptr; -String DynamicFontImportSettings::_pad_zeros(const String &p_hex) const { +String DynamicFontImportSettingsDialog::_pad_zeros(const String &p_hex) const { int len = CLAMP(5 - p_hex.length(), 0, 5); return String("0").repeat(len) + p_hex; } -void DynamicFontImportSettings::_notification(int p_what) { +void DynamicFontImportSettingsDialog::_notification(int p_what) { switch (p_what) { case NOTIFICATION_READY: { - connect("confirmed", callable_mp(this, &DynamicFontImportSettings::_re_import)); + connect("confirmed", callable_mp(this, &DynamicFontImportSettingsDialog::_re_import)); } break; case NOTIFICATION_THEME_CHANGED: { @@ -932,7 +932,7 @@ void DynamicFontImportSettings::_notification(int p_what) { } } -void DynamicFontImportSettings::_re_import() { +void DynamicFontImportSettingsDialog::_re_import() { HashMap<StringName, Variant> main_settings; main_settings["face_index"] = import_settings_data->get("face_index"); @@ -999,13 +999,13 @@ void DynamicFontImportSettings::_re_import() { EditorFileSystem::get_singleton()->reimport_file_with_custom_parameters(base_path, "font_data_dynamic", main_settings); } -void DynamicFontImportSettings::_locale_edited() { +void DynamicFontImportSettingsDialog::_locale_edited() { TreeItem *item = locale_tree->get_selected(); ERR_FAIL_NULL(item); item->set_checked(0, !item->is_checked(0)); } -void DynamicFontImportSettings::_process_locales() { +void DynamicFontImportSettingsDialog::_process_locales() { Ref<DynamicFontImportSettingsData> import_variation_data; TreeItem *vars_item = vars_list->get_selected(); @@ -1049,7 +1049,7 @@ void DynamicFontImportSettings::_process_locales() { _range_selected(); } -void DynamicFontImportSettings::open_settings(const String &p_path) { +void DynamicFontImportSettingsDialog::open_settings(const String &p_path) { // Load base font data. Vector<uint8_t> font_data = FileAccess::get_file_as_bytes(p_path); @@ -1234,11 +1234,11 @@ void DynamicFontImportSettings::open_settings(const String &p_path) { set_title(vformat(TTR("Advanced Import Settings for '%s'"), base_path.get_file())); } -DynamicFontImportSettings *DynamicFontImportSettings::get_singleton() { +DynamicFontImportSettingsDialog *DynamicFontImportSettingsDialog::get_singleton() { return singleton; } -DynamicFontImportSettings::DynamicFontImportSettings() { +DynamicFontImportSettingsDialog::DynamicFontImportSettingsDialog() { singleton = this; options_general.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::NIL, "Rendering", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_GROUP), Variant())); @@ -1334,7 +1334,7 @@ DynamicFontImportSettings::DynamicFontImportSettings() { inspector_general->set_v_size_flags(Control::SIZE_EXPAND_FILL); inspector_general->set_custom_minimum_size(Size2(300 * EDSCALE, 250 * EDSCALE)); page1_hb->add_child(inspector_general); - inspector_general->connect("property_edited", callable_mp(this, &DynamicFontImportSettings::_main_prop_changed)); + inspector_general->connect("property_edited", callable_mp(this, &DynamicFontImportSettingsDialog::_main_prop_changed)); // Page 2 layout: Configurations VBoxContainer *page2_vb = memnew(VBoxContainer); @@ -1367,7 +1367,7 @@ DynamicFontImportSettings::DynamicFontImportSettings() { add_var = memnew(Button); add_var->set_tooltip_text(TTR("Add configuration")); page2_hb_vars->add_child(add_var); - add_var->connect("pressed", callable_mp(this, &DynamicFontImportSettings::_variation_add)); + add_var->connect("pressed", callable_mp(this, &DynamicFontImportSettingsDialog::_variation_add)); vars_list = memnew(Tree); vars_list->set_custom_minimum_size(Size2(300 * EDSCALE, 0)); @@ -1379,13 +1379,13 @@ DynamicFontImportSettings::DynamicFontImportSettings() { vars_list->set_column_custom_minimum_width(1, 50 * EDSCALE); vars_list->set_v_size_flags(Control::SIZE_EXPAND_FILL); page2_side_vb->add_child(vars_list); - vars_list->connect("item_selected", callable_mp(this, &DynamicFontImportSettings::_variation_selected)); - vars_list->connect("button_clicked", callable_mp(this, &DynamicFontImportSettings::_variation_remove)); + vars_list->connect("item_selected", callable_mp(this, &DynamicFontImportSettingsDialog::_variation_selected)); + vars_list->connect("button_clicked", callable_mp(this, &DynamicFontImportSettingsDialog::_variation_remove)); inspector_vars = memnew(EditorInspector); inspector_vars->set_v_size_flags(Control::SIZE_EXPAND_FILL); page2_side_vb->add_child(inspector_vars); - inspector_vars->connect("property_edited", callable_mp(this, &DynamicFontImportSettings::_variation_changed)); + inspector_vars->connect("property_edited", callable_mp(this, &DynamicFontImportSettingsDialog::_variation_changed)); VBoxContainer *preload_pages_vb = memnew(VBoxContainer); page2_hb->add_child(preload_pages_vb); @@ -1408,7 +1408,7 @@ DynamicFontImportSettings::DynamicFontImportSettings() { Button *btn_clear = memnew(Button); btn_clear->set_text(TTR("Clear Glyph List")); gl_hb->add_child(btn_clear); - btn_clear->connect("pressed", callable_mp(this, &DynamicFontImportSettings::_glyph_clear)); + btn_clear->connect("pressed", callable_mp(this, &DynamicFontImportSettingsDialog::_glyph_clear)); VBoxContainer *page2_0_vb = memnew(VBoxContainer); page2_0_vb->set_name(TTR("Glyphs from the Translations")); @@ -1427,7 +1427,7 @@ DynamicFontImportSettings::DynamicFontImportSettings() { locale_tree->set_column_custom_minimum_width(0, 120 * EDSCALE); locale_tree->set_v_size_flags(Control::SIZE_EXPAND_FILL); page2_0_vb->add_child(locale_tree); - locale_tree->connect("item_activated", callable_mp(this, &DynamicFontImportSettings::_locale_edited)); + locale_tree->connect("item_activated", callable_mp(this, &DynamicFontImportSettingsDialog::_locale_edited)); locale_root = locale_tree->create_item(); @@ -1438,7 +1438,7 @@ DynamicFontImportSettings::DynamicFontImportSettings() { btn_fill_locales = memnew(Button); btn_fill_locales->set_text(TTR("Shape all Strings in the Translations and Add Glyphs")); locale_hb->add_child(btn_fill_locales); - btn_fill_locales->connect("pressed", callable_mp(this, &DynamicFontImportSettings::_process_locales)); + btn_fill_locales->connect("pressed", callable_mp(this, &DynamicFontImportSettingsDialog::_process_locales)); // Page 2.1 layout: Text to select glyphs VBoxContainer *page2_1_vb = memnew(VBoxContainer); @@ -1461,7 +1461,7 @@ DynamicFontImportSettings::DynamicFontImportSettings() { inspector_text->set_v_size_flags(Control::SIZE_EXPAND_FILL); inspector_text->set_custom_minimum_size(Size2(300 * EDSCALE, 250 * EDSCALE)); page2_1_hb->add_child(inspector_text); - inspector_text->connect("property_edited", callable_mp(this, &DynamicFontImportSettings::_change_text_opts)); + inspector_text->connect("property_edited", callable_mp(this, &DynamicFontImportSettingsDialog::_change_text_opts)); text_edit = memnew(TextEdit); text_edit->set_v_size_flags(Control::SIZE_EXPAND_FILL); @@ -1475,7 +1475,7 @@ DynamicFontImportSettings::DynamicFontImportSettings() { btn_fill = memnew(Button); btn_fill->set_text(TTR("Shape Text and Add Glyphs")); text_hb->add_child(btn_fill); - btn_fill->connect("pressed", callable_mp(this, &DynamicFontImportSettings::_glyph_text_selected)); + btn_fill->connect("pressed", callable_mp(this, &DynamicFontImportSettingsDialog::_glyph_text_selected)); // Page 2.2 layout: Character map VBoxContainer *page2_2_vb = memnew(VBoxContainer); @@ -1510,7 +1510,7 @@ DynamicFontImportSettings::DynamicFontImportSettings() { glyph_table->set_h_size_flags(Control::SIZE_EXPAND_FILL); glyph_table->set_v_size_flags(Control::SIZE_EXPAND_FILL); glyphs_split->add_child(glyph_table); - glyph_table->connect("item_activated", callable_mp(this, &DynamicFontImportSettings::_glyph_selected)); + glyph_table->connect("item_activated", callable_mp(this, &DynamicFontImportSettingsDialog::_glyph_selected)); glyph_tree = memnew(Tree); glyph_tree->set_custom_minimum_size(Size2(300 * EDSCALE, 0)); @@ -1525,8 +1525,8 @@ DynamicFontImportSettings::DynamicFontImportSettings() { _add_glyph_range_item(unicode_ranges[i].start, unicode_ranges[i].end, unicode_ranges[i].name); } glyphs_split->add_child(glyph_tree); - glyph_tree->connect("item_activated", callable_mp(this, &DynamicFontImportSettings::_range_edited)); - glyph_tree->connect("item_selected", callable_mp(this, &DynamicFontImportSettings::_range_selected)); + glyph_tree->connect("item_activated", callable_mp(this, &DynamicFontImportSettingsDialog::_range_edited)); + glyph_tree->connect("item_selected", callable_mp(this, &DynamicFontImportSettingsDialog::_range_selected)); // Common diff --git a/editor/import/dynamic_font_import_settings.h b/editor/import/dynamic_font_import_settings.h index 4a586049fa..61d52b737a 100644 --- a/editor/import/dynamic_font_import_settings.h +++ b/editor/import/dynamic_font_import_settings.h @@ -45,16 +45,16 @@ #include "scene/resources/font.h" #include "servers/text_server.h" -class DynamicFontImportSettings; +class DynamicFontImportSettingsDialog; class DynamicFontImportSettingsData : public RefCounted { GDCLASS(DynamicFontImportSettingsData, RefCounted) - friend class DynamicFontImportSettings; + friend class DynamicFontImportSettingsDialog; HashMap<StringName, Variant> settings; HashMap<StringName, Variant> defaults; List<ResourceImporter::ImportOption> options; - DynamicFontImportSettings *owner = nullptr; + DynamicFontImportSettingsDialog *owner = nullptr; HashSet<char32_t> selected_chars; HashSet<int32_t> selected_glyphs; @@ -73,8 +73,8 @@ class EditorFileDialog; class EditorInspector; class EditorLocaleDialog; -class DynamicFontImportSettings : public ConfirmationDialog { - GDCLASS(DynamicFontImportSettings, ConfirmationDialog) +class DynamicFontImportSettingsDialog : public ConfirmationDialog { + GDCLASS(DynamicFontImportSettingsDialog, ConfirmationDialog) friend class DynamicFontImportSettingsData; enum ItemButton { @@ -82,7 +82,7 @@ class DynamicFontImportSettings : public ConfirmationDialog { BUTTON_REMOVE_VAR, }; - static DynamicFontImportSettings *singleton; + static DynamicFontImportSettingsDialog *singleton; String base_path; @@ -172,9 +172,9 @@ protected: public: void open_settings(const String &p_path); - static DynamicFontImportSettings *get_singleton(); + static DynamicFontImportSettingsDialog *get_singleton(); - DynamicFontImportSettings(); + DynamicFontImportSettingsDialog(); }; #endif // DYNAMIC_FONT_IMPORT_SETTINGS_H diff --git a/editor/import/resource_importer_dynamic_font.cpp b/editor/import/resource_importer_dynamic_font.cpp index bb20d3b941..9d4c5edebc 100644 --- a/editor/import/resource_importer_dynamic_font.cpp +++ b/editor/import/resource_importer_dynamic_font.cpp @@ -137,7 +137,7 @@ bool ResourceImporterDynamicFont::has_advanced_options() const { return true; } void ResourceImporterDynamicFont::show_advanced_options(const String &p_path) { - DynamicFontImportSettings::get_singleton()->open_settings(p_path); + DynamicFontImportSettingsDialog::get_singleton()->open_settings(p_path); } Error ResourceImporterDynamicFont::import(const String &p_source_file, const String &p_save_path, const HashMap<StringName, Variant> &p_options, List<String> *r_platform_variants, List<String> *r_gen_files, Variant *r_metadata) { diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp index d5da1183fb..a5813cf192 100644 --- a/editor/import/resource_importer_scene.cpp +++ b/editor/import/resource_importer_scene.cpp @@ -250,9 +250,7 @@ String ResourceImporterScene::get_visible_name() const { } void ResourceImporterScene::get_recognized_extensions(List<String> *p_extensions) const { - for (Ref<EditorSceneFormatImporter> importer_elem : importers) { - importer_elem->get_extensions(p_extensions); - } + get_scene_importer_extensions(p_extensions); } String ResourceImporterScene::get_save_extension() const { @@ -294,7 +292,7 @@ bool ResourceImporterScene::get_option_visibility(const String &p_path, const St } } - for (Ref<EditorSceneFormatImporter> importer : importers) { + for (Ref<EditorSceneFormatImporter> importer : scene_importers) { Variant ret = importer->get_option_visibility(p_path, animation_importer, p_option, p_options); if (ret.get_type() == Variant::BOOL) { return ret; @@ -1505,6 +1503,7 @@ void ResourceImporterScene::_create_slices(AnimationPlayer *ap, Ref<Animation> a new_anim->add_track(anim->track_get_type(j)); dtrack = new_anim->get_track_count() - 1; new_anim->track_set_path(dtrack, anim->track_get_path(j)); + new_anim->track_set_imported(dtrack, true); if (kt > (from + 0.01) && k > 0) { if (anim->track_get_type(j) == Animation::TYPE_POSITION_3D) { @@ -1580,6 +1579,7 @@ void ResourceImporterScene::_create_slices(AnimationPlayer *ap, Ref<Animation> a new_anim->add_track(anim->track_get_type(j)); dtrack = new_anim->get_track_count() - 1; new_anim->track_set_path(dtrack, anim->track_get_path(j)); + new_anim->track_set_imported(dtrack, true); if (anim->track_get_type(j) == Animation::TYPE_POSITION_3D) { Vector3 p; anim->try_position_track_interpolate(j, from, &p); @@ -1949,13 +1949,13 @@ void ResourceImporterScene::get_import_options(const String &p_path, List<Import post_importer_plugins.write[i]->get_import_options(p_path, r_options); } - for (Ref<EditorSceneFormatImporter> importer_elem : importers) { + for (Ref<EditorSceneFormatImporter> importer_elem : scene_importers) { importer_elem->get_import_options(p_path, r_options); } } void ResourceImporterScene::handle_compatibility_options(HashMap<StringName, Variant> &p_import_params) const { - for (Ref<EditorSceneFormatImporter> importer_elem : importers) { + for (Ref<EditorSceneFormatImporter> importer_elem : scene_importers) { importer_elem->handle_compatibility_options(p_import_params); } } @@ -2004,7 +2004,7 @@ Array ResourceImporterScene::_get_skinned_pose_transforms(ImporterMeshInstance3D return skin_pose_transform_array; } -void ResourceImporterScene::_generate_meshes(Node *p_node, const Dictionary &p_mesh_data, bool p_generate_lods, bool p_create_shadow_meshes, LightBakeMode p_light_bake_mode, float p_lightmap_texel_size, const Vector<uint8_t> &p_src_lightmap_cache, Vector<Vector<uint8_t>> &r_lightmap_caches) { +Node *ResourceImporterScene::_generate_meshes(Node *p_node, const Dictionary &p_mesh_data, bool p_generate_lods, bool p_create_shadow_meshes, LightBakeMode p_light_bake_mode, float p_lightmap_texel_size, const Vector<uint8_t> &p_src_lightmap_cache, Vector<Vector<uint8_t>> &r_lightmap_caches) { ImporterMeshInstance3D *src_mesh_node = Object::cast_to<ImporterMeshInstance3D>(p_node); if (src_mesh_node) { //is mesh @@ -2185,6 +2185,8 @@ void ResourceImporterScene::_generate_meshes(Node *p_node, const Dictionary &p_m for (int i = 0; i < p_node->get_child_count(); i++) { _generate_meshes(p_node->get_child(i), p_mesh_data, p_generate_lods, p_create_shadow_meshes, p_light_bake_mode, p_lightmap_texel_size, p_src_lightmap_cache, r_lightmap_caches); } + + return p_node; } void ResourceImporterScene::_add_shapes(Node *p_node, const Vector<Ref<Shape3D>> &p_shapes) { @@ -2356,7 +2358,7 @@ Node *ResourceImporterScene::pre_import(const String &p_source_file, const HashM EditorProgress progress("pre-import", TTR("Pre-Import Scene"), 0); progress.step(TTR("Importing Scene..."), 0); - for (Ref<EditorSceneFormatImporter> importer_elem : importers) { + for (Ref<EditorSceneFormatImporter> importer_elem : scene_importers) { List<String> extensions; importer_elem->get_extensions(&extensions); @@ -2398,7 +2400,7 @@ Error ResourceImporterScene::import(const String &p_source_file, const String &p EditorProgress progress("import", TTR("Import Scene"), 104); progress.step(TTR("Importing Scene..."), 0); - for (Ref<EditorSceneFormatImporter> importer_elem : importers) { + for (Ref<EditorSceneFormatImporter> importer_elem : scene_importers) { List<String> extensions; importer_elem->get_extensions(&extensions); @@ -2564,7 +2566,7 @@ Error ResourceImporterScene::import(const String &p_source_file, const String &p if (subresources.has("meshes")) { mesh_data = subresources["meshes"]; } - _generate_meshes(scene, mesh_data, gen_lods, create_shadow_meshes, LightBakeMode(light_bake_mode), lightmap_texel_size, src_lightmap_cache, mesh_lightmap_caches); + scene = _generate_meshes(scene, mesh_data, gen_lods, create_shadow_meshes, LightBakeMode(light_bake_mode), lightmap_texel_size, src_lightmap_cache, mesh_lightmap_caches); if (mesh_lightmap_caches.size()) { Ref<FileAccess> f = FileAccess::open(p_source_file + ".unwrap_cache", FileAccess::WRITE); @@ -2661,14 +2663,15 @@ Error ResourceImporterScene::import(const String &p_source_file, const String &p ResourceImporterScene *ResourceImporterScene::scene_singleton = nullptr; ResourceImporterScene *ResourceImporterScene::animation_singleton = nullptr; -Vector<Ref<EditorSceneFormatImporter>> ResourceImporterScene::importers; +Vector<Ref<EditorSceneFormatImporter>> ResourceImporterScene::scene_importers; Vector<Ref<EditorScenePostImportPlugin>> ResourceImporterScene::post_importer_plugins; bool ResourceImporterScene::has_advanced_options() const { return true; } + void ResourceImporterScene::show_advanced_options(const String &p_path) { - SceneImportSettings::get_singleton()->open_settings(p_path, animation_importer); + SceneImportSettingsDialog::get_singleton()->open_settings(p_path, animation_importer); } ResourceImporterScene::ResourceImporterScene(bool p_animation_import, bool p_singleton) { @@ -2693,12 +2696,12 @@ ResourceImporterScene::~ResourceImporterScene() { } } -void ResourceImporterScene::add_importer(Ref<EditorSceneFormatImporter> p_importer, bool p_first_priority) { +void ResourceImporterScene::add_scene_importer(Ref<EditorSceneFormatImporter> p_importer, bool p_first_priority) { ERR_FAIL_COND(p_importer.is_null()); if (p_first_priority) { - importers.insert(0, p_importer); + scene_importers.insert(0, p_importer); } else { - importers.push_back(p_importer); + scene_importers.push_back(p_importer); } } @@ -2715,15 +2718,21 @@ void ResourceImporterScene::add_post_importer_plugin(const Ref<EditorScenePostIm } } -void ResourceImporterScene::remove_importer(Ref<EditorSceneFormatImporter> p_importer) { - importers.erase(p_importer); +void ResourceImporterScene::remove_scene_importer(Ref<EditorSceneFormatImporter> p_importer) { + scene_importers.erase(p_importer); } void ResourceImporterScene::clean_up_importer_plugins() { - importers.clear(); + scene_importers.clear(); post_importer_plugins.clear(); } +void ResourceImporterScene::get_scene_importer_extensions(List<String> *p_extensions) { + for (Ref<EditorSceneFormatImporter> importer_elem : scene_importers) { + importer_elem->get_extensions(p_extensions); + } +} + /////////////////////////////////////// uint32_t EditorSceneFormatImporterESCN::get_import_flags() const { diff --git a/editor/import/resource_importer_scene.h b/editor/import/resource_importer_scene.h index 17681387e6..6ea4d1af7d 100644 --- a/editor/import/resource_importer_scene.h +++ b/editor/import/resource_importer_scene.h @@ -159,7 +159,7 @@ VARIANT_ENUM_CAST(EditorScenePostImportPlugin::InternalImportCategory) class ResourceImporterScene : public ResourceImporter { GDCLASS(ResourceImporterScene, ResourceImporter); - static Vector<Ref<EditorSceneFormatImporter>> importers; + static Vector<Ref<EditorSceneFormatImporter>> scene_importers; static Vector<Ref<EditorScenePostImportPlugin>> post_importer_plugins; static ResourceImporterScene *scene_singleton; @@ -216,7 +216,7 @@ class ResourceImporterScene : public ResourceImporter { Array _get_skinned_pose_transforms(ImporterMeshInstance3D *p_src_mesh_node); void _replace_owner(Node *p_node, Node *p_scene, Node *p_new_owner); - void _generate_meshes(Node *p_node, const Dictionary &p_mesh_data, bool p_generate_lods, bool p_create_shadow_meshes, LightBakeMode p_light_bake_mode, float p_lightmap_texel_size, const Vector<uint8_t> &p_src_lightmap_cache, Vector<Vector<uint8_t>> &r_lightmap_caches); + Node *_generate_meshes(Node *p_node, const Dictionary &p_mesh_data, bool p_generate_lods, bool p_create_shadow_meshes, LightBakeMode p_light_bake_mode, float p_lightmap_texel_size, const Vector<uint8_t> &p_src_lightmap_cache, Vector<Vector<uint8_t>> &r_lightmap_caches); void _add_shapes(Node *p_node, const Vector<Ref<Shape3D>> &p_shapes); enum AnimationImportTracks { @@ -243,10 +243,10 @@ public: static void add_post_importer_plugin(const Ref<EditorScenePostImportPlugin> &p_plugin, bool p_first_priority = false); static void remove_post_importer_plugin(const Ref<EditorScenePostImportPlugin> &p_plugin); - const Vector<Ref<EditorSceneFormatImporter>> &get_importers() const { return importers; } - - static void add_importer(Ref<EditorSceneFormatImporter> p_importer, bool p_first_priority = false); - static void remove_importer(Ref<EditorSceneFormatImporter> p_importer); + const Vector<Ref<EditorSceneFormatImporter>> &get_scene_importers() const { return scene_importers; } + static void add_scene_importer(Ref<EditorSceneFormatImporter> p_importer, bool p_first_priority = false); + static void remove_scene_importer(Ref<EditorSceneFormatImporter> p_importer); + static void get_scene_importer_extensions(List<String> *p_extensions); static void clean_up_importer_plugins(); diff --git a/editor/import/resource_importer_texture.cpp b/editor/import/resource_importer_texture.cpp index 8eac5ec323..7f27be99f7 100644 --- a/editor/import/resource_importer_texture.cpp +++ b/editor/import/resource_importer_texture.cpp @@ -38,6 +38,7 @@ #include "editor/editor_node.h" #include "editor/editor_scale.h" #include "editor/editor_settings.h" +#include "editor/gui/editor_toaster.h" #include "editor/import/resource_importer_texture_settings.h" #include "scene/resources/compressed_texture.h" @@ -108,13 +109,21 @@ void ResourceImporterTexture::update_imports() { bool changed = false; if (E.value.flags & MAKE_NORMAL_FLAG && int(cf->get_value("params", "compress/normal_map")) == 0) { - print_line(vformat(TTR("%s: Texture detected as used as a normal map in 3D. Enabling red-green texture compression to reduce memory usage (blue channel is discarded)."), String(E.key))); + String message = vformat(TTR("%s: Texture detected as used as a normal map in 3D. Enabling red-green texture compression to reduce memory usage (blue channel is discarded)."), String(E.key)); +#ifdef TOOLS_ENABLED + EditorToaster::get_singleton()->popup_str(message); +#endif + print_line(message); cf->set_value("params", "compress/normal_map", 1); changed = true; } if (E.value.flags & MAKE_ROUGHNESS_FLAG && int(cf->get_value("params", "roughness/mode")) == 0) { - print_line(vformat(TTR("%s: Texture detected as used as a roughness map in 3D. Enabling roughness limiter based on the detected associated normal map at %s."), String(E.key), E.value.normal_path_for_roughness)); + String message = vformat(TTR("%s: Texture detected as used as a roughness map in 3D. Enabling roughness limiter based on the detected associated normal map at %s."), String(E.key), E.value.normal_path_for_roughness); +#ifdef TOOLS_ENABLED + EditorToaster::get_singleton()->popup_str(message); +#endif + print_line(message); cf->set_value("params", "roughness/mode", E.value.channel_for_roughness + 2); cf->set_value("params", "roughness/src_normal", E.value.normal_path_for_roughness); changed = true; @@ -131,7 +140,11 @@ void ResourceImporterTexture::update_imports() { cf->set_value("params", "compress/mode", COMPRESS_BASIS_UNIVERSAL); compress_string = "Basis Universal"; } - print_line(vformat(TTR("%s: Texture detected as used in 3D. Enabling mipmap generation and setting the texture compression mode to %s."), String(E.key), compress_string)); + String message = vformat(TTR("%s: Texture detected as used in 3D. Enabling mipmap generation and setting the texture compression mode to %s."), String(E.key), compress_string); +#ifdef TOOLS_ENABLED + EditorToaster::get_singleton()->popup_str(message); +#endif + print_line(message); cf->set_value("params", "mipmaps/generate", true); changed = true; } @@ -367,14 +380,6 @@ void ResourceImporterTexture::_save_ctex(const Ref<Image> &p_image, const String f->store_32(0); f->store_32(0); - /* - print_line("streamable " + itos(p_streamable)); - print_line("mipmaps " + itos(p_mipmaps)); - print_line("detect_3d " + itos(p_detect_3d)); - print_line("roughness " + itos(p_detect_roughness)); - print_line("normal " + itos(p_detect_normal)); -*/ - if ((p_compress_mode == COMPRESS_LOSSLESS || p_compress_mode == COMPRESS_LOSSY) && p_image->get_format() > Image::FORMAT_RGBA8) { p_compress_mode = COMPRESS_VRAM_UNCOMPRESSED; //these can't go as lossy } @@ -740,6 +745,10 @@ bool ResourceImporterTexture::are_import_settings_valid(const String &p_path) co if (meta.has("has_editor_variant")) { String imported_path = ResourceFormatImporter::get_singleton()->get_internal_resource_path(p_path); + if (!FileAccess::exists(imported_path)) { + return false; + } + String editor_meta_path = imported_path.replace(".editor.ctex", ".editor.meta"); Dictionary editor_meta = _load_editor_meta(editor_meta_path); diff --git a/editor/import/resource_importer_wav.cpp b/editor/import/resource_importer_wav.cpp index f3cb5bda32..c97b6a7579 100644 --- a/editor/import/resource_importer_wav.cpp +++ b/editor/import/resource_importer_wav.cpp @@ -292,7 +292,9 @@ Error ResourceImporterWAV::import(const String &p_source_file, const String &p_s loop_end = file->get_32(); } } - file->seek(file_pos + chunksize); + // Move to the start of the next chunk. Note that RIFF requires a padding byte for odd + // chunk sizes. + file->seek(file_pos + chunksize + (chunksize & 1)); } // STEP 2, APPLY CONVERSIONS diff --git a/editor/import/scene_import_settings.cpp b/editor/import/scene_import_settings.cpp index 322e39e112..4ecc6dedbd 100644 --- a/editor/import/scene_import_settings.cpp +++ b/editor/import/scene_import_settings.cpp @@ -45,7 +45,7 @@ class SceneImportSettingsData : public Object { GDCLASS(SceneImportSettingsData, Object) - friend class SceneImportSettings; + friend class SceneImportSettingsDialog; HashMap<StringName, Variant> *settings = nullptr; HashMap<StringName, Variant> current; HashMap<StringName, Variant> defaults; @@ -67,27 +67,27 @@ class SceneImportSettingsData : public Object { // SceneImportSettings must decide if a new collider should be generated or not. if (category == ResourceImporterScene::INTERNAL_IMPORT_CATEGORY_MESH_3D_NODE) { - SceneImportSettings::get_singleton()->request_generate_collider(); + SceneImportSettingsDialog::get_singleton()->request_generate_collider(); } - if (SceneImportSettings::get_singleton()->is_editing_animation()) { + if (SceneImportSettingsDialog::get_singleton()->is_editing_animation()) { if (category == ResourceImporterScene::INTERNAL_IMPORT_CATEGORY_MAX) { if (ResourceImporterScene::get_animation_singleton()->get_option_visibility(path, p_name, current)) { - SceneImportSettings::get_singleton()->update_view(); + SceneImportSettingsDialog::get_singleton()->update_view(); } } else { if (ResourceImporterScene::get_animation_singleton()->get_internal_option_update_view_required(category, p_name, current)) { - SceneImportSettings::get_singleton()->update_view(); + SceneImportSettingsDialog::get_singleton()->update_view(); } } } else { if (category == ResourceImporterScene::INTERNAL_IMPORT_CATEGORY_MAX) { if (ResourceImporterScene::get_scene_singleton()->get_option_visibility(path, p_name, current)) { - SceneImportSettings::get_singleton()->update_view(); + SceneImportSettingsDialog::get_singleton()->update_view(); } } else { if (ResourceImporterScene::get_scene_singleton()->get_internal_option_update_view_required(category, p_name, current)) { - SceneImportSettings::get_singleton()->update_view(); + SceneImportSettingsDialog::get_singleton()->update_view(); } } } @@ -114,7 +114,7 @@ class SceneImportSettingsData : public Object { return; } for (const ResourceImporter::ImportOption &E : options) { - if (SceneImportSettings::get_singleton()->is_editing_animation()) { + if (SceneImportSettingsDialog::get_singleton()->is_editing_animation()) { if (category == ResourceImporterScene::INTERNAL_IMPORT_CATEGORY_MAX) { if (ResourceImporterScene::get_animation_singleton()->get_option_visibility(path, E.option.name, current)) { p_list->push_back(E.option); @@ -139,7 +139,7 @@ class SceneImportSettingsData : public Object { } }; -void SceneImportSettings::_fill_material(Tree *p_tree, const Ref<Material> &p_material, TreeItem *p_parent) { +void SceneImportSettingsDialog::_fill_material(Tree *p_tree, const Ref<Material> &p_material, TreeItem *p_parent) { String import_id; bool has_import_id = false; @@ -199,7 +199,7 @@ void SceneImportSettings::_fill_material(Tree *p_tree, const Ref<Material> &p_ma } } -void SceneImportSettings::_fill_mesh(Tree *p_tree, const Ref<Mesh> &p_mesh, TreeItem *p_parent) { +void SceneImportSettingsDialog::_fill_mesh(Tree *p_tree, const Ref<Mesh> &p_mesh, TreeItem *p_parent) { String import_id; bool has_import_id = false; @@ -263,7 +263,7 @@ void SceneImportSettings::_fill_mesh(Tree *p_tree, const Ref<Mesh> &p_mesh, Tree } } -void SceneImportSettings::_fill_animation(Tree *p_tree, const Ref<Animation> &p_anim, const String &p_name, TreeItem *p_parent) { +void SceneImportSettingsDialog::_fill_animation(Tree *p_tree, const Ref<Animation> &p_anim, const String &p_name, TreeItem *p_parent) { if (!animation_map.has(p_name)) { AnimationData ad; ad.animation = p_anim; @@ -289,7 +289,7 @@ void SceneImportSettings::_fill_animation(Tree *p_tree, const Ref<Animation> &p_ animation_data.scene_node = item; } -void SceneImportSettings::_fill_scene(Node *p_node, TreeItem *p_parent_item) { +void SceneImportSettingsDialog::_fill_scene(Node *p_node, TreeItem *p_parent_item) { String import_id; if (p_node->has_meta("import_id")) { @@ -353,7 +353,7 @@ void SceneImportSettings::_fill_scene(Node *p_node, TreeItem *p_parent_item) { category = ResourceImporterScene::INTERNAL_IMPORT_CATEGORY_ANIMATION_NODE; animation_player = Object::cast_to<AnimationPlayer>(p_node); - animation_player->connect(SNAME("animation_finished"), callable_mp(this, &SceneImportSettings::_animation_finished)); + animation_player->connect(SNAME("animation_finished"), callable_mp(this, &SceneImportSettingsDialog::_animation_finished)); } else if (Object::cast_to<Skeleton3D>(p_node)) { category = ResourceImporterScene::INTERNAL_IMPORT_CATEGORY_SKELETON_3D_NODE; skeletons.push_back(Object::cast_to<Skeleton3D>(p_node)); @@ -413,7 +413,7 @@ void SceneImportSettings::_fill_scene(Node *p_node, TreeItem *p_parent_item) { } } -void SceneImportSettings::_update_scene() { +void SceneImportSettingsDialog::_update_scene() { scene_tree->clear(); material_tree->clear(); mesh_tree->clear(); @@ -425,7 +425,7 @@ void SceneImportSettings::_update_scene() { _fill_scene(scene, nullptr); } -void SceneImportSettings::_update_view_gizmos() { +void SceneImportSettingsDialog::_update_view_gizmos() { if (!is_visible()) { return; } @@ -516,7 +516,7 @@ void SceneImportSettings::_update_view_gizmos() { generate_collider = false; } -void SceneImportSettings::_update_camera() { +void SceneImportSettingsDialog::_update_camera() { AABB camera_aabb; float rot_x = cam_rot_x; @@ -557,7 +557,7 @@ void SceneImportSettings::_update_camera() { camera->set_transform(xf); } -void SceneImportSettings::_load_default_subresource_settings(HashMap<StringName, Variant> &settings, const String &p_type, const String &p_import_id, ResourceImporterScene::InternalImportCategory p_category) { +void SceneImportSettingsDialog::_load_default_subresource_settings(HashMap<StringName, Variant> &settings, const String &p_type, const String &p_import_id, ResourceImporterScene::InternalImportCategory p_category) { if (base_subresource_settings.has(p_type)) { Dictionary d = base_subresource_settings[p_type]; if (d.has(p_import_id)) { @@ -578,15 +578,15 @@ void SceneImportSettings::_load_default_subresource_settings(HashMap<StringName, } } -void SceneImportSettings::request_generate_collider() { +void SceneImportSettingsDialog::request_generate_collider() { generate_collider = true; } -void SceneImportSettings::update_view() { +void SceneImportSettingsDialog::update_view() { update_view_timer->start(); } -void SceneImportSettings::open_settings(const String &p_path, bool p_for_animation) { +void SceneImportSettingsDialog::open_settings(const String &p_path, bool p_for_animation) { if (scene) { memdelete(scene); scene = nullptr; @@ -678,20 +678,20 @@ void SceneImportSettings::open_settings(const String &p_path, bool p_for_animati } } -SceneImportSettings *SceneImportSettings::singleton = nullptr; +SceneImportSettingsDialog *SceneImportSettingsDialog::singleton = nullptr; -SceneImportSettings *SceneImportSettings::get_singleton() { +SceneImportSettingsDialog *SceneImportSettingsDialog::get_singleton() { return singleton; } -Node *SceneImportSettings::get_selected_node() { +Node *SceneImportSettingsDialog::get_selected_node() { if (selected_id == "") { return nullptr; } return node_map[selected_id].node; } -void SceneImportSettings::_select(Tree *p_from, String p_type, String p_id) { +void SceneImportSettingsDialog::_select(Tree *p_from, String p_type, String p_id) { selecting = true; scene_import_settings_data->hide_options = false; @@ -859,7 +859,7 @@ void SceneImportSettings::_select(Tree *p_from, String p_type, String p_id) { scene_import_settings_data->notify_property_list_changed(); } -void SceneImportSettings::_inspector_property_edited(const String &p_name) { +void SceneImportSettingsDialog::_inspector_property_edited(const String &p_name) { if (p_name == "settings/loop_mode") { if (!animation_map.has(selected_id)) { return; @@ -873,13 +873,13 @@ void SceneImportSettings::_inspector_property_edited(const String &p_name) { } } -void SceneImportSettings::_reset_bone_transforms() { +void SceneImportSettingsDialog::_reset_bone_transforms() { for (Skeleton3D *skeleton : skeletons) { skeleton->reset_bone_poses(); } } -void SceneImportSettings::_play_animation() { +void SceneImportSettingsDialog::_play_animation() { if (animation_player == nullptr) { return; } @@ -897,7 +897,7 @@ void SceneImportSettings::_play_animation() { } } -void SceneImportSettings::_stop_current_animation() { +void SceneImportSettingsDialog::_stop_current_animation() { animation_pingpong = false; animation_player->stop(); animation_play_button->set_icon(get_editor_theme_icon(SNAME("MainPlay"))); @@ -905,7 +905,7 @@ void SceneImportSettings::_stop_current_animation() { set_process(false); } -void SceneImportSettings::_reset_animation(const String &p_animation_name) { +void SceneImportSettingsDialog::_reset_animation(const String &p_animation_name) { if (p_animation_name.is_empty()) { animation_preview->hide(); @@ -943,7 +943,7 @@ void SceneImportSettings::_reset_animation(const String &p_animation_name) { } } -void SceneImportSettings::_animation_slider_value_changed(double p_value) { +void SceneImportSettingsDialog::_animation_slider_value_changed(double p_value) { if (animation_player == nullptr || !animation_map.has(selected_id) || animation_map[selected_id].animation.is_null()) { return; } @@ -955,7 +955,7 @@ void SceneImportSettings::_animation_slider_value_changed(double p_value) { animation_player->seek(p_value * animation_map[selected_id].animation->get_length(), true); } -void SceneImportSettings::_animation_finished(const StringName &p_name) { +void SceneImportSettingsDialog::_animation_finished(const StringName &p_name) { Animation::LoopMode loop_mode = animation_loop_mode; switch (loop_mode) { @@ -980,7 +980,7 @@ void SceneImportSettings::_animation_finished(const StringName &p_name) { } } -void SceneImportSettings::_material_tree_selected() { +void SceneImportSettingsDialog::_material_tree_selected() { if (selecting) { return; } @@ -991,7 +991,7 @@ void SceneImportSettings::_material_tree_selected() { _select(material_tree, type, import_id); } -void SceneImportSettings::_mesh_tree_selected() { +void SceneImportSettingsDialog::_mesh_tree_selected() { if (selecting) { return; } @@ -1003,7 +1003,7 @@ void SceneImportSettings::_mesh_tree_selected() { _select(mesh_tree, type, import_id); } -void SceneImportSettings::_scene_tree_selected() { +void SceneImportSettingsDialog::_scene_tree_selected() { if (selecting) { return; } @@ -1014,16 +1014,16 @@ void SceneImportSettings::_scene_tree_selected() { _select(scene_tree, type, import_id); } -void SceneImportSettings::_cleanup() { +void SceneImportSettingsDialog::_cleanup() { skeletons.clear(); if (animation_player != nullptr) { - animation_player->disconnect(SNAME("animation_finished"), callable_mp(this, &SceneImportSettings::_animation_finished)); + animation_player->disconnect(SNAME("animation_finished"), callable_mp(this, &SceneImportSettingsDialog::_animation_finished)); animation_player = nullptr; } set_process(false); } -void SceneImportSettings::_viewport_input(const Ref<InputEvent> &p_input) { +void SceneImportSettingsDialog::_viewport_input(const Ref<InputEvent> &p_input) { float *rot_x = &cam_rot_x; float *rot_y = &cam_rot_y; float *zoom = &cam_zoom; @@ -1066,7 +1066,7 @@ void SceneImportSettings::_viewport_input(const Ref<InputEvent> &p_input) { } } -void SceneImportSettings::_re_import() { +void SceneImportSettingsDialog::_re_import() { HashMap<StringName, Variant> main_settings; main_settings = scene_import_settings_data->current; @@ -1137,10 +1137,10 @@ void SceneImportSettings::_re_import() { EditorFileSystem::get_singleton()->reimport_file_with_custom_parameters(base_path, editing_animation ? "animation_library" : "scene", main_settings); } -void SceneImportSettings::_notification(int p_what) { +void SceneImportSettingsDialog::_notification(int p_what) { switch (p_what) { case NOTIFICATION_READY: { - connect("confirmed", callable_mp(this, &SceneImportSettings::_re_import)); + connect("confirmed", callable_mp(this, &SceneImportSettingsDialog::_re_import)); } break; case NOTIFICATION_THEME_CHANGED: { @@ -1172,7 +1172,7 @@ void SceneImportSettings::_notification(int p_what) { } } -void SceneImportSettings::_menu_callback(int p_id) { +void SceneImportSettingsDialog::_menu_callback(int p_id) { switch (p_id) { case ACTION_EXTRACT_MATERIALS: { save_path->set_title(TTR("Select folder to extract material resources")); @@ -1193,7 +1193,7 @@ void SceneImportSettings::_menu_callback(int p_id) { save_path->popup_centered_ratio(); } -void SceneImportSettings::_save_path_changed(const String &p_path) { +void SceneImportSettingsDialog::_save_path_changed(const String &p_path) { save_path_item->set_text(1, p_path); if (FileAccess::exists(p_path)) { @@ -1207,7 +1207,7 @@ void SceneImportSettings::_save_path_changed(const String &p_path) { } } -void SceneImportSettings::_browse_save_callback(Object *p_item, int p_column, int p_id, MouseButton p_button) { +void SceneImportSettingsDialog::_browse_save_callback(Object *p_item, int p_column, int p_id, MouseButton p_button) { if (p_button != MouseButton::LEFT) { return; } @@ -1222,7 +1222,7 @@ void SceneImportSettings::_browse_save_callback(Object *p_item, int p_column, in item_save_path->popup_centered_ratio(); } -void SceneImportSettings::_save_dir_callback(const String &p_path) { +void SceneImportSettingsDialog::_save_dir_callback(const String &p_path) { external_path_tree->clear(); TreeItem *root = external_path_tree->create_item(); save_path_items.clear(); @@ -1386,7 +1386,7 @@ void SceneImportSettings::_save_dir_callback(const String &p_path) { external_paths->popup_centered_ratio(); } -void SceneImportSettings::_save_dir_confirm() { +void SceneImportSettingsDialog::_save_dir_confirm() { for (int i = 0; i < save_path_items.size(); i++) { TreeItem *item = save_path_items[i]; if (!item->is_checked(0)) { @@ -1441,7 +1441,7 @@ void SceneImportSettings::_save_dir_confirm() { } } -SceneImportSettings::SceneImportSettings() { +SceneImportSettingsDialog::SceneImportSettingsDialog() { singleton = this; VBoxContainer *main_vb = memnew(VBoxContainer); @@ -1461,7 +1461,7 @@ SceneImportSettings::SceneImportSettings() { action_menu->get_popup()->add_item(TTR("Set Animation Save Paths"), ACTION_CHOOSE_ANIMATION_SAVE_PATHS); action_menu->get_popup()->add_item(TTR("Set Mesh Save Paths"), ACTION_CHOOSE_MESH_SAVE_PATHS); - action_menu->get_popup()->connect("id_pressed", callable_mp(this, &SceneImportSettings::_menu_callback)); + action_menu->get_popup()->connect("id_pressed", callable_mp(this, &SceneImportSettingsDialog::_menu_callback)); tree_split = memnew(HSplitContainer); main_vb->add_child(tree_split); @@ -1479,18 +1479,18 @@ SceneImportSettings::SceneImportSettings() { scene_tree = memnew(Tree); scene_tree->set_name(TTR("Scene")); data_mode->add_child(scene_tree); - scene_tree->connect("cell_selected", callable_mp(this, &SceneImportSettings::_scene_tree_selected)); + scene_tree->connect("cell_selected", callable_mp(this, &SceneImportSettingsDialog::_scene_tree_selected)); mesh_tree = memnew(Tree); mesh_tree->set_name(TTR("Meshes")); data_mode->add_child(mesh_tree); mesh_tree->set_hide_root(true); - mesh_tree->connect("cell_selected", callable_mp(this, &SceneImportSettings::_mesh_tree_selected)); + mesh_tree->connect("cell_selected", callable_mp(this, &SceneImportSettingsDialog::_mesh_tree_selected)); material_tree = memnew(Tree); material_tree->set_name(TTR("Materials")); data_mode->add_child(material_tree); - material_tree->connect("cell_selected", callable_mp(this, &SceneImportSettings::_material_tree_selected)); + material_tree->connect("cell_selected", callable_mp(this, &SceneImportSettingsDialog::_material_tree_selected)); material_tree->set_hide_root(true); @@ -1504,7 +1504,7 @@ SceneImportSettings::SceneImportSettings() { vp_container->set_v_size_flags(Control::SIZE_EXPAND_FILL); vp_container->set_custom_minimum_size(Size2(10, 10)); vp_container->set_stretch(true); - vp_container->connect("gui_input", callable_mp(this, &SceneImportSettings::_viewport_input)); + vp_container->connect("gui_input", callable_mp(this, &SceneImportSettingsDialog::_viewport_input)); vp_vb->add_child(vp_container); base_viewport = memnew(SubViewport); @@ -1523,13 +1523,13 @@ SceneImportSettings::SceneImportSettings() { animation_play_button->set_flat(true); animation_play_button->set_focus_mode(Control::FOCUS_NONE); animation_play_button->set_shortcut(ED_SHORTCUT("scene_import_settings/play_selected_animation", TTR("Selected Animation Play/Pause"), Key::SPACE)); - animation_play_button->connect(SNAME("pressed"), callable_mp(this, &SceneImportSettings::_play_animation)); + animation_play_button->connect(SNAME("pressed"), callable_mp(this, &SceneImportSettingsDialog::_play_animation)); animation_stop_button = memnew(Button); animation_hbox->add_child(animation_stop_button); animation_stop_button->set_flat(true); animation_stop_button->set_focus_mode(Control::FOCUS_NONE); - animation_stop_button->connect(SNAME("pressed"), callable_mp(this, &SceneImportSettings::_stop_current_animation)); + animation_stop_button->connect(SNAME("pressed"), callable_mp(this, &SceneImportSettingsDialog::_stop_current_animation)); animation_slider = memnew(HSlider); animation_hbox->add_child(animation_slider); @@ -1539,7 +1539,7 @@ SceneImportSettings::SceneImportSettings() { animation_slider->set_step(1.0 / 100.0); animation_slider->set_value_no_signal(0.0); animation_slider->set_focus_mode(Control::FOCUS_NONE); - animation_slider->connect(SNAME("value_changed"), callable_mp(this, &SceneImportSettings::_animation_slider_value_changed)); + animation_slider->connect(SNAME("value_changed"), callable_mp(this, &SceneImportSettingsDialog::_animation_slider_value_changed)); base_viewport->set_use_own_world_3d(true); @@ -1609,7 +1609,7 @@ SceneImportSettings::SceneImportSettings() { inspector = memnew(EditorInspector); inspector->set_custom_minimum_size(Size2(300 * EDSCALE, 0)); - inspector->connect(SNAME("property_edited"), callable_mp(this, &SceneImportSettings::_inspector_property_edited)); + inspector->connect(SNAME("property_edited"), callable_mp(this, &SceneImportSettingsDialog::_inspector_property_edited)); property_split->add_child(inspector); @@ -1622,8 +1622,8 @@ SceneImportSettings::SceneImportSettings() { add_child(external_paths); external_path_tree = memnew(Tree); external_paths->add_child(external_path_tree); - external_path_tree->connect("button_clicked", callable_mp(this, &SceneImportSettings::_browse_save_callback)); - external_paths->connect("confirmed", callable_mp(this, &SceneImportSettings::_save_dir_confirm)); + external_path_tree->connect("button_clicked", callable_mp(this, &SceneImportSettingsDialog::_browse_save_callback)); + external_paths->connect("confirmed", callable_mp(this, &SceneImportSettingsDialog::_save_dir_confirm)); external_path_tree->set_columns(3); external_path_tree->set_column_titles_visible(true); external_path_tree->set_column_expand(0, true); @@ -1653,16 +1653,16 @@ SceneImportSettings::SceneImportSettings() { item_save_path->add_filter("*.tres", TTR("Text Resource")); item_save_path->add_filter("*.res", TTR("Binary Resource")); add_child(item_save_path); - item_save_path->connect("file_selected", callable_mp(this, &SceneImportSettings::_save_path_changed)); + item_save_path->connect("file_selected", callable_mp(this, &SceneImportSettingsDialog::_save_path_changed)); - save_path->connect("dir_selected", callable_mp(this, &SceneImportSettings::_save_dir_callback)); + save_path->connect("dir_selected", callable_mp(this, &SceneImportSettingsDialog::_save_dir_callback)); update_view_timer = memnew(Timer); update_view_timer->set_wait_time(0.2); - update_view_timer->connect("timeout", callable_mp(this, &SceneImportSettings::_update_view_gizmos)); + update_view_timer->connect("timeout", callable_mp(this, &SceneImportSettingsDialog::_update_view_gizmos)); add_child(update_view_timer); } -SceneImportSettings::~SceneImportSettings() { +SceneImportSettingsDialog::~SceneImportSettingsDialog() { memdelete(scene_import_settings_data); } diff --git a/editor/import/scene_import_settings.h b/editor/import/scene_import_settings.h index b4954b9099..3e71d5da17 100644 --- a/editor/import/scene_import_settings.h +++ b/editor/import/scene_import_settings.h @@ -52,10 +52,10 @@ class EditorFileDialog; class EditorInspector; class SceneImportSettingsData; -class SceneImportSettings : public ConfirmationDialog { - GDCLASS(SceneImportSettings, ConfirmationDialog) +class SceneImportSettingsDialog : public ConfirmationDialog { + GDCLASS(SceneImportSettingsDialog, ConfirmationDialog) - static SceneImportSettings *singleton; + static SceneImportSettingsDialog *singleton; enum Actions { ACTION_EXTRACT_MATERIALS, @@ -223,10 +223,10 @@ public: void request_generate_collider(); void update_view(); void open_settings(const String &p_path, bool p_for_animation = false); - static SceneImportSettings *get_singleton(); + static SceneImportSettingsDialog *get_singleton(); Node *get_selected_node(); - SceneImportSettings(); - ~SceneImportSettings(); + SceneImportSettingsDialog(); + ~SceneImportSettingsDialog(); }; #endif // SCENE_IMPORT_SETTINGS_H diff --git a/editor/input_event_configuration_dialog.cpp b/editor/input_event_configuration_dialog.cpp index 724ad9370b..db7922233e 100644 --- a/editor/input_event_configuration_dialog.cpp +++ b/editor/input_event_configuration_dialog.cpp @@ -553,9 +553,8 @@ void InputEventConfigurationDialog::_notification(int p_what) { event_listener->grab_focus(); } break; - case NOTIFICATION_ENTER_TREE: case NOTIFICATION_THEME_CHANGED: { - input_list_search->set_right_icon(input_list_search->get_editor_theme_icon(SNAME("Search"))); + input_list_search->set_right_icon(get_editor_theme_icon(SNAME("Search"))); key_mode->set_item_icon(KEYMODE_KEYCODE, get_editor_theme_icon(SNAME("Keyboard"))); key_mode->set_item_icon(KEYMODE_PHY_KEYCODE, get_editor_theme_icon(SNAME("KeyboardPhysical"))); @@ -573,7 +572,7 @@ void InputEventConfigurationDialog::_notification(int p_what) { } } -void InputEventConfigurationDialog::popup_and_configure(const Ref<InputEvent> &p_event) { +void InputEventConfigurationDialog::popup_and_configure(const Ref<InputEvent> &p_event, const String &p_current_action_name) { if (p_event.is_valid()) { _set_event(p_event->duplicate(), p_event); } else { @@ -597,6 +596,12 @@ void InputEventConfigurationDialog::popup_and_configure(const Ref<InputEvent> &p device_id_option->select(0); } + if (!p_current_action_name.is_empty()) { + set_title(vformat(TTR("Event Configuration for \"%s\""), p_current_action_name)); + } else { + set_title(TTR("Event Configuration")); + } + popup_centered(Size2(0, 400) * EDSCALE); } @@ -612,13 +617,13 @@ void InputEventConfigurationDialog::set_allowed_input_types(int p_type_masks) { InputEventConfigurationDialog::InputEventConfigurationDialog() { allowed_input_types = INPUT_KEY | INPUT_MOUSE_BUTTON | INPUT_JOY_BUTTON | INPUT_JOY_MOTION; - set_title(TTR("Event Configuration")); - set_min_size(Size2i(550 * EDSCALE, 0)); // Min width + set_min_size(Size2i(550, 0) * EDSCALE); VBoxContainer *main_vbox = memnew(VBoxContainer); add_child(main_vbox); event_as_text = memnew(Label); + event_as_text->set_custom_minimum_size(Size2(500, 0) * EDSCALE); event_as_text->set_autowrap_mode(TextServer::AUTOWRAP_WORD_SMART); event_as_text->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); event_as_text->add_theme_font_size_override("font_size", 18 * EDSCALE); diff --git a/editor/input_event_configuration_dialog.h b/editor/input_event_configuration_dialog.h index e7ab0da4d6..bde0b73ade 100644 --- a/editor/input_event_configuration_dialog.h +++ b/editor/input_event_configuration_dialog.h @@ -120,7 +120,8 @@ protected: public: // Pass an existing event to configure it. Alternatively, pass no event to start with a blank configuration. - void popup_and_configure(const Ref<InputEvent> &p_event = Ref<InputEvent>()); + // An action name can be passed for descriptive purposes. + void popup_and_configure(const Ref<InputEvent> &p_event = Ref<InputEvent>(), const String &p_current_action_name = ""); Ref<InputEvent> get_event() const; void set_allowed_input_types(int p_type_masks); diff --git a/editor/node_dock.cpp b/editor/node_dock.cpp index 6521730473..db4f5a67e5 100644 --- a/editor/node_dock.cpp +++ b/editor/node_dock.cpp @@ -67,14 +67,23 @@ void NodeDock::update_lists() { connections->update_tree(); } +void NodeDock::_on_node_tree_exited() { + set_node(nullptr); +} + void NodeDock::set_node(Node *p_node) { + if (last_valid_node) { + last_valid_node->disconnect("tree_exited", callable_mp(this, &NodeDock::_on_node_tree_exited)); + last_valid_node = nullptr; + } + connections->set_node(p_node); groups->set_current(p_node); + if (p_node) { last_valid_node = p_node; - } + last_valid_node->connect("tree_exited", callable_mp(this, &NodeDock::_on_node_tree_exited)); - if (p_node) { if (connections_button->is_pressed()) { connections->show(); } else { @@ -104,7 +113,7 @@ NodeDock::NodeDock() { mode_hb->hide(); connections_button = memnew(Button); - connections_button->set_flat(true); + connections_button->set_theme_type_variation("FlatButton"); connections_button->set_text(TTR("Signals")); connections_button->set_toggle_mode(true); connections_button->set_pressed(true); @@ -114,7 +123,7 @@ NodeDock::NodeDock() { connections_button->connect("pressed", callable_mp(this, &NodeDock::show_connections)); groups_button = memnew(Button); - groups_button->set_flat(true); + groups_button->set_theme_type_variation("FlatButton"); groups_button->set_text(TTR("Groups")); groups_button->set_toggle_mode(true); groups_button->set_pressed(false); diff --git a/editor/node_dock.h b/editor/node_dock.h index cc22171453..41495ffead 100644 --- a/editor/node_dock.h +++ b/editor/node_dock.h @@ -58,6 +58,7 @@ public: protected: static void _bind_methods(); void _notification(int p_what); + void _on_node_tree_exited(); public: void set_node(Node *p_node); diff --git a/editor/plugin_config_dialog.cpp b/editor/plugin_config_dialog.cpp index 196a2186a7..98b7ab6cc1 100644 --- a/editor/plugin_config_dialog.cpp +++ b/editor/plugin_config_dialog.cpp @@ -62,7 +62,7 @@ void PluginConfigDialog::_on_confirmed() { int lang_idx = script_option_edit->get_selected(); String ext = ScriptServer::get_language(lang_idx)->get_extension(); String script_name = script_edit->get_text().is_empty() ? _get_subfolder() : script_edit->get_text(); - if (script_name.get_extension().is_empty()) { + if (script_name.get_extension() != ext) { script_name += "." + ext; } String script_path = path.path_join(script_name); @@ -152,7 +152,7 @@ void PluginConfigDialog::config(const String &p_config_path) { ERR_FAIL_COND_MSG(err != OK, "Cannot load config file from path '" + p_config_path + "'."); name_edit->set_text(cf->get_value("plugin", "name", "")); - subfolder_edit->set_text(p_config_path.get_base_dir().get_basename().get_file()); + subfolder_edit->set_text(p_config_path.get_base_dir().get_file()); desc_edit->set_text(cf->get_value("plugin", "description", "")); author_edit->set_text(cf->get_value("plugin", "author", "")); version_edit->set_text(cf->get_value("plugin", "version", "")); diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp index d6f53e30c7..84251e1476 100644 --- a/editor/plugins/animation_player_editor_plugin.cpp +++ b/editor/plugins/animation_player_editor_plugin.cpp @@ -335,7 +335,7 @@ void AnimationPlayerEditor::_animation_selected(int p_which) { } AnimationPlayerEditor::get_singleton()->get_track_editor()->update_keying(); - _animation_key_editor_seek(timeline_position, false); + _animation_key_editor_seek(timeline_position); emit_signal("animation_selected", current); } @@ -1231,7 +1231,7 @@ Ref<Animation> AnimationPlayerEditor::_animation_clone(Ref<Animation> p_anim) { return new_anim; } -void AnimationPlayerEditor::_seek_value_changed(float p_value, bool p_set, bool p_timeline_only) { +void AnimationPlayerEditor::_seek_value_changed(float p_value, bool p_timeline_only) { if (updating || !player || player->is_playing()) { return; }; @@ -1247,22 +1247,14 @@ void AnimationPlayerEditor::_seek_value_changed(float p_value, bool p_set, bool Ref<Animation> anim; anim = player->get_animation(current); - float pos = CLAMP((double)anim->get_length() * (p_value / frame->get_max()), 0, (double)anim->get_length()); + double pos = CLAMP((double)anim->get_length() * (p_value / frame->get_max()), 0, (double)anim->get_length()); if (track_editor->is_snap_enabled()) { pos = Math::snapped(pos, _get_editor_step()); } + pos = CLAMP(pos, 0, (double)anim->get_length() - CMP_EPSILON2); // Hack: Avoid fposmod with LOOP_LINEAR. - if (!p_timeline_only) { - if (player->is_valid() && !p_set) { - double delta = player->get_current_animation_position(); - player->seek(pos, true, true); - player->seek(pos + delta, true, true); - } else { - if (player->is_playing()) { - player->stop(); - } - player->seek(pos, true, true); - } + if (!p_timeline_only && anim.is_valid()) { + player->seek(pos, true, true); } track_editor->set_anim_pos(pos); @@ -1313,7 +1305,7 @@ void AnimationPlayerEditor::_animation_key_editor_anim_len_changed(float p_len) frame->set_max(p_len); } -void AnimationPlayerEditor::_animation_key_editor_seek(float p_pos, bool p_drag, bool p_timeline_only) { +void AnimationPlayerEditor::_animation_key_editor_seek(float p_pos, bool p_timeline_only) { timeline_position = p_pos; if (!is_visible_in_tree()) { @@ -1335,7 +1327,7 @@ void AnimationPlayerEditor::_animation_key_editor_seek(float p_pos, bool p_drag, updating = true; frame->set_value(Math::snapped(p_pos, _get_editor_step())); updating = false; - _seek_value_changed(p_pos, !p_drag, p_timeline_only); + _seek_value_changed(p_pos, p_timeline_only); } void AnimationPlayerEditor::_animation_tool_menu(int p_option) { @@ -2006,7 +1998,7 @@ AnimationPlayerEditor::AnimationPlayerEditor(AnimationPlayerEditorPlugin *p_plug animation->connect(SNAME("item_selected"), callable_mp(this, &AnimationPlayerEditor::_animation_selected)); - frame->connect(SNAME("value_changed"), callable_mp(this, &AnimationPlayerEditor::_seek_value_changed).bind(true, false)); + frame->connect(SNAME("value_changed"), callable_mp(this, &AnimationPlayerEditor::_seek_value_changed).bind(false)); scale->connect(SNAME("text_submitted"), callable_mp(this, &AnimationPlayerEditor::_scale_changed)); add_child(track_editor); diff --git a/editor/plugins/animation_player_editor_plugin.h b/editor/plugins/animation_player_editor_plugin.h index 3db9ac2a54..c780023c6d 100644 --- a/editor/plugins/animation_player_editor_plugin.h +++ b/editor/plugins/animation_player_editor_plugin.h @@ -196,7 +196,7 @@ class AnimationPlayerEditor : public VBoxContainer { Ref<Animation> _animation_clone(const Ref<Animation> p_anim); void _animation_resource_edit(); void _scale_changed(const String &p_scale); - void _seek_value_changed(float p_value, bool p_set = false, bool p_timeline_only = false); + void _seek_value_changed(float p_value, bool p_timeline_only = false); void _blend_editor_next_changed(const int p_idx); void _edit_animation_blend(); @@ -213,7 +213,7 @@ class AnimationPlayerEditor : public VBoxContainer { void _animation_player_changed(Object *p_pl); void _animation_libraries_updated(); - void _animation_key_editor_seek(float p_pos, bool p_drag, bool p_timeline_only = false); + void _animation_key_editor_seek(float p_pos, bool p_timeline_only = false); void _animation_key_editor_anim_len_changed(float p_len); virtual void shortcut_input(const Ref<InputEvent> &p_ev) override; diff --git a/editor/plugins/bone_map_editor_plugin.cpp b/editor/plugins/bone_map_editor_plugin.cpp index 7d15edef1e..db61c95474 100644 --- a/editor/plugins/bone_map_editor_plugin.cpp +++ b/editor/plugins/bone_map_editor_plugin.cpp @@ -1347,7 +1347,7 @@ void BoneMapEditor::create_editors() { void BoneMapEditor::fetch_objects() { skeleton = nullptr; // Hackey... but it may be the easiest way to get a selected object from "ImporterScene". - SceneImportSettings *si = SceneImportSettings::get_singleton(); + SceneImportSettingsDialog *si = SceneImportSettingsDialog::get_singleton(); if (!si) { return; } diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 85846d7bc6..bac2a4909f 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -5613,8 +5613,7 @@ void CanvasItemEditorViewport::_on_change_type_closed() { void CanvasItemEditorViewport::_create_preview(const Vector<String> &files) const { bool add_preview = false; for (int i = 0; i < files.size(); i++) { - String path = files[i]; - Ref<Resource> res = ResourceLoader::load(path); + Ref<Resource> res = ResourceLoader::load(files[i]); ERR_FAIL_COND(res.is_null()); Ref<Texture2D> texture = Ref<Texture2D>(Object::cast_to<Texture2D>(*res)); Ref<PackedScene> scene = Ref<PackedScene>(Object::cast_to<PackedScene>(*res)); diff --git a/editor/plugins/gpu_particles_3d_editor_plugin.cpp b/editor/plugins/gpu_particles_3d_editor_plugin.cpp index e47af62b5b..88c9df7103 100644 --- a/editor/plugins/gpu_particles_3d_editor_plugin.cpp +++ b/editor/plugins/gpu_particles_3d_editor_plugin.cpp @@ -223,6 +223,9 @@ GPUParticles3DEditorBase::GPUParticles3DEditorBase() { emission_dialog->connect("confirmed", callable_mp(this, &GPUParticles3DEditorBase::_generate_emission_points)); emission_tree_dialog = memnew(SceneTreeDialog); + Vector<StringName> valid_types; + valid_types.push_back("MeshInstance3D"); + emission_tree_dialog->set_valid_types(valid_types); add_child(emission_tree_dialog); emission_tree_dialog->connect("selected", callable_mp(this, &GPUParticles3DEditorBase::_node_selected)); } diff --git a/editor/plugins/multimesh_editor_plugin.cpp b/editor/plugins/multimesh_editor_plugin.cpp index da1abc2af1..370c423b40 100644 --- a/editor/plugins/multimesh_editor_plugin.cpp +++ b/editor/plugins/multimesh_editor_plugin.cpp @@ -354,6 +354,9 @@ MultiMeshEditor::MultiMeshEditor() { populate_dialog->get_ok_button()->connect("pressed", callable_mp(this, &MultiMeshEditor::_populate)); std = memnew(SceneTreeDialog); + Vector<StringName> valid_types; + valid_types.push_back("MeshInstance3D"); + std->set_valid_types(valid_types); populate_dialog->add_child(std); std->connect("selected", callable_mp(this, &MultiMeshEditor::_browsed)); diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index 8ab35d150e..52f17c4a45 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -4152,9 +4152,9 @@ Node *Node3DEditorViewport::_sanitize_preview_node(Node *p_node) const { } void Node3DEditorViewport::_create_preview_node(const Vector<String> &files) const { + bool add_preview = false; for (int i = 0; i < files.size(); i++) { - String path = files[i]; - Ref<Resource> res = ResourceLoader::load(path); + Ref<Resource> res = ResourceLoader::load(files[i]); ERR_CONTINUE(res.is_null()); Ref<PackedScene> scene = Ref<PackedScene>(Object::cast_to<PackedScene>(*res)); Ref<Mesh> mesh = Ref<Mesh>(Object::cast_to<Mesh>(*res)); @@ -4172,9 +4172,13 @@ void Node3DEditorViewport::_create_preview_node(const Vector<String> &files) con } } } - EditorNode::get_singleton()->get_scene_root()->add_child(preview_node); + add_preview = true; } } + if (add_preview) { + EditorNode::get_singleton()->get_scene_root()->add_child(preview_node); + } + *preview_bounds = _calculate_spatial_bounds(preview_node); } diff --git a/editor/plugins/path_3d_editor_plugin.cpp b/editor/plugins/path_3d_editor_plugin.cpp index 9d66e606b0..6fe1949382 100644 --- a/editor/plugins/path_3d_editor_plugin.cpp +++ b/editor/plugins/path_3d_editor_plugin.cpp @@ -303,9 +303,19 @@ void Path3DGizmo::redraw() { } const Transform3D *r = frames.ptr(); + Vector<Vector3> _collision_segments; + _collision_segments.resize((sample_count - 1) * 2); + Vector3 *_collisions_ptr = _collision_segments.ptrw(); + Vector<Vector3> bones; + bones.resize(sample_count * 4); + Vector3 *bones_ptr = bones.ptrw(); + Vector<Vector3> ribbon; + ribbon.resize(sample_count); + Vector3 *ribbon_ptr = ribbon.ptrw(); + for (int i = 0; i < sample_count; i++) { const Vector3 p1 = r[i].origin; const Vector3 side = r[i].basis.get_column(0); @@ -313,23 +323,25 @@ void Path3DGizmo::redraw() { const Vector3 forward = r[i].basis.get_column(2); // Collision segments. - if (i != sample_count) { + if (i != sample_count - 1) { const Vector3 p2 = r[i + 1].origin; - _collision_segments.push_back(p1); - _collision_segments.push_back(p2); + _collisions_ptr[(i * 2)] = p1; + _collisions_ptr[(i * 2) + 1] = p2; } // Path3D as a ribbon. - ribbon.push_back(p1); + ribbon_ptr[i] = p1; // Fish Bone. const Vector3 p_left = p1 + (side + forward - up * 0.3) * 0.06; const Vector3 p_right = p1 + (-side + forward - up * 0.3) * 0.06; - bones.push_back(p1); - bones.push_back(p_left); - bones.push_back(p1); - bones.push_back(p_right); + const int bone_idx = i * 4; + + bones_ptr[bone_idx] = p1; + bones_ptr[bone_idx + 1] = p_left; + bones_ptr[bone_idx + 2] = p1; + bones_ptr[bone_idx + 3] = p_right; } add_collision_segments(_collision_segments); @@ -713,6 +725,9 @@ void Path3DEditorPlugin::_notification(int p_what) { } break; case NOTIFICATION_READY: { + // FIXME: This can trigger theme updates when the nodes that we want to update are not yet available. + // The toolbar should be extracted to a dedicated control and theme updates should be handled through + // the notification. Node3DEditor::get_singleton()->connect("theme_changed", callable_mp(this, &Path3DEditorPlugin::_update_theme)); } break; } diff --git a/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp index 8141d18341..f8e6c71a4c 100644 --- a/editor/plugins/polygon_2d_editor_plugin.cpp +++ b/editor/plugins/polygon_2d_editor_plugin.cpp @@ -456,6 +456,7 @@ void Polygon2DEditor::_uv_mode(int p_mode) { for (int i = 0; i < UV_MODE_MAX; i++) { uv_button[i]->set_pressed(p_mode == i); } + uv_edit_draw->queue_redraw(); } void Polygon2DEditor::_uv_input(const Ref<InputEvent> &p_input) { @@ -989,9 +990,36 @@ void Polygon2DEditor::_uv_draw() { mtx.columns[2] = -uv_draw_ofs; mtx.scale_basis(Vector2(uv_draw_zoom, uv_draw_zoom)); - RS::get_singleton()->canvas_item_add_set_transform(uv_edit_draw->get_canvas_item(), mtx); - uv_edit_draw->draw_texture(base_tex, Point2()); - RS::get_singleton()->canvas_item_add_set_transform(uv_edit_draw->get_canvas_item(), Transform2D()); + // Draw texture as a background if editing uvs or no uv mapping exist. + if (uv_edit_mode[0]->is_pressed() || uv_mode == UV_MODE_CREATE || node->get_polygon().is_empty() || node->get_uv().size() != node->get_polygon().size()) { + Transform2D texture_transform = Transform2D(node->get_texture_rotation(), node->get_texture_offset()); + texture_transform.scale(node->get_texture_scale()); + texture_transform.affine_invert(); + RS::get_singleton()->canvas_item_add_set_transform(uv_edit_draw->get_canvas_item(), mtx * texture_transform); + uv_edit_draw->draw_texture(base_tex, Point2()); + RS::get_singleton()->canvas_item_add_set_transform(uv_edit_draw->get_canvas_item(), Transform2D()); + preview_polygon->hide(); + } else { + preview_polygon->set_transform(mtx); + // Keep in sync with newly added Polygon2D properties (when relevant). + preview_polygon->set_texture(node->get_texture()); + preview_polygon->set_texture_offset(node->get_texture_offset()); + preview_polygon->set_texture_rotation(node->get_texture_rotation()); + preview_polygon->set_texture_scale(node->get_texture_scale()); + preview_polygon->set_texture_filter(node->get_texture_filter_in_tree()); + preview_polygon->set_texture_repeat(node->get_texture_repeat_in_tree()); + preview_polygon->set_polygon(node->get_polygon()); + preview_polygon->set_uv(node->get_uv()); + preview_polygon->set_invert(node->get_invert()); + preview_polygon->set_invert_border(node->get_invert_border()); + preview_polygon->set_internal_vertex_count(node->get_internal_vertex_count()); + if (uv_mode == UV_MODE_ADD_POLYGON) { + preview_polygon->set_polygons(Array()); + } else { + preview_polygon->set_polygons(node->get_polygons()); + } + preview_polygon->show(); + } if (snap_show_grid) { Color grid_color = Color(1.0, 1.0, 1.0, 0.15); @@ -1357,10 +1385,19 @@ Polygon2DEditor::Polygon2DEditor() { HSplitContainer *uv_main_hsc = memnew(HSplitContainer); uv_main_vb->add_child(uv_main_hsc); uv_main_hsc->set_v_size_flags(SIZE_EXPAND_FILL); - uv_edit_draw = memnew(Panel); - uv_main_hsc->add_child(uv_edit_draw); - uv_edit_draw->set_h_size_flags(SIZE_EXPAND_FILL); - uv_edit_draw->set_custom_minimum_size(Size2(200, 200) * EDSCALE); + + uv_edit_background = memnew(Panel); + uv_main_hsc->add_child(uv_edit_background); + uv_edit_background->set_h_size_flags(SIZE_EXPAND_FILL); + uv_edit_background->set_custom_minimum_size(Size2(200, 200) * EDSCALE); + uv_edit_background->set_clip_contents(true); + + preview_polygon = memnew(Polygon2D); + uv_edit_background->add_child(preview_polygon); + + uv_edit_draw = memnew(Control); + uv_edit_background->add_child(uv_edit_draw); + uv_edit_draw->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT); Control *space = memnew(Control); uv_mode_hb->add_child(space); @@ -1503,8 +1540,6 @@ Polygon2DEditor::Polygon2DEditor() { error = memnew(AcceptDialog); add_child(error); - - uv_edit_draw->set_clip_contents(true); } Polygon2DEditorPlugin::Polygon2DEditorPlugin() : diff --git a/editor/plugins/polygon_2d_editor_plugin.h b/editor/plugins/polygon_2d_editor_plugin.h index 3547c03120..8c52984b59 100644 --- a/editor/plugins/polygon_2d_editor_plugin.h +++ b/editor/plugins/polygon_2d_editor_plugin.h @@ -82,7 +82,9 @@ class Polygon2DEditor : public AbstractPolygon2DEditor { Button *uv_button[UV_MODE_MAX]; Button *b_snap_enable = nullptr; Button *b_snap_grid = nullptr; - Panel *uv_edit_draw = nullptr; + Panel *uv_edit_background = nullptr; + Polygon2D *preview_polygon = nullptr; + Control *uv_edit_draw = nullptr; HSlider *uv_zoom = nullptr; SpinBox *uv_zoom_value = nullptr; HScrollBar *uv_hscroll = nullptr; diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 6c4636dba3..c1a65b7bb7 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -548,7 +548,7 @@ void ScriptEditor::_set_breakpoint(Ref<RefCounted> p_script, int p_line, bool p_ } state["breakpoints"] = breakpoints; script_editor_cache->set_value(scr->get_path(), "state", state); - EditorDebuggerNode::get_singleton()->set_breakpoint(scr->get_path(), p_line + 1, false); + EditorDebuggerNode::get_singleton()->set_breakpoint(scr->get_path(), p_line + 1, p_enabled); } } @@ -1427,11 +1427,7 @@ void ScriptEditor::_menu_option(int p_option) { path = path.get_slice("::", 0); // Show the scene instead. } - FileSystemDock *file_system_dock = FileSystemDock::get_singleton(); - file_system_dock->navigate_to_path(path); - // Ensure that the FileSystem dock is visible. - TabContainer *dock_tab_container = (TabContainer *)file_system_dock->get_parent_control(); - dock_tab_container->set_current_tab(dock_tab_container->get_tab_idx_from_control(file_system_dock)); + FileSystemDock::get_singleton()->navigate_to_path(path); } } break; case CLOSE_DOCS: { @@ -3963,8 +3959,8 @@ ScriptEditor::ScriptEditor(WindowWrapper *p_wrapper) { _update_recent_scripts(); file_menu->get_popup()->add_separator(); - file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/save", TTR("Save"), KeyModifierMask::CMD_OR_CTRL | Key::S), FILE_SAVE); - file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/save_as", TTR("Save As..."), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::S), FILE_SAVE_AS); + file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/save", TTR("Save"), KeyModifierMask::ALT | KeyModifierMask::CMD_OR_CTRL | Key::S), FILE_SAVE); + file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/save_as", TTR("Save As...")), FILE_SAVE_AS); file_menu->get_popup()->add_shortcut(ED_SHORTCUT("script_editor/save_all", TTR("Save All"), KeyModifierMask::SHIFT | KeyModifierMask::ALT | Key::S), FILE_SAVE_ALL); ED_SHORTCUT_OVERRIDE("script_editor/save_all", "macos", KeyModifierMask::META | KeyModifierMask::CTRL | Key::S); file_menu->get_popup()->add_separator(); diff --git a/editor/plugins/script_editor_plugin.h b/editor/plugins/script_editor_plugin.h index f6c2eb727b..4a814ea1bc 100644 --- a/editor/plugins/script_editor_plugin.h +++ b/editor/plugins/script_editor_plugin.h @@ -204,6 +204,10 @@ class EditorScriptCodeCompletionCache; class FindInFilesDialog; class FindInFilesPanel; +#ifdef MINGW_ENABLED +#undef FILE_OPEN +#endif + class ScriptEditor : public PanelContainer { GDCLASS(ScriptEditor, PanelContainer); diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index 9ed997dca7..04eda502d2 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -1650,7 +1650,7 @@ void ScriptTextEditor::reload(bool p_soft) { return; } scr->set_source_code(te->get_text()); - bool soft = p_soft || scr->get_instance_base_type() == "EditorPlugin"; // Always soft-reload editor plugins. + bool soft = p_soft || ClassDB::is_parent_class(scr->get_instance_base_type(), "EditorPlugin"); // Always soft-reload editor plugins. scr->get_language()->reload_tool_script(scr, soft); } diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp index 18f5c31caa..9da201f9f1 100644 --- a/editor/plugins/shader_editor_plugin.cpp +++ b/editor/plugins/shader_editor_plugin.cpp @@ -613,8 +613,8 @@ ShaderEditorPlugin::ShaderEditorPlugin() { file_menu->get_popup()->add_separator(); file_menu->get_popup()->add_item(TTR("Load Shader File"), FILE_OPEN); file_menu->get_popup()->add_item(TTR("Load Shader Include File"), FILE_OPEN_INCLUDE); - file_menu->get_popup()->add_shortcut(ED_SHORTCUT("shader_editor/save", TTR("Save File"), KeyModifierMask::CMD_OR_CTRL | Key::S), FILE_SAVE); - file_menu->get_popup()->add_shortcut(ED_SHORTCUT("shader_editor/save_as", TTR("Save File As"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::S), FILE_SAVE_AS); + file_menu->get_popup()->add_shortcut(ED_SHORTCUT("shader_editor/save", TTR("Save File"), KeyModifierMask::ALT | KeyModifierMask::CMD_OR_CTRL | Key::S), FILE_SAVE); + file_menu->get_popup()->add_shortcut(ED_SHORTCUT("shader_editor/save_as", TTR("Save File As")), FILE_SAVE_AS); file_menu->get_popup()->add_separator(); file_menu->get_popup()->add_item(TTR("Open File in Inspector"), FILE_INSPECT); file_menu->get_popup()->add_separator(); diff --git a/editor/plugins/shader_editor_plugin.h b/editor/plugins/shader_editor_plugin.h index 039afd61fe..073b0ee192 100644 --- a/editor/plugins/shader_editor_plugin.h +++ b/editor/plugins/shader_editor_plugin.h @@ -42,6 +42,10 @@ class TextShaderEditor; class VisualShaderEditor; class WindowWrapper; +#ifdef MINGW_ENABLED +#undef FILE_OPEN +#endif + class ShaderEditorPlugin : public EditorPlugin { GDCLASS(ShaderEditorPlugin, EditorPlugin); diff --git a/editor/plugins/sprite_2d_editor_plugin.cpp b/editor/plugins/sprite_2d_editor_plugin.cpp index 56d74bba0a..7c1c6a8f82 100644 --- a/editor/plugins/sprite_2d_editor_plugin.cpp +++ b/editor/plugins/sprite_2d_editor_plugin.cpp @@ -159,9 +159,6 @@ void Sprite2DEditor::_popup_debug_uv_dialog() { if (texture.is_null()) { error_message = TTR("Can't convert an empty sprite to mesh."); } - if (node->get_hframes() > 1 || node->get_vframes() > 1) { - error_message = TTR("Can't convert a sprite using animation frames to mesh."); - } if (!error_message.is_empty()) { err_dialog->set_text(error_message); @@ -185,9 +182,9 @@ void Sprite2DEditor::_update_mesh_data() { image->decompress(); } - // TODO: Add support for Sprite2D's region. - Rect2 rect; - rect.size = image->get_size(); + Rect2 rect = node->is_region_enabled() ? node->get_region_rect() : Rect2(Point2(), image->get_size()); + rect.size /= Vector2(node->get_hframes(), node->get_vframes()); + rect.position += node->get_frame_coords() * rect.size; Ref<BitMap> bm; bm.instantiate(); @@ -224,18 +221,15 @@ void Sprite2DEditor::_update_mesh_data() { for (int i = 0; i < lines[j].size(); i++) { Vector2 vtx = lines[j][i]; - computed_uv.push_back(vtx / img_size); - - vtx -= rect.position; //offset by rect position + computed_uv.push_back((vtx + rect.position) / img_size); - //flip if flipped if (node->is_flipped_h()) { - vtx.x = rect.size.x - vtx.x - 1.0; + vtx.x = rect.size.x - vtx.x; } if (node->is_flipped_v()) { - vtx.y = rect.size.y - vtx.y - 1.0; + vtx.y = rect.size.y - vtx.y; } - + vtx += node->get_offset(); if (node->is_centered()) { vtx -= rect.size / 2.0; } @@ -249,8 +243,8 @@ void Sprite2DEditor::_update_mesh_data() { for (int k = 0; k < 3; k++) { int idx = i + k; int idxn = i + (k + 1) % 3; - uv_lines.push_back(lines[j][poly[idx]]); - uv_lines.push_back(lines[j][poly[idxn]]); + uv_lines.push_back(lines[j][poly[idx]] + rect.position); + uv_lines.push_back(lines[j][poly[idxn]] + rect.position); computed_indices.push_back(poly[idx] + index_ofs); } @@ -273,19 +267,18 @@ void Sprite2DEditor::_update_mesh_data() { for (int i = 0; i < lines[pi].size(); i++) { Vector2 vtx = lines[pi][i]; + ol.write[i] = vtx + rect.position; - ol.write[i] = vtx; - - vtx -= rect.position; //offset by rect position - - //flip if flipped if (node->is_flipped_h()) { - vtx.x = rect.size.x - vtx.x - 1.0; + vtx.x = rect.size.x - vtx.x; } if (node->is_flipped_v()) { - vtx.y = rect.size.y - vtx.y - 1.0; + vtx.y = rect.size.y - vtx.y; + } + // Don't bake offset to Polygon2D which has offset property. + if (selected_menu_item != MENU_OPTION_CONVERT_TO_POLYGON_2D) { + vtx += node->get_offset(); } - if (node->is_centered()) { vtx -= rect.size / 2.0; } diff --git a/editor/plugins/theme_editor_plugin.cpp b/editor/plugins/theme_editor_plugin.cpp index 9ea0a03e68..6c153f6113 100644 --- a/editor/plugins/theme_editor_plugin.cpp +++ b/editor/plugins/theme_editor_plugin.cpp @@ -2287,8 +2287,11 @@ VBoxContainer *ThemeTypeEditor::_create_item_list(Theme::DataType p_data_type) { item_add_edit->connect("text_submitted", callable_mp(this, &ThemeTypeEditor::_item_add_lineedit_cbk).bind(p_data_type, item_add_edit)); Button *item_add_button = memnew(Button); item_add_button->set_text(TTR("Add")); + item_add_button->set_disabled(true); item_add_hb->add_child(item_add_button); item_add_button->connect("pressed", callable_mp(this, &ThemeTypeEditor::_item_add_cbk).bind(p_data_type, item_add_edit)); + item_add_edit->set_meta("button", item_add_button); + item_add_edit->connect("text_changed", callable_mp(this, &ThemeTypeEditor::_update_add_button).bind(item_add_edit)); return items_list; } @@ -2850,6 +2853,11 @@ void ThemeTypeEditor::_add_default_type_items() { ur->commit_action(); } +void ThemeTypeEditor::_update_add_button(const String &p_text, LineEdit *p_for_edit) { + Button *button = Object::cast_to<Button>(p_for_edit->get_meta("button")); + button->set_disabled(p_text.strip_edges().is_empty()); +} + void ThemeTypeEditor::_item_add_cbk(int p_data_type, Control *p_control) { LineEdit *le = Object::cast_to<LineEdit>(p_control); if (le->get_text().strip_edges().is_empty()) { @@ -2895,6 +2903,7 @@ void ThemeTypeEditor::_item_add_cbk(int p_data_type, Control *p_control) { ur->commit_action(); le->set_text(""); + _update_add_button("", le); } void ThemeTypeEditor::_item_add_lineedit_cbk(String p_value, int p_data_type, Control *p_control) { diff --git a/editor/plugins/theme_editor_plugin.h b/editor/plugins/theme_editor_plugin.h index 33accf587a..cf8c5ceb28 100644 --- a/editor/plugins/theme_editor_plugin.h +++ b/editor/plugins/theme_editor_plugin.h @@ -382,6 +382,7 @@ class ThemeTypeEditor : public MarginContainer { void _add_type_button_cbk(); void _add_default_type_items(); + void _update_add_button(const String &p_text, LineEdit *p_for_edit); void _item_add_cbk(int p_data_type, Control *p_control); void _item_add_lineedit_cbk(String p_value, int p_data_type, Control *p_control); void _item_override_cbk(int p_data_type, String p_item_name); diff --git a/editor/plugins/tiles/tile_data_editors.cpp b/editor/plugins/tiles/tile_data_editors.cpp index ad4844fe3e..221833d450 100644 --- a/editor/plugins/tiles/tile_data_editors.cpp +++ b/editor/plugins/tiles/tile_data_editors.cpp @@ -1421,8 +1421,8 @@ void TileDataOcclusionShapeEditor::draw_over_tile(CanvasItem *p_canvas_item, Tra Variant TileDataOcclusionShapeEditor::_get_painted_value() { Ref<OccluderPolygon2D> occluder_polygon; - occluder_polygon.instantiate(); if (polygon_editor->get_polygon_count() >= 1) { + occluder_polygon.instantiate(); occluder_polygon->set_polygon(polygon_editor->get_polygon(0)); } return occluder_polygon; diff --git a/editor/plugins/tiles/tile_map_editor.cpp b/editor/plugins/tiles/tile_map_editor.cpp index 6bee3660cf..7b3847e548 100644 --- a/editor/plugins/tiles/tile_map_editor.cpp +++ b/editor/plugins/tiles/tile_map_editor.cpp @@ -524,6 +524,7 @@ bool TileMapEditorTilesPlugin::forward_canvas_gui_input(const Ref<InputEvent> &p } if (CanvasItemEditor::get_singleton()->get_current_tool() != CanvasItemEditor::TOOL_SELECT) { + _stop_dragging(); return false; } @@ -2373,7 +2374,9 @@ TileMapEditorTilesPlugin::TileMapEditorTilesPlugin() { // --- Bottom panel tiles --- tiles_bottom_panel = memnew(VBoxContainer); - tiles_bottom_panel->connect("tree_entered", callable_mp(this, &TileMapEditorTilesPlugin::_update_theme)); + // FIXME: This can trigger theme updates when the nodes that we want to update are not yet available. + // The toolbar should be extracted to a dedicated control and theme updates should be handled through + // the notification. tiles_bottom_panel->connect("theme_changed", callable_mp(this, &TileMapEditorTilesPlugin::_update_theme)); tiles_bottom_panel->connect("visibility_changed", callable_mp(this, &TileMapEditorTilesPlugin::_stop_dragging)); tiles_bottom_panel->connect("visibility_changed", callable_mp(this, &TileMapEditorTilesPlugin::_tab_changed)); @@ -3536,7 +3539,9 @@ void TileMapEditorTerrainsPlugin::edit(ObjectID p_tile_map_id, int p_tile_map_la TileMapEditorTerrainsPlugin::TileMapEditorTerrainsPlugin() { main_vbox_container = memnew(VBoxContainer); - main_vbox_container->connect("tree_entered", callable_mp(this, &TileMapEditorTerrainsPlugin::_update_theme)); + // FIXME: This can trigger theme updates when the nodes that we want to update are not yet available. + // The toolbar should be extracted to a dedicated control and theme updates should be handled through + // the notification. main_vbox_container->connect("theme_changed", callable_mp(this, &TileMapEditorTerrainsPlugin::_update_theme)); main_vbox_container->set_name(TTR("Terrains")); diff --git a/editor/plugins/tiles/tile_set_editor.cpp b/editor/plugins/tiles/tile_set_editor.cpp index 5bde1f754b..ef56e66e85 100644 --- a/editor/plugins/tiles/tile_set_editor.cpp +++ b/editor/plugins/tiles/tile_set_editor.cpp @@ -86,8 +86,7 @@ bool TileSetEditor::_can_drop_data_fw(const Point2 &p_point, const Variant &p_da } for (int i = 0; i < files.size(); i++) { - String file = files[i]; - String ftype = EditorFileSystem::get_singleton()->get_file_type(file); + String ftype = EditorFileSystem::get_singleton()->get_file_type(files[i]); if (!ClassDB::is_parent_class(ftype, "Texture2D")) { return false; diff --git a/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp b/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp index eaf7a2b50b..1f4c3651e9 100644 --- a/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp +++ b/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp @@ -479,8 +479,7 @@ bool TileSetScenesCollectionSourceEditor::_can_drop_data_fw(const Point2 &p_poin } for (int i = 0; i < files.size(); i++) { - String file = files[i]; - String ftype = EditorFileSystem::get_singleton()->get_file_type(file); + String ftype = EditorFileSystem::get_singleton()->get_file_type(files[i]); if (!ClassDB::is_parent_class(ftype, "PackedScene")) { return false; diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index 5e16361bae..5c22e454ab 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -4080,6 +4080,12 @@ void VisualShaderEditor::_show_members_dialog(bool at_mouse_pos, VisualShaderNod saved_node_pos_dirty = false; members_dialog->set_position(graph->get_screen_position() + Point2(5 * EDSCALE, 65 * EDSCALE)); } + + if (members_dialog->is_visible()) { + members_dialog->grab_focus(); + return; + } + members_dialog->popup(); // Keep dialog within window bounds. @@ -4820,16 +4826,14 @@ void VisualShaderEditor::_varying_create() { add_varying_dialog->hide(); } -void VisualShaderEditor::_varying_name_changed(const String &p_text) { - String name = p_text; - - if (!name.is_valid_identifier()) { +void VisualShaderEditor::_varying_name_changed(const String &p_name) { + if (!p_name.is_valid_identifier()) { varying_error_label->show(); varying_error_label->set_text(TTR("Invalid name for varying.")); add_varying_dialog->get_ok_button()->set_disabled(true); return; } - if (visual_shader->has_varying(name)) { + if (visual_shader->has_varying(p_name)) { varying_error_label->show(); varying_error_label->set_text(TTR("Varying with that name is already exist.")); add_varying_dialog->get_ok_button()->set_disabled(true); @@ -5384,6 +5388,7 @@ VisualShaderEditor::VisualShaderEditor() { preview_window = memnew(Window); preview_window->set_title(TTR("Generated Shader Code")); preview_window->set_visible(preview_showed); + preview_window->set_exclusive(true); preview_window->connect("close_requested", callable_mp(this, &VisualShaderEditor::_preview_close_requested)); preview_window->connect("size_changed", callable_mp(this, &VisualShaderEditor::_preview_size_changed)); add_child(preview_window); @@ -5485,7 +5490,7 @@ VisualShaderEditor::VisualShaderEditor() { members_dialog = memnew(ConfirmationDialog); members_dialog->set_title(TTR("Create Shader Node")); - members_dialog->set_exclusive(false); + members_dialog->set_exclusive(true); members_dialog->add_child(members_vb); members_dialog->set_ok_button_text(TTR("Create")); members_dialog->get_ok_button()->connect("pressed", callable_mp(this, &VisualShaderEditor::_member_create)); @@ -5497,7 +5502,7 @@ VisualShaderEditor::VisualShaderEditor() { { add_varying_dialog = memnew(ConfirmationDialog); add_varying_dialog->set_title(TTR("Create Shader Varying")); - add_varying_dialog->set_exclusive(false); + add_varying_dialog->set_exclusive(true); add_varying_dialog->set_ok_button_text(TTR("Create")); add_varying_dialog->get_ok_button()->connect("pressed", callable_mp(this, &VisualShaderEditor::_varying_create)); add_varying_dialog->get_ok_button()->set_disabled(true); @@ -5543,7 +5548,7 @@ VisualShaderEditor::VisualShaderEditor() { { remove_varying_dialog = memnew(ConfirmationDialog); remove_varying_dialog->set_title(TTR("Delete Shader Varying")); - remove_varying_dialog->set_exclusive(false); + remove_varying_dialog->set_exclusive(true); remove_varying_dialog->set_ok_button_text(TTR("Delete")); remove_varying_dialog->get_ok_button()->connect("pressed", callable_mp(this, &VisualShaderEditor::_varying_deleted)); add_child(remove_varying_dialog); diff --git a/editor/plugins/visual_shader_editor_plugin.h b/editor/plugins/visual_shader_editor_plugin.h index 07a73b4e51..5f1fde3a52 100644 --- a/editor/plugins/visual_shader_editor_plugin.h +++ b/editor/plugins/visual_shader_editor_plugin.h @@ -260,6 +260,10 @@ class VisualShaderEditor : public VBoxContainer { COLLAPSE_ALL }; +#ifdef MINGW_ENABLED +#undef DELETE +#endif + enum NodeMenuOptions { ADD, SEPARATOR, // ignore @@ -487,7 +491,7 @@ class VisualShaderEditor : public VBoxContainer { void _member_cancel(); void _varying_create(); - void _varying_name_changed(const String &p_text); + void _varying_name_changed(const String &p_name); void _varying_deleted(); void _varying_selected(); void _varying_unselected(); diff --git a/editor/progress_dialog.cpp b/editor/progress_dialog.cpp index e5db5f9d30..366d0cb2fc 100644 --- a/editor/progress_dialog.cpp +++ b/editor/progress_dialog.cpp @@ -147,6 +147,13 @@ void ProgressDialog::_popup() { main->set_offset(SIDE_BOTTOM, -style->get_margin(SIDE_BOTTOM)); if (!is_inside_tree()) { + for (Window *window : host_windows) { + if (window->has_focus()) { + popup_exclusive_centered(window, ms); + return; + } + } + // No host window found, use main window. EditorInterface::get_singleton()->popup_dialog_centered(this, ms); } } @@ -226,6 +233,11 @@ void ProgressDialog::end_task(const String &p_task) { } } +void ProgressDialog::add_host_window(Window *p_window) { + ERR_FAIL_NULL(p_window); + host_windows.push_back(p_window); +} + void ProgressDialog::_cancel_pressed() { canceled = true; } diff --git a/editor/progress_dialog.h b/editor/progress_dialog.h index ae47e5f25c..c75c8fac10 100644 --- a/editor/progress_dialog.h +++ b/editor/progress_dialog.h @@ -81,6 +81,8 @@ class ProgressDialog : public PopupPanel { VBoxContainer *main = nullptr; uint64_t last_progress_tick; + LocalVector<Window *> host_windows; + static ProgressDialog *singleton; void _popup(); @@ -96,6 +98,8 @@ public: bool task_step(const String &p_task, const String &p_state, int p_step = -1, bool p_force_redraw = true); void end_task(const String &p_task); + void add_host_window(Window *p_window); + ProgressDialog(); }; diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp index 40c482eb90..291484600c 100644 --- a/editor/project_manager.cpp +++ b/editor/project_manager.cpp @@ -101,12 +101,6 @@ void ProjectDialog::_set_message(const String &p_msg, MessageType p_type, InputT } else if (current_install_icon != new_icon && input_type == INSTALL_PATH) { install_status_rect->set_texture(new_icon); } - - Size2i window_size = get_size(); - Size2 contents_min_size = get_contents_minimum_size(); - if (window_size.x < contents_min_size.x || window_size.y < contents_min_size.y) { - set_size(window_size.max(contents_min_size)); - } } String ProjectDialog::_test_path() { @@ -727,9 +721,12 @@ void ProjectDialog::show_dialog() { project_path->set_text(d->get_current_dir()); fdialog->set_current_dir(d->get_current_dir()); } - String proj = TTR("New Game Project"); - project_name->set_text(proj); - _text_changed(proj); + + if (project_name->get_text().is_empty()) { + String proj = TTR("New Game Project"); + project_name->set_text(proj); + _text_changed(proj); + } project_path->set_editable(true); browse->set_disabled(false); @@ -865,6 +862,7 @@ ProjectDialog::ProjectDialog() { msg = memnew(Label); msg->set_horizontal_alignment(HORIZONTAL_ALIGNMENT_CENTER); + msg->set_custom_minimum_size(Size2(200, 0) * EDSCALE); vb->add_child(msg); // Renderer selection. diff --git a/editor/register_editor_types.cpp b/editor/register_editor_types.cpp index 9a667d5775..075c856c1c 100644 --- a/editor/register_editor_types.cpp +++ b/editor/register_editor_types.cpp @@ -129,7 +129,7 @@ #include "editor/register_exporters.h" void register_editor_types() { - OS::get_singleton()->benchmark_begin_measure("register_editor_types"); + OS::get_singleton()->benchmark_begin_measure("Editor", "Register Types"); ResourceLoader::set_timestamp_on_load(true); ResourceSaver::set_timestamp_on_save(true); @@ -282,11 +282,11 @@ void register_editor_types() { ei_singleton.editor_only = true; Engine::get_singleton()->add_singleton(ei_singleton); - OS::get_singleton()->benchmark_end_measure("register_editor_types"); + OS::get_singleton()->benchmark_end_measure("Editor", "Register Types"); } void unregister_editor_types() { - OS::get_singleton()->benchmark_begin_measure("unregister_editor_types"); + OS::get_singleton()->benchmark_begin_measure("Editor", "Unregister Types"); EditorNode::cleanup(); EditorInterface::free(); @@ -296,5 +296,5 @@ void unregister_editor_types() { } EditorStringNames::free(); - OS::get_singleton()->benchmark_end_measure("unregister_editor_types"); + OS::get_singleton()->benchmark_end_measure("Editor", "Unregister Types"); } diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index a94c978a1a..6553a592d0 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -46,6 +46,7 @@ #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/editor_undo_redo_manager.h" +#include "editor/filesystem_dock.h" #include "editor/gui/editor_file_dialog.h" #include "editor/inspector_dock.h" #include "editor/multi_node_edit.h" @@ -148,6 +149,8 @@ void SceneTreeDock::shortcut_input(const Ref<InputEvent> &p_event) { _tool_selected(TOOL_ERASE, true); } else if (ED_IS_SHORTCUT("scene_tree/copy_node_path", p_event)) { _tool_selected(TOOL_COPY_NODE_PATH); + } else if (ED_IS_SHORTCUT("scene_tree/show_in_file_system", p_event)) { + _tool_selected(TOOL_SHOW_IN_FILE_SYSTEM); } else if (ED_IS_SHORTCUT("scene_tree/toggle_unique_name", p_event)) { _tool_selected(TOOL_TOGGLE_SCENE_UNIQUE_NAME); } else if (ED_IS_SHORTCUT("scene_tree/delete", p_event)) { @@ -1016,6 +1019,16 @@ void SceneTreeDock::_tool_selected(int p_tool, bool p_confirm_override) { } } } break; + case TOOL_SHOW_IN_FILE_SYSTEM: { + List<Node *> selection = editor_selection->get_selected_node_list(); + List<Node *>::Element *e = selection.front(); + if (e) { + const Node *node = e->get(); + if (node) { + FileSystemDock::get_singleton()->navigate_to_path(node->get_scene_file_path()); + } + } + } break; case TOOL_OPEN_DOCUMENTATION: { List<Node *> selection = editor_selection->get_selected_node_list(); for (int i = 0; i < selection.size(); i++) { @@ -1762,6 +1775,8 @@ bool SceneTreeDock::_check_node_path_recursive(Node *p_root_node, Variant &r_var } } break; +// FIXME: This approach causes a significant performance regression, see GH-84910. +#if 0 case Variant::OBJECT: { Resource *resource = Object::cast_to<Resource>(r_variant); if (!resource) { @@ -1792,6 +1807,7 @@ bool SceneTreeDock::_check_node_path_recursive(Node *p_root_node, Variant &r_var } break; }; +#endif default: { } @@ -2176,6 +2192,7 @@ void SceneTreeDock::_do_reparent(Node *p_new_parent, int p_position_in_parent, V } int child_pos = node->get_index(false); + bool reparented_to_container = Object::cast_to<Container>(new_parent) && Object::cast_to<Control>(node); undo_redo->add_undo_method(node->get_parent(), "add_child", node, true); undo_redo->add_undo_method(node->get_parent(), "move_child", node, child_pos); @@ -2191,10 +2208,14 @@ void SceneTreeDock::_do_reparent(Node *p_new_parent, int p_position_in_parent, V if (Object::cast_to<Node3D>(node)) { undo_redo->add_undo_method(node, "set_transform", Object::cast_to<Node3D>(node)->get_transform()); } - if (Object::cast_to<Control>(node)) { + if (!reparented_to_container && Object::cast_to<Control>(node)) { undo_redo->add_undo_method(node, "set_position", Object::cast_to<Control>(node)->get_position()); } } + + if (reparented_to_container) { + undo_redo->add_undo_method(node, "_edit_set_state", Object::cast_to<Control>(node)->_edit_get_state()); + } } perform_node_renames(nullptr, &path_renames); @@ -3266,6 +3287,11 @@ void SceneTreeDock::_tree_rmb(const Vector2 &p_menu_pos) { } #endif // MODULE_REGEX_ENABLED menu->add_separator(); + + if (full_selection.size() == 1 && !selection[0]->get_scene_file_path().is_empty()) { + menu->add_icon_shortcut(get_editor_theme_icon(SNAME("ShowInFileSystem")), ED_GET_SHORTCUT("scene_tree/show_in_file_system"), TOOL_SHOW_IN_FILE_SYSTEM); + } + menu->add_icon_item(get_editor_theme_icon(SNAME("Help")), TTR("Open Documentation"), TOOL_OPEN_DOCUMENTATION); if (profile_allow_editing) { @@ -3304,7 +3330,7 @@ void SceneTreeDock::_filter_changed(const String &p_filter) { filter->set_tooltip_text(warning); } else { filter->remove_theme_icon_override(SNAME("clear")); - filter->set_tooltip_text(""); + filter->set_tooltip_text(TTR("Filter nodes by entering a part of their name, type (if prefixed with \"type:\" or \"t:\")\nor group (if prefixed with \"group:\" or \"g:\"). Filtering is case-insensitive.")); } } @@ -3967,6 +3993,7 @@ SceneTreeDock::SceneTreeDock(Node *p_scene_root, EditorSelection *p_editor_selec ED_SHORTCUT("scene_tree/make_root", TTR("Make Scene Root")); ED_SHORTCUT("scene_tree/save_branch_as_scene", TTR("Save Branch as Scene")); ED_SHORTCUT("scene_tree/copy_node_path", TTR("Copy Node Path"), KeyModifierMask::CMD_OR_CTRL | KeyModifierMask::SHIFT | Key::C); + ED_SHORTCUT("scene_tree/show_in_file_system", TTR("Show In FileSystem")); ED_SHORTCUT("scene_tree/toggle_unique_name", TTR("Toggle Access as Unique Name")); ED_SHORTCUT("scene_tree/delete_no_confirm", TTR("Delete (No Confirm)"), KeyModifierMask::SHIFT | Key::KEY_DELETE); ED_SHORTCUT("scene_tree/delete", TTR("Delete"), Key::KEY_DELETE); @@ -4031,21 +4058,21 @@ SceneTreeDock::SceneTreeDock(Node *p_scene_root, EditorSelection *p_editor_selec vbc->add_child(button_hb); edit_remote = memnew(Button); - edit_remote->set_flat(true); - button_hb->add_child(edit_remote); + edit_remote->set_theme_type_variation("FlatButton"); edit_remote->set_h_size_flags(SIZE_EXPAND_FILL); edit_remote->set_text(TTR("Remote")); edit_remote->set_toggle_mode(true); edit_remote->set_tooltip_text(TTR("If selected, the Remote scene tree dock will cause the project to stutter every time it updates.\nSwitch back to the Local scene tree dock to improve performance.")); + button_hb->add_child(edit_remote); edit_remote->connect("pressed", callable_mp(this, &SceneTreeDock::_remote_tree_selected)); edit_local = memnew(Button); - edit_local->set_flat(true); - button_hb->add_child(edit_local); + edit_local->set_theme_type_variation("FlatButton"); edit_local->set_h_size_flags(SIZE_EXPAND_FILL); edit_local->set_text(TTR("Local")); edit_local->set_toggle_mode(true); edit_local->set_pressed(true); + button_hb->add_child(edit_local); edit_local->connect("pressed", callable_mp(this, &SceneTreeDock::_local_tree_selected)); remote_tree = nullptr; diff --git a/editor/scene_tree_dock.h b/editor/scene_tree_dock.h index 93c0e16db7..fc9c271526 100644 --- a/editor/scene_tree_dock.h +++ b/editor/scene_tree_dock.h @@ -79,6 +79,7 @@ class SceneTreeDock : public VBoxContainer { TOOL_MULTI_EDIT, TOOL_ERASE, TOOL_COPY_NODE_PATH, + TOOL_SHOW_IN_FILE_SYSTEM, TOOL_OPEN_DOCUMENTATION, TOOL_AUTO_EXPAND, TOOL_SCENE_EDITABLE_CHILDREN, diff --git a/editor/shader_create_dialog.cpp b/editor/shader_create_dialog.cpp index 28776cbddc..fb91d139a7 100644 --- a/editor/shader_create_dialog.cpp +++ b/editor/shader_create_dialog.cpp @@ -48,8 +48,6 @@ enum ShaderType { void ShaderCreateDialog::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: { - _update_theme(); - String last_lang = EditorSettings::get_singleton()->get_project_metadata("shader_setup", "last_selected_language", ""); if (!last_lang.is_empty()) { for (int i = 0; i < type_menu->get_item_count(); i++) { @@ -68,28 +66,17 @@ void ShaderCreateDialog::_notification(int p_what) { } break; case NOTIFICATION_THEME_CHANGED: { - _update_theme(); - } break; - } -} - -void ShaderCreateDialog::_update_theme() { - Ref<Texture2D> shader_icon = gc->get_editor_theme_icon(SNAME("Shader")); - if (shader_icon.is_valid()) { - type_menu->set_item_icon(0, shader_icon); - } - - Ref<Texture2D> visual_shader_icon = gc->get_editor_theme_icon(SNAME("VisualShader")); - if (visual_shader_icon.is_valid()) { - type_menu->set_item_icon(1, visual_shader_icon); - } + static const char *shader_types[3] = { "Shader", "VisualShader", "TextFile" }; + for (int i = 0; i < 3; i++) { + Ref<Texture2D> icon = get_editor_theme_icon(shader_types[i]); + if (icon.is_valid()) { + type_menu->set_item_icon(i, icon); + } + } - Ref<Texture2D> include_icon = gc->get_editor_theme_icon(SNAME("TextFile")); - if (include_icon.is_valid()) { - type_menu->set_item_icon(2, include_icon); + path_button->set_icon(get_editor_theme_icon(SNAME("Folder"))); + } break; } - - path_button->set_icon(get_editor_theme_icon(SNAME("Folder"))); } void ShaderCreateDialog::_update_language_info() { @@ -175,9 +162,10 @@ void fragment() { // Called for every pixel the material is visible on. } -void light() { +//void light() { // Called for every pixel for every light affecting the material. -} + // Uncomment to replace the default light processing function with this one. +//} )"; break; case Shader::MODE_CANVAS_ITEM: @@ -190,9 +178,10 @@ void fragment() { // Called for every pixel the material is visible on. } -void light() { +//void light() { // Called for every pixel for every light affecting the CanvasItem. -} + // Uncomment to replace the default light processing function with this one. +//} )"; break; case Shader::MODE_PARTICLES: diff --git a/editor/shader_create_dialog.h b/editor/shader_create_dialog.h index d6d9f10020..5240842110 100644 --- a/editor/shader_create_dialog.h +++ b/editor/shader_create_dialog.h @@ -101,7 +101,6 @@ class ShaderCreateDialog : public ConfirmationDialog { void _update_dialog(); protected: - void _update_theme(); void _notification(int p_what); static void _bind_methods(); diff --git a/editor/surface_upgrade_tool.cpp b/editor/surface_upgrade_tool.cpp index 2294ff22e5..78ebe43c96 100644 --- a/editor/surface_upgrade_tool.cpp +++ b/editor/surface_upgrade_tool.cpp @@ -31,8 +31,11 @@ #include "surface_upgrade_tool.h" #include "editor/editor_file_system.h" +#include "editor/editor_log.h" #include "editor/editor_node.h" +#include "editor/editor_scale.h" #include "editor/editor_settings.h" +#include "editor/gui/editor_toaster.h" #include "scene/scene_string_names.h" #include "servers/rendering_server.h" @@ -57,54 +60,62 @@ void SurfaceUpgradeTool::_add_files(EditorFileSystemDirectory *p_dir, Vector<Str } void SurfaceUpgradeTool::_try_show_popup() { - if (singleton->show_requested || singleton->popped_up) { + if (singleton->show_requested || singleton->updating) { return; } + singleton->show_requested = true; - RS::get_singleton()->set_warn_on_surface_upgrade(false); + if (!EditorNode::get_singleton()->is_editor_ready()) { + // EditorNode may not be ready yet. It will call this tool when it is. + return; + } if (EditorFileSystem::get_singleton()->is_importing()) { EditorFileSystem::get_singleton()->connect("resources_reimported", callable_mp(singleton, &SurfaceUpgradeTool::_show_popup), CONNECT_ONE_SHOT); - } else if (EditorNode::get_singleton()->is_inside_tree()) { + } else { singleton->_show_popup(); } - - // EditorNode may not be ready yet. It will call this tool when it is. + RS::get_singleton()->set_warn_on_surface_upgrade(false); } void SurfaceUpgradeTool::_show_popup() { MutexLock lock(mutex); - if (!show_requested || popped_up) { - return; + if (!show_requested) { + return; // We only show the dialog if it was previously requested. } show_requested = false; - popped_up = true; - bool accepted = EditorNode::immediate_confirmation_dialog(TTR("This project uses meshes with an outdated mesh format from previous Godot versions. The engine needs to update the format in order to use those meshes.\n\nPress 'Restart & Upgrade' to run the surface upgrade tool which will update and re-save all meshes and scenes. This update will restart the editor and may take several minutes. Upgrading will make the meshes incompatible with previous versions of Godot.\n\nPress 'Upgrade Only' to continue opening the scene as normal. The engine will update each mesh in memory, but the update will not be saved. Choosing this option will lead to slower load times every time this project is loaded."), TTR("Restart & Upgrade"), TTR("Upgrade Only"), 500); - if (accepted) { - EditorSettings::get_singleton()->set_project_metadata("surface_upgrade_tool", "run_on_restart", true); + // These messages are supposed to be translated as they are critical to users migrating their projects. - Vector<String> reimport_paths; - Vector<String> resave_paths; - _add_files(EditorFileSystem::get_singleton()->get_filesystem(), reimport_paths, resave_paths); + const String confirmation_message = TTR("This project uses meshes with an outdated mesh format from previous Godot versions. The engine needs to update the format in order to use those meshes. Please use the 'Upgrade Mesh Surfaces' tool from the 'Project > Tools' menu. You can ignore this message and keep using outdated meshes, but keep in mind that this leads to increased load times every time you load the project."); + EditorNode::get_log()->add_message(confirmation_message, EditorLog::MSG_TYPE_WARNING); - EditorSettings::get_singleton()->set_project_metadata("surface_upgrade_tool", "reimport_paths", reimport_paths); - EditorSettings::get_singleton()->set_project_metadata("surface_upgrade_tool", "resave_paths", resave_paths); + const String toast_message = TTR("This project uses meshes with an outdated mesh format. Check the output log."); + EditorToaster::get_singleton()->popup_str(toast_message, EditorToaster::SEVERITY_WARNING); +} - // Delay to avoid deadlocks, since this dialog can be triggered by loading a scene. - MessageQueue::get_singleton()->push_callable(callable_mp(EditorNode::get_singleton(), &EditorNode::restart_editor)); - } else { - RS::get_singleton()->set_warn_on_surface_upgrade(true); - } +void SurfaceUpgradeTool::prepare_upgrade() { + EditorSettings::get_singleton()->set_project_metadata("surface_upgrade_tool", "run_on_restart", true); + + Vector<String> reimport_paths; + Vector<String> resave_paths; + _add_files(EditorFileSystem::get_singleton()->get_filesystem(), reimport_paths, resave_paths); + + EditorSettings::get_singleton()->set_project_metadata("surface_upgrade_tool", "reimport_paths", reimport_paths); + EditorSettings::get_singleton()->set_project_metadata("surface_upgrade_tool", "resave_paths", resave_paths); + + // Delay to avoid deadlocks, since this dialog can be triggered by loading a scene. + MessageQueue::get_singleton()->push_callable(callable_mp(EditorNode::get_singleton(), &EditorNode::restart_editor)); } // Ensure that the warnings and popups are skipped. void SurfaceUpgradeTool::begin_upgrade() { + updating = true; + EditorSettings::get_singleton()->set_project_metadata("surface_upgrade_tool", "run_on_restart", false); RS::get_singleton()->set_surface_upgrade_callback(nullptr); RS::get_singleton()->set_warn_on_surface_upgrade(false); - popped_up = true; } void SurfaceUpgradeTool::finish_upgrade() { @@ -112,11 +123,13 @@ void SurfaceUpgradeTool::finish_upgrade() { // Update all meshes here. Vector<String> resave_paths = EditorSettings::get_singleton()->get_project_metadata("surface_upgrade_tool", "resave_paths", Vector<String>()); - EditorProgress ep("surface_upgrade_resave", TTR("Upgrading All Meshes in Project"), resave_paths.size()); + Vector<String> reimport_paths = EditorSettings::get_singleton()->get_project_metadata("surface_upgrade_tool", "reimport_paths", Vector<String>()); + EditorProgress ep("surface_upgrade_resave", TTR("Upgrading All Meshes in Project"), resave_paths.size() + reimport_paths.size()); + int step = 0; for (const String &file_path : resave_paths) { Ref<Resource> res = ResourceLoader::load(file_path); - ep.step(TTR("Attempting to re-save ") + file_path); + ep.step(TTR("Attempting to re-save ") + file_path, step++); if (res.is_valid()) { // Ignore things that fail to load. ResourceSaver::save(res); @@ -125,7 +138,6 @@ void SurfaceUpgradeTool::finish_upgrade() { EditorSettings::get_singleton()->set_project_metadata("surface_upgrade_tool", "resave_paths", Vector<String>()); // Remove the imported scenes/meshes from .import so they will be reimported automatically after this. - Vector<String> reimport_paths = EditorSettings::get_singleton()->get_project_metadata("surface_upgrade_tool", "reimport_paths", Vector<String>()); for (const String &file_path : reimport_paths) { Ref<ConfigFile> config; config.instantiate(); @@ -140,6 +152,8 @@ void SurfaceUpgradeTool::finish_upgrade() { continue; } + ep.step(TTR("Attempting to remove ") + remap_path, step++); + String path = OS::get_singleton()->get_resource_dir() + remap_path.replace_first("res://", "/"); print_verbose("Moving to trash: " + path); err = OS::get_singleton()->move_to_trash(path); @@ -161,4 +175,28 @@ SurfaceUpgradeTool::SurfaceUpgradeTool() { RS::get_singleton()->set_surface_upgrade_callback(_try_show_popup); } -SurfaceUpgradeTool::~SurfaceUpgradeTool() {} +SurfaceUpgradeTool::~SurfaceUpgradeTool() { + singleton = nullptr; +} + +void SurfaceUpgradeDialog::popup_on_demand() { + const String confirmation_message = TTR("The mesh format has changed in Godot 4.2, which affects both imported meshes and meshes authored inside of Godot. The engine needs to update the format in order to use those meshes.\n\nIf your project predates Godot 4.2 and contains meshes, we recommend you run this one time conversion tool. This update will restart the editor and may take several minutes. Upgrading will make the meshes incompatible with previous versions of Godot.\n\nYou can still use your existing meshes as is. The engine will update each mesh in memory, but the update will not be saved. Choosing this option will lead to slower load times every time this project is loaded."); + set_text(confirmation_message); + get_ok_button()->set_text(TTR("Restart & Upgrade")); + + popup_centered(Size2(750 * EDSCALE, 0)); +} + +void SurfaceUpgradeDialog::_notification(int p_what) { + switch (p_what) { + case NOTIFICATION_READY: + // Can't do it in the constructor because it doesn't know that the signal exists. + connect("confirmed", callable_mp(SurfaceUpgradeTool::get_singleton(), &SurfaceUpgradeTool::prepare_upgrade)); + break; + } +} + +SurfaceUpgradeDialog::SurfaceUpgradeDialog() { + set_autowrap(true); + get_label()->set_custom_minimum_size(Size2(750 * EDSCALE, 0)); +} diff --git a/editor/surface_upgrade_tool.h b/editor/surface_upgrade_tool.h index 70e07c58a1..59745250e4 100644 --- a/editor/surface_upgrade_tool.h +++ b/editor/surface_upgrade_tool.h @@ -31,7 +31,7 @@ #ifndef SURFACE_UPGRADE_TOOL_H #define SURFACE_UPGRADE_TOOL_H -#include "scene/main/node.h" +#include "scene/gui/dialogs.h" class EditorFileSystemDirectory; @@ -40,12 +40,14 @@ class SurfaceUpgradeTool : public Object { static SurfaceUpgradeTool *singleton; - bool show_requested = false; - bool popped_up = false; Mutex mutex; + bool show_requested = false; + bool updating = false; + static void _try_show_popup(); void _show_popup(); + void _add_files(EditorFileSystemDirectory *p_dir, Vector<String> &r_reimport_paths, Vector<String> &r_resave_paths); protected: @@ -57,6 +59,7 @@ public: bool is_show_requested() const { return show_requested; }; void show_popup() { _show_popup(); } + void prepare_upgrade(); void begin_upgrade(); void finish_upgrade(); @@ -64,4 +67,16 @@ public: ~SurfaceUpgradeTool(); }; +class SurfaceUpgradeDialog : public ConfirmationDialog { + GDCLASS(SurfaceUpgradeDialog, ConfirmationDialog); + +protected: + void _notification(int p_what); + +public: + void popup_on_demand(); + + SurfaceUpgradeDialog(); +}; + #endif // SURFACE_UPGRADE_TOOL_H diff --git a/editor/translations/editor/ar.po b/editor/translations/editor/ar.po index 9db3e4ca80..dfea8dffdf 100644 --- a/editor/translations/editor/ar.po +++ b/editor/translations/editor/ar.po @@ -93,7 +93,7 @@ msgstr "" "Project-Id-Version: Godot Engine editor interface\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-11-06 00:35+0000\n" +"PO-Revision-Date: 2023-11-16 16:21+0000\n" "Last-Translator: Emad Alhaddad <emad142240@gmail.com>\n" "Language-Team: Arabic <https://hosted.weblate.org/projects/godot-engine/godot/" "ar/>\n" @@ -103,7 +103,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && " "n%100<=10 ? 3 : n%100>=11 ? 4 : 5;\n" -"X-Generator: Weblate 5.2-dev\n" +"X-Generator: Weblate 5.2\n" msgid "Main Thread" msgstr "ثريد رئيسي" @@ -1990,21 +1990,6 @@ msgstr "الرعاة الذهبيين" msgid "Silver Sponsors" msgstr "المانحين الفضيين" -msgid "Bronze Sponsors" -msgstr "المانحين البرنزيين" - -msgid "Mini Sponsors" -msgstr "الرعاة الصغار" - -msgid "Gold Donors" -msgstr "المانحين الذهبيين" - -msgid "Silver Donors" -msgstr "المانحين الفضيين" - -msgid "Bronze Donors" -msgstr "المانحين البرنزيين" - msgid "Donors" msgstr "مانحين" @@ -2864,12 +2849,24 @@ msgstr "أوصاف الدوال" msgid "Operator Descriptions" msgstr "أوصاف العمليات" +msgid "Metadata:" +msgstr "أضف البيانات الوصفية:" + msgid "Property:" msgstr "خاصية:" +msgid "Method:" +msgstr "دالة:" + msgid "Signal:" msgstr "إشارة:" +msgid "Theme Item:" +msgstr "إضافة عنصر مظهر واجهة المستخدم:" + +msgid "No description available." +msgstr "لا يوجد وصف متاح." + msgid "%d match." msgstr "تطابق %d." @@ -3461,17 +3458,6 @@ msgstr "" "تعطيل الإضافة في '%s' لتجنب الأخطاء لاحقاً." msgid "" -"Unable to load addon script from path: '%s' Base type is not EditorPlugin." -msgstr "" -"غير قادر علي تحميل النص البرمجي الإضافي من المسار: '%s' النوع الأساسي ليس " -"إضافة المُعدل." - -msgid "Unable to load addon script from path: '%s' Script is not in tool mode." -msgstr "" -"غير قادر علي تحميل النص البرمجي الإضافي من المسار: '%s' النص البرمجي ليس في " -"وضع الأداة." - -msgid "" "Scene '%s' was automatically imported, so it can't be modified.\n" "To make changes to it, a new inherited scene can be created." msgstr "" @@ -3993,6 +3979,12 @@ msgstr "" msgid "Assign..." msgstr "إلحاق..." +msgid "Copy as Text" +msgstr "نسخ كنص" + +msgid "Show Node in Tree" +msgstr "إظهار العقدة في الشجرة" + msgid "Invalid RID" msgstr "RID غير صالح" @@ -4080,6 +4072,9 @@ msgstr "اجعلْه فريدًا" msgid "Make Unique (Recursive)" msgstr "اجعلْه فريدا (متكرر)" +msgid "Save As..." +msgstr "حفظ بنوع..." + msgid "Show in FileSystem" msgstr "أظهر في نظام الملفات" @@ -4548,6 +4543,9 @@ msgstr "حذف المُعد مُسبقاً '%s'؟" msgid "Resources to exclude:" msgstr "الموارد المستثناة:" +msgid "Resources to override export behavior:" +msgstr "الموارد اللازمة لتجاوز سلوك التصدير:" + msgid "Resources to export:" msgstr "الموارد المُعدّة للتصدير:" @@ -4840,6 +4838,9 @@ msgstr "تكرار مجلد:" msgid "New Inherited Scene" msgstr "مشهد مُوّرَث جديد" +msgid "Set as Main Scene" +msgstr "تعيين كمشهد رئيسي" + msgid "Open Scenes" msgstr "فتح المَشاهِد" @@ -4951,6 +4952,33 @@ msgstr "إعادة تسمية..." msgid "Open in External Program" msgstr "افتح في برنامج خارجي" +msgid "Red" +msgstr "أحمر" + +msgid "Orange" +msgstr "برتقالي" + +msgid "Yellow" +msgstr "أصفر" + +msgid "Green" +msgstr "أخضر" + +msgid "Teal" +msgstr "تركواز" + +msgid "Blue" +msgstr "أزرق" + +msgid "Purple" +msgstr "أرجواني" + +msgid "Pink" +msgstr "وردي" + +msgid "Gray" +msgstr "رمادي" + msgid "Go to previous selected folder/file." msgstr "ارجع إلى المجلد/الملف السابق." @@ -4960,6 +4988,9 @@ msgstr "اذهب إلى المجلد/الملف التالي." msgid "Re-Scan Filesystem" msgstr "إعادة فحص نظام الملفات" +msgid "Change Split Mode" +msgstr "تغيير وضع الانقسام" + msgid "Filter Files" msgstr "تصفية الملفات" @@ -5573,15 +5604,6 @@ msgstr "يتم تحميل خط TrueType/OpenType ديناميكيًا" msgid "Prerendered multichannel(+true) signed distance field" msgstr "مجال مسافة موقعة متعدد القنوات (+صحيح) تم تحميلها مسبقًا" -msgid "Can't load font texture:" -msgstr "لا يمكن تحميل جلد الخط:" - -msgid "Image margin too big." -msgstr "حافة الصورة كبيرة جدا." - -msgid "Character margin too big." -msgstr "هامش الأحرف كبير جدًا." - msgid "Pre-Import Scene" msgstr "قبل-استيراد المشهد" @@ -5939,9 +5961,6 @@ msgstr "تحميل مورد موجود مسبقا من الذاكرة وتعدي msgid "Save the currently edited resource." msgstr "حفظ المورد الذي يتم تعديله حاليا." -msgid "Save As..." -msgstr "حفظ بنوع..." - msgid "Extra resource options." msgstr "أختيارات اضافية للمورد." @@ -6551,6 +6570,9 @@ msgstr "(إنشاء) [عمومي]" msgid "Duplicated Animation Name:" msgstr "أسماء التحريك المتكرر:" +msgid "Onion skinning requires a RESET animation." +msgstr "يتطلب سلخ البصل لإعادة الضبط الرسوم المتحركة." + msgid "Play selected animation backwards from current pos. (A)" msgstr "تشغيل الرسم المتحرك المختار بشكل عكسي من الموقع الحالي. (زر A)" @@ -7673,6 +7695,18 @@ msgstr "" "عند تفعيل هذا الخيار، فإن أجسام التجنب، وأنصاف قُطرها، وسرعاتها، ستكون ظاهرة " "في المشروع المشغل." +msgid "Debug CanvasItem Redraws" +msgstr "تصحيح أخطاء إعادة رسم عنصر اللوحة القماشية" + +msgid "" +"When this option is enabled, redraw requests of 2D objects will become " +"visible (as a short flash) in the running project.\n" +"This is useful to troubleshoot low processor mode." +msgstr "" +"عند تمكين هذا الخيار، ستصبح طلبات إعادة رسم الكائنات ثنائية الأبعاد مرئية " +"(كومضة قصيرة) في المشروع قيد التشغيل.\n" +"يعد هذا مفيدًا لاستكشاف أخطاء وضع المعالج المنخفض وإصلاحها." + msgid "Synchronize Scene Changes" msgstr "مزامنة تغييرات المشهد" @@ -8040,6 +8074,9 @@ msgstr "أنشئ سطح Mesh التنقل" msgid "Create Debug Tangents" msgstr "إنشاء ملامِسات التنقيح" +msgid "No mesh to unwrap." +msgstr "لا يوجد مجسم لفكه." + msgid "" "Mesh cannot unwrap UVs because it does not belong to the edited scene. Make " "it unique first." @@ -8065,6 +8102,15 @@ msgstr "نشر نقشة الطبقة الثانية (الطول والعرض)" msgid "Contained Mesh is not of type ArrayMesh." msgstr "السطح المتضمن ليس نوعاً من مصفوفة السطوح ArrayMesh." +msgid "Can't unwrap mesh with blend shapes." +msgstr "لا يمكن فك مجسمات ذات الأشكال الممزوجة." + +msgid "Only triangles are supported for lightmap unwrap." +msgstr "يتم دعم المثلثات فقط لإلغاء تغليف الخريطة الضوئية." + +msgid "Normals are required for lightmap unwrap." +msgstr "المعايير مطلوبة لإلغاء تغليف الخريطة الضوئية." + msgid "UV Unwrap failed, mesh may not be manifold?" msgstr "نشر Unwrap فشل، الميش ربما لا يكون متعدد؟" @@ -8938,12 +8984,18 @@ msgstr "اللون الأرض" msgid "Sky Energy" msgstr "قوة السماء" +msgid "AO" +msgstr "الانسداد المحيط" + msgid "Glow" msgstr "توهُّج" msgid "Tonemap" msgstr "خريطة تناغم الألوان" +msgid "GI" +msgstr "الإضاءة العالمية" + msgid "Post Process" msgstr "مرحلة ما بعد المعالجة" @@ -9779,6 +9831,12 @@ msgstr "إنشاء LightOccluder2D" msgid "LightOccluder2D Preview" msgstr "معاينة LightOccluder2D" +msgid "Can't convert a sprite from a foreign scene." +msgstr "لا يمكن تحويل الرسوم من مشهد أجنبي." + +msgid "Can't convert an empty sprite to mesh." +msgstr "لا يمكن تحويل كائن فارغ إلى مجسم." + msgid "Can't convert a sprite using animation frames to mesh." msgstr "" "لا يمكن تحويل الرسومية (sprite) إلى سطح (mesh) باستخدام إطارات الرسوم " @@ -13456,9 +13514,19 @@ msgid "" msgstr "" "تعطيل \"المثيل_المُحرر\" سيجعل كل خصائص العقدة ترجع إلى الحالة الافتراضية." +msgid "" +"Enabling \"Load as Placeholder\" will disable \"Editable Children\" and cause " +"all properties of the node to be reverted to their default." +msgstr "" +"سيؤدي تمكين \"التحميل كعنصر نائب\" إلى تعطيل \"العناصر الفرعية القابلة " +"للتحرير\" ويتسبب في إعادة كافة خصائص العقدة إلى وضعها الافتراضي." + msgid "Make Local" msgstr "اجعله محلياً" +msgid "Can't toggle unique name for nodes in subscene!" +msgstr "لا يمكن تبديل الاسم الفريد للعقد في المشهد الفرعي!" + msgid "Enable Scene Unique Name(s)" msgstr "تفعيل اسم المشهد الفريد" @@ -13510,16 +13578,6 @@ msgstr "إزالة عُقدة (عُقد)" msgid "Change type of node(s)" msgstr "تغيير نوع العُقدة(العُقد)" -msgid "Removing the node from variable \"%s\" on node \"%s\"." -msgstr "إزالة العقدة من المتغير \"%s\" الموجود على العقدة \"%s\"." - -msgid "" -"The node's new type is incompatible with an exported variable (expected %s, " -"but type is %s)." -msgstr "" -"النوع الجديد للعقدة غير متوافق مع متغير تم تصديره (%s متوقع، ولكن النوع هو " -"%s)." - msgid "This operation requires a single selected node." msgstr "هذه العملية تتطلب عقدة واحدة محددة." @@ -13552,6 +13610,9 @@ msgstr "مسح الميراث" msgid "Editable Children" msgstr "فروع قابلة للتعديل" +msgid "Load as Placeholder" +msgstr "تحميله كعنصر نائب" + msgid "Auto Expand to Selected" msgstr "التوسيع التلقائي للمختارة" @@ -13848,6 +13909,15 @@ msgstr "الاسم '%s' هو كلمة أساسية محجوزة في لغة ال msgid "Add Shader Global Parameter" msgstr "إضافة معلمة تظليل العالمية" +msgid "Upgrading All Meshes in Project" +msgstr "ترقية كافة المجسمات في المشروع" + +msgid "Attempting to re-save " +msgstr "محاولة إعادة الحفظ. " + +msgid "Restart & Upgrade" +msgstr "إعادة التشغيل والترقية" + msgid "Make this panel floating in the screen %d." msgstr "اجعل هذه اللوحة عائمة على الشاشة %d." @@ -13876,6 +13946,9 @@ msgstr "تعديل نصف القطر الخارجي للمسنن" msgid "Invalid type argument to convert(), use TYPE_* constants." msgstr "معامل خاطئ لدالة ()Convert، استخدم احدى الثوابت من مجموعة TYPE_*." +msgid "Cannot resize array." +msgstr "لا يمكن تغيير المصفوفة." + msgid "Step argument is zero!" msgstr "معامل الخطوة تساوي صفر!" @@ -13900,6 +13973,9 @@ msgstr "نموذج الشكل القاموسي غير صالح ( النص الب msgid "Invalid instance dictionary (invalid subclasses)" msgstr "نموذج القاموس غير صالح (أصناف فرعية غير صالحة)" +msgid "Cannot instantiate GDScript class." +msgstr "لا يمكن إنشاء قالب لفئة GDScript." + msgid "Value of type '%s' can't provide a length." msgstr "لا يمكن لقيمة النوع '%s' توفير طول." @@ -14106,6 +14182,9 @@ msgstr "تحديد الإضاءة المباشرة" msgid "Integrate indirect lighting" msgstr "دمج الإضاءة غير المباشرة" +msgid "Integrate indirect lighting %d%%" +msgstr "دمج الإضاءة غير المباشرة %d%%" + msgid "Baking lightprobes" msgstr "خبز مجسات الضوء" @@ -14510,6 +14589,9 @@ msgstr "لا يمكن التنفيذ على الجهاز." msgid "Exporting to Android when using C#/.NET is experimental." msgstr "يعد التصدير إلى الاندرويد عند استخدام C#/.NET أمرًا تجريبيًا." +msgid "Android architecture %s not supported in C# projects." +msgstr "بنية الاندرويد %s غير مدعومة في مشاريع C#." + msgid "" "Android build template not installed in the project. Install it from the " "Project menu." @@ -14669,21 +14751,9 @@ msgstr "لا يمكن كتابة ملف الحزمة الإضافية!" msgid "Building Android Project (gradle)" msgstr "بناء مشروع الأندرويد (gradle)" -msgid "" -"Building of Android project failed, check output for the error. Alternatively " -"visit docs.godotengine.org for Android build documentation." -msgstr "" -"أخفق بناء مشروع الأندرويد، تفقد المُخرجات للإطلاع على الخطأ. بصورة بديلة يمكنك " -"زيارة docs.godotengine.org لأجل مستندات البناء للأندرويد." - msgid "Moving output" msgstr "جاري تحريك المخرجات" -msgid "" -"Unable to copy and rename export file, check gradle project directory for " -"outputs." -msgstr "تعذر نسخ وإعادة تسمية الملف المصدر، تفقد ملف مشروع gradle للمخرجات." - msgid "Package not found: \"%s\"." msgstr "لم نجد الحزمة: \"%s\"." @@ -14754,6 +14824,14 @@ msgstr "" "لا يمكن إنشاء .ipa إلا على نظام التشغيل macOS. ترك مشروع اكس كود دون إنشاء " "الحزمة." +msgid "Exporting to iOS when using C#/.NET is experimental and requires macOS." +msgstr "" +"يعد التصدير إلى iOS عند استخدام C#/.NET أمرًا تجريبيًا ويتطلب نظام التشغيل " +"macOS." + +msgid "Exporting to iOS when using C#/.NET is experimental." +msgstr "يعد التصدير إلى iOS عند استخدام C#/.NET أمرًا تجريبيًا." + msgid "Identifier is missing." msgstr "المُحدد مفقود." @@ -14833,6 +14911,9 @@ msgstr "جارٍ رفع البرامج النصية..." msgid "Starting project..." msgstr "بدء المشروع..." +msgid "All Files" +msgstr "كل الملفات" + msgid "Can't get filesystem access." msgstr "لم يتكمن من الحصول على حَقّ الدّخُول لملف النظام." @@ -14911,6 +14992,13 @@ msgstr "مطلوب هوية توقيع المثبت لتوزيع متجر الت msgid "App sandbox is required for App Store distribution." msgstr "مطلوب وضع حماية التطبيق لتوزيع متجر التطبيقات." +msgid "" +"'rcodesign' doesn't support signing applications with embedded dynamic " +"libraries (GDExtension or .NET)." +msgstr "" +"لا يدعم 'rcodesign' توقيع التطبيقات ذات المكتبات الديناميكية المضمنة " +"(GDExtension أو .NET)." + msgid "Code signing is required for App Store distribution." msgstr "توقيع الرمز مطلوب لتوزيع متجر التطبيقات." @@ -14996,6 +15084,12 @@ msgstr "لم يتم تثبيت أدوات سطر أوامر إكس كود." msgid "Could not start xcrun executable." msgstr "تعذر بدء تشغيل xcrun." +msgid "Built-in CodeSign failed with error \"%s\"." +msgstr "فشلت علامة الكود المضمن بسبب الخطأ \"%s\"." + +msgid "Built-in CodeSign require regex module." +msgstr "يتطلب علامة الكود المدمج وحدة regex." + msgid "" "Xrcodesign path is not set. Configure rcodesign path in the Editor Settings " "(Export > macOS > rcodesign)." @@ -15003,15 +15097,44 @@ msgstr "" "لم يتم تعيين مسار Xrcodesign. قم بتكوين مسار rcodesign في إعدادات المحرر " "(Export > macOS > rcodesign)." +msgid "" +"Could not start codesign executable, make sure Xcode command line tools are " +"installed." +msgstr "" +"تعذر بدء تشغيل برنامج علامة الكود القابل للتنفيذ، تأكد من تثبيت أدوات سطر " +"أوامر كود إكس." + msgid "Cannot sign file %s." msgstr "خطأ في تسجيل الملف %s." +msgid "Relative symlinks are not supported, exported \"%s\" might be broken!" +msgstr "" +"الارتباطات الرمزية النسبية غير مدعومة، ربما يكون \"%s\" الذي تم تصديره معطلاً!" + +msgid "PKG Creation" +msgstr "إنشاء PKG" + +msgid "Could not start productbuild executable." +msgstr "تعذر بدء إنشاء المنتج القابل للتنفيذ." + +msgid "`productbuild` failed." +msgstr "فشل \"بناء المنتج\"." + msgid "DMG Creation" msgstr "إنشاء ال DMG" msgid "Could not start hdiutil executable." msgstr "تعذر بدء الملف التنفيذي hdiutil." +msgid "`hdiutil create` failed - file exists." +msgstr "فشل '' إنشاء hdiutil '' - الملف موجود." + +msgid "`hdiutil create` failed." +msgstr "فشل إنشاء hdiutil." + +msgid "Exporting for macOS" +msgstr "تصدير الكُلالتصدير لنظام التشغيل MacOS" + msgid "Creating app bundle" msgstr "إنشاء حزمة البرنامج" @@ -15021,9 +15144,56 @@ msgstr "لا يُوجد \"تطبيق القالب\" لتصديره: \"%s\"." msgid "Invalid export format." msgstr "صيغة التصدير لا تصلح" +msgid "Could not create directory: \"%s\"." +msgstr "تعذر إنشاء مجلد: \"%s\"." + +msgid "Could not create directory \"%s\"." +msgstr "تعذر إنشاء الدليل \"%s\"." + +msgid "" +"Relative symlinks are not supported on this OS, the exported project might be " +"broken!" +msgstr "" +"الارتباطات الرمزية النسبية غير مدعومة على نظام التشغيل هذا، وقد يكون المشروع " +"الذي تم تصديره معطلاً!" + +msgid "Could not created symlink \"%s\" -> \"%s\"." +msgstr "تعذر إنشاء الارتباط الرمزي \"%s\" -> \"%s\"." + +msgid "Could not open \"%s\"." +msgstr "تعذر فتح \"%s\"." + +msgid "" +"Requested template binary \"%s\" not found. It might be missing from your " +"template archive." +msgstr "" +"لم يتم العثور على القالب الثنائي المطلوب \"%s\". ربما يكون مفقودًا من أرشيف " +"القالب الخاص بك." + msgid "Making PKG" msgstr "إنشاء PKG" +msgid "Entitlements Modified" +msgstr "تم تعديل الاستحقاقات" + +msgid "" +"Ad-hoc signed applications require the 'Disable Library Validation' " +"entitlement to load dynamic libraries." +msgstr "" +"تتطلب التطبيقات الموقعة المخصصة استحقاق \"تعطيل التحقق من صحة المكتبة\" " +"لتحميل المكتبات الديناميكية." + +msgid "" +"'rcodesign' doesn't support signing applications with embedded dynamic " +"libraries." +msgstr "لا يدعم \"rcodesign\" توقيع التطبيقات ذات المكتبات الديناميكية المضمنة." + +msgid "Could not create entitlements file." +msgstr "لا يمكن إنشاء ملف الاستحقاقات." + +msgid "Could not create helper entitlements file." +msgstr "لا يمكن إنشاء ملف استحقاقات المساعد." + msgid "Code signing bundle" msgstr "حزمة توقيع الكود" @@ -15033,6 +15203,9 @@ msgstr "إنشاء DMG" msgid "Code signing DMG" msgstr "توقيع ال DMG" +msgid "Making PKG installer" +msgstr "صنع مثبت PKG" + msgid "Making ZIP" msgstr "إنشاء ZIP" @@ -15045,6 +15218,9 @@ msgstr "" msgid "Sending archive for notarization" msgstr "إرسال الأرشيف من اجل التوثيق" +msgid "Notarization: Xcode command line tools are not installed." +msgstr "التوثيق: لم يتم تثبيت أدوات سطر أوامر كود إكس." + msgid "" "Notarization: rcodesign path is not set. Configure rcodesign path in the " "Editor Settings (Export > macOS > rcodesign)." @@ -15067,12 +15243,28 @@ msgstr "" "تم تمكين Gatekeeper وأجهزة Mac التي تعمل بتقنية Apple Silicon عليها." msgid "" +"Code signing: Using ad-hoc signature. The exported project will be blocked by " +"Gatekeeper" +msgstr "" +"توقيع الكود: استخدام التوقيع المخصص. سيتم حظر المشروع المصدر بواسطة حارس " +"البوابة" + +msgid "Code signing: Xcode command line tools are not installed." +msgstr "توقيع التعليمات البرمجية: لم يتم تثبيت أدوات سطر أوامر كود إكس." + +msgid "" "Code signing: rcodesign path is not set. Configure rcodesign path in the " "Editor Settings (Export > macOS > rcodesign)." msgstr "" "توقيع الكود: لم يتم تعيين مسار rcodesign. قم بتكوين مسار rcodesign في إعدادات " "المحرر (Export > macOS > rcodesign)." +msgid "Run on remote macOS system" +msgstr "التشغيل على نظام macOS عن بعد" + +msgid "Run exported project on remote macOS system" +msgstr "قم بتشغيل المشروع الذي تم تصديره على نظام macOS عن بعد" + msgid "Could not open template for export: \"%s\"." msgstr "لا يمكن فتح القالب للتصدير: \"%s\"." @@ -15126,9 +15318,30 @@ msgstr "شغل ملف HTML المُصدر في المتصفح الإفتراضي msgid "Resources Modification" msgstr "تعديل المصادر" +msgid "Icon size \"%d\" is missing." +msgstr "حجم ايقونة \"%d\" مفقود." + msgid "Failed to rename temporary file \"%s\"." msgstr "فشل تسمية الملف المؤقت \"%s\"." +msgid "Invalid icon path." +msgstr "مسار الأيقونة غير صالح." + +msgid "Invalid file version." +msgstr "نسخة غير صالحة للملف." + +msgid "Invalid product version." +msgstr "إصدار المنتج غير صالح." + +msgid "Could not find rcedit executable at \"%s\"." +msgstr "تعذر العثور على rcedit القابل للتنفيذ على \"%s\"." + +msgid "Could not find wine executable at \"%s\"." +msgstr "تعذر العثور على طبقة المعالجة القابل للتنفيذ في \"%s\"." + +msgid "Invalid icon file \"%s\"." +msgstr "ملف أيقونه \"%s\" غير صالح." + msgid "" "Could not start rcedit executable. Configure rcedit path in the Editor " "Settings (Export > Windows > rcedit), or disable \"Application > Modify " @@ -15138,12 +15351,24 @@ msgstr "" "(تصدير > ويندوز> rcedit)، أو قم بتعطيل \"التطبيق > تعديل الموارد\" في الإعداد " "المسبق للتصدير." +msgid "rcedit failed to modify executable: %s." +msgstr "فشل rcedit في تعديل الملف القابل للتنفيذ: %s." + +msgid "Could not find signtool executable at \"%s\"." +msgstr "تعذر العثور على أداة التوقيع القابلة للتنفيذ على \"%s\"." + +msgid "Could not find osslsigncode executable at \"%s\"." +msgstr "تعذر العثور على رمز تسجيل ossl القابل للتنفيذ على \"%s\"." + msgid "No identity found." msgstr "لم توجد هوية." msgid "Invalid identity type." msgstr "نوع الهوية أو المعرِّف غير صالح." +msgid "Invalid timestamp server." +msgstr "خادم الطابع الزمني غير صالح." + msgid "" "Could not start signtool executable. Configure signtool path in the Editor " "Settings (Export > Windows > signtool), or disable \"Codesign\" in the export " @@ -15162,6 +15387,9 @@ msgstr "" "إعدادات المحرر (تصدير > ويندوز> osslsigncode)، أو قم بتعطيل \"Codesign\" في " "الإعداد المسبق للتصدير." +msgid "Signtool failed to sign executable: %s." +msgstr "فشلت أداة التوقيع في التوقيع على الملف القابل للتنفيذ: %s." + msgid "Failed to remove temporary file \"%s\"." msgstr "فشل حذف الملف المؤقت \"%s\"." @@ -15172,6 +15400,15 @@ msgstr "" "يجب تكوين أداة rcedit في إعدادات المحرر (تصدير > ويندوز > rcedit) لتغيير " "الرمز أو بيانات معلومات التطبيق." +msgid "Windows executables cannot be >= 4 GiB." +msgstr "لا يمكن أن تكون ملفات ويندوز القابلة للتنفيذ >= 4 جيجا بايت." + +msgid "Run on remote Windows system" +msgstr "تشغيل على نظام ويندوز عن بعد" + +msgid "Run exported project on remote Windows system" +msgstr "تشغيل المشروع المُصدَّر على نظام ويندوز عن بعد" + msgid "" "A SpriteFrames resource must be created or set in the \"Frames\" property in " "order for AnimatedSprite2D to display frames." @@ -15279,6 +15516,20 @@ msgstr "" "تتطلب الرسوم المتحركة للجسيمات-ثنائية-البُعد (Particles2D) استخدام لوحة-مادة-" "العنصر (CanvasItemMaterial) مع تمكين \"الرسوم المتحركة للجسيمات\"." +msgid "" +"Particle trails are only available when using the Forward+ or Mobile " +"rendering backends." +msgstr "" +"تتوفر مسارات الجسيمات فقط عند استخدام الواجهات الخلفية للعرض تقدم+ أو الهاتف " +"المحمول." + +msgid "" +"Particle sub-emitters are not available when using the GL Compatibility " +"rendering backend." +msgstr "" +"لا تتوفر بواعث الجسيمات الفرعية عند استخدام الواجهة الخلفية للعرض المتوافق مع " +"GL." + msgid "Node A and Node B must be PhysicsBody2Ds" msgstr "" "يجب على العقدة A والعقدة B أن يكونا PhysicsBody2Ds (جسم فيزيائي ثنائي البُعد)" @@ -15311,6 +15562,19 @@ msgid "The occluder polygon for this occluder is empty. Please draw a polygon." msgstr "المُضلع المُغلق لهذا الغَلق فارغ. الرجاء رسم مُضلع." msgid "" +"The NavigationAgent2D can be used only under a Node2D inheriting parent node." +msgstr "" +"يمكن استخدام وكيل التنقل ثنائي الأبعاد فقط ضمن العقدة الأصلية الوارثة لـ عقدة " +"ثنائية الأبعاد." + +msgid "" +"NavigationLink2D start position should be different than the end position to " +"be useful." +msgstr "" +"يجب أن يكون موضع بداية رابط التنقل ثنائي الأبعاد مختلفًا عن موضع النهاية ليكون " +"مفيدًا." + +msgid "" "A NavigationMesh resource must be set or created for this node to work. " "Please set a property or draw a polygon." msgstr "" @@ -15329,6 +15593,13 @@ msgstr "" "البُعد (Path2D) تابعًا له." msgid "" +"A PhysicalBone2D only works with a Skeleton2D or another PhysicalBone2D as a " +"parent node!" +msgstr "" +"يعمل عظم-ثنائي-البُعد فيزيائي فقط مع هيكلية-ثنائية-البُعد أو عظم-ثنائي-البُعد " +"فيزيائي آخر كعقدة رئيسية!" + +msgid "" "A PhysicalBone2D needs to be assigned to a Bone2D node in order to function! " "Please set a Bone2D node in the inspector." msgstr "" @@ -15354,6 +15625,12 @@ msgstr "" msgid "Path property must point to a valid Node2D node to work." msgstr "يجب أن تشير خاصية المسار إلى عُقدة-ثنائية-البُعد (Node2D) صالحة لكي تعمل." +msgid "" +"This node cannot interact with other objects unless a Shape2D is assigned." +msgstr "" +"لا يمكن لهذه العقدة أن تتفاعل مع كائنات أخرى ما لم يتم تعيين شكل ثنائي " +"الأبعاد." + msgid "This Bone2D chain should end at a Skeleton2D node." msgstr "" "سلسلة العظم ثنائي البُعد Bone2D هذه، ينبغي أن تنتهي في عُقدة هيكل ثنائي البُعد " @@ -15844,15 +16121,6 @@ msgstr "" "العقد مرة أخرى. ومن ثم يمكن إعادة حفظها بأمان دون التعرض لخطر فقدان البيانات." msgid "" -"Setting node name '%s' to be unique within scene for '%s', but it's already " -"claimed by '%s'.\n" -"'%s' is no longer set as having a unique name." -msgstr "" -"تعيين اسم العقدة '%s' ليكون فريدًا داخل المشهد لـ '%s'، ولكن تمت المطالبة به " -"بالفعل بواسطة '%s'.\n" -"لم يعد يتم تعيين '%s' كاسم فريد." - -msgid "" "This node is marked as deprecated and will be removed in future versions.\n" "Please check the Godot documentation for information about migration." msgstr "" diff --git a/editor/translations/editor/bg.po b/editor/translations/editor/bg.po index d2742c7cb1..8b1972675d 100644 --- a/editor/translations/editor/bg.po +++ b/editor/translations/editor/bg.po @@ -1679,17 +1679,6 @@ msgstr "" "Добавката „%s“ ще бъде изключена, за да се предотвратят последващи проблеми." msgid "" -"Unable to load addon script from path: '%s' Base type is not EditorPlugin." -msgstr "" -"Не може да се зареди добавката-скрипт от: „%s“. Базовият тип не е " -"„EditorPlugin“." - -msgid "Unable to load addon script from path: '%s' Script is not in tool mode." -msgstr "" -"Не може да се зареди добавката-скрипт от: „%s“. Скриптът не е в режим на " -"„инструмент“." - -msgid "" "Scene '%s' was automatically imported, so it can't be modified.\n" "To make changes to it, a new inherited scene can be created." msgstr "" @@ -1922,6 +1911,9 @@ msgstr "Размер:" msgid "New Value:" msgstr "Нова стойност:" +msgid "Save As..." +msgstr "Запазване като..." + msgid "Show in FileSystem" msgstr "Показване във файловата система" @@ -2544,9 +2536,6 @@ msgstr "Поставяне на свойствата" msgid "Save the currently edited resource." msgstr "Запазване на текущо редактирания ресурс." -msgid "Save As..." -msgstr "Запазване като..." - msgid "Extra resource options." msgstr "Допълнителни настройки на ресурса." @@ -5386,24 +5375,9 @@ msgstr "Файлът с пакета за разширение не може д msgid "Building Android Project (gradle)" msgstr "Компилиране на проект за Android (gradle)" -msgid "" -"Building of Android project failed, check output for the error. Alternatively " -"visit docs.godotengine.org for Android build documentation." -msgstr "" -"Компилирането на проекта за Android беше неуспешно. Вижте изхода за грешката. " -"Може също да разгледате документацията за компилиране за Android на docs." -"godotengine.org." - msgid "Moving output" msgstr "Преместване на изходящите данни" -msgid "" -"Unable to copy and rename export file, check gradle project directory for " -"outputs." -msgstr "" -"Изнесеният файл не може да бъде копиран и преименуван. Потърсете резултатите " -"в папката на проекта на gradle." - msgid "Package not found: \"%s\"." msgstr "Пакетът не е намерен: „%s“." @@ -5612,9 +5586,6 @@ msgstr "Моля, потвърдете..." msgid "(Other)" msgstr "(Други)" -msgid "Unsupported BMFont texture format." -msgstr "Неподдържан формат за текстури BMFont." - msgid "" "Shader keywords cannot be used as parameter names.\n" "Choose another name." diff --git a/editor/translations/editor/ca.po b/editor/translations/editor/ca.po index 81e2273993..7f665d811d 100644 --- a/editor/translations/editor/ca.po +++ b/editor/translations/editor/ca.po @@ -1521,21 +1521,6 @@ msgstr "Patrocinadors Gold" msgid "Silver Sponsors" msgstr "Donants Plata" -msgid "Bronze Sponsors" -msgstr "Donants Bronze" - -msgid "Mini Sponsors" -msgstr "Mini Patrocinadors" - -msgid "Gold Donors" -msgstr "Donants Gold" - -msgid "Silver Donors" -msgstr "Donants Silver" - -msgid "Bronze Donors" -msgstr "Donants Bronze" - msgid "Donors" msgstr "Donants" @@ -2323,17 +2308,6 @@ msgstr "" "Es desactivarà el complement (addon) a '% s' per a evitar més errors." msgid "" -"Unable to load addon script from path: '%s' Base type is not EditorPlugin." -msgstr "" -"No es pot carregar l'Script del complement: El tipus base de '%s' no és pas " -"EditorPlugin." - -msgid "Unable to load addon script from path: '%s' Script is not in tool mode." -msgstr "" -"No s'ha carregat l'Script d'addon des del camí: L'Script '%s' no és en el " -"mode d'Eina." - -msgid "" "Scene '%s' was automatically imported, so it can't be modified.\n" "To make changes to it, a new inherited scene can be created." msgstr "" @@ -2737,6 +2711,9 @@ msgstr "Carrega Rapida" msgid "Make Unique" msgstr "Fes-lo Únic" +msgid "Save As..." +msgstr "Anomena i Desa..." + msgid "Show in FileSystem" msgstr "Mostrar en el Sistema de Fitxers" @@ -3441,9 +3418,6 @@ msgstr "Carrega un recurs des del disc i edita'l." msgid "Save the currently edited resource." msgstr "Desa el recurs editat ara." -msgid "Save As..." -msgstr "Anomena i Desa..." - msgid "Copy Resource" msgstr "Copia el Recurs" diff --git a/editor/translations/editor/cs.po b/editor/translations/editor/cs.po index 0b5428a50f..4e239229e5 100644 --- a/editor/translations/editor/cs.po +++ b/editor/translations/editor/cs.po @@ -46,8 +46,8 @@ msgstr "" "Project-Id-Version: Godot Engine editor interface\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-09-25 08:36+0000\n" -"Last-Translator: Marek Douběta <mrocklon420@gmail.com>\n" +"PO-Revision-Date: 2023-12-07 07:04+0000\n" +"Last-Translator: Vojtěch Šamla <auzkok@seznam.cz>\n" "Language-Team: Czech <https://hosted.weblate.org/projects/godot-engine/godot/" "cs/>\n" "Language: cs\n" @@ -55,7 +55,10 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" -"X-Generator: Weblate 5.1-dev\n" +"X-Generator: Weblate 5.3-dev\n" + +msgid "Main Thread" +msgstr "Hlavní vlákno" msgid "Unset" msgstr "Nenastaveno" @@ -563,6 +566,9 @@ msgstr "Změnit cestu stopy" msgid "Toggle this track on/off." msgstr "Aktivovat/Deaktivovat tuto stopu." +msgid "Use Blend" +msgstr "Použít prolnutí" + msgid "Update Mode (How this property is set)" msgstr "Režim aktualizace (jak je tato vlastnost nastavena)" @@ -756,6 +762,9 @@ msgid "Select an AnimationPlayer node to create and edit animations." msgstr "" "Pro přidání a úpravu animací vyberte ze stromu scény uzel AnimationPlayer." +msgid "Imported Scene" +msgstr "Importovaná scéna" + msgid "Warning: Editing imported animation" msgstr "Upozornění: Upravuje se importovaná animace" @@ -813,6 +822,15 @@ msgstr "Přejít k předchozímu kroku" msgid "Apply Reset" msgstr "Resetovat" +msgid "Bake Animation" +msgstr "Zapéct animaci" + +msgid "Optimize Animation (no undo)" +msgstr "Optimalizovat animaci (nelze vrátit zpět)" + +msgid "Clean-Up Animation (no undo)" +msgstr "Pročistit animaci (nelze vrátit zpět)" + msgid "Use Bezier Curves" msgstr "Použít Bézierovy křivky" @@ -835,7 +853,7 @@ msgid "Clean-up all animations" msgstr "Pročistit všechny animace" msgid "Clean-Up Animation(s) (NO UNDO!)" -msgstr "Pročistit animaci (NELZE VZÍT ZPĚT!)" +msgstr "Pročistit animace (NELZE VRÁTIT ZPĚT!)" msgid "Clean-Up" msgstr "Pročistit" @@ -893,6 +911,9 @@ msgstr "Číslo řádku:" msgid "%d replaced." msgstr "%d nahrazeno." +msgid "No match" +msgstr "Žádná shoda" + msgid "%d match" msgid_plural "%d matches" msgstr[0] "%d shoda" @@ -901,9 +922,9 @@ msgstr[2] "%d shod" msgid "%d of %d match" msgid_plural "%d of %d matches" -msgstr[0] "%d shoda" -msgstr[1] "%d shody" -msgstr[2] "%d shod" +msgstr[0] "%d z %d shody" +msgstr[1] "%d ze %d shod" +msgstr[2] "%d z %d shod" msgid "Match Case" msgstr "Rozlišovat malá/velká" @@ -1180,6 +1201,12 @@ msgstr "Čas" msgid "Calls" msgstr "Volání" +msgid "CPU" +msgstr "CPU" + +msgid "GPU" +msgstr "GPU" + msgid "Bytes:" msgstr "Bajtů:" @@ -1189,12 +1216,30 @@ msgstr "Varování:" msgid "Error:" msgstr "Chyba:" +msgid "%s Error" +msgstr "Chyba %s" + msgid "%s Error:" msgstr "Chyba %s:" +msgid "%s Source" +msgstr "Zdroj %s" + +msgid "%s Source:" +msgstr "Zdroj %s:" + msgid "Stack Trace" msgstr "Trasování zásobníku" +msgid "Stack Trace:" +msgstr "Trasování zásobníku:" + +msgid "Debug session started." +msgstr "Ladící sezení zahájeno." + +msgid "Debug session closed." +msgstr "Ladící sezení ukončeno." + msgid "Line %d" msgstr "Řádek %d" @@ -1234,6 +1279,9 @@ msgstr "Přerušit" msgid "Continue" msgstr "Pokračovat" +msgid "Thread:" +msgstr "Vlákno:" + msgid "Stack Frames" msgstr "Rámce zásobníku" @@ -1384,7 +1432,7 @@ msgid "Errors loading!" msgstr "Chyby při načítání!" msgid "Permanently delete %d item(s)? (No undo!)" -msgstr "Permanentně smazat %d položek? (nelze vrátit zpět!)" +msgstr "Permanentně smazat %d položek? (Nelze vrátit zpět!)" msgid "Show Dependencies" msgstr "Zobrazit závislosti" @@ -1441,21 +1489,6 @@ msgstr "Zlatí sponzoři" msgid "Silver Sponsors" msgstr "Stříbrní sponzoři" -msgid "Bronze Sponsors" -msgstr "Bronzoví sponzoři" - -msgid "Mini Sponsors" -msgstr "Mini sponzoři" - -msgid "Gold Donors" -msgstr "Zlatí dárci" - -msgid "Silver Donors" -msgstr "Stříbrní dárci" - -msgid "Bronze Donors" -msgstr "Bronzoví dárci" - msgid "Donors" msgstr "Dárci" @@ -1506,6 +1539,12 @@ msgstr "Balíček \"%s\" byl úspěšně nainstalován!" msgid "Success!" msgstr "Úspěch!" +msgid "No files conflict with your project" +msgstr "Žádné soubory nejsou v konfliktu s vaším projektem" + +msgid "Installation preview:" +msgstr "Náhled instalace:" + msgid "Install" msgstr "Instalovat" @@ -1680,6 +1719,15 @@ msgstr "Název uzlu:" msgid "Global Variable" msgstr "Globální proměnná" +msgid "3D Engine" +msgstr "3D Engine" + +msgid "2D Physics" +msgstr "2D Fyzika" + +msgid "3D Physics" +msgstr "3D Fyzika" + msgid "Navigation" msgstr "Navigace" @@ -1689,6 +1737,9 @@ msgstr "OpenGL" msgid "Vulkan" msgstr "Vulkan" +msgid "Navigation, both 2D and 3D." +msgstr "Navigace, jak 2D, tak i 3D." + msgid "File saving failed." msgstr "Ukládání souboru selhalo." @@ -1707,6 +1758,9 @@ msgstr "Nový" msgid "Save" msgstr "Uložit" +msgid "Profile:" +msgstr "Profil:" + msgid "Reset to Defaults" msgstr "Obnovit výchozí" @@ -1719,6 +1773,13 @@ msgstr "Načíst profil" msgid "Export Profile" msgstr "Exportovat profil" +msgid "" +"Failed to execute command \"%s\":\n" +"%s." +msgstr "" +"Nepodařilo se vykonat příkaz \"%s\":\n" +"%s." + msgid "Filter Commands" msgstr "Filtrovat příkazy" @@ -1895,12 +1956,21 @@ msgstr "(Re)Importování assetů" msgid "Import resources of type: %s" msgstr "Importovat zdroje typu: %s" +msgid "No return value." +msgstr "Žádná návratová hodnota." + msgid "Experimental" msgstr "Experimentální" msgid "Error codes returned:" msgstr "Vráceny chybové kódy:" +msgid "There is currently no description for this method." +msgstr "Momentálně zde není žádný popis této metody." + +msgid "There is currently no description for this constructor." +msgstr "Momentálně zde není žádný popis tohoto konstruktoru." + msgid "Top" msgstr "Horní" @@ -1926,6 +1996,9 @@ msgstr "Online návody" msgid "Properties" msgstr "Vlastnosti" +msgid "overrides %s:" +msgstr "přepisuje %s:" + msgid "default:" msgstr "výchozí:" @@ -1984,12 +2057,24 @@ msgstr "Popisy metod" msgid "Operator Descriptions" msgstr "Popisy operátorů" +msgid "Metadata:" +msgstr "Metadata:" + msgid "Property:" msgstr "Vlastnost:" +msgid "Method:" +msgstr "Metoda:" + msgid "Signal:" msgstr "Signál:" +msgid "Theme Item:" +msgstr "Položka motivu:" + +msgid "No description available." +msgstr "Není dostupný popis." + msgid "%d match." msgstr "%d shoda." @@ -2014,6 +2099,9 @@ msgstr "Pouze třídy" msgid "Methods Only" msgstr "Pouze metody" +msgid "Operators Only" +msgstr "Pouze operátory" + msgid "Signals Only" msgstr "Pouze signály" @@ -2060,21 +2148,45 @@ msgstr[0] "(%d změna)" msgstr[1] "(%d změny)" msgstr[2] "(%d změn)" +msgid "Add element to property array with prefix %s." +msgstr "Přidat prvek do pole vlastností s prefixem %s." + +msgid "Remove element %d from property array with prefix %s." +msgstr "Odstranit prvek %d z pole vlastností s prefixem %s." + +msgid "Move element %d to position %d in property array with prefix %s." +msgstr "Přesunout prvek %d na pozici %d v poli vlastností s prefixem %s." + +msgid "Element %d: %s%d*" +msgstr "Prvek %d: %s%d*" + msgid "Move Up" msgstr "Přesunout nahoru" msgid "Move Down" msgstr "Přesunout dolů" +msgid "Resize Array..." +msgstr "Změnit velikost pole..." + +msgid "Add Element" +msgstr "Přidat prvek" + msgid "Resize Array" msgstr "Změnit velikost pole" +msgid "Element %s" +msgstr "Prvek %s" + msgid "Add Metadata" msgstr "Přidat metadata" msgid "Set %s" msgstr "Nastav %s" +msgid "Set Multiple: %s" +msgstr "Nastavit více: %s" + msgid "Remove metadata %s" msgstr "Odstranit metadata %s" @@ -2093,6 +2205,15 @@ msgstr "Název metadat nemůže být prázdný." msgid "Name:" msgstr "Jméno:" +msgid "Add Metadata Property for \"%s\"" +msgstr "Přidat vlastnost metadat pro \"%s\"" + +msgid "Copy Value" +msgstr "Zkopírovat hodnotu" + +msgid "Paste Value" +msgstr "Vložit hodnotu" + msgid "Creating Mesh Previews" msgstr "Vytváření náhledu modelu" @@ -2111,6 +2232,9 @@ msgstr "Změněn režim filtru pro nastavení jazyka" msgid "[Default]" msgstr "[Výchozí]" +msgid "Select a Locale" +msgstr "Vybrat jazyk" + msgid "Show All Locales" msgstr "Zobrazit všechny jazyky" @@ -2327,7 +2451,7 @@ msgid "Can't reload a scene that was never saved." msgstr "Nelze načíst scénu, která nebyla nikdy uložena." msgid "Reload Saved Scene" -msgstr "Znovunačíst uloženou scénu" +msgstr "Znovu načíst uloženou scénu" msgid "" "The current scene has unsaved changes.\n" @@ -2336,9 +2460,18 @@ msgstr "" "Aktuální scéna obsahuje neuložené změny.\n" "Přesto znovu načíst? Tuto akci nelze vrátit zpět." +msgid "Save & Reload" +msgstr "Uložit a znovu načíst" + +msgid "Save modified resources before reloading?" +msgstr "Uložit změněné zdroje před opětovným načtením?" + msgid "Save & Quit" msgstr "Uložit a ukončit" +msgid "Save modified resources before closing?" +msgstr "Uložit změněné zdroje před zavřením?" + msgid "Save changes to the following scene(s) before quitting?" msgstr "Uložit změny následujících scén před ukončením?" @@ -2381,17 +2514,6 @@ msgstr "" "Deaktivujte rozšíření '%s' abyste předešli dalším chybám." msgid "" -"Unable to load addon script from path: '%s' Base type is not EditorPlugin." -msgstr "" -"Nepodařilo se načíst addon skript z cesty: '%s'. Základní typ není " -"EditorPlugin." - -msgid "Unable to load addon script from path: '%s' Script is not in tool mode." -msgstr "" -"Nelze načíst skript rozšíření z cesty: '%s'. Skript není v režimu nástroje " -"(tool)." - -msgid "" "Scene '%s' was automatically imported, so it can't be modified.\n" "To make changes to it, a new inherited scene can be created." msgstr "" @@ -2453,6 +2575,9 @@ msgstr "Výchozí" msgid "Save & Close" msgstr "Uložit a zavřít" +msgid "Save before closing?" +msgstr "Uložit před zavřením?" + msgid "%d more files or folders" msgstr "%d více souborů nebo složek" @@ -2489,6 +2614,12 @@ msgstr "Možností scén." msgid "Copy Text" msgstr "Kopírovat text" +msgid "Next Scene Tab" +msgstr "Příští karta scény" + +msgid "Previous Scene Tab" +msgstr "Předchozí karta scény" + msgid "New Scene" msgstr "Nová scéna" @@ -2507,6 +2638,9 @@ msgstr "Otevřít nedávné" msgid "Save Scene" msgstr "Uložit scénu" +msgid "Export As..." +msgstr "Exportovat jako..." + msgid "MeshLibrary..." msgstr "Knihovna modelů..." @@ -2522,6 +2656,9 @@ msgstr "Projekt" msgid "Project Settings..." msgstr "Nastavení projektu..." +msgid "Project Settings" +msgstr "Nastavení projektu" + msgid "Version Control" msgstr "Správa verzí" @@ -2549,6 +2686,9 @@ msgstr "Editor" msgid "Editor Settings..." msgstr "Nastavení editoru..." +msgid "Command Palette..." +msgstr "Paleta příkazů..." + msgid "Editor Layout" msgstr "Rozložení editoru" @@ -2591,6 +2731,9 @@ msgstr "Otázky & odpovědi" msgid "Community" msgstr "Komunita" +msgid "Copy System Info" +msgstr "Zkopírovat informace o systému" + msgid "Report a Bug" msgstr "Nahlásit chybu" @@ -2817,6 +2960,9 @@ msgstr "Rychlé načtení" msgid "Make Unique" msgstr "Vytvořit unikátní" +msgid "Save As..." +msgstr "Uložit jako..." + msgid "Show in FileSystem" msgstr "Zobrazit v souborovém systému" @@ -2848,6 +2994,12 @@ msgstr "Napište svůj kód v _run() metodě." msgid "There is an edited scene already." msgstr "Nějaka scéna už je upravována." +msgid "Edit Built-in Action: %s" +msgstr "Upravit vestavěnou funkci: %s" + +msgid "Edit Shortcut: %s" +msgstr "Upravit zkratku: %s" + msgid "Common" msgstr "Společný" @@ -2872,6 +3024,9 @@ msgstr "Vazba" msgid "Unicode" msgstr "Unicode" +msgid "Joypad Axis %d %s (%s)" +msgstr "Osa joypadu %d %s (%s)" + msgid "All Devices" msgstr "Všechna zařízení" @@ -2884,12 +3039,18 @@ msgstr "Filtrovat podle události..." msgid "Project export for platform:" msgstr "Exportovat projekt pro platformu:" +msgid "Completed with warnings." +msgstr "Dokončeno s varováními." + msgid "Completed successfully." msgstr "Úspěšně dokončeno." msgid "Failed." msgstr "Selhalo." +msgid "Storing File: %s" +msgstr "Ukládám soubor: %s" + msgid "Storing File:" msgstr "Ukládám soubor:" @@ -2902,6 +3063,15 @@ msgstr "Nelze otevřít soubor pro čtení z cesty \"%s\"." msgid "Packing" msgstr "Balím" +msgid "Cannot create file \"%s\"." +msgstr "Nelze vytvořit soubor \"%s\"." + +msgid "Failed to export project files." +msgstr "Export souborů projektu selhal." + +msgid "Can't open encrypted file to write." +msgstr "Nelze otevřít zašifrovaný soubor pro zápis." + msgid "Custom debug template not found." msgstr "Vlastní ladící šablona nebyla nalezena." @@ -2914,6 +3084,9 @@ msgstr "Zadaná cesta pro export neexistuje." msgid "Template file not found: \"%s\"." msgstr "Soubor šablony nenalezen: \"%s\"." +msgid "Failed to copy export template." +msgstr "Nepodařilo se zkopírovat exportní šablonu." + msgid "On 32-bit exports the embedded PCK cannot be bigger than 4 GiB." msgstr "Při 32-bitovým exportu vestavěné PCK nemůže být větší než 4 GiB." @@ -3111,6 +3284,12 @@ msgstr "" "Šablony se budou stahovat i nadále.\n" "Po dokončení může dojít ke krátkému zamrznutí editoru." +msgid "" +"Target platform requires '%s' texture compression. Enable 'Import %s' to fix." +msgstr "" +"Cílová platforma vyžaduje kompresi textur '%s'. Povolte 'Import %s' v " +"nastaveních projektu." + msgid "Runnable" msgstr "Spustitelný" @@ -3120,6 +3299,12 @@ msgstr "Odstranit předvolbu '%s'?" msgid "Resources to export:" msgstr "Zdroje k exportu:" +msgid "(Inherited)" +msgstr "(zděděno)" + +msgid "%s Export" +msgstr "Export pro %s" + msgid "Release" msgstr "Vydání" @@ -3189,9 +3374,21 @@ msgstr "Vlastní (oddělené čárkou):" msgid "Feature List:" msgstr "Seznam funkcí:" +msgid "Export PCK/ZIP..." +msgstr "Exportovat PCK/Zip..." + +msgid "Export Project..." +msgstr "Exportovat projekt..." + msgid "Export All" msgstr "Exportovat vše" +msgid "Choose an export mode:" +msgstr "Zvolte mód exportu:" + +msgid "Export All..." +msgstr "Exportovat vše..." + msgid "ZIP File" msgstr "Soubor ZIP" @@ -3241,6 +3438,12 @@ msgstr "Chyba přesouvání:" msgid "Error duplicating:" msgstr "Chyba duplikování:" +msgid "Failed to save resource at %s: %s" +msgstr "Selhalo uložení zdroje do %s: %s" + +msgid "Failed to load resource at %s: %s" +msgstr "Selhalo nahrání zdroje z %s: %s" + msgid "" "This filename begins with a dot rendering the file invisible to the editor.\n" "If you want to rename it anyway, use your operating system's file manager." @@ -3288,6 +3491,9 @@ msgstr "Upravit závislosti..." msgid "View Owners..." msgstr "Zobrazit vlastníky..." +msgid "Create New" +msgstr "Vytvořit nový" + msgid "Add to Favorites" msgstr "Přidat do oblíbených" @@ -3383,9 +3589,21 @@ msgstr "Najít..." msgid "Replace..." msgstr "Nahradit..." +msgid "Replace all (no undo)" +msgstr "Nahradit všechny (nelze vrátit zpět)" + msgid "Searching..." msgstr "Hledám..." +msgid "%d match in %d file" +msgstr "%d shoda v %d souboru" + +msgid "%d matches in %d file" +msgstr "%d shod v %d souboru" + +msgid "%d matches in %d files" +msgstr "%d shod v %d souborech" + msgid "Add to Group" msgstr "Přidat do skupiny" @@ -3527,6 +3745,12 @@ msgstr "Spustit projekt." msgid "Play the edited scene." msgstr "Spustit upravenou scénu." +msgid "Play a custom scene." +msgstr "Přehrát vlastní scénu." + +msgid "Reload the played scene." +msgstr "Znovu načíst přehrávanou scénu." + msgid "Quick Run Scene..." msgstr "Rychle spustit scénu..." @@ -3638,6 +3862,9 @@ msgstr "Offset(Posun):" msgid "Loop:" msgstr "Smyčka:" +msgid "Configuration:" +msgstr "Konfigurace:" + msgid "Importing Scene..." msgstr "Importuji scénu..." @@ -3665,6 +3892,48 @@ msgstr "2D" msgid "3D" msgstr "3D" +msgid "<Unnamed Material>" +msgstr "<Nepojmenovaný materiál>" + +msgid "Error opening scene" +msgstr "Chyba při otevírání scény" + +msgid "Warning: File exists" +msgstr "Varování: Soubor již existuje" + +msgid "Will create new file" +msgstr "Vytvoří nový soubor" + +msgid "Extract" +msgstr "Extrahovat" + +msgid "Will save to new file" +msgstr "Uloží do nového souboru" + +msgid "Actions..." +msgstr "Akce..." + +msgid "Extract Materials" +msgstr "Extrahovat materiály" + +msgid "Materials" +msgstr "Materiály" + +msgid "Save Extension:" +msgstr "Uložit rozšíření:" + +msgid "Text: *.tres" +msgstr "Textový: *.tres" + +msgid "Binary: *.res" +msgstr "Binární: *.res" + +msgid "Text Resource" +msgstr "Textový zdroj" + +msgid "Binary Resource" +msgstr "Binární zdroj" + msgid "Importer:" msgstr "Importér:" @@ -3697,6 +3966,9 @@ msgstr "Importovat jako:" msgid "Preset" msgstr "Předvolba" +msgid "Advanced..." +msgstr "Pokročilé..." + msgid "" "Select a resource file in the filesystem or in the inspector to adjust import " "settings." @@ -3704,6 +3976,9 @@ msgstr "" "Vyberte zdrojový soubor v prohlížeči souboru nebo v inspektoru k úpravě " "nastavení importu." +msgid "Joypad Axes" +msgstr "Osy gamepadu" + msgid "Device:" msgstr "Zařízení:" @@ -3734,9 +4009,6 @@ msgstr "Nahrát existující zdroj z disku a editovat ho." msgid "Save the currently edited resource." msgstr "Uložit právě editovaný zdroj." -msgid "Save As..." -msgstr "Uložit jako..." - msgid "Extra resource options." msgstr "Další možnosti zdrojů." @@ -3773,6 +4045,9 @@ msgstr "Odebrat přemapování zdroje" msgid "Remove Resource Remap Option" msgstr "Odebrat možnost přemapování zdroje" +msgid "%s cannot be found." +msgstr "Nelze nalézt %s." + msgid "Translations" msgstr "Překlady" @@ -3794,9 +4069,15 @@ msgstr "Jazyky" msgid "Set %s on %d nodes" msgstr "Nastavit %s na %d uzlech" +msgid "%s (%d Selected)" +msgstr "%s (%d vybráno)" + msgid "Select a single node to edit its signals and groups." msgstr "Zvolte vybraný uzel pro editaci jeho signálů a skupin." +msgid "Subfolder name is not a valid folder name." +msgstr "Jméno podsložky není platné jméno pro složku." + msgid "Edit a Plugin" msgstr "Editovat plugin" @@ -3901,6 +4182,9 @@ msgstr "Zvolte a přesuňte body. Nové uzly vytvořte pomocí RMB." msgid "Enable snap and show grid." msgstr "Aktivovat přichytávání a zobrazit mřížku." +msgid "Sync:" +msgstr "Synchronizovat:" + msgid "Blend:" msgstr "Prolínání:" @@ -3943,6 +4227,9 @@ msgstr "Odstranit body a trojúhelníky." msgid "Generate blend triangles automatically (instead of manually)" msgstr "Vygenerovat blend trojúhelníky automaticky (ne manuálně)" +msgid "Parameter Changed: %s" +msgstr "Změněný parametr: %s" + msgid "Output node can't be added to the blend tree." msgstr "Výstupní uzly nemohou být přidané do blend stromu." @@ -4004,15 +4291,45 @@ msgstr "Přidat uzel..." msgid "Enable Filtering" msgstr "Povolit filtrování" +msgid "Library Name:" +msgstr "Název knihovny:" + msgid "Animation name can't be empty." msgstr "Název animace nemůže být prázdný." +msgid "Animation with the same name already exists." +msgstr "Akce se stejným názvem již existuje." + +msgid "Add Animation to Library: %s" +msgstr "Přidat animaci do knihovny: %s" + +msgid "Add Animation Library: %s" +msgstr "Přidat knihovnu animací: %s" + msgid "Load Animation" msgstr "Načíst animaci" msgid "Invalid AnimationLibrary file." msgstr "Neplatný soubor AnimationLibrary." +msgid "Invalid Animation file." +msgstr "Neplatný soubor animace." + +msgid "Load Animation into Library: %s" +msgstr "Načíst animaci do knihovny: %s" + +msgid "Save Animation to File: %s" +msgstr "Uložit animaci do souboru: %s" + +msgid "Rename Animation Library: %s" +msgstr "Přejmenovat knihovnu animací: %s" + +msgid "[Global]" +msgstr "[Globální]" + +msgid "Rename Animation: %s" +msgstr "Přejmenovat animaci: %s" + msgid "Animation Name:" msgstr "Jméno animace:" @@ -4022,12 +4339,27 @@ msgstr "Vložená animace" msgid "Open in Inspector" msgstr "Otevřít v inspektoru" +msgid "Remove Animation Library: %s" +msgstr "Odstranit knihovnu animací: %s" + +msgid "Remove Animation from Library: %s" +msgstr "Odstranit animaci z knihovny: %s" + +msgid "Paste Animation to Library from clipboard" +msgstr "Vložit animaci ze schránky do knihovny" + +msgid "Save animation library to resource on disk" +msgstr "Uložit knihovnu animací do zdroje na disku" + msgid "Copy animation to clipboard" msgstr "Zkopírovat animaci do schránky" msgid "Save animation to resource on disk" msgstr "Uložit animaci do zdroje na disku" +msgid "Edit Animation Libraries" +msgstr "Upravit knihovny animací" + msgid "Toggle Autoplay" msgstr "Zapnout Autoplay" @@ -4043,12 +4375,18 @@ msgstr "Přejmenovat animaci" msgid "Change Animation Name:" msgstr "Změnit název animace:" +msgid "Delete Animation '%s'?" +msgstr "Smazat animaci '%s'?" + msgid "Remove Animation" msgstr "Smazat animaci" msgid "Invalid animation name!" msgstr "Neplatné jméno animace!" +msgid "Animation '%s' already exists!" +msgstr "Animace '%s' už existuje!" + msgid "Duplicate Animation" msgstr "Duplikovat animaci" @@ -4058,6 +4396,12 @@ msgstr "Upraveno prolnutí na další" msgid "Change Blend Time" msgstr "Změnit Blend Time" +msgid "[Global] (create)" +msgstr "[Globální] (vytvořit)" + +msgid "Duplicated Animation Name:" +msgstr "Název duplikované animace:" + msgid "Play selected animation backwards from current pos. (A)" msgstr "Přehrát zvolenou animaci pozpátku ze současné pozice. (A)" @@ -4082,6 +4426,9 @@ msgstr "Nástroje pro animaci" msgid "Animation" msgstr "Animace" +msgid "Manage Animations..." +msgstr "Spravovat animace..." + msgid "Edit Transitions..." msgstr "Upravit přechody..." @@ -4148,6 +4495,9 @@ msgstr "Přesunout uzel" msgid "Transition exists!" msgstr "Přechod existuje!" +msgid "Edit %s" +msgstr "Upravit %s" + msgid "Add Transition" msgstr "Přidat přechod" @@ -4428,6 +4778,12 @@ msgstr "Zamčeno" msgid "Grouped" msgstr "Seskupené" +msgid "Add Node Here..." +msgstr "Přidat uzel sem..." + +msgid "Instantiate Scene Here..." +msgstr "Instanciovat scénu sem..." + msgid "Scaling:" msgstr "Škálování:" @@ -4634,6 +4990,9 @@ msgstr "Výběr snímku" msgid "Preview Canvas Scale" msgstr "Náhled měřítka plátna" +msgid "Project theme" +msgstr "Motiv projektu" + msgid "Translation mask for inserting keys." msgstr "Offset maska pro vkládání klíčů." @@ -4742,6 +5101,12 @@ msgstr "Vpravo po celé výšce" msgid "Full Rect" msgstr "Celý obdélník" +msgid "Horizontal alignment" +msgstr "Vodorovné zarovnání" + +msgid "Vertical alignment" +msgstr "Svislé zarovnání" + msgid "Load Emission Mask" msgstr "Načíst emisní masku" @@ -4831,6 +5196,9 @@ msgstr "" "když je povolena tato volba, tak lze během hry vidět kolizní tvary a raycast " "uzly (pro 2D a 3D)." +msgid "Visible Paths" +msgstr "Viditelné cesty" + msgid "Visible Navigation" msgstr "Viditelná navigace" @@ -4869,16 +5237,35 @@ msgstr "" "Při vzdáleném použití na zařízení je tato možnost efektivnější, když je " "povolen síťový souborový systém." +msgid "" +"When this option is enabled, the editor debug server will stay open and " +"listen for new sessions started outside of the editor itself." +msgstr "" +"Pokud je tato možnost povolena, ladící server zůstane běžet a poslouchá " +"jestli nezačalo nové ladící sezení mimo editor." + msgid "Run %d Instance" msgid_plural "Run %d Instances" msgstr[0] "Spustit %d instanci" msgstr[1] "Spustit %d instance" msgstr[2] "Spustit %d instancí" +msgid "Size: %s" +msgstr "Velikost: %s" + +msgid "Type: %s" +msgstr "Typ: %s" + +msgid "Overrides (%d)" +msgstr "Přepisuje (%d)" + msgctxt "Locale" msgid "Add Script" msgstr "Přídat Skript" +msgid "No supported features" +msgstr "Nepodporované funkce" + msgid " - Variation" msgstr " - Variace" @@ -5035,6 +5422,12 @@ msgstr "Žádná mesh pro debugování." msgid "Mesh has no UV in layer %d." msgstr "Model nemá ve vrstvě %d žádné UV." +msgid "MeshInstance3D lacks a Mesh." +msgstr "MeshInstance3D nemá Mesh." + +msgid "Mesh has no surface to create outlines from." +msgstr "Mesh nemá povrch, z kterého lze vytvořit obrysy." + msgid "Could not create outline." msgstr "Nelze vytvořit obrys." @@ -5243,6 +5636,9 @@ msgstr "Animační klíč vložen." msgid "Objects: %d\n" msgstr "Objekty: %d\n" +msgid "FPS: %d" +msgstr "FPS: %d" + msgid "Top View." msgstr "Pohled shora." @@ -5282,6 +5678,15 @@ msgstr "Posun:" msgid "Rotating %s degrees." msgstr "Rotuji %s stupňů." +msgid "Translating %s." +msgstr "Posun %s." + +msgid "Rotating %f degrees." +msgstr "Rotace o %f stupňů." + +msgid "Scaling %s." +msgstr "Škálování %s." + msgid "Auto Orthogonal Enabled" msgstr "Auto-ortogonalizace zapnutá" @@ -5303,6 +5708,9 @@ msgstr "Bezestínový pohled" msgid "Normal Buffer" msgstr "Normální vyrovnávací paměť" +msgid "Display Advanced..." +msgstr "Zobrazit pokročilé..." + msgid "View Environment" msgstr "Zobrazit prostředí" @@ -5511,6 +5919,27 @@ msgstr "Před" msgid "Post" msgstr "Po" +msgid "Sun Color" +msgstr "Barva slunce" + +msgid "Sun Energy" +msgstr "Energie slunce" + +msgid "Shadow Max Distance" +msgstr "Maximální vzdálenost stínů" + +msgid "Add Sun to Scene" +msgstr "Přidat slunce do scény" + +msgid "Sky Color" +msgstr "Barva nebe" + +msgid "Ground Color" +msgstr "Barva země" + +msgid "Sky Energy" +msgstr "Energie nebe" + msgid "Remove Point from Curve" msgstr "Odstranit bod z křivky" @@ -6021,6 +6450,9 @@ msgstr "Přejít na další breakpoint" msgid "Go to Previous Breakpoint" msgstr "Přejít na předchozí breakpoint" +msgid "Save File As" +msgstr "Uložit soubor jako" + msgid "This skeleton has no bones, create some children Bone2D nodes." msgstr "Kostra nemá žádné kosti, vytvoř nějaké potomky Bone2D." @@ -6060,6 +6492,9 @@ msgstr "Vytvořit LightOccluder2D" msgid "LightOccluder2D Preview" msgstr "Náhled LightOccluder2D" +msgid "Can't convert a sprite from a foreign scene." +msgstr "Nelze konvertovat sprite z jiné scény." + msgid "Can't convert a sprite using animation frames to mesh." msgstr "Nelze převést sprite pomocí animačních snímků na síť." @@ -6084,6 +6519,9 @@ msgstr "Neplatná geometrie, nelze vytvořit light occluder." msgid "Create LightOccluder2D Sibling" msgstr "Vytvořit sourozence LightOccluder2D" +msgid "Sprite2D" +msgstr "Sprite2D" + msgid "Simplification:" msgstr "Zjednodušení:" @@ -6144,12 +6582,18 @@ msgstr "Smazat animaci" msgid "Animation Frames:" msgstr "Snímky animace:" +msgid "Frame Duration:" +msgstr "Délka snímku:" + msgid "Zoom Reset" msgstr "Obnovení lupy" msgid "Select Frames" msgstr "Vybrat snímky" +msgid "Frame Order" +msgstr "Pořadí snímků" + msgid "Size" msgstr "Velikost" @@ -6159,6 +6603,12 @@ msgstr "Vytvořit rámečky ze Sprite Sheet" msgid "SpriteFrames" msgstr "Snímky spritu" +msgid "%s Mipmaps" +msgstr "%s mipmap" + +msgid "Memory: %s" +msgstr "Paměť: %s" + msgid "Set Region Rect" msgstr "Nastavit oblast textury" @@ -6408,21 +6858,48 @@ msgstr "Převrátit horizontálně" msgid "Flip Vertically" msgstr "Převrátit vertikálně" +msgid "Index: %d" +msgstr "Index: %d" + msgid "Scattering:" msgstr "Rozptyl:" +msgid "Global actions:" +msgstr "Globální akce:" + msgid "Rendering" msgstr "Vykreslování" +msgid "Occlusion Layer %d" +msgstr "Okluzní vrstva %d" + msgid "Physics" msgstr "Fyzika" +msgid "Physics Layer %d" +msgstr "Fyzikální vrstva %d" + +msgid "No physics layers" +msgstr "Žádné fyzikální vrstvy" + +msgid "Navigation Layer %d" +msgstr "Navigační vrstva %d" + +msgid "Custom Data %d" +msgstr "Vlastní data %d" + msgid "Yes" msgstr "Ano" msgid "No" msgstr "Ne" +msgid "ID: %d" +msgstr "ID: %d" + +msgid "Tile properties:" +msgstr "vlastnosti dlaždice:" + msgid "TileSet" msgstr "TileSet (Sada dlaždic)" @@ -6459,6 +6936,9 @@ msgstr "Detekovat nové změny" msgid "Discard all changes" msgstr "Zrušit všechny změny" +msgid "Permanentally delete my changes" +msgstr "Permanentně smazat mé změny" + msgid "Commit Changes" msgstr "Commitnout změny" @@ -6528,6 +7008,9 @@ msgstr "Boolean" msgid "Sampler" msgstr "Vzorkovač" +msgid "[default]" +msgstr "[výchozí]" + msgid "Add Input Port" msgstr "Přidat vstupní port" @@ -6709,6 +7192,9 @@ msgstr "Vrátí arkus tangent parametrů." msgid "Returns the inverse hyperbolic tangent of the parameter." msgstr "Vrátí inverzní hyperbolický tangent parametru." +msgid "Returns the result of bitwise NOT (~a) operation on the integer." +msgstr "Vrátí výsledek bitové operace NOT (~a) na celém čísle (integeru)." + msgid "" "Finds the nearest integer that is greater than or equal to the parameter." msgstr "Nalezne nejbližší celé číslo, které je větší nebo stejné jako parametr." @@ -6843,6 +7329,13 @@ msgstr "Vrátí hyperbolický tangens parametru." msgid "Finds the truncated value of the parameter." msgstr "Vrátí zkrácenou hodnotu parametru." +msgid "Returns the result of bitwise AND (a & b) operation for two integers." +msgstr "" +"Vrátí výsledek bitové operace AND (a & b) mezi dvěma celými čísly (integery)." + +msgid "Returns the result of bitwise OR (a | b) operation for two integers." +msgstr "Vrátí výsledek operace OR (a | b) mezi dvěma celými čísly (integery)." + msgid "Perform the cubic texture lookup." msgstr "Provést vyhledání kubické textury." @@ -7063,6 +7556,16 @@ msgstr "Bylo by dobré pojmenovat váš projekt." msgid "Invalid project path (changed anything?)." msgstr "Neplatná cesta k projektu (něco se změnilo?)." +msgid "" +"Couldn't load project at '%s' (error %d). It may be missing or corrupted." +msgstr "Nelze načíst projekt z '%s' (chyba %d). Může chybět nebo být poškozený." + +msgid "Couldn't save project at '%s' (error %d)." +msgstr "Nelze uložit projekt do '%s' (chyba %d)." + +msgid "Warning: This folder is not empty" +msgstr "Varování: Tato složka není prázdná" + msgid "Couldn't create project.godot in project path." msgstr "Nelze vytvořit project.godot v umístění projektu." @@ -7108,6 +7611,9 @@ msgstr "Instalační cesta k projektu:" msgid "Renderer:" msgstr "Vykreslovač:" +msgid "Git" +msgstr "Git" + msgid "Error: Project is missing on the filesystem." msgstr "Chyba: Projek se nevyskytuje v souborovém systému." @@ -7263,6 +7769,9 @@ msgstr "Vyberte složku pro skenování" msgid "Remove All" msgstr "Odebrat vše" +msgid "Also delete project contents (no undo!)" +msgstr "Také smazat obsah projektu (nelze vrátit zpět!)" + msgid "Can't run project" msgstr "Nelze spustit projekt" @@ -7273,6 +7782,27 @@ msgstr "" "V této chvíli nemáte žádný projekt.\n" "Přejete si prozkoumat oficiální ukázkové projekty v knihovně assetů?" +msgid "Manage Project Tags" +msgstr "Spravovat štítky projektu" + +msgid "Project Tags" +msgstr "Štítky projektu" + +msgid "Click tag to remove it from the project." +msgstr "Klikněte na štítek, abyste ho odebrali z projektu." + +msgid "All Tags" +msgstr "Všechny štítky" + +msgid "Click tag to add it to the project." +msgstr "Klikněte na štítek, abyste ho přidali k projektu." + +msgid "Create New Tag" +msgstr "Vytvořit nový štítek" + +msgid "Tags are capitalized automatically when displayed." +msgstr "Štítky jsou automaticky zobrazeny s kapitalizovaným prvním písmenem." + msgid "Add Project Setting" msgstr "Přidat nastavení projektu" @@ -7294,6 +7824,9 @@ msgstr "Vymazat vstupní akce" msgid "Project Settings (project.godot)" msgstr "Nastavení projektu (project.godot)" +msgid "Select a Setting or Type its Name" +msgstr "Vyberte nastavení nebo zadejte jeho název" + msgid "Input Map" msgstr "Mapování vstupů" @@ -7544,6 +8077,9 @@ msgstr "" msgid "Can't paste root node into the same scene." msgstr "Nelze vložit kořenový uzel do stejné scény." +msgid "<Unnamed> at %s" +msgstr "<Nepojmenovaný> v %s" + msgid "Reparent to New Node" msgstr "Změnit rodiče na nový uzel" @@ -7601,6 +8137,12 @@ msgstr "Otevřít skript / Vybrat umístění" msgid "Open Script" msgstr "Otevřít skript" +msgid "Inherit %s" +msgstr "Zdědit %s" + +msgid "Inherit" +msgstr "Zdědit" + msgid "Invalid path." msgstr "Neplatná cesta." @@ -7690,6 +8232,9 @@ msgstr "Neplatná instance slovníkového formátu (nemohu nahrát skript na @pa msgid "Invalid instance dictionary (invalid subclasses)" msgstr "Neplatná instance slovníku (neplatné podtřídy)" +msgid "Value of type '%s' can't provide a length." +msgstr "Hodnota typu '%s' nemůže poskytnout délku." + msgid "Next Plane" msgstr "Další rovina" @@ -7817,6 +8362,12 @@ msgstr "" "Aby tento uzel mohl fungovat, musí mít nastaven nebo vytvořen zdroj " "NavigationMesh." +msgid "Error saving file %s: %s" +msgstr "Chyba při ukládání souboru %s: %s" + +msgid "Error loading %s: %s." +msgstr "Chyba při načítání %s: %s." + msgid "Package name is missing." msgstr "Chybí jméno balíčku." @@ -7943,23 +8494,9 @@ msgstr "Nelze zapsat soubor rozšiřujícího balíčku!" msgid "Building Android Project (gradle)" msgstr "Buildování projektu pro Android (gradle)" -msgid "" -"Building of Android project failed, check output for the error. Alternatively " -"visit docs.godotengine.org for Android build documentation." -msgstr "" -"Buildování projektu pro Android se nezdařilo, zkontrolujte chybový výstup. " -"Případně navštivte dokumentaci o build pro Android na docs.godotengine.org." - msgid "Moving output" msgstr "Přesunout výstup" -msgid "" -"Unable to copy and rename export file, check gradle project directory for " -"outputs." -msgstr "" -"Nelze kopírovat či přejmenovat exportovaný soubor, zkontrolujte výstupy v " -"adresáři projektu gradle." - msgid "Creating APK..." msgstr "Vytvářím APK..." @@ -7981,9 +8518,15 @@ msgstr "Chybí identifikátor." msgid "The character '%s' is not allowed in Identifier." msgstr "Znak '%s' není dovolen v identifikátoru." +msgid "Could not open file \"%s\"." +msgstr "Nelze otevřít soubor \"%s\"." + msgid "All Files" msgstr "Všechny soubory" +msgid "Failed to create \"%s\" subfolder." +msgstr "Nelze vytvořit podsložku \"%s\"." + msgid "Invalid executable file." msgstr "Neplatný spouštěcí soubor." @@ -7996,6 +8539,18 @@ msgstr "Nelze spustit program xcrun." msgid "Could not start hdiutil executable." msgstr "Nelze spustit program hdiutil." +msgid "Could not create directory: \"%s\"." +msgstr "Nepodařilo se vytvořit adresář: \"%s\"." + +msgid "Could not create directory \"%s\"." +msgstr "Nepodařilo se vytvořit adresář: \"%s\"." + +msgid "Could not created symlink \"%s\" -> \"%s\"." +msgstr "Nelze vytvořit symbolický odkaz \"%s\" -> \"%s\"." + +msgid "Could not open \"%s\"." +msgstr "Nelze otevřít \"%s\"." + msgid "Could not open template for export: \"%s\"." msgstr "Nelze otevřít šablonu pro export: \"%s\"." @@ -8026,9 +8581,15 @@ msgstr "Spustit v prohlížeči" msgid "Run exported HTML in the system's default browser." msgstr "Spustit vyexportované HTML ve výchozím prohlížeči." +msgid "Icon size \"%d\" is missing." +msgstr "Chybí ikona velikosti \"%d\"." + msgid "Failed to rename temporary file \"%s\"." msgstr "Nelze přejmenovat dočasný soubor: \"%s\"." +msgid "Invalid icon file \"%s\"." +msgstr "Neplatný soubor ikony \"%s\"." + msgid "Failed to remove temporary file \"%s\"." msgstr "Nelze odstranit dočasný soubor: \"%s\"." @@ -8204,6 +8765,9 @@ msgstr "Nic není připojeno do vstupu '%s' uzlu '%s'." msgid "No root AnimationNode for the graph is set." msgstr "Není nastaven žádný kořen grafu AnimationNode." +msgid "Copy this constructor in a script." +msgstr "Kopírovat tento konstruktor ve skriptu." + msgid "" "Color: #%s\n" "LMB: Apply color" @@ -8256,9 +8820,6 @@ msgstr "" msgid "(Other)" msgstr "(Ostatní)" -msgid "Unsupported BMFont texture format." -msgstr "Nepodporovaný formát textury BMFont." - msgid "" "Shader keywords cannot be used as parameter names.\n" "Choose another name." @@ -8285,6 +8846,12 @@ msgstr "Filtr" msgid "Invalid comparison function for that type." msgstr "Neplatná funkce pro porovnání tohoto typu." +msgid "Invalid arguments for the built-in function: \"%s(%s)\"." +msgstr "Neplatné argumenty pro vestavěnou funkci:\"%s(%s)\"." + +msgid "Invalid assignment of '%s' to '%s'." +msgstr "Neplatné přiřazení '%s' do '%s'." + msgid "Assignment to function." msgstr "Přiřazeno funkci." diff --git a/editor/translations/editor/de.po b/editor/translations/editor/de.po index 494f53e8e7..e9e48e99c4 100644 --- a/editor/translations/editor/de.po +++ b/editor/translations/editor/de.po @@ -113,7 +113,7 @@ msgstr "" "Project-Id-Version: Godot Engine editor interface\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-11-10 08:03+0000\n" +"PO-Revision-Date: 2023-12-11 21:00+0000\n" "Last-Translator: Cerno_b <cerno.b@gmail.com>\n" "Language-Team: German <https://hosted.weblate.org/projects/godot-engine/godot/" "de/>\n" @@ -122,7 +122,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.2-dev\n" +"X-Generator: Weblate 5.3-dev\n" msgid "Main Thread" msgstr "Hauptthread" @@ -756,7 +756,7 @@ msgid "Use Blend" msgstr "Mischung verwenden" msgid "Update Mode (How this property is set)" -msgstr "Aktualisierungs-Modus (wie Eigenschaften gesetzt werden)" +msgstr "Aktualisierungs-Modus (wie diese Eigenschaft gesetzt wird)" msgid "Interpolation Mode" msgstr "Interpolationsmodus" @@ -789,7 +789,7 @@ msgid "(Invalid, expected type: %s)" msgstr "(Ungültig, erwarteter Typ: %s)" msgid "Easing:" -msgstr "Glätten:" +msgstr "Easing:" msgid "In-Handle:" msgstr "Eingehender Handle:" @@ -953,7 +953,7 @@ msgid "Not possible to add a new track without a root" msgstr "Ohne einen Root kann kein neuer Track hinzugefügt werden" msgid "Invalid track for Bezier (no suitable sub-properties)" -msgstr "Track ungültig als Bezier (keine passenden Unter-Eigenschaften)" +msgstr "Track ungültig als Bezier (keine passenden Untereigenschaften)" msgid "Add Bezier Track" msgstr "Bezier-Track hinzufügen" @@ -1019,7 +1019,7 @@ msgid "Animation Scale Keys" msgstr "Animations-Keys skalieren" msgid "Make Easing Keys" -msgstr "Glättungs-Key erzeugen" +msgstr "Easing-Key erzeugen" msgid "" "This option does not work for Bezier editing, as it's only a single track." @@ -1060,8 +1060,8 @@ msgid "" "The dummy player is forced active, non-deterministic and doesn't have the " "root motion track. Furthermore, the original node is inactive temporary." msgstr "" -"Einige Eigenschaften von AnimationPlayerEditor wurden deaktiviert, da dies " -"ein Dummy-AnimationPlayer für die Vorschau ist.\n" +"Einige Optionen von AnimationPlayerEditor wurden deaktiviert, da dies ein " +"Dummy-AnimationPlayer für die Vorschau ist.\n" "\n" "Der Dummy-Player ist zwangsweise aktiviert, nichtdeterministisch und hat " "nicht die Root-Bewegungs-Track. Außerdem ist der Ursprungsnode temporär " @@ -1130,13 +1130,13 @@ msgid "Scale From Cursor" msgstr "Vom Mauszeiger skalieren" msgid "Make Easing Selection" -msgstr "Auswahl zum Glätten erstellen" +msgstr "Easing-Auswahl erzeugen" msgid "Duplicate Selection" msgstr "Auswahl duplizieren" msgid "Duplicate Transposed" -msgstr "Umgesetztes duplizieren" +msgstr "Transponiert duplizieren" msgid "Delete Selection" msgstr "Auswahl löschen" @@ -1202,7 +1202,7 @@ msgid "Scale Ratio:" msgstr "Skalierungsverhältnis:" msgid "Select Transition and Easing" -msgstr "Übergang und Glättung auswählen" +msgstr "Übergang und Easing auswählen" msgctxt "Transition Type" msgid "Linear" @@ -2005,6 +2005,9 @@ msgstr "Entwickler" msgid "Authors" msgstr "Autoren" +msgid "Patrons" +msgstr "Förderer" + msgid "Platinum Sponsors" msgstr "Platin-Sponsoren" @@ -2014,20 +2017,17 @@ msgstr "Gold-Sponsoren" msgid "Silver Sponsors" msgstr "Silber-Sponsoren" -msgid "Bronze Sponsors" -msgstr "Bronze-Sponsoren" - -msgid "Mini Sponsors" -msgstr "Mini-Sponsoren" +msgid "Diamond Members" +msgstr "Diamant-Mitglieder" -msgid "Gold Donors" -msgstr "Gold-Unterstützer" +msgid "Titanium Members" +msgstr "Titan-Mitglieder" -msgid "Silver Donors" -msgstr "Silber-Unterstützer" +msgid "Platinum Members" +msgstr "Platin-Mitglieder" -msgid "Bronze Donors" -msgstr "Bronze-Unterstützer" +msgid "Gold Members" +msgstr "Gold-Mitglieder" msgid "Donors" msgstr "Unterstützer" @@ -2915,12 +2915,24 @@ msgstr "Methoden-Beschreibung" msgid "Operator Descriptions" msgstr "Operatorbeschreibungen" +msgid "Metadata:" +msgstr "Metadaten:" + msgid "Property:" msgstr "Eigenschaft:" +msgid "Method:" +msgstr "Methode:" + msgid "Signal:" msgstr "Signale:" +msgid "Theme Item:" +msgstr "Theme-Element:" + +msgid "No description available." +msgstr "Keine Beschreibung verfügbar." + msgid "%d match." msgstr "%d Übereinstimmung gefunden." @@ -3533,15 +3545,15 @@ msgstr "" "Die Erweiterung ‚%s‘ wird deaktiviert, um weitere Fehler zu verhindern." msgid "" -"Unable to load addon script from path: '%s' Base type is not EditorPlugin." +"Unable to load addon script from path: '%s'. Base type is not 'EditorPlugin'." msgstr "" -"Erweiterungsskript konnte nicht geladen werden: ‚%s‘ Basistyp ist nicht " -"EditorPlugin." +"Erweiterungsskript konnte nicht geladen werden: ‚%s‘. Basistyp ist nicht " +"‚EditorPlugin‘." -msgid "Unable to load addon script from path: '%s' Script is not in tool mode." +msgid "Unable to load addon script from path: '%s'. Script is not in tool mode." msgstr "" -"Erweiterungsskript konnte nicht geladen werden: ‚%s‘ Skript ist nicht im Tool-" -"Modus." +"Erweiterungsskript konnte nicht geladen werden: ‚%s‘. Skript ist nicht im " +"Tool-Modus." msgid "" "Scene '%s' was automatically imported, so it can't be modified.\n" @@ -3752,6 +3764,9 @@ msgstr "Tools" msgid "Orphan Resource Explorer..." msgstr "Verwaltung nicht verwendeter Ressourcen …" +msgid "Upgrade Mesh Surfaces..." +msgstr "Mesh-Oberflächen aktualisieren..." + msgid "Reload Current Project" msgstr "Aktuelles Projekt neu laden" @@ -3838,7 +3853,7 @@ msgid "Forward+" msgstr "Forward+" msgid "Mobile" -msgstr "Mobil" +msgstr "Mobile" msgid "Compatibility" msgstr "Kompatibilität" @@ -4064,6 +4079,12 @@ msgstr "" msgid "Assign..." msgstr "Zuweisen …" +msgid "Copy as Text" +msgstr "Als Text kopieren" + +msgid "Show Node in Tree" +msgstr "Node im Baum zeigen" + msgid "Invalid RID" msgstr "Ungültige RID" @@ -4153,6 +4174,9 @@ msgstr "Einzigartig machen" msgid "Make Unique (Recursive)" msgstr "Einzigartig machen (rekursiv)" +msgid "Save As..." +msgstr "Speichern als …" + msgid "Show in FileSystem" msgstr "Im Dateisystem anzeigen" @@ -4298,7 +4322,7 @@ msgid "Joystick 4 Down" msgstr "Joystick 4 runter" msgid "or" -msgstr "oder" +msgstr "or" msgid "Unicode" msgstr "Unicode" @@ -4607,7 +4631,7 @@ msgstr "" msgid "" "Target platform requires '%s' texture compression. Enable 'Import %s' to fix." msgstr "" -"Die Zielplattform benötigt „%s“-Texturkompression. Bitte in den " +"Die Target-Plattform benötigt „%s“-Texturkompression. Bitte in den " "Projekteinstellungen „%s importieren“ aktivieren." msgid "Fix Import" @@ -4630,6 +4654,9 @@ msgstr "Vorgabe ‚%s‘ löschen?" msgid "Resources to exclude:" msgstr "Auszuschließende Ressourcen:" +msgid "Resources to override export behavior:" +msgstr "Exportverhalten auszuschließende Ressourcen:" + msgid "Resources to export:" msgstr "Zu exportierende Ressourcen:" @@ -4933,6 +4960,9 @@ msgstr "Dupliziere Ordner:" msgid "New Inherited Scene" msgstr "Neue geerbte Szene" +msgid "Set as Main Scene" +msgstr "Als Hauptszene setzen" + msgid "Open Scenes" msgstr "Szenen öffnen" @@ -5044,6 +5074,33 @@ msgstr "Umbenennen …" msgid "Open in External Program" msgstr "In externem Programm öffnen" +msgid "Red" +msgstr "Rot" + +msgid "Orange" +msgstr "Orange" + +msgid "Yellow" +msgstr "Gelb" + +msgid "Green" +msgstr "Grün" + +msgid "Teal" +msgstr "Türkis" + +msgid "Blue" +msgstr "Blau" + +msgid "Purple" +msgstr "Lila" + +msgid "Pink" +msgstr "Pink" + +msgid "Gray" +msgstr "Grau" + msgid "Go to previous selected folder/file." msgstr "Zur vorigen ausgewählten Datei/Ordner springen." @@ -5053,6 +5110,9 @@ msgstr "Zur nächsten ausgewählten Datei/Ordner springen." msgid "Re-Scan Filesystem" msgstr "Dateisystem erneut einlesen" +msgid "Change Split Mode" +msgstr "Geteilten Modus ändern" + msgid "Filter Files" msgstr "Dateien filtern" @@ -5095,7 +5155,7 @@ msgstr "" "Projekteinstellungen änderbar." msgid "Find..." -msgstr "Finde …" +msgstr "Suche…" msgid "Replace..." msgstr "Ersetzen …" @@ -5677,15 +5737,6 @@ msgstr "Dynamisch gerenderte TrueType/OpenType-Schriftart" msgid "Prerendered multichannel(+true) signed distance field" msgstr "Vorgerendertes Mehrkanal(+true) vorzeichenbehaftetes Distanzfeld" -msgid "Can't load font texture:" -msgstr "Schriftart-Textur konnte nicht geladen werden:" - -msgid "Image margin too big." -msgstr "Bildrand zu groß." - -msgid "Character margin too big." -msgstr "Zeichenabstand ist zu groß." - msgid "Pre-Import Scene" msgstr "Szene vorimportieren" @@ -6064,9 +6115,6 @@ msgstr "Lade eine bestehende Ressource von der Festplatte und bearbeite sie." msgid "Save the currently edited resource." msgstr "Speichere die so eben bearbeitete Ressource." -msgid "Save As..." -msgstr "Speichern als …" - msgid "Extra resource options." msgstr "Zusatz-Ressourcenoptionen." @@ -6219,7 +6267,7 @@ msgid "" msgstr "" "Optional. diese Beschreibung sollte relativ kurz gehalten werden (bis zu 5 " "Zeilen).\n" -"Sie wird angezeigt wenn der Mauscursor in der Liste der Plugins über dem " +"Sie wird angezeigt, wenn der Mauszeiger in der Liste der Plugins über dem " "Plugin schwebt." msgid "Author:" @@ -6520,14 +6568,14 @@ msgid "" "This animation library can't be saved because it does not belong to the " "edited scene. Make it unique first." msgstr "" -"Diese Animationsbibliothek kann nicht gespeichert werden da sie nicht zur " +"Diese Animationsbibliothek kann nicht gespeichert werden, da sie nicht zur " "bearbeiteten Szene gehört. Sie muss erst einzigartig gemacht werden." msgid "" "This animation library can't be saved because it was imported from another " "file. Make it unique first." msgstr "" -"Diese Animationsbibliothek kann nicht gespeichert werden da sie aus einer " +"Diese Animationsbibliothek kann nicht gespeichert werden, da sie aus einer " "anderen Datei importiert wurde. Sie muss erst einzigartig gemacht werden." msgid "Save Library" @@ -6540,14 +6588,14 @@ msgid "" "This animation can't be saved because it does not belong to the edited scene. " "Make it unique first." msgstr "" -"Diese Animation kann nicht gespeichert werden da sie nicht zur bearbeiteten " +"Diese Animation kann nicht gespeichert werden, da sie nicht zur bearbeiteten " "Szene gehört. Sie muss erst einzigartig gemacht werden." msgid "" "This animation can't be saved because it was imported from another file. Make " "it unique first." msgstr "" -"Diese Animation kann nicht gespeichert werden da sie aus einer anderen Datei " +"Diese Animation kann nicht gespeichert werden, da sie aus einer anderen Datei " "importiert wurde. Sie muss erst einzigartig gemacht werden." msgid "Save Animation" @@ -6691,6 +6739,9 @@ msgstr "[Global] (erstellen)" msgid "Duplicated Animation Name:" msgstr "Duplizierter Animationsname:" +msgid "Onion skinning requires a RESET animation." +msgstr "Onion-Skinning benötigt eine RESET-Animation." + msgid "Play selected animation backwards from current pos. (A)" msgstr "Spiele ausgewählte Animation rückwärts von aktueller Position. (A)" @@ -6728,7 +6779,7 @@ msgid "Display list of animations in player." msgstr "Liste der Animationen im Player anzeigen." msgid "Autoplay on Load" -msgstr "Beim Laden automatisch abspielen" +msgstr "Autoplay beim Laden" msgid "Enable Onion Skinning" msgstr "Zwiebelhaut aktivieren" @@ -7477,7 +7528,7 @@ msgid "Copy Pose" msgstr "Pose kopieren" msgid "Clear Pose" -msgstr "Pose/Stellung löschen" +msgstr "Pose zurücksetzen" msgid "Multiply grid step by 2" msgstr "Rasterstufe verdoppeln" @@ -7836,6 +7887,18 @@ msgstr "" "Wenn diese Option aktiviert ist, werden Vermeidungs-Objekt-Shapes, -Radien " "und -Geschwindigkeiten im laufenden Projekt sichtbar sein." +msgid "Debug CanvasItem Redraws" +msgstr "CanvasItems-Redraws debuggen" + +msgid "" +"When this option is enabled, redraw requests of 2D objects will become " +"visible (as a short flash) in the running project.\n" +"This is useful to troubleshoot low processor mode." +msgstr "" +"Wenn diese Option aktiviert ist, werden Redraw-Anforderungen von 2D-Objekten " +"im laufenden Projekt sichtbar (als kurzes Blinken).\n" +"Dies ist nützlich bei der Fehlersuche im Prozessorenergiesparmodus." + msgid "Synchronize Scene Changes" msgstr "Szenenänderungen synchronisieren" @@ -8211,6 +8274,9 @@ msgstr "Navigations-Mesh erzeugen" msgid "Create Debug Tangents" msgstr "Debug-Tangenten generieren" +msgid "No mesh to unwrap." +msgstr "Kein Mesh zu entpacken." + msgid "" "Mesh cannot unwrap UVs because it does not belong to the edited scene. Make " "it unique first." @@ -8239,6 +8305,15 @@ msgstr "UV2 entfalten" msgid "Contained Mesh is not of type ArrayMesh." msgstr "Beinhaltetes Mesh ist nicht vom Typ ArrayMesh." +msgid "Can't unwrap mesh with blend shapes." +msgstr "Kann Mesh mit Blend-Shapes nicht entpacken." + +msgid "Only triangles are supported for lightmap unwrap." +msgstr "Nur Dreiecke werden für Lightmap-Entpacken unterstützt." + +msgid "Normals are required for lightmap unwrap." +msgstr "Normalen werden für Lightmap-Entpacken benötigt." + msgid "UV Unwrap failed, mesh may not be manifold?" msgstr "" "UV-Entfalten fehlgeschlagen, könnte das Mesh keine Mannigfaltigkeit sein?" @@ -8627,7 +8702,7 @@ msgid "Align Transform with View" msgstr "Transform an Ansicht ausrichten" msgid "Align Rotation with View" -msgstr "Rotation auf Sicht ausrichten" +msgstr "Rotation auf Ansicht ausrichten" msgid "Set Surface %d Override Material" msgstr "Override–Material der Oberfläche %d festlegen" @@ -8979,7 +9054,7 @@ msgid "Focus Origin" msgstr "Auf Ursprung zentrieren" msgid "Focus Selection" -msgstr "Auswahl fokussieren" +msgstr "Auf Auswahl zentrieren" msgid "Toggle Freelook" msgstr "Freie Kamera ein-/ausschalten" @@ -9548,10 +9623,10 @@ msgid "%s Class Reference" msgstr "%s Klassenreferenz" msgid "Find Next" -msgstr "Finde Nächstes" +msgstr "Suche Nächstes" msgid "Find Previous" -msgstr "Finde Vorheriges" +msgstr "Suche Vorheriges" msgid "Filter Scripts" msgstr "Skripte filtern" @@ -9581,7 +9656,7 @@ msgid "Save All" msgstr "Alle speichern" msgid "Soft Reload Tool Script" -msgstr "Tool-Skript für Soft-Nachladen" +msgstr "Soft-Neuladen von Tool-Skript" msgid "Copy Script Path" msgstr "Skriptpfad kopieren" @@ -9775,7 +9850,7 @@ msgid "Toggle Word Wrap" msgstr "Zeilenumbruch ein-/ausschalten" msgid "Trim Trailing Whitespace" -msgstr "Kürze Whitespace am Zeilenende" +msgstr "Whitespace am Zeilenende entfernen" msgid "Convert Indent to Spaces" msgstr "Konvertiere Einrückung zu Leerzeichen" @@ -9817,7 +9892,7 @@ msgid "Toggle Breakpoint" msgstr "Haltepunkt ein-/ausschalten" msgid "Remove All Breakpoints" -msgstr "Lösche alle Haltepunkte" +msgstr "Alle Haltepunkte löschen" msgid "Go to Next Breakpoint" msgstr "Zum nächsten Haltepunkt springen" @@ -9983,6 +10058,12 @@ msgstr "LightOccluder2D erzeugen" msgid "LightOccluder2D Preview" msgstr "LightOccluder2D-Vorschau" +msgid "Can't convert a sprite from a foreign scene." +msgstr "Kann keinen Sprite aus einer fremden Szene konvertieren." + +msgid "Can't convert an empty sprite to mesh." +msgstr "Kann kein leeres Sprite zu Mesh konvertieren." + msgid "Can't convert a sprite using animation frames to mesh." msgstr "" "Ein Sprite, das Animations-Frames nutzt, kann nicht zu einem Mesh konvertiert " @@ -11025,7 +11106,7 @@ msgid "Scattering:" msgstr "Streuung:" msgid "Tiles" -msgstr "Kacheln" +msgstr "Tiles" msgid "" "This TileMap's TileSet has no source configured. Go to the TileSet bottom tab " @@ -11406,7 +11487,7 @@ msgid "" "to reference an invalid source instead. This may result in unexpected data " "loss. Change this ID carefully." msgstr "" -"Achtung: Die Änderung einer Quellen-ID wird dazu führen, dass alle TileMaps, " +"Warnung: Die Änderung einer Quellen-ID wird dazu führen, dass alle TileMaps, " "die diese Quelle benutzen, stattdessen eine Referenz auf eine ungültige " "Quelle haben. Dies könnte zu unerwartetem Datenverlust führen. Ändern Sie " "diese ID mit Bedacht." @@ -13418,7 +13499,7 @@ msgid "Localization" msgstr "Lokalisierung" msgid "Autoload" -msgstr "Auto-Laden" +msgstr "Autoload" msgid "Shader Globals" msgstr "Globale Shader-Variablen" @@ -13742,9 +13823,20 @@ msgstr "" "Wenn „Editierbare Instanz“ deaktiviert wird, werden alle Eigenschaften dieses " "Nodes wieder in ihren Default-Zustand zurückgesetzt." +msgid "" +"Enabling \"Load as Placeholder\" will disable \"Editable Children\" and cause " +"all properties of the node to be reverted to their default." +msgstr "" +"Wenn Sie die Option \"Als Platzhalter laden\" aktivieren, wird die Option " +"\"Bearbeitbare Children\" deaktiviert und alle Eigenschaften des Nodes werden " +"auf ihre Defaultwerte zurückgesetzt." + msgid "Make Local" msgstr "Lokal machen" +msgid "Can't toggle unique name for nodes in subscene!" +msgstr "Kann keine eindeutigen Namen für Nodes in Unterszenen umschalten!" + msgid "Enable Scene Unique Name(s)" msgstr "Szenen-eindeutige(n) Namen aktivieren" @@ -13798,16 +13890,6 @@ msgstr "Entferne Node(s)" msgid "Change type of node(s)" msgstr "Node-Typ(en) ändern" -msgid "Removing the node from variable \"%s\" on node \"%s\"." -msgstr "Entferne Node von Variable „%s“ bei Node „%s“." - -msgid "" -"The node's new type is incompatible with an exported variable (expected %s, " -"but type is %s)." -msgstr "" -"Der neue Typ des Nodes ist nicht kompatibel mit einer exportieren Variable " -"(erwarte %s, aber Typ ist %s)." - msgid "This operation requires a single selected node." msgstr "Diese Aktion benötigt einen einzelnen ausgewählten Node." @@ -13842,6 +13924,9 @@ msgstr "Löse Vererbung" msgid "Editable Children" msgstr "Bearbeitbare Child-Objekte" +msgid "Load as Placeholder" +msgstr "Als Platzhalter laden" + msgid "Auto Expand to Selected" msgstr "Automatisch auf Auswahl vergrößern" @@ -14141,6 +14226,67 @@ msgstr "Der Name ‚%s‘ ist ein reserviertes Schlüsselwort der Shader-Sprache msgid "Add Shader Global Parameter" msgstr "Globalen Parameter für Shader hinzufügen" +msgid "" +"This project uses meshes with an outdated mesh format from previous Godot " +"versions. The engine needs to update the format in order to use those meshes. " +"Please use the 'Upgrade Mesh Surfaces' tool from the 'Project > Tools' menu. " +"You can ignore this message and keep using outdated meshes, but keep in mind " +"that this leads to increased load times every time you load the project." +msgstr "" +"Dieses Projekt verwendet Meshes mit einem veralteten Mesh-Format aus vorigen " +"Godot-Versionen. Die Engine muss das Format aktualisieren, um diese Meshes zu " +"verwenden. Bitte verwenden Sie das 'Mesh-Oberflächen aktualisieren'-Tool aus " +"dem 'Projekt > Tools'-Menü. Sie können diese Nachricht ignorieren und weiter " +"die veralteten Meshes verwenden, aber beachten Sie, dass dies bei jedem Laden " +"des Projekts zu erhöhten Ladezeiten führen kann." + +msgid "" +"This project uses meshes with an outdated mesh format. Check the output log." +msgstr "" +"Dieses Projekt verwendet Meshes mit einem veralteten Mesh-Format. Prüfen Sie " +"das Ausgabe-Log." + +msgid "Upgrading All Meshes in Project" +msgstr "Upgrade alle Meshes im Projekt" + +msgid "Attempting to re-save " +msgstr "Versuche neuzuspeichern " + +msgid "Attempting to remove " +msgstr "Versuche, folgendes zu entfernen: " + +msgid "" +"The mesh format has changed in Godot 4.2, which affects both imported meshes " +"and meshes authored inside of Godot. The engine needs to update the format in " +"order to use those meshes.\n" +"\n" +"If your project predates Godot 4.2 and contains meshes, we recommend you run " +"this one time conversion tool. This update will restart the editor and may " +"take several minutes. Upgrading will make the meshes incompatible with " +"previous versions of Godot.\n" +"\n" +"You can still use your existing meshes as is. The engine will update each " +"mesh in memory, but the update will not be saved. Choosing this option will " +"lead to slower load times every time this project is loaded." +msgstr "" +"Das Mesh-Format hat sich in Godot 4.2 geändert, was sich sowohl auf " +"importierte Meshes als auch auf innerhalb von Godot erstellte Meshes " +"auswirkt. Die Engine muss das Format aktualisieren, um diese Meshes verwenden " +"zu können.\n" +"\n" +"Wenn Ihr Projekt älter als Godot 4.2 ist und Meshes enthält, empfehlen wir " +"Ihnen, dieses einmalige Konvertierungstool auszuführen. Diese Aktualisierung " +"wird den Editor neu starten und kann einige Minuten dauern. Durch die " +"Aktualisierung werden die Meshes mit früheren Godot-Versionen inkompatibel.\n" +"\n" +"Sie können Ihre bestehenden Meshes aber weiterhin verwenden. Die Engine wird " +"jedes Mesh im Speicher aktualisieren, aber die Aktualisierung wird nicht " +"gespeichert. Wenn Sie diese Option wählen, führt bei jedem Laden des Projekts " +"zu längeren Ladezeiten ." + +msgid "Restart & Upgrade" +msgstr "Neustart & Aktualisieren" + msgid "Make this panel floating in the screen %d." msgstr "Dieses Panel schwebend machen auf Bildschirm %d." @@ -14169,6 +14315,9 @@ msgstr "Äußeren Torusradius ändern" msgid "Invalid type argument to convert(), use TYPE_* constants." msgstr "Ungültiger Argument-Typ in convert(), TYPE_*-Konstanten benötigt." +msgid "Cannot resize array." +msgstr "Kann Arraygröße nicht anpassen." + msgid "Step argument is zero!" msgstr "Schrittargument ist null!" @@ -14195,6 +14344,9 @@ msgstr "Ungültiges Instanz-Dictionary-Format (ungültiges Skript in @path)" msgid "Invalid instance dictionary (invalid subclasses)" msgstr "Ungültiges Instanz-Dictionary-Format (ungültige Unterklasse)" +msgid "Cannot instantiate GDScript class." +msgstr "Kann GDScript-Klasse nicht instanziieren." + msgid "Value of type '%s' can't provide a length." msgstr "Ein Wert des Typs ‚%s‘ kann keine Länge beinhalten." @@ -14405,6 +14557,9 @@ msgstr "Indirektes Licht aufzeichnen" msgid "Integrate indirect lighting" msgstr "Indirektes Licht integrieren" +msgid "Integrate indirect lighting %d%%" +msgstr "Indirekte Beleuchtung integrieren %d%%" + msgid "Baking lightprobes" msgstr "Backe Lightprobes" @@ -14412,7 +14567,7 @@ msgid "Integrating light probes %d%%" msgstr "Integriere Lightprobes %d%%" msgid "Denoising" -msgstr "Entrauschen" +msgstr "Rauschunterdrückung" msgid "Retrieving textures" msgstr "Am Textur-Laden" @@ -14526,7 +14681,7 @@ msgid "Add from path" msgstr "Aus Pfad hinzufügen" msgid "Spawn" -msgstr "Spawnen" +msgstr "Spawn" msgid "Replicate" msgstr "Nachbilden" @@ -14830,6 +14985,9 @@ msgid "Exporting to Android when using C#/.NET is experimental." msgstr "" "Exportieren nach Android bei Verwendung von C#/.NET ist noch experimentell." +msgid "Android architecture %s not supported in C# projects." +msgstr "Keine Unterstützung von Android-Architektur %s in C#-Projekten." + msgid "" "Android build template not installed in the project. Install it from the " "Project menu." @@ -14999,23 +15157,16 @@ msgstr "Konnte Expansion-Package-Datei nicht schreiben!" msgid "Building Android Project (gradle)" msgstr "Baue Android-Projekt (gradle)" -msgid "" -"Building of Android project failed, check output for the error. Alternatively " -"visit docs.godotengine.org for Android build documentation." +msgid "Building of Android project failed, check output for the error:" msgstr "" -"Bauen des Android-Projekts fehlgeschlagen, Fehlerdetails befinden ich in der " -"Textausgabe. Alternativ befindet sich die Android-Build-Dokumentation auf " -"docs.godotengine.org." +"Das Erstellen des Android-Projekts ist fehlgeschlagen, prüfen Sie die Ausgabe " +"auf den Fehler:" msgid "Moving output" msgstr "Verschiebe Ausgabe" -msgid "" -"Unable to copy and rename export file, check gradle project directory for " -"outputs." -msgstr "" -"Exportdatei kann nicht kopiert und umbenannt werden. Ausgaben sollten im " -"Gradle Projektverzeichnis erscheinen." +msgid "Unable to copy and rename export file:" +msgstr "Exportdatei kann nicht kopiert und umbenannt werden:" msgid "Package not found: \"%s\"." msgstr "Paket nicht gefunden: „%s“." @@ -15090,6 +15241,14 @@ msgstr "" ".ipa können nur unter MacOS gebaut werden. Das Xcode-Projekt wird verlassen " "ohne das Paket zu bauen." +msgid "Exporting to iOS when using C#/.NET is experimental and requires macOS." +msgstr "" +"Exportieren nach iOS bei Verwendung von C#/.NET ist noch experimentell und " +"benötigt macOS." + +msgid "Exporting to iOS when using C#/.NET is experimental." +msgstr "Exportieren nach iOS bei Verwendung von C#/.NET ist noch experimentell." + msgid "Identifier is missing." msgstr "Bezeichner fehlt." @@ -15253,6 +15412,13 @@ msgstr "Installer-Signing-Identity wird benötigt für App-Store-Verteilung." msgid "App sandbox is required for App Store distribution." msgstr "App-Sandbox wird benötigt für App-Store-Verteilung." +msgid "" +"'rcodesign' doesn't support signing applications with embedded dynamic " +"libraries (GDExtension or .NET)." +msgstr "" +"‚rcodesign‘ unterstützt nicht das Signieren von Anwendungen mit eingebetteten " +"dynamischen Bibliotheken (GDExtension oder .NET)." + msgid "Code signing is required for App Store distribution." msgstr "Code-Signatur wird benötigt für App-Store-Verteilung." @@ -15450,6 +15616,13 @@ msgstr "" "Ad-hoc signierte Anwendungen benötigen die ‚Disable Library Validation‘-" "Berechtigung, um dynamische Bibliotheken zu laden." +msgid "" +"'rcodesign' doesn't support signing applications with embedded dynamic " +"libraries." +msgstr "" +"‚rcodesign‘ unterstützt das Signieren von Anwendungen mit eingebetteten " +"dynamischen Bibliotheken nicht." + msgid "Could not create entitlements file." msgstr "Berechtigungsdatei konnte nicht erstellt werden." @@ -15929,6 +16102,17 @@ msgstr "" "nicht im TileMap-Node aktiviert." msgid "" +"The TileMap node is set as Y-sorted, but Y-sort is not enabled on any of the " +"TileMap's layers.\n" +"This may lead to unwanted behaviors, as a layer that is not Y-sorted will be " +"Y-sorted as a whole." +msgstr "" +"Der TileMap-Node ist als Y-sortiert festgelegt, aber Y-Sortierung ist für " +"keine der Ebenen der TileMap aktiviert.\n" +"Dies kann zu unerwünschtem Verhalten führen, da eine Ebene, die nicht Y-" +"sortiert ist, als Ganzes Y-sortiert wird." + +msgid "" "Isometric TileSet will likely not look as intended without Y-sort enabled for " "the TileMap and all of its layers." msgstr "" @@ -16338,7 +16522,7 @@ msgstr "" "Kollisionen gemeldet." msgid "This body will be ignored until you set a mesh." -msgstr "Diese Körper wird ignoriert werden bis ein Mesh zugewiesen wurde." +msgstr "Dieser Körper wird ignoriert bis Sie ein Mesh zuweisen." msgid "" "A SpriteFrames resource must be created or set in the \"Frames\" property in " @@ -16511,7 +16695,7 @@ msgid "Pick a color from the application window." msgstr "Eine Farbe innerhalb des Anwendungsfensters auswählen." msgid "Select a picker shape." -msgstr "Auswahl-Shape wählen." +msgstr "Auswahl-Geometrie wählen." msgid "Select a picker mode." msgstr "Auswahlmodus wählen." @@ -16587,6 +16771,14 @@ msgid "Automatically arrange selected nodes." msgstr "Automatisch ausgewählte Nodes anordnen." msgid "" +"Labels with autowrapping enabled must have a custom minimum size configured " +"to work correctly inside a container." +msgstr "" +"Für Labels mit aktiviertem automatischen Zeilenumbruch muss eine " +"benutzerdefinierte Mindestgröße konfiguriert sein, damit sie in einem " +"Container korrekt funktionieren." + +msgid "" "The current font does not support rendering one or more characters used in " "this Label's text." msgstr "" @@ -16710,15 +16902,6 @@ msgstr "" "Datenverlust problemlos möglich." msgid "" -"Setting node name '%s' to be unique within scene for '%s', but it's already " -"claimed by '%s'.\n" -"'%s' is no longer set as having a unique name." -msgstr "" -"Der verwendete Node-Name ‚%s‘ wurde als einzigartig in der Szene für ‚%s‘ " -"festgelegt, jedoch wurde der Name bereits von ‚%s‘ verwendet.\n" -"‚%s‘ wird nicht mehr als einzigartig geführt." - -msgid "" "This node is marked as deprecated and will be removed in future versions.\n" "Please check the Godot documentation for information about migration." msgstr "" @@ -16734,13 +16917,6 @@ msgstr "" "Versionen entfernt oder stark umgeändert werden." msgid "" -"Default Environment as specified in the project setting \"rendering/" -"environment/defaults/default_environment\" could not be loaded." -msgstr "" -"Die Default-Environment wie festgelegt in den Projekteinstellungen (Rendering/" -"Umgebung/Defaults/Default-Umgebung) konnte nicht geladen werden." - -msgid "" "ShaderGlobalsOverride is not active because another node of the same type is " "in the scene." msgstr "" @@ -16765,27 +16941,6 @@ msgstr "" "Die Größe des Viewports muss mindestens 2 Pixel in beiden Dimensionen " "betragen, um überhaupt irgendetwas rendern zu können." -msgid "Cannot open font from file: %s." -msgstr "Schriftart aus Datei „%s“ konnte nicht geöffnet werden." - -msgid "Version %d of BMFont is not supported (should be 3)." -msgstr "Version %d von BMFont wird nicht unterstützt (sollte 3 sein)." - -msgid "Invalid BMFont info block size." -msgstr "Ungültige BMFont-Infoblockgröße." - -msgid "Invalid BMFont common block size." -msgstr "Ungültige BMFont Common-Blockgröße." - -msgid "Can't load font texture: %s." -msgstr "Schriftarttextur kann nicht geladen werden: %s." - -msgid "Unsupported BMFont texture format." -msgstr "Nicht unterstütztes BMFont-Texturformat." - -msgid "Invalid BMFont block type." -msgstr "Ungültiger BMFont-Blocktyp." - msgid "" "An incoming node's name clashes with %s already in the scene (presumably, " "from a more nested instance).\n" diff --git a/editor/translations/editor/el.po b/editor/translations/editor/el.po index ac93a2b748..284abe494a 100644 --- a/editor/translations/editor/el.po +++ b/editor/translations/editor/el.po @@ -1250,21 +1250,6 @@ msgstr "Χρυσοί Χορυγοί" msgid "Silver Sponsors" msgstr "Αργυροί Δωρητές" -msgid "Bronze Sponsors" -msgstr "Χάλκινοι Δωρητές" - -msgid "Mini Sponsors" -msgstr "Μικροί Χορηγοί" - -msgid "Gold Donors" -msgstr "Χρυσοί Δωρητές" - -msgid "Silver Donors" -msgstr "Αργυροί Δωρητές" - -msgid "Bronze Donors" -msgstr "Χάλκινοι Δωρητές" - msgid "Donors" msgstr "Δωρητές" @@ -2030,17 +2015,6 @@ msgstr "" "Έγινε απενεργοποίηση το προσθέτου '%s' για αποτροπή περαιτέρω προβλημάτων." msgid "" -"Unable to load addon script from path: '%s' Base type is not EditorPlugin." -msgstr "" -"Αδύνατη η φόρτωση δέσμης ενεργειών προσθέτου από τη διαδρομή: '%s'. Ο βασικός " -"τύπος δεν είναι το EditorPlugin." - -msgid "Unable to load addon script from path: '%s' Script is not in tool mode." -msgstr "" -"Αδύνατη η φόρτωση δέσμης ενεργειών προσθέτου από τη διαδρομή: '%s'. Δεν είναι " -"σε λειτουργία tool." - -msgid "" "Scene '%s' was automatically imported, so it can't be modified.\n" "To make changes to it, a new inherited scene can be created." msgstr "" @@ -2437,6 +2411,9 @@ msgstr "" msgid "Make Unique" msgstr "Κάνε μοναδικό" +msgid "Save As..." +msgstr "Αποθήκευση ως..." + msgid "Show in FileSystem" msgstr "Εμφάνιση στο Σύστημα Αρχείων" @@ -3129,9 +3106,6 @@ msgstr "Φόρτωσε υπάρχων πόρο στη μνήμη και επεξ msgid "Save the currently edited resource." msgstr "Αποθήκευσε το τρέχων επεξεργαζόμενο πόρο." -msgid "Save As..." -msgstr "Αποθήκευση ως..." - msgid "Copy Resource" msgstr "Αντιγραφή πόρου" diff --git a/editor/translations/editor/eo.po b/editor/translations/editor/eo.po index f3271c69be..53a70d77e7 100644 --- a/editor/translations/editor/eo.po +++ b/editor/translations/editor/eo.po @@ -980,21 +980,6 @@ msgstr "Oraj Sponsoroj" msgid "Silver Sponsors" msgstr "Arĝentaj Sponsoroj" -msgid "Bronze Sponsors" -msgstr "Bronzaj Sponsoroj" - -msgid "Mini Sponsors" -msgstr "Minisponsoroj" - -msgid "Gold Donors" -msgstr "Oraj Donacantoj" - -msgid "Silver Donors" -msgstr "Arĝentaj Donacantoj" - -msgid "Bronze Donors" -msgstr "Bronzaj Donacantoj" - msgid "Donors" msgstr "Donacantoj" @@ -1765,17 +1750,6 @@ msgstr "" "Malŝaltas la kromprogramon ĉe '%s' por malebligi pli erarojn." msgid "" -"Unable to load addon script from path: '%s' Base type is not EditorPlugin." -msgstr "" -"Ne eblas ŝargi kromprograman skripton ĉe dosierindiko: '%s'. Baza tipo ne " -"estas EditorPlugin." - -msgid "Unable to load addon script from path: '%s' Script is not in tool mode." -msgstr "" -"Ne eblas ŝargi kromprograman skripton ĉe dosierindiko: '%s'. Skripto ne estas " -"en ila reĝimo." - -msgid "" "Scene '%s' was automatically imported, so it can't be modified.\n" "To make changes to it, a new inherited scene can be created." msgstr "" @@ -2133,6 +2107,9 @@ msgstr "" msgid "Make Unique" msgstr "Farigi unikan" +msgid "Save As..." +msgstr "Konservi kiel..." + msgid "Show in FileSystem" msgstr "Montri en dosiersistemo" @@ -2707,9 +2684,6 @@ msgstr "Ŝargi ekzistantan risurcon el disko kaj redakti ĝin." msgid "Save the currently edited resource." msgstr "Konservi la aktuale redaktantan risurcon." -msgid "Save As..." -msgstr "Konservi kiel..." - msgid "Copy Resource" msgstr "Kopii risurcon" diff --git a/editor/translations/editor/es.po b/editor/translations/editor/es.po index 2f0ed0fa0b..43da30e3c1 100644 --- a/editor/translations/editor/es.po +++ b/editor/translations/editor/es.po @@ -122,12 +122,15 @@ # Jorge Julio Torres <jjulio.tlg.89@gmail.com>, 2023. # kxnzen <polcondalgarcia@gmail.com>, 2023. # simomi 073 <arcemoyanomanuel@gmail.com>, 2023. +# "Hendrick Y. Rodríguez V. (NoVa)" <theyuniorytrodriguez04@gmail.com>, 2023. +# Chimi <tximi.sysaad@gmail.com>, 2023. +# gallegonovato <fran-carro@hotmail.es>, 2023. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor interface\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-10-31 10:40+0000\n" +"PO-Revision-Date: 2023-11-29 23:13+0000\n" "Last-Translator: Javier Ocampos <xavier.ocampos@gmail.com>\n" "Language-Team: Spanish <https://hosted.weblate.org/projects/godot-engine/" "godot/es/>\n" @@ -136,7 +139,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.2-dev\n" +"X-Generator: Weblate 5.3-dev\n" msgid "Main Thread" msgstr "Hilo principal" @@ -2015,6 +2018,9 @@ msgstr "Desarrolladores" msgid "Authors" msgstr "Autores" +msgid "Patrons" +msgstr "Patrocinadores" + msgid "Platinum Sponsors" msgstr "Patrocinadores Platino" @@ -2024,20 +2030,17 @@ msgstr "Patrocinadores Oro" msgid "Silver Sponsors" msgstr "Patrocinadores Plata" -msgid "Bronze Sponsors" -msgstr "Patrocinadores Bronce" - -msgid "Mini Sponsors" -msgstr "Mini Patrocinadores" +msgid "Diamond Members" +msgstr "Miembros Diamante" -msgid "Gold Donors" -msgstr "Donantes Oro" +msgid "Titanium Members" +msgstr "Miembros Titanio" -msgid "Silver Donors" -msgstr "Donantes Plata" +msgid "Platinum Members" +msgstr "Miembros Platino" -msgid "Bronze Donors" -msgstr "Donantes Bronce" +msgid "Gold Members" +msgstr "Miembros Oro" msgid "Donors" msgstr "Donantes" @@ -2858,7 +2861,7 @@ msgid "Operators" msgstr "Operadores" msgid "Theme Properties" -msgstr "Propiedades del Tema" +msgstr "Propiedades del Theme" msgid "Colors" msgstr "Colores" @@ -2919,12 +2922,24 @@ msgstr "Descripciones de Métodos" msgid "Operator Descriptions" msgstr "Descripciones de Operador" +msgid "Metadata:" +msgstr "Metadata:" + msgid "Property:" msgstr "Propiedad:" +msgid "Method:" +msgstr "Método:" + msgid "Signal:" msgstr "Señal:" +msgid "Theme Item:" +msgstr "Ítem del Theme:" + +msgid "No description available." +msgstr "No hay descripción disponible." + msgid "%d match." msgstr "%d coincidencia." @@ -3535,17 +3550,6 @@ msgstr "" "Desactivar el addon en '%s' para prevenir mas errores." msgid "" -"Unable to load addon script from path: '%s' Base type is not EditorPlugin." -msgstr "" -"No se pudo cargar el script addon desde la ruta: '%s' El tipo de base no es " -"un EditorPlugin." - -msgid "Unable to load addon script from path: '%s' Script is not in tool mode." -msgstr "" -"No se pudo cargar el script addon desde la ruta: '%s' El script no está en " -"modo tool." - -msgid "" "Scene '%s' was automatically imported, so it can't be modified.\n" "To make changes to it, a new inherited scene can be created." msgstr "" @@ -3752,6 +3756,9 @@ msgstr "Herramientas" msgid "Orphan Resource Explorer..." msgstr "Explorador de Recursos Huérfanos..." +msgid "Upgrade Mesh Surfaces..." +msgstr "Actualizar Superficies de Malla..." + msgid "Reload Current Project" msgstr "Recargar proyecto actual" @@ -4070,6 +4077,12 @@ msgstr "" msgid "Assign..." msgstr "Asignar..." +msgid "Copy as Text" +msgstr "Copiar como Texto" + +msgid "Show Node in Tree" +msgstr "Mostrar Nodo en Árbol" + msgid "Invalid RID" msgstr "RID inválido" @@ -4158,6 +4171,9 @@ msgstr "Hacer Único" msgid "Make Unique (Recursive)" msgstr "Hacer Único (Recursivo)" +msgid "Save As..." +msgstr "Guardar como..." + msgid "Show in FileSystem" msgstr "Mostrar en Sistema de Archivos" @@ -4640,6 +4656,9 @@ msgstr "¿Eliminar preajuste '%s'?" msgid "Resources to exclude:" msgstr "Recursos a excluir:" +msgid "Resources to override export behavior:" +msgstr "Recursos para anular el comportamiento de exportación:" + msgid "Resources to export:" msgstr "Recursos a exportar:" @@ -4945,6 +4964,9 @@ msgstr "Duplicando carpeta:" msgid "New Inherited Scene" msgstr "Nueva Escena Heredada" +msgid "Set as Main Scene" +msgstr "Establecer como Escena Principal" + msgid "Open Scenes" msgstr "Abrir Escenas" @@ -5056,6 +5078,33 @@ msgstr "Renombrar..." msgid "Open in External Program" msgstr "Abrir en un Programa Externo" +msgid "Red" +msgstr "Rojo" + +msgid "Orange" +msgstr "Naranja" + +msgid "Yellow" +msgstr "Amarillo" + +msgid "Green" +msgstr "Verde" + +msgid "Teal" +msgstr "Verde Azulado" + +msgid "Blue" +msgstr "Azul" + +msgid "Purple" +msgstr "Morado" + +msgid "Pink" +msgstr "Rosa" + +msgid "Gray" +msgstr "Gris" + msgid "Go to previous selected folder/file." msgstr "Ir a la carpeta/archivo previamente seleccionado." @@ -5065,6 +5114,9 @@ msgstr "Ir a la siguiente carpeta/archivo seleccionado." msgid "Re-Scan Filesystem" msgstr "Re-escanear Sistema de Archivos" +msgid "Change Split Mode" +msgstr "Cambiar Modo de División" + msgid "Filter Files" msgstr "Filtrar Archivos" @@ -5689,15 +5741,6 @@ msgstr "Fuente TrueType/OpenType renderizada dinámicamente" msgid "Prerendered multichannel(+true) signed distance field" msgstr "Campo de distancia con signo preprocesado multicanal(+true)" -msgid "Can't load font texture:" -msgstr "No se puede cargar la textura de la fuente:" - -msgid "Image margin too big." -msgstr "Margen de imagen demasiado grande." - -msgid "Character margin too big." -msgstr "Margen de carácter demasiado grande." - msgid "Pre-Import Scene" msgstr "Pre-Importar Escena" @@ -6076,9 +6119,6 @@ msgstr "Cargar un recurso existente desde disco y editarlo." msgid "Save the currently edited resource." msgstr "Guardar el recurso editado actualmente." -msgid "Save As..." -msgstr "Guardar como..." - msgid "Extra resource options." msgstr "Opciones de recursos extra." @@ -6700,6 +6740,9 @@ msgstr "[Global] (crear)" msgid "Duplicated Animation Name:" msgstr "Nombre de Animación Duplicado:" +msgid "Onion skinning requires a RESET animation." +msgstr "Onion skinning requiere una animación RESET." + msgid "Play selected animation backwards from current pos. (A)" msgstr "" "Reproducir hacia atrás la animación seleccionada desde la posición actual (A)" @@ -7443,13 +7486,13 @@ msgid "Preview Canvas Scale" msgstr "Previsualizar Escala de Canvas" msgid "Project theme" -msgstr "Tema del proyecto" +msgstr "Theme del proyecto" msgid "Editor theme" msgstr "Editor de Theme" msgid "Default theme" -msgstr "Theme Predeterminado" +msgstr "Theme predeterminado" msgid "Preview Theme" msgstr "Vista Previa del Theme" @@ -7848,6 +7891,18 @@ msgstr "" "Cuando esta opción está activada, las formas, radios y velocidades de los " "objetos de evasión serán visibles en el proyecto en ejecución." +msgid "Debug CanvasItem Redraws" +msgstr "Depurar Redibujado de CanvasItems" + +msgid "" +"When this option is enabled, redraw requests of 2D objects will become " +"visible (as a short flash) in the running project.\n" +"This is useful to troubleshoot low processor mode." +msgstr "" +"Cuando se habilita esta opción, las solicitudes de redibujo de objetos 2D se " +"vuelven visibles (como un breve destello) en el proyecto en ejecución.\n" +"Esto es útil para solucionar problemas en el modo de procesador bajo." + msgid "Synchronize Scene Changes" msgstr "Sincronizar Cambios de Escena" @@ -8225,6 +8280,9 @@ msgstr "Crear Malla de Navegación" msgid "Create Debug Tangents" msgstr "Crear Tangentes de Depuración" +msgid "No mesh to unwrap." +msgstr "No hay malla que desenvolver." + msgid "" "Mesh cannot unwrap UVs because it does not belong to the edited scene. Make " "it unique first." @@ -8252,6 +8310,15 @@ msgstr "Desenvolver UV2" msgid "Contained Mesh is not of type ArrayMesh." msgstr "La Malla contenedora no es del tipo ArrayMesh." +msgid "Can't unwrap mesh with blend shapes." +msgstr "No se puede desenvolver la malla con formas de mezcla." + +msgid "Only triangles are supported for lightmap unwrap." +msgstr "Sólo se admiten triángulos para desenvolver lightmaps." + +msgid "Normals are required for lightmap unwrap." +msgstr "Las normales son necesarias para desenvolver lightmaps." + msgid "UV Unwrap failed, mesh may not be manifold?" msgstr "Fallo del UV Unwrap ¿la malla podría no ser múltiple?" @@ -9989,6 +10056,12 @@ msgstr "Crear LightOccluder2D" msgid "LightOccluder2D Preview" msgstr "Vista Previa de LightOccluder2D" +msgid "Can't convert a sprite from a foreign scene." +msgstr "No se puede convertir un sprite de una escena externa." + +msgid "Can't convert an empty sprite to mesh." +msgstr "No se puede convertir un sprite vacío en malla." + msgid "Can't convert a sprite using animation frames to mesh." msgstr "" "No se puede convertir en malla un sprite usando fotogramas de animación." @@ -13740,9 +13813,19 @@ msgstr "" "Desactivar \"editable_instance\" causará que todas las propiedades del nodo " "vuelvan a sus valores predeterminados." +msgid "" +"Enabling \"Load as Placeholder\" will disable \"Editable Children\" and cause " +"all properties of the node to be reverted to their default." +msgstr "" +"Al activar \"Cargar como Placeholder\" se desactivará \"Hijos editables\" y " +"todas las propiedades del nodo volverán a sus valores por defecto." + msgid "Make Local" msgstr "Crear Local" +msgid "Can't toggle unique name for nodes in subscene!" +msgstr "¡No se puede cambiar el nombre único de los nodos en la subescena!" + msgid "Enable Scene Unique Name(s)" msgstr "Activar Nombre(s) Único(s) de Escena" @@ -13794,16 +13877,6 @@ msgstr "Eliminar Nodo(s)" msgid "Change type of node(s)" msgstr "Cambiar tipo de nodo(s)" -msgid "Removing the node from variable \"%s\" on node \"%s\"." -msgstr "Quita el nodo de la variable \"%s\" en el nodo \"%s\"." - -msgid "" -"The node's new type is incompatible with an exported variable (expected %s, " -"but type is %s)." -msgstr "" -"El nuevo tipo de nodo es incompatible con el tipo de variable exportada (se " -"esperaba %s, pero el tipo es %s)." - msgid "This operation requires a single selected node." msgstr "Esta operación requiere un solo nodo seleccionado." @@ -13838,6 +13911,9 @@ msgstr "Limpiar Heredado" msgid "Editable Children" msgstr "Hijos Editables" +msgid "Load as Placeholder" +msgstr "Cargar como Placeholder" + msgid "Auto Expand to Selected" msgstr "Auto Expandir a Seleccionado" @@ -14138,6 +14214,65 @@ msgstr "El nombre '%s' es una palabra reservada del lenguaje del shader." msgid "Add Shader Global Parameter" msgstr "Añadir Parámetro Global en el Shader" +msgid "" +"This project uses meshes with an outdated mesh format from previous Godot " +"versions. The engine needs to update the format in order to use those meshes. " +"Please use the 'Upgrade Mesh Surfaces' tool from the 'Project > Tools' menu. " +"You can ignore this message and keep using outdated meshes, but keep in mind " +"that this leads to increased load times every time you load the project." +msgstr "" +"Este proyecto utiliza mallas con un formato obsoleto de versiones anteriores " +"de Godot. El motor necesita actualizar el formato para poder usar esas " +"mallas. Utiliza la herramienta ‘Actualizar Superficies de Malla’ del menú " +"‘Proyecto > Herramientas’. Puedes ignorar este mensaje y seguir utilizando " +"mallas obsoletas, pero ten en cuenta que esto conduce a tiempos de carga más " +"largos cada vez que carga el proyecto." + +msgid "" +"This project uses meshes with an outdated mesh format. Check the output log." +msgstr "" +"Este proyecto utiliza mallas con un formato obsoleto. Revisa el registro de " +"salida." + +msgid "Upgrading All Meshes in Project" +msgstr "Actualizar Todas las Mallas del Proyecto" + +msgid "Attempting to re-save " +msgstr "Intentando volver a guardar " + +msgid "Attempting to remove " +msgstr "Intentando eliminar " + +msgid "" +"The mesh format has changed in Godot 4.2, which affects both imported meshes " +"and meshes authored inside of Godot. The engine needs to update the format in " +"order to use those meshes.\n" +"\n" +"If your project predates Godot 4.2 and contains meshes, we recommend you run " +"this one time conversion tool. This update will restart the editor and may " +"take several minutes. Upgrading will make the meshes incompatible with " +"previous versions of Godot.\n" +"\n" +"You can still use your existing meshes as is. The engine will update each " +"mesh in memory, but the update will not be saved. Choosing this option will " +"lead to slower load times every time this project is loaded." +msgstr "" +"El formato de malla ha cambiado en Godot 4.2, lo que afecta tanto a las " +"mallas importadas como a las mallas creadas dentro de Godot. El motor " +"necesita actualizar el formato para poder usar esas mallas.\n" +"\n" +"Si tu proyecto es anterior a Godot 4.2 y contiene mallas, te recomendamos que " +"ejecutes esta herramienta de conversión única. Esta actualización reiniciará " +"el editor y puede tardar varios minutos. La actualización hará que las mallas " +"sean incompatibles con las versiones anteriores de Godot.\n" +"\n" +"Todavía puedes usar tus mallas existentes tal cual. El motor actualizará cada " +"malla en memoria, pero la actualización no se guardará. Elegir esta opción " +"provocará tiempos de carga más lentos cada vez que se cargue este proyecto." + +msgid "Restart & Upgrade" +msgstr "Reiniciar y Actualizar" + msgid "Make this panel floating in the screen %d." msgstr "Haz que este panel flote en pantalla %d." @@ -14166,6 +14301,9 @@ msgstr "Cambiar Radio Externo de Torus" msgid "Invalid type argument to convert(), use TYPE_* constants." msgstr "Tipo de argumento inválido para 'convert()', utiliza constantes TYPE_*." +msgid "Cannot resize array." +msgstr "No se puede redimensionar el array." + msgid "Step argument is zero!" msgstr "¡El argumento step es cero!" @@ -14194,6 +14332,9 @@ msgstr "" msgid "Invalid instance dictionary (invalid subclasses)" msgstr "El diccionario de instancias no es correcto (subclases erróneas)" +msgid "Cannot instantiate GDScript class." +msgstr "No se puede instanciar la clase GDScript." + msgid "Value of type '%s' can't provide a length." msgstr "El valor del tipo '%s' no puede proporcionar una longitud." @@ -14402,6 +14543,9 @@ msgstr "Trazar iluminación directa" msgid "Integrate indirect lighting" msgstr "Integrar iluminación indirecta" +msgid "Integrate indirect lighting %d%%" +msgstr "Integrar iluminación indirecta %d%%" + msgid "Baking lightprobes" msgstr "Bakear lightprobes" @@ -14823,6 +14967,9 @@ msgstr "No se ha podido ejecutar en el dispositivo." msgid "Exporting to Android when using C#/.NET is experimental." msgstr "Exportar a Android usando C#/.NET es una opción experimental." +msgid "Android architecture %s not supported in C# projects." +msgstr "Arquitectura Android %s no soportada en proyectos C#." + msgid "" "Android build template not installed in the project. Install it from the " "Project menu." @@ -14994,23 +15141,15 @@ msgstr "¡No se pudo escribir el archivo del paquete de expansión!" msgid "Building Android Project (gradle)" msgstr "Construir Proyecto Android (gradle)" -msgid "" -"Building of Android project failed, check output for the error. Alternatively " -"visit docs.godotengine.org for Android build documentation." +msgid "Building of Android project failed, check output for the error:" msgstr "" -"La compilación del proyecto Android ha fallado, comprueba la salida del " -"error. También puedes visitar docs.godotengine.org para ver la documentación " -"de compilación de Android." +"La construcción del proyecto Android falló, comprueba la salida del error:" msgid "Moving output" msgstr "Moviendo salida" -msgid "" -"Unable to copy and rename export file, check gradle project directory for " -"outputs." -msgstr "" -"No se puede copiar y renombrar el archivo de exportación, comprueba el " -"directorio del proyecto de gradle para ver los resultados." +msgid "Unable to copy and rename export file:" +msgstr "No se puede copiar y renombrar el archivo de exportación:" msgid "Package not found: \"%s\"." msgstr "Paquete no encontrado: \"%s\"." @@ -15087,6 +15226,12 @@ msgstr "" ".ipa sólo se puede construir en macOS. Salir del proyecto Xcode sin construir " "el paquete." +msgid "Exporting to iOS when using C#/.NET is experimental and requires macOS." +msgstr "La exportación a iOS con C#/.NET es experimental y requiere macOS." + +msgid "Exporting to iOS when using C#/.NET is experimental." +msgstr "La exportación a iOS con C#/.NET es experimental." + msgid "Identifier is missing." msgstr "Falta el identificador." @@ -15258,6 +15403,13 @@ msgid "App sandbox is required for App Store distribution." msgstr "" "Se requiere un sandbox de aplicación para la distribución en la App Store." +msgid "" +"'rcodesign' doesn't support signing applications with embedded dynamic " +"libraries (GDExtension or .NET)." +msgstr "" +"‘rcodesign’ no admite la firma de aplicaciones con bibliotecas dinámicas " +"incrustadas (GDExtension o .NET)." + msgid "Code signing is required for App Store distribution." msgstr "Se requiere la firma de código para la distribución en la App Store." @@ -15463,6 +15615,13 @@ msgstr "" "Las aplicaciones firmadas ad-hoc requieren la autorización 'Desactivar " "Validación de Librería' para cargar librerías dinámicas." +msgid "" +"'rcodesign' doesn't support signing applications with embedded dynamic " +"libraries." +msgstr "" +"‘rcodesign’ no admite la firma de aplicaciones con bibliotecas dinámicas " +"incrustadas." + msgid "Could not create entitlements file." msgstr "No se pudo crear el archivo de entitlements." @@ -15940,6 +16099,17 @@ msgstr "" "no está activada en el propio nodo TileMap." msgid "" +"The TileMap node is set as Y-sorted, but Y-sort is not enabled on any of the " +"TileMap's layers.\n" +"This may lead to unwanted behaviors, as a layer that is not Y-sorted will be " +"Y-sorted as a whole." +msgstr "" +"El nodo TileMap está configurado como ordenado en Y, pero el ordenado en Y no " +"está activado en ninguna de las capas del TileMap.\n" +"Esto puede dar lugar a comportamientos no deseados, ya que una capa que no " +"esté ordenada en Y se ordenará en Y en su totalidad." + +msgid "" "Isometric TileSet will likely not look as intended without Y-sort enabled for " "the TileMap and all of its layers." msgstr "" @@ -16596,6 +16766,14 @@ msgid "Automatically arrange selected nodes." msgstr "Ordena automáticamente los nodos seleccionados." msgid "" +"Labels with autowrapping enabled must have a custom minimum size configured " +"to work correctly inside a container." +msgstr "" +"Las etiquetas con el ajuste automático habilitado deben tener un tamaño " +"mínimo personalizado configurado para funcionar correctamente dentro de un " +"contenedor." + +msgid "" "The current font does not support rendering one or more characters used in " "this Label's text." msgstr "" @@ -16715,18 +16893,9 @@ msgid "" "Data from the original node is kept as a placeholder until this type of node " "is available again. It can hence be safely re-saved without risk of data loss." msgstr "" -"Los datos del nodo original se conservan como marcador de posición hasta que " -"este tipo de nodo vuelva a estar disponible. De este modo, pueden volver a " -"guardarse sin riesgo de pérdida de datos." - -msgid "" -"Setting node name '%s' to be unique within scene for '%s', but it's already " -"claimed by '%s'.\n" -"'%s' is no longer set as having a unique name." -msgstr "" -"Se está estableciendo el nombre del nodo '%s' para que sea único dentro de la " -"escena para '%s', pero ya está reclamado por '%s'.\n" -"'%s' ya no está establecido como un nombre único." +"Los datos del nodo original se conservan como placeholder hasta que este tipo " +"de nodo vuelva a estar disponible. De este modo, pueden volver a guardarse " +"sin riesgo de pérdida de datos." msgid "" "This node is marked as deprecated and will be removed in future versions.\n" @@ -16744,13 +16913,6 @@ msgstr "" "sufrir cambios importantes en futuras versiones." msgid "" -"Default Environment as specified in the project setting \"rendering/" -"environment/defaults/default_environment\" could not be loaded." -msgstr "" -"El entorno predeterminado especificado en la configuración del proyecto " -"\"rendering/environment/defaults/default_environment\" no se pudo cargar." - -msgid "" "ShaderGlobalsOverride is not active because another node of the same type is " "in the scene." msgstr "" @@ -16776,27 +16938,6 @@ msgstr "" "El tamaño del Viewport debe ser mayor o igual a 2 píxeles en ambas " "dimensiones para renderizar cualquier cosa." -msgid "Cannot open font from file: %s." -msgstr "No se puede abrir la fuente desde el archivo: %s." - -msgid "Version %d of BMFont is not supported (should be 3)." -msgstr "La versión %d de BMFont no es compatible (debería ser la 3)." - -msgid "Invalid BMFont info block size." -msgstr "Tamaño del bloque de información BMFont inválido." - -msgid "Invalid BMFont common block size." -msgstr "Tamaño de bloque común BMFont inválido." - -msgid "Can't load font texture: %s." -msgstr "No se puede cargar la textura de la fuente: %s." - -msgid "Unsupported BMFont texture format." -msgstr "Formato de textura BMFont no compatible." - -msgid "Invalid BMFont block type." -msgstr "Tipo de bloque BMFont inválido." - msgid "" "An incoming node's name clashes with %s already in the scene (presumably, " "from a more nested instance).\n" diff --git a/editor/translations/editor/es_AR.po b/editor/translations/editor/es_AR.po index aa13114e99..46a0ad286a 100644 --- a/editor/translations/editor/es_AR.po +++ b/editor/translations/editor/es_AR.po @@ -1096,21 +1096,6 @@ msgstr "Sponsors Oro" msgid "Silver Sponsors" msgstr "Sponsors Plata" -msgid "Bronze Sponsors" -msgstr "Sponsors Bronce" - -msgid "Mini Sponsors" -msgstr "Mini Sponsors" - -msgid "Gold Donors" -msgstr "Donantes Oro" - -msgid "Silver Donors" -msgstr "Donantes Plata" - -msgid "Bronze Donors" -msgstr "Donantes Bronce" - msgid "Donors" msgstr "Donantes" @@ -1955,17 +1940,6 @@ msgstr "" "Desactivando el addon en '%s' para prevenir nuevos errores." msgid "" -"Unable to load addon script from path: '%s' Base type is not EditorPlugin." -msgstr "" -"No se pudo cargar el script de addon desde la ruta: El tipo base de '%s' no " -"es EditorPlugin." - -msgid "Unable to load addon script from path: '%s' Script is not in tool mode." -msgstr "" -"No se pudo cargar el script de addon desde la ruta: El script '%s' no está en " -"modo tool." - -msgid "" "Scene '%s' was automatically imported, so it can't be modified.\n" "To make changes to it, a new inherited scene can be created." msgstr "" @@ -2381,6 +2355,9 @@ msgstr "Carga Rápida" msgid "Make Unique" msgstr "Convertir en Unico" +msgid "Save As..." +msgstr "Guardar Como..." + msgid "Show in FileSystem" msgstr "Mostrar en Sistema de Archivos" @@ -3239,9 +3216,6 @@ msgstr "Cargar un recurso existente desde disco y editarlo." msgid "Save the currently edited resource." msgstr "Guardar el recurso editado actualmente." -msgid "Save As..." -msgstr "Guardar Como..." - msgid "Extra resource options." msgstr "Opciones de recursos extra." @@ -7763,24 +7737,9 @@ msgstr "¡No se pudo escribir el archivo del paquete de expansión!" msgid "Building Android Project (gradle)" msgstr "Construir Proyecto Android (gradle)" -msgid "" -"Building of Android project failed, check output for the error. Alternatively " -"visit docs.godotengine.org for Android build documentation." -msgstr "" -"La construcción del proyecto Android falló, comprueba la salida del error. " -"También podés visitar docs.godotengine.org para consultar la documentación de " -"compilación de Android." - msgid "Moving output" msgstr "Moviendo salida" -msgid "" -"Unable to copy and rename export file, check gradle project directory for " -"outputs." -msgstr "" -"No se puede copiar y renombrar el archivo de exportación, comprobá el " -"directorio del proyecto de gradle para ver los resultados." - msgid "Creating APK..." msgstr "Creando APK..." diff --git a/editor/translations/editor/et.po b/editor/translations/editor/et.po index 89d948fbf3..b9d9d01aca 100644 --- a/editor/translations/editor/et.po +++ b/editor/translations/editor/et.po @@ -1105,21 +1105,6 @@ msgstr "Kuldsponsorid" msgid "Silver Sponsors" msgstr "Hõbesponsorid" -msgid "Bronze Sponsors" -msgstr "Pronkssponsorid" - -msgid "Mini Sponsors" -msgstr "Väikesponsorid" - -msgid "Gold Donors" -msgstr "Kuldannetajad" - -msgid "Silver Donors" -msgstr "Hõbennetajad" - -msgid "Bronze Donors" -msgstr "Pronksannetajad" - msgid "Donors" msgstr "Annetajad" @@ -2303,17 +2288,6 @@ msgstr "" "Lisandmooduli keelamine aadressil '%s', et vältida edasisi vigu." msgid "" -"Unable to load addon script from path: '%s' Base type is not EditorPlugin." -msgstr "" -"Lisa-skripti ei olnud võimalik laadida teelt: '%s'. Baastüüp ei ole " -"EditorPlugin." - -msgid "Unable to load addon script from path: '%s' Script is not in tool mode." -msgstr "" -"Lisa-skripti ei olnud võimalik laadida teelt: '%s'. Skript ei ole tööriista " -"režiimis." - -msgid "" "Scene '%s' was automatically imported, so it can't be modified.\n" "To make changes to it, a new inherited scene can be created." msgstr "" @@ -2844,6 +2818,9 @@ msgstr "Tee Unikaalseks" msgid "Make Unique (Recursive)" msgstr "Tee Unikaalseks (Rekursiivselt)" +msgid "Save As..." +msgstr "Salvesta kui..." + msgid "Show in FileSystem" msgstr "Kuva failisüsteemis" @@ -4165,12 +4142,6 @@ msgstr "" msgid "Dynamically rendered TrueType/OpenType font" msgstr "Dünaamiliselt renderdatud TrueType/OpenType font" -msgid "Can't load font texture:" -msgstr "Fondi tekstuuri ei saa laadida:" - -msgid "Image margin too big." -msgstr "Pildi veeris liiga suur." - msgid "Pre-Import Scene" msgstr "Eel-Impordi Stseen" @@ -4450,9 +4421,6 @@ msgstr "Lae olemasolev resurss kettalt ning redigeeri seda." msgid "Save the currently edited resource." msgstr "Salvesta käesolevalt muudetud ressurss." -msgid "Save As..." -msgstr "Salvesta kui..." - msgid "Extra resource options." msgstr "Ekstra resursi valikud." @@ -9861,12 +9829,6 @@ msgstr "Sisesta Juhtmärk" msgid "(Other)" msgstr "(Muu)" -msgid "Cannot open font from file: %s." -msgstr "Fonti ei saa avada failist: %s." - -msgid "Invalid BMFont block type." -msgstr "Vale BMFont-ploki tüüp." - msgid "Invalid source for preview." msgstr "Vigane eelvaate lähe." diff --git a/editor/translations/editor/fa.po b/editor/translations/editor/fa.po index ad450f928c..4ee54eb7e4 100644 --- a/editor/translations/editor/fa.po +++ b/editor/translations/editor/fa.po @@ -48,7 +48,7 @@ msgstr "" "Project-Id-Version: Godot Engine editor interface\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-09-25 08:36+0000\n" +"PO-Revision-Date: 2023-11-26 13:51+0000\n" "Last-Translator: John Smith <pkafsharix@gmail.com>\n" "Language-Team: Persian <https://hosted.weblate.org/projects/godot-engine/" "godot/fa/>\n" @@ -57,7 +57,10 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 5.1-dev\n" +"X-Generator: Weblate 5.2.1-rc\n" + +msgid "Main Thread" +msgstr "موضوع اصلی" msgid "Unset" msgstr "تنظیم نشده" @@ -576,6 +579,15 @@ msgstr "لغو انتخاب کلیدها" msgid "Animation Change Transition" msgstr "انتقال تغییر انیمیشن" +msgid "Animation Change Position3D" +msgstr "تغییر انیمیشن مختصات سه بعدی" + +msgid "Animation Change Rotation3D" +msgstr "تغییر انیمیشن چرخش سه بعدی" + +msgid "Animation Change Scale3D" +msgstr "تغییر انیمیشن ابعاد سه بعدی" + msgid "Animation Change Keyframe Value" msgstr "تغییر مقدار لحظهکلید انیمیشن" @@ -585,6 +597,15 @@ msgstr "تغییر فراخوان انیمیشن" msgid "Animation Multi Change Transition" msgstr "انیمیشن انتقال چند تغییر" +msgid "Animation Multi Change Position3D" +msgstr "تغییرات انیمیشن مختصات سه بعدی" + +msgid "Animation Multi Change Rotation3D" +msgstr "تغییرات انیمیشن چرخش سه بعدی" + +msgid "Animation Multi Change Scale3D" +msgstr "تغییرات انیمیشن ابعاد سه بعدی" + msgid "Animation Multi Change Keyframe Value" msgstr "تغییرات مقدار لحظه کلید انیمیشن" @@ -796,6 +817,10 @@ msgstr "" msgid "Remove Anim Track" msgstr "حذف ترک انیمیشن" +msgid "Hold Shift when clicking the key icon to skip this dialog." +msgstr "" +"هنگام کلیک کردن روی نماد، کلید Shift را نگه دارید تا از این گفتگو رد شوید." + msgid "Create new track for %s and insert key?" msgstr "یک مسیر جدید برای %s بساز و کلید را درج کن؟" @@ -874,6 +899,9 @@ msgstr "افزودن کلید اندازه" msgid "Add Track Key" msgstr "افزودن کلید ترک" +msgid "Track path is invalid, so can't add a method key." +msgstr "مسیر نامعتبر است، پس نمیتوان کلید تابعی (متد) اضافه کرد." + msgid "Add Method Track Key" msgstr "افزودن تابع کلید میسر" @@ -910,10 +938,56 @@ msgstr "حافظه پنهان خالی است!" msgid "Paste Tracks" msgstr "جاگذاری مسیر ها" +msgid "Animation Scale Keys" +msgstr "انیمیشن اندازه ی کلید ها" + +msgid "Make Easing Keys" +msgstr "ساخت کلید تسهیل" + msgid "" "This option does not work for Bezier editing, as it's only a single track." msgstr "این گزینه برای اصلاح بِزیِر کار نمی کند, چون تنها یک مسیر واحد است." +msgid "Animation Add RESET Keys" +msgstr "اضافه کردن کلید های تنظیم مجدد (reset) انیمیشن" + +msgid "Bake Animation as Linear Keys" +msgstr "محاسبه پیش از اجرای انیمیشن به عنوان کلیدهای خطی" + +msgid "" +"This animation belongs to an imported scene, so changes to imported tracks " +"will not be saved.\n" +"\n" +"To modify this animation, navigate to the scene's Advanced Import settings " +"and select the animation.\n" +"Some options, including looping, are available here. To add custom tracks, " +"enable \"Save To File\" and\n" +"\"Keep Custom Tracks\"." +msgstr "" +"این انیمیشن متعلق به یک صحنه ورودی است, بنابراین تغییرات در مسیرهای ورودی " +"ذخیره نمیشوند.\n" +"\n" +"برای امکان اضافه کردن مسیر های سفارشی, به تنظیمات ورودی صحنه بروید و انیمیشن " +"را انتخاب کنید.\n" +"برخی گزینه ها مانند تکرار اینجا موجود هستند.برای اضافه کردن مسیر های " +"سفارشی(Custom)\"ذخیره در فایل\" و \"نگه داشتن مسیر های سفارشی\" را\n" +"فعال کنید." + +msgid "" +"Some AnimationPlayerEditor's options are disabled since this is the dummy " +"AnimationPlayer for preview.\n" +"\n" +"The dummy player is forced active, non-deterministic and doesn't have the " +"root motion track. Furthermore, the original node is inactive temporary." +msgstr "" +"تعدادی از گزینه های ویرایشگر پخش کننده ی انیمیشن غیر فعال هستند زیرا این پخش " +"کننده ی انیمیشن ساختگی، برای پیش نمایش است.\n" +"پخش کننده ی ساختگی به اجبار فعال و غیر قطعی است و مسیر حرکتی ریشه را ندارد. " +"علاوه بر این، گره ی اصلی به طور موقت غیر فعال است." + +msgid "AnimationPlayer is inactive. The playback will not be processed." +msgstr "پخش کننده ی انیمیشن غیر فعال است. پخش پردازش نخواهد شد." + msgid "Select an AnimationPlayer node to create and edit animations." msgstr "یک گره AnimationPlayer را برای ایجاد و ویرایش انیمیشن ها برگزینید." @@ -923,6 +997,21 @@ msgstr "صحنه ی وارد شده" msgid "Warning: Editing imported animation" msgstr "هشدار: در حال ویرایش انیمیشن وارد شده" +msgid "Dummy Player" +msgstr "پخش کننده ی ساختگی" + +msgid "Warning: Editing dummy AnimationPlayer" +msgstr "هشدار: در حال ویرایش پخش کننده ی انیمیشن ساختگی" + +msgid "Inactive Player" +msgstr "پخش کننده ی غیر فعال" + +msgid "Warning: AnimationPlayer is inactive" +msgstr "هشدار: پخش کننده ی انیمیشن غیر فعال است" + +msgid "Toggle between the bezier curve editor and track editor." +msgstr "بین ویرایشگر منحنی bezier و ویرایشگر مسیر جابهجا شوید." + msgid "Only show tracks from nodes selected in tree." msgstr "فقط مسیرهای از گره های انتخاب شده در درخت نشان داده شود." @@ -957,6 +1046,9 @@ msgstr "انتخاب شده را تغییر مقیاس بده" msgid "Scale From Cursor" msgstr "از مکاننما تغییر مقیاس بده" +msgid "Make Easing Selection" +msgstr "ساخت تسهیل برگزیده" + msgid "Duplicate Selection" msgstr "تکثیر برگزیده" @@ -975,12 +1067,36 @@ msgstr "برو به گام پیشین" msgid "Apply Reset" msgstr "بازنشانی را اعمال کنید" +msgid "Bake Animation" +msgstr "از پیش تعیین کردن انیمیشن" + +msgid "Optimize Animation (no undo)" +msgstr "بهینه سازی انیمیشن (بازگردانی نمیشود)" + +msgid "Clean-Up Animation (no undo)" +msgstr "پاک سازی انیمیشن (بازگردانی نمیشود)" + +msgid "Pick a node to animate:" +msgstr "گره را برای انیمیت کردن انتخاب کنید:" + msgid "Use Bezier Curves" msgstr "بکارگیری منحنی بِزیِر" msgid "Create RESET Track(s)" msgstr "ایجاد آهنگ (های) بازنشانی" +msgid "Animation Optimizer" +msgstr "بهینهساز انیمیشن" + +msgid "Max Velocity Error:" +msgstr "خطای Max Velocity:" + +msgid "Max Angular Error:" +msgstr "خطای Max Angular:" + +msgid "Max Precision Error:" +msgstr "خطای Max Precision:" + msgid "Optimize" msgstr "بهینهسازی کن" @@ -994,7 +1110,7 @@ msgid "Clean-up all animations" msgstr "تمام انیمیشنها را پاکسازی کن" msgid "Clean-Up Animation(s) (NO UNDO!)" -msgstr "انیمیشن(ها) را پاکسازی کن (نه UNDO !)" +msgstr "انیمیشن(ها) را پاکسازی کن (بدون بازگردانی !)" msgid "Clean-Up" msgstr "پاکسازی" @@ -1002,6 +1118,13 @@ msgstr "پاکسازی" msgid "Scale Ratio:" msgstr "نسبت تغییر مقیاس:" +msgid "Select Transition and Easing" +msgstr "انتخاب انتقال و تسهیل دهنده" + +msgctxt "Transition Type" +msgid "Linear" +msgstr "خطی" + msgctxt "Transition Type" msgid "Sine" msgstr "سینوس" @@ -1019,27 +1142,79 @@ msgid "Quad" msgstr "چهارگوش" msgctxt "Transition Type" +msgid "Expo" +msgstr "نمایی (Expo)" + +msgctxt "Transition Type" msgid "Elastic" msgstr "کشسان" msgctxt "Transition Type" +msgid "Cubic" +msgstr "مکعبی" + +msgctxt "Transition Type" msgid "Circ" -msgstr "دایره" +msgstr "دایره ای" msgctxt "Transition Type" msgid "Bounce" msgstr "پرش" msgctxt "Transition Type" +msgid "Back" +msgstr "عقب" + +msgctxt "Transition Type" msgid "Spring" msgstr "فنر" +msgctxt "Ease Type" +msgid "In" +msgstr "ورود" + +msgctxt "Ease Type" +msgid "Out" +msgstr "خروج" + +msgctxt "Ease Type" +msgid "InOut" +msgstr "ورود و خروج" + +msgctxt "Ease Type" +msgid "OutIn" +msgstr "خروج و ورود" + +msgid "Transition Type:" +msgstr "نوع انتقال:" + +msgid "Ease Type:" +msgstr "نوع سهول:" + +msgid "FPS:" +msgstr "FPS:" + +msgid "Animation Baker" +msgstr "از پیش تعیین کننده انیمیشن" + +msgid "3D Pos/Rot/Scl Track:" +msgstr "مسیر مکان/چرخش/مقیاس سهبعدی:" + +msgid "Blendshape Track:" +msgstr "مسیر BlendShape:" + +msgid "Value Track:" +msgstr "مسیر مقدار:" + msgid "Select Tracks to Copy" -msgstr "انتخاب میسرها جهت تکثیر" +msgstr "انتخاب میسرها جهت کپی" msgid "Select All/None" msgstr "انتخاب همه/هیچ" +msgid "Animation Change Keyframe Time" +msgstr "تغییر زمان کلید فریم انیمیشن" + msgid "Add Audio Track Clip" msgstr "افزودن کلیپ آهنگ صوتی" @@ -1058,21 +1233,24 @@ msgstr "شماره خط:" msgid "%d replaced." msgstr "%d جایگزین شده." +msgid "No match" +msgstr "بدون مطابقت" + msgid "%d match" msgid_plural "%d matches" -msgstr[0] "%d نظیر" -msgstr[1] "%d نظیر" +msgstr[0] "%d مطابقت" +msgstr[1] "%d مطابقت ها" msgid "%d of %d match" msgid_plural "%d of %d matches" -msgstr[0] "%d نظیر" -msgstr[1] "%d نظیر" +msgstr[0] "%d از %d مطابقت" +msgstr[1] "%d از %d مطابقت ها" msgid "Match Case" -msgstr "بین حروف کوچک و بزرگ لاتین تمایز قائل شو" +msgstr "تطابق بزرگی حروف" msgid "Whole Words" -msgstr "عین کلمات (بدون هیچ کم و کاستی)" +msgstr "کل کلمات" msgid "Replace" msgstr "جایگزینی" @@ -1083,8 +1261,16 @@ msgstr "جایگزینی همه" msgid "Selection Only" msgstr "تنها در قسمت انتخاب شده" +msgctxt "Indentation" +msgid "Spaces" +msgstr "جاهای خالی" + +msgctxt "Indentation" +msgid "Tabs" +msgstr "Tabs" + msgid "Toggle Scripts Panel" -msgstr "تغییر پانل اسکریپت ها" +msgstr "تغییر پنل اسکریپت ها" msgid "Zoom In" msgstr "بزرگنمایی" @@ -1165,6 +1351,9 @@ msgstr "آرگومانهای اضافی فراخوانی:" msgid "Allows to drop arguments sent by signal emitter." msgstr "اجازه میدهد تا آرگومانهای ارسال شده توسط فرستنده سیگنال را رها کنید." +msgid "Unbind Signal Arguments:" +msgstr "آرگومانهای سیگنال Unbind:" + msgid "Receiver Method:" msgstr "روش گیرنده:" @@ -1240,6 +1429,9 @@ msgstr "کپی نام" msgid "Edit..." msgstr "ویرایش..." +msgid "Go to Method" +msgstr "برو به متد" + msgid "Change Type of \"%s\"" msgstr "تغییر نوع \"%s\"" @@ -1279,6 +1471,9 @@ msgstr "تطبیقها:" msgid "Description:" msgstr "توضیح:" +msgid "Remote %s:" +msgstr "ریموت%s:" + msgid "Debugger" msgstr "اشکال زدا" @@ -1315,6 +1510,12 @@ msgstr "همگامسازی سرصفحهها" msgid "Getting remote file system" msgstr "دریافت سیستم فایل از راه دور" +msgid "Decompressing remote file system" +msgstr "در حال باز کردن(Decompress)سیستم فایل ریموت" + +msgid "Scanning for local changes" +msgstr "در حال اسکن برای تغييرات محلی" + msgid "Sending list of changed files:" msgstr "ارسال فهرست فایلهای تغییر یافته:" @@ -1348,6 +1549,9 @@ msgstr "پاک کردن" msgid "Measure:" msgstr "اندازه گیری:" +msgid "Frame Time (ms)" +msgstr "زمان فریم (ms)" + msgid "Average Time (ms)" msgstr "زمان متوسط (میلیثانیه)" @@ -1357,9 +1561,27 @@ msgstr "فریم %" msgid "Physics Frame %" msgstr "% فریم فیزیک" +msgid "Inclusive" +msgstr "تمام وقت" + msgid "Self" msgstr "خود" +msgid "" +"Inclusive: Includes time from other functions called by this function.\n" +"Use this to spot bottlenecks.\n" +"\n" +"Self: Only count the time spent in the function itself, not in other " +"functions called by that function.\n" +"Use this to find individual functions to optimize." +msgstr "" +"تمام وقت: شامل زمان از توابع دیگر فراخوانده شده توسط این تابع\n" +"استفاده کن از این برای پیدا کردن bottleneck ها\n" +"\n" +"خود:فقط زمانی را می شمارد که درون خود توابع صرف شده نه در توابع دیگر " +"فراخوانده شده توسط آن تابع.\n" +"استفاده کن از این برای پیدا کردن توابع تکی برای بهینه سازی." + msgid "Frame #:" msgstr "فریم #:" @@ -1372,9 +1594,18 @@ msgstr "زمان" msgid "Calls" msgstr "فراخوانیها" +msgid "Fit to Frame" +msgstr "جا کردن در تصویر" + msgid "Linked" msgstr "پیوند داده شده" +msgid "CPU" +msgstr "پردازنده (CPU)" + +msgid "GPU" +msgstr "واحد پردازش گرافیکی (GPU)" + msgid "Execution resumed." msgstr "راهاندازی از سر گرفته شد." @@ -1384,24 +1615,84 @@ msgstr "بایتها:" msgid "Warning:" msgstr "هشدار:" +msgid "Error:" +msgstr "خطا:" + +msgid "%s Error" +msgstr "خطای %s" + +msgid "%s Error:" +msgstr "خطای %s:" + +msgid "%s Source" +msgstr "منبع %s" + +msgid "%s Source:" +msgstr "منبع %s:" + +msgid "Stack Trace" +msgstr "ردیابی پشته(Stack Trace)" + +msgid "Stack Trace:" +msgstr "ردیابی پشته(Stack Trace):" + +msgid "Debug session started." +msgstr "نشست اشکال زدایی شزوع شد." + +msgid "Debug session closed." +msgstr "نشست اشکال زدایی بسته شد." + +msgid "Line %d" +msgstr "خط %d" + +msgid "Delete Breakpoint" +msgstr "حذف Breakpoint" + +msgid "Delete All Breakpoints in:" +msgstr "تمام Breakpoints ها را حذف کن در:" + +msgid "Delete All Breakpoints" +msgstr "حذف تمام Breakpoint ها" + msgid "Copy Error" -msgstr "خطای کپی" +msgstr "کپی خطا" msgid "Open C++ Source on GitHub" msgstr "بازکردن منبع C++ در گیتهاب" +msgid "C++ Source" +msgstr "منبع C++" + msgid "Video RAM" msgstr "ویدئو رم" +msgid "Skip Breakpoints" +msgstr "ردکردن Breakpoint ها" + +msgid "Step Into" +msgstr "قدم به درون" + +msgid "Step Over" +msgstr "قدم برداشتن" + msgid "Break" -msgstr "Break" +msgstr "وقفه" msgid "Continue" msgstr "ادامه" +msgid "Thread:" +msgstr "نخ:" + msgid "Stack Frames" msgstr "روی هم چیدن فریمها" +msgid "Filter Stack Variables" +msgstr "فیلتر متغیر های پشته" + +msgid "Breakpoints" +msgstr "مکان های وقفه" + msgid "Expand All" msgstr "بسط دادن همه" @@ -1411,12 +1702,18 @@ msgstr "بستن همه" msgid "Profiler" msgstr "پروفایلر" +msgid "Visual Profiler" +msgstr "پروفایلر دیداری" + msgid "List of Video Memory Usage by Resource:" msgstr "فهرست استفاده از حافظه ویدئویی بر اساس منبع:" msgid "Total:" msgstr "کل:" +msgid "Export list to a CSV file" +msgstr "صدور لیست در یک فایل CSV" + msgid "Resource Path" msgstr "مسیر منبع" @@ -1427,7 +1724,7 @@ msgid "Format" msgstr "قالب" msgid "Usage" -msgstr "کاربرد:" +msgstr "استفاده" msgid "Misc" msgstr "متفرقه" @@ -1438,6 +1735,15 @@ msgstr "کنترل کلیکشده:" msgid "Clicked Control Type:" msgstr "گونهٔ کنترل کلیکشده:" +msgid "Live Edit Root:" +msgstr "ویرایش زنده Root:" + +msgid "Set From Tree" +msgstr "تنظیم از Tree" + +msgid "Export measures as CSV" +msgstr "صدور اندازه ها بعنوان CSV" + msgid "Search Replacement For:" msgstr "جستجوی جایگزین برای:" @@ -1479,9 +1785,23 @@ msgstr "ویرایشگر بستگی" msgid "Search Replacement Resource:" msgstr "منبع جایگزینی را جستجو کن:" +msgid "Open Scene" +msgid_plural "Open Scenes" +msgstr[0] "باز کردن صحنه" +msgstr[1] "باز کردن صحنه ها" + msgid "Open" msgstr "باز کن" +msgid "Owners of: %s (Total: %d)" +msgstr "صاحبان: %s (کل: %d)" + +msgid "Localization remap" +msgstr "بومیسازی مجدد" + +msgid "Localization remap for path '%s' and locale '%s'." +msgstr "بومی سازی مجدد برای مسیر '%s' و بومی '%s'." + msgid "" "Remove the selected files from the project? (Cannot be undone.)\n" "Depending on your filesystem configuration, the files will either be moved to " @@ -1539,6 +1859,24 @@ msgstr "اموال" msgid "Resources Without Explicit Ownership:" msgstr "منابع بدون مالکیت صریح:" +msgid "Folder name cannot be empty." +msgstr "نام پوشه نمیتواند خالی باشد." + +msgid "Folder name contains invalid characters." +msgstr "نام پوشه شامل کاراکترهای نامعتبر است." + +msgid "Folder name cannot begin or end with a space." +msgstr "نام پوشه نمیتواند با جای خالی شروع یا تمام شود." + +msgid "Folder name cannot begin with a dot." +msgstr "نام پوشه نمیتواند با نقطه شروع شود." + +msgid "File with that name already exists." +msgstr "فایل با این نام در حال حاضر وجود دارد." + +msgid "Folder with that name already exists." +msgstr "پوشه با این نام در حال حاضر وجود دارد." + msgid "Using slashes in folder names will create subfolders recursively." msgstr "" "استفاده از خط مورب در نام پوشهها، زیرپوشهها را به صورت بازگشتی ایجاد میکند." @@ -1546,11 +1884,17 @@ msgstr "" msgid "Could not create folder." msgstr "ناتوان در ساختن پوشه." +msgid "Create new folder in %s:" +msgstr "ساخت پوشه جدید در %s:" + msgid "Create Folder" -msgstr "ایجاد پوشه" +msgstr "ساخت پوشه" + +msgid "Folder name is valid." +msgstr "نام پوشه معتبر است." msgid "Thanks from the Godot community!" -msgstr "با تشکر از سوی جامعهٔ گودو!" +msgstr "با تشکر از سوی جامعهٔ گودوت!" msgid "Click to copy." msgstr "برای کپی کردن کلیک کنید." @@ -1564,12 +1908,19 @@ msgstr "بنیانگذاران پروژه" msgid "Lead Developer" msgstr "توسعهدهندهی اصلی" +msgctxt "Job Title" +msgid "Project Manager" +msgstr "مدیر پروژه" + msgid "Developers" msgstr "توسعه دهندگان" msgid "Authors" msgstr "مؤلفان" +msgid "Patrons" +msgstr "حامی" + msgid "Platinum Sponsors" msgstr "حامیان پلاتینیومی" @@ -1579,20 +1930,17 @@ msgstr "حامیان طلایی" msgid "Silver Sponsors" msgstr "حامیان نقره ای" -msgid "Bronze Sponsors" -msgstr "حامیان برنزی" - -msgid "Mini Sponsors" -msgstr "حامیان مینی" +msgid "Diamond Members" +msgstr "اعضای الماسی" -msgid "Gold Donors" -msgstr "اهدا کنندگان طلایی" +msgid "Titanium Members" +msgstr "اعضای تیتانیومی" -msgid "Silver Donors" -msgstr "اهدا کنندگان نقرهای" +msgid "Platinum Members" +msgstr "اعضای پلاتینیومی" -msgid "Bronze Donors" -msgstr "اهدا کنندگان برنزی" +msgid "Gold Members" +msgstr "اعضای طلایی" msgid "Donors" msgstr "اهدا کنندگان" @@ -1629,8 +1977,22 @@ msgstr "خطا در گشودن پروندهٔ دارایی برای «%s» (در msgid "%s (already exists)" msgstr "\"%s\" (در حال حاضر موجود است)" +msgid "%d file conflicts with your project and won't be installed" +msgid_plural "%d files conflict with your project and won't be installed" +msgstr[0] "فایل %d با پروژه شما در مغایرت است و نصب نمی شود" +msgstr[1] "فایل های %d با پروژه شما در مغایرت است و نصب نمی شود" + +msgid "This asset doesn't have a root directory, so it can't be ignored." +msgstr "این Asset یک مسیر Root ندارد پس نمیتوان آن را نادیده گرفت." + +msgid "Ignore the root directory when extracting files." +msgstr "هنگام استخراج فایل ها مسیر Root را نادیده بگیر." + +msgid "Select Install Folder" +msgstr "پوشه نصب را انتخاب کنید" + msgid "Uncompressing Assets" -msgstr "استخراج داراییها" +msgstr "استخراج Asset ها" msgid "The following files failed extraction from asset \"%s\":" msgstr "استخراج پروندههای زیر از دارایی «%s» شکست خورد:" @@ -1639,11 +2001,42 @@ msgid "(and %s more files)" msgstr "(و %s دیگر فایل ها)" msgid "Asset \"%s\" installed successfully!" -msgstr "دارایی «%s» با موفقیت نصب شد!" +msgstr "Asset ه \"%s\" با موفقیت نصب شد!" msgid "Success!" msgstr "موفقیت!" +msgid "Asset:" +msgstr "Asset:" + +msgid "Open the list of the asset contents and select which files to install." +msgstr "باز کردنه لیست محتوا Asset ها و انتخاب فایل ها را برای نصب." + +msgid "Change Install Folder" +msgstr "تغییر پوشه نصب" + +msgid "" +"Change the folder where the contents of the asset are going to be installed." +msgstr "تغییر پوشه ای که محتوای Asset در آن نصب خواهد شد." + +msgid "Ignore asset root" +msgstr "نادیده گرفتن Root ه Asset" + +msgid "No files conflict with your project" +msgstr "هیچ فایلی با پروژه شما در مغایرت نیست" + +msgid "Show contents of the asset and conflicting files." +msgstr "نشان دادن محتوای Asset و فایل های در مغایرت." + +msgid "Contents of the asset:" +msgstr "محتوای Asset:" + +msgid "Installation preview:" +msgstr "پیشنمایش نصب:" + +msgid "Configure Asset Before Installing" +msgstr "تنظیم کردن Asset قبل از نصب کردن" + msgid "Install" msgstr "نصب کردن" @@ -1695,6 +2088,12 @@ msgstr "گذرگاه فرعی" msgid "Bus Options" msgstr "گزینه های اتوبوس" +msgid "Duplicate Bus" +msgstr "تکثیر کردن Bus" + +msgid "Delete Bus" +msgstr "حذف Bus" + msgid "Reset Volume" msgstr "بازنشانی حجم" @@ -1702,34 +2101,37 @@ msgid "Delete Effect" msgstr "حذف جلوه" msgid "Add Audio Bus" -msgstr "افزودن گذرگاه صدا" +msgstr "افزودن Bus صدا" msgid "Master bus can't be deleted!" -msgstr "گذرگاه اصلی قابل حذف نیست!" +msgstr "Bus اصلی قابل حذف نیست!" msgid "Delete Audio Bus" -msgstr "حذف گذرگاه صدا" +msgstr "حذف Bus صدا" msgid "Duplicate Audio Bus" -msgstr "تکثیر صدای خطی" +msgstr "تکثیر Bus صدا" msgid "Reset Bus Volume" -msgstr "بازنشانی مقدار خطی" +msgstr "بازنشانی مقدار Bus" msgid "Move Audio Bus" -msgstr "انتقال صدای خطی" +msgstr "انتقال Bus صدا" msgid "Save Audio Bus Layout As..." -msgstr "ذخیره طرح اتوبوس صوتی به عنوان ..." +msgstr "ذخیره چیدمان Bus صوتی به عنوان ..." msgid "Location for New Layout..." -msgstr "مکان برای طرح جدید ..." +msgstr "مکان برای چیدمان جدید ..." msgid "Open Audio Bus Layout" -msgstr "چیدمان اتوبوس صوتی را باز کنید" +msgstr "بار کردن چیدمان Bus صوتی" msgid "There is no '%s' file." -msgstr "پرونده '٪ s' وجود ندارد." +msgstr "فایل '%s' وجود ندارد." + +msgid "Layout:" +msgstr "چیدمان:" msgid "Invalid file, not an audio bus layout." msgstr "پرونده نامعتبر است ، نه طرح اتوبوس صوتی." @@ -1764,6 +2166,9 @@ msgstr "طرح پیش فرض اتوبوس را بارگیری کنید." msgid "Create a new Bus Layout." msgstr "طرح جدید اتوبوس ایجاد کنید." +msgid "Audio Bus Layout" +msgstr "چیدمان Bus صوتی" + msgid "Invalid name." msgstr "نام نامعتبر." @@ -1776,36 +2181,51 @@ msgstr "کاراکترهای معتبر:" msgid "Must not collide with an existing engine class name." msgstr "نباید با یک نام کلاس موتور موجود برخورد کند." +msgid "Must not collide with an existing global script class name." +msgstr "نباید با نام یک کلاس سراسری موجود برخوردی کند." + msgid "Must not collide with an existing built-in type name." msgstr "نباید با یک نام نوع درون-ساز موجود برخورد کند." msgid "Must not collide with an existing global constant name." msgstr "نباید با نام یک ثابت سراسری موجود برخوردی کند." +msgid "Keyword cannot be used as an Autoload name." +msgstr "کلمه کلیدی نمی تواند به عنوان یک نام خودبارگیر بکار برده شود." + msgid "Autoload '%s' already exists!" msgstr "بارگذاری خودکار '%s' هم اکنون موجود است!" msgid "Rename Autoload" msgstr "بارگذاری خودکار را تغییر نام بده" +msgid "Toggle Autoload Globals" +msgstr "تغییر خودبارگیری متغیر های عمومی" + msgid "Move Autoload" -msgstr "بارگیری خودکار را انجام دهید" +msgstr "انتقال بارگیری خودکار" msgid "Remove Autoload" -msgstr "بارگیری خودکار را حذف کنید" +msgstr "حذف بارگیری خودکار" msgid "Enable" -msgstr "روشن کردن" +msgstr "فعال کردن" msgid "Rearrange Autoloads" msgstr "تنظیم مجدد بارهای خودکار" +msgid "Can't add Autoload:" +msgstr "اضافه کردن بارگیری خودکار امکان پذیر نیست:" + msgid "%s is an invalid path. File does not exist." msgstr "%s یک مسیر نامعتبر است. فایل موجود نمیباشد." msgid "%s is an invalid path. Not in resource path (res://)." msgstr "%s یک مسیر نامعتبر است. در مسیر منبع نیست (//:res)." +msgid "Add Autoload" +msgstr "افزودن بارگیری خودکار" + msgid "Path:" msgstr "مسیر:" @@ -1833,8 +2253,35 @@ msgstr "جهتیابی" msgid "XR" msgstr "اکسآر" +msgid "RenderingDevice" +msgstr "دستگاه Render" + +msgid "OpenGL" +msgstr "OpenGL" + msgid "Vulkan" -msgstr "وولکان" +msgstr "Vulkan" + +msgid "Text Server: Fallback" +msgstr "سرویس دهنده متن: Fallback" + +msgid "Text Server: Advanced" +msgstr "سرویس دهنده متن: پیشرفته" + +msgid "TTF, OTF, Type 1, WOFF1 Fonts" +msgstr "فونت های TTF, OTF, Type 1, WOFF1" + +msgid "WOFF2 Fonts" +msgstr "فونت های WOFF2" + +msgid "SIL Graphite Fonts" +msgstr "فونت های گرافیکی SIL" + +msgid "Multi-channel Signed Distance Field Font Rendering" +msgstr "Render فونت میدان فاصله امضا شده چند کاناله" + +msgid "3D Nodes as well as RenderingServer access to 3D features." +msgstr "دسترسی گرههای ۳بعدی و همین طور سرویس دهنده Render به قابلیت های ۳بعدی." msgid "2D Physics nodes and PhysicsServer2D." msgstr "گرههای دوبعدی فیزیک و PhysicsServer2D." @@ -1848,6 +2295,32 @@ msgstr "جهتیابی، هم دوبعدی هم سهبعدی." msgid "XR (AR and VR)." msgstr "اکسآر (ایآر و ویآر)." +msgid "" +"RenderingDevice based rendering (if disabled, the OpenGL back-end is " +"required)." +msgstr "رندر بر پایه دستگاه Render (اگر غیرفعال باشد بک اند OpenGL نیاز است)." + +msgid "OpenGL back-end (if disabled, the RenderingDevice back-end is required)." +msgstr "بک اند OpenGL (اگر غیر فعال باشد بک اند دستگاه Render مورد نیاز است)." + +msgid "Vulkan back-end of RenderingDevice." +msgstr "بک اند Vulkan از دستگاه Render." + +msgid "" +"Fallback implementation of Text Server\n" +"Supports basic text layouts." +msgstr "" +"پیاده سازی Fallback از سرویس دهنده متن\n" +"از چیدمان های ساده متن پشتیبانی می کند." + +msgid "" +"Text Server implementation powered by ICU and HarfBuzz libraries.\n" +"Supports complex text layouts, BiDi, and contextual OpenType font features." +msgstr "" +"پیاده سازی سرویس دهنده متن با کمک کتابخانه های ICU و HarfBuzz.\n" +"از چیدمان های پیچیده متن، BiDi و قابلیت های بافتی OpenType فونت پشتیبانی " +"میکند." + msgid "Text Rendering and Font Options:" msgstr "گزینههای رندر متن و فونت:" @@ -2491,17 +2964,6 @@ msgid "Unable to load addon script from path: '%s'." msgstr "امکان بارگیری اسکریپت افزونه از مسیر وجود ندارد: '%s'." msgid "" -"Unable to load addon script from path: '%s' Base type is not EditorPlugin." -msgstr "" -"امکان بارگیری اسکریپت افزونه از مسیر: '%s' وجود ندارد، نوع پایه EditorPlugin " -"نیست." - -msgid "Unable to load addon script from path: '%s' Script is not in tool mode." -msgstr "" -"امکان بارگیری اسکریپت افزونه از مسیر: '%s' وجود ندارد، اسکریپت در حالت ابزار " -"نیست." - -msgid "" "Error loading scene, it must be inside the project path. Use 'Import' to open " "the scene, then save it inside the project path." msgstr "" @@ -2794,6 +3256,9 @@ msgstr "دیکشنری (اندازه %d)" msgid "Quick Load" msgstr "بارگذاری سریع" +msgid "Save As..." +msgstr "ذخیره در..." + msgid "Show in FileSystem" msgstr "نمایش در فایلسیستم" @@ -3417,6 +3882,9 @@ msgstr "وارد کردن شناسه: %s" msgid "Error opening scene" msgstr "خطا در باز کردن صحنه" +msgid "Warning: File exists" +msgstr "هشدار: پرونده وجود دارد" + msgid "Actions..." msgstr "فعالیتها" @@ -3478,9 +3946,6 @@ msgstr "یک منبع جدید در حافظه بساز و آن را ویرای msgid "Load an existing resource from disk and edit it." msgstr "بارگذاری یک منبع موجود از دیسک و ویرایش آن." -msgid "Save As..." -msgstr "ذخیره در..." - msgid "Copy Resource" msgstr "کپی منبع" @@ -3940,6 +4405,9 @@ msgstr "مرکز" msgid "Load Curve Preset" msgstr "بارگیری منحنی ذخیرهشده" +msgid "Add Curve Point" +msgstr "اضافه کردن نقطه منحنی" + msgid "Remove Curve Point" msgstr "حذف نقطهٔ منحنی" @@ -4059,11 +4527,14 @@ msgstr "اندازه سلول: %s" msgid "Video RAM size: %s MB (%s)" msgstr "اندازه ویدئو رم: %s مگابایت ( %s)" +msgid "Configure" +msgstr "تنظیم کردن" + msgid "Create Outline" msgstr "ساخت طرح کلی" msgid "Mesh" -msgstr "مِش" +msgstr "مش" msgid "Outline Size:" msgstr "اندازه طرح کلی:" @@ -4107,6 +4578,9 @@ msgstr "اندازه تصادفی:" msgid "Amount:" msgstr "مقدار:" +msgid "Set NavigationObstacle3D Vertices" +msgstr "تنظیم رئوس NavigationObstacle3D" + msgid "Edit Poly" msgstr "ویرایش چندضلعی" @@ -4582,6 +5056,9 @@ msgstr "انتخاب فریمها" msgid "Frame Order" msgstr "ترتیب فریم" +msgid "Toggle Settings Panel" +msgstr "تغییر وضعیت تنظیمات پنل" + msgid "Size" msgstr "اندازه" @@ -4880,12 +5357,39 @@ msgstr "مرتبسازی منابع" msgid "Patterns" msgstr "الگوها" +msgid "From Source" +msgstr "از منبع" + +msgid "From Coords" +msgstr "از مختصات" + +msgid "To Source" +msgstr "به منبع" + +msgid "Atlas" +msgstr "اطلس" + +msgid "Modulate" +msgstr "میزانسازی" + msgid "Z Index" msgstr "اندیس Z" msgid "Physics Layer %d" msgstr "لایه فیزیک %d" +msgid "Navigation Layer %d" +msgstr "لایه ناوبری %d" + +msgid "Custom Data" +msgstr "داده سفارشی" + +msgid "Custom Data %d" +msgstr "داده سفارشی %d" + +msgid "No custom data layers" +msgstr "بدون لایه داده سفارشی" + msgid "Setup" msgstr "آمادهسازی" @@ -5448,6 +5952,9 @@ msgstr "(همه)" msgid "Add Input Action" msgstr "افزودن عمل ورودی" +msgid "Rename Input Action" +msgstr "تغییر نام اکشن ورودی" + msgid "Project Settings (project.godot)" msgstr "تنظیمات پروژه (project.godot)" @@ -5762,13 +6269,6 @@ msgstr "" "عدم تطابق نسخهٔ ساخت اندروید: الگوی نصب شده: %s، نسخهٔ گودو: %s. لطفاً الگوی " "ساخت اندروید را از منوی «پروژه» دوباره نصب کنید." -msgid "" -"Building of Android project failed, check output for the error. Alternatively " -"visit docs.godotengine.org for Android build documentation." -msgstr "" -"ساخت پروژهٔ اندروید ناموفق بود، خروجی را برای وجود خطا بررسی کنید یا برای " -"مستندات ساخت اندروید از docs.godotengine.org بازدید کنید." - msgid "Adding files..." msgstr "افزودن فایلها..." @@ -5912,5 +6412,50 @@ msgstr "ثوابت قابل تغییر نیستند." msgid "Expected a function name." msgstr "نام تابع مورد انتظار است." +msgid "Expected a '{' to begin function." +msgstr "برای شروع یک تابع '{' انتظار میرود." + +msgid "Expected a '%s'." +msgstr "%s انتظار میرود." + +msgid "Expected a '%s' or '%s'." +msgstr "یک %s یا %s انتظار میرود." + +msgid "Expected a '%s' after '%s'." +msgstr "%s بعد از %s انتظار میردود." + +msgid "Redefinition of '%s'." +msgstr "تعریف دوباره از %s." + msgid "Invalid argument name." msgstr "نام آرگومان نامعتبر." + +msgid "Missing condition." +msgstr "نبود شرط." + +msgid "Condition evaluation error." +msgstr "خطای ارزیابی شرط." + +msgid "Unmatched else." +msgstr "else مچ نشده." + +msgid "Invalid else." +msgstr "else نامعتبر." + +msgid "Shader include file does not exist:" +msgstr "فایل سایهزن موجود نیست:" + +msgid "Invalid pragma directive." +msgstr "دستورالعمل نامعتبر پراگما." + +msgid "Invalid undef." +msgstr "undef نامعتبر." + +msgid "Invalid macro argument list." +msgstr "لیست آرگومان های کوچک نامعتبر." + +msgid "Invalid macro argument." +msgstr "آرگومان کوچک نامعتبر." + +msgid "Invalid macro argument count." +msgstr "تعداد آرگومان کوچک نامعتبر." diff --git a/editor/translations/editor/fi.po b/editor/translations/editor/fi.po index a89cc7c39b..84cbf80ae3 100644 --- a/editor/translations/editor/fi.po +++ b/editor/translations/editor/fi.po @@ -18,12 +18,13 @@ # Sami <sami@httpster.io>, 2023. # Kasper <kasper.bjorkgren@gmail.com>, 2023. # Mitja <mitja.leino@hotmail.com>, 2023. +# Aku <akulaku.ap@gmail.com>, 2023. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor interface\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-10-20 09:04+0000\n" +"PO-Revision-Date: 2023-12-08 07:17+0000\n" "Last-Translator: Mitja <mitja.leino@hotmail.com>\n" "Language-Team: Finnish <https://hosted.weblate.org/projects/godot-engine/" "godot/fi/>\n" @@ -32,7 +33,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.1\n" +"X-Generator: Weblate 5.3-dev\n" msgid "Main Thread" msgstr "Pää Säie" @@ -569,6 +570,24 @@ msgstr "Animaatio: Muuta avainruudun arvoa" msgid "Animation Change Call" msgstr "Animaatio: Muuta Kutsua" +msgid "Animation Multi Change Transition" +msgstr "Animaatio: muuta monta siirtymää" + +msgid "Animation Multi Change Position3D" +msgstr "Animaatio: muuta monta 3D-sijaintia" + +msgid "Animation Multi Change Rotation3D" +msgstr "Animaatio: muuta monta 3D-kiertoa" + +msgid "Animation Multi Change Scale3D" +msgstr "Animaatio: muuta monta 3D-skaalausta" + +msgid "Animation Multi Change Keyframe Value" +msgstr "Animaatio: muuta monen avainruudun arvoa" + +msgid "Animation Multi Change Call" +msgstr "Animaatio: muuta monta funktiokutsua" + msgid "Change Animation Length" msgstr "Muuta animaation pituutta" @@ -597,6 +616,9 @@ msgstr "3D Kierto Raita" msgid "3D Scale Track" msgstr "3D Koko Raita" +msgid "Blend Shape Track" +msgstr "Muodonsulautusraita" + msgid "Call Method Track" msgstr "Metodikutsuraita" @@ -810,6 +832,9 @@ msgstr "Vaihda animaation askelta" msgid "Rearrange Tracks" msgstr "Järjestele uudelleen raidat" +msgid "Blend Shape tracks only apply to MeshInstance3D nodes." +msgstr "Muodonsulautusraitojen muunnos toimii vain MeshInstance3D-solmuille." + msgid "Position/Rotation/Scale 3D tracks only apply to 3D-based nodes." msgstr "" "Sijainti/Kierto/Koko 3D raidat vaikuttavat ainoastaan 3D-pohjaisilla " @@ -841,6 +866,9 @@ msgstr "Lisää Bezier-raita" msgid "Track path is invalid, so can't add a key." msgstr "Raidan polku on virheellinen, joten ei voida lisätä avainruutua." +msgid "Track is not of type Node3D, can't insert key" +msgstr "Raita ei ole Node3D-tyyppinen, joten ei voida lisätä avainruutua" + msgid "Add Position Key" msgstr "Lisää Sijainti Avain" @@ -874,6 +902,9 @@ msgstr "Kierto" msgid "Scale" msgstr "Skaalaa" +msgid "BlendShape" +msgstr "Muodonsulautus" + msgid "Methods" msgstr "Metodit" @@ -889,10 +920,22 @@ msgstr "Leikepöytä on tyhjä!" msgid "Paste Tracks" msgstr "Liitä raidat" +msgid "Animation Scale Keys" +msgstr "Animaatio: Skaalaa avaimia" + +msgid "Make Easing Keys" +msgstr "Tee sulavan siirtymän avaimia" + msgid "" "This option does not work for Bezier editing, as it's only a single track." msgstr "Tämä valinta ei käy Bezier-editoinnille, koska se on vain yksi raita." +msgid "Animation Add RESET Keys" +msgstr "Animaatio: Lisää RESET avaimet" + +msgid "Bake Animation as Linear Keys" +msgstr "Animaatio: Tallenna lineaarisina avainruutuina" + msgid "" "This animation belongs to an imported scene, so changes to imported tracks " "will not be saved.\n" @@ -948,7 +991,10 @@ msgid "Inactive Player" msgstr "Ei-aktiivinen soitin" msgid "Warning: AnimationPlayer is inactive" -msgstr "Varoitus: AnimaatioSoitin on ei-aktiivinen" +msgstr "Varoitus: AnimationPlayer ei ole aktiivinen" + +msgid "Toggle between the bezier curve editor and track editor." +msgstr "Vaihda käyrä- ja raitamuokkaimen välillä." msgid "Only show tracks from nodes selected in tree." msgstr "Näytä raidat vain puussa valituista solmuista." @@ -1819,20 +1865,11 @@ msgstr "Kultasponsorit" msgid "Silver Sponsors" msgstr "Hopeasponsorit" -msgid "Bronze Sponsors" -msgstr "Pronssisponsorit" - -msgid "Mini Sponsors" -msgstr "Minisponsorit" +msgid "Platinum Members" +msgstr "Platina Jäsenet" -msgid "Gold Donors" -msgstr "Kultalahjoittajat" - -msgid "Silver Donors" -msgstr "Hopealahjoittajat" - -msgid "Bronze Donors" -msgstr "Pronssilahjoittajat" +msgid "Gold Members" +msgstr "Kulta Jäsenet" msgid "Donors" msgstr "Lahjoittajat" @@ -1892,6 +1929,9 @@ msgstr "Asset \"%s\" asennettu onnistuneesti!" msgid "Success!" msgstr "Onnistui!" +msgid "Asset:" +msgstr "Resurssi:" + msgid "Change Install Folder" msgstr "Muuta Asennus Kansiota" @@ -2066,6 +2106,9 @@ msgstr "Automaattisesti ladattava '%s' on jo olemassa!" msgid "Rename Autoload" msgstr "Nimeä automaattisesti ladattava uudelleen" +msgid "Toggle Autoload Globals" +msgstr "Aseta Globaalien Automaattilataus" + msgid "Move Autoload" msgstr "Siirrä automaattisesti ladattavaa" @@ -2587,12 +2630,24 @@ msgstr "Metodien kuvaukset" msgid "Operator Descriptions" msgstr "Operaattori Kuvaukset" +msgid "Metadata:" +msgstr "Metadata:" + msgid "Property:" msgstr "Ominaisuus:" +msgid "Method:" +msgstr "Metodi:" + msgid "Signal:" msgstr "Signaali:" +msgid "Theme Item:" +msgstr "Teeman Osa:" + +msgid "No description available." +msgstr "Kuvaus ei ole saatavilla." + msgid "%d match." msgstr "%d osuma." @@ -2806,6 +2861,9 @@ msgstr "Vaihdettu kielisuodattimen tila" msgid "[Default]" msgstr "[Oletus]" +msgid "Select a Locale" +msgstr "Valitse Alueasetus" + msgid "Show All Locales" msgstr "Näytä kaikki kielialueet" @@ -3173,14 +3231,6 @@ msgstr "" "Lisäosa '%s' poistetaan käytöstä tulevien virheiden estämiseksi." msgid "" -"Unable to load addon script from path: '%s' Base type is not EditorPlugin." -msgstr "Virhe ladattaessa lisäosaa polusta: '%s'. Tyyppi ei ole EditorPlugin." - -msgid "Unable to load addon script from path: '%s' Script is not in tool mode." -msgstr "" -"Virhe ladattaessa lisäosaa polusta: '%s'. Skripti ei ole työkalu-tilassa." - -msgid "" "Scene '%s' was automatically imported, so it can't be modified.\n" "To make changes to it, a new inherited scene can be created." msgstr "" @@ -3315,6 +3365,9 @@ msgstr "Seuraava Kohtaus Välilehti" msgid "Previous Scene Tab" msgstr "Edellinen Kohtaus Välilehti" +msgid "Command Palette" +msgstr "Komentorivi" + msgid "New Scene" msgstr "Uusi kohtaus" @@ -3333,6 +3386,9 @@ msgstr "Avaa viimeaikainen" msgid "Save Scene" msgstr "Tallenna kohtaus" +msgid "Export As..." +msgstr "Vie..." + msgid "MeshLibrary..." msgstr "Mesh-kirjastoksi..." @@ -3381,6 +3437,9 @@ msgstr "Editori" msgid "Editor Settings..." msgstr "Editorin asetukset..." +msgid "Command Palette..." +msgstr "Komentopaletti..." + msgid "Editor Layout" msgstr "Editorin ulkoasu" @@ -3453,6 +3512,9 @@ msgstr "Mobiili" msgid "Compatibility" msgstr "Yhteensopivuus" +msgid "Changing the renderer requires restarting the editor." +msgstr "Näyttöajurin vaihtaminen edellyttää editorin uudelleenkäynnistystä." + msgid "Update Continuously" msgstr "Päivitä jatkuvasti" @@ -3492,6 +3554,9 @@ msgstr "Hallinnoi malleja" msgid "Install from file" msgstr "Asenna tiedostosta" +msgid "Select Android sources file" +msgstr "Valitse android-lähdetiedosto" + msgid "" "The Android build template is already installed in this project and it won't " "be overwritten.\n" @@ -3636,6 +3701,12 @@ msgstr "<tyhjä>" msgid "Assign..." msgstr "Aseta..." +msgid "Copy as Text" +msgstr "Kopioi Tekstinä" + +msgid "Show Node in Tree" +msgstr "Näytä Solmu Puussa" + msgid "Invalid RID" msgstr "Virheellinen RID" @@ -3712,6 +3783,9 @@ msgstr "Tee yksilölliseksi" msgid "Make Unique (Recursive)" msgstr "Tee yksilölliseksi (Rekursiivisesti)" +msgid "Save As..." +msgstr "Tallenna nimellä..." + msgid "Show in FileSystem" msgstr "Näytä tiedostojärjestelmässä" @@ -3730,6 +3804,9 @@ msgstr "Uusi skripti" msgid "Extend Script" msgstr "Laajenna skriptiä" +msgid "New Shader" +msgstr "Uusi Shader" + msgid "No Remote Debug export presets configured." msgstr "Ei Etädebuggaus vientiasetuksia konfiguroitu." @@ -3745,6 +3822,9 @@ msgstr "" "Ole hyvä ja lisää ajettava esiasetus Vienti-valikosta tai määrittele olemassa " "oleva esiasetus ajettavaksi." +msgid "Project Run" +msgstr "Aja Projekti" + msgid "Write your logic in the _run() method." msgstr "Kirjoita logiikka _run() metodiin." @@ -3784,6 +3864,30 @@ msgstr "Pikanäppäimet" msgid "Binding" msgstr "Sidonta" +msgid "Left Stick Left, Joystick 0 Left" +msgstr "Vasen Sauva Vasemmalle, Tatti 0 Vasemmalle" + +msgid "Left Stick Right, Joystick 0 Right" +msgstr "Vasen Sauva Oikealle, Tatti 0 Oikealle" + +msgid "Left Stick Up, Joystick 0 Up" +msgstr "Vasen Sauva Ylös, Tatti 0 Ylös" + +msgid "Left Stick Down, Joystick 0 Down" +msgstr "Vasen Sauva Alas, Tatti 0 Alas" + +msgid "Right Stick Left, Joystick 1 Left" +msgstr "Oikea Sauva Vasemmalle, Tatti 1 Vasemmalle" + +msgid "Right Stick Right, Joystick 1 Right" +msgstr "Oikea Sauva Oikealle, Tatti 1 Oikealle" + +msgid "Right Stick Up, Joystick 1 Up" +msgstr "Oikea Sauva Ylös, Tatti 1 Ylös" + +msgid "Right Stick Down, Joystick 1 Down" +msgstr "Oikea Sauva Alas, Tatti 1 Alas" + msgid "Joystick 2 Left" msgstr "Tatti 2 Vasemmalle" @@ -3802,6 +3906,18 @@ msgstr "Tatti 3 Ylös" msgid "Joystick 3 Down" msgstr "Tatti 3 Alas" +msgid "Joystick 4 Left" +msgstr "Tatti 4 Vasemmalle" + +msgid "Joystick 4 Right" +msgstr "Tatti 4 Oikealle" + +msgid "Joystick 4 Up" +msgstr "Tatti 4 Ylös" + +msgid "Joystick 4 Down" +msgstr "Tatti 4 Alas" + msgid "or" msgstr "tai" @@ -4099,6 +4215,9 @@ msgid "" msgstr "" "Kohdealusta tarvitsee '%s' tekstuuripakkausta. Kytke 'Import %s' päälle." +msgid "Fix Import" +msgstr "Korjaa Tuonti" + msgid "Runnable" msgstr "Suoritettava" @@ -4349,6 +4468,9 @@ msgstr "Kahdennetaan kansio:" msgid "New Inherited Scene" msgstr "Uusi peritty kohtaus" +msgid "Set as Main Scene" +msgstr "Aseta Pääkohtaukseksi" + msgid "Open Scenes" msgstr "Avaa kohtaukset" @@ -4460,6 +4582,33 @@ msgstr "Nimeä uudelleen..." msgid "Open in External Program" msgstr "Avaa Ulkopuolisessa Ohjelmassa" +msgid "Red" +msgstr "Punainen" + +msgid "Orange" +msgstr "Oranssi" + +msgid "Yellow" +msgstr "Keltainen" + +msgid "Green" +msgstr "Vihreä" + +msgid "Teal" +msgstr "Sinivihreä" + +msgid "Blue" +msgstr "Sininen" + +msgid "Purple" +msgstr "Violetti" + +msgid "Pink" +msgstr "Pinkki" + +msgid "Gray" +msgstr "Harmaa" + msgid "Go to previous selected folder/file." msgstr "Siirry edelliseen kansioon/tiedostoon." @@ -4799,6 +4948,9 @@ msgstr "Poista solmun lukitus" msgid "Button Group" msgstr "Painikeryhmä" +msgid "Disable Scene Unique Name" +msgstr "Poista Kohtauksen Uniikki Nimi Käytöstä" + msgid "(Connecting From)" msgstr "(Yhdistetään paikasta)" @@ -4890,6 +5042,9 @@ msgstr "Silmukka:" msgid "BPM:" msgstr "Iskua Minuutissa:" +msgid "Beat Count:" +msgstr "Tahtien Määrä:" + msgid "Music Playback:" msgstr "Toista Musiikki:" @@ -4915,14 +5070,8 @@ msgstr "Konfiguraatio:" msgid "Add configuration" msgstr "Lisää konfiguraatio" -msgid "Can't load font texture:" -msgstr "Ei voida ladata fontti tekstuuria:" - -msgid "Image margin too big." -msgstr "Kuva marginaali on liian iso." - -msgid "Character margin too big." -msgstr "Merkin marginaali on liian iso." +msgid "Pre-Import Scene" +msgstr "Esituo Kohtaus" msgid "Importing Scene..." msgstr "Tuodaan kohtausta..." @@ -5064,6 +5213,13 @@ msgid "Advanced..." msgstr "Edistyneet..." msgid "" +"WARNING: Assets exist that use this resource. They may stop loading properly " +"after changing type." +msgstr "" +"VAROITUS: Tällä resurssilla on sitä käyttäviä assetteja. Ne voivat lakata " +"latautumasta kunnolla tyypin muuttamisen jälkeen." + +msgid "" "Select a resource file in the filesystem or in the inspector to adjust import " "settings." msgstr "" @@ -5127,9 +5283,6 @@ msgstr "Lataa olemassaoleva resurssi levyltä ja muokkaa sitä." msgid "Save the currently edited resource." msgstr "Tallenna tällä hetkellä muokattu resurssi." -msgid "Save As..." -msgstr "Tallenna nimellä..." - msgid "Extra resource options." msgstr "Ylimääräiset resurssivalinnat." @@ -6008,6 +6161,9 @@ msgstr "Assettien zip-tiedosto" msgid "Audio Preview Play/Pause" msgstr "Äänen esikuuntelun toisto/keskeytys" +msgid "Bone Picker:" +msgstr "Luu Valitsin:" + msgid "Preview" msgstr "Esikatselu" @@ -6278,6 +6434,9 @@ msgstr "Lukitse valitut solmut" msgid "Unlock Selected Node(s)" msgstr "Vapauta valitut solmut" +msgid "Make selected node's children not selectable." +msgstr "Tee valitun solmun alisolmuista valitsemattomia." + msgid "Group Selected Node(s)" msgstr "Ryhmitä valitut solmut" @@ -6392,6 +6551,10 @@ msgstr "Jaa ruudukon välistys kahdella" msgid "Adding %s..." msgstr "Lisätään %s..." +msgid "Drag and drop to add as child of current scene's root node." +msgstr "" +"Raahaa ja pudota lisätäksesi nykyisen kohtauksen juurisolmun alisolmuksi." + msgid "Hold %s when dropping to add as child of selected node." msgstr "" "Pidä %s pohjassa pudottaessa lisätäksesi jälkeiläiseksi valittuun solmuun." @@ -6408,9 +6571,15 @@ msgstr "Ei voida luoda ilmentymiä useasta solmusta ilman juurta." msgid "Create Node" msgstr "Luo solmu" +msgid "Error instantiating scene from %s" +msgstr "Virhe luodessa ilmentymää kohteesta %s" + msgid "Change Default Type" msgstr "Muuta oletustyyppiä" +msgid "Set Target Position" +msgstr "Aseta kohdesijainti" + msgid "Set Handle" msgstr "Aseta kahva" @@ -6423,6 +6592,12 @@ msgstr "Tämä solmu on containerin lapsi." msgid "Use container properties for positioning." msgstr "Käytä containerin ominaisuuksia sijoittamiseen." +msgid "Collapse positioning hint." +msgstr "Piilota sijainnin vihje." + +msgid "Expand positioning hint." +msgstr "Laajenna sijainnin vihje." + msgid "Fill" msgstr "Täytä" @@ -6489,9 +6664,15 @@ msgstr "Täysi ruutu" msgid "Horizontal alignment" msgstr "Vaakasuora kohdistus" +msgid "Vertical alignment" +msgstr "Pystysuuntainen kohdistus" + msgid "Load Emission Mask" msgstr "Lataa emissiomaski" +msgid "CPUParticles2D" +msgstr "CPUPartikkelit2D" + msgid "Generated Point Count:" msgstr "Luotujen pisteiden määrä:" @@ -6510,6 +6691,12 @@ msgstr "Suunnatut reunapikselit" msgid "Centered" msgstr "Keskitetty" +msgid "Capture Colors from Pixel" +msgstr "Nappaa Värit Pikselistä" + +msgid "CPUParticles3D" +msgstr "CPUPartikkelit3D" + msgid "Create Emission Points From Node" msgstr "Luo säteilypisteet solmusta" @@ -6537,6 +6724,9 @@ msgstr "Hidasta lopussa" msgid "Smoothstep" msgstr "Pehmeä askellus" +msgid "Toggle Grid Snap" +msgstr "Vaihda Ruudukon Tartunta Päälle/Pois" + msgid "Debug with External Editor" msgstr "Debuggaa ulkoisella editorilla" @@ -6654,6 +6844,13 @@ msgstr "Mitat: %d × %d" msgid "Overrides (%d)" msgstr "Ylikirjoittaa (%d)" +msgctxt "Locale" +msgid "Add Script" +msgstr "Lisää Skripti" + +msgid "Add Locale" +msgstr "Lisää Kielialue" + msgid "Variation Coordinates (%d)" msgstr "Vaihtelu Koordinaatit (%d)" @@ -6696,6 +6893,9 @@ msgstr "Muuta sylinterimuodon korkeutta" msgid "Change Particles AABB" msgstr "Muuta partikkelien AABB" +msgid "Change Radius" +msgstr "Muuta Sädettä" + msgid "Change Light Radius" msgstr "Muuta valon sädettä" @@ -6711,6 +6911,9 @@ msgstr "Kartoita näkyvä alue" msgid "Clear Emission Mask" msgstr "Tyhjennä emissiomaski" +msgid "GPUParticles2D" +msgstr "GPUPartikkelit2D" + msgid "Generation Time (sec):" msgstr "Luontiaika (s):" @@ -6720,6 +6923,9 @@ msgstr "Geometrian tahkot eivät sisällä mitään alaa." msgid "The geometry doesn't contain any faces." msgstr "Geometria ei sisällä yhtään tahkoja." +msgid "\"%s\" doesn't inherit from Node3D." +msgstr "\"%s\" ei periydy Node3D solmusta." + msgid "\"%s\" doesn't contain geometry." msgstr "\"%s\" ei sisällä geometriaa." @@ -6744,9 +6950,27 @@ msgstr "Tilavuus" msgid "Emission Source:" msgstr "Emission lähde:" +msgid "Convert to CPUParticles3D" +msgstr "Muunna CPUParticles3D:ksi" + msgid "Generate Visibility AABB" msgstr "Kartoita näkyvä alue" +msgid "GPUParticles3D" +msgstr "GPUPartikkelit3D" + +msgid "Generate AABB" +msgstr "Generoi AABB" + +msgid "Low" +msgstr "Alhainen" + +msgid "Moderate" +msgstr "Kohtalainen" + +msgid "High" +msgstr "Korkea" + msgid "Cell size: %s" msgstr "Solun koko: %s" @@ -8723,6 +8947,9 @@ msgstr "Ei fysiikka kerroksia" msgid "Navigation Layer %d" msgstr "Navigointi Kerros %d" +msgid "Custom Data %d" +msgstr "Mukautettu Data %d" + msgid "Select tiles." msgstr "Valitse laatat." @@ -9923,6 +10150,9 @@ msgstr "Tiedosto nimi ei kelpaa." msgid "Invalid root node name characters have been replaced." msgstr "Virheelliset merkit on korvattu juuri solmun nimestä." +msgid "Root Type:" +msgstr "Juuren Tyyppi:" + msgid "2D Scene" msgstr "2D-kohtaus" @@ -9932,6 +10162,9 @@ msgstr "3D-kohtaus" msgid "User Interface" msgstr "Käyttöliittymä" +msgid "Root Name:" +msgstr "Juuren Nimi:" + msgid "Root node valid." msgstr "Juurisolmu validi." @@ -10079,6 +10312,9 @@ msgstr "Virhe kohtauksen kopioimisessa sen tallentamiseksi." msgid "Sub-Resources" msgstr "Aliresurssit" +msgid "Revoke Unique Name" +msgstr "Peru Yksilöllinen Nimi" + msgid "Access as Unique Name" msgstr "Käytä Uniikilla Nimellä" @@ -10130,6 +10366,9 @@ msgstr "Vaihda solmulle uusi isäntä" msgid "Make Scene Root" msgstr "Tee kohtauksen juuri" +msgid "Toggle Access as Unique Name" +msgstr "Vaihda Käyttö Yksilöllisellä Nimellä" + msgid "Delete (No Confirm)" msgstr "Poista (ei varmistusta)" @@ -10658,24 +10897,9 @@ msgstr "Ei voitu kirjoittaa laajennuspakettitiedostoa!" msgid "Building Android Project (gradle)" msgstr "Käännetään Android-projektia (gradle)" -msgid "" -"Building of Android project failed, check output for the error. Alternatively " -"visit docs.godotengine.org for Android build documentation." -msgstr "" -"Android-projektin käännös epäonnistui, tarkista virhe tulosteesta. " -"Vaihtoehtoisesti, lue docs.godotengine.org sivustolta Androidin " -"käännösdokumentaatio." - msgid "Moving output" msgstr "Siirretään tulostetta" -msgid "" -"Unable to copy and rename export file, check gradle project directory for " -"outputs." -msgstr "" -"Vientitiedoston kopiointi ja uudelleennimeäminen ei onnistu, tarkista " -"tulosteet gradle-projektin hakemistosta." - msgid "Package not found: \"%s\"." msgstr "Pakettia ei löytynyt: \"%s\"." @@ -11118,6 +11342,9 @@ msgstr "Mitään ei ole yhdistetty syötteeseen '%s' solmussa '%s'." msgid "No root AnimationNode for the graph is set." msgstr "Graafille ei ole asetettu AnimationNode juurisolmua." +msgid "Enter a hex code (\"#ff0000\") or named color (\"red\")." +msgstr "Syötä hex koodi (\"#ff0000\") tai nimetty väri (\"red\")." + msgid "" "Color: #%s\n" "LMB: Apply color\n" @@ -11137,6 +11364,9 @@ msgstr "" msgid "Switch between hexadecimal and code values." msgstr "Vaihda heksadesimaali- ja koodiarvojen välillä." +msgid "Hex code or named color" +msgstr "Hex koodi tai nimetty väri" + msgid "Add current color as a preset." msgstr "Lisää nykyinen väri esiasetukseksi." @@ -11164,6 +11394,12 @@ msgstr "Huomio!" msgid "Please Confirm..." msgstr "Ole hyvä ja vahvista..." +msgid "You don't have permission to access contents of this folder." +msgstr "Sinulla ei ole oikeuksia tämän kansio sisältöön." + +msgid "Right-to-Left" +msgstr "Oikealta-Vasemmalle" + msgid "If \"Exp Edit\" is enabled, \"Min Value\" must be greater than 0." msgstr "Jos \"Exp Edit\" on päällä, \"Min Value\" täytyy olla suurempi kuin 0." @@ -11198,12 +11434,6 @@ msgstr "" "Näyttöruudun koko on oltava suurempi tai yhtä suuri kuin kaksi pikseliä " "kummassakin suunnassa, jotta mitään renderöidään." -msgid "Cannot open font from file: %s." -msgstr "Ei voitu avata fonttia tiedostosta: %s." - -msgid "Unsupported BMFont texture format." -msgstr "Ei tuettu BMFont tekstuuri formaatti." - msgid "" "Shader keywords cannot be used as parameter names.\n" "Choose another name." @@ -11242,6 +11472,9 @@ msgstr "2D Tila" msgid "Invalid arguments for the built-in function: \"%s(%s)\"." msgstr "Virheelliset argumentit sisäänrakennetulle funktiolle \"%s(%s)\"." +msgid "Recursion is not allowed." +msgstr "Rekursio ei ole sallittu." + msgid "Varying may not be assigned in the '%s' function." msgstr "Varying tyyppiä ei voi sijoittaa '%s' funktiossa." @@ -11266,6 +11499,12 @@ msgstr "Vastaavaa rakentaa ei löytynyt: '%s':lle." msgid "No matching function found for: '%s'." msgstr "Vastaavaa funktiota ei löytynyt: '%s':lle." +msgid "Unknown identifier in expression: '%s'." +msgstr "Tuntematon tunniste lausekkeessa: '%s'." + +msgid "Unexpected end of expression." +msgstr "Lausekkeen odottamaton loppu." + msgid "Invalid arguments to operator '%s': '%s'." msgstr "Virheelliset argumentit operaattorille '%s': '%s'" @@ -11323,6 +11562,12 @@ msgstr "Uudelleen määritetty '%s'." msgid "Invalid argument name." msgstr "Virheellinen argumentin nimi." +msgid "Missing condition." +msgstr "Ehto puuttuu." + +msgid "Condition evaluation error." +msgstr "Virhe ehdon arvioinnissa." + msgid "The const '%s' is declared but never used." msgstr "Vakio '%s' on määritelty, mutta ei käytetty." diff --git a/editor/translations/editor/fr.po b/editor/translations/editor/fr.po index cc33d6aa29..b39f637c8c 100644 --- a/editor/translations/editor/fr.po +++ b/editor/translations/editor/fr.po @@ -153,13 +153,15 @@ # kdx <weblate@kdx.mikuwu.ltd>, 2023. # Calimelo <melo.j@lilo.org>, 2023. # Xabi GOITY <xabigoity@gmail.com>, 2023. +# Roskai <angel.du.2558@gmail.com>, 2023. +# Clément <clement.vaugoyeau@gmail.com>, 2023. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor interface\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-11-09 22:39+0000\n" -"Last-Translator: Xabi GOITY <xabigoity@gmail.com>\n" +"PO-Revision-Date: 2023-12-06 04:32+0000\n" +"Last-Translator: Rertsyd <rertsyd@outlook.com>\n" "Language-Team: French <https://hosted.weblate.org/projects/godot-engine/godot/" "fr/>\n" "Language: fr\n" @@ -167,7 +169,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 5.2-dev\n" +"X-Generator: Weblate 5.3-dev\n" msgid "Main Thread" msgstr "Thread principal" @@ -708,6 +710,18 @@ msgstr "Changer la valeur de l'image clé d’animation" msgid "Animation Change Call" msgstr "Changer l’appel d'animation" +msgid "Animation Multi Change Transition" +msgstr "Changements multiple d'animations de Transition" + +msgid "Animation Multi Change Position3D" +msgstr "Changements multiple d'animations de Position3D" + +msgid "Animation Multi Change Rotation3D" +msgstr "Changements multiple d'animations de Rotation3D" + +msgid "Animation Multi Change Scale3D" +msgstr "Changements multiple d'animations de Scale3D" + msgid "Animation Multi Change Keyframe Value" msgstr "Changer la valeur de plusieurs images clés d’animation" @@ -2042,6 +2056,9 @@ msgstr "Développeurs" msgid "Authors" msgstr "Auteurs" +msgid "Patrons" +msgstr "Modèles" + msgid "Platinum Sponsors" msgstr "Sponsors Platine" @@ -2051,20 +2068,17 @@ msgstr "Sponsors Or" msgid "Silver Sponsors" msgstr "Sponsors Argent" -msgid "Bronze Sponsors" -msgstr "Sponsors Bronze" - -msgid "Mini Sponsors" -msgstr "Petits Sponsors" +msgid "Diamond Members" +msgstr "Membres Diamant" -msgid "Gold Donors" -msgstr "Donateurs Or" +msgid "Titanium Members" +msgstr "Membres Titane" -msgid "Silver Donors" -msgstr "Donateurs Argent" +msgid "Platinum Members" +msgstr "Membres Platine" -msgid "Bronze Donors" -msgstr "Donateurs Bronze" +msgid "Gold Members" +msgstr "Membres Or" msgid "Donors" msgstr "Donateurs" @@ -2953,12 +2967,24 @@ msgstr "Descriptions des méthodes" msgid "Operator Descriptions" msgstr "Descriptions des opérateurs" +msgid "Metadata:" +msgstr "Métadonnées :" + msgid "Property:" msgstr "Propriété :" +msgid "Method:" +msgstr "Méthode :" + msgid "Signal:" msgstr "Signal :" +msgid "Theme Item:" +msgstr "Élément du thème :" + +msgid "No description available." +msgstr "Aucune description disponible." + msgid "%d match." msgstr "%d correspondance(s) trouvée(s)." @@ -3571,12 +3597,12 @@ msgstr "" "L'extension '%s' a été désactivée pour prévenir de nouvelles erreurs." msgid "" -"Unable to load addon script from path: '%s' Base type is not EditorPlugin." +"Unable to load addon script from path: '%s'. Base type is not 'EditorPlugin'." msgstr "" "Impossible de charger le script de l'addon depuis le chemin : '%s'. Le type " -"de base n'est pas EditorPlugin." +"de base n'est pas 'EditorPlugin'." -msgid "Unable to load addon script from path: '%s' Script is not in tool mode." +msgid "Unable to load addon script from path: '%s'. Script is not in tool mode." msgstr "" "Impossible de charger le script de l’extension depuis le chemin : '%s'. Le " "script n'est pas en mode outil." @@ -4104,6 +4130,12 @@ msgstr "" msgid "Assign..." msgstr "Assigner..." +msgid "Copy as Text" +msgstr "Copier en tant que texte" + +msgid "Show Node in Tree" +msgstr "Afficher le nœud dans l'arbre" + msgid "Invalid RID" msgstr "RID invalide" @@ -4193,6 +4225,9 @@ msgstr "Rendre unique" msgid "Make Unique (Recursive)" msgstr "Rendre unique (récursivement)" +msgid "Save As..." +msgstr "Enregistrer sous…" + msgid "Show in FileSystem" msgstr "Montrer dans le système de fichiers" @@ -4979,6 +5014,9 @@ msgstr "Duplication du dossier :" msgid "New Inherited Scene" msgstr "Nouvelle scène héritée" +msgid "Set as Main Scene" +msgstr "Définir comme scène principale" + msgid "Open Scenes" msgstr "Ouvrir des scènes" @@ -5090,6 +5128,33 @@ msgstr "Renommer..." msgid "Open in External Program" msgstr "Ouvrir dans l'éditeur externe" +msgid "Red" +msgstr "Rouge" + +msgid "Orange" +msgstr "Orange" + +msgid "Yellow" +msgstr "Jaune" + +msgid "Green" +msgstr "Vert" + +msgid "Teal" +msgstr "Sarcelle" + +msgid "Blue" +msgstr "Bleu" + +msgid "Purple" +msgstr "Mauve" + +msgid "Pink" +msgstr "Rose" + +msgid "Gray" +msgstr "Gris" + msgid "Go to previous selected folder/file." msgstr "Aller au dossier/fichier précédent." @@ -5724,15 +5789,6 @@ msgstr "Police TrueType/OpenType rendue dynamiquement" msgid "Prerendered multichannel(+true) signed distance field" msgstr "Champ de distance signée multicanal(+true) pré-rendu" -msgid "Can't load font texture:" -msgstr "Impossible de charger la texture de police :" - -msgid "Image margin too big." -msgstr "Marge de l'image trop grande." - -msgid "Character margin too big." -msgstr "Marge du caractère trop grande." - msgid "Pre-Import Scene" msgstr "Préimporter une scène" @@ -6112,9 +6168,6 @@ msgstr "Charger une ressource existante depuis la disque et la modifier." msgid "Save the currently edited resource." msgstr "Enregistrer la ressource en cours d'édition." -msgid "Save As..." -msgstr "Enregistrer sous…" - msgid "Extra resource options." msgstr "Options de ressource additionnelles." @@ -7890,6 +7943,18 @@ msgstr "" "Lorsque cette option est activée, les formes d'objets d'évitement, le rayon " "et les vitesses seront visibles dans le projet en cours d'exécution." +msgid "Debug CanvasItem Redraws" +msgstr "Débogage redessiner le CanvasItem" + +msgid "" +"When this option is enabled, redraw requests of 2D objects will become " +"visible (as a short flash) in the running project.\n" +"This is useful to troubleshoot low processor mode." +msgstr "" +"Quand cette option est activée, les requêtes pour redessiner des objet 2D " +"deviennent visible (comme un court flash) dans le projet en cours.\n" +"Cela est utile pour dépanner le mode low processor." + msgid "Synchronize Scene Changes" msgstr "Synchroniser les modifications des scènes" @@ -8269,6 +8334,9 @@ msgstr "Créer un maillage de navigation" msgid "Create Debug Tangents" msgstr "Générer les tangentes debug" +msgid "No mesh to unwrap." +msgstr "Aucun mesh à déplier." + msgid "" "Mesh cannot unwrap UVs because it does not belong to the edited scene. Make " "it unique first." @@ -8297,6 +8365,12 @@ msgstr "Déplier les UV2" msgid "Contained Mesh is not of type ArrayMesh." msgstr "Le maillage contenu n'est pas de type ArrayMesh." +msgid "Only triangles are supported for lightmap unwrap." +msgstr "Seuls les triangles sont supportés pour le dépliage de lightmap." + +msgid "Normals are required for lightmap unwrap." +msgstr "Des normales sont requises pour le dépliage de lghtmap." + msgid "UV Unwrap failed, mesh may not be manifold?" msgstr "" "Le dépliage UV a échoué, le maillage n'est peut-être pas (« manifold ») ?" @@ -10397,13 +10471,13 @@ msgid "Font sizes" msgstr "Taille de la Police" msgid "Select all visible font size items." -msgstr "Sélectionner tous les éléments de taille de police visibles." +msgstr "Sélectionnez tous les éléments de taille de police visibles." msgid "Select all visible font size items and their data." msgstr "Sélectionner tous les items de police visibles et leurs données." msgid "Deselect all visible font size items." -msgstr "Désélectionner toutes les tailles de police." +msgstr "Désélectionnez tous les éléments de taille de police visibles." msgid "Select all visible icon items." msgstr "Sélectionner tous les items d'icône visibles." @@ -11287,6 +11361,9 @@ msgstr "" msgid "Select tiles." msgstr "Sélectionner tuiles." +msgid "Paint properties." +msgstr "Propriétés de la peinture." + msgid "" "No tiles selected.\n" "Select one or more tiles from the palette to edit its properties." @@ -11617,7 +11694,7 @@ msgid "Int" msgstr "Nombre entier" msgid "UInt" -msgstr "Entier non signé" +msgstr "Nombre entier positif" msgid "Vector2" msgstr "Vecteur2" @@ -11676,6 +11753,12 @@ msgstr "Cacher l'aperçu du port" msgid "Show Port Preview" msgstr "Montrer l'aperçu du port" +msgid "Set Comment Title" +msgstr "Définir le titre du commentaire" + +msgid "Set Comment Description" +msgstr "Définir la description du commentaire" + msgid "Set Parameter Name" msgstr "Modifier le nom du paramètre" @@ -11820,6 +11903,9 @@ msgstr "Opérateur de lumière douce." msgid "Color constant." msgstr "Constante de couleur." +msgid "Color parameter." +msgstr "Paramètre de couleur." + msgid "Returns the boolean result of the %s comparison between two parameters." msgstr "Renvoi le résultat booléen de la comparaison %s de deux paramètres." @@ -11974,6 +12060,15 @@ msgstr "" "rotation utilisant un axe spécifique. Destiné à fonctionner avec des " "émetteurs." +msgid "Integer function." +msgstr "Fonction entière." + +msgid "Integer operator." +msgstr "Opérateur entier." + +msgid "Unsigned integer function." +msgstr "Fonction entière non signé." + msgid "Unsigned integer operator." msgstr "Opérateur entier non signé." @@ -12569,6 +12664,42 @@ msgstr "" "(Mode Fragment/Light uniquement) (Vecteur) Somme des dérivées absolues en 'x' " "et 'y'." +msgid "Adds 2D vector to 2D vector." +msgstr "Additionne un vecteur 2D à un vecteur 2D." + +msgid "Adds 3D vector to 3D vector." +msgstr "Additionne un vecteur 3D à un vecteur 3D." + +msgid "Adds 4D vector to 4D vector." +msgstr "Additionne un vecteur 4D à un vecteur 4D." + +msgid "Divides 2D vector by 2D vector." +msgstr "Divise un vecteur 2D par un vecteur 2D." + +msgid "Divides 3D vector by 3D vector." +msgstr "Divise un vecteur 3D par un vecteur 3D." + +msgid "Divides 4D vector by 4D vector." +msgstr "Divise un vecteur 4D par un vecteur 4D." + +msgid "Multiplies 2D vector by 2D vector." +msgstr "Multiplie un vecteur 2D par un vecteur 2D." + +msgid "Multiplies 3D vector by 3D vector." +msgstr "Multiplie un vecteur 3D par un vecteur 3D." + +msgid "Multiplies 4D vector by 4D vector." +msgstr "Multiplie un vecteur 4D par un vecteur 4D." + +msgid "Subtracts 2D vector from 2D vector." +msgstr "Soustrait un vecteur 2D d'un vecteur 2D." + +msgid "Subtracts 3D vector from 3D vector." +msgstr "Soustrait un vecteur 3D d'un vecteur 3D." + +msgid "Subtracts 4D vector from 4D vector." +msgstr "Soustrait un vecteur 4D d'un vecteur 4D." + msgid "" "Custom Godot Shader Language expression, with custom amount of input and " "output ports. This is a direct injection of code into the vertex/fragment/" @@ -12579,6 +12710,9 @@ msgstr "" "fonction vertex/fragment/lumière, ne l'utilisez pas pour écrire les " "déclarations de fonction à l'intérieur." +msgid "A reference to an existing parameter." +msgstr "Une référence à un paramètre existant." + msgid "Edit Visual Property: %s" msgstr "Éditer la propriété visuelle : %s" @@ -12723,6 +12857,9 @@ msgstr "" msgid "Couldn't create project.godot in project path." msgstr "Impossible de créer le fichier project.godot dans le chemin du projet." +msgid "Couldn't create icon.svg in project path." +msgstr "Impossible de créer icon.svg dans le chemin du projet." + msgid "Error opening package file, not in ZIP format." msgstr "Erreur d'ouverture de paquetage, pas au format ZIP." @@ -12766,7 +12903,10 @@ msgid "Renderer:" msgstr "Moteur de rendu :" msgid "Version Control Metadata:" -msgstr "Contrôle de version des métadonnées :" +msgstr "Métadonnées du contrôle de version :" + +msgid "Git" +msgstr "Git" msgid "This project was last edited in a different Godot version: " msgstr "" @@ -12965,6 +13105,12 @@ msgstr "" msgid "Are you sure to run %d projects at once?" msgstr "Voulez-vous vraiment lancer %d projets à la fois ?" +msgid "Tag name can't be empty." +msgstr "Le nom de l'étiquette ne peut pas être vide." + +msgid "Tag name can't contain spaces." +msgstr "Le nom de l'étiquette ne peut pas contenir d'espace." + msgid "These characters are not allowed in tags: %s." msgstr "Ces caractères ne sont pas autorisés dans les étiquettes : %s." @@ -13035,6 +13181,9 @@ msgstr "Balises" msgid "Edit Project" msgstr "Modifier le projet" +msgid "Manage Tags" +msgstr "Gérer les étiquettes" + msgid "Remove Project" msgstr "Retirer le projet" @@ -13056,6 +13205,9 @@ msgstr "Supprimer tout" msgid "Also delete project contents (no undo!)" msgstr "Supprimer les contenus du projet également (pas d'annulation !)" +msgid "Convert Full Project" +msgstr "Convertir le projet entier" + msgid "Can't run project" msgstr "Impossible de lancer le projet" @@ -13063,12 +13215,19 @@ msgid "" "You currently don't have any projects.\n" "Would you like to explore official example projects in the Asset Library?" msgstr "" -"Vous n'avez pour l'instant aucun projets.\n" -"Voulez-vous explorer des exemples de projets officiels dans l'Asset Library ?" +"Vous n'avez pour l'instant aucun projet.\n" +"Voulez-vous rechercher des exemples de projets officiels dans l'Asset " +"Library ?" + +msgid "Manage Project Tags" +msgstr "Gérer les étiquettes de projet" msgid "Click tag to remove it from the project." msgstr "Cliquez sur la balise pour la retirer du projet." +msgid "All Tags" +msgstr "Toutes les étiquettes" + msgid "Click tag to add it to the project." msgstr "Cliquez sur la balise pour l'ajouter au projet." @@ -13231,9 +13390,18 @@ msgstr "Conserver la transformation globale" msgid "Reparent" msgstr "Re-parenter" +msgid "Scene name is empty." +msgstr "Le nom de la scène est vide." + msgid "File name invalid." msgstr "Nom de fichier invalide." +msgid "File already exists." +msgstr "Le fichier existe déjà." + +msgid "Invalid root node name." +msgstr "Le nom du nœud racine n'est pas valide." + msgid "Invalid root node name characters have been replaced." msgstr "Les caractères non valides du nom du nœud racine ont été remplacés." @@ -13253,7 +13421,7 @@ msgid "Scene Name:" msgstr "Nom de la scène :" msgid "Root Name:" -msgstr "Nom de la racine :" +msgstr "Nom de la Racine :" msgid "" "When empty, the root node name is derived from the scene name based on the " @@ -13262,6 +13430,15 @@ msgstr "" "S'il est non renseigné, le nom du nœud racine est dérivé du nom de la scène " "d'après le paramètre du projet \"editor/naming/node_name_casing\"." +msgid "Scene name is valid." +msgstr "Le nom de la scène est valide." + +msgid "Root node valid." +msgstr "Le nœud racine est valide." + +msgid "Create New Scene" +msgstr "Créer une nouvelle scène" + msgid "Error loading scene from %s" msgstr "Erreur de chargement de la scène depuis %s" @@ -13380,6 +13557,9 @@ msgstr "Créer un nœud racine :" msgid "Other Node" msgstr "Autre nœud" +msgid "Paste From Clipboard" +msgstr "Coller depuis le presse-papiers" + msgid "Filters" msgstr "Filtres" @@ -13401,16 +13581,6 @@ msgstr "Supprimer le(s) nœud(s)" msgid "Change type of node(s)" msgstr "Changer le type de nœud (s)" -msgid "Removing the node from variable \"%s\" on node \"%s\"." -msgstr "Supprimer le nœud de la variable \"%s\" sur le nœud \"%s\"." - -msgid "" -"The node's new type is incompatible with an exported variable (expected %s, " -"but type is %s)." -msgstr "" -"Le nouveau type du nœud est incompatible avec l'une des variables exportées " -"(%s est attendu, mais le type est %s)." - msgid "This operation requires a single selected node." msgstr "" "Cette opération ne peut être réalisée uniquement avec un seul nœud " @@ -13442,6 +13612,15 @@ msgstr "Enfants modifiables" msgid "Auto Expand to Selected" msgstr "Auto-déplier jusqu'à la sélection" +msgid "Filter by Type" +msgstr "Filtrer par type" + +msgid "Filter by Group" +msgstr "Filtrer par groupe" + +msgid "Selects all Nodes of the given type." +msgstr "Sélectionne tous les nœuds d'un type donné." + msgid "" "Selects all Nodes belonging to the given group.\n" "If empty, selects any Node belonging to any group." @@ -13542,9 +13721,15 @@ msgstr "Le chemin est vide." msgid "Filename is empty." msgstr "Le nom de fichier est vide." +msgid "Filename is invalid." +msgstr "Le nom de fichier n'est pas valide." + msgid "Path is not local." msgstr "Le chemin n'est pas local." +msgid "Base path is invalid." +msgstr "Le chemin de base n'est pas valide." + msgid "A directory with the same name exists." msgstr "Un dossier du même nom existe déjà." @@ -13640,6 +13825,18 @@ msgstr "Le paramètre global de shaders '%s' existe déjà" msgid "Name '%s' is a reserved shader language keyword." msgstr "Le nom '%s' est un mot-clé réservé du langage de shader." +msgid "" +"This project uses meshes with an outdated mesh format. Check the output log." +msgstr "" +"Ce projet utilise des meshes avec un format obsolète. Vérifiez le journal de " +"sortie." + +msgid "Attempting to re-save " +msgstr "Tentative de ré-enregistrer " + +msgid "Restart & Upgrade" +msgstr "Redémarrer et mettre à jour" + msgid "Make this panel floating in the screen %d." msgstr "Rendre ce panneau flottant sur l'écran %d." @@ -13697,6 +13894,9 @@ msgid "Invalid instance dictionary (invalid subclasses)" msgstr "" "Instance invalide pour le format de dictionnaire (sous-classes invalides)" +msgid "Cannot instantiate GDScript class." +msgstr "Impossible d’instancier la classe GDScript." + msgid "Value of type '%s' can't provide a length." msgstr "La valeur de type '%s' ne peut fournir une longueur." @@ -13864,9 +14064,15 @@ msgstr "Optimise la structure d'accélération" msgid "Begin Bake" msgstr "Commencer le précalcul" +msgid "Integrate indirect lighting %d%%" +msgstr "Intégrer l'éclairage indirect %d%%" + msgid "Integrating light probes %d%%" msgstr "Intégration de sondes lumineuses %d%%" +msgid "Retrieving textures" +msgstr "Récupération des textures" + msgid "Class name can't be a reserved keyword" msgstr "Le nom de classe ne peut pas être un mot-clé réservé" @@ -13916,6 +14122,9 @@ msgstr "" "Veuillez installer le SDK .NET 6.0 ou ultérieur depuis https://dotnet." "microsoft.com/en-us/download et redémarrer Godot." +msgid "%d (%s)" +msgstr "%d (%s)" + msgid "%s/s" msgstr "%s/s" @@ -14033,6 +14242,12 @@ msgstr "Erreur de chargement %s : %s." msgid "Add an action set." msgstr "Ajouter un ensemble d'actions." +msgid "Add profile" +msgstr "Ajouter un profil" + +msgid "Add an interaction profile." +msgstr "Ajouter un profil d'interaction." + msgid "Save this OpenXR action map." msgstr "Enregistre cette carte d'action OpenXR." @@ -14161,6 +14376,9 @@ msgstr "Impossible d'exécuter sur l'appareil." msgid "Exporting to Android when using C#/.NET is experimental." msgstr "Exporter un projet C#/.NET vers Android est expérimental." +msgid "Android architecture %s not supported in C# projects." +msgstr "L'architecture Android %s n'est pas supportée dans les projets C#." + msgid "" "Android build template not installed in the project. Install it from the " "Project menu." @@ -14328,23 +14546,15 @@ msgstr "Impossible d'écrire le fichier du paquet d'expansion !" msgid "Building Android Project (gradle)" msgstr "Construire le Project Android (gradle)" -msgid "" -"Building of Android project failed, check output for the error. Alternatively " -"visit docs.godotengine.org for Android build documentation." +msgid "Building of Android project failed, check output for the error:" msgstr "" -"La construction du projet Android a échoué, vérifiez la sortie pour l'erreur. " -"Sinon, visitez docs.godotengine.org pour la documentation de construction " -"Android." +"La construction du projet Android a échoué, vérifier la sortie pour l'erreur :" msgid "Moving output" msgstr "Déplacement du résultat" -msgid "" -"Unable to copy and rename export file, check gradle project directory for " -"outputs." -msgstr "" -"Impossible de copier et de renommer le fichier d'export, vérifiez le dossier " -"du projet gradle pour les journaux." +msgid "Unable to copy and rename export file:" +msgstr "Impossible de copier et de renommer le fichier d'export :" msgid "Package not found: \"%s\"." msgstr "Paquet non trouvé : \"%s\"." @@ -14427,6 +14637,9 @@ msgstr "" msgid "Debug Script Export" msgstr "Exportation du script de débogage" +msgid "Could not open file \"%s\"." +msgstr "Impossible d'ouvrir le fichier « %s »." + msgid "Debug Console Export" msgstr "Exportation de la console de débogage" @@ -14443,6 +14656,9 @@ msgstr "" msgid "Executable \"pck\" section not found." msgstr "Section \"pck\" de l’exécutable non trouvée." +msgid "Stop and uninstall" +msgstr "Arrêter et désinstaller" + msgid "Run on remote Linux/BSD system" msgstr "Exécuter sur un système distant Linux/BSD" @@ -14452,9 +14668,27 @@ msgstr "Arrêter et désinstaller le projet en cours depuis le système distant" msgid "Run exported project on remote Linux/BSD system" msgstr "Exécuter le projet exporté sur un système distant Linux/BSD" +msgid "Running..." +msgstr "En cours d'exécution..." + msgid "Could not create temp directory:" msgstr "Impossible de créer le répertoire temporaire :" +msgid "Exporting project..." +msgstr "Exportation du projet..." + +msgid "Creating temporary directory..." +msgstr "Création d'un dossier temporaire..." + +msgid "Uploading archive..." +msgstr "Téléversement de l'archive..." + +msgid "Uploading scripts..." +msgstr "Téléversement des scripts…" + +msgid "Starting project..." +msgstr "Démarrage du projet..." + msgid "Can't get filesystem access." msgstr "Le système de fichiers ne peut être accédé." @@ -14523,6 +14757,13 @@ msgid "App sandbox is required for App Store distribution." msgstr "Un App Sandbox est nécessaire pour la distribution App Store." msgid "" +"'rcodesign' doesn't support signing applications with embedded dynamic " +"libraries (GDExtension or .NET)." +msgstr "" +"« rcodesign » ne prend pas en charge la signature des applications contenant " +"des bibliothèques dynamiques intégrées (GDExtension ou .NET)." + +msgid "" "Neither Apple ID name nor App Store Connect issuer ID name not specified." msgstr "" "Ni l'identifiant Apple, ni l'émetteur de l'App Store Connect ne sont " @@ -14562,6 +14803,9 @@ msgstr "" "Exécutez la commande suivante pour lier le ticket de certification avec " "l'application exporté (optionnel) :" +msgid "Xcode command line tools are not installed." +msgstr "Les outils en ligne de commande Xcode ne sont pas installés." + msgid "Could not start xcrun executable." msgstr "Impossible de démarrer le sous-processus." @@ -14617,6 +14861,9 @@ msgstr "" msgid "Could not created symlink \"%s\" -> \"%s\"." msgstr "Impossible de créer le lien symbolique \"%s\" -> \"%s\"." +msgid "Could not open \"%s\"." +msgstr "Impossible d'ouvrir « %s »." + msgid "" "Requested template binary \"%s\" not found. It might be missing from your " "template archive." @@ -14635,6 +14882,13 @@ msgstr "" "validation de bibliothèque\" pour pouvoir charger dynamiquement les " "bibliothèques." +msgid "" +"'rcodesign' doesn't support signing applications with embedded dynamic " +"libraries." +msgstr "" +"« rcodesign » ne prend pas en charge la signature d'applications contenant " +"des bibliothèques dynamiques intégrées." + msgid "Code signing bundle" msgstr "Paquet de signature du code" @@ -14686,6 +14940,11 @@ msgstr "" "Signature du code : utilise une signature ad-hoc. Le projet exporté sera " "bloqué par Gatekeeper" +msgid "Code signing: Xcode command line tools are not installed." +msgstr "" +"Signature du code : les outils en ligne de commande Xcode ne sont pas " +"installés." + msgid "Run on remote macOS system" msgstr "Exécuter sur un système macOS distant" @@ -15090,12 +15349,18 @@ msgstr "" "RigidBody3D, CharacterBody3D, etc. pour leur donner une forme." msgid "" +"WorldBoundaryShape3D doesn't support RigidBody3D in another mode than static." +msgstr "" +"WorldBoundaryShape3D ne supporte pas RigidBody3D dans un autre mode que le " +"mode statique." + +msgid "" "A non-uniformly scaled CollisionShape3D node will probably not function as " "expected.\n" "Please make its scale uniform (i.e. the same on all axes), and change the " "size of its shape resource instead." msgstr "" -"Un noeud CollisionShape3D non uniformément échelonné ne fonctionnera " +"Un nœud CollisionShape3D non uniformément échelonné ne fonctionnera " "probablement pas comme prévu.\n" "Veuillez modifier l'échelle pour la rendre uniforme (c'est-à-dire la même sur " "tous les axes), et changer la taille de sa ressource de forme à la place." @@ -15140,12 +15405,55 @@ msgstr "" "Pour résoudre cela, activez au moins un bit dans la propriété masque " "d'élagage." +msgid "Fog Volumes are only visible when using the Forward+ backend." +msgstr "" +"Les volumes de brouillard sont seulement visible quand le moteur de rendu " +"Forward+ est utilisé." + +msgid "" +"Fog Volumes need volumetric fog to be enabled in the scene's Environment in " +"order to be visible." +msgstr "" +"Pour être visibles, les volumes de brouillard doivent être activés dans " +"l'environnement de la scène." + msgid "Nothing is visible because meshes have not been assigned to draw passes." msgstr "" "Rien n'est visible car les maillages n'ont pas été assignés au tirage des " "passes." msgid "" +"Using Trail meshes with a skin causes Skin to override Trail poses. Suggest " +"removing the Skin." +msgstr "" +"L'utilisation de Trail meshes avec un skin fait que le Skin prévaut sur les " +"Trail poses. Il est suggéré de supprimer le skin." + +msgid "Trails active, but neither Trail meshes or a Skin were found." +msgstr "Trails actifs, mais aucune maille de Trail ou Skin n'a été trouvée." + +msgid "" +"Only one Trail mesh is supported. If you want to use more than a single mesh, " +"a Skin is needed (see documentation)." +msgstr "" +"Une seule mesh Trail est prise en charge. Si vous souhaitez utiliser plus " +"d'une maille, un Skin est nécessaire (voir la documentation)." + +msgid "" +"Trails enabled, but one or more mesh materials are either missing or not set " +"for trails rendering." +msgstr "" +"Trails activés, mais un ou plusieurs matériaux de mesh sont soit manquants, " +"soit non définis pour le rendu des trails." + +msgid "" +"Particle sub-emitters are only available when using the Forward+ or Mobile " +"rendering backends." +msgstr "" +"Les sous-émetteurs de particules ne sont disponibles que lors de " +"l'utilisation des backends de rendu Forward+ ou Mobile." + +msgid "" "The Bake Mask has no bits enabled, which means baking will not produce any " "collision for this GPUParticlesCollisionSDF3D.\n" "To resolve this, enable at least one bit in the Bake Mask property." @@ -15155,6 +15463,9 @@ msgstr "" "Pour résoudre ce problème, activer au moins un bit dans la propriété du " "masque de précalcul." +msgid "A light's scale does not affect the visual size of the light." +msgstr "L'échelle d'un feu n'affecte pas la taille visuelle du feu." + msgid "Projector texture only works with shadows active." msgstr "La texture du projecteur fonctionne uniquement avec les ombres actives." @@ -15210,6 +15521,18 @@ msgstr "" "de fin pour être utile." msgid "" +"Occlusion culling is disabled in the Project Settings, which means occlusion " +"culling won't be performed in the root viewport.\n" +"To resolve this, open the Project Settings and enable Rendering > Occlusion " +"Culling > Use Occlusion Culling." +msgstr "" +"L'élagage de l'occlusion est désactivé dans les paramètres du projet, ce qui " +"signifie que l'élagage de l'occlusion ne sera pas effectué dans la fenêtre " +"racine.\n" +"Pour résoudre ce problème, ouvrez les paramètres du projet et activez les " +"options Rendu > Élagage de l'occlusion > Utiliser l'élagage de l'occlusion." + +msgid "" "The Bake Mask has no bits enabled, which means baking will not produce any " "occluder meshes for this OccluderInstance3D.\n" "To resolve this, enable at least one bit in the Bake Mask property." @@ -15220,6 +15543,21 @@ msgstr "" "masque de précalcul." msgid "" +"No occluder mesh is defined in the Occluder property, so no occlusion culling " +"will be performed using this OccluderInstance3D.\n" +"To resolve this, set the Occluder property to one of the primitive occluder " +"types or bake the scene meshes by selecting the OccluderInstance3D and " +"pressing the Bake Occluders button at the top of the 3D editor viewport." +msgstr "" +"Aucun maillage d'occlusion n'est défini dans la propriété Occluder, de sorte " +"qu'aucun filtrage d'occlusion ne sera effectué à l'aide de cette " +"OccluderInstance3D.\n" +"Pour résoudre ce problème, définissez la propriété Occluder sur l'un des " +"types d'occluder primitifs ou faites cuire les maillages de la scène en " +"sélectionnant l'OccluderInstance3D et en appuyant sur le bouton Calculer les " +"occluders en haut de la fenêtre de l'éditeur 3D." + +msgid "" "This node cannot interact with other objects unless a Shape3D is assigned." msgstr "" "Ce nœud ne peut pas interagir avec d'autres objets, sauf si une Shape3D est " @@ -15278,7 +15616,7 @@ msgid "Copy this constructor in a script." msgstr "Copier ce constructeur dans un script." msgid "Enter a hex code (\"#ff0000\") or named color (\"red\")." -msgstr "Entrer un code hexa (\"#ff0000\") ou un nom de couleur (\"red\")." +msgstr "Entrez un code hexadécimal («#ff0000») ou le nom d'une couleur («red»)." msgid "" "Color: #%s\n" @@ -15306,7 +15644,7 @@ msgid "Switch between hexadecimal and code values." msgstr "Alterner entre les valeurs hexadécimales ou brutes." msgid "Hex code or named color" -msgstr "Code hexa ou nom de couleur" +msgstr "Code hexadécimal ou nom de couleur" msgid "Add current color as a preset." msgstr "Ajouter la couleur courante comme préréglage." @@ -15460,15 +15798,6 @@ msgstr "" "réenregistrées sans risque de pertes de données." msgid "" -"Setting node name '%s' to be unique within scene for '%s', but it's already " -"claimed by '%s'.\n" -"'%s' is no longer set as having a unique name." -msgstr "" -"Impossible de déclarer le nom de nœud '%s' comme unique dans la scène pour " -"'%s', car ce nom est déjà attribué à '%s'.\n" -"'%s' n'est plus considéré comme ayant un nom unique." - -msgid "" "This node is marked as deprecated and will be removed in future versions.\n" "Please check the Godot documentation for information about migration." msgstr "" @@ -15509,21 +15838,6 @@ msgstr "" "La taille de la fenêtre d'affichage doit être supérieure ou égale à 2 pixels " "dans les deux sens pour que le rendu soit possible." -msgid "Version %d of BMFont is not supported (should be 3)." -msgstr "Version %d de BMFont n'est pas supportée (devrait être 3)." - -msgid "Invalid BMFont info block size." -msgstr "Taille du bloc info BMFont invalide." - -msgid "Invalid BMFont common block size." -msgstr "Taille du bloc common BMFont invalide." - -msgid "Can't load font texture: %s." -msgstr "Ne peut charger la texture de la police de caractère : %s." - -msgid "Unsupported BMFont texture format." -msgstr "Format de texture BMFont non pris en charge." - msgid "" "Shader keywords cannot be used as parameter names.\n" "Choose another name." @@ -15577,6 +15891,9 @@ msgstr "Fonction de comparaison invalide pour ce type." msgid "Invalid arguments for the built-in function: \"%s(%s)\"." msgstr "Arguments invalides pour la fonction intégrée : \"%s(%s)\"." +msgid "Recursion is not allowed." +msgstr "La récursivité n'est pas autorisée." + msgid "Invalid assignment of '%s' to '%s'." msgstr "Assignation invalide de '%s' à '%s'." @@ -15595,6 +15912,15 @@ msgstr "Affectation à la variable uniform." msgid "Constants cannot be modified." msgstr "Les constantes ne peuvent être modifiées." +msgid "Array size is already defined." +msgstr "La taille du tableau est déjà définie." + +msgid "Unknown array size is forbidden in that context." +msgstr "Une taille de tableau inconnue est interdite dans ce contexte." + +msgid "Array size mismatch." +msgstr "La taille du tableau ne correspond pas." + msgid "Cannot convert from '%s' to '%s'." msgstr "Impossible de convertir '%s' en '%s'." @@ -15614,9 +15940,15 @@ msgid "Varying '%s' cannot be passed for the '%s' parameter in that context." msgstr "" "La varying '%s' ne peut pas être passé pour le paramètre'%s' dans ce contexte." +msgid "Index [%d] out of range [%d..%d]." +msgstr "L'index [%d] est en dehors de l'intervalle [%d..%d]." + msgid "Invalid member for '%s' expression: '.%s'." msgstr "Membre invalide pour l'expression '%s' : '%s'." +msgid "An object of type '%s' can't be indexed." +msgstr "Un objet de type « %s » ne peut pas être indexé." + msgid "Unexpected end of expression." msgstr "Fin d'expression inattendue." @@ -15633,30 +15965,154 @@ msgid "Invalid variable type (samplers are not allowed)." msgstr "" "Type de variable non valide (les échantillonneurs ne sont pas autorisés)." +msgid "Cases must be defined before default case." +msgstr "Les différents cas doivent être définis avant le cas par défaut." + +msgid "Default case must be defined only once." +msgstr "Le cas par défaut ne doit être défini qu'une seule fois." + msgid "Duplicated case label: %d." msgstr "Étiquette de cas dupliquée : %d." +msgid "'%s' is not allowed outside of a loop." +msgstr "« %s » n'est pas autorisé en dehors d'une boucle." + +msgid "The middle expression is expected to be a boolean operator." +msgstr "L'expression du milieu doit être un opérateur booléen." + +msgid "The left expression is expected to be a variable declaration." +msgstr "L'expression de gauche doit être une déclaration de variable." + +msgid "Invalid shader type. Valid types are: %s" +msgstr "Type de shader non valide. Les types valides sont : %s" + msgid "Duplicated render mode: '%s'." msgstr "Mode de rendu dupliqué : '%s'." +msgid "" +"Redefinition of render mode: '%s'. The '%s' mode has already been set to '%s'." +msgstr "" +"Redéfinition du mode de rendu : « %s ». Le mode « %s » a déjà été défini sur " +"« %s »." + +msgid "Invalid render mode: '%s'." +msgstr "Mode de rendu non valide : « %s »." + +msgid "Unexpected token: '%s'." +msgstr "Jeton inattendu : « %s »." + +msgid "Nested structs are not allowed." +msgstr "Les structures imbriquées ne sont pas autorisées." + msgid "Expected data type." msgstr "Type de données attendu." +msgid "Empty structs are not allowed." +msgstr "Les structures vides ne sont pas autorisées." + +msgid "The '%s' data type is not allowed here." +msgstr "Le type de donnée « %s » n'est pas autorisé ici." + +msgid "Expected valid type hint after ':'." +msgstr "Indice de type valide attendu après « : »." + +msgid "This hint is not supported for uniform arrays." +msgstr "Cette aide n'est pas prise en charge pour les tableaux uniformes." + +msgid "Source color hint is for '%s', '%s' or sampler types only." +msgstr "" +"L'aide de la couleur de la source ne concerne que les types « %s », « %s » ou " +"les types de sampler." + msgid "Duplicated hint: '%s'." msgstr "Suggestion dupliquée : '%s'." +msgid "Range hint is for '%s' and '%s' only." +msgstr "L'aide de plage ne concerne que « %s » et « %s »." + +msgid "Expected ',' after integer constant." +msgstr "Un « , » est attendu après une constante entière." + msgid "Can only specify '%s' once." msgstr "Ne peut spécifier '%s' qu'une fois." msgid "The instance index can't be negative." msgstr "L'index de l'instance ne peut pas être négatif." +msgid "Allowed instance uniform indices must be within [0..%d] range." +msgstr "" +"Les indices uniformes d'instance autorisés doivent être compris dans la plage " +"[0..%d]." + +msgid "" +"'hint_normal_roughness_texture' is only available when using the Forward+ " +"backend." +msgstr "" +"« hint_normal_roughness_texture » n'est disponible que lors de l'utilisation " +"du backend Forward+." + +msgid "'hint_normal_roughness_texture' is not supported in '%s' shaders." +msgstr "" +"« hint_normal_roughness_texture » n'est pas supporté dans les shaders « %s »." + +msgid "'hint_depth_texture' is not supported in '%s' shaders." +msgstr "« hint_depth_texture » n'est pas supporté dans les shaders « %s »." + +msgid "This hint is only for sampler types." +msgstr "Cette aide ne concerne que les types de sampler." + +msgid "Redefinition of hint: '%s'. The hint has already been set to '%s'." +msgstr "Redéfinition de l'indice : « %s ». L'indice a déjà été défini à « %s »." + msgid "Duplicated filter mode: '%s'." msgstr "Mode de filtrage dupliqué : '%s'." +msgid "" +"Redefinition of filter mode: '%s'. The filter mode has already been set to " +"'%s'." +msgstr "" +"Redéfinition du mode de filtrage : « %s ». Le mode de filtrage a déjà été " +"défini sur « %s »." + msgid "Duplicated repeat mode: '%s'." msgstr "Mode de répétition dupliqué : '%s'." +msgid "" +"Redefinition of repeat mode: '%s'. The repeat mode has already been set to " +"'%s'." +msgstr "" +"Redéfinition du mode de répétition : « %s ». Le mode de répétition a déjà été " +"défini à « %s »." + +msgid "Too many '%s' uniforms in shader, maximum supported is %d." +msgstr "Trop d'uniformes '%s' dans le shader, le maximum supporté est %d." + +msgid "Setting default values to uniform arrays is not supported." +msgstr "" +"La définition de valeurs par défaut pour les tableaux uniformes n'est pas " +"prise en charge." + +msgid "Expected constant expression after '='." +msgstr "Une expression de constante est attendu après un « = »." + +msgid "Expected an uniform subgroup identifier." +msgstr "Un identifiant de sous-groupe uniforme est attendu." + +msgid "Expected an uniform group identifier." +msgstr "Un identifiant de groupe uniforme est attendu." + +msgid "Expected an uniform group identifier or `;`." +msgstr "Un identifiant de groupe uniforme ou « ; » est attendu." + +msgid "Group needs to be opened before." +msgstr "Un groupe a besoin d'être ouvert avant." + +msgid "Shader type is already defined." +msgstr "Le type de shader est déjà défini." + +msgid "Expected constant, function, uniform or varying." +msgstr "Une constante, une fonction, un uniforme ou une varying est attendu." + msgid "Invalid constant type (samplers are not allowed)." msgstr "" "Type de constante invalide (les échantillonneurs ne sont pas autorisés)." @@ -15664,6 +16120,25 @@ msgstr "" msgid "Invalid function type (samplers are not allowed)." msgstr "Type de fonction invalide (les échantillonneurs ne sont pas autorisés)." +msgid "" +"Global non-constant variables are not supported. Expected '%s' keyword before " +"constant definition." +msgstr "" +"Les variables globales non constantes ne sont pas prises en charge. Mot-clé " +"« %s » attendu avant la définition de la constante." + +msgid "Expected an identifier after type." +msgstr "Un identifiant après le type est attendu." + +msgid "Expected a valid data type for argument." +msgstr "Un type de donnée valide pour argument est espéré." + +msgid "Void type not allowed as argument." +msgstr "Le type void n'est pas autorisé comme argument." + +msgid "Expected an identifier for argument name." +msgstr "Un identifieur est attendu pour le nom de l'argument." + msgid "Function '%s' expects no arguments." msgstr "Méthode '%s' n'attend aucun argument." @@ -15676,6 +16151,9 @@ msgstr "Attendait un '{' pour commencer une méthode." msgid "Expected at least one '%s' statement in a non-void function." msgstr "Attendait au moins une déclaration '%s' dans une méthode non void." +msgid "uniform buffer" +msgstr "tampon uniforme" + msgid "Expected a '%s'." msgstr "Un '%s' est attendu." @@ -15691,6 +16169,9 @@ msgstr "Redéfinition de '%s'." msgid "Unknown directive." msgstr "Instruction inconnue." +msgid "Invalid macro name." +msgstr "Nom de macro non valide." + msgid "Macro redefinition." msgstr "Redéfinition des macros." @@ -15698,7 +16179,13 @@ msgid "Invalid argument name." msgstr "Nom d'argument invalide." msgid "Expected a comma in the macro argument list." -msgstr "Attendait une virgule dans la liste des arguments de la macro." +msgstr "Une virgule est attendue dans la liste des arguments de la macro." + +msgid "'##' must not appear at beginning of macro expansion." +msgstr "« ## » ne doit pas apparaître au début d'une expansion de macro." + +msgid "'##' must not appear at end of macro expansion." +msgstr "« ## » ne doit pas apparaître à la fin d'une expansion de macro." msgid "Unmatched elif." msgstr "Elif inégal." @@ -15730,9 +16217,15 @@ msgstr "Ifndef invalide." msgid "Shader include file does not exist:" msgstr "Le fichier appelé par \"include\" dans le shader n'existe pas :" +msgid "Shader include resource type is wrong." +msgstr "Le type de ressource incluse dans le shader est incorrect." + msgid "Cyclic include found" msgstr "'Include' cyclique trouvé" +msgid "Invalid pragma directive." +msgstr "Directive pragma non valide." + msgid "Invalid undef." msgstr "Undef invalide." @@ -15751,6 +16244,9 @@ msgstr "Compteur d'arguments de macro invalide." msgid "Can't find matching branch directive." msgstr "Impossible de trouver une directive de branche correspondante." +msgid "Invalid symbols placed before directive." +msgstr "Symboles non valides placés devant la directive." + msgid "Unmatched conditional statement." msgstr "Déclaration conditionnelle non valide." diff --git a/editor/translations/editor/gl.po b/editor/translations/editor/gl.po index 58b20c5895..3dbb61edec 100644 --- a/editor/translations/editor/gl.po +++ b/editor/translations/editor/gl.po @@ -9,20 +9,20 @@ # davidrogel <david.rogel.pernas@icloud.com>, 2021. # David Salcas <davisalcas@gmail.com>, 2023. # David Fernández Pérez <davidfernandezperez.thezombrex@gmail.com>, 2023. +# Carlos Cortes Garcia <carlos.cortes.games@gmail.com>, 2023. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor interface\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" -"PO-Revision-Date: 2023-10-04 02:10+0000\n" -"Last-Translator: David Fernández Pérez <davidfernandezperez.thezombrex@gmail." -"com>\n" +"PO-Revision-Date: 2023-12-11 21:00+0000\n" +"Last-Translator: Carlos Cortes Garcia <carlos.cortes.games@gmail.com>\n" "Language-Team: Galician <https://hosted.weblate.org/projects/godot-engine/" "godot/gl/>\n" "Language: gl\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8-bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.1-dev\n" +"X-Generator: Weblate 5.3-dev\n" msgid "Main Thread" msgstr "Fío principal" @@ -198,6 +198,12 @@ msgstr "Xesto de ampliación en (%s) co factor %s" msgid "Pan Gesture at (%s) with delta (%s)" msgstr "Xesto panorámico en (%s) con delta (%s)" +msgid "MIDI Input on Channel=%s Message=%s" +msgstr "Entrada MIDI no Canal=%s Mensaxe=%s" + +msgid "Input Event with Shortcut=%s" +msgstr "Evento de Entrada con atallo=%s" + msgid "Accept" msgstr "Aceptar" @@ -273,6 +279,9 @@ msgstr "Reducción de sangría" msgid "Backspace" msgstr "Retroceso" +msgid "Backspace Word" +msgstr "Retroceder Palabra" + msgid "Backspace all to Left" msgstr "Retroceder todo á esquerda" @@ -297,12 +306,36 @@ msgstr "Cursor Dereita" msgid "Caret Word Right" msgstr "Cursor Palabra Dereita" +msgid "Caret Up" +msgstr "Cursor Enriba" + +msgid "Caret Down" +msgstr "Cursor Abaixo" + +msgid "Caret Line Start" +msgstr "Comezo da Línea do Cursor" + +msgid "Caret Line End" +msgstr "Cursor Final da Línea" + msgid "Caret Page Up" msgstr "Cursor Páxina Superior" +msgid "Caret Page Down" +msgstr "Cursor Páxina Inferior" + msgid "Caret Document Start" msgstr "Cursor Inicio do Documento" +msgid "Caret Document End" +msgstr "Cursor Final do Documento" + +msgid "Caret Add Below" +msgstr "Cursor Engadir Abaixo" + +msgid "Caret Add Above" +msgstr "Cursor Engadir Enriba" + msgid "Scroll Up" msgstr "Desprazamento cara arriba" @@ -312,6 +345,9 @@ msgstr "Desprazamento cara abaixo" msgid "Select All" msgstr "Seleccionar Todo" +msgid "Select Word Under Caret" +msgstr "Seleccionar Palabra Debaixo do Cursor" + msgid "Add Selection for Next Occurrence" msgstr "Engadir selección para a próxima aparición" @@ -468,6 +504,15 @@ msgstr "Duplicar Clave(s) Seleccionadas(s)" msgid "Delete Selected Key(s)" msgstr "Eliminar Clave(s) Seleccionada(s)" +msgid "Make Handles Free" +msgstr "Liberar os Manipuladores" + +msgid "Make Handles Linear" +msgstr "Facer os Manipuladores Lineais" + +msgid "Make Handles Balanced" +msgstr "Facer os Manipuladores equilibrados" + msgid "Add Bezier Point" msgstr "Engadir Punto Bezier" @@ -1556,21 +1601,6 @@ msgstr "Patrocinadores Ouro" msgid "Silver Sponsors" msgstr "Patrocinadores Prata" -msgid "Bronze Sponsors" -msgstr "Patrocinadores Bronce" - -msgid "Mini Sponsors" -msgstr "Patrocinadores Mini" - -msgid "Gold Donors" -msgstr "Doadores Ouro" - -msgid "Silver Donors" -msgstr "Doadores Prata" - -msgid "Bronze Donors" -msgstr "Doadores Bronce" - msgid "Donors" msgstr "Doadores" @@ -2419,17 +2449,6 @@ msgstr "" "Desactive o complemento en '%s' para evitar máis erros." msgid "" -"Unable to load addon script from path: '%s' Base type is not EditorPlugin." -msgstr "" -"Non se puido cargar o Script da característica adicional (Plugin): O tipo " -"base de %s non é EditorPlugin." - -msgid "Unable to load addon script from path: '%s' Script is not in tool mode." -msgstr "" -"Non se puido cargar Script de característica adicional (Addon) na ruta: '%s'. " -"O script non está en modo ferramenta (tool)." - -msgid "" "Scene '%s' was automatically imported, so it can't be modified.\n" "To make changes to it, a new inherited scene can be created." msgstr "" @@ -2754,6 +2773,9 @@ msgstr "" msgid "Make Unique" msgstr "Facer Único" +msgid "Save As..." +msgstr "Gardar Como..." + msgid "Show in FileSystem" msgstr "Amosar no Sistema de Arquivos" @@ -3259,9 +3281,6 @@ msgstr "Fallou a carga do Recurso." msgid "Raw" msgstr "Sen Procesar (Raw)" -msgid "Save As..." -msgstr "Gardar Como..." - msgid "Copy Resource" msgstr "Copiar Recurso" @@ -5175,14 +5194,6 @@ msgid "Building Android Project (gradle)" msgstr "Construir Proxecto Android (gradle)" msgid "" -"Building of Android project failed, check output for the error. Alternatively " -"visit docs.godotengine.org for Android build documentation." -msgstr "" -"A creación do proxecto para Android fallou, comproba a saída para encontrar o " -"erro. Alternativamente visita docs.godotengine.org para ver a documentación " -"sobre compilación para Android." - -msgid "" "This node has no shape, so it can't collide or interact with other objects.\n" "Consider adding a CollisionShape2D or CollisionPolygon2D as a child to define " "its shape." diff --git a/editor/translations/editor/he.po b/editor/translations/editor/he.po index 5fb6252472..764b4a1102 100644 --- a/editor/translations/editor/he.po +++ b/editor/translations/editor/he.po @@ -1050,21 +1050,6 @@ msgstr "מממני זהב" msgid "Silver Sponsors" msgstr "תורמים בדרגת כסף" -msgid "Bronze Sponsors" -msgstr "תורמים בדרגת ארד" - -msgid "Mini Sponsors" -msgstr "מממנים קטנים" - -msgid "Gold Donors" -msgstr "תורמים בדרגת זהב" - -msgid "Silver Donors" -msgstr "תורמים בדרגת כסף" - -msgid "Bronze Donors" -msgstr "תורמים בדרגת ארד" - msgid "Donors" msgstr "תורמים" @@ -1882,13 +1867,6 @@ msgstr "" "יש לבטל את ההרחבה ,%s, כדי למנוע שגיאות נוספות." msgid "" -"Unable to load addon script from path: '%s' Base type is not EditorPlugin." -msgstr "לא ניתן לטעון סקריפט הרחבה מנתיב: '%s' סוג הבסיס אינו EditorPlugin." - -msgid "Unable to load addon script from path: '%s' Script is not in tool mode." -msgstr "לא ניתן לטעון סקריפט הרחבה מנתיב: '%s' סקריפט אינו מוגדר ככלי (tool)." - -msgid "" "Scene '%s' was automatically imported, so it can't be modified.\n" "To make changes to it, a new inherited scene can be created." msgstr "" @@ -2200,6 +2178,9 @@ msgstr "מחרוזת ניתנת לתרגום (גודל %d)" msgid "Make Unique" msgstr "הפוך לייחודי" +msgid "Save As..." +msgstr "שמירה בשם…" + msgid "Show in FileSystem" msgstr "הצגה בחלון הקבצים" @@ -2667,9 +2648,6 @@ msgstr "טעינת משאב קיים מהכונן ועריכתו." msgid "Save the currently edited resource." msgstr "שמירת המשאב שנערך כרגע." -msgid "Save As..." -msgstr "שמירה בשם…" - msgid "Copy Resource" msgstr "העתקת משאב" diff --git a/editor/translations/editor/hu.po b/editor/translations/editor/hu.po index 55ad65786d..3bc2c4e019 100644 --- a/editor/translations/editor/hu.po +++ b/editor/translations/editor/hu.po @@ -1146,21 +1146,6 @@ msgstr "Arany Szponzorok" msgid "Silver Sponsors" msgstr "Ezüst adományozók" -msgid "Bronze Sponsors" -msgstr "Bronz adományozók" - -msgid "Mini Sponsors" -msgstr "Mini Szponzorok" - -msgid "Gold Donors" -msgstr "Arany Adományozók" - -msgid "Silver Donors" -msgstr "Ezüst Adományozók" - -msgid "Bronze Donors" -msgstr "Bronz Adományozók" - msgid "Donors" msgstr "Adományozók" @@ -1865,17 +1850,6 @@ msgid "Unable to load addon script from path: '%s'." msgstr "Nem sikerült az addon szkript betöltése a következő útvonalról: '%s'." msgid "" -"Unable to load addon script from path: '%s' Base type is not EditorPlugin." -msgstr "" -"Nem sikerült az addon szkript betöltése a következő útvonalról: '%s' Az " -"alaptípus nem EditorPlugin." - -msgid "Unable to load addon script from path: '%s' Script is not in tool mode." -msgstr "" -"Nem sikerült az addon szkript betöltése a következő útvonalról: '%s' A " -"szkript nem eszközmódban van." - -msgid "" "Scene '%s' was automatically imported, so it can't be modified.\n" "To make changes to it, a new inherited scene can be created." msgstr "" @@ -2206,6 +2180,9 @@ msgstr "Kulcs/érték pár hozzáadása" msgid "Make Unique" msgstr "Egyedivé tétel" +msgid "Save As..." +msgstr "Mentés Másként..." + msgid "Show in FileSystem" msgstr "Megjelenítés a fájlrendszerben" @@ -2718,9 +2695,6 @@ msgstr "Meglévő erőforrás betöltése a lemezről, majd annak szerkesztése. msgid "Save the currently edited resource." msgstr "A jelenleg szerkesztett erőforrás elmentése." -msgid "Save As..." -msgstr "Mentés Másként..." - msgid "Copy Resource" msgstr "Erőforrás Másolása" diff --git a/editor/translations/editor/id.po b/editor/translations/editor/id.po index 997d3d9a37..4c6d1ef46f 100644 --- a/editor/translations/editor/id.po +++ b/editor/translations/editor/id.po @@ -12,7 +12,7 @@ # Reza Hidayat Bayu Prabowo <rh.bayu.prabowo@gmail.com>, 2018, 2019. # Romi Kusuma Bakti <romikusumab@gmail.com>, 2017, 2018, 2021. # Sofyan Sugianto <sofyanartem@gmail.com>, 2017-2018, 2019, 2020, 2021. -# Tito <ijavadroid@gmail.com>, 2018. +# Tito <ijavadroid@gmail.com>, 2018, 2023. # Tom My <tom.asadinawan@gmail.com>, 2017. # yursan9 <rizal.sagi@gmail.com>, 2016. # Evan Hyacinth <muhammad.ivan669@gmail.com>, 2018, 2019. @@ -54,13 +54,15 @@ # Luqman Firmansyah <luqm4n.firm4n@gmail.com>, 2023. # Bayu Satiyo <itsyuukunz@gmail.com>, 2023. # Avirur Rahman <avirahmandev@gmail.com>, 2023. +# Nazan <121859424+nazhard@users.noreply.github.com>, 2023. +# ekaknl22 <2200018407@webmail.uad.ac.id>, 2023. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor interface\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-10-23 06:30+0000\n" -"Last-Translator: ProgrammerIndonesia 44 <elo.jhy@gmail.com>\n" +"PO-Revision-Date: 2023-11-28 04:14+0000\n" +"Last-Translator: Tito <ijavadroid@gmail.com>\n" "Language-Team: Indonesian <https://hosted.weblate.org/projects/godot-engine/" "godot/id/>\n" "Language: id\n" @@ -68,7 +70,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 5.1\n" +"X-Generator: Weblate 5.3-dev\n" msgid "Main Thread" msgstr "Utas Utama" @@ -322,7 +324,7 @@ msgid "Dedent" msgstr "Dedentasi" msgid "Backspace" -msgstr "Kembali" +msgstr "Backspace" msgid "Backspace Word" msgstr "Hapus Word" @@ -591,6 +593,15 @@ msgstr "Batalkan Pilihan Semua Kunci" msgid "Animation Change Transition" msgstr "Ubah Transisi Animasi" +msgid "Animation Change Position3D" +msgstr "Ubah Transisi Animasi3D" + +msgid "Animation Change Rotation3D" +msgstr "Ubah Transisi Animasi 3D" + +msgid "Animation Change Scale3D" +msgstr "Ubah Animasi Skala3D" + msgid "Animation Change Keyframe Value" msgstr "Ubah Nilai Keyframe Animasi" @@ -600,6 +611,15 @@ msgstr "Ubah Panggilan Animasi" msgid "Animation Multi Change Transition" msgstr "Ubah Beberapa Transisi Animasi" +msgid "Animation Multi Change Position3D" +msgstr "Ubah Beberapa Posisi3D Animasi" + +msgid "Animation Multi Change Rotation3D" +msgstr "Ubah Beberapa Rotasi Animasi3D" + +msgid "Animation Multi Change Scale3D" +msgstr "Ubah Beberapa Skala3D Animasi" + msgid "Animation Multi Change Keyframe Value" msgstr "Ubah Beberapa Nilai Keyframe Animasi" @@ -814,6 +834,9 @@ msgstr "" msgid "Remove Anim Track" msgstr "Hapus Trek Anim" +msgid "Hold Shift when clicking the key icon to skip this dialog." +msgstr "Tahan Shift saat mengklik ikon kunci untuk melewati dialog ini." + msgid "Create new track for %s and insert key?" msgstr "Buat track baru untuk %s dan sisipkan kunci?" @@ -915,7 +938,7 @@ msgid "Scale" msgstr "Skala" msgid "BlendShape" -msgstr "BlendShape" +msgstr "BentukCampuran" msgid "Methods" msgstr "Metode" @@ -945,6 +968,9 @@ msgstr "Opsi ini tidak bisa untuk mengedit Bezier, karena hanya satu track." msgid "Animation Add RESET Keys" msgstr "Animasi Tambahkan Kunci RESET" +msgid "Bake Animation as Linear Keys" +msgstr "Bake Animasi sebagai Kunci Linier" + msgid "" "This animation belongs to an imported scene, so changes to imported tracks " "will not be saved.\n" @@ -964,8 +990,24 @@ msgstr "" "khusus, aktifkan \"Simpan Ke File\" dan\n" "\"Simpan Trek Khusus\"." +msgid "" +"Some AnimationPlayerEditor's options are disabled since this is the dummy " +"AnimationPlayer for preview.\n" +"\n" +"The dummy player is forced active, non-deterministic and doesn't have the " +"root motion track. Furthermore, the original node is inactive temporary." +msgstr "" +"Beberapa opsi AnimationPlayerEditor dinonaktifkan karena ini adalah " +"AnimationPlayer tiruan untuk pratinjau.\n" +"\n" +"Pemain tiruan dipaksa aktif, non-deterministik dan tidak memiliki jalur gerak " +"root. Selain itu, node asli tidak aktif sementara." + +msgid "AnimationPlayer is inactive. The playback will not be processed." +msgstr "AnimationPlayer mati. Putar ulang tidak akan diproses." + msgid "Select an AnimationPlayer node to create and edit animations." -msgstr "Lokasi untuk node AnimationPlayer yang mengandung animasi belum diatur." +msgstr "Pilih node AnimationPlayer untuk membuat dan mengedit animasi." msgid "Imported Scene" msgstr "Adegan yang Diimpor" @@ -973,6 +1015,18 @@ msgstr "Adegan yang Diimpor" msgid "Warning: Editing imported animation" msgstr "Peringatan: Menyunting animasi yang diimpor" +msgid "Dummy Player" +msgstr "Pemain Tiruan" + +msgid "Warning: Editing dummy AnimationPlayer" +msgstr "Peringatan: Sedang menyunting tiruan AnimationPlayer" + +msgid "Inactive Player" +msgstr "Player Nonaktif" + +msgid "Warning: AnimationPlayer is inactive" +msgstr "Peringatan: AnimationPlayer tidak aktif" + msgid "Toggle between the bezier curve editor and track editor." msgstr "Beralih antara editor kurva bezier dan editor trek." @@ -980,13 +1034,13 @@ msgid "Only show tracks from nodes selected in tree." msgstr "Hanya tampilkan track dari node terpilih dalam tree." msgid "Group tracks by node or display them as plain list." -msgstr "Susun Track-track dengan node atau tampilkan sebagai daftar biasa." +msgstr "Susun track berdasarkan node atau tampilkan sebagai daftar biasa." msgid "Snap:" -msgstr "Senap:" +msgstr "Tangkapan:" msgid "Animation step value." -msgstr "Nilai Langkah Animasi." +msgstr "Nilai langkah animasi." msgid "Seconds" msgstr "Detik" @@ -998,7 +1052,7 @@ msgid "Edit" msgstr "Sunting" msgid "Animation properties." -msgstr "Properti Animasi." +msgstr "Properti animasi." msgid "Copy Tracks" msgstr "Salin Trek-trek" @@ -1031,7 +1085,7 @@ msgid "Apply Reset" msgstr "Terapkan Reset" msgid "Bake Animation" -msgstr "Bake Animasi" +msgstr "Ubah Animasi" msgid "Optimize Animation (no undo)" msgstr "Optimalkan Animasi (tanpa undo)" @@ -1064,7 +1118,7 @@ msgid "Optimize" msgstr "Optimalkan" msgid "Remove invalid keys" -msgstr "Hapus Tombol-tombol yang tidak sah" +msgstr "Hapus Tombol-tombol yang tidak valid" msgid "Remove unresolved and empty tracks" msgstr "Hapus tracks yang kosong dan belum diselesaikan" @@ -1222,6 +1276,14 @@ msgstr "Ganti Semua" msgid "Selection Only" msgstr "Hanya yang Dipilih" +msgctxt "Indentation" +msgid "Spaces" +msgstr "Sepasi" + +msgctxt "Indentation" +msgid "Tabs" +msgstr "Tab" + msgid "Toggle Scripts Panel" msgstr "Jungkitkan Panel Skrip" @@ -1634,6 +1696,9 @@ msgstr "Putuskan" msgid "Continue" msgstr "Lanjutkan" +msgid "Thread:" +msgstr "Untai:" + msgid "Stack Frames" msgstr "Stack Frame" @@ -1737,7 +1802,7 @@ msgstr "Cari Resource Pengganti:" msgid "Open Scene" msgid_plural "Open Scenes" -msgstr[0] "Buka Skene" +msgstr[0] "Buka Skena" msgid "Open" msgstr "Buka" @@ -1815,6 +1880,12 @@ msgstr "Nama folder tidak boleh kosong." msgid "Folder name contains invalid characters." msgstr "Nama folder berisi karakter yang tidak valid." +msgid "Folder name cannot begin or end with a space." +msgstr "Nama folder tidak boleh dimulai atau di akhiri dengan spasi." + +msgid "Folder name cannot begin with a dot." +msgstr "Nama folder tidak boleh dimulai atau di akhiri dengan titik." + msgid "File with that name already exists." msgstr "File dengan nama itu sudah ada." @@ -1863,6 +1934,9 @@ msgstr "Pengembang" msgid "Authors" msgstr "Pengarang" +msgid "Patrons" +msgstr "Patron" + msgid "Platinum Sponsors" msgstr "Sponsor Platinum" @@ -1872,20 +1946,14 @@ msgstr "Sponsor Emas" msgid "Silver Sponsors" msgstr "Donatur Perak" -msgid "Bronze Sponsors" -msgstr "Donatur Perunggu" - -msgid "Mini Sponsors" -msgstr "Sponsor Mini" - -msgid "Gold Donors" -msgstr "Donatur Emas" +msgid "Diamond Members" +msgstr "Donatur Bertingkat Diamon" -msgid "Silver Donors" -msgstr "Donatur Perak" +msgid "Titanium Members" +msgstr "Donatur Bertingkat Titanium" -msgid "Bronze Donors" -msgstr "Donatur Perunggu" +msgid "Gold Members" +msgstr "Donatur Bertingkat Gold" msgid "Donors" msgstr "Donatur" @@ -1922,6 +1990,19 @@ msgstr "Gagal saat membuka berkas aset untuk \"%s\" (tidak dalam format ZIP)." msgid "%s (already exists)" msgstr "%s (sudah ada)" +msgid "%d file conflicts with your project and won't be installed" +msgid_plural "%d files conflict with your project and won't be installed" +msgstr[0] "%d file konflik denfan proyek anda dan tidak mau di pasang" + +msgid "This asset doesn't have a root directory, so it can't be ignored." +msgstr "Aset ini tidak memiliki folder akar, jadi tudak dapat di abaikan." + +msgid "Ignore the root directory when extracting files." +msgstr "Abaikan direktori akar ketika meng ekstrak file." + +msgid "Select Install Folder" +msgstr "Pilih Folder Pemasangan" + msgid "Uncompressing Assets" msgstr "Membuka Aset Terkompresi" @@ -1937,6 +2018,38 @@ msgstr "Aset \"%s\" sukses terpasang!" msgid "Success!" msgstr "Sukses!" +msgid "Asset:" +msgstr "Aset:" + +msgid "Open the list of the asset contents and select which files to install." +msgstr "" +"Buka daftar konten dalam pustaka aset dan pilih file mana yang akan di pasang." + +msgid "Change Install Folder" +msgstr "Ganti Folder Pemasangan" + +msgid "" +"Change the folder where the contents of the asset are going to be installed." +msgstr "Ganti folder dimana konten aset yang akan di pasang." + +msgid "Ignore asset root" +msgstr "Lewati direktori akar" + +msgid "No files conflict with your project" +msgstr "Tidak ada konflik dengan proyek anda" + +msgid "Show contents of the asset and conflicting files." +msgstr "Tampilkan konten aset dan file-file yang konflik." + +msgid "Contents of the asset:" +msgstr "Konten-konten dari aset:" + +msgid "Installation preview:" +msgstr "Pratinjau pemasangan:" + +msgid "Configure Asset Before Installing" +msgstr "Atur aset terlebih dahulu sebelum pemasangan" + msgid "Install" msgstr "Pasang" @@ -2307,6 +2420,14 @@ msgstr "Paksa kelas ssat terdeteksi:" msgid "Edit Build Configuration Profile" msgstr "Edit Konfigurasi Build Profil" +msgid "" +"Failed to execute command \"%s\":\n" +"%s." +msgstr "" +"Gagal mengeksekusi perintah \"\n" +"%s\":\n" +"%s." + msgid "Filter Commands" msgstr "Perintah Filter" @@ -2338,7 +2459,7 @@ msgid "Asset Library" msgstr "Pustaka Aset" msgid "Scene Tree Editing" -msgstr "Menyunting Pohon Skena" +msgstr "Menyunting Daftar Skena" msgid "Node Dock" msgstr "Dok Node" @@ -2353,7 +2474,7 @@ msgid "History Dock" msgstr "Dok Sejarah" msgid "Allows to view and edit 3D scenes." -msgstr "Memungkinkan untuk melihat dan mengedit scene 3D." +msgstr "Memungkinkan untuk melihat dan mengedit adegan 3D." msgid "Allows to edit scripts using the integrated script editor." msgstr "" @@ -2363,7 +2484,7 @@ msgid "Provides built-in access to the Asset Library." msgstr "Menyediakan akses bawaan ke Perpustakaan Aset." msgid "Allows editing the node hierarchy in the Scene dock." -msgstr "Memungkinkan pengeditan hierarki node di dock Scene." +msgstr "Memungkinkan pengeditan hierarki node di dock adegan." msgid "" "Allows to work with signals and groups of the node selected in the Scene dock." @@ -2538,6 +2659,29 @@ msgstr "" msgid "Error codes returned:" msgstr "Kode kesalahan dikembalikan:" +msgid "There is currently no description for this method." +msgstr "Saat ini tidak ada deskripsi untuk fungsi ini." + +msgid "There is currently no description for this constructor." +msgstr "Saat ini tidak ada deskripsi untuk konstruktor ini." + +msgid "There is currently no description for this operator." +msgstr "Saat ini belum ada deskripsi untuk properti ini." + +msgid "" +"There is currently no description for this method. Please help us by " +"[color=$color][url=$url]contributing one[/url][/color]!" +msgstr "" +"Saat ini belum ada deskripsi untuk fungsi ini. Tolong bantu kami dengan " +"[color=$color][url=$url]kontribusi[/url][/color]!" + +msgid "" +"There is currently no description for this constructor. Please help us by " +"[color=$color][url=$url]contributing one[/url][/color]!" +msgstr "" +"Saat ini belum ada deskripsi untuk konstruktor ini. Tolong bantu kami dengan " +"[color=$color][url=$url]kontribusi[/url][/color]!" + msgid "Top" msgstr "Atas" @@ -2576,6 +2720,17 @@ msgstr "" "Saat ini belum ada deskripsi untuk kelas ini. Tolong bantu kami dengan " "[color=$color][url=$url]kontribusi[/url][/color]!" +msgid "Note:" +msgstr "Catatan:" + +msgid "" +"There are notable differences when using this API with C#. See [url=%s]C# API " +"differences to GDScript[/url] for more information." +msgstr "" +"Tidak ada catatan perbedaan ketika menggunakan API ini dengan C#. Lihat " +"[url=%s]Perbedaan Antara C# API dan GDScript[/url] untuk informasi lebih " +"lanjut." + msgid "Online Tutorials" msgstr "Tutorial Daring" @@ -2659,12 +2814,24 @@ msgstr "Deskripsi Method" msgid "Operator Descriptions" msgstr "Deskripsi Operator" +msgid "Metadata:" +msgstr "Metadata:" + msgid "Property:" msgstr "Properti:" +msgid "Method:" +msgstr "Fungsi:" + msgid "Signal:" msgstr "Sinyal:" +msgid "Theme Item:" +msgstr "Item Tema:" + +msgid "No description available." +msgstr "Tidak ada deskripsi yang tersedia." + msgid "%d match." msgstr "Ditemukan %d kecocokan." @@ -3008,7 +3175,7 @@ msgid "Error while loading file '%s'." msgstr "Kesalahan saat memuat file '%s'." msgid "Saving Scene" -msgstr "Menyimpan Skena" +msgstr "Menyimpan Adegan" msgid "Analyzing" msgstr "Menganalisis" @@ -3023,8 +3190,9 @@ msgid "" "This scene can't be saved because there is a cyclic instance inclusion.\n" "Please resolve it and then attempt to save again." msgstr "" -"Scene ini tidak bisa disimpan karena ada inklusi penginstansian yang siklik.\n" -"Mohon betulkan dan coba simpan lagi." +"Adegan ini tidak bisa disimpan karena ada inklusi penginstansian yang " +"siklik.\n" +"Mohon perbaiki dan coba simpan lagi." msgid "" "Couldn't save scene. Likely dependencies (instances or inheritance) couldn't " @@ -3034,16 +3202,16 @@ msgstr "" "tidak terpenuhi." msgid "Save scene before running..." -msgstr "Simpan skena sebelum menjalankan..." +msgstr "Simpan adegan sebelum menjalankan..." msgid "Could not save one or more scenes!" -msgstr "Tidak dapat menyimpan satu atau lebih skena!" +msgstr "Tidak dapat menyimpan satu atau beberapa adegan!" msgid "Save All Scenes" -msgstr "Simpan Semua Skena" +msgstr "Simpan Semua Adegan" msgid "Can't overwrite scene that is still open!" -msgstr "Tidak bisa menimpa skena yang masih terbuka!" +msgstr "Tidak bisa menimpa adegan yang masih terbuka!" msgid "Can't load MeshLibrary for merging!" msgstr "Tidak dapat memuat MeshLibrary untuk menggabungkan!" @@ -3081,17 +3249,16 @@ msgid "" "Please read the documentation relevant to importing scenes to better " "understand this workflow." msgstr "" -"Resource ini milik skena yang telah diimpor, jadi tidak dapat disunting.\n" -"Harap baca dokumentasi yang relevan dalam mengimpor skena untuk lebih " +"Resource ini milik adegan yang telah diimpor, jadi tidak dapat disunting.\n" +"Harap baca dokumentasi yang relevan dalam mengimpor adegan untuk lebih " "memahami alur kerjanya." msgid "" "This resource belongs to a scene that was instantiated or inherited.\n" "Changes to it must be made inside the original scene." msgstr "" -"Sumber daya ini termasuk dalam scene yang telah di-instansiasi atau " -"diwarisi.\n" -"Perubahan harus dilakukan di dalam scene asli." +"Resource ini termasuk dalam adegan yang telah di-instansiasi atau diwarisi.\n" +"Perubahan harus dilakukan di dalam adegan asli." msgid "" "This resource was imported, so it's not editable. Change its settings in the " @@ -3109,7 +3276,7 @@ msgstr "" "Adegan ini diimpor, jadi perubahan pada adegan ini tidak akan disimpan.\n" "Menginstansiasi atau mewarisinya akan memungkinkan Anda untuk membuat " "perubahan padanya.\n" -"Silakan baca dokumentasi yang relevan dengan mengimpor scene untuk lebih " +"Silakan baca dokumentasi yang relevan dengan mengimpor adegan untuk lebih " "memahami alur kerja ini." msgid "Changes may be lost!" @@ -3119,13 +3286,13 @@ msgid "This object is read-only." msgstr "Objek ini hanya dapat dibaca." msgid "Open Base Scene" -msgstr "Buka Skena Dasar" +msgstr "Buka Adegan Dasar" msgid "Quick Open..." msgstr "Buka Cepat..." msgid "Quick Open Scene..." -msgstr "Buka Cepat Skenario..." +msgstr "Buka Cepat Adegan..." msgid "Quick Open Script..." msgstr "Buka Cepat Skrip..." @@ -3137,21 +3304,21 @@ msgid "" "The current scene has no root node, but %d modified external resource(s) were " "saved anyway." msgstr "" -"Scene saat ini tidak memiliki node root, tetapi %d sumber daya eksternal yang " +"Adegan saat ini tidak memiliki node root, tetapi %d resource eksternal yang " "diubah tetap disimpan." msgid "" "A root node is required to save the scene. You can add a root node using the " "Scene tree dock." msgstr "" -"Node root diperlukan untuk menyimpan scene. Anda dapat menambahkan node root " -"menggunakan dok pohon Scene." +"Node root diperlukan untuk menyimpan adegan. Anda dapat menambahkan node root " +"menggunakan dok pohon Adegan." msgid "Save Scene As..." -msgstr "Simpan Skena Sebagai..." +msgstr "Simpan Adegan Sebagai..." msgid "Current scene not saved. Open anyway?" -msgstr "Skena saat ini belum disimpan. Buka saja?" +msgstr "Adegan saat ini belum disimpan. Buka saja?" msgid "Can't undo while mouse buttons are pressed." msgstr "Tidak bisa membatalkan ketika tombol mouse ditekan." @@ -3181,20 +3348,20 @@ msgid "Remote Redo: %s" msgstr "Undo Remote: %s" msgid "Scene Redo: %s" -msgstr "Adegan Redo: %s" +msgstr "Redo Adegan: %s" msgid "Can't reload a scene that was never saved." -msgstr "Tidak bisa memuat ulang skena yang belum pernah disimpan." +msgstr "Tidak bisa memuat ulang adegan yang belum pernah disimpan." msgid "Reload Saved Scene" -msgstr "Muat ulang scene yang sudah disimpan" +msgstr "Muat ulang adegan yang sudah disimpan" msgid "" "The current scene has unsaved changes.\n" "Reload the saved scene anyway? This action cannot be undone." msgstr "" -"Skena saat ini mempunyai perubahan yang belum tersimpan.\n" -"Tetap muat ulang skena yang tersimpan? Aksi ini tidak dapat dibatalkan." +"Adegan saat ini mempunyai perubahan yang belum tersimpan.\n" +"Tetap muat ulang adegan yang tersimpan? Tindakan ini tidak dapat dibatalkan." msgid "Save & Reload" msgstr "Simpan & Mulai Ulang" @@ -3212,10 +3379,10 @@ msgid "Save changes to the following scene(s) before reloading?" msgstr "Menyimpan perubahan pada adegan berikut sebelum memuat ulang?" msgid "Save changes to the following scene(s) before quitting?" -msgstr "Simpan perubahan skena saat ini sebelum keluar?" +msgstr "Simpan perubahan adegan saat ini sebelum keluar?" msgid "Save changes to the following scene(s) before opening Project Manager?" -msgstr "Simpan perubahan skena saat ini sebelum membuka Manajer Proyek?" +msgstr "Simpan perubahan adegan saat ini sebelum membuka Manajer Proyek?" msgid "" "This option is deprecated. Situations where refresh must be forced are now " @@ -3225,10 +3392,10 @@ msgstr "" "sebagai bug. Tolong laporkan." msgid "Pick a Main Scene" -msgstr "Pilih Skena Utama" +msgstr "Pilih Adegan Utama" msgid "This operation can't be done without a scene." -msgstr "Operasi ini tidak dapat diselesaikan tanpa skena." +msgstr "Operasi ini tidak dapat diselesaikan tanpa adegan." msgid "Export Mesh Library" msgstr "Ekspor Pustaka Mesh" @@ -3255,37 +3422,27 @@ msgstr "" "Lepaskan addon di '%s' to mencegah kesalahan kedepan." msgid "" -"Unable to load addon script from path: '%s' Base type is not EditorPlugin." -msgstr "" -"Tidak dapat memuat skrip addon dari jalur: '%s' karena jenis Basisnya bukan " -"EditorPlugin." - -msgid "Unable to load addon script from path: '%s' Script is not in tool mode." -msgstr "" -"Tidak dapat memuat addon script dari jalur: '%s' Script tidak pada mode tool." - -msgid "" "Scene '%s' was automatically imported, so it can't be modified.\n" "To make changes to it, a new inherited scene can be created." msgstr "" -"Skena '%s' terimpor otomatis, jadi tidak dapat dimodifikasi.\n" -"Untuk melakukan perubahan, skena warisan baru dapat dibuat." +"Adegan '%s' terimpor otomatis, jadi tidak dapat dimodifikasi.\n" +"Untuk melakukan perubahan, adegan warisan baru dapat dibuat." msgid "" "Error loading scene, it must be inside the project path. Use 'Import' to open " "the scene, then save it inside the project path." msgstr "" -"Gagal memuat skena, harus dalam lokasi proyek. Gunakan 'Impor\" untuk membuka " -"skena tersebut, kemudian simpan di dalam lokasi proyek." +"Gagal memuat adegan, harus dalam lokasi proyek. Gunakan 'Impor\" untuk " +"membuka adegan tersebut, kemudian simpan di dalam lokasi proyek." msgid "Scene '%s' has broken dependencies:" -msgstr "Skena '%s' memiliki dependensi yang rusak:" +msgstr "Adegan '%s' memiliki dependensi yang rusak:" msgid "Clear Recent Scenes" -msgstr "Bersihkan Scenes baru-baru ini" +msgstr "Bersihkan Adegan baru-baru ini" msgid "There is no defined scene to run." -msgstr "Tidak ada skena yang didefinisikan untuk dijalankan." +msgstr "Tidak ada adegan yang didefinisikan untuk dijalankan." msgid "%s - Godot Engine" msgstr "%s - Godot Engine" @@ -3295,7 +3452,7 @@ msgid "" "You can change it later in \"Project Settings\" under the 'application' " "category." msgstr "" -"Tidak ada skena utama yang pernah didefinisikan, pilih satu?\n" +"Tidak ada adegan utama yang pernah didefinisikan, pilih satu?\n" "Anda dapat mengubahnya nanti di \"Pengaturan Proyek\" di bawah kategori " "'aplikasi'." @@ -3304,7 +3461,7 @@ msgid "" "You can change it later in \"Project Settings\" under the 'application' " "category." msgstr "" -"Skena '%s' tidak ada, pilih yang valid?\n" +"Adegan '%s' tidak ada, pilih yang valid?\n" "Anda dapat mengubahnya nanti di \"Pengaturan Proyek\" di bawah kategori " "'aplikasi'." @@ -3313,7 +3470,7 @@ msgid "" "You can change it later in \"Project Settings\" under the 'application' " "category." msgstr "" -"Skena yang dipilih '%s' bukanlah berkas skena, pilih yang valid?\n" +"Adegan yang dipilih '%s' bukanlah berkas adegan, pilih yang valid?\n" "Anda dapat menggantinya nanti di \"Pengaturan Proyek\" di bawah kategori " "'aplikasi'." @@ -3326,9 +3483,34 @@ msgstr "Hapus Penampilan" msgid "Default" msgstr "Bawaan" +msgid "This scene was never saved." +msgstr "Tidak bisa memuat ulang adegan yang belum pernah disimpan." + +msgid "%d second ago" +msgid_plural "%d seconds ago" +msgstr[0] "%d detik yang lalu" + +msgid "%d minute ago" +msgid_plural "%d minutes ago" +msgstr[0] "%d menit yang lalu" + +msgid "%d hour ago" +msgid_plural "%d hours ago" +msgstr[0] "%d jam yang lalu" + +msgid "" +"Scene \"%s\" has unsaved changes.\n" +"Last saved: %s." +msgstr "" +"Adegan \"%s\" memiliki perubahan yang belum disimpan.\n" +"Terakhir disimpan: %s." + msgid "Save & Close" msgstr "Simpan & Tutup" +msgid "Save before closing?" +msgstr "Simpan perubahan sebelum menutupnya?" + msgid "%d more files or folders" msgstr "%d file atau folder lagi" @@ -3363,7 +3545,7 @@ msgid "Scene" msgstr "Adegan" msgid "Operations with scene files." -msgstr "Operasi dengan berkas skena." +msgstr "Operasi dengan berkas adegan." msgid "Copy Text" msgstr "Salin Teks" @@ -3381,22 +3563,22 @@ msgid "Command Palette" msgstr "Palet Perintah" msgid "New Scene" -msgstr "Skena Baru" +msgstr "Adegan Baru" msgid "New Inherited Scene..." -msgstr "Skena Warisan Baru..." +msgstr "Adegan Turunan Baru..." msgid "Open Scene..." -msgstr "Buka Skena..." +msgstr "Buka Adegan..." msgid "Reopen Closed Scene" -msgstr "Buka Kembali Skena yang Ditutup" +msgstr "Buka Kembali Adegan yang Ditutup" msgid "Open Recent" msgstr "Buka baru-baru ini" msgid "Save Scene" -msgstr "Simpan Skena" +msgstr "Simpan Adegan" msgid "Export As..." msgstr "Ekspor Sebagai..." @@ -3405,7 +3587,7 @@ msgid "MeshLibrary..." msgstr "PerpustakaanMesh..." msgid "Close Scene" -msgstr "Tutup Skena" +msgstr "Tutup Adegan" msgid "Quit" msgstr "Keluar" @@ -3440,6 +3622,9 @@ msgstr "Alat-alat" msgid "Orphan Resource Explorer..." msgstr "Penjelajah Resource Orphan..." +msgid "Upgrade Mesh Surfaces..." +msgstr "Tingkatkan Permukaan Mesh..." + msgid "Reload Current Project" msgstr "Muat Ulang Project Saat Ini" @@ -3635,6 +3820,9 @@ msgstr "Muat Ulang" msgid "Resave" msgstr "Simpan Ulang" +msgid "Version Control Settings..." +msgstr "Pengaturan Kontrol Versi..." + msgid "New Inherited" msgstr "Turunan Baru" @@ -3745,6 +3933,12 @@ msgstr "" msgid "Assign..." msgstr "Terapkan.." +msgid "Copy as Text" +msgstr "Salin sebagai Teks" + +msgid "Show Node in Tree" +msgstr "Tampilkan Node dalam Daftar" + msgid "Invalid RID" msgstr "RID tidak valid" @@ -3757,7 +3951,7 @@ msgid "" msgstr "" "Tidak dapat membuat ViewportTexture pada resource yang disimpan sebagai " "berkas.\n" -"Resource harus dimiliki oleh sebuah skena." +"Resource harus dimiliki oleh sebuah adegan." msgid "" "Can't create a ViewportTexture on this resource because it's not set as local " @@ -3766,7 +3960,7 @@ msgid "" "containing it up to a node)." msgstr "" "Tidak dapat membuat ViewportTexture pada resource ini karena tidak dibuat " -"lokal ke skena.\n" +"lokal ke adegan.\n" "Silakan aktifkan properti 'lokal ke skena' di atasnya (dan semua resource " "yang memuatnya sampai node)." @@ -3834,12 +4028,18 @@ msgstr "Jadikan Unik" msgid "Make Unique (Recursive)" msgstr "Jadikan Unik (Rekursif)" +msgid "Save As..." +msgstr "Simpan Sebagai..." + msgid "Show in FileSystem" msgstr "Tampilkan dalam FileSystem" msgid "Convert to %s" msgstr "Konversi ke %s" +msgid "Select resources to make unique:" +msgstr "Pilih berkas untuk membuatnya unik:" + msgid "New %s" msgstr "%s baru" @@ -3887,6 +4087,12 @@ msgstr "Urungkan: %s" msgid "Redo: %s" msgstr "Ulangi: %s" +msgid "Edit Built-in Action: %s" +msgstr "Edit Tindakan Bawaan:%s" + +msgid "Edit Shortcut: %s" +msgstr "Edit Pintasan:%s" + msgid "Common" msgstr "Umum" @@ -4070,6 +4276,9 @@ msgstr "Penyematan PCK" msgid "On 32-bit exports the embedded PCK cannot be bigger than 4 GiB." msgstr "Pada ekspor 32-bit PCK yang ditanamkan tidak boleh lebih dari 4GiB." +msgid "Plugin \"%s\" is not supported on \"%s\"" +msgstr "Plugin \"%s\" tidak didukung pada \"%s\"" + msgid "Open the folder containing these templates." msgstr "Buka folder yang berisi template ini." @@ -5304,12 +5513,6 @@ msgid "Prerendered multichannel(+true) signed distance field" msgstr "" "Bidang jarak bertanda multisaluran(+benar) yang telah ditentukan sebelumnya" -msgid "Can't load font texture:" -msgstr "Tidak dapat memuat tekstur font:" - -msgid "Image margin too big." -msgstr "Margin gambar terlalu besar." - msgid "Pre-Import Scene" msgstr "Adegan Pra-Impor" @@ -5663,9 +5866,6 @@ msgstr "Muat resource yang ada dari diska dan mengubahnya." msgid "Save the currently edited resource." msgstr "Simpan resource yang sedang disunting saat ini." -msgid "Save As..." -msgstr "Simpan Sebagai..." - msgid "Extra resource options." msgstr "Opsi resource tambahan." @@ -6293,7 +6493,7 @@ msgid "Force White Modulate" msgstr "Paksa Modulasi Putih" msgid "Include Gizmos (3D)" -msgstr "Masukkan Gizmo (3D)" +msgstr "Sertakan Gizmo (3D)" msgid "Pin AnimationPlayer" msgstr "Sematkan AnimationPlayer" @@ -6926,7 +7126,7 @@ msgid "Show Group And Lock Icons" msgstr "Tampilkan Ikon Kunci Dan Grup" msgid "Show Transformation Gizmos" -msgstr "Tampilkan Gizmos Transformasi" +msgstr "Tampilkan Transformasi Gismos" msgid "Center Selection" msgstr "Seleksi Tengah" @@ -11079,6 +11279,9 @@ msgstr "Pengaturan Proyek (project.godot)" msgid "Advanced Settings" msgstr "Setelan Lanjutan" +msgid "Select a Setting or Type its Name" +msgstr "Pilih Pengaturan atau Ketik Namanya" + msgid "Input Map" msgstr "Pemetaan Input" @@ -11780,23 +11983,9 @@ msgstr "Tidak dapat menulis berkas paket ekspansi!" msgid "Building Android Project (gradle)" msgstr "Membangun Proyek Android (gradle)" -msgid "" -"Building of Android project failed, check output for the error. Alternatively " -"visit docs.godotengine.org for Android build documentation." -msgstr "" -"Pembangunan proyek Android gagal, periksa output untuk galatnya. Atau " -"kunjungi docs.godotengine.org untuk dokumentasi build Android." - msgid "Moving output" msgstr "Memindahkan keluaran" -msgid "" -"Unable to copy and rename export file, check gradle project directory for " -"outputs." -msgstr "" -"Tidak dapat menyalin dan mengubah nama berkas ekspor, cek direktori proyek " -"gradle untuk hasilnya." - msgid "Could not find template APK to export: \"%s\"." msgstr "Tidak dapat menemukan contoh APK untuk ekspor: \"%s\"" @@ -12173,6 +12362,9 @@ msgstr "Konstanta tidak dapat dimodifikasi." msgid "Invalid argument name." msgstr "Nama argumen tidak valid." +msgid "Invalid undef." +msgstr "Tidak valid." + msgid "Invalid macro argument list." msgstr "Daftar Argumen Macro Tidak Valid." @@ -12181,3 +12373,6 @@ msgstr "Argumen makro tidak sah." msgid "Invalid macro argument count." msgstr "Daftar Argumen Macro Tidak Valid" + +msgid "Unmatched conditional statement." +msgstr "Pernyataan kondisi tidak cocok." diff --git a/editor/translations/editor/it.po b/editor/translations/editor/it.po index 09beccf543..782e9f457f 100644 --- a/editor/translations/editor/it.po +++ b/editor/translations/editor/it.po @@ -36,7 +36,7 @@ # Davide Giuliano <davidegiuliano00@gmail.com>, 2019. # Stefano Merazzi <asso99@hotmail.com>, 2019. # Sinapse X <sinapsex13@gmail.com>, 2019. -# Micila Micillotto <micillotto@gmail.com>, 2019, 2020, 2021, 2022. +# Micila Micillotto <micillotto@gmail.com>, 2019, 2020, 2021, 2022, 2023. # Mirko Soppelsa <miknsop@gmail.com>, 2019, 2020, 2021, 2022, 2023. # No <kingofwizards.kw7@gmail.com>, 2019. # StarFang208 <polaritymanx@yahoo.it>, 2019, 2023. @@ -93,13 +93,14 @@ # Luca Martinelli <lucxmangajet@gmail.com>, 2023. # Frankie McEyes <mceyes@protonmail.com>, 2023. # Andrea <andrea.rubino1990@gmail.com>, 2023. +# Samuele Righi <blackdestinyx145@gmail.com>, 2023. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor interface\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-10-23 06:30+0000\n" -"Last-Translator: Andrea <andrea.rubino1990@gmail.com>\n" +"PO-Revision-Date: 2023-12-11 21:00+0000\n" +"Last-Translator: Samuele Righi <blackdestinyx145@gmail.com>\n" "Language-Team: Italian <https://hosted.weblate.org/projects/godot-engine/" "godot/it/>\n" "Language: it\n" @@ -107,10 +108,10 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.1\n" +"X-Generator: Weblate 5.3-dev\n" msgid "Main Thread" -msgstr "Thread principale" +msgstr "Thread Principale" msgid "Unset" msgstr "Non impostato" @@ -854,6 +855,11 @@ msgstr "" msgid "Remove Anim Track" msgstr "Rimuovi una traccia d'animazione" +msgid "Hold Shift when clicking the key icon to skip this dialog." +msgstr "" +"Tieni premuto Maiuscolo (Shift) mentre clicchi l'icona a forma di chiave per " +"non far comparire questo dialogo." + msgid "Create new track for %s and insert key?" msgstr "Creare una nuova traccia per %s e inserire la chiave?" @@ -992,6 +998,9 @@ msgstr "" msgid "Animation Add RESET Keys" msgstr "Aggiungi le chiavi RESET di un'animazione" +msgid "Bake Animation as Linear Keys" +msgstr "Salva l'animazione come chiavi lineari" + msgid "" "This animation belongs to an imported scene, so changes to imported tracks " "will not be saved.\n" @@ -1011,6 +1020,9 @@ msgstr "" "delle tracce personalizzate, abilitare \"Save To File\" e\n" "\"Keep Custom Tracks\"." +msgid "AnimationPlayer is inactive. The playback will not be processed." +msgstr "AnimationPlayer non è attivo. La riproduzione non verrà eseguita." + msgid "Select an AnimationPlayer node to create and edit animations." msgstr "Selezionare un nodo AnimationPlayer per creare e modificare animazioni." @@ -1020,6 +1032,18 @@ msgstr "Scena importata" msgid "Warning: Editing imported animation" msgstr "Attenzione: sta venendo modificata un'animazione importata" +msgid "Dummy Player" +msgstr "Player Fantoccio" + +msgid "Warning: Editing dummy AnimationPlayer" +msgstr "Attenzione: AnimationPlayer fantoccio in modifica" + +msgid "Inactive Player" +msgstr "Player inattivo" + +msgid "Warning: AnimationPlayer is inactive" +msgstr "Avviso: AnimationPlayer non attivo" + msgid "Toggle between the bezier curve editor and track editor." msgstr "Commuta tra l'editor di curve di Bézier e l'editor di tracce." @@ -1863,6 +1887,12 @@ msgstr "Il nome della cartella non può essere vuoto." msgid "Folder name contains invalid characters." msgstr "Il nome della cartella contiene caratteri non validi." +msgid "Folder name cannot begin or end with a space." +msgstr "Il nome della cartella non può cominciare o finire con uno spazio." + +msgid "Folder name cannot begin with a dot." +msgstr "Il nome di una cartella non può cominciare con un punto." + msgid "File with that name already exists." msgstr "Esiste già un File con questo nome." @@ -1910,6 +1940,9 @@ msgstr "Sviluppatori" msgid "Authors" msgstr "Autori" +msgid "Patrons" +msgstr "Patrons" + msgid "Platinum Sponsors" msgstr "Sponsor platino" @@ -1919,20 +1952,14 @@ msgstr "Sponsor oro" msgid "Silver Sponsors" msgstr "Sponsor argento" -msgid "Bronze Sponsors" -msgstr "Sponsor bronzo" - -msgid "Mini Sponsors" -msgstr "Sponsor mini" +msgid "Diamond Members" +msgstr "Membri Diamond" -msgid "Gold Donors" -msgstr "Donatori oro" +msgid "Titanium Members" +msgstr "Membri Titanium" -msgid "Silver Donors" -msgstr "Donatori argento" - -msgid "Bronze Donors" -msgstr "Donatori bronzo" +msgid "Platinum Members" +msgstr "Membri Platinum" msgid "Donors" msgstr "Donatori" @@ -1970,6 +1997,16 @@ msgstr "" msgid "%s (already exists)" msgstr "%s (già esistente)" +msgid "%d file conflicts with your project and won't be installed" +msgid_plural "%d files conflict with your project and won't be installed" +msgstr[0] "" +"Il file %d va in conflitto con il tuo progetto e non verrà installato" +msgstr[1] "" +"I file %d vanno in conflitto con il tuo progetto e non verranno installati" + +msgid "Select Install Folder" +msgstr "Seleziona Cartella di Installazione" + msgid "Uncompressing Assets" msgstr "Estraendo i contenuti" @@ -1985,6 +2022,28 @@ msgstr "Contenuto \"%s\" installato con successo!" msgid "Success!" msgstr "Successo!" +msgid "Asset:" +msgstr "Contenuto:" + +msgid "Open the list of the asset contents and select which files to install." +msgstr "Apri la lista degli asset delle risorse e seleziona quasi installare." + +msgid "Change Install Folder" +msgstr "Cambia la cartella di installazione" + +msgid "" +"Change the folder where the contents of the asset are going to be installed." +msgstr "Cambia la cartella dove verranno installati i contenuti degli asset." + +msgid "Ignore asset root" +msgstr "Ignora contenuto root" + +msgid "No files conflict with your project" +msgstr "Nessun file in conflitto con il tuo progetto" + +msgid "Installation preview:" +msgstr "Anteprima installazione:" + msgid "Install" msgstr "Installa" @@ -2354,6 +2413,13 @@ msgstr "Classi forzate al rilevamento:" msgid "Edit Build Configuration Profile" msgstr "Modifica il profilo di configurazione di costruzione" +msgid "" +"Failed to execute command \"%s\":\n" +"%s." +msgstr "" +"Impossibile aprire l'eseguibile \"%s\".\n" +"%s." + msgid "Filter Commands" msgstr "Filtra i comandi" @@ -2590,6 +2656,15 @@ msgstr "" msgid "Error codes returned:" msgstr "Codici di errore restituiti:" +msgid "There is currently no description for this method." +msgstr "Attualmente non esiste nessuna descrizione per questo metodo." + +msgid "There is currently no description for this constructor." +msgstr "Attualmente non esiste nessuna descrizione per questo costruttore." + +msgid "There is currently no description for this operator." +msgstr "Attualmente non esiste nessuna descrizione per questo operatore." + msgid "Top" msgstr "In cima" @@ -2710,12 +2785,24 @@ msgstr "Descrizioni del metodo" msgid "Operator Descriptions" msgstr "Descrizione degli operatori" +msgid "Metadata:" +msgstr "Metadati:" + msgid "Property:" msgstr "Proprietà:" +msgid "Method:" +msgstr "Metodo:" + msgid "Signal:" msgstr "Segnale:" +msgid "Theme Item:" +msgstr "Oggetto Tema:" + +msgid "No description available." +msgstr "Nessuna descrizione disponibile." + msgid "%d match." msgstr "%d corrispondenze." @@ -3314,17 +3401,6 @@ msgstr "" "Disabilitata l'aggiunta di '%s' per prevenire ulteriori errori." msgid "" -"Unable to load addon script from path: '%s' Base type is not EditorPlugin." -msgstr "" -"Impossibile caricare uno script di estensione dal percorso: il tipo base di " -"\"%s\" non è EditorPlugin." - -msgid "Unable to load addon script from path: '%s' Script is not in tool mode." -msgstr "" -"Impossibile caricare lo script di un componente aggiuntivo dal percorso: " -"\"%s\" Lo script non è in modalità strumento." - -msgid "" "Scene '%s' was automatically imported, so it can't be modified.\n" "To make changes to it, a new inherited scene can be created." msgstr "" @@ -3916,6 +3992,9 @@ msgstr "Rendi Unico" msgid "Make Unique (Recursive)" msgstr "Rendi unica (ricorsivo)" +msgid "Save As..." +msgstr "Salva Come..." + msgid "Show in FileSystem" msgstr "Mostra nel filesystem" @@ -4782,6 +4861,21 @@ msgstr "Rinomina..." msgid "Open in External Program" msgstr "Apri in un programma esterno" +msgid "Yellow" +msgstr "Giallo" + +msgid "Green" +msgstr "Verde" + +msgid "Blue" +msgstr "Blu" + +msgid "Pink" +msgstr "Rosa" + +msgid "Gray" +msgstr "Grigio" + msgid "Go to previous selected folder/file." msgstr "Vai al file (o cartella) precedentemente selezionato." @@ -5406,12 +5500,6 @@ msgstr "Font TrueType/OpenType renderizzato dinamicamente" msgid "Prerendered multichannel(+true) signed distance field" msgstr "Campo distanza sottoscritta(+true) multicanale prerenderizzata" -msgid "Can't load font texture:" -msgstr "Impossibile caricare texture del font:" - -msgid "Image margin too big." -msgstr "Margine dell'immagine troppo grande." - msgid "Pre-Import Scene" msgstr "Pre-importazione della scena" @@ -5776,9 +5864,6 @@ msgstr "Carica una risorsa esistente dal disco e modificala." msgid "Save the currently edited resource." msgstr "Salva la risorsa attualmente in modifica." -msgid "Save As..." -msgstr "Salva Come..." - msgid "Extra resource options." msgstr "Ulteriori opzioni di risorsa." @@ -9220,6 +9305,12 @@ msgstr "Apri il file nell'ispettore" msgid "Close File" msgstr "Chiudi il file" +msgid "Make the shader editor floating." +msgstr "Rendi l'editor delle shader fluttuante." + +msgid "Shader stage compiled without errors." +msgstr "Fase delle shader compilata senza errori." + msgid "" "File structure for '%s' contains unrecoverable errors:\n" "\n" @@ -10225,6 +10316,15 @@ msgstr "Seleziona il livello della mappa dei tasselli selezionata" msgid "Toggle grid visibility." msgstr "Commuta la visibilità della griglia." +msgid "Source-level proxies" +msgstr "Proxies a livello sorgente" + +msgid "Coords-level proxies" +msgstr "Proxies a livello coordinate" + +msgid "Alternative-level proxies" +msgstr "Proxies di livello alternativo" + msgid "From Coords" msgstr "Dalle coordinate" @@ -10248,9 +10348,23 @@ msgstr "Layer di fisica %d" msgid "Navigation Layer %d" msgstr "Layer di navigazione %d" +msgid "" +"Create and customize navigation layers in the inspector of the TileSet " +"resource." +msgstr "" +"Crea e personalizza i layers di navigazione nell'ispettore della risorsa " +"TileSet." + msgid "Custom Data %d" msgstr "Dati personalizzati %d" +msgid "" +"Create and customize custom data layers in the inspector of the TileSet " +"resource." +msgstr "" +"Crea e personalizza i layers di dati personalizzati nell'ispettore della " +"risorsa TileSet." + msgid "Select a property editor" msgstr "Seleziona un editor delle proprietà" @@ -10302,6 +10416,13 @@ msgstr "Seleziona dei tasselli." msgid "Paint properties." msgstr "Proprietà di disegno." +msgid "" +"No tiles selected.\n" +"Select one or more tiles from the palette to edit its properties." +msgstr "" +"Nessuna tile selezionata.\n" +"Seleziona una o più tile dalla palette per modificare le sue proprietà." + msgid "Paint Properties:" msgstr "Proprietà di disegno:" @@ -10312,6 +10433,13 @@ msgid "Remove Tiles in Fully Transparent Texture Regions" msgstr "" "Rimuovi i tasselli nelle regioni completamente trasparenti della texture" +msgid "" +"The current atlas source has tiles outside the texture.\n" +"You can clear it using \"%s\" option in the 3 dots menu." +msgstr "" +"La corrente risorsa atlas ha delle tile fuori dalla texture.\n" +"Puoi cancellarle usando l'opzione \"%s\" nel menu a 3 punti." + msgid "Create an Alternative Tile" msgstr "Crea un tassello alternativo" @@ -10349,12 +10477,27 @@ msgstr "Ordina i sorgenti" msgid "Open Atlas Merging Tool" msgstr "Apri lo strumento di fusione degli atlas" +msgid "" +"No TileSet source selected. Select or create a TileSet source.\n" +"You can create a new source by using the Add button on the left or by " +"dropping a tileset texture onto the source list." +msgstr "" +"Nessuna TileSet sorgente selezionata. Seleziona o crea una TileSet sorgente.\n" +"Puoi creare una nuova sorgente usando il pulsante Aggiungi sulla sinistra o " +"rilasciando una texture tileset dentro alla lista sorgenti." + +msgid "Add new patterns in the TileMap editing mode." +msgstr "Aggiunti nuovi modelli nella modalità di editing della TileMap." + msgid "Add a Scene Tile" msgstr "Aggiungi un tassello scena" msgid "Remove a Scene Tile" msgstr "Rimuovi un tassello scena" +msgid "Drag and drop scenes here or use the Add button." +msgstr "Trascina e rilascia scene qui o usando il pulsante Aggiungi." + msgid "Tile properties:" msgstr "Proprietà del tassello:" @@ -10759,6 +10902,9 @@ msgstr "Aggiungi Nodo" msgid "Create Shader Node" msgstr "Crea Nodo Shader" +msgid "Delete Shader Varying" +msgstr "Elimina la Varying Shader" + msgid "Color function." msgstr "Funzione colore." @@ -10863,6 +11009,9 @@ msgstr "" msgid "Boolean constant." msgstr "Costante booleana." +msgid "Translated to '%s' in Godot Shading Language." +msgstr "Tradotto in \"%s\" nel Godot Shading Language." + msgid "'%s' input parameter for all shader modes." msgstr "Parametro di input \"%s\" per tutte le modalità shader." @@ -10907,6 +11056,14 @@ msgstr "" "Parametro d'ingresso \"%s\" per la modalità di elaborazione e collisione " "dello shader." +msgid "" +"A node for help to multiply a position input vector by rotation using " +"specific axis. Intended to work with emitters." +msgstr "" +"Un nodo per aiutare a moltiplicare un vettore di input di posizione mediante " +"rotazione utilizzando un asse specifico. Pensato per lavorare con gli " +"emettitori." + msgid "Float function." msgstr "Funzione float." @@ -11018,6 +11175,9 @@ msgstr "Restituisce il minore di due valori." msgid "Linear interpolation between two scalars." msgstr "Interpolazione lineare tra due scalari." +msgid "Performs a fused multiply-add operation (a * b + c) on scalars." +msgstr "Esegue un'operazione di moltiplicazione fusa (a * b *c) su scalari." + msgid "Returns the opposite value of the parameter." msgstr "Restituisce il valore opposto del parametro." @@ -11212,9 +11372,29 @@ msgstr "Parametro scalare intero." msgid "Scalar unsigned integer parameter." msgstr "Parametro scalare intero senza segno." +msgid "Casts a ray against the screen SDF and returns the distance travelled." +msgstr "" +"Lancia un raggio contro lo schermo SDF e restituisce la distanza percorsa." + +msgid "Converts a SDF to screen UV." +msgstr "Converte un SDF ad uno schermo UV." + +msgid "Function to be applied on texture coordinates." +msgstr "Funzione da applicare sulle coordinate della texture." + +msgid "Polar coordinates conversion applied on texture coordinates." +msgstr "" +"Conversione delle coordinate polari applicata sulle coordinate della texture." + msgid "Perform the cubic texture lookup." msgstr "Esegue la ricerca di texture cubiche." +msgid "" +"Returns the depth value obtained from the depth prepass in a linear space." +msgstr "" +"Restituisce il valore della profondità ottenuto dal prepass della profondità " +"in uno spazio lineare." + msgid "Perform the 3D texture lookup." msgstr "Esegue la ricerca di texture 3D." @@ -11861,6 +12041,15 @@ msgstr "" "\n" msgid "" +"Warning: This project was last edited in Godot %s. Opening will change it to " +"Godot %s.\n" +"\n" +msgstr "" +"Avviso: Questo progetto è stato modificato l'ultima volta in Godot %s. " +"Aprirlo lo convertirà a Godot %s.\n" +"\n" + +msgid "" "Warning: This project uses the following features not supported by this build " "of Godot:\n" "\n" @@ -13347,24 +13536,9 @@ msgstr "Impossibile scrivere il file del pacchetto di espansione!" msgid "Building Android Project (gradle)" msgstr "Compilazione di un progetto Android (gradle)" -msgid "" -"Building of Android project failed, check output for the error. Alternatively " -"visit docs.godotengine.org for Android build documentation." -msgstr "" -"Compilazione del progetto Android fallita, controlla l'output per vedere gli " -"errori. In alternativa, visita docs.godotengine.org per la documentazione " -"della build Android." - msgid "Moving output" msgstr "Spostando l'output" -msgid "" -"Unable to copy and rename export file, check gradle project directory for " -"outputs." -msgstr "" -"Impossibile copiare e rinominare il file di esportazione, controlla la " -"directory del progetto gradle per gli output." - msgid "Package not found: \"%s\"." msgstr "Pacchetto non trovato: \"%s\"." @@ -13805,6 +13979,15 @@ msgstr "" "\"Frames\" per permettere a AnimatedSprite2D di visualizzare i fotogrammi." msgid "" +"Only one visible CanvasModulate is allowed per canvas.\n" +"When there are more than one, only one of them will be active. Which one is " +"undefined." +msgstr "" +"Solo un CanvasModulate è permesso per ogni canvas.\n" +"Quando ne è presente più di uno, solo uno sarà attivo. Quale di essi non è " +"definito." + +msgid "" "This node has no shape, so it can't collide or interact with other objects.\n" "Consider adding a CollisionShape2D or CollisionPolygon2D as a child to define " "its shape." @@ -14269,15 +14452,6 @@ msgstr "" "La dimensione del Viewport deve essere maggiore o uguale a 2 pixel su " "entrambi i lati per visualizzare qualcosa." -msgid "Cannot open font from file: %s." -msgstr "Impossibile aprie il font dal file: %s." - -msgid "Version %d of BMFont is not supported (should be 3)." -msgstr "La Versione %d di BMFont non è supportata (dovrebbe essere la 3)." - -msgid "Can't load font texture: %s." -msgstr "Impossibile caricare la texture del font: %s." - msgid "" "The sampler port is connected but not used. Consider changing the source to " "'SamplerPort'." @@ -14554,18 +14728,42 @@ msgstr "Previsto: '%s'." msgid "Expected a '%s' after '%s'." msgstr "Previsto '%s' dopo '%s'." +msgid "Invalid argument name." +msgstr "Nome argomento invalido." + +msgid "'##' must not appear at end of macro expansion." +msgstr "'##' non deve apparire alla fine dell'espansione macro." + msgid "Unmatched elif." msgstr "elif spaiato." +msgid "Missing condition." +msgstr "Condizione mancante." + msgid "Unmatched else." msgstr "else non corrisposto." +msgid "Invalid endif." +msgstr "endif non valido." + +msgid "Invalid ifdef." +msgstr "ifdef non valido." + +msgid "Invalid ifndef." +msgstr "ifndef non valido." + msgid "Shader include file does not exist:" msgstr "Il file Shader include non esiste:" msgid "Macro expansion limit exceeded." msgstr "Limite espansione macro superato." +msgid "Invalid macro argument count." +msgstr "Numero di argomenti macro invalido." + +msgid "Invalid symbols placed before directive." +msgstr "Simboli invalidi inseriti prima della direttiva." + msgid "The const '%s' is declared but never used." msgstr "La costante '%s' è dichiarata ma mai utilizzata." diff --git a/editor/translations/editor/ja.po b/editor/translations/editor/ja.po index 36e40f8d86..a8593c2e08 100644 --- a/editor/translations/editor/ja.po +++ b/editor/translations/editor/ja.po @@ -68,7 +68,7 @@ msgstr "" "Project-Id-Version: Godot Engine editor interface\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-10-31 19:10+0000\n" +"PO-Revision-Date: 2023-12-01 04:24+0000\n" "Last-Translator: Koji Horaguchi <koji.horaguchi@gmail.com>\n" "Language-Team: Japanese <https://hosted.weblate.org/projects/godot-engine/" "godot/ja/>\n" @@ -77,7 +77,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 5.2-dev\n" +"X-Generator: Weblate 5.3-dev\n" msgid "Main Thread" msgstr "メインスレッド" @@ -161,37 +161,37 @@ msgid "Joypad Motion on Axis %d (%s) with Value %.2f" msgstr "ジョイパッドモーション 軸:%d (%s) 値:%.2f" msgid "Bottom Action, Sony Cross, Xbox A, Nintendo B" -msgstr "下アクション。Sony ✕、Xbox A、Nintendo B" +msgstr "下アクション、Sony ✕、Xbox A、Nintendo B" msgid "Right Action, Sony Circle, Xbox B, Nintendo A" -msgstr "右アクション。Sony ○、Xbox B,Nintendo A" +msgstr "右アクション、Sony ○、Xbox B,Nintendo A" msgid "Left Action, Sony Square, Xbox X, Nintendo Y" -msgstr "左アクション。Sony □、Xbox X、Nintendo Y" +msgstr "左アクション、Sony □、Xbox X、Nintendo Y" msgid "Top Action, Sony Triangle, Xbox Y, Nintendo X" -msgstr "上アクション。Sony △、Xbox Y、Nintendo X" +msgstr "上アクション、Sony △、Xbox Y、Nintendo X" msgid "Back, Sony Select, Xbox Back, Nintendo -" -msgstr "Back。Sony Select、Xbox Back、Nintendo -" +msgstr "Back、Sony Select、Xbox Back、Nintendo -" msgid "Guide, Sony PS, Xbox Home" -msgstr "Guide。Sony PS、Xbox Home" +msgstr "Guide、Sony PS、Xbox Home" msgid "Start, Xbox Menu, Nintendo +" -msgstr "スタート、Xbox、任天堂 +" +msgstr "Start、Xbox Menu、Nintendo +" msgid "Left Stick, Sony L3, Xbox L/LS" -msgstr "左スティック。Sony L3、Xbox L/LS" +msgstr "左スティック、Sony L3、Xbox L/LS" msgid "Right Stick, Sony R3, Xbox R/RS" -msgstr "右スティック。Sony R3、Xbox R/RS" +msgstr "右スティック、Sony R3、Xbox R/RS" msgid "Left Shoulder, Sony L1, Xbox LB" -msgstr "左ショルダー、PSコンのL1ボタン、XboxコンのLBボタン" +msgstr "左ショルダー、Sony L1、Xbox LB" msgid "Right Shoulder, Sony R1, Xbox RB" -msgstr "右ショルダー、PSコンのR1ボタン、Xbox RBボタン" +msgstr "右ショルダー、Sony R1、Xbox RB" msgid "D-pad Up" msgstr "D-pad 上" @@ -206,7 +206,7 @@ msgid "D-pad Right" msgstr "D-pad 右" msgid "Xbox Share, PS5 Microphone, Nintendo Capture" -msgstr "Xbox シェア, PS5 マイク, Nintendo キャプチャ" +msgstr "Xbox シェア、PS5 マイク、Nintendo キャプチャ" msgid "Xbox Paddle 1" msgstr "Xbox パドル 1" @@ -1940,6 +1940,9 @@ msgstr "開発者" msgid "Authors" msgstr "作者" +msgid "Patrons" +msgstr "パトロン" + msgid "Platinum Sponsors" msgstr "プラチナスポンサー" @@ -1949,20 +1952,17 @@ msgstr "ゴールドスポンサー" msgid "Silver Sponsors" msgstr "シルバースポンサー" -msgid "Bronze Sponsors" -msgstr "ブロンズスポンサー" - -msgid "Mini Sponsors" -msgstr "ミニスポンサー" +msgid "Diamond Members" +msgstr "ダイヤモンドメンバー" -msgid "Gold Donors" -msgstr "ゴールドドナー" +msgid "Titanium Members" +msgstr "チタニウムメンバー" -msgid "Silver Donors" -msgstr "シルバードナー" +msgid "Platinum Members" +msgstr "プレミアムメンバー" -msgid "Bronze Donors" -msgstr "ブロンズドナー" +msgid "Gold Members" +msgstr "ゴールドメンバー" msgid "Donors" msgstr "ドナー" @@ -2827,12 +2827,24 @@ msgstr "メソッドの説明" msgid "Operator Descriptions" msgstr "オペレーターの説明" +msgid "Metadata:" +msgstr "メタデータ:" + msgid "Property:" msgstr "プロパティ:" +msgid "Method:" +msgstr "メソッド:" + msgid "Signal:" msgstr "シグナル:" +msgid "Theme Item:" +msgstr "テーマアイテム:" + +msgid "No description available." +msgstr "説明はありません。" + msgid "%d match." msgstr "%d件の一致が見つかりました。" @@ -3431,17 +3443,6 @@ msgstr "" "さらなるエラーを防ぐため、'%s' のアドオンを無効化します。" msgid "" -"Unable to load addon script from path: '%s' Base type is not EditorPlugin." -msgstr "" -"パス '%s' からアドオンスクリプトを読み込めません。基底型が EditorPlugin ではあ" -"りません。" - -msgid "Unable to load addon script from path: '%s' Script is not in tool mode." -msgstr "" -"パス '%s' からアドオンスクリプトを読み込めません。スクリプトがツールモードでは" -"ありません。" - -msgid "" "Scene '%s' was automatically imported, so it can't be modified.\n" "To make changes to it, a new inherited scene can be created." msgstr "" @@ -3641,6 +3642,9 @@ msgstr "ツール" msgid "Orphan Resource Explorer..." msgstr "孤立リソースエクスプローラー..." +msgid "Upgrade Mesh Surfaces..." +msgstr "メッシュサーフェスをアップグレード..." + msgid "Reload Current Project" msgstr "現在のプロジェクトをリロード" @@ -3952,6 +3956,12 @@ msgstr "" msgid "Assign..." msgstr "割り当て..." +msgid "Copy as Text" +msgstr "パスをコピー" + +msgid "Show Node in Tree" +msgstr "ツリーでノードを表示" + msgid "Invalid RID" msgstr "無効なRID" @@ -4039,6 +4049,9 @@ msgstr "ユニーク化" msgid "Make Unique (Recursive)" msgstr "ユニーク化 (再帰的)" +msgid "Save As..." +msgstr "名前を付けて保存..." + msgid "Show in FileSystem" msgstr "ファイルシステム上で表示" @@ -4513,6 +4526,9 @@ msgstr "プリセット '%s' を削除しますか?" msgid "Resources to exclude:" msgstr "除外するリソース:" +msgid "Resources to override export behavior:" +msgstr "エクスポート処理を上書きするリソース:" + msgid "Resources to export:" msgstr "エクスポートするリソース:" @@ -4822,6 +4838,9 @@ msgstr "フォルダーを複製:" msgid "New Inherited Scene" msgstr "新しい継承シーン" +msgid "Set as Main Scene" +msgstr "メインシーンとして設定" + msgid "Open Scenes" msgstr "シーンを開く" @@ -4933,6 +4952,33 @@ msgstr "名前を変更..." msgid "Open in External Program" msgstr "外部プログラムで開く" +msgid "Red" +msgstr "赤色" + +msgid "Orange" +msgstr "オレンジ色" + +msgid "Yellow" +msgstr "黄色" + +msgid "Green" +msgstr "緑色" + +msgid "Teal" +msgstr "水色" + +msgid "Blue" +msgstr "青色" + +msgid "Purple" +msgstr "紫色" + +msgid "Pink" +msgstr "ピンク色" + +msgid "Gray" +msgstr "灰色" + msgid "Go to previous selected folder/file." msgstr "前に選択したフォルダ/ファイルに移動します。" @@ -4942,6 +4988,9 @@ msgstr "次に選択したフォルダ/ファイルに移動します。" msgid "Re-Scan Filesystem" msgstr "ファイルシステムを再スキャン" +msgid "Change Split Mode" +msgstr "分割モードの変更" + msgid "Filter Files" msgstr "ファイルをフィルタ" @@ -5553,15 +5602,6 @@ msgstr "動的にレンダリングされるTrueType/OpenTypeフォント" msgid "Prerendered multichannel(+true) signed distance field" msgstr "プリレンダリングされたマルチチャンネル(+true) 符号付き距離フィールド" -msgid "Can't load font texture:" -msgstr "フォントテクスチャを読み込むことができません。" - -msgid "Image margin too big." -msgstr "画像の余白が大きすぎます。" - -msgid "Character margin too big." -msgstr "文字の余白が大きすぎます。" - msgid "Pre-Import Scene" msgstr "シーンを事前インポート" @@ -5925,9 +5965,6 @@ msgstr "既存のリソースをディスクから読み込み編集する。" msgid "Save the currently edited resource." msgstr "現在編集中のリソースを保存する。" -msgid "Save As..." -msgstr "名前を付けて保存..." - msgid "Extra resource options." msgstr "追加のリソースオプション。" @@ -6540,6 +6577,9 @@ msgstr "[グローバル](作成)" msgid "Duplicated Animation Name:" msgstr "複製されたアニメーション名:" +msgid "Onion skinning requires a RESET animation." +msgstr "オニオン スキニングには RESET アニメーションが必要です。" + msgid "Play selected animation backwards from current pos. (A)" msgstr "選択したアニメーションを現在の位置から逆再生する。(A)" @@ -7672,6 +7712,18 @@ msgstr "" "このオプションを有効にすると、回避形状、大きさおよびベロシティが、ゲーム実行中" "にも表示されるようになります。" +msgid "Debug CanvasItem Redraws" +msgstr "CanvasItem の再描画をデバッグする" + +msgid "" +"When this option is enabled, redraw requests of 2D objects will become " +"visible (as a short flash) in the running project.\n" +"This is useful to troubleshoot low processor mode." +msgstr "" +"このオプションを有効にすると、2D オブジェクトの再描画リクエストが実行中のプロ" +"ジェクトに (短いフラッシュとして) 表示されるようになります。\n" +"これは、低プロセッサモードのトラブルシューティングに役立ちます。" + msgid "Synchronize Scene Changes" msgstr "シーン変更を同期" @@ -8041,6 +8093,9 @@ msgstr "ナビゲーションメッシュを生成" msgid "Create Debug Tangents" msgstr "デバッグ接線を生成" +msgid "No mesh to unwrap." +msgstr "アンラップするメッシュがありません。" + msgid "" "Mesh cannot unwrap UVs because it does not belong to the edited scene. Make " "it unique first." @@ -8068,6 +8123,15 @@ msgstr "UV2のアンラップ" msgid "Contained Mesh is not of type ArrayMesh." msgstr "含まれているメッシュがArrayMesh型ではありません。" +msgid "Can't unwrap mesh with blend shapes." +msgstr "メッシュはブレンドシェイプとアンラップできません。" + +msgid "Only triangles are supported for lightmap unwrap." +msgstr "ライトマップのアンラップでは三角形のみがサポートされます。" + +msgid "Normals are required for lightmap unwrap." +msgstr "ライトマップのアンラップには法線が必要です。" + msgid "UV Unwrap failed, mesh may not be manifold?" msgstr "UV展開に失敗しました。メッシュが非多様体ではありませんか?" @@ -9797,6 +9861,12 @@ msgstr "LightOccluder2Dを作成" msgid "LightOccluder2D Preview" msgstr "LightOccluder2D プレビュー" +msgid "Can't convert a sprite from a foreign scene." +msgstr "外部シーンからのスプライトを変換できません。" + +msgid "Can't convert an empty sprite to mesh." +msgstr "空のスプライトをメッシュに変換できません。" + msgid "Can't convert a sprite using animation frames to mesh." msgstr "アニメーションフレームを使用してスプライトをメッシュに変換できません。" @@ -11610,7 +11680,7 @@ msgid "Light" msgstr "ライト" msgid "Process" -msgstr "プロセス" +msgstr "インポートプロセス" msgid "Collide" msgstr "衝突" @@ -13463,9 +13533,19 @@ msgstr "" "\"editable_instance\" を無効にすると、ノードのすべてのプロパティがデフォルトに" "戻ります。" +msgid "" +"Enabling \"Load as Placeholder\" will disable \"Editable Children\" and cause " +"all properties of the node to be reverted to their default." +msgstr "" +"「プレースホルダーとしてロード」を有効にすると、「編集可能な子」が無効になり、" +"ノードのすべてのプロパティがデフォルトに戻ります。" + msgid "Make Local" msgstr "ローカルにする" +msgid "Can't toggle unique name for nodes in subscene!" +msgstr "サブシーン内のノードの固有名を切り替えることができません!" + msgid "Enable Scene Unique Name(s)" msgstr "シーン固有名を有効にする" @@ -13517,16 +13597,6 @@ msgstr "ノードを除去" msgid "Change type of node(s)" msgstr "ノードのタイプを変更" -msgid "Removing the node from variable \"%s\" on node \"%s\"." -msgstr "次の変数からノードを削除します。変数 \"%s\" を持つノード \"%s\" 。" - -msgid "" -"The node's new type is incompatible with an exported variable (expected %s, " -"but type is %s)." -msgstr "" -"ノードの新しい型はエクスポートされた変数と互換性がありません (%s が予想されま" -"すが、型は %s)。" - msgid "This operation requires a single selected node." msgstr "この操作には選択されたノードが1つ必要です。" @@ -13561,6 +13631,9 @@ msgstr "継承をクリア" msgid "Editable Children" msgstr "編集可能な子" +msgid "Load as Placeholder" +msgstr "プレースホルダーとしてロード" + msgid "Auto Expand to Selected" msgstr "選択対象へ自動拡張" @@ -13851,7 +13924,7 @@ msgid "Please specify a valid shader uniform identifier name." msgstr "有効なシェーダーuniform識別子名を指定してください。" msgid "Global shader parameter '%s' already exists'" -msgstr "グローバルシェーダーパラメーター '%s' は存在しています" +msgstr "グローバルシェーダーパラメーター '%s' は既に存在しています" msgid "Name '%s' is a reserved shader language keyword." msgstr "名前 '%s' は予約されたシェーダー言語キーワードです。" @@ -13859,6 +13932,65 @@ msgstr "名前 '%s' は予約されたシェーダー言語キーワードです msgid "Add Shader Global Parameter" msgstr "シェーダーグローバルパラメーターを追加" +msgid "" +"This project uses meshes with an outdated mesh format from previous Godot " +"versions. The engine needs to update the format in order to use those meshes. " +"Please use the 'Upgrade Mesh Surfaces' tool from the 'Project > Tools' menu. " +"You can ignore this message and keep using outdated meshes, but keep in mind " +"that this leads to increased load times every time you load the project." +msgstr "" +"このプロジェクトでは、以前の Godot バージョンの古いメッシュ形式のメッシュが使" +"用されています。 これらのメッシュを使用するには、エンジンでフォーマットを更新" +"する必要があります。 「プロジェクト > ツール」メニューから「メッシュサーフェス" +"のアップグレード」ツールを使用してください。 このメッセージを無視して古いメッ" +"シュを使用し続けることもできますが、プロジェクトをロードするたびにロード時間が" +"長くなることに注意してください。" + +msgid "" +"This project uses meshes with an outdated mesh format. Check the output log." +msgstr "" +"このプロジェクトでは、古いメッシュ形式のメッシュが使用されています。 出力され" +"たログを確認してください。" + +msgid "Upgrading All Meshes in Project" +msgstr "プロジェクト内のすべてのメッシュをアップグレード中" + +msgid "Attempting to re-save " +msgstr "再保存を試行中 " + +msgid "Attempting to remove " +msgstr "削除を試行中 " + +msgid "" +"The mesh format has changed in Godot 4.2, which affects both imported meshes " +"and meshes authored inside of Godot. The engine needs to update the format in " +"order to use those meshes.\n" +"\n" +"If your project predates Godot 4.2 and contains meshes, we recommend you run " +"this one time conversion tool. This update will restart the editor and may " +"take several minutes. Upgrading will make the meshes incompatible with " +"previous versions of Godot.\n" +"\n" +"You can still use your existing meshes as is. The engine will update each " +"mesh in memory, but the update will not be saved. Choosing this option will " +"lead to slower load times every time this project is loaded." +msgstr "" +"Godot 4.2 ではメッシュ形式が変更され、インポートされたメッシュと Godot 内で作" +"成されたメッシュの両方に影響します。 これらのメッシュを使用するには、エンジン" +"でフォーマットを更新する必要があります。\n" +"\n" +"プロジェクトが Godot 4.2 よりも古く、メッシュが含まれている場合は、この 1 回限" +"りの変換ツールを実行することをお勧めします。 この更新によりエディタが再起動さ" +"れ、数分かかる場合があります。 アップグレードすると、メッシュは Godot の以前の" +"バージョンと互換性がなくなります。\n" +"\n" +"既存のメッシュをそのまま使用できます。 エンジンはメモリ内の各メッシュを更新し" +"ますが、更新は保存されません。 このオプションを選択すると、このプロジェクトが" +"ロードされるたびにロード時間が遅くなります。" + +msgid "Restart & Upgrade" +msgstr "再起動とアップグレード" + msgid "Make this panel floating in the screen %d." msgstr "このパネルを画面%dにフローティングさせます。" @@ -13887,6 +14019,9 @@ msgstr "トーラスの外半径を変更" msgid "Invalid type argument to convert(), use TYPE_* constants." msgstr "convert() の引数の型が無効です。TYPE_* 定数を使用してください。" +msgid "Cannot resize array." +msgstr "配列のサイズを変更できません。" + msgid "Step argument is zero!" msgstr "ステップ引数はゼロです!" @@ -13911,6 +14046,9 @@ msgstr "無効なインスタンス辞書形式です(@path で無効なスク msgid "Invalid instance dictionary (invalid subclasses)" msgstr "無効なインスタンス辞書です(無効なサブクラス)" +msgid "Cannot instantiate GDScript class." +msgstr "GDScriptクラスをインスタンス化できません。" + msgid "Value of type '%s' can't provide a length." msgstr "'%s'型のオブジェクトは長さを提供できません。" @@ -14122,6 +14260,9 @@ msgstr "ダイレクトライティングをプロットする" msgid "Integrate indirect lighting" msgstr "間接ライティングを統合する" +msgid "Integrate indirect lighting %d%%" +msgstr "間接照明を統合します %d%%" + msgid "Baking lightprobes" msgstr "ライトプローブをベイク" @@ -14543,6 +14684,10 @@ msgstr "デバイスで実行できませんでした。" msgid "Exporting to Android when using C#/.NET is experimental." msgstr "C#/.NET を使用する場合の Android へのエクスポートは実験的です。" +msgid "Android architecture %s not supported in C# projects." +msgstr "" +"Android アーキテクチャ %s は C# プロジェクトではサポートされていません。" + msgid "" "Android build template not installed in the project. Install it from the " "Project menu." @@ -14703,23 +14848,15 @@ msgstr "拡張パッケージファイルを書き込めませんでした!" msgid "Building Android Project (gradle)" msgstr "Androidプロジェクトの構築(gradle)" -msgid "" -"Building of Android project failed, check output for the error. Alternatively " -"visit docs.godotengine.org for Android build documentation." +msgid "Building of Android project failed, check output for the error:" msgstr "" -"Androidプロジェクトのビルドに失敗しました。エラーの出力を確認してください。\n" -"また、Androidビルドについてのドキュメントは docs.godotengine.org をご覧くださ" -"い。" +"Android プロジェクトのビルドに失敗しました。エラー出力を確認してください:" msgid "Moving output" msgstr "出力結果の移動中" -msgid "" -"Unable to copy and rename export file, check gradle project directory for " -"outputs." -msgstr "" -"エクスポートファイルのコピーと名前の変更ができません。出力結果をみるにはgradle" -"のプロジェクトディレクトリを確認してください。" +msgid "Unable to copy and rename export file:" +msgstr "エクスポートファイルのコピーと名前変更ができません:" msgid "Package not found: \"%s\"." msgstr "パッケージが見つかりません: \"%s\"。" @@ -14794,6 +14931,14 @@ msgid "" msgstr "" ".ipa は macOS でしかビルドできません。パッケージをビルドせずに終了します。" +msgid "Exporting to iOS when using C#/.NET is experimental and requires macOS." +msgstr "" +"C#/.NET を使用する場合の iOS へのエクスポートは実験的であり、macOS が必要で" +"す。" + +msgid "Exporting to iOS when using C#/.NET is experimental." +msgstr "C#/.NET を使用する場合の iOS へのエクスポートは実験的です。" + msgid "Identifier is missing." msgstr "識別子がありません。" @@ -14957,6 +15102,13 @@ msgstr "App Store の配布には、インストーラーの署名 ID が必要 msgid "App sandbox is required for App Store distribution." msgstr "App Store の配布にはアプリサンドボックスが必要です。" +msgid "" +"'rcodesign' doesn't support signing applications with embedded dynamic " +"libraries (GDExtension or .NET)." +msgstr "" +"「rcodesign」は、組み込み動的ライブラリ (GDExtension または .NET) を使用したア" +"プリケーションの署名をサポートしていません。" + msgid "Code signing is required for App Store distribution." msgstr "App Storeでの配布にはコード署名が必要です。" @@ -15149,6 +15301,13 @@ msgstr "" "アドホック署名付きアプリケーションでは、動的ライブラリを読み込むために「ライブ" "ラリ検証を無効にする」の権限が必要です。" +msgid "" +"'rcodesign' doesn't support signing applications with embedded dynamic " +"libraries." +msgstr "" +"「rcodesign」は、組み込み動的ライブラリを使用したアプリケーションの署名をサ" +"ポートしていません。" + msgid "Could not create entitlements file." msgstr "資格ファイルを作成できませんでした。" @@ -15614,6 +15773,17 @@ msgstr "" "ソートが有効になっていません。" msgid "" +"The TileMap node is set as Y-sorted, but Y-sort is not enabled on any of the " +"TileMap's layers.\n" +"This may lead to unwanted behaviors, as a layer that is not Y-sorted will be " +"Y-sorted as a whole." +msgstr "" +"TileMap ノードは Y ソートとして設定されていますが、TileMap のどのレイヤーでも " +"Y ソートが有効になっていません。\n" +"Y ソートされていないレイヤーも含め全体として Y ソートされるため、望ましくない" +"動作が発生する可能性があります。" + +msgid "" "Isometric TileSet will likely not look as intended without Y-sort enabled for " "the TileMap and all of its layers." msgstr "" @@ -16152,6 +16322,9 @@ msgstr "" msgid "New Code Region" msgstr "新しいコード領域" +msgid "Copy this constructor in a script." +msgstr "このコンストラクターをスクリプトにコピーします。" + msgid "Enter a hex code (\"#ff0000\") or named color (\"red\")." msgstr "16進コード (「#ff0000」) または名前付きの色 (「red」) を入力します。" @@ -16253,6 +16426,13 @@ msgid "Automatically arrange selected nodes." msgstr "選択したノードを自動的に配置します。" msgid "" +"Labels with autowrapping enabled must have a custom minimum size configured " +"to work correctly inside a container." +msgstr "" +"コンテナ内で正しく動作させるため、自動ラッピングが有効になっているラベルには、" +"カスタム最小サイズの設定が必要です。" + +msgid "" "The current font does not support rendering one or more characters used in " "this Label's text." msgstr "" @@ -16376,15 +16556,6 @@ msgstr "" "す。" msgid "" -"Setting node name '%s' to be unique within scene for '%s', but it's already " -"claimed by '%s'.\n" -"'%s' is no longer set as having a unique name." -msgstr "" -"ノード名 '%s' を '%s' のシーン内で一意になるように設定していますが、すでに " -"'%s' によって要求されています。\n" -"「%s」は一意の名前として設定されなくなりました。" - -msgid "" "This node is marked as deprecated and will be removed in future versions.\n" "Please check the Godot documentation for information about migration." msgstr "" @@ -16400,13 +16571,6 @@ msgstr "" "大幅な変更が行われる可能性があります。" msgid "" -"Default Environment as specified in the project setting \"rendering/" -"environment/defaults/default_environment\" could not be loaded." -msgstr "" -"プロジェクト設定「rendering/environment/defaults/default_environment」で指定さ" -"れたデフォルト環境をロードできませんでした。" - -msgid "" "ShaderGlobalsOverride is not active because another node of the same type is " "in the scene." msgstr "" @@ -16430,28 +16594,6 @@ msgid "" msgstr "" "レンダーするにはViewportの縦横それぞれが2ピクセル以上である必要があります。" -msgid "Cannot open font from file: %s." -msgstr "ファイルからフォントを開けません: %s。" - -msgid "Version %d of BMFont is not supported (should be 3)." -msgstr "" -"BMFont のバージョン %d はサポートされていません (3 である必要があります)。" - -msgid "Invalid BMFont info block size." -msgstr "BMFont 情報ブロック サイズが無効です。" - -msgid "Invalid BMFont common block size." -msgstr "BMFont 共通ブロック サイズが無効です。" - -msgid "Can't load font texture: %s." -msgstr "フォント テクスチャを読み込めません: %s。" - -msgid "Unsupported BMFont texture format." -msgstr "サポートされていない BMFont テクスチャ形式です。" - -msgid "Invalid BMFont block type." -msgstr "無効な BMFont ブロック タイプです。" - msgid "" "An incoming node's name clashes with %s already in the scene (presumably, " "from a more nested instance).\n" @@ -16764,6 +16906,9 @@ msgstr "メンバーとして識別子が必要です。" msgid "Cannot combine symbols from different sets in expression '.%s'." msgstr "式 '.%s' では異なるセットのシンボルを結合できません。" +msgid "Invalid member for '%s' expression: '.%s'." +msgstr "無効なメンバ '%s' が '.%s' 式にあります。" + msgid "An object of type '%s' can't be indexed." msgstr "型「%s」のオブジェクトはインデックスできません。" diff --git a/editor/translations/editor/ka.po b/editor/translations/editor/ka.po index 9dd48c4f66..a9f193b9d1 100644 --- a/editor/translations/editor/ka.po +++ b/editor/translations/editor/ka.po @@ -1103,18 +1103,6 @@ msgstr "პლატინის სპონსორები" msgid "Gold Sponsors" msgstr "ოქროს სპონსორები" -msgid "Mini Sponsors" -msgstr "მინი სპონსორები" - -msgid "Gold Donors" -msgstr "ოქროს დონატორები" - -msgid "Silver Donors" -msgstr "ვერცხლის დონატორები" - -msgid "Bronze Donors" -msgstr "ბრინჯაოს დონატორები" - msgid "Donors" msgstr "დონატორები" @@ -1662,6 +1650,9 @@ msgstr "თარგმნადი სტრიქონი (ზომა %d)" msgid "Inspect" msgstr "შეამოწმეთ" +msgid "Save As..." +msgstr "შეინახვა &როგორც..." + msgid "Convert to %s" msgstr "%s-ში გადაყვანა" @@ -2134,9 +2125,6 @@ msgstr "თვისებების კოპირება" msgid "Paste Properties" msgstr "თვისებების ჩასმა" -msgid "Save As..." -msgstr "შეინახვა &როგორც..." - msgid "Go to previous edited object in history." msgstr "ისტორიაში წინა ჩასწორებულ ობიექტზე გადასვლა." @@ -3867,9 +3855,6 @@ msgstr "მარცხნიდან-მარჯვნივ" msgid "Right-to-Left" msgstr "მარჯვნიდან-მარცხნივ" -msgid "Cannot open font from file: %s." -msgstr "ფაილიდან ფონტის გახსნის შეცდომა: %s." - msgid "Default Color" msgstr "ნაგულისხმები ფერი" diff --git a/editor/translations/editor/ko.po b/editor/translations/editor/ko.po index 70788fbdc8..0f80bd97ac 100644 --- a/editor/translations/editor/ko.po +++ b/editor/translations/editor/ko.po @@ -61,8 +61,8 @@ msgstr "" "Project-Id-Version: Godot Engine editor interface\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-11-10 08:03+0000\n" -"Last-Translator: Myeongjin Lee <aranet100@gmail.com>\n" +"PO-Revision-Date: 2023-12-04 01:29+0000\n" +"Last-Translator: nulta <un5450@naver.com>\n" "Language-Team: Korean <https://hosted.weblate.org/projects/godot-engine/godot/" "ko/>\n" "Language: ko\n" @@ -70,7 +70,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 5.2-dev\n" +"X-Generator: Weblate 5.3-dev\n" msgid "Main Thread" msgstr "메인 스레드" @@ -607,10 +607,19 @@ msgid "Animation Change Call" msgstr "애니메이션 변경 호출" msgid "Animation Multi Change Transition" -msgstr "애니메이션 다중 변경 전환" +msgstr "애니메이션 전환 다수 변경" + +msgid "Animation Multi Change Position3D" +msgstr "애니메이션 3D 위치 다수 변경" + +msgid "Animation Multi Change Rotation3D" +msgstr "애니메이션 3D 회전 다수 변경" + +msgid "Animation Multi Change Scale3D" +msgstr "애니메이션 3D 크기 다수 변경" msgid "Animation Multi Change Keyframe Value" -msgstr "애니메이션 다중 키프레임 값 변경" +msgstr "애니메이션 키프레임 값 다수 변경" msgid "Animation Multi Change Call" msgstr "애니메이션 다중 호출 바꾸기" @@ -718,7 +727,7 @@ msgid "(Invalid, expected type: %s)" msgstr "(인식불가. 예상한 타입: %s)" msgid "Easing:" -msgstr "Easing:" +msgstr "이징:" msgid "In-Handle:" msgstr "입력 핸들:" @@ -820,6 +829,11 @@ msgstr "" msgid "Remove Anim Track" msgstr "애니메이션 트랙 제거" +msgid "Hold Shift when clicking the key icon to skip this dialog." +msgstr "" +"키 아이콘을 누를 때 Shift 키를 누르고 있으면 이 대화 상자를 건너뛸 수 있습니" +"다." + msgid "Create new track for %s and insert key?" msgstr "\"%s\"을(를) 위한 새로운 트랙을 생성하고 키를 삽입하시겠습니까?" @@ -942,7 +956,7 @@ msgid "Animation Scale Keys" msgstr "애니메이션 스케일 키" msgid "Make Easing Keys" -msgstr "완화 키 만들기" +msgstr "이징 키 만들기" msgid "" "This option does not work for Bezier editing, as it's only a single track." @@ -952,6 +966,9 @@ msgstr "" msgid "Animation Add RESET Keys" msgstr "애니메이션 리셋 키 추가" +msgid "Bake Animation as Linear Keys" +msgstr "애니메이션을 직선형 키로 굽기" + msgid "" "This animation belongs to an imported scene, so changes to imported tracks " "will not be saved.\n" @@ -971,6 +988,22 @@ msgstr "" "면,\n" "\"파일으로 저장\"과 \"커스텀 트랙 유지\"를 켜세요." +msgid "" +"Some AnimationPlayerEditor's options are disabled since this is the dummy " +"AnimationPlayer for preview.\n" +"\n" +"The dummy player is forced active, non-deterministic and doesn't have the " +"root motion track. Furthermore, the original node is inactive temporary." +msgstr "" +"미리보기용 더미 AnimationPlayer를 사용 중이기 때문에 AnimationPlayerEditor의 " +"일부 설정을 조작할 수 없습니다.\n" +"\n" +"더미 플레이어는 항상 활성화 상태이고, 비결정적이며, 루트 모션 트랙을 가지지 않" +"습니다. 또한 본래 노드는 임시적으로 비활성화됩니다." + +msgid "AnimationPlayer is inactive. The playback will not be processed." +msgstr "AnimationPlayer가 비활성 상태입니다. 애니메이션을 재생하지 않습니다." + msgid "Select an AnimationPlayer node to create and edit animations." msgstr "애니메이션을 만들고 편집하려면 AnimationPlayer노드를 선택하세요." @@ -980,6 +1013,18 @@ msgstr "가져온 씬" msgid "Warning: Editing imported animation" msgstr "경고: 가져온 애니메이션을 편집하고 있음" +msgid "Dummy Player" +msgstr "더미 플레이어" + +msgid "Warning: Editing dummy AnimationPlayer" +msgstr "경고: 더미 AnimationPlayer를 편집하고 있음" + +msgid "Inactive Player" +msgstr "비활성 플레이어" + +msgid "Warning: AnimationPlayer is inactive" +msgstr "경고: AnimationPlayer가 비활성 상태입니다" + msgid "Toggle between the bezier curve editor and track editor." msgstr "베지어 커브 편집기와 트랙 편집기 사이를 전환합니다." @@ -1017,7 +1062,7 @@ msgid "Scale From Cursor" msgstr "커서 위치에서 스케일 조절" msgid "Make Easing Selection" -msgstr "완화 선택 만들기" +msgstr "선택된 구간에 이징 만들기" msgid "Duplicate Selection" msgstr "선택 항목 복제" @@ -1089,7 +1134,7 @@ msgid "Scale Ratio:" msgstr "스케일 비율:" msgid "Select Transition and Easing" -msgstr "전환 및 완화 선택" +msgstr "전환 및 이징 선택" msgctxt "Transition Type" msgid "Linear" @@ -1229,6 +1274,14 @@ msgstr "모두 바꾸기" msgid "Selection Only" msgstr "선택 영역만" +msgctxt "Indentation" +msgid "Spaces" +msgstr "스페이스" + +msgctxt "Indentation" +msgid "Tabs" +msgstr "탭" + msgid "Toggle Scripts Panel" msgstr "스크립트 패널 토글" @@ -1641,6 +1694,9 @@ msgstr "정지" msgid "Continue" msgstr "계속" +msgid "Thread:" +msgstr "스레드:" + msgid "Stack Frames" msgstr "스택 프레임" @@ -1819,6 +1875,12 @@ msgstr "폴더 이름은 비워둘 수 없습니다." msgid "Folder name contains invalid characters." msgstr "폴더 이름에 잘못된 문자가 있습니다." +msgid "Folder name cannot begin or end with a space." +msgstr "폴더 이름의 시작이나 끝에 공백 문자를 넣을 수 없습니다." + +msgid "Folder name cannot begin with a dot." +msgstr "폴더 이름은 점으로 시작할 수 없습니다." + msgid "File with that name already exists." msgstr "이 이름으로 된 파일이 이미 있습니다." @@ -1866,6 +1928,9 @@ msgstr "개발자" msgid "Authors" msgstr "저자" +msgid "Patrons" +msgstr "후원자" + msgid "Platinum Sponsors" msgstr "플래티넘 스폰서" @@ -1875,20 +1940,17 @@ msgstr "골드 스폰서" msgid "Silver Sponsors" msgstr "실버 스폰서" -msgid "Bronze Sponsors" -msgstr "브론즈 스폰서" - -msgid "Mini Sponsors" -msgstr "미니 스폰서" +msgid "Diamond Members" +msgstr "다이아몬드 멤버" -msgid "Gold Donors" -msgstr "골드 기부자" +msgid "Titanium Members" +msgstr "티타늄 멤버" -msgid "Silver Donors" -msgstr "실버 기부자" +msgid "Platinum Members" +msgstr "플래티넘 멤버" -msgid "Bronze Donors" -msgstr "브론즈 기부자" +msgid "Gold Members" +msgstr "골드 멤버" msgid "Donors" msgstr "기부자" @@ -1924,6 +1986,19 @@ msgstr "\"%s\"에 대한 애셋 파일을 여는 중 오류 (ZIP 형식이 아 msgid "%s (already exists)" msgstr "%s (이미 있습니다)" +msgid "%d file conflicts with your project and won't be installed" +msgid_plural "%d files conflict with your project and won't be installed" +msgstr[0] "%d개 파일이 프로젝트와 충돌하기 때문에 설치되지 않습니다" + +msgid "This asset doesn't have a root directory, so it can't be ignored." +msgstr "이 에셋에는 루트 디렉터리가 없기 때문에 무시할 수 없습니다." + +msgid "Ignore the root directory when extracting files." +msgstr "파일을 압축 해제할 때 루트 디렉터리를 무시합니다." + +msgid "Select Install Folder" +msgstr "설치 폴더 선택" + msgid "Uncompressing Assets" msgstr "애셋 압축 풀기" @@ -1939,6 +2014,37 @@ msgstr "애셋 \"%s\"를 성공적으로 설치했습니다!" msgid "Success!" msgstr "성공!" +msgid "Asset:" +msgstr "에셋:" + +msgid "Open the list of the asset contents and select which files to install." +msgstr "에셋의 파일 목록을 열고 그 중 설치할 파일들을 선택합니다." + +msgid "Change Install Folder" +msgstr "설치 폴더 변경" + +msgid "" +"Change the folder where the contents of the asset are going to be installed." +msgstr "에셋의 파일들을 설치할 폴더를 변경합니다." + +msgid "Ignore asset root" +msgstr "에셋 루트 무시" + +msgid "No files conflict with your project" +msgstr "프로젝트와 충돌하는 파일이 없습니다" + +msgid "Show contents of the asset and conflicting files." +msgstr "에셋과 충돌하는 파일의 내용을 봅니다." + +msgid "Contents of the asset:" +msgstr "에셋의 내용:" + +msgid "Installation preview:" +msgstr "설치 미리보기:" + +msgid "Configure Asset Before Installing" +msgstr "설치 전 에셋 설정" + msgid "Install" msgstr "설치" @@ -2306,6 +2412,13 @@ msgstr "감지 시 강제 클래스:" msgid "Edit Build Configuration Profile" msgstr "빌드 설정 프로필 편집" +msgid "" +"Failed to execute command \"%s\":\n" +"%s." +msgstr "" +"명령 \"%s\"를 실행할 수 없습니다:\n" +"%s." + msgid "Filter Commands" msgstr "명령어 필터" @@ -2531,6 +2644,36 @@ msgstr "" msgid "Error codes returned:" msgstr "반환된 오류 코드:" +msgid "There is currently no description for this method." +msgstr "현재 이 메서드에 대한 설명이 없습니다." + +msgid "There is currently no description for this constructor." +msgstr "현재 이 생성자에 대한 설명이 없습니다." + +msgid "There is currently no description for this operator." +msgstr "현재 이 연산자에 대한 설명이 없습니다." + +msgid "" +"There is currently no description for this method. Please help us by " +"[color=$color][url=$url]contributing one[/url][/color]!" +msgstr "" +"현재 이 메서드의 설명이 없습니다. [color=$color][url=$url]관련 정보를 기여하여" +"[/url][/color] 개선할 수 있도록 도와주세요!" + +msgid "" +"There is currently no description for this constructor. Please help us by " +"[color=$color][url=$url]contributing one[/url][/color]!" +msgstr "" +"현재 이 생성자의 설명이 없습니다. [color=$color][url=$url]관련 정보를 기여하여" +"[/url][/color] 개선할 수 있도록 도와주세요!" + +msgid "" +"There is currently no description for this operator. Please help us by " +"[color=$color][url=$url]contributing one[/url][/color]!" +msgstr "" +"현재 이 연산자의 설명이 없습니다. [color=$color][url=$url]관련 정보를 기여하여" +"[/url][/color] 개선할 수 있도록 도와주세요!" + msgid "Top" msgstr "위쪽" @@ -2569,6 +2712,16 @@ msgstr "" "현재 이 클래스의 설명이 없습니다. [color=$color][url=$url]관련 정보를 기여하여" "[/url][/color] 개선할 수 있도록 도와주세요!" +msgid "Note:" +msgstr "노트:" + +msgid "" +"There are notable differences when using this API with C#. See [url=%s]C# API " +"differences to GDScript[/url] for more information." +msgstr "" +"이 API는 C#에서 사용될 때 큰 차이가 있습니다. 자세한 내용은 [url=%s]C# API와 " +"GDScript의 차이점[/url]을 참조하십시오." + msgid "Online Tutorials" msgstr "온라인 튜토리얼" @@ -2652,12 +2805,24 @@ msgstr "메서드 설명" msgid "Operator Descriptions" msgstr "연산자 설명" +msgid "Metadata:" +msgstr "메타데이터:" + msgid "Property:" msgstr "속성:" +msgid "Method:" +msgstr "메서드:" + msgid "Signal:" msgstr "시그널:" +msgid "Theme Item:" +msgstr "테마 항목:" + +msgid "No description available." +msgstr "사용 가능한 설명이 없습니다." + msgid "%d match." msgstr "%d개 일치." @@ -2759,6 +2924,12 @@ msgid "Move element %d to position %d in property array with prefix %s." msgstr "" "%d번 요소의 위치를 %d번으로, 접두어 %s를 가진 속성 배열 내에서 이동합니다." +msgid "Clear Property Array with Prefix %s" +msgstr "접두어 %s를 가진 속성 배열 비우기" + +msgid "Resize Property Array with Prefix %s" +msgstr "접두어 %s를 가진 속성 배열 크기 변경" + msgid "Element %d: %s%d*" msgstr "요소 %d: %s%d*" @@ -2798,6 +2969,9 @@ msgstr "메타데이터 추가" msgid "Set %s" msgstr "Set %s" +msgid "Set Multiple: %s" +msgstr "다수 변경: %s" + msgid "Remove metadata %s" msgstr "메타데이터 %s 제거" @@ -3246,17 +3420,6 @@ msgstr "" "추가 오류를 방지하려면 '%s'에서 애드온을 비활성화하세요." msgid "" -"Unable to load addon script from path: '%s' Base type is not EditorPlugin." -msgstr "" -"다음 경로에서 애드온 스크립트를 불러올 수 없음: '%s' 기본 타입이 EditorPlugin" -"이 아닙니다." - -msgid "Unable to load addon script from path: '%s' Script is not in tool mode." -msgstr "" -"다음 경로에서 애드온 스크립트를 불러올 수 없음: '%s' 스크립트가 tool 모드가 아" -"닙니다." - -msgid "" "Scene '%s' was automatically imported, so it can't be modified.\n" "To make changes to it, a new inherited scene can be created." msgstr "" @@ -3315,9 +3478,34 @@ msgstr "레이아웃 삭제" msgid "Default" msgstr "기본값" +msgid "This scene was never saved." +msgstr "이 씬은 저장되지 않았습니다." + +msgid "%d second ago" +msgid_plural "%d seconds ago" +msgstr[0] "%d초 전" + +msgid "%d minute ago" +msgid_plural "%d minutes ago" +msgstr[0] "%d분 전" + +msgid "%d hour ago" +msgid_plural "%d hours ago" +msgstr[0] "%d시간 전" + +msgid "" +"Scene \"%s\" has unsaved changes.\n" +"Last saved: %s." +msgstr "" +"씬 \"%s\"에 저장되지 않은 변경 사항이 있습니다.\n" +"마지막 저장: %s." + msgid "Save & Close" msgstr "저장 & 닫기" +msgid "Save before closing?" +msgstr "닫기 전에 저장합니까?" + msgid "%d more files or folders" msgstr "외 %d개의 파일 또는 폴더" @@ -3428,6 +3616,9 @@ msgstr "툴" msgid "Orphan Resource Explorer..." msgstr "미사용 리소스 탐색기..." +msgid "Upgrade Mesh Surfaces..." +msgstr "메시 표면 업그레이드..." + msgid "Reload Current Project" msgstr "현재 프로젝트 새로고침" @@ -3622,6 +3813,12 @@ msgstr "새로고침" msgid "Resave" msgstr "다시 저장" +msgid "Create Version Control Metadata..." +msgstr "버전 관리 메타데이터 생성..." + +msgid "Version Control Settings..." +msgstr "버전 관리 설정..." + msgid "New Inherited" msgstr "새 상속 씬" @@ -3730,6 +3927,12 @@ msgstr "" msgid "Assign..." msgstr "지정..." +msgid "Copy as Text" +msgstr "텍스트로 복사" + +msgid "Show Node in Tree" +msgstr "트리에 노드 표시" + msgid "Invalid RID" msgstr "잘못된 RID" @@ -3816,12 +4019,18 @@ msgstr "유일하게 만들기" msgid "Make Unique (Recursive)" msgstr "유일하게 만들기 (재귀적으로)" +msgid "Save As..." +msgstr "다른 이름으로 저장..." + msgid "Show in FileSystem" msgstr "파일시스템에서 보기" msgid "Convert to %s" msgstr "%s(으)로 변환" +msgid "Select resources to make unique:" +msgstr "유일하게 만들 리소스를 선택하세요:" + msgid "New %s" msgstr "새 %s" @@ -3870,6 +4079,12 @@ msgstr "실행 취소: %s" msgid "Redo: %s" msgstr "다시 실행: %s" +msgid "Edit Built-in Action: %s" +msgstr "내장 액션 편집: %s" + +msgid "Edit Shortcut: %s" +msgstr "단축키 편집: %s" + msgid "Common" msgstr "일반" @@ -4053,6 +4268,9 @@ msgstr "PCK 임베딩" msgid "On 32-bit exports the embedded PCK cannot be bigger than 4 GiB." msgstr "32비트 환경에서는 4 GiB보다 큰 내장 PCK를 내보낼 수 없습니다." +msgid "Plugin \"%s\" is not supported on \"%s\"" +msgstr "플러그인 \"%s\"는 \"%s\"에서는 지원되지 않습니다" + msgid "Open the folder containing these templates." msgstr "이 템플릿이 포함된 폴더를 엽니다." @@ -4249,6 +4467,15 @@ msgstr "" "템플릿이 다운로드를 계속할 것입니다.\n" "완료되면 에디터가 짧게 멈추는 현상을 겪을 수 있습니다." +msgid "" +"Target platform requires '%s' texture compression. Enable 'Import %s' to fix." +msgstr "" +"대상 플랫폼에서 '%s' 텍스처 압축이 필요합니다. 프로젝트 설정에서 '%s 가져오" +"기' 설정을 활성화하세요." + +msgid "Fix Import" +msgstr "가져오기 고치기" + msgid "Runnable" msgstr "실행가능" @@ -4266,6 +4493,9 @@ msgstr "'%s' 프리셋을 삭제하시겠습니까?" msgid "Resources to exclude:" msgstr "제외하는 리소스:" +msgid "Resources to override export behavior:" +msgstr "내보내기 동작을 덮어쓸 리소스:" + msgid "Resources to export:" msgstr "내보내는 리소스:" @@ -4513,6 +4743,9 @@ msgstr "%s 에 리소스를 저장하지 못했습니다: %s" msgid "Failed to load resource at %s: %s" msgstr "%s 에서 리소스를 불러오지 못했습니다: %s" +msgid "Unable to update dependencies for:" +msgstr "종속성을 업데이트할 수 없음:" + msgid "" "This filename begins with a dot rendering the file invisible to the editor.\n" "If you want to rename it anyway, use your operating system's file manager." @@ -4533,6 +4766,9 @@ msgstr "" msgid "A file or folder with this name already exists." msgstr "이 이름은 이미 어떤 파일이나 폴더가 쓰고 있습니다." +msgid "Name begins with a dot." +msgstr "이름이 점으로 시작합니다." + msgid "" "The following files or folders conflict with items in the target location " "'%s':" @@ -4553,6 +4789,9 @@ msgstr "폴더 복제 중:" msgid "New Inherited Scene" msgstr "새 상속된 씬" +msgid "Set as Main Scene" +msgstr "메인 씬으로 설정" + msgid "Open Scenes" msgstr "씬 열기" @@ -4592,6 +4831,12 @@ msgstr "계층 구조 펼치기" msgid "Collapse Hierarchy" msgstr "계층 구조 접기" +msgid "Set Folder Color..." +msgstr "폴더 색깔 설정..." + +msgid "Default (Reset)" +msgstr "기본값 (리셋)" + msgid "Move/Duplicate To..." msgstr "다른 곳으로 이동/복제..." @@ -4658,6 +4903,33 @@ msgstr "이름 바꾸기..." msgid "Open in External Program" msgstr "다른 프로그램에서 열기" +msgid "Red" +msgstr "붉은색" + +msgid "Orange" +msgstr "주황색" + +msgid "Yellow" +msgstr "노란색" + +msgid "Green" +msgstr "초록색" + +msgid "Teal" +msgstr "하늘색" + +msgid "Blue" +msgstr "파란색" + +msgid "Purple" +msgstr "보라색" + +msgid "Pink" +msgstr "분홍색" + +msgid "Gray" +msgstr "회색" + msgid "Go to previous selected folder/file." msgstr "이전 파일/폴더로 이동합니다." @@ -4667,6 +4939,9 @@ msgstr "다음 파일/폴더로 이동합니다." msgid "Re-Scan Filesystem" msgstr "파일시스템 다시 스캔" +msgid "Change Split Mode" +msgstr "분할 모드 변경" + msgid "Filter Files" msgstr "파일 필터" @@ -5098,9 +5373,15 @@ msgstr "씬 트리 (노드):" msgid "Node Configuration Warning!" msgstr "노드 설정 경고!" +msgid "Allowed:" +msgstr "허용값:" + msgid "Select a Node" msgstr "노드를 선택하세요" +msgid "Show All" +msgstr "모두 보기" + msgid "The Beginning" msgstr "시작점" @@ -5259,12 +5540,6 @@ msgstr "동적으로 렌더링된 트루타입/오픈타입 글꼴" msgid "Prerendered multichannel(+true) signed distance field" msgstr "미리 렌더링된 다중 채널(+true) 부호 있는 거리 필드 (Multichannel SDF)" -msgid "Can't load font texture:" -msgstr "글꼴 텍스처를 로드할 수 없습니다:" - -msgid "Image margin too big." -msgstr "이미지 여백이 너무 큽니다." - msgid "Pre-Import Scene" msgstr "씬 미리 가져오기" @@ -5453,6 +5728,9 @@ msgstr "메쉬" msgid "Materials" msgstr "머티리얼" +msgid "Selected Animation Play/Pause" +msgstr "선택된 애니메이션 재생/정지" + msgid "Save Extension:" msgstr "저장할 확장자:" @@ -5504,6 +5782,20 @@ msgid "Advanced..." msgstr "고급..." msgid "" +"The imported resource is currently loaded. All instances will be replaced and " +"undo history will be cleared." +msgstr "" +"불러온 리소스가 이미 로드되어 있습니다. 모든 인스턴스를 교환한 뒤 되돌리기 내" +"역을 비웁니다." + +msgid "" +"WARNING: Assets exist that use this resource. They may stop loading properly " +"after changing type." +msgstr "" +"경고: 이 리소스를 사용하는 에셋이 있습니다. 타입을 변경한 후에는 정상적으로 불" +"러오지 못할 수도 있습니다." + +msgid "" "Select a resource file in the filesystem or in the inspector to adjust import " "settings." msgstr "" @@ -5608,9 +5900,6 @@ msgstr "디스크에서 기존 리소스를 불러오고 편집합니다." msgid "Save the currently edited resource." msgstr "현재 편집하는 리소스를 저장합니다." -msgid "Save As..." -msgstr "다른 이름으로 저장..." - msgid "Extra resource options." msgstr "다른 리소스 옵션입니다." @@ -5737,21 +6026,74 @@ msgstr "업데이트" msgid "Plugin Name:" msgstr "플러그인 이름:" +msgid "Required. This name will be displayed in the list of plugins." +msgstr "필수. 플러그인 목록에 표시할 이름입니다." + msgid "Subfolder:" msgstr "하위 폴더:" +msgid "" +"Optional. The folder name should generally use `snake_case` naming (avoid " +"spaces and special characters).\n" +"If left empty, the folder will be named after the plugin name converted to " +"`snake_case`." +msgstr "" +"선택. 폴더 이름에는 보통 스네이크 표기법( `snake_case` ) 을 사용하며 띄어쓰기" +"나 특수문자 사용은 피합니다.\n" +"공란일 경우, 폴더 이름으로는 스네이크 표기법으로 치환된 플러그인 이름을 사용합" +"니다." + +msgid "" +"Optional. This description should be kept relatively short (up to 5 lines).\n" +"It will display when hovering the plugin in the list of plugins." +msgstr "" +"선택. 설명은 최대 5줄 내로 간결하게 작성하여야 합니다.\n" +"이 설명은 플러그인 목록에서 마우스를 가져다댈 때 보여집니다." + msgid "Author:" msgstr "저자:" +msgid "Optional. The author's username, full name, or organization name." +msgstr "선택. 제작자의 닉네임이나 풀 네임 또는 만든 조직의 이름입니다." + msgid "Version:" msgstr "버전:" +msgid "" +"Optional. A human-readable version identifier used for informational purposes " +"only." +msgstr "선택. 사람이 읽을 수 있는 버전 식별자입니다. 설명 용도로만 사용됩니다." + +msgid "" +"Required. The scripting language to use for the script.\n" +"Note that a plugin may use several languages at once by adding more scripts " +"to the plugin." +msgstr "" +"필수. 스크립트에 사용할 스크립팅 언어입니다.\n" +"플러그인에 여러 스크립트를 추가하여 여러 언어를 사용할 수도 있습니다." + msgid "Script Name:" msgstr "스크립트 이름:" +msgid "" +"Optional. The path to the script (relative to the add-on folder). If left " +"empty, will default to \"plugin.gd\"." +msgstr "" +"선택. 스크립트의 (애드온 폴더로부터 상대적인) 경로입니다. 공란일 경우 기본값" +"인 \"plugin.gd\"를 사용합니다." + msgid "Activate now?" msgstr "지금 실행할까요?" +msgid "Plugin name is valid." +msgstr "플러그인 이름이 올바릅니다." + +msgid "Script extension is valid." +msgstr "스크립트 확장이 올바릅니다." + +msgid "Subfolder name is valid." +msgstr "서브폴더 이름이 올바릅니다." + msgid "Create Polygon" msgstr "폴리곤 만들기" @@ -5883,6 +6225,9 @@ msgstr "점과 삼각형 지우기." msgid "Generate blend triangles automatically (instead of manually)" msgstr "(수동 대신) 자동으로 혼합 삼각형 만들기" +msgid "Parameter Changed: %s" +msgstr "매개변수 변경됨: %s" + msgid "Inspect Filters" msgstr "필터 인스펙트" @@ -6032,6 +6377,9 @@ msgstr "애니메이션 유일하게 만들기: %s" msgid "Invalid AnimationLibrary file." msgstr "잘못된 AnimationLibrary 파일입니다." +msgid "This library is already added to the mixer." +msgstr "이 라이브러리는 이미 믹서에 추가되었습니다." + msgid "Invalid Animation file." msgstr "잘못된 애니메이션 파일입니다." @@ -6161,6 +6509,9 @@ msgstr "[전역] (생성)" msgid "Duplicated Animation Name:" msgstr "복제된 애니메이션 이름:" +msgid "Onion skinning requires a RESET animation." +msgstr "어니언 스키닝을 사용하려면 RESET 애니메이션이 필요합니다." + msgid "Play selected animation backwards from current pos. (A)" msgstr "선택한 애니메이션을 현재 위치에서 거꾸로 재생합니다. (A)" @@ -6257,6 +6608,12 @@ msgstr "노드 이동" msgid "Transition exists!" msgstr "전환이 있습니다!" +msgid "Play/Travel to %s" +msgstr "재생/이동 %s" + +msgid "Edit %s" +msgstr "편집 %s" + msgid "Add Node and Transition" msgstr "노드와 전환 추가" @@ -6541,6 +6898,11 @@ msgstr "회전 단계:" msgid "Scale Step:" msgstr "스케일 단계:" +msgid "" +"Children of a container get their position and size determined only by their " +"parent." +msgstr "컨테이너 노드의 자식은 부모에 의해서만 위치와 크기가 결정됩니다." + msgid "Move Node(s) to Position" msgstr "노드를 위치로 이동" @@ -6601,6 +6963,12 @@ msgstr "잠김" msgid "Grouped" msgstr "그룹됨" +msgid "Add Node Here..." +msgstr "여기에 노드 추가..." + +msgid "Instantiate Scene Here..." +msgstr "여기에 씬 인스턴스화..." + msgid "Paste Node(s) Here" msgstr "여기에 노드 붙여넣기" @@ -6876,6 +7244,18 @@ msgstr "프레임 선택" msgid "Preview Canvas Scale" msgstr "캔버스 스케일 미리보기" +msgid "Project theme" +msgstr "프로젝트 테마" + +msgid "Editor theme" +msgstr "에디터 테마" + +msgid "Default theme" +msgstr "기본 테마" + +msgid "Preview Theme" +msgstr "미리보기 테마" + msgid "Translation mask for inserting keys." msgstr "키를 삽입하기 위한 전환 마스크." @@ -6926,6 +7306,9 @@ msgstr "%s 추가하는 중..." msgid "Drag and drop to add as child of current scene's root node." msgstr "드래그 & 드롭하면 현재 씬의 루트 노드의 자식으로서 노드를 추가합니다." +msgid "Hold %s when dropping to add as child of selected node." +msgstr "%s을 누른 채 드롭하면 현재 선택된 노드의 자식으로서 노드를 추가합니다." + msgid "Hold Shift when dropping to add as sibling of selected node." msgstr "Shift를 누른 채 드롭하면 선택된 노드의 형제로서 노드를 추가합니다." @@ -7096,9 +7479,15 @@ msgstr "가로 방향 정렬" msgid "Vertical alignment" msgstr "세로 방향 정렬" +msgid "Convert to GPUParticles3D" +msgstr "GPUParticles3D로 변환" + msgid "Load Emission Mask" msgstr "방출 마스크 불러오기" +msgid "Convert to GPUParticles2D" +msgstr "GPUParticles2D로 변환" + msgid "CPUParticles2D" msgstr "CPUParticles2D" @@ -7117,6 +7506,12 @@ msgstr "테두리 픽셀" msgid "Directed Border Pixels" msgstr "방향성이 있는 테두리 픽셀" +msgid "Centered" +msgstr "중앙" + +msgid "Capture Colors from Pixel" +msgstr "픽셀에서 색상 캡처" + msgid "CPUParticles3D" msgstr "CPUParticles3D" @@ -7239,6 +7634,18 @@ msgstr "" "이 설정이 활성화되면, 프로젝트를 실행하는 동안 어보이던스 오브젝트의 모양, 직" "경과 속도가 보이게 됩니다." +msgid "Debug CanvasItem Redraws" +msgstr "CanvasItem 리드로우를 디버그" + +msgid "" +"When this option is enabled, redraw requests of 2D objects will become " +"visible (as a short flash) in the running project.\n" +"This is useful to troubleshoot low processor mode." +msgstr "" +"이 설정이 활성화되면, 프로젝트 내에서 2D 오브젝트의 다시 그리기 요청이 (짧은 " +"섬광으로) 시각화됩니다.\n" +"이 설정은 로우 프로세서 모드에서의 문제 해결에 도움을 줄 수도 있습니다." + msgid "Synchronize Scene Changes" msgstr "씬 변경사항 동기화" @@ -7381,6 +7788,9 @@ msgstr "끝 위치 바꾸기" msgid "Change Probe Size" msgstr "프로브 크기 바꾸기" +msgid "Change Probe Origin Offset" +msgstr "프로브 원점 오프셋 바꾸기" + msgid "Change Notifier AABB" msgstr "알림이 AABB 바꾸기" @@ -7490,6 +7900,24 @@ msgstr "" msgid "Select path for SDF Texture" msgstr "SDF 텍스처의 경로를 선택하세요" +msgid "Add Gradient Point" +msgstr "그라디언트 포인트 추가" + +msgid "Remove Gradient Point" +msgstr "그라디언트 포인트 제거" + +msgid "Move Gradient Point" +msgstr "그라디언트 포인트 이동" + +msgid "Recolor Gradient Point" +msgstr "그라디언트 포인트 색 바꾸기" + +msgid "Reverse Gradient" +msgstr "그라디언트 뒤집기" + +msgid "Reverse/Mirror Gradient" +msgstr "그라디언트 돌리기/뒤집기" + msgid "Move GradientTexture2D Fill Point" msgstr "GradientTexture2D 채우기 포인트 교체" @@ -7528,6 +7956,9 @@ msgstr "에디터 씬의 루트를 찾을 수 없습니다." msgid "Lightmap data is not local to the scene." msgstr "라이트맵 데이터가 씬에 로컬이 아닙니다." +msgid "Maximum texture size is too small for the lightmap images." +msgstr "최대 텍스처 사이즈가 라이트맵 이미지에 사용하기에는 너무 작습니다." + msgid "Bake Lightmaps" msgstr "라이트맵 굽기" @@ -7579,6 +8010,9 @@ msgstr "내비게이션 메시 만들기" msgid "Create Debug Tangents" msgstr "디버그 접선 생성" +msgid "No mesh to unwrap." +msgstr "언랩할 메시가 없습니다." + msgid "" "Mesh cannot unwrap UVs because it does not belong to the edited scene. Make " "it unique first." @@ -7606,6 +8040,15 @@ msgstr "UV2 펼치기" msgid "Contained Mesh is not of type ArrayMesh." msgstr "포함된 메시가 ArrayMesh 타입이 아닙니다." +msgid "Can't unwrap mesh with blend shapes." +msgstr "메시를 블렌드 셰이프로 언랩할 수 없습니다." + +msgid "Only triangles are supported for lightmap unwrap." +msgstr "라이트맵 언랩에는 삼각형만 사용할 수 있습니다." + +msgid "Normals are required for lightmap unwrap." +msgstr "라이트맵을 언랩하기 위해서는 노멀이 필요합니다." + msgid "UV Unwrap failed, mesh may not be manifold?" msgstr "UV 펼치기를 실패했습니다. 메시가 다양한 것 같은데요?" @@ -7848,6 +8291,27 @@ msgstr "폴리곤 편집 (점 제거)" msgid "Create Navigation Polygon" msgstr "내비게이션 폴리곤 만들기" +msgid "Bake NavigationPolygon" +msgstr "NavigationPolygon 굽기" + +msgid "" +"Bakes the NavigationPolygon by first parsing the scene for source geometry " +"and then creating the navigation polygon vertices and polygons." +msgstr "" +"씬의 지형을 분석한 뒤, 내비게이션 폴리곤 버텍스 및 폴리곤을 만들어서 " +"NavigationPolygon을 굽습니다." + +msgid "Clear NavigationPolygon" +msgstr "NavigationPolygon 모두 제거" + +msgid "Clears the internal NavigationPolygon outlines, vertices and polygons." +msgstr "내부 NavigationPolygon의 아웃라인, 버텍스, 폴리곤을 모두 비웁니다." + +msgid "" +"A NavigationPolygon resource must be set or created for this node to work." +msgstr "" +"이 노드가 작동하려면 NavigationPolygon 리소스를 설정하거나 만들어야 합니다." + msgid "Unnamed Gizmo" msgstr "이름 없는 기즈모" @@ -7990,11 +8454,20 @@ msgid "Translate" msgstr "옮기기" msgid "Translating:" -msgstr "번역 중:" +msgstr "이동 중:" msgid "Rotating %s degrees." msgstr "%s도로 회전." +msgid "Translating %s." +msgstr "%s 이동 중." + +msgid "Rotating %f degrees." +msgstr "%f 도 회전 중." + +msgid "Scaling %s." +msgstr "%s 스케일 중." + msgid "Auto Orthogonal Enabled" msgstr "자동 직교 활성화" @@ -8079,6 +8552,9 @@ msgstr "오클루전 컬링 버퍼" msgid "Motion Vectors" msgstr "모션 벡터" +msgid "Internal Buffer" +msgstr "내부 버퍼" + msgid "Display Advanced..." msgstr "자세히 표시..." @@ -8176,6 +8652,13 @@ msgstr "더욱 확대하려면, 카메라의 클리핑 평면을 바꾸세요 ( msgid "Overriding material..." msgstr "머티리얼 오버라이드..." +msgid "" +"Drag and drop to override the material of any geometry node.\n" +"Hold %s when dropping to override a specific surface." +msgstr "" +"드래그 & 드롭으로 아무 지오메트리 노드의 머티리얼을 오버라이드합니다.\n" +"%s을 누르며 드롭하여 특정한 면을 오버라이드합니다." + msgid "XForm Dialog" msgstr "XForm 대화 상자" @@ -8547,6 +9030,15 @@ msgstr "핸들 길이 거울" msgid "Curve Point #" msgstr "곡선 점 #" +msgid "Handle In #" +msgstr "핸들 인 #" + +msgid "Handle Out #" +msgstr "핸들 아웃 #" + +msgid "Handle Tilt #" +msgstr "핸들 틸트 #" + msgid "Set Curve Point Position" msgstr "곡선 점 위치 설정" @@ -8556,12 +9048,24 @@ msgstr "곡선의 아웃 위치 설정" msgid "Set Curve In Position" msgstr "곡선의 인 위치 설정" +msgid "Set Curve Point Tilt" +msgstr "곡선 점 틸트 설정" + msgid "Split Path" msgstr "경로 가르기" msgid "Remove Path Point" msgstr "경로 점 제거" +msgid "Reset Out-Control Point" +msgstr "아웃-컨트롤 점 초기화" + +msgid "Reset In-Control Point" +msgstr "인-컨트롤 점 초기화" + +msgid "Reset Point Tilt" +msgstr "점 틸트 초기화" + msgid "Split Segment (in curve)" msgstr "(곡선에서) 세그먼트 가르기" @@ -8639,9 +9143,15 @@ msgstr "본" msgid "Move Points" msgstr "점 이동" +msgid ": Rotate" +msgstr ": 회전" + msgid "Shift: Move All" msgstr "Shift: 모두 이동" +msgid "Shift: Scale" +msgstr "Shift: 스케일 조절" + msgid "Move Polygon" msgstr "폴리곤 이동" @@ -8732,6 +9242,15 @@ msgstr "리소스 붙여넣기" msgid "Load Resource" msgstr "리소스 불러오기" +msgid "Path to AnimationMixer is invalid" +msgstr "AnimationMixer를 향하는 경로가 잘못되었습니다" + +msgid "" +"AnimationMixer has no valid root node path, so unable to retrieve track names." +msgstr "" +"AnimationMixer의 루트 노드 경로가 유효하지 않으므로 트랙 이름을 받아올 수 없습" +"니다." + msgid "Clear Recent Files" msgstr "최근 파일 지우기" @@ -8895,6 +9414,9 @@ msgstr "" msgid "Search Results" msgstr "검색 결과" +msgid "Save changes to the following script(s) before quitting?" +msgstr "종료하기 전에 해당 스크립트의 변경사항을 저장하시겠습니까?" + msgid "Clear Recent Scripts" msgstr "최근 스크립트 지우기" @@ -8985,6 +9507,9 @@ msgstr "행 접기/펼치기" msgid "Fold All Lines" msgstr "모든 행 접기" +msgid "Create Code Region" +msgstr "코드 영역 생성" + msgid "Unfold All Lines" msgstr "모든 행 펼치기" @@ -9045,6 +9570,9 @@ msgstr "다음 중단점으로 이동" msgid "Go to Previous Breakpoint" msgstr "이전 중단점으로 이동" +msgid "Save changes to the following shaders(s) before quitting?" +msgstr "종료하기 전에 해당 셰이더의 변경사항을 저장하시겠습니까?" + msgid "Shader Editor" msgstr "셰이더 에디터" @@ -12799,9 +13327,24 @@ msgstr "%s의 <이름 없음>" msgid "(used %d times)" msgstr "(%d회 사용됨)" +msgid "Add Child Node..." +msgstr "자식 노드 추가..." + +msgid "Instantiate Child Scene..." +msgstr "자식 씬 인스턴스화..." + msgid "Expand/Collapse Branch" msgstr "하위 항목 펼치기/접기" +msgid "Change Type..." +msgstr "타입 바꾸기..." + +msgid "Attach Script..." +msgstr "스크립트 붙이기..." + +msgid "Extend Script..." +msgstr "스크립트 상속..." + msgid "Reparent to New Node" msgstr "새 노드에 부모 노드 다시 지정" @@ -12823,6 +13366,9 @@ msgid "" msgstr "" "씬 파일을 노드로 인스턴스화합니다. 루트 노드가 없으면 상속된 씬을 만듭니다." +msgid "Filter: name, t:type, g:group" +msgstr "필터: 이름, t:타입, g:그룹" + msgid "Attach a new or existing script to the selected node." msgstr "선택한 노드에 새 스크립트나 기존 스크립트를 붙입니다." @@ -13043,6 +13589,9 @@ msgid "Invalid type argument to convert(), use TYPE_* constants." msgstr "" "convert() 메서드의 인수 타입이 올바르지 않습니다. TYPE_* 상수를 사용하세요." +msgid "Cannot resize array." +msgstr "배열 크기를 변경할 수 없습니다." + msgid "Step argument is zero!" msgstr "스텝 인수가 0입니다!" @@ -13774,23 +14323,9 @@ msgstr "확장 패키지 파일을 쓸 수 없었습니다!" msgid "Building Android Project (gradle)" msgstr "Android 프로젝트 빌드 중 (gradle)" -msgid "" -"Building of Android project failed, check output for the error. Alternatively " -"visit docs.godotengine.org for Android build documentation." -msgstr "" -"Android 프로젝트의 빌드에 실패했습니다, 출력된 오류를 확인하세요. 또는 docs." -"godotengine.org에서 Android 빌드 문서를 찾아보세요." - msgid "Moving output" msgstr "출력 이동 중" -msgid "" -"Unable to copy and rename export file, check gradle project directory for " -"outputs." -msgstr "" -"내보내기 파일을 복사하고 이름을 바꿀 수 없습니다, 출력에 대한 gradle 프로젝트 " -"디렉토리를 확인하세요." - msgid "Package not found: \"%s\"." msgstr "패키지를 찾을 수 없음: \"%s\"." @@ -14987,15 +15522,6 @@ msgstr "" "지됩니다. 따라서 데이터를 잃을 우려 없이 저장할 수 있습니다." msgid "" -"Setting node name '%s' to be unique within scene for '%s', but it's already " -"claimed by '%s'.\n" -"'%s' is no longer set as having a unique name." -msgstr "" -"노드 이름 '%s'을(를) 씬에서 '%s'에 대해 고유하게 만들었지만, 그것은 이미 " -"'%s'가 소유하고 있습니다.\n" -"'%s'는 더 이상 고유 이름을 가지지 않게 됩니다." - -msgid "" "This node is marked as deprecated and will be removed in future versions.\n" "Please check the Godot documentation for information about migration." msgstr "" @@ -15008,13 +15534,6 @@ msgid "" msgstr "이 노드는 실험적이며 이후 버전에서 삭제되거나 변경될 수도 있습니다." msgid "" -"Default Environment as specified in the project setting \"rendering/" -"environment/defaults/default_environment\" could not be loaded." -msgstr "" -"프로젝트 설정 \"rendering/environment/defaults/default_environment\"에 지정한 " -"디폴트 환경을 불러올 수 없습니다." - -msgid "" "ShaderGlobalsOverride is not active because another node of the same type is " "in the scene." msgstr "" @@ -15038,27 +15557,6 @@ msgid "" msgstr "" "무엇이든 렌더링하려면 뷰포트 크기가 양쪽 차원에서 2픽셀 이상이어야 합니다." -msgid "Cannot open font from file: %s." -msgstr "파일으로부터 글꼴을 열 수 없습니다: %s." - -msgid "Version %d of BMFont is not supported (should be 3)." -msgstr "BMFont 버전 %d는 지원되지 않습니다 (3이어야 합니다)." - -msgid "Invalid BMFont info block size." -msgstr "BMFont info block의 크기가 올바르지 않습니다." - -msgid "Invalid BMFont common block size." -msgstr "BMFont common block의 크기가 올바르지 않습니다." - -msgid "Can't load font texture: %s." -msgstr "글꼴 텍스쳐를 불러오지 못했습니다: %s." - -msgid "Unsupported BMFont texture format." -msgstr "지원되지 않는 BMFont 텍스처 형식입니다." - -msgid "Invalid BMFont block type." -msgstr "잘못된 BMFont block 타입입니다." - msgid "" "An incoming node's name clashes with %s already in the scene (presumably, " "from a more nested instance).\n" diff --git a/editor/translations/editor/lv.po b/editor/translations/editor/lv.po index 48c367325f..70b5bc9c40 100644 --- a/editor/translations/editor/lv.po +++ b/editor/translations/editor/lv.po @@ -12,13 +12,14 @@ # D āvis <dlektauers@gmail.com>, 2022. # Agnis Aldiņš <agnis16@gmail.com>, 2023. # Andrejs <ledaviskylv@gmail.com>, 2023. +# Peter Lauris <peterlauris@gmail.com>, 2023. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor interface\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-09-23 21:22+0000\n" -"Last-Translator: Andrejs <ledaviskylv@gmail.com>\n" +"PO-Revision-Date: 2023-11-16 07:52+0000\n" +"Last-Translator: Peter Lauris <peterlauris@gmail.com>\n" "Language-Team: Latvian <https://hosted.weblate.org/projects/godot-engine/" "godot/lv/>\n" "Language: lv\n" @@ -27,7 +28,10 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n % 10 == 0 || n % 100 >= 11 && n % 100 <= " "19) ? 0 : ((n % 10 == 1 && n % 100 != 11) ? 1 : 2);\n" -"X-Generator: Weblate 5.1-dev\n" +"X-Generator: Weblate 5.2\n" + +msgid "Main Thread" +msgstr "Galvenais Pavediens" msgid "Unset" msgstr "Neiestatīts" @@ -1223,21 +1227,6 @@ msgstr "Zelta Sponsori" msgid "Silver Sponsors" msgstr "Sudraba Sponsors" -msgid "Bronze Sponsors" -msgstr "Bronzas Sponsors" - -msgid "Mini Sponsors" -msgstr "Mini Sponsori" - -msgid "Gold Donors" -msgstr "Zelta Donors" - -msgid "Silver Donors" -msgstr "Sudraba Donors" - -msgid "Bronze Donors" -msgstr "Bronzas Donors" - msgid "Donors" msgstr "Ziedotāji" @@ -2049,15 +2038,6 @@ msgstr "" "Spraudnis '%s' atspējots, lai novērstu tupmākās kļūdas." msgid "" -"Unable to load addon script from path: '%s' Base type is not EditorPlugin." -msgstr "" -"Nevar ielādēt papildinājuma skriptu no ceļa: '%s' Bāzes tips nav EditorPlugin." - -msgid "Unable to load addon script from path: '%s' Script is not in tool mode." -msgstr "" -"Nevarēja ielādēt spraudņa skriptu no mapes: '%s' Skripts nav rīka režīmā." - -msgid "" "Scene '%s' was automatically imported, so it can't be modified.\n" "To make changes to it, a new inherited scene can be created." msgstr "" @@ -2393,6 +2373,9 @@ msgstr "Jauna atslēga:" msgid "New Value:" msgstr "Jauna vērtība:" +msgid "Save As..." +msgstr "Saglabāt kā..." + msgid "Show in FileSystem" msgstr "Parādīt failu sistēmā" @@ -2799,9 +2782,6 @@ msgstr "Kopēt iestatījumus" msgid "Paste Properties" msgstr "Ielīmēt iestatījumus" -msgid "Save As..." -msgstr "Saglabāt kā..." - msgid "Open documentation for this object." msgstr "Atvērt dokumentāciju šim objektam." diff --git a/editor/translations/editor/ms.po b/editor/translations/editor/ms.po index c2928c4067..0019a5e3f6 100644 --- a/editor/translations/editor/ms.po +++ b/editor/translations/editor/ms.po @@ -1159,21 +1159,6 @@ msgstr "Penaja Emas" msgid "Silver Sponsors" msgstr "Penderma Perak" -msgid "Bronze Sponsors" -msgstr "Penderma Gangsa" - -msgid "Mini Sponsors" -msgstr "Penaja Mini" - -msgid "Gold Donors" -msgstr "Penderma Emas" - -msgid "Silver Donors" -msgstr "Penderma Perak" - -msgid "Bronze Donors" -msgstr "Penderma Gangsa" - msgid "Donors" msgstr "Penderma" @@ -1985,17 +1970,6 @@ msgstr "" "Menyahdayakan addon pada '%s' untuk mengelakkan ralat selanjutnya." msgid "" -"Unable to load addon script from path: '%s' Base type is not EditorPlugin." -msgstr "" -"Tidak dapat memuatkan skrip addon dari laluan: '%s' Jenis Asas bukan " -"EditorPlugin." - -msgid "Unable to load addon script from path: '%s' Script is not in tool mode." -msgstr "" -"Tidak dapat memuat skrip addon dari laluan: Skrip '%s' tidak berada dalam mod " -"alat." - -msgid "" "Scene '%s' was automatically imported, so it can't be modified.\n" "To make changes to it, a new inherited scene can be created." msgstr "" @@ -2407,6 +2381,9 @@ msgstr "Muatan Cepat" msgid "Make Unique" msgstr "Buat Unik" +msgid "Save As..." +msgstr "Simpan Sebagai..." + msgid "Show in FileSystem" msgstr "Tunjukkan dalam FileSystem" @@ -3070,9 +3047,6 @@ msgstr "Muatkan sumber sedia ada dari cakera dan suntingnya." msgid "Save the currently edited resource." msgstr "Simpan sumber yang sedang disunting." -msgid "Save As..." -msgstr "Simpan Sebagai..." - msgid "Extra resource options." msgstr "Pilihan sumber tambahan." diff --git a/editor/translations/editor/nb.po b/editor/translations/editor/nb.po index f025de8eb4..1f2c42820d 100644 --- a/editor/translations/editor/nb.po +++ b/editor/translations/editor/nb.po @@ -1138,18 +1138,6 @@ msgstr "Platinasponsorer" msgid "Gold Sponsors" msgstr "Gullsponsorer" -msgid "Mini Sponsors" -msgstr "Minisponsorer" - -msgid "Gold Donors" -msgstr "Gulldonorer" - -msgid "Silver Donors" -msgstr "Sølvdonorer" - -msgid "Bronze Donors" -msgstr "Bronsedonorer" - msgid "Donors" msgstr "Donorer" @@ -1640,16 +1628,6 @@ msgid "Unable to load addon script from path: '%s'." msgstr "Kan ikke laste addon-skript fra bane: '%s'." msgid "" -"Unable to load addon script from path: '%s' Base type is not EditorPlugin." -msgstr "" -"Kan ikke laste addon-skript fra stien: Basistypen '%s' er ikke en " -"EditorPlugin." - -msgid "Unable to load addon script from path: '%s' Script is not in tool mode." -msgstr "" -"Kunne ikke laste tillegsskript fra sti: '%s' Script er ikke i verktøymodus." - -msgid "" "Scene '%s' was automatically imported, so it can't be modified.\n" "To make changes to it, a new inherited scene can be created." msgstr "" @@ -1919,6 +1897,9 @@ msgstr "Legg Til Nøkkel/Verdi Par" msgid "Make Unique" msgstr "Gjør Unik" +msgid "Save As..." +msgstr "Lagre Som..." + msgid "New %s" msgstr "Ny %s" @@ -2360,9 +2341,6 @@ msgstr "Last inn en eksisterende ressurs fra disk og rediger den." msgid "Save the currently edited resource." msgstr "Lagre den nylige redigerte ressursen." -msgid "Save As..." -msgstr "Lagre Som..." - msgid "Copy Resource" msgstr "Kopier Ressurs" diff --git a/editor/translations/editor/nl.po b/editor/translations/editor/nl.po index 61100e5f25..e99e6524cc 100644 --- a/editor/translations/editor/nl.po +++ b/editor/translations/editor/nl.po @@ -69,13 +69,15 @@ # Raymon Zutekouw <me@raymon.dev>, 2023. # Nicolai Van der Storm <nicolai@nvds.be>, 2023. # Gaetan Deglorie <gaetan@rhinox.training>, 2023. +# Bert Heymans <bert.heymans@gmail.com>, 2023. +# Gert-dev <Gert-dev@users.noreply.hosted.weblate.org>, 2023. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor interface\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-11-08 00:04+0000\n" -"Last-Translator: Raymon <me@raymon.dev>\n" +"PO-Revision-Date: 2023-11-27 01:40+0000\n" +"Last-Translator: Gert-dev <Gert-dev@users.noreply.hosted.weblate.org>\n" "Language-Team: Dutch <https://hosted.weblate.org/projects/godot-engine/godot/" "nl/>\n" "Language: nl\n" @@ -83,7 +85,10 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.2-dev\n" +"X-Generator: Weblate 5.2.1-rc\n" + +msgid "Main Thread" +msgstr "Hoofdthread" msgid "Unset" msgstr "Niet ingesteld" @@ -92,121 +97,121 @@ msgid "Physical" msgstr "Fysiek" msgid "Left Mouse Button" -msgstr "Linker Muis Knop" +msgstr "Linkermuisknop" msgid "Right Mouse Button" -msgstr "Rechter Muis Knop" +msgstr "Rechtermuisknop" msgid "Middle Mouse Button" -msgstr "Middelste Muis Knop" +msgstr "Middelmuisknop" msgid "Mouse Wheel Up" -msgstr "Scrollwiel Omhoog" +msgstr "Scrollwiel omhoog" msgid "Mouse Wheel Down" -msgstr "Scrollwiel Omlaag" +msgstr "Scrollwiel omlaag" msgid "Mouse Wheel Left" -msgstr "Muiswielknop Links" +msgstr "Muiswielknop links" msgid "Mouse Wheel Right" -msgstr "Muiswielknop Rechts" +msgstr "Muiswielknop rechts" msgid "Mouse Thumb Button 1" -msgstr "Muis Duim Knop 1" +msgstr "Duimknop muis 1" msgid "Mouse Thumb Button 2" -msgstr "Muisduimknop 2" +msgstr "Duimknop muis 2" msgid "Button" msgstr "Knop" msgid "Double Click" -msgstr "Dubbel Klik" +msgstr "Dubbelklik" msgid "Mouse motion at position (%s) with velocity (%s)" -msgstr "Muis beweging op positie (%s) met snelheid (%s)" +msgstr "Muisbeweging op positie (%s) met snelheid (%s)" msgid "Left Stick X-Axis, Joystick 0 X-Axis" -msgstr "Linker Pook X-As, Joystick 0 X-As" +msgstr "Linkerpook x-as, Joystick 0 x-as" msgid "Left Stick Y-Axis, Joystick 0 Y-Axis" -msgstr "Linker Pook Y-As, Joystick 0 Y-As" +msgstr "Linkerpook y-as, Joystick 0 y-as" msgid "Right Stick X-Axis, Joystick 1 X-Axis" -msgstr "Rechter Pook X-As, Joystick 1 X-As" +msgstr "Rechterpook x-as, Joystick 1 x-as" msgid "Right Stick Y-Axis, Joystick 1 Y-Axis" -msgstr "Rechter Pook Y-As, Joystick 1 Y-As" +msgstr "Rechterpook y-as, Joystick 1 y-as" msgid "Joystick 2 X-Axis, Left Trigger, Sony L2, Xbox LT" -msgstr "Joystick 2 X-As, Linker Trekker, Sony L2, Xbox LT" +msgstr "Joystick 2 x-as, Linkse trekker, Sony L2, Xbox LT" msgid "Joystick 2 Y-Axis, Right Trigger, Sony R2, Xbox RT" -msgstr "Joystick 2 Y-As, Rechter Trekker, Sony R2, Xbox RT" +msgstr "Joystick 2 y-as, Rechtse trekker, Sony R2, Xbox RT" msgid "Joystick 3 X-Axis" -msgstr "Joystick 3 X-As" +msgstr "Joystick 3 x-as" msgid "Joystick 3 Y-Axis" -msgstr "Joystick 3 Y-As" +msgstr "Joystick 3 y-as" msgid "Joystick 4 X-Axis" -msgstr "Joystick 4 X-As" +msgstr "Joystick 4 x-as" msgid "Joystick 4 Y-Axis" -msgstr "Joystick 4 Y-As" +msgstr "Joystick 4 y-as" msgid "Unknown Joypad Axis" -msgstr "Onbekende Joypad As" +msgstr "Onbekende Joypad-as" msgid "Joypad Motion on Axis %d (%s) with Value %.2f" -msgstr "Joypad Beweging op As %d (%s) met Waarde %.2f" +msgstr "Joypad-beweging op as %d (%s) met waarde %.2f" msgid "Bottom Action, Sony Cross, Xbox A, Nintendo B" -msgstr "Onderste Actie, Sony Kruisje, Xbox A, Nintendo B" +msgstr "Onderste actie, Sony kruisje, Xbox A, Nintendo B" msgid "Right Action, Sony Circle, Xbox B, Nintendo A" -msgstr "Rechter Actie, Sony Cirkel, Xbox B, Nintendo A" +msgstr "Rechtse Actie, Sony cirkel, Xbox B, Nintendo A" msgid "Left Action, Sony Square, Xbox X, Nintendo Y" -msgstr "Linker Actie, Sony Vierkantje, Xbox X, Nintendo Y" +msgstr "Linkse actie, Sony vierkantje, Xbox X, Nintendo Y" msgid "Top Action, Sony Triangle, Xbox Y, Nintendo X" -msgstr "Bovenste Actie, Sony Driehoekje, Xbox Y, Nintendo X" +msgstr "Bovenste actie, Sony driehoekje, Xbox Y, Nintendo X" msgid "Back, Sony Select, Xbox Back, Nintendo -" -msgstr "Terug, Sony Selecteer, Xbox Terug, Nintendo -" +msgstr "Terug, Sony selecteer, Xbox terug, Nintendo -" msgid "Guide, Sony PS, Xbox Home" -msgstr "Gids, Sony PS, Xbox Thuis" +msgstr "Gids, Sony PS, Xbox Home" msgid "Start, Xbox Menu, Nintendo +" -msgstr "Start, Xbox Menu, Nintendo +" +msgstr "Start, Xbox menu, Nintendo +" msgid "Left Stick, Sony L3, Xbox L/LS" -msgstr "Linker Joystick, Sony L3, Xbox L/LS" +msgstr "Linkse pook, Sony L3, Xbox L/LS" msgid "Right Stick, Sony R3, Xbox R/RS" -msgstr "Rechter Joystick, Sony R3, Xbox R/RS" +msgstr "Rechtse pook, Sony R3, Xbox R/RS" msgid "Left Shoulder, Sony L1, Xbox LB" -msgstr "Linker Schouder, Sony L1, Xbox LB" +msgstr "Linkse schouder, Sony L1, Xbox LB" msgid "Right Shoulder, Sony R1, Xbox RB" -msgstr "Rechter Schouder, Sony R1, Xbox RB" +msgstr "Rechtse schouder, Sony R1, Xbox RB" msgid "D-pad Up" -msgstr "D-pad Boven" +msgstr "D-pad omhoog" msgid "D-pad Down" -msgstr "D-pad Onder" +msgstr "D-pad omlaag" msgid "D-pad Left" -msgstr "D-pad Links" +msgstr "D-pad links" msgid "D-pad Right" -msgstr "D-pad Rechts" +msgstr "D-pad rechts" msgid "Xbox Share, PS5 Microphone, Nintendo Capture" msgstr "Xbox Delen, PS5 Microfoon, Nintendo Opname" @@ -224,10 +229,10 @@ msgid "Xbox Paddle 4" msgstr "Xbox Paddle 4" msgid "PS4/5 Touchpad" -msgstr "PS4/5 Touchpad" +msgstr "PS4-/5-touchpad" msgid "Joypad Button %d" -msgstr "Controllerknop %d" +msgstr "Joypad-knop %d" msgid "Pressure:" msgstr "Druk:" @@ -254,28 +259,28 @@ msgid "Magnify Gesture at (%s) with factor %s" msgstr "Vergrotingsgebaar op (%s) met factor %s" msgid "Pan Gesture at (%s) with delta (%s)" -msgstr "Pan-gebaar op (%s) met delta (%s)" +msgstr "Verplaatsingsgebaar op (%s) met delta (%s)" msgid "MIDI Input on Channel=%s Message=%s" -msgstr "MIDI Input op kanaal=%s Bericht=%s" +msgstr "MIDI-invoer op kanaal=%s Bericht=%s" msgid "Input Event with Shortcut=%s" -msgstr "Input Gebeurtenis met sneltoets=%s" +msgstr "Invoergebeurtenis met sneltoets=%s" msgid "Accept" -msgstr "Accepteren" +msgstr "Aanvaarden" msgid "Select" -msgstr "Selecteer" +msgstr "Selecteren" msgid "Cancel" -msgstr "Annuleer" +msgstr "Annuleren" msgid "Focus Next" -msgstr "Focus Volgende" +msgstr "Volgende focussen" msgid "Focus Prev" -msgstr "Focus Vorige" +msgstr "Vorige focussen" msgid "Left" msgstr "Links" @@ -290,10 +295,10 @@ msgid "Down" msgstr "Omlaag" msgid "Page Up" -msgstr "Pagina Omhoog" +msgstr "Pagina omhoog" msgid "Page Down" -msgstr "Pagina Omlaag" +msgstr "Pagina omlaag" msgid "Home" msgstr "Home" @@ -314,7 +319,10 @@ msgid "Undo" msgstr "Ongedaan maken" msgid "Redo" -msgstr "Opnieuw" +msgstr "Opnieuw uitvoeren" + +msgid "Completion Query" +msgstr "Aanvullings-query" msgid "New Line" msgstr "Nieuwe regel" @@ -322,61 +330,138 @@ msgstr "Nieuwe regel" msgid "New Blank Line" msgstr "Nieuwe lege regel" +msgid "New Line Above" +msgstr "Nieuwe regel boven invoegen" + msgid "Indent" msgstr "Inspringen" +msgid "Dedent" +msgstr "Inspringing weghalen" + +msgid "Backspace" +msgstr "Voorgaand karakter verwijderen" + +msgid "Backspace Word" +msgstr "Voorgaand woord verwijderen" + +msgid "Backspace all to Left" +msgstr "Alles links verwijderen" + msgid "Delete" -msgstr "Verwijder" +msgstr "Verwijderen" msgid "Delete Word" -msgstr "Woord Verwijderen" +msgstr "Woord verwijderen" + +msgid "Delete all to Right" +msgstr "Alles rechts verwijderen" + +msgid "Caret Left" +msgstr "Cursor naar links verplaatsen" + +msgid "Caret Word Left" +msgstr "Cursor woord naar links verplaatsen" + +msgid "Caret Right" +msgstr "Cursor naar rechts verplaatsen" + +msgid "Caret Word Right" +msgstr "Cursor woord naar rechts verplaatsen" + +msgid "Caret Up" +msgstr "Cursor omhoog verplaatsen" + +msgid "Caret Down" +msgstr "Cursor omlaag verplaatsen" + +msgid "Caret Line Start" +msgstr "Cursor naar begin lijn verplaatsen" + +msgid "Caret Line End" +msgstr "Cursor naar einde lijn verplaatsen" msgid "Caret Page Up" -msgstr "Caret Pagina Omhoog" +msgstr "Cursor pagina omhoog verplaatsen" msgid "Caret Page Down" -msgstr "Caret Pagina Omlaag" +msgstr "Caret pagina omlaag verplaatsen" + +msgid "Caret Document Start" +msgstr "Cursor naar documenthoofd verplaatsen" + +msgid "Caret Document End" +msgstr "Cursor naar documenteinde verplaatsen" + +msgid "Caret Add Below" +msgstr "Cursor boven toevoegen" + +msgid "Caret Add Above" +msgstr "Cursor onder toevoegen" msgid "Scroll Up" -msgstr "Scroll Omhoog" +msgstr "Omhoog scrollen" msgid "Scroll Down" -msgstr "Scroll Omlaag" +msgstr "Omlaag scrollen" msgid "Select All" msgstr "Alles selecteren" +msgid "Select Word Under Caret" +msgstr "Woord onder cursor selecteren" + +msgid "Add Selection for Next Occurrence" +msgstr "Volgende herkomst mee selecteren" + +msgid "Clear Carets and Selection" +msgstr "Cursors en selectie wissen" + +msgid "Toggle Insert Mode" +msgstr "Invoermodus wisselen" + +msgid "Submit Text" +msgstr "Tekst versturen" + msgid "Duplicate Nodes" msgstr "Knopen dupliceren" msgid "Delete Nodes" -msgstr "VisualShader-knoop/knopen verwijderen" +msgstr "Knopen verwijderen" msgid "Go Up One Level" -msgstr "Ga Een Niveau Omhoog" +msgstr "Één niveau omhoog gaan" msgid "Refresh" -msgstr "Verversen" +msgstr "Herladen" + +msgid "Show Hidden" +msgstr "Verborgen tonen" + +msgid "Swap Input Direction" +msgstr "Invoerrichting wisselen" + +msgid "Invalid input %d (not passed) in expression" +msgstr "Ongeldige invoer %d (niet doorgegeven) in uitdrukking" msgid "self can't be used because instance is null (not passed)" msgstr "" -"'self' kan niet gebruikt worden omdat de instantie 'null' is (niet " -"doorgegeven)" +"'self' kan niet gebruikt worden omdat instantie 'null' is (niet doorgegeven)" msgid "Invalid operands to operator %s, %s and %s." -msgstr "Ongeldige operanden %s en %s voor operator %s." +msgstr "Ongeldige operanden voor operator %s: %s en %s." msgid "Invalid index of type %s for base type %s" -msgstr "Ongeldige index in type %s voor basis-type %s" +msgstr "Ongeldige index van type %s voor basis-type %s" msgid "Invalid named index '%s' for base type %s" -msgstr "Ongeldige indexnaam %s voor basis-type %s" +msgstr "Ongeldige benoemde index '%s' voor basis-type %s" msgid "Invalid arguments to construct '%s'" -msgstr "Ongeldig argument in constructie '%s'" +msgstr "Ongeldige argumenten in constructie '%s'" msgid "On call to '%s':" -msgstr "Tijdens invocatie van '%s':" +msgstr "Bij oproepen van '%s':" msgid "Built-in script" msgstr "Ingebouwd script" @@ -408,6 +493,11 @@ msgstr "EiB" msgid "Example: %s" msgstr "Voorbeeld: %s" +msgid "%d item" +msgid_plural "%d items" +msgstr[0] "%d item" +msgstr[1] "%d items" + msgid "" "Invalid action name. It cannot be empty nor contain '/', ':', '=', '\\' or " "'\"'" @@ -416,31 +506,43 @@ msgstr "" "'\"' bevatten" msgid "An action with the name '%s' already exists." -msgstr "Action '%s' bestaat al." +msgstr "Actie '%s' bestaat al." + +msgid "Cannot Revert - Action is same as initial" +msgstr "Kan niet ongedaan maken - actie is identiek aan de oorspronkelijke" + +msgid "Revert Action" +msgstr "Actie ongedaan maken" msgid "Add Event" -msgstr "Event Toevoegen" +msgstr "Gebeurtenis toevoegen" msgid "Remove Action" -msgstr "Verwijder Actie" +msgstr "Actie verwijderen" msgid "Cannot Remove Action" -msgstr "Kan Actie Niet Verwijderen" +msgstr "Kan actie niet verwijderen" + +msgid "Edit Event" +msgstr "Gebeurtenis bewerken" msgid "Remove Event" -msgstr "Remote Event" +msgstr "Gebeurtenis verwijderen" msgid "Filter by name..." -msgstr "Filter op naam..." +msgstr "Op naam filteren..." + +msgid "Clear All" +msgstr "Alles verwijderen" msgid "Add New Action" -msgstr "Nieuwe Actie Toevoegen" +msgstr "Nieuwe actie toevoegen" msgid "Add" msgstr "Toevoegen" msgid "Show Built-in Actions" -msgstr "Weergeef Ingebouwde Acties" +msgstr "Ingebouwde acties weergeven" msgid "Action" msgstr "Actie" @@ -454,8 +556,11 @@ msgstr "Tijd:" msgid "Value:" msgstr "Waarde:" +msgid "Update Selected Key Handles" +msgstr "Geselecteerde sleutel-handles bijwerken" + msgid "Insert Key Here" -msgstr "Hier Key invoegen" +msgstr "Sleutel hier toevoegen" msgid "Duplicate Selected Key(s)" msgstr "Geselecteerde sleutel(s) dupliceren" @@ -463,35 +568,122 @@ msgstr "Geselecteerde sleutel(s) dupliceren" msgid "Delete Selected Key(s)" msgstr "Geselecteerde sleutel(s) verwijderen" +msgid "Make Handles Free" +msgstr "Handgrepen vrij manipuleerbaar maken" + +msgid "Make Handles Linear" +msgstr "Handgrepen lineair maken" + +msgid "Make Handles Balanced" +msgstr "Handgrepen gebalanceerd maken" + +msgid "Make Handles Mirrored" +msgstr "Handgrepen gespiegeld maken" + +msgid "Make Handles Balanced (Auto Tangent)" +msgstr "Handgrepen gebalanceerd maken (automatische tangent)" + +msgid "Make Handles Mirrored (Auto Tangent)" +msgstr "Handgrepen gespiegeld maken (automatische tangent)" + msgid "Add Bezier Point" -msgstr "Bézierpunt toevoegen" +msgstr "Bézier-punt toevoegen" msgid "Move Bezier Points" -msgstr "Beweeg Bézierpunten" +msgstr "Bézier-punten verplaatsen" + +msgid "Animation Duplicate Keys" +msgstr "Animatiesleutels dupliceren" + +msgid "Animation Delete Keys" +msgstr "Animatiesleutels verwijderen" msgid "Focus" msgstr "Focus" +msgid "Select All Keys" +msgstr "Alle sleutels selecteren" + +msgid "Deselect All Keys" +msgstr "Alle sleutels deselecteren" + +msgid "Animation Change Transition" +msgstr "Animatietransitie wijzigen" + +msgid "Animation Change Position3D" +msgstr "3D-positie animatie wijzigen" + +msgid "Animation Change Rotation3D" +msgstr "3D-rotatie animatie wijzigen" + +msgid "Animation Change Scale3D" +msgstr "3D-schaal animatie wijzigen" + +msgid "Animation Change Keyframe Value" +msgstr "Keyframe-waarde animatie wijzigen" + +msgid "Animation Change Call" +msgstr "Aanroep animatie wijzigen" + +msgid "Animation Multi Change Transition" +msgstr "Meerdere animatietransities wijzigen" + +msgid "Animation Multi Change Position3D" +msgstr "Meerdere 3D-posities animatie wijzigen" + +msgid "Animation Multi Change Rotation3D" +msgstr "Meerdere 3D-rotaties animatie wijzigen" + +msgid "Animation Multi Change Scale3D" +msgstr "Meerdere 3D-schalen animatie wijzigen" + +msgid "Animation Multi Change Keyframe Value" +msgstr "Meerdere keyframe-waarden animatie wijzigen" + +msgid "Animation Multi Change Call" +msgstr "Meerdere aanroepen animatie wijzigen" + msgid "Change Animation Length" -msgstr "Verander Animatielengte" +msgstr "Animatielengte wijzigen" msgid "Change Animation Loop" -msgstr "Animatielus veranderen" +msgstr "Animatielus wijzigen" + +msgid "Can't change loop mode on animation instanced from imported scene." +msgstr "" +"Kan lusmodus niet wijzigen voor animatie die geïnstantieerd is vanuit " +"geïmporteerde scène." + +msgid "Can't change loop mode on animation embedded in another scene." +msgstr "" +"Kan lusmodus niet wijzigen voor animatie die ingebed is in een andere scène." msgid "Property Track" -msgstr "Eigenschap Track" +msgstr "Eigenschappen-track" + +msgid "3D Position Track" +msgstr "3D-positie-track" + +msgid "3D Rotation Track" +msgstr "3D-rotatie-track" + +msgid "3D Scale Track" +msgstr "3D-schaal-track" + +msgid "Blend Shape Track" +msgstr "Blend-vorm-track" msgid "Call Method Track" -msgstr "Methode Invocatie Track" +msgstr "Methode-oproep-track" msgid "Bezier Curve Track" -msgstr "Bezier-curve Track" +msgstr "Bézier-curve-track" msgid "Audio Playback Track" -msgstr "Audio Terugspelen Track" +msgstr "Audio-afspelen-track" msgid "Animation Playback Track" -msgstr "Animatie Terugspelen Track" +msgstr "Animatie-afspelen-track" msgid "Animation length (frames)" msgstr "Animatielengte (frames)" @@ -500,7 +692,7 @@ msgid "Animation length (seconds)" msgstr "Animatielengte (seconden)" msgid "Add Track" -msgstr "Track Toevoegen" +msgstr "Track toevoegen" msgid "Animation Looping" msgstr "Animatie herhalen" @@ -515,22 +707,25 @@ msgid "Animation Clips:" msgstr "Animatieclips:" msgid "Change Track Path" -msgstr "Verander Track pad" +msgstr "Track-pad veranderen" msgid "Toggle this track on/off." -msgstr "Schakel deze track aan/uit." +msgstr "Deze track in-/uitschakelen." + +msgid "Use Blend" +msgstr "Mengen gebruiken" msgid "Update Mode (How this property is set)" -msgstr "Bijwerkmodus (hoe de eigenschap ingesteld wordt)" +msgstr "Bijwerk-modus (hoe deze eigenschap ingesteld wordt)" msgid "Interpolation Mode" msgstr "Interpolatiemodus" msgid "Loop Wrap Mode (Interpolate end with beginning on loop)" -msgstr "Naadloze-lusmodus (interpoleert einde met begin van lus)" +msgstr "Naadloze-lus-modus (interpoleert einde met begin van lus)" msgid "Remove this track." -msgstr "Verwijder deze track." +msgstr "Deze track verwijderen." msgid "Time (s):" msgstr "Tijd (s):" @@ -544,23 +739,53 @@ msgstr "Rotatie:" msgid "Scale:" msgstr "Schaal:" +msgid "Blend Shape:" +msgstr "Mengvorm:" + msgid "Type:" msgstr "Type:" msgid "(Invalid, expected type: %s)" -msgstr "(Ongeldig, verwachtte type: %s)" +msgstr "(Ongeldig, verwacht type: %s)" + +msgid "Easing:" +msgstr "Verzachting:" + +msgid "In-Handle:" +msgstr "In-handgreep:" + +msgid "Out-Handle:" +msgstr "Uit-handgreep:" + +msgid "Handle mode: Free\n" +msgstr "Handgreep-modus: Vrij\n" + +msgid "Handle mode: Linear\n" +msgstr "Handgreep-modus: Lineair\n" + +msgid "Handle mode: Balanced\n" +msgstr "Handgreep-modus: Gebalanceerd\n" + +msgid "Handle mode: Mirrored\n" +msgstr "Handgreep-modus: Gespiegeld\n" + +msgid "Stream:" +msgstr "Stroom:" msgid "Start (s):" msgstr "Start (s):" msgid "End (s):" -msgstr "Eind (s):" +msgstr "Einde (s):" msgid "Animation Clip:" -msgstr "Animatie Clip:" +msgstr "Animatieclip:" msgid "Toggle Track Enabled" -msgstr "Track in-/uit schakelen" +msgstr "Track in-/uitschakelen" + +msgid "Don't Use Blend" +msgstr "Mengen niet gebruiken" msgid "Continuous" msgstr "Doorlopend" @@ -569,7 +794,7 @@ msgid "Discrete" msgstr "Discreet" msgid "Capture" -msgstr "Vastleggen" +msgstr "Opnemen" msgid "Nearest" msgstr "Dichtstbijzijnde" @@ -580,56 +805,94 @@ msgstr "Lineair" msgid "Cubic" msgstr "Kubiek" +msgid "Linear Angle" +msgstr "Lineaire hoek" + +msgid "Cubic Angle" +msgstr "Kubieke hoek" + msgid "Clamp Loop Interp" -msgstr "Klem lusinterpolatie" +msgstr "Lusinterpolatie begrenzen" msgid "Wrap Loop Interp" -msgstr "Naadloze lusinterpolatie" +msgstr "Lusinterpolatie naadloos maken" msgid "Insert Key" -msgstr "Sleutel invoeren" +msgstr "Sleutel invoegen" msgid "Duplicate Key(s)" msgstr "Sleutel(s) dupliceren" msgid "Add RESET Value(s)" -msgstr "Voeg RESET Waarde(s) toe" +msgstr "RESET-waarden toevoegen" msgid "Delete Key(s)" msgstr "Sleutel(s) verwijderen" msgid "Change Animation Update Mode" -msgstr "Animatiebijwerkmodus veranderen" +msgstr "Bijwerk-modus animaties wijzigen" msgid "Change Animation Interpolation Mode" -msgstr "Animatieinterpolatiemodus veranderen" +msgstr "Interpolatiemodus animaties wijzigen" msgid "Change Animation Loop Mode" -msgstr "Animatielusmodus veranderen" +msgstr "Lusmodus animaties wijzigen" + +msgid "Change Animation Use Blend" +msgstr "'Mengen gebruiken' animaties wijzigen" + +msgid "" +"Compressed tracks can't be edited or removed. Re-import the animation with " +"compression disabled in order to edit." +msgstr "" +"Gecomprimeerde track kunnen niet bewerkt of verwijderd worden. Importeer de " +"animatie opnieuw met compressie uitgeschakeld om deze te bewerken." msgid "Remove Anim Track" -msgstr "Verwijder Anim Track" +msgstr "Animatie-track verwijderen" + +msgid "Hold Shift when clicking the key icon to skip this dialog." +msgstr "" +"Houd shift ingedrukt bij het klikken op het sleutel-icoontje om dit venster " +"over te slaan." + +msgid "Create new track for %s and insert key?" +msgstr "Nieuw spoor aanmaken voor %s en sleutel invoegen?" + +msgid "Create %d new tracks and insert keys?" +msgstr "%d nieuwe sporen aanmaken en sleutels invoeren?" msgid "Create" -msgstr "Maken" +msgstr "Aanmaken" + +msgid "Animation Insert Key" +msgstr "Animatiesleutel toevoegen" msgid "node '%s'" -msgstr "node '%s'" +msgstr "knoop '%s'" msgid "animation" msgstr "animatie" msgid "AnimationPlayer can't animate itself, only other players." -msgstr "Animatie-Speler kan zichzelf niet animeren, alleen andere spelers." +msgstr "AnimationPlayer kan enkel andere spelers animeren, maar niet zichzelf." msgid "property '%s'" -msgstr "Eigenschap '%s'" +msgstr "eigenschap '%s'" msgid "Change Animation Step" -msgstr "Verander Animatiestappen" +msgstr "Animatiestap wijzigen" msgid "Rearrange Tracks" -msgstr "Herschik Tracks" +msgstr "Sporen herordenen" + +msgid "Blend Shape tracks only apply to MeshInstance3D nodes." +msgstr "Mengvorm-sporen zijn enkel van toepassing op MeshInstance3D-knopen." + +msgid "Position/Rotation/Scale 3D tracks only apply to 3D-based nodes." +msgstr "" +"3D-Positie-/-Rotatie-/-Schaal-sporen zijn enkel van toepassing op 3D-" +"gebaseerde knopen." msgid "" "Audio tracks can only point to nodes of type:\n" @@ -637,37 +900,52 @@ msgid "" "-AudioStreamPlayer2D\n" "-AudioStreamPlayer3D" msgstr "" -"Audiosporen kunnen alleen verwijzen naar de volgende knopen:\n" +"Audio-sporen kunnen enkel verwijzen naar het volgende type knopen:\n" "-AudioStreamPlayer\n" "-AudioStreamPlayer2D\n" "-AudioStreamPlayer3D" msgid "Animation tracks can only point to AnimationPlayer nodes." -msgstr "Animatiesporen kunnen alleen verwijzen naar AnimatiePlayer-knopen." +msgstr "Animatie-sporen kunnen enkel verwijzen naar AnimationPlayer-knopen." msgid "Not possible to add a new track without a root" -msgstr "Niet mogelijk om een nieuwe track toe te voegen zonder een root" +msgstr "Nieuwe sporen kunnen niet toegevoegd worden zonder een root" msgid "Invalid track for Bezier (no suitable sub-properties)" -msgstr "Ongeldig spoor voor Bezier (geen geschikte sub-eigenschappen)" +msgstr "Ongeldig spoor voor Bézier (geen geschikte sub-eigenschappen)" msgid "Add Bezier Track" -msgstr "Voeg Bézierbaan Toe" +msgstr "Bézier-spoor toevoegen" msgid "Track path is invalid, so can't add a key." -msgstr "Spoorpad is ongeldig, dus sleutel kan niet toevoegt worden." +msgstr "Sleutel kan niet toegevoegd worden omdat spoorpad ongeldig is." + +msgid "Track is not of type Node3D, can't insert key" +msgstr "Sleutel kan niet ingevoegd worden omdat spoor niet van type Node3D is" + +msgid "Add Position Key" +msgstr "Positie-sleutel toevoegen" + +msgid "Add Rotation Key" +msgstr "Rotatie-sleutel toevoegen" + +msgid "Add Scale Key" +msgstr "Schaal-sleutel toevoegen" msgid "Add Track Key" -msgstr "Voeg Track sleutel toe" +msgstr "Spoor-sleutel toevoegen" msgid "Track path is invalid, so can't add a method key." -msgstr "Track path is niet geldig, dus kan geen methode key toevoegen." +msgstr "Methodesleutel kan niet toegevoegd worden omdat spoorpad ongeldig is." msgid "Add Method Track Key" -msgstr "Voeg Methode Track sleutel toe" +msgstr "Methode-spoor-sleutel toevoegen" msgid "Method not found in object:" -msgstr "Methode niet gevonden in object:" +msgstr "Methode niet teruggevonden in object:" + +msgid "Animation Move Keys" +msgstr "Animatie-verplaatsingssleutels" msgid "Position" msgstr "Positie" @@ -678,39 +956,105 @@ msgstr "Rotatie" msgid "Scale" msgstr "Schaal" +msgid "BlendShape" +msgstr "Meng-vorm" + msgid "Methods" msgstr "Methoden" msgid "Bezier" -msgstr "Bezier" +msgstr "Bézier" msgid "Audio" msgstr "Audio" msgid "Clipboard is empty!" -msgstr "Plakbord is leeg!" +msgstr "Klembord is leeg!" msgid "Paste Tracks" -msgstr "Plak sporen" +msgstr "Sporen plakken" + +msgid "Animation Scale Keys" +msgstr "Animatie-schaal-sleutels" + +msgid "Make Easing Keys" +msgstr "Verzachtingssleutels toevoegen" msgid "" "This option does not work for Bezier editing, as it's only a single track." msgstr "" -"Deze optie is nu niet mogelijk bij Bezier bewerken omdat slechts een spoor " -"aanwezig is." +"Deze optie werkt niet in de Bézier-bewerkmodus omdat deze slechts uit één " +"spoor bestaat." + +msgid "Animation Add RESET Keys" +msgstr "Animatie-RESET-sleutels toevoegen" + +msgid "Bake Animation as Linear Keys" +msgstr "Animatie bakken als lineaire sleutels" + +msgid "" +"This animation belongs to an imported scene, so changes to imported tracks " +"will not be saved.\n" +"\n" +"To modify this animation, navigate to the scene's Advanced Import settings " +"and select the animation.\n" +"Some options, including looping, are available here. To add custom tracks, " +"enable \"Save To File\" and\n" +"\"Keep Custom Tracks\"." +msgstr "" +"Deze animatie komt van een geïmporteerde scène, waardoor veranderingen aan " +"geïmporteerde tracks niet opgeslagen worden.\n" +"\n" +"Om deze animatie te kunnen bewerken, navigeer naar de geavanceerde import-" +"instellingen van de scène en selecteer daar de animatie.\n" +"Sommige opties, waaronder de lusmodus, zijn hier ook beschikbaar. Om " +"aangepaste tracks toe te voegen, schakel je \"Naar bestand opslaan\"\n" +"en \"Aangepaste tracks behouden\" in." + +msgid "" +"Some AnimationPlayerEditor's options are disabled since this is the dummy " +"AnimationPlayer for preview.\n" +"\n" +"The dummy player is forced active, non-deterministic and doesn't have the " +"root motion track. Furthermore, the original node is inactive temporary." +msgstr "" +"Sommige opties voor de AnimationPlayerEditor zijn uitgeschakeld omdat dit een " +"dummy AnimationPlayer ter voorbeeld is.\n" +"\n" +"De dummy-speler wordt geforceerd actief gezet, is niet-deterministisch en " +"heeft geen root-bewegings-spoor. Hiernaast is de oorspronkelijke knoop " +"tijdelijk inactief." + +msgid "AnimationPlayer is inactive. The playback will not be processed." +msgstr "AnimationPlayer is inactief. Het afspelen ervan wordt niet uitgevoerd." msgid "Select an AnimationPlayer node to create and edit animations." msgstr "" -"Selecteer een AnimationPlayer uit de Scene Tree om animaties te wijzigen." +"Selecteer een AnimationPlayer-knoop om animaties aan te maken en te bewerken." msgid "Imported Scene" -msgstr "Geïmporteerde Scene" +msgstr "Geïmporteerde scène" msgid "Warning: Editing imported animation" -msgstr "Waarschuwing: Er wordt een geïmporteerde animatie bewerkt" +msgstr "Waarschuwing: Je bewerkt een geïmporteerde animatie" + +msgid "Dummy Player" +msgstr "Dummy-speler" + +msgid "Warning: Editing dummy AnimationPlayer" +msgstr "Waarschuwing: Je bewerkt een dummy-AnimationPlayer" + +msgid "Inactive Player" +msgstr "Inactieve speler" + +msgid "Warning: AnimationPlayer is inactive" +msgstr "Waarschuwing: AnimationPlayer is niet actief" + +msgid "Toggle between the bezier curve editor and track editor." +msgstr "Schakel tussen de bewerker voor bézier-curves en die voor sporen." msgid "Only show tracks from nodes selected in tree." -msgstr "Alleen sporen van geselecteerde knopen tonen." +msgstr "Alleen sporen van in boomstructuur geselecteerde knopen tonen." msgid "Group tracks by node or display them as plain list." msgstr "Sporen groeperen op knoop of als een normale lijst tonen." @@ -719,7 +1063,7 @@ msgid "Snap:" msgstr "Uitlijnen:" msgid "Animation step value." -msgstr "Animatie stap waarde." +msgstr "Animatiestapwaarde." msgid "Seconds" msgstr "Seconden" @@ -731,58 +1075,76 @@ msgid "Edit" msgstr "Bewerken" msgid "Animation properties." -msgstr "Animatie eigenschappen." +msgstr "Animatie-eigenschappen." msgid "Copy Tracks" -msgstr "Kopieer sporen" +msgstr "Sporen kopiëren" msgid "Scale Selection" -msgstr "Schaal selectie" +msgstr "Selectie schalen" msgid "Scale From Cursor" -msgstr "Schaal Vanaf Cursor" +msgstr "Schalen vanuit cursor" + +msgid "Make Easing Selection" +msgstr "Verzachtingsselectie maken" msgid "Duplicate Selection" msgstr "Selectie dupliceren" msgid "Duplicate Transposed" -msgstr "Dupliceer Getransponeerde" +msgstr "Getransponeerde dupliceren" msgid "Delete Selection" -msgstr "Verwijder Selectie" +msgstr "Selectie verwijderen" msgid "Go to Next Step" -msgstr "Ga naar Volgende Stap" +msgstr "Naar volgende stap gaan" msgid "Go to Previous Step" -msgstr "Ga naar Vorige Stap" +msgstr "Naar vorige stap gaan" msgid "Apply Reset" -msgstr "Reset" +msgstr "Reset doorvoeren" + +msgid "Bake Animation" +msgstr "Animatie bakken" msgid "Optimize Animation (no undo)" -msgstr "Optimaliseer Animatie (Onomkeerbaar)" +msgstr "Animatie optimaliseren (onomkeerbaar)" msgid "Clean-Up Animation (no undo)" -msgstr "Animatie Opschonen (Onomkeerbaar)" +msgstr "Animatie opschonen (onomkeerbaar)" msgid "Pick a node to animate:" -msgstr "Kies een node om te animeren:" +msgstr "Kies een knoop om te animeren:" msgid "Use Bezier Curves" -msgstr "Gebruik Bezier Curves" +msgstr "Bézier-curves gebruiken" msgid "Create RESET Track(s)" -msgstr "Creëer RESET Track(s)" +msgstr "RESET-spo(o)r(en) creëren" + +msgid "Animation Optimizer" +msgstr "Animatie-optimalisator" + +msgid "Max Velocity Error:" +msgstr "Maximale foutmarge snelheid:" + +msgid "Max Angular Error:" +msgstr "Maximale foutmarge hoek:" + +msgid "Max Precision Error:" +msgstr "Maximale foutmarge precisie:" msgid "Optimize" msgstr "Optimaliseren" msgid "Remove invalid keys" -msgstr "Verwijder ongeldige sleutels" +msgstr "Ongeldige sleutels verwijderen" msgid "Remove unresolved and empty tracks" -msgstr "Verwijder onopgeloste en lege sporen" +msgstr "Onopgeloste en lege sporen verwijderen" msgid "Clean-up all animations" msgstr "Alle animaties opruimen" @@ -794,31 +1156,125 @@ msgid "Clean-Up" msgstr "Opruimen" msgid "Scale Ratio:" -msgstr "Schaal Ratio:" +msgstr "Schaal-verhouding:" + +msgid "Select Transition and Easing" +msgstr "Transitie en verzachting selecteren" + +msgctxt "Transition Type" +msgid "Linear" +msgstr "Lineair" + +msgctxt "Transition Type" +msgid "Sine" +msgstr "Sinus" + +msgctxt "Transition Type" +msgid "Quint" +msgstr "Quint" + +msgctxt "Transition Type" +msgid "Quart" +msgstr "Quart" + +msgctxt "Transition Type" +msgid "Quad" +msgstr "Quad" + +msgctxt "Transition Type" +msgid "Expo" +msgstr "Exponent" + +msgctxt "Transition Type" +msgid "Elastic" +msgstr "Elastisch" + +msgctxt "Transition Type" +msgid "Cubic" +msgstr "Kubiek" + +msgctxt "Transition Type" +msgid "Circ" +msgstr "Cirkel" + +msgctxt "Transition Type" +msgid "Bounce" +msgstr "Tutsen" + +msgctxt "Transition Type" +msgid "Back" +msgstr "Terug" + +msgctxt "Transition Type" +msgid "Spring" +msgstr "Veer" + +msgctxt "Ease Type" +msgid "In" +msgstr "In" + +msgctxt "Ease Type" +msgid "Out" +msgstr "Uit" + +msgctxt "Ease Type" +msgid "InOut" +msgstr "InUit" + +msgctxt "Ease Type" +msgid "OutIn" +msgstr "UitIn" + +msgid "Transition Type:" +msgstr "Type overgang:" + +msgid "Ease Type:" +msgstr "Verzachtingstype:" + +msgid "FPS:" +msgstr "FPS:" + +msgid "Animation Baker" +msgstr "Animatie-bakker" + +msgid "3D Pos/Rot/Scl Track:" +msgstr "3D-Pos.-/-Rot.-/-Sch.-spoor" + +msgid "Blendshape Track:" +msgstr "Mengvorm-spoor:" + +msgid "Value Track:" +msgstr "Waarde-spoor:" msgid "Select Tracks to Copy" -msgstr "Selecteer sporen om te kopieren" +msgstr "Sporen om te kopiëren selecteren" msgid "Select All/None" msgstr "Alles/niets selecteren" +msgid "Animation Change Keyframe Time" +msgstr "Animatie sleutelframe-tijd wijzigen" + msgid "Add Audio Track Clip" -msgstr "Voeg audiospoor clip toe" +msgstr "Audiotrack-clip toevoegen" msgid "Change Audio Track Clip Start Offset" -msgstr "Wijzig startverschuiving van audiospoorclip" +msgstr "Startverschuiving van audiospoorclip wijzigen" msgid "Change Audio Track Clip End Offset" -msgstr "Wijzig eindverschuiving van audiospoorclip" +msgstr "Eindverschuiving van audiospoorclip wijzigen" msgid "Go to Line" -msgstr "Ga naar Regel" +msgstr "Naar regel gaan" msgid "Line Number:" msgstr "Regelnummer:" msgid "%d replaced." -msgstr "%d vervangingen." +msgstr "%d vervangen." + +msgid "No match" +msgstr "Geen overeenkomsten teruggevonden" msgid "%d match" msgid_plural "%d matches" @@ -827,8 +1283,8 @@ msgstr[1] "%d overeenkomsten gevonden" msgid "%d of %d match" msgid_plural "%d of %d matches" -msgstr[0] "%d overeenkomst gevonden" -msgstr[1] "%d overeenkomsten gevonden" +msgstr[0] "%d van %d overeenkomst" +msgstr[1] "%d van %d overeenkomsten" msgid "Match Case" msgstr "Hoofdlettergevoelig" @@ -843,10 +1299,18 @@ msgid "Replace All" msgstr "Alles vervangen" msgid "Selection Only" -msgstr "Alleen selectie" +msgstr "Enkel selectie" + +msgctxt "Indentation" +msgid "Spaces" +msgstr "Spaties" + +msgctxt "Indentation" +msgid "Tabs" +msgstr "Tabs" msgid "Toggle Scripts Panel" -msgstr "Schakel Scripten Paneel" +msgstr "Script-paneel in-/uitschakelen" msgid "Zoom In" msgstr "Inzoomen" @@ -855,7 +1319,7 @@ msgid "Zoom Out" msgstr "Uitzoomen" msgid "Reset Zoom" -msgstr "Herstel Zoom" +msgstr "Zoom herstellen" msgid "Errors" msgstr "Fouten" @@ -867,20 +1331,23 @@ msgid "Line and column numbers." msgstr "Regel- en kolomnummers." msgid "Method in target node must be specified." -msgstr "Methode in doelknoop moet gespecificeerd worden." +msgstr "Methode in doelknoop moet opgegeven worden." msgid "Method name must be a valid identifier." -msgstr "Methodenaam is geen geldige naam." +msgstr "Methodenaam voldoet niet aan de naamregels." msgid "" "Target method not found. Specify a valid method or attach a script to the " "target node." msgstr "" -"Doelmethode niet gevonden. Specificeer een geldige methode of koppel een " -"script aan de doelknoop." +"Doelmethode niet gevonden. Geef een geldige methode op of koppel een script " +"aan de doelknoop." + +msgid "Attached Script" +msgstr "Bijgevoegd script" msgid "Connect to Node:" -msgstr "Aan Node verbinden:" +msgstr "Met knoop verbinden:" msgid "Connect to Script:" msgstr "Met script verbinden:" @@ -888,20 +1355,38 @@ msgstr "Met script verbinden:" msgid "From Signal:" msgstr "Vanuit signaal:" +msgid "Filter Nodes" +msgstr "Knopen filteren" + +msgid "Go to Source" +msgstr "Naar bron navigeren" + msgid "Scene does not contain any script." -msgstr "Scene bevat geen script." +msgstr "Scene bevat geen scripts." msgid "Select Method" -msgstr "Selecteer Method" +msgstr "Methode selecteren" + +msgid "Filter Methods" +msgstr "Methodes filteren" + +msgid "No method found matching given filters." +msgstr "Geen methode gevonden die aan de opgegeven filters voldoet." + +msgid "Script Methods Only" +msgstr "Enkel script-methoden" + +msgid "Compatible Methods Only" +msgstr "Enkel compatibele methoden" msgid "Remove" msgstr "Verwijderen" msgid "Add Extra Call Argument:" -msgstr "Aanvullende aanroepparameter toevoegen:" +msgstr "Bijkomende aanroep-parameter toevoegen:" msgid "Extra Call Arguments:" -msgstr "Aanroepparameters:" +msgstr "Bijkomende aanroep-parameters:" msgid "Receiver Method:" msgstr "Ontvangende methode:" @@ -956,7 +1441,7 @@ msgstr "" "Weet je zeker dat je alle verbindingen met signaal \"%s\" wilt verwijderen?" msgid "Signals" -msgstr "Signalen" +msgstr "Signaal:" msgid "Filter Signals" msgstr "Filter Signalen" @@ -1364,21 +1849,6 @@ msgstr "Gouden Sponsors" msgid "Silver Sponsors" msgstr "Zilveren Sponsors" -msgid "Bronze Sponsors" -msgstr "Bronzen Sponsors" - -msgid "Mini Sponsors" -msgstr "Mini Sponsoren" - -msgid "Gold Donors" -msgstr "Gouden Donors" - -msgid "Silver Donors" -msgstr "Zilveren Donors" - -msgid "Bronze Donors" -msgstr "Bronzen Donors" - msgid "Donors" msgstr "Donoren" @@ -2239,15 +2709,6 @@ msgstr "" "Schakel de extra uit op '%s' om toekomstige fouten te vermijden." msgid "" -"Unable to load addon script from path: '%s' Base type is not EditorPlugin." -msgstr "" -"Volgend script kon niet geladen worden: '%' Basistype is niet EditorPlugin." - -msgid "Unable to load addon script from path: '%s' Script is not in tool mode." -msgstr "" -"Uitbreidingsscript kon niet geladen worden: '%s' Script is niet in toolmodus." - -msgid "" "Scene '%s' was automatically imported, so it can't be modified.\n" "To make changes to it, a new inherited scene can be created." msgstr "" @@ -2660,6 +3121,9 @@ msgstr "Snel Laden" msgid "Make Unique" msgstr "Maak Uniek" +msgid "Save As..." +msgstr "Opslaan Als..." + msgid "Show in FileSystem" msgstr "Weergeven in Bestandssysteem" @@ -3440,9 +3904,6 @@ msgstr "Laad een bestaande bron van de schijf en bewerk het." msgid "Save the currently edited resource." msgstr "De zojuist bewerkte bron opslaan." -msgid "Save As..." -msgstr "Opslaan Als..." - msgid "Copy Resource" msgstr "Bron kopiëren" @@ -7272,13 +7733,6 @@ msgstr "Bouwen van Android Project (gradle)" msgid "Moving output" msgstr "Output verplaatsen" -msgid "" -"Unable to copy and rename export file, check gradle project directory for " -"outputs." -msgstr "" -"Niet in staat om het export bestand te kopiëren en hernoemen. Controleer de " -"gradle project folder voor outputs." - msgid "Invalid Identifier:" msgstr "Ongeldige identifier:" diff --git a/editor/translations/editor/pl.po b/editor/translations/editor/pl.po index eaaa1f765d..80f9bb2cf4 100644 --- a/editor/translations/editor/pl.po +++ b/editor/translations/editor/pl.po @@ -82,13 +82,15 @@ # Eryk Michalak <gnu.ewm@protonmail.com>, 2023. # BorysBe <b.bobulski@wp.pl>, 2023. # johnny1029 <jkste07@gmail.com>, 2023. +# Marcin Zieliński <czolgista83@gmail.com>, 2023. +# Aleksander Łagowiec <mineolek10@users.noreply.hosted.weblate.org>, 2023. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor interface\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-11-07 01:15+0000\n" -"Last-Translator: johnny1029 <jkste07@gmail.com>\n" +"PO-Revision-Date: 2023-12-11 21:00+0000\n" +"Last-Translator: Tomek <kobewi4e@gmail.com>\n" "Language-Team: Polish <https://hosted.weblate.org/projects/godot-engine/godot/" "pl/>\n" "Language: pl\n" @@ -97,7 +99,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " "|| n%100>=20) ? 1 : 2;\n" -"X-Generator: Weblate 5.2-dev\n" +"X-Generator: Weblate 5.3-dev\n" msgid "Main Thread" msgstr "Główny wątek" @@ -803,7 +805,7 @@ msgid "Continuous" msgstr "Ciągłe" msgid "Discrete" -msgstr "Dyskretnie" +msgstr "Nieciągły" msgid "Capture" msgstr "Przechwyć" @@ -1968,6 +1970,9 @@ msgstr "Deweloperzy" msgid "Authors" msgstr "Autorzy" +msgid "Patrons" +msgstr "Sponsorzy" + msgid "Platinum Sponsors" msgstr "Platynowi sponsorzy" @@ -1977,20 +1982,17 @@ msgstr "Złoci sponsorzy" msgid "Silver Sponsors" msgstr "Srebrni sponsorzy" -msgid "Bronze Sponsors" -msgstr "Brązowi sponsorzy" - -msgid "Mini Sponsors" -msgstr "Mini-sponsorzy" +msgid "Diamond Members" +msgstr "Diamentowi członkowie" -msgid "Gold Donors" -msgstr "Złoci darczyńcy" +msgid "Titanium Members" +msgstr "Tytanowi członkowie" -msgid "Silver Donors" -msgstr "Srebrni darczyńcy" +msgid "Platinum Members" +msgstr "Platynowi członkowie" -msgid "Bronze Donors" -msgstr "Brązowi darczyńcy" +msgid "Gold Members" +msgstr "Złoci członkowie" msgid "Donors" msgstr "Darczyńcy" @@ -2074,7 +2076,7 @@ msgid "Ignore asset root" msgstr "Ignoruj folder główny zasobu" msgid "No files conflict with your project" -msgstr "Żaden plik nie konfliktuje z twoim projektem." +msgstr "Żaden plik nie konfliktuje z twoim projektem" msgid "Show contents of the asset and conflicting files." msgstr "Pokaż zawartość zasobu i konfliktujące pliki." @@ -2462,7 +2464,7 @@ msgid "" "%s." msgstr "" "Nie udało się wykonać komendy \"%s\":\n" -"%s" +"%s." msgid "Filter Commands" msgstr "Filtruj komendy" @@ -2851,12 +2853,24 @@ msgstr "Opisy metod" msgid "Operator Descriptions" msgstr "Opisy operatorów" +msgid "Metadata:" +msgstr "Metadane:" + msgid "Property:" msgstr "Właściwość:" +msgid "Method:" +msgstr "Metoda:" + msgid "Signal:" msgstr "Sygnał:" +msgid "Theme Item:" +msgstr "Element motywu:" + +msgid "No description available." +msgstr "Brak dostępnego opisu." + msgid "%d match." msgstr "%d dopasowanie." @@ -3461,15 +3475,15 @@ msgstr "" "Wyłączam dodatek \"%s\" by uniknąć dalszych błędów." msgid "" -"Unable to load addon script from path: '%s' Base type is not EditorPlugin." +"Unable to load addon script from path: '%s'. Base type is not 'EditorPlugin'." msgstr "" "Nie można wczytać skryptu dodatku ze ścieżki: \"%s\" Skrypt nie dziedziczy po " "klasie EditorPlugin." -msgid "Unable to load addon script from path: '%s' Script is not in tool mode." +msgid "Unable to load addon script from path: '%s'. Script is not in tool mode." msgstr "" -"Nie można załadować skryptu dodatku z ścieżki: \"%s\" Skrypt nie jest w " -"trybie narzędzia (tool)." +"Nie można wczytać skryptu dodatku z ścieżki: \"%s\" Skrypt nie jest w trybie " +"narzędzia (tool)." msgid "" "Scene '%s' was automatically imported, so it can't be modified.\n" @@ -3677,6 +3691,9 @@ msgstr "Narzędzia" msgid "Orphan Resource Explorer..." msgstr "Eksplorator osieroconych zasobów..." +msgid "Upgrade Mesh Surfaces..." +msgstr "Aktualizuj powierzchnie siatek..." + msgid "Reload Current Project" msgstr "Wczytaj ponownie aktualny projekt" @@ -3765,7 +3782,7 @@ msgid "Mobile" msgstr "Mobilny" msgid "Compatibility" -msgstr "Kompatybilność" +msgstr "Kompatybilny" msgid "Changing the renderer requires restarting the editor." msgstr "Zmiana renderera wymaga restartu edytora." @@ -3986,6 +4003,12 @@ msgstr "" msgid "Assign..." msgstr "Przypisz..." +msgid "Copy as Text" +msgstr "Skopiuj jako tekst" + +msgid "Show Node in Tree" +msgstr "Pokaż węzeł w drzewie" + msgid "Invalid RID" msgstr "Nieprawidłowy RID" @@ -4074,6 +4097,9 @@ msgstr "Zrób unikalny" msgid "Make Unique (Recursive)" msgstr "Zrób unikalny (rekurencyjnie)" +msgid "Save As..." +msgstr "Zapisz jako..." + msgid "Show in FileSystem" msgstr "Pokaż w systemie plików" @@ -4547,6 +4573,9 @@ msgstr "Usunąć profil \"%s\"?" msgid "Resources to exclude:" msgstr "Zasoby do wykluczenia:" +msgid "Resources to override export behavior:" +msgstr "Zasoby do nadpisania zachowania eksportu:" + msgid "Resources to export:" msgstr "Zasoby do eksportu:" @@ -4849,6 +4878,9 @@ msgstr "Duplikowanie Folderu:" msgid "New Inherited Scene" msgstr "Nowa scena dziedzicząca" +msgid "Set as Main Scene" +msgstr "Ustaw jako scenę główną" + msgid "Open Scenes" msgstr "Otwórz sceny" @@ -4960,6 +4992,33 @@ msgstr "Zmień nazwę..." msgid "Open in External Program" msgstr "Otwórz w programie zewnętrznym" +msgid "Red" +msgstr "Czerwony" + +msgid "Orange" +msgstr "Pomarańczowy" + +msgid "Yellow" +msgstr "Żółty" + +msgid "Green" +msgstr "Zielony" + +msgid "Teal" +msgstr "Morski" + +msgid "Blue" +msgstr "Niebieski" + +msgid "Purple" +msgstr "Fioletowy" + +msgid "Pink" +msgstr "Różowy" + +msgid "Gray" +msgstr "Szary" + msgid "Go to previous selected folder/file." msgstr "Przejdź do poprzednio zaznaczonego folderu/pliku." @@ -4969,6 +5028,9 @@ msgstr "Przejdź do następnego wybranego folderu/pliku." msgid "Re-Scan Filesystem" msgstr "Przeskanuj system plików ponownie" +msgid "Change Split Mode" +msgstr "Przełącz tryb podziału" + msgid "Filter Files" msgstr "Filtruj pliki" @@ -5588,15 +5650,6 @@ msgstr "Dynamicznie renderowana czcionka TrueType/OpenType" msgid "Prerendered multichannel(+true) signed distance field" msgstr "Wstępnie renderowane wielokanałowe(+true) znakowane pole odległości" -msgid "Can't load font texture:" -msgstr "Nie można wczytać tekstury czcionki:" - -msgid "Image margin too big." -msgstr "Za duży margines obrazka." - -msgid "Character margin too big." -msgstr "Za duży margines znaku." - msgid "Pre-Import Scene" msgstr "Wstępne importowanie sceny" @@ -5967,9 +6020,6 @@ msgstr "Wczytaj istniejący zasób i edytuj go." msgid "Save the currently edited resource." msgstr "Zapisz aktualnie edytowany zasób." -msgid "Save As..." -msgstr "Zapisz jako..." - msgid "Extra resource options." msgstr "Dodatkowe opcje zasobów." @@ -6585,6 +6635,9 @@ msgstr "[Globalna] (utwórz)" msgid "Duplicated Animation Name:" msgstr "Nazwa duplikowanej animacji:" +msgid "Onion skinning requires a RESET animation." +msgstr "Tryb warstw cebuli wymaga animacji RESET." + msgid "Play selected animation backwards from current pos. (A)" msgstr "Odtwórz zaznaczoną animację od tyłu z aktualnej pozycji. (A)" @@ -7725,6 +7778,18 @@ msgstr "" "Jeśli ta opcja jest zaznaczona, kształty obiektów omijania, promienie i " "prędkości będą widoczne w uruchomionym projekcie." +msgid "Debug CanvasItem Redraws" +msgstr "Debugój generowanie CanvasItem" + +msgid "" +"When this option is enabled, redraw requests of 2D objects will become " +"visible (as a short flash) in the running project.\n" +"This is useful to troubleshoot low processor mode." +msgstr "" +"Kiedy ta opcja jest włączona, żądania przerysowania obiektów 2D będą widoczne " +"(jako krótkie błyśnięcie) w uruchomionym projekcie.\n" +"Użyteczne dla rozwiązywania problemów trybu niskiego zużycia procesora." + msgid "Synchronize Scene Changes" msgstr "Synchronizuj zmiany na scenie" @@ -8095,6 +8160,9 @@ msgstr "Utwórz siatkę nawigacyjną (Navigation Mesh)" msgid "Create Debug Tangents" msgstr "Utwórz debugowe styczne" +msgid "No mesh to unwrap." +msgstr "Brak siatki do rozwinięcia." + msgid "" "Mesh cannot unwrap UVs because it does not belong to the edited scene. Make " "it unique first." @@ -8122,6 +8190,15 @@ msgstr "Rozwiń UV2" msgid "Contained Mesh is not of type ArrayMesh." msgstr "Zawarta siatka nie jest typu ArrayMesh." +msgid "Can't unwrap mesh with blend shapes." +msgstr "Nie można rozwinąć siatki bez kształtów mieszania." + +msgid "Only triangles are supported for lightmap unwrap." +msgstr "Tylko trójkąty są wspierane dla rozwijania mapy światła." + +msgid "Normals are required for lightmap unwrap." +msgstr "Wymagane są normalne dla rozwijania mapy światła." + msgid "UV Unwrap failed, mesh may not be manifold?" msgstr "Rozwijanie UV nie powiodło się, siatka modelu może być nieróżnorodna?" @@ -9850,6 +9927,12 @@ msgstr "Utwórz węzeł LightOccluder2D" msgid "LightOccluder2D Preview" msgstr "Podgląd LightOccluder2D" +msgid "Can't convert a sprite from a foreign scene." +msgstr "Nie można przekonwertować sprite z innej sceny." + +msgid "Can't convert an empty sprite to mesh." +msgstr "Nie można przekonwertować pustego sprite'a do siatki." + msgid "Can't convert a sprite using animation frames to mesh." msgstr "" "Nie można przekonwertować sprite'a używającego klatek animacji na siatkę." @@ -13565,9 +13648,19 @@ msgstr "" "Wyłączenie \"edytowalnej instancji\" sprawi, że wszystkie właściwości węzła " "zostaną przywrócone do domyślnych." +msgid "" +"Enabling \"Load as Placeholder\" will disable \"Editable Children\" and cause " +"all properties of the node to be reverted to their default." +msgstr "" +"Włączenie \"Wczytaj jako zastępczy\" wyłączy \"Edytowalne dzieci\" i sprawi, " +"że wszystkie właściwości węzła zostaną przywrócone do domyślnych." + msgid "Make Local" msgstr "Uczyń lokalnym" +msgid "Can't toggle unique name for nodes in subscene!" +msgstr "Nie można przełączyć unikalnej nazwy dla węzłów w podscenie!" + msgid "Enable Scene Unique Name(s)" msgstr "Włącz unikalne w scenie nazwy" @@ -13619,16 +13712,6 @@ msgstr "Usuń węzeł(y)" msgid "Change type of node(s)" msgstr "Zmień typ węzła/ów" -msgid "Removing the node from variable \"%s\" on node \"%s\"." -msgstr "Usuwanie węzła ze zmiennej \"%s\" w węźle \"%s\"." - -msgid "" -"The node's new type is incompatible with an exported variable (expected %s, " -"but type is %s)." -msgstr "" -"Typ węzła jest niekompatybilny z eksportowaną zmienną (oczekiwano %s, ale typ " -"to %s)." - msgid "This operation requires a single selected node." msgstr "Ta operacja wymaga pojedynczego wybranego węzła." @@ -13663,6 +13746,9 @@ msgstr "Wyczyść dziedziczenie" msgid "Editable Children" msgstr "Edytowalne dzieci" +msgid "Load as Placeholder" +msgstr "Wczytaj jako zastępczy" + msgid "Auto Expand to Selected" msgstr "Automatycznie rozwijaj do wybranego" @@ -13962,6 +14048,64 @@ msgstr "Nazwa \"%s\" jest zarezerwowanym słowem kluczowym języka shaderów." msgid "Add Shader Global Parameter" msgstr "Dodaj parametr globalny shadera" +msgid "" +"This project uses meshes with an outdated mesh format from previous Godot " +"versions. The engine needs to update the format in order to use those meshes. " +"Please use the 'Upgrade Mesh Surfaces' tool from the 'Project > Tools' menu. " +"You can ignore this message and keep using outdated meshes, but keep in mind " +"that this leads to increased load times every time you load the project." +msgstr "" +"Ten projekt używa siatki (meshes) z nieaktualnym formacie siatki (mesh) z " +"poprzedniej wersji Godot. Silnik potrzebuje zaktualizować format aby móc " +"używać tych siatek (meshes). Proszę użyj 'Zaktualizuj powierzchnie siatki' w " +"menu 'Projekt > Narzędzia'. Możesz zignorować tą wiadomość i wciąż używać " +"przestarzałych siatek ale pamiętaj że to wydłuża czas ładowania za każdym " +"razem kiedy otwierasz (ładujesz) projekt." + +msgid "" +"This project uses meshes with an outdated mesh format. Check the output log." +msgstr "Ten projekt używa przestarzałych formatów siatek. Sprawdź dziennik." + +msgid "Upgrading All Meshes in Project" +msgstr "Aktualizacja wszystkich siatek w projekcie" + +msgid "Attempting to re-save " +msgstr "Próba ponownego zapisania " + +msgid "Attempting to remove " +msgstr "Próba usunięcia " + +msgid "" +"The mesh format has changed in Godot 4.2, which affects both imported meshes " +"and meshes authored inside of Godot. The engine needs to update the format in " +"order to use those meshes.\n" +"\n" +"If your project predates Godot 4.2 and contains meshes, we recommend you run " +"this one time conversion tool. This update will restart the editor and may " +"take several minutes. Upgrading will make the meshes incompatible with " +"previous versions of Godot.\n" +"\n" +"You can still use your existing meshes as is. The engine will update each " +"mesh in memory, but the update will not be saved. Choosing this option will " +"lead to slower load times every time this project is loaded." +msgstr "" +"Format siatki uległ zmianie w Godot 4.2, co dotyczy zarówno siatek " +"importowanych, jak i siatek stworzonych w Godocie. Aby móc korzystać z tych " +"siatek, silnik musi zaktualizować format.\n" +"\n" +"Jeśli Twój projekt jest starszy niż Godot 4.2 i zawiera siatki, zalecamy " +"uruchomienie tego jednorazowego narzędzia do konwersji. Ta aktualizacja " +"spowoduje ponowne uruchomienie edytora i może zająć kilka minut. Aktualizacja " +"spowoduje, że siatki będą niekompatybilne z poprzednimi wersjami Godota.\n" +"\n" +"Nadal możesz używać istniejących siatek w niezmienionej postaci. Silnik " +"zaktualizuje każdą siatkę w pamięci, ale aktualizacja nie zostanie zapisana. " +"Wybranie tej opcji spowoduje wolniejsze wczytywanie przy każdym ładowaniu " +"tego projektu." + +msgid "Restart & Upgrade" +msgstr "Zrestartuj i zaktualizuj" + msgid "Make this panel floating in the screen %d." msgstr "Uczyń ten panel pływającym na ekranie %d." @@ -13990,6 +14134,9 @@ msgstr "Zmień zewnętrzny promień torusa" msgid "Invalid type argument to convert(), use TYPE_* constants." msgstr "Niepoprawny typ argumentu funkcji convert(), użyj stałych TYPE_*." +msgid "Cannot resize array." +msgstr "Nie można zmienić rozmiaru tablicy." + msgid "Step argument is zero!" msgstr "Argument kroku wynosi zero!" @@ -14003,7 +14150,7 @@ msgid "Not based on a resource file" msgstr "Nie bazuje na pliku zasobów" msgid "Invalid instance dictionary format (missing @path)" -msgstr "Niepoprawna instancja formatu słownika (brakuje @path)" +msgstr "Niepoprawna/Nieważna instancja formatu słownika (brakuje @path)" msgid "Invalid instance dictionary format (can't load script at @path)" msgstr "" @@ -14015,6 +14162,9 @@ msgstr "Niepoprawna instancja formatu słownika (niepoprawny skrypt w @path)" msgid "Invalid instance dictionary (invalid subclasses)" msgstr "Niepoprawny słownik instancji (niepoprawne podklasy)" +msgid "Cannot instantiate GDScript class." +msgstr "Nie można zainicjować klasy GDScript." + msgid "Value of type '%s' can't provide a length." msgstr "Wartość typu \"%s\" nie może określać długości." @@ -14221,6 +14371,9 @@ msgstr "Wykreśl bezpośrednie oświetlenie" msgid "Integrate indirect lighting" msgstr "Integruj pośrednie oświetlenie" +msgid "Integrate indirect lighting %d%%" +msgstr "Integruj pośrednie oświetlenie %d%%" + msgid "Baking lightprobes" msgstr "Wypiekanie sond światła" @@ -14267,7 +14420,7 @@ msgstr "" "Upewnij się, że katalog \"%s\" istnieje i zawiera zestawy .NET." msgid ".NET assemblies not found" -msgstr "Nie znaleziono zestawów .NET." +msgstr "Nie znaleziono zestawów .NET" msgid "" "Unable to load .NET runtime, specifically hostfxr.\n" @@ -14643,6 +14796,9 @@ msgstr "Nie udało się uruchomić na urządzeniu." msgid "Exporting to Android when using C#/.NET is experimental." msgstr "Eksportowanie na Androida z użyciem C#/.NET jest eksperymentalne." +msgid "Android architecture %s not supported in C# projects." +msgstr "Architektura Androida %s nie jest wspierana w projektach C#." + msgid "" "Android build template not installed in the project. Install it from the " "Project menu." @@ -14803,23 +14959,14 @@ msgstr "Nie udało się zapisać pliku pakietu rozszerzenia!" msgid "Building Android Project (gradle)" msgstr "Budowanie projektu Androida (gradle)" -msgid "" -"Building of Android project failed, check output for the error. Alternatively " -"visit docs.godotengine.org for Android build documentation." -msgstr "" -"Budowanie projektu Androida się nie powiodło, sprawdź dane wyjściowe błędu. " -"Ewentualnie, odwiedź docs.godotengine.org po dokumentację budowania dla " -"Androida." +msgid "Building of Android project failed, check output for the error:" +msgstr "Budowanie projektu Androida nie powiodło się, sprawdź błędy w konsoli:" msgid "Moving output" msgstr "Przesuwam wyjście" -msgid "" -"Unable to copy and rename export file, check gradle project directory for " -"outputs." -msgstr "" -"Nie udało się skopiować i przemianować pliku eksportu, sprawdź folder " -"projektu gradle po informacje." +msgid "Unable to copy and rename export file:" +msgstr "Nie udało się skopiować i zmienić nazwy pliku eksportu:" msgid "Package not found: \"%s\"." msgstr "Nie znaleziono pakietu: \"%s\"." @@ -14897,6 +15044,13 @@ msgstr "" ".ipa można zbudować tylko w systemie macOS. Opuszczanie projektu Xcode bez " "budowania pakietu." +msgid "Exporting to iOS when using C#/.NET is experimental and requires macOS." +msgstr "" +"Eksportowanie na iOS z użyciem C#/.NET jest eksperymentalne i wymaga macOS." + +msgid "Exporting to iOS when using C#/.NET is experimental." +msgstr "Eksportowanie na iOS z użyciem C#/.NET jest eksperymentalne." + msgid "Identifier is missing." msgstr "Brakuje identyfikatora." @@ -15063,6 +15217,13 @@ msgstr "" msgid "App sandbox is required for App Store distribution." msgstr "Piaskownica aplikacji jest wymagana do dystrybucji w App Store." +msgid "" +"'rcodesign' doesn't support signing applications with embedded dynamic " +"libraries (GDExtension or .NET)." +msgstr "" +"\"rcodesign\" nie wspiera podpisywania aplikacji z osadzonymi bibliotekami " +"dynamicznymi (GDExtension lub .NET)." + msgid "Code signing is required for App Store distribution." msgstr "Podpisanie kodu jest wymagane do dystrybucji w App Store." @@ -15261,6 +15422,13 @@ msgstr "" "Aplikacje podpisane ad-hoc wymagają uprawnienia \"Wyłącz walidację " "biblioteki\" do ładowania bibliotek dynamicznych." +msgid "" +"'rcodesign' doesn't support signing applications with embedded dynamic " +"libraries." +msgstr "" +"\"rcodesign\" nie wspiera podpisywania aplikacji z osadzonymi bibliotekami " +"dynamicznymi." + msgid "Could not create entitlements file." msgstr "Nie można utworzyć pliku uprawnień." @@ -15625,7 +15793,7 @@ msgid "" "An occluder polygon must be set (or drawn) for this occluder to take effect." msgstr "" "Wielokąt przesłaniający musi być ustawiony (lub narysowany), aby ten " -"przesłaniacz zadziałał." +"\"occluder\" zadziałał." msgid "The occluder polygon for this occluder is empty. Please draw a polygon." msgstr "" @@ -15733,6 +15901,17 @@ msgstr "" "włączone w samym węźle TileMap." msgid "" +"The TileMap node is set as Y-sorted, but Y-sort is not enabled on any of the " +"TileMap's layers.\n" +"This may lead to unwanted behaviors, as a layer that is not Y-sorted will be " +"Y-sorted as a whole." +msgstr "" +"Węzeł TileMap ma włączone sortowanie Y, ale sortowanie Y nie jest ustawione " +"na żadnej z warstw TileMapy.\n" +"To może doprowadzić do niechcianych zachowań, gdyż warstwa nie sortowana po Y " +"będzie sortowana jako całość." + +msgid "" "Isometric TileSet will likely not look as intended without Y-sort enabled for " "the TileMap and all of its layers." msgstr "" @@ -16356,7 +16535,7 @@ msgid "" "refactoring in a future 4.x version involving compatibility-breaking API " "changes." msgstr "" -"Miej na uwadze, że GraphEdit i GraphNode przejdą obszerne refaktorowanie w " +"Miej na uwadze, że GraphEdit i GraphNode przejdą obszerną refaktoryzację w " "przyszłej wersji 4.x, obejmujące zmiany API łamiące kompatybilność." msgid "Toggle the visual grid." @@ -16375,6 +16554,13 @@ msgid "Automatically arrange selected nodes." msgstr "Automatycznie ułóż zaznaczone węzły." msgid "" +"Labels with autowrapping enabled must have a custom minimum size configured " +"to work correctly inside a container." +msgstr "" +"Labelki z włączonym autozawijaniem muszą mieć skonfigurowany własny minimalny " +"rozmiar, by działać poprawnie w kontenerze." + +msgid "" "The current font does not support rendering one or more characters used in " "this Label's text." msgstr "" @@ -16497,15 +16683,6 @@ msgstr "" "ryzyka utraty danych." msgid "" -"Setting node name '%s' to be unique within scene for '%s', but it's already " -"claimed by '%s'.\n" -"'%s' is no longer set as having a unique name." -msgstr "" -"Ustawianie nazwy węzła \"%s\" by była unikalna w scenie dla \"%s\", ale jest " -"już zajęta przez \"%s\".\n" -"\"%s\" nie będzie już ustawiony jako posiadające unikalną nazwę." - -msgid "" "This node is marked as deprecated and will be removed in future versions.\n" "Please check the Godot documentation for information about migration." msgstr "" @@ -16521,13 +16698,6 @@ msgstr "" "poważnym zmianom w przyszłych wersjach." msgid "" -"Default Environment as specified in the project setting \"rendering/" -"environment/defaults/default_environment\" could not be loaded." -msgstr "" -"Domyślne środowisko określone w ustawieniu projektu \"rendering/environment/" -"defaults/default_environment\" nie mogło zostać załadowane." - -msgid "" "ShaderGlobalsOverride is not active because another node of the same type is " "in the scene." msgstr "" @@ -16552,27 +16722,6 @@ msgstr "" "Wielkość Viewportu musi być większa lub równa 2 piksele w obu wymiarach, by " "cokolwiek renderować." -msgid "Cannot open font from file: %s." -msgstr "Nie można otworzyć czcionki z pliku: %s." - -msgid "Version %d of BMFont is not supported (should be 3)." -msgstr "Wersja %d BMFont nie jest obsługiwana (powinna być 3)." - -msgid "Invalid BMFont info block size." -msgstr "Nieprawidłowy rozmiar bloku informacyjnego BMFont." - -msgid "Invalid BMFont common block size." -msgstr "Nieprawidłowy rozmiar bloku wspólnego BMFont." - -msgid "Can't load font texture: %s." -msgstr "Nie można załadować tekstury czcionki: %s." - -msgid "Unsupported BMFont texture format." -msgstr "Nieobsługiwany format tekstury BMFont." - -msgid "Invalid BMFont block type." -msgstr "Nieprawidłowy typ bloku BMFont." - msgid "" "An incoming node's name clashes with %s already in the scene (presumably, " "from a more nested instance).\n" diff --git a/editor/translations/editor/pt.po b/editor/translations/editor/pt.po index 3bdc62195b..8888daf251 100644 --- a/editor/translations/editor/pt.po +++ b/editor/translations/editor/pt.po @@ -43,13 +43,14 @@ # Lucas Souza <lucasteisouza@gmail.com>, 2023. # André Luiz Santana Siqueira <hivosoft@outlook.com>, 2023. # gomakappa <gomaproi@outlook.com>, 2023. +# 100Nome <100nome.portugal@gmail.com>, 2023. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor interface\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-10-20 09:04+0000\n" -"Last-Translator: gomakappa <gomaproi@outlook.com>\n" +"PO-Revision-Date: 2023-12-04 15:08+0000\n" +"Last-Translator: 100Nome <100nome.portugal@gmail.com>\n" "Language-Team: Portuguese <https://hosted.weblate.org/projects/godot-engine/" "godot/pt/>\n" "Language: pt\n" @@ -57,7 +58,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.1\n" +"X-Generator: Weblate 5.3-dev\n" msgid "Main Thread" msgstr "Linha Principal" @@ -1877,21 +1878,6 @@ msgstr "Patrocinadores Ouro" msgid "Silver Sponsors" msgstr "Patrocinadores Prata" -msgid "Bronze Sponsors" -msgstr "Patrocinadores Bronze" - -msgid "Mini Sponsors" -msgstr "Patrocinadores Mini" - -msgid "Gold Donors" -msgstr "Doadores Gold" - -msgid "Silver Donors" -msgstr "Doadores Silver" - -msgid "Bronze Donors" -msgstr "Doadores Bronze" - msgid "Donors" msgstr "Doadores" @@ -3283,17 +3269,6 @@ msgstr "" "A desativar o addon em '%s' para prevenir mais erros." msgid "" -"Unable to load addon script from path: '%s' Base type is not EditorPlugin." -msgstr "" -"Incapaz de carregar script addon do Caminho: '%s' Tipo base não é " -"EditorPlugin." - -msgid "Unable to load addon script from path: '%s' Script is not in tool mode." -msgstr "" -"Incapaz de carregar script addon do Caminho: '%s' Script não está no modo " -"ferramenta." - -msgid "" "Scene '%s' was automatically imported, so it can't be modified.\n" "To make changes to it, a new inherited scene can be created." msgstr "" @@ -3866,6 +3841,9 @@ msgstr "Fazer único" msgid "Make Unique (Recursive)" msgstr "Tornar Único (Recursivo)" +msgid "Save As..." +msgstr "Guardar Como..." + msgid "Show in FileSystem" msgstr "Mostrar no Sistema de Ficheiros" @@ -4652,7 +4630,7 @@ msgid "Resource..." msgstr "Recurso..." msgid "TextFile..." -msgstr "Fucheiro de Texto..." +msgstr "Ficheiro de Texto..." msgid "Expand Folder" msgstr "Expandir Pasta" @@ -5349,12 +5327,6 @@ msgstr "Fonte TrueType/OpenType renderizada dinamicamente" msgid "Prerendered multichannel(+true) signed distance field" msgstr "Campo de distância com sinal multicanal pré-renderizado (+verdadeiro)" -msgid "Can't load font texture:" -msgstr "Não é possível carregar a textura da fonte:" - -msgid "Image margin too big." -msgstr "Margem da imagem muito grande." - msgid "Pre-Import Scene" msgstr "Pré-importando Cena" @@ -5700,9 +5672,6 @@ msgstr "Carregue um recurso existente a partir do disco e edite-o." msgid "Save the currently edited resource." msgstr "Guarde o recurso editado." -msgid "Save As..." -msgstr "Guardar Como..." - msgid "Extra resource options." msgstr "Opções de recurso extra." @@ -13830,24 +13799,9 @@ msgstr "Incapaz de escrever ficheiro de pacote de expansão!" msgid "Building Android Project (gradle)" msgstr "A compilar Projeto Android (gradle)" -msgid "" -"Building of Android project failed, check output for the error. Alternatively " -"visit docs.godotengine.org for Android build documentation." -msgstr "" -"Falhou a compilação do projeto Android, verifique o erro na saída. Em " -"alternativa visite docs.godotengine.org para a documentação sobre compilação " -"Android." - msgid "Moving output" msgstr "A mover saída" -msgid "" -"Unable to copy and rename export file, check gradle project directory for " -"outputs." -msgstr "" -"Incapaz de copiar e renomear ficheiro de exportação, verifique diretoria de " -"projeto gradle por resultados." - msgid "Package not found: \"%s\"." msgstr "Pacote não encontrado: \"%s\"." @@ -15339,15 +15293,6 @@ msgstr "" "novamente com segurança, sem risco de perda de dados." msgid "" -"Setting node name '%s' to be unique within scene for '%s', but it's already " -"claimed by '%s'.\n" -"'%s' is no longer set as having a unique name." -msgstr "" -"Configurando o nome do nó '%s' para ser único dentro da cena para '%s', mas " -"já foi reivindicado por '%s'.\n" -"'%s' não está mais definido como tendo um nome exclusivo." - -msgid "" "This node is marked as deprecated and will be removed in future versions.\n" "Please check the Godot documentation for information about migration." msgstr "" @@ -15387,27 +15332,6 @@ msgstr "" "O tamanho do Viewport tem de ser maior ou igual a 2 pixeis em ambas as " "dimensões para renderizar." -msgid "Cannot open font from file: %s." -msgstr "Não é possível abrir a fonte do ficheiro: %s." - -msgid "Version %d of BMFont is not supported (should be 3)." -msgstr "A versão %d de BMFont não é suportada (deve ser 3)." - -msgid "Invalid BMFont info block size." -msgstr "Tamanho de bloco de informações BMFont inválido." - -msgid "Invalid BMFont common block size." -msgstr "Tamanho de bloco comum BMFont inválido." - -msgid "Can't load font texture: %s." -msgstr "Não é possível carregar a textura da fonte: %s." - -msgid "Unsupported BMFont texture format." -msgstr "Formato de textura BMFont não suportado." - -msgid "Invalid BMFont block type." -msgstr "Tipo de bloco BMFont inválido." - msgid "" "Shader keywords cannot be used as parameter names.\n" "Choose another name." diff --git a/editor/translations/editor/pt_BR.po b/editor/translations/editor/pt_BR.po index c18518f8e6..20693fc5d3 100644 --- a/editor/translations/editor/pt_BR.po +++ b/editor/translations/editor/pt_BR.po @@ -175,13 +175,14 @@ # "wendeli alves (wilcoxjvkb)" <wilcoxjvkb@gmail.com>, 2023. # Fernando Crozetta <fernando@czetta.com>, 2023. # Sergio Antonio <sergio.antonio.pn@proton.me>, 2023. +# Martonio Junior <jose.mart.junior@gmail.com>, 2023. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor interface\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: 2016-05-30\n" -"PO-Revision-Date: 2023-11-06 00:35+0000\n" -"Last-Translator: Elizandro Baldin <ejbaldin@gmail.com>\n" +"PO-Revision-Date: 2023-11-21 15:04+0000\n" +"Last-Translator: Martonio Junior <jose.mart.junior@gmail.com>\n" "Language-Team: Portuguese (Brazil) <https://hosted.weblate.org/projects/godot-" "engine/godot/pt_BR/>\n" "Language: pt_BR\n" @@ -189,7 +190,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 5.2-dev\n" +"X-Generator: Weblate 5.2\n" msgid "Main Thread" msgstr "Thread principal" @@ -2067,20 +2068,8 @@ msgstr "Patrocinadores Ouro" msgid "Silver Sponsors" msgstr "Patrocinadores Prata" -msgid "Bronze Sponsors" -msgstr "Patrocinadores Bronze" - -msgid "Mini Sponsors" -msgstr "Patrocinadores Mini" - -msgid "Gold Donors" -msgstr "Doadores Ouro" - -msgid "Silver Donors" -msgstr "Doadores Prata" - -msgid "Bronze Donors" -msgstr "Doadores Bronze" +msgid "Diamond Members" +msgstr "Patrocinadores Diamante" msgid "Donors" msgstr "Doadores" @@ -3479,17 +3468,6 @@ msgstr "" "Desativando o complemento em '%s' para evitar mais erros." msgid "" -"Unable to load addon script from path: '%s' Base type is not EditorPlugin." -msgstr "" -"Não foi possível carregar o script complementar do caminho: '%s' Tipo base " -"não é EditorPlugin." - -msgid "Unable to load addon script from path: '%s' Script is not in tool mode." -msgstr "" -"Não foi possível carregar o script complementar do caminho: '%s' Script não " -"está em modo ferramenta." - -msgid "" "Scene '%s' was automatically imported, so it can't be modified.\n" "To make changes to it, a new inherited scene can be created." msgstr "" @@ -4066,6 +4044,9 @@ msgstr "Tornar Único" msgid "Make Unique (Recursive)" msgstr "Tornar Único (Recursivo)" +msgid "Save As..." +msgstr "Salvar Como..." + msgid "Show in FileSystem" msgstr "Mostrar em Arquivos" @@ -5553,12 +5534,6 @@ msgstr "Fonte TrueType/OpenType renderizada dinamicamente" msgid "Prerendered multichannel(+true) signed distance field" msgstr "Campo de distância com sinal multicanal pré-renderizado (+verdadeiro)" -msgid "Can't load font texture:" -msgstr "Não é possível carregar a textura da fonte:" - -msgid "Image margin too big." -msgstr "Margem da imagem muito grande." - msgid "Pre-Import Scene" msgstr "Pré-importando Cena" @@ -5903,9 +5878,6 @@ msgstr "Carrega um recurso existente do disco e o edita." msgid "Save the currently edited resource." msgstr "Salva o recurso editado atualmente." -msgid "Save As..." -msgstr "Salvar Como..." - msgid "Extra resource options." msgstr "Opções de recursos extras." @@ -14238,24 +14210,9 @@ msgstr "Não foi possível escrever o arquivo do pacote de expansão!" msgid "Building Android Project (gradle)" msgstr "Construindo Projeto Android (gradle)" -msgid "" -"Building of Android project failed, check output for the error. Alternatively " -"visit docs.godotengine.org for Android build documentation." -msgstr "" -"A compilação do projeto Android falhou, verifique a saída para detalhes. Ou " -"então visite docs.godotengine.org para ver a documentação de compilação do " -"Android." - msgid "Moving output" msgstr "Movendo saída" -msgid "" -"Unable to copy and rename export file, check gradle project directory for " -"outputs." -msgstr "" -"Não foi possível copiar e renomear o arquivo de exportação, verifique o " -"diretório do projeto gradle por saídas." - msgid "Package not found: \"%s\"." msgstr "Pacote não encontrado: \"%s\"." @@ -15885,15 +15842,6 @@ msgstr "" "novamente com segurança, sem risco de perda de dados." msgid "" -"Setting node name '%s' to be unique within scene for '%s', but it's already " -"claimed by '%s'.\n" -"'%s' is no longer set as having a unique name." -msgstr "" -"Configurando o nome do nó '%s' para ser único dentro da cena para '%s', mas " -"já foi reivindicado por '%s'.\n" -"'%s' não está mais definido como tendo um nome exclusivo." - -msgid "" "This node is marked as deprecated and will be removed in future versions.\n" "Please check the Godot documentation for information about migration." msgstr "" @@ -15908,13 +15856,6 @@ msgstr "" "grandes alterações em versões futuras." msgid "" -"Default Environment as specified in the project setting \"rendering/" -"environment/defaults/default_environment\" could not be loaded." -msgstr "" -"O ambiente padrão conforme especificado na configuração do projeto " -"\"rendering/environment/defaults/default_environment\" não pôde ser carregado." - -msgid "" "ShaderGlobalsOverride is not active because another node of the same type is " "in the scene." msgstr "" @@ -15940,27 +15881,6 @@ msgstr "" "O tamanho do Viewport deve ser maior ou igual a 2 pixels em ambas as " "dimensões para renderizar algo." -msgid "Cannot open font from file: %s." -msgstr "Não é possível abrir a fonte do arquivo: %s." - -msgid "Version %d of BMFont is not supported (should be 3)." -msgstr "A versão %d de BMFont não é suportada (deve ser 3)." - -msgid "Invalid BMFont info block size." -msgstr "Tamanho de bloco de informações BMFont inválido." - -msgid "Invalid BMFont common block size." -msgstr "Tamanho de bloco comum BMFont inválido." - -msgid "Can't load font texture: %s." -msgstr "Não é possível carregar a textura da fonte: %s." - -msgid "Unsupported BMFont texture format." -msgstr "Formato de textura BMFont não suportado." - -msgid "Invalid BMFont block type." -msgstr "Tipo de bloco BMFont inválido." - msgid "" "An incoming node's name clashes with %s already in the scene (presumably, " "from a more nested instance).\n" diff --git a/editor/translations/editor/ro.po b/editor/translations/editor/ro.po index 744ad077f3..f6fbdaa30d 100644 --- a/editor/translations/editor/ro.po +++ b/editor/translations/editor/ro.po @@ -977,21 +977,6 @@ msgstr "Sponsori Aur" msgid "Silver Sponsors" msgstr "Sponsori de argint" -msgid "Bronze Sponsors" -msgstr "Sponsori de bronz" - -msgid "Mini Sponsors" -msgstr "Mini Sponsori" - -msgid "Gold Donors" -msgstr "Donatori de Aur" - -msgid "Silver Donors" -msgstr "Donatori de Argint" - -msgid "Bronze Donors" -msgstr "Donatori de Bronz" - msgid "Donors" msgstr "Donatori" @@ -1703,17 +1688,6 @@ msgstr "" "Dezactivez addon-ul de la '%s' pentru a preveni erori ulterioare." msgid "" -"Unable to load addon script from path: '%s' Base type is not EditorPlugin." -msgstr "" -"Nu a putut fi încărcat scriptul add-on din calea: '%s' tipul de Bază nu este " -"EditorPlugin." - -msgid "Unable to load addon script from path: '%s' Script is not in tool mode." -msgstr "" -"Nu a putut fi încărcat scriptul add-on din calea: '%s' Scriptul nu este în " -"modul unealtă." - -msgid "" "Scene '%s' was automatically imported, so it can't be modified.\n" "To make changes to it, a new inherited scene can be created." msgstr "" @@ -2006,6 +1980,9 @@ msgstr "Cheie Nouă:" msgid "New Value:" msgstr "Valoare Nouă:" +msgid "Save As..." +msgstr "Salvează Ca..." + msgid "Show in FileSystem" msgstr "Afișare în FileSystem" @@ -2467,9 +2444,6 @@ msgstr "Încarcă o resursă existentă de pe disc si editeaz-o." msgid "Save the currently edited resource." msgstr "Salvează resursa editată curentă." -msgid "Save As..." -msgstr "Salvează Ca..." - msgid "Copy Resource" msgstr "Copiați Resursa" diff --git a/editor/translations/editor/ru.po b/editor/translations/editor/ru.po index 1dfaac9228..463758931b 100644 --- a/editor/translations/editor/ru.po +++ b/editor/translations/editor/ru.po @@ -165,13 +165,15 @@ # Daniil Zimchuk <danrus228zk@gmail.com>, 2023. # Иван Жиляк <zilakivan2008@gmail.com>, 2023. # Ilia Brykin <brykin.ilia@gmail.com>, 2023. +# Ruslan <vovavalenkov15@gmail.com>, 2023. +# DLushin <dmiyashyt@gmail.com>, 2023. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor interface\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-11-10 13:46+0000\n" -"Last-Translator: Ilia Brykin <brykin.ilia@gmail.com>\n" +"PO-Revision-Date: 2023-11-28 04:14+0000\n" +"Last-Translator: DLushin <dmiyashyt@gmail.com>\n" "Language-Team: Russian <https://hosted.weblate.org/projects/godot-engine/" "godot/ru/>\n" "Language: ru\n" @@ -180,7 +182,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && " "n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" -"X-Generator: Weblate 5.2-dev\n" +"X-Generator: Weblate 5.3-dev\n" msgid "Main Thread" msgstr "Главный поток" @@ -2055,6 +2057,9 @@ msgstr "Разработчики" msgid "Authors" msgstr "Авторы" +msgid "Patrons" +msgstr "Покровители" + msgid "Platinum Sponsors" msgstr "Платиновые спонсоры" @@ -2064,20 +2069,17 @@ msgstr "Золотые спонсоры" msgid "Silver Sponsors" msgstr "Серебряные спонсоры" -msgid "Bronze Sponsors" -msgstr "Бронзовые спонсоры" - -msgid "Mini Sponsors" -msgstr "Мини спонсоры" +msgid "Diamond Members" +msgstr "Члены Алмазного уровня" -msgid "Gold Donors" -msgstr "Золотые доноры" +msgid "Titanium Members" +msgstr "Члены Титанового уровня" -msgid "Silver Donors" -msgstr "Серебряные доноры" +msgid "Platinum Members" +msgstr "Члены Платинового уровня" -msgid "Bronze Donors" -msgstr "Бронзовые доноры" +msgid "Gold Members" +msgstr "Члены золотого уровня" msgid "Donors" msgstr "Доноры" @@ -2943,12 +2945,24 @@ msgstr "Описания методов" msgid "Operator Descriptions" msgstr "Описания операторов" +msgid "Metadata:" +msgstr "Метаданные:" + msgid "Property:" msgstr "Свойство:" +msgid "Method:" +msgstr "Метод:" + msgid "Signal:" msgstr "Сигнал:" +msgid "Theme Item:" +msgstr "Элемент темы:" + +msgid "No description available." +msgstr "Описание недоступно." + msgid "%d match." msgstr "%d совпадение." @@ -3552,16 +3566,6 @@ msgstr "" "Отключение аддона '%s' для предотвращения дальнейших ошибок." msgid "" -"Unable to load addon script from path: '%s' Base type is not EditorPlugin." -msgstr "" -"Не удалось загрузить скрипт из источника: '%s' Базовый тип не EditorPlugin." - -msgid "Unable to load addon script from path: '%s' Script is not in tool mode." -msgstr "" -"Не удалось загрузить скрипт аддона из источника: '%s'. Скрипт не в режиме " -"инструмента." - -msgid "" "Scene '%s' was automatically imported, so it can't be modified.\n" "To make changes to it, a new inherited scene can be created." msgstr "" @@ -3767,6 +3771,9 @@ msgstr "Инструменты" msgid "Orphan Resource Explorer..." msgstr "Обзор ресурсов-сирот..." +msgid "Upgrade Mesh Surfaces..." +msgstr "Обновление сетчатых поверхностей..." + msgid "Reload Current Project" msgstr "Перезагрузить текущий проект" @@ -3850,7 +3857,7 @@ msgid "Choose a renderer." msgstr "Выберите отрисовщик." msgid "Forward+" -msgstr "Вперед+" +msgstr "Forward+" msgid "Mobile" msgstr "Мобильные устройства" @@ -4079,6 +4086,12 @@ msgstr "" msgid "Assign..." msgstr "Устанавливать.." +msgid "Copy as Text" +msgstr "Копировать как текст" + +msgid "Show Node in Tree" +msgstr "Показать узел в дереве" + msgid "Invalid RID" msgstr "Неверный RID" @@ -4167,6 +4180,9 @@ msgstr "Сделать уникальным" msgid "Make Unique (Recursive)" msgstr "Сделать уникальным (рекурсивно)" +msgid "Save As..." +msgstr "Сохранить как..." + msgid "Show in FileSystem" msgstr "Показать в файловой системе" @@ -4640,6 +4656,9 @@ msgstr "Удалить пресет '%s'?" msgid "Resources to exclude:" msgstr "Исключаемые ресурсы:" +msgid "Resources to override export behavior:" +msgstr "Ресурсы для изменения поведения экспорта:" + msgid "Resources to export:" msgstr "Ресурсы для экспорта:" @@ -4942,6 +4961,9 @@ msgstr "Дублирование папки:" msgid "New Inherited Scene" msgstr "Новая вложенная сцена" +msgid "Set as Main Scene" +msgstr "Установить как основную сцену" + msgid "Open Scenes" msgstr "Открыть сцены" @@ -5053,6 +5075,33 @@ msgstr "Переименовать..." msgid "Open in External Program" msgstr "Открыть во внешней программе" +msgid "Red" +msgstr "Красный" + +msgid "Orange" +msgstr "Оранжевый" + +msgid "Yellow" +msgstr "Желтый" + +msgid "Green" +msgstr "Зеленый" + +msgid "Teal" +msgstr "Бирюзовый" + +msgid "Blue" +msgstr "Синий" + +msgid "Purple" +msgstr "Фиолетовый" + +msgid "Pink" +msgstr "Розовый" + +msgid "Gray" +msgstr "Серый" + msgid "Go to previous selected folder/file." msgstr "Перейти к предыдущей выбранной папке/файлу." @@ -5062,6 +5111,9 @@ msgstr "Перейти к следующей выбранной папке/фа msgid "Re-Scan Filesystem" msgstr "Пересканировать файловую систему" +msgid "Change Split Mode" +msgstr "Изменить режим разделения" + msgid "Filter Files" msgstr "Фильтр файлов" @@ -5680,15 +5732,6 @@ msgstr "Динамически отображаемый шрифт TrueType/Open msgid "Prerendered multichannel(+true) signed distance field" msgstr "Предрендерное многоканальное (+true) подписанное поле расстояния" -msgid "Can't load font texture:" -msgstr "Не удаётся загрузить текстуру шрифта:" - -msgid "Image margin too big." -msgstr "Поля изображения слишком большие." - -msgid "Character margin too big." -msgstr "Слишком большой отступ символов." - msgid "Pre-Import Scene" msgstr "Предварительно импортировать сцену" @@ -6059,9 +6102,6 @@ msgstr "Загрузить существующий ресурс с диска msgid "Save the currently edited resource." msgstr "Сохранить текущий редактируемый ресурс." -msgid "Save As..." -msgstr "Сохранить как..." - msgid "Extra resource options." msgstr "Дополнительные параметры ресурса." @@ -6678,6 +6718,10 @@ msgstr "[Глобальная] (создать)" msgid "Duplicated Animation Name:" msgstr "Повторяющееся имя анимации:" +msgid "Onion skinning requires a RESET animation." +msgstr "" +"Для использования \"onion skinning\" необходима анимация с сбросом (RESET)." + msgid "Play selected animation backwards from current pos. (A)" msgstr "" "Воспроизвести выбранную анимацию в обратном направлении с текущей позиции. (A)" @@ -7819,6 +7863,19 @@ msgstr "" "Когда эта опция включена, формы, радиус и скорости объектов избегания будут " "видны в работающем проекте." +msgid "Debug CanvasItem Redraws" +msgstr "Отладочная перерисовка элемента холста" + +msgid "" +"When this option is enabled, redraw requests of 2D objects will become " +"visible (as a short flash) in the running project.\n" +"This is useful to troubleshoot low processor mode." +msgstr "" +"Когда эта опция включена, запросы на перерисовку 2D объектов становятся " +"видимыми (как короткое вспышки) в работающем проекте.\n" +"Это полезно для устранения неполадок в режиме низкой производительности " +"процессора." + msgid "Synchronize Scene Changes" msgstr "Синхронизация изменений в сценах" @@ -8188,6 +8245,9 @@ msgstr "Создать меш навигации" msgid "Create Debug Tangents" msgstr "Отладка генерации касательной" +msgid "No mesh to unwrap." +msgstr "Нет сетки для распаковки." + msgid "" "Mesh cannot unwrap UVs because it does not belong to the edited scene. Make " "it unique first." @@ -8216,6 +8276,15 @@ msgstr "Развернуть UV2" msgid "Contained Mesh is not of type ArrayMesh." msgstr "Содержимое меша не типа ArrayMesh." +msgid "Can't unwrap mesh with blend shapes." +msgstr "Невозможно распаковать сетку с формами смешивания (blend shapes)." + +msgid "Only triangles are supported for lightmap unwrap." +msgstr "Поддерживаются только треугольники для распаковки карты освещения." + +msgid "Normals are required for lightmap unwrap." +msgstr "Для распаковки карты освещения требуются нормали." + msgid "UV Unwrap failed, mesh may not be manifold?" msgstr "UV развертка не удалась, возможно у меша не односвязная форма?" @@ -9944,6 +10013,12 @@ msgstr "Создать LightOccluder2D" msgid "LightOccluder2D Preview" msgstr "Предпросмотр LightOccluder2D" +msgid "Can't convert a sprite from a foreign scene." +msgstr "Невозможно преобразовать спрайт из другой сцены." + +msgid "Can't convert an empty sprite to mesh." +msgstr "Невозможно преобразовать пустой спрайт в меш." + msgid "Can't convert a sprite using animation frames to mesh." msgstr "" "Не удаётся преобразовать спрайт использующий анимационные кадры в сетку." @@ -13667,9 +13742,19 @@ msgstr "" "Отключение параметра \"editable_instance\" приведет к тому, что все свойства " "узла будут возвращены к значениям по умолчанию." +msgid "" +"Enabling \"Load as Placeholder\" will disable \"Editable Children\" and cause " +"all properties of the node to be reverted to their default." +msgstr "" +"Включение \"Загружать как заполнитель\" отключит \"Редактируемых дочерних " +"элементов\" и приведет к возврату всех свойств узла к значениям по умолчанию." + msgid "Make Local" msgstr "Сделать локальным" +msgid "Can't toggle unique name for nodes in subscene!" +msgstr "Нельзя переключить уникальное имя для узлов в подсцене!" + msgid "Enable Scene Unique Name(s)" msgstr "Включить уникальные имена сцен" @@ -13722,16 +13807,6 @@ msgstr "Удалить узел(узлы)" msgid "Change type of node(s)" msgstr "Изменить тип узла(ов)" -msgid "Removing the node from variable \"%s\" on node \"%s\"." -msgstr "Удаление узла из переменной \"%s\" на узле \"%s\"." - -msgid "" -"The node's new type is incompatible with an exported variable (expected %s, " -"but type is %s)." -msgstr "" -"Новый тип узла несовместим с экспортируемой переменной (ожидается %s, но тип " -"- %s)." - msgid "This operation requires a single selected node." msgstr "Эта операция требует одного выбранного узла." @@ -13766,6 +13841,9 @@ msgstr "Очистить наследование" msgid "Editable Children" msgstr "Редактируемые потомки" +msgid "Load as Placeholder" +msgstr "Загрузить как заполнитель" + msgid "Auto Expand to Selected" msgstr "Авто-раскрыть дерево до выбранного элемента" @@ -14066,6 +14144,15 @@ msgstr "Имя '%s' является зарезервированным слов msgid "Add Shader Global Parameter" msgstr "Добавить глобальный параметр шейдера" +msgid "Upgrading All Meshes in Project" +msgstr "Обновление всех сеток в проекте" + +msgid "Attempting to re-save " +msgstr "Попытка повторного сохранения " + +msgid "Restart & Upgrade" +msgstr "Перезапустить и обновить" + msgid "Make this panel floating in the screen %d." msgstr "Сделать эту панель плавающей на экране %d." @@ -14096,6 +14183,9 @@ msgstr "" "Недопустимое значение аргумента type для convert(), используйте константы " "TYPE_*." +msgid "Cannot resize array." +msgstr "Невозможно изменить размер массива." + msgid "Step argument is zero!" msgstr "Аргумент шага равен нулю!" @@ -14121,6 +14211,9 @@ msgstr "Недопустимый формат экземпляра словар msgid "Invalid instance dictionary (invalid subclasses)" msgstr "Недопустимый экземпляр словаря (неверные подклассы)" +msgid "Cannot instantiate GDScript class." +msgstr "Невозможно создать экземпляр класса GDScript." + msgid "Value of type '%s' can't provide a length." msgstr "Значение типа '%s' не может иметь длину." @@ -14326,6 +14419,9 @@ msgstr "Прямое освещение участка" msgid "Integrate indirect lighting" msgstr "Интегрировать непрямое освещение" +msgid "Integrate indirect lighting %d%%" +msgstr "Интегрировать непрямое освещение %d%%" + msgid "Baking lightprobes" msgstr "Запекание карт освещения" @@ -14744,6 +14840,9 @@ msgstr "Не удалось выполнить на устройстве." msgid "Exporting to Android when using C#/.NET is experimental." msgstr "Экспорт в Android при использовании C#/.NET является экспериментальным." +msgid "Android architecture %s not supported in C# projects." +msgstr "Архитектура Android %s не поддерживается в проектах на C#." + msgid "" "Android build template not installed in the project. Install it from the " "Project menu." @@ -14902,23 +15001,14 @@ msgstr "Не удалось записать расширение файла п msgid "Building Android Project (gradle)" msgstr "Сборка проекта Android (gradle)" -msgid "" -"Building of Android project failed, check output for the error. Alternatively " -"visit docs.godotengine.org for Android build documentation." -msgstr "" -"Сборка Android проекта не удалась, проверьте вывод на ошибки. Вы также можете " -"посетить docs.godotengine.org для получения документации по сборке для " -"Android." +msgid "Building of Android project failed, check output for the error:" +msgstr "Сборка проекта Android не удалась, проверьте вывод для ошибки:" msgid "Moving output" msgstr "Перемещение выходных данных" -msgid "" -"Unable to copy and rename export file, check gradle project directory for " -"outputs." -msgstr "" -"Невозможно скопировать и переименовать файл экспорта, проверьте каталог " -"проекта gradle на наличие выходных данных." +msgid "Unable to copy and rename export file:" +msgstr "Не удается скопировать и переименовать файл экспорта:" msgid "Package not found: \"%s\"." msgstr "Пакет не найден: \"%s\"." @@ -14991,6 +15081,14 @@ msgstr "" "Пакет .ipa может быть собран только на macOS. Выход из проекта Xcode без " "сборки пакета." +msgid "Exporting to iOS when using C#/.NET is experimental and requires macOS." +msgstr "" +"Экспорт в iOS при использовании C#/.NET является экспериментальным и требует " +"наличия macOS." + +msgid "Exporting to iOS when using C#/.NET is experimental." +msgstr "Экспорт в iOS при использовании C#/.NET является экспериментальным." + msgid "Identifier is missing." msgstr "Отсутствует определитель." @@ -15159,6 +15257,13 @@ msgstr "" msgid "App sandbox is required for App Store distribution." msgstr "Требуется приложение-песочница для распространения в App Store." +msgid "" +"'rcodesign' doesn't support signing applications with embedded dynamic " +"libraries (GDExtension or .NET)." +msgstr "" +"'rcodesign' не поддерживает подписывание приложений с встроенными " +"динамическими библиотеками (GDExtension или .NET)." + msgid "Code signing is required for App Store distribution." msgstr "Подписание кода требуется для распространения в App Store." @@ -15361,6 +15466,13 @@ msgstr "" "Для подписанных ad-hoc приложений требуется право 'Отключить проверку " "библиотеки' для загрузки динамических библиотек." +msgid "" +"'rcodesign' doesn't support signing applications with embedded dynamic " +"libraries." +msgstr "" +"'rcodesign' не поддерживает подписывание приложений с встроенными " +"динамическими библиотеками." + msgid "Could not create entitlements file." msgstr "Не удалось создать файл прав." @@ -15833,6 +15945,17 @@ msgstr "" "самом узле TileMap." msgid "" +"The TileMap node is set as Y-sorted, but Y-sort is not enabled on any of the " +"TileMap's layers.\n" +"This may lead to unwanted behaviors, as a layer that is not Y-sorted will be " +"Y-sorted as a whole." +msgstr "" +"Узел TileMap установлен как сортированный по Y, но сортировка по Y не " +"включена ни на одном из слоев TileMap.\n" +"Это может привести к нежелательным поведениям, поскольку слой, который не " +"сортируется по Y, будет сортироваться по Y в целом." + +msgid "" "Isometric TileSet will likely not look as intended without Y-sort enabled for " "the TileMap and all of its layers." msgstr "" @@ -16480,6 +16603,14 @@ msgid "Automatically arrange selected nodes." msgstr "Автоматически располагать выбранные узлы." msgid "" +"Labels with autowrapping enabled must have a custom minimum size configured " +"to work correctly inside a container." +msgstr "" +"Этикетки с включенной автоматической переноской должны иметь настроенный " +"пользовательский минимальный размер, чтобы правильно работать внутри " +"контейнера." + +msgid "" "The current font does not support rendering one or more characters used in " "this Label's text." msgstr "" @@ -16612,15 +16743,6 @@ msgstr "" "сохранены повторно без риска потери данных." msgid "" -"Setting node name '%s' to be unique within scene for '%s', but it's already " -"claimed by '%s'.\n" -"'%s' is no longer set as having a unique name." -msgstr "" -"Установлено уникальное имя узла '%s' в пределах сцены для '%s', но оно уже " -"занято '%s'.\n" -"'%s' больше не устанавливается как имеющий уникальное имя." - -msgid "" "This node is marked as deprecated and will be removed in future versions.\n" "Please check the Godot documentation for information about migration." msgstr "" @@ -16635,13 +16757,6 @@ msgstr "" "изменён в следующих версиях." msgid "" -"Default Environment as specified in the project setting \"rendering/" -"environment/defaults/default_environment\" could not be loaded." -msgstr "" -"Не удалось загрузить окружение по умолчанию, указанное в настройке проекта " -"\"rendering/environment/defaults/default_environment\"." - -msgid "" "ShaderGlobalsOverride is not active because another node of the same type is " "in the scene." msgstr "" @@ -16667,27 +16782,6 @@ msgstr "" "Размер области просмотра должен быть больше или равен 2 пикселям в обоих " "измерениях, чтобы отобразить что-либо." -msgid "Cannot open font from file: %s." -msgstr "Невозможно открыть шрифт из файла: %s." - -msgid "Version %d of BMFont is not supported (should be 3)." -msgstr "Версия %d BMFont не поддерживается (должно быть 3)." - -msgid "Invalid BMFont info block size." -msgstr "Неверный размер блока информации BMFont." - -msgid "Invalid BMFont common block size." -msgstr "Неверный размер общего блока BMFont." - -msgid "Can't load font texture: %s." -msgstr "Не удается загрузить текстуру шрифта: %s." - -msgid "Unsupported BMFont texture format." -msgstr "Неподдерживаемый формат текстуры BMFont." - -msgid "Invalid BMFont block type." -msgstr "Неверный тип блока BMFont." - msgid "" "An incoming node's name clashes with %s already in the scene (presumably, " "from a more nested instance).\n" diff --git a/editor/translations/editor/sk.po b/editor/translations/editor/sk.po index 5690d513eb..b9a8a693c4 100644 --- a/editor/translations/editor/sk.po +++ b/editor/translations/editor/sk.po @@ -17,13 +17,15 @@ # Tengado <tenda151002@gmail.com>, 2023. # Lukáš Ševc <sevclukas0@gmail.com>, 2023. # Milan Šalka <salka.milan@googlemail.com>, 2023. +# Mikuláš Suchanovský <mikulassuchanovsky@protonmail.com>, 2023. +# Ellie Star <gender.thief.star@gmail.com>, 2023. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor interface\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-10-06 12:19+0000\n" -"Last-Translator: Milan Šalka <salka.milan@googlemail.com>\n" +"PO-Revision-Date: 2023-12-02 19:36+0000\n" +"Last-Translator: Ellie Star <gender.thief.star@gmail.com>\n" "Language-Team: Slovak <https://hosted.weblate.org/projects/godot-engine/godot/" "sk/>\n" "Language: sk\n" @@ -31,7 +33,10 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" -"X-Generator: Weblate 5.1-dev\n" +"X-Generator: Weblate 5.3-dev\n" + +msgid "Main Thread" +msgstr "Hlavné vlákno" msgid "Unset" msgstr "Nenastavené" @@ -129,6 +134,9 @@ msgstr "Späť, Sony Select, Xbox Back, Nintendo -" msgid "Guide, Sony PS, Xbox Home" msgstr "Sprievodca, Sony PS, Xbox Home" +msgid "Start, Xbox Menu, Nintendo +" +msgstr "Štart, Xbox Menu, Nintendo +" + msgid "Left Stick, Sony L3, Xbox L/LS" msgstr "Ľavá páčka, Sony L3, Xbox L/LS" @@ -153,12 +161,30 @@ msgstr "D-pad vľavo" msgid "D-pad Right" msgstr "D-pad vpravo" +msgid "Xbox Share, PS5 Microphone, Nintendo Capture" +msgstr "Xbox zdieľanie, PS5 mikrofón, Nintendo záznam" + +msgid "Xbox Paddle 1" +msgstr "Xbox pádlo 1" + +msgid "Xbox Paddle 2" +msgstr "Xbox pádlo 2" + +msgid "Xbox Paddle 3" +msgstr "Xbox pádlo 3" + +msgid "Xbox Paddle 4" +msgstr "Xbox pádlo 4" + msgid "PS4/5 Touchpad" msgstr "PS4/5 Touchpad" msgid "Joypad Button %d" msgstr "Joypad Tlačidlo %d" +msgid "Pressure:" +msgstr "Tlak:" + msgid "canceled" msgstr "zrušený" @@ -185,6 +211,9 @@ msgstr "Gesto presúvania na (%s) s deltou (%s)" msgid "MIDI Input on Channel=%s Message=%s" msgstr "Vstup MIDI na Kanále=%s Správa=%s" +msgid "Input Event with Shortcut=%s" +msgstr "Vstupná udalosť so skratkou=%s" + msgid "Accept" msgstr "Potvrdiť" @@ -194,6 +223,12 @@ msgstr "Zvoliť" msgid "Cancel" msgstr "Zrušiť" +msgid "Focus Next" +msgstr "Zamerať ďalšie" + +msgid "Focus Prev" +msgstr "Zamerať predchádzajúce" + msgid "Left" msgstr "Vľavo" @@ -233,6 +268,9 @@ msgstr "Späť" msgid "Redo" msgstr "Prerobiť" +msgid "Completion Query" +msgstr "Dotaz na dokončenie" + msgid "New Line" msgstr "Nový riadok" @@ -248,6 +286,9 @@ msgstr "Odsadenie" msgid "Dedent" msgstr "Zmazať odsadenie" +msgid "Backspace" +msgstr "Backspace" + msgid "Backspace Word" msgstr "Zmazať slovo naľavo" @@ -320,6 +361,15 @@ msgstr "Označiť slovo pod kurzorom" msgid "Add Selection for Next Occurrence" msgstr "Pridať ďalší výskyt do označenia" +msgid "Clear Carets and Selection" +msgstr "Vyčistiť vsuvky a výber" + +msgid "Toggle Insert Mode" +msgstr "Prepnúť mód vloženia" + +msgid "Submit Text" +msgstr "Odoslať text" + msgid "Duplicate Nodes" msgstr "Duplikovať Nody" @@ -335,6 +385,12 @@ msgstr "Obnoviť" msgid "Show Hidden" msgstr "Zobraziť Skryté" +msgid "Swap Input Direction" +msgstr "Prevrátiť smer vstupu" + +msgid "Invalid input %d (not passed) in expression" +msgstr "Nesprávny vstup %d (neprešiel) vo výraze" + msgid "self can't be used because instance is null (not passed)" msgstr "self nemôže byť použité, pretože inštancia je null (nie je platná)" @@ -402,6 +458,9 @@ msgstr "Akcia s názvom '%s' už existuje." msgid "Cannot Revert - Action is same as initial" msgstr "Nie je možný návrat - akcia je rovnaká ako počiatočná" +msgid "Revert Action" +msgstr "Vrátiť akciu" + msgid "Add Event" msgstr "Pridať udalosť" @@ -420,6 +479,9 @@ msgstr "Odstrániť Udalosť" msgid "Filter by name..." msgstr "Filtrovať podľa názvu..." +msgid "Clear All" +msgstr "Vyčistiť všetko" + msgid "Add New Action" msgstr "Pridať Novú Akciu" @@ -441,6 +503,9 @@ msgstr "Čas:" msgid "Value:" msgstr "Hodnota:" +msgid "Update Selected Key Handles" +msgstr "Upraviť vybrané rukoväte kľúčov" + msgid "Insert Key Here" msgstr "Tu vložte kľúč" @@ -450,6 +515,15 @@ msgstr "Duplikovať kľúč(e)" msgid "Delete Selected Key(s)" msgstr "Zmazať označené kľúč(e)" +msgid "Make Handles Free" +msgstr "Uvoľniť rukoväte" + +msgid "Make Handles Linear" +msgstr "Spraviť rukoväte lineárne" + +msgid "Make Handles Balanced" +msgstr "Spraviť rukoväte balancované" + msgid "Add Bezier Point" msgstr "Pridať Bezier bod" @@ -1490,21 +1564,6 @@ msgstr "Zlatý Sponzori" msgid "Silver Sponsors" msgstr "Strieborný Sponzori" -msgid "Bronze Sponsors" -msgstr "Bronzový Sponzori" - -msgid "Mini Sponsors" -msgstr "Malý Sponzori" - -msgid "Gold Donors" -msgstr "Zlatý Darcovia" - -msgid "Silver Donors" -msgstr "Strieborný Darcovia" - -msgid "Bronze Donors" -msgstr "Bronzový Darcovia" - msgid "Donors" msgstr "Darcovia" @@ -2796,15 +2855,6 @@ msgstr "" "Deaktivujem addon z '%s', aby sa predišlo ďalším chybám." msgid "" -"Unable to load addon script from path: '%s' Base type is not EditorPlugin." -msgstr "" -"Nepodarilo sa načítať addon script z cesty: '%s' Base type není EditorPlugin." - -msgid "Unable to load addon script from path: '%s' Script is not in tool mode." -msgstr "" -"Nepodarilo sa načítať addon script z cesty: '%s' Script není v tool móde." - -msgid "" "Scene '%s' was automatically imported, so it can't be modified.\n" "To make changes to it, a new inherited scene can be created." msgstr "" @@ -3245,6 +3295,9 @@ msgstr "Rýchle načítanie" msgid "Make Unique" msgstr "Spraviť Jedinečným" +msgid "Save As..." +msgstr "Uložiť Ako..." + msgid "Show in FileSystem" msgstr "Ukázať v FileSystéme" @@ -4294,9 +4347,6 @@ msgstr "Načítať existujúci prostriedok z disku a upraviť ho." msgid "Save the currently edited resource." msgstr "Uložiť aktuálne upravený prostriedok." -msgid "Save As..." -msgstr "Uložiť Ako..." - msgid "Copy Resource" msgstr "Skopírovať Prostriedok" @@ -7462,15 +7512,6 @@ msgstr "" "straty dát." msgid "" -"Setting node name '%s' to be unique within scene for '%s', but it's already " -"claimed by '%s'.\n" -"'%s' is no longer set as having a unique name." -msgstr "" -"Nastavenie názvu nodu '%s', aby bol jedinečným v scéne '%s', ale názov už je " -"nárokovaný '%s'.\n" -"'%s' už nie je nastavený ako s jedinečným názvom." - -msgid "" "This node is marked as deprecated and will be removed in future versions.\n" "Please check the Godot documentation for information about migration." msgstr "" @@ -7491,9 +7532,6 @@ msgstr "" "ShaderGlobalsOverride nie je aktívny, pretože iný node rovnakého typu je v " "scéne." -msgid "Cannot open font from file: %s." -msgstr "Nedá sa otvoriť font zo súboru: %s." - msgid "" "An incoming node's name clashes with %s already in the scene (presumably, " "from a more nested instance).\n" diff --git a/editor/translations/editor/sv.po b/editor/translations/editor/sv.po index 0fc8020a04..31dcbf5ca4 100644 --- a/editor/translations/editor/sv.po +++ b/editor/translations/editor/sv.po @@ -38,8 +38,8 @@ msgstr "" "Project-Id-Version: Godot Engine editor interface\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-11-03 04:56+0000\n" -"Last-Translator: Henrik Nilsson <nsmoooose@gmail.com>\n" +"PO-Revision-Date: 2023-12-06 04:32+0000\n" +"Last-Translator: Kristoffer Grundström <swedishsailfishosuser@tutanota.com>\n" "Language-Team: Swedish <https://hosted.weblate.org/projects/godot-engine/" "godot/sv/>\n" "Language: sv\n" @@ -47,7 +47,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.2-dev\n" +"X-Generator: Weblate 5.3-dev\n" msgid "Main Thread" msgstr "Huvudtråd" @@ -967,6 +967,12 @@ msgstr "Importerad Scen" msgid "Warning: Editing imported animation" msgstr "Varning: Redigerar importerad animation" +msgid "Inactive Player" +msgstr "Inaktiv spelare" + +msgid "Warning: AnimationPlayer is inactive" +msgstr "Varning: Animationsspelaren är inaktiv" + msgid "Toggle between the bezier curve editor and track editor." msgstr "Växla mellan redigeringen av bezierkurvor och spårredigeringen." @@ -1107,6 +1113,10 @@ msgid "Elastic" msgstr "Elastisk" msgctxt "Transition Type" +msgid "Cubic" +msgstr "Kubisk" + +msgctxt "Transition Type" msgid "Circ" msgstr "Cirkulär" @@ -1280,6 +1290,12 @@ msgstr "Filtrera metoder" msgid "No method found matching given filters." msgstr "Ingen metod funnen som matchar det givna filtret." +msgid "Script Methods Only" +msgstr "Endast skriptmetoder" + +msgid "Compatible Methods Only" +msgstr "Endast kompatibla metoder" + msgid "Remove" msgstr "Ta bort" @@ -1607,6 +1623,9 @@ msgstr "Stack Frames" msgid "Filter Stack Variables" msgstr "Filtrera stackvariabler" +msgid "Expand All" +msgstr "Expandera alla" + msgid "Profiler" msgstr "Profiler" @@ -1619,6 +1638,9 @@ msgstr "Lista över Videominnes-användning av Resource:" msgid "Total:" msgstr "Totalt:" +msgid "Export list to a CSV file" +msgstr "Exportera lista till en CSV-fil" + msgid "Resource Path" msgstr "Resource Path" @@ -1767,6 +1789,21 @@ msgstr "Resurser Utan Explicit Ägande:" msgid "Folder name cannot be empty." msgstr "Katalognamnet kan inte vara tomt." +msgid "Folder name contains invalid characters." +msgstr "Mappnamnet innehåller ogiltiga tecken." + +msgid "Folder name cannot begin or end with a space." +msgstr "Mappens namn kan inte börja eller sluta med ett mellanslag." + +msgid "Folder name cannot begin with a dot." +msgstr "Namnet på mappen kan inte börja med en punkt." + +msgid "File with that name already exists." +msgstr "Fil med det där namnet existerar redan." + +msgid "Folder with that name already exists." +msgstr "Mapp med det där namnet existerar redan." + msgid "Using slashes in folder names will create subfolders recursively." msgstr "Användandet av snedstreck i mappnamn skapar undermappar rekursivt." @@ -1779,6 +1816,9 @@ msgstr "Skapa ny katalog i %s:" msgid "Create Folder" msgstr "Skapa Mapp" +msgid "Folder name is valid." +msgstr "Mapp-namnet är ogiltigt." + msgid "Thanks from the Godot community!" msgstr "Tack från Godot-gemenskapen!" @@ -1794,6 +1834,10 @@ msgstr "Projektgrundare" msgid "Lead Developer" msgstr "Ledande utvecklare" +msgctxt "Job Title" +msgid "Project Manager" +msgstr "Projektledare" + msgid "Developers" msgstr "Utvecklare" @@ -1809,20 +1853,17 @@ msgstr "Guldsponsorer" msgid "Silver Sponsors" msgstr "Silverdonatorer" -msgid "Bronze Sponsors" -msgstr "Bronsdonatorer" +msgid "Diamond Members" +msgstr "Diamantmedlemmar" -msgid "Mini Sponsors" -msgstr "Minisponsorer" +msgid "Titanium Members" +msgstr "Titanium-medlemmar" -msgid "Gold Donors" -msgstr "Gulddonatorer" +msgid "Platinum Members" +msgstr "Platinum-medlemmar" -msgid "Silver Donors" -msgstr "Silverdonatorer" - -msgid "Bronze Donors" -msgstr "Bronsdonatorer" +msgid "Gold Members" +msgstr "Guld-medlemmar" msgid "Donors" msgstr "Donatorer" @@ -2049,6 +2090,9 @@ msgstr "Skapa en ny Buss-Layout." msgid "Invalid name." msgstr "Ogiltigt namn." +msgid "Cannot begin with a digit." +msgstr "Kan inte börja med en siffra." + msgid "Valid characters:" msgstr "Giltiga tecken:" @@ -2127,6 +2171,9 @@ msgstr "XR" msgid "RenderingDevice" msgstr "Renderare" +msgid "OpenGL" +msgstr "OpenGL" + msgid "Vulkan" msgstr "Vulkan" @@ -2237,6 +2284,9 @@ msgstr "Profil:" msgid "Reset to Defaults" msgstr "Återställ till standardvärden" +msgid "Detect from Project" +msgstr "Upptäck från projekt" + msgid "Actions:" msgstr "Åtgärder:" @@ -2605,6 +2655,9 @@ msgstr "Typsnittsstorlekar" msgid "Icons" msgstr "Ikoner" +msgid "Styles" +msgstr "Stilar" + msgid "Enumerations" msgstr "Enumerationer" @@ -2646,12 +2699,24 @@ msgstr "Metodbeskrivning" msgid "Operator Descriptions" msgstr "Operator beskrivning" +msgid "Metadata:" +msgstr "Metadata:" + msgid "Property:" msgstr "Egenskap:" +msgid "Method:" +msgstr "Metod:" + msgid "Signal:" msgstr "Signal:" +msgid "Theme Item:" +msgstr "Tema-objekt:" + +msgid "No description available." +msgstr "Ingen beskrivning tillgänglig." + msgid "%d match." msgstr "%d matcha." @@ -2676,6 +2741,9 @@ msgstr "Endast Metoder" msgid "Signals Only" msgstr "Endast Signaler" +msgid "Annotations Only" +msgstr "Endast annoteringar" + msgid "Constants Only" msgstr "Enbart konstanter" @@ -3154,15 +3222,6 @@ msgstr "" "Stänger av addon vid '%s' för att förhindra fler fel." msgid "" -"Unable to load addon script from path: '%s' Base type is not EditorPlugin." -msgstr "" -"Kunde inte ladda addon script från sökväg: '%s' Bastyp är inte EditorPlugin." - -msgid "Unable to load addon script from path: '%s' Script is not in tool mode." -msgstr "" -"Kunde inte ladda addon script från sökväg: '%s' Skript är inte i verktygsläge." - -msgid "" "Scene '%s' was automatically imported, so it can't be modified.\n" "To make changes to it, a new inherited scene can be created." msgstr "" @@ -3539,6 +3598,9 @@ msgstr "Lokaliserbar sträng (storlek %d)" msgid "Make Unique" msgstr "Gör Unik" +msgid "Save As..." +msgstr "Spara Som..." + msgid "Show in FileSystem" msgstr "Visa i filsystemet" @@ -4336,12 +4398,6 @@ msgstr "Konfiguration:" msgid "Add configuration" msgstr "Lägg till konfiguration" -msgid "Image margin too big." -msgstr "Bildmarginal för stor." - -msgid "Character margin too big." -msgstr "Teckenmarginal för stor." - msgid "Import Scene" msgstr "Importera Scen" @@ -4486,9 +4542,6 @@ msgstr "Ladda en befintlig resurs från disken och redigera den." msgid "Save the currently edited resource." msgstr "Spara den nuvarande redigerade resursen." -msgid "Save As..." -msgstr "Spara Som..." - msgid "Copy Resource" msgstr "Kopiera Resurs" @@ -7408,12 +7461,6 @@ msgstr "Infoga kontroltecken" msgid "(Other)" msgstr "(Annat)" -msgid "Cannot open font from file: %s." -msgstr "Kan inte öppna typsnitt från fil: %s." - -msgid "Invalid BMFont block type." -msgstr "Ogiltig BMFont blocktyp." - msgid "" "Shader keywords cannot be used as parameter names.\n" "Choose another name." diff --git a/editor/translations/editor/th.po b/editor/translations/editor/th.po index 1455e1a246..cce2c863be 100644 --- a/editor/translations/editor/th.po +++ b/editor/translations/editor/th.po @@ -1361,21 +1361,6 @@ msgstr "ผู้สนับสนุนระดับทอง" msgid "Silver Sponsors" msgstr "ผู้บริจาคระดับเงิน" -msgid "Bronze Sponsors" -msgstr "ผู้บริจาคระดับทองแดง" - -msgid "Mini Sponsors" -msgstr "ผู้สนับสนุน" - -msgid "Gold Donors" -msgstr "ผู้บริจาคระดับทอง" - -msgid "Silver Donors" -msgstr "ผู้บริจาคระดับเงิน" - -msgid "Bronze Donors" -msgstr "ผู้บริจาคระดับทองแดง" - msgid "Donors" msgstr "ผู้บริจาค" @@ -2081,13 +2066,6 @@ msgid "Unable to load addon script from path: '%s'." msgstr "ไม่สามารถโหลดสคริปต์จาก: '%s'" msgid "" -"Unable to load addon script from path: '%s' Base type is not EditorPlugin." -msgstr "ไม่สามารถโหลดสคริปต์จาก: '%s' ไม่ได้สืบทอดจาก EditorPlugin" - -msgid "Unable to load addon script from path: '%s' Script is not in tool mode." -msgstr "ไม่สามารถโหลดสคริปต์จาก: '%s' ไม่ใช่สคริปต์ tool" - -msgid "" "Scene '%s' was automatically imported, so it can't be modified.\n" "To make changes to it, a new inherited scene can be created." msgstr "" @@ -2450,6 +2428,9 @@ msgstr "ทรัพยากรที่เลือก (%s) มีประเ msgid "Make Unique" msgstr "ไม่ใช้ร่วมกับวัตถุอื่น" +msgid "Save As..." +msgstr "บันทึกเป็น..." + msgid "Show in FileSystem" msgstr "แสดงในรูปแบบไฟล์" @@ -3108,9 +3089,6 @@ msgstr "โหลดรีซอร์สที่มีอยู่แล้ว msgid "Save the currently edited resource." msgstr "บันทึกรีซอร์สที่กำลังปรับแต่ง" -msgid "Save As..." -msgstr "บันทึกเป็น..." - msgid "Copy Resource" msgstr "คัดลอกรีซอร์ส" @@ -6787,12 +6765,6 @@ msgstr "กำลังสร้างโปรเจคแอนดรอยด msgid "Moving output" msgstr "กำลังย้ายเอาต์พุต" -msgid "" -"Unable to copy and rename export file, check gradle project directory for " -"outputs." -msgstr "" -"ไม่สามารถคัดลอกและเปลี่ยนชื่อไฟล์ส่งออก ตรวจสอบไดเร็กทอรีโปรเจ็กต์ gradle สำหรับเอาต์พุต" - msgid "Aligning APK..." msgstr "จัดเรียง APK..." diff --git a/editor/translations/editor/tr.po b/editor/translations/editor/tr.po index 5b8273ed28..995b00ab25 100644 --- a/editor/translations/editor/tr.po +++ b/editor/translations/editor/tr.po @@ -105,12 +105,13 @@ # Yusuf <yusufdundar92@gmail.com>, 2023. # Ufuk SARIALTIN <sarialtinufuk@gmail.com>, 2023. # Caner Özer <canerozer44@gmail.com>, 2023. +# yiid <tunayigit026@gmail.com>, 2023. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor interface\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-10-17 06:43+0000\n" +"PO-Revision-Date: 2023-12-11 09:59+0000\n" "Last-Translator: Yılmaz Durmaz <yilmaz_durmaz@hotmail.com>\n" "Language-Team: Turkish <https://hosted.weblate.org/projects/godot-engine/" "godot/tr/>\n" @@ -119,7 +120,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.1\n" +"X-Generator: Weblate 5.3-dev\n" msgid "Main Thread" msgstr "Ana İş Parçası" @@ -1987,6 +1988,9 @@ msgstr "Geliştiriciler" msgid "Authors" msgstr "Yazarlar" +msgid "Patrons" +msgstr "Velinimetler" + msgid "Platinum Sponsors" msgstr "Platin Sponsorlar" @@ -1996,20 +2000,17 @@ msgstr "Altın Sponsorlar" msgid "Silver Sponsors" msgstr "Gümüş Bağışçılar" -msgid "Bronze Sponsors" -msgstr "Bronz Bağışçılar" - -msgid "Mini Sponsors" -msgstr "Mini Sponsorlar" +msgid "Diamond Members" +msgstr "Elmas Üyeler" -msgid "Gold Donors" -msgstr "Altın Bağışçılar" +msgid "Titanium Members" +msgstr "Titanyum Üyeler" -msgid "Silver Donors" -msgstr "Gümüş Bağışçılar" +msgid "Platinum Members" +msgstr "Platin Üyeler" -msgid "Bronze Donors" -msgstr "Bronz Bağışçılar" +msgid "Gold Members" +msgstr "Altın Üyeler" msgid "Donors" msgstr "Bağışçılar" @@ -2884,12 +2885,24 @@ msgstr "Yöntem Tanımlamaları" msgid "Operator Descriptions" msgstr "İşleç Tanımlamaları" +msgid "Metadata:" +msgstr "Metaveri:" + msgid "Property:" msgstr "Özellik:" +msgid "Method:" +msgstr "Yöntem:" + msgid "Signal:" msgstr "Sinyal:" +msgid "Theme Item:" +msgstr "Tema Öğesi:" + +msgid "No description available." +msgstr "Tanımlama mevcut değil." + msgid "%d match." msgstr "%d eşleşme." @@ -3495,12 +3508,12 @@ msgstr "" "Daha fazla hatayı önlemek için '%s' eklentisi devre dışı bırakılıyor." msgid "" -"Unable to load addon script from path: '%s' Base type is not EditorPlugin." +"Unable to load addon script from path: '%s'. Base type is not 'EditorPlugin'." msgstr "" -"Eklenti betiği '%s' yolundan yüklenemedi. Bunun temel tipi EditorPlugin " -"(düzenleyici eklentisi) değil." +"Eklenti betiği '%s' yolundan yüklenemedi. Bunun temel tipi " +"'EditorPlugin' (düzenleyici eklentisi) değil." -msgid "Unable to load addon script from path: '%s' Script is not in tool mode." +msgid "Unable to load addon script from path: '%s'. Script is not in tool mode." msgstr "Eklenti betiği '%s' yolundan yüklenemedi. Betik, araç kipinde değil." msgid "" @@ -3706,6 +3719,9 @@ msgstr "Araçlar" msgid "Orphan Resource Explorer..." msgstr "Sahipsiz Kaynak Gezgini..." +msgid "Upgrade Mesh Surfaces..." +msgstr "Örgü Yüzeylerini Güncelle..." + msgid "Reload Current Project" msgstr "Bu Projeyi Tekrar Yükle" @@ -4018,6 +4034,12 @@ msgstr "" msgid "Assign..." msgstr "Ata..." +msgid "Copy as Text" +msgstr "Metin Olarak Kopyala" + +msgid "Show Node in Tree" +msgstr "Düğümü Ağaçta Görüntüle" + msgid "Invalid RID" msgstr "Geçersiz kaynak kimliği (RID)" @@ -4107,6 +4129,9 @@ msgstr "Benzersiz Yap" msgid "Make Unique (Recursive)" msgstr "Benzersiz Yap (Özyinelemeli)" +msgid "Save As..." +msgstr "Farklı Kaydet..." + msgid "Show in FileSystem" msgstr "DosyaSistemi'nde Göster" @@ -4585,6 +4610,9 @@ msgstr "'%s' hazırayarı silinsin mi?" msgid "Resources to exclude:" msgstr "Hariç tutulacak kaynaklar:" +msgid "Resources to override export behavior:" +msgstr "Dışa aktarma davranışının üzerine yazacak kaynaklar:" + msgid "Resources to export:" msgstr "Dışa aktarılacak kaynaklar:" @@ -4893,6 +4921,9 @@ msgstr "Klasör çoğaltılıyor:" msgid "New Inherited Scene" msgstr "Yeni Miras Alınmış Sahne" +msgid "Set as Main Scene" +msgstr "Ana Sahne olarak ayarla" + msgid "Open Scenes" msgstr "Sahneleri Aç" @@ -5004,6 +5035,33 @@ msgstr "Yeniden Adlandır..." msgid "Open in External Program" msgstr "Harici Programda Aç" +msgid "Red" +msgstr "Kırmızı" + +msgid "Orange" +msgstr "Turuncu" + +msgid "Yellow" +msgstr "Sarı" + +msgid "Green" +msgstr "Yeşil" + +msgid "Teal" +msgstr "Ördekbaşı" + +msgid "Blue" +msgstr "Mavi" + +msgid "Purple" +msgstr "Mor" + +msgid "Pink" +msgstr "Pembe" + +msgid "Gray" +msgstr "Gri" + msgid "Go to previous selected folder/file." msgstr "Önceki seçilen klasöre/dosyaya git." @@ -5013,6 +5071,9 @@ msgstr "Sonraki seçilen klasöre/dosyaya git." msgid "Re-Scan Filesystem" msgstr "Dosyasistemi'ni Yeniden Tara" +msgid "Change Split Mode" +msgstr "Bölünmüş Kipi Değiştir" + msgid "Filter Files" msgstr "Dosyaları Filtrele" @@ -5629,15 +5690,6 @@ msgstr "Dinamik olarak işlenen TrueType/OpenType yazı tipi" msgid "Prerendered multichannel(+true) signed distance field" msgstr "Ön-işlenmiş çok kanallı(+true) işaretli uzaklık alanı (MSDF)" -msgid "Can't load font texture:" -msgstr "Font dokusu yüklenemiyor:" - -msgid "Image margin too big." -msgstr "Görüntü kenar boşluğu çok büyük." - -msgid "Character margin too big." -msgstr "Karakter dış kenar boşluğu çok fazla." - msgid "Pre-Import Scene" msgstr "\"İçe Aktarım Öncesi\" Sahnesi" @@ -6010,9 +6062,6 @@ msgstr "Var olan bir kaynağı diskten yükle ve düzenle." msgid "Save the currently edited resource." msgstr "Şu anda düzenlenen kaynağı kaydet." -msgid "Save As..." -msgstr "Farklı Kaydet..." - msgid "Extra resource options." msgstr "Kaynak ek seçenekleri." @@ -6628,6 +6677,9 @@ msgstr "[Genel] (oluştur)" msgid "Duplicated Animation Name:" msgstr "Yinelenen Animasyon İsmi:" +msgid "Onion skinning requires a RESET animation." +msgstr "Onion skinning, bir RESET (Sıfırlama) animasyonu gerektiriyor." + msgid "Play selected animation backwards from current pos. (A)" msgstr "Seçilen animasyonu geçerli konumdan geriye doğru oynat. (A)" @@ -7768,6 +7820,18 @@ msgstr "" "Bu seçenek etkinleştirildiğinde, kaçınma nesnelerinin şekilleri, yarıçapları " "ve hızları çalışan projede görünür olacaktır." +msgid "Debug CanvasItem Redraws" +msgstr "CanvasItem (kanvas öğeleri) Yeniden Çizimi Hata Ayıkla" + +msgid "" +"When this option is enabled, redraw requests of 2D objects will become " +"visible (as a short flash) in the running project.\n" +"This is useful to troubleshoot low processor mode." +msgstr "" +"Bu seçenek etkinleştirildiğinde, 2B nesnelerin tekrar çizim istekleri çalışan " +"projede görünür (kısa yanıp sönme şeklinde) olacaktır.\n" +"Düşük işlemci güç kipinde sorunları bulmak için yararlıdır." + msgid "Synchronize Scene Changes" msgstr "Sahne Değişikliklerini Eşle" @@ -8137,6 +8201,9 @@ msgstr "Gezinti Örgüsü Oluştur" msgid "Create Debug Tangents" msgstr "Hata Ayıklama Teğetleri Oluştur" +msgid "No mesh to unwrap." +msgstr "Açılacak hiçbir örgü yok." + msgid "" "Mesh cannot unwrap UVs because it does not belong to the edited scene. Make " "it unique first." @@ -8164,6 +8231,15 @@ msgstr "UV2 'yi aç" msgid "Contained Mesh is not of type ArrayMesh." msgstr "Kapsanan Örgü, ArrayMesh (DiziÖrgü) tipinde değil." +msgid "Can't unwrap mesh with blend shapes." +msgstr "Harman şekilleri içeren örgüler açılamıyor." + +msgid "Only triangles are supported for lightmap unwrap." +msgstr "Işık haritası açılması sırasında sadece üçgenler desteklenir." + +msgid "Normals are required for lightmap unwrap." +msgstr "Normaller, ışık haritası açılması için gereklidir." + msgid "UV Unwrap failed, mesh may not be manifold?" msgstr "UV Açma başarısız oldu, örgü bir çokkatmanlı (manifold) olmayabilir?" @@ -9899,6 +9975,12 @@ msgstr "LightOccluder2D -2B ışık perdeleyici- Oluştur" msgid "LightOccluder2D Preview" msgstr "LightOccluder2D -2B ışık perdeleyici- Önizle" +msgid "Can't convert a sprite from a foreign scene." +msgstr "Yabancı bir sahnedeki bir grafik öğe dönüştürülemiyor." + +msgid "Can't convert an empty sprite to mesh." +msgstr "Boş bir grafik öğe örgüye dönüştürülemiyor." + msgid "Can't convert a sprite using animation frames to mesh." msgstr "" "Animasyon kareleri kullanan bir grafik öğe, bir örgüye dönüştürülemiyor." @@ -13626,9 +13708,20 @@ msgstr "" "\"düzenlenebilir_örnek\" seçeneği iptal edilirse, düğümün tüm özellikleri " "varsayılan değerlere geri döner." +msgid "" +"Enabling \"Load as Placeholder\" will disable \"Editable Children\" and cause " +"all properties of the node to be reverted to their default." +msgstr "" +"\"Yer Tutucu Olarak Yükle\" seçeneğini etkinleştirilmek, \"Düzenlenebilir Alt-" +"düğüm\" seçeneğini etkisiz hale getirir ve düğümün tüm özelliklerini " +"varsayılanlara geri döndürür." + msgid "Make Local" msgstr "Yerel Yap" +msgid "Can't toggle unique name for nodes in subscene!" +msgstr "Alt sahnedeki düğümler için benzersiz isim değiştirilemiyor!" + msgid "Enable Scene Unique Name(s)" msgstr "Sahne İçi Benzersiz İsim(ler)i Etkin Kıl" @@ -13680,16 +13773,6 @@ msgstr "Düğüm(ler)i Kaldır" msgid "Change type of node(s)" msgstr "Düğüm(ler)in türünü değiştir" -msgid "Removing the node from variable \"%s\" on node \"%s\"." -msgstr "Düğüm, \"%s\" değişkeninden (\"%s\" düğümündeki) kaldırılıyor." - -msgid "" -"The node's new type is incompatible with an exported variable (expected %s, " -"but type is %s)." -msgstr "" -"Düğümün yeni türü, dışa aktarılan bir değişkenle uyumsuz (beklenen %s, ancak " -"tür %s)." - msgid "This operation requires a single selected node." msgstr "Bu işlem, seçilmiş tek bir düğüm gerektirir." @@ -13722,6 +13805,9 @@ msgstr "Kalıtımı Temizle" msgid "Editable Children" msgstr "Düzenlenebilir Alt-öğeler" +msgid "Load as Placeholder" +msgstr "Yer Tutucu olarak Yükle" + msgid "Auto Expand to Selected" msgstr "Seçilene Otomatik Genişlet" @@ -14019,6 +14105,66 @@ msgstr "'%s' ismi gölgelendirici dili için ayrılmış bir anahtar kelimedir." msgid "Add Shader Global Parameter" msgstr "Gölgelendirici Genel Parametresi Ekle" +msgid "" +"This project uses meshes with an outdated mesh format from previous Godot " +"versions. The engine needs to update the format in order to use those meshes. " +"Please use the 'Upgrade Mesh Surfaces' tool from the 'Project > Tools' menu. " +"You can ignore this message and keep using outdated meshes, but keep in mind " +"that this leads to increased load times every time you load the project." +msgstr "" +"Bu proje, önceki Godot sürümlerinden gelen eski bir örgü formatına sahip " +"örgüleri kullanıyor. Motorun bu örgüleri kullanabilmesi için bu formatı " +"güncellemesi gerekmektedir. Lütfen 'Proje > Araçlar' menüsünden 'Örgü " +"Yüzeylerini Yükselt' aracını kullanın. Bu mesajı görmezden gelebilir ve eski " +"örgüleri kullanmaya devam edebilirsiniz, ancak bunun projeyi her " +"yüklediğinizde yükleme sürelerinin artmasına neden olduğunu unutmayın." + +msgid "" +"This project uses meshes with an outdated mesh format. Check the output log." +msgstr "" +"Bu proje, eski bir örgü formatına sahip örgüler kullanıyor. Çıktı günlüğünü " +"kontrol edin." + +msgid "Upgrading All Meshes in Project" +msgstr "Projedeki Tüm Örgüler Güncelleniyor" + +msgid "Attempting to re-save " +msgstr "Yeniden kaydetme deneniyor " + +msgid "Attempting to remove " +msgstr "Kaldırılmaya çalışılıyor " + +msgid "" +"The mesh format has changed in Godot 4.2, which affects both imported meshes " +"and meshes authored inside of Godot. The engine needs to update the format in " +"order to use those meshes.\n" +"\n" +"If your project predates Godot 4.2 and contains meshes, we recommend you run " +"this one time conversion tool. This update will restart the editor and may " +"take several minutes. Upgrading will make the meshes incompatible with " +"previous versions of Godot.\n" +"\n" +"You can still use your existing meshes as is. The engine will update each " +"mesh in memory, but the update will not be saved. Choosing this option will " +"lead to slower load times every time this project is loaded." +msgstr "" +"Örgü formatı Godot 4.2'de değişmiştir, bu da hem içe aktarılan örgüleri hem " +"de Godot içinde yazılan örgüleri etkilemektedir. Motorun bu örgüleri " +"kullanabilmesi için formatı güncellemesi gerekiyor.\n" +"\n" +"Eğer projeniz Godot 4.2'den önceye aitse ve örgüler içeriyorsa, bu tek " +"seferlik dönüştürme aracını çalıştırmanızı öneririz. Bu güncelleme " +"düzenleyiciyi yeniden başlatacaktır ve birkaç dakika sürebilir. Yükseltme " +"işlemi, örgüleri Godot'un önceki sürümleriyle uyumsuz hale getirecektir.\n" +"\n" +"Mevcut örgülerinizi olduğu gibi kullanmaya devam da edebilirsiniz. Motor, her " +"bir örgüyü bellekte güncelleyecek, ancak bu güncelleme kaydedilmeyecektir. Bu " +"seçeneğin seçilmesi, projenin her açılmasında daha yavaş yükleme sürelerine " +"yol açacaktır." + +msgid "Restart & Upgrade" +msgstr "Yeniden Başlat ve Güncelle" + msgid "Make this panel floating in the screen %d." msgstr "Bu paneli %d ekranında yüzer hale getir." @@ -14048,6 +14194,9 @@ msgid "Invalid type argument to convert(), use TYPE_* constants." msgstr "" "convert() için geçersiz tipte girdi değişkeni, TYPE_* sabitlerini kullanın." +msgid "Cannot resize array." +msgstr "Dizi yeniden boyutlandırılamadı." + msgid "Step argument is zero!" msgstr "Adım girdi değişkeni sıfır!" @@ -14072,6 +14221,9 @@ msgstr "Geçersiz örnek sözlüğü biçimi (@path 'teki betik geçersiz)" msgid "Invalid instance dictionary (invalid subclasses)" msgstr "Geçersiz örnek sözlüğü (geçersiz altsınıflar)" +msgid "Cannot instantiate GDScript class." +msgstr "GDScript sınıfı örneklenemiyor." + msgid "Value of type '%s' can't provide a length." msgstr "'%s' tipindeki değer, bir uzunluk sağlayamaz." @@ -14283,6 +14435,9 @@ msgstr "Doğrudan aydınlatma çizme" msgid "Integrate indirect lighting" msgstr "Dolaylı aydınlatmayı birleştir" +msgid "Integrate indirect lighting %d%%" +msgstr "Dolaylı aydınlatmayı birleştir %d%%" + msgid "Baking lightprobes" msgstr "Işık-sondaları pişiriliyor" @@ -14290,7 +14445,7 @@ msgid "Integrating light probes %d%%" msgstr "Işık sondaları birleştiriliyor %d%%" msgid "Denoising" -msgstr "Gürültü arındırılıyor" +msgstr "Gürültü Giderme" msgid "Retrieving textures" msgstr "Dokular alınıyor" @@ -14707,6 +14862,9 @@ msgstr "Cihazda yürütülemedi." msgid "Exporting to Android when using C#/.NET is experimental." msgstr "C#/.NET kullanırken Android'e dışa aktarma henüz deneyseldir." +msgid "Android architecture %s not supported in C# projects." +msgstr "Android %s mimarisi C# projelerinde desteklenmez." + msgid "" "Android build template not installed in the project. Install it from the " "Project menu." @@ -14869,23 +15027,16 @@ msgstr "Genişletme paketi dosyası yazılamadı!" msgid "Building Android Project (gradle)" msgstr "Android Projesi Oluşturuluyor (gradle)" -msgid "" -"Building of Android project failed, check output for the error. Alternatively " -"visit docs.godotengine.org for Android build documentation." +msgid "Building of Android project failed, check output for the error:" msgstr "" "Android projesinin oluşturulması başarısız oldu, hata için çıktıları kontrol " -"edin. Alternatif olarak, Android derleme belgeleri için docs.godotengine.org " -"adresini ziyaret edin." +"edin:" msgid "Moving output" msgstr "Çıktı taşınıyor" -msgid "" -"Unable to copy and rename export file, check gradle project directory for " -"outputs." -msgstr "" -"Dışa aktarma dosyası kopyalanamıyor ve yeniden adlandırılamıyor, çıktılar " -"için gradle proje dizinini kontrol edin." +msgid "Unable to copy and rename export file:" +msgstr "Dışa aktarma dosyası kopyalanamıyor ve yeniden adlandırılamıyor:" msgid "Package not found: \"%s\"." msgstr "Paket bulunamadı: \"%s\"." @@ -14962,6 +15113,12 @@ msgstr "" ".ipa yalnızca macOS üzerinde oluşturulabilir. Paketi oluşturmadan Xcode " "projesinden çıkılıyor." +msgid "Exporting to iOS when using C#/.NET is experimental and requires macOS." +msgstr "C#/.NET kullanırken iOS'a dışa aktarma deneyseldir ve macOS gerektirir." + +msgid "Exporting to iOS when using C#/.NET is experimental." +msgstr "C#/.NET kullanırken iOS'a dışa aktarma deneyseldir." + msgid "Identifier is missing." msgstr "Tanımlayıcı eksik." @@ -15126,6 +15283,13 @@ msgstr "App Store dağıtımı için yükleyici imzalama kimliği gereklidir." msgid "App sandbox is required for App Store distribution." msgstr "App Store dağıtımı için App korumalı oyun alanı (sandbox) gereklidir." +msgid "" +"'rcodesign' doesn't support signing applications with embedded dynamic " +"libraries (GDExtension or .NET)." +msgstr "" +"'rcodesign', gömülü dinamik kütüphaneli (GDExtension veya .NET) uygulamaların " +"imzalanmasını desteklemez." + msgid "Code signing is required for App Store distribution." msgstr "Kod imzalama, App Store dağıtım için gereklidir." @@ -15318,6 +15482,13 @@ msgstr "" "Geçici imzalı uygulamalar, dinamik kitaplıkları yüklemek için 'Kitaplık " "Doğrulamasını Devre Dışı Bırak' yetkilendirmesini gerektirir." +msgid "" +"'rcodesign' doesn't support signing applications with embedded dynamic " +"libraries." +msgstr "" +"'rcodesign', gömülü dinamik kütüphaneli uygulamaların imzalanmasını " +"desteklemez." + msgid "Could not create entitlements file." msgstr "Yetkilendirmeler dosyası oluşturulamadı." @@ -15788,6 +15959,17 @@ msgstr "" "KaroHaritası düğümünün kendisinde Y-sıralaması etkinleştirilmedi." msgid "" +"The TileMap node is set as Y-sorted, but Y-sort is not enabled on any of the " +"TileMap's layers.\n" +"This may lead to unwanted behaviors, as a layer that is not Y-sorted will be " +"Y-sorted as a whole." +msgstr "" +"KaroHaritası düğümü Y-sıralamalı olarak ayarlanmış, ancak KaroHaritası'nın " +"hiçbir katmanında Y-sıralama etkin değil.\n" +"Bu durum istenmeyen davranışlara yol açabilir, çünkü Y-sıralı olmayan bir " +"katmanda bir bütün halinde Y-sıralama yapılacaktır." + +msgid "" "Isometric TileSet will likely not look as intended without Y-sort enabled for " "the TileMap and all of its layers." msgstr "" @@ -16475,6 +16657,14 @@ msgid "Automatically arrange selected nodes." msgstr "Seçilen düğümleri otomatik olarak düzenle." msgid "" +"Labels with autowrapping enabled must have a custom minimum size configured " +"to work correctly inside a container." +msgstr "" +"Otomatik sarma özelliği etkin olan etiketlerin (Label) bir taşıyıcı " +"içerisinde düzgün çalışabilmesi için özel en küçük boy ayarı yapılması " +"gereklidir." + +msgid "" "The current font does not support rendering one or more characters used in " "this Label's text." msgstr "" @@ -16600,15 +16790,6 @@ msgstr "" "şekilde yeniden kaydedilebilir." msgid "" -"Setting node name '%s' to be unique within scene for '%s', but it's already " -"claimed by '%s'.\n" -"'%s' is no longer set as having a unique name." -msgstr "" -"'%s' düğüm ismi, '%s' için sahne içinde benzersiz olması için ayarlanmaya " -"çalışılıyor, ancak bu isim zaten '%s' tarafından alınmış.\n" -"'%s' artık benzersiz bir isime sahip olarak ayarlı değil." - -msgid "" "This node is marked as deprecated and will be removed in future versions.\n" "Please check the Godot documentation for information about migration." msgstr "" @@ -16624,13 +16805,6 @@ msgstr "" "kaldırılabilir veya büyük değişikliklere tabi olabilir." msgid "" -"Default Environment as specified in the project setting \"rendering/" -"environment/defaults/default_environment\" could not be loaded." -msgstr "" -"Proje Ayarlarında, \"işleme/ortam/varsayılanlar/varsayılan_ortam\", " -"belirlenmiş Varsayılan Ortam yüklenemedi." - -msgid "" "ShaderGlobalsOverride is not active because another node of the same type is " "in the scene." msgstr "" @@ -16655,29 +16829,6 @@ msgstr "" "Herhangi bir şeyi işlemek için, çerçevenin (Viewport) boyutları her iki " "boyutta da 2 piksele eşit ya da büyük olmalıdır." -msgid "Cannot open font from file: %s." -msgstr "Yazı tipi, dosyadan açılamıyor: %s." - -msgid "Version %d of BMFont is not supported (should be 3)." -msgstr "" -"BitHaritası yazı tipi yükleyici'nin (BMFont) %d sürümü desteklenmemektedir (3 " -"olmalı)." - -msgid "Invalid BMFont info block size." -msgstr "Geçersiz BMFont bilgi kalıp boyutu." - -msgid "Invalid BMFont common block size." -msgstr "Geçersiz BMFont ortak kalıp boyutu." - -msgid "Can't load font texture: %s." -msgstr "Yazı tipi dokusu yüklenemiyor: %s." - -msgid "Unsupported BMFont texture format." -msgstr "Desteklenmeyen BMFont doku biçimi." - -msgid "Invalid BMFont block type." -msgstr "Geçersiz BMFont kalıbı türü." - msgid "" "An incoming node's name clashes with %s already in the scene (presumably, " "from a more nested instance).\n" diff --git a/editor/translations/editor/uk.po b/editor/translations/editor/uk.po index 12fab33e04..b4a90a5d8d 100644 --- a/editor/translations/editor/uk.po +++ b/editor/translations/editor/uk.po @@ -37,13 +37,14 @@ # Siked Siked <siked3@gmail.com>, 2023. # Kipя <yankirill@icloud.com>, 2023. # Kristian Sik <jemynanyt@gmail.com>, 2023. +# Maxi fox <oleksijyerukh@gmail.com>, 2023. msgid "" msgstr "" "Project-Id-Version: Ukrainian (Godot Engine)\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-10-13 02:30+0000\n" -"Last-Translator: Siked Siked <siked3@gmail.com>\n" +"PO-Revision-Date: 2023-12-02 19:36+0000\n" +"Last-Translator: Maxi fox <oleksijyerukh@gmail.com>\n" "Language-Team: Ukrainian <https://hosted.weblate.org/projects/godot-engine/" "godot/uk/>\n" "Language: uk\n" @@ -52,7 +53,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && " "n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" -"X-Generator: Weblate 5.1-dev\n" +"X-Generator: Weblate 5.3-dev\n" msgid "Main Thread" msgstr "Головний потік" @@ -908,6 +909,22 @@ msgstr "" "увімкніть опції \"Зберегти у файл\" і\n" "\"Зберегти власні доріжки\"." +msgid "" +"Some AnimationPlayerEditor's options are disabled since this is the dummy " +"AnimationPlayer for preview.\n" +"\n" +"The dummy player is forced active, non-deterministic and doesn't have the " +"root motion track. Furthermore, the original node is inactive temporary." +msgstr "" +"Деякі опції редактора AnimationPlayerEditor вимкнено, оскільки це фіктивний " +"плеєр для попереднього перегляду.\n" +"\n" +"Фіктивний програвач є примусово активним, недетермінованим і не має кореневої " +"доріжки руху. Крім того, оригінальний вузол тимчасово неактивний." + +msgid "AnimationPlayer is inactive. The playback will not be processed." +msgstr "Програвач AnimationPlayer неактивний. Відтворення не буде оброблено." + msgid "Select an AnimationPlayer node to create and edit animations." msgstr "Виберіть вузол AnimationPlayer для створення і редагування анімацій." @@ -1036,15 +1053,60 @@ msgctxt "Transition Type" msgid "Sine" msgstr "Синусоїдний" +msgctxt "Transition Type" +msgid "Quint" +msgstr "Квінт" + +msgctxt "Transition Type" +msgid "Quart" +msgstr "Кварт" + +msgctxt "Transition Type" +msgid "Quad" +msgstr "Чотири." + +msgctxt "Transition Type" +msgid "Elastic" +msgstr "Еластичний" + +msgctxt "Transition Type" +msgid "Circ" +msgstr "Кірк" + +msgctxt "Transition Type" +msgid "Bounce" +msgstr "Відскок" + +msgctxt "Transition Type" +msgid "Spring" +msgstr "Весна" + +msgctxt "Ease Type" +msgid "InOut" +msgstr "Увійшов - вийшов" + +msgctxt "Ease Type" +msgid "OutIn" +msgstr "Виходьте У" + +msgid "Ease Type:" +msgstr "Легкий тип:" + msgid "FPS:" msgstr "FPS:" msgid "Animation Baker" msgstr "Запікання анімації" +msgid "3D Pos/Rot/Scl Track:" +msgstr "Трек 3D пози./пово./розм.:" + msgid "Blendshape Track:" msgstr "Доріжка змішаних форм:" +msgid "Value Track:" +msgstr "Ціннісний трек:" + msgid "Select Tracks to Copy" msgstr "Виберіть доріжки для копіювання" @@ -1072,6 +1134,9 @@ msgstr "Номер рядка:" msgid "%d replaced." msgstr "%d замінено." +msgid "No match" +msgstr "Не збігається" + msgid "%d match" msgid_plural "%d matches" msgstr[0] "%d збіг" @@ -1099,6 +1164,14 @@ msgstr "Замінити всі" msgid "Selection Only" msgstr "Тільки виділити" +msgctxt "Indentation" +msgid "Spaces" +msgstr "Простори" + +msgctxt "Indentation" +msgid "Tabs" +msgstr "Tabs" + msgid "Toggle Scripts Panel" msgstr "Перемкнути панель скриптів" @@ -1331,6 +1404,18 @@ msgstr "" msgid "Toggle Visibility" msgstr "Перемкнути видимість" +msgid "Updating assets on target device:" +msgstr "Оновлення ресурсів на цільовому пристрої:" + +msgid "Decompressing remote file system" +msgstr "Розпакування віддаленої файлової системи" + +msgid "Scanning for local changes" +msgstr "Сканування локальних змін" + +msgid "Sending list of changed files:" +msgstr "Надсилання списку змінених файлів:" + msgid "ms" msgstr "мс" @@ -1484,6 +1569,9 @@ msgstr "Пауза" msgid "Continue" msgstr "Продовжити" +msgid "Thread:" +msgstr "Нитки:" + msgid "Stack Frames" msgstr "Стосувати кадри" @@ -1585,6 +1673,12 @@ msgstr "Редактор залежностей" msgid "Search Replacement Resource:" msgstr "Знайти замінний ресурс:" +msgid "Open Scene" +msgid_plural "Open Scenes" +msgstr[0] "Відкрити сцену" +msgstr[1] "Відкрити сцени" +msgstr[2] "Відкрити сцен" + msgid "Open" msgstr "Відкрити" @@ -1655,9 +1749,17 @@ msgstr "Кількість" msgid "Resources Without Explicit Ownership:" msgstr "Ресурси без явної власності:" +msgid "Using slashes in folder names will create subfolders recursively." +msgstr "" +"Використання косих рисок у назвах теки призведе до рекурсивного створення " +"підтеки." + msgid "Could not create folder." msgstr "Неможливо створити теку." +msgid "Create new folder in %s:" +msgstr "Створіть нову папку в %s:" + msgid "Create Folder" msgstr "Створити Теку" @@ -1686,6 +1788,9 @@ msgstr "Розробники" msgid "Authors" msgstr "Автори" +msgid "Patrons" +msgstr "Меценати" + msgid "Platinum Sponsors" msgstr "Платинові спонсори" @@ -1695,20 +1800,11 @@ msgstr "Золоті спонсори" msgid "Silver Sponsors" msgstr "Срібні донори" -msgid "Bronze Sponsors" -msgstr "Бронзові донори" - -msgid "Mini Sponsors" -msgstr "Міні-спонсори" +msgid "Diamond Members" +msgstr "Діамантові учасники" -msgid "Gold Donors" -msgstr "Золоті донори" - -msgid "Silver Donors" -msgstr "Срібні донори" - -msgid "Bronze Donors" -msgstr "Бронзові донори" +msgid "Titanium Members" +msgstr "Титанові члени" msgid "Donors" msgstr "Донори" @@ -1746,6 +1842,18 @@ msgstr "" msgid "%s (already exists)" msgstr "%s (вже існує)" +msgid "%d file conflicts with your project and won't be installed" +msgid_plural "%d files conflict with your project and won't be installed" +msgstr[0] "Файл %d конфліктує з вашим проектом і не буде інстальований" +msgstr[1] "Файли %d конфліктують з вашим проектом і не будуть встановлені" +msgstr[2] "Файли %d конфліктують з вашим проектом і не будуть встановлені" + +msgid "This asset doesn't have a root directory, so it can't be ignored." +msgstr "Цей ресурс не має кореневого каталогу, тому його не можна ігнорувати." + +msgid "Ignore the root directory when extracting files." +msgstr "Ігноруйте кореневий каталог під час видобування файлів." + msgid "Uncompressing Assets" msgstr "Розпаковування ресурсів" @@ -1761,6 +1869,32 @@ msgstr "Пакунок «%s» успішно встановлено!" msgid "Success!" msgstr "Успіх!" +msgid "Open the list of the asset contents and select which files to install." +msgstr "" +"Відкрийте список вмісту ресурсу і виберіть файли, які потрібно встановити." + +msgid "" +"Change the folder where the contents of the asset are going to be installed." +msgstr "Змініть папку, до якої буде інстальовано вміст ресурсу." + +msgid "Ignore asset root" +msgstr "Ігнорувати корінь активу" + +msgid "No files conflict with your project" +msgstr "Файли не конфліктують з вашим проектом" + +msgid "Show contents of the asset and conflicting files." +msgstr "Показати вміст ресурсу та конфліктуючі файли." + +msgid "Contents of the asset:" +msgstr "Зміст активу:" + +msgid "Installation preview:" +msgstr "Попередній перегляд установки:" + +msgid "Configure Asset Before Installing" +msgstr "Налаштуйте актив перед встановленням" + msgid "Install" msgstr "Встановити" @@ -1978,10 +2112,10 @@ msgid "XR" msgstr "XR" msgid "OpenGL" -msgstr "OpenGL" +msgstr "ОпенГЛ" msgid "Vulkan" -msgstr "Vulkan" +msgstr "Вулкан" msgid "Text Server: Fallback" msgstr "Текстовий сервер: Запасний" @@ -1998,6 +2132,9 @@ msgstr "Шрифти WOFF2" msgid "SIL Graphite Fonts" msgstr "Шрифти SIL Graphite" +msgid "Multi-channel Signed Distance Field Font Rendering" +msgstr "Багатоканальна візуалізація шрифтів полів зі знаками відстані" + msgid "2D Physics nodes and PhysicsServer2D." msgstr "Вузли 2D фізики та PhysicsServer2D." @@ -2056,6 +2193,14 @@ msgstr "" "Підтримка технології інтелектуальних шрифтів SIL Graphite (підтримується лише " "в Розширеному текстовому сервері)." +msgid "" +"Multi-channel signed distance field font rendering support using msdfgen " +"library (pre-rendered MSDF fonts can be used even if this option disabled)." +msgstr "" +"Підтримка багатоканального відображення шрифтів підписаних полів відстані за " +"допомогою бібліотеки msdfgen (можна використовувати попередньо відмальовані " +"MSDF-шрифти, навіть якщо цю опцію вимкнено)." + msgid "General Features:" msgstr "Основні можливості:" @@ -2107,9 +2252,19 @@ msgstr "Завантажити профіль" msgid "Export Profile" msgstr "Експорт профілю" +msgid "Forced classes on detect:" +msgstr "Примусові заняття з детективу:" + msgid "Edit Build Configuration Profile" msgstr "Редагувати профіль конфігурації збірки" +msgid "" +"Failed to execute command \"%s\":\n" +"%s." +msgstr "" +"Не вдалося виконати команду \"%s\":\n" +"%s." + msgid "Filter Commands" msgstr "Фільтрувати команди" @@ -2306,6 +2461,11 @@ msgstr "Імпорт ресурсів типу: %s" msgid "No return value." msgstr "Значення не повертається." +msgid "This value is an integer composed as a bitmask of the following flags." +msgstr "" +"Це значення є цілим числом, складеним у вигляді бітової маски з наступних " +"прапорів." + msgid "Deprecated" msgstr "Застаріле" @@ -2339,6 +2499,26 @@ msgstr "" msgid "Error codes returned:" msgstr "Повернуто коди помилок:" +msgid "There is currently no description for this method." +msgstr "Наразі для цього методу немає опису." + +msgid "There is currently no description for this constructor." +msgstr "Наразі для цього конструктора немає опису." + +msgid "" +"There is currently no description for this method. Please help us by " +"[color=$color][url=$url]contributing one[/url][/color]!" +msgstr "" +"Наразі для цього методу немає опису. Будь ласка, допоможіть нам, " +"[color=$color][url=$url]зробивши один внесок[/url][/color]!" + +msgid "" +"There is currently no description for this constructor. Please help us by " +"[color=$color][url=$url]contributing one[/url][/color]!" +msgstr "" +"Наразі для цього конструктора немає опису. Будь ласка, допоможіть нам, " +"[color=$color][url=$url]зробивши один внесок[/url][/color]!" + msgid "Top" msgstr "Верхівка" @@ -2376,6 +2556,17 @@ msgstr "" "Наразі для цього класу немає опису. Будь ласка, допоможіть нам, [color=$color]" "[url=$url]зробивши внесок[/url][/color]!" +msgid "Note:" +msgstr "Зауважте:" + +msgid "" +"There are notable differences when using this API with C#. See [url=%s]C# API " +"differences to GDScript[/url] for more information." +msgstr "" +"Існують помітні відмінності при використанні цього API з C#. Дивіться " +"[url=%s]Відмінності API C# від GDScript[/url] для отримання додаткової " +"інформації." + msgid "Online Tutorials" msgstr "Підручники в інтернеті" @@ -2459,12 +2650,24 @@ msgstr "Описи методів" msgid "Operator Descriptions" msgstr "Описи операторів" +msgid "Metadata:" +msgstr "Метадані:" + msgid "Property:" msgstr "Властивість:" +msgid "Method:" +msgstr "Метод:" + msgid "Signal:" msgstr "Сигнал:" +msgid "Theme Item:" +msgstr "Тема \"Предмет\":" + +msgid "No description available." +msgstr "Опис відсутній." + msgid "%d match." msgstr "%d відповідник." @@ -2548,6 +2751,12 @@ msgstr "" "Пришпилення значення призведе до примусового збереження значення, навіть якщо " "воно дорівнює типовому." +msgid "(%d change)" +msgid_plural "(%d changes)" +msgstr[0] "(%d зміна)" +msgstr[1] "(%d зміни)" +msgstr[2] "(%d змін)" + msgid "Add element to property array with prefix %s." msgstr "Додати елемент до масиву властивостей із перфіксом %s." @@ -2558,6 +2767,12 @@ msgid "Move element %d to position %d in property array with prefix %s." msgstr "" "Перемістити елемент %d на позицію %d в масиві властивостей із перфіксом %s." +msgid "Clear Property Array with Prefix %s" +msgstr "Очистити масив властивостей з префіксом %s" + +msgid "Resize Property Array with Prefix %s" +msgstr "Зміна розміру масиву властивостей з префіксом %s" + msgid "Element %d: %s%d*" msgstr "Елемент %d: %s%d*" @@ -2591,6 +2806,9 @@ msgstr "Додати метадані" msgid "Set %s" msgstr "Встановити %s" +msgid "Set Multiple: %s" +msgstr "Встановити множину: %s" + msgid "Remove metadata %s" msgstr "Видалити метадані %s" @@ -2642,6 +2860,9 @@ msgstr "Мініатюра..." msgid "Select existing layout:" msgstr "Виберіть існуючий макет:" +msgid "Or enter new layout name" +msgstr "Або введіть нову назву макета" + msgid "Changed Locale Language Filter" msgstr "Змінено фільтр локальної мови" @@ -2722,6 +2943,9 @@ msgstr "Переключити видимість попереджень." msgid "Toggle visibility of editor messages." msgstr "Переключити видимість повідомлень редактора." +msgid "Native Shader Source Inspector" +msgstr "Інспектор джерел нативних шейдерів" + msgid "Unnamed Project" msgstr "Проєкт без назви" @@ -3034,17 +3258,6 @@ msgstr "" "Вимикаємо додаток у «%s», щоб запобігти подальшим помилкам." msgid "" -"Unable to load addon script from path: '%s' Base type is not EditorPlugin." -msgstr "" -"Не вдається завантажити скрипт доповнення з шляху: '%s' Базовий тип не є " -"редактором плагінів." - -msgid "Unable to load addon script from path: '%s' Script is not in tool mode." -msgstr "" -"Неможливо завантажити скрипт доповнення з шляху: '%s' Скрипт не в режимі " -"інструменту." - -msgid "" "Scene '%s' was automatically imported, so it can't be modified.\n" "To make changes to it, a new inherited scene can be created." msgstr "" @@ -3068,6 +3281,9 @@ msgstr "Очистити недавні сцени" msgid "There is no defined scene to run." msgstr "Немає визначеної сцени для виконання." +msgid "%s - Godot Engine" +msgstr "%s - Godot Engine" + msgid "" "No main scene has ever been defined, select one?\n" "You can change it later in \"Project Settings\" under the 'application' " @@ -3104,9 +3320,37 @@ msgstr "Видалити компонування" msgid "Default" msgstr "Типовий" +msgid "%d second ago" +msgid_plural "%d seconds ago" +msgstr[0] "%d секунду тому" +msgstr[1] "%d секунд тому" +msgstr[2] "%d секунд тому" + +msgid "%d minute ago" +msgid_plural "%d minutes ago" +msgstr[0] "%d хвилину тому" +msgstr[1] "%d хвилин тому" +msgstr[2] "%d хвилин тому" + +msgid "%d hour ago" +msgid_plural "%d hours ago" +msgstr[0] "%d годину тому" +msgstr[1] "%d годин тому" +msgstr[2] "%d годин тому" + +msgid "" +"Scene \"%s\" has unsaved changes.\n" +"Last saved: %s." +msgstr "" +"Сцена \"%s\" має незбережені зміни.\n" +"Останнє збереження: %s." + msgid "Save & Close" msgstr "Зберегти та закрити" +msgid "Save before closing?" +msgstr "Зберегти перед закриттям?" + msgid "%d more files or folders" msgstr "%d більше файлів або тек" @@ -3275,6 +3519,13 @@ msgstr "Запитання і відповіді" msgid "Community" msgstr "Спільнота" +msgid "Copy System Info" +msgstr "Копіювати інформацію про систему" + +msgid "Copies the system info as a single-line text into the clipboard." +msgstr "" +"Копіює системну інформацію у вигляді однорядкового тексту до буфера обміну." + msgid "Report a Bug" msgstr "Повідомити про ваду" @@ -3406,6 +3657,12 @@ msgstr "Перезавантажити" msgid "Resave" msgstr "Перезаписати" +msgid "Create Version Control Metadata..." +msgstr "Створення метаданих керування версіями..." + +msgid "Version Control Settings..." +msgstr "Налаштування контролю версій..." + msgid "New Inherited" msgstr "Новий успадкований" @@ -3545,6 +3802,9 @@ msgstr "Виберіть панель перегляду" msgid "Selected node is not a Viewport!" msgstr "Позначений вузол не є панеллю перегляду!" +msgid "(Nil) %s" +msgstr "(Ніл) %s" + msgid "%s (size %s)" msgstr "%s (розмір %s)" @@ -3578,6 +3838,9 @@ msgstr "Локалізуючий рядок (розмір %d)" msgid "Add Translation" msgstr "Додати переклад" +msgid "Lock/Unlock Component Ratio" +msgstr "Співвідношення компонентів блокування/розблокування" + msgid "" "The selected resource (%s) does not match any type expected for this property " "(%s)." @@ -3597,6 +3860,9 @@ msgstr "Зробити унікальним" msgid "Make Unique (Recursive)" msgstr "Зробити унікальним (Рекурсивним)" +msgid "Save As..." +msgstr "Зберегти як..." + msgid "Show in FileSystem" msgstr "Показати у файловій системі" @@ -3645,6 +3911,12 @@ msgid "" msgstr "" "Не вдалося запустити скрипт редактора, ви забули перевизначити метод '_run'?" +msgid "Edit Built-in Action: %s" +msgstr "Редагувати вбудовану дію: %s" + +msgid "Edit Shortcut: %s" +msgstr "Ярлик редагування: %s" + msgid "Common" msgstr "Загальні" @@ -3666,12 +3938,42 @@ msgstr "Клавіатурні скорочення" msgid "Binding" msgstr "Палітурка" +msgid "Left Stick Left, Joystick 0 Left" +msgstr "Ліва кнопка ліворуч, джойстик 0 ліворуч" + +msgid "Left Stick Right, Joystick 0 Right" +msgstr "Ліва паличка Вправо, джойстик 0 Вправо" + +msgid "Left Stick Up, Joystick 0 Up" +msgstr "Лівий стік вгору, джойстик 0 вгору" + +msgid "Left Stick Down, Joystick 0 Down" +msgstr "Лівий стік вниз, джойстик 0 вниз" + +msgid "Right Stick Left, Joystick 1 Left" +msgstr "Права кнопка ліворуч, джойстик 1 ліворуч" + +msgid "Right Stick Right, Joystick 1 Right" +msgstr "Правий джойстик вправо, джойстик 1 вправо" + +msgid "Right Stick Up, Joystick 1 Up" +msgstr "Правий джойстик вгору, джойстик 1 вгору" + +msgid "Right Stick Down, Joystick 1 Down" +msgstr "Правий стік вниз, джойстик 1 вниз" + msgid "Joystick 2 Left" msgstr "Джойстик 2 Лівий" +msgid "Left Trigger, Sony L2, Xbox LT, Joystick 2 Right" +msgstr "Лівий тригер, Sony L2, Xbox LT, джойстик 2 Правий" + msgid "Joystick 2 Up" msgstr "Джойстик 2 Вгору" +msgid "Right Trigger, Sony R2, Xbox RT, Joystick 2 Down" +msgstr "Правий тригер, Sony R2, Xbox RT, джойстик 2 вниз" + msgid "Joystick 3 Left" msgstr "Джойстик 3 Лівий" @@ -3696,6 +3998,9 @@ msgstr "Джойстик 4 Вгору" msgid "Joystick 4 Down" msgstr "Джойстик 4 Вниз" +msgid "Unicode" +msgstr "Юнікод" + msgid "Joypad Axis %d %s (%s)" msgstr "Вісь джойстика %d %s (%s)" @@ -3794,6 +4099,9 @@ msgstr "" "При експортуванні у 32-бітовому режимі вбудовані PCK не можуть перевищувати " "за розміром 4 ГіБ." +msgid "Plugin \"%s\" is not supported on \"%s\"" +msgstr "Плагін \"%s\" не підтримується на \"%s\"" + msgid "Open the folder containing these templates." msgstr "Відкрити теку, яка містить ці шаблони." @@ -3993,6 +4301,12 @@ msgstr "" "Отримання шаблонів буде продовжено.\n" "Під час завершення можливе тимчасове «замерзання» редактора." +msgid "" +"Target platform requires '%s' texture compression. Enable 'Import %s' to fix." +msgstr "" +"Цільова платформа вимагає стиснення текстур '%s'. Увімкніть \"Імпортувати " +"%s\" для виправлення." + msgid "Runnable" msgstr "Активний" @@ -4245,6 +4559,14 @@ msgid "Failed to load resource at %s: %s" msgstr "Не вдалося завантажити ресурс з %s: %s" msgid "" +"This filename begins with a dot rendering the file invisible to the editor.\n" +"If you want to rename it anyway, use your operating system's file manager." +msgstr "" +"Ім'я файлу починається з крапки, що робить його невидимим для редактора.\n" +"Якщо ви все одно хочете перейменувати його, скористайтеся файловим менеджером " +"вашої операційної системи." + +msgid "" "This file extension is not recognized by the editor.\n" "If you want to rename it anyway, use your operating system's file manager.\n" "After renaming to an unknown extension, the file won't be shown in the editor " @@ -4266,6 +4588,12 @@ msgstr "" "Наступні файли або папки конфліктують з елементами в цільовому розташуванні " "'%s':" +msgid "Do you wish to overwrite them or rename the copied files?" +msgstr "Ви хочете перезаписати їх або перейменувати скопійовані файли?" + +msgid "Do you wish to overwrite them or rename the moved files?" +msgstr "Ви хочете перезаписати їх або перейменувати переміщені файли?" + msgid "Duplicating file:" msgstr "Дублювання файлу:" @@ -4365,6 +4693,27 @@ msgstr "Перейменувати..." msgid "Open in External Program" msgstr "Відкрити в зовнішній програмі" +msgid "Yellow" +msgstr "Жовтий" + +msgid "Green" +msgstr "Зелений" + +msgid "Teal" +msgstr "Чирок." + +msgid "Blue" +msgstr "Синій" + +msgid "Purple" +msgstr "Фіолетовий" + +msgid "Pink" +msgstr "Рожевий." + +msgid "Gray" +msgstr "Грей." + msgid "Go to previous selected folder/file." msgstr "Перейти до попередньої вибраної теки/файлу." @@ -4805,6 +5154,9 @@ msgstr "Дерево сцени (вузли):" msgid "Node Configuration Warning!" msgstr "Попередження щодо налаштування вузлів!" +msgid "Allowed:" +msgstr "Дозвольте:" + msgid "Select a Node" msgstr "Виберіть вузол" @@ -4833,6 +5185,9 @@ msgstr "" msgid "Loop:" msgstr "Цикл:" +msgid "BPM:" +msgstr "УД./ХВ:" + msgid "" "Configure the Beats Per Measure (tempo) used for the interactive streams.\n" "This is required in order to configure beat information." @@ -4977,12 +5332,6 @@ msgstr "Динамічно відрендерений шрифт TrueType/OpenTy msgid "Prerendered multichannel(+true) signed distance field" msgstr "Попередньо відрендерене багатоканальне (+true) поле відстані зі знаком" -msgid "Can't load font texture:" -msgstr "Не вдається завантажити текстуру шрифту:" - -msgid "Image margin too big." -msgstr "Занадто велике поле зображення." - msgid "Pre-Import Scene" msgstr "Попередній імпорт сцени" @@ -5088,6 +5437,9 @@ msgstr "Існуючий файл з такою самою назвою буде msgid "Will create new file" msgstr "Створить файл скрипту" +msgid "Already External" +msgstr "Вже зовнішній" + msgid "" "This material already references an external file, no action will be taken.\n" "Disable the external property for it to be extracted again." @@ -5227,6 +5579,13 @@ msgid "Advanced..." msgstr "Додатково..." msgid "" +"The imported resource is currently loaded. All instances will be replaced and " +"undo history will be cleared." +msgstr "" +"Наразі завантажується імпортований ресурс. Всі екземпляри будуть замінені, а " +"історія скасувань буде очищена." + +msgid "" "Select a resource file in the filesystem or in the inspector to adjust import " "settings." msgstr "" @@ -5329,9 +5688,6 @@ msgstr "Завантажити наявний ресурс із диска та msgid "Save the currently edited resource." msgstr "Зберегти поточний редагований ресурс." -msgid "Save As..." -msgstr "Зберегти як..." - msgid "Extra resource options." msgstr "Додаткові параметри ресурсу." @@ -5458,18 +5814,66 @@ msgstr "Оновити" msgid "Plugin Name:" msgstr "Назва додатка:" +msgid "Required. This name will be displayed in the list of plugins." +msgstr "Обов'язкова умова. Ця назва буде відображатися у списку плагінів." + msgid "Subfolder:" msgstr "Підтека:" +msgid "" +"Optional. The folder name should generally use `snake_case` naming (avoid " +"spaces and special characters).\n" +"If left empty, the folder will be named after the plugin name converted to " +"`snake_case`." +msgstr "" +"Необов'язково. Ім'я теки зазвичай має використовувати регістр `snake_case` " +"(уникайте пробілів і спеціальних символів).\n" +"Якщо залишити теку порожньою, її буде названо ім'ям плагіна, перетвореним на " +"`snake_case`." + +msgid "" +"Optional. This description should be kept relatively short (up to 5 lines).\n" +"It will display when hovering the plugin in the list of plugins." +msgstr "" +"Необов'язково. Цей опис має бути відносно коротким (до 5 рядків).\n" +"Він відображатиметься при наведенні на плагін у списку плагінів." + msgid "Author:" msgstr "Автор:" +msgid "Optional. The author's username, full name, or organization name." +msgstr "" +"Необов'язково. Ім'я користувача, повне ім'я або назва організації автора." + msgid "Version:" msgstr "Версія:" +msgid "" +"Optional. A human-readable version identifier used for informational purposes " +"only." +msgstr "" +"Необов'язково. Ідентифікатор версії, що читається людиною і використовується " +"лише в інформаційних цілях." + +msgid "" +"Required. The scripting language to use for the script.\n" +"Note that a plugin may use several languages at once by adding more scripts " +"to the plugin." +msgstr "" +"Обов'язковий параметр. Мова скриптів, яку буде використано для скрипту.\n" +"Зверніть увагу, що плагін може використовувати декілька мов одночасно, " +"додавши більше скриптів до плагіна." + msgid "Script Name:" msgstr "Назва скрипту:" +msgid "" +"Optional. The path to the script (relative to the add-on folder). If left " +"empty, will default to \"plugin.gd\"." +msgstr "" +"Необов'язково. Шлях до скрипту (відносно теки доповнення). Якщо залишити " +"порожнім, за замовчуванням буде \"plugin.gd\"." + msgid "Activate now?" msgstr "Задіяти зараз?" @@ -5609,6 +6013,9 @@ msgstr "Вилучити точки і трикутники." msgid "Generate blend triangles automatically (instead of manually)" msgstr "Створити трикутники злиття автоматично (а не вручну)" +msgid "Parameter Changed: %s" +msgstr "Параметр змінено: %s" + msgid "Inspect Filters" msgstr "Оглянути фільтри" @@ -5805,6 +6212,9 @@ msgstr "Видалити анімацію з бібліотеки: %s" msgid "[built-in]" msgstr "[вбудована]" +msgid "[foreign]" +msgstr "[іноземна мова]" + msgid "[imported]" msgstr "[імпортована]" @@ -5983,6 +6393,12 @@ msgstr "Пересунути вузол" msgid "Transition exists!" msgstr "Існує перехід!" +msgid "Play/Travel to %s" +msgstr "Відтворення/подорож до %s" + +msgid "Edit %s" +msgstr "Редагування %s" + msgid "Add Node and Transition" msgstr "Додати вузол і перехід" @@ -6268,6 +6684,13 @@ msgstr "Крок повороту:" msgid "Scale Step:" msgstr "Крок масштабу:" +msgid "" +"Children of a container get their position and size determined only by their " +"parent." +msgstr "" +"Дочки контейнера отримують позицію і розмір, які визначаються тільки їхнім " +"батьком." + msgid "Move Node(s) to Position" msgstr "Пересунути вузол(и) на Позицію" @@ -6328,12 +6751,21 @@ msgstr "Заблоковано" msgid "Grouped" msgstr "Згруповано" +msgid "Add Node Here..." +msgstr "Додати вузол тут..." + +msgid "Instantiate Scene Here..." +msgstr "Миттєва сцена тут..." + msgid "Paste Node(s) Here" msgstr "Вставити вузол(и) сюди" msgid "Move Node(s) Here" msgstr "Пересунути вузол(и) сюди" +msgid "px" +msgstr "пкс." + msgid "units" msgstr "одиниць" @@ -6601,6 +7033,9 @@ msgstr "Кадрувати вибране" msgid "Preview Canvas Scale" msgstr "Попередній перегляд масштабованого полотна" +msgid "Project theme" +msgstr "Тема проекту" + msgid "Translation mask for inserting keys." msgstr "Маска перенесення для вставляння ключових кадрів." @@ -6653,6 +7088,10 @@ msgid "Drag and drop to add as child of current scene's root node." msgstr "" "Перетягніть, щоб додати дочірній елемент кореневому вузлу поточної сцени." +msgid "Hold %s when dropping to add as child of selected node." +msgstr "" +"Утримуйте %s при скиданні, щоб додати дочірню вершину до вибраного вузла." + msgid "Hold Shift when dropping to add as sibling of selected node." msgstr "" "Утримуйте Shift під час перетягування, щоб додати брата вибраному вузлу." @@ -6951,6 +7390,19 @@ msgstr "" "Якщо увімкнено цей параметр, у запущеному проєкті буде показано навігаційні " "сітки та полігони." +msgid "Debug CanvasItem Redraws" +msgstr "Налагодження перемальовувань CanvasItem" + +msgid "" +"When this option is enabled, redraw requests of 2D objects will become " +"visible (as a short flash) in the running project.\n" +"This is useful to troubleshoot low processor mode." +msgstr "" +"Якщо цю опцію увімкнено, запити на перемальовування 2D-об'єктів стануть " +"видимими (у вигляді короткого спалаху) у запущеному проекті.\n" +"Це корисно для усунення несправностей у режимі низької завантаженості " +"процесора." + msgid "Synchronize Scene Changes" msgstr "Синхронізувати зміни сцени" @@ -6999,6 +7451,15 @@ msgstr[0] "Запустити %d вставлений екземпляр" msgstr[1] "Запустити %d вставлені екземпляри" msgstr[2] "Запустити %d вставлених екземплярів" +msgid "Size: %s" +msgstr "Розмір: %s" + +msgid "Type: %s" +msgstr "Введіть: %s" + +msgid "Dimensions: %d × %d" +msgstr "Розміри: %d × %d" + msgid "Overrides (%d)" msgstr "Перевизначення (%d)" @@ -7192,6 +7653,12 @@ msgstr "" msgid "Select path for SDF Texture" msgstr "Виберіть шлях до текстури SDF" +msgid "Reverse Gradient" +msgstr "Зворотний градієнт" + +msgid "Reverse/Mirror Gradient" +msgstr "Зворотний/дзеркальний градієнт" + msgid "Swap GradientTexture2D Fill Points" msgstr "Поміняти точки заповнення GradientTexture2D" @@ -7229,6 +7696,9 @@ msgstr "Коренева сцена редактора не знайдена." msgid "Lightmap data is not local to the scene." msgstr "Дані карти світла не є локальними для сцени." +msgid "Maximum texture size is too small for the lightmap images." +msgstr "Максимальний розмір текстури замалий для зображень з лайтмапами." + msgid "Bake Lightmaps" msgstr "Запікати карти освітлення" @@ -7304,6 +7774,12 @@ msgstr "Розгорнути UV2" msgid "Contained Mesh is not of type ArrayMesh." msgstr "Вбудована сітка не має типу ArrayMesh." +msgid "Only triangles are supported for lightmap unwrap." +msgstr "Для розгортання лайтмапами підтримуються лише трикутники." + +msgid "Normals are required for lightmap unwrap." +msgstr "Для розгортання лайтмапами потрібні нормалі." + msgid "UV Unwrap failed, mesh may not be manifold?" msgstr "UV-розгортка не вдалася, можливо у сітки не однозв'язна форма?" @@ -7531,6 +8007,9 @@ msgstr "Задати start_position" msgid "Set end_position" msgstr "Задати end_position" +msgid "Set NavigationObstacle3D Vertices" +msgstr "Встановити вершини NavigationObstacle3D" + msgid "Edit Poly" msgstr "Редагувати полігон" @@ -7540,6 +8019,16 @@ msgstr "Редагувати полігон (вилучити точку)" msgid "Create Navigation Polygon" msgstr "Створення навігаційного полігону" +msgid "" +"Bakes the NavigationPolygon by first parsing the scene for source geometry " +"and then creating the navigation polygon vertices and polygons." +msgstr "" +"Створює NavigationPolygon, спочатку розбираючи сцену на вихідну геометрію, а " +"потім створюючи вершини та полігони навігаційного полігону." + +msgid "Clears the internal NavigationPolygon outlines, vertices and polygons." +msgstr "Очищає внутрішні контури, вершини та полігони NavigationPolygon." + msgid "Unnamed Gizmo" msgstr "Гаджет без назви" @@ -7609,6 +8098,15 @@ msgstr "Вставлення ключа вимкнено (ключ не вста msgid "Animation Key Inserted." msgstr "Вставлено ключ анімації." +msgid "X: %s\n" +msgstr "X: %s\n" + +msgid "Y: %s\n" +msgstr "Y: %s\n" + +msgid "Z: %s\n" +msgstr "Z: %s\n" + msgid "Size: %s (%.1fMP)\n" msgstr "Розмір: %s (%.1fMP)\n" @@ -7675,6 +8173,15 @@ msgstr "Перенесення:" msgid "Rotating %s degrees." msgstr "Обертання на %s градусів." +msgid "Translating %s." +msgstr "Переклад %s." + +msgid "Rotating %f degrees." +msgstr "Поворот на %f градусів." + +msgid "Scaling %s." +msgstr "Масштабування %s." + msgid "Auto Orthogonal Enabled" msgstr "Увімкнено автоматичну ортогоналізацію" @@ -7726,6 +8233,12 @@ msgstr "Зонди SDFGI" msgid "Scene Luminance" msgstr "Яскравість сцени" +msgid "SSAO" +msgstr "SSAO" + +msgid "SSIL" +msgstr "SSIL" + msgid "VoxelGI/SDFGI Buffer" msgstr "Буфер VoxelGI/SDFGI" @@ -7738,6 +8251,9 @@ msgstr "Кластер OmniLight3D" msgid "SpotLight3D Cluster" msgstr "Кластер SpotLight3D" +msgid "Decal Cluster" +msgstr "Кластер наклейок" + msgid "ReflectionProbe Cluster" msgstr "Кластер ReflectionProbe" @@ -7846,6 +8362,13 @@ msgstr "" msgid "Overriding material..." msgstr "Замінювання матеріалу..." +msgid "" +"Drag and drop to override the material of any geometry node.\n" +"Hold %s when dropping to override a specific surface." +msgstr "" +"Перетягніть, щоб замінити матеріал будь-якого вузла геометрії.\n" +"Утримуйте %s при перетягуванні, щоб замінити певну поверхню." + msgid "XForm Dialog" msgstr "Вікно XForm" @@ -8219,6 +8742,12 @@ msgstr "Віддзеркалити довжини елемента керува msgid "Curve Point #" msgstr "Точку кривої #" +msgid "Handle In #" +msgstr "Handle In #" + +msgid "Handle Tilt #" +msgstr "Нахил ручки #" + msgid "Set Curve Point Position" msgstr "Задати положення точки кривої" @@ -8451,6 +8980,27 @@ msgstr "Не вдається отримати скрипт для переза msgid "Reload only takes effect on tool scripts." msgstr "Перезавантаження діє лише для скриптів інструментів." +msgid "Cannot run the edited file because it's not a script." +msgstr "Неможливо запустити відредагований файл, оскільки він не є скриптом." + +msgid "Cannot run the script because it contains errors, check the output log." +msgstr "" +"Не вдається запустити скрипт, оскільки він містить помилки, перевірте журнал " +"виводу." + +msgid "Cannot run the script because it doesn't extend EditorScript." +msgstr "Неможливо запустити скрипт, оскільки він не розширює EditorScript." + +msgid "" +"Cannot run the script because it's not a tool script (add the @tool " +"annotation at the top)." +msgstr "" +"Неможливо запустити скрипт, оскільки він не є інструментальним (додайте " +"зверху анотацію @tool)." + +msgid "Cannot run the script because it's not a tool script." +msgstr "Неможливо запустити скрипт, оскільки він не є інструментальним." + msgid "Import Theme" msgstr "Імпортувати тему" @@ -8566,6 +9116,9 @@ msgstr "" msgid "Search Results" msgstr "Результати пошуку" +msgid "There are unsaved changes in the following built-in script(s):" +msgstr "У наступних вбудованих скриптах є незбережені зміни:" + msgid "Clear Recent Scripts" msgstr "Спорожнити список нещодавніх скриптів" @@ -8575,6 +9128,9 @@ msgstr "Стандартний" msgid "Plain Text" msgstr "Звичайний текст" +msgid "JSON" +msgstr "ДЖЕСОН" + msgid "Connections to method:" msgstr "З'єднання з методом:" @@ -8602,6 +9158,14 @@ msgstr "Рядок" msgid "Go to Function" msgstr "Перейти до функції" +msgid "" +"The resource does not have a valid path because it has not been saved.\n" +"Please save the scene or resource that contains this resource and try again." +msgstr "" +"Ресурс не має правильного шляху, оскільки його не було збережено.\n" +"Будь ласка, збережіть сцену або ресурс, який містить цей ресурс, і спробуйте " +"ще раз." + msgid "Can't drop nodes without an open scene." msgstr "Неможливо скинути вузли без відкритої сцени." @@ -8734,6 +9298,9 @@ msgstr "Відкрити файл в Інспекторі" msgid "Close File" msgstr "Закрити файл" +msgid "Make the shader editor floating." +msgstr "Зробіть редактор шейдерів плаваючим." + msgid "No valid shader stages found." msgstr "Допустимих етапів шейдера не знайдено." @@ -8760,7 +9327,7 @@ msgid "Create Rest Pose from Bones" msgstr "Створити вільну позу з кісток" msgid "Skeleton2D" -msgstr "Skeleton2D" +msgstr "Skeleton2D (Скелет 2Д)" msgid "Reset to Rest Pose" msgstr "Відновити вільну позу" @@ -8777,6 +9344,9 @@ msgstr "Не можна створити фізичний скелет для в msgid "Create physical bones" msgstr "Створити фізичний кістяк" +msgid "Cannot export a SkeletonProfile for a Skeleton3D node with no bones." +msgstr "Неможливо експортувати SkeletonProfile для вузла Skeleton3D без кісток." + msgid "Export Skeleton Profile As..." msgstr "Експортувати профіль скелета як..." @@ -8784,7 +9354,7 @@ msgid "Set Bone Parentage" msgstr "Задати кістці предка" msgid "Skeleton3D" -msgstr "Skeleton3D" +msgstr "Skeleton3D (Скелет 3Д)" msgid "Reset All Bone Poses" msgstr "Скинути всі пози кісток" @@ -8871,7 +9441,7 @@ msgid "Create LightOccluder2D Sibling" msgstr "Створити близнюка LightOccluder2D" msgid "Sprite2D" -msgstr "Sprite2D" +msgstr "Спрайт2Д" msgid "Simplification:" msgstr "Спрощення:" @@ -8975,9 +9545,42 @@ msgstr "Перемістити кадр вправо" msgid "Select Frames" msgstr "Вибрати кадри" +msgid "Frame Order" +msgstr "Порядок кадрів" + +msgid "By Row" +msgstr "По рядах" + +msgid "Left to Right, Top to Bottom" +msgstr "Зліва направо, зверху вниз" + +msgid "Left to Right, Bottom to Top" +msgstr "Зліва направо, знизу вгору" + +msgid "Right to Left, Top to Bottom" +msgstr "Справа наліво, зверху вниз" + +msgid "Right to Left, Bottom to Top" +msgstr "Справа наліво, знизу вгору" + +msgid "By Column" +msgstr "По колонці" + +msgid "Horizontal" +msgstr "Горизонтальний" + +msgid "Vertical" +msgstr "Вертикальний" + msgid "Size" msgstr "Розмір" +msgid "Separation" +msgstr "Розлука" + +msgid "Offset" +msgstr "Зміщення" + msgid "Create Frames from Sprite Sheet" msgstr "Створити кадри з аркуша спрайтів" @@ -8994,6 +9597,9 @@ msgstr "" "До цього шейдера внесено зміни на диску.\n" "Що слід зробити?" +msgid "%s Mipmaps" +msgstr "%s Mip-карти" + msgid "Memory: %s" msgstr "Пам'ять: %s" @@ -9587,6 +10193,9 @@ msgstr "Перезавантажити сцену для відтворення msgid "Merge TileSetAtlasSource" msgstr "Об'єднати TileSetAtlasSource" +msgid "%s (ID: %d)" +msgstr "%s (АЙДИ: %d)" + msgid "Atlas Merging" msgstr "Об'єднати атласи" @@ -9620,6 +10229,13 @@ msgstr "" "Координати атласу: %s\n" "Альтернатива: %d" +msgid "" +"The selected atlas source has no valid texture. Assign a texture in the " +"TileSet bottom tab." +msgstr "" +"Вибране джерело атласу не має правильної текстури. Призначте текстуру на " +"нижній вкладці TileSet." + msgid "Base Tiles" msgstr "Базова плитка" @@ -9692,6 +10308,9 @@ msgstr "Набір для малювання місцевості" msgid "Painting Terrain" msgstr "Малювання місцевості" +msgid "Can't rotate patterns when using non-square tile grid." +msgstr "Неможливо обертати шаблони при використанні неквадратної сітки плиток." + msgid "No Texture Atlas Source (ID: %d)" msgstr "Нема джерела текстурного атласу (ID: %d)" @@ -9707,12 +10326,25 @@ msgstr "Додати шаблон Набору плиток" msgid "Remove TileSet patterns" msgstr "Вилучити шаблон Набору плиток" +msgid "Index: %d" +msgstr "Індекс: %d" + msgid "Tile with Invalid Scene" msgstr "Плитка з неприпустимою сценою" +msgid "" +"The selected scene collection source has no scenes. Add scenes in the TileSet " +"bottom tab." +msgstr "" +"Вибране джерело колекції сцен не містить сцен. Додайте сцени на нижній " +"вкладці TileSet." + msgid "Delete tiles" msgstr "Видалити плитки" +msgid "Drawing Rect:" +msgstr "Прямокутник для малювання:" + msgid "Change selection" msgstr "Змінити вибір" @@ -9741,6 +10373,12 @@ msgstr "Лінія" msgid "Rect" msgstr "Прямокутник" +msgid "Bucket" +msgstr "Відро" + +msgid "Alternatively hold %s with other tools to pick tile." +msgstr "Або утримуйте %s іншими інструментами, щоб вибрати плитку." + msgid "Eraser" msgstr "Гумка" @@ -9838,6 +10476,13 @@ msgstr "Перемкнути видимість ґратки." msgid "Automatically Replace Tiles with Proxies" msgstr "Автоматична заміна плиток на проксі" +msgid "" +"The edited TileMap node has no TileSet resource.\n" +"Create or load a TileSet resource in the Tile Set property in the inspector." +msgstr "" +"Відредагований вузол TileMap не має ресурсу TileSet.\n" +"Створіть або завантажте ресурс TileSet у властивості Tile Set в інспекторі." + msgid "Remove Tile Proxies" msgstr "Видалити проксі плиток" @@ -9927,15 +10572,37 @@ msgstr "Фізика" msgid "Physics Layer %d" msgstr "Фізичний шар %d" +msgid "No physics layers" +msgstr "Ніяких фізичних шарів" + +msgid "" +"Create and customize physics layers in the inspector of the TileSet resource." +msgstr "Створюйте та налаштовуйте фізичні шари в інспекторі ресурсу TileSet." + msgid "Navigation Layer %d" msgstr "Шар навігації %d" +msgid "No navigation layers" +msgstr "Немає навігаційних шарів" + +msgid "" +"Create and customize navigation layers in the inspector of the TileSet " +"resource." +msgstr "" +"Створюйте та налаштовуйте навігаційні шари в інспекторі ресурсу TileSet." + msgid "Custom Data" msgstr "Спеціальні дані" msgid "Custom Data %d" msgstr "Спеціальні дані %d" +msgid "" +"Create and customize custom data layers in the inspector of the TileSet " +"resource." +msgstr "" +"Створюйте та налаштовуйте кастомні шари даних в інспекторі ресурсу TileSet." + msgid "Select a property editor" msgstr "Вибрати редактор властивостей" @@ -9986,6 +10653,13 @@ msgstr "Вибрати плитки." msgid "Paint properties." msgstr "Властивості малювання." +msgid "" +"No tiles selected.\n" +"Select one or more tiles from the palette to edit its properties." +msgstr "" +"Не вибрано жодної плитки.\n" +"Виберіть одну або декілька плиток з палітри, щоб змінити їхні властивості." + msgid "Paint Properties:" msgstr "Властивості малювання:" @@ -9995,6 +10669,13 @@ msgstr "Створення плиток у непрозорих областях msgid "Remove Tiles in Fully Transparent Texture Regions" msgstr "Видалити плитки у повністю прозорих областях текстури" +msgid "" +"The current atlas source has tiles outside the texture.\n" +"You can clear it using \"%s\" option in the 3 dots menu." +msgstr "" +"Поточне джерело атласу має плитки за межами текстури.\n" +"Ви можете очистити його за допомогою опції \"%s\" у меню 3 крапки." + msgid "Create an Alternative Tile" msgstr "Створити альтернативну плитку" @@ -10038,9 +10719,31 @@ msgstr "Відкрити інструмент злиття атласів" msgid "Manage Tile Proxies" msgstr "Керівник проксі плиток" +msgid "" +"No TileSet source selected. Select or create a TileSet source.\n" +"You can create a new source by using the Add button on the left or by " +"dropping a tileset texture onto the source list." +msgstr "" +"Не вибрано жодного джерела TileSet.\n" +"Виберіть або створіть джерело TileSet'а. Ви можете створити нове джерело за " +"допомогою кнопки Додати ліворуч або перетягнувши текстуру набору плиток до " +"списку джерел." + msgid "Add new patterns in the TileMap editing mode." msgstr "Додати нові візерунки в режимі редагування Карти плиток." +msgid "" +"Warning: Modifying a source ID will result in all TileMaps using that source " +"to reference an invalid source instead. This may result in unexpected data " +"loss. Change this ID carefully." +msgstr "" +"Попередження: Зміна ідентифікатора джерела призведе до того, що всі TileMaps, " +"які використовують це джерело, посилатимуться на недійсне джерело. Це може " +"призвести до неочікуваної втрати даних. Змінюйте цей ідентифікатор обережно." + +msgid "ID: %d" +msgstr "ID: %d" + msgid "Add a Scene Tile" msgstr "Додайте плитку сцени" @@ -10277,6 +10980,12 @@ msgstr "Додати вхід" msgid "Add Output" msgstr "Додати вихід" +msgid "Float" +msgstr "Поплавок" + +msgid "UInt" +msgstr "Ю-інт" + msgid "Boolean" msgstr "Булеве" @@ -11005,6 +11714,12 @@ msgstr "" "Повертає значення глибини, отримане з попереднього проходу глибини в " "лінійному просторі." +msgid "Reconstructs the World Position of the Node from the depth texture." +msgstr "Відновлює світову позицію вузла на основі текстури глибини." + +msgid "Unpacks the Screen Normal Texture in World Space" +msgstr "Розпаковує нормальну текстуру екрана у світовому просторі" + msgid "Perform the 2D texture lookup." msgstr "Виконує пошук 2D текстури." @@ -11112,6 +11827,9 @@ msgstr "" msgid "Remaps a given input from the input range to the output range." msgstr "Відображає вхідні дані з діапазону вводу у діапазон виводу." +msgid "Rotates an input vector by a given angle." +msgstr "Повертає вхідний вектор на заданий кут." + msgid "Vector function." msgstr "Векторна функція." @@ -11358,6 +12076,9 @@ msgstr "Отримати параметр варіації." msgid "Set varying parameter." msgstr "Встановити параметр варіації." +msgid "Edit Visual Property: %s" +msgstr "Редагувати візуальну властивість: %s" + msgid "Visual Shader Mode Changed" msgstr "Змінено режим візуального шейдерів" @@ -11393,6 +12114,13 @@ msgid "This directory already contains a Godot project." msgstr "У цьому каталозі вже міститься проєкт Godot." msgid "" +"You cannot save a project in the selected path. Please make a new folder or " +"choose a new path." +msgstr "" +"Ви не можете зберегти проект у вибраному шляху. Будь ласка, створіть нову " +"папку або виберіть новий шлях." + +msgid "" "The selected path is not empty. Choosing an empty folder is highly " "recommended." msgstr "" @@ -11546,6 +12274,9 @@ msgstr "Метадані керування версіями:" msgid "Git" msgstr "Git" +msgid "This project was last edited in a different Godot version: " +msgstr "Цей проект востаннє редагувався в іншій версії Godot: " + msgid "This project uses features unsupported by the current build:" msgstr "Цей проект використовує функції, які не підтримуються поточною збіркою:" @@ -11699,8 +12430,8 @@ msgid "" "Godot %s.\n" "\n" msgstr "" -"Попередження: Цей проект було створено на мові Godot %s.\n" -"Відкриття проекту покращить або погіршить його якість до версії Godot %s.\n" +"Попередження: Цей проект востаннє було відредаговано у Godot %s.При відкритті " +"буде змінено на Godot %s.\n" "\n" msgid "" @@ -11739,6 +12470,9 @@ msgstr "" msgid "Are you sure to run %d projects at once?" msgstr "Ви справді хочете запустити %d проєктів одночасно?" +msgid "Tag name must be lowercase." +msgstr "Ім'я тегу повинно бути маленькими літерами." + msgid "Remove %d projects from the list?" msgstr "Вилучити зі списку %d проєктів?" @@ -11801,6 +12535,9 @@ msgstr "" msgid "Last Edited" msgstr "Останнє редагування" +msgid "Tags" +msgstr "Теги" + msgid "Edit Project" msgstr "Редагувати проєкт" @@ -11835,6 +12572,18 @@ msgstr "" "Наразі у вас немає проєктів.\n" "Бажаєте переглянути офіційні приклади проєктів з бібліотеки ресурсів?" +msgid "Click tag to remove it from the project." +msgstr "Клацніть тег, щоб видалити його з проекту." + +msgid "Click tag to add it to the project." +msgstr "Натисніть на тег, щоб додати його до проекту." + +msgid "Create New Tag" +msgstr "Створити новий тег" + +msgid "Tags are capitalized automatically when displayed." +msgstr "Теги автоматично починаються з великої літери при відображенні." + msgid "Add Project Setting" msgstr "Додавання параметрів проекту" @@ -12022,6 +12771,9 @@ msgstr "Файл уже існує." msgid "Invalid root node name." msgstr "Некоректна назва кореневого вузла." +msgid "Invalid root node name characters have been replaced." +msgstr "Замінено невірні символи імені кореневого вузла." + msgid "Root Type:" msgstr "Тип кореня:" @@ -12040,6 +12792,13 @@ msgstr "Назва сцени:" msgid "Root Name:" msgstr "Назва кореня:" +msgid "" +"When empty, the root node name is derived from the scene name based on the " +"\"editor/naming/node_name_casing\" project setting." +msgstr "" +"Якщо порожньо, ім'я кореневого вузла походить від імені сцени на основі " +"параметра проекту \"editor/naming/node_name_casing\"." + msgid "Scene name is valid." msgstr "Назва сцени коректна." @@ -12115,6 +12874,9 @@ msgstr "Вилучити вузол «%s» і його дочірні запис msgid "Delete node \"%s\"?" msgstr "Вилучити вузол «%s»?" +msgid "Some nodes are referenced by animation tracks." +msgstr "На деякі вузли посилаються доріжки анімації." + msgid "Saving the branch as a scene requires having a scene open in the editor." msgstr "" "Щоб можна було зберегти гілку як сцену, сцена має бути відкрита у редакторі." @@ -12294,9 +13056,36 @@ msgstr "" msgid "Can't paste root node into the same scene." msgstr "Не можна вставляти кореневий вузол до сцени цього кореневого вузла." +msgid "Paste Node(s) as Sibling of %s" +msgstr "Вставити Вузол(и) як брата або сестру %s" + +msgid "Paste Node(s) as Child of %s" +msgstr "Вставити вузол(и) як дочірній до %s" + +msgid "<Unnamed> at %s" +msgstr "<Unnamed> at %s" + +msgid "Add Child Node..." +msgstr "Додати дочірній вузол..." + +msgid "Instantiate Child Scene..." +msgstr "Миттєва дитяча сцена..." + msgid "Expand/Collapse Branch" msgstr "Розгорнути/Згорнути гілку" +msgid "Paste as Sibling" +msgstr "Вставити як брата або сестру" + +msgid "Change Type..." +msgstr "Тип зміни..." + +msgid "Attach Script..." +msgstr "Прикріпити скрипт..." + +msgid "Extend Script..." +msgstr "Розширити сценарій..." + msgid "Reparent to New Node" msgstr "Змінити батьківський вузол на новий" @@ -12319,6 +13108,20 @@ msgstr "" "Створити екземпляр файла сцени як вузол. Створює успадковану сцену, якщо " "кореневого вузла не існує." +msgid "Filter: name, t:type, g:group" +msgstr "Фільтр: назва, t:тип, g:група" + +msgid "" +"Filter nodes by entering a part of their name, type (if prefixed with \"type:" +"\" or \"t:\")\n" +"or group (if prefixed with \"group:\" or \"g:\"). Filtering is case-" +"insensitive." +msgstr "" +"Відфільтруйте вузли, ввівши частину їхньої назви, тип (з префіксом \"type:\" " +"або \"t:\")\n" +"або групу (з префіксом \"group:\" або \"g:\"). Фільтрація не залежить від " +"регістру." + msgid "Attach a new or existing script to the selected node." msgstr "Долучити новий або наявний скрипт до позначеного вузла." @@ -12498,6 +13301,9 @@ msgstr "Створити шейдер" msgid "Set Shader Global Variable" msgstr "Встановити глобальну змінну шейдера" +msgid "Please specify a valid shader uniform identifier name." +msgstr "Будь ласка, вкажіть правильне ім'я ідентифікатора шейдерної уніформи." + msgid "Global shader parameter '%s' already exists'" msgstr "Глобальний параметр шейдера '%s' вже існує'" @@ -12507,6 +13313,29 @@ msgstr "Назва '%s' є зарезервованим ключовим сло msgid "Add Shader Global Parameter" msgstr "Додати глобальний параметр шейдера" +msgid "" +"This project uses meshes with an outdated mesh format from previous Godot " +"versions. The engine needs to update the format in order to use those meshes. " +"Please use the 'Upgrade Mesh Surfaces' tool from the 'Project > Tools' menu. " +"You can ignore this message and keep using outdated meshes, but keep in mind " +"that this leads to increased load times every time you load the project." +msgstr "" +"У цьому проекті використовуються сіті із застарілим форматом з попередніх " +"версій Godot. Рушій повинен оновити формат, щоб використовувати ці сіті. Будь " +"ласка, скористайтеся інструментом \"Upgrade Mesh Surfaces\" з меню \"Project " +"> Tools\". Ви можете проігнорувати це повідомлення і продовжувати " +"використовувати застарілі сіті, але майте на увазі, що це призведе до " +"збільшення часу завантаження при кожному завантаженні проекту." + +msgid "" +"This project uses meshes with an outdated mesh format. Check the output log." +msgstr "" +"У цьому проекті використовуються сіті із застарілим форматом. Перевірте лог " +"виводу." + +msgid "Select Screen" +msgstr "Виберіть екран" + msgid "Change Cylinder Radius" msgstr "Змінити радіус циліндра" @@ -12549,6 +13378,9 @@ msgstr "Некоректний формат словника екземпляр msgid "Invalid instance dictionary (invalid subclasses)" msgstr "Некоректний словник екземпляра (некоректні підкласи)" +msgid "Cannot instantiate GDScript class." +msgstr "Не вдається створити екземпляр класу GDScript." + msgid "Value of type '%s' can't provide a length." msgstr "Значення типу '%s' не може мати довжину." @@ -12584,6 +13416,9 @@ msgstr "Шлях не містить інсталятора Blender'а." msgid "Can't execute Blender binary." msgstr "Не вдається запустити файл Blender'а." +msgid "Unexpected --version output from Blender binary at: %s." +msgstr "Неочікуване виведення --версії з бінарного файлу Blender'а при: %s." + msgid "Path supplied lacks a Blender binary." msgstr "У наданому шляху відсутній бінарний файл Blender." @@ -12737,6 +13572,9 @@ msgstr "Пряме освітлення ділянки" msgid "Integrate indirect lighting" msgstr "Інтеграція непрямого освітлення" +msgid "Integrate indirect lighting %d%%" +msgstr "Інтегрувати непряме освітлення %d%%" + msgid "Baking lightprobes" msgstr "Запікання світлових зондів" @@ -12752,6 +13590,9 @@ msgstr "Отримання текстур" msgid "Class name can't be a reserved keyword" msgstr "Назвою класу не може бути зарезервоване ключове слово" +msgid "Class name must be a valid identifier" +msgstr "Ім'я класу має бути дійсним ідентифікатором" + msgid "Not enough bytes for decoding bytes, or invalid format." msgstr "Недостатньо байтів для їх декодування або вказано некоректний формат." @@ -12772,6 +13613,9 @@ msgstr "" msgid "Failed to load .NET runtime" msgstr "Не вдалося завантажити середовище виконання .NET" +msgid ".NET assemblies not found" +msgstr ".NET збірок не знайдено" + msgid "" "Unable to load .NET runtime, specifically hostfxr.\n" "Attempting to create/edit a project will lead to a crash.\n" @@ -12852,6 +13696,9 @@ msgstr "Будь ласка, спочатку виберіть MultiplayerSynchr msgid "The MultiplayerSynchronizer needs a root path." msgstr "MultiplayerSynchronizer потребує кореневого шляху." +msgid "Invalid property path: '%s'" +msgstr "Неправильний шлях до властивості: '%s'" + msgid "Delete Property?" msgstr "Видалити властивість?" @@ -13089,6 +13936,9 @@ msgstr "Запуск на пристрої…" msgid "Could not execute on device." msgstr "Не вдалося виконати на пристрої." +msgid "Android architecture %s not supported in C# projects." +msgstr "Архітектура Android %s не підтримується у проектах C#." + msgid "" "Android build template not installed in the project. Install it from the " "Project menu." @@ -13256,23 +14106,16 @@ msgstr "Не вдалося записати файл пакунка розши msgid "Building Android Project (gradle)" msgstr "Збирання проєкту Android (gradle)" -msgid "" -"Building of Android project failed, check output for the error. Alternatively " -"visit docs.godotengine.org for Android build documentation." +msgid "Building of Android project failed, check output for the error:" msgstr "" -"Не вдалося виконати збирання проєкту для Android. Ознайомтеся із виведеними " -"даними, щоб визначити причину помилки. Крім того, можете відвідати docs." -"godotengine.org і ознайомитися із документацією щодо збирання для Android." +"Збірка проекту Android завершилася невдало, перевірте вивід на наявність " +"помилки:" msgid "Moving output" msgstr "Пересування виведених даних" -msgid "" -"Unable to copy and rename export file, check gradle project directory for " -"outputs." -msgstr "" -"Не вдалося скопіювати і перейменувати файл експортованих даних. Виведені дані " -"можна знайти у каталозі проєкту gradle." +msgid "Unable to copy and rename export file:" +msgstr "Неможливо скопіювати та перейменувати файл експорту:" msgid "Package not found: \"%s\"." msgstr "Пакунок не знайдено: \"%s\"." @@ -13702,6 +14545,15 @@ msgstr "Відсутній розмір піктограми \"%d\"." msgid "Failed to rename temporary file \"%s\"." msgstr "Не вдалося перейменувати тимчасовий файл \"%s\"." +msgid "Invalid icon path." +msgstr "Неправильний шлях до іконки." + +msgid "Invalid file version." +msgstr "Неправильна версія файлу." + +msgid "Invalid product version." +msgstr "Неправильна версія продукту." + msgid "Could not find rcedit executable at \"%s\"." msgstr "Не вдалося знайти виконуваний файл rcedit за адресою \"%s\"." @@ -14488,6 +15340,9 @@ msgstr "" "ButtonGroup призначено для використання лише з кнопками, для яких toggle_mode " "встановлено у true." +msgid "Copy this constructor in a script." +msgstr "Скопіюйте цей конструктор у скрипт." + msgid "" "Color: #%s\n" "LMB: Apply color\n" @@ -14673,15 +15528,6 @@ msgstr "" "ризику втрати даних." msgid "" -"Setting node name '%s' to be unique within scene for '%s', but it's already " -"claimed by '%s'.\n" -"'%s' is no longer set as having a unique name." -msgstr "" -"Встановлення назви вузла '%s' як унікального у сцені для '%s', але на неї вже " -"претендує '%s'.\n" -"'%s' більше не визначено як унікальну назву." - -msgid "" "This node is marked as deprecated and will be removed in future versions.\n" "Please check the Godot documentation for information about migration." msgstr "" @@ -14721,27 +15567,6 @@ msgstr "" "Щоб програма могла хоч щось показати, розмір поля перегляду має бути більшим " "або рівним 2 пікселям в обох вимірах." -msgid "Cannot open font from file: %s." -msgstr "Не вдалося відкрити шрифт із файлу: %s." - -msgid "Version %d of BMFont is not supported (should be 3)." -msgstr "Версія %d BMFont не підтримується (має бути 3)." - -msgid "Invalid BMFont info block size." -msgstr "Некоректний розмір інформаційного блоку BMFont." - -msgid "Invalid BMFont common block size." -msgstr "Неправильний загальний розмір блоку BMFont." - -msgid "Can't load font texture: %s." -msgstr "Не вдається завантажити текстуру шрифту: %s." - -msgid "Unsupported BMFont texture format." -msgstr "Непідтримуваний формат текстури BMFont." - -msgid "Invalid BMFont block type." -msgstr "Недійсний тип блоку BMFont." - msgid "" "Shader keywords cannot be used as parameter names.\n" "Choose another name." @@ -15230,6 +16055,12 @@ msgstr "" "Допустимі рівномірні індекси екземплярів повинні знаходитися в діапазоні [0.." "%d]." +msgid "'hint_normal_roughness_texture' is not supported in '%s' shaders." +msgstr "'hint_normal_roughness_texture' не підтримується у шейдерах '%s'." + +msgid "'hint_depth_texture' is not supported in '%s' shaders." +msgstr "'hint_depth_texture' не підтримується у шейдерах '%s'." + msgid "This hint is only for sampler types." msgstr "Ця підказка стосується лише типів семплерів." @@ -15357,6 +16188,9 @@ msgstr "Відсутня умова." msgid "Condition evaluation error." msgstr "Помилка оцінки умови." +msgid "Unmatched else." +msgstr "Неперевершена." + msgid "Invalid else." msgstr "Некоректне else." @@ -15429,6 +16263,9 @@ msgstr "Функція '%s' оголошена, але ніде не викор msgid "The struct '%s' is declared but never used." msgstr "Структура '%s' оголошена, але ніде не використовується." +msgid "The uniform '%s' is declared but never used." +msgstr "Уніфікований символ '%s' декларується, але ніколи не використовується." + msgid "The varying '%s' is declared but never used." msgstr "Варіація '%s' оголошена, але ніде не використовується." diff --git a/editor/translations/editor/vi.po b/editor/translations/editor/vi.po index 24bfe7a071..119845453d 100644 --- a/editor/translations/editor/vi.po +++ b/editor/translations/editor/vi.po @@ -18,7 +18,7 @@ # LetterC67 <hoangdeptoong@gmail.com>, 2020, 2021. # Rev <revolnoom7801@gmail.com>, 2021. # SyliawDeV <thanhlongstranger@gmail.com>, 2021. -# IoeCmcomc <hopdaigia2004@gmail.com>, 2021, 2022. +# IoeCmcomc <hopdaigia2004@gmail.com>, 2021, 2022, 2023. # Hung <hungthitkhia@gmail.com>, 2021. # Paweł Fertyk <pfertyk@pfertyk.me>, 2022. # MInhTriet <luckyblockblack@gmail.com>, 2022. @@ -34,13 +34,15 @@ # plantcraft94 <plantcraft60@gmail.com>, 2023. # Anh Hoang Nguyen <iam@hoanganh.dev>, 2023. # Huu Le <huuptag@gmail.com>, 2023. +# Phaspez <tramtrimin@gmail.com>, 2023. +# phamminhkha <Phamminhkha.tc@gmail.com>, 2023. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor interface\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-10-15 16:02+0000\n" -"Last-Translator: Huu Le <huuptag@gmail.com>\n" +"PO-Revision-Date: 2023-12-04 01:29+0000\n" +"Last-Translator: IoeCmcomc <hopdaigia2004@gmail.com>\n" "Language-Team: Vietnamese <https://hosted.weblate.org/projects/godot-engine/" "godot/vi/>\n" "Language: vi\n" @@ -48,7 +50,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 5.1-dev\n" +"X-Generator: Weblate 5.3-dev\n" msgid "Main Thread" msgstr "Chủ đề chính" @@ -128,6 +130,33 @@ msgstr "Trục Y của cần điều khiển 4" msgid "Unknown Joypad Axis" msgstr "Trục chưa định danh của bàn di chuột" +msgid "Joypad Motion on Axis %d (%s) with Value %.2f" +msgstr "Chuyển động của Joypad trên Trục %d (%s) với Giá trị %.2f" + +msgid "Bottom Action, Sony Cross, Xbox A, Nintendo B" +msgstr "Hành động phía dưới, Sony X, Xbox A, Nintendo B" + +msgid "Left Action, Sony Square, Xbox X, Nintendo Y" +msgstr "Thao tác bên trái, Sony Vuông, Xbox X, Nintendo Y" + +msgid "Top Action, Sony Triangle, Xbox Y, Nintendo X" +msgstr "Thao tác phía trên, Sony Tam Giác, Xbox Y, Nintendo X" + +msgid "Back, Sony Select, Xbox Back, Nintendo -" +msgstr "Trở về, Sony Select, Xbox Back, Nintendo -" + +msgid "Guide, Sony PS, Xbox Home" +msgstr "Hướng dẫn, Sony PS, Xbox Home" + +msgid "Start, Xbox Menu, Nintendo +" +msgstr "Bắt đầu, Xbox Menu, Nintendo +" + +msgid "D-pad Up" +msgstr "D-pad Trên" + +msgid "D-pad Down" +msgstr "D-pad Dưới" + msgid "D-pad Left" msgstr "D-pad trái" @@ -137,6 +166,21 @@ msgstr "D-pad phải" msgid "canceled" msgstr "Huỷ bỏ" +msgid "touched" +msgstr "Đã chạm" + +msgid "Magnify Gesture at (%s) with factor %s" +msgstr "Cử chỉ Phóng to tại (%s) với hệ số (%s)" + +msgid "Pan Gesture at (%s) with delta (%s)" +msgstr "Cử chỉ Điều hướng tại (%s) với delta (%s)" + +msgid "MIDI Input on Channel=%s Message=%s" +msgstr "Ngõ vào MIDI tại Kênh=%s Tin nhắn=%s" + +msgid "Input Event with Shortcut=%s" +msgstr "Sự kiện Đầu vào với Phím tắt=%s" + msgid "Accept" msgstr "Xác nhận" @@ -233,6 +277,9 @@ msgstr "Đối số không hợp lệ để dựng '%s'" msgid "On call to '%s':" msgstr "Khi gọi đến '%s':" +msgid "Built-in script" +msgstr "Tập lệnh có sẵn:" + msgid "B" msgstr "B" @@ -254,6 +301,9 @@ msgstr "PiB" msgid "EiB" msgstr "EiB" +msgid "Example: %s" +msgstr "Ví dụ: %s" + msgid "" "Invalid action name. It cannot be empty nor contain '/', ':', '=', '\\' or " "'\"'" @@ -265,6 +315,9 @@ msgstr "Hành động với tên '%s' đã tồn tại." msgid "Add Event" msgstr "Thêm Sự kiện" +msgid "Filter by name..." +msgstr "Lọc theo tên..." + msgid "Add" msgstr "Thêm" @@ -577,6 +630,10 @@ msgstr "Dọn dẹp" msgid "Scale Ratio:" msgstr "Tỉ lệ phóng đại:" +msgctxt "Transition Type" +msgid "Sine" +msgstr "Sin" + msgid "Select Tracks to Copy" msgstr "Chọn các Track để sao chép" @@ -616,6 +673,10 @@ msgstr "Thay thế tất cả" msgid "Selection Only" msgstr "Chỉ chọn" +msgctxt "Indentation" +msgid "Tabs" +msgstr "Thẻ" + msgid "Toggle Scripts Panel" msgstr "Hiện/Ẩn bảng tập lệnh" @@ -647,24 +708,36 @@ msgid "" "Target method not found. Specify a valid method or attach a script to the " "target node." msgstr "" -"Phương thức không được tìm thấy. Chỉ định phương thức hợp lệ hoặc đính kèm " -"tập lệnh vào nút mục tiêu." +"Phương thức mục tiêu không được tìm thấy. Chỉ định phương thức hợp lệ hoặc " +"đính kèm tập lệnh vào nút mục tiêu." msgid "Connect to Node:" msgstr "Kết nối đến Nút:" msgid "Connect to Script:" -msgstr "Kết nối Tập lệnh:" +msgstr "Kết nối với tập lệnh:" msgid "From Signal:" msgstr "Từ tín hiệu:" +msgid "Filter Nodes" +msgstr "Lọc các nút" + msgid "Scene does not contain any script." msgstr "Cảnh không chứa tập lệnh nào cả." msgid "Select Method" msgstr "Chọn Phương thức" +msgid "Filter Methods" +msgstr "Lọc phương thức" + +msgid "No method found matching given filters." +msgstr "Không có phương thức nào khớp với bộ lọc này." + +msgid "Script Methods Only" +msgstr "Chỉ tìm phương thức tập lệnh" + msgid "Remove" msgstr "Xóa" @@ -724,6 +797,9 @@ msgstr "Bạn muốn xoá tất cả kết nối từ tín hiệu \"%s\"?" msgid "Signals" msgstr "Tín hiệu" +msgid "Filter Signals" +msgstr "Lọc tín hiệu" + msgid "Are you sure you want to remove all connections from this signal?" msgstr "Bạn có chắc muốn xóa bỏ tất cả kết nối từ tín hiệu này?" @@ -853,18 +929,33 @@ msgstr "Lỗi:" msgid "Copy Error" msgstr "Sao chép lỗi" +msgid "Open C++ Source on GitHub" +msgstr "Mở mã nguồn C++ trên GitHub" + +msgid "Video RAM" +msgstr "RAM video" + msgid "Skip Breakpoints" msgstr "Lờ đi điểm dừng" msgid "Step Into" msgstr "Bước vào" +msgid "Step Over" +msgstr "Bước qua" + msgid "Break" msgstr "Thoát" msgid "Continue" msgstr "Tiếp tục" +msgid "Thread:" +msgstr "Luồng:" + +msgid "Filter Stack Variables" +msgstr "Lọc biến ngăn xếp" + msgid "Breakpoints" msgstr "Điểm dừng" @@ -895,6 +986,9 @@ msgstr "Sử dụng" msgid "Misc" msgstr "Khác" +msgid "Set From Tree" +msgstr "Đặt từ cây" + msgid "Search Replacement For:" msgstr "Tìm kiếm thay thế cho:" @@ -939,6 +1033,18 @@ msgstr "Tìm kiếm tài nguyên thay thế:" msgid "Open" msgstr "Mở" +msgid "" +"The files being removed are required by other resources in order for them to " +"work.\n" +"Remove them anyway? (Cannot be undone.)\n" +"Depending on your filesystem configuration, the files will either be moved to " +"the system trash or deleted permanently." +msgstr "" +"Các tài nguyên khác cần những tệp bị xóa này mới hoạt động được.\n" +"Vẫn xóa hả? (không khôi phục được đâu.)\n" +"Tuỳ vào cấu hình hệ thống tệp của bạn, các tệp trên có thể được di chuyển vào " +"trong thùng rác hệ thống hoặc bị xoá vĩnh viễn." + msgid "Cannot remove:" msgstr "Không thể gỡ bỏ:" @@ -1015,21 +1121,6 @@ msgstr "Nhà tài trợ Vàng" msgid "Silver Sponsors" msgstr "Nhà tài trợ Bạc" -msgid "Bronze Sponsors" -msgstr "Nhà tài trợ Đồng" - -msgid "Mini Sponsors" -msgstr "Nhà tài trợ Nhỏ" - -msgid "Gold Donors" -msgstr "Người ủng hộ Vàng" - -msgid "Silver Donors" -msgstr "Người ủng hộ Bạc" - -msgid "Bronze Donors" -msgstr "Người ủng hộ Đồng" - msgid "Donors" msgstr "Người ủng hộ" @@ -1249,9 +1340,15 @@ msgstr "Lưu" msgid "Reset to Defaults" msgstr "Đặt lại thành mặc định" +msgid "Detect from Project" +msgstr "Phát hiện từ dự án" + msgid "Export Profile" msgstr "Xuất hồ sơ" +msgid "Filter Commands" +msgstr "Lọc lệnh" + msgid "Paste Params" msgstr "Dán các đối số" @@ -1395,6 +1492,10 @@ msgstr "" msgid "(Re)Importing Assets" msgstr "Nhập lại tài nguyên" +msgid "This value is an integer composed as a bitmask of the following flags." +msgstr "" +"Giá trị này là một số nguyên được tính như là bitmask của những flags sau." + msgid "Experimental" msgstr "Tính thử nghiệm" @@ -1486,6 +1587,9 @@ msgstr "Thuộc tính:" msgid "Signal:" msgstr "Tín hiệu:" +msgid "No description available." +msgstr "Không có mô tả." + msgid "%d match." msgstr "%d khớp." @@ -1577,11 +1681,22 @@ msgid "Thumbnail..." msgstr "Ảnh thu nhỏ..." msgid "Edit Filters" -msgstr "Chỉnh sửa Lọc" +msgstr "Sửa bộ lọc" msgid "Language:" msgstr "Ngôn ngữ:" +msgctxt "Locale" +msgid "Script:" +msgstr "Hệ chữ viết:" + +msgctxt "Locale" +msgid "Script" +msgstr "Hệ chữ viết" + +msgid "Filter Messages" +msgstr "Lọc thông điệp" + msgid "Clear Output" msgstr "Xoá đầu ra" @@ -1718,7 +1833,7 @@ msgid "Save Scene As..." msgstr "Lưu Cảnh thành..." msgid "Current scene not saved. Open anyway?" -msgstr "Cảnh hiện tại chưa lưu. Kệ mở luôn?" +msgstr "Cảnh hiện tại chưa được lưu. Vẫn mở chứ?" msgid "Nothing to undo." msgstr "Không có gì để hoàn tác." @@ -1790,17 +1905,6 @@ msgstr "" "Vô hiệu hoá phần bổ trợ tại '%s' để ngăn những lỗi về sau." msgid "" -"Unable to load addon script from path: '%s' Base type is not EditorPlugin." -msgstr "" -"Không thể tải tập lệnh bổ trợ từ đường dẫn: '%s' Kiểu cơ sở không phải " -"EditorPlugin." - -msgid "Unable to load addon script from path: '%s' Script is not in tool mode." -msgstr "" -"Không thể tải tập lệnh bổ trợ từ đường dẫn: '%s' Tập lệnh không ở trong chế " -"độ công cụ." - -msgid "" "Scene '%s' was automatically imported, so it can't be modified.\n" "To make changes to it, a new inherited scene can be created." msgstr "" @@ -1907,6 +2011,9 @@ msgstr "Mở gần đây" msgid "Save Scene" msgstr "Lưu Cảnh" +msgid "Export As..." +msgstr "Xuất thành..." + msgid "MeshLibrary..." msgstr "Thư viện hình lưới..." @@ -1917,10 +2024,10 @@ msgid "Quit" msgstr "Thoát" msgid "Project" -msgstr "Dự Án" +msgstr "Dự án" msgid "Project Settings..." -msgstr "Cài đặt Dự Án..." +msgstr "Cài đặt Dự án..." msgid "Version Control" msgstr "Theo dõi phiên bản" @@ -2106,7 +2213,7 @@ msgid "Warning!" msgstr "Cảnh báo!" msgid "Main Script:" -msgstr "Tập lệnhchính:" +msgstr "Tập lệnh chính:" msgid "Edit Plugin" msgstr "Chỉnh sửa Tiện ích" @@ -2184,6 +2291,9 @@ msgstr "Nạp nhanh" msgid "Make Unique" msgstr "Duy nhất" +msgid "Save As..." +msgstr "Lưu thành ..." + msgid "Show in FileSystem" msgstr "Hiện trong Hệ thống tệp tin" @@ -2211,6 +2321,9 @@ msgstr "Cài đặt Trình biên tập" msgid "General" msgstr "Tổng quan" +msgid "Filter Settings" +msgstr "Thiết đặt bộ lọc" + msgid "The editor must be restarted for changes to take effect." msgstr "Thay đổi sẽ được áp dụng sau khi Trình biên tập khởi động lại." @@ -2223,6 +2336,9 @@ msgstr "Tất cả thiết bị" msgid "Device" msgstr "Thiết bị" +msgid "Filter by event..." +msgstr "Lọc theo sự kiện..." + msgid "Storing File:" msgstr "Lưu trữ tệp tin:" @@ -2413,6 +2529,9 @@ msgstr "Xuất các cảnh đã chọn (cùng các phần phụ thuộc)" msgid "Export selected resources (and dependencies)" msgstr "Xuất tài nguyên đã chọn (cùng các phần phụ thuộc)" +msgid "Export as dedicated server" +msgstr "Xuất một máy chủ chuyên biệt" + msgid "Export Mode:" msgstr "Chế độ xuất:" @@ -2511,6 +2630,9 @@ msgstr "Chỉnh sửa các phần phụ thuộc..." msgid "View Owners..." msgstr "Xem các scene sở hữu..." +msgid "Script..." +msgstr "Tập lệnh..." + msgid "Add to Favorites" msgstr "Thêm vào Ưa thích" @@ -2547,6 +2669,9 @@ msgstr "Đổi tên..." msgid "Re-Scan Filesystem" msgstr "Quét lại hệ thống tập tin" +msgid "Filter Files" +msgstr "Lọc tệp" + msgid "" "Scanning Files,\n" "Please Wait..." @@ -2768,8 +2893,11 @@ msgstr "Cảnh báo cấu hình nút:" msgid "Open in Editor" msgstr "Mở trong Trình biên soạn" +msgid "This script is currently running in the editor." +msgstr "Tập lệnh hiện đang chạy trong trình chỉnh sửa." + msgid "Open Script:" -msgstr "Mở Tệp lệnh:" +msgstr "Mở tập lệnh:" msgid "" "Node is locked.\n" @@ -2866,9 +2994,6 @@ msgstr "Tải tài nguyên có sẵn trong đĩa rồi chỉnh sửa." msgid "Save the currently edited resource." msgstr "Lưu tài nguyên đã chỉnh sửa hiện tại." -msgid "Save As..." -msgstr "Lưu thành ..." - msgid "Copy Resource" msgstr "Sao chép Tài nguyên" @@ -2929,6 +3054,9 @@ msgstr "Tên tập lệnh:" msgid "Activate now?" msgstr "Kích hoạt bây giờ?" +msgid "Script extension is valid." +msgstr "Phần mở rộng tập lệnh hợp lệ." + msgid "Create Polygon" msgstr "Tạo Polygon" @@ -3752,6 +3880,10 @@ msgstr "" msgid "Synchronize Script Changes" msgstr "Đồng bộ hóa thay đổi trong tập lệnh" +msgctxt "Locale" +msgid "Add Script" +msgstr "Thêm hệ chữ viết" + msgid " - Variation" msgstr " - Biến" @@ -4275,6 +4407,12 @@ msgstr "Bật/tắt sắp xếp danh sách phương thức theo bảng chữ cá msgid "Sort" msgstr "Sắp xếp" +msgid "Next Script" +msgstr "Tệp lệnh tiếp theo" + +msgid "Previous Script" +msgstr "Tệp lệnh trước đó" + msgid "File" msgstr "Tệp" @@ -4288,7 +4426,7 @@ msgid "Save All" msgstr "Lưu tất cả" msgid "Copy Script Path" -msgstr "Sao chép đường dẫn tệp lệnh" +msgstr "Sao chép đường dẫn tập lệnh" msgid "Theme" msgstr "Tông màu" @@ -4329,6 +4467,9 @@ msgstr "Tới tài liệu được chỉnh sửa trước đó." msgid "Go to next edited document." msgstr "Tới tài liệu được chỉnh sửa tiếp theo." +msgid "Make the script editor floating." +msgstr "Làm cho tập lệnh nổi lên." + msgid "Discard" msgstr "Hủy" @@ -4342,6 +4483,9 @@ msgstr "" msgid "Search Results" msgstr "Kết quả tìm kiếm" +msgid "Save changes to the following script(s) before quitting?" +msgstr "Lưu thay đổi trong các tập lệnh sau trước khi thoát không?" + msgid "Clear Recent Scripts" msgstr "Dọn các tệp lệnh gần đây" @@ -4752,6 +4896,9 @@ msgstr "Xóa cổng vào" msgid "Remove Output Port" msgstr "Xóa cổng ra" +msgid "Set Comment Description" +msgstr "Đặt mô tả chú thích" + msgid "Set Input Default Port" msgstr "Đặt cổng đầu vào mặc định" @@ -5111,6 +5258,9 @@ msgstr "Đường dẫn cài đặt Dự án:" msgid "Renderer:" msgstr "Trình kết xuất hình ảnh:" +msgid "This project was last edited in a different Godot version: " +msgstr "Dự án này đã được sửa đổi trong một phiên bản Godot khác: " + msgid "Error: Project is missing on the filesystem." msgstr "Lỗi: Dự án bị thiếu trên hệ thống tệp tin." @@ -5120,10 +5270,25 @@ msgstr "Dự án bị lỗi" msgid "Local" msgstr "Cục bộ" +msgid "Local Projects" +msgstr "Dự án cục bộ" + msgid "Can't open project at '%s'." msgstr "Không thể mở dự án tại '%s'." msgid "" +"Warning: This project was last edited in Godot %s. Opening will change it to " +"Godot %s.\n" +"\n" +msgstr "" +"Cảnh báo: Dự án này đã được sửa lần cuối bằng Godot %s. Mở dự án này sẽ thay " +"đổi nó sang Godot %s.\n" +"\n" + +msgid "Open anyway? Project will be modified." +msgstr "Vẫn mở chứ? Dự án sẽ được sửa đổi." + +msgid "" "Can't run project: no main scene defined.\n" "Please edit the project and set the main scene in the Project Settings under " "the \"Application\" category." @@ -5141,6 +5306,9 @@ msgstr "" msgid "Are you sure to run %d projects at once?" msgstr "Bạn có chắc chắn chạy các dự án %d cùng lúc?" +msgid "Remove this project from the list?" +msgstr "Loại bỏ dự án này ra khỏi danh sách chứ?" + msgid "" "Remove all missing projects from the list?\n" "The project folders' contents won't be modified." @@ -5172,6 +5340,21 @@ msgstr "Quét" msgid "Loading, please wait..." msgstr "Đang tải, đợi xíu..." +msgid "Filter Projects" +msgstr "Lọc các dự án" + +msgid "Last Edited" +msgstr "Sửa đổi lần cuối" + +msgid "Tags" +msgstr "Nhãn" + +msgid "Manage Tags" +msgstr "Quản lí nhãn" + +msgid "Remove Missing" +msgstr "Loại bỏ bị mất" + msgid "About" msgstr "Về chúng tôi" @@ -5390,6 +5573,9 @@ msgstr "Lỗi khi lưu scene." msgid "Error duplicating scene to save it." msgstr "Lỗi khi nhân bản cảnh để lưu." +msgid "Instantiate Script" +msgstr "Khởi tạo tập lệnh" + msgid "Sub-Resources" msgstr "Tài nguyên phụ" @@ -5411,6 +5597,15 @@ msgstr "" msgid "Can't paste root node into the same scene." msgstr "Không thể dán Nút Gốc vào cùng một Cảnh." +msgid "Add Child Node..." +msgstr "Thêm nút con..." + +msgid "Attach Script..." +msgstr "Đính kèm tập lệnh..." + +msgid "Extend Script..." +msgstr "Mở rộng tập lệnh..." + msgid "Reparent to New Node" msgstr "Thay nút mẹ thành nút mới" @@ -5424,7 +5619,10 @@ msgid "Add/Create a New Node." msgstr "Thêm/Tạo một nút mới." msgid "Attach a new or existing script to the selected node." -msgstr "Đính kèm một tập lệnh cho nút đã chọn." +msgstr "Đính kèm một tập lệnh mới hoặc đã tồn tại cho nút đã chọn." + +msgid "Detach the script from the selected node." +msgstr "Xoá tập lệnh khỏi nút đã chọn." msgid "Remote" msgstr "Từ xa" @@ -5451,14 +5649,17 @@ msgid "Template:" msgstr "Bản mẫu:" msgid "Error - Could not create script in filesystem." -msgstr "Lỗi - Không thể tạo tệp lệnh trong hệ thống tệp tin." +msgstr "Lỗi - Không thể tạo tập lệnh trong hệ thống tệp." msgid "Error loading script from %s" -msgstr "Lỗi nạp tệp lệnh từ %s" +msgstr "Lỗi nạp tập lệnh từ %s" msgid "Open Script / Choose Location" msgstr "Mở tệp lệnh / Chọn vị trí" +msgid "Open Script" +msgstr "Mở tập lệnh" + msgid "Invalid inherited parent name or path." msgstr "Tên hoặc đường dẫn nút mẹ được kế thừa không hợp lệ." @@ -5475,8 +5676,14 @@ msgstr "Tệp lệnh tích hợp (vào tệp cảnh)." msgid "Will load an existing script file." msgstr "Sẽ nạp một tệp lệnh đã tồn tại." +msgid "Script file already exists." +msgstr "Tệp tập lệnh đã tồn tại." + +msgid "Script path/name is valid." +msgstr "Tên/đường dẫn tập lệnh hợp lệ." + msgid "Will create a new script file." -msgstr "Sẽ tạo một tệp lệnh mới." +msgstr "Sẽ tạo một tệp tập lệnh mới." msgid "Built-in Script:" msgstr "Tệp lệnh có sẵn:" @@ -5517,6 +5724,13 @@ msgstr "Định dạng từ điển không hợp lệ (tệp lệnh không hợp msgid "Invalid instance dictionary (invalid subclasses)" msgstr "Từ điển không hợp lệ (Lớp con không hợp lệ)" +msgid "" +"Invalid type argument for is_instance_of(), should be a TYPE_* constant, a " +"class or a script." +msgstr "" +"Hàm convert() có loại đối số không hợp lệ, hãy sử dụng hằng TYPE_*, một lớp " +"hoặc một tập lệnh." + msgid "Next Plane" msgstr "Mặt phẳng tiếp theo" @@ -5655,13 +5869,6 @@ msgstr "" msgid "Building Android Project (gradle)" msgstr "Đang dựng dự án Android (gradle)" -msgid "" -"Unable to copy and rename export file, check gradle project directory for " -"outputs." -msgstr "" -"Không thể sao chép và đổi tên tệp xuất, hãy kiểm tra thư mục Gradle của dự án " -"để xem kết quả." - msgid "Invalid Identifier:" msgstr "Định danh không hợp lệ:" @@ -5671,6 +5878,9 @@ msgstr "Thiếu định danh." msgid "The character '%s' is not allowed in Identifier." msgstr "Không được phép có kí tự '%s' trong Định danh." +msgid "Uploading scripts..." +msgstr "Đang tải lên tập lệnh..." + msgid "Stop HTTP Server" msgstr "Dừng Máy chủ HTTP" diff --git a/editor/translations/editor/zh_CN.po b/editor/translations/editor/zh_CN.po index cffebee3bb..d07c26b59a 100644 --- a/editor/translations/editor/zh_CN.po +++ b/editor/translations/editor/zh_CN.po @@ -101,8 +101,8 @@ msgstr "" "Project-Id-Version: Chinese (Simplified) (Godot Engine)\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: 2018-01-20 12:15+0200\n" -"PO-Revision-Date: 2023-11-10 08:03+0000\n" -"Last-Translator: Haoyu Qiu <timothyqiu32@gmail.com>\n" +"PO-Revision-Date: 2023-12-07 14:59+0000\n" +"Last-Translator: 风青山 <idleman@yeah.net>\n" "Language-Team: Chinese (Simplified) <https://hosted.weblate.org/projects/" "godot-engine/godot/zh_Hans/>\n" "Language: zh_CN\n" @@ -110,7 +110,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 5.2-dev\n" +"X-Generator: Weblate 5.3-dev\n" msgid "Main Thread" msgstr "主线程" @@ -1950,6 +1950,9 @@ msgstr "开发人员" msgid "Authors" msgstr "作者" +msgid "Patrons" +msgstr "赞助人" + msgid "Platinum Sponsors" msgstr "白金赞助" @@ -1959,20 +1962,17 @@ msgstr "黄金赞助" msgid "Silver Sponsors" msgstr "白银赞助" -msgid "Bronze Sponsors" -msgstr "青铜赞助" - -msgid "Mini Sponsors" -msgstr "迷你赞助" +msgid "Diamond Members" +msgstr "钻石会员" -msgid "Gold Donors" -msgstr "黄金捐赠者" +msgid "Titanium Members" +msgstr "钛金会员" -msgid "Silver Donors" -msgstr "白银捐赠者" +msgid "Platinum Members" +msgstr "白金会员" -msgid "Bronze Donors" -msgstr "青铜捐赠者" +msgid "Gold Members" +msgstr "黄金会员" msgid "Donors" msgstr "捐助者" @@ -2811,12 +2811,24 @@ msgstr "方法说明" msgid "Operator Descriptions" msgstr "运算符说明" +msgid "Metadata:" +msgstr "元数据:" + msgid "Property:" msgstr "属性:" +msgid "Method:" +msgstr "方法:" + msgid "Signal:" msgstr "信号:" +msgid "Theme Item:" +msgstr "主题项目:" + +msgid "No description available." +msgstr "没有可用的描述。" + msgid "%d match." msgstr "%d 个匹配。" @@ -3372,28 +3384,28 @@ msgid "Export Mesh Library" msgstr "导出网格库" msgid "Unable to enable addon plugin at: '%s' parsing of config failed." -msgstr "无法在 “%s” 上启用加载项插件:配置解析失败。" +msgstr "无法启用位于 “%s” 的附加插件:配置解析失败。" msgid "Unable to find script field for addon plugin at: '%s'." -msgstr "无法在 “%s” 上找到加载项的 script 字段。" +msgstr "无法在 “%s” 上找到附加组件的 script 字段。" msgid "Unable to load addon script from path: '%s'." -msgstr "无法从路径 “%s” 中加载加载项脚本。" +msgstr "无法从路径 “%s” 加载附加组件脚本。" msgid "" "Unable to load addon script from path: '%s'. This might be due to a code " "error in that script.\n" "Disabling the addon at '%s' to prevent further errors." msgstr "" -"无法从路径“%s”加载加载项脚本:该脚本可能有代码错误。\n" -"禁用加载项“%s”可阻止其进一步报错。" +"无法从路径 “%s” 加载附加组件脚本:该脚本可能有代码错误。\n" +"正在禁用位于 “%s” 的附加组件以阻止其进一步报错。" msgid "" -"Unable to load addon script from path: '%s' Base type is not EditorPlugin." -msgstr "无法从路径 “%s” 加载加载项脚本:基类型不是 EditorPlugin。" +"Unable to load addon script from path: '%s'. Base type is not 'EditorPlugin'." +msgstr "无法从路径 “%s” 加载附加组件脚本。基类型不是 “EditorPlugin”。" -msgid "Unable to load addon script from path: '%s' Script is not in tool mode." -msgstr "无法从路径 “%s” 加载插件脚本:脚本不在工具模式下。" +msgid "Unable to load addon script from path: '%s'. Script is not in tool mode." +msgstr "无法从路径 “%s” 加载附加组件脚本。脚本不在工具模式下。" msgid "" "Scene '%s' was automatically imported, so it can't be modified.\n" @@ -3591,6 +3603,9 @@ msgstr "工具" msgid "Orphan Resource Explorer..." msgstr "孤立资源浏览器..." +msgid "Upgrade Mesh Surfaces..." +msgstr "升级网格表面..." + msgid "Reload Current Project" msgstr "重新加载当前项目" @@ -3896,6 +3911,12 @@ msgstr "" msgid "Assign..." msgstr "指定..." +msgid "Copy as Text" +msgstr "复制文本" + +msgid "Show Node in Tree" +msgstr "在树中显示节点" + msgid "Invalid RID" msgstr "无效的 RID" @@ -3980,6 +4001,9 @@ msgstr "唯一化" msgid "Make Unique (Recursive)" msgstr "唯一化(递归)" +msgid "Save As..." +msgstr "另存为..." + msgid "Show in FileSystem" msgstr "在文件系统中显示" @@ -4440,6 +4464,9 @@ msgstr "是否删除预设 “%s”?" msgid "Resources to exclude:" msgstr "排除的资源:" +msgid "Resources to override export behavior:" +msgstr "覆盖导出行为的资源:" + msgid "Resources to export:" msgstr "导出的资源:" @@ -4729,6 +4756,9 @@ msgstr "复制文件夹:" msgid "New Inherited Scene" msgstr "新建继承场景" +msgid "Set as Main Scene" +msgstr "设为主场景" + msgid "Open Scenes" msgstr "打开场景" @@ -4840,6 +4870,33 @@ msgstr "重命名..." msgid "Open in External Program" msgstr "在外部程序中打开" +msgid "Red" +msgstr "红色" + +msgid "Orange" +msgstr "橙色" + +msgid "Yellow" +msgstr "黄色" + +msgid "Green" +msgstr "绿色" + +msgid "Teal" +msgstr "青绿色" + +msgid "Blue" +msgstr "蓝色" + +msgid "Purple" +msgstr "紫色" + +msgid "Pink" +msgstr "粉色" + +msgid "Gray" +msgstr "灰色" + msgid "Go to previous selected folder/file." msgstr "转到之前选定的文件夹/文件。" @@ -4849,6 +4906,9 @@ msgstr "转到下一个选定的文件夹/文件。" msgid "Re-Scan Filesystem" msgstr "重新扫描文件系统" +msgid "Change Split Mode" +msgstr "修改拆分模式" + msgid "Filter Files" msgstr "筛选文件" @@ -5437,15 +5497,6 @@ msgstr "动态渲染的 TrueType/OpenType 字体" msgid "Prerendered multichannel(+true) signed distance field" msgstr "预渲染的多通道(+true)有符号距离场" -msgid "Can't load font texture:" -msgstr "无法加载字体纹理:" - -msgid "Image margin too big." -msgstr "图像边距太大。" - -msgid "Character margin too big." -msgstr "字符边距太大。" - msgid "Pre-Import Scene" msgstr "预导入场景" @@ -5792,9 +5843,6 @@ msgstr "从磁盘中加载资源并编辑。" msgid "Save the currently edited resource." msgstr "保存当前编辑的资源。" -msgid "Save As..." -msgstr "另存为..." - msgid "Extra resource options." msgstr "更多资源选项。" @@ -6389,6 +6437,9 @@ msgstr "[全局](创建)" msgid "Duplicated Animation Name:" msgstr "副本动画名称:" +msgid "Onion skinning requires a RESET animation." +msgstr "洋葱皮需要 RESET 动画。" + msgid "Play selected animation backwards from current pos. (A)" msgstr "从当前位置倒放选中动画(A)" @@ -7496,6 +7547,17 @@ msgid "" "will be visible in the running project." msgstr "启用该选项时,避障对象的形状、半径、速度都将在项目运行时可见。" +msgid "Debug CanvasItem Redraws" +msgstr "调试 CanvasItem 重绘" + +msgid "" +"When this option is enabled, redraw requests of 2D objects will become " +"visible (as a short flash) in the running project.\n" +"This is useful to troubleshoot low processor mode." +msgstr "" +"启用该选项时,2D 对象的重绘请求将在项目运行时可见(短暂的闪光)。\n" +"可用于低处理器模式下的故障排除。" + msgid "Synchronize Scene Changes" msgstr "同步场景修改" @@ -7852,6 +7914,9 @@ msgstr "创建导航网格" msgid "Create Debug Tangents" msgstr "创建调试切线" +msgid "No mesh to unwrap." +msgstr "没有可展开的网格。" + msgid "" "Mesh cannot unwrap UVs because it does not belong to the edited scene. Make " "it unique first." @@ -7874,6 +7939,15 @@ msgstr "展开 UV2" msgid "Contained Mesh is not of type ArrayMesh." msgstr "包含的 Mesh 不是 ArrayMesh 类型。" +msgid "Can't unwrap mesh with blend shapes." +msgstr "无法展开带混合变形的网格。" + +msgid "Only triangles are supported for lightmap unwrap." +msgstr "光照贴图的展开仅支持三角形。" + +msgid "Normals are required for lightmap unwrap." +msgstr "光照贴图的展开需要法线。" + msgid "UV Unwrap failed, mesh may not be manifold?" msgstr "UV 展开失败,可能该网格并非流形?" @@ -9569,6 +9643,12 @@ msgstr "创建 LightOccluder2D" msgid "LightOccluder2D Preview" msgstr "LightOccluder2D 预览" +msgid "Can't convert a sprite from a foreign scene." +msgstr "无法将外部场景转换为精灵。" + +msgid "Can't convert an empty sprite to mesh." +msgstr "无法将空精灵转换为网格。" + msgid "Can't convert a sprite using animation frames to mesh." msgstr "无法将使用动画帧的精灵转换为网格。" @@ -9778,7 +9858,7 @@ msgstr "" "应该采取什么行动?" msgid "%s Mipmaps" -msgstr "%s Mipmaps" +msgstr "%s Mipmap" msgid "Memory: %s" msgstr "内存:%s" @@ -13119,9 +13199,18 @@ msgid "" "reverted to their default." msgstr "禁用 “editable_instance” 将导致节点的所有属性恢复为其默认值。" +msgid "" +"Enabling \"Load as Placeholder\" will disable \"Editable Children\" and cause " +"all properties of the node to be reverted to their default." +msgstr "" +"开启“加载为占位符”将禁用“子节点可编辑”,该节点的所有属性都会恢复为默认值。" + msgid "Make Local" msgstr "转为本地" +msgid "Can't toggle unique name for nodes in subscene!" +msgstr "无法为子场景中的节点开关唯一名称!" + msgid "Enable Scene Unique Name(s)" msgstr "启用场景唯一名称" @@ -13173,14 +13262,6 @@ msgstr "移除节点" msgid "Change type of node(s)" msgstr "修改节点的类型" -msgid "Removing the node from variable \"%s\" on node \"%s\"." -msgstr "从变量“%s”移除节点,原节点为“%s”。" - -msgid "" -"The node's new type is incompatible with an exported variable (expected %s, " -"but type is %s)." -msgstr "节点的新类型与导出变量不兼容(需要 %s,但类型为 %s)。" - msgid "This operation requires a single selected node." msgstr "此操作只能应用于单个选中节点。" @@ -13213,6 +13294,9 @@ msgstr "清除继承" msgid "Editable Children" msgstr "子节点可编辑" +msgid "Load as Placeholder" +msgstr "加载为占位符" + msgid "Auto Expand to Selected" msgstr "自动展开至选定项" @@ -13500,6 +13584,56 @@ msgstr "名称“%s”是为着色器语言保留的关键字。" msgid "Add Shader Global Parameter" msgstr "添加着色器全局参数" +msgid "" +"This project uses meshes with an outdated mesh format from previous Godot " +"versions. The engine needs to update the format in order to use those meshes. " +"Please use the 'Upgrade Mesh Surfaces' tool from the 'Project > Tools' menu. " +"You can ignore this message and keep using outdated meshes, but keep in mind " +"that this leads to increased load times every time you load the project." +msgstr "" +"该项目使用的网格具有过时的之前 Godot 版本中的网格格式。引擎需要更新格式才能使" +"用这些网格。请使用“项目 > 工具”菜单中的“升级网格表面”工具。你可以忽略该消息并" +"继续使用过时的网格,但请记住,这会导致每次加载项目时加载时间增加。" + +msgid "" +"This project uses meshes with an outdated mesh format. Check the output log." +msgstr "该项目使用具有过时网格格式的网格。请检查输出日志。" + +msgid "Upgrading All Meshes in Project" +msgstr "正在升级项目中的所有网格" + +msgid "Attempting to re-save " +msgstr "正在尝试重新保存 " + +msgid "Attempting to remove " +msgstr "正在尝试移除 " + +msgid "" +"The mesh format has changed in Godot 4.2, which affects both imported meshes " +"and meshes authored inside of Godot. The engine needs to update the format in " +"order to use those meshes.\n" +"\n" +"If your project predates Godot 4.2 and contains meshes, we recommend you run " +"this one time conversion tool. This update will restart the editor and may " +"take several minutes. Upgrading will make the meshes incompatible with " +"previous versions of Godot.\n" +"\n" +"You can still use your existing meshes as is. The engine will update each " +"mesh in memory, but the update will not be saved. Choosing this option will " +"lead to slower load times every time this project is loaded." +msgstr "" +"Godot 4.2 更改了网格的格式,导入的网格和在 Godot 中制作的网格都会受到影响。引" +"擎需要对格式进行升级才能使用这些网格。\n" +"\n" +"如果你的项目早于 Godot 4.2 并且包含网格,我们建议运行这个一次性转换工具。升级" +"时将会重启编辑器,可能需要几分钟时间。更新后的网格不再兼容以前版本的 Godot。\n" +"\n" +"你仍然可以保留现有网格。引擎会在内存中升级各个网格,但是不会保存更新。选择这个" +"选项将会使得每次加载这个项目的时间变长。" + +msgid "Restart & Upgrade" +msgstr "重启并升级" + msgid "Make this panel floating in the screen %d." msgstr "让这个面板在屏幕 %d 中浮动。" @@ -13528,6 +13662,9 @@ msgstr "修改圆环外半径" msgid "Invalid type argument to convert(), use TYPE_* constants." msgstr "convert() 的参数类型无效,请使用 TYPE_* 常量。" +msgid "Cannot resize array." +msgstr "无法调整数组大小。" + msgid "Step argument is zero!" msgstr "Step 参数为 0!" @@ -13552,6 +13689,9 @@ msgstr "实例字典格式不正确(@path 的脚本无效)" msgid "Invalid instance dictionary (invalid subclasses)" msgstr "实例字典无效(派生类无效)" +msgid "Cannot instantiate GDScript class." +msgstr "无法实例化 GDScript 类。" + msgid "Value of type '%s' can't provide a length." msgstr "类型为“%s”的值无法提供长度。" @@ -13750,6 +13890,9 @@ msgstr "构建直接光照" msgid "Integrate indirect lighting" msgstr "集成间接光照" +msgid "Integrate indirect lighting %d%%" +msgstr "集成间接光照 %d%%" + msgid "Baking lightprobes" msgstr "正在烘焙光照探针" @@ -13757,7 +13900,7 @@ msgid "Integrating light probes %d%%" msgstr "正在集成光照探针 %d%%" msgid "Denoising" -msgstr "正在降噪" +msgstr "降噪" msgid "Retrieving textures" msgstr "正在获取纹理" @@ -14143,6 +14286,9 @@ msgstr "无法在设备上运行。" msgid "Exporting to Android when using C#/.NET is experimental." msgstr "使用 C#/.NET 时导出到 Android 是实验性的。" +msgid "Android architecture %s not supported in C# projects." +msgstr "C# 项目中不支持 Android 架构 %s。" + msgid "" "Android build template not installed in the project. Install it from the " "Project menu." @@ -14288,20 +14434,14 @@ msgstr "无法写入扩展包文件!" msgid "Building Android Project (gradle)" msgstr "构建 Android 项目 (Gradle)" -msgid "" -"Building of Android project failed, check output for the error. Alternatively " -"visit docs.godotengine.org for Android build documentation." -msgstr "" -"Android 项目构建失败,请检查输出中显示的错误。也可以访问 docs.godotengine.org " -"查看 Android 构建文档。" +msgid "Building of Android project failed, check output for the error:" +msgstr "Android 项目构建失败,请检查输出中显示的错误:" msgid "Moving output" msgstr "移动输出" -msgid "" -"Unable to copy and rename export file, check gradle project directory for " -"outputs." -msgstr "无法复制与更名导出文件,请在 Gradle 项目文件夹内确认输出。" +msgid "Unable to copy and rename export file:" +msgstr "无法复制并更名导出文件:" msgid "Package not found: \"%s\"." msgstr "包不存在:“%s”。" @@ -14370,6 +14510,12 @@ msgid "" "package." msgstr ".ipa 只能在 macOS 上构建。正在离开 Xcode 项目,未构建包。" +msgid "Exporting to iOS when using C#/.NET is experimental and requires macOS." +msgstr "使用 C#/.NET 时导出到 iOS 是实验性的,并且需要 macOS。" + +msgid "Exporting to iOS when using C#/.NET is experimental." +msgstr "使用 C#/.NET 时导出到 iOS 是实验性的。" + msgid "Identifier is missing." msgstr "缺少标识符。" @@ -14529,6 +14675,12 @@ msgstr "App Store 分发时,安装程序签名身份是必填项。" msgid "App sandbox is required for App Store distribution." msgstr "App Store 分发时,App 沙盒是必选项。" +msgid "" +"'rcodesign' doesn't support signing applications with embedded dynamic " +"libraries (GDExtension or .NET)." +msgstr "" +"“rcodesign”不支持对带有嵌入式动态库的应用程序进行签名(GDExtension 和 .NET)。" + msgid "Code signing is required for App Store distribution." msgstr "App Store 分发时,代码签名是必选项。" @@ -14703,6 +14855,11 @@ msgid "" "entitlement to load dynamic libraries." msgstr "Ad-hoc 签名的应用需要“Disable Library Validation”授权才能加载动态库。" +msgid "" +"'rcodesign' doesn't support signing applications with embedded dynamic " +"libraries." +msgstr "“rcodesign”不支持对带有嵌入式动态库的应用程序进行签名。" + msgid "Could not create entitlements file." msgstr "无法创建授权文件。" @@ -15119,6 +15276,15 @@ msgid "" msgstr "TileMap 图层设置为 Y 排序,但 TileMap 节点本身未启用 Y 排序。" msgid "" +"The TileMap node is set as Y-sorted, but Y-sort is not enabled on any of the " +"TileMap's layers.\n" +"This may lead to unwanted behaviors, as a layer that is not Y-sorted will be " +"Y-sorted as a whole." +msgstr "" +"TileMap 节点启用了 Y 排序,但是 TileMap 中并没有启用了 Y 排序的层。\n" +"这可能会导致不需要的行为,因为未按 Y 排序的层将作为一个整体进行 Y 排序。" + +msgid "" "Isometric TileSet will likely not look as intended without Y-sort enabled for " "the TileMap and all of its layers." msgstr "" @@ -15683,6 +15849,12 @@ msgid "Automatically arrange selected nodes." msgstr "自动排列所选节点。" msgid "" +"Labels with autowrapping enabled must have a custom minimum size configured " +"to work correctly inside a container." +msgstr "" +"位于容器中的 Label 如果启用了自动换行,则必须配置自定义最小尺寸才能正常工作。" + +msgid "" "The current font does not support rendering one or more characters used in " "this Label's text." msgstr "当前字体不支持渲染该标签文本中使用的一个或多个字符。" @@ -15799,14 +15971,6 @@ msgstr "" "新保存,而不会有数据丢失的风险。" msgid "" -"Setting node name '%s' to be unique within scene for '%s', but it's already " -"claimed by '%s'.\n" -"'%s' is no longer set as having a unique name." -msgstr "" -"正在将场景中的唯一节点名称“%s”设给“%s”,但该名称已被“%s”占用。\n" -"“%s”不再设置为具有唯一名称。" - -msgid "" "This node is marked as deprecated and will be removed in future versions.\n" "Please check the Godot documentation for information about migration." msgstr "" @@ -15819,13 +15983,6 @@ msgid "" msgstr "此节点标记为实验性节点,可能会在将来的版本中删除或进行重大更改。" msgid "" -"Default Environment as specified in the project setting \"rendering/" -"environment/defaults/default_environment\" could not be loaded." -msgstr "" -"无法加载项目设置“rendering/environment/defaults/default_environment”中指定的默" -"认环境。" - -msgid "" "ShaderGlobalsOverride is not active because another node of the same type is " "in the scene." msgstr "ShaderGlobalsOverride 未激活,因为场景中存在另一个相同类型的节点。" @@ -15845,27 +16002,6 @@ msgid "" "dimensions to render anything." msgstr "Viewport 的宽高都大于等于 2 像素时才能进行渲染。" -msgid "Cannot open font from file: %s." -msgstr "无法打开字体文件:%s。" - -msgid "Version %d of BMFont is not supported (should be 3)." -msgstr "不支持版本为 %d 的 BMFont(应该是3)。" - -msgid "Invalid BMFont info block size." -msgstr "无效的 BMFont 信息块大小。" - -msgid "Invalid BMFont common block size." -msgstr "无效的 BMFont 公共块大小。" - -msgid "Can't load font texture: %s." -msgstr "无法加载字体纹理:%s。" - -msgid "Unsupported BMFont texture format." -msgstr "不支持的 BMFont 纹理格式。" - -msgid "Invalid BMFont block type." -msgstr "无效的 BMFont 块类型。" - msgid "" "An incoming node's name clashes with %s already in the scene (presumably, " "from a more nested instance).\n" diff --git a/editor/translations/editor/zh_TW.po b/editor/translations/editor/zh_TW.po index 579de301e0..74a5324d67 100644 --- a/editor/translations/editor/zh_TW.po +++ b/editor/translations/editor/zh_TW.po @@ -48,13 +48,14 @@ # Sand Smith <1105483764@qq.com>, 2023. # Skyter Lin <linskyter@gmail.com>, 2023. # powder <hhurhxhdyruw@gmail.com>, 2023. +# Ink&Soul <mbyl_inkandsoul@foxmail.com>, 2023. msgid "" msgstr "" "Project-Id-Version: Godot Engine editor interface\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-10-24 17:38+0000\n" -"Last-Translator: Skyter Lin <linskyter@gmail.com>\n" +"PO-Revision-Date: 2023-11-23 09:02+0000\n" +"Last-Translator: Ink&Soul <mbyl_inkandsoul@foxmail.com>\n" "Language-Team: Chinese (Traditional) <https://hosted.weblate.org/projects/" "godot-engine/godot/zh_Hant/>\n" "Language: zh_TW\n" @@ -62,7 +63,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 5.1.1-dev\n" +"X-Generator: Weblate 5.2.1-rc\n" msgid "Main Thread" msgstr "主執行緒" @@ -1911,21 +1912,6 @@ msgstr "黃金贊助" msgid "Silver Sponsors" msgstr "白銀贊助" -msgid "Bronze Sponsors" -msgstr "青銅贊助" - -msgid "Mini Sponsors" -msgstr "迷你贊助" - -msgid "Gold Donors" -msgstr "黃金捐贈者" - -msgid "Silver Donors" -msgstr "白銀捐贈者" - -msgid "Bronze Donors" -msgstr "青銅捐贈者" - msgid "Donors" msgstr "捐贈者" @@ -3003,7 +2989,7 @@ msgid "Script:" msgstr "文字:" msgid "Country:" -msgstr "國家:" +msgstr "地區:" msgid "Language" msgstr "語言" @@ -3013,7 +2999,7 @@ msgid "Script" msgstr "腳 本" msgid "Country" -msgstr "國家" +msgstr "地區" msgid "Variant" msgstr "變體" @@ -3338,13 +3324,6 @@ msgstr "" "將停用擴充套件'%s'以避免進一步的錯誤。" msgid "" -"Unable to load addon script from path: '%s' Base type is not EditorPlugin." -msgstr "無法自路徑「%s」載入擴充腳本,基礎型別非 EditorPlugin。" - -msgid "Unable to load addon script from path: '%s' Script is not in tool mode." -msgstr "無法自路徑載入擴充腳本「%s」,腳本不在工具模式下。" - -msgid "" "Scene '%s' was automatically imported, so it can't be modified.\n" "To make changes to it, a new inherited scene can be created." msgstr "" @@ -3929,6 +3908,9 @@ msgstr "唯一化" msgid "Make Unique (Recursive)" msgstr "獨立化(遞迴)" +msgid "Save As..." +msgstr "另存為..." + msgid "Show in FileSystem" msgstr "在檔案系統中顯示" @@ -5384,15 +5366,6 @@ msgstr "動態渲染的 TrueType/OpenType 字體" msgid "Prerendered multichannel(+true) signed distance field" msgstr "預渲染的multichannel(+true)signed distance field" -msgid "Can't load font texture:" -msgstr "無法加載字體貼圖:" - -msgid "Image margin too big." -msgstr "圖像邊距太大。" - -msgid "Character margin too big." -msgstr "字符邊距太大。" - msgid "Pre-Import Scene" msgstr "預導入場景" @@ -5738,9 +5711,6 @@ msgstr "從磁碟中載入現有的資源並編輯。" msgid "Save the currently edited resource." msgstr "儲存目前編輯的資源。" -msgid "Save As..." -msgstr "另存為..." - msgid "Extra resource options." msgstr "更多資源選項。" @@ -13124,14 +13094,6 @@ msgstr "移除節點" msgid "Change type of node(s)" msgstr "更改節點的型別" -msgid "Removing the node from variable \"%s\" on node \"%s\"." -msgstr "從變數”%s“移除節點,原節點為”%s\"。" - -msgid "" -"The node's new type is incompatible with an exported variable (expected %s, " -"but type is %s)." -msgstr "節點的新型別與導出變數不相容(需要 %s,但型別為 %s)。" - msgid "This operation requires a single selected node." msgstr "此操作需要單個選定的節點。" @@ -14239,21 +14201,9 @@ msgstr "無法寫入擴充套件檔案!" msgid "Building Android Project (gradle)" msgstr "建置 Android 專案(Gradle)" -msgid "" -"Building of Android project failed, check output for the error. Alternatively " -"visit docs.godotengine.org for Android build documentation." -msgstr "" -"建置 Android 專案失敗,請檢查輸出以確認錯誤。也可以瀏覽 docs.godotengine.org " -"檢視 Android 建置說明文件。" - msgid "Moving output" msgstr "移動輸出" -msgid "" -"Unable to copy and rename export file, check gradle project directory for " -"outputs." -msgstr "無法複製並更名匯出的檔案,請於 Gradle 專案資料夾內確認輸出。" - msgid "Package not found: \"%s\"." msgstr "未找到套件:「%s」。" @@ -15752,14 +15702,6 @@ msgstr "" "重新保存,而不會有資料遺失的風險。" msgid "" -"Setting node name '%s' to be unique within scene for '%s', but it's already " -"claimed by '%s'.\n" -"'%s' is no longer set as having a unique name." -msgstr "" -"正在將場景中的唯一節點名稱”%s“設給”%s“,但該名稱已被”%s“佔用。\n" -"“%s“不再設定為具有唯一名稱。" - -msgid "" "This node is marked as deprecated and will be removed in future versions.\n" "Please check the Godot documentation for information about migration." msgstr "" @@ -15772,13 +15714,6 @@ msgid "" msgstr "此節點標記為實驗性節點,可能會在將來的版本中刪除或進行重大更改。" msgid "" -"Default Environment as specified in the project setting \"rendering/" -"environment/defaults/default_environment\" could not be loaded." -msgstr "" -"無法載入專案設定中指定的預設環境 (Rendering -> Environment -> Default " -"Environment)中指定的默認環境。" - -msgid "" "ShaderGlobalsOverride is not active because another node of the same type is " "in the scene." msgstr "ShaderGlobalsOverride 未啟用,因為場景中存在另一個相同型別的節點。" @@ -15798,27 +15733,6 @@ msgid "" "dimensions to render anything." msgstr "Viewport長與寬必須皆大於或等於2像素才可進行算繪。" -msgid "Cannot open font from file: %s." -msgstr "無法開啟字型檔:%s。" - -msgid "Version %d of BMFont is not supported (should be 3)." -msgstr "不支援版本為%d的 BMFont(應該是3)。" - -msgid "Invalid BMFont info block size." -msgstr "無效的 BMFont 訊息塊大小。" - -msgid "Invalid BMFont common block size." -msgstr "無效的 BMFont 一般塊大小。" - -msgid "Can't load font texture: %s." -msgstr "無法載入字型紋理:%s。" - -msgid "Unsupported BMFont texture format." -msgstr "不支援的BMFont 紋理格式。" - -msgid "Invalid BMFont block type." -msgstr "無效的 BMFont 塊型別。" - msgid "" "An incoming node's name clashes with %s already in the scene (presumably, " "from a more nested instance).\n" diff --git a/editor/translations/properties/de.po b/editor/translations/properties/de.po index 690c8dbeea..6666a5cb0b 100644 --- a/editor/translations/properties/de.po +++ b/editor/translations/properties/de.po @@ -108,7 +108,7 @@ msgstr "" "Project-Id-Version: Godot Engine properties\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-11-09 22:40+0000\n" +"PO-Revision-Date: 2023-11-27 01:40+0000\n" "Last-Translator: Cerno_b <cerno.b@gmail.com>\n" "Language-Team: German <https://hosted.weblate.org/projects/godot-engine/godot-" "properties/de/>\n" @@ -117,7 +117,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.2-dev\n" +"X-Generator: Weblate 5.2.1-rc\n" msgid "Application" msgstr "Anwendung" @@ -251,6 +251,12 @@ msgstr "Stärke des 3D-Panning" msgid "iOS" msgstr "iOS" +msgid "Session Category" +msgstr "Session-Kategorie" + +msgid "Mix With Others" +msgstr "Mit anderen mixen" + msgid "Editor" msgstr "Editor" @@ -434,6 +440,9 @@ msgstr "Ambient verwenden" msgid "Low Processor Usage Mode" msgstr "Prozessorenergiesparmodus" +msgid "Low Processor Usage Mode Sleep (µsec)" +msgstr "Leerlaufzeit im Prozessorenergiesparmodus (μs)" + msgid "Delta Smoothing" msgstr "Delta-Glättung" @@ -774,7 +783,7 @@ msgid "Animation" msgstr "Animation" msgid "Easing" -msgstr "Glätten Ein-Aus" +msgstr "Easing" msgid "Debug Adapter" msgstr "Debug-Adapter" @@ -959,6 +968,12 @@ msgstr "Hauptschriftart Fett" msgid "Code Font" msgstr "Quellcodeschriftart" +msgid "Low Processor Mode Sleep (µsec)" +msgstr "Leerlaufzeit im Prozessorenergiesparmodus (μs)" + +msgid "Unfocused Low Processor Mode Sleep (µsec)" +msgstr "Leerlaufzeit im Prozessorenergiesparmodus bei fehlendem Fokus (μs)" + msgid "Separate Distraction Mode" msgstr "Separater ablenkungsfreier Modus" @@ -1133,6 +1148,15 @@ msgstr "FBX" msgid "FBX2glTF Path" msgstr "FBX2glTF-Pfad" +msgid "Tools" +msgstr "Tools" + +msgid "Oidn" +msgstr "Oidn" + +msgid "Oidn Denoise Path" +msgstr "Pfad Oidn Noise-Unterdrückung" + msgid "Docks" msgstr "Docks" @@ -1679,6 +1703,9 @@ msgstr "Nutzertypfarbe" msgid "Comment Color" msgstr "Kommentarfarbe" +msgid "Doc Comment Color" +msgstr "Dokumentations-Kommentarfarbe" + msgid "String Color" msgstr "String-Farbe" @@ -1958,6 +1985,9 @@ msgstr "Nicht-gemappte Knochen" msgid "Create From" msgstr "Erstellen aus" +msgid "Scaling Mode" +msgstr "Skalierungs-Modus" + msgid "Delimiter" msgstr "Trennzeichen" @@ -2027,6 +2057,9 @@ msgstr "Mesh verschieben" msgid "Optimize Mesh" msgstr "Mesh optimieren" +msgid "Force Disable Mesh Compression" +msgstr "Mesh-Kompression deaktivert erzwingen" + msgid "Skip Import" msgstr "Import überspringen" @@ -2219,6 +2252,9 @@ msgstr "Lichtbacken" msgid "Lightmap Texel Size" msgstr "Lightmap Texelgröße" +msgid "Force Disable Compression" +msgstr "Kompression deaktiviert erzwingen" + msgid "Skins" msgstr "Skins" @@ -2414,6 +2450,12 @@ msgstr "Viewport-Navigationsgizmo anzeigen" msgid "Gizmo Settings" msgstr "Gizmo-Einstellungen" +msgid "Path 3D Tilt Disk Size" +msgstr "Größe Path3D Tilt-Disk" + +msgid "Path Tilt" +msgstr "Pfad-Tilt" + msgid "Auto Reload and Parse Scripts on Save" msgstr "Skripte beim Speichern auto-neuladen und parsen" @@ -2538,7 +2580,7 @@ msgid "Plugin Name" msgstr "Plugin-Name" msgid "Autoload on Startup" -msgstr "Automatisches Laden beim Start" +msgstr "Autoload beim Start" msgid "Show Scene Tree Root Selection" msgstr "Szenenbaumwurzel-Auswahl anzeigen" @@ -2588,6 +2630,18 @@ msgstr "GL-Kompatibilität" msgid "Nvidia Disable Threaded Optimization" msgstr "Nvidia-Thread-Optimierung deaktivieren" +msgid "Fallback to Angle" +msgstr "Fallback auf ANGLE" + +msgid "Fallback to Native" +msgstr "Fallback auf nativ" + +msgid "Fallback to Gles" +msgstr "Fallback auf GLES" + +msgid "Force Angle on Devices" +msgstr "Winkel auf Devices erzwingen" + msgid "Renderer" msgstr "Renderer" @@ -2693,6 +2747,15 @@ msgstr "Tiefenpuffer absenden" msgid "Startup Alert" msgstr "Startbenachrichtigung" +msgid "Extensions" +msgstr "Extensions" + +msgid "Hand Tracking" +msgstr "Hand-Tracking" + +msgid "Eye Gaze Interaction" +msgstr "Blickkontakt-Interaktion" + msgid "In Editor" msgstr "Im Editor" @@ -2951,6 +3014,9 @@ msgstr "Thread verwenden" msgid "glTF" msgstr "glTF" +msgid "Naming Version" +msgstr "Naming-Version" + msgid "Embedded Image Handling" msgstr "Handhabung für eingebettete Bilder" @@ -3296,6 +3362,12 @@ msgstr "Probe-Strahlenanzahl Ultra-Qualität" msgid "Max Rays per Probe Pass" msgstr "Max. Strahlen pro Probe-Durchlauf" +msgid "Denoising" +msgstr "Rauschunterdrückung" + +msgid "Denoiser" +msgstr "Rauschunterdrückungs-Typ" + msgid "BPM" msgstr "BPM" @@ -4320,7 +4392,7 @@ msgid "Playing" msgstr "Wird abgespielt" msgid "Autoplay" -msgstr "Automatisches Abspielen" +msgstr "Autoplay" msgid "Stream Paused" msgstr "Abspielen pausiert" @@ -4622,6 +4694,9 @@ msgstr "Versatz Max." msgid "Offset Curve" msgstr "Versatzkurve" +msgid "Amount Ratio" +msgstr "Mengenverhältnis" + msgid "Sub Emitter" msgstr "Unteremitter" @@ -4631,6 +4706,9 @@ msgstr "Materialverarbeitung" msgid "Interpolate" msgstr "Interpolieren" +msgid "Interp to End" +msgstr "Interp zum Ende" + msgid "Base Size" msgstr "Basisgröße" @@ -5127,7 +5205,7 @@ msgid "Filter Clip Enabled" msgstr "Filter-Clip aktiviert" msgid "Tile Set" -msgstr "Tileset" +msgstr "Tile Set" msgid "Rendering Quadrant Size" msgstr "Renderquadrantengröße" @@ -5625,11 +5703,17 @@ msgid "Quality" msgstr "Qualität" msgid "Bounces" -msgstr "Aufprälle" +msgstr "Abprälle" + +msgid "Bounce Indirect Energy" +msgstr "Indirekte Energie abprallen" msgid "Directional" msgstr "Direktional" +msgid "Use Texture for Bounces" +msgstr "Textur für Abprallen verwenden" + msgid "Interior" msgstr "Innenbereich" @@ -5672,6 +5756,9 @@ msgstr "Pfadhöhenversatz" msgid "Use 3D Avoidance" msgstr "3D-Vermeidung verwenden" +msgid "Keep Y Velocity" +msgstr "Y-Geschwindigkeit behalten" + msgid "Navigation Mesh" msgstr "Navigations-Mesh" @@ -6018,7 +6105,7 @@ msgid "Propagation" msgstr "Verbreitung" msgid "Use Two Bounces" -msgstr "Zwei Aufprälle benutzen" +msgstr "Zwei Abprälle benutzen" msgid "Tracker" msgstr "Tracker" @@ -6911,6 +6998,15 @@ msgstr "Mehrere" msgid "Syntax Highlighter" msgstr "Syntaxhervorhebung" +msgid "Visual Whitespace" +msgstr "Visueller Whitespace" + +msgid "Control Chars" +msgstr "Steuerzeichen" + +msgid "Spaces" +msgstr "Leerzeichen" + msgid "Text Edit Idle Detect (sec)" msgstr "Text Edit-Inaktivitätserkennung (Sek.)" @@ -7352,6 +7448,9 @@ msgstr "Min Größe" msgid "Max Size" msgstr "Max Größe" +msgid "Keep Title Visible" +msgstr "Titel sichtbar halten" + msgid "Content Scale" msgstr "Inhaltsskalierung" @@ -7875,7 +7974,7 @@ msgid "Flip Texture" msgstr "Textur spiegeln" msgid "Subsurface Scattering" -msgstr "Subsurface-Scattering" +msgstr "Subsurface Scattering" msgid "Skin Mode" msgstr "Skin-Modus" @@ -8081,6 +8180,78 @@ msgstr "Quellengeometriegruppenname" msgid "Bundled" msgstr "Gebündelt" +msgid "Damping as Friction" +msgstr "Dämpfung als Reibung" + +msgid "Spawn" +msgstr "Spawn" + +msgid "Emission Shape Offset" +msgstr "Emissions-Shape-Offset" + +msgid "Emission Shape Scale" +msgstr "Emissions-Shape-Skala" + +msgid "Emission Sphere Radius" +msgstr "Emissions-Kugel-Radius" + +msgid "Emission Box Extents" +msgstr "Emissions-Box-Ausmaße" + +msgid "Emission Point Texture" +msgstr "Emissions-Punkt-Textur" + +msgid "Emission Normal Texture" +msgstr "Emissions-Normalen-Textur" + +msgid "Emission Color Texture" +msgstr "Emissions-Farbtextur" + +msgid "Emission Point Count" +msgstr "Emissions-Punktzahl" + +msgid "Emission Ring Axis" +msgstr "Emissions-Ringachse" + +msgid "Emission Ring Height" +msgstr "Emission-Ringhöhe" + +msgid "Emission Ring Radius" +msgstr "Emissions-Ring-Radius" + +msgid "Emission Ring Inner Radius" +msgstr "Emissions-Ring-Innenradius" + +msgid "Inherit Velocity Ratio" +msgstr "Geschwindigkeits-Verhältnis erben" + +msgid "Velocity Pivot" +msgstr "Geschwindigkeits-Pivot" + +msgid "Initial Velocity Min" +msgstr "Initiale Geschwindigkeit Min" + +msgid "Initial Velocity Max" +msgstr "Initiale Geschwindigkeit Max" + +msgid "Animated Velocity" +msgstr "Animierte Geschwindigkeit" + +msgid "Velocity Limit" +msgstr "Geschwindigkeits-Limit" + +msgid "Directional Velocity" +msgstr "Richtungsgeschwindigkeit" + +msgid "Radial Velocity" +msgstr "Radialgeschwindigkeit" + +msgid "Velocity Limit Curve" +msgstr "Geschwindigkeits-Limit-Kurve" + +msgid "Accelerations" +msgstr "Beschleunigungen" + msgid "Attractor Interaction" msgstr "Attraktor-Interaktion" @@ -8093,6 +8264,27 @@ msgstr "Skala Max." msgid "Scale Curve" msgstr "Skalierungskurve" +msgid "Scale Over Velocity" +msgstr "Skalierung über Geschwindigkeit" + +msgid "Scale over Velocity Min" +msgstr "Skalierung über Geschwindigkeit Min" + +msgid "Scale over Velocity Max" +msgstr "Skalierung über Geschwindigkeit Max" + +msgid "Scale over Velocity Curve" +msgstr "Skalierung Geschwindigkeits-Kurve" + +msgid "Color Curves" +msgstr "Farbkurven" + +msgid "Alpha Curve" +msgstr "Alphakurve" + +msgid "Emission Curve" +msgstr "Emissions-Kurve" + msgid "Turbulence" msgstr "Turbulenz" @@ -8466,7 +8658,7 @@ msgid "Alternative Level" msgstr "Alternativer Level" msgid "Tile Shape" -msgstr "Tile-Shape" +msgstr "Tile-Form" msgid "Tile Layout" msgstr "Tile-Layout" @@ -9228,7 +9420,7 @@ msgid "Color Okhsl Hue" msgstr "Farbe Okhsl Farbton" msgid "BG" -msgstr "HG" +msgstr "BG" msgid "Preset FG" msgstr "Vorgabe VG" @@ -9428,6 +9620,9 @@ msgstr "Pegel dB" msgid "Pan" msgstr "Panning" +msgid "Attack (µs)" +msgstr "Attack (μs)" + msgid "Release (ms)" msgstr "Release (ms)" @@ -9699,7 +9894,7 @@ msgid "Exclude" msgstr "Ausschließen" msgid "Collide With Bodies" -msgstr "Mit anderen Körpern kollidieren" +msgstr "Mit anderen Bodies kollidieren" msgid "Collide With Areas" msgstr "Mit anderen Gebieten kollidieren" @@ -9714,7 +9909,7 @@ msgid "Collide Separation Ray" msgstr "Kollision Trennungsstrahl" msgid "Exclude Bodies" -msgstr "Körper ausschließen" +msgstr "Bodies ausschließen" msgid "Exclude Objects" msgstr "Objekte ausschließen" @@ -9773,6 +9968,12 @@ msgstr "Hauptträgheitsachse" msgid "Max Collisions" msgstr "Max. Kollisionen" +msgid "Debug Redraw Time" +msgstr "Zeit Debug-Neuzeichnen" + +msgid "Debug Redraw Color" +msgstr "Farbe Debug-Neuzeichnen" + msgid "Vertex" msgstr "Vertex" diff --git a/editor/translations/properties/es.po b/editor/translations/properties/es.po index f423e5acf2..5987f4dc8f 100644 --- a/editor/translations/properties/es.po +++ b/editor/translations/properties/es.po @@ -98,13 +98,14 @@ # Víctor Mardones <vnicolas.mb.ni@gmail.com>, 2023. # "Francisco S. F." <fsanchezflorido@gmail.com>, 2023. # Jorge Julio Torres <jjulio.tlg.89@gmail.com>, 2023. +# Chimi <tximi.sysaad@gmail.com>, 2023. msgid "" msgstr "" "Project-Id-Version: Godot Engine properties\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-10-31 10:40+0000\n" -"Last-Translator: Javier Ocampos <xavier.ocampos@gmail.com>\n" +"PO-Revision-Date: 2023-11-23 17:10+0000\n" +"Last-Translator: Chimi <tximi.sysaad@gmail.com>\n" "Language-Team: Spanish <https://hosted.weblate.org/projects/godot-engine/" "godot-properties/es/>\n" "Language: es\n" @@ -112,7 +113,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.2-dev\n" +"X-Generator: Weblate 5.2.1-rc\n" msgid "Application" msgstr "Aplicación" @@ -124,7 +125,7 @@ msgid "Name" msgstr "Nombre" msgid "Name Localized" -msgstr "Nombre Localizado" +msgstr "Nombre localizado" msgid "Description" msgstr "Descripción" @@ -246,6 +247,12 @@ msgstr "Fuerza de panoramización 3D" msgid "iOS" msgstr "iOS" +msgid "Session Category" +msgstr "Categoría de la sesión" + +msgid "Mix With Others" +msgstr "Mezclar con otros" + msgid "Editor" msgstr "Editor" @@ -1128,6 +1135,9 @@ msgstr "FBX" msgid "FBX2glTF Path" msgstr "Ruta FBX2glTF" +msgid "Tools" +msgstr "Herramientas" + msgid "Docks" msgstr "Paneles" diff --git a/editor/translations/properties/fr.po b/editor/translations/properties/fr.po index ffa81113a9..b57158458a 100644 --- a/editor/translations/properties/fr.po +++ b/editor/translations/properties/fr.po @@ -119,13 +119,14 @@ # Vivalzar <gillespeyroux@hotmail.com>, 2023. # Gouvernon Stan <stany@gouvernon.org>, 2023. # Rertsyd <rertsyd@outlook.com>, 2023. +# Roskai <angel.du.2558@gmail.com>, 2023. msgid "" msgstr "" "Project-Id-Version: Godot Engine properties\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-10-26 13:04+0000\n" -"Last-Translator: Rertsyd <rertsyd@outlook.com>\n" +"PO-Revision-Date: 2023-11-16 07:53+0000\n" +"Last-Translator: Roskai <angel.du.2558@gmail.com>\n" "Language-Team: French <https://hosted.weblate.org/projects/godot-engine/godot-" "properties/fr/>\n" "Language: fr\n" @@ -133,7 +134,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 5.1.1\n" +"X-Generator: Weblate 5.2\n" msgid "Application" msgstr "Application" @@ -4926,6 +4927,9 @@ msgstr "Mode différé" msgid "Presets Visible" msgstr "Préréglages visibles" +msgid "Styles" +msgstr "Styles" + msgid "Grow Direction" msgstr "Direction d'expansion" @@ -6684,6 +6688,9 @@ msgstr "Utiliser le filtre Mipmap le plus proche" msgid "Buffer Size" msgstr "Taille de tampon" +msgid "OpenGL" +msgstr "OpenGL" + msgid "Shaders" msgstr "Shaders" diff --git a/editor/translations/properties/it.po b/editor/translations/properties/it.po index 24c3122939..44b8fa414b 100644 --- a/editor/translations/properties/it.po +++ b/editor/translations/properties/it.po @@ -81,13 +81,14 @@ # Francesco <martefrinbell@gmail.com>, 2023. # E D <th3-crasin3ss@hotmail.com>, 2023. # Frankie McEyes <mceyes@protonmail.com>, 2023. +# Samuele Righi <blackdestinyx145@gmail.com>, 2023. msgid "" msgstr "" "Project-Id-Version: Godot Engine properties\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-10-17 06:43+0000\n" -"Last-Translator: Frankie McEyes <mceyes@protonmail.com>\n" +"PO-Revision-Date: 2023-12-11 09:59+0000\n" +"Last-Translator: Samuele Righi <blackdestinyx145@gmail.com>\n" "Language-Team: Italian <https://hosted.weblate.org/projects/godot-engine/" "godot-properties/it/>\n" "Language: it\n" @@ -95,7 +96,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.1\n" +"X-Generator: Weblate 5.3-dev\n" msgid "Application" msgstr "Applicazione" @@ -214,6 +215,9 @@ msgstr "Generale" msgid "iOS" msgstr "iOS" +msgid "Mix With Others" +msgstr "Mischia Con Altri" + msgid "Editor" msgstr "Editor" @@ -286,6 +290,9 @@ msgstr "Server Multithreading" msgid "Internationalization" msgstr "Lingue" +msgid "Force Right to Left Layout Direction" +msgstr "Forza la Direzione del Layout da Destra a Sinistra" + msgid "GUI" msgstr "Interfaccia Grafica" diff --git a/editor/translations/properties/ja.po b/editor/translations/properties/ja.po index 97ee73c142..47df70e320 100644 --- a/editor/translations/properties/ja.po +++ b/editor/translations/properties/ja.po @@ -53,13 +53,14 @@ # matsu7089 <32781959+matsu7089@users.noreply.github.com>, 2023. # Koji Horaguchi <koji.horaguchi@gmail.com>, 2023. # ueshita <nalto32@gmail.com>, 2023. +# Komaru Bomaru <ohmanhowwillithink@gmail.com>, 2023. msgid "" msgstr "" "Project-Id-Version: Godot Engine properties\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-10-28 18:51+0000\n" -"Last-Translator: ueshita <nalto32@gmail.com>\n" +"PO-Revision-Date: 2023-12-06 04:32+0000\n" +"Last-Translator: Komaru Bomaru <ohmanhowwillithink@gmail.com>\n" "Language-Team: Japanese <https://hosted.weblate.org/projects/godot-engine/" "godot-properties/ja/>\n" "Language: ja\n" @@ -67,7 +68,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 5.2-dev\n" +"X-Generator: Weblate 5.3-dev\n" msgid "Application" msgstr "アプリケーション" @@ -201,6 +202,12 @@ msgstr "3D パンの強さ" msgid "iOS" msgstr "iOS" +msgid "Session Category" +msgstr "セッションカテゴリー:" + +msgid "Mix With Others" +msgstr "バックグラウンド音声とミックス" + msgid "Editor" msgstr "エディター" @@ -237,6 +244,9 @@ msgstr "アスペクト" msgid "Scale" msgstr "スケール" +msgid "Scale Mode" +msgstr "スケールモード" + msgid "Debug" msgstr "デバッグ" @@ -381,6 +391,9 @@ msgstr "アンビエントを使用" msgid "Low Processor Usage Mode" msgstr "プロセッサー低使用率モード" +msgid "Low Processor Usage Mode Sleep (µsec)" +msgstr "プロセッサー低使用率モードのスリープ時間 (マイクロ秒)" + msgid "Delta Smoothing" msgstr "デルタ時間のスムージング" @@ -444,6 +457,12 @@ msgstr "押下" msgid "Keycode" msgstr "キーコード" +msgid "Physical Keycode" +msgstr "物理キーコード" + +msgid "Key Label" +msgstr "キーラベル" + msgid "Unicode" msgstr "Unicode" @@ -465,6 +484,9 @@ msgstr "係数" msgid "Button Index" msgstr "ボタンのインデックス" +msgid "Canceled" +msgstr "キャンセル" + msgid "Double Click" msgstr "ダブルクリック" @@ -594,12 +616,21 @@ msgstr "TCP" msgid "Connect Timeout Seconds" msgstr "接続タイムアウト秒数" +msgid "Packet Peer Stream" +msgstr "パケットピアストリーム" + msgid "Max Buffer (Power of 2)" msgstr "最大バッファサイズ(2の累乗)" msgid "TLS" msgstr "TLS" +msgid "Certificate Bundle Override" +msgstr "証明書バンドルの上書き" + +msgid "Threading" +msgstr "スレッド" + msgid "Worker Pool" msgstr "ワーカープール" @@ -621,11 +652,35 @@ msgstr "テスト" msgid "Fallback" msgstr "フォールバック" +msgid "Pseudolocalization" +msgstr "疑似ローカライズ" + +msgid "Use Pseudolocalization" +msgstr "疑似ローカライズを有効化" + +msgid "Replace With Accents" +msgstr "文字列のアクセントの置き換え" + +msgid "Double Vowels" +msgstr "文字列の母音を2倍にする" + msgid "Fake BiDi" -msgstr "偽のBiDi" +msgstr "偽の双方向テキスト (右から左)" msgid "Override" -msgstr "上書き" +msgstr "文字をアスタリスク(*)に置き換え" + +msgid "Expansion Ratio" +msgstr "文字列の拡張率" + +msgid "Prefix" +msgstr "折り返しの接頭辞:" + +msgid "Suffix" +msgstr "折り返しの接尾辞:" + +msgid "Skip Placeholders" +msgstr "プレースホルダ(%%sなど)のスキップ" msgid "Rotation" msgstr "回転" @@ -642,6 +697,15 @@ msgstr "引数" msgid "Type" msgstr "タイプ(型)" +msgid "In Handle" +msgstr "インハンドル" + +msgid "Out Handle" +msgstr "アウトハンドル" + +msgid "Handle Mode" +msgstr "ハンドルモード" + msgid "Stream" msgstr "ストリーム" @@ -657,9 +721,18 @@ msgstr "アニメーション" msgid "Easing" msgstr "イージング" +msgid "Debug Adapter" +msgstr "デバッグアダプター" + msgid "Remote Port" msgstr "リモートポート" +msgid "Request Timeout" +msgstr "リクエスト失敗、タイムアウト" + +msgid "Sync Breakpoints" +msgstr "ブレークポイントの同期" + msgid "FileSystem" msgstr "ファイルシステム" @@ -948,6 +1021,15 @@ msgstr "FBX" msgid "FBX2glTF Path" msgstr "FBX2glTFのパス" +msgid "Tools" +msgstr "ツール" + +msgid "Oidn" +msgstr "Oidn" + +msgid "Oidn Denoise Path" +msgstr "Oidnデノイザーのパス" + msgid "Docks" msgstr "ドック" @@ -1572,12 +1654,21 @@ msgstr "圧縮" msgid "Language" msgstr "言語:" +msgid "Embolden" +msgstr "太字" + msgid "Transform" msgstr "トランスフォーム" +msgid "Retarget" +msgstr "リターゲット" + msgid "Make Unique" msgstr "ユニーク化" +msgid "Fix Silhouette" +msgstr "シルエットを直す" + msgid "Filter" msgstr "フィルター" @@ -1593,14 +1684,29 @@ msgstr "作成元" msgid "Delimiter" msgstr "区切り文字" +msgid "Rows" +msgstr "列" + +msgid "High Quality" +msgstr "高品質" + msgid "Lossy Quality" msgstr "非可逆品質" +msgid "HDR Compression" +msgstr "HDR圧縮" + +msgid "Channel Pack" +msgstr "チャンネルパック" + msgid "Mipmaps" msgstr "ミップマップ" +msgid "Generate" +msgstr "生成する" + msgid "Limit" -msgstr "制限" +msgstr "制限値" msgid "Slices" msgstr "スライス" @@ -1626,6 +1732,24 @@ msgstr "スケールメッシュ" msgid "Offset Mesh" msgstr "メッシュのオフセット" +msgid "Optimize Mesh" +msgstr "メッシュ最適化" + +msgid "Force Disable Mesh Compression" +msgstr "メッシュ圧縮を無効化" + +msgid "Skip Import" +msgstr "インポートしない" + +msgid "NavMesh" +msgstr "ナビメッシュ" + +msgid "Body Type" +msgstr "ボディタイプ" + +msgid "Shape Type" +msgstr "シェイプタイプ" + msgid "Physics Material Override" msgstr "物理マテリアルのオーバーライド" @@ -1635,15 +1759,42 @@ msgstr "レイヤー" msgid "Mask" msgstr "マスク" +msgid "Mesh Instance" +msgstr "メッシュインスタンス" + msgid "Layers" msgstr "レイヤー" +msgid "Visibility Range Begin" +msgstr "可視範囲の開始距離" + +msgid "Visibility Range Begin Margin" +msgstr "可視範囲の開始マージン" + +msgid "Visibility Range End" +msgstr "可視範囲の終了距離" + +msgid "Visibility Range End Margin" +msgstr "可視範囲の終了マージン" + +msgid "Visibility Range Fade Mode" +msgstr "可視範囲のフェードモード" + +msgid "Cast Shadow" +msgstr "影を落とす" + msgid "Advanced" msgstr "高度な設定" msgid "Precision" msgstr "精度" +msgid "Plane Downsampling" +msgstr "平面ダウンサンプリング" + +msgid "Convexhull Downsampling" +msgstr "凸包ダウンサンプリング" + msgid "Height" msgstr "高さ" @@ -1683,12 +1834,24 @@ msgstr "カスタムトラックを保持" msgid "Optimizer" msgstr "オプティマイザー(Optimizer)" +msgid "Max Velocity Error" +msgstr "最大速度誤差" + msgid "Max Angular Error" -msgstr "最大角度エラー" +msgstr "最大角度誤差" + +msgid "Max Precision Error" +msgstr "最大制度誤差" msgid "Page Size" msgstr "ページサイズ" +msgid "Import Tracks" +msgstr "トラックのインポート" + +msgid "Bone Map" +msgstr "ボーンマップ" + msgid "Nodes" msgstr "ノード" @@ -1698,8 +1861,11 @@ msgstr "ルートの型" msgid "Root Name" msgstr "ルートの名前" +msgid "Apply Root Scale" +msgstr "ルートスケールを適用" + msgid "Root Scale" -msgstr "ルートのスケール" +msgstr "ルートスケール" msgid "Meshes" msgstr "メッシュ" @@ -1707,12 +1873,21 @@ msgstr "メッシュ" msgid "Ensure Tangents" msgstr "接線の確保" +msgid "Generate LODs" +msgstr "LODを生成" + +msgid "Create Shadow Meshes" +msgstr "シャドウメッシュの作成" + msgid "Light Baking" -msgstr "ライトベーキング(Light Baking)" +msgstr "ライト焼き込み" msgid "Lightmap Texel Size" msgstr "ライトマップのテクセルサイズ" +msgid "Force Disable Compression" +msgstr "圧縮を無効にする" + msgid "Skins" msgstr "スキン" @@ -1722,14 +1897,29 @@ msgstr "名前付きスキンの使用" msgid "FPS" msgstr "フレームレート(FPS)" +msgid "Trimming" +msgstr "前後のトリミング" + +msgid "Remove Immutable Tracks" +msgstr "不変トラックの削除" + +msgid "Import Script" +msgstr "インポートスクリプト" + msgid "Normal Map" msgstr "法線マップ" +msgid "Roughness" +msgstr "ラフネス" + +msgid "Src Normal" +msgstr "ラフネス用の法線マップ" + msgid "Process" -msgstr "プロセス" +msgstr "インポートプロセス" msgid "Fix Alpha Border" -msgstr "アルファボーダーを修正" +msgstr "アルファ境界を修正" msgid "Premult Alpha" msgstr "乗算済みアルファ" @@ -1737,35 +1927,50 @@ msgstr "乗算済みアルファ" msgid "Normal Map Invert Y" msgstr "法線マップのYを反転" +msgid "HDR as sRGB" +msgstr "HDRをsRGBとして処理" + +msgid "HDR Clamp Exposure" +msgstr "HDRの明るさ上限処理" + msgid "Size Limit" msgstr "サイズ制限" msgid "Detect 3D" -msgstr "3Dを検出" +msgstr "3D検出時" + +msgid "Compress To" +msgstr "圧縮モードの変更" msgid "SVG" msgstr "SVG" +msgid "Convert Colors With Editor Theme" +msgstr "エディタのテーマで色を変える" + msgid "Atlas File" msgstr "アトラスファイル" msgid "Import Mode" msgstr "インポートモード" +msgid "Crop to Region" +msgstr "領域にあわせて切り出す" + msgid "Trim Alpha Border From Region" -msgstr "領域からアルファボーダーをトリミング" +msgstr "領域からアルファ境界をトリミング" msgid "Force" msgstr "強制" msgid "8 Bit" -msgstr "8ビット" +msgstr "8ビット化" msgid "Mono" -msgstr "Mono" +msgstr "モノラル化" msgid "Max Rate" -msgstr "最大レート" +msgstr "最大レート適用" msgid "Max Rate Hz" msgstr "最大レート(Hz)" @@ -1774,7 +1979,7 @@ msgid "Edit" msgstr "編集" msgid "Trim" -msgstr "トリム" +msgstr "前後のトリム" msgid "Normalize" msgstr "ノーマライズ" @@ -1815,9 +2020,18 @@ msgstr "カメラ" msgid "Decal" msgstr "デカール" +msgid "Fog Volume" +msgstr "フォグボリューム" + msgid "Particles" msgstr "パーティクル" +msgid "Particle Attractor" +msgstr "パーティクルアトラクター" + +msgid "Particle Collision" +msgstr "パーティクルコリジョン" + msgid "Joint Body A" msgstr "ジョイント ボディA" @@ -1860,6 +2074,9 @@ msgstr "テクスチャ" msgid "Separation" msgstr "分離" +msgid "Alternative ID" +msgstr "代替ID" + msgid "Speed" msgstr "速さ" @@ -1878,6 +2095,9 @@ msgstr "SSH 秘密鍵パス" msgid "Main Run Args" msgstr "メイン実行引数" +msgid "Naming" +msgstr "名付ける" + msgid "Reimport Missing Imported Files" msgstr "見つからないインポート済みファイルを再インポートする" @@ -1887,6 +2107,12 @@ msgstr "シーンツリーのルート選択対象を表示" msgid "Use Favorites Root Selection" msgstr "お気に入りのルート選択対象を使用" +msgid "Max Chars per Second" +msgstr "秒当たり字" + +msgid "Max Warnings per Second" +msgstr "秒当たり警報" + msgid "File Logging" msgstr "ファイルロギング" @@ -1894,11 +2120,41 @@ msgid "Enable File Logging" msgstr "ファイルロギングを有効化" msgid "Log Path" -msgstr "ログのパス" +msgstr "ログファイルのパス" + +msgid "Max Log Files" +msgstr "ログファイルの最大数" msgid "Driver" msgstr "ドライバー" +msgid "GL Compatibility" +msgstr "GL互換" + +msgid "Nvidia Disable Threaded Optimization" +msgstr "NVIDIAのスレッド最適化の無効化" + +msgid "Fallback to Angle" +msgstr "Angleへフォールバックする" + +msgid "Fallback to Native" +msgstr "Nativeへフォールバックする" + +msgid "Fallback to Gles" +msgstr "GLESへフォールバックする" + +msgid "Force Angle on Devices" +msgstr "Angleへ強制フォールバックするデバイス" + +msgid "Renderer" +msgstr "レンダラー" + +msgid "Rendering Method" +msgstr "レンダリングメソッド" + +msgid "Include Text Server Data" +msgstr "テキストサーバーデータを含める" + msgid "DPI" msgstr "DPI" @@ -1977,11 +2233,17 @@ msgstr "ブートスプラッシュ" msgid "BG Color" msgstr "背景色" +msgid "Pen Tablet" +msgstr "ペンタブレット" + msgid "Environment" msgstr "環境" +msgid "Defaults" +msgstr "デフォルト" + msgid "Default Clear Color" -msgstr "デフォルトのクリアー色" +msgstr "デフォルトのクリア色" msgid "Show Image" msgstr "画像を表示" @@ -1998,6 +2260,12 @@ msgstr "フィルターを使用" msgid "Icon" msgstr "アイコン" +msgid "macOS Native Icon" +msgstr "macOSアイコン" + +msgid "Windows Native Icon" +msgstr "Windowsアイコン" + msgid "Buffering" msgstr "バッファリング" @@ -2016,15 +2284,27 @@ msgstr "タッチでマウス操作をエミュレート" msgid "Android" msgstr "Android" +msgid "Text Driver" +msgstr "テキストドライバー" + msgid "Mouse Cursor" msgstr "マウスカーソル" +msgid "Custom Image" +msgstr "カスタムイメージ" + msgid "Custom Image Hotspot" msgstr "カスタムイメージホットスポット" msgid "Tooltip Position Offset" msgstr "ツールチップ位置のオフセット" +msgid "Minimum Display Time" +msgstr "最小表示時間" + +msgid "Dotnet" +msgstr ".NET" + msgid "Project" msgstr "プロジェクト" @@ -2034,6 +2314,9 @@ msgstr "アセンブリ名" msgid "Solution Directory" msgstr "ソリューションのディレクトリ" +msgid "Assembly Reload Attempts" +msgstr "アセンブリのリロード試行" + msgid "Operation" msgstr "操作" @@ -2076,6 +2359,12 @@ msgstr "ポリゴン" msgid "Depth" msgstr "Depth(深度/奥行)" +msgid "Path Interval" +msgstr "パス合間" + +msgid "Path Simplify Angle" +msgstr "パスの角度を容易にする" + msgid "CSG" msgstr "CSG" @@ -2103,6 +2392,9 @@ msgstr "Smart Resolveを有効化" msgid "Use Thread" msgstr "スレッドを使用" +msgid "glTF" +msgstr "glTF" + msgid "Color" msgstr "色" @@ -2118,6 +2410,9 @@ msgstr "鏡面反射係数" msgid "Mass" msgstr "質量" +msgid "Angular Velocity" +msgstr "角速度" + msgid "Json" msgstr "JSON" @@ -3379,7 +3674,13 @@ msgid "Depth Prepass" msgstr "深度プレパス" msgid "Decals" -msgstr "アップリケ" +msgstr "デカール" + +msgid "Screen Space Reflection" +msgstr "スクリーンスペース反射" + +msgid "OpenGL" +msgstr "OpenGL" msgid "Shaders" msgstr "シェーダー" diff --git a/editor/translations/properties/ko.po b/editor/translations/properties/ko.po index 65223e17c1..ebd2c4bdf5 100644 --- a/editor/translations/properties/ko.po +++ b/editor/translations/properties/ko.po @@ -55,8 +55,8 @@ msgstr "" "Project-Id-Version: Godot Engine properties\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-11-10 08:03+0000\n" -"Last-Translator: Myeongjin Lee <aranet100@gmail.com>\n" +"PO-Revision-Date: 2023-12-04 01:29+0000\n" +"Last-Translator: nulta <un5450@naver.com>\n" "Language-Team: Korean <https://hosted.weblate.org/projects/godot-engine/godot-" "properties/ko/>\n" "Language: ko\n" @@ -64,7 +64,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 5.2-dev\n" +"X-Generator: Weblate 5.3-dev\n" msgid "Application" msgstr "어플리케이션" @@ -2014,7 +2014,7 @@ msgid "Resolution" msgstr "해상도" msgid "Max Num Vertices per Convex Hull" -msgstr "컨벡스 헐 당 최대 꼭지점 수" +msgstr "컨벡스 헐 당 최대 꼭짓점 수" msgid "Plane Downsampling" msgstr "평면 다운샘플링" @@ -2032,7 +2032,7 @@ msgid "Max Convex Hulls" msgstr "최대 컨벡스 헐" msgid "Project Hull Vertices" -msgstr "프로젝트 헐 꼭지점" +msgstr "프로젝트 헐 꼭짓점" msgid "Primitive" msgstr "프리미티브" @@ -2155,7 +2155,7 @@ msgid "Import Script" msgstr "스크립트 가져오기" msgid "Normal Map" -msgstr "일반 맵" +msgstr "노멀 맵" msgid "Roughness" msgstr "굵기" @@ -4822,7 +4822,7 @@ msgid "UV" msgstr "UV" msgid "Vertex Colors" -msgstr "꼭짓점 색" +msgstr "버텍스 컬러" msgid "Polygons" msgstr "폴리곤" @@ -4900,7 +4900,7 @@ msgid "Navigation Visibility Mode" msgstr "네비게이션 가시성 모드" msgid "Texture Normal" -msgstr "일반 텍스처" +msgstr "노멀 텍스처" msgid "Texture Pressed" msgstr "눌림 텍스처" @@ -6385,7 +6385,7 @@ msgid "Snap 2D Transforms to Pixel" msgstr "2D 변형을 픽셀에 스냅" msgid "Snap 2D Vertices to Pixel" -msgstr "2D 꼭지점을 픽셀에 스냅" +msgstr "2D 꼭짓점을 픽셀에 스냅" msgid "VRS" msgstr "VRS" @@ -6733,7 +6733,7 @@ msgid "Disable Ambient Light" msgstr "환경광 비활성화" msgid "Vertex Color" -msgstr "꼭짓점 색" +msgstr "버텍스 컬러" msgid "Use as Albedo" msgstr "알베도로 사용" @@ -7476,8 +7476,14 @@ msgstr "프래그먼트" msgid "Cull" msgstr "컬링" +msgid "Skip Vertex Transform" +msgstr "버텍스 변형 건너뛰기" + +msgid "World Vertex Coords" +msgstr "전역 꼭짓점 좌표" + msgid "Vertex Lighting" -msgstr "꼭짓점 조명" +msgstr "버텍스 라이팅" msgid "Shadow Atlas" msgstr "그림자 아틀라스" @@ -7497,6 +7503,9 @@ msgstr "GI" msgid "Overrides" msgstr "오버라이드" +msgid "Force Vertex Shading" +msgstr "버텍스 셰이딩 강제" + msgid "Global Shader Variables" msgstr "전역 셰이더 변수" diff --git a/editor/translations/properties/pl.po b/editor/translations/properties/pl.po index a9707f0bcf..9c392350e7 100644 --- a/editor/translations/properties/pl.po +++ b/editor/translations/properties/pl.po @@ -81,13 +81,16 @@ # Led Liedtke <przemekliedtke@gmail.com>, 2023. # ThomsikDev <szczopek7@outlook.com>, 2023. # johnny1029 <jkste07@gmail.com>, 2023. +# Marcin Zieliński <czolgista83@gmail.com>, 2023. +# Aleksander Łagowiec <mineolek10@users.noreply.hosted.weblate.org>, 2023. msgid "" msgstr "" "Project-Id-Version: Godot Engine properties\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-11-07 01:15+0000\n" -"Last-Translator: johnny1029 <jkste07@gmail.com>\n" +"PO-Revision-Date: 2023-12-06 04:32+0000\n" +"Last-Translator: Aleksander Łagowiec <mineolek10@users.noreply.hosted.weblate." +"org>\n" "Language-Team: Polish <https://hosted.weblate.org/projects/godot-engine/godot-" "properties/pl/>\n" "Language: pl\n" @@ -96,7 +99,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " "|| n%100>=20) ? 1 : 2;\n" -"X-Generator: Weblate 5.2-dev\n" +"X-Generator: Weblate 5.3-dev\n" msgid "Application" msgstr "Aplikacja" @@ -230,6 +233,12 @@ msgstr "Siła przesuwania 3D" msgid "iOS" msgstr "iOS" +msgid "Session Category" +msgstr "Kategoria sesji" + +msgid "Mix With Others" +msgstr "Mieszaj z Innymi" + msgid "Editor" msgstr "Edytor" @@ -290,6 +299,9 @@ msgstr "Formaty" msgid "Zstd" msgstr "Zstd" +msgid "Long Distance Matching" +msgstr "Dopasowanie Na Odległość" + msgid "Compression Level" msgstr "Poziom kompresji" @@ -329,6 +341,9 @@ msgstr "Internacjonalizacja" msgid "Force Right to Left Layout Direction" msgstr "Wymuś kierunek układu od prawej do lewej" +msgid "Root Node Layout Direction" +msgstr "Kierunek układu węzła głównego" + msgid "GUI" msgstr "GUI" @@ -356,14 +371,26 @@ msgstr "Zastosuj nadpróbkowanie" msgid "Rendering Device" msgstr "Urządzenie renderujące" +msgid "Staging Buffer" +msgstr "Bufor przejściowy" + msgid "Block Size (KB)" msgstr "Rozmiar bloku (KB)" msgid "Max Size (MB)" msgstr "Maks. rozmiar (MB)" +msgid "Texture Upload Region Size Px" +msgstr "Rozmiar regionu przesyłania tekstur (w piks.)" + +msgid "Pipeline Cache" +msgstr "Pamięć podręczna Pipeline-u" + +msgid "Save Chunk Size (MB)" +msgstr "Zapisz rozmiar fragmentu (MB)" + msgid "Vulkan" -msgstr "Vulkan" +msgstr "Vulkan (API)" msgid "Max Descriptors per Pool" msgstr "Maks. liczba deskryptorów na pulę" @@ -395,8 +422,11 @@ msgstr "Wygładzanie delty" msgid "Print Error Messages" msgstr "Wyświetlaj komunikaty o błędach" +msgid "Physics Ticks per Second" +msgstr "Ticki Fizyki na Sekundę" + msgid "Max Physics Steps per Frame" -msgstr "Maksymalna liczba kroków fizyki na klatkę" +msgstr "Maksymalna Liczba Kroków Fizyki na Klatkę" msgid "Max FPS" msgstr "Maks. FPS" @@ -417,7 +447,7 @@ msgid "Input Devices" msgstr "Urządzenia wejściowe" msgid "Compatibility" -msgstr "Kompatybilność" +msgstr "Kompatybilny" msgid "Device" msgstr "Urządzenie" @@ -848,6 +878,9 @@ msgstr "Rozmiar miniaturki" msgid "Import" msgstr "Zaimportuj" +msgid "Blender 3 Path" +msgstr "Ścieżka Blender 3" + msgid "FBX" msgstr "FBX" @@ -1419,7 +1452,7 @@ msgid "MSDF Size" msgstr "Rozmiar MSDF" msgid "Hinting" -msgstr "Hinting" +msgstr "Podpowiedź" msgid "Subpixel Positioning" msgstr "Pozycjonowanie subpikselowe" @@ -1532,6 +1565,9 @@ msgstr "Wysokość" msgid "Radius" msgstr "Promień" +msgid "Simplification Distance" +msgstr "Dystans uproszczenia" + msgid "Save to File" msgstr "Zapisz do pliku" @@ -1679,6 +1715,9 @@ msgstr "Używaj wątków" msgid "Available URLs" msgstr "Dostępne URL" +msgid "Bone Mapper" +msgstr "Mapper kości" + msgid "Unset" msgstr "Wymaż" @@ -1703,6 +1742,9 @@ msgstr "Regulacja przezroczystości uchwytu" msgid "Show Viewport Rotation Gizmo" msgstr "Pokaż obrót widoku uchwytu" +msgid "Path Tilt" +msgstr "Odchył ścieżki" + msgid "External" msgstr "Zewnętrzne" @@ -1778,6 +1820,9 @@ msgstr "Ścieżka szukania szablonów" msgid "Naming" msgstr "Nazewnictwo" +msgid "Scene Name Casing" +msgstr "Wielkość liter w nazwie Sceny" + msgid "Reimport Missing Imported Files" msgstr "Zaimportuj ponownie brakujące importowane pliki" @@ -1952,12 +1997,18 @@ msgstr "CSG" msgid "GDScript" msgstr "GDScript" +msgid "Notice List" +msgstr "Lista uwag" + msgid "Warnings" msgstr "Ostrzeżenia" msgid "Language Server" msgstr "Serwer języka" +msgid "Range" +msgstr "Przedział" + msgid "Diffuse Img" msgstr "Rozmycie obrazu" @@ -2000,6 +2051,12 @@ msgstr "Zapętl" msgid "Perspective" msgstr "Perspektywa" +msgid "Size Mag" +msgstr "Rozmiar" + +msgid "Instance Materials" +msgstr "Materiały instancji" + msgid "Skin" msgstr "Skórka" @@ -2045,6 +2102,9 @@ msgstr "Lightmapping" msgid "Region Size" msgstr "Rozmiar regionu" +msgid "Denoiser" +msgstr "Filtr" + msgid "Loop Offset" msgstr "Przesunięcie pętli" @@ -2090,6 +2150,9 @@ msgstr "Siła uderzenia" msgid "Noise" msgstr "Szum" +msgid "Render Target Size Multiplier" +msgstr "Multiplier rozmiaru obiektu renderowania" + msgid "Names" msgstr "Nazwy" @@ -2108,18 +2171,51 @@ msgstr "Funkcje wymagane" msgid "Optional Features" msgstr "Funkcje opcjonalne" +msgid "Min SDK" +msgstr "minimalne SDK" + msgid "Plugins" msgstr "Wtyczki" +msgid "Unique Name" +msgstr "Unikalna nazwa" + +msgid "App Category" +msgstr "Kategoria aplikacji" + +msgid "Graphics" +msgstr "Grafika" + +msgid "Extra Args" +msgstr "Dodatkowe argumenty" + msgid "Icons" msgstr "Ikony" +msgid "Notification 40 X 40" +msgstr "Notifikacja 40 X 40" + +msgid "Notification 60 X 60" +msgstr "Notyfikacja 60 X 60" + +msgid "Export Method Release" +msgstr "Metoda eksportu wydania" + +msgid "Bundle Identifier" +msgstr "Identyfikator zbioru" + msgid "Access Wi-Fi" msgstr "Dostęp do Wi-Fi" +msgid "Push Notifications" +msgstr "Powiadomienia push" + msgid "macOS" msgstr "macOS" +msgid "Provisioning Profile" +msgstr "Profil aprowizacji" + msgid "Location" msgstr "Lokalizacja" @@ -2312,6 +2408,9 @@ msgstr "Synchronizuj" msgid "Request" msgstr "Żądanie" +msgid "Seek Request" +msgstr "Żądanie danych" + msgid "Root Node" msgstr "Węzeł główny" @@ -2618,6 +2717,9 @@ msgstr "Kolor separatora czcionki" msgid "Cursor" msgstr "Kursor" +msgid "Screen Picker" +msgstr "Operator ekranu" + msgid "Node" msgstr "Węzeł" @@ -2630,6 +2732,12 @@ msgstr "Domyślne pozycjonowanie subpikselowe czcionki" msgid "Pan" msgstr "Pan" +msgid "Tap 1" +msgstr "Pierwszy" + +msgid "Tap 2" +msgstr "Pierwsze dwa" + msgid "Feedback" msgstr "Informacja zwrotna" @@ -2651,6 +2759,9 @@ msgstr "Wartość progowa dB" msgid "Soft Clip dB" msgstr "Miękkie przesterowanie dB" +msgid "Time Pullout (ms)" +msgstr "Przekroczenie czasu" + msgid "Vertex" msgstr "Wierzchołki" @@ -2658,7 +2769,7 @@ msgid "Fragment" msgstr "Fragmenty" msgid "Cull" -msgstr "Cull" +msgstr "Zredukuj" msgid "Ensure Correct Normals" msgstr "Zapewnij prawidłowe wartości normalnych" @@ -2675,6 +2786,9 @@ msgstr "GI" msgid "Overrides" msgstr "Nadpisuje" +msgid "Decals" +msgstr "Naklejki" + msgid "Screen Space Reflection" msgstr "Odbicie w przestrzeni ekranu" diff --git a/editor/translations/properties/pt.po b/editor/translations/properties/pt.po index a4132f803f..76fcbf5f6a 100644 --- a/editor/translations/properties/pt.po +++ b/editor/translations/properties/pt.po @@ -35,13 +35,15 @@ # Deolindo <deolindojvn@gmail.com>, 2023. # Hevinis <meauriocardoso@gmail.com>, 2023. # Ricardo Caetano <ricardofilipecaetano@gmail.com>, 2023. +# Henricky Corazza Serrão <henrickyserrao@gmail.com>, 2023. +# Ricardo Bustamante <ricardobqueiroz@gmail.com>, 2023. msgid "" msgstr "" "Project-Id-Version: Godot Engine properties\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-07-10 08:17+0000\n" -"Last-Translator: Ricardo Caetano <ricardofilipecaetano@gmail.com>\n" +"PO-Revision-Date: 2023-12-07 23:30+0000\n" +"Last-Translator: Ricardo Bustamante <ricardobqueiroz@gmail.com>\n" "Language-Team: Portuguese <https://hosted.weblate.org/projects/godot-engine/" "godot-properties/pt/>\n" "Language: pt\n" @@ -49,7 +51,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.0-dev\n" +"X-Generator: Weblate 5.3-dev\n" msgid "Application" msgstr "Aplicação" @@ -183,6 +185,9 @@ msgstr "Força de Panning 3D" msgid "iOS" msgstr "iOS" +msgid "Mix With Others" +msgstr "Misturar Com Outros" + msgid "Editor" msgstr "Editor" @@ -192,6 +197,12 @@ msgstr "Script" msgid "Search in File Extensions" msgstr "Pesquisar em Extensões de Arquivo" +msgid "Subwindows" +msgstr "Subjanelas" + +msgid "Embed Subwindows" +msgstr "Incorporar subjanelas" + msgid "Physics" msgstr "Física" @@ -225,6 +236,9 @@ msgstr "Compressão" msgid "Zstd" msgstr "Zstd" +msgid "Compression Level" +msgstr "Nível de Compressão" + msgid "Zlib" msgstr "Zlib" @@ -270,6 +284,9 @@ msgstr "Fontes Dinâmicas" msgid "Use Oversampling" msgstr "Usar Sobreamostragem" +msgid "Pipeline Cache" +msgstr "Cache de Pipeline" + msgid "Vulkan" msgstr "Vulkan" @@ -309,6 +326,9 @@ msgstr "Usar Entrada Acumulada" msgid "Input Devices" msgstr "Dispositivos de Entrada" +msgid "Legacy Just Pressed Behavior" +msgstr "Comportamento de Acabou de Pressionar (Legado)" + msgid "Device" msgstr "Aparelho" @@ -369,6 +389,9 @@ msgstr "Valor do Eixo" msgid "Index" msgstr "Índice" +msgid "Double Tap" +msgstr "Toque Duplo" + msgid "Action" msgstr "Ação" @@ -756,6 +779,9 @@ msgstr "FBX" msgid "FBX2glTF Path" msgstr "Caminho para FBX2glTF" +msgid "Oidn Denoise Path" +msgstr "Caminho Oidn de Remoção de Ruído" + msgid "Docks" msgstr "Painéis" @@ -1077,6 +1103,9 @@ msgstr "Tamanho do Contorno dos Ossos" msgid "Viewport Border Color" msgstr "Cor da borda do Viewport" +msgid "Use Integer Zoom by Default" +msgstr "Usar Zoom Inteiro por Padrão" + msgid "Sub Editors Panning Scheme" msgstr "Esquema de painéis do Sub Editor" @@ -1731,6 +1760,12 @@ msgstr "Caminho de Log" msgid "Driver" msgstr "Driver" +msgid "Nvidia Disable Threaded Optimization" +msgstr "Nvidia Desabilitar Otimização em Threads" + +msgid "Force Angle on Devices" +msgstr "Forçar Ângulo em Dispositivos" + msgid "Include Text Server Data" msgstr "Incluir dados de Servidor de Texto" @@ -2031,6 +2066,9 @@ msgstr "Massa" msgid "Angular Velocity" msgstr "Velocidade Angular" +msgid "Is Trigger" +msgstr "É Gatilho" + msgid "Json" msgstr "Json" @@ -2409,6 +2447,9 @@ msgstr "Depurar Senha de Armazenamento de Chaves" msgid "Force System User" msgstr "Forçar Usuário do Sistema" +msgid "Use Wi-Fi for Remote Debug" +msgstr "Use Wi-Fi para Depuração Remota" + msgid "Launcher Icons" msgstr "Ícones do Inicializador" @@ -2439,17 +2480,20 @@ msgstr "Plugins" msgid "Architectures" msgstr "Arquiteturas" +msgid "Keystore" +msgstr "Keystore" + msgid "Debug User" -msgstr "Depurar Utilizador" +msgstr "Usuário de Depuração" msgid "Debug Password" -msgstr "Depurar Palavra-passe" +msgstr "Senha de Depuração" msgid "Release User" -msgstr "Liberar Utilizador" +msgstr "Usuário de Lançamento" msgid "Release Password" -msgstr "Liberar Palavra-passe" +msgstr "Senha de Lançamento" msgid "Code" msgstr "Código" @@ -2469,6 +2513,9 @@ msgstr "Categoria da App" msgid "Exclude From Recents" msgstr "Excluir de Recentes" +msgid "Show in Android Tv" +msgstr "Mostrar em Android TV" + msgid "Graphics" msgstr "Gráficos" @@ -3510,6 +3557,9 @@ msgstr "Flags" msgid "Billboard" msgstr "'Billboard'" +msgid "Double Sided" +msgstr "Dois Lados" + msgid "No Depth Test" msgstr "Sem Teste de Profundidade" @@ -3813,6 +3863,9 @@ msgstr "Nó Raiz" msgid "Root Motion" msgstr "Movimento Raiz" +msgid "Method" +msgstr "Método" + msgid "Reset" msgstr "Repor" @@ -3888,6 +3941,12 @@ msgstr "Forma do Cursor Predefinida" msgid "Scroll Offset" msgstr "Deslocamento da Rolagem" +msgid "Show Grid" +msgstr "Mostrar Grade" + +msgid "Toolbar Menu" +msgstr "Menu de Ferramentas" + msgid "Title" msgstr "Titulo" @@ -4113,6 +4172,9 @@ msgstr "'MSAA 2D'" msgid "MSAA 3D" msgstr "'MSAA 3D'" +msgid "HDR 2D" +msgstr "HDR 2D" + msgid "Use Debanding" msgstr "Usar Debanding" @@ -4275,6 +4337,9 @@ msgstr "1" msgid "2" msgstr "2" +msgid "3" +msgstr "3" + msgid "4" msgstr "4" diff --git a/editor/translations/properties/pt_BR.po b/editor/translations/properties/pt_BR.po index 84ef5ca496..8791950b78 100644 --- a/editor/translations/properties/pt_BR.po +++ b/editor/translations/properties/pt_BR.po @@ -161,13 +161,14 @@ # Romildo Franco <rtfranco@gmail.com>, 2023. # Felipe Bertola <eduardodelphinodepaula@gmail.com>, 2023. # Vittor Paulo Vieira da Costa <vittorpaulovc@gmail.com>, 2023. +# Matheus Macedo <mmanganelidemacedo@gmail.com>, 2023. msgid "" msgstr "" "Project-Id-Version: Godot Engine properties\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: 2016-05-30\n" -"PO-Revision-Date: 2023-11-03 04:56+0000\n" -"Last-Translator: Vittor Paulo Vieira da Costa <vittorpaulovc@gmail.com>\n" +"PO-Revision-Date: 2023-11-18 06:21+0000\n" +"Last-Translator: Matheus Macedo <mmanganelidemacedo@gmail.com>\n" "Language-Team: Portuguese (Brazil) <https://hosted.weblate.org/projects/godot-" "engine/godot-properties/pt_BR/>\n" "Language: pt_BR\n" @@ -175,7 +176,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 5.2-dev\n" +"X-Generator: Weblate 5.2\n" msgid "Application" msgstr "Aplicação" @@ -309,6 +310,9 @@ msgstr "Intensidade da Panorâmica 3D" msgid "iOS" msgstr "iOS" +msgid "Mix With Others" +msgstr "Misturar com Outros" + msgid "Editor" msgstr "Editor" diff --git a/editor/translations/properties/ru.po b/editor/translations/properties/ru.po index 3ff877b33f..ef8bab2b83 100644 --- a/editor/translations/properties/ru.po +++ b/editor/translations/properties/ru.po @@ -153,13 +153,15 @@ # Daniil Zimchuk <danrus228zk@gmail.com>, 2023. # Иван Жиляк <zilakivan2008@gmail.com>, 2023. # Ilia Brykin <brykin.ilia@gmail.com>, 2023. +# DLushin <dmiyashyt@gmail.com>, 2023. +# Ruslan <vovavalenkov15@gmail.com>, 2023. msgid "" msgstr "" "Project-Id-Version: Godot Engine properties\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-11-09 22:40+0000\n" -"Last-Translator: Ilia Brykin <brykin.ilia@gmail.com>\n" +"PO-Revision-Date: 2023-11-28 04:14+0000\n" +"Last-Translator: DLushin <dmiyashyt@gmail.com>\n" "Language-Team: Russian <https://hosted.weblate.org/projects/godot-engine/" "godot-properties/ru/>\n" "Language: ru\n" @@ -168,7 +170,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && " "n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" -"X-Generator: Weblate 5.2-dev\n" +"X-Generator: Weblate 5.3-dev\n" msgid "Application" msgstr "Приложение" @@ -231,7 +233,7 @@ msgid "Size" msgstr "Размер" msgid "Viewport Width" -msgstr "Ширина окна предпросмотра" +msgstr "Ширина экрана" msgid "Viewport Height" msgstr "Высота экрана" @@ -302,6 +304,12 @@ msgstr "Сила панорамирования 3D" msgid "iOS" msgstr "iOS" +msgid "Session Category" +msgstr "Категория приложения" + +msgid "Mix With Others" +msgstr "Смешивание с другими" + msgid "Editor" msgstr "Редактор" @@ -485,6 +493,9 @@ msgstr "Использовать Ambient" msgid "Low Processor Usage Mode" msgstr "Режим низкой нагрузки процессора" +msgid "Low Processor Usage Mode Sleep (µsec)" +msgstr "Задержка в режиме низкой нагрузки процессора (мсек)" + msgid "Delta Smoothing" msgstr "Дельта сглаживание" @@ -908,6 +919,9 @@ msgstr "Локализация" msgid "Scene Tabs" msgstr "Вкладки сцен" +msgid "Restore Scenes on Load" +msgstr "Восстанавливать сцены при загрузке" + msgid "Inspector" msgstr "Инспектор" @@ -929,12 +943,18 @@ msgstr "Горизонтальное редактирование Vector2" msgid "Horizontal Vector Types Editing" msgstr "Горизонтальных редактирование векторных типов" +msgid "Open Resources in Current Inspector" +msgstr "Открывать ресурсы в текущем инспекторе" + msgid "Resources to Open in New Inspector" msgstr "Ресурсы для Открытия в новом экземпляре Инспектора" msgid "Default Color Picker Mode" msgstr "Режим выбора цвета по умолчанию" +msgid "Default Color Picker Shape" +msgstr "Режим выбора цвета по умолчанию" + msgid "Base Type" msgstr "Базовый тип" @@ -950,6 +970,12 @@ msgstr "Язык редактора" msgid "Display Scale" msgstr "Масштаб отображения" +msgid "Editor Screen" +msgstr "Сторона редактора" + +msgid "Project Manager Screen" +msgstr "Экран менеджера проекта" + msgid "Enable Pseudolocalization" msgstr "Включить псевдолокализацию" @@ -1088,12 +1114,21 @@ msgstr "Импорт" msgid "Blender" msgstr "Blender" +msgid "RPC Server Uptime" +msgstr "Время работы сервера RPC" + msgid "FBX" msgstr "FBX" msgid "FBX2glTF Path" msgstr "FBX2glTF Путь" +msgid "Oidn" +msgstr "" +"Oidn означает Open Image Denoise, это свободно распространяемая библиотека " +"для обработки изображений с открытым исходным кодом, предназначенная для " +"удаления шумов из рендеров." + msgid "Docks" msgstr "Панели" @@ -1418,6 +1453,9 @@ msgstr "Размер контура кости" msgid "Viewport Border Color" msgstr "Цвет границы Viewport" +msgid "Use Integer Zoom by Default" +msgstr "Использовать целочисленное масштабирование по умолчанию" + msgid "Sub Editors Panning Scheme" msgstr "Схема панорамирования подредакторов" @@ -1781,6 +1819,21 @@ msgstr "Точность" msgid "Symmetry Planes Clipping Bias" msgstr "Плоскости симметрии смещение отсечения" +msgid "Revolution Axes Clipping Bias" +msgstr "Смещение отсечения осей революции" + +msgid "Min Volume per Convex Hull" +msgstr "Минимальный объем для каждой выпуклой оболочки" + +msgid "Max Num Vertices per Convex Hull" +msgstr "Максимальное количество вершин для каждой выпуклой оболочки" + +msgid "Plane Downsampling" +msgstr "Понижение разрешения для плоскости" + +msgid "Convexhull Downsampling" +msgstr "Понижение разрешения для выпуклой оболочки" + msgid "Height" msgstr "Высота" @@ -4139,6 +4192,9 @@ msgstr "HDR маcштаб" msgid "Fog" msgstr "Туман" +msgid "Volumetric Fog" +msgstr "Объемный туман" + msgid "Anisotropy" msgstr "Анизотропия" diff --git a/editor/translations/properties/tr.po b/editor/translations/properties/tr.po index 5a8db2970f..072f178285 100644 --- a/editor/translations/properties/tr.po +++ b/editor/translations/properties/tr.po @@ -100,7 +100,7 @@ msgstr "" "Project-Id-Version: Godot Engine properties\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-10-17 06:43+0000\n" +"PO-Revision-Date: 2023-11-16 16:21+0000\n" "Last-Translator: Yılmaz Durmaz <yilmaz_durmaz@hotmail.com>\n" "Language-Team: Turkish <https://hosted.weblate.org/projects/godot-engine/" "godot-properties/tr/>\n" @@ -109,7 +109,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.1\n" +"X-Generator: Weblate 5.2\n" msgid "Application" msgstr "Uygulama" @@ -243,6 +243,12 @@ msgstr "3D Kaydırma Keskinliği" msgid "iOS" msgstr "iOS" +msgid "Session Category" +msgstr "Oturum Kategorisi" + +msgid "Mix With Others" +msgstr "Diğerleri ile Karıştır" + msgid "Editor" msgstr "Düzenleyici" @@ -426,6 +432,9 @@ msgstr "Çevreyi Kullan" msgid "Low Processor Usage Mode" msgstr "Düşük İşlemci Kullanım Kipi" +msgid "Low Processor Usage Mode Sleep (µsec)" +msgstr "Düşük İşlemci Kullanım Kipi Uyku (µsec)" + msgid "Delta Smoothing" msgstr "Delta Yumuşatması" @@ -951,6 +960,12 @@ msgstr "Ana Yazı Tipi Kalın" msgid "Code Font" msgstr "Kod Yazı Tipi" +msgid "Low Processor Mode Sleep (µsec)" +msgstr "Düşük İşlemci Kipi Uyku (µsec)" + +msgid "Unfocused Low Processor Mode Sleep (µsec)" +msgstr "Odaklanılmamış Düşük İşlemci Kipi Uyku (µsec)" + msgid "Separate Distraction Mode" msgstr "Ayrık Dikkat Dağıtma Kipi" @@ -1125,6 +1140,15 @@ msgstr "FBX" msgid "FBX2glTF Path" msgstr "FBX2glTF Yolu" +msgid "Tools" +msgstr "Araçlar" + +msgid "Oidn" +msgstr "Oidn" + +msgid "Oidn Denoise Path" +msgstr "Oidn Gürültü Giderici Yolu" + msgid "Docks" msgstr "Yuvalar" @@ -1671,6 +1695,9 @@ msgstr "Kullanıcı Tip Rengi" msgid "Comment Color" msgstr "Yorum Rengi" +msgid "Doc Comment Color" +msgstr "Döküman Yorum Rengi" + msgid "String Color" msgstr "Dize Rengi" @@ -1950,6 +1977,9 @@ msgstr "Haritalanmamış Kemikler" msgid "Create From" msgstr "Şuradan Oluştur" +msgid "Scaling Mode" +msgstr "Ölçekleme Kipi" + msgid "Delimiter" msgstr "Ayırıcı" @@ -2019,6 +2049,9 @@ msgstr "Örgü Kaydırma" msgid "Optimize Mesh" msgstr "Örgüyü En İyileştir" +msgid "Force Disable Mesh Compression" +msgstr "Örgü Sıkıştırmayı Devre Dışı Bırakmayı Zorla" + msgid "Skip Import" msgstr "İçe Aktarmayı Atla" @@ -2211,6 +2244,9 @@ msgstr "Işık Pişirme" msgid "Lightmap Texel Size" msgstr "Işık Haritası Texel Boyutu" +msgid "Force Disable Compression" +msgstr "Sıkıştırmayı Zorla Devre Dışı bırak" + msgid "Skins" msgstr "Kaplamalar" @@ -2406,6 +2442,12 @@ msgstr "Çerçevede Gezinti Aletini Göster" msgid "Gizmo Settings" msgstr "Alet Ayarları" +msgid "Path 3D Tilt Disk Size" +msgstr "3B Yolu Eğme Diski Boyutu" + +msgid "Path Tilt" +msgstr "Yol Eğimi" + msgid "Auto Reload and Parse Scripts on Save" msgstr "Kaydederken Betikleri Otomatik Tekrar Yükle ve Çözümle" @@ -2580,6 +2622,18 @@ msgstr "GL Uyumluluğu" msgid "Nvidia Disable Threaded Optimization" msgstr "Nvidia İş Parçacıklı En İyileştirmeyi Kapat" +msgid "Fallback to Angle" +msgstr "Son Çare Angle'a Geri Dön" + +msgid "Fallback to Native" +msgstr "Son Çare Yerel'e Geri Dön" + +msgid "Fallback to Gles" +msgstr "Son Çare Gles'e Geri Dön" + +msgid "Force Angle on Devices" +msgstr "Cihazlarda Angle kullanımını Zorla" + msgid "Renderer" msgstr "İşleyici" @@ -2685,6 +2739,15 @@ msgstr "Derinlik Arabelleğini Gönder" msgid "Startup Alert" msgstr "Başlangıç Uyarısı" +msgid "Extensions" +msgstr "Uzantılar" + +msgid "Hand Tracking" +msgstr "El Takibi" + +msgid "Eye Gaze Interaction" +msgstr "Göz Bakış Etkileşimi" + msgid "In Editor" msgstr "Düzenleyici İçinde" @@ -2943,6 +3006,9 @@ msgstr "İş Parçası Kullan" msgid "glTF" msgstr "glTF" +msgid "Naming Version" +msgstr "Sürümü İsimlendirme" + msgid "Embedded Image Handling" msgstr "Gömülü Resim İşlemesi" @@ -3288,6 +3354,12 @@ msgstr "Çok Yüksek Kalite Sonda Işın Sayısı" msgid "Max Rays per Probe Pass" msgstr "Sonda Geçişi başına En Fazla Işın" +msgid "Denoising" +msgstr "Gürültü Giderme" + +msgid "Denoiser" +msgstr "Gürültü Giderici" + msgid "BPM" msgstr "Dakika Başına Vuruş (BPM)" @@ -4614,6 +4686,9 @@ msgstr "Kaydırma En Çok" msgid "Offset Curve" msgstr "Kaydırma Eğrisi" +msgid "Amount Ratio" +msgstr "Miktar Oranı" + msgid "Sub Emitter" msgstr "Alt Yayıcı" @@ -4623,6 +4698,9 @@ msgstr "İşleme Malzemesi" msgid "Interpolate" msgstr "Ara Değerle" +msgid "Interp to End" +msgstr "Sona Ara Değerle" + msgid "Base Size" msgstr "Temel Boyut" @@ -5619,9 +5697,15 @@ msgstr "Kalite" msgid "Bounces" msgstr "Sekmeli" +msgid "Bounce Indirect Energy" +msgstr "Dolaylı Enerjiyi Sektir" + msgid "Directional" msgstr "Yönlü" +msgid "Use Texture for Bounces" +msgstr "Sektirme için Doku Kullan" + msgid "Interior" msgstr "İç Mekan" @@ -5664,6 +5748,9 @@ msgstr "Yol Yüksekliği Kayması" msgid "Use 3D Avoidance" msgstr "3B Kaçınma Kullan" +msgid "Keep Y Velocity" +msgstr "Y Hızını Koru" + msgid "Navigation Mesh" msgstr "Gezinti Örgüsü" @@ -6903,6 +6990,15 @@ msgstr "Çoklu" msgid "Syntax Highlighter" msgstr "Sözdizimi Vurgulama" +msgid "Visual Whitespace" +msgstr "Görsel Beyazboşluk" + +msgid "Control Chars" +msgstr "Denetim Karakterleri" + +msgid "Spaces" +msgstr "Boşluklar" + msgid "Text Edit Idle Detect (sec)" msgstr "Metn Düzenleme Boşta Kalma Algılama (sn)" @@ -7344,6 +7440,9 @@ msgstr "En Küçük Boyut" msgid "Max Size" msgstr "En Büyük Boyut" +msgid "Keep Title Visible" +msgstr "Başlığı Görünür Tut" + msgid "Content Scale" msgstr "İçerik Ölçeği" @@ -8073,6 +8172,78 @@ msgstr "Kaynak Geometri Grup İsmi" msgid "Bundled" msgstr "Paketlenmiş" +msgid "Damping as Friction" +msgstr "Sönümlemeyi Sürtünme Olarak Al" + +msgid "Spawn" +msgstr "Oluştur" + +msgid "Emission Shape Offset" +msgstr "Yayılma Şekli Kayması" + +msgid "Emission Shape Scale" +msgstr "Yayılma Şekli Ölçeği" + +msgid "Emission Sphere Radius" +msgstr "Yayılma Küresi Yarıçapı" + +msgid "Emission Box Extents" +msgstr "Yayılma Kutusu Uzanımları" + +msgid "Emission Point Texture" +msgstr "Yayılma Noktası Dokusu" + +msgid "Emission Normal Texture" +msgstr "Yayılmaz Normali Dokusu" + +msgid "Emission Color Texture" +msgstr "Yayılma Rengi Dokusu" + +msgid "Emission Point Count" +msgstr "Yayılma Noktası Sayısı" + +msgid "Emission Ring Axis" +msgstr "Yayılma Halkası Ekseni" + +msgid "Emission Ring Height" +msgstr "Yayılma Halkası Yüksekliği" + +msgid "Emission Ring Radius" +msgstr "Yayılma Halkası Yarıçapı" + +msgid "Emission Ring Inner Radius" +msgstr "Yayılma Halkası İç Yarıçapı" + +msgid "Inherit Velocity Ratio" +msgstr "Hız Oranını Miras Al" + +msgid "Velocity Pivot" +msgstr "Hız Ekseni" + +msgid "Initial Velocity Min" +msgstr "Başlangıç Hızı En Az" + +msgid "Initial Velocity Max" +msgstr "Başlangıç Hızı En Fazla" + +msgid "Animated Velocity" +msgstr "Canlandırılan Hız" + +msgid "Velocity Limit" +msgstr "Hız Sınırı" + +msgid "Directional Velocity" +msgstr "Yönlü Hız" + +msgid "Radial Velocity" +msgstr "Radyal Hız" + +msgid "Velocity Limit Curve" +msgstr "Hız Sınırı Eğrisi" + +msgid "Accelerations" +msgstr "Hızlanmalar" + msgid "Attractor Interaction" msgstr "Çekici Etkileşimi" @@ -8085,6 +8256,27 @@ msgstr "Ölçek En Fazla" msgid "Scale Curve" msgstr "Ölçek Eğri" +msgid "Scale Over Velocity" +msgstr "Hız Üzerinden Ölçeklendir" + +msgid "Scale over Velocity Min" +msgstr "En Az Hız Üzerinden Ölçekle" + +msgid "Scale over Velocity Max" +msgstr "En Fazla Hız Üzerinden Ölçekle" + +msgid "Scale over Velocity Curve" +msgstr "Hız Eğrisi Üzerinden Ölçekle" + +msgid "Color Curves" +msgstr "Renk Eğrileri" + +msgid "Alpha Curve" +msgstr "Alfa Eğrisi" + +msgid "Emission Curve" +msgstr "Yayılım Eğrisi" + msgid "Turbulence" msgstr "Çalkantı" @@ -9420,6 +9612,9 @@ msgstr "Seviye dB" msgid "Pan" msgstr "Kaydır" +msgid "Attack (µs)" +msgstr "Atak (µs)" + msgid "Release (ms)" msgstr "Bırakma (ms)" @@ -9765,6 +9960,12 @@ msgstr "Esas Elemsizlik Ekseni" msgid "Max Collisions" msgstr "En Fazla Çarpışmalar" +msgid "Debug Redraw Time" +msgstr "Hata Ayıklama Tekrar Çizme Süresi" + +msgid "Debug Redraw Color" +msgstr "Hata Ayıklama Tekrar Çizme Rengi" + msgid "Vertex" msgstr "Köşenokta" diff --git a/editor/translations/properties/uk.po b/editor/translations/properties/uk.po index dd0d869707..1ee7e3f0e6 100644 --- a/editor/translations/properties/uk.po +++ b/editor/translations/properties/uk.po @@ -31,13 +31,14 @@ # Dan <jonweblin2205@protonmail.com>, 2023. # Siked Siked <siked3@gmail.com>, 2023. # Вадим Коваль <vadimkoval571@gmail.com>, 2023. +# Volodymyr Mikhav <mihaw.wolodymyr@gmail.com>, 2023. msgid "" msgstr "" "Project-Id-Version: Ukrainian (Godot Engine)\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-10-29 17:04+0000\n" -"Last-Translator: Вадим Коваль <vadimkoval571@gmail.com>\n" +"PO-Revision-Date: 2023-11-23 17:10+0000\n" +"Last-Translator: Volodymyr Mikhav <mihaw.wolodymyr@gmail.com>\n" "Language-Team: Ukrainian <https://hosted.weblate.org/projects/godot-engine/" "godot-properties/uk/>\n" "Language: uk\n" @@ -46,7 +47,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && " "n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" -"X-Generator: Weblate 5.2-dev\n" +"X-Generator: Weblate 5.2.1-rc\n" msgid "Application" msgstr "Застосунок" @@ -361,7 +362,7 @@ msgid "Time Scale" msgstr "Шкала часу" msgid "Physics Jitter Fix" -msgstr "Фізичний кадр %" +msgstr "Корекція джитеру фізики" msgid "Mouse Mode" msgstr "Режим миші" @@ -969,6 +970,9 @@ msgstr "Розмір мініатюр" msgid "Import" msgstr "Імпорт" +msgid "Blender 3 Path" +msgstr "Шлях до Blender 3" + msgid "FBX" msgstr "FBX" @@ -1750,7 +1754,7 @@ msgid "Channel Pack" msgstr "Пакет каналів" msgid "Mipmaps" -msgstr "Множинне відтворення" +msgstr "MIP-текстурування" msgid "Generate" msgstr "Створити" @@ -2136,6 +2140,9 @@ msgstr "Використання кількох потоків" msgid "Convert Text Resources to Binary" msgstr "Перетворювати текстові ресурси на двійкові" +msgid "Plugin Name" +msgstr "Назва додатка" + msgid "Show Scene Tree Root Selection" msgstr "Показувати кореневе позначення ієрархії сцени" @@ -2154,6 +2161,9 @@ msgstr "Шлях до журналу" msgid "Driver" msgstr "Драйвер" +msgid "Renderer" +msgstr "Рендерер" + msgid "DPI" msgstr "Роздільність" @@ -2181,8 +2191,11 @@ msgstr "Орієнтація" msgid "V-Sync" msgstr "Верт. синхронізація" +msgid "V-Sync Mode" +msgstr "Режим верт. синхронізації" + msgid "Output Latency" -msgstr "Результат" +msgstr "Затримка виведення" msgid "stdout" msgstr "stdout" @@ -2190,8 +2203,11 @@ msgstr "stdout" msgid "Print FPS" msgstr "Виводити частоту кадрів" +msgid "Print GPU Profile" +msgstr "Виводити профілювання GPU" + msgid "Verbose stdout" -msgstr "Докладно до stdout" +msgstr "Детальне виведення до stdout" msgid "Low Processor Mode" msgstr "Режим низького споживання процесора" @@ -2202,6 +2218,24 @@ msgstr "Приховати індикатор домівки" msgid "XR" msgstr "XR" +msgid "Form Factor" +msgstr "Форм-фактор" + +msgid "View Configuration" +msgstr "Конфігурація подання" + +msgid "Reference Space" +msgstr "Опорний простір" + +msgid "Environment Blend Mode" +msgstr "Режим змішування середовища" + +msgid "Foveation Level" +msgstr "Рівень фовеації" + +msgid "Foveation Dynamic" +msgstr "Динамічна фовеація" + msgid "Boot Splash" msgstr "Вітання системи" @@ -2256,6 +2290,12 @@ msgstr "Нетипова активна ділянка зображення" msgid "Tooltip Position Offset" msgstr "Відступ позиції підказки" +msgid "Minimum Display Time" +msgstr "Мінімальний час показу" + +msgid "Dotnet" +msgstr "Dotnet" + msgid "Project" msgstr "Проєкт" @@ -2596,7 +2636,7 @@ msgid "Mesh Library" msgstr "Бібліотека сітки" msgid "Physics Material" -msgstr "Фізичний кадр %" +msgstr "Матеріал фізики" msgid "Cell" msgstr "Мобільний" @@ -2631,6 +2671,9 @@ msgstr "Висока якість підрахунку променів" msgid "Ultra Quality Ray Count" msgstr "Кількість променів високої якості" +msgid "Max Rays per Pass" +msgstr "Макс. променів за прохід" + msgid "Loop Offset" msgstr "Зміщення циклу" @@ -2641,7 +2684,7 @@ msgid "IOD" msgstr "IOD" msgid "Display Width" -msgstr "Перегляд каркасу" +msgstr "Ширина екрану" msgid "Oversample" msgstr "Надвибірка" @@ -3238,7 +3281,7 @@ msgid "Tweaks" msgstr "Коригування" msgid "Use Mipmaps" -msgstr "Множинне відтворення" +msgstr "Використовувати MIP-текстурування" msgid "Input" msgstr "Введення" @@ -3576,6 +3619,9 @@ msgstr "Монітор контакту" msgid "Linear" msgstr "Лінійний" +msgid "Damp Mode" +msgstr "Режим прилипання" + msgid "Damp" msgstr "В’язкість" @@ -3855,6 +3901,9 @@ msgstr "Шрифт" msgid "Uppercase" msgstr "ВЕРХНІЙ РЕГІСТР" +msgid "Temperature" +msgstr "Температура" + msgid "Indirect Energy" msgstr "Опосередкована енергія" @@ -4086,6 +4135,9 @@ msgstr "Поза" msgid "World Scale" msgstr "Масштаб світу" +msgid "Play Mode" +msgstr "Режим гри" + msgid "Sync" msgstr "Синхронізувати" @@ -4135,7 +4187,7 @@ msgid "Expression" msgstr "Вираз" msgid "Current Animation" -msgstr "Встановити анімацію" +msgstr "Поточна анімація" msgid "Playback Options" msgstr "Параметри відтворення" @@ -5067,6 +5119,9 @@ msgstr "Місцевості" msgid "Custom Data" msgstr "Спеціальні дані" +msgid "Physics Layers" +msgstr "Шари фізики" + msgid "Scene" msgstr "Сцена" @@ -5082,6 +5137,9 @@ msgstr "Файл" msgid "Input Name" msgstr "Карта введення" +msgid "Parameter Name" +msgstr "Назва параметру" + msgid "Constant" msgstr "Сталий" @@ -5388,6 +5446,9 @@ msgstr "Діяльність" msgid "Node" msgstr "Вузол" +msgid "Playback Mode" +msgstr "Режим відтворення" + msgid "Random Pitch" msgstr "Випадковий тон" @@ -5485,10 +5546,10 @@ msgid "Shape RID" msgstr "RID форми" msgid "Default Gravity" -msgstr "Типове зображення перегляду" +msgstr "Типове тяжіння" msgid "Default Gravity Vector" -msgstr "Типове зображення перегляду" +msgstr "Типовий вектор тяжіння" msgid "Principal Inertia Axes" msgstr "Головні вісі інерції" @@ -5499,6 +5560,9 @@ msgstr "Вершина" msgid "Fragment" msgstr "Фрагмент" +msgid "Base Error" +msgstr "Основна помилка" + msgid "Cull" msgstr "Вибракування" @@ -5523,6 +5587,9 @@ msgstr "Примусово записати" msgid "Shadow Atlas" msgstr "Новий атлас" +msgid "Shader Cache" +msgstr "Кеш шейдерів" + msgid "Reflections" msgstr "Відбиття" diff --git a/editor/translations/properties/zh_CN.po b/editor/translations/properties/zh_CN.po index ae34ceb410..681a82eb6d 100644 --- a/editor/translations/properties/zh_CN.po +++ b/editor/translations/properties/zh_CN.po @@ -97,8 +97,8 @@ msgstr "" "Project-Id-Version: Chinese (Simplified) (Godot Engine)\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: 2018-01-20 12:15+0200\n" -"PO-Revision-Date: 2023-10-28 10:03+0000\n" -"Last-Translator: Arsvine Zhu <2162371684@qq.com>\n" +"PO-Revision-Date: 2023-11-12 10:25+0000\n" +"Last-Translator: Haoyu Qiu <timothyqiu32@gmail.com>\n" "Language-Team: Chinese (Simplified) <https://hosted.weblate.org/projects/" "godot-engine/godot-properties/zh_Hans/>\n" "Language: zh_CN\n" @@ -240,6 +240,12 @@ msgstr "3D 声像强度" msgid "iOS" msgstr "iOS" +msgid "Session Category" +msgstr "会话类别" + +msgid "Mix With Others" +msgstr "与其他混合" + msgid "Editor" msgstr "编辑器" @@ -421,7 +427,10 @@ msgid "Use Ambient" msgstr "使用环境光" msgid "Low Processor Usage Mode" -msgstr "低处理器使用模式" +msgstr "低处理器占用模式" + +msgid "Low Processor Usage Mode Sleep (µsec)" +msgstr "低处理器占用模式睡眠(微秒)" msgid "Delta Smoothing" msgstr "增量平滑" @@ -948,6 +957,12 @@ msgstr "主字体粗体" msgid "Code Font" msgstr "代码字体" +msgid "Low Processor Mode Sleep (µsec)" +msgstr "低处理器模式睡眠(微秒)" + +msgid "Unfocused Low Processor Mode Sleep (µsec)" +msgstr "未聚焦低处理器模式睡眠(微秒)" + msgid "Separate Distraction Mode" msgstr "单独的专注模式" @@ -1122,6 +1137,15 @@ msgstr "FBX" msgid "FBX2glTF Path" msgstr "FBX2glTF 路径" +msgid "Tools" +msgstr "工具" + +msgid "Oidn" +msgstr "OIDN" + +msgid "Oidn Denoise Path" +msgstr "OIDN 降噪器路径" + msgid "Docks" msgstr "停靠面板" @@ -1668,6 +1692,9 @@ msgstr "用户类型颜色" msgid "Comment Color" msgstr "注释颜色" +msgid "Doc Comment Color" +msgstr "文档注释颜色" + msgid "String Color" msgstr "字符串颜色" @@ -1947,6 +1974,9 @@ msgstr "未映射骨骼" msgid "Create From" msgstr "创建自" +msgid "Scaling Mode" +msgstr "缩放模式" + msgid "Delimiter" msgstr "分隔符" @@ -2016,6 +2046,9 @@ msgstr "偏移网格" msgid "Optimize Mesh" msgstr "优化网格" +msgid "Force Disable Mesh Compression" +msgstr "强制禁用网格压缩" + msgid "Skip Import" msgstr "跳过导入" @@ -2208,6 +2241,9 @@ msgstr "光照烘焙" msgid "Lightmap Texel Size" msgstr "光照贴图纹素大小" +msgid "Force Disable Compression" +msgstr "强制禁用压缩" + msgid "Skins" msgstr "蒙皮" @@ -2403,6 +2439,12 @@ msgstr "显示视口导航小工具" msgid "Gizmo Settings" msgstr "小工具设置" +msgid "Path 3D Tilt Disk Size" +msgstr "Path3D 倾斜盘大小" + +msgid "Path Tilt" +msgstr "路径倾斜" + msgid "Auto Reload and Parse Scripts on Save" msgstr "保存时自动重新加载并解析脚本" @@ -2577,6 +2619,18 @@ msgstr "GL 兼容性" msgid "Nvidia Disable Threaded Optimization" msgstr "Nvidia 禁用多线程优化" +msgid "Fallback to Angle" +msgstr "回退至 Angle" + +msgid "Fallback to Native" +msgstr "回退至原生" + +msgid "Fallback to Gles" +msgstr "回退至 GLES" + +msgid "Force Angle on Devices" +msgstr "在设备上强制 Angle" + msgid "Renderer" msgstr "渲染器" @@ -2682,6 +2736,15 @@ msgstr "提交深度缓冲区" msgid "Startup Alert" msgstr "启动警报" +msgid "Extensions" +msgstr "扩展" + +msgid "Hand Tracking" +msgstr "手部跟踪" + +msgid "Eye Gaze Interaction" +msgstr "眼动交互" + msgid "In Editor" msgstr "在编辑器中" @@ -2940,6 +3003,9 @@ msgstr "使用线程" msgid "glTF" msgstr "glTF" +msgid "Naming Version" +msgstr "命名版本" + msgid "Embedded Image Handling" msgstr "嵌入图像处理" @@ -3285,6 +3351,12 @@ msgstr "超高质量探针射线数" msgid "Max Rays per Probe Pass" msgstr "探针单阶段最大射线数" +msgid "Denoising" +msgstr "降噪" + +msgid "Denoiser" +msgstr "降噪器" + msgid "BPM" msgstr "BPM" @@ -3643,7 +3715,7 @@ msgid "Signed" msgstr "签名" msgid "App Category" -msgstr "App 分类" +msgstr "App 类别" msgid "Retain Data on Uninstall" msgstr "卸载时保留数据" @@ -4611,6 +4683,9 @@ msgstr "最大偏移" msgid "Offset Curve" msgstr "偏移曲线" +msgid "Amount Ratio" +msgstr "数量比" + msgid "Sub Emitter" msgstr "子发射器" @@ -4620,6 +4695,9 @@ msgstr "处理材质" msgid "Interpolate" msgstr "插值" +msgid "Interp to End" +msgstr "插值至结尾" + msgid "Base Size" msgstr "基本大小" @@ -5614,11 +5692,17 @@ msgid "Quality" msgstr "质量" msgid "Bounces" -msgstr "弹射" +msgstr "反弹" + +msgid "Bounce Indirect Energy" +msgstr "反弹间接能量" msgid "Directional" msgstr "定向" +msgid "Use Texture for Bounces" +msgstr "反弹使用纹理" + msgid "Interior" msgstr "内部" @@ -5661,6 +5745,9 @@ msgstr "路径高度偏移" msgid "Use 3D Avoidance" msgstr "使用 3D 避障" +msgid "Keep Y Velocity" +msgstr "保持 Y 速度" + msgid "Navigation Mesh" msgstr "导航网格" @@ -5962,7 +6049,7 @@ msgid "Track Physics Step" msgstr "跟踪物理迭代" msgid "AABB" -msgstr "AABB表示物体或对象的包围框" +msgstr "AABB" msgid "Sorting" msgstr "排序" @@ -6900,6 +6987,15 @@ msgstr "多个" msgid "Syntax Highlighter" msgstr "语法高亮器" +msgid "Visual Whitespace" +msgstr "可视空白" + +msgid "Control Chars" +msgstr "控制字符" + +msgid "Spaces" +msgstr "空格" + msgid "Text Edit Idle Detect (sec)" msgstr "TextEdit 空闲检测(秒)" @@ -7341,6 +7437,9 @@ msgstr "最小大小" msgid "Max Size" msgstr "大小上限" +msgid "Keep Title Visible" +msgstr "保持标题可见" + msgid "Content Scale" msgstr "内容缩放" @@ -8070,6 +8169,78 @@ msgstr "来源几何体分组名称" msgid "Bundled" msgstr "捆绑" +msgid "Damping as Friction" +msgstr "阻尼作为摩擦" + +msgid "Spawn" +msgstr "出生" + +msgid "Emission Shape Offset" +msgstr "发射形状偏移" + +msgid "Emission Shape Scale" +msgstr "发射形状缩放" + +msgid "Emission Sphere Radius" +msgstr "发射球体半径" + +msgid "Emission Box Extents" +msgstr "发射盒子范围" + +msgid "Emission Point Texture" +msgstr "发射点纹理" + +msgid "Emission Normal Texture" +msgstr "发射法线纹理" + +msgid "Emission Color Texture" +msgstr "发射颜色纹理" + +msgid "Emission Point Count" +msgstr "发射点数" + +msgid "Emission Ring Axis" +msgstr "发射环轴" + +msgid "Emission Ring Height" +msgstr "发射环高度" + +msgid "Emission Ring Radius" +msgstr "发射环半径" + +msgid "Emission Ring Inner Radius" +msgstr "发射环内径" + +msgid "Inherit Velocity Ratio" +msgstr "继承速度比" + +msgid "Velocity Pivot" +msgstr "速度轴心" + +msgid "Initial Velocity Min" +msgstr "初速度下限" + +msgid "Initial Velocity Max" +msgstr "初速度上限" + +msgid "Animated Velocity" +msgstr "动画速度" + +msgid "Velocity Limit" +msgstr "速度限制" + +msgid "Directional Velocity" +msgstr "方向速度" + +msgid "Radial Velocity" +msgstr "径向速度" + +msgid "Velocity Limit Curve" +msgstr "速度限制曲线" + +msgid "Accelerations" +msgstr "加速度" + msgid "Attractor Interaction" msgstr "吸引器交互" @@ -8082,6 +8253,27 @@ msgstr "最大缩放" msgid "Scale Curve" msgstr "缩放曲线" +msgid "Scale Over Velocity" +msgstr "随速度缩放" + +msgid "Scale over Velocity Min" +msgstr "随速度缩放下限" + +msgid "Scale over Velocity Max" +msgstr "随速度缩放上限" + +msgid "Scale over Velocity Curve" +msgstr "随速度缩放曲线" + +msgid "Color Curves" +msgstr "颜色曲线" + +msgid "Alpha Curve" +msgstr "Alpha 曲线" + +msgid "Emission Curve" +msgstr "自发光曲线" + msgid "Turbulence" msgstr "扰动" @@ -9417,6 +9609,9 @@ msgstr "电平 dB" msgid "Pan" msgstr "平移" +msgid "Attack (µs)" +msgstr "起音(微秒)" + msgid "Release (ms)" msgstr "释音(毫秒)" @@ -9762,6 +9957,12 @@ msgstr "主惯性轴" msgid "Max Collisions" msgstr "最大碰撞数" +msgid "Debug Redraw Time" +msgstr "调试重绘时间" + +msgid "Debug Redraw Color" +msgstr "调试重绘颜色" + msgid "Vertex" msgstr "顶点" diff --git a/editor/window_wrapper.cpp b/editor/window_wrapper.cpp index a5c862ffd6..2d89e4df46 100644 --- a/editor/window_wrapper.cpp +++ b/editor/window_wrapper.cpp @@ -34,6 +34,7 @@ #include "editor/editor_scale.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" +#include "editor/progress_dialog.h" #include "scene/gui/box_container.h" #include "scene/gui/label.h" #include "scene/gui/panel.h" @@ -332,6 +333,8 @@ WindowWrapper::WindowWrapper() { window_background = memnew(Panel); window_background->set_anchors_and_offsets_preset(PRESET_FULL_RECT); window->add_child(window_background); + + ProgressDialog::get_singleton()->add_host_window(window); } // ScreenSelect diff --git a/gles3_builders.py b/gles3_builders.py index 10d7e5bb4c..055451f298 100644 --- a/gles3_builders.py +++ b/gles3_builders.py @@ -199,7 +199,7 @@ def build_gles3_header( filename: str, include: str, class_suffix: str, - optional_output_filename: str = None, + optional_output_filename: Optional[str] = None, header_data: Optional[GLES3HeaderStruct] = None, ): header_data = header_data or GLES3HeaderStruct() diff --git a/glsl_builders.py b/glsl_builders.py index 706b50636e..a6ca9aa2f3 100644 --- a/glsl_builders.py +++ b/glsl_builders.py @@ -114,7 +114,7 @@ def include_file_in_rd_header(filename: str, header_data: RDHeaderStruct, depth: def build_rd_header( - filename: str, optional_output_filename: str = None, header_data: Optional[RDHeaderStruct] = None + filename: str, optional_output_filename: Optional[str] = None, header_data: Optional[RDHeaderStruct] = None ) -> None: header_data = header_data or RDHeaderStruct() include_file_in_rd_header(filename, header_data, 0) @@ -198,7 +198,7 @@ def include_file_in_raw_header(filename: str, header_data: RAWHeaderStruct, dept def build_raw_header( - filename: str, optional_output_filename: str = None, header_data: Optional[RAWHeaderStruct] = None + filename: str, optional_output_filename: Optional[str] = None, header_data: Optional[RAWHeaderStruct] = None ): header_data = header_data or RAWHeaderStruct() include_file_in_raw_header(filename, header_data, 0) diff --git a/main/main.cpp b/main/main.cpp index 271791f368..350b8606b9 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -510,6 +510,7 @@ void Main::print_help(const char *p_binary) { OS::get_singleton()->print(" The target directory must exist.\n"); OS::get_singleton()->print(" --export-debug <preset> <path> Export the project in debug mode using the given preset and output path. See --export-release description for other considerations.\n"); OS::get_singleton()->print(" --export-pack <preset> <path> Export the project data only using the given preset and output path. The <path> extension determines whether it will be in PCK or ZIP format.\n"); + OS::get_singleton()->print(" --install-android-build-template Install the android build template. Used in conjunction with --export-release or --export-debug.\n"); #ifndef DISABLE_DEPRECATED OS::get_singleton()->print(" --convert-3to4 [<max_file_kb>] [<max_line_size>]\n"); OS::get_singleton()->print(" Converts project from Godot 3.x to Godot 4.x.\n"); @@ -765,12 +766,13 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph // Benchmark tracking must be done after `OS::get_singleton()->initialize()` as on some // platforms, it's used to set up the time utilities. - OS::get_singleton()->benchmark_begin_measure("startup_begin"); + OS::get_singleton()->benchmark_begin_measure("Startup", "Total"); + OS::get_singleton()->benchmark_begin_measure("Startup", "Setup"); engine = memnew(Engine); MAIN_PRINT("Main: Initialize CORE"); - OS::get_singleton()->benchmark_begin_measure("core"); + OS::get_singleton()->benchmark_begin_measure("Startup", "Core"); register_core_types(); register_core_driver_types(); @@ -1732,15 +1734,27 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph { String driver_hints = ""; + String driver_hints_with_d3d12 = ""; + + { + Vector<String> driver_hints_arr; #ifdef VULKAN_ENABLED - driver_hints = "vulkan"; + driver_hints_arr.push_back("vulkan"); +#endif + driver_hints = String(",").join(driver_hints_arr); + +#ifdef D3D12_ENABLED + driver_hints_arr.push_back("d3d12"); #endif + driver_hints_with_d3d12 = String(",").join(driver_hints_arr); + } String default_driver = driver_hints.get_slice(",", 0); + String default_driver_with_d3d12 = driver_hints_with_d3d12.get_slice(",", 0); // For now everything defaults to vulkan when available. This can change in future updates. GLOBAL_DEF_RST_NOVAL("rendering/rendering_device/driver", default_driver); - GLOBAL_DEF_RST_NOVAL(PropertyInfo(Variant::STRING, "rendering/rendering_device/driver.windows", PROPERTY_HINT_ENUM, driver_hints), default_driver); + GLOBAL_DEF_RST_NOVAL(PropertyInfo(Variant::STRING, "rendering/rendering_device/driver.windows", PROPERTY_HINT_ENUM, driver_hints_with_d3d12), default_driver_with_d3d12); GLOBAL_DEF_RST_NOVAL(PropertyInfo(Variant::STRING, "rendering/rendering_device/driver.linuxbsd", PROPERTY_HINT_ENUM, driver_hints), default_driver); GLOBAL_DEF_RST_NOVAL(PropertyInfo(Variant::STRING, "rendering/rendering_device/driver.android", PROPERTY_HINT_ENUM, driver_hints), default_driver); GLOBAL_DEF_RST_NOVAL(PropertyInfo(Variant::STRING, "rendering/rendering_device/driver.ios", PROPERTY_HINT_ENUM, driver_hints), default_driver); @@ -1753,15 +1767,11 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph String driver_hints_egl = ""; #ifdef GLES3_ENABLED driver_hints = "opengl3"; - driver_hints_angle = "opengl3,opengl3_angle"; - driver_hints_egl = "opengl3,opengl3_es"; + driver_hints_angle = "opengl3,opengl3_angle"; // macOS, Windows. + driver_hints_egl = "opengl3,opengl3_es"; // Linux. #endif String default_driver = driver_hints.get_slice(",", 0); - String default_driver_macos = default_driver; -#if defined(GLES3_ENABLED) && defined(EGL_STATIC) && defined(MACOS_ENABLED) - default_driver_macos = "opengl3_angle"; // Default to ANGLE if it's built-in. -#endif GLOBAL_DEF_RST_NOVAL("rendering/gl_compatibility/driver", default_driver); GLOBAL_DEF_RST_NOVAL(PropertyInfo(Variant::STRING, "rendering/gl_compatibility/driver.windows", PROPERTY_HINT_ENUM, driver_hints_angle), default_driver); @@ -1769,7 +1779,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph GLOBAL_DEF_RST_NOVAL(PropertyInfo(Variant::STRING, "rendering/gl_compatibility/driver.web", PROPERTY_HINT_ENUM, driver_hints), default_driver); GLOBAL_DEF_RST_NOVAL(PropertyInfo(Variant::STRING, "rendering/gl_compatibility/driver.android", PROPERTY_HINT_ENUM, driver_hints), default_driver); GLOBAL_DEF_RST_NOVAL(PropertyInfo(Variant::STRING, "rendering/gl_compatibility/driver.ios", PROPERTY_HINT_ENUM, driver_hints), default_driver); - GLOBAL_DEF_RST_NOVAL(PropertyInfo(Variant::STRING, "rendering/gl_compatibility/driver.macos", PROPERTY_HINT_ENUM, driver_hints_angle), default_driver_macos); + GLOBAL_DEF_RST_NOVAL(PropertyInfo(Variant::STRING, "rendering/gl_compatibility/driver.macos", PROPERTY_HINT_ENUM, driver_hints_angle), default_driver); GLOBAL_DEF_RST("rendering/gl_compatibility/nvidia_disable_threaded_optimization", true); GLOBAL_DEF_RST("rendering/gl_compatibility/fallback_to_angle", true); @@ -1787,13 +1797,47 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph } // AMD GPUs. - BLOCK_DEVICE("ATI", "AMD Radeon(TM) R2 Graphics"); - BLOCK_DEVICE("ATI", "AMD Radeon(TM) R3 Graphics"); - BLOCK_DEVICE("ATI", "AMD Radeon HD 8400 / R3 Series"); - BLOCK_DEVICE("ATI", "AMD Radeon R5 M200 Series"); - BLOCK_DEVICE("ATI", "AMD Radeon R5 M230 Series"); - BLOCK_DEVICE("ATI", "AMD Radeon R5 M255"); - BLOCK_DEVICE("AMD", "AMD Radeon (TM) R5 M330"); + BLOCK_DEVICE("ATI", "Radeon 9"); // ATI Radeon 9000 Series + BLOCK_DEVICE("ATI", "Radeon X"); // ATI Radeon X500-X2000 Series + BLOCK_DEVICE("ATI", "Radeon HD 2"); // AMD/ATI (Mobility) Radeon HD 2xxx Series + BLOCK_DEVICE("ATI", "Radeon HD 3"); // AMD/ATI (Mobility) Radeon HD 3xxx Series + BLOCK_DEVICE("ATI", "Radeon HD 4"); // AMD/ATI (Mobility) Radeon HD 4xxx Series + BLOCK_DEVICE("ATI", "Radeon HD 5"); // AMD/ATI (Mobility) Radeon HD 5xxx Series + BLOCK_DEVICE("ATI", "Radeon HD 6"); // AMD/ATI (Mobility) Radeon HD 6xxx Series + BLOCK_DEVICE("ATI", "Radeon HD 7"); // AMD/ATI (Mobility) Radeon HD 7xxx Series + BLOCK_DEVICE("ATI", "Radeon HD 8"); // AMD/ATI (Mobility) Radeon HD 8xxx Series + BLOCK_DEVICE("ATI", "Radeon(TM) R2 Graphics"); // APUs + BLOCK_DEVICE("ATI", "Radeon(TM) R3 Graphics"); + BLOCK_DEVICE("ATI", "Radeon(TM) R4 Graphics"); + BLOCK_DEVICE("ATI", "Radeon(TM) R5 Graphics"); + BLOCK_DEVICE("ATI", "Radeon(TM) R6 Graphics"); + BLOCK_DEVICE("ATI", "Radeon(TM) R7 Graphics"); + BLOCK_DEVICE("AMD", "Radeon(TM) R7 Graphics"); + BLOCK_DEVICE("AMD", "Radeon(TM) R8 Graphics"); + BLOCK_DEVICE("ATI", "Radeon R5 Graphics"); + BLOCK_DEVICE("ATI", "Radeon R6 Graphics"); + BLOCK_DEVICE("ATI", "Radeon R7 Graphics"); + BLOCK_DEVICE("AMD", "Radeon R7 Graphics"); + BLOCK_DEVICE("AMD", "Radeon R8 Graphics"); + BLOCK_DEVICE("ATI", "Radeon R5 2"); // Rx 2xx Series + BLOCK_DEVICE("ATI", "Radeon R7 2"); + BLOCK_DEVICE("ATI", "Radeon R9 2"); + BLOCK_DEVICE("ATI", "Radeon R5 M2"); // Rx M2xx Series + BLOCK_DEVICE("ATI", "Radeon R7 M2"); + BLOCK_DEVICE("ATI", "Radeon R9 M2"); + BLOCK_DEVICE("ATI", "Radeon (TM) R9 Fury"); + BLOCK_DEVICE("ATI", "Radeon (TM) R5 3"); // Rx 3xx Series + BLOCK_DEVICE("AMD", "Radeon (TM) R5 3"); + BLOCK_DEVICE("ATI", "Radeon (TM) R7 3"); + BLOCK_DEVICE("AMD", "Radeon (TM) R7 3"); + BLOCK_DEVICE("ATI", "Radeon (TM) R9 3"); + BLOCK_DEVICE("AMD", "Radeon (TM) R9 3"); + BLOCK_DEVICE("ATI", "Radeon (TM) R5 M3"); // Rx M3xx Series + BLOCK_DEVICE("AMD", "Radeon (TM) R5 M3"); + BLOCK_DEVICE("ATI", "Radeon (TM) R7 M3"); + BLOCK_DEVICE("AMD", "Radeon (TM) R7 M3"); + BLOCK_DEVICE("ATI", "Radeon (TM) R9 M3"); + BLOCK_DEVICE("AMD", "Radeon (TM) R9 M3"); #undef BLOCK_DEVICE @@ -1801,7 +1845,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph } // Start with RenderingDevice-based backends. Should be included if any RD driver present. -#ifdef VULKAN_ENABLED +#if defined(VULKAN_ENABLED) || defined(D3D12_ENABLED) renderer_hints = "forward_plus,mobile"; default_renderer_mobile = "mobile"; #endif @@ -1881,11 +1925,14 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph // Now validate whether the selected driver matches with the renderer. bool valid_combination = false; Vector<String> available_drivers; -#ifdef VULKAN_ENABLED if (rendering_method == "forward_plus" || rendering_method == "mobile") { +#ifdef VULKAN_ENABLED available_drivers.push_back("vulkan"); - } #endif +#ifdef D3D12_ENABLED + available_drivers.push_back("d3d12"); +#endif + } #ifdef GLES3_ENABLED if (rendering_method == "gl_compatibility") { available_drivers.push_back("opengl3"); @@ -2183,11 +2230,13 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph Thread::release_main_thread(); // If setup2() is called from another thread, that one will become main thread, so preventively release this one. set_current_thread_safe_for_nodes(false); + OS::get_singleton()->benchmark_end_measure("Startup", "Core"); + if (p_second_phase) { return setup2(); } - OS::get_singleton()->benchmark_end_measure("core"); + OS::get_singleton()->benchmark_end_measure("Startup", "Setup"); return OK; error: @@ -2241,7 +2290,8 @@ error: memdelete(message_queue); } - OS::get_singleton()->benchmark_end_measure("core"); + OS::get_singleton()->benchmark_end_measure("Startup", "Core"); + OS::get_singleton()->benchmark_end_measure("Startup", "Setup"); OS::get_singleton()->finalize_core(); locale = String(); @@ -2275,25 +2325,10 @@ Error Main::setup2() { // Print engine name and version print_line(String(VERSION_NAME) + " v" + get_full_version_string() + " - " + String(VERSION_WEBSITE)); - OS::get_singleton()->benchmark_begin_measure("servers"); - - tsman = memnew(TextServerManager); - - if (tsman) { - Ref<TextServerDummy> ts; - ts.instantiate(); - tsman->add_interface(ts); - } - - physics_server_3d_manager = memnew(PhysicsServer3DManager); - physics_server_2d_manager = memnew(PhysicsServer2DManager); - - register_server_types(); - initialize_modules(MODULE_INITIALIZATION_LEVEL_SERVERS); - GDExtensionManager::get_singleton()->initialize_extensions(GDExtension::INITIALIZATION_LEVEL_SERVERS); - #ifdef TOOLS_ENABLED if (editor || project_manager || cmdline_tool) { + OS::get_singleton()->benchmark_begin_measure("Startup", "Initialize Early Settings"); + EditorPaths::create(); // Editor setting class is not available, load config directly. @@ -2355,16 +2390,49 @@ Error Main::setup2() { return FAILED; } } + + OS::get_singleton()->benchmark_end_measure("Startup", "Initialize Early Settings"); } #endif + OS::get_singleton()->benchmark_begin_measure("Startup", "Servers"); + + tsman = memnew(TextServerManager); + if (tsman) { + Ref<TextServerDummy> ts; + ts.instantiate(); + tsman->add_interface(ts); + } + + physics_server_3d_manager = memnew(PhysicsServer3DManager); + physics_server_2d_manager = memnew(PhysicsServer2DManager); + + register_server_types(); + { + OS::get_singleton()->benchmark_begin_measure("Servers", "Modules and Extensions"); + + initialize_modules(MODULE_INITIALIZATION_LEVEL_SERVERS); + GDExtensionManager::get_singleton()->initialize_extensions(GDExtension::INITIALIZATION_LEVEL_SERVERS); + + OS::get_singleton()->benchmark_end_measure("Servers", "Modules and Extensions"); + } + /* Initialize Input */ - input = memnew(Input); + { + OS::get_singleton()->benchmark_begin_measure("Servers", "Input"); + + input = memnew(Input); + OS::get_singleton()->initialize_joypads(); + + OS::get_singleton()->benchmark_end_measure("Servers", "Input"); + } /* Initialize Display Server */ { + OS::get_singleton()->benchmark_begin_measure("Servers", "Display"); + String display_driver = DisplayServer::get_create_function_name(display_driver_idx); Vector2i *window_position = nullptr; @@ -2398,10 +2466,12 @@ Error Main::setup2() { ERR_PRINT("Unable to create DisplayServer, all display drivers failed."); return err; } - } - if (display_server->has_feature(DisplayServer::FEATURE_ORIENTATION)) { - display_server->screen_set_orientation(window_orientation); + if (display_server->has_feature(DisplayServer::FEATURE_ORIENTATION)) { + display_server->screen_set_orientation(window_orientation); + } + + OS::get_singleton()->benchmark_end_measure("Servers", "Display"); } if (GLOBAL_GET("debug/settings/stdout/print_fps") || print_fps) { @@ -2429,48 +2499,58 @@ Error Main::setup2() { /* Initialize Pen Tablet Driver */ { + OS::get_singleton()->benchmark_begin_measure("Servers", "Tablet Driver"); + GLOBAL_DEF_RST_NOVAL("input_devices/pen_tablet/driver", ""); GLOBAL_DEF_RST_NOVAL(PropertyInfo(Variant::STRING, "input_devices/pen_tablet/driver.windows", PROPERTY_HINT_ENUM, "wintab,winink"), ""); - } - if (tablet_driver.is_empty()) { // specified in project.godot - tablet_driver = GLOBAL_GET("input_devices/pen_tablet/driver"); - if (tablet_driver.is_empty()) { - tablet_driver = DisplayServer::get_singleton()->tablet_get_driver_name(0); + if (tablet_driver.is_empty()) { // specified in project.godot + tablet_driver = GLOBAL_GET("input_devices/pen_tablet/driver"); + if (tablet_driver.is_empty()) { + tablet_driver = DisplayServer::get_singleton()->tablet_get_driver_name(0); + } } - } - for (int i = 0; i < DisplayServer::get_singleton()->tablet_get_driver_count(); i++) { - if (tablet_driver == DisplayServer::get_singleton()->tablet_get_driver_name(i)) { - DisplayServer::get_singleton()->tablet_set_current_driver(DisplayServer::get_singleton()->tablet_get_driver_name(i)); - break; + for (int i = 0; i < DisplayServer::get_singleton()->tablet_get_driver_count(); i++) { + if (tablet_driver == DisplayServer::get_singleton()->tablet_get_driver_name(i)) { + DisplayServer::get_singleton()->tablet_set_current_driver(DisplayServer::get_singleton()->tablet_get_driver_name(i)); + break; + } } - } - if (DisplayServer::get_singleton()->tablet_get_current_driver().is_empty()) { - DisplayServer::get_singleton()->tablet_set_current_driver(DisplayServer::get_singleton()->tablet_get_driver_name(0)); - } + if (DisplayServer::get_singleton()->tablet_get_current_driver().is_empty()) { + DisplayServer::get_singleton()->tablet_set_current_driver(DisplayServer::get_singleton()->tablet_get_driver_name(0)); + } - print_verbose("Using \"" + tablet_driver + "\" pen tablet driver..."); + print_verbose("Using \"" + tablet_driver + "\" pen tablet driver..."); + + OS::get_singleton()->benchmark_end_measure("Servers", "Tablet Driver"); + } /* Initialize Rendering Server */ - rendering_server = memnew(RenderingServerDefault(OS::get_singleton()->get_render_thread_mode() == OS::RENDER_SEPARATE_THREAD)); + { + OS::get_singleton()->benchmark_begin_measure("Servers", "Rendering"); - rendering_server->init(); - //rendering_server->call_set_use_vsync(OS::get_singleton()->_use_vsync); - rendering_server->set_render_loop_enabled(!disable_render_loop); + rendering_server = memnew(RenderingServerDefault(OS::get_singleton()->get_render_thread_mode() == OS::RENDER_SEPARATE_THREAD)); - if (profile_gpu || (!editor && bool(GLOBAL_GET("debug/settings/stdout/print_gpu_profile")))) { - rendering_server->set_print_gpu_profile(true); - } + rendering_server->init(); + //rendering_server->call_set_use_vsync(OS::get_singleton()->_use_vsync); + rendering_server->set_render_loop_enabled(!disable_render_loop); - if (Engine::get_singleton()->get_write_movie_path() != String()) { - movie_writer = MovieWriter::find_writer_for_file(Engine::get_singleton()->get_write_movie_path()); - if (movie_writer == nullptr) { - ERR_PRINT("Can't find movie writer for file type, aborting: " + Engine::get_singleton()->get_write_movie_path()); - Engine::get_singleton()->set_write_movie_path(String()); + if (profile_gpu || (!editor && bool(GLOBAL_GET("debug/settings/stdout/print_gpu_profile")))) { + rendering_server->set_print_gpu_profile(true); + } + + if (Engine::get_singleton()->get_write_movie_path() != String()) { + movie_writer = MovieWriter::find_writer_for_file(Engine::get_singleton()->get_write_movie_path()); + if (movie_writer == nullptr) { + ERR_PRINT("Can't find movie writer for file type, aborting: " + Engine::get_singleton()->get_write_movie_path()); + Engine::get_singleton()->set_write_movie_path(String()); + } } + + OS::get_singleton()->benchmark_end_measure("Servers", "Rendering"); } #ifdef UNIX_ENABLED @@ -2480,210 +2560,246 @@ Error Main::setup2() { } #endif - OS::get_singleton()->initialize_joypads(); - /* Initialize Audio Driver */ - AudioDriverManager::initialize(audio_driver_idx); + { + OS::get_singleton()->benchmark_begin_measure("Servers", "Audio"); + + AudioDriverManager::initialize(audio_driver_idx); - print_line(" "); //add a blank line for readability + print_line(" "); // Add a blank line for readability. + + // Right moment to create and initialize the audio server. + audio_server = memnew(AudioServer); + audio_server->init(); + + OS::get_singleton()->benchmark_end_measure("Servers", "Audio"); + } + + /* Initialize XR Server */ + + { + OS::get_singleton()->benchmark_begin_measure("Servers", "XR"); - // right moment to create and initialize the audio server + xr_server = memnew(XRServer); - audio_server = memnew(AudioServer); - audio_server->init(); + OS::get_singleton()->benchmark_end_measure("Servers", "XR"); + } - // also init our xr_server from here - xr_server = memnew(XRServer); + OS::get_singleton()->benchmark_end_measure("Startup", "Servers"); register_core_singletons(); - MAIN_PRINT("Main: Setup Logo"); + /* Initialize the main window and boot screen */ + + { + OS::get_singleton()->benchmark_begin_measure("Startup", "Setup Window and Boot"); + + MAIN_PRINT("Main: Setup Logo"); #if !defined(TOOLS_ENABLED) && (defined(WEB_ENABLED) || defined(ANDROID_ENABLED)) - bool show_logo = false; + bool show_logo = false; #else - bool show_logo = true; + bool show_logo = true; #endif - if (init_windowed) { - //do none.. - } else if (init_maximized) { - DisplayServer::get_singleton()->window_set_mode(DisplayServer::WINDOW_MODE_MAXIMIZED); - } else if (init_fullscreen) { - DisplayServer::get_singleton()->window_set_mode(DisplayServer::WINDOW_MODE_FULLSCREEN); - } - if (init_always_on_top) { - DisplayServer::get_singleton()->window_set_flag(DisplayServer::WINDOW_FLAG_ALWAYS_ON_TOP, true); - } + if (init_windowed) { + //do none.. + } else if (init_maximized) { + DisplayServer::get_singleton()->window_set_mode(DisplayServer::WINDOW_MODE_MAXIMIZED); + } else if (init_fullscreen) { + DisplayServer::get_singleton()->window_set_mode(DisplayServer::WINDOW_MODE_FULLSCREEN); + } + if (init_always_on_top) { + DisplayServer::get_singleton()->window_set_flag(DisplayServer::WINDOW_FLAG_ALWAYS_ON_TOP, true); + } - MAIN_PRINT("Main: Load Boot Image"); + MAIN_PRINT("Main: Load Boot Image"); - Color clear = GLOBAL_DEF_BASIC("rendering/environment/defaults/default_clear_color", Color(0.3, 0.3, 0.3)); - RenderingServer::get_singleton()->set_default_clear_color(clear); + Color clear = GLOBAL_DEF_BASIC("rendering/environment/defaults/default_clear_color", Color(0.3, 0.3, 0.3)); + RenderingServer::get_singleton()->set_default_clear_color(clear); - if (show_logo) { //boot logo! - const bool boot_logo_image = GLOBAL_DEF_BASIC("application/boot_splash/show_image", true); - const String boot_logo_path = String(GLOBAL_DEF_BASIC(PropertyInfo(Variant::STRING, "application/boot_splash/image", PROPERTY_HINT_FILE, "*.png"), String())).strip_edges(); - const bool boot_logo_scale = GLOBAL_DEF_BASIC("application/boot_splash/fullsize", true); - const bool boot_logo_filter = GLOBAL_DEF_BASIC("application/boot_splash/use_filter", true); + if (show_logo) { //boot logo! + const bool boot_logo_image = GLOBAL_DEF_BASIC("application/boot_splash/show_image", true); + const String boot_logo_path = String(GLOBAL_DEF_BASIC(PropertyInfo(Variant::STRING, "application/boot_splash/image", PROPERTY_HINT_FILE, "*.png"), String())).strip_edges(); + const bool boot_logo_scale = GLOBAL_DEF_BASIC("application/boot_splash/fullsize", true); + const bool boot_logo_filter = GLOBAL_DEF_BASIC("application/boot_splash/use_filter", true); - Ref<Image> boot_logo; + Ref<Image> boot_logo; - if (boot_logo_image) { - if (!boot_logo_path.is_empty()) { - boot_logo.instantiate(); - Error load_err = ImageLoader::load_image(boot_logo_path, boot_logo); - if (load_err) { - ERR_PRINT("Non-existing or invalid boot splash at '" + boot_logo_path + "'. Loading default splash."); + if (boot_logo_image) { + if (!boot_logo_path.is_empty()) { + boot_logo.instantiate(); + Error load_err = ImageLoader::load_image(boot_logo_path, boot_logo); + if (load_err) { + ERR_PRINT("Non-existing or invalid boot splash at '" + boot_logo_path + "'. Loading default splash."); + } } + } else { + // Create a 1×1 transparent image. This will effectively hide the splash image. + boot_logo.instantiate(); + boot_logo->initialize_data(1, 1, false, Image::FORMAT_RGBA8); + boot_logo->set_pixel(0, 0, Color(0, 0, 0, 0)); } - } else { - // Create a 1×1 transparent image. This will effectively hide the splash image. - boot_logo.instantiate(); - boot_logo->initialize_data(1, 1, false, Image::FORMAT_RGBA8); - boot_logo->set_pixel(0, 0, Color(0, 0, 0, 0)); - } - Color boot_bg_color = GLOBAL_GET("application/boot_splash/bg_color"); + Color boot_bg_color = GLOBAL_GET("application/boot_splash/bg_color"); #if defined(TOOLS_ENABLED) && !defined(NO_EDITOR_SPLASH) - boot_bg_color = - GLOBAL_DEF_BASIC("application/boot_splash/bg_color", - (editor || project_manager) ? boot_splash_editor_bg_color : boot_splash_bg_color); + boot_bg_color = + GLOBAL_DEF_BASIC("application/boot_splash/bg_color", + (editor || project_manager) ? boot_splash_editor_bg_color : boot_splash_bg_color); #endif - if (boot_logo.is_valid()) { - RenderingServer::get_singleton()->set_boot_image(boot_logo, boot_bg_color, boot_logo_scale, - boot_logo_filter); + if (boot_logo.is_valid()) { + RenderingServer::get_singleton()->set_boot_image(boot_logo, boot_bg_color, boot_logo_scale, + boot_logo_filter); - } else { + } else { #ifndef NO_DEFAULT_BOOT_LOGO - MAIN_PRINT("Main: Create bootsplash"); + MAIN_PRINT("Main: Create bootsplash"); #if defined(TOOLS_ENABLED) && !defined(NO_EDITOR_SPLASH) - Ref<Image> splash = (editor || project_manager) ? memnew(Image(boot_splash_editor_png)) : memnew(Image(boot_splash_png)); + Ref<Image> splash = (editor || project_manager) ? memnew(Image(boot_splash_editor_png)) : memnew(Image(boot_splash_png)); #else - Ref<Image> splash = memnew(Image(boot_splash_png)); + Ref<Image> splash = memnew(Image(boot_splash_png)); #endif - MAIN_PRINT("Main: ClearColor"); - RenderingServer::get_singleton()->set_default_clear_color(boot_bg_color); - MAIN_PRINT("Main: Image"); - RenderingServer::get_singleton()->set_boot_image(splash, boot_bg_color, false); + MAIN_PRINT("Main: ClearColor"); + RenderingServer::get_singleton()->set_default_clear_color(boot_bg_color); + MAIN_PRINT("Main: Image"); + RenderingServer::get_singleton()->set_boot_image(splash, boot_bg_color, false); #endif - } + } #if defined(TOOLS_ENABLED) && defined(MACOS_ENABLED) - if (OS::get_singleton()->get_bundle_icon_path().is_empty()) { - Ref<Image> icon = memnew(Image(app_icon_png)); - DisplayServer::get_singleton()->set_icon(icon); - } + if (OS::get_singleton()->get_bundle_icon_path().is_empty()) { + Ref<Image> icon = memnew(Image(app_icon_png)); + DisplayServer::get_singleton()->set_icon(icon); + } #endif - } + } + + MAIN_PRINT("Main: Clear Color"); - DisplayServer::set_early_window_clear_color_override(false); + DisplayServer::set_early_window_clear_color_override(false); + RenderingServer::get_singleton()->set_default_clear_color( + GLOBAL_GET("rendering/environment/defaults/default_clear_color")); - MAIN_PRINT("Main: DCC"); - RenderingServer::get_singleton()->set_default_clear_color( - GLOBAL_GET("rendering/environment/defaults/default_clear_color")); + GLOBAL_DEF_BASIC(PropertyInfo(Variant::STRING, "application/config/icon", PROPERTY_HINT_FILE, "*.png,*.webp,*.svg"), String()); + GLOBAL_DEF(PropertyInfo(Variant::STRING, "application/config/macos_native_icon", PROPERTY_HINT_FILE, "*.icns"), String()); + GLOBAL_DEF(PropertyInfo(Variant::STRING, "application/config/windows_native_icon", PROPERTY_HINT_FILE, "*.ico"), String()); - GLOBAL_DEF_BASIC(PropertyInfo(Variant::STRING, "application/config/icon", PROPERTY_HINT_FILE, "*.png,*.webp,*.svg"), String()); - GLOBAL_DEF(PropertyInfo(Variant::STRING, "application/config/macos_native_icon", PROPERTY_HINT_FILE, "*.icns"), String()); - GLOBAL_DEF(PropertyInfo(Variant::STRING, "application/config/windows_native_icon", PROPERTY_HINT_FILE, "*.ico"), String()); + MAIN_PRINT("Main: Touch Input"); - Input *id = Input::get_singleton(); - if (id) { - agile_input_event_flushing = GLOBAL_DEF("input_devices/buffering/agile_event_flushing", false); + Input *id = Input::get_singleton(); + if (id) { + agile_input_event_flushing = GLOBAL_DEF("input_devices/buffering/agile_event_flushing", false); - if (bool(GLOBAL_DEF_BASIC("input_devices/pointing/emulate_touch_from_mouse", false)) && - !(editor || project_manager)) { - if (!DisplayServer::get_singleton()->is_touchscreen_available()) { - //only if no touchscreen ui hint, set emulation - id->set_emulate_touch_from_mouse(true); + if (bool(GLOBAL_DEF_BASIC("input_devices/pointing/emulate_touch_from_mouse", false)) && + !(editor || project_manager)) { + if (!DisplayServer::get_singleton()->is_touchscreen_available()) { + //only if no touchscreen ui hint, set emulation + id->set_emulate_touch_from_mouse(true); + } } + + id->set_emulate_mouse_from_touch(bool(GLOBAL_DEF_BASIC("input_devices/pointing/emulate_mouse_from_touch", true))); } - id->set_emulate_mouse_from_touch(bool(GLOBAL_DEF_BASIC("input_devices/pointing/emulate_mouse_from_touch", true))); - } + GLOBAL_DEF_BASIC("input_devices/pointing/android/enable_long_press_as_right_click", false); + GLOBAL_DEF_BASIC("input_devices/pointing/android/enable_pan_and_scale_gestures", false); - GLOBAL_DEF_BASIC("input_devices/pointing/android/enable_long_press_as_right_click", false); - GLOBAL_DEF_BASIC("input_devices/pointing/android/enable_pan_and_scale_gestures", false); + OS::get_singleton()->benchmark_end_measure("Startup", "Setup Window and Boot"); + } MAIN_PRINT("Main: Load Translations and Remaps"); - translation_server->setup(); //register translations, load them, etc. - if (!locale.is_empty()) { - translation_server->set_locale(locale); - } - translation_server->load_translations(); - ResourceLoader::load_translation_remaps(); //load remaps for resources - - ResourceLoader::load_path_remaps(); + /* Setup translations and remaps */ - MAIN_PRINT("Main: Load TextServer"); + { + OS::get_singleton()->benchmark_begin_measure("Startup", "Translations and Remaps"); - /* Enum text drivers */ - GLOBAL_DEF_RST("internationalization/rendering/text_driver", ""); - String text_driver_options; - for (int i = 0; i < TextServerManager::get_singleton()->get_interface_count(); i++) { - const String driver_name = TextServerManager::get_singleton()->get_interface(i)->get_name(); - if (driver_name == "Dummy") { - // Dummy text driver cannot draw any text, making the editor unusable if selected. - continue; + translation_server->setup(); //register translations, load them, etc. + if (!locale.is_empty()) { + translation_server->set_locale(locale); } - if (!text_driver_options.is_empty() && text_driver_options.find(",") == -1) { - // Not the first option; add a comma before it as a separator for the property hint. - text_driver_options += ","; - } - text_driver_options += driver_name; - } - ProjectSettings::get_singleton()->set_custom_property_info(PropertyInfo(Variant::STRING, "internationalization/rendering/text_driver", PROPERTY_HINT_ENUM, text_driver_options)); + translation_server->load_translations(); + ResourceLoader::load_translation_remaps(); //load remaps for resources + + ResourceLoader::load_path_remaps(); - /* Determine text driver */ - if (text_driver.is_empty()) { - text_driver = GLOBAL_GET("internationalization/rendering/text_driver"); + OS::get_singleton()->benchmark_end_measure("Startup", "Translations and Remaps"); } - if (!text_driver.is_empty()) { - /* Load user selected text server. */ + MAIN_PRINT("Main: Load TextServer"); + + /* Setup Text Server */ + + { + OS::get_singleton()->benchmark_begin_measure("Startup", "Text Server"); + + /* Enum text drivers */ + GLOBAL_DEF_RST("internationalization/rendering/text_driver", ""); + String text_driver_options; for (int i = 0; i < TextServerManager::get_singleton()->get_interface_count(); i++) { - if (TextServerManager::get_singleton()->get_interface(i)->get_name() == text_driver) { - text_driver_idx = i; - break; + const String driver_name = TextServerManager::get_singleton()->get_interface(i)->get_name(); + if (driver_name == "Dummy") { + // Dummy text driver cannot draw any text, making the editor unusable if selected. + continue; } + if (!text_driver_options.is_empty() && text_driver_options.find(",") == -1) { + // Not the first option; add a comma before it as a separator for the property hint. + text_driver_options += ","; + } + text_driver_options += driver_name; } - } + ProjectSettings::get_singleton()->set_custom_property_info(PropertyInfo(Variant::STRING, "internationalization/rendering/text_driver", PROPERTY_HINT_ENUM, text_driver_options)); - if (text_driver_idx < 0) { - /* If not selected, use one with the most features available. */ - int max_features = 0; - for (int i = 0; i < TextServerManager::get_singleton()->get_interface_count(); i++) { - uint32_t features = TextServerManager::get_singleton()->get_interface(i)->get_features(); - int feature_number = 0; - while (features) { - feature_number += features & 1; - features >>= 1; + /* Determine text driver */ + if (text_driver.is_empty()) { + text_driver = GLOBAL_GET("internationalization/rendering/text_driver"); + } + + if (!text_driver.is_empty()) { + /* Load user selected text server. */ + for (int i = 0; i < TextServerManager::get_singleton()->get_interface_count(); i++) { + if (TextServerManager::get_singleton()->get_interface(i)->get_name() == text_driver) { + text_driver_idx = i; + break; + } } - if (feature_number >= max_features) { - max_features = feature_number; - text_driver_idx = i; + } + + if (text_driver_idx < 0) { + /* If not selected, use one with the most features available. */ + int max_features = 0; + for (int i = 0; i < TextServerManager::get_singleton()->get_interface_count(); i++) { + uint32_t features = TextServerManager::get_singleton()->get_interface(i)->get_features(); + int feature_number = 0; + while (features) { + feature_number += features & 1; + features >>= 1; + } + if (feature_number >= max_features) { + max_features = feature_number; + text_driver_idx = i; + } } } - } - if (text_driver_idx >= 0) { - Ref<TextServer> ts = TextServerManager::get_singleton()->get_interface(text_driver_idx); - TextServerManager::get_singleton()->set_primary_interface(ts); - if (ts->has_feature(TextServer::FEATURE_USE_SUPPORT_DATA)) { - ts->load_support_data("res://" + ts->get_support_data_filename()); + if (text_driver_idx >= 0) { + Ref<TextServer> ts = TextServerManager::get_singleton()->get_interface(text_driver_idx); + TextServerManager::get_singleton()->set_primary_interface(ts); + if (ts->has_feature(TextServer::FEATURE_USE_SUPPORT_DATA)) { + ts->load_support_data("res://" + ts->get_support_data_filename()); + } + } else { + ERR_FAIL_V_MSG(ERR_CANT_CREATE, "TextServer: Unable to create TextServer interface."); } - } else { - ERR_FAIL_V_MSG(ERR_CANT_CREATE, "TextServer: Unable to create TextServer interface."); - } - OS::get_singleton()->benchmark_end_measure("servers"); + OS::get_singleton()->benchmark_end_measure("Startup", "Text Server"); + } MAIN_PRINT("Main: Load Scene Types"); - OS::get_singleton()->benchmark_begin_measure("scene"); + OS::get_singleton()->benchmark_begin_measure("Startup", "Scene"); // Initialize ThemeDB early so that scene types can register their theme items. // Default theme will be initialized later, after modules and ScriptServer are ready. @@ -2694,23 +2810,42 @@ Error Main::setup2() { register_scene_singletons(); - initialize_modules(MODULE_INITIALIZATION_LEVEL_SCENE); - GDExtensionManager::get_singleton()->initialize_extensions(GDExtension::INITIALIZATION_LEVEL_SCENE); + { + OS::get_singleton()->benchmark_begin_measure("Scene", "Modules and Extensions"); + + initialize_modules(MODULE_INITIALIZATION_LEVEL_SCENE); + GDExtensionManager::get_singleton()->initialize_extensions(GDExtension::INITIALIZATION_LEVEL_SCENE); + + OS::get_singleton()->benchmark_end_measure("Scene", "Modules and Extensions"); + } + + OS::get_singleton()->benchmark_end_measure("Startup", "Scene"); #ifdef TOOLS_ENABLED ClassDB::set_current_api(ClassDB::API_EDITOR); register_editor_types(); - initialize_modules(MODULE_INITIALIZATION_LEVEL_EDITOR); - GDExtensionManager::get_singleton()->initialize_extensions(GDExtension::INITIALIZATION_LEVEL_EDITOR); + + { + OS::get_singleton()->benchmark_begin_measure("Editor", "Modules and Extensions"); + + initialize_modules(MODULE_INITIALIZATION_LEVEL_EDITOR); + GDExtensionManager::get_singleton()->initialize_extensions(GDExtension::INITIALIZATION_LEVEL_EDITOR); + + OS::get_singleton()->benchmark_end_measure("Editor", "Modules and Extensions"); + } ClassDB::set_current_api(ClassDB::API_CORE); #endif - MAIN_PRINT("Main: Load Modules"); + MAIN_PRINT("Main: Load Platforms"); + + OS::get_singleton()->benchmark_begin_measure("Startup", "Platforms"); register_platform_apis(); + OS::get_singleton()->benchmark_end_measure("Startup", "Platforms"); + GLOBAL_DEF_BASIC(PropertyInfo(Variant::STRING, "display/mouse_cursor/custom_image", PROPERTY_HINT_FILE, "*.png,*.webp"), String()); GLOBAL_DEF_BASIC("display/mouse_cursor/custom_image_hotspot", Vector2()); GLOBAL_DEF_BASIC("display/mouse_cursor/tooltip_position_offset", Point2(10, 10)); @@ -2724,12 +2859,18 @@ Error Main::setup2() { } } + OS::get_singleton()->benchmark_begin_measure("Startup", "Finalize Setup"); + camera_server = CameraServer::create(); MAIN_PRINT("Main: Load Physics"); initialize_physics(); + + MAIN_PRINT("Main: Load Navigation"); + initialize_navigation_server(); + register_server_singletons(); // This loads global classes, so it must happen before custom loaders and savers are registered @@ -2761,6 +2902,8 @@ Error Main::setup2() { rendering_server->global_shader_parameters_load_settings(!editor); } + OS::get_singleton()->benchmark_end_measure("Startup", "Finalize Setup"); + _start_success = true; ClassDB::set_current_api(ClassDB::API_NONE); //no more APIs are registered at this point @@ -2769,7 +2912,7 @@ Error Main::setup2() { print_verbose("EDITOR API HASH: " + uitos(ClassDB::get_api_hash(ClassDB::API_EDITOR))); MAIN_PRINT("Main: Done"); - OS::get_singleton()->benchmark_end_measure("scene"); + OS::get_singleton()->benchmark_end_measure("Startup", "Setup"); return OK; } @@ -2797,6 +2940,7 @@ bool Main::start() { String _export_preset; bool export_debug = false; bool export_pack_only = false; + bool install_android_build_template = false; #ifdef MODULE_GDSCRIPT_ENABLED String gdscript_docs_path; #endif @@ -2829,6 +2973,8 @@ bool Main::start() { editor = true; } else if (args[i] == "-p" || args[i] == "--project-manager") { project_manager = true; + } else if (args[i] == "--install-android-build-template") { + install_android_build_template = true; #endif // TOOLS_ENABLED } else if (args[i].length() && args[i][0] != '-' && positional_arg.is_empty()) { positional_arg = args[i]; @@ -2991,24 +3137,28 @@ bool Main::start() { return false; } - if (dump_gdextension_interface) { - GDExtensionInterfaceDump::generate_gdextension_interface_file("gdextension_interface.h"); - } + // GDExtension API and interface. + { + if (dump_gdextension_interface) { + GDExtensionInterfaceDump::generate_gdextension_interface_file("gdextension_interface.h"); + } - if (dump_extension_api) { - Engine::get_singleton()->set_editor_hint(true); // "extension_api.json" should always contains editor singletons. - GDExtensionAPIDump::generate_extension_json_file("extension_api.json", include_docs_in_extension_api_dump); - } + if (dump_extension_api) { + Engine::get_singleton()->set_editor_hint(true); // "extension_api.json" should always contains editor singletons. + GDExtensionAPIDump::generate_extension_json_file("extension_api.json", include_docs_in_extension_api_dump); + } - if (dump_gdextension_interface || dump_extension_api) { - OS::get_singleton()->set_exit_code(EXIT_SUCCESS); - return false; - } + if (dump_gdextension_interface || dump_extension_api) { + OS::get_singleton()->set_exit_code(EXIT_SUCCESS); + return false; + } - if (validate_extension_api) { - bool valid = GDExtensionAPIDump::validate_extension_json_file(validate_extension_api_file) == OK; - OS::get_singleton()->set_exit_code(valid ? EXIT_SUCCESS : EXIT_FAILURE); - return false; + if (validate_extension_api) { + Engine::get_singleton()->set_editor_hint(true); // "extension_api.json" should always contains editor singletons. + bool valid = GDExtensionAPIDump::validate_extension_json_file(validate_extension_api_file) == OK; + OS::get_singleton()->set_exit_code(valid ? EXIT_SUCCESS : EXIT_FAILURE); + return false; + } } #ifndef DISABLE_DEPRECATED @@ -3169,7 +3319,7 @@ bool Main::start() { if (!project_manager && !editor) { // game if (!game_path.is_empty() || !script.is_empty()) { //autoload - OS::get_singleton()->benchmark_begin_measure("load_autoloads"); + OS::get_singleton()->benchmark_begin_measure("Startup", "Load Autoloads"); HashMap<StringName, ProjectSettings::AutoloadInfo> autoloads = ProjectSettings::get_singleton()->get_autoload_list(); //first pass, add the constants so they exist before any script is loaded @@ -3195,31 +3345,30 @@ bool Main::start() { scn.instantiate(); scn->set_path(info.path); scn->reload_from_file(); - ERR_CONTINUE_MSG(!scn.is_valid(), vformat("Can't autoload: %s.", info.path)); + ERR_CONTINUE_MSG(!scn.is_valid(), vformat("Failed to instantiate an autoload, can't load from path: %s.", info.path)); if (scn.is_valid()) { n = scn->instantiate(); } } else { Ref<Resource> res = ResourceLoader::load(info.path); - ERR_CONTINUE_MSG(res.is_null(), vformat("Can't autoload: %s.", info.path)); + ERR_CONTINUE_MSG(res.is_null(), vformat("Failed to instantiate an autoload, can't load from path: %s.", info.path)); Ref<Script> script_res = res; if (script_res.is_valid()) { StringName ibt = script_res->get_instance_base_type(); bool valid_type = ClassDB::is_parent_class(ibt, "Node"); - ERR_CONTINUE_MSG(!valid_type, vformat("Script does not inherit from Node: %s.", info.path)); + ERR_CONTINUE_MSG(!valid_type, vformat("Failed to instantiate an autoload, script '%s' does not inherit from 'Node'.", info.path)); Object *obj = ClassDB::instantiate(ibt); - - ERR_CONTINUE_MSG(!obj, vformat("Cannot instance script for autoload, expected 'Node' inheritance, got: %s.")); + ERR_CONTINUE_MSG(!obj, vformat("Failed to instantiate an autoload, cannot instantiate '%s'.", ibt)); n = Object::cast_to<Node>(obj); n->set_script(script_res); } } - ERR_CONTINUE_MSG(!n, vformat("Path in autoload not a node or script: %s.", info.path)); + ERR_CONTINUE_MSG(!n, vformat("Failed to instantiate an autoload, path is not pointing to a scene or a script: %s.", info.path)); n->set_name(info.name); //defer so references are all valid on _ready() @@ -3235,7 +3384,7 @@ bool Main::start() { for (Node *E : to_add) { sml->get_root()->add_child(E); } - OS::get_singleton()->benchmark_end_measure("load_autoloads"); + OS::get_singleton()->benchmark_end_measure("Startup", "Load Autoloads"); } } @@ -3274,16 +3423,16 @@ bool Main::start() { EditorNode *editor_node = nullptr; if (editor) { - OS::get_singleton()->benchmark_begin_measure("editor"); + OS::get_singleton()->benchmark_begin_measure("Startup", "Editor"); editor_node = memnew(EditorNode); sml->get_root()->add_child(editor_node); if (!_export_preset.is_empty()) { - editor_node->export_preset(_export_preset, positional_arg, export_debug, export_pack_only); + editor_node->export_preset(_export_preset, positional_arg, export_debug, export_pack_only, install_android_build_template); game_path = ""; // Do not load anything. } - OS::get_singleton()->benchmark_end_measure("editor"); + OS::get_singleton()->benchmark_end_measure("Startup", "Editor"); } #endif sml->set_auto_accept_quit(GLOBAL_GET("application/config/auto_accept_quit")); @@ -3421,7 +3570,7 @@ bool Main::start() { if (!project_manager && !editor) { // game - OS::get_singleton()->benchmark_begin_measure("game_load"); + OS::get_singleton()->benchmark_begin_measure("Startup", "Load Game"); // Load SSL Certificates from Project Settings (or builtin). Crypto::load_default_certificates(GLOBAL_GET("network/tls/certificate_bundle_override")); @@ -3463,19 +3612,19 @@ bool Main::start() { } } - OS::get_singleton()->benchmark_end_measure("game_load"); + OS::get_singleton()->benchmark_end_measure("Startup", "Load Game"); } #ifdef TOOLS_ENABLED if (project_manager) { - OS::get_singleton()->benchmark_begin_measure("project_manager"); + OS::get_singleton()->benchmark_begin_measure("Startup", "Project Manager"); Engine::get_singleton()->set_editor_hint(true); ProjectManager *pmanager = memnew(ProjectManager); ProgressDialog *progress_dialog = memnew(ProgressDialog); pmanager->add_child(progress_dialog); sml->get_root()->add_child(pmanager); DisplayServer::get_singleton()->set_context(DisplayServer::CONTEXT_PROJECTMAN); - OS::get_singleton()->benchmark_end_measure("project_manager"); + OS::get_singleton()->benchmark_end_measure("Startup", "Project Manager"); } if (project_manager || editor) { @@ -3503,7 +3652,7 @@ bool Main::start() { } } - OS::get_singleton()->benchmark_end_measure("startup_begin"); + OS::get_singleton()->benchmark_end_measure("Startup", "Total"); OS::get_singleton()->benchmark_dump(); return true; @@ -3752,7 +3901,7 @@ void Main::force_redraw() { * The order matters as some of those steps are linked with each other. */ void Main::cleanup(bool p_force) { - OS::get_singleton()->benchmark_begin_measure("Main::cleanup"); + OS::get_singleton()->benchmark_begin_measure("Shutdown", "Total"); if (!p_force) { ERR_FAIL_COND(!_start_success); } @@ -3893,7 +4042,7 @@ void Main::cleanup(bool p_force) { uninitialize_modules(MODULE_INITIALIZATION_LEVEL_CORE); unregister_core_types(); - OS::get_singleton()->benchmark_end_measure("Main::cleanup"); + OS::get_singleton()->benchmark_end_measure("Shutdown", "Total"); OS::get_singleton()->benchmark_dump(); OS::get_singleton()->finalize_core(); diff --git a/methods.py b/methods.py index 7a7758e24b..7c511af930 100644 --- a/methods.py +++ b/methods.py @@ -708,25 +708,28 @@ def detect_visual_c_compiler_version(tools_env): def find_visual_c_batch_file(env): - from SCons.Tool.MSCommon.vc import ( - get_default_version, - get_host_target, - find_batch_file, - ) + from SCons.Tool.MSCommon.vc import get_default_version, get_host_target, find_batch_file, find_vc_pdir # Syntax changed in SCons 4.4.0. from SCons import __version__ as scons_raw_version scons_ver = env._get_major_minor_revision(scons_raw_version) - version = get_default_version(env) + msvc_version = get_default_version(env) if scons_ver >= (4, 4, 0): - (host_platform, target_platform, _) = get_host_target(env, version) + (host_platform, target_platform, _) = get_host_target(env, msvc_version) else: (host_platform, target_platform, _) = get_host_target(env) - return find_batch_file(env, version, host_platform, target_platform)[0] + if scons_ver < (4, 6, 0): + return find_batch_file(env, msvc_version, host_platform, target_platform)[0] + + # Scons 4.6.0+ removed passing env, so we need to get the product_dir ourselves first, + # then pass that as the last param instead of env as the first param as before. + # We should investigate if we can avoid relying on SCons internals here. + product_dir = find_vc_pdir(env, msvc_version) + return find_batch_file(msvc_version, host_platform, target_platform, product_dir)[0] def generate_cpp_hint_file(filename): @@ -904,9 +907,16 @@ def generate_vs_project(env, original_args, project_name="godot"): defines=mono_defines, ) - env["MSVSBUILDCOM"] = module_configs.build_commandline("scons") - env["MSVSREBUILDCOM"] = module_configs.build_commandline("scons vsproj=yes") - env["MSVSCLEANCOM"] = module_configs.build_commandline("scons --clean") + scons_cmd = "scons" + + path_to_venv = os.getenv("VIRTUAL_ENV") + path_to_scons_exe = Path(str(path_to_venv)) / "Scripts" / "scons.exe" + if path_to_venv and path_to_scons_exe.exists(): + scons_cmd = str(path_to_scons_exe) + + env["MSVSBUILDCOM"] = module_configs.build_commandline(scons_cmd) + env["MSVSREBUILDCOM"] = module_configs.build_commandline(f"{scons_cmd} vsproj=yes") + env["MSVSCLEANCOM"] = module_configs.build_commandline(f"{scons_cmd} --clean") if not env.get("MSVS"): env["MSVS"]["PROJECTSUFFIX"] = ".vcxproj" env["MSVS"]["SOLUTIONSUFFIX"] = ".sln" diff --git a/misc/dist/macos_tools.app/Contents/Info.plist b/misc/dist/macos_tools.app/Contents/Info.plist index 6151593f72..90888719f8 100644 --- a/misc/dist/macos_tools.app/Contents/Info.plist +++ b/misc/dist/macos_tools.app/Contents/Info.plist @@ -17,11 +17,11 @@ <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> - <string>4.2</string> + <string>4.3</string> <key>CFBundleSignature</key> <string>godot</string> <key>CFBundleVersion</key> - <string>4.2</string> + <string>4.3</string> <key>NSMicrophoneUsageDescription</key> <string>Microphone access is required to capture audio.</string> <key>NSCameraUsageDescription</key> diff --git a/misc/dist/windows/godot.iss b/misc/dist/windows/godot.iss index ba8be69a92..6ce51e4bab 100644 --- a/misc/dist/windows/godot.iss +++ b/misc/dist/windows/godot.iss @@ -1,5 +1,5 @@ #define MyAppName "Godot Engine" -#define MyAppVersion "4.2" +#define MyAppVersion "4.3" #define MyAppPublisher "Godot Engine contributors" #define MyAppURL "https://godotengine.org/" #define MyAppExeName "godot.exe" diff --git a/misc/extension_api_validation/4.1-stable.expected b/misc/extension_api_validation/4.1-stable_4.2-stable.expected index d51523bd38..d51523bd38 100644 --- a/misc/extension_api_validation/4.1-stable.expected +++ b/misc/extension_api_validation/4.1-stable_4.2-stable.expected diff --git a/misc/extension_api_validation/4.2-stable.expected b/misc/extension_api_validation/4.2-stable.expected new file mode 100644 index 0000000000..8a31d0fbc8 --- /dev/null +++ b/misc/extension_api_validation/4.2-stable.expected @@ -0,0 +1,16 @@ +This file contains the expected output of --validate-extension-api when run against the extension_api.json of the +4.2-stable tag (the basename of this file). + +Only lines that start with "Validate extension JSON:" matter, everything else is considered a comment and ignored. They +should instead be used to justify these changes and describe how users should work around these changes. + +Add new entries at the end of the file. + +## Changes between 4.2-stable and 4.3-stable + +GH-84660 +-------- +Validate extension JSON: Error: Field 'classes/TileData/methods/get_navigation_polygon/arguments': size changed value in new API, from 1 to 4. +Validate extension JSON: Error: Field 'classes/TileData/methods/get_occluder/arguments': size changed value in new API, from 1 to 4. + +Added optional argument to get_navigation_polygon and get_occluder to specify a polygon transform. diff --git a/misc/scripts/mypy.ini b/misc/scripts/mypy.ini index b3323eacda..45f048f118 100644 --- a/misc/scripts/mypy.ini +++ b/misc/scripts/mypy.ini @@ -1,6 +1,7 @@ [mypy] -ignore_missing_imports = true +ignore_missing_imports = True disallow_any_generics = True +no_implicit_optional = True pretty = True show_column_numbers = True warn_redundant_casts = True diff --git a/modules/csg/csg_shape.cpp b/modules/csg/csg_shape.cpp index 9c178997c5..6082b468f7 100644 --- a/modules/csg/csg_shape.cpp +++ b/modules/csg/csg_shape.cpp @@ -2226,7 +2226,7 @@ void CSGPolygon3D::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "path_node", PROPERTY_HINT_NODE_PATH_VALID_TYPES, "Path3D"), "set_path_node", "get_path_node"); ADD_PROPERTY(PropertyInfo(Variant::INT, "path_interval_type", PROPERTY_HINT_ENUM, "Distance,Subdivide"), "set_path_interval_type", "get_path_interval_type"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "path_interval", PROPERTY_HINT_RANGE, "0.01,1.0,0.01,exp,or_greater"), "set_path_interval", "get_path_interval"); - ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "path_simplify_angle", PROPERTY_HINT_RANGE, "0.0,180.0,0.1,exp"), "set_path_simplify_angle", "get_path_simplify_angle"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "path_simplify_angle", PROPERTY_HINT_RANGE, "0.0,180.0,0.1"), "set_path_simplify_angle", "get_path_simplify_angle"); ADD_PROPERTY(PropertyInfo(Variant::INT, "path_rotation", PROPERTY_HINT_ENUM, "Polygon,Path,PathFollow"), "set_path_rotation", "get_path_rotation"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "path_local"), "set_path_local", "is_path_local"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "path_continuous_u"), "set_path_continuous_u", "is_path_continuous_u"); diff --git a/modules/dds/texture_loader_dds.cpp b/modules/dds/texture_loader_dds.cpp index 481bb46c24..5bd8598f4a 100644 --- a/modules/dds/texture_loader_dds.cpp +++ b/modules/dds/texture_loader_dds.cpp @@ -44,24 +44,79 @@ enum { DDSD_MIPMAPCOUNT = 0x00020000, DDPF_FOURCC = 0x00000004, DDPF_ALPHAPIXELS = 0x00000001, - DDPF_INDEXED = 0x00000020, - DDPF_RGB = 0x00000040, + DDPF_RGB = 0x00000040 }; +enum DDSFourCC { + DDFCC_DXT1 = PF_FOURCC("DXT1"), + DDFCC_DXT3 = PF_FOURCC("DXT3"), + DDFCC_DXT5 = PF_FOURCC("DXT5"), + DDFCC_ATI1 = PF_FOURCC("ATI1"), + DDFCC_BC4U = PF_FOURCC("BC4U"), + DDFCC_ATI2 = PF_FOURCC("ATI2"), + DDFCC_BC5U = PF_FOURCC("BC5U"), + DDFCC_A2XY = PF_FOURCC("A2XY"), + DDFCC_DX10 = PF_FOURCC("DX10"), + DDFCC_R16F = 111, + DDFCC_RG16F = 112, + DDFCC_RGBA16F = 113, + DDFCC_R32F = 114, + DDFCC_RG32F = 115, + DDFCC_RGBA32F = 116 +}; + +// Reference: https://learn.microsoft.com/en-us/windows/win32/api/dxgiformat/ne-dxgiformat-dxgi_format +enum DXGIFormat { + DXGI_R32G32B32A32_FLOAT = 2, + DXGI_R16G16B16A16_FLOAT = 10, + DXGI_R32G32_FLOAT = 16, + DXGI_R10G10B10A2_UNORM = 24, + DXGI_R8G8B8A8_UNORM = 28, + DXGI_R16G16_FLOAT = 34, + DXGI_R32_FLOAT = 41, + DXGI_R16_FLOAT = 54, + DXGI_R9G9B9E5 = 67, + DXGI_BC1_UNORM = 71, + DXGI_BC2_UNORM = 74, + DXGI_BC3_UNORM = 77, + DXGI_BC4_UNORM = 80, + DXGI_BC5_UNORM = 83, + DXGI_B5G6R5_UNORM = 85, + DXGI_B5G5R5A1_UNORM = 86, + DXGI_B8G8R8A8_UNORM = 87, + DXGI_BC6H_UF16 = 95, + DXGI_BC6H_SF16 = 96, + DXGI_BC7_UNORM = 98, + DXGI_B4G4R4A4_UNORM = 115 +}; + +// The legacy bitmasked format names here represent the actual data layout in the files, +// while their official names are flipped (e.g. RGBA8 layout is officially called ABGR8). enum DDSFormat { DDS_DXT1, DDS_DXT3, DDS_DXT5, DDS_ATI1, DDS_ATI2, - DDS_A2XY, + DDS_BC6U, + DDS_BC6S, + DDS_BC7U, + DDS_R16F, + DDS_RG16F, + DDS_RGBA16F, + DDS_R32F, + DDS_RG32F, + DDS_RGBA32F, + DDS_RGB9E5, DDS_BGRA8, DDS_BGR8, - DDS_RGBA8, //flipped in dds - DDS_RGB8, //flipped in dds + DDS_RGBA8, + DDS_RGB8, DDS_BGR5A1, DDS_BGR565, DDS_BGR10A2, + DDS_RGB10A2, + DDS_BGRA4, DDS_LUMINANCE, DDS_LUMINANCE_ALPHA, DDS_MAX @@ -70,30 +125,112 @@ enum DDSFormat { struct DDSFormatInfo { const char *name = nullptr; bool compressed = false; - bool palette = false; uint32_t divisor = 0; uint32_t block_size = 0; Image::Format format = Image::Format::FORMAT_BPTC_RGBA; }; static const DDSFormatInfo dds_format_info[DDS_MAX] = { - { "DXT1/BC1", true, false, 4, 8, Image::FORMAT_DXT1 }, - { "DXT3/BC2", true, false, 4, 16, Image::FORMAT_DXT3 }, - { "DXT5/BC3", true, false, 4, 16, Image::FORMAT_DXT5 }, - { "ATI1/BC4", true, false, 4, 8, Image::FORMAT_RGTC_R }, - { "ATI2/3DC/BC5", true, false, 4, 16, Image::FORMAT_RGTC_RG }, - { "A2XY/DXN/BC5", true, false, 4, 16, Image::FORMAT_RGTC_RG }, - { "BGRA8", false, false, 1, 4, Image::FORMAT_RGBA8 }, - { "BGR8", false, false, 1, 3, Image::FORMAT_RGB8 }, - { "RGBA8", false, false, 1, 4, Image::FORMAT_RGBA8 }, - { "RGB8", false, false, 1, 3, Image::FORMAT_RGB8 }, - { "BGR5A1", false, false, 1, 2, Image::FORMAT_RGBA8 }, - { "BGR565", false, false, 1, 2, Image::FORMAT_RGB8 }, - { "BGR10A2", false, false, 1, 4, Image::FORMAT_RGBA8 }, - { "GRAYSCALE", false, false, 1, 1, Image::FORMAT_L8 }, - { "GRAYSCALE_ALPHA", false, false, 1, 2, Image::FORMAT_LA8 } + { "DXT1/BC1", true, 4, 8, Image::FORMAT_DXT1 }, + { "DXT3/BC2", true, 4, 16, Image::FORMAT_DXT3 }, + { "DXT5/BC3", true, 4, 16, Image::FORMAT_DXT5 }, + { "ATI1/BC4", true, 4, 8, Image::FORMAT_RGTC_R }, + { "ATI2/A2XY/BC5", true, 4, 16, Image::FORMAT_RGTC_RG }, + { "BC6U", true, 4, 16, Image::FORMAT_BPTC_RGBFU }, + { "BC6S", true, 4, 16, Image::FORMAT_BPTC_RGBF }, + { "BC7U", true, 4, 16, Image::FORMAT_BPTC_RGBA }, + { "R16F", false, 1, 2, Image::FORMAT_RH }, + { "RG16F", false, 1, 4, Image::FORMAT_RGH }, + { "RGBA16F", false, 1, 8, Image::FORMAT_RGBAH }, + { "R32F", false, 1, 4, Image::FORMAT_RF }, + { "RG32F", false, 1, 8, Image::FORMAT_RGF }, + { "RGBA32F", false, 1, 16, Image::FORMAT_RGBAF }, + { "RGB9E5", false, 1, 4, Image::FORMAT_RGBE9995 }, + { "BGRA8", false, 1, 4, Image::FORMAT_RGBA8 }, + { "BGR8", false, 1, 3, Image::FORMAT_RGB8 }, + { "RGBA8", false, 1, 4, Image::FORMAT_RGBA8 }, + { "RGB8", false, 1, 3, Image::FORMAT_RGB8 }, + { "BGR5A1", false, 1, 2, Image::FORMAT_RGBA8 }, + { "BGR565", false, 1, 2, Image::FORMAT_RGB8 }, + { "BGR10A2", false, 1, 4, Image::FORMAT_RGBA8 }, + { "RGB10A2", false, 1, 4, Image::FORMAT_RGBA8 }, + { "BGRA4", false, 1, 2, Image::FORMAT_RGBA8 }, + { "GRAYSCALE", false, 1, 1, Image::FORMAT_L8 }, + { "GRAYSCALE_ALPHA", false, 1, 2, Image::FORMAT_LA8 } }; +static DDSFormat dxgi_to_dds_format(uint32_t p_dxgi_format) { + switch (p_dxgi_format) { + case DXGI_R32G32B32A32_FLOAT: { + return DDS_RGBA32F; + } + case DXGI_R16G16B16A16_FLOAT: { + return DDS_RGBA16F; + } + case DXGI_R32G32_FLOAT: { + return DDS_RG32F; + } + case DXGI_R10G10B10A2_UNORM: { + return DDS_RGB10A2; + } + case DXGI_R8G8B8A8_UNORM: { + return DDS_RGBA8; + } + case DXGI_R16G16_FLOAT: { + return DDS_RG16F; + } + case DXGI_R32_FLOAT: { + return DDS_R32F; + } + case DXGI_R16_FLOAT: { + return DDS_R16F; + } + case DXGI_R9G9B9E5: { + return DDS_RGB9E5; + } + case DXGI_BC1_UNORM: { + return DDS_DXT1; + } + case DXGI_BC2_UNORM: { + return DDS_DXT3; + } + case DXGI_BC3_UNORM: { + return DDS_DXT5; + } + case DXGI_BC4_UNORM: { + return DDS_ATI1; + } + case DXGI_BC5_UNORM: { + return DDS_ATI2; + } + case DXGI_B5G6R5_UNORM: { + return DDS_BGR565; + } + case DXGI_B5G5R5A1_UNORM: { + return DDS_BGR5A1; + } + case DXGI_B8G8R8A8_UNORM: { + return DDS_BGRA8; + } + case DXGI_BC6H_UF16: { + return DDS_BC6U; + } + case DXGI_BC6H_SF16: { + return DDS_BC6S; + } + case DXGI_BC7_UNORM: { + return DDS_BC7U; + } + case DXGI_B4G4R4A4_UNORM: { + return DDS_BGRA4; + } + + default: { + return DDS_MAX; + } + } +} + Ref<Resource> ResourceFormatDDS::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress, CacheMode p_cache_mode) { if (r_error) { *r_error = ERR_CANT_OPEN; @@ -121,15 +258,14 @@ Ref<Resource> ResourceFormatDDS::load(const String &p_path, const String &p_orig /* uint32_t depth = */ f->get_32(); uint32_t mipmaps = f->get_32(); - //skip 11 + // Skip reserved. for (int i = 0; i < 11; i++) { f->get_32(); } - //validate - + // Validate. // We don't check DDSD_CAPS or DDSD_PIXELFORMAT, as they're mandatory when writing, - // but non-mandatory when reading (as some writers don't set them)... + // but non-mandatory when reading (as some writers don't set them). if (magic != DDS_MAGIC || hsize != 124) { ERR_FAIL_V_MSG(Ref<Resource>(), "Invalid or unsupported DDS texture file '" + p_path + "'."); } @@ -145,65 +281,112 @@ Ref<Resource> ResourceFormatDDS::load(const String &p_path, const String &p_orig /* uint32_t caps_1 = */ f->get_32(); /* uint32_t caps_2 = */ f->get_32(); - /* uint32_t caps_ddsx = */ f->get_32(); + /* uint32_t caps_3 = */ f->get_32(); + /* uint32_t caps_4 = */ f->get_32(); - //reserved skip - f->get_32(); + // Skip reserved. f->get_32(); - /* - print_line("DDS width: "+itos(width)); - print_line("DDS height: "+itos(height)); - print_line("DDS mipmaps: "+itos(mipmaps)); + if (f->get_position() < 128) { + f->seek(128); + } - printf("fourcc: %x fflags: %x, rgbbits: %x, fsize: %x\n",format_fourcc,format_flags,format_rgb_bits,format_size); - printf("rmask: %x gmask: %x, bmask: %x, amask: %x\n",format_red_mask,format_green_mask,format_blue_mask,format_alpha_mask); - */ + DDSFormat dds_format = DDS_MAX; - //must avoid this later - while (f->get_position() < 128) { - f->get_8(); - } + if (format_flags & DDPF_FOURCC) { + // FourCC formats. + switch (format_fourcc) { + case DDFCC_DXT1: { + dds_format = DDS_DXT1; + } break; + case DDFCC_DXT3: { + dds_format = DDS_DXT3; + } break; + case DDFCC_DXT5: { + dds_format = DDS_DXT5; + } break; + case DDFCC_ATI1: + case DDFCC_BC4U: { + dds_format = DDS_ATI1; + } break; + case DDFCC_ATI2: + case DDFCC_BC5U: + case DDFCC_A2XY: { + dds_format = DDS_ATI2; + } break; + case DDFCC_R16F: { + dds_format = DDS_R16F; + } break; + case DDFCC_RG16F: { + dds_format = DDS_RG16F; + } break; + case DDFCC_RGBA16F: { + dds_format = DDS_RGBA16F; + } break; + case DDFCC_R32F: { + dds_format = DDS_R32F; + } break; + case DDFCC_RG32F: { + dds_format = DDS_RG32F; + } break; + case DDFCC_RGBA32F: { + dds_format = DDS_RGBA32F; + } break; + case DDFCC_DX10: { + uint32_t dxgi_format = f->get_32(); + /* uint32_t dimension = */ f->get_32(); + /* uint32_t misc_flags_1 = */ f->get_32(); + /* uint32_t array_size = */ f->get_32(); + /* uint32_t misc_flags_2 = */ f->get_32(); + + dds_format = dxgi_to_dds_format(dxgi_format); + } break; + + default: { + ERR_FAIL_V_MSG(Ref<Resource>(), "Unrecognized or unsupported FourCC in DDS '" + p_path + "'."); + } + } + + } else if (format_flags & DDPF_RGB) { + // Channel-bitmasked formats. + if (format_flags & DDPF_ALPHAPIXELS) { + // With alpha. + if (format_rgb_bits == 32 && format_red_mask == 0xff0000 && format_green_mask == 0xff00 && format_blue_mask == 0xff && format_alpha_mask == 0xff000000) { + dds_format = DDS_BGRA8; + } else if (format_rgb_bits == 32 && format_red_mask == 0xff && format_green_mask == 0xff00 && format_blue_mask == 0xff0000 && format_alpha_mask == 0xff000000) { + dds_format = DDS_RGBA8; + } else if (format_rgb_bits == 16 && format_red_mask == 0x00007c00 && format_green_mask == 0x000003e0 && format_blue_mask == 0x0000001f && format_alpha_mask == 0x00008000) { + dds_format = DDS_BGR5A1; + } else if (format_rgb_bits == 32 && format_red_mask == 0x3ff00000 && format_green_mask == 0xffc00 && format_blue_mask == 0x3ff && format_alpha_mask == 0xc0000000) { + dds_format = DDS_BGR10A2; + } else if (format_rgb_bits == 32 && format_red_mask == 0x3ff && format_green_mask == 0xffc00 && format_blue_mask == 0x3ff00000 && format_alpha_mask == 0xc0000000) { + dds_format = DDS_RGB10A2; + } else if (format_rgb_bits == 16 && format_red_mask == 0xf00 && format_green_mask == 0xf0 && format_blue_mask == 0xf && format_alpha_mask == 0xf000) { + dds_format = DDS_BGRA4; + } + + } else { + // Without alpha. + if (format_rgb_bits == 24 && format_red_mask == 0xff0000 && format_green_mask == 0xff00 && format_blue_mask == 0xff) { + dds_format = DDS_BGR8; + } else if (format_rgb_bits == 24 && format_red_mask == 0xff && format_green_mask == 0xff00 && format_blue_mask == 0xff0000) { + dds_format = DDS_RGB8; + } else if (format_rgb_bits == 16 && format_red_mask == 0x0000f800 && format_green_mask == 0x000007e0 && format_blue_mask == 0x0000001f) { + dds_format = DDS_BGR565; + } + } - DDSFormat dds_format; - - if (format_flags & DDPF_FOURCC && format_fourcc == PF_FOURCC("DXT1")) { - dds_format = DDS_DXT1; - } else if (format_flags & DDPF_FOURCC && format_fourcc == PF_FOURCC("DXT3")) { - dds_format = DDS_DXT3; - - } else if (format_flags & DDPF_FOURCC && format_fourcc == PF_FOURCC("DXT5")) { - dds_format = DDS_DXT5; - } else if (format_flags & DDPF_FOURCC && format_fourcc == PF_FOURCC("ATI1")) { - dds_format = DDS_ATI1; - } else if (format_flags & DDPF_FOURCC && format_fourcc == PF_FOURCC("ATI2")) { - dds_format = DDS_ATI2; - } else if (format_flags & DDPF_FOURCC && format_fourcc == PF_FOURCC("A2XY")) { - dds_format = DDS_A2XY; - - } else if (format_flags & DDPF_RGB && format_flags & DDPF_ALPHAPIXELS && format_rgb_bits == 32 && format_red_mask == 0xff0000 && format_green_mask == 0xff00 && format_blue_mask == 0xff && format_alpha_mask == 0xff000000) { - dds_format = DDS_BGRA8; - } else if (format_flags & DDPF_RGB && !(format_flags & DDPF_ALPHAPIXELS) && format_rgb_bits == 24 && format_red_mask == 0xff0000 && format_green_mask == 0xff00 && format_blue_mask == 0xff) { - dds_format = DDS_BGR8; - } else if (format_flags & DDPF_RGB && format_flags & DDPF_ALPHAPIXELS && format_rgb_bits == 32 && format_red_mask == 0xff && format_green_mask == 0xff00 && format_blue_mask == 0xff0000 && format_alpha_mask == 0xff000000) { - dds_format = DDS_RGBA8; - } else if (format_flags & DDPF_RGB && !(format_flags & DDPF_ALPHAPIXELS) && format_rgb_bits == 24 && format_red_mask == 0xff && format_green_mask == 0xff00 && format_blue_mask == 0xff0000) { - dds_format = DDS_RGB8; - - } else if (format_flags & DDPF_RGB && format_flags & DDPF_ALPHAPIXELS && format_rgb_bits == 16 && format_red_mask == 0x00007c00 && format_green_mask == 0x000003e0 && format_blue_mask == 0x0000001f && format_alpha_mask == 0x00008000) { - dds_format = DDS_BGR5A1; - } else if (format_flags & DDPF_RGB && format_flags & DDPF_ALPHAPIXELS && format_rgb_bits == 32 && format_red_mask == 0x3ff00000 && format_green_mask == 0xffc00 && format_blue_mask == 0x3ff && format_alpha_mask == 0xc0000000) { - dds_format = DDS_BGR10A2; - } else if (format_flags & DDPF_RGB && !(format_flags & DDPF_ALPHAPIXELS) && format_rgb_bits == 16 && format_red_mask == 0x0000f800 && format_green_mask == 0x000007e0 && format_blue_mask == 0x0000001f) { - dds_format = DDS_BGR565; - } else if (!(format_flags & DDPF_ALPHAPIXELS) && format_rgb_bits == 8 && format_red_mask == 0xff) { - dds_format = DDS_LUMINANCE; - } else if ((format_flags & DDPF_ALPHAPIXELS) && format_rgb_bits == 16 && format_red_mask == 0xff && format_alpha_mask == 0xff00) { - dds_format = DDS_LUMINANCE_ALPHA; - } else if (format_flags & DDPF_INDEXED && format_rgb_bits == 8) { - dds_format = DDS_BGR565; } else { - //printf("unrecognized fourcc %x format_flags: %x - rgbbits %i - red_mask %x green mask %x blue mask %x alpha mask %x\n", format_fourcc, format_flags, format_rgb_bits, format_red_mask, format_green_mask, format_blue_mask, format_alpha_mask); + // Other formats. + if (format_flags & DDPF_ALPHAPIXELS && format_rgb_bits == 16 && format_red_mask == 0xff && format_alpha_mask == 0xff00) { + dds_format = DDS_LUMINANCE_ALPHA; + } else if (!(format_flags & DDPF_ALPHAPIXELS) && format_rgb_bits == 8 && format_red_mask == 0xff) { + dds_format = DDS_LUMINANCE; + } + } + + // No format detected, error. + if (dds_format == DDS_MAX) { ERR_FAIL_V_MSG(Ref<Resource>(), "Unrecognized or unsupported color layout in DDS '" + p_path + "'."); } @@ -218,17 +401,17 @@ Ref<Resource> ResourceFormatDDS::load(const String &p_path, const String &p_orig uint32_t h = height; if (info.compressed) { - //compressed bc - + // BC compressed. uint32_t size = MAX(info.divisor, w) / info.divisor * MAX(info.divisor, h) / info.divisor * info.block_size; + ERR_FAIL_COND_V(size != pitch, Ref<Resource>()); ERR_FAIL_COND_V(!(flags & DDSD_LINEARSIZE), Ref<Resource>()); for (uint32_t i = 1; i < mipmaps; i++) { w = MAX(1u, w >> 1); h = MAX(1u, h >> 1); + uint32_t bsize = MAX(info.divisor, w) / info.divisor * MAX(info.divisor, h) / info.divisor * info.block_size; - //printf("%i x %i - block: %i\n",w,h,bsize); size += bsize; } @@ -236,50 +419,8 @@ Ref<Resource> ResourceFormatDDS::load(const String &p_path, const String &p_orig uint8_t *wb = src_data.ptrw(); f->get_buffer(wb, size); - } else if (info.palette) { - //indexed - ERR_FAIL_COND_V(!(flags & DDSD_PITCH), Ref<Resource>()); - ERR_FAIL_COND_V(format_rgb_bits != 8, Ref<Resource>()); - - uint32_t size = pitch * height; - ERR_FAIL_COND_V(size != width * height * info.block_size, Ref<Resource>()); - - uint8_t palette[256 * 4]; - f->get_buffer(palette, 256 * 4); - - int colsize = 3; - for (int i = 0; i < 256; i++) { - if (palette[i * 4 + 3] < 255) { - colsize = 4; - } - } - - int w2 = width; - int h2 = height; - - for (uint32_t i = 1; i < mipmaps; i++) { - w2 = (w2 + 1) >> 1; - h2 = (h2 + 1) >> 1; - size += w2 * h2 * info.block_size; - } - - src_data.resize(size + 256 * colsize); - uint8_t *wb = src_data.ptrw(); - f->get_buffer(wb, size); - - for (int i = 0; i < 256; i++) { - int dst_ofs = size + i * colsize; - int src_ofs = i * 4; - wb[dst_ofs + 0] = palette[src_ofs + 2]; - wb[dst_ofs + 1] = palette[src_ofs + 1]; - wb[dst_ofs + 2] = palette[src_ofs + 0]; - if (colsize == 4) { - wb[dst_ofs + 3] = palette[src_ofs + 3]; - } - } } else { - //uncompressed generic... - + // Generic uncompressed. uint32_t size = width * height * info.block_size; for (uint32_t i = 1; i < mipmaps; i++) { @@ -288,9 +429,10 @@ Ref<Resource> ResourceFormatDDS::load(const String &p_path, const String &p_orig size += w * h * info.block_size; } + // Calculate the space these formats will take up after decoding. if (dds_format == DDS_BGR565) { size = size * 3 / 2; - } else if (dds_format == DDS_BGR5A1) { + } else if (dds_format == DDS_BGR5A1 || dds_format == DDS_BGRA4) { size = size * 2; } @@ -298,9 +440,10 @@ Ref<Resource> ResourceFormatDDS::load(const String &p_path, const String &p_orig uint8_t *wb = src_data.ptrw(); f->get_buffer(wb, size); + // Decode nonstandard formats. switch (dds_format) { case DDS_BGR5A1: { - // TO RGBA + // To RGBA8. int colcount = size / 4; for (int i = colcount - 1; i >= 0; i--) { @@ -311,13 +454,16 @@ Ref<Resource> ResourceFormatDDS::load(const String &p_path, const String &p_orig uint8_t b = wb[src_ofs] & 0x1F; uint8_t g = (wb[src_ofs] >> 5) | ((wb[src_ofs + 1] & 0x3) << 3); uint8_t r = (wb[src_ofs + 1] >> 2) & 0x1F; + wb[dst_ofs + 0] = r << 3; wb[dst_ofs + 1] = g << 3; wb[dst_ofs + 2] = b << 3; wb[dst_ofs + 3] = a ? 255 : 0; } + } break; case DDS_BGR565: { + // To RGB8. int colcount = size / 3; for (int i = colcount - 1; i >= 0; i--) { @@ -327,21 +473,67 @@ Ref<Resource> ResourceFormatDDS::load(const String &p_path, const String &p_orig uint8_t b = wb[src_ofs] & 0x1F; uint8_t g = (wb[src_ofs] >> 5) | ((wb[src_ofs + 1] & 0x7) << 3); uint8_t r = wb[src_ofs + 1] >> 3; + wb[dst_ofs + 0] = r << 3; wb[dst_ofs + 1] = g << 2; - wb[dst_ofs + 2] = b << 3; //b<<3; + wb[dst_ofs + 2] = b << 3; } } break; - case DDS_BGR10A2: { - // TO RGBA + case DDS_BGRA4: { + // To RGBA8. int colcount = size / 4; for (int i = colcount - 1; i >= 0; i--) { + int src_ofs = i * 2; + int dst_ofs = i * 4; + + uint8_t b = wb[src_ofs] & 0x0F; + uint8_t g = wb[src_ofs] & 0xF0; + uint8_t r = wb[src_ofs + 1] & 0x0F; + uint8_t a = wb[src_ofs + 1] & 0xF0; + + wb[dst_ofs] = (r << 4) | r; + wb[dst_ofs + 1] = g | (g >> 4); + wb[dst_ofs + 2] = (b << 4) | b; + wb[dst_ofs + 3] = a | (a >> 4); + } + + } break; + case DDS_RGB10A2: { + // To RGBA8. + int colcount = size / 4; + + for (int i = 0; i < colcount; i++) { int ofs = i * 4; uint32_t w32 = uint32_t(wb[ofs + 0]) | (uint32_t(wb[ofs + 1]) << 8) | (uint32_t(wb[ofs + 2]) << 16) | (uint32_t(wb[ofs + 3]) << 24); + // This method follows the 'standard' way of decoding 10-bit dds files, + // which means the ones created with DirectXTex will be loaded incorrectly. + uint8_t a = (w32 & 0xc0000000) >> 24; + uint8_t r = (w32 & 0x3ff) >> 2; + uint8_t g = (w32 & 0xffc00) >> 12; + uint8_t b = (w32 & 0x3ff00000) >> 22; + + wb[ofs + 0] = r; + wb[ofs + 1] = g; + wb[ofs + 2] = b; + wb[ofs + 3] = a == 0xc0 ? 255 : a; // 0xc0 should be opaque. + } + + } break; + case DDS_BGR10A2: { + // To RGBA8. + int colcount = size / 4; + + for (int i = 0; i < colcount; i++) { + int ofs = i * 4; + + uint32_t w32 = uint32_t(wb[ofs + 0]) | (uint32_t(wb[ofs + 1]) << 8) | (uint32_t(wb[ofs + 2]) << 16) | (uint32_t(wb[ofs + 3]) << 24); + + // This method follows the 'standard' way of decoding 10-bit dds files, + // which means the ones created with DirectXTex will be loaded incorrectly. uint8_t a = (w32 & 0xc0000000) >> 24; uint8_t r = (w32 & 0x3ff00000) >> 22; uint8_t g = (w32 & 0xffc00) >> 12; @@ -350,10 +542,12 @@ Ref<Resource> ResourceFormatDDS::load(const String &p_path, const String &p_orig wb[ofs + 0] = r; wb[ofs + 1] = g; wb[ofs + 2] = b; - wb[ofs + 3] = a == 0xc0 ? 255 : a; //0xc0 should be opaque + wb[ofs + 3] = a == 0xc0 ? 255 : a; // 0xc0 should be opaque. } + } break; case DDS_BGRA8: { + // To RGBA8. int colcount = size / 4; for (int i = 0; i < colcount; i++) { @@ -362,44 +556,12 @@ Ref<Resource> ResourceFormatDDS::load(const String &p_path, const String &p_orig } break; case DDS_BGR8: { + // To RGB8. int colcount = size / 3; for (int i = 0; i < colcount; i++) { SWAP(wb[i * 3 + 0], wb[i * 3 + 2]); } - } break; - case DDS_RGBA8: { - /* do nothing either - int colcount = size/4; - - for(int i=0;i<colcount;i++) { - uint8_t r = wb[i*4+1]; - uint8_t g = wb[i*4+2]; - uint8_t b = wb[i*4+3]; - uint8_t a = wb[i*4+0]; - - wb[i*4+0]=r; - wb[i*4+1]=g; - wb[i*4+2]=b; - wb[i*4+3]=a; - } - */ - } break; - case DDS_RGB8: { - // do nothing - /* - int colcount = size/3; - - for(int i=0;i<colcount;i++) { - SWAP( wb[i*3+0],wb[i*3+2] ); - }*/ - } break; - case DDS_LUMINANCE: { - // do nothing i guess? - - } break; - case DDS_LUMINANCE_ALPHA: { - // do nothing i guess? } break; diff --git a/modules/etcpak/SCsub b/modules/etcpak/SCsub index 2d3b69be75..3a4bff8e87 100644 --- a/modules/etcpak/SCsub +++ b/modules/etcpak/SCsub @@ -13,6 +13,7 @@ thirdparty_dir = "#thirdparty/etcpak/" thirdparty_sources = [ "Dither.cpp", "ProcessDxtc.cpp", + "ProcessRgtc.cpp", "ProcessRGB.cpp", "Tables.cpp", ] diff --git a/modules/etcpak/image_compress_etcpak.cpp b/modules/etcpak/image_compress_etcpak.cpp index 14cce2686c..f528b92cf2 100644 --- a/modules/etcpak/image_compress_etcpak.cpp +++ b/modules/etcpak/image_compress_etcpak.cpp @@ -35,6 +35,7 @@ #include <ProcessDxtc.hpp> #include <ProcessRGB.hpp> +#include <ProcessRgtc.hpp> EtcpakType _determine_etc_type(Image::UsedChannels p_channels) { switch (p_channels) { @@ -62,9 +63,9 @@ EtcpakType _determine_dxt_type(Image::UsedChannels p_channels) { case Image::USED_CHANNELS_LA: return EtcpakType::ETCPAK_TYPE_DXT5; case Image::USED_CHANNELS_R: - return EtcpakType::ETCPAK_TYPE_DXT5; + return EtcpakType::ETCPAK_TYPE_RGTC_R; case Image::USED_CHANNELS_RG: - return EtcpakType::ETCPAK_TYPE_DXT5_RA_AS_RG; + return EtcpakType::ETCPAK_TYPE_RGTC_RG; case Image::USED_CHANNELS_RGB: return EtcpakType::ETCPAK_TYPE_DXT1; case Image::USED_CHANNELS_RGBA: @@ -127,6 +128,10 @@ void _compress_etcpak(EtcpakType p_compresstype, Image *r_img) { r_img->convert_rg_to_ra_rgba8(); } else if (p_compresstype == EtcpakType::ETCPAK_TYPE_DXT5) { target_format = Image::FORMAT_DXT5; + } else if (p_compresstype == EtcpakType::ETCPAK_TYPE_RGTC_R) { + target_format = Image::FORMAT_RGTC_R; + } else if (p_compresstype == EtcpakType::ETCPAK_TYPE_RGTC_RG) { + target_format = Image::FORMAT_RGTC_RG; } else { ERR_FAIL_MSG("Invalid or unsupported etcpak compression format, not ETC or DXT."); } @@ -229,6 +234,10 @@ void _compress_etcpak(EtcpakType p_compresstype, Image *r_img) { CompressDxt1Dither(src_mip_read, dest_mip_write, blocks, mip_w); } else if (p_compresstype == EtcpakType::ETCPAK_TYPE_DXT5 || p_compresstype == EtcpakType::ETCPAK_TYPE_DXT5_RA_AS_RG) { CompressDxt5(src_mip_read, dest_mip_write, blocks, mip_w); + } else if (p_compresstype == EtcpakType::ETCPAK_TYPE_RGTC_RG) { + CompressRgtcRG(src_mip_read, dest_mip_write, blocks, mip_w); + } else if (p_compresstype == EtcpakType::ETCPAK_TYPE_RGTC_R) { + CompressRgtcR(src_mip_read, dest_mip_write, blocks, mip_w); } else { ERR_FAIL_MSG("etcpak: Invalid or unsupported compression format."); } diff --git a/modules/etcpak/image_compress_etcpak.h b/modules/etcpak/image_compress_etcpak.h index ff267631a6..ff8bb635b4 100644 --- a/modules/etcpak/image_compress_etcpak.h +++ b/modules/etcpak/image_compress_etcpak.h @@ -41,6 +41,8 @@ enum class EtcpakType { ETCPAK_TYPE_DXT1, ETCPAK_TYPE_DXT5, ETCPAK_TYPE_DXT5_RA_AS_RG, + ETCPAK_TYPE_RGTC_R, + ETCPAK_TYPE_RGTC_RG, }; void _compress_etc1(Image *r_img); diff --git a/modules/gdscript/doc_classes/@GDScript.xml b/modules/gdscript/doc_classes/@GDScript.xml index 3da6bcf10c..fcb7a11a14 100644 --- a/modules/gdscript/doc_classes/@GDScript.xml +++ b/modules/gdscript/doc_classes/@GDScript.xml @@ -162,7 +162,7 @@ <return type="Resource" /> <param index="0" name="path" type="String" /> <description> - Returns a [Resource] from the filesystem located at the absolute [param path]. Unless it's already referenced elsewhere (such as in another script or in the scene), the resource is loaded from disk on function call, which might cause a slight delay, especially when loading large scenes. To avoid unnecessary delays when loading something multiple times, either store the resource in a variable or use [method preload]. + Returns a [Resource] from the filesystem located at the absolute [param path]. Unless it's already referenced elsewhere (such as in another script or in the scene), the resource is loaded from disk on function call, which might cause a slight delay, especially when loading large scenes. To avoid unnecessary delays when loading something multiple times, either store the resource in a variable or use [method preload]. This method is equivalent of using [method ResourceLoader.load] with [constant ResourceLoader.CACHE_MODE_REUSE]. [b]Note:[/b] Resource paths can be obtained by right-clicking on a resource in the FileSystem dock and choosing "Copy Path", or by dragging the file from the FileSystem dock into the current script. [codeblock] # Load a scene called "main" located in the root of the project directory and cache it in a variable. diff --git a/modules/gdscript/editor/gdscript_docgen.cpp b/modules/gdscript/editor/gdscript_docgen.cpp index c3979dd290..00179109a3 100644 --- a/modules/gdscript/editor/gdscript_docgen.cpp +++ b/modules/gdscript/editor/gdscript_docgen.cpp @@ -64,8 +64,8 @@ void GDScriptDocGen::_doctype_from_gdtype(const GDType &p_gdtype, String &r_type r_type = p_is_return ? "void" : "null"; return; } - if (p_gdtype.builtin_type == Variant::ARRAY && p_gdtype.has_container_element_type()) { - _doctype_from_gdtype(p_gdtype.get_container_element_type(), r_type, r_enum); + if (p_gdtype.builtin_type == Variant::ARRAY && p_gdtype.has_container_element_type(0)) { + _doctype_from_gdtype(p_gdtype.get_container_element_type(0), r_type, r_enum); if (!r_enum.is_empty()) { r_type = "int[]"; r_enum += "[]"; diff --git a/modules/gdscript/editor/gdscript_highlighter.cpp b/modules/gdscript/editor/gdscript_highlighter.cpp index 8dbd262b22..3df07f9794 100644 --- a/modules/gdscript/editor/gdscript_highlighter.cpp +++ b/modules/gdscript/editor/gdscript_highlighter.cpp @@ -494,7 +494,7 @@ Dictionary GDScriptSyntaxHighlighter::_get_line_syntax_highlighting_impl(int p_l in_function_arg_dicts = 0; } - if (expect_type && (prev_is_char || str[j] == '=') && str[j] != '[' && str[j] != '.') { + if (expect_type && (prev_is_char || str[j] == '=') && str[j] != '[' && str[j] != ',' && str[j] != '.') { expect_type = false; } diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index 4accdb4d21..52235b1854 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -1117,8 +1117,7 @@ GDScript *GDScript::find_class(const String &p_qualified_name) { // Starts at index 1 because index 0 was handled above. for (int i = 1; result != nullptr && i < class_names.size(); i++) { - String current_name = class_names[i]; - if (HashMap<StringName, Ref<GDScript>>::Iterator E = result->subclasses.find(current_name)) { + if (HashMap<StringName, Ref<GDScript>>::Iterator E = result->subclasses.find(class_names[i])) { result = E->value.ptr(); } else { // Couldn't find inner class. @@ -1156,8 +1155,8 @@ RBSet<GDScript *> GDScript::get_dependencies() { return dependencies; } -RBSet<GDScript *> GDScript::get_inverted_dependencies() { - RBSet<GDScript *> inverted_dependencies; +HashMap<GDScript *, RBSet<GDScript *>> GDScript::get_all_dependencies() { + HashMap<GDScript *, RBSet<GDScript *>> all_dependencies; List<GDScript *> scripts; { @@ -1171,51 +1170,42 @@ RBSet<GDScript *> GDScript::get_inverted_dependencies() { } for (GDScript *scr : scripts) { - if (scr == nullptr || scr == this || scr->destructing) { + if (scr == nullptr || scr->destructing) { continue; } - - RBSet<GDScript *> scr_dependencies = scr->get_dependencies(); - if (scr_dependencies.has(this)) { - inverted_dependencies.insert(scr); - } + all_dependencies.insert(scr, scr->get_dependencies()); } - return inverted_dependencies; + return all_dependencies; } RBSet<GDScript *> GDScript::get_must_clear_dependencies() { RBSet<GDScript *> dependencies = get_dependencies(); RBSet<GDScript *> must_clear_dependencies; - HashMap<GDScript *, RBSet<GDScript *>> inverted_dependencies; - - for (GDScript *E : dependencies) { - inverted_dependencies.insert(E, E->get_inverted_dependencies()); - } + HashMap<GDScript *, RBSet<GDScript *>> all_dependencies = get_all_dependencies(); RBSet<GDScript *> cant_clear; - for (KeyValue<GDScript *, RBSet<GDScript *>> &E : inverted_dependencies) { + for (KeyValue<GDScript *, RBSet<GDScript *>> &E : all_dependencies) { + if (dependencies.has(E.key)) { + continue; + } for (GDScript *F : E.value) { - if (!dependencies.has(F)) { - cant_clear.insert(E.key); - for (GDScript *G : E.key->get_dependencies()) { - cant_clear.insert(G); - } - break; + if (dependencies.has(F)) { + cant_clear.insert(F); } } } - for (KeyValue<GDScript *, RBSet<GDScript *>> &E : inverted_dependencies) { - if (cant_clear.has(E.key) || ScriptServer::is_global_class(E.key->get_fully_qualified_name())) { + for (GDScript *E : dependencies) { + if (cant_clear.has(E) || ScriptServer::is_global_class(E->get_fully_qualified_name())) { continue; } - must_clear_dependencies.insert(E.key); + must_clear_dependencies.insert(E); } cant_clear.clear(); dependencies.clear(); - inverted_dependencies.clear(); + all_dependencies.clear(); return must_clear_dependencies; } @@ -1391,106 +1381,51 @@ String GDScript::debug_get_script_name(const Ref<Script> &p_script) { } #endif -thread_local GDScript::UpdatableFuncPtr GDScript::func_ptrs_to_update_thread_local; -GDScript::UpdatableFuncPtr *GDScript::func_ptrs_to_update_main_thread = &func_ptrs_to_update_thread_local; +GDScript::UpdatableFuncPtr GDScript::func_ptrs_to_update_main_thread; +thread_local GDScript::UpdatableFuncPtr *GDScript::func_ptrs_to_update_thread_local = nullptr; -GDScript::UpdatableFuncPtrElement *GDScript::_add_func_ptr_to_update(GDScriptFunction **p_func_ptr_ptr) { - MutexLock lock(func_ptrs_to_update_mutex); - - List<UpdatableFuncPtrElement>::Element *result = func_ptrs_to_update_elems.push_back(UpdatableFuncPtrElement()); +GDScript::UpdatableFuncPtrElement GDScript::_add_func_ptr_to_update(GDScriptFunction **p_func_ptr_ptr) { + UpdatableFuncPtrElement result = {}; { - MutexLock lock2(func_ptrs_to_update_thread_local.mutex); - result->get().element = func_ptrs_to_update_thread_local.ptrs.push_back(p_func_ptr_ptr); - result->get().mutex = &func_ptrs_to_update_thread_local.mutex; + MutexLock lock(func_ptrs_to_update_thread_local->mutex); + result.element = func_ptrs_to_update_thread_local->ptrs.push_back(p_func_ptr_ptr); + result.func_ptr = func_ptrs_to_update_thread_local; - if (likely(func_ptrs_to_update_thread_local.initialized)) { - return &result->get(); + if (likely(func_ptrs_to_update_thread_local->initialized)) { + return result; } - func_ptrs_to_update_thread_local.initialized = true; + func_ptrs_to_update_thread_local->initialized = true; } - func_ptrs_to_update.push_back(&func_ptrs_to_update_thread_local); + MutexLock lock(func_ptrs_to_update_mutex); + func_ptrs_to_update.push_back(func_ptrs_to_update_thread_local); + func_ptrs_to_update_thread_local->rc++; - return &result->get(); + return result; } -void GDScript::_remove_func_ptr_to_update(const UpdatableFuncPtrElement *p_func_ptr_element) { - // None of these checks should ever fail, unless there's a bug. - // They can be removed once we are sure they never catch anything. - // Left here now due to extra safety needs late in the release cycle. - ERR_FAIL_NULL(p_func_ptr_element); - MutexLock lock(*p_func_ptr_element->mutex); - ERR_FAIL_NULL(p_func_ptr_element->element); - ERR_FAIL_NULL(p_func_ptr_element->mutex); - p_func_ptr_element->element->erase(); +void GDScript::_remove_func_ptr_to_update(const UpdatableFuncPtrElement &p_func_ptr_element) { + ERR_FAIL_NULL(p_func_ptr_element.element); + ERR_FAIL_NULL(p_func_ptr_element.func_ptr); + MutexLock lock(p_func_ptr_element.func_ptr->mutex); + p_func_ptr_element.element->erase(); } void GDScript::_fixup_thread_function_bookkeeping() { // Transfer the ownership of these update items to the main thread, // because the current one is dying, leaving theirs orphan, dangling. - HashSet<GDScript *> scripts; - DEV_ASSERT(!Thread::is_main_thread()); - MutexLock lock(func_ptrs_to_update_main_thread->mutex); - { - MutexLock lock2(func_ptrs_to_update_thread_local.mutex); - - while (!func_ptrs_to_update_thread_local.ptrs.is_empty()) { - // Transfer the thread-to-script records from the dying thread to the main one. - - List<GDScriptFunction **>::Element *E = func_ptrs_to_update_thread_local.ptrs.front(); - List<GDScriptFunction **>::Element *new_E = func_ptrs_to_update_main_thread->ptrs.push_front(E->get()); - - GDScript *script = (*E->get())->get_script(); - if (!scripts.has(script)) { - scripts.insert(script); - - // Replace dying thread by the main thread in the script-to-thread records. - - MutexLock lock3(script->func_ptrs_to_update_mutex); - DEV_ASSERT(script->func_ptrs_to_update.find(&func_ptrs_to_update_thread_local)); - { - for (List<UpdatableFuncPtrElement>::Element *F = script->func_ptrs_to_update_elems.front(); F; F = F->next()) { - bool is_dying_thread_entry = F->get().mutex == &func_ptrs_to_update_thread_local.mutex; - if (is_dying_thread_entry) { - // This may lead to multiple main-thread entries, but that's not a problem - // and allows to reuse the element, which is needed, since it's tracked by pointer. - F->get().element = new_E; - F->get().mutex = &func_ptrs_to_update_main_thread->mutex; - } - } - } - } + MutexLock lock(func_ptrs_to_update_main_thread.mutex); + MutexLock lock2(func_ptrs_to_update_thread_local->mutex); - E->erase(); - } - } - func_ptrs_to_update_main_thread->initialized = true; - - { - // Remove orphan thread-to-script entries from every script. - // FIXME: This involves iterating through every script whenever a thread dies. - // While it's OK that thread creation/destruction are heavy operations, - // additional bookkeeping can be used to outperform this brute-force approach. - - GDScriptLanguage *gd_lang = GDScriptLanguage::get_singleton(); - - MutexLock lock2(gd_lang->mutex); - - for (SelfList<GDScript> *s = gd_lang->script_list.first(); s; s = s->next()) { - GDScript *script = s->self(); - for (List<UpdatableFuncPtr *>::Element *E = script->func_ptrs_to_update.front(); E; E = E->next()) { - bool is_dying_thread_entry = &E->get()->mutex == &func_ptrs_to_update_thread_local.mutex; - if (is_dying_thread_entry) { - E->erase(); - break; - } - } - } + while (!func_ptrs_to_update_thread_local->ptrs.is_empty()) { + List<GDScriptFunction **>::Element *E = func_ptrs_to_update_thread_local->ptrs.front(); + E->transfer_to_back(&func_ptrs_to_update_main_thread.ptrs); + func_ptrs_to_update_thread_local->transferred = true; } } @@ -1514,12 +1449,29 @@ void GDScript::clear(ClearData *p_clear_data) { { MutexLock outer_lock(func_ptrs_to_update_mutex); for (UpdatableFuncPtr *updatable : func_ptrs_to_update) { - MutexLock inner_lock(updatable->mutex); - for (GDScriptFunction **func_ptr_ptr : updatable->ptrs) { - *func_ptr_ptr = nullptr; + bool destroy = false; + { + MutexLock inner_lock(updatable->mutex); + if (updatable->transferred) { + func_ptrs_to_update_main_thread.mutex.lock(); + } + for (GDScriptFunction **func_ptr_ptr : updatable->ptrs) { + *func_ptr_ptr = nullptr; + } + DEV_ASSERT(updatable->rc != 0); + updatable->rc--; + if (updatable->rc == 0) { + destroy = true; + } + if (updatable->transferred) { + func_ptrs_to_update_main_thread.mutex.unlock(); + } + } + if (destroy) { + DEV_ASSERT(updatable != &func_ptrs_to_update_main_thread); + memdelete(updatable); } } - func_ptrs_to_update_elems.clear(); } RBSet<GDScript *> must_clear_dependencies = get_must_clear_dependencies(); @@ -2139,8 +2091,31 @@ void GDScriptLanguage::remove_named_global_constant(const StringName &p_name) { named_globals.erase(p_name); } +void GDScriptLanguage::thread_enter() { + GDScript::func_ptrs_to_update_thread_local = memnew(GDScript::UpdatableFuncPtr); +} + void GDScriptLanguage::thread_exit() { + // This thread may have been created before GDScript was up + // (which also means it can't have run any GDScript code at all). + if (!GDScript::func_ptrs_to_update_thread_local) { + return; + } + GDScript::_fixup_thread_function_bookkeeping(); + + bool destroy = false; + { + MutexLock lock(GDScript::func_ptrs_to_update_thread_local->mutex); + DEV_ASSERT(GDScript::func_ptrs_to_update_thread_local->rc != 0); + GDScript::func_ptrs_to_update_thread_local->rc--; + if (GDScript::func_ptrs_to_update_thread_local->rc == 0) { + destroy = true; + } + } + if (destroy) { + memdelete(GDScript::func_ptrs_to_update_thread_local); + } } void GDScriptLanguage::init() { @@ -2175,6 +2150,8 @@ void GDScriptLanguage::init() { _add_global(E.name, E.ptr); } + GDScript::func_ptrs_to_update_thread_local = &GDScript::func_ptrs_to_update_main_thread; + #ifdef TESTS_ENABLED GDScriptTests::GDScriptTestRunner::handle_cmdline(); #endif @@ -2224,6 +2201,8 @@ void GDScriptLanguage::finish() { } script_list.clear(); function_list.clear(); + + DEV_ASSERT(GDScript::func_ptrs_to_update_main_thread.rc == 1); } void GDScriptLanguage::profiling_start() { @@ -2340,6 +2319,19 @@ void GDScriptLanguage::reload_all_scripts() { } elem = elem->next(); } + +#ifdef TOOLS_ENABLED + if (Engine::get_singleton()->is_editor_hint()) { + // Reload all pointers to existing singletons so that tool scripts can work with the reloaded extensions. + List<Engine::Singleton> singletons; + Engine::get_singleton()->get_singletons(&singletons); + for (const Engine::Singleton &E : singletons) { + if (globals.has(E.name)) { + _add_global(E.name, E.ptr); + } + } + } +#endif } //as scripts are going to be reloaded, must proceed without locking here diff --git a/modules/gdscript/gdscript.h b/modules/gdscript/gdscript.h index 9b99f5ca0b..5165ec1b06 100644 --- a/modules/gdscript/gdscript.h +++ b/modules/gdscript/gdscript.h @@ -121,21 +121,23 @@ class GDScript : public Script { struct UpdatableFuncPtr { List<GDScriptFunction **> ptrs; Mutex mutex; - bool initialized = false; + bool initialized : 1; + bool transferred : 1; + uint32_t rc = 1; + UpdatableFuncPtr() : + initialized(false), transferred(false) {} }; struct UpdatableFuncPtrElement { List<GDScriptFunction **>::Element *element = nullptr; - Mutex *mutex = nullptr; + UpdatableFuncPtr *func_ptr = nullptr; }; - static thread_local UpdatableFuncPtr func_ptrs_to_update_thread_local; - static thread_local LocalVector<List<UpdatableFuncPtr *>::Element> func_ptrs_to_update_entries_thread_local; - static UpdatableFuncPtr *func_ptrs_to_update_main_thread; + static UpdatableFuncPtr func_ptrs_to_update_main_thread; + static thread_local UpdatableFuncPtr *func_ptrs_to_update_thread_local; List<UpdatableFuncPtr *> func_ptrs_to_update; - List<UpdatableFuncPtrElement> func_ptrs_to_update_elems; Mutex func_ptrs_to_update_mutex; - UpdatableFuncPtrElement *_add_func_ptr_to_update(GDScriptFunction **p_func_ptr_ptr); - static void _remove_func_ptr_to_update(const UpdatableFuncPtrElement *p_func_ptr_element); + UpdatableFuncPtrElement _add_func_ptr_to_update(GDScriptFunction **p_func_ptr_ptr); + static void _remove_func_ptr_to_update(const UpdatableFuncPtrElement &p_func_ptr_element); static void _fixup_thread_function_bookkeeping(); @@ -252,7 +254,7 @@ public: const Ref<GDScriptNativeClass> &get_native() const { return native; } RBSet<GDScript *> get_dependencies(); - RBSet<GDScript *> get_inverted_dependencies(); + HashMap<GDScript *, RBSet<GDScript *>> get_all_dependencies(); RBSet<GDScript *> get_must_clear_dependencies(); virtual bool has_script_signal(const StringName &p_signal) const override; @@ -561,6 +563,7 @@ public: /* MULTITHREAD FUNCTIONS */ + virtual void thread_enter() override; virtual void thread_exit() override; /* DEBUGGER FUNCTIONS */ diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp index 983a19470a..55bd0f97d5 100644 --- a/modules/gdscript/gdscript_analyzer.cpp +++ b/modules/gdscript/gdscript_analyzer.cpp @@ -685,10 +685,10 @@ GDScriptParser::DataType GDScriptAnalyzer::resolve_datatype(GDScriptParser::Type result.builtin_type = GDScriptParser::get_builtin_type(first); if (result.builtin_type == Variant::ARRAY) { - GDScriptParser::DataType container_type = type_from_metatype(resolve_datatype(p_type->container_type)); + GDScriptParser::DataType container_type = type_from_metatype(resolve_datatype(p_type->get_container_type_or_null(0))); if (container_type.kind != GDScriptParser::DataType::VARIANT) { container_type.is_constant = false; - result.set_container_element_type(container_type); + result.set_container_element_type(0, container_type); } } } else if (class_exists(first)) { @@ -829,8 +829,16 @@ GDScriptParser::DataType GDScriptAnalyzer::resolve_datatype(GDScriptParser::Type } } - if (result.builtin_type != Variant::ARRAY && p_type->container_type != nullptr) { - push_error("Only arrays can specify the collection element type.", p_type); + if (!p_type->container_types.is_empty()) { + if (result.builtin_type == Variant::ARRAY) { + if (p_type->container_types.size() != 1) { + push_error("Arrays require exactly one collection element type.", p_type); + return bad_type; + } + } else { + push_error("Only arrays can specify collection element types.", p_type); + return bad_type; + } } p_type->set_datatype(result); @@ -1891,8 +1899,8 @@ void GDScriptAnalyzer::resolve_assignable(GDScriptParser::AssignableNode *p_assi if (p_assignable->initializer->type == GDScriptParser::Node::ARRAY) { GDScriptParser::ArrayNode *array = static_cast<GDScriptParser::ArrayNode *>(p_assignable->initializer); - if (has_specified_type && specified_type.has_container_element_type()) { - update_array_literal_element_type(array, specified_type.get_container_element_type()); + if (has_specified_type && specified_type.has_container_element_type(0)) { + update_array_literal_element_type(array, specified_type.get_container_element_type(0)); } } @@ -1955,7 +1963,7 @@ void GDScriptAnalyzer::resolve_assignable(GDScriptParser::AssignableNode *p_assi } else { push_error(vformat(R"(Cannot assign a value of type %s to %s "%s" with specified type %s.)", initializer_type.to_string(), p_kind, p_assignable->identifier->name, specified_type.to_string()), p_assignable->initializer); } - } else if (specified_type.has_container_element_type() && !initializer_type.has_container_element_type()) { + } else if (specified_type.has_container_element_type(0) && !initializer_type.has_container_element_type(0)) { mark_node_unsafe(p_assignable->initializer); #ifdef DEBUG_ENABLED } else if (specified_type.builtin_type == Variant::INT && initializer_type.builtin_type == Variant::FLOAT) { @@ -2127,8 +2135,8 @@ void GDScriptAnalyzer::resolve_for(GDScriptParser::ForNode *p_for) { if (list_type.is_variant()) { variable_type.kind = GDScriptParser::DataType::VARIANT; mark_node_unsafe(p_for->list); - } else if (list_type.has_container_element_type()) { - variable_type = list_type.get_container_element_type(); + } else if (list_type.has_container_element_type(0)) { + variable_type = list_type.get_container_element_type(0); variable_type.type_source = list_type.type_source; } else if (list_type.is_typed_container_type()) { variable_type = list_type.get_typed_container_type(); @@ -2377,8 +2385,8 @@ void GDScriptAnalyzer::resolve_return(GDScriptParser::ReturnNode *p_return) { result.builtin_type = Variant::NIL; result.is_constant = true; } else { - if (p_return->return_value->type == GDScriptParser::Node::ARRAY && has_expected_type && expected_type.has_container_element_type()) { - update_array_literal_element_type(static_cast<GDScriptParser::ArrayNode *>(p_return->return_value), expected_type.get_container_element_type()); + if (p_return->return_value->type == GDScriptParser::Node::ARRAY && has_expected_type && expected_type.has_container_element_type(0)) { + update_array_literal_element_type(static_cast<GDScriptParser::ArrayNode *>(p_return->return_value), expected_type.get_container_element_type(0)); } if (has_expected_type && expected_type.is_hard_type() && p_return->return_value->is_constant) { update_const_expression_builtin_type(p_return->return_value, expected_type, "return"); @@ -2598,7 +2606,7 @@ void GDScriptAnalyzer::update_const_expression_builtin_type(GDScriptParser::Expr // This function determines which type is that (if any). void GDScriptAnalyzer::update_array_literal_element_type(GDScriptParser::ArrayNode *p_array, const GDScriptParser::DataType &p_element_type) { GDScriptParser::DataType expected_type = p_element_type; - expected_type.unset_container_element_type(); // Nested types (like `Array[Array[int]]`) are not currently supported. + expected_type.container_element_types.clear(); // Nested types (like `Array[Array[int]]`) are not currently supported. for (int i = 0; i < p_array->elements.size(); i++) { GDScriptParser::ExpressionNode *element_node = p_array->elements[i]; @@ -2621,7 +2629,7 @@ void GDScriptAnalyzer::update_array_literal_element_type(GDScriptParser::ArrayNo } GDScriptParser::DataType array_type = p_array->get_datatype(); - array_type.set_container_element_type(expected_type); + array_type.set_container_element_type(0, expected_type); p_array->set_datatype(array_type); } @@ -2668,8 +2676,8 @@ void GDScriptAnalyzer::reduce_assignment(GDScriptParser::AssignmentNode *p_assig } // Check if assigned value is an array literal, so we can make it a typed array too if appropriate. - if (p_assignment->assigned_value->type == GDScriptParser::Node::ARRAY && assignee_type.is_hard_type() && assignee_type.has_container_element_type()) { - update_array_literal_element_type(static_cast<GDScriptParser::ArrayNode *>(p_assignment->assigned_value), assignee_type.get_container_element_type()); + if (p_assignment->assigned_value->type == GDScriptParser::Node::ARRAY && assignee_type.is_hard_type() && assignee_type.has_container_element_type(0)) { + update_array_literal_element_type(static_cast<GDScriptParser::ArrayNode *>(p_assignment->assigned_value), assignee_type.get_container_element_type(0)); } if (p_assignment->operation == GDScriptParser::AssignmentNode::OP_NONE && assignee_type.is_hard_type() && p_assignment->assigned_value->is_constant) { @@ -2747,7 +2755,7 @@ void GDScriptAnalyzer::reduce_assignment(GDScriptParser::AssignmentNode *p_assig // weak non-variant assignee and incompatible result downgrades_assignee = true; } - } else if (assignee_type.has_container_element_type() && !op_type.has_container_element_type()) { + } else if (assignee_type.has_container_element_type(0) && !op_type.has_container_element_type(0)) { // typed array assignee and untyped array result mark_node_unsafe(p_assignment); } @@ -3311,8 +3319,8 @@ void GDScriptAnalyzer::reduce_call(GDScriptParser::CallNode *p_call, bool p_is_a // If the function requires typed arrays we must make literals be typed. for (const KeyValue<int, GDScriptParser::ArrayNode *> &E : arrays) { int index = E.key; - if (index < par_types.size() && par_types[index].is_hard_type() && par_types[index].has_container_element_type()) { - update_array_literal_element_type(E.value, par_types[index].get_container_element_type()); + if (index < par_types.size() && par_types[index].is_hard_type() && par_types[index].has_container_element_type(0)) { + update_array_literal_element_type(E.value, par_types[index].get_container_element_type(0)); } } validate_call_arg(par_types, default_arg_count, method_flags.has_flag(METHOD_FLAG_VARARG), p_call); @@ -3444,8 +3452,8 @@ void GDScriptAnalyzer::reduce_cast(GDScriptParser::CastNode *p_cast) { } } - if (p_cast->operand->type == GDScriptParser::Node::ARRAY && cast_type.has_container_element_type()) { - update_array_literal_element_type(static_cast<GDScriptParser::ArrayNode *>(p_cast->operand), cast_type.get_container_element_type()); + if (p_cast->operand->type == GDScriptParser::Node::ARRAY && cast_type.has_container_element_type(0)) { + update_array_literal_element_type(static_cast<GDScriptParser::ArrayNode *>(p_cast->operand), cast_type.get_container_element_type(0)); } if (!cast_type.is_variant()) { @@ -4432,8 +4440,8 @@ void GDScriptAnalyzer::reduce_subscript(GDScriptParser::SubscriptNode *p_subscri break; // Can have an element type. case Variant::ARRAY: - if (base_type.has_container_element_type()) { - result_type = base_type.get_container_element_type(); + if (base_type.has_container_element_type(0)) { + result_type = base_type.get_container_element_type(0); result_type.type_source = base_type.type_source; } else { result_type.kind = GDScriptParser::DataType::VARIANT; @@ -4597,7 +4605,7 @@ Variant GDScriptAnalyzer::make_expression_reduced_value(GDScriptParser::Expressi } Variant GDScriptAnalyzer::make_array_reduced_value(GDScriptParser::ArrayNode *p_array, bool &is_reduced) { - Array array = p_array->get_datatype().has_container_element_type() ? make_array_from_element_datatype(p_array->get_datatype().get_container_element_type()) : Array(); + Array array = p_array->get_datatype().has_container_element_type(0) ? make_array_from_element_datatype(p_array->get_datatype().get_container_element_type(0)) : Array(); array.resize(p_array->elements.size()); for (int i = 0; i < p_array->elements.size(); i++) { @@ -4719,8 +4727,8 @@ Variant GDScriptAnalyzer::make_variable_default_value(GDScriptParser::VariableNo GDScriptParser::DataType datatype = p_variable->get_datatype(); if (datatype.is_hard_type()) { if (datatype.kind == GDScriptParser::DataType::BUILTIN && datatype.builtin_type != Variant::OBJECT) { - if (datatype.builtin_type == Variant::ARRAY && datatype.has_container_element_type()) { - result = make_array_from_element_datatype(datatype.get_container_element_type()); + if (datatype.builtin_type == Variant::ARRAY && datatype.has_container_element_type(0)) { + result = make_array_from_element_datatype(datatype.get_container_element_type(0)); } else { VariantInternal::initialize(&result, datatype.builtin_type); } @@ -4747,11 +4755,11 @@ GDScriptParser::DataType GDScriptAnalyzer::type_from_variant(const Variant &p_va if (p_value.get_type() == Variant::ARRAY) { const Array &array = p_value; if (array.get_typed_script()) { - result.set_container_element_type(type_from_metatype(make_script_meta_type(array.get_typed_script()))); + result.set_container_element_type(0, type_from_metatype(make_script_meta_type(array.get_typed_script()))); } else if (array.get_typed_class_name()) { - result.set_container_element_type(type_from_metatype(make_native_meta_type(array.get_typed_class_name()))); + result.set_container_element_type(0, type_from_metatype(make_native_meta_type(array.get_typed_class_name()))); } else if (array.get_typed_builtin() != Variant::NIL) { - result.set_container_element_type(type_from_metatype(make_builtin_meta_type((Variant::Type)array.get_typed_builtin()))); + result.set_container_element_type(0, type_from_metatype(make_builtin_meta_type((Variant::Type)array.get_typed_builtin()))); } } else if (p_value.get_type() == Variant::OBJECT) { // Object is treated as a native type, not a builtin type. @@ -4873,7 +4881,7 @@ GDScriptParser::DataType GDScriptAnalyzer::type_from_property(const PropertyInfo ERR_FAIL_V_MSG(result, "Could not find element type from property hint of a typed array."); } elem_type.is_constant = false; - result.set_container_element_type(elem_type); + result.set_container_element_type(0, elem_type); } else if (p_property.type == Variant::INT) { // Check if it's enum. if ((p_property.usage & PROPERTY_USAGE_CLASS_IS_ENUM) && p_property.class_name != StringName()) { @@ -5225,7 +5233,7 @@ GDScriptParser::DataType GDScriptAnalyzer::get_operation_type(Variant::Operator bool hard_operation = p_a.is_hard_type() && p_b.is_hard_type(); if (p_operation == Variant::OP_ADD && a_type == Variant::ARRAY && b_type == Variant::ARRAY) { - if (p_a.has_container_element_type() && p_b.has_container_element_type() && p_a.get_container_element_type() == p_b.get_container_element_type()) { + if (p_a.has_container_element_type(0) && p_b.has_container_element_type(0) && p_a.get_container_element_type(0) == p_b.get_container_element_type(0)) { r_valid = true; result = p_a; result.type_source = hard_operation ? GDScriptParser::DataType::ANNOTATED_INFERRED : GDScriptParser::DataType::INFERRED; @@ -5276,8 +5284,8 @@ bool GDScriptAnalyzer::is_type_compatible(const GDScriptParser::DataType &p_targ } if (valid && p_target.builtin_type == Variant::ARRAY && p_source.builtin_type == Variant::ARRAY) { // Check the element type. - if (p_target.has_container_element_type() && p_source.has_container_element_type()) { - valid = p_target.get_container_element_type() == p_source.get_container_element_type(); + if (p_target.has_container_element_type(0) && p_source.has_container_element_type(0)) { + valid = p_target.get_container_element_type(0) == p_source.get_container_element_type(0); } } return valid; diff --git a/modules/gdscript/gdscript_byte_codegen.cpp b/modules/gdscript/gdscript_byte_codegen.cpp index 25e20c0e76..27766115d5 100644 --- a/modules/gdscript/gdscript_byte_codegen.cpp +++ b/modules/gdscript/gdscript_byte_codegen.cpp @@ -623,8 +623,8 @@ void GDScriptByteCodeGenerator::write_binary_operator(const Address &p_target, V void GDScriptByteCodeGenerator::write_type_test(const Address &p_target, const Address &p_source, const GDScriptDataType &p_type) { switch (p_type.kind) { case GDScriptDataType::BUILTIN: { - if (p_type.builtin_type == Variant::ARRAY && p_type.has_container_element_type()) { - const GDScriptDataType &element_type = p_type.get_container_element_type(); + if (p_type.builtin_type == Variant::ARRAY && p_type.has_container_element_type(0)) { + const GDScriptDataType &element_type = p_type.get_container_element_type(0); append_opcode(GDScriptFunction::OPCODE_TYPE_TEST_ARRAY); append(p_target); append(p_source); @@ -878,8 +878,8 @@ void GDScriptByteCodeGenerator::write_get_static_variable(const Address &p_targe void GDScriptByteCodeGenerator::write_assign_with_conversion(const Address &p_target, const Address &p_source) { switch (p_target.type.kind) { case GDScriptDataType::BUILTIN: { - if (p_target.type.builtin_type == Variant::ARRAY && p_target.type.has_container_element_type()) { - const GDScriptDataType &element_type = p_target.type.get_container_element_type(); + if (p_target.type.builtin_type == Variant::ARRAY && p_target.type.has_container_element_type(0)) { + const GDScriptDataType &element_type = p_target.type.get_container_element_type(0); append_opcode(GDScriptFunction::OPCODE_ASSIGN_TYPED_ARRAY); append(p_target); append(p_source); @@ -924,8 +924,8 @@ void GDScriptByteCodeGenerator::write_assign_with_conversion(const Address &p_ta } void GDScriptByteCodeGenerator::write_assign(const Address &p_target, const Address &p_source) { - if (p_target.type.kind == GDScriptDataType::BUILTIN && p_target.type.builtin_type == Variant::ARRAY && p_target.type.has_container_element_type()) { - const GDScriptDataType &element_type = p_target.type.get_container_element_type(); + if (p_target.type.kind == GDScriptDataType::BUILTIN && p_target.type.builtin_type == Variant::ARRAY && p_target.type.has_container_element_type(0)) { + const GDScriptDataType &element_type = p_target.type.get_container_element_type(0); append_opcode(GDScriptFunction::OPCODE_ASSIGN_TYPED_ARRAY); append(p_target); append(p_source); @@ -1666,9 +1666,9 @@ void GDScriptByteCodeGenerator::write_return(const Address &p_return_value) { // If this is a typed function, then we need to check for potential conversions. if (function->return_type.has_type) { - if (function->return_type.kind == GDScriptDataType::BUILTIN && function->return_type.builtin_type == Variant::ARRAY && function->return_type.has_container_element_type()) { + if (function->return_type.kind == GDScriptDataType::BUILTIN && function->return_type.builtin_type == Variant::ARRAY && function->return_type.has_container_element_type(0)) { // Typed array. - const GDScriptDataType &element_type = function->return_type.get_container_element_type(); + const GDScriptDataType &element_type = function->return_type.get_container_element_type(0); append_opcode(GDScriptFunction::OPCODE_RETURN_TYPED_ARRAY); append(p_return_value); append(get_constant_pos(element_type.script_type) | (GDScriptFunction::ADDR_TYPE_CONSTANT << GDScriptFunction::ADDR_BITS)); @@ -1691,8 +1691,8 @@ void GDScriptByteCodeGenerator::write_return(const Address &p_return_value) { } else { switch (function->return_type.kind) { case GDScriptDataType::BUILTIN: { - if (function->return_type.builtin_type == Variant::ARRAY && function->return_type.has_container_element_type()) { - const GDScriptDataType &element_type = function->return_type.get_container_element_type(); + if (function->return_type.builtin_type == Variant::ARRAY && function->return_type.has_container_element_type(0)) { + const GDScriptDataType &element_type = function->return_type.get_container_element_type(0); append_opcode(GDScriptFunction::OPCODE_RETURN_TYPED_ARRAY); append(p_return_value); append(get_constant_pos(element_type.script_type) | (GDScriptFunction::ADDR_TYPE_CONSTANT << GDScriptFunction::ADDR_BITS)); diff --git a/modules/gdscript/gdscript_compiler.cpp b/modules/gdscript/gdscript_compiler.cpp index 7980f020b8..9560f670e6 100644 --- a/modules/gdscript/gdscript_compiler.cpp +++ b/modules/gdscript/gdscript_compiler.cpp @@ -196,8 +196,8 @@ GDScriptDataType GDScriptCompiler::_gdtype_from_datatype(const GDScriptParser::D } } - if (p_datatype.has_container_element_type()) { - result.set_container_element_type(_gdtype_from_datatype(p_datatype.get_container_element_type(), p_owner, false)); + for (int i = 0; i < p_datatype.container_element_types.size(); i++) { + result.set_container_element_type(i, _gdtype_from_datatype(p_datatype.get_container_element_type_or_variant(i), p_owner, false)); } return result; @@ -507,8 +507,8 @@ GDScriptCodeGenerator::Address GDScriptCompiler::_parse_expression(CodeGen &code values.push_back(val); } - if (array_type.has_container_element_type()) { - gen->write_construct_typed_array(result, array_type.get_container_element_type(), values); + if (array_type.has_container_element_type(0)) { + gen->write_construct_typed_array(result, array_type.get_container_element_type(0), values); } else { gen->write_construct_array(result, values); } @@ -2133,8 +2133,8 @@ Error GDScriptCompiler::_parse_block(CodeGen &codegen, const GDScriptParser::Sui initialized = true; } else if (local_type.has_type) { // Initialize with default for type. - if (local_type.has_container_element_type()) { - codegen.generator->write_construct_typed_array(local, local_type.get_container_element_type(), Vector<GDScriptCodeGenerator::Address>()); + if (local_type.has_container_element_type(0)) { + codegen.generator->write_construct_typed_array(local, local_type.get_container_element_type(0), Vector<GDScriptCodeGenerator::Address>()); initialized = true; } else if (local_type.kind == GDScriptDataType::BUILTIN) { codegen.generator->write_construct(local, local_type.builtin_type, Vector<GDScriptCodeGenerator::Address>()); @@ -2276,8 +2276,8 @@ GDScriptFunction *GDScriptCompiler::_parse_function(Error &r_error, GDScript *p_ GDScriptCodeGenerator::Address dst_address(GDScriptCodeGenerator::Address::MEMBER, codegen.script->member_indices[field->identifier->name].index, field_type); - if (field_type.has_container_element_type()) { - codegen.generator->write_construct_typed_array(dst_address, field_type.get_container_element_type(), Vector<GDScriptCodeGenerator::Address>()); + if (field_type.has_container_element_type(0)) { + codegen.generator->write_construct_typed_array(dst_address, field_type.get_container_element_type(0), Vector<GDScriptCodeGenerator::Address>()); } else if (field_type.kind == GDScriptDataType::BUILTIN) { codegen.generator->write_construct(dst_address, field_type.builtin_type, Vector<GDScriptCodeGenerator::Address>()); } @@ -2466,9 +2466,9 @@ GDScriptFunction *GDScriptCompiler::_make_static_initializer(Error &r_error, GDS if (field_type.has_type) { codegen.generator->write_newline(field->start_line); - if (field_type.has_container_element_type()) { + if (field_type.has_container_element_type(0)) { GDScriptCodeGenerator::Address temp = codegen.add_temporary(field_type); - codegen.generator->write_construct_typed_array(temp, field_type.get_container_element_type(), Vector<GDScriptCodeGenerator::Address>()); + codegen.generator->write_construct_typed_array(temp, field_type.get_container_element_type(0), Vector<GDScriptCodeGenerator::Address>()); codegen.generator->write_set_static_variable(temp, class_addr, p_script->static_variables_indices[field->identifier->name].index); codegen.generator->pop_temporary(); } else if (field_type.kind == GDScriptDataType::BUILTIN) { diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index 724715d9e5..87617cafab 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -1083,6 +1083,12 @@ static void _find_identifiers_in_base(const GDScriptCompletionIdentifier &p_base List<PropertyInfo> members; scr->get_script_property_list(&members); for (const PropertyInfo &E : members) { + if (E.usage & (PROPERTY_USAGE_CATEGORY | PROPERTY_USAGE_GROUP | PROPERTY_USAGE_SUBGROUP)) { + continue; + } + if (E.name.contains("/")) { + continue; + } int location = p_recursion_depth + _get_property_location(scr->get_class_name(), E.name); ScriptLanguage::CodeCompletionOption option(E.name, ScriptLanguage::CODE_COMPLETION_KIND_MEMBER, location); r_result.insert(option.display, option); @@ -1152,7 +1158,7 @@ static void _find_identifiers_in_base(const GDScriptCompletionIdentifier &p_base List<PropertyInfo> pinfo; ClassDB::get_property_list(type, &pinfo); for (const PropertyInfo &E : pinfo) { - if (E.usage & (PROPERTY_USAGE_GROUP | PROPERTY_USAGE_CATEGORY)) { + if (E.usage & (PROPERTY_USAGE_CATEGORY | PROPERTY_USAGE_GROUP | PROPERTY_USAGE_SUBGROUP)) { continue; } if (E.name.contains("/")) { @@ -1213,6 +1219,9 @@ static void _find_identifiers_in_base(const GDScriptCompletionIdentifier &p_base } for (const PropertyInfo &E : members) { + if (E.usage & (PROPERTY_USAGE_CATEGORY | PROPERTY_USAGE_GROUP | PROPERTY_USAGE_SUBGROUP)) { + continue; + } if (!String(E.name).contains("/")) { ScriptLanguage::CodeCompletionOption option(E.name, ScriptLanguage::CODE_COMPLETION_KIND_MEMBER); if (GDScriptParser::theme_color_names.has(E.name)) { @@ -2601,6 +2610,64 @@ static void _find_call_arguments(GDScriptParser::CompletionContext &p_context, c r_arghint = _make_arguments_hint(info, p_argidx); } + if (p_argidx == 1 && p_context.node && p_context.node->type == GDScriptParser::Node::CALL && ClassDB::is_parent_class(class_name, SNAME("Tween")) && p_method == SNAME("tween_property")) { + // Get tweened objects properties. + GDScriptParser::ExpressionNode *tweened_object = static_cast<GDScriptParser::CallNode *>(p_context.node)->arguments[0]; + StringName native_type = tweened_object->datatype.native_type; + switch (tweened_object->datatype.kind) { + case GDScriptParser::DataType::SCRIPT: { + Ref<Script> script = tweened_object->datatype.script_type; + native_type = script->get_instance_base_type(); + int n = 0; + while (script.is_valid()) { + List<PropertyInfo> properties; + script->get_script_property_list(&properties); + for (const PropertyInfo &E : properties) { + if (E.usage & (PROPERTY_USAGE_SUBGROUP | PROPERTY_USAGE_GROUP | PROPERTY_USAGE_CATEGORY | PROPERTY_USAGE_INTERNAL)) { + continue; + } + ScriptLanguage::CodeCompletionOption option(E.name.quote(quote_style), ScriptLanguage::CODE_COMPLETION_KIND_MEMBER, ScriptLanguage::CodeCompletionLocation::LOCATION_LOCAL + n); + r_result.insert(option.display, option); + } + script = script->get_base_script(); + n++; + } + } break; + case GDScriptParser::DataType::CLASS: { + GDScriptParser::ClassNode *clss = tweened_object->datatype.class_type; + native_type = clss->base_type.native_type; + int n = 0; + while (clss) { + for (GDScriptParser::ClassNode::Member member : clss->members) { + if (member.type == GDScriptParser::ClassNode::Member::VARIABLE) { + ScriptLanguage::CodeCompletionOption option(member.get_name().quote(quote_style), ScriptLanguage::CODE_COMPLETION_KIND_MEMBER, ScriptLanguage::CodeCompletionLocation::LOCATION_LOCAL + n); + r_result.insert(option.display, option); + } + } + if (clss->base_type.kind == GDScriptParser::DataType::Kind::CLASS) { + clss = clss->base_type.class_type; + n++; + } else { + native_type = clss->base_type.native_type; + clss = nullptr; + } + } + } break; + default: + break; + } + + List<PropertyInfo> properties; + ClassDB::get_property_list(native_type, &properties); + for (const PropertyInfo &E : properties) { + if (E.usage & (PROPERTY_USAGE_SUBGROUP | PROPERTY_USAGE_GROUP | PROPERTY_USAGE_CATEGORY | PROPERTY_USAGE_INTERNAL)) { + continue; + } + ScriptLanguage::CodeCompletionOption option(E.name.quote(quote_style), ScriptLanguage::CODE_COMPLETION_KIND_MEMBER); + r_result.insert(option.display, option); + } + } + if (p_argidx == 0 && ClassDB::is_parent_class(class_name, SNAME("Node")) && (p_method == SNAME("get_node") || p_method == SNAME("has_node"))) { // Get autoloads List<PropertyInfo> props; @@ -2667,6 +2734,7 @@ static bool _get_subscript_type(GDScriptParser::CompletionContext &p_context, co if (p_context.base == nullptr) { return false; } + const GDScriptParser::GetNodeNode *get_node = nullptr; switch (p_subscript->base->type) { @@ -2675,6 +2743,11 @@ static bool _get_subscript_type(GDScriptParser::CompletionContext &p_context, co } break; case GDScriptParser::Node::IDENTIFIER: { + if (p_subscript->base->datatype.type_source == GDScriptParser::DataType::ANNOTATED_EXPLICIT) { + // Annotated type takes precedence. + return false; + } + const GDScriptParser::IdentifierNode *identifier_node = static_cast<GDScriptParser::IdentifierNode *>(p_subscript->base); switch (identifier_node->source) { @@ -2715,10 +2788,19 @@ static bool _get_subscript_type(GDScriptParser::CompletionContext &p_context, co if (r_base != nullptr) { *r_base = node; } - r_base_type.type_source = GDScriptParser::DataType::ANNOTATED_EXPLICIT; - r_base_type.kind = GDScriptParser::DataType::NATIVE; + + r_base_type.type_source = GDScriptParser::DataType::INFERRED; r_base_type.builtin_type = Variant::OBJECT; r_base_type.native_type = node->get_class_name(); + + Ref<Script> scr = node->get_script(); + if (scr.is_null()) { + r_base_type.kind = GDScriptParser::DataType::NATIVE; + } else { + r_base_type.kind = GDScriptParser::DataType::SCRIPT; + r_base_type.script_type = scr; + } + return true; } } @@ -2745,8 +2827,6 @@ static void _find_call_arguments(GDScriptParser::CompletionContext &p_context, c const GDScriptParser::CallNode *call = static_cast<const GDScriptParser::CallNode *>(p_call); GDScriptParser::Node::Type callee_type = call->get_callee_type(); - GDScriptCompletionIdentifier connect_base; - if (callee_type == GDScriptParser::Node::SUBSCRIPT) { const GDScriptParser::SubscriptNode *subscript = static_cast<const GDScriptParser::SubscriptNode *>(call->callee); diff --git a/modules/gdscript/gdscript_function.h b/modules/gdscript/gdscript_function.h index c9b543fbb9..e63fa17cfe 100644 --- a/modules/gdscript/gdscript_function.h +++ b/modules/gdscript/gdscript_function.h @@ -45,10 +45,9 @@ class GDScriptInstance; class GDScript; class GDScriptDataType { -private: - GDScriptDataType *container_element_type = nullptr; - public: + Vector<GDScriptDataType> container_element_types; + enum Kind { UNINITIALIZED, BUILTIN, @@ -76,19 +75,20 @@ public: case BUILTIN: { Variant::Type var_type = p_variant.get_type(); bool valid = builtin_type == var_type; - if (valid && builtin_type == Variant::ARRAY && has_container_element_type()) { + if (valid && builtin_type == Variant::ARRAY && has_container_element_type(0)) { Array array = p_variant; if (array.is_typed()) { + GDScriptDataType array_container_type = get_container_element_type(0); Variant::Type array_builtin_type = (Variant::Type)array.get_typed_builtin(); StringName array_native_type = array.get_typed_class_name(); Ref<Script> array_script_type_ref = array.get_typed_script(); if (array_script_type_ref.is_valid()) { - valid = (container_element_type->kind == SCRIPT || container_element_type->kind == GDSCRIPT) && container_element_type->script_type == array_script_type_ref.ptr(); + valid = (array_container_type.kind == SCRIPT || array_container_type.kind == GDSCRIPT) && array_container_type.script_type == array_script_type_ref.ptr(); } else if (array_native_type != StringName()) { - valid = container_element_type->kind == NATIVE && container_element_type->native_type == array_native_type; + valid = array_container_type.kind == NATIVE && array_container_type.native_type == array_native_type; } else { - valid = container_element_type->kind == BUILTIN && container_element_type->builtin_type == array_builtin_type; + valid = array_container_type.kind == BUILTIN && array_container_type.builtin_type == array_builtin_type; } } else { valid = false; @@ -147,24 +147,32 @@ public: return false; } - void set_container_element_type(const GDScriptDataType &p_element_type) { - container_element_type = memnew(GDScriptDataType(p_element_type)); + void set_container_element_type(int p_index, const GDScriptDataType &p_element_type) { + ERR_FAIL_COND(p_index < 0); + while (p_index >= container_element_types.size()) { + container_element_types.push_back(GDScriptDataType()); + } + container_element_types.write[p_index] = GDScriptDataType(p_element_type); + } + + GDScriptDataType get_container_element_type(int p_index) const { + ERR_FAIL_INDEX_V(p_index, container_element_types.size(), GDScriptDataType()); + return container_element_types[p_index]; } - GDScriptDataType get_container_element_type() const { - ERR_FAIL_NULL_V(container_element_type, GDScriptDataType()); - return *container_element_type; + GDScriptDataType get_container_element_type_or_variant(int p_index) const { + if (p_index < 0 || p_index >= container_element_types.size()) { + return GDScriptDataType(); + } + return container_element_types[p_index]; } - bool has_container_element_type() const { - return container_element_type != nullptr; + bool has_container_element_type(int p_index) const { + return p_index >= 0 && p_index < container_element_types.size(); } - void unset_container_element_type() { - if (container_element_type) { - memdelete(container_element_type); - } - container_element_type = nullptr; + bool has_container_element_types() const { + return !container_element_types.is_empty(); } GDScriptDataType() = default; @@ -176,19 +184,14 @@ public: native_type = p_other.native_type; script_type = p_other.script_type; script_type_ref = p_other.script_type_ref; - unset_container_element_type(); - if (p_other.has_container_element_type()) { - set_container_element_type(p_other.get_container_element_type()); - } + container_element_types = p_other.container_element_types; } GDScriptDataType(const GDScriptDataType &p_other) { *this = p_other; } - ~GDScriptDataType() { - unset_container_element_type(); - } + ~GDScriptDataType() {} }; class GDScriptFunction { diff --git a/modules/gdscript/gdscript_lambda_callable.cpp b/modules/gdscript/gdscript_lambda_callable.cpp index 339d1ac08e..547f5607d3 100644 --- a/modules/gdscript/gdscript_lambda_callable.cpp +++ b/modules/gdscript/gdscript_lambda_callable.cpp @@ -296,7 +296,5 @@ GDScriptLambdaSelfCallable::GDScriptLambdaSelfCallable(Object *p_self, GDScriptF } GDScriptLambdaSelfCallable::~GDScriptLambdaSelfCallable() { - if (updatable_func_ptr_element) { - GDScript::_remove_func_ptr_to_update(updatable_func_ptr_element); - } + GDScript::_remove_func_ptr_to_update(updatable_func_ptr_element); } diff --git a/modules/gdscript/gdscript_lambda_callable.h b/modules/gdscript/gdscript_lambda_callable.h index d961f18852..ee7d547544 100644 --- a/modules/gdscript/gdscript_lambda_callable.h +++ b/modules/gdscript/gdscript_lambda_callable.h @@ -45,7 +45,7 @@ class GDScriptLambdaCallable : public CallableCustom { GDScriptFunction *function = nullptr; Ref<GDScript> script; uint32_t h; - GDScript::UpdatableFuncPtrElement *updatable_func_ptr_element = nullptr; + GDScript::UpdatableFuncPtrElement updatable_func_ptr_element; Vector<Variant> captures; @@ -72,7 +72,7 @@ class GDScriptLambdaSelfCallable : public CallableCustom { Ref<RefCounted> reference; // For objects that are RefCounted, keep a reference. Object *object = nullptr; // For non RefCounted objects, use a direct pointer. uint32_t h; - GDScript::UpdatableFuncPtrElement *updatable_func_ptr_element = nullptr; + GDScript::UpdatableFuncPtrElement updatable_func_ptr_element; Vector<Variant> captures; diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index db7b3e7ace..ea7abc9ded 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -3337,14 +3337,21 @@ GDScriptParser::TypeNode *GDScriptParser::parse_type(bool p_allow_void) { if (match(GDScriptTokenizer::Token::BRACKET_OPEN)) { // Typed collection (like Array[int]). - type->container_type = parse_type(false); // Don't allow void for array element type. - if (type->container_type == nullptr) { - push_error(R"(Expected type for collection after "[".)"); - complete_extents(type); - type = nullptr; - } else if (type->container_type->container_type != nullptr) { - push_error("Nested typed collections are not supported."); - } + bool first_pass = true; + do { + TypeNode *container_type = parse_type(false); // Don't allow void for element type. + if (container_type == nullptr) { + push_error(vformat(R"(Expected type for collection after "%s".)", first_pass ? "[" : ",")); + complete_extents(type); + type = nullptr; + break; + } else if (container_type->container_types.size() > 0) { + push_error("Nested typed collections are not supported."); + } else { + type->container_types.append(container_type); + } + first_pass = false; + } while (match(GDScriptTokenizer::Token::COMMA)); consume(GDScriptTokenizer::Token::BRACKET_CLOSE, R"(Expected closing "]" after collection type.)"); if (type != nullptr) { complete_extents(type); @@ -3996,8 +4003,8 @@ bool GDScriptParser::export_annotations(const AnnotationNode *p_annotation, Node variable->export_info.type = Variant::INT; } } else if (p_annotation->name == SNAME("@export_multiline")) { - if (export_type.builtin_type == Variant::ARRAY && export_type.has_container_element_type()) { - DataType inner_type = export_type.get_container_element_type(); + if (export_type.builtin_type == Variant::ARRAY && export_type.has_container_element_type(0)) { + DataType inner_type = export_type.get_container_element_type(0); if (inner_type.builtin_type != Variant::STRING) { push_error(vformat(R"("%s" annotation on arrays requires a string type but type "%s" was given instead.)", p_annotation->name.operator String(), inner_type.to_string()), variable); return false; @@ -4033,8 +4040,8 @@ bool GDScriptParser::export_annotations(const AnnotationNode *p_annotation, Node bool is_array = false; - if (export_type.builtin_type == Variant::ARRAY && export_type.has_container_element_type()) { - export_type = export_type.get_container_element_type(); // Use inner type for. + if (export_type.builtin_type == Variant::ARRAY && export_type.has_container_element_type(0)) { + export_type = export_type.get_container_element_type(0); // Use inner type for. is_array = true; } @@ -4344,8 +4351,8 @@ String GDScriptParser::DataType::to_string() const { if (builtin_type == Variant::NIL) { return "null"; } - if (builtin_type == Variant::ARRAY && has_container_element_type()) { - return vformat("Array[%s]", container_element_type->to_string()); + if (builtin_type == Variant::ARRAY && has_container_element_type(0)) { + return vformat("Array[%s]", container_element_types[0].to_string()); } return Variant::get_type_name(builtin_type); case NATIVE: @@ -4398,36 +4405,36 @@ PropertyInfo GDScriptParser::DataType::to_property_info(const String &p_name) co switch (kind) { case BUILTIN: result.type = builtin_type; - if (builtin_type == Variant::ARRAY && has_container_element_type()) { - const DataType *elem_type = container_element_type; - switch (elem_type->kind) { + if (builtin_type == Variant::ARRAY && has_container_element_type(0)) { + const DataType elem_type = get_container_element_type(0); + switch (elem_type.kind) { case BUILTIN: result.hint = PROPERTY_HINT_ARRAY_TYPE; - result.hint_string = Variant::get_type_name(elem_type->builtin_type); + result.hint_string = Variant::get_type_name(elem_type.builtin_type); break; case NATIVE: result.hint = PROPERTY_HINT_ARRAY_TYPE; - result.hint_string = elem_type->native_type; + result.hint_string = elem_type.native_type; break; case SCRIPT: result.hint = PROPERTY_HINT_ARRAY_TYPE; - if (elem_type->script_type.is_valid() && elem_type->script_type->get_global_name() != StringName()) { - result.hint_string = elem_type->script_type->get_global_name(); + if (elem_type.script_type.is_valid() && elem_type.script_type->get_global_name() != StringName()) { + result.hint_string = elem_type.script_type->get_global_name(); } else { - result.hint_string = elem_type->native_type; + result.hint_string = elem_type.native_type; } break; case CLASS: result.hint = PROPERTY_HINT_ARRAY_TYPE; - if (elem_type->class_type != nullptr && elem_type->class_type->get_global_name() != StringName()) { - result.hint_string = elem_type->class_type->get_global_name(); + if (elem_type.class_type != nullptr && elem_type.class_type->get_global_name() != StringName()) { + result.hint_string = elem_type.class_type->get_global_name(); } else { - result.hint_string = elem_type->native_type; + result.hint_string = elem_type.native_type; } break; case ENUM: result.hint = PROPERTY_HINT_ARRAY_TYPE; - result.hint_string = String(elem_type->native_type).replace("::", "."); + result.hint_string = String(elem_type.native_type).replace("::", "."); break; case VARIANT: case RESOLVING: diff --git a/modules/gdscript/gdscript_parser.h b/modules/gdscript/gdscript_parser.h index 4b46b98baa..f48ad48de0 100644 --- a/modules/gdscript/gdscript_parser.h +++ b/modules/gdscript/gdscript_parser.h @@ -101,11 +101,9 @@ public: struct WhileNode; class DataType { - private: - // Private access so we can control memory management. - DataType *container_element_type = nullptr; - public: + Vector<DataType> container_element_types; + enum Kind { BUILTIN, NATIVE, @@ -152,24 +150,39 @@ public: _FORCE_INLINE_ String to_string_strict() const { return is_hard_type() ? to_string() : "Variant"; } PropertyInfo to_property_info(const String &p_name) const; - _FORCE_INLINE_ void set_container_element_type(const DataType &p_type) { - container_element_type = memnew(DataType(p_type)); + _FORCE_INLINE_ static DataType get_variant_type() { // Default DataType for container elements. + DataType datatype; + datatype.kind = VARIANT; + datatype.type_source = INFERRED; + return datatype; } - _FORCE_INLINE_ DataType get_container_element_type() const { - ERR_FAIL_NULL_V(container_element_type, DataType()); - return *container_element_type; + _FORCE_INLINE_ void set_container_element_type(int p_index, const DataType &p_type) { + ERR_FAIL_COND(p_index < 0); + while (p_index >= container_element_types.size()) { + container_element_types.push_back(get_variant_type()); + } + container_element_types.write[p_index] = DataType(p_type); } - _FORCE_INLINE_ bool has_container_element_type() const { - return container_element_type != nullptr; + _FORCE_INLINE_ DataType get_container_element_type(int p_index) const { + ERR_FAIL_INDEX_V(p_index, container_element_types.size(), get_variant_type()); + return container_element_types[p_index]; } - _FORCE_INLINE_ void unset_container_element_type() { - if (container_element_type) { - memdelete(container_element_type); - }; - container_element_type = nullptr; + _FORCE_INLINE_ DataType get_container_element_type_or_variant(int p_index) const { + if (p_index < 0 || p_index >= container_element_types.size()) { + return get_variant_type(); + } + return container_element_types[p_index]; + } + + _FORCE_INLINE_ bool has_container_element_type(int p_index) const { + return p_index >= 0 && p_index < container_element_types.size(); + } + + _FORCE_INLINE_ bool has_container_element_types() const { + return !container_element_types.is_empty(); } bool is_typed_container_type() const; @@ -229,10 +242,7 @@ public: class_type = p_other.class_type; method_info = p_other.method_info; enum_values = p_other.enum_values; - unset_container_element_type(); - if (p_other.has_container_element_type()) { - set_container_element_type(p_other.get_container_element_type()); - } + container_element_types = p_other.container_element_types; } DataType() = default; @@ -241,9 +251,7 @@ public: *this = p_other; } - ~DataType() { - unset_container_element_type(); - } + ~DataType() {} }; struct ParserError { @@ -1183,7 +1191,11 @@ public: struct TypeNode : public Node { Vector<IdentifierNode *> type_chain; - TypeNode *container_type = nullptr; + Vector<TypeNode *> container_types; + + TypeNode *get_container_type_or_null(int p_index) const { + return p_index >= 0 && p_index < container_types.size() ? container_types[p_index] : nullptr; + } TypeNode() { type = TYPE; diff --git a/modules/gdscript/gdscript_tokenizer.h b/modules/gdscript/gdscript_tokenizer.h index 6dd8a98652..a64aaf6820 100644 --- a/modules/gdscript/gdscript_tokenizer.h +++ b/modules/gdscript/gdscript_tokenizer.h @@ -37,6 +37,12 @@ #include "core/templates/vector.h" #include "core/variant/variant.h" +#ifdef MINGW_ENABLED +#undef CONST +#undef IN +#undef VOID +#endif + class GDScriptTokenizer { public: enum CursorPlace { diff --git a/modules/gdscript/gdscript_vm.cpp b/modules/gdscript/gdscript_vm.cpp index d31411b26b..2c0b8df9ac 100644 --- a/modules/gdscript/gdscript_vm.cpp +++ b/modules/gdscript/gdscript_vm.cpp @@ -91,8 +91,8 @@ Variant GDScriptFunction::_get_default_variant_for_data_type(const GDScriptDataT if (p_data_type.builtin_type == Variant::ARRAY) { Array array; // Typed array. - if (p_data_type.has_container_element_type()) { - const GDScriptDataType &element_type = p_data_type.get_container_element_type(); + if (p_data_type.has_container_element_type(0)) { + const GDScriptDataType &element_type = p_data_type.get_container_element_type(0); array.set_typed(element_type.builtin_type, element_type.native_type, element_type.script_type); } diff --git a/modules/gdscript/language_server/gdscript_text_document.cpp b/modules/gdscript/language_server/gdscript_text_document.cpp index 44f605232d..0b1371851b 100644 --- a/modules/gdscript/language_server/gdscript_text_document.cpp +++ b/modules/gdscript/language_server/gdscript_text_document.cpp @@ -315,9 +315,8 @@ Dictionary GDScriptTextDocument::resolve(const Dictionary &p_params) { Vector<String> param_symbols = query.split(SYMBOL_SEPERATOR, false); if (param_symbols.size() >= 2) { - String class_ = param_symbols[0]; - StringName class_name = class_; - String member_name = param_symbols[param_symbols.size() - 1]; + StringName class_name = param_symbols[0]; + const String &member_name = param_symbols[param_symbols.size() - 1]; String inner_class_name; if (param_symbols.size() >= 3) { inner_class_name = param_symbols[1]; diff --git a/modules/gdscript/tests/gdscript_test_runner.cpp b/modules/gdscript/tests/gdscript_test_runner.cpp index f91dc83f2c..361ca276bb 100644 --- a/modules/gdscript/tests/gdscript_test_runner.cpp +++ b/modules/gdscript/tests/gdscript_test_runner.cpp @@ -78,31 +78,30 @@ void init_autoloads() { scn.instantiate(); scn->set_path(info.path); scn->reload_from_file(); - ERR_CONTINUE_MSG(!scn.is_valid(), vformat("Can't autoload: %s.", info.path)); + ERR_CONTINUE_MSG(!scn.is_valid(), vformat("Failed to instantiate an autoload, can't load from path: %s.", info.path)); if (scn.is_valid()) { n = scn->instantiate(); } } else { Ref<Resource> res = ResourceLoader::load(info.path); - ERR_CONTINUE_MSG(res.is_null(), vformat("Can't autoload: %s.", info.path)); + ERR_CONTINUE_MSG(res.is_null(), vformat("Failed to instantiate an autoload, can't load from path: %s.", info.path)); Ref<Script> scr = res; if (scr.is_valid()) { StringName ibt = scr->get_instance_base_type(); bool valid_type = ClassDB::is_parent_class(ibt, "Node"); - ERR_CONTINUE_MSG(!valid_type, vformat("Script does not inherit from Node: %s.", info.path)); + ERR_CONTINUE_MSG(!valid_type, vformat("Failed to instantiate an autoload, script '%s' does not inherit from 'Node'.", info.path)); Object *obj = ClassDB::instantiate(ibt); - - ERR_CONTINUE_MSG(!obj, vformat("Cannot instance script for Autoload, expected 'Node' inheritance, got: %s.", ibt)); + ERR_CONTINUE_MSG(!obj, vformat("Failed to instantiate an autoload, cannot instantiate '%s'.", ibt)); n = Object::cast_to<Node>(obj); n->set_script(scr); } } - ERR_CONTINUE_MSG(!n, vformat("Path in autoload not a node or script: %s.", info.path)); + ERR_CONTINUE_MSG(!n, vformat("Failed to instantiate an autoload, path is not pointing to a scene or a script: %s.", info.path)); n->set_name(info.name); for (int i = 0; i < ScriptServer::get_language_count(); i++) { diff --git a/modules/glslang/register_types.cpp b/modules/glslang/register_types.cpp index 7fe3a57880..d7e5ddd32c 100644 --- a/modules/glslang/register_types.cpp +++ b/modules/glslang/register_types.cpp @@ -67,6 +67,13 @@ static Vector<uint8_t> _compile_shader_glsl(RenderingDevice::ShaderStage p_stage } else { // use defaults } + } else if (capabilities->device_family == RenderingDevice::DeviceFamily::DEVICE_DIRECTX) { + // NIR-DXIL is Vulkan 1.1-conformant. + ClientVersion = glslang::EShTargetVulkan_1_1; + // The SPIR-V part of Mesa supports 1.6, but: + // - SPIRV-Reflect won't be able to parse the compute workgroup size. + // - We want to play it safe with NIR-DXIL. + TargetVersion = glslang::EShTargetSpv_1_3; } else { // once we support other backends we'll need to do something here if (r_error) { diff --git a/modules/gltf/editor/editor_scene_importer_blend.cpp b/modules/gltf/editor/editor_scene_importer_blend.cpp index 2fad475e92..9587604e56 100644 --- a/modules/gltf/editor/editor_scene_importer_blend.cpp +++ b/modules/gltf/editor/editor_scene_importer_blend.cpp @@ -45,6 +45,11 @@ #include "main/main.h" #include "scene/gui/line_edit.h" +#ifdef MINGW_ENABLED +#define near +#define far +#endif + #ifdef WINDOWS_ENABLED #include <shlwapi.h> #endif diff --git a/modules/gltf/register_types.cpp b/modules/gltf/register_types.cpp index fecea45fc9..0bf02cf890 100644 --- a/modules/gltf/register_types.cpp +++ b/modules/gltf/register_types.cpp @@ -51,7 +51,7 @@ static void _editor_init() { Ref<EditorSceneFormatImporterGLTF> import_gltf; import_gltf.instantiate(); - ResourceImporterScene::add_importer(import_gltf); + ResourceImporterScene::add_scene_importer(import_gltf); // Blend to glTF importer. @@ -66,7 +66,7 @@ static void _editor_init() { } else { Ref<EditorSceneFormatImporterBlend> importer; importer.instantiate(); - ResourceImporterScene::add_importer(importer); + ResourceImporterScene::add_scene_importer(importer); Ref<EditorFileSystemImportFormatSupportQueryBlend> blend_import_query; blend_import_query.instantiate(); @@ -82,7 +82,7 @@ static void _editor_init() { if (fbx_enabled) { Ref<EditorSceneFormatImporterFBX> importer; importer.instantiate(); - ResourceImporterScene::get_scene_singleton()->add_importer(importer); + ResourceImporterScene::add_scene_importer(importer); Ref<EditorFileSystemImportFormatSupportQueryFBX> fbx_import_query; fbx_import_query.instantiate(); diff --git a/modules/minimp3/register_types.cpp b/modules/minimp3/register_types.cpp index 627d093bc1..c85f0b3389 100644 --- a/modules/minimp3/register_types.cpp +++ b/modules/minimp3/register_types.cpp @@ -52,8 +52,13 @@ void initialize_minimp3_module(ModuleInitializationLevel p_level) { ResourceFormatImporter::get_singleton()->add_importer(mp3_import); } + ClassDB::APIType prev_api = ClassDB::get_current_api(); + ClassDB::set_current_api(ClassDB::API_EDITOR); + // Required to document import options in the class reference. GDREGISTER_CLASS(ResourceImporterMP3); + + ClassDB::set_current_api(prev_api); #endif GDREGISTER_CLASS(AudioStreamMP3); diff --git a/modules/minimp3/resource_importer_mp3.cpp b/modules/minimp3/resource_importer_mp3.cpp index d60b979c3f..33c926689a 100644 --- a/modules/minimp3/resource_importer_mp3.cpp +++ b/modules/minimp3/resource_importer_mp3.cpp @@ -89,7 +89,7 @@ bool ResourceImporterMP3::has_advanced_options() const { void ResourceImporterMP3::show_advanced_options(const String &p_path) { Ref<AudioStreamMP3> mp3_stream = import_mp3(p_path); if (mp3_stream.is_valid()) { - AudioStreamImportSettings::get_singleton()->edit(p_path, "mp3", mp3_stream); + AudioStreamImportSettingsDialog::get_singleton()->edit(p_path, "mp3", mp3_stream); } } #endif diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.NET.Sdk/Godot.NET.Sdk.csproj b/modules/mono/editor/Godot.NET.Sdk/Godot.NET.Sdk/Godot.NET.Sdk.csproj index ad3a10ba49..ccef90c911 100644 --- a/modules/mono/editor/Godot.NET.Sdk/Godot.NET.Sdk/Godot.NET.Sdk.csproj +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.NET.Sdk/Godot.NET.Sdk.csproj @@ -7,7 +7,7 @@ <Authors>Godot Engine contributors</Authors> <PackageId>Godot.NET.Sdk</PackageId> - <Version>4.2.0</Version> + <Version>4.3.0</Version> <PackageVersion>$(PackageVersion_Godot_NET_Sdk)</PackageVersion> <RepositoryUrl>https://github.com/godotengine/godot/tree/master/modules/mono/editor/Godot.NET.Sdk</RepositoryUrl> <PackageProjectUrl>$(RepositoryUrl)</PackageProjectUrl> diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.NET.Sdk/Sdk/iOSNativeAOT.targets b/modules/mono/editor/Godot.NET.Sdk/Godot.NET.Sdk/Sdk/iOSNativeAOT.targets index d8129a6652..b51ce5cb8c 100644 --- a/modules/mono/editor/Godot.NET.Sdk/Godot.NET.Sdk/Sdk/iOSNativeAOT.targets +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.NET.Sdk/Sdk/iOSNativeAOT.targets @@ -33,9 +33,9 @@ <Message Importance="normal" Text="Found XCode at $(XcodeSelect)" Condition=" '$(FindXCode)' == 'true' "/> <ItemGroup> - <LinkerArg Include="-isysroot %22$(XCodePath)Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk%22" + <LinkerArg Include="-mios-simulator-version-min=12.0 -isysroot %22$(XCodePath)Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk%22" Condition=" $(RuntimeIdentifier.Contains('simulator')) "/> - <LinkerArg Include="-isysroot %22$(XCodePath)Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk%22" + <LinkerArg Include="-miphoneos-version-min=12.0 -isysroot %22$(XCodePath)Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk%22" Condition=" !$(RuntimeIdentifier.Contains('simulator')) "/> </ItemGroup> diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/Godot.SourceGenerators.csproj b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/Godot.SourceGenerators.csproj index 23879e0e53..7d2395ba61 100644 --- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/Godot.SourceGenerators.csproj +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/Godot.SourceGenerators.csproj @@ -9,7 +9,7 @@ <Authors>Godot Engine contributors</Authors> <PackageId>Godot.SourceGenerators</PackageId> - <Version>4.2.0</Version> + <Version>4.3.0</Version> <PackageVersion>$(PackageVersion_Godot_SourceGenerators)</PackageVersion> <RepositoryUrl>https://github.com/godotengine/godot/tree/master/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators</RepositoryUrl> <PackageProjectUrl>$(RepositoryUrl)</PackageProjectUrl> diff --git a/modules/mono/editor/GodotTools/GodotTools/Export/AotBuilder.cs b/modules/mono/editor/GodotTools/GodotTools/Export/AotBuilder.cs index b16adb6f55..e516b4dd18 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Export/AotBuilder.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Export/AotBuilder.cs @@ -195,7 +195,7 @@ namespace GodotTools.Export bool isSim = arch == "i386" || arch == "x86_64"; // Shouldn't really happen as we don't do AOT for the simulator string versionMinName = isSim ? "iphonesimulator" : "iphoneos"; string iOSPlatformName = isSim ? "iPhoneSimulator" : "iPhoneOS"; - const string versionMin = "10.0"; // TODO: Turn this hard-coded version into an exporter setting + const string versionMin = "12.0"; // TODO: Turn this hard-coded version into an exporter setting string iOSSdkPath = Path.Combine(XcodeHelper.XcodePath, $"Contents/Developer/Platforms/{iOSPlatformName}.platform/Developer/SDKs/{iOSPlatformName}.sdk"); diff --git a/modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs b/modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs index 91e5118990..c634d9c1ac 100644 --- a/modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs +++ b/modules/mono/editor/GodotTools/GodotTools/Export/ExportPlugin.cs @@ -194,7 +194,7 @@ namespace GodotTools.Export BundleOutputs = false, IncludeDebugSymbols = publishConfig.IncludeDebugSymbols, RidOS = OS.DotNetOS.iOSSimulator, - UseTempDir = true, + UseTempDir = false, }); } @@ -361,7 +361,7 @@ namespace GodotTools.Export } var xcFrameworkPath = Path.Combine(GodotSharpDirs.ProjectBaseOutputPath, publishConfig.BuildConfig, - $"{GodotSharpDirs.ProjectAssemblyName}.xcframework"); + $"{GodotSharpDirs.ProjectAssemblyName}_aot.xcframework"); if (!BuildManager.GenerateXCFrameworkBlocking(outputPaths, Path.Combine(GodotSharpDirs.ProjectBaseOutputPath, publishConfig.BuildConfig, xcFrameworkPath))) { diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Aabb.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Aabb.cs index cc99225a33..57b5b09ebb 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Aabb.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Aabb.cs @@ -1,6 +1,9 @@ using System; +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; +#nullable enable + namespace Godot { /// <summary> @@ -689,7 +692,7 @@ namespace Godot /// </summary> /// <param name="obj">The object to compare with.</param> /// <returns>Whether or not the AABB and the object are equal.</returns> - public override readonly bool Equals(object obj) + public override readonly bool Equals([NotNullWhen(true)] object? obj) { return obj is Aabb other && Equals(other); } @@ -739,7 +742,7 @@ namespace Godot /// Converts this <see cref="Aabb"/> to a string with the given <paramref name="format"/>. /// </summary> /// <returns>A string representation of this AABB.</returns> - public readonly string ToString(string format) + public readonly string ToString(string? format) { return $"{_position.ToString(format)}, {_size.ToString(format)}"; } diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Basis.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Basis.cs index b4f7b82f60..589d6596f0 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Basis.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Basis.cs @@ -1,7 +1,10 @@ using System; +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; using System.ComponentModel; +#nullable enable + namespace Godot { /// <summary> @@ -1090,7 +1093,7 @@ namespace Godot /// </summary> /// <param name="obj">The object to compare with.</param> /// <returns>Whether or not the basis matrix and the object are exactly equal.</returns> - public override readonly bool Equals(object obj) + public override readonly bool Equals([NotNullWhen(true)] object? obj) { return obj is Basis other && Equals(other); } @@ -1140,7 +1143,7 @@ namespace Godot /// Converts this <see cref="Basis"/> to a string with the given <paramref name="format"/>. /// </summary> /// <returns>A string representation of this basis.</returns> - public readonly string ToString(string format) + public readonly string ToString(string? format) { return $"[X: {X.ToString(format)}, Y: {Y.ToString(format)}, Z: {Z.ToString(format)}]"; } diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs index 293e680067..772209064c 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Color.cs @@ -1,7 +1,10 @@ using System; +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; using Godot.NativeInterop; +#nullable enable + namespace Godot { /// <summary> @@ -1274,7 +1277,7 @@ namespace Godot /// </summary> /// <param name="obj">The other object to compare.</param> /// <returns>Whether or not the color and the other object are equal.</returns> - public override readonly bool Equals(object obj) + public override readonly bool Equals([NotNullWhen(true)] object? obj) { return obj is Color other && Equals(other); } @@ -1324,7 +1327,7 @@ namespace Godot /// Converts this <see cref="Color"/> to a string with the given <paramref name="format"/>. /// </summary> /// <returns>A string representation of this color.</returns> - public readonly string ToString(string format) + public readonly string ToString(string? format) { return $"({R.ToString(format)}, {G.ToString(format)}, {B.ToString(format)}, {A.ToString(format)})"; } diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Plane.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Plane.cs index 85b2b02c45..f5dc34d824 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Plane.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Plane.cs @@ -1,6 +1,9 @@ using System; +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; +#nullable enable + namespace Godot { /// <summary> @@ -382,7 +385,7 @@ namespace Godot /// </summary> /// <param name="obj">The other object to compare.</param> /// <returns>Whether or not the plane and the other object are exactly equal.</returns> - public override readonly bool Equals(object obj) + public override readonly bool Equals([NotNullWhen(true)] object? obj) { return obj is Plane other && Equals(other); } @@ -430,7 +433,7 @@ namespace Godot /// Converts this <see cref="Plane"/> to a string with the given <paramref name="format"/>. /// </summary> /// <returns>A string representation of this plane.</returns> - public readonly string ToString(string format) + public readonly string ToString(string? format) { return $"{_normal.ToString(format)}, {_d.ToString(format)}"; } diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Projection.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Projection.cs index 155e90ff24..4c9e21fb79 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Projection.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Projection.cs @@ -1,6 +1,9 @@ using System; +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; +#nullable enable + namespace Godot { /// <summary> @@ -586,7 +589,7 @@ namespace Godot public readonly Vector2 GetFarPlaneHalfExtents() { var res = GetProjectionPlane(Planes.Far).Intersect3(GetProjectionPlane(Planes.Right), GetProjectionPlane(Planes.Top)); - return new Vector2(res.Value.X, res.Value.Y); + return res is null ? default : new Vector2(res.Value.X, res.Value.Y); } /// <summary> @@ -597,7 +600,7 @@ namespace Godot public readonly Vector2 GetViewportHalfExtents() { var res = GetProjectionPlane(Planes.Near).Intersect3(GetProjectionPlane(Planes.Right), GetProjectionPlane(Planes.Top)); - return new Vector2(res.Value.X, res.Value.Y); + return res is null ? default : new Vector2(res.Value.X, res.Value.Y); } /// <summary> @@ -981,7 +984,7 @@ namespace Godot /// </summary> /// <param name="obj">The object to compare with.</param> /// <returns>Whether or not the vector and the object are equal.</returns> - public override readonly bool Equals(object obj) + public override readonly bool Equals([NotNullWhen(true)] object? obj) { return obj is Projection other && Equals(other); } @@ -1018,7 +1021,7 @@ namespace Godot /// Converts this <see cref="Projection"/> to a string with the given <paramref name="format"/>. /// </summary> /// <returns>A string representation of this projection.</returns> - public readonly string ToString(string format) + public readonly string ToString(string? format) { return $"{X.X.ToString(format)}, {X.Y.ToString(format)}, {X.Z.ToString(format)}, {X.W.ToString(format)}\n" + $"{Y.X.ToString(format)}, {Y.Y.ToString(format)}, {Y.Z.ToString(format)}, {Y.W.ToString(format)}\n" + diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Quaternion.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Quaternion.cs index 3d45913586..2344e8c510 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Quaternion.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Quaternion.cs @@ -1,6 +1,9 @@ using System; +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; +#nullable enable + namespace Godot { /// <summary> @@ -769,7 +772,7 @@ namespace Godot /// </summary> /// <param name="obj">The other object to compare.</param> /// <returns>Whether or not the quaternion and the other object are exactly equal.</returns> - public override readonly bool Equals(object obj) + public override readonly bool Equals([NotNullWhen(true)] object? obj) { return obj is Quaternion other && Equals(other); } @@ -817,7 +820,7 @@ namespace Godot /// Converts this <see cref="Quaternion"/> to a string with the given <paramref name="format"/>. /// </summary> /// <returns>A string representation of this quaternion.</returns> - public readonly string ToString(string format) + public readonly string ToString(string? format) { return $"({X.ToString(format)}, {Y.ToString(format)}, {Z.ToString(format)}, {W.ToString(format)})"; } diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2.cs index babb26960b..71a35ab809 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2.cs @@ -1,6 +1,9 @@ using System; +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; +#nullable enable + namespace Godot { /// <summary> @@ -427,7 +430,7 @@ namespace Godot /// </summary> /// <param name="obj">The other object to compare.</param> /// <returns>Whether or not the rect and the other object are exactly equal.</returns> - public override readonly bool Equals(object obj) + public override readonly bool Equals([NotNullWhen(true)] object? obj) { return obj is Rect2 other && Equals(other); } @@ -475,7 +478,7 @@ namespace Godot /// Converts this <see cref="Rect2"/> to a string with the given <paramref name="format"/>. /// </summary> /// <returns>A string representation of this rect.</returns> - public readonly string ToString(string format) + public readonly string ToString(string? format) { return $"{_position.ToString(format)}, {_size.ToString(format)}"; } diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2I.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2I.cs index 49fba02b54..ef7e9eacd8 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2I.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Rect2I.cs @@ -1,6 +1,9 @@ using System; +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; +#nullable enable + namespace Godot { /// <summary> @@ -398,7 +401,7 @@ namespace Godot /// </summary> /// <param name="obj">The other object to compare.</param> /// <returns>Whether or not the rect and the other object are equal.</returns> - public override readonly bool Equals(object obj) + public override readonly bool Equals([NotNullWhen(true)] object? obj) { return obj is Rect2I other && Equals(other); } @@ -435,7 +438,7 @@ namespace Godot /// Converts this <see cref="Rect2I"/> to a string with the given <paramref name="format"/>. /// </summary> /// <returns>A string representation of this rect.</returns> - public readonly string ToString(string format) + public readonly string ToString(string? format) { return $"{_position.ToString(format)}, {_size.ToString(format)}"; } diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Rid.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Rid.cs index 350626389b..fccae94eac 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Rid.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Rid.cs @@ -1,8 +1,11 @@ using System; +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Godot.NativeInterop; +#nullable enable + namespace Godot { /// <summary> @@ -71,7 +74,7 @@ namespace Godot /// </summary> /// <param name="obj">The other object to compare.</param> /// <returns>Whether or not the color and the other object are equal.</returns> - public override readonly bool Equals(object obj) + public override readonly bool Equals([NotNullWhen(true)] object? obj) { return obj is Rid other && Equals(other); } diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Transform2D.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Transform2D.cs index 386f587464..3443277fee 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Transform2D.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Transform2D.cs @@ -1,7 +1,10 @@ using System; +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +#nullable enable + namespace Godot { /// <summary> @@ -606,7 +609,7 @@ namespace Godot /// </summary> /// <param name="obj">The object to compare with.</param> /// <returns>Whether or not the transform and the object are exactly equal.</returns> - public override readonly bool Equals(object obj) + public override readonly bool Equals([NotNullWhen(true)] object? obj) { return obj is Transform2D other && Equals(other); } @@ -656,7 +659,7 @@ namespace Godot /// Converts this <see cref="Transform2D"/> to a string with the given <paramref name="format"/>. /// </summary> /// <returns>A string representation of this transform.</returns> - public readonly string ToString(string format) + public readonly string ToString(string? format) { return $"[X: {X.ToString(format)}, Y: {Y.ToString(format)}, O: {Origin.ToString(format)}]"; } diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Transform3D.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Transform3D.cs index 2d09259dcb..f80c0bd8dd 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Transform3D.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Transform3D.cs @@ -1,7 +1,10 @@ using System; +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; using System.ComponentModel; +#nullable enable + namespace Godot { /// <summary> @@ -630,7 +633,7 @@ namespace Godot /// </summary> /// <param name="obj">The object to compare with.</param> /// <returns>Whether or not the transform and the object are exactly equal.</returns> - public override readonly bool Equals(object obj) + public override readonly bool Equals([NotNullWhen(true)] object? obj) { return obj is Transform3D other && Equals(other); } @@ -680,7 +683,7 @@ namespace Godot /// Converts this <see cref="Transform3D"/> to a string with the given <paramref name="format"/>. /// </summary> /// <returns>A string representation of this transform.</returns> - public readonly string ToString(string format) + public readonly string ToString(string? format) { return $"[X: {Basis.X.ToString(format)}, Y: {Basis.Y.ToString(format)}, Z: {Basis.Z.ToString(format)}, O: {Origin.ToString(format)}]"; } diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs index 4842dbc9af..a27a1ab1cf 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs @@ -1,6 +1,9 @@ using System; +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; +#nullable enable + namespace Godot { /// <summary> @@ -954,7 +957,7 @@ namespace Godot /// </summary> /// <param name="obj">The object to compare with.</param> /// <returns>Whether or not the vector and the object are equal.</returns> - public override readonly bool Equals(object obj) + public override readonly bool Equals([NotNullWhen(true)] object? obj) { return obj is Vector2 other && Equals(other); } @@ -1016,7 +1019,7 @@ namespace Godot /// Converts this <see cref="Vector2"/> to a string with the given <paramref name="format"/>. /// </summary> /// <returns>A string representation of this vector.</returns> - public readonly string ToString(string format) + public readonly string ToString(string? format) { return $"({X.ToString(format)}, {Y.ToString(format)})"; } diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2I.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2I.cs index 215bb4df8c..104e30981f 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2I.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2I.cs @@ -1,6 +1,9 @@ using System; +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; +#nullable enable + namespace Godot { /// <summary> @@ -535,7 +538,7 @@ namespace Godot /// </summary> /// <param name="obj">The object to compare with.</param> /// <returns>Whether or not the vector and the object are equal.</returns> - public override readonly bool Equals(object obj) + public override readonly bool Equals([NotNullWhen(true)] object? obj) { return obj is Vector2I other && Equals(other); } @@ -572,7 +575,7 @@ namespace Godot /// Converts this <see cref="Vector2I"/> to a string with the given <paramref name="format"/>. /// </summary> /// <returns>A string representation of this vector.</returns> - public readonly string ToString(string format) + public readonly string ToString(string? format) { return $"({X.ToString(format)}, {Y.ToString(format)})"; } diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs index d26d4662a0..54d698345f 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs @@ -1,6 +1,9 @@ using System; +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; +#nullable enable + namespace Godot { /// <summary> @@ -1056,7 +1059,7 @@ namespace Godot /// </summary> /// <param name="obj">The object to compare with.</param> /// <returns>Whether or not the vector and the object are equal.</returns> - public override readonly bool Equals(object obj) + public override readonly bool Equals([NotNullWhen(true)] object? obj) { return obj is Vector3 other && Equals(other); } @@ -1118,7 +1121,7 @@ namespace Godot /// Converts this <see cref="Vector3"/> to a string with the given <paramref name="format"/>. /// </summary> /// <returns>A string representation of this vector.</returns> - public readonly string ToString(string format) + public readonly string ToString(string? format) { return $"({X.ToString(format)}, {Y.ToString(format)}, {Z.ToString(format)})"; } diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3I.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3I.cs index fe74ec8884..4af9fd878b 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3I.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3I.cs @@ -1,6 +1,9 @@ using System; +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; +#nullable enable + namespace Godot { /// <summary> @@ -590,7 +593,7 @@ namespace Godot /// </summary> /// <param name="obj">The object to compare with.</param> /// <returns>Whether or not the vector and the object are equal.</returns> - public override readonly bool Equals(object obj) + public override readonly bool Equals([NotNullWhen(true)] object? obj) { return obj is Vector3I other && Equals(other); } @@ -627,7 +630,7 @@ namespace Godot /// Converts this <see cref="Vector3I"/> to a string with the given <paramref name="format"/>. /// </summary> /// <returns>A string representation of this vector.</returns> - public readonly string ToString(string format) + public readonly string ToString(string? format) { return $"({X.ToString(format)}, {Y.ToString(format)}, {Z.ToString(format)})"; } diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector4.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector4.cs index eeaef5e46e..87c01ad5ea 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector4.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector4.cs @@ -1,6 +1,9 @@ using System; +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; +#nullable enable + namespace Godot { /// <summary> @@ -838,7 +841,7 @@ namespace Godot /// </summary> /// <param name="obj">The object to compare with.</param> /// <returns>Whether or not the vector and the object are equal.</returns> - public override readonly bool Equals(object obj) + public override readonly bool Equals([NotNullWhen(true)] object? obj) { return obj is Vector4 other && Equals(other); } @@ -900,7 +903,7 @@ namespace Godot /// Converts this <see cref="Vector4"/> to a string with the given <paramref name="format"/>. /// </summary> /// <returns>A string representation of this vector.</returns> - public readonly string ToString(string format) + public readonly string ToString(string? format) { return $"({X.ToString(format)}, {Y.ToString(format)}, {Z.ToString(format)}, {W.ToString(format)})"; } diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector4I.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector4I.cs index a0a4393523..7d4d3dd353 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector4I.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector4I.cs @@ -1,6 +1,9 @@ using System; +using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; +#nullable enable + namespace Godot { /// <summary> @@ -611,7 +614,7 @@ namespace Godot /// </summary> /// <param name="obj">The object to compare with.</param> /// <returns>Whether or not the vector and the object are equal.</returns> - public override readonly bool Equals(object obj) + public override readonly bool Equals([NotNullWhen(true)] object? obj) { return obj is Vector4I other && Equals(other); } @@ -648,7 +651,7 @@ namespace Godot /// Converts this <see cref="Vector4I"/> to a string with the given <paramref name="format"/>. /// </summary> /// <returns>A string representation of this vector.</returns> - public readonly string ToString(string format) + public readonly string ToString(string? format) { return $"({X.ToString(format)}, {Y.ToString(format)}, {Z.ToString(format)}), {W.ToString(format)})"; } diff --git a/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj b/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj index a55b8d693b..db16b1fe1d 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj +++ b/modules/mono/glue/GodotSharp/GodotSharp/GodotSharp.csproj @@ -17,7 +17,7 @@ <Authors>Godot Engine contributors</Authors> <PackageId>GodotSharp</PackageId> - <Version>4.2.0</Version> + <Version>4.3.0</Version> <PackageVersion>$(PackageVersion_GodotSharp)</PackageVersion> <RepositoryUrl>https://github.com/godotengine/godot/tree/master/modules/mono/glue/GodotSharp/GodotSharp</RepositoryUrl> <PackageProjectUrl>$(RepositoryUrl)</PackageProjectUrl> diff --git a/modules/mono/glue/GodotSharp/GodotSharpEditor/GodotSharpEditor.csproj b/modules/mono/glue/GodotSharp/GodotSharpEditor/GodotSharpEditor.csproj index db9337d4eb..31e20e4ecd 100644 --- a/modules/mono/glue/GodotSharp/GodotSharpEditor/GodotSharpEditor.csproj +++ b/modules/mono/glue/GodotSharp/GodotSharpEditor/GodotSharpEditor.csproj @@ -15,7 +15,7 @@ <Authors>Godot Engine contributors</Authors> <PackageId>GodotSharpEditor</PackageId> - <Version>4.2.0</Version> + <Version>4.3.0</Version> <PackageVersion>$(PackageVersion_GodotSharp)</PackageVersion> <RepositoryUrl>https://github.com/godotengine/godot/tree/master/modules/mono/glue/GodotSharp/GodotSharpEditor</RepositoryUrl> <PackageProjectUrl>$(RepositoryUrl)</PackageProjectUrl> diff --git a/modules/mono/mono_gd/gd_mono.h b/modules/mono/mono_gd/gd_mono.h index 530936cfb4..1b46a619ca 100644 --- a/modules/mono/mono_gd/gd_mono.h +++ b/modules/mono/mono_gd/gd_mono.h @@ -68,7 +68,9 @@ class GDMono { String project_assembly_path; uint64_t project_assembly_modified_time = 0; +#ifdef GD_MONO_HOT_RELOAD int project_load_failure_count = 0; +#endif #ifdef TOOLS_ENABLED bool _load_project_assembly(); diff --git a/modules/navigation/godot_navigation_server.cpp b/modules/navigation/godot_navigation_server.cpp index 6a3bf6793e..5a28f8b8ef 100644 --- a/modules/navigation/godot_navigation_server.cpp +++ b/modules/navigation/godot_navigation_server.cpp @@ -331,6 +331,13 @@ RID GodotNavigationServer::agent_get_map(RID p_agent) const { return RID(); } +Vector3 GodotNavigationServer::map_get_random_point(RID p_map, uint32_t p_navigation_layers, bool p_uniformly) const { + const NavMap *map = map_owner.get_or_null(p_map); + ERR_FAIL_NULL_V(map, Vector3()); + + return map->get_random_point(p_navigation_layers, p_uniformly); +} + RID GodotNavigationServer::region_create() { MutexLock lock(operations_mutex); @@ -498,6 +505,13 @@ Vector3 GodotNavigationServer::region_get_connection_pathway_end(RID p_region, i return region->get_connection_pathway_end(p_connection_id); } +Vector3 GodotNavigationServer::region_get_random_point(RID p_region, uint32_t p_navigation_layers, bool p_uniformly) const { + const NavRegion *region = region_owner.get_or_null(p_region); + ERR_FAIL_NULL_V(region, Vector3()); + + return region->get_random_point(p_navigation_layers, p_uniformly); +} + RID GodotNavigationServer::link_create() { MutexLock lock(operations_mutex); diff --git a/modules/navigation/godot_navigation_server.h b/modules/navigation/godot_navigation_server.h index 4ead4fc398..3a76f83b09 100644 --- a/modules/navigation/godot_navigation_server.h +++ b/modules/navigation/godot_navigation_server.h @@ -140,6 +140,8 @@ public: virtual void map_force_update(RID p_map) override; + virtual Vector3 map_get_random_point(RID p_map, uint32_t p_navigation_layers, bool p_uniformly) const override; + virtual RID region_create() override; COMMAND_2(region_set_enabled, RID, p_region, bool, p_enabled); @@ -170,6 +172,7 @@ public: virtual int region_get_connections_count(RID p_region) const override; virtual Vector3 region_get_connection_pathway_start(RID p_region, int p_connection_id) const override; virtual Vector3 region_get_connection_pathway_end(RID p_region, int p_connection_id) const override; + virtual Vector3 region_get_random_point(RID p_region, uint32_t p_navigation_layers, bool p_uniformly) const override; virtual RID link_create() override; COMMAND_2(link_set_map, RID, p_link, RID, p_map); diff --git a/modules/navigation/godot_navigation_server_2d.cpp b/modules/navigation/godot_navigation_server_2d.cpp index b54729e06f..142d6181a1 100644 --- a/modules/navigation/godot_navigation_server_2d.cpp +++ b/modules/navigation/godot_navigation_server_2d.cpp @@ -259,8 +259,12 @@ Vector<Vector2> FORWARD_5_R_C(vector_v3_to_v2, map_get_path, RID, p_map, Vector2 Vector2 FORWARD_2_R_C(v3_to_v2, map_get_closest_point, RID, p_map, const Vector2 &, p_point, rid_to_rid, v2_to_v3); RID FORWARD_2_C(map_get_closest_point_owner, RID, p_map, const Vector2 &, p_point, rid_to_rid, v2_to_v3); -RID FORWARD_0(region_create); +Vector2 GodotNavigationServer2D::map_get_random_point(RID p_map, uint32_t p_naviation_layers, bool p_uniformly) const { + Vector3 result = NavigationServer3D::get_singleton()->map_get_random_point(p_map, p_naviation_layers, p_uniformly); + return v3_to_v2(result); +} +RID FORWARD_0(region_create); void FORWARD_2(region_set_enabled, RID, p_region, bool, p_enabled, rid_to_rid, bool_to_bool); bool FORWARD_1_C(region_get_enabled, RID, p_region, rid_to_rid); void FORWARD_2(region_set_use_edge_connections, RID, p_region, bool, p_enabled, rid_to_rid, bool_to_bool); @@ -287,6 +291,11 @@ int FORWARD_1_C(region_get_connections_count, RID, p_region, rid_to_rid); Vector2 FORWARD_2_R_C(v3_to_v2, region_get_connection_pathway_start, RID, p_region, int, p_connection_id, rid_to_rid, int_to_int); Vector2 FORWARD_2_R_C(v3_to_v2, region_get_connection_pathway_end, RID, p_region, int, p_connection_id, rid_to_rid, int_to_int); +Vector2 GodotNavigationServer2D::region_get_random_point(RID p_region, uint32_t p_navigation_layers, bool p_uniformly) const { + Vector3 result = NavigationServer3D::get_singleton()->region_get_random_point(p_region, p_navigation_layers, p_uniformly); + return v3_to_v2(result); +} + RID FORWARD_0(link_create); void FORWARD_2(link_set_map, RID, p_link, RID, p_map, rid_to_rid, rid_to_rid); diff --git a/modules/navigation/godot_navigation_server_2d.h b/modules/navigation/godot_navigation_server_2d.h index 337f5f40d8..88dee0ce69 100644 --- a/modules/navigation/godot_navigation_server_2d.h +++ b/modules/navigation/godot_navigation_server_2d.h @@ -76,6 +76,7 @@ public: virtual TypedArray<RID> map_get_agents(RID p_map) const override; virtual TypedArray<RID> map_get_obstacles(RID p_map) const override; virtual void map_force_update(RID p_map) override; + virtual Vector2 map_get_random_point(RID p_map, uint32_t p_navigation_layers, bool p_uniformly) const override; virtual RID region_create() override; virtual void region_set_enabled(RID p_region, bool p_enabled) override; @@ -98,6 +99,7 @@ public: virtual int region_get_connections_count(RID p_region) const override; virtual Vector2 region_get_connection_pathway_start(RID p_region, int p_connection_id) const override; virtual Vector2 region_get_connection_pathway_end(RID p_region, int p_connection_id) const override; + virtual Vector2 region_get_random_point(RID p_region, uint32_t p_navigation_layers, bool p_uniformly) const override; virtual RID link_create() override; diff --git a/modules/navigation/nav_map.cpp b/modules/navigation/nav_map.cpp index ca1034dcc0..3b875b7fa7 100644 --- a/modules/navigation/nav_map.cpp +++ b/modules/navigation/nav_map.cpp @@ -769,6 +769,70 @@ void NavMap::remove_agent_as_controlled(NavAgent *agent) { } } +Vector3 NavMap::get_random_point(uint32_t p_navigation_layers, bool p_uniformly) const { + const LocalVector<NavRegion *> map_regions = get_regions(); + + if (map_regions.is_empty()) { + return Vector3(); + } + + LocalVector<const NavRegion *> accessible_regions; + + for (const NavRegion *region : map_regions) { + if (!region->get_enabled() || (p_navigation_layers & region->get_navigation_layers()) == 0) { + continue; + } + accessible_regions.push_back(region); + } + + if (accessible_regions.is_empty()) { + // All existing region polygons are disabled. + return Vector3(); + } + + if (p_uniformly) { + real_t accumulated_region_surface_area = 0; + RBMap<real_t, uint32_t> accessible_regions_area_map; + + for (uint32_t accessible_region_index = 0; accessible_region_index < accessible_regions.size(); accessible_region_index++) { + const NavRegion *region = accessible_regions[accessible_region_index]; + + real_t region_surface_area = region->get_surface_area(); + + if (region_surface_area == 0.0f) { + continue; + } + + accessible_regions_area_map[accumulated_region_surface_area] = accessible_region_index; + accumulated_region_surface_area += region_surface_area; + } + if (accessible_regions_area_map.is_empty() || accumulated_region_surface_area == 0) { + // All faces have no real surface / no area. + return Vector3(); + } + + real_t random_accessible_regions_area_map = Math::random(real_t(0), accumulated_region_surface_area); + + RBMap<real_t, uint32_t>::Iterator E = accessible_regions_area_map.find_closest(random_accessible_regions_area_map); + ERR_FAIL_COND_V(!E, Vector3()); + uint32_t random_region_index = E->value; + ERR_FAIL_UNSIGNED_INDEX_V(random_region_index, accessible_regions.size(), Vector3()); + + const NavRegion *random_region = accessible_regions[random_region_index]; + ERR_FAIL_NULL_V(random_region, Vector3()); + + return random_region->get_random_point(p_navigation_layers, p_uniformly); + + } else { + uint32_t random_region_index = Math::random(int(0), accessible_regions.size() - 1); + + const NavRegion *random_region = accessible_regions[random_region_index]; + ERR_FAIL_NULL_V(random_region, Vector3()); + + return random_region->get_random_point(p_navigation_layers, p_uniformly); + } +} + void NavMap::sync() { // Performance Monitor int _new_pm_region_count = regions.size(); @@ -1107,8 +1171,14 @@ void NavMap::_update_rvo_obstacles_tree_2d() { obstacle_vertex_count += obstacle->get_vertices().size(); } + // Cleaning old obstacles. + for (size_t i = 0; i < rvo_simulation_2d.obstacles_.size(); ++i) { + delete rvo_simulation_2d.obstacles_[i]; + } + rvo_simulation_2d.obstacles_.clear(); + // Cannot use LocalVector here as RVO library expects std::vector to build KdTree - std::vector<RVO2D::Obstacle2D *> raw_obstacles; + std::vector<RVO2D::Obstacle2D *> &raw_obstacles = rvo_simulation_2d.obstacles_; raw_obstacles.reserve(obstacle_vertex_count); // The following block is modified copy from RVO2D::AddObstacle() @@ -1128,6 +1198,11 @@ void NavMap::_update_rvo_obstacles_tree_2d() { real_t _obstacle_height = obstacle->get_height(); for (const Vector3 &_obstacle_vertex : _obstacle_vertices) { +#ifdef TOOLS_ENABLED + if (_obstacle_vertex.y != 0) { + WARN_PRINT_ONCE("Y coordinates of static obstacle vertices are ignored. Please use obstacle position Y to change elevation of obstacle."); + } +#endif rvo_2d_vertices.push_back(RVO2D::Vector2(_obstacle_vertex.x + _obstacle_position.x, _obstacle_vertex.z + _obstacle_position.z)); } diff --git a/modules/navigation/nav_map.h b/modules/navigation/nav_map.h index 5d78c14627..e8cbe7e247 100644 --- a/modules/navigation/nav_map.h +++ b/modules/navigation/nav_map.h @@ -190,6 +190,8 @@ public: return map_update_id; } + Vector3 get_random_point(uint32_t p_navigation_layers, bool p_uniformly) const; + void sync(); void step(real_t p_deltatime); void dispatch_callbacks(); diff --git a/modules/navigation/nav_mesh_generator_2d.cpp b/modules/navigation/nav_mesh_generator_2d.cpp index f8c12935b4..6dfafa4e91 100644 --- a/modules/navigation/nav_mesh_generator_2d.cpp +++ b/modules/navigation/nav_mesh_generator_2d.cpp @@ -591,13 +591,19 @@ void NavMeshGenerator2D::generator_parse_tilemap_node(const Ref<NavigationPolygo continue; } + // Transform flags. + const int alternative_id = tilemap->get_cell_alternative_tile(tilemap_layer, cell, false); + bool flip_h = (alternative_id & TileSetAtlasSource::TRANSFORM_FLIP_H); + bool flip_v = (alternative_id & TileSetAtlasSource::TRANSFORM_FLIP_V); + bool transpose = (alternative_id & TileSetAtlasSource::TRANSFORM_TRANSPOSE); + Transform2D tile_transform; tile_transform.set_origin(tilemap->map_to_local(cell)); const Transform2D tile_transform_offset = tilemap_xform * tile_transform; if (navigation_layers_count > 0) { - Ref<NavigationPolygon> navigation_polygon = tile_data->get_navigation_polygon(tilemap_layer); + Ref<NavigationPolygon> navigation_polygon = tile_data->get_navigation_polygon(tilemap_layer, flip_h, flip_v, transpose); if (navigation_polygon.is_valid()) { for (int outline_index = 0; outline_index < navigation_polygon->get_outline_count(); outline_index++) { const Vector<Vector2> &navigation_polygon_outline = navigation_polygon->get_outline(outline_index); @@ -622,11 +628,15 @@ void NavMeshGenerator2D::generator_parse_tilemap_node(const Ref<NavigationPolygo if (physics_layers_count > 0 && (parsed_geometry_type == NavigationPolygon::PARSED_GEOMETRY_STATIC_COLLIDERS || parsed_geometry_type == NavigationPolygon::PARSED_GEOMETRY_BOTH) && (tile_set->get_physics_layer_collision_layer(tilemap_layer) & parsed_collision_mask)) { for (int collision_polygon_index = 0; collision_polygon_index < tile_data->get_collision_polygons_count(tilemap_layer); collision_polygon_index++) { - const Vector<Vector2> &collision_polygon_points = tile_data->get_collision_polygon_points(tilemap_layer, collision_polygon_index); + PackedVector2Array collision_polygon_points = tile_data->get_collision_polygon_points(tilemap_layer, collision_polygon_index); if (collision_polygon_points.size() == 0) { continue; } + if (flip_h || flip_v || transpose) { + collision_polygon_points = TileData::get_transformed_vertices(collision_polygon_points, flip_h, flip_v, transpose); + } + Vector<Vector2> obstruction_outline; obstruction_outline.resize(collision_polygon_points.size()); diff --git a/modules/navigation/nav_region.cpp b/modules/navigation/nav_region.cpp index 09697c7be0..9cb235d79f 100644 --- a/modules/navigation/nav_region.cpp +++ b/modules/navigation/nav_region.cpp @@ -100,6 +100,88 @@ Vector3 NavRegion::get_connection_pathway_end(int p_connection_id) const { return connections[p_connection_id].pathway_end; } +Vector3 NavRegion::get_random_point(uint32_t p_navigation_layers, bool p_uniformly) const { + if (!get_enabled()) { + return Vector3(); + } + + const LocalVector<gd::Polygon> ®ion_polygons = get_polygons(); + + if (region_polygons.is_empty()) { + return Vector3(); + } + + if (p_uniformly) { + real_t accumulated_area = 0; + RBMap<real_t, uint32_t> region_area_map; + + for (uint32_t rp_index = 0; rp_index < region_polygons.size(); rp_index++) { + const gd::Polygon ®ion_polygon = region_polygons[rp_index]; + real_t polyon_area = region_polygon.surface_area; + + if (polyon_area == 0.0) { + continue; + } + region_area_map[accumulated_area] = rp_index; + accumulated_area += polyon_area; + } + if (region_area_map.is_empty() || accumulated_area == 0) { + // All polygons have no real surface / no area. + return Vector3(); + } + + real_t region_area_map_pos = Math::random(real_t(0), accumulated_area); + + RBMap<real_t, uint32_t>::Iterator region_E = region_area_map.find_closest(region_area_map_pos); + ERR_FAIL_COND_V(!region_E, Vector3()); + uint32_t rrp_polygon_index = region_E->value; + ERR_FAIL_UNSIGNED_INDEX_V(rrp_polygon_index, region_polygons.size(), Vector3()); + + const gd::Polygon &rr_polygon = region_polygons[rrp_polygon_index]; + + real_t accumulated_polygon_area = 0; + RBMap<real_t, uint32_t> polygon_area_map; + + for (uint32_t rpp_index = 2; rpp_index < rr_polygon.points.size(); rpp_index++) { + real_t face_area = Face3(rr_polygon.points[0].pos, rr_polygon.points[rpp_index - 1].pos, rr_polygon.points[rpp_index].pos).get_area(); + + if (face_area == 0.0) { + continue; + } + polygon_area_map[accumulated_polygon_area] = rpp_index; + accumulated_polygon_area += face_area; + } + if (polygon_area_map.is_empty() || accumulated_polygon_area == 0) { + // All faces have no real surface / no area. + return Vector3(); + } + + real_t polygon_area_map_pos = Math::random(real_t(0), accumulated_polygon_area); + + RBMap<real_t, uint32_t>::Iterator polygon_E = polygon_area_map.find_closest(polygon_area_map_pos); + ERR_FAIL_COND_V(!polygon_E, Vector3()); + uint32_t rrp_face_index = polygon_E->value; + ERR_FAIL_UNSIGNED_INDEX_V(rrp_face_index, rr_polygon.points.size(), Vector3()); + + const Face3 face(rr_polygon.points[0].pos, rr_polygon.points[rrp_face_index - 1].pos, rr_polygon.points[rrp_face_index].pos); + + Vector3 face_random_position = face.get_random_point_inside(); + return face_random_position; + + } else { + uint32_t rrp_polygon_index = Math::random(int(0), region_polygons.size() - 1); + + const gd::Polygon &rr_polygon = region_polygons[rrp_polygon_index]; + + uint32_t rrp_face_index = Math::random(int(2), rr_polygon.points.size() - 1); + + const Face3 face(rr_polygon.points[0].pos, rr_polygon.points[rrp_face_index - 1].pos, rr_polygon.points[rrp_face_index].pos); + + Vector3 face_random_position = face.get_random_point_inside(); + return face_random_position; + } +} + bool NavRegion::sync() { bool something_changed = polygons_dirty /* || something_dirty? */; @@ -113,6 +195,7 @@ void NavRegion::update_polygons() { return; } polygons.clear(); + surface_area = 0.0; polygons_dirty = false; if (map == nullptr) { @@ -147,21 +230,46 @@ void NavRegion::update_polygons() { polygons.resize(mesh->get_polygon_count()); + real_t _new_region_surface_area = 0.0; + // Build - for (size_t i(0); i < polygons.size(); i++) { - gd::Polygon &p = polygons[i]; - p.owner = this; + int navigation_mesh_polygon_index = 0; + for (gd::Polygon &polygon : polygons) { + polygon.owner = this; + polygon.surface_area = 0.0; - Vector<int> mesh_poly = mesh->get_polygon(i); - const int *indices = mesh_poly.ptr(); + Vector<int> navigation_mesh_polygon = mesh->get_polygon(navigation_mesh_polygon_index); + navigation_mesh_polygon_index += 1; + + int navigation_mesh_polygon_size = navigation_mesh_polygon.size(); + if (navigation_mesh_polygon_size < 3) { + continue; + } + + const int *indices = navigation_mesh_polygon.ptr(); bool valid(true); - p.points.resize(mesh_poly.size()); - p.edges.resize(mesh_poly.size()); - Vector3 center; + polygon.points.resize(navigation_mesh_polygon_size); + polygon.edges.resize(navigation_mesh_polygon_size); + + real_t _new_polygon_surface_area = 0.0; + + for (int j(2); j < navigation_mesh_polygon_size; j++) { + const Face3 face = Face3( + transform.xform(vertices_r[indices[0]]), + transform.xform(vertices_r[indices[j - 1]]), + transform.xform(vertices_r[indices[j]])); + + _new_polygon_surface_area += face.get_area(); + } + + polygon.surface_area = _new_polygon_surface_area; + _new_region_surface_area += _new_polygon_surface_area; + + Vector3 polygon_center; real_t sum(0); - for (int j(0); j < mesh_poly.size(); j++) { + for (int j(0); j < navigation_mesh_polygon_size; j++) { int idx = indices[j]; if (idx < 0 || idx >= len) { valid = false; @@ -169,10 +277,10 @@ void NavRegion::update_polygons() { } Vector3 point_position = transform.xform(vertices_r[idx]); - p.points[j].pos = point_position; - p.points[j].key = map->get_point_key(point_position); + polygon.points[j].pos = point_position; + polygon.points[j].key = map->get_point_key(point_position); - center += point_position; // Composing the center of the polygon + polygon_center += point_position; // Composing the center of the polygon if (j >= 2) { Vector3 epa = transform.xform(vertices_r[indices[j - 2]]); @@ -186,9 +294,11 @@ void NavRegion::update_polygons() { ERR_BREAK_MSG(!valid, "The navigation mesh set in this region is not valid!"); } - p.clockwise = sum > 0; - if (mesh_poly.size() != 0) { - p.center = center / real_t(mesh_poly.size()); + polygon.clockwise = sum > 0; + if (!navigation_mesh_polygon.is_empty()) { + polygon.center = polygon_center / real_t(navigation_mesh_polygon.size()); } } + + surface_area = _new_region_surface_area; } diff --git a/modules/navigation/nav_region.h b/modules/navigation/nav_region.h index 6a8ebe5336..a9cfc53c7e 100644 --- a/modules/navigation/nav_region.h +++ b/modules/navigation/nav_region.h @@ -50,6 +50,8 @@ class NavRegion : public NavBase { /// Cache LocalVector<gd::Polygon> polygons; + real_t surface_area = 0.0; + public: NavRegion() { type = NavigationUtilities::PathSegmentType::PATH_SEGMENT_TYPE_REGION; @@ -93,6 +95,10 @@ public: return polygons; } + Vector3 get_random_point(uint32_t p_navigation_layers, bool p_uniformly) const; + + real_t get_surface_area() const { return surface_area; }; + bool sync(); private: diff --git a/modules/navigation/nav_utils.h b/modules/navigation/nav_utils.h index 6ddd8b9078..aa5ccc96dc 100644 --- a/modules/navigation/nav_utils.h +++ b/modules/navigation/nav_utils.h @@ -112,6 +112,8 @@ struct Polygon { /// The center of this `Polygon` Vector3 center; + + real_t surface_area = 0.0; }; struct NavigationPoly { diff --git a/modules/ogg/ogg_packet_sequence.cpp b/modules/ogg/ogg_packet_sequence.cpp index 1100367f03..1e6a9bbb6a 100644 --- a/modules/ogg/ogg_packet_sequence.cpp +++ b/modules/ogg/ogg_packet_sequence.cpp @@ -159,9 +159,7 @@ bool OggPacketSequencePlayback::next_ogg_packet(ogg_packet **p_packet) const { *p_packet = packet; - if (!packet->e_o_s) { // Added this so it doesn't try to go to the next packet if it's the last packet of the file. - packet_cursor++; - } + packet_cursor++; return true; } diff --git a/modules/openxr/action_map/openxr_action_map.cpp b/modules/openxr/action_map/openxr_action_map.cpp index 72866f1cf7..bbcb63a7e6 100644 --- a/modules/openxr/action_map/openxr_action_map.cpp +++ b/modules/openxr/action_map/openxr_action_map.cpp @@ -177,7 +177,6 @@ void OpenXRActionMap::create_default_action_sets() { Ref<OpenXRAction> trigger_touch = action_set->add_new_action("trigger_touch", "Trigger touching", OpenXRAction::OPENXR_ACTION_BOOL, "/user/hand/left,/user/hand/right"); Ref<OpenXRAction> grip = action_set->add_new_action("grip", "Grip", OpenXRAction::OPENXR_ACTION_FLOAT, "/user/hand/left,/user/hand/right"); Ref<OpenXRAction> grip_click = action_set->add_new_action("grip_click", "Grip click", OpenXRAction::OPENXR_ACTION_BOOL, "/user/hand/left,/user/hand/right"); - Ref<OpenXRAction> grip_touch = action_set->add_new_action("grip_touch", "Grip touching", OpenXRAction::OPENXR_ACTION_BOOL, "/user/hand/left,/user/hand/right"); Ref<OpenXRAction> grip_force = action_set->add_new_action("grip_force", "Grip force", OpenXRAction::OPENXR_ACTION_FLOAT, "/user/hand/left,/user/hand/right"); Ref<OpenXRAction> primary = action_set->add_new_action("primary", "Primary joystick/thumbstick/trackpad", OpenXRAction::OPENXR_ACTION_VECTOR2, "/user/hand/left,/user/hand/right"); Ref<OpenXRAction> primary_click = action_set->add_new_action("primary_click", "Primary joystick/thumbstick/trackpad click", OpenXRAction::OPENXR_ACTION_BOOL, "/user/hand/left,/user/hand/right"); diff --git a/modules/openxr/doc_classes/OpenXRInterface.xml b/modules/openxr/doc_classes/OpenXRInterface.xml index 6d1c215ffc..666d20d7e7 100644 --- a/modules/openxr/doc_classes/OpenXRInterface.xml +++ b/modules/openxr/doc_classes/OpenXRInterface.xml @@ -129,9 +129,11 @@ </member> <member name="foveation_dynamic" type="bool" setter="set_foveation_dynamic" getter="get_foveation_dynamic" default="false"> Enable dynamic foveation adjustment, the interface must be initialized before this is accessible. If enabled foveation will automatically adjusted between low and [member foveation_level]. + [b]Note:[/b] Only works on compatibility renderer. </member> <member name="foveation_level" type="int" setter="set_foveation_level" getter="get_foveation_level" default="0"> Set foveation level from 0 (off) to 3 (high), the interface must be initialized before this is accessible. + [b]Note:[/b] Only works on compatibility renderer. </member> <member name="render_target_size_multiplier" type="float" setter="set_render_target_size_multiplier" getter="get_render_target_size_multiplier" default="1.0"> The render size multiplier for the current HMD. Must be set before the interface has been initialized. diff --git a/modules/openxr/openxr_api.cpp b/modules/openxr/openxr_api.cpp index 3c606de670..da6fd2e9b2 100644 --- a/modules/openxr/openxr_api.cpp +++ b/modules/openxr/openxr_api.cpp @@ -87,7 +87,7 @@ String OpenXRAPI::get_default_action_map_resource_name() { return name; } -String OpenXRAPI::get_error_string(XrResult result) { +String OpenXRAPI::get_error_string(XrResult result) const { if (XR_SUCCEEDED(result)) { return String("Succeeded"); } @@ -1261,6 +1261,7 @@ bool OpenXRAPI::resolve_instance_openxr_symbols() { OPENXR_API_INIT_XR_FUNC_V(xrGetActionStateFloat); OPENXR_API_INIT_XR_FUNC_V(xrGetActionStateVector2f); OPENXR_API_INIT_XR_FUNC_V(xrGetCurrentInteractionProfile); + OPENXR_API_INIT_XR_FUNC_V(xrGetReferenceSpaceBoundsRect); OPENXR_API_INIT_XR_FUNC_V(xrGetSystem); OPENXR_API_INIT_XR_FUNC_V(xrGetSystemProperties); OPENXR_API_INIT_XR_FUNC_V(xrLocateViews); @@ -2072,6 +2073,25 @@ void OpenXRAPI::set_foveation_dynamic(bool p_foveation_dynamic) { } } +Size2 OpenXRAPI::get_play_space_bounds() const { + Size2 ret; + + ERR_FAIL_COND_V(session == XR_NULL_HANDLE, Size2()); + + XrExtent2Df extents; + + XrResult result = xrGetReferenceSpaceBoundsRect(session, reference_space, &extents); + if (XR_FAILED(result)) { + print_line("OpenXR: failed to get play space bounds! [", get_error_string(result), "]"); + return ret; + } + + ret.width = extents.width; + ret.height = extents.height; + + return ret; +} + OpenXRAPI::OpenXRAPI() { // OpenXRAPI is only constructed if OpenXR is enabled. singleton = this; diff --git a/modules/openxr/openxr_api.h b/modules/openxr/openxr_api.h index 64769b244c..efa32b7544 100644 --- a/modules/openxr/openxr_api.h +++ b/modules/openxr/openxr_api.h @@ -199,6 +199,7 @@ private: EXT_PROTO_XRRESULT_FUNC3(xrGetActionStateVector2f, (XrSession), session, (const XrActionStateGetInfo *), getInfo, (XrActionStateVector2f *), state) EXT_PROTO_XRRESULT_FUNC3(xrGetCurrentInteractionProfile, (XrSession), session, (XrPath), topLevelUserPath, (XrInteractionProfileState *), interactionProfile) EXT_PROTO_XRRESULT_FUNC2(xrGetInstanceProperties, (XrInstance), instance, (XrInstanceProperties *), instanceProperties) + EXT_PROTO_XRRESULT_FUNC3(xrGetReferenceSpaceBoundsRect, (XrSession), session, (XrReferenceSpaceType), referenceSpaceType, (XrExtent2Df *), bounds) EXT_PROTO_XRRESULT_FUNC3(xrGetSystem, (XrInstance), instance, (const XrSystemGetInfo *), getInfo, (XrSystemId *), systemId) EXT_PROTO_XRRESULT_FUNC3(xrGetSystemProperties, (XrInstance), instance, (XrSystemId), systemId, (XrSystemProperties *), properties) EXT_PROTO_XRRESULT_FUNC4(xrLocateSpace, (XrSpace), space, (XrSpace), baseSpace, (XrTime), time, (XrSpaceLocation *), location) @@ -317,7 +318,7 @@ public: XrResult try_get_instance_proc_addr(const char *p_name, PFN_xrVoidFunction *p_addr); XrResult get_instance_proc_addr(const char *p_name, PFN_xrVoidFunction *p_addr); - String get_error_string(XrResult result); + String get_error_string(XrResult result) const; String get_swapchain_format_name(int64_t p_swapchain_format) const; void set_xr_interface(OpenXRInterface *p_xr_interface); @@ -380,6 +381,9 @@ public: bool get_foveation_dynamic() const; void set_foveation_dynamic(bool p_foveation_dynamic); + // Play space. + Size2 get_play_space_bounds() const; + // action map String get_default_action_map_resource_name(); diff --git a/modules/openxr/openxr_interface.cpp b/modules/openxr/openxr_interface.cpp index 8ce76a5fad..66f8192c9e 100644 --- a/modules/openxr/openxr_interface.cpp +++ b/modules/openxr/openxr_interface.cpp @@ -690,6 +690,42 @@ bool OpenXRInterface::set_play_area_mode(XRInterface::PlayAreaMode p_mode) { return false; } +PackedVector3Array OpenXRInterface::get_play_area() const { + XRServer *xr_server = XRServer::get_singleton(); + ERR_FAIL_NULL_V(xr_server, PackedVector3Array()); + PackedVector3Array arr; + + Vector3 sides[4] = { + Vector3(-0.5f, 0.0f, -0.5f), + Vector3(0.5f, 0.0f, -0.5f), + Vector3(0.5f, 0.0f, 0.5f), + Vector3(-0.5f, 0.0f, 0.5f), + }; + + if (openxr_api != nullptr && openxr_api->is_initialized()) { + Size2 extents = openxr_api->get_play_space_bounds(); + if (extents.width != 0.0 && extents.height != 0.0) { + Transform3D reference_frame = xr_server->get_reference_frame(); + + for (int i = 0; i < 4; i++) { + Vector3 coord = sides[i]; + + // Scale it up. + coord.x *= extents.width; + coord.z *= extents.height; + + // Now apply our reference. + Vector3 out = reference_frame.xform(coord); + arr.push_back(out); + } + } else { + WARN_PRINT_ONCE("OpenXR: No extents available."); + } + } + + return arr; +} + float OpenXRInterface::get_display_refresh_rate() const { if (openxr_api == nullptr) { return 0.0; diff --git a/modules/openxr/openxr_interface.h b/modules/openxr/openxr_interface.h index 51ef4ea228..489d0845ba 100644 --- a/modules/openxr/openxr_interface.h +++ b/modules/openxr/openxr_interface.h @@ -125,6 +125,7 @@ public: virtual bool supports_play_area_mode(XRInterface::PlayAreaMode p_mode) override; virtual XRInterface::PlayAreaMode get_play_area_mode() const override; virtual bool set_play_area_mode(XRInterface::PlayAreaMode p_mode) override; + virtual PackedVector3Array get_play_area() const override; float get_display_refresh_rate() const; void set_display_refresh_rate(float p_refresh_rate); diff --git a/modules/squish/image_decompress_squish.cpp b/modules/squish/image_decompress_squish.cpp index 5b35a2643a..fba76621d6 100644 --- a/modules/squish/image_decompress_squish.cpp +++ b/modules/squish/image_decompress_squish.cpp @@ -36,7 +36,9 @@ void image_decompress_squish(Image *p_image) { int w = p_image->get_width(); int h = p_image->get_height(); + Image::Format source_format = p_image->get_format(); Image::Format target_format = Image::FORMAT_RGBA8; + Vector<uint8_t> data; int target_size = Image::get_image_data_size(w, h, target_format, p_image->has_mipmaps()); int mm_count = p_image->get_mipmap_count(); @@ -45,33 +47,49 @@ void image_decompress_squish(Image *p_image) { const uint8_t *rb = p_image->get_data().ptr(); uint8_t *wb = data.ptrw(); - int squish_flags = Image::FORMAT_MAX; - if (p_image->get_format() == Image::FORMAT_DXT1) { - squish_flags = squish::kDxt1; - } else if (p_image->get_format() == Image::FORMAT_DXT3) { - squish_flags = squish::kDxt3; - } else if (p_image->get_format() == Image::FORMAT_DXT5 || p_image->get_format() == Image::FORMAT_DXT5_RA_AS_RG) { - squish_flags = squish::kDxt5; - } else if (p_image->get_format() == Image::FORMAT_RGTC_R) { - squish_flags = squish::kBc4; - } else if (p_image->get_format() == Image::FORMAT_RGTC_RG) { - squish_flags = squish::kBc5; - } else { - ERR_FAIL_MSG("Squish: Can't decompress unknown format: " + itos(p_image->get_format()) + "."); + int squish_flags = 0; + + switch (source_format) { + case Image::FORMAT_DXT1: + squish_flags = squish::kDxt1; + break; + + case Image::FORMAT_DXT3: + squish_flags = squish::kDxt3; + break; + + case Image::FORMAT_DXT5: + case Image::FORMAT_DXT5_RA_AS_RG: + squish_flags = squish::kDxt5; + break; + + case Image::FORMAT_RGTC_R: + squish_flags = squish::kBc4; + break; + + case Image::FORMAT_RGTC_RG: + squish_flags = squish::kBc5; + break; + + default: + ERR_FAIL_MSG("Squish: Can't decompress unknown format: " + itos(p_image->get_format()) + "."); + break; } for (int i = 0; i <= mm_count; i++) { int src_ofs = 0, mipmap_size = 0, mipmap_w = 0, mipmap_h = 0; p_image->get_mipmap_offset_size_and_dimensions(i, src_ofs, mipmap_size, mipmap_w, mipmap_h); + int dst_ofs = Image::get_image_mipmap_offset(p_image->get_width(), p_image->get_height(), target_format, i); squish::DecompressImage(&wb[dst_ofs], w, h, &rb[src_ofs], squish_flags); + w >>= 1; h >>= 1; } p_image->set_data(p_image->get_width(), p_image->get_height(), p_image->has_mipmaps(), target_format, data); - if (p_image->get_format() == Image::FORMAT_DXT5_RA_AS_RG) { + if (source_format == Image::FORMAT_DXT5_RA_AS_RG) { p_image->convert_ra_rgba8_to_rg(); } } diff --git a/modules/text_server_adv/text_server_adv.cpp b/modules/text_server_adv/text_server_adv.cpp index 6d0a398218..bcc7bff909 100644 --- a/modules/text_server_adv/text_server_adv.cpp +++ b/modules/text_server_adv/text_server_adv.cpp @@ -3504,6 +3504,9 @@ void TextServerAdvanced::_font_render_glyph(const RID &p_font_rid, const Vector2 } void TextServerAdvanced::_font_draw_glyph(const RID &p_font_rid, const RID &p_canvas, int64_t p_size, const Vector2 &p_pos, int64_t p_index, const Color &p_color) const { + if (p_index == 0) { + return; // Non visual character, skip. + } FontAdvanced *fd = _get_font_data(p_font_rid); ERR_FAIL_NULL(fd); @@ -3541,6 +3544,9 @@ void TextServerAdvanced::_font_draw_glyph(const RID &p_font_rid, const RID &p_ca const FontGlyph &gl = fd->cache[size]->glyph_map[index]; if (gl.found) { + if (gl.uv_rect.size.x <= 2 || gl.uv_rect.size.y <= 2) { + return; // Nothing to draw. + } ERR_FAIL_COND(gl.texture_idx < -1 || gl.texture_idx >= fd->cache[size]->textures.size()); if (gl.texture_idx != -1) { @@ -3608,6 +3614,9 @@ void TextServerAdvanced::_font_draw_glyph(const RID &p_font_rid, const RID &p_ca } void TextServerAdvanced::_font_draw_glyph_outline(const RID &p_font_rid, const RID &p_canvas, int64_t p_size, int64_t p_outline_size, const Vector2 &p_pos, int64_t p_index, const Color &p_color) const { + if (p_index == 0) { + return; // Non visual character, skip. + } FontAdvanced *fd = _get_font_data(p_font_rid); ERR_FAIL_NULL(fd); @@ -3645,6 +3654,9 @@ void TextServerAdvanced::_font_draw_glyph_outline(const RID &p_font_rid, const R const FontGlyph &gl = fd->cache[size]->glyph_map[index]; if (gl.found) { + if (gl.uv_rect.size.x <= 2 || gl.uv_rect.size.y <= 2) { + return; // Nothing to draw. + } ERR_FAIL_COND(gl.texture_idx < -1 || gl.texture_idx >= fd->cache[size]->textures.size()); if (gl.texture_idx != -1) { @@ -4048,6 +4060,20 @@ String TextServerAdvanced::_shaped_text_get_custom_punctuation(const RID &p_shap return sd->custom_punct; } +void TextServerAdvanced::_shaped_text_set_custom_ellipsis(const RID &p_shaped, int64_t p_char) { + _THREAD_SAFE_METHOD_ + ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); + ERR_FAIL_NULL(sd); + sd->el_char = p_char; +} + +int64_t TextServerAdvanced::_shaped_text_get_custom_ellipsis(const RID &p_shaped) const { + _THREAD_SAFE_METHOD_ + const ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); + ERR_FAIL_NULL_V(sd, 0); + return sd->el_char; +} + void TextServerAdvanced::_shaped_text_set_bidi_override(const RID &p_shaped, const Array &p_override) { ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_NULL(sd); @@ -4800,6 +4826,166 @@ double TextServerAdvanced::_shaped_text_tab_align(const RID &p_shaped, const Pac return 0.0; } +RID TextServerAdvanced::_find_sys_font_for_text(const RID &p_fdef, const String &p_script_code, const String &p_language, const String &p_text) { + RID f; + // Try system fallback. + String font_name = _font_get_name(p_fdef); + BitField<FontStyle> font_style = _font_get_style(p_fdef); + int font_weight = _font_get_weight(p_fdef); + int font_stretch = _font_get_stretch(p_fdef); + Dictionary dvar = _font_get_variation_coordinates(p_fdef); + static int64_t wgth_tag = _name_to_tag("weight"); + static int64_t wdth_tag = _name_to_tag("width"); + static int64_t ital_tag = _name_to_tag("italic"); + if (dvar.has(wgth_tag)) { + font_weight = dvar[wgth_tag].operator int(); + } + if (dvar.has(wdth_tag)) { + font_stretch = dvar[wdth_tag].operator int(); + } + if (dvar.has(ital_tag) && dvar[ital_tag].operator int() == 1) { + font_style.set_flag(TextServer::FONT_ITALIC); + } + + String locale = (p_language.is_empty()) ? TranslationServer::get_singleton()->get_tool_locale() : p_language; + PackedStringArray fallback_font_name = OS::get_singleton()->get_system_font_path_for_text(font_name, p_text, locale, p_script_code, font_weight, font_stretch, font_style & TextServer::FONT_ITALIC); +#ifdef GDEXTENSION + for (int fb = 0; fb < fallback_font_name.size(); fb++) { + const String &E = fallback_font_name[fb]; +#else + for (const String &E : fallback_font_name) { +#endif + SystemFontKey key = SystemFontKey(E, font_style & TextServer::FONT_ITALIC, font_weight, font_stretch, p_fdef, this); + if (system_fonts.has(key)) { + const SystemFontCache &sysf_cache = system_fonts[key]; + int best_score = 0; + int best_match = -1; + for (int face_idx = 0; face_idx < sysf_cache.var.size(); face_idx++) { + const SystemFontCacheRec &F = sysf_cache.var[face_idx]; + if (unlikely(!_font_has_char(F.rid, p_text[0]))) { + continue; + } + BitField<FontStyle> style = _font_get_style(F.rid); + int weight = _font_get_weight(F.rid); + int stretch = _font_get_stretch(F.rid); + int score = (20 - Math::abs(weight - font_weight) / 50); + score += (20 - Math::abs(stretch - font_stretch) / 10); + if (bool(style & TextServer::FONT_ITALIC) == bool(font_style & TextServer::FONT_ITALIC)) { + score += 30; + } + if (score >= best_score) { + best_score = score; + best_match = face_idx; + } + if (best_score == 70) { + break; + } + } + if (best_match != -1) { + f = sysf_cache.var[best_match].rid; + } + } + if (!f.is_valid()) { + if (system_fonts.has(key)) { + const SystemFontCache &sysf_cache = system_fonts[key]; + if (sysf_cache.max_var == sysf_cache.var.size()) { + // All subfonts already tested, skip. + continue; + } + } + + if (!system_font_data.has(E)) { + system_font_data[E] = FileAccess::get_file_as_bytes(E); + } + + const PackedByteArray &font_data = system_font_data[E]; + + SystemFontCacheRec sysf; + sysf.rid = _create_font(); + _font_set_data_ptr(sysf.rid, font_data.ptr(), font_data.size()); + + Dictionary var = dvar; + // Select matching style from collection. + int best_score = 0; + int best_match = -1; + for (int face_idx = 0; face_idx < _font_get_face_count(sysf.rid); face_idx++) { + _font_set_face_index(sysf.rid, face_idx); + if (unlikely(!_font_has_char(sysf.rid, p_text[0]))) { + continue; + } + BitField<FontStyle> style = _font_get_style(sysf.rid); + int weight = _font_get_weight(sysf.rid); + int stretch = _font_get_stretch(sysf.rid); + int score = (20 - Math::abs(weight - font_weight) / 50); + score += (20 - Math::abs(stretch - font_stretch) / 10); + if (bool(style & TextServer::FONT_ITALIC) == bool(font_style & TextServer::FONT_ITALIC)) { + score += 30; + } + if (score >= best_score) { + best_score = score; + best_match = face_idx; + } + if (best_score == 70) { + break; + } + } + if (best_match == -1) { + _free_rid(sysf.rid); + continue; + } else { + _font_set_face_index(sysf.rid, best_match); + } + sysf.index = best_match; + + // If it's a variable font, apply weight, stretch and italic coordinates to match requested style. + if (best_score != 70) { + Dictionary ftr = _font_supported_variation_list(sysf.rid); + if (ftr.has(wdth_tag)) { + var[wdth_tag] = font_stretch; + _font_set_stretch(sysf.rid, font_stretch); + } + if (ftr.has(wgth_tag)) { + var[wgth_tag] = font_weight; + _font_set_weight(sysf.rid, font_weight); + } + if ((font_style & TextServer::FONT_ITALIC) && ftr.has(ital_tag)) { + var[ital_tag] = 1; + _font_set_style(sysf.rid, _font_get_style(sysf.rid) | TextServer::FONT_ITALIC); + } + } + + _font_set_antialiasing(sysf.rid, key.antialiasing); + _font_set_generate_mipmaps(sysf.rid, key.mipmaps); + _font_set_multichannel_signed_distance_field(sysf.rid, key.msdf); + _font_set_msdf_pixel_range(sysf.rid, key.msdf_range); + _font_set_msdf_size(sysf.rid, key.msdf_source_size); + _font_set_fixed_size(sysf.rid, key.fixed_size); + _font_set_force_autohinter(sysf.rid, key.force_autohinter); + _font_set_hinting(sysf.rid, key.hinting); + _font_set_subpixel_positioning(sysf.rid, key.subpixel_positioning); + _font_set_variation_coordinates(sysf.rid, var); + _font_set_oversampling(sysf.rid, key.oversampling); + _font_set_embolden(sysf.rid, key.embolden); + _font_set_transform(sysf.rid, key.transform); + _font_set_spacing(sysf.rid, SPACING_TOP, key.extra_spacing[SPACING_TOP]); + _font_set_spacing(sysf.rid, SPACING_BOTTOM, key.extra_spacing[SPACING_BOTTOM]); + _font_set_spacing(sysf.rid, SPACING_SPACE, key.extra_spacing[SPACING_SPACE]); + _font_set_spacing(sysf.rid, SPACING_GLYPH, key.extra_spacing[SPACING_GLYPH]); + + if (system_fonts.has(key)) { + system_fonts[key].var.push_back(sysf); + } else { + SystemFontCache &sysf_cache = system_fonts[key]; + sysf_cache.max_var = _font_get_face_count(sysf.rid); + sysf_cache.var.push_back(sysf); + } + f = sysf.rid; + } + break; + } + return f; +} + void TextServerAdvanced::_shaped_text_overrun_trim_to_width(const RID &p_shaped_line, double p_width, BitField<TextServer::TextOverrunFlag> p_trim_flags) { ShapedTextDataAdvanced *sd = shaped_owner.get_or_null(p_shaped_line); ERR_FAIL_NULL_MSG(sd, "ShapedTextDataAdvanced invalid."); @@ -4842,20 +5028,52 @@ void TextServerAdvanced::_shaped_text_overrun_trim_to_width(const RID &p_shaped_ int sd_size = sd->glyphs.size(); int last_gl_font_size = sd_glyphs[sd_size - 1].font_size; + bool found_el_char = false; // Find usable fonts, if fonts from the last glyph do not have required chars. RID dot_gl_font_rid = sd_glyphs[sd_size - 1].font_rid; - if (!_font_has_char(dot_gl_font_rid, '.')) { + if (!_font_has_char(dot_gl_font_rid, sd->el_char)) { const Array &fonts = spans[spans.size() - 1].fonts; for (int i = 0; i < fonts.size(); i++) { - if (_font_has_char(fonts[i], '.')) { + if (_font_has_char(fonts[i], sd->el_char)) { dot_gl_font_rid = fonts[i]; + found_el_char = true; break; } } + if (!found_el_char && OS::get_singleton()->has_feature("system_fonts") && fonts.size() > 0 && _font_is_allow_system_fallback(fonts[0])) { + const char32_t u32str[] = { sd->el_char, 0 }; + RID rid = _find_sys_font_for_text(fonts[0], String(), spans[spans.size() - 1].language, u32str); + if (rid.is_valid()) { + dot_gl_font_rid = rid; + found_el_char = true; + } + } + } else { + found_el_char = true; + } + if (!found_el_char) { + bool found_dot_char = false; + dot_gl_font_rid = sd_glyphs[sd_size - 1].font_rid; + if (!_font_has_char(dot_gl_font_rid, '.')) { + const Array &fonts = spans[spans.size() - 1].fonts; + for (int i = 0; i < fonts.size(); i++) { + if (_font_has_char(fonts[i], '.')) { + dot_gl_font_rid = fonts[i]; + found_dot_char = true; + break; + } + } + if (!found_dot_char && OS::get_singleton()->has_feature("system_fonts") && fonts.size() > 0 && _font_is_allow_system_fallback(fonts[0])) { + RID rid = _find_sys_font_for_text(fonts[0], String(), spans[spans.size() - 1].language, "."); + if (rid.is_valid()) { + dot_gl_font_rid = rid; + } + } + } } RID whitespace_gl_font_rid = sd_glyphs[sd_size - 1].font_rid; - if (!_font_has_char(whitespace_gl_font_rid, '.')) { + if (!_font_has_char(whitespace_gl_font_rid, ' ')) { const Array &fonts = spans[spans.size() - 1].fonts; for (int i = 0; i < fonts.size(); i++) { if (_font_has_char(fonts[i], ' ')) { @@ -4865,14 +5083,14 @@ void TextServerAdvanced::_shaped_text_overrun_trim_to_width(const RID &p_shaped_ } } - int32_t dot_gl_idx = dot_gl_font_rid.is_valid() ? _font_get_glyph_index(dot_gl_font_rid, last_gl_font_size, '.', 0) : -10; + int32_t dot_gl_idx = dot_gl_font_rid.is_valid() ? _font_get_glyph_index(dot_gl_font_rid, last_gl_font_size, (found_el_char ? sd->el_char : '.'), 0) : -1; Vector2 dot_adv = dot_gl_font_rid.is_valid() ? _font_get_glyph_advance(dot_gl_font_rid, last_gl_font_size, dot_gl_idx) : Vector2(); - int32_t whitespace_gl_idx = whitespace_gl_font_rid.is_valid() ? _font_get_glyph_index(whitespace_gl_font_rid, last_gl_font_size, ' ', 0) : -10; + int32_t whitespace_gl_idx = whitespace_gl_font_rid.is_valid() ? _font_get_glyph_index(whitespace_gl_font_rid, last_gl_font_size, ' ', 0) : -1; Vector2 whitespace_adv = whitespace_gl_font_rid.is_valid() ? _font_get_glyph_advance(whitespace_gl_font_rid, last_gl_font_size, whitespace_gl_idx) : Vector2(); int ellipsis_width = 0; if (add_ellipsis && whitespace_gl_font_rid.is_valid()) { - ellipsis_width = 3 * dot_adv.x + sd->extra_spacing[SPACING_GLYPH] + _font_get_spacing(dot_gl_font_rid, SPACING_GLYPH) + (cut_per_word ? whitespace_adv.x : 0); + ellipsis_width = (found_el_char ? 1 : 3) * dot_adv.x + sd->extra_spacing[SPACING_GLYPH] + _font_get_spacing(dot_gl_font_rid, SPACING_GLYPH) + (cut_per_word ? whitespace_adv.x : 0); } int ell_min_characters = 6; @@ -4951,7 +5169,7 @@ void TextServerAdvanced::_shaped_text_overrun_trim_to_width(const RID &p_shaped_ if (dot_gl_idx != 0) { Glyph gl; gl.count = 1; - gl.repeat = 3; + gl.repeat = (found_el_char ? 1 : 3); gl.advance = dot_adv.x; gl.index = dot_gl_idx; gl.font_rid = dot_gl_font_rid; @@ -5580,166 +5798,12 @@ void TextServerAdvanced::_shape_run(ShapedTextDataAdvanced *p_sd, int64_t p_star break; } } - String text = p_sd->text.substr(p_start, next - p_start); - - String font_name = _font_get_name(fdef); - BitField<FontStyle> font_style = _font_get_style(fdef); - int font_weight = _font_get_weight(fdef); - int font_stretch = _font_get_stretch(fdef); - Dictionary dvar = _font_get_variation_coordinates(fdef); - static int64_t wgth_tag = _name_to_tag("weight"); - static int64_t wdth_tag = _name_to_tag("width"); - static int64_t ital_tag = _name_to_tag("italic"); - if (dvar.has(wgth_tag)) { - font_weight = dvar[wgth_tag].operator int(); - } - if (dvar.has(wdth_tag)) { - font_stretch = dvar[wdth_tag].operator int(); - } - if (dvar.has(ital_tag) && dvar[ital_tag].operator int() == 1) { - font_style.set_flag(TextServer::FONT_ITALIC); - } - char scr_buffer[5] = { 0, 0, 0, 0, 0 }; hb_tag_to_string(hb_script_to_iso15924_tag(p_script), scr_buffer); String script_code = String(scr_buffer); - String locale = (p_sd->spans[p_span].language.is_empty()) ? TranslationServer::get_singleton()->get_tool_locale() : p_sd->spans[p_span].language; - - PackedStringArray fallback_font_name = OS::get_singleton()->get_system_font_path_for_text(font_name, text, locale, script_code, font_weight, font_stretch, font_style & TextServer::FONT_ITALIC); -#ifdef GDEXTENSION - for (int fb = 0; fb < fallback_font_name.size(); fb++) { - const String &E = fallback_font_name[fb]; -#else - for (const String &E : fallback_font_name) { -#endif - SystemFontKey key = SystemFontKey(E, font_style & TextServer::FONT_ITALIC, font_weight, font_stretch, fdef, this); - if (system_fonts.has(key)) { - const SystemFontCache &sysf_cache = system_fonts[key]; - int best_score = 0; - int best_match = -1; - for (int face_idx = 0; face_idx < sysf_cache.var.size(); face_idx++) { - const SystemFontCacheRec &F = sysf_cache.var[face_idx]; - if (unlikely(!_font_has_char(F.rid, text[0]))) { - continue; - } - BitField<FontStyle> style = _font_get_style(F.rid); - int weight = _font_get_weight(F.rid); - int stretch = _font_get_stretch(F.rid); - int score = (20 - Math::abs(weight - font_weight) / 50); - score += (20 - Math::abs(stretch - font_stretch) / 10); - if (bool(style & TextServer::FONT_ITALIC) == bool(font_style & TextServer::FONT_ITALIC)) { - score += 30; - } - if (score >= best_score) { - best_score = score; - best_match = face_idx; - } - if (best_score == 70) { - break; - } - } - if (best_match != -1) { - f = sysf_cache.var[best_match].rid; - } - } - if (!f.is_valid()) { - if (system_fonts.has(key)) { - const SystemFontCache &sysf_cache = system_fonts[key]; - if (sysf_cache.max_var == sysf_cache.var.size()) { - // All subfonts already tested, skip. - continue; - } - } - if (!system_font_data.has(E)) { - system_font_data[E] = FileAccess::get_file_as_bytes(E); - } - - const PackedByteArray &font_data = system_font_data[E]; - - SystemFontCacheRec sysf; - sysf.rid = _create_font(); - _font_set_data_ptr(sysf.rid, font_data.ptr(), font_data.size()); - - Dictionary var = dvar; - // Select matching style from collection. - int best_score = 0; - int best_match = -1; - for (int face_idx = 0; face_idx < _font_get_face_count(sysf.rid); face_idx++) { - _font_set_face_index(sysf.rid, face_idx); - if (unlikely(!_font_has_char(sysf.rid, text[0]))) { - continue; - } - BitField<FontStyle> style = _font_get_style(sysf.rid); - int weight = _font_get_weight(sysf.rid); - int stretch = _font_get_stretch(sysf.rid); - int score = (20 - Math::abs(weight - font_weight) / 50); - score += (20 - Math::abs(stretch - font_stretch) / 10); - if (bool(style & TextServer::FONT_ITALIC) == bool(font_style & TextServer::FONT_ITALIC)) { - score += 30; - } - if (score >= best_score) { - best_score = score; - best_match = face_idx; - } - if (best_score == 70) { - break; - } - } - if (best_match == -1) { - _free_rid(sysf.rid); - continue; - } else { - _font_set_face_index(sysf.rid, best_match); - } - sysf.index = best_match; - - // If it's a variable font, apply weight, stretch and italic coordinates to match requested style. - if (best_score != 70) { - Dictionary ftr = _font_supported_variation_list(sysf.rid); - if (ftr.has(wdth_tag)) { - var[wdth_tag] = font_stretch; - _font_set_stretch(sysf.rid, font_stretch); - } - if (ftr.has(wgth_tag)) { - var[wgth_tag] = font_weight; - _font_set_weight(sysf.rid, font_weight); - } - if ((font_style & TextServer::FONT_ITALIC) && ftr.has(ital_tag)) { - var[ital_tag] = 1; - _font_set_style(sysf.rid, _font_get_style(sysf.rid) | TextServer::FONT_ITALIC); - } - } - - _font_set_antialiasing(sysf.rid, key.antialiasing); - _font_set_generate_mipmaps(sysf.rid, key.mipmaps); - _font_set_multichannel_signed_distance_field(sysf.rid, key.msdf); - _font_set_msdf_pixel_range(sysf.rid, key.msdf_range); - _font_set_msdf_size(sysf.rid, key.msdf_source_size); - _font_set_fixed_size(sysf.rid, key.fixed_size); - _font_set_force_autohinter(sysf.rid, key.force_autohinter); - _font_set_hinting(sysf.rid, key.hinting); - _font_set_subpixel_positioning(sysf.rid, key.subpixel_positioning); - _font_set_variation_coordinates(sysf.rid, var); - _font_set_oversampling(sysf.rid, key.oversampling); - _font_set_embolden(sysf.rid, key.embolden); - _font_set_transform(sysf.rid, key.transform); - _font_set_spacing(sysf.rid, SPACING_TOP, key.extra_spacing[SPACING_TOP]); - _font_set_spacing(sysf.rid, SPACING_BOTTOM, key.extra_spacing[SPACING_BOTTOM]); - _font_set_spacing(sysf.rid, SPACING_SPACE, key.extra_spacing[SPACING_SPACE]); - _font_set_spacing(sysf.rid, SPACING_GLYPH, key.extra_spacing[SPACING_GLYPH]); - - if (system_fonts.has(key)) { - system_fonts[key].var.push_back(sysf); - } else { - SystemFontCache &sysf_cache = system_fonts[key]; - sysf_cache.max_var = _font_get_face_count(sysf.rid); - sysf_cache.var.push_back(sysf); - } - f = sysf.rid; - } - break; - } + String text = p_sd->text.substr(p_start, next - p_start); + f = _find_sys_font_for_text(fdef, script_code, p_sd->spans[p_span].language, text); } } diff --git a/modules/text_server_adv/text_server_adv.h b/modules/text_server_adv/text_server_adv.h index cbd2911aaf..e5d0ab3105 100644 --- a/modules/text_server_adv/text_server_adv.h +++ b/modules/text_server_adv/text_server_adv.h @@ -502,6 +502,7 @@ class TextServerAdvanced : public TextServerExtension { double upos = 0.0; double uthk = 0.0; + char32_t el_char = 0x2026; TrimData overrun_trim_data; bool fit_width_minimum_reached = false; @@ -647,6 +648,7 @@ class TextServerAdvanced : public TextServerExtension { bool _shape_substr(ShapedTextDataAdvanced *p_new_sd, const ShapedTextDataAdvanced *p_sd, int64_t p_start, int64_t p_length) const; void _shape_run(ShapedTextDataAdvanced *p_sd, int64_t p_start, int64_t p_end, hb_script_t p_script, hb_direction_t p_direction, TypedArray<RID> p_fonts, int64_t p_span, int64_t p_fb_index, int64_t p_prev_start, int64_t p_prev_end); Glyph _shape_single_glyph(ShapedTextDataAdvanced *p_sd, char32_t p_char, hb_script_t p_script, hb_direction_t p_direction, const RID &p_font, int64_t p_font_size); + _FORCE_INLINE_ RID _find_sys_font_for_text(const RID &p_fdef, const String &p_script_code, const String &p_language, const String &p_text); _FORCE_INLINE_ void _add_featuers(const Dictionary &p_source, Vector<hb_feature_t> &r_ftrs); @@ -899,6 +901,9 @@ public: MODBIND2(shaped_text_set_custom_punctuation, const RID &, const String &); MODBIND1RC(String, shaped_text_get_custom_punctuation, const RID &); + MODBIND2(shaped_text_set_custom_ellipsis, const RID &, int64_t); + MODBIND1RC(int64_t, shaped_text_get_custom_ellipsis, const RID &); + MODBIND2(shaped_text_set_orientation, const RID &, Orientation); MODBIND1RC(Orientation, shaped_text_get_orientation, const RID &); diff --git a/modules/text_server_fb/text_server_fb.cpp b/modules/text_server_fb/text_server_fb.cpp index f12275d10c..8fc7694aa4 100644 --- a/modules/text_server_fb/text_server_fb.cpp +++ b/modules/text_server_fb/text_server_fb.cpp @@ -2439,6 +2439,9 @@ void TextServerFallback::_font_render_glyph(const RID &p_font_rid, const Vector2 } void TextServerFallback::_font_draw_glyph(const RID &p_font_rid, const RID &p_canvas, int64_t p_size, const Vector2 &p_pos, int64_t p_index, const Color &p_color) const { + if (p_index == 0) { + return; // Non visual character, skip. + } FontFallback *fd = _get_font_data(p_font_rid); ERR_FAIL_NULL(fd); @@ -2476,6 +2479,9 @@ void TextServerFallback::_font_draw_glyph(const RID &p_font_rid, const RID &p_ca const FontGlyph &gl = fd->cache[size]->glyph_map[index]; if (gl.found) { + if (gl.uv_rect.size.x <= 2 || gl.uv_rect.size.y <= 2) { + return; // Nothing to draw. + } ERR_FAIL_COND(gl.texture_idx < -1 || gl.texture_idx >= fd->cache[size]->textures.size()); if (gl.texture_idx != -1) { @@ -2543,6 +2549,9 @@ void TextServerFallback::_font_draw_glyph(const RID &p_font_rid, const RID &p_ca } void TextServerFallback::_font_draw_glyph_outline(const RID &p_font_rid, const RID &p_canvas, int64_t p_size, int64_t p_outline_size, const Vector2 &p_pos, int64_t p_index, const Color &p_color) const { + if (p_index == 0) { + return; // Non visual character, skip. + } FontFallback *fd = _get_font_data(p_font_rid); ERR_FAIL_NULL(fd); @@ -2580,6 +2589,9 @@ void TextServerFallback::_font_draw_glyph_outline(const RID &p_font_rid, const R const FontGlyph &gl = fd->cache[size]->glyph_map[index]; if (gl.found) { + if (gl.uv_rect.size.x <= 2 || gl.uv_rect.size.y <= 2) { + return; // Nothing to draw. + } ERR_FAIL_COND(gl.texture_idx < -1 || gl.texture_idx >= fd->cache[size]->textures.size()); if (gl.texture_idx != -1) { @@ -2905,6 +2917,20 @@ String TextServerFallback::_shaped_text_get_custom_punctuation(const RID &p_shap return sd->custom_punct; } +void TextServerFallback::_shaped_text_set_custom_ellipsis(const RID &p_shaped, int64_t p_char) { + _THREAD_SAFE_METHOD_ + ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); + ERR_FAIL_NULL(sd); + sd->el_char = p_char; +} + +int64_t TextServerFallback::_shaped_text_get_custom_ellipsis(const RID &p_shaped) const { + _THREAD_SAFE_METHOD_ + const ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); + ERR_FAIL_NULL_V(sd, 0); + return sd->el_char; +} + void TextServerFallback::_shaped_text_set_orientation(const RID &p_shaped, TextServer::Orientation p_orientation) { ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped); ERR_FAIL_NULL(sd); @@ -3601,6 +3627,168 @@ bool TextServerFallback::_shaped_text_update_justification_ops(const RID &p_shap return true; } +RID TextServerFallback::_find_sys_font_for_text(const RID &p_fdef, const String &p_script_code, const String &p_language, const String &p_text) { + RID f; + // Try system fallback. + if (_font_is_allow_system_fallback(p_fdef)) { + String font_name = _font_get_name(p_fdef); + BitField<FontStyle> font_style = _font_get_style(p_fdef); + int font_weight = _font_get_weight(p_fdef); + int font_stretch = _font_get_stretch(p_fdef); + Dictionary dvar = _font_get_variation_coordinates(p_fdef); + static int64_t wgth_tag = _name_to_tag("weight"); + static int64_t wdth_tag = _name_to_tag("width"); + static int64_t ital_tag = _name_to_tag("italic"); + if (dvar.has(wgth_tag)) { + font_weight = dvar[wgth_tag].operator int(); + } + if (dvar.has(wdth_tag)) { + font_stretch = dvar[wdth_tag].operator int(); + } + if (dvar.has(ital_tag) && dvar[ital_tag].operator int() == 1) { + font_style.set_flag(TextServer::FONT_ITALIC); + } + + String locale = (p_language.is_empty()) ? TranslationServer::get_singleton()->get_tool_locale() : p_language; + PackedStringArray fallback_font_name = OS::get_singleton()->get_system_font_path_for_text(font_name, p_text, locale, p_script_code, font_weight, font_stretch, font_style & TextServer::FONT_ITALIC); +#ifdef GDEXTENSION + for (int fb = 0; fb < fallback_font_name.size(); fb++) { + const String &E = fallback_font_name[fb]; +#else + for (const String &E : fallback_font_name) { +#endif + SystemFontKey key = SystemFontKey(E, font_style & TextServer::FONT_ITALIC, font_weight, font_stretch, p_fdef, this); + if (system_fonts.has(key)) { + const SystemFontCache &sysf_cache = system_fonts[key]; + int best_score = 0; + int best_match = -1; + for (int face_idx = 0; face_idx < sysf_cache.var.size(); face_idx++) { + const SystemFontCacheRec &F = sysf_cache.var[face_idx]; + if (unlikely(!_font_has_char(F.rid, p_text[0]))) { + continue; + } + BitField<FontStyle> style = _font_get_style(F.rid); + int weight = _font_get_weight(F.rid); + int stretch = _font_get_stretch(F.rid); + int score = (20 - Math::abs(weight - font_weight) / 50); + score += (20 - Math::abs(stretch - font_stretch) / 10); + if (bool(style & TextServer::FONT_ITALIC) == bool(font_style & TextServer::FONT_ITALIC)) { + score += 30; + } + if (score >= best_score) { + best_score = score; + best_match = face_idx; + } + if (best_score == 70) { + break; + } + } + if (best_match != -1) { + f = sysf_cache.var[best_match].rid; + } + } + if (!f.is_valid()) { + if (system_fonts.has(key)) { + const SystemFontCache &sysf_cache = system_fonts[key]; + if (sysf_cache.max_var == sysf_cache.var.size()) { + // All subfonts already tested, skip. + continue; + } + } + + if (!system_font_data.has(E)) { + system_font_data[E] = FileAccess::get_file_as_bytes(E); + } + + const PackedByteArray &font_data = system_font_data[E]; + + SystemFontCacheRec sysf; + sysf.rid = _create_font(); + _font_set_data_ptr(sysf.rid, font_data.ptr(), font_data.size()); + + Dictionary var = dvar; + // Select matching style from collection. + int best_score = 0; + int best_match = -1; + for (int face_idx = 0; face_idx < _font_get_face_count(sysf.rid); face_idx++) { + _font_set_face_index(sysf.rid, face_idx); + if (unlikely(!_font_has_char(sysf.rid, p_text[0]))) { + continue; + } + BitField<FontStyle> style = _font_get_style(sysf.rid); + int weight = _font_get_weight(sysf.rid); + int stretch = _font_get_stretch(sysf.rid); + int score = (20 - Math::abs(weight - font_weight) / 50); + score += (20 - Math::abs(stretch - font_stretch) / 10); + if (bool(style & TextServer::FONT_ITALIC) == bool(font_style & TextServer::FONT_ITALIC)) { + score += 30; + } + if (score >= best_score) { + best_score = score; + best_match = face_idx; + } + if (best_score == 70) { + break; + } + } + if (best_match == -1) { + _free_rid(sysf.rid); + continue; + } else { + _font_set_face_index(sysf.rid, best_match); + } + sysf.index = best_match; + + // If it's a variable font, apply weight, stretch and italic coordinates to match requested style. + if (best_score != 70) { + Dictionary ftr = _font_supported_variation_list(sysf.rid); + if (ftr.has(wdth_tag)) { + var[wdth_tag] = font_stretch; + _font_set_stretch(sysf.rid, font_stretch); + } + if (ftr.has(wgth_tag)) { + var[wgth_tag] = font_weight; + _font_set_weight(sysf.rid, font_weight); + } + if ((font_style & TextServer::FONT_ITALIC) && ftr.has(ital_tag)) { + var[ital_tag] = 1; + _font_set_style(sysf.rid, _font_get_style(sysf.rid) | TextServer::FONT_ITALIC); + } + } + + _font_set_antialiasing(sysf.rid, key.antialiasing); + _font_set_generate_mipmaps(sysf.rid, key.mipmaps); + _font_set_multichannel_signed_distance_field(sysf.rid, key.msdf); + _font_set_msdf_pixel_range(sysf.rid, key.msdf_range); + _font_set_msdf_size(sysf.rid, key.msdf_source_size); + _font_set_fixed_size(sysf.rid, key.fixed_size); + _font_set_force_autohinter(sysf.rid, key.force_autohinter); + _font_set_hinting(sysf.rid, key.hinting); + _font_set_subpixel_positioning(sysf.rid, key.subpixel_positioning); + _font_set_variation_coordinates(sysf.rid, var); + _font_set_oversampling(sysf.rid, key.oversampling); + _font_set_embolden(sysf.rid, key.embolden); + _font_set_transform(sysf.rid, key.transform); + _font_set_spacing(sysf.rid, SPACING_TOP, key.extra_spacing[SPACING_TOP]); + _font_set_spacing(sysf.rid, SPACING_BOTTOM, key.extra_spacing[SPACING_BOTTOM]); + _font_set_spacing(sysf.rid, SPACING_SPACE, key.extra_spacing[SPACING_SPACE]); + _font_set_spacing(sysf.rid, SPACING_GLYPH, key.extra_spacing[SPACING_GLYPH]); + + if (system_fonts.has(key)) { + system_fonts[key].var.push_back(sysf); + } else { + SystemFontCache &sysf_cache = system_fonts[key]; + sysf_cache.max_var = _font_get_face_count(sysf.rid); + sysf_cache.var.push_back(sysf); + } + f = sysf.rid; + } + break; + } + } + return f; +} + void TextServerFallback::_shaped_text_overrun_trim_to_width(const RID &p_shaped_line, double p_width, BitField<TextServer::TextOverrunFlag> p_trim_flags) { ShapedTextDataFallback *sd = shaped_owner.get_or_null(p_shaped_line); ERR_FAIL_NULL_MSG(sd, "ShapedTextDataFallback invalid."); @@ -3643,20 +3831,52 @@ void TextServerFallback::_shaped_text_overrun_trim_to_width(const RID &p_shaped_ int sd_size = sd->glyphs.size(); int last_gl_font_size = sd_glyphs[sd_size - 1].font_size; + bool found_el_char = false; // Find usable fonts, if fonts from the last glyph do not have required chars. RID dot_gl_font_rid = sd_glyphs[sd_size - 1].font_rid; - if (!_font_has_char(dot_gl_font_rid, '.')) { + if (!_font_has_char(dot_gl_font_rid, sd->el_char)) { const Array &fonts = spans[spans.size() - 1].fonts; for (int i = 0; i < fonts.size(); i++) { - if (_font_has_char(fonts[i], '.')) { + if (_font_has_char(fonts[i], sd->el_char)) { dot_gl_font_rid = fonts[i]; + found_el_char = true; break; } } + if (!found_el_char && OS::get_singleton()->has_feature("system_fonts") && fonts.size() > 0 && _font_is_allow_system_fallback(fonts[0])) { + const char32_t u32str[] = { sd->el_char, 0 }; + RID rid = _find_sys_font_for_text(fonts[0], String(), spans[spans.size() - 1].language, u32str); + if (rid.is_valid()) { + dot_gl_font_rid = rid; + found_el_char = true; + } + } + } else { + found_el_char = true; + } + if (!found_el_char) { + bool found_dot_char = false; + dot_gl_font_rid = sd_glyphs[sd_size - 1].font_rid; + if (!_font_has_char(dot_gl_font_rid, '.')) { + const Array &fonts = spans[spans.size() - 1].fonts; + for (int i = 0; i < fonts.size(); i++) { + if (_font_has_char(fonts[i], '.')) { + dot_gl_font_rid = fonts[i]; + found_dot_char = true; + break; + } + } + if (!found_dot_char && OS::get_singleton()->has_feature("system_fonts") && fonts.size() > 0 && _font_is_allow_system_fallback(fonts[0])) { + RID rid = _find_sys_font_for_text(fonts[0], String(), spans[spans.size() - 1].language, "."); + if (rid.is_valid()) { + dot_gl_font_rid = rid; + } + } + } } RID whitespace_gl_font_rid = sd_glyphs[sd_size - 1].font_rid; - if (!_font_has_char(whitespace_gl_font_rid, '.')) { + if (!_font_has_char(whitespace_gl_font_rid, ' ')) { const Array &fonts = spans[spans.size() - 1].fonts; for (int i = 0; i < fonts.size(); i++) { if (_font_has_char(fonts[i], ' ')) { @@ -3666,14 +3886,14 @@ void TextServerFallback::_shaped_text_overrun_trim_to_width(const RID &p_shaped_ } } - int32_t dot_gl_idx = dot_gl_font_rid.is_valid() ? _font_get_glyph_index(dot_gl_font_rid, last_gl_font_size, '.', 0) : -10; + int32_t dot_gl_idx = dot_gl_font_rid.is_valid() ? _font_get_glyph_index(dot_gl_font_rid, last_gl_font_size, (found_el_char ? sd->el_char : '.'), 0) : -1; Vector2 dot_adv = dot_gl_font_rid.is_valid() ? _font_get_glyph_advance(dot_gl_font_rid, last_gl_font_size, dot_gl_idx) : Vector2(); - int32_t whitespace_gl_idx = whitespace_gl_font_rid.is_valid() ? _font_get_glyph_index(whitespace_gl_font_rid, last_gl_font_size, ' ', 0) : -10; + int32_t whitespace_gl_idx = whitespace_gl_font_rid.is_valid() ? _font_get_glyph_index(whitespace_gl_font_rid, last_gl_font_size, ' ', 0) : -1; Vector2 whitespace_adv = whitespace_gl_font_rid.is_valid() ? _font_get_glyph_advance(whitespace_gl_font_rid, last_gl_font_size, whitespace_gl_idx) : Vector2(); int ellipsis_width = 0; if (add_ellipsis && whitespace_gl_font_rid.is_valid()) { - ellipsis_width = 3 * dot_adv.x + sd->extra_spacing[SPACING_GLYPH] + _font_get_spacing(dot_gl_font_rid, SPACING_GLYPH) + (cut_per_word ? whitespace_adv.x : 0); + ellipsis_width = (found_el_char ? 1 : 3) * dot_adv.x + sd->extra_spacing[SPACING_GLYPH] + _font_get_spacing(dot_gl_font_rid, SPACING_GLYPH) + (cut_per_word ? whitespace_adv.x : 0); } int ell_min_characters = 6; @@ -3742,7 +3962,7 @@ void TextServerFallback::_shaped_text_overrun_trim_to_width(const RID &p_shaped_ if (dot_gl_idx != 0) { Glyph gl; gl.count = 1; - gl.repeat = 3; + gl.repeat = (found_el_char ? 1 : 3); gl.advance = dot_adv.x; gl.index = dot_gl_idx; gl.font_rid = dot_gl_font_rid; @@ -3873,161 +4093,7 @@ bool TextServerFallback::_shaped_text_shape(const RID &p_shaped) { RID fdef = span.fonts[0]; if (_font_is_allow_system_fallback(fdef)) { String text = sd->text.substr(j, 1); - String font_name = _font_get_name(fdef); - BitField<FontStyle> font_style = _font_get_style(fdef); - int font_weight = _font_get_weight(fdef); - int font_stretch = _font_get_stretch(fdef); - Dictionary dvar = _font_get_variation_coordinates(fdef); - static int64_t wgth_tag = _name_to_tag("weight"); - static int64_t wdth_tag = _name_to_tag("width"); - static int64_t ital_tag = _name_to_tag("italic"); - if (dvar.has(wgth_tag)) { - font_weight = dvar[wgth_tag].operator int(); - } - if (dvar.has(wdth_tag)) { - font_stretch = dvar[wdth_tag].operator int(); - } - if (dvar.has(ital_tag) && dvar[ital_tag].operator int() == 1) { - font_style.set_flag(TextServer::FONT_ITALIC); - } - - String locale = (span.language.is_empty()) ? TranslationServer::get_singleton()->get_tool_locale() : span.language; - - PackedStringArray fallback_font_name = OS::get_singleton()->get_system_font_path_for_text(font_name, text, locale, String(), font_weight, font_stretch, font_style & TextServer::FONT_ITALIC); -#ifdef GDEXTENSION - for (int fb = 0; fb < fallback_font_name.size(); fb++) { - const String &E = fallback_font_name[fb]; -#else - for (const String &E : fallback_font_name) { -#endif - SystemFontKey key = SystemFontKey(E, font_style & TextServer::FONT_ITALIC, font_weight, font_stretch, fdef, this); - if (system_fonts.has(key)) { - const SystemFontCache &sysf_cache = system_fonts[key]; - int best_score = 0; - int best_match = -1; - for (int face_idx = 0; face_idx < sysf_cache.var.size(); face_idx++) { - const SystemFontCacheRec &F = sysf_cache.var[face_idx]; - if (unlikely(!_font_has_char(F.rid, text[0]))) { - continue; - } - BitField<FontStyle> style = _font_get_style(F.rid); - int weight = _font_get_weight(F.rid); - int stretch = _font_get_stretch(F.rid); - int score = (20 - Math::abs(weight - font_weight) / 50); - score += (20 - Math::abs(stretch - font_stretch) / 10); - if (bool(style & TextServer::FONT_ITALIC) == bool(font_style & TextServer::FONT_ITALIC)) { - score += 30; - } - if (score >= best_score) { - best_score = score; - best_match = face_idx; - } - if (best_score == 70) { - break; - } - } - if (best_match != -1) { - gl.font_rid = sysf_cache.var[best_match].rid; - } - } - if (!gl.font_rid.is_valid()) { - if (system_fonts.has(key)) { - const SystemFontCache &sysf_cache = system_fonts[key]; - if (sysf_cache.max_var == sysf_cache.var.size()) { - // All subfonts already tested, skip. - continue; - } - } - - if (!system_font_data.has(E)) { - system_font_data[E] = FileAccess::get_file_as_bytes(E); - } - - const PackedByteArray &font_data = system_font_data[E]; - - SystemFontCacheRec sysf; - sysf.rid = _create_font(); - _font_set_data_ptr(sysf.rid, font_data.ptr(), font_data.size()); - - Dictionary var = dvar; - // Select matching style from collection. - int best_score = 0; - int best_match = -1; - for (int face_idx = 0; face_idx < _font_get_face_count(sysf.rid); face_idx++) { - _font_set_face_index(sysf.rid, face_idx); - if (unlikely(!_font_has_char(sysf.rid, text[0]))) { - continue; - } - BitField<FontStyle> style = _font_get_style(sysf.rid); - int weight = _font_get_weight(sysf.rid); - int stretch = _font_get_stretch(sysf.rid); - int score = (20 - Math::abs(weight - font_weight) / 50); - score += (20 - Math::abs(stretch - font_stretch) / 10); - if (bool(style & TextServer::FONT_ITALIC) == bool(font_style & TextServer::FONT_ITALIC)) { - score += 30; - } - if (score >= best_score) { - best_score = score; - best_match = face_idx; - } - if (best_score == 70) { - break; - } - } - if (best_match == -1) { - _free_rid(sysf.rid); - continue; - } else { - _font_set_face_index(sysf.rid, best_match); - } - sysf.index = best_match; - - // If it's a variable font, apply weight, stretch and italic coordinates to match requested style. - if (best_score != 70) { - Dictionary ftr = _font_supported_variation_list(sysf.rid); - if (ftr.has(wdth_tag)) { - var[wdth_tag] = font_stretch; - _font_set_stretch(sysf.rid, font_stretch); - } - if (ftr.has(wgth_tag)) { - var[wgth_tag] = font_weight; - _font_set_weight(sysf.rid, font_weight); - } - if ((font_style & TextServer::FONT_ITALIC) && ftr.has(ital_tag)) { - var[ital_tag] = 1; - _font_set_style(sysf.rid, _font_get_style(sysf.rid) | TextServer::FONT_ITALIC); - } - } - - _font_set_antialiasing(sysf.rid, key.antialiasing); - _font_set_generate_mipmaps(sysf.rid, key.mipmaps); - _font_set_multichannel_signed_distance_field(sysf.rid, key.msdf); - _font_set_msdf_pixel_range(sysf.rid, key.msdf_range); - _font_set_msdf_size(sysf.rid, key.msdf_source_size); - _font_set_fixed_size(sysf.rid, key.fixed_size); - _font_set_force_autohinter(sysf.rid, key.force_autohinter); - _font_set_hinting(sysf.rid, key.hinting); - _font_set_subpixel_positioning(sysf.rid, key.subpixel_positioning); - _font_set_variation_coordinates(sysf.rid, var); - _font_set_oversampling(sysf.rid, key.oversampling); - _font_set_embolden(sysf.rid, key.embolden); - _font_set_transform(sysf.rid, key.transform); - _font_set_spacing(sysf.rid, SPACING_TOP, key.extra_spacing[SPACING_TOP]); - _font_set_spacing(sysf.rid, SPACING_BOTTOM, key.extra_spacing[SPACING_BOTTOM]); - _font_set_spacing(sysf.rid, SPACING_SPACE, key.extra_spacing[SPACING_SPACE]); - _font_set_spacing(sysf.rid, SPACING_GLYPH, key.extra_spacing[SPACING_GLYPH]); - - if (system_fonts.has(key)) { - system_fonts[key].var.push_back(sysf); - } else { - SystemFontCache &sysf_cache = system_fonts[key]; - sysf_cache.max_var = _font_get_face_count(sysf.rid); - sysf_cache.var.push_back(sysf); - } - gl.font_rid = sysf.rid; - } - break; - } + gl.font_rid = _find_sys_font_for_text(fdef, String(), span.language, text); } } prev_font = gl.font_rid; diff --git a/modules/text_server_fb/text_server_fb.h b/modules/text_server_fb/text_server_fb.h index 5c30ea0c05..68e0cbff6c 100644 --- a/modules/text_server_fb/text_server_fb.h +++ b/modules/text_server_fb/text_server_fb.h @@ -447,6 +447,7 @@ class TextServerFallback : public TextServerExtension { double upos = 0.0; double uthk = 0.0; + char32_t el_char = 0x2026; TrimData overrun_trim_data; bool fit_width_minimum_reached = false; @@ -555,6 +556,7 @@ class TextServerFallback : public TextServerExtension { mutable HashMap<String, PackedByteArray> system_font_data; void _realign(ShapedTextDataFallback *p_sd) const; + _FORCE_INLINE_ RID _find_sys_font_for_text(const RID &p_fdef, const String &p_script_code, const String &p_language, const String &p_text); Mutex ft_mutex; @@ -766,6 +768,9 @@ public: MODBIND2(shaped_text_set_custom_punctuation, const RID &, const String &); MODBIND1RC(String, shaped_text_get_custom_punctuation, const RID &); + MODBIND2(shaped_text_set_custom_ellipsis, const RID &, int64_t); + MODBIND1RC(int64_t, shaped_text_get_custom_ellipsis, const RID &); + MODBIND2(shaped_text_set_orientation, const RID &, Orientation); MODBIND1RC(Orientation, shaped_text_get_orientation, const RID &); diff --git a/modules/tinyexr/image_loader_tinyexr.cpp b/modules/tinyexr/image_loader_tinyexr.cpp index f64bb14e4a..8720ca56f6 100644 --- a/modules/tinyexr/image_loader_tinyexr.cpp +++ b/modules/tinyexr/image_loader_tinyexr.cpp @@ -68,6 +68,7 @@ Error ImageLoaderTinyEXR::load_image(Ref<Image> p_image, Ref<FileAccess> f, BitF if (ret != TINYEXR_SUCCESS) { if (err) { ERR_PRINT(String(err)); + FreeEXRErrorMessage(err); } return ERR_FILE_CORRUPT; } @@ -86,6 +87,7 @@ Error ImageLoaderTinyEXR::load_image(Ref<Image> p_image, Ref<FileAccess> f, BitF if (ret != TINYEXR_SUCCESS) { if (err) { ERR_PRINT(String(err)); + FreeEXRErrorMessage(err); } return ERR_FILE_CORRUPT; } diff --git a/modules/vorbis/register_types.cpp b/modules/vorbis/register_types.cpp index 26af912999..def34220ea 100644 --- a/modules/vorbis/register_types.cpp +++ b/modules/vorbis/register_types.cpp @@ -48,8 +48,13 @@ void initialize_vorbis_module(ModuleInitializationLevel p_level) { ResourceFormatImporter::get_singleton()->add_importer(ogg_vorbis_importer); } + ClassDB::APIType prev_api = ClassDB::get_current_api(); + ClassDB::set_current_api(ClassDB::API_EDITOR); + // Required to document import options in the class reference. GDREGISTER_CLASS(ResourceImporterOggVorbis); + + ClassDB::set_current_api(prev_api); #endif GDREGISTER_CLASS(AudioStreamOggVorbis); diff --git a/modules/vorbis/resource_importer_ogg_vorbis.cpp b/modules/vorbis/resource_importer_ogg_vorbis.cpp index a8c92f06f6..bf5d964d39 100644 --- a/modules/vorbis/resource_importer_ogg_vorbis.cpp +++ b/modules/vorbis/resource_importer_ogg_vorbis.cpp @@ -90,7 +90,7 @@ bool ResourceImporterOggVorbis::has_advanced_options() const { void ResourceImporterOggVorbis::show_advanced_options(const String &p_path) { Ref<AudioStreamOggVorbis> ogg_stream = load_from_file(p_path); if (ogg_stream.is_valid()) { - AudioStreamImportSettings::get_singleton()->edit(p_path, "oggvorbisstr", ogg_stream); + AudioStreamImportSettingsDialog::get_singleton()->edit(p_path, "oggvorbisstr", ogg_stream); } } #endif diff --git a/modules/webxr/webxr_interface_js.cpp b/modules/webxr/webxr_interface_js.cpp index 47f20ce1a3..828476edfb 100644 --- a/modules/webxr/webxr_interface_js.cpp +++ b/modules/webxr/webxr_interface_js.cpp @@ -309,7 +309,7 @@ void WebXRInterfaceJS::uninitialize() { godot_webxr_uninitialize(); - GLES3::TextureStorage *texture_storage = dynamic_cast<GLES3::TextureStorage *>(RSG::texture_storage); + GLES3::TextureStorage *texture_storage = GLES3::TextureStorage::get_singleton(); if (texture_storage != nullptr) { for (KeyValue<unsigned int, RID> &E : texture_cache) { // Forcibly mark as not part of a render target so we can free it. @@ -438,16 +438,11 @@ Projection WebXRInterfaceJS::get_projection_for_view(uint32_t p_view, double p_a } bool WebXRInterfaceJS::pre_draw_viewport(RID p_render_target) { - GLES3::TextureStorage *texture_storage = dynamic_cast<GLES3::TextureStorage *>(RSG::texture_storage); + GLES3::TextureStorage *texture_storage = GLES3::TextureStorage::get_singleton(); if (texture_storage == nullptr) { return false; } - GLES3::RenderTarget *rt = texture_storage->get_render_target(p_render_target); - if (rt == nullptr) { - return false; - } - // Cache the resources so we don't have to get them from JS twice. color_texture = _get_color_texture(); depth_texture = _get_depth_texture(); @@ -460,23 +455,9 @@ bool WebXRInterfaceJS::pre_draw_viewport(RID p_render_target) { // // See: https://immersive-web.github.io/layers/#xropaquetextures // - // This is why we're doing this sort of silly check: if the color and depth - // textures are the same this frame as last frame, we need to attach them - // again, despite the fact that the GLuint for them hasn't changed. - if (rt->overridden.is_overridden && rt->overridden.color == color_texture && rt->overridden.depth == depth_texture) { - GLES3::Config *config = GLES3::Config::get_singleton(); - bool use_multiview = rt->view_count > 1 && config->multiview_supported; - - glBindFramebuffer(GL_FRAMEBUFFER, rt->fbo); - if (use_multiview) { - glFramebufferTextureMultiviewOVR(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, rt->color, 0, 0, rt->view_count); - glFramebufferTextureMultiviewOVR(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, rt->depth, 0, 0, rt->view_count); - } else { - glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, rt->color, 0); - glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, rt->depth, 0); - } - glBindFramebuffer(GL_FRAMEBUFFER, texture_storage->system_fbo); - } + // So, even if the color and depth textures have the same GLuint as the last + // frame, we need to re-attach them again. + texture_storage->render_target_set_reattach_textures(p_render_target, true); return true; } @@ -484,7 +465,12 @@ bool WebXRInterfaceJS::pre_draw_viewport(RID p_render_target) { Vector<BlitToScreen> WebXRInterfaceJS::post_draw_viewport(RID p_render_target, const Rect2 &p_screen_rect) { Vector<BlitToScreen> blit_to_screen; - // We don't need to do anything here. + GLES3::TextureStorage *texture_storage = GLES3::TextureStorage::get_singleton(); + if (texture_storage == nullptr) { + return blit_to_screen; + } + + texture_storage->render_target_set_reattach_textures(p_render_target, false); return blit_to_screen; }; @@ -513,7 +499,7 @@ RID WebXRInterfaceJS::_get_texture(unsigned int p_texture_id) { return cache->get(); } - GLES3::TextureStorage *texture_storage = dynamic_cast<GLES3::TextureStorage *>(RSG::texture_storage); + GLES3::TextureStorage *texture_storage = GLES3::TextureStorage::get_singleton(); if (texture_storage == nullptr) { return RID(); } diff --git a/modules/zip/zip_packer.cpp b/modules/zip/zip_packer.cpp index 5f623476fc..e67c65d4d1 100644 --- a/modules/zip/zip_packer.cpp +++ b/modules/zip/zip_packer.cpp @@ -72,7 +72,24 @@ Error ZIPPacker::start_file(const String &p_path) { zipfi.internal_fa = 0; zipfi.external_fa = 0; - int err = zipOpenNewFileInZip(zf, p_path.utf8().get_data(), &zipfi, nullptr, 0, nullptr, 0, nullptr, Z_DEFLATED, Z_DEFAULT_COMPRESSION); + int err = zipOpenNewFileInZip4(zf, + p_path.utf8().get_data(), + &zipfi, + nullptr, + 0, + nullptr, + 0, + nullptr, + Z_DEFLATED, + Z_DEFAULT_COMPRESSION, + 0, + -MAX_WBITS, + DEF_MEM_LEVEL, + Z_DEFAULT_STRATEGY, + nullptr, + 0, + 0x0314, // "version made by", 0x03 - Unix, 0x14 - ZIP specification version 2.0, required to store Unix file permissions. + 1 << 11); // Bit 11 is the language encoding flag. When set, filename and comment fields must be encoded using UTF-8. return err == ZIP_OK ? OK : FAILED; } diff --git a/platform/android/SCsub b/platform/android/SCsub index dfc921cc54..97262cf148 100644 --- a/platform/android/SCsub +++ b/platform/android/SCsub @@ -1,5 +1,7 @@ #!/usr/bin/env python +import subprocess + Import("env") android_files = [ @@ -77,3 +79,29 @@ if lib_arch_dir != "": str(env["ANDROID_NDK_ROOT"]) + "/sources/cxx-stl/llvm-libc++/libs/" + lib_arch_dir + "/libc++_shared.so" ) env_android.Command(out_dir + "/libc++_shared.so", stl_lib_path, Copy("$TARGET", "$SOURCE")) + + def generate_apk(target, source, env): + if env["target"] != "editor" and env["dev_build"]: + subprocess.run( + [ + "./gradlew", + "generateDevTemplate", + "--quiet", + ], + cwd="platform/android/java", + ) + else: + # Android editor with `dev_build=yes` is handled by the `generateGodotEditor` task. + subprocess.run( + [ + "./gradlew", + "generateGodotEditor" if env["target"] == "editor" else "generateGodotTemplates", + "--quiet", + ], + cwd="platform/android/java", + ) + + if env["generate_apk"]: + generate_apk_command = env_android.Command("generate_apk", [], generate_apk) + command = env_android.AlwaysBuild(generate_apk_command) + env_android.Depends(command, [lib]) diff --git a/platform/android/display_server_android.cpp b/platform/android/display_server_android.cpp index dd5ab46bd7..9529e0e683 100644 --- a/platform/android/display_server_android.cpp +++ b/platform/android/display_server_android.cpp @@ -486,6 +486,9 @@ Vector<String> DisplayServerAndroid::get_rendering_drivers_func() { #ifdef GLES3_ENABLED drivers.push_back("opengl3"); #endif +#ifdef D3D12_ENABLED + drivers.push_back("d3d12"); +#endif #ifdef VULKAN_ENABLED drivers.push_back("vulkan"); #endif diff --git a/platform/android/export/export_plugin.cpp b/platform/android/export/export_plugin.cpp index f0ee405b41..10d54e8d97 100644 --- a/platform/android/export/export_plugin.cpp +++ b/platform/android/export/export_plugin.cpp @@ -460,7 +460,7 @@ String EditorExportPlatformAndroid::get_valid_basename() const { if (is_digit(c) && first) { continue; } - if (is_ascii_alphanumeric_char(c)) { + if (is_ascii_identifier_char(c)) { name += String::chr(c); first = false; } @@ -537,13 +537,6 @@ bool EditorExportPlatformAndroid::is_package_name_valid(const String &p_package, return false; } - if (p_package.find("$genname") >= 0 && !is_project_name_valid()) { - if (r_error) { - *r_error = TTR("The project name does not meet the requirement for the package name format. Please explicitly specify the package name."); - } - return false; - } - return true; } @@ -2446,6 +2439,13 @@ bool EditorExportPlatformAndroid::has_valid_project_configuration(const Ref<Edit err += "\n"; } + String package_name = p_preset->get("package/unique_name"); + if (package_name.find("$genname") >= 0 && !is_project_name_valid()) { + // Warning only, so don't override `valid`. + err += vformat(TTR("The project name does not meet the requirement for the package name format and will be updated to \"%s\". Please explicitly specify the package name if needed."), get_valid_basename()); + err += "\n"; + } + r_error = err; return valid; } @@ -2782,6 +2782,12 @@ Error EditorExportPlatformAndroid::export_project(const Ref<EditorExportPreset> Error EditorExportPlatformAndroid::export_project_helper(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int export_format, bool should_sign, int p_flags) { ExportNotifier notifier(*this, p_preset, p_debug, p_path, p_flags); + const String base_dir = p_path.get_base_dir(); + if (!DirAccess::exists(base_dir)) { + add_message(EXPORT_MESSAGE_ERROR, TTR("Export"), vformat(TTR("Target folder does not exist or is inaccessible: \"%s\""), base_dir)); + return ERR_FILE_BAD_PATH; + } + String src_apk; Error err; @@ -2856,7 +2862,10 @@ Error EditorExportPlatformAndroid::export_project_helper(const Ref<EditorExportP } const String assets_directory = get_assets_directory(p_preset, export_format); String sdk_path = EDITOR_GET("export/android/android_sdk_path"); - ERR_FAIL_COND_V_MSG(sdk_path.is_empty(), ERR_UNCONFIGURED, "Android SDK path must be configured in Editor Settings at 'export/android/android_sdk_path'."); + if (sdk_path.is_empty()) { + add_message(EXPORT_MESSAGE_ERROR, TTR("Export"), TTR("Android SDK path must be configured in Editor Settings at 'export/android/android_sdk_path'.")); + return ERR_UNCONFIGURED; + } print_verbose("Android sdk path: " + sdk_path); // TODO: should we use "package/name" or "application/config/name"? @@ -3106,10 +3115,6 @@ Error EditorExportPlatformAndroid::export_project_helper(const Ref<EditorExportP } } - if (!DirAccess::exists(p_path.get_base_dir())) { - return ERR_FILE_BAD_PATH; - } - Ref<FileAccess> io_fa; zlib_filefunc_def io = zipio_create_io(&io_fa); @@ -3302,10 +3307,6 @@ Error EditorExportPlatformAndroid::export_project_helper(const Ref<EditorExportP zipClose(unaligned_apk, nullptr); unzClose(pkg); - if (err != OK) { - CLEANUP_AND_RETURN(err); - } - // Let's zip-align (must be done before signing) static const int ZIP_ALIGNMENT = 4; @@ -3392,6 +3393,7 @@ Error EditorExportPlatformAndroid::export_project_helper(const Ref<EditorExportP // file will invalidate the signature. err = sign_apk(p_preset, p_debug, p_path, ep); if (err != OK) { + // Message is supplied by the subroutine method. CLEANUP_AND_RETURN(err); } } diff --git a/platform/android/java/editor/src/main/java/org/godotengine/editor/GodotEditor.kt b/platform/android/java/editor/src/main/java/org/godotengine/editor/GodotEditor.kt index 02709d4dc5..0d7017ae71 100644 --- a/platform/android/java/editor/src/main/java/org/godotengine/editor/GodotEditor.kt +++ b/platform/android/java/editor/src/main/java/org/godotengine/editor/GodotEditor.kt @@ -221,16 +221,9 @@ open class GodotEditor : GodotActivity() { val runningProcesses = activityManager.runningAppProcesses for (runningProcess in runningProcesses) { if (runningProcess.processName.endsWith(processNameSuffix)) { - if (targetClass == null) { - // Killing process directly - Log.v(TAG, "Killing Godot process ${runningProcess.processName}") - Process.killProcess(runningProcess.pid) - } else { - // Activity is running; sending a request for self termination. - Log.v(TAG, "Sending force quit request to $targetClass running on process ${runningProcess.processName}") - val forceQuitIntent = Intent(this, targetClass).putExtra(EXTRA_FORCE_QUIT, true) - startActivity(forceQuitIntent) - } + // Killing process directly + Log.v(TAG, "Killing Godot process ${runningProcess.processName}") + Process.killProcess(runningProcess.pid) return true } } diff --git a/platform/android/java/lib/src/org/godotengine/godot/Godot.kt b/platform/android/java/lib/src/org/godotengine/godot/Godot.kt index 38961bcda8..217e7a2b60 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/Godot.kt +++ b/platform/android/java/lib/src/org/godotengine/godot/Godot.kt @@ -184,7 +184,7 @@ class Godot(private val context: Context) : SensorEventListener { return } - beginBenchmarkMeasure("Godot::onCreate") + beginBenchmarkMeasure("Startup", "Godot::onCreate") try { this.primaryHost = primaryHost val activity = requireActivity() @@ -286,7 +286,7 @@ class Godot(private val context: Context) : SensorEventListener { initializationStarted = false throw e } finally { - endBenchmarkMeasure("Godot::onCreate"); + endBenchmarkMeasure("Startup", "Godot::onCreate"); } } @@ -536,8 +536,11 @@ class Godot(private val context: Context) : SensorEventListener { for (plugin in pluginRegistry.allPlugins) { plugin.onMainDestroy() } - GodotLib.ondestroy() - forceQuit() + + runOnRenderThread { + GodotLib.ondestroy() + forceQuit() + } } /** @@ -1013,13 +1016,13 @@ class Godot(private val context: Context) : SensorEventListener { } @Keep - private fun nativeBeginBenchmarkMeasure(label: String) { - beginBenchmarkMeasure(label) + private fun nativeBeginBenchmarkMeasure(scope: String, label: String) { + beginBenchmarkMeasure(scope, label) } @Keep - private fun nativeEndBenchmarkMeasure(label: String) { - endBenchmarkMeasure(label) + private fun nativeEndBenchmarkMeasure(scope: String, label: String) { + endBenchmarkMeasure(scope, label) } @Keep diff --git a/platform/android/java/lib/src/org/godotengine/godot/GodotFragment.java b/platform/android/java/lib/src/org/godotengine/godot/GodotFragment.java index 120e1722e5..f1c029e7a1 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/GodotFragment.java +++ b/platform/android/java/lib/src/org/godotengine/godot/GodotFragment.java @@ -172,7 +172,7 @@ public class GodotFragment extends Fragment implements IDownloaderClient, GodotH @Override public void onCreate(Bundle icicle) { - BenchmarkUtils.beginBenchmarkMeasure("GodotFragment::onCreate"); + BenchmarkUtils.beginBenchmarkMeasure("Startup", "GodotFragment::onCreate"); super.onCreate(icicle); final Activity activity = getActivity(); @@ -180,7 +180,7 @@ public class GodotFragment extends Fragment implements IDownloaderClient, GodotH godot = new Godot(requireContext()); performEngineInitialization(); - BenchmarkUtils.endBenchmarkMeasure("GodotFragment::onCreate"); + BenchmarkUtils.endBenchmarkMeasure("Startup", "GodotFragment::onCreate"); } private void performEngineInitialization() { diff --git a/platform/android/java/lib/src/org/godotengine/godot/utils/BenchmarkUtils.kt b/platform/android/java/lib/src/org/godotengine/godot/utils/BenchmarkUtils.kt index 1552c8f082..69748c0a8d 100644 --- a/platform/android/java/lib/src/org/godotengine/godot/utils/BenchmarkUtils.kt +++ b/platform/android/java/lib/src/org/godotengine/godot/utils/BenchmarkUtils.kt @@ -41,7 +41,7 @@ import org.godotengine.godot.io.file.FileAccessFlags import org.godotengine.godot.io.file.FileAccessHandler import org.json.JSONObject import java.nio.ByteBuffer -import java.util.concurrent.ConcurrentSkipListMap +import java.util.Collections /** * Contains benchmark related utilities methods @@ -51,44 +51,47 @@ private const val TAG = "GodotBenchmark" var useBenchmark = false var benchmarkFile = "" -private val startBenchmarkFrom = ConcurrentSkipListMap<String, Long>() -private val benchmarkTracker = ConcurrentSkipListMap<String, Double>() +private val startBenchmarkFrom = Collections.synchronizedMap(LinkedHashMap<Pair<String, String>, Long>()) +private val benchmarkTracker = Collections.synchronizedMap(LinkedHashMap<Pair<String, String>, Double>()) /** - * Start measuring and tracing the execution of a given section of code using the given label. + * Start measuring and tracing the execution of a given section of code using the given label + * within the given scope. * * Must be followed by a call to [endBenchmarkMeasure]. * * Note: Only enabled on 'editorDev' build variant. */ -fun beginBenchmarkMeasure(label: String) { +fun beginBenchmarkMeasure(scope: String, label: String) { if (BuildConfig.FLAVOR != "editor" || BuildConfig.BUILD_TYPE != "dev") { return } - startBenchmarkFrom[label] = SystemClock.elapsedRealtime() + val key = Pair(scope, label) + startBenchmarkFrom[key] = SystemClock.elapsedRealtime() if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { - Trace.beginAsyncSection(label, 0) + Trace.beginAsyncSection("[$scope] $label", 0) } } /** - * End measuring and tracing of the section of code with the given label. + * End measuring and tracing of the section of code with the given label within the given scope. * * Must be preceded by a call [beginBenchmarkMeasure] * * * Note: Only enabled on 'editorDev' build variant. */ -fun endBenchmarkMeasure(label: String) { +fun endBenchmarkMeasure(scope: String, label: String) { if (BuildConfig.FLAVOR != "editor" || BuildConfig.BUILD_TYPE != "dev") { return } - val startTime = startBenchmarkFrom[label] ?: return + val key = Pair(scope, label) + val startTime = startBenchmarkFrom[key] ?: return val total = SystemClock.elapsedRealtime() - startTime - benchmarkTracker[label] = total / 1000.0 + benchmarkTracker[key] = total / 1_000.0 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { - Trace.endAsyncSection(label, 0) + Trace.endAsyncSection("[$scope] $label", 0) } } @@ -107,8 +110,16 @@ fun dumpBenchmark(fileAccessHandler: FileAccessHandler?, filepath: String? = ben return } + val results = LinkedHashMap<String, String>() + for (entry in benchmarkTracker) { + if (!results.containsKey(entry.key.first)) { + results[entry.key.first] = "" + } + results[entry.key.first] += "\t\t- ${entry.key.second}: ${entry.value * 1_000.0} msec.\n" + } + val printOut = - benchmarkTracker.map { "\t- ${it.key} : ${it.value} sec." }.joinToString("\n") + results.map { "\t- [${it.key}]\n ${it.value}" }.joinToString("\n") Log.i(TAG, "BENCHMARK:\n$printOut") if (fileAccessHandler != null && !filepath.isNullOrBlank()) { diff --git a/platform/android/java_godot_view_wrapper.h b/platform/android/java_godot_view_wrapper.h index e5b04e4866..5f554aa2d6 100644 --- a/platform/android/java_godot_view_wrapper.h +++ b/platform/android/java_godot_view_wrapper.h @@ -38,7 +38,7 @@ #include <android/log.h> #include <jni.h> -// Class that makes functions in java/src/org/godotengine/godot/GodotView.java callable from C++ +// Class that makes functions in java/src/org/godotengine/godot/GodotRenderView.java callable from C++ class GodotJavaViewWrapper { private: jclass _cls; diff --git a/platform/android/java_godot_wrapper.cpp b/platform/android/java_godot_wrapper.cpp index cb6ebf14a8..4e401e633e 100644 --- a/platform/android/java_godot_wrapper.cpp +++ b/platform/android/java_godot_wrapper.cpp @@ -78,8 +78,8 @@ GodotJavaWrapper::GodotJavaWrapper(JNIEnv *p_env, jobject p_activity, jobject p_ _on_godot_main_loop_started = p_env->GetMethodID(godot_class, "onGodotMainLoopStarted", "()V"); _create_new_godot_instance = p_env->GetMethodID(godot_class, "createNewGodotInstance", "([Ljava/lang/String;)I"); _get_render_view = p_env->GetMethodID(godot_class, "getRenderView", "()Lorg/godotengine/godot/GodotRenderView;"); - _begin_benchmark_measure = p_env->GetMethodID(godot_class, "nativeBeginBenchmarkMeasure", "(Ljava/lang/String;)V"); - _end_benchmark_measure = p_env->GetMethodID(godot_class, "nativeEndBenchmarkMeasure", "(Ljava/lang/String;)V"); + _begin_benchmark_measure = p_env->GetMethodID(godot_class, "nativeBeginBenchmarkMeasure", "(Ljava/lang/String;Ljava/lang/String;)V"); + _end_benchmark_measure = p_env->GetMethodID(godot_class, "nativeEndBenchmarkMeasure", "(Ljava/lang/String;Ljava/lang/String;)V"); _dump_benchmark = p_env->GetMethodID(godot_class, "nativeDumpBenchmark", "(Ljava/lang/String;)V"); _get_gdextension_list_config_file = p_env->GetMethodID(godot_class, "getGDExtensionConfigFiles", "()[Ljava/lang/String;"); _has_feature = p_env->GetMethodID(godot_class, "hasFeature", "(Ljava/lang/String;)Z"); @@ -348,21 +348,23 @@ int GodotJavaWrapper::create_new_godot_instance(List<String> args) { } } -void GodotJavaWrapper::begin_benchmark_measure(const String &p_label) { +void GodotJavaWrapper::begin_benchmark_measure(const String &p_context, const String &p_label) { if (_begin_benchmark_measure) { JNIEnv *env = get_jni_env(); ERR_FAIL_NULL(env); + jstring j_context = env->NewStringUTF(p_context.utf8().get_data()); jstring j_label = env->NewStringUTF(p_label.utf8().get_data()); - env->CallVoidMethod(godot_instance, _begin_benchmark_measure, j_label); + env->CallVoidMethod(godot_instance, _begin_benchmark_measure, j_context, j_label); } } -void GodotJavaWrapper::end_benchmark_measure(const String &p_label) { +void GodotJavaWrapper::end_benchmark_measure(const String &p_context, const String &p_label) { if (_end_benchmark_measure) { JNIEnv *env = get_jni_env(); ERR_FAIL_NULL(env); + jstring j_context = env->NewStringUTF(p_context.utf8().get_data()); jstring j_label = env->NewStringUTF(p_label.utf8().get_data()); - env->CallVoidMethod(godot_instance, _end_benchmark_measure, j_label); + env->CallVoidMethod(godot_instance, _end_benchmark_measure, j_context, j_label); } } diff --git a/platform/android/java_godot_wrapper.h b/platform/android/java_godot_wrapper.h index 7c6327c9e1..52043c6027 100644 --- a/platform/android/java_godot_wrapper.h +++ b/platform/android/java_godot_wrapper.h @@ -39,7 +39,7 @@ #include <android/log.h> #include <jni.h> -// Class that makes functions in java/src/org/godotengine/godot/Godot.java callable from C++ +// Class that makes functions in java/src/org/godotengine/godot/Godot.kt callable from C++ class GodotJavaWrapper { private: jobject godot_instance; @@ -105,8 +105,8 @@ public: void vibrate(int p_duration_ms); String get_input_fallback_mapping(); int create_new_godot_instance(List<String> args); - void begin_benchmark_measure(const String &p_label); - void end_benchmark_measure(const String &p_label); + void begin_benchmark_measure(const String &p_context, const String &p_label); + void end_benchmark_measure(const String &p_context, const String &p_label); void dump_benchmark(const String &benchmark_file); // Return the list of gdextensions config file. diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp index 92dc5f909f..0d82bec75d 100644 --- a/platform/android/os_android.cpp +++ b/platform/android/os_android.cpp @@ -708,15 +708,15 @@ String OS_Android::get_config_path() const { return get_user_data_dir().path_join("config"); } -void OS_Android::benchmark_begin_measure(const String &p_what) { +void OS_Android::benchmark_begin_measure(const String &p_context, const String &p_what) { #ifdef TOOLS_ENABLED - godot_java->begin_benchmark_measure(p_what); + godot_java->begin_benchmark_measure(p_context, p_what); #endif } -void OS_Android::benchmark_end_measure(const String &p_what) { +void OS_Android::benchmark_end_measure(const String &p_context, const String &p_what) { #ifdef TOOLS_ENABLED - godot_java->end_benchmark_measure(p_what); + godot_java->end_benchmark_measure(p_context, p_what); #endif } diff --git a/platform/android/os_android.h b/platform/android/os_android.h index f88f3e0518..837ef8bad5 100644 --- a/platform/android/os_android.h +++ b/platform/android/os_android.h @@ -165,8 +165,8 @@ public: virtual Error setup_remote_filesystem(const String &p_server_host, int p_port, const String &p_password, String &r_project_path) override; - virtual void benchmark_begin_measure(const String &p_what) override; - virtual void benchmark_end_measure(const String &p_what) override; + virtual void benchmark_begin_measure(const String &p_context, const String &p_what) override; + virtual void benchmark_end_measure(const String &p_context, const String &p_what) override; virtual void benchmark_dump() override; virtual void load_platform_gdextensions() const override; diff --git a/platform/ios/display_server_ios.mm b/platform/ios/display_server_ios.mm index 2561c1c095..60da16ae8c 100644 --- a/platform/ios/display_server_ios.mm +++ b/platform/ios/display_server_ios.mm @@ -443,7 +443,11 @@ int DisplayServerIOS::screen_get_dpi(int p_screen) const { } float DisplayServerIOS::screen_get_refresh_rate(int p_screen) const { - return [UIScreen mainScreen].maximumFramesPerSecond; + float fps = [UIScreen mainScreen].maximumFramesPerSecond; + if ([NSProcessInfo processInfo].lowPowerModeEnabled) { + fps = 60; + } + return fps; } float DisplayServerIOS::screen_get_scale(int p_screen) const { diff --git a/platform/ios/export/export_plugin.cpp b/platform/ios/export/export_plugin.cpp index 3cae85ea55..b478759e45 100644 --- a/platform/ios/export/export_plugin.cpp +++ b/platform/ios/export/export_plugin.cpp @@ -620,7 +620,10 @@ Error EditorExportPlatformIOS::_export_icons(const Ref<EditorExportPreset> &p_pr String sizes; Ref<DirAccess> da = DirAccess::open(p_iconset_dir); - ERR_FAIL_COND_V_MSG(da.is_null(), ERR_CANT_OPEN, "Cannot open directory '" + p_iconset_dir + "'."); + if (da.is_null()) { + add_message(EXPORT_MESSAGE_ERROR, TTR("Export Icons"), vformat(TTR("Could not open a directory at path \"%s\"."), p_iconset_dir)); + return ERR_CANT_OPEN; + } Color boot_bg_color = GLOBAL_GET("application/boot_splash/bg_color"); @@ -692,12 +695,20 @@ Error EditorExportPlatformIOS::_export_icons(const Ref<EditorExportPreset> &p_pr json_description += "]}"; Ref<FileAccess> json_file = FileAccess::open(p_iconset_dir + "Contents.json", FileAccess::WRITE); - ERR_FAIL_COND_V(json_file.is_null(), ERR_CANT_CREATE); + if (json_file.is_null()) { + add_message(EXPORT_MESSAGE_ERROR, TTR("Export Icons"), vformat(TTR("Could not write to a file at path \"%s\"."), p_iconset_dir + "Contents.json")); + return ERR_CANT_CREATE; + } + CharString json_utf8 = json_description.utf8(); json_file->store_buffer((const uint8_t *)json_utf8.get_data(), json_utf8.length()); Ref<FileAccess> sizes_file = FileAccess::open(p_iconset_dir + "sizes", FileAccess::WRITE); - ERR_FAIL_COND_V(sizes_file.is_null(), ERR_CANT_CREATE); + if (sizes_file.is_null()) { + add_message(EXPORT_MESSAGE_ERROR, TTR("Export Icons"), vformat(TTR("Could not write to a file at path \"%s\"."), p_iconset_dir + "sizes")); + return ERR_CANT_CREATE; + } + CharString sizes_utf8 = sizes.utf8(); sizes_file->store_buffer((const uint8_t *)sizes_utf8.get_data(), sizes_utf8.length()); @@ -882,8 +893,7 @@ Error EditorExportPlatformIOS::_walk_dir_recursive(Ref<DirAccess> &p_da, FileHan p_da->list_dir_end(); for (int i = 0; i < dirs.size(); ++i) { - String dir = dirs[i]; - p_da->change_dir(dir); + p_da->change_dir(dirs[i]); Error err = _walk_dir_recursive(p_da, p_handler, p_userdata); p_da->change_dir(".."); if (err) { @@ -1077,14 +1087,15 @@ Error EditorExportPlatformIOS::_copy_asset(const String &p_out_dir, const String return ERR_FILE_NOT_FOUND; } - String base_dir = p_asset.get_base_dir().replace("res://", ""); + String base_dir = p_asset.get_base_dir().replace("res://", "").replace(".godot/mono/temp/bin/", ""); + String asset = p_asset.ends_with("/") ? p_asset.left(p_asset.length() - 1) : p_asset; String destination_dir; String destination; String asset_path; bool create_framework = false; - if (p_is_framework && p_asset.ends_with(".dylib")) { + if (p_is_framework && asset.ends_with(".dylib")) { // For iOS we need to turn .dylib into .framework // to be able to send application to AppStore asset_path = String("dylibs").path_join(base_dir); @@ -1103,7 +1114,7 @@ Error EditorExportPlatformIOS::_copy_asset(const String &p_out_dir, const String destination_dir = p_out_dir.path_join(asset_path); destination = destination_dir.path_join(file_name); create_framework = true; - } else if (p_is_framework && (p_asset.ends_with(".framework") || p_asset.ends_with(".xcframework"))) { + } else if (p_is_framework && (asset.ends_with(".framework") || asset.ends_with(".xcframework"))) { asset_path = String("dylibs").path_join(base_dir); String file_name; @@ -1147,6 +1158,9 @@ Error EditorExportPlatformIOS::_copy_asset(const String &p_out_dir, const String if (err) { return err; } + if (asset_path.ends_with("/")) { + asset_path = asset_path.left(asset_path.length() - 1); + } IOSExportAsset exported_asset = { binary_name.path_join(asset_path), p_is_framework, p_should_embed }; r_exported_assets.push_back(exported_asset); @@ -1213,13 +1227,16 @@ Error EditorExportPlatformIOS::_copy_asset(const String &p_out_dir, const String Error EditorExportPlatformIOS::_export_additional_assets(const String &p_out_dir, const Vector<String> &p_assets, bool p_is_framework, bool p_should_embed, Vector<IOSExportAsset> &r_exported_assets) { for (int f_idx = 0; f_idx < p_assets.size(); ++f_idx) { String asset = p_assets[f_idx]; - if (!asset.begins_with("res://")) { + if (asset.begins_with("res://")) { + Error err = _copy_asset(p_out_dir, asset, nullptr, p_is_framework, p_should_embed, r_exported_assets); + ERR_FAIL_COND_V(err != OK, err); + } else if (ProjectSettings::get_singleton()->localize_path(asset).begins_with("res://")) { + Error err = _copy_asset(p_out_dir, ProjectSettings::get_singleton()->localize_path(asset), nullptr, p_is_framework, p_should_embed, r_exported_assets); + ERR_FAIL_COND_V(err != OK, err); + } else { // either SDK-builtin or already a part of the export template IOSExportAsset exported_asset = { asset, p_is_framework, p_should_embed }; r_exported_assets.push_back(exported_asset); - } else { - Error err = _copy_asset(p_out_dir, asset, nullptr, p_is_framework, p_should_embed, r_exported_assets); - ERR_FAIL_COND_V(err, err); } } @@ -1299,8 +1316,7 @@ Error EditorExportPlatformIOS::_export_ios_plugins(const Ref<EditorExportPreset> // We shouldn't embed .xcframework that contains static libraries. // Static libraries are not embedded anyway. err = _copy_asset(dest_dir, plugin_main_binary, &plugin_binary_result_file, true, false, r_exported_assets); - - ERR_FAIL_COND_V(err, err); + ERR_FAIL_COND_V(err != OK, err); // Adding dependencies. // Use separate container for names to check for duplicates. @@ -1425,15 +1441,15 @@ Error EditorExportPlatformIOS::_export_ios_plugins(const Ref<EditorExportPreset> { // Export linked plugin dependency err = _export_additional_assets(dest_dir, plugin_linked_dependencies, true, false, r_exported_assets); - ERR_FAIL_COND_V(err, err); + ERR_FAIL_COND_V(err != OK, err); // Export embedded plugin dependency err = _export_additional_assets(dest_dir, plugin_embedded_dependencies, true, true, r_exported_assets); - ERR_FAIL_COND_V(err, err); + ERR_FAIL_COND_V(err != OK, err); // Export plugin files err = _export_additional_assets(dest_dir, plugin_files, false, false, r_exported_assets); - ERR_FAIL_COND_V(err, err); + ERR_FAIL_COND_V(err != OK, err); } // Update CPP @@ -1486,20 +1502,29 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p return _export_project_helper(p_preset, p_debug, p_path, p_flags, false, false); } -Error EditorExportPlatformIOS::_export_project_helper(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags, bool p_simulator, bool p_skip_ipa) { +Error EditorExportPlatformIOS::_export_project_helper(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags, bool p_simulator, bool p_oneclick) { ExportNotifier notifier(*this, p_preset, p_debug, p_path, p_flags); - String src_pkg_name; - String dest_dir = p_path.get_base_dir() + "/"; - String binary_name = p_path.get_file().get_basename(); + const String dest_dir = p_path.get_base_dir() + "/"; + const String binary_name = p_path.get_file().get_basename(); + const String binary_dir = dest_dir + binary_name; + + if (!DirAccess::exists(dest_dir)) { + add_message(EXPORT_MESSAGE_ERROR, TTR("Export"), vformat(TTR("Target folder does not exist or is inaccessible: \"%s\""), dest_dir)); + return ERR_FILE_BAD_PATH; + } bool export_project_only = p_preset->get("application/export_project_only"); + if (p_oneclick) { + export_project_only = false; // Skip for one-click deploy. + } EditorProgress ep("export", export_project_only ? TTR("Exporting for iOS (Project Files Only)") : TTR("Exporting for iOS"), export_project_only ? 2 : 5, true); String team_id = p_preset->get("application/app_store_team_id"); ERR_FAIL_COND_V_MSG(team_id.length() == 0, ERR_CANT_OPEN, "App Store Team ID not specified - cannot configure the project."); + String src_pkg_name; if (p_debug) { src_pkg_name = p_preset->get("custom_template/debug"); } else { @@ -1515,10 +1540,6 @@ Error EditorExportPlatformIOS::_export_project_helper(const Ref<EditorExportPres } } - if (!DirAccess::exists(dest_dir)) { - return ERR_FILE_BAD_PATH; - } - { Ref<DirAccess> da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); if (da.is_valid()) { @@ -1526,18 +1547,19 @@ Error EditorExportPlatformIOS::_export_project_helper(const Ref<EditorExportPres // remove leftovers from last export so they don't interfere // in case some files are no longer needed - if (da->change_dir(dest_dir + binary_name + ".xcodeproj") == OK) { + if (da->change_dir(binary_dir + ".xcodeproj") == OK) { da->erase_contents_recursive(); } - if (da->change_dir(dest_dir + binary_name) == OK) { + if (da->change_dir(binary_dir) == OK) { da->erase_contents_recursive(); } da->change_dir(current_dir); - if (!da->dir_exists(dest_dir + binary_name)) { - Error err = da->make_dir(dest_dir + binary_name); - if (err) { + if (!da->dir_exists(binary_dir)) { + Error err = da->make_dir(binary_dir); + if (err != OK) { + add_message(EXPORT_MESSAGE_ERROR, TTR("Export"), vformat(TTR("Failed to create the directory: \"%s\""), binary_dir)); return err; } } @@ -1547,10 +1569,11 @@ Error EditorExportPlatformIOS::_export_project_helper(const Ref<EditorExportPres if (ep.step("Making .pck", 0)) { return ERR_SKIP; } - String pack_path = dest_dir + binary_name + ".pck"; + String pack_path = binary_dir + ".pck"; Vector<SharedObject> libraries; Error err = save_pack(p_preset, p_debug, pack_path, &libraries); if (err) { + // Message is supplied by the subroutine method. return err; } @@ -1599,7 +1622,10 @@ Error EditorExportPlatformIOS::_export_project_helper(const Ref<EditorExportPres Vector<IOSExportAsset> assets; Ref<DirAccess> tmp_app_path = DirAccess::create_for_path(dest_dir); - ERR_FAIL_COND_V(tmp_app_path.is_null(), ERR_CANT_CREATE); + if (tmp_app_path.is_null()) { + add_message(EXPORT_MESSAGE_ERROR, TTR("Prepare Templates"), vformat(TTR("Could not create and open the directory: \"%s\""), dest_dir)); + return ERR_CANT_CREATE; + } print_line("Unzipping..."); Ref<FileAccess> io_fa; @@ -1610,8 +1636,14 @@ Error EditorExportPlatformIOS::_export_project_helper(const Ref<EditorExportPres return ERR_CANT_OPEN; } - err = _export_ios_plugins(p_preset, config_data, dest_dir + binary_name, assets, p_debug); - ERR_FAIL_COND_V(err, err); + err = _export_ios_plugins(p_preset, config_data, binary_dir, assets, p_debug); + if (err != OK) { + // TODO: Improve error reporting by using `add_message` throughout all methods called via `_export_ios_plugins`. + // For now a generic top level message would be fine, but we're ought to use proper reporting here instead of + // just fail macros and non-descriptive error return values. + add_message(EXPORT_MESSAGE_ERROR, TTR("iOS Plugins"), vformat(TTR("Failed to export iOS plugins with code %d. Please check the output log."), err)); + return err; + } //export rest of the files int ret = unzGoToFirstFile(src_pkg_zip); @@ -1676,8 +1708,8 @@ Error EditorExportPlatformIOS::_export_project_helper(const Ref<EditorExportPres print_line("Creating " + dir_name); Error dir_err = tmp_app_path->make_dir_recursive(dir_name); if (dir_err) { - ERR_PRINT("Can't create '" + dir_name + "'."); unzClose(src_pkg_zip); + add_message(EXPORT_MESSAGE_ERROR, TTR("Export"), vformat(TTR("Could not create a directory at path \"%s\"."), dir_name)); return ERR_CANT_CREATE; } } @@ -1686,8 +1718,8 @@ Error EditorExportPlatformIOS::_export_project_helper(const Ref<EditorExportPres { Ref<FileAccess> f = FileAccess::open(file, FileAccess::WRITE); if (f.is_null()) { - ERR_PRINT("Can't write '" + file + "'."); unzClose(src_pkg_zip); + add_message(EXPORT_MESSAGE_ERROR, TTR("Export"), vformat(TTR("Could not write to a file at path \"%s\"."), file)); return ERR_CANT_CREATE; }; f->store_buffer(data.ptr(), data.size()); @@ -1708,7 +1740,7 @@ Error EditorExportPlatformIOS::_export_project_helper(const Ref<EditorExportPres unzClose(src_pkg_zip); if (!found_library) { - ERR_PRINT("Requested template library '" + library_to_use + "' not found. It might be missing from your template archive."); + add_message(EXPORT_MESSAGE_ERROR, TTR("Export"), vformat(TTR("Requested template library '%s' not found. It might be missing from your template archive."), library_to_use)); return ERR_FILE_NOT_FOUND; } @@ -1720,7 +1752,7 @@ Error EditorExportPlatformIOS::_export_project_helper(const Ref<EditorExportPres Vector<String> translations = GLOBAL_GET("internationalization/locale/translations"); if (translations.size() > 0) { { - String fname = dest_dir + binary_name + "/en.lproj"; + String fname = binary_dir + "/en.lproj"; tmp_app_path->make_dir_recursive(fname); Ref<FileAccess> f = FileAccess::open(fname + "/InfoPlist.strings", FileAccess::WRITE); f->store_line("/* Localized versions of Info.plist keys */"); @@ -1740,7 +1772,7 @@ Error EditorExportPlatformIOS::_export_project_helper(const Ref<EditorExportPres } for (const String &lang : languages) { - String fname = dest_dir + binary_name + "/" + lang + ".lproj"; + String fname = binary_dir + "/" + lang + ".lproj"; tmp_app_path->make_dir_recursive(fname); Ref<FileAccess> f = FileAccess::open(fname + "/InfoPlist.strings", FileAccess::WRITE); f->store_line("/* Localized versions of Info.plist keys */"); @@ -1769,34 +1801,37 @@ Error EditorExportPlatformIOS::_export_project_helper(const Ref<EditorExportPres String dest_lib_file_path = dest_dir + static_lib_path.get_file(); Error lib_copy_err = tmp_app_path->copy(static_lib_path, dest_lib_file_path); if (lib_copy_err != OK) { - ERR_PRINT("Can't copy '" + static_lib_path + "'."); + add_message(EXPORT_MESSAGE_ERROR, TTR("Export"), vformat(TTR("Could not copy a file at path \"%s\" to \"%s\"."), static_lib_path, dest_lib_file_path)); return lib_copy_err; } } } - String iconset_dir = dest_dir + binary_name + "/Images.xcassets/AppIcon.appiconset/"; + String iconset_dir = binary_dir + "/Images.xcassets/AppIcon.appiconset/"; err = OK; if (!tmp_app_path->dir_exists(iconset_dir)) { err = tmp_app_path->make_dir_recursive(iconset_dir); } - if (err) { + if (err != OK) { + add_message(EXPORT_MESSAGE_ERROR, TTR("Export"), vformat(TTR("Could not create a directory at path \"%s\"."), iconset_dir)); return err; } err = _export_icons(p_preset, iconset_dir); - if (err) { + if (err != OK) { + // Message is supplied by the subroutine method. return err; } { bool use_storyboard = p_preset->get("storyboard/use_launch_screen_storyboard"); - String launch_image_path = dest_dir + binary_name + "/Images.xcassets/LaunchImage.launchimage/"; - String splash_image_path = dest_dir + binary_name + "/Images.xcassets/SplashImage.imageset/"; + String launch_image_path = binary_dir + "/Images.xcassets/LaunchImage.launchimage/"; + String splash_image_path = binary_dir + "/Images.xcassets/SplashImage.imageset/"; Ref<DirAccess> launch_screen_da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM); if (launch_screen_da.is_null()) { + add_message(EXPORT_MESSAGE_ERROR, TTR("Export"), TTR("Could not access the filesystem.")); return ERR_CANT_CREATE; } @@ -1809,10 +1844,11 @@ Error EditorExportPlatformIOS::_export_project_helper(const Ref<EditorExportPres } err = _export_loading_screen_file(p_preset, splash_image_path); + add_message(EXPORT_MESSAGE_ERROR, TTR("Export"), vformat(TTR("Failed to create a file at path \"%s\" with code %d."), splash_image_path, err)); } else { print_line("Using Launch Images"); - const String launch_screen_path = dest_dir + binary_name + "/Launch Screen.storyboard"; + const String launch_screen_path = binary_dir + "/Launch Screen.storyboard"; launch_screen_da->remove(launch_screen_path); @@ -1822,21 +1858,22 @@ Error EditorExportPlatformIOS::_export_project_helper(const Ref<EditorExportPres } err = _export_loading_screen_images(p_preset, launch_image_path); + add_message(EXPORT_MESSAGE_ERROR, TTR("Export"), vformat(TTR("Failed to create a file at path \"%s\" with code %d."), launch_image_path, err)); } } - if (err) { + if (err != OK) { return err; } print_line("Exporting additional assets"); - _export_additional_assets(dest_dir + binary_name, libraries, assets); + _export_additional_assets(binary_dir, libraries, assets); _add_assets_to_project(p_preset, project_file_data, assets); - String project_file_name = dest_dir + binary_name + ".xcodeproj/project.pbxproj"; + String project_file_name = binary_dir + ".xcodeproj/project.pbxproj"; { Ref<FileAccess> f = FileAccess::open(project_file_name, FileAccess::WRITE); if (f.is_null()) { - ERR_PRINT("Can't write '" + project_file_name + "'."); + add_message(EXPORT_MESSAGE_ERROR, TTR("Export"), vformat(TTR("Could not write to a file at path \"%s\"."), project_file_name)); return ERR_CANT_CREATE; }; f->store_buffer(project_file_data.ptr(), project_file_data.size()); @@ -1847,7 +1884,7 @@ Error EditorExportPlatformIOS::_export_project_helper(const Ref<EditorExportPres if (ep.step("Code-signing dylibs", 2)) { return ERR_SKIP; } - Ref<DirAccess> dylibs_dir = DirAccess::open(dest_dir + binary_name + "/dylibs"); + Ref<DirAccess> dylibs_dir = DirAccess::open(binary_dir + "/dylibs"); ERR_FAIL_COND_V(dylibs_dir.is_null(), ERR_CANT_OPEN); CodesignData codesign_data(p_preset, p_debug); err = _walk_dir_recursive(dylibs_dir, _codesign, &codesign_data); @@ -1864,10 +1901,11 @@ Error EditorExportPlatformIOS::_export_project_helper(const Ref<EditorExportPres if (ep.step("Making .xcarchive", 3)) { return ERR_SKIP; } + String archive_path = p_path.get_basename() + ".xcarchive"; List<String> archive_args; archive_args.push_back("-project"); - archive_args.push_back(dest_dir + binary_name + ".xcodeproj"); + archive_args.push_back(binary_dir + ".xcodeproj"); archive_args.push_back("-scheme"); archive_args.push_back(binary_name); archive_args.push_back("-sdk"); @@ -1888,31 +1926,42 @@ Error EditorExportPlatformIOS::_export_project_helper(const Ref<EditorExportPres archive_args.push_back("-allowProvisioningUpdates"); archive_args.push_back("-archivePath"); archive_args.push_back(archive_path); + String archive_str; err = OS::get_singleton()->execute("xcodebuild", archive_args, &archive_str, nullptr, true); - ERR_FAIL_COND_V(err, err); + if (err != OK) { + add_message(EXPORT_MESSAGE_ERROR, TTR("Xcode Build"), vformat(TTR("Failed to run xcodebuild with code %d"), err)); + return err; + } + print_line("xcodebuild (.xcarchive):\n" + archive_str); if (!archive_str.contains("** ARCHIVE SUCCEEDED **")) { add_message(EXPORT_MESSAGE_ERROR, TTR("Xcode Build"), TTR("Xcode project build failed, see editor log for details.")); return FAILED; } - if (!p_skip_ipa) { + if (!p_oneclick) { if (ep.step("Making .ipa", 4)) { return ERR_SKIP; } + List<String> export_args; export_args.push_back("-exportArchive"); export_args.push_back("-archivePath"); export_args.push_back(archive_path); export_args.push_back("-exportOptionsPlist"); - export_args.push_back(dest_dir + binary_name + "/export_options.plist"); + export_args.push_back(binary_dir + "/export_options.plist"); export_args.push_back("-allowProvisioningUpdates"); export_args.push_back("-exportPath"); export_args.push_back(dest_dir); + String export_str; err = OS::get_singleton()->execute("xcodebuild", export_args, &export_str, nullptr, true); - ERR_FAIL_COND_V(err, err); + if (err != OK) { + add_message(EXPORT_MESSAGE_ERROR, TTR("Xcode Build"), vformat(TTR("Failed to run xcodebuild with code %d"), err)); + return err; + } + print_line("xcodebuild (.ipa):\n" + export_str); if (!export_str.contains("** EXPORT SUCCEEDED **")) { add_message(EXPORT_MESSAGE_ERROR, TTR("Xcode Build"), TTR(".ipa export failed, see editor log for details.")); @@ -2064,6 +2113,28 @@ bool EditorExportPlatformIOS::is_package_name_valid(const String &p_package, Str } #ifdef MACOS_ENABLED +bool EditorExportPlatformIOS::_check_xcode_install() { + static bool xcode_found = false; + if (!xcode_found) { + Vector<String> mdfind_paths; + List<String> mdfind_args; + mdfind_args.push_back("kMDItemCFBundleIdentifier=com.apple.dt.Xcode"); + + String output; + Error err = OS::get_singleton()->execute("mdfind", mdfind_args, &output); + if (err == OK) { + mdfind_paths = output.split("\n"); + } + for (const String &found_path : mdfind_paths) { + xcode_found = !found_path.is_empty() && DirAccess::dir_exists_absolute(found_path.strip_edges()); + if (xcode_found) { + break; + } + } + } + return xcode_found; +} + void EditorExportPlatformIOS::_check_for_changes_poll_thread(void *ud) { EditorExportPlatformIOS *ea = static_cast<EditorExportPlatformIOS *>(ud); @@ -2089,12 +2160,9 @@ void EditorExportPlatformIOS::_check_for_changes_poll_thread(void *ud) { // Check for devices updates. Vector<Device> ldevices; - // Enum real devices. + // Enum real devices (via ios_deploy, pre Xcode 15). String idepl = EDITOR_GET("export/ios/ios_deploy"); - if (idepl.is_empty()) { - idepl = "ios-deploy"; - } - { + if (!idepl.is_empty()) { String devices; List<String> args; args.push_back("-c"); @@ -2120,8 +2188,9 @@ void EditorExportPlatformIOS::_check_for_changes_poll_thread(void *ud) { Dictionary device_info = device_event["Device"]; Device nd; nd.id = device_info["DeviceIdentifier"]; - nd.name = device_info["DeviceName"].operator String() + " (connected through " + device_event["Interface"].operator String() + ")"; + nd.name = device_info["DeviceName"].operator String() + " (ios_deploy, " + ((device_event["Interface"] == "WIFI") ? "network" : "wired") + ")"; nd.wifi = device_event["Interface"] == "WIFI"; + nd.use_ios_deploy = true; nd.simulator = false; ldevices.push_back(nd); } @@ -2130,39 +2199,78 @@ void EditorExportPlatformIOS::_check_for_changes_poll_thread(void *ud) { } } - // Enum simulators - if (FileAccess::exists("/usr/bin/xcrun") || FileAccess::exists("/bin/xcrun")) { - String devices; - List<String> args; - args.push_back("simctl"); - args.push_back("list"); - args.push_back("devices"); - args.push_back("-j"); - - int ec = 0; - Error err = OS::get_singleton()->execute("xcrun", args, &devices, &ec, true); - if (err == OK && ec == 0) { - Ref<JSON> json; - json.instantiate(); - err = json->parse(devices); - if (err == OK) { - Dictionary data = json->get_data(); - Dictionary devices = data["devices"]; - for (const Variant *key = devices.next(nullptr); key; key = devices.next(key)) { - Array os_devices = devices[*key]; - for (int i = 0; i < os_devices.size(); i++) { - Dictionary device_info = os_devices[i]; - if (device_info["isAvailable"].operator bool() && device_info["state"] == "Booted") { + // Enum simulators. + if (_check_xcode_install() && (FileAccess::exists("/usr/bin/xcrun") || FileAccess::exists("/bin/xcrun"))) { + { + String devices; + List<String> args; + args.push_back("devicectl"); + args.push_back("list"); + args.push_back("devices"); + args.push_back("-j"); + args.push_back("-"); + args.push_back("-q"); + int ec = 0; + Error err = OS::get_singleton()->execute("xcrun", args, &devices, &ec, true); + if (err == OK && ec == 0) { + Ref<JSON> json; + json.instantiate(); + err = json->parse(devices); + if (err == OK) { + const Dictionary &data = json->get_data(); + const Dictionary &result = data["result"]; + const Array &devices = result["devices"]; + for (int i = 0; i < devices.size(); i++) { + const Dictionary &device_info = devices[i]; + const Dictionary &conn_props = device_info["connectionProperties"]; + const Dictionary &dev_props = device_info["deviceProperties"]; + if (conn_props["pairingState"] == "paired" && dev_props["developerModeStatus"] == "enabled") { Device nd; - nd.id = device_info["udid"]; - nd.name = device_info["name"].operator String() + " (simulator)"; - nd.simulator = true; + nd.id = device_info["identifier"]; + nd.name = dev_props["name"].operator String() + " (devicectl, " + ((conn_props["transportType"] == "localNetwork") ? "network" : "wired") + ")"; + nd.wifi = conn_props["transportType"] == "localNetwork"; + nd.simulator = false; ldevices.push_back(nd); } } } } } + + // Enum simulators. + { + String devices; + List<String> args; + args.push_back("simctl"); + args.push_back("list"); + args.push_back("devices"); + args.push_back("-j"); + + int ec = 0; + Error err = OS::get_singleton()->execute("xcrun", args, &devices, &ec, true); + if (err == OK && ec == 0) { + Ref<JSON> json; + json.instantiate(); + err = json->parse(devices); + if (err == OK) { + const Dictionary &data = json->get_data(); + const Dictionary &devices = data["devices"]; + for (const Variant *key = devices.next(nullptr); key; key = devices.next(key)) { + const Array &os_devices = devices[*key]; + for (int i = 0; i < os_devices.size(); i++) { + const Dictionary &device_info = os_devices[i]; + if (device_info["isAvailable"].operator bool() && device_info["state"] == "Booted") { + Device nd; + nd.id = device_info["udid"]; + nd.name = device_info["name"].operator String() + " (simulator)"; + nd.simulator = true; + ldevices.push_back(nd); + } + } + } + } + } + } } // Update device list. @@ -2323,6 +2431,7 @@ Error EditorExportPlatformIOS::run(const Ref<EditorExportPreset> &p_preset, int List<String> args; args.push_back("simctl"); args.push_back("launch"); + args.push_back("--terminate-running-process"); args.push_back(dev.id); args.push_back(p_preset->get("application/bundle_identifier")); for (const String &E : cmd_args_list) { @@ -2341,8 +2450,8 @@ Error EditorExportPlatformIOS::run(const Ref<EditorExportPreset> &p_preset, int add_message(EXPORT_MESSAGE_ERROR, TTR("Run"), TTR("Running failed, see editor log for details.")); } } - } else { - // Deploy and run on real device. + } else if (dev.use_ios_deploy) { + // Deploy and run on real device (via ios-deploy). if (ep.step("Installing and running on device...", 4)) { CLEANUP_AND_RETURN(ERR_SKIP); } else { @@ -2380,6 +2489,62 @@ Error EditorExportPlatformIOS::run(const Ref<EditorExportPreset> &p_preset, int CLEANUP_AND_RETURN(ERR_UNCONFIGURED); } } + } else { + // Deploy and run on real device. + if (ep.step("Installing to device...", 3)) { + CLEANUP_AND_RETURN(ERR_SKIP); + } else { + List<String> args; + args.push_back("devicectl"); + args.push_back("device"); + args.push_back("install"); + args.push_back("app"); + args.push_back("-d"); + args.push_back(dev.id); + args.push_back(EditorPaths::get_singleton()->get_cache_dir().path_join(id).path_join("export.xcarchive/Products/Applications/export.app")); + + String log; + int ec; + err = OS::get_singleton()->execute("xcrun", args, &log, &ec, true); + if (err != OK) { + add_message(EXPORT_MESSAGE_WARNING, TTR("Run"), TTR("Could not start device executable.")); + CLEANUP_AND_RETURN(err); + } + if (ec != 0) { + print_line("device install:\n" + log); + add_message(EXPORT_MESSAGE_ERROR, TTR("Run"), TTR("Installation failed, see editor log for details.")); + CLEANUP_AND_RETURN(ERR_UNCONFIGURED); + } + } + + if (ep.step("Running on device...", 4)) { + CLEANUP_AND_RETURN(ERR_SKIP); + } else { + List<String> args; + args.push_back("devicectl"); + args.push_back("device"); + args.push_back("process"); + args.push_back("launch"); + args.push_back("--terminate-existing"); + args.push_back("-d"); + args.push_back(dev.id); + args.push_back(p_preset->get("application/bundle_identifier")); + for (const String &E : cmd_args_list) { + args.push_back(E); + } + + String log; + int ec; + err = OS::get_singleton()->execute("xcrun", args, &log, &ec, true); + if (err != OK) { + add_message(EXPORT_MESSAGE_WARNING, TTR("Run"), TTR("Could not start devicectl executable.")); + CLEANUP_AND_RETURN(err); + } + if (ec != 0) { + print_line("devicectl launch:\n" + log); + add_message(EXPORT_MESSAGE_ERROR, TTR("Run"), TTR("Running failed, see editor log for details.")); + } + } } CLEANUP_AND_RETURN(OK); diff --git a/platform/ios/export/export_plugin.h b/platform/ios/export/export_plugin.h index 27a4d73fcd..fd2243bcda 100644 --- a/platform/ios/export/export_plugin.h +++ b/platform/ios/export/export_plugin.h @@ -70,6 +70,7 @@ class EditorExportPlatformIOS : public EditorExportPlatform { String name; bool simulator = false; bool wifi = false; + bool use_ios_deploy = false; }; Vector<Device> devices; @@ -81,6 +82,7 @@ class EditorExportPlatformIOS : public EditorExportPlatform { Thread check_for_changes_thread; SafeFlag quit_request; + static bool _check_xcode_install(); static void _check_for_changes_poll_thread(void *ud); #endif @@ -138,7 +140,7 @@ class EditorExportPlatformIOS : public EditorExportPlatform { Error _export_additional_assets(const String &p_out_dir, const Vector<SharedObject> &p_libraries, Vector<IOSExportAsset> &r_exported_assets); Error _export_ios_plugins(const Ref<EditorExportPreset> &p_preset, IOSConfigData &p_config_data, const String &dest_dir, Vector<IOSExportAsset> &r_exported_assets, bool p_debug); - Error _export_project_helper(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags, bool p_simulator, bool p_skip_ipa); + Error _export_project_helper(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags, bool p_simulator, bool p_oneclick); bool is_package_name_valid(const String &p_package, String *r_error = nullptr) const; diff --git a/platform/ios/os_ios.mm b/platform/ios/os_ios.mm index 68e6d4c934..16ac3acbec 100644 --- a/platform/ios/os_ios.mm +++ b/platform/ios/os_ios.mm @@ -72,16 +72,15 @@ HashMap<String, void *> OS_IOS::dynamic_symbol_lookup_table; void add_ios_init_callback(init_callback cb) { if (ios_init_callbacks_count == ios_init_callbacks_capacity) { - void *new_ptr = realloc(ios_init_callbacks, sizeof(cb) * 32); + void *new_ptr = realloc(ios_init_callbacks, sizeof(cb) * (ios_init_callbacks_capacity + 32)); if (new_ptr) { ios_init_callbacks = (init_callback *)(new_ptr); ios_init_callbacks_capacity += 32; + } else { + ERR_FAIL_MSG("Unable to allocate memory for extension callbacks."); } } - if (ios_init_callbacks_capacity > ios_init_callbacks_count) { - ios_init_callbacks[ios_init_callbacks_count] = cb; - ++ios_init_callbacks_count; - } + ios_init_callbacks[ios_init_callbacks_count++] = cb; } void register_dynamic_symbol(char *name, void *address) { diff --git a/platform/linuxbsd/export/export_plugin.cpp b/platform/linuxbsd/export/export_plugin.cpp index 9d1e058b76..64efcffae3 100644 --- a/platform/linuxbsd/export/export_plugin.cpp +++ b/platform/linuxbsd/export/export_plugin.cpp @@ -79,6 +79,7 @@ Error EditorExportPlatformLinuxBSD::export_project(const Ref<EditorExportPreset> Ref<DirAccess> tmp_app_dir = DirAccess::create_for_path(tmp_dir_path); if (export_as_zip) { if (tmp_app_dir.is_null()) { + add_message(EXPORT_MESSAGE_ERROR, TTR("Prepare Templates"), vformat(TTR("Could not create and open the directory: \"%s\""), tmp_dir_path)); return ERR_CANT_CREATE; } if (DirAccess::exists(tmp_dir_path)) { @@ -93,19 +94,18 @@ Error EditorExportPlatformLinuxBSD::export_project(const Ref<EditorExportPreset> // Export project. Error err = EditorExportPlatformPC::export_project(p_preset, p_debug, path, p_flags); if (err != OK) { + // Message is supplied by the subroutine method. return err; } // Save console wrapper. - if (err == OK) { - int con_scr = p_preset->get("debug/export_console_wrapper"); - if ((con_scr == 1 && p_debug) || (con_scr == 2)) { - String scr_path = path.get_basename() + ".sh"; - err = _export_debug_script(p_preset, pkg_name, path.get_file(), scr_path); - FileAccess::set_unix_permissions(scr_path, 0755); - if (err != OK) { - add_message(EXPORT_MESSAGE_ERROR, TTR("Debug Console Export"), TTR("Could not create console wrapper.")); - } + int con_scr = p_preset->get("debug/export_console_wrapper"); + if ((con_scr == 1 && p_debug) || (con_scr == 2)) { + String scr_path = path.get_basename() + ".sh"; + err = _export_debug_script(p_preset, pkg_name, path.get_file(), scr_path); + FileAccess::set_unix_permissions(scr_path, 0755); + if (err != OK) { + add_message(EXPORT_MESSAGE_ERROR, TTR("Debug Console Export"), TTR("Could not create console wrapper.")); } } diff --git a/platform/linuxbsd/x11/display_server_x11.cpp b/platform/linuxbsd/x11/display_server_x11.cpp index 3bafdfb53d..e1d842422c 100644 --- a/platform/linuxbsd/x11/display_server_x11.cpp +++ b/platform/linuxbsd/x11/display_server_x11.cpp @@ -3875,7 +3875,7 @@ void DisplayServerX11::_xim_preedit_draw_callback(::XIM xim, ::XPointer client_d ds->im_selection = Point2i(); } - OS_Unix::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_OS_IME_UPDATE); + OS_Unix::get_singleton()->get_main_loop()->call_deferred(SNAME("notification"), MainLoop::NOTIFICATION_OS_IME_UPDATE); } } diff --git a/platform/macos/display_server_macos.h b/platform/macos/display_server_macos.h index f012292f84..a19e02eb21 100644 --- a/platform/macos/display_server_macos.h +++ b/platform/macos/display_server_macos.h @@ -140,6 +140,8 @@ private: String rendering_driver; NSMenu *apple_menu = nullptr; + NSMenu *window_menu = nullptr; + NSMenu *help_menu = nullptr; NSMenu *dock_menu = nullptr; struct MenuData { Callable open; @@ -226,7 +228,8 @@ private: static NSCursor *_cursor_from_selector(SEL p_selector, SEL p_fallback = nil); - bool _has_help_menu() const; + int _get_system_menu_start(const NSMenu *p_menu) const; + int _get_system_menu_count(const NSMenu *p_menu) const; NSMenuItem *_menu_add_item(const String &p_menu_root, const String &p_label, Key p_accel, int p_index, int *r_out); public: @@ -321,6 +324,8 @@ public: virtual void global_menu_remove_item(const String &p_menu_root, int p_idx) override; virtual void global_menu_clear(const String &p_menu_root) override; + virtual Dictionary global_menu_get_system_menu_roots() const override; + virtual bool tts_is_speaking() const override; virtual bool tts_is_paused() const override; virtual TypedArray<Dictionary> tts_get_voices() const override; diff --git a/platform/macos/display_server_macos.mm b/platform/macos/display_server_macos.mm index 2a6f17cb5d..742b552e13 100644 --- a/platform/macos/display_server_macos.mm +++ b/platform/macos/display_server_macos.mm @@ -64,6 +64,9 @@ #import <IOKit/hid/IOHIDKeys.h> #import <IOKit/hid/IOHIDLib.h> +#define MENU_TAG_START 0x00004447 +#define MENU_TAG_END 0xFFFF4447 + const NSMenu *DisplayServerMacOS::_get_menu_root(const String &p_menu_root) const { const NSMenu *menu = nullptr; if (p_menu_root == "" || p_menu_root.to_lower() == "_main") { @@ -72,16 +75,21 @@ const NSMenu *DisplayServerMacOS::_get_menu_root(const String &p_menu_root) cons } else if (p_menu_root.to_lower() == "_dock") { // macOS dock menu. menu = dock_menu; + } else if (p_menu_root.to_lower() == "_apple") { + // macOS Apple menu. + menu = apple_menu; + } else if (p_menu_root.to_lower() == "_window") { + // macOS Window menu. + menu = window_menu; + } else if (p_menu_root.to_lower() == "_help") { + // macOS Help menu. + menu = help_menu; } else { // Submenu. if (submenu.has(p_menu_root)) { menu = submenu[p_menu_root].menu; } } - if (menu == apple_menu) { - // Do not allow to change Apple menu. - return nullptr; - } return menu; } @@ -93,6 +101,15 @@ NSMenu *DisplayServerMacOS::_get_menu_root(const String &p_menu_root) { } else if (p_menu_root.to_lower() == "_dock") { // macOS dock menu. menu = dock_menu; + } else if (p_menu_root.to_lower() == "_apple") { + // macOS Apple menu. + menu = apple_menu; + } else if (p_menu_root.to_lower() == "_window") { + // macOS Window menu. + menu = window_menu; + } else if (p_menu_root.to_lower() == "_help") { + // macOS Help menu. + menu = help_menu; } else { // Submenu. if (!submenu.has(p_menu_root)) { @@ -104,10 +121,6 @@ NSMenu *DisplayServerMacOS::_get_menu_root(const String &p_menu_root) { } menu = submenu[p_menu_root].menu; } - if (menu == apple_menu) { - // Do not allow to change Apple menu. - return nullptr; - } return menu; } @@ -725,7 +738,8 @@ void DisplayServerMacOS::update_mouse_pos(DisplayServerMacOS::WindowData &p_wd, } void DisplayServerMacOS::pop_last_key_event() { - if (key_event_pos > 0) { + // Does not pop last key event when it is an IME key event. + if (key_event_pos > 0 && key_event_buffer[key_event_pos - 1].raw) { key_event_pos--; } } @@ -819,22 +833,6 @@ String DisplayServerMacOS::get_name() const { return "macOS"; } -bool DisplayServerMacOS::_has_help_menu() const { - if ([NSApp helpMenu]) { - return true; - } else { - NSMenu *menu = [NSApp mainMenu]; - const NSMenuItem *menu_item = [menu itemAtIndex:[menu numberOfItems] - 1]; - if (menu_item) { - String menu_name = String::utf8([[menu_item title] UTF8String]); - if (menu_name == "Help" || menu_name == RTR("Help")) { - return true; - } - } - return false; - } -} - bool DisplayServerMacOS::_is_menu_opened(NSMenu *p_menu) const { if (submenu_inv.has(p_menu)) { const MenuData &md = submenu[submenu_inv[p_menu]]; @@ -853,24 +851,57 @@ bool DisplayServerMacOS::_is_menu_opened(NSMenu *p_menu) const { return false; } +int DisplayServerMacOS::_get_system_menu_start(const NSMenu *p_menu) const { + if (p_menu == [NSApp mainMenu]) { // Skip Apple menu. + return 1; + } + if (p_menu == apple_menu || p_menu == window_menu || p_menu == help_menu) { + int count = [p_menu numberOfItems]; + for (int i = 0; i < count; i++) { + NSMenuItem *menu_item = [p_menu itemAtIndex:i]; + if (menu_item.tag == MENU_TAG_START) { + return i + 1; + } + } + } + return 0; +} + +int DisplayServerMacOS::_get_system_menu_count(const NSMenu *p_menu) const { + if (p_menu == [NSApp mainMenu]) { // Skip Apple, Window and Help menu. + return [p_menu numberOfItems] - 3; + } + if (p_menu == apple_menu || p_menu == window_menu || p_menu == help_menu) { + int start = 0; + int count = [p_menu numberOfItems]; + for (int i = 0; i < count; i++) { + NSMenuItem *menu_item = [p_menu itemAtIndex:i]; + if (menu_item.tag == MENU_TAG_START) { + start = i + 1; + } + if (menu_item.tag == MENU_TAG_END) { + return i - start; + } + } + } + return [p_menu numberOfItems]; +} + NSMenuItem *DisplayServerMacOS::_menu_add_item(const String &p_menu_root, const String &p_label, Key p_accel, int p_index, int *r_out) { NSMenu *menu = _get_menu_root(p_menu_root); if (menu) { String keycode = KeyMappingMacOS::keycode_get_native_string(p_accel & KeyModifierMask::CODE_MASK); NSMenuItem *menu_item; - int item_count = ((menu == [NSApp mainMenu]) && _has_help_menu()) ? [menu numberOfItems] - 1 : [menu numberOfItems]; - if ((menu == [NSApp mainMenu]) && (p_label == "Help" || p_label == RTR("Help"))) { - p_index = [menu numberOfItems]; - } else if (p_index < 0) { - p_index = item_count; + int item_start = _get_system_menu_start(menu); + int item_count = _get_system_menu_count(menu); + if (p_index < 0) { + p_index = item_start + item_count; } else { - if (menu == [NSApp mainMenu]) { // Skip Apple menu. - p_index++; - } - p_index = CLAMP(p_index, 0, item_count); + p_index += item_start; + p_index = CLAMP(p_index, item_start, item_start + item_count); } menu_item = [menu insertItemWithTitle:[NSString stringWithUTF8String:p_label.utf8().get_data()] action:@selector(globalMenuCallback:) keyEquivalent:[NSString stringWithUTF8String:keycode.utf8().get_data()] atIndex:p_index]; - *r_out = (menu == [NSApp mainMenu]) ? p_index - 1 : p_index; + *r_out = p_index - item_start; return menu_item; } return nullptr; @@ -1069,19 +1100,16 @@ int DisplayServerMacOS::global_menu_add_submenu_item(const String &p_menu_root, return -1; } NSMenuItem *menu_item; - int item_count = ((menu == [NSApp mainMenu]) && _has_help_menu()) ? [menu numberOfItems] - 1 : [menu numberOfItems]; - if ((menu == [NSApp mainMenu]) && (p_label == "Help" || p_label == RTR("Help"))) { - p_index = [menu numberOfItems]; - } else if (p_index < 0) { - p_index = item_count; + int item_start = _get_system_menu_start(menu); + int item_count = _get_system_menu_count(menu); + if (p_index < 0) { + p_index = item_start + item_count; } else { - if (menu == [NSApp mainMenu]) { // Skip Apple menu. - p_index++; - } - p_index = CLAMP(p_index, 0, item_count); + p_index += item_start; + p_index = CLAMP(p_index, item_start, item_start + item_count); } menu_item = [menu insertItemWithTitle:[NSString stringWithUTF8String:p_label.utf8().get_data()] action:nil keyEquivalent:@"" atIndex:p_index]; - out = (menu == [NSApp mainMenu]) ? p_index - 1 : p_index; + out = p_index - item_start; GodotMenuItem *obj = [[GodotMenuItem alloc] init]; obj->callback = Callable(); @@ -1104,13 +1132,16 @@ int DisplayServerMacOS::global_menu_add_separator(const String &p_menu_root, int if (menu == [NSApp mainMenu]) { // Do not add separators into main menu. return -1; } + int item_start = _get_system_menu_start(menu); + int item_count = _get_system_menu_count(menu); if (p_index < 0) { - p_index = [menu numberOfItems]; + p_index = item_start + item_count; } else { - p_index = CLAMP(p_index, 0, [menu numberOfItems]); + p_index += item_start; + p_index = CLAMP(p_index, item_start, item_start + item_count); } [menu insertItem:[NSMenuItem separatorItem] atIndex:p_index]; - return p_index; + return p_index - item_start; } return -1; } @@ -1120,11 +1151,8 @@ int DisplayServerMacOS::global_menu_get_item_index_from_text(const String &p_men const NSMenu *menu = _get_menu_root(p_menu_root); if (menu) { - if (menu == [NSApp mainMenu]) { // Skip Apple menu. - return [menu indexOfItemWithTitle:[NSString stringWithUTF8String:p_text.utf8().get_data()]] - 1; - } else { - return [menu indexOfItemWithTitle:[NSString stringWithUTF8String:p_text.utf8().get_data()]]; - } + int item_start = _get_system_menu_start(menu); + return [menu indexOfItemWithTitle:[NSString stringWithUTF8String:p_text.utf8().get_data()]] - item_start; } return -1; @@ -1135,16 +1163,14 @@ int DisplayServerMacOS::global_menu_get_item_index_from_tag(const String &p_menu const NSMenu *menu = _get_menu_root(p_menu_root); if (menu) { - for (NSInteger i = (menu == [NSApp mainMenu]) ? 1 : 0; i < [menu numberOfItems]; i++) { + int item_start = _get_system_menu_start(menu); + int item_count = _get_system_menu_count(menu); + for (NSInteger i = item_start; i < item_start + item_count; i++) { const NSMenuItem *menu_item = [menu itemAtIndex:i]; if (menu_item) { const GodotMenuItem *obj = [menu_item representedObject]; if (obj && obj->meta == p_tag) { - if (menu == [NSApp mainMenu]) { // Skip Apple menu. - return i - 1; - } else { - return i; - } + return i - item_start; } } } @@ -1159,10 +1185,10 @@ bool DisplayServerMacOS::global_menu_is_item_checked(const String &p_menu_root, const NSMenu *menu = _get_menu_root(p_menu_root); if (menu) { ERR_FAIL_COND_V(p_idx < 0, false); - if (menu == [NSApp mainMenu]) { // Skip Apple menu. - p_idx++; - } - ERR_FAIL_COND_V(p_idx >= [menu numberOfItems], false); + int item_start = _get_system_menu_start(menu); + int item_count = _get_system_menu_count(menu); + p_idx += item_start; + ERR_FAIL_COND_V(p_idx >= item_start + item_count, false); const NSMenuItem *menu_item = [menu itemAtIndex:p_idx]; if (menu_item) { return ([menu_item state] == NSControlStateValueOn); @@ -1177,10 +1203,10 @@ bool DisplayServerMacOS::global_menu_is_item_checkable(const String &p_menu_root const NSMenu *menu = _get_menu_root(p_menu_root); if (menu) { ERR_FAIL_COND_V(p_idx < 0, false); - if (menu == [NSApp mainMenu]) { // Skip Apple menu. - p_idx++; - } - ERR_FAIL_COND_V(p_idx >= [menu numberOfItems], false); + int item_start = _get_system_menu_start(menu); + int item_count = _get_system_menu_count(menu); + p_idx += item_start; + ERR_FAIL_COND_V(p_idx >= item_start + item_count, false); const NSMenuItem *menu_item = [menu itemAtIndex:p_idx]; if (menu_item) { GodotMenuItem *obj = [menu_item representedObject]; @@ -1198,10 +1224,10 @@ bool DisplayServerMacOS::global_menu_is_item_radio_checkable(const String &p_men const NSMenu *menu = _get_menu_root(p_menu_root); if (menu) { ERR_FAIL_COND_V(p_idx < 0, false); - if (menu == [NSApp mainMenu]) { // Skip Apple menu. - p_idx++; - } - ERR_FAIL_COND_V(p_idx >= [menu numberOfItems], false); + int item_start = _get_system_menu_start(menu); + int item_count = _get_system_menu_count(menu); + p_idx += item_start; + ERR_FAIL_COND_V(p_idx >= item_start + item_count, false); const NSMenuItem *menu_item = [menu itemAtIndex:p_idx]; if (menu_item) { GodotMenuItem *obj = [menu_item representedObject]; @@ -1219,10 +1245,10 @@ Callable DisplayServerMacOS::global_menu_get_item_callback(const String &p_menu_ const NSMenu *menu = _get_menu_root(p_menu_root); if (menu) { ERR_FAIL_COND_V(p_idx < 0, Callable()); - if (menu == [NSApp mainMenu]) { // Skip Apple menu. - p_idx++; - } - ERR_FAIL_COND_V(p_idx >= [menu numberOfItems], Callable()); + int item_start = _get_system_menu_start(menu); + int item_count = _get_system_menu_count(menu); + p_idx += item_start; + ERR_FAIL_COND_V(p_idx >= item_start + item_count, Callable()); const NSMenuItem *menu_item = [menu itemAtIndex:p_idx]; if (menu_item) { GodotMenuItem *obj = [menu_item representedObject]; @@ -1240,10 +1266,10 @@ Callable DisplayServerMacOS::global_menu_get_item_key_callback(const String &p_m const NSMenu *menu = _get_menu_root(p_menu_root); if (menu) { ERR_FAIL_COND_V(p_idx < 0, Callable()); - if (menu == [NSApp mainMenu]) { // Skip Apple menu. - p_idx++; - } - ERR_FAIL_COND_V(p_idx >= [menu numberOfItems], Callable()); + int item_start = _get_system_menu_start(menu); + int item_count = _get_system_menu_count(menu); + p_idx += item_start; + ERR_FAIL_COND_V(p_idx >= item_start + item_count, Callable()); const NSMenuItem *menu_item = [menu itemAtIndex:p_idx]; if (menu_item) { GodotMenuItem *obj = [menu_item representedObject]; @@ -1261,10 +1287,10 @@ Variant DisplayServerMacOS::global_menu_get_item_tag(const String &p_menu_root, const NSMenu *menu = _get_menu_root(p_menu_root); if (menu) { ERR_FAIL_COND_V(p_idx < 0, Variant()); - if (menu == [NSApp mainMenu]) { // Skip Apple menu. - p_idx++; - } - ERR_FAIL_COND_V(p_idx >= [menu numberOfItems], Variant()); + int item_start = _get_system_menu_start(menu); + int item_count = _get_system_menu_count(menu); + p_idx += item_start; + ERR_FAIL_COND_V(p_idx >= item_start + item_count, Variant()); const NSMenuItem *menu_item = [menu itemAtIndex:p_idx]; if (menu_item) { GodotMenuItem *obj = [menu_item representedObject]; @@ -1282,10 +1308,10 @@ String DisplayServerMacOS::global_menu_get_item_text(const String &p_menu_root, const NSMenu *menu = _get_menu_root(p_menu_root); if (menu) { ERR_FAIL_COND_V(p_idx < 0, String()); - if (menu == [NSApp mainMenu]) { // Skip Apple menu. - p_idx++; - } - ERR_FAIL_COND_V(p_idx >= [menu numberOfItems], String()); + int item_start = _get_system_menu_start(menu); + int item_count = _get_system_menu_count(menu); + p_idx += item_start; + ERR_FAIL_COND_V(p_idx >= item_start + item_count, String()); const NSMenuItem *menu_item = [menu itemAtIndex:p_idx]; if (menu_item) { return String::utf8([[menu_item title] UTF8String]); @@ -1300,10 +1326,10 @@ String DisplayServerMacOS::global_menu_get_item_submenu(const String &p_menu_roo const NSMenu *menu = _get_menu_root(p_menu_root); if (menu) { ERR_FAIL_COND_V(p_idx < 0, String()); - if (menu == [NSApp mainMenu]) { // Skip Apple menu. - p_idx++; - } - ERR_FAIL_COND_V(p_idx >= [menu numberOfItems], String()); + int item_start = _get_system_menu_start(menu); + int item_count = _get_system_menu_count(menu); + p_idx += item_start; + ERR_FAIL_COND_V(p_idx >= item_start + item_count, String()); const NSMenuItem *menu_item = [menu itemAtIndex:p_idx]; if (menu_item) { NSMenu *sub_menu = [menu_item submenu]; @@ -1321,10 +1347,10 @@ Key DisplayServerMacOS::global_menu_get_item_accelerator(const String &p_menu_ro const NSMenu *menu = _get_menu_root(p_menu_root); if (menu) { ERR_FAIL_COND_V(p_idx < 0, Key::NONE); - if (menu == [NSApp mainMenu]) { // Skip Apple menu. - p_idx++; - } - ERR_FAIL_COND_V(p_idx >= [menu numberOfItems], Key::NONE); + int item_start = _get_system_menu_start(menu); + int item_count = _get_system_menu_count(menu); + p_idx += item_start; + ERR_FAIL_COND_V(p_idx >= item_start + item_count, Key::NONE); const NSMenuItem *menu_item = [menu itemAtIndex:p_idx]; if (menu_item) { String ret = String::utf8([[menu_item keyEquivalent] UTF8String]); @@ -1357,10 +1383,10 @@ bool DisplayServerMacOS::global_menu_is_item_disabled(const String &p_menu_root, const NSMenu *menu = _get_menu_root(p_menu_root); if (menu) { ERR_FAIL_COND_V(p_idx < 0, false); - if (menu == [NSApp mainMenu]) { // Skip Apple menu. - p_idx++; - } - ERR_FAIL_COND_V(p_idx >= [menu numberOfItems], false); + int item_start = _get_system_menu_start(menu); + int item_count = _get_system_menu_count(menu); + p_idx += item_start; + ERR_FAIL_COND_V(p_idx >= item_start + item_count, false); const NSMenuItem *menu_item = [menu itemAtIndex:p_idx]; if (menu_item) { return ![menu_item isEnabled]; @@ -1375,10 +1401,10 @@ bool DisplayServerMacOS::global_menu_is_item_hidden(const String &p_menu_root, i const NSMenu *menu = _get_menu_root(p_menu_root); if (menu) { ERR_FAIL_COND_V(p_idx < 0, false); - if (menu == [NSApp mainMenu]) { // Skip Apple menu. - p_idx++; - } - ERR_FAIL_COND_V(p_idx >= [menu numberOfItems], false); + int item_start = _get_system_menu_start(menu); + int item_count = _get_system_menu_count(menu); + p_idx += item_start; + ERR_FAIL_COND_V(p_idx >= item_start + item_count, false); const NSMenuItem *menu_item = [menu itemAtIndex:p_idx]; if (menu_item) { return [menu_item isHidden]; @@ -1393,10 +1419,10 @@ String DisplayServerMacOS::global_menu_get_item_tooltip(const String &p_menu_roo const NSMenu *menu = _get_menu_root(p_menu_root); if (menu) { ERR_FAIL_COND_V(p_idx < 0, String()); - if (menu == [NSApp mainMenu]) { // Skip Apple menu. - p_idx++; - } - ERR_FAIL_COND_V(p_idx >= [menu numberOfItems], String()); + int item_start = _get_system_menu_start(menu); + int item_count = _get_system_menu_count(menu); + p_idx += item_start; + ERR_FAIL_COND_V(p_idx >= item_start + item_count, String()); const NSMenuItem *menu_item = [menu itemAtIndex:p_idx]; if (menu_item) { return String::utf8([[menu_item toolTip] UTF8String]); @@ -1411,10 +1437,10 @@ int DisplayServerMacOS::global_menu_get_item_state(const String &p_menu_root, in const NSMenu *menu = _get_menu_root(p_menu_root); if (menu) { ERR_FAIL_COND_V(p_idx < 0, 0); - if (menu == [NSApp mainMenu]) { // Skip Apple menu. - p_idx++; - } - ERR_FAIL_COND_V(p_idx >= [menu numberOfItems], 0); + int item_start = _get_system_menu_start(menu); + int item_count = _get_system_menu_count(menu); + p_idx += item_start; + ERR_FAIL_COND_V(p_idx >= item_start + item_count, 0); const NSMenuItem *menu_item = [menu itemAtIndex:p_idx]; if (menu_item) { GodotMenuItem *obj = [menu_item representedObject]; @@ -1432,10 +1458,10 @@ int DisplayServerMacOS::global_menu_get_item_max_states(const String &p_menu_roo const NSMenu *menu = _get_menu_root(p_menu_root); if (menu) { ERR_FAIL_COND_V(p_idx < 0, 0); - if (menu == [NSApp mainMenu]) { // Skip Apple menu. - p_idx++; - } - ERR_FAIL_COND_V(p_idx >= [menu numberOfItems], 0); + int item_start = _get_system_menu_start(menu); + int item_count = _get_system_menu_count(menu); + p_idx += item_start; + ERR_FAIL_COND_V(p_idx >= item_start + item_count, 0); const NSMenuItem *menu_item = [menu itemAtIndex:p_idx]; if (menu_item) { GodotMenuItem *obj = [menu_item representedObject]; @@ -1453,10 +1479,10 @@ Ref<Texture2D> DisplayServerMacOS::global_menu_get_item_icon(const String &p_men const NSMenu *menu = _get_menu_root(p_menu_root); if (menu) { ERR_FAIL_COND_V(p_idx < 0, Ref<Texture2D>()); - if (menu == [NSApp mainMenu]) { // Skip Apple menu. - p_idx++; - } - ERR_FAIL_COND_V(p_idx >= [menu numberOfItems], Ref<Texture2D>()); + int item_start = _get_system_menu_start(menu); + int item_count = _get_system_menu_count(menu); + p_idx += item_start; + ERR_FAIL_COND_V(p_idx >= item_start + item_count, Ref<Texture2D>()); const NSMenuItem *menu_item = [menu itemAtIndex:p_idx]; if (menu_item) { GodotMenuItem *obj = [menu_item representedObject]; @@ -1476,10 +1502,10 @@ int DisplayServerMacOS::global_menu_get_item_indentation_level(const String &p_m const NSMenu *menu = _get_menu_root(p_menu_root); if (menu) { ERR_FAIL_COND_V(p_idx < 0, 0); - if (menu == [NSApp mainMenu]) { // Skip Apple menu. - p_idx++; - } - ERR_FAIL_COND_V(p_idx >= [menu numberOfItems], 0); + int item_start = _get_system_menu_start(menu); + int item_count = _get_system_menu_count(menu); + p_idx += item_start; + ERR_FAIL_COND_V(p_idx >= item_start + item_count, 0); const NSMenuItem *menu_item = [menu itemAtIndex:p_idx]; if (menu_item) { return [menu_item indentationLevel]; @@ -1494,10 +1520,10 @@ void DisplayServerMacOS::global_menu_set_item_checked(const String &p_menu_root, NSMenu *menu = _get_menu_root(p_menu_root); if (menu) { ERR_FAIL_COND(p_idx < 0); - if (menu == [NSApp mainMenu]) { // Skip Apple menu. - p_idx++; - } - ERR_FAIL_COND(p_idx >= [menu numberOfItems]); + int item_start = _get_system_menu_start(menu); + int item_count = _get_system_menu_count(menu); + p_idx += item_start; + ERR_FAIL_COND(p_idx >= item_start + item_count); NSMenuItem *menu_item = [menu itemAtIndex:p_idx]; if (menu_item) { if (p_checked) { @@ -1515,10 +1541,10 @@ void DisplayServerMacOS::global_menu_set_item_checkable(const String &p_menu_roo NSMenu *menu = _get_menu_root(p_menu_root); if (menu) { ERR_FAIL_COND(p_idx < 0); - if (menu == [NSApp mainMenu]) { // Skip Apple menu. - p_idx++; - } - ERR_FAIL_COND(p_idx >= [menu numberOfItems]); + int item_start = _get_system_menu_start(menu); + int item_count = _get_system_menu_count(menu); + p_idx += item_start; + ERR_FAIL_COND(p_idx >= item_start + item_count); NSMenuItem *menu_item = [menu itemAtIndex:p_idx]; if (menu_item) { GodotMenuItem *obj = [menu_item representedObject]; @@ -1534,10 +1560,10 @@ void DisplayServerMacOS::global_menu_set_item_radio_checkable(const String &p_me NSMenu *menu = _get_menu_root(p_menu_root); if (menu) { ERR_FAIL_COND(p_idx < 0); - if (menu == [NSApp mainMenu]) { // Skip Apple menu. - p_idx++; - } - ERR_FAIL_COND(p_idx >= [menu numberOfItems]); + int item_start = _get_system_menu_start(menu); + int item_count = _get_system_menu_count(menu); + p_idx += item_start; + ERR_FAIL_COND(p_idx >= item_start + item_count); NSMenuItem *menu_item = [menu itemAtIndex:p_idx]; if (menu_item) { GodotMenuItem *obj = [menu_item representedObject]; @@ -1553,10 +1579,10 @@ void DisplayServerMacOS::global_menu_set_item_callback(const String &p_menu_root NSMenu *menu = _get_menu_root(p_menu_root); if (menu) { ERR_FAIL_COND(p_idx < 0); - if (menu == [NSApp mainMenu]) { // Skip Apple menu. - p_idx++; - } - ERR_FAIL_COND(p_idx >= [menu numberOfItems]); + int item_start = _get_system_menu_start(menu); + int item_count = _get_system_menu_count(menu); + p_idx += item_start; + ERR_FAIL_COND(p_idx >= item_start + item_count); NSMenuItem *menu_item = [menu itemAtIndex:p_idx]; if (menu_item) { GodotMenuItem *obj = [menu_item representedObject]; @@ -1572,10 +1598,10 @@ void DisplayServerMacOS::global_menu_set_item_hover_callbacks(const String &p_me NSMenu *menu = _get_menu_root(p_menu_root); if (menu) { ERR_FAIL_COND(p_idx < 0); - if (menu == [NSApp mainMenu]) { // Skip Apple menu. - p_idx++; - } - ERR_FAIL_COND(p_idx >= [menu numberOfItems]); + int item_start = _get_system_menu_start(menu); + int item_count = _get_system_menu_count(menu); + p_idx += item_start; + ERR_FAIL_COND(p_idx >= item_start + item_count); NSMenuItem *menu_item = [menu itemAtIndex:p_idx]; if (menu_item) { GodotMenuItem *obj = [menu_item representedObject]; @@ -1591,10 +1617,10 @@ void DisplayServerMacOS::global_menu_set_item_key_callback(const String &p_menu_ NSMenu *menu = _get_menu_root(p_menu_root); if (menu) { ERR_FAIL_COND(p_idx < 0); - if (menu == [NSApp mainMenu]) { // Skip Apple menu. - p_idx++; - } - ERR_FAIL_COND(p_idx >= [menu numberOfItems]); + int item_start = _get_system_menu_start(menu); + int item_count = _get_system_menu_count(menu); + p_idx += item_start; + ERR_FAIL_COND(p_idx >= item_start + item_count); NSMenuItem *menu_item = [menu itemAtIndex:p_idx]; if (menu_item) { GodotMenuItem *obj = [menu_item representedObject]; @@ -1610,10 +1636,10 @@ void DisplayServerMacOS::global_menu_set_item_tag(const String &p_menu_root, int NSMenu *menu = _get_menu_root(p_menu_root); if (menu) { ERR_FAIL_COND(p_idx < 0); - if (menu == [NSApp mainMenu]) { // Skip Apple menu. - p_idx++; - } - ERR_FAIL_COND(p_idx >= [menu numberOfItems]); + int item_start = _get_system_menu_start(menu); + int item_count = _get_system_menu_count(menu); + p_idx += item_start; + ERR_FAIL_COND(p_idx >= item_start + item_count); NSMenuItem *menu_item = [menu itemAtIndex:p_idx]; if (menu_item) { GodotMenuItem *obj = [menu_item representedObject]; @@ -1629,10 +1655,10 @@ void DisplayServerMacOS::global_menu_set_item_text(const String &p_menu_root, in NSMenu *menu = _get_menu_root(p_menu_root); if (menu) { ERR_FAIL_COND(p_idx < 0); - if (menu == [NSApp mainMenu]) { // Skip Apple menu. - p_idx++; - } - ERR_FAIL_COND(p_idx >= [menu numberOfItems]); + int item_start = _get_system_menu_start(menu); + int item_count = _get_system_menu_count(menu); + p_idx += item_start; + ERR_FAIL_COND(p_idx >= item_start + item_count); NSMenuItem *menu_item = [menu itemAtIndex:p_idx]; if (menu_item) { [menu_item setTitle:[NSString stringWithUTF8String:p_text.utf8().get_data()]]; @@ -1646,10 +1672,10 @@ void DisplayServerMacOS::global_menu_set_item_submenu(const String &p_menu_root, NSMenu *menu = _get_menu_root(p_menu_root); if (menu && p_submenu.is_empty()) { ERR_FAIL_COND(p_idx < 0); - if (menu == [NSApp mainMenu]) { // Skip Apple menu. - p_idx++; - } - ERR_FAIL_COND(p_idx >= [menu numberOfItems]); + int item_start = _get_system_menu_start(menu); + int item_count = _get_system_menu_count(menu); + p_idx += item_start; + ERR_FAIL_COND(p_idx >= item_start + item_count); NSMenuItem *menu_item = [menu itemAtIndex:p_idx]; if (menu_item) { if ([menu_item submenu] && _is_menu_opened([menu_item submenu])) { @@ -1672,10 +1698,10 @@ void DisplayServerMacOS::global_menu_set_item_submenu(const String &p_menu_root, return; } ERR_FAIL_COND(p_idx < 0); - if (menu == [NSApp mainMenu]) { // Skip Apple menu. - p_idx++; - } - ERR_FAIL_COND(p_idx >= [menu numberOfItems]); + int item_start = _get_system_menu_start(menu); + int item_count = _get_system_menu_count(menu); + p_idx += item_start; + ERR_FAIL_COND(p_idx >= item_start + item_count); NSMenuItem *menu_item = [menu itemAtIndex:p_idx]; if (menu_item) { [menu setSubmenu:sub_menu forItem:menu_item]; @@ -1689,10 +1715,10 @@ void DisplayServerMacOS::global_menu_set_item_accelerator(const String &p_menu_r NSMenu *menu = _get_menu_root(p_menu_root); if (menu) { ERR_FAIL_COND(p_idx < 0); - if (menu == [NSApp mainMenu]) { // Skip Apple menu. - p_idx++; - } - ERR_FAIL_COND(p_idx >= [menu numberOfItems]); + int item_start = _get_system_menu_start(menu); + int item_count = _get_system_menu_count(menu); + p_idx += item_start; + ERR_FAIL_COND(p_idx >= item_start + item_count); NSMenuItem *menu_item = [menu itemAtIndex:p_idx]; if (menu_item) { if (p_keycode == Key::NONE) { @@ -1712,10 +1738,10 @@ void DisplayServerMacOS::global_menu_set_item_disabled(const String &p_menu_root NSMenu *menu = _get_menu_root(p_menu_root); if (menu) { ERR_FAIL_COND(p_idx < 0); - if (menu == [NSApp mainMenu]) { // Skip Apple menu. - p_idx++; - } - ERR_FAIL_COND(p_idx >= [menu numberOfItems]); + int item_start = _get_system_menu_start(menu); + int item_count = _get_system_menu_count(menu); + p_idx += item_start; + ERR_FAIL_COND(p_idx >= item_start + item_count); NSMenuItem *menu_item = [menu itemAtIndex:p_idx]; if (menu_item) { [menu_item setEnabled:(!p_disabled)]; @@ -1729,10 +1755,10 @@ void DisplayServerMacOS::global_menu_set_item_hidden(const String &p_menu_root, NSMenu *menu = _get_menu_root(p_menu_root); if (menu) { ERR_FAIL_COND(p_idx < 0); - if (menu == [NSApp mainMenu]) { // Skip Apple menu. - p_idx++; - } - ERR_FAIL_COND(p_idx >= [menu numberOfItems]); + int item_start = _get_system_menu_start(menu); + int item_count = _get_system_menu_count(menu); + p_idx += item_start; + ERR_FAIL_COND(p_idx >= item_start + item_count); NSMenuItem *menu_item = [menu itemAtIndex:p_idx]; if (menu_item) { [menu_item setHidden:p_hidden]; @@ -1746,10 +1772,10 @@ void DisplayServerMacOS::global_menu_set_item_tooltip(const String &p_menu_root, NSMenu *menu = _get_menu_root(p_menu_root); if (menu) { ERR_FAIL_COND(p_idx < 0); - if (menu == [NSApp mainMenu]) { // Skip Apple menu. - p_idx++; - } - ERR_FAIL_COND(p_idx >= [menu numberOfItems]); + int item_start = _get_system_menu_start(menu); + int item_count = _get_system_menu_count(menu); + p_idx += item_start; + ERR_FAIL_COND(p_idx >= item_start + item_count); NSMenuItem *menu_item = [menu itemAtIndex:p_idx]; if (menu_item) { [menu_item setToolTip:[NSString stringWithUTF8String:p_tooltip.utf8().get_data()]]; @@ -1763,10 +1789,10 @@ void DisplayServerMacOS::global_menu_set_item_state(const String &p_menu_root, i NSMenu *menu = _get_menu_root(p_menu_root); if (menu) { ERR_FAIL_COND(p_idx < 0); - if (menu == [NSApp mainMenu]) { // Skip Apple menu. - p_idx++; - } - ERR_FAIL_COND(p_idx >= [menu numberOfItems]); + int item_start = _get_system_menu_start(menu); + int item_count = _get_system_menu_count(menu); + p_idx += item_start; + ERR_FAIL_COND(p_idx >= item_start + item_count); NSMenuItem *menu_item = [menu itemAtIndex:p_idx]; if (menu_item) { GodotMenuItem *obj = [menu_item representedObject]; @@ -1782,10 +1808,10 @@ void DisplayServerMacOS::global_menu_set_item_max_states(const String &p_menu_ro NSMenu *menu = _get_menu_root(p_menu_root); if (menu) { ERR_FAIL_COND(p_idx < 0); - if (menu == [NSApp mainMenu]) { // Skip Apple menu. - p_idx++; - } - ERR_FAIL_COND(p_idx >= [menu numberOfItems]); + int item_start = _get_system_menu_start(menu); + int item_count = _get_system_menu_count(menu); + p_idx += item_start; + ERR_FAIL_COND(p_idx >= item_start + item_count); NSMenuItem *menu_item = [menu itemAtIndex:p_idx]; if (menu_item) { GodotMenuItem *obj = [menu_item representedObject]; @@ -1801,10 +1827,10 @@ void DisplayServerMacOS::global_menu_set_item_icon(const String &p_menu_root, in NSMenu *menu = _get_menu_root(p_menu_root); if (menu) { ERR_FAIL_COND(p_idx < 0); - if (menu == [NSApp mainMenu]) { // Skip Apple menu. - p_idx++; - } - ERR_FAIL_COND(p_idx >= [menu numberOfItems]); + int item_start = _get_system_menu_start(menu); + int item_count = _get_system_menu_count(menu); + p_idx += item_start; + ERR_FAIL_COND(p_idx >= item_start + item_count); NSMenuItem *menu_item = [menu itemAtIndex:p_idx]; if (menu_item) { GodotMenuItem *obj = [menu_item representedObject]; @@ -1831,10 +1857,10 @@ void DisplayServerMacOS::global_menu_set_item_indentation_level(const String &p_ NSMenu *menu = _get_menu_root(p_menu_root); if (menu) { ERR_FAIL_COND(p_idx < 0); - if (menu == [NSApp mainMenu]) { // Skip Apple menu. - p_idx++; - } - ERR_FAIL_COND(p_idx >= [menu numberOfItems]); + int item_start = _get_system_menu_start(menu); + int item_count = _get_system_menu_count(menu); + p_idx += item_start; + ERR_FAIL_COND(p_idx >= item_start + item_count); NSMenuItem *menu_item = [menu itemAtIndex:p_idx]; if (menu_item) { [menu_item setIndentationLevel:p_level]; @@ -1847,11 +1873,7 @@ int DisplayServerMacOS::global_menu_get_item_count(const String &p_menu_root) co const NSMenu *menu = _get_menu_root(p_menu_root); if (menu) { - if (menu == [NSApp mainMenu]) { // Skip Apple menu. - return [menu numberOfItems] - 1; - } else { - return [menu numberOfItems]; - } + return _get_system_menu_count(menu); } else { return 0; } @@ -1863,10 +1885,10 @@ void DisplayServerMacOS::global_menu_remove_item(const String &p_menu_root, int NSMenu *menu = _get_menu_root(p_menu_root); if (menu) { ERR_FAIL_COND(p_idx < 0); - if (menu == [NSApp mainMenu]) { // Skip Apple menu. - p_idx++; - } - ERR_FAIL_COND(p_idx >= [menu numberOfItems]); + int item_start = _get_system_menu_start(menu); + int item_count = _get_system_menu_count(menu); + p_idx += item_start; + ERR_FAIL_COND(p_idx >= item_start + item_count); NSMenuItem *menu_item = [menu itemAtIndex:p_idx]; if ([menu_item submenu] && _is_menu_opened([menu_item submenu])) { ERR_PRINT("Can't remove open menu!"); @@ -1885,12 +1907,41 @@ void DisplayServerMacOS::global_menu_clear(const String &p_menu_root) { ERR_PRINT("Can't remove open menu!"); return; } - [menu removeAllItems]; - // Restore Apple menu. + + if (menu == apple_menu) { + int start = _get_system_menu_start(apple_menu); + int count = _get_system_menu_count(apple_menu); + for (int i = start + count - 1; i >= start; i--) { + [apple_menu removeItemAtIndex:i]; + } + } else if (menu == window_menu) { + int start = _get_system_menu_start(window_menu); + int count = _get_system_menu_count(window_menu); + for (int i = start + count - 1; i >= start; i--) { + [window_menu removeItemAtIndex:i]; + } + } else if (menu == help_menu) { + int start = _get_system_menu_start(help_menu); + int count = _get_system_menu_count(help_menu); + for (int i = start + count - 1; i >= start; i--) { + [help_menu removeItemAtIndex:i]; + } + } else { + [menu removeAllItems]; + } + + // Restore Apple, Window and Help menu. if (menu == [NSApp mainMenu]) { NSMenuItem *menu_item = [menu addItemWithTitle:@"" action:nil keyEquivalent:@""]; [menu setSubmenu:apple_menu forItem:menu_item]; + + menu_item = [menu addItemWithTitle:@"Window" action:nil keyEquivalent:@""]; + [menu setSubmenu:window_menu forItem:menu_item]; + + menu_item = [menu addItemWithTitle:@"Help" action:nil keyEquivalent:@""]; + [menu setSubmenu:help_menu forItem:menu_item]; } + if (submenu.has(p_menu_root)) { submenu_inv.erase(submenu[p_menu_root].menu); submenu.erase(p_menu_root); @@ -1898,6 +1949,15 @@ void DisplayServerMacOS::global_menu_clear(const String &p_menu_root) { } } +Dictionary DisplayServerMacOS::global_menu_get_system_menu_roots() const { + Dictionary out; + out["_dock"] = "@Dock"; + out["_apple"] = "@Apple"; + out["_window"] = "Window"; + out["_help"] = "Help"; + return out; +} + bool DisplayServerMacOS::tts_is_speaking() const { ERR_FAIL_NULL_V_MSG(tts, false, "Enable the \"audio/general/text_to_speech\" project setting to use text-to-speech."); return [tts isSpeaking]; @@ -3563,6 +3623,9 @@ void DisplayServerMacOS::window_set_flag(WindowFlags p_flag, bool p_enabled, Win } break; case WINDOW_FLAG_NO_FOCUS: { wd.no_focus = p_enabled; + + NSWindow *w = wd.window_object; + w.excludedFromWindowsMenu = wd.is_popup || wd.no_focus; } break; case WINDOW_FLAG_MOUSE_PASSTHROUGH: { wd.mpass = p_enabled; @@ -3571,6 +3634,9 @@ void DisplayServerMacOS::window_set_flag(WindowFlags p_flag, bool p_enabled, Win ERR_FAIL_COND_MSG(p_window == MAIN_WINDOW_ID, "Main window can't be popup."); ERR_FAIL_COND_MSG([wd.window_object isVisible] && (wd.is_popup != p_enabled), "Popup flag can't changed while window is opened."); wd.is_popup = p_enabled; + + NSWindow *w = wd.window_object; + w.excludedFromWindowsMenu = wd.is_popup || wd.no_focus; } break; default: { } @@ -4487,6 +4553,13 @@ DisplayServerMacOS::DisplayServerMacOS(const String &p_rendering_driver, WindowM [apple_menu addItem:[NSMenuItem separatorItem]]; + menu_item = [apple_menu addItemWithTitle:@"_start_" action:nil keyEquivalent:@""]; + menu_item.hidden = YES; + menu_item.tag = MENU_TAG_START; + menu_item = [apple_menu addItemWithTitle:@"_end_" action:nil keyEquivalent:@""]; + menu_item.hidden = YES; + menu_item.tag = MENU_TAG_END; + NSMenu *services = [[NSMenu alloc] initWithTitle:@""]; menu_item = [apple_menu addItemWithTitle:NSLocalizedString(@"Services", nil) action:nil keyEquivalent:@""]; [apple_menu setSubmenu:services forItem:menu_item]; @@ -4507,10 +4580,41 @@ DisplayServerMacOS::DisplayServerMacOS(const String &p_rendering_driver, WindowM title = [NSString stringWithFormat:NSLocalizedString(@"Quit %@", nil), nsappname]; [apple_menu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"]; + window_menu = [[NSMenu alloc] initWithTitle:NSLocalizedString(@"Window", nil)]; + [window_menu addItemWithTitle:NSLocalizedString(@"Minimize", nil) action:@selector(performMiniaturize:) keyEquivalent:@"m"]; + [window_menu addItemWithTitle:NSLocalizedString(@"Zoom", nil) action:@selector(performZoom:) keyEquivalent:@""]; + [window_menu addItem:[NSMenuItem separatorItem]]; + [window_menu addItemWithTitle:NSLocalizedString(@"Bring All to Front", nil) action:@selector(bringAllToFront:) keyEquivalent:@""]; + [window_menu addItem:[NSMenuItem separatorItem]]; + menu_item = [window_menu addItemWithTitle:@"_start_" action:nil keyEquivalent:@""]; + menu_item.hidden = YES; + menu_item.tag = MENU_TAG_START; + menu_item = [window_menu addItemWithTitle:@"_end_" action:nil keyEquivalent:@""]; + menu_item.hidden = YES; + menu_item.tag = MENU_TAG_END; + + help_menu = [[NSMenu alloc] initWithTitle:NSLocalizedString(@"Help", nil)]; + menu_item = [help_menu addItemWithTitle:@"_start_" action:nil keyEquivalent:@""]; + menu_item.hidden = YES; + menu_item.tag = MENU_TAG_START; + menu_item = [help_menu addItemWithTitle:@"_end_" action:nil keyEquivalent:@""]; + menu_item.hidden = YES; + menu_item.tag = MENU_TAG_END; + + [NSApp setWindowsMenu:window_menu]; + [NSApp setHelpMenu:help_menu]; + // Add items to the menu bar. NSMenu *main_menu = [NSApp mainMenu]; menu_item = [main_menu addItemWithTitle:@"" action:nil keyEquivalent:@""]; [main_menu setSubmenu:apple_menu forItem:menu_item]; + + menu_item = [main_menu addItemWithTitle:NSLocalizedString(@"Window", nil) action:nil keyEquivalent:@""]; + [main_menu setSubmenu:window_menu forItem:menu_item]; + + menu_item = [main_menu addItemWithTitle:NSLocalizedString(@"Help", nil) action:nil keyEquivalent:@""]; + [main_menu setSubmenu:help_menu forItem:menu_item]; + [main_menu setAutoenablesItems:NO]; //!!!!!!!!!!!!!!!!!!!!!!!!!! diff --git a/platform/macos/export/export_plugin.cpp b/platform/macos/export/export_plugin.cpp index 24cb76b4ab..6f9db1427b 100644 --- a/platform/macos/export/export_plugin.cpp +++ b/platform/macos/export/export_plugin.cpp @@ -1266,10 +1266,16 @@ Error EditorExportPlatformMacOS::_export_debug_script(const Ref<EditorExportPres Error EditorExportPlatformMacOS::export_project(const Ref<EditorExportPreset> &p_preset, bool p_debug, const String &p_path, int p_flags) { ExportNotifier notifier(*this, p_preset, p_debug, p_path, p_flags); - String src_pkg_name; + const String base_dir = p_path.get_base_dir(); + + if (!DirAccess::exists(base_dir)) { + add_message(EXPORT_MESSAGE_ERROR, TTR("Export"), vformat(TTR("Target folder does not exist or is inaccessible: \"%s\""), base_dir)); + return ERR_FILE_BAD_PATH; + } EditorProgress ep("export", TTR("Exporting for macOS"), 3, true); + String src_pkg_name; if (p_debug) { src_pkg_name = p_preset->get("custom_template/debug"); } else { @@ -1280,16 +1286,11 @@ Error EditorExportPlatformMacOS::export_project(const Ref<EditorExportPreset> &p String err; src_pkg_name = find_export_template("macos.zip", &err); if (src_pkg_name.is_empty()) { - add_message(EXPORT_MESSAGE_ERROR, TTR("Prepare Templates"), TTR("Export template not found.")); + add_message(EXPORT_MESSAGE_ERROR, TTR("Prepare Templates"), TTR("Export template not found.") + "\n" + err); return ERR_FILE_NOT_FOUND; } } - if (!DirAccess::exists(p_path.get_base_dir())) { - add_message(EXPORT_MESSAGE_ERROR, TTR("Prepare Templates"), TTR("The given export path doesn't exist.")); - return ERR_FILE_BAD_PATH; - } - Ref<FileAccess> io_fa; zlib_filefunc_def io = zipio_create_io(&io_fa); @@ -2026,9 +2027,9 @@ Error EditorExportPlatformMacOS::export_project(const Ref<EditorExportPreset> &p bool EditorExportPlatformMacOS::has_valid_export_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates, bool p_debug) const { String err; - // Look for export templates (custom templates). - bool dvalid = false; - bool rvalid = false; + // Look for export templates (official templates first, then custom). + bool dvalid = exists_export_template("macos.zip", &err); + bool rvalid = dvalid; // Both in the same ZIP. if (p_preset->get("custom_template/debug") != "") { dvalid = FileAccess::exists(p_preset->get("custom_template/debug")); @@ -2043,12 +2044,6 @@ bool EditorExportPlatformMacOS::has_valid_export_configuration(const Ref<EditorE } } - // Look for export templates (official templates, check only is custom templates are not set). - if (!dvalid || !rvalid) { - dvalid = exists_export_template("macos.zip", &err); - rvalid = dvalid; // Both in the same ZIP. - } - bool valid = dvalid || rvalid; r_missing_templates = !valid; diff --git a/platform/macos/gl_manager_macos_angle.mm b/platform/macos/gl_manager_macos_angle.mm index ec0ca3e1f3..ac2f20ee7e 100644 --- a/platform/macos/gl_manager_macos_angle.mm +++ b/platform/macos/gl_manager_macos_angle.mm @@ -48,7 +48,7 @@ EGLenum GLManagerANGLE_MacOS::_get_platform_extension_enum() const { Vector<EGLAttrib> GLManagerANGLE_MacOS::_get_platform_display_attributes() const { Vector<EGLAttrib> ret; ret.push_back(EGL_PLATFORM_ANGLE_TYPE_ANGLE); - ret.push_back(EGL_PLATFORM_ANGLE_TYPE_METAL_ANGLE); + ret.push_back(EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE); ret.push_back(EGL_NONE); return ret; diff --git a/platform/web/detect.py b/platform/web/detect.py index b0044a80ff..579eaaff03 100644 --- a/platform/web/detect.py +++ b/platform/web/detect.py @@ -186,9 +186,18 @@ def configure(env: "Environment"): env["LIBPREFIXES"] = ["$LIBPREFIX"] env["LIBSUFFIXES"] = ["$LIBSUFFIX"] + # Get version info for checks below. + cc_version = get_compiler_version(env) + cc_semver = (cc_version["major"], cc_version["minor"], cc_version["patch"]) + env.Prepend(CPPPATH=["#platform/web"]) env.Append(CPPDEFINES=["WEB_ENABLED", "UNIX_ENABLED"]) + if cc_semver >= (3, 1, 25): + env.Append(LINKFLAGS=["-s", "STACK_SIZE=5MB"]) + else: + env.Append(LINKFLAGS=["-s", "TOTAL_STACK=5MB"]) + if env["opengl3"]: env.AppendUnique(CPPDEFINES=["GLES3_ENABLED"]) # This setting just makes WebGL 2 APIs available, it does NOT disable WebGL 1. @@ -203,13 +212,10 @@ def configure(env: "Environment"): env.Append(CPPDEFINES=["PTHREAD_NO_RENAME"]) env.Append(CCFLAGS=["-s", "USE_PTHREADS=1"]) env.Append(LINKFLAGS=["-s", "USE_PTHREADS=1"]) + env.Append(LINKFLAGS=["-s", "DEFAULT_PTHREAD_STACK_SIZE=2MB"]) env.Append(LINKFLAGS=["-s", "PTHREAD_POOL_SIZE=8"]) env.Append(LINKFLAGS=["-s", "WASM_MEM_MAX=2048MB"]) - # Get version info for checks below. - cc_version = get_compiler_version(env) - cc_semver = (cc_version["major"], cc_version["minor"], cc_version["patch"]) - if env["lto"] != "none": # Workaround https://github.com/emscripten-core/emscripten/issues/19781. if cc_semver >= (3, 1, 42) and cc_semver < (3, 1, 46): diff --git a/platform/web/display_server_web.cpp b/platform/web/display_server_web.cpp index 022e044185..b4a190d47e 100644 --- a/platform/web/display_server_web.cpp +++ b/platform/web/display_server_web.cpp @@ -174,6 +174,11 @@ void DisplayServerWeb::_key_callback(const String &p_key_event_code, const Strin // Resume audio context after input in case autoplay was denied. OS_Web::get_singleton()->resume_audio(); + DisplayServerWeb *ds = get_singleton(); + if (ds->ime_started) { + return; + } + char32_t c = 0x00; String unicode = p_key_event_key; if (unicode.length() == 1) { @@ -183,17 +188,21 @@ void DisplayServerWeb::_key_callback(const String &p_key_event_code, const Strin Key keycode = dom_code2godot_scancode(p_key_event_code.utf8().get_data(), p_key_event_key.utf8().get_data(), false); Key scancode = dom_code2godot_scancode(p_key_event_code.utf8().get_data(), p_key_event_key.utf8().get_data(), true); - Ref<InputEventKey> ev; - ev.instantiate(); - ev->set_echo(p_repeat); - ev->set_keycode(fix_keycode(c, keycode)); - ev->set_physical_keycode(scancode); - ev->set_key_label(fix_key_label(c, keycode)); - ev->set_unicode(fix_unicode(c)); - ev->set_pressed(p_pressed); - dom2godot_mod(ev, p_modifiers, fix_keycode(c, keycode)); + DisplayServerWeb::KeyEvent ke; - Input::get_singleton()->parse_input_event(ev); + ke.pressed = p_pressed; + ke.echo = p_repeat; + ke.raw = true; + ke.keycode = fix_keycode(c, keycode); + ke.physical_keycode = scancode; + ke.key_label = fix_key_label(c, keycode); + ke.unicode = fix_unicode(c); + ke.mod = p_modifiers; + + if (ds->key_event_pos >= ds->key_event_buffer.size()) { + ds->key_event_buffer.resize(1 + ds->key_event_pos); + } + ds->key_event_buffer.write[ds->key_event_pos++] = ke; // Make sure to flush all events so we can call restricted APIs inside the event. Input::get_singleton()->flush_buffered_events(); @@ -619,7 +628,7 @@ int DisplayServerWeb::mouse_wheel_callback(double p_delta_x, double p_delta_y) { } int DisplayServerWeb::_mouse_wheel_callback(double p_delta_x, double p_delta_y) { - if (!godot_js_display_canvas_is_focused()) { + if (!godot_js_display_canvas_is_focused() && !godot_js_is_ime_focused()) { if (get_singleton()->cursor_inside_canvas) { godot_js_display_canvas_focus(); } else { @@ -726,7 +735,7 @@ bool DisplayServerWeb::is_touchscreen_available() const { // Virtual Keyboard void DisplayServerWeb::vk_input_text_callback(const char *p_text, int p_cursor) { - String text = p_text; + String text = String::utf8(p_text); #ifdef PROXY_TO_PTHREAD_ENABLED if (!Thread::is_main_thread()) { @@ -809,6 +818,100 @@ void DisplayServerWeb::_gamepad_callback(int p_index, int p_connected, const Str } } +// IME. +void DisplayServerWeb::ime_callback(int p_type, const char *p_text) { + String text = String::utf8(p_text); + +#ifdef PROXY_TO_PTHREAD_ENABLED + if (!Thread::is_main_thread()) { + callable_mp_static(DisplayServerWeb::_ime_callback).bind(p_type, text).call_deferred(); + return; + } +#endif + + _ime_callback(p_type, text); +} + +void DisplayServerWeb::_ime_callback(int p_type, const String &p_text) { + DisplayServerWeb *ds = get_singleton(); + // Resume audio context after input in case autoplay was denied. + OS_Web::get_singleton()->resume_audio(); + + switch (p_type) { + case 0: { + // IME start. + ds->ime_text = String(); + ds->ime_selection = Vector2i(); + for (int i = ds->key_event_pos - 1; i >= 0; i--) { + // Delete last raw keydown event from query. + if (ds->key_event_buffer[i].pressed && ds->key_event_buffer[i].raw) { + ds->key_event_buffer.remove_at(i); + ds->key_event_pos--; + break; + } + } + OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_OS_IME_UPDATE); + ds->ime_started = true; + } break; + case 1: { + // IME update. + if (ds->ime_active && ds->ime_started) { + ds->ime_text = p_text; + ds->ime_selection = Vector2i(ds->ime_text.length(), ds->ime_text.length()); + OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_OS_IME_UPDATE); + } + } break; + case 2: { + // IME commit. + if (ds->ime_active && ds->ime_started) { + ds->ime_started = false; + + ds->ime_text = String(); + ds->ime_selection = Vector2i(); + OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_OS_IME_UPDATE); + + String text = p_text; + for (int i = 0; i < text.length(); i++) { + DisplayServerWeb::KeyEvent ke; + + ke.pressed = true; + ke.echo = false; + ke.raw = false; + ke.keycode = Key::NONE; + ke.physical_keycode = Key::NONE; + ke.key_label = Key::NONE; + ke.unicode = text[i]; + ke.mod = 0; + + if (ds->key_event_pos >= ds->key_event_buffer.size()) { + ds->key_event_buffer.resize(1 + ds->key_event_pos); + } + ds->key_event_buffer.write[ds->key_event_pos++] = ke; + } + } + } break; + default: + break; + } +} + +void DisplayServerWeb::window_set_ime_active(const bool p_active, WindowID p_window) { + ime_active = p_active; + godot_js_set_ime_active(p_active); +} + +void DisplayServerWeb::window_set_ime_position(const Point2i &p_pos, WindowID p_window) { + godot_js_set_ime_position(p_pos.x, p_pos.y); +} + +Point2i DisplayServerWeb::ime_get_selection() const { + return ime_selection; +} + +String DisplayServerWeb::ime_get_text() const { + return ime_text; +} + void DisplayServerWeb::process_joypads() { Input *input = Input::get_singleton(); int32_t pads = godot_js_input_gamepad_sample_count(); @@ -893,6 +996,9 @@ void DisplayServerWeb::_send_window_event_callback(int p_notification) { if (p_notification == DisplayServer::WINDOW_EVENT_MOUSE_ENTER || p_notification == DisplayServer::WINDOW_EVENT_MOUSE_EXIT) { ds->cursor_inside_canvas = p_notification == DisplayServer::WINDOW_EVENT_MOUSE_ENTER; } + if (godot_js_is_ime_focused() && (p_notification == DisplayServer::WINDOW_EVENT_FOCUS_IN || p_notification == DisplayServer::WINDOW_EVENT_FOCUS_OUT)) { + return; + } if (!ds->window_event_callback.is_null()) { Variant event = int(p_notification); ds->window_event_callback.call(event); @@ -1003,6 +1109,7 @@ DisplayServerWeb::DisplayServerWeb(const String &p_rendering_driver, WindowMode godot_js_input_paste_cb(&DisplayServerWeb::update_clipboard_callback); godot_js_input_drop_files_cb(&DisplayServerWeb::drop_files_js_callback); godot_js_input_gamepad_cb(&DisplayServerWeb::gamepad_callback); + godot_js_set_ime_cb(&DisplayServerWeb::ime_callback, &DisplayServerWeb::key_callback, key_event.code, key_event.key); // JS Display interface (js/libs/library_godot_display.js) godot_js_display_fullscreen_cb(&DisplayServerWeb::fullscreen_change_callback); @@ -1030,7 +1137,6 @@ bool DisplayServerWeb::has_feature(Feature p_feature) const { switch (p_feature) { //case FEATURE_GLOBAL_MENU: //case FEATURE_HIDPI: - //case FEATURE_IME: case FEATURE_ICON: case FEATURE_CLIPBOARD: case FEATURE_CURSOR_SHAPE: @@ -1044,6 +1150,9 @@ bool DisplayServerWeb::has_feature(Feature p_feature) const { //case FEATURE_WINDOW_TRANSPARENCY: //case FEATURE_KEEP_SCREEN_ON: //case FEATURE_ORIENTATION: + case FEATURE_IME: + // IME does not work with experimental VK support. + return godot_js_display_vk_available() == 0; case FEATURE_VIRTUAL_KEYBOARD: return godot_js_display_vk_available() != 0; case FEATURE_TEXT_TO_SPEECH: @@ -1263,6 +1372,24 @@ void DisplayServerWeb::process_events() { Input::get_singleton()->flush_buffered_events(); if (godot_js_input_gamepad_sample() == OK) { process_joypads(); + for (int i = 0; i < key_event_pos; i++) { + const DisplayServerWeb::KeyEvent &ke = key_event_buffer[i]; + + Ref<InputEventKey> ev; + ev.instantiate(); + ev->set_pressed(ke.pressed); + ev->set_echo(ke.echo); + ev->set_keycode(ke.keycode); + ev->set_physical_keycode(ke.physical_keycode); + ev->set_key_label(ke.key_label); + ev->set_unicode(ke.unicode); + if (ke.raw) { + dom2godot_mod(ev, ke.mod, ke.keycode); + } + + Input::get_singleton()->parse_input_event(ev); + } + key_event_pos = 0; } } diff --git a/platform/web/display_server_web.h b/platform/web/display_server_web.h index 51c6ab3c0a..140aef952b 100644 --- a/platform/web/display_server_web.h +++ b/platform/web/display_server_web.h @@ -82,6 +82,25 @@ private: uint64_t last_click_ms = 0; MouseButton last_click_button_index = MouseButton::NONE; + bool ime_active = false; + bool ime_started = false; + String ime_text; + Vector2i ime_selection; + + struct KeyEvent { + bool pressed = false; + bool echo = false; + bool raw = false; + Key keycode = Key::NONE; + Key physical_keycode = Key::NONE; + Key key_label = Key::NONE; + uint32_t unicode = 0; + int mod = 0; + }; + + Vector<KeyEvent> key_event_buffer; + int key_event_pos = 0; + bool swap_cancel_ok = false; bool tts = false; @@ -108,6 +127,8 @@ private: static void _gamepad_callback(int p_index, int p_connected, const String &p_id, const String &p_guid); WASM_EXPORT static void js_utterance_callback(int p_event, int p_id, int p_pos); static void _js_utterance_callback(int p_event, int p_id, int p_pos); + WASM_EXPORT static void ime_callback(int p_type, const char *p_text); + static void _ime_callback(int p_type, const String &p_text); WASM_EXPORT static void request_quit_callback(); static void _request_quit_callback(); WASM_EXPORT static void window_blur_callback(); @@ -162,6 +183,13 @@ public: virtual MouseMode mouse_get_mode() const override; virtual Point2i mouse_get_position() const override; + // ime + virtual void window_set_ime_active(const bool p_active, WindowID p_window = MAIN_WINDOW_ID) override; + virtual void window_set_ime_position(const Point2i &p_pos, WindowID p_window = MAIN_WINDOW_ID) override; + + virtual Point2i ime_get_selection() const override; + virtual String ime_get_text() const override; + // touch virtual bool is_touchscreen_available() const override; diff --git a/platform/web/export/export_plugin.cpp b/platform/web/export/export_plugin.cpp index a62ccdc2aa..a70812cf5b 100644 --- a/platform/web/export/export_plugin.cpp +++ b/platform/web/export/export_plugin.cpp @@ -259,6 +259,7 @@ Error EditorExportPlatformWeb::_build_pwa(const Ref<EditorExportPreset> &p_prese _replace_strings(replaces, sw); Error err = _write_or_error(sw.ptr(), sw.size(), dir.path_join(name + ".service.worker.js")); if (err != OK) { + // Message is supplied by the subroutine method. return err; } @@ -291,16 +292,19 @@ Error EditorExportPlatformWeb::_build_pwa(const Ref<EditorExportPreset> &p_prese const String icon144_path = p_preset->get("progressive_web_app/icon_144x144"); err = _add_manifest_icon(p_path, icon144_path, 144, icons_arr); if (err != OK) { + // Message is supplied by the subroutine method. return err; } const String icon180_path = p_preset->get("progressive_web_app/icon_180x180"); err = _add_manifest_icon(p_path, icon180_path, 180, icons_arr); if (err != OK) { + // Message is supplied by the subroutine method. return err; } const String icon512_path = p_preset->get("progressive_web_app/icon_512x512"); err = _add_manifest_icon(p_path, icon512_path, 512, icons_arr); if (err != OK) { + // Message is supplied by the subroutine method. return err; } manifest["icons"] = icons_arr; @@ -308,6 +312,7 @@ Error EditorExportPlatformWeb::_build_pwa(const Ref<EditorExportPreset> &p_prese CharString cs = Variant(manifest).to_json_string().utf8(); err = _write_or_error((const uint8_t *)cs.get_data(), cs.length(), dir.path_join(name + ".manifest.json")); if (err != OK) { + // Message is supplied by the subroutine method. return err; } @@ -439,6 +444,11 @@ Error EditorExportPlatformWeb::export_project(const Ref<EditorExportPreset> &p_p const String base_path = p_path.get_basename(); const String base_name = p_path.get_file().get_basename(); + if (!DirAccess::exists(base_dir)) { + add_message(EXPORT_MESSAGE_ERROR, TTR("Export"), vformat(TTR("Target folder does not exist or is inaccessible: \"%s\""), base_dir)); + return ERR_FILE_BAD_PATH; + } + // Find the correct template String template_path = p_debug ? custom_debug : custom_release; template_path = template_path.strip_edges(); @@ -447,10 +457,6 @@ Error EditorExportPlatformWeb::export_project(const Ref<EditorExportPreset> &p_p template_path = find_export_template(_get_template_name(extensions, p_debug)); } - if (!DirAccess::exists(base_dir)) { - return ERR_FILE_BAD_PATH; - } - if (!template_path.is_empty() && !FileAccess::exists(template_path)) { add_message(EXPORT_MESSAGE_ERROR, TTR("Prepare Templates"), vformat(TTR("Template file not found: \"%s\"."), template_path)); return ERR_FILE_NOT_FOUND; @@ -480,6 +486,7 @@ Error EditorExportPlatformWeb::export_project(const Ref<EditorExportPreset> &p_p // Extract templates. error = _extract_template(template_path, base_dir, base_name, pwa); if (error) { + // Message is supplied by the subroutine method. return error; } @@ -510,6 +517,7 @@ Error EditorExportPlatformWeb::export_project(const Ref<EditorExportPreset> &p_p _fix_html(html, p_preset, base_name, p_debug, p_flags, shared_objects, file_sizes); Error err = _write_or_error(html.ptr(), html.size(), p_path); if (err != OK) { + // Message is supplied by the subroutine method. return err; } html.resize(0); @@ -543,6 +551,7 @@ Error EditorExportPlatformWeb::export_project(const Ref<EditorExportPreset> &p_p if (pwa) { err = _build_pwa(p_preset, p_path, shared_objects); if (err != OK) { + // Message is supplied by the subroutine method. return err; } } diff --git a/platform/web/godot_js.h b/platform/web/godot_js.h index 031e67e486..a3d2632f17 100644 --- a/platform/web/godot_js.h +++ b/platform/web/godot_js.h @@ -64,6 +64,11 @@ extern void godot_js_input_touch_cb(void (*p_callback)(int p_type, int p_count), extern void godot_js_input_key_cb(void (*p_callback)(int p_type, int p_repeat, int p_modifiers), char r_code[32], char r_key[32]); extern void godot_js_input_vibrate_handheld(int p_duration_ms); +extern void godot_js_set_ime_active(int p_active); +extern void godot_js_set_ime_position(int p_x, int p_y); +extern void godot_js_set_ime_cb(void (*p_input)(int p_type, const char *p_text), void (*p_callback)(int p_type, int p_repeat, int p_modifiers), char r_code[32], char r_key[32]); +extern int godot_js_is_ime_focused(); + // Input gamepad extern void godot_js_input_gamepad_cb(void (*p_on_change)(int p_index, int p_connected, const char *p_id, const char *p_guid)); extern int godot_js_input_gamepad_sample(); diff --git a/platform/web/godot_webgl2.h b/platform/web/godot_webgl2.h index 3ade9e4239..2c9af4313f 100644 --- a/platform/web/godot_webgl2.h +++ b/platform/web/godot_webgl2.h @@ -44,9 +44,11 @@ extern "C" { #endif void godot_webgl2_glFramebufferTextureMultiviewOVR(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews); +void godot_webgl2_glFramebufferTextureMultisampleMultiviewOVR(GLenum target, GLenum attachment, GLuint texture, GLint level, GLsizei samples, GLint baseViewIndex, GLsizei numViews); void godot_webgl2_glGetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data); #define glFramebufferTextureMultiviewOVR godot_webgl2_glFramebufferTextureMultiviewOVR +#define glFramebufferTextureMultisampleMultiviewOVR godot_webgl2_glFramebufferTextureMultisampleMultiviewOVR #ifdef __cplusplus } diff --git a/platform/web/js/libs/library_godot_input.js b/platform/web/js/libs/library_godot_input.js index eaff40f89c..1292c468f5 100644 --- a/platform/web/js/libs/library_godot_input.js +++ b/platform/web/js/libs/library_godot_input.js @@ -29,6 +29,110 @@ /**************************************************************************/ /* + * IME API helper. + */ + +const GodotIME = { + $GodotIME__deps: ['$GodotRuntime', '$GodotEventListeners'], + $GodotIME__postset: 'GodotOS.atexit(function(resolve, reject) { GodotIME.clear(); resolve(); });', + $GodotIME: { + ime: null, + active: false, + + getModifiers: function (evt) { + return (evt.shiftKey + 0) + ((evt.altKey + 0) << 1) + ((evt.ctrlKey + 0) << 2) + ((evt.metaKey + 0) << 3); + }, + + ime_active: function (active) { + function focus_timer() { + GodotIME.active = true; + GodotIME.ime.focus(); + } + + if (GodotIME.ime) { + if (active) { + GodotIME.ime.style.display = 'block'; + setInterval(focus_timer, 100); + } else { + GodotIME.ime.style.display = 'none'; + GodotConfig.canvas.focus(); + GodotIME.active = false; + } + } + }, + + ime_position: function (x, y) { + if (GodotIME.ime) { + GodotIME.ime.style.left = `${x}px`; + GodotIME.ime.style.top = `${y}px`; + } + }, + + init: function (ime_cb, key_cb, code, key) { + function key_event_cb(pressed, evt) { + const modifiers = GodotIME.getModifiers(evt); + GodotRuntime.stringToHeap(evt.code, code, 32); + GodotRuntime.stringToHeap(evt.key, key, 32); + key_cb(pressed, evt.repeat, modifiers); + evt.preventDefault(); + } + function ime_event_cb(event) { + if (GodotIME.ime) { + if (event.type === 'compositionstart') { + ime_cb(0, null); + GodotIME.ime.innerHTML = ''; + } else if (event.type === 'compositionupdate') { + const ptr = GodotRuntime.allocString(event.data); + ime_cb(1, ptr); + GodotRuntime.free(ptr); + } else if (event.type === 'compositionend') { + const ptr = GodotRuntime.allocString(event.data); + ime_cb(2, ptr); + GodotRuntime.free(ptr); + GodotIME.ime.innerHTML = ''; + } + } + } + + const ime = document.createElement('div'); + ime.className = 'ime'; + ime.style.background = 'none'; + ime.style.opacity = 0.0; + ime.style.position = 'fixed'; + ime.style.left = '0px'; + ime.style.top = '0px'; + ime.style.width = '2px'; + ime.style.height = '2px'; + ime.style.display = 'none'; + ime.contentEditable = 'true'; + + GodotEventListeners.add(ime, 'compositionstart', ime_event_cb, false); + GodotEventListeners.add(ime, 'compositionupdate', ime_event_cb, false); + GodotEventListeners.add(ime, 'compositionend', ime_event_cb, false); + GodotEventListeners.add(ime, 'keydown', key_event_cb.bind(null, 1), false); + GodotEventListeners.add(ime, 'keyup', key_event_cb.bind(null, 0), false); + + ime.onblur = function () { + this.style.display = 'none'; + GodotConfig.canvas.focus(); + GodotIME.active = false; + }; + + GodotConfig.canvas.parentElement.appendChild(ime); + GodotIME.ime = ime; + }, + + clear: function () { + if (GodotIME.ime) { + GodotIME.ime.remove(); + GodotIME.ime = null; + } + }, + }, +}; +mergeInto(LibraryManager.library, GodotIME); + +/* * Gamepad API helper. */ const GodotInputGamepads = { @@ -338,7 +442,7 @@ mergeInto(LibraryManager.library, GodotInputDragDrop); * Godot exposed input functions. */ const GodotInput = { - $GodotInput__deps: ['$GodotRuntime', '$GodotConfig', '$GodotEventListeners', '$GodotInputGamepads', '$GodotInputDragDrop'], + $GodotInput__deps: ['$GodotRuntime', '$GodotConfig', '$GodotEventListeners', '$GodotInputGamepads', '$GodotInputDragDrop', '$GodotIME'], $GodotInput: { getModifiers: function (evt) { return (evt.shiftKey + 0) + ((evt.altKey + 0) << 1) + ((evt.ctrlKey + 0) << 2) + ((evt.metaKey + 0) << 3); @@ -462,6 +566,35 @@ const GodotInput = { }, /* + * IME API + */ + godot_js_set_ime_active__proxy: 'sync', + godot_js_set_ime_active__sig: 'vi', + godot_js_set_ime_active: function (p_active) { + GodotIME.ime_active(p_active); + }, + + godot_js_set_ime_position__proxy: 'sync', + godot_js_set_ime_position__sig: 'vii', + godot_js_set_ime_position: function (p_x, p_y) { + GodotIME.ime_position(p_x, p_y); + }, + + godot_js_set_ime_cb__proxy: 'sync', + godot_js_set_ime_cb__sig: 'viiii', + godot_js_set_ime_cb: function (p_ime_cb, p_key_cb, code, key) { + const ime_cb = GodotRuntime.get_func(p_ime_cb); + const key_cb = GodotRuntime.get_func(p_key_cb); + GodotIME.init(ime_cb, key_cb, code, key); + }, + + godot_js_is_ime_focused__proxy: 'sync', + godot_js_is_ime_focused__sig: 'i', + godot_js_is_ime_focused: function () { + return GodotIME.active; + }, + + /* * Gamepad API */ godot_js_input_gamepad_cb__proxy: 'sync', diff --git a/platform/web/js/libs/library_godot_webgl2.externs.js b/platform/web/js/libs/library_godot_webgl2.externs.js index 18d8d0815a..99190ab009 100644 --- a/platform/web/js/libs/library_godot_webgl2.externs.js +++ b/platform/web/js/libs/library_godot_webgl2.externs.js @@ -34,3 +34,19 @@ OVR_multiview2.prototype.FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR; * @return {void} */ OVR_multiview2.prototype.framebufferTextureMultiviewOVR = function(target, attachment, texture, level, baseViewIndex, numViews) {}; + +/** + * @constructor OCULUS_multiview + */ +function OCULUS_multiview() {} + +/** + * @param {number} target + * @param {number} attachment + * @param {WebGLTexture} texture + * @param {number} level + * @param {number} baseViewIndex + * @param {number} numViews + * @return {void} + */ +OCULUS_multiview.prototype.framebufferTextureMultisampleMultiviewOVR = function(target, attachment, texture, level, samples, baseViewIndex, numViews) {}; diff --git a/platform/web/js/libs/library_godot_webgl2.js b/platform/web/js/libs/library_godot_webgl2.js index dbaec9f01b..005b4b7917 100644 --- a/platform/web/js/libs/library_godot_webgl2.js +++ b/platform/web/js/libs/library_godot_webgl2.js @@ -61,6 +61,23 @@ const GodotWebGL2 = { const /** OVR_multiview2 */ ext = context.multiviewExt; ext.framebufferTextureMultiviewOVR(target, attachment, GL.textures[texture], level, base_view_index, num_views); }, + + godot_webgl2_glFramebufferTextureMultisampleMultiviewOVR__deps: ['emscripten_webgl_get_current_context'], + godot_webgl2_glFramebufferTextureMultisampleMultiviewOVR__proxy: 'sync', + godot_webgl2_glFramebufferTextureMultisampleMultiviewOVR__sig: 'viiiiiii', + godot_webgl2_glFramebufferTextureMultisampleMultiviewOVR: function (target, attachment, texture, level, samples, base_view_index, num_views) { + const context = GL.currentContext; + if (typeof context.oculusMultiviewExt === 'undefined') { + const /** OCULUS_multiview */ ext = context.GLctx.getExtension('OCULUS_multiview'); + if (!ext) { + GodotRuntime.error('Trying to call glFramebufferTextureMultisampleMultiviewOVR() without the OCULUS_multiview extension'); + return; + } + context.oculusMultiviewExt = ext; + } + const /** OCULUS_multiview */ ext = context.oculusMultiviewExt; + ext.framebufferTextureMultisampleMultiviewOVR(target, attachment, GL.textures[texture], level, samples, base_view_index, num_views); + }, }; autoAddDeps(GodotWebGL2, '$GodotWebGL2'); diff --git a/platform/windows/SCsub b/platform/windows/SCsub index 1b6908d2bb..0549e408a7 100644 --- a/platform/windows/SCsub +++ b/platform/windows/SCsub @@ -29,7 +29,9 @@ res_file = "godot_res.rc" res_target = "godot_res" + env["OBJSUFFIX"] res_obj = env.RES(res_target, res_file) -prog = env.add_program("#bin/godot", common_win + res_obj, PROGSUFFIX=env["PROGSUFFIX"]) +sources = common_win + res_obj + +prog = env.add_program("#bin/godot", sources, PROGSUFFIX=env["PROGSUFFIX"]) # Build console wrapper app. if env["windows_subsystem"] == "gui": @@ -58,6 +60,59 @@ if env["vsproj"]: for x in common_win_wrap: env.vs_srcs += ["platform/windows/" + str(x)] +if env["d3d12"]: + dxc_target_aliases = { + "x86_32": "x86", + "x86_64": "x64", + "arm32": "arm", + "arm64": "arm64", + } + dxc_arch_subdir = dxc_target_aliases[env["arch"]] + + agility_target_aliases = { + "x86_32": "win32", + "x86_64": "x64", + "arm32": "arm", + "arm64": "arm64", + } + agility_arch_subdir = agility_target_aliases[env["arch"]] + + # Used in cases where we can have multiple archs side-by-side. + arch_bin_dir = "#bin/" + env["arch"] + + # DXC + if env["dxc_path"] != "": + dxc_dll = "dxil.dll" + # Whether this one is loaded from arch-specific directory or not can be determined at runtime. + # Let's copy to both and let the user decide the distribution model. + for v in ["#bin", arch_bin_dir]: + env.Command( + v + "/" + dxc_dll, + env["dxc_path"] + "/bin/" + dxc_arch_subdir + "/" + dxc_dll, + Copy("$TARGET", "$SOURCE"), + ) + + # Agility SDK + if env["agility_sdk_path"] != "": + agility_dlls = ["D3D12Core.dll", "d3d12SDKLayers.dll"] + # Whether these are loaded from arch-specific directory or not has to be known at build time. + target_dir = arch_bin_dir if env["agility_sdk_multiarch"] else "#bin" + for dll in agility_dlls: + env.Command( + target_dir + "/" + dll, + env["agility_sdk_path"] + "/build/native/bin/" + agility_arch_subdir + "/" + dll, + Copy("$TARGET", "$SOURCE"), + ) + + # PIX + if env["pix_path"] != "": + pix_dll = "WinPixEventRuntime.dll" + env.Command( + "#bin/" + pix_dll, + env["pix_path"] + "/bin/" + dxc_arch_subdir + "/" + pix_dll, + Copy("$TARGET", "$SOURCE"), + ) + if not os.getenv("VCINSTALLDIR"): if env["debug_symbols"] and env["separate_debug_symbols"]: env.AddPostAction(prog, run_in_subprocess(platform_windows_builders.make_debug_mingw)) diff --git a/platform/windows/detect.py b/platform/windows/detect.py index bdacdbb9ba..4acdc8e639 100644 --- a/platform/windows/detect.py +++ b/platform/windows/detect.py @@ -187,6 +187,12 @@ def get_opts(): BoolVariable("debug_crt", "Compile with MSVC's debug CRT (/MDd)", False), BoolVariable("incremental_link", "Use MSVC incremental linking. May increase or decrease build times.", False), ("angle_libs", "Path to the ANGLE static libraries", ""), + # Direct3D 12 support. + ("mesa_libs", "Path to the MESA/NIR static libraries (required for D3D12)", ""), + ("dxc_path", "Path to the DirectX Shader Compiler distribution (required for D3D12)", ""), + ("agility_sdk_path", "Path to the Agility SDK distribution (optional for D3D12)", ""), + ("agility_sdk_multiarch", "Whether the Agility SDK DLLs will be stored in arch-specific subdirectories", False), + ("pix_path", "Path to the PIX runtime distribution (optional for D3D12)", ""), ] @@ -430,6 +436,34 @@ def configure_msvc(env, vcvars_msvc_config): if not env["use_volk"]: LIBS += ["vulkan"] + if env["d3d12"]: + if env["dxc_path"] == "": + print("The Direct3D 12 rendering driver requires dxc_path to be set.") + sys.exit(255) + + env.AppendUnique(CPPDEFINES=["D3D12_ENABLED"]) + LIBS += ["d3d12", "dxgi", "dxguid"] + LIBS += ["version"] # Mesa dependency. + + # Needed for avoiding C1128. + if env["target"] == "release_debug": + env.Append(CXXFLAGS=["/bigobj"]) + + arch_subdir = "arm64" if env["arch"] == "arm64" else "x64" + + # PIX + if env["pix_path"] != "": + env.Append(LIBPATH=[env["pix_path"] + "/bin/" + arch_subdir]) + LIBS += ["WinPixEventRuntime"] + + # Mesa + if env["mesa_libs"] == "": + print("The Direct3D 12 rendering driver requires mesa_libs to be set.") + sys.exit(255) + + env.Append(LIBPATH=[env["mesa_libs"] + "/bin"]) + LIBS += ["libNIR.windows." + env["arch"]] + if env["opengl3"]: env.AppendUnique(CPPDEFINES=["GLES3_ENABLED"]) if env["angle_libs"] != "": @@ -481,7 +515,7 @@ def configure_msvc(env, vcvars_msvc_config): env["BUILDERS"]["ProgramOriginal"] = env["BUILDERS"]["Program"] env["BUILDERS"]["Program"] = methods.precious_program - env.Append(LINKFLAGS=["/NATVIS:platform\windows\godot.natvis"]) + env.Append(LINKFLAGS=["/NATVIS:platform\\windows\\godot.natvis"]) env.AppendUnique(LINKFLAGS=["/STACK:" + str(STACK_SIZE)]) @@ -623,6 +657,26 @@ def configure_mingw(env): if not env["use_volk"]: env.Append(LIBS=["vulkan"]) + if env["d3d12"]: + env.AppendUnique(CPPDEFINES=["D3D12_ENABLED"]) + env.Append(LIBS=["d3d12", "dxgi", "dxguid"]) + env.Append(LIBS=["version"]) # Mesa dependency. + + arch_subdir = "arm64" if env["arch"] == "arm64" else "x64" + + # PIX + if env["pix_path"] != "": + print("PIX runtime is not supported with MinGW.") + sys.exit(255) + + # Mesa + if env["mesa_libs"] == "": + print("The Direct3D 12 rendering driver requires mesa_libs to be set.") + sys.exit(255) + + env.Append(LIBPATH=[env["mesa_libs"] + "/bin"]) + env.Append(LIBS=["libNIR.windows." + env["arch"]]) + if env["opengl3"]: env.Append(CPPDEFINES=["GLES3_ENABLED"]) if env["angle_libs"] != "": diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp index e8d81405f0..77dfff2e5d 100644 --- a/platform/windows/display_server_windows.cpp +++ b/platform/windows/display_server_windows.cpp @@ -1107,6 +1107,11 @@ void DisplayServerWindows::delete_sub_window(WindowID p_window) { context_vulkan->window_destroy(p_window); } #endif +#ifdef D3D12_ENABLED + if (context_d3d12) { + context_d3d12->window_destroy(p_window); + } +#endif #ifdef GLES3_ENABLED if (gl_manager_angle) { gl_manager_angle->window_destroy(p_window); @@ -1539,6 +1544,11 @@ void DisplayServerWindows::window_set_size(const Size2i p_size, WindowID p_windo context_vulkan->window_resize(p_window, w, h); } #endif +#if defined(D3D12_ENABLED) + if (context_d3d12) { + context_d3d12->window_resize(p_window, w, h); + } +#endif #if defined(GLES3_ENABLED) if (gl_manager_native) { gl_manager_native->window_resize(p_window, w, h); @@ -2590,6 +2600,12 @@ void DisplayServerWindows::window_set_vsync_mode(DisplayServer::VSyncMode p_vsyn } #endif +#if defined(D3D12_ENABLED) + if (context_d3d12) { + context_d3d12->set_vsync_mode(p_window, p_vsync_mode); + } +#endif + #if defined(GLES3_ENABLED) if (gl_manager_native) { gl_manager_native->set_use_vsync(p_window, p_vsync_mode != DisplayServer::VSYNC_DISABLED); @@ -2608,6 +2624,12 @@ DisplayServer::VSyncMode DisplayServerWindows::window_get_vsync_mode(WindowID p_ } #endif +#if defined(D3D12_ENABLED) + if (context_d3d12) { + return context_d3d12->get_vsync_mode(p_window); + } +#endif + #if defined(GLES3_ENABLED) if (gl_manager_native) { return gl_manager_native->is_using_vsync(p_window) ? DisplayServer::VSYNC_ENABLED : DisplayServer::VSYNC_DISABLED; @@ -2616,7 +2638,6 @@ DisplayServer::VSyncMode DisplayServerWindows::window_get_vsync_mode(WindowID p_ return gl_manager_angle->is_using_vsync() ? DisplayServer::VSYNC_ENABLED : DisplayServer::VSYNC_DISABLED; } #endif - return DisplayServer::VSYNC_ENABLED; } @@ -2958,9 +2979,7 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA } } break; case WM_MOUSEACTIVATE: { - if (windows[window_id].no_focus) { - return MA_NOACTIVATEANDEAT; // Do not activate, and discard mouse messages. - } else if (windows[window_id].is_popup) { + if (windows[window_id].no_focus || windows[window_id].is_popup) { return MA_NOACTIVATE; // Do not activate, but process mouse messages. } } break; @@ -3769,12 +3788,19 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA rect_changed = true; } + // Note: Trigger resize event to update swapchains when window is minimized/restored, even if size is not changed. + if (window_created && window.context_created) { #if defined(VULKAN_ENABLED) - if (context_vulkan && window.context_created) { - // Note: Trigger resize event to update swapchains when window is minimized/restored, even if size is not changed. - context_vulkan->window_resize(window_id, window.width, window.height); - } + if (context_vulkan) { + context_vulkan->window_resize(window_id, window.width, window.height); + } +#endif +#if defined(D3D12_ENABLED) + if (context_d3d12) { + context_d3d12->window_resize(window_id, window.width, window.height); + } #endif + } } if (!window.minimized && (!(window_pos_params->flags & SWP_NOMOVE) || window_pos_params->flags & SWP_FRAMECHANGED)) { @@ -4338,6 +4364,18 @@ DisplayServer::WindowID DisplayServerWindows::_create_window(WindowMode p_mode, } #endif +#ifdef D3D12_ENABLED + if (context_d3d12) { + if (context_d3d12->window_create(id, p_vsync_mode, wd.hWnd, hInstance, WindowRect.right - WindowRect.left, WindowRect.bottom - WindowRect.top) != OK) { + memdelete(context_d3d12); + context_d3d12 = nullptr; + windows.erase(id); + ERR_FAIL_V_MSG(INVALID_WINDOW_ID, "Failed to create D3D12 Window."); + } + wd.context_created = true; + } +#endif + #ifdef GLES3_ENABLED if (gl_manager_native) { if (gl_manager_native->window_create(id, wd.hWnd, hInstance, WindowRect.right - WindowRect.left, WindowRect.bottom - WindowRect.top) != OK) { @@ -4646,9 +4684,26 @@ DisplayServerWindows::DisplayServerWindows(const String &p_rendering_driver, Win } } #endif +#if defined(D3D12_ENABLED) + if (rendering_driver == "d3d12") { + context_d3d12 = memnew(D3D12Context); + if (context_d3d12->initialize() != OK) { + memdelete(context_d3d12); + context_d3d12 = nullptr; + r_error = ERR_UNAVAILABLE; + return; + } + } +#endif // Init context and rendering device #if defined(GLES3_ENABLED) +#if defined(__arm__) || defined(__aarch64__) || defined(_M_ARM) || defined(_M_ARM64) + // There's no native OpenGL drivers on Windows for ARM, switch to ANGLE over DX. + if (rendering_driver == "opengl3") { + rendering_driver = "opengl3_angle"; + } +#else bool fallback = GLOBAL_GET("rendering/gl_compatibility/fallback_to_angle"); if (fallback && (rendering_driver == "opengl3")) { Dictionary gl_info = detect_wgl(); @@ -4669,6 +4724,7 @@ DisplayServerWindows::DisplayServerWindows(const String &p_rendering_driver, Win rendering_driver = "opengl3_angle"; } } +#endif if (rendering_driver == "opengl3") { gl_manager_native = memnew(GLManagerNative_Windows); @@ -4722,7 +4778,6 @@ DisplayServerWindows::DisplayServerWindows(const String &p_rendering_driver, Win show_window(MAIN_WINDOW_ID); #if defined(VULKAN_ENABLED) - if (rendering_driver == "vulkan") { rendering_device_vulkan = memnew(RenderingDeviceVulkan); rendering_device_vulkan->initialize(context_vulkan); @@ -4730,6 +4785,14 @@ DisplayServerWindows::DisplayServerWindows(const String &p_rendering_driver, Win RendererCompositorRD::make_current(); } #endif +#if defined(D3D12_ENABLED) + if (rendering_driver == "d3d12") { + rendering_device_d3d12 = memnew(RenderingDeviceD3D12); + rendering_device_d3d12->initialize(context_d3d12); + + RendererCompositorRD::make_current(); + } +#endif if (!Engine::get_singleton()->is_editor_hint() && !OS::get_singleton()->is_in_low_processor_usage_mode()) { // Increase priority for projects that are not in low-processor mode (typically games) @@ -4764,6 +4827,9 @@ Vector<String> DisplayServerWindows::get_rendering_drivers_func() { #ifdef VULKAN_ENABLED drivers.push_back("vulkan"); #endif +#ifdef D3D12_ENABLED + drivers.push_back("d3d12"); +#endif #ifdef GLES3_ENABLED drivers.push_back("opengl3"); drivers.push_back("opengl3_angle"); @@ -4828,6 +4894,11 @@ DisplayServerWindows::~DisplayServerWindows() { context_vulkan->window_destroy(MAIN_WINDOW_ID); } #endif +#ifdef D3D12_ENABLED + if (context_d3d12) { + context_d3d12->window_destroy(MAIN_WINDOW_ID); + } +#endif if (wintab_available && windows[MAIN_WINDOW_ID].wtctx) { wintab_WTClose(windows[MAIN_WINDOW_ID].wtctx); windows[MAIN_WINDOW_ID].wtctx = 0; @@ -4848,6 +4919,19 @@ DisplayServerWindows::~DisplayServerWindows() { } #endif +#if defined(D3D12_ENABLED) + if (rendering_device_d3d12) { + rendering_device_d3d12->finalize(); + memdelete(rendering_device_d3d12); + rendering_device_d3d12 = nullptr; + } + + if (context_d3d12) { + memdelete(context_d3d12); + context_d3d12 = nullptr; + } +#endif + if (restore_mouse_trails > 1) { SystemParametersInfoA(SPI_SETMOUSETRAILS, restore_mouse_trails, 0, 0); } diff --git a/platform/windows/display_server_windows.h b/platform/windows/display_server_windows.h index 48c8c20280..1e61462e95 100644 --- a/platform/windows/display_server_windows.h +++ b/platform/windows/display_server_windows.h @@ -58,6 +58,10 @@ #include "drivers/vulkan/rendering_device_vulkan.h" #endif +#if defined(D3D12_ENABLED) +#include "drivers/d3d12/rendering_device_d3d12.h" +#endif + #if defined(GLES3_ENABLED) #include "gl_manager_windows_angle.h" #include "gl_manager_windows_native.h" @@ -347,6 +351,11 @@ class DisplayServerWindows : public DisplayServer { RenderingDeviceVulkan *rendering_device_vulkan = nullptr; #endif +#if defined(D3D12_ENABLED) + D3D12Context *context_d3d12 = nullptr; + RenderingDeviceD3D12 *rendering_device_d3d12 = nullptr; +#endif + RBMap<int, Vector2> touch_state; int pressrc; diff --git a/platform/windows/export/export_plugin.cpp b/platform/windows/export/export_plugin.cpp index 4185c36d77..418f38c127 100644 --- a/platform/windows/export/export_plugin.cpp +++ b/platform/windows/export/export_plugin.cpp @@ -226,6 +226,7 @@ Error EditorExportPlatformWindows::export_project(const Ref<EditorExportPreset> Ref<DirAccess> tmp_app_dir = DirAccess::create_for_path(tmp_dir_path); if (export_as_zip) { if (tmp_app_dir.is_null()) { + add_message(EXPORT_MESSAGE_ERROR, TTR("Prepare Templates"), vformat(TTR("Could not create and open the directory: \"%s\""), tmp_dir_path)); return ERR_CANT_CREATE; } if (DirAccess::exists(tmp_dir_path)) { @@ -242,8 +243,14 @@ Error EditorExportPlatformWindows::export_project(const Ref<EditorExportPreset> if (embedded) { pck_path = pck_path.get_basename() + ".tmp"; } + Error err = EditorExportPlatformPC::export_project(p_preset, p_debug, pck_path, p_flags); - if (p_preset->get("codesign/enable") && err == OK) { + if (err != OK) { + // Message is supplied by the subroutine method. + return err; + } + + if (p_preset->get("codesign/enable")) { _code_sign(p_preset, pck_path); String wrapper_path = p_path.get_basename() + ".console.exe"; if (FileAccess::exists(wrapper_path)) { @@ -251,7 +258,7 @@ Error EditorExportPlatformWindows::export_project(const Ref<EditorExportPreset> } } - if (embedded && err == OK) { + if (embedded) { Ref<DirAccess> tmp_dir = DirAccess::create_for_path(p_path.get_base_dir()); err = tmp_dir->rename(pck_path, p_path); if (err != OK) { diff --git a/platform/windows/gl_manager_windows_native.cpp b/platform/windows/gl_manager_windows_native.cpp index b350786d11..8af32395b7 100644 --- a/platform/windows/gl_manager_windows_native.cpp +++ b/platform/windows/gl_manager_windows_native.cpp @@ -104,8 +104,8 @@ static bool nvapi_err_check(const char *msg, int status) { } // On windows we have to disable threaded optimization when using NVIDIA graphics cards -// to avoid stuttering, see https://github.com/microsoft/vscode-cpptools/issues/6592 -// also see https://github.com/Ryujinx/Ryujinx/blob/master/Ryujinx.Common/GraphicsDriver/NVThreadedOptimization.cs +// to avoid stuttering, see https://stackoverflow.com/questions/36959508/nvidia-graphics-driver-causing-noticeable-frame-stuttering/37632948 +// also see https://github.com/Ryujinx/Ryujinx/blob/master/src/Ryujinx.Common/GraphicsDriver/NVThreadedOptimization.cs void GLManagerNative_Windows::_nvapi_disable_threaded_optimization() { HMODULE nvapi = 0; #ifdef _WIN64 @@ -149,6 +149,10 @@ void GLManagerNative_Windows::_nvapi_disable_threaded_optimization() { NvDRSSessionHandle session_handle; + if (NvAPI_DRS_CreateSession == nullptr) { + return; + } + if (!nvapi_err_check("NVAPI: Error creating DRS session", NvAPI_DRS_CreateSession(&session_handle))) { NvAPI_Unload(); return; diff --git a/platform/windows/os_windows.h b/platform/windows/os_windows.h index e873fb8a13..02f062f2de 100644 --- a/platform/windows/os_windows.h +++ b/platform/windows/os_windows.h @@ -52,6 +52,10 @@ #include "drivers/vulkan/rendering_device_vulkan.h" #endif +#if defined(D3D12_ENABLED) +#include "drivers/d3d12/rendering_device_d3d12.h" +#endif + #include <io.h> #include <shellapi.h> #include <stdio.h> diff --git a/scene/2d/animated_sprite_2d.cpp b/scene/2d/animated_sprite_2d.cpp index bf3783966b..08b315fa6c 100644 --- a/scene/2d/animated_sprite_2d.cpp +++ b/scene/2d/animated_sprite_2d.cpp @@ -381,6 +381,10 @@ float AnimatedSprite2D::get_playing_speed() const { } void AnimatedSprite2D::set_centered(bool p_center) { + if (centered == p_center) { + return; + } + centered = p_center; queue_redraw(); item_rect_changed(); @@ -391,6 +395,10 @@ bool AnimatedSprite2D::is_centered() const { } void AnimatedSprite2D::set_offset(const Point2 &p_offset) { + if (offset == p_offset) { + return; + } + offset = p_offset; queue_redraw(); item_rect_changed(); @@ -401,6 +409,10 @@ Point2 AnimatedSprite2D::get_offset() const { } void AnimatedSprite2D::set_flip_h(bool p_flip) { + if (hflip == p_flip) { + return; + } + hflip = p_flip; queue_redraw(); } @@ -410,6 +422,10 @@ bool AnimatedSprite2D::is_flipped_h() const { } void AnimatedSprite2D::set_flip_v(bool p_flip) { + if (vflip == p_flip) { + return; + } + vflip = p_flip; queue_redraw(); } diff --git a/scene/2d/area_2d.cpp b/scene/2d/area_2d.cpp index 3aa2a71a2c..b1ff94dda4 100644 --- a/scene/2d/area_2d.cpp +++ b/scene/2d/area_2d.cpp @@ -166,6 +166,21 @@ void Area2D::_body_inout(int p_status, const RID &p_body, ObjectID p_instance, i bool body_in = p_status == PhysicsServer2D::AREA_BODY_ADDED; ObjectID objid = p_instance; + // Exit early if instance is invalid. + if (objid.is_null()) { + // Emit the appropriate signals. + lock_callback(); + locked = true; + if (body_in) { + emit_signal(SceneStringNames::get_singleton()->body_shape_entered, p_body, (Node *)nullptr, p_body_shape, p_area_shape); + } else { + emit_signal(SceneStringNames::get_singleton()->body_shape_exited, p_body, (Node *)nullptr, p_body_shape, p_area_shape); + } + locked = false; + unlock_callback(); + return; + } + Object *obj = ObjectDB::get_instance(objid); Node *node = Object::cast_to<Node>(obj); @@ -262,6 +277,21 @@ void Area2D::_area_inout(int p_status, const RID &p_area, ObjectID p_instance, i bool area_in = p_status == PhysicsServer2D::AREA_BODY_ADDED; ObjectID objid = p_instance; + // Exit early if instance is invalid. + if (objid.is_null()) { + // Emit the appropriate signals. + lock_callback(); + locked = true; + if (area_in) { + emit_signal(SceneStringNames::get_singleton()->area_shape_entered, p_area, (Node *)nullptr, p_area_shape, p_self_shape); + } else { + emit_signal(SceneStringNames::get_singleton()->area_shape_exited, p_area, (Node *)nullptr, p_area_shape, p_self_shape); + } + locked = false; + unlock_callback(); + return; + } + Object *obj = ObjectDB::get_instance(objid); Node *node = Object::cast_to<Node>(obj); @@ -384,11 +414,9 @@ void Area2D::_clear_monitoring() { } } -void Area2D::_notification(int p_what) { - switch (p_what) { - case NOTIFICATION_EXIT_TREE: { - _clear_monitoring(); - } break; +void Area2D::_space_changed(const RID &p_new_space) { + if (p_new_space.is_null()) { + _clear_monitoring(); } } diff --git a/scene/2d/area_2d.h b/scene/2d/area_2d.h index 421c29f758..9d6e04b706 100644 --- a/scene/2d/area_2d.h +++ b/scene/2d/area_2d.h @@ -133,10 +133,11 @@ private: StringName audio_bus; protected: - void _notification(int p_what); static void _bind_methods(); void _validate_property(PropertyInfo &p_property) const; + virtual void _space_changed(const RID &p_new_space) override; + public: void set_gravity_space_override_mode(SpaceOverride p_mode); SpaceOverride get_gravity_space_override_mode() const; diff --git a/scene/2d/collision_object_2d.cpp b/scene/2d/collision_object_2d.cpp index ab42c52913..2fbe4eb409 100644 --- a/scene/2d/collision_object_2d.cpp +++ b/scene/2d/collision_object_2d.cpp @@ -59,6 +59,7 @@ void CollisionObject2D::_notification(int p_what) { } else { PhysicsServer2D::get_singleton()->body_set_space(rid, space); } + _space_changed(space); } _update_pickable(); @@ -102,6 +103,7 @@ void CollisionObject2D::_notification(int p_what) { } else { PhysicsServer2D::get_singleton()->body_set_space(rid, RID()); } + _space_changed(RID()); } } @@ -125,6 +127,7 @@ void CollisionObject2D::_notification(int p_what) { } else { PhysicsServer2D::get_singleton()->body_set_space(rid, space); } + _space_changed(space); } break; case NOTIFICATION_DISABLED: { @@ -246,6 +249,7 @@ void CollisionObject2D::_apply_disabled() { } else { PhysicsServer2D::get_singleton()->body_set_space(rid, RID()); } + _space_changed(RID()); } } } break; @@ -272,6 +276,7 @@ void CollisionObject2D::_apply_enabled() { } else { PhysicsServer2D::get_singleton()->body_set_space(rid, space); } + _space_changed(space); } } break; @@ -569,6 +574,9 @@ void CollisionObject2D::set_body_mode(PhysicsServer2D::BodyMode p_mode) { PhysicsServer2D::get_singleton()->body_set_mode(rid, p_mode); } +void CollisionObject2D::_space_changed(const RID &p_new_space) { +} + void CollisionObject2D::_update_pickable() { if (!is_inside_tree()) { return; diff --git a/scene/2d/collision_object_2d.h b/scene/2d/collision_object_2d.h index 88429b145d..780793f289 100644 --- a/scene/2d/collision_object_2d.h +++ b/scene/2d/collision_object_2d.h @@ -109,6 +109,8 @@ protected: void set_body_mode(PhysicsServer2D::BodyMode p_mode); + virtual void _space_changed(const RID &p_new_space); + GDVIRTUAL3(_input_event, Viewport *, Ref<InputEvent>, int) GDVIRTUAL0(_mouse_enter) GDVIRTUAL0(_mouse_exit) diff --git a/scene/2d/navigation_agent_2d.cpp b/scene/2d/navigation_agent_2d.cpp index 1b3b0bcef0..dbbba315d4 100644 --- a/scene/2d/navigation_agent_2d.cpp +++ b/scene/2d/navigation_agent_2d.cpp @@ -274,7 +274,6 @@ void NavigationAgent2D::_notification(int p_what) { NavigationServer2D::get_singleton()->agent_set_velocity_forced(agent, velocity_forced); } } - _check_distance_to_target(); } #ifdef DEBUG_ENABLED if (debug_path_dirty) { @@ -294,6 +293,13 @@ NavigationAgent2D::NavigationAgent2D() { NavigationServer2D::get_singleton()->agent_set_time_horizon_obstacles(agent, time_horizon_obstacles); NavigationServer2D::get_singleton()->agent_set_radius(agent, radius); NavigationServer2D::get_singleton()->agent_set_max_speed(agent, max_speed); + NavigationServer2D::get_singleton()->agent_set_avoidance_layers(agent, avoidance_layers); + NavigationServer2D::get_singleton()->agent_set_avoidance_mask(agent, avoidance_mask); + NavigationServer2D::get_singleton()->agent_set_avoidance_priority(agent, avoidance_priority); + NavigationServer2D::get_singleton()->agent_set_avoidance_enabled(agent, avoidance_enabled); + if (avoidance_enabled) { + NavigationServer2D::get_singleton()->agent_set_avoidance_callback(agent, callable_mp(this, &NavigationAgent2D::_avoidance_done)); + } // Preallocate query and result objects to improve performance. navigation_query = Ref<NavigationPathQueryParameters2D>(); @@ -302,11 +308,6 @@ NavigationAgent2D::NavigationAgent2D() { navigation_result = Ref<NavigationPathQueryResult2D>(); navigation_result.instantiate(); - set_avoidance_layers(avoidance_layers); - set_avoidance_mask(avoidance_mask); - set_avoidance_priority(avoidance_priority); - set_avoidance_enabled(avoidance_enabled); - #ifdef DEBUG_ENABLED NavigationServer2D::get_singleton()->connect(SNAME("navigation_debug_changed"), callable_mp(this, &NavigationAgent2D::_navigation_debug_changed)); #endif // DEBUG_ENABLED @@ -556,7 +557,7 @@ Vector2 NavigationAgent2D::get_target_position() const { } Vector2 NavigationAgent2D::get_next_path_position() { - update_navigation(); + _update_navigation(); const Vector<Vector2> &navigation_path = navigation_result->get_path(); if (navigation_path.size() == 0) { @@ -577,17 +578,25 @@ bool NavigationAgent2D::is_target_reached() const { } bool NavigationAgent2D::is_target_reachable() { - return target_desired_distance >= get_final_position().distance_to(target_position); + _update_navigation(); + return _is_target_reachable(); +} + +bool NavigationAgent2D::_is_target_reachable() const { + return target_desired_distance >= _get_final_position().distance_to(target_position); } bool NavigationAgent2D::is_navigation_finished() { - update_navigation(); + _update_navigation(); return navigation_finished; } Vector2 NavigationAgent2D::get_final_position() { - update_navigation(); + _update_navigation(); + return _get_final_position(); +} +Vector2 NavigationAgent2D::_get_final_position() const { const Vector<Vector2> &navigation_path = navigation_result->get_path(); if (navigation_path.size() == 0) { return Vector2(); @@ -625,7 +634,7 @@ PackedStringArray NavigationAgent2D::get_configuration_warnings() const { return warnings; } -void NavigationAgent2D::update_navigation() { +void NavigationAgent2D::_update_navigation() { if (agent_parent == nullptr) { return; } @@ -679,6 +688,7 @@ void NavigationAgent2D::update_navigation() { debug_path_dirty = true; #endif // DEBUG_ENABLED navigation_finished = false; + last_waypoint_reached = false; navigation_path_index = 0; emit_signal(SNAME("path_changed")); } @@ -687,102 +697,145 @@ void NavigationAgent2D::update_navigation() { return; } - // Check if we can advance the navigation path - if (navigation_finished == false) { - // Advances to the next far away position. - const Vector<Vector2> &navigation_path = navigation_result->get_path(); - const Vector<int32_t> &navigation_path_types = navigation_result->get_path_types(); - const TypedArray<RID> &navigation_path_rids = navigation_result->get_path_rids(); - const Vector<int64_t> &navigation_path_owners = navigation_result->get_path_owner_ids(); + // Check if the navigation has already finished. + if (navigation_finished) { + return; + } - while (origin.distance_to(navigation_path[navigation_path_index]) < path_desired_distance) { - Dictionary details; + // Check if we reached the target. + if (_is_within_target_distance(origin)) { + // Emit waypoint_reached in case we also moved within distance of a waypoint. + _advance_waypoints(origin); + _transition_to_target_reached(); + _transition_to_navigation_finished(); + } else { + // Advance waypoints if possible. + _advance_waypoints(origin); + // Keep navigation running even after reaching the last waypoint if the target is reachable. + if (last_waypoint_reached && !_is_target_reachable()) { + _transition_to_navigation_finished(); + } + } +} - const Vector2 waypoint = navigation_path[navigation_path_index]; - details[SNAME("position")] = waypoint; +void NavigationAgent2D::_advance_waypoints(const Vector2 &p_origin) { + if (last_waypoint_reached) { + return; + } - int waypoint_type = -1; - if (path_metadata_flags.has_flag(NavigationPathQueryParameters2D::PathMetadataFlags::PATH_METADATA_INCLUDE_TYPES)) { - const NavigationPathQueryResult2D::PathSegmentType type = NavigationPathQueryResult2D::PathSegmentType(navigation_path_types[navigation_path_index]); + // Advance to the farthest possible waypoint. + while (_is_within_waypoint_distance(p_origin)) { + _trigger_waypoint_reached(); - details[SNAME("type")] = type; - waypoint_type = type; - } + if (_is_last_waypoint()) { + last_waypoint_reached = true; + break; + } - if (path_metadata_flags.has_flag(NavigationPathQueryParameters2D::PathMetadataFlags::PATH_METADATA_INCLUDE_RIDS)) { - details[SNAME("rid")] = navigation_path_rids[navigation_path_index]; - } + _move_to_next_waypoint(); + } +} - if (path_metadata_flags.has_flag(NavigationPathQueryParameters2D::PathMetadataFlags::PATH_METADATA_INCLUDE_OWNERS)) { - const ObjectID waypoint_owner_id = ObjectID(navigation_path_owners[navigation_path_index]); +void NavigationAgent2D::_request_repath() { + navigation_result->reset(); + target_reached = false; + navigation_finished = false; + last_waypoint_reached = false; + update_frame_id = 0; +} - // Get a reference to the owning object. - Object *owner = nullptr; - if (waypoint_owner_id.is_valid()) { - owner = ObjectDB::get_instance(waypoint_owner_id); - } +bool NavigationAgent2D::_is_last_waypoint() const { + return navigation_path_index == navigation_result->get_path().size() - 1; +} - details[SNAME("owner")] = owner; - - if (waypoint_type == NavigationPathQueryResult2D::PATH_SEGMENT_TYPE_LINK) { - const NavigationLink2D *navlink = Object::cast_to<NavigationLink2D>(owner); - if (navlink) { - Vector2 link_global_start_position = navlink->get_global_start_position(); - Vector2 link_global_end_position = navlink->get_global_end_position(); - if (waypoint.distance_to(link_global_start_position) < waypoint.distance_to(link_global_end_position)) { - details[SNAME("link_entry_position")] = link_global_start_position; - details[SNAME("link_exit_position")] = link_global_end_position; - } else { - details[SNAME("link_entry_position")] = link_global_end_position; - details[SNAME("link_exit_position")] = link_global_start_position; - } - } - } - } +void NavigationAgent2D::_move_to_next_waypoint() { + navigation_path_index += 1; +} - // Emit a signal for the waypoint - emit_signal(SNAME("waypoint_reached"), details); +bool NavigationAgent2D::_is_within_waypoint_distance(const Vector2 &p_origin) const { + const Vector<Vector2> &navigation_path = navigation_result->get_path(); + return p_origin.distance_to(navigation_path[navigation_path_index]) < path_desired_distance; +} - // Emit a signal if we've reached a navigation link - if (waypoint_type == NavigationPathQueryResult2D::PATH_SEGMENT_TYPE_LINK) { - emit_signal(SNAME("link_reached"), details); - } +bool NavigationAgent2D::_is_within_target_distance(const Vector2 &p_origin) const { + return p_origin.distance_to(target_position) < target_desired_distance; +} + +void NavigationAgent2D::_trigger_waypoint_reached() { + const Vector<Vector2> &navigation_path = navigation_result->get_path(); + const Vector<int32_t> &navigation_path_types = navigation_result->get_path_types(); + const TypedArray<RID> &navigation_path_rids = navigation_result->get_path_rids(); + const Vector<int64_t> &navigation_path_owners = navigation_result->get_path_owner_ids(); + + Dictionary details; - // Move to the next waypoint on the list - navigation_path_index += 1; - - // Check to see if we've finished our route - if (navigation_path_index == navigation_path.size()) { - _check_distance_to_target(); - navigation_path_index -= 1; - navigation_finished = true; - target_position_submitted = false; - if (avoidance_enabled) { - NavigationServer2D::get_singleton()->agent_set_position(agent, agent_parent->get_global_position()); - NavigationServer2D::get_singleton()->agent_set_velocity(agent, Vector2(0.0, 0.0)); - NavigationServer2D::get_singleton()->agent_set_velocity_forced(agent, Vector2(0.0, 0.0)); + const Vector2 waypoint = navigation_path[navigation_path_index]; + details[SNAME("position")] = waypoint; + + int waypoint_type = -1; + if (path_metadata_flags.has_flag(NavigationPathQueryParameters2D::PathMetadataFlags::PATH_METADATA_INCLUDE_TYPES)) { + const NavigationPathQueryResult2D::PathSegmentType type = NavigationPathQueryResult2D::PathSegmentType(navigation_path_types[navigation_path_index]); + + details[SNAME("type")] = type; + waypoint_type = type; + } + + if (path_metadata_flags.has_flag(NavigationPathQueryParameters2D::PathMetadataFlags::PATH_METADATA_INCLUDE_RIDS)) { + details[SNAME("rid")] = navigation_path_rids[navigation_path_index]; + } + + if (path_metadata_flags.has_flag(NavigationPathQueryParameters2D::PathMetadataFlags::PATH_METADATA_INCLUDE_OWNERS)) { + const ObjectID waypoint_owner_id = ObjectID(navigation_path_owners[navigation_path_index]); + + // Get a reference to the owning object. + Object *owner = nullptr; + if (waypoint_owner_id.is_valid()) { + owner = ObjectDB::get_instance(waypoint_owner_id); + } + + details[SNAME("owner")] = owner; + + if (waypoint_type == NavigationPathQueryResult2D::PATH_SEGMENT_TYPE_LINK) { + const NavigationLink2D *navlink = Object::cast_to<NavigationLink2D>(owner); + if (navlink) { + Vector2 link_global_start_position = navlink->get_global_start_position(); + Vector2 link_global_end_position = navlink->get_global_end_position(); + if (waypoint.distance_to(link_global_start_position) < waypoint.distance_to(link_global_end_position)) { + details[SNAME("link_entry_position")] = link_global_start_position; + details[SNAME("link_exit_position")] = link_global_end_position; + } else { + details[SNAME("link_entry_position")] = link_global_end_position; + details[SNAME("link_exit_position")] = link_global_start_position; } - emit_signal(SNAME("navigation_finished")); - break; } } } -} -void NavigationAgent2D::_request_repath() { - navigation_result->reset(); - target_reached = false; - navigation_finished = false; - update_frame_id = 0; + // Emit a signal for the waypoint. + emit_signal(SNAME("waypoint_reached"), details); + + // Emit a signal if we've reached a navigation link. + if (waypoint_type == NavigationPathQueryResult2D::PATH_SEGMENT_TYPE_LINK) { + emit_signal(SNAME("link_reached"), details); + } } -void NavigationAgent2D::_check_distance_to_target() { - if (!target_reached) { - if (distance_to_target() < target_desired_distance) { - target_reached = true; - emit_signal(SNAME("target_reached")); - } +void NavigationAgent2D::_transition_to_navigation_finished() { + navigation_finished = true; + target_position_submitted = false; + + if (avoidance_enabled) { + NavigationServer2D::get_singleton()->agent_set_position(agent, agent_parent->get_global_position()); + NavigationServer2D::get_singleton()->agent_set_velocity(agent, Vector2(0.0, 0.0)); + NavigationServer2D::get_singleton()->agent_set_velocity_forced(agent, Vector2(0.0, 0.0)); } + + emit_signal(SNAME("navigation_finished")); +} + +void NavigationAgent2D::_transition_to_target_reached() { + target_reached = true; + emit_signal(SNAME("target_reached")); } void NavigationAgent2D::set_avoidance_layers(uint32_t p_layers) { diff --git a/scene/2d/navigation_agent_2d.h b/scene/2d/navigation_agent_2d.h index 10c703168b..0e46086a81 100644 --- a/scene/2d/navigation_agent_2d.h +++ b/scene/2d/navigation_agent_2d.h @@ -88,6 +88,7 @@ class NavigationAgent2D : public Node { bool target_reached = false; bool navigation_finished = true; + bool last_waypoint_reached = false; // No initialized on purpose uint32_t update_frame_id = 0; @@ -232,9 +233,21 @@ public: float get_debug_path_custom_line_width() const; private: - void update_navigation(); + bool _is_target_reachable() const; + Vector2 _get_final_position() const; + + void _update_navigation(); + void _advance_waypoints(const Vector2 &p_origin); void _request_repath(); - void _check_distance_to_target(); + + bool _is_last_waypoint() const; + void _move_to_next_waypoint(); + bool _is_within_waypoint_distance(const Vector2 &p_origin) const; + bool _is_within_target_distance(const Vector2 &p_origin) const; + + void _trigger_waypoint_reached(); + void _transition_to_navigation_finished(); + void _transition_to_target_reached(); #ifdef DEBUG_ENABLED void _navigation_debug_changed(); diff --git a/scene/2d/navigation_link_2d.cpp b/scene/2d/navigation_link_2d.cpp index 95798b6856..04ba550888 100644 --- a/scene/2d/navigation_link_2d.cpp +++ b/scene/2d/navigation_link_2d.cpp @@ -36,6 +36,8 @@ #include "servers/navigation_server_3d.h" void NavigationLink2D::_bind_methods() { + ClassDB::bind_method(D_METHOD("get_rid"), &NavigationLink2D::get_rid); + ClassDB::bind_method(D_METHOD("set_enabled", "enabled"), &NavigationLink2D::set_enabled); ClassDB::bind_method(D_METHOD("is_enabled"), &NavigationLink2D::is_enabled); @@ -175,6 +177,10 @@ bool NavigationLink2D::_edit_is_selected_on_click(const Point2 &p_point, double } #endif // TOOLS_ENABLED +RID NavigationLink2D::get_rid() const { + return link; +} + void NavigationLink2D::set_enabled(bool p_enabled) { if (enabled == p_enabled) { return; @@ -343,7 +349,13 @@ PackedStringArray NavigationLink2D::get_configuration_warnings() const { NavigationLink2D::NavigationLink2D() { link = NavigationServer2D::get_singleton()->link_create(); + NavigationServer2D::get_singleton()->link_set_owner_id(link, get_instance_id()); + NavigationServer2D::get_singleton()->link_set_enter_cost(link, enter_cost); + NavigationServer2D::get_singleton()->link_set_travel_cost(link, travel_cost); + NavigationServer2D::get_singleton()->link_set_navigation_layers(link, navigation_layers); + NavigationServer2D::get_singleton()->link_set_bidirectional(link, bidirectional); + NavigationServer2D::get_singleton()->link_set_enabled(link, enabled); set_notify_transform(true); set_hide_clip_children(true); diff --git a/scene/2d/navigation_link_2d.h b/scene/2d/navigation_link_2d.h index 4259740c90..2929691c04 100644 --- a/scene/2d/navigation_link_2d.h +++ b/scene/2d/navigation_link_2d.h @@ -61,6 +61,7 @@ public: virtual Rect2 _edit_get_rect() const override; virtual bool _edit_is_selected_on_click(const Point2 &p_point, double p_tolerance) const override; #endif + RID get_rid() const; void set_enabled(bool p_enabled); bool is_enabled() const { return enabled; } diff --git a/scene/2d/navigation_obstacle_2d.cpp b/scene/2d/navigation_obstacle_2d.cpp index d993b8a400..60fb64a8e2 100644 --- a/scene/2d/navigation_obstacle_2d.cpp +++ b/scene/2d/navigation_obstacle_2d.cpp @@ -148,10 +148,10 @@ void NavigationObstacle2D::_notification(int p_what) { NavigationObstacle2D::NavigationObstacle2D() { obstacle = NavigationServer2D::get_singleton()->obstacle_create(); - set_radius(radius); - set_vertices(vertices); - set_avoidance_layers(avoidance_layers); - set_avoidance_enabled(avoidance_enabled); + NavigationServer2D::get_singleton()->obstacle_set_radius(obstacle, radius); + NavigationServer2D::get_singleton()->obstacle_set_vertices(obstacle, vertices); + NavigationServer2D::get_singleton()->obstacle_set_avoidance_layers(obstacle, avoidance_layers); + NavigationServer2D::get_singleton()->obstacle_set_avoidance_enabled(obstacle, avoidance_enabled); } NavigationObstacle2D::~NavigationObstacle2D() { diff --git a/scene/2d/navigation_region_2d.cpp b/scene/2d/navigation_region_2d.cpp index 78733f04e4..8e4b6bfa19 100644 --- a/scene/2d/navigation_region_2d.cpp +++ b/scene/2d/navigation_region_2d.cpp @@ -35,6 +35,10 @@ #include "scene/resources/world_2d.h" #include "servers/navigation_server_2d.h" +RID NavigationRegion2D::get_rid() const { + return region; +} + void NavigationRegion2D::set_enabled(bool p_enabled) { if (enabled == p_enabled) { return; @@ -136,7 +140,7 @@ real_t NavigationRegion2D::get_travel_cost() const { } RID NavigationRegion2D::get_region_rid() const { - return region; + return get_rid(); } #ifdef TOOLS_ENABLED @@ -165,6 +169,7 @@ void NavigationRegion2D::_notification(int p_what) { case NOTIFICATION_INTERNAL_PHYSICS_PROCESS: { set_physics_process_internal(false); + _region_update_transform(); } break; case NOTIFICATION_DRAW: { @@ -279,6 +284,8 @@ PackedStringArray NavigationRegion2D::get_configuration_warnings() const { } void NavigationRegion2D::_bind_methods() { + ClassDB::bind_method(D_METHOD("get_rid"), &NavigationRegion2D::get_rid); + ClassDB::bind_method(D_METHOD("set_navigation_polygon", "navigation_polygon"), &NavigationRegion2D::set_navigation_polygon); ClassDB::bind_method(D_METHOD("get_navigation_polygon"), &NavigationRegion2D::get_navigation_polygon); @@ -356,6 +363,9 @@ NavigationRegion2D::NavigationRegion2D() { NavigationServer2D::get_singleton()->region_set_owner_id(region, get_instance_id()); NavigationServer2D::get_singleton()->region_set_enter_cost(region, get_enter_cost()); NavigationServer2D::get_singleton()->region_set_travel_cost(region, get_travel_cost()); + NavigationServer2D::get_singleton()->region_set_navigation_layers(region, navigation_layers); + NavigationServer2D::get_singleton()->region_set_use_edge_connections(region, use_edge_connections); + NavigationServer2D::get_singleton()->region_set_enabled(region, enabled); #ifdef DEBUG_ENABLED NavigationServer2D::get_singleton()->connect(SNAME("map_changed"), callable_mp(this, &NavigationRegion2D::_navigation_map_changed)); diff --git a/scene/2d/navigation_region_2d.h b/scene/2d/navigation_region_2d.h index 36e889877a..3b880dd00d 100644 --- a/scene/2d/navigation_region_2d.h +++ b/scene/2d/navigation_region_2d.h @@ -76,6 +76,7 @@ public: virtual Rect2 _edit_get_rect() const override; virtual bool _edit_is_selected_on_click(const Point2 &p_point, double p_tolerance) const override; #endif + RID get_rid() const; void set_enabled(bool p_enabled); bool is_enabled() const; diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp index 45533732c7..6af5a8dd80 100644 --- a/scene/2d/physics_body_2d.cpp +++ b/scene/2d/physics_body_2d.cpp @@ -451,10 +451,14 @@ void RigidBody2D::_body_state_changed(PhysicsDirectBodyState2D *p_state) { if (GDVIRTUAL_IS_OVERRIDDEN(_integrate_forces)) { _sync_body_state(p_state); + Transform2D old_transform = get_global_transform(); GDVIRTUAL_CALL(_integrate_forces, p_state); + Transform2D new_transform = get_global_transform(); - // Update the physics server with any new transform, to prevent it from being overwritten at the sync below. - force_update_transform(); + if (new_transform != old_transform) { + // Update the physics server with the new transform, to prevent it from being overwritten at the sync below. + PhysicsServer2D::get_singleton()->body_set_state(get_rid(), PhysicsServer2D::BODY_STATE_TRANSFORM, new_transform); + } } _sync_body_state(p_state); diff --git a/scene/2d/polygon_2d.cpp b/scene/2d/polygon_2d.cpp index bda7b495e1..ee186de5f1 100644 --- a/scene/2d/polygon_2d.cpp +++ b/scene/2d/polygon_2d.cpp @@ -101,7 +101,12 @@ void Polygon2D::_skeleton_bone_setup_changed() { } void Polygon2D::_notification(int p_what) { + if (p_what == NOTIFICATION_TRANSFORM_CHANGED && !Engine::get_singleton()->is_editor_hint()) { + return; // Mesh recreation for NOTIFICATION_TRANSFORM_CHANGED is only needed in editor. + } + switch (p_what) { + case NOTIFICATION_TRANSFORM_CHANGED: case NOTIFICATION_DRAW: { if (polygon.size() < 3) { return; @@ -364,7 +369,30 @@ void Polygon2D::_notification(int p_what) { arr[RS::ARRAY_INDEX] = index_array; - RS::get_singleton()->mesh_add_surface_from_arrays(mesh, RS::PRIMITIVE_TRIANGLES, arr, Array(), Dictionary(), RS::ARRAY_FLAG_USE_2D_VERTICES); + RS::SurfaceData sd; + + if (skeleton_node) { + // Compute transform between mesh and skeleton for runtime AABB compute. + const Transform2D mesh_transform = get_global_transform(); + const Transform2D skeleton_transform = skeleton_node->get_global_transform(); + const Transform2D mesh_to_sk2d = mesh_transform * skeleton_transform.affine_inverse(); + + // Convert 2d transform to 3d. + sd.mesh_to_skeleton_xform.basis.rows[0][0] = mesh_to_sk2d.columns[0][0]; + sd.mesh_to_skeleton_xform.basis.rows[0][1] = mesh_to_sk2d.columns[0][1]; + sd.mesh_to_skeleton_xform.origin.x = mesh_to_sk2d.get_origin().x; + + sd.mesh_to_skeleton_xform.basis.rows[1][0] = mesh_to_sk2d.columns[1][0]; + sd.mesh_to_skeleton_xform.basis.rows[1][1] = mesh_to_sk2d.columns[1][1]; + sd.mesh_to_skeleton_xform.origin.y = mesh_to_sk2d.get_origin().y; + } + + Error err = RS::get_singleton()->mesh_create_surface_data_from_arrays(&sd, RS::PRIMITIVE_TRIANGLES, arr, Array(), Dictionary(), RS::ARRAY_FLAG_USE_2D_VERTICES); + if (err != OK) { + return; + } + + RS::get_singleton()->mesh_add_surface(mesh, sd); RS::get_singleton()->canvas_item_add_mesh(get_canvas_item(), mesh, Transform2D(), Color(1, 1, 1), texture.is_valid() ? texture->get_rid() : RID()); } diff --git a/scene/2d/sprite_2d.cpp b/scene/2d/sprite_2d.cpp index 7e6b43559c..d3be5b9c65 100644 --- a/scene/2d/sprite_2d.cpp +++ b/scene/2d/sprite_2d.cpp @@ -155,6 +155,10 @@ Ref<Texture2D> Sprite2D::get_texture() const { } void Sprite2D::set_centered(bool p_center) { + if (centered == p_center) { + return; + } + centered = p_center; queue_redraw(); item_rect_changed(); @@ -165,6 +169,10 @@ bool Sprite2D::is_centered() const { } void Sprite2D::set_offset(const Point2 &p_offset) { + if (offset == p_offset) { + return; + } + offset = p_offset; queue_redraw(); item_rect_changed(); @@ -175,6 +183,10 @@ Point2 Sprite2D::get_offset() const { } void Sprite2D::set_flip_h(bool p_flip) { + if (hflip == p_flip) { + return; + } + hflip = p_flip; queue_redraw(); } @@ -184,6 +196,10 @@ bool Sprite2D::is_flipped_h() const { } void Sprite2D::set_flip_v(bool p_flip) { + if (vflip == p_flip) { + return; + } + vflip = p_flip; queue_redraw(); } @@ -193,7 +209,7 @@ bool Sprite2D::is_flipped_v() const { } void Sprite2D::set_region_enabled(bool p_region_enabled) { - if (p_region_enabled == region_enabled) { + if (region_enabled == p_region_enabled) { return; } @@ -223,6 +239,10 @@ Rect2 Sprite2D::get_region_rect() const { } void Sprite2D::set_region_filter_clip_enabled(bool p_region_filter_clip_enabled) { + if (region_filter_clip_enabled == p_region_filter_clip_enabled) { + return; + } + region_filter_clip_enabled = p_region_filter_clip_enabled; queue_redraw(); } @@ -234,12 +254,12 @@ bool Sprite2D::is_region_filter_clip_enabled() const { void Sprite2D::set_frame(int p_frame) { ERR_FAIL_INDEX(p_frame, vframes * hframes); - if (frame != p_frame) { - item_rect_changed(); + if (frame == p_frame) { + return; } frame = p_frame; - + item_rect_changed(); emit_signal(SceneStringNames::get_singleton()->frame_changed); } @@ -260,7 +280,15 @@ Vector2i Sprite2D::get_frame_coords() const { void Sprite2D::set_vframes(int p_amount) { ERR_FAIL_COND_MSG(p_amount < 1, "Amount of vframes cannot be smaller than 1."); + + if (vframes == p_amount) { + return; + } + vframes = p_amount; + if (frame >= vframes * hframes) { + frame = 0; + } queue_redraw(); item_rect_changed(); notify_property_list_changed(); @@ -272,7 +300,26 @@ int Sprite2D::get_vframes() const { void Sprite2D::set_hframes(int p_amount) { ERR_FAIL_COND_MSG(p_amount < 1, "Amount of hframes cannot be smaller than 1."); + + if (hframes == p_amount) { + return; + } + + if (vframes > 1) { + // Adjust the frame to fit new sheet dimensions. + int original_column = frame % hframes; + if (original_column >= p_amount) { + // Frame's column was dropped, reset. + frame = 0; + } else { + int original_row = frame / hframes; + frame = original_row * p_amount + original_column; + } + } hframes = p_amount; + if (frame >= vframes * hframes) { + frame = 0; + } queue_redraw(); item_rect_changed(); notify_property_list_changed(); diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index 1ea342c3f4..f2be91cbf3 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -447,6 +447,9 @@ void TileMapLayer::_rendering_update() { for (KeyValue<Vector2i, CellData> &kv : tile_map) { CellData &cell_data = kv.value; for (const RID &occluder : cell_data.occluders) { + if (occluder.is_null()) { + continue; + } Transform2D xform(0, tile_map_node->map_to_local(kv.key)); rs->canvas_light_occluder_attach_to_canvas(occluder, tile_map_node->get_canvas()); rs->canvas_light_occluder_set_transform(occluder, tile_map_node->get_global_transform() * xform); @@ -565,6 +568,15 @@ void TileMapLayer::_rendering_occluders_update_cell(CellData &r_cell_data) { const Ref<TileSet> &tile_set = tile_map_node->get_tileset(); RenderingServer *rs = RenderingServer::get_singleton(); + // Free unused occluders then resize the occluders array. + for (uint32_t i = tile_set->get_occlusion_layers_count(); i < r_cell_data.occluders.size(); i++) { + RID occluder_id = r_cell_data.occluders[i]; + if (occluder_id.is_valid()) { + rs->free(occluder_id); + } + } + r_cell_data.occluders.resize(tile_set->get_occlusion_layers_count()); + TileSetSource *source; if (tile_set->has_source(r_cell_data.cell.source_id)) { source = *tile_set->get_source(r_cell_data.cell.source_id); @@ -580,18 +592,35 @@ void TileMapLayer::_rendering_occluders_update_cell(CellData &r_cell_data) { tile_data = atlas_source->get_tile_data(r_cell_data.cell.get_atlas_coords(), r_cell_data.cell.alternative_tile); } - // Update/create occluders. - for (int i = 0; i < tile_set->get_occlusion_layers_count(); i++) { - Transform2D xform; - xform.set_origin(tile_map_node->map_to_local(r_cell_data.coords)); - if (tile_data->get_occluder(i).is_valid()) { - RID occluder_id = rs->canvas_light_occluder_create(); - rs->canvas_light_occluder_set_enabled(occluder_id, node_visible); - rs->canvas_light_occluder_set_transform(occluder_id, tile_map_node->get_global_transform() * xform); - rs->canvas_light_occluder_set_polygon(occluder_id, tile_map_node->get_transformed_polygon(Ref<Resource>(tile_data->get_occluder(i)), r_cell_data.cell.alternative_tile)->get_rid()); - rs->canvas_light_occluder_attach_to_canvas(occluder_id, tile_map_node->get_canvas()); - rs->canvas_light_occluder_set_light_mask(occluder_id, tile_set->get_occlusion_layer_light_mask(i)); - r_cell_data.occluders.push_back(occluder_id); + // Transform flags. + bool flip_h = (r_cell_data.cell.alternative_tile & TileSetAtlasSource::TRANSFORM_FLIP_H); + bool flip_v = (r_cell_data.cell.alternative_tile & TileSetAtlasSource::TRANSFORM_FLIP_V); + bool transpose = (r_cell_data.cell.alternative_tile & TileSetAtlasSource::TRANSFORM_TRANSPOSE); + + // Create, update or clear occluders. + for (uint32_t occlusion_layer_index = 0; occlusion_layer_index < r_cell_data.occluders.size(); occlusion_layer_index++) { + Ref<OccluderPolygon2D> occluder_polygon = tile_data->get_occluder(occlusion_layer_index); + + RID &occluder = r_cell_data.occluders[occlusion_layer_index]; + + if (occluder_polygon.is_valid()) { + // Create or update occluder. + Transform2D xform; + xform.set_origin(tile_map_node->map_to_local(r_cell_data.coords)); + if (!occluder.is_valid()) { + occluder = rs->canvas_light_occluder_create(); + } + rs->canvas_light_occluder_set_enabled(occluder, node_visible); + rs->canvas_light_occluder_set_transform(occluder, tile_map_node->get_global_transform() * xform); + rs->canvas_light_occluder_set_polygon(occluder, tile_data->get_occluder(occlusion_layer_index, flip_h, flip_v, transpose)->get_rid()); + rs->canvas_light_occluder_attach_to_canvas(occluder, tile_map_node->get_canvas()); + rs->canvas_light_occluder_set_light_mask(occluder, tile_set->get_occlusion_layer_light_mask(occlusion_layer_index)); + } else { + // Clear occluder. + if (occluder.is_valid()) { + rs->free(occluder); + occluder = RID(); + } } } @@ -686,6 +715,8 @@ void TileMapLayer::_physics_update() { void TileMapLayer::_physics_notify_tilemap_change(TileMapLayer::DirtyFlags p_what) { Transform2D gl_transform = tile_map_node->get_global_transform(); + PhysicsServer2D *ps = PhysicsServer2D::get_singleton(); + bool in_editor = false; #ifdef TOOLS_ENABLED in_editor = Engine::get_singleton()->is_editor_hint(); @@ -693,6 +724,7 @@ void TileMapLayer::_physics_notify_tilemap_change(TileMapLayer::DirtyFlags p_wha if (p_what == DIRTY_FLAGS_TILE_MAP_XFORM) { if (tile_map_node->is_inside_tree() && (!tile_map_node->is_collision_animatable() || in_editor)) { + // Move the collisison shapes along with the TileMap. for (KeyValue<Vector2i, CellData> &kv : tile_map) { const CellData &cell_data = kv.value; @@ -700,12 +732,13 @@ void TileMapLayer::_physics_notify_tilemap_change(TileMapLayer::DirtyFlags p_wha if (body.is_valid()) { Transform2D xform(0, tile_map_node->map_to_local(bodies_coords[body])); xform = gl_transform * xform; - PhysicsServer2D::get_singleton()->body_set_state(body, PhysicsServer2D::BODY_STATE_TRANSFORM, xform); + ps->body_set_state(body, PhysicsServer2D::BODY_STATE_TRANSFORM, xform); } } } } } else if (p_what == DIRTY_FLAGS_TILE_MAP_LOCAL_XFORM) { + // With collisions animatable, move the collisison shapes along with the TileMap only on local xform change (they are synchornized on physics tick instead). if (tile_map_node->is_inside_tree() && tile_map_node->is_collision_animatable() && !in_editor) { for (KeyValue<Vector2i, CellData> &kv : tile_map) { const CellData &cell_data = kv.value; @@ -714,7 +747,22 @@ void TileMapLayer::_physics_notify_tilemap_change(TileMapLayer::DirtyFlags p_wha if (body.is_valid()) { Transform2D xform(0, tile_map_node->map_to_local(bodies_coords[body])); xform = gl_transform * xform; - PhysicsServer2D::get_singleton()->body_set_state(body, PhysicsServer2D::BODY_STATE_TRANSFORM, xform); + ps->body_set_state(body, PhysicsServer2D::BODY_STATE_TRANSFORM, xform); + } + } + } + } + } else if (p_what == DIRTY_FLAGS_TILE_MAP_IN_TREE) { + // Changes in the tree may cause the space to change (e.g. when reparenting to a SubViewport). + if (tile_map_node->is_inside_tree()) { + RID space = tile_map_node->get_world_2d()->get_space(); + + for (KeyValue<Vector2i, CellData> &kv : tile_map) { + const CellData &cell_data = kv.value; + + for (RID body : cell_data.bodies) { + if (body.is_valid()) { + ps->body_set_space(body, space); } } } @@ -758,8 +806,13 @@ void TileMapLayer::_physics_update_cell(CellData &r_cell_data) { tile_data = atlas_source->get_tile_data(c.get_atlas_coords(), c.alternative_tile); } + // Transform flags. + bool flip_h = (c.alternative_tile & TileSetAtlasSource::TRANSFORM_FLIP_H); + bool flip_v = (c.alternative_tile & TileSetAtlasSource::TRANSFORM_FLIP_V); + bool transpose = (c.alternative_tile & TileSetAtlasSource::TRANSFORM_TRANSPOSE); + // Free unused bodies then resize the bodies array. - for (unsigned int i = tile_set->get_physics_layers_count(); i < r_cell_data.bodies.size(); i++) { + for (uint32_t i = tile_set->get_physics_layers_count(); i < r_cell_data.bodies.size(); i++) { RID body = r_cell_data.bodies[i]; if (body.is_valid()) { bodies_coords.erase(body); @@ -768,7 +821,7 @@ void TileMapLayer::_physics_update_cell(CellData &r_cell_data) { } r_cell_data.bodies.resize(tile_set->get_physics_layers_count()); - for (int tile_set_physics_layer = 0; tile_set_physics_layer < tile_set->get_physics_layers_count(); tile_set_physics_layer++) { + for (uint32_t tile_set_physics_layer = 0; tile_set_physics_layer < (uint32_t)tile_set->get_physics_layers_count(); tile_set_physics_layer++) { Ref<PhysicsMaterial> physics_material = tile_set->get_physics_layer_physics_material(tile_set_physics_layer); uint32_t physics_layer = tile_set->get_physics_layer_collision_layer(tile_set_physics_layer); uint32_t physics_mask = tile_set->get_physics_layer_collision_mask(tile_set_physics_layer); @@ -822,8 +875,7 @@ void TileMapLayer::_physics_update_cell(CellData &r_cell_data) { int shapes_count = tile_data->get_collision_polygon_shapes_count(tile_set_physics_layer, polygon_index); for (int shape_index = 0; shape_index < shapes_count; shape_index++) { // Add decomposed convex shapes. - Ref<ConvexPolygonShape2D> shape = tile_data->get_collision_polygon_shape(tile_set_physics_layer, polygon_index, shape_index); - shape = tile_map_node->get_transformed_polygon(Ref<Resource>(shape), c.alternative_tile); + Ref<ConvexPolygonShape2D> shape = tile_data->get_collision_polygon_shape(tile_set_physics_layer, polygon_index, shape_index, flip_h, flip_v, transpose); ps->body_add_shape(body, shape->get_rid()); ps->body_set_shape_as_one_way_collision(body, body_shape_index, one_way_collision, one_way_collision_margin); @@ -979,7 +1031,7 @@ void TileMapLayer::_navigation_update() { void TileMapLayer::_navigation_clear_cell(CellData &r_cell_data) { NavigationServer2D *ns = NavigationServer2D::get_singleton(); // Clear navigation shapes. - for (unsigned int i = 0; i < r_cell_data.navigation_regions.size(); i++) { + for (uint32_t i = 0; i < r_cell_data.navigation_regions.size(); i++) { const RID ®ion = r_cell_data.navigation_regions[i]; if (region.is_valid()) { ns->region_set_map(region, RID()); @@ -1011,8 +1063,13 @@ void TileMapLayer::_navigation_update_cell(CellData &r_cell_data) { tile_data = atlas_source->get_tile_data(c.get_atlas_coords(), c.alternative_tile); } + // Transform flags. + bool flip_h = (c.alternative_tile & TileSetAtlasSource::TRANSFORM_FLIP_H); + bool flip_v = (c.alternative_tile & TileSetAtlasSource::TRANSFORM_FLIP_V); + bool transpose = (c.alternative_tile & TileSetAtlasSource::TRANSFORM_TRANSPOSE); + // Free unused regions then resize the regions array. - for (unsigned int i = tile_set->get_navigation_layers_count(); i < r_cell_data.navigation_regions.size(); i++) { + for (uint32_t i = tile_set->get_navigation_layers_count(); i < r_cell_data.navigation_regions.size(); i++) { RID ®ion = r_cell_data.navigation_regions[i]; if (region.is_valid()) { ns->region_set_map(region, RID()); @@ -1023,10 +1080,8 @@ void TileMapLayer::_navigation_update_cell(CellData &r_cell_data) { r_cell_data.navigation_regions.resize(tile_set->get_navigation_layers_count()); // Create, update or clear regions. - for (unsigned int navigation_layer_index = 0; navigation_layer_index < r_cell_data.navigation_regions.size(); navigation_layer_index++) { - Ref<NavigationPolygon> navigation_polygon; - navigation_polygon = tile_data->get_navigation_polygon(navigation_layer_index); - navigation_polygon = tile_map_node->get_transformed_polygon(Ref<Resource>(navigation_polygon), c.alternative_tile); + for (uint32_t navigation_layer_index = 0; navigation_layer_index < r_cell_data.navigation_regions.size(); navigation_layer_index++) { + Ref<NavigationPolygon> navigation_polygon = tile_data->get_navigation_polygon(navigation_layer_index, flip_h, flip_v, transpose); RID ®ion = r_cell_data.navigation_regions[navigation_layer_index]; @@ -1119,9 +1174,11 @@ void TileMapLayer::_navigation_draw_cell_debug(const RID &p_canvas_item, const V rs->canvas_item_add_set_transform(p_canvas_item, cell_to_quadrant); for (int layer_index = 0; layer_index < tile_set->get_navigation_layers_count(); layer_index++) { - Ref<NavigationPolygon> navigation_polygon = tile_data->get_navigation_polygon(layer_index); + bool flip_h = (c.alternative_tile & TileSetAtlasSource::TRANSFORM_FLIP_H); + bool flip_v = (c.alternative_tile & TileSetAtlasSource::TRANSFORM_FLIP_V); + bool transpose = (c.alternative_tile & TileSetAtlasSource::TRANSFORM_TRANSPOSE); + Ref<NavigationPolygon> navigation_polygon = tile_data->get_navigation_polygon(layer_index, flip_h, flip_v, transpose); if (navigation_polygon.is_valid()) { - navigation_polygon = tile_map_node->get_transformed_polygon(Ref<Resource>(navigation_polygon), c.alternative_tile); Vector<Vector2> navigation_polygon_vertices = navigation_polygon->get_vertices(); if (navigation_polygon_vertices.size() < 3) { continue; @@ -1172,7 +1229,7 @@ void TileMapLayer::_scenes_update() { const Ref<TileSet> &tile_set = tile_map_node->get_tileset(); // Check if we should cleanup everything. - bool forced_cleanup = in_destructor || !enabled || !tile_map_node->is_inside_tree() || !tile_set.is_valid() || !tile_map_node->is_visible_in_tree(); + bool forced_cleanup = in_destructor || !enabled || !tile_map_node->is_inside_tree() || !tile_set.is_valid(); if (forced_cleanup) { // Clean everything. @@ -3077,11 +3134,6 @@ void TileMap::_internal_update() { return; } - // FIXME: This should only clear polygons that are no longer going to be used, but since it's difficult to determine, - // the cache is never cleared at runtime to prevent invalidating used polygons. - if (Engine::get_singleton()->is_editor_hint()) { - polygon_cache.clear(); - } // Update dirty quadrants on layers. for (Ref<TileMapLayer> &layer : layers) { layer->internal_update(); @@ -3231,7 +3283,7 @@ void TileMap::add_layer(int p_to_pos) { new_layer.instantiate(); new_layer->set_tile_map(this); layers.insert(p_to_pos, new_layer); - for (unsigned int i = 0; i < layers.size(); i++) { + for (uint32_t i = 0; i < layers.size(); i++) { layers[i]->set_layer_index_in_tile_map_node(i); } queue_internal_update(); @@ -3250,7 +3302,7 @@ void TileMap::move_layer(int p_layer, int p_to_pos) { Ref<TileMapLayer> layer = layers[p_layer]; layers.insert(p_to_pos, layer); layers.remove_at(p_to_pos < p_layer ? p_layer + 1 : p_layer); - for (unsigned int i = 0; i < layers.size(); i++) { + for (uint32_t i = 0; i < layers.size(); i++) { layers[i]->set_layer_index_in_tile_map_node(i); } queue_internal_update(); @@ -3270,7 +3322,7 @@ void TileMap::remove_layer(int p_layer) { // Clear before removing the layer. layers.remove_at(p_layer); - for (unsigned int i = 0; i < layers.size(); i++) { + for (uint32_t i = 0; i < layers.size(); i++) { layers[i]->set_layer_index_in_tile_map_node(i); } queue_internal_update(); @@ -3507,7 +3559,7 @@ Vector2i TileMap::get_coords_for_body_rid(RID p_physics_body) { } int TileMap::get_layer_for_body_rid(RID p_physics_body) { - for (unsigned int i = 0; i < layers.size(); i++) { + for (uint32_t i = 0; i < layers.size(); i++) { if (layers[i]->has_body_rid(p_physics_body)) { return i; } @@ -3557,7 +3609,7 @@ Rect2 TileMap::_edit_get_rect() const { bool changed = false; Rect2 rect = layers[0]->get_rect(changed); any_changed |= changed; - for (unsigned int i = 1; i < layers.size(); i++) { + for (uint32_t i = 1; i < layers.size(); i++) { rect = rect.merge(layers[i]->get_rect(changed)); any_changed |= changed; } @@ -3566,37 +3618,6 @@ Rect2 TileMap::_edit_get_rect() const { } #endif -PackedVector2Array TileMap::_get_transformed_vertices(const PackedVector2Array &p_vertices, int p_alternative_id) { - const Vector2 *r = p_vertices.ptr(); - int size = p_vertices.size(); - - PackedVector2Array new_points; - new_points.resize(size); - Vector2 *w = new_points.ptrw(); - - bool flip_h = (p_alternative_id & TileSetAtlasSource::TRANSFORM_FLIP_H); - bool flip_v = (p_alternative_id & TileSetAtlasSource::TRANSFORM_FLIP_V); - bool transpose = (p_alternative_id & TileSetAtlasSource::TRANSFORM_TRANSPOSE); - - for (int i = 0; i < size; i++) { - Vector2 v; - if (transpose) { - v = Vector2(r[i].y, r[i].x); - } else { - v = r[i]; - } - - if (flip_h) { - v.x *= -1; - } - if (flip_v) { - v.y *= -1; - } - w[i] = v; - } - return new_points; -} - bool TileMap::_set(const StringName &p_name, const Variant &p_value) { Vector<String> components = String(p_name).split("/", true, 2); if (p_name == "format") { @@ -3604,8 +3625,9 @@ bool TileMap::_set(const StringName &p_name, const Variant &p_value) { format = (TileMapLayer::DataFormat)(p_value.operator int64_t()); // Set format used for loading. return true; } + } #ifndef DISABLE_DEPRECATED - } else if (p_name == "tile_data") { // Kept for compatibility reasons. + else if (p_name == "tile_data") { // Kept for compatibility reasons. if (p_value.is_array()) { if (layers.size() == 0) { Ref<TileMapLayer> new_layer; @@ -3619,10 +3641,12 @@ bool TileMap::_set(const StringName &p_name, const Variant &p_value) { return true; } return false; - } else if (p_name == "rendering_quadrant_size") { + } else if (p_name == "cell_quadrant_size") { set_rendering_quadrant_size(p_value); + return true; + } #endif // DISABLE_DEPRECATED - } else if (components.size() == 2 && components[0].begins_with("layer_") && components[0].trim_prefix("layer_").is_valid_int()) { + else if (components.size() == 2 && components[0].begins_with("layer_") && components[0].trim_prefix("layer_").is_valid_int()) { int index = components[0].trim_prefix("layer_").to_int(); if (index < 0) { return false; @@ -3679,7 +3703,14 @@ bool TileMap::_get(const StringName &p_name, Variant &r_ret) const { if (p_name == "format") { r_ret = TileMapLayer::FORMAT_MAX - 1; // When saving, always save highest format. return true; - } else if (components.size() == 2 && components[0].begins_with("layer_") && components[0].trim_prefix("layer_").is_valid_int()) { + } +#ifndef DISABLE_DEPRECATED + else if (p_name == "cell_quadrant_size") { // Kept for compatibility reasons. + r_ret = get_rendering_quadrant_size(); + return true; + } +#endif + else if (components.size() == 2 && components[0].begins_with("layer_") && components[0].trim_prefix("layer_").is_valid_int()) { int index = components[0].trim_prefix("layer_").to_int(); if (index < 0 || index >= (int)layers.size()) { return false; @@ -3726,7 +3757,7 @@ void TileMap::_get_property_list(List<PropertyInfo> *p_list) const { p_list->push_back(PropertyInfo(m_type, property_name, PROPERTY_HINT_NONE, m_hint, (get(property_name) == property_get_revert(property_name)) ? PROPERTY_USAGE_EDITOR : PROPERTY_USAGE_DEFAULT)); \ } - for (unsigned int i = 0; i < layers.size(); i++) { + for (uint32_t i = 0; i < layers.size(); i++) { MAKE_LAYER_PROPERTY(Variant::STRING, "name", ""); MAKE_LAYER_PROPERTY(Variant::BOOL, "enabled", ""); MAKE_LAYER_PROPERTY(Variant::COLOR, "modulate", ""); @@ -4585,57 +4616,6 @@ void TileMap::draw_cells_outline(Control *p_control, const RBSet<Vector2i> &p_ce #undef DRAW_SIDE_IF_NEEDED } -Ref<Resource> TileMap::get_transformed_polygon(Ref<Resource> p_polygon, int p_alternative_id) { - if (!bool(p_alternative_id & (TileSetAtlasSource::TRANSFORM_FLIP_H | TileSetAtlasSource::TRANSFORM_FLIP_V | TileSetAtlasSource::TRANSFORM_TRANSPOSE))) { - return p_polygon; - } - - { - HashMap<Pair<Ref<Resource>, int>, Ref<Resource>, PairHash<Ref<Resource>, int>>::Iterator E = polygon_cache.find(Pair<Ref<Resource>, int>(p_polygon, p_alternative_id)); - if (E) { - return E->value; - } - } - - Ref<ConvexPolygonShape2D> col = p_polygon; - if (col.is_valid()) { - Ref<ConvexPolygonShape2D> ret; - ret.instantiate(); - ret->set_points(_get_transformed_vertices(col->get_points(), p_alternative_id)); - polygon_cache[Pair<Ref<Resource>, int>(p_polygon, p_alternative_id)] = ret; - return ret; - } - - Ref<NavigationPolygon> nav = p_polygon; - if (nav.is_valid()) { - PackedVector2Array new_points = _get_transformed_vertices(nav->get_vertices(), p_alternative_id); - Ref<NavigationPolygon> ret; - ret.instantiate(); - ret->set_vertices(new_points); - - PackedInt32Array indices; - indices.resize(new_points.size()); - int *w = indices.ptrw(); - for (int i = 0; i < new_points.size(); i++) { - w[i] = i; - } - ret->add_polygon(indices); - polygon_cache[Pair<Ref<Resource>, int>(p_polygon, p_alternative_id)] = ret; - return ret; - } - - Ref<OccluderPolygon2D> ocd = p_polygon; - if (ocd.is_valid()) { - Ref<OccluderPolygon2D> ret; - ret.instantiate(); - ret->set_polygon(_get_transformed_vertices(ocd->get_polygon(), p_alternative_id)); - polygon_cache[Pair<Ref<Resource>, int>(p_polygon, p_alternative_id)] = ret; - return ret; - } - - return p_polygon; -} - PackedStringArray TileMap::get_configuration_warnings() const { PackedStringArray warnings = Node::get_configuration_warnings(); diff --git a/scene/2d/tile_map.h b/scene/2d/tile_map.h index 1136e4190d..1e4c6d0e66 100644 --- a/scene/2d/tile_map.h +++ b/scene/2d/tile_map.h @@ -104,7 +104,7 @@ struct CellData { // Rendering. Ref<RenderingQuadrant> rendering_quadrant; SelfList<CellData> rendering_quadrant_list_element; - List<RID> occluders; + LocalVector<RID> occluders; // Physics. LocalVector<RID> bodies; @@ -472,10 +472,6 @@ private: void _update_notify_local_transform(); - // Polygons. - HashMap<Pair<Ref<Resource>, int>, Ref<Resource>, PairHash<Ref<Resource>, int>> polygon_cache; - PackedVector2Array _get_transformed_vertices(const PackedVector2Array &p_vertices, int p_alternative_id); - protected: bool _set(const StringName &p_name, const Variant &p_value); bool _get(const StringName &p_name, Variant &r_ret) const; @@ -619,7 +615,6 @@ public: // Helpers? TypedArray<Vector2i> get_surrounding_cells(const Vector2i &coords); void draw_cells_outline(Control *p_control, const RBSet<Vector2i> &p_cells, Color p_color, Transform2D p_transform = Transform2D()); - Ref<Resource> get_transformed_polygon(Ref<Resource> p_polygon, int p_alternative_id); // Virtual function to modify the TileData at runtime. GDVIRTUAL2R(bool, _use_tile_data_runtime_update, int, Vector2i); diff --git a/scene/3d/area_3d.cpp b/scene/3d/area_3d.cpp index beb6892435..014c33cad0 100644 --- a/scene/3d/area_3d.cpp +++ b/scene/3d/area_3d.cpp @@ -223,6 +223,21 @@ void Area3D::_body_inout(int p_status, const RID &p_body, ObjectID p_instance, i bool body_in = p_status == PhysicsServer3D::AREA_BODY_ADDED; ObjectID objid = p_instance; + // Exit early if instance is invalid. + if (objid.is_null()) { + lock_callback(); + locked = true; + // Emit the appropriate signals. + if (body_in) { + emit_signal(SceneStringNames::get_singleton()->body_shape_entered, p_body, (Node *)nullptr, p_body_shape, p_area_shape); + } else { + emit_signal(SceneStringNames::get_singleton()->body_shape_exited, p_body, (Node *)nullptr, p_body_shape, p_area_shape); + } + locked = false; + unlock_callback(); + return; + } + Object *obj = ObjectDB::get_instance(objid); Node *node = Object::cast_to<Node>(obj); @@ -254,7 +269,7 @@ void Area3D::_body_inout(int p_status, const RID &p_body, ObjectID p_instance, i E->value.shapes.insert(ShapePair(p_body_shape, p_area_shape)); } - if (E->value.in_tree) { + if (!node || E->value.in_tree) { emit_signal(SceneStringNames::get_singleton()->body_shape_entered, p_body, node, p_body_shape, p_area_shape); } @@ -276,7 +291,7 @@ void Area3D::_body_inout(int p_status, const RID &p_body, ObjectID p_instance, i } } } - if (node && in_tree) { + if (!node || in_tree) { emit_signal(SceneStringNames::get_singleton()->body_shape_exited, p_body, obj, p_body_shape, p_area_shape); } } @@ -347,12 +362,14 @@ void Area3D::_clear_monitoring() { } } +void Area3D::_space_changed(const RID &p_new_space) { + if (p_new_space.is_null()) { + _clear_monitoring(); + } +} + void Area3D::_notification(int p_what) { switch (p_what) { - case NOTIFICATION_EXIT_TREE: { - _clear_monitoring(); - } break; - case NOTIFICATION_ENTER_TREE: { _initialize_wind(); } break; @@ -412,6 +429,21 @@ void Area3D::_area_inout(int p_status, const RID &p_area, ObjectID p_instance, i bool area_in = p_status == PhysicsServer3D::AREA_BODY_ADDED; ObjectID objid = p_instance; + // Exit if instance is invalid. + if (objid.is_null()) { + lock_callback(); + locked = true; + // Emit the appropriate signals. + if (area_in) { + emit_signal(SceneStringNames::get_singleton()->area_shape_entered, p_area, (Node *)nullptr, p_area_shape, p_self_shape); + } else { + emit_signal(SceneStringNames::get_singleton()->area_shape_exited, p_area, (Node *)nullptr, p_area_shape, p_self_shape); + } + locked = false; + unlock_callback(); + return; + } + Object *obj = ObjectDB::get_instance(objid); Node *node = Object::cast_to<Node>(obj); diff --git a/scene/3d/area_3d.h b/scene/3d/area_3d.h index 86602d3192..05c558e8f0 100644 --- a/scene/3d/area_3d.h +++ b/scene/3d/area_3d.h @@ -149,6 +149,8 @@ protected: static void _bind_methods(); void _validate_property(PropertyInfo &p_property) const; + virtual void _space_changed(const RID &p_new_space) override; + public: void set_gravity_space_override_mode(SpaceOverride p_mode); SpaceOverride get_gravity_space_override_mode() const; diff --git a/scene/3d/camera_3d.h b/scene/3d/camera_3d.h index aa302ded4a..8de607806e 100644 --- a/scene/3d/camera_3d.h +++ b/scene/3d/camera_3d.h @@ -36,6 +36,11 @@ #include "scene/resources/camera_attributes.h" #include "scene/resources/environment.h" +#ifdef MINGW_ENABLED +#undef near +#undef far +#endif + class Camera3D : public Node3D { GDCLASS(Camera3D, Node3D); diff --git a/scene/3d/collision_object_3d.cpp b/scene/3d/collision_object_3d.cpp index bfe594adc2..4562ecfb5f 100644 --- a/scene/3d/collision_object_3d.cpp +++ b/scene/3d/collision_object_3d.cpp @@ -78,6 +78,7 @@ void CollisionObject3D::_notification(int p_what) { } else { PhysicsServer3D::get_singleton()->body_set_space(rid, space); } + _space_changed(space); } _update_pickable(); @@ -117,6 +118,7 @@ void CollisionObject3D::_notification(int p_what) { } else { PhysicsServer3D::get_singleton()->body_set_space(rid, RID()); } + _space_changed(RID()); } } @@ -244,6 +246,7 @@ void CollisionObject3D::_apply_disabled() { } else { PhysicsServer3D::get_singleton()->body_set_space(rid, RID()); } + _space_changed(RID()); } } } break; @@ -270,6 +273,7 @@ void CollisionObject3D::_apply_enabled() { } else { PhysicsServer3D::get_singleton()->body_set_space(rid, space); } + _space_changed(space); } } break; @@ -320,6 +324,9 @@ void CollisionObject3D::set_body_mode(PhysicsServer3D::BodyMode p_mode) { PhysicsServer3D::get_singleton()->body_set_mode(rid, p_mode); } +void CollisionObject3D::_space_changed(const RID &p_new_space) { +} + void CollisionObject3D::set_only_update_transform_changes(bool p_enable) { only_update_transform_changes = p_enable; } diff --git a/scene/3d/collision_object_3d.h b/scene/3d/collision_object_3d.h index ebcbb39e0d..b51423f021 100644 --- a/scene/3d/collision_object_3d.h +++ b/scene/3d/collision_object_3d.h @@ -116,6 +116,8 @@ protected: void set_body_mode(PhysicsServer3D::BodyMode p_mode); + virtual void _space_changed(const RID &p_new_space); + void set_only_update_transform_changes(bool p_enable); bool is_only_update_transform_changes_enabled() const; diff --git a/scene/3d/label_3d.cpp b/scene/3d/label_3d.cpp index 9eec2f5345..3fb472335e 100644 --- a/scene/3d/label_3d.cpp +++ b/scene/3d/label_3d.cpp @@ -326,28 +326,38 @@ Ref<TriangleMesh> Label3D::generate_triangle_mesh() const { } void Label3D::_generate_glyph_surfaces(const Glyph &p_glyph, Vector2 &r_offset, const Color &p_modulate, int p_priority, int p_outline_size) { - for (int j = 0; j < p_glyph.repeat; j++) { - Vector2 gl_of; - Vector2 gl_sz; - Rect2 gl_uv; - Size2 texs; - RID tex; - - if (p_glyph.font_rid != RID()) { - tex = TS->font_get_glyph_texture_rid(p_glyph.font_rid, Vector2i(p_glyph.font_size, p_outline_size), p_glyph.index); - if (tex != RID()) { - gl_of = (TS->font_get_glyph_offset(p_glyph.font_rid, Vector2i(p_glyph.font_size, p_outline_size), p_glyph.index) + Vector2(p_glyph.x_off, p_glyph.y_off)) * pixel_size; - gl_sz = TS->font_get_glyph_size(p_glyph.font_rid, Vector2i(p_glyph.font_size, p_outline_size), p_glyph.index) * pixel_size; - gl_uv = TS->font_get_glyph_uv_rect(p_glyph.font_rid, Vector2i(p_glyph.font_size, p_outline_size), p_glyph.index); - texs = TS->font_get_glyph_texture_size(p_glyph.font_rid, Vector2i(p_glyph.font_size, p_outline_size), p_glyph.index); - } - } else { - gl_sz = TS->get_hex_code_box_size(p_glyph.font_size, p_glyph.index) * pixel_size; - gl_of = Vector2(0, -gl_sz.y); + if (p_glyph.index == 0) { + r_offset.x += p_glyph.advance * pixel_size * p_glyph.repeat; // Non visual character, skip. + return; + } + + Vector2 gl_of; + Vector2 gl_sz; + Rect2 gl_uv; + Size2 texs; + RID tex; + + if (p_glyph.font_rid.is_valid()) { + tex = TS->font_get_glyph_texture_rid(p_glyph.font_rid, Vector2i(p_glyph.font_size, p_outline_size), p_glyph.index); + if (tex.is_valid()) { + gl_of = (TS->font_get_glyph_offset(p_glyph.font_rid, Vector2i(p_glyph.font_size, p_outline_size), p_glyph.index) + Vector2(p_glyph.x_off, p_glyph.y_off)) * pixel_size; + gl_sz = TS->font_get_glyph_size(p_glyph.font_rid, Vector2i(p_glyph.font_size, p_outline_size), p_glyph.index) * pixel_size; + gl_uv = TS->font_get_glyph_uv_rect(p_glyph.font_rid, Vector2i(p_glyph.font_size, p_outline_size), p_glyph.index); + texs = TS->font_get_glyph_texture_size(p_glyph.font_rid, Vector2i(p_glyph.font_size, p_outline_size), p_glyph.index); } + } else { + gl_sz = TS->get_hex_code_box_size(p_glyph.font_size, p_glyph.index) * pixel_size; + gl_of = Vector2(0, -gl_sz.y); + } - bool msdf = TS->font_is_multichannel_signed_distance_field(p_glyph.font_rid); + if (gl_uv.size.x <= 2 || gl_uv.size.y <= 2) { + r_offset.x += p_glyph.advance * pixel_size * p_glyph.repeat; // Nothing to draw. + return; + } + bool msdf = TS->font_is_multichannel_signed_distance_field(p_glyph.font_rid); + + for (int j = 0; j < p_glyph.repeat; j++) { SurfaceKey key = SurfaceKey(tex.get_id(), p_priority, p_outline_size); if (!surfaces.has(key)) { SurfaceData surf; @@ -420,7 +430,7 @@ void Label3D::_generate_glyph_surfaces(const Glyph &p_glyph, Vector2 &r_offset, } } - if (tex != RID()) { + if (tex.is_valid()) { s.mesh_uvs.write[(s.offset * 4) + 3] = Vector2(gl_uv.position.x / texs.x, (gl_uv.position.y + gl_uv.size.y) / texs.y); s.mesh_uvs.write[(s.offset * 4) + 2] = Vector2((gl_uv.position.x + gl_uv.size.x) / texs.x, (gl_uv.position.y + gl_uv.size.y) / texs.y); s.mesh_uvs.write[(s.offset * 4) + 1] = Vector2((gl_uv.position.x + gl_uv.size.x) / texs.x, gl_uv.position.y / texs.y); diff --git a/scene/3d/lightmap_gi.cpp b/scene/3d/lightmap_gi.cpp index 4ba039becd..76933cd956 100644 --- a/scene/3d/lightmap_gi.cpp +++ b/scene/3d/lightmap_gi.cpp @@ -1523,7 +1523,7 @@ PackedStringArray LightmapGI::get_configuration_warnings() const { PackedStringArray warnings = Node::get_configuration_warnings(); if (OS::get_singleton()->get_current_rendering_method() == "gl_compatibility") { - warnings.push_back(RTR("LightmapGI nodes are not supported when using the GL Compatibility backend yet. Support will be added in a future release.")); + warnings.push_back(RTR("Lightmap cannot be baked when using the GL Compatibility backend yet. Support will be added in a future release.")); return warnings; } diff --git a/scene/3d/navigation_agent_3d.cpp b/scene/3d/navigation_agent_3d.cpp index b311495a7f..b67935018c 100644 --- a/scene/3d/navigation_agent_3d.cpp +++ b/scene/3d/navigation_agent_3d.cpp @@ -299,7 +299,6 @@ void NavigationAgent3D::_notification(int p_what) { NavigationServer3D::get_singleton()->agent_set_velocity_forced(agent, velocity_forced); } } - _check_distance_to_target(); } #ifdef DEBUG_ENABLED if (debug_path_dirty) { @@ -327,6 +326,14 @@ NavigationAgent3D::NavigationAgent3D() { NavigationServer3D::get_singleton()->agent_set_radius(agent, radius); NavigationServer3D::get_singleton()->agent_set_height(agent, height); NavigationServer3D::get_singleton()->agent_set_max_speed(agent, max_speed); + NavigationServer3D::get_singleton()->agent_set_avoidance_layers(agent, avoidance_layers); + NavigationServer3D::get_singleton()->agent_set_avoidance_mask(agent, avoidance_mask); + NavigationServer3D::get_singleton()->agent_set_avoidance_priority(agent, avoidance_priority); + NavigationServer3D::get_singleton()->agent_set_use_3d_avoidance(agent, use_3d_avoidance); + NavigationServer3D::get_singleton()->agent_set_avoidance_enabled(agent, avoidance_enabled); + if (avoidance_enabled) { + NavigationServer3D::get_singleton()->agent_set_avoidance_callback(agent, callable_mp(this, &NavigationAgent3D::_avoidance_done)); + } // Preallocate query and result objects to improve performance. navigation_query = Ref<NavigationPathQueryParameters3D>(); @@ -335,12 +342,6 @@ NavigationAgent3D::NavigationAgent3D() { navigation_result = Ref<NavigationPathQueryResult3D>(); navigation_result.instantiate(); - set_avoidance_layers(avoidance_layers); - set_avoidance_mask(avoidance_mask); - set_avoidance_priority(avoidance_priority); - set_use_3d_avoidance(use_3d_avoidance); - set_avoidance_enabled(avoidance_enabled); - #ifdef DEBUG_ENABLED NavigationServer3D::get_singleton()->connect(SNAME("navigation_debug_changed"), callable_mp(this, &NavigationAgent3D::_navigation_debug_changed)); #endif // DEBUG_ENABLED @@ -620,7 +621,7 @@ Vector3 NavigationAgent3D::get_target_position() const { } Vector3 NavigationAgent3D::get_next_path_position() { - update_navigation(); + _update_navigation(); const Vector<Vector3> &navigation_path = navigation_result->get_path(); if (navigation_path.size() == 0) { @@ -641,22 +642,30 @@ bool NavigationAgent3D::is_target_reached() const { } bool NavigationAgent3D::is_target_reachable() { - return target_desired_distance >= get_final_position().distance_to(target_position); + _update_navigation(); + return _is_target_reachable(); +} + +bool NavigationAgent3D::_is_target_reachable() const { + return target_desired_distance >= _get_final_position().distance_to(target_position); } bool NavigationAgent3D::is_navigation_finished() { - update_navigation(); + _update_navigation(); return navigation_finished; } Vector3 NavigationAgent3D::get_final_position() { - update_navigation(); + _update_navigation(); + return _get_final_position(); +} +Vector3 NavigationAgent3D::_get_final_position() const { const Vector<Vector3> &navigation_path = navigation_result->get_path(); if (navigation_path.size() == 0) { return Vector3(); } - return navigation_path[navigation_path.size() - 1]; + return navigation_path[navigation_path.size() - 1] - Vector3(0, path_height_offset, 0); } void NavigationAgent3D::set_velocity_forced(Vector3 p_velocity) { @@ -691,7 +700,7 @@ PackedStringArray NavigationAgent3D::get_configuration_warnings() const { return warnings; } -void NavigationAgent3D::update_navigation() { +void NavigationAgent3D::_update_navigation() { if (agent_parent == nullptr) { return; } @@ -747,6 +756,7 @@ void NavigationAgent3D::update_navigation() { debug_path_dirty = true; #endif // DEBUG_ENABLED navigation_finished = false; + last_waypoint_reached = false; navigation_path_index = 0; emit_signal(SNAME("path_changed")); } @@ -755,103 +765,147 @@ void NavigationAgent3D::update_navigation() { return; } - // Check if we can advance the navigation path - if (navigation_finished == false) { - // Advances to the next far away position. - const Vector<Vector3> &navigation_path = navigation_result->get_path(); - const Vector<int32_t> &navigation_path_types = navigation_result->get_path_types(); - const TypedArray<RID> &navigation_path_rids = navigation_result->get_path_rids(); - const Vector<int64_t> &navigation_path_owners = navigation_result->get_path_owner_ids(); + // Check if the navigation has already finished. + if (navigation_finished) { + return; + } - while (origin.distance_to(navigation_path[navigation_path_index] - Vector3(0, path_height_offset, 0)) < path_desired_distance) { - Dictionary details; + // Check if we reached the target. + if (_is_within_target_distance(origin)) { + // Emit waypoint_reached in case we also moved within distance of a waypoint. + _advance_waypoints(origin); + _transition_to_target_reached(); + _transition_to_navigation_finished(); + } else { + // Advance waypoints if possible. + _advance_waypoints(origin); + // Keep navigation running even after reaching the last waypoint if the target is reachable. + if (last_waypoint_reached && !_is_target_reachable()) { + _transition_to_navigation_finished(); + } + } +} - const Vector3 waypoint = navigation_path[navigation_path_index]; - details[SNAME("position")] = waypoint; +void NavigationAgent3D::_advance_waypoints(const Vector3 &p_origin) { + if (last_waypoint_reached) { + return; + } - int waypoint_type = -1; - if (path_metadata_flags.has_flag(NavigationPathQueryParameters3D::PathMetadataFlags::PATH_METADATA_INCLUDE_TYPES)) { - const NavigationPathQueryResult3D::PathSegmentType type = NavigationPathQueryResult3D::PathSegmentType(navigation_path_types[navigation_path_index]); + // Advance to the farthest possible waypoint. + while (_is_within_waypoint_distance(p_origin)) { + _trigger_waypoint_reached(); - details[SNAME("type")] = type; - waypoint_type = type; - } + if (_is_last_waypoint()) { + last_waypoint_reached = true; + break; + } - if (path_metadata_flags.has_flag(NavigationPathQueryParameters3D::PathMetadataFlags::PATH_METADATA_INCLUDE_RIDS)) { - details[SNAME("rid")] = navigation_path_rids[navigation_path_index]; - } + _move_to_next_waypoint(); + } +} - if (path_metadata_flags.has_flag(NavigationPathQueryParameters3D::PathMetadataFlags::PATH_METADATA_INCLUDE_OWNERS)) { - const ObjectID waypoint_owner_id = ObjectID(navigation_path_owners[navigation_path_index]); +void NavigationAgent3D::_request_repath() { + navigation_result->reset(); + target_reached = false; + navigation_finished = false; + last_waypoint_reached = false; + update_frame_id = 0; +} - // Get a reference to the owning object. - Object *owner = nullptr; - if (waypoint_owner_id.is_valid()) { - owner = ObjectDB::get_instance(waypoint_owner_id); - } +bool NavigationAgent3D::_is_last_waypoint() const { + return navigation_path_index == navigation_result->get_path().size() - 1; +} - details[SNAME("owner")] = owner; - - if (waypoint_type == NavigationPathQueryResult3D::PATH_SEGMENT_TYPE_LINK) { - const NavigationLink3D *navlink = Object::cast_to<NavigationLink3D>(owner); - if (navlink) { - Vector3 link_global_start_position = navlink->get_global_start_position(); - Vector3 link_global_end_position = navlink->get_global_end_position(); - if (waypoint.distance_to(link_global_start_position) < waypoint.distance_to(link_global_end_position)) { - details[SNAME("link_entry_position")] = link_global_start_position; - details[SNAME("link_exit_position")] = link_global_end_position; - } else { - details[SNAME("link_entry_position")] = link_global_end_position; - details[SNAME("link_exit_position")] = link_global_start_position; - } - } - } - } +void NavigationAgent3D::_move_to_next_waypoint() { + navigation_path_index += 1; +} + +bool NavigationAgent3D::_is_within_waypoint_distance(const Vector3 &p_origin) const { + const Vector<Vector3> &navigation_path = navigation_result->get_path(); + Vector3 waypoint = navigation_path[navigation_path_index] - Vector3(0, path_height_offset, 0); + return p_origin.distance_to(waypoint) < path_desired_distance; +} - // Emit a signal for the waypoint - emit_signal(SNAME("waypoint_reached"), details); +bool NavigationAgent3D::_is_within_target_distance(const Vector3 &p_origin) const { + return p_origin.distance_to(target_position) < target_desired_distance; +} - // Emit a signal if we've reached a navigation link - if (waypoint_type == NavigationPathQueryResult3D::PATH_SEGMENT_TYPE_LINK) { - emit_signal(SNAME("link_reached"), details); - } +void NavigationAgent3D::_trigger_waypoint_reached() { + const Vector<Vector3> &navigation_path = navigation_result->get_path(); + const Vector<int32_t> &navigation_path_types = navigation_result->get_path_types(); + const TypedArray<RID> &navigation_path_rids = navigation_result->get_path_rids(); + const Vector<int64_t> &navigation_path_owners = navigation_result->get_path_owner_ids(); + + Dictionary details; + + const Vector3 waypoint = navigation_path[navigation_path_index]; + details[SNAME("position")] = waypoint; + + int waypoint_type = -1; + if (path_metadata_flags.has_flag(NavigationPathQueryParameters3D::PathMetadataFlags::PATH_METADATA_INCLUDE_TYPES)) { + const NavigationPathQueryResult3D::PathSegmentType type = NavigationPathQueryResult3D::PathSegmentType(navigation_path_types[navigation_path_index]); + + details[SNAME("type")] = type; + waypoint_type = type; + } + + if (path_metadata_flags.has_flag(NavigationPathQueryParameters3D::PathMetadataFlags::PATH_METADATA_INCLUDE_RIDS)) { + details[SNAME("rid")] = navigation_path_rids[navigation_path_index]; + } + + if (path_metadata_flags.has_flag(NavigationPathQueryParameters3D::PathMetadataFlags::PATH_METADATA_INCLUDE_OWNERS)) { + const ObjectID waypoint_owner_id = ObjectID(navigation_path_owners[navigation_path_index]); - // Move to the next waypoint on the list - navigation_path_index += 1; - - // Check to see if we've finished our route - if (navigation_path_index == navigation_path.size()) { - _check_distance_to_target(); - navigation_path_index -= 1; - navigation_finished = true; - target_position_submitted = false; - if (avoidance_enabled) { - NavigationServer3D::get_singleton()->agent_set_position(agent, agent_parent->get_global_transform().origin); - NavigationServer3D::get_singleton()->agent_set_velocity(agent, Vector3(0.0, 0.0, 0.0)); - NavigationServer3D::get_singleton()->agent_set_velocity_forced(agent, Vector3(0.0, 0.0, 0.0)); - stored_y_velocity = 0.0; + // Get a reference to the owning object. + Object *owner = nullptr; + if (waypoint_owner_id.is_valid()) { + owner = ObjectDB::get_instance(waypoint_owner_id); + } + + details[SNAME("owner")] = owner; + + if (waypoint_type == NavigationPathQueryResult3D::PATH_SEGMENT_TYPE_LINK) { + const NavigationLink3D *navlink = Object::cast_to<NavigationLink3D>(owner); + if (navlink) { + Vector3 link_global_start_position = navlink->get_global_start_position(); + Vector3 link_global_end_position = navlink->get_global_end_position(); + if (waypoint.distance_to(link_global_start_position) < waypoint.distance_to(link_global_end_position)) { + details[SNAME("link_entry_position")] = link_global_start_position; + details[SNAME("link_exit_position")] = link_global_end_position; + } else { + details[SNAME("link_entry_position")] = link_global_end_position; + details[SNAME("link_exit_position")] = link_global_start_position; } - emit_signal(SNAME("navigation_finished")); - break; } } } -} -void NavigationAgent3D::_request_repath() { - navigation_result->reset(); - target_reached = false; - navigation_finished = false; - update_frame_id = 0; + // Emit a signal for the waypoint. + emit_signal(SNAME("waypoint_reached"), details); + + // Emit a signal if we've reached a navigation link. + if (waypoint_type == NavigationPathQueryResult3D::PATH_SEGMENT_TYPE_LINK) { + emit_signal(SNAME("link_reached"), details); + } } -void NavigationAgent3D::_check_distance_to_target() { - if (!target_reached) { - if (distance_to_target() < target_desired_distance) { - target_reached = true; - emit_signal(SNAME("target_reached")); - } +void NavigationAgent3D::_transition_to_navigation_finished() { + navigation_finished = true; + target_position_submitted = false; + + if (avoidance_enabled) { + NavigationServer3D::get_singleton()->agent_set_position(agent, agent_parent->get_global_transform().origin); + NavigationServer3D::get_singleton()->agent_set_velocity(agent, Vector3(0.0, 0.0, 0.0)); + NavigationServer3D::get_singleton()->agent_set_velocity_forced(agent, Vector3(0.0, 0.0, 0.0)); + stored_y_velocity = 0.0; } + + emit_signal(SNAME("navigation_finished")); +} + +void NavigationAgent3D::_transition_to_target_reached() { + target_reached = true; + emit_signal(SNAME("target_reached")); } void NavigationAgent3D::set_avoidance_layers(uint32_t p_layers) { diff --git a/scene/3d/navigation_agent_3d.h b/scene/3d/navigation_agent_3d.h index ff0498a2a8..4eaed83149 100644 --- a/scene/3d/navigation_agent_3d.h +++ b/scene/3d/navigation_agent_3d.h @@ -95,6 +95,7 @@ class NavigationAgent3D : public Node { bool target_position_submitted = false; bool target_reached = false; bool navigation_finished = true; + bool last_waypoint_reached = false; // No initialized on purpose uint32_t update_frame_id = 0; @@ -250,9 +251,21 @@ public: float get_debug_path_custom_point_size() const; private: - void update_navigation(); + bool _is_target_reachable() const; + Vector3 _get_final_position() const; + + void _update_navigation(); + void _advance_waypoints(const Vector3 &p_origin); void _request_repath(); - void _check_distance_to_target(); + + bool _is_last_waypoint() const; + void _move_to_next_waypoint(); + bool _is_within_waypoint_distance(const Vector3 &p_origin) const; + bool _is_within_target_distance(const Vector3 &p_origin) const; + + void _trigger_waypoint_reached(); + void _transition_to_navigation_finished(); + void _transition_to_target_reached(); #ifdef DEBUG_ENABLED void _navigation_debug_changed(); diff --git a/scene/3d/navigation_link_3d.cpp b/scene/3d/navigation_link_3d.cpp index 70416ca93b..dc776ebea2 100644 --- a/scene/3d/navigation_link_3d.cpp +++ b/scene/3d/navigation_link_3d.cpp @@ -147,6 +147,8 @@ void NavigationLink3D::_update_debug_mesh() { #endif // DEBUG_ENABLED void NavigationLink3D::_bind_methods() { + ClassDB::bind_method(D_METHOD("get_rid"), &NavigationLink3D::get_rid); + ClassDB::bind_method(D_METHOD("set_enabled", "enabled"), &NavigationLink3D::set_enabled); ClassDB::bind_method(D_METHOD("is_enabled"), &NavigationLink3D::is_enabled); @@ -263,7 +265,13 @@ void NavigationLink3D::_notification(int p_what) { NavigationLink3D::NavigationLink3D() { link = NavigationServer3D::get_singleton()->link_create(); + NavigationServer3D::get_singleton()->link_set_owner_id(link, get_instance_id()); + NavigationServer3D::get_singleton()->link_set_enter_cost(link, enter_cost); + NavigationServer3D::get_singleton()->link_set_travel_cost(link, travel_cost); + NavigationServer3D::get_singleton()->link_set_navigation_layers(link, navigation_layers); + NavigationServer3D::get_singleton()->link_set_bidirectional(link, bidirectional); + NavigationServer3D::get_singleton()->link_set_enabled(link, enabled); set_notify_transform(true); } @@ -284,6 +292,10 @@ NavigationLink3D::~NavigationLink3D() { #endif // DEBUG_ENABLED } +RID NavigationLink3D::get_rid() const { + return link; +} + void NavigationLink3D::set_enabled(bool p_enabled) { if (enabled == p_enabled) { return; diff --git a/scene/3d/navigation_link_3d.h b/scene/3d/navigation_link_3d.h index ec92fb9dd9..1867082811 100644 --- a/scene/3d/navigation_link_3d.h +++ b/scene/3d/navigation_link_3d.h @@ -67,6 +67,8 @@ public: NavigationLink3D(); ~NavigationLink3D(); + RID get_rid() const; + void set_enabled(bool p_enabled); bool is_enabled() const { return enabled; } diff --git a/scene/3d/navigation_obstacle_3d.cpp b/scene/3d/navigation_obstacle_3d.cpp index 95881b1d5a..98cd5efef2 100644 --- a/scene/3d/navigation_obstacle_3d.cpp +++ b/scene/3d/navigation_obstacle_3d.cpp @@ -167,13 +167,11 @@ NavigationObstacle3D::NavigationObstacle3D() { obstacle = NavigationServer3D::get_singleton()->obstacle_create(); NavigationServer3D::get_singleton()->obstacle_set_height(obstacle, height); - - set_radius(radius); - set_height(height); - set_vertices(vertices); - set_avoidance_layers(avoidance_layers); - set_avoidance_enabled(avoidance_enabled); - set_use_3d_avoidance(use_3d_avoidance); + NavigationServer3D::get_singleton()->obstacle_set_radius(obstacle, radius); + NavigationServer3D::get_singleton()->obstacle_set_vertices(obstacle, vertices); + NavigationServer3D::get_singleton()->obstacle_set_avoidance_layers(obstacle, avoidance_layers); + NavigationServer3D::get_singleton()->obstacle_set_use_3d_avoidance(obstacle, use_3d_avoidance); + NavigationServer3D::get_singleton()->obstacle_set_avoidance_enabled(obstacle, avoidance_enabled); #ifdef DEBUG_ENABLED NavigationServer3D::get_singleton()->connect("avoidance_debug_changed", callable_mp(this, &NavigationObstacle3D::_update_fake_agent_radius_debug)); diff --git a/scene/3d/navigation_region_3d.cpp b/scene/3d/navigation_region_3d.cpp index b376a4945e..94c0a2279a 100644 --- a/scene/3d/navigation_region_3d.cpp +++ b/scene/3d/navigation_region_3d.cpp @@ -33,6 +33,10 @@ #include "scene/resources/navigation_mesh_source_geometry_data_3d.h" #include "servers/navigation_server_3d.h" +RID NavigationRegion3D::get_rid() const { + return region; +} + void NavigationRegion3D::set_enabled(bool p_enabled) { if (enabled == p_enabled) { return; @@ -154,7 +158,7 @@ real_t NavigationRegion3D::get_travel_cost() const { } RID NavigationRegion3D::get_region_rid() const { - return region; + return get_rid(); } void NavigationRegion3D::_notification(int p_what) { @@ -275,6 +279,8 @@ PackedStringArray NavigationRegion3D::get_configuration_warnings() const { } void NavigationRegion3D::_bind_methods() { + ClassDB::bind_method(D_METHOD("get_rid"), &NavigationRegion3D::get_rid); + ClassDB::bind_method(D_METHOD("set_navigation_mesh", "navigation_mesh"), &NavigationRegion3D::set_navigation_mesh); ClassDB::bind_method(D_METHOD("get_navigation_mesh"), &NavigationRegion3D::get_navigation_mesh); @@ -410,6 +416,9 @@ NavigationRegion3D::NavigationRegion3D() { NavigationServer3D::get_singleton()->region_set_owner_id(region, get_instance_id()); NavigationServer3D::get_singleton()->region_set_enter_cost(region, get_enter_cost()); NavigationServer3D::get_singleton()->region_set_travel_cost(region, get_travel_cost()); + NavigationServer3D::get_singleton()->region_set_navigation_layers(region, navigation_layers); + NavigationServer3D::get_singleton()->region_set_use_edge_connections(region, use_edge_connections); + NavigationServer3D::get_singleton()->region_set_enabled(region, enabled); #ifdef DEBUG_ENABLED NavigationServer3D::get_singleton()->connect(SNAME("map_changed"), callable_mp(this, &NavigationRegion3D::_navigation_map_changed)); diff --git a/scene/3d/navigation_region_3d.h b/scene/3d/navigation_region_3d.h index 02fe5524b2..fe9ee178ff 100644 --- a/scene/3d/navigation_region_3d.h +++ b/scene/3d/navigation_region_3d.h @@ -73,6 +73,8 @@ protected: #endif // DISABLE_DEPRECATED public: + RID get_rid() const; + void set_enabled(bool p_enabled); bool is_enabled() const; diff --git a/scene/3d/path_3d.cpp b/scene/3d/path_3d.cpp index 6aea063096..e38375d339 100644 --- a/scene/3d/path_3d.cpp +++ b/scene/3d/path_3d.cpp @@ -93,24 +93,63 @@ void Path3D::_update_debug_mesh() { return; } - Vector<Vector3> vertex_array; + real_t interval = 0.1; + const real_t length = curve->get_baked_length(); - for (int i = 1; i < curve->get_point_count(); i++) { - Vector3 line_end = curve->get_point_position(i); - Vector3 line_start = curve->get_point_position(i - 1); - vertex_array.push_back(line_start); - vertex_array.push_back(line_end); + if (length <= CMP_EPSILON) { + RS::get_singleton()->instance_set_visible(debug_instance, false); + return; } - Array mesh_array; - mesh_array.resize(Mesh::ARRAY_MAX); - mesh_array[Mesh::ARRAY_VERTEX] = vertex_array; + const int sample_count = int(length / interval) + 2; + interval = length / (sample_count - 1); + + Vector<Vector3> ribbon; + ribbon.resize(sample_count); + Vector3 *ribbon_ptr = ribbon.ptrw(); + + Vector<Vector3> bones; + bones.resize(sample_count * 4); + Vector3 *bones_ptr = bones.ptrw(); + + for (int i = 0; i < sample_count; i++) { + const Transform3D r = curve->sample_baked_with_rotation(i * interval, true, true); + + const Vector3 p1 = r.origin; + const Vector3 side = r.basis.get_column(0); + const Vector3 up = r.basis.get_column(1); + const Vector3 forward = r.basis.get_column(2); + + // Path3D as a ribbon. + ribbon_ptr[i] = p1; + + // Fish Bone. + const Vector3 p_left = p1 + (side + forward - up * 0.3) * 0.06; + const Vector3 p_right = p1 + (-side + forward - up * 0.3) * 0.06; + + const int bone_idx = i * 4; + + bones_ptr[bone_idx] = p1; + bones_ptr[bone_idx + 1] = p_left; + bones_ptr[bone_idx + 2] = p1; + bones_ptr[bone_idx + 3] = p_right; + } + + Array ribbon_array; + ribbon_array.resize(Mesh::ARRAY_MAX); + ribbon_array[Mesh::ARRAY_VERTEX] = ribbon; + + Array bone_array; + bone_array.resize(Mesh::ARRAY_MAX); + bone_array[Mesh::ARRAY_VERTEX] = bones; debug_mesh->clear_surfaces(); - debug_mesh->add_surface_from_arrays(Mesh::PRIMITIVE_LINES, mesh_array); + debug_mesh->add_surface_from_arrays(Mesh::PRIMITIVE_LINE_STRIP, ribbon_array); + debug_mesh->add_surface_from_arrays(Mesh::PRIMITIVE_LINES, bone_array); RS::get_singleton()->instance_set_base(debug_instance, debug_mesh->get_rid()); RS::get_singleton()->mesh_surface_set_material(debug_mesh->get_rid(), 0, st->get_debug_paths_material()->get_rid()); + RS::get_singleton()->mesh_surface_set_material(debug_mesh->get_rid(), 1, st->get_debug_paths_material()->get_rid()); if (is_inside_tree()) { RS::get_singleton()->instance_set_scenario(debug_instance, get_world_3d()->get_scenario()); RS::get_singleton()->instance_set_transform(debug_instance, get_global_transform()); diff --git a/scene/3d/physics_body_3d.cpp b/scene/3d/physics_body_3d.cpp index e8d05f129f..ed64c16564 100644 --- a/scene/3d/physics_body_3d.cpp +++ b/scene/3d/physics_body_3d.cpp @@ -506,10 +506,14 @@ void RigidBody3D::_body_state_changed(PhysicsDirectBodyState3D *p_state) { if (GDVIRTUAL_IS_OVERRIDDEN(_integrate_forces)) { _sync_body_state(p_state); + Transform3D old_transform = get_global_transform(); GDVIRTUAL_CALL(_integrate_forces, p_state); + Transform3D new_transform = get_global_transform(); - // Update the physics server with any new transform, to prevent it from being overwritten at the sync below. - force_update_transform(); + if (new_transform != old_transform) { + // Update the physics server with the new transform, to prevent it from being overwritten at the sync below. + PhysicsServer3D::get_singleton()->body_set_state(get_rid(), PhysicsServer3D::BODY_STATE_TRANSFORM, new_transform); + } } _sync_body_state(p_state); @@ -2945,10 +2949,14 @@ void PhysicalBone3D::_body_state_changed(PhysicsDirectBodyState3D *p_state) { if (GDVIRTUAL_IS_OVERRIDDEN(_integrate_forces)) { _sync_body_state(p_state); + Transform3D old_transform = get_global_transform(); GDVIRTUAL_CALL(_integrate_forces, p_state); + Transform3D new_transform = get_global_transform(); - // Update the physics server with any new transform, to prevent it from being overwritten at the sync below. - force_update_transform(); + if (new_transform != old_transform) { + // Update the physics server with the new transform, to prevent it from being overwritten at the sync below. + PhysicsServer3D::get_singleton()->body_set_state(get_rid(), PhysicsServer3D::BODY_STATE_TRANSFORM, new_transform); + } } _sync_body_state(p_state); diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp index 920cf22b83..b8b0d31d45 100644 --- a/scene/3d/sprite_3d.cpp +++ b/scene/3d/sprite_3d.cpp @@ -286,6 +286,10 @@ void SpriteBase3D::draw_texture_rect(Ref<Texture2D> p_texture, Rect2 p_dst_rect, } void SpriteBase3D::set_centered(bool p_center) { + if (centered == p_center) { + return; + } + centered = p_center; _queue_redraw(); } @@ -295,6 +299,10 @@ bool SpriteBase3D::is_centered() const { } void SpriteBase3D::set_offset(const Point2 &p_offset) { + if (offset == p_offset) { + return; + } + offset = p_offset; _queue_redraw(); } @@ -304,6 +312,10 @@ Point2 SpriteBase3D::get_offset() const { } void SpriteBase3D::set_flip_h(bool p_flip) { + if (hflip == p_flip) { + return; + } + hflip = p_flip; _queue_redraw(); } @@ -313,6 +325,10 @@ bool SpriteBase3D::is_flipped_h() const { } void SpriteBase3D::set_flip_v(bool p_flip) { + if (vflip == p_flip) { + return; + } + vflip = p_flip; _queue_redraw(); } @@ -322,6 +338,10 @@ bool SpriteBase3D::is_flipped_v() const { } void SpriteBase3D::set_modulate(const Color &p_color) { + if (modulate == p_color) { + return; + } + modulate = p_color; _propagate_color_changed(); _queue_redraw(); @@ -333,6 +353,11 @@ Color SpriteBase3D::get_modulate() const { void SpriteBase3D::set_render_priority(int p_priority) { ERR_FAIL_COND(p_priority < RS::MATERIAL_RENDER_PRIORITY_MIN || p_priority > RS::MATERIAL_RENDER_PRIORITY_MAX); + + if (render_priority == p_priority) { + return; + } + render_priority = p_priority; _queue_redraw(); } @@ -342,6 +367,10 @@ int SpriteBase3D::get_render_priority() const { } void SpriteBase3D::set_pixel_size(real_t p_amount) { + if (pixel_size == p_amount) { + return; + } + pixel_size = p_amount; _queue_redraw(); } @@ -352,6 +381,11 @@ real_t SpriteBase3D::get_pixel_size() const { void SpriteBase3D::set_axis(Vector3::Axis p_axis) { ERR_FAIL_INDEX(p_axis, 3); + + if (axis == p_axis) { + return; + } + axis = p_axis; _queue_redraw(); } @@ -445,6 +479,11 @@ Ref<TriangleMesh> SpriteBase3D::generate_triangle_mesh() const { void SpriteBase3D::set_draw_flag(DrawFlags p_flag, bool p_enable) { ERR_FAIL_INDEX(p_flag, FLAG_MAX); + + if (flags[p_flag] == p_enable) { + return; + } + flags[p_flag] = p_enable; _queue_redraw(); } @@ -456,6 +495,11 @@ bool SpriteBase3D::get_draw_flag(DrawFlags p_flag) const { void SpriteBase3D::set_alpha_cut_mode(AlphaCutMode p_mode) { ERR_FAIL_INDEX(p_mode, ALPHA_CUT_MAX); + + if (alpha_cut == p_mode) { + return; + } + alpha_cut = p_mode; _queue_redraw(); } @@ -465,10 +509,12 @@ SpriteBase3D::AlphaCutMode SpriteBase3D::get_alpha_cut_mode() const { } void SpriteBase3D::set_alpha_hash_scale(float p_hash_scale) { - if (alpha_hash_scale != p_hash_scale) { - alpha_hash_scale = p_hash_scale; - _queue_redraw(); + if (alpha_hash_scale == p_hash_scale) { + return; } + + alpha_hash_scale = p_hash_scale; + _queue_redraw(); } float SpriteBase3D::get_alpha_hash_scale() const { @@ -476,10 +522,12 @@ float SpriteBase3D::get_alpha_hash_scale() const { } void SpriteBase3D::set_alpha_scissor_threshold(float p_threshold) { - if (alpha_scissor_threshold != p_threshold) { - alpha_scissor_threshold = p_threshold; - _queue_redraw(); + if (alpha_scissor_threshold == p_threshold) { + return; } + + alpha_scissor_threshold = p_threshold; + _queue_redraw(); } float SpriteBase3D::get_alpha_scissor_threshold() const { @@ -487,10 +535,12 @@ float SpriteBase3D::get_alpha_scissor_threshold() const { } void SpriteBase3D::set_alpha_antialiasing(BaseMaterial3D::AlphaAntiAliasing p_alpha_aa) { - if (alpha_antialiasing_mode != p_alpha_aa) { - alpha_antialiasing_mode = p_alpha_aa; - _queue_redraw(); + if (alpha_antialiasing_mode == p_alpha_aa) { + return; } + + alpha_antialiasing_mode = p_alpha_aa; + _queue_redraw(); } BaseMaterial3D::AlphaAntiAliasing SpriteBase3D::get_alpha_antialiasing() const { @@ -498,10 +548,12 @@ BaseMaterial3D::AlphaAntiAliasing SpriteBase3D::get_alpha_antialiasing() const { } void SpriteBase3D::set_alpha_antialiasing_edge(float p_edge) { - if (alpha_antialiasing_edge != p_edge) { - alpha_antialiasing_edge = p_edge; - _queue_redraw(); + if (alpha_antialiasing_edge == p_edge) { + return; } + + alpha_antialiasing_edge = p_edge; + _queue_redraw(); } float SpriteBase3D::get_alpha_antialiasing_edge() const { @@ -510,6 +562,11 @@ float SpriteBase3D::get_alpha_antialiasing_edge() const { void SpriteBase3D::set_billboard_mode(StandardMaterial3D::BillboardMode p_mode) { ERR_FAIL_INDEX(p_mode, 3); // Cannot use BILLBOARD_PARTICLES. + + if (billboard_mode == p_mode) { + return; + } + billboard_mode = p_mode; _queue_redraw(); } @@ -519,10 +576,12 @@ StandardMaterial3D::BillboardMode SpriteBase3D::get_billboard_mode() const { } void SpriteBase3D::set_texture_filter(StandardMaterial3D::TextureFilter p_filter) { - if (texture_filter != p_filter) { - texture_filter = p_filter; - _queue_redraw(); + if (texture_filter == p_filter) { + return; } + + texture_filter = p_filter; + _queue_redraw(); } StandardMaterial3D::TextureFilter SpriteBase3D::get_texture_filter() const { @@ -767,9 +826,12 @@ bool Sprite3D::is_region_enabled() const { } void Sprite3D::set_region_rect(const Rect2 &p_region_rect) { - bool changed = region_rect != p_region_rect; + if (region_rect == p_region_rect) { + return; + } + region_rect = p_region_rect; - if (region && changed) { + if (region) { _queue_redraw(); } } @@ -781,10 +843,12 @@ Rect2 Sprite3D::get_region_rect() const { void Sprite3D::set_frame(int p_frame) { ERR_FAIL_INDEX(p_frame, int64_t(vframes) * hframes); - frame = p_frame; + if (frame == p_frame) { + return; + } + frame = p_frame; _queue_redraw(); - emit_signal(SceneStringNames::get_singleton()->frame_changed); } @@ -804,8 +868,16 @@ Vector2i Sprite3D::get_frame_coords() const { } void Sprite3D::set_vframes(int p_amount) { - ERR_FAIL_COND(p_amount < 1); + ERR_FAIL_COND_MSG(p_amount < 1, "Amount of vframes cannot be smaller than 1."); + + if (vframes == p_amount) { + return; + } + vframes = p_amount; + if (frame >= vframes * hframes) { + frame = 0; + } _queue_redraw(); notify_property_list_changed(); } @@ -815,8 +887,27 @@ int Sprite3D::get_vframes() const { } void Sprite3D::set_hframes(int p_amount) { - ERR_FAIL_COND(p_amount < 1); + ERR_FAIL_COND_MSG(p_amount < 1, "Amount of hframes cannot be smaller than 1."); + + if (hframes == p_amount) { + return; + } + + if (vframes > 1) { + // Adjust the frame to fit new sheet dimensions. + int original_column = frame % hframes; + if (original_column >= p_amount) { + // Frame's column was dropped, reset. + frame = 0; + } else { + int original_row = frame / hframes; + frame = original_row * p_amount + original_column; + } + } hframes = p_amount; + if (frame >= vframes * hframes) { + frame = 0; + } _queue_redraw(); notify_property_list_changed(); } diff --git a/scene/animation/animation_mixer.cpp b/scene/animation/animation_mixer.cpp index fb17dae832..da00d1dd7b 100644 --- a/scene/animation/animation_mixer.cpp +++ b/scene/animation/animation_mixer.cpp @@ -445,7 +445,7 @@ bool AnimationMixer::is_active() const { void AnimationMixer::set_root_node(const NodePath &p_path) { root_node = p_path; - clear_caches(); + _clear_caches(); } NodePath AnimationMixer::get_root_node() const { @@ -454,7 +454,7 @@ NodePath AnimationMixer::get_root_node() const { void AnimationMixer::set_deterministic(bool p_deterministic) { deterministic = p_deterministic; - clear_caches(); + _clear_caches(); } bool AnimationMixer::is_deterministic() const { @@ -563,7 +563,7 @@ void AnimationMixer::_clear_audio_streams() { void AnimationMixer::_clear_playing_caches() { for (const TrackCache *E : playing_caches) { if (ObjectDB::get_instance(E->object_id)) { - E->object->call(SNAME("stop")); + E->object->call(SNAME("stop"), true); } } playing_caches.clear(); @@ -638,6 +638,10 @@ bool AnimationMixer::_update_caches() { switch (track_type) { case Animation::TYPE_VALUE: { + // If a value track without a key is cached first, the initial value cannot be determined. + // It is a corner case, but which may cause problems with blending. + ERR_CONTINUE_MSG(anim->track_get_key_count(i) == 0, "AnimationMixer: '" + String(E) + "', Value Track: '" + String(path) + "' must have at least one key to cache for blending."); + TrackCacheValue *track_value = memnew(TrackCacheValue); if (resource.is_valid()) { @@ -654,9 +658,6 @@ bool AnimationMixer::_update_caches() { track = track_value; - // If a value track without a key is cached first, the initial value cannot be determined. - // It is a corner case, but which may cause problems with blending. - ERR_CONTINUE_MSG(anim->track_get_key_count(i) == 0, "AnimationMixer: '" + String(E) + "', Value Track: '" + String(path) + "' must have at least one key to cache for blending."); track_value->init_value = anim->track_get_key_value(i, 0); track_value->init_value.zero(); @@ -667,6 +668,7 @@ bool AnimationMixer::_update_caches() { track_value->init_value = reset_anim->track_get_key_value(rt, 0); } } + } break; case Animation::TYPE_POSITION_3D: case Animation::TYPE_ROTATION_3D: @@ -812,6 +814,7 @@ bool AnimationMixer::_update_caches() { track_bezier->init_value = (reset_anim->track_get_key_value(rt, 0).operator Array())[0]; } } + } break; case Animation::TYPE_AUDIO: { TrackCacheAudio *track_audio = memnew(TrackCacheAudio); @@ -868,43 +871,26 @@ bool AnimationMixer::_update_caches() { track_value->is_continuous |= anim->value_track_get_update_mode(i) != Animation::UPDATE_DISCRETE; track_value->is_using_angle |= anim->track_get_interpolation_type(i) == Animation::INTERPOLATION_LINEAR_ANGLE || anim->track_get_interpolation_type(i) == Animation::INTERPOLATION_CUBIC_ANGLE; - // TODO: Currently, misc type cannot be blended. In the future, - // it should have a separate blend weight, just as bool is converted to 0 and 1. + // TODO: Currently, misc type cannot be blended. + // In the future, it should have a separate blend weight, just as bool is converted to 0 and 1. // Then, it should provide the correct precedence value. + bool skip_update_mode_warning = false; if (track_value->is_continuous) { - switch (track_value->init_value.get_type()) { - case Variant::NIL: - case Variant::STRING_NAME: - case Variant::NODE_PATH: - case Variant::RID: - case Variant::OBJECT: - case Variant::CALLABLE: - case Variant::SIGNAL: - case Variant::DICTIONARY: - case Variant::ARRAY: - case Variant::PACKED_BYTE_ARRAY: - case Variant::PACKED_INT32_ARRAY: - case Variant::PACKED_INT64_ARRAY: - case Variant::PACKED_FLOAT32_ARRAY: - case Variant::PACKED_FLOAT64_ARRAY: - case Variant::PACKED_STRING_ARRAY: - case Variant::PACKED_VECTOR2_ARRAY: - case Variant::PACKED_VECTOR3_ARRAY: - case Variant::PACKED_COLOR_ARRAY: { - WARN_PRINT_ONCE_ED("AnimationMixer: '" + String(E) + "', Value Track: '" + String(path) + "' uses a non-numeric type as key value with UpdateMode.UPDATE_CONTINUOUS. This will not be blended correctly, so it is forced to UpdateMode.UPDATE_DISCRETE."); - track_value->is_continuous = false; - break; - } - default: { - } + if (!Animation::is_variant_interpolatable(track_value->init_value)) { + WARN_PRINT_ONCE_ED("AnimationMixer: '" + String(E) + "', Value Track: '" + String(path) + "' uses a non-numeric type as key value with UpdateMode.UPDATE_CONTINUOUS. This will not be blended correctly, so it is forced to UpdateMode.UPDATE_DISCRETE."); + track_value->is_continuous = false; + skip_update_mode_warning = true; + } + if (track_value->init_value.is_string()) { + WARN_PRINT_ONCE_ED("AnimationMixer: '" + String(E) + "', Value Track: '" + String(path) + "' blends String types. This is an experimental algorithm."); } } - if (was_continuous != track_value->is_continuous) { - WARN_PRINT_ONCE_ED("Value Track: " + String(path) + " has different update modes between some animations may be blended. Blending prioritizes UpdateMode.UPDATE_CONTINUOUS, so the process treat UpdateMode.UPDATE_DISCRETE as UpdateMode.UPDATE_CONTINUOUS with InterpolationType.INTERPOLATION_NEAREST."); + if (!skip_update_mode_warning && was_continuous != track_value->is_continuous) { + WARN_PRINT_ONCE_ED("AnimationMixer: '" + String(E) + "', Value Track: '" + String(path) + "' has different update modes between some animations which may be blended together. Blending prioritizes UpdateMode.UPDATE_CONTINUOUS, so the process treats UpdateMode.UPDATE_DISCRETE as UpdateMode.UPDATE_CONTINUOUS with InterpolationType.INTERPOLATION_NEAREST."); } if (was_using_angle != track_value->is_using_angle) { - WARN_PRINT_ONCE_ED("Value Track: " + String(path) + " has different interpolation types for rotation between some animations may be blended. Blending prioritizes angle interpolation, so the blending result uses the shortest path referenced to the initial (RESET animation) value."); + WARN_PRINT_ONCE_ED("AnimationMixer: '" + String(E) + "', Value Track: '" + String(path) + "' has different interpolation types for rotation between some animations which may be blended together. Blending prioritizes angle interpolation, so the blending result uses the shortest path referenced to the initial (RESET animation) value."); } } @@ -950,9 +936,7 @@ bool AnimationMixer::_update_caches() { void AnimationMixer::_process_animation(double p_delta, bool p_update_only) { _blend_init(); if (_blend_pre_process(p_delta, track_count, track_map)) { - if (!deterministic) { - _blend_calc_total_weight(); - } + _blend_calc_total_weight(); _blend_process(p_delta, p_update_only); _blend_apply(); _blend_post_process(); @@ -1024,7 +1008,8 @@ void AnimationMixer::_blend_init() { } break; case Animation::TYPE_VALUE: { TrackCacheValue *t = static_cast<TrackCacheValue *>(track); - t->value = t->init_value; + t->value = Animation::cast_to_blendwise(t->init_value); + t->element_size = t->init_value.is_string() ? (real_t)(t->init_value.operator String()).length() : 0; } break; case Animation::TYPE_BEZIER: { TrackCacheBezier *t = static_cast<TrackCacheBezier *>(track); @@ -1111,7 +1096,7 @@ void AnimationMixer::_blend_process(double p_delta, bool p_update_only) { ERR_CONTINUE(blend_idx < 0 || blend_idx >= track_count); real_t blend = blend_idx < track_weights.size() ? track_weights[blend_idx] * weight : weight; if (!deterministic) { - // If undeterministic, do normalization. + // If non-deterministic, do normalization. // It would be better to make this if statement outside the for loop, but come here since too much code... if (Math::is_zero_approx(track->total_weight)) { continue; @@ -1434,13 +1419,15 @@ void AnimationMixer::_blend_process(double p_delta, bool p_update_only) { } t->value = Math::fposmod(rot_a + (rot_b - rot_init) * (float)blend, (float)Math_TAU); } else { - if (t->init_value.get_type() == Variant::BOOL) { - value = Animation::subtract_variant(value.operator real_t(), t->init_value.operator real_t()); - t->value = Animation::blend_variant(t->value.operator real_t(), value.operator real_t(), blend); - } else { - value = Animation::subtract_variant(value, t->init_value); - t->value = Animation::blend_variant(t->value, value, blend); + value = Animation::cast_to_blendwise(value); + if (t->init_value.is_array()) { + t->element_size = MAX(t->element_size.operator int(), (value.operator Array()).size()); + } else if (t->init_value.is_string()) { + real_t length = Animation::subtract_variant((real_t)(value.operator Array()).size(), (real_t)(t->init_value.operator String()).length()); + t->element_size = Animation::blend_variant(t->element_size, length, blend); } + value = Animation::subtract_variant(value, Animation::cast_to_blendwise(t->init_value)); + t->value = Animation::blend_variant(t->value, value, blend); } } else { if (seeked) { @@ -1710,10 +1697,23 @@ void AnimationMixer::_blend_apply() { break; // Don't overwrite the value set by UPDATE_DISCRETE. } - if (t->init_value.get_type() == Variant::BOOL) { - t->object->set_indexed(t->subpath, t->value.operator real_t() >= 0.5); - } else { - t->object->set_indexed(t->subpath, t->value); + // Trim unused elements if init array/string is not blended. + if (t->value.is_array()) { + int actual_blended_size = (int)Math::round(Math::abs(t->element_size.operator real_t())); + if (actual_blended_size < (t->value.operator Array()).size()) { + real_t abs_weight = Math::abs(track->total_weight); + if (abs_weight >= 1.0) { + (t->value.operator Array()).resize(actual_blended_size); + } else if (t->init_value.is_string()) { + (t->value.operator Array()).resize(Animation::interpolate_variant((t->init_value.operator String()).length(), actual_blended_size, abs_weight)); + } + } + } + + // t->object isn't safe here, get instance from id (GH-85365). + Object *obj = ObjectDB::get_instance(t->object_id); + if (obj) { + obj->set_indexed(t->subpath, Animation::cast_from_blendwise(t->value, t->init_value.get_type())); } } break; @@ -1789,7 +1789,7 @@ void AnimationMixer::_blend_apply() { void AnimationMixer::_call_object(Object *p_object, const StringName &p_method, const Vector<Variant> &p_params, bool p_deferred) { // Separate function to use alloca() more efficiently - const Variant **argptrs = (const Variant **)alloca(sizeof(const Variant **) * p_params.size()); + const Variant **argptrs = (const Variant **)alloca(sizeof(Variant *) * p_params.size()); const Variant *args = p_params.ptr(); uint32_t argcount = p_params.size(); for (uint32_t i = 0; i < argcount; i++) { @@ -1874,7 +1874,6 @@ bool AnimationMixer::is_reset_on_save_enabled() const { return reset_on_save; } -#ifdef TOOLS_ENABLED bool AnimationMixer::can_apply_reset() const { return has_animation(SceneStringNames::get_singleton()->RESET); } @@ -1935,7 +1934,6 @@ void AnimationMixer::_build_backup_track_cache() { if (asp) { t->object->call(SNAME("set_stream"), Ref<AudioStream>()); } - track = memnew(TrackCache); // Make disable this track cache. } break; default: { } // The rest don't matter. @@ -1965,29 +1963,6 @@ Ref<AnimatedValuesBackup> AnimationMixer::make_backup() { return backup; } -Ref<AnimatedValuesBackup> AnimationMixer::apply_reset(bool p_user_initiated) { - if (!p_user_initiated && dummy) { - return Ref<AnimatedValuesBackup>(); - } - ERR_FAIL_COND_V(!can_apply_reset(), Ref<AnimatedValuesBackup>()); - - Ref<Animation> reset_anim = animation_set[SceneStringNames::get_singleton()->RESET].animation; - ERR_FAIL_COND_V(reset_anim.is_null(), Ref<AnimatedValuesBackup>()); - - Ref<AnimatedValuesBackup> backup_current = make_backup(); - if (p_user_initiated) { - EditorUndoRedoManager *ur = EditorUndoRedoManager::get_singleton(); - ur->create_action(TTR("Animation Apply Reset")); - ur->add_do_method(this, "_reset"); - ur->add_undo_method(this, "_restore", backup_current); - ur->commit_action(); - } else { - reset(); - } - - return backup_current; -} - void AnimationMixer::reset() { ERR_FAIL_COND(!can_apply_reset()); @@ -2011,11 +1986,36 @@ void AnimationMixer::reset() { } void AnimationMixer::restore(const Ref<AnimatedValuesBackup> &p_backup) { + ERR_FAIL_COND(p_backup.is_null()); track_cache = p_backup->get_data(); _blend_apply(); track_cache = HashMap<NodePath, AnimationMixer::TrackCache *>(); cache_valid = false; } + +#ifdef TOOLS_ENABLED +Ref<AnimatedValuesBackup> AnimationMixer::apply_reset(bool p_user_initiated) { + if (!p_user_initiated && dummy) { + return Ref<AnimatedValuesBackup>(); + } + ERR_FAIL_COND_V(!can_apply_reset(), Ref<AnimatedValuesBackup>()); + + Ref<Animation> reset_anim = animation_set[SceneStringNames::get_singleton()->RESET].animation; + ERR_FAIL_COND_V(reset_anim.is_null(), Ref<AnimatedValuesBackup>()); + + Ref<AnimatedValuesBackup> backup_current = make_backup(); + if (p_user_initiated) { + EditorUndoRedoManager *ur = EditorUndoRedoManager::get_singleton(); + ur->create_action(TTR("Animation Apply Reset")); + ur->add_do_method(this, "_reset"); + ur->add_undo_method(this, "_restore", backup_current); + ur->commit_action(); + } else { + reset(); + } + + return backup_current; +} #endif // TOOLS_ENABLED /* -------------------------------------------- */ @@ -2134,6 +2134,9 @@ void AnimationMixer::_bind_methods() { ADD_SIGNAL(MethodInfo(SNAME("animation_finished"), PropertyInfo(Variant::STRING_NAME, "anim_name"))); ADD_SIGNAL(MethodInfo(SNAME("animation_started"), PropertyInfo(Variant::STRING_NAME, "anim_name"))); ADD_SIGNAL(MethodInfo(SNAME("caches_cleared"))); + + ClassDB::bind_method(D_METHOD("_reset"), &AnimationMixer::reset); + ClassDB::bind_method(D_METHOD("_restore", "backup"), &AnimationMixer::restore); } AnimationMixer::AnimationMixer() { @@ -2142,3 +2145,76 @@ AnimationMixer::AnimationMixer() { AnimationMixer::~AnimationMixer() { } + +void AnimatedValuesBackup::set_data(const HashMap<NodePath, AnimationMixer::TrackCache *> p_data) { + clear_data(); + + for (const KeyValue<NodePath, AnimationMixer::TrackCache *> &E : p_data) { + AnimationMixer::TrackCache *track = get_cache_copy(E.value); + if (!track) { + continue; // Some types of tracks do not get a copy and must be ignored. + } + + data.insert(E.key, track); + } +} + +HashMap<NodePath, AnimationMixer::TrackCache *> AnimatedValuesBackup::get_data() const { + HashMap<NodePath, AnimationMixer::TrackCache *> ret; + for (const KeyValue<NodePath, AnimationMixer::TrackCache *> &E : data) { + AnimationMixer::TrackCache *track = get_cache_copy(E.value); + ERR_CONTINUE(!track); // Backup shouldn't contain tracks that cannot be copied, this is a mistake. + + ret.insert(E.key, track); + } + return ret; +} + +void AnimatedValuesBackup::clear_data() { + for (KeyValue<NodePath, AnimationMixer::TrackCache *> &K : data) { + memdelete(K.value); + } + data.clear(); +} + +AnimationMixer::TrackCache *AnimatedValuesBackup::get_cache_copy(AnimationMixer::TrackCache *p_cache) const { + switch (p_cache->type) { + case Animation::TYPE_VALUE: { + AnimationMixer::TrackCacheValue *src = static_cast<AnimationMixer::TrackCacheValue *>(p_cache); + AnimationMixer::TrackCacheValue *tc = memnew(AnimationMixer::TrackCacheValue(*src)); + return tc; + } + + case Animation::TYPE_POSITION_3D: + case Animation::TYPE_ROTATION_3D: + case Animation::TYPE_SCALE_3D: { + AnimationMixer::TrackCacheTransform *src = static_cast<AnimationMixer::TrackCacheTransform *>(p_cache); + AnimationMixer::TrackCacheTransform *tc = memnew(AnimationMixer::TrackCacheTransform(*src)); + return tc; + } + + case Animation::TYPE_BLEND_SHAPE: { + AnimationMixer::TrackCacheBlendShape *src = static_cast<AnimationMixer::TrackCacheBlendShape *>(p_cache); + AnimationMixer::TrackCacheBlendShape *tc = memnew(AnimationMixer::TrackCacheBlendShape(*src)); + return tc; + } + + case Animation::TYPE_BEZIER: { + AnimationMixer::TrackCacheBezier *src = static_cast<AnimationMixer::TrackCacheBezier *>(p_cache); + AnimationMixer::TrackCacheBezier *tc = memnew(AnimationMixer::TrackCacheBezier(*src)); + return tc; + } + + case Animation::TYPE_AUDIO: { + AnimationMixer::TrackCacheAudio *src = static_cast<AnimationMixer::TrackCacheAudio *>(p_cache); + AnimationMixer::TrackCacheAudio *tc = memnew(AnimationMixer::TrackCacheAudio(*src)); + return tc; + } + + case Animation::TYPE_METHOD: + case Animation::TYPE_ANIMATION: { + // Nothing to do here. + } break; + } + return nullptr; +} diff --git a/scene/animation/animation_mixer.h b/scene/animation/animation_mixer.h index 6aa050d1fb..0cd204b384 100644 --- a/scene/animation/animation_mixer.h +++ b/scene/animation/animation_mixer.h @@ -38,14 +38,12 @@ #include "scene/resources/animation_library.h" #include "scene/resources/audio_stream_polyphonic.h" -#ifdef TOOLS_ENABLED class AnimatedValuesBackup; -#endif // TOOLS_ENABLED class AnimationMixer : public Node { GDCLASS(AnimationMixer, Node); -#ifdef TOOLS_ENABLED friend AnimatedValuesBackup; +#ifdef TOOLS_ENABLED bool editing = false; bool dummy = false; #endif // TOOLS_ENABLED @@ -143,6 +141,17 @@ protected: Object *object = nullptr; ObjectID object_id; real_t total_weight = 0.0; + + TrackCache() = default; + TrackCache(const TrackCache &p_other) : + root_motion(p_other.root_motion), + setup_pass(p_other.setup_pass), + type(p_other.type), + object(p_other.object), + object_id(p_other.object_id), + total_weight(p_other.total_weight) {} + + virtual ~TrackCache() {} }; struct TrackCacheTransform : public TrackCache { @@ -161,9 +170,28 @@ protected: Quaternion rot; Vector3 scale; + TrackCacheTransform(const TrackCacheTransform &p_other) : + TrackCache(p_other), +#ifndef _3D_DISABLED + node_3d(p_other.node_3d), + skeleton(p_other.skeleton), +#endif + bone_idx(p_other.bone_idx), + loc_used(p_other.loc_used), + rot_used(p_other.rot_used), + scale_used(p_other.scale_used), + init_loc(p_other.init_loc), + init_rot(p_other.init_rot), + init_scale(p_other.init_scale), + loc(p_other.loc), + rot(p_other.rot), + scale(p_other.scale) { + } + TrackCacheTransform() { type = Animation::TYPE_POSITION_3D; } + ~TrackCacheTransform() {} }; struct RootMotionCache { @@ -177,7 +205,16 @@ protected: float init_value = 0; float value = 0; int shape_index = -1; + + TrackCacheBlendShape(const TrackCacheBlendShape &p_other) : + TrackCache(p_other), + mesh_3d(p_other.mesh_3d), + init_value(p_other.init_value), + value(p_other.value), + shape_index(p_other.shape_index) {} + TrackCacheBlendShape() { type = Animation::TYPE_BLEND_SHAPE; } + ~TrackCacheBlendShape() {} }; struct TrackCacheValue : public TrackCache { @@ -186,20 +223,45 @@ protected: Vector<StringName> subpath; bool is_continuous = false; bool is_using_angle = false; + Variant element_size; + + TrackCacheValue(const TrackCacheValue &p_other) : + TrackCache(p_other), + init_value(p_other.init_value), + value(p_other.value), + subpath(p_other.subpath), + is_continuous(p_other.is_continuous), + is_using_angle(p_other.is_using_angle), + element_size(p_other.element_size) {} + TrackCacheValue() { type = Animation::TYPE_VALUE; } + ~TrackCacheValue() { + // Clear ref to avoid leaking. + init_value = Variant(); + value = Variant(); + } }; struct TrackCacheMethod : public TrackCache { TrackCacheMethod() { type = Animation::TYPE_METHOD; } + ~TrackCacheMethod() {} }; struct TrackCacheBezier : public TrackCache { real_t init_value = 0.0; real_t value = 0.0; Vector<StringName> subpath; + + TrackCacheBezier(const TrackCacheBezier &p_other) : + TrackCache(p_other), + init_value(p_other.init_value), + value(p_other.value), + subpath(p_other.subpath) {} + TrackCacheBezier() { type = Animation::TYPE_BEZIER; } + ~TrackCacheBezier() {} }; // Audio stream information for each audio stream placed on the track. @@ -225,9 +287,16 @@ protected: Ref<AudioStreamPlaybackPolyphonic> audio_stream_playback; HashMap<ObjectID, PlayingAudioTrackInfo> playing_streams; // Key is Animation resource ObjectID. + TrackCacheAudio(const TrackCacheAudio &p_other) : + TrackCache(p_other), + audio_stream(p_other.audio_stream), + audio_stream_playback(p_other.audio_stream_playback), + playing_streams(p_other.playing_streams) {} + TrackCacheAudio() { type = Animation::TYPE_AUDIO; } + ~TrackCacheAudio() {} }; struct TrackCacheAnimation : public TrackCache { @@ -236,6 +305,7 @@ protected: TrackCacheAnimation() { type = Animation::TYPE_ANIMATION; } + ~TrackCacheAnimation() {} }; RootMotionCache root_motion_cache; @@ -350,35 +420,40 @@ public: void set_reset_on_save_enabled(bool p_enabled); bool is_reset_on_save_enabled() const; + bool can_apply_reset() const; + void _build_backup_track_cache(); + Ref<AnimatedValuesBackup> make_backup(); + void restore(const Ref<AnimatedValuesBackup> &p_backup); + void reset(); + #ifdef TOOLS_ENABLED + Ref<AnimatedValuesBackup> apply_reset(bool p_user_initiated = false); + void set_editing(bool p_editing); bool is_editing() const; void set_dummy(bool p_dummy); bool is_dummy() const; - - bool can_apply_reset() const; - void _build_backup_track_cache(); - Ref<AnimatedValuesBackup> make_backup(); - Ref<AnimatedValuesBackup> apply_reset(bool p_user_initiated = false); - void restore(const Ref<AnimatedValuesBackup> &p_backup); - void reset(); #endif // TOOLS_ENABLED + AnimationMixer(); ~AnimationMixer(); }; -#ifdef TOOLS_ENABLED class AnimatedValuesBackup : public RefCounted { GDCLASS(AnimatedValuesBackup, RefCounted); HashMap<NodePath, AnimationMixer::TrackCache *> data; public: - void set_data(const HashMap<NodePath, AnimationMixer::TrackCache *> p_data) { data = p_data; }; - HashMap<NodePath, AnimationMixer::TrackCache *> get_data() const { return data; }; + void set_data(const HashMap<NodePath, AnimationMixer::TrackCache *> p_data); + HashMap<NodePath, AnimationMixer::TrackCache *> get_data() const; + void clear_data(); + + AnimationMixer::TrackCache *get_cache_copy(AnimationMixer::TrackCache *p_cache) const; + + ~AnimatedValuesBackup() { clear_data(); } }; -#endif VARIANT_ENUM_CAST(AnimationMixer::AnimationCallbackModeProcess); VARIANT_ENUM_CAST(AnimationMixer::AnimationCallbackModeMethod); diff --git a/scene/animation/animation_node_state_machine.cpp b/scene/animation/animation_node_state_machine.cpp index dd5ff7912f..f4e1b3615c 100644 --- a/scene/animation/animation_node_state_machine.cpp +++ b/scene/animation/animation_node_state_machine.cpp @@ -860,7 +860,7 @@ double AnimationNodeStateMachinePlayback::_process(const String &p_base_path, An pi.time = 0; pi.seeked = true; } - fading_from_rem = p_state_machine->blend_node(p_state_machine->states[fading_from].node, fading_from, pi, AnimationNode::FILTER_IGNORE, true); // Blend values must be more than CMP_EPSILON to process discrete keys in edge. + fading_from_rem = p_state_machine->blend_node(p_state_machine->states[fading_from].node, fading_from, pi, AnimationNode::FILTER_IGNORE, true, p_test_only); // Blend values must be more than CMP_EPSILON to process discrete keys in edge. // Guess playback position. if (fading_from_rem > len_fade_from) { /// Weird but ok. @@ -976,7 +976,7 @@ bool AnimationNodeStateMachinePlayback::_transition_to_next_recursive(AnimationT pi.seeked = true; pi.is_external_seeking = false; pi.weight = 0; - p_state_machine->blend_node(p_state_machine->states[current].node, current, pi, AnimationNode::FILTER_IGNORE, true); + p_state_machine->blend_node(p_state_machine->states[current].node, current, pi, AnimationNode::FILTER_IGNORE, true, p_test_only); } // Just get length to find next recursive. diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index df7044d005..02b74c9188 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -151,7 +151,7 @@ void AnimationPlayer::_notification(int p_what) { if (!Engine::get_singleton()->is_editor_hint() && animation_set.has(autoplay)) { set_active(true); play(autoplay); - seek(0, true); + _check_immediately_after_start(); } } break; } @@ -233,7 +233,7 @@ void AnimationPlayer::_process_playback_data(PlaybackData &cd, double p_delta, f pi.delta = delta; pi.seeked = p_seeked; } - pi.is_external_seeking = false; + pi.is_external_seeking = true; // AnimationPlayer doesn't have internal seeking. pi.looped_flag = looped_flag; pi.weight = p_blend; make_animation_instance(cd.from->name, pi); @@ -522,8 +522,9 @@ void AnimationPlayer::seek(double p_time, bool p_update, bool p_update_only) { return; } - playback.current.pos = p_time; + _check_immediately_after_start(); + playback.current.pos = p_time; if (!playback.current.from) { if (playback.assigned) { ERR_FAIL_COND_MSG(!animation_set.has(playback.assigned), vformat("Animation not found: %s.", playback.assigned)); @@ -537,6 +538,18 @@ void AnimationPlayer::seek(double p_time, bool p_update, bool p_update_only) { playback.seeked = true; if (p_update) { _process_animation(0, p_update_only); + playback.seeked = false; // If animation was proceeded here, no more seek in internal process. + } +} + +void AnimationPlayer::advance(double p_time) { + _check_immediately_after_start(); + AnimationMixer::advance(p_time); +} + +void AnimationPlayer::_check_immediately_after_start() { + if (playback.started) { + _process_animation(0); // Force process current key for Discrete/Method/Audio/AnimationPlayback. Then, started flag is cleared. } } diff --git a/scene/animation/animation_player.h b/scene/animation/animation_player.h index 51beb67260..74f9323e2b 100644 --- a/scene/animation/animation_player.h +++ b/scene/animation/animation_player.h @@ -111,6 +111,7 @@ private: void _process_playback_data(PlaybackData &cd, double p_delta, float p_blend, bool p_seeked, bool p_started, bool p_is_current = false); void _blend_playback_data(double p_delta, bool p_started); void _stop_internal(bool p_reset, bool p_keep_state); + void _check_immediately_after_start(); bool playing = false; @@ -183,6 +184,8 @@ public: void get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const override; + virtual void advance(double p_time) override; + AnimationPlayer(); ~AnimationPlayer(); }; diff --git a/scene/animation/animation_tree.cpp b/scene/animation/animation_tree.cpp index bdadc4ecac..da0687dd70 100644 --- a/scene/animation/animation_tree.cpp +++ b/scene/animation/animation_tree.cpp @@ -33,6 +33,7 @@ #include "animation_blend_tree.h" #include "core/config/engine.h" +#include "scene/animation/animation_player.h" #include "scene/scene_string_names.h" void AnimationNode::get_parameter_list(List<PropertyInfo> *r_list) const { @@ -100,9 +101,9 @@ void AnimationNode::blend_animation(const StringName &p_animation, AnimationMixe process_state->tree->make_animation_instance(p_animation, p_playback_info); } -double AnimationNode::_pre_process(ProcessState *p_process_state, AnimationMixer::PlaybackInfo p_playback_info) { +double AnimationNode::_pre_process(ProcessState *p_process_state, AnimationMixer::PlaybackInfo p_playback_info, bool p_test_only) { process_state = p_process_state; - double t = process(p_playback_info); + double t = process(p_playback_info, p_test_only); process_state = nullptr; return t; } @@ -152,7 +153,7 @@ double AnimationNode::blend_input(int p_input, AnimationMixer::PlaybackInfo p_pl } double AnimationNode::blend_node(Ref<AnimationNode> p_node, const StringName &p_subpath, AnimationMixer::PlaybackInfo p_playback_info, FilterAction p_filter, bool p_sync, bool p_test_only) { - node_state.connections.clear(); + p_node->node_state.connections.clear(); return _blend_node(p_node, p_subpath, this, p_playback_info, p_filter, p_sync, p_test_only, nullptr); } @@ -269,9 +270,9 @@ double AnimationNode::_blend_node(Ref<AnimationNode> p_node, const StringName &p p_node->node_state.parent = new_parent; if (!p_playback_info.seeked && !p_sync && !any_valid) { p_playback_info.time = 0.0; - return p_node->_pre_process(process_state, p_playback_info); + return p_node->_pre_process(process_state, p_playback_info, p_test_only); } - return p_node->_pre_process(process_state, p_playback_info); + return p_node->_pre_process(process_state, p_playback_info, p_test_only); } String AnimationNode::get_caption() const { @@ -565,12 +566,12 @@ bool AnimationTree::_blend_pre_process(double p_delta, int p_track_count, const if (started) { // If started, seek. pi.seeked = true; - root_animation_node->_pre_process(&process_state, pi); + root_animation_node->_pre_process(&process_state, pi, false); started = false; - } else { - pi.time = p_delta; - root_animation_node->_pre_process(&process_state, pi); } + pi.seeked = false; + pi.time = p_delta; + root_animation_node->_pre_process(&process_state, pi, false); } if (!process_state.valid) { @@ -764,15 +765,16 @@ void AnimationTree::_setup_animation_player() { return; } - AnimationMixer *mixer = Object::cast_to<AnimationMixer>(get_node_or_null(animation_player)); - if (mixer) { - if (!mixer->is_connected(SNAME("caches_cleared"), callable_mp(this, &AnimationTree::_setup_animation_player))) { - mixer->connect(SNAME("caches_cleared"), callable_mp(this, &AnimationTree::_setup_animation_player), CONNECT_DEFERRED); + // Using AnimationPlayer here is for compatibility. Changing to AnimationMixer needs extra work like error handling. + AnimationPlayer *player = Object::cast_to<AnimationPlayer>(get_node_or_null(animation_player)); + if (player) { + if (!player->is_connected(SNAME("caches_cleared"), callable_mp(this, &AnimationTree::_setup_animation_player))) { + player->connect(SNAME("caches_cleared"), callable_mp(this, &AnimationTree::_setup_animation_player), CONNECT_DEFERRED); } - if (!mixer->is_connected(SNAME("animation_list_changed"), callable_mp(this, &AnimationTree::_setup_animation_player))) { - mixer->connect(SNAME("animation_list_changed"), callable_mp(this, &AnimationTree::_setup_animation_player), CONNECT_DEFERRED); + if (!player->is_connected(SNAME("animation_list_changed"), callable_mp(this, &AnimationTree::_setup_animation_player))) { + player->connect(SNAME("animation_list_changed"), callable_mp(this, &AnimationTree::_setup_animation_player), CONNECT_DEFERRED); } - Node *root = mixer->get_node_or_null(mixer->get_root_node()); + Node *root = player->get_node_or_null(player->get_root_node()); if (root) { set_root_node(get_path_to(root, true)); } @@ -780,9 +782,9 @@ void AnimationTree::_setup_animation_player() { remove_animation_library(animation_libraries[0].name); } List<StringName> list; - mixer->get_animation_library_list(&list); + player->get_animation_library_list(&list); for (int i = 0; i < list.size(); i++) { - Ref<AnimationLibrary> lib = mixer->get_animation_library(list[i]); + Ref<AnimationLibrary> lib = player->get_animation_library(list[i]); if (lib.is_valid()) { add_animation_library(list[i], lib); } @@ -799,6 +801,9 @@ void AnimationTree::_validate_property(PropertyInfo &p_property) const { if (p_property.name == "root_node" || p_property.name.begins_with("libraries")) { p_property.usage |= PROPERTY_USAGE_READ_ONLY; } + if (p_property.name.begins_with("libraries")) { + p_property.usage &= ~PROPERTY_USAGE_STORAGE; + } } } diff --git a/scene/animation/animation_tree.h b/scene/animation/animation_tree.h index 0be487d3fd..87928e4d20 100644 --- a/scene/animation/animation_tree.h +++ b/scene/animation/animation_tree.h @@ -85,7 +85,7 @@ public: void _set_filters(const Array &p_filters); friend class AnimationNodeBlendTree; double _blend_node(Ref<AnimationNode> p_node, const StringName &p_subpath, AnimationNode *p_new_parent, AnimationMixer::PlaybackInfo p_playback_info, FilterAction p_filter = FILTER_IGNORE, bool p_sync = true, bool p_test_only = false, real_t *r_activity = nullptr); - double _pre_process(ProcessState *p_process_state, AnimationMixer::PlaybackInfo p_playback_info); + double _pre_process(ProcessState *p_process_state, AnimationMixer::PlaybackInfo p_playback_info, bool p_test_only = false); protected: virtual double _process(const AnimationMixer::PlaybackInfo p_playback_info, bool p_test_only = false); diff --git a/scene/animation/tween.cpp b/scene/animation/tween.cpp index 32028bcf28..8193bbf3f1 100644 --- a/scene/animation/tween.cpp +++ b/scene/animation/tween.cpp @@ -420,13 +420,8 @@ Variant Tween::interpolate_variant(const Variant &p_initial_val, const Variant & ERR_FAIL_INDEX_V(p_trans, TransitionType::TRANS_MAX, Variant()); ERR_FAIL_INDEX_V(p_ease, EaseType::EASE_MAX, Variant()); - // Special case for bool. - if (p_initial_val.get_type() == Variant::BOOL) { - return run_equation(p_trans, p_ease, p_time, p_initial_val, p_delta_val, p_duration) >= 0.5; - } - Variant ret = Animation::add_variant(p_initial_val, p_delta_val); - ret = Animation::interpolate_variant(p_initial_val, ret, run_equation(p_trans, p_ease, p_time, 0.0, 1.0, p_duration)); + ret = Animation::interpolate_variant(p_initial_val, ret, run_equation(p_trans, p_ease, p_time, 0.0, 1.0, p_duration), p_initial_val.is_string()); return ret; } @@ -554,9 +549,12 @@ void PropertyTweener::start() { return; } - if (do_continue && Math::is_zero_approx(delay)) { - initial_val = target_instance->get_indexed(property); - do_continue = false; + if (do_continue) { + if (Math::is_zero_approx(delay)) { + initial_val = target_instance->get_indexed(property); + } else { + do_continue_delayed = true; + } } if (relative) { @@ -581,10 +579,10 @@ bool PropertyTweener::step(double &r_delta) { if (elapsed_time < delay) { r_delta = 0; return true; - } else if (do_continue && !Math::is_zero_approx(delay)) { + } else if (do_continue_delayed && !Math::is_zero_approx(delay)) { initial_val = target_instance->get_indexed(property); delta_val = Animation::subtract_variant(final_val, initial_val); - do_continue = false; + do_continue_delayed = false; } double time = MIN(elapsed_time - delay, duration); diff --git a/scene/animation/tween.h b/scene/animation/tween.h index 10c7a272ef..053b4fac46 100644 --- a/scene/animation/tween.h +++ b/scene/animation/tween.h @@ -225,6 +225,7 @@ private: double delay = 0; bool do_continue = true; + bool do_continue_delayed = false; bool relative = false; }; diff --git a/scene/debugger/scene_debugger.cpp b/scene/debugger/scene_debugger.cpp index 79cd1056dd..5603b2dbe4 100644 --- a/scene/debugger/scene_debugger.cpp +++ b/scene/debugger/scene_debugger.cpp @@ -72,6 +72,11 @@ void SceneDebugger::deinitialize() { } } +#ifdef MINGW_ENABLED +#undef near +#undef far +#endif + #ifdef DEBUG_ENABLED Error SceneDebugger::parse_message(void *p_user, const String &p_msg, const Array &p_args, bool &r_captured) { SceneTree *scene_tree = SceneTree::get_singleton(); diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index f250662be0..1d5c1c0ade 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -74,7 +74,7 @@ void ColorPicker::_notification(int p_what) { sliders[i]->add_theme_constant_override(SNAME("center_grabber"), theme_cache.center_slider_grabbers); } alpha_label->set_custom_minimum_size(Size2(theme_cache.label_width, 0)); - alpha_label->add_theme_constant_override(SNAME("center_grabber"), theme_cache.center_slider_grabbers); + alpha_slider->add_theme_constant_override(SNAME("center_grabber"), theme_cache.center_slider_grabbers); for (int i = 0; i < MODE_BUTTON_COUNT; i++) { mode_btns[i]->begin_bulk_theme_override(); @@ -556,16 +556,17 @@ void ColorPicker::_html_submitted(const String &p_html) { return; } - const Color previous_color = color; - color = Color::from_string(p_html.strip_edges(), previous_color); + Color new_color = Color::from_string(p_html.strip_edges(), color); if (!is_editing_alpha()) { - color.a = previous_color.a; + new_color.a = color.a; } - if (color == previous_color) { + if (new_color.to_argb32() == color.to_argb32()) { return; } + color = new_color; + if (!is_inside_tree()) { return; } @@ -693,6 +694,12 @@ void ColorPicker::set_picker_shape(PickerShapeType p_shape) { current_shape = p_shape; +#ifdef TOOLS_ENABLED + if (editor_settings) { + editor_settings->call(SNAME("set_project_metadata"), "color_picker", "picker_shape", current_shape); + } +#endif + _copy_color_to_hsv(); _update_controls(); @@ -927,6 +934,12 @@ void ColorPicker::set_color_mode(ColorModeType p_mode) { current_mode = p_mode; +#ifdef TOOLS_ENABLED + if (editor_settings) { + editor_settings->call(SNAME("set_project_metadata"), "color_picker", "color_mode", current_mode); + } +#endif + if (!is_inside_tree()) { return; } diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp index 8dddbf78cf..69023d2056 100644 --- a/scene/gui/graph_edit.cpp +++ b/scene/gui/graph_edit.cpp @@ -2015,7 +2015,7 @@ GraphEdit::GraphEdit() { top_layer->connect("focus_exited", callable_mp(panner.ptr(), &ViewPanner::release_pan_key)); connections_layer = memnew(Control); - add_child(connections_layer, false); + add_child(connections_layer, false, INTERNAL_MODE_FRONT); connections_layer->connect("draw", callable_mp(this, &GraphEdit::_connections_layer_draw)); connections_layer->set_name("_connection_layer"); connections_layer->set_disable_visibility_clip(true); // Necessary, so it can draw freely and be offset. diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp index 2fbd29b048..3df0d97160 100644 --- a/scene/gui/label.cpp +++ b/scene/gui/label.cpp @@ -240,10 +240,12 @@ void Label::_shape() { if (i < jst_to_line) { TS->shaped_text_fit_to_width(lines_rid[i], width, line_jst_flags); } else if (i == (visible_lines - 1)) { + TS->shaped_text_set_custom_ellipsis(lines_rid[i], (el_char.length() > 0) ? el_char[0] : 0x2026); TS->shaped_text_overrun_trim_to_width(lines_rid[i], width, overrun_flags); } } } else if (lines_hidden) { + TS->shaped_text_set_custom_ellipsis(lines_rid[visible_lines - 1], (el_char.length() > 0) ? el_char[0] : 0x2026); TS->shaped_text_overrun_trim_to_width(lines_rid[visible_lines - 1], width, overrun_flags); } } else { @@ -268,9 +270,11 @@ void Label::_shape() { if (i < jst_to_line && horizontal_alignment == HORIZONTAL_ALIGNMENT_FILL) { TS->shaped_text_fit_to_width(lines_rid[i], width, line_jst_flags); overrun_flags.set_flag(TextServer::OVERRUN_JUSTIFICATION_AWARE); + TS->shaped_text_set_custom_ellipsis(lines_rid[i], (el_char.length() > 0) ? el_char[0] : 0x2026); TS->shaped_text_overrun_trim_to_width(lines_rid[i], width, overrun_flags); TS->shaped_text_fit_to_width(lines_rid[i], width, line_jst_flags | TextServer::JUSTIFICATION_CONSTRAIN_ELLIPSIS); } else { + TS->shaped_text_set_custom_ellipsis(lines_rid[i], (el_char.length() > 0) ? el_char[0] : 0x2026); TS->shaped_text_overrun_trim_to_width(lines_rid[i], width, overrun_flags); } } @@ -887,6 +891,27 @@ TextServer::OverrunBehavior Label::get_text_overrun_behavior() const { return overrun_behavior; } +void Label::set_ellipsis_char(const String &p_char) { + String c = p_char; + if (c.length() > 1) { + WARN_PRINT("Ellipsis must be exactly one character long (" + itos(c.length()) + " characters given)."); + c = c.left(1); + } + if (el_char == c) { + return; + } + el_char = c; + lines_dirty = true; + queue_redraw(); + if (clip || overrun_behavior != TextServer::OVERRUN_NO_TRIMMING) { + update_minimum_size(); + } +} + +String Label::get_ellipsis_char() const { + return el_char; +} + String Label::get_text() const { return text; } @@ -1007,6 +1032,8 @@ void Label::_bind_methods() { ClassDB::bind_method(D_METHOD("get_tab_stops"), &Label::get_tab_stops); ClassDB::bind_method(D_METHOD("set_text_overrun_behavior", "overrun_behavior"), &Label::set_text_overrun_behavior); ClassDB::bind_method(D_METHOD("get_text_overrun_behavior"), &Label::get_text_overrun_behavior); + ClassDB::bind_method(D_METHOD("set_ellipsis_char", "char"), &Label::set_ellipsis_char); + ClassDB::bind_method(D_METHOD("get_ellipsis_char"), &Label::get_ellipsis_char); ClassDB::bind_method(D_METHOD("set_uppercase", "enable"), &Label::set_uppercase); ClassDB::bind_method(D_METHOD("is_uppercase"), &Label::is_uppercase); ClassDB::bind_method(D_METHOD("get_line_height", "line"), &Label::get_line_height, DEFVAL(-1)); @@ -1037,6 +1064,7 @@ void Label::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::BOOL, "clip_text"), "set_clip_text", "is_clipping_text"); ADD_PROPERTY(PropertyInfo(Variant::INT, "text_overrun_behavior", PROPERTY_HINT_ENUM, "Trim Nothing,Trim Characters,Trim Words,Ellipsis,Word Ellipsis"), "set_text_overrun_behavior", "get_text_overrun_behavior"); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "ellipsis_char"), "set_ellipsis_char", "get_ellipsis_char"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "uppercase"), "set_uppercase", "is_uppercase"); ADD_PROPERTY(PropertyInfo(Variant::PACKED_FLOAT32_ARRAY, "tab_stops"), "set_tab_stops", "get_tab_stops"); diff --git a/scene/gui/label.h b/scene/gui/label.h index a5126c6b91..44443e3eb4 100644 --- a/scene/gui/label.h +++ b/scene/gui/label.h @@ -45,6 +45,7 @@ private: TextServer::AutowrapMode autowrap_mode = TextServer::AUTOWRAP_OFF; BitField<TextServer::JustificationFlag> jst_flags = TextServer::JUSTIFICATION_WORD_BOUND | TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_SKIP_LAST_LINE | TextServer::JUSTIFICATION_DO_NOT_SKIP_SINGLE_LINE; bool clip = false; + String el_char = U"…"; TextServer::OverrunBehavior overrun_behavior = TextServer::OVERRUN_NO_TRIMMING; Size2 minsize; bool uppercase = false; @@ -147,6 +148,9 @@ public: void set_text_overrun_behavior(TextServer::OverrunBehavior p_behavior); TextServer::OverrunBehavior get_text_overrun_behavior() const; + void set_ellipsis_char(const String &p_char); + String get_ellipsis_char() const; + void set_lines_skipped(int p_lines); int get_lines_skipped() const; diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 5ed1a9d5e3..5cca09bcf6 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -1914,12 +1914,15 @@ bool LineEdit::is_secret() const { } void LineEdit::set_secret_character(const String &p_string) { - if (secret_character == p_string) { + String c = p_string; + if (c.length() > 1) { + WARN_PRINT("Secret character must be exactly one character long (" + itos(c.length()) + " characters given)."); + c = c.left(1); + } + if (secret_character == c) { return; } - - secret_character = p_string; - update_configuration_warnings(); + secret_character = c; _shape(); queue_redraw(); } @@ -2285,14 +2288,8 @@ void LineEdit::_shape() { if (text.length() == 0 && ime_text.length() == 0) { t = placeholder_translated; } else if (pass) { - // TODO: Integrate with text server to add support for non-latin scripts. - // Allow secret_character as empty strings, act like if a space was used as a secret character. - String secret = " "; - // Allow values longer than 1 character in the property, but trim characters after the first one. - if (!secret_character.is_empty()) { - secret = secret_character.left(1); - } - t = secret.repeat(text.length() + ime_text.length()); + String s = (secret_character.length() > 0) ? secret_character.left(1) : U"•"; + t = s.repeat(text.length() + ime_text.length()); } else { if (ime_text.length() > 0) { t = text.substr(0, caret_column) + ime_text + text.substr(caret_column, text.length()); diff --git a/scene/gui/menu_bar.cpp b/scene/gui/menu_bar.cpp index 7418ba7333..7fa2653ed9 100644 --- a/scene/gui/menu_bar.cpp +++ b/scene/gui/menu_bar.cpp @@ -249,11 +249,13 @@ String MenuBar::bind_global_menu() { Vector<PopupMenu *> popups = _get_popups(); for (int i = 0; i < menu_cache.size(); i++) { String submenu_name = popups[i]->bind_global_menu(); - int index = ds->global_menu_add_submenu_item("_main", menu_cache[i].name, submenu_name, global_start_idx + i); - ds->global_menu_set_item_tag("_main", index, global_menu_name + "#" + itos(i)); - ds->global_menu_set_item_hidden("_main", index, menu_cache[i].hidden); - ds->global_menu_set_item_disabled("_main", index, menu_cache[i].disabled); - ds->global_menu_set_item_tooltip("_main", index, menu_cache[i].tooltip); + if (!popups[i]->is_system_menu()) { + int index = ds->global_menu_add_submenu_item("_main", menu_cache[i].name, submenu_name, global_start_idx + i); + ds->global_menu_set_item_tag("_main", index, global_menu_name + "#" + itos(i)); + ds->global_menu_set_item_hidden("_main", index, menu_cache[i].hidden); + ds->global_menu_set_item_disabled("_main", index, menu_cache[i].disabled); + ds->global_menu_set_item_tooltip("_main", index, menu_cache[i].tooltip); + } } return global_menu_name; @@ -268,8 +270,10 @@ void MenuBar::unbind_global_menu() { int global_start = _find_global_start_index(); Vector<PopupMenu *> popups = _get_popups(); for (int i = menu_cache.size() - 1; i >= 0; i--) { - popups[i]->unbind_global_menu(); - ds->global_menu_remove_item("_main", global_start + i); + if (!popups[i]->is_system_menu()) { + popups[i]->unbind_global_menu(); + ds->global_menu_remove_item("_main", global_start + i); + } } global_menu_name = String(); @@ -558,8 +562,10 @@ void MenuBar::add_child_notify(Node *p_child) { if (!global_menu_name.is_empty()) { String submenu_name = pm->bind_global_menu(); - int index = DisplayServer::get_singleton()->global_menu_add_submenu_item("_main", atr(menu.name), submenu_name, _find_global_start_index() + menu_cache.size() - 1); - DisplayServer::get_singleton()->global_menu_set_item_tag("_main", index, global_menu_name + "#" + itos(menu_cache.size() - 1)); + if (!pm->is_system_menu()) { + int index = DisplayServer::get_singleton()->global_menu_add_submenu_item("_main", atr(menu.name), submenu_name, _find_global_start_index() + menu_cache.size() - 1); + DisplayServer::get_singleton()->global_menu_set_item_tag("_main", index, global_menu_name + "#" + itos(menu_cache.size() - 1)); + } } update_minimum_size(); } @@ -587,14 +593,16 @@ void MenuBar::move_child_notify(Node *p_child) { menu_cache.insert(new_idx, menu); if (!global_menu_name.is_empty()) { - int global_start = _find_global_start_index(); - if (old_idx != -1) { - DisplayServer::get_singleton()->global_menu_remove_item("_main", global_start + old_idx); - } - if (new_idx != -1) { - String submenu_name = pm->bind_global_menu(); - int index = DisplayServer::get_singleton()->global_menu_add_submenu_item("_main", atr(menu.name), submenu_name, global_start + new_idx); - DisplayServer::get_singleton()->global_menu_set_item_tag("_main", index, global_menu_name + "#" + itos(new_idx)); + if (!pm->is_system_menu()) { + int global_start = _find_global_start_index(); + if (old_idx != -1) { + DisplayServer::get_singleton()->global_menu_remove_item("_main", global_start + old_idx); + } + if (new_idx != -1) { + String submenu_name = pm->bind_global_menu(); + int index = DisplayServer::get_singleton()->global_menu_add_submenu_item("_main", atr(menu.name), submenu_name, global_start + new_idx); + DisplayServer::get_singleton()->global_menu_set_item_tag("_main", index, global_menu_name + "#" + itos(new_idx)); + } } } } @@ -612,8 +620,10 @@ void MenuBar::remove_child_notify(Node *p_child) { menu_cache.remove_at(idx); if (!global_menu_name.is_empty()) { - pm->unbind_global_menu(); - DisplayServer::get_singleton()->global_menu_remove_item("_main", _find_global_start_index() + idx); + if (!pm->is_system_menu()) { + pm->unbind_global_menu(); + DisplayServer::get_singleton()->global_menu_remove_item("_main", _find_global_start_index() + idx); + } } p_child->remove_meta("_menu_name"); diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp index cf8082d137..d9c633b238 100644 --- a/scene/gui/popup_menu.cpp +++ b/scene/gui/popup_menu.cpp @@ -40,6 +40,8 @@ #include "scene/gui/menu_bar.h" #include "scene/theme/theme_db.h" +HashMap<String, PopupMenu *> PopupMenu::system_menus; + String PopupMenu::bind_global_menu() { #ifdef TOOLS_ENABLED if (is_part_of_edited_scene()) { @@ -54,8 +56,20 @@ String PopupMenu::bind_global_menu() { return global_menu_name; // Already bound; } - DisplayServer *ds = DisplayServer::get_singleton(); global_menu_name = "__PopupMenu#" + itos(get_instance_id()); + if (system_menu_name.length() > 0) { + if (system_menus.has(system_menu_name)) { + WARN_PRINT(vformat("Attempting to bind PopupMenu to the special menu %s, but another menu is already bound to it. This menu: %s, current menu: %s", system_menu_name, this->get_description(), system_menus[system_menu_name]->get_description())); + } else { + const Dictionary &supported_special_names = DisplayServer::get_singleton()->global_menu_get_system_menu_roots(); + if (supported_special_names.has(system_menu_name)) { + system_menus[system_menu_name] = this; + global_menu_name = system_menu_name; + } + } + } + + DisplayServer *ds = DisplayServer::get_singleton(); ds->global_menu_set_popup_callbacks(global_menu_name, callable_mp(this, &PopupMenu::_about_to_popup), callable_mp(this, &PopupMenu::_about_to_close)); for (int i = 0; i < items.size(); i++) { Item &item = items.write[i]; @@ -105,6 +119,10 @@ void PopupMenu::unbind_global_menu() { return; } + if (global_menu_name == system_menu_name && system_menus[system_menu_name] == this) { + system_menus.erase(system_menu_name); + } + for (int i = 0; i < items.size(); i++) { Item &item = items.write[i]; if (!item.submenu.is_empty()) { @@ -120,6 +138,24 @@ void PopupMenu::unbind_global_menu() { global_menu_name = String(); } +bool PopupMenu::is_system_menu() const { + return (global_menu_name == system_menu_name) && (system_menu_name.length() > 0); +} + +void PopupMenu::set_system_menu_root(const String &p_special) { + if (is_inside_tree() && system_menu_name.length() > 0) { + unbind_global_menu(); + } + system_menu_name = p_special; + if (is_inside_tree() && system_menu_name.length() > 0) { + bind_global_menu(); + } +} + +String PopupMenu::get_system_menu_root() const { + return system_menu_name; +} + String PopupMenu::_get_accel_text(const Item &p_item) const { if (p_item.shortcut.is_valid()) { return p_item.shortcut->get_as_text(); @@ -954,6 +990,15 @@ void PopupMenu::_notification(int p_what) { if (!is_embedded()) { set_flag(FLAG_NO_FOCUS, true); } + if (system_menu_name.length() > 0) { + bind_global_menu(); + } + } break; + + case NOTIFICATION_EXIT_TREE: { + if (system_menu_name.length() > 0) { + unbind_global_menu(); + } } break; case NOTIFICATION_THEME_CHANGED: @@ -2723,11 +2768,16 @@ void PopupMenu::_bind_methods() { ClassDB::bind_method(D_METHOD("set_allow_search", "allow"), &PopupMenu::set_allow_search); ClassDB::bind_method(D_METHOD("get_allow_search"), &PopupMenu::get_allow_search); + ClassDB::bind_method(D_METHOD("is_system_menu"), &PopupMenu::is_system_menu); + ClassDB::bind_method(D_METHOD("set_system_menu_root", "special"), &PopupMenu::set_system_menu_root); + ClassDB::bind_method(D_METHOD("get_system_menu_root"), &PopupMenu::get_system_menu_root); + ADD_PROPERTY(PropertyInfo(Variant::BOOL, "hide_on_item_selection"), "set_hide_on_item_selection", "is_hide_on_item_selection"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "hide_on_checkable_item_selection"), "set_hide_on_checkable_item_selection", "is_hide_on_checkable_item_selection"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "hide_on_state_item_selection"), "set_hide_on_state_item_selection", "is_hide_on_state_item_selection"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "submenu_popup_delay", PROPERTY_HINT_NONE, "suffix:s"), "set_submenu_popup_delay", "get_submenu_popup_delay"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "allow_search"), "set_allow_search", "get_allow_search"); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "system_menu_root", PROPERTY_HINT_ENUM, "Dock (macOS):_dock,Apple Menu(macOS):_apple,Window Menu(macOS):_window,Help Menu(macOS):_help"), "set_system_menu_root", "get_system_menu_root"); ADD_ARRAY_COUNT("Items", "item_count", "set_item_count", "get_item_count", "item_"); diff --git a/scene/gui/popup_menu.h b/scene/gui/popup_menu.h index 3e542b5d8b..c1ab9544ea 100644 --- a/scene/gui/popup_menu.h +++ b/scene/gui/popup_menu.h @@ -40,6 +40,8 @@ class PopupMenu : public Popup { GDCLASS(PopupMenu, Popup); + static HashMap<String, PopupMenu *> system_menus; + struct Item { Ref<Texture2D> icon; int icon_max_width = 0; @@ -90,6 +92,7 @@ class PopupMenu : public Popup { }; String global_menu_name; + String system_menu_name; bool close_allowed = false; bool activated_by_keyboard = false; @@ -219,6 +222,9 @@ public: String bind_global_menu(); void unbind_global_menu(); + bool is_system_menu() const; + void set_system_menu_root(const String &p_special); + String get_system_menu_root() const; void add_item(const String &p_label, int p_id = -1, Key p_accel = Key::NONE); void add_icon_item(const Ref<Texture2D> &p_icon, const String &p_label, int p_id = -1, Key p_accel = Key::NONE); diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index dc96f8a594..fbc374e89e 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -1771,7 +1771,7 @@ void RichTextLabel::_scroll_changed(double) { return; } - if (scroll_follow && vscroll->get_value() >= (vscroll->get_max() - vscroll->get_page())) { + if (scroll_follow && vscroll->get_value() >= (vscroll->get_max() - Math::round(vscroll->get_page()))) { scroll_following = true; } else { scroll_following = false; @@ -3121,6 +3121,8 @@ void RichTextLabel::_add_item(Item *p_item, bool p_enter, bool p_ensure_newline) current_char_ofs += t->text.length(); } else if (p_item->type == ITEM_IMAGE) { current_char_ofs++; + } else if (p_item->type == ITEM_NEWLINE) { + current_char_ofs++; } if (p_enter) { @@ -6329,11 +6331,9 @@ Ref<RichTextEffect> RichTextLabel::_get_custom_effect_by_code(String p_bbcode_id Dictionary RichTextLabel::parse_expressions_for_values(Vector<String> p_expressions) { Dictionary d; for (int i = 0; i < p_expressions.size(); i++) { - String expression = p_expressions[i]; - Array a; - Vector<String> parts = expression.split("=", true); - String key = parts[0]; + Vector<String> parts = p_expressions[i].split("=", true); + const String &key = parts[0]; if (parts.size() != 2) { return d; } diff --git a/scene/gui/tab_bar.cpp b/scene/gui/tab_bar.cpp index 777ca96cc4..e9fbdbb312 100644 --- a/scene/gui/tab_bar.cpp +++ b/scene/gui/tab_bar.cpp @@ -1664,7 +1664,7 @@ bool TabBar::_set(const StringName &p_name, const Variant &p_value) { } else if (property == "icon") { set_tab_icon(tab_index, p_value); return true; - } else if (components[1] == "disabled") { + } else if (property == "disabled") { set_tab_disabled(tab_index, p_value); return true; } @@ -1683,7 +1683,7 @@ bool TabBar::_get(const StringName &p_name, Variant &r_ret) const { } else if (property == "icon") { r_ret = get_tab_icon(tab_index); return true; - } else if (components[1] == "disabled") { + } else if (property == "disabled") { r_ret = is_tab_disabled(tab_index); return true; } diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp index aa9400847f..0f461f4865 100644 --- a/scene/gui/tab_container.cpp +++ b/scene/gui/tab_container.cpp @@ -381,22 +381,29 @@ void TabContainer::move_tab_from_tab_container(TabContainer *p_from, int p_from_ // Get the tab properties before they get erased by the child removal. String tab_title = p_from->get_tab_title(p_from_index); Ref<Texture2D> tab_icon = p_from->get_tab_icon(p_from_index); + Ref<Texture2D> tab_button_icon = p_from->get_tab_button_icon(p_from_index); bool tab_disabled = p_from->is_tab_disabled(p_from_index); + bool tab_hidden = p_from->is_tab_hidden(p_from_index); Variant tab_metadata = p_from->get_tab_metadata(p_from_index); + int tab_icon_max_width = p_from->get_tab_bar()->get_tab_icon_max_width(p_from_index); Control *moving_tabc = p_from->get_tab_control(p_from_index); p_from->remove_child(moving_tabc); add_child(moving_tabc, true); - set_tab_title(get_tab_count() - 1, tab_title); - set_tab_icon(get_tab_count() - 1, tab_icon); - set_tab_disabled(get_tab_count() - 1, tab_disabled); - set_tab_metadata(get_tab_count() - 1, tab_metadata); - if (p_to_index < 0 || p_to_index > get_tab_count() - 1) { p_to_index = get_tab_count() - 1; } move_child(moving_tabc, get_tab_control(p_to_index)->get_index(false)); + + set_tab_title(p_to_index, tab_title); + set_tab_icon(p_to_index, tab_icon); + set_tab_button_icon(p_to_index, tab_button_icon); + set_tab_disabled(p_to_index, tab_disabled); + set_tab_hidden(p_to_index, tab_hidden); + set_tab_metadata(p_to_index, tab_metadata); + get_tab_bar()->set_tab_icon_max_width(p_to_index, tab_icon_max_width); + if (!is_tab_disabled(p_to_index)) { set_current_tab(p_to_index); } diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 86e726d9da..308250c592 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -770,7 +770,14 @@ void TextEdit::_notification(int p_what) { Dictionary color_map = _get_line_syntax_highlighting(minimap_line); Color line_background_color = text.get_line_background_color(minimap_line); - line_background_color.a *= 0.6; + + if (line_background_color != theme_cache.background_color) { + // Make non-default background colors more visible, such as error markers. + line_background_color.a = 1.0; + } else { + line_background_color.a *= 0.6; + } + Color current_color = theme_cache.font_color; if (!editable) { current_color = theme_cache.font_readonly_color; @@ -5307,8 +5314,7 @@ int TextEdit::get_line_wrap_index_at_column(int p_line, int p_column) const { Vector<String> lines = get_line_wrapped_text(p_line); for (int i = 0; i < lines.size(); i++) { wrap_index = i; - String s = lines[wrap_index]; - col += s.length(); + col += lines[wrap_index].length(); if (col > p_column) { break; } diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 1d06ce05ae..8a243fd68f 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -70,19 +70,27 @@ void TreeItem::Cell::draw_icon(const RID &p_where, const Point2 &p_pos, const Si } void TreeItem::_changed_notify(int p_cell) { - tree->item_changed(p_cell, this); + if (tree) { + tree->item_changed(p_cell, this); + } } void TreeItem::_changed_notify() { - tree->item_changed(-1, this); + if (tree) { + tree->item_changed(-1, this); + } } void TreeItem::_cell_selected(int p_cell) { - tree->item_selected(p_cell, this); + if (tree) { + tree->item_selected(p_cell, this); + } } void TreeItem::_cell_deselected(int p_cell) { - tree->item_deselected(p_cell, this); + if (tree) { + tree->item_deselected(p_cell, this); + } } void TreeItem::_change_tree(Tree *p_tree) { diff --git a/scene/gui/video_stream_player.cpp b/scene/gui/video_stream_player.cpp index ac09844128..41a210e180 100644 --- a/scene/gui/video_stream_player.cpp +++ b/scene/gui/video_stream_player.cpp @@ -237,6 +237,12 @@ bool VideoStreamPlayer::has_loop() const { void VideoStreamPlayer::set_stream(const Ref<VideoStream> &p_stream) { stop(); + // Make sure to handle stream changes seamlessly, e.g. when done via + // translation remapping. + if (stream.is_valid()) { + stream->disconnect_changed(callable_mp(this, &VideoStreamPlayer::set_stream)); + } + AudioServer::get_singleton()->lock(); mix_buffer.resize(AudioServer::get_singleton()->thread_get_mix_buffer_size()); stream = p_stream; @@ -248,6 +254,10 @@ void VideoStreamPlayer::set_stream(const Ref<VideoStream> &p_stream) { } AudioServer::get_singleton()->unlock(); + if (stream.is_valid()) { + stream->connect_changed(callable_mp(this, &VideoStreamPlayer::set_stream).bind(stream)); + } + if (!playback.is_null()) { playback->set_paused(paused); texture = playback->get_texture(); diff --git a/scene/gui/view_panner.cpp b/scene/gui/view_panner.cpp index fc03f2d887..c61fa1d9b8 100644 --- a/scene/gui/view_panner.cpp +++ b/scene/gui/view_panner.cpp @@ -125,6 +125,17 @@ bool ViewPanner::gui_input(const Ref<InputEvent> &p_event, Rect2 p_canvas_rect) Ref<InputEventPanGesture> pan_gesture = p_event; if (pan_gesture.is_valid()) { + if (pan_gesture->is_ctrl_pressed()) { + // Zoom gesture. + float pan_zoom_factor = 1.02f; + float zoom_direction = pan_gesture->get_delta().x - pan_gesture->get_delta().y; + if (zoom_direction == 0.f) { + return true; + } + float zoom = zoom_direction < 0 ? 1.0 / pan_zoom_factor : pan_zoom_factor; + zoom_callback.call(zoom, pan_gesture->get_position(), p_event); + return true; + } pan_callback.call(-pan_gesture->get_delta() * scroll_speed, p_event); } diff --git a/scene/main/canvas_item.cpp b/scene/main/canvas_item.cpp index d2735b968b..4ee81e5cb0 100644 --- a/scene/main/canvas_item.cpp +++ b/scene/main/canvas_item.cpp @@ -891,18 +891,22 @@ void CanvasItem::_notify_transform(CanvasItem *p_node) { * notification anyway). */ - if (p_node->block_transform_notify || p_node->_is_global_invalid()) { + if (/*p_node->xform_change.in_list() &&*/ p_node->_is_global_invalid()) { return; //nothing to do } p_node->_set_global_invalid(true); - if (p_node->notify_transform && !p_node->xform_change.in_list() && p_node->is_inside_tree()) { - if (is_accessible_from_caller_thread()) { - get_tree()->xform_change_list.add(&p_node->xform_change); - } else { - // Should be rare, but still needs to be handled. - MessageQueue::get_singleton()->push_callable(callable_mp(p_node, &CanvasItem::_notify_transform_deferred)); + if (p_node->notify_transform && !p_node->xform_change.in_list()) { + if (!p_node->block_transform_notify) { + if (p_node->is_inside_tree()) { + if (is_accessible_from_caller_thread()) { + get_tree()->xform_change_list.add(&p_node->xform_change); + } else { + // Should be rare, but still needs to be handled. + MessageQueue::get_singleton()->push_callable(callable_mp(p_node, &CanvasItem::_notify_transform_deferred)); + } + } } } diff --git a/scene/main/node.cpp b/scene/main/node.cpp index e730f47607..820cb7571f 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -202,6 +202,11 @@ void Node::_notification(int p_notification) { _clean_up_owner(); } + while (!data.owned.is_empty()) { + Node *n = data.owned.back()->get(); + n->_clean_up_owner(); // This will change data.owned. So it's impossible to loop over the list in the usual manner. + } + if (data.parent) { data.parent->remove_child(this); } @@ -1415,6 +1420,14 @@ void Node::add_child(Node *p_child, bool p_force_readable_name, InternalMode p_i ERR_FAIL_COND_MSG(data.blocked > 0, "Parent node is busy setting up children, `add_child()` failed. Consider using `add_child.call_deferred(child)` instead."); _validate_child_name(p_child, p_force_readable_name); + +#ifdef DEBUG_ENABLED + if (p_child->data.owner && !p_child->data.owner->is_ancestor_of(p_child)) { + // Owner of p_child should be ancestor of p_child. + WARN_PRINT(vformat("Adding '%s' as child to '%s' will make owner '%s' inconsistent. Consider unsetting the owner beforehand.", p_child->get_name(), get_name(), p_child->data.owner->get_name())); + } +#endif // DEBUG_ENABLED + _add_child_nocheck(p_child, p_child->data.name, p_internal); } @@ -2515,44 +2528,6 @@ Node *Node::_duplicate(int p_flags, HashMap<const Node *, Node *> *r_duplimap) c } } - for (List<const Node *>::Element *N = node_tree.front(); N; N = N->next()) { - Node *current_node = node->get_node(get_path_to(N->get())); - ERR_CONTINUE(!current_node); - - if (p_flags & DUPLICATE_SCRIPTS) { - bool is_valid = false; - Variant scr = N->get()->get(script_property_name, &is_valid); - if (is_valid) { - current_node->set(script_property_name, scr); - } - } - - List<PropertyInfo> plist; - N->get()->get_property_list(&plist); - - for (const PropertyInfo &E : plist) { - if (!(E.usage & PROPERTY_USAGE_STORAGE)) { - continue; - } - String name = E.name; - if (name == script_property_name) { - continue; - } - - Variant value = N->get()->get(name).duplicate(true); - - if (E.usage & PROPERTY_USAGE_ALWAYS_DUPLICATE) { - Resource *res = Object::cast_to<Resource>(value); - if (res) { // Duplicate only if it's a resource - current_node->set(name, res->duplicate()); - } - - } else { - current_node->set(name, value); - } - } - } - if (get_name() != String()) { node->set_name(get_name()); } @@ -2618,6 +2593,62 @@ Node *Node::_duplicate(int p_flags, HashMap<const Node *, Node *> *r_duplimap) c } } + for (List<const Node *>::Element *N = node_tree.front(); N; N = N->next()) { + Node *current_node = node->get_node(get_path_to(N->get())); + ERR_CONTINUE(!current_node); + + if (p_flags & DUPLICATE_SCRIPTS) { + bool is_valid = false; + Variant scr = N->get()->get(script_property_name, &is_valid); + if (is_valid) { + current_node->set(script_property_name, scr); + } + } + + List<PropertyInfo> plist; + N->get()->get_property_list(&plist); + + for (const PropertyInfo &E : plist) { + if (!(E.usage & PROPERTY_USAGE_STORAGE)) { + continue; + } + String name = E.name; + if (name == script_property_name) { + continue; + } + + Variant value = N->get()->get(name).duplicate(true); + + if (E.usage & PROPERTY_USAGE_ALWAYS_DUPLICATE) { + Resource *res = Object::cast_to<Resource>(value); + if (res) { // Duplicate only if it's a resource + current_node->set(name, res->duplicate()); + } + + } else { + // If property points to a node which is owned by a node we are duplicating, update its path. + if (value.get_type() == Variant::OBJECT) { + Node *property_node = Object::cast_to<Node>(value); + if (property_node && is_ancestor_of(property_node)) { + value = current_node->get_node_or_null(get_path_to(property_node)); + } + } else if (value.get_type() == Variant::ARRAY) { + Array arr = value; + if (arr.get_typed_builtin() == Variant::OBJECT) { + for (int i = 0; i < arr.size(); i++) { + Node *property_node = Object::cast_to<Node>(arr[i]); + if (property_node && is_ancestor_of(property_node)) { + arr[i] = current_node->get_node_or_null(get_path_to(property_node)); + } + } + value = arr; + } + } + current_node->set(name, value); + } + } + } + return node; } diff --git a/scene/main/resource_preloader.cpp b/scene/main/resource_preloader.cpp index de42b63548..fe0e82370a 100644 --- a/scene/main/resource_preloader.cpp +++ b/scene/main/resource_preloader.cpp @@ -40,12 +40,11 @@ void ResourcePreloader::_set_resources(const Array &p_data) { ERR_FAIL_COND(names.size() != resdata.size()); for (int i = 0; i < resdata.size(); i++) { - String name = names[i]; Ref<Resource> resource = resdata[i]; ERR_CONTINUE(!resource.is_valid()); - resources[name] = resource; + resources[names[i]] = resource; - //add_resource(name,resource); + //add_resource(names[i],resource); } } diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp index d3347bc304..4417007b9d 100644 --- a/scene/main/scene_tree.cpp +++ b/scene/main/scene_tree.cpp @@ -515,6 +515,10 @@ bool SceneTree::process(double p_time) { _flush_delete_queue(); + if (unlikely(pending_new_scene)) { + _flush_scene_change(); + } + process_timers(p_time, false); //go through timers process_tweens(p_time, false); @@ -550,10 +554,6 @@ bool SceneTree::process(double p_time) { #endif // _3D_DISABLED #endif // TOOLS_ENABLED - if (unlikely(pending_new_scene)) { - _flush_scene_change(); - } - return _quit; } @@ -1302,6 +1302,16 @@ bool SceneTree::has_group(const StringName &p_identifier) const { return group_map.has(p_identifier); } +int SceneTree::get_node_count_in_group(const StringName &p_group) const { + _THREAD_SAFE_METHOD_ + HashMap<StringName, Group>::ConstIterator E = group_map.find(p_group); + if (!E) { + return 0; + } + + return E->value.nodes.size(); +} + Node *SceneTree::get_first_node_in_group(const StringName &p_group) { _THREAD_SAFE_METHOD_ HashMap<StringName, Group>::Iterator E = group_map.find(p_group); @@ -1617,6 +1627,7 @@ void SceneTree::_bind_methods() { ClassDB::bind_method(D_METHOD("get_nodes_in_group", "group"), &SceneTree::_get_nodes_in_group); ClassDB::bind_method(D_METHOD("get_first_node_in_group", "group"), &SceneTree::get_first_node_in_group); + ClassDB::bind_method(D_METHOD("get_node_count_in_group", "group"), &SceneTree::get_node_count_in_group); ClassDB::bind_method(D_METHOD("set_current_scene", "child_node"), &SceneTree::set_current_scene); ClassDB::bind_method(D_METHOD("get_current_scene"), &SceneTree::get_current_scene); diff --git a/scene/main/scene_tree.h b/scene/main/scene_tree.h index e1597d3890..618ac275ff 100644 --- a/scene/main/scene_tree.h +++ b/scene/main/scene_tree.h @@ -385,6 +385,7 @@ public: void get_nodes_in_group(const StringName &p_group, List<Node *> *p_list); Node *get_first_node_in_group(const StringName &p_group); bool has_group(const StringName &p_identifier) const; + int get_node_count_in_group(const StringName &p_group) const; //void change_scene(const String& p_path); //Node *get_loaded_scene(); diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 43bdb1395b..89ec5636ab 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -2451,6 +2451,14 @@ void Viewport::_gui_update_mouse_over() { return; } + if (gui.sending_mouse_enter_exit_notifications) { + // If notifications are already being sent, delay call to next frame. + if (get_tree() && !get_tree()->is_connected(SNAME("process_frame"), callable_mp(this, &Viewport::_gui_update_mouse_over))) { + get_tree()->connect(SNAME("process_frame"), callable_mp(this, &Viewport::_gui_update_mouse_over), CONNECT_ONE_SHOT); + } + return; + } + // Rebuild the mouse over hierarchy. LocalVector<Control *> new_mouse_over_hierarchy; LocalVector<Control *> needs_enter; @@ -2507,6 +2515,8 @@ void Viewport::_gui_update_mouse_over() { return; } + gui.sending_mouse_enter_exit_notifications = true; + // Send Mouse Exit Self notification. if (gui.mouse_over && !needs_exit.is_empty() && needs_exit[0] == (int)gui.mouse_over_hierarchy.size() - 1) { gui.mouse_over->notification(Control::NOTIFICATION_MOUSE_EXIT_SELF); @@ -2528,6 +2538,8 @@ void Viewport::_gui_update_mouse_over() { for (int i = needs_enter.size() - 1; i >= 0; i--) { needs_enter[i]->notification(Control::NOTIFICATION_MOUSE_ENTER); } + + gui.sending_mouse_enter_exit_notifications = false; } Window *Viewport::get_base_window() const { @@ -3200,14 +3212,20 @@ void Viewport::_update_mouse_over(Vector2 p_pos) { gui.mouse_over = over; gui.mouse_over_hierarchy.reserve(gui.mouse_over_hierarchy.size() + over_ancestors.size()); + gui.sending_mouse_enter_exit_notifications = true; + // Send Mouse Enter notifications to parents first. for (int i = over_ancestors.size() - 1; i >= 0; i--) { - over_ancestors[i]->notification(Control::NOTIFICATION_MOUSE_ENTER); gui.mouse_over_hierarchy.push_back(over_ancestors[i]); + over_ancestors[i]->notification(Control::NOTIFICATION_MOUSE_ENTER); } // Send Mouse Enter Self notification. - gui.mouse_over->notification(Control::NOTIFICATION_MOUSE_ENTER_SELF); + if (gui.mouse_over) { + gui.mouse_over->notification(Control::NOTIFICATION_MOUSE_ENTER_SELF); + } + + gui.sending_mouse_enter_exit_notifications = false; notify_embedded_viewports = true; } @@ -3250,6 +3268,12 @@ void Viewport::_mouse_leave_viewport() { } void Viewport::_drop_mouse_over(Control *p_until_control) { + if (gui.sending_mouse_enter_exit_notifications) { + // If notifications are already being sent, defer call. + callable_mp(this, &Viewport::_drop_mouse_over).call_deferred(p_until_control); + return; + } + _gui_cancel_tooltip(); SubViewportContainer *c = Object::cast_to<SubViewportContainer>(gui.mouse_over); if (c) { @@ -3261,6 +3285,8 @@ void Viewport::_drop_mouse_over(Control *p_until_control) { v->_mouse_leave_viewport(); } } + + gui.sending_mouse_enter_exit_notifications = true; if (gui.mouse_over && gui.mouse_over->is_inside_tree()) { gui.mouse_over->notification(Control::NOTIFICATION_MOUSE_EXIT_SELF); } @@ -3274,6 +3300,7 @@ void Viewport::_drop_mouse_over(Control *p_until_control) { } } gui.mouse_over_hierarchy.resize(notification_until); + gui.sending_mouse_enter_exit_notifications = false; } void Viewport::push_input(const Ref<InputEvent> &p_event, bool p_local_coords) { @@ -3491,6 +3518,11 @@ Control *Viewport::gui_get_focus_owner() const { return gui.key_focus; } +Control *Viewport::gui_get_hovered_control() const { + ERR_READ_THREAD_GUARD_V(nullptr); + return gui.mouse_over; +} + void Viewport::set_msaa_2d(MSAA p_msaa) { ERR_MAIN_THREAD_GUARD; ERR_FAIL_INDEX(p_msaa, MSAA_MAX); @@ -4530,6 +4562,7 @@ void Viewport::_bind_methods() { ClassDB::bind_method(D_METHOD("gui_release_focus"), &Viewport::gui_release_focus); ClassDB::bind_method(D_METHOD("gui_get_focus_owner"), &Viewport::gui_get_focus_owner); + ClassDB::bind_method(D_METHOD("gui_get_hovered_control"), &Viewport::gui_get_hovered_control); ClassDB::bind_method(D_METHOD("set_disable_input", "disable"), &Viewport::set_disable_input); ClassDB::bind_method(D_METHOD("is_input_disabled"), &Viewport::is_input_disabled); diff --git a/scene/main/viewport.h b/scene/main/viewport.h index 82a9bfc438..43a89c8a0b 100644 --- a/scene/main/viewport.h +++ b/scene/main/viewport.h @@ -362,6 +362,7 @@ private: Control *key_focus = nullptr; Control *mouse_over = nullptr; LocalVector<Control *> mouse_over_hierarchy; + bool sending_mouse_enter_exit_notifications = false; Window *subwindow_over = nullptr; // mouse_over and subwindow_over are mutually exclusive. At all times at least one of them is nullptr. Window *windowmanager_window_over = nullptr; // Only used in root Viewport. Control *drag_mouse_over = nullptr; @@ -609,6 +610,7 @@ public: void gui_release_focus(); Control *gui_get_focus_owner() const; + Control *gui_get_hovered_control() const; PackedStringArray get_configuration_warnings() const override; diff --git a/scene/main/window.cpp b/scene/main/window.cpp index 0d554de6f4..98b207bd3c 100644 --- a/scene/main/window.cpp +++ b/scene/main/window.cpp @@ -284,7 +284,13 @@ void Window::set_title(const String &p_title) { embedder->_sub_window_update(this); } else if (window_id != DisplayServer::INVALID_WINDOW_ID) { DisplayServer::get_singleton()->window_set_title(tr_title, window_id); - _update_window_size(); + if (keep_title_visible) { + Size2i title_size = DisplayServer::get_singleton()->window_get_title_size(tr_title, window_id); + Size2i size_limit = get_clamped_minimum_size(); + if (title_size.x > size_limit.x || title_size.y > size_limit.y) { + _update_window_size(); + } + } } } @@ -681,6 +687,9 @@ void Window::_propagate_window_notification(Node *p_node, int p_notification) { void Window::_event_callback(DisplayServer::WindowEvent p_event) { switch (p_event) { case DisplayServer::WINDOW_EVENT_MOUSE_ENTER: { + if (!is_inside_tree()) { + return; + } Window *root = get_tree()->get_root(); if (root->gui.windowmanager_window_over) { #ifdef DEV_ENABLED @@ -696,6 +705,9 @@ void Window::_event_callback(DisplayServer::WindowEvent p_event) { } } break; case DisplayServer::WINDOW_EVENT_MOUSE_EXIT: { + if (!is_inside_tree()) { + return; + } Window *root = get_tree()->get_root(); if (!root->gui.windowmanager_window_over) { #ifdef DEV_ENABLED @@ -955,6 +967,10 @@ Size2i Window::_clamp_window_size(const Size2i &p_size) { void Window::_update_window_size() { Size2i size_limit = get_clamped_minimum_size(); + if (!embedder && window_id != DisplayServer::INVALID_WINDOW_ID && keep_title_visible) { + Size2i title_size = DisplayServer::get_singleton()->window_get_title_size(tr_title, window_id); + size_limit = size_limit.max(title_size); + } size = size.max(size_limit); @@ -986,12 +1002,6 @@ void Window::_update_window_size() { } DisplayServer::get_singleton()->window_set_max_size(max_size_used, window_id); - - if (keep_title_visible) { - Size2i title_size = DisplayServer::get_singleton()->window_get_title_size(tr_title, window_id); - size_limit = size_limit.max(title_size); - } - DisplayServer::get_singleton()->window_set_min_size(size_limit, window_id); DisplayServer::get_singleton()->window_set_size(size, window_id); } @@ -1291,7 +1301,13 @@ void Window::_notification(int p_what) { if (!embedder && window_id != DisplayServer::INVALID_WINDOW_ID) { DisplayServer::get_singleton()->window_set_title(tr_title, window_id); - _update_window_size(); + if (keep_title_visible) { + Size2i title_size = DisplayServer::get_singleton()->window_get_title_size(tr_title, window_id); + Size2i size_limit = get_clamped_minimum_size(); + if (title_size.x > size_limit.x || title_size.y > size_limit.y) { + _update_window_size(); + } + } } } break; diff --git a/scene/property_utils.cpp b/scene/property_utils.cpp index 063e91df67..090c81aefe 100644 --- a/scene/property_utils.cpp +++ b/scene/property_utils.cpp @@ -74,10 +74,31 @@ Variant PropertyUtils::get_property_default_value(const Object *p_object, const const SceneState::PackState &ia = states_stack[i]; bool found = false; Variant value_in_ancestor = ia.state->get_property_value(ia.node, p_property, found); + const Vector<String> &deferred_properties = ia.state->get_node_deferred_nodepath_properties(ia.node); if (found) { if (r_is_valid) { *r_is_valid = true; } + // Replace properties stored as NodePaths with actual Nodes. + // Otherwise, the property value would be considered as overridden. + if (deferred_properties.has(p_property)) { + if (value_in_ancestor.get_type() == Variant::ARRAY) { + Array paths = value_in_ancestor; + + bool valid = false; + Array array = node->get(p_property, &valid); + ERR_CONTINUE(!valid); + array = array.duplicate(); + + array.resize(paths.size()); + for (int j = 0; j < array.size(); j++) { + array.set(j, node->get_node_or_null(paths[j])); + } + value_in_ancestor = array; + } else { + value_in_ancestor = node->get_node_or_null(value_in_ancestor); + } + } return value_in_ancestor; } // Save script for later diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp index 3727c788fd..2e6759063b 100644 --- a/scene/register_scene_types.cpp +++ b/scene/register_scene_types.cpp @@ -293,6 +293,8 @@ static Ref<ResourceFormatSaverShaderInclude> resource_saver_shader_include; static Ref<ResourceFormatLoaderShaderInclude> resource_loader_shader_include; void register_scene_types() { + OS::get_singleton()->benchmark_begin_measure("Scene", "Register Types"); + SceneStringNames::create(); OS::get_singleton()->yield(); // may take time to init @@ -1182,9 +1184,13 @@ void register_scene_types() { } SceneDebugger::initialize(); + + OS::get_singleton()->benchmark_end_measure("Scene", "Register Types"); } void unregister_scene_types() { + OS::get_singleton()->benchmark_begin_measure("Scene", "Unregister Types"); + SceneDebugger::deinitialize(); ResourceLoader::remove_resource_format_loader(resource_loader_texture_layered); @@ -1227,10 +1233,16 @@ void unregister_scene_types() { CanvasItemMaterial::finish_shaders(); ColorPicker::finish_shaders(); SceneStringNames::free(); + + OS::get_singleton()->benchmark_end_measure("Scene", "Unregister Types"); } void register_scene_singletons() { + OS::get_singleton()->benchmark_begin_measure("Scene", "Register Singletons"); + GDREGISTER_CLASS(ThemeDB); Engine::get_singleton()->add_singleton(Engine::Singleton("ThemeDB", ThemeDB::get_singleton())); + + OS::get_singleton()->benchmark_end_measure("Scene", "Register Singletons"); } diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp index af1f9da2b5..52850cac4a 100644 --- a/scene/resources/animation.cpp +++ b/scene/resources/animation.cpp @@ -5476,469 +5476,638 @@ bool Animation::_fetch_compressed_by_index(uint32_t p_compressed_track, int p_in } // Helper math functions for Variant. +bool Animation::is_variant_interpolatable(const Variant p_value) { + Variant::Type type = p_value.get_type(); + return (type >= Variant::BOOL && type <= Variant::STRING_NAME) || type == Variant::ARRAY || type >= Variant::PACKED_INT32_ARRAY; // PackedByteArray is unsigned, so it would be better to ignore since blending uses float. +} + +Variant Animation::cast_to_blendwise(const Variant p_value) { + switch (p_value.get_type()) { + case Variant::BOOL: + case Variant::INT: { + return p_value.operator double(); + } break; + case Variant::STRING: + case Variant::STRING_NAME: { + return string_to_array(p_value); + } break; + case Variant::RECT2I: { + return p_value.operator Rect2(); + } break; + case Variant::VECTOR2I: { + return p_value.operator Vector2(); + } break; + case Variant::VECTOR3I: { + return p_value.operator Vector3(); + } break; + case Variant::VECTOR4I: { + return p_value.operator Vector4(); + } break; + case Variant::PACKED_INT32_ARRAY: { + return p_value.operator PackedFloat32Array(); + } break; + case Variant::PACKED_INT64_ARRAY: { + return p_value.operator PackedFloat64Array(); + } break; + default: { + } break; + } + return p_value; +} + +Variant Animation::cast_from_blendwise(const Variant p_value, const Variant::Type p_type) { + switch (p_type) { + case Variant::BOOL: { + return p_value.operator real_t() >= 0.5; + } break; + case Variant::INT: { + return (int64_t)Math::round(p_value.operator double()); + } break; + case Variant::STRING: { + return array_to_string(p_value); + } break; + case Variant::STRING_NAME: { + return StringName(array_to_string(p_value)); + } break; + case Variant::RECT2I: { + return Rect2i(p_value.operator Rect2().round()); + } break; + case Variant::VECTOR2I: { + return Vector2i(p_value.operator Vector2().round()); + } break; + case Variant::VECTOR3I: { + return Vector3i(p_value.operator Vector3().round()); + } break; + case Variant::VECTOR4I: { + return Vector4i(p_value.operator Vector4().round()); + } break; + case Variant::PACKED_INT32_ARRAY: { + PackedFloat32Array old_val = p_value.operator PackedFloat32Array(); + PackedInt32Array new_val; + new_val.resize(old_val.size()); + int *new_val_w = new_val.ptrw(); + for (int i = 0; i < old_val.size(); i++) { + new_val_w[i] = (int32_t)Math::round(old_val[i]); + } + return new_val; + } break; + case Variant::PACKED_INT64_ARRAY: { + PackedFloat64Array old_val = p_value.operator PackedFloat64Array(); + PackedInt64Array new_val; + for (int i = 0; i < old_val.size(); i++) { + new_val.push_back((int64_t)Math::round(old_val[i])); + } + return new_val; + } break; + default: { + } break; + } + return p_value; +} + +Variant Animation::string_to_array(const Variant p_value) { + if (!p_value.is_string()) { + return p_value; + }; + const String &str = p_value.operator String(); + PackedFloat32Array arr; + for (int i = 0; i < str.length(); i++) { + arr.push_back((float)str[i]); + } + return arr; +} + +Variant Animation::array_to_string(const Variant p_value) { + if (!p_value.is_array()) { + return p_value; + }; + const PackedFloat32Array &arr = p_value.operator PackedFloat32Array(); + String str; + for (int i = 0; i < arr.size(); i++) { + char32_t c = (char32_t)Math::round(arr[i]); + if (c == 0 || (c & 0xfffff800) == 0xd800 || c > 0x10ffff) { + c = ' '; + } + str += c; + } + return str; +} + Variant Animation::add_variant(const Variant &a, const Variant &b) { if (a.get_type() != b.get_type()) { - return a; + if (a.is_num() && b.is_num()) { + return add_variant(cast_to_blendwise(a), cast_to_blendwise(b)); + } else if (!a.is_array()) { + return a; + } } switch (a.get_type()) { case Variant::NIL: { return Variant(); - } - case Variant::BOOL: { - return (a.operator real_t()) + (b.operator real_t()); // It is cast for interpolation. - } + } break; + case Variant::FLOAT: { + return (a.operator double()) + (b.operator double()); + } break; case Variant::RECT2: { const Rect2 ra = a.operator Rect2(); const Rect2 rb = b.operator Rect2(); return Rect2(ra.position + rb.position, ra.size + rb.size); - } - case Variant::RECT2I: { - const Rect2i ra = a.operator Rect2i(); - const Rect2i rb = b.operator Rect2i(); - return Rect2i(ra.position + rb.position, ra.size + rb.size); - } + } break; case Variant::PLANE: { const Plane pa = a.operator Plane(); const Plane pb = b.operator Plane(); return Plane(pa.normal + pb.normal, pa.d + pb.d); - } + } break; case Variant::AABB: { const ::AABB aa = a.operator ::AABB(); const ::AABB ab = b.operator ::AABB(); return ::AABB(aa.position + ab.position, aa.size + ab.size); - } + } break; case Variant::BASIS: { return (a.operator Basis()) * (b.operator Basis()); - } + } break; case Variant::QUATERNION: { return (a.operator Quaternion()) * (b.operator Quaternion()); - } + } break; case Variant::TRANSFORM2D: { return (a.operator Transform2D()) * (b.operator Transform2D()); - } + } break; case Variant::TRANSFORM3D: { return (a.operator Transform3D()) * (b.operator Transform3D()); - } + } break; + case Variant::INT: + case Variant::RECT2I: + case Variant::VECTOR2I: + case Variant::VECTOR3I: + case Variant::VECTOR4I: + case Variant::PACKED_INT32_ARRAY: + case Variant::PACKED_INT64_ARRAY: { + // Fallback the interpolatable value which needs casting. + return cast_from_blendwise(add_variant(cast_to_blendwise(a), cast_to_blendwise(b)), a.get_type()); + } break; + case Variant::BOOL: + case Variant::STRING: + case Variant::STRING_NAME: { + // Specialized for Tween. + return b; + } break; + case Variant::PACKED_BYTE_ARRAY: { + // Skip. + } break; default: { - return Variant::evaluate(Variant::OP_ADD, a, b); - } + if (a.is_array()) { + const Array arr_a = a.operator Array(); + const Array arr_b = b.operator Array(); + + int min_size = arr_a.size(); + int max_size = arr_b.size(); + bool is_a_larger = inform_variant_array(min_size, max_size); + + Array result; + result.set_typed(MAX(arr_a.get_typed_builtin(), arr_b.get_typed_builtin()), StringName(), Variant()); + result.resize(min_size); + int i = 0; + for (; i < min_size; i++) { + result[i] = add_variant(arr_a[i], arr_b[i]); + } + if (min_size != max_size) { + // Process with last element of the lesser array. + // This is pretty funny and bizarre, but artists like to use it for polygon animation. + Variant lesser_last; + result.resize(max_size); + if (is_a_larger) { + if (i > 0) { + lesser_last = arr_b[i - 1]; + } else { + Variant vz = arr_a[i]; + vz.zero(); + lesser_last = vz; + } + for (; i < max_size; i++) { + result[i] = add_variant(arr_a[i], lesser_last); + } + } else { + if (i > 0) { + lesser_last = arr_a[i - 1]; + } else { + Variant vz = arr_b[i]; + vz.zero(); + lesser_last = vz; + } + for (; i < max_size; i++) { + result[i] = add_variant(lesser_last, arr_b[i]); + } + } + } + return result; + } + } break; } + return Variant::evaluate(Variant::OP_ADD, a, b); } Variant Animation::subtract_variant(const Variant &a, const Variant &b) { if (a.get_type() != b.get_type()) { - return a; + if (a.is_num() && b.is_num()) { + return subtract_variant(cast_to_blendwise(a), cast_to_blendwise(b)); + } else if (!a.is_array()) { + return a; + } } switch (a.get_type()) { case Variant::NIL: { return Variant(); - } - case Variant::BOOL: { - return (a.operator real_t()) - (b.operator real_t()); // It is cast for interpolation. - } + } break; + case Variant::FLOAT: { + return (a.operator double()) - (b.operator double()); + } break; case Variant::RECT2: { const Rect2 ra = a.operator Rect2(); const Rect2 rb = b.operator Rect2(); return Rect2(ra.position - rb.position, ra.size - rb.size); - } - case Variant::RECT2I: { - const Rect2i ra = a.operator Rect2i(); - const Rect2i rb = b.operator Rect2i(); - return Rect2i(ra.position - rb.position, ra.size - rb.size); - } + } break; case Variant::PLANE: { const Plane pa = a.operator Plane(); const Plane pb = b.operator Plane(); return Plane(pa.normal - pb.normal, pa.d - pb.d); - } + } break; case Variant::AABB: { const ::AABB aa = a.operator ::AABB(); const ::AABB ab = b.operator ::AABB(); return ::AABB(aa.position - ab.position, aa.size - ab.size); - } + } break; case Variant::BASIS: { return (b.operator Basis()).inverse() * (a.operator Basis()); - } + } break; case Variant::QUATERNION: { return (b.operator Quaternion()).inverse() * (a.operator Quaternion()); - } + } break; case Variant::TRANSFORM2D: { return (b.operator Transform2D()).affine_inverse() * (a.operator Transform2D()); - } + } break; case Variant::TRANSFORM3D: { return (b.operator Transform3D()).affine_inverse() * (a.operator Transform3D()); - } + } break; + case Variant::INT: + case Variant::RECT2I: + case Variant::VECTOR2I: + case Variant::VECTOR3I: + case Variant::VECTOR4I: + case Variant::PACKED_INT32_ARRAY: + case Variant::PACKED_INT64_ARRAY: { + // Fallback the interpolatable value which needs casting. + return cast_from_blendwise(subtract_variant(cast_to_blendwise(a), cast_to_blendwise(b)), a.get_type()); + } break; + case Variant::BOOL: + case Variant::STRING: + case Variant::STRING_NAME: { + // Specialized for Tween. + return a; + } break; + case Variant::PACKED_BYTE_ARRAY: { + // Skip. + } break; default: { - return Variant::evaluate(Variant::OP_SUBTRACT, a, b); - } + if (a.is_array()) { + const Array arr_a = a.operator Array(); + const Array arr_b = b.operator Array(); + + int min_size = arr_a.size(); + int max_size = arr_b.size(); + bool is_a_larger = inform_variant_array(min_size, max_size); + + Array result; + result.set_typed(MAX(arr_a.get_typed_builtin(), arr_b.get_typed_builtin()), StringName(), Variant()); + result.resize(min_size); + int i = 0; + for (; i < min_size; i++) { + result[i] = subtract_variant(arr_a[i], arr_b[i]); + } + if (min_size != max_size) { + // Process with last element of the lesser array. + // This is pretty funny and bizarre, but artists like to use it for polygon animation. + Variant lesser_last; + result.resize(max_size); + if (is_a_larger) { + if (i > 0) { + lesser_last = arr_b[i - 1]; + } else { + Variant vz = arr_a[i]; + vz.zero(); + lesser_last = vz; + } + for (; i < max_size; i++) { + result[i] = subtract_variant(arr_a[i], lesser_last); + } + } else { + if (i > 0) { + lesser_last = arr_a[i - 1]; + } else { + Variant vz = arr_b[i]; + vz.zero(); + lesser_last = vz; + } + for (; i < max_size; i++) { + result[i] = subtract_variant(lesser_last, arr_b[i]); + } + } + } + return result; + } + } break; } + return Variant::evaluate(Variant::OP_SUBTRACT, a, b); } Variant Animation::blend_variant(const Variant &a, const Variant &b, float c) { if (a.get_type() != b.get_type()) { if (a.is_num() && b.is_num()) { - double va = a; - double vb = b; - return va + vb * c; + return blend_variant(cast_to_blendwise(a), cast_to_blendwise(b), c); + } else if (!a.is_array()) { + return a; } - return a; } switch (a.get_type()) { case Variant::NIL: { return Variant(); - } - case Variant::INT: { - return int64_t((a.operator int64_t()) + (b.operator int64_t()) * c + 0.5); - } + } break; case Variant::FLOAT: { return (a.operator double()) + (b.operator double()) * c; - } + } break; case Variant::VECTOR2: { return (a.operator Vector2()) + (b.operator Vector2()) * c; - } - case Variant::VECTOR2I: { - const Vector2i va = a.operator Vector2i(); - const Vector2i vb = b.operator Vector2i(); - return Vector2i(int32_t(va.x + vb.x * c + 0.5), int32_t(va.y + vb.y * c + 0.5)); - } + } break; case Variant::RECT2: { const Rect2 ra = a.operator Rect2(); const Rect2 rb = b.operator Rect2(); return Rect2(ra.position + rb.position * c, ra.size + rb.size * c); - } - case Variant::RECT2I: { - const Rect2i ra = a.operator Rect2i(); - const Rect2i rb = b.operator Rect2i(); - return Rect2i(int32_t(ra.position.x + rb.position.x * c + 0.5), int32_t(ra.position.y + rb.position.y * c + 0.5), int32_t(ra.size.x + rb.size.x * c + 0.5), int32_t(ra.size.y + rb.size.y * c + 0.5)); - } + } break; case Variant::VECTOR3: { return (a.operator Vector3()) + (b.operator Vector3()) * c; - } - case Variant::VECTOR3I: { - const Vector3i va = a.operator Vector3i(); - const Vector3i vb = b.operator Vector3i(); - return Vector3i(int32_t(va.x + vb.x * c + 0.5), int32_t(va.y + vb.y * c + 0.5), int32_t(va.z + vb.z * c + 0.5)); - } + } break; case Variant::VECTOR4: { return (a.operator Vector4()) + (b.operator Vector4()) * c; - } - case Variant::VECTOR4I: { - const Vector4i va = a.operator Vector4i(); - const Vector4i vb = b.operator Vector4i(); - return Vector4i(int32_t(va.x + vb.x * c + 0.5), int32_t(va.y + vb.y * c + 0.5), int32_t(va.z + vb.z * c + 0.5), int32_t(va.w + vb.w * c + 0.5)); - } + } break; case Variant::PLANE: { const Plane pa = a.operator Plane(); const Plane pb = b.operator Plane(); return Plane(pa.normal + pb.normal * c, pa.d + pb.d * c); - } + } break; case Variant::COLOR: { return (a.operator Color()) + (b.operator Color()) * c; - } + } break; case Variant::AABB: { const ::AABB aa = a.operator ::AABB(); const ::AABB ab = b.operator ::AABB(); return ::AABB(aa.position + ab.position * c, aa.size + ab.size * c); - } + } break; case Variant::BASIS: { return (a.operator Basis()) + (b.operator Basis()) * c; - } + } break; case Variant::QUATERNION: { return (a.operator Quaternion()) * Quaternion().slerp((b.operator Quaternion()), c); - } + } break; case Variant::TRANSFORM2D: { return (a.operator Transform2D()) * Transform2D().interpolate_with((b.operator Transform2D()), c); - } + } break; case Variant::TRANSFORM3D: { return (a.operator Transform3D()) * Transform3D().interpolate_with((b.operator Transform3D()), c); - } + } break; + case Variant::BOOL: + case Variant::INT: + case Variant::RECT2I: + case Variant::VECTOR2I: + case Variant::VECTOR3I: + case Variant::VECTOR4I: + case Variant::PACKED_INT32_ARRAY: + case Variant::PACKED_INT64_ARRAY: { + // Fallback the interpolatable value which needs casting. + return cast_from_blendwise(blend_variant(cast_to_blendwise(a), cast_to_blendwise(b), c), a.get_type()); + } break; + case Variant::STRING: + case Variant::STRING_NAME: { + Array arr_a = cast_to_blendwise(a); + Array arr_b = cast_to_blendwise(b); + int min_size = arr_a.size(); + int max_size = arr_b.size(); + bool is_a_larger = inform_variant_array(min_size, max_size); + int mid_size = interpolate_variant(arr_a.size(), arr_b.size(), c); + if (is_a_larger) { + arr_a.resize(mid_size); + } else { + arr_b.resize(mid_size); + } + return cast_from_blendwise(blend_variant(arr_a, arr_b, c), a.get_type()); + } break; + case Variant::PACKED_BYTE_ARRAY: { + // Skip. + } break; default: { - return c < 0.5 ? a : b; - } + if (a.is_array()) { + const Array arr_a = a.operator Array(); + const Array arr_b = b.operator Array(); + + int min_size = arr_a.size(); + int max_size = arr_b.size(); + bool is_a_larger = inform_variant_array(min_size, max_size); + + Array result; + result.set_typed(MAX(arr_a.get_typed_builtin(), arr_b.get_typed_builtin()), StringName(), Variant()); + result.resize(min_size); + int i = 0; + for (; i < min_size; i++) { + result[i] = blend_variant(arr_a[i], arr_b[i], c); + } + if (min_size != max_size) { + // Process with last element of the lesser array. + // This is pretty funny and bizarre, but artists like to use it for polygon animation. + Variant lesser_last; + if (is_a_larger && !Math::is_equal_approx(c, 1.0f)) { + result.resize(max_size); + if (i > 0) { + lesser_last = arr_b[i - 1]; + } else { + Variant vz = arr_a[i]; + vz.zero(); + lesser_last = vz; + } + for (; i < max_size; i++) { + result[i] = blend_variant(arr_a[i], lesser_last, c); + } + } else if (!is_a_larger && !Math::is_zero_approx(c)) { + result.resize(max_size); + if (i > 0) { + lesser_last = arr_a[i - 1]; + } else { + Variant vz = arr_b[i]; + vz.zero(); + lesser_last = vz; + } + for (; i < max_size; i++) { + result[i] = blend_variant(lesser_last, arr_b[i], c); + } + } + } + return result; + } + } break; } + return c < 0.5 ? a : b; } -Variant Animation::interpolate_variant(const Variant &a, const Variant &b, float c) { +Variant Animation::interpolate_variant(const Variant &a, const Variant &b, float c, bool p_snap_array_element) { if (a.get_type() != b.get_type()) { if (a.is_num() && b.is_num()) { - double va = a; - double vb = b; - return va + (vb - va) * c; + return interpolate_variant(cast_to_blendwise(a), cast_to_blendwise(b), c); + } else if (!a.is_array()) { + return a; } - return a; } switch (a.get_type()) { case Variant::NIL: { return Variant(); - } - case Variant::INT: { - const int64_t va = a.operator int64_t(); - return int64_t(va + ((b.operator int64_t()) - va) * c); - } + } break; case Variant::FLOAT: { const double va = a.operator double(); return va + ((b.operator double()) - va) * c; - } + } break; case Variant::VECTOR2: { return (a.operator Vector2()).lerp(b.operator Vector2(), c); - } - case Variant::VECTOR2I: { - const Vector2i va = a.operator Vector2i(); - const Vector2i vb = b.operator Vector2i(); - return Vector2i(int32_t(va.x + (vb.x - va.x) * c), int32_t(va.y + (vb.y - va.y) * c)); - } + } break; case Variant::RECT2: { const Rect2 ra = a.operator Rect2(); const Rect2 rb = b.operator Rect2(); return Rect2(ra.position.lerp(rb.position, c), ra.size.lerp(rb.size, c)); - } - case Variant::RECT2I: { - const Rect2i ra = a.operator Rect2i(); - const Rect2i rb = b.operator Rect2i(); - return Rect2i(int32_t(ra.position.x + (rb.position.x - ra.position.x) * c), int32_t(ra.position.y + (rb.position.y - ra.position.y) * c), int32_t(ra.size.x + (rb.size.x - ra.size.x) * c), int32_t(ra.size.y + (rb.size.y - ra.size.y) * c)); - } + } break; case Variant::VECTOR3: { return (a.operator Vector3()).lerp(b.operator Vector3(), c); - } - case Variant::VECTOR3I: { - const Vector3i va = a.operator Vector3i(); - const Vector3i vb = b.operator Vector3i(); - return Vector3i(int32_t(va.x + (vb.x - va.x) * c), int32_t(va.y + (vb.y - va.y) * c), int32_t(va.z + (vb.z - va.z) * c)); - } + } break; case Variant::VECTOR4: { return (a.operator Vector4()).lerp(b.operator Vector4(), c); - } - case Variant::VECTOR4I: { - const Vector4i va = a.operator Vector4i(); - const Vector4i vb = b.operator Vector4i(); - return Vector4i(int32_t(va.x + (vb.x - va.x) * c), int32_t(va.y + (vb.y - va.y) * c), int32_t(va.z + (vb.z - va.z) * c), int32_t(va.w + (vb.w - va.w) * c)); - } + } break; case Variant::PLANE: { const Plane pa = a.operator Plane(); const Plane pb = b.operator Plane(); return Plane(pa.normal.lerp(pb.normal, c), pa.d + (pb.d - pa.d) * c); - } + } break; case Variant::COLOR: { return (a.operator Color()).lerp(b.operator Color(), c); - } + } break; case Variant::AABB: { const ::AABB aa = a.operator ::AABB(); const ::AABB ab = b.operator ::AABB(); return ::AABB(aa.position.lerp(ab.position, c), aa.size.lerp(ab.size, c)); - } + } break; case Variant::BASIS: { return (a.operator Basis()).lerp(b.operator Basis(), c); - } + } break; case Variant::QUATERNION: { return (a.operator Quaternion()).slerp(b.operator Quaternion(), c); - } + } break; case Variant::TRANSFORM2D: { return (a.operator Transform2D()).interpolate_with(b.operator Transform2D(), c); - } + } break; case Variant::TRANSFORM3D: { return (a.operator Transform3D()).interpolate_with(b.operator Transform3D(), c); - } - case Variant::STRING: { - // This is pretty funny and bizarre, but artists like to use it for typewriter effects. - const String sa = a.operator String(); - const String sb = b.operator String(); - String dst; - int sa_len = sa.length(); - int sb_len = sb.length(); - int csize = sa_len + (sb_len - sa_len) * c; - if (csize == 0) { - return ""; - } - dst.resize(csize + 1); - dst[csize] = 0; - int split = csize / 2; - - for (int i = 0; i < csize; i++) { - char32_t chr = ' '; - - if (i < split) { - if (i < sa.length()) { - chr = sa[i]; - } else if (i < sb.length()) { - chr = sb[i]; - } - - } else { - if (i < sb.length()) { - chr = sb[i]; - } else if (i < sa.length()) { - chr = sa[i]; - } - } - - dst[i] = chr; - } - - return dst; - } - case Variant::PACKED_INT32_ARRAY: { - const Vector<int32_t> arr_a = a; - const Vector<int32_t> arr_b = b; - int sz = arr_a.size(); - if (sz == 0 || arr_b.size() != sz) { - return a; - } else { - Vector<int32_t> v; - v.resize(sz); - { - int32_t *vw = v.ptrw(); - const int32_t *ar = arr_a.ptr(); - const int32_t *br = arr_b.ptr(); - - Variant va; - for (int i = 0; i < sz; i++) { - va = interpolate_variant(ar[i], br[i], c); - vw[i] = va; - } - } - return v; - } - } + } break; + case Variant::BOOL: + case Variant::INT: + case Variant::RECT2I: + case Variant::VECTOR2I: + case Variant::VECTOR3I: + case Variant::VECTOR4I: + case Variant::PACKED_INT32_ARRAY: case Variant::PACKED_INT64_ARRAY: { - const Vector<int64_t> arr_a = a; - const Vector<int64_t> arr_b = b; - int sz = arr_a.size(); - if (sz == 0 || arr_b.size() != sz) { - return a; - } else { - Vector<int64_t> v; - v.resize(sz); - { - int64_t *vw = v.ptrw(); - const int64_t *ar = arr_a.ptr(); - const int64_t *br = arr_b.ptr(); - - Variant va; - for (int i = 0; i < sz; i++) { - va = interpolate_variant(ar[i], br[i], c); - vw[i] = va; - } - } - return v; - } - } - case Variant::PACKED_FLOAT32_ARRAY: { - const Vector<float> arr_a = a; - const Vector<float> arr_b = b; - int sz = arr_a.size(); - if (sz == 0 || arr_b.size() != sz) { - return a; - } else { - Vector<float> v; - v.resize(sz); - { - float *vw = v.ptrw(); - const float *ar = arr_a.ptr(); - const float *br = arr_b.ptr(); - - Variant va; - for (int i = 0; i < sz; i++) { - va = interpolate_variant(ar[i], br[i], c); - vw[i] = va; - } - } - return v; - } - } - case Variant::PACKED_FLOAT64_ARRAY: { - const Vector<double> arr_a = a; - const Vector<double> arr_b = b; - int sz = arr_a.size(); - if (sz == 0 || arr_b.size() != sz) { - return a; + // Fallback the interpolatable value which needs casting. + return cast_from_blendwise(interpolate_variant(cast_to_blendwise(a), cast_to_blendwise(b), c), a.get_type()); + } break; + case Variant::STRING: + case Variant::STRING_NAME: { + Array arr_a = cast_to_blendwise(a); + Array arr_b = cast_to_blendwise(b); + int min_size = arr_a.size(); + int max_size = arr_b.size(); + bool is_a_larger = inform_variant_array(min_size, max_size); + int mid_size = interpolate_variant(arr_a.size(), arr_b.size(), c); + if (is_a_larger) { + arr_a.resize(mid_size); } else { - Vector<double> v; - v.resize(sz); - { - double *vw = v.ptrw(); - const double *ar = arr_a.ptr(); - const double *br = arr_b.ptr(); - - Variant va; - for (int i = 0; i < sz; i++) { - va = interpolate_variant(ar[i], br[i], c); - vw[i] = va; - } - } - return v; + arr_b.resize(mid_size); } - } - case Variant::PACKED_VECTOR2_ARRAY: { - const Vector<Vector2> arr_a = a; - const Vector<Vector2> arr_b = b; - int sz = arr_a.size(); - if (sz == 0 || arr_b.size() != sz) { - return a; - } else { - Vector<Vector2> v; - v.resize(sz); - { - Vector2 *vw = v.ptrw(); - const Vector2 *ar = arr_a.ptr(); - const Vector2 *br = arr_b.ptr(); - - for (int i = 0; i < sz; i++) { - vw[i] = ar[i].lerp(br[i], c); - } + return cast_from_blendwise(interpolate_variant(arr_a, arr_b, c, true), a.get_type()); + } break; + case Variant::PACKED_BYTE_ARRAY: { + // Skip. + } break; + default: { + if (a.is_array()) { + const Array arr_a = a.operator Array(); + const Array arr_b = b.operator Array(); + + int min_size = arr_a.size(); + int max_size = arr_b.size(); + bool is_a_larger = inform_variant_array(min_size, max_size); + + Array result; + result.set_typed(MAX(arr_a.get_typed_builtin(), arr_b.get_typed_builtin()), StringName(), Variant()); + result.resize(min_size); + int i = 0; + for (; i < min_size; i++) { + result[i] = interpolate_variant(arr_a[i], arr_b[i], c); } - return v; - } - } - case Variant::PACKED_VECTOR3_ARRAY: { - const Vector<Vector3> arr_a = a; - const Vector<Vector3> arr_b = b; - int sz = arr_a.size(); - if (sz == 0 || arr_b.size() != sz) { - return a; - } else { - Vector<Vector3> v; - v.resize(sz); - { - Vector3 *vw = v.ptrw(); - const Vector3 *ar = arr_a.ptr(); - const Vector3 *br = arr_b.ptr(); - - for (int i = 0; i < sz; i++) { - vw[i] = ar[i].lerp(br[i], c); + if (min_size != max_size) { + // Process with last element of the lesser array. + // This is pretty funny and bizarre, but artists like to use it for polygon animation. + Variant lesser_last; + if (is_a_larger && !Math::is_equal_approx(c, 1.0f)) { + result.resize(max_size); + if (p_snap_array_element) { + c = 0; + } + if (i > 0) { + lesser_last = arr_b[i - 1]; + } else { + Variant vz = arr_a[i]; + vz.zero(); + lesser_last = vz; + } + for (; i < max_size; i++) { + result[i] = interpolate_variant(arr_a[i], lesser_last, c); + } + } else if (!is_a_larger && !Math::is_zero_approx(c)) { + result.resize(max_size); + if (p_snap_array_element) { + c = 1; + } + if (i > 0) { + lesser_last = arr_a[i - 1]; + } else { + Variant vz = arr_b[i]; + vz.zero(); + lesser_last = vz; + } + for (; i < max_size; i++) { + result[i] = interpolate_variant(lesser_last, arr_b[i], c); + } } } - return v; + return result; } - } - case Variant::PACKED_COLOR_ARRAY: { - const Vector<Color> arr_a = a; - const Vector<Color> arr_b = b; - int sz = arr_a.size(); - if (sz == 0 || arr_b.size() != sz) { - return a; - } else { - Vector<Color> v; - v.resize(sz); - { - Color *vw = v.ptrw(); - const Color *ar = arr_a.ptr(); - const Color *br = arr_b.ptr(); + } break; + } + return c < 0.5 ? a : b; +} - for (int i = 0; i < sz; i++) { - vw[i] = ar[i].lerp(br[i], c); - } - } - return v; - } - } - default: { - return c < 0.5 ? a : b; - } +bool Animation::inform_variant_array(int &r_min, int &r_max) { + if (r_min <= r_max) { + return false; } + SWAP(r_min, r_max); + return true; } Animation::Animation() { diff --git a/scene/resources/animation.h b/scene/resources/animation.h index c128c14e49..2579b6c8ce 100644 --- a/scene/resources/animation.h +++ b/scene/resources/animation.h @@ -373,6 +373,8 @@ protected: static void _bind_methods(); + static bool inform_variant_array(int &r_min, int &r_max); // Returns true if max and min are swapped. + public: int add_track(TrackType p_type, int p_at_pos = -1); void remove_track(int p_track); @@ -487,11 +489,19 @@ public: void optimize(real_t p_allowed_velocity_err = 0.01, real_t p_allowed_angular_err = 0.01, int p_precision = 3); void compress(uint32_t p_page_size = 8192, uint32_t p_fps = 120, float p_split_tolerance = 4.0); // 4.0 seems to be the split tolerance sweet spot from many tests - // Helper math functions for Variant. + // Helper functions for Variant. + static bool is_variant_interpolatable(const Variant p_value); + + static Variant cast_to_blendwise(const Variant p_value); + static Variant cast_from_blendwise(const Variant p_value, const Variant::Type p_type); + + static Variant string_to_array(const Variant p_value); + static Variant array_to_string(const Variant p_value); + static Variant add_variant(const Variant &a, const Variant &b); static Variant subtract_variant(const Variant &a, const Variant &b); static Variant blend_variant(const Variant &a, const Variant &b, float c); - static Variant interpolate_variant(const Variant &a, const Variant &b, float c); + static Variant interpolate_variant(const Variant &a, const Variant &b, float c, bool p_snap_array_element = false); Animation(); ~Animation(); diff --git a/scene/resources/camera_attributes.cpp b/scene/resources/camera_attributes.cpp index 7c46729af3..af5df165b3 100644 --- a/scene/resources/camera_attributes.cpp +++ b/scene/resources/camera_attributes.cpp @@ -286,10 +286,10 @@ void CameraAttributesPractical::_bind_methods() { ADD_GROUP("DOF Blur", "dof_blur_"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "dof_blur_far_enabled"), "set_dof_blur_far_enabled", "is_dof_blur_far_enabled"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "dof_blur_far_distance", PROPERTY_HINT_RANGE, "0.01,8192,0.01,exp,suffix:m"), "set_dof_blur_far_distance", "get_dof_blur_far_distance"); - ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "dof_blur_far_transition", PROPERTY_HINT_RANGE, "-1,8192,0.01,exp"), "set_dof_blur_far_transition", "get_dof_blur_far_transition"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "dof_blur_far_transition", PROPERTY_HINT_RANGE, "-1,8192,0.01"), "set_dof_blur_far_transition", "get_dof_blur_far_transition"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "dof_blur_near_enabled"), "set_dof_blur_near_enabled", "is_dof_blur_near_enabled"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "dof_blur_near_distance", PROPERTY_HINT_RANGE, "0.01,8192,0.01,exp,suffix:m"), "set_dof_blur_near_distance", "get_dof_blur_near_distance"); - ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "dof_blur_near_transition", PROPERTY_HINT_RANGE, "-1,8192,0.01,exp"), "set_dof_blur_near_transition", "get_dof_blur_near_transition"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "dof_blur_near_transition", PROPERTY_HINT_RANGE, "-1,8192,0.01"), "set_dof_blur_near_transition", "get_dof_blur_near_transition"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "dof_blur_amount", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_dof_blur_amount", "get_dof_blur_amount"); ADD_GROUP("Auto Exposure", "auto_exposure_"); @@ -373,6 +373,11 @@ real_t CameraAttributesPhysical::get_fov() const { return frustum_fov; } +#ifdef MINGW_ENABLED +#undef near +#undef far +#endif + void CameraAttributesPhysical::_update_frustum() { //https://en.wikipedia.org/wiki/Circle_of_confusion#Circle_of_confusion_diameter_limit_based_on_d/1500 Vector2i sensor_size = Vector2i(36, 24); // Matches high-end DSLR, could be made variable if there is demand. diff --git a/scene/resources/importer_mesh.cpp b/scene/resources/importer_mesh.cpp index 1f4171c072..2ffb8da46c 100644 --- a/scene/resources/importer_mesh.cpp +++ b/scene/resources/importer_mesh.cpp @@ -418,11 +418,10 @@ void ImporterMesh::generate_lods(float p_normal_merge_angle, float p_normal_spli } } - LocalVector<float> normal_weights; - normal_weights.resize(merged_vertex_count); - for (unsigned int j = 0; j < merged_vertex_count; j++) { - normal_weights[j] = 2.0; // Give some weight to normal preservation, may be worth exposing as an import setting - } + const float normal_weights[3] = { + // Give some weight to normal preservation, may be worth exposing as an import setting + 2.0f, 2.0f, 2.0f + }; Vector<float> merged_vertices_f32 = vector3_to_float32_array(merged_vertices_ptr, merged_vertex_count); float scale = SurfaceTool::simplify_scale_func(merged_vertices_f32.ptr(), merged_vertex_count, sizeof(float) * 3); @@ -460,12 +459,13 @@ void ImporterMesh::generate_lods(float p_normal_merge_angle, float p_normal_spli (const uint32_t *)merged_indices_ptr, index_count, merged_vertices_f32.ptr(), merged_vertex_count, sizeof(float) * 3, // Vertex stride + merged_normals_f32.ptr(), + sizeof(float) * 3, // Attribute stride + normal_weights, 3, index_target, max_mesh_error, simplify_options, - &mesh_error, - merged_normals_f32.ptr(), - normal_weights.ptr(), 3); + &mesh_error); if (new_index_count < last_index_count * 1.5f) { index_target = index_target * 1.5f; @@ -969,7 +969,7 @@ Vector<Ref<Shape3D>> ImporterMesh::convex_decompose(const Ref<MeshConvexDecompos if (found_vertex) { index = found_vertex->value; } else { - index = ++vertex_count; + index = vertex_count++; vertex_map[vertex] = index; vertex_w[index] = vertex; } diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index 515ae67c59..1b74063ff4 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -3167,7 +3167,7 @@ bool StandardMaterial3D::_set(const StringName &p_name, const Variant &p_value) { "flags_use_shadow_to_opacity", "shadow_to_opacity" }, { "flags_no_depth_test", "no_depth_test" }, { "flags_use_point_size", "use_point_size" }, - { "flags_fixed_size", "fixed_Size" }, + { "flags_fixed_size", "fixed_size" }, { "flags_albedo_tex_force_srgb", "albedo_texture_force_srgb" }, { "flags_do_not_receive_shadows", "disable_receive_shadows" }, { "flags_disable_ambient_light", "disable_ambient_light" }, diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp index 2456212327..1f6e453e88 100644 --- a/scene/resources/packed_scene.cpp +++ b/scene/resources/packed_scene.cpp @@ -138,7 +138,7 @@ Node *SceneState::instantiate(GenEditState p_edit_state) const { } int nc = nodes.size(); - ERR_FAIL_COND_V(nc == 0, nullptr); + ERR_FAIL_COND_V_MSG(nc == 0, nullptr, vformat("Failed to instantiate scene state of \"%s\", node count is 0. Make sure the PackedScene resource is valid.", path)); const StringName *snames = nullptr; int sname_count = names.size(); @@ -219,7 +219,7 @@ Node *SceneState::instantiate(GenEditState p_edit_state) const { Ref<PackedScene> sdata = props[n.instance & FLAG_MASK]; ERR_FAIL_COND_V(!sdata.is_valid(), nullptr); node = sdata->instantiate(p_edit_state == GEN_EDIT_STATE_DISABLED ? PackedScene::GEN_EDIT_STATE_DISABLED : PackedScene::GEN_EDIT_STATE_INSTANCE); - ERR_FAIL_NULL_V(node, nullptr); + ERR_FAIL_NULL_V_MSG(node, nullptr, vformat("Failed to load scene dependency: \"%s\". Make sure the required scene is valid.", sdata->get_path())); } } else if (n.type == TYPE_INSTANTIATED) { diff --git a/scene/resources/particle_process_material.cpp b/scene/resources/particle_process_material.cpp index 2a70deee6c..4ed1980826 100644 --- a/scene/resources/particle_process_material.cpp +++ b/scene/resources/particle_process_material.cpp @@ -762,8 +762,11 @@ void ParticleProcessMaterial::_update_shader() { code += "}\n"; - code += "vec3 process_radial_displacement(DynamicsParameters param, float lifetime, inout uint alt_seed, mat4 transform, mat4 emission_transform){\n"; + code += "vec3 process_radial_displacement(DynamicsParameters param, float lifetime, inout uint alt_seed, mat4 transform, mat4 emission_transform, float delta){\n"; code += " vec3 radial_displacement = vec3(0.0);\n"; + code += " if (delta < 0.001){\n"; + code += " return radial_displacement;\n"; + code += " }\n"; code += " float radial_displacement_multiplier = 1.0;\n"; if (tex_parameters[PARAM_RADIAL_VELOCITY].is_valid()) { code += " radial_displacement_multiplier = texture(radial_velocity_curve, vec2(lifetime)).r;\n"; @@ -774,7 +777,7 @@ void ParticleProcessMaterial::_update_shader() { code += " }else{radial_displacement = get_random_direction_from_spread(alt_seed, 360.0)* param.radial_velocity;} \n"; code += " if (radial_displacement_multiplier * param.radial_velocity < 0.0){\n // Prevent inwards velocity to flicker once the point is reached."; code += " if (length(radial_displacement) > 0.01){\n"; - code += " radial_displacement = normalize(radial_displacement) * min(abs((radial_displacement_multiplier * param.radial_velocity)), length(transform[3].xyz - global_pivot));\n"; + code += " radial_displacement = normalize(radial_displacement) * min(abs((radial_displacement_multiplier * param.radial_velocity)), length(transform[3].xyz - global_pivot) / delta);\n"; code += " }\n"; code += " \n"; code += " return radial_displacement;\n"; @@ -923,7 +926,7 @@ void ParticleProcessMaterial::_update_shader() { } code += " // calculate all velocity\n"; code += " \n"; - code += " controlled_displacement += process_radial_displacement(dynamic_params, lifetime_percent, alt_seed, TRANSFORM, EMISSION_TRANSFORM);\n"; + code += " controlled_displacement += process_radial_displacement(dynamic_params, lifetime_percent, alt_seed, TRANSFORM, EMISSION_TRANSFORM, DELTA);\n"; code += " \n"; if (tex_parameters[PARAM_DIRECTIONAL_VELOCITY].is_valid()) { code += " controlled_displacement += process_directional_displacement(dynamic_params, lifetime_percent, TRANSFORM, EMISSION_TRANSFORM);\n"; diff --git a/scene/resources/primitive_meshes.cpp b/scene/resources/primitive_meshes.cpp index 13791d8c2b..8ad9eec25f 100644 --- a/scene/resources/primitive_meshes.cpp +++ b/scene/resources/primitive_meshes.cpp @@ -552,7 +552,7 @@ void CapsuleMesh::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "radius", PROPERTY_HINT_RANGE, "0.001,100.0,0.001,or_greater,suffix:m"), "set_radius", "get_radius"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "height", PROPERTY_HINT_RANGE, "0.001,100.0,0.001,or_greater,suffix:m"), "set_height", "get_height"); ADD_PROPERTY(PropertyInfo(Variant::INT, "radial_segments", PROPERTY_HINT_RANGE, "1,100,1,or_greater"), "set_radial_segments", "get_radial_segments"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "rings", PROPERTY_HINT_RANGE, "1,100,1,or_greater"), "set_rings", "get_rings"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "rings", PROPERTY_HINT_RANGE, "0,100,1,or_greater"), "set_rings", "get_rings"); ADD_LINKED_PROPERTY("radius", "height"); ADD_LINKED_PROPERTY("height", "radius"); @@ -594,7 +594,8 @@ int CapsuleMesh::get_radial_segments() const { } void CapsuleMesh::set_rings(const int p_rings) { - rings = p_rings > 1 ? p_rings : 1; + ERR_FAIL_COND(p_rings < 0); + rings = p_rings; _request_update(); } @@ -1161,7 +1162,7 @@ void CylinderMesh::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "bottom_radius", PROPERTY_HINT_RANGE, "0,100,0.001,or_greater,suffix:m"), "set_bottom_radius", "get_bottom_radius"); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "height", PROPERTY_HINT_RANGE, "0.001,100,0.001,or_greater,suffix:m"), "set_height", "get_height"); ADD_PROPERTY(PropertyInfo(Variant::INT, "radial_segments", PROPERTY_HINT_RANGE, "1,100,1,or_greater"), "set_radial_segments", "get_radial_segments"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "rings", PROPERTY_HINT_RANGE, "1,100,1,or_greater"), "set_rings", "get_rings"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "rings", PROPERTY_HINT_RANGE, "0,100,1,or_greater"), "set_rings", "get_rings"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "cap_top"), "set_cap_top", "is_cap_top"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "cap_bottom"), "set_cap_bottom", "is_cap_bottom"); } @@ -1206,7 +1207,8 @@ int CylinderMesh::get_radial_segments() const { } void CylinderMesh::set_rings(const int p_rings) { - rings = p_rings > 0 ? p_rings : 0; + ERR_FAIL_COND(p_rings < 0); + rings = p_rings; _request_update(); } @@ -1919,7 +1921,8 @@ int SphereMesh::get_radial_segments() const { } void SphereMesh::set_rings(const int p_rings) { - rings = p_rings > 1 ? p_rings : 1; + ERR_FAIL_COND(p_rings < 1); + rings = p_rings; _request_update(); } diff --git a/scene/resources/resource_format_text.cpp b/scene/resources/resource_format_text.cpp index 19718f12be..037cd32f10 100644 --- a/scene/resources/resource_format_text.cpp +++ b/scene/resources/resource_format_text.cpp @@ -973,8 +973,7 @@ Error ResourceLoaderText::rename_dependencies(Ref<FileAccess> p_f, const String } if (p_map.has(path)) { - String np = p_map[path]; - path = np; + path = p_map[path]; } if (relative) { @@ -1791,8 +1790,8 @@ Error ResourceFormatLoaderText::rename_dependencies(const String &p_path, const err = loader.rename_dependencies(f, p_path, p_map); } - if (err == OK) { - Ref<DirAccess> da = DirAccess::create(DirAccess::ACCESS_RESOURCES); + Ref<DirAccess> da = DirAccess::create(DirAccess::ACCESS_RESOURCES); + if (err == OK && da->file_exists(p_path + ".depren")) { da->remove(p_path); da->rename(p_path + ".depren", p_path); } diff --git a/scene/resources/skeleton_modification_2d_twoboneik.cpp b/scene/resources/skeleton_modification_2d_twoboneik.cpp index d0b5625298..4458cdc0e3 100644 --- a/scene/resources/skeleton_modification_2d_twoboneik.cpp +++ b/scene/resources/skeleton_modification_2d_twoboneik.cpp @@ -468,8 +468,8 @@ void SkeletonModification2DTwoBoneIK::_bind_methods() { ClassDB::bind_method(D_METHOD("get_joint_two_bone_idx"), &SkeletonModification2DTwoBoneIK::get_joint_two_bone_idx); ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "target_nodepath", PROPERTY_HINT_NODE_PATH_VALID_TYPES, "Node2D"), "set_target_node", "get_target_node"); - ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "target_minimum_distance", PROPERTY_HINT_RANGE, "0,100000000,0.01,suffix:m"), "set_target_minimum_distance", "get_target_minimum_distance"); - ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "target_maximum_distance", PROPERTY_HINT_NONE, "0,100000000,0.01,suffix:m"), "set_target_maximum_distance", "get_target_maximum_distance"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "target_minimum_distance", PROPERTY_HINT_RANGE, "0,100000000,0.01,suffix:px"), "set_target_minimum_distance", "get_target_minimum_distance"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "target_maximum_distance", PROPERTY_HINT_NONE, "0,100000000,0.01,suffix:px"), "set_target_maximum_distance", "get_target_maximum_distance"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "flip_bend_direction", PROPERTY_HINT_NONE, ""), "set_flip_bend_direction", "get_flip_bend_direction"); ADD_GROUP("", ""); } diff --git a/scene/resources/sky_material.cpp b/scene/resources/sky_material.cpp index 670ce152bd..640261d615 100644 --- a/scene/resources/sky_material.cpp +++ b/scene/resources/sky_material.cpp @@ -161,6 +161,15 @@ bool ProceduralSkyMaterial::get_use_debanding() const { return use_debanding; } +void ProceduralSkyMaterial::set_energy_multiplier(float p_multiplier) { + global_energy_multiplier = p_multiplier; + RS::get_singleton()->material_set_param(_get_material(), "exposure", global_energy_multiplier); +} + +float ProceduralSkyMaterial::get_energy_multiplier() const { + return global_energy_multiplier; +} + Shader::Mode ProceduralSkyMaterial::get_shader_mode() const { return Shader::MODE_SKY; } @@ -226,6 +235,9 @@ void ProceduralSkyMaterial::_bind_methods() { ClassDB::bind_method(D_METHOD("set_use_debanding", "use_debanding"), &ProceduralSkyMaterial::set_use_debanding); ClassDB::bind_method(D_METHOD("get_use_debanding"), &ProceduralSkyMaterial::get_use_debanding); + ClassDB::bind_method(D_METHOD("set_energy_multiplier", "multiplier"), &ProceduralSkyMaterial::set_energy_multiplier); + ClassDB::bind_method(D_METHOD("get_energy_multiplier"), &ProceduralSkyMaterial::get_energy_multiplier); + ADD_GROUP("Sky", "sky_"); ADD_PROPERTY(PropertyInfo(Variant::COLOR, "sky_top_color", PROPERTY_HINT_COLOR_NO_ALPHA), "set_sky_top_color", "get_sky_top_color"); ADD_PROPERTY(PropertyInfo(Variant::COLOR, "sky_horizon_color", PROPERTY_HINT_COLOR_NO_ALPHA), "set_sky_horizon_color", "get_sky_horizon_color"); @@ -246,6 +258,7 @@ void ProceduralSkyMaterial::_bind_methods() { ADD_GROUP("", ""); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_debanding"), "set_use_debanding", "get_use_debanding"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "energy_multiplier", PROPERTY_HINT_RANGE, "0,128,0.01"), "set_energy_multiplier", "get_energy_multiplier"); } void ProceduralSkyMaterial::cleanup_shader() { @@ -280,6 +293,7 @@ uniform float ground_curve : hint_range(0, 1) = 0.02; uniform float ground_energy = 1.0; uniform float sun_angle_max = 30.0; uniform float sun_curve : hint_range(0, 1) = 0.15; +uniform float exposure : hint_range(0, 128) = 1.0; void sky() { float v_angle = acos(clamp(EYEDIR.y, -1.0, 1.0)); @@ -334,7 +348,7 @@ void sky() { vec3 ground = mix(ground_horizon_color.rgb, ground_bottom_color.rgb, clamp(1.0 - pow(1.0 - c, 1.0 / ground_curve), 0.0, 1.0)); ground *= ground_energy; - COLOR = mix(ground, sky, step(0.0, EYEDIR.y)); + COLOR = mix(ground, sky, step(0.0, EYEDIR.y)) * exposure; } )", i ? "render_mode use_debanding;" : "")); @@ -358,6 +372,7 @@ ProceduralSkyMaterial::ProceduralSkyMaterial() { set_sun_angle_max(30.0); set_sun_curve(0.15); set_use_debanding(true); + set_energy_multiplier(1.0); } ProceduralSkyMaterial::~ProceduralSkyMaterial() { @@ -393,6 +408,15 @@ bool PanoramaSkyMaterial::is_filtering_enabled() const { return filter; } +void PanoramaSkyMaterial::set_energy_multiplier(float p_multiplier) { + energy_multiplier = p_multiplier; + RS::get_singleton()->material_set_param(_get_material(), "exposure", energy_multiplier); +} + +float PanoramaSkyMaterial::get_energy_multiplier() const { + return energy_multiplier; +} + Shader::Mode PanoramaSkyMaterial::get_shader_mode() const { return Shader::MODE_SKY; } @@ -420,8 +444,12 @@ void PanoramaSkyMaterial::_bind_methods() { ClassDB::bind_method(D_METHOD("set_filtering_enabled", "enabled"), &PanoramaSkyMaterial::set_filtering_enabled); ClassDB::bind_method(D_METHOD("is_filtering_enabled"), &PanoramaSkyMaterial::is_filtering_enabled); + ClassDB::bind_method(D_METHOD("set_energy_multiplier", "multiplier"), &PanoramaSkyMaterial::set_energy_multiplier); + ClassDB::bind_method(D_METHOD("get_energy_multiplier"), &PanoramaSkyMaterial::get_energy_multiplier); + ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "panorama", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_panorama", "get_panorama"); ADD_PROPERTY(PropertyInfo(Variant::BOOL, "filter"), "set_filtering_enabled", "is_filtering_enabled"); + ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "energy_multiplier", PROPERTY_HINT_RANGE, "0,128,0.01"), "set_energy_multiplier", "get_energy_multiplier"); } Mutex PanoramaSkyMaterial::shader_mutex; @@ -447,9 +475,10 @@ void PanoramaSkyMaterial::_update_shader() { shader_type sky; uniform sampler2D source_panorama : %s, source_color, hint_default_black; +uniform float exposure : hint_range(0, 128) = 1.0; void sky() { - COLOR = texture(source_panorama, SKY_COORDS).rgb; + COLOR = texture(source_panorama, SKY_COORDS).rgb * exposure; } )", i ? "filter_linear" : "filter_nearest")); @@ -460,6 +489,7 @@ void sky() { } PanoramaSkyMaterial::PanoramaSkyMaterial() { + set_energy_multiplier(1.0); } PanoramaSkyMaterial::~PanoramaSkyMaterial() { diff --git a/scene/resources/sky_material.h b/scene/resources/sky_material.h index f570dd998d..4ffb18c6b4 100644 --- a/scene/resources/sky_material.h +++ b/scene/resources/sky_material.h @@ -53,6 +53,7 @@ private: float sun_angle_max = 0.0f; float sun_curve = 0.0f; bool use_debanding = true; + float global_energy_multiplier = 1.0f; static Mutex shader_mutex; static RID shader_cache[2]; @@ -103,6 +104,9 @@ public: void set_use_debanding(bool p_use_debanding); bool get_use_debanding() const; + void set_energy_multiplier(float p_multiplier); + float get_energy_multiplier() const; + virtual Shader::Mode get_shader_mode() const override; virtual RID get_shader_rid() const override; virtual RID get_rid() const override; @@ -121,6 +125,7 @@ class PanoramaSkyMaterial : public Material { private: Ref<Texture2D> panorama; + float energy_multiplier = 1.0f; static Mutex shader_mutex; static RID shader_cache[2]; diff --git a/scene/resources/surface_tool.h b/scene/resources/surface_tool.h index 2a8ad53525..9dfb298b9e 100644 --- a/scene/resources/surface_tool.h +++ b/scene/resources/surface_tool.h @@ -86,7 +86,7 @@ public: static OptimizeVertexCacheFunc optimize_vertex_cache_func; typedef size_t (*SimplifyFunc)(unsigned int *destination, const unsigned int *indices, size_t index_count, const float *vertex_positions, size_t vertex_count, size_t vertex_positions_stride, size_t target_index_count, float target_error, unsigned int options, float *r_error); static SimplifyFunc simplify_func; - typedef size_t (*SimplifyWithAttribFunc)(unsigned int *destination, const unsigned int *indices, size_t index_count, const float *vertex_data, size_t vertex_count, size_t vertex_stride, size_t target_index_count, float target_error, unsigned int options, float *result_error, const float *attributes, const float *attribute_weights, size_t attribute_count); + typedef size_t (*SimplifyWithAttribFunc)(unsigned int *destination, const unsigned int *indices, size_t index_count, const float *vertex_data, size_t vertex_count, size_t vertex_stride, const float *attributes, size_t attribute_stride, const float *attribute_weights, size_t attribute_count, size_t target_index_count, float target_error, unsigned int options, float *result_error); static SimplifyWithAttribFunc simplify_with_attrib_func; typedef float (*SimplifyScaleFunc)(const float *vertex_positions, size_t vertex_count, size_t vertex_positions_stride); static SimplifyScaleFunc simplify_scale_func; diff --git a/scene/resources/text_line.cpp b/scene/resources/text_line.cpp index 98527da96b..76c0a28ea4 100644 --- a/scene/resources/text_line.cpp +++ b/scene/resources/text_line.cpp @@ -81,6 +81,10 @@ void TextLine::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "text_overrun_behavior", PROPERTY_HINT_ENUM, "Trim Nothing,Trim Characters,Trim Words,Ellipsis,Word Ellipsis"), "set_text_overrun_behavior", "get_text_overrun_behavior"); + ClassDB::bind_method(D_METHOD("set_ellipsis_char", "char"), &TextLine::set_ellipsis_char); + ClassDB::bind_method(D_METHOD("get_ellipsis_char"), &TextLine::get_ellipsis_char); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "ellipsis_char"), "set_ellipsis_char", "get_ellipsis_char"); + ClassDB::bind_method(D_METHOD("get_objects"), &TextLine::get_objects); ClassDB::bind_method(D_METHOD("get_object_rect", "key"), &TextLine::get_object_rect); @@ -137,8 +141,10 @@ void TextLine::_shape() { if (alignment == HORIZONTAL_ALIGNMENT_FILL) { TS->shaped_text_fit_to_width(rid, width, flags); overrun_flags.set_flag(TextServer::OVERRUN_JUSTIFICATION_AWARE); + TS->shaped_text_set_custom_ellipsis(rid, (el_char.length() > 0) ? el_char[0] : 0x2026); TS->shaped_text_overrun_trim_to_width(rid, width, overrun_flags); } else { + TS->shaped_text_set_custom_ellipsis(rid, (el_char.length() > 0) ? el_char[0] : 0x2026); TS->shaped_text_overrun_trim_to_width(rid, width, overrun_flags); } } else if (alignment == HORIZONTAL_ALIGNMENT_FILL) { @@ -306,6 +312,23 @@ TextServer::OverrunBehavior TextLine::get_text_overrun_behavior() const { return overrun_behavior; } +void TextLine::set_ellipsis_char(const String &p_char) { + String c = p_char; + if (c.length() > 1) { + WARN_PRINT("Ellipsis must be exactly one character long (" + itos(c.length()) + " characters given)."); + c = c.left(1); + } + if (el_char == c) { + return; + } + el_char = c; + dirty = true; +} + +String TextLine::get_ellipsis_char() const { + return el_char; +} + void TextLine::set_width(float p_width) { width = p_width; if (alignment == HORIZONTAL_ALIGNMENT_FILL || overrun_behavior != TextServer::OVERRUN_NO_TRIMMING) { diff --git a/scene/resources/text_line.h b/scene/resources/text_line.h index cc52d2e6a7..795bdeb15c 100644 --- a/scene/resources/text_line.h +++ b/scene/resources/text_line.h @@ -47,6 +47,7 @@ private: float width = -1.0; BitField<TextServer::JustificationFlag> flags = TextServer::JUSTIFICATION_WORD_BOUND | TextServer::JUSTIFICATION_KASHIDA; HorizontalAlignment alignment = HORIZONTAL_ALIGNMENT_LEFT; + String el_char = U"…"; TextServer::OverrunBehavior overrun_behavior = TextServer::OVERRUN_TRIM_ELLIPSIS; Vector<float> tab_stops; @@ -90,6 +91,9 @@ public: void set_text_overrun_behavior(TextServer::OverrunBehavior p_behavior); TextServer::OverrunBehavior get_text_overrun_behavior() const; + void set_ellipsis_char(const String &p_char); + String get_ellipsis_char() const; + void set_width(float p_width); float get_width() const; diff --git a/scene/resources/text_paragraph.cpp b/scene/resources/text_paragraph.cpp index 147c9044b8..5da47966dd 100644 --- a/scene/resources/text_paragraph.cpp +++ b/scene/resources/text_paragraph.cpp @@ -89,6 +89,10 @@ void TextParagraph::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "text_overrun_behavior", PROPERTY_HINT_ENUM, "Trim Nothing,Trim Characters,Trim Words,Ellipsis,Word Ellipsis"), "set_text_overrun_behavior", "get_text_overrun_behavior"); + ClassDB::bind_method(D_METHOD("set_ellipsis_char", "char"), &TextParagraph::set_ellipsis_char); + ClassDB::bind_method(D_METHOD("get_ellipsis_char"), &TextParagraph::get_ellipsis_char); + ADD_PROPERTY(PropertyInfo(Variant::STRING, "ellipsis_char"), "set_ellipsis_char", "get_ellipsis_char"); + ClassDB::bind_method(D_METHOD("set_width", "width"), &TextParagraph::set_width); ClassDB::bind_method(D_METHOD("get_width"), &TextParagraph::get_width); @@ -252,10 +256,12 @@ void TextParagraph::_shape_lines() { if (i < jst_to_line) { TS->shaped_text_fit_to_width(lines_rid[i], line_w, jst_flags); } else if (i == (visible_lines - 1)) { + TS->shaped_text_set_custom_ellipsis(lines_rid[visible_lines - 1], (el_char.length() > 0) ? el_char[0] : 0x2026); TS->shaped_text_overrun_trim_to_width(lines_rid[visible_lines - 1], line_w, overrun_flags); } } } else if (lines_hidden) { + TS->shaped_text_set_custom_ellipsis(lines_rid[visible_lines - 1], (el_char.length() > 0) ? el_char[0] : 0x2026); TS->shaped_text_overrun_trim_to_width(lines_rid[visible_lines - 1], (visible_lines - 1 <= dropcap_lines) ? (width - h_offset) : width, overrun_flags); } } else { @@ -281,9 +287,11 @@ void TextParagraph::_shape_lines() { if (i < jst_to_line && alignment == HORIZONTAL_ALIGNMENT_FILL) { TS->shaped_text_fit_to_width(lines_rid[i], line_w, jst_flags); overrun_flags.set_flag(TextServer::OVERRUN_JUSTIFICATION_AWARE); + TS->shaped_text_set_custom_ellipsis(lines_rid[i], (el_char.length() > 0) ? el_char[0] : 0x2026); TS->shaped_text_overrun_trim_to_width(lines_rid[i], line_w, overrun_flags); TS->shaped_text_fit_to_width(lines_rid[i], line_w, jst_flags | TextServer::JUSTIFICATION_CONSTRAIN_ELLIPSIS); } else { + TS->shaped_text_set_custom_ellipsis(lines_rid[i], (el_char.length() > 0) ? el_char[0] : 0x2026); TS->shaped_text_overrun_trim_to_width(lines_rid[i], line_w, overrun_flags); } } @@ -501,6 +509,23 @@ TextServer::OverrunBehavior TextParagraph::get_text_overrun_behavior() const { return overrun_behavior; } +void TextParagraph::set_ellipsis_char(const String &p_char) { + String c = p_char; + if (c.length() > 1) { + WARN_PRINT("Ellipsis must be exactly one character long (" + itos(c.length()) + " characters given)."); + c = c.left(1); + } + if (el_char == c) { + return; + } + el_char = c; + lines_dirty = true; +} + +String TextParagraph::get_ellipsis_char() const { + return el_char; +} + void TextParagraph::set_width(float p_width) { _THREAD_SAFE_METHOD_ diff --git a/scene/resources/text_paragraph.h b/scene/resources/text_paragraph.h index 31fc95ac02..28c69967ac 100644 --- a/scene/resources/text_paragraph.h +++ b/scene/resources/text_paragraph.h @@ -56,6 +56,7 @@ private: BitField<TextServer::LineBreakFlag> brk_flags = TextServer::BREAK_MANDATORY | TextServer::BREAK_WORD_BOUND; BitField<TextServer::JustificationFlag> jst_flags = TextServer::JUSTIFICATION_WORD_BOUND | TextServer::JUSTIFICATION_KASHIDA | TextServer::JUSTIFICATION_SKIP_LAST_LINE | TextServer::JUSTIFICATION_DO_NOT_SKIP_SINGLE_LINE; + String el_char = U"…"; TextServer::OverrunBehavior overrun_behavior = TextServer::OVERRUN_NO_TRIMMING; HorizontalAlignment alignment = HORIZONTAL_ALIGNMENT_LEFT; @@ -112,6 +113,9 @@ public: void set_text_overrun_behavior(TextServer::OverrunBehavior p_behavior); TextServer::OverrunBehavior get_text_overrun_behavior() const; + void set_ellipsis_char(const String &p_char); + String get_ellipsis_char() const; + void set_width(float p_width); float get_width() const; diff --git a/scene/resources/tile_set.compat.inc b/scene/resources/tile_set.compat.inc new file mode 100644 index 0000000000..873ae3aa93 --- /dev/null +++ b/scene/resources/tile_set.compat.inc @@ -0,0 +1,48 @@ +/**************************************************************************/ +/* tile_set.compat.inc */ +/**************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/**************************************************************************/ +/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ +/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* */ +/* Permission is hereby granted, free of charge, to any person obtaining */ +/* a copy of this software and associated documentation files (the */ +/* "Software"), to deal in the Software without restriction, including */ +/* without limitation the rights to use, copy, modify, merge, publish, */ +/* distribute, sublicense, and/or sell copies of the Software, and to */ +/* permit persons to whom the Software is furnished to do so, subject to */ +/* the following conditions: */ +/* */ +/* The above copyright notice and this permission notice shall be */ +/* included in all copies or substantial portions of the Software. */ +/* */ +/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ +/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ +/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ +/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ +/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ +/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ +/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/**************************************************************************/ + +#ifndef DISABLE_DEPRECATED + +#include "tile_set.h" + +Ref<NavigationPolygon> TileData::_get_navigation_polygon_bind_compat_84660(int p_layer_id) const { + return get_navigation_polygon(p_layer_id, false, false, false); +} + +Ref<OccluderPolygon2D> TileData::_get_occluder_bind_compat_84660(int p_layer_id) const { + return get_occluder(p_layer_id, false, false, false); +} + +void TileData::_bind_compatibility_methods() { + ClassDB::bind_compatibility_method(D_METHOD("get_navigation_polygon"), &TileData::_get_navigation_polygon_bind_compat_84660); + ClassDB::bind_compatibility_method(D_METHOD("get_occluder"), &TileData::_get_occluder_bind_compat_84660); +} + +#endif diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp index 7b4080517f..2de7cce5c7 100644 --- a/scene/resources/tile_set.cpp +++ b/scene/resources/tile_set.cpp @@ -29,6 +29,7 @@ /**************************************************************************/ #include "tile_set.h" +#include "tile_set.compat.inc" #include "core/io/marshalls.h" #include "core/math/geometry_2d.h" @@ -1839,20 +1840,25 @@ Vector<Vector<Ref<Texture2D>>> TileSet::generate_terrains_icons(Size2i p_size) { // Generate the icons. for (int terrain_set = 0; terrain_set < get_terrain_sets_count(); terrain_set++) { for (int terrain = 0; terrain < get_terrains_count(terrain_set); terrain++) { - Ref<Image> image; - image.instantiate(); + Ref<Image> dst_image; + dst_image.instantiate(); if (counts[terrain_set][terrain].count > 0) { // Get the best tile. - Ref<Texture2D> texture = counts[terrain_set][terrain].texture; + Ref<Texture2D> src_texture = counts[terrain_set][terrain].texture; + ERR_FAIL_COND_V(src_texture.is_null(), output); + Ref<Image> src_image = src_texture->get_image(); + ERR_FAIL_COND_V(src_image.is_null(), output); Rect2i region = counts[terrain_set][terrain].region; - image->initialize_data(region.size.x, region.size.y, false, Image::FORMAT_RGBA8); - image->blit_rect(texture->get_image(), region, Point2i()); - image->resize(p_size.x, p_size.y, Image::INTERPOLATE_NEAREST); + + dst_image->initialize_data(region.size.x, region.size.y, false, src_image->get_format()); + dst_image->blit_rect(src_image, region, Point2i()); + dst_image->convert(Image::FORMAT_RGBA8); + dst_image->resize(p_size.x, p_size.y, Image::INTERPOLATE_NEAREST); } else { - image->initialize_data(1, 1, false, Image::FORMAT_RGBA8); - image->set_pixel(0, 0, get_terrain_color(terrain_set, terrain)); + dst_image->initialize_data(1, 1, false, Image::FORMAT_RGBA8); + dst_image->set_pixel(0, 0, get_terrain_color(terrain_set, terrain)); } - Ref<ImageTexture> icon = ImageTexture::create_from_image(image); + Ref<ImageTexture> icon = ImageTexture::create_from_image(dst_image); icon->set_size_override(p_size); output.write[terrain_set].write[terrain] = icon; } @@ -5099,7 +5105,7 @@ void TileData::add_occlusion_layer(int p_to_pos) { p_to_pos = occluders.size(); } ERR_FAIL_INDEX(p_to_pos, occluders.size() + 1); - occluders.insert(p_to_pos, Ref<OccluderPolygon2D>()); + occluders.insert(p_to_pos, OcclusionLayerTileData()); } void TileData::move_occlusion_layer(int p_from_index, int p_to_pos) { @@ -5214,7 +5220,7 @@ void TileData::add_navigation_layer(int p_to_pos) { p_to_pos = navigation.size(); } ERR_FAIL_INDEX(p_to_pos, navigation.size() + 1); - navigation.insert(p_to_pos, Ref<NavigationPolygon>()); + navigation.insert(p_to_pos, NavigationLayerTileData()); } void TileData::move_navigation_layer(int p_from_index, int p_to_pos) { @@ -5360,13 +5366,35 @@ int TileData::get_y_sort_origin() const { void TileData::set_occluder(int p_layer_id, Ref<OccluderPolygon2D> p_occluder_polygon) { ERR_FAIL_INDEX(p_layer_id, occluders.size()); - occluders.write[p_layer_id] = p_occluder_polygon; + occluders.write[p_layer_id].occluder = p_occluder_polygon; + occluders.write[p_layer_id].transformed_occluders.clear(); emit_signal(SNAME("changed")); } -Ref<OccluderPolygon2D> TileData::get_occluder(int p_layer_id) const { +Ref<OccluderPolygon2D> TileData::get_occluder(int p_layer_id, bool p_flip_h, bool p_flip_v, bool p_transpose) const { ERR_FAIL_INDEX_V(p_layer_id, occluders.size(), Ref<OccluderPolygon2D>()); - return occluders[p_layer_id]; + + const OcclusionLayerTileData &layer_tile_data = occluders[p_layer_id]; + + int key = int(p_flip_h) | int(p_flip_v) << 1 | int(p_transpose) << 2; + if (key == 0) { + return layer_tile_data.occluder; + } + + if (layer_tile_data.occluder.is_null()) { + return Ref<OccluderPolygon2D>(); + } + + HashMap<int, Ref<OccluderPolygon2D>>::Iterator I = layer_tile_data.transformed_occluders.find(key); + if (!I) { + Ref<OccluderPolygon2D> transformed_polygon; + transformed_polygon.instantiate(); + transformed_polygon->set_polygon(get_transformed_vertices(layer_tile_data.occluder->get_polygon(), p_flip_h, p_flip_v, p_transpose)); + layer_tile_data.transformed_occluders[key] = transformed_polygon; + return transformed_polygon; + } else { + return I->value; + } } // Physics @@ -5426,22 +5454,25 @@ void TileData::set_collision_polygon_points(int p_layer_id, int p_polygon_index, ERR_FAIL_INDEX(p_polygon_index, physics[p_layer_id].polygons.size()); ERR_FAIL_COND_MSG(p_polygon.size() != 0 && p_polygon.size() < 3, "Invalid polygon. Needs either 0 or more than 3 points."); + TileData::PhysicsLayerTileData::PolygonShapeTileData &polygon_shape_tile_data = physics.write[p_layer_id].polygons.write[p_polygon_index]; + if (p_polygon.is_empty()) { - physics.write[p_layer_id].polygons.write[p_polygon_index].shapes.clear(); + polygon_shape_tile_data.shapes.clear(); } else { // Decompose into convex shapes. Vector<Vector<Vector2>> decomp = Geometry2D::decompose_polygon_in_convex(p_polygon); ERR_FAIL_COND_MSG(decomp.is_empty(), "Could not decompose the polygon into convex shapes."); - physics.write[p_layer_id].polygons.write[p_polygon_index].shapes.resize(decomp.size()); + polygon_shape_tile_data.shapes.resize(decomp.size()); for (int i = 0; i < decomp.size(); i++) { Ref<ConvexPolygonShape2D> shape; shape.instantiate(); shape->set_points(decomp[i]); - physics.write[p_layer_id].polygons.write[p_polygon_index].shapes[i] = shape; + polygon_shape_tile_data.shapes[i] = shape; } } - physics.write[p_layer_id].polygons.write[p_polygon_index].polygon = p_polygon; + polygon_shape_tile_data.transformed_shapes.clear(); + polygon_shape_tile_data.polygon = p_polygon; emit_signal(SNAME("changed")); } @@ -5483,11 +5514,36 @@ int TileData::get_collision_polygon_shapes_count(int p_layer_id, int p_polygon_i return physics[p_layer_id].polygons[p_polygon_index].shapes.size(); } -Ref<ConvexPolygonShape2D> TileData::get_collision_polygon_shape(int p_layer_id, int p_polygon_index, int shape_index) const { +Ref<ConvexPolygonShape2D> TileData::get_collision_polygon_shape(int p_layer_id, int p_polygon_index, int shape_index, bool p_flip_h, bool p_flip_v, bool p_transpose) const { ERR_FAIL_INDEX_V(p_layer_id, physics.size(), Ref<ConvexPolygonShape2D>()); ERR_FAIL_INDEX_V(p_polygon_index, physics[p_layer_id].polygons.size(), Ref<ConvexPolygonShape2D>()); ERR_FAIL_INDEX_V(shape_index, (int)physics[p_layer_id].polygons[p_polygon_index].shapes.size(), Ref<ConvexPolygonShape2D>()); - return physics[p_layer_id].polygons[p_polygon_index].shapes[shape_index]; + + const PhysicsLayerTileData &layer_tile_data = physics[p_layer_id]; + const PhysicsLayerTileData::PolygonShapeTileData &shapes_data = layer_tile_data.polygons[p_polygon_index]; + + int key = int(p_flip_h) | int(p_flip_v) << 1 | int(p_transpose) << 2; + if (key == 0) { + return shapes_data.shapes[shape_index]; + } + if (shapes_data.shapes[shape_index].is_null()) { + return Ref<ConvexPolygonShape2D>(); + } + + HashMap<int, LocalVector<Ref<ConvexPolygonShape2D>>>::Iterator I = shapes_data.transformed_shapes.find(key); + if (!I) { + int size = shapes_data.shapes.size(); + shapes_data.transformed_shapes[key].resize(size); + for (int i = 0; i < size; i++) { + Ref<ConvexPolygonShape2D> transformed_polygon; + transformed_polygon.instantiate(); + transformed_polygon->set_points(get_transformed_vertices(shapes_data.shapes[shape_index]->get_points(), p_flip_h, p_flip_v, p_transpose)); + shapes_data.transformed_shapes[key][i] = transformed_polygon; + } + return shapes_data.transformed_shapes[key][shape_index]; + } else { + return I->value[shape_index]; + } } // Terrain @@ -5565,13 +5621,50 @@ TileSet::TerrainsPattern TileData::get_terrains_pattern() const { // Navigation void TileData::set_navigation_polygon(int p_layer_id, Ref<NavigationPolygon> p_navigation_polygon) { ERR_FAIL_INDEX(p_layer_id, navigation.size()); - navigation.write[p_layer_id] = p_navigation_polygon; + navigation.write[p_layer_id].navigation_polygon = p_navigation_polygon; + navigation.write[p_layer_id].transformed_navigation_polygon.clear(); emit_signal(SNAME("changed")); } -Ref<NavigationPolygon> TileData::get_navigation_polygon(int p_layer_id) const { +Ref<NavigationPolygon> TileData::get_navigation_polygon(int p_layer_id, bool p_flip_h, bool p_flip_v, bool p_transpose) const { ERR_FAIL_INDEX_V(p_layer_id, navigation.size(), Ref<NavigationPolygon>()); - return navigation[p_layer_id]; + + const NavigationLayerTileData &layer_tile_data = navigation[p_layer_id]; + + int key = int(p_flip_h) | int(p_flip_v) << 1 | int(p_transpose) << 2; + if (key == 0) { + return layer_tile_data.navigation_polygon; + } + + if (layer_tile_data.navigation_polygon.is_null()) { + return Ref<NavigationPolygon>(); + } + + HashMap<int, Ref<NavigationPolygon>>::Iterator I = layer_tile_data.transformed_navigation_polygon.find(key); + if (!I) { + Ref<NavigationPolygon> transformed_polygon; + transformed_polygon.instantiate(); + + PackedVector2Array new_points = get_transformed_vertices(layer_tile_data.navigation_polygon->get_vertices(), p_flip_h, p_flip_v, p_transpose); + transformed_polygon->set_vertices(new_points); + + for (int i = 0; i < layer_tile_data.navigation_polygon->get_outline_count(); i++) { + PackedVector2Array new_outline = get_transformed_vertices(layer_tile_data.navigation_polygon->get_outline(i), p_flip_h, p_flip_v, p_transpose); + transformed_polygon->add_outline(new_outline); + } + + PackedInt32Array indices; + indices.resize(new_points.size()); + int *w = indices.ptrw(); + for (int i = 0; i < new_points.size(); i++) { + w[i] = i; + } + transformed_polygon->add_polygon(indices); + layer_tile_data.transformed_navigation_polygon[key] = transformed_polygon; + return transformed_polygon; + } else { + return I->value; + } } // Misc @@ -5610,6 +5703,33 @@ Variant TileData::get_custom_data_by_layer_id(int p_layer_id) const { return custom_data[p_layer_id]; } +PackedVector2Array TileData::get_transformed_vertices(const PackedVector2Array &p_vertices, bool p_flip_h, bool p_flip_v, bool p_transpose) { + const Vector2 *r = p_vertices.ptr(); + int size = p_vertices.size(); + + PackedVector2Array new_points; + new_points.resize(size); + Vector2 *w = new_points.ptrw(); + + for (int i = 0; i < size; i++) { + Vector2 v; + if (p_transpose) { + v = Vector2(r[i].y, r[i].x); + } else { + v = r[i]; + } + + if (p_flip_h) { + v.x *= -1; + } + if (p_flip_v) { + v.y *= -1; + } + w[i] = v; + } + return new_points; +} + bool TileData::_set(const StringName &p_name, const Variant &p_value) { #ifndef DISABLE_DEPRECATED if (p_name == "texture_offset") { @@ -5840,7 +5960,7 @@ void TileData::_get_property_list(List<PropertyInfo> *p_list) const { for (int i = 0; i < occluders.size(); i++) { // occlusion_layer_%d/polygon property_info = PropertyInfo(Variant::OBJECT, vformat("occlusion_layer_%d/%s", i, PNAME("polygon")), PROPERTY_HINT_RESOURCE_TYPE, "OccluderPolygon2D", PROPERTY_USAGE_DEFAULT); - if (!occluders[i].is_valid()) { + if (occluders[i].occluder.is_null()) { property_info.usage ^= PROPERTY_USAGE_STORAGE; } p_list->push_back(property_info); @@ -5896,7 +6016,7 @@ void TileData::_get_property_list(List<PropertyInfo> *p_list) const { p_list->push_back(PropertyInfo(Variant::NIL, GNAME("Navigation", ""), PROPERTY_HINT_NONE, "", PROPERTY_USAGE_GROUP)); for (int i = 0; i < navigation.size(); i++) { property_info = PropertyInfo(Variant::OBJECT, vformat("navigation_layer_%d/%s", i, PNAME("polygon")), PROPERTY_HINT_RESOURCE_TYPE, "NavigationPolygon", PROPERTY_USAGE_DEFAULT); - if (!navigation[i].is_valid()) { + if (navigation[i].navigation_polygon.is_null()) { property_info.usage ^= PROPERTY_USAGE_STORAGE; } p_list->push_back(property_info); @@ -5937,7 +6057,7 @@ void TileData::_bind_methods() { ClassDB::bind_method(D_METHOD("get_y_sort_origin"), &TileData::get_y_sort_origin); ClassDB::bind_method(D_METHOD("set_occluder", "layer_id", "occluder_polygon"), &TileData::set_occluder); - ClassDB::bind_method(D_METHOD("get_occluder", "layer_id"), &TileData::get_occluder); + ClassDB::bind_method(D_METHOD("get_occluder", "layer_id", "flip_h", "flip_v", "transpose"), &TileData::get_occluder, DEFVAL(false), DEFVAL(false), DEFVAL(false)); // Physics. ClassDB::bind_method(D_METHOD("set_constant_linear_velocity", "layer_id", "velocity"), &TileData::set_constant_linear_velocity); @@ -5965,7 +6085,7 @@ void TileData::_bind_methods() { // Navigation ClassDB::bind_method(D_METHOD("set_navigation_polygon", "layer_id", "navigation_polygon"), &TileData::set_navigation_polygon); - ClassDB::bind_method(D_METHOD("get_navigation_polygon", "layer_id"), &TileData::get_navigation_polygon); + ClassDB::bind_method(D_METHOD("get_navigation_polygon", "layer_id", "flip_h", "flip_v", "transpose"), &TileData::get_navigation_polygon, DEFVAL(false), DEFVAL(false), DEFVAL(false)); // Misc. ClassDB::bind_method(D_METHOD("set_probability", "probability"), &TileData::set_probability); diff --git a/scene/resources/tile_set.h b/scene/resources/tile_set.h index 313c4df65d..a71982cd56 100644 --- a/scene/resources/tile_set.h +++ b/scene/resources/tile_set.h @@ -815,13 +815,18 @@ private: Color modulate = Color(1.0, 1.0, 1.0, 1.0); int z_index = 0; int y_sort_origin = 0; - Vector<Ref<OccluderPolygon2D>> occluders; + struct OcclusionLayerTileData { + Ref<OccluderPolygon2D> occluder; + mutable HashMap<int, Ref<OccluderPolygon2D>> transformed_occluders; + }; + Vector<OcclusionLayerTileData> occluders; // Physics struct PhysicsLayerTileData { struct PolygonShapeTileData { LocalVector<Vector2> polygon; LocalVector<Ref<ConvexPolygonShape2D>> shapes; + mutable HashMap<int, LocalVector<Ref<ConvexPolygonShape2D>>> transformed_shapes; bool one_way = false; float one_way_margin = 1.0; }; @@ -839,7 +844,11 @@ private: int terrain_peering_bits[16] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; // Navigation - Vector<Ref<NavigationPolygon>> navigation; + struct NavigationLayerTileData { + Ref<NavigationPolygon> navigation_polygon; + mutable HashMap<int, Ref<NavigationPolygon>> transformed_navigation_polygon; + }; + Vector<NavigationLayerTileData> navigation; // Misc double probability = 1.0; @@ -853,6 +862,13 @@ protected: void _get_property_list(List<PropertyInfo> *p_list) const; static void _bind_methods(); +#ifndef DISABLE_DEPRECATED + Ref<NavigationPolygon> _get_navigation_polygon_bind_compat_84660(int p_layer_id) const; + Ref<OccluderPolygon2D> _get_occluder_bind_compat_84660(int p_layer_id) const; + + static void _bind_compatibility_methods(); +#endif + public: // Not exposed. void set_tile_set(const TileSet *p_tile_set); @@ -901,7 +917,7 @@ public: int get_y_sort_origin() const; void set_occluder(int p_layer_id, Ref<OccluderPolygon2D> p_occluder_polygon); - Ref<OccluderPolygon2D> get_occluder(int p_layer_id) const; + Ref<OccluderPolygon2D> get_occluder(int p_layer_id, bool p_flip_h = false, bool p_flip_v = false, bool p_transpose = false) const; // Physics void set_constant_linear_velocity(int p_layer_id, const Vector2 &p_velocity); @@ -919,7 +935,7 @@ public: void set_collision_polygon_one_way_margin(int p_layer_id, int p_polygon_index, float p_one_way_margin); float get_collision_polygon_one_way_margin(int p_layer_id, int p_polygon_index) const; int get_collision_polygon_shapes_count(int p_layer_id, int p_polygon_index) const; - Ref<ConvexPolygonShape2D> get_collision_polygon_shape(int p_layer_id, int p_polygon_index, int shape_index) const; + Ref<ConvexPolygonShape2D> get_collision_polygon_shape(int p_layer_id, int p_polygon_index, int shape_index, bool p_flip_h = false, bool p_flip_v = false, bool p_transpose = false) const; // Terrain void set_terrain_set(int p_terrain_id); @@ -934,7 +950,7 @@ public: // Navigation void set_navigation_polygon(int p_layer_id, Ref<NavigationPolygon> p_navigation_polygon); - Ref<NavigationPolygon> get_navigation_polygon(int p_layer_id) const; + Ref<NavigationPolygon> get_navigation_polygon(int p_layer_id, bool p_flip_h = false, bool p_flip_v = false, bool p_transpose = false) const; // Misc void set_probability(float p_probability); @@ -945,6 +961,9 @@ public: Variant get_custom_data(String p_layer_name) const; void set_custom_data_by_layer_id(int p_layer_id, Variant p_value); Variant get_custom_data_by_layer_id(int p_layer_id) const; + + // Polygons. + static PackedVector2Array get_transformed_vertices(const PackedVector2Array &p_vertices, bool p_flip_h, bool p_flip_v, bool p_transpose); }; VARIANT_ENUM_CAST(TileSet::CellNeighbor); diff --git a/scene/resources/video_stream.cpp b/scene/resources/video_stream.cpp index dc8545426f..3b152d11ce 100644 --- a/scene/resources/video_stream.cpp +++ b/scene/resources/video_stream.cpp @@ -172,6 +172,7 @@ Ref<VideoStreamPlayback> VideoStream::instantiate_playback() { void VideoStream::set_file(const String &p_file) { file = p_file; + emit_changed(); } String VideoStream::get_file() { diff --git a/scene/resources/visual_shader.cpp b/scene/resources/visual_shader.cpp index 423ef3867f..9fb6b364a7 100644 --- a/scene/resources/visual_shader.cpp +++ b/scene/resources/visual_shader.cpp @@ -962,12 +962,13 @@ void VisualShader::remove_node(Type p_type, int p_id) { for (List<Connection>::Element *E = g->connections.front(); E;) { List<Connection>::Element *N = E->next(); - if (E->get().from_node == p_id || E->get().to_node == p_id) { - if (E->get().from_node == p_id) { - g->nodes[E->get().to_node].prev_connected_nodes.erase(p_id); - g->nodes[E->get().to_node].node->set_input_port_connected(E->get().to_port, false); - } else if (E->get().to_node == p_id) { - g->nodes[E->get().from_node].next_connected_nodes.erase(p_id); + const VisualShader::Connection &connection = E->get(); + if (connection.from_node == p_id || connection.to_node == p_id) { + if (connection.from_node == p_id) { + g->nodes[connection.to_node].prev_connected_nodes.erase(p_id); + g->nodes[connection.to_node].node->set_input_port_connected(connection.to_port, false); + } else if (connection.to_node == p_id) { + g->nodes[connection.from_node].next_connected_nodes.erase(p_id); } g->connections.erase(E); } diff --git a/servers/display_server.cpp b/servers/display_server.cpp index 6459cc7462..bb28bc0eb8 100644 --- a/servers/display_server.cpp +++ b/servers/display_server.cpp @@ -267,6 +267,11 @@ void DisplayServer::global_menu_clear(const String &p_menu_root) { WARN_PRINT("Global menus not supported by this display server."); } +Dictionary DisplayServer::global_menu_get_system_menu_roots() const { + WARN_PRINT("Global menus not supported by this display server."); + return Dictionary(); +} + bool DisplayServer::tts_is_speaking() const { WARN_PRINT("TTS is not supported by this display server."); return false; @@ -652,6 +657,8 @@ void DisplayServer::_bind_methods() { ClassDB::bind_method(D_METHOD("global_menu_remove_item", "menu_root", "idx"), &DisplayServer::global_menu_remove_item); ClassDB::bind_method(D_METHOD("global_menu_clear", "menu_root"), &DisplayServer::global_menu_clear); + ClassDB::bind_method(D_METHOD("global_menu_get_system_menu_roots"), &DisplayServer::global_menu_get_system_menu_roots); + ClassDB::bind_method(D_METHOD("tts_is_speaking"), &DisplayServer::tts_is_speaking); ClassDB::bind_method(D_METHOD("tts_is_paused"), &DisplayServer::tts_is_paused); ClassDB::bind_method(D_METHOD("tts_get_voices"), &DisplayServer::tts_get_voices); diff --git a/servers/display_server.h b/servers/display_server.h index d2e112d224..4450677f71 100644 --- a/servers/display_server.h +++ b/servers/display_server.h @@ -185,6 +185,8 @@ public: virtual void global_menu_remove_item(const String &p_menu_root, int p_idx); virtual void global_menu_clear(const String &p_menu_root); + virtual Dictionary global_menu_get_system_menu_roots() const; + struct TTSUtterance { String text; String voice; diff --git a/servers/navigation_server_2d.cpp b/servers/navigation_server_2d.cpp index 3804b45e1a..d37bbcfff0 100644 --- a/servers/navigation_server_2d.cpp +++ b/servers/navigation_server_2d.cpp @@ -59,6 +59,8 @@ void NavigationServer2D::_bind_methods() { ClassDB::bind_method(D_METHOD("map_force_update", "map"), &NavigationServer2D::map_force_update); + ClassDB::bind_method(D_METHOD("map_get_random_point", "map", "navigation_layers", "uniformly"), &NavigationServer2D::map_get_random_point); + ClassDB::bind_method(D_METHOD("query_path", "parameters", "result"), &NavigationServer2D::query_path); ClassDB::bind_method(D_METHOD("region_create"), &NavigationServer2D::region_create); @@ -82,6 +84,7 @@ void NavigationServer2D::_bind_methods() { ClassDB::bind_method(D_METHOD("region_get_connections_count", "region"), &NavigationServer2D::region_get_connections_count); ClassDB::bind_method(D_METHOD("region_get_connection_pathway_start", "region", "connection"), &NavigationServer2D::region_get_connection_pathway_start); ClassDB::bind_method(D_METHOD("region_get_connection_pathway_end", "region", "connection"), &NavigationServer2D::region_get_connection_pathway_end); + ClassDB::bind_method(D_METHOD("region_get_random_point", "region", "navigation_layers", "uniformly"), &NavigationServer2D::region_get_random_point); ClassDB::bind_method(D_METHOD("link_create"), &NavigationServer2D::link_create); ClassDB::bind_method(D_METHOD("link_set_map", "link", "map"), &NavigationServer2D::link_set_map); diff --git a/servers/navigation_server_2d.h b/servers/navigation_server_2d.h index 0afd794c26..66bfface3e 100644 --- a/servers/navigation_server_2d.h +++ b/servers/navigation_server_2d.h @@ -103,6 +103,8 @@ public: virtual void map_force_update(RID p_map) = 0; + virtual Vector2 map_get_random_point(RID p_map, uint32_t p_navigation_layers, bool p_uniformly) const = 0; + /// Creates a new region. virtual RID region_create() = 0; @@ -145,6 +147,8 @@ public: virtual Vector2 region_get_connection_pathway_start(RID p_region, int p_connection_id) const = 0; virtual Vector2 region_get_connection_pathway_end(RID p_region, int p_connection_id) const = 0; + virtual Vector2 region_get_random_point(RID p_region, uint32_t p_navigation_layers, bool p_uniformly) const = 0; + /// Creates a new link between positions in the nav map. virtual RID link_create() = 0; diff --git a/servers/navigation_server_2d_dummy.h b/servers/navigation_server_2d_dummy.h index d64a9454aa..d380ca5242 100644 --- a/servers/navigation_server_2d_dummy.h +++ b/servers/navigation_server_2d_dummy.h @@ -58,6 +58,7 @@ public: TypedArray<RID> map_get_agents(RID p_map) const override { return TypedArray<RID>(); } TypedArray<RID> map_get_obstacles(RID p_map) const override { return TypedArray<RID>(); } void map_force_update(RID p_map) override {} + Vector2 map_get_random_point(RID p_map, uint32_t p_naviation_layers, bool p_uniformly) const override { return Vector2(); }; RID region_create() override { return RID(); } void region_set_enabled(RID p_region, bool p_enabled) override {} @@ -80,6 +81,7 @@ public: int region_get_connections_count(RID p_region) const override { return 0; } Vector2 region_get_connection_pathway_start(RID p_region, int p_connection_id) const override { return Vector2(); } Vector2 region_get_connection_pathway_end(RID p_region, int p_connection_id) const override { return Vector2(); } + Vector2 region_get_random_point(RID p_region, uint32_t p_navigation_layers, bool p_uniformly) const override { return Vector2(); }; RID link_create() override { return RID(); } void link_set_map(RID p_link, RID p_map) override {} diff --git a/servers/navigation_server_3d.cpp b/servers/navigation_server_3d.cpp index eccacd3ea8..874809a6d7 100644 --- a/servers/navigation_server_3d.cpp +++ b/servers/navigation_server_3d.cpp @@ -64,6 +64,8 @@ void NavigationServer3D::_bind_methods() { ClassDB::bind_method(D_METHOD("map_force_update", "map"), &NavigationServer3D::map_force_update); + ClassDB::bind_method(D_METHOD("map_get_random_point", "map", "navigation_layers", "uniformly"), &NavigationServer3D::map_get_random_point); + ClassDB::bind_method(D_METHOD("query_path", "parameters", "result"), &NavigationServer3D::query_path); ClassDB::bind_method(D_METHOD("region_create"), &NavigationServer3D::region_create); @@ -90,6 +92,7 @@ void NavigationServer3D::_bind_methods() { ClassDB::bind_method(D_METHOD("region_get_connections_count", "region"), &NavigationServer3D::region_get_connections_count); ClassDB::bind_method(D_METHOD("region_get_connection_pathway_start", "region", "connection"), &NavigationServer3D::region_get_connection_pathway_start); ClassDB::bind_method(D_METHOD("region_get_connection_pathway_end", "region", "connection"), &NavigationServer3D::region_get_connection_pathway_end); + ClassDB::bind_method(D_METHOD("region_get_random_point", "region", "navigation_layers", "uniformly"), &NavigationServer3D::region_get_random_point); ClassDB::bind_method(D_METHOD("link_create"), &NavigationServer3D::link_create); ClassDB::bind_method(D_METHOD("link_set_map", "link", "map"), &NavigationServer3D::link_set_map); diff --git a/servers/navigation_server_3d.h b/servers/navigation_server_3d.h index 53d33d0058..96587afefa 100644 --- a/servers/navigation_server_3d.h +++ b/servers/navigation_server_3d.h @@ -114,6 +114,8 @@ public: virtual void map_force_update(RID p_map) = 0; + virtual Vector3 map_get_random_point(RID p_map, uint32_t p_navigation_layers, bool p_uniformly) const = 0; + /// Creates a new region. virtual RID region_create() = 0; @@ -161,6 +163,8 @@ public: virtual Vector3 region_get_connection_pathway_start(RID p_region, int p_connection_id) const = 0; virtual Vector3 region_get_connection_pathway_end(RID p_region, int p_connection_id) const = 0; + virtual Vector3 region_get_random_point(RID p_region, uint32_t p_navigation_layers, bool p_uniformly) const = 0; + /// Creates a new link between positions in the nav map. virtual RID link_create() = 0; diff --git a/servers/navigation_server_3d_dummy.h b/servers/navigation_server_3d_dummy.h index 5258022328..7bd3eec937 100644 --- a/servers/navigation_server_3d_dummy.h +++ b/servers/navigation_server_3d_dummy.h @@ -58,6 +58,7 @@ public: Vector3 map_get_closest_point(RID p_map, const Vector3 &p_point) const override { return Vector3(); } Vector3 map_get_closest_point_normal(RID p_map, const Vector3 &p_point) const override { return Vector3(); } RID map_get_closest_point_owner(RID p_map, const Vector3 &p_point) const override { return RID(); } + Vector3 map_get_random_point(RID p_map, uint32_t p_navigation_layers, bool p_uniformly) const override { return Vector3(); } TypedArray<RID> map_get_links(RID p_map) const override { return TypedArray<RID>(); } TypedArray<RID> map_get_regions(RID p_map) const override { return TypedArray<RID>(); } TypedArray<RID> map_get_agents(RID p_map) const override { return TypedArray<RID>(); } @@ -87,6 +88,7 @@ public: int region_get_connections_count(RID p_region) const override { return 0; } Vector3 region_get_connection_pathway_start(RID p_region, int p_connection_id) const override { return Vector3(); } Vector3 region_get_connection_pathway_end(RID p_region, int p_connection_id) const override { return Vector3(); } + Vector3 region_get_random_point(RID p_region, uint32_t p_navigation_layers, bool p_uniformly) const override { return Vector3(); } RID link_create() override { return RID(); } void link_set_map(RID p_link, RID p_map) override {} RID link_get_map(RID p_link) const override { return RID(); } diff --git a/servers/physics_2d/godot_area_2d.h b/servers/physics_2d/godot_area_2d.h index 234e4eb9a9..d14ddb6a2e 100644 --- a/servers/physics_2d/godot_area_2d.h +++ b/servers/physics_2d/godot_area_2d.h @@ -167,7 +167,7 @@ void GodotArea2D::add_body_to_query(GodotBody2D *p_body, uint32_t p_body_shape, void GodotArea2D::remove_body_from_query(GodotBody2D *p_body, uint32_t p_body_shape, uint32_t p_area_shape) { BodyKey bk(p_body, p_body_shape, p_area_shape); monitored_bodies[bk].dec(); - if (!monitor_query_list.in_list()) { + if (get_space() && !monitor_query_list.in_list()) { _queue_monitor_update(); } } @@ -183,7 +183,7 @@ void GodotArea2D::add_area_to_query(GodotArea2D *p_area, uint32_t p_area_shape, void GodotArea2D::remove_area_from_query(GodotArea2D *p_area, uint32_t p_area_shape, uint32_t p_self_shape) { BodyKey bk(p_area, p_area_shape, p_self_shape); monitored_areas[bk].dec(); - if (!monitor_query_list.in_list()) { + if (get_space() && !monitor_query_list.in_list()) { _queue_monitor_update(); } } diff --git a/servers/physics_2d/godot_body_2d.cpp b/servers/physics_2d/godot_body_2d.cpp index 12c3e1e5b4..01996dc43c 100644 --- a/servers/physics_2d/godot_body_2d.cpp +++ b/servers/physics_2d/godot_body_2d.cpp @@ -407,7 +407,8 @@ void GodotBody2D::set_space(GodotSpace2D *p_space) { if (get_space()) { _mass_properties_changed(); - if (active) { + + if (active && !active_list.in_list()) { get_space()->body_add_to_active_list(&active_list); } } diff --git a/servers/physics_2d/godot_collision_object_2d.cpp b/servers/physics_2d/godot_collision_object_2d.cpp index 4fb53a2d89..9851cac140 100644 --- a/servers/physics_2d/godot_collision_object_2d.cpp +++ b/servers/physics_2d/godot_collision_object_2d.cpp @@ -212,20 +212,21 @@ void GodotCollisionObject2D::_update_shapes_with_motion(const Vector2 &p_motion) } void GodotCollisionObject2D::_set_space(GodotSpace2D *p_space) { - if (space) { - space->remove_object(this); + GodotSpace2D *old_space = space; + space = p_space; + + if (old_space) { + old_space->remove_object(this); for (int i = 0; i < shapes.size(); i++) { Shape &s = shapes.write[i]; if (s.bpid) { - space->get_broadphase()->remove(s.bpid); + old_space->get_broadphase()->remove(s.bpid); s.bpid = 0; } } } - space = p_space; - if (space) { space->add_object(this); _update_shapes(); diff --git a/servers/physics_3d/godot_area_3d.h b/servers/physics_3d/godot_area_3d.h index f05d0f9019..c3c9e494a4 100644 --- a/servers/physics_3d/godot_area_3d.h +++ b/servers/physics_3d/godot_area_3d.h @@ -204,7 +204,7 @@ void GodotArea3D::add_body_to_query(GodotBody3D *p_body, uint32_t p_body_shape, void GodotArea3D::remove_body_from_query(GodotBody3D *p_body, uint32_t p_body_shape, uint32_t p_area_shape) { BodyKey bk(p_body, p_body_shape, p_area_shape); monitored_bodies[bk].dec(); - if (!monitor_query_list.in_list()) { + if (get_space() && !monitor_query_list.in_list()) { _queue_monitor_update(); } } @@ -220,7 +220,7 @@ void GodotArea3D::add_area_to_query(GodotArea3D *p_area, uint32_t p_area_shape, void GodotArea3D::remove_area_from_query(GodotArea3D *p_area, uint32_t p_area_shape, uint32_t p_self_shape) { BodyKey bk(p_area, p_area_shape, p_self_shape); monitored_areas[bk].dec(); - if (!monitor_query_list.in_list()) { + if (get_space() && !monitor_query_list.in_list()) { _queue_monitor_update(); } } diff --git a/servers/physics_3d/godot_body_3d.cpp b/servers/physics_3d/godot_body_3d.cpp index e102d0f3c9..407957b904 100644 --- a/servers/physics_3d/godot_body_3d.cpp +++ b/servers/physics_3d/godot_body_3d.cpp @@ -454,7 +454,8 @@ void GodotBody3D::set_space(GodotSpace3D *p_space) { if (get_space()) { _mass_properties_changed(); - if (active) { + + if (active && !active_list.in_list()) { get_space()->body_add_to_active_list(&active_list); } } diff --git a/servers/physics_3d/godot_collision_object_3d.cpp b/servers/physics_3d/godot_collision_object_3d.cpp index 0d7fcb67f6..283614a43d 100644 --- a/servers/physics_3d/godot_collision_object_3d.cpp +++ b/servers/physics_3d/godot_collision_object_3d.cpp @@ -210,20 +210,21 @@ void GodotCollisionObject3D::_update_shapes_with_motion(const Vector3 &p_motion) } void GodotCollisionObject3D::_set_space(GodotSpace3D *p_space) { - if (space) { - space->remove_object(this); + GodotSpace3D *old_space = space; + space = p_space; + + if (old_space) { + old_space->remove_object(this); for (int i = 0; i < shapes.size(); i++) { Shape &s = shapes.write[i]; if (s.bpid) { - space->get_broadphase()->remove(s.bpid); + old_space->get_broadphase()->remove(s.bpid); s.bpid = 0; } } } - space = p_space; - if (space) { space->add_object(this); _update_shapes(); diff --git a/servers/register_server_types.cpp b/servers/register_server_types.cpp index 50e14a1f37..2beab44f91 100644 --- a/servers/register_server_types.cpp +++ b/servers/register_server_types.cpp @@ -117,6 +117,8 @@ static MovieWriterMJPEG *writer_mjpeg = nullptr; static MovieWriterPNGWAV *writer_pngwav = nullptr; void register_server_types() { + OS::get_singleton()->benchmark_begin_measure("Servers", "Register Extensions"); + shader_types = memnew(ShaderTypes); GDREGISTER_CLASS(TextServerManager); @@ -293,16 +295,24 @@ void register_server_types() { writer_pngwav = memnew(MovieWriterPNGWAV); MovieWriter::add_writer(writer_pngwav); + + OS::get_singleton()->benchmark_end_measure("Servers", "Register Extensions"); } void unregister_server_types() { + OS::get_singleton()->benchmark_begin_measure("Servers", "Unregister Extensions"); + ServersDebugger::deinitialize(); memdelete(shader_types); memdelete(writer_mjpeg); memdelete(writer_pngwav); + + OS::get_singleton()->benchmark_end_measure("Servers", "Unregister Extensions"); } void register_server_singletons() { + OS::get_singleton()->benchmark_begin_measure("Servers", "Register Singletons"); + Engine::get_singleton()->add_singleton(Engine::Singleton("DisplayServer", DisplayServer::get_singleton(), "DisplayServer")); Engine::get_singleton()->add_singleton(Engine::Singleton("RenderingServer", RenderingServer::get_singleton(), "RenderingServer")); Engine::get_singleton()->add_singleton(Engine::Singleton("AudioServer", AudioServer::get_singleton(), "AudioServer")); @@ -312,4 +322,6 @@ void register_server_singletons() { Engine::get_singleton()->add_singleton(Engine::Singleton("NavigationServer3D", NavigationServer3D::get_singleton(), "NavigationServer3D")); Engine::get_singleton()->add_singleton(Engine::Singleton("XRServer", XRServer::get_singleton(), "XRServer")); Engine::get_singleton()->add_singleton(Engine::Singleton("CameraServer", CameraServer::get_singleton(), "CameraServer")); + + OS::get_singleton()->benchmark_end_measure("Servers", "Register Singletons"); } diff --git a/servers/rendering/dummy/rasterizer_canvas_dummy.h b/servers/rendering/dummy/rasterizer_canvas_dummy.h index 862b941a73..a450b2a21d 100644 --- a/servers/rendering/dummy/rasterizer_canvas_dummy.h +++ b/servers/rendering/dummy/rasterizer_canvas_dummy.h @@ -38,7 +38,7 @@ public: PolygonID request_polygon(const Vector<int> &p_indices, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), const Vector<int> &p_bones = Vector<int>(), const Vector<float> &p_weights = Vector<float>()) override { return 0; } void free_polygon(PolygonID p_polygon) override {} - void canvas_render_items(RID p_to_render_target, Item *p_item_list, const Color &p_modulate, Light *p_light_list, Light *p_directional_list, const Transform2D &p_canvas_transform, RS::CanvasItemTextureFilter p_default_filter, RS::CanvasItemTextureRepeat p_default_repeat, bool p_snap_2d_vertices_to_pixel, bool &r_sdf_used) override {} + void canvas_render_items(RID p_to_render_target, Item *p_item_list, const Color &p_modulate, Light *p_light_list, Light *p_directional_list, const Transform2D &p_canvas_transform, RS::CanvasItemTextureFilter p_default_filter, RS::CanvasItemTextureRepeat p_default_repeat, bool p_snap_2d_vertices_to_pixel, bool &r_sdf_used, RenderingMethod::RenderInfo *r_render_info = nullptr) override {} RID light_create() override { return RID(); } void light_set_texture(RID p_rid, RID p_texture) override {} diff --git a/servers/rendering/dummy/storage/texture_storage.h b/servers/rendering/dummy/storage/texture_storage.h index 2a72547810..b3a5323e66 100644 --- a/servers/rendering/dummy/storage/texture_storage.h +++ b/servers/rendering/dummy/storage/texture_storage.h @@ -177,6 +177,9 @@ public: virtual void render_target_set_as_unused(RID p_render_target) override {} virtual void render_target_set_msaa(RID p_render_target, RS::ViewportMSAA p_msaa) override {} virtual RS::ViewportMSAA render_target_get_msaa(RID p_render_target) const override { return RS::VIEWPORT_MSAA_DISABLED; } + virtual void render_target_set_msaa_needs_resolve(RID p_render_target, bool p_needs_resolve) override {} + virtual bool render_target_get_msaa_needs_resolve(RID p_render_target) const override { return false; } + virtual void render_target_do_msaa_resolve(RID p_render_target) override {} virtual void render_target_set_use_hdr(RID p_render_target, bool p_use_hdr_2d) override {} virtual bool render_target_is_using_hdr(RID p_render_target) const override { return false; } diff --git a/servers/rendering/renderer_canvas_cull.cpp b/servers/rendering/renderer_canvas_cull.cpp index c5206017f7..cc51d44042 100644 --- a/servers/rendering/renderer_canvas_cull.cpp +++ b/servers/rendering/renderer_canvas_cull.cpp @@ -37,7 +37,7 @@ #include "rendering_server_globals.h" #include "servers/rendering/storage/texture_storage.h" -void RendererCanvasCull::_render_canvas_item_tree(RID p_to_render_target, Canvas::ChildItem *p_child_items, int p_child_item_count, Item *p_canvas_item, const Transform2D &p_transform, const Rect2 &p_clip_rect, const Color &p_modulate, RendererCanvasRender::Light *p_lights, RendererCanvasRender::Light *p_directional_lights, RenderingServer::CanvasItemTextureFilter p_default_filter, RenderingServer::CanvasItemTextureRepeat p_default_repeat, bool p_snap_2d_vertices_to_pixel, uint32_t canvas_cull_mask) { +void RendererCanvasCull::_render_canvas_item_tree(RID p_to_render_target, Canvas::ChildItem *p_child_items, int p_child_item_count, Item *p_canvas_item, const Transform2D &p_transform, const Rect2 &p_clip_rect, const Color &p_modulate, RendererCanvasRender::Light *p_lights, RendererCanvasRender::Light *p_directional_lights, RenderingServer::CanvasItemTextureFilter p_default_filter, RenderingServer::CanvasItemTextureRepeat p_default_repeat, bool p_snap_2d_vertices_to_pixel, uint32_t canvas_cull_mask, RenderingMethod::RenderInfo *r_render_info) { RENDER_TIMESTAMP("Cull CanvasItem Tree"); memset(z_list, 0, z_range * sizeof(RendererCanvasRender::Item *)); @@ -69,7 +69,7 @@ void RendererCanvasCull::_render_canvas_item_tree(RID p_to_render_target, Canvas RENDER_TIMESTAMP("Render CanvasItems"); bool sdf_flag; - RSG::canvas_render->canvas_render_items(p_to_render_target, list, p_modulate, p_lights, p_directional_lights, p_transform, p_default_filter, p_default_repeat, p_snap_2d_vertices_to_pixel, sdf_flag); + RSG::canvas_render->canvas_render_items(p_to_render_target, list, p_modulate, p_lights, p_directional_lights, p_transform, p_default_filter, p_default_repeat, p_snap_2d_vertices_to_pixel, sdf_flag, r_render_info); if (sdf_flag) { sdf_used = true; } @@ -354,7 +354,7 @@ void RendererCanvasCull::_cull_canvas_item(Item *p_canvas_item, const Transform2 } } -void RendererCanvasCull::render_canvas(RID p_render_target, Canvas *p_canvas, const Transform2D &p_transform, RendererCanvasRender::Light *p_lights, RendererCanvasRender::Light *p_directional_lights, const Rect2 &p_clip_rect, RenderingServer::CanvasItemTextureFilter p_default_filter, RenderingServer::CanvasItemTextureRepeat p_default_repeat, bool p_snap_2d_transforms_to_pixel, bool p_snap_2d_vertices_to_pixel, uint32_t canvas_cull_mask) { +void RendererCanvasCull::render_canvas(RID p_render_target, Canvas *p_canvas, const Transform2D &p_transform, RendererCanvasRender::Light *p_lights, RendererCanvasRender::Light *p_directional_lights, const Rect2 &p_clip_rect, RenderingServer::CanvasItemTextureFilter p_default_filter, RenderingServer::CanvasItemTextureRepeat p_default_repeat, bool p_snap_2d_transforms_to_pixel, bool p_snap_2d_vertices_to_pixel, uint32_t canvas_cull_mask, RenderingMethod::RenderInfo *r_render_info) { RENDER_TIMESTAMP("> Render Canvas"); sdf_used = false; @@ -377,26 +377,26 @@ void RendererCanvasCull::render_canvas(RID p_render_target, Canvas *p_canvas, co } if (!has_mirror) { - _render_canvas_item_tree(p_render_target, ci, l, nullptr, p_transform, p_clip_rect, p_canvas->modulate, p_lights, p_directional_lights, p_default_filter, p_default_repeat, p_snap_2d_vertices_to_pixel, canvas_cull_mask); + _render_canvas_item_tree(p_render_target, ci, l, nullptr, p_transform, p_clip_rect, p_canvas->modulate, p_lights, p_directional_lights, p_default_filter, p_default_repeat, p_snap_2d_vertices_to_pixel, canvas_cull_mask, r_render_info); } else { //used for parallaxlayer mirroring for (int i = 0; i < l; i++) { const Canvas::ChildItem &ci2 = p_canvas->child_items[i]; - _render_canvas_item_tree(p_render_target, nullptr, 0, ci2.item, p_transform, p_clip_rect, p_canvas->modulate, p_lights, p_directional_lights, p_default_filter, p_default_repeat, p_snap_2d_vertices_to_pixel, canvas_cull_mask); + _render_canvas_item_tree(p_render_target, nullptr, 0, ci2.item, p_transform, p_clip_rect, p_canvas->modulate, p_lights, p_directional_lights, p_default_filter, p_default_repeat, p_snap_2d_vertices_to_pixel, canvas_cull_mask, r_render_info); //mirroring (useful for scrolling backgrounds) if (ci2.mirror.x != 0) { Transform2D xform2 = p_transform * Transform2D(0, Vector2(ci2.mirror.x, 0)); - _render_canvas_item_tree(p_render_target, nullptr, 0, ci2.item, xform2, p_clip_rect, p_canvas->modulate, p_lights, p_directional_lights, p_default_filter, p_default_repeat, p_snap_2d_vertices_to_pixel, canvas_cull_mask); + _render_canvas_item_tree(p_render_target, nullptr, 0, ci2.item, xform2, p_clip_rect, p_canvas->modulate, p_lights, p_directional_lights, p_default_filter, p_default_repeat, p_snap_2d_vertices_to_pixel, canvas_cull_mask, r_render_info); } if (ci2.mirror.y != 0) { Transform2D xform2 = p_transform * Transform2D(0, Vector2(0, ci2.mirror.y)); - _render_canvas_item_tree(p_render_target, nullptr, 0, ci2.item, xform2, p_clip_rect, p_canvas->modulate, p_lights, p_directional_lights, p_default_filter, p_default_repeat, p_snap_2d_vertices_to_pixel, canvas_cull_mask); + _render_canvas_item_tree(p_render_target, nullptr, 0, ci2.item, xform2, p_clip_rect, p_canvas->modulate, p_lights, p_directional_lights, p_default_filter, p_default_repeat, p_snap_2d_vertices_to_pixel, canvas_cull_mask, r_render_info); } if (ci2.mirror.y != 0 && ci2.mirror.x != 0) { Transform2D xform2 = p_transform * Transform2D(0, ci2.mirror); - _render_canvas_item_tree(p_render_target, nullptr, 0, ci2.item, xform2, p_clip_rect, p_canvas->modulate, p_lights, p_directional_lights, p_default_filter, p_default_repeat, p_snap_2d_vertices_to_pixel, canvas_cull_mask); + _render_canvas_item_tree(p_render_target, nullptr, 0, ci2.item, xform2, p_clip_rect, p_canvas->modulate, p_lights, p_directional_lights, p_default_filter, p_default_repeat, p_snap_2d_vertices_to_pixel, canvas_cull_mask, r_render_info); } } } @@ -1396,14 +1396,12 @@ void RendererCanvasCull::canvas_item_add_triangle_array(RID p_item, const Vector ERR_FAIL_COND(!p_bones.is_empty() && p_bones.size() != vertex_count * 4); ERR_FAIL_COND(!p_weights.is_empty() && p_weights.size() != vertex_count * 4); - Vector<int> indices = p_indices; - Item::CommandPolygon *polygon = canvas_item->alloc_command<Item::CommandPolygon>(); ERR_FAIL_NULL(polygon); polygon->texture = p_texture; - polygon->polygon.create(indices, p_points, p_colors, p_uvs, p_bones, p_weights); + polygon->polygon.create(p_indices, p_points, p_colors, p_uvs, p_bones, p_weights); polygon->primitive = RS::PRIMITIVE_TRIANGLES; } @@ -2041,6 +2039,12 @@ void RendererCanvasCull::update_visibility_notifiers() { } } +Rect2 RendererCanvasCull::_debug_canvas_item_get_rect(RID p_item) { + Item *canvas_item = canvas_item_owner.get_or_null(p_item); + ERR_FAIL_NULL_V(canvas_item, Rect2()); + return canvas_item->get_rect(); +} + bool RendererCanvasCull::free(RID p_rid) { if (canvas_owner.owns(p_rid)) { Canvas *canvas = canvas_owner.get_or_null(p_rid); diff --git a/servers/rendering/renderer_canvas_cull.h b/servers/rendering/renderer_canvas_cull.h index 0f51abbb26..ba013e667f 100644 --- a/servers/rendering/renderer_canvas_cull.h +++ b/servers/rendering/renderer_canvas_cull.h @@ -184,7 +184,7 @@ public: _FORCE_INLINE_ void _attach_canvas_item_for_draw(Item *ci, Item *p_canvas_clip, RendererCanvasRender::Item **r_z_list, RendererCanvasRender::Item **r_z_last_list, const Transform2D &xform, const Rect2 &p_clip_rect, Rect2 global_rect, const Color &modulate, int p_z, RendererCanvasCull::Item *p_material_owner, bool p_use_canvas_group, RendererCanvasRender::Item *canvas_group_from, const Transform2D &p_xform); private: - void _render_canvas_item_tree(RID p_to_render_target, Canvas::ChildItem *p_child_items, int p_child_item_count, Item *p_canvas_item, const Transform2D &p_transform, const Rect2 &p_clip_rect, const Color &p_modulate, RendererCanvasRender::Light *p_lights, RendererCanvasRender::Light *p_directional_lights, RS::CanvasItemTextureFilter p_default_filter, RS::CanvasItemTextureRepeat p_default_repeat, bool p_snap_2d_vertices_to_pixel, uint32_t canvas_cull_mask); + void _render_canvas_item_tree(RID p_to_render_target, Canvas::ChildItem *p_child_items, int p_child_item_count, Item *p_canvas_item, const Transform2D &p_transform, const Rect2 &p_clip_rect, const Color &p_modulate, RendererCanvasRender::Light *p_lights, RendererCanvasRender::Light *p_directional_lights, RS::CanvasItemTextureFilter p_default_filter, RS::CanvasItemTextureRepeat p_default_repeat, bool p_snap_2d_vertices_to_pixel, uint32_t canvas_cull_mask, RenderingMethod::RenderInfo *r_render_info = nullptr); void _cull_canvas_item(Item *p_canvas_item, const Transform2D &p_transform, const Rect2 &p_clip_rect, const Color &p_modulate, int p_z, RendererCanvasRender::Item **r_z_list, RendererCanvasRender::Item **r_z_last_list, Item *p_canvas_clip, Item *p_material_owner, bool allow_y_sort, uint32_t canvas_cull_mask); static constexpr int z_range = RS::CANVAS_ITEM_Z_MAX - RS::CANVAS_ITEM_Z_MIN + 1; @@ -193,7 +193,7 @@ private: RendererCanvasRender::Item **z_last_list; public: - void render_canvas(RID p_render_target, Canvas *p_canvas, const Transform2D &p_transform, RendererCanvasRender::Light *p_lights, RendererCanvasRender::Light *p_directional_lights, const Rect2 &p_clip_rect, RS::CanvasItemTextureFilter p_default_filter, RS::CanvasItemTextureRepeat p_default_repeat, bool p_snap_2d_transforms_to_pixel, bool p_snap_2d_vertices_to_pixel, uint32_t canvas_cull_mask); + void render_canvas(RID p_render_target, Canvas *p_canvas, const Transform2D &p_transform, RendererCanvasRender::Light *p_lights, RendererCanvasRender::Light *p_directional_lights, const Rect2 &p_clip_rect, RS::CanvasItemTextureFilter p_default_filter, RS::CanvasItemTextureRepeat p_default_repeat, bool p_snap_2d_transforms_to_pixel, bool p_snap_2d_vertices_to_pixel, uint32_t canvas_cull_mask, RenderingMethod::RenderInfo *r_render_info = nullptr); bool was_sdf_used(); @@ -326,6 +326,8 @@ public: void update_visibility_notifiers(); + Rect2 _debug_canvas_item_get_rect(RID p_item); + bool free(RID p_rid); RendererCanvasCull(); ~RendererCanvasCull(); diff --git a/servers/rendering/renderer_canvas_render.h b/servers/rendering/renderer_canvas_render.h index ef4de9ce54..3b78df5fab 100644 --- a/servers/rendering/renderer_canvas_render.h +++ b/servers/rendering/renderer_canvas_render.h @@ -31,6 +31,7 @@ #ifndef RENDERER_CANVAS_RENDER_H #define RENDERER_CANVAS_RENDER_H +#include "servers/rendering/rendering_method.h" #include "servers/rendering_server.h" class RendererCanvasRender { @@ -479,7 +480,7 @@ public: } }; - virtual void canvas_render_items(RID p_to_render_target, Item *p_item_list, const Color &p_modulate, Light *p_light_list, Light *p_directional_list, const Transform2D &p_canvas_transform, RS::CanvasItemTextureFilter p_default_filter, RS::CanvasItemTextureRepeat p_default_repeat, bool p_snap_2d_vertices_to_pixel, bool &r_sdf_used) = 0; + virtual void canvas_render_items(RID p_to_render_target, Item *p_item_list, const Color &p_modulate, Light *p_light_list, Light *p_directional_list, const Transform2D &p_canvas_transform, RS::CanvasItemTextureFilter p_default_filter, RS::CanvasItemTextureRepeat p_default_repeat, bool p_snap_2d_vertices_to_pixel, bool &r_sdf_used, RenderingMethod::RenderInfo *r_render_info = nullptr) = 0; struct LightOccluderInstance { bool enabled; diff --git a/servers/rendering/renderer_rd/effects/copy_effects.cpp b/servers/rendering/renderer_rd/effects/copy_effects.cpp index aa1a87cdd7..92bd3a043a 100644 --- a/servers/rendering/renderer_rd/effects/copy_effects.cpp +++ b/servers/rendering/renderer_rd/effects/copy_effects.cpp @@ -71,7 +71,9 @@ CopyEffects::CopyEffects(bool p_prefer_raster_effects) { for (int i = 0; i < BLUR_MODE_MAX; i++) { blur_raster.pipelines[i].clear(); } + } + { Vector<String> copy_modes; copy_modes.push_back("\n#define MODE_GAUSSIAN_BLUR\n"); copy_modes.push_back("\n#define MODE_GAUSSIAN_BLUR\n#define DST_IMAGE_8BIT\n"); @@ -104,9 +106,9 @@ CopyEffects::CopyEffects(bool p_prefer_raster_effects) { copy_modes.push_back("\n"); // COPY_TO_FB_COPY copy_modes.push_back("\n#define MODE_PANORAMA_TO_DP\n"); // COPY_TO_FB_COPY_PANORAMA_TO_DP copy_modes.push_back("\n#define MODE_TWO_SOURCES\n"); // COPY_TO_FB_COPY2 + copy_modes.push_back("\n#define MODE_SET_COLOR\n"); // COPY_TO_FB_SET_COLOR copy_modes.push_back("\n#define MULTIVIEW\n"); // COPY_TO_FB_MULTIVIEW copy_modes.push_back("\n#define MULTIVIEW\n#define MODE_TWO_SOURCES\n"); // COPY_TO_FB_MULTIVIEW_WITH_DEPTH - copy_modes.push_back("\n#define MODE_SET_COLOR\n"); // COPY_TO_FB_SET_COLOR copy_to_fb.shader.initialize(copy_modes); @@ -310,12 +312,12 @@ CopyEffects::~CopyEffects() { filter.raster_shader.version_free(filter.shader_version); roughness.raster_shader.version_free(roughness.shader_version); } else { - copy.shader.version_free(copy.shader_version); cubemap_downsampler.compute_shader.version_free(cubemap_downsampler.shader_version); filter.compute_shader.version_free(filter.shader_version); roughness.compute_shader.version_free(roughness.shader_version); } + copy.shader.version_free(copy.shader_version); specular_merge.shader.version_free(specular_merge.shader_version); RD::get_singleton()->free(filter.coefficient_buffer); @@ -335,8 +337,6 @@ CopyEffects::~CopyEffects() { } void CopyEffects::copy_to_rect(RID p_source_rd_texture, RID p_dest_texture, const Rect2i &p_rect, bool p_flip_y, bool p_force_luminance, bool p_all_source, bool p_8_bit_dst, bool p_alpha_to_one) { - ERR_FAIL_COND_MSG(prefer_raster_effects, "Can't use the compute version of the copy_to_rect shader with the mobile renderer."); - UniformSetCacheRD *uniform_set_cache = UniformSetCacheRD::get_singleton(); ERR_FAIL_NULL(uniform_set_cache); MaterialStorage *material_storage = MaterialStorage::get_singleton(); @@ -386,8 +386,6 @@ void CopyEffects::copy_to_rect(RID p_source_rd_texture, RID p_dest_texture, cons } void CopyEffects::copy_cubemap_to_panorama(RID p_source_cube, RID p_dest_panorama, const Size2i &p_panorama_size, float p_lod, bool p_is_array) { - ERR_FAIL_COND_MSG(prefer_raster_effects, "Can't use the compute version of the copy_cubemap_to_panorama shader with the mobile renderer."); - UniformSetCacheRD *uniform_set_cache = UniformSetCacheRD::get_singleton(); ERR_FAIL_NULL(uniform_set_cache); MaterialStorage *material_storage = MaterialStorage::get_singleton(); @@ -423,8 +421,6 @@ void CopyEffects::copy_cubemap_to_panorama(RID p_source_cube, RID p_dest_panoram } void CopyEffects::copy_depth_to_rect(RID p_source_rd_texture, RID p_dest_texture, const Rect2i &p_rect, bool p_flip_y) { - ERR_FAIL_COND_MSG(prefer_raster_effects, "Can't use the compute version of the copy_depth_to_rect shader with the mobile renderer."); - UniformSetCacheRD *uniform_set_cache = UniformSetCacheRD::get_singleton(); ERR_FAIL_NULL(uniform_set_cache); MaterialStorage *material_storage = MaterialStorage::get_singleton(); @@ -462,8 +458,6 @@ void CopyEffects::copy_depth_to_rect(RID p_source_rd_texture, RID p_dest_texture } void CopyEffects::copy_depth_to_rect_and_linearize(RID p_source_rd_texture, RID p_dest_texture, const Rect2i &p_rect, bool p_flip_y, float p_z_near, float p_z_far) { - ERR_FAIL_COND_MSG(prefer_raster_effects, "Can't use the compute version of the copy_depth_to_rect_and_linearize shader with the mobile renderer."); - UniformSetCacheRD *uniform_set_cache = UniformSetCacheRD::get_singleton(); ERR_FAIL_NULL(uniform_set_cache); MaterialStorage *material_storage = MaterialStorage::get_singleton(); @@ -599,6 +593,40 @@ void CopyEffects::copy_to_fb_rect(RID p_source_rd_texture, RID p_dest_framebuffe RD::get_singleton()->draw_list_end(); } +void CopyEffects::copy_to_drawlist(RD::DrawListID p_draw_list, RD::FramebufferFormatID p_fb_format, RID p_source_rd_texture, bool p_linear) { + UniformSetCacheRD *uniform_set_cache = UniformSetCacheRD::get_singleton(); + ERR_FAIL_NULL(uniform_set_cache); + MaterialStorage *material_storage = MaterialStorage::get_singleton(); + ERR_FAIL_NULL(material_storage); + + memset(©_to_fb.push_constant, 0, sizeof(CopyToFbPushConstant)); + copy_to_fb.push_constant.luminance_multiplier = 1.0; + + if (p_linear) { + // Used for copying to a linear buffer. In the mobile renderer we divide the contents of the linear buffer + // to allow for a wider effective range. + copy_to_fb.push_constant.flags |= COPY_TO_FB_FLAG_LINEAR; + copy_to_fb.push_constant.luminance_multiplier = prefer_raster_effects ? 2.0 : 1.0; + } + + // setup our uniforms + RID default_sampler = material_storage->sampler_rd_get_default(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + + RD::Uniform u_source_rd_texture(RD::UNIFORM_TYPE_SAMPLER_WITH_TEXTURE, 0, Vector<RID>({ default_sampler, p_source_rd_texture })); + + // Multiview not supported here! + CopyToFBMode mode = COPY_TO_FB_COPY; + + RID shader = copy_to_fb.shader.version_get_shader(copy_to_fb.shader_version, mode); + ERR_FAIL_COND(shader.is_null()); + + RD::get_singleton()->draw_list_bind_render_pipeline(p_draw_list, copy_to_fb.pipelines[mode].get_render_pipeline(RD::INVALID_ID, p_fb_format)); + RD::get_singleton()->draw_list_bind_uniform_set(p_draw_list, uniform_set_cache->get_cache(shader, 0, u_source_rd_texture), 0); + RD::get_singleton()->draw_list_bind_index_array(p_draw_list, material_storage->get_quad_index_array()); + RD::get_singleton()->draw_list_set_push_constant(p_draw_list, ©_to_fb.push_constant, sizeof(CopyToFbPushConstant)); + RD::get_singleton()->draw_list_draw(p_draw_list, true); +} + void CopyEffects::copy_raster(RID p_source_texture, RID p_dest_framebuffer) { ERR_FAIL_COND_MSG(!prefer_raster_effects, "Can't use the raster version of the copy with the clustered renderer."); diff --git a/servers/rendering/renderer_rd/effects/copy_effects.h b/servers/rendering/renderer_rd/effects/copy_effects.h index 470ac1acee..f9dcc42421 100644 --- a/servers/rendering/renderer_rd/effects/copy_effects.h +++ b/servers/rendering/renderer_rd/effects/copy_effects.h @@ -172,11 +172,13 @@ private: COPY_TO_FB_COPY, COPY_TO_FB_COPY_PANORAMA_TO_DP, COPY_TO_FB_COPY2, + COPY_TO_FB_SET_COLOR, + // These variants are disabled unless XR shaders are enabled. + // They should be listed last. COPY_TO_FB_MULTIVIEW, COPY_TO_FB_MULTIVIEW_WITH_DEPTH, - COPY_TO_FB_SET_COLOR, COPY_TO_FB_MAX, }; @@ -328,6 +330,7 @@ public: void copy_depth_to_rect_and_linearize(RID p_source_rd_texture, RID p_dest_texture, const Rect2i &p_rect, bool p_flip_y, float p_z_near, float p_z_far); void copy_to_fb_rect(RID p_source_rd_texture, RID p_dest_framebuffer, const Rect2i &p_rect, bool p_flip_y = false, bool p_force_luminance = false, bool p_alpha_to_zero = false, bool p_srgb = false, RID p_secondary = RID(), bool p_multiview = false, bool alpha_to_one = false, bool p_linear = false); void copy_to_atlas_fb(RID p_source_rd_texture, RID p_dest_framebuffer, const Rect2 &p_uv_rect, RD::DrawListID p_draw_list, bool p_flip_y = false, bool p_panorama = false); + void copy_to_drawlist(RD::DrawListID p_draw_list, RD::FramebufferFormatID p_fb_format, RID p_source_rd_texture, bool p_linear = false); void copy_raster(RID p_source_texture, RID p_dest_framebuffer); void gaussian_blur(RID p_source_rd_texture, RID p_texture, const Rect2i &p_region, const Size2i &p_size, bool p_8bit_dst = false); diff --git a/servers/rendering/renderer_rd/effects/ss_effects.cpp b/servers/rendering/renderer_rd/effects/ss_effects.cpp index d123f24865..628edc0127 100644 --- a/servers/rendering/renderer_rd/effects/ss_effects.cpp +++ b/servers/rendering/renderer_rd/effects/ss_effects.cpp @@ -950,7 +950,7 @@ void SSEffects::screen_space_indirect_lighting(Ref<RenderSceneBuffersRD> p_rende RD::get_singleton()->draw_command_end_label(); // SSIL - RD::get_singleton()->compute_list_end(RD::BARRIER_MASK_NO_BARRIER); + RD::get_singleton()->compute_list_end(RD::BARRIER_MASK_TRANSFER); // Zeroing importance_map_load_counter depends on us. int zero[1] = { 0 }; RD::get_singleton()->buffer_update(ssil.importance_map_load_counter, 0, sizeof(uint32_t), &zero, 0); //no barrier @@ -1332,7 +1332,7 @@ void SSEffects::generate_ssao(Ref<RenderSceneBuffersRD> p_render_buffers, SSAORe RD::get_singleton()->draw_command_end_label(); // Interleave } RD::get_singleton()->draw_command_end_label(); //SSAO - RD::get_singleton()->compute_list_end(RD::BARRIER_MASK_NO_BARRIER); //wait for upcoming transfer + RD::get_singleton()->compute_list_end(RD::BARRIER_MASK_TRANSFER); // Zeroing importance_map_load_counter depends on us. int zero[1] = { 0 }; RD::get_singleton()->buffer_update(ssao.importance_map_load_counter, 0, sizeof(uint32_t), &zero, 0); //no barrier diff --git a/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp b/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp index 2397249ca5..14995d0156 100644 --- a/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp +++ b/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.cpp @@ -1672,6 +1672,7 @@ void RenderForwardClustered::_render_scene(RenderDataRD *p_render_data, const Co RID color_framebuffer; RID color_only_framebuffer; RID depth_framebuffer; + RendererRD::MaterialStorage::Samplers samplers; PassMode depth_pass_mode = PASS_MODE_DEPTH; uint32_t color_pass_flags = 0; @@ -1698,6 +1699,7 @@ void RenderForwardClustered::_render_scene(RenderDataRD *p_render_data, const Co } reverse_cull = true; // for some reason our views are inverted + samplers = RendererRD::MaterialStorage::get_singleton()->samplers_rd_get_default(); } else { screen_size = rb->get_internal_size(); @@ -1729,6 +1731,7 @@ void RenderForwardClustered::_render_scene(RenderDataRD *p_render_data, const Co color_framebuffer = rb_data->get_color_pass_fb(color_pass_flags); color_only_framebuffer = rb_data->get_color_only_fb(); + samplers = rb->get_samplers(); } p_render_data->scene_data->emissive_exposure_normalization = -1.0; @@ -1740,11 +1743,7 @@ void RenderForwardClustered::_render_scene(RenderDataRD *p_render_data, const Co _setup_environment(p_render_data, is_reflection_probe, screen_size, !is_reflection_probe, p_default_bg_color, false); // May have changed due to the above (light buffer enlarged, as an example). - if (is_reflection_probe) { - _update_render_base_uniform_set(RendererRD::MaterialStorage::get_singleton()->samplers_rd_get_default(), BASE_UNIFORM_SET_CACHE_DEFAULT); - } else { - _update_render_base_uniform_set(rb->get_samplers(), BASE_UNIFORM_SET_CACHE_VIEWPORT); - } + _update_render_base_uniform_set(); _fill_render_list(RENDER_LIST_OPAQUE, p_render_data, PASS_MODE_COLOR, using_sdfgi, using_sdfgi || using_voxelgi, using_motion_pass); render_list[RENDER_LIST_OPAQUE].sort_by_key(); @@ -1928,7 +1927,7 @@ void RenderForwardClustered::_render_scene(RenderDataRD *p_render_data, const Co RD::get_singleton()->draw_command_begin_label("Render Depth Pre-Pass"); - RID rp_uniform_set = _setup_render_pass_uniform_set(RENDER_LIST_OPAQUE, nullptr, RID()); + RID rp_uniform_set = _setup_render_pass_uniform_set(RENDER_LIST_OPAQUE, nullptr, RID(), samplers); bool finish_depth = using_ssao || using_ssil || using_sdfgi || using_voxelgi; RenderListParameters render_list_params(render_list[RENDER_LIST_OPAQUE].elements.ptr(), render_list[RENDER_LIST_OPAQUE].element_info.ptr(), render_list[RENDER_LIST_OPAQUE].elements.size(), reverse_cull, depth_pass_mode, 0, rb_data.is_null(), p_render_data->directional_light_soft_shadows, rp_uniform_set, get_debug_draw_mode() == RS::VIEWPORT_DEBUG_DRAW_WIREFRAME, Vector2(), p_render_data->scene_data->lod_distance_multiplier, p_render_data->scene_data->screen_mesh_lod_threshold, p_render_data->scene_data->view_count); @@ -1975,17 +1974,13 @@ void RenderForwardClustered::_render_scene(RenderDataRD *p_render_data, const Co p_render_data->scene_data->opaque_prepass_threshold = 0.0f; // Shadow pass can change the base uniform set samplers. - if (is_reflection_probe) { - _update_render_base_uniform_set(RendererRD::MaterialStorage::get_singleton()->samplers_rd_get_default(), BASE_UNIFORM_SET_CACHE_DEFAULT); - } else { - _update_render_base_uniform_set(rb->get_samplers(), BASE_UNIFORM_SET_CACHE_VIEWPORT); - } + _update_render_base_uniform_set(); _setup_environment(p_render_data, is_reflection_probe, screen_size, !is_reflection_probe, p_default_bg_color, true, using_motion_pass); RENDER_TIMESTAMP("Render Opaque Pass"); - RID rp_uniform_set = _setup_render_pass_uniform_set(RENDER_LIST_OPAQUE, p_render_data, radiance_texture, true); + RID rp_uniform_set = _setup_render_pass_uniform_set(RENDER_LIST_OPAQUE, p_render_data, radiance_texture, samplers, true); bool can_continue_color = !scene_state.used_screen_texture && !using_ssr && !using_sss; bool can_continue_depth = !(scene_state.used_depth_texture || scene_state.used_normal_texture) && !using_ssr && !using_sss; @@ -2032,11 +2027,13 @@ void RenderForwardClustered::_render_scene(RenderDataRD *p_render_data, const Co RENDER_TIMESTAMP("Render Motion Pass"); - rp_uniform_set = _setup_render_pass_uniform_set(RENDER_LIST_MOTION, p_render_data, radiance_texture, true); + rp_uniform_set = _setup_render_pass_uniform_set(RENDER_LIST_MOTION, p_render_data, radiance_texture, samplers, true); RenderListParameters render_list_params(render_list[RENDER_LIST_MOTION].elements.ptr(), render_list[RENDER_LIST_MOTION].element_info.ptr(), render_list[RENDER_LIST_MOTION].elements.size(), reverse_cull, PASS_MODE_COLOR, color_pass_flags, rb_data.is_null(), p_render_data->directional_light_soft_shadows, rp_uniform_set, get_debug_draw_mode() == RS::VIEWPORT_DEBUG_DRAW_WIREFRAME, Vector2(), p_render_data->scene_data->lod_distance_multiplier, p_render_data->scene_data->screen_mesh_lod_threshold, p_render_data->scene_data->view_count); _render_list_with_threads(&render_list_params, color_framebuffer, RD::INITIAL_ACTION_CONTINUE, final_color_action, RD::INITIAL_ACTION_CONTINUE, final_depth_action); + RD::get_singleton()->draw_command_end_label(); + if (will_continue_color) { // Close the motion vectors framebuffer as it'll no longer be used. RD::get_singleton()->draw_list_begin(rb_data->get_velocity_only_fb(), RD::INITIAL_ACTION_CONTINUE, RD::FINAL_ACTION_READ, RD::INITIAL_ACTION_CONTINUE, RD::FINAL_ACTION_CONTINUE); @@ -2051,8 +2048,6 @@ void RenderForwardClustered::_render_scene(RenderDataRD *p_render_data, const Co } } - RD::get_singleton()->draw_command_end_label(); - if (debug_voxelgis) { //debug voxelgis bool will_continue_color = (can_continue_color || draw_sky || draw_sky_fog_only); @@ -2175,7 +2170,7 @@ void RenderForwardClustered::_render_scene(RenderDataRD *p_render_data, const Co RD::get_singleton()->draw_command_begin_label("Render 3D Transparent Pass"); - rp_uniform_set = _setup_render_pass_uniform_set(RENDER_LIST_ALPHA, p_render_data, radiance_texture, true); + rp_uniform_set = _setup_render_pass_uniform_set(RENDER_LIST_ALPHA, p_render_data, radiance_texture, samplers, true); _setup_environment(p_render_data, is_reflection_probe, screen_size, !is_reflection_probe, p_default_bg_color, false); @@ -2504,7 +2499,7 @@ void RenderForwardClustered::_render_shadow_pass(RID p_light, RID p_shadow_atlas void RenderForwardClustered::_render_shadow_begin() { scene_state.shadow_passes.clear(); RD::get_singleton()->draw_command_begin_label("Shadow Setup"); - _update_render_base_uniform_set(RendererRD::MaterialStorage::get_singleton()->samplers_rd_get_default(), BASE_UNIFORM_SET_CACHE_DEFAULT); + _update_render_base_uniform_set(); render_list[RENDER_LIST_SECONDARY].clear(); scene_state.instance_data[RENDER_LIST_SECONDARY].clear(); @@ -2587,7 +2582,7 @@ void RenderForwardClustered::_render_shadow_process() { for (uint32_t i = 0; i < scene_state.shadow_passes.size(); i++) { //render passes need to be configured after instance buffer is done, since they need the latest version SceneState::ShadowPass &shadow_pass = scene_state.shadow_passes[i]; - shadow_pass.rp_uniform_set = _setup_render_pass_uniform_set(RENDER_LIST_SECONDARY, nullptr, RID(), false, i); + shadow_pass.rp_uniform_set = _setup_render_pass_uniform_set(RENDER_LIST_SECONDARY, nullptr, RID(), RendererRD::MaterialStorage::get_singleton()->samplers_rd_get_default(), false, i); } RD::get_singleton()->draw_command_end_label(); @@ -2628,7 +2623,7 @@ void RenderForwardClustered::_render_particle_collider_heightfield(RID p_fb, con render_data.cluster_max_elements = 32; render_data.instances = &p_instances; - _update_render_base_uniform_set(RendererRD::MaterialStorage::get_singleton()->samplers_rd_get_default(), BASE_UNIFORM_SET_CACHE_DEFAULT); + _update_render_base_uniform_set(); _setup_environment(&render_data, true, Vector2(1, 1), true, Color(), false, false, false); @@ -2638,7 +2633,7 @@ void RenderForwardClustered::_render_particle_collider_heightfield(RID p_fb, con render_list[RENDER_LIST_SECONDARY].sort_by_key(); _fill_instance_data(RENDER_LIST_SECONDARY); - RID rp_uniform_set = _setup_render_pass_uniform_set(RENDER_LIST_SECONDARY, nullptr, RID()); + RID rp_uniform_set = _setup_render_pass_uniform_set(RENDER_LIST_SECONDARY, nullptr, RID(), RendererRD::MaterialStorage::get_singleton()->samplers_rd_get_default()); RENDER_TIMESTAMP("Render Collider Heightfield"); @@ -2674,7 +2669,7 @@ void RenderForwardClustered::_render_material(const Transform3D &p_cam_transform scene_shader.enable_advanced_shader_group(); - _update_render_base_uniform_set(RendererRD::MaterialStorage::get_singleton()->samplers_rd_get_default(), BASE_UNIFORM_SET_CACHE_DEFAULT); + _update_render_base_uniform_set(); _setup_environment(&render_data, true, Vector2(1, 1), false, Color()); @@ -2683,7 +2678,7 @@ void RenderForwardClustered::_render_material(const Transform3D &p_cam_transform render_list[RENDER_LIST_SECONDARY].sort_by_key(); _fill_instance_data(RENDER_LIST_SECONDARY); - RID rp_uniform_set = _setup_render_pass_uniform_set(RENDER_LIST_SECONDARY, nullptr, RID()); + RID rp_uniform_set = _setup_render_pass_uniform_set(RENDER_LIST_SECONDARY, nullptr, RID(), RendererRD::MaterialStorage::get_singleton()->samplers_rd_get_default()); RENDER_TIMESTAMP("Render 3D Material"); @@ -2725,7 +2720,7 @@ void RenderForwardClustered::_render_uv2(const PagedArray<RenderGeometryInstance scene_shader.enable_advanced_shader_group(); - _update_render_base_uniform_set(RendererRD::MaterialStorage::get_singleton()->samplers_rd_get_default(), BASE_UNIFORM_SET_CACHE_DEFAULT); + _update_render_base_uniform_set(); _setup_environment(&render_data, true, Vector2(1, 1), false, Color()); @@ -2734,7 +2729,7 @@ void RenderForwardClustered::_render_uv2(const PagedArray<RenderGeometryInstance render_list[RENDER_LIST_SECONDARY].sort_by_key(); _fill_instance_data(RENDER_LIST_SECONDARY); - RID rp_uniform_set = _setup_render_pass_uniform_set(RENDER_LIST_SECONDARY, nullptr, RID()); + RID rp_uniform_set = _setup_render_pass_uniform_set(RENDER_LIST_SECONDARY, nullptr, RID(), RendererRD::MaterialStorage::get_singleton()->samplers_rd_get_default()); RENDER_TIMESTAMP("Render 3D Material"); @@ -2794,7 +2789,7 @@ void RenderForwardClustered::_render_sdfgi(Ref<RenderSceneBuffersRD> p_render_bu render_data.cluster_max_elements = 32; render_data.instances = &p_instances; - _update_render_base_uniform_set(RendererRD::MaterialStorage::get_singleton()->samplers_rd_get_default(), BASE_UNIFORM_SET_CACHE_DEFAULT); + _update_render_base_uniform_set(); PassMode pass_mode = PASS_MODE_SDF; _fill_render_list(RENDER_LIST_SECONDARY, &render_data, pass_mode); @@ -2852,7 +2847,7 @@ void RenderForwardClustered::_render_sdfgi(Ref<RenderSceneBuffersRD> p_render_bu scene_data.emissive_exposure_normalization = p_exposure_normalization; _setup_environment(&render_data, true, Vector2(1, 1), false, Color()); - RID rp_uniform_set = _setup_sdfgi_render_pass_uniform_set(p_albedo_texture, p_emission_texture, p_emission_aniso_texture, p_geom_facing_texture); + RID rp_uniform_set = _setup_sdfgi_render_pass_uniform_set(p_albedo_texture, p_emission_texture, p_emission_aniso_texture, p_geom_facing_texture, RendererRD::MaterialStorage::get_singleton()->samplers_rd_get_default()); HashMap<Size2i, RID>::Iterator E = sdfgi_framebuffer_size_cache.find(fb_size); if (!E) { @@ -2868,23 +2863,21 @@ void RenderForwardClustered::_render_sdfgi(Ref<RenderSceneBuffersRD> p_render_bu } void RenderForwardClustered::base_uniforms_changed() { - for (int i = 0; i < BASE_UNIFORM_SET_CACHE_MAX; i++) { - if (!render_base_uniform_set_cache[i].is_null() && RD::get_singleton()->uniform_set_is_valid(render_base_uniform_set_cache[i])) { - RD::get_singleton()->free(render_base_uniform_set_cache[i]); - } - render_base_uniform_set_cache[i] = RID(); + if (!render_base_uniform_set.is_null() && RD::get_singleton()->uniform_set_is_valid(render_base_uniform_set)) { + RD::get_singleton()->free(render_base_uniform_set); } + render_base_uniform_set = RID(); } -void RenderForwardClustered::_update_render_base_uniform_set(const RendererRD::MaterialStorage::Samplers &p_samplers, BaseUniformSetCache p_cache_index) { +void RenderForwardClustered::_update_render_base_uniform_set() { RendererRD::LightStorage *light_storage = RendererRD::LightStorage::get_singleton(); - if (render_base_uniform_set_cache[p_cache_index].is_null() || !RD::get_singleton()->uniform_set_is_valid(render_base_uniform_set_cache[p_cache_index]) || (lightmap_texture_array_version_cache[p_cache_index] != light_storage->lightmap_array_get_version())) { - if (render_base_uniform_set_cache[p_cache_index].is_valid() && RD::get_singleton()->uniform_set_is_valid(render_base_uniform_set_cache[p_cache_index])) { - RD::get_singleton()->free(render_base_uniform_set_cache[p_cache_index]); + if (render_base_uniform_set.is_null() || !RD::get_singleton()->uniform_set_is_valid(render_base_uniform_set) || (lightmap_texture_array_version != light_storage->lightmap_array_get_version())) { + if (render_base_uniform_set.is_valid() && RD::get_singleton()->uniform_set_is_valid(render_base_uniform_set)) { + RD::get_singleton()->free(render_base_uniform_set); } - lightmap_texture_array_version_cache[p_cache_index] = light_storage->lightmap_array_get_version(); + lightmap_texture_array_version = light_storage->lightmap_array_get_version(); Vector<RD::Uniform> uniforms; @@ -2899,73 +2892,13 @@ void RenderForwardClustered::_update_render_base_uniform_set(const RendererRD::M { RD::Uniform u; u.binding = 3; - u.uniform_type = RD::UNIFORM_TYPE_SAMPLER; - RID sampler; - switch (decals_get_filter()) { - case RS::DECAL_FILTER_NEAREST: { - sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); - } break; - case RS::DECAL_FILTER_LINEAR: { - sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); - } break; - case RS::DECAL_FILTER_NEAREST_MIPMAPS: { - sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); - } break; - case RS::DECAL_FILTER_LINEAR_MIPMAPS: { - sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); - } break; - case RS::DECAL_FILTER_NEAREST_MIPMAPS_ANISOTROPIC: { - sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); - } break; - case RS::DECAL_FILTER_LINEAR_MIPMAPS_ANISOTROPIC: { - sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); - } break; - } - - u.append_id(sampler); - uniforms.push_back(u); - } - - { - RD::Uniform u; - u.binding = 4; - u.uniform_type = RD::UNIFORM_TYPE_SAMPLER; - RID sampler; - switch (light_projectors_get_filter()) { - case RS::LIGHT_PROJECTOR_FILTER_NEAREST: { - sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); - } break; - case RS::LIGHT_PROJECTOR_FILTER_LINEAR: { - sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); - } break; - case RS::LIGHT_PROJECTOR_FILTER_NEAREST_MIPMAPS: { - sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); - } break; - case RS::LIGHT_PROJECTOR_FILTER_LINEAR_MIPMAPS: { - sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); - } break; - case RS::LIGHT_PROJECTOR_FILTER_NEAREST_MIPMAPS_ANISOTROPIC: { - sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); - } break; - case RS::LIGHT_PROJECTOR_FILTER_LINEAR_MIPMAPS_ANISOTROPIC: { - sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); - } break; - } - - u.append_id(sampler); - uniforms.push_back(u); - } - - { - RD::Uniform u; - u.binding = 5; u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER; u.append_id(RendererRD::LightStorage::get_singleton()->get_omni_light_buffer()); uniforms.push_back(u); } { RD::Uniform u; - u.binding = 6; + u.binding = 4; u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER; u.append_id(RendererRD::LightStorage::get_singleton()->get_spot_light_buffer()); uniforms.push_back(u); @@ -2973,35 +2906,35 @@ void RenderForwardClustered::_update_render_base_uniform_set(const RendererRD::M { RD::Uniform u; - u.binding = 7; + u.binding = 5; u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER; u.append_id(RendererRD::LightStorage::get_singleton()->get_reflection_probe_buffer()); uniforms.push_back(u); } { RD::Uniform u; - u.binding = 8; + u.binding = 6; u.uniform_type = RD::UNIFORM_TYPE_UNIFORM_BUFFER; u.append_id(RendererRD::LightStorage::get_singleton()->get_directional_light_buffer()); uniforms.push_back(u); } { RD::Uniform u; - u.binding = 9; + u.binding = 7; u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER; u.append_id(scene_state.lightmap_buffer); uniforms.push_back(u); } { RD::Uniform u; - u.binding = 10; + u.binding = 8; u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER; u.append_id(scene_state.lightmap_capture_buffer); uniforms.push_back(u); } { RD::Uniform u; - u.binding = 11; + u.binding = 9; u.uniform_type = RD::UNIFORM_TYPE_TEXTURE; RID decal_atlas = RendererRD::TextureStorage::get_singleton()->decal_atlas_get_texture(); u.append_id(decal_atlas); @@ -3009,7 +2942,7 @@ void RenderForwardClustered::_update_render_base_uniform_set(const RendererRD::M } { RD::Uniform u; - u.binding = 12; + u.binding = 10; u.uniform_type = RD::UNIFORM_TYPE_TEXTURE; RID decal_atlas = RendererRD::TextureStorage::get_singleton()->decal_atlas_get_texture_srgb(); u.append_id(decal_atlas); @@ -3017,7 +2950,7 @@ void RenderForwardClustered::_update_render_base_uniform_set(const RendererRD::M } { RD::Uniform u; - u.binding = 13; + u.binding = 11; u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER; u.append_id(RendererRD::TextureStorage::get_singleton()->get_decal_buffer()); uniforms.push_back(u); @@ -3026,7 +2959,7 @@ void RenderForwardClustered::_update_render_base_uniform_set(const RendererRD::M { RD::Uniform u; u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER; - u.binding = 14; + u.binding = 12; u.append_id(RendererRD::MaterialStorage::get_singleton()->global_shader_uniforms_get_storage_buffer()); uniforms.push_back(u); } @@ -3034,19 +2967,24 @@ void RenderForwardClustered::_update_render_base_uniform_set(const RendererRD::M { RD::Uniform u; u.uniform_type = RD::UNIFORM_TYPE_UNIFORM_BUFFER; - u.binding = 15; + u.binding = 13; u.append_id(sdfgi_get_ubo()); uniforms.push_back(u); } - uniforms.append_array(p_samplers.get_uniforms(SAMPLERS_BINDING_FIRST_INDEX)); + { + RD::Uniform u; + u.binding = 14; + u.uniform_type = RD::UNIFORM_TYPE_SAMPLER; + u.append_id(RendererRD::MaterialStorage::get_singleton()->sampler_rd_get_default(RS::CanvasItemTextureFilter::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS, RS::CanvasItemTextureRepeat::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED)); + uniforms.push_back(u); + } - render_base_uniform_set_cache[p_cache_index] = RD::get_singleton()->uniform_set_create(uniforms, scene_shader.default_shader_rd, SCENE_UNIFORM_SET); + render_base_uniform_set = RD::get_singleton()->uniform_set_create(uniforms, scene_shader.default_shader_rd, SCENE_UNIFORM_SET); } - render_base_uniform_set = render_base_uniform_set_cache[p_cache_index]; } -RID RenderForwardClustered::_setup_render_pass_uniform_set(RenderListType p_render_list, const RenderDataRD *p_render_data, RID p_radiance_texture, bool p_use_directional_shadow_atlas, int p_index) { +RID RenderForwardClustered::_setup_render_pass_uniform_set(RenderListType p_render_list, const RenderDataRD *p_render_data, RID p_radiance_texture, const RendererRD::MaterialStorage::Samplers &p_samplers, bool p_use_directional_shadow_atlas, int p_index) { RendererRD::TextureStorage *texture_storage = RendererRD::TextureStorage::get_singleton(); RendererRD::LightStorage *light_storage = RendererRD::LightStorage::get_singleton(); @@ -3194,6 +3132,68 @@ RID RenderForwardClustered::_setup_render_pass_uniform_set(RenderListType p_rend { RD::Uniform u; u.binding = 10; + u.uniform_type = RD::UNIFORM_TYPE_SAMPLER; + RID sampler; + switch (decals_get_filter()) { + case RS::DECAL_FILTER_NEAREST: { + sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + } break; + case RS::DECAL_FILTER_LINEAR: { + sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + } break; + case RS::DECAL_FILTER_NEAREST_MIPMAPS: { + sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + } break; + case RS::DECAL_FILTER_LINEAR_MIPMAPS: { + sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + } break; + case RS::DECAL_FILTER_NEAREST_MIPMAPS_ANISOTROPIC: { + sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + } break; + case RS::DECAL_FILTER_LINEAR_MIPMAPS_ANISOTROPIC: { + sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + } break; + } + + u.append_id(sampler); + uniforms.push_back(u); + } + + { + RD::Uniform u; + u.binding = 11; + u.uniform_type = RD::UNIFORM_TYPE_SAMPLER; + RID sampler; + switch (light_projectors_get_filter()) { + case RS::LIGHT_PROJECTOR_FILTER_NEAREST: { + sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + } break; + case RS::LIGHT_PROJECTOR_FILTER_LINEAR: { + sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + } break; + case RS::LIGHT_PROJECTOR_FILTER_NEAREST_MIPMAPS: { + sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + } break; + case RS::LIGHT_PROJECTOR_FILTER_LINEAR_MIPMAPS: { + sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + } break; + case RS::LIGHT_PROJECTOR_FILTER_NEAREST_MIPMAPS_ANISOTROPIC: { + sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + } break; + case RS::LIGHT_PROJECTOR_FILTER_LINEAR_MIPMAPS_ANISOTROPIC: { + sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + } break; + } + + u.append_id(sampler); + uniforms.push_back(u); + } + + uniforms.append_array(p_samplers.get_uniforms(12)); + + { + RD::Uniform u; + u.binding = 24; u.uniform_type = RD::UNIFORM_TYPE_TEXTURE; RID texture; if (rb.is_valid() && rb->has_texture(RB_SCOPE_BUFFERS, RB_TEX_BACK_DEPTH)) { @@ -3206,7 +3206,7 @@ RID RenderForwardClustered::_setup_render_pass_uniform_set(RenderListType p_rend } { RD::Uniform u; - u.binding = 11; + u.binding = 25; u.uniform_type = RD::UNIFORM_TYPE_TEXTURE; RID bbt = rb_data.is_valid() ? rb->get_back_buffer_texture() : RID(); RID texture = bbt.is_valid() ? bbt : texture_storage->texture_rd_get_default(is_multiview ? RendererRD::TextureStorage::DEFAULT_RD_TEXTURE_2D_ARRAY_BLACK : RendererRD::TextureStorage::DEFAULT_RD_TEXTURE_BLACK); @@ -3216,7 +3216,7 @@ RID RenderForwardClustered::_setup_render_pass_uniform_set(RenderListType p_rend { RD::Uniform u; - u.binding = 12; + u.binding = 26; u.uniform_type = RD::UNIFORM_TYPE_TEXTURE; RID texture = rb_data.is_valid() && rb_data->has_normal_roughness() ? rb_data->get_normal_roughness() : texture_storage->texture_rd_get_default(is_multiview ? RendererRD::TextureStorage::DEFAULT_RD_TEXTURE_2D_ARRAY_NORMAL : RendererRD::TextureStorage::DEFAULT_RD_TEXTURE_NORMAL); u.append_id(texture); @@ -3225,7 +3225,7 @@ RID RenderForwardClustered::_setup_render_pass_uniform_set(RenderListType p_rend { RD::Uniform u; - u.binding = 13; + u.binding = 27; u.uniform_type = RD::UNIFORM_TYPE_TEXTURE; RID aot = rb.is_valid() && rb->has_texture(RB_SCOPE_SSAO, RB_FINAL) ? rb->get_texture(RB_SCOPE_SSAO, RB_FINAL) : RID(); RID texture = aot.is_valid() ? aot : texture_storage->texture_rd_get_default(is_multiview ? RendererRD::TextureStorage::DEFAULT_RD_TEXTURE_2D_ARRAY_BLACK : RendererRD::TextureStorage::DEFAULT_RD_TEXTURE_BLACK); @@ -3235,7 +3235,7 @@ RID RenderForwardClustered::_setup_render_pass_uniform_set(RenderListType p_rend { RD::Uniform u; - u.binding = 14; + u.binding = 28; u.uniform_type = RD::UNIFORM_TYPE_TEXTURE; RID texture = rb_data.is_valid() && rb->has_texture(RB_SCOPE_GI, RB_TEX_AMBIENT) ? rb->get_texture(RB_SCOPE_GI, RB_TEX_AMBIENT) : texture_storage->texture_rd_get_default(is_multiview ? RendererRD::TextureStorage::DEFAULT_RD_TEXTURE_2D_ARRAY_BLACK : RendererRD::TextureStorage::DEFAULT_RD_TEXTURE_BLACK); u.append_id(texture); @@ -3244,7 +3244,7 @@ RID RenderForwardClustered::_setup_render_pass_uniform_set(RenderListType p_rend { RD::Uniform u; - u.binding = 15; + u.binding = 29; u.uniform_type = RD::UNIFORM_TYPE_TEXTURE; RID texture = rb_data.is_valid() && rb->has_texture(RB_SCOPE_GI, RB_TEX_REFLECTION) ? rb->get_texture(RB_SCOPE_GI, RB_TEX_REFLECTION) : texture_storage->texture_rd_get_default(is_multiview ? RendererRD::TextureStorage::DEFAULT_RD_TEXTURE_2D_ARRAY_BLACK : RendererRD::TextureStorage::DEFAULT_RD_TEXTURE_BLACK); u.append_id(texture); @@ -3252,7 +3252,7 @@ RID RenderForwardClustered::_setup_render_pass_uniform_set(RenderListType p_rend } { RD::Uniform u; - u.binding = 16; + u.binding = 30; u.uniform_type = RD::UNIFORM_TYPE_TEXTURE; RID t; if (rb.is_valid() && rb->has_custom_data(RB_SCOPE_SDFGI)) { @@ -3267,7 +3267,7 @@ RID RenderForwardClustered::_setup_render_pass_uniform_set(RenderListType p_rend } { RD::Uniform u; - u.binding = 17; + u.binding = 31; u.uniform_type = RD::UNIFORM_TYPE_TEXTURE; RID t; if (rb.is_valid() && rb->has_custom_data(RB_SCOPE_SDFGI)) { @@ -3282,7 +3282,7 @@ RID RenderForwardClustered::_setup_render_pass_uniform_set(RenderListType p_rend } { RD::Uniform u; - u.binding = 18; + u.binding = 32; u.uniform_type = RD::UNIFORM_TYPE_UNIFORM_BUFFER; RID voxel_gi; if (rb.is_valid() && rb->has_custom_data(RB_SCOPE_GI)) { @@ -3294,7 +3294,7 @@ RID RenderForwardClustered::_setup_render_pass_uniform_set(RenderListType p_rend } { RD::Uniform u; - u.binding = 19; + u.binding = 33; u.uniform_type = RD::UNIFORM_TYPE_TEXTURE; RID vfog; if (rb_data.is_valid() && rb->has_custom_data(RB_SCOPE_FOG)) { @@ -3311,7 +3311,7 @@ RID RenderForwardClustered::_setup_render_pass_uniform_set(RenderListType p_rend } { RD::Uniform u; - u.binding = 20; + u.binding = 34; u.uniform_type = RD::UNIFORM_TYPE_TEXTURE; RID ssil = rb.is_valid() && rb->has_texture(RB_SCOPE_SSIL, RB_FINAL) ? rb->get_texture(RB_SCOPE_SSIL, RB_FINAL) : RID(); RID texture = ssil.is_valid() ? ssil : texture_storage->texture_rd_get_default(is_multiview ? RendererRD::TextureStorage::DEFAULT_RD_TEXTURE_2D_ARRAY_BLACK : RendererRD::TextureStorage::DEFAULT_RD_TEXTURE_BLACK); @@ -3322,7 +3322,7 @@ RID RenderForwardClustered::_setup_render_pass_uniform_set(RenderListType p_rend return UniformSetCacheRD::get_singleton()->get_cache_vec(scene_shader.default_shader_rd, RENDER_PASS_UNIFORM_SET, uniforms); } -RID RenderForwardClustered::_setup_sdfgi_render_pass_uniform_set(RID p_albedo_texture, RID p_emission_texture, RID p_emission_aniso_texture, RID p_geom_facing_texture) { +RID RenderForwardClustered::_setup_sdfgi_render_pass_uniform_set(RID p_albedo_texture, RID p_emission_texture, RID p_emission_aniso_texture, RID p_geom_facing_texture, const RendererRD::MaterialStorage::Samplers &p_samplers) { RendererRD::TextureStorage *texture_storage = RendererRD::TextureStorage::get_singleton(); Vector<RD::Uniform> uniforms; @@ -3428,33 +3428,95 @@ RID RenderForwardClustered::_setup_sdfgi_render_pass_uniform_set(RID p_albedo_te uniforms.push_back(u); } + { + RD::Uniform u; + u.binding = 10; + u.uniform_type = RD::UNIFORM_TYPE_SAMPLER; + RID sampler; + switch (decals_get_filter()) { + case RS::DECAL_FILTER_NEAREST: { + sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + } break; + case RS::DECAL_FILTER_LINEAR: { + sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + } break; + case RS::DECAL_FILTER_NEAREST_MIPMAPS: { + sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + } break; + case RS::DECAL_FILTER_LINEAR_MIPMAPS: { + sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + } break; + case RS::DECAL_FILTER_NEAREST_MIPMAPS_ANISOTROPIC: { + sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + } break; + case RS::DECAL_FILTER_LINEAR_MIPMAPS_ANISOTROPIC: { + sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + } break; + } + + u.append_id(sampler); + uniforms.push_back(u); + } + + { + RD::Uniform u; + u.binding = 11; + u.uniform_type = RD::UNIFORM_TYPE_SAMPLER; + RID sampler; + switch (light_projectors_get_filter()) { + case RS::LIGHT_PROJECTOR_FILTER_NEAREST: { + sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + } break; + case RS::LIGHT_PROJECTOR_FILTER_LINEAR: { + sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + } break; + case RS::LIGHT_PROJECTOR_FILTER_NEAREST_MIPMAPS: { + sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + } break; + case RS::LIGHT_PROJECTOR_FILTER_LINEAR_MIPMAPS: { + sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + } break; + case RS::LIGHT_PROJECTOR_FILTER_NEAREST_MIPMAPS_ANISOTROPIC: { + sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + } break; + case RS::LIGHT_PROJECTOR_FILTER_LINEAR_MIPMAPS_ANISOTROPIC: { + sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + } break; + } + + u.append_id(sampler); + uniforms.push_back(u); + } + + uniforms.append_array(p_samplers.get_uniforms(12)); + // actual sdfgi stuff { RD::Uniform u; u.uniform_type = RD::UNIFORM_TYPE_IMAGE; - u.binding = 10; + u.binding = 24; u.append_id(p_albedo_texture); uniforms.push_back(u); } { RD::Uniform u; u.uniform_type = RD::UNIFORM_TYPE_IMAGE; - u.binding = 11; + u.binding = 25; u.append_id(p_emission_texture); uniforms.push_back(u); } { RD::Uniform u; u.uniform_type = RD::UNIFORM_TYPE_IMAGE; - u.binding = 12; + u.binding = 26; u.append_id(p_emission_aniso_texture); uniforms.push_back(u); } { RD::Uniform u; u.uniform_type = RD::UNIFORM_TYPE_IMAGE; - u.binding = 13; + u.binding = 27; u.append_id(p_geom_facing_texture); uniforms.push_back(u); } @@ -4148,7 +4210,6 @@ RenderForwardClustered::RenderForwardClustered() { } { defines += "\n#define MATERIAL_UNIFORM_SET " + itos(MATERIAL_UNIFORM_SET) + "\n"; - defines += "\n#define SAMPLERS_BINDING_FIRST_INDEX " + itos(SAMPLERS_BINDING_FIRST_INDEX) + "\n"; } #ifdef REAL_T_IS_DOUBLE { diff --git a/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.h b/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.h index bedf119210..8119e6ff4d 100644 --- a/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.h +++ b/servers/rendering/renderer_rd/forward_clustered/render_forward_clustered.h @@ -64,8 +64,6 @@ class RenderForwardClustered : public RendererSceneRenderRD { MATERIAL_UNIFORM_SET = 3, }; - const int SAMPLERS_BINDING_FIRST_INDEX = 16; - enum { SPEC_CONSTANT_SOFT_SHADOW_SAMPLES = 6, SPEC_CONSTANT_PENUMBRA_SHADOW_SAMPLES = 7, @@ -158,22 +156,13 @@ class RenderForwardClustered : public RendererSceneRenderRD { virtual void setup_render_buffer_data(Ref<RenderSceneBuffersRD> p_render_buffers) override; - enum BaseUniformSetCache { - BASE_UNIFORM_SET_CACHE_VIEWPORT, - BASE_UNIFORM_SET_CACHE_DEFAULT, - BASE_UNIFORM_SET_CACHE_MAX - }; - RID render_base_uniform_set; - // One for custom samplers, one for default samplers. - // Need to switch between them as default is needed for probes, shadows, materials, etc. - RID render_base_uniform_set_cache[BASE_UNIFORM_SET_CACHE_MAX]; - uint64_t lightmap_texture_array_version_cache[BASE_UNIFORM_SET_CACHE_MAX] = { 0xFFFFFFFF, 0xFFFFFFFF }; + uint64_t lightmap_texture_array_version = 0xFFFFFFFF; - void _update_render_base_uniform_set(const RendererRD::MaterialStorage::Samplers &p_samplers, BaseUniformSetCache p_cache_index); - RID _setup_sdfgi_render_pass_uniform_set(RID p_albedo_texture, RID p_emission_texture, RID p_emission_aniso_texture, RID p_geom_facing_texture); - RID _setup_render_pass_uniform_set(RenderListType p_render_list, const RenderDataRD *p_render_data, RID p_radiance_texture, bool p_use_directional_shadow_atlas = false, int p_index = 0); + void _update_render_base_uniform_set(); + RID _setup_sdfgi_render_pass_uniform_set(RID p_albedo_texture, RID p_emission_texture, RID p_emission_aniso_texture, RID p_geom_facing_texture, const RendererRD::MaterialStorage::Samplers &p_samplers); + RID _setup_render_pass_uniform_set(RenderListType p_render_list, const RenderDataRD *p_render_data, RID p_radiance_texture, const RendererRD::MaterialStorage::Samplers &p_samplers, bool p_use_directional_shadow_atlas = false, int p_index = 0); enum PassMode { PASS_MODE_COLOR, diff --git a/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.cpp b/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.cpp index 5134f4d545..bba1f62023 100644 --- a/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.cpp +++ b/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.cpp @@ -853,7 +853,6 @@ void SceneShaderForwardClustered::set_default_specialization_constants(const Vec void SceneShaderForwardClustered::enable_advanced_shader_group(bool p_needs_multiview) { if (p_needs_multiview || RendererCompositorRD::get_singleton()->is_xr_enabled()) { shader.enable_group(SHADER_GROUP_ADVANCED_MULTIVIEW); - } else { - shader.enable_group(SHADER_GROUP_ADVANCED); } + shader.enable_group(SHADER_GROUP_ADVANCED); } diff --git a/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp b/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp index 462fc4b524..b7d7105daa 100644 --- a/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp +++ b/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.cpp @@ -192,72 +192,43 @@ RID RenderForwardMobile::RenderBufferDataForwardMobile::get_color_fbs(Framebuffe // Now define our subpasses Vector<RD::FramebufferPass> passes; - // Define our base pass, we'll be re-using this - RD::FramebufferPass pass; - pass.color_attachments.push_back(0); - pass.depth_attachment = 1; - if (vrs_texture.is_valid()) { - pass.vrs_attachment = 2; - } - switch (p_config_type) { - case FB_CONFIG_ONE_PASS: { - // just one pass - if (use_msaa) { - // Add resolve - pass.resolve_attachments.push_back(color_buffer_id); + case FB_CONFIG_RENDER_PASS: { + RD::FramebufferPass pass; + pass.color_attachments.push_back(0); + pass.depth_attachment = 1; + if (vrs_texture.is_valid()) { + pass.vrs_attachment = 2; } - passes.push_back(pass); - return FramebufferCacheRD::get_singleton()->get_cache_multipass(textures, passes, view_count); - } break; - case FB_CONFIG_TWO_SUBPASSES: { - // - opaque pass - passes.push_back(pass); - - // - add sky pass if (use_msaa) { - // add resolve + // Add resolve pass.resolve_attachments.push_back(color_buffer_id); } passes.push_back(pass); return FramebufferCacheRD::get_singleton()->get_cache_multipass(textures, passes, view_count); } break; - case FB_CONFIG_THREE_SUBPASSES: { - // - opaque pass - passes.push_back(pass); - - // - add sky pass - passes.push_back(pass); - // - add alpha pass - if (use_msaa) { - // add resolve - pass.resolve_attachments.push_back(color_buffer_id); - } - passes.push_back(pass); - - return FramebufferCacheRD::get_singleton()->get_cache_multipass(textures, passes, view_count); - } break; - case FB_CONFIG_FOUR_SUBPASSES: { + case FB_CONFIG_RENDER_AND_POST_PASS: { Size2i target_size = render_buffers->get_target_size(); Size2i internal_size = render_buffers->get_internal_size(); // can't do our blit pass if resolutions don't match, this should already have been checked. ERR_FAIL_COND_V(target_size != internal_size, RID()); - // - opaque pass - passes.push_back(pass); - - // - add sky pass - passes.push_back(pass); + RD::FramebufferPass pass; + pass.color_attachments.push_back(0); + pass.depth_attachment = 1; + if (vrs_texture.is_valid()) { + pass.vrs_attachment = 2; + } - // - add alpha pass if (use_msaa) { // add resolve pass.resolve_attachments.push_back(color_buffer_id); } + passes.push_back(pass); // - add blit to 2D pass @@ -268,6 +239,7 @@ RID RenderForwardMobile::RenderBufferDataForwardMobile::get_color_fbs(Framebuffe target_buffer = texture_storage->render_target_get_rd_texture(render_target); } else { target_buffer = texture_storage->render_target_get_rd_texture_msaa(render_target); + texture_storage->render_target_set_msaa_needs_resolve(render_target, true); // Make sure this gets resolved. } ERR_FAIL_COND_V(target_buffer.is_null(), RID()); @@ -348,7 +320,7 @@ bool RenderForwardMobile::_render_buffers_can_be_storage() { return false; } -RID RenderForwardMobile::_setup_render_pass_uniform_set(RenderListType p_render_list, const RenderDataRD *p_render_data, RID p_radiance_texture, bool p_use_directional_shadow_atlas, int p_index) { +RID RenderForwardMobile::_setup_render_pass_uniform_set(RenderListType p_render_list, const RenderDataRD *p_render_data, RID p_radiance_texture, const RendererRD::MaterialStorage::Samplers &p_samplers, bool p_use_directional_shadow_atlas, int p_index) { RendererRD::LightStorage *light_storage = RendererRD::LightStorage::get_singleton(); RendererRD::TextureStorage *texture_storage = RendererRD::TextureStorage::get_singleton(); @@ -522,6 +494,68 @@ RID RenderForwardMobile::_setup_render_pass_uniform_set(RenderListType p_render_ uniforms.push_back(u); } + { + RD::Uniform u; + u.binding = 11; + u.uniform_type = RD::UNIFORM_TYPE_SAMPLER; + RID sampler; + switch (decals_get_filter()) { + case RS::DECAL_FILTER_NEAREST: { + sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + } break; + case RS::DECAL_FILTER_LINEAR: { + sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + } break; + case RS::DECAL_FILTER_NEAREST_MIPMAPS: { + sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + } break; + case RS::DECAL_FILTER_LINEAR_MIPMAPS: { + sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + } break; + case RS::DECAL_FILTER_NEAREST_MIPMAPS_ANISOTROPIC: { + sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + } break; + case RS::DECAL_FILTER_LINEAR_MIPMAPS_ANISOTROPIC: { + sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + } break; + } + + u.append_id(sampler); + uniforms.push_back(u); + } + + { + RD::Uniform u; + u.binding = 12; + u.uniform_type = RD::UNIFORM_TYPE_SAMPLER; + RID sampler; + switch (light_projectors_get_filter()) { + case RS::LIGHT_PROJECTOR_FILTER_NEAREST: { + sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + } break; + case RS::LIGHT_PROJECTOR_FILTER_LINEAR: { + sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + } break; + case RS::LIGHT_PROJECTOR_FILTER_NEAREST_MIPMAPS: { + sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + } break; + case RS::LIGHT_PROJECTOR_FILTER_LINEAR_MIPMAPS: { + sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + } break; + case RS::LIGHT_PROJECTOR_FILTER_NEAREST_MIPMAPS_ANISOTROPIC: { + sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + } break; + case RS::LIGHT_PROJECTOR_FILTER_LINEAR_MIPMAPS_ANISOTROPIC: { + sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); + } break; + } + + u.append_id(sampler); + uniforms.push_back(u); + } + + uniforms.append_array(p_samplers.get_uniforms(13)); + if (p_index >= (int)render_pass_uniform_sets.size()) { render_pass_uniform_sets.resize(p_index + 1); } @@ -676,8 +710,9 @@ void RenderForwardMobile::_render_scene(RenderDataRD *p_render_data, const Color Size2i screen_size; RID framebuffer; bool reverse_cull = p_render_data->scene_data->cam_transform.basis.determinant() < 0; - bool using_subpass_transparent = true; - bool using_subpass_post_process = true; + bool merge_transparent_pass = true; // If true: we can do our transparent pass in the same pass as our opaque pass. + bool using_subpass_post_process = true; // If true: we can do our post processing in a subpass + RendererRD::MaterialStorage::Samplers samplers; bool using_shadows = true; @@ -722,8 +757,9 @@ void RenderForwardMobile::_render_scene(RenderDataRD *p_render_data, const Color } reverse_cull = true; - using_subpass_transparent = true; // we ignore our screen/depth texture here + merge_transparent_pass = true; // we ignore our screen/depth texture here using_subpass_post_process = false; // not applicable at all for reflection probes. + samplers = RendererRD::MaterialStorage::get_singleton()->samplers_rd_get_default(); } else if (rb_data.is_valid()) { // setup rendering to render buffer screen_size = p_render_data->render_buffers->get_internal_size(); @@ -738,20 +774,18 @@ void RenderForwardMobile::_render_scene(RenderDataRD *p_render_data, const Color if (scene_state.used_screen_texture || scene_state.used_depth_texture) { // can't use our last two subpasses because we're reading from screen texture or depth texture - using_subpass_transparent = false; + merge_transparent_pass = false; using_subpass_post_process = false; } if (using_subpass_post_process) { - // all as subpasses - framebuffer = rb_data->get_color_fbs(RenderBufferDataForwardMobile::FB_CONFIG_FOUR_SUBPASSES); - } else if (using_subpass_transparent) { - // our tonemap pass is separate - framebuffer = rb_data->get_color_fbs(RenderBufferDataForwardMobile::FB_CONFIG_THREE_SUBPASSES); + // We can do all in one go. + framebuffer = rb_data->get_color_fbs(RenderBufferDataForwardMobile::FB_CONFIG_RENDER_AND_POST_PASS); } else { - // only opaque and sky as subpasses - framebuffer = rb_data->get_color_fbs(RenderBufferDataForwardMobile::FB_CONFIG_TWO_SUBPASSES); + // We separate things out. + framebuffer = rb_data->get_color_fbs(RenderBufferDataForwardMobile::FB_CONFIG_RENDER_PASS); } + samplers = rb->get_samplers(); } else { ERR_FAIL(); //bug? } @@ -764,11 +798,7 @@ void RenderForwardMobile::_render_scene(RenderDataRD *p_render_data, const Color _setup_environment(p_render_data, is_reflection_probe, screen_size, !is_reflection_probe, p_default_bg_color, false); // May have changed due to the above (light buffer enlarged, as an example). - if (is_reflection_probe) { - _update_render_base_uniform_set(RendererRD::MaterialStorage::get_singleton()->samplers_rd_get_default(), BASE_UNIFORM_SET_CACHE_DEFAULT); - } else { - _update_render_base_uniform_set(rb->get_samplers(), BASE_UNIFORM_SET_CACHE_VIEWPORT); - } + _update_render_base_uniform_set(); RD::get_singleton()->draw_command_end_label(); // Render Setup @@ -782,6 +812,7 @@ void RenderForwardMobile::_render_scene(RenderDataRD *p_render_data, const Color Color clear_color = p_default_bg_color; bool keep_color = false; + bool copy_canvas = false; if (get_debug_draw_mode() == RS::VIEWPORT_DEBUG_DRAW_OVERDRAW) { clear_color = Color(0, 0, 0, 1); //in overdraw mode, BG should always be black @@ -820,12 +851,8 @@ void RenderForwardMobile::_render_scene(RenderDataRD *p_render_data, const Color } break; case RS::ENV_BG_CANVAS: { if (rb_data.is_valid()) { - RID dest_framebuffer = rb_data->get_color_fbs(RenderBufferDataForwardMobile::FB_CONFIG_ONE_PASS); - RID texture = RendererRD::TextureStorage::get_singleton()->render_target_get_rd_texture(rb->get_render_target()); - bool convert_to_linear = !RendererRD::TextureStorage::get_singleton()->render_target_is_using_hdr(rb->get_render_target()); - copy_effects->copy_to_fb_rect(texture, dest_framebuffer, Rect2i(), false, false, false, false, RID(), false, false, convert_to_linear); + copy_canvas = true; } - keep_color = true; } break; case RS::ENV_BG_KEEP: { keep_color = true; @@ -893,6 +920,7 @@ void RenderForwardMobile::_render_scene(RenderDataRD *p_render_data, const Color spec_constant_base_flags |= 1 << SPEC_CONSTANT_DISABLE_FOG; } } + { if (rb_data.is_valid()) { RD::get_singleton()->draw_command_begin_label("Render 3D Pass"); @@ -901,134 +929,93 @@ void RenderForwardMobile::_render_scene(RenderDataRD *p_render_data, const Color } // opaque pass - - RD::get_singleton()->draw_command_begin_label("Render Opaque Subpass"); + RD::get_singleton()->draw_command_begin_label("Render Opaque"); p_render_data->scene_data->directional_light_count = p_render_data->directional_light_count; // Shadow pass can change the base uniform set samplers. - if (is_reflection_probe) { - _update_render_base_uniform_set(RendererRD::MaterialStorage::get_singleton()->samplers_rd_get_default(), BASE_UNIFORM_SET_CACHE_DEFAULT); - } else { - _update_render_base_uniform_set(rb->get_samplers(), BASE_UNIFORM_SET_CACHE_VIEWPORT); - } + _update_render_base_uniform_set(); _setup_environment(p_render_data, is_reflection_probe, screen_size, !is_reflection_probe, p_default_bg_color, p_render_data->render_buffers.is_valid()); - if (using_subpass_transparent && using_subpass_post_process) { + if (merge_transparent_pass && using_subpass_post_process) { RENDER_TIMESTAMP("Render Opaque + Transparent + Tonemap"); - } else if (using_subpass_transparent) { + } else if (merge_transparent_pass) { RENDER_TIMESTAMP("Render Opaque + Transparent"); } else { RENDER_TIMESTAMP("Render Opaque"); } - RID rp_uniform_set = _setup_render_pass_uniform_set(RENDER_LIST_OPAQUE, p_render_data, radiance_texture, true); - - bool can_continue_color = !using_subpass_transparent && !scene_state.used_screen_texture; - bool can_continue_depth = !using_subpass_transparent && !scene_state.used_depth_texture; + RID rp_uniform_set = _setup_render_pass_uniform_set(RENDER_LIST_OPAQUE, p_render_data, radiance_texture, samplers, true); + // Set clear colors. + Vector<Color> c; { - // regular forward for now - Vector<Color> c; - { - Color cc = clear_color.srgb_to_linear() * inverse_luminance_multiplier; - if (rb_data.is_valid()) { - cc.a = 0; // For transparent viewport backgrounds. + Color cc = clear_color.srgb_to_linear() * inverse_luminance_multiplier; + if (rb_data.is_valid()) { + cc.a = 0; // For transparent viewport backgrounds. + } + c.push_back(cc); // Our render buffer. + if (rb_data.is_valid()) { + if (p_render_data->render_buffers->get_msaa_3d() != RS::VIEWPORT_MSAA_DISABLED) { + c.push_back(clear_color.srgb_to_linear() * inverse_luminance_multiplier); // Our resolve buffer. } - c.push_back(cc); // Our render buffer. - if (rb_data.is_valid()) { - if (p_render_data->render_buffers->get_msaa_3d() != RS::VIEWPORT_MSAA_DISABLED) { - c.push_back(clear_color.srgb_to_linear() * inverse_luminance_multiplier); // Our resolve buffer. - } - if (using_subpass_post_process) { - c.push_back(Color()); // Our 2D buffer we're copying into. - } + if (using_subpass_post_process) { + c.push_back(Color()); // Our 2D buffer we're copying into. } } + } - RD::FramebufferFormatID fb_format = RD::get_singleton()->framebuffer_get_format(framebuffer); - RenderListParameters render_list_params(render_list[RENDER_LIST_OPAQUE].elements.ptr(), render_list[RENDER_LIST_OPAQUE].element_info.ptr(), render_list[RENDER_LIST_OPAQUE].elements.size(), reverse_cull, PASS_MODE_COLOR, rp_uniform_set, spec_constant_base_flags, get_debug_draw_mode() == RS::VIEWPORT_DEBUG_DRAW_WIREFRAME, Vector2(), p_render_data->scene_data->lod_distance_multiplier, p_render_data->scene_data->screen_mesh_lod_threshold, p_render_data->scene_data->view_count); - render_list_params.framebuffer_format = fb_format; - if ((uint32_t)render_list_params.element_count > render_list_thread_threshold && false) { - // secondary command buffers need more testing at this time - //multi threaded - thread_draw_lists.resize(WorkerThreadPool::get_singleton()->get_thread_count()); - RD::get_singleton()->draw_list_begin_split(framebuffer, thread_draw_lists.size(), thread_draw_lists.ptr(), keep_color ? RD::INITIAL_ACTION_KEEP : RD::INITIAL_ACTION_CLEAR, can_continue_color ? RD::FINAL_ACTION_CONTINUE : RD::FINAL_ACTION_READ, RD::INITIAL_ACTION_CLEAR, can_continue_depth ? RD::FINAL_ACTION_CONTINUE : RD::FINAL_ACTION_READ, c, 1.0, 0); - - WorkerThreadPool::GroupID group_task = WorkerThreadPool::get_singleton()->add_template_group_task(this, &RenderForwardMobile::_render_list_thread_function, &render_list_params, thread_draw_lists.size(), -1, true, SNAME("ForwardMobileRenderList")); - WorkerThreadPool::get_singleton()->wait_for_group_task_completion(group_task); + RD::DrawListID draw_list = RD::get_singleton()->draw_list_begin(framebuffer, keep_color ? RD::INITIAL_ACTION_KEEP : RD::INITIAL_ACTION_CLEAR, merge_transparent_pass ? RD::FINAL_ACTION_READ : RD::FINAL_ACTION_CONTINUE, RD::INITIAL_ACTION_CLEAR, merge_transparent_pass ? RD::FINAL_ACTION_READ : RD::FINAL_ACTION_CONTINUE, c, 1.0, 0); + RD::FramebufferFormatID fb_format = RD::get_singleton()->framebuffer_get_format(framebuffer); + if (copy_canvas) { + if (p_render_data->scene_data->view_count > 1) { + WARN_PRINT_ONCE("Canvas background is not supported in multiview!"); } else { - //single threaded - RD::DrawListID draw_list = RD::get_singleton()->draw_list_begin(framebuffer, keep_color ? RD::INITIAL_ACTION_KEEP : RD::INITIAL_ACTION_CLEAR, can_continue_color ? RD::FINAL_ACTION_CONTINUE : RD::FINAL_ACTION_READ, RD::INITIAL_ACTION_CLEAR, can_continue_depth ? RD::FINAL_ACTION_CONTINUE : RD::FINAL_ACTION_READ, c, 1.0, 0); - _render_list(draw_list, fb_format, &render_list_params, 0, render_list_params.element_count); + RID texture = RendererRD::TextureStorage::get_singleton()->render_target_get_rd_texture(rb->get_render_target()); + bool convert_to_linear = !RendererRD::TextureStorage::get_singleton()->render_target_is_using_hdr(rb->get_render_target()); + + copy_effects->copy_to_drawlist(draw_list, fb_format, texture, convert_to_linear); } } - RD::get_singleton()->draw_command_end_label(); //Render Opaque Subpass + if (render_list[RENDER_LIST_OPAQUE].elements.size() > 0) { + RenderListParameters render_list_params(render_list[RENDER_LIST_OPAQUE].elements.ptr(), render_list[RENDER_LIST_OPAQUE].element_info.ptr(), render_list[RENDER_LIST_OPAQUE].elements.size(), reverse_cull, PASS_MODE_COLOR, rp_uniform_set, spec_constant_base_flags, get_debug_draw_mode() == RS::VIEWPORT_DEBUG_DRAW_WIREFRAME, Vector2(), p_render_data->scene_data->lod_distance_multiplier, p_render_data->scene_data->screen_mesh_lod_threshold, p_render_data->scene_data->view_count); + render_list_params.framebuffer_format = fb_format; + render_list_params.subpass = RD::get_singleton()->draw_list_get_current_pass(); // Should now always be 0. + + _render_list(draw_list, fb_format, &render_list_params, 0, render_list_params.element_count); + } + + RD::get_singleton()->draw_command_end_label(); //Render Opaque if (draw_sky || draw_sky_fog_only) { - RD::get_singleton()->draw_command_begin_label("Draw Sky Subpass"); + RD::get_singleton()->draw_command_begin_label("Draw Sky"); // Note, sky.setup should have been called up above and setup stuff we need. - RD::DrawListID draw_list = RD::get_singleton()->draw_list_switch_to_next_pass(); - sky.draw_sky(draw_list, rb, p_render_data->environment, framebuffer, time, sky_energy_multiplier); - RD::get_singleton()->draw_command_end_label(); // Draw Sky Subpass - - // note, if MSAA is used in 2-subpass approach we should get an automatic resolve here - } else { - // switch to subpass but we do nothing here so basically we skip (though this should trigger resolve with 2-subpass MSAA). - RD::get_singleton()->draw_list_switch_to_next_pass(); + RD::get_singleton()->draw_command_end_label(); // Draw Sky } - if (!using_subpass_transparent) { - // We're done with our subpasses so end our container pass - RD::get_singleton()->draw_list_end(RD::BARRIER_MASK_ALL_BARRIERS); + if (merge_transparent_pass) { + if (render_list[RENDER_LIST_ALPHA].element_info.size() > 0) { + // transparent pass - RD::get_singleton()->draw_command_end_label(); // Render 3D Pass / Render Reflection Probe Pass - } + RD::get_singleton()->draw_command_begin_label("Render Transparent"); - if (scene_state.used_screen_texture) { - // Copy screen texture to backbuffer so we can read from it - _render_buffers_copy_screen_texture(p_render_data); - } - - if (scene_state.used_depth_texture) { - // Copy depth texture to backbuffer so we can read from it - _render_buffers_copy_depth_texture(p_render_data); - } - - // transparent pass - - RD::get_singleton()->draw_command_begin_label("Render Transparent Subpass"); + rp_uniform_set = _setup_render_pass_uniform_set(RENDER_LIST_ALPHA, p_render_data, radiance_texture, samplers, true); - rp_uniform_set = _setup_render_pass_uniform_set(RENDER_LIST_ALPHA, p_render_data, radiance_texture, true); + RenderListParameters render_list_params(render_list[RENDER_LIST_ALPHA].elements.ptr(), render_list[RENDER_LIST_ALPHA].element_info.ptr(), render_list[RENDER_LIST_ALPHA].elements.size(), reverse_cull, PASS_MODE_COLOR_TRANSPARENT, rp_uniform_set, spec_constant_base_flags, get_debug_draw_mode() == RS::VIEWPORT_DEBUG_DRAW_WIREFRAME, Vector2(), p_render_data->scene_data->lod_distance_multiplier, p_render_data->scene_data->screen_mesh_lod_threshold, p_render_data->scene_data->view_count); + render_list_params.framebuffer_format = fb_format; + render_list_params.subpass = RD::get_singleton()->draw_list_get_current_pass(); // Should now always be 0. - if (using_subpass_transparent) { - RD::FramebufferFormatID fb_format = RD::get_singleton()->framebuffer_get_format(framebuffer); - RenderListParameters render_list_params(render_list[RENDER_LIST_ALPHA].elements.ptr(), render_list[RENDER_LIST_ALPHA].element_info.ptr(), render_list[RENDER_LIST_ALPHA].elements.size(), reverse_cull, PASS_MODE_COLOR_TRANSPARENT, rp_uniform_set, spec_constant_base_flags, get_debug_draw_mode() == RS::VIEWPORT_DEBUG_DRAW_WIREFRAME, Vector2(), p_render_data->scene_data->lod_distance_multiplier, p_render_data->scene_data->screen_mesh_lod_threshold, p_render_data->scene_data->view_count); - render_list_params.framebuffer_format = fb_format; - if ((uint32_t)render_list_params.element_count > render_list_thread_threshold && false) { - // secondary command buffers need more testing at this time - //multi threaded - thread_draw_lists.resize(WorkerThreadPool::get_singleton()->get_thread_count()); - RD::get_singleton()->draw_list_switch_to_next_pass_split(thread_draw_lists.size(), thread_draw_lists.ptr()); - render_list_params.subpass = RD::get_singleton()->draw_list_get_current_pass(); - WorkerThreadPool::GroupID group_task = WorkerThreadPool::get_singleton()->add_template_group_task(this, &RenderForwardMobile::_render_list_thread_function, &render_list_params, thread_draw_lists.size(), -1, true, SNAME("ForwardMobileRenderSubpass")); - WorkerThreadPool::get_singleton()->wait_for_group_task_completion(group_task); - - } else { - //single threaded - RD::DrawListID draw_list = RD::get_singleton()->draw_list_switch_to_next_pass(); - render_list_params.subpass = RD::get_singleton()->draw_list_get_current_pass(); _render_list(draw_list, fb_format, &render_list_params, 0, render_list_params.element_count); - } - RD::get_singleton()->draw_command_end_label(); // Render Transparent Subpass + RD::get_singleton()->draw_command_end_label(); // Render Transparent Subpass + } // note if we are using MSAA we should get an automatic resolve through our subpass configuration. @@ -1041,35 +1028,46 @@ void RenderForwardMobile::_render_scene(RenderDataRD *p_render_data, const Color RD::get_singleton()->draw_list_end(RD::BARRIER_MASK_ALL_BARRIERS); } else { - RENDER_TIMESTAMP("Render Transparent"); + // We're done with our subpasses so end our container pass + // note, if MSAA is used we should get an automatic resolve here - if (rb_data.is_valid()) { - framebuffer = rb_data->get_color_fbs(RenderBufferDataForwardMobile::FB_CONFIG_ONE_PASS); + RD::get_singleton()->draw_list_end(RD::BARRIER_MASK_ALL_BARRIERS); + + RD::get_singleton()->draw_command_end_label(); // Render 3D Pass / Render Reflection Probe Pass + + if (scene_state.used_screen_texture) { + // Copy screen texture to backbuffer so we can read from it + _render_buffers_copy_screen_texture(p_render_data); } - // this may be needed if we re-introduced steps that change info, not sure which do so in the previous implementation - // _setup_environment(p_render_data, is_reflection_probe, screen_size, !is_reflection_probe, p_default_bg_color, false); + if (scene_state.used_depth_texture) { + // Copy depth texture to backbuffer so we can read from it + _render_buffers_copy_depth_texture(p_render_data); + } - RD::FramebufferFormatID fb_format = RD::get_singleton()->framebuffer_get_format(framebuffer); - RenderListParameters render_list_params(render_list[RENDER_LIST_ALPHA].elements.ptr(), render_list[RENDER_LIST_ALPHA].element_info.ptr(), render_list[RENDER_LIST_ALPHA].elements.size(), reverse_cull, PASS_MODE_COLOR, rp_uniform_set, spec_constant_base_flags, get_debug_draw_mode() == RS::VIEWPORT_DEBUG_DRAW_WIREFRAME, Vector2(), p_render_data->scene_data->lod_distance_multiplier, p_render_data->scene_data->screen_mesh_lod_threshold, p_render_data->scene_data->view_count); - render_list_params.framebuffer_format = fb_format; - if ((uint32_t)render_list_params.element_count > render_list_thread_threshold && false) { - // secondary command buffers need more testing at this time - //multi threaded - thread_draw_lists.resize(WorkerThreadPool::get_singleton()->get_thread_count()); - RD::get_singleton()->draw_list_begin_split(framebuffer, thread_draw_lists.size(), thread_draw_lists.ptr(), can_continue_color ? RD::INITIAL_ACTION_CONTINUE : RD::INITIAL_ACTION_KEEP, RD::FINAL_ACTION_READ, can_continue_depth ? RD::INITIAL_ACTION_CONTINUE : RD::INITIAL_ACTION_KEEP, RD::FINAL_ACTION_READ); - WorkerThreadPool::GroupID group_task = WorkerThreadPool::get_singleton()->add_template_group_task(this, &RenderForwardMobile::_render_list_thread_function, &render_list_params, thread_draw_lists.size(), -1, true, SNAME("ForwardMobileRenderSubpass")); - WorkerThreadPool::get_singleton()->wait_for_group_task_completion(group_task); + if (render_list[RENDER_LIST_ALPHA].element_info.size() > 0) { + RD::get_singleton()->draw_command_begin_label("Render Transparent Pass"); + RENDER_TIMESTAMP("Render Transparent"); - RD::get_singleton()->draw_list_end(RD::BARRIER_MASK_ALL_BARRIERS); - } else { - //single threaded - RD::DrawListID draw_list = RD::get_singleton()->draw_list_begin(framebuffer, can_continue_color ? RD::INITIAL_ACTION_CONTINUE : RD::INITIAL_ACTION_KEEP, RD::FINAL_ACTION_READ, can_continue_depth ? RD::INITIAL_ACTION_CONTINUE : RD::INITIAL_ACTION_KEEP, RD::FINAL_ACTION_READ); + rp_uniform_set = _setup_render_pass_uniform_set(RENDER_LIST_ALPHA, p_render_data, radiance_texture, samplers, true); + + if (rb_data.is_valid()) { + framebuffer = rb_data->get_color_fbs(RenderBufferDataForwardMobile::FB_CONFIG_RENDER_PASS); + } + + // this may be needed if we re-introduced steps that change info, not sure which do so in the previous implementation + //_setup_environment(p_render_data, is_reflection_probe, screen_size, !is_reflection_probe, p_default_bg_color, false); + + RenderListParameters render_list_params(render_list[RENDER_LIST_ALPHA].elements.ptr(), render_list[RENDER_LIST_ALPHA].element_info.ptr(), render_list[RENDER_LIST_ALPHA].elements.size(), reverse_cull, PASS_MODE_COLOR, rp_uniform_set, spec_constant_base_flags, get_debug_draw_mode() == RS::VIEWPORT_DEBUG_DRAW_WIREFRAME, Vector2(), p_render_data->scene_data->lod_distance_multiplier, p_render_data->scene_data->screen_mesh_lod_threshold, p_render_data->scene_data->view_count); + render_list_params.framebuffer_format = fb_format; + render_list_params.subpass = RD::get_singleton()->draw_list_get_current_pass(); // Should now always be 0. + + draw_list = RD::get_singleton()->draw_list_begin(framebuffer, RD::INITIAL_ACTION_KEEP, RD::FINAL_ACTION_READ, RD::INITIAL_ACTION_KEEP, RD::FINAL_ACTION_READ); _render_list(draw_list, fb_format, &render_list_params, 0, render_list_params.element_count); RD::get_singleton()->draw_list_end(RD::BARRIER_MASK_ALL_BARRIERS); - } - RD::get_singleton()->draw_command_end_label(); // Render Transparent Subpass + RD::get_singleton()->draw_command_end_label(); // Render Transparent Pass + } } } @@ -1273,7 +1271,7 @@ void RenderForwardMobile::_render_shadow_pass(RID p_light, RID p_shadow_atlas, i void RenderForwardMobile::_render_shadow_begin() { scene_state.shadow_passes.clear(); RD::get_singleton()->draw_command_begin_label("Shadow Setup"); - _update_render_base_uniform_set(RendererRD::MaterialStorage::get_singleton()->samplers_rd_get_default(), BASE_UNIFORM_SET_CACHE_DEFAULT); + _update_render_base_uniform_set(); render_list[RENDER_LIST_SECONDARY].clear(); } @@ -1353,7 +1351,7 @@ void RenderForwardMobile::_render_shadow_process() { for (uint32_t i = 0; i < scene_state.shadow_passes.size(); i++) { //render passes need to be configured after instance buffer is done, since they need the latest version SceneState::ShadowPass &shadow_pass = scene_state.shadow_passes[i]; - shadow_pass.rp_uniform_set = _setup_render_pass_uniform_set(RENDER_LIST_SECONDARY, nullptr, RID(), false, i); + shadow_pass.rp_uniform_set = _setup_render_pass_uniform_set(RENDER_LIST_SECONDARY, nullptr, RID(), RendererRD::MaterialStorage::get_singleton()->samplers_rd_get_default(), false, i); } RD::get_singleton()->draw_command_end_label(); @@ -1380,7 +1378,7 @@ void RenderForwardMobile::_render_material(const Transform3D &p_cam_transform, c RD::get_singleton()->draw_command_begin_label("Render 3D Material"); - _update_render_base_uniform_set(RendererRD::MaterialStorage::get_singleton()->samplers_rd_get_default(), BASE_UNIFORM_SET_CACHE_DEFAULT); + _update_render_base_uniform_set(); RenderSceneDataRD scene_data; scene_data.cam_projection = p_cam_projection; @@ -1404,7 +1402,7 @@ void RenderForwardMobile::_render_material(const Transform3D &p_cam_transform, c render_list[RENDER_LIST_SECONDARY].sort_by_key(); _fill_instance_data(RENDER_LIST_SECONDARY); - RID rp_uniform_set = _setup_render_pass_uniform_set(RENDER_LIST_SECONDARY, nullptr, RID()); + RID rp_uniform_set = _setup_render_pass_uniform_set(RENDER_LIST_SECONDARY, nullptr, RID(), RendererRD::MaterialStorage::get_singleton()->samplers_rd_get_default()); RENDER_TIMESTAMP("Render 3D Material"); @@ -1431,7 +1429,7 @@ void RenderForwardMobile::_render_uv2(const PagedArray<RenderGeometryInstance *> RD::get_singleton()->draw_command_begin_label("Render UV2"); - _update_render_base_uniform_set(RendererRD::MaterialStorage::get_singleton()->samplers_rd_get_default(), BASE_UNIFORM_SET_CACHE_DEFAULT); + _update_render_base_uniform_set(); RenderSceneDataRD scene_data; scene_data.dual_paraboloid_side = 0; @@ -1449,7 +1447,7 @@ void RenderForwardMobile::_render_uv2(const PagedArray<RenderGeometryInstance *> render_list[RENDER_LIST_SECONDARY].sort_by_key(); _fill_instance_data(RENDER_LIST_SECONDARY); - RID rp_uniform_set = _setup_render_pass_uniform_set(RENDER_LIST_SECONDARY, nullptr, RID()); + RID rp_uniform_set = _setup_render_pass_uniform_set(RENDER_LIST_SECONDARY, nullptr, RID(), RendererRD::MaterialStorage::get_singleton()->samplers_rd_get_default()); RENDER_TIMESTAMP("Render 3D Material"); @@ -1505,7 +1503,7 @@ void RenderForwardMobile::_render_particle_collider_heightfield(RID p_fb, const RD::get_singleton()->draw_command_begin_label("Render Collider Heightfield"); - _update_render_base_uniform_set(RendererRD::MaterialStorage::get_singleton()->samplers_rd_get_default(), BASE_UNIFORM_SET_CACHE_DEFAULT); + _update_render_base_uniform_set(); RenderSceneDataRD scene_data; scene_data.cam_projection = p_cam_projection; @@ -1530,7 +1528,7 @@ void RenderForwardMobile::_render_particle_collider_heightfield(RID p_fb, const render_list[RENDER_LIST_SECONDARY].sort_by_key(); _fill_instance_data(RENDER_LIST_SECONDARY); - RID rp_uniform_set = _setup_render_pass_uniform_set(RENDER_LIST_SECONDARY, nullptr, RID()); + RID rp_uniform_set = _setup_render_pass_uniform_set(RENDER_LIST_SECONDARY, nullptr, RID(), RendererRD::MaterialStorage::get_singleton()->samplers_rd_get_default()); RENDER_TIMESTAMP("Render Collider Heightfield"); @@ -1543,23 +1541,21 @@ void RenderForwardMobile::_render_particle_collider_heightfield(RID p_fb, const } void RenderForwardMobile::base_uniforms_changed() { - for (int i = 0; i < BASE_UNIFORM_SET_CACHE_MAX; i++) { - if (!render_base_uniform_set_cache[i].is_null() && RD::get_singleton()->uniform_set_is_valid(render_base_uniform_set_cache[i])) { - RD::get_singleton()->free(render_base_uniform_set_cache[i]); - } - render_base_uniform_set_cache[i] = RID(); + if (!render_base_uniform_set.is_null() && RD::get_singleton()->uniform_set_is_valid(render_base_uniform_set)) { + RD::get_singleton()->free(render_base_uniform_set); } + render_base_uniform_set = RID(); } -void RenderForwardMobile::_update_render_base_uniform_set(const RendererRD::MaterialStorage::Samplers &p_samplers, BaseUniformSetCache p_cache_index) { +void RenderForwardMobile::_update_render_base_uniform_set() { RendererRD::LightStorage *light_storage = RendererRD::LightStorage::get_singleton(); - if (render_base_uniform_set_cache[p_cache_index].is_null() || !RD::get_singleton()->uniform_set_is_valid(render_base_uniform_set_cache[p_cache_index]) || (lightmap_texture_array_version_cache[p_cache_index] != light_storage->lightmap_array_get_version())) { - if (render_base_uniform_set_cache[p_cache_index].is_valid() && RD::get_singleton()->uniform_set_is_valid(render_base_uniform_set_cache[p_cache_index])) { - RD::get_singleton()->free(render_base_uniform_set_cache[p_cache_index]); + if (render_base_uniform_set.is_null() || !RD::get_singleton()->uniform_set_is_valid(render_base_uniform_set) || (lightmap_texture_array_version != light_storage->lightmap_array_get_version())) { + if (render_base_uniform_set.is_valid() && RD::get_singleton()->uniform_set_is_valid(render_base_uniform_set)) { + RD::get_singleton()->free(render_base_uniform_set); } - lightmap_texture_array_version_cache[p_cache_index] = light_storage->lightmap_array_get_version(); + lightmap_texture_array_version = light_storage->lightmap_array_get_version(); Vector<RD::Uniform> uniforms; @@ -1574,73 +1570,13 @@ void RenderForwardMobile::_update_render_base_uniform_set(const RendererRD::Mate { RD::Uniform u; u.binding = 3; - u.uniform_type = RD::UNIFORM_TYPE_SAMPLER; - RID sampler; - switch (decals_get_filter()) { - case RS::DECAL_FILTER_NEAREST: { - sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); - } break; - case RS::DECAL_FILTER_LINEAR: { - sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); - } break; - case RS::DECAL_FILTER_NEAREST_MIPMAPS: { - sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); - } break; - case RS::DECAL_FILTER_LINEAR_MIPMAPS: { - sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); - } break; - case RS::DECAL_FILTER_NEAREST_MIPMAPS_ANISOTROPIC: { - sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); - } break; - case RS::DECAL_FILTER_LINEAR_MIPMAPS_ANISOTROPIC: { - sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); - } break; - } - - u.append_id(sampler); - uniforms.push_back(u); - } - - { - RD::Uniform u; - u.binding = 4; - u.uniform_type = RD::UNIFORM_TYPE_SAMPLER; - RID sampler; - switch (light_projectors_get_filter()) { - case RS::LIGHT_PROJECTOR_FILTER_NEAREST: { - sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); - } break; - case RS::LIGHT_PROJECTOR_FILTER_LINEAR: { - sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); - } break; - case RS::LIGHT_PROJECTOR_FILTER_NEAREST_MIPMAPS: { - sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); - } break; - case RS::LIGHT_PROJECTOR_FILTER_LINEAR_MIPMAPS: { - sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); - } break; - case RS::LIGHT_PROJECTOR_FILTER_NEAREST_MIPMAPS_ANISOTROPIC: { - sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); - } break; - case RS::LIGHT_PROJECTOR_FILTER_LINEAR_MIPMAPS_ANISOTROPIC: { - sampler = p_samplers.get_sampler(RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC, RS::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); - } break; - } - - u.append_id(sampler); - uniforms.push_back(u); - } - - { - RD::Uniform u; - u.binding = 5; u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER; u.append_id(RendererRD::LightStorage::get_singleton()->get_omni_light_buffer()); uniforms.push_back(u); } { RD::Uniform u; - u.binding = 6; + u.binding = 4; u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER; u.append_id(RendererRD::LightStorage::get_singleton()->get_spot_light_buffer()); uniforms.push_back(u); @@ -1648,35 +1584,35 @@ void RenderForwardMobile::_update_render_base_uniform_set(const RendererRD::Mate { RD::Uniform u; - u.binding = 7; + u.binding = 5; u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER; u.append_id(RendererRD::LightStorage::get_singleton()->get_reflection_probe_buffer()); uniforms.push_back(u); } { RD::Uniform u; - u.binding = 8; + u.binding = 6; u.uniform_type = RD::UNIFORM_TYPE_UNIFORM_BUFFER; u.append_id(RendererRD::LightStorage::get_singleton()->get_directional_light_buffer()); uniforms.push_back(u); } { RD::Uniform u; - u.binding = 9; + u.binding = 7; u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER; u.append_id(scene_state.lightmap_buffer); uniforms.push_back(u); } { RD::Uniform u; - u.binding = 10; + u.binding = 8; u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER; u.append_id(scene_state.lightmap_capture_buffer); uniforms.push_back(u); } { RD::Uniform u; - u.binding = 11; + u.binding = 9; u.uniform_type = RD::UNIFORM_TYPE_TEXTURE; RID decal_atlas = RendererRD::TextureStorage::get_singleton()->decal_atlas_get_texture(); u.append_id(decal_atlas); @@ -1684,7 +1620,7 @@ void RenderForwardMobile::_update_render_base_uniform_set(const RendererRD::Mate } { RD::Uniform u; - u.binding = 12; + u.binding = 10; u.uniform_type = RD::UNIFORM_TYPE_TEXTURE; RID decal_atlas = RendererRD::TextureStorage::get_singleton()->decal_atlas_get_texture_srgb(); u.append_id(decal_atlas); @@ -1692,7 +1628,7 @@ void RenderForwardMobile::_update_render_base_uniform_set(const RendererRD::Mate } { RD::Uniform u; - u.binding = 13; + u.binding = 11; u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER; u.append_id(RendererRD::TextureStorage::get_singleton()->get_decal_buffer()); uniforms.push_back(u); @@ -1701,16 +1637,21 @@ void RenderForwardMobile::_update_render_base_uniform_set(const RendererRD::Mate { RD::Uniform u; u.uniform_type = RD::UNIFORM_TYPE_STORAGE_BUFFER; - u.binding = 14; + u.binding = 12; u.append_id(RendererRD::MaterialStorage::get_singleton()->global_shader_uniforms_get_storage_buffer()); uniforms.push_back(u); } - uniforms.append_array(p_samplers.get_uniforms(SAMPLERS_BINDING_FIRST_INDEX)); + { + RD::Uniform u; + u.binding = 13; + u.uniform_type = RD::UNIFORM_TYPE_SAMPLER; + u.append_id(RendererRD::MaterialStorage::get_singleton()->sampler_rd_get_default(RS::CanvasItemTextureFilter::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS, RS::CanvasItemTextureRepeat::CANVAS_ITEM_TEXTURE_REPEAT_DISABLED)); + uniforms.push_back(u); + } - render_base_uniform_set_cache[p_cache_index] = RD::get_singleton()->uniform_set_create(uniforms, scene_shader.default_shader_rd, SCENE_UNIFORM_SET); + render_base_uniform_set = RD::get_singleton()->uniform_set_create(uniforms, scene_shader.default_shader_rd, SCENE_UNIFORM_SET); } - render_base_uniform_set = render_base_uniform_set_cache[p_cache_index]; } RID RenderForwardMobile::_render_buffers_get_normal_texture(Ref<RenderSceneBuffersRD> p_render_buffers) { @@ -2863,7 +2804,6 @@ RenderForwardMobile::RenderForwardMobile() { } { defines += "\n#define MATERIAL_UNIFORM_SET " + itos(MATERIAL_UNIFORM_SET) + "\n"; - defines += "\n#define SAMPLERS_BINDING_FIRST_INDEX " + itos(SAMPLERS_BINDING_FIRST_INDEX) + "\n"; } #ifdef REAL_T_IS_DOUBLE { diff --git a/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.h b/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.h index f10d3c1568..3496495245 100644 --- a/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.h +++ b/servers/rendering/renderer_rd/forward_mobile/render_forward_mobile.h @@ -59,8 +59,6 @@ private: MATERIAL_UNIFORM_SET = 3, }; - const int SAMPLERS_BINDING_FIRST_INDEX = 15; - enum { SPEC_CONSTANT_USING_PROJECTOR = 0, @@ -108,15 +106,9 @@ private: GDCLASS(RenderBufferDataForwardMobile, RenderBufferCustomDataRD); public: - // We can have: - // - 4 subpasses combining the full render cycle - // - 3 subpasses + 1 normal pass for tonemapping/glow/dof/etc (using fb for 2D buffer) - // - 2 subpasses + 1 normal pass for transparent + 1 normal pass for tonemapping/glow/dof/etc (using fb for 2D buffer) enum FramebufferConfigType { - FB_CONFIG_ONE_PASS, // Single pass frame buffer for alpha pass - FB_CONFIG_TWO_SUBPASSES, // Opaque + Sky sub pass - FB_CONFIG_THREE_SUBPASSES, // Opaque + Sky + Alpha sub pass - FB_CONFIG_FOUR_SUBPASSES, // Opaque + Sky + Alpha sub pass + Tonemap pass + FB_CONFIG_RENDER_PASS, // Single pass framebuffer for normal rendering. + FB_CONFIG_RENDER_AND_POST_PASS, // Two subpasses, one for normal rendering, one for post processing. FB_CONFIG_MAX }; @@ -195,22 +187,12 @@ private: /* Render Scene */ - RID _setup_render_pass_uniform_set(RenderListType p_render_list, const RenderDataRD *p_render_data, RID p_radiance_texture, bool p_use_directional_shadow_atlas = false, int p_index = 0); + RID _setup_render_pass_uniform_set(RenderListType p_render_list, const RenderDataRD *p_render_data, RID p_radiance_texture, const RendererRD::MaterialStorage::Samplers &p_samplers, bool p_use_directional_shadow_atlas = false, int p_index = 0); void _pre_opaque_render(RenderDataRD *p_render_data); - enum BaseUniformSetCache { - BASE_UNIFORM_SET_CACHE_VIEWPORT, - BASE_UNIFORM_SET_CACHE_DEFAULT, - BASE_UNIFORM_SET_CACHE_MAX - }; - - // One for custom samplers, one for default samplers. - // Need to switch between them as default is needed for probes, shadows, materials, etc. - RID render_base_uniform_set_cache[BASE_UNIFORM_SET_CACHE_MAX]; - - uint64_t lightmap_texture_array_version_cache[BASE_UNIFORM_SET_CACHE_MAX] = { 0xFFFFFFFF, 0xFFFFFFFF }; + uint64_t lightmap_texture_array_version = 0xFFFFFFFF; - void _update_render_base_uniform_set(const RendererRD::MaterialStorage::Samplers &p_samplers, BaseUniformSetCache p_cache_index); + void _update_render_base_uniform_set(); void _update_instance_data_buffer(RenderListType p_render_list); void _fill_instance_data(RenderListType p_render_list, uint32_t p_offset = 0, int32_t p_max_elements = -1, bool p_update_buffer = true); diff --git a/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp b/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp index 0b1561939e..657628111a 100644 --- a/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp @@ -305,6 +305,7 @@ RendererCanvasRender::PolygonID RendererCanvasRenderRD::request_polygon(const Ve } pb.vertex_array = RD::get_singleton()->vertex_array_create(p_points.size(), vertex_id, buffers); + pb.primitive_count = vertex_count; if (p_indices.size()) { //create indices, as indices were requested @@ -316,6 +317,7 @@ RendererCanvasRender::PolygonID RendererCanvasRenderRD::request_polygon(const Ve } pb.index_buffer = RD::get_singleton()->index_buffer_create(p_indices.size(), RD::INDEX_BUFFER_FORMAT_UINT32, index_buffer); pb.indices = RD::get_singleton()->index_array_create(pb.index_buffer, 0, p_indices.size()); + pb.primitive_count = p_indices.size(); } pb.vertex_format_id = vertex_id; @@ -398,7 +400,13 @@ void RendererCanvasRenderRD::_bind_canvas_texture(RD::DrawListID p_draw_list, RI r_last_texture = p_texture; } -void RendererCanvasRenderRD::_render_item(RD::DrawListID p_draw_list, RID p_render_target, const Item *p_item, RD::FramebufferFormatID p_framebuffer_format, const Transform2D &p_canvas_transform_inverse, Item *¤t_clip, Light *p_lights, PipelineVariants *p_pipeline_variants, bool &r_sdf_used) { +_FORCE_INLINE_ static uint32_t _indices_to_primitives(RS::PrimitiveType p_primitive, uint32_t p_indices) { + static const uint32_t divisor[RS::PRIMITIVE_MAX] = { 1, 2, 1, 3, 1 }; + static const uint32_t subtractor[RS::PRIMITIVE_MAX] = { 0, 0, 1, 0, 1 }; + return (p_indices - subtractor[p_primitive]) / divisor[p_primitive]; +} + +void RendererCanvasRenderRD::_render_item(RD::DrawListID p_draw_list, RID p_render_target, const Item *p_item, RD::FramebufferFormatID p_framebuffer_format, const Transform2D &p_canvas_transform_inverse, Item *¤t_clip, Light *p_lights, PipelineVariants *p_pipeline_variants, bool &r_sdf_used, RenderingMethod::RenderInfo *r_render_info) { //create an empty push constant RendererRD::TextureStorage *texture_storage = RendererRD::TextureStorage::get_singleton(); RendererRD::MeshStorage *mesh_storage = RendererRD::MeshStorage::get_singleton(); @@ -592,6 +600,12 @@ void RendererCanvasRenderRD::_render_item(RD::DrawListID p_draw_list, RID p_rend RD::get_singleton()->draw_list_bind_index_array(p_draw_list, shader.quad_index_array); RD::get_singleton()->draw_list_draw(p_draw_list, true); + if (r_render_info) { + r_render_info->info[RS::VIEWPORT_RENDER_INFO_TYPE_CANVAS][RS::VIEWPORT_RENDER_INFO_OBJECTS_IN_FRAME]++; + r_render_info->info[RS::VIEWPORT_RENDER_INFO_TYPE_CANVAS][RS::VIEWPORT_RENDER_INFO_PRIMITIVES_IN_FRAME] += 2; + r_render_info->info[RS::VIEWPORT_RENDER_INFO_TYPE_CANVAS][RS::VIEWPORT_RENDER_INFO_DRAW_CALLS_IN_FRAME]++; + } + } break; case Item::Command::TYPE_NINEPATCH: { @@ -661,6 +675,12 @@ void RendererCanvasRenderRD::_render_item(RD::DrawListID p_draw_list, RID p_rend RD::get_singleton()->draw_list_bind_index_array(p_draw_list, shader.quad_index_array); RD::get_singleton()->draw_list_draw(p_draw_list, true); + if (r_render_info) { + r_render_info->info[RS::VIEWPORT_RENDER_INFO_TYPE_CANVAS][RS::VIEWPORT_RENDER_INFO_OBJECTS_IN_FRAME]++; + r_render_info->info[RS::VIEWPORT_RENDER_INFO_TYPE_CANVAS][RS::VIEWPORT_RENDER_INFO_PRIMITIVES_IN_FRAME] += 2; + r_render_info->info[RS::VIEWPORT_RENDER_INFO_TYPE_CANVAS][RS::VIEWPORT_RENDER_INFO_DRAW_CALLS_IN_FRAME]++; + } + // Restore if overridden. push_constant.color_texture_pixel_size[0] = texpixel_size.x; push_constant.color_texture_pixel_size[1] = texpixel_size.y; @@ -711,6 +731,12 @@ void RendererCanvasRenderRD::_render_item(RD::DrawListID p_draw_list, RID p_rend } RD::get_singleton()->draw_list_draw(p_draw_list, pb->indices.is_valid()); + if (r_render_info) { + r_render_info->info[RS::VIEWPORT_RENDER_INFO_TYPE_CANVAS][RS::VIEWPORT_RENDER_INFO_OBJECTS_IN_FRAME]++; + r_render_info->info[RS::VIEWPORT_RENDER_INFO_TYPE_CANVAS][RS::VIEWPORT_RENDER_INFO_PRIMITIVES_IN_FRAME] += _indices_to_primitives(polygon->primitive, pb->primitive_count); + r_render_info->info[RS::VIEWPORT_RENDER_INFO_TYPE_CANVAS][RS::VIEWPORT_RENDER_INFO_DRAW_CALLS_IN_FRAME]++; + } + } break; case Item::Command::TYPE_PRIMITIVE: { const Item::CommandPrimitive *primitive = static_cast<const Item::CommandPrimitive *>(c); @@ -744,6 +770,12 @@ void RendererCanvasRenderRD::_render_item(RD::DrawListID p_draw_list, RID p_rend RD::get_singleton()->draw_list_set_push_constant(p_draw_list, &push_constant, sizeof(PushConstant)); RD::get_singleton()->draw_list_draw(p_draw_list, true); + if (r_render_info) { + r_render_info->info[RS::VIEWPORT_RENDER_INFO_TYPE_CANVAS][RS::VIEWPORT_RENDER_INFO_OBJECTS_IN_FRAME]++; + r_render_info->info[RS::VIEWPORT_RENDER_INFO_TYPE_CANVAS][RS::VIEWPORT_RENDER_INFO_PRIMITIVES_IN_FRAME]++; + r_render_info->info[RS::VIEWPORT_RENDER_INFO_TYPE_CANVAS][RS::VIEWPORT_RENDER_INFO_DRAW_CALLS_IN_FRAME]++; + } + if (primitive->point_count == 4) { for (uint32_t j = 1; j < 3; j++) { //second half of triangle @@ -761,6 +793,12 @@ void RendererCanvasRenderRD::_render_item(RD::DrawListID p_draw_list, RID p_rend RD::get_singleton()->draw_list_set_push_constant(p_draw_list, &push_constant, sizeof(PushConstant)); RD::get_singleton()->draw_list_draw(p_draw_list, true); + + if (r_render_info) { + r_render_info->info[RS::VIEWPORT_RENDER_INFO_TYPE_CANVAS][RS::VIEWPORT_RENDER_INFO_OBJECTS_IN_FRAME]++; + r_render_info->info[RS::VIEWPORT_RENDER_INFO_TYPE_CANVAS][RS::VIEWPORT_RENDER_INFO_PRIMITIVES_IN_FRAME]++; + r_render_info->info[RS::VIEWPORT_RENDER_INFO_TYPE_CANVAS][RS::VIEWPORT_RENDER_INFO_DRAW_CALLS_IN_FRAME]++; + } } } break; @@ -918,6 +956,12 @@ void RendererCanvasRenderRD::_render_item(RD::DrawListID p_draw_list, RID p_rend RD::get_singleton()->draw_list_set_push_constant(p_draw_list, &push_constant, sizeof(PushConstant)); RD::get_singleton()->draw_list_draw(p_draw_list, index_array.is_valid(), instance_count); + + if (r_render_info) { + r_render_info->info[RS::VIEWPORT_RENDER_INFO_TYPE_CANVAS][RS::VIEWPORT_RENDER_INFO_OBJECTS_IN_FRAME]++; + r_render_info->info[RS::VIEWPORT_RENDER_INFO_TYPE_CANVAS][RS::VIEWPORT_RENDER_INFO_PRIMITIVES_IN_FRAME] += _indices_to_primitives(primitive, mesh_storage->mesh_surface_get_vertices_drawn_count(surface)) * instance_count; + r_render_info->info[RS::VIEWPORT_RENDER_INFO_TYPE_CANVAS][RS::VIEWPORT_RENDER_INFO_DRAW_CALLS_IN_FRAME]++; + } } for (int j = 0; j < 6; j++) { @@ -1098,7 +1142,7 @@ RID RendererCanvasRenderRD::_create_base_uniform_set(RID p_to_render_target, boo return uniform_set; } -void RendererCanvasRenderRD::_render_items(RID p_to_render_target, int p_item_count, const Transform2D &p_canvas_transform_inverse, Light *p_lights, bool &r_sdf_used, bool p_to_backbuffer) { +void RendererCanvasRenderRD::_render_items(RID p_to_render_target, int p_item_count, const Transform2D &p_canvas_transform_inverse, Light *p_lights, bool &r_sdf_used, bool p_to_backbuffer, RenderingMethod::RenderInfo *r_render_info) { RendererRD::MaterialStorage *material_storage = RendererRD::MaterialStorage::get_singleton(); RendererRD::TextureStorage *texture_storage = RendererRD::TextureStorage::get_singleton(); @@ -1116,6 +1160,7 @@ void RendererCanvasRenderRD::_render_items(RID p_to_render_target, int p_item_co fb_uniform_set = texture_storage->render_target_get_backbuffer_uniform_set(p_to_render_target); } else { framebuffer = texture_storage->render_target_get_rd_framebuffer(p_to_render_target); + texture_storage->render_target_set_msaa_needs_resolve(p_to_render_target, false); // If MSAA is enabled, our framebuffer will be resolved! if (texture_storage->render_target_is_clear_requested(p_to_render_target)) { clear = true; @@ -1195,7 +1240,7 @@ void RendererCanvasRenderRD::_render_items(RID p_to_render_target, int p_item_co } } - _render_item(draw_list, p_to_render_target, ci, fb_format, canvas_transform_inverse, current_clip, p_lights, pipeline_variants, r_sdf_used); + _render_item(draw_list, p_to_render_target, ci, fb_format, canvas_transform_inverse, current_clip, p_lights, pipeline_variants, r_sdf_used, r_render_info); prev_material = material; } @@ -1203,7 +1248,7 @@ void RendererCanvasRenderRD::_render_items(RID p_to_render_target, int p_item_co RD::get_singleton()->draw_list_end(); } -void RendererCanvasRenderRD::canvas_render_items(RID p_to_render_target, Item *p_item_list, const Color &p_modulate, Light *p_light_list, Light *p_directional_light_list, const Transform2D &p_canvas_transform, RenderingServer::CanvasItemTextureFilter p_default_filter, RenderingServer::CanvasItemTextureRepeat p_default_repeat, bool p_snap_2d_vertices_to_pixel, bool &r_sdf_used) { +void RendererCanvasRenderRD::canvas_render_items(RID p_to_render_target, Item *p_item_list, const Color &p_modulate, Light *p_light_list, Light *p_directional_light_list, const Transform2D &p_canvas_transform, RenderingServer::CanvasItemTextureFilter p_default_filter, RenderingServer::CanvasItemTextureRepeat p_default_repeat, bool p_snap_2d_vertices_to_pixel, bool &r_sdf_used, RenderingMethod::RenderInfo *r_render_info) { RendererRD::TextureStorage *texture_storage = RendererRD::TextureStorage::get_singleton(); RendererRD::MaterialStorage *material_storage = RendererRD::MaterialStorage::get_singleton(); RendererRD::MeshStorage *mesh_storage = RendererRD::MeshStorage::get_singleton(); @@ -1494,7 +1539,7 @@ void RendererCanvasRenderRD::canvas_render_items(RID p_to_render_target, Item *p update_skeletons = false; } - _render_items(p_to_render_target, item_count, canvas_transform_inverse, p_light_list, r_sdf_used); + _render_items(p_to_render_target, item_count, canvas_transform_inverse, p_light_list, r_sdf_used, false, r_render_info); item_count = 0; if (ci->canvas_group_owner->canvas_group->mode != RS::CANVAS_GROUP_MODE_TRANSPARENT) { @@ -1526,7 +1571,7 @@ void RendererCanvasRenderRD::canvas_render_items(RID p_to_render_target, Item *p update_skeletons = false; } - _render_items(p_to_render_target, item_count, canvas_transform_inverse, p_light_list, r_sdf_used, true); + _render_items(p_to_render_target, item_count, canvas_transform_inverse, p_light_list, r_sdf_used, true, r_render_info); item_count = 0; if (ci->canvas_group->blur_mipmaps) { @@ -1550,7 +1595,7 @@ void RendererCanvasRenderRD::canvas_render_items(RID p_to_render_target, Item *p update_skeletons = false; } - _render_items(p_to_render_target, item_count, canvas_transform_inverse, p_light_list, r_sdf_used); + _render_items(p_to_render_target, item_count, canvas_transform_inverse, p_light_list, r_sdf_used, false, r_render_info); item_count = 0; texture_storage->render_target_copy_to_back_buffer(p_to_render_target, back_buffer_rect, backbuffer_gen_mipmaps); @@ -1580,7 +1625,7 @@ void RendererCanvasRenderRD::canvas_render_items(RID p_to_render_target, Item *p update_skeletons = false; } - _render_items(p_to_render_target, item_count, canvas_transform_inverse, p_light_list, r_sdf_used, canvas_group_owner != nullptr); + _render_items(p_to_render_target, item_count, canvas_transform_inverse, p_light_list, r_sdf_used, canvas_group_owner != nullptr, r_render_info); //then reset item_count = 0; } @@ -1980,8 +2025,7 @@ void RendererCanvasRenderRD::occluder_polygon_set_shape(RID p_occluder, const Ve if (oc->vertex_array.is_null()) { //create from scratch //vertices - // TODO: geometry is always of length lc * 6 * sizeof(float), so in doubles builds this will receive half the data it needs - oc->vertex_buffer = RD::get_singleton()->vertex_buffer_create(lc * 6 * sizeof(real_t), geometry); + oc->vertex_buffer = RD::get_singleton()->vertex_buffer_create(lc * 6 * sizeof(float), geometry); Vector<RID> buffer; buffer.push_back(oc->vertex_buffer); @@ -2042,7 +2086,18 @@ void RendererCanvasRenderRD::occluder_polygon_set_shape(RID p_occluder, const Ve if (oc->sdf_vertex_array.is_null()) { //create from scratch //vertices - oc->sdf_vertex_buffer = RD::get_singleton()->vertex_buffer_create(p_points.size() * 2 * sizeof(real_t), p_points.to_byte_array()); +#ifdef REAL_T_IS_DOUBLE + PackedFloat32Array float_points; + float_points.resize(p_points.size() * 2); + float *float_points_ptr = (float *)float_points.ptrw(); + for (int i = 0; i < p_points.size(); i++) { + float_points_ptr[i * 2] = p_points[i].x; + float_points_ptr[i * 2 + 1] = p_points[i].y; + } + oc->sdf_vertex_buffer = RD::get_singleton()->vertex_buffer_create(p_points.size() * 2 * sizeof(float), float_points.to_byte_array()); +#else + oc->sdf_vertex_buffer = RD::get_singleton()->vertex_buffer_create(p_points.size() * 2 * sizeof(float), p_points.to_byte_array()); +#endif oc->sdf_index_buffer = RD::get_singleton()->index_buffer_create(sdf_indices.size(), RD::INDEX_BUFFER_FORMAT_UINT32, sdf_indices.to_byte_array()); oc->sdf_index_array = RD::get_singleton()->index_array_create(oc->sdf_index_buffer, 0, sdf_indices.size()); @@ -2053,7 +2108,18 @@ void RendererCanvasRenderRD::occluder_polygon_set_shape(RID p_occluder, const Ve } else { //update existing - RD::get_singleton()->buffer_update(oc->sdf_vertex_buffer, 0, sizeof(real_t) * 2 * p_points.size(), p_points.ptr()); +#ifdef REAL_T_IS_DOUBLE + PackedFloat32Array float_points; + float_points.resize(p_points.size() * 2); + float *float_points_ptr = (float *)float_points.ptrw(); + for (int i = 0; i < p_points.size(); i++) { + float_points_ptr[i * 2] = p_points[i].x; + float_points_ptr[i * 2 + 1] = p_points[i].y; + } + RD::get_singleton()->buffer_update(oc->sdf_vertex_buffer, 0, sizeof(float) * 2 * p_points.size(), float_points.ptr()); +#else + RD::get_singleton()->buffer_update(oc->sdf_vertex_buffer, 0, sizeof(float) * 2 * p_points.size(), p_points.ptr()); +#endif RD::get_singleton()->buffer_update(oc->sdf_index_buffer, 0, sdf_indices.size() * sizeof(int32_t), sdf_indices.ptr()); } } @@ -2577,15 +2643,15 @@ RendererCanvasRenderRD::RendererCanvasRenderRD() { //pipelines Vector<RD::VertexAttribute> vf; RD::VertexAttribute vd; - vd.format = sizeof(real_t) == sizeof(float) ? RD::DATA_FORMAT_R32G32B32_SFLOAT : RD::DATA_FORMAT_R64G64B64_SFLOAT; + vd.format = RD::DATA_FORMAT_R32G32B32_SFLOAT; + vd.stride = sizeof(float) * 3; vd.location = 0; vd.offset = 0; - vd.stride = sizeof(real_t) * 3; vf.push_back(vd); shadow_render.vertex_format = RD::get_singleton()->vertex_format_create(vf); - vd.format = sizeof(real_t) == sizeof(float) ? RD::DATA_FORMAT_R32G32_SFLOAT : RD::DATA_FORMAT_R64G64_SFLOAT; - vd.stride = sizeof(real_t) * 2; + vd.format = RD::DATA_FORMAT_R32G32_SFLOAT; + vd.stride = sizeof(float) * 2; vf.write[0] = vd; shadow_render.sdf_vertex_format = RD::get_singleton()->vertex_format_create(vf); diff --git a/servers/rendering/renderer_rd/renderer_canvas_render_rd.h b/servers/rendering/renderer_rd/renderer_canvas_render_rd.h index 7dbcd903e6..6da3774fc2 100644 --- a/servers/rendering/renderer_rd/renderer_canvas_render_rd.h +++ b/servers/rendering/renderer_rd/renderer_canvas_render_rd.h @@ -229,6 +229,7 @@ class RendererCanvasRenderRD : public RendererCanvasRender { RID vertex_array; RID index_buffer; RID indices; + uint32_t primitive_count = 0; }; struct { @@ -423,8 +424,8 @@ class RendererCanvasRenderRD : public RendererCanvasRender { double debug_redraw_time = 1.0; inline void _bind_canvas_texture(RD::DrawListID p_draw_list, RID p_texture, RS::CanvasItemTextureFilter p_base_filter, RS::CanvasItemTextureRepeat p_base_repeat, RID &r_last_texture, PushConstant &push_constant, Size2 &r_texpixel_size, bool p_texture_is_data = false); //recursive, so regular inline used instead. - void _render_item(RenderingDevice::DrawListID p_draw_list, RID p_render_target, const Item *p_item, RenderingDevice::FramebufferFormatID p_framebuffer_format, const Transform2D &p_canvas_transform_inverse, Item *¤t_clip, Light *p_lights, PipelineVariants *p_pipeline_variants, bool &r_sdf_used); - void _render_items(RID p_to_render_target, int p_item_count, const Transform2D &p_canvas_transform_inverse, Light *p_lights, bool &r_sdf_used, bool p_to_backbuffer = false); + void _render_item(RenderingDevice::DrawListID p_draw_list, RID p_render_target, const Item *p_item, RenderingDevice::FramebufferFormatID p_framebuffer_format, const Transform2D &p_canvas_transform_inverse, Item *¤t_clip, Light *p_lights, PipelineVariants *p_pipeline_variants, bool &r_sdf_used, RenderingMethod::RenderInfo *r_render_info = nullptr); + void _render_items(RID p_to_render_target, int p_item_count, const Transform2D &p_canvas_transform_inverse, Light *p_lights, bool &r_sdf_used, bool p_to_backbuffer = false, RenderingMethod::RenderInfo *r_render_info = nullptr); _FORCE_INLINE_ void _update_transform_2d_to_mat2x4(const Transform2D &p_transform, float *p_mat2x4); _FORCE_INLINE_ void _update_transform_2d_to_mat2x3(const Transform2D &p_transform, float *p_mat2x3); @@ -435,30 +436,30 @@ class RendererCanvasRenderRD : public RendererCanvasRender { void _update_shadow_atlas(); public: - PolygonID request_polygon(const Vector<int> &p_indices, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), const Vector<int> &p_bones = Vector<int>(), const Vector<float> &p_weights = Vector<float>()); - void free_polygon(PolygonID p_polygon); + PolygonID request_polygon(const Vector<int> &p_indices, const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs = Vector<Point2>(), const Vector<int> &p_bones = Vector<int>(), const Vector<float> &p_weights = Vector<float>()) override; + void free_polygon(PolygonID p_polygon) override; - RID light_create(); - void light_set_texture(RID p_rid, RID p_texture); - void light_set_use_shadow(RID p_rid, bool p_enable); - void light_update_shadow(RID p_rid, int p_shadow_index, const Transform2D &p_light_xform, int p_light_mask, float p_near, float p_far, LightOccluderInstance *p_occluders); - void light_update_directional_shadow(RID p_rid, int p_shadow_index, const Transform2D &p_light_xform, int p_light_mask, float p_cull_distance, const Rect2 &p_clip_rect, LightOccluderInstance *p_occluders); + RID light_create() override; + void light_set_texture(RID p_rid, RID p_texture) override; + void light_set_use_shadow(RID p_rid, bool p_enable) override; + void light_update_shadow(RID p_rid, int p_shadow_index, const Transform2D &p_light_xform, int p_light_mask, float p_near, float p_far, LightOccluderInstance *p_occluders) override; + void light_update_directional_shadow(RID p_rid, int p_shadow_index, const Transform2D &p_light_xform, int p_light_mask, float p_cull_distance, const Rect2 &p_clip_rect, LightOccluderInstance *p_occluders) override; - virtual void render_sdf(RID p_render_target, LightOccluderInstance *p_occluders); + virtual void render_sdf(RID p_render_target, LightOccluderInstance *p_occluders) override; - RID occluder_polygon_create(); - void occluder_polygon_set_shape(RID p_occluder, const Vector<Vector2> &p_points, bool p_closed); - void occluder_polygon_set_cull_mode(RID p_occluder, RS::CanvasOccluderPolygonCullMode p_mode); + RID occluder_polygon_create() override; + void occluder_polygon_set_shape(RID p_occluder, const Vector<Vector2> &p_points, bool p_closed) override; + void occluder_polygon_set_cull_mode(RID p_occluder, RS::CanvasOccluderPolygonCullMode p_mode) override; - void canvas_render_items(RID p_to_render_target, Item *p_item_list, const Color &p_modulate, Light *p_light_list, Light *p_directional_light_list, const Transform2D &p_canvas_transform, RS::CanvasItemTextureFilter p_default_filter, RS::CanvasItemTextureRepeat p_default_repeat, bool p_snap_2d_vertices_to_pixel, bool &r_sdf_used); + void canvas_render_items(RID p_to_render_target, Item *p_item_list, const Color &p_modulate, Light *p_light_list, Light *p_directional_light_list, const Transform2D &p_canvas_transform, RS::CanvasItemTextureFilter p_default_filter, RS::CanvasItemTextureRepeat p_default_repeat, bool p_snap_2d_vertices_to_pixel, bool &r_sdf_used, RenderingMethod::RenderInfo *r_render_info = nullptr) override; - virtual void set_shadow_texture_size(int p_size); + virtual void set_shadow_texture_size(int p_size) override; - void set_debug_redraw(bool p_enabled, double p_time, const Color &p_color); + void set_debug_redraw(bool p_enabled, double p_time, const Color &p_color) override; void set_time(double p_time); - void update(); - bool free(RID p_rid); + void update() override; + bool free(RID p_rid) override; RendererCanvasRenderRD(); ~RendererCanvasRenderRD(); }; diff --git a/servers/rendering/renderer_rd/renderer_compositor_rd.cpp b/servers/rendering/renderer_rd/renderer_compositor_rd.cpp index b9bda9329e..a69877e680 100644 --- a/servers/rendering/renderer_rd/renderer_compositor_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_compositor_rd.cpp @@ -306,19 +306,20 @@ RendererCompositorRD::RendererCompositorRD() { fog = memnew(RendererRD::Fog); canvas = memnew(RendererCanvasRenderRD()); - String rendering_method = GLOBAL_GET("rendering/renderer/rendering_method"); + String rendering_method = OS::get_singleton()->get_current_rendering_method(); uint64_t textures_per_stage = RD::get_singleton()->limit_get(RD::LIMIT_MAX_TEXTURES_PER_SHADER_STAGE); if (rendering_method == "mobile" || textures_per_stage < 48) { - scene = memnew(RendererSceneRenderImplementation::RenderForwardMobile()); if (rendering_method == "forward_plus") { WARN_PRINT_ONCE("Platform supports less than 48 textures per stage which is less than required by the Clustered renderer. Defaulting to Mobile renderer."); } + scene = memnew(RendererSceneRenderImplementation::RenderForwardMobile()); } else if (rendering_method == "forward_plus") { - // default to our high end renderer scene = memnew(RendererSceneRenderImplementation::RenderForwardClustered()); } else { - ERR_FAIL_MSG("Cannot instantiate RenderingDevice-based renderer with renderer type " + rendering_method); + // Fall back to our high end renderer. + ERR_PRINT(vformat("Cannot instantiate RenderingDevice-based renderer with renderer type '%s'. Defaulting to Forward+ renderer.", rendering_method)); + scene = memnew(RendererSceneRenderImplementation::RenderForwardClustered()); } scene->init(); diff --git a/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp b/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp index 1a33f1d6e0..d4ed640247 100644 --- a/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp @@ -586,6 +586,7 @@ void RendererSceneRenderRD::_render_buffers_post_process_and_tonemap(const Rende if (dest_is_msaa_2d) { dest_fb = FramebufferCacheRD::get_singleton()->get_cache(texture_storage->render_target_get_rd_texture_msaa(render_target)); + texture_storage->render_target_set_msaa_needs_resolve(render_target, true); // Make sure this gets resolved. } else { dest_fb = texture_storage->render_target_get_rd_framebuffer(render_target); } @@ -611,6 +612,8 @@ void RendererSceneRenderRD::_render_buffers_post_process_and_tonemap(const Rende RID source_texture = texture_storage->render_target_get_rd_texture(render_target); RID dest_fb = FramebufferCacheRD::get_singleton()->get_cache(texture_storage->render_target_get_rd_texture_msaa(render_target)); copy_effects->copy_to_fb_rect(source_texture, dest_fb, Rect2i(Point2i(), rb->get_target_size())); + + texture_storage->render_target_set_msaa_needs_resolve(render_target, true); // Make sure this gets resolved. } RD::get_singleton()->draw_command_end_label(); diff --git a/servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl b/servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl index 206c2fb245..e17fa0ce90 100644 --- a/servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl +++ b/servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl @@ -816,10 +816,10 @@ vec4 fog_process(vec3 vertex) { #ifdef USE_RADIANCE_CUBEMAP_ARRAY float lod, blend; blend = modf(mip_level * MAX_ROUGHNESS_LOD, lod); - sky_fog_color = texture(samplerCubeArray(radiance_cubemap, SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), vec4(cube_view, lod)).rgb; - sky_fog_color = mix(sky_fog_color, texture(samplerCubeArray(radiance_cubemap, SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), vec4(cube_view, lod + 1)).rgb, blend); + sky_fog_color = texture(samplerCubeArray(radiance_cubemap, DEFAULT_SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), vec4(cube_view, lod)).rgb; + sky_fog_color = mix(sky_fog_color, texture(samplerCubeArray(radiance_cubemap, DEFAULT_SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), vec4(cube_view, lod + 1)).rgb, blend); #else - sky_fog_color = textureLod(samplerCube(radiance_cubemap, SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), cube_view, mip_level * MAX_ROUGHNESS_LOD).rgb; + sky_fog_color = textureLod(samplerCube(radiance_cubemap, DEFAULT_SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), cube_view, mip_level * MAX_ROUGHNESS_LOD).rgb; #endif //USE_RADIANCE_CUBEMAP_ARRAY fog_color = mix(fog_color, sky_fog_color, scene_data_block.data.fog_aerial_perspective); } @@ -1271,11 +1271,11 @@ void fragment_shader(in SceneData scene_data) { float lod, blend; blend = modf(sqrt(roughness) * MAX_ROUGHNESS_LOD, lod); - specular_light = texture(samplerCubeArray(radiance_cubemap, SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), vec4(ref_vec, lod)).rgb; - specular_light = mix(specular_light, texture(samplerCubeArray(radiance_cubemap, SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), vec4(ref_vec, lod + 1)).rgb, blend); + specular_light = texture(samplerCubeArray(radiance_cubemap, DEFAULT_SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), vec4(ref_vec, lod)).rgb; + specular_light = mix(specular_light, texture(samplerCubeArray(radiance_cubemap, DEFAULT_SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), vec4(ref_vec, lod + 1)).rgb, blend); #else - specular_light = textureLod(samplerCube(radiance_cubemap, SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), ref_vec, sqrt(roughness) * MAX_ROUGHNESS_LOD).rgb; + specular_light = textureLod(samplerCube(radiance_cubemap, DEFAULT_SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), ref_vec, sqrt(roughness) * MAX_ROUGHNESS_LOD).rgb; #endif //USE_RADIANCE_CUBEMAP_ARRAY specular_light *= scene_data.IBL_exposure_normalization; @@ -1295,9 +1295,9 @@ void fragment_shader(in SceneData scene_data) { if (scene_data.use_ambient_cubemap) { vec3 ambient_dir = scene_data.radiance_inverse_xform * normal; #ifdef USE_RADIANCE_CUBEMAP_ARRAY - vec3 cubemap_ambient = texture(samplerCubeArray(radiance_cubemap, SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), vec4(ambient_dir, MAX_ROUGHNESS_LOD)).rgb; + vec3 cubemap_ambient = texture(samplerCubeArray(radiance_cubemap, DEFAULT_SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), vec4(ambient_dir, MAX_ROUGHNESS_LOD)).rgb; #else - vec3 cubemap_ambient = textureLod(samplerCube(radiance_cubemap, SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), ambient_dir, MAX_ROUGHNESS_LOD).rgb; + vec3 cubemap_ambient = textureLod(samplerCube(radiance_cubemap, DEFAULT_SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), ambient_dir, MAX_ROUGHNESS_LOD).rgb; #endif //USE_RADIANCE_CUBEMAP_ARRAY cubemap_ambient *= scene_data.IBL_exposure_normalization; ambient_light = mix(ambient_light, cubemap_ambient * scene_data.ambient_light_color_energy.a, scene_data.ambient_color_sky_mix); @@ -1328,11 +1328,11 @@ void fragment_shader(in SceneData scene_data) { float lod, blend; blend = modf(roughness_lod, lod); - vec3 clearcoat_light = texture(samplerCubeArray(radiance_cubemap, SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), vec4(ref_vec, lod)).rgb; - clearcoat_light = mix(clearcoat_light, texture(samplerCubeArray(radiance_cubemap, SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), vec4(ref_vec, lod + 1)).rgb, blend); + vec3 clearcoat_light = texture(samplerCubeArray(radiance_cubemap, DEFAULT_SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), vec4(ref_vec, lod)).rgb; + clearcoat_light = mix(clearcoat_light, texture(samplerCubeArray(radiance_cubemap, DEFAULT_SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), vec4(ref_vec, lod + 1)).rgb, blend); #else - vec3 clearcoat_light = textureLod(samplerCube(radiance_cubemap, SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), ref_vec, roughness_lod).rgb; + vec3 clearcoat_light = textureLod(samplerCube(radiance_cubemap, DEFAULT_SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), ref_vec, roughness_lod).rgb; #endif //USE_RADIANCE_CUBEMAP_ARRAY specular_light += clearcoat_light * horizon * horizon * Fc * scene_data.ambient_light_color_energy.a; @@ -1860,7 +1860,7 @@ void fragment_shader(in SceneData scene_data) { pssm_coord /= pssm_coord.w; - shadow = sample_directional_pcf_shadow(directional_shadow_atlas, scene_data.directional_shadow_pixel_size * directional_lights.data[i].soft_shadow_scale * blur_factor, pssm_coord); + shadow = sample_directional_pcf_shadow(directional_shadow_atlas, scene_data.directional_shadow_pixel_size * directional_lights.data[i].soft_shadow_scale * (blur_factor + (1.0 - blur_factor) * float(directional_lights.data[i].blend_splits)), pssm_coord); if (directional_lights.data[i].blend_splits) { float pssm_blend; @@ -1870,21 +1870,21 @@ void fragment_shader(in SceneData scene_data) { vec4 v = vec4(vertex, 1.0); BIAS_FUNC(v, 1) pssm_coord = (directional_lights.data[i].shadow_matrix2 * v); - pssm_blend = smoothstep(0.0, directional_lights.data[i].shadow_split_offsets.x, depth_z); + pssm_blend = smoothstep(directional_lights.data[i].shadow_split_offsets.x - directional_lights.data[i].shadow_split_offsets.x * 0.1, directional_lights.data[i].shadow_split_offsets.x, depth_z); // Adjust shadow blur with reference to the first split to reduce discrepancy between shadow splits. blur_factor2 = directional_lights.data[i].shadow_split_offsets.x / directional_lights.data[i].shadow_split_offsets.y; } else if (depth_z < directional_lights.data[i].shadow_split_offsets.y) { vec4 v = vec4(vertex, 1.0); BIAS_FUNC(v, 2) pssm_coord = (directional_lights.data[i].shadow_matrix3 * v); - pssm_blend = smoothstep(directional_lights.data[i].shadow_split_offsets.x, directional_lights.data[i].shadow_split_offsets.y, depth_z); + pssm_blend = smoothstep(directional_lights.data[i].shadow_split_offsets.y - directional_lights.data[i].shadow_split_offsets.y * 0.1, directional_lights.data[i].shadow_split_offsets.y, depth_z); // Adjust shadow blur with reference to the first split to reduce discrepancy between shadow splits. blur_factor2 = directional_lights.data[i].shadow_split_offsets.x / directional_lights.data[i].shadow_split_offsets.z; } else if (depth_z < directional_lights.data[i].shadow_split_offsets.z) { vec4 v = vec4(vertex, 1.0); BIAS_FUNC(v, 3) pssm_coord = (directional_lights.data[i].shadow_matrix4 * v); - pssm_blend = smoothstep(directional_lights.data[i].shadow_split_offsets.y, directional_lights.data[i].shadow_split_offsets.z, depth_z); + pssm_blend = smoothstep(directional_lights.data[i].shadow_split_offsets.z - directional_lights.data[i].shadow_split_offsets.z * 0.1, directional_lights.data[i].shadow_split_offsets.z, depth_z); // Adjust shadow blur with reference to the first split to reduce discrepancy between shadow splits. blur_factor2 = directional_lights.data[i].shadow_split_offsets.x / directional_lights.data[i].shadow_split_offsets.w; } else { @@ -1894,7 +1894,7 @@ void fragment_shader(in SceneData scene_data) { pssm_coord /= pssm_coord.w; - float shadow2 = sample_directional_pcf_shadow(directional_shadow_atlas, scene_data.directional_shadow_pixel_size * directional_lights.data[i].soft_shadow_scale * blur_factor2, pssm_coord); + float shadow2 = sample_directional_pcf_shadow(directional_shadow_atlas, scene_data.directional_shadow_pixel_size * directional_lights.data[i].soft_shadow_scale * (blur_factor2 + (1.0 - blur_factor2) * float(directional_lights.data[i].blend_splits)), pssm_coord); shadow = mix(shadow, shadow2, pssm_blend); } } diff --git a/servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered_inc.glsl b/servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered_inc.glsl index bfd87b4ea1..5cde975f94 100644 --- a/servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered_inc.glsl +++ b/servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered_inc.glsl @@ -46,14 +46,8 @@ draw_call; #include "../light_data_inc.glsl" -#include "../samplers_inc.glsl" - layout(set = 0, binding = 2) uniform sampler shadow_sampler; -layout(set = 0, binding = 3) uniform sampler decal_sampler; - -layout(set = 0, binding = 4) uniform sampler light_projector_sampler; - #define INSTANCE_FLAGS_NON_UNIFORM_SCALE (1 << 4) #define INSTANCE_FLAGS_USE_GI_BUFFERS (1 << 5) #define INSTANCE_FLAGS_USE_SDFGI (1 << 6) @@ -74,22 +68,22 @@ layout(set = 0, binding = 4) uniform sampler light_projector_sampler; #define SCREEN_SPACE_EFFECTS_FLAGS_USE_SSAO 1 #define SCREEN_SPACE_EFFECTS_FLAGS_USE_SSIL 2 -layout(set = 0, binding = 5, std430) restrict readonly buffer OmniLights { +layout(set = 0, binding = 3, std430) restrict readonly buffer OmniLights { LightData data[]; } omni_lights; -layout(set = 0, binding = 6, std430) restrict readonly buffer SpotLights { +layout(set = 0, binding = 4, std430) restrict readonly buffer SpotLights { LightData data[]; } spot_lights; -layout(set = 0, binding = 7, std430) restrict readonly buffer ReflectionProbeData { +layout(set = 0, binding = 5, std430) restrict readonly buffer ReflectionProbeData { ReflectionData data[]; } reflections; -layout(set = 0, binding = 8, std140) uniform DirectionalLights { +layout(set = 0, binding = 6, std140) uniform DirectionalLights { DirectionalLightData data[MAX_DIRECTIONAL_LIGHT_DATA_STRUCTS]; } directional_lights; @@ -103,7 +97,7 @@ struct Lightmap { float exposure_normalization; }; -layout(set = 0, binding = 9, std140) restrict readonly buffer Lightmaps { +layout(set = 0, binding = 7, std140) restrict readonly buffer Lightmaps { Lightmap data[]; } lightmaps; @@ -112,20 +106,20 @@ struct LightmapCapture { vec4 sh[9]; }; -layout(set = 0, binding = 10, std140) restrict readonly buffer LightmapCaptures { +layout(set = 0, binding = 8, std140) restrict readonly buffer LightmapCaptures { LightmapCapture data[]; } lightmap_captures; -layout(set = 0, binding = 11) uniform texture2D decal_atlas; -layout(set = 0, binding = 12) uniform texture2D decal_atlas_srgb; +layout(set = 0, binding = 9) uniform texture2D decal_atlas; +layout(set = 0, binding = 10) uniform texture2D decal_atlas_srgb; -layout(set = 0, binding = 13, std430) restrict readonly buffer Decals { +layout(set = 0, binding = 11, std430) restrict readonly buffer Decals { DecalData data[]; } decals; -layout(set = 0, binding = 14, std430) restrict readonly buffer GlobalShaderUniformData { +layout(set = 0, binding = 12, std430) restrict readonly buffer GlobalShaderUniformData { vec4 data[]; } global_shader_uniforms; @@ -139,7 +133,7 @@ struct SDFVoxelGICascadeData { float exposure_normalization; }; -layout(set = 0, binding = 15, std140) uniform SDFGI { +layout(set = 0, binding = 13, std140) uniform SDFGI { vec3 grid_size; uint max_cascades; @@ -167,6 +161,8 @@ layout(set = 0, binding = 15, std140) uniform SDFGI { } sdfgi; +layout(set = 0, binding = 14) uniform sampler DEFAULT_SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP; + /* Set 1: Render Pass (changes per render pass) */ layout(set = 1, binding = 0, std140) uniform SceneDataBlock { @@ -250,12 +246,29 @@ layout(set = 1, binding = 9, std430) buffer restrict readonly ClusterBuffer { } cluster_buffer; +layout(set = 1, binding = 10) uniform sampler decal_sampler; + +layout(set = 1, binding = 11) uniform sampler light_projector_sampler; + +layout(set = 1, binding = 12 + 0) uniform sampler SAMPLER_NEAREST_CLAMP; +layout(set = 1, binding = 12 + 1) uniform sampler SAMPLER_LINEAR_CLAMP; +layout(set = 1, binding = 12 + 2) uniform sampler SAMPLER_NEAREST_WITH_MIPMAPS_CLAMP; +layout(set = 1, binding = 12 + 3) uniform sampler SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP; +layout(set = 1, binding = 12 + 4) uniform sampler SAMPLER_NEAREST_WITH_MIPMAPS_ANISOTROPIC_CLAMP; +layout(set = 1, binding = 12 + 5) uniform sampler SAMPLER_LINEAR_WITH_MIPMAPS_ANISOTROPIC_CLAMP; +layout(set = 1, binding = 12 + 6) uniform sampler SAMPLER_NEAREST_REPEAT; +layout(set = 1, binding = 12 + 7) uniform sampler SAMPLER_LINEAR_REPEAT; +layout(set = 1, binding = 12 + 8) uniform sampler SAMPLER_NEAREST_WITH_MIPMAPS_REPEAT; +layout(set = 1, binding = 12 + 9) uniform sampler SAMPLER_LINEAR_WITH_MIPMAPS_REPEAT; +layout(set = 1, binding = 12 + 10) uniform sampler SAMPLER_NEAREST_WITH_MIPMAPS_ANISOTROPIC_REPEAT; +layout(set = 1, binding = 12 + 11) uniform sampler SAMPLER_LINEAR_WITH_MIPMAPS_ANISOTROPIC_REPEAT; + #ifdef MODE_RENDER_SDF -layout(r16ui, set = 1, binding = 10) uniform restrict writeonly uimage3D albedo_volume_grid; -layout(r32ui, set = 1, binding = 11) uniform restrict writeonly uimage3D emission_grid; -layout(r32ui, set = 1, binding = 12) uniform restrict writeonly uimage3D emission_aniso_grid; -layout(r32ui, set = 1, binding = 13) uniform restrict uimage3D geom_facing_grid; +layout(r16ui, set = 1, binding = 24) uniform restrict writeonly uimage3D albedo_volume_grid; +layout(r32ui, set = 1, binding = 25) uniform restrict writeonly uimage3D emission_grid; +layout(r32ui, set = 1, binding = 26) uniform restrict writeonly uimage3D emission_aniso_grid; +layout(r32ui, set = 1, binding = 27) uniform restrict uimage3D geom_facing_grid; //still need to be present for shaders that use it, so remap them to something #define depth_buffer shadow_atlas @@ -266,24 +279,24 @@ layout(r32ui, set = 1, binding = 13) uniform restrict uimage3D geom_facing_grid; #else #ifdef USE_MULTIVIEW -layout(set = 1, binding = 10) uniform texture2DArray depth_buffer; -layout(set = 1, binding = 11) uniform texture2DArray color_buffer; -layout(set = 1, binding = 12) uniform texture2DArray normal_roughness_buffer; -layout(set = 1, binding = 13) uniform texture2DArray ao_buffer; -layout(set = 1, binding = 14) uniform texture2DArray ambient_buffer; -layout(set = 1, binding = 15) uniform texture2DArray reflection_buffer; +layout(set = 1, binding = 24) uniform texture2DArray depth_buffer; +layout(set = 1, binding = 25) uniform texture2DArray color_buffer; +layout(set = 1, binding = 26) uniform texture2DArray normal_roughness_buffer; +layout(set = 1, binding = 27) uniform texture2DArray ao_buffer; +layout(set = 1, binding = 28) uniform texture2DArray ambient_buffer; +layout(set = 1, binding = 29) uniform texture2DArray reflection_buffer; #define multiviewSampler sampler2DArray #else // USE_MULTIVIEW -layout(set = 1, binding = 10) uniform texture2D depth_buffer; -layout(set = 1, binding = 11) uniform texture2D color_buffer; -layout(set = 1, binding = 12) uniform texture2D normal_roughness_buffer; -layout(set = 1, binding = 13) uniform texture2D ao_buffer; -layout(set = 1, binding = 14) uniform texture2D ambient_buffer; -layout(set = 1, binding = 15) uniform texture2D reflection_buffer; +layout(set = 1, binding = 24) uniform texture2D depth_buffer; +layout(set = 1, binding = 25) uniform texture2D color_buffer; +layout(set = 1, binding = 26) uniform texture2D normal_roughness_buffer; +layout(set = 1, binding = 27) uniform texture2D ao_buffer; +layout(set = 1, binding = 28) uniform texture2D ambient_buffer; +layout(set = 1, binding = 29) uniform texture2D reflection_buffer; #define multiviewSampler sampler2D #endif -layout(set = 1, binding = 16) uniform texture2DArray sdfgi_lightprobe_texture; -layout(set = 1, binding = 17) uniform texture3D sdfgi_occlusion_cascades; +layout(set = 1, binding = 30) uniform texture2DArray sdfgi_lightprobe_texture; +layout(set = 1, binding = 31) uniform texture3D sdfgi_occlusion_cascades; struct VoxelGIData { mat4 xform; // 64 - 64 @@ -300,17 +313,17 @@ struct VoxelGIData { float exposure_normalization; // 4 - 112 }; -layout(set = 1, binding = 18, std140) uniform VoxelGIs { +layout(set = 1, binding = 32, std140) uniform VoxelGIs { VoxelGIData data[MAX_VOXEL_GI_INSTANCES]; } voxel_gi_instances; -layout(set = 1, binding = 19) uniform texture3D volumetric_fog_texture; +layout(set = 1, binding = 33) uniform texture3D volumetric_fog_texture; #ifdef USE_MULTIVIEW -layout(set = 1, binding = 20) uniform texture2DArray ssil_buffer; +layout(set = 1, binding = 34) uniform texture2DArray ssil_buffer; #else -layout(set = 1, binding = 20) uniform texture2D ssil_buffer; +layout(set = 1, binding = 34) uniform texture2D ssil_buffer; #endif // USE_MULTIVIEW #endif diff --git a/servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl b/servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl index 5ed3669703..03737e087c 100644 --- a/servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl +++ b/servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl @@ -658,10 +658,10 @@ vec4 fog_process(vec3 vertex) { #ifdef USE_RADIANCE_CUBEMAP_ARRAY float lod, blend; blend = modf(mip_level * MAX_ROUGHNESS_LOD, lod); - sky_fog_color = texture(samplerCubeArray(radiance_cubemap, SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), vec4(cube_view, lod)).rgb; - sky_fog_color = mix(sky_fog_color, texture(samplerCubeArray(radiance_cubemap, SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), vec4(cube_view, lod + 1)).rgb, blend); + sky_fog_color = texture(samplerCubeArray(radiance_cubemap, DEFAULT_SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), vec4(cube_view, lod)).rgb; + sky_fog_color = mix(sky_fog_color, texture(samplerCubeArray(radiance_cubemap, DEFAULT_SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), vec4(cube_view, lod + 1)).rgb, blend); #else - sky_fog_color = textureLod(samplerCube(radiance_cubemap, SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), cube_view, mip_level * MAX_ROUGHNESS_LOD).rgb; + sky_fog_color = textureLod(samplerCube(radiance_cubemap, DEFAULT_SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), cube_view, mip_level * MAX_ROUGHNESS_LOD).rgb; #endif //USE_RADIANCE_CUBEMAP_ARRAY fog_color = mix(fog_color, sky_fog_color, scene_data_block.data.fog_aerial_perspective); } @@ -1051,11 +1051,11 @@ void main() { float lod, blend; blend = modf(sqrt(roughness) * MAX_ROUGHNESS_LOD, lod); - specular_light = texture(samplerCubeArray(radiance_cubemap, SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), vec4(ref_vec, lod)).rgb; - specular_light = mix(specular_light, texture(samplerCubeArray(radiance_cubemap, SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), vec4(ref_vec, lod + 1)).rgb, blend); + specular_light = texture(samplerCubeArray(radiance_cubemap, DEFAULT_SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), vec4(ref_vec, lod)).rgb; + specular_light = mix(specular_light, texture(samplerCubeArray(radiance_cubemap, DEFAULT_SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), vec4(ref_vec, lod + 1)).rgb, blend); #else // USE_RADIANCE_CUBEMAP_ARRAY - specular_light = textureLod(samplerCube(radiance_cubemap, SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), ref_vec, sqrt(roughness) * MAX_ROUGHNESS_LOD).rgb; + specular_light = textureLod(samplerCube(radiance_cubemap, DEFAULT_SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), ref_vec, sqrt(roughness) * MAX_ROUGHNESS_LOD).rgb; #endif //USE_RADIANCE_CUBEMAP_ARRAY specular_light *= sc_luminance_multiplier; @@ -1076,9 +1076,9 @@ void main() { if (scene_data.use_ambient_cubemap) { vec3 ambient_dir = scene_data.radiance_inverse_xform * normal; #ifdef USE_RADIANCE_CUBEMAP_ARRAY - vec3 cubemap_ambient = texture(samplerCubeArray(radiance_cubemap, SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), vec4(ambient_dir, MAX_ROUGHNESS_LOD)).rgb; + vec3 cubemap_ambient = texture(samplerCubeArray(radiance_cubemap, DEFAULT_SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), vec4(ambient_dir, MAX_ROUGHNESS_LOD)).rgb; #else - vec3 cubemap_ambient = textureLod(samplerCube(radiance_cubemap, SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), ambient_dir, MAX_ROUGHNESS_LOD).rgb; + vec3 cubemap_ambient = textureLod(samplerCube(radiance_cubemap, DEFAULT_SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), ambient_dir, MAX_ROUGHNESS_LOD).rgb; #endif //USE_RADIANCE_CUBEMAP_ARRAY cubemap_ambient *= sc_luminance_multiplier; cubemap_ambient *= scene_data.IBL_exposure_normalization; @@ -1110,11 +1110,11 @@ void main() { float lod, blend; blend = modf(roughness_lod, lod); - vec3 clearcoat_light = texture(samplerCubeArray(radiance_cubemap, SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), vec4(ref_vec, lod)).rgb; - clearcoat_light = mix(clearcoat_light, texture(samplerCubeArray(radiance_cubemap, SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), vec4(ref_vec, lod + 1)).rgb, blend); + vec3 clearcoat_light = texture(samplerCubeArray(radiance_cubemap, DEFAULT_SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), vec4(ref_vec, lod)).rgb; + clearcoat_light = mix(clearcoat_light, texture(samplerCubeArray(radiance_cubemap, DEFAULT_SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), vec4(ref_vec, lod + 1)).rgb, blend); #else - vec3 clearcoat_light = textureLod(samplerCube(radiance_cubemap, SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), ref_vec, roughness_lod).rgb; + vec3 clearcoat_light = textureLod(samplerCube(radiance_cubemap, DEFAULT_SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), ref_vec, roughness_lod).rgb; #endif //USE_RADIANCE_CUBEMAP_ARRAY specular_light += clearcoat_light * horizon * horizon * Fc * scene_data.ambient_light_color_energy.a; @@ -1506,7 +1506,7 @@ void main() { pssm_coord /= pssm_coord.w; - shadow = sample_directional_pcf_shadow(directional_shadow_atlas, scene_data.directional_shadow_pixel_size * directional_lights.data[i].soft_shadow_scale * blur_factor, pssm_coord); + shadow = sample_directional_pcf_shadow(directional_shadow_atlas, scene_data.directional_shadow_pixel_size * directional_lights.data[i].soft_shadow_scale * (blur_factor + (1.0 - blur_factor) * float(directional_lights.data[i].blend_splits)), pssm_coord); if (directional_lights.data[i].blend_splits) { float pssm_blend; @@ -1516,21 +1516,21 @@ void main() { vec4 v = vec4(vertex, 1.0); BIAS_FUNC(v, 1) pssm_coord = (directional_lights.data[i].shadow_matrix2 * v); - pssm_blend = smoothstep(0.0, directional_lights.data[i].shadow_split_offsets.x, depth_z); + pssm_blend = smoothstep(directional_lights.data[i].shadow_split_offsets.x - directional_lights.data[i].shadow_split_offsets.x * 0.1, directional_lights.data[i].shadow_split_offsets.x, depth_z); // Adjust shadow blur with reference to the first split to reduce discrepancy between shadow splits. blur_factor2 = directional_lights.data[i].shadow_split_offsets.x / directional_lights.data[i].shadow_split_offsets.y; } else if (depth_z < directional_lights.data[i].shadow_split_offsets.y) { vec4 v = vec4(vertex, 1.0); BIAS_FUNC(v, 2) pssm_coord = (directional_lights.data[i].shadow_matrix3 * v); - pssm_blend = smoothstep(directional_lights.data[i].shadow_split_offsets.x, directional_lights.data[i].shadow_split_offsets.y, depth_z); + pssm_blend = smoothstep(directional_lights.data[i].shadow_split_offsets.y - directional_lights.data[i].shadow_split_offsets.y * 0.1, directional_lights.data[i].shadow_split_offsets.y, depth_z); // Adjust shadow blur with reference to the first split to reduce discrepancy between shadow splits. blur_factor2 = directional_lights.data[i].shadow_split_offsets.x / directional_lights.data[i].shadow_split_offsets.z; } else if (depth_z < directional_lights.data[i].shadow_split_offsets.z) { vec4 v = vec4(vertex, 1.0); BIAS_FUNC(v, 3) pssm_coord = (directional_lights.data[i].shadow_matrix4 * v); - pssm_blend = smoothstep(directional_lights.data[i].shadow_split_offsets.y, directional_lights.data[i].shadow_split_offsets.z, depth_z); + pssm_blend = smoothstep(directional_lights.data[i].shadow_split_offsets.z - directional_lights.data[i].shadow_split_offsets.z * 0.1, directional_lights.data[i].shadow_split_offsets.z, depth_z); // Adjust shadow blur with reference to the first split to reduce discrepancy between shadow splits. blur_factor2 = directional_lights.data[i].shadow_split_offsets.x / directional_lights.data[i].shadow_split_offsets.w; } else { @@ -1540,7 +1540,7 @@ void main() { pssm_coord /= pssm_coord.w; - float shadow2 = sample_directional_pcf_shadow(directional_shadow_atlas, scene_data.directional_shadow_pixel_size * directional_lights.data[i].soft_shadow_scale * blur_factor2, pssm_coord); + float shadow2 = sample_directional_pcf_shadow(directional_shadow_atlas, scene_data.directional_shadow_pixel_size * directional_lights.data[i].soft_shadow_scale * (blur_factor2 + (1.0 - blur_factor2) * float(directional_lights.data[i].blend_splits)), pssm_coord); shadow = mix(shadow, shadow2, pssm_blend); } diff --git a/servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile_inc.glsl b/servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile_inc.glsl index 3de5e76970..cc3e5f6a14 100644 --- a/servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile_inc.glsl +++ b/servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile_inc.glsl @@ -27,13 +27,8 @@ draw_call; #include "../light_data_inc.glsl" -#include "../samplers_inc.glsl" - layout(set = 0, binding = 2) uniform sampler shadow_sampler; -layout(set = 0, binding = 3) uniform sampler decal_sampler; -layout(set = 0, binding = 4) uniform sampler light_projector_sampler; - #define INSTANCE_FLAGS_NON_UNIFORM_SCALE (1 << 4) #define INSTANCE_FLAGS_USE_GI_BUFFERS (1 << 5) #define INSTANCE_FLAGS_USE_SDFGI (1 << 6) @@ -50,22 +45,22 @@ layout(set = 0, binding = 4) uniform sampler light_projector_sampler; //3 bits of stride #define INSTANCE_FLAGS_PARTICLE_TRAIL_MASK 0xFF -layout(set = 0, binding = 5, std430) restrict readonly buffer OmniLights { +layout(set = 0, binding = 3, std430) restrict readonly buffer OmniLights { LightData data[]; } omni_lights; -layout(set = 0, binding = 6, std430) restrict readonly buffer SpotLights { +layout(set = 0, binding = 4, std430) restrict readonly buffer SpotLights { LightData data[]; } spot_lights; -layout(set = 0, binding = 7, std430) restrict readonly buffer ReflectionProbeData { +layout(set = 0, binding = 5, std430) restrict readonly buffer ReflectionProbeData { ReflectionData data[]; } reflections; -layout(set = 0, binding = 8, std140) uniform DirectionalLights { +layout(set = 0, binding = 6, std140) uniform DirectionalLights { DirectionalLightData data[MAX_DIRECTIONAL_LIGHT_DATA_STRUCTS]; } directional_lights; @@ -79,7 +74,7 @@ struct Lightmap { float exposure_normalization; }; -layout(set = 0, binding = 9, std140) restrict readonly buffer Lightmaps { +layout(set = 0, binding = 7, std140) restrict readonly buffer Lightmaps { Lightmap data[]; } lightmaps; @@ -88,24 +83,26 @@ struct LightmapCapture { mediump vec4 sh[9]; }; -layout(set = 0, binding = 10, std140) restrict readonly buffer LightmapCaptures { +layout(set = 0, binding = 8, std140) restrict readonly buffer LightmapCaptures { LightmapCapture data[]; } lightmap_captures; -layout(set = 0, binding = 11) uniform mediump texture2D decal_atlas; -layout(set = 0, binding = 12) uniform mediump texture2D decal_atlas_srgb; +layout(set = 0, binding = 9) uniform mediump texture2D decal_atlas; +layout(set = 0, binding = 10) uniform mediump texture2D decal_atlas_srgb; -layout(set = 0, binding = 13, std430) restrict readonly buffer Decals { +layout(set = 0, binding = 11, std430) restrict readonly buffer Decals { DecalData data[]; } decals; -layout(set = 0, binding = 14, std430) restrict readonly buffer GlobalShaderUniformData { +layout(set = 0, binding = 12, std430) restrict readonly buffer GlobalShaderUniformData { highp vec4 data[]; } global_shader_uniforms; +layout(set = 0, binding = 13) uniform sampler DEFAULT_SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP; + /* Set 1: Render Pass (changes per render pass) */ layout(set = 1, binding = 0, std140) uniform SceneDataBlock { @@ -166,6 +163,23 @@ layout(set = 1, binding = 10) uniform mediump texture2D color_buffer; #define multiviewSampler sampler2D #endif // USE_MULTIVIEW +layout(set = 1, binding = 11) uniform sampler decal_sampler; + +layout(set = 1, binding = 12) uniform sampler light_projector_sampler; + +layout(set = 1, binding = 13 + 0) uniform sampler SAMPLER_NEAREST_CLAMP; +layout(set = 1, binding = 13 + 1) uniform sampler SAMPLER_LINEAR_CLAMP; +layout(set = 1, binding = 13 + 2) uniform sampler SAMPLER_NEAREST_WITH_MIPMAPS_CLAMP; +layout(set = 1, binding = 13 + 3) uniform sampler SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP; +layout(set = 1, binding = 13 + 4) uniform sampler SAMPLER_NEAREST_WITH_MIPMAPS_ANISOTROPIC_CLAMP; +layout(set = 1, binding = 13 + 5) uniform sampler SAMPLER_LINEAR_WITH_MIPMAPS_ANISOTROPIC_CLAMP; +layout(set = 1, binding = 13 + 6) uniform sampler SAMPLER_NEAREST_REPEAT; +layout(set = 1, binding = 13 + 7) uniform sampler SAMPLER_LINEAR_REPEAT; +layout(set = 1, binding = 13 + 8) uniform sampler SAMPLER_NEAREST_WITH_MIPMAPS_REPEAT; +layout(set = 1, binding = 13 + 9) uniform sampler SAMPLER_LINEAR_WITH_MIPMAPS_REPEAT; +layout(set = 1, binding = 13 + 10) uniform sampler SAMPLER_NEAREST_WITH_MIPMAPS_ANISOTROPIC_REPEAT; +layout(set = 1, binding = 13 + 11) uniform sampler SAMPLER_LINEAR_WITH_MIPMAPS_ANISOTROPIC_REPEAT; + /* Set 2 Skeleton & Instancing (can change per item) */ layout(set = 2, binding = 0, std430) restrict readonly buffer Transforms { diff --git a/servers/rendering/renderer_rd/shaders/scene_forward_gi_inc.glsl b/servers/rendering/renderer_rd/shaders/scene_forward_gi_inc.glsl index 8f68030cba..1f618eb34e 100644 --- a/servers/rendering/renderer_rd/shaders/scene_forward_gi_inc.glsl +++ b/servers/rendering/renderer_rd/shaders/scene_forward_gi_inc.glsl @@ -13,7 +13,7 @@ vec4 voxel_cone_trace(texture3D probe, vec3 cell_size, vec3 pos, vec3 direction, if (any(greaterThan(abs(uvw_pos - 0.5), vec3(0.5f + half_diameter * cell_size)))) { break; } - vec4 scolor = textureLod(sampler3D(probe, SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), uvw_pos, log2(diameter)); + vec4 scolor = textureLod(sampler3D(probe, DEFAULT_SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), uvw_pos, log2(diameter)); float a = (1.0 - color.a); color += a * scolor; dist += half_diameter; @@ -35,7 +35,7 @@ vec4 voxel_cone_trace_45_degrees(texture3D probe, vec3 cell_size, vec3 pos, vec3 if (any(greaterThan(abs(uvw_pos - 0.5), vec3(0.5f + radius * cell_size)))) { break; } - vec4 scolor = textureLod(sampler3D(probe, SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), uvw_pos, lod_level); + vec4 scolor = textureLod(sampler3D(probe, DEFAULT_SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), uvw_pos, lod_level); lod_level += 1.0; float a = (1.0 - color.a); diff --git a/servers/rendering/renderer_rd/shaders/scene_forward_lights_inc.glsl b/servers/rendering/renderer_rd/shaders/scene_forward_lights_inc.glsl index 4fb577d697..e9722bad1f 100644 --- a/servers/rendering/renderer_rd/shaders/scene_forward_lights_inc.glsl +++ b/servers/rendering/renderer_rd/shaders/scene_forward_lights_inc.glsl @@ -932,7 +932,7 @@ void reflection_process(uint ref_index, vec3 vertex, vec3 ref_vec, vec3 normal, vec4 reflection; - reflection.rgb = textureLod(samplerCubeArray(reflection_atlas, SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), vec4(local_ref_vec, reflections.data[ref_index].index), roughness * MAX_ROUGHNESS_LOD).rgb * sc_luminance_multiplier; + reflection.rgb = textureLod(samplerCubeArray(reflection_atlas, DEFAULT_SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), vec4(local_ref_vec, reflections.data[ref_index].index), roughness * MAX_ROUGHNESS_LOD).rgb * sc_luminance_multiplier; reflection.rgb *= reflections.data[ref_index].exposure_normalization; if (reflections.data[ref_index].exterior) { reflection.rgb = mix(specular_light, reflection.rgb, blend); @@ -955,7 +955,7 @@ void reflection_process(uint ref_index, vec3 vertex, vec3 ref_vec, vec3 normal, vec4 ambient_out; - ambient_out.rgb = textureLod(samplerCubeArray(reflection_atlas, SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), vec4(local_amb_vec, reflections.data[ref_index].index), MAX_ROUGHNESS_LOD).rgb; + ambient_out.rgb = textureLod(samplerCubeArray(reflection_atlas, DEFAULT_SAMPLER_LINEAR_WITH_MIPMAPS_CLAMP), vec4(local_amb_vec, reflections.data[ref_index].index), MAX_ROUGHNESS_LOD).rgb; ambient_out.rgb *= reflections.data[ref_index].exposure_normalization; ambient_out.a = blend; if (reflections.data[ref_index].exterior) { diff --git a/servers/rendering/renderer_rd/storage_rd/light_storage.cpp b/servers/rendering/renderer_rd/storage_rd/light_storage.cpp index 1f6d1021f4..5f4bf6c8ed 100644 --- a/servers/rendering/renderer_rd/storage_rd/light_storage.cpp +++ b/servers/rendering/renderer_rd/storage_rd/light_storage.cpp @@ -1669,6 +1669,8 @@ void LightStorage::update_reflection_probe_buffer(RenderDataRD *p_render_data, c for (uint32_t i = 0; i < reflection_count; i++) { ReflectionProbeInstance *rpi = reflection_sort[i].probe_instance; + rpi->last_pass = RSG::rasterizer->get_frame_number(); + if (using_forward_ids) { forward_id_storage->map_forward_id(FORWARD_ID_TYPE_REFLECTION_PROBE, rpi->forward_id, i, rpi->last_pass); } @@ -1717,8 +1719,6 @@ void LightStorage::update_reflection_probe_buffer(RenderDataRD *p_render_data, c // hook for subclass to do further processing. RendererSceneRenderRD::get_singleton()->setup_added_reflection_probe(transform, extents); - - rpi->last_pass = RSG::rasterizer->get_frame_number(); } if (reflection_count) { diff --git a/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp b/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp index da55b68109..3bc1b476cb 100644 --- a/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp +++ b/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp @@ -430,6 +430,7 @@ void MeshStorage::mesh_add_surface(RID p_mesh, const RS::SurfaceData &p_surface) s->aabb = new_surface.aabb; s->bone_aabbs = new_surface.bone_aabbs; //only really useful for returning them. + s->mesh_to_skeleton_xform = p_surface.mesh_to_skeleton_xform; s->uv_scale = new_surface.uv_scale; @@ -617,6 +618,7 @@ RS::SurfaceData MeshStorage::mesh_get_surface(RID p_mesh, int p_surface) const { } sd.bone_aabbs = s.bone_aabbs; + sd.mesh_to_skeleton_xform = s.mesh_to_skeleton_xform; if (s.blend_shape_buffer.is_valid()) { sd.blend_shape_data = RD::get_singleton()->buffer_get_data(s.blend_shape_buffer); @@ -663,15 +665,16 @@ AABB MeshStorage::mesh_get_aabb(RID p_mesh, RID p_skeleton) { for (uint32_t i = 0; i < mesh->surface_count; i++) { AABB laabb; - if ((mesh->surfaces[i]->format & RS::ARRAY_FORMAT_BONES) && mesh->surfaces[i]->bone_aabbs.size()) { - int bs = mesh->surfaces[i]->bone_aabbs.size(); - const AABB *skbones = mesh->surfaces[i]->bone_aabbs.ptr(); + const Mesh::Surface &surface = *mesh->surfaces[i]; + if ((surface.format & RS::ARRAY_FORMAT_BONES) && surface.bone_aabbs.size()) { + int bs = surface.bone_aabbs.size(); + const AABB *skbones = surface.bone_aabbs.ptr(); int sbs = skeleton->size; ERR_CONTINUE(bs > sbs); const float *baseptr = skeleton->data.ptr(); - bool first = true; + bool found_bone_aabb = false; if (skeleton->use_2d) { for (int j = 0; j < bs; j++) { @@ -691,11 +694,13 @@ AABB MeshStorage::mesh_get_aabb(RID p_mesh, RID p_skeleton) { mtx.basis.rows[1][1] = dataptr[5]; mtx.origin.y = dataptr[7]; - AABB baabb = mtx.xform(skbones[j]); + // Transform bounds to skeleton's space before applying animation data. + AABB baabb = surface.mesh_to_skeleton_xform.xform(skbones[j]); + baabb = mtx.xform(baabb); - if (first) { + if (!found_bone_aabb) { laabb = baabb; - first = false; + found_bone_aabb = true; } else { laabb.merge_with(baabb); } @@ -723,21 +728,29 @@ AABB MeshStorage::mesh_get_aabb(RID p_mesh, RID p_skeleton) { mtx.basis.rows[2][2] = dataptr[10]; mtx.origin.z = dataptr[11]; - AABB baabb = mtx.xform(skbones[j]); - if (first) { + // Transform bounds to skeleton's space before applying animation data. + AABB baabb = surface.mesh_to_skeleton_xform.xform(skbones[j]); + baabb = mtx.xform(baabb); + + if (!found_bone_aabb) { laabb = baabb; - first = false; + found_bone_aabb = true; } else { laabb.merge_with(baabb); } } } + if (found_bone_aabb) { + // Transform skeleton bounds back to mesh's space if any animated AABB applied. + laabb = surface.mesh_to_skeleton_xform.affine_inverse().xform(laabb); + } + if (laabb.size == Vector3()) { - laabb = mesh->surfaces[i]->aabb; + laabb = surface.aabb; } } else { - laabb = mesh->surfaces[i]->aabb; + laabb = surface.aabb; } if (i == 0) { diff --git a/servers/rendering/renderer_rd/storage_rd/mesh_storage.h b/servers/rendering/renderer_rd/storage_rd/mesh_storage.h index db54816e09..0fc1a6f320 100644 --- a/servers/rendering/renderer_rd/storage_rd/mesh_storage.h +++ b/servers/rendering/renderer_rd/storage_rd/mesh_storage.h @@ -120,6 +120,10 @@ private: Vector<AABB> bone_aabbs; + // Transform used in runtime bone AABBs compute. + // As bone AABBs are saved in Mesh space, but bones animation is in Skeleton space. + Transform3D mesh_to_skeleton_xform; + Vector4 uv_scale; RID blend_shape_buffer; diff --git a/servers/rendering/renderer_rd/storage_rd/render_scene_buffers_rd.cpp b/servers/rendering/renderer_rd/storage_rd/render_scene_buffers_rd.cpp index 5ff5adc59a..6a99eb4108 100644 --- a/servers/rendering/renderer_rd/storage_rd/render_scene_buffers_rd.cpp +++ b/servers/rendering/renderer_rd/storage_rd/render_scene_buffers_rd.cpp @@ -148,9 +148,6 @@ void RenderSceneBuffersRD::configure(const RenderSceneBuffersConfiguration *p_co update_samplers(); - // Notify the renderer the base uniform needs to be recreated. - RendererSceneRenderRD::get_singleton()->base_uniforms_changed(); - // cleanout any old buffers we had. cleanup(); diff --git a/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp b/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp index 678564a0e4..307cbd703a 100644 --- a/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp +++ b/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp @@ -3364,6 +3364,31 @@ RS::ViewportMSAA TextureStorage::render_target_get_msaa(RID p_render_target) con return rt->msaa; } +void TextureStorage::render_target_set_msaa_needs_resolve(RID p_render_target, bool p_needs_resolve) { + RenderTarget *rt = render_target_owner.get_or_null(p_render_target); + ERR_FAIL_NULL(rt); + + rt->msaa_needs_resolve = p_needs_resolve; +} + +bool TextureStorage::render_target_get_msaa_needs_resolve(RID p_render_target) const { + RenderTarget *rt = render_target_owner.get_or_null(p_render_target); + ERR_FAIL_NULL_V(rt, false); + + return rt->msaa_needs_resolve; +} + +void TextureStorage::render_target_do_msaa_resolve(RID p_render_target) { + RenderTarget *rt = render_target_owner.get_or_null(p_render_target); + ERR_FAIL_NULL(rt); + if (!rt->msaa_needs_resolve) { + return; + } + RD::get_singleton()->draw_list_begin(rt->get_framebuffer(), RD::INITIAL_ACTION_KEEP, RD::FINAL_ACTION_READ, RD::INITIAL_ACTION_KEEP, RD::FINAL_ACTION_DISCARD); + RD::get_singleton()->draw_list_end(); + rt->msaa_needs_resolve = false; +} + void TextureStorage::render_target_set_use_hdr(RID p_render_target, bool p_use_hdr) { RenderTarget *rt = render_target_owner.get_or_null(p_render_target); ERR_FAIL_NULL(rt); @@ -3479,6 +3504,7 @@ void TextureStorage::render_target_do_clear_request(RID p_render_target) { RD::get_singleton()->draw_list_begin(rt->get_framebuffer(), RD::INITIAL_ACTION_CLEAR, RD::FINAL_ACTION_READ, RD::INITIAL_ACTION_KEEP, RD::FINAL_ACTION_DISCARD, clear_colors); RD::get_singleton()->draw_list_end(); rt->clear_requested = false; + rt->msaa_needs_resolve = false; } void TextureStorage::render_target_set_sdf_size_and_scale(RID p_render_target, RS::ViewportSDFOversize p_size, RS::ViewportSDFScale p_scale) { diff --git a/servers/rendering/renderer_rd/storage_rd/texture_storage.h b/servers/rendering/renderer_rd/storage_rd/texture_storage.h index 276c8c4ce2..c665b02e14 100644 --- a/servers/rendering/renderer_rd/storage_rd/texture_storage.h +++ b/servers/rendering/renderer_rd/storage_rd/texture_storage.h @@ -331,9 +331,10 @@ private: uint32_t view_count; RID color; Vector<RID> color_slices; - RID color_multisample; // Needed when MSAA is enabled. + RID color_multisample; // Needed when 2D MSAA is enabled. - RS::ViewportMSAA msaa = RS::VIEWPORT_MSAA_DISABLED; + RS::ViewportMSAA msaa = RS::VIEWPORT_MSAA_DISABLED; // 2D MSAA mode + bool msaa_needs_resolve = false; // 2D MSAA needs resolved //used for retrieving from CPU RD::DataFormat color_format = RD::DATA_FORMAT_R4G4_UNORM_PACK8; @@ -718,6 +719,9 @@ public: virtual void render_target_set_as_unused(RID p_render_target) override; virtual void render_target_set_msaa(RID p_render_target, RS::ViewportMSAA p_msaa) override; virtual RS::ViewportMSAA render_target_get_msaa(RID p_render_target) const override; + virtual void render_target_set_msaa_needs_resolve(RID p_render_target, bool p_needs_resolve) override; + virtual bool render_target_get_msaa_needs_resolve(RID p_render_target) const override; + virtual void render_target_do_msaa_resolve(RID p_render_target) override; virtual void render_target_set_use_hdr(RID p_render_target, bool p_use_hdr) override; virtual bool render_target_is_using_hdr(RID p_render_target) const override; diff --git a/servers/rendering/renderer_scene_render.cpp b/servers/rendering/renderer_scene_render.cpp index a389e3e767..cd89bb314b 100644 --- a/servers/rendering/renderer_scene_render.cpp +++ b/servers/rendering/renderer_scene_render.cpp @@ -47,6 +47,11 @@ void RendererSceneRender::CameraData::set_camera(const Transform3D p_transform, taa_jitter = p_taa_jitter; } +#ifdef MINGW_ENABLED +#undef near +#undef far +#endif + void RendererSceneRender::CameraData::set_multiview_camera(uint32_t p_view_count, const Transform3D *p_transforms, const Projection *p_projections, bool p_is_orthogonal, bool p_vaspect) { ERR_FAIL_COND_MSG(p_view_count != 2, "Incorrect view count for stereoscopic view"); diff --git a/servers/rendering/renderer_viewport.cpp b/servers/rendering/renderer_viewport.cpp index 6b47c29382..97e9694fe1 100644 --- a/servers/rendering/renderer_viewport.cpp +++ b/servers/rendering/renderer_viewport.cpp @@ -586,7 +586,7 @@ void RendererViewport::_draw_viewport(Viewport *p_viewport) { ptr = ptr->filter_next_ptr; } - RSG::canvas->render_canvas(p_viewport->render_target, canvas, xform, canvas_lights, canvas_directional_lights, clip_rect, p_viewport->texture_filter, p_viewport->texture_repeat, p_viewport->snap_2d_transforms_to_pixel, p_viewport->snap_2d_vertices_to_pixel, p_viewport->canvas_cull_mask); + RSG::canvas->render_canvas(p_viewport->render_target, canvas, xform, canvas_lights, canvas_directional_lights, clip_rect, p_viewport->texture_filter, p_viewport->texture_repeat, p_viewport->snap_2d_transforms_to_pixel, p_viewport->snap_2d_vertices_to_pixel, p_viewport->canvas_cull_mask, &p_viewport->render_info); if (RSG::canvas->was_sdf_used()) { p_viewport->sdf_active = true; } @@ -622,6 +622,11 @@ void RendererViewport::_draw_viewport(Viewport *p_viewport) { RSG::texture_storage->render_target_do_clear_request(p_viewport->render_target); } + if (RSG::texture_storage->render_target_get_msaa_needs_resolve(p_viewport->render_target)) { + WARN_PRINT_ONCE("2D MSAA is enabled while there is no 2D content. Disable 2D MSAA for better performance."); + RSG::texture_storage->render_target_do_msaa_resolve(p_viewport->render_target); + } + if (p_viewport->measure_render_time) { String rt_id = "vp_end_" + itos(p_viewport->self.get_id()); RSG::utilities->capture_timestamp(rt_id); @@ -801,9 +806,14 @@ void RendererViewport::draw_viewports(bool p_swap_buffers) { RENDER_TIMESTAMP("< Render Viewport " + itos(i)); + // 3D render info. objects_drawn += vp->render_info.info[RS::VIEWPORT_RENDER_INFO_TYPE_VISIBLE][RS::VIEWPORT_RENDER_INFO_OBJECTS_IN_FRAME] + vp->render_info.info[RS::VIEWPORT_RENDER_INFO_TYPE_SHADOW][RS::VIEWPORT_RENDER_INFO_OBJECTS_IN_FRAME]; vertices_drawn += vp->render_info.info[RS::VIEWPORT_RENDER_INFO_TYPE_VISIBLE][RS::VIEWPORT_RENDER_INFO_PRIMITIVES_IN_FRAME] + vp->render_info.info[RS::VIEWPORT_RENDER_INFO_TYPE_SHADOW][RS::VIEWPORT_RENDER_INFO_PRIMITIVES_IN_FRAME]; draw_calls_used += vp->render_info.info[RS::VIEWPORT_RENDER_INFO_TYPE_VISIBLE][RS::VIEWPORT_RENDER_INFO_DRAW_CALLS_IN_FRAME] + vp->render_info.info[RS::VIEWPORT_RENDER_INFO_TYPE_SHADOW][RS::VIEWPORT_RENDER_INFO_DRAW_CALLS_IN_FRAME]; + // 2D render info. + objects_drawn += vp->render_info.info[RS::VIEWPORT_RENDER_INFO_TYPE_CANVAS][RS::VIEWPORT_RENDER_INFO_OBJECTS_IN_FRAME]; + vertices_drawn += vp->render_info.info[RS::VIEWPORT_RENDER_INFO_TYPE_CANVAS][RS::VIEWPORT_RENDER_INFO_PRIMITIVES_IN_FRAME]; + draw_calls_used += vp->render_info.info[RS::VIEWPORT_RENDER_INFO_TYPE_CANVAS][RS::VIEWPORT_RENDER_INFO_DRAW_CALLS_IN_FRAME]; } RSG::scene->set_debug_draw_mode(RS::VIEWPORT_DEBUG_DRAW_DISABLED); @@ -881,9 +891,7 @@ void RendererViewport::viewport_set_fsr_sharpness(RID p_viewport, float p_sharpn ERR_FAIL_NULL(viewport); viewport->fsr_sharpness = p_sharpness; - if (viewport->render_buffers.is_valid()) { - viewport->render_buffers->set_fsr_sharpness(p_sharpness); - } + _configure_3d_render_buffers(viewport); } void RendererViewport::viewport_set_texture_mipmap_bias(RID p_viewport, float p_mipmap_bias) { @@ -891,9 +899,7 @@ void RendererViewport::viewport_set_texture_mipmap_bias(RID p_viewport, float p_ ERR_FAIL_NULL(viewport); viewport->texture_mipmap_bias = p_mipmap_bias; - if (viewport->render_buffers.is_valid()) { - viewport->render_buffers->set_texture_mipmap_bias(p_mipmap_bias); - } + _configure_3d_render_buffers(viewport); } void RendererViewport::viewport_set_scaling_3d_scale(RID p_viewport, float p_scaling_3d_scale) { @@ -1263,9 +1269,7 @@ void RendererViewport::viewport_set_use_debanding(RID p_viewport, bool p_use_deb return; } viewport->use_debanding = p_use_debanding; - if (viewport->render_buffers.is_valid()) { - viewport->render_buffers->set_use_debanding(p_use_debanding); - } + _configure_3d_render_buffers(viewport); } void RendererViewport::viewport_set_use_occlusion_culling(RID p_viewport, bool p_use_occlusion_culling) { @@ -1387,7 +1391,7 @@ void RendererViewport::viewport_set_sdf_oversize_and_scale(RID p_viewport, RS::V RID RendererViewport::viewport_find_from_screen_attachment(DisplayServer::WindowID p_id) const { RID *rids = nullptr; uint32_t rid_count = viewport_owner.get_rid_count(); - rids = (RID *)alloca(sizeof(RID *) * rid_count); + rids = (RID *)alloca(sizeof(RID) * rid_count); viewport_owner.fill_owned_buffer(rids); for (uint32_t i = 0; i < rid_count; i++) { Viewport *viewport = viewport_owner.get_or_null(rids[i]); diff --git a/servers/rendering/rendering_server_default.cpp b/servers/rendering/rendering_server_default.cpp index 65a6da8ac3..77fe91e4c9 100644 --- a/servers/rendering/rendering_server_default.cpp +++ b/servers/rendering/rendering_server_default.cpp @@ -379,6 +379,7 @@ void RenderingServerDefault::sync() { } void RenderingServerDefault::draw(bool p_swap_buffers, double frame_step) { + ERR_FAIL_COND_MSG(!Thread::is_main_thread(), "Manually triggering the draw function from the RenderingServer can only be done on the main thread. Call this function from the main thread or use call_deferred()."); if (create_thread) { command_queue.push(this, &RenderingServerDefault::_thread_draw, p_swap_buffers, frame_step); } else { diff --git a/servers/rendering/rendering_server_default.h b/servers/rendering/rendering_server_default.h index cd5904f175..dac1275957 100644 --- a/servers/rendering/rendering_server_default.h +++ b/servers/rendering/rendering_server_default.h @@ -940,6 +940,8 @@ public: FUNC1(canvas_set_shadow_texture_size, int) + FUNC1R(Rect2, _debug_canvas_item_get_rect, RID) + /* GLOBAL SHADER UNIFORMS */ #undef server_name diff --git a/servers/rendering/shader_types.cpp b/servers/rendering/shader_types.cpp index a6b4646f43..3e19e8f01a 100644 --- a/servers/rendering/shader_types.cpp +++ b/servers/rendering/shader_types.cpp @@ -361,7 +361,7 @@ ShaderTypes::ShaderTypes() { shader_modes[RS::SHADER_PARTICLES].functions["start"].built_ins["RESTART_VELOCITY"] = constt(ShaderLanguage::TYPE_BOOL); shader_modes[RS::SHADER_PARTICLES].functions["start"].built_ins["RESTART_COLOR"] = constt(ShaderLanguage::TYPE_BOOL); shader_modes[RS::SHADER_PARTICLES].functions["start"].built_ins["RESTART_CUSTOM"] = constt(ShaderLanguage::TYPE_BOOL); - shader_modes[RS::SHADER_PARTICLES].functions["start"].built_ins["AMOUNT_RATIO"] = ShaderLanguage::TYPE_FLOAT; + shader_modes[RS::SHADER_PARTICLES].functions["start"].built_ins["AMOUNT_RATIO"] = constt(ShaderLanguage::TYPE_FLOAT); shader_modes[RS::SHADER_PARTICLES].functions["start"].main_function = true; shader_modes[RS::SHADER_PARTICLES].functions["process"].built_ins["COLOR"] = ShaderLanguage::TYPE_VEC4; @@ -394,7 +394,7 @@ ShaderTypes::ShaderTypes() { shader_modes[RS::SHADER_PARTICLES].functions["process"].built_ins["COLLISION_NORMAL"] = constt(ShaderLanguage::TYPE_VEC3); shader_modes[RS::SHADER_PARTICLES].functions["process"].built_ins["COLLISION_DEPTH"] = constt(ShaderLanguage::TYPE_FLOAT); shader_modes[RS::SHADER_PARTICLES].functions["process"].built_ins["ATTRACTOR_FORCE"] = constt(ShaderLanguage::TYPE_VEC3); - shader_modes[RS::SHADER_PARTICLES].functions["process"].built_ins["AMOUNT_RATIO"] = ShaderLanguage::TYPE_FLOAT; + shader_modes[RS::SHADER_PARTICLES].functions["process"].built_ins["AMOUNT_RATIO"] = constt(ShaderLanguage::TYPE_FLOAT); shader_modes[RS::SHADER_PARTICLES].functions["process"].main_function = true; { diff --git a/servers/rendering/storage/texture_storage.h b/servers/rendering/storage/texture_storage.h index 6332dd578e..cf37fbfb4a 100644 --- a/servers/rendering/storage/texture_storage.h +++ b/servers/rendering/storage/texture_storage.h @@ -151,6 +151,9 @@ public: virtual void render_target_set_as_unused(RID p_render_target) = 0; virtual void render_target_set_msaa(RID p_render_target, RS::ViewportMSAA p_msaa) = 0; virtual RS::ViewportMSAA render_target_get_msaa(RID p_render_target) const = 0; + virtual void render_target_set_msaa_needs_resolve(RID p_render_target, bool p_needs_resolve) = 0; + virtual bool render_target_get_msaa_needs_resolve(RID p_render_target) const = 0; + virtual void render_target_do_msaa_resolve(RID p_render_target) = 0; virtual void render_target_set_use_hdr(RID p_render_target, bool p_use_hdr) = 0; virtual bool render_target_is_using_hdr(RID p_render_target) const = 0; diff --git a/servers/rendering_server.cpp b/servers/rendering_server.cpp index 43615f0d7e..b4af27c510 100644 --- a/servers/rendering_server.cpp +++ b/servers/rendering_server.cpp @@ -1193,7 +1193,7 @@ Error RenderingServer::mesh_create_surface_data_from_arrays(SurfaceData *r_surfa array_len = v3.size(); } break; default: { - ERR_FAIL_V(ERR_INVALID_DATA); + ERR_FAIL_V_MSG(ERR_INVALID_DATA, "Vertex array must be a PackedVector2Array or PackedVector3Array."); } break; } ERR_FAIL_COND_V(array_len == 0, ERR_INVALID_DATA); @@ -1214,7 +1214,7 @@ Error RenderingServer::mesh_create_surface_data_from_arrays(SurfaceData *r_surfa } } break; default: { - ERR_FAIL_V(ERR_INVALID_DATA); + ERR_FAIL_V_MSG(ERR_INVALID_DATA, "Bones array must be a PackedInt32Array."); } break; } } else if (i == RS::ARRAY_INDEX) { @@ -1802,6 +1802,14 @@ Array RenderingServer::_mesh_surface_get_skeleton_aabb_bind(RID p_mesh, int p_su } #endif +Rect2 RenderingServer::debug_canvas_item_get_rect(RID p_item) { +#ifdef TOOLS_ENABLED + return _debug_canvas_item_get_rect(p_item); +#else + return Rect2(); +#endif +} + int RenderingServer::global_shader_uniform_type_get_shader_datatype(GlobalShaderParameterType p_type) { switch (p_type) { case RS::GLOBAL_VAR_TYPE_BOOL: @@ -2148,45 +2156,47 @@ void RenderingServer::fix_surface_compatibility(SurfaceData &p_surface, const St // The only difference for now is that Version 1 uses interleaved vertex positions while version 2 does not. // I.e. PNTPNTPNT -> PPPNTNTNT. - int vertex_size = 0; - int normal_size = 0; - int tangent_size = 0; - if (p_surface.format & ARRAY_FORMAT_VERTEX) { - if (p_surface.format & ARRAY_FLAG_USE_2D_VERTICES) { - vertex_size = sizeof(float) * 2; - } else { - vertex_size = sizeof(float) * 3; + if (p_surface.vertex_data.size() > 0 && p_surface.vertex_count > 0) { + int vertex_size = 0; + int normal_size = 0; + int tangent_size = 0; + if (p_surface.format & ARRAY_FORMAT_VERTEX) { + if (p_surface.format & ARRAY_FLAG_USE_2D_VERTICES) { + vertex_size = sizeof(float) * 2; + } else { + vertex_size = sizeof(float) * 3; + } } - } - if (p_surface.format & ARRAY_FORMAT_NORMAL) { - normal_size += sizeof(uint16_t) * 2; - } - if (p_surface.format & ARRAY_FORMAT_TANGENT) { - tangent_size = sizeof(uint16_t) * 2; - } - int stride = p_surface.vertex_data.size() / p_surface.vertex_count; - int position_stride = vertex_size; - int normal_tangent_stride = normal_size + tangent_size; + if (p_surface.format & ARRAY_FORMAT_NORMAL) { + normal_size += sizeof(uint16_t) * 2; + } + if (p_surface.format & ARRAY_FORMAT_TANGENT) { + tangent_size = sizeof(uint16_t) * 2; + } + int stride = p_surface.vertex_data.size() / p_surface.vertex_count; + int position_stride = vertex_size; + int normal_tangent_stride = normal_size + tangent_size; - p_surface.vertex_data = _convert_surface_version_1_to_surface_version_2(p_surface.format, p_surface.vertex_data, p_surface.vertex_count, stride, vertex_size, normal_size, position_stride, normal_tangent_stride); + p_surface.vertex_data = _convert_surface_version_1_to_surface_version_2(p_surface.format, p_surface.vertex_data, p_surface.vertex_count, stride, vertex_size, normal_size, position_stride, normal_tangent_stride); - if (p_surface.blend_shape_data.size() > 0) { - // The size of one blend shape. - int divisor = (vertex_size + normal_size + tangent_size) * p_surface.vertex_count; - ERR_FAIL_COND((p_surface.blend_shape_data.size() % divisor) != 0); + if (p_surface.blend_shape_data.size() > 0) { + // The size of one blend shape. + int divisor = (vertex_size + normal_size + tangent_size) * p_surface.vertex_count; + ERR_FAIL_COND((p_surface.blend_shape_data.size() % divisor) != 0); - uint32_t blend_shape_count = p_surface.blend_shape_data.size() / divisor; + uint32_t blend_shape_count = p_surface.blend_shape_data.size() / divisor; - Vector<uint8_t> new_blend_shape_data; - for (uint32_t i = 0; i < blend_shape_count; i++) { - Vector<uint8_t> bs_data = p_surface.blend_shape_data.slice(i * divisor, (i + 1) * divisor); - Vector<uint8_t> blend_shape = _convert_surface_version_1_to_surface_version_2(p_surface.format, bs_data, p_surface.vertex_count, stride, vertex_size, normal_size, position_stride, normal_tangent_stride); - new_blend_shape_data.append_array(blend_shape); - } + Vector<uint8_t> new_blend_shape_data; + for (uint32_t i = 0; i < blend_shape_count; i++) { + Vector<uint8_t> bs_data = p_surface.blend_shape_data.slice(i * divisor, (i + 1) * divisor); + Vector<uint8_t> blend_shape = _convert_surface_version_1_to_surface_version_2(p_surface.format, bs_data, p_surface.vertex_count, stride, vertex_size, normal_size, position_stride, normal_tangent_stride); + new_blend_shape_data.append_array(blend_shape); + } - ERR_FAIL_COND(p_surface.blend_shape_data.size() != new_blend_shape_data.size()); + ERR_FAIL_COND(p_surface.blend_shape_data.size() != new_blend_shape_data.size()); - p_surface.blend_shape_data = new_blend_shape_data; + p_surface.blend_shape_data = new_blend_shape_data; + } } } p_surface.format &= ~(ARRAY_FLAG_FORMAT_VERSION_MASK << ARRAY_FLAG_FORMAT_VERSION_SHIFT); @@ -2846,6 +2856,7 @@ void RenderingServer::_bind_methods() { BIND_ENUM_CONSTANT(VIEWPORT_RENDER_INFO_TYPE_VISIBLE); BIND_ENUM_CONSTANT(VIEWPORT_RENDER_INFO_TYPE_SHADOW); + BIND_ENUM_CONSTANT(VIEWPORT_RENDER_INFO_TYPE_CANVAS); BIND_ENUM_CONSTANT(VIEWPORT_RENDER_INFO_TYPE_MAX); BIND_ENUM_CONSTANT(VIEWPORT_DEBUG_DRAW_DISABLED); @@ -3186,6 +3197,8 @@ void RenderingServer::_bind_methods() { ClassDB::bind_method(D_METHOD("canvas_item_set_visibility_notifier", "item", "enable", "area", "enter_callable", "exit_callable"), &RenderingServer::canvas_item_set_visibility_notifier); ClassDB::bind_method(D_METHOD("canvas_item_set_canvas_group_mode", "item", "mode", "clear_margin", "fit_empty", "fit_margin", "blur_mipmaps"), &RenderingServer::canvas_item_set_canvas_group_mode, DEFVAL(5.0), DEFVAL(false), DEFVAL(0.0), DEFVAL(false)); + ClassDB::bind_method(D_METHOD("debug_canvas_item_get_rect", "item"), &RenderingServer::debug_canvas_item_get_rect); + BIND_ENUM_CONSTANT(NINE_PATCH_STRETCH); BIND_ENUM_CONSTANT(NINE_PATCH_TILE); BIND_ENUM_CONSTANT(NINE_PATCH_TILE_FIT); diff --git a/servers/rendering_server.h b/servers/rendering_server.h index fbc67fc84d..016801fa6e 100644 --- a/servers/rendering_server.h +++ b/servers/rendering_server.h @@ -328,6 +328,10 @@ public: Vector<LOD> lods; Vector<AABB> bone_aabbs; + // Transforms used in runtime bone AABBs compute. + // Since bone AABBs is saved in Mesh space, but bones is in Skeleton space. + Transform3D mesh_to_skeleton_xform; + Vector<uint8_t> blend_shape_data; Vector4 uv_scale; @@ -961,6 +965,7 @@ public: enum ViewportRenderInfoType { VIEWPORT_RENDER_INFO_TYPE_VISIBLE, VIEWPORT_RENDER_INFO_TYPE_SHADOW, + VIEWPORT_RENDER_INFO_TYPE_CANVAS, VIEWPORT_RENDER_INFO_TYPE_MAX }; @@ -1491,6 +1496,9 @@ public: virtual void canvas_set_shadow_texture_size(int p_size) = 0; + Rect2 debug_canvas_item_get_rect(RID p_item); + virtual Rect2 _debug_canvas_item_get_rect(RID p_item) = 0; + /* GLOBAL SHADER UNIFORMS */ enum GlobalShaderParameterType { diff --git a/servers/text/text_server_extension.cpp b/servers/text/text_server_extension.cpp index d6844bba6a..ec622cdb1c 100644 --- a/servers/text/text_server_extension.cpp +++ b/servers/text/text_server_extension.cpp @@ -236,6 +236,9 @@ void TextServerExtension::_bind_methods() { GDVIRTUAL_BIND(_shaped_text_set_custom_punctuation, "shaped", "punct"); GDVIRTUAL_BIND(_shaped_text_get_custom_punctuation, "shaped"); + GDVIRTUAL_BIND(_shaped_text_set_custom_ellipsis, "shaped", "char"); + GDVIRTUAL_BIND(_shaped_text_get_custom_ellipsis, "shaped"); + GDVIRTUAL_BIND(_shaped_text_set_orientation, "shaped", "orientation"); GDVIRTUAL_BIND(_shaped_text_get_orientation, "shaped"); @@ -1058,6 +1061,16 @@ String TextServerExtension::shaped_text_get_custom_punctuation(const RID &p_shap return ret; } +void TextServerExtension::shaped_text_set_custom_ellipsis(const RID &p_shaped, int64_t p_char) { + GDVIRTUAL_CALL(_shaped_text_set_custom_ellipsis, p_shaped, p_char); +} + +int64_t TextServerExtension::shaped_text_get_custom_ellipsis(const RID &p_shaped) const { + int64_t ret = 0; + GDVIRTUAL_CALL(_shaped_text_get_custom_ellipsis, p_shaped, ret); + return ret; +} + void TextServerExtension::shaped_text_set_preserve_invalid(const RID &p_shaped, bool p_enabled) { GDVIRTUAL_CALL(_shaped_text_set_preserve_invalid, p_shaped, p_enabled); } diff --git a/servers/text/text_server_extension.h b/servers/text/text_server_extension.h index 7605ed480d..d0d7ee31ad 100644 --- a/servers/text/text_server_extension.h +++ b/servers/text/text_server_extension.h @@ -391,6 +391,11 @@ public: GDVIRTUAL2(_shaped_text_set_custom_punctuation, RID, String); GDVIRTUAL1RC(String, _shaped_text_get_custom_punctuation, RID); + virtual void shaped_text_set_custom_ellipsis(const RID &p_shaped, int64_t p_char) override; + virtual int64_t shaped_text_get_custom_ellipsis(const RID &p_shaped) const override; + GDVIRTUAL2(_shaped_text_set_custom_ellipsis, RID, int64_t); + GDVIRTUAL1RC(int64_t, _shaped_text_get_custom_ellipsis, RID); + virtual void shaped_text_set_orientation(const RID &p_shaped, Orientation p_orientation = ORIENTATION_HORIZONTAL) override; virtual Orientation shaped_text_get_orientation(const RID &p_shaped) const override; GDVIRTUAL2(_shaped_text_set_orientation, RID, Orientation); diff --git a/servers/text_server.cpp b/servers/text_server.cpp index 302d14bd8d..b282c517d3 100644 --- a/servers/text_server.cpp +++ b/servers/text_server.cpp @@ -390,6 +390,9 @@ void TextServer::_bind_methods() { ClassDB::bind_method(D_METHOD("shaped_text_set_custom_punctuation", "shaped", "punct"), &TextServer::shaped_text_set_custom_punctuation); ClassDB::bind_method(D_METHOD("shaped_text_get_custom_punctuation", "shaped"), &TextServer::shaped_text_get_custom_punctuation); + ClassDB::bind_method(D_METHOD("shaped_text_set_custom_ellipsis", "shaped", "char"), &TextServer::shaped_text_set_custom_ellipsis); + ClassDB::bind_method(D_METHOD("shaped_text_get_custom_ellipsis", "shaped"), &TextServer::shaped_text_get_custom_ellipsis); + ClassDB::bind_method(D_METHOD("shaped_text_set_orientation", "shaped", "orientation"), &TextServer::shaped_text_set_orientation, DEFVAL(ORIENTATION_HORIZONTAL)); ClassDB::bind_method(D_METHOD("shaped_text_get_orientation", "shaped"), &TextServer::shaped_text_get_orientation); diff --git a/servers/text_server.h b/servers/text_server.h index fdc0e9fc4d..70d2129b51 100644 --- a/servers/text_server.h +++ b/servers/text_server.h @@ -427,6 +427,9 @@ public: virtual void shaped_text_set_custom_punctuation(const RID &p_shaped, const String &p_punct) = 0; virtual String shaped_text_get_custom_punctuation(const RID &p_shaped) const = 0; + virtual void shaped_text_set_custom_ellipsis(const RID &p_shaped, int64_t p_char) = 0; + virtual int64_t shaped_text_get_custom_ellipsis(const RID &p_shaped) const = 0; + virtual void shaped_text_set_orientation(const RID &p_shaped, Orientation p_orientation = ORIENTATION_HORIZONTAL) = 0; virtual Orientation shaped_text_get_orientation(const RID &p_shaped) const = 0; diff --git a/tests/core/io/test_image.h b/tests/core/io/test_image.h index 07c7c04e36..945a7e1ba3 100644 --- a/tests/core/io/test_image.h +++ b/tests/core/io/test_image.h @@ -403,6 +403,29 @@ TEST_CASE("[Image] Custom mipmaps") { } } +TEST_CASE("[Image] Convert image") { + for (int format = Image::FORMAT_RF; format < Image::FORMAT_RGBE9995; format++) { + for (int new_format = Image::FORMAT_RF; new_format < Image::FORMAT_RGBE9995; new_format++) { + Ref<Image> image = memnew(Image(4, 4, false, (Image::Format)format)); + image->convert((Image::Format)new_format); + String format_string = Image::format_names[(Image::Format)format]; + String new_format_string = Image::format_names[(Image::Format)new_format]; + format_string = "Error converting from " + format_string + " to " + new_format_string + "."; + CHECK_MESSAGE(image->get_format() == new_format, format_string); + } + } + + Ref<Image> image = memnew(Image(4, 4, false, Image::FORMAT_RGBA8)); + PackedByteArray image_data = image->get_data(); + image->convert((Image::Format)-1); + CHECK_MESSAGE(image->get_data() == image_data, "Image conversion to invalid type (-1) should not alter image."); + + Ref<Image> image2 = memnew(Image(4, 4, false, Image::FORMAT_RGBA8)); + image_data = image2->get_data(); + image2->convert((Image::Format)(Image::FORMAT_MAX + 1)); + CHECK_MESSAGE(image2->get_data() == image_data, "Image conversion to invalid type (Image::FORMAT_MAX + 1) should not alter image."); +} + } // namespace TestImage #endif // TEST_IMAGE_H diff --git a/tests/core/math/test_basis.h b/tests/core/math/test_basis.h index fcac9a6231..a9bc2e9b99 100644 --- a/tests/core/math/test_basis.h +++ b/tests/core/math/test_basis.h @@ -324,6 +324,100 @@ TEST_CASE("[Basis] Is conformal checks") { CHECK_FALSE_MESSAGE( Basis(Vector3(Math_SQRT12, Math_SQRT12, 0), Vector3(0, 1, 0), Vector3(0, 0, 1)).is_conformal(), "Basis with the X axis skewed 45 degrees should not be conformal."); + + CHECK_MESSAGE( + Basis(0, 0, 0, 0, 0, 0, 0, 0, 0).is_conformal(), + "Edge case: Basis with all zeroes should return true for is_conformal (because a 0 scale is uniform)."); +} + +TEST_CASE("[Basis] Is orthogonal checks") { + CHECK_MESSAGE( + Basis().is_orthogonal(), + "Identity Basis should be orthogonal."); + + CHECK_MESSAGE( + Basis::from_euler(Vector3(1.2, 3.4, 5.6)).is_orthogonal(), + "Basis with only rotation should be orthogonal."); + + CHECK_MESSAGE( + Basis::from_scale(Vector3(-1, -1, -1)).is_orthogonal(), + "Basis with only a flip should be orthogonal."); + + CHECK_MESSAGE( + Basis::from_scale(Vector3(1.2, 3.4, 5.6)).is_orthogonal(), + "Basis with only scale should be orthogonal."); + + CHECK_MESSAGE( + Basis(Vector3(3, 4, 0), Vector3(4, -3, 0), Vector3(0, 0, 5)).is_orthogonal(), + "Basis with a flip, rotation, and uniform scale should be orthogonal."); + + CHECK_FALSE_MESSAGE( + Basis(Vector3(Math_SQRT12, Math_SQRT12, 0), Vector3(0, 1, 0), Vector3(0, 0, 1)).is_orthogonal(), + "Basis with the X axis skewed 45 degrees should not be orthogonal."); + + CHECK_MESSAGE( + Basis(0, 0, 0, 0, 0, 0, 0, 0, 0).is_orthogonal(), + "Edge case: Basis with all zeroes should return true for is_orthogonal, since zero vectors are orthogonal to all vectors."); +} + +TEST_CASE("[Basis] Is orthonormal checks") { + CHECK_MESSAGE( + Basis().is_orthonormal(), + "Identity Basis should be orthonormal."); + + CHECK_MESSAGE( + Basis::from_euler(Vector3(1.2, 3.4, 5.6)).is_orthonormal(), + "Basis with only rotation should be orthonormal."); + + CHECK_MESSAGE( + Basis::from_scale(Vector3(-1, -1, -1)).is_orthonormal(), + "Basis with only a flip should be orthonormal."); + + CHECK_FALSE_MESSAGE( + Basis::from_scale(Vector3(1.2, 3.4, 5.6)).is_orthonormal(), + "Basis with only scale should not be orthonormal."); + + CHECK_FALSE_MESSAGE( + Basis(Vector3(3, 4, 0), Vector3(4, -3, 0), Vector3(0, 0, 5)).is_orthonormal(), + "Basis with a flip, rotation, and uniform scale should not be orthonormal."); + + CHECK_FALSE_MESSAGE( + Basis(Vector3(Math_SQRT12, Math_SQRT12, 0), Vector3(0, 1, 0), Vector3(0, 0, 1)).is_orthonormal(), + "Basis with the X axis skewed 45 degrees should not be orthonormal."); + + CHECK_FALSE_MESSAGE( + Basis(0, 0, 0, 0, 0, 0, 0, 0, 0).is_orthonormal(), + "Edge case: Basis with all zeroes should return false for is_orthonormal, since the vectors do not have a length of 1."); +} + +TEST_CASE("[Basis] Is rotation checks") { + CHECK_MESSAGE( + Basis().is_rotation(), + "Identity Basis should be a rotation (a rotation of zero)."); + + CHECK_MESSAGE( + Basis::from_euler(Vector3(1.2, 3.4, 5.6)).is_rotation(), + "Basis with only rotation should be a rotation."); + + CHECK_FALSE_MESSAGE( + Basis::from_scale(Vector3(-1, -1, -1)).is_rotation(), + "Basis with only a flip should not be a rotation."); + + CHECK_FALSE_MESSAGE( + Basis::from_scale(Vector3(1.2, 3.4, 5.6)).is_rotation(), + "Basis with only scale should not be a rotation."); + + CHECK_FALSE_MESSAGE( + Basis(Vector3(2, 0, 0), Vector3(0, 0.5, 0), Vector3(0, 0, 1)).is_rotation(), + "Basis with a squeeze should not be a rotation."); + + CHECK_FALSE_MESSAGE( + Basis(Vector3(Math_SQRT12, Math_SQRT12, 0), Vector3(0, 1, 0), Vector3(0, 0, 1)).is_rotation(), + "Basis with the X axis skewed 45 degrees should not be a rotation."); + + CHECK_FALSE_MESSAGE( + Basis(0, 0, 0, 0, 0, 0, 0, 0, 0).is_rotation(), + "Edge case: Basis with all zeroes should return false for is_rotation, because it is not just a rotation (has a scale of 0)."); } } // namespace TestBasis diff --git a/tests/core/string/test_string.h b/tests/core/string/test_string.h index 02349aedc0..8a11491bb2 100644 --- a/tests/core/string/test_string.h +++ b/tests/core/string/test_string.h @@ -456,30 +456,93 @@ TEST_CASE("[String] Number to string") { } TEST_CASE("[String] String to integer") { - static const char *nums[4] = { "1237461283", "- 22", "0", " - 1123412" }; - static const int num[4] = { 1237461283, -22, 0, -1123412 }; + static const char *nums[14] = { "1237461283", "- 22", "0", " - 1123412", "", "10_000_000", "-1_2_3_4", "10__000", " 1 2 34 ", "-0", "007", "--45", "---46", "-7-2" }; + static const int num[14] = { 1237461283, -22, 0, -1123412, 0, 10000000, -1234, 10000, 1234, 0, 7, 45, -46, -72 }; - for (int i = 0; i < 4; i++) { + for (int i = 0; i < 14; i++) { CHECK(String(nums[i]).to_int() == num[i]); } + CHECK(String("0b1011").to_int() == 1011); // Looks like a binary number, but to_int() handles this as a base-10 number, "b" is just ignored. + CHECK(String("0x1012").to_int() == 1012); // Looks like a hexadecimal number, but to_int() handles this as a base-10 number, "x" is just ignored. + + ERR_PRINT_OFF + CHECK(String("999999999999999999999999999999999999999999999999999999999").to_int() == INT64_MAX); // Too large, largest possible is returned. + CHECK(String("-999999999999999999999999999999999999999999999999999999999").to_int() == INT64_MIN); // Too small, smallest possible is returned. + ERR_PRINT_ON } TEST_CASE("[String] Hex to integer") { - static const char *nums[4] = { "0xFFAE", "22", "0", "AADDAD" }; - static const int64_t num[4] = { 0xFFAE, 0x22, 0, 0xAADDAD }; + static const char *nums[12] = { "0xFFAE", "22", "0", "AADDAD", "0x7FFFFFFFFFFFFFFF", "-0xf", "", "000", "000f", "0xaA", "-ff", "-" }; + static const int64_t num[12] = { 0xFFAE, 0x22, 0, 0xAADDAD, 0x7FFFFFFFFFFFFFFF, -0xf, 0, 0, 0xf, 0xaa, -0xff, 0x0 }; - for (int i = 0; i < 4; i++) { + for (int i = 0; i < 12; i++) { CHECK(String(nums[i]).hex_to_int() == num[i]); } + + // Invalid hex strings should return 0. + static const char *invalid_nums[15] = { "qwerty", "QWERTY", "0xqwerty", "0x00qwerty", "qwerty00", "0x", "0x__", "__", "x12", "+", " ff", "ff ", "f f", "+ff", "--0x78" }; + + ERR_PRINT_OFF + for (int i = 0; i < 15; i++) { + CHECK(String(invalid_nums[i]).hex_to_int() == 0); + } + + CHECK(String("0xFFFFFFFFFFFFFFFFFFFFFFF").hex_to_int() == INT64_MAX); // Too large, largest possible is returned. + CHECK(String("-0xFFFFFFFFFFFFFFFFFFFFFFF").hex_to_int() == INT64_MIN); // Too small, smallest possible is returned. + ERR_PRINT_ON +} + +TEST_CASE("[String] Bin to integer") { + static const char *nums[10] = { "", "0", "0b0", "0b1", "0b", "1", "0b1010", "-0b11", "-1010", "0b0111111111111111111111111111111111111111111111111111111111111111" }; + static const int64_t num[10] = { 0, 0, 0, 1, 0, 1, 10, -3, -10, 0x7FFFFFFFFFFFFFFF }; + + for (int i = 0; i < 10; i++) { + CHECK(String(nums[i]).bin_to_int() == num[i]); + } + + // Invalid bin strings should return 0. The long "0x11...11" is just too long for a 64 bit int. + static const char *invalid_nums[16] = { "qwerty", "QWERTY", "0bqwerty", "0b00qwerty", "qwerty00", "0x__", "0b__", "__", "b12", "+", "-", "0x12ab", " 11", "11 ", "1 1", "--0b11" }; + + for (int i = 0; i < 16; i++) { + CHECK(String(invalid_nums[i]).bin_to_int() == 0); + } + + ERR_PRINT_OFF + CHECK(String("0b111111111111111111111111111111111111111111111111111111111111111111111111111111111").bin_to_int() == INT64_MAX); // Too large, largest possible is returned. + CHECK(String("-0b111111111111111111111111111111111111111111111111111111111111111111111111111111111").bin_to_int() == INT64_MIN); // Too small, smallest possible is returned. + ERR_PRINT_ON } TEST_CASE("[String] String to float") { - static const char *nums[4] = { "-12348298412.2", "0.05", "2.0002", " -0.0001" }; - static const double num[4] = { -12348298412.2, 0.05, 2.0002, -0.0001 }; + static const char *nums[12] = { "-12348298412.2", "0.05", "2.0002", " -0.0001", "0", "000", "123", "0.0", "000.000", "000.007", "234__", "3..14" }; + static const double num[12] = { -12348298412.2, 0.05, 2.0002, -0.0001, 0.0, 0.0, 123.0, 0.0, 0.0, 0.007, 234.0, 3.0 }; - for (int i = 0; i < 4; i++) { + for (int i = 0; i < 12; i++) { CHECK(!(ABS(String(nums[i]).to_float() - num[i]) > 0.00001)); } + + // Invalid float strings should return 0. + static const char *invalid_nums[6] = { "qwerty", "qwerty123", "0xffff", "0b1010", "--3.13", "__345" }; + + for (int i = 0; i < 6; i++) { + CHECK(String(invalid_nums[i]).to_float() == 0); + } + + // Very large exponents. + CHECK(String("1e308").to_float() == 1e308); + CHECK(String("-1e308").to_float() == -1e308); + + // Exponent is so high that value is INFINITY/-INFINITY. + CHECK(String("1e309").to_float() == INFINITY); + CHECK(String("1e511").to_float() == INFINITY); + CHECK(String("-1e309").to_float() == -INFINITY); + CHECK(String("-1e511").to_float() == -INFINITY); + + // Exponent is so high that a warning message is printed. Value is INFINITY/-INFINITY. + ERR_PRINT_OFF + CHECK(String("1e512").to_float() == INFINITY); + CHECK(String("-1e512").to_float() == -INFINITY); + ERR_PRINT_ON } TEST_CASE("[String] Slicing") { diff --git a/tests/scene/test_primitives.h b/tests/scene/test_primitives.h index 9232a3020d..552f722d24 100644 --- a/tests/scene/test_primitives.h +++ b/tests/scene/test_primitives.h @@ -232,7 +232,7 @@ TEST_CASE("[SceneTree][Primitive][Cylinder] Cylinder Primitive") { CHECK(cylinder->get_bottom_radius() > 0); CHECK(cylinder->get_height() > 0); CHECK(cylinder->get_radial_segments() > 0); - CHECK(cylinder->get_rings() > 0); + CHECK(cylinder->get_rings() >= 0); } SUBCASE("[SceneTree][Primitive][Cylinder] Set properties and get them") { diff --git a/tests/scene/test_text_edit.h b/tests/scene/test_text_edit.h index 9c9ade4445..e81578a862 100644 --- a/tests/scene/test_text_edit.h +++ b/tests/scene/test_text_edit.h @@ -4118,7 +4118,7 @@ TEST_CASE("[SceneTree][TextEdit] setter getters") { CHECK_FALSE(text_edit->is_drawing_spaces()); } - SUBCASE("[TextEdit] draw minimao") { + SUBCASE("[TextEdit] draw minimap") { text_edit->set_draw_minimap(true); CHECK(text_edit->is_drawing_minimap()); text_edit->set_draw_minimap(false); diff --git a/tests/servers/test_navigation_server_3d.h b/tests/servers/test_navigation_server_3d.h index 691536da8e..5ab2975b74 100644 --- a/tests/servers/test_navigation_server_3d.h +++ b/tests/servers/test_navigation_server_3d.h @@ -429,6 +429,105 @@ TEST_SUITE("[Navigation]") { navigation_server->free(map); } + TEST_CASE("[NavigationServer3D] Server should make agents avoid dynamic obstacles when avoidance enabled") { + NavigationServer3D *navigation_server = NavigationServer3D::get_singleton(); + + RID map = navigation_server->map_create(); + RID agent_1 = navigation_server->agent_create(); + RID obstacle_1 = navigation_server->obstacle_create(); + + navigation_server->map_set_active(map, true); + + navigation_server->agent_set_map(agent_1, map); + navigation_server->agent_set_avoidance_enabled(agent_1, true); + navigation_server->agent_set_position(agent_1, Vector3(0, 0, 0)); + navigation_server->agent_set_radius(agent_1, 1); + navigation_server->agent_set_velocity(agent_1, Vector3(1, 0, 0)); + CallableMock agent_1_avoidance_callback_mock; + navigation_server->agent_set_avoidance_callback(agent_1, callable_mp(&agent_1_avoidance_callback_mock, &CallableMock::function1)); + + navigation_server->obstacle_set_map(obstacle_1, map); + navigation_server->obstacle_set_avoidance_enabled(obstacle_1, true); + navigation_server->obstacle_set_position(obstacle_1, Vector3(2.5, 0, 0.5)); + navigation_server->obstacle_set_radius(obstacle_1, 1); + + CHECK_EQ(agent_1_avoidance_callback_mock.function1_calls, 0); + navigation_server->process(0.0); // Give server some cycles to commit. + CHECK_EQ(agent_1_avoidance_callback_mock.function1_calls, 1); + Vector3 agent_1_safe_velocity = agent_1_avoidance_callback_mock.function1_latest_arg0; + CHECK_MESSAGE(agent_1_safe_velocity.x > 0, "Agent 1 should move a bit along desired velocity (+X)."); + CHECK_MESSAGE(agent_1_safe_velocity.z < 0, "Agent 1 should move a bit to the side so that it avoids obstacle."); + + navigation_server->free(obstacle_1); + navigation_server->free(agent_1); + navigation_server->free(map); + navigation_server->process(0.0); // Give server some cycles to commit. + } + + TEST_CASE("[NavigationServer3D] Server should make agents avoid static obstacles when avoidance enabled") { + NavigationServer3D *navigation_server = NavigationServer3D::get_singleton(); + + RID map = navigation_server->map_create(); + RID agent_1 = navigation_server->agent_create(); + RID agent_2 = navigation_server->agent_create(); + RID obstacle_1 = navigation_server->obstacle_create(); + + navigation_server->map_set_active(map, true); + + navigation_server->agent_set_map(agent_1, map); + navigation_server->agent_set_avoidance_enabled(agent_1, true); + navigation_server->agent_set_radius(agent_1, 1.6); // Have hit the obstacle already. + navigation_server->agent_set_velocity(agent_1, Vector3(1, 0, 0)); + CallableMock agent_1_avoidance_callback_mock; + navigation_server->agent_set_avoidance_callback(agent_1, callable_mp(&agent_1_avoidance_callback_mock, &CallableMock::function1)); + + navigation_server->agent_set_map(agent_2, map); + navigation_server->agent_set_avoidance_enabled(agent_2, true); + navigation_server->agent_set_radius(agent_2, 1.4); // Haven't hit the obstacle yet. + navigation_server->agent_set_velocity(agent_2, Vector3(1, 0, 0)); + CallableMock agent_2_avoidance_callback_mock; + navigation_server->agent_set_avoidance_callback(agent_2, callable_mp(&agent_2_avoidance_callback_mock, &CallableMock::function1)); + + navigation_server->obstacle_set_map(obstacle_1, map); + navigation_server->obstacle_set_avoidance_enabled(obstacle_1, true); + PackedVector3Array obstacle_1_vertices; + + SUBCASE("Static obstacles should work on ground level") { + navigation_server->agent_set_position(agent_1, Vector3(0, 0, 0)); + navigation_server->agent_set_position(agent_2, Vector3(0, 0, 5)); + obstacle_1_vertices.push_back(Vector3(1.5, 0, 0.5)); + obstacle_1_vertices.push_back(Vector3(1.5, 0, 4.5)); + } + + SUBCASE("Static obstacles should work when elevated") { + navigation_server->agent_set_position(agent_1, Vector3(0, 5, 0)); + navigation_server->agent_set_position(agent_2, Vector3(0, 5, 5)); + obstacle_1_vertices.push_back(Vector3(1.5, 0, 0.5)); + obstacle_1_vertices.push_back(Vector3(1.5, 0, 4.5)); + navigation_server->obstacle_set_position(obstacle_1, Vector3(0, 5, 0)); + } + + navigation_server->obstacle_set_vertices(obstacle_1, obstacle_1_vertices); + + CHECK_EQ(agent_1_avoidance_callback_mock.function1_calls, 0); + CHECK_EQ(agent_2_avoidance_callback_mock.function1_calls, 0); + navigation_server->process(0.0); // Give server some cycles to commit. + CHECK_EQ(agent_1_avoidance_callback_mock.function1_calls, 1); + CHECK_EQ(agent_2_avoidance_callback_mock.function1_calls, 1); + Vector3 agent_1_safe_velocity = agent_1_avoidance_callback_mock.function1_latest_arg0; + Vector3 agent_2_safe_velocity = agent_2_avoidance_callback_mock.function1_latest_arg0; + CHECK_MESSAGE(agent_1_safe_velocity.x > 0, "Agent 1 should move a bit along desired velocity (+X)."); + CHECK_MESSAGE(agent_1_safe_velocity.z < 0, "Agent 1 should move a bit to the side so that it avoids obstacle."); + CHECK_MESSAGE(agent_2_safe_velocity.x > 0, "Agent 2 should move a bit along desired velocity (+X)."); + CHECK_MESSAGE(agent_2_safe_velocity.z == 0, "Agent 2 should not move to the side."); + + navigation_server->free(obstacle_1); + navigation_server->free(agent_2); + navigation_server->free(agent_1); + navigation_server->free(map); + navigation_server->process(0.0); // Give server some cycles to commit. + } + #ifndef DISABLE_DEPRECATED // This test case uses only public APIs on purpose - other test cases use simplified baking. // FIXME: Remove once deprecated `region_bake_navigation_mesh()` is removed. diff --git a/thirdparty/README.md b/thirdparty/README.md index 4fcd85b36e..8b8f40aff3 100644 --- a/thirdparty/README.md +++ b/thirdparty/README.md @@ -120,6 +120,31 @@ have been removed as they caused massive quality regressions. Apply the patches in the `patches/` folder when syncing on newer upstream commits. +## d3d12ma + +- Upstream: https://github.com/GPUOpen-LibrariesAndSDKs/D3D12MemoryAllocator +- Version: 2.1.0-development (4d16e802e0b9451c9d3c27cd308928c13b73acd6, 2023) +- License: MIT + +Files extracted from upstream source: + +- `src/D3D12MemAlloc.cpp`, `src/D3D12MemAlloc.natvis` +- `include/D3D12MemAlloc.h` +- `LICENSE.txt`, `NOTICES.txt` + + +## directx_headers + +- Upstream: https://github.com/microsoft/DirectX-Headers +- Version: 1.606.3 (fd329244e62201bf959331d28514928fc1d45005, 2022) +- License: MIT + +Files extracted from upstream source: + +- `include/directx/*.h` +- `LICENSE` + + ## doctest - Upstream: https://github.com/onqtam/doctest @@ -191,6 +216,8 @@ Files extracted from upstream source: ``` - `AUTHORS.txt` and `LICENSE.txt` +Two files (`ProcessRgtc.{cpp,hpp}`) have been added to provide RGTC compression implementation, +based on library's `ProcessDxtc.{cpp,hpp}`. ## fonts @@ -501,7 +528,7 @@ File extracted from upstream release tarball: ## meshoptimizer - Upstream: https://github.com/zeux/meshoptimizer -- Version: git (4a287848fd664ae1c3fc8e5e008560534ceeb526, 2022) +- Version: git (c21d3be6ddf627f8ca852ba4b6db9903b0557858, 2023) - License: MIT Files extracted from upstream repository: @@ -509,10 +536,27 @@ Files extracted from upstream repository: - All files in `src/` - `LICENSE.md` -An [experimental upstream feature](https://github.com/zeux/meshoptimizer/tree/simplify-attr), -has been backported. On top of that, it was modified to report only distance -error metrics instead of a combination of distance and attribute errors. Patches -for both changes can be found in the `patches` directory. +A patch is included to modify the simplifier to report only distance error +metrics instead of a combination of distance and attribute errors. + + +## mingw-std-threads + +- Upstream: https://github.com/meganz/mingw-std-threads +- Version: git (c931bac289dd431f1dd30fc4a5d1a7be36668073, 2023) +- License: BSD-2-clause + +Files extracted from upstream repository: + +- `LICENSE` +- `mingw.condition_variable.h` +- `mingw.invoke.h` +- `mingw.mutex.h` +- `mingw.shared_mutex.h` +- `mingw.thread.h` + +Once copied, apply `godot.patch` (needed because Godot is built without exceptions +and to avoid std:: replacements leak in Clang builds). ## minimp3 @@ -565,6 +609,8 @@ Important: Some files have Godot-made changes for use in core/io. They are marked with `/* GODOT start */` and `/* GODOT end */` comments and a patch is provided in the `patches` folder. +Another patch is included to fix CVE-2023-45853. + ## misc diff --git a/thirdparty/d3d12ma/D3D12MemAlloc.cpp b/thirdparty/d3d12ma/D3D12MemAlloc.cpp new file mode 100644 index 0000000000..8e2488091a --- /dev/null +++ b/thirdparty/d3d12ma/D3D12MemAlloc.cpp @@ -0,0 +1,10544 @@ +// +// Copyright (c) 2019-2022 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +#include "D3D12MemAlloc.h" + +#include <combaseapi.h> +#include <mutex> +#include <algorithm> +#include <utility> +#include <cstdlib> +#include <cstdint> +#include <malloc.h> // for _aligned_malloc, _aligned_free +#ifndef _WIN32 + #include <shared_mutex> +#endif + +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// +// Configuration Begin +// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +#ifndef _D3D12MA_CONFIGURATION + +#ifdef _WIN32 + #if !defined(WINVER) || WINVER < 0x0600 + #error Required at least WinAPI version supporting: client = Windows Vista, server = Windows Server 2008. + #endif +#endif + +#ifndef D3D12MA_SORT + #define D3D12MA_SORT(beg, end, cmp) std::sort(beg, end, cmp) +#endif + +#ifndef D3D12MA_D3D12_HEADERS_ALREADY_INCLUDED + #include <dxgi.h> + #if D3D12MA_DXGI_1_4 + #include <dxgi1_4.h> + #endif +#endif + +#ifndef D3D12MA_ASSERT + #include <cassert> + #define D3D12MA_ASSERT(cond) assert(cond) +#endif + +// Assert that will be called very often, like inside data structures e.g. operator[]. +// Making it non-empty can make program slow. +#ifndef D3D12MA_HEAVY_ASSERT + #ifdef _DEBUG + #define D3D12MA_HEAVY_ASSERT(expr) //D3D12MA_ASSERT(expr) + #else + #define D3D12MA_HEAVY_ASSERT(expr) + #endif +#endif + +#ifndef D3D12MA_DEBUG_ALIGNMENT + /* + Minimum alignment of all allocations, in bytes. + Set to more than 1 for debugging purposes only. Must be power of two. + */ + #define D3D12MA_DEBUG_ALIGNMENT (1) +#endif + +#ifndef D3D12MA_DEBUG_MARGIN + // Minimum margin before and after every allocation, in bytes. + // Set nonzero for debugging purposes only. + #define D3D12MA_DEBUG_MARGIN (0) +#endif + +#ifndef D3D12MA_DEBUG_GLOBAL_MUTEX + /* + Set this to 1 for debugging purposes only, to enable single mutex protecting all + entry calls to the library. Can be useful for debugging multithreading issues. + */ + #define D3D12MA_DEBUG_GLOBAL_MUTEX (0) +#endif + +/* +Define this macro for debugging purposes only to force specific D3D12_RESOURCE_HEAP_TIER, +especially to test compatibility with D3D12_RESOURCE_HEAP_TIER_1 on modern GPUs. +*/ +//#define D3D12MA_FORCE_RESOURCE_HEAP_TIER D3D12_RESOURCE_HEAP_TIER_1 + +#ifndef D3D12MA_DEFAULT_BLOCK_SIZE + /// Default size of a block allocated as single ID3D12Heap. + #define D3D12MA_DEFAULT_BLOCK_SIZE (64ull * 1024 * 1024) +#endif + +#ifndef D3D12MA_DEBUG_LOG + #define D3D12MA_DEBUG_LOG(format, ...) + /* + #define D3D12MA_DEBUG_LOG(format, ...) do { \ + wprintf(format, __VA_ARGS__); \ + wprintf(L"\n"); \ + } while(false) + */ +#endif + +#endif // _D3D12MA_CONFIGURATION +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// +// Configuration End +// +//////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// + +#define D3D12MA_IID_PPV_ARGS(ppType) __uuidof(**(ppType)), reinterpret_cast<void**>(ppType) + +#ifdef __ID3D12Device8_INTERFACE_DEFINED__ + #define D3D12MA_CREATE_NOT_ZEROED_AVAILABLE 1 +#endif + +namespace D3D12MA +{ +static constexpr UINT HEAP_TYPE_COUNT = 4; +static constexpr UINT STANDARD_HEAP_TYPE_COUNT = 3; // Only DEFAULT, UPLOAD, READBACK. +static constexpr UINT DEFAULT_POOL_MAX_COUNT = 9; +static const UINT NEW_BLOCK_SIZE_SHIFT_MAX = 3; +// Minimum size of a free suballocation to register it in the free suballocation collection. +static const UINT64 MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER = 16; + +static const WCHAR* const HeapTypeNames[] = +{ + L"DEFAULT", + L"UPLOAD", + L"READBACK", + L"CUSTOM", +}; + +static const D3D12_HEAP_FLAGS RESOURCE_CLASS_HEAP_FLAGS = + D3D12_HEAP_FLAG_DENY_BUFFERS | D3D12_HEAP_FLAG_DENY_RT_DS_TEXTURES | D3D12_HEAP_FLAG_DENY_NON_RT_DS_TEXTURES; + +static const D3D12_RESIDENCY_PRIORITY D3D12_RESIDENCY_PRIORITY_NONE = D3D12_RESIDENCY_PRIORITY(0); + +#ifndef _D3D12MA_ENUM_DECLARATIONS + +// Local copy of this enum, as it is provided only by <dxgi1_4.h>, so it may not be available. +enum DXGI_MEMORY_SEGMENT_GROUP_COPY +{ + DXGI_MEMORY_SEGMENT_GROUP_LOCAL_COPY = 0, + DXGI_MEMORY_SEGMENT_GROUP_NON_LOCAL_COPY = 1, + DXGI_MEMORY_SEGMENT_GROUP_COUNT +}; + +enum class ResourceClass +{ + Unknown, Buffer, Non_RT_DS_Texture, RT_DS_Texture +}; + +enum SuballocationType +{ + SUBALLOCATION_TYPE_FREE = 0, + SUBALLOCATION_TYPE_ALLOCATION = 1, +}; + +#endif // _D3D12MA_ENUM_DECLARATIONS + + +#ifndef _D3D12MA_FUNCTIONS + +static void* DefaultAllocate(size_t Size, size_t Alignment, void* /*pPrivateData*/) +{ +#ifdef _WIN32 + return _aligned_malloc(Size, Alignment); +#else + return aligned_alloc(Alignment, Size); +#endif +} +static void DefaultFree(void* pMemory, void* /*pPrivateData*/) +{ +#ifdef _WIN32 + return _aligned_free(pMemory); +#else + return free(pMemory); +#endif +} + +static void* Malloc(const ALLOCATION_CALLBACKS& allocs, size_t size, size_t alignment) +{ + void* const result = (*allocs.pAllocate)(size, alignment, allocs.pPrivateData); + D3D12MA_ASSERT(result); + return result; +} +static void Free(const ALLOCATION_CALLBACKS& allocs, void* memory) +{ + (*allocs.pFree)(memory, allocs.pPrivateData); +} + +template<typename T> +static T* Allocate(const ALLOCATION_CALLBACKS& allocs) +{ + return (T*)Malloc(allocs, sizeof(T), __alignof(T)); +} +template<typename T> +static T* AllocateArray(const ALLOCATION_CALLBACKS& allocs, size_t count) +{ + return (T*)Malloc(allocs, sizeof(T) * count, __alignof(T)); +} + +#define D3D12MA_NEW(allocs, type) new(D3D12MA::Allocate<type>(allocs))(type) +#define D3D12MA_NEW_ARRAY(allocs, type, count) new(D3D12MA::AllocateArray<type>((allocs), (count)))(type) + +template<typename T> +void D3D12MA_DELETE(const ALLOCATION_CALLBACKS& allocs, T* memory) +{ + if (memory) + { + memory->~T(); + Free(allocs, memory); + } +} +template<typename T> +void D3D12MA_DELETE_ARRAY(const ALLOCATION_CALLBACKS& allocs, T* memory, size_t count) +{ + if (memory) + { + for (size_t i = count; i--; ) + { + memory[i].~T(); + } + Free(allocs, memory); + } +} + +static void SetupAllocationCallbacks(ALLOCATION_CALLBACKS& outAllocs, const ALLOCATION_CALLBACKS* allocationCallbacks) +{ + if (allocationCallbacks) + { + outAllocs = *allocationCallbacks; + D3D12MA_ASSERT(outAllocs.pAllocate != NULL && outAllocs.pFree != NULL); + } + else + { + outAllocs.pAllocate = &DefaultAllocate; + outAllocs.pFree = &DefaultFree; + outAllocs.pPrivateData = NULL; + } +} + +#define SAFE_RELEASE(ptr) do { if(ptr) { (ptr)->Release(); (ptr) = NULL; } } while(false) + +#define D3D12MA_VALIDATE(cond) do { if(!(cond)) { \ + D3D12MA_ASSERT(0 && "Validation failed: " #cond); \ + return false; \ +} } while(false) + +template<typename T> +static T D3D12MA_MIN(const T& a, const T& b) { return a <= b ? a : b; } +template<typename T> +static T D3D12MA_MAX(const T& a, const T& b) { return a <= b ? b : a; } + +template<typename T> +static void D3D12MA_SWAP(T& a, T& b) { T tmp = a; a = b; b = tmp; } + +// Scans integer for index of first nonzero bit from the Least Significant Bit (LSB). If mask is 0 then returns UINT8_MAX +static UINT8 BitScanLSB(UINT64 mask) +{ +#if defined(_MSC_VER) && defined(_WIN64) + unsigned long pos; + if (_BitScanForward64(&pos, mask)) + return static_cast<UINT8>(pos); + return UINT8_MAX; +#elif defined __GNUC__ || defined __clang__ + return static_cast<UINT8>(__builtin_ffsll(mask)) - 1U; +#else + UINT8 pos = 0; + UINT64 bit = 1; + do + { + if (mask & bit) + return pos; + bit <<= 1; + } while (pos++ < 63); + return UINT8_MAX; +#endif +} +// Scans integer for index of first nonzero bit from the Least Significant Bit (LSB). If mask is 0 then returns UINT8_MAX +static UINT8 BitScanLSB(UINT32 mask) +{ +#ifdef _MSC_VER + unsigned long pos; + if (_BitScanForward(&pos, mask)) + return static_cast<UINT8>(pos); + return UINT8_MAX; +#elif defined __GNUC__ || defined __clang__ + return static_cast<UINT8>(__builtin_ffs(mask)) - 1U; +#else + UINT8 pos = 0; + UINT32 bit = 1; + do + { + if (mask & bit) + return pos; + bit <<= 1; + } while (pos++ < 31); + return UINT8_MAX; +#endif +} + +// Scans integer for index of first nonzero bit from the Most Significant Bit (MSB). If mask is 0 then returns UINT8_MAX +static UINT8 BitScanMSB(UINT64 mask) +{ +#if defined(_MSC_VER) && defined(_WIN64) + unsigned long pos; + if (_BitScanReverse64(&pos, mask)) + return static_cast<UINT8>(pos); +#elif defined __GNUC__ || defined __clang__ + if (mask) + return 63 - static_cast<UINT8>(__builtin_clzll(mask)); +#else + UINT8 pos = 63; + UINT64 bit = 1ULL << 63; + do + { + if (mask & bit) + return pos; + bit >>= 1; + } while (pos-- > 0); +#endif + return UINT8_MAX; +} +// Scans integer for index of first nonzero bit from the Most Significant Bit (MSB). If mask is 0 then returns UINT8_MAX +static UINT8 BitScanMSB(UINT32 mask) +{ +#ifdef _MSC_VER + unsigned long pos; + if (_BitScanReverse(&pos, mask)) + return static_cast<UINT8>(pos); +#elif defined __GNUC__ || defined __clang__ + if (mask) + return 31 - static_cast<UINT8>(__builtin_clz(mask)); +#else + UINT8 pos = 31; + UINT32 bit = 1UL << 31; + do + { + if (mask & bit) + return pos; + bit >>= 1; + } while (pos-- > 0); +#endif + return UINT8_MAX; +} + +/* +Returns true if given number is a power of two. +T must be unsigned integer number or signed integer but always nonnegative. +For 0 returns true. +*/ +template <typename T> +static bool IsPow2(T x) { return (x & (x - 1)) == 0; } + +// Aligns given value up to nearest multiply of align value. For example: AlignUp(11, 8) = 16. +// Use types like UINT, uint64_t as T. +template <typename T> +static T AlignUp(T val, T alignment) +{ + D3D12MA_HEAVY_ASSERT(IsPow2(alignment)); + return (val + alignment - 1) & ~(alignment - 1); +} +// Aligns given value down to nearest multiply of align value. For example: AlignUp(11, 8) = 8. +// Use types like UINT, uint64_t as T. +template <typename T> +static T AlignDown(T val, T alignment) +{ + D3D12MA_HEAVY_ASSERT(IsPow2(alignment)); + return val & ~(alignment - 1); +} + +// Division with mathematical rounding to nearest number. +template <typename T> +static T RoundDiv(T x, T y) { return (x + (y / (T)2)) / y; } +template <typename T> +static T DivideRoundingUp(T x, T y) { return (x + y - 1) / y; } + +static WCHAR HexDigitToChar(UINT8 digit) +{ + if(digit < 10) + return L'0' + digit; + else + return L'A' + (digit - 10); +} + +/* +Performs binary search and returns iterator to first element that is greater or +equal to `key`, according to comparison `cmp`. + +Cmp should return true if first argument is less than second argument. + +Returned value is the found element, if present in the collection or place where +new element with value (key) should be inserted. +*/ +template <typename CmpLess, typename IterT, typename KeyT> +static IterT BinaryFindFirstNotLess(IterT beg, IterT end, const KeyT& key, const CmpLess& cmp) +{ + size_t down = 0, up = (end - beg); + while (down < up) + { + const size_t mid = (down + up) / 2; + if (cmp(*(beg + mid), key)) + { + down = mid + 1; + } + else + { + up = mid; + } + } + return beg + down; +} + +/* +Performs binary search and returns iterator to an element that is equal to `key`, +according to comparison `cmp`. + +Cmp should return true if first argument is less than second argument. + +Returned value is the found element, if present in the collection or end if not +found. +*/ +template<typename CmpLess, typename IterT, typename KeyT> +static IterT BinaryFindSorted(const IterT& beg, const IterT& end, const KeyT& value, const CmpLess& cmp) +{ + IterT it = BinaryFindFirstNotLess<CmpLess, IterT, KeyT>(beg, end, value, cmp); + if (it == end || + (!cmp(*it, value) && !cmp(value, *it))) + { + return it; + } + return end; +} + +static UINT HeapTypeToIndex(D3D12_HEAP_TYPE type) +{ + switch (type) + { + case D3D12_HEAP_TYPE_DEFAULT: return 0; + case D3D12_HEAP_TYPE_UPLOAD: return 1; + case D3D12_HEAP_TYPE_READBACK: return 2; + case D3D12_HEAP_TYPE_CUSTOM: return 3; + default: D3D12MA_ASSERT(0); return UINT_MAX; + } +} + +static D3D12_HEAP_TYPE IndexToHeapType(UINT heapTypeIndex) +{ + D3D12MA_ASSERT(heapTypeIndex < 4); + // D3D12_HEAP_TYPE_DEFAULT starts at 1. + return (D3D12_HEAP_TYPE)(heapTypeIndex + 1); +} + +static UINT64 HeapFlagsToAlignment(D3D12_HEAP_FLAGS flags, bool denyMsaaTextures) +{ + /* + Documentation of D3D12_HEAP_DESC structure says: + + - D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT defined as 64KB. + - D3D12_DEFAULT_MSAA_RESOURCE_PLACEMENT_ALIGNMENT defined as 4MB. An + application must decide whether the heap will contain multi-sample + anti-aliasing (MSAA), in which case, the application must choose [this flag]. + + https://docs.microsoft.com/en-us/windows/desktop/api/d3d12/ns-d3d12-d3d12_heap_desc + */ + + if (denyMsaaTextures) + return D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT; + + const D3D12_HEAP_FLAGS denyAllTexturesFlags = + D3D12_HEAP_FLAG_DENY_NON_RT_DS_TEXTURES | D3D12_HEAP_FLAG_DENY_RT_DS_TEXTURES; + const bool canContainAnyTextures = + (flags & denyAllTexturesFlags) != denyAllTexturesFlags; + return canContainAnyTextures ? + D3D12_DEFAULT_MSAA_RESOURCE_PLACEMENT_ALIGNMENT : D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT; +} + +static ResourceClass HeapFlagsToResourceClass(D3D12_HEAP_FLAGS heapFlags) +{ + const bool allowBuffers = (heapFlags & D3D12_HEAP_FLAG_DENY_BUFFERS) == 0; + const bool allowRtDsTextures = (heapFlags & D3D12_HEAP_FLAG_DENY_RT_DS_TEXTURES) == 0; + const bool allowNonRtDsTextures = (heapFlags & D3D12_HEAP_FLAG_DENY_NON_RT_DS_TEXTURES) == 0; + + const uint8_t allowedGroupCount = (allowBuffers ? 1 : 0) + (allowRtDsTextures ? 1 : 0) + (allowNonRtDsTextures ? 1 : 0); + if (allowedGroupCount != 1) + return ResourceClass::Unknown; + + if (allowRtDsTextures) + return ResourceClass::RT_DS_Texture; + if (allowNonRtDsTextures) + return ResourceClass::Non_RT_DS_Texture; + return ResourceClass::Buffer; +} + +static bool IsHeapTypeStandard(D3D12_HEAP_TYPE type) +{ + return type == D3D12_HEAP_TYPE_DEFAULT || + type == D3D12_HEAP_TYPE_UPLOAD || + type == D3D12_HEAP_TYPE_READBACK; +} + +static D3D12_HEAP_PROPERTIES StandardHeapTypeToHeapProperties(D3D12_HEAP_TYPE type) +{ + D3D12MA_ASSERT(IsHeapTypeStandard(type)); + D3D12_HEAP_PROPERTIES result = {}; + result.Type = type; + return result; +} + +static bool IsFormatCompressed(DXGI_FORMAT format) +{ + switch (format) + { + case DXGI_FORMAT_BC1_TYPELESS: + case DXGI_FORMAT_BC1_UNORM: + case DXGI_FORMAT_BC1_UNORM_SRGB: + case DXGI_FORMAT_BC2_TYPELESS: + case DXGI_FORMAT_BC2_UNORM: + case DXGI_FORMAT_BC2_UNORM_SRGB: + case DXGI_FORMAT_BC3_TYPELESS: + case DXGI_FORMAT_BC3_UNORM: + case DXGI_FORMAT_BC3_UNORM_SRGB: + case DXGI_FORMAT_BC4_TYPELESS: + case DXGI_FORMAT_BC4_UNORM: + case DXGI_FORMAT_BC4_SNORM: + case DXGI_FORMAT_BC5_TYPELESS: + case DXGI_FORMAT_BC5_UNORM: + case DXGI_FORMAT_BC5_SNORM: + case DXGI_FORMAT_BC6H_TYPELESS: + case DXGI_FORMAT_BC6H_UF16: + case DXGI_FORMAT_BC6H_SF16: + case DXGI_FORMAT_BC7_TYPELESS: + case DXGI_FORMAT_BC7_UNORM: + case DXGI_FORMAT_BC7_UNORM_SRGB: + return true; + default: + return false; + } +} + +// Only some formats are supported. For others it returns 0. +static UINT GetBitsPerPixel(DXGI_FORMAT format) +{ + switch (format) + { + case DXGI_FORMAT_R32G32B32A32_TYPELESS: + case DXGI_FORMAT_R32G32B32A32_FLOAT: + case DXGI_FORMAT_R32G32B32A32_UINT: + case DXGI_FORMAT_R32G32B32A32_SINT: + return 128; + case DXGI_FORMAT_R32G32B32_TYPELESS: + case DXGI_FORMAT_R32G32B32_FLOAT: + case DXGI_FORMAT_R32G32B32_UINT: + case DXGI_FORMAT_R32G32B32_SINT: + return 96; + case DXGI_FORMAT_R16G16B16A16_TYPELESS: + case DXGI_FORMAT_R16G16B16A16_FLOAT: + case DXGI_FORMAT_R16G16B16A16_UNORM: + case DXGI_FORMAT_R16G16B16A16_UINT: + case DXGI_FORMAT_R16G16B16A16_SNORM: + case DXGI_FORMAT_R16G16B16A16_SINT: + return 64; + case DXGI_FORMAT_R32G32_TYPELESS: + case DXGI_FORMAT_R32G32_FLOAT: + case DXGI_FORMAT_R32G32_UINT: + case DXGI_FORMAT_R32G32_SINT: + return 64; + case DXGI_FORMAT_R32G8X24_TYPELESS: + case DXGI_FORMAT_D32_FLOAT_S8X24_UINT: + case DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS: + case DXGI_FORMAT_X32_TYPELESS_G8X24_UINT: + return 64; + case DXGI_FORMAT_R10G10B10A2_TYPELESS: + case DXGI_FORMAT_R10G10B10A2_UNORM: + case DXGI_FORMAT_R10G10B10A2_UINT: + case DXGI_FORMAT_R11G11B10_FLOAT: + return 32; + case DXGI_FORMAT_R8G8B8A8_TYPELESS: + case DXGI_FORMAT_R8G8B8A8_UNORM: + case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB: + case DXGI_FORMAT_R8G8B8A8_UINT: + case DXGI_FORMAT_R8G8B8A8_SNORM: + case DXGI_FORMAT_R8G8B8A8_SINT: + return 32; + case DXGI_FORMAT_R16G16_TYPELESS: + case DXGI_FORMAT_R16G16_FLOAT: + case DXGI_FORMAT_R16G16_UNORM: + case DXGI_FORMAT_R16G16_UINT: + case DXGI_FORMAT_R16G16_SNORM: + case DXGI_FORMAT_R16G16_SINT: + return 32; + case DXGI_FORMAT_R32_TYPELESS: + case DXGI_FORMAT_D32_FLOAT: + case DXGI_FORMAT_R32_FLOAT: + case DXGI_FORMAT_R32_UINT: + case DXGI_FORMAT_R32_SINT: + return 32; + case DXGI_FORMAT_R24G8_TYPELESS: + case DXGI_FORMAT_D24_UNORM_S8_UINT: + case DXGI_FORMAT_R24_UNORM_X8_TYPELESS: + case DXGI_FORMAT_X24_TYPELESS_G8_UINT: + return 32; + case DXGI_FORMAT_R8G8_TYPELESS: + case DXGI_FORMAT_R8G8_UNORM: + case DXGI_FORMAT_R8G8_UINT: + case DXGI_FORMAT_R8G8_SNORM: + case DXGI_FORMAT_R8G8_SINT: + return 16; + case DXGI_FORMAT_R16_TYPELESS: + case DXGI_FORMAT_R16_FLOAT: + case DXGI_FORMAT_D16_UNORM: + case DXGI_FORMAT_R16_UNORM: + case DXGI_FORMAT_R16_UINT: + case DXGI_FORMAT_R16_SNORM: + case DXGI_FORMAT_R16_SINT: + return 16; + case DXGI_FORMAT_R8_TYPELESS: + case DXGI_FORMAT_R8_UNORM: + case DXGI_FORMAT_R8_UINT: + case DXGI_FORMAT_R8_SNORM: + case DXGI_FORMAT_R8_SINT: + case DXGI_FORMAT_A8_UNORM: + return 8; + case DXGI_FORMAT_BC1_TYPELESS: + case DXGI_FORMAT_BC1_UNORM: + case DXGI_FORMAT_BC1_UNORM_SRGB: + return 4; + case DXGI_FORMAT_BC2_TYPELESS: + case DXGI_FORMAT_BC2_UNORM: + case DXGI_FORMAT_BC2_UNORM_SRGB: + return 8; + case DXGI_FORMAT_BC3_TYPELESS: + case DXGI_FORMAT_BC3_UNORM: + case DXGI_FORMAT_BC3_UNORM_SRGB: + return 8; + case DXGI_FORMAT_BC4_TYPELESS: + case DXGI_FORMAT_BC4_UNORM: + case DXGI_FORMAT_BC4_SNORM: + return 4; + case DXGI_FORMAT_BC5_TYPELESS: + case DXGI_FORMAT_BC5_UNORM: + case DXGI_FORMAT_BC5_SNORM: + return 8; + case DXGI_FORMAT_BC6H_TYPELESS: + case DXGI_FORMAT_BC6H_UF16: + case DXGI_FORMAT_BC6H_SF16: + return 8; + case DXGI_FORMAT_BC7_TYPELESS: + case DXGI_FORMAT_BC7_UNORM: + case DXGI_FORMAT_BC7_UNORM_SRGB: + return 8; + default: + return 0; + } +} + +template<typename D3D12_RESOURCE_DESC_T> +static ResourceClass ResourceDescToResourceClass(const D3D12_RESOURCE_DESC_T& resDesc) +{ + if (resDesc.Dimension == D3D12_RESOURCE_DIMENSION_BUFFER) + return ResourceClass::Buffer; + // Else: it's surely a texture. + const bool isRenderTargetOrDepthStencil = + (resDesc.Flags & (D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET | D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL)) != 0; + return isRenderTargetOrDepthStencil ? ResourceClass::RT_DS_Texture : ResourceClass::Non_RT_DS_Texture; +} + +// This algorithm is overly conservative. +template<typename D3D12_RESOURCE_DESC_T> +static bool CanUseSmallAlignment(const D3D12_RESOURCE_DESC_T& resourceDesc) +{ + if (resourceDesc.Dimension != D3D12_RESOURCE_DIMENSION_TEXTURE2D) + return false; + if ((resourceDesc.Flags & (D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET | D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL)) != 0) + return false; + if (resourceDesc.SampleDesc.Count > 1) + return false; + if (resourceDesc.DepthOrArraySize != 1) + return false; + + UINT sizeX = (UINT)resourceDesc.Width; + UINT sizeY = resourceDesc.Height; + UINT bitsPerPixel = GetBitsPerPixel(resourceDesc.Format); + if (bitsPerPixel == 0) + return false; + + if (IsFormatCompressed(resourceDesc.Format)) + { + sizeX = DivideRoundingUp(sizeX, 4u); + sizeY = DivideRoundingUp(sizeY, 4u); + bitsPerPixel *= 16; + } + + UINT tileSizeX = 0, tileSizeY = 0; + switch (bitsPerPixel) + { + case 8: tileSizeX = 64; tileSizeY = 64; break; + case 16: tileSizeX = 64; tileSizeY = 32; break; + case 32: tileSizeX = 32; tileSizeY = 32; break; + case 64: tileSizeX = 32; tileSizeY = 16; break; + case 128: tileSizeX = 16; tileSizeY = 16; break; + default: return false; + } + + const UINT tileCount = DivideRoundingUp(sizeX, tileSizeX) * DivideRoundingUp(sizeY, tileSizeY); + return tileCount <= 16; +} + +static bool ValidateAllocateMemoryParameters( + const ALLOCATION_DESC* pAllocDesc, + const D3D12_RESOURCE_ALLOCATION_INFO* pAllocInfo, + Allocation** ppAllocation) +{ + return pAllocDesc && + pAllocInfo && + ppAllocation && + (pAllocInfo->Alignment == 0 || + pAllocInfo->Alignment == D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT || + pAllocInfo->Alignment == D3D12_DEFAULT_MSAA_RESOURCE_PLACEMENT_ALIGNMENT) && + pAllocInfo->SizeInBytes != 0 && + pAllocInfo->SizeInBytes % (64ull * 1024) == 0; +} + +#endif // _D3D12MA_FUNCTIONS + +#ifndef _D3D12MA_STATISTICS_FUNCTIONS + +static void ClearStatistics(Statistics& outStats) +{ + outStats.BlockCount = 0; + outStats.AllocationCount = 0; + outStats.BlockBytes = 0; + outStats.AllocationBytes = 0; +} + +static void ClearDetailedStatistics(DetailedStatistics& outStats) +{ + ClearStatistics(outStats.Stats); + outStats.UnusedRangeCount = 0; + outStats.AllocationSizeMin = UINT64_MAX; + outStats.AllocationSizeMax = 0; + outStats.UnusedRangeSizeMin = UINT64_MAX; + outStats.UnusedRangeSizeMax = 0; +} + +static void AddStatistics(Statistics& inoutStats, const Statistics& src) +{ + inoutStats.BlockCount += src.BlockCount; + inoutStats.AllocationCount += src.AllocationCount; + inoutStats.BlockBytes += src.BlockBytes; + inoutStats.AllocationBytes += src.AllocationBytes; +} + +static void AddDetailedStatistics(DetailedStatistics& inoutStats, const DetailedStatistics& src) +{ + AddStatistics(inoutStats.Stats, src.Stats); + inoutStats.UnusedRangeCount += src.UnusedRangeCount; + inoutStats.AllocationSizeMin = D3D12MA_MIN(inoutStats.AllocationSizeMin, src.AllocationSizeMin); + inoutStats.AllocationSizeMax = D3D12MA_MAX(inoutStats.AllocationSizeMax, src.AllocationSizeMax); + inoutStats.UnusedRangeSizeMin = D3D12MA_MIN(inoutStats.UnusedRangeSizeMin, src.UnusedRangeSizeMin); + inoutStats.UnusedRangeSizeMax = D3D12MA_MAX(inoutStats.UnusedRangeSizeMax, src.UnusedRangeSizeMax); +} + +static void AddDetailedStatisticsAllocation(DetailedStatistics& inoutStats, UINT64 size) +{ + inoutStats.Stats.AllocationCount++; + inoutStats.Stats.AllocationBytes += size; + inoutStats.AllocationSizeMin = D3D12MA_MIN(inoutStats.AllocationSizeMin, size); + inoutStats.AllocationSizeMax = D3D12MA_MAX(inoutStats.AllocationSizeMax, size); +} + +static void AddDetailedStatisticsUnusedRange(DetailedStatistics& inoutStats, UINT64 size) +{ + inoutStats.UnusedRangeCount++; + inoutStats.UnusedRangeSizeMin = D3D12MA_MIN(inoutStats.UnusedRangeSizeMin, size); + inoutStats.UnusedRangeSizeMax = D3D12MA_MAX(inoutStats.UnusedRangeSizeMax, size); +} + +#endif // _D3D12MA_STATISTICS_FUNCTIONS + + +#ifndef _D3D12MA_MUTEX + +#ifndef D3D12MA_MUTEX + class Mutex + { + public: + void Lock() { m_Mutex.lock(); } + void Unlock() { m_Mutex.unlock(); } + + private: + std::mutex m_Mutex; + }; + #define D3D12MA_MUTEX Mutex +#endif + +#ifndef D3D12MA_RW_MUTEX +#ifdef _WIN32 + class RWMutex + { + public: + RWMutex() { InitializeSRWLock(&m_Lock); } + void LockRead() { AcquireSRWLockShared(&m_Lock); } + void UnlockRead() { ReleaseSRWLockShared(&m_Lock); } + void LockWrite() { AcquireSRWLockExclusive(&m_Lock); } + void UnlockWrite() { ReleaseSRWLockExclusive(&m_Lock); } + + private: + SRWLOCK m_Lock; + }; +#else // #ifdef _WIN32 + class RWMutex + { + public: + RWMutex() {} + void LockRead() { m_Mutex.lock_shared(); } + void UnlockRead() { m_Mutex.unlock_shared(); } + void LockWrite() { m_Mutex.lock(); } + void UnlockWrite() { m_Mutex.unlock(); } + + private: + std::shared_timed_mutex m_Mutex; + }; +#endif // #ifdef _WIN32 + #define D3D12MA_RW_MUTEX RWMutex +#endif // #ifndef D3D12MA_RW_MUTEX + +// Helper RAII class to lock a mutex in constructor and unlock it in destructor (at the end of scope). +struct MutexLock +{ + D3D12MA_CLASS_NO_COPY(MutexLock); +public: + MutexLock(D3D12MA_MUTEX& mutex, bool useMutex = true) : + m_pMutex(useMutex ? &mutex : NULL) + { + if (m_pMutex) m_pMutex->Lock(); + } + ~MutexLock() { if (m_pMutex) m_pMutex->Unlock(); } + +private: + D3D12MA_MUTEX* m_pMutex; +}; + +// Helper RAII class to lock a RW mutex in constructor and unlock it in destructor (at the end of scope), for reading. +struct MutexLockRead +{ + D3D12MA_CLASS_NO_COPY(MutexLockRead); +public: + MutexLockRead(D3D12MA_RW_MUTEX& mutex, bool useMutex) + : m_pMutex(useMutex ? &mutex : NULL) + { + if(m_pMutex) + { + m_pMutex->LockRead(); + } + } + ~MutexLockRead() { if (m_pMutex) m_pMutex->UnlockRead(); } + +private: + D3D12MA_RW_MUTEX* m_pMutex; +}; + +// Helper RAII class to lock a RW mutex in constructor and unlock it in destructor (at the end of scope), for writing. +struct MutexLockWrite +{ + D3D12MA_CLASS_NO_COPY(MutexLockWrite); +public: + MutexLockWrite(D3D12MA_RW_MUTEX& mutex, bool useMutex) + : m_pMutex(useMutex ? &mutex : NULL) + { + if (m_pMutex) m_pMutex->LockWrite(); + } + ~MutexLockWrite() { if (m_pMutex) m_pMutex->UnlockWrite(); } + +private: + D3D12MA_RW_MUTEX* m_pMutex; +}; + +#if D3D12MA_DEBUG_GLOBAL_MUTEX + static D3D12MA_MUTEX g_DebugGlobalMutex; + #define D3D12MA_DEBUG_GLOBAL_MUTEX_LOCK MutexLock debugGlobalMutexLock(g_DebugGlobalMutex, true); +#else + #define D3D12MA_DEBUG_GLOBAL_MUTEX_LOCK +#endif +#endif // _D3D12MA_MUTEX + +#ifndef _D3D12MA_VECTOR +/* +Dynamically resizing continuous array. Class with interface similar to std::vector. +T must be POD because constructors and destructors are not called and memcpy is +used for these objects. +*/ +template<typename T> +class Vector +{ +public: + using value_type = T; + using iterator = T*; + using const_iterator = const T*; + + // allocationCallbacks externally owned, must outlive this object. + Vector(const ALLOCATION_CALLBACKS& allocationCallbacks); + Vector(size_t count, const ALLOCATION_CALLBACKS& allocationCallbacks); + Vector(const Vector<T>& src); + ~Vector(); + + const ALLOCATION_CALLBACKS& GetAllocs() const { return m_AllocationCallbacks; } + bool empty() const { return m_Count == 0; } + size_t size() const { return m_Count; } + T* data() { return m_pArray; } + const T* data() const { return m_pArray; } + void clear(bool freeMemory = false) { resize(0, freeMemory); } + + iterator begin() { return m_pArray; } + iterator end() { return m_pArray + m_Count; } + const_iterator cbegin() const { return m_pArray; } + const_iterator cend() const { return m_pArray + m_Count; } + const_iterator begin() const { return cbegin(); } + const_iterator end() const { return cend(); } + + void push_front(const T& src) { insert(0, src); } + void push_back(const T& src); + void pop_front(); + void pop_back(); + + T& front(); + T& back(); + const T& front() const; + const T& back() const; + + void reserve(size_t newCapacity, bool freeMemory = false); + void resize(size_t newCount, bool freeMemory = false); + void insert(size_t index, const T& src); + void remove(size_t index); + + template<typename CmpLess> + size_t InsertSorted(const T& value, const CmpLess& cmp); + template<typename CmpLess> + bool RemoveSorted(const T& value, const CmpLess& cmp); + + Vector& operator=(const Vector<T>& rhs); + T& operator[](size_t index); + const T& operator[](size_t index) const; + +private: + const ALLOCATION_CALLBACKS& m_AllocationCallbacks; + T* m_pArray; + size_t m_Count; + size_t m_Capacity; +}; + +#ifndef _D3D12MA_VECTOR_FUNCTIONS +template<typename T> +Vector<T>::Vector(const ALLOCATION_CALLBACKS& allocationCallbacks) + : m_AllocationCallbacks(allocationCallbacks), + m_pArray(NULL), + m_Count(0), + m_Capacity(0) {} + +template<typename T> +Vector<T>::Vector(size_t count, const ALLOCATION_CALLBACKS& allocationCallbacks) + : m_AllocationCallbacks(allocationCallbacks), + m_pArray(count ? AllocateArray<T>(allocationCallbacks, count) : NULL), + m_Count(count), + m_Capacity(count) {} + +template<typename T> +Vector<T>::Vector(const Vector<T>& src) + : m_AllocationCallbacks(src.m_AllocationCallbacks), + m_pArray(src.m_Count ? AllocateArray<T>(src.m_AllocationCallbacks, src.m_Count) : NULL), + m_Count(src.m_Count), + m_Capacity(src.m_Count) +{ + if (m_Count > 0) + { + memcpy(m_pArray, src.m_pArray, m_Count * sizeof(T)); + } +} + +template<typename T> +Vector<T>::~Vector() +{ + Free(m_AllocationCallbacks, m_pArray); +} + +template<typename T> +void Vector<T>::push_back(const T& src) +{ + const size_t newIndex = size(); + resize(newIndex + 1); + m_pArray[newIndex] = src; +} + +template<typename T> +void Vector<T>::pop_front() +{ + D3D12MA_HEAVY_ASSERT(m_Count > 0); + remove(0); +} + +template<typename T> +void Vector<T>::pop_back() +{ + D3D12MA_HEAVY_ASSERT(m_Count > 0); + resize(size() - 1); +} + +template<typename T> +T& Vector<T>::front() +{ + D3D12MA_HEAVY_ASSERT(m_Count > 0); + return m_pArray[0]; +} + +template<typename T> +T& Vector<T>::back() +{ + D3D12MA_HEAVY_ASSERT(m_Count > 0); + return m_pArray[m_Count - 1]; +} + +template<typename T> +const T& Vector<T>::front() const +{ + D3D12MA_HEAVY_ASSERT(m_Count > 0); + return m_pArray[0]; +} + +template<typename T> +const T& Vector<T>::back() const +{ + D3D12MA_HEAVY_ASSERT(m_Count > 0); + return m_pArray[m_Count - 1]; +} + +template<typename T> +void Vector<T>::reserve(size_t newCapacity, bool freeMemory) +{ + newCapacity = D3D12MA_MAX(newCapacity, m_Count); + + if ((newCapacity < m_Capacity) && !freeMemory) + { + newCapacity = m_Capacity; + } + + if (newCapacity != m_Capacity) + { + T* const newArray = newCapacity ? AllocateArray<T>(m_AllocationCallbacks, newCapacity) : NULL; + if (m_Count != 0) + { + memcpy(newArray, m_pArray, m_Count * sizeof(T)); + } + Free(m_AllocationCallbacks, m_pArray); + m_Capacity = newCapacity; + m_pArray = newArray; + } +} + +template<typename T> +void Vector<T>::resize(size_t newCount, bool freeMemory) +{ + size_t newCapacity = m_Capacity; + if (newCount > m_Capacity) + { + newCapacity = D3D12MA_MAX(newCount, D3D12MA_MAX(m_Capacity * 3 / 2, (size_t)8)); + } + else if (freeMemory) + { + newCapacity = newCount; + } + + if (newCapacity != m_Capacity) + { + T* const newArray = newCapacity ? AllocateArray<T>(m_AllocationCallbacks, newCapacity) : NULL; + const size_t elementsToCopy = D3D12MA_MIN(m_Count, newCount); + if (elementsToCopy != 0) + { + memcpy(newArray, m_pArray, elementsToCopy * sizeof(T)); + } + Free(m_AllocationCallbacks, m_pArray); + m_Capacity = newCapacity; + m_pArray = newArray; + } + + m_Count = newCount; +} + +template<typename T> +void Vector<T>::insert(size_t index, const T& src) +{ + D3D12MA_HEAVY_ASSERT(index <= m_Count); + const size_t oldCount = size(); + resize(oldCount + 1); + if (index < oldCount) + { + memmove(m_pArray + (index + 1), m_pArray + index, (oldCount - index) * sizeof(T)); + } + m_pArray[index] = src; +} + +template<typename T> +void Vector<T>::remove(size_t index) +{ + D3D12MA_HEAVY_ASSERT(index < m_Count); + const size_t oldCount = size(); + if (index < oldCount - 1) + { + memmove(m_pArray + index, m_pArray + (index + 1), (oldCount - index - 1) * sizeof(T)); + } + resize(oldCount - 1); +} + +template<typename T> template<typename CmpLess> +size_t Vector<T>::InsertSorted(const T& value, const CmpLess& cmp) +{ + const size_t indexToInsert = BinaryFindFirstNotLess<CmpLess, iterator, T>( + m_pArray, + m_pArray + m_Count, + value, + cmp) - m_pArray; + insert(indexToInsert, value); + return indexToInsert; +} + +template<typename T> template<typename CmpLess> +bool Vector<T>::RemoveSorted(const T& value, const CmpLess& cmp) +{ + const iterator it = BinaryFindFirstNotLess( + m_pArray, + m_pArray + m_Count, + value, + cmp); + if ((it != end()) && !cmp(*it, value) && !cmp(value, *it)) + { + size_t indexToRemove = it - begin(); + remove(indexToRemove); + return true; + } + return false; +} + +template<typename T> +Vector<T>& Vector<T>::operator=(const Vector<T>& rhs) +{ + if (&rhs != this) + { + resize(rhs.m_Count); + if (m_Count != 0) + { + memcpy(m_pArray, rhs.m_pArray, m_Count * sizeof(T)); + } + } + return *this; +} + +template<typename T> +T& Vector<T>::operator[](size_t index) +{ + D3D12MA_HEAVY_ASSERT(index < m_Count); + return m_pArray[index]; +} + +template<typename T> +const T& Vector<T>::operator[](size_t index) const +{ + D3D12MA_HEAVY_ASSERT(index < m_Count); + return m_pArray[index]; +} +#endif // _D3D12MA_VECTOR_FUNCTIONS +#endif // _D3D12MA_VECTOR + +#ifndef _D3D12MA_STRING_BUILDER +class StringBuilder +{ +public: + StringBuilder(const ALLOCATION_CALLBACKS& allocationCallbacks) : m_Data(allocationCallbacks) {} + + size_t GetLength() const { return m_Data.size(); } + LPCWSTR GetData() const { return m_Data.data(); } + + void Add(WCHAR ch) { m_Data.push_back(ch); } + void Add(LPCWSTR str); + void AddNewLine() { Add(L'\n'); } + void AddNumber(UINT num); + void AddNumber(UINT64 num); + void AddPointer(const void* ptr); + +private: + Vector<WCHAR> m_Data; +}; + +#ifndef _D3D12MA_STRING_BUILDER_FUNCTIONS +void StringBuilder::Add(LPCWSTR str) +{ + const size_t len = wcslen(str); + if (len > 0) + { + const size_t oldCount = m_Data.size(); + m_Data.resize(oldCount + len); + memcpy(m_Data.data() + oldCount, str, len * sizeof(WCHAR)); + } +} + +void StringBuilder::AddNumber(UINT num) +{ + WCHAR buf[11]; + buf[10] = L'\0'; + WCHAR *p = &buf[10]; + do + { + *--p = L'0' + (num % 10); + num /= 10; + } + while (num); + Add(p); +} + +void StringBuilder::AddNumber(UINT64 num) +{ + WCHAR buf[21]; + buf[20] = L'\0'; + WCHAR *p = &buf[20]; + do + { + *--p = L'0' + (num % 10); + num /= 10; + } + while (num); + Add(p); +} + +void StringBuilder::AddPointer(const void* ptr) +{ + WCHAR buf[21]; + uintptr_t num = (uintptr_t)ptr; + buf[20] = L'\0'; + WCHAR *p = &buf[20]; + do + { + *--p = HexDigitToChar((UINT8)(num & 0xF)); + num >>= 4; + } + while (num); + Add(p); +} + +#endif // _D3D12MA_STRING_BUILDER_FUNCTIONS +#endif // _D3D12MA_STRING_BUILDER + +#ifndef _D3D12MA_JSON_WRITER +/* +Allows to conveniently build a correct JSON document to be written to the +StringBuilder passed to the constructor. +*/ +class JsonWriter +{ +public: + // stringBuilder - string builder to write the document to. Must remain alive for the whole lifetime of this object. + JsonWriter(const ALLOCATION_CALLBACKS& allocationCallbacks, StringBuilder& stringBuilder); + ~JsonWriter(); + + // Begins object by writing "{". + // Inside an object, you must call pairs of WriteString and a value, e.g.: + // j.BeginObject(true); j.WriteString("A"); j.WriteNumber(1); j.WriteString("B"); j.WriteNumber(2); j.EndObject(); + // Will write: { "A": 1, "B": 2 } + void BeginObject(bool singleLine = false); + // Ends object by writing "}". + void EndObject(); + + // Begins array by writing "[". + // Inside an array, you can write a sequence of any values. + void BeginArray(bool singleLine = false); + // Ends array by writing "[". + void EndArray(); + + // Writes a string value inside "". + // pStr can contain any UTF-16 characters, including '"', new line etc. - they will be properly escaped. + void WriteString(LPCWSTR pStr); + + // Begins writing a string value. + // Call BeginString, ContinueString, ContinueString, ..., EndString instead of + // WriteString to conveniently build the string content incrementally, made of + // parts including numbers. + void BeginString(LPCWSTR pStr = NULL); + // Posts next part of an open string. + void ContinueString(LPCWSTR pStr); + // Posts next part of an open string. The number is converted to decimal characters. + void ContinueString(UINT num); + void ContinueString(UINT64 num); + void ContinueString_Pointer(const void* ptr); + // Posts next part of an open string. Pointer value is converted to characters + // using "%p" formatting - shown as hexadecimal number, e.g.: 000000081276Ad00 + // void ContinueString_Pointer(const void* ptr); + // Ends writing a string value by writing '"'. + void EndString(LPCWSTR pStr = NULL); + + // Writes a number value. + void WriteNumber(UINT num); + void WriteNumber(UINT64 num); + // Writes a boolean value - false or true. + void WriteBool(bool b); + // Writes a null value. + void WriteNull(); + + void AddAllocationToObject(const Allocation& alloc); + void AddDetailedStatisticsInfoObject(const DetailedStatistics& stats); + +private: + static const WCHAR* const INDENT; + + enum CollectionType + { + COLLECTION_TYPE_OBJECT, + COLLECTION_TYPE_ARRAY, + }; + struct StackItem + { + CollectionType type; + UINT valueCount; + bool singleLineMode; + }; + + StringBuilder& m_SB; + Vector<StackItem> m_Stack; + bool m_InsideString; + + void BeginValue(bool isString); + void WriteIndent(bool oneLess = false); +}; + +#ifndef _D3D12MA_JSON_WRITER_FUNCTIONS +const WCHAR* const JsonWriter::INDENT = L" "; + +JsonWriter::JsonWriter(const ALLOCATION_CALLBACKS& allocationCallbacks, StringBuilder& stringBuilder) + : m_SB(stringBuilder), + m_Stack(allocationCallbacks), + m_InsideString(false) {} + +JsonWriter::~JsonWriter() +{ + D3D12MA_ASSERT(!m_InsideString); + D3D12MA_ASSERT(m_Stack.empty()); +} + +void JsonWriter::BeginObject(bool singleLine) +{ + D3D12MA_ASSERT(!m_InsideString); + + BeginValue(false); + m_SB.Add(L'{'); + + StackItem stackItem; + stackItem.type = COLLECTION_TYPE_OBJECT; + stackItem.valueCount = 0; + stackItem.singleLineMode = singleLine; + m_Stack.push_back(stackItem); +} + +void JsonWriter::EndObject() +{ + D3D12MA_ASSERT(!m_InsideString); + D3D12MA_ASSERT(!m_Stack.empty() && m_Stack.back().type == COLLECTION_TYPE_OBJECT); + D3D12MA_ASSERT(m_Stack.back().valueCount % 2 == 0); + + WriteIndent(true); + m_SB.Add(L'}'); + + m_Stack.pop_back(); +} + +void JsonWriter::BeginArray(bool singleLine) +{ + D3D12MA_ASSERT(!m_InsideString); + + BeginValue(false); + m_SB.Add(L'['); + + StackItem stackItem; + stackItem.type = COLLECTION_TYPE_ARRAY; + stackItem.valueCount = 0; + stackItem.singleLineMode = singleLine; + m_Stack.push_back(stackItem); +} + +void JsonWriter::EndArray() +{ + D3D12MA_ASSERT(!m_InsideString); + D3D12MA_ASSERT(!m_Stack.empty() && m_Stack.back().type == COLLECTION_TYPE_ARRAY); + + WriteIndent(true); + m_SB.Add(L']'); + + m_Stack.pop_back(); +} + +void JsonWriter::WriteString(LPCWSTR pStr) +{ + BeginString(pStr); + EndString(); +} + +void JsonWriter::BeginString(LPCWSTR pStr) +{ + D3D12MA_ASSERT(!m_InsideString); + + BeginValue(true); + m_InsideString = true; + m_SB.Add(L'"'); + if (pStr != NULL) + { + ContinueString(pStr); + } +} + +void JsonWriter::ContinueString(LPCWSTR pStr) +{ + D3D12MA_ASSERT(m_InsideString); + D3D12MA_ASSERT(pStr); + + for (const WCHAR *p = pStr; *p; ++p) + { + // the strings we encode are assumed to be in UTF-16LE format, the native + // windows wide character Unicode format. In this encoding Unicode code + // points U+0000 to U+D7FF and U+E000 to U+FFFF are encoded in two bytes, + // and everything else takes more than two bytes. We will reject any + // multi wchar character encodings for simplicity. + UINT val = (UINT)*p; + D3D12MA_ASSERT(((val <= 0xD7FF) || (0xE000 <= val && val <= 0xFFFF)) && + "Character not currently supported."); + switch (*p) + { + case L'"': m_SB.Add(L'\\'); m_SB.Add(L'"'); break; + case L'\\': m_SB.Add(L'\\'); m_SB.Add(L'\\'); break; + case L'/': m_SB.Add(L'\\'); m_SB.Add(L'/'); break; + case L'\b': m_SB.Add(L'\\'); m_SB.Add(L'b'); break; + case L'\f': m_SB.Add(L'\\'); m_SB.Add(L'f'); break; + case L'\n': m_SB.Add(L'\\'); m_SB.Add(L'n'); break; + case L'\r': m_SB.Add(L'\\'); m_SB.Add(L'r'); break; + case L'\t': m_SB.Add(L'\\'); m_SB.Add(L't'); break; + default: + // conservatively use encoding \uXXXX for any Unicode character + // requiring more than one byte. + if (32 <= val && val < 256) + m_SB.Add(*p); + else + { + m_SB.Add(L'\\'); + m_SB.Add(L'u'); + for (UINT i = 0; i < 4; ++i) + { + UINT hexDigit = (val & 0xF000) >> 12; + val <<= 4; + if (hexDigit < 10) + m_SB.Add(L'0' + (WCHAR)hexDigit); + else + m_SB.Add(L'A' + (WCHAR)hexDigit); + } + } + break; + } + } +} + +void JsonWriter::ContinueString(UINT num) +{ + D3D12MA_ASSERT(m_InsideString); + m_SB.AddNumber(num); +} + +void JsonWriter::ContinueString(UINT64 num) +{ + D3D12MA_ASSERT(m_InsideString); + m_SB.AddNumber(num); +} + +void JsonWriter::ContinueString_Pointer(const void* ptr) +{ + D3D12MA_ASSERT(m_InsideString); + m_SB.AddPointer(ptr); +} + +void JsonWriter::EndString(LPCWSTR pStr) +{ + D3D12MA_ASSERT(m_InsideString); + + if (pStr) + ContinueString(pStr); + m_SB.Add(L'"'); + m_InsideString = false; +} + +void JsonWriter::WriteNumber(UINT num) +{ + D3D12MA_ASSERT(!m_InsideString); + BeginValue(false); + m_SB.AddNumber(num); +} + +void JsonWriter::WriteNumber(UINT64 num) +{ + D3D12MA_ASSERT(!m_InsideString); + BeginValue(false); + m_SB.AddNumber(num); +} + +void JsonWriter::WriteBool(bool b) +{ + D3D12MA_ASSERT(!m_InsideString); + BeginValue(false); + if (b) + m_SB.Add(L"true"); + else + m_SB.Add(L"false"); +} + +void JsonWriter::WriteNull() +{ + D3D12MA_ASSERT(!m_InsideString); + BeginValue(false); + m_SB.Add(L"null"); +} + +void JsonWriter::AddAllocationToObject(const Allocation& alloc) +{ + WriteString(L"Type"); + switch (alloc.m_PackedData.GetResourceDimension()) { + case D3D12_RESOURCE_DIMENSION_UNKNOWN: + WriteString(L"UNKNOWN"); + break; + case D3D12_RESOURCE_DIMENSION_BUFFER: + WriteString(L"BUFFER"); + break; + case D3D12_RESOURCE_DIMENSION_TEXTURE1D: + WriteString(L"TEXTURE1D"); + break; + case D3D12_RESOURCE_DIMENSION_TEXTURE2D: + WriteString(L"TEXTURE2D"); + break; + case D3D12_RESOURCE_DIMENSION_TEXTURE3D: + WriteString(L"TEXTURE3D"); + break; + default: D3D12MA_ASSERT(0); break; + } + + WriteString(L"Size"); + WriteNumber(alloc.GetSize()); + WriteString(L"Usage"); + WriteNumber((UINT)alloc.m_PackedData.GetResourceFlags()); + + void* privateData = alloc.GetPrivateData(); + if (privateData) + { + WriteString(L"CustomData"); + BeginString(); + ContinueString_Pointer(privateData); + EndString(); + } + + LPCWSTR name = alloc.GetName(); + if (name != NULL) + { + WriteString(L"Name"); + WriteString(name); + } + if (alloc.m_PackedData.GetTextureLayout()) + { + WriteString(L"Layout"); + WriteNumber((UINT)alloc.m_PackedData.GetTextureLayout()); + } +} + +void JsonWriter::AddDetailedStatisticsInfoObject(const DetailedStatistics& stats) +{ + BeginObject(); + + WriteString(L"BlockCount"); + WriteNumber(stats.Stats.BlockCount); + WriteString(L"BlockBytes"); + WriteNumber(stats.Stats.BlockBytes); + WriteString(L"AllocationCount"); + WriteNumber(stats.Stats.AllocationCount); + WriteString(L"AllocationBytes"); + WriteNumber(stats.Stats.AllocationBytes); + WriteString(L"UnusedRangeCount"); + WriteNumber(stats.UnusedRangeCount); + + if (stats.Stats.AllocationCount > 1) + { + WriteString(L"AllocationSizeMin"); + WriteNumber(stats.AllocationSizeMin); + WriteString(L"AllocationSizeMax"); + WriteNumber(stats.AllocationSizeMax); + } + if (stats.UnusedRangeCount > 1) + { + WriteString(L"UnusedRangeSizeMin"); + WriteNumber(stats.UnusedRangeSizeMin); + WriteString(L"UnusedRangeSizeMax"); + WriteNumber(stats.UnusedRangeSizeMax); + } + EndObject(); +} + +void JsonWriter::BeginValue(bool isString) +{ + if (!m_Stack.empty()) + { + StackItem& currItem = m_Stack.back(); + if (currItem.type == COLLECTION_TYPE_OBJECT && currItem.valueCount % 2 == 0) + { + D3D12MA_ASSERT(isString); + } + + if (currItem.type == COLLECTION_TYPE_OBJECT && currItem.valueCount % 2 == 1) + { + m_SB.Add(L':'); m_SB.Add(L' '); + } + else if (currItem.valueCount > 0) + { + m_SB.Add(L','); m_SB.Add(L' '); + WriteIndent(); + } + else + { + WriteIndent(); + } + ++currItem.valueCount; + } +} + +void JsonWriter::WriteIndent(bool oneLess) +{ + if (!m_Stack.empty() && !m_Stack.back().singleLineMode) + { + m_SB.AddNewLine(); + + size_t count = m_Stack.size(); + if (count > 0 && oneLess) + { + --count; + } + for (size_t i = 0; i < count; ++i) + { + m_SB.Add(INDENT); + } + } +} +#endif // _D3D12MA_JSON_WRITER_FUNCTIONS +#endif // _D3D12MA_JSON_WRITER + +#ifndef _D3D12MA_POOL_ALLOCATOR +/* +Allocator for objects of type T using a list of arrays (pools) to speed up +allocation. Number of elements that can be allocated is not bounded because +allocator can create multiple blocks. +T should be POD because constructor and destructor is not called in Alloc or +Free. +*/ +template<typename T> +class PoolAllocator +{ + D3D12MA_CLASS_NO_COPY(PoolAllocator) +public: + // allocationCallbacks externally owned, must outlive this object. + PoolAllocator(const ALLOCATION_CALLBACKS& allocationCallbacks, UINT firstBlockCapacity); + ~PoolAllocator() { Clear(); } + + void Clear(); + template<typename... Types> + T* Alloc(Types... args); + void Free(T* ptr); + +private: + union Item + { + UINT NextFreeIndex; // UINT32_MAX means end of list. + alignas(T) char Value[sizeof(T)]; + }; + + struct ItemBlock + { + Item* pItems; + UINT Capacity; + UINT FirstFreeIndex; + }; + + const ALLOCATION_CALLBACKS& m_AllocationCallbacks; + const UINT m_FirstBlockCapacity; + Vector<ItemBlock> m_ItemBlocks; + + ItemBlock& CreateNewBlock(); +}; + +#ifndef _D3D12MA_POOL_ALLOCATOR_FUNCTIONS +template<typename T> +PoolAllocator<T>::PoolAllocator(const ALLOCATION_CALLBACKS& allocationCallbacks, UINT firstBlockCapacity) + : m_AllocationCallbacks(allocationCallbacks), + m_FirstBlockCapacity(firstBlockCapacity), + m_ItemBlocks(allocationCallbacks) +{ + D3D12MA_ASSERT(m_FirstBlockCapacity > 1); +} + +template<typename T> +void PoolAllocator<T>::Clear() +{ + for(size_t i = m_ItemBlocks.size(); i--; ) + { + D3D12MA_DELETE_ARRAY(m_AllocationCallbacks, m_ItemBlocks[i].pItems, m_ItemBlocks[i].Capacity); + } + m_ItemBlocks.clear(true); +} + +template<typename T> template<typename... Types> +T* PoolAllocator<T>::Alloc(Types... args) +{ + for(size_t i = m_ItemBlocks.size(); i--; ) + { + ItemBlock& block = m_ItemBlocks[i]; + // This block has some free items: Use first one. + if(block.FirstFreeIndex != UINT32_MAX) + { + Item* const pItem = &block.pItems[block.FirstFreeIndex]; + block.FirstFreeIndex = pItem->NextFreeIndex; + T* result = (T*)&pItem->Value; + new(result)T(std::forward<Types>(args)...); // Explicit constructor call. + return result; + } + } + + // No block has free item: Create new one and use it. + ItemBlock& newBlock = CreateNewBlock(); + Item* const pItem = &newBlock.pItems[0]; + newBlock.FirstFreeIndex = pItem->NextFreeIndex; + T* result = (T*)pItem->Value; + new(result)T(std::forward<Types>(args)...); // Explicit constructor call. + return result; +} + +template<typename T> +void PoolAllocator<T>::Free(T* ptr) +{ + // Search all memory blocks to find ptr. + for(size_t i = m_ItemBlocks.size(); i--; ) + { + ItemBlock& block = m_ItemBlocks[i]; + + Item* pItemPtr; + memcpy(&pItemPtr, &ptr, sizeof(pItemPtr)); + + // Check if pItemPtr is in address range of this block. + if((pItemPtr >= block.pItems) && (pItemPtr < block.pItems + block.Capacity)) + { + ptr->~T(); // Explicit destructor call. + const UINT index = static_cast<UINT>(pItemPtr - block.pItems); + pItemPtr->NextFreeIndex = block.FirstFreeIndex; + block.FirstFreeIndex = index; + return; + } + } + D3D12MA_ASSERT(0 && "Pointer doesn't belong to this memory pool."); +} + +template<typename T> +typename PoolAllocator<T>::ItemBlock& PoolAllocator<T>::CreateNewBlock() +{ + const UINT newBlockCapacity = m_ItemBlocks.empty() ? + m_FirstBlockCapacity : m_ItemBlocks.back().Capacity * 3 / 2; + + const ItemBlock newBlock = { + D3D12MA_NEW_ARRAY(m_AllocationCallbacks, Item, newBlockCapacity), + newBlockCapacity, + 0 }; + + m_ItemBlocks.push_back(newBlock); + + // Setup singly-linked list of all free items in this block. + for(UINT i = 0; i < newBlockCapacity - 1; ++i) + { + newBlock.pItems[i].NextFreeIndex = i + 1; + } + newBlock.pItems[newBlockCapacity - 1].NextFreeIndex = UINT32_MAX; + return m_ItemBlocks.back(); +} +#endif // _D3D12MA_POOL_ALLOCATOR_FUNCTIONS +#endif // _D3D12MA_POOL_ALLOCATOR + +#ifndef _D3D12MA_LIST +/* +Doubly linked list, with elements allocated out of PoolAllocator. +Has custom interface, as well as STL-style interface, including iterator and +const_iterator. +*/ +template<typename T> +class List +{ + D3D12MA_CLASS_NO_COPY(List) +public: + struct Item + { + Item* pPrev; + Item* pNext; + T Value; + }; + + class reverse_iterator; + class const_reverse_iterator; + class iterator + { + friend class List<T>; + friend class const_iterator; + + public: + iterator() = default; + iterator(const reverse_iterator& src) + : m_pList(src.m_pList), m_pItem(src.m_pItem) {} + + T& operator*() const; + T* operator->() const; + + iterator& operator++(); + iterator& operator--(); + iterator operator++(int); + iterator operator--(int); + + bool operator==(const iterator& rhs) const; + bool operator!=(const iterator& rhs) const; + + private: + List<T>* m_pList = NULL; + Item* m_pItem = NULL; + + iterator(List<T>* pList, Item* pItem) : m_pList(pList), m_pItem(pItem) {} + }; + + class reverse_iterator + { + friend class List<T>; + friend class const_reverse_iterator; + + public: + reverse_iterator() = default; + reverse_iterator(const iterator& src) + : m_pList(src.m_pList), m_pItem(src.m_pItem) {} + + T& operator*() const; + T* operator->() const; + + reverse_iterator& operator++(); + reverse_iterator& operator--(); + reverse_iterator operator++(int); + reverse_iterator operator--(int); + + bool operator==(const reverse_iterator& rhs) const; + bool operator!=(const reverse_iterator& rhs) const; + + private: + List<T>* m_pList = NULL; + Item* m_pItem = NULL; + + reverse_iterator(List<T>* pList, Item* pItem) + : m_pList(pList), m_pItem(pItem) {} + }; + + class const_iterator + { + friend class List<T>; + + public: + const_iterator() = default; + const_iterator(const iterator& src) + : m_pList(src.m_pList), m_pItem(src.m_pItem) {} + const_iterator(const reverse_iterator& src) + : m_pList(src.m_pList), m_pItem(src.m_pItem) {} + const_iterator(const const_reverse_iterator& src) + : m_pList(src.m_pList), m_pItem(src.m_pItem) {} + + iterator dropConst() const; + const T& operator*() const; + const T* operator->() const; + + const_iterator& operator++(); + const_iterator& operator--(); + const_iterator operator++(int); + const_iterator operator--(int); + + bool operator==(const const_iterator& rhs) const; + bool operator!=(const const_iterator& rhs) const; + + private: + const List<T>* m_pList = NULL; + const Item* m_pItem = NULL; + + const_iterator(const List<T>* pList, const Item* pItem) + : m_pList(pList), m_pItem(pItem) {} + }; + + class const_reverse_iterator + { + friend class List<T>; + + public: + const_reverse_iterator() = default; + const_reverse_iterator(const iterator& src) + : m_pList(src.m_pList), m_pItem(src.m_pItem) {} + const_reverse_iterator(const reverse_iterator& src) + : m_pList(src.m_pList), m_pItem(src.m_pItem) {} + const_reverse_iterator(const const_iterator& src) + : m_pList(src.m_pList), m_pItem(src.m_pItem) {} + + reverse_iterator dropConst() const; + const T& operator*() const; + const T* operator->() const; + + const_reverse_iterator& operator++(); + const_reverse_iterator& operator--(); + const_reverse_iterator operator++(int); + const_reverse_iterator operator--(int); + + bool operator==(const const_reverse_iterator& rhs) const; + bool operator!=(const const_reverse_iterator& rhs) const; + + private: + const List<T>* m_pList = NULL; + const Item* m_pItem = NULL; + + const_reverse_iterator(const List<T>* pList, const Item* pItem) + : m_pList(pList), m_pItem(pItem) {} + }; + + // allocationCallbacks externally owned, must outlive this object. + List(const ALLOCATION_CALLBACKS& allocationCallbacks); + // Intentionally not calling Clear, because that would be unnecessary + // computations to return all items to m_ItemAllocator as free. + ~List() = default; + + size_t GetCount() const { return m_Count; } + bool IsEmpty() const { return m_Count == 0; } + + Item* Front() { return m_pFront; } + const Item* Front() const { return m_pFront; } + Item* Back() { return m_pBack; } + const Item* Back() const { return m_pBack; } + + bool empty() const { return IsEmpty(); } + size_t size() const { return GetCount(); } + void push_back(const T& value) { PushBack(value); } + iterator insert(iterator it, const T& value) { return iterator(this, InsertBefore(it.m_pItem, value)); } + void clear() { Clear(); } + void erase(iterator it) { Remove(it.m_pItem); } + + iterator begin() { return iterator(this, Front()); } + iterator end() { return iterator(this, NULL); } + reverse_iterator rbegin() { return reverse_iterator(this, Back()); } + reverse_iterator rend() { return reverse_iterator(this, NULL); } + + const_iterator cbegin() const { return const_iterator(this, Front()); } + const_iterator cend() const { return const_iterator(this, NULL); } + const_iterator begin() const { return cbegin(); } + const_iterator end() const { return cend(); } + + const_reverse_iterator crbegin() const { return const_reverse_iterator(this, Back()); } + const_reverse_iterator crend() const { return const_reverse_iterator(this, NULL); } + const_reverse_iterator rbegin() const { return crbegin(); } + const_reverse_iterator rend() const { return crend(); } + + Item* PushBack(); + Item* PushFront(); + Item* PushBack(const T& value); + Item* PushFront(const T& value); + void PopBack(); + void PopFront(); + + // Item can be null - it means PushBack. + Item* InsertBefore(Item* pItem); + // Item can be null - it means PushFront. + Item* InsertAfter(Item* pItem); + Item* InsertBefore(Item* pItem, const T& value); + Item* InsertAfter(Item* pItem, const T& value); + + void Clear(); + void Remove(Item* pItem); + +private: + const ALLOCATION_CALLBACKS& m_AllocationCallbacks; + PoolAllocator<Item> m_ItemAllocator; + Item* m_pFront; + Item* m_pBack; + size_t m_Count; +}; + +#ifndef _D3D12MA_LIST_ITERATOR_FUNCTIONS +template<typename T> +T& List<T>::iterator::operator*() const +{ + D3D12MA_HEAVY_ASSERT(m_pItem != NULL); + return m_pItem->Value; +} + +template<typename T> +T* List<T>::iterator::operator->() const +{ + D3D12MA_HEAVY_ASSERT(m_pItem != NULL); + return &m_pItem->Value; +} + +template<typename T> +typename List<T>::iterator& List<T>::iterator::operator++() +{ + D3D12MA_HEAVY_ASSERT(m_pItem != NULL); + m_pItem = m_pItem->pNext; + return *this; +} + +template<typename T> +typename List<T>::iterator& List<T>::iterator::operator--() +{ + if (m_pItem != NULL) + { + m_pItem = m_pItem->pPrev; + } + else + { + D3D12MA_HEAVY_ASSERT(!m_pList->IsEmpty()); + m_pItem = m_pList->Back(); + } + return *this; +} + +template<typename T> +typename List<T>::iterator List<T>::iterator::operator++(int) +{ + iterator result = *this; + ++* this; + return result; +} + +template<typename T> +typename List<T>::iterator List<T>::iterator::operator--(int) +{ + iterator result = *this; + --* this; + return result; +} + +template<typename T> +bool List<T>::iterator::operator==(const iterator& rhs) const +{ + D3D12MA_HEAVY_ASSERT(m_pList == rhs.m_pList); + return m_pItem == rhs.m_pItem; +} + +template<typename T> +bool List<T>::iterator::operator!=(const iterator& rhs) const +{ + D3D12MA_HEAVY_ASSERT(m_pList == rhs.m_pList); + return m_pItem != rhs.m_pItem; +} +#endif // _D3D12MA_LIST_ITERATOR_FUNCTIONS + +#ifndef _D3D12MA_LIST_REVERSE_ITERATOR_FUNCTIONS +template<typename T> +T& List<T>::reverse_iterator::operator*() const +{ + D3D12MA_HEAVY_ASSERT(m_pItem != NULL); + return m_pItem->Value; +} + +template<typename T> +T* List<T>::reverse_iterator::operator->() const +{ + D3D12MA_HEAVY_ASSERT(m_pItem != NULL); + return &m_pItem->Value; +} + +template<typename T> +typename List<T>::reverse_iterator& List<T>::reverse_iterator::operator++() +{ + D3D12MA_HEAVY_ASSERT(m_pItem != NULL); + m_pItem = m_pItem->pPrev; + return *this; +} + +template<typename T> +typename List<T>::reverse_iterator& List<T>::reverse_iterator::operator--() +{ + if (m_pItem != NULL) + { + m_pItem = m_pItem->pNext; + } + else + { + D3D12MA_HEAVY_ASSERT(!m_pList->IsEmpty()); + m_pItem = m_pList->Front(); + } + return *this; +} + +template<typename T> +typename List<T>::reverse_iterator List<T>::reverse_iterator::operator++(int) +{ + reverse_iterator result = *this; + ++* this; + return result; +} + +template<typename T> +typename List<T>::reverse_iterator List<T>::reverse_iterator::operator--(int) +{ + reverse_iterator result = *this; + --* this; + return result; +} + +template<typename T> +bool List<T>::reverse_iterator::operator==(const reverse_iterator& rhs) const +{ + D3D12MA_HEAVY_ASSERT(m_pList == rhs.m_pList); + return m_pItem == rhs.m_pItem; +} + +template<typename T> +bool List<T>::reverse_iterator::operator!=(const reverse_iterator& rhs) const +{ + D3D12MA_HEAVY_ASSERT(m_pList == rhs.m_pList); + return m_pItem != rhs.m_pItem; +} +#endif // _D3D12MA_LIST_REVERSE_ITERATOR_FUNCTIONS + +#ifndef _D3D12MA_LIST_CONST_ITERATOR_FUNCTIONS +template<typename T> +typename List<T>::iterator List<T>::const_iterator::dropConst() const +{ + return iterator(const_cast<List<T>*>(m_pList), const_cast<Item*>(m_pItem)); +} + +template<typename T> +const T& List<T>::const_iterator::operator*() const +{ + D3D12MA_HEAVY_ASSERT(m_pItem != NULL); + return m_pItem->Value; +} + +template<typename T> +const T* List<T>::const_iterator::operator->() const +{ + D3D12MA_HEAVY_ASSERT(m_pItem != NULL); + return &m_pItem->Value; +} + +template<typename T> +typename List<T>::const_iterator& List<T>::const_iterator::operator++() +{ + D3D12MA_HEAVY_ASSERT(m_pItem != NULL); + m_pItem = m_pItem->pNext; + return *this; +} + +template<typename T> +typename List<T>::const_iterator& List<T>::const_iterator::operator--() +{ + if (m_pItem != NULL) + { + m_pItem = m_pItem->pPrev; + } + else + { + D3D12MA_HEAVY_ASSERT(!m_pList->IsEmpty()); + m_pItem = m_pList->Back(); + } + return *this; +} + +template<typename T> +typename List<T>::const_iterator List<T>::const_iterator::operator++(int) +{ + const_iterator result = *this; + ++* this; + return result; +} + +template<typename T> +typename List<T>::const_iterator List<T>::const_iterator::operator--(int) +{ + const_iterator result = *this; + --* this; + return result; +} + +template<typename T> +bool List<T>::const_iterator::operator==(const const_iterator& rhs) const +{ + D3D12MA_HEAVY_ASSERT(m_pList == rhs.m_pList); + return m_pItem == rhs.m_pItem; +} + +template<typename T> +bool List<T>::const_iterator::operator!=(const const_iterator& rhs) const +{ + D3D12MA_HEAVY_ASSERT(m_pList == rhs.m_pList); + return m_pItem != rhs.m_pItem; +} +#endif // _D3D12MA_LIST_CONST_ITERATOR_FUNCTIONS + +#ifndef _D3D12MA_LIST_CONST_REVERSE_ITERATOR_FUNCTIONS +template<typename T> +typename List<T>::reverse_iterator List<T>::const_reverse_iterator::dropConst() const +{ + return reverse_iterator(const_cast<List<T>*>(m_pList), const_cast<Item*>(m_pItem)); +} + +template<typename T> +const T& List<T>::const_reverse_iterator::operator*() const +{ + D3D12MA_HEAVY_ASSERT(m_pItem != NULL); + return m_pItem->Value; +} + +template<typename T> +const T* List<T>::const_reverse_iterator::operator->() const +{ + D3D12MA_HEAVY_ASSERT(m_pItem != NULL); + return &m_pItem->Value; +} + +template<typename T> +typename List<T>::const_reverse_iterator& List<T>::const_reverse_iterator::operator++() +{ + D3D12MA_HEAVY_ASSERT(m_pItem != NULL); + m_pItem = m_pItem->pPrev; + return *this; +} + +template<typename T> +typename List<T>::const_reverse_iterator& List<T>::const_reverse_iterator::operator--() +{ + if (m_pItem != NULL) + { + m_pItem = m_pItem->pNext; + } + else + { + D3D12MA_HEAVY_ASSERT(!m_pList->IsEmpty()); + m_pItem = m_pList->Front(); + } + return *this; +} + +template<typename T> +typename List<T>::const_reverse_iterator List<T>::const_reverse_iterator::operator++(int) +{ + const_reverse_iterator result = *this; + ++* this; + return result; +} + +template<typename T> +typename List<T>::const_reverse_iterator List<T>::const_reverse_iterator::operator--(int) +{ + const_reverse_iterator result = *this; + --* this; + return result; +} + +template<typename T> +bool List<T>::const_reverse_iterator::operator==(const const_reverse_iterator& rhs) const +{ + D3D12MA_HEAVY_ASSERT(m_pList == rhs.m_pList); + return m_pItem == rhs.m_pItem; +} + +template<typename T> +bool List<T>::const_reverse_iterator::operator!=(const const_reverse_iterator& rhs) const +{ + D3D12MA_HEAVY_ASSERT(m_pList == rhs.m_pList); + return m_pItem != rhs.m_pItem; +} +#endif // _D3D12MA_LIST_CONST_REVERSE_ITERATOR_FUNCTIONS + +#ifndef _D3D12MA_LIST_FUNCTIONS +template<typename T> +List<T>::List(const ALLOCATION_CALLBACKS& allocationCallbacks) + : m_AllocationCallbacks(allocationCallbacks), + m_ItemAllocator(allocationCallbacks, 128), + m_pFront(NULL), + m_pBack(NULL), + m_Count(0) {} + +template<typename T> +void List<T>::Clear() +{ + if(!IsEmpty()) + { + Item* pItem = m_pBack; + while(pItem != NULL) + { + Item* const pPrevItem = pItem->pPrev; + m_ItemAllocator.Free(pItem); + pItem = pPrevItem; + } + m_pFront = NULL; + m_pBack = NULL; + m_Count = 0; + } +} + +template<typename T> +typename List<T>::Item* List<T>::PushBack() +{ + Item* const pNewItem = m_ItemAllocator.Alloc(); + pNewItem->pNext = NULL; + if(IsEmpty()) + { + pNewItem->pPrev = NULL; + m_pFront = pNewItem; + m_pBack = pNewItem; + m_Count = 1; + } + else + { + pNewItem->pPrev = m_pBack; + m_pBack->pNext = pNewItem; + m_pBack = pNewItem; + ++m_Count; + } + return pNewItem; +} + +template<typename T> +typename List<T>::Item* List<T>::PushFront() +{ + Item* const pNewItem = m_ItemAllocator.Alloc(); + pNewItem->pPrev = NULL; + if(IsEmpty()) + { + pNewItem->pNext = NULL; + m_pFront = pNewItem; + m_pBack = pNewItem; + m_Count = 1; + } + else + { + pNewItem->pNext = m_pFront; + m_pFront->pPrev = pNewItem; + m_pFront = pNewItem; + ++m_Count; + } + return pNewItem; +} + +template<typename T> +typename List<T>::Item* List<T>::PushBack(const T& value) +{ + Item* const pNewItem = PushBack(); + pNewItem->Value = value; + return pNewItem; +} + +template<typename T> +typename List<T>::Item* List<T>::PushFront(const T& value) +{ + Item* const pNewItem = PushFront(); + pNewItem->Value = value; + return pNewItem; +} + +template<typename T> +void List<T>::PopBack() +{ + D3D12MA_HEAVY_ASSERT(m_Count > 0); + Item* const pBackItem = m_pBack; + Item* const pPrevItem = pBackItem->pPrev; + if(pPrevItem != NULL) + { + pPrevItem->pNext = NULL; + } + m_pBack = pPrevItem; + m_ItemAllocator.Free(pBackItem); + --m_Count; +} + +template<typename T> +void List<T>::PopFront() +{ + D3D12MA_HEAVY_ASSERT(m_Count > 0); + Item* const pFrontItem = m_pFront; + Item* const pNextItem = pFrontItem->pNext; + if(pNextItem != NULL) + { + pNextItem->pPrev = NULL; + } + m_pFront = pNextItem; + m_ItemAllocator.Free(pFrontItem); + --m_Count; +} + +template<typename T> +void List<T>::Remove(Item* pItem) +{ + D3D12MA_HEAVY_ASSERT(pItem != NULL); + D3D12MA_HEAVY_ASSERT(m_Count > 0); + + if(pItem->pPrev != NULL) + { + pItem->pPrev->pNext = pItem->pNext; + } + else + { + D3D12MA_HEAVY_ASSERT(m_pFront == pItem); + m_pFront = pItem->pNext; + } + + if(pItem->pNext != NULL) + { + pItem->pNext->pPrev = pItem->pPrev; + } + else + { + D3D12MA_HEAVY_ASSERT(m_pBack == pItem); + m_pBack = pItem->pPrev; + } + + m_ItemAllocator.Free(pItem); + --m_Count; +} + +template<typename T> +typename List<T>::Item* List<T>::InsertBefore(Item* pItem) +{ + if(pItem != NULL) + { + Item* const prevItem = pItem->pPrev; + Item* const newItem = m_ItemAllocator.Alloc(); + newItem->pPrev = prevItem; + newItem->pNext = pItem; + pItem->pPrev = newItem; + if(prevItem != NULL) + { + prevItem->pNext = newItem; + } + else + { + D3D12MA_HEAVY_ASSERT(m_pFront == pItem); + m_pFront = newItem; + } + ++m_Count; + return newItem; + } + else + { + return PushBack(); + } +} + +template<typename T> +typename List<T>::Item* List<T>::InsertAfter(Item* pItem) +{ + if(pItem != NULL) + { + Item* const nextItem = pItem->pNext; + Item* const newItem = m_ItemAllocator.Alloc(); + newItem->pNext = nextItem; + newItem->pPrev = pItem; + pItem->pNext = newItem; + if(nextItem != NULL) + { + nextItem->pPrev = newItem; + } + else + { + D3D12MA_HEAVY_ASSERT(m_pBack == pItem); + m_pBack = newItem; + } + ++m_Count; + return newItem; + } + else + return PushFront(); +} + +template<typename T> +typename List<T>::Item* List<T>::InsertBefore(Item* pItem, const T& value) +{ + Item* const newItem = InsertBefore(pItem); + newItem->Value = value; + return newItem; +} + +template<typename T> +typename List<T>::Item* List<T>::InsertAfter(Item* pItem, const T& value) +{ + Item* const newItem = InsertAfter(pItem); + newItem->Value = value; + return newItem; +} +#endif // _D3D12MA_LIST_FUNCTIONS +#endif // _D3D12MA_LIST + +#ifndef _D3D12MA_INTRUSIVE_LINKED_LIST +/* +Expected interface of ItemTypeTraits: +struct MyItemTypeTraits +{ + using ItemType = MyItem; + static ItemType* GetPrev(const ItemType* item) { return item->myPrevPtr; } + static ItemType* GetNext(const ItemType* item) { return item->myNextPtr; } + static ItemType*& AccessPrev(ItemType* item) { return item->myPrevPtr; } + static ItemType*& AccessNext(ItemType* item) { return item->myNextPtr; } +}; +*/ +template<typename ItemTypeTraits> +class IntrusiveLinkedList +{ +public: + using ItemType = typename ItemTypeTraits::ItemType; + static ItemType* GetPrev(const ItemType* item) { return ItemTypeTraits::GetPrev(item); } + static ItemType* GetNext(const ItemType* item) { return ItemTypeTraits::GetNext(item); } + + // Movable, not copyable. + IntrusiveLinkedList() = default; + IntrusiveLinkedList(const IntrusiveLinkedList&) = delete; + IntrusiveLinkedList(IntrusiveLinkedList&& src); + IntrusiveLinkedList& operator=(const IntrusiveLinkedList&) = delete; + IntrusiveLinkedList& operator=(IntrusiveLinkedList&& src); + ~IntrusiveLinkedList() { D3D12MA_HEAVY_ASSERT(IsEmpty()); } + + size_t GetCount() const { return m_Count; } + bool IsEmpty() const { return m_Count == 0; } + + ItemType* Front() { return m_Front; } + ItemType* Back() { return m_Back; } + const ItemType* Front() const { return m_Front; } + const ItemType* Back() const { return m_Back; } + + void PushBack(ItemType* item); + void PushFront(ItemType* item); + ItemType* PopBack(); + ItemType* PopFront(); + + // MyItem can be null - it means PushBack. + void InsertBefore(ItemType* existingItem, ItemType* newItem); + // MyItem can be null - it means PushFront. + void InsertAfter(ItemType* existingItem, ItemType* newItem); + + void Remove(ItemType* item); + void RemoveAll(); + +private: + ItemType* m_Front = NULL; + ItemType* m_Back = NULL; + size_t m_Count = 0; +}; + +#ifndef _D3D12MA_INTRUSIVE_LINKED_LIST_FUNCTIONS +template<typename ItemTypeTraits> +IntrusiveLinkedList<ItemTypeTraits>::IntrusiveLinkedList(IntrusiveLinkedList&& src) + : m_Front(src.m_Front), m_Back(src.m_Back), m_Count(src.m_Count) +{ + src.m_Front = src.m_Back = NULL; + src.m_Count = 0; +} + +template<typename ItemTypeTraits> +IntrusiveLinkedList<ItemTypeTraits>& IntrusiveLinkedList<ItemTypeTraits>::operator=(IntrusiveLinkedList&& src) +{ + if (&src != this) + { + D3D12MA_HEAVY_ASSERT(IsEmpty()); + m_Front = src.m_Front; + m_Back = src.m_Back; + m_Count = src.m_Count; + src.m_Front = src.m_Back = NULL; + src.m_Count = 0; + } + return *this; +} + +template<typename ItemTypeTraits> +void IntrusiveLinkedList<ItemTypeTraits>::PushBack(ItemType* item) +{ + D3D12MA_HEAVY_ASSERT(ItemTypeTraits::GetPrev(item) == NULL && ItemTypeTraits::GetNext(item) == NULL); + if (IsEmpty()) + { + m_Front = item; + m_Back = item; + m_Count = 1; + } + else + { + ItemTypeTraits::AccessPrev(item) = m_Back; + ItemTypeTraits::AccessNext(m_Back) = item; + m_Back = item; + ++m_Count; + } +} + +template<typename ItemTypeTraits> +void IntrusiveLinkedList<ItemTypeTraits>::PushFront(ItemType* item) +{ + D3D12MA_HEAVY_ASSERT(ItemTypeTraits::GetPrev(item) == NULL && ItemTypeTraits::GetNext(item) == NULL); + if (IsEmpty()) + { + m_Front = item; + m_Back = item; + m_Count = 1; + } + else + { + ItemTypeTraits::AccessNext(item) = m_Front; + ItemTypeTraits::AccessPrev(m_Front) = item; + m_Front = item; + ++m_Count; + } +} + +template<typename ItemTypeTraits> +typename IntrusiveLinkedList<ItemTypeTraits>::ItemType* IntrusiveLinkedList<ItemTypeTraits>::PopBack() +{ + D3D12MA_HEAVY_ASSERT(m_Count > 0); + ItemType* const backItem = m_Back; + ItemType* const prevItem = ItemTypeTraits::GetPrev(backItem); + if (prevItem != NULL) + { + ItemTypeTraits::AccessNext(prevItem) = NULL; + } + m_Back = prevItem; + --m_Count; + ItemTypeTraits::AccessPrev(backItem) = NULL; + ItemTypeTraits::AccessNext(backItem) = NULL; + return backItem; +} + +template<typename ItemTypeTraits> +typename IntrusiveLinkedList<ItemTypeTraits>::ItemType* IntrusiveLinkedList<ItemTypeTraits>::PopFront() +{ + D3D12MA_HEAVY_ASSERT(m_Count > 0); + ItemType* const frontItem = m_Front; + ItemType* const nextItem = ItemTypeTraits::GetNext(frontItem); + if (nextItem != NULL) + { + ItemTypeTraits::AccessPrev(nextItem) = NULL; + } + m_Front = nextItem; + --m_Count; + ItemTypeTraits::AccessPrev(frontItem) = NULL; + ItemTypeTraits::AccessNext(frontItem) = NULL; + return frontItem; +} + +template<typename ItemTypeTraits> +void IntrusiveLinkedList<ItemTypeTraits>::InsertBefore(ItemType* existingItem, ItemType* newItem) +{ + D3D12MA_HEAVY_ASSERT(newItem != NULL && ItemTypeTraits::GetPrev(newItem) == NULL && ItemTypeTraits::GetNext(newItem) == NULL); + if (existingItem != NULL) + { + ItemType* const prevItem = ItemTypeTraits::GetPrev(existingItem); + ItemTypeTraits::AccessPrev(newItem) = prevItem; + ItemTypeTraits::AccessNext(newItem) = existingItem; + ItemTypeTraits::AccessPrev(existingItem) = newItem; + if (prevItem != NULL) + { + ItemTypeTraits::AccessNext(prevItem) = newItem; + } + else + { + D3D12MA_HEAVY_ASSERT(m_Front == existingItem); + m_Front = newItem; + } + ++m_Count; + } + else + PushBack(newItem); +} + +template<typename ItemTypeTraits> +void IntrusiveLinkedList<ItemTypeTraits>::InsertAfter(ItemType* existingItem, ItemType* newItem) +{ + D3D12MA_HEAVY_ASSERT(newItem != NULL && ItemTypeTraits::GetPrev(newItem) == NULL && ItemTypeTraits::GetNext(newItem) == NULL); + if (existingItem != NULL) + { + ItemType* const nextItem = ItemTypeTraits::GetNext(existingItem); + ItemTypeTraits::AccessNext(newItem) = nextItem; + ItemTypeTraits::AccessPrev(newItem) = existingItem; + ItemTypeTraits::AccessNext(existingItem) = newItem; + if (nextItem != NULL) + { + ItemTypeTraits::AccessPrev(nextItem) = newItem; + } + else + { + D3D12MA_HEAVY_ASSERT(m_Back == existingItem); + m_Back = newItem; + } + ++m_Count; + } + else + return PushFront(newItem); +} + +template<typename ItemTypeTraits> +void IntrusiveLinkedList<ItemTypeTraits>::Remove(ItemType* item) +{ + D3D12MA_HEAVY_ASSERT(item != NULL && m_Count > 0); + if (ItemTypeTraits::GetPrev(item) != NULL) + { + ItemTypeTraits::AccessNext(ItemTypeTraits::AccessPrev(item)) = ItemTypeTraits::GetNext(item); + } + else + { + D3D12MA_HEAVY_ASSERT(m_Front == item); + m_Front = ItemTypeTraits::GetNext(item); + } + + if (ItemTypeTraits::GetNext(item) != NULL) + { + ItemTypeTraits::AccessPrev(ItemTypeTraits::AccessNext(item)) = ItemTypeTraits::GetPrev(item); + } + else + { + D3D12MA_HEAVY_ASSERT(m_Back == item); + m_Back = ItemTypeTraits::GetPrev(item); + } + ItemTypeTraits::AccessPrev(item) = NULL; + ItemTypeTraits::AccessNext(item) = NULL; + --m_Count; +} + +template<typename ItemTypeTraits> +void IntrusiveLinkedList<ItemTypeTraits>::RemoveAll() +{ + if (!IsEmpty()) + { + ItemType* item = m_Back; + while (item != NULL) + { + ItemType* const prevItem = ItemTypeTraits::AccessPrev(item); + ItemTypeTraits::AccessPrev(item) = NULL; + ItemTypeTraits::AccessNext(item) = NULL; + item = prevItem; + } + m_Front = NULL; + m_Back = NULL; + m_Count = 0; + } +} +#endif // _D3D12MA_INTRUSIVE_LINKED_LIST_FUNCTIONS +#endif // _D3D12MA_INTRUSIVE_LINKED_LIST + +#ifndef _D3D12MA_ALLOCATION_OBJECT_ALLOCATOR +/* +Thread-safe wrapper over PoolAllocator free list, for allocation of Allocation objects. +*/ +class AllocationObjectAllocator +{ + D3D12MA_CLASS_NO_COPY(AllocationObjectAllocator); +public: + AllocationObjectAllocator(const ALLOCATION_CALLBACKS& allocationCallbacks) + : m_Allocator(allocationCallbacks, 1024) {} + + template<typename... Types> + Allocation* Allocate(Types... args); + void Free(Allocation* alloc); + +private: + D3D12MA_MUTEX m_Mutex; + PoolAllocator<Allocation> m_Allocator; +}; + +#ifndef _D3D12MA_ALLOCATION_OBJECT_ALLOCATOR_FUNCTIONS +template<typename... Types> +Allocation* AllocationObjectAllocator::Allocate(Types... args) +{ + MutexLock mutexLock(m_Mutex); + return m_Allocator.Alloc(std::forward<Types>(args)...); +} + +void AllocationObjectAllocator::Free(Allocation* alloc) +{ + MutexLock mutexLock(m_Mutex); + m_Allocator.Free(alloc); +} +#endif // _D3D12MA_ALLOCATION_OBJECT_ALLOCATOR_FUNCTIONS +#endif // _D3D12MA_ALLOCATION_OBJECT_ALLOCATOR + +#ifndef _D3D12MA_SUBALLOCATION +/* +Represents a region of NormalBlock that is either assigned and returned as +allocated memory block or free. +*/ +struct Suballocation +{ + UINT64 offset; + UINT64 size; + void* privateData; + SuballocationType type; +}; +using SuballocationList = List<Suballocation>; + +// Comparator for offsets. +struct SuballocationOffsetLess +{ + bool operator()(const Suballocation& lhs, const Suballocation& rhs) const + { + return lhs.offset < rhs.offset; + } +}; + +struct SuballocationOffsetGreater +{ + bool operator()(const Suballocation& lhs, const Suballocation& rhs) const + { + return lhs.offset > rhs.offset; + } +}; + +struct SuballocationItemSizeLess +{ + bool operator()(const SuballocationList::iterator lhs, const SuballocationList::iterator rhs) const + { + return lhs->size < rhs->size; + } + bool operator()(const SuballocationList::iterator lhs, UINT64 rhsSize) const + { + return lhs->size < rhsSize; + } +}; +#endif // _D3D12MA_SUBALLOCATION + +#ifndef _D3D12MA_ALLOCATION_REQUEST +/* +Parameters of planned allocation inside a NormalBlock. +*/ +struct AllocationRequest +{ + AllocHandle allocHandle; + UINT64 size; + UINT64 algorithmData; + UINT64 sumFreeSize; // Sum size of free items that overlap with proposed allocation. + UINT64 sumItemSize; // Sum size of items to make lost that overlap with proposed allocation. + SuballocationList::iterator item; + BOOL zeroInitialized = FALSE; // TODO Implement proper handling in TLSF and Linear, using ZeroInitializedRange class. +}; +#endif // _D3D12MA_ALLOCATION_REQUEST + +#ifndef _D3D12MA_ZERO_INITIALIZED_RANGE +/* +Keeps track of the range of bytes that are surely initialized with zeros. +Everything outside of it is considered uninitialized memory that may contain +garbage data. + +The range is left-inclusive. +*/ +class ZeroInitializedRange +{ +public: + void Reset(UINT64 size); + BOOL IsRangeZeroInitialized(UINT64 beg, UINT64 end) const; + void MarkRangeAsUsed(UINT64 usedBeg, UINT64 usedEnd); + +private: + UINT64 m_ZeroBeg = 0, m_ZeroEnd = 0; +}; + +#ifndef _D3D12MA_ZERO_INITIALIZED_RANGE_FUNCTIONS +void ZeroInitializedRange::Reset(UINT64 size) +{ + D3D12MA_ASSERT(size > 0); + m_ZeroBeg = 0; + m_ZeroEnd = size; +} + +BOOL ZeroInitializedRange::IsRangeZeroInitialized(UINT64 beg, UINT64 end) const +{ + D3D12MA_ASSERT(beg < end); + return m_ZeroBeg <= beg && end <= m_ZeroEnd; +} + +void ZeroInitializedRange::MarkRangeAsUsed(UINT64 usedBeg, UINT64 usedEnd) +{ + D3D12MA_ASSERT(usedBeg < usedEnd); + // No new bytes marked. + if (usedEnd <= m_ZeroBeg || m_ZeroEnd <= usedBeg) + { + return; + } + // All bytes marked. + if (usedBeg <= m_ZeroBeg && m_ZeroEnd <= usedEnd) + { + m_ZeroBeg = m_ZeroEnd = 0; + } + // Some bytes marked. + else + { + const UINT64 remainingZeroBefore = usedBeg > m_ZeroBeg ? usedBeg - m_ZeroBeg : 0; + const UINT64 remainingZeroAfter = usedEnd < m_ZeroEnd ? m_ZeroEnd - usedEnd : 0; + D3D12MA_ASSERT(remainingZeroBefore > 0 || remainingZeroAfter > 0); + if (remainingZeroBefore > remainingZeroAfter) + { + m_ZeroEnd = usedBeg; + } + else + { + m_ZeroBeg = usedEnd; + } + } +} +#endif // _D3D12MA_ZERO_INITIALIZED_RANGE_FUNCTIONS +#endif // _D3D12MA_ZERO_INITIALIZED_RANGE + +#ifndef _D3D12MA_BLOCK_METADATA +/* +Data structure used for bookkeeping of allocations and unused ranges of memory +in a single ID3D12Heap memory block. +*/ +class BlockMetadata +{ +public: + BlockMetadata(const ALLOCATION_CALLBACKS* allocationCallbacks, bool isVirtual); + virtual ~BlockMetadata() = default; + + virtual void Init(UINT64 size) { m_Size = size; } + // Validates all data structures inside this object. If not valid, returns false. + virtual bool Validate() const = 0; + UINT64 GetSize() const { return m_Size; } + bool IsVirtual() const { return m_IsVirtual; } + virtual size_t GetAllocationCount() const = 0; + virtual size_t GetFreeRegionsCount() const = 0; + virtual UINT64 GetSumFreeSize() const = 0; + virtual UINT64 GetAllocationOffset(AllocHandle allocHandle) const = 0; + // Returns true if this block is empty - contains only single free suballocation. + virtual bool IsEmpty() const = 0; + + virtual void GetAllocationInfo(AllocHandle allocHandle, VIRTUAL_ALLOCATION_INFO& outInfo) const = 0; + + // Tries to find a place for suballocation with given parameters inside this block. + // If succeeded, fills pAllocationRequest and returns true. + // If failed, returns false. + virtual bool CreateAllocationRequest( + UINT64 allocSize, + UINT64 allocAlignment, + bool upperAddress, + UINT32 strategy, + AllocationRequest* pAllocationRequest) = 0; + + // Makes actual allocation based on request. Request must already be checked and valid. + virtual void Alloc( + const AllocationRequest& request, + UINT64 allocSize, + void* PrivateData) = 0; + + virtual void Free(AllocHandle allocHandle) = 0; + // Frees all allocations. + // Careful! Don't call it if there are Allocation objects owned by pPrivateData of of cleared allocations! + virtual void Clear() = 0; + + virtual AllocHandle GetAllocationListBegin() const = 0; + virtual AllocHandle GetNextAllocation(AllocHandle prevAlloc) const = 0; + virtual UINT64 GetNextFreeRegionSize(AllocHandle alloc) const = 0; + virtual void* GetAllocationPrivateData(AllocHandle allocHandle) const = 0; + virtual void SetAllocationPrivateData(AllocHandle allocHandle, void* privateData) = 0; + + virtual void AddStatistics(Statistics& inoutStats) const = 0; + virtual void AddDetailedStatistics(DetailedStatistics& inoutStats) const = 0; + virtual void WriteAllocationInfoToJson(JsonWriter& json) const = 0; + virtual void DebugLogAllAllocations() const = 0; + +protected: + const ALLOCATION_CALLBACKS* GetAllocs() const { return m_pAllocationCallbacks; } + UINT64 GetDebugMargin() const { return IsVirtual() ? 0 : D3D12MA_DEBUG_MARGIN; } + + void DebugLogAllocation(UINT64 offset, UINT64 size, void* privateData) const; + void PrintDetailedMap_Begin(JsonWriter& json, + UINT64 unusedBytes, + size_t allocationCount, + size_t unusedRangeCount) const; + void PrintDetailedMap_Allocation(JsonWriter& json, + UINT64 offset, UINT64 size, void* privateData) const; + void PrintDetailedMap_UnusedRange(JsonWriter& json, + UINT64 offset, UINT64 size) const; + void PrintDetailedMap_End(JsonWriter& json) const; + +private: + UINT64 m_Size; + bool m_IsVirtual; + const ALLOCATION_CALLBACKS* m_pAllocationCallbacks; + + D3D12MA_CLASS_NO_COPY(BlockMetadata); +}; + +#ifndef _D3D12MA_BLOCK_METADATA_FUNCTIONS +BlockMetadata::BlockMetadata(const ALLOCATION_CALLBACKS* allocationCallbacks, bool isVirtual) + : m_Size(0), + m_IsVirtual(isVirtual), + m_pAllocationCallbacks(allocationCallbacks) +{ + D3D12MA_ASSERT(allocationCallbacks); +} + +void BlockMetadata::DebugLogAllocation(UINT64 offset, UINT64 size, void* privateData) const +{ + if (IsVirtual()) + { + D3D12MA_DEBUG_LOG(L"UNFREED VIRTUAL ALLOCATION; Offset: %llu; Size: %llu; PrivateData: %p", offset, size, privateData); + } + else + { + D3D12MA_ASSERT(privateData != NULL); + Allocation* allocation = reinterpret_cast<Allocation*>(privateData); + + privateData = allocation->GetPrivateData(); + LPCWSTR name = allocation->GetName(); + + D3D12MA_DEBUG_LOG(L"UNFREED ALLOCATION; Offset: %llu; Size: %llu; PrivateData: %p; Name: %s", + offset, size, privateData, name ? name : L"D3D12MA_Empty"); + } +} + +void BlockMetadata::PrintDetailedMap_Begin(JsonWriter& json, + UINT64 unusedBytes, size_t allocationCount, size_t unusedRangeCount) const +{ + json.WriteString(L"TotalBytes"); + json.WriteNumber(GetSize()); + + json.WriteString(L"UnusedBytes"); + json.WriteNumber(unusedBytes); + + json.WriteString(L"Allocations"); + json.WriteNumber((UINT64)allocationCount); + + json.WriteString(L"UnusedRanges"); + json.WriteNumber((UINT64)unusedRangeCount); + + json.WriteString(L"Suballocations"); + json.BeginArray(); +} + +void BlockMetadata::PrintDetailedMap_Allocation(JsonWriter& json, + UINT64 offset, UINT64 size, void* privateData) const +{ + json.BeginObject(true); + + json.WriteString(L"Offset"); + json.WriteNumber(offset); + + if (IsVirtual()) + { + json.WriteString(L"Size"); + json.WriteNumber(size); + if (privateData) + { + json.WriteString(L"CustomData"); + json.WriteNumber((uintptr_t)privateData); + } + } + else + { + const Allocation* const alloc = (const Allocation*)privateData; + D3D12MA_ASSERT(alloc); + json.AddAllocationToObject(*alloc); + } + json.EndObject(); +} + +void BlockMetadata::PrintDetailedMap_UnusedRange(JsonWriter& json, + UINT64 offset, UINT64 size) const +{ + json.BeginObject(true); + + json.WriteString(L"Offset"); + json.WriteNumber(offset); + + json.WriteString(L"Type"); + json.WriteString(L"FREE"); + + json.WriteString(L"Size"); + json.WriteNumber(size); + + json.EndObject(); +} + +void BlockMetadata::PrintDetailedMap_End(JsonWriter& json) const +{ + json.EndArray(); +} +#endif // _D3D12MA_BLOCK_METADATA_FUNCTIONS +#endif // _D3D12MA_BLOCK_METADATA + +#if 0 +#ifndef _D3D12MA_BLOCK_METADATA_GENERIC +class BlockMetadata_Generic : public BlockMetadata +{ +public: + BlockMetadata_Generic(const ALLOCATION_CALLBACKS* allocationCallbacks, bool isVirtual); + virtual ~BlockMetadata_Generic() = default; + + size_t GetAllocationCount() const override { return m_Suballocations.size() - m_FreeCount; } + UINT64 GetSumFreeSize() const override { return m_SumFreeSize; } + UINT64 GetAllocationOffset(AllocHandle allocHandle) const override { return (UINT64)allocHandle - 1; } + + void Init(UINT64 size) override; + bool Validate() const override; + bool IsEmpty() const override; + void GetAllocationInfo(AllocHandle allocHandle, VIRTUAL_ALLOCATION_INFO& outInfo) const override; + + bool CreateAllocationRequest( + UINT64 allocSize, + UINT64 allocAlignment, + bool upperAddress, + AllocationRequest* pAllocationRequest) override; + + void Alloc( + const AllocationRequest& request, + UINT64 allocSize, + void* privateData) override; + + void Free(AllocHandle allocHandle) override; + void Clear() override; + + void SetAllocationPrivateData(AllocHandle allocHandle, void* privateData) override; + + void AddStatistics(Statistics& inoutStats) const override; + void AddDetailedStatistics(DetailedStatistics& inoutStats) const override; + void WriteAllocationInfoToJson(JsonWriter& json) const override; + +private: + UINT m_FreeCount; + UINT64 m_SumFreeSize; + SuballocationList m_Suballocations; + // Suballocations that are free and have size greater than certain threshold. + // Sorted by size, ascending. + Vector<SuballocationList::iterator> m_FreeSuballocationsBySize; + ZeroInitializedRange m_ZeroInitializedRange; + + SuballocationList::const_iterator FindAtOffset(UINT64 offset) const; + bool ValidateFreeSuballocationList() const; + + // Checks if requested suballocation with given parameters can be placed in given pFreeSuballocItem. + // If yes, fills pOffset and returns true. If no, returns false. + bool CheckAllocation( + UINT64 allocSize, + UINT64 allocAlignment, + SuballocationList::const_iterator suballocItem, + AllocHandle* pAllocHandle, + UINT64* pSumFreeSize, + UINT64* pSumItemSize, + BOOL *pZeroInitialized) const; + // Given free suballocation, it merges it with following one, which must also be free. + void MergeFreeWithNext(SuballocationList::iterator item); + // Releases given suballocation, making it free. + // Merges it with adjacent free suballocations if applicable. + // Returns iterator to new free suballocation at this place. + SuballocationList::iterator FreeSuballocation(SuballocationList::iterator suballocItem); + // Given free suballocation, it inserts it into sorted list of + // m_FreeSuballocationsBySize if it's suitable. + void RegisterFreeSuballocation(SuballocationList::iterator item); + // Given free suballocation, it removes it from sorted list of + // m_FreeSuballocationsBySize if it's suitable. + void UnregisterFreeSuballocation(SuballocationList::iterator item); + + D3D12MA_CLASS_NO_COPY(BlockMetadata_Generic) +}; + +#ifndef _D3D12MA_BLOCK_METADATA_GENERIC_FUNCTIONS +BlockMetadata_Generic::BlockMetadata_Generic(const ALLOCATION_CALLBACKS* allocationCallbacks, bool isVirtual) + : BlockMetadata(allocationCallbacks, isVirtual), + m_FreeCount(0), + m_SumFreeSize(0), + m_Suballocations(*allocationCallbacks), + m_FreeSuballocationsBySize(*allocationCallbacks) +{ + D3D12MA_ASSERT(allocationCallbacks); +} + +void BlockMetadata_Generic::Init(UINT64 size) +{ + BlockMetadata::Init(size); + m_ZeroInitializedRange.Reset(size); + + m_FreeCount = 1; + m_SumFreeSize = size; + + Suballocation suballoc = {}; + suballoc.offset = 0; + suballoc.size = size; + suballoc.type = SUBALLOCATION_TYPE_FREE; + suballoc.privateData = NULL; + + D3D12MA_ASSERT(size > MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER); + m_Suballocations.push_back(suballoc); + SuballocationList::iterator suballocItem = m_Suballocations.end(); + --suballocItem; + m_FreeSuballocationsBySize.push_back(suballocItem); +} + +bool BlockMetadata_Generic::Validate() const +{ + D3D12MA_VALIDATE(!m_Suballocations.empty()); + + // Expected offset of new suballocation as calculated from previous ones. + UINT64 calculatedOffset = 0; + // Expected number of free suballocations as calculated from traversing their list. + UINT calculatedFreeCount = 0; + // Expected sum size of free suballocations as calculated from traversing their list. + UINT64 calculatedSumFreeSize = 0; + // Expected number of free suballocations that should be registered in + // m_FreeSuballocationsBySize calculated from traversing their list. + size_t freeSuballocationsToRegister = 0; + // True if previous visited suballocation was free. + bool prevFree = false; + + for (const auto& subAlloc : m_Suballocations) + { + // Actual offset of this suballocation doesn't match expected one. + D3D12MA_VALIDATE(subAlloc.offset == calculatedOffset); + + const bool currFree = (subAlloc.type == SUBALLOCATION_TYPE_FREE); + // Two adjacent free suballocations are invalid. They should be merged. + D3D12MA_VALIDATE(!prevFree || !currFree); + + const Allocation* const alloc = (Allocation*)subAlloc.privateData; + if (!IsVirtual()) + { + D3D12MA_VALIDATE(currFree == (alloc == NULL)); + } + + if (currFree) + { + calculatedSumFreeSize += subAlloc.size; + ++calculatedFreeCount; + if (subAlloc.size >= MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER) + { + ++freeSuballocationsToRegister; + } + + // Margin required between allocations - every free space must be at least that large. + D3D12MA_VALIDATE(subAlloc.size >= GetDebugMargin()); + } + else + { + if (!IsVirtual()) + { + D3D12MA_VALIDATE(alloc->GetOffset() == subAlloc.offset); + D3D12MA_VALIDATE(alloc->GetSize() == subAlloc.size); + } + + // Margin required between allocations - previous allocation must be free. + D3D12MA_VALIDATE(GetDebugMargin() == 0 || prevFree); + } + + calculatedOffset += subAlloc.size; + prevFree = currFree; + } + + // Number of free suballocations registered in m_FreeSuballocationsBySize doesn't + // match expected one. + D3D12MA_VALIDATE(m_FreeSuballocationsBySize.size() == freeSuballocationsToRegister); + + UINT64 lastSize = 0; + for (size_t i = 0; i < m_FreeSuballocationsBySize.size(); ++i) + { + SuballocationList::iterator suballocItem = m_FreeSuballocationsBySize[i]; + + // Only free suballocations can be registered in m_FreeSuballocationsBySize. + D3D12MA_VALIDATE(suballocItem->type == SUBALLOCATION_TYPE_FREE); + // They must be sorted by size ascending. + D3D12MA_VALIDATE(suballocItem->size >= lastSize); + + lastSize = suballocItem->size; + } + + // Check if totals match calculacted values. + D3D12MA_VALIDATE(ValidateFreeSuballocationList()); + D3D12MA_VALIDATE(calculatedOffset == GetSize()); + D3D12MA_VALIDATE(calculatedSumFreeSize == m_SumFreeSize); + D3D12MA_VALIDATE(calculatedFreeCount == m_FreeCount); + + return true; +} + +bool BlockMetadata_Generic::IsEmpty() const +{ + return (m_Suballocations.size() == 1) && (m_FreeCount == 1); +} + +void BlockMetadata_Generic::GetAllocationInfo(AllocHandle allocHandle, VIRTUAL_ALLOCATION_INFO& outInfo) const +{ + Suballocation& suballoc = *FindAtOffset((UINT64)allocHandle - 1).dropConst(); + outInfo.Offset = suballoc.offset; + outInfo.Size = suballoc.size; + outInfo.pPrivateData = suballoc.privateData; +} + +bool BlockMetadata_Generic::CreateAllocationRequest( + UINT64 allocSize, + UINT64 allocAlignment, + bool upperAddress, + AllocationRequest* pAllocationRequest) +{ + D3D12MA_ASSERT(allocSize > 0); + D3D12MA_ASSERT(!upperAddress && "ALLOCATION_FLAG_UPPER_ADDRESS can be used only with linear algorithm."); + D3D12MA_ASSERT(pAllocationRequest != NULL); + D3D12MA_HEAVY_ASSERT(Validate()); + + // There is not enough total free space in this block to fullfill the request: Early return. + if (m_SumFreeSize < allocSize + GetDebugMargin()) + { + return false; + } + + // New algorithm, efficiently searching freeSuballocationsBySize. + const size_t freeSuballocCount = m_FreeSuballocationsBySize.size(); + if (freeSuballocCount > 0) + { + // Find first free suballocation with size not less than allocSize + GetDebugMargin(). + SuballocationList::iterator* const it = BinaryFindFirstNotLess( + m_FreeSuballocationsBySize.data(), + m_FreeSuballocationsBySize.data() + freeSuballocCount, + allocSize + GetDebugMargin(), + SuballocationItemSizeLess()); + size_t index = it - m_FreeSuballocationsBySize.data(); + for (; index < freeSuballocCount; ++index) + { + if (CheckAllocation( + allocSize, + allocAlignment, + m_FreeSuballocationsBySize[index], + &pAllocationRequest->allocHandle, + &pAllocationRequest->sumFreeSize, + &pAllocationRequest->sumItemSize, + &pAllocationRequest->zeroInitialized)) + { + pAllocationRequest->item = m_FreeSuballocationsBySize[index]; + return true; + } + } + } + + return false; +} + +void BlockMetadata_Generic::Alloc( + const AllocationRequest& request, + UINT64 allocSize, + void* privateData) +{ + D3D12MA_ASSERT(request.item != m_Suballocations.end()); + Suballocation& suballoc = *request.item; + // Given suballocation is a free block. + D3D12MA_ASSERT(suballoc.type == SUBALLOCATION_TYPE_FREE); + // Given offset is inside this suballocation. + UINT64 offset = (UINT64)request.allocHandle - 1; + D3D12MA_ASSERT(offset >= suballoc.offset); + const UINT64 paddingBegin = offset - suballoc.offset; + D3D12MA_ASSERT(suballoc.size >= paddingBegin + allocSize); + const UINT64 paddingEnd = suballoc.size - paddingBegin - allocSize; + + // Unregister this free suballocation from m_FreeSuballocationsBySize and update + // it to become used. + UnregisterFreeSuballocation(request.item); + + suballoc.offset = offset; + suballoc.size = allocSize; + suballoc.type = SUBALLOCATION_TYPE_ALLOCATION; + suballoc.privateData = privateData; + + // If there are any free bytes remaining at the end, insert new free suballocation after current one. + if (paddingEnd) + { + Suballocation paddingSuballoc = {}; + paddingSuballoc.offset = offset + allocSize; + paddingSuballoc.size = paddingEnd; + paddingSuballoc.type = SUBALLOCATION_TYPE_FREE; + SuballocationList::iterator next = request.item; + ++next; + const SuballocationList::iterator paddingEndItem = + m_Suballocations.insert(next, paddingSuballoc); + RegisterFreeSuballocation(paddingEndItem); + } + + // If there are any free bytes remaining at the beginning, insert new free suballocation before current one. + if (paddingBegin) + { + Suballocation paddingSuballoc = {}; + paddingSuballoc.offset = offset - paddingBegin; + paddingSuballoc.size = paddingBegin; + paddingSuballoc.type = SUBALLOCATION_TYPE_FREE; + const SuballocationList::iterator paddingBeginItem = + m_Suballocations.insert(request.item, paddingSuballoc); + RegisterFreeSuballocation(paddingBeginItem); + } + + // Update totals. + m_FreeCount = m_FreeCount - 1; + if (paddingBegin > 0) + { + ++m_FreeCount; + } + if (paddingEnd > 0) + { + ++m_FreeCount; + } + m_SumFreeSize -= allocSize; + + m_ZeroInitializedRange.MarkRangeAsUsed(offset, offset + allocSize); +} + +void BlockMetadata_Generic::Free(AllocHandle allocHandle) +{ + FreeSuballocation(FindAtOffset((UINT64)allocHandle - 1).dropConst()); +} + +void BlockMetadata_Generic::Clear() +{ + m_FreeCount = 1; + m_SumFreeSize = GetSize(); + + m_Suballocations.clear(); + Suballocation suballoc = {}; + suballoc.offset = 0; + suballoc.size = GetSize(); + suballoc.type = SUBALLOCATION_TYPE_FREE; + m_Suballocations.push_back(suballoc); + + m_FreeSuballocationsBySize.clear(); + m_FreeSuballocationsBySize.push_back(m_Suballocations.begin()); +} + +SuballocationList::const_iterator BlockMetadata_Generic::FindAtOffset(UINT64 offset) const +{ + const UINT64 last = m_Suballocations.crbegin()->offset; + if (last == offset) + return m_Suballocations.crbegin(); + const UINT64 first = m_Suballocations.cbegin()->offset; + if (first == offset) + return m_Suballocations.cbegin(); + + const size_t suballocCount = m_Suballocations.size(); + const UINT64 step = (last - first + m_Suballocations.cbegin()->size) / suballocCount; + auto findSuballocation = [&](auto begin, auto end) -> SuballocationList::const_iterator + { + for (auto suballocItem = begin; + suballocItem != end; + ++suballocItem) + { + const Suballocation& suballoc = *suballocItem; + if (suballoc.offset == offset) + return suballocItem; + } + D3D12MA_ASSERT(false && "Not found!"); + return m_Suballocations.end(); + }; + // If requested offset is closer to the end of range, search from the end + if ((offset - first) > suballocCount * step / 2) + { + return findSuballocation(m_Suballocations.crbegin(), m_Suballocations.crend()); + } + return findSuballocation(m_Suballocations.cbegin(), m_Suballocations.cend()); +} + +bool BlockMetadata_Generic::ValidateFreeSuballocationList() const +{ + UINT64 lastSize = 0; + for (size_t i = 0, count = m_FreeSuballocationsBySize.size(); i < count; ++i) + { + const SuballocationList::iterator it = m_FreeSuballocationsBySize[i]; + + D3D12MA_VALIDATE(it->type == SUBALLOCATION_TYPE_FREE); + D3D12MA_VALIDATE(it->size >= MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER); + D3D12MA_VALIDATE(it->size >= lastSize); + lastSize = it->size; + } + return true; +} + +bool BlockMetadata_Generic::CheckAllocation( + UINT64 allocSize, + UINT64 allocAlignment, + SuballocationList::const_iterator suballocItem, + AllocHandle* pAllocHandle, + UINT64* pSumFreeSize, + UINT64* pSumItemSize, + BOOL* pZeroInitialized) const +{ + D3D12MA_ASSERT(allocSize > 0); + D3D12MA_ASSERT(suballocItem != m_Suballocations.cend()); + D3D12MA_ASSERT(pAllocHandle != NULL && pZeroInitialized != NULL); + + *pSumFreeSize = 0; + *pSumItemSize = 0; + *pZeroInitialized = FALSE; + + const Suballocation& suballoc = *suballocItem; + D3D12MA_ASSERT(suballoc.type == SUBALLOCATION_TYPE_FREE); + + *pSumFreeSize = suballoc.size; + + // Size of this suballocation is too small for this request: Early return. + if (suballoc.size < allocSize) + { + return false; + } + + // Start from offset equal to beginning of this suballocation and debug margin of previous allocation if present. + UINT64 offset = suballoc.offset + (suballocItem == m_Suballocations.cbegin() ? 0 : GetDebugMargin()); + + // Apply alignment. + offset = AlignUp(offset, allocAlignment); + + // Calculate padding at the beginning based on current offset. + const UINT64 paddingBegin = offset - suballoc.offset; + + // Fail if requested size plus margin after is bigger than size of this suballocation. + if (paddingBegin + allocSize + GetDebugMargin() > suballoc.size) + { + return false; + } + + // All tests passed: Success. Offset is already filled. + *pZeroInitialized = m_ZeroInitializedRange.IsRangeZeroInitialized(offset, offset + allocSize); + *pAllocHandle = (AllocHandle)(offset + 1); + return true; +} + +void BlockMetadata_Generic::MergeFreeWithNext(SuballocationList::iterator item) +{ + D3D12MA_ASSERT(item != m_Suballocations.end()); + D3D12MA_ASSERT(item->type == SUBALLOCATION_TYPE_FREE); + + SuballocationList::iterator nextItem = item; + ++nextItem; + D3D12MA_ASSERT(nextItem != m_Suballocations.end()); + D3D12MA_ASSERT(nextItem->type == SUBALLOCATION_TYPE_FREE); + + item->size += nextItem->size; + --m_FreeCount; + m_Suballocations.erase(nextItem); +} + +SuballocationList::iterator BlockMetadata_Generic::FreeSuballocation(SuballocationList::iterator suballocItem) +{ + // Change this suballocation to be marked as free. + Suballocation& suballoc = *suballocItem; + suballoc.type = SUBALLOCATION_TYPE_FREE; + suballoc.privateData = NULL; + + // Update totals. + ++m_FreeCount; + m_SumFreeSize += suballoc.size; + + // Merge with previous and/or next suballocation if it's also free. + bool mergeWithNext = false; + bool mergeWithPrev = false; + + SuballocationList::iterator nextItem = suballocItem; + ++nextItem; + if ((nextItem != m_Suballocations.end()) && (nextItem->type == SUBALLOCATION_TYPE_FREE)) + { + mergeWithNext = true; + } + + SuballocationList::iterator prevItem = suballocItem; + if (suballocItem != m_Suballocations.begin()) + { + --prevItem; + if (prevItem->type == SUBALLOCATION_TYPE_FREE) + { + mergeWithPrev = true; + } + } + + if (mergeWithNext) + { + UnregisterFreeSuballocation(nextItem); + MergeFreeWithNext(suballocItem); + } + + if (mergeWithPrev) + { + UnregisterFreeSuballocation(prevItem); + MergeFreeWithNext(prevItem); + RegisterFreeSuballocation(prevItem); + return prevItem; + } + else + { + RegisterFreeSuballocation(suballocItem); + return suballocItem; + } +} + +void BlockMetadata_Generic::RegisterFreeSuballocation(SuballocationList::iterator item) +{ + D3D12MA_ASSERT(item->type == SUBALLOCATION_TYPE_FREE); + D3D12MA_ASSERT(item->size > 0); + + // You may want to enable this validation at the beginning or at the end of + // this function, depending on what do you want to check. + D3D12MA_HEAVY_ASSERT(ValidateFreeSuballocationList()); + + if (item->size >= MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER) + { + if (m_FreeSuballocationsBySize.empty()) + { + m_FreeSuballocationsBySize.push_back(item); + } + else + { + m_FreeSuballocationsBySize.InsertSorted(item, SuballocationItemSizeLess()); + } + } + + //D3D12MA_HEAVY_ASSERT(ValidateFreeSuballocationList()); +} + +void BlockMetadata_Generic::UnregisterFreeSuballocation(SuballocationList::iterator item) +{ + D3D12MA_ASSERT(item->type == SUBALLOCATION_TYPE_FREE); + D3D12MA_ASSERT(item->size > 0); + + // You may want to enable this validation at the beginning or at the end of + // this function, depending on what do you want to check. + D3D12MA_HEAVY_ASSERT(ValidateFreeSuballocationList()); + + if (item->size >= MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER) + { + SuballocationList::iterator* const it = BinaryFindFirstNotLess( + m_FreeSuballocationsBySize.data(), + m_FreeSuballocationsBySize.data() + m_FreeSuballocationsBySize.size(), + item, + SuballocationItemSizeLess()); + for (size_t index = it - m_FreeSuballocationsBySize.data(); + index < m_FreeSuballocationsBySize.size(); + ++index) + { + if (m_FreeSuballocationsBySize[index] == item) + { + m_FreeSuballocationsBySize.remove(index); + return; + } + D3D12MA_ASSERT((m_FreeSuballocationsBySize[index]->size == item->size) && "Not found."); + } + D3D12MA_ASSERT(0 && "Not found."); + } + + //D3D12MA_HEAVY_ASSERT(ValidateFreeSuballocationList()); +} + +void BlockMetadata_Generic::SetAllocationPrivateData(AllocHandle allocHandle, void* privateData) +{ + Suballocation& suballoc = *FindAtOffset((UINT64)allocHandle - 1).dropConst(); + suballoc.privateData = privateData; +} + +void BlockMetadata_Generic::AddStatistics(Statistics& inoutStats) const +{ + inoutStats.BlockCount++; + inoutStats.AllocationCount += (UINT)m_Suballocations.size() - m_FreeCount; + inoutStats.BlockBytes += GetSize(); + inoutStats.AllocationBytes += GetSize() - m_SumFreeSize; +} + +void BlockMetadata_Generic::AddDetailedStatistics(DetailedStatistics& inoutStats) const +{ + inoutStats.Stats.BlockCount++; + inoutStats.Stats.BlockBytes += GetSize(); + + for (const auto& suballoc : m_Suballocations) + { + if (suballoc.type == SUBALLOCATION_TYPE_FREE) + AddDetailedStatisticsUnusedRange(inoutStats, suballoc.size); + else + AddDetailedStatisticsAllocation(inoutStats, suballoc.size); + } +} + +void BlockMetadata_Generic::WriteAllocationInfoToJson(JsonWriter& json) const +{ + PrintDetailedMap_Begin(json, GetSumFreeSize(), GetAllocationCount(), m_FreeCount); + for (const auto& suballoc : m_Suballocations) + { + if (suballoc.type == SUBALLOCATION_TYPE_FREE) + PrintDetailedMap_UnusedRange(json, suballoc.offset, suballoc.size); + else + PrintDetailedMap_Allocation(json, suballoc.offset, suballoc.size, suballoc.privateData); + } + PrintDetailedMap_End(json); +} +#endif // _D3D12MA_BLOCK_METADATA_GENERIC_FUNCTIONS +#endif // _D3D12MA_BLOCK_METADATA_GENERIC +#endif // #if 0 + +#ifndef _D3D12MA_BLOCK_METADATA_LINEAR +class BlockMetadata_Linear : public BlockMetadata +{ +public: + BlockMetadata_Linear(const ALLOCATION_CALLBACKS* allocationCallbacks, bool isVirtual); + virtual ~BlockMetadata_Linear() = default; + + UINT64 GetSumFreeSize() const override { return m_SumFreeSize; } + bool IsEmpty() const override { return GetAllocationCount() == 0; } + UINT64 GetAllocationOffset(AllocHandle allocHandle) const override { return (UINT64)allocHandle - 1; }; + + void Init(UINT64 size) override; + bool Validate() const override; + size_t GetAllocationCount() const override; + size_t GetFreeRegionsCount() const override; + void GetAllocationInfo(AllocHandle allocHandle, VIRTUAL_ALLOCATION_INFO& outInfo) const override; + + bool CreateAllocationRequest( + UINT64 allocSize, + UINT64 allocAlignment, + bool upperAddress, + UINT32 strategy, + AllocationRequest* pAllocationRequest) override; + + void Alloc( + const AllocationRequest& request, + UINT64 allocSize, + void* privateData) override; + + void Free(AllocHandle allocHandle) override; + void Clear() override; + + AllocHandle GetAllocationListBegin() const override; + AllocHandle GetNextAllocation(AllocHandle prevAlloc) const override; + UINT64 GetNextFreeRegionSize(AllocHandle alloc) const override; + void* GetAllocationPrivateData(AllocHandle allocHandle) const override; + void SetAllocationPrivateData(AllocHandle allocHandle, void* privateData) override; + + void AddStatistics(Statistics& inoutStats) const override; + void AddDetailedStatistics(DetailedStatistics& inoutStats) const override; + void WriteAllocationInfoToJson(JsonWriter& json) const override; + void DebugLogAllAllocations() const override; + +private: + /* + There are two suballocation vectors, used in ping-pong way. + The one with index m_1stVectorIndex is called 1st. + The one with index (m_1stVectorIndex ^ 1) is called 2nd. + 2nd can be non-empty only when 1st is not empty. + When 2nd is not empty, m_2ndVectorMode indicates its mode of operation. + */ + typedef Vector<Suballocation> SuballocationVectorType; + + enum ALLOC_REQUEST_TYPE + { + ALLOC_REQUEST_UPPER_ADDRESS, + ALLOC_REQUEST_END_OF_1ST, + ALLOC_REQUEST_END_OF_2ND, + }; + + enum SECOND_VECTOR_MODE + { + SECOND_VECTOR_EMPTY, + /* + Suballocations in 2nd vector are created later than the ones in 1st, but they + all have smaller offset. + */ + SECOND_VECTOR_RING_BUFFER, + /* + Suballocations in 2nd vector are upper side of double stack. + They all have offsets higher than those in 1st vector. + Top of this stack means smaller offsets, but higher indices in this vector. + */ + SECOND_VECTOR_DOUBLE_STACK, + }; + + UINT64 m_SumFreeSize; + SuballocationVectorType m_Suballocations0, m_Suballocations1; + UINT32 m_1stVectorIndex; + SECOND_VECTOR_MODE m_2ndVectorMode; + // Number of items in 1st vector with hAllocation = null at the beginning. + size_t m_1stNullItemsBeginCount; + // Number of other items in 1st vector with hAllocation = null somewhere in the middle. + size_t m_1stNullItemsMiddleCount; + // Number of items in 2nd vector with hAllocation = null. + size_t m_2ndNullItemsCount; + + SuballocationVectorType& AccessSuballocations1st() { return m_1stVectorIndex ? m_Suballocations1 : m_Suballocations0; } + SuballocationVectorType& AccessSuballocations2nd() { return m_1stVectorIndex ? m_Suballocations0 : m_Suballocations1; } + const SuballocationVectorType& AccessSuballocations1st() const { return m_1stVectorIndex ? m_Suballocations1 : m_Suballocations0; } + const SuballocationVectorType& AccessSuballocations2nd() const { return m_1stVectorIndex ? m_Suballocations0 : m_Suballocations1; } + + Suballocation& FindSuballocation(UINT64 offset) const; + bool ShouldCompact1st() const; + void CleanupAfterFree(); + + bool CreateAllocationRequest_LowerAddress( + UINT64 allocSize, + UINT64 allocAlignment, + AllocationRequest* pAllocationRequest); + bool CreateAllocationRequest_UpperAddress( + UINT64 allocSize, + UINT64 allocAlignment, + AllocationRequest* pAllocationRequest); + + D3D12MA_CLASS_NO_COPY(BlockMetadata_Linear) +}; + +#ifndef _D3D12MA_BLOCK_METADATA_LINEAR_FUNCTIONS +BlockMetadata_Linear::BlockMetadata_Linear(const ALLOCATION_CALLBACKS* allocationCallbacks, bool isVirtual) + : BlockMetadata(allocationCallbacks, isVirtual), + m_SumFreeSize(0), + m_Suballocations0(*allocationCallbacks), + m_Suballocations1(*allocationCallbacks), + m_1stVectorIndex(0), + m_2ndVectorMode(SECOND_VECTOR_EMPTY), + m_1stNullItemsBeginCount(0), + m_1stNullItemsMiddleCount(0), + m_2ndNullItemsCount(0) +{ + D3D12MA_ASSERT(allocationCallbacks); +} + +void BlockMetadata_Linear::Init(UINT64 size) +{ + BlockMetadata::Init(size); + m_SumFreeSize = size; +} + +bool BlockMetadata_Linear::Validate() const +{ + D3D12MA_VALIDATE(GetSumFreeSize() <= GetSize()); + const SuballocationVectorType& suballocations1st = AccessSuballocations1st(); + const SuballocationVectorType& suballocations2nd = AccessSuballocations2nd(); + + D3D12MA_VALIDATE(suballocations2nd.empty() == (m_2ndVectorMode == SECOND_VECTOR_EMPTY)); + D3D12MA_VALIDATE(!suballocations1st.empty() || + suballocations2nd.empty() || + m_2ndVectorMode != SECOND_VECTOR_RING_BUFFER); + + if (!suballocations1st.empty()) + { + // Null item at the beginning should be accounted into m_1stNullItemsBeginCount. + D3D12MA_VALIDATE(suballocations1st[m_1stNullItemsBeginCount].type != SUBALLOCATION_TYPE_FREE); + // Null item at the end should be just pop_back(). + D3D12MA_VALIDATE(suballocations1st.back().type != SUBALLOCATION_TYPE_FREE); + } + if (!suballocations2nd.empty()) + { + // Null item at the end should be just pop_back(). + D3D12MA_VALIDATE(suballocations2nd.back().type != SUBALLOCATION_TYPE_FREE); + } + + D3D12MA_VALIDATE(m_1stNullItemsBeginCount + m_1stNullItemsMiddleCount <= suballocations1st.size()); + D3D12MA_VALIDATE(m_2ndNullItemsCount <= suballocations2nd.size()); + + UINT64 sumUsedSize = 0; + const size_t suballoc1stCount = suballocations1st.size(); + UINT64 offset = 0; + + if (m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER) + { + const size_t suballoc2ndCount = suballocations2nd.size(); + size_t nullItem2ndCount = 0; + for (size_t i = 0; i < suballoc2ndCount; ++i) + { + const Suballocation& suballoc = suballocations2nd[i]; + const bool currFree = (suballoc.type == SUBALLOCATION_TYPE_FREE); + + const Allocation* alloc = (Allocation*)suballoc.privateData; + if (!IsVirtual()) + { + D3D12MA_VALIDATE(currFree == (alloc == NULL)); + } + D3D12MA_VALIDATE(suballoc.offset >= offset); + + if (!currFree) + { + if (!IsVirtual()) + { + D3D12MA_VALIDATE(GetAllocationOffset(alloc->GetAllocHandle()) == suballoc.offset); + D3D12MA_VALIDATE(alloc->GetSize() == suballoc.size); + } + sumUsedSize += suballoc.size; + } + else + { + ++nullItem2ndCount; + } + + offset = suballoc.offset + suballoc.size + GetDebugMargin(); + } + + D3D12MA_VALIDATE(nullItem2ndCount == m_2ndNullItemsCount); + } + + for (size_t i = 0; i < m_1stNullItemsBeginCount; ++i) + { + const Suballocation& suballoc = suballocations1st[i]; + D3D12MA_VALIDATE(suballoc.type == SUBALLOCATION_TYPE_FREE && + suballoc.privateData == NULL); + } + + size_t nullItem1stCount = m_1stNullItemsBeginCount; + + for (size_t i = m_1stNullItemsBeginCount; i < suballoc1stCount; ++i) + { + const Suballocation& suballoc = suballocations1st[i]; + const bool currFree = (suballoc.type == SUBALLOCATION_TYPE_FREE); + + const Allocation* alloc = (Allocation*)suballoc.privateData; + if (!IsVirtual()) + { + D3D12MA_VALIDATE(currFree == (alloc == NULL)); + } + D3D12MA_VALIDATE(suballoc.offset >= offset); + D3D12MA_VALIDATE(i >= m_1stNullItemsBeginCount || currFree); + + if (!currFree) + { + if (!IsVirtual()) + { + D3D12MA_VALIDATE(GetAllocationOffset(alloc->GetAllocHandle()) == suballoc.offset); + D3D12MA_VALIDATE(alloc->GetSize() == suballoc.size); + } + sumUsedSize += suballoc.size; + } + else + { + ++nullItem1stCount; + } + + offset = suballoc.offset + suballoc.size + GetDebugMargin(); + } + D3D12MA_VALIDATE(nullItem1stCount == m_1stNullItemsBeginCount + m_1stNullItemsMiddleCount); + + if (m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK) + { + const size_t suballoc2ndCount = suballocations2nd.size(); + size_t nullItem2ndCount = 0; + for (size_t i = suballoc2ndCount; i--; ) + { + const Suballocation& suballoc = suballocations2nd[i]; + const bool currFree = (suballoc.type == SUBALLOCATION_TYPE_FREE); + + const Allocation* alloc = (Allocation*)suballoc.privateData; + if (!IsVirtual()) + { + D3D12MA_VALIDATE(currFree == (alloc == NULL)); + } + D3D12MA_VALIDATE(suballoc.offset >= offset); + + if (!currFree) + { + if (!IsVirtual()) + { + D3D12MA_VALIDATE(GetAllocationOffset(alloc->GetAllocHandle()) == suballoc.offset); + D3D12MA_VALIDATE(alloc->GetSize() == suballoc.size); + } + sumUsedSize += suballoc.size; + } + else + { + ++nullItem2ndCount; + } + + offset = suballoc.offset + suballoc.size + GetDebugMargin(); + } + + D3D12MA_VALIDATE(nullItem2ndCount == m_2ndNullItemsCount); + } + + D3D12MA_VALIDATE(offset <= GetSize()); + D3D12MA_VALIDATE(m_SumFreeSize == GetSize() - sumUsedSize); + + return true; +} + +size_t BlockMetadata_Linear::GetAllocationCount() const +{ + return AccessSuballocations1st().size() - m_1stNullItemsBeginCount - m_1stNullItemsMiddleCount + + AccessSuballocations2nd().size() - m_2ndNullItemsCount; +} + +size_t BlockMetadata_Linear::GetFreeRegionsCount() const +{ + // Function only used for defragmentation, which is disabled for this algorithm + D3D12MA_ASSERT(0); + return SIZE_MAX; +} + +void BlockMetadata_Linear::GetAllocationInfo(AllocHandle allocHandle, VIRTUAL_ALLOCATION_INFO& outInfo) const +{ + const Suballocation& suballoc = FindSuballocation((UINT64)allocHandle - 1); + outInfo.Offset = suballoc.offset; + outInfo.Size = suballoc.size; + outInfo.pPrivateData = suballoc.privateData; +} + +bool BlockMetadata_Linear::CreateAllocationRequest( + UINT64 allocSize, + UINT64 allocAlignment, + bool upperAddress, + UINT32 strategy, + AllocationRequest* pAllocationRequest) +{ + D3D12MA_ASSERT(allocSize > 0 && "Cannot allocate empty block!"); + D3D12MA_ASSERT(pAllocationRequest != NULL); + D3D12MA_HEAVY_ASSERT(Validate()); + pAllocationRequest->size = allocSize; + return upperAddress ? + CreateAllocationRequest_UpperAddress( + allocSize, allocAlignment, pAllocationRequest) : + CreateAllocationRequest_LowerAddress( + allocSize, allocAlignment, pAllocationRequest); +} + +void BlockMetadata_Linear::Alloc( + const AllocationRequest& request, + UINT64 allocSize, + void* privateData) +{ + UINT64 offset = (UINT64)request.allocHandle - 1; + const Suballocation newSuballoc = { offset, request.size, privateData, SUBALLOCATION_TYPE_ALLOCATION }; + + switch (request.algorithmData) + { + case ALLOC_REQUEST_UPPER_ADDRESS: + { + D3D12MA_ASSERT(m_2ndVectorMode != SECOND_VECTOR_RING_BUFFER && + "CRITICAL ERROR: Trying to use linear allocator as double stack while it was already used as ring buffer."); + SuballocationVectorType& suballocations2nd = AccessSuballocations2nd(); + suballocations2nd.push_back(newSuballoc); + m_2ndVectorMode = SECOND_VECTOR_DOUBLE_STACK; + break; + } + case ALLOC_REQUEST_END_OF_1ST: + { + SuballocationVectorType& suballocations1st = AccessSuballocations1st(); + + D3D12MA_ASSERT(suballocations1st.empty() || + offset >= suballocations1st.back().offset + suballocations1st.back().size); + // Check if it fits before the end of the block. + D3D12MA_ASSERT(offset + request.size <= GetSize()); + + suballocations1st.push_back(newSuballoc); + break; + } + case ALLOC_REQUEST_END_OF_2ND: + { + SuballocationVectorType& suballocations1st = AccessSuballocations1st(); + // New allocation at the end of 2-part ring buffer, so before first allocation from 1st vector. + D3D12MA_ASSERT(!suballocations1st.empty() && + offset + request.size <= suballocations1st[m_1stNullItemsBeginCount].offset); + SuballocationVectorType& suballocations2nd = AccessSuballocations2nd(); + + switch (m_2ndVectorMode) + { + case SECOND_VECTOR_EMPTY: + // First allocation from second part ring buffer. + D3D12MA_ASSERT(suballocations2nd.empty()); + m_2ndVectorMode = SECOND_VECTOR_RING_BUFFER; + break; + case SECOND_VECTOR_RING_BUFFER: + // 2-part ring buffer is already started. + D3D12MA_ASSERT(!suballocations2nd.empty()); + break; + case SECOND_VECTOR_DOUBLE_STACK: + D3D12MA_ASSERT(0 && "CRITICAL ERROR: Trying to use linear allocator as ring buffer while it was already used as double stack."); + break; + default: + D3D12MA_ASSERT(0); + } + + suballocations2nd.push_back(newSuballoc); + break; + } + default: + D3D12MA_ASSERT(0 && "CRITICAL INTERNAL ERROR."); + } + m_SumFreeSize -= newSuballoc.size; +} + +void BlockMetadata_Linear::Free(AllocHandle allocHandle) +{ + SuballocationVectorType& suballocations1st = AccessSuballocations1st(); + SuballocationVectorType& suballocations2nd = AccessSuballocations2nd(); + UINT64 offset = (UINT64)allocHandle - 1; + + if (!suballocations1st.empty()) + { + // First allocation: Mark it as next empty at the beginning. + Suballocation& firstSuballoc = suballocations1st[m_1stNullItemsBeginCount]; + if (firstSuballoc.offset == offset) + { + firstSuballoc.type = SUBALLOCATION_TYPE_FREE; + firstSuballoc.privateData = NULL; + m_SumFreeSize += firstSuballoc.size; + ++m_1stNullItemsBeginCount; + CleanupAfterFree(); + return; + } + } + + // Last allocation in 2-part ring buffer or top of upper stack (same logic). + if (m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER || + m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK) + { + Suballocation& lastSuballoc = suballocations2nd.back(); + if (lastSuballoc.offset == offset) + { + m_SumFreeSize += lastSuballoc.size; + suballocations2nd.pop_back(); + CleanupAfterFree(); + return; + } + } + // Last allocation in 1st vector. + else if (m_2ndVectorMode == SECOND_VECTOR_EMPTY) + { + Suballocation& lastSuballoc = suballocations1st.back(); + if (lastSuballoc.offset == offset) + { + m_SumFreeSize += lastSuballoc.size; + suballocations1st.pop_back(); + CleanupAfterFree(); + return; + } + } + + Suballocation refSuballoc; + refSuballoc.offset = offset; + // Rest of members stays uninitialized intentionally for better performance. + + // Item from the middle of 1st vector. + { + const SuballocationVectorType::iterator it = BinaryFindSorted( + suballocations1st.begin() + m_1stNullItemsBeginCount, + suballocations1st.end(), + refSuballoc, + SuballocationOffsetLess()); + if (it != suballocations1st.end()) + { + it->type = SUBALLOCATION_TYPE_FREE; + it->privateData = NULL; + ++m_1stNullItemsMiddleCount; + m_SumFreeSize += it->size; + CleanupAfterFree(); + return; + } + } + + if (m_2ndVectorMode != SECOND_VECTOR_EMPTY) + { + // Item from the middle of 2nd vector. + const SuballocationVectorType::iterator it = m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER ? + BinaryFindSorted(suballocations2nd.begin(), suballocations2nd.end(), refSuballoc, SuballocationOffsetLess()) : + BinaryFindSorted(suballocations2nd.begin(), suballocations2nd.end(), refSuballoc, SuballocationOffsetGreater()); + if (it != suballocations2nd.end()) + { + it->type = SUBALLOCATION_TYPE_FREE; + it->privateData = NULL; + ++m_2ndNullItemsCount; + m_SumFreeSize += it->size; + CleanupAfterFree(); + return; + } + } + + D3D12MA_ASSERT(0 && "Allocation to free not found in linear allocator!"); +} + +void BlockMetadata_Linear::Clear() +{ + m_SumFreeSize = GetSize(); + m_Suballocations0.clear(); + m_Suballocations1.clear(); + // Leaving m_1stVectorIndex unchanged - it doesn't matter. + m_2ndVectorMode = SECOND_VECTOR_EMPTY; + m_1stNullItemsBeginCount = 0; + m_1stNullItemsMiddleCount = 0; + m_2ndNullItemsCount = 0; +} + +AllocHandle BlockMetadata_Linear::GetAllocationListBegin() const +{ + // Function only used for defragmentation, which is disabled for this algorithm + D3D12MA_ASSERT(0); + return (AllocHandle)0; +} + +AllocHandle BlockMetadata_Linear::GetNextAllocation(AllocHandle prevAlloc) const +{ + // Function only used for defragmentation, which is disabled for this algorithm + D3D12MA_ASSERT(0); + return (AllocHandle)0; +} + +UINT64 BlockMetadata_Linear::GetNextFreeRegionSize(AllocHandle alloc) const +{ + // Function only used for defragmentation, which is disabled for this algorithm + D3D12MA_ASSERT(0); + return 0; +} + +void* BlockMetadata_Linear::GetAllocationPrivateData(AllocHandle allocHandle) const +{ + return FindSuballocation((UINT64)allocHandle - 1).privateData; +} + +void BlockMetadata_Linear::SetAllocationPrivateData(AllocHandle allocHandle, void* privateData) +{ + Suballocation& suballoc = FindSuballocation((UINT64)allocHandle - 1); + suballoc.privateData = privateData; +} + +void BlockMetadata_Linear::AddStatistics(Statistics& inoutStats) const +{ + inoutStats.BlockCount++; + inoutStats.AllocationCount += (UINT)GetAllocationCount(); + inoutStats.BlockBytes += GetSize(); + inoutStats.AllocationBytes += GetSize() - m_SumFreeSize; +} + +void BlockMetadata_Linear::AddDetailedStatistics(DetailedStatistics& inoutStats) const +{ + inoutStats.Stats.BlockCount++; + inoutStats.Stats.BlockBytes += GetSize(); + + const UINT64 size = GetSize(); + const SuballocationVectorType& suballocations1st = AccessSuballocations1st(); + const SuballocationVectorType& suballocations2nd = AccessSuballocations2nd(); + const size_t suballoc1stCount = suballocations1st.size(); + const size_t suballoc2ndCount = suballocations2nd.size(); + + UINT64 lastOffset = 0; + if (m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER) + { + const UINT64 freeSpace2ndTo1stEnd = suballocations1st[m_1stNullItemsBeginCount].offset; + size_t nextAlloc2ndIndex = 0; + while (lastOffset < freeSpace2ndTo1stEnd) + { + // Find next non-null allocation or move nextAllocIndex to the end. + while (nextAlloc2ndIndex < suballoc2ndCount && + suballocations2nd[nextAlloc2ndIndex].privateData == NULL) + { + ++nextAlloc2ndIndex; + } + + // Found non-null allocation. + if (nextAlloc2ndIndex < suballoc2ndCount) + { + const Suballocation& suballoc = suballocations2nd[nextAlloc2ndIndex]; + + // 1. Process free space before this allocation. + if (lastOffset < suballoc.offset) + { + // There is free space from lastOffset to suballoc.offset. + const UINT64 unusedRangeSize = suballoc.offset - lastOffset; + AddDetailedStatisticsUnusedRange(inoutStats, unusedRangeSize); + } + + // 2. Process this allocation. + // There is allocation with suballoc.offset, suballoc.size. + AddDetailedStatisticsAllocation(inoutStats, suballoc.size); + + // 3. Prepare for next iteration. + lastOffset = suballoc.offset + suballoc.size; + ++nextAlloc2ndIndex; + } + // We are at the end. + else + { + // There is free space from lastOffset to freeSpace2ndTo1stEnd. + if (lastOffset < freeSpace2ndTo1stEnd) + { + const UINT64 unusedRangeSize = freeSpace2ndTo1stEnd - lastOffset; + AddDetailedStatisticsUnusedRange(inoutStats, unusedRangeSize); + } + + // End of loop. + lastOffset = freeSpace2ndTo1stEnd; + } + } + } + + size_t nextAlloc1stIndex = m_1stNullItemsBeginCount; + const UINT64 freeSpace1stTo2ndEnd = + m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK ? suballocations2nd.back().offset : size; + while (lastOffset < freeSpace1stTo2ndEnd) + { + // Find next non-null allocation or move nextAllocIndex to the end. + while (nextAlloc1stIndex < suballoc1stCount && + suballocations1st[nextAlloc1stIndex].privateData == NULL) + { + ++nextAlloc1stIndex; + } + + // Found non-null allocation. + if (nextAlloc1stIndex < suballoc1stCount) + { + const Suballocation& suballoc = suballocations1st[nextAlloc1stIndex]; + + // 1. Process free space before this allocation. + if (lastOffset < suballoc.offset) + { + // There is free space from lastOffset to suballoc.offset. + const UINT64 unusedRangeSize = suballoc.offset - lastOffset; + AddDetailedStatisticsUnusedRange(inoutStats, unusedRangeSize); + } + + // 2. Process this allocation. + // There is allocation with suballoc.offset, suballoc.size. + AddDetailedStatisticsAllocation(inoutStats, suballoc.size); + + // 3. Prepare for next iteration. + lastOffset = suballoc.offset + suballoc.size; + ++nextAlloc1stIndex; + } + // We are at the end. + else + { + // There is free space from lastOffset to freeSpace1stTo2ndEnd. + if (lastOffset < freeSpace1stTo2ndEnd) + { + const UINT64 unusedRangeSize = freeSpace1stTo2ndEnd - lastOffset; + AddDetailedStatisticsUnusedRange(inoutStats, unusedRangeSize); + } + + // End of loop. + lastOffset = freeSpace1stTo2ndEnd; + } + } + + if (m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK) + { + size_t nextAlloc2ndIndex = suballocations2nd.size() - 1; + while (lastOffset < size) + { + // Find next non-null allocation or move nextAllocIndex to the end. + while (nextAlloc2ndIndex != SIZE_MAX && + suballocations2nd[nextAlloc2ndIndex].privateData == NULL) + { + --nextAlloc2ndIndex; + } + + // Found non-null allocation. + if (nextAlloc2ndIndex != SIZE_MAX) + { + const Suballocation& suballoc = suballocations2nd[nextAlloc2ndIndex]; + + // 1. Process free space before this allocation. + if (lastOffset < suballoc.offset) + { + // There is free space from lastOffset to suballoc.offset. + const UINT64 unusedRangeSize = suballoc.offset - lastOffset; + AddDetailedStatisticsUnusedRange(inoutStats, unusedRangeSize); + } + + // 2. Process this allocation. + // There is allocation with suballoc.offset, suballoc.size. + AddDetailedStatisticsAllocation(inoutStats, suballoc.size); + + // 3. Prepare for next iteration. + lastOffset = suballoc.offset + suballoc.size; + --nextAlloc2ndIndex; + } + // We are at the end. + else + { + // There is free space from lastOffset to size. + if (lastOffset < size) + { + const UINT64 unusedRangeSize = size - lastOffset; + AddDetailedStatisticsUnusedRange(inoutStats, unusedRangeSize); + } + + // End of loop. + lastOffset = size; + } + } + } +} + +void BlockMetadata_Linear::WriteAllocationInfoToJson(JsonWriter& json) const +{ + const UINT64 size = GetSize(); + const SuballocationVectorType& suballocations1st = AccessSuballocations1st(); + const SuballocationVectorType& suballocations2nd = AccessSuballocations2nd(); + const size_t suballoc1stCount = suballocations1st.size(); + const size_t suballoc2ndCount = suballocations2nd.size(); + + // FIRST PASS + + size_t unusedRangeCount = 0; + UINT64 usedBytes = 0; + + UINT64 lastOffset = 0; + + size_t alloc2ndCount = 0; + if (m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER) + { + const UINT64 freeSpace2ndTo1stEnd = suballocations1st[m_1stNullItemsBeginCount].offset; + size_t nextAlloc2ndIndex = 0; + while (lastOffset < freeSpace2ndTo1stEnd) + { + // Find next non-null allocation or move nextAlloc2ndIndex to the end. + while (nextAlloc2ndIndex < suballoc2ndCount && + suballocations2nd[nextAlloc2ndIndex].privateData == NULL) + { + ++nextAlloc2ndIndex; + } + + // Found non-null allocation. + if (nextAlloc2ndIndex < suballoc2ndCount) + { + const Suballocation& suballoc = suballocations2nd[nextAlloc2ndIndex]; + + // 1. Process free space before this allocation. + if (lastOffset < suballoc.offset) + { + // There is free space from lastOffset to suballoc.offset. + ++unusedRangeCount; + } + + // 2. Process this allocation. + // There is allocation with suballoc.offset, suballoc.size. + ++alloc2ndCount; + usedBytes += suballoc.size; + + // 3. Prepare for next iteration. + lastOffset = suballoc.offset + suballoc.size; + ++nextAlloc2ndIndex; + } + // We are at the end. + else + { + if (lastOffset < freeSpace2ndTo1stEnd) + { + // There is free space from lastOffset to freeSpace2ndTo1stEnd. + ++unusedRangeCount; + } + + // End of loop. + lastOffset = freeSpace2ndTo1stEnd; + } + } + } + + size_t nextAlloc1stIndex = m_1stNullItemsBeginCount; + size_t alloc1stCount = 0; + const UINT64 freeSpace1stTo2ndEnd = + m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK ? suballocations2nd.back().offset : size; + while (lastOffset < freeSpace1stTo2ndEnd) + { + // Find next non-null allocation or move nextAllocIndex to the end. + while (nextAlloc1stIndex < suballoc1stCount && + suballocations1st[nextAlloc1stIndex].privateData == NULL) + { + ++nextAlloc1stIndex; + } + + // Found non-null allocation. + if (nextAlloc1stIndex < suballoc1stCount) + { + const Suballocation& suballoc = suballocations1st[nextAlloc1stIndex]; + + // 1. Process free space before this allocation. + if (lastOffset < suballoc.offset) + { + // There is free space from lastOffset to suballoc.offset. + ++unusedRangeCount; + } + + // 2. Process this allocation. + // There is allocation with suballoc.offset, suballoc.size. + ++alloc1stCount; + usedBytes += suballoc.size; + + // 3. Prepare for next iteration. + lastOffset = suballoc.offset + suballoc.size; + ++nextAlloc1stIndex; + } + // We are at the end. + else + { + if (lastOffset < size) + { + // There is free space from lastOffset to freeSpace1stTo2ndEnd. + ++unusedRangeCount; + } + + // End of loop. + lastOffset = freeSpace1stTo2ndEnd; + } + } + + if (m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK) + { + size_t nextAlloc2ndIndex = suballocations2nd.size() - 1; + while (lastOffset < size) + { + // Find next non-null allocation or move nextAlloc2ndIndex to the end. + while (nextAlloc2ndIndex != SIZE_MAX && + suballocations2nd[nextAlloc2ndIndex].privateData == NULL) + { + --nextAlloc2ndIndex; + } + + // Found non-null allocation. + if (nextAlloc2ndIndex != SIZE_MAX) + { + const Suballocation& suballoc = suballocations2nd[nextAlloc2ndIndex]; + + // 1. Process free space before this allocation. + if (lastOffset < suballoc.offset) + { + // There is free space from lastOffset to suballoc.offset. + ++unusedRangeCount; + } + + // 2. Process this allocation. + // There is allocation with suballoc.offset, suballoc.size. + ++alloc2ndCount; + usedBytes += suballoc.size; + + // 3. Prepare for next iteration. + lastOffset = suballoc.offset + suballoc.size; + --nextAlloc2ndIndex; + } + // We are at the end. + else + { + if (lastOffset < size) + { + // There is free space from lastOffset to size. + ++unusedRangeCount; + } + + // End of loop. + lastOffset = size; + } + } + } + + const UINT64 unusedBytes = size - usedBytes; + PrintDetailedMap_Begin(json, unusedBytes, alloc1stCount + alloc2ndCount, unusedRangeCount); + + // SECOND PASS + lastOffset = 0; + if (m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER) + { + const UINT64 freeSpace2ndTo1stEnd = suballocations1st[m_1stNullItemsBeginCount].offset; + size_t nextAlloc2ndIndex = 0; + while (lastOffset < freeSpace2ndTo1stEnd) + { + // Find next non-null allocation or move nextAlloc2ndIndex to the end. + while (nextAlloc2ndIndex < suballoc2ndCount && + suballocations2nd[nextAlloc2ndIndex].privateData == NULL) + { + ++nextAlloc2ndIndex; + } + + // Found non-null allocation. + if (nextAlloc2ndIndex < suballoc2ndCount) + { + const Suballocation& suballoc = suballocations2nd[nextAlloc2ndIndex]; + + // 1. Process free space before this allocation. + if (lastOffset < suballoc.offset) + { + // There is free space from lastOffset to suballoc.offset. + const UINT64 unusedRangeSize = suballoc.offset - lastOffset; + PrintDetailedMap_UnusedRange(json, lastOffset, unusedRangeSize); + } + + // 2. Process this allocation. + // There is allocation with suballoc.offset, suballoc.size. + PrintDetailedMap_Allocation(json, suballoc.offset, suballoc.size, suballoc.privateData); + + // 3. Prepare for next iteration. + lastOffset = suballoc.offset + suballoc.size; + ++nextAlloc2ndIndex; + } + // We are at the end. + else + { + if (lastOffset < freeSpace2ndTo1stEnd) + { + // There is free space from lastOffset to freeSpace2ndTo1stEnd. + const UINT64 unusedRangeSize = freeSpace2ndTo1stEnd - lastOffset; + PrintDetailedMap_UnusedRange(json, lastOffset, unusedRangeSize); + } + + // End of loop. + lastOffset = freeSpace2ndTo1stEnd; + } + } + } + + nextAlloc1stIndex = m_1stNullItemsBeginCount; + while (lastOffset < freeSpace1stTo2ndEnd) + { + // Find next non-null allocation or move nextAllocIndex to the end. + while (nextAlloc1stIndex < suballoc1stCount && + suballocations1st[nextAlloc1stIndex].privateData == NULL) + { + ++nextAlloc1stIndex; + } + + // Found non-null allocation. + if (nextAlloc1stIndex < suballoc1stCount) + { + const Suballocation& suballoc = suballocations1st[nextAlloc1stIndex]; + + // 1. Process free space before this allocation. + if (lastOffset < suballoc.offset) + { + // There is free space from lastOffset to suballoc.offset. + const UINT64 unusedRangeSize = suballoc.offset - lastOffset; + PrintDetailedMap_UnusedRange(json, lastOffset, unusedRangeSize); + } + + // 2. Process this allocation. + // There is allocation with suballoc.offset, suballoc.size. + PrintDetailedMap_Allocation(json, suballoc.offset, suballoc.size, suballoc.privateData); + + // 3. Prepare for next iteration. + lastOffset = suballoc.offset + suballoc.size; + ++nextAlloc1stIndex; + } + // We are at the end. + else + { + if (lastOffset < freeSpace1stTo2ndEnd) + { + // There is free space from lastOffset to freeSpace1stTo2ndEnd. + const UINT64 unusedRangeSize = freeSpace1stTo2ndEnd - lastOffset; + PrintDetailedMap_UnusedRange(json, lastOffset, unusedRangeSize); + } + + // End of loop. + lastOffset = freeSpace1stTo2ndEnd; + } + } + + if (m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK) + { + size_t nextAlloc2ndIndex = suballocations2nd.size() - 1; + while (lastOffset < size) + { + // Find next non-null allocation or move nextAlloc2ndIndex to the end. + while (nextAlloc2ndIndex != SIZE_MAX && + suballocations2nd[nextAlloc2ndIndex].privateData == NULL) + { + --nextAlloc2ndIndex; + } + + // Found non-null allocation. + if (nextAlloc2ndIndex != SIZE_MAX) + { + const Suballocation& suballoc = suballocations2nd[nextAlloc2ndIndex]; + + // 1. Process free space before this allocation. + if (lastOffset < suballoc.offset) + { + // There is free space from lastOffset to suballoc.offset. + const UINT64 unusedRangeSize = suballoc.offset - lastOffset; + PrintDetailedMap_UnusedRange(json, lastOffset, unusedRangeSize); + } + + // 2. Process this allocation. + // There is allocation with suballoc.offset, suballoc.size. + PrintDetailedMap_Allocation(json, suballoc.offset, suballoc.size, suballoc.privateData); + + // 3. Prepare for next iteration. + lastOffset = suballoc.offset + suballoc.size; + --nextAlloc2ndIndex; + } + // We are at the end. + else + { + if (lastOffset < size) + { + // There is free space from lastOffset to size. + const UINT64 unusedRangeSize = size - lastOffset; + PrintDetailedMap_UnusedRange(json, lastOffset, unusedRangeSize); + } + + // End of loop. + lastOffset = size; + } + } + } + + PrintDetailedMap_End(json); +} + +void BlockMetadata_Linear::DebugLogAllAllocations() const +{ + const SuballocationVectorType& suballocations1st = AccessSuballocations1st(); + for (auto it = suballocations1st.begin() + m_1stNullItemsBeginCount; it != suballocations1st.end(); ++it) + if (it->type != SUBALLOCATION_TYPE_FREE) + DebugLogAllocation(it->offset, it->size, it->privateData); + + const SuballocationVectorType& suballocations2nd = AccessSuballocations2nd(); + for (auto it = suballocations2nd.begin(); it != suballocations2nd.end(); ++it) + if (it->type != SUBALLOCATION_TYPE_FREE) + DebugLogAllocation(it->offset, it->size, it->privateData); +} + +Suballocation& BlockMetadata_Linear::FindSuballocation(UINT64 offset) const +{ + const SuballocationVectorType& suballocations1st = AccessSuballocations1st(); + const SuballocationVectorType& suballocations2nd = AccessSuballocations2nd(); + + Suballocation refSuballoc; + refSuballoc.offset = offset; + // Rest of members stays uninitialized intentionally for better performance. + + // Item from the 1st vector. + { + const SuballocationVectorType::const_iterator it = BinaryFindSorted( + suballocations1st.begin() + m_1stNullItemsBeginCount, + suballocations1st.end(), + refSuballoc, + SuballocationOffsetLess()); + if (it != suballocations1st.end()) + { + return const_cast<Suballocation&>(*it); + } + } + + if (m_2ndVectorMode != SECOND_VECTOR_EMPTY) + { + // Rest of members stays uninitialized intentionally for better performance. + const SuballocationVectorType::const_iterator it = m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER ? + BinaryFindSorted(suballocations2nd.begin(), suballocations2nd.end(), refSuballoc, SuballocationOffsetLess()) : + BinaryFindSorted(suballocations2nd.begin(), suballocations2nd.end(), refSuballoc, SuballocationOffsetGreater()); + if (it != suballocations2nd.end()) + { + return const_cast<Suballocation&>(*it); + } + } + + D3D12MA_ASSERT(0 && "Allocation not found in linear allocator!"); + return const_cast<Suballocation&>(suballocations1st.back()); // Should never occur. +} + +bool BlockMetadata_Linear::ShouldCompact1st() const +{ + const size_t nullItemCount = m_1stNullItemsBeginCount + m_1stNullItemsMiddleCount; + const size_t suballocCount = AccessSuballocations1st().size(); + return suballocCount > 32 && nullItemCount * 2 >= (suballocCount - nullItemCount) * 3; +} + +void BlockMetadata_Linear::CleanupAfterFree() +{ + SuballocationVectorType& suballocations1st = AccessSuballocations1st(); + SuballocationVectorType& suballocations2nd = AccessSuballocations2nd(); + + if (IsEmpty()) + { + suballocations1st.clear(); + suballocations2nd.clear(); + m_1stNullItemsBeginCount = 0; + m_1stNullItemsMiddleCount = 0; + m_2ndNullItemsCount = 0; + m_2ndVectorMode = SECOND_VECTOR_EMPTY; + } + else + { + const size_t suballoc1stCount = suballocations1st.size(); + const size_t nullItem1stCount = m_1stNullItemsBeginCount + m_1stNullItemsMiddleCount; + D3D12MA_ASSERT(nullItem1stCount <= suballoc1stCount); + + // Find more null items at the beginning of 1st vector. + while (m_1stNullItemsBeginCount < suballoc1stCount && + suballocations1st[m_1stNullItemsBeginCount].type == SUBALLOCATION_TYPE_FREE) + { + ++m_1stNullItemsBeginCount; + --m_1stNullItemsMiddleCount; + } + + // Find more null items at the end of 1st vector. + while (m_1stNullItemsMiddleCount > 0 && + suballocations1st.back().type == SUBALLOCATION_TYPE_FREE) + { + --m_1stNullItemsMiddleCount; + suballocations1st.pop_back(); + } + + // Find more null items at the end of 2nd vector. + while (m_2ndNullItemsCount > 0 && + suballocations2nd.back().type == SUBALLOCATION_TYPE_FREE) + { + --m_2ndNullItemsCount; + suballocations2nd.pop_back(); + } + + // Find more null items at the beginning of 2nd vector. + while (m_2ndNullItemsCount > 0 && + suballocations2nd[0].type == SUBALLOCATION_TYPE_FREE) + { + --m_2ndNullItemsCount; + suballocations2nd.remove(0); + } + + if (ShouldCompact1st()) + { + const size_t nonNullItemCount = suballoc1stCount - nullItem1stCount; + size_t srcIndex = m_1stNullItemsBeginCount; + for (size_t dstIndex = 0; dstIndex < nonNullItemCount; ++dstIndex) + { + while (suballocations1st[srcIndex].type == SUBALLOCATION_TYPE_FREE) + { + ++srcIndex; + } + if (dstIndex != srcIndex) + { + suballocations1st[dstIndex] = suballocations1st[srcIndex]; + } + ++srcIndex; + } + suballocations1st.resize(nonNullItemCount); + m_1stNullItemsBeginCount = 0; + m_1stNullItemsMiddleCount = 0; + } + + // 2nd vector became empty. + if (suballocations2nd.empty()) + { + m_2ndVectorMode = SECOND_VECTOR_EMPTY; + } + + // 1st vector became empty. + if (suballocations1st.size() - m_1stNullItemsBeginCount == 0) + { + suballocations1st.clear(); + m_1stNullItemsBeginCount = 0; + + if (!suballocations2nd.empty() && m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER) + { + // Swap 1st with 2nd. Now 2nd is empty. + m_2ndVectorMode = SECOND_VECTOR_EMPTY; + m_1stNullItemsMiddleCount = m_2ndNullItemsCount; + while (m_1stNullItemsBeginCount < suballocations2nd.size() && + suballocations2nd[m_1stNullItemsBeginCount].type == SUBALLOCATION_TYPE_FREE) + { + ++m_1stNullItemsBeginCount; + --m_1stNullItemsMiddleCount; + } + m_2ndNullItemsCount = 0; + m_1stVectorIndex ^= 1; + } + } + } + + D3D12MA_HEAVY_ASSERT(Validate()); +} + +bool BlockMetadata_Linear::CreateAllocationRequest_LowerAddress( + UINT64 allocSize, + UINT64 allocAlignment, + AllocationRequest* pAllocationRequest) +{ + const UINT64 blockSize = GetSize(); + SuballocationVectorType& suballocations1st = AccessSuballocations1st(); + SuballocationVectorType& suballocations2nd = AccessSuballocations2nd(); + + if (m_2ndVectorMode == SECOND_VECTOR_EMPTY || m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK) + { + // Try to allocate at the end of 1st vector. + + UINT64 resultBaseOffset = 0; + if (!suballocations1st.empty()) + { + const Suballocation& lastSuballoc = suballocations1st.back(); + resultBaseOffset = lastSuballoc.offset + lastSuballoc.size + GetDebugMargin(); + } + + // Start from offset equal to beginning of free space. + UINT64 resultOffset = resultBaseOffset; + // Apply alignment. + resultOffset = AlignUp(resultOffset, allocAlignment); + + const UINT64 freeSpaceEnd = m_2ndVectorMode == SECOND_VECTOR_DOUBLE_STACK ? + suballocations2nd.back().offset : blockSize; + + // There is enough free space at the end after alignment. + if (resultOffset + allocSize + GetDebugMargin() <= freeSpaceEnd) + { + // All tests passed: Success. + pAllocationRequest->allocHandle = (AllocHandle)(resultOffset + 1); + // pAllocationRequest->item, customData unused. + pAllocationRequest->algorithmData = ALLOC_REQUEST_END_OF_1ST; + return true; + } + } + + // Wrap-around to end of 2nd vector. Try to allocate there, watching for the + // beginning of 1st vector as the end of free space. + if (m_2ndVectorMode == SECOND_VECTOR_EMPTY || m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER) + { + D3D12MA_ASSERT(!suballocations1st.empty()); + + UINT64 resultBaseOffset = 0; + if (!suballocations2nd.empty()) + { + const Suballocation& lastSuballoc = suballocations2nd.back(); + resultBaseOffset = lastSuballoc.offset + lastSuballoc.size + GetDebugMargin(); + } + + // Start from offset equal to beginning of free space. + UINT64 resultOffset = resultBaseOffset; + + // Apply alignment. + resultOffset = AlignUp(resultOffset, allocAlignment); + + size_t index1st = m_1stNullItemsBeginCount; + // There is enough free space at the end after alignment. + if ((index1st == suballocations1st.size() && resultOffset + allocSize + GetDebugMargin() <= blockSize) || + (index1st < suballocations1st.size() && resultOffset + allocSize + GetDebugMargin() <= suballocations1st[index1st].offset)) + { + // All tests passed: Success. + pAllocationRequest->allocHandle = (AllocHandle)(resultOffset + 1); + pAllocationRequest->algorithmData = ALLOC_REQUEST_END_OF_2ND; + // pAllocationRequest->item, customData unused. + return true; + } + } + return false; +} + +bool BlockMetadata_Linear::CreateAllocationRequest_UpperAddress( + UINT64 allocSize, + UINT64 allocAlignment, + AllocationRequest* pAllocationRequest) +{ + const UINT64 blockSize = GetSize(); + SuballocationVectorType& suballocations1st = AccessSuballocations1st(); + SuballocationVectorType& suballocations2nd = AccessSuballocations2nd(); + + if (m_2ndVectorMode == SECOND_VECTOR_RING_BUFFER) + { + D3D12MA_ASSERT(0 && "Trying to use pool with linear algorithm as double stack, while it is already being used as ring buffer."); + return false; + } + + // Try to allocate before 2nd.back(), or end of block if 2nd.empty(). + if (allocSize > blockSize) + { + return false; + } + UINT64 resultBaseOffset = blockSize - allocSize; + if (!suballocations2nd.empty()) + { + const Suballocation& lastSuballoc = suballocations2nd.back(); + resultBaseOffset = lastSuballoc.offset - allocSize; + if (allocSize > lastSuballoc.offset) + { + return false; + } + } + + // Start from offset equal to end of free space. + UINT64 resultOffset = resultBaseOffset; + // Apply debugMargin at the end. + if (GetDebugMargin() > 0) + { + if (resultOffset < GetDebugMargin()) + { + return false; + } + resultOffset -= GetDebugMargin(); + } + + // Apply alignment. + resultOffset = AlignDown(resultOffset, allocAlignment); + // There is enough free space. + const UINT64 endOf1st = !suballocations1st.empty() ? + suballocations1st.back().offset + suballocations1st.back().size : 0; + + if (endOf1st + GetDebugMargin() <= resultOffset) + { + // All tests passed: Success. + pAllocationRequest->allocHandle = (AllocHandle)(resultOffset + 1); + // pAllocationRequest->item unused. + pAllocationRequest->algorithmData = ALLOC_REQUEST_UPPER_ADDRESS; + return true; + } + return false; +} +#endif // _D3D12MA_BLOCK_METADATA_LINEAR_FUNCTIONS +#endif // _D3D12MA_BLOCK_METADATA_LINEAR + +#ifndef _D3D12MA_BLOCK_METADATA_TLSF +class BlockMetadata_TLSF : public BlockMetadata +{ +public: + BlockMetadata_TLSF(const ALLOCATION_CALLBACKS* allocationCallbacks, bool isVirtual); + virtual ~BlockMetadata_TLSF(); + + size_t GetAllocationCount() const override { return m_AllocCount; } + size_t GetFreeRegionsCount() const override { return m_BlocksFreeCount + 1; } + UINT64 GetSumFreeSize() const override { return m_BlocksFreeSize + m_NullBlock->size; } + bool IsEmpty() const override { return m_NullBlock->offset == 0; } + UINT64 GetAllocationOffset(AllocHandle allocHandle) const override { return ((Block*)allocHandle)->offset; }; + + void Init(UINT64 size) override; + bool Validate() const override; + void GetAllocationInfo(AllocHandle allocHandle, VIRTUAL_ALLOCATION_INFO& outInfo) const override; + + bool CreateAllocationRequest( + UINT64 allocSize, + UINT64 allocAlignment, + bool upperAddress, + UINT32 strategy, + AllocationRequest* pAllocationRequest) override; + + void Alloc( + const AllocationRequest& request, + UINT64 allocSize, + void* privateData) override; + + void Free(AllocHandle allocHandle) override; + void Clear() override; + + AllocHandle GetAllocationListBegin() const override; + AllocHandle GetNextAllocation(AllocHandle prevAlloc) const override; + UINT64 GetNextFreeRegionSize(AllocHandle alloc) const override; + void* GetAllocationPrivateData(AllocHandle allocHandle) const override; + void SetAllocationPrivateData(AllocHandle allocHandle, void* privateData) override; + + void AddStatistics(Statistics& inoutStats) const override; + void AddDetailedStatistics(DetailedStatistics& inoutStats) const override; + void WriteAllocationInfoToJson(JsonWriter& json) const override; + void DebugLogAllAllocations() const override; + +private: + // According to original paper it should be preferable 4 or 5: + // M. Masmano, I. Ripoll, A. Crespo, and J. Real "TLSF: a New Dynamic Memory Allocator for Real-Time Systems" + // http://www.gii.upv.es/tlsf/files/ecrts04_tlsf.pdf + static const UINT8 SECOND_LEVEL_INDEX = 5; + static const UINT16 SMALL_BUFFER_SIZE = 256; + static const UINT INITIAL_BLOCK_ALLOC_COUNT = 16; + static const UINT8 MEMORY_CLASS_SHIFT = 7; + static const UINT8 MAX_MEMORY_CLASSES = 65 - MEMORY_CLASS_SHIFT; + + class Block + { + public: + UINT64 offset; + UINT64 size; + Block* prevPhysical; + Block* nextPhysical; + + void MarkFree() { prevFree = NULL; } + void MarkTaken() { prevFree = this; } + bool IsFree() const { return prevFree != this; } + void*& PrivateData() { D3D12MA_HEAVY_ASSERT(!IsFree()); return privateData; } + Block*& PrevFree() { return prevFree; } + Block*& NextFree() { D3D12MA_HEAVY_ASSERT(IsFree()); return nextFree; } + + private: + Block* prevFree; // Address of the same block here indicates that block is taken + union + { + Block* nextFree; + void* privateData; + }; + }; + + size_t m_AllocCount = 0; + // Total number of free blocks besides null block + size_t m_BlocksFreeCount = 0; + // Total size of free blocks excluding null block + UINT64 m_BlocksFreeSize = 0; + UINT32 m_IsFreeBitmap = 0; + UINT8 m_MemoryClasses = 0; + UINT32 m_InnerIsFreeBitmap[MAX_MEMORY_CLASSES]; + UINT32 m_ListsCount = 0; + /* + * 0: 0-3 lists for small buffers + * 1+: 0-(2^SLI-1) lists for normal buffers + */ + Block** m_FreeList = NULL; + PoolAllocator<Block> m_BlockAllocator; + Block* m_NullBlock = NULL; + + UINT8 SizeToMemoryClass(UINT64 size) const; + UINT16 SizeToSecondIndex(UINT64 size, UINT8 memoryClass) const; + UINT32 GetListIndex(UINT8 memoryClass, UINT16 secondIndex) const; + UINT32 GetListIndex(UINT64 size) const; + + void RemoveFreeBlock(Block* block); + void InsertFreeBlock(Block* block); + void MergeBlock(Block* block, Block* prev); + + Block* FindFreeBlock(UINT64 size, UINT32& listIndex) const; + bool CheckBlock( + Block& block, + UINT32 listIndex, + UINT64 allocSize, + UINT64 allocAlignment, + AllocationRequest* pAllocationRequest); + + D3D12MA_CLASS_NO_COPY(BlockMetadata_TLSF) +}; + +#ifndef _D3D12MA_BLOCK_METADATA_TLSF_FUNCTIONS +BlockMetadata_TLSF::BlockMetadata_TLSF(const ALLOCATION_CALLBACKS* allocationCallbacks, bool isVirtual) + : BlockMetadata(allocationCallbacks, isVirtual), + m_BlockAllocator(*allocationCallbacks, INITIAL_BLOCK_ALLOC_COUNT) +{ + D3D12MA_ASSERT(allocationCallbacks); +} + +BlockMetadata_TLSF::~BlockMetadata_TLSF() +{ + D3D12MA_DELETE_ARRAY(*GetAllocs(), m_FreeList, m_ListsCount); +} + +void BlockMetadata_TLSF::Init(UINT64 size) +{ + BlockMetadata::Init(size); + + m_NullBlock = m_BlockAllocator.Alloc(); + m_NullBlock->size = size; + m_NullBlock->offset = 0; + m_NullBlock->prevPhysical = NULL; + m_NullBlock->nextPhysical = NULL; + m_NullBlock->MarkFree(); + m_NullBlock->NextFree() = NULL; + m_NullBlock->PrevFree() = NULL; + UINT8 memoryClass = SizeToMemoryClass(size); + UINT16 sli = SizeToSecondIndex(size, memoryClass); + m_ListsCount = (memoryClass == 0 ? 0 : (memoryClass - 1) * (1UL << SECOND_LEVEL_INDEX) + sli) + 1; + if (IsVirtual()) + m_ListsCount += 1UL << SECOND_LEVEL_INDEX; + else + m_ListsCount += 4; + + m_MemoryClasses = memoryClass + 2; + memset(m_InnerIsFreeBitmap, 0, MAX_MEMORY_CLASSES * sizeof(UINT32)); + + m_FreeList = D3D12MA_NEW_ARRAY(*GetAllocs(), Block*, m_ListsCount); + memset(m_FreeList, 0, m_ListsCount * sizeof(Block*)); +} + +bool BlockMetadata_TLSF::Validate() const +{ + D3D12MA_VALIDATE(GetSumFreeSize() <= GetSize()); + + UINT64 calculatedSize = m_NullBlock->size; + UINT64 calculatedFreeSize = m_NullBlock->size; + size_t allocCount = 0; + size_t freeCount = 0; + + // Check integrity of free lists + for (UINT32 list = 0; list < m_ListsCount; ++list) + { + Block* block = m_FreeList[list]; + if (block != NULL) + { + D3D12MA_VALIDATE(block->IsFree()); + D3D12MA_VALIDATE(block->PrevFree() == NULL); + while (block->NextFree()) + { + D3D12MA_VALIDATE(block->NextFree()->IsFree()); + D3D12MA_VALIDATE(block->NextFree()->PrevFree() == block); + block = block->NextFree(); + } + } + } + + D3D12MA_VALIDATE(m_NullBlock->nextPhysical == NULL); + if (m_NullBlock->prevPhysical) + { + D3D12MA_VALIDATE(m_NullBlock->prevPhysical->nextPhysical == m_NullBlock); + } + + // Check all blocks + UINT64 nextOffset = m_NullBlock->offset; + for (Block* prev = m_NullBlock->prevPhysical; prev != NULL; prev = prev->prevPhysical) + { + D3D12MA_VALIDATE(prev->offset + prev->size == nextOffset); + nextOffset = prev->offset; + calculatedSize += prev->size; + + UINT32 listIndex = GetListIndex(prev->size); + if (prev->IsFree()) + { + ++freeCount; + // Check if free block belongs to free list + Block* freeBlock = m_FreeList[listIndex]; + D3D12MA_VALIDATE(freeBlock != NULL); + + bool found = false; + do + { + if (freeBlock == prev) + found = true; + + freeBlock = freeBlock->NextFree(); + } while (!found && freeBlock != NULL); + + D3D12MA_VALIDATE(found); + calculatedFreeSize += prev->size; + } + else + { + ++allocCount; + // Check if taken block is not on a free list + Block* freeBlock = m_FreeList[listIndex]; + while (freeBlock) + { + D3D12MA_VALIDATE(freeBlock != prev); + freeBlock = freeBlock->NextFree(); + } + } + + if (prev->prevPhysical) + { + D3D12MA_VALIDATE(prev->prevPhysical->nextPhysical == prev); + } + } + + D3D12MA_VALIDATE(nextOffset == 0); + D3D12MA_VALIDATE(calculatedSize == GetSize()); + D3D12MA_VALIDATE(calculatedFreeSize == GetSumFreeSize()); + D3D12MA_VALIDATE(allocCount == m_AllocCount); + D3D12MA_VALIDATE(freeCount == m_BlocksFreeCount); + + return true; +} + +void BlockMetadata_TLSF::GetAllocationInfo(AllocHandle allocHandle, VIRTUAL_ALLOCATION_INFO& outInfo) const +{ + Block* block = (Block*)allocHandle; + D3D12MA_ASSERT(!block->IsFree() && "Cannot get allocation info for free block!"); + outInfo.Offset = block->offset; + outInfo.Size = block->size; + outInfo.pPrivateData = block->PrivateData(); +} + +bool BlockMetadata_TLSF::CreateAllocationRequest( + UINT64 allocSize, + UINT64 allocAlignment, + bool upperAddress, + UINT32 strategy, + AllocationRequest* pAllocationRequest) +{ + D3D12MA_ASSERT(allocSize > 0 && "Cannot allocate empty block!"); + D3D12MA_ASSERT(!upperAddress && "ALLOCATION_FLAG_UPPER_ADDRESS can be used only with linear algorithm."); + D3D12MA_ASSERT(pAllocationRequest != NULL); + D3D12MA_HEAVY_ASSERT(Validate()); + + allocSize += GetDebugMargin(); + // Quick check for too small pool + if (allocSize > GetSumFreeSize()) + return false; + + // If no free blocks in pool then check only null block + if (m_BlocksFreeCount == 0) + return CheckBlock(*m_NullBlock, m_ListsCount, allocSize, allocAlignment, pAllocationRequest); + + // Round up to the next block + UINT64 sizeForNextList = allocSize; + UINT16 smallSizeStep = SMALL_BUFFER_SIZE / (IsVirtual() ? 1 << SECOND_LEVEL_INDEX : 4); + if (allocSize > SMALL_BUFFER_SIZE) + { + sizeForNextList += (1ULL << (BitScanMSB(allocSize) - SECOND_LEVEL_INDEX)); + } + else if (allocSize > SMALL_BUFFER_SIZE - smallSizeStep) + sizeForNextList = SMALL_BUFFER_SIZE + 1; + else + sizeForNextList += smallSizeStep; + + UINT32 nextListIndex = 0; + UINT32 prevListIndex = 0; + Block* nextListBlock = NULL; + Block* prevListBlock = NULL; + + // Check blocks according to strategies + if (strategy & ALLOCATION_FLAG_STRATEGY_MIN_TIME) + { + // Quick check for larger block first + nextListBlock = FindFreeBlock(sizeForNextList, nextListIndex); + if (nextListBlock != NULL && CheckBlock(*nextListBlock, nextListIndex, allocSize, allocAlignment, pAllocationRequest)) + return true; + + // If not fitted then null block + if (CheckBlock(*m_NullBlock, m_ListsCount, allocSize, allocAlignment, pAllocationRequest)) + return true; + + // Null block failed, search larger bucket + while (nextListBlock) + { + if (CheckBlock(*nextListBlock, nextListIndex, allocSize, allocAlignment, pAllocationRequest)) + return true; + nextListBlock = nextListBlock->NextFree(); + } + + // Failed again, check best fit bucket + prevListBlock = FindFreeBlock(allocSize, prevListIndex); + while (prevListBlock) + { + if (CheckBlock(*prevListBlock, prevListIndex, allocSize, allocAlignment, pAllocationRequest)) + return true; + prevListBlock = prevListBlock->NextFree(); + } + } + else if (strategy & ALLOCATION_FLAG_STRATEGY_MIN_MEMORY) + { + // Check best fit bucket + prevListBlock = FindFreeBlock(allocSize, prevListIndex); + while (prevListBlock) + { + if (CheckBlock(*prevListBlock, prevListIndex, allocSize, allocAlignment, pAllocationRequest)) + return true; + prevListBlock = prevListBlock->NextFree(); + } + + // If failed check null block + if (CheckBlock(*m_NullBlock, m_ListsCount, allocSize, allocAlignment, pAllocationRequest)) + return true; + + // Check larger bucket + nextListBlock = FindFreeBlock(sizeForNextList, nextListIndex); + while (nextListBlock) + { + if (CheckBlock(*nextListBlock, nextListIndex, allocSize, allocAlignment, pAllocationRequest)) + return true; + nextListBlock = nextListBlock->NextFree(); + } + } + else if (strategy & ALLOCATION_FLAG_STRATEGY_MIN_OFFSET) + { + // Perform search from the start + Vector<Block*> blockList(m_BlocksFreeCount, *GetAllocs()); + + size_t i = m_BlocksFreeCount; + for (Block* block = m_NullBlock->prevPhysical; block != NULL; block = block->prevPhysical) + { + if (block->IsFree() && block->size >= allocSize) + blockList[--i] = block; + } + + for (; i < m_BlocksFreeCount; ++i) + { + Block& block = *blockList[i]; + if (CheckBlock(block, GetListIndex(block.size), allocSize, allocAlignment, pAllocationRequest)) + return true; + } + + // If failed check null block + if (CheckBlock(*m_NullBlock, m_ListsCount, allocSize, allocAlignment, pAllocationRequest)) + return true; + + // Whole range searched, no more memory + return false; + } + else + { + // Check larger bucket + nextListBlock = FindFreeBlock(sizeForNextList, nextListIndex); + while (nextListBlock) + { + if (CheckBlock(*nextListBlock, nextListIndex, allocSize, allocAlignment, pAllocationRequest)) + return true; + nextListBlock = nextListBlock->NextFree(); + } + + // If failed check null block + if (CheckBlock(*m_NullBlock, m_ListsCount, allocSize, allocAlignment, pAllocationRequest)) + return true; + + // Check best fit bucket + prevListBlock = FindFreeBlock(allocSize, prevListIndex); + while (prevListBlock) + { + if (CheckBlock(*prevListBlock, prevListIndex, allocSize, allocAlignment, pAllocationRequest)) + return true; + prevListBlock = prevListBlock->NextFree(); + } + } + + // Worst case, full search has to be done + while (++nextListIndex < m_ListsCount) + { + nextListBlock = m_FreeList[nextListIndex]; + while (nextListBlock) + { + if (CheckBlock(*nextListBlock, nextListIndex, allocSize, allocAlignment, pAllocationRequest)) + return true; + nextListBlock = nextListBlock->NextFree(); + } + } + + // No more memory sadly + return false; +} + +void BlockMetadata_TLSF::Alloc( + const AllocationRequest& request, + UINT64 allocSize, + void* privateData) +{ + // Get block and pop it from the free list + Block* currentBlock = (Block*)request.allocHandle; + UINT64 offset = request.algorithmData; + D3D12MA_ASSERT(currentBlock != NULL); + D3D12MA_ASSERT(currentBlock->offset <= offset); + + if (currentBlock != m_NullBlock) + RemoveFreeBlock(currentBlock); + + // Append missing alignment to prev block or create new one + UINT64 misssingAlignment = offset - currentBlock->offset; + if (misssingAlignment) + { + Block* prevBlock = currentBlock->prevPhysical; + D3D12MA_ASSERT(prevBlock != NULL && "There should be no missing alignment at offset 0!"); + + if (prevBlock->IsFree() && prevBlock->size != GetDebugMargin()) + { + UINT32 oldList = GetListIndex(prevBlock->size); + prevBlock->size += misssingAlignment; + // Check if new size crosses list bucket + if (oldList != GetListIndex(prevBlock->size)) + { + prevBlock->size -= misssingAlignment; + RemoveFreeBlock(prevBlock); + prevBlock->size += misssingAlignment; + InsertFreeBlock(prevBlock); + } + else + m_BlocksFreeSize += misssingAlignment; + } + else + { + Block* newBlock = m_BlockAllocator.Alloc(); + currentBlock->prevPhysical = newBlock; + prevBlock->nextPhysical = newBlock; + newBlock->prevPhysical = prevBlock; + newBlock->nextPhysical = currentBlock; + newBlock->size = misssingAlignment; + newBlock->offset = currentBlock->offset; + newBlock->MarkTaken(); + + InsertFreeBlock(newBlock); + } + + currentBlock->size -= misssingAlignment; + currentBlock->offset += misssingAlignment; + } + + UINT64 size = request.size + GetDebugMargin(); + if (currentBlock->size == size) + { + if (currentBlock == m_NullBlock) + { + // Setup new null block + m_NullBlock = m_BlockAllocator.Alloc(); + m_NullBlock->size = 0; + m_NullBlock->offset = currentBlock->offset + size; + m_NullBlock->prevPhysical = currentBlock; + m_NullBlock->nextPhysical = NULL; + m_NullBlock->MarkFree(); + m_NullBlock->PrevFree() = NULL; + m_NullBlock->NextFree() = NULL; + currentBlock->nextPhysical = m_NullBlock; + currentBlock->MarkTaken(); + } + } + else + { + D3D12MA_ASSERT(currentBlock->size > size && "Proper block already found, shouldn't find smaller one!"); + + // Create new free block + Block* newBlock = m_BlockAllocator.Alloc(); + newBlock->size = currentBlock->size - size; + newBlock->offset = currentBlock->offset + size; + newBlock->prevPhysical = currentBlock; + newBlock->nextPhysical = currentBlock->nextPhysical; + currentBlock->nextPhysical = newBlock; + currentBlock->size = size; + + if (currentBlock == m_NullBlock) + { + m_NullBlock = newBlock; + m_NullBlock->MarkFree(); + m_NullBlock->NextFree() = NULL; + m_NullBlock->PrevFree() = NULL; + currentBlock->MarkTaken(); + } + else + { + newBlock->nextPhysical->prevPhysical = newBlock; + newBlock->MarkTaken(); + InsertFreeBlock(newBlock); + } + } + currentBlock->PrivateData() = privateData; + + if (GetDebugMargin() > 0) + { + currentBlock->size -= GetDebugMargin(); + Block* newBlock = m_BlockAllocator.Alloc(); + newBlock->size = GetDebugMargin(); + newBlock->offset = currentBlock->offset + currentBlock->size; + newBlock->prevPhysical = currentBlock; + newBlock->nextPhysical = currentBlock->nextPhysical; + newBlock->MarkTaken(); + currentBlock->nextPhysical->prevPhysical = newBlock; + currentBlock->nextPhysical = newBlock; + InsertFreeBlock(newBlock); + } + ++m_AllocCount; +} + +void BlockMetadata_TLSF::Free(AllocHandle allocHandle) +{ + Block* block = (Block*)allocHandle; + Block* next = block->nextPhysical; + D3D12MA_ASSERT(!block->IsFree() && "Block is already free!"); + + --m_AllocCount; + if (GetDebugMargin() > 0) + { + RemoveFreeBlock(next); + MergeBlock(next, block); + block = next; + next = next->nextPhysical; + } + + // Try merging + Block* prev = block->prevPhysical; + if (prev != NULL && prev->IsFree() && prev->size != GetDebugMargin()) + { + RemoveFreeBlock(prev); + MergeBlock(block, prev); + } + + if (!next->IsFree()) + InsertFreeBlock(block); + else if (next == m_NullBlock) + MergeBlock(m_NullBlock, block); + else + { + RemoveFreeBlock(next); + MergeBlock(next, block); + InsertFreeBlock(next); + } +} + +void BlockMetadata_TLSF::Clear() +{ + m_AllocCount = 0; + m_BlocksFreeCount = 0; + m_BlocksFreeSize = 0; + m_IsFreeBitmap = 0; + m_NullBlock->offset = 0; + m_NullBlock->size = GetSize(); + Block* block = m_NullBlock->prevPhysical; + m_NullBlock->prevPhysical = NULL; + while (block) + { + Block* prev = block->prevPhysical; + m_BlockAllocator.Free(block); + block = prev; + } + memset(m_FreeList, 0, m_ListsCount * sizeof(Block*)); + memset(m_InnerIsFreeBitmap, 0, m_MemoryClasses * sizeof(UINT32)); +} + +AllocHandle BlockMetadata_TLSF::GetAllocationListBegin() const +{ + if (m_AllocCount == 0) + return (AllocHandle)0; + + for (Block* block = m_NullBlock->prevPhysical; block; block = block->prevPhysical) + { + if (!block->IsFree()) + return (AllocHandle)block; + } + D3D12MA_ASSERT(false && "If m_AllocCount > 0 then should find any allocation!"); + return (AllocHandle)0; +} + +AllocHandle BlockMetadata_TLSF::GetNextAllocation(AllocHandle prevAlloc) const +{ + Block* startBlock = (Block*)prevAlloc; + D3D12MA_ASSERT(!startBlock->IsFree() && "Incorrect block!"); + + for (Block* block = startBlock->prevPhysical; block; block = block->prevPhysical) + { + if (!block->IsFree()) + return (AllocHandle)block; + } + return (AllocHandle)0; +} + +UINT64 BlockMetadata_TLSF::GetNextFreeRegionSize(AllocHandle alloc) const +{ + Block* block = (Block*)alloc; + D3D12MA_ASSERT(!block->IsFree() && "Incorrect block!"); + + if (block->prevPhysical) + return block->prevPhysical->IsFree() ? block->prevPhysical->size : 0; + return 0; +} + +void* BlockMetadata_TLSF::GetAllocationPrivateData(AllocHandle allocHandle) const +{ + Block* block = (Block*)allocHandle; + D3D12MA_ASSERT(!block->IsFree() && "Cannot get user data for free block!"); + return block->PrivateData(); +} + +void BlockMetadata_TLSF::SetAllocationPrivateData(AllocHandle allocHandle, void* privateData) +{ + Block* block = (Block*)allocHandle; + D3D12MA_ASSERT(!block->IsFree() && "Trying to set user data for not allocated block!"); + block->PrivateData() = privateData; +} + +void BlockMetadata_TLSF::AddStatistics(Statistics& inoutStats) const +{ + inoutStats.BlockCount++; + inoutStats.AllocationCount += static_cast<UINT>(m_AllocCount); + inoutStats.BlockBytes += GetSize(); + inoutStats.AllocationBytes += GetSize() - GetSumFreeSize(); +} + +void BlockMetadata_TLSF::AddDetailedStatistics(DetailedStatistics& inoutStats) const +{ + inoutStats.Stats.BlockCount++; + inoutStats.Stats.BlockBytes += GetSize(); + + for (Block* block = m_NullBlock->prevPhysical; block != NULL; block = block->prevPhysical) + { + if (block->IsFree()) + AddDetailedStatisticsUnusedRange(inoutStats, block->size); + else + AddDetailedStatisticsAllocation(inoutStats, block->size); + } + + if (m_NullBlock->size > 0) + AddDetailedStatisticsUnusedRange(inoutStats, m_NullBlock->size); +} + +void BlockMetadata_TLSF::WriteAllocationInfoToJson(JsonWriter& json) const +{ + size_t blockCount = m_AllocCount + m_BlocksFreeCount; + Vector<Block*> blockList(blockCount, *GetAllocs()); + + size_t i = blockCount; + if (m_NullBlock->size > 0) + { + ++blockCount; + blockList.push_back(m_NullBlock); + } + for (Block* block = m_NullBlock->prevPhysical; block != NULL; block = block->prevPhysical) + { + blockList[--i] = block; + } + D3D12MA_ASSERT(i == 0); + + PrintDetailedMap_Begin(json, GetSumFreeSize(), GetAllocationCount(), m_BlocksFreeCount + static_cast<bool>(m_NullBlock->size)); + for (; i < blockCount; ++i) + { + Block* block = blockList[i]; + if (block->IsFree()) + PrintDetailedMap_UnusedRange(json, block->offset, block->size); + else + PrintDetailedMap_Allocation(json, block->offset, block->size, block->PrivateData()); + } + PrintDetailedMap_End(json); +} + +void BlockMetadata_TLSF::DebugLogAllAllocations() const +{ + for (Block* block = m_NullBlock->prevPhysical; block != NULL; block = block->prevPhysical) + { + if (!block->IsFree()) + { + DebugLogAllocation(block->offset, block->size, block->PrivateData()); + } + } +} + +UINT8 BlockMetadata_TLSF::SizeToMemoryClass(UINT64 size) const +{ + if (size > SMALL_BUFFER_SIZE) + return BitScanMSB(size) - MEMORY_CLASS_SHIFT; + return 0; +} + +UINT16 BlockMetadata_TLSF::SizeToSecondIndex(UINT64 size, UINT8 memoryClass) const +{ + if (memoryClass == 0) + { + if (IsVirtual()) + return static_cast<UINT16>((size - 1) / 8); + else + return static_cast<UINT16>((size - 1) / 64); + } + return static_cast<UINT16>((size >> (memoryClass + MEMORY_CLASS_SHIFT - SECOND_LEVEL_INDEX)) ^ (1U << SECOND_LEVEL_INDEX)); +} + +UINT32 BlockMetadata_TLSF::GetListIndex(UINT8 memoryClass, UINT16 secondIndex) const +{ + if (memoryClass == 0) + return secondIndex; + + const UINT32 index = static_cast<UINT32>(memoryClass - 1) * (1 << SECOND_LEVEL_INDEX) + secondIndex; + if (IsVirtual()) + return index + (1 << SECOND_LEVEL_INDEX); + else + return index + 4; +} + +UINT32 BlockMetadata_TLSF::GetListIndex(UINT64 size) const +{ + UINT8 memoryClass = SizeToMemoryClass(size); + return GetListIndex(memoryClass, SizeToSecondIndex(size, memoryClass)); +} + +void BlockMetadata_TLSF::RemoveFreeBlock(Block* block) +{ + D3D12MA_ASSERT(block != m_NullBlock); + D3D12MA_ASSERT(block->IsFree()); + + if (block->NextFree() != NULL) + block->NextFree()->PrevFree() = block->PrevFree(); + if (block->PrevFree() != NULL) + block->PrevFree()->NextFree() = block->NextFree(); + else + { + UINT8 memClass = SizeToMemoryClass(block->size); + UINT16 secondIndex = SizeToSecondIndex(block->size, memClass); + UINT32 index = GetListIndex(memClass, secondIndex); + m_FreeList[index] = block->NextFree(); + if (block->NextFree() == NULL) + { + m_InnerIsFreeBitmap[memClass] &= ~(1U << secondIndex); + if (m_InnerIsFreeBitmap[memClass] == 0) + m_IsFreeBitmap &= ~(1UL << memClass); + } + } + block->MarkTaken(); + block->PrivateData() = NULL; + --m_BlocksFreeCount; + m_BlocksFreeSize -= block->size; +} + +void BlockMetadata_TLSF::InsertFreeBlock(Block* block) +{ + D3D12MA_ASSERT(block != m_NullBlock); + D3D12MA_ASSERT(!block->IsFree() && "Cannot insert block twice!"); + + UINT8 memClass = SizeToMemoryClass(block->size); + UINT16 secondIndex = SizeToSecondIndex(block->size, memClass); + UINT32 index = GetListIndex(memClass, secondIndex); + block->PrevFree() = NULL; + block->NextFree() = m_FreeList[index]; + m_FreeList[index] = block; + if (block->NextFree() != NULL) + block->NextFree()->PrevFree() = block; + else + { + m_InnerIsFreeBitmap[memClass] |= 1U << secondIndex; + m_IsFreeBitmap |= 1UL << memClass; + } + ++m_BlocksFreeCount; + m_BlocksFreeSize += block->size; +} + +void BlockMetadata_TLSF::MergeBlock(Block* block, Block* prev) +{ + D3D12MA_ASSERT(block->prevPhysical == prev && "Cannot merge seperate physical regions!"); + D3D12MA_ASSERT(!prev->IsFree() && "Cannot merge block that belongs to free list!"); + + block->offset = prev->offset; + block->size += prev->size; + block->prevPhysical = prev->prevPhysical; + if (block->prevPhysical) + block->prevPhysical->nextPhysical = block; + m_BlockAllocator.Free(prev); +} + +BlockMetadata_TLSF::Block* BlockMetadata_TLSF::FindFreeBlock(UINT64 size, UINT32& listIndex) const +{ + UINT8 memoryClass = SizeToMemoryClass(size); + UINT32 innerFreeMap = m_InnerIsFreeBitmap[memoryClass] & (~0U << SizeToSecondIndex(size, memoryClass)); + if (!innerFreeMap) + { + // Check higher levels for avaiable blocks + UINT32 freeMap = m_IsFreeBitmap & (~0UL << (memoryClass + 1)); + if (!freeMap) + return NULL; // No more memory avaible + + // Find lowest free region + memoryClass = BitScanLSB(freeMap); + innerFreeMap = m_InnerIsFreeBitmap[memoryClass]; + D3D12MA_ASSERT(innerFreeMap != 0); + } + // Find lowest free subregion + listIndex = GetListIndex(memoryClass, BitScanLSB(innerFreeMap)); + return m_FreeList[listIndex]; +} + +bool BlockMetadata_TLSF::CheckBlock( + Block& block, + UINT32 listIndex, + UINT64 allocSize, + UINT64 allocAlignment, + AllocationRequest* pAllocationRequest) +{ + D3D12MA_ASSERT(block.IsFree() && "Block is already taken!"); + + UINT64 alignedOffset = AlignUp(block.offset, allocAlignment); + if (block.size < allocSize + alignedOffset - block.offset) + return false; + + // Alloc successful + pAllocationRequest->allocHandle = (AllocHandle)█ + pAllocationRequest->size = allocSize - GetDebugMargin(); + pAllocationRequest->algorithmData = alignedOffset; + + // Place block at the start of list if it's normal block + if (listIndex != m_ListsCount && block.PrevFree()) + { + block.PrevFree()->NextFree() = block.NextFree(); + if (block.NextFree()) + block.NextFree()->PrevFree() = block.PrevFree(); + block.PrevFree() = NULL; + block.NextFree() = m_FreeList[listIndex]; + m_FreeList[listIndex] = █ + if (block.NextFree()) + block.NextFree()->PrevFree() = █ + } + + return true; +} +#endif // _D3D12MA_BLOCK_METADATA_TLSF_FUNCTIONS +#endif // _D3D12MA_BLOCK_METADATA_TLSF + +#ifndef _D3D12MA_MEMORY_BLOCK +/* +Represents a single block of device memory (heap). +Base class for inheritance. +Thread-safety: This class must be externally synchronized. +*/ +class MemoryBlock +{ +public: + // Creates the ID3D12Heap. + MemoryBlock( + AllocatorPimpl* allocator, + const D3D12_HEAP_PROPERTIES& heapProps, + D3D12_HEAP_FLAGS heapFlags, + UINT64 size, + UINT id); + virtual ~MemoryBlock(); + + const D3D12_HEAP_PROPERTIES& GetHeapProperties() const { return m_HeapProps; } + D3D12_HEAP_FLAGS GetHeapFlags() const { return m_HeapFlags; } + UINT64 GetSize() const { return m_Size; } + UINT GetId() const { return m_Id; } + ID3D12Heap* GetHeap() const { return m_Heap; } + +protected: + AllocatorPimpl* const m_Allocator; + const D3D12_HEAP_PROPERTIES m_HeapProps; + const D3D12_HEAP_FLAGS m_HeapFlags; + const UINT64 m_Size; + const UINT m_Id; + + HRESULT Init(ID3D12ProtectedResourceSession* pProtectedSession, bool denyMsaaTextures); + +private: + ID3D12Heap* m_Heap = NULL; + + D3D12MA_CLASS_NO_COPY(MemoryBlock) +}; +#endif // _D3D12MA_MEMORY_BLOCK + +#ifndef _D3D12MA_NORMAL_BLOCK +/* +Represents a single block of device memory (heap) with all the data about its +regions (aka suballocations, Allocation), assigned and free. +Thread-safety: This class must be externally synchronized. +*/ +class NormalBlock : public MemoryBlock +{ +public: + BlockMetadata* m_pMetadata; + + NormalBlock( + AllocatorPimpl* allocator, + BlockVector* blockVector, + const D3D12_HEAP_PROPERTIES& heapProps, + D3D12_HEAP_FLAGS heapFlags, + UINT64 size, + UINT id); + virtual ~NormalBlock(); + + BlockVector* GetBlockVector() const { return m_BlockVector; } + + // 'algorithm' should be one of the *_ALGORITHM_* flags in enums POOL_FLAGS or VIRTUAL_BLOCK_FLAGS + HRESULT Init(UINT32 algorithm, ID3D12ProtectedResourceSession* pProtectedSession, bool denyMsaaTextures); + + // Validates all data structures inside this object. If not valid, returns false. + bool Validate() const; + +private: + BlockVector* m_BlockVector; + + D3D12MA_CLASS_NO_COPY(NormalBlock) +}; +#endif // _D3D12MA_NORMAL_BLOCK + +#ifndef _D3D12MA_COMMITTED_ALLOCATION_LIST_ITEM_TRAITS +struct CommittedAllocationListItemTraits +{ + using ItemType = Allocation; + + static ItemType* GetPrev(const ItemType* item) + { + D3D12MA_ASSERT(item->m_PackedData.GetType() == Allocation::TYPE_COMMITTED || item->m_PackedData.GetType() == Allocation::TYPE_HEAP); + return item->m_Committed.prev; + } + static ItemType* GetNext(const ItemType* item) + { + D3D12MA_ASSERT(item->m_PackedData.GetType() == Allocation::TYPE_COMMITTED || item->m_PackedData.GetType() == Allocation::TYPE_HEAP); + return item->m_Committed.next; + } + static ItemType*& AccessPrev(ItemType* item) + { + D3D12MA_ASSERT(item->m_PackedData.GetType() == Allocation::TYPE_COMMITTED || item->m_PackedData.GetType() == Allocation::TYPE_HEAP); + return item->m_Committed.prev; + } + static ItemType*& AccessNext(ItemType* item) + { + D3D12MA_ASSERT(item->m_PackedData.GetType() == Allocation::TYPE_COMMITTED || item->m_PackedData.GetType() == Allocation::TYPE_HEAP); + return item->m_Committed.next; + } +}; +#endif // _D3D12MA_COMMITTED_ALLOCATION_LIST_ITEM_TRAITS + +#ifndef _D3D12MA_COMMITTED_ALLOCATION_LIST +/* +Stores linked list of Allocation objects that are of TYPE_COMMITTED or TYPE_HEAP. +Thread-safe, synchronized internally. +*/ +class CommittedAllocationList +{ +public: + CommittedAllocationList() = default; + void Init(bool useMutex, D3D12_HEAP_TYPE heapType, PoolPimpl* pool); + ~CommittedAllocationList(); + + D3D12_HEAP_TYPE GetHeapType() const { return m_HeapType; } + PoolPimpl* GetPool() const { return m_Pool; } + UINT GetMemorySegmentGroup(AllocatorPimpl* allocator) const; + + void AddStatistics(Statistics& inoutStats); + void AddDetailedStatistics(DetailedStatistics& inoutStats); + // Writes JSON array with the list of allocations. + void BuildStatsString(JsonWriter& json); + + void Register(Allocation* alloc); + void Unregister(Allocation* alloc); + +private: + using CommittedAllocationLinkedList = IntrusiveLinkedList<CommittedAllocationListItemTraits>; + + bool m_UseMutex = true; + D3D12_HEAP_TYPE m_HeapType = D3D12_HEAP_TYPE_CUSTOM; + PoolPimpl* m_Pool = NULL; + + D3D12MA_RW_MUTEX m_Mutex; + CommittedAllocationLinkedList m_AllocationList; +}; +#endif // _D3D12MA_COMMITTED_ALLOCATION_LIST + +#ifndef _D3D12M_COMMITTED_ALLOCATION_PARAMETERS +struct CommittedAllocationParameters +{ + CommittedAllocationList* m_List = NULL; + D3D12_HEAP_PROPERTIES m_HeapProperties = {}; + D3D12_HEAP_FLAGS m_HeapFlags = D3D12_HEAP_FLAG_NONE; + ID3D12ProtectedResourceSession* m_ProtectedSession = NULL; + bool m_CanAlias = false; + D3D12_RESIDENCY_PRIORITY m_ResidencyPriority = D3D12_RESIDENCY_PRIORITY_NONE; + + bool IsValid() const { return m_List != NULL; } +}; +#endif // _D3D12M_COMMITTED_ALLOCATION_PARAMETERS + +// Simple variant data structure to hold all possible variations of ID3D12Device*::CreateCommittedResource* and ID3D12Device*::CreatePlacedResource* arguments +struct CREATE_RESOURCE_PARAMS +{ + CREATE_RESOURCE_PARAMS() = delete; + CREATE_RESOURCE_PARAMS( + const D3D12_RESOURCE_DESC* pResourceDesc, + D3D12_RESOURCE_STATES InitialResourceState, + const D3D12_CLEAR_VALUE* pOptimizedClearValue) + : Variant(VARIANT_WITH_STATE) + , pResourceDesc(pResourceDesc) + , InitialResourceState(InitialResourceState) + , pOptimizedClearValue(pOptimizedClearValue) + { + } +#ifdef __ID3D12Device8_INTERFACE_DEFINED__ + CREATE_RESOURCE_PARAMS( + const D3D12_RESOURCE_DESC1* pResourceDesc, + D3D12_RESOURCE_STATES InitialResourceState, + const D3D12_CLEAR_VALUE* pOptimizedClearValue) + : Variant(VARIANT_WITH_STATE_AND_DESC1) + , pResourceDesc1(pResourceDesc) + , InitialResourceState(InitialResourceState) + , pOptimizedClearValue(pOptimizedClearValue) + { + } +#endif +#ifdef __ID3D12Device10_INTERFACE_DEFINED__ + CREATE_RESOURCE_PARAMS( + const D3D12_RESOURCE_DESC1* pResourceDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + const D3D12_CLEAR_VALUE* pOptimizedClearValue, + UINT32 NumCastableFormats, + DXGI_FORMAT* pCastableFormats) + : Variant(VARIANT_WITH_LAYOUT) + , pResourceDesc1(pResourceDesc) + , InitialLayout(InitialLayout) + , pOptimizedClearValue(pOptimizedClearValue) + , NumCastableFormats(NumCastableFormats) + , pCastableFormats(pCastableFormats) + { + } +#endif + + enum VARIANT + { + VARIANT_INVALID = 0, + VARIANT_WITH_STATE, + VARIANT_WITH_STATE_AND_DESC1, + VARIANT_WITH_LAYOUT + }; + + VARIANT Variant = VARIANT_INVALID; + + const D3D12_RESOURCE_DESC* GetResourceDesc() const + { + D3D12MA_ASSERT(Variant == VARIANT_WITH_STATE); + return pResourceDesc; + } + const D3D12_RESOURCE_DESC*& AccessResourceDesc() + { + D3D12MA_ASSERT(Variant == VARIANT_WITH_STATE); + return pResourceDesc; + } + const D3D12_RESOURCE_DESC* GetBaseResourceDesc() const + { + // D3D12_RESOURCE_DESC1 can be cast to D3D12_RESOURCE_DESC by discarding the new members at the end. + return pResourceDesc; + } + D3D12_RESOURCE_STATES GetInitialResourceState() const + { + D3D12MA_ASSERT(Variant < VARIANT_WITH_LAYOUT); + return InitialResourceState; + } + const D3D12_CLEAR_VALUE* GetOptimizedClearValue() const + { + return pOptimizedClearValue; + } + +#ifdef __ID3D12Device8_INTERFACE_DEFINED__ + const D3D12_RESOURCE_DESC1* GetResourceDesc1() const + { + D3D12MA_ASSERT(Variant >= VARIANT_WITH_STATE_AND_DESC1); + return pResourceDesc1; + } + const D3D12_RESOURCE_DESC1*& AccessResourceDesc1() + { + D3D12MA_ASSERT(Variant >= VARIANT_WITH_STATE_AND_DESC1); + return pResourceDesc1; + } +#endif + +#ifdef __ID3D12Device10_INTERFACE_DEFINED__ + D3D12_BARRIER_LAYOUT GetInitialLayout() const + { + D3D12MA_ASSERT(Variant >= VARIANT_WITH_LAYOUT); + return InitialLayout; + } + UINT32 GetNumCastableFormats() const + { + D3D12MA_ASSERT(Variant >= VARIANT_WITH_LAYOUT); + return NumCastableFormats; + } + DXGI_FORMAT* GetCastableFormats() const + { + D3D12MA_ASSERT(Variant >= VARIANT_WITH_LAYOUT); + return pCastableFormats; + } +#endif + +private: + union + { + const D3D12_RESOURCE_DESC* pResourceDesc; +#ifdef __ID3D12Device8_INTERFACE_DEFINED__ + const D3D12_RESOURCE_DESC1* pResourceDesc1; +#endif + }; + union + { + D3D12_RESOURCE_STATES InitialResourceState; +#ifdef __ID3D12Device10_INTERFACE_DEFINED__ + D3D12_BARRIER_LAYOUT InitialLayout; +#endif + }; + const D3D12_CLEAR_VALUE* pOptimizedClearValue; +#ifdef __ID3D12Device10_INTERFACE_DEFINED__ + UINT32 NumCastableFormats; + DXGI_FORMAT* pCastableFormats; +#endif +}; + +#ifndef _D3D12MA_BLOCK_VECTOR +/* +Sequence of NormalBlock. Represents memory blocks allocated for a specific +heap type and possibly resource type (if only Tier 1 is supported). + +Synchronized internally with a mutex. +*/ +class BlockVector +{ + friend class DefragmentationContextPimpl; + D3D12MA_CLASS_NO_COPY(BlockVector) +public: + BlockVector( + AllocatorPimpl* hAllocator, + const D3D12_HEAP_PROPERTIES& heapProps, + D3D12_HEAP_FLAGS heapFlags, + UINT64 preferredBlockSize, + size_t minBlockCount, + size_t maxBlockCount, + bool explicitBlockSize, + UINT64 minAllocationAlignment, + UINT32 algorithm, + bool denyMsaaTextures, + ID3D12ProtectedResourceSession* pProtectedSession, + D3D12_RESIDENCY_PRIORITY residencyPriority); + ~BlockVector(); + D3D12_RESIDENCY_PRIORITY GetResidencyPriority() const { return m_ResidencyPriority; } + + const D3D12_HEAP_PROPERTIES& GetHeapProperties() const { return m_HeapProps; } + D3D12_HEAP_FLAGS GetHeapFlags() const { return m_HeapFlags; } + UINT64 GetPreferredBlockSize() const { return m_PreferredBlockSize; } + UINT32 GetAlgorithm() const { return m_Algorithm; } + bool DeniesMsaaTextures() const { return m_DenyMsaaTextures; } + // To be used only while the m_Mutex is locked. Used during defragmentation. + size_t GetBlockCount() const { return m_Blocks.size(); } + // To be used only while the m_Mutex is locked. Used during defragmentation. + NormalBlock* GetBlock(size_t index) const { return m_Blocks[index]; } + D3D12MA_RW_MUTEX& GetMutex() { return m_Mutex; } + + HRESULT CreateMinBlocks(); + bool IsEmpty(); + + HRESULT Allocate( + UINT64 size, + UINT64 alignment, + const ALLOCATION_DESC& allocDesc, + size_t allocationCount, + Allocation** pAllocations); + + void Free(Allocation* hAllocation); + + HRESULT CreateResource( + UINT64 size, + UINT64 alignment, + const ALLOCATION_DESC& allocDesc, + const CREATE_RESOURCE_PARAMS& createParams, + Allocation** ppAllocation, + REFIID riidResource, + void** ppvResource); + + void AddStatistics(Statistics& inoutStats); + void AddDetailedStatistics(DetailedStatistics& inoutStats); + + void WriteBlockInfoToJson(JsonWriter& json); + +private: + AllocatorPimpl* const m_hAllocator; + const D3D12_HEAP_PROPERTIES m_HeapProps; + const D3D12_HEAP_FLAGS m_HeapFlags; + const UINT64 m_PreferredBlockSize; + const size_t m_MinBlockCount; + const size_t m_MaxBlockCount; + const bool m_ExplicitBlockSize; + const UINT64 m_MinAllocationAlignment; + const UINT32 m_Algorithm; + const bool m_DenyMsaaTextures; + ID3D12ProtectedResourceSession* const m_ProtectedSession; + const D3D12_RESIDENCY_PRIORITY m_ResidencyPriority; + /* There can be at most one allocation that is completely empty - a + hysteresis to avoid pessimistic case of alternating creation and destruction + of a ID3D12Heap. */ + bool m_HasEmptyBlock; + D3D12MA_RW_MUTEX m_Mutex; + // Incrementally sorted by sumFreeSize, ascending. + Vector<NormalBlock*> m_Blocks; + UINT m_NextBlockId; + bool m_IncrementalSort = true; + + // Disable incremental sorting when freeing allocations + void SetIncrementalSort(bool val) { m_IncrementalSort = val; } + + UINT64 CalcSumBlockSize() const; + UINT64 CalcMaxBlockSize() const; + + // Finds and removes given block from vector. + void Remove(NormalBlock* pBlock); + + // Performs single step in sorting m_Blocks. They may not be fully sorted + // after this call. + void IncrementallySortBlocks(); + void SortByFreeSize(); + + HRESULT AllocatePage( + UINT64 size, + UINT64 alignment, + const ALLOCATION_DESC& allocDesc, + Allocation** pAllocation); + + HRESULT AllocateFromBlock( + NormalBlock* pBlock, + UINT64 size, + UINT64 alignment, + ALLOCATION_FLAGS allocFlags, + void* pPrivateData, + UINT32 strategy, + Allocation** pAllocation); + + HRESULT CommitAllocationRequest( + AllocationRequest& allocRequest, + NormalBlock* pBlock, + UINT64 size, + UINT64 alignment, + void* pPrivateData, + Allocation** pAllocation); + + HRESULT CreateBlock( + UINT64 blockSize, + size_t* pNewBlockIndex); +}; +#endif // _D3D12MA_BLOCK_VECTOR + +#ifndef _D3D12MA_CURRENT_BUDGET_DATA +class CurrentBudgetData +{ +public: + bool ShouldUpdateBudget() const { return m_OperationsSinceBudgetFetch >= 30; } + + void GetStatistics(Statistics& outStats, UINT group) const; + void GetBudget(bool useMutex, + UINT64* outLocalUsage, UINT64* outLocalBudget, + UINT64* outNonLocalUsage, UINT64* outNonLocalBudget); + +#if D3D12MA_DXGI_1_4 + HRESULT UpdateBudget(IDXGIAdapter3* adapter3, bool useMutex); +#endif + + void AddAllocation(UINT group, UINT64 allocationBytes); + void RemoveAllocation(UINT group, UINT64 allocationBytes); + + void AddBlock(UINT group, UINT64 blockBytes); + void RemoveBlock(UINT group, UINT64 blockBytes); + +private: + D3D12MA_ATOMIC_UINT32 m_BlockCount[DXGI_MEMORY_SEGMENT_GROUP_COUNT] = {}; + D3D12MA_ATOMIC_UINT32 m_AllocationCount[DXGI_MEMORY_SEGMENT_GROUP_COUNT] = {}; + D3D12MA_ATOMIC_UINT64 m_BlockBytes[DXGI_MEMORY_SEGMENT_GROUP_COUNT] = {}; + D3D12MA_ATOMIC_UINT64 m_AllocationBytes[DXGI_MEMORY_SEGMENT_GROUP_COUNT] = {}; + + D3D12MA_ATOMIC_UINT32 m_OperationsSinceBudgetFetch = {0}; + D3D12MA_RW_MUTEX m_BudgetMutex; + UINT64 m_D3D12Usage[DXGI_MEMORY_SEGMENT_GROUP_COUNT] = {}; + UINT64 m_D3D12Budget[DXGI_MEMORY_SEGMENT_GROUP_COUNT] = {}; + UINT64 m_BlockBytesAtD3D12Fetch[DXGI_MEMORY_SEGMENT_GROUP_COUNT] = {}; +}; + +#ifndef _D3D12MA_CURRENT_BUDGET_DATA_FUNCTIONS +void CurrentBudgetData::GetStatistics(Statistics& outStats, UINT group) const +{ + outStats.BlockCount = m_BlockCount[group]; + outStats.AllocationCount = m_AllocationCount[group]; + outStats.BlockBytes = m_BlockBytes[group]; + outStats.AllocationBytes = m_AllocationBytes[group]; +} + +void CurrentBudgetData::GetBudget(bool useMutex, + UINT64* outLocalUsage, UINT64* outLocalBudget, + UINT64* outNonLocalUsage, UINT64* outNonLocalBudget) +{ + MutexLockRead lockRead(m_BudgetMutex, useMutex); + + if (outLocalUsage) + { + const UINT64 D3D12Usage = m_D3D12Usage[DXGI_MEMORY_SEGMENT_GROUP_LOCAL_COPY]; + const UINT64 blockBytes = m_BlockBytes[DXGI_MEMORY_SEGMENT_GROUP_LOCAL_COPY]; + const UINT64 blockBytesAtD3D12Fetch = m_BlockBytesAtD3D12Fetch[DXGI_MEMORY_SEGMENT_GROUP_LOCAL_COPY]; + *outLocalUsage = D3D12Usage + blockBytes > blockBytesAtD3D12Fetch ? + D3D12Usage + blockBytes - blockBytesAtD3D12Fetch : 0; + } + if (outLocalBudget) + *outLocalBudget = m_D3D12Budget[DXGI_MEMORY_SEGMENT_GROUP_LOCAL_COPY]; + + if (outNonLocalUsage) + { + const UINT64 D3D12Usage = m_D3D12Usage[DXGI_MEMORY_SEGMENT_GROUP_NON_LOCAL_COPY]; + const UINT64 blockBytes = m_BlockBytes[DXGI_MEMORY_SEGMENT_GROUP_NON_LOCAL_COPY]; + const UINT64 blockBytesAtD3D12Fetch = m_BlockBytesAtD3D12Fetch[DXGI_MEMORY_SEGMENT_GROUP_NON_LOCAL_COPY]; + *outNonLocalUsage = D3D12Usage + blockBytes > blockBytesAtD3D12Fetch ? + D3D12Usage + blockBytes - blockBytesAtD3D12Fetch : 0; + } + if (outNonLocalBudget) + *outNonLocalBudget = m_D3D12Budget[DXGI_MEMORY_SEGMENT_GROUP_NON_LOCAL_COPY]; +} + +#if D3D12MA_DXGI_1_4 +HRESULT CurrentBudgetData::UpdateBudget(IDXGIAdapter3* adapter3, bool useMutex) +{ + D3D12MA_ASSERT(adapter3); + + DXGI_QUERY_VIDEO_MEMORY_INFO infoLocal = {}; + DXGI_QUERY_VIDEO_MEMORY_INFO infoNonLocal = {}; + const HRESULT hrLocal = adapter3->QueryVideoMemoryInfo(0, DXGI_MEMORY_SEGMENT_GROUP_LOCAL, &infoLocal); + const HRESULT hrNonLocal = adapter3->QueryVideoMemoryInfo(0, DXGI_MEMORY_SEGMENT_GROUP_NON_LOCAL, &infoNonLocal); + + if (SUCCEEDED(hrLocal) || SUCCEEDED(hrNonLocal)) + { + MutexLockWrite lockWrite(m_BudgetMutex, useMutex); + + if (SUCCEEDED(hrLocal)) + { + m_D3D12Usage[0] = infoLocal.CurrentUsage; + m_D3D12Budget[0] = infoLocal.Budget; + } + if (SUCCEEDED(hrNonLocal)) + { + m_D3D12Usage[1] = infoNonLocal.CurrentUsage; + m_D3D12Budget[1] = infoNonLocal.Budget; + } + + m_BlockBytesAtD3D12Fetch[0] = m_BlockBytes[0]; + m_BlockBytesAtD3D12Fetch[1] = m_BlockBytes[1]; + m_OperationsSinceBudgetFetch = 0; + } + + return FAILED(hrLocal) ? hrLocal : hrNonLocal; +} +#endif // #if D3D12MA_DXGI_1_4 + +void CurrentBudgetData::AddAllocation(UINT group, UINT64 allocationBytes) +{ + ++m_AllocationCount[group]; + m_AllocationBytes[group] += allocationBytes; + ++m_OperationsSinceBudgetFetch; +} + +void CurrentBudgetData::RemoveAllocation(UINT group, UINT64 allocationBytes) +{ + D3D12MA_ASSERT(m_AllocationBytes[group] >= allocationBytes); + D3D12MA_ASSERT(m_AllocationCount[group] > 0); + m_AllocationBytes[group] -= allocationBytes; + --m_AllocationCount[group]; + ++m_OperationsSinceBudgetFetch; +} + +void CurrentBudgetData::AddBlock(UINT group, UINT64 blockBytes) +{ + ++m_BlockCount[group]; + m_BlockBytes[group] += blockBytes; + ++m_OperationsSinceBudgetFetch; +} + +void CurrentBudgetData::RemoveBlock(UINT group, UINT64 blockBytes) +{ + D3D12MA_ASSERT(m_BlockBytes[group] >= blockBytes); + D3D12MA_ASSERT(m_BlockCount[group] > 0); + m_BlockBytes[group] -= blockBytes; + --m_BlockCount[group]; + ++m_OperationsSinceBudgetFetch; +} +#endif // _D3D12MA_CURRENT_BUDGET_DATA_FUNCTIONS +#endif // _D3D12MA_CURRENT_BUDGET_DATA + +#ifndef _D3D12MA_DEFRAGMENTATION_CONTEXT_PIMPL +class DefragmentationContextPimpl +{ + D3D12MA_CLASS_NO_COPY(DefragmentationContextPimpl) +public: + DefragmentationContextPimpl( + AllocatorPimpl* hAllocator, + const DEFRAGMENTATION_DESC& desc, + BlockVector* poolVector); + ~DefragmentationContextPimpl(); + + void GetStats(DEFRAGMENTATION_STATS& outStats) { outStats = m_GlobalStats; } + const ALLOCATION_CALLBACKS& GetAllocs() const { return m_Moves.GetAllocs(); } + + HRESULT DefragmentPassBegin(DEFRAGMENTATION_PASS_MOVE_INFO& moveInfo); + HRESULT DefragmentPassEnd(DEFRAGMENTATION_PASS_MOVE_INFO& moveInfo); + +private: + // Max number of allocations to ignore due to size constraints before ending single pass + static const UINT8 MAX_ALLOCS_TO_IGNORE = 16; + enum class CounterStatus { Pass, Ignore, End }; + + struct FragmentedBlock + { + UINT32 data; + NormalBlock* block; + }; + struct StateBalanced + { + UINT64 avgFreeSize = 0; + UINT64 avgAllocSize = UINT64_MAX; + }; + struct MoveAllocationData + { + UINT64 size; + UINT64 alignment; + ALLOCATION_FLAGS flags; + DEFRAGMENTATION_MOVE move = {}; + }; + + const UINT64 m_MaxPassBytes; + const UINT32 m_MaxPassAllocations; + + Vector<DEFRAGMENTATION_MOVE> m_Moves; + + UINT8 m_IgnoredAllocs = 0; + UINT32 m_Algorithm; + UINT32 m_BlockVectorCount; + BlockVector* m_PoolBlockVector; + BlockVector** m_pBlockVectors; + size_t m_ImmovableBlockCount = 0; + DEFRAGMENTATION_STATS m_GlobalStats = { 0 }; + DEFRAGMENTATION_STATS m_PassStats = { 0 }; + void* m_AlgorithmState = NULL; + + static MoveAllocationData GetMoveData(AllocHandle handle, BlockMetadata* metadata); + CounterStatus CheckCounters(UINT64 bytes); + bool IncrementCounters(UINT64 bytes); + bool ReallocWithinBlock(BlockVector& vector, NormalBlock* block); + bool AllocInOtherBlock(size_t start, size_t end, MoveAllocationData& data, BlockVector& vector); + + bool ComputeDefragmentation(BlockVector& vector, size_t index); + bool ComputeDefragmentation_Fast(BlockVector& vector); + bool ComputeDefragmentation_Balanced(BlockVector& vector, size_t index, bool update); + bool ComputeDefragmentation_Full(BlockVector& vector); + + void UpdateVectorStatistics(BlockVector& vector, StateBalanced& state); +}; +#endif // _D3D12MA_DEFRAGMENTATION_CONTEXT_PIMPL + +#ifndef _D3D12MA_POOL_PIMPL +class PoolPimpl +{ + friend class Allocator; + friend struct PoolListItemTraits; +public: + PoolPimpl(AllocatorPimpl* allocator, const POOL_DESC& desc); + ~PoolPimpl(); + + AllocatorPimpl* GetAllocator() const { return m_Allocator; } + const POOL_DESC& GetDesc() const { return m_Desc; } + bool SupportsCommittedAllocations() const { return m_Desc.BlockSize == 0; } + LPCWSTR GetName() const { return m_Name; } + + BlockVector* GetBlockVector() { return m_BlockVector; } + CommittedAllocationList* GetCommittedAllocationList() { return SupportsCommittedAllocations() ? &m_CommittedAllocations : NULL; } + + HRESULT Init(); + void GetStatistics(Statistics& outStats); + void CalculateStatistics(DetailedStatistics& outStats); + void AddDetailedStatistics(DetailedStatistics& inoutStats); + void SetName(LPCWSTR Name); + +private: + AllocatorPimpl* m_Allocator; // Externally owned object. + POOL_DESC m_Desc; + BlockVector* m_BlockVector; // Owned object. + CommittedAllocationList m_CommittedAllocations; + wchar_t* m_Name; + PoolPimpl* m_PrevPool = NULL; + PoolPimpl* m_NextPool = NULL; + + void FreeName(); +}; + +struct PoolListItemTraits +{ + using ItemType = PoolPimpl; + static ItemType* GetPrev(const ItemType* item) { return item->m_PrevPool; } + static ItemType* GetNext(const ItemType* item) { return item->m_NextPool; } + static ItemType*& AccessPrev(ItemType* item) { return item->m_PrevPool; } + static ItemType*& AccessNext(ItemType* item) { return item->m_NextPool; } +}; +#endif // _D3D12MA_POOL_PIMPL + + +#ifndef _D3D12MA_ALLOCATOR_PIMPL +class AllocatorPimpl +{ + friend class Allocator; + friend class Pool; +public: + std::atomic_uint32_t m_RefCount = {1}; + CurrentBudgetData m_Budget; + + AllocatorPimpl(const ALLOCATION_CALLBACKS& allocationCallbacks, const ALLOCATOR_DESC& desc); + ~AllocatorPimpl(); + + ID3D12Device* GetDevice() const { return m_Device; } +#ifdef __ID3D12Device1_INTERFACE_DEFINED__ + ID3D12Device1* GetDevice1() const { return m_Device1; } +#endif +#ifdef __ID3D12Device4_INTERFACE_DEFINED__ + ID3D12Device4* GetDevice4() const { return m_Device4; } +#endif +#ifdef __ID3D12Device8_INTERFACE_DEFINED__ + ID3D12Device8* GetDevice8() const { return m_Device8; } +#endif + // Shortcut for "Allocation Callbacks", because this function is called so often. + const ALLOCATION_CALLBACKS& GetAllocs() const { return m_AllocationCallbacks; } + const D3D12_FEATURE_DATA_D3D12_OPTIONS& GetD3D12Options() const { return m_D3D12Options; } + BOOL IsUMA() const { return m_D3D12Architecture.UMA; } + BOOL IsCacheCoherentUMA() const { return m_D3D12Architecture.CacheCoherentUMA; } + bool SupportsResourceHeapTier2() const { return m_D3D12Options.ResourceHeapTier >= D3D12_RESOURCE_HEAP_TIER_2; } + bool UseMutex() const { return m_UseMutex; } + AllocationObjectAllocator& GetAllocationObjectAllocator() { return m_AllocationObjectAllocator; } + UINT GetCurrentFrameIndex() const { return m_CurrentFrameIndex.load(); } + /* + If SupportsResourceHeapTier2(): + 0: D3D12_HEAP_TYPE_DEFAULT + 1: D3D12_HEAP_TYPE_UPLOAD + 2: D3D12_HEAP_TYPE_READBACK + else: + 0: D3D12_HEAP_TYPE_DEFAULT + buffer + 1: D3D12_HEAP_TYPE_DEFAULT + texture + 2: D3D12_HEAP_TYPE_DEFAULT + texture RT or DS + 3: D3D12_HEAP_TYPE_UPLOAD + buffer + 4: D3D12_HEAP_TYPE_UPLOAD + texture + 5: D3D12_HEAP_TYPE_UPLOAD + texture RT or DS + 6: D3D12_HEAP_TYPE_READBACK + buffer + 7: D3D12_HEAP_TYPE_READBACK + texture + 8: D3D12_HEAP_TYPE_READBACK + texture RT or DS + */ + UINT GetDefaultPoolCount() const { return SupportsResourceHeapTier2() ? 3 : 9; } + BlockVector** GetDefaultPools() { return m_BlockVectors; } + + HRESULT Init(const ALLOCATOR_DESC& desc); + bool HeapFlagsFulfillResourceHeapTier(D3D12_HEAP_FLAGS flags) const; + UINT StandardHeapTypeToMemorySegmentGroup(D3D12_HEAP_TYPE heapType) const; + UINT HeapPropertiesToMemorySegmentGroup(const D3D12_HEAP_PROPERTIES& heapProps) const; + UINT64 GetMemoryCapacity(UINT memorySegmentGroup) const; + + HRESULT CreatePlacedResourceWrap( + ID3D12Heap *pHeap, + UINT64 HeapOffset, + const CREATE_RESOURCE_PARAMS& createParams, + REFIID riidResource, + void** ppvResource); + + HRESULT CreateResource( + const ALLOCATION_DESC* pAllocDesc, + const CREATE_RESOURCE_PARAMS& createParams, + Allocation** ppAllocation, + REFIID riidResource, + void** ppvResource); + + HRESULT CreateAliasingResource( + Allocation* pAllocation, + UINT64 AllocationLocalOffset, + const CREATE_RESOURCE_PARAMS& createParams, + REFIID riidResource, + void** ppvResource); + + HRESULT AllocateMemory( + const ALLOCATION_DESC* pAllocDesc, + const D3D12_RESOURCE_ALLOCATION_INFO* pAllocInfo, + Allocation** ppAllocation); + + // Unregisters allocation from the collection of dedicated allocations. + // Allocation object must be deleted externally afterwards. + void FreeCommittedMemory(Allocation* allocation); + // Unregisters allocation from the collection of placed allocations. + // Allocation object must be deleted externally afterwards. + void FreePlacedMemory(Allocation* allocation); + // Unregisters allocation from the collection of dedicated allocations and destroys associated heap. + // Allocation object must be deleted externally afterwards. + void FreeHeapMemory(Allocation* allocation); + + void SetResidencyPriority(ID3D12Pageable* obj, D3D12_RESIDENCY_PRIORITY priority) const; + + void SetCurrentFrameIndex(UINT frameIndex); + // For more deailed stats use outCutomHeaps to access statistics divided into L0 and L1 group + void CalculateStatistics(TotalStatistics& outStats, DetailedStatistics outCutomHeaps[2] = NULL); + + void GetBudget(Budget* outLocalBudget, Budget* outNonLocalBudget); + void GetBudgetForHeapType(Budget& outBudget, D3D12_HEAP_TYPE heapType); + + void BuildStatsString(WCHAR** ppStatsString, BOOL detailedMap); + void FreeStatsString(WCHAR* pStatsString); + +private: + using PoolList = IntrusiveLinkedList<PoolListItemTraits>; + + const bool m_UseMutex; + const bool m_AlwaysCommitted; + const bool m_MsaaAlwaysCommitted; + bool m_DefaultPoolsNotZeroed = false; + ID3D12Device* m_Device; // AddRef +#ifdef __ID3D12Device1_INTERFACE_DEFINED__ + ID3D12Device1* m_Device1 = NULL; // AddRef, optional +#endif +#ifdef __ID3D12Device4_INTERFACE_DEFINED__ + ID3D12Device4* m_Device4 = NULL; // AddRef, optional +#endif +#ifdef __ID3D12Device8_INTERFACE_DEFINED__ + ID3D12Device8* m_Device8 = NULL; // AddRef, optional +#endif +#ifdef __ID3D12Device10_INTERFACE_DEFINED__ + ID3D12Device10* m_Device10 = NULL; // AddRef, optional +#endif + IDXGIAdapter* m_Adapter; // AddRef +#if D3D12MA_DXGI_1_4 + IDXGIAdapter3* m_Adapter3 = NULL; // AddRef, optional +#endif + UINT64 m_PreferredBlockSize; + ALLOCATION_CALLBACKS m_AllocationCallbacks; + D3D12MA_ATOMIC_UINT32 m_CurrentFrameIndex; + DXGI_ADAPTER_DESC m_AdapterDesc; + D3D12_FEATURE_DATA_D3D12_OPTIONS m_D3D12Options; + D3D12_FEATURE_DATA_ARCHITECTURE m_D3D12Architecture; + AllocationObjectAllocator m_AllocationObjectAllocator; + + D3D12MA_RW_MUTEX m_PoolsMutex[HEAP_TYPE_COUNT]; + PoolList m_Pools[HEAP_TYPE_COUNT]; + // Default pools. + BlockVector* m_BlockVectors[DEFAULT_POOL_MAX_COUNT]; + CommittedAllocationList m_CommittedAllocations[STANDARD_HEAP_TYPE_COUNT]; + + /* + Heuristics that decides whether a resource should better be placed in its own, + dedicated allocation (committed resource rather than placed resource). + */ + template<typename D3D12_RESOURCE_DESC_T> + static bool PrefersCommittedAllocation(const D3D12_RESOURCE_DESC_T& resourceDesc); + + // Allocates and registers new committed resource with implicit heap, as dedicated allocation. + // Creates and returns Allocation object and optionally D3D12 resource. + HRESULT AllocateCommittedResource( + const CommittedAllocationParameters& committedAllocParams, + UINT64 resourceSize, bool withinBudget, void* pPrivateData, + const CREATE_RESOURCE_PARAMS& createParams, + Allocation** ppAllocation, REFIID riidResource, void** ppvResource); + + // Allocates and registers new heap without any resources placed in it, as dedicated allocation. + // Creates and returns Allocation object. + HRESULT AllocateHeap( + const CommittedAllocationParameters& committedAllocParams, + const D3D12_RESOURCE_ALLOCATION_INFO& allocInfo, bool withinBudget, + void* pPrivateData, Allocation** ppAllocation); + + template<typename D3D12_RESOURCE_DESC_T> + HRESULT CalcAllocationParams(const ALLOCATION_DESC& allocDesc, UINT64 allocSize, + const D3D12_RESOURCE_DESC_T* resDesc, // Optional + BlockVector*& outBlockVector, CommittedAllocationParameters& outCommittedAllocationParams, bool& outPreferCommitted); + + // Returns UINT32_MAX if index cannot be calculcated. + UINT CalcDefaultPoolIndex(const ALLOCATION_DESC& allocDesc, ResourceClass resourceClass) const; + void CalcDefaultPoolParams(D3D12_HEAP_TYPE& outHeapType, D3D12_HEAP_FLAGS& outHeapFlags, UINT index) const; + + // Registers Pool object in m_Pools. + void RegisterPool(Pool* pool, D3D12_HEAP_TYPE heapType); + // Unregisters Pool object from m_Pools. + void UnregisterPool(Pool* pool, D3D12_HEAP_TYPE heapType); + + HRESULT UpdateD3D12Budget(); + + D3D12_RESOURCE_ALLOCATION_INFO GetResourceAllocationInfoNative(const D3D12_RESOURCE_DESC& resourceDesc) const; +#ifdef __ID3D12Device8_INTERFACE_DEFINED__ + D3D12_RESOURCE_ALLOCATION_INFO GetResourceAllocationInfoNative(const D3D12_RESOURCE_DESC1& resourceDesc) const; +#endif + + template<typename D3D12_RESOURCE_DESC_T> + D3D12_RESOURCE_ALLOCATION_INFO GetResourceAllocationInfo(D3D12_RESOURCE_DESC_T& inOutResourceDesc) const; + + bool NewAllocationWithinBudget(D3D12_HEAP_TYPE heapType, UINT64 size); + + // Writes object { } with data of given budget. + static void WriteBudgetToJson(JsonWriter& json, const Budget& budget); +}; + +#ifndef _D3D12MA_ALLOCATOR_PIMPL_FUNCTINOS +AllocatorPimpl::AllocatorPimpl(const ALLOCATION_CALLBACKS& allocationCallbacks, const ALLOCATOR_DESC& desc) + : m_UseMutex((desc.Flags & ALLOCATOR_FLAG_SINGLETHREADED) == 0), + m_AlwaysCommitted((desc.Flags & ALLOCATOR_FLAG_ALWAYS_COMMITTED) != 0), + m_MsaaAlwaysCommitted((desc.Flags & ALLOCATOR_FLAG_MSAA_TEXTURES_ALWAYS_COMMITTED) != 0), + m_Device(desc.pDevice), + m_Adapter(desc.pAdapter), + m_PreferredBlockSize(desc.PreferredBlockSize != 0 ? desc.PreferredBlockSize : D3D12MA_DEFAULT_BLOCK_SIZE), + m_AllocationCallbacks(allocationCallbacks), + m_CurrentFrameIndex(0), + // Below this line don't use allocationCallbacks but m_AllocationCallbacks!!! + m_AllocationObjectAllocator(m_AllocationCallbacks) +{ + // desc.pAllocationCallbacks intentionally ignored here, preprocessed by CreateAllocator. + ZeroMemory(&m_D3D12Options, sizeof(m_D3D12Options)); + ZeroMemory(&m_D3D12Architecture, sizeof(m_D3D12Architecture)); + + ZeroMemory(m_BlockVectors, sizeof(m_BlockVectors)); + + for (UINT i = 0; i < STANDARD_HEAP_TYPE_COUNT; ++i) + { + m_CommittedAllocations[i].Init( + m_UseMutex, + (D3D12_HEAP_TYPE)(D3D12_HEAP_TYPE_DEFAULT + i), + NULL); // pool + } + + m_Device->AddRef(); + m_Adapter->AddRef(); +} + +HRESULT AllocatorPimpl::Init(const ALLOCATOR_DESC& desc) +{ +#if D3D12MA_DXGI_1_4 + desc.pAdapter->QueryInterface(D3D12MA_IID_PPV_ARGS(&m_Adapter3)); +#endif + +#ifdef __ID3D12Device1_INTERFACE_DEFINED__ + m_Device->QueryInterface(D3D12MA_IID_PPV_ARGS(&m_Device1)); +#endif + +#ifdef __ID3D12Device4_INTERFACE_DEFINED__ + m_Device->QueryInterface(D3D12MA_IID_PPV_ARGS(&m_Device4)); +#endif + +#ifdef __ID3D12Device8_INTERFACE_DEFINED__ + m_Device->QueryInterface(D3D12MA_IID_PPV_ARGS(&m_Device8)); + + if((desc.Flags & ALLOCATOR_FLAG_DEFAULT_POOLS_NOT_ZEROED) != 0) + { + D3D12_FEATURE_DATA_D3D12_OPTIONS7 options7 = {}; + if(SUCCEEDED(m_Device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS7, &options7, sizeof(options7)))) + { + // DEFAULT_POOLS_NOT_ZEROED both supported and enabled by the user. + m_DefaultPoolsNotZeroed = true; + } + } +#endif + +#ifdef __ID3D12Device10_INTERFACE_DEFINED__ + m_Device->QueryInterface(D3D12MA_IID_PPV_ARGS(&m_Device10)); +#endif + + HRESULT hr = m_Adapter->GetDesc(&m_AdapterDesc); + if (FAILED(hr)) + { + return hr; + } + + hr = m_Device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS, &m_D3D12Options, sizeof(m_D3D12Options)); + if (FAILED(hr)) + { + return hr; + } +#ifdef D3D12MA_FORCE_RESOURCE_HEAP_TIER + m_D3D12Options.ResourceHeapTier = (D3D12MA_FORCE_RESOURCE_HEAP_TIER); +#endif + + hr = m_Device->CheckFeatureSupport(D3D12_FEATURE_ARCHITECTURE, &m_D3D12Architecture, sizeof(m_D3D12Architecture)); + if (FAILED(hr)) + { + m_D3D12Architecture.UMA = FALSE; + m_D3D12Architecture.CacheCoherentUMA = FALSE; + } + + D3D12_HEAP_PROPERTIES heapProps = {}; + const UINT defaultPoolCount = GetDefaultPoolCount(); + for (UINT i = 0; i < defaultPoolCount; ++i) + { + D3D12_HEAP_FLAGS heapFlags; + CalcDefaultPoolParams(heapProps.Type, heapFlags, i); + +#if D3D12MA_CREATE_NOT_ZEROED_AVAILABLE + if(m_DefaultPoolsNotZeroed) + { + heapFlags |= D3D12_HEAP_FLAG_CREATE_NOT_ZEROED; + } +#endif + + m_BlockVectors[i] = D3D12MA_NEW(GetAllocs(), BlockVector)( + this, // hAllocator + heapProps, // heapType + heapFlags, // heapFlags + m_PreferredBlockSize, + 0, // minBlockCount + SIZE_MAX, // maxBlockCount + false, // explicitBlockSize + D3D12MA_DEBUG_ALIGNMENT, // minAllocationAlignment + 0, // Default algorithm, + m_MsaaAlwaysCommitted, + NULL, // pProtectedSession + D3D12_RESIDENCY_PRIORITY_NONE); // residencyPriority + // No need to call m_pBlockVectors[i]->CreateMinBlocks here, becase minBlockCount is 0. + } + +#if D3D12MA_DXGI_1_4 + UpdateD3D12Budget(); +#endif + + return S_OK; +} + +AllocatorPimpl::~AllocatorPimpl() +{ +#ifdef __ID3D12Device10_INTERFACE_DEFINED__ + SAFE_RELEASE(m_Device10); +#endif +#ifdef __ID3D12Device8_INTERFACE_DEFINED__ + SAFE_RELEASE(m_Device8); +#endif +#ifdef __ID3D12Device4_INTERFACE_DEFINED__ + SAFE_RELEASE(m_Device4); +#endif +#ifdef __ID3D12Device1_INTERFACE_DEFINED__ + SAFE_RELEASE(m_Device1); +#endif +#if D3D12MA_DXGI_1_4 + SAFE_RELEASE(m_Adapter3); +#endif + SAFE_RELEASE(m_Adapter); + SAFE_RELEASE(m_Device); + + for (UINT i = DEFAULT_POOL_MAX_COUNT; i--; ) + { + D3D12MA_DELETE(GetAllocs(), m_BlockVectors[i]); + } + + for (UINT i = HEAP_TYPE_COUNT; i--; ) + { + if (!m_Pools[i].IsEmpty()) + { + D3D12MA_ASSERT(0 && "Unfreed pools found!"); + } + } +} + +bool AllocatorPimpl::HeapFlagsFulfillResourceHeapTier(D3D12_HEAP_FLAGS flags) const +{ + if (SupportsResourceHeapTier2()) + { + return true; + } + else + { + const bool allowBuffers = (flags & D3D12_HEAP_FLAG_DENY_BUFFERS) == 0; + const bool allowRtDsTextures = (flags & D3D12_HEAP_FLAG_DENY_RT_DS_TEXTURES) == 0; + const bool allowNonRtDsTextures = (flags & D3D12_HEAP_FLAG_DENY_NON_RT_DS_TEXTURES) == 0; + const uint8_t allowedGroupCount = (allowBuffers ? 1 : 0) + (allowRtDsTextures ? 1 : 0) + (allowNonRtDsTextures ? 1 : 0); + return allowedGroupCount == 1; + } +} + +UINT AllocatorPimpl::StandardHeapTypeToMemorySegmentGroup(D3D12_HEAP_TYPE heapType) const +{ + D3D12MA_ASSERT(IsHeapTypeStandard(heapType)); + if (IsUMA()) + return DXGI_MEMORY_SEGMENT_GROUP_LOCAL_COPY; + return heapType == D3D12_HEAP_TYPE_DEFAULT ? + DXGI_MEMORY_SEGMENT_GROUP_LOCAL_COPY : DXGI_MEMORY_SEGMENT_GROUP_NON_LOCAL_COPY; +} + +UINT AllocatorPimpl::HeapPropertiesToMemorySegmentGroup(const D3D12_HEAP_PROPERTIES& heapProps) const +{ + if (IsUMA()) + return DXGI_MEMORY_SEGMENT_GROUP_LOCAL_COPY; + if (heapProps.MemoryPoolPreference == D3D12_MEMORY_POOL_UNKNOWN) + return StandardHeapTypeToMemorySegmentGroup(heapProps.Type); + return heapProps.MemoryPoolPreference == D3D12_MEMORY_POOL_L1 ? + DXGI_MEMORY_SEGMENT_GROUP_LOCAL_COPY : DXGI_MEMORY_SEGMENT_GROUP_NON_LOCAL_COPY; +} + +UINT64 AllocatorPimpl::GetMemoryCapacity(UINT memorySegmentGroup) const +{ + switch (memorySegmentGroup) + { + case DXGI_MEMORY_SEGMENT_GROUP_LOCAL_COPY: + return IsUMA() ? + m_AdapterDesc.DedicatedVideoMemory + m_AdapterDesc.SharedSystemMemory : m_AdapterDesc.DedicatedVideoMemory; + case DXGI_MEMORY_SEGMENT_GROUP_NON_LOCAL_COPY: + return IsUMA() ? 0 : m_AdapterDesc.SharedSystemMemory; + default: + D3D12MA_ASSERT(0); + return UINT64_MAX; + } +} + +HRESULT AllocatorPimpl::CreatePlacedResourceWrap( + ID3D12Heap *pHeap, + UINT64 HeapOffset, + const CREATE_RESOURCE_PARAMS& createParams, + REFIID riidResource, + void** ppvResource) +{ +#ifdef __ID3D12Device10_INTERFACE_DEFINED__ + if (createParams.Variant == CREATE_RESOURCE_PARAMS::VARIANT_WITH_LAYOUT) + { + if (!m_Device10) + { + return E_NOINTERFACE; + } + return m_Device10->CreatePlacedResource2(pHeap, HeapOffset, + createParams.GetResourceDesc1(), createParams.GetInitialLayout(), + createParams.GetOptimizedClearValue(), createParams.GetNumCastableFormats(), + createParams.GetCastableFormats(), riidResource, ppvResource); + } else +#endif +#ifdef __ID3D12Device8_INTERFACE_DEFINED__ + if (createParams.Variant == CREATE_RESOURCE_PARAMS::VARIANT_WITH_STATE_AND_DESC1) + { + if (!m_Device8) + { + return E_NOINTERFACE; + } + return m_Device8->CreatePlacedResource1(pHeap, HeapOffset, + createParams.GetResourceDesc1(), createParams.GetInitialResourceState(), + createParams.GetOptimizedClearValue(), riidResource, ppvResource); + } else +#endif + if (createParams.Variant == CREATE_RESOURCE_PARAMS::VARIANT_WITH_STATE) + { + return m_Device->CreatePlacedResource(pHeap, HeapOffset, + createParams.GetResourceDesc(), createParams.GetInitialResourceState(), + createParams.GetOptimizedClearValue(), riidResource, ppvResource); + } + else + { + D3D12MA_ASSERT(0); + return E_INVALIDARG; + } +} + + +HRESULT AllocatorPimpl::CreateResource( + const ALLOCATION_DESC* pAllocDesc, + const CREATE_RESOURCE_PARAMS& createParams, + Allocation** ppAllocation, + REFIID riidResource, + void** ppvResource) +{ + D3D12MA_ASSERT(pAllocDesc && createParams.GetBaseResourceDesc() && ppAllocation); + + *ppAllocation = NULL; + if (ppvResource) + { + *ppvResource = NULL; + } + + CREATE_RESOURCE_PARAMS finalCreateParams = createParams; + D3D12_RESOURCE_DESC finalResourceDesc; +#ifdef __ID3D12Device8_INTERFACE_DEFINED__ + D3D12_RESOURCE_DESC1 finalResourceDesc1; +#endif + D3D12_RESOURCE_ALLOCATION_INFO resAllocInfo; + if (createParams.Variant == CREATE_RESOURCE_PARAMS::VARIANT_WITH_STATE) + { + finalResourceDesc = *createParams.GetResourceDesc(); + finalCreateParams.AccessResourceDesc() = &finalResourceDesc; + resAllocInfo = GetResourceAllocationInfo(finalResourceDesc); + } +#ifdef __ID3D12Device8_INTERFACE_DEFINED__ + else if (createParams.Variant == CREATE_RESOURCE_PARAMS::VARIANT_WITH_STATE_AND_DESC1) + { + if (!m_Device8) + { + return E_NOINTERFACE; + } + finalResourceDesc1 = *createParams.GetResourceDesc1(); + finalCreateParams.AccessResourceDesc1() = &finalResourceDesc1; + resAllocInfo = GetResourceAllocationInfo(finalResourceDesc1); + } +#endif +#ifdef __ID3D12Device10_INTERFACE_DEFINED__ + else if (createParams.Variant == CREATE_RESOURCE_PARAMS::VARIANT_WITH_LAYOUT) + { + if (!m_Device10) + { + return E_NOINTERFACE; + } + finalResourceDesc1 = *createParams.GetResourceDesc1(); + finalCreateParams.AccessResourceDesc1() = &finalResourceDesc1; + resAllocInfo = GetResourceAllocationInfo(finalResourceDesc1); + } +#endif + else + { + D3D12MA_ASSERT(0); + return E_INVALIDARG; + } + D3D12MA_ASSERT(IsPow2(resAllocInfo.Alignment)); + D3D12MA_ASSERT(resAllocInfo.SizeInBytes > 0); + + BlockVector* blockVector = NULL; + CommittedAllocationParameters committedAllocationParams = {}; + bool preferCommitted = false; + + HRESULT hr; +#ifdef __ID3D12Device8_INTERFACE_DEFINED__ + if (createParams.Variant >= CREATE_RESOURCE_PARAMS::VARIANT_WITH_STATE_AND_DESC1) + { + hr = CalcAllocationParams<D3D12_RESOURCE_DESC1>(*pAllocDesc, resAllocInfo.SizeInBytes, + createParams.GetResourceDesc1(), + blockVector, committedAllocationParams, preferCommitted); + } + else +#endif + { + hr = CalcAllocationParams<D3D12_RESOURCE_DESC>(*pAllocDesc, resAllocInfo.SizeInBytes, + createParams.GetResourceDesc(), + blockVector, committedAllocationParams, preferCommitted); + } + if (FAILED(hr)) + return hr; + + const bool withinBudget = (pAllocDesc->Flags & ALLOCATION_FLAG_WITHIN_BUDGET) != 0; + hr = E_INVALIDARG; + if (committedAllocationParams.IsValid() && preferCommitted) + { + hr = AllocateCommittedResource(committedAllocationParams, + resAllocInfo.SizeInBytes, withinBudget, pAllocDesc->pPrivateData, + finalCreateParams, ppAllocation, riidResource, ppvResource); + if (SUCCEEDED(hr)) + return hr; + } + if (blockVector != NULL) + { + hr = blockVector->CreateResource(resAllocInfo.SizeInBytes, resAllocInfo.Alignment, + *pAllocDesc, finalCreateParams, + ppAllocation, riidResource, ppvResource); + if (SUCCEEDED(hr)) + return hr; + } + if (committedAllocationParams.IsValid() && !preferCommitted) + { + hr = AllocateCommittedResource(committedAllocationParams, + resAllocInfo.SizeInBytes, withinBudget, pAllocDesc->pPrivateData, + finalCreateParams, ppAllocation, riidResource, ppvResource); + if (SUCCEEDED(hr)) + return hr; + } + return hr; +} + +HRESULT AllocatorPimpl::AllocateMemory( + const ALLOCATION_DESC* pAllocDesc, + const D3D12_RESOURCE_ALLOCATION_INFO* pAllocInfo, + Allocation** ppAllocation) +{ + *ppAllocation = NULL; + + BlockVector* blockVector = NULL; + CommittedAllocationParameters committedAllocationParams = {}; + bool preferCommitted = false; + HRESULT hr = CalcAllocationParams<D3D12_RESOURCE_DESC>(*pAllocDesc, pAllocInfo->SizeInBytes, + NULL, // pResDesc + blockVector, committedAllocationParams, preferCommitted); + if (FAILED(hr)) + return hr; + + const bool withinBudget = (pAllocDesc->Flags & ALLOCATION_FLAG_WITHIN_BUDGET) != 0; + hr = E_INVALIDARG; + if (committedAllocationParams.IsValid() && preferCommitted) + { + hr = AllocateHeap(committedAllocationParams, *pAllocInfo, withinBudget, pAllocDesc->pPrivateData, ppAllocation); + if (SUCCEEDED(hr)) + return hr; + } + if (blockVector != NULL) + { + hr = blockVector->Allocate(pAllocInfo->SizeInBytes, pAllocInfo->Alignment, + *pAllocDesc, 1, (Allocation**)ppAllocation); + if (SUCCEEDED(hr)) + return hr; + } + if (committedAllocationParams.IsValid() && !preferCommitted) + { + hr = AllocateHeap(committedAllocationParams, *pAllocInfo, withinBudget, pAllocDesc->pPrivateData, ppAllocation); + if (SUCCEEDED(hr)) + return hr; + } + return hr; +} + +HRESULT AllocatorPimpl::CreateAliasingResource( + Allocation* pAllocation, + UINT64 AllocationLocalOffset, + const CREATE_RESOURCE_PARAMS& createParams, + REFIID riidResource, + void** ppvResource) +{ + *ppvResource = NULL; + + CREATE_RESOURCE_PARAMS finalCreateParams = createParams; + D3D12_RESOURCE_DESC finalResourceDesc; +#ifdef __ID3D12Device8_INTERFACE_DEFINED__ + D3D12_RESOURCE_DESC1 finalResourceDesc1; +#endif + D3D12_RESOURCE_ALLOCATION_INFO resAllocInfo; + if (createParams.Variant == CREATE_RESOURCE_PARAMS::VARIANT_WITH_STATE) + { + finalResourceDesc = *createParams.GetResourceDesc(); + finalCreateParams.AccessResourceDesc() = &finalResourceDesc; + resAllocInfo = GetResourceAllocationInfo(finalResourceDesc); + } +#ifdef __ID3D12Device8_INTERFACE_DEFINED__ + else if (createParams.Variant == CREATE_RESOURCE_PARAMS::VARIANT_WITH_STATE_AND_DESC1) + { + if (!m_Device8) + { + return E_NOINTERFACE; + } + finalResourceDesc1 = *createParams.GetResourceDesc1(); + finalCreateParams.AccessResourceDesc1() = &finalResourceDesc1; + resAllocInfo = GetResourceAllocationInfo(finalResourceDesc1); + } +#endif +#ifdef __ID3D12Device10_INTERFACE_DEFINED__ + else if (createParams.Variant == CREATE_RESOURCE_PARAMS::VARIANT_WITH_LAYOUT) + { + if (!m_Device10) + { + return E_NOINTERFACE; + } + finalResourceDesc1 = *createParams.GetResourceDesc1(); + finalCreateParams.AccessResourceDesc1() = &finalResourceDesc1; + resAllocInfo = GetResourceAllocationInfo(finalResourceDesc1); + } +#endif + else + { + D3D12MA_ASSERT(0); + return E_INVALIDARG; + } + D3D12MA_ASSERT(IsPow2(resAllocInfo.Alignment)); + D3D12MA_ASSERT(resAllocInfo.SizeInBytes > 0); + + ID3D12Heap* const existingHeap = pAllocation->GetHeap(); + const UINT64 existingOffset = pAllocation->GetOffset(); + const UINT64 existingSize = pAllocation->GetSize(); + const UINT64 newOffset = existingOffset + AllocationLocalOffset; + + if (existingHeap == NULL || + AllocationLocalOffset + resAllocInfo.SizeInBytes > existingSize || + newOffset % resAllocInfo.Alignment != 0) + { + return E_INVALIDARG; + } + + return CreatePlacedResourceWrap(existingHeap, newOffset, finalCreateParams, riidResource, ppvResource); +} + +void AllocatorPimpl::FreeCommittedMemory(Allocation* allocation) +{ + D3D12MA_ASSERT(allocation && allocation->m_PackedData.GetType() == Allocation::TYPE_COMMITTED); + + CommittedAllocationList* const allocList = allocation->m_Committed.list; + allocList->Unregister(allocation); + + const UINT memSegmentGroup = allocList->GetMemorySegmentGroup(this); + const UINT64 allocSize = allocation->GetSize(); + m_Budget.RemoveAllocation(memSegmentGroup, allocSize); + m_Budget.RemoveBlock(memSegmentGroup, allocSize); +} + +void AllocatorPimpl::FreePlacedMemory(Allocation* allocation) +{ + D3D12MA_ASSERT(allocation && allocation->m_PackedData.GetType() == Allocation::TYPE_PLACED); + + NormalBlock* const block = allocation->m_Placed.block; + D3D12MA_ASSERT(block); + BlockVector* const blockVector = block->GetBlockVector(); + D3D12MA_ASSERT(blockVector); + m_Budget.RemoveAllocation(HeapPropertiesToMemorySegmentGroup(block->GetHeapProperties()), allocation->GetSize()); + blockVector->Free(allocation); +} + +void AllocatorPimpl::FreeHeapMemory(Allocation* allocation) +{ + D3D12MA_ASSERT(allocation && allocation->m_PackedData.GetType() == Allocation::TYPE_HEAP); + + CommittedAllocationList* const allocList = allocation->m_Committed.list; + allocList->Unregister(allocation); + SAFE_RELEASE(allocation->m_Heap.heap); + + const UINT memSegmentGroup = allocList->GetMemorySegmentGroup(this); + const UINT64 allocSize = allocation->GetSize(); + m_Budget.RemoveAllocation(memSegmentGroup, allocSize); + m_Budget.RemoveBlock(memSegmentGroup, allocSize); +} + +void AllocatorPimpl::SetResidencyPriority(ID3D12Pageable* obj, D3D12_RESIDENCY_PRIORITY priority) const +{ +#ifdef __ID3D12Device1_INTERFACE_DEFINED__ + if (priority != D3D12_RESIDENCY_PRIORITY_NONE && m_Device1) + { + // Intentionally ignoring the result. + m_Device1->SetResidencyPriority(1, &obj, &priority); + } +#endif +} + +void AllocatorPimpl::SetCurrentFrameIndex(UINT frameIndex) +{ + m_CurrentFrameIndex.store(frameIndex); + +#if D3D12MA_DXGI_1_4 + UpdateD3D12Budget(); +#endif +} + +void AllocatorPimpl::CalculateStatistics(TotalStatistics& outStats, DetailedStatistics outCutomHeaps[2]) +{ + // Init stats + for (size_t i = 0; i < HEAP_TYPE_COUNT; i++) + ClearDetailedStatistics(outStats.HeapType[i]); + for (size_t i = 0; i < DXGI_MEMORY_SEGMENT_GROUP_COUNT; i++) + ClearDetailedStatistics(outStats.MemorySegmentGroup[i]); + ClearDetailedStatistics(outStats.Total); + if (outCutomHeaps) + { + ClearDetailedStatistics(outCutomHeaps[0]); + ClearDetailedStatistics(outCutomHeaps[1]); + } + + // Process default pools. 3 standard heap types only. Add them to outStats.HeapType[i]. + if (SupportsResourceHeapTier2()) + { + // DEFAULT, UPLOAD, READBACK. + for (size_t heapTypeIndex = 0; heapTypeIndex < STANDARD_HEAP_TYPE_COUNT; ++heapTypeIndex) + { + BlockVector* const pBlockVector = m_BlockVectors[heapTypeIndex]; + D3D12MA_ASSERT(pBlockVector); + pBlockVector->AddDetailedStatistics(outStats.HeapType[heapTypeIndex]); + } + } + else + { + // DEFAULT, UPLOAD, READBACK. + for (size_t heapTypeIndex = 0; heapTypeIndex < STANDARD_HEAP_TYPE_COUNT; ++heapTypeIndex) + { + for (size_t heapSubType = 0; heapSubType < 3; ++heapSubType) + { + BlockVector* const pBlockVector = m_BlockVectors[heapTypeIndex * 3 + heapSubType]; + D3D12MA_ASSERT(pBlockVector); + pBlockVector->AddDetailedStatistics(outStats.HeapType[heapTypeIndex]); + } + } + } + + // Sum them up to memory segment groups. + AddDetailedStatistics( + outStats.MemorySegmentGroup[StandardHeapTypeToMemorySegmentGroup(D3D12_HEAP_TYPE_DEFAULT)], + outStats.HeapType[0]); + AddDetailedStatistics( + outStats.MemorySegmentGroup[StandardHeapTypeToMemorySegmentGroup(D3D12_HEAP_TYPE_UPLOAD)], + outStats.HeapType[1]); + AddDetailedStatistics( + outStats.MemorySegmentGroup[StandardHeapTypeToMemorySegmentGroup(D3D12_HEAP_TYPE_READBACK)], + outStats.HeapType[2]); + + // Process custom pools. + DetailedStatistics tmpStats; + for (size_t heapTypeIndex = 0; heapTypeIndex < HEAP_TYPE_COUNT; ++heapTypeIndex) + { + MutexLockRead lock(m_PoolsMutex[heapTypeIndex], m_UseMutex); + PoolList& poolList = m_Pools[heapTypeIndex]; + for (PoolPimpl* pool = poolList.Front(); pool != NULL; pool = poolList.GetNext(pool)) + { + const D3D12_HEAP_PROPERTIES& poolHeapProps = pool->GetDesc().HeapProperties; + ClearDetailedStatistics(tmpStats); + pool->AddDetailedStatistics(tmpStats); + AddDetailedStatistics( + outStats.HeapType[heapTypeIndex], tmpStats); + + UINT memorySegment = HeapPropertiesToMemorySegmentGroup(poolHeapProps); + AddDetailedStatistics( + outStats.MemorySegmentGroup[memorySegment], tmpStats); + + if (outCutomHeaps) + AddDetailedStatistics(outCutomHeaps[memorySegment], tmpStats); + } + } + + // Process committed allocations. 3 standard heap types only. + for (UINT heapTypeIndex = 0; heapTypeIndex < STANDARD_HEAP_TYPE_COUNT; ++heapTypeIndex) + { + ClearDetailedStatistics(tmpStats); + m_CommittedAllocations[heapTypeIndex].AddDetailedStatistics(tmpStats); + AddDetailedStatistics( + outStats.HeapType[heapTypeIndex], tmpStats); + AddDetailedStatistics( + outStats.MemorySegmentGroup[StandardHeapTypeToMemorySegmentGroup(IndexToHeapType(heapTypeIndex))], tmpStats); + } + + // Sum up memory segment groups to totals. + AddDetailedStatistics(outStats.Total, outStats.MemorySegmentGroup[0]); + AddDetailedStatistics(outStats.Total, outStats.MemorySegmentGroup[1]); + + D3D12MA_ASSERT(outStats.Total.Stats.BlockCount == + outStats.MemorySegmentGroup[0].Stats.BlockCount + outStats.MemorySegmentGroup[1].Stats.BlockCount); + D3D12MA_ASSERT(outStats.Total.Stats.AllocationCount == + outStats.MemorySegmentGroup[0].Stats.AllocationCount + outStats.MemorySegmentGroup[1].Stats.AllocationCount); + D3D12MA_ASSERT(outStats.Total.Stats.BlockBytes == + outStats.MemorySegmentGroup[0].Stats.BlockBytes + outStats.MemorySegmentGroup[1].Stats.BlockBytes); + D3D12MA_ASSERT(outStats.Total.Stats.AllocationBytes == + outStats.MemorySegmentGroup[0].Stats.AllocationBytes + outStats.MemorySegmentGroup[1].Stats.AllocationBytes); + D3D12MA_ASSERT(outStats.Total.UnusedRangeCount == + outStats.MemorySegmentGroup[0].UnusedRangeCount + outStats.MemorySegmentGroup[1].UnusedRangeCount); + + D3D12MA_ASSERT(outStats.Total.Stats.BlockCount == + outStats.HeapType[0].Stats.BlockCount + outStats.HeapType[1].Stats.BlockCount + + outStats.HeapType[2].Stats.BlockCount + outStats.HeapType[3].Stats.BlockCount); + D3D12MA_ASSERT(outStats.Total.Stats.AllocationCount == + outStats.HeapType[0].Stats.AllocationCount + outStats.HeapType[1].Stats.AllocationCount + + outStats.HeapType[2].Stats.AllocationCount + outStats.HeapType[3].Stats.AllocationCount); + D3D12MA_ASSERT(outStats.Total.Stats.BlockBytes == + outStats.HeapType[0].Stats.BlockBytes + outStats.HeapType[1].Stats.BlockBytes + + outStats.HeapType[2].Stats.BlockBytes + outStats.HeapType[3].Stats.BlockBytes); + D3D12MA_ASSERT(outStats.Total.Stats.AllocationBytes == + outStats.HeapType[0].Stats.AllocationBytes + outStats.HeapType[1].Stats.AllocationBytes + + outStats.HeapType[2].Stats.AllocationBytes + outStats.HeapType[3].Stats.AllocationBytes); + D3D12MA_ASSERT(outStats.Total.UnusedRangeCount == + outStats.HeapType[0].UnusedRangeCount + outStats.HeapType[1].UnusedRangeCount + + outStats.HeapType[2].UnusedRangeCount + outStats.HeapType[3].UnusedRangeCount); +} + +void AllocatorPimpl::GetBudget(Budget* outLocalBudget, Budget* outNonLocalBudget) +{ + if (outLocalBudget) + m_Budget.GetStatistics(outLocalBudget->Stats, DXGI_MEMORY_SEGMENT_GROUP_LOCAL_COPY); + if (outNonLocalBudget) + m_Budget.GetStatistics(outNonLocalBudget->Stats, DXGI_MEMORY_SEGMENT_GROUP_NON_LOCAL_COPY); + +#if D3D12MA_DXGI_1_4 + if (m_Adapter3) + { + if (!m_Budget.ShouldUpdateBudget()) + { + m_Budget.GetBudget(m_UseMutex, + outLocalBudget ? &outLocalBudget->UsageBytes : NULL, + outLocalBudget ? &outLocalBudget->BudgetBytes : NULL, + outNonLocalBudget ? &outNonLocalBudget->UsageBytes : NULL, + outNonLocalBudget ? &outNonLocalBudget->BudgetBytes : NULL); + } + else + { + UpdateD3D12Budget(); + GetBudget(outLocalBudget, outNonLocalBudget); // Recursion + } + } + else +#endif + { + if (outLocalBudget) + { + outLocalBudget->UsageBytes = outLocalBudget->Stats.BlockBytes; + outLocalBudget->BudgetBytes = GetMemoryCapacity(DXGI_MEMORY_SEGMENT_GROUP_LOCAL_COPY) * 8 / 10; // 80% heuristics. + } + if (outNonLocalBudget) + { + outNonLocalBudget->UsageBytes = outNonLocalBudget->Stats.BlockBytes; + outNonLocalBudget->BudgetBytes = GetMemoryCapacity(DXGI_MEMORY_SEGMENT_GROUP_NON_LOCAL_COPY) * 8 / 10; // 80% heuristics. + } + } +} + +void AllocatorPimpl::GetBudgetForHeapType(Budget& outBudget, D3D12_HEAP_TYPE heapType) +{ + switch (heapType) + { + case D3D12_HEAP_TYPE_DEFAULT: + GetBudget(&outBudget, NULL); + break; + case D3D12_HEAP_TYPE_UPLOAD: + case D3D12_HEAP_TYPE_READBACK: + GetBudget(NULL, &outBudget); + break; + default: D3D12MA_ASSERT(0); + } +} + +void AllocatorPimpl::BuildStatsString(WCHAR** ppStatsString, BOOL detailedMap) +{ + StringBuilder sb(GetAllocs()); + { + Budget localBudget = {}, nonLocalBudget = {}; + GetBudget(&localBudget, &nonLocalBudget); + + TotalStatistics stats; + DetailedStatistics customHeaps[2]; + CalculateStatistics(stats, customHeaps); + + JsonWriter json(GetAllocs(), sb); + json.BeginObject(); + { + json.WriteString(L"General"); + json.BeginObject(); + { + json.WriteString(L"API"); + json.WriteString(L"Direct3D 12"); + + json.WriteString(L"GPU"); + json.WriteString(m_AdapterDesc.Description); + + json.WriteString(L"DedicatedVideoMemory"); + json.WriteNumber((UINT64)m_AdapterDesc.DedicatedVideoMemory); + json.WriteString(L"DedicatedSystemMemory"); + json.WriteNumber((UINT64)m_AdapterDesc.DedicatedSystemMemory); + json.WriteString(L"SharedSystemMemory"); + json.WriteNumber((UINT64)m_AdapterDesc.SharedSystemMemory); + + json.WriteString(L"ResourceHeapTier"); + json.WriteNumber(static_cast<UINT>(m_D3D12Options.ResourceHeapTier)); + + json.WriteString(L"ResourceBindingTier"); + json.WriteNumber(static_cast<UINT>(m_D3D12Options.ResourceBindingTier)); + + json.WriteString(L"TiledResourcesTier"); + json.WriteNumber(static_cast<UINT>(m_D3D12Options.TiledResourcesTier)); + + json.WriteString(L"TileBasedRenderer"); + json.WriteBool(m_D3D12Architecture.TileBasedRenderer); + + json.WriteString(L"UMA"); + json.WriteBool(m_D3D12Architecture.UMA); + json.WriteString(L"CacheCoherentUMA"); + json.WriteBool(m_D3D12Architecture.CacheCoherentUMA); + } + json.EndObject(); + } + { + json.WriteString(L"Total"); + json.AddDetailedStatisticsInfoObject(stats.Total); + } + { + json.WriteString(L"MemoryInfo"); + json.BeginObject(); + { + json.WriteString(L"L0"); + json.BeginObject(); + { + json.WriteString(L"Budget"); + WriteBudgetToJson(json, IsUMA() ? localBudget : nonLocalBudget); // When UMA device only L0 present as local + + json.WriteString(L"Stats"); + json.AddDetailedStatisticsInfoObject(stats.MemorySegmentGroup[!IsUMA()]); + + json.WriteString(L"MemoryPools"); + json.BeginObject(); + { + if (IsUMA()) + { + json.WriteString(L"DEFAULT"); + json.BeginObject(); + { + json.WriteString(L"Stats"); + json.AddDetailedStatisticsInfoObject(stats.HeapType[0]); + } + json.EndObject(); + } + json.WriteString(L"UPLOAD"); + json.BeginObject(); + { + json.WriteString(L"Stats"); + json.AddDetailedStatisticsInfoObject(stats.HeapType[1]); + } + json.EndObject(); + + json.WriteString(L"READBACK"); + json.BeginObject(); + { + json.WriteString(L"Stats"); + json.AddDetailedStatisticsInfoObject(stats.HeapType[2]); + } + json.EndObject(); + + json.WriteString(L"CUSTOM"); + json.BeginObject(); + { + json.WriteString(L"Stats"); + json.AddDetailedStatisticsInfoObject(customHeaps[!IsUMA()]); + } + json.EndObject(); + } + json.EndObject(); + } + json.EndObject(); + if (!IsUMA()) + { + json.WriteString(L"L1"); + json.BeginObject(); + { + json.WriteString(L"Budget"); + WriteBudgetToJson(json, localBudget); + + json.WriteString(L"Stats"); + json.AddDetailedStatisticsInfoObject(stats.MemorySegmentGroup[0]); + + json.WriteString(L"MemoryPools"); + json.BeginObject(); + { + json.WriteString(L"DEFAULT"); + json.BeginObject(); + { + json.WriteString(L"Stats"); + json.AddDetailedStatisticsInfoObject(stats.HeapType[0]); + } + json.EndObject(); + + json.WriteString(L"CUSTOM"); + json.BeginObject(); + { + json.WriteString(L"Stats"); + json.AddDetailedStatisticsInfoObject(customHeaps[0]); + } + json.EndObject(); + } + json.EndObject(); + } + json.EndObject(); + } + } + json.EndObject(); + } + + if (detailedMap) + { + const auto writeHeapInfo = [&](BlockVector* blockVector, CommittedAllocationList* committedAllocs, bool customHeap) + { + D3D12MA_ASSERT(blockVector); + + D3D12_HEAP_FLAGS flags = blockVector->GetHeapFlags(); + json.WriteString(L"Flags"); + json.BeginArray(true); + { + if (flags & D3D12_HEAP_FLAG_SHARED) + json.WriteString(L"HEAP_FLAG_SHARED"); + if (flags & D3D12_HEAP_FLAG_ALLOW_DISPLAY) + json.WriteString(L"HEAP_FLAG_ALLOW_DISPLAY"); + if (flags & D3D12_HEAP_FLAG_SHARED_CROSS_ADAPTER) + json.WriteString(L"HEAP_FLAG_CROSS_ADAPTER"); + if (flags & D3D12_HEAP_FLAG_HARDWARE_PROTECTED) + json.WriteString(L"HEAP_FLAG_HARDWARE_PROTECTED"); + if (flags & D3D12_HEAP_FLAG_ALLOW_WRITE_WATCH) + json.WriteString(L"HEAP_FLAG_ALLOW_WRITE_WATCH"); + if (flags & D3D12_HEAP_FLAG_ALLOW_SHADER_ATOMICS) + json.WriteString(L"HEAP_FLAG_ALLOW_SHADER_ATOMICS"); +#ifdef __ID3D12Device8_INTERFACE_DEFINED__ + if (flags & D3D12_HEAP_FLAG_CREATE_NOT_RESIDENT) + json.WriteString(L"HEAP_FLAG_CREATE_NOT_RESIDENT"); + if (flags & D3D12_HEAP_FLAG_CREATE_NOT_ZEROED) + json.WriteString(L"HEAP_FLAG_CREATE_NOT_ZEROED"); +#endif + + if (flags & D3D12_HEAP_FLAG_DENY_BUFFERS) + json.WriteString(L"HEAP_FLAG_DENY_BUFFERS"); + if (flags & D3D12_HEAP_FLAG_DENY_RT_DS_TEXTURES) + json.WriteString(L"HEAP_FLAG_DENY_RT_DS_TEXTURES"); + if (flags & D3D12_HEAP_FLAG_DENY_NON_RT_DS_TEXTURES) + json.WriteString(L"HEAP_FLAG_DENY_NON_RT_DS_TEXTURES"); + + flags &= ~(D3D12_HEAP_FLAG_SHARED + | D3D12_HEAP_FLAG_DENY_BUFFERS + | D3D12_HEAP_FLAG_ALLOW_DISPLAY + | D3D12_HEAP_FLAG_SHARED_CROSS_ADAPTER + | D3D12_HEAP_FLAG_DENY_RT_DS_TEXTURES + | D3D12_HEAP_FLAG_DENY_NON_RT_DS_TEXTURES + | D3D12_HEAP_FLAG_HARDWARE_PROTECTED + | D3D12_HEAP_FLAG_ALLOW_WRITE_WATCH + | D3D12_HEAP_FLAG_ALLOW_SHADER_ATOMICS); +#ifdef __ID3D12Device8_INTERFACE_DEFINED__ + flags &= ~(D3D12_HEAP_FLAG_CREATE_NOT_RESIDENT + | D3D12_HEAP_FLAG_CREATE_NOT_ZEROED); +#endif + if (flags != 0) + json.WriteNumber((UINT)flags); + + if (customHeap) + { + const D3D12_HEAP_PROPERTIES& properties = blockVector->GetHeapProperties(); + switch (properties.MemoryPoolPreference) + { + default: + D3D12MA_ASSERT(0); + case D3D12_MEMORY_POOL_UNKNOWN: + json.WriteString(L"MEMORY_POOL_UNKNOWN"); + break; + case D3D12_MEMORY_POOL_L0: + json.WriteString(L"MEMORY_POOL_L0"); + break; + case D3D12_MEMORY_POOL_L1: + json.WriteString(L"MEMORY_POOL_L1"); + break; + } + switch (properties.CPUPageProperty) + { + default: + D3D12MA_ASSERT(0); + case D3D12_CPU_PAGE_PROPERTY_UNKNOWN: + json.WriteString(L"CPU_PAGE_PROPERTY_UNKNOWN"); + break; + case D3D12_CPU_PAGE_PROPERTY_NOT_AVAILABLE: + json.WriteString(L"CPU_PAGE_PROPERTY_NOT_AVAILABLE"); + break; + case D3D12_CPU_PAGE_PROPERTY_WRITE_COMBINE: + json.WriteString(L"CPU_PAGE_PROPERTY_WRITE_COMBINE"); + break; + case D3D12_CPU_PAGE_PROPERTY_WRITE_BACK: + json.WriteString(L"CPU_PAGE_PROPERTY_WRITE_BACK"); + break; + } + } + } + json.EndArray(); + + json.WriteString(L"PreferredBlockSize"); + json.WriteNumber(blockVector->GetPreferredBlockSize()); + + json.WriteString(L"Blocks"); + blockVector->WriteBlockInfoToJson(json); + + json.WriteString(L"DedicatedAllocations"); + json.BeginArray(); + if (committedAllocs) + committedAllocs->BuildStatsString(json); + json.EndArray(); + }; + + json.WriteString(L"DefaultPools"); + json.BeginObject(); + { + if (SupportsResourceHeapTier2()) + { + for (uint8_t heapType = 0; heapType < STANDARD_HEAP_TYPE_COUNT; ++heapType) + { + json.WriteString(HeapTypeNames[heapType]); + json.BeginObject(); + writeHeapInfo(m_BlockVectors[heapType], m_CommittedAllocations + heapType, false); + json.EndObject(); + } + } + else + { + for (uint8_t heapType = 0; heapType < STANDARD_HEAP_TYPE_COUNT; ++heapType) + { + for (uint8_t heapSubType = 0; heapSubType < 3; ++heapSubType) + { + static const WCHAR* const heapSubTypeName[] = { + L" - Buffers", + L" - Textures", + L" - Textures RT/DS", + }; + json.BeginString(HeapTypeNames[heapType]); + json.EndString(heapSubTypeName[heapSubType]); + + json.BeginObject(); + writeHeapInfo(m_BlockVectors[heapType + heapSubType], m_CommittedAllocations + heapType, false); + json.EndObject(); + } + } + } + } + json.EndObject(); + + json.WriteString(L"CustomPools"); + json.BeginObject(); + for (uint8_t heapTypeIndex = 0; heapTypeIndex < HEAP_TYPE_COUNT; ++heapTypeIndex) + { + MutexLockRead mutex(m_PoolsMutex[heapTypeIndex], m_UseMutex); + auto* item = m_Pools[heapTypeIndex].Front(); + if (item != NULL) + { + size_t index = 0; + json.WriteString(HeapTypeNames[heapTypeIndex]); + json.BeginArray(); + do + { + json.BeginObject(); + json.WriteString(L"Name"); + json.BeginString(); + json.ContinueString(index++); + if (item->GetName()) + { + json.ContinueString(L" - "); + json.ContinueString(item->GetName()); + } + json.EndString(); + + writeHeapInfo(item->GetBlockVector(), item->GetCommittedAllocationList(), heapTypeIndex == 3); + json.EndObject(); + } while ((item = PoolList::GetNext(item)) != NULL); + json.EndArray(); + } + } + json.EndObject(); + } + json.EndObject(); + } + + const size_t length = sb.GetLength(); + WCHAR* result = AllocateArray<WCHAR>(GetAllocs(), length + 2); + result[0] = 0xFEFF; + memcpy(result + 1, sb.GetData(), length * sizeof(WCHAR)); + result[length + 1] = L'\0'; + *ppStatsString = result; +} + +void AllocatorPimpl::FreeStatsString(WCHAR* pStatsString) +{ + D3D12MA_ASSERT(pStatsString); + Free(GetAllocs(), pStatsString); +} + +template<typename D3D12_RESOURCE_DESC_T> +bool AllocatorPimpl::PrefersCommittedAllocation(const D3D12_RESOURCE_DESC_T& resourceDesc) +{ + // Intentional. It may change in the future. + return false; +} + +HRESULT AllocatorPimpl::AllocateCommittedResource( + const CommittedAllocationParameters& committedAllocParams, + UINT64 resourceSize, bool withinBudget, void* pPrivateData, + const CREATE_RESOURCE_PARAMS& createParams, + Allocation** ppAllocation, REFIID riidResource, void** ppvResource) +{ + D3D12MA_ASSERT(committedAllocParams.IsValid()); + + HRESULT hr; + ID3D12Resource* res = NULL; + // Allocate aliasing memory with explicit heap + if (committedAllocParams.m_CanAlias) + { + D3D12_RESOURCE_ALLOCATION_INFO heapAllocInfo = {}; + heapAllocInfo.SizeInBytes = resourceSize; + heapAllocInfo.Alignment = HeapFlagsToAlignment(committedAllocParams.m_HeapFlags, m_MsaaAlwaysCommitted); + hr = AllocateHeap(committedAllocParams, heapAllocInfo, withinBudget, pPrivateData, ppAllocation); + if (SUCCEEDED(hr)) + { + hr = CreatePlacedResourceWrap((*ppAllocation)->GetHeap(), 0, + createParams, D3D12MA_IID_PPV_ARGS(&res)); + if (SUCCEEDED(hr)) + { + if (ppvResource != NULL) + hr = res->QueryInterface(riidResource, ppvResource); + if (SUCCEEDED(hr)) + { + (*ppAllocation)->SetResourcePointer(res, createParams.GetBaseResourceDesc()); + return hr; + } + res->Release(); + } + FreeHeapMemory(*ppAllocation); + } + return hr; + } + + if (withinBudget && + !NewAllocationWithinBudget(committedAllocParams.m_HeapProperties.Type, resourceSize)) + { + return E_OUTOFMEMORY; + } + + /* D3D12 ERROR: + * ID3D12Device::CreateCommittedResource: + * When creating a committed resource, D3D12_HEAP_FLAGS must not have either + * D3D12_HEAP_FLAG_DENY_NON_RT_DS_TEXTURES, + * D3D12_HEAP_FLAG_DENY_RT_DS_TEXTURES, + * nor D3D12_HEAP_FLAG_DENY_BUFFERS set. + * These flags will be set automatically to correspond with the committed resource type. + * + * [ STATE_CREATION ERROR #640: CREATERESOURCEANDHEAP_INVALIDHEAPMISCFLAGS] + */ + +#ifdef __ID3D12Device10_INTERFACE_DEFINED__ + if (createParams.Variant == CREATE_RESOURCE_PARAMS::VARIANT_WITH_LAYOUT) + { + if (!m_Device10) + { + return E_NOINTERFACE; + } + hr = m_Device10->CreateCommittedResource3( + &committedAllocParams.m_HeapProperties, + committedAllocParams.m_HeapFlags & ~RESOURCE_CLASS_HEAP_FLAGS, + createParams.GetResourceDesc1(), createParams.GetInitialLayout(), + createParams.GetOptimizedClearValue(), committedAllocParams.m_ProtectedSession, + createParams.GetNumCastableFormats(), createParams.GetCastableFormats(), + D3D12MA_IID_PPV_ARGS(&res)); + } else +#endif +#ifdef __ID3D12Device8_INTERFACE_DEFINED__ + if (createParams.Variant == CREATE_RESOURCE_PARAMS::VARIANT_WITH_STATE_AND_DESC1) + { + if (!m_Device8) + { + return E_NOINTERFACE; + } + hr = m_Device8->CreateCommittedResource2( + &committedAllocParams.m_HeapProperties, + committedAllocParams.m_HeapFlags & ~RESOURCE_CLASS_HEAP_FLAGS, + createParams.GetResourceDesc1(), createParams.GetInitialResourceState(), + createParams.GetOptimizedClearValue(), committedAllocParams.m_ProtectedSession, + D3D12MA_IID_PPV_ARGS(&res)); + } else +#endif + if (createParams.Variant == CREATE_RESOURCE_PARAMS::VARIANT_WITH_STATE) + { +#ifdef __ID3D12Device4_INTERFACE_DEFINED__ + if (m_Device4) + { + hr = m_Device4->CreateCommittedResource1( + &committedAllocParams.m_HeapProperties, + committedAllocParams.m_HeapFlags & ~RESOURCE_CLASS_HEAP_FLAGS, + createParams.GetResourceDesc(), createParams.GetInitialResourceState(), + createParams.GetOptimizedClearValue(), committedAllocParams.m_ProtectedSession, + D3D12MA_IID_PPV_ARGS(&res)); + } + else +#endif + { + if (committedAllocParams.m_ProtectedSession == NULL) + { + hr = m_Device->CreateCommittedResource( + &committedAllocParams.m_HeapProperties, + committedAllocParams.m_HeapFlags & ~RESOURCE_CLASS_HEAP_FLAGS, + createParams.GetResourceDesc(), createParams.GetInitialResourceState(), + createParams.GetOptimizedClearValue(), D3D12MA_IID_PPV_ARGS(&res)); + } + else + hr = E_NOINTERFACE; + } + } + else + { + D3D12MA_ASSERT(0); + return E_INVALIDARG; + } + + if (SUCCEEDED(hr)) + { + SetResidencyPriority(res, committedAllocParams.m_ResidencyPriority); + + if (ppvResource != NULL) + { + hr = res->QueryInterface(riidResource, ppvResource); + } + if (SUCCEEDED(hr)) + { + BOOL wasZeroInitialized = TRUE; +#if D3D12MA_CREATE_NOT_ZEROED_AVAILABLE + if((committedAllocParams.m_HeapFlags & D3D12_HEAP_FLAG_CREATE_NOT_ZEROED) != 0) + { + wasZeroInitialized = FALSE; + } +#endif + + Allocation* alloc = m_AllocationObjectAllocator.Allocate( + this, resourceSize, createParams.GetBaseResourceDesc()->Alignment, wasZeroInitialized); + alloc->InitCommitted(committedAllocParams.m_List); + alloc->SetResourcePointer(res, createParams.GetBaseResourceDesc()); + alloc->SetPrivateData(pPrivateData); + + *ppAllocation = alloc; + + committedAllocParams.m_List->Register(alloc); + + const UINT memSegmentGroup = HeapPropertiesToMemorySegmentGroup(committedAllocParams.m_HeapProperties); + m_Budget.AddBlock(memSegmentGroup, resourceSize); + m_Budget.AddAllocation(memSegmentGroup, resourceSize); + } + else + { + res->Release(); + } + } + return hr; +} + +HRESULT AllocatorPimpl::AllocateHeap( + const CommittedAllocationParameters& committedAllocParams, + const D3D12_RESOURCE_ALLOCATION_INFO& allocInfo, bool withinBudget, + void* pPrivateData, Allocation** ppAllocation) +{ + D3D12MA_ASSERT(committedAllocParams.IsValid()); + + *ppAllocation = nullptr; + + if (withinBudget && + !NewAllocationWithinBudget(committedAllocParams.m_HeapProperties.Type, allocInfo.SizeInBytes)) + { + return E_OUTOFMEMORY; + } + + D3D12_HEAP_DESC heapDesc = {}; + heapDesc.SizeInBytes = allocInfo.SizeInBytes; + heapDesc.Properties = committedAllocParams.m_HeapProperties; + heapDesc.Alignment = allocInfo.Alignment; + heapDesc.Flags = committedAllocParams.m_HeapFlags; + + HRESULT hr; + ID3D12Heap* heap = nullptr; +#ifdef __ID3D12Device4_INTERFACE_DEFINED__ + if (m_Device4) + hr = m_Device4->CreateHeap1(&heapDesc, committedAllocParams.m_ProtectedSession, D3D12MA_IID_PPV_ARGS(&heap)); + else +#endif + { + if (committedAllocParams.m_ProtectedSession == NULL) + hr = m_Device->CreateHeap(&heapDesc, D3D12MA_IID_PPV_ARGS(&heap)); + else + hr = E_NOINTERFACE; + } + + if (SUCCEEDED(hr)) + { + SetResidencyPriority(heap, committedAllocParams.m_ResidencyPriority); + + BOOL wasZeroInitialized = TRUE; +#if D3D12MA_CREATE_NOT_ZEROED_AVAILABLE + if((heapDesc.Flags & D3D12_HEAP_FLAG_CREATE_NOT_ZEROED) != 0) + { + wasZeroInitialized = FALSE; + } +#endif + + (*ppAllocation) = m_AllocationObjectAllocator.Allocate(this, allocInfo.SizeInBytes, allocInfo.Alignment, wasZeroInitialized); + (*ppAllocation)->InitHeap(committedAllocParams.m_List, heap); + (*ppAllocation)->SetPrivateData(pPrivateData); + committedAllocParams.m_List->Register(*ppAllocation); + + const UINT memSegmentGroup = HeapPropertiesToMemorySegmentGroup(committedAllocParams.m_HeapProperties); + m_Budget.AddBlock(memSegmentGroup, allocInfo.SizeInBytes); + m_Budget.AddAllocation(memSegmentGroup, allocInfo.SizeInBytes); + } + return hr; +} + +template<typename D3D12_RESOURCE_DESC_T> +HRESULT AllocatorPimpl::CalcAllocationParams(const ALLOCATION_DESC& allocDesc, UINT64 allocSize, + const D3D12_RESOURCE_DESC_T* resDesc, + BlockVector*& outBlockVector, CommittedAllocationParameters& outCommittedAllocationParams, bool& outPreferCommitted) +{ + outBlockVector = NULL; + outCommittedAllocationParams = CommittedAllocationParameters(); + outPreferCommitted = false; + + bool msaaAlwaysCommitted; + if (allocDesc.CustomPool != NULL) + { + PoolPimpl* const pool = allocDesc.CustomPool->m_Pimpl; + + msaaAlwaysCommitted = pool->GetBlockVector()->DeniesMsaaTextures(); + outBlockVector = pool->GetBlockVector(); + + const auto& desc = pool->GetDesc(); + outCommittedAllocationParams.m_ProtectedSession = desc.pProtectedSession; + outCommittedAllocationParams.m_HeapProperties = desc.HeapProperties; + outCommittedAllocationParams.m_HeapFlags = desc.HeapFlags; + outCommittedAllocationParams.m_List = pool->GetCommittedAllocationList(); + outCommittedAllocationParams.m_ResidencyPriority = pool->GetDesc().ResidencyPriority; + } + else + { + if (!IsHeapTypeStandard(allocDesc.HeapType)) + { + return E_INVALIDARG; + } + msaaAlwaysCommitted = m_MsaaAlwaysCommitted; + + outCommittedAllocationParams.m_HeapProperties = StandardHeapTypeToHeapProperties(allocDesc.HeapType); + outCommittedAllocationParams.m_HeapFlags = allocDesc.ExtraHeapFlags; + outCommittedAllocationParams.m_List = &m_CommittedAllocations[HeapTypeToIndex(allocDesc.HeapType)]; + // outCommittedAllocationParams.m_ResidencyPriority intentionally left with default value. + + const ResourceClass resourceClass = (resDesc != NULL) ? + ResourceDescToResourceClass(*resDesc) : HeapFlagsToResourceClass(allocDesc.ExtraHeapFlags); + const UINT defaultPoolIndex = CalcDefaultPoolIndex(allocDesc, resourceClass); + if (defaultPoolIndex != UINT32_MAX) + { + outBlockVector = m_BlockVectors[defaultPoolIndex]; + const UINT64 preferredBlockSize = outBlockVector->GetPreferredBlockSize(); + if (allocSize > preferredBlockSize) + { + outBlockVector = NULL; + } + else if (allocSize > preferredBlockSize / 2) + { + // Heuristics: Allocate committed memory if requested size if greater than half of preferred block size. + outPreferCommitted = true; + } + } + + const D3D12_HEAP_FLAGS extraHeapFlags = allocDesc.ExtraHeapFlags & ~RESOURCE_CLASS_HEAP_FLAGS; + if (outBlockVector != NULL && extraHeapFlags != 0) + { + outBlockVector = NULL; + } + } + + if ((allocDesc.Flags & ALLOCATION_FLAG_COMMITTED) != 0 || + m_AlwaysCommitted) + { + outBlockVector = NULL; + } + if ((allocDesc.Flags & ALLOCATION_FLAG_NEVER_ALLOCATE) != 0) + { + outCommittedAllocationParams.m_List = NULL; + } + outCommittedAllocationParams.m_CanAlias = allocDesc.Flags & ALLOCATION_FLAG_CAN_ALIAS; + + if (resDesc != NULL) + { + if (resDesc->SampleDesc.Count > 1 && msaaAlwaysCommitted) + outBlockVector = NULL; + if (!outPreferCommitted && PrefersCommittedAllocation(*resDesc)) + outPreferCommitted = true; + } + + return (outBlockVector != NULL || outCommittedAllocationParams.m_List != NULL) ? S_OK : E_INVALIDARG; +} + +UINT AllocatorPimpl::CalcDefaultPoolIndex(const ALLOCATION_DESC& allocDesc, ResourceClass resourceClass) const +{ + D3D12_HEAP_FLAGS extraHeapFlags = allocDesc.ExtraHeapFlags & ~RESOURCE_CLASS_HEAP_FLAGS; + +#if D3D12MA_CREATE_NOT_ZEROED_AVAILABLE + // If allocator was created with ALLOCATOR_FLAG_DEFAULT_POOLS_NOT_ZEROED, also ignore + // D3D12_HEAP_FLAG_CREATE_NOT_ZEROED. + if(m_DefaultPoolsNotZeroed) + { + extraHeapFlags &= ~D3D12_HEAP_FLAG_CREATE_NOT_ZEROED; + } +#endif + + if (extraHeapFlags != 0) + { + return UINT32_MAX; + } + + UINT poolIndex = UINT_MAX; + switch (allocDesc.HeapType) + { + case D3D12_HEAP_TYPE_DEFAULT: poolIndex = 0; break; + case D3D12_HEAP_TYPE_UPLOAD: poolIndex = 1; break; + case D3D12_HEAP_TYPE_READBACK: poolIndex = 2; break; + default: D3D12MA_ASSERT(0); + } + + if (SupportsResourceHeapTier2()) + return poolIndex; + else + { + switch (resourceClass) + { + case ResourceClass::Buffer: + return poolIndex * 3; + case ResourceClass::Non_RT_DS_Texture: + return poolIndex * 3 + 1; + case ResourceClass::RT_DS_Texture: + return poolIndex * 3 + 2; + default: + return UINT32_MAX; + } + } +} + +void AllocatorPimpl::CalcDefaultPoolParams(D3D12_HEAP_TYPE& outHeapType, D3D12_HEAP_FLAGS& outHeapFlags, UINT index) const +{ + outHeapType = D3D12_HEAP_TYPE_DEFAULT; + outHeapFlags = D3D12_HEAP_FLAG_NONE; + + if (!SupportsResourceHeapTier2()) + { + switch (index % 3) + { + case 0: + outHeapFlags = D3D12_HEAP_FLAG_DENY_RT_DS_TEXTURES | D3D12_HEAP_FLAG_DENY_NON_RT_DS_TEXTURES; + break; + case 1: + outHeapFlags = D3D12_HEAP_FLAG_DENY_BUFFERS | D3D12_HEAP_FLAG_DENY_RT_DS_TEXTURES; + break; + case 2: + outHeapFlags = D3D12_HEAP_FLAG_DENY_BUFFERS | D3D12_HEAP_FLAG_DENY_NON_RT_DS_TEXTURES; + break; + } + + index /= 3; + } + + switch (index) + { + case 0: + outHeapType = D3D12_HEAP_TYPE_DEFAULT; + break; + case 1: + outHeapType = D3D12_HEAP_TYPE_UPLOAD; + break; + case 2: + outHeapType = D3D12_HEAP_TYPE_READBACK; + break; + default: + D3D12MA_ASSERT(0); + } +} + +void AllocatorPimpl::RegisterPool(Pool* pool, D3D12_HEAP_TYPE heapType) +{ + const UINT heapTypeIndex = HeapTypeToIndex(heapType); + + MutexLockWrite lock(m_PoolsMutex[heapTypeIndex], m_UseMutex); + m_Pools[heapTypeIndex].PushBack(pool->m_Pimpl); +} + +void AllocatorPimpl::UnregisterPool(Pool* pool, D3D12_HEAP_TYPE heapType) +{ + const UINT heapTypeIndex = HeapTypeToIndex(heapType); + + MutexLockWrite lock(m_PoolsMutex[heapTypeIndex], m_UseMutex); + m_Pools[heapTypeIndex].Remove(pool->m_Pimpl); +} + +HRESULT AllocatorPimpl::UpdateD3D12Budget() +{ +#if D3D12MA_DXGI_1_4 + if (m_Adapter3) + return m_Budget.UpdateBudget(m_Adapter3, m_UseMutex); + else + return E_NOINTERFACE; +#else + return S_OK; +#endif +} + +D3D12_RESOURCE_ALLOCATION_INFO AllocatorPimpl::GetResourceAllocationInfoNative(const D3D12_RESOURCE_DESC& resourceDesc) const +{ + return m_Device->GetResourceAllocationInfo(0, 1, &resourceDesc); +} + +#ifdef __ID3D12Device8_INTERFACE_DEFINED__ +D3D12_RESOURCE_ALLOCATION_INFO AllocatorPimpl::GetResourceAllocationInfoNative(const D3D12_RESOURCE_DESC1& resourceDesc) const +{ + D3D12MA_ASSERT(m_Device8 != NULL); + D3D12_RESOURCE_ALLOCATION_INFO1 info1Unused; + return m_Device8->GetResourceAllocationInfo2(0, 1, &resourceDesc, &info1Unused); +} +#endif // #ifdef __ID3D12Device8_INTERFACE_DEFINED__ + +template<typename D3D12_RESOURCE_DESC_T> +D3D12_RESOURCE_ALLOCATION_INFO AllocatorPimpl::GetResourceAllocationInfo(D3D12_RESOURCE_DESC_T& inOutResourceDesc) const +{ + /* Optional optimization: Microsoft documentation says: + https://docs.microsoft.com/en-us/windows/win32/api/d3d12/nf-d3d12-id3d12device-getresourceallocationinfo + + Your application can forgo using GetResourceAllocationInfo for buffer resources + (D3D12_RESOURCE_DIMENSION_BUFFER). Buffers have the same size on all adapters, + which is merely the smallest multiple of 64KB that's greater or equal to + D3D12_RESOURCE_DESC::Width. + */ + if (inOutResourceDesc.Alignment == 0 && + inOutResourceDesc.Dimension == D3D12_RESOURCE_DIMENSION_BUFFER) + { + return { + AlignUp<UINT64>(inOutResourceDesc.Width, D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT), // SizeInBytes + D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT }; // Alignment + } + +#if D3D12MA_USE_SMALL_RESOURCE_PLACEMENT_ALIGNMENT + if (inOutResourceDesc.Alignment == 0 && + inOutResourceDesc.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE2D && + (inOutResourceDesc.Flags & (D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET | D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL)) == 0 +#if D3D12MA_USE_SMALL_RESOURCE_PLACEMENT_ALIGNMENT == 1 + && CanUseSmallAlignment(inOutResourceDesc) +#endif + ) + { + /* + The algorithm here is based on Microsoft sample: "Small Resources Sample" + https://github.com/microsoft/DirectX-Graphics-Samples/tree/master/Samples/Desktop/D3D12SmallResources + */ + const UINT64 smallAlignmentToTry = inOutResourceDesc.SampleDesc.Count > 1 ? + D3D12_SMALL_MSAA_RESOURCE_PLACEMENT_ALIGNMENT : + D3D12_SMALL_RESOURCE_PLACEMENT_ALIGNMENT; + inOutResourceDesc.Alignment = smallAlignmentToTry; + const D3D12_RESOURCE_ALLOCATION_INFO smallAllocInfo = GetResourceAllocationInfoNative(inOutResourceDesc); + // Check if alignment requested has been granted. + if (smallAllocInfo.Alignment == smallAlignmentToTry) + { + return smallAllocInfo; + } + inOutResourceDesc.Alignment = 0; // Restore original + } +#endif // #if D3D12MA_USE_SMALL_RESOURCE_PLACEMENT_ALIGNMENT + + return GetResourceAllocationInfoNative(inOutResourceDesc); +} + +bool AllocatorPimpl::NewAllocationWithinBudget(D3D12_HEAP_TYPE heapType, UINT64 size) +{ + Budget budget = {}; + GetBudgetForHeapType(budget, heapType); + return budget.UsageBytes + size <= budget.BudgetBytes; +} + +void AllocatorPimpl::WriteBudgetToJson(JsonWriter& json, const Budget& budget) +{ + json.BeginObject(); + { + json.WriteString(L"BudgetBytes"); + json.WriteNumber(budget.BudgetBytes); + json.WriteString(L"UsageBytes"); + json.WriteNumber(budget.UsageBytes); + } + json.EndObject(); +} + +#endif // _D3D12MA_ALLOCATOR_PIMPL +#endif // _D3D12MA_ALLOCATOR_PIMPL + +#ifndef _D3D12MA_VIRTUAL_BLOCK_PIMPL +class VirtualBlockPimpl +{ +public: + const ALLOCATION_CALLBACKS m_AllocationCallbacks; + const UINT64 m_Size; + BlockMetadata* m_Metadata; + + VirtualBlockPimpl(const ALLOCATION_CALLBACKS& allocationCallbacks, const VIRTUAL_BLOCK_DESC& desc); + ~VirtualBlockPimpl(); +}; + +#ifndef _D3D12MA_VIRTUAL_BLOCK_PIMPL_FUNCTIONS +VirtualBlockPimpl::VirtualBlockPimpl(const ALLOCATION_CALLBACKS& allocationCallbacks, const VIRTUAL_BLOCK_DESC& desc) + : m_AllocationCallbacks(allocationCallbacks), m_Size(desc.Size) +{ + switch (desc.Flags & VIRTUAL_BLOCK_FLAG_ALGORITHM_MASK) + { + case VIRTUAL_BLOCK_FLAG_ALGORITHM_LINEAR: + m_Metadata = D3D12MA_NEW(allocationCallbacks, BlockMetadata_Linear)(&m_AllocationCallbacks, true); + break; + default: + D3D12MA_ASSERT(0); + case 0: + m_Metadata = D3D12MA_NEW(allocationCallbacks, BlockMetadata_TLSF)(&m_AllocationCallbacks, true); + break; + } + m_Metadata->Init(m_Size); +} + +VirtualBlockPimpl::~VirtualBlockPimpl() +{ + D3D12MA_DELETE(m_AllocationCallbacks, m_Metadata); +} +#endif // _D3D12MA_VIRTUAL_BLOCK_PIMPL_FUNCTIONS +#endif // _D3D12MA_VIRTUAL_BLOCK_PIMPL + + +#ifndef _D3D12MA_MEMORY_BLOCK_FUNCTIONS +MemoryBlock::MemoryBlock( + AllocatorPimpl* allocator, + const D3D12_HEAP_PROPERTIES& heapProps, + D3D12_HEAP_FLAGS heapFlags, + UINT64 size, + UINT id) + : m_Allocator(allocator), + m_HeapProps(heapProps), + m_HeapFlags(heapFlags), + m_Size(size), + m_Id(id) {} + +MemoryBlock::~MemoryBlock() +{ + if (m_Heap) + { + m_Heap->Release(); + m_Allocator->m_Budget.RemoveBlock( + m_Allocator->HeapPropertiesToMemorySegmentGroup(m_HeapProps), m_Size); + } +} + +HRESULT MemoryBlock::Init(ID3D12ProtectedResourceSession* pProtectedSession, bool denyMsaaTextures) +{ + D3D12MA_ASSERT(m_Heap == NULL && m_Size > 0); + + D3D12_HEAP_DESC heapDesc = {}; + heapDesc.SizeInBytes = m_Size; + heapDesc.Properties = m_HeapProps; + heapDesc.Alignment = HeapFlagsToAlignment(m_HeapFlags, denyMsaaTextures); + heapDesc.Flags = m_HeapFlags; + + HRESULT hr; +#ifdef __ID3D12Device4_INTERFACE_DEFINED__ + ID3D12Device4* const device4 = m_Allocator->GetDevice4(); + if (device4) + hr = m_Allocator->GetDevice4()->CreateHeap1(&heapDesc, pProtectedSession, D3D12MA_IID_PPV_ARGS(&m_Heap)); + else +#endif + { + if (pProtectedSession == NULL) + hr = m_Allocator->GetDevice()->CreateHeap(&heapDesc, D3D12MA_IID_PPV_ARGS(&m_Heap)); + else + hr = E_NOINTERFACE; + } + + if (SUCCEEDED(hr)) + { + m_Allocator->m_Budget.AddBlock( + m_Allocator->HeapPropertiesToMemorySegmentGroup(m_HeapProps), m_Size); + } + return hr; +} +#endif // _D3D12MA_MEMORY_BLOCK_FUNCTIONS + +#ifndef _D3D12MA_NORMAL_BLOCK_FUNCTIONS +NormalBlock::NormalBlock( + AllocatorPimpl* allocator, + BlockVector* blockVector, + const D3D12_HEAP_PROPERTIES& heapProps, + D3D12_HEAP_FLAGS heapFlags, + UINT64 size, + UINT id) + : MemoryBlock(allocator, heapProps, heapFlags, size, id), + m_pMetadata(NULL), + m_BlockVector(blockVector) {} + +NormalBlock::~NormalBlock() +{ + if (m_pMetadata != NULL) + { + // Define macro D3D12MA_DEBUG_LOG to receive the list of the unfreed allocations. + if (!m_pMetadata->IsEmpty()) + m_pMetadata->DebugLogAllAllocations(); + + // THIS IS THE MOST IMPORTANT ASSERT IN THE ENTIRE LIBRARY! + // Hitting it means you have some memory leak - unreleased Allocation objects. + D3D12MA_ASSERT(m_pMetadata->IsEmpty() && "Some allocations were not freed before destruction of this memory block!"); + + D3D12MA_DELETE(m_Allocator->GetAllocs(), m_pMetadata); + } +} + +HRESULT NormalBlock::Init(UINT32 algorithm, ID3D12ProtectedResourceSession* pProtectedSession, bool denyMsaaTextures) +{ + HRESULT hr = MemoryBlock::Init(pProtectedSession, denyMsaaTextures); + if (FAILED(hr)) + { + return hr; + } + + switch (algorithm) + { + case POOL_FLAG_ALGORITHM_LINEAR: + m_pMetadata = D3D12MA_NEW(m_Allocator->GetAllocs(), BlockMetadata_Linear)(&m_Allocator->GetAllocs(), false); + break; + default: + D3D12MA_ASSERT(0); + case 0: + m_pMetadata = D3D12MA_NEW(m_Allocator->GetAllocs(), BlockMetadata_TLSF)(&m_Allocator->GetAllocs(), false); + break; + } + m_pMetadata->Init(m_Size); + + return hr; +} + +bool NormalBlock::Validate() const +{ + D3D12MA_VALIDATE(GetHeap() && + m_pMetadata && + m_pMetadata->GetSize() != 0 && + m_pMetadata->GetSize() == GetSize()); + return m_pMetadata->Validate(); +} +#endif // _D3D12MA_NORMAL_BLOCK_FUNCTIONS + +#ifndef _D3D12MA_COMMITTED_ALLOCATION_LIST_FUNCTIONS +void CommittedAllocationList::Init(bool useMutex, D3D12_HEAP_TYPE heapType, PoolPimpl* pool) +{ + m_UseMutex = useMutex; + m_HeapType = heapType; + m_Pool = pool; +} + +CommittedAllocationList::~CommittedAllocationList() +{ + if (!m_AllocationList.IsEmpty()) + { + D3D12MA_ASSERT(0 && "Unfreed committed allocations found!"); + } +} + +UINT CommittedAllocationList::GetMemorySegmentGroup(AllocatorPimpl* allocator) const +{ + if (m_Pool) + return allocator->HeapPropertiesToMemorySegmentGroup(m_Pool->GetDesc().HeapProperties); + else + return allocator->StandardHeapTypeToMemorySegmentGroup(m_HeapType); +} + +void CommittedAllocationList::AddStatistics(Statistics& inoutStats) +{ + MutexLockRead lock(m_Mutex, m_UseMutex); + + for (Allocation* alloc = m_AllocationList.Front(); + alloc != NULL; alloc = m_AllocationList.GetNext(alloc)) + { + const UINT64 size = alloc->GetSize(); + inoutStats.BlockCount++; + inoutStats.AllocationCount++; + inoutStats.BlockBytes += size; + inoutStats.AllocationBytes += size; + } +} + +void CommittedAllocationList::AddDetailedStatistics(DetailedStatistics& inoutStats) +{ + MutexLockRead lock(m_Mutex, m_UseMutex); + + for (Allocation* alloc = m_AllocationList.Front(); + alloc != NULL; alloc = m_AllocationList.GetNext(alloc)) + { + const UINT64 size = alloc->GetSize(); + inoutStats.Stats.BlockCount++; + inoutStats.Stats.BlockBytes += size; + AddDetailedStatisticsAllocation(inoutStats, size); + } +} + +void CommittedAllocationList::BuildStatsString(JsonWriter& json) +{ + MutexLockRead lock(m_Mutex, m_UseMutex); + + for (Allocation* alloc = m_AllocationList.Front(); + alloc != NULL; alloc = m_AllocationList.GetNext(alloc)) + { + json.BeginObject(true); + json.AddAllocationToObject(*alloc); + json.EndObject(); + } +} + +void CommittedAllocationList::Register(Allocation* alloc) +{ + MutexLockWrite lock(m_Mutex, m_UseMutex); + m_AllocationList.PushBack(alloc); +} + +void CommittedAllocationList::Unregister(Allocation* alloc) +{ + MutexLockWrite lock(m_Mutex, m_UseMutex); + m_AllocationList.Remove(alloc); +} +#endif // _D3D12MA_COMMITTED_ALLOCATION_LIST_FUNCTIONS + +#ifndef _D3D12MA_BLOCK_VECTOR_FUNCTIONS +BlockVector::BlockVector( + AllocatorPimpl* hAllocator, + const D3D12_HEAP_PROPERTIES& heapProps, + D3D12_HEAP_FLAGS heapFlags, + UINT64 preferredBlockSize, + size_t minBlockCount, + size_t maxBlockCount, + bool explicitBlockSize, + UINT64 minAllocationAlignment, + UINT32 algorithm, + bool denyMsaaTextures, + ID3D12ProtectedResourceSession* pProtectedSession, + D3D12_RESIDENCY_PRIORITY residencyPriority) + : m_hAllocator(hAllocator), + m_HeapProps(heapProps), + m_HeapFlags(heapFlags), + m_PreferredBlockSize(preferredBlockSize), + m_MinBlockCount(minBlockCount), + m_MaxBlockCount(maxBlockCount), + m_ExplicitBlockSize(explicitBlockSize), + m_MinAllocationAlignment(minAllocationAlignment), + m_Algorithm(algorithm), + m_DenyMsaaTextures(denyMsaaTextures), + m_ProtectedSession(pProtectedSession), + m_ResidencyPriority(residencyPriority), + m_HasEmptyBlock(false), + m_Blocks(hAllocator->GetAllocs()), + m_NextBlockId(0) {} + +BlockVector::~BlockVector() +{ + for (size_t i = m_Blocks.size(); i--; ) + { + D3D12MA_DELETE(m_hAllocator->GetAllocs(), m_Blocks[i]); + } +} + +HRESULT BlockVector::CreateMinBlocks() +{ + for (size_t i = 0; i < m_MinBlockCount; ++i) + { + HRESULT hr = CreateBlock(m_PreferredBlockSize, NULL); + if (FAILED(hr)) + { + return hr; + } + } + return S_OK; +} + +bool BlockVector::IsEmpty() +{ + MutexLockRead lock(m_Mutex, m_hAllocator->UseMutex()); + return m_Blocks.empty(); +} + +HRESULT BlockVector::Allocate( + UINT64 size, + UINT64 alignment, + const ALLOCATION_DESC& allocDesc, + size_t allocationCount, + Allocation** pAllocations) +{ + size_t allocIndex; + HRESULT hr = S_OK; + + { + MutexLockWrite lock(m_Mutex, m_hAllocator->UseMutex()); + for (allocIndex = 0; allocIndex < allocationCount; ++allocIndex) + { + hr = AllocatePage( + size, + alignment, + allocDesc, + pAllocations + allocIndex); + if (FAILED(hr)) + { + break; + } + } + } + + if (FAILED(hr)) + { + // Free all already created allocations. + while (allocIndex--) + { + Free(pAllocations[allocIndex]); + } + ZeroMemory(pAllocations, sizeof(Allocation*) * allocationCount); + } + + return hr; +} + +void BlockVector::Free(Allocation* hAllocation) +{ + NormalBlock* pBlockToDelete = NULL; + + bool budgetExceeded = false; + if (IsHeapTypeStandard(m_HeapProps.Type)) + { + Budget budget = {}; + m_hAllocator->GetBudgetForHeapType(budget, m_HeapProps.Type); + budgetExceeded = budget.UsageBytes >= budget.BudgetBytes; + } + + // Scope for lock. + { + MutexLockWrite lock(m_Mutex, m_hAllocator->UseMutex()); + + NormalBlock* pBlock = hAllocation->m_Placed.block; + + pBlock->m_pMetadata->Free(hAllocation->GetAllocHandle()); + D3D12MA_HEAVY_ASSERT(pBlock->Validate()); + + const size_t blockCount = m_Blocks.size(); + // pBlock became empty after this deallocation. + if (pBlock->m_pMetadata->IsEmpty()) + { + // Already has empty Allocation. We don't want to have two, so delete this one. + if ((m_HasEmptyBlock || budgetExceeded) && + blockCount > m_MinBlockCount) + { + pBlockToDelete = pBlock; + Remove(pBlock); + } + // We now have first empty block. + else + { + m_HasEmptyBlock = true; + } + } + // pBlock didn't become empty, but we have another empty block - find and free that one. + // (This is optional, heuristics.) + else if (m_HasEmptyBlock && blockCount > m_MinBlockCount) + { + NormalBlock* pLastBlock = m_Blocks.back(); + if (pLastBlock->m_pMetadata->IsEmpty()) + { + pBlockToDelete = pLastBlock; + m_Blocks.pop_back(); + m_HasEmptyBlock = false; + } + } + + IncrementallySortBlocks(); + } + + // Destruction of a free Allocation. Deferred until this point, outside of mutex + // lock, for performance reason. + if (pBlockToDelete != NULL) + { + D3D12MA_DELETE(m_hAllocator->GetAllocs(), pBlockToDelete); + } +} + +HRESULT BlockVector::CreateResource( + UINT64 size, + UINT64 alignment, + const ALLOCATION_DESC& allocDesc, + const CREATE_RESOURCE_PARAMS& createParams, + Allocation** ppAllocation, + REFIID riidResource, + void** ppvResource) +{ + HRESULT hr = Allocate(size, alignment, allocDesc, 1, ppAllocation); + if (SUCCEEDED(hr)) + { + ID3D12Resource* res = NULL; + hr = m_hAllocator->CreatePlacedResourceWrap( + (*ppAllocation)->m_Placed.block->GetHeap(), + (*ppAllocation)->GetOffset(), + createParams, + D3D12MA_IID_PPV_ARGS(&res)); + if (SUCCEEDED(hr)) + { + if (ppvResource != NULL) + { + hr = res->QueryInterface(riidResource, ppvResource); + } + if (SUCCEEDED(hr)) + { + (*ppAllocation)->SetResourcePointer(res, createParams.GetBaseResourceDesc()); + } + else + { + res->Release(); + SAFE_RELEASE(*ppAllocation); + } + } + else + { + SAFE_RELEASE(*ppAllocation); + } + } + return hr; +} + +void BlockVector::AddStatistics(Statistics& inoutStats) +{ + MutexLockRead lock(m_Mutex, m_hAllocator->UseMutex()); + + for (size_t i = 0; i < m_Blocks.size(); ++i) + { + const NormalBlock* const pBlock = m_Blocks[i]; + D3D12MA_ASSERT(pBlock); + D3D12MA_HEAVY_ASSERT(pBlock->Validate()); + pBlock->m_pMetadata->AddStatistics(inoutStats); + } +} + +void BlockVector::AddDetailedStatistics(DetailedStatistics& inoutStats) +{ + MutexLockRead lock(m_Mutex, m_hAllocator->UseMutex()); + + for (size_t i = 0; i < m_Blocks.size(); ++i) + { + const NormalBlock* const pBlock = m_Blocks[i]; + D3D12MA_ASSERT(pBlock); + D3D12MA_HEAVY_ASSERT(pBlock->Validate()); + pBlock->m_pMetadata->AddDetailedStatistics(inoutStats); + } +} + +void BlockVector::WriteBlockInfoToJson(JsonWriter& json) +{ + MutexLockRead lock(m_Mutex, m_hAllocator->UseMutex()); + + json.BeginObject(); + + for (size_t i = 0, count = m_Blocks.size(); i < count; ++i) + { + const NormalBlock* const pBlock = m_Blocks[i]; + D3D12MA_ASSERT(pBlock); + D3D12MA_HEAVY_ASSERT(pBlock->Validate()); + json.BeginString(); + json.ContinueString(pBlock->GetId()); + json.EndString(); + + json.BeginObject(); + pBlock->m_pMetadata->WriteAllocationInfoToJson(json); + json.EndObject(); + } + + json.EndObject(); +} + +UINT64 BlockVector::CalcSumBlockSize() const +{ + UINT64 result = 0; + for (size_t i = m_Blocks.size(); i--; ) + { + result += m_Blocks[i]->m_pMetadata->GetSize(); + } + return result; +} + +UINT64 BlockVector::CalcMaxBlockSize() const +{ + UINT64 result = 0; + for (size_t i = m_Blocks.size(); i--; ) + { + result = D3D12MA_MAX(result, m_Blocks[i]->m_pMetadata->GetSize()); + if (result >= m_PreferredBlockSize) + { + break; + } + } + return result; +} + +void BlockVector::Remove(NormalBlock* pBlock) +{ + for (size_t blockIndex = 0; blockIndex < m_Blocks.size(); ++blockIndex) + { + if (m_Blocks[blockIndex] == pBlock) + { + m_Blocks.remove(blockIndex); + return; + } + } + D3D12MA_ASSERT(0); +} + +void BlockVector::IncrementallySortBlocks() +{ + if (!m_IncrementalSort) + return; + // Bubble sort only until first swap. + for (size_t i = 1; i < m_Blocks.size(); ++i) + { + if (m_Blocks[i - 1]->m_pMetadata->GetSumFreeSize() > m_Blocks[i]->m_pMetadata->GetSumFreeSize()) + { + D3D12MA_SWAP(m_Blocks[i - 1], m_Blocks[i]); + return; + } + } +} + +void BlockVector::SortByFreeSize() +{ + D3D12MA_SORT(m_Blocks.begin(), m_Blocks.end(), + [](auto* b1, auto* b2) + { + return b1->m_pMetadata->GetSumFreeSize() < b2->m_pMetadata->GetSumFreeSize(); + }); +} + +HRESULT BlockVector::AllocatePage( + UINT64 size, + UINT64 alignment, + const ALLOCATION_DESC& allocDesc, + Allocation** pAllocation) +{ + // Early reject: requested allocation size is larger that maximum block size for this block vector. + if (size + D3D12MA_DEBUG_MARGIN > m_PreferredBlockSize) + { + return E_OUTOFMEMORY; + } + + UINT64 freeMemory = UINT64_MAX; + if (IsHeapTypeStandard(m_HeapProps.Type)) + { + Budget budget = {}; + m_hAllocator->GetBudgetForHeapType(budget, m_HeapProps.Type); + freeMemory = (budget.UsageBytes < budget.BudgetBytes) ? (budget.BudgetBytes - budget.UsageBytes) : 0; + } + + const bool canCreateNewBlock = + ((allocDesc.Flags & ALLOCATION_FLAG_NEVER_ALLOCATE) == 0) && + (m_Blocks.size() < m_MaxBlockCount) && + // Even if we don't have to stay within budget with this allocation, when the + // budget would be exceeded, we don't want to allocate new blocks, but always + // create resources as committed. + freeMemory >= size; + + // 1. Search existing allocations + { + // Forward order in m_Blocks - prefer blocks with smallest amount of free space. + for (size_t blockIndex = 0; blockIndex < m_Blocks.size(); ++blockIndex) + { + NormalBlock* const pCurrBlock = m_Blocks[blockIndex]; + D3D12MA_ASSERT(pCurrBlock); + HRESULT hr = AllocateFromBlock( + pCurrBlock, + size, + alignment, + allocDesc.Flags, + allocDesc.pPrivateData, + allocDesc.Flags & ALLOCATION_FLAG_STRATEGY_MASK, + pAllocation); + if (SUCCEEDED(hr)) + { + return hr; + } + } + } + + // 2. Try to create new block. + if (canCreateNewBlock) + { + // Calculate optimal size for new block. + UINT64 newBlockSize = m_PreferredBlockSize; + UINT newBlockSizeShift = 0; + + if (!m_ExplicitBlockSize) + { + // Allocate 1/8, 1/4, 1/2 as first blocks. + const UINT64 maxExistingBlockSize = CalcMaxBlockSize(); + for (UINT i = 0; i < NEW_BLOCK_SIZE_SHIFT_MAX; ++i) + { + const UINT64 smallerNewBlockSize = newBlockSize / 2; + if (smallerNewBlockSize > maxExistingBlockSize && smallerNewBlockSize >= size * 2) + { + newBlockSize = smallerNewBlockSize; + ++newBlockSizeShift; + } + else + { + break; + } + } + } + + size_t newBlockIndex = 0; + HRESULT hr = newBlockSize <= freeMemory ? + CreateBlock(newBlockSize, &newBlockIndex) : E_OUTOFMEMORY; + // Allocation of this size failed? Try 1/2, 1/4, 1/8 of m_PreferredBlockSize. + if (!m_ExplicitBlockSize) + { + while (FAILED(hr) && newBlockSizeShift < NEW_BLOCK_SIZE_SHIFT_MAX) + { + const UINT64 smallerNewBlockSize = newBlockSize / 2; + if (smallerNewBlockSize >= size) + { + newBlockSize = smallerNewBlockSize; + ++newBlockSizeShift; + hr = newBlockSize <= freeMemory ? + CreateBlock(newBlockSize, &newBlockIndex) : E_OUTOFMEMORY; + } + else + { + break; + } + } + } + + if (SUCCEEDED(hr)) + { + NormalBlock* const pBlock = m_Blocks[newBlockIndex]; + D3D12MA_ASSERT(pBlock->m_pMetadata->GetSize() >= size); + + hr = AllocateFromBlock( + pBlock, + size, + alignment, + allocDesc.Flags, + allocDesc.pPrivateData, + allocDesc.Flags & ALLOCATION_FLAG_STRATEGY_MASK, + pAllocation); + if (SUCCEEDED(hr)) + { + return hr; + } + else + { + // Allocation from new block failed, possibly due to D3D12MA_DEBUG_MARGIN or alignment. + return E_OUTOFMEMORY; + } + } + } + + return E_OUTOFMEMORY; +} + +HRESULT BlockVector::AllocateFromBlock( + NormalBlock* pBlock, + UINT64 size, + UINT64 alignment, + ALLOCATION_FLAGS allocFlags, + void* pPrivateData, + UINT32 strategy, + Allocation** pAllocation) +{ + alignment = D3D12MA_MAX(alignment, m_MinAllocationAlignment); + + AllocationRequest currRequest = {}; + if (pBlock->m_pMetadata->CreateAllocationRequest( + size, + alignment, + allocFlags & ALLOCATION_FLAG_UPPER_ADDRESS, + strategy, + &currRequest)) + { + return CommitAllocationRequest(currRequest, pBlock, size, alignment, pPrivateData, pAllocation); + } + return E_OUTOFMEMORY; +} + +HRESULT BlockVector::CommitAllocationRequest( + AllocationRequest& allocRequest, + NormalBlock* pBlock, + UINT64 size, + UINT64 alignment, + void* pPrivateData, + Allocation** pAllocation) +{ + // We no longer have an empty Allocation. + if (pBlock->m_pMetadata->IsEmpty()) + m_HasEmptyBlock = false; + + *pAllocation = m_hAllocator->GetAllocationObjectAllocator().Allocate(m_hAllocator, size, alignment, allocRequest.zeroInitialized); + pBlock->m_pMetadata->Alloc(allocRequest, size, *pAllocation); + + (*pAllocation)->InitPlaced(allocRequest.allocHandle, pBlock); + (*pAllocation)->SetPrivateData(pPrivateData); + + D3D12MA_HEAVY_ASSERT(pBlock->Validate()); + m_hAllocator->m_Budget.AddAllocation(m_hAllocator->HeapPropertiesToMemorySegmentGroup(m_HeapProps), size); + + return S_OK; +} + +HRESULT BlockVector::CreateBlock( + UINT64 blockSize, + size_t* pNewBlockIndex) +{ + NormalBlock* const pBlock = D3D12MA_NEW(m_hAllocator->GetAllocs(), NormalBlock)( + m_hAllocator, + this, + m_HeapProps, + m_HeapFlags, + blockSize, + m_NextBlockId++); + HRESULT hr = pBlock->Init(m_Algorithm, m_ProtectedSession, m_DenyMsaaTextures); + if (FAILED(hr)) + { + D3D12MA_DELETE(m_hAllocator->GetAllocs(), pBlock); + return hr; + } + + m_hAllocator->SetResidencyPriority(pBlock->GetHeap(), m_ResidencyPriority); + + m_Blocks.push_back(pBlock); + if (pNewBlockIndex != NULL) + { + *pNewBlockIndex = m_Blocks.size() - 1; + } + + return hr; +} +#endif // _D3D12MA_BLOCK_VECTOR_FUNCTIONS + +#ifndef _D3D12MA_DEFRAGMENTATION_CONTEXT_PIMPL_FUNCTIONS +DefragmentationContextPimpl::DefragmentationContextPimpl( + AllocatorPimpl* hAllocator, + const DEFRAGMENTATION_DESC& desc, + BlockVector* poolVector) + : m_MaxPassBytes(desc.MaxBytesPerPass == 0 ? UINT64_MAX : desc.MaxBytesPerPass), + m_MaxPassAllocations(desc.MaxAllocationsPerPass == 0 ? UINT32_MAX : desc.MaxAllocationsPerPass), + m_Moves(hAllocator->GetAllocs()) +{ + m_Algorithm = desc.Flags & DEFRAGMENTATION_FLAG_ALGORITHM_MASK; + + if (poolVector != NULL) + { + m_BlockVectorCount = 1; + m_PoolBlockVector = poolVector; + m_pBlockVectors = &m_PoolBlockVector; + m_PoolBlockVector->SetIncrementalSort(false); + m_PoolBlockVector->SortByFreeSize(); + } + else + { + m_BlockVectorCount = hAllocator->GetDefaultPoolCount(); + m_PoolBlockVector = NULL; + m_pBlockVectors = hAllocator->GetDefaultPools(); + for (UINT32 i = 0; i < m_BlockVectorCount; ++i) + { + BlockVector* vector = m_pBlockVectors[i]; + if (vector != NULL) + { + vector->SetIncrementalSort(false); + vector->SortByFreeSize(); + } + } + } + + switch (m_Algorithm) + { + case 0: // Default algorithm + m_Algorithm = DEFRAGMENTATION_FLAG_ALGORITHM_BALANCED; + case DEFRAGMENTATION_FLAG_ALGORITHM_BALANCED: + { + m_AlgorithmState = D3D12MA_NEW_ARRAY(hAllocator->GetAllocs(), StateBalanced, m_BlockVectorCount); + break; + } + } +} + +DefragmentationContextPimpl::~DefragmentationContextPimpl() +{ + if (m_PoolBlockVector != NULL) + m_PoolBlockVector->SetIncrementalSort(true); + else + { + for (UINT32 i = 0; i < m_BlockVectorCount; ++i) + { + BlockVector* vector = m_pBlockVectors[i]; + if (vector != NULL) + vector->SetIncrementalSort(true); + } + } + + if (m_AlgorithmState) + { + switch (m_Algorithm) + { + case DEFRAGMENTATION_FLAG_ALGORITHM_BALANCED: + D3D12MA_DELETE_ARRAY(m_Moves.GetAllocs(), reinterpret_cast<StateBalanced*>(m_AlgorithmState), m_BlockVectorCount); + break; + default: + D3D12MA_ASSERT(0); + } + } +} + +HRESULT DefragmentationContextPimpl::DefragmentPassBegin(DEFRAGMENTATION_PASS_MOVE_INFO& moveInfo) +{ + if (m_PoolBlockVector != NULL) + { + MutexLockWrite lock(m_PoolBlockVector->GetMutex(), m_PoolBlockVector->m_hAllocator->UseMutex()); + + if (m_PoolBlockVector->GetBlockCount() > 1) + ComputeDefragmentation(*m_PoolBlockVector, 0); + else if (m_PoolBlockVector->GetBlockCount() == 1) + ReallocWithinBlock(*m_PoolBlockVector, m_PoolBlockVector->GetBlock(0)); + + // Setup index into block vector + for (size_t i = 0; i < m_Moves.size(); ++i) + m_Moves[i].pDstTmpAllocation->SetPrivateData(0); + } + else + { + for (UINT32 i = 0; i < m_BlockVectorCount; ++i) + { + if (m_pBlockVectors[i] != NULL) + { + MutexLockWrite lock(m_pBlockVectors[i]->GetMutex(), m_pBlockVectors[i]->m_hAllocator->UseMutex()); + + bool end = false; + size_t movesOffset = m_Moves.size(); + if (m_pBlockVectors[i]->GetBlockCount() > 1) + { + end = ComputeDefragmentation(*m_pBlockVectors[i], i); + } + else if (m_pBlockVectors[i]->GetBlockCount() == 1) + { + end = ReallocWithinBlock(*m_pBlockVectors[i], m_pBlockVectors[i]->GetBlock(0)); + } + + // Setup index into block vector + for (; movesOffset < m_Moves.size(); ++movesOffset) + m_Moves[movesOffset].pDstTmpAllocation->SetPrivateData(reinterpret_cast<void*>(static_cast<uintptr_t>(i))); + + if (end) + break; + } + } + } + + moveInfo.MoveCount = static_cast<UINT32>(m_Moves.size()); + if (moveInfo.MoveCount > 0) + { + moveInfo.pMoves = m_Moves.data(); + return S_FALSE; + } + + moveInfo.pMoves = NULL; + return S_OK; +} + +HRESULT DefragmentationContextPimpl::DefragmentPassEnd(DEFRAGMENTATION_PASS_MOVE_INFO& moveInfo) +{ + D3D12MA_ASSERT(moveInfo.MoveCount > 0 ? moveInfo.pMoves != NULL : true); + + HRESULT result = S_OK; + Vector<FragmentedBlock> immovableBlocks(m_Moves.GetAllocs()); + + for (uint32_t i = 0; i < moveInfo.MoveCount; ++i) + { + DEFRAGMENTATION_MOVE& move = moveInfo.pMoves[i]; + size_t prevCount = 0, currentCount = 0; + UINT64 freedBlockSize = 0; + + UINT32 vectorIndex; + BlockVector* vector; + if (m_PoolBlockVector != NULL) + { + vectorIndex = 0; + vector = m_PoolBlockVector; + } + else + { + vectorIndex = static_cast<UINT32>(reinterpret_cast<uintptr_t>(move.pDstTmpAllocation->GetPrivateData())); + vector = m_pBlockVectors[vectorIndex]; + D3D12MA_ASSERT(vector != NULL); + } + + switch (move.Operation) + { + case DEFRAGMENTATION_MOVE_OPERATION_COPY: + { + move.pSrcAllocation->SwapBlockAllocation(move.pDstTmpAllocation); + + // Scope for locks, Free have it's own lock + { + MutexLockRead lock(vector->GetMutex(), vector->m_hAllocator->UseMutex()); + prevCount = vector->GetBlockCount(); + freedBlockSize = move.pDstTmpAllocation->GetBlock()->m_pMetadata->GetSize(); + } + move.pDstTmpAllocation->Release(); + { + MutexLockRead lock(vector->GetMutex(), vector->m_hAllocator->UseMutex()); + currentCount = vector->GetBlockCount(); + } + + result = S_FALSE; + break; + } + case DEFRAGMENTATION_MOVE_OPERATION_IGNORE: + { + m_PassStats.BytesMoved -= move.pSrcAllocation->GetSize(); + --m_PassStats.AllocationsMoved; + move.pDstTmpAllocation->Release(); + + NormalBlock* newBlock = move.pSrcAllocation->GetBlock(); + bool notPresent = true; + for (const FragmentedBlock& block : immovableBlocks) + { + if (block.block == newBlock) + { + notPresent = false; + break; + } + } + if (notPresent) + immovableBlocks.push_back({ vectorIndex, newBlock }); + break; + } + case DEFRAGMENTATION_MOVE_OPERATION_DESTROY: + { + m_PassStats.BytesMoved -= move.pSrcAllocation->GetSize(); + --m_PassStats.AllocationsMoved; + // Scope for locks, Free have it's own lock + { + MutexLockRead lock(vector->GetMutex(), vector->m_hAllocator->UseMutex()); + prevCount = vector->GetBlockCount(); + freedBlockSize = move.pSrcAllocation->GetBlock()->m_pMetadata->GetSize(); + } + move.pSrcAllocation->Release(); + { + MutexLockRead lock(vector->GetMutex(), vector->m_hAllocator->UseMutex()); + currentCount = vector->GetBlockCount(); + } + freedBlockSize *= prevCount - currentCount; + + UINT64 dstBlockSize; + { + MutexLockRead lock(vector->GetMutex(), vector->m_hAllocator->UseMutex()); + dstBlockSize = move.pDstTmpAllocation->GetBlock()->m_pMetadata->GetSize(); + } + move.pDstTmpAllocation->Release(); + { + MutexLockRead lock(vector->GetMutex(), vector->m_hAllocator->UseMutex()); + freedBlockSize += dstBlockSize * (currentCount - vector->GetBlockCount()); + currentCount = vector->GetBlockCount(); + } + + result = S_FALSE; + break; + } + default: + D3D12MA_ASSERT(0); + } + + if (prevCount > currentCount) + { + size_t freedBlocks = prevCount - currentCount; + m_PassStats.HeapsFreed += static_cast<UINT32>(freedBlocks); + m_PassStats.BytesFreed += freedBlockSize; + } + } + moveInfo.MoveCount = 0; + moveInfo.pMoves = NULL; + m_Moves.clear(); + + // Update stats + m_GlobalStats.AllocationsMoved += m_PassStats.AllocationsMoved; + m_GlobalStats.BytesFreed += m_PassStats.BytesFreed; + m_GlobalStats.BytesMoved += m_PassStats.BytesMoved; + m_GlobalStats.HeapsFreed += m_PassStats.HeapsFreed; + m_PassStats = { 0 }; + + // Move blocks with immovable allocations according to algorithm + if (immovableBlocks.size() > 0) + { + // Move to the begining + for (const FragmentedBlock& block : immovableBlocks) + { + BlockVector* vector = m_pBlockVectors[block.data]; + MutexLockWrite lock(vector->GetMutex(), vector->m_hAllocator->UseMutex()); + + for (size_t i = m_ImmovableBlockCount; i < vector->GetBlockCount(); ++i) + { + if (vector->GetBlock(i) == block.block) + { + D3D12MA_SWAP(vector->m_Blocks[i], vector->m_Blocks[m_ImmovableBlockCount++]); + break; + } + } + } + } + return result; +} + +bool DefragmentationContextPimpl::ComputeDefragmentation(BlockVector& vector, size_t index) +{ + switch (m_Algorithm) + { + case DEFRAGMENTATION_FLAG_ALGORITHM_FAST: + return ComputeDefragmentation_Fast(vector); + default: + D3D12MA_ASSERT(0); + case DEFRAGMENTATION_FLAG_ALGORITHM_BALANCED: + return ComputeDefragmentation_Balanced(vector, index, true); + case DEFRAGMENTATION_FLAG_ALGORITHM_FULL: + return ComputeDefragmentation_Full(vector); + } +} + +DefragmentationContextPimpl::MoveAllocationData DefragmentationContextPimpl::GetMoveData( + AllocHandle handle, BlockMetadata* metadata) +{ + MoveAllocationData moveData; + moveData.move.pSrcAllocation = (Allocation*)metadata->GetAllocationPrivateData(handle); + moveData.size = moveData.move.pSrcAllocation->GetSize(); + moveData.alignment = moveData.move.pSrcAllocation->GetAlignment(); + moveData.flags = ALLOCATION_FLAG_NONE; + + return moveData; +} + +DefragmentationContextPimpl::CounterStatus DefragmentationContextPimpl::CheckCounters(UINT64 bytes) +{ + // Ignore allocation if will exceed max size for copy + if (m_PassStats.BytesMoved + bytes > m_MaxPassBytes) + { + if (++m_IgnoredAllocs < MAX_ALLOCS_TO_IGNORE) + return CounterStatus::Ignore; + else + return CounterStatus::End; + } + return CounterStatus::Pass; +} + +bool DefragmentationContextPimpl::IncrementCounters(UINT64 bytes) +{ + m_PassStats.BytesMoved += bytes; + // Early return when max found + if (++m_PassStats.AllocationsMoved >= m_MaxPassAllocations || m_PassStats.BytesMoved >= m_MaxPassBytes) + { + D3D12MA_ASSERT((m_PassStats.AllocationsMoved == m_MaxPassAllocations || + m_PassStats.BytesMoved == m_MaxPassBytes) && "Exceeded maximal pass threshold!"); + return true; + } + return false; +} + +bool DefragmentationContextPimpl::ReallocWithinBlock(BlockVector& vector, NormalBlock* block) +{ + BlockMetadata* metadata = block->m_pMetadata; + + for (AllocHandle handle = metadata->GetAllocationListBegin(); + handle != (AllocHandle)0; + handle = metadata->GetNextAllocation(handle)) + { + MoveAllocationData moveData = GetMoveData(handle, metadata); + // Ignore newly created allocations by defragmentation algorithm + if (moveData.move.pSrcAllocation->GetPrivateData() == this) + continue; + switch (CheckCounters(moveData.move.pSrcAllocation->GetSize())) + { + case CounterStatus::Ignore: + continue; + case CounterStatus::End: + return true; + default: + D3D12MA_ASSERT(0); + case CounterStatus::Pass: + break; + } + + UINT64 offset = moveData.move.pSrcAllocation->GetOffset(); + if (offset != 0 && metadata->GetSumFreeSize() >= moveData.size) + { + AllocationRequest request = {}; + if (metadata->CreateAllocationRequest( + moveData.size, + moveData.alignment, + false, + ALLOCATION_FLAG_STRATEGY_MIN_OFFSET, + &request)) + { + if (metadata->GetAllocationOffset(request.allocHandle) < offset) + { + if (SUCCEEDED(vector.CommitAllocationRequest( + request, + block, + moveData.size, + moveData.alignment, + this, + &moveData.move.pDstTmpAllocation))) + { + m_Moves.push_back(moveData.move); + if (IncrementCounters(moveData.size)) + return true; + } + } + } + } + } + return false; +} + +bool DefragmentationContextPimpl::AllocInOtherBlock(size_t start, size_t end, MoveAllocationData& data, BlockVector& vector) +{ + for (; start < end; ++start) + { + NormalBlock* dstBlock = vector.GetBlock(start); + if (dstBlock->m_pMetadata->GetSumFreeSize() >= data.size) + { + if (SUCCEEDED(vector.AllocateFromBlock(dstBlock, + data.size, + data.alignment, + data.flags, + this, + 0, + &data.move.pDstTmpAllocation))) + { + m_Moves.push_back(data.move); + if (IncrementCounters(data.size)) + return true; + break; + } + } + } + return false; +} + +bool DefragmentationContextPimpl::ComputeDefragmentation_Fast(BlockVector& vector) +{ + // Move only between blocks + + // Go through allocations in last blocks and try to fit them inside first ones + for (size_t i = vector.GetBlockCount() - 1; i > m_ImmovableBlockCount; --i) + { + BlockMetadata* metadata = vector.GetBlock(i)->m_pMetadata; + + for (AllocHandle handle = metadata->GetAllocationListBegin(); + handle != (AllocHandle)0; + handle = metadata->GetNextAllocation(handle)) + { + MoveAllocationData moveData = GetMoveData(handle, metadata); + // Ignore newly created allocations by defragmentation algorithm + if (moveData.move.pSrcAllocation->GetPrivateData() == this) + continue; + switch (CheckCounters(moveData.move.pSrcAllocation->GetSize())) + { + case CounterStatus::Ignore: + continue; + case CounterStatus::End: + return true; + default: + D3D12MA_ASSERT(0); + case CounterStatus::Pass: + break; + } + + // Check all previous blocks for free space + if (AllocInOtherBlock(0, i, moveData, vector)) + return true; + } + } + return false; +} + +bool DefragmentationContextPimpl::ComputeDefragmentation_Balanced(BlockVector& vector, size_t index, bool update) +{ + // Go over every allocation and try to fit it in previous blocks at lowest offsets, + // if not possible: realloc within single block to minimize offset (exclude offset == 0), + // but only if there are noticable gaps between them (some heuristic, ex. average size of allocation in block) + D3D12MA_ASSERT(m_AlgorithmState != NULL); + + StateBalanced& vectorState = reinterpret_cast<StateBalanced*>(m_AlgorithmState)[index]; + if (update && vectorState.avgAllocSize == UINT64_MAX) + UpdateVectorStatistics(vector, vectorState); + + const size_t startMoveCount = m_Moves.size(); + UINT64 minimalFreeRegion = vectorState.avgFreeSize / 2; + for (size_t i = vector.GetBlockCount() - 1; i > m_ImmovableBlockCount; --i) + { + NormalBlock* block = vector.GetBlock(i); + BlockMetadata* metadata = block->m_pMetadata; + UINT64 prevFreeRegionSize = 0; + + for (AllocHandle handle = metadata->GetAllocationListBegin(); + handle != (AllocHandle)0; + handle = metadata->GetNextAllocation(handle)) + { + MoveAllocationData moveData = GetMoveData(handle, metadata); + // Ignore newly created allocations by defragmentation algorithm + if (moveData.move.pSrcAllocation->GetPrivateData() == this) + continue; + switch (CheckCounters(moveData.move.pSrcAllocation->GetSize())) + { + case CounterStatus::Ignore: + continue; + case CounterStatus::End: + return true; + default: + D3D12MA_ASSERT(0); + case CounterStatus::Pass: + break; + } + + // Check all previous blocks for free space + const size_t prevMoveCount = m_Moves.size(); + if (AllocInOtherBlock(0, i, moveData, vector)) + return true; + + UINT64 nextFreeRegionSize = metadata->GetNextFreeRegionSize(handle); + // If no room found then realloc within block for lower offset + UINT64 offset = moveData.move.pSrcAllocation->GetOffset(); + if (prevMoveCount == m_Moves.size() && offset != 0 && metadata->GetSumFreeSize() >= moveData.size) + { + // Check if realloc will make sense + if (prevFreeRegionSize >= minimalFreeRegion || + nextFreeRegionSize >= minimalFreeRegion || + moveData.size <= vectorState.avgFreeSize || + moveData.size <= vectorState.avgAllocSize) + { + AllocationRequest request = {}; + if (metadata->CreateAllocationRequest( + moveData.size, + moveData.alignment, + false, + ALLOCATION_FLAG_STRATEGY_MIN_OFFSET, + &request)) + { + if (metadata->GetAllocationOffset(request.allocHandle) < offset) + { + if (SUCCEEDED(vector.CommitAllocationRequest( + request, + block, + moveData.size, + moveData.alignment, + this, + &moveData.move.pDstTmpAllocation))) + { + m_Moves.push_back(moveData.move); + if (IncrementCounters(moveData.size)) + return true; + } + } + } + } + } + prevFreeRegionSize = nextFreeRegionSize; + } + } + + // No moves perfomed, update statistics to current vector state + if (startMoveCount == m_Moves.size() && !update) + { + vectorState.avgAllocSize = UINT64_MAX; + return ComputeDefragmentation_Balanced(vector, index, false); + } + return false; +} + +bool DefragmentationContextPimpl::ComputeDefragmentation_Full(BlockVector& vector) +{ + // Go over every allocation and try to fit it in previous blocks at lowest offsets, + // if not possible: realloc within single block to minimize offset (exclude offset == 0) + + for (size_t i = vector.GetBlockCount() - 1; i > m_ImmovableBlockCount; --i) + { + NormalBlock* block = vector.GetBlock(i); + BlockMetadata* metadata = block->m_pMetadata; + + for (AllocHandle handle = metadata->GetAllocationListBegin(); + handle != (AllocHandle)0; + handle = metadata->GetNextAllocation(handle)) + { + MoveAllocationData moveData = GetMoveData(handle, metadata); + // Ignore newly created allocations by defragmentation algorithm + if (moveData.move.pSrcAllocation->GetPrivateData() == this) + continue; + switch (CheckCounters(moveData.move.pSrcAllocation->GetSize())) + { + case CounterStatus::Ignore: + continue; + case CounterStatus::End: + return true; + default: + D3D12MA_ASSERT(0); + case CounterStatus::Pass: + break; + } + + // Check all previous blocks for free space + const size_t prevMoveCount = m_Moves.size(); + if (AllocInOtherBlock(0, i, moveData, vector)) + return true; + + // If no room found then realloc within block for lower offset + UINT64 offset = moveData.move.pSrcAllocation->GetOffset(); + if (prevMoveCount == m_Moves.size() && offset != 0 && metadata->GetSumFreeSize() >= moveData.size) + { + AllocationRequest request = {}; + if (metadata->CreateAllocationRequest( + moveData.size, + moveData.alignment, + false, + ALLOCATION_FLAG_STRATEGY_MIN_OFFSET, + &request)) + { + if (metadata->GetAllocationOffset(request.allocHandle) < offset) + { + if (SUCCEEDED(vector.CommitAllocationRequest( + request, + block, + moveData.size, + moveData.alignment, + this, + &moveData.move.pDstTmpAllocation))) + { + m_Moves.push_back(moveData.move); + if (IncrementCounters(moveData.size)) + return true; + } + } + } + } + } + } + return false; +} + +void DefragmentationContextPimpl::UpdateVectorStatistics(BlockVector& vector, StateBalanced& state) +{ + size_t allocCount = 0; + size_t freeCount = 0; + state.avgFreeSize = 0; + state.avgAllocSize = 0; + + for (size_t i = 0; i < vector.GetBlockCount(); ++i) + { + BlockMetadata* metadata = vector.GetBlock(i)->m_pMetadata; + + allocCount += metadata->GetAllocationCount(); + freeCount += metadata->GetFreeRegionsCount(); + state.avgFreeSize += metadata->GetSumFreeSize(); + state.avgAllocSize += metadata->GetSize(); + } + + state.avgAllocSize = (state.avgAllocSize - state.avgFreeSize) / allocCount; + state.avgFreeSize /= freeCount; +} +#endif // _D3D12MA_DEFRAGMENTATION_CONTEXT_PIMPL_FUNCTIONS + +#ifndef _D3D12MA_POOL_PIMPL_FUNCTIONS +PoolPimpl::PoolPimpl(AllocatorPimpl* allocator, const POOL_DESC& desc) + : m_Allocator(allocator), + m_Desc(desc), + m_BlockVector(NULL), + m_Name(NULL) +{ + const bool explicitBlockSize = desc.BlockSize != 0; + const UINT64 preferredBlockSize = explicitBlockSize ? desc.BlockSize : D3D12MA_DEFAULT_BLOCK_SIZE; + UINT maxBlockCount = desc.MaxBlockCount != 0 ? desc.MaxBlockCount : UINT_MAX; + +#ifndef __ID3D12Device4_INTERFACE_DEFINED__ + D3D12MA_ASSERT(m_Desc.pProtectedSession == NULL); +#endif + + m_BlockVector = D3D12MA_NEW(allocator->GetAllocs(), BlockVector)( + allocator, desc.HeapProperties, desc.HeapFlags, + preferredBlockSize, + desc.MinBlockCount, maxBlockCount, + explicitBlockSize, + D3D12MA_MAX(desc.MinAllocationAlignment, (UINT64)D3D12MA_DEBUG_ALIGNMENT), + (desc.Flags & POOL_FLAG_ALGORITHM_MASK) != 0, + (desc.Flags & POOL_FLAG_MSAA_TEXTURES_ALWAYS_COMMITTED) != 0, + desc.pProtectedSession, + desc.ResidencyPriority); +} + +PoolPimpl::~PoolPimpl() +{ + D3D12MA_ASSERT(m_PrevPool == NULL && m_NextPool == NULL); + FreeName(); + D3D12MA_DELETE(m_Allocator->GetAllocs(), m_BlockVector); +} + +HRESULT PoolPimpl::Init() +{ + m_CommittedAllocations.Init(m_Allocator->UseMutex(), m_Desc.HeapProperties.Type, this); + return m_BlockVector->CreateMinBlocks(); +} + +void PoolPimpl::GetStatistics(Statistics& outStats) +{ + ClearStatistics(outStats); + m_BlockVector->AddStatistics(outStats); + m_CommittedAllocations.AddStatistics(outStats); +} + +void PoolPimpl::CalculateStatistics(DetailedStatistics& outStats) +{ + ClearDetailedStatistics(outStats); + AddDetailedStatistics(outStats); +} + +void PoolPimpl::AddDetailedStatistics(DetailedStatistics& inoutStats) +{ + m_BlockVector->AddDetailedStatistics(inoutStats); + m_CommittedAllocations.AddDetailedStatistics(inoutStats); +} + +void PoolPimpl::SetName(LPCWSTR Name) +{ + FreeName(); + + if (Name) + { + const size_t nameCharCount = wcslen(Name) + 1; + m_Name = D3D12MA_NEW_ARRAY(m_Allocator->GetAllocs(), WCHAR, nameCharCount); + memcpy(m_Name, Name, nameCharCount * sizeof(WCHAR)); + } +} + +void PoolPimpl::FreeName() +{ + if (m_Name) + { + const size_t nameCharCount = wcslen(m_Name) + 1; + D3D12MA_DELETE_ARRAY(m_Allocator->GetAllocs(), m_Name, nameCharCount); + m_Name = NULL; + } +} +#endif // _D3D12MA_POOL_PIMPL_FUNCTIONS + + +#ifndef _D3D12MA_PUBLIC_INTERFACE +HRESULT CreateAllocator(const ALLOCATOR_DESC* pDesc, Allocator** ppAllocator) +{ + if (!pDesc || !ppAllocator || !pDesc->pDevice || !pDesc->pAdapter || + !(pDesc->PreferredBlockSize == 0 || (pDesc->PreferredBlockSize >= 16 && pDesc->PreferredBlockSize < 0x10000000000ull))) + { + D3D12MA_ASSERT(0 && "Invalid arguments passed to CreateAllocator."); + return E_INVALIDARG; + } + + D3D12MA_DEBUG_GLOBAL_MUTEX_LOCK + + ALLOCATION_CALLBACKS allocationCallbacks; + SetupAllocationCallbacks(allocationCallbacks, pDesc->pAllocationCallbacks); + + *ppAllocator = D3D12MA_NEW(allocationCallbacks, Allocator)(allocationCallbacks, *pDesc); + HRESULT hr = (*ppAllocator)->m_Pimpl->Init(*pDesc); + if (FAILED(hr)) + { + D3D12MA_DELETE(allocationCallbacks, *ppAllocator); + *ppAllocator = NULL; + } + return hr; +} + +HRESULT CreateVirtualBlock(const VIRTUAL_BLOCK_DESC* pDesc, VirtualBlock** ppVirtualBlock) +{ + if (!pDesc || !ppVirtualBlock) + { + D3D12MA_ASSERT(0 && "Invalid arguments passed to CreateVirtualBlock."); + return E_INVALIDARG; + } + + D3D12MA_DEBUG_GLOBAL_MUTEX_LOCK + + ALLOCATION_CALLBACKS allocationCallbacks; + SetupAllocationCallbacks(allocationCallbacks, pDesc->pAllocationCallbacks); + + *ppVirtualBlock = D3D12MA_NEW(allocationCallbacks, VirtualBlock)(allocationCallbacks, *pDesc); + return S_OK; +} + +#ifndef _D3D12MA_IUNKNOWN_IMPL_FUNCTIONS +HRESULT STDMETHODCALLTYPE IUnknownImpl::QueryInterface(REFIID riid, void** ppvObject) +{ + if (ppvObject == NULL) + return E_POINTER; + if (riid == IID_IUnknown) + { + ++m_RefCount; + *ppvObject = this; + return S_OK; + } + *ppvObject = NULL; + return E_NOINTERFACE; +} + +ULONG STDMETHODCALLTYPE IUnknownImpl::AddRef() +{ + return ++m_RefCount; +} + +ULONG STDMETHODCALLTYPE IUnknownImpl::Release() +{ + D3D12MA_DEBUG_GLOBAL_MUTEX_LOCK + + const uint32_t newRefCount = --m_RefCount; + if (newRefCount == 0) + ReleaseThis(); + return newRefCount; +} +#endif // _D3D12MA_IUNKNOWN_IMPL_FUNCTIONS + +#ifndef _D3D12MA_ALLOCATION_FUNCTIONS +void Allocation::PackedData::SetType(Type type) +{ + const UINT u = (UINT)type; + D3D12MA_ASSERT(u < (1u << 2)); + m_Type = u; +} + +void Allocation::PackedData::SetResourceDimension(D3D12_RESOURCE_DIMENSION resourceDimension) +{ + const UINT u = (UINT)resourceDimension; + D3D12MA_ASSERT(u < (1u << 3)); + m_ResourceDimension = u; +} + +void Allocation::PackedData::SetResourceFlags(D3D12_RESOURCE_FLAGS resourceFlags) +{ + const UINT u = (UINT)resourceFlags; + D3D12MA_ASSERT(u < (1u << 24)); + m_ResourceFlags = u; +} + +void Allocation::PackedData::SetTextureLayout(D3D12_TEXTURE_LAYOUT textureLayout) +{ + const UINT u = (UINT)textureLayout; + D3D12MA_ASSERT(u < (1u << 9)); + m_TextureLayout = u; +} + +UINT64 Allocation::GetOffset() const +{ + switch (m_PackedData.GetType()) + { + case TYPE_COMMITTED: + case TYPE_HEAP: + return 0; + case TYPE_PLACED: + return m_Placed.block->m_pMetadata->GetAllocationOffset(m_Placed.allocHandle); + default: + D3D12MA_ASSERT(0); + return 0; + } +} + +void Allocation::SetResource(ID3D12Resource* pResource) +{ + if (pResource != m_Resource) + { + if (m_Resource) + m_Resource->Release(); + m_Resource = pResource; + if (m_Resource) + m_Resource->AddRef(); + } +} + +ID3D12Heap* Allocation::GetHeap() const +{ + switch (m_PackedData.GetType()) + { + case TYPE_COMMITTED: + return NULL; + case TYPE_PLACED: + return m_Placed.block->GetHeap(); + case TYPE_HEAP: + return m_Heap.heap; + default: + D3D12MA_ASSERT(0); + return 0; + } +} + +void Allocation::SetName(LPCWSTR Name) +{ + FreeName(); + + if (Name) + { + const size_t nameCharCount = wcslen(Name) + 1; + m_Name = D3D12MA_NEW_ARRAY(m_Allocator->GetAllocs(), WCHAR, nameCharCount); + memcpy(m_Name, Name, nameCharCount * sizeof(WCHAR)); + } +} + +void Allocation::ReleaseThis() +{ + if (this == NULL) + { + return; + } + + SAFE_RELEASE(m_Resource); + + switch (m_PackedData.GetType()) + { + case TYPE_COMMITTED: + m_Allocator->FreeCommittedMemory(this); + break; + case TYPE_PLACED: + m_Allocator->FreePlacedMemory(this); + break; + case TYPE_HEAP: + m_Allocator->FreeHeapMemory(this); + break; + } + + FreeName(); + + m_Allocator->GetAllocationObjectAllocator().Free(this); +} + +Allocation::Allocation(AllocatorPimpl* allocator, UINT64 size, UINT64 alignment, BOOL wasZeroInitialized) + : m_Allocator{ allocator }, + m_Size{ size }, + m_Alignment{ alignment }, + m_Resource{ NULL }, + m_pPrivateData{ NULL }, + m_Name{ NULL } +{ + D3D12MA_ASSERT(allocator); + + m_PackedData.SetType(TYPE_COUNT); + m_PackedData.SetResourceDimension(D3D12_RESOURCE_DIMENSION_UNKNOWN); + m_PackedData.SetResourceFlags(D3D12_RESOURCE_FLAG_NONE); + m_PackedData.SetTextureLayout(D3D12_TEXTURE_LAYOUT_UNKNOWN); + m_PackedData.SetWasZeroInitialized(wasZeroInitialized); +} + +void Allocation::InitCommitted(CommittedAllocationList* list) +{ + m_PackedData.SetType(TYPE_COMMITTED); + m_Committed.list = list; + m_Committed.prev = NULL; + m_Committed.next = NULL; +} + +void Allocation::InitPlaced(AllocHandle allocHandle, NormalBlock* block) +{ + m_PackedData.SetType(TYPE_PLACED); + m_Placed.allocHandle = allocHandle; + m_Placed.block = block; +} + +void Allocation::InitHeap(CommittedAllocationList* list, ID3D12Heap* heap) +{ + m_PackedData.SetType(TYPE_HEAP); + m_Heap.list = list; + m_Committed.prev = NULL; + m_Committed.next = NULL; + m_Heap.heap = heap; +} + +void Allocation::SwapBlockAllocation(Allocation* allocation) +{ + D3D12MA_ASSERT(allocation != NULL); + D3D12MA_ASSERT(m_PackedData.GetType() == TYPE_PLACED); + D3D12MA_ASSERT(allocation->m_PackedData.GetType() == TYPE_PLACED); + + D3D12MA_SWAP(m_Resource, allocation->m_Resource); + m_PackedData.SetWasZeroInitialized(allocation->m_PackedData.WasZeroInitialized()); + m_Placed.block->m_pMetadata->SetAllocationPrivateData(m_Placed.allocHandle, allocation); + D3D12MA_SWAP(m_Placed, allocation->m_Placed); + m_Placed.block->m_pMetadata->SetAllocationPrivateData(m_Placed.allocHandle, this); +} + +AllocHandle Allocation::GetAllocHandle() const +{ + switch (m_PackedData.GetType()) + { + case TYPE_COMMITTED: + case TYPE_HEAP: + return (AllocHandle)0; + case TYPE_PLACED: + return m_Placed.allocHandle; + default: + D3D12MA_ASSERT(0); + return (AllocHandle)0; + } +} + +NormalBlock* Allocation::GetBlock() +{ + switch (m_PackedData.GetType()) + { + case TYPE_COMMITTED: + case TYPE_HEAP: + return NULL; + case TYPE_PLACED: + return m_Placed.block; + default: + D3D12MA_ASSERT(0); + return NULL; + } +} + +template<typename D3D12_RESOURCE_DESC_T> +void Allocation::SetResourcePointer(ID3D12Resource* resource, const D3D12_RESOURCE_DESC_T* pResourceDesc) +{ + D3D12MA_ASSERT(m_Resource == NULL && pResourceDesc); + m_Resource = resource; + m_PackedData.SetResourceDimension(pResourceDesc->Dimension); + m_PackedData.SetResourceFlags(pResourceDesc->Flags); + m_PackedData.SetTextureLayout(pResourceDesc->Layout); +} + +void Allocation::FreeName() +{ + if (m_Name) + { + const size_t nameCharCount = wcslen(m_Name) + 1; + D3D12MA_DELETE_ARRAY(m_Allocator->GetAllocs(), m_Name, nameCharCount); + m_Name = NULL; + } +} +#endif // _D3D12MA_ALLOCATION_FUNCTIONS + +#ifndef _D3D12MA_DEFRAGMENTATION_CONTEXT_FUNCTIONS +HRESULT DefragmentationContext::BeginPass(DEFRAGMENTATION_PASS_MOVE_INFO* pPassInfo) +{ + D3D12MA_ASSERT(pPassInfo); + return m_Pimpl->DefragmentPassBegin(*pPassInfo); +} + +HRESULT DefragmentationContext::EndPass(DEFRAGMENTATION_PASS_MOVE_INFO* pPassInfo) +{ + D3D12MA_ASSERT(pPassInfo); + return m_Pimpl->DefragmentPassEnd(*pPassInfo); +} + +void DefragmentationContext::GetStats(DEFRAGMENTATION_STATS* pStats) +{ + D3D12MA_ASSERT(pStats); + m_Pimpl->GetStats(*pStats); +} + +void DefragmentationContext::ReleaseThis() +{ + if (this == NULL) + { + return; + } + + D3D12MA_DELETE(m_Pimpl->GetAllocs(), this); +} + +DefragmentationContext::DefragmentationContext(AllocatorPimpl* allocator, + const DEFRAGMENTATION_DESC& desc, + BlockVector* poolVector) + : m_Pimpl(D3D12MA_NEW(allocator->GetAllocs(), DefragmentationContextPimpl)(allocator, desc, poolVector)) {} + +DefragmentationContext::~DefragmentationContext() +{ + D3D12MA_DELETE(m_Pimpl->GetAllocs(), m_Pimpl); +} +#endif // _D3D12MA_DEFRAGMENTATION_CONTEXT_FUNCTIONS + +#ifndef _D3D12MA_POOL_FUNCTIONS +POOL_DESC Pool::GetDesc() const +{ + return m_Pimpl->GetDesc(); +} + +void Pool::GetStatistics(Statistics* pStats) +{ + D3D12MA_ASSERT(pStats); + D3D12MA_DEBUG_GLOBAL_MUTEX_LOCK + m_Pimpl->GetStatistics(*pStats); +} + +void Pool::CalculateStatistics(DetailedStatistics* pStats) +{ + D3D12MA_ASSERT(pStats); + D3D12MA_DEBUG_GLOBAL_MUTEX_LOCK + m_Pimpl->CalculateStatistics(*pStats); +} + +void Pool::SetName(LPCWSTR Name) +{ + D3D12MA_DEBUG_GLOBAL_MUTEX_LOCK + m_Pimpl->SetName(Name); +} + +LPCWSTR Pool::GetName() const +{ + return m_Pimpl->GetName(); +} + +HRESULT Pool::BeginDefragmentation(const DEFRAGMENTATION_DESC* pDesc, DefragmentationContext** ppContext) +{ + D3D12MA_ASSERT(pDesc && ppContext); + + // Check for support + if (m_Pimpl->GetBlockVector()->GetAlgorithm() & POOL_FLAG_ALGORITHM_LINEAR) + return E_NOINTERFACE; + + AllocatorPimpl* allocator = m_Pimpl->GetAllocator(); + *ppContext = D3D12MA_NEW(allocator->GetAllocs(), DefragmentationContext)(allocator, *pDesc, m_Pimpl->GetBlockVector()); + return S_OK; +} + +void Pool::ReleaseThis() +{ + if (this == NULL) + { + return; + } + + D3D12MA_DELETE(m_Pimpl->GetAllocator()->GetAllocs(), this); +} + +Pool::Pool(Allocator* allocator, const POOL_DESC& desc) + : m_Pimpl(D3D12MA_NEW(allocator->m_Pimpl->GetAllocs(), PoolPimpl)(allocator->m_Pimpl, desc)) {} + +Pool::~Pool() +{ + m_Pimpl->GetAllocator()->UnregisterPool(this, m_Pimpl->GetDesc().HeapProperties.Type); + + D3D12MA_DELETE(m_Pimpl->GetAllocator()->GetAllocs(), m_Pimpl); +} +#endif // _D3D12MA_POOL_FUNCTIONS + +#ifndef _D3D12MA_ALLOCATOR_FUNCTIONS +const D3D12_FEATURE_DATA_D3D12_OPTIONS& Allocator::GetD3D12Options() const +{ + return m_Pimpl->GetD3D12Options(); +} + +BOOL Allocator::IsUMA() const +{ + return m_Pimpl->IsUMA(); +} + +BOOL Allocator::IsCacheCoherentUMA() const +{ + return m_Pimpl->IsCacheCoherentUMA(); +} + +UINT64 Allocator::GetMemoryCapacity(UINT memorySegmentGroup) const +{ + return m_Pimpl->GetMemoryCapacity(memorySegmentGroup); +} + +HRESULT Allocator::CreateResource( + const ALLOCATION_DESC* pAllocDesc, + const D3D12_RESOURCE_DESC* pResourceDesc, + D3D12_RESOURCE_STATES InitialResourceState, + const D3D12_CLEAR_VALUE* pOptimizedClearValue, + Allocation** ppAllocation, + REFIID riidResource, + void** ppvResource) +{ + if (!pAllocDesc || !pResourceDesc || !ppAllocation) + { + D3D12MA_ASSERT(0 && "Invalid arguments passed to Allocator::CreateResource."); + return E_INVALIDARG; + } + D3D12MA_DEBUG_GLOBAL_MUTEX_LOCK + return m_Pimpl->CreateResource( + pAllocDesc, + CREATE_RESOURCE_PARAMS(pResourceDesc, InitialResourceState, pOptimizedClearValue), + ppAllocation, + riidResource, + ppvResource); +} + +#ifdef __ID3D12Device8_INTERFACE_DEFINED__ +HRESULT Allocator::CreateResource2( + const ALLOCATION_DESC* pAllocDesc, + const D3D12_RESOURCE_DESC1* pResourceDesc, + D3D12_RESOURCE_STATES InitialResourceState, + const D3D12_CLEAR_VALUE* pOptimizedClearValue, + Allocation** ppAllocation, + REFIID riidResource, + void** ppvResource) +{ + if (!pAllocDesc || !pResourceDesc || !ppAllocation) + { + D3D12MA_ASSERT(0 && "Invalid arguments passed to Allocator::CreateResource2."); + return E_INVALIDARG; + } + D3D12MA_DEBUG_GLOBAL_MUTEX_LOCK + return m_Pimpl->CreateResource( + pAllocDesc, + CREATE_RESOURCE_PARAMS(pResourceDesc, InitialResourceState, pOptimizedClearValue), + ppAllocation, + riidResource, + ppvResource); +} +#endif // #ifdef __ID3D12Device8_INTERFACE_DEFINED__ + +#ifdef __ID3D12Device10_INTERFACE_DEFINED__ +HRESULT Allocator::CreateResource3( + const ALLOCATION_DESC* pAllocDesc, + const D3D12_RESOURCE_DESC1* pResourceDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + const D3D12_CLEAR_VALUE* pOptimizedClearValue, + UINT32 NumCastableFormats, + DXGI_FORMAT* pCastableFormats, + Allocation** ppAllocation, + REFIID riidResource, + void** ppvResource) +{ + if (!pAllocDesc || !pResourceDesc || !ppAllocation) + { + D3D12MA_ASSERT(0 && "Invalid arguments passed to Allocator::CreateResource3."); + return E_INVALIDARG; + } + D3D12MA_DEBUG_GLOBAL_MUTEX_LOCK + return m_Pimpl->CreateResource( + pAllocDesc, + CREATE_RESOURCE_PARAMS(pResourceDesc, InitialLayout, pOptimizedClearValue, NumCastableFormats, pCastableFormats), + ppAllocation, + riidResource, + ppvResource); +} +#endif // #ifdef __ID3D12Device10_INTERFACE_DEFINED__ + +HRESULT Allocator::AllocateMemory( + const ALLOCATION_DESC* pAllocDesc, + const D3D12_RESOURCE_ALLOCATION_INFO* pAllocInfo, + Allocation** ppAllocation) +{ + if (!ValidateAllocateMemoryParameters(pAllocDesc, pAllocInfo, ppAllocation)) + { + D3D12MA_ASSERT(0 && "Invalid arguments passed to Allocator::AllocateMemory."); + return E_INVALIDARG; + } + D3D12MA_DEBUG_GLOBAL_MUTEX_LOCK + return m_Pimpl->AllocateMemory(pAllocDesc, pAllocInfo, ppAllocation); +} + +HRESULT Allocator::CreateAliasingResource( + Allocation* pAllocation, + UINT64 AllocationLocalOffset, + const D3D12_RESOURCE_DESC* pResourceDesc, + D3D12_RESOURCE_STATES InitialResourceState, + const D3D12_CLEAR_VALUE* pOptimizedClearValue, + REFIID riidResource, + void** ppvResource) +{ + if (!pAllocation || !pResourceDesc || !ppvResource) + { + D3D12MA_ASSERT(0 && "Invalid arguments passed to Allocator::CreateAliasingResource."); + return E_INVALIDARG; + } + D3D12MA_DEBUG_GLOBAL_MUTEX_LOCK + return m_Pimpl->CreateAliasingResource( + pAllocation, + AllocationLocalOffset, + CREATE_RESOURCE_PARAMS(pResourceDesc, InitialResourceState, pOptimizedClearValue), + riidResource, + ppvResource); +} + +#ifdef __ID3D12Device8_INTERFACE_DEFINED__ +HRESULT Allocator::CreateAliasingResource1( + Allocation* pAllocation, + UINT64 AllocationLocalOffset, + const D3D12_RESOURCE_DESC1* pResourceDesc, + D3D12_RESOURCE_STATES InitialResourceState, + const D3D12_CLEAR_VALUE* pOptimizedClearValue, + REFIID riidResource, + void** ppvResource) +{ + if (!pAllocation || !pResourceDesc || !ppvResource) + { + D3D12MA_ASSERT(0 && "Invalid arguments passed to Allocator::CreateAliasingResource."); + return E_INVALIDARG; + } + D3D12MA_DEBUG_GLOBAL_MUTEX_LOCK + return m_Pimpl->CreateAliasingResource( + pAllocation, + AllocationLocalOffset, + CREATE_RESOURCE_PARAMS(pResourceDesc, InitialResourceState, pOptimizedClearValue), + riidResource, + ppvResource); +} +#endif // #ifdef __ID3D12Device8_INTERFACE_DEFINED__ + +#ifdef __ID3D12Device10_INTERFACE_DEFINED__ +HRESULT Allocator::CreateAliasingResource2( + Allocation* pAllocation, + UINT64 AllocationLocalOffset, + const D3D12_RESOURCE_DESC1* pResourceDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + const D3D12_CLEAR_VALUE* pOptimizedClearValue, + UINT32 NumCastableFormats, + DXGI_FORMAT* pCastableFormats, + REFIID riidResource, + void** ppvResource) +{ + if (!pAllocation || !pResourceDesc || !ppvResource) + { + D3D12MA_ASSERT(0 && "Invalid arguments passed to Allocator::CreateAliasingResource."); + return E_INVALIDARG; + } + D3D12MA_DEBUG_GLOBAL_MUTEX_LOCK + return m_Pimpl->CreateAliasingResource( + pAllocation, + AllocationLocalOffset, + CREATE_RESOURCE_PARAMS(pResourceDesc, InitialLayout, pOptimizedClearValue, NumCastableFormats, pCastableFormats), + riidResource, + ppvResource); +} +#endif // #ifdef __ID3D12Device10_INTERFACE_DEFINED__ + +HRESULT Allocator::CreatePool( + const POOL_DESC* pPoolDesc, + Pool** ppPool) +{ + if (!pPoolDesc || !ppPool || + (pPoolDesc->MaxBlockCount > 0 && pPoolDesc->MaxBlockCount < pPoolDesc->MinBlockCount) || + (pPoolDesc->MinAllocationAlignment > 0 && !IsPow2(pPoolDesc->MinAllocationAlignment))) + { + D3D12MA_ASSERT(0 && "Invalid arguments passed to Allocator::CreatePool."); + return E_INVALIDARG; + } + if (!m_Pimpl->HeapFlagsFulfillResourceHeapTier(pPoolDesc->HeapFlags)) + { + D3D12MA_ASSERT(0 && "Invalid pPoolDesc->HeapFlags passed to Allocator::CreatePool. Did you forget to handle ResourceHeapTier=1?"); + return E_INVALIDARG; + } + D3D12MA_DEBUG_GLOBAL_MUTEX_LOCK + * ppPool = D3D12MA_NEW(m_Pimpl->GetAllocs(), Pool)(this, *pPoolDesc); + HRESULT hr = (*ppPool)->m_Pimpl->Init(); + if (SUCCEEDED(hr)) + { + m_Pimpl->RegisterPool(*ppPool, pPoolDesc->HeapProperties.Type); + } + else + { + D3D12MA_DELETE(m_Pimpl->GetAllocs(), *ppPool); + *ppPool = NULL; + } + return hr; +} + +void Allocator::SetCurrentFrameIndex(UINT frameIndex) +{ + D3D12MA_DEBUG_GLOBAL_MUTEX_LOCK + m_Pimpl->SetCurrentFrameIndex(frameIndex); +} + +void Allocator::GetBudget(Budget* pLocalBudget, Budget* pNonLocalBudget) +{ + if (pLocalBudget == NULL && pNonLocalBudget == NULL) + { + return; + } + D3D12MA_DEBUG_GLOBAL_MUTEX_LOCK + m_Pimpl->GetBudget(pLocalBudget, pNonLocalBudget); +} + +void Allocator::CalculateStatistics(TotalStatistics* pStats) +{ + D3D12MA_ASSERT(pStats); + D3D12MA_DEBUG_GLOBAL_MUTEX_LOCK + m_Pimpl->CalculateStatistics(*pStats); +} + +void Allocator::BuildStatsString(WCHAR** ppStatsString, BOOL DetailedMap) const +{ + D3D12MA_ASSERT(ppStatsString); + D3D12MA_DEBUG_GLOBAL_MUTEX_LOCK + m_Pimpl->BuildStatsString(ppStatsString, DetailedMap); +} + +void Allocator::FreeStatsString(WCHAR* pStatsString) const +{ + if (pStatsString != NULL) + { + D3D12MA_DEBUG_GLOBAL_MUTEX_LOCK + m_Pimpl->FreeStatsString(pStatsString); + } +} + +void Allocator::BeginDefragmentation(const DEFRAGMENTATION_DESC* pDesc, DefragmentationContext** ppContext) +{ + D3D12MA_ASSERT(pDesc && ppContext); + + *ppContext = D3D12MA_NEW(m_Pimpl->GetAllocs(), DefragmentationContext)(m_Pimpl, *pDesc, NULL); +} + +void Allocator::ReleaseThis() +{ + // Copy is needed because otherwise we would call destructor and invalidate the structure with callbacks before using it to free memory. + const ALLOCATION_CALLBACKS allocationCallbacksCopy = m_Pimpl->GetAllocs(); + D3D12MA_DELETE(allocationCallbacksCopy, this); +} + +Allocator::Allocator(const ALLOCATION_CALLBACKS& allocationCallbacks, const ALLOCATOR_DESC& desc) + : m_Pimpl(D3D12MA_NEW(allocationCallbacks, AllocatorPimpl)(allocationCallbacks, desc)) {} + +Allocator::~Allocator() +{ + D3D12MA_DELETE(m_Pimpl->GetAllocs(), m_Pimpl); +} +#endif // _D3D12MA_ALLOCATOR_FUNCTIONS + +#ifndef _D3D12MA_VIRTUAL_BLOCK_FUNCTIONS +BOOL VirtualBlock::IsEmpty() const +{ + D3D12MA_DEBUG_GLOBAL_MUTEX_LOCK + return m_Pimpl->m_Metadata->IsEmpty() ? TRUE : FALSE; +} + +void VirtualBlock::GetAllocationInfo(VirtualAllocation allocation, VIRTUAL_ALLOCATION_INFO* pInfo) const +{ + D3D12MA_ASSERT(allocation.AllocHandle != (AllocHandle)0 && pInfo); + + D3D12MA_DEBUG_GLOBAL_MUTEX_LOCK + m_Pimpl->m_Metadata->GetAllocationInfo(allocation.AllocHandle, *pInfo); +} + +HRESULT VirtualBlock::Allocate(const VIRTUAL_ALLOCATION_DESC* pDesc, VirtualAllocation* pAllocation, UINT64* pOffset) +{ + if (!pDesc || !pAllocation || pDesc->Size == 0 || !IsPow2(pDesc->Alignment)) + { + D3D12MA_ASSERT(0 && "Invalid arguments passed to VirtualBlock::Allocate."); + return E_INVALIDARG; + } + + D3D12MA_DEBUG_GLOBAL_MUTEX_LOCK + + const UINT64 alignment = pDesc->Alignment != 0 ? pDesc->Alignment : 1; + AllocationRequest allocRequest = {}; + if (m_Pimpl->m_Metadata->CreateAllocationRequest( + pDesc->Size, + alignment, + pDesc->Flags & VIRTUAL_ALLOCATION_FLAG_UPPER_ADDRESS, + pDesc->Flags & VIRTUAL_ALLOCATION_FLAG_STRATEGY_MASK, + &allocRequest)) + { + m_Pimpl->m_Metadata->Alloc(allocRequest, pDesc->Size, pDesc->pPrivateData); + D3D12MA_HEAVY_ASSERT(m_Pimpl->m_Metadata->Validate()); + pAllocation->AllocHandle = allocRequest.allocHandle; + + if (pOffset) + *pOffset = m_Pimpl->m_Metadata->GetAllocationOffset(allocRequest.allocHandle); + return S_OK; + } + + pAllocation->AllocHandle = (AllocHandle)0; + if (pOffset) + *pOffset = UINT64_MAX; + + return E_OUTOFMEMORY; +} + +void VirtualBlock::FreeAllocation(VirtualAllocation allocation) +{ + if (allocation.AllocHandle == (AllocHandle)0) + return; + + D3D12MA_DEBUG_GLOBAL_MUTEX_LOCK + + m_Pimpl->m_Metadata->Free(allocation.AllocHandle); + D3D12MA_HEAVY_ASSERT(m_Pimpl->m_Metadata->Validate()); +} + +void VirtualBlock::Clear() +{ + D3D12MA_DEBUG_GLOBAL_MUTEX_LOCK + + m_Pimpl->m_Metadata->Clear(); + D3D12MA_HEAVY_ASSERT(m_Pimpl->m_Metadata->Validate()); +} + +void VirtualBlock::SetAllocationPrivateData(VirtualAllocation allocation, void* pPrivateData) +{ + D3D12MA_ASSERT(allocation.AllocHandle != (AllocHandle)0); + + D3D12MA_DEBUG_GLOBAL_MUTEX_LOCK + m_Pimpl->m_Metadata->SetAllocationPrivateData(allocation.AllocHandle, pPrivateData); +} + +void VirtualBlock::GetStatistics(Statistics* pStats) const +{ + D3D12MA_ASSERT(pStats); + D3D12MA_DEBUG_GLOBAL_MUTEX_LOCK + D3D12MA_HEAVY_ASSERT(m_Pimpl->m_Metadata->Validate()); + ClearStatistics(*pStats); + m_Pimpl->m_Metadata->AddStatistics(*pStats); +} + +void VirtualBlock::CalculateStatistics(DetailedStatistics* pStats) const +{ + D3D12MA_ASSERT(pStats); + D3D12MA_DEBUG_GLOBAL_MUTEX_LOCK + D3D12MA_HEAVY_ASSERT(m_Pimpl->m_Metadata->Validate()); + ClearDetailedStatistics(*pStats); + m_Pimpl->m_Metadata->AddDetailedStatistics(*pStats); +} + +void VirtualBlock::BuildStatsString(WCHAR** ppStatsString) const +{ + D3D12MA_ASSERT(ppStatsString); + + D3D12MA_DEBUG_GLOBAL_MUTEX_LOCK + + StringBuilder sb(m_Pimpl->m_AllocationCallbacks); + { + JsonWriter json(m_Pimpl->m_AllocationCallbacks, sb); + D3D12MA_HEAVY_ASSERT(m_Pimpl->m_Metadata->Validate()); + json.BeginObject(); + m_Pimpl->m_Metadata->WriteAllocationInfoToJson(json); + json.EndObject(); + } // Scope for JsonWriter + + const size_t length = sb.GetLength(); + WCHAR* result = AllocateArray<WCHAR>(m_Pimpl->m_AllocationCallbacks, length + 1); + memcpy(result, sb.GetData(), length * sizeof(WCHAR)); + result[length] = L'\0'; + *ppStatsString = result; +} + +void VirtualBlock::FreeStatsString(WCHAR* pStatsString) const +{ + if (pStatsString != NULL) + { + D3D12MA_DEBUG_GLOBAL_MUTEX_LOCK + D3D12MA::Free(m_Pimpl->m_AllocationCallbacks, pStatsString); + } +} + +void VirtualBlock::ReleaseThis() +{ + // Copy is needed because otherwise we would call destructor and invalidate the structure with callbacks before using it to free memory. + const ALLOCATION_CALLBACKS allocationCallbacksCopy = m_Pimpl->m_AllocationCallbacks; + D3D12MA_DELETE(allocationCallbacksCopy, this); +} + +VirtualBlock::VirtualBlock(const ALLOCATION_CALLBACKS& allocationCallbacks, const VIRTUAL_BLOCK_DESC& desc) + : m_Pimpl(D3D12MA_NEW(allocationCallbacks, VirtualBlockPimpl)(allocationCallbacks, desc)) {} + +VirtualBlock::~VirtualBlock() +{ + // THIS IS AN IMPORTANT ASSERT! + // Hitting it means you have some memory leak - unreleased allocations in this virtual block. + D3D12MA_ASSERT(m_Pimpl->m_Metadata->IsEmpty() && "Some allocations were not freed before destruction of this virtual block!"); + + D3D12MA_DELETE(m_Pimpl->m_AllocationCallbacks, m_Pimpl); +} +#endif // _D3D12MA_VIRTUAL_BLOCK_FUNCTIONS +#endif // _D3D12MA_PUBLIC_INTERFACE +} // namespace D3D12MA diff --git a/thirdparty/d3d12ma/D3D12MemAlloc.h b/thirdparty/d3d12ma/D3D12MemAlloc.h new file mode 100644 index 0000000000..4ab7be318e --- /dev/null +++ b/thirdparty/d3d12ma/D3D12MemAlloc.h @@ -0,0 +1,2632 @@ +// +// Copyright (c) 2019-2022 Advanced Micro Devices, Inc. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +#pragma once + +/** \mainpage D3D12 Memory Allocator + +<b>Version 2.1.0-development</b> (2022-12-15) + +Copyright (c) 2019-2022 Advanced Micro Devices, Inc. All rights reserved. \n +License: MIT + +Documentation of all members: D3D12MemAlloc.h + +\section main_table_of_contents Table of contents + +- \subpage quick_start + - [Project setup](@ref quick_start_project_setup) + - [Creating resources](@ref quick_start_creating_resources) + - [Resource reference counting](@ref quick_start_resource_reference_counting) + - [Mapping memory](@ref quick_start_mapping_memory) +- \subpage custom_pools +- \subpage defragmentation +- \subpage statistics +- \subpage resource_aliasing +- \subpage linear_algorithm +- \subpage virtual_allocator +- \subpage configuration + - [Custom CPU memory allocator](@ref custom_memory_allocator) + - [Debug margins](@ref debug_margins) +- \subpage general_considerations + - [Thread safety](@ref general_considerations_thread_safety) + - [Versioning and compatibility](@ref general_considerations_versioning_and_compatibility) + - [Features not supported](@ref general_considerations_features_not_supported) + +\section main_see_also See also + +- [Product page on GPUOpen](https://gpuopen.com/gaming-product/d3d12-memory-allocator/) +- [Source repository on GitHub](https://github.com/GPUOpen-LibrariesAndSDKs/D3D12MemoryAllocator) +*/ + +// If using this library on a platform different than Windows PC or want to use different version of DXGI, +// you should include D3D12-compatible headers before this library on your own and define this macro. +#ifndef D3D12MA_D3D12_HEADERS_ALREADY_INCLUDED + #include <d3d12.h> + #include <dxgi1_4.h> +#endif + +// Define this macro to 0 to disable usage of DXGI 1.4 (needed for IDXGIAdapter3 and query for memory budget). +#ifndef D3D12MA_DXGI_1_4 + #ifdef __IDXGIAdapter3_INTERFACE_DEFINED__ + #define D3D12MA_DXGI_1_4 1 + #else + #define D3D12MA_DXGI_1_4 0 + #endif +#endif + +/* +When defined to value other than 0, the library will try to use +D3D12_SMALL_RESOURCE_PLACEMENT_ALIGNMENT or D3D12_SMALL_MSAA_RESOURCE_PLACEMENT_ALIGNMENT +for created textures when possible, which can save memory because some small textures +may get their alignment 4K and their size a multiply of 4K instead of 64K. + +#define D3D12MA_USE_SMALL_RESOURCE_PLACEMENT_ALIGNMENT 0 + Disables small texture alignment. +#define D3D12MA_USE_SMALL_RESOURCE_PLACEMENT_ALIGNMENT 1 + Enables conservative algorithm that will use small alignment only for some textures + that are surely known to support it. +#define D3D12MA_USE_SMALL_RESOURCE_PLACEMENT_ALIGNMENT 2 + Enables query for small alignment to D3D12 (based on Microsoft sample) which will + enable small alignment for more textures, but will also generate D3D Debug Layer + error #721 on call to ID3D12Device::GetResourceAllocationInfo, which you should just + ignore. +*/ +#ifndef D3D12MA_USE_SMALL_RESOURCE_PLACEMENT_ALIGNMENT + #define D3D12MA_USE_SMALL_RESOURCE_PLACEMENT_ALIGNMENT 1 +#endif + +/// \cond INTERNAL + +#define D3D12MA_CLASS_NO_COPY(className) \ + private: \ + className(const className&) = delete; \ + className(className&&) = delete; \ + className& operator=(const className&) = delete; \ + className& operator=(className&&) = delete; + +// To be used with MAKE_HRESULT to define custom error codes. +#define FACILITY_D3D12MA 3542 + +/* +If providing your own implementation, you need to implement a subset of std::atomic. +*/ +#if !defined(D3D12MA_ATOMIC_UINT32) || !defined(D3D12MA_ATOMIC_UINT64) + #include <atomic> +#endif + +#ifndef D3D12MA_ATOMIC_UINT32 + #define D3D12MA_ATOMIC_UINT32 std::atomic<UINT> +#endif + +#ifndef D3D12MA_ATOMIC_UINT64 + #define D3D12MA_ATOMIC_UINT64 std::atomic<UINT64> +#endif + +#ifdef D3D12MA_EXPORTS + #define D3D12MA_API __declspec(dllexport) +#elif defined(D3D12MA_IMPORTS) + #define D3D12MA_API __declspec(dllimport) +#else + #define D3D12MA_API +#endif + +// Forward declaration if ID3D12ProtectedResourceSession is not defined inside the headers (older SDK, pre ID3D12Device4) +struct ID3D12ProtectedResourceSession; + +// Define this enum even if SDK doesn't provide it, to simplify the API. +#ifndef __ID3D12Device1_INTERFACE_DEFINED__ +typedef enum D3D12_RESIDENCY_PRIORITY +{ + D3D12_RESIDENCY_PRIORITY_MINIMUM = 0x28000000, + D3D12_RESIDENCY_PRIORITY_LOW = 0x50000000, + D3D12_RESIDENCY_PRIORITY_NORMAL = 0x78000000, + D3D12_RESIDENCY_PRIORITY_HIGH = 0xa0010000, + D3D12_RESIDENCY_PRIORITY_MAXIMUM = 0xc8000000 +} D3D12_RESIDENCY_PRIORITY; +#endif + +namespace D3D12MA +{ +class D3D12MA_API IUnknownImpl : public IUnknown +{ +public: + virtual ~IUnknownImpl() = default; + virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject); + virtual ULONG STDMETHODCALLTYPE AddRef(); + virtual ULONG STDMETHODCALLTYPE Release(); +protected: + virtual void ReleaseThis() { delete this; } +private: + D3D12MA_ATOMIC_UINT32 m_RefCount = {1}; +}; +} // namespace D3D12MA + +/// \endcond + +namespace D3D12MA +{ + +/// \cond INTERNAL +class DefragmentationContextPimpl; +class AllocatorPimpl; +class PoolPimpl; +class NormalBlock; +class BlockVector; +class CommittedAllocationList; +class JsonWriter; +class VirtualBlockPimpl; +/// \endcond + +class Pool; +class Allocator; +struct Statistics; +struct DetailedStatistics; +struct TotalStatistics; + +/// \brief Unique identifier of single allocation done inside the memory heap. +typedef UINT64 AllocHandle; + +/// Pointer to custom callback function that allocates CPU memory. +using ALLOCATE_FUNC_PTR = void* (*)(size_t Size, size_t Alignment, void* pPrivateData); +/** +\brief Pointer to custom callback function that deallocates CPU memory. + +`pMemory = null` should be accepted and ignored. +*/ +using FREE_FUNC_PTR = void (*)(void* pMemory, void* pPrivateData); + +/// Custom callbacks to CPU memory allocation functions. +struct ALLOCATION_CALLBACKS +{ + /// %Allocation function. + ALLOCATE_FUNC_PTR pAllocate; + /// Dellocation function. + FREE_FUNC_PTR pFree; + /// Custom data that will be passed to allocation and deallocation functions as `pUserData` parameter. + void* pPrivateData; +}; + + +/// \brief Bit flags to be used with ALLOCATION_DESC::Flags. +enum ALLOCATION_FLAGS +{ + /// Zero + ALLOCATION_FLAG_NONE = 0, + + /** + Set this flag if the allocation should have its own dedicated memory allocation (committed resource with implicit heap). + + Use it for special, big resources, like fullscreen textures used as render targets. + + - When used with functions like D3D12MA::Allocator::CreateResource, it will use `ID3D12Device::CreateCommittedResource`, + so the created allocation will contain a resource (D3D12MA::Allocation::GetResource() `!= NULL`) but will not have + a heap (D3D12MA::Allocation::GetHeap() `== NULL`), as the heap is implicit. + - When used with raw memory allocation like D3D12MA::Allocator::AllocateMemory, it will use `ID3D12Device::CreateHeap`, + so the created allocation will contain a heap (D3D12MA::Allocation::GetHeap() `!= NULL`) and its offset will always be 0. + */ + ALLOCATION_FLAG_COMMITTED = 0x1, + + /** + Set this flag to only try to allocate from existing memory heaps and never create new such heap. + + If new allocation cannot be placed in any of the existing heaps, allocation + fails with `E_OUTOFMEMORY` error. + + You should not use D3D12MA::ALLOCATION_FLAG_COMMITTED and + D3D12MA::ALLOCATION_FLAG_NEVER_ALLOCATE at the same time. It makes no sense. + */ + ALLOCATION_FLAG_NEVER_ALLOCATE = 0x2, + + /** Create allocation only if additional memory required for it, if any, won't exceed + memory budget. Otherwise return `E_OUTOFMEMORY`. + */ + ALLOCATION_FLAG_WITHIN_BUDGET = 0x4, + + /** Allocation will be created from upper stack in a double stack pool. + + This flag is only allowed for custom pools created with #POOL_FLAG_ALGORITHM_LINEAR flag. + */ + ALLOCATION_FLAG_UPPER_ADDRESS = 0x8, + + /** Set this flag if the allocated memory will have aliasing resources. + + Use this when calling D3D12MA::Allocator::CreateResource() and similar to + guarantee creation of explicit heap for desired allocation and prevent it from using `CreateCommittedResource`, + so that new allocation object will always have `allocation->GetHeap() != NULL`. + */ + ALLOCATION_FLAG_CAN_ALIAS = 0x10, + + /** Allocation strategy that chooses smallest possible free range for the allocation + to minimize memory usage and fragmentation, possibly at the expense of allocation time. + */ + ALLOCATION_FLAG_STRATEGY_MIN_MEMORY = 0x00010000, + + /** Allocation strategy that chooses first suitable free range for the allocation - + not necessarily in terms of the smallest offset but the one that is easiest and fastest to find + to minimize allocation time, possibly at the expense of allocation quality. + */ + ALLOCATION_FLAG_STRATEGY_MIN_TIME = 0x00020000, + + /** Allocation strategy that chooses always the lowest offset in available space. + This is not the most efficient strategy but achieves highly packed data. + Used internally by defragmentation, not recomended in typical usage. + */ + ALLOCATION_FLAG_STRATEGY_MIN_OFFSET = 0x0004000, + + /// Alias to #ALLOCATION_FLAG_STRATEGY_MIN_MEMORY. + ALLOCATION_FLAG_STRATEGY_BEST_FIT = ALLOCATION_FLAG_STRATEGY_MIN_MEMORY, + /// Alias to #ALLOCATION_FLAG_STRATEGY_MIN_TIME. + ALLOCATION_FLAG_STRATEGY_FIRST_FIT = ALLOCATION_FLAG_STRATEGY_MIN_TIME, + + /// A bit mask to extract only `STRATEGY` bits from entire set of flags. + ALLOCATION_FLAG_STRATEGY_MASK = + ALLOCATION_FLAG_STRATEGY_MIN_MEMORY | + ALLOCATION_FLAG_STRATEGY_MIN_TIME | + ALLOCATION_FLAG_STRATEGY_MIN_OFFSET, +}; + +/// \brief Parameters of created D3D12MA::Allocation object. To be used with Allocator::CreateResource. +struct ALLOCATION_DESC +{ + /// Flags. + ALLOCATION_FLAGS Flags; + /** \brief The type of memory heap where the new allocation should be placed. + + It must be one of: `D3D12_HEAP_TYPE_DEFAULT`, `D3D12_HEAP_TYPE_UPLOAD`, `D3D12_HEAP_TYPE_READBACK`. + + When D3D12MA::ALLOCATION_DESC::CustomPool != NULL this member is ignored. + */ + D3D12_HEAP_TYPE HeapType; + /** \brief Additional heap flags to be used when allocating memory. + + In most cases it can be 0. + + - If you use D3D12MA::Allocator::CreateResource(), you don't need to care. + Necessary flag `D3D12_HEAP_FLAG_ALLOW_ONLY_BUFFERS`, `D3D12_HEAP_FLAG_ALLOW_ONLY_NON_RT_DS_TEXTURES`, + or `D3D12_HEAP_FLAG_ALLOW_ONLY_RT_DS_TEXTURES` is added automatically. + - If you use D3D12MA::Allocator::AllocateMemory(), you should specify one of those `ALLOW_ONLY` flags. + Except when you validate that D3D12MA::Allocator::GetD3D12Options()`.ResourceHeapTier == D3D12_RESOURCE_HEAP_TIER_1` - + then you can leave it 0. + - You can specify additional flags if needed. Then the memory will always be allocated as + separate block using `D3D12Device::CreateCommittedResource` or `CreateHeap`, not as part of an existing larget block. + + When D3D12MA::ALLOCATION_DESC::CustomPool != NULL this member is ignored. + */ + D3D12_HEAP_FLAGS ExtraHeapFlags; + /** \brief Custom pool to place the new resource in. Optional. + + When not NULL, the resource will be created inside specified custom pool. + */ + Pool* CustomPool; + /// Custom general-purpose pointer that will be stored in D3D12MA::Allocation. + void* pPrivateData; +}; + +/** \brief Calculated statistics of memory usage e.g. in a specific memory heap type, +memory segment group, custom pool, or total. + +These are fast to calculate. +See functions: D3D12MA::Allocator::GetBudget(), D3D12MA::Pool::GetStatistics(). +*/ +struct Statistics +{ + /** \brief Number of D3D12 memory blocks allocated - `ID3D12Heap` objects and committed resources. + */ + UINT BlockCount; + /** \brief Number of D3D12MA::Allocation objects allocated. + + Committed allocations have their own blocks, so each one adds 1 to `AllocationCount` as well as `BlockCount`. + */ + UINT AllocationCount; + /** \brief Number of bytes allocated in memory blocks. + */ + UINT64 BlockBytes; + /** \brief Total number of bytes occupied by all D3D12MA::Allocation objects. + + Always less or equal than `BlockBytes`. + Difference `(BlockBytes - AllocationBytes)` is the amount of memory allocated from D3D12 + but unused by any D3D12MA::Allocation. + */ + UINT64 AllocationBytes; +}; + +/** \brief More detailed statistics than D3D12MA::Statistics. + +These are slower to calculate. Use for debugging purposes. +See functions: D3D12MA::Allocator::CalculateStatistics(), D3D12MA::Pool::CalculateStatistics(). + +Averages are not provided because they can be easily calculated as: + +\code +UINT64 AllocationSizeAvg = DetailedStats.Statistics.AllocationBytes / detailedStats.Statistics.AllocationCount; +UINT64 UnusedBytes = DetailedStats.Statistics.BlockBytes - DetailedStats.Statistics.AllocationBytes; +UINT64 UnusedRangeSizeAvg = UnusedBytes / DetailedStats.UnusedRangeCount; +\endcode +*/ +struct DetailedStatistics +{ + /// Basic statistics. + Statistics Stats; + /// Number of free ranges of memory between allocations. + UINT UnusedRangeCount; + /// Smallest allocation size. `UINT64_MAX` if there are 0 allocations. + UINT64 AllocationSizeMin; + /// Largest allocation size. 0 if there are 0 allocations. + UINT64 AllocationSizeMax; + /// Smallest empty range size. `UINT64_MAX` if there are 0 empty ranges. + UINT64 UnusedRangeSizeMin; + /// Largest empty range size. 0 if there are 0 empty ranges. + UINT64 UnusedRangeSizeMax; +}; + +/** \brief General statistics from current state of the allocator - +total memory usage across all memory heaps and segments. + +These are slower to calculate. Use for debugging purposes. +See function D3D12MA::Allocator::CalculateStatistics(). +*/ +struct TotalStatistics +{ + /** \brief One element for each type of heap located at the following indices: + + - 0 = `D3D12_HEAP_TYPE_DEFAULT` + - 1 = `D3D12_HEAP_TYPE_UPLOAD` + - 2 = `D3D12_HEAP_TYPE_READBACK` + - 3 = `D3D12_HEAP_TYPE_CUSTOM` + */ + DetailedStatistics HeapType[4]; + /** \brief One element for each memory segment group located at the following indices: + + - 0 = `DXGI_MEMORY_SEGMENT_GROUP_LOCAL` + - 1 = `DXGI_MEMORY_SEGMENT_GROUP_NON_LOCAL` + + Meaning of these segment groups is: + + - When `IsUMA() == FALSE` (discrete graphics card): + - `DXGI_MEMORY_SEGMENT_GROUP_LOCAL` (index 0) represents GPU memory + (resources allocated in `D3D12_HEAP_TYPE_DEFAULT` or `D3D12_MEMORY_POOL_L1`). + - `DXGI_MEMORY_SEGMENT_GROUP_NON_LOCAL` (index 1) represents system memory + (resources allocated in `D3D12_HEAP_TYPE_UPLOAD`, `D3D12_HEAP_TYPE_READBACK`, or `D3D12_MEMORY_POOL_L0`). + - When `IsUMA() == TRUE` (integrated graphics chip): + - `DXGI_MEMORY_SEGMENT_GROUP_LOCAL` = (index 0) represents memory shared for all the resources. + - `DXGI_MEMORY_SEGMENT_GROUP_NON_LOCAL` = (index 1) is unused and always 0. + */ + DetailedStatistics MemorySegmentGroup[2]; + /// Total statistics from all memory allocated from D3D12. + DetailedStatistics Total; +}; + +/** \brief %Statistics of current memory usage and available budget for a specific memory segment group. + +These are fast to calculate. See function D3D12MA::Allocator::GetBudget(). +*/ +struct Budget +{ + /** \brief %Statistics fetched from the library. + */ + Statistics Stats; + /** \brief Estimated current memory usage of the program. + + Fetched from system using `IDXGIAdapter3::QueryVideoMemoryInfo` if possible. + + It might be different than `BlockBytes` (usually higher) due to additional implicit objects + also occupying the memory, like swapchain, pipeline state objects, descriptor heaps, command lists, or + heaps and resources allocated outside of this library, if any. + */ + UINT64 UsageBytes; + /** \brief Estimated amount of memory available to the program. + + Fetched from system using `IDXGIAdapter3::QueryVideoMemoryInfo` if possible. + + It might be different (most probably smaller) than memory capacity returned + by D3D12MA::Allocator::GetMemoryCapacity() due to factors + external to the program, decided by the operating system. + Difference `BudgetBytes - UsageBytes` is the amount of additional memory that can probably + be allocated without problems. Exceeding the budget may result in various problems. + */ + UINT64 BudgetBytes; +}; + + +/// \brief Represents single memory allocation done inside VirtualBlock. +struct D3D12MA_API VirtualAllocation +{ + /// \brief Unique idenitfier of current allocation. 0 means null/invalid. + AllocHandle AllocHandle; +}; + +/** \brief Represents single memory allocation. + +It may be either implicit memory heap dedicated to a single resource or a +specific region of a bigger heap plus unique offset. + +To create such object, fill structure D3D12MA::ALLOCATION_DESC and call function +Allocator::CreateResource. + +The object remembers size and some other information. +To retrieve this information, use methods of this class. + +The object also remembers `ID3D12Resource` and "owns" a reference to it, +so it calls `%Release()` on the resource when destroyed. +*/ +class D3D12MA_API Allocation : public IUnknownImpl +{ +public: + /** \brief Returns offset in bytes from the start of memory heap. + + You usually don't need to use this offset. If you create a buffer or a texture together with the allocation using function + D3D12MA::Allocator::CreateResource, functions that operate on that resource refer to the beginning of the resource, + not entire memory heap. + + If the Allocation represents committed resource with implicit heap, returns 0. + */ + UINT64 GetOffset() const; + + /// Returns alignment that resource was created with. + UINT64 GetAlignment() const { return m_Alignment; } + + /** \brief Returns size in bytes of the allocation. + + - If you created a buffer or a texture together with the allocation using function D3D12MA::Allocator::CreateResource, + this is the size of the resource returned by `ID3D12Device::GetResourceAllocationInfo`. + - For allocations made out of bigger memory blocks, this also is the size of the memory region assigned exclusively to this allocation. + - For resources created as committed, this value may not be accurate. DirectX implementation may optimize memory usage internally + so that you may even observe regions of `ID3D12Resource::GetGPUVirtualAddress()` + Allocation::GetSize() to overlap in memory and still work correctly. + */ + UINT64 GetSize() const { return m_Size; } + + /** \brief Returns D3D12 resource associated with this object. + + Calling this method doesn't increment resource's reference counter. + */ + ID3D12Resource* GetResource() const { return m_Resource; } + + /// Releases the resource currently pointed by the allocation (if any), sets it to new one, incrementing its reference counter (if not null). + void SetResource(ID3D12Resource* pResource); + + /** \brief Returns memory heap that the resource is created in. + + If the Allocation represents committed resource with implicit heap, returns NULL. + */ + ID3D12Heap* GetHeap() const; + + /// Changes custom pointer for an allocation to a new value. + void SetPrivateData(void* pPrivateData) { m_pPrivateData = pPrivateData; } + + /// Get custom pointer associated with the allocation. + void* GetPrivateData() const { return m_pPrivateData; } + + /** \brief Associates a name with the allocation object. This name is for use in debug diagnostics and tools. + + Internal copy of the string is made, so the memory pointed by the argument can be + changed of freed immediately after this call. + + `Name` can be null. + */ + void SetName(LPCWSTR Name); + + /** \brief Returns the name associated with the allocation object. + + Returned string points to an internal copy. + + If no name was associated with the allocation, returns null. + */ + LPCWSTR GetName() const { return m_Name; } + + /** \brief Returns `TRUE` if the memory of the allocation was filled with zeros when the allocation was created. + + Returns `TRUE` only if the allocator is sure that the entire memory where the + allocation was created was filled with zeros at the moment the allocation was made. + + Returns `FALSE` if the memory could potentially contain garbage data. + If it's a render-target or depth-stencil texture, it then needs proper + initialization with `ClearRenderTargetView`, `ClearDepthStencilView`, `DiscardResource`, + or a copy operation, as described on page + "ID3D12Device::CreatePlacedResource method - Notes on the required resource initialization" in Microsoft documentation. + Please note that rendering a fullscreen triangle or quad to the texture as + a render target is not a proper way of initialization! + + See also articles: + + - "Coming to DirectX 12: More control over memory allocation" on DirectX Developer Blog + - ["Initializing DX12 Textures After Allocation and Aliasing"](https://asawicki.info/news_1724_initializing_dx12_textures_after_allocation_and_aliasing). + */ + BOOL WasZeroInitialized() const { return m_PackedData.WasZeroInitialized(); } + +protected: + void ReleaseThis() override; + +private: + friend class AllocatorPimpl; + friend class BlockVector; + friend class CommittedAllocationList; + friend class JsonWriter; + friend class BlockMetadata_Linear; + friend class DefragmentationContextPimpl; + friend struct CommittedAllocationListItemTraits; + template<typename T> friend void D3D12MA_DELETE(const ALLOCATION_CALLBACKS&, T*); + template<typename T> friend class PoolAllocator; + + enum Type + { + TYPE_COMMITTED, + TYPE_PLACED, + TYPE_HEAP, + TYPE_COUNT + }; + + AllocatorPimpl* m_Allocator; + UINT64 m_Size; + UINT64 m_Alignment; + ID3D12Resource* m_Resource; + void* m_pPrivateData; + wchar_t* m_Name; + + union + { + struct + { + CommittedAllocationList* list; + Allocation* prev; + Allocation* next; + } m_Committed; + + struct + { + AllocHandle allocHandle; + NormalBlock* block; + } m_Placed; + + struct + { + // Beginning must be compatible with m_Committed. + CommittedAllocationList* list; + Allocation* prev; + Allocation* next; + ID3D12Heap* heap; + } m_Heap; + }; + + struct PackedData + { + public: + PackedData() : + m_Type(0), m_ResourceDimension(0), m_ResourceFlags(0), m_TextureLayout(0), m_WasZeroInitialized(0) { } + + Type GetType() const { return (Type)m_Type; } + D3D12_RESOURCE_DIMENSION GetResourceDimension() const { return (D3D12_RESOURCE_DIMENSION)m_ResourceDimension; } + D3D12_RESOURCE_FLAGS GetResourceFlags() const { return (D3D12_RESOURCE_FLAGS)m_ResourceFlags; } + D3D12_TEXTURE_LAYOUT GetTextureLayout() const { return (D3D12_TEXTURE_LAYOUT)m_TextureLayout; } + BOOL WasZeroInitialized() const { return (BOOL)m_WasZeroInitialized; } + + void SetType(Type type); + void SetResourceDimension(D3D12_RESOURCE_DIMENSION resourceDimension); + void SetResourceFlags(D3D12_RESOURCE_FLAGS resourceFlags); + void SetTextureLayout(D3D12_TEXTURE_LAYOUT textureLayout); + void SetWasZeroInitialized(BOOL wasZeroInitialized) { m_WasZeroInitialized = wasZeroInitialized ? 1 : 0; } + + private: + UINT m_Type : 2; // enum Type + UINT m_ResourceDimension : 3; // enum D3D12_RESOURCE_DIMENSION + UINT m_ResourceFlags : 24; // flags D3D12_RESOURCE_FLAGS + UINT m_TextureLayout : 9; // enum D3D12_TEXTURE_LAYOUT + UINT m_WasZeroInitialized : 1; // BOOL + } m_PackedData; + + Allocation(AllocatorPimpl* allocator, UINT64 size, UINT64 alignment, BOOL wasZeroInitialized); + // Nothing here, everything already done in Release. + virtual ~Allocation() = default; + + void InitCommitted(CommittedAllocationList* list); + void InitPlaced(AllocHandle allocHandle, NormalBlock* block); + void InitHeap(CommittedAllocationList* list, ID3D12Heap* heap); + void SwapBlockAllocation(Allocation* allocation); + // If the Allocation represents committed resource with implicit heap, returns UINT64_MAX. + AllocHandle GetAllocHandle() const; + NormalBlock* GetBlock(); + template<typename D3D12_RESOURCE_DESC_T> + void SetResourcePointer(ID3D12Resource* resource, const D3D12_RESOURCE_DESC_T* pResourceDesc); + void FreeName(); + + D3D12MA_CLASS_NO_COPY(Allocation) +}; + + +/// Flags to be passed as DEFRAGMENTATION_DESC::Flags. +enum DEFRAGMENTATION_FLAGS +{ + /** Use simple but fast algorithm for defragmentation. + May not achieve best results but will require least time to compute and least allocations to copy. + */ + DEFRAGMENTATION_FLAG_ALGORITHM_FAST = 0x1, + /** Default defragmentation algorithm, applied also when no `ALGORITHM` flag is specified. + Offers a balance between defragmentation quality and the amount of allocations and bytes that need to be moved. + */ + DEFRAGMENTATION_FLAG_ALGORITHM_BALANCED = 0x2, + /** Perform full defragmentation of memory. + Can result in notably more time to compute and allocations to copy, but will achieve best memory packing. + */ + DEFRAGMENTATION_FLAG_ALGORITHM_FULL = 0x4, + + /// A bit mask to extract only `ALGORITHM` bits from entire set of flags. + DEFRAGMENTATION_FLAG_ALGORITHM_MASK = + DEFRAGMENTATION_FLAG_ALGORITHM_FAST | + DEFRAGMENTATION_FLAG_ALGORITHM_BALANCED | + DEFRAGMENTATION_FLAG_ALGORITHM_FULL +}; + +/** \brief Parameters for defragmentation. + +To be used with functions Allocator::BeginDefragmentation() and Pool::BeginDefragmentation(). +*/ +struct DEFRAGMENTATION_DESC +{ + /// Flags. + DEFRAGMENTATION_FLAGS Flags; + /** \brief Maximum numbers of bytes that can be copied during single pass, while moving allocations to different places. + + 0 means no limit. + */ + UINT64 MaxBytesPerPass; + /** \brief Maximum number of allocations that can be moved during single pass to a different place. + + 0 means no limit. + */ + UINT32 MaxAllocationsPerPass; +}; + +/// Operation performed on single defragmentation move. +enum DEFRAGMENTATION_MOVE_OPERATION +{ + /** Resource has been recreated at `pDstTmpAllocation`, data has been copied, old resource has been destroyed. + `pSrcAllocation` will be changed to point to the new place. This is the default value set by DefragmentationContext::BeginPass(). + */ + DEFRAGMENTATION_MOVE_OPERATION_COPY = 0, + /// Set this value if you cannot move the allocation. New place reserved at `pDstTmpAllocation` will be freed. `pSrcAllocation` will remain unchanged. + DEFRAGMENTATION_MOVE_OPERATION_IGNORE = 1, + /// Set this value if you decide to abandon the allocation and you destroyed the resource. New place reserved `pDstTmpAllocation` will be freed, along with `pSrcAllocation`. + DEFRAGMENTATION_MOVE_OPERATION_DESTROY = 2, +}; + +/// Single move of an allocation to be done for defragmentation. +struct DEFRAGMENTATION_MOVE +{ + /** \brief Operation to be performed on the allocation by DefragmentationContext::EndPass(). + Default value is #DEFRAGMENTATION_MOVE_OPERATION_COPY. You can modify it. + */ + DEFRAGMENTATION_MOVE_OPERATION Operation; + /// %Allocation that should be moved. + Allocation* pSrcAllocation; + /** \brief Temporary allocation pointing to destination memory that will replace `pSrcAllocation`. + + Use it to retrieve new `ID3D12Heap` and offset to create new `ID3D12Resource` and then store it here via Allocation::SetResource(). + + \warning Do not store this allocation in your data structures! It exists only temporarily, for the duration of the defragmentation pass, + to be used for storing newly created resource. DefragmentationContext::EndPass() will destroy it and make `pSrcAllocation` point to this memory. + */ + Allocation* pDstTmpAllocation; +}; + +/** \brief Parameters for incremental defragmentation steps. + +To be used with function DefragmentationContext::BeginPass(). +*/ +struct DEFRAGMENTATION_PASS_MOVE_INFO +{ + /// Number of elements in the `pMoves` array. + UINT32 MoveCount; + /** \brief Array of moves to be performed by the user in the current defragmentation pass. + + Pointer to an array of `MoveCount` elements, owned by %D3D12MA, created in DefragmentationContext::BeginPass(), destroyed in DefragmentationContext::EndPass(). + + For each element, you should: + + 1. Create a new resource in the place pointed by `pMoves[i].pDstTmpAllocation->GetHeap()` + `pMoves[i].pDstTmpAllocation->GetOffset()`. + 2. Store new resource in `pMoves[i].pDstTmpAllocation` by using Allocation::SetResource(). It will later replace old resource from `pMoves[i].pSrcAllocation`. + 3. Copy data from the `pMoves[i].pSrcAllocation` e.g. using `D3D12GraphicsCommandList::CopyResource`. + 4. Make sure these commands finished executing on the GPU. + + Only then you can finish defragmentation pass by calling DefragmentationContext::EndPass(). + After this call, the allocation will point to the new place in memory. + + Alternatively, if you cannot move specific allocation, + you can set DEFRAGMENTATION_MOVE::Operation to D3D12MA::DEFRAGMENTATION_MOVE_OPERATION_IGNORE. + + Alternatively, if you decide you want to completely remove the allocation, + set DEFRAGMENTATION_MOVE::Operation to D3D12MA::DEFRAGMENTATION_MOVE_OPERATION_DESTROY. + Then, after DefragmentationContext::EndPass() the allocation will be released. + */ + DEFRAGMENTATION_MOVE* pMoves; +}; + +/// %Statistics returned for defragmentation process by function DefragmentationContext::GetStats(). +struct DEFRAGMENTATION_STATS +{ + /// Total number of bytes that have been copied while moving allocations to different places. + UINT64 BytesMoved; + /// Total number of bytes that have been released to the system by freeing empty heaps. + UINT64 BytesFreed; + /// Number of allocations that have been moved to different places. + UINT32 AllocationsMoved; + /// Number of empty `ID3D12Heap` objects that have been released to the system. + UINT32 HeapsFreed; +}; + +/** \brief Represents defragmentation process in progress. + +You can create this object using Allocator::BeginDefragmentation (for default pools) or +Pool::BeginDefragmentation (for a custom pool). +*/ +class D3D12MA_API DefragmentationContext : public IUnknownImpl +{ +public: + /** \brief Starts single defragmentation pass. + + \param[out] pPassInfo Computed informations for current pass. + \returns + - `S_OK` if no more moves are possible. Then you can omit call to DefragmentationContext::EndPass() and simply end whole defragmentation. + - `S_FALSE` if there are pending moves returned in `pPassInfo`. You need to perform them, call DefragmentationContext::EndPass(), + and then preferably try another pass with DefragmentationContext::BeginPass(). + */ + HRESULT BeginPass(DEFRAGMENTATION_PASS_MOVE_INFO* pPassInfo); + /** \brief Ends single defragmentation pass. + + \param pPassInfo Computed informations for current pass filled by DefragmentationContext::BeginPass() and possibly modified by you. + \return Returns `S_OK` if no more moves are possible or `S_FALSE` if more defragmentations are possible. + + Ends incremental defragmentation pass and commits all defragmentation moves from `pPassInfo`. + After this call: + + - %Allocation at `pPassInfo[i].pSrcAllocation` that had `pPassInfo[i].Operation ==` #DEFRAGMENTATION_MOVE_OPERATION_COPY + (which is the default) will be pointing to the new destination place. + - %Allocation at `pPassInfo[i].pSrcAllocation` that had `pPassInfo[i].operation ==` #DEFRAGMENTATION_MOVE_OPERATION_DESTROY + will be released. + + If no more moves are possible you can end whole defragmentation. + */ + HRESULT EndPass(DEFRAGMENTATION_PASS_MOVE_INFO* pPassInfo); + /** \brief Returns statistics of the defragmentation performed so far. + */ + void GetStats(DEFRAGMENTATION_STATS* pStats); + +protected: + void ReleaseThis() override; + +private: + friend class Pool; + friend class Allocator; + template<typename T> friend void D3D12MA_DELETE(const ALLOCATION_CALLBACKS&, T*); + + DefragmentationContextPimpl* m_Pimpl; + + DefragmentationContext(AllocatorPimpl* allocator, + const DEFRAGMENTATION_DESC& desc, + BlockVector* poolVector); + ~DefragmentationContext(); + + D3D12MA_CLASS_NO_COPY(DefragmentationContext) +}; + +/// \brief Bit flags to be used with POOL_DESC::Flags. +enum POOL_FLAGS +{ + /// Zero + POOL_FLAG_NONE = 0, + + /** \brief Enables alternative, linear allocation algorithm in this pool. + + Specify this flag to enable linear allocation algorithm, which always creates + new allocations after last one and doesn't reuse space from allocations freed in + between. It trades memory consumption for simplified algorithm and data + structure, which has better performance and uses less memory for metadata. + + By using this flag, you can achieve behavior of free-at-once, stack, + ring buffer, and double stack. + For details, see documentation chapter \ref linear_algorithm. + */ + POOL_FLAG_ALGORITHM_LINEAR = 0x1, + + /** \brief Optimization, allocate MSAA textures as committed resources always. + + Specify this flag to create MSAA textures with implicit heaps, as if they were created + with flag D3D12MA::ALLOCATION_FLAG_COMMITTED. Usage of this flags enables pool to create its heaps + on smaller alignment not suitable for MSAA textures. + */ + POOL_FLAG_MSAA_TEXTURES_ALWAYS_COMMITTED = 0x2, + + // Bit mask to extract only `ALGORITHM` bits from entire set of flags. + POOL_FLAG_ALGORITHM_MASK = POOL_FLAG_ALGORITHM_LINEAR +}; + +/// \brief Parameters of created D3D12MA::Pool object. To be used with D3D12MA::Allocator::CreatePool. +struct POOL_DESC +{ + /// Flags. + POOL_FLAGS Flags; + /** \brief The parameters of memory heap where allocations of this pool should be placed. + + In the simplest case, just fill it with zeros and set `Type` to one of: `D3D12_HEAP_TYPE_DEFAULT`, + `D3D12_HEAP_TYPE_UPLOAD`, `D3D12_HEAP_TYPE_READBACK`. Additional parameters can be used e.g. to utilize UMA. + */ + D3D12_HEAP_PROPERTIES HeapProperties; + /** \brief Heap flags to be used when allocating heaps of this pool. + + It should contain one of these values, depending on type of resources you are going to create in this heap: + `D3D12_HEAP_FLAG_ALLOW_ONLY_BUFFERS`, + `D3D12_HEAP_FLAG_ALLOW_ONLY_NON_RT_DS_TEXTURES`, + `D3D12_HEAP_FLAG_ALLOW_ONLY_RT_DS_TEXTURES`. + Except if ResourceHeapTier = 2, then it may be `D3D12_HEAP_FLAG_ALLOW_ALL_BUFFERS_AND_TEXTURES` = 0. + + You can specify additional flags if needed. + */ + D3D12_HEAP_FLAGS HeapFlags; + /** \brief Size of a single heap (memory block) to be allocated as part of this pool, in bytes. Optional. + + Specify nonzero to set explicit, constant size of memory blocks used by this pool. + Leave 0 to use default and let the library manage block sizes automatically. + Then sizes of particular blocks may vary. + */ + UINT64 BlockSize; + /** \brief Minimum number of heaps (memory blocks) to be always allocated in this pool, even if they stay empty. Optional. + + Set to 0 to have no preallocated blocks and allow the pool be completely empty. + */ + UINT MinBlockCount; + /** \brief Maximum number of heaps (memory blocks) that can be allocated in this pool. Optional. + + Set to 0 to use default, which is `UINT64_MAX`, which means no limit. + + Set to same value as D3D12MA::POOL_DESC::MinBlockCount to have fixed amount of memory allocated + throughout whole lifetime of this pool. + */ + UINT MaxBlockCount; + /** \brief Additional minimum alignment to be used for all allocations created from this pool. Can be 0. + + Leave 0 (default) not to impose any additional alignment. If not 0, it must be a power of two. + */ + UINT64 MinAllocationAlignment; + /** \brief Additional parameter allowing pool to create resources with passed protected session. + + If not null then all the heaps and committed resources will be created with this parameter. + Valid only if ID3D12Device4 interface is present in current Windows SDK! + */ + ID3D12ProtectedResourceSession* pProtectedSession; + /** \brief Residency priority to be set for all allocations made in this pool. Optional. + + Set this parameter to one of the possible enum values e.g. `D3D12_RESIDENCY_PRIORITY_HIGH` + to apply specific residency priority to all allocations made in this pool: + `ID3D12Heap` memory blocks used to sub-allocate for placed resources, as well as + committed resources or heaps created when D3D12MA::ALLOCATION_FLAG_COMMITTED is used. + This can increase/decrease chance that the memory will be pushed out from VRAM + to system RAM when the system runs out of memory, which is invisible to the developer + using D3D12 API while it can degrade performance. + + Priority is set using function `ID3D12Device1::SetResidencyPriority`. + It is performed only when `ID3D12Device1` interface is defined and successfully obtained. + Otherwise, this parameter is ignored. + + This parameter is optional. If you set it to `D3D12_RESIDENCY_PRIORITY(0)`, + residency priority will not be set for allocations made in this pool. + + There is no equivalent parameter for allocations made in default pools. + If you want to set residency priority for such allocation, you need to do it manually: + allocate with D3D12MA::ALLOCATION_FLAG_COMMITTED and call + `ID3D12Device1::SetResidencyPriority`, passing `allocation->GetResource()`. + */ + D3D12_RESIDENCY_PRIORITY ResidencyPriority; +}; + +/** \brief Custom memory pool + +Represents a separate set of heaps (memory blocks) that can be used to create +D3D12MA::Allocation-s and resources in it. Usually there is no need to create custom +pools - creating resources in default pool is sufficient. + +To create custom pool, fill D3D12MA::POOL_DESC and call D3D12MA::Allocator::CreatePool. +*/ +class D3D12MA_API Pool : public IUnknownImpl +{ +public: + /** \brief Returns copy of parameters of the pool. + + These are the same parameters as passed to D3D12MA::Allocator::CreatePool. + */ + POOL_DESC GetDesc() const; + + /** \brief Retrieves basic statistics of the custom pool that are fast to calculate. + + \param[out] pStats %Statistics of the current pool. + */ + void GetStatistics(Statistics* pStats); + + /** \brief Retrieves detailed statistics of the custom pool that are slower to calculate. + + \param[out] pStats %Statistics of the current pool. + */ + void CalculateStatistics(DetailedStatistics* pStats); + + /** \brief Associates a name with the pool. This name is for use in debug diagnostics and tools. + + Internal copy of the string is made, so the memory pointed by the argument can be + changed of freed immediately after this call. + + `Name` can be NULL. + */ + void SetName(LPCWSTR Name); + + /** \brief Returns the name associated with the pool object. + + Returned string points to an internal copy. + + If no name was associated with the allocation, returns NULL. + */ + LPCWSTR GetName() const; + + /** \brief Begins defragmentation process of the current pool. + + \param pDesc Structure filled with parameters of defragmentation. + \param[out] ppContext Context object that will manage defragmentation. + \returns + - `S_OK` if defragmentation can begin. + - `E_NOINTERFACE` if defragmentation is not supported. + + For more information about defragmentation, see documentation chapter: + [Defragmentation](@ref defragmentation). + */ + HRESULT BeginDefragmentation(const DEFRAGMENTATION_DESC* pDesc, DefragmentationContext** ppContext); + +protected: + void ReleaseThis() override; + +private: + friend class Allocator; + friend class AllocatorPimpl; + template<typename T> friend void D3D12MA_DELETE(const ALLOCATION_CALLBACKS&, T*); + + PoolPimpl* m_Pimpl; + + Pool(Allocator* allocator, const POOL_DESC &desc); + ~Pool(); + + D3D12MA_CLASS_NO_COPY(Pool) +}; + + +/// \brief Bit flags to be used with ALLOCATOR_DESC::Flags. +enum ALLOCATOR_FLAGS +{ + /// Zero + ALLOCATOR_FLAG_NONE = 0, + + /** + Allocator and all objects created from it will not be synchronized internally, + so you must guarantee they are used from only one thread at a time or + synchronized by you. + + Using this flag may increase performance because internal mutexes are not used. + */ + ALLOCATOR_FLAG_SINGLETHREADED = 0x1, + + /** + Every allocation will have its own memory block. + To be used for debugging purposes. + */ + ALLOCATOR_FLAG_ALWAYS_COMMITTED = 0x2, + + /** + Heaps created for the default pools will be created with flag `D3D12_HEAP_FLAG_CREATE_NOT_ZEROED`, + allowing for their memory to be not zeroed by the system if possible, + which can speed up allocation. + + Only affects default pools. + To use the flag with @ref custom_pools, you need to add it manually: + + \code + poolDesc.heapFlags |= D3D12_HEAP_FLAG_CREATE_NOT_ZEROED; + \endcode + + Only avaiable if `ID3D12Device8` is present. Otherwise, the flag is ignored. + */ + ALLOCATOR_FLAG_DEFAULT_POOLS_NOT_ZEROED = 0x4, + + /** \brief Optimization, allocate MSAA textures as committed resources always. + + Specify this flag to create MSAA textures with implicit heaps, as if they were created + with flag D3D12MA::ALLOCATION_FLAG_COMMITTED. Usage of this flags enables all default pools + to create its heaps on smaller alignment not suitable for MSAA textures. + */ + ALLOCATOR_FLAG_MSAA_TEXTURES_ALWAYS_COMMITTED = 0x8, +}; + +/// \brief Parameters of created Allocator object. To be used with CreateAllocator(). +struct ALLOCATOR_DESC +{ + /// Flags. + ALLOCATOR_FLAGS Flags; + + /** Direct3D device object that the allocator should be attached to. + + Allocator is doing `AddRef`/`Release` on this object. + */ + ID3D12Device* pDevice; + + /** \brief Preferred size of a single `ID3D12Heap` block to be allocated. + + Set to 0 to use default, which is currently 64 MiB. + */ + UINT64 PreferredBlockSize; + + /** \brief Custom CPU memory allocation callbacks. Optional. + + Optional, can be null. When specified, will be used for all CPU-side memory allocations. + */ + const ALLOCATION_CALLBACKS* pAllocationCallbacks; + + /** DXGI Adapter object that you use for D3D12 and this allocator. + + Allocator is doing `AddRef`/`Release` on this object. + */ + IDXGIAdapter* pAdapter; +}; + +/** +\brief Represents main object of this library initialized for particular `ID3D12Device`. + +Fill structure D3D12MA::ALLOCATOR_DESC and call function CreateAllocator() to create it. +Call method `Release()` to destroy it. + +It is recommended to create just one object of this type per `ID3D12Device` object, +right after Direct3D 12 is initialized and keep it alive until before Direct3D device is destroyed. +*/ +class D3D12MA_API Allocator : public IUnknownImpl +{ +public: + /// Returns cached options retrieved from D3D12 device. + const D3D12_FEATURE_DATA_D3D12_OPTIONS& GetD3D12Options() const; + /** \brief Returns true if `D3D12_FEATURE_DATA_ARCHITECTURE1::UMA` was found to be true. + + For more information about how to use it, see articles in Microsoft Docs articles: + + - "UMA Optimizations: CPU Accessible Textures and Standard Swizzle" + - "D3D12_FEATURE_DATA_ARCHITECTURE structure (d3d12.h)" + - "ID3D12Device::GetCustomHeapProperties method (d3d12.h)" + */ + BOOL IsUMA() const; + /** \brief Returns true if `D3D12_FEATURE_DATA_ARCHITECTURE1::CacheCoherentUMA` was found to be true. + + For more information about how to use it, see articles in Microsoft Docs articles: + + - "UMA Optimizations: CPU Accessible Textures and Standard Swizzle" + - "D3D12_FEATURE_DATA_ARCHITECTURE structure (d3d12.h)" + - "ID3D12Device::GetCustomHeapProperties method (d3d12.h)" + */ + BOOL IsCacheCoherentUMA() const; + /** \brief Returns total amount of memory of specific segment group, in bytes. + + \param memorySegmentGroup use `DXGI_MEMORY_SEGMENT_GROUP_LOCAL` or DXGI_MEMORY_SEGMENT_GROUP_NON_LOCAL`. + + This information is taken from `DXGI_ADAPTER_DESC`. + It is not recommended to use this number. + You should preferably call GetBudget() and limit memory usage to D3D12MA::Budget::BudgetBytes instead. + + - When IsUMA() `== FALSE` (discrete graphics card): + - `GetMemoryCapacity(DXGI_MEMORY_SEGMENT_GROUP_LOCAL)` returns the size of the video memory. + - `GetMemoryCapacity(DXGI_MEMORY_SEGMENT_GROUP_NON_LOCAL)` returns the size of the system memory available for D3D12 resources. + - When IsUMA() `== TRUE` (integrated graphics chip): + - `GetMemoryCapacity(DXGI_MEMORY_SEGMENT_GROUP_LOCAL)` returns the size of the shared memory available for all D3D12 resources. + All memory is considered "local". + - `GetMemoryCapacity(DXGI_MEMORY_SEGMENT_GROUP_NON_LOCAL)` is not applicable and returns 0. + */ + UINT64 GetMemoryCapacity(UINT memorySegmentGroup) const; + + /** \brief Allocates memory and creates a D3D12 resource (buffer or texture). This is the main allocation function. + + The function is similar to `ID3D12Device::CreateCommittedResource`, but it may + really call `ID3D12Device::CreatePlacedResource` to assign part of a larger, + existing memory heap to the new resource, which is the main purpose of this + whole library. + + If `ppvResource` is null, you receive only `ppAllocation` object from this function. + It holds pointer to `ID3D12Resource` that can be queried using function D3D12MA::Allocation::GetResource(). + Reference count of the resource object is 1. + It is automatically destroyed when you destroy the allocation object. + + If `ppvResource` is not null, you receive pointer to the resource next to allocation object. + Reference count of the resource object is then increased by calling `QueryInterface`, so you need to manually `Release` it + along with the allocation. + + \param pAllocDesc Parameters of the allocation. + \param pResourceDesc Description of created resource. + \param InitialResourceState Initial resource state. + \param pOptimizedClearValue Optional. Either null or optimized clear value. + \param[out] ppAllocation Filled with pointer to new allocation object created. + \param riidResource IID of a resource to be returned via `ppvResource`. + \param[out] ppvResource Optional. If not null, filled with pointer to new resouce created. + + \note This function creates a new resource. Sub-allocation of parts of one large buffer, + although recommended as a good practice, is out of scope of this library and could be implemented + by the user as a higher-level logic on top of it, e.g. using the \ref virtual_allocator feature. + */ + HRESULT CreateResource( + const ALLOCATION_DESC* pAllocDesc, + const D3D12_RESOURCE_DESC* pResourceDesc, + D3D12_RESOURCE_STATES InitialResourceState, + const D3D12_CLEAR_VALUE *pOptimizedClearValue, + Allocation** ppAllocation, + REFIID riidResource, + void** ppvResource); + +#ifdef __ID3D12Device8_INTERFACE_DEFINED__ + /** \brief Similar to Allocator::CreateResource, but supports new structure `D3D12_RESOURCE_DESC1`. + + It internally uses `ID3D12Device8::CreateCommittedResource2` or `ID3D12Device8::CreatePlacedResource1`. + + To work correctly, `ID3D12Device8` interface must be available in the current system. Otherwise, `E_NOINTERFACE` is returned. + */ + HRESULT CreateResource2( + const ALLOCATION_DESC* pAllocDesc, + const D3D12_RESOURCE_DESC1* pResourceDesc, + D3D12_RESOURCE_STATES InitialResourceState, + const D3D12_CLEAR_VALUE *pOptimizedClearValue, + Allocation** ppAllocation, + REFIID riidResource, + void** ppvResource); +#endif // #ifdef __ID3D12Device8_INTERFACE_DEFINED__ + +#ifdef __ID3D12Device10_INTERFACE_DEFINED__ + /** \brief Similar to Allocator::CreateResource2, but there are initial layout instead of state and + castable formats list + + It internally uses `ID3D12Device10::CreateCommittedResource3` or `ID3D12Device10::CreatePlacedResource2`. + + To work correctly, `ID3D12Device10` interface must be available in the current system. Otherwise, `E_NOINTERFACE` is returned. + */ + HRESULT CreateResource3(const ALLOCATION_DESC* pAllocDesc, + const D3D12_RESOURCE_DESC1* pResourceDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + const D3D12_CLEAR_VALUE* pOptimizedClearValue, + UINT32 NumCastableFormats, + DXGI_FORMAT* pCastableFormats, + Allocation** ppAllocation, + REFIID riidResource, + void** ppvResource); +#endif // #ifdef __ID3D12Device10_INTERFACE_DEFINED__ + + /** \brief Allocates memory without creating any resource placed in it. + + This function is similar to `ID3D12Device::CreateHeap`, but it may really assign + part of a larger, existing heap to the allocation. + + `pAllocDesc->heapFlags` should contain one of these values, depending on type of resources you are going to create in this memory: + `D3D12_HEAP_FLAG_ALLOW_ONLY_BUFFERS`, + `D3D12_HEAP_FLAG_ALLOW_ONLY_NON_RT_DS_TEXTURES`, + `D3D12_HEAP_FLAG_ALLOW_ONLY_RT_DS_TEXTURES`. + Except if you validate that ResourceHeapTier = 2 - then `heapFlags` + may be `D3D12_HEAP_FLAG_ALLOW_ALL_BUFFERS_AND_TEXTURES` = 0. + Additional flags in `heapFlags` are allowed as well. + + `pAllocInfo->SizeInBytes` must be multiply of 64KB. + `pAllocInfo->Alignment` must be one of the legal values as described in documentation of `D3D12_HEAP_DESC`. + + If you use D3D12MA::ALLOCATION_FLAG_COMMITTED you will get a separate memory block - + a heap that always has offset 0. + */ + HRESULT AllocateMemory( + const ALLOCATION_DESC* pAllocDesc, + const D3D12_RESOURCE_ALLOCATION_INFO* pAllocInfo, + Allocation** ppAllocation); + + /** \brief Creates a new resource in place of an existing allocation. This is useful for memory aliasing. + + \param pAllocation Existing allocation indicating the memory where the new resource should be created. + It can be created using D3D12MA::Allocator::CreateResource and already have a resource bound to it, + or can be a raw memory allocated with D3D12MA::Allocator::AllocateMemory. + It must not be created as committed so that `ID3D12Heap` is available and not implicit. + \param AllocationLocalOffset Additional offset in bytes to be applied when allocating the resource. + Local from the start of `pAllocation`, not the beginning of the whole `ID3D12Heap`! + If the new resource should start from the beginning of the `pAllocation` it should be 0. + \param pResourceDesc Description of the new resource to be created. + \param InitialResourceState + \param pOptimizedClearValue + \param riidResource + \param[out] ppvResource Returns pointer to the new resource. + The resource is not bound with `pAllocation`. + This pointer must not be null - you must get the resource pointer and `Release` it when no longer needed. + + Memory requirements of the new resource are checked for validation. + If its size exceeds the end of `pAllocation` or required alignment is not fulfilled + considering `pAllocation->GetOffset() + AllocationLocalOffset`, the function + returns `E_INVALIDARG`. + */ + HRESULT CreateAliasingResource( + Allocation* pAllocation, + UINT64 AllocationLocalOffset, + const D3D12_RESOURCE_DESC* pResourceDesc, + D3D12_RESOURCE_STATES InitialResourceState, + const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riidResource, + void** ppvResource); + +#ifdef __ID3D12Device8_INTERFACE_DEFINED__ + /** \brief Similar to Allocator::CreateAliasingResource, but supports new structure `D3D12_RESOURCE_DESC1`. + + It internally uses `ID3D12Device8::CreatePlacedResource1`. + + To work correctly, `ID3D12Device8` interface must be available in the current system. Otherwise, `E_NOINTERFACE` is returned. + */ + HRESULT CreateAliasingResource1(Allocation* pAllocation, + UINT64 AllocationLocalOffset, + const D3D12_RESOURCE_DESC1* pResourceDesc, + D3D12_RESOURCE_STATES InitialResourceState, + const D3D12_CLEAR_VALUE* pOptimizedClearValue, + REFIID riidResource, + void** ppvResource); +#endif // #ifdef __ID3D12Device8_INTERFACE_DEFINED__ + +#ifdef __ID3D12Device10_INTERFACE_DEFINED__ + /** \brief Similar to Allocator::CreateAliasingResource1, but there are initial layout instead of state and + castable formats list + + It internally uses `ID3D12Device10::CreatePlacedResource2`. + + To work correctly, `ID3D12Device10` interface must be available in the current system. Otherwise, `E_NOINTERFACE` is returned. + */ + HRESULT CreateAliasingResource2(Allocation* pAllocation, + UINT64 AllocationLocalOffset, + const D3D12_RESOURCE_DESC1* pResourceDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + const D3D12_CLEAR_VALUE* pOptimizedClearValue, + UINT32 NumCastableFormats, + DXGI_FORMAT* pCastableFormats, + REFIID riidResource, + void** ppvResource); +#endif // #ifdef __ID3D12Device10_INTERFACE_DEFINED__ + + /** \brief Creates custom pool. + */ + HRESULT CreatePool( + const POOL_DESC* pPoolDesc, + Pool** ppPool); + + /** \brief Sets the index of the current frame. + + This function is used to set the frame index in the allocator when a new game frame begins. + */ + void SetCurrentFrameIndex(UINT frameIndex); + + /** \brief Retrieves information about current memory usage and budget. + + \param[out] pLocalBudget Optional, can be null. + \param[out] pNonLocalBudget Optional, can be null. + + - When IsUMA() `== FALSE` (discrete graphics card): + - `pLocalBudget` returns the budget of the video memory. + - `pNonLocalBudget` returns the budget of the system memory available for D3D12 resources. + - When IsUMA() `== TRUE` (integrated graphics chip): + - `pLocalBudget` returns the budget of the shared memory available for all D3D12 resources. + All memory is considered "local". + - `pNonLocalBudget` is not applicable and returns zeros. + + This function is called "get" not "calculate" because it is very fast, suitable to be called + every frame or every allocation. For more detailed statistics use CalculateStatistics(). + + Note that when using allocator from multiple threads, returned information may immediately + become outdated. + */ + void GetBudget(Budget* pLocalBudget, Budget* pNonLocalBudget); + + /** \brief Retrieves statistics from current state of the allocator. + + This function is called "calculate" not "get" because it has to traverse all + internal data structures, so it may be quite slow. Use it for debugging purposes. + For faster but more brief statistics suitable to be called every frame or every allocation, + use GetBudget(). + + Note that when using allocator from multiple threads, returned information may immediately + become outdated. + */ + void CalculateStatistics(TotalStatistics* pStats); + + /** \brief Builds and returns statistics as a string in JSON format. + * + @param[out] ppStatsString Must be freed using Allocator::FreeStatsString. + @param DetailedMap `TRUE` to include full list of allocations (can make the string quite long), `FALSE` to only return statistics. + */ + void BuildStatsString(WCHAR** ppStatsString, BOOL DetailedMap) const; + + /// Frees memory of a string returned from Allocator::BuildStatsString. + void FreeStatsString(WCHAR* pStatsString) const; + + /** \brief Begins defragmentation process of the default pools. + + \param pDesc Structure filled with parameters of defragmentation. + \param[out] ppContext Context object that will manage defragmentation. + + For more information about defragmentation, see documentation chapter: + [Defragmentation](@ref defragmentation). + */ + void BeginDefragmentation(const DEFRAGMENTATION_DESC* pDesc, DefragmentationContext** ppContext); + +protected: + void ReleaseThis() override; + +private: + friend D3D12MA_API HRESULT CreateAllocator(const ALLOCATOR_DESC*, Allocator**); + template<typename T> friend void D3D12MA_DELETE(const ALLOCATION_CALLBACKS&, T*); + friend class DefragmentationContext; + friend class Pool; + + Allocator(const ALLOCATION_CALLBACKS& allocationCallbacks, const ALLOCATOR_DESC& desc); + ~Allocator(); + + AllocatorPimpl* m_Pimpl; + + D3D12MA_CLASS_NO_COPY(Allocator) +}; + + +/// \brief Bit flags to be used with VIRTUAL_BLOCK_DESC::Flags. +enum VIRTUAL_BLOCK_FLAGS +{ + /// Zero + VIRTUAL_BLOCK_FLAG_NONE = 0, + + /** \brief Enables alternative, linear allocation algorithm in this virtual block. + + Specify this flag to enable linear allocation algorithm, which always creates + new allocations after last one and doesn't reuse space from allocations freed in + between. It trades memory consumption for simplified algorithm and data + structure, which has better performance and uses less memory for metadata. + + By using this flag, you can achieve behavior of free-at-once, stack, + ring buffer, and double stack. + For details, see documentation chapter \ref linear_algorithm. + */ + VIRTUAL_BLOCK_FLAG_ALGORITHM_LINEAR = POOL_FLAG_ALGORITHM_LINEAR, + + // Bit mask to extract only `ALGORITHM` bits from entire set of flags. + VIRTUAL_BLOCK_FLAG_ALGORITHM_MASK = POOL_FLAG_ALGORITHM_MASK +}; + +/// Parameters of created D3D12MA::VirtualBlock object to be passed to CreateVirtualBlock(). +struct VIRTUAL_BLOCK_DESC +{ + /// Flags. + VIRTUAL_BLOCK_FLAGS Flags; + /** \brief Total size of the block. + + Sizes can be expressed in bytes or any units you want as long as you are consistent in using them. + For example, if you allocate from some array of structures, 1 can mean single instance of entire structure. + */ + UINT64 Size; + /** \brief Custom CPU memory allocation callbacks. Optional. + + Optional, can be null. When specified, will be used for all CPU-side memory allocations. + */ + const ALLOCATION_CALLBACKS* pAllocationCallbacks; +}; + +/// \brief Bit flags to be used with VIRTUAL_ALLOCATION_DESC::Flags. +enum VIRTUAL_ALLOCATION_FLAGS +{ + /// Zero + VIRTUAL_ALLOCATION_FLAG_NONE = 0, + + /** \brief Allocation will be created from upper stack in a double stack pool. + + This flag is only allowed for virtual blocks created with #VIRTUAL_BLOCK_FLAG_ALGORITHM_LINEAR flag. + */ + VIRTUAL_ALLOCATION_FLAG_UPPER_ADDRESS = ALLOCATION_FLAG_UPPER_ADDRESS, + + /// Allocation strategy that tries to minimize memory usage. + VIRTUAL_ALLOCATION_FLAG_STRATEGY_MIN_MEMORY = ALLOCATION_FLAG_STRATEGY_MIN_MEMORY, + /// Allocation strategy that tries to minimize allocation time. + VIRTUAL_ALLOCATION_FLAG_STRATEGY_MIN_TIME = ALLOCATION_FLAG_STRATEGY_MIN_TIME, + /** \brief Allocation strategy that chooses always the lowest offset in available space. + This is not the most efficient strategy but achieves highly packed data. + */ + VIRTUAL_ALLOCATION_FLAG_STRATEGY_MIN_OFFSET = ALLOCATION_FLAG_STRATEGY_MIN_OFFSET, + /** \brief A bit mask to extract only `STRATEGY` bits from entire set of flags. + + These strategy flags are binary compatible with equivalent flags in #ALLOCATION_FLAGS. + */ + VIRTUAL_ALLOCATION_FLAG_STRATEGY_MASK = ALLOCATION_FLAG_STRATEGY_MASK, +}; + +/// Parameters of created virtual allocation to be passed to VirtualBlock::Allocate(). +struct VIRTUAL_ALLOCATION_DESC +{ + /// Flags. + VIRTUAL_ALLOCATION_FLAGS Flags; + /** \brief Size of the allocation. + + Cannot be zero. + */ + UINT64 Size; + /** \brief Required alignment of the allocation. + + Must be power of two. Special value 0 has the same meaning as 1 - means no special alignment is required, so allocation can start at any offset. + */ + UINT64 Alignment; + /** \brief Custom pointer to be associated with the allocation. + + It can be fetched or changed later. + */ + void* pPrivateData; +}; + +/// Parameters of an existing virtual allocation, returned by VirtualBlock::GetAllocationInfo(). +struct VIRTUAL_ALLOCATION_INFO +{ + /// \brief Offset of the allocation. + UINT64 Offset; + /** \brief Size of the allocation. + + Same value as passed in VIRTUAL_ALLOCATION_DESC::Size. + */ + UINT64 Size; + /** \brief Custom pointer associated with the allocation. + + Same value as passed in VIRTUAL_ALLOCATION_DESC::pPrivateData or VirtualBlock::SetAllocationPrivateData(). + */ + void* pPrivateData; +}; + +/** \brief Represents pure allocation algorithm and a data structure with allocations in some memory block, without actually allocating any GPU memory. + +This class allows to use the core algorithm of the library custom allocations e.g. CPU memory or +sub-allocation regions inside a single GPU buffer. + +To create this object, fill in D3D12MA::VIRTUAL_BLOCK_DESC and call CreateVirtualBlock(). +To destroy it, call its method `VirtualBlock::Release()`. +You need to free all the allocations within this block or call Clear() before destroying it. + +This object is not thread-safe - should not be used from multiple threads simultaneously, must be synchronized externally. +*/ +class D3D12MA_API VirtualBlock : public IUnknownImpl +{ +public: + /** \brief Returns true if the block is empty - contains 0 allocations. + */ + BOOL IsEmpty() const; + /** \brief Returns information about an allocation - its offset, size and custom pointer. + */ + void GetAllocationInfo(VirtualAllocation allocation, VIRTUAL_ALLOCATION_INFO* pInfo) const; + + /** \brief Creates new allocation. + \param pDesc + \param[out] pAllocation Unique indentifier of the new allocation within single block. + \param[out] pOffset Returned offset of the new allocation. Optional, can be null. + \return `S_OK` if allocation succeeded, `E_OUTOFMEMORY` if it failed. + + If the allocation failed, `pAllocation->AllocHandle` is set to 0 and `pOffset`, if not null, is set to `UINT64_MAX`. + */ + HRESULT Allocate(const VIRTUAL_ALLOCATION_DESC* pDesc, VirtualAllocation* pAllocation, UINT64* pOffset); + /** \brief Frees the allocation. + + Calling this function with `allocation.AllocHandle == 0` is correct and does nothing. + */ + void FreeAllocation(VirtualAllocation allocation); + /** \brief Frees all the allocations. + */ + void Clear(); + /** \brief Changes custom pointer for an allocation to a new value. + */ + void SetAllocationPrivateData(VirtualAllocation allocation, void* pPrivateData); + /** \brief Retrieves basic statistics of the virtual block that are fast to calculate. + + \param[out] pStats %Statistics of the virtual block. + */ + void GetStatistics(Statistics* pStats) const; + /** \brief Retrieves detailed statistics of the virtual block that are slower to calculate. + + \param[out] pStats %Statistics of the virtual block. + */ + void CalculateStatistics(DetailedStatistics* pStats) const; + + /** \brief Builds and returns statistics as a string in JSON format, including the list of allocations with their parameters. + @param[out] ppStatsString Must be freed using VirtualBlock::FreeStatsString. + */ + void BuildStatsString(WCHAR** ppStatsString) const; + + /** \brief Frees memory of a string returned from VirtualBlock::BuildStatsString. + */ + void FreeStatsString(WCHAR* pStatsString) const; + +protected: + void ReleaseThis() override; + +private: + friend D3D12MA_API HRESULT CreateVirtualBlock(const VIRTUAL_BLOCK_DESC*, VirtualBlock**); + template<typename T> friend void D3D12MA_DELETE(const ALLOCATION_CALLBACKS&, T*); + + VirtualBlockPimpl* m_Pimpl; + + VirtualBlock(const ALLOCATION_CALLBACKS& allocationCallbacks, const VIRTUAL_BLOCK_DESC& desc); + ~VirtualBlock(); + + D3D12MA_CLASS_NO_COPY(VirtualBlock) +}; + + +/** \brief Creates new main D3D12MA::Allocator object and returns it through `ppAllocator`. + +You normally only need to call it once and keep a single Allocator object for your `ID3D12Device`. +*/ +D3D12MA_API HRESULT CreateAllocator(const ALLOCATOR_DESC* pDesc, Allocator** ppAllocator); + +/** \brief Creates new D3D12MA::VirtualBlock object and returns it through `ppVirtualBlock`. + +Note you don't need to create D3D12MA::Allocator to use virtual blocks. +*/ +D3D12MA_API HRESULT CreateVirtualBlock(const VIRTUAL_BLOCK_DESC* pDesc, VirtualBlock** ppVirtualBlock); + +} // namespace D3D12MA + +/// \cond INTERNAL +DEFINE_ENUM_FLAG_OPERATORS(D3D12MA::ALLOCATION_FLAGS); +DEFINE_ENUM_FLAG_OPERATORS(D3D12MA::DEFRAGMENTATION_FLAGS); +DEFINE_ENUM_FLAG_OPERATORS(D3D12MA::ALLOCATOR_FLAGS); +DEFINE_ENUM_FLAG_OPERATORS(D3D12MA::POOL_FLAGS); +DEFINE_ENUM_FLAG_OPERATORS(D3D12MA::VIRTUAL_BLOCK_FLAGS); +DEFINE_ENUM_FLAG_OPERATORS(D3D12MA::VIRTUAL_ALLOCATION_FLAGS); +/// \endcond + +/** +\page quick_start Quick start + +\section quick_start_project_setup Project setup and initialization + +This is a small, standalone C++ library. It consists of a pair of 2 files: +"D3D12MemAlloc.h" header file with public interface and "D3D12MemAlloc.cpp" with +internal implementation. The only external dependencies are WinAPI, Direct3D 12, +and parts of C/C++ standard library (but STL containers, exceptions, or RTTI are +not used). + +The library is developed and tested using Microsoft Visual Studio 2019, but it +should work with other compilers as well. It is designed for 64-bit code. + +To use the library in your project: + +(1.) Copy files `D3D12MemAlloc.cpp`, `%D3D12MemAlloc.h` to your project. + +(2.) Make `D3D12MemAlloc.cpp` compiling as part of the project, as C++ code. + +(3.) Include library header in each CPP file that needs to use the library. + +\code +#include "D3D12MemAlloc.h" +\endcode + +(4.) Right after you created `ID3D12Device`, fill D3D12MA::ALLOCATOR_DESC +structure and call function D3D12MA::CreateAllocator to create the main +D3D12MA::Allocator object. + +Please note that all symbols of the library are declared inside #D3D12MA namespace. + +\code +IDXGIAdapter* adapter = (...) +ID3D12Device* device = (...) + +D3D12MA::ALLOCATOR_DESC allocatorDesc = {}; +allocatorDesc.pDevice = device; +allocatorDesc.pAdapter = adapter; + +D3D12MA::Allocator* allocator; +HRESULT hr = D3D12MA::CreateAllocator(&allocatorDesc, &allocator); +\endcode + +(5.) Right before destroying the D3D12 device, destroy the allocator object. + +Objects of this library must be destroyed by calling `Release` method. +They are somewhat compatible with COM: they implement `IUnknown` interface with its virtual methods: `AddRef`, `Release`, `QueryInterface`, +and they are reference-counted internally. +You can use smart pointers designed for COM with objects of this library - e.g. `CComPtr` or `Microsoft::WRL::ComPtr`. +The reference counter is thread-safe. +`QueryInterface` method supports only `IUnknown`, as classes of this library don't define their own GUIDs. + +\code +allocator->Release(); +\endcode + + +\section quick_start_creating_resources Creating resources + +To use the library for creating resources (textures and buffers), call method +D3D12MA::Allocator::CreateResource in the place where you would previously call +`ID3D12Device::CreateCommittedResource`. + +The function has similar syntax, but it expects structure D3D12MA::ALLOCATION_DESC +to be passed along with `D3D12_RESOURCE_DESC` and other parameters for created +resource. This structure describes parameters of the desired memory allocation, +including choice of `D3D12_HEAP_TYPE`. + +The function returns a new object of type D3D12MA::Allocation. +It represents allocated memory and can be queried for size, offset, `ID3D12Heap`. +It also holds a reference to the `ID3D12Resource`, which can be accessed by calling D3D12MA::Allocation::GetResource(). + +\code +D3D12_RESOURCE_DESC resourceDesc = {}; +resourceDesc.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D; +resourceDesc.Alignment = 0; +resourceDesc.Width = 1024; +resourceDesc.Height = 1024; +resourceDesc.DepthOrArraySize = 1; +resourceDesc.MipLevels = 1; +resourceDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; +resourceDesc.SampleDesc.Count = 1; +resourceDesc.SampleDesc.Quality = 0; +resourceDesc.Layout = D3D12_TEXTURE_LAYOUT_UNKNOWN; +resourceDesc.Flags = D3D12_RESOURCE_FLAG_NONE; + +D3D12MA::ALLOCATION_DESC allocationDesc = {}; +allocationDesc.HeapType = D3D12_HEAP_TYPE_DEFAULT; + +D3D12MA::Allocation* allocation; +HRESULT hr = allocator->CreateResource( + &allocationDesc, + &resourceDesc, + D3D12_RESOURCE_STATE_COPY_DEST, + NULL, + &allocation, + IID_NULL, NULL); + +// Use allocation->GetResource()... +\endcode + +You need to release the allocation object when no longer needed. +This will also release the D3D12 resource. + +\code +allocation->Release(); +\endcode + +The advantage of using the allocator instead of creating committed resource, and +the main purpose of this library, is that it can decide to allocate bigger memory +heap internally using `ID3D12Device::CreateHeap` and place multiple resources in +it, at different offsets, using `ID3D12Device::CreatePlacedResource`. The library +manages its own collection of allocated memory blocks (heaps) and remembers which +parts of them are occupied and which parts are free to be used for new resources. + +It is important to remember that resources created as placed don't have their memory +initialized to zeros, but may contain garbage data, so they need to be fully initialized +before usage, e.g. using Clear (`ClearRenderTargetView`), Discard (`DiscardResource`), +or copy (`CopyResource`). + +The library also automatically handles resource heap tier. +When `D3D12_FEATURE_DATA_D3D12_OPTIONS::ResourceHeapTier` equals `D3D12_RESOURCE_HEAP_TIER_1`, +resources of 3 types: buffers, textures that are render targets or depth-stencil, +and other textures must be kept in separate heaps. When `D3D12_RESOURCE_HEAP_TIER_2`, +they can be kept together. By using this library, you don't need to handle this +manually. + + +\section quick_start_resource_reference_counting Resource reference counting + +`ID3D12Resource` and other interfaces of Direct3D 12 use COM, so they are reference-counted. +Objects of this library are reference-counted as well. +An object of type D3D12MA::Allocation remembers the resource (buffer or texture) +that was created together with this memory allocation +and holds a reference to the `ID3D12Resource` object. +(Note this is a difference to Vulkan Memory Allocator, where a `VmaAllocation` object has no connection +with the buffer or image that was created with it.) +Thus, it is important to manage the resource reference counter properly. + +<b>The simplest use case</b> is shown in the code snippet above. +When only D3D12MA::Allocation object is obtained from a function call like D3D12MA::Allocator::CreateResource, +it remembers the `ID3D12Resource` that was created with it and holds a reference to it. +The resource can be obtained by calling `allocation->GetResource()`, which doesn't increment the resource +reference counter. +Calling `allocation->Release()` will decrease the resource reference counter, which is = 1 in this case, +so the resource will be released. + +<b>Second option</b> is to retrieve a pointer to the resource along with D3D12MA::Allocation. +Last parameters of the resource creation function can be used for this purpose. + +\code +D3D12MA::Allocation* allocation; +ID3D12Resource* resource; +HRESULT hr = allocator->CreateResource( + &allocationDesc, + &resourceDesc, + D3D12_RESOURCE_STATE_COPY_DEST, + NULL, + &allocation, + IID_PPV_ARGS(&resource)); + +// Use resource... +\endcode + +In this case, returned pointer `resource` is equal to `allocation->GetResource()`, +but the creation function additionally increases resource reference counter for the purpose of returning it from this call +(it actually calls `QueryInterface` internally), so the resource will have the counter = 2. +The resource then need to be released along with the allocation, in this particular order, +to make sure the resource is destroyed before its memory heap can potentially be freed. + +\code +resource->Release(); +allocation->Release(); +\endcode + +<b>More advanced use cases</b> are possible when we consider that an D3D12MA::Allocation object can just hold +a reference to any resource. +It can be changed by calling D3D12MA::Allocation::SetResource. This function +releases the old resource and calls `AddRef` on the new one. + +Special care must be taken when performing <b>defragmentation</b>. +The new resource created at the destination place should be set as `pass.pMoves[i].pDstTmpAllocation->SetResource(newRes)`, +but it is moved to the source allocation at end of the defragmentation pass, +while the old resource accessible through `pass.pMoves[i].pSrcAllocation->GetResource()` is then released. +For more information, see documentation chapter \ref defragmentation. + + +\section quick_start_mapping_memory Mapping memory + +The process of getting regular CPU-side pointer to the memory of a resource in +Direct3D is called "mapping". There are rules and restrictions to this process, +as described in D3D12 documentation of `ID3D12Resource::Map` method. + +Mapping happens on the level of particular resources, not entire memory heaps, +and so it is out of scope of this library. Just as the documentation of the `Map` function says: + +- Returned pointer refers to data of particular subresource, not entire memory heap. +- You can map same resource multiple times. It is ref-counted internally. +- Mapping is thread-safe. +- Unmapping is not required before resource destruction. +- Unmapping may not be required before using written data - some heap types on + some platforms support resources persistently mapped. + +When using this library, you can map and use your resources normally without +considering whether they are created as committed resources or placed resources in one large heap. + +Example for buffer created and filled in `UPLOAD` heap type: + +\code +const UINT64 bufSize = 65536; +const float* bufData = (...); + +D3D12_RESOURCE_DESC resourceDesc = {}; +resourceDesc.Dimension = D3D12_RESOURCE_DIMENSION_BUFFER; +resourceDesc.Alignment = 0; +resourceDesc.Width = bufSize; +resourceDesc.Height = 1; +resourceDesc.DepthOrArraySize = 1; +resourceDesc.MipLevels = 1; +resourceDesc.Format = DXGI_FORMAT_UNKNOWN; +resourceDesc.SampleDesc.Count = 1; +resourceDesc.SampleDesc.Quality = 0; +resourceDesc.Layout = D3D12_TEXTURE_LAYOUT_ROW_MAJOR; +resourceDesc.Flags = D3D12_RESOURCE_FLAG_NONE; + +D3D12MA::ALLOCATION_DESC allocationDesc = {}; +allocationDesc.HeapType = D3D12_HEAP_TYPE_UPLOAD; + +D3D12Resource* resource; +D3D12MA::Allocation* allocation; +HRESULT hr = allocator->CreateResource( + &allocationDesc, + &resourceDesc, + D3D12_RESOURCE_STATE_GENERIC_READ, + NULL, + &allocation, + IID_PPV_ARGS(&resource)); + +void* mappedPtr; +hr = resource->Map(0, NULL, &mappedPtr); + +memcpy(mappedPtr, bufData, bufSize); + +resource->Unmap(0, NULL); +\endcode + + +\page custom_pools Custom memory pools + +A "pool" is a collection of memory blocks that share certain properties. +Allocator creates 3 default pools: for `D3D12_HEAP_TYPE_DEFAULT`, `UPLOAD`, `READBACK`. +A default pool automatically grows in size. Size of allocated blocks is also variable and managed automatically. +Typical allocations are created in these pools. You can also create custom pools. + +\section custom_pools_usage Usage + +To create a custom pool, fill in structure D3D12MA::POOL_DESC and call function D3D12MA::Allocator::CreatePool +to obtain object D3D12MA::Pool. Example: + +\code +POOL_DESC poolDesc = {}; +poolDesc.HeapProperties.Type = D3D12_HEAP_TYPE_DEFAULT; + +Pool* pool; +HRESULT hr = allocator->CreatePool(&poolDesc, &pool); +\endcode + +To allocate resources out of a custom pool, only set member D3D12MA::ALLOCATION_DESC::CustomPool. +Example: + +\code +ALLOCATION_DESC allocDesc = {}; +allocDesc.CustomPool = pool; + +D3D12_RESOURCE_DESC resDesc = ... +Allocation* alloc; +hr = allocator->CreateResource(&allocDesc, &resDesc, + D3D12_RESOURCE_STATE_GENERIC_READ, NULL, &alloc, IID_NULL, NULL); +\endcode + +All allocations must be released before releasing the pool. +The pool must be released before relasing the allocator. + +\code +alloc->Release(); +pool->Release(); +\endcode + +\section custom_pools_features_and_benefits Features and benefits + +While it is recommended to use default pools whenever possible for simplicity and to give the allocator +more opportunities for internal optimizations, custom pools may be useful in following cases: + +- To keep some resources separate from others in memory. +- To keep track of memory usage of just a specific group of resources. %Statistics can be queried using + D3D12MA::Pool::CalculateStatistics. +- To use specific size of a memory block (`ID3D12Heap`). To set it, use member D3D12MA::POOL_DESC::BlockSize. + When set to 0, the library uses automatically determined, variable block sizes. +- To reserve some minimum amount of memory allocated. To use it, set member D3D12MA::POOL_DESC::MinBlockCount. +- To limit maximum amount of memory allocated. To use it, set member D3D12MA::POOL_DESC::MaxBlockCount. +- To use extended parameters of the D3D12 memory allocation. While resources created from default pools + can only specify `D3D12_HEAP_TYPE_DEFAULT`, `UPLOAD`, `READBACK`, a custom pool may use non-standard + `D3D12_HEAP_PROPERTIES` (member D3D12MA::POOL_DESC::HeapProperties) and `D3D12_HEAP_FLAGS` + (D3D12MA::POOL_DESC::HeapFlags), which is useful e.g. for cross-adapter sharing or UMA + (see also D3D12MA::Allocator::IsUMA). + +New versions of this library support creating **committed allocations in custom pools**. +It is supported only when D3D12MA::POOL_DESC::BlockSize = 0. +To use this feature, set D3D12MA::ALLOCATION_DESC::CustomPool to the pointer to your custom pool and +D3D12MA::ALLOCATION_DESC::Flags to D3D12MA::ALLOCATION_FLAG_COMMITTED. Example: + +\code +ALLOCATION_DESC allocDesc = {}; +allocDesc.CustomPool = pool; +allocDesc.Flags = ALLOCATION_FLAG_COMMITTED; + +D3D12_RESOURCE_DESC resDesc = ... +Allocation* alloc; +ID3D12Resource* res; +hr = allocator->CreateResource(&allocDesc, &resDesc, + D3D12_RESOURCE_STATE_GENERIC_READ, NULL, &alloc, IID_PPV_ARGS(&res)); +\endcode + +This feature may seem unnecessary, but creating committed allocations from custom pools may be useful +in some cases, e.g. to have separate memory usage statistics for some group of resources or to use +extended allocation parameters, like custom `D3D12_HEAP_PROPERTIES`, which are available only in custom pools. + + +\page defragmentation Defragmentation + +Interleaved allocations and deallocations of many objects of varying size can +cause fragmentation over time, which can lead to a situation where the library is unable +to find a continuous range of free memory for a new allocation despite there is +enough free space, just scattered across many small free ranges between existing +allocations. + +To mitigate this problem, you can use defragmentation feature. +It doesn't happen automatically though and needs your cooperation, +because %D3D12MA is a low level library that only allocates memory. +It cannot recreate buffers and textures in a new place as it doesn't remember the contents of `D3D12_RESOURCE_DESC` structure. +It cannot copy their contents as it doesn't record any commands to a command list. + +Example: + +\code +D3D12MA::DEFRAGMENTATION_DESC defragDesc = {}; +defragDesc.Flags = D3D12MA::DEFRAGMENTATION_FLAG_ALGORITHM_FAST; + +D3D12MA::DefragmentationContext* defragCtx; +allocator->BeginDefragmentation(&defragDesc, &defragCtx); + +for(;;) +{ + D3D12MA::DEFRAGMENTATION_PASS_MOVE_INFO pass; + HRESULT hr = defragCtx->BeginPass(&pass); + if(hr == S_OK) + break; + else if(hr != S_FALSE) + // Handle error... + + for(UINT i = 0; i < pass.MoveCount; ++i) + { + // Inspect pass.pMoves[i].pSrcAllocation, identify what buffer/texture it represents. + MyEngineResourceData* resData = (MyEngineResourceData*)pMoves[i].pSrcAllocation->GetPrivateData(); + + // Recreate this buffer/texture as placed at pass.pMoves[i].pDstTmpAllocation. + D3D12_RESOURCE_DESC resDesc = ... + ID3D12Resource* newRes; + hr = device->CreatePlacedResource( + pass.pMoves[i].pDstTmpAllocation->GetHeap(), + pass.pMoves[i].pDstTmpAllocation->GetOffset(), &resDesc, + D3D12_RESOURCE_STATE_COPY_DEST, NULL, IID_PPV_ARGS(&newRes)); + // Check hr... + + // Store new resource in the pDstTmpAllocation. + pass.pMoves[i].pDstTmpAllocation->SetResource(newRes); + + // Copy its content to the new place. + cmdList->CopyResource( + pass.pMoves[i].pDstTmpAllocation->GetResource(), + pass.pMoves[i].pSrcAllocation->GetResource()); + } + + // Make sure the copy commands finished executing. + cmdQueue->ExecuteCommandLists(...); + // ... + WaitForSingleObject(fenceEvent, INFINITE); + + // Update appropriate descriptors to point to the new places... + + hr = defragCtx->EndPass(&pass); + if(hr == S_OK) + break; + else if(hr != S_FALSE) + // Handle error... +} + +defragCtx->Release(); +\endcode + +Although functions like D3D12MA::Allocator::CreateResource() +create an allocation and a buffer/texture at once, these are just a shortcut for +allocating memory and creating a placed resource. +Defragmentation works on memory allocations only. You must handle the rest manually. +Defragmentation is an iterative process that should repreat "passes" as long as related functions +return `S_FALSE` not `S_OK`. +In each pass: + +1. D3D12MA::DefragmentationContext::BeginPass() function call: + - Calculates and returns the list of allocations to be moved in this pass. + Note this can be a time-consuming process. + - Reserves destination memory for them by creating temporary destination allocations + that you can query for their `ID3D12Heap` + offset using methods like D3D12MA::Allocation::GetHeap(). +2. Inside the pass, **you should**: + - Inspect the returned list of allocations to be moved. + - Create new buffers/textures as placed at the returned destination temporary allocations. + - Copy data from source to destination resources if necessary. + - Store the pointer to the new resource in the temporary destination allocation. +3. D3D12MA::DefragmentationContext::EndPass() function call: + - Frees the source memory reserved for the allocations that are moved. + - Modifies source D3D12MA::Allocation objects that are moved to point to the destination reserved memory + and destination resource, while source resource is released. + - Frees `ID3D12Heap` blocks that became empty. + +Defragmentation algorithm tries to move all suitable allocations. +You can, however, refuse to move some of them inside a defragmentation pass, by setting +`pass.pMoves[i].Operation` to D3D12MA::DEFRAGMENTATION_MOVE_OPERATION_IGNORE. +This is not recommended and may result in suboptimal packing of the allocations after defragmentation. +If you cannot ensure any allocation can be moved, it is better to keep movable allocations separate in a custom pool. + +Inside a pass, for each allocation that should be moved: + +- You should copy its data from the source to the destination place by calling e.g. `CopyResource()`. + - You need to make sure these commands finished executing before the source buffers/textures are released by D3D12MA::DefragmentationContext::EndPass(). +- If a resource doesn't contain any meaningful data, e.g. it is a transient render-target texture to be cleared, + filled, and used temporarily in each rendering frame, you can just recreate this texture + without copying its data. +- If the resource is in `D3D12_HEAP_TYPE_READBACK` memory, you can copy its data on the CPU + using `memcpy()`. +- If you cannot move the allocation, you can set `pass.pMoves[i].Operation` to D3D12MA::DEFRAGMENTATION_MOVE_OPERATION_IGNORE. + This will cancel the move. + - D3D12MA::DefragmentationContext::EndPass() will then free the destination memory + not the source memory of the allocation, leaving it unchanged. +- If you decide the allocation is unimportant and can be destroyed instead of moved (e.g. it wasn't used for long time), + you can set `pass.pMoves[i].Operation` to D3D12MA::DEFRAGMENTATION_MOVE_OPERATION_DESTROY. + - D3D12MA::DefragmentationContext::EndPass() will then free both source and destination memory, and will destroy the source D3D12MA::Allocation object. + +You can defragment a specific custom pool by calling D3D12MA::Pool::BeginDefragmentation +or all the default pools by calling D3D12MA::Allocator::BeginDefragmentation (like in the example above). + +Defragmentation is always performed in each pool separately. +Allocations are never moved between different heap types. +The size of the destination memory reserved for a moved allocation is the same as the original one. +Alignment of an allocation as it was determined using `GetResourceAllocationInfo()` is also respected after defragmentation. +Buffers/textures should be recreated with the same `D3D12_RESOURCE_DESC` parameters as the original ones. + +You can perform the defragmentation incrementally to limit the number of allocations and bytes to be moved +in each pass, e.g. to call it in sync with render frames and not to experience too big hitches. +See members: D3D12MA::DEFRAGMENTATION_DESC::MaxBytesPerPass, D3D12MA::DEFRAGMENTATION_DESC::MaxAllocationsPerPass. + +<b>Thread safety:</b> +It is safe to perform the defragmentation asynchronously to render frames and other Direct3D 12 and %D3D12MA +usage, possibly from multiple threads, with the exception that allocations +returned in D3D12MA::DEFRAGMENTATION_PASS_MOVE_INFO::pMoves shouldn't be released until the defragmentation pass is ended. +During the call to D3D12MA::DefragmentationContext::BeginPass(), any operations on the memory pool +affected by the defragmentation are blocked by a mutex. + +What it means in practice is that you shouldn't free any allocations from the defragmented pool +since the moment a call to `BeginPass` begins. Otherwise, a thread performing the `allocation->Release()` +would block for the time `BeginPass` executes and then free the allocation when it finishes, while the allocation +could have ended up on the list of allocations to move. +A solution to freeing allocations during defragmentation is to find such allocation on the list +`pass.pMoves[i]` and set its operation to D3D12MA::DEFRAGMENTATION_MOVE_OPERATION_DESTROY instead of +calling `allocation->Release()`, or simply deferring the release to the time after defragmentation finished. + +<b>Mapping</b> is out of scope of this library and so it is not preserved after an allocation is moved during defragmentation. +You need to map the new resource yourself if needed. + +\note Defragmentation is not supported in custom pools created with D3D12MA::POOL_FLAG_ALGORITHM_LINEAR. + + +\page statistics Statistics + +This library contains several functions that return information about its internal state, +especially the amount of memory allocated from D3D12. + +\section statistics_numeric_statistics Numeric statistics + +If you need to obtain basic statistics about memory usage per memory segment group, together with current budget, +you can call function D3D12MA::Allocator::GetBudget() and inspect structure D3D12MA::Budget. +This is useful to keep track of memory usage and stay withing budget. +Example: + +\code +D3D12MA::Budget localBudget; +allocator->GetBudget(&localBudget, NULL); + +printf("My GPU memory currently has %u allocations taking %llu B,\n", + localBudget.Statistics.AllocationCount, + localBudget.Statistics.AllocationBytes); +printf("allocated out of %u D3D12 memory heaps taking %llu B,\n", + localBudget.Statistics.BlockCount, + localBudget.Statistics.BlockBytes); +printf("D3D12 reports total usage %llu B with budget %llu B.\n", + localBudget.UsageBytes, + localBudget.BudgetBytes); +\endcode + +You can query for more detailed statistics per heap type, memory segment group, and totals, +including minimum and maximum allocation size and unused range size, +by calling function D3D12MA::Allocator::CalculateStatistics() and inspecting structure D3D12MA::TotalStatistics. +This function is slower though, as it has to traverse all the internal data structures, +so it should be used only for debugging purposes. + +You can query for statistics of a custom pool using function D3D12MA::Pool::GetStatistics() +or D3D12MA::Pool::CalculateStatistics(). + +You can query for information about a specific allocation using functions of the D3D12MA::Allocation class, +e.g. `GetSize()`, `GetOffset()`, `GetHeap()`. + +\section statistics_json_dump JSON dump + +You can dump internal state of the allocator to a string in JSON format using function D3D12MA::Allocator::BuildStatsString(). +The result is guaranteed to be correct JSON. +It uses Windows Unicode (UTF-16) encoding. +Any strings provided by user (see D3D12MA::Allocation::SetName()) +are copied as-is and properly escaped for JSON. +It must be freed using function D3D12MA::Allocator::FreeStatsString(). + +The format of this JSON string is not part of official documentation of the library, +but it will not change in backward-incompatible way without increasing library major version number +and appropriate mention in changelog. + +The JSON string contains all the data that can be obtained using D3D12MA::Allocator::CalculateStatistics(). +It can also contain detailed map of allocated memory blocks and their regions - +free and occupied by allocations. +This allows e.g. to visualize the memory or assess fragmentation. + + +\page resource_aliasing Resource aliasing (overlap) + +New explicit graphics APIs (Vulkan and Direct3D 12), thanks to manual memory +management, give an opportunity to alias (overlap) multiple resources in the +same region of memory - a feature not available in the old APIs (Direct3D 11, OpenGL). +It can be useful to save video memory, but it must be used with caution. + +For example, if you know the flow of your whole render frame in advance, you +are going to use some intermediate textures or buffers only during a small range of render passes, +and you know these ranges don't overlap in time, you can create these resources in +the same place in memory, even if they have completely different parameters (width, height, format etc.). + + + +Such scenario is possible using D3D12MA, but you need to create your resources +using special function D3D12MA::Allocator::CreateAliasingResource. +Before that, you need to allocate memory with parameters calculated using formula: + +- allocation size = max(size of each resource) +- allocation alignment = max(alignment of each resource) + +Following example shows two different textures created in the same place in memory, +allocated to fit largest of them. + +\code +D3D12_RESOURCE_DESC resDesc1 = {}; +resDesc1.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D; +resDesc1.Alignment = 0; +resDesc1.Width = 1920; +resDesc1.Height = 1080; +resDesc1.DepthOrArraySize = 1; +resDesc1.MipLevels = 1; +resDesc1.Format = DXGI_FORMAT_R8G8B8A8_UNORM; +resDesc1.SampleDesc.Count = 1; +resDesc1.SampleDesc.Quality = 0; +resDesc1.Layout = D3D12_TEXTURE_LAYOUT_UNKNOWN; +resDesc1.Flags = D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET | D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS; + +D3D12_RESOURCE_DESC resDesc2 = {}; +resDesc2.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D; +resDesc2.Alignment = 0; +resDesc2.Width = 1024; +resDesc2.Height = 1024; +resDesc2.DepthOrArraySize = 1; +resDesc2.MipLevels = 0; +resDesc2.Format = DXGI_FORMAT_R8G8B8A8_UNORM; +resDesc2.SampleDesc.Count = 1; +resDesc2.SampleDesc.Quality = 0; +resDesc2.Layout = D3D12_TEXTURE_LAYOUT_UNKNOWN; +resDesc2.Flags = D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET; + +const D3D12_RESOURCE_ALLOCATION_INFO allocInfo1 = + device->GetResourceAllocationInfo(0, 1, &resDesc1); +const D3D12_RESOURCE_ALLOCATION_INFO allocInfo2 = + device->GetResourceAllocationInfo(0, 1, &resDesc2); + +D3D12_RESOURCE_ALLOCATION_INFO finalAllocInfo = {}; +finalAllocInfo.Alignment = std::max(allocInfo1.Alignment, allocInfo2.Alignment); +finalAllocInfo.SizeInBytes = std::max(allocInfo1.SizeInBytes, allocInfo2.SizeInBytes); + +D3D12MA::ALLOCATION_DESC allocDesc = {}; +allocDesc.HeapType = D3D12_HEAP_TYPE_DEFAULT; +allocDesc.ExtraHeapFlags = D3D12_HEAP_FLAG_ALLOW_ONLY_RT_DS_TEXTURES; + +D3D12MA::Allocation* alloc; +hr = allocator->AllocateMemory(&allocDesc, &finalAllocInfo, &alloc); +assert(alloc != NULL && alloc->GetHeap() != NULL); + +ID3D12Resource* res1; +hr = allocator->CreateAliasingResource( + alloc, + 0, // AllocationLocalOffset + &resDesc1, + D3D12_RESOURCE_STATE_COMMON, + NULL, // pOptimizedClearValue + IID_PPV_ARGS(&res1)); + +ID3D12Resource* res2; +hr = allocator->CreateAliasingResource( + alloc, + 0, // AllocationLocalOffset + &resDesc2, + D3D12_RESOURCE_STATE_COMMON, + NULL, // pOptimizedClearValue + IID_PPV_ARGS(&res2)); + +// You can use res1 and res2, but not at the same time! + +res2->Release(); +res1->Release(); +alloc->Release(); +\endcode + +Remember that using resouces that alias in memory requires proper synchronization. +You need to issue a special barrier of type `D3D12_RESOURCE_BARRIER_TYPE_ALIASING`. +You also need to treat a resource after aliasing as uninitialized - containing garbage data. +For example, if you use `res1` and then want to use `res2`, you need to first initialize `res2` +using either Clear, Discard, or Copy to the entire resource. + +Additional considerations: + +- D3D12 also allows to interpret contents of memory between aliasing resources consistently in some cases, + which is called "data inheritance". For details, see + Microsoft documentation chapter "Memory Aliasing and Data Inheritance". +- You can create more complex layout where different textures and buffers are bound + at different offsets inside one large allocation. For example, one can imagine + a big texture used in some render passes, aliasing with a set of many small buffers + used in some further passes. To bind a resource at non-zero offset of an allocation, + call D3D12MA::Allocator::CreateAliasingResource with appropriate value of `AllocationLocalOffset` parameter. +- Resources of the three categories: buffers, textures with `RENDER_TARGET` or `DEPTH_STENCIL` flags, and all other textures, + can be placed in the same memory only when `allocator->GetD3D12Options().ResourceHeapTier >= D3D12_RESOURCE_HEAP_TIER_2`. + Otherwise they must be placed in different memory heap types, and thus aliasing them is not possible. + + +\page linear_algorithm Linear allocation algorithm + +Each D3D12 memory block managed by this library has accompanying metadata that +keeps track of used and unused regions. By default, the metadata structure and +algorithm tries to find best place for new allocations among free regions to +optimize memory usage. This way you can allocate and free objects in any order. + + + +Sometimes there is a need to use simpler, linear allocation algorithm. You can +create custom pool that uses such algorithm by adding flag +D3D12MA::POOL_FLAG_ALGORITHM_LINEAR to D3D12MA::POOL_DESC::Flags while creating +D3D12MA::Pool object. Then an alternative metadata management is used. It always +creates new allocations after last one and doesn't reuse free regions after +allocations freed in the middle. It results in better allocation performance and +less memory consumed by metadata. + + + +With this one flag, you can create a custom pool that can be used in many ways: +free-at-once, stack, double stack, and ring buffer. See below for details. +You don't need to specify explicitly which of these options you are going to use - it is detected automatically. + +\section linear_algorithm_free_at_once Free-at-once + +In a pool that uses linear algorithm, you still need to free all the allocations +individually by calling `allocation->Release()`. You can free +them in any order. New allocations are always made after last one - free space +in the middle is not reused. However, when you release all the allocation and +the pool becomes empty, allocation starts from the beginning again. This way you +can use linear algorithm to speed up creation of allocations that you are going +to release all at once. + + + +This mode is also available for pools created with D3D12MA::POOL_DESC::MaxBlockCount +value that allows multiple memory blocks. + +\section linear_algorithm_stack Stack + +When you free an allocation that was created last, its space can be reused. +Thanks to this, if you always release allocations in the order opposite to their +creation (LIFO - Last In First Out), you can achieve behavior of a stack. + + + +This mode is also available for pools created with D3D12MA::POOL_DESC::MaxBlockCount +value that allows multiple memory blocks. + +\section linear_algorithm_double_stack Double stack + +The space reserved by a custom pool with linear algorithm may be used by two +stacks: + +- First, default one, growing up from offset 0. +- Second, "upper" one, growing down from the end towards lower offsets. + +To make allocation from the upper stack, add flag D3D12MA::ALLOCATION_FLAG_UPPER_ADDRESS +to D3D12MA::ALLOCATION_DESC::Flags. + + + +Double stack is available only in pools with one memory block - +D3D12MA::POOL_DESC::MaxBlockCount must be 1. Otherwise behavior is undefined. + +When the two stacks' ends meet so there is not enough space between them for a +new allocation, such allocation fails with usual `E_OUTOFMEMORY` error. + +\section linear_algorithm_ring_buffer Ring buffer + +When you free some allocations from the beginning and there is not enough free space +for a new one at the end of a pool, allocator's "cursor" wraps around to the +beginning and starts allocation there. Thanks to this, if you always release +allocations in the same order as you created them (FIFO - First In First Out), +you can achieve behavior of a ring buffer / queue. + + + +Ring buffer is available only in pools with one memory block - +D3D12MA::POOL_DESC::MaxBlockCount must be 1. Otherwise behavior is undefined. + +\section linear_algorithm_additional_considerations Additional considerations + +Linear algorithm can also be used with \ref virtual_allocator. +See flag D3D12MA::VIRTUAL_BLOCK_FLAG_ALGORITHM_LINEAR. + + +\page virtual_allocator Virtual allocator + +As an extra feature, the core allocation algorithm of the library is exposed through a simple and convenient API of "virtual allocator". +It doesn't allocate any real GPU memory. It just keeps track of used and free regions of a "virtual block". +You can use it to allocate your own memory or other objects, even completely unrelated to D3D12. +A common use case is sub-allocation of pieces of one large GPU buffer. + +\section virtual_allocator_creating_virtual_block Creating virtual block + +To use this functionality, there is no main "allocator" object. +You don't need to have D3D12MA::Allocator object created. +All you need to do is to create a separate D3D12MA::VirtualBlock object for each block of memory you want to be managed by the allocator: + +-# Fill in D3D12MA::ALLOCATOR_DESC structure. +-# Call D3D12MA::CreateVirtualBlock. Get new D3D12MA::VirtualBlock object. + +Example: + +\code +D3D12MA::VIRTUAL_BLOCK_DESC blockDesc = {}; +blockDesc.Size = 1048576; // 1 MB + +D3D12MA::VirtualBlock *block; +HRESULT hr = CreateVirtualBlock(&blockDesc, &block); +\endcode + +\section virtual_allocator_making_virtual_allocations Making virtual allocations + +D3D12MA::VirtualBlock object contains internal data structure that keeps track of free and occupied regions +using the same code as the main D3D12 memory allocator. +A single allocation is identified by a lightweight structure D3D12MA::VirtualAllocation. +You will also likely want to know the offset at which the allocation was made in the block. + +In order to make an allocation: + +-# Fill in D3D12MA::VIRTUAL_ALLOCATION_DESC structure. +-# Call D3D12MA::VirtualBlock::Allocate. Get new D3D12MA::VirtualAllocation value that identifies the allocation. + +Example: + +\code +D3D12MA::VIRTUAL_ALLOCATION_DESC allocDesc = {}; +allocDesc.Size = 4096; // 4 KB + +D3D12MA::VirtualAllocation alloc; +UINT64 allocOffset; +hr = block->Allocate(&allocDesc, &alloc, &allocOffset); +if(SUCCEEDED(hr)) +{ + // Use the 4 KB of your memory starting at allocOffset. +} +else +{ + // Allocation failed - no space for it could be found. Handle this error! +} +\endcode + +\section virtual_allocator_deallocation Deallocation + +When no longer needed, an allocation can be freed by calling D3D12MA::VirtualBlock::FreeAllocation. + +When whole block is no longer needed, the block object can be released by calling `block->Release()`. +All allocations must be freed before the block is destroyed, which is checked internally by an assert. +However, if you don't want to call `block->FreeAllocation` for each allocation, you can use D3D12MA::VirtualBlock::Clear to free them all at once - +a feature not available in normal D3D12 memory allocator. + +Example: + +\code +block->FreeAllocation(alloc); +block->Release(); +\endcode + +\section virtual_allocator_allocation_parameters Allocation parameters + +You can attach a custom pointer to each allocation by using D3D12MA::VirtualBlock::SetAllocationPrivateData. +Its default value is `NULL`. +It can be used to store any data that needs to be associated with that allocation - e.g. an index, a handle, or a pointer to some +larger data structure containing more information. Example: + +\code +struct CustomAllocData +{ + std::string m_AllocName; +}; +CustomAllocData* allocData = new CustomAllocData(); +allocData->m_AllocName = "My allocation 1"; +block->SetAllocationPrivateData(alloc, allocData); +\endcode + +The pointer can later be fetched, along with allocation offset and size, by passing the allocation handle to function +D3D12MA::VirtualBlock::GetAllocationInfo and inspecting returned structure D3D12MA::VIRTUAL_ALLOCATION_INFO. +If you allocated a new object to be used as the custom pointer, don't forget to delete that object before freeing the allocation! +Example: + +\code +VIRTUAL_ALLOCATION_INFO allocInfo; +block->GetAllocationInfo(alloc, &allocInfo); +delete (CustomAllocData*)allocInfo.pPrivateData; + +block->FreeAllocation(alloc); +\endcode + +\section virtual_allocator_alignment_and_units Alignment and units + +It feels natural to express sizes and offsets in bytes. +If an offset of an allocation needs to be aligned to a multiply of some number (e.g. 4 bytes), you can fill optional member +D3D12MA::VIRTUAL_ALLOCATION_DESC::Alignment to request it. Example: + +\code +D3D12MA::VIRTUAL_ALLOCATION_DESC allocDesc = {}; +allocDesc.Size = 4096; // 4 KB +allocDesc.Alignment = 4; // Returned offset must be a multiply of 4 B + +D3D12MA::VirtualAllocation alloc; +UINT64 allocOffset; +hr = block->Allocate(&allocDesc, &alloc, &allocOffset); +\endcode + +Alignments of different allocations made from one block may vary. +However, if all alignments and sizes are always multiply of some size e.g. 4 B or `sizeof(MyDataStruct)`, +you can express all sizes, alignments, and offsets in multiples of that size instead of individual bytes. +It might be more convenient, but you need to make sure to use this new unit consistently in all the places: + +- D3D12MA::VIRTUAL_BLOCK_DESC::Size +- D3D12MA::VIRTUAL_ALLOCATION_DESC::Size and D3D12MA::VIRTUAL_ALLOCATION_DESC::Alignment +- Using offset returned by D3D12MA::VirtualBlock::Allocate and D3D12MA::VIRTUAL_ALLOCATION_INFO::Offset + +\section virtual_allocator_statistics Statistics + +You can obtain brief statistics of a virtual block using D3D12MA::VirtualBlock::GetStatistics(). +The function fills structure D3D12MA::Statistics - same as used by the normal D3D12 memory allocator. +Example: + +\code +D3D12MA::Statistics stats; +block->GetStatistics(&stats); +printf("My virtual block has %llu bytes used by %u virtual allocations\n", + stats.AllocationBytes, stats.AllocationCount); +\endcode + +More detailed statistics can be obtained using function D3D12MA::VirtualBlock::CalculateStatistics(), +but they are slower to calculate. + +You can also request a full list of allocations and free regions as a string in JSON format by calling +D3D12MA::VirtualBlock::BuildStatsString. +Returned string must be later freed using D3D12MA::VirtualBlock::FreeStatsString. +The format of this string may differ from the one returned by the main D3D12 allocator, but it is similar. + +\section virtual_allocator_additional_considerations Additional considerations + +Alternative, linear algorithm can be used with virtual allocator - see flag +D3D12MA::VIRTUAL_BLOCK_FLAG_ALGORITHM_LINEAR and documentation: \ref linear_algorithm. + +Note that the "virtual allocator" functionality is implemented on a level of individual memory blocks. +Keeping track of a whole collection of blocks, allocating new ones when out of free space, +deleting empty ones, and deciding which one to try first for a new allocation must be implemented by the user. + + +\page configuration Configuration + +Please check file `D3D12MemAlloc.cpp` lines between "Configuration Begin" and +"Configuration End" to find macros that you can define to change the behavior of +the library, primarily for debugging purposes. + +\section custom_memory_allocator Custom CPU memory allocator + +If you use custom allocator for CPU memory rather than default C++ operator `new` +and `delete` or `malloc` and `free` functions, you can make this library using +your allocator as well by filling structure D3D12MA::ALLOCATION_CALLBACKS and +passing it as optional member D3D12MA::ALLOCATOR_DESC::pAllocationCallbacks. +Functions pointed there will be used by the library to make any CPU-side +allocations. Example: + +\code +#include <malloc.h> + +void* CustomAllocate(size_t Size, size_t Alignment, void* pPrivateData) +{ + void* memory = _aligned_malloc(Size, Alignment); + // Your extra bookkeeping here... + return memory; +} + +void CustomFree(void* pMemory, void* pPrivateData) +{ + // Your extra bookkeeping here... + _aligned_free(pMemory); +} + +(...) + +D3D12MA::ALLOCATION_CALLBACKS allocationCallbacks = {}; +allocationCallbacks.pAllocate = &CustomAllocate; +allocationCallbacks.pFree = &CustomFree; + +D3D12MA::ALLOCATOR_DESC allocatorDesc = {}; +allocatorDesc.pDevice = device; +allocatorDesc.pAdapter = adapter; +allocatorDesc.pAllocationCallbacks = &allocationCallbacks; + +D3D12MA::Allocator* allocator; +HRESULT hr = D3D12MA::CreateAllocator(&allocatorDesc, &allocator); +\endcode + + +\section debug_margins Debug margins + +By default, allocations are laid out in memory blocks next to each other if possible +(considering required alignment returned by `ID3D12Device::GetResourceAllocationInfo`). + + + +Define macro `D3D12MA_DEBUG_MARGIN` to some non-zero value (e.g. 16) inside "D3D12MemAlloc.cpp" +to enforce specified number of bytes as a margin after every allocation. + + + +If your bug goes away after enabling margins, it means it may be caused by memory +being overwritten outside of allocation boundaries. It is not 100% certain though. +Change in application behavior may also be caused by different order and distribution +of allocations across memory blocks after margins are applied. + +Margins work with all memory heap types. + +Margin is applied only to placed allocations made out of memory heaps and not to committed +allocations, which have their own, implicit memory heap of specific size. +It is thus not applied to allocations made using D3D12MA::ALLOCATION_FLAG_COMMITTED flag +or those automatically decided to put into committed allocations, e.g. due to its large size. + +Margins appear in [JSON dump](@ref statistics_json_dump) as part of free space. + +Note that enabling margins increases memory usage and fragmentation. + +Margins do not apply to \ref virtual_allocator. + + +\page general_considerations General considerations + +\section general_considerations_thread_safety Thread safety + +- The library has no global state, so separate D3D12MA::Allocator objects can be used independently. + In typical applications there should be no need to create multiple such objects though - one per `ID3D12Device` is enough. +- All calls to methods of D3D12MA::Allocator class are safe to be made from multiple + threads simultaneously because they are synchronized internally when needed. +- When the allocator is created with D3D12MA::ALLOCATOR_FLAG_SINGLETHREADED, + calls to methods of D3D12MA::Allocator class must be made from a single thread or synchronized by the user. + Using this flag may improve performance. +- D3D12MA::VirtualBlock is not safe to be used from multiple threads simultaneously. + +\section general_considerations_versioning_and_compatibility Versioning and compatibility + +The library uses [**Semantic Versioning**](https://semver.org/), +which means version numbers follow convention: Major.Minor.Patch (e.g. 2.3.0), where: + +- Incremented Patch version means a release is backward- and forward-compatible, + introducing only some internal improvements, bug fixes, optimizations etc. + or changes that are out of scope of the official API described in this documentation. +- Incremented Minor version means a release is backward-compatible, + so existing code that uses the library should continue to work, while some new + symbols could have been added: new structures, functions, new values in existing + enums and bit flags, new structure members, but not new function parameters. +- Incrementing Major version means a release could break some backward compatibility. + +All changes between official releases are documented in file "CHANGELOG.md". + +\warning Backward compatiblity is considered on the level of C++ source code, not binary linkage. +Adding new members to existing structures is treated as backward compatible if initializing +the new members to binary zero results in the old behavior. +You should always fully initialize all library structures to zeros and not rely on their +exact binary size. + +\section general_considerations_features_not_supported Features not supported + +Features deliberately excluded from the scope of this library: + +- **Descriptor allocation.** Although also called "heaps", objects that represent + descriptors are separate part of the D3D12 API from buffers and textures. + You can still use \ref virtual_allocator to manage descriptors and their ranges inside a descriptor heap. +- **Support for reserved (tiled) resources.** We don't recommend using them. +- Support for `ID3D12Device::Evict` and `MakeResident`. We don't recommend using them. + You can call them on the D3D12 objects manually. + Plese keep in mind, however, that eviction happens on the level of entire `ID3D12Heap` memory blocks + and not individual buffers or textures which may be placed inside them. +- **Handling CPU memory allocation failures.** When dynamically creating small C++ + objects in CPU memory (not the GPU memory), allocation failures are not + handled gracefully, because that would complicate code significantly and + is usually not needed in desktop PC applications anyway. + Success of an allocation is just checked with an assert. +- **Code free of any compiler warnings.** + There are many preprocessor macros that make some variables unused, function parameters unreferenced, + or conditional expressions constant in some configurations. + The code of this library should not be bigger or more complicated just to silence these warnings. + It is recommended to disable such warnings instead. +- This is a C++ library. **Bindings or ports to any other programming languages** are welcome as external projects but + are not going to be included into this repository. +*/ diff --git a/thirdparty/d3d12ma/D3D12MemAlloc.natvis b/thirdparty/d3d12ma/D3D12MemAlloc.natvis new file mode 100644 index 0000000000..957edc929d --- /dev/null +++ b/thirdparty/d3d12ma/D3D12MemAlloc.natvis @@ -0,0 +1,58 @@ +<?xml version="1.0" encoding="utf-8"?> +<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010"> + <Type Name="D3D12MA::Vector<*>"> + <DisplayString>{{ Count={m_Count} }}</DisplayString> + <Expand> + <Item Name="[Count]">m_Count</Item> + <Item Name="[Capacity]">m_Capacity</Item> + <ArrayItems> + <Size>m_Count</Size> + <ValuePointer>m_pArray</ValuePointer> + </ArrayItems> + </Expand> + </Type> + + <Type Name="D3D12MA::List<*>"> + <DisplayString>{{ Count={m_Count} }}</DisplayString> + <Expand> + <Item Name="[Count]">m_Count</Item> + <LinkedListItems> + <Size>m_Count</Size> + <HeadPointer>m_pFront</HeadPointer> + <NextPointer>pNext</NextPointer> + <ValueNode>Value</ValueNode> + </LinkedListItems> + </Expand> + </Type> + + <!-- + Due to custom way of accesing next items in + D3D12MA::IntrusiveLinkedList via methods in provided type traits, + every specialization must be manually added with + custom <NextPointer> field describing proper way of iterating the list. + --> + <Type Name="D3D12MA::IntrusiveLinkedList<D3D12MA::CommittedAllocationListItemTraits>"> + <DisplayString>{{ Count={m_Count} }}</DisplayString> + <Expand> + <Item Name="[Count]">m_Count</Item> + <LinkedListItems> + <Size>m_Count</Size> + <HeadPointer>m_Front</HeadPointer> + <NextPointer>m_Committed.next</NextPointer> + <ValueNode>*this</ValueNode> + </LinkedListItems> + </Expand> + </Type> + <Type Name="D3D12MA::IntrusiveLinkedList<D3D12MA::PoolListItemTraits>"> + <DisplayString>{{ Count={m_Count} }}</DisplayString> + <Expand> + <Item Name="[Count]">m_Count</Item> + <LinkedListItems> + <Size>m_Count</Size> + <HeadPointer>m_Front</HeadPointer> + <NextPointer>m_NextPool</NextPointer> + <ValueNode>*this</ValueNode> + </LinkedListItems> + </Expand> + </Type> +</AutoVisualizer>
\ No newline at end of file diff --git a/thirdparty/d3d12ma/LICENSE.txt b/thirdparty/d3d12ma/LICENSE.txt new file mode 100644 index 0000000000..bc2ab4dc05 --- /dev/null +++ b/thirdparty/d3d12ma/LICENSE.txt @@ -0,0 +1,19 @@ +Copyright (c) 2019-2022 Advanced Micro Devices, Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/thirdparty/d3d12ma/NOTICES.txt b/thirdparty/d3d12ma/NOTICES.txt new file mode 100644 index 0000000000..98bccc5de5 --- /dev/null +++ b/thirdparty/d3d12ma/NOTICES.txt @@ -0,0 +1,52 @@ +Notices and licenses file +_________________________ + +AMD copyrighted code (MIT) +Copyright (c) 2019 Advanced Micro Devices, Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, +modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the +Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +Dependecnies on microsoft-directx-graphics-samples v-u (MIT) + +Copyright (c) 2019 Advanced Micro Devices, Inc. All rights reserved. +Copyright (c) Microsoft. All rights reserved. + +This code is licensed under the MIT License (MIT). +THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF +ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY +IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR +PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. + + +gpuopen-librariesandsdks-vulkanmemoryallocator v-u (MIT) +Copyright (c) 2019-2022 Advanced Micro Devices, Inc. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/thirdparty/directx_headers/LICENSE b/thirdparty/directx_headers/LICENSE new file mode 100644 index 0000000000..63447fd8bb --- /dev/null +++ b/thirdparty/directx_headers/LICENSE @@ -0,0 +1,21 @@ +Copyright (c) Microsoft Corporation. + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.
\ No newline at end of file diff --git a/thirdparty/directx_headers/d3d12.h b/thirdparty/directx_headers/d3d12.h new file mode 100644 index 0000000000..07355f558c --- /dev/null +++ b/thirdparty/directx_headers/d3d12.h @@ -0,0 +1,28706 @@ +/*------------------------------------------------------------------------------------- + * + * Copyright (c) Microsoft Corporation + * Licensed under the MIT license + * + *-------------------------------------------------------------------------------------*/ + + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 8.01.0628 */ + + + +/* verify that the <rpcndr.h> version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 500 +#endif + +/* verify that the <rpcsal.h> version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCSAL_H_VERSION__ +#define __REQUIRED_RPCSAL_H_VERSION__ 100 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of <rpcndr.h> +#endif /* __RPCNDR_H_VERSION__ */ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __d3d12_h__ +#define __d3d12_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +#ifndef DECLSPEC_XFGVIRT +#if defined(_CONTROL_FLOW_GUARD_XFG) +#define DECLSPEC_XFGVIRT(base, func) __declspec(xfg_virtual(base, func)) +#else +#define DECLSPEC_XFGVIRT(base, func) +#endif +#endif + +/* Forward Declarations */ + +#ifndef __ID3D12Object_FWD_DEFINED__ +#define __ID3D12Object_FWD_DEFINED__ +typedef interface ID3D12Object ID3D12Object; + +#endif /* __ID3D12Object_FWD_DEFINED__ */ + + +#ifndef __ID3D12DeviceChild_FWD_DEFINED__ +#define __ID3D12DeviceChild_FWD_DEFINED__ +typedef interface ID3D12DeviceChild ID3D12DeviceChild; + +#endif /* __ID3D12DeviceChild_FWD_DEFINED__ */ + + +#ifndef __ID3D12RootSignature_FWD_DEFINED__ +#define __ID3D12RootSignature_FWD_DEFINED__ +typedef interface ID3D12RootSignature ID3D12RootSignature; + +#endif /* __ID3D12RootSignature_FWD_DEFINED__ */ + + +#ifndef __ID3D12RootSignatureDeserializer_FWD_DEFINED__ +#define __ID3D12RootSignatureDeserializer_FWD_DEFINED__ +typedef interface ID3D12RootSignatureDeserializer ID3D12RootSignatureDeserializer; + +#endif /* __ID3D12RootSignatureDeserializer_FWD_DEFINED__ */ + + +#ifndef __ID3D12VersionedRootSignatureDeserializer_FWD_DEFINED__ +#define __ID3D12VersionedRootSignatureDeserializer_FWD_DEFINED__ +typedef interface ID3D12VersionedRootSignatureDeserializer ID3D12VersionedRootSignatureDeserializer; + +#endif /* __ID3D12VersionedRootSignatureDeserializer_FWD_DEFINED__ */ + + +#ifndef __ID3D12Pageable_FWD_DEFINED__ +#define __ID3D12Pageable_FWD_DEFINED__ +typedef interface ID3D12Pageable ID3D12Pageable; + +#endif /* __ID3D12Pageable_FWD_DEFINED__ */ + + +#ifndef __ID3D12Heap_FWD_DEFINED__ +#define __ID3D12Heap_FWD_DEFINED__ +typedef interface ID3D12Heap ID3D12Heap; + +#endif /* __ID3D12Heap_FWD_DEFINED__ */ + + +#ifndef __ID3D12Resource_FWD_DEFINED__ +#define __ID3D12Resource_FWD_DEFINED__ +typedef interface ID3D12Resource ID3D12Resource; + +#endif /* __ID3D12Resource_FWD_DEFINED__ */ + + +#ifndef __ID3D12CommandAllocator_FWD_DEFINED__ +#define __ID3D12CommandAllocator_FWD_DEFINED__ +typedef interface ID3D12CommandAllocator ID3D12CommandAllocator; + +#endif /* __ID3D12CommandAllocator_FWD_DEFINED__ */ + + +#ifndef __ID3D12Fence_FWD_DEFINED__ +#define __ID3D12Fence_FWD_DEFINED__ +typedef interface ID3D12Fence ID3D12Fence; + +#endif /* __ID3D12Fence_FWD_DEFINED__ */ + + +#ifndef __ID3D12Fence1_FWD_DEFINED__ +#define __ID3D12Fence1_FWD_DEFINED__ +typedef interface ID3D12Fence1 ID3D12Fence1; + +#endif /* __ID3D12Fence1_FWD_DEFINED__ */ + + +#ifndef __ID3D12PipelineState_FWD_DEFINED__ +#define __ID3D12PipelineState_FWD_DEFINED__ +typedef interface ID3D12PipelineState ID3D12PipelineState; + +#endif /* __ID3D12PipelineState_FWD_DEFINED__ */ + + +#ifndef __ID3D12DescriptorHeap_FWD_DEFINED__ +#define __ID3D12DescriptorHeap_FWD_DEFINED__ +typedef interface ID3D12DescriptorHeap ID3D12DescriptorHeap; + +#endif /* __ID3D12DescriptorHeap_FWD_DEFINED__ */ + + +#ifndef __ID3D12QueryHeap_FWD_DEFINED__ +#define __ID3D12QueryHeap_FWD_DEFINED__ +typedef interface ID3D12QueryHeap ID3D12QueryHeap; + +#endif /* __ID3D12QueryHeap_FWD_DEFINED__ */ + + +#ifndef __ID3D12CommandSignature_FWD_DEFINED__ +#define __ID3D12CommandSignature_FWD_DEFINED__ +typedef interface ID3D12CommandSignature ID3D12CommandSignature; + +#endif /* __ID3D12CommandSignature_FWD_DEFINED__ */ + + +#ifndef __ID3D12CommandList_FWD_DEFINED__ +#define __ID3D12CommandList_FWD_DEFINED__ +typedef interface ID3D12CommandList ID3D12CommandList; + +#endif /* __ID3D12CommandList_FWD_DEFINED__ */ + + +#ifndef __ID3D12GraphicsCommandList_FWD_DEFINED__ +#define __ID3D12GraphicsCommandList_FWD_DEFINED__ +typedef interface ID3D12GraphicsCommandList ID3D12GraphicsCommandList; + +#endif /* __ID3D12GraphicsCommandList_FWD_DEFINED__ */ + + +#ifndef __ID3D12GraphicsCommandList1_FWD_DEFINED__ +#define __ID3D12GraphicsCommandList1_FWD_DEFINED__ +typedef interface ID3D12GraphicsCommandList1 ID3D12GraphicsCommandList1; + +#endif /* __ID3D12GraphicsCommandList1_FWD_DEFINED__ */ + + +#ifndef __ID3D12GraphicsCommandList2_FWD_DEFINED__ +#define __ID3D12GraphicsCommandList2_FWD_DEFINED__ +typedef interface ID3D12GraphicsCommandList2 ID3D12GraphicsCommandList2; + +#endif /* __ID3D12GraphicsCommandList2_FWD_DEFINED__ */ + + +#ifndef __ID3D12CommandQueue_FWD_DEFINED__ +#define __ID3D12CommandQueue_FWD_DEFINED__ +typedef interface ID3D12CommandQueue ID3D12CommandQueue; + +#endif /* __ID3D12CommandQueue_FWD_DEFINED__ */ + + +#ifndef __ID3D12Device_FWD_DEFINED__ +#define __ID3D12Device_FWD_DEFINED__ +typedef interface ID3D12Device ID3D12Device; + +#endif /* __ID3D12Device_FWD_DEFINED__ */ + + +#ifndef __ID3D12PipelineLibrary_FWD_DEFINED__ +#define __ID3D12PipelineLibrary_FWD_DEFINED__ +typedef interface ID3D12PipelineLibrary ID3D12PipelineLibrary; + +#endif /* __ID3D12PipelineLibrary_FWD_DEFINED__ */ + + +#ifndef __ID3D12PipelineLibrary1_FWD_DEFINED__ +#define __ID3D12PipelineLibrary1_FWD_DEFINED__ +typedef interface ID3D12PipelineLibrary1 ID3D12PipelineLibrary1; + +#endif /* __ID3D12PipelineLibrary1_FWD_DEFINED__ */ + + +#ifndef __ID3D12Device1_FWD_DEFINED__ +#define __ID3D12Device1_FWD_DEFINED__ +typedef interface ID3D12Device1 ID3D12Device1; + +#endif /* __ID3D12Device1_FWD_DEFINED__ */ + + +#ifndef __ID3D12Device2_FWD_DEFINED__ +#define __ID3D12Device2_FWD_DEFINED__ +typedef interface ID3D12Device2 ID3D12Device2; + +#endif /* __ID3D12Device2_FWD_DEFINED__ */ + + +#ifndef __ID3D12Device3_FWD_DEFINED__ +#define __ID3D12Device3_FWD_DEFINED__ +typedef interface ID3D12Device3 ID3D12Device3; + +#endif /* __ID3D12Device3_FWD_DEFINED__ */ + + +#ifndef __ID3D12ProtectedSession_FWD_DEFINED__ +#define __ID3D12ProtectedSession_FWD_DEFINED__ +typedef interface ID3D12ProtectedSession ID3D12ProtectedSession; + +#endif /* __ID3D12ProtectedSession_FWD_DEFINED__ */ + + +#ifndef __ID3D12ProtectedResourceSession_FWD_DEFINED__ +#define __ID3D12ProtectedResourceSession_FWD_DEFINED__ +typedef interface ID3D12ProtectedResourceSession ID3D12ProtectedResourceSession; + +#endif /* __ID3D12ProtectedResourceSession_FWD_DEFINED__ */ + + +#ifndef __ID3D12Device4_FWD_DEFINED__ +#define __ID3D12Device4_FWD_DEFINED__ +typedef interface ID3D12Device4 ID3D12Device4; + +#endif /* __ID3D12Device4_FWD_DEFINED__ */ + + +#ifndef __ID3D12LifetimeOwner_FWD_DEFINED__ +#define __ID3D12LifetimeOwner_FWD_DEFINED__ +typedef interface ID3D12LifetimeOwner ID3D12LifetimeOwner; + +#endif /* __ID3D12LifetimeOwner_FWD_DEFINED__ */ + + +#ifndef __ID3D12SwapChainAssistant_FWD_DEFINED__ +#define __ID3D12SwapChainAssistant_FWD_DEFINED__ +typedef interface ID3D12SwapChainAssistant ID3D12SwapChainAssistant; + +#endif /* __ID3D12SwapChainAssistant_FWD_DEFINED__ */ + + +#ifndef __ID3D12LifetimeTracker_FWD_DEFINED__ +#define __ID3D12LifetimeTracker_FWD_DEFINED__ +typedef interface ID3D12LifetimeTracker ID3D12LifetimeTracker; + +#endif /* __ID3D12LifetimeTracker_FWD_DEFINED__ */ + + +#ifndef __ID3D12StateObject_FWD_DEFINED__ +#define __ID3D12StateObject_FWD_DEFINED__ +typedef interface ID3D12StateObject ID3D12StateObject; + +#endif /* __ID3D12StateObject_FWD_DEFINED__ */ + + +#ifndef __ID3D12StateObjectProperties_FWD_DEFINED__ +#define __ID3D12StateObjectProperties_FWD_DEFINED__ +typedef interface ID3D12StateObjectProperties ID3D12StateObjectProperties; + +#endif /* __ID3D12StateObjectProperties_FWD_DEFINED__ */ + + +#ifndef __ID3D12Device5_FWD_DEFINED__ +#define __ID3D12Device5_FWD_DEFINED__ +typedef interface ID3D12Device5 ID3D12Device5; + +#endif /* __ID3D12Device5_FWD_DEFINED__ */ + + +#ifndef __ID3D12DeviceRemovedExtendedDataSettings_FWD_DEFINED__ +#define __ID3D12DeviceRemovedExtendedDataSettings_FWD_DEFINED__ +typedef interface ID3D12DeviceRemovedExtendedDataSettings ID3D12DeviceRemovedExtendedDataSettings; + +#endif /* __ID3D12DeviceRemovedExtendedDataSettings_FWD_DEFINED__ */ + + +#ifndef __ID3D12DeviceRemovedExtendedDataSettings1_FWD_DEFINED__ +#define __ID3D12DeviceRemovedExtendedDataSettings1_FWD_DEFINED__ +typedef interface ID3D12DeviceRemovedExtendedDataSettings1 ID3D12DeviceRemovedExtendedDataSettings1; + +#endif /* __ID3D12DeviceRemovedExtendedDataSettings1_FWD_DEFINED__ */ + + +#ifndef __ID3D12DeviceRemovedExtendedDataSettings2_FWD_DEFINED__ +#define __ID3D12DeviceRemovedExtendedDataSettings2_FWD_DEFINED__ +typedef interface ID3D12DeviceRemovedExtendedDataSettings2 ID3D12DeviceRemovedExtendedDataSettings2; + +#endif /* __ID3D12DeviceRemovedExtendedDataSettings2_FWD_DEFINED__ */ + + +#ifndef __ID3D12DeviceRemovedExtendedData_FWD_DEFINED__ +#define __ID3D12DeviceRemovedExtendedData_FWD_DEFINED__ +typedef interface ID3D12DeviceRemovedExtendedData ID3D12DeviceRemovedExtendedData; + +#endif /* __ID3D12DeviceRemovedExtendedData_FWD_DEFINED__ */ + + +#ifndef __ID3D12DeviceRemovedExtendedData1_FWD_DEFINED__ +#define __ID3D12DeviceRemovedExtendedData1_FWD_DEFINED__ +typedef interface ID3D12DeviceRemovedExtendedData1 ID3D12DeviceRemovedExtendedData1; + +#endif /* __ID3D12DeviceRemovedExtendedData1_FWD_DEFINED__ */ + + +#ifndef __ID3D12DeviceRemovedExtendedData2_FWD_DEFINED__ +#define __ID3D12DeviceRemovedExtendedData2_FWD_DEFINED__ +typedef interface ID3D12DeviceRemovedExtendedData2 ID3D12DeviceRemovedExtendedData2; + +#endif /* __ID3D12DeviceRemovedExtendedData2_FWD_DEFINED__ */ + + +#ifndef __ID3D12Device6_FWD_DEFINED__ +#define __ID3D12Device6_FWD_DEFINED__ +typedef interface ID3D12Device6 ID3D12Device6; + +#endif /* __ID3D12Device6_FWD_DEFINED__ */ + + +#ifndef __ID3D12ProtectedResourceSession1_FWD_DEFINED__ +#define __ID3D12ProtectedResourceSession1_FWD_DEFINED__ +typedef interface ID3D12ProtectedResourceSession1 ID3D12ProtectedResourceSession1; + +#endif /* __ID3D12ProtectedResourceSession1_FWD_DEFINED__ */ + + +#ifndef __ID3D12Device7_FWD_DEFINED__ +#define __ID3D12Device7_FWD_DEFINED__ +typedef interface ID3D12Device7 ID3D12Device7; + +#endif /* __ID3D12Device7_FWD_DEFINED__ */ + + +#ifndef __ID3D12Device8_FWD_DEFINED__ +#define __ID3D12Device8_FWD_DEFINED__ +typedef interface ID3D12Device8 ID3D12Device8; + +#endif /* __ID3D12Device8_FWD_DEFINED__ */ + + +#ifndef __ID3D12Resource1_FWD_DEFINED__ +#define __ID3D12Resource1_FWD_DEFINED__ +typedef interface ID3D12Resource1 ID3D12Resource1; + +#endif /* __ID3D12Resource1_FWD_DEFINED__ */ + + +#ifndef __ID3D12Resource2_FWD_DEFINED__ +#define __ID3D12Resource2_FWD_DEFINED__ +typedef interface ID3D12Resource2 ID3D12Resource2; + +#endif /* __ID3D12Resource2_FWD_DEFINED__ */ + + +#ifndef __ID3D12Heap1_FWD_DEFINED__ +#define __ID3D12Heap1_FWD_DEFINED__ +typedef interface ID3D12Heap1 ID3D12Heap1; + +#endif /* __ID3D12Heap1_FWD_DEFINED__ */ + + +#ifndef __ID3D12GraphicsCommandList3_FWD_DEFINED__ +#define __ID3D12GraphicsCommandList3_FWD_DEFINED__ +typedef interface ID3D12GraphicsCommandList3 ID3D12GraphicsCommandList3; + +#endif /* __ID3D12GraphicsCommandList3_FWD_DEFINED__ */ + + +#ifndef __ID3D12MetaCommand_FWD_DEFINED__ +#define __ID3D12MetaCommand_FWD_DEFINED__ +typedef interface ID3D12MetaCommand ID3D12MetaCommand; + +#endif /* __ID3D12MetaCommand_FWD_DEFINED__ */ + + +#ifndef __ID3D12GraphicsCommandList4_FWD_DEFINED__ +#define __ID3D12GraphicsCommandList4_FWD_DEFINED__ +typedef interface ID3D12GraphicsCommandList4 ID3D12GraphicsCommandList4; + +#endif /* __ID3D12GraphicsCommandList4_FWD_DEFINED__ */ + + +#ifndef __ID3D12ShaderCacheSession_FWD_DEFINED__ +#define __ID3D12ShaderCacheSession_FWD_DEFINED__ +typedef interface ID3D12ShaderCacheSession ID3D12ShaderCacheSession; + +#endif /* __ID3D12ShaderCacheSession_FWD_DEFINED__ */ + + +#ifndef __ID3D12Device9_FWD_DEFINED__ +#define __ID3D12Device9_FWD_DEFINED__ +typedef interface ID3D12Device9 ID3D12Device9; + +#endif /* __ID3D12Device9_FWD_DEFINED__ */ + + +#ifndef __ID3D12Device10_FWD_DEFINED__ +#define __ID3D12Device10_FWD_DEFINED__ +typedef interface ID3D12Device10 ID3D12Device10; + +#endif /* __ID3D12Device10_FWD_DEFINED__ */ + + +#ifndef __ID3D12Device11_FWD_DEFINED__ +#define __ID3D12Device11_FWD_DEFINED__ +typedef interface ID3D12Device11 ID3D12Device11; + +#endif /* __ID3D12Device11_FWD_DEFINED__ */ + + +#ifndef __ID3D12VirtualizationGuestDevice_FWD_DEFINED__ +#define __ID3D12VirtualizationGuestDevice_FWD_DEFINED__ +typedef interface ID3D12VirtualizationGuestDevice ID3D12VirtualizationGuestDevice; + +#endif /* __ID3D12VirtualizationGuestDevice_FWD_DEFINED__ */ + + +#ifndef __ID3D12Tools_FWD_DEFINED__ +#define __ID3D12Tools_FWD_DEFINED__ +typedef interface ID3D12Tools ID3D12Tools; + +#endif /* __ID3D12Tools_FWD_DEFINED__ */ + + +#ifndef __ID3D12SDKConfiguration_FWD_DEFINED__ +#define __ID3D12SDKConfiguration_FWD_DEFINED__ +typedef interface ID3D12SDKConfiguration ID3D12SDKConfiguration; + +#endif /* __ID3D12SDKConfiguration_FWD_DEFINED__ */ + + +#ifndef __ID3D12SDKConfiguration1_FWD_DEFINED__ +#define __ID3D12SDKConfiguration1_FWD_DEFINED__ +typedef interface ID3D12SDKConfiguration1 ID3D12SDKConfiguration1; + +#endif /* __ID3D12SDKConfiguration1_FWD_DEFINED__ */ + + +#ifndef __ID3D12DeviceFactory_FWD_DEFINED__ +#define __ID3D12DeviceFactory_FWD_DEFINED__ +typedef interface ID3D12DeviceFactory ID3D12DeviceFactory; + +#endif /* __ID3D12DeviceFactory_FWD_DEFINED__ */ + + +#ifndef __ID3D12DeviceConfiguration_FWD_DEFINED__ +#define __ID3D12DeviceConfiguration_FWD_DEFINED__ +typedef interface ID3D12DeviceConfiguration ID3D12DeviceConfiguration; + +#endif /* __ID3D12DeviceConfiguration_FWD_DEFINED__ */ + + +#ifndef __ID3D12GraphicsCommandList5_FWD_DEFINED__ +#define __ID3D12GraphicsCommandList5_FWD_DEFINED__ +typedef interface ID3D12GraphicsCommandList5 ID3D12GraphicsCommandList5; + +#endif /* __ID3D12GraphicsCommandList5_FWD_DEFINED__ */ + + +#ifndef __ID3D12GraphicsCommandList6_FWD_DEFINED__ +#define __ID3D12GraphicsCommandList6_FWD_DEFINED__ +typedef interface ID3D12GraphicsCommandList6 ID3D12GraphicsCommandList6; + +#endif /* __ID3D12GraphicsCommandList6_FWD_DEFINED__ */ + + +#ifndef __ID3D12GraphicsCommandList7_FWD_DEFINED__ +#define __ID3D12GraphicsCommandList7_FWD_DEFINED__ +typedef interface ID3D12GraphicsCommandList7 ID3D12GraphicsCommandList7; + +#endif /* __ID3D12GraphicsCommandList7_FWD_DEFINED__ */ + + +#ifndef __ID3D12GraphicsCommandList8_FWD_DEFINED__ +#define __ID3D12GraphicsCommandList8_FWD_DEFINED__ +typedef interface ID3D12GraphicsCommandList8 ID3D12GraphicsCommandList8; + +#endif /* __ID3D12GraphicsCommandList8_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "oaidl.h" +#include "ocidl.h" +#include "dxgicommon.h" +#include "dxgiformat.h" +#include "d3dcommon.h" + +#ifdef __cplusplus +extern "C"{ +#endif + + +/* interface __MIDL_itf_d3d12_0000_0000 */ +/* [local] */ + +#include <winapifamily.h> +#pragma region App Family +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES) +#ifndef _D3D12_CONSTANTS +#define _D3D12_CONSTANTS +#define D3D12_16BIT_INDEX_STRIP_CUT_VALUE ( 0xffff ) + +#define D3D12_32BIT_INDEX_STRIP_CUT_VALUE ( 0xffffffff ) + +#define D3D12_8BIT_INDEX_STRIP_CUT_VALUE ( 0xff ) + +#define D3D12_APPEND_ALIGNED_ELEMENT ( 0xffffffff ) + +#define D3D12_ARRAY_AXIS_ADDRESS_RANGE_BIT_COUNT ( 9 ) + +#define D3D12_CLIP_OR_CULL_DISTANCE_COUNT ( 8 ) + +#define D3D12_CLIP_OR_CULL_DISTANCE_ELEMENT_COUNT ( 2 ) + +#define D3D12_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT ( 14 ) + +#define D3D12_COMMONSHADER_CONSTANT_BUFFER_COMPONENTS ( 4 ) + +#define D3D12_COMMONSHADER_CONSTANT_BUFFER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_COMMONSHADER_CONSTANT_BUFFER_HW_SLOT_COUNT ( 15 ) + +#define D3D12_COMMONSHADER_CONSTANT_BUFFER_PARTIAL_UPDATE_EXTENTS_BYTE_ALIGNMENT ( 16 ) + +#define D3D12_COMMONSHADER_CONSTANT_BUFFER_REGISTER_COMPONENTS ( 4 ) + +#define D3D12_COMMONSHADER_CONSTANT_BUFFER_REGISTER_COUNT ( 15 ) + +#define D3D12_COMMONSHADER_CONSTANT_BUFFER_REGISTER_READS_PER_INST ( 1 ) + +#define D3D12_COMMONSHADER_CONSTANT_BUFFER_REGISTER_READ_PORTS ( 1 ) + +#define D3D12_COMMONSHADER_FLOWCONTROL_NESTING_LIMIT ( 64 ) + +#define D3D12_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_COMPONENTS ( 4 ) + +#define D3D12_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_COUNT ( 1 ) + +#define D3D12_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_READS_PER_INST ( 1 ) + +#define D3D12_COMMONSHADER_IMMEDIATE_CONSTANT_BUFFER_REGISTER_READ_PORTS ( 1 ) + +#define D3D12_COMMONSHADER_IMMEDIATE_VALUE_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_COMMONSHADER_INPUT_RESOURCE_REGISTER_COMPONENTS ( 1 ) + +#define D3D12_COMMONSHADER_INPUT_RESOURCE_REGISTER_COUNT ( 128 ) + +#define D3D12_COMMONSHADER_INPUT_RESOURCE_REGISTER_READS_PER_INST ( 1 ) + +#define D3D12_COMMONSHADER_INPUT_RESOURCE_REGISTER_READ_PORTS ( 1 ) + +#define D3D12_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT ( 128 ) + +#define D3D12_COMMONSHADER_SAMPLER_REGISTER_COMPONENTS ( 1 ) + +#define D3D12_COMMONSHADER_SAMPLER_REGISTER_COUNT ( 16 ) + +#define D3D12_COMMONSHADER_SAMPLER_REGISTER_READS_PER_INST ( 1 ) + +#define D3D12_COMMONSHADER_SAMPLER_REGISTER_READ_PORTS ( 1 ) + +#define D3D12_COMMONSHADER_SAMPLER_SLOT_COUNT ( 16 ) + +#define D3D12_COMMONSHADER_SUBROUTINE_NESTING_LIMIT ( 32 ) + +#define D3D12_COMMONSHADER_TEMP_REGISTER_COMPONENTS ( 4 ) + +#define D3D12_COMMONSHADER_TEMP_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_COMMONSHADER_TEMP_REGISTER_COUNT ( 4096 ) + +#define D3D12_COMMONSHADER_TEMP_REGISTER_READS_PER_INST ( 3 ) + +#define D3D12_COMMONSHADER_TEMP_REGISTER_READ_PORTS ( 3 ) + +#define D3D12_COMMONSHADER_TEXCOORD_RANGE_REDUCTION_MAX ( 10 ) + +#define D3D12_COMMONSHADER_TEXCOORD_RANGE_REDUCTION_MIN ( -10 ) + +#define D3D12_COMMONSHADER_TEXEL_OFFSET_MAX_NEGATIVE ( -8 ) + +#define D3D12_COMMONSHADER_TEXEL_OFFSET_MAX_POSITIVE ( 7 ) + +#define D3D12_CONSTANT_BUFFER_DATA_PLACEMENT_ALIGNMENT ( 256 ) + +#define D3D12_CS_4_X_BUCKET00_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 256 ) + +#define D3D12_CS_4_X_BUCKET00_MAX_NUM_THREADS_PER_GROUP ( 64 ) + +#define D3D12_CS_4_X_BUCKET01_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 240 ) + +#define D3D12_CS_4_X_BUCKET01_MAX_NUM_THREADS_PER_GROUP ( 68 ) + +#define D3D12_CS_4_X_BUCKET02_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 224 ) + +#define D3D12_CS_4_X_BUCKET02_MAX_NUM_THREADS_PER_GROUP ( 72 ) + +#define D3D12_CS_4_X_BUCKET03_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 208 ) + +#define D3D12_CS_4_X_BUCKET03_MAX_NUM_THREADS_PER_GROUP ( 76 ) + +#define D3D12_CS_4_X_BUCKET04_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 192 ) + +#define D3D12_CS_4_X_BUCKET04_MAX_NUM_THREADS_PER_GROUP ( 84 ) + +#define D3D12_CS_4_X_BUCKET05_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 176 ) + +#define D3D12_CS_4_X_BUCKET05_MAX_NUM_THREADS_PER_GROUP ( 92 ) + +#define D3D12_CS_4_X_BUCKET06_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 160 ) + +#define D3D12_CS_4_X_BUCKET06_MAX_NUM_THREADS_PER_GROUP ( 100 ) + +#define D3D12_CS_4_X_BUCKET07_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 144 ) + +#define D3D12_CS_4_X_BUCKET07_MAX_NUM_THREADS_PER_GROUP ( 112 ) + +#define D3D12_CS_4_X_BUCKET08_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 128 ) + +#define D3D12_CS_4_X_BUCKET08_MAX_NUM_THREADS_PER_GROUP ( 128 ) + +#define D3D12_CS_4_X_BUCKET09_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 112 ) + +#define D3D12_CS_4_X_BUCKET09_MAX_NUM_THREADS_PER_GROUP ( 144 ) + +#define D3D12_CS_4_X_BUCKET10_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 96 ) + +#define D3D12_CS_4_X_BUCKET10_MAX_NUM_THREADS_PER_GROUP ( 168 ) + +#define D3D12_CS_4_X_BUCKET11_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 80 ) + +#define D3D12_CS_4_X_BUCKET11_MAX_NUM_THREADS_PER_GROUP ( 204 ) + +#define D3D12_CS_4_X_BUCKET12_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 64 ) + +#define D3D12_CS_4_X_BUCKET12_MAX_NUM_THREADS_PER_GROUP ( 256 ) + +#define D3D12_CS_4_X_BUCKET13_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 48 ) + +#define D3D12_CS_4_X_BUCKET13_MAX_NUM_THREADS_PER_GROUP ( 340 ) + +#define D3D12_CS_4_X_BUCKET14_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 32 ) + +#define D3D12_CS_4_X_BUCKET14_MAX_NUM_THREADS_PER_GROUP ( 512 ) + +#define D3D12_CS_4_X_BUCKET15_MAX_BYTES_TGSM_WRITABLE_PER_THREAD ( 16 ) + +#define D3D12_CS_4_X_BUCKET15_MAX_NUM_THREADS_PER_GROUP ( 768 ) + +#define D3D12_CS_4_X_DISPATCH_MAX_THREAD_GROUPS_IN_Z_DIMENSION ( 1 ) + +#define D3D12_CS_4_X_RAW_UAV_BYTE_ALIGNMENT ( 256 ) + +#define D3D12_CS_4_X_THREAD_GROUP_MAX_THREADS_PER_GROUP ( 768 ) + +#define D3D12_CS_4_X_THREAD_GROUP_MAX_X ( 768 ) + +#define D3D12_CS_4_X_THREAD_GROUP_MAX_Y ( 768 ) + +#define D3D12_CS_4_X_UAV_REGISTER_COUNT ( 1 ) + +#define D3D12_CS_DISPATCH_MAX_THREAD_GROUPS_PER_DIMENSION ( 65535 ) + +#define D3D12_CS_TGSM_REGISTER_COUNT ( 8192 ) + +#define D3D12_CS_TGSM_REGISTER_READS_PER_INST ( 1 ) + +#define D3D12_CS_TGSM_RESOURCE_REGISTER_COMPONENTS ( 1 ) + +#define D3D12_CS_TGSM_RESOURCE_REGISTER_READ_PORTS ( 1 ) + +#define D3D12_CS_THREADGROUPID_REGISTER_COMPONENTS ( 3 ) + +#define D3D12_CS_THREADGROUPID_REGISTER_COUNT ( 1 ) + +#define D3D12_CS_THREADIDINGROUPFLATTENED_REGISTER_COMPONENTS ( 1 ) + +#define D3D12_CS_THREADIDINGROUPFLATTENED_REGISTER_COUNT ( 1 ) + +#define D3D12_CS_THREADIDINGROUP_REGISTER_COMPONENTS ( 3 ) + +#define D3D12_CS_THREADIDINGROUP_REGISTER_COUNT ( 1 ) + +#define D3D12_CS_THREADID_REGISTER_COMPONENTS ( 3 ) + +#define D3D12_CS_THREADID_REGISTER_COUNT ( 1 ) + +#define D3D12_CS_THREAD_GROUP_MAX_THREADS_PER_GROUP ( 1024 ) + +#define D3D12_CS_THREAD_GROUP_MAX_X ( 1024 ) + +#define D3D12_CS_THREAD_GROUP_MAX_Y ( 1024 ) + +#define D3D12_CS_THREAD_GROUP_MAX_Z ( 64 ) + +#define D3D12_CS_THREAD_GROUP_MIN_X ( 1 ) + +#define D3D12_CS_THREAD_GROUP_MIN_Y ( 1 ) + +#define D3D12_CS_THREAD_GROUP_MIN_Z ( 1 ) + +#define D3D12_CS_THREAD_LOCAL_TEMP_REGISTER_POOL ( 16384 ) + +#define D3D12_DEFAULT_BLEND_FACTOR_ALPHA ( 1.0f ) +#define D3D12_DEFAULT_BLEND_FACTOR_BLUE ( 1.0f ) +#define D3D12_DEFAULT_BLEND_FACTOR_GREEN ( 1.0f ) +#define D3D12_DEFAULT_BLEND_FACTOR_RED ( 1.0f ) +#define D3D12_DEFAULT_BORDER_COLOR_COMPONENT ( 0.0f ) +#define D3D12_DEFAULT_DEPTH_BIAS ( 0 ) + +#define D3D12_DEFAULT_DEPTH_BIAS_CLAMP ( 0.0f ) +#define D3D12_DEFAULT_MAX_ANISOTROPY ( 16 ) + +#define D3D12_DEFAULT_MIP_LOD_BIAS ( 0.0f ) +#define D3D12_DEFAULT_MSAA_RESOURCE_PLACEMENT_ALIGNMENT ( 4194304 ) + +#define D3D12_DEFAULT_RENDER_TARGET_ARRAY_INDEX ( 0 ) + +#define D3D12_DEFAULT_RESOURCE_PLACEMENT_ALIGNMENT ( 65536 ) + +#define D3D12_DEFAULT_SAMPLE_MASK ( 0xffffffff ) + +#define D3D12_DEFAULT_SCISSOR_ENDX ( 0 ) + +#define D3D12_DEFAULT_SCISSOR_ENDY ( 0 ) + +#define D3D12_DEFAULT_SCISSOR_STARTX ( 0 ) + +#define D3D12_DEFAULT_SCISSOR_STARTY ( 0 ) + +#define D3D12_DEFAULT_SLOPE_SCALED_DEPTH_BIAS ( 0.0f ) +#define D3D12_DEFAULT_STENCIL_READ_MASK ( 0xff ) + +#define D3D12_DEFAULT_STENCIL_REFERENCE ( 0 ) + +#define D3D12_DEFAULT_STENCIL_WRITE_MASK ( 0xff ) + +#define D3D12_DEFAULT_VIEWPORT_AND_SCISSORRECT_INDEX ( 0 ) + +#define D3D12_DEFAULT_VIEWPORT_HEIGHT ( 0 ) + +#define D3D12_DEFAULT_VIEWPORT_MAX_DEPTH ( 0.0f ) +#define D3D12_DEFAULT_VIEWPORT_MIN_DEPTH ( 0.0f ) +#define D3D12_DEFAULT_VIEWPORT_TOPLEFTX ( 0 ) + +#define D3D12_DEFAULT_VIEWPORT_TOPLEFTY ( 0 ) + +#define D3D12_DEFAULT_VIEWPORT_WIDTH ( 0 ) + +#define D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND ( 0xffffffff ) + +#define D3D12_DRIVER_RESERVED_REGISTER_SPACE_VALUES_END ( 0xfffffff7 ) + +#define D3D12_DRIVER_RESERVED_REGISTER_SPACE_VALUES_START ( 0xfffffff0 ) + +#define D3D12_DS_INPUT_CONTROL_POINTS_MAX_TOTAL_SCALARS ( 3968 ) + +#define D3D12_DS_INPUT_CONTROL_POINT_REGISTER_COMPONENTS ( 4 ) + +#define D3D12_DS_INPUT_CONTROL_POINT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_DS_INPUT_CONTROL_POINT_REGISTER_COUNT ( 32 ) + +#define D3D12_DS_INPUT_CONTROL_POINT_REGISTER_READS_PER_INST ( 2 ) + +#define D3D12_DS_INPUT_CONTROL_POINT_REGISTER_READ_PORTS ( 1 ) + +#define D3D12_DS_INPUT_DOMAIN_POINT_REGISTER_COMPONENTS ( 3 ) + +#define D3D12_DS_INPUT_DOMAIN_POINT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_DS_INPUT_DOMAIN_POINT_REGISTER_COUNT ( 1 ) + +#define D3D12_DS_INPUT_DOMAIN_POINT_REGISTER_READS_PER_INST ( 2 ) + +#define D3D12_DS_INPUT_DOMAIN_POINT_REGISTER_READ_PORTS ( 1 ) + +#define D3D12_DS_INPUT_PATCH_CONSTANT_REGISTER_COMPONENTS ( 4 ) + +#define D3D12_DS_INPUT_PATCH_CONSTANT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_DS_INPUT_PATCH_CONSTANT_REGISTER_COUNT ( 32 ) + +#define D3D12_DS_INPUT_PATCH_CONSTANT_REGISTER_READS_PER_INST ( 2 ) + +#define D3D12_DS_INPUT_PATCH_CONSTANT_REGISTER_READ_PORTS ( 1 ) + +#define D3D12_DS_INPUT_PRIMITIVE_ID_REGISTER_COMPONENTS ( 1 ) + +#define D3D12_DS_INPUT_PRIMITIVE_ID_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_DS_INPUT_PRIMITIVE_ID_REGISTER_COUNT ( 1 ) + +#define D3D12_DS_INPUT_PRIMITIVE_ID_REGISTER_READS_PER_INST ( 2 ) + +#define D3D12_DS_INPUT_PRIMITIVE_ID_REGISTER_READ_PORTS ( 1 ) + +#define D3D12_DS_OUTPUT_REGISTER_COMPONENTS ( 4 ) + +#define D3D12_DS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_DS_OUTPUT_REGISTER_COUNT ( 32 ) + +#define D3D12_FLOAT16_FUSED_TOLERANCE_IN_ULP ( 0.6 ) +#define D3D12_FLOAT32_MAX ( 3.402823466e+38f ) +#define D3D12_FLOAT32_TO_INTEGER_TOLERANCE_IN_ULP ( 0.6f ) +#define D3D12_FLOAT_TO_SRGB_EXPONENT_DENOMINATOR ( 2.4f ) +#define D3D12_FLOAT_TO_SRGB_EXPONENT_NUMERATOR ( 1.0f ) +#define D3D12_FLOAT_TO_SRGB_OFFSET ( 0.055f ) +#define D3D12_FLOAT_TO_SRGB_SCALE_1 ( 12.92f ) +#define D3D12_FLOAT_TO_SRGB_SCALE_2 ( 1.055f ) +#define D3D12_FLOAT_TO_SRGB_THRESHOLD ( 0.0031308f ) +#define D3D12_FTOI_INSTRUCTION_MAX_INPUT ( 2147483647.999f ) +#define D3D12_FTOI_INSTRUCTION_MIN_INPUT ( -2147483648.999f ) +#define D3D12_FTOU_INSTRUCTION_MAX_INPUT ( 4294967295.999f ) +#define D3D12_FTOU_INSTRUCTION_MIN_INPUT ( 0.0f ) +#define D3D12_GS_INPUT_INSTANCE_ID_READS_PER_INST ( 2 ) + +#define D3D12_GS_INPUT_INSTANCE_ID_READ_PORTS ( 1 ) + +#define D3D12_GS_INPUT_INSTANCE_ID_REGISTER_COMPONENTS ( 1 ) + +#define D3D12_GS_INPUT_INSTANCE_ID_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_GS_INPUT_INSTANCE_ID_REGISTER_COUNT ( 1 ) + +#define D3D12_GS_INPUT_PRIM_CONST_REGISTER_COMPONENTS ( 1 ) + +#define D3D12_GS_INPUT_PRIM_CONST_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_GS_INPUT_PRIM_CONST_REGISTER_COUNT ( 1 ) + +#define D3D12_GS_INPUT_PRIM_CONST_REGISTER_READS_PER_INST ( 2 ) + +#define D3D12_GS_INPUT_PRIM_CONST_REGISTER_READ_PORTS ( 1 ) + +#define D3D12_GS_INPUT_REGISTER_COMPONENTS ( 4 ) + +#define D3D12_GS_INPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_GS_INPUT_REGISTER_COUNT ( 32 ) + +#define D3D12_GS_INPUT_REGISTER_READS_PER_INST ( 2 ) + +#define D3D12_GS_INPUT_REGISTER_READ_PORTS ( 1 ) + +#define D3D12_GS_INPUT_REGISTER_VERTICES ( 32 ) + +#define D3D12_GS_MAX_INSTANCE_COUNT ( 32 ) + +#define D3D12_GS_MAX_OUTPUT_VERTEX_COUNT_ACROSS_INSTANCES ( 1024 ) + +#define D3D12_GS_OUTPUT_ELEMENTS ( 32 ) + +#define D3D12_GS_OUTPUT_REGISTER_COMPONENTS ( 4 ) + +#define D3D12_GS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_GS_OUTPUT_REGISTER_COUNT ( 32 ) + +#define D3D12_HS_CONTROL_POINT_PHASE_INPUT_REGISTER_COUNT ( 32 ) + +#define D3D12_HS_CONTROL_POINT_PHASE_OUTPUT_REGISTER_COUNT ( 32 ) + +#define D3D12_HS_CONTROL_POINT_REGISTER_COMPONENTS ( 4 ) + +#define D3D12_HS_CONTROL_POINT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_HS_CONTROL_POINT_REGISTER_READS_PER_INST ( 2 ) + +#define D3D12_HS_CONTROL_POINT_REGISTER_READ_PORTS ( 1 ) + +#define D3D12_HS_FORK_PHASE_INSTANCE_COUNT_UPPER_BOUND ( 0xffffffff ) + +#define D3D12_HS_INPUT_FORK_INSTANCE_ID_REGISTER_COMPONENTS ( 1 ) + +#define D3D12_HS_INPUT_FORK_INSTANCE_ID_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_HS_INPUT_FORK_INSTANCE_ID_REGISTER_COUNT ( 1 ) + +#define D3D12_HS_INPUT_FORK_INSTANCE_ID_REGISTER_READS_PER_INST ( 2 ) + +#define D3D12_HS_INPUT_FORK_INSTANCE_ID_REGISTER_READ_PORTS ( 1 ) + +#define D3D12_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_COMPONENTS ( 1 ) + +#define D3D12_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_COUNT ( 1 ) + +#define D3D12_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_READS_PER_INST ( 2 ) + +#define D3D12_HS_INPUT_JOIN_INSTANCE_ID_REGISTER_READ_PORTS ( 1 ) + +#define D3D12_HS_INPUT_PRIMITIVE_ID_REGISTER_COMPONENTS ( 1 ) + +#define D3D12_HS_INPUT_PRIMITIVE_ID_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_HS_INPUT_PRIMITIVE_ID_REGISTER_COUNT ( 1 ) + +#define D3D12_HS_INPUT_PRIMITIVE_ID_REGISTER_READS_PER_INST ( 2 ) + +#define D3D12_HS_INPUT_PRIMITIVE_ID_REGISTER_READ_PORTS ( 1 ) + +#define D3D12_HS_JOIN_PHASE_INSTANCE_COUNT_UPPER_BOUND ( 0xffffffff ) + +#define D3D12_HS_MAXTESSFACTOR_LOWER_BOUND ( 1.0f ) +#define D3D12_HS_MAXTESSFACTOR_UPPER_BOUND ( 64.0f ) +#define D3D12_HS_OUTPUT_CONTROL_POINTS_MAX_TOTAL_SCALARS ( 3968 ) + +#define D3D12_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_COMPONENTS ( 1 ) + +#define D3D12_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_COUNT ( 1 ) + +#define D3D12_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_READS_PER_INST ( 2 ) + +#define D3D12_HS_OUTPUT_CONTROL_POINT_ID_REGISTER_READ_PORTS ( 1 ) + +#define D3D12_HS_OUTPUT_PATCH_CONSTANT_REGISTER_COMPONENTS ( 4 ) + +#define D3D12_HS_OUTPUT_PATCH_CONSTANT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_HS_OUTPUT_PATCH_CONSTANT_REGISTER_COUNT ( 32 ) + +#define D3D12_HS_OUTPUT_PATCH_CONSTANT_REGISTER_READS_PER_INST ( 2 ) + +#define D3D12_HS_OUTPUT_PATCH_CONSTANT_REGISTER_READ_PORTS ( 1 ) + +#define D3D12_HS_OUTPUT_PATCH_CONSTANT_REGISTER_SCALAR_COMPONENTS ( 128 ) + +#define D3D12_IA_DEFAULT_INDEX_BUFFER_OFFSET_IN_BYTES ( 0 ) + +#define D3D12_IA_DEFAULT_PRIMITIVE_TOPOLOGY ( 0 ) + +#define D3D12_IA_DEFAULT_VERTEX_BUFFER_OFFSET_IN_BYTES ( 0 ) + +#define D3D12_IA_INDEX_INPUT_RESOURCE_SLOT_COUNT ( 1 ) + +#define D3D12_IA_INSTANCE_ID_BIT_COUNT ( 32 ) + +#define D3D12_IA_INTEGER_ARITHMETIC_BIT_COUNT ( 32 ) + +#define D3D12_IA_PATCH_MAX_CONTROL_POINT_COUNT ( 32 ) + +#define D3D12_IA_PRIMITIVE_ID_BIT_COUNT ( 32 ) + +#define D3D12_IA_VERTEX_ID_BIT_COUNT ( 32 ) + +#define D3D12_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT ( 32 ) + +#define D3D12_IA_VERTEX_INPUT_STRUCTURE_ELEMENTS_COMPONENTS ( 128 ) + +#define D3D12_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT ( 32 ) + +#define D3D12_INTEGER_DIVIDE_BY_ZERO_QUOTIENT ( 0xffffffff ) + +#define D3D12_INTEGER_DIVIDE_BY_ZERO_REMAINDER ( 0xffffffff ) + +#define D3D12_KEEP_RENDER_TARGETS_AND_DEPTH_STENCIL ( 0xffffffff ) + +#define D3D12_KEEP_UNORDERED_ACCESS_VIEWS ( 0xffffffff ) + +#define D3D12_LINEAR_GAMMA ( 1.0f ) +#define D3D12_MAJOR_VERSION ( 12 ) + +#define D3D12_MAX_BORDER_COLOR_COMPONENT ( 1.0f ) +#define D3D12_MAX_DEPTH ( 1.0f ) +#define D3D12_MAX_LIVE_STATIC_SAMPLERS ( 2032 ) + +#define D3D12_MAX_MAXANISOTROPY ( 16 ) + +#define D3D12_MAX_MULTISAMPLE_SAMPLE_COUNT ( 32 ) + +#define D3D12_MAX_POSITION_VALUE ( 3.402823466e+34f ) +#define D3D12_MAX_ROOT_COST ( 64 ) + +#define D3D12_MAX_SHADER_VISIBLE_DESCRIPTOR_HEAP_SIZE_TIER_1 ( 1000000 ) + +#define D3D12_MAX_SHADER_VISIBLE_DESCRIPTOR_HEAP_SIZE_TIER_2 ( 1000000 ) + +#define D3D12_MAX_SHADER_VISIBLE_SAMPLER_HEAP_SIZE ( 2048 ) + +#define D3D12_MAX_TEXTURE_DIMENSION_2_TO_EXP ( 17 ) + +#define D3D12_MAX_VIEW_INSTANCE_COUNT ( 4 ) + +#define D3D12_MINOR_VERSION ( 0 ) + +#define D3D12_MIN_BORDER_COLOR_COMPONENT ( 0.0f ) +#define D3D12_MIN_DEPTH ( 0.0f ) +#define D3D12_MIN_MAXANISOTROPY ( 0 ) + +#define D3D12_MIP_LOD_BIAS_MAX ( 15.99f ) +#define D3D12_MIP_LOD_BIAS_MIN ( -16.0f ) +#define D3D12_MIP_LOD_FRACTIONAL_BIT_COUNT ( 8 ) + +#define D3D12_MIP_LOD_RANGE_BIT_COUNT ( 8 ) + +#define D3D12_MULTISAMPLE_ANTIALIAS_LINE_WIDTH ( 1.4f ) +#define D3D12_NONSAMPLE_FETCH_OUT_OF_RANGE_ACCESS_RESULT ( 0 ) + +#define D3D12_OS_RESERVED_REGISTER_SPACE_VALUES_END ( 0xffffffff ) + +#define D3D12_OS_RESERVED_REGISTER_SPACE_VALUES_START ( 0xfffffff8 ) + +#define D3D12_PACKED_TILE ( 0xffffffff ) + +#define D3D12_PIXEL_ADDRESS_RANGE_BIT_COUNT ( 15 ) + +#define D3D12_PREVIEW_SDK_VERSION ( 706 ) + +#define D3D12_PRE_SCISSOR_PIXEL_ADDRESS_RANGE_BIT_COUNT ( 16 ) + +#define D3D12_PS_CS_UAV_REGISTER_COMPONENTS ( 1 ) + +#define D3D12_PS_CS_UAV_REGISTER_COUNT ( 8 ) + +#define D3D12_PS_CS_UAV_REGISTER_READS_PER_INST ( 1 ) + +#define D3D12_PS_CS_UAV_REGISTER_READ_PORTS ( 1 ) + +#define D3D12_PS_FRONTFACING_DEFAULT_VALUE ( 0xffffffff ) + +#define D3D12_PS_FRONTFACING_FALSE_VALUE ( 0 ) + +#define D3D12_PS_FRONTFACING_TRUE_VALUE ( 0xffffffff ) + +#define D3D12_PS_INPUT_REGISTER_COMPONENTS ( 4 ) + +#define D3D12_PS_INPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_PS_INPUT_REGISTER_COUNT ( 32 ) + +#define D3D12_PS_INPUT_REGISTER_READS_PER_INST ( 2 ) + +#define D3D12_PS_INPUT_REGISTER_READ_PORTS ( 1 ) + +#define D3D12_PS_LEGACY_PIXEL_CENTER_FRACTIONAL_COMPONENT ( 0.0f ) +#define D3D12_PS_OUTPUT_DEPTH_REGISTER_COMPONENTS ( 1 ) + +#define D3D12_PS_OUTPUT_DEPTH_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_PS_OUTPUT_DEPTH_REGISTER_COUNT ( 1 ) + +#define D3D12_PS_OUTPUT_MASK_REGISTER_COMPONENTS ( 1 ) + +#define D3D12_PS_OUTPUT_MASK_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_PS_OUTPUT_MASK_REGISTER_COUNT ( 1 ) + +#define D3D12_PS_OUTPUT_REGISTER_COMPONENTS ( 4 ) + +#define D3D12_PS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_PS_OUTPUT_REGISTER_COUNT ( 8 ) + +#define D3D12_PS_PIXEL_CENTER_FRACTIONAL_COMPONENT ( 0.5f ) +#define D3D12_RAW_UAV_SRV_BYTE_ALIGNMENT ( 16 ) + +#define D3D12_RAYTRACING_AABB_BYTE_ALIGNMENT ( 8 ) + +#define D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BYTE_ALIGNMENT ( 256 ) + +#define D3D12_RAYTRACING_INSTANCE_DESCS_BYTE_ALIGNMENT ( 16 ) + +#define D3D12_RAYTRACING_MAX_ATTRIBUTE_SIZE_IN_BYTES ( 32 ) + +#define D3D12_RAYTRACING_MAX_DECLARABLE_TRACE_RECURSION_DEPTH ( 31 ) + +#define D3D12_RAYTRACING_MAX_GEOMETRIES_PER_BOTTOM_LEVEL_ACCELERATION_STRUCTURE ( 16777216 ) + +#define D3D12_RAYTRACING_MAX_INSTANCES_PER_TOP_LEVEL_ACCELERATION_STRUCTURE ( 16777216 ) + +#define D3D12_RAYTRACING_MAX_PRIMITIVES_PER_BOTTOM_LEVEL_ACCELERATION_STRUCTURE ( 536870912 ) + +#define D3D12_RAYTRACING_MAX_RAY_GENERATION_SHADER_THREADS ( 1073741824 ) + +#define D3D12_RAYTRACING_MAX_SHADER_RECORD_STRIDE ( 4096 ) + +#define D3D12_RAYTRACING_SHADER_RECORD_BYTE_ALIGNMENT ( 32 ) + +#define D3D12_RAYTRACING_SHADER_TABLE_BYTE_ALIGNMENT ( 64 ) + +#define D3D12_RAYTRACING_TRANSFORM3X4_BYTE_ALIGNMENT ( 16 ) + +#define D3D12_REQ_BLEND_OBJECT_COUNT_PER_DEVICE ( 4096 ) + +#define D3D12_REQ_BUFFER_RESOURCE_TEXEL_COUNT_2_TO_EXP ( 27 ) + +#define D3D12_REQ_CONSTANT_BUFFER_ELEMENT_COUNT ( 4096 ) + +#define D3D12_REQ_DEPTH_STENCIL_OBJECT_COUNT_PER_DEVICE ( 4096 ) + +#define D3D12_REQ_DRAWINDEXED_INDEX_COUNT_2_TO_EXP ( 32 ) + +#define D3D12_REQ_DRAW_VERTEX_COUNT_2_TO_EXP ( 32 ) + +#define D3D12_REQ_FILTERING_HW_ADDRESSABLE_RESOURCE_DIMENSION ( 16384 ) + +#define D3D12_REQ_GS_INVOCATION_32BIT_OUTPUT_COMPONENT_LIMIT ( 1024 ) + +#define D3D12_REQ_IMMEDIATE_CONSTANT_BUFFER_ELEMENT_COUNT ( 4096 ) + +#define D3D12_REQ_MAXANISOTROPY ( 16 ) + +#define D3D12_REQ_MIP_LEVELS ( 15 ) + +#define D3D12_REQ_MULTI_ELEMENT_STRUCTURE_SIZE_IN_BYTES ( 2048 ) + +#define D3D12_REQ_RASTERIZER_OBJECT_COUNT_PER_DEVICE ( 4096 ) + +#define D3D12_REQ_RENDER_TO_BUFFER_WINDOW_WIDTH ( 16384 ) + +#define D3D12_REQ_RESOURCE_SIZE_IN_MEGABYTES_EXPRESSION_A_TERM ( 128 ) + +#define D3D12_REQ_RESOURCE_SIZE_IN_MEGABYTES_EXPRESSION_B_TERM ( 0.25f ) +#define D3D12_REQ_RESOURCE_SIZE_IN_MEGABYTES_EXPRESSION_C_TERM ( 2048 ) + +#define D3D12_REQ_RESOURCE_VIEW_COUNT_PER_DEVICE_2_TO_EXP ( 20 ) + +#define D3D12_REQ_SAMPLER_OBJECT_COUNT_PER_DEVICE ( 4096 ) + +#define D3D12_REQ_SUBRESOURCES ( 30720 ) + +#define D3D12_REQ_TEXTURE1D_ARRAY_AXIS_DIMENSION ( 2048 ) + +#define D3D12_REQ_TEXTURE1D_U_DIMENSION ( 16384 ) + +#define D3D12_REQ_TEXTURE2D_ARRAY_AXIS_DIMENSION ( 2048 ) + +#define D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION ( 16384 ) + +#define D3D12_REQ_TEXTURE3D_U_V_OR_W_DIMENSION ( 2048 ) + +#define D3D12_REQ_TEXTURECUBE_DIMENSION ( 16384 ) + +#define D3D12_RESINFO_INSTRUCTION_MISSING_COMPONENT_RETVAL ( 0 ) + +#define D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES ( 0xffffffff ) + +#define D3D12_RS_SET_SHADING_RATE_COMBINER_COUNT ( 2 ) + +#define D3D12_SDK_VERSION ( 606 ) + +#define D3D12_SHADER_IDENTIFIER_SIZE_IN_BYTES ( 32 ) + +#define D3D12_SHADER_MAJOR_VERSION ( 5 ) + +#define D3D12_SHADER_MAX_INSTANCES ( 65535 ) + +#define D3D12_SHADER_MAX_INTERFACES ( 253 ) + +#define D3D12_SHADER_MAX_INTERFACE_CALL_SITES ( 4096 ) + +#define D3D12_SHADER_MAX_TYPES ( 65535 ) + +#define D3D12_SHADER_MINOR_VERSION ( 1 ) + +#define D3D12_SHIFT_INSTRUCTION_PAD_VALUE ( 0 ) + +#define D3D12_SHIFT_INSTRUCTION_SHIFT_VALUE_BIT_COUNT ( 5 ) + +#define D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT ( 8 ) + +#define D3D12_SMALL_MSAA_RESOURCE_PLACEMENT_ALIGNMENT ( 65536 ) + +#define D3D12_SMALL_RESOURCE_PLACEMENT_ALIGNMENT ( 4096 ) + +#define D3D12_SO_BUFFER_MAX_STRIDE_IN_BYTES ( 2048 ) + +#define D3D12_SO_BUFFER_MAX_WRITE_WINDOW_IN_BYTES ( 512 ) + +#define D3D12_SO_BUFFER_SLOT_COUNT ( 4 ) + +#define D3D12_SO_DDI_REGISTER_INDEX_DENOTING_GAP ( 0xffffffff ) + +#define D3D12_SO_NO_RASTERIZED_STREAM ( 0xffffffff ) + +#define D3D12_SO_OUTPUT_COMPONENT_COUNT ( 128 ) + +#define D3D12_SO_STREAM_COUNT ( 4 ) + +#define D3D12_SPEC_DATE_DAY ( 14 ) + +#define D3D12_SPEC_DATE_MONTH ( 11 ) + +#define D3D12_SPEC_DATE_YEAR ( 2014 ) + +#define D3D12_SPEC_VERSION ( 1.16 ) +#define D3D12_SRGB_GAMMA ( 2.2f ) +#define D3D12_SRGB_TO_FLOAT_DENOMINATOR_1 ( 12.92f ) +#define D3D12_SRGB_TO_FLOAT_DENOMINATOR_2 ( 1.055f ) +#define D3D12_SRGB_TO_FLOAT_EXPONENT ( 2.4f ) +#define D3D12_SRGB_TO_FLOAT_OFFSET ( 0.055f ) +#define D3D12_SRGB_TO_FLOAT_THRESHOLD ( 0.04045f ) +#define D3D12_SRGB_TO_FLOAT_TOLERANCE_IN_ULP ( 0.5f ) +#define D3D12_STANDARD_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_STANDARD_COMPONENT_BIT_COUNT_DOUBLED ( 64 ) + +#define D3D12_STANDARD_MAXIMUM_ELEMENT_ALIGNMENT_BYTE_MULTIPLE ( 4 ) + +#define D3D12_STANDARD_PIXEL_COMPONENT_COUNT ( 128 ) + +#define D3D12_STANDARD_PIXEL_ELEMENT_COUNT ( 32 ) + +#define D3D12_STANDARD_VECTOR_SIZE ( 4 ) + +#define D3D12_STANDARD_VERTEX_ELEMENT_COUNT ( 32 ) + +#define D3D12_STANDARD_VERTEX_TOTAL_COMPONENT_COUNT ( 64 ) + +#define D3D12_SUBPIXEL_FRACTIONAL_BIT_COUNT ( 8 ) + +#define D3D12_SUBTEXEL_FRACTIONAL_BIT_COUNT ( 8 ) + +#define D3D12_SYSTEM_RESERVED_REGISTER_SPACE_VALUES_END ( 0xffffffff ) + +#define D3D12_SYSTEM_RESERVED_REGISTER_SPACE_VALUES_START ( 0xfffffff0 ) + +#define D3D12_TESSELLATOR_MAX_EVEN_TESSELLATION_FACTOR ( 64 ) + +#define D3D12_TESSELLATOR_MAX_ISOLINE_DENSITY_TESSELLATION_FACTOR ( 64 ) + +#define D3D12_TESSELLATOR_MAX_ODD_TESSELLATION_FACTOR ( 63 ) + +#define D3D12_TESSELLATOR_MAX_TESSELLATION_FACTOR ( 64 ) + +#define D3D12_TESSELLATOR_MIN_EVEN_TESSELLATION_FACTOR ( 2 ) + +#define D3D12_TESSELLATOR_MIN_ISOLINE_DENSITY_TESSELLATION_FACTOR ( 1 ) + +#define D3D12_TESSELLATOR_MIN_ODD_TESSELLATION_FACTOR ( 1 ) + +#define D3D12_TEXEL_ADDRESS_RANGE_BIT_COUNT ( 16 ) + +#define D3D12_TEXTURE_DATA_PITCH_ALIGNMENT ( 256 ) + +#define D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT ( 512 ) + +#define D3D12_TILED_RESOURCE_TILE_SIZE_IN_BYTES ( 65536 ) + +#define D3D12_TRACKED_WORKLOAD_MAX_INSTANCES ( 32 ) + +#define D3D12_UAV_COUNTER_PLACEMENT_ALIGNMENT ( 4096 ) + +#define D3D12_UAV_SLOT_COUNT ( 64 ) + +#define D3D12_UNBOUND_MEMORY_ACCESS_RESULT ( 0 ) + +#define D3D12_VIDEO_DECODE_MAX_ARGUMENTS ( 10 ) + +#define D3D12_VIDEO_DECODE_MAX_HISTOGRAM_COMPONENTS ( 4 ) + +#define D3D12_VIDEO_DECODE_MIN_BITSTREAM_OFFSET_ALIGNMENT ( 256 ) + +#define D3D12_VIDEO_DECODE_MIN_HISTOGRAM_OFFSET_ALIGNMENT ( 256 ) + +#define D3D12_VIDEO_DECODE_STATUS_MACROBLOCKS_AFFECTED_UNKNOWN ( 0xffffffff ) + +#define D3D12_VIDEO_PROCESS_MAX_FILTERS ( 32 ) + +#define D3D12_VIDEO_PROCESS_STEREO_VIEWS ( 2 ) + +#define D3D12_VIEWPORT_AND_SCISSORRECT_MAX_INDEX ( 15 ) + +#define D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE ( 16 ) + +#define D3D12_VIEWPORT_BOUNDS_MAX ( 32767 ) + +#define D3D12_VIEWPORT_BOUNDS_MIN ( -32768 ) + +#define D3D12_VS_INPUT_REGISTER_COMPONENTS ( 4 ) + +#define D3D12_VS_INPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_VS_INPUT_REGISTER_COUNT ( 32 ) + +#define D3D12_VS_INPUT_REGISTER_READS_PER_INST ( 2 ) + +#define D3D12_VS_INPUT_REGISTER_READ_PORTS ( 1 ) + +#define D3D12_VS_OUTPUT_REGISTER_COMPONENTS ( 4 ) + +#define D3D12_VS_OUTPUT_REGISTER_COMPONENT_BIT_COUNT ( 32 ) + +#define D3D12_VS_OUTPUT_REGISTER_COUNT ( 32 ) + +#define D3D12_WHQL_CONTEXT_COUNT_FOR_RESOURCE_LIMIT ( 10 ) + +#define D3D12_WHQL_DRAWINDEXED_INDEX_COUNT_2_TO_EXP ( 25 ) + +#define D3D12_WHQL_DRAW_VERTEX_COUNT_2_TO_EXP ( 25 ) + +#endif + +typedef UINT64 D3D12_GPU_VIRTUAL_ADDRESS; + +typedef +enum D3D12_COMMAND_LIST_TYPE + { + D3D12_COMMAND_LIST_TYPE_DIRECT = 0, + D3D12_COMMAND_LIST_TYPE_BUNDLE = 1, + D3D12_COMMAND_LIST_TYPE_COMPUTE = 2, + D3D12_COMMAND_LIST_TYPE_COPY = 3, + D3D12_COMMAND_LIST_TYPE_VIDEO_DECODE = 4, + D3D12_COMMAND_LIST_TYPE_VIDEO_PROCESS = 5, + D3D12_COMMAND_LIST_TYPE_VIDEO_ENCODE = 6, + D3D12_COMMAND_LIST_TYPE_NONE = -1 + } D3D12_COMMAND_LIST_TYPE; + +typedef +enum D3D12_COMMAND_QUEUE_FLAGS + { + D3D12_COMMAND_QUEUE_FLAG_NONE = 0, + D3D12_COMMAND_QUEUE_FLAG_DISABLE_GPU_TIMEOUT = 0x1 + } D3D12_COMMAND_QUEUE_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMMAND_QUEUE_FLAGS ); +typedef +enum D3D12_COMMAND_QUEUE_PRIORITY + { + D3D12_COMMAND_QUEUE_PRIORITY_NORMAL = 0, + D3D12_COMMAND_QUEUE_PRIORITY_HIGH = 100, + D3D12_COMMAND_QUEUE_PRIORITY_GLOBAL_REALTIME = 10000 + } D3D12_COMMAND_QUEUE_PRIORITY; + +typedef struct D3D12_COMMAND_QUEUE_DESC + { + D3D12_COMMAND_LIST_TYPE Type; + INT Priority; + D3D12_COMMAND_QUEUE_FLAGS Flags; + UINT NodeMask; + } D3D12_COMMAND_QUEUE_DESC; + +typedef +enum D3D12_PRIMITIVE_TOPOLOGY_TYPE + { + D3D12_PRIMITIVE_TOPOLOGY_TYPE_UNDEFINED = 0, + D3D12_PRIMITIVE_TOPOLOGY_TYPE_POINT = 1, + D3D12_PRIMITIVE_TOPOLOGY_TYPE_LINE = 2, + D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE = 3, + D3D12_PRIMITIVE_TOPOLOGY_TYPE_PATCH = 4 + } D3D12_PRIMITIVE_TOPOLOGY_TYPE; + +typedef +enum D3D12_INPUT_CLASSIFICATION + { + D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA = 0, + D3D12_INPUT_CLASSIFICATION_PER_INSTANCE_DATA = 1 + } D3D12_INPUT_CLASSIFICATION; + +typedef struct D3D12_INPUT_ELEMENT_DESC + { + LPCSTR SemanticName; + UINT SemanticIndex; + DXGI_FORMAT Format; + UINT InputSlot; + UINT AlignedByteOffset; + D3D12_INPUT_CLASSIFICATION InputSlotClass; + UINT InstanceDataStepRate; + } D3D12_INPUT_ELEMENT_DESC; + +typedef +enum D3D12_FILL_MODE + { + D3D12_FILL_MODE_WIREFRAME = 2, + D3D12_FILL_MODE_SOLID = 3 + } D3D12_FILL_MODE; + +typedef D3D_PRIMITIVE_TOPOLOGY D3D12_PRIMITIVE_TOPOLOGY; + +typedef D3D_PRIMITIVE D3D12_PRIMITIVE; + +typedef +enum D3D12_CULL_MODE + { + D3D12_CULL_MODE_NONE = 1, + D3D12_CULL_MODE_FRONT = 2, + D3D12_CULL_MODE_BACK = 3 + } D3D12_CULL_MODE; + +typedef struct D3D12_SO_DECLARATION_ENTRY + { + UINT Stream; + LPCSTR SemanticName; + UINT SemanticIndex; + BYTE StartComponent; + BYTE ComponentCount; + BYTE OutputSlot; + } D3D12_SO_DECLARATION_ENTRY; + +typedef struct D3D12_VIEWPORT + { + FLOAT TopLeftX; + FLOAT TopLeftY; + FLOAT Width; + FLOAT Height; + FLOAT MinDepth; + FLOAT MaxDepth; + } D3D12_VIEWPORT; + +typedef RECT D3D12_RECT; + +typedef struct D3D12_BOX + { + UINT left; + UINT top; + UINT front; + UINT right; + UINT bottom; + UINT back; + } D3D12_BOX; + +typedef +enum D3D12_COMPARISON_FUNC + { + D3D12_COMPARISON_FUNC_NONE = 0, + D3D12_COMPARISON_FUNC_NEVER = 1, + D3D12_COMPARISON_FUNC_LESS = 2, + D3D12_COMPARISON_FUNC_EQUAL = 3, + D3D12_COMPARISON_FUNC_LESS_EQUAL = 4, + D3D12_COMPARISON_FUNC_GREATER = 5, + D3D12_COMPARISON_FUNC_NOT_EQUAL = 6, + D3D12_COMPARISON_FUNC_GREATER_EQUAL = 7, + D3D12_COMPARISON_FUNC_ALWAYS = 8 + } D3D12_COMPARISON_FUNC; + +typedef +enum D3D12_DEPTH_WRITE_MASK + { + D3D12_DEPTH_WRITE_MASK_ZERO = 0, + D3D12_DEPTH_WRITE_MASK_ALL = 1 + } D3D12_DEPTH_WRITE_MASK; + +typedef +enum D3D12_STENCIL_OP + { + D3D12_STENCIL_OP_KEEP = 1, + D3D12_STENCIL_OP_ZERO = 2, + D3D12_STENCIL_OP_REPLACE = 3, + D3D12_STENCIL_OP_INCR_SAT = 4, + D3D12_STENCIL_OP_DECR_SAT = 5, + D3D12_STENCIL_OP_INVERT = 6, + D3D12_STENCIL_OP_INCR = 7, + D3D12_STENCIL_OP_DECR = 8 + } D3D12_STENCIL_OP; + +typedef struct D3D12_DEPTH_STENCILOP_DESC + { + D3D12_STENCIL_OP StencilFailOp; + D3D12_STENCIL_OP StencilDepthFailOp; + D3D12_STENCIL_OP StencilPassOp; + D3D12_COMPARISON_FUNC StencilFunc; + } D3D12_DEPTH_STENCILOP_DESC; + +typedef struct D3D12_DEPTH_STENCIL_DESC + { + BOOL DepthEnable; + D3D12_DEPTH_WRITE_MASK DepthWriteMask; + D3D12_COMPARISON_FUNC DepthFunc; + BOOL StencilEnable; + UINT8 StencilReadMask; + UINT8 StencilWriteMask; + D3D12_DEPTH_STENCILOP_DESC FrontFace; + D3D12_DEPTH_STENCILOP_DESC BackFace; + } D3D12_DEPTH_STENCIL_DESC; + +typedef struct D3D12_DEPTH_STENCIL_DESC1 + { + BOOL DepthEnable; + D3D12_DEPTH_WRITE_MASK DepthWriteMask; + D3D12_COMPARISON_FUNC DepthFunc; + BOOL StencilEnable; + UINT8 StencilReadMask; + UINT8 StencilWriteMask; + D3D12_DEPTH_STENCILOP_DESC FrontFace; + D3D12_DEPTH_STENCILOP_DESC BackFace; + BOOL DepthBoundsTestEnable; + } D3D12_DEPTH_STENCIL_DESC1; + +typedef struct D3D12_DEPTH_STENCILOP_DESC1 + { + D3D12_STENCIL_OP StencilFailOp; + D3D12_STENCIL_OP StencilDepthFailOp; + D3D12_STENCIL_OP StencilPassOp; + D3D12_COMPARISON_FUNC StencilFunc; + UINT8 StencilReadMask; + UINT8 StencilWriteMask; + } D3D12_DEPTH_STENCILOP_DESC1; + +typedef struct D3D12_DEPTH_STENCIL_DESC2 + { + BOOL DepthEnable; + D3D12_DEPTH_WRITE_MASK DepthWriteMask; + D3D12_COMPARISON_FUNC DepthFunc; + BOOL StencilEnable; + D3D12_DEPTH_STENCILOP_DESC1 FrontFace; + D3D12_DEPTH_STENCILOP_DESC1 BackFace; + BOOL DepthBoundsTestEnable; + } D3D12_DEPTH_STENCIL_DESC2; + +typedef +enum D3D12_BLEND + { + D3D12_BLEND_ZERO = 1, + D3D12_BLEND_ONE = 2, + D3D12_BLEND_SRC_COLOR = 3, + D3D12_BLEND_INV_SRC_COLOR = 4, + D3D12_BLEND_SRC_ALPHA = 5, + D3D12_BLEND_INV_SRC_ALPHA = 6, + D3D12_BLEND_DEST_ALPHA = 7, + D3D12_BLEND_INV_DEST_ALPHA = 8, + D3D12_BLEND_DEST_COLOR = 9, + D3D12_BLEND_INV_DEST_COLOR = 10, + D3D12_BLEND_SRC_ALPHA_SAT = 11, + D3D12_BLEND_BLEND_FACTOR = 14, + D3D12_BLEND_INV_BLEND_FACTOR = 15, + D3D12_BLEND_SRC1_COLOR = 16, + D3D12_BLEND_INV_SRC1_COLOR = 17, + D3D12_BLEND_SRC1_ALPHA = 18, + D3D12_BLEND_INV_SRC1_ALPHA = 19, + D3D12_BLEND_ALPHA_FACTOR = 20, + D3D12_BLEND_INV_ALPHA_FACTOR = 21 + } D3D12_BLEND; + +typedef +enum D3D12_BLEND_OP + { + D3D12_BLEND_OP_ADD = 1, + D3D12_BLEND_OP_SUBTRACT = 2, + D3D12_BLEND_OP_REV_SUBTRACT = 3, + D3D12_BLEND_OP_MIN = 4, + D3D12_BLEND_OP_MAX = 5 + } D3D12_BLEND_OP; + +typedef +enum D3D12_COLOR_WRITE_ENABLE + { + D3D12_COLOR_WRITE_ENABLE_RED = 1, + D3D12_COLOR_WRITE_ENABLE_GREEN = 2, + D3D12_COLOR_WRITE_ENABLE_BLUE = 4, + D3D12_COLOR_WRITE_ENABLE_ALPHA = 8, + D3D12_COLOR_WRITE_ENABLE_ALL = ( ( ( D3D12_COLOR_WRITE_ENABLE_RED | D3D12_COLOR_WRITE_ENABLE_GREEN ) | D3D12_COLOR_WRITE_ENABLE_BLUE ) | D3D12_COLOR_WRITE_ENABLE_ALPHA ) + } D3D12_COLOR_WRITE_ENABLE; + +typedef +enum D3D12_LOGIC_OP + { + D3D12_LOGIC_OP_CLEAR = 0, + D3D12_LOGIC_OP_SET = ( D3D12_LOGIC_OP_CLEAR + 1 ) , + D3D12_LOGIC_OP_COPY = ( D3D12_LOGIC_OP_SET + 1 ) , + D3D12_LOGIC_OP_COPY_INVERTED = ( D3D12_LOGIC_OP_COPY + 1 ) , + D3D12_LOGIC_OP_NOOP = ( D3D12_LOGIC_OP_COPY_INVERTED + 1 ) , + D3D12_LOGIC_OP_INVERT = ( D3D12_LOGIC_OP_NOOP + 1 ) , + D3D12_LOGIC_OP_AND = ( D3D12_LOGIC_OP_INVERT + 1 ) , + D3D12_LOGIC_OP_NAND = ( D3D12_LOGIC_OP_AND + 1 ) , + D3D12_LOGIC_OP_OR = ( D3D12_LOGIC_OP_NAND + 1 ) , + D3D12_LOGIC_OP_NOR = ( D3D12_LOGIC_OP_OR + 1 ) , + D3D12_LOGIC_OP_XOR = ( D3D12_LOGIC_OP_NOR + 1 ) , + D3D12_LOGIC_OP_EQUIV = ( D3D12_LOGIC_OP_XOR + 1 ) , + D3D12_LOGIC_OP_AND_REVERSE = ( D3D12_LOGIC_OP_EQUIV + 1 ) , + D3D12_LOGIC_OP_AND_INVERTED = ( D3D12_LOGIC_OP_AND_REVERSE + 1 ) , + D3D12_LOGIC_OP_OR_REVERSE = ( D3D12_LOGIC_OP_AND_INVERTED + 1 ) , + D3D12_LOGIC_OP_OR_INVERTED = ( D3D12_LOGIC_OP_OR_REVERSE + 1 ) + } D3D12_LOGIC_OP; + +typedef struct D3D12_RENDER_TARGET_BLEND_DESC + { + BOOL BlendEnable; + BOOL LogicOpEnable; + D3D12_BLEND SrcBlend; + D3D12_BLEND DestBlend; + D3D12_BLEND_OP BlendOp; + D3D12_BLEND SrcBlendAlpha; + D3D12_BLEND DestBlendAlpha; + D3D12_BLEND_OP BlendOpAlpha; + D3D12_LOGIC_OP LogicOp; + UINT8 RenderTargetWriteMask; + } D3D12_RENDER_TARGET_BLEND_DESC; + +typedef struct D3D12_BLEND_DESC + { + BOOL AlphaToCoverageEnable; + BOOL IndependentBlendEnable; + D3D12_RENDER_TARGET_BLEND_DESC RenderTarget[ 8 ]; + } D3D12_BLEND_DESC; + +/* Note, the array size for RenderTarget[] above is D3D12_SIMULTANEOUS_RENDERTARGET_COUNT. + IDL processing/generation of this header replaces the define; this comment is merely explaining what happened. */ +typedef +enum D3D12_CONSERVATIVE_RASTERIZATION_MODE + { + D3D12_CONSERVATIVE_RASTERIZATION_MODE_OFF = 0, + D3D12_CONSERVATIVE_RASTERIZATION_MODE_ON = 1 + } D3D12_CONSERVATIVE_RASTERIZATION_MODE; + +typedef struct D3D12_RASTERIZER_DESC + { + D3D12_FILL_MODE FillMode; + D3D12_CULL_MODE CullMode; + BOOL FrontCounterClockwise; + INT DepthBias; + FLOAT DepthBiasClamp; + FLOAT SlopeScaledDepthBias; + BOOL DepthClipEnable; + BOOL MultisampleEnable; + BOOL AntialiasedLineEnable; + UINT ForcedSampleCount; + D3D12_CONSERVATIVE_RASTERIZATION_MODE ConservativeRaster; + } D3D12_RASTERIZER_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0000_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0000_v0_0_s_ifspec; + +#ifndef __ID3D12Object_INTERFACE_DEFINED__ +#define __ID3D12Object_INTERFACE_DEFINED__ + +/* interface ID3D12Object */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Object; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("c4fec28f-7966-4e95-9f94-f431cb56c3b8") + ID3D12Object : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE GetPrivateData( + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetPrivateData( + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetPrivateDataInterface( + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetName( + _In_z_ LPCWSTR Name) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12ObjectVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Object * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Object * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Object * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Object * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Object * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Object * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Object * This, + _In_z_ LPCWSTR Name); + + END_INTERFACE + } ID3D12ObjectVtbl; + + interface ID3D12Object + { + CONST_VTBL struct ID3D12ObjectVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Object_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Object_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Object_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Object_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Object_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Object_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Object_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Object_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12DeviceChild_INTERFACE_DEFINED__ +#define __ID3D12DeviceChild_INTERFACE_DEFINED__ + +/* interface ID3D12DeviceChild */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DeviceChild; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("905db94b-a00c-4140-9df5-2b64ca9ea357") + ID3D12DeviceChild : public ID3D12Object + { + public: + virtual HRESULT STDMETHODCALLTYPE GetDevice( + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DeviceChildVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DeviceChild * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DeviceChild * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DeviceChild * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12DeviceChild * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12DeviceChild * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12DeviceChild * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12DeviceChild * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12DeviceChild * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + END_INTERFACE + } ID3D12DeviceChildVtbl; + + interface ID3D12DeviceChild + { + CONST_VTBL struct ID3D12DeviceChildVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DeviceChild_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DeviceChild_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DeviceChild_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DeviceChild_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12DeviceChild_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12DeviceChild_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12DeviceChild_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12DeviceChild_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DeviceChild_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12RootSignature_INTERFACE_DEFINED__ +#define __ID3D12RootSignature_INTERFACE_DEFINED__ + +/* interface ID3D12RootSignature */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12RootSignature; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("c54a6b66-72df-4ee8-8be5-a946a1429214") + ID3D12RootSignature : public ID3D12DeviceChild + { + public: + }; + + +#else /* C style interface */ + + typedef struct ID3D12RootSignatureVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12RootSignature * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12RootSignature * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12RootSignature * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12RootSignature * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12RootSignature * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12RootSignature * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12RootSignature * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12RootSignature * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + END_INTERFACE + } ID3D12RootSignatureVtbl; + + interface ID3D12RootSignature + { + CONST_VTBL struct ID3D12RootSignatureVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12RootSignature_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12RootSignature_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12RootSignature_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12RootSignature_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12RootSignature_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12RootSignature_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12RootSignature_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12RootSignature_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12RootSignature_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0001 */ +/* [local] */ + +typedef struct D3D12_SHADER_BYTECODE + { + _Field_size_bytes_full_(BytecodeLength) const void *pShaderBytecode; + SIZE_T BytecodeLength; + } D3D12_SHADER_BYTECODE; + +typedef struct D3D12_STREAM_OUTPUT_DESC + { + _Field_size_full_(NumEntries) const D3D12_SO_DECLARATION_ENTRY *pSODeclaration; + UINT NumEntries; + _Field_size_full_(NumStrides) const UINT *pBufferStrides; + UINT NumStrides; + UINT RasterizedStream; + } D3D12_STREAM_OUTPUT_DESC; + +typedef struct D3D12_INPUT_LAYOUT_DESC + { + _Field_size_full_(NumElements) const D3D12_INPUT_ELEMENT_DESC *pInputElementDescs; + UINT NumElements; + } D3D12_INPUT_LAYOUT_DESC; + +typedef +enum D3D12_INDEX_BUFFER_STRIP_CUT_VALUE + { + D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_DISABLED = 0, + D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_0xFFFF = 1, + D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_0xFFFFFFFF = 2 + } D3D12_INDEX_BUFFER_STRIP_CUT_VALUE; + +typedef struct D3D12_CACHED_PIPELINE_STATE + { + _Field_size_bytes_full_(CachedBlobSizeInBytes) const void *pCachedBlob; + SIZE_T CachedBlobSizeInBytes; + } D3D12_CACHED_PIPELINE_STATE; + +typedef +enum D3D12_PIPELINE_STATE_FLAGS + { + D3D12_PIPELINE_STATE_FLAG_NONE = 0, + D3D12_PIPELINE_STATE_FLAG_TOOL_DEBUG = 0x1 + } D3D12_PIPELINE_STATE_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_PIPELINE_STATE_FLAGS ); +typedef struct D3D12_GRAPHICS_PIPELINE_STATE_DESC + { + ID3D12RootSignature *pRootSignature; + D3D12_SHADER_BYTECODE VS; + D3D12_SHADER_BYTECODE PS; + D3D12_SHADER_BYTECODE DS; + D3D12_SHADER_BYTECODE HS; + D3D12_SHADER_BYTECODE GS; + D3D12_STREAM_OUTPUT_DESC StreamOutput; + D3D12_BLEND_DESC BlendState; + UINT SampleMask; + D3D12_RASTERIZER_DESC RasterizerState; + D3D12_DEPTH_STENCIL_DESC DepthStencilState; + D3D12_INPUT_LAYOUT_DESC InputLayout; + D3D12_INDEX_BUFFER_STRIP_CUT_VALUE IBStripCutValue; + D3D12_PRIMITIVE_TOPOLOGY_TYPE PrimitiveTopologyType; + UINT NumRenderTargets; + DXGI_FORMAT RTVFormats[ 8 ]; + DXGI_FORMAT DSVFormat; + DXGI_SAMPLE_DESC SampleDesc; + UINT NodeMask; + D3D12_CACHED_PIPELINE_STATE CachedPSO; + D3D12_PIPELINE_STATE_FLAGS Flags; + } D3D12_GRAPHICS_PIPELINE_STATE_DESC; + +typedef struct D3D12_COMPUTE_PIPELINE_STATE_DESC + { + ID3D12RootSignature *pRootSignature; + D3D12_SHADER_BYTECODE CS; + UINT NodeMask; + D3D12_CACHED_PIPELINE_STATE CachedPSO; + D3D12_PIPELINE_STATE_FLAGS Flags; + } D3D12_COMPUTE_PIPELINE_STATE_DESC; + +struct D3D12_RT_FORMAT_ARRAY + { + DXGI_FORMAT RTFormats[ 8 ]; + UINT NumRenderTargets; + } ; +typedef struct D3D12_PIPELINE_STATE_STREAM_DESC + { + _In_ SIZE_T SizeInBytes; + _In_reads_(_Inexpressible_("Dependent on size of subobjects")) void *pPipelineStateSubobjectStream; + } D3D12_PIPELINE_STATE_STREAM_DESC; + +typedef +enum D3D12_PIPELINE_STATE_SUBOBJECT_TYPE + { + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_ROOT_SIGNATURE = 0, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_VS = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_ROOT_SIGNATURE + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_PS = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_VS + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DS = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_PS + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_HS = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DS + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_GS = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_HS + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_CS = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_GS + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_STREAM_OUTPUT = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_CS + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_BLEND = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_STREAM_OUTPUT + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_SAMPLE_MASK = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_BLEND + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RASTERIZER = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_SAMPLE_MASK + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RASTERIZER + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_INPUT_LAYOUT = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_IB_STRIP_CUT_VALUE = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_INPUT_LAYOUT + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_PRIMITIVE_TOPOLOGY = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_IB_STRIP_CUT_VALUE + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RENDER_TARGET_FORMATS = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_PRIMITIVE_TOPOLOGY + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL_FORMAT = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RENDER_TARGET_FORMATS + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_SAMPLE_DESC = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL_FORMAT + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_NODE_MASK = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_SAMPLE_DESC + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_CACHED_PSO = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_NODE_MASK + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_FLAGS = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_CACHED_PSO + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL1 = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_FLAGS + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_VIEW_INSTANCING = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL1 + 1 ) , + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_AS = 24, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MS = 25, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL2 = 26, + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MAX_VALID = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL2 + 1 ) + } D3D12_PIPELINE_STATE_SUBOBJECT_TYPE; + +typedef +enum D3D12_FEATURE + { + D3D12_FEATURE_D3D12_OPTIONS = 0, + D3D12_FEATURE_ARCHITECTURE = 1, + D3D12_FEATURE_FEATURE_LEVELS = 2, + D3D12_FEATURE_FORMAT_SUPPORT = 3, + D3D12_FEATURE_MULTISAMPLE_QUALITY_LEVELS = 4, + D3D12_FEATURE_FORMAT_INFO = 5, + D3D12_FEATURE_GPU_VIRTUAL_ADDRESS_SUPPORT = 6, + D3D12_FEATURE_SHADER_MODEL = 7, + D3D12_FEATURE_D3D12_OPTIONS1 = 8, + D3D12_FEATURE_PROTECTED_RESOURCE_SESSION_SUPPORT = 10, + D3D12_FEATURE_ROOT_SIGNATURE = 12, + D3D12_FEATURE_ARCHITECTURE1 = 16, + D3D12_FEATURE_D3D12_OPTIONS2 = 18, + D3D12_FEATURE_SHADER_CACHE = 19, + D3D12_FEATURE_COMMAND_QUEUE_PRIORITY = 20, + D3D12_FEATURE_D3D12_OPTIONS3 = 21, + D3D12_FEATURE_EXISTING_HEAPS = 22, + D3D12_FEATURE_D3D12_OPTIONS4 = 23, + D3D12_FEATURE_SERIALIZATION = 24, + D3D12_FEATURE_CROSS_NODE = 25, + D3D12_FEATURE_D3D12_OPTIONS5 = 27, + D3D12_FEATURE_DISPLAYABLE = 28, + D3D12_FEATURE_D3D12_OPTIONS6 = 30, + D3D12_FEATURE_QUERY_META_COMMAND = 31, + D3D12_FEATURE_D3D12_OPTIONS7 = 32, + D3D12_FEATURE_PROTECTED_RESOURCE_SESSION_TYPE_COUNT = 33, + D3D12_FEATURE_PROTECTED_RESOURCE_SESSION_TYPES = 34, + D3D12_FEATURE_D3D12_OPTIONS8 = 36, + D3D12_FEATURE_D3D12_OPTIONS9 = 37, + D3D12_FEATURE_D3D12_OPTIONS10 = 39, + D3D12_FEATURE_D3D12_OPTIONS11 = 40, + D3D12_FEATURE_D3D12_OPTIONS12 = 41, + D3D12_FEATURE_D3D12_OPTIONS13 = 42, + D3D12_FEATURE_D3D12_OPTIONS14 = 43, + D3D12_FEATURE_D3D12_OPTIONS15 = 44 + } D3D12_FEATURE; + +typedef +enum D3D12_SHADER_MIN_PRECISION_SUPPORT + { + D3D12_SHADER_MIN_PRECISION_SUPPORT_NONE = 0, + D3D12_SHADER_MIN_PRECISION_SUPPORT_10_BIT = 0x1, + D3D12_SHADER_MIN_PRECISION_SUPPORT_16_BIT = 0x2 + } D3D12_SHADER_MIN_PRECISION_SUPPORT; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_SHADER_MIN_PRECISION_SUPPORT ); +typedef +enum D3D12_TILED_RESOURCES_TIER + { + D3D12_TILED_RESOURCES_TIER_NOT_SUPPORTED = 0, + D3D12_TILED_RESOURCES_TIER_1 = 1, + D3D12_TILED_RESOURCES_TIER_2 = 2, + D3D12_TILED_RESOURCES_TIER_3 = 3, + D3D12_TILED_RESOURCES_TIER_4 = 4 + } D3D12_TILED_RESOURCES_TIER; + +typedef +enum D3D12_RESOURCE_BINDING_TIER + { + D3D12_RESOURCE_BINDING_TIER_1 = 1, + D3D12_RESOURCE_BINDING_TIER_2 = 2, + D3D12_RESOURCE_BINDING_TIER_3 = 3 + } D3D12_RESOURCE_BINDING_TIER; + +typedef +enum D3D12_CONSERVATIVE_RASTERIZATION_TIER + { + D3D12_CONSERVATIVE_RASTERIZATION_TIER_NOT_SUPPORTED = 0, + D3D12_CONSERVATIVE_RASTERIZATION_TIER_1 = 1, + D3D12_CONSERVATIVE_RASTERIZATION_TIER_2 = 2, + D3D12_CONSERVATIVE_RASTERIZATION_TIER_3 = 3 + } D3D12_CONSERVATIVE_RASTERIZATION_TIER; + +typedef +enum D3D12_FORMAT_SUPPORT1 + { + D3D12_FORMAT_SUPPORT1_NONE = 0, + D3D12_FORMAT_SUPPORT1_BUFFER = 0x1, + D3D12_FORMAT_SUPPORT1_IA_VERTEX_BUFFER = 0x2, + D3D12_FORMAT_SUPPORT1_IA_INDEX_BUFFER = 0x4, + D3D12_FORMAT_SUPPORT1_SO_BUFFER = 0x8, + D3D12_FORMAT_SUPPORT1_TEXTURE1D = 0x10, + D3D12_FORMAT_SUPPORT1_TEXTURE2D = 0x20, + D3D12_FORMAT_SUPPORT1_TEXTURE3D = 0x40, + D3D12_FORMAT_SUPPORT1_TEXTURECUBE = 0x80, + D3D12_FORMAT_SUPPORT1_SHADER_LOAD = 0x100, + D3D12_FORMAT_SUPPORT1_SHADER_SAMPLE = 0x200, + D3D12_FORMAT_SUPPORT1_SHADER_SAMPLE_COMPARISON = 0x400, + D3D12_FORMAT_SUPPORT1_SHADER_SAMPLE_MONO_TEXT = 0x800, + D3D12_FORMAT_SUPPORT1_MIP = 0x1000, + D3D12_FORMAT_SUPPORT1_RENDER_TARGET = 0x4000, + D3D12_FORMAT_SUPPORT1_BLENDABLE = 0x8000, + D3D12_FORMAT_SUPPORT1_DEPTH_STENCIL = 0x10000, + D3D12_FORMAT_SUPPORT1_MULTISAMPLE_RESOLVE = 0x40000, + D3D12_FORMAT_SUPPORT1_DISPLAY = 0x80000, + D3D12_FORMAT_SUPPORT1_CAST_WITHIN_BIT_LAYOUT = 0x100000, + D3D12_FORMAT_SUPPORT1_MULTISAMPLE_RENDERTARGET = 0x200000, + D3D12_FORMAT_SUPPORT1_MULTISAMPLE_LOAD = 0x400000, + D3D12_FORMAT_SUPPORT1_SHADER_GATHER = 0x800000, + D3D12_FORMAT_SUPPORT1_BACK_BUFFER_CAST = 0x1000000, + D3D12_FORMAT_SUPPORT1_TYPED_UNORDERED_ACCESS_VIEW = 0x2000000, + D3D12_FORMAT_SUPPORT1_SHADER_GATHER_COMPARISON = 0x4000000, + D3D12_FORMAT_SUPPORT1_DECODER_OUTPUT = 0x8000000, + D3D12_FORMAT_SUPPORT1_VIDEO_PROCESSOR_OUTPUT = 0x10000000, + D3D12_FORMAT_SUPPORT1_VIDEO_PROCESSOR_INPUT = 0x20000000, + D3D12_FORMAT_SUPPORT1_VIDEO_ENCODER = 0x40000000 + } D3D12_FORMAT_SUPPORT1; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_FORMAT_SUPPORT1 ); +typedef +enum D3D12_FORMAT_SUPPORT2 + { + D3D12_FORMAT_SUPPORT2_NONE = 0, + D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_ADD = 0x1, + D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_BITWISE_OPS = 0x2, + D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_COMPARE_STORE_OR_COMPARE_EXCHANGE = 0x4, + D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_EXCHANGE = 0x8, + D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_SIGNED_MIN_OR_MAX = 0x10, + D3D12_FORMAT_SUPPORT2_UAV_ATOMIC_UNSIGNED_MIN_OR_MAX = 0x20, + D3D12_FORMAT_SUPPORT2_UAV_TYPED_LOAD = 0x40, + D3D12_FORMAT_SUPPORT2_UAV_TYPED_STORE = 0x80, + D3D12_FORMAT_SUPPORT2_OUTPUT_MERGER_LOGIC_OP = 0x100, + D3D12_FORMAT_SUPPORT2_TILED = 0x200, + D3D12_FORMAT_SUPPORT2_MULTIPLANE_OVERLAY = 0x4000, + D3D12_FORMAT_SUPPORT2_SAMPLER_FEEDBACK = 0x8000 + } D3D12_FORMAT_SUPPORT2; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_FORMAT_SUPPORT2 ); +typedef +enum D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS + { + D3D12_MULTISAMPLE_QUALITY_LEVELS_FLAG_NONE = 0, + D3D12_MULTISAMPLE_QUALITY_LEVELS_FLAG_TILED_RESOURCE = 0x1 + } D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS ); +typedef +enum D3D12_CROSS_NODE_SHARING_TIER + { + D3D12_CROSS_NODE_SHARING_TIER_NOT_SUPPORTED = 0, + D3D12_CROSS_NODE_SHARING_TIER_1_EMULATED = 1, + D3D12_CROSS_NODE_SHARING_TIER_1 = 2, + D3D12_CROSS_NODE_SHARING_TIER_2 = 3, + D3D12_CROSS_NODE_SHARING_TIER_3 = 4 + } D3D12_CROSS_NODE_SHARING_TIER; + +typedef +enum D3D12_RESOURCE_HEAP_TIER + { + D3D12_RESOURCE_HEAP_TIER_1 = 1, + D3D12_RESOURCE_HEAP_TIER_2 = 2 + } D3D12_RESOURCE_HEAP_TIER; + +typedef +enum D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER + { + D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_NOT_SUPPORTED = 0, + D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_1 = 1, + D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_2 = 2 + } D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER; + +typedef +enum D3D12_VIEW_INSTANCING_TIER + { + D3D12_VIEW_INSTANCING_TIER_NOT_SUPPORTED = 0, + D3D12_VIEW_INSTANCING_TIER_1 = 1, + D3D12_VIEW_INSTANCING_TIER_2 = 2, + D3D12_VIEW_INSTANCING_TIER_3 = 3 + } D3D12_VIEW_INSTANCING_TIER; + +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS + { + _Out_ BOOL DoublePrecisionFloatShaderOps; + _Out_ BOOL OutputMergerLogicOp; + _Out_ D3D12_SHADER_MIN_PRECISION_SUPPORT MinPrecisionSupport; + _Out_ D3D12_TILED_RESOURCES_TIER TiledResourcesTier; + _Out_ D3D12_RESOURCE_BINDING_TIER ResourceBindingTier; + _Out_ BOOL PSSpecifiedStencilRefSupported; + _Out_ BOOL TypedUAVLoadAdditionalFormats; + _Out_ BOOL ROVsSupported; + _Out_ D3D12_CONSERVATIVE_RASTERIZATION_TIER ConservativeRasterizationTier; + _Out_ UINT MaxGPUVirtualAddressBitsPerResource; + _Out_ BOOL StandardSwizzle64KBSupported; + _Out_ D3D12_CROSS_NODE_SHARING_TIER CrossNodeSharingTier; + _Out_ BOOL CrossAdapterRowMajorTextureSupported; + _Out_ BOOL VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation; + _Out_ D3D12_RESOURCE_HEAP_TIER ResourceHeapTier; + } D3D12_FEATURE_DATA_D3D12_OPTIONS; + +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS1 + { + _Out_ BOOL WaveOps; + _Out_ UINT WaveLaneCountMin; + _Out_ UINT WaveLaneCountMax; + _Out_ UINT TotalLaneCount; + _Out_ BOOL ExpandedComputeResourceStates; + _Out_ BOOL Int64ShaderOps; + } D3D12_FEATURE_DATA_D3D12_OPTIONS1; + +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS2 + { + _Out_ BOOL DepthBoundsTestSupported; + _Out_ D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER ProgrammableSamplePositionsTier; + } D3D12_FEATURE_DATA_D3D12_OPTIONS2; + +typedef +enum D3D_ROOT_SIGNATURE_VERSION + { + D3D_ROOT_SIGNATURE_VERSION_1 = 0x1, + D3D_ROOT_SIGNATURE_VERSION_1_0 = 0x1, + D3D_ROOT_SIGNATURE_VERSION_1_1 = 0x2 + } D3D_ROOT_SIGNATURE_VERSION; + +typedef struct D3D12_FEATURE_DATA_ROOT_SIGNATURE + { + _Inout_ D3D_ROOT_SIGNATURE_VERSION HighestVersion; + } D3D12_FEATURE_DATA_ROOT_SIGNATURE; + +typedef struct D3D12_FEATURE_DATA_ARCHITECTURE + { + _In_ UINT NodeIndex; + _Out_ BOOL TileBasedRenderer; + _Out_ BOOL UMA; + _Out_ BOOL CacheCoherentUMA; + } D3D12_FEATURE_DATA_ARCHITECTURE; + +typedef struct D3D12_FEATURE_DATA_ARCHITECTURE1 + { + _In_ UINT NodeIndex; + _Out_ BOOL TileBasedRenderer; + _Out_ BOOL UMA; + _Out_ BOOL CacheCoherentUMA; + _Out_ BOOL IsolatedMMU; + } D3D12_FEATURE_DATA_ARCHITECTURE1; + +typedef struct D3D12_FEATURE_DATA_FEATURE_LEVELS + { + _In_ UINT NumFeatureLevels; + _In_reads_(NumFeatureLevels) const D3D_FEATURE_LEVEL *pFeatureLevelsRequested; + _Out_ D3D_FEATURE_LEVEL MaxSupportedFeatureLevel; + } D3D12_FEATURE_DATA_FEATURE_LEVELS; + +typedef +enum D3D_SHADER_MODEL + { + D3D_SHADER_MODEL_5_1 = 0x51, + D3D_SHADER_MODEL_6_0 = 0x60, + D3D_SHADER_MODEL_6_1 = 0x61, + D3D_SHADER_MODEL_6_2 = 0x62, + D3D_SHADER_MODEL_6_3 = 0x63, + D3D_SHADER_MODEL_6_4 = 0x64, + D3D_SHADER_MODEL_6_5 = 0x65, + D3D_SHADER_MODEL_6_6 = 0x66, + D3D_SHADER_MODEL_6_7 = 0x67, + D3D_SHADER_MODEL_6_8 = 0x68, + D3D_HIGHEST_SHADER_MODEL = D3D_SHADER_MODEL_6_8 + } D3D_SHADER_MODEL; + +typedef struct D3D12_FEATURE_DATA_SHADER_MODEL + { + _Inout_ D3D_SHADER_MODEL HighestShaderModel; + } D3D12_FEATURE_DATA_SHADER_MODEL; + +typedef struct D3D12_FEATURE_DATA_FORMAT_SUPPORT + { + _In_ DXGI_FORMAT Format; + _Out_ D3D12_FORMAT_SUPPORT1 Support1; + _Out_ D3D12_FORMAT_SUPPORT2 Support2; + } D3D12_FEATURE_DATA_FORMAT_SUPPORT; + +typedef struct D3D12_FEATURE_DATA_MULTISAMPLE_QUALITY_LEVELS + { + _In_ DXGI_FORMAT Format; + _In_ UINT SampleCount; + _In_ D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS Flags; + _Out_ UINT NumQualityLevels; + } D3D12_FEATURE_DATA_MULTISAMPLE_QUALITY_LEVELS; + +typedef struct D3D12_FEATURE_DATA_FORMAT_INFO + { + DXGI_FORMAT Format; + UINT8 PlaneCount; + } D3D12_FEATURE_DATA_FORMAT_INFO; + +typedef struct D3D12_FEATURE_DATA_GPU_VIRTUAL_ADDRESS_SUPPORT + { + UINT MaxGPUVirtualAddressBitsPerResource; + UINT MaxGPUVirtualAddressBitsPerProcess; + } D3D12_FEATURE_DATA_GPU_VIRTUAL_ADDRESS_SUPPORT; + +typedef +enum D3D12_SHADER_CACHE_SUPPORT_FLAGS + { + D3D12_SHADER_CACHE_SUPPORT_NONE = 0, + D3D12_SHADER_CACHE_SUPPORT_SINGLE_PSO = 0x1, + D3D12_SHADER_CACHE_SUPPORT_LIBRARY = 0x2, + D3D12_SHADER_CACHE_SUPPORT_AUTOMATIC_INPROC_CACHE = 0x4, + D3D12_SHADER_CACHE_SUPPORT_AUTOMATIC_DISK_CACHE = 0x8, + D3D12_SHADER_CACHE_SUPPORT_DRIVER_MANAGED_CACHE = 0x10, + D3D12_SHADER_CACHE_SUPPORT_SHADER_CONTROL_CLEAR = 0x20, + D3D12_SHADER_CACHE_SUPPORT_SHADER_SESSION_DELETE = 0x40 + } D3D12_SHADER_CACHE_SUPPORT_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_SHADER_CACHE_SUPPORT_FLAGS ); +typedef struct D3D12_FEATURE_DATA_SHADER_CACHE + { + _Out_ D3D12_SHADER_CACHE_SUPPORT_FLAGS SupportFlags; + } D3D12_FEATURE_DATA_SHADER_CACHE; + +typedef struct D3D12_FEATURE_DATA_COMMAND_QUEUE_PRIORITY + { + _In_ D3D12_COMMAND_LIST_TYPE CommandListType; + _In_ UINT Priority; + _Out_ BOOL PriorityForTypeIsSupported; + } D3D12_FEATURE_DATA_COMMAND_QUEUE_PRIORITY; + +typedef +enum D3D12_COMMAND_LIST_SUPPORT_FLAGS + { + D3D12_COMMAND_LIST_SUPPORT_FLAG_NONE = 0, + D3D12_COMMAND_LIST_SUPPORT_FLAG_DIRECT = ( 1 << D3D12_COMMAND_LIST_TYPE_DIRECT ) , + D3D12_COMMAND_LIST_SUPPORT_FLAG_BUNDLE = ( 1 << D3D12_COMMAND_LIST_TYPE_BUNDLE ) , + D3D12_COMMAND_LIST_SUPPORT_FLAG_COMPUTE = ( 1 << D3D12_COMMAND_LIST_TYPE_COMPUTE ) , + D3D12_COMMAND_LIST_SUPPORT_FLAG_COPY = ( 1 << D3D12_COMMAND_LIST_TYPE_COPY ) , + D3D12_COMMAND_LIST_SUPPORT_FLAG_VIDEO_DECODE = ( 1 << D3D12_COMMAND_LIST_TYPE_VIDEO_DECODE ) , + D3D12_COMMAND_LIST_SUPPORT_FLAG_VIDEO_PROCESS = ( 1 << D3D12_COMMAND_LIST_TYPE_VIDEO_PROCESS ) , + D3D12_COMMAND_LIST_SUPPORT_FLAG_VIDEO_ENCODE = ( 1 << D3D12_COMMAND_LIST_TYPE_VIDEO_ENCODE ) + } D3D12_COMMAND_LIST_SUPPORT_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMMAND_LIST_SUPPORT_FLAGS ); +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS3 + { + _Out_ BOOL CopyQueueTimestampQueriesSupported; + _Out_ BOOL CastingFullyTypedFormatSupported; + _Out_ D3D12_COMMAND_LIST_SUPPORT_FLAGS WriteBufferImmediateSupportFlags; + _Out_ D3D12_VIEW_INSTANCING_TIER ViewInstancingTier; + _Out_ BOOL BarycentricsSupported; + } D3D12_FEATURE_DATA_D3D12_OPTIONS3; + +typedef struct D3D12_FEATURE_DATA_EXISTING_HEAPS + { + _Out_ BOOL Supported; + } D3D12_FEATURE_DATA_EXISTING_HEAPS; + +typedef +enum D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER + { + D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_0 = 0, + D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_1 = ( D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_0 + 1 ) , + D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_2 = ( D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_1 + 1 ) + } D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER; + +typedef struct D3D12_FEATURE_DATA_DISPLAYABLE + { + _Out_ BOOL DisplayableTexture; + _Out_ D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER SharedResourceCompatibilityTier; + } D3D12_FEATURE_DATA_DISPLAYABLE; + +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS4 + { + _Out_ BOOL MSAA64KBAlignedTextureSupported; + _Out_ D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER SharedResourceCompatibilityTier; + _Out_ BOOL Native16BitShaderOpsSupported; + } D3D12_FEATURE_DATA_D3D12_OPTIONS4; + +typedef +enum D3D12_HEAP_SERIALIZATION_TIER + { + D3D12_HEAP_SERIALIZATION_TIER_0 = 0, + D3D12_HEAP_SERIALIZATION_TIER_10 = 10 + } D3D12_HEAP_SERIALIZATION_TIER; + +typedef struct D3D12_FEATURE_DATA_SERIALIZATION + { + _In_ UINT NodeIndex; + _Out_ D3D12_HEAP_SERIALIZATION_TIER HeapSerializationTier; + } D3D12_FEATURE_DATA_SERIALIZATION; + +typedef struct D3D12_FEATURE_DATA_CROSS_NODE + { + D3D12_CROSS_NODE_SHARING_TIER SharingTier; + BOOL AtomicShaderInstructions; + } D3D12_FEATURE_DATA_CROSS_NODE; + +typedef +enum D3D12_RENDER_PASS_TIER + { + D3D12_RENDER_PASS_TIER_0 = 0, + D3D12_RENDER_PASS_TIER_1 = 1, + D3D12_RENDER_PASS_TIER_2 = 2 + } D3D12_RENDER_PASS_TIER; + +typedef +enum D3D12_RAYTRACING_TIER + { + D3D12_RAYTRACING_TIER_NOT_SUPPORTED = 0, + D3D12_RAYTRACING_TIER_1_0 = 10, + D3D12_RAYTRACING_TIER_1_1 = 11 + } D3D12_RAYTRACING_TIER; + +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS5 + { + _Out_ BOOL SRVOnlyTiledResourceTier3; + _Out_ D3D12_RENDER_PASS_TIER RenderPassesTier; + _Out_ D3D12_RAYTRACING_TIER RaytracingTier; + } D3D12_FEATURE_DATA_D3D12_OPTIONS5; + +typedef +enum D3D12_VARIABLE_SHADING_RATE_TIER + { + D3D12_VARIABLE_SHADING_RATE_TIER_NOT_SUPPORTED = 0, + D3D12_VARIABLE_SHADING_RATE_TIER_1 = 1, + D3D12_VARIABLE_SHADING_RATE_TIER_2 = 2 + } D3D12_VARIABLE_SHADING_RATE_TIER; + +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS6 + { + _Out_ BOOL AdditionalShadingRatesSupported; + _Out_ BOOL PerPrimitiveShadingRateSupportedWithViewportIndexing; + _Out_ D3D12_VARIABLE_SHADING_RATE_TIER VariableShadingRateTier; + _Out_ UINT ShadingRateImageTileSize; + _Out_ BOOL BackgroundProcessingSupported; + } D3D12_FEATURE_DATA_D3D12_OPTIONS6; + +typedef +enum D3D12_MESH_SHADER_TIER + { + D3D12_MESH_SHADER_TIER_NOT_SUPPORTED = 0, + D3D12_MESH_SHADER_TIER_1 = 10 + } D3D12_MESH_SHADER_TIER; + +typedef +enum D3D12_SAMPLER_FEEDBACK_TIER + { + D3D12_SAMPLER_FEEDBACK_TIER_NOT_SUPPORTED = 0, + D3D12_SAMPLER_FEEDBACK_TIER_0_9 = 90, + D3D12_SAMPLER_FEEDBACK_TIER_1_0 = 100 + } D3D12_SAMPLER_FEEDBACK_TIER; + +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS7 + { + _Out_ D3D12_MESH_SHADER_TIER MeshShaderTier; + _Out_ D3D12_SAMPLER_FEEDBACK_TIER SamplerFeedbackTier; + } D3D12_FEATURE_DATA_D3D12_OPTIONS7; + +typedef struct D3D12_FEATURE_DATA_QUERY_META_COMMAND + { + _In_ GUID CommandId; + _In_ UINT NodeMask; + _Field_size_bytes_full_opt_( QueryInputDataSizeInBytes ) const void *pQueryInputData; + _In_ SIZE_T QueryInputDataSizeInBytes; + _Field_size_bytes_full_( QueryOutputDataSizeInBytes ) void *pQueryOutputData; + _In_ SIZE_T QueryOutputDataSizeInBytes; + } D3D12_FEATURE_DATA_QUERY_META_COMMAND; + +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS8 + { + _Out_ BOOL UnalignedBlockTexturesSupported; + } D3D12_FEATURE_DATA_D3D12_OPTIONS8; + +typedef +enum D3D12_WAVE_MMA_TIER + { + D3D12_WAVE_MMA_TIER_NOT_SUPPORTED = 0, + D3D12_WAVE_MMA_TIER_1_0 = 10 + } D3D12_WAVE_MMA_TIER; + +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS9 + { + _Out_ BOOL MeshShaderPipelineStatsSupported; + _Out_ BOOL MeshShaderSupportsFullRangeRenderTargetArrayIndex; + _Out_ BOOL AtomicInt64OnTypedResourceSupported; + _Out_ BOOL AtomicInt64OnGroupSharedSupported; + _Out_ BOOL DerivativesInMeshAndAmplificationShadersSupported; + _Out_ D3D12_WAVE_MMA_TIER WaveMMATier; + } D3D12_FEATURE_DATA_D3D12_OPTIONS9; + +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS10 + { + _Out_ BOOL VariableRateShadingSumCombinerSupported; + _Out_ BOOL MeshShaderPerPrimitiveShadingRateSupported; + } D3D12_FEATURE_DATA_D3D12_OPTIONS10; + +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS11 + { + _Out_ BOOL AtomicInt64OnDescriptorHeapResourceSupported; + } D3D12_FEATURE_DATA_D3D12_OPTIONS11; + +typedef +enum D3D12_TRI_STATE + { + D3D12_TRI_STATE_UNKNOWN = -1, + D3D12_TRI_STATE_FALSE = 0, + D3D12_TRI_STATE_TRUE = 1 + } D3D12_TRI_STATE; + +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS12 + { + _Out_ D3D12_TRI_STATE MSPrimitivesPipelineStatisticIncludesCulledPrimitives; + _Out_ BOOL EnhancedBarriersSupported; + _Out_ BOOL RelaxedFormatCastingSupported; + } D3D12_FEATURE_DATA_D3D12_OPTIONS12; + +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS13 + { + _Out_ BOOL UnrestrictedBufferTextureCopyPitchSupported; + _Out_ BOOL UnrestrictedVertexElementAlignmentSupported; + _Out_ BOOL InvertedViewportHeightFlipsYSupported; + _Out_ BOOL InvertedViewportDepthFlipsZSupported; + _Out_ BOOL TextureCopyBetweenDimensionsSupported; + _Out_ BOOL AlphaBlendFactorSupported; + } D3D12_FEATURE_DATA_D3D12_OPTIONS13; + +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS14 + { + _Out_ BOOL AdvancedTextureOpsSupported; + _Out_ BOOL WriteableMSAATexturesSupported; + _Out_ BOOL IndependentFrontAndBackStencilRefMaskSupported; + } D3D12_FEATURE_DATA_D3D12_OPTIONS14; + +typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS15 + { + _Out_ BOOL TriangleFanSupported; + _Out_ BOOL DynamicIndexBufferStripCutSupported; + } D3D12_FEATURE_DATA_D3D12_OPTIONS15; + +typedef struct D3D12_RESOURCE_ALLOCATION_INFO + { + UINT64 SizeInBytes; + UINT64 Alignment; + } D3D12_RESOURCE_ALLOCATION_INFO; + +typedef struct D3D12_RESOURCE_ALLOCATION_INFO1 + { + UINT64 Offset; + UINT64 Alignment; + UINT64 SizeInBytes; + } D3D12_RESOURCE_ALLOCATION_INFO1; + +typedef +enum D3D12_HEAP_TYPE + { + D3D12_HEAP_TYPE_DEFAULT = 1, + D3D12_HEAP_TYPE_UPLOAD = 2, + D3D12_HEAP_TYPE_READBACK = 3, + D3D12_HEAP_TYPE_CUSTOM = 4 + } D3D12_HEAP_TYPE; + +typedef +enum D3D12_CPU_PAGE_PROPERTY + { + D3D12_CPU_PAGE_PROPERTY_UNKNOWN = 0, + D3D12_CPU_PAGE_PROPERTY_NOT_AVAILABLE = 1, + D3D12_CPU_PAGE_PROPERTY_WRITE_COMBINE = 2, + D3D12_CPU_PAGE_PROPERTY_WRITE_BACK = 3 + } D3D12_CPU_PAGE_PROPERTY; + +typedef +enum D3D12_MEMORY_POOL + { + D3D12_MEMORY_POOL_UNKNOWN = 0, + D3D12_MEMORY_POOL_L0 = 1, + D3D12_MEMORY_POOL_L1 = 2 + } D3D12_MEMORY_POOL; + +typedef struct D3D12_HEAP_PROPERTIES + { + D3D12_HEAP_TYPE Type; + D3D12_CPU_PAGE_PROPERTY CPUPageProperty; + D3D12_MEMORY_POOL MemoryPoolPreference; + UINT CreationNodeMask; + UINT VisibleNodeMask; + } D3D12_HEAP_PROPERTIES; + +typedef +enum D3D12_HEAP_FLAGS + { + D3D12_HEAP_FLAG_NONE = 0, + D3D12_HEAP_FLAG_SHARED = 0x1, + D3D12_HEAP_FLAG_DENY_BUFFERS = 0x4, + D3D12_HEAP_FLAG_ALLOW_DISPLAY = 0x8, + D3D12_HEAP_FLAG_SHARED_CROSS_ADAPTER = 0x20, + D3D12_HEAP_FLAG_DENY_RT_DS_TEXTURES = 0x40, + D3D12_HEAP_FLAG_DENY_NON_RT_DS_TEXTURES = 0x80, + D3D12_HEAP_FLAG_HARDWARE_PROTECTED = 0x100, + D3D12_HEAP_FLAG_ALLOW_WRITE_WATCH = 0x200, + D3D12_HEAP_FLAG_ALLOW_SHADER_ATOMICS = 0x400, + D3D12_HEAP_FLAG_CREATE_NOT_RESIDENT = 0x800, + D3D12_HEAP_FLAG_CREATE_NOT_ZEROED = 0x1000, + D3D12_HEAP_FLAG_ALLOW_ALL_BUFFERS_AND_TEXTURES = 0, + D3D12_HEAP_FLAG_ALLOW_ONLY_BUFFERS = 0xc0, + D3D12_HEAP_FLAG_ALLOW_ONLY_NON_RT_DS_TEXTURES = 0x44, + D3D12_HEAP_FLAG_ALLOW_ONLY_RT_DS_TEXTURES = 0x84 + } D3D12_HEAP_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_HEAP_FLAGS ); +typedef struct D3D12_HEAP_DESC + { + UINT64 SizeInBytes; + D3D12_HEAP_PROPERTIES Properties; + UINT64 Alignment; + D3D12_HEAP_FLAGS Flags; + } D3D12_HEAP_DESC; + +typedef +enum D3D12_RESOURCE_DIMENSION + { + D3D12_RESOURCE_DIMENSION_UNKNOWN = 0, + D3D12_RESOURCE_DIMENSION_BUFFER = 1, + D3D12_RESOURCE_DIMENSION_TEXTURE1D = 2, + D3D12_RESOURCE_DIMENSION_TEXTURE2D = 3, + D3D12_RESOURCE_DIMENSION_TEXTURE3D = 4 + } D3D12_RESOURCE_DIMENSION; + +typedef +enum D3D12_TEXTURE_LAYOUT + { + D3D12_TEXTURE_LAYOUT_UNKNOWN = 0, + D3D12_TEXTURE_LAYOUT_ROW_MAJOR = 1, + D3D12_TEXTURE_LAYOUT_64KB_UNDEFINED_SWIZZLE = 2, + D3D12_TEXTURE_LAYOUT_64KB_STANDARD_SWIZZLE = 3 + } D3D12_TEXTURE_LAYOUT; + +typedef +enum D3D12_RESOURCE_FLAGS + { + D3D12_RESOURCE_FLAG_NONE = 0, + D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET = 0x1, + D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL = 0x2, + D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS = 0x4, + D3D12_RESOURCE_FLAG_DENY_SHADER_RESOURCE = 0x8, + D3D12_RESOURCE_FLAG_ALLOW_CROSS_ADAPTER = 0x10, + D3D12_RESOURCE_FLAG_ALLOW_SIMULTANEOUS_ACCESS = 0x20, + D3D12_RESOURCE_FLAG_VIDEO_DECODE_REFERENCE_ONLY = 0x40, + D3D12_RESOURCE_FLAG_VIDEO_ENCODE_REFERENCE_ONLY = 0x80, + D3D12_RESOURCE_FLAG_RAYTRACING_ACCELERATION_STRUCTURE = 0x100 + } D3D12_RESOURCE_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_RESOURCE_FLAGS ); +typedef struct D3D12_MIP_REGION + { + UINT Width; + UINT Height; + UINT Depth; + } D3D12_MIP_REGION; + +typedef struct D3D12_RESOURCE_DESC + { + D3D12_RESOURCE_DIMENSION Dimension; + UINT64 Alignment; + UINT64 Width; + UINT Height; + UINT16 DepthOrArraySize; + UINT16 MipLevels; + DXGI_FORMAT Format; + DXGI_SAMPLE_DESC SampleDesc; + D3D12_TEXTURE_LAYOUT Layout; + D3D12_RESOURCE_FLAGS Flags; + } D3D12_RESOURCE_DESC; + +typedef struct D3D12_RESOURCE_DESC1 + { + D3D12_RESOURCE_DIMENSION Dimension; + UINT64 Alignment; + UINT64 Width; + UINT Height; + UINT16 DepthOrArraySize; + UINT16 MipLevels; + DXGI_FORMAT Format; + DXGI_SAMPLE_DESC SampleDesc; + D3D12_TEXTURE_LAYOUT Layout; + D3D12_RESOURCE_FLAGS Flags; + D3D12_MIP_REGION SamplerFeedbackMipRegion; + } D3D12_RESOURCE_DESC1; + +typedef struct D3D12_DEPTH_STENCIL_VALUE + { + FLOAT Depth; + UINT8 Stencil; + } D3D12_DEPTH_STENCIL_VALUE; + +typedef struct D3D12_CLEAR_VALUE + { + DXGI_FORMAT Format; + union + { + FLOAT Color[ 4 ]; + D3D12_DEPTH_STENCIL_VALUE DepthStencil; + } ; + } D3D12_CLEAR_VALUE; + +typedef struct D3D12_RANGE + { + SIZE_T Begin; + SIZE_T End; + } D3D12_RANGE; + +typedef struct D3D12_RANGE_UINT64 + { + UINT64 Begin; + UINT64 End; + } D3D12_RANGE_UINT64; + +typedef struct D3D12_SUBRESOURCE_RANGE_UINT64 + { + UINT Subresource; + D3D12_RANGE_UINT64 Range; + } D3D12_SUBRESOURCE_RANGE_UINT64; + +typedef struct D3D12_SUBRESOURCE_INFO + { + UINT64 Offset; + UINT RowPitch; + UINT DepthPitch; + } D3D12_SUBRESOURCE_INFO; + +typedef struct D3D12_TILED_RESOURCE_COORDINATE + { + UINT X; + UINT Y; + UINT Z; + UINT Subresource; + } D3D12_TILED_RESOURCE_COORDINATE; + +typedef struct D3D12_TILE_REGION_SIZE + { + UINT NumTiles; + BOOL UseBox; + UINT Width; + UINT16 Height; + UINT16 Depth; + } D3D12_TILE_REGION_SIZE; + +typedef +enum D3D12_TILE_RANGE_FLAGS + { + D3D12_TILE_RANGE_FLAG_NONE = 0, + D3D12_TILE_RANGE_FLAG_NULL = 1, + D3D12_TILE_RANGE_FLAG_SKIP = 2, + D3D12_TILE_RANGE_FLAG_REUSE_SINGLE_TILE = 4 + } D3D12_TILE_RANGE_FLAGS; + +typedef struct D3D12_SUBRESOURCE_TILING + { + UINT WidthInTiles; + UINT16 HeightInTiles; + UINT16 DepthInTiles; + UINT StartTileIndexInOverallResource; + } D3D12_SUBRESOURCE_TILING; + +typedef struct D3D12_TILE_SHAPE + { + UINT WidthInTexels; + UINT HeightInTexels; + UINT DepthInTexels; + } D3D12_TILE_SHAPE; + +typedef struct D3D12_PACKED_MIP_INFO + { + UINT8 NumStandardMips; + UINT8 NumPackedMips; + UINT NumTilesForPackedMips; + UINT StartTileIndexInOverallResource; + } D3D12_PACKED_MIP_INFO; + +typedef +enum D3D12_TILE_MAPPING_FLAGS + { + D3D12_TILE_MAPPING_FLAG_NONE = 0, + D3D12_TILE_MAPPING_FLAG_NO_HAZARD = 0x1 + } D3D12_TILE_MAPPING_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_TILE_MAPPING_FLAGS ); +typedef +enum D3D12_TILE_COPY_FLAGS + { + D3D12_TILE_COPY_FLAG_NONE = 0, + D3D12_TILE_COPY_FLAG_NO_HAZARD = 0x1, + D3D12_TILE_COPY_FLAG_LINEAR_BUFFER_TO_SWIZZLED_TILED_RESOURCE = 0x2, + D3D12_TILE_COPY_FLAG_SWIZZLED_TILED_RESOURCE_TO_LINEAR_BUFFER = 0x4 + } D3D12_TILE_COPY_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_TILE_COPY_FLAGS ); +typedef +enum D3D12_RESOURCE_STATES + { + D3D12_RESOURCE_STATE_COMMON = 0, + D3D12_RESOURCE_STATE_VERTEX_AND_CONSTANT_BUFFER = 0x1, + D3D12_RESOURCE_STATE_INDEX_BUFFER = 0x2, + D3D12_RESOURCE_STATE_RENDER_TARGET = 0x4, + D3D12_RESOURCE_STATE_UNORDERED_ACCESS = 0x8, + D3D12_RESOURCE_STATE_DEPTH_WRITE = 0x10, + D3D12_RESOURCE_STATE_DEPTH_READ = 0x20, + D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE = 0x40, + D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE = 0x80, + D3D12_RESOURCE_STATE_STREAM_OUT = 0x100, + D3D12_RESOURCE_STATE_INDIRECT_ARGUMENT = 0x200, + D3D12_RESOURCE_STATE_COPY_DEST = 0x400, + D3D12_RESOURCE_STATE_COPY_SOURCE = 0x800, + D3D12_RESOURCE_STATE_RESOLVE_DEST = 0x1000, + D3D12_RESOURCE_STATE_RESOLVE_SOURCE = 0x2000, + D3D12_RESOURCE_STATE_RAYTRACING_ACCELERATION_STRUCTURE = 0x400000, + D3D12_RESOURCE_STATE_SHADING_RATE_SOURCE = 0x1000000, + D3D12_RESOURCE_STATE_GENERIC_READ = ( ( ( ( ( 0x1 | 0x2 ) | 0x40 ) | 0x80 ) | 0x200 ) | 0x800 ) , + D3D12_RESOURCE_STATE_ALL_SHADER_RESOURCE = ( 0x40 | 0x80 ) , + D3D12_RESOURCE_STATE_PRESENT = 0, + D3D12_RESOURCE_STATE_PREDICATION = 0x200, + D3D12_RESOURCE_STATE_VIDEO_DECODE_READ = 0x10000, + D3D12_RESOURCE_STATE_VIDEO_DECODE_WRITE = 0x20000, + D3D12_RESOURCE_STATE_VIDEO_PROCESS_READ = 0x40000, + D3D12_RESOURCE_STATE_VIDEO_PROCESS_WRITE = 0x80000, + D3D12_RESOURCE_STATE_VIDEO_ENCODE_READ = 0x200000, + D3D12_RESOURCE_STATE_VIDEO_ENCODE_WRITE = 0x800000 + } D3D12_RESOURCE_STATES; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_RESOURCE_STATES ); +typedef +enum D3D12_RESOURCE_BARRIER_TYPE + { + D3D12_RESOURCE_BARRIER_TYPE_TRANSITION = 0, + D3D12_RESOURCE_BARRIER_TYPE_ALIASING = ( D3D12_RESOURCE_BARRIER_TYPE_TRANSITION + 1 ) , + D3D12_RESOURCE_BARRIER_TYPE_UAV = ( D3D12_RESOURCE_BARRIER_TYPE_ALIASING + 1 ) + } D3D12_RESOURCE_BARRIER_TYPE; + + +typedef struct D3D12_RESOURCE_TRANSITION_BARRIER + { + ID3D12Resource *pResource; + UINT Subresource; + D3D12_RESOURCE_STATES StateBefore; + D3D12_RESOURCE_STATES StateAfter; + } D3D12_RESOURCE_TRANSITION_BARRIER; + +typedef struct D3D12_RESOURCE_ALIASING_BARRIER + { + ID3D12Resource *pResourceBefore; + ID3D12Resource *pResourceAfter; + } D3D12_RESOURCE_ALIASING_BARRIER; + +typedef struct D3D12_RESOURCE_UAV_BARRIER + { + ID3D12Resource *pResource; + } D3D12_RESOURCE_UAV_BARRIER; + +typedef +enum D3D12_RESOURCE_BARRIER_FLAGS + { + D3D12_RESOURCE_BARRIER_FLAG_NONE = 0, + D3D12_RESOURCE_BARRIER_FLAG_BEGIN_ONLY = 0x1, + D3D12_RESOURCE_BARRIER_FLAG_END_ONLY = 0x2 + } D3D12_RESOURCE_BARRIER_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_RESOURCE_BARRIER_FLAGS ); +typedef struct D3D12_RESOURCE_BARRIER + { + D3D12_RESOURCE_BARRIER_TYPE Type; + D3D12_RESOURCE_BARRIER_FLAGS Flags; + union + { + D3D12_RESOURCE_TRANSITION_BARRIER Transition; + D3D12_RESOURCE_ALIASING_BARRIER Aliasing; + D3D12_RESOURCE_UAV_BARRIER UAV; + } ; + } D3D12_RESOURCE_BARRIER; + +typedef struct D3D12_SUBRESOURCE_FOOTPRINT + { + DXGI_FORMAT Format; + UINT Width; + UINT Height; + UINT Depth; + UINT RowPitch; + } D3D12_SUBRESOURCE_FOOTPRINT; + +typedef struct D3D12_PLACED_SUBRESOURCE_FOOTPRINT + { + UINT64 Offset; + D3D12_SUBRESOURCE_FOOTPRINT Footprint; + } D3D12_PLACED_SUBRESOURCE_FOOTPRINT; + +typedef +enum D3D12_TEXTURE_COPY_TYPE + { + D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX = 0, + D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT = 1 + } D3D12_TEXTURE_COPY_TYPE; + +typedef struct D3D12_TEXTURE_COPY_LOCATION + { + ID3D12Resource *pResource; + D3D12_TEXTURE_COPY_TYPE Type; + union + { + D3D12_PLACED_SUBRESOURCE_FOOTPRINT PlacedFootprint; + UINT SubresourceIndex; + } ; + } D3D12_TEXTURE_COPY_LOCATION; + +typedef +enum D3D12_RESOLVE_MODE + { + D3D12_RESOLVE_MODE_DECOMPRESS = 0, + D3D12_RESOLVE_MODE_MIN = 1, + D3D12_RESOLVE_MODE_MAX = 2, + D3D12_RESOLVE_MODE_AVERAGE = 3, + D3D12_RESOLVE_MODE_ENCODE_SAMPLER_FEEDBACK = 4, + D3D12_RESOLVE_MODE_DECODE_SAMPLER_FEEDBACK = 5 + } D3D12_RESOLVE_MODE; + +typedef struct D3D12_SAMPLE_POSITION + { + INT8 X; + INT8 Y; + } D3D12_SAMPLE_POSITION; + +typedef struct D3D12_VIEW_INSTANCE_LOCATION + { + UINT ViewportArrayIndex; + UINT RenderTargetArrayIndex; + } D3D12_VIEW_INSTANCE_LOCATION; + +typedef +enum D3D12_VIEW_INSTANCING_FLAGS + { + D3D12_VIEW_INSTANCING_FLAG_NONE = 0, + D3D12_VIEW_INSTANCING_FLAG_ENABLE_VIEW_INSTANCE_MASKING = 0x1 + } D3D12_VIEW_INSTANCING_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_VIEW_INSTANCING_FLAGS ); +typedef struct D3D12_VIEW_INSTANCING_DESC + { + UINT ViewInstanceCount; + _Field_size_full_(ViewInstanceCount) const D3D12_VIEW_INSTANCE_LOCATION *pViewInstanceLocations; + D3D12_VIEW_INSTANCING_FLAGS Flags; + } D3D12_VIEW_INSTANCING_DESC; + +typedef +enum D3D12_SHADER_COMPONENT_MAPPING + { + D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_0 = 0, + D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_1 = 1, + D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_2 = 2, + D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_3 = 3, + D3D12_SHADER_COMPONENT_MAPPING_FORCE_VALUE_0 = 4, + D3D12_SHADER_COMPONENT_MAPPING_FORCE_VALUE_1 = 5 + } D3D12_SHADER_COMPONENT_MAPPING; + +#define D3D12_SHADER_COMPONENT_MAPPING_MASK 0x7 +#define D3D12_SHADER_COMPONENT_MAPPING_SHIFT 3 +#define D3D12_SHADER_COMPONENT_MAPPING_ALWAYS_SET_BIT_AVOIDING_ZEROMEM_MISTAKES (1<<(D3D12_SHADER_COMPONENT_MAPPING_SHIFT*4)) +#define D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING(Src0,Src1,Src2,Src3) ((((Src0)&D3D12_SHADER_COMPONENT_MAPPING_MASK)| \ + (((Src1)&D3D12_SHADER_COMPONENT_MAPPING_MASK)<<D3D12_SHADER_COMPONENT_MAPPING_SHIFT)| \ + (((Src2)&D3D12_SHADER_COMPONENT_MAPPING_MASK)<<(D3D12_SHADER_COMPONENT_MAPPING_SHIFT*2))| \ + (((Src3)&D3D12_SHADER_COMPONENT_MAPPING_MASK)<<(D3D12_SHADER_COMPONENT_MAPPING_SHIFT*3))| \ + D3D12_SHADER_COMPONENT_MAPPING_ALWAYS_SET_BIT_AVOIDING_ZEROMEM_MISTAKES)) +#define D3D12_DECODE_SHADER_4_COMPONENT_MAPPING(ComponentToExtract,Mapping) ((D3D12_SHADER_COMPONENT_MAPPING)(Mapping >> (D3D12_SHADER_COMPONENT_MAPPING_SHIFT*ComponentToExtract) & D3D12_SHADER_COMPONENT_MAPPING_MASK)) +#define D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING(0,1,2,3) +typedef +enum D3D12_BUFFER_SRV_FLAGS + { + D3D12_BUFFER_SRV_FLAG_NONE = 0, + D3D12_BUFFER_SRV_FLAG_RAW = 0x1 + } D3D12_BUFFER_SRV_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_BUFFER_SRV_FLAGS ); +typedef struct D3D12_BUFFER_SRV + { + UINT64 FirstElement; + UINT NumElements; + UINT StructureByteStride; + D3D12_BUFFER_SRV_FLAGS Flags; + } D3D12_BUFFER_SRV; + +typedef struct D3D12_TEX1D_SRV + { + UINT MostDetailedMip; + UINT MipLevels; + FLOAT ResourceMinLODClamp; + } D3D12_TEX1D_SRV; + +typedef struct D3D12_TEX1D_ARRAY_SRV + { + UINT MostDetailedMip; + UINT MipLevels; + UINT FirstArraySlice; + UINT ArraySize; + FLOAT ResourceMinLODClamp; + } D3D12_TEX1D_ARRAY_SRV; + +typedef struct D3D12_TEX2D_SRV + { + UINT MostDetailedMip; + UINT MipLevels; + UINT PlaneSlice; + FLOAT ResourceMinLODClamp; + } D3D12_TEX2D_SRV; + +typedef struct D3D12_TEX2D_ARRAY_SRV + { + UINT MostDetailedMip; + UINT MipLevels; + UINT FirstArraySlice; + UINT ArraySize; + UINT PlaneSlice; + FLOAT ResourceMinLODClamp; + } D3D12_TEX2D_ARRAY_SRV; + +typedef struct D3D12_TEX3D_SRV + { + UINT MostDetailedMip; + UINT MipLevels; + FLOAT ResourceMinLODClamp; + } D3D12_TEX3D_SRV; + +typedef struct D3D12_TEXCUBE_SRV + { + UINT MostDetailedMip; + UINT MipLevels; + FLOAT ResourceMinLODClamp; + } D3D12_TEXCUBE_SRV; + +typedef struct D3D12_TEXCUBE_ARRAY_SRV + { + UINT MostDetailedMip; + UINT MipLevels; + UINT First2DArrayFace; + UINT NumCubes; + FLOAT ResourceMinLODClamp; + } D3D12_TEXCUBE_ARRAY_SRV; + +typedef struct D3D12_TEX2DMS_SRV + { + UINT UnusedField_NothingToDefine; + } D3D12_TEX2DMS_SRV; + +typedef struct D3D12_TEX2DMS_ARRAY_SRV + { + UINT FirstArraySlice; + UINT ArraySize; + } D3D12_TEX2DMS_ARRAY_SRV; + +typedef struct D3D12_RAYTRACING_ACCELERATION_STRUCTURE_SRV + { + D3D12_GPU_VIRTUAL_ADDRESS Location; + } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_SRV; + +typedef +enum D3D12_SRV_DIMENSION + { + D3D12_SRV_DIMENSION_UNKNOWN = 0, + D3D12_SRV_DIMENSION_BUFFER = 1, + D3D12_SRV_DIMENSION_TEXTURE1D = 2, + D3D12_SRV_DIMENSION_TEXTURE1DARRAY = 3, + D3D12_SRV_DIMENSION_TEXTURE2D = 4, + D3D12_SRV_DIMENSION_TEXTURE2DARRAY = 5, + D3D12_SRV_DIMENSION_TEXTURE2DMS = 6, + D3D12_SRV_DIMENSION_TEXTURE2DMSARRAY = 7, + D3D12_SRV_DIMENSION_TEXTURE3D = 8, + D3D12_SRV_DIMENSION_TEXTURECUBE = 9, + D3D12_SRV_DIMENSION_TEXTURECUBEARRAY = 10, + D3D12_SRV_DIMENSION_RAYTRACING_ACCELERATION_STRUCTURE = 11 + } D3D12_SRV_DIMENSION; + +typedef struct D3D12_SHADER_RESOURCE_VIEW_DESC + { + DXGI_FORMAT Format; + D3D12_SRV_DIMENSION ViewDimension; + UINT Shader4ComponentMapping; + union + { + D3D12_BUFFER_SRV Buffer; + D3D12_TEX1D_SRV Texture1D; + D3D12_TEX1D_ARRAY_SRV Texture1DArray; + D3D12_TEX2D_SRV Texture2D; + D3D12_TEX2D_ARRAY_SRV Texture2DArray; + D3D12_TEX2DMS_SRV Texture2DMS; + D3D12_TEX2DMS_ARRAY_SRV Texture2DMSArray; + D3D12_TEX3D_SRV Texture3D; + D3D12_TEXCUBE_SRV TextureCube; + D3D12_TEXCUBE_ARRAY_SRV TextureCubeArray; + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_SRV RaytracingAccelerationStructure; + } ; + } D3D12_SHADER_RESOURCE_VIEW_DESC; + +typedef struct D3D12_CONSTANT_BUFFER_VIEW_DESC + { + D3D12_GPU_VIRTUAL_ADDRESS BufferLocation; + UINT SizeInBytes; + } D3D12_CONSTANT_BUFFER_VIEW_DESC; + +typedef +enum D3D12_FILTER + { + D3D12_FILTER_MIN_MAG_MIP_POINT = 0, + D3D12_FILTER_MIN_MAG_POINT_MIP_LINEAR = 0x1, + D3D12_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x4, + D3D12_FILTER_MIN_POINT_MAG_MIP_LINEAR = 0x5, + D3D12_FILTER_MIN_LINEAR_MAG_MIP_POINT = 0x10, + D3D12_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x11, + D3D12_FILTER_MIN_MAG_LINEAR_MIP_POINT = 0x14, + D3D12_FILTER_MIN_MAG_MIP_LINEAR = 0x15, + D3D12_FILTER_ANISOTROPIC = 0x55, + D3D12_FILTER_COMPARISON_MIN_MAG_MIP_POINT = 0x80, + D3D12_FILTER_COMPARISON_MIN_MAG_POINT_MIP_LINEAR = 0x81, + D3D12_FILTER_COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x84, + D3D12_FILTER_COMPARISON_MIN_POINT_MAG_MIP_LINEAR = 0x85, + D3D12_FILTER_COMPARISON_MIN_LINEAR_MAG_MIP_POINT = 0x90, + D3D12_FILTER_COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x91, + D3D12_FILTER_COMPARISON_MIN_MAG_LINEAR_MIP_POINT = 0x94, + D3D12_FILTER_COMPARISON_MIN_MAG_MIP_LINEAR = 0x95, + D3D12_FILTER_COMPARISON_ANISOTROPIC = 0xd5, + D3D12_FILTER_MINIMUM_MIN_MAG_MIP_POINT = 0x100, + D3D12_FILTER_MINIMUM_MIN_MAG_POINT_MIP_LINEAR = 0x101, + D3D12_FILTER_MINIMUM_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x104, + D3D12_FILTER_MINIMUM_MIN_POINT_MAG_MIP_LINEAR = 0x105, + D3D12_FILTER_MINIMUM_MIN_LINEAR_MAG_MIP_POINT = 0x110, + D3D12_FILTER_MINIMUM_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x111, + D3D12_FILTER_MINIMUM_MIN_MAG_LINEAR_MIP_POINT = 0x114, + D3D12_FILTER_MINIMUM_MIN_MAG_MIP_LINEAR = 0x115, + D3D12_FILTER_MINIMUM_ANISOTROPIC = 0x155, + D3D12_FILTER_MAXIMUM_MIN_MAG_MIP_POINT = 0x180, + D3D12_FILTER_MAXIMUM_MIN_MAG_POINT_MIP_LINEAR = 0x181, + D3D12_FILTER_MAXIMUM_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x184, + D3D12_FILTER_MAXIMUM_MIN_POINT_MAG_MIP_LINEAR = 0x185, + D3D12_FILTER_MAXIMUM_MIN_LINEAR_MAG_MIP_POINT = 0x190, + D3D12_FILTER_MAXIMUM_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x191, + D3D12_FILTER_MAXIMUM_MIN_MAG_LINEAR_MIP_POINT = 0x194, + D3D12_FILTER_MAXIMUM_MIN_MAG_MIP_LINEAR = 0x195, + D3D12_FILTER_MAXIMUM_ANISOTROPIC = 0x1d5 + } D3D12_FILTER; + +typedef +enum D3D12_FILTER_TYPE + { + D3D12_FILTER_TYPE_POINT = 0, + D3D12_FILTER_TYPE_LINEAR = 1 + } D3D12_FILTER_TYPE; + +typedef +enum D3D12_FILTER_REDUCTION_TYPE + { + D3D12_FILTER_REDUCTION_TYPE_STANDARD = 0, + D3D12_FILTER_REDUCTION_TYPE_COMPARISON = 1, + D3D12_FILTER_REDUCTION_TYPE_MINIMUM = 2, + D3D12_FILTER_REDUCTION_TYPE_MAXIMUM = 3 + } D3D12_FILTER_REDUCTION_TYPE; + +#define D3D12_FILTER_REDUCTION_TYPE_MASK ( 0x3 ) + +#define D3D12_FILTER_REDUCTION_TYPE_SHIFT ( 7 ) + +#define D3D12_FILTER_TYPE_MASK ( 0x3 ) + +#define D3D12_MIN_FILTER_SHIFT ( 4 ) + +#define D3D12_MAG_FILTER_SHIFT ( 2 ) + +#define D3D12_MIP_FILTER_SHIFT ( 0 ) + +#define D3D12_ANISOTROPIC_FILTERING_BIT ( 0x40 ) + +#define D3D12_ENCODE_BASIC_FILTER( min, mag, mip, reduction ) \ + ( ( D3D12_FILTER ) ( \ + ( ( ( min ) & D3D12_FILTER_TYPE_MASK ) << D3D12_MIN_FILTER_SHIFT ) | \ + ( ( ( mag ) & D3D12_FILTER_TYPE_MASK ) << D3D12_MAG_FILTER_SHIFT ) | \ + ( ( ( mip ) & D3D12_FILTER_TYPE_MASK ) << D3D12_MIP_FILTER_SHIFT ) | \ + ( ( ( reduction ) & D3D12_FILTER_REDUCTION_TYPE_MASK ) << D3D12_FILTER_REDUCTION_TYPE_SHIFT ) ) ) +#define D3D12_ENCODE_ANISOTROPIC_FILTER( reduction ) \ + ( ( D3D12_FILTER ) ( \ + D3D12_ANISOTROPIC_FILTERING_BIT | \ + D3D12_ENCODE_BASIC_FILTER( D3D12_FILTER_TYPE_LINEAR, \ + D3D12_FILTER_TYPE_LINEAR, \ + D3D12_FILTER_TYPE_LINEAR, \ + reduction ) ) ) +#define D3D12_DECODE_MIN_FILTER( D3D12Filter ) \ + ( ( D3D12_FILTER_TYPE ) \ + ( ( ( D3D12Filter ) >> D3D12_MIN_FILTER_SHIFT ) & D3D12_FILTER_TYPE_MASK ) ) +#define D3D12_DECODE_MAG_FILTER( D3D12Filter ) \ + ( ( D3D12_FILTER_TYPE ) \ + ( ( ( D3D12Filter ) >> D3D12_MAG_FILTER_SHIFT ) & D3D12_FILTER_TYPE_MASK ) ) +#define D3D12_DECODE_MIP_FILTER( D3D12Filter ) \ + ( ( D3D12_FILTER_TYPE ) \ + ( ( ( D3D12Filter ) >> D3D12_MIP_FILTER_SHIFT ) & D3D12_FILTER_TYPE_MASK ) ) +#define D3D12_DECODE_FILTER_REDUCTION( D3D12Filter ) \ + ( ( D3D12_FILTER_REDUCTION_TYPE ) \ + ( ( ( D3D12Filter ) >> D3D12_FILTER_REDUCTION_TYPE_SHIFT ) & D3D12_FILTER_REDUCTION_TYPE_MASK ) ) +#define D3D12_DECODE_IS_COMPARISON_FILTER( D3D12Filter ) \ + ( D3D12_DECODE_FILTER_REDUCTION( D3D12Filter ) == D3D12_FILTER_REDUCTION_TYPE_COMPARISON ) +#define D3D12_DECODE_IS_ANISOTROPIC_FILTER( D3D12Filter ) \ + ( ( ( D3D12Filter ) & D3D12_ANISOTROPIC_FILTERING_BIT ) && \ + ( D3D12_FILTER_TYPE_LINEAR == D3D12_DECODE_MIN_FILTER( D3D12Filter ) ) && \ + ( D3D12_FILTER_TYPE_LINEAR == D3D12_DECODE_MAG_FILTER( D3D12Filter ) ) && \ + ( D3D12_FILTER_TYPE_LINEAR == D3D12_DECODE_MIP_FILTER( D3D12Filter ) ) ) +typedef +enum D3D12_TEXTURE_ADDRESS_MODE + { + D3D12_TEXTURE_ADDRESS_MODE_WRAP = 1, + D3D12_TEXTURE_ADDRESS_MODE_MIRROR = 2, + D3D12_TEXTURE_ADDRESS_MODE_CLAMP = 3, + D3D12_TEXTURE_ADDRESS_MODE_BORDER = 4, + D3D12_TEXTURE_ADDRESS_MODE_MIRROR_ONCE = 5 + } D3D12_TEXTURE_ADDRESS_MODE; + +typedef struct D3D12_SAMPLER_DESC + { + D3D12_FILTER Filter; + D3D12_TEXTURE_ADDRESS_MODE AddressU; + D3D12_TEXTURE_ADDRESS_MODE AddressV; + D3D12_TEXTURE_ADDRESS_MODE AddressW; + FLOAT MipLODBias; + UINT MaxAnisotropy; + D3D12_COMPARISON_FUNC ComparisonFunc; + FLOAT BorderColor[ 4 ]; + FLOAT MinLOD; + FLOAT MaxLOD; + } D3D12_SAMPLER_DESC; + +typedef +enum D3D12_SAMPLER_FLAGS + { + D3D12_SAMPLER_FLAG_NONE = 0, + D3D12_SAMPLER_FLAG_UINT_BORDER_COLOR = 0x1 + } D3D12_SAMPLER_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_SAMPLER_FLAGS ); +typedef struct D3D12_SAMPLER_DESC2 + { + D3D12_FILTER Filter; + D3D12_TEXTURE_ADDRESS_MODE AddressU; + D3D12_TEXTURE_ADDRESS_MODE AddressV; + D3D12_TEXTURE_ADDRESS_MODE AddressW; + FLOAT MipLODBias; + UINT MaxAnisotropy; + D3D12_COMPARISON_FUNC ComparisonFunc; + union + { + FLOAT FloatBorderColor[ 4 ]; + UINT UintBorderColor[ 4 ]; + } ; + FLOAT MinLOD; + FLOAT MaxLOD; + D3D12_SAMPLER_FLAGS Flags; + } D3D12_SAMPLER_DESC2; + +typedef +enum D3D12_BUFFER_UAV_FLAGS + { + D3D12_BUFFER_UAV_FLAG_NONE = 0, + D3D12_BUFFER_UAV_FLAG_RAW = 0x1 + } D3D12_BUFFER_UAV_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_BUFFER_UAV_FLAGS ); +typedef struct D3D12_BUFFER_UAV + { + UINT64 FirstElement; + UINT NumElements; + UINT StructureByteStride; + UINT64 CounterOffsetInBytes; + D3D12_BUFFER_UAV_FLAGS Flags; + } D3D12_BUFFER_UAV; + +typedef struct D3D12_TEX1D_UAV + { + UINT MipSlice; + } D3D12_TEX1D_UAV; + +typedef struct D3D12_TEX1D_ARRAY_UAV + { + UINT MipSlice; + UINT FirstArraySlice; + UINT ArraySize; + } D3D12_TEX1D_ARRAY_UAV; + +typedef struct D3D12_TEX2D_UAV + { + UINT MipSlice; + UINT PlaneSlice; + } D3D12_TEX2D_UAV; + +typedef struct D3D12_TEX2D_ARRAY_UAV + { + UINT MipSlice; + UINT FirstArraySlice; + UINT ArraySize; + UINT PlaneSlice; + } D3D12_TEX2D_ARRAY_UAV; + +typedef struct D3D12_TEX2DMS_UAV + { + UINT UnusedField_NothingToDefine; + } D3D12_TEX2DMS_UAV; + +typedef struct D3D12_TEX2DMS_ARRAY_UAV + { + UINT FirstArraySlice; + UINT ArraySize; + } D3D12_TEX2DMS_ARRAY_UAV; + +typedef struct D3D12_TEX3D_UAV + { + UINT MipSlice; + UINT FirstWSlice; + UINT WSize; + } D3D12_TEX3D_UAV; + +typedef +enum D3D12_UAV_DIMENSION + { + D3D12_UAV_DIMENSION_UNKNOWN = 0, + D3D12_UAV_DIMENSION_BUFFER = 1, + D3D12_UAV_DIMENSION_TEXTURE1D = 2, + D3D12_UAV_DIMENSION_TEXTURE1DARRAY = 3, + D3D12_UAV_DIMENSION_TEXTURE2D = 4, + D3D12_UAV_DIMENSION_TEXTURE2DARRAY = 5, + D3D12_UAV_DIMENSION_TEXTURE2DMS = 6, + D3D12_UAV_DIMENSION_TEXTURE2DMSARRAY = 7, + D3D12_UAV_DIMENSION_TEXTURE3D = 8 + } D3D12_UAV_DIMENSION; + +typedef struct D3D12_UNORDERED_ACCESS_VIEW_DESC + { + DXGI_FORMAT Format; + D3D12_UAV_DIMENSION ViewDimension; + union + { + D3D12_BUFFER_UAV Buffer; + D3D12_TEX1D_UAV Texture1D; + D3D12_TEX1D_ARRAY_UAV Texture1DArray; + D3D12_TEX2D_UAV Texture2D; + D3D12_TEX2D_ARRAY_UAV Texture2DArray; + D3D12_TEX2DMS_UAV Texture2DMS; + D3D12_TEX2DMS_ARRAY_UAV Texture2DMSArray; + D3D12_TEX3D_UAV Texture3D; + } ; + } D3D12_UNORDERED_ACCESS_VIEW_DESC; + +typedef struct D3D12_BUFFER_RTV + { + UINT64 FirstElement; + UINT NumElements; + } D3D12_BUFFER_RTV; + +typedef struct D3D12_TEX1D_RTV + { + UINT MipSlice; + } D3D12_TEX1D_RTV; + +typedef struct D3D12_TEX1D_ARRAY_RTV + { + UINT MipSlice; + UINT FirstArraySlice; + UINT ArraySize; + } D3D12_TEX1D_ARRAY_RTV; + +typedef struct D3D12_TEX2D_RTV + { + UINT MipSlice; + UINT PlaneSlice; + } D3D12_TEX2D_RTV; + +typedef struct D3D12_TEX2DMS_RTV + { + UINT UnusedField_NothingToDefine; + } D3D12_TEX2DMS_RTV; + +typedef struct D3D12_TEX2D_ARRAY_RTV + { + UINT MipSlice; + UINT FirstArraySlice; + UINT ArraySize; + UINT PlaneSlice; + } D3D12_TEX2D_ARRAY_RTV; + +typedef struct D3D12_TEX2DMS_ARRAY_RTV + { + UINT FirstArraySlice; + UINT ArraySize; + } D3D12_TEX2DMS_ARRAY_RTV; + +typedef struct D3D12_TEX3D_RTV + { + UINT MipSlice; + UINT FirstWSlice; + UINT WSize; + } D3D12_TEX3D_RTV; + +typedef +enum D3D12_RTV_DIMENSION + { + D3D12_RTV_DIMENSION_UNKNOWN = 0, + D3D12_RTV_DIMENSION_BUFFER = 1, + D3D12_RTV_DIMENSION_TEXTURE1D = 2, + D3D12_RTV_DIMENSION_TEXTURE1DARRAY = 3, + D3D12_RTV_DIMENSION_TEXTURE2D = 4, + D3D12_RTV_DIMENSION_TEXTURE2DARRAY = 5, + D3D12_RTV_DIMENSION_TEXTURE2DMS = 6, + D3D12_RTV_DIMENSION_TEXTURE2DMSARRAY = 7, + D3D12_RTV_DIMENSION_TEXTURE3D = 8 + } D3D12_RTV_DIMENSION; + +typedef struct D3D12_RENDER_TARGET_VIEW_DESC + { + DXGI_FORMAT Format; + D3D12_RTV_DIMENSION ViewDimension; + union + { + D3D12_BUFFER_RTV Buffer; + D3D12_TEX1D_RTV Texture1D; + D3D12_TEX1D_ARRAY_RTV Texture1DArray; + D3D12_TEX2D_RTV Texture2D; + D3D12_TEX2D_ARRAY_RTV Texture2DArray; + D3D12_TEX2DMS_RTV Texture2DMS; + D3D12_TEX2DMS_ARRAY_RTV Texture2DMSArray; + D3D12_TEX3D_RTV Texture3D; + } ; + } D3D12_RENDER_TARGET_VIEW_DESC; + +typedef struct D3D12_TEX1D_DSV + { + UINT MipSlice; + } D3D12_TEX1D_DSV; + +typedef struct D3D12_TEX1D_ARRAY_DSV + { + UINT MipSlice; + UINT FirstArraySlice; + UINT ArraySize; + } D3D12_TEX1D_ARRAY_DSV; + +typedef struct D3D12_TEX2D_DSV + { + UINT MipSlice; + } D3D12_TEX2D_DSV; + +typedef struct D3D12_TEX2D_ARRAY_DSV + { + UINT MipSlice; + UINT FirstArraySlice; + UINT ArraySize; + } D3D12_TEX2D_ARRAY_DSV; + +typedef struct D3D12_TEX2DMS_DSV + { + UINT UnusedField_NothingToDefine; + } D3D12_TEX2DMS_DSV; + +typedef struct D3D12_TEX2DMS_ARRAY_DSV + { + UINT FirstArraySlice; + UINT ArraySize; + } D3D12_TEX2DMS_ARRAY_DSV; + +typedef +enum D3D12_DSV_FLAGS + { + D3D12_DSV_FLAG_NONE = 0, + D3D12_DSV_FLAG_READ_ONLY_DEPTH = 0x1, + D3D12_DSV_FLAG_READ_ONLY_STENCIL = 0x2 + } D3D12_DSV_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_DSV_FLAGS ); +typedef +enum D3D12_DSV_DIMENSION + { + D3D12_DSV_DIMENSION_UNKNOWN = 0, + D3D12_DSV_DIMENSION_TEXTURE1D = 1, + D3D12_DSV_DIMENSION_TEXTURE1DARRAY = 2, + D3D12_DSV_DIMENSION_TEXTURE2D = 3, + D3D12_DSV_DIMENSION_TEXTURE2DARRAY = 4, + D3D12_DSV_DIMENSION_TEXTURE2DMS = 5, + D3D12_DSV_DIMENSION_TEXTURE2DMSARRAY = 6 + } D3D12_DSV_DIMENSION; + +typedef struct D3D12_DEPTH_STENCIL_VIEW_DESC + { + DXGI_FORMAT Format; + D3D12_DSV_DIMENSION ViewDimension; + D3D12_DSV_FLAGS Flags; + union + { + D3D12_TEX1D_DSV Texture1D; + D3D12_TEX1D_ARRAY_DSV Texture1DArray; + D3D12_TEX2D_DSV Texture2D; + D3D12_TEX2D_ARRAY_DSV Texture2DArray; + D3D12_TEX2DMS_DSV Texture2DMS; + D3D12_TEX2DMS_ARRAY_DSV Texture2DMSArray; + } ; + } D3D12_DEPTH_STENCIL_VIEW_DESC; + +typedef +enum D3D12_CLEAR_FLAGS + { + D3D12_CLEAR_FLAG_DEPTH = 0x1, + D3D12_CLEAR_FLAG_STENCIL = 0x2 + } D3D12_CLEAR_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_CLEAR_FLAGS ); +typedef +enum D3D12_FENCE_FLAGS + { + D3D12_FENCE_FLAG_NONE = 0, + D3D12_FENCE_FLAG_SHARED = 0x1, + D3D12_FENCE_FLAG_SHARED_CROSS_ADAPTER = 0x2, + D3D12_FENCE_FLAG_NON_MONITORED = 0x4 + } D3D12_FENCE_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_FENCE_FLAGS ); +typedef +enum D3D12_DESCRIPTOR_HEAP_TYPE + { + D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV = 0, + D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER = ( D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV + 1 ) , + D3D12_DESCRIPTOR_HEAP_TYPE_RTV = ( D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER + 1 ) , + D3D12_DESCRIPTOR_HEAP_TYPE_DSV = ( D3D12_DESCRIPTOR_HEAP_TYPE_RTV + 1 ) , + D3D12_DESCRIPTOR_HEAP_TYPE_NUM_TYPES = ( D3D12_DESCRIPTOR_HEAP_TYPE_DSV + 1 ) + } D3D12_DESCRIPTOR_HEAP_TYPE; + +typedef +enum D3D12_DESCRIPTOR_HEAP_FLAGS + { + D3D12_DESCRIPTOR_HEAP_FLAG_NONE = 0, + D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE = 0x1 + } D3D12_DESCRIPTOR_HEAP_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_DESCRIPTOR_HEAP_FLAGS ); +typedef struct D3D12_DESCRIPTOR_HEAP_DESC + { + D3D12_DESCRIPTOR_HEAP_TYPE Type; + UINT NumDescriptors; + D3D12_DESCRIPTOR_HEAP_FLAGS Flags; + UINT NodeMask; + } D3D12_DESCRIPTOR_HEAP_DESC; + +typedef +enum D3D12_DESCRIPTOR_RANGE_TYPE + { + D3D12_DESCRIPTOR_RANGE_TYPE_SRV = 0, + D3D12_DESCRIPTOR_RANGE_TYPE_UAV = ( D3D12_DESCRIPTOR_RANGE_TYPE_SRV + 1 ) , + D3D12_DESCRIPTOR_RANGE_TYPE_CBV = ( D3D12_DESCRIPTOR_RANGE_TYPE_UAV + 1 ) , + D3D12_DESCRIPTOR_RANGE_TYPE_SAMPLER = ( D3D12_DESCRIPTOR_RANGE_TYPE_CBV + 1 ) + } D3D12_DESCRIPTOR_RANGE_TYPE; + +typedef struct D3D12_DESCRIPTOR_RANGE + { + D3D12_DESCRIPTOR_RANGE_TYPE RangeType; + UINT NumDescriptors; + UINT BaseShaderRegister; + UINT RegisterSpace; + UINT OffsetInDescriptorsFromTableStart; + } D3D12_DESCRIPTOR_RANGE; + +typedef struct D3D12_ROOT_DESCRIPTOR_TABLE + { + UINT NumDescriptorRanges; + _Field_size_full_(NumDescriptorRanges) const D3D12_DESCRIPTOR_RANGE *pDescriptorRanges; + } D3D12_ROOT_DESCRIPTOR_TABLE; + +typedef struct D3D12_ROOT_CONSTANTS + { + UINT ShaderRegister; + UINT RegisterSpace; + UINT Num32BitValues; + } D3D12_ROOT_CONSTANTS; + +typedef struct D3D12_ROOT_DESCRIPTOR + { + UINT ShaderRegister; + UINT RegisterSpace; + } D3D12_ROOT_DESCRIPTOR; + +typedef +enum D3D12_SHADER_VISIBILITY + { + D3D12_SHADER_VISIBILITY_ALL = 0, + D3D12_SHADER_VISIBILITY_VERTEX = 1, + D3D12_SHADER_VISIBILITY_HULL = 2, + D3D12_SHADER_VISIBILITY_DOMAIN = 3, + D3D12_SHADER_VISIBILITY_GEOMETRY = 4, + D3D12_SHADER_VISIBILITY_PIXEL = 5, + D3D12_SHADER_VISIBILITY_AMPLIFICATION = 6, + D3D12_SHADER_VISIBILITY_MESH = 7 + } D3D12_SHADER_VISIBILITY; + +typedef +enum D3D12_ROOT_PARAMETER_TYPE + { + D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE = 0, + D3D12_ROOT_PARAMETER_TYPE_32BIT_CONSTANTS = ( D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE + 1 ) , + D3D12_ROOT_PARAMETER_TYPE_CBV = ( D3D12_ROOT_PARAMETER_TYPE_32BIT_CONSTANTS + 1 ) , + D3D12_ROOT_PARAMETER_TYPE_SRV = ( D3D12_ROOT_PARAMETER_TYPE_CBV + 1 ) , + D3D12_ROOT_PARAMETER_TYPE_UAV = ( D3D12_ROOT_PARAMETER_TYPE_SRV + 1 ) + } D3D12_ROOT_PARAMETER_TYPE; + +typedef struct D3D12_ROOT_PARAMETER + { + D3D12_ROOT_PARAMETER_TYPE ParameterType; + union + { + D3D12_ROOT_DESCRIPTOR_TABLE DescriptorTable; + D3D12_ROOT_CONSTANTS Constants; + D3D12_ROOT_DESCRIPTOR Descriptor; + } ; + D3D12_SHADER_VISIBILITY ShaderVisibility; + } D3D12_ROOT_PARAMETER; + +typedef +enum D3D12_ROOT_SIGNATURE_FLAGS + { + D3D12_ROOT_SIGNATURE_FLAG_NONE = 0, + D3D12_ROOT_SIGNATURE_FLAG_ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT = 0x1, + D3D12_ROOT_SIGNATURE_FLAG_DENY_VERTEX_SHADER_ROOT_ACCESS = 0x2, + D3D12_ROOT_SIGNATURE_FLAG_DENY_HULL_SHADER_ROOT_ACCESS = 0x4, + D3D12_ROOT_SIGNATURE_FLAG_DENY_DOMAIN_SHADER_ROOT_ACCESS = 0x8, + D3D12_ROOT_SIGNATURE_FLAG_DENY_GEOMETRY_SHADER_ROOT_ACCESS = 0x10, + D3D12_ROOT_SIGNATURE_FLAG_DENY_PIXEL_SHADER_ROOT_ACCESS = 0x20, + D3D12_ROOT_SIGNATURE_FLAG_ALLOW_STREAM_OUTPUT = 0x40, + D3D12_ROOT_SIGNATURE_FLAG_LOCAL_ROOT_SIGNATURE = 0x80, + D3D12_ROOT_SIGNATURE_FLAG_DENY_AMPLIFICATION_SHADER_ROOT_ACCESS = 0x100, + D3D12_ROOT_SIGNATURE_FLAG_DENY_MESH_SHADER_ROOT_ACCESS = 0x200, + D3D12_ROOT_SIGNATURE_FLAG_CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED = 0x400, + D3D12_ROOT_SIGNATURE_FLAG_SAMPLER_HEAP_DIRECTLY_INDEXED = 0x800 + } D3D12_ROOT_SIGNATURE_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_ROOT_SIGNATURE_FLAGS ); +typedef +enum D3D12_STATIC_BORDER_COLOR + { + D3D12_STATIC_BORDER_COLOR_TRANSPARENT_BLACK = 0, + D3D12_STATIC_BORDER_COLOR_OPAQUE_BLACK = ( D3D12_STATIC_BORDER_COLOR_TRANSPARENT_BLACK + 1 ) , + D3D12_STATIC_BORDER_COLOR_OPAQUE_WHITE = ( D3D12_STATIC_BORDER_COLOR_OPAQUE_BLACK + 1 ) , + D3D12_STATIC_BORDER_COLOR_OPAQUE_BLACK_UINT = ( D3D12_STATIC_BORDER_COLOR_OPAQUE_WHITE + 1 ) , + D3D12_STATIC_BORDER_COLOR_OPAQUE_WHITE_UINT = ( D3D12_STATIC_BORDER_COLOR_OPAQUE_BLACK_UINT + 1 ) + } D3D12_STATIC_BORDER_COLOR; + +typedef struct D3D12_STATIC_SAMPLER_DESC + { + D3D12_FILTER Filter; + D3D12_TEXTURE_ADDRESS_MODE AddressU; + D3D12_TEXTURE_ADDRESS_MODE AddressV; + D3D12_TEXTURE_ADDRESS_MODE AddressW; + FLOAT MipLODBias; + UINT MaxAnisotropy; + D3D12_COMPARISON_FUNC ComparisonFunc; + D3D12_STATIC_BORDER_COLOR BorderColor; + FLOAT MinLOD; + FLOAT MaxLOD; + UINT ShaderRegister; + UINT RegisterSpace; + D3D12_SHADER_VISIBILITY ShaderVisibility; + } D3D12_STATIC_SAMPLER_DESC; + +typedef struct D3D12_ROOT_SIGNATURE_DESC + { + UINT NumParameters; + _Field_size_full_(NumParameters) const D3D12_ROOT_PARAMETER *pParameters; + UINT NumStaticSamplers; + _Field_size_full_(NumStaticSamplers) const D3D12_STATIC_SAMPLER_DESC *pStaticSamplers; + D3D12_ROOT_SIGNATURE_FLAGS Flags; + } D3D12_ROOT_SIGNATURE_DESC; + +typedef +enum D3D12_DESCRIPTOR_RANGE_FLAGS + { + D3D12_DESCRIPTOR_RANGE_FLAG_NONE = 0, + D3D12_DESCRIPTOR_RANGE_FLAG_DESCRIPTORS_VOLATILE = 0x1, + D3D12_DESCRIPTOR_RANGE_FLAG_DATA_VOLATILE = 0x2, + D3D12_DESCRIPTOR_RANGE_FLAG_DATA_STATIC_WHILE_SET_AT_EXECUTE = 0x4, + D3D12_DESCRIPTOR_RANGE_FLAG_DATA_STATIC = 0x8, + D3D12_DESCRIPTOR_RANGE_FLAG_DESCRIPTORS_STATIC_KEEPING_BUFFER_BOUNDS_CHECKS = 0x10000 + } D3D12_DESCRIPTOR_RANGE_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_DESCRIPTOR_RANGE_FLAGS ); +typedef struct D3D12_DESCRIPTOR_RANGE1 + { + D3D12_DESCRIPTOR_RANGE_TYPE RangeType; + UINT NumDescriptors; + UINT BaseShaderRegister; + UINT RegisterSpace; + D3D12_DESCRIPTOR_RANGE_FLAGS Flags; + UINT OffsetInDescriptorsFromTableStart; + } D3D12_DESCRIPTOR_RANGE1; + +typedef struct D3D12_ROOT_DESCRIPTOR_TABLE1 + { + UINT NumDescriptorRanges; + _Field_size_full_(NumDescriptorRanges) const D3D12_DESCRIPTOR_RANGE1 *pDescriptorRanges; + } D3D12_ROOT_DESCRIPTOR_TABLE1; + +typedef +enum D3D12_ROOT_DESCRIPTOR_FLAGS + { + D3D12_ROOT_DESCRIPTOR_FLAG_NONE = 0, + D3D12_ROOT_DESCRIPTOR_FLAG_DATA_VOLATILE = 0x2, + D3D12_ROOT_DESCRIPTOR_FLAG_DATA_STATIC_WHILE_SET_AT_EXECUTE = 0x4, + D3D12_ROOT_DESCRIPTOR_FLAG_DATA_STATIC = 0x8 + } D3D12_ROOT_DESCRIPTOR_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_ROOT_DESCRIPTOR_FLAGS ); +typedef struct D3D12_ROOT_DESCRIPTOR1 + { + UINT ShaderRegister; + UINT RegisterSpace; + D3D12_ROOT_DESCRIPTOR_FLAGS Flags; + } D3D12_ROOT_DESCRIPTOR1; + +typedef struct D3D12_ROOT_PARAMETER1 + { + D3D12_ROOT_PARAMETER_TYPE ParameterType; + union + { + D3D12_ROOT_DESCRIPTOR_TABLE1 DescriptorTable; + D3D12_ROOT_CONSTANTS Constants; + D3D12_ROOT_DESCRIPTOR1 Descriptor; + } ; + D3D12_SHADER_VISIBILITY ShaderVisibility; + } D3D12_ROOT_PARAMETER1; + +typedef struct D3D12_ROOT_SIGNATURE_DESC1 + { + UINT NumParameters; + _Field_size_full_(NumParameters) const D3D12_ROOT_PARAMETER1 *pParameters; + UINT NumStaticSamplers; + _Field_size_full_(NumStaticSamplers) const D3D12_STATIC_SAMPLER_DESC *pStaticSamplers; + D3D12_ROOT_SIGNATURE_FLAGS Flags; + } D3D12_ROOT_SIGNATURE_DESC1; + +typedef struct D3D12_VERSIONED_ROOT_SIGNATURE_DESC + { + D3D_ROOT_SIGNATURE_VERSION Version; + union + { + D3D12_ROOT_SIGNATURE_DESC Desc_1_0; + D3D12_ROOT_SIGNATURE_DESC1 Desc_1_1; + } ; + } D3D12_VERSIONED_ROOT_SIGNATURE_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0001_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0001_v0_0_s_ifspec; + +#ifndef __ID3D12RootSignatureDeserializer_INTERFACE_DEFINED__ +#define __ID3D12RootSignatureDeserializer_INTERFACE_DEFINED__ + +/* interface ID3D12RootSignatureDeserializer */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12RootSignatureDeserializer; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("34AB647B-3CC8-46AC-841B-C0965645C046") + ID3D12RootSignatureDeserializer : public IUnknown + { + public: + virtual const D3D12_ROOT_SIGNATURE_DESC *STDMETHODCALLTYPE GetRootSignatureDesc( void) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12RootSignatureDeserializerVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12RootSignatureDeserializer * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12RootSignatureDeserializer * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12RootSignatureDeserializer * This); + + DECLSPEC_XFGVIRT(ID3D12RootSignatureDeserializer, GetRootSignatureDesc) + const D3D12_ROOT_SIGNATURE_DESC *( STDMETHODCALLTYPE *GetRootSignatureDesc )( + ID3D12RootSignatureDeserializer * This); + + END_INTERFACE + } ID3D12RootSignatureDeserializerVtbl; + + interface ID3D12RootSignatureDeserializer + { + CONST_VTBL struct ID3D12RootSignatureDeserializerVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12RootSignatureDeserializer_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12RootSignatureDeserializer_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12RootSignatureDeserializer_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12RootSignatureDeserializer_GetRootSignatureDesc(This) \ + ( (This)->lpVtbl -> GetRootSignatureDesc(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12RootSignatureDeserializer_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12VersionedRootSignatureDeserializer_INTERFACE_DEFINED__ +#define __ID3D12VersionedRootSignatureDeserializer_INTERFACE_DEFINED__ + +/* interface ID3D12VersionedRootSignatureDeserializer */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VersionedRootSignatureDeserializer; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("7F91CE67-090C-4BB7-B78E-ED8FF2E31DA0") + ID3D12VersionedRootSignatureDeserializer : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE GetRootSignatureDescAtVersion( + D3D_ROOT_SIGNATURE_VERSION convertToVersion, + _Out_ const D3D12_VERSIONED_ROOT_SIGNATURE_DESC **ppDesc) = 0; + + virtual const D3D12_VERSIONED_ROOT_SIGNATURE_DESC *STDMETHODCALLTYPE GetUnconvertedRootSignatureDesc( void) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VersionedRootSignatureDeserializerVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VersionedRootSignatureDeserializer * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VersionedRootSignatureDeserializer * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VersionedRootSignatureDeserializer * This); + + DECLSPEC_XFGVIRT(ID3D12VersionedRootSignatureDeserializer, GetRootSignatureDescAtVersion) + HRESULT ( STDMETHODCALLTYPE *GetRootSignatureDescAtVersion )( + ID3D12VersionedRootSignatureDeserializer * This, + D3D_ROOT_SIGNATURE_VERSION convertToVersion, + _Out_ const D3D12_VERSIONED_ROOT_SIGNATURE_DESC **ppDesc); + + DECLSPEC_XFGVIRT(ID3D12VersionedRootSignatureDeserializer, GetUnconvertedRootSignatureDesc) + const D3D12_VERSIONED_ROOT_SIGNATURE_DESC *( STDMETHODCALLTYPE *GetUnconvertedRootSignatureDesc )( + ID3D12VersionedRootSignatureDeserializer * This); + + END_INTERFACE + } ID3D12VersionedRootSignatureDeserializerVtbl; + + interface ID3D12VersionedRootSignatureDeserializer + { + CONST_VTBL struct ID3D12VersionedRootSignatureDeserializerVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VersionedRootSignatureDeserializer_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VersionedRootSignatureDeserializer_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VersionedRootSignatureDeserializer_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VersionedRootSignatureDeserializer_GetRootSignatureDescAtVersion(This,convertToVersion,ppDesc) \ + ( (This)->lpVtbl -> GetRootSignatureDescAtVersion(This,convertToVersion,ppDesc) ) + +#define ID3D12VersionedRootSignatureDeserializer_GetUnconvertedRootSignatureDesc(This) \ + ( (This)->lpVtbl -> GetUnconvertedRootSignatureDesc(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VersionedRootSignatureDeserializer_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0003 */ +/* [local] */ + +typedef HRESULT (WINAPI* PFN_D3D12_SERIALIZE_ROOT_SIGNATURE)( + _In_ const D3D12_ROOT_SIGNATURE_DESC* pRootSignature, + _In_ D3D_ROOT_SIGNATURE_VERSION Version, + _Out_ ID3DBlob** ppBlob, + _Always_(_Outptr_opt_result_maybenull_) ID3DBlob** ppErrorBlob); + +HRESULT WINAPI D3D12SerializeRootSignature( + _In_ const D3D12_ROOT_SIGNATURE_DESC* pRootSignature, + _In_ D3D_ROOT_SIGNATURE_VERSION Version, + _Out_ ID3DBlob** ppBlob, + _Always_(_Outptr_opt_result_maybenull_) ID3DBlob** ppErrorBlob); + +typedef HRESULT (WINAPI* PFN_D3D12_CREATE_ROOT_SIGNATURE_DESERIALIZER)( + _In_reads_bytes_(SrcDataSizeInBytes) LPCVOID pSrcData, + _In_ SIZE_T SrcDataSizeInBytes, + _In_ REFIID pRootSignatureDeserializerInterface, + _Out_ void** ppRootSignatureDeserializer); + +HRESULT WINAPI D3D12CreateRootSignatureDeserializer( + _In_reads_bytes_(SrcDataSizeInBytes) LPCVOID pSrcData, + _In_ SIZE_T SrcDataSizeInBytes, + _In_ REFIID pRootSignatureDeserializerInterface, + _Out_ void** ppRootSignatureDeserializer); + +typedef HRESULT (WINAPI* PFN_D3D12_SERIALIZE_VERSIONED_ROOT_SIGNATURE)( + _In_ const D3D12_VERSIONED_ROOT_SIGNATURE_DESC* pRootSignature, + _Out_ ID3DBlob** ppBlob, + _Always_(_Outptr_opt_result_maybenull_) ID3DBlob** ppErrorBlob); + +HRESULT WINAPI D3D12SerializeVersionedRootSignature( + _In_ const D3D12_VERSIONED_ROOT_SIGNATURE_DESC* pRootSignature, + _Out_ ID3DBlob** ppBlob, + _Always_(_Outptr_opt_result_maybenull_) ID3DBlob** ppErrorBlob); + +typedef HRESULT (WINAPI* PFN_D3D12_CREATE_VERSIONED_ROOT_SIGNATURE_DESERIALIZER)( + _In_reads_bytes_(SrcDataSizeInBytes) LPCVOID pSrcData, + _In_ SIZE_T SrcDataSizeInBytes, + _In_ REFIID pRootSignatureDeserializerInterface, + _Out_ void** ppRootSignatureDeserializer); + +HRESULT WINAPI D3D12CreateVersionedRootSignatureDeserializer( + _In_reads_bytes_(SrcDataSizeInBytes) LPCVOID pSrcData, + _In_ SIZE_T SrcDataSizeInBytes, + _In_ REFIID pRootSignatureDeserializerInterface, + _Out_ void** ppRootSignatureDeserializer); + +typedef struct D3D12_CPU_DESCRIPTOR_HANDLE + { + SIZE_T ptr; + } D3D12_CPU_DESCRIPTOR_HANDLE; + +typedef struct D3D12_GPU_DESCRIPTOR_HANDLE + { + UINT64 ptr; + } D3D12_GPU_DESCRIPTOR_HANDLE; + +// If rects are supplied in D3D12_DISCARD_REGION, below, the resource +// must have 2D subresources with all specified subresources the same dimension. +typedef struct D3D12_DISCARD_REGION + { + UINT NumRects; + _In_reads_(NumRects) const D3D12_RECT *pRects; + UINT FirstSubresource; + UINT NumSubresources; + } D3D12_DISCARD_REGION; + +typedef +enum D3D12_QUERY_HEAP_TYPE + { + D3D12_QUERY_HEAP_TYPE_OCCLUSION = 0, + D3D12_QUERY_HEAP_TYPE_TIMESTAMP = 1, + D3D12_QUERY_HEAP_TYPE_PIPELINE_STATISTICS = 2, + D3D12_QUERY_HEAP_TYPE_SO_STATISTICS = 3, + D3D12_QUERY_HEAP_TYPE_VIDEO_DECODE_STATISTICS = 4, + D3D12_QUERY_HEAP_TYPE_COPY_QUEUE_TIMESTAMP = 5, + D3D12_QUERY_HEAP_TYPE_PIPELINE_STATISTICS1 = 7 + } D3D12_QUERY_HEAP_TYPE; + +typedef struct D3D12_QUERY_HEAP_DESC + { + D3D12_QUERY_HEAP_TYPE Type; + UINT Count; + UINT NodeMask; + } D3D12_QUERY_HEAP_DESC; + +typedef +enum D3D12_QUERY_TYPE + { + D3D12_QUERY_TYPE_OCCLUSION = 0, + D3D12_QUERY_TYPE_BINARY_OCCLUSION = 1, + D3D12_QUERY_TYPE_TIMESTAMP = 2, + D3D12_QUERY_TYPE_PIPELINE_STATISTICS = 3, + D3D12_QUERY_TYPE_SO_STATISTICS_STREAM0 = 4, + D3D12_QUERY_TYPE_SO_STATISTICS_STREAM1 = 5, + D3D12_QUERY_TYPE_SO_STATISTICS_STREAM2 = 6, + D3D12_QUERY_TYPE_SO_STATISTICS_STREAM3 = 7, + D3D12_QUERY_TYPE_VIDEO_DECODE_STATISTICS = 8, + D3D12_QUERY_TYPE_PIPELINE_STATISTICS1 = 10 + } D3D12_QUERY_TYPE; + +typedef +enum D3D12_PREDICATION_OP + { + D3D12_PREDICATION_OP_EQUAL_ZERO = 0, + D3D12_PREDICATION_OP_NOT_EQUAL_ZERO = 1 + } D3D12_PREDICATION_OP; + +typedef struct D3D12_QUERY_DATA_PIPELINE_STATISTICS + { + UINT64 IAVertices; + UINT64 IAPrimitives; + UINT64 VSInvocations; + UINT64 GSInvocations; + UINT64 GSPrimitives; + UINT64 CInvocations; + UINT64 CPrimitives; + UINT64 PSInvocations; + UINT64 HSInvocations; + UINT64 DSInvocations; + UINT64 CSInvocations; + } D3D12_QUERY_DATA_PIPELINE_STATISTICS; + +typedef struct D3D12_QUERY_DATA_PIPELINE_STATISTICS1 + { + UINT64 IAVertices; + UINT64 IAPrimitives; + UINT64 VSInvocations; + UINT64 GSInvocations; + UINT64 GSPrimitives; + UINT64 CInvocations; + UINT64 CPrimitives; + UINT64 PSInvocations; + UINT64 HSInvocations; + UINT64 DSInvocations; + UINT64 CSInvocations; + UINT64 ASInvocations; + UINT64 MSInvocations; + UINT64 MSPrimitives; + } D3D12_QUERY_DATA_PIPELINE_STATISTICS1; + +typedef struct D3D12_QUERY_DATA_SO_STATISTICS + { + UINT64 NumPrimitivesWritten; + UINT64 PrimitivesStorageNeeded; + } D3D12_QUERY_DATA_SO_STATISTICS; + +typedef struct D3D12_STREAM_OUTPUT_BUFFER_VIEW + { + D3D12_GPU_VIRTUAL_ADDRESS BufferLocation; + UINT64 SizeInBytes; + D3D12_GPU_VIRTUAL_ADDRESS BufferFilledSizeLocation; + } D3D12_STREAM_OUTPUT_BUFFER_VIEW; + +typedef struct D3D12_DRAW_ARGUMENTS + { + UINT VertexCountPerInstance; + UINT InstanceCount; + UINT StartVertexLocation; + UINT StartInstanceLocation; + } D3D12_DRAW_ARGUMENTS; + +typedef struct D3D12_DRAW_INDEXED_ARGUMENTS + { + UINT IndexCountPerInstance; + UINT InstanceCount; + UINT StartIndexLocation; + INT BaseVertexLocation; + UINT StartInstanceLocation; + } D3D12_DRAW_INDEXED_ARGUMENTS; + +typedef struct D3D12_DISPATCH_ARGUMENTS + { + UINT ThreadGroupCountX; + UINT ThreadGroupCountY; + UINT ThreadGroupCountZ; + } D3D12_DISPATCH_ARGUMENTS; + +typedef struct D3D12_VERTEX_BUFFER_VIEW + { + D3D12_GPU_VIRTUAL_ADDRESS BufferLocation; + UINT SizeInBytes; + UINT StrideInBytes; + } D3D12_VERTEX_BUFFER_VIEW; + +typedef struct D3D12_INDEX_BUFFER_VIEW + { + D3D12_GPU_VIRTUAL_ADDRESS BufferLocation; + UINT SizeInBytes; + DXGI_FORMAT Format; + } D3D12_INDEX_BUFFER_VIEW; + +typedef +enum D3D12_INDIRECT_ARGUMENT_TYPE + { + D3D12_INDIRECT_ARGUMENT_TYPE_DRAW = 0, + D3D12_INDIRECT_ARGUMENT_TYPE_DRAW_INDEXED = ( D3D12_INDIRECT_ARGUMENT_TYPE_DRAW + 1 ) , + D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH = ( D3D12_INDIRECT_ARGUMENT_TYPE_DRAW_INDEXED + 1 ) , + D3D12_INDIRECT_ARGUMENT_TYPE_VERTEX_BUFFER_VIEW = ( D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH + 1 ) , + D3D12_INDIRECT_ARGUMENT_TYPE_INDEX_BUFFER_VIEW = ( D3D12_INDIRECT_ARGUMENT_TYPE_VERTEX_BUFFER_VIEW + 1 ) , + D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT = ( D3D12_INDIRECT_ARGUMENT_TYPE_INDEX_BUFFER_VIEW + 1 ) , + D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT_BUFFER_VIEW = ( D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT + 1 ) , + D3D12_INDIRECT_ARGUMENT_TYPE_SHADER_RESOURCE_VIEW = ( D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT_BUFFER_VIEW + 1 ) , + D3D12_INDIRECT_ARGUMENT_TYPE_UNORDERED_ACCESS_VIEW = ( D3D12_INDIRECT_ARGUMENT_TYPE_SHADER_RESOURCE_VIEW + 1 ) , + D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_RAYS = ( D3D12_INDIRECT_ARGUMENT_TYPE_UNORDERED_ACCESS_VIEW + 1 ) , + D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_MESH = ( D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_RAYS + 1 ) + } D3D12_INDIRECT_ARGUMENT_TYPE; + +typedef struct D3D12_INDIRECT_ARGUMENT_DESC + { + D3D12_INDIRECT_ARGUMENT_TYPE Type; + union + { + struct + { + UINT Slot; + } VertexBuffer; + struct + { + UINT RootParameterIndex; + UINT DestOffsetIn32BitValues; + UINT Num32BitValuesToSet; + } Constant; + struct + { + UINT RootParameterIndex; + } ConstantBufferView; + struct + { + UINT RootParameterIndex; + } ShaderResourceView; + struct + { + UINT RootParameterIndex; + } UnorderedAccessView; + } ; + } D3D12_INDIRECT_ARGUMENT_DESC; + +typedef struct D3D12_COMMAND_SIGNATURE_DESC + { + UINT ByteStride; + UINT NumArgumentDescs; + _Field_size_full_(NumArgumentDescs) const D3D12_INDIRECT_ARGUMENT_DESC *pArgumentDescs; + UINT NodeMask; + } D3D12_COMMAND_SIGNATURE_DESC; + + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0003_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0003_v0_0_s_ifspec; + +#ifndef __ID3D12Pageable_INTERFACE_DEFINED__ +#define __ID3D12Pageable_INTERFACE_DEFINED__ + +/* interface ID3D12Pageable */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Pageable; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("63ee58fb-1268-4835-86da-f008ce62f0d6") + ID3D12Pageable : public ID3D12DeviceChild + { + public: + }; + + +#else /* C style interface */ + + typedef struct ID3D12PageableVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Pageable * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Pageable * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Pageable * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Pageable * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Pageable * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Pageable * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Pageable * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12Pageable * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + END_INTERFACE + } ID3D12PageableVtbl; + + interface ID3D12Pageable + { + CONST_VTBL struct ID3D12PageableVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Pageable_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Pageable_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Pageable_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Pageable_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Pageable_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Pageable_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Pageable_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Pageable_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Pageable_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Heap_INTERFACE_DEFINED__ +#define __ID3D12Heap_INTERFACE_DEFINED__ + +/* interface ID3D12Heap */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Heap; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("6b3b2502-6e51-45b3-90ee-9884265e8df3") + ID3D12Heap : public ID3D12Pageable + { + public: +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_HEAP_DESC STDMETHODCALLTYPE GetDesc( void) = 0; +#else + virtual D3D12_HEAP_DESC *STDMETHODCALLTYPE GetDesc( + D3D12_HEAP_DESC * RetVal) = 0; +#endif + + }; + + +#else /* C style interface */ + + typedef struct ID3D12HeapVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Heap * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Heap * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Heap * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Heap * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Heap * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Heap * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Heap * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12Heap * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12Heap, GetDesc) +#if !defined(_WIN32) + D3D12_HEAP_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12Heap * This); + +#else + D3D12_HEAP_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12Heap * This, + D3D12_HEAP_DESC * RetVal); + +#endif + + END_INTERFACE + } ID3D12HeapVtbl; + + interface ID3D12Heap + { + CONST_VTBL struct ID3D12HeapVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Heap_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Heap_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Heap_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Heap_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Heap_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Heap_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Heap_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Heap_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#if !defined(_WIN32) + +#define ID3D12Heap_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) +#else +#define ID3D12Heap_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) +#endif + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Heap_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Resource_INTERFACE_DEFINED__ +#define __ID3D12Resource_INTERFACE_DEFINED__ + +/* interface ID3D12Resource */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Resource; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("696442be-a72e-4059-bc79-5b5c98040fad") + ID3D12Resource : public ID3D12Pageable + { + public: + virtual HRESULT STDMETHODCALLTYPE Map( + UINT Subresource, + _In_opt_ const D3D12_RANGE *pReadRange, + _Outptr_opt_result_bytebuffer_(_Inexpressible_("Dependent on resource")) void **ppData) = 0; + + virtual void STDMETHODCALLTYPE Unmap( + UINT Subresource, + _In_opt_ const D3D12_RANGE *pWrittenRange) = 0; + +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_RESOURCE_DESC STDMETHODCALLTYPE GetDesc( void) = 0; +#else + virtual D3D12_RESOURCE_DESC *STDMETHODCALLTYPE GetDesc( + D3D12_RESOURCE_DESC * RetVal) = 0; +#endif + + virtual D3D12_GPU_VIRTUAL_ADDRESS STDMETHODCALLTYPE GetGPUVirtualAddress( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE WriteToSubresource( + UINT DstSubresource, + _In_opt_ const D3D12_BOX *pDstBox, + _In_ const void *pSrcData, + UINT SrcRowPitch, + UINT SrcDepthPitch) = 0; + + virtual HRESULT STDMETHODCALLTYPE ReadFromSubresource( + _Out_ void *pDstData, + UINT DstRowPitch, + UINT DstDepthPitch, + UINT SrcSubresource, + _In_opt_ const D3D12_BOX *pSrcBox) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetHeapProperties( + _Out_opt_ D3D12_HEAP_PROPERTIES *pHeapProperties, + _Out_opt_ D3D12_HEAP_FLAGS *pHeapFlags) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12ResourceVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Resource * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Resource * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Resource * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Resource * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Resource * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Resource * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Resource * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12Resource * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12Resource, Map) + HRESULT ( STDMETHODCALLTYPE *Map )( + ID3D12Resource * This, + UINT Subresource, + _In_opt_ const D3D12_RANGE *pReadRange, + _Outptr_opt_result_bytebuffer_(_Inexpressible_("Dependent on resource")) void **ppData); + + DECLSPEC_XFGVIRT(ID3D12Resource, Unmap) + void ( STDMETHODCALLTYPE *Unmap )( + ID3D12Resource * This, + UINT Subresource, + _In_opt_ const D3D12_RANGE *pWrittenRange); + + DECLSPEC_XFGVIRT(ID3D12Resource, GetDesc) +#if !defined(_WIN32) + D3D12_RESOURCE_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12Resource * This); + +#else + D3D12_RESOURCE_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12Resource * This, + D3D12_RESOURCE_DESC * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Resource, GetGPUVirtualAddress) + D3D12_GPU_VIRTUAL_ADDRESS ( STDMETHODCALLTYPE *GetGPUVirtualAddress )( + ID3D12Resource * This); + + DECLSPEC_XFGVIRT(ID3D12Resource, WriteToSubresource) + HRESULT ( STDMETHODCALLTYPE *WriteToSubresource )( + ID3D12Resource * This, + UINT DstSubresource, + _In_opt_ const D3D12_BOX *pDstBox, + _In_ const void *pSrcData, + UINT SrcRowPitch, + UINT SrcDepthPitch); + + DECLSPEC_XFGVIRT(ID3D12Resource, ReadFromSubresource) + HRESULT ( STDMETHODCALLTYPE *ReadFromSubresource )( + ID3D12Resource * This, + _Out_ void *pDstData, + UINT DstRowPitch, + UINT DstDepthPitch, + UINT SrcSubresource, + _In_opt_ const D3D12_BOX *pSrcBox); + + DECLSPEC_XFGVIRT(ID3D12Resource, GetHeapProperties) + HRESULT ( STDMETHODCALLTYPE *GetHeapProperties )( + ID3D12Resource * This, + _Out_opt_ D3D12_HEAP_PROPERTIES *pHeapProperties, + _Out_opt_ D3D12_HEAP_FLAGS *pHeapFlags); + + END_INTERFACE + } ID3D12ResourceVtbl; + + interface ID3D12Resource + { + CONST_VTBL struct ID3D12ResourceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Resource_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Resource_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Resource_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Resource_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Resource_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Resource_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Resource_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Resource_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + + +#define ID3D12Resource_Map(This,Subresource,pReadRange,ppData) \ + ( (This)->lpVtbl -> Map(This,Subresource,pReadRange,ppData) ) + +#define ID3D12Resource_Unmap(This,Subresource,pWrittenRange) \ + ( (This)->lpVtbl -> Unmap(This,Subresource,pWrittenRange) ) +#if !defined(_WIN32) + +#define ID3D12Resource_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) +#else +#define ID3D12Resource_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) +#endif + +#define ID3D12Resource_GetGPUVirtualAddress(This) \ + ( (This)->lpVtbl -> GetGPUVirtualAddress(This) ) + +#define ID3D12Resource_WriteToSubresource(This,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) \ + ( (This)->lpVtbl -> WriteToSubresource(This,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) ) + +#define ID3D12Resource_ReadFromSubresource(This,pDstData,DstRowPitch,DstDepthPitch,SrcSubresource,pSrcBox) \ + ( (This)->lpVtbl -> ReadFromSubresource(This,pDstData,DstRowPitch,DstDepthPitch,SrcSubresource,pSrcBox) ) + +#define ID3D12Resource_GetHeapProperties(This,pHeapProperties,pHeapFlags) \ + ( (This)->lpVtbl -> GetHeapProperties(This,pHeapProperties,pHeapFlags) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Resource_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12CommandAllocator_INTERFACE_DEFINED__ +#define __ID3D12CommandAllocator_INTERFACE_DEFINED__ + +/* interface ID3D12CommandAllocator */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12CommandAllocator; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("6102dee4-af59-4b09-b999-b44d73f09b24") + ID3D12CommandAllocator : public ID3D12Pageable + { + public: + virtual HRESULT STDMETHODCALLTYPE Reset( void) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12CommandAllocatorVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12CommandAllocator * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12CommandAllocator * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12CommandAllocator * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12CommandAllocator * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12CommandAllocator * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12CommandAllocator * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12CommandAllocator * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12CommandAllocator * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandAllocator, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12CommandAllocator * This); + + END_INTERFACE + } ID3D12CommandAllocatorVtbl; + + interface ID3D12CommandAllocator + { + CONST_VTBL struct ID3D12CommandAllocatorVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12CommandAllocator_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12CommandAllocator_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12CommandAllocator_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12CommandAllocator_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12CommandAllocator_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12CommandAllocator_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12CommandAllocator_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12CommandAllocator_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + + +#define ID3D12CommandAllocator_Reset(This) \ + ( (This)->lpVtbl -> Reset(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12CommandAllocator_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Fence_INTERFACE_DEFINED__ +#define __ID3D12Fence_INTERFACE_DEFINED__ + +/* interface ID3D12Fence */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Fence; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("0a753dcf-c4d8-4b91-adf6-be5a60d95a76") + ID3D12Fence : public ID3D12Pageable + { + public: + virtual UINT64 STDMETHODCALLTYPE GetCompletedValue( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetEventOnCompletion( + UINT64 Value, + HANDLE hEvent) = 0; + + virtual HRESULT STDMETHODCALLTYPE Signal( + UINT64 Value) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12FenceVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Fence * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Fence * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Fence * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Fence * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Fence * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Fence * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Fence * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12Fence * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12Fence, GetCompletedValue) + UINT64 ( STDMETHODCALLTYPE *GetCompletedValue )( + ID3D12Fence * This); + + DECLSPEC_XFGVIRT(ID3D12Fence, SetEventOnCompletion) + HRESULT ( STDMETHODCALLTYPE *SetEventOnCompletion )( + ID3D12Fence * This, + UINT64 Value, + HANDLE hEvent); + + DECLSPEC_XFGVIRT(ID3D12Fence, Signal) + HRESULT ( STDMETHODCALLTYPE *Signal )( + ID3D12Fence * This, + UINT64 Value); + + END_INTERFACE + } ID3D12FenceVtbl; + + interface ID3D12Fence + { + CONST_VTBL struct ID3D12FenceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Fence_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Fence_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Fence_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Fence_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Fence_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Fence_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Fence_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Fence_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + + +#define ID3D12Fence_GetCompletedValue(This) \ + ( (This)->lpVtbl -> GetCompletedValue(This) ) + +#define ID3D12Fence_SetEventOnCompletion(This,Value,hEvent) \ + ( (This)->lpVtbl -> SetEventOnCompletion(This,Value,hEvent) ) + +#define ID3D12Fence_Signal(This,Value) \ + ( (This)->lpVtbl -> Signal(This,Value) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Fence_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Fence1_INTERFACE_DEFINED__ +#define __ID3D12Fence1_INTERFACE_DEFINED__ + +/* interface ID3D12Fence1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Fence1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("433685fe-e22b-4ca0-a8db-b5b4f4dd0e4a") + ID3D12Fence1 : public ID3D12Fence + { + public: + virtual D3D12_FENCE_FLAGS STDMETHODCALLTYPE GetCreationFlags( void) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Fence1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Fence1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Fence1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Fence1 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Fence1 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Fence1 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Fence1 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Fence1 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12Fence1 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12Fence, GetCompletedValue) + UINT64 ( STDMETHODCALLTYPE *GetCompletedValue )( + ID3D12Fence1 * This); + + DECLSPEC_XFGVIRT(ID3D12Fence, SetEventOnCompletion) + HRESULT ( STDMETHODCALLTYPE *SetEventOnCompletion )( + ID3D12Fence1 * This, + UINT64 Value, + HANDLE hEvent); + + DECLSPEC_XFGVIRT(ID3D12Fence, Signal) + HRESULT ( STDMETHODCALLTYPE *Signal )( + ID3D12Fence1 * This, + UINT64 Value); + + DECLSPEC_XFGVIRT(ID3D12Fence1, GetCreationFlags) + D3D12_FENCE_FLAGS ( STDMETHODCALLTYPE *GetCreationFlags )( + ID3D12Fence1 * This); + + END_INTERFACE + } ID3D12Fence1Vtbl; + + interface ID3D12Fence1 + { + CONST_VTBL struct ID3D12Fence1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Fence1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Fence1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Fence1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Fence1_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Fence1_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Fence1_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Fence1_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Fence1_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + + +#define ID3D12Fence1_GetCompletedValue(This) \ + ( (This)->lpVtbl -> GetCompletedValue(This) ) + +#define ID3D12Fence1_SetEventOnCompletion(This,Value,hEvent) \ + ( (This)->lpVtbl -> SetEventOnCompletion(This,Value,hEvent) ) + +#define ID3D12Fence1_Signal(This,Value) \ + ( (This)->lpVtbl -> Signal(This,Value) ) + + +#define ID3D12Fence1_GetCreationFlags(This) \ + ( (This)->lpVtbl -> GetCreationFlags(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Fence1_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12PipelineState_INTERFACE_DEFINED__ +#define __ID3D12PipelineState_INTERFACE_DEFINED__ + +/* interface ID3D12PipelineState */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12PipelineState; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("765a30f3-f624-4c6f-a828-ace948622445") + ID3D12PipelineState : public ID3D12Pageable + { + public: + virtual HRESULT STDMETHODCALLTYPE GetCachedBlob( + _COM_Outptr_ ID3DBlob **ppBlob) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12PipelineStateVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12PipelineState * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12PipelineState * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12PipelineState * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12PipelineState * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12PipelineState * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12PipelineState * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12PipelineState * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12PipelineState * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12PipelineState, GetCachedBlob) + HRESULT ( STDMETHODCALLTYPE *GetCachedBlob )( + ID3D12PipelineState * This, + _COM_Outptr_ ID3DBlob **ppBlob); + + END_INTERFACE + } ID3D12PipelineStateVtbl; + + interface ID3D12PipelineState + { + CONST_VTBL struct ID3D12PipelineStateVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12PipelineState_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12PipelineState_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12PipelineState_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12PipelineState_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12PipelineState_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12PipelineState_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12PipelineState_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12PipelineState_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + + +#define ID3D12PipelineState_GetCachedBlob(This,ppBlob) \ + ( (This)->lpVtbl -> GetCachedBlob(This,ppBlob) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12PipelineState_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12DescriptorHeap_INTERFACE_DEFINED__ +#define __ID3D12DescriptorHeap_INTERFACE_DEFINED__ + +/* interface ID3D12DescriptorHeap */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DescriptorHeap; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("8efb471d-616c-4f49-90f7-127bb763fa51") + ID3D12DescriptorHeap : public ID3D12Pageable + { + public: +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_DESCRIPTOR_HEAP_DESC STDMETHODCALLTYPE GetDesc( void) = 0; +#else + virtual D3D12_DESCRIPTOR_HEAP_DESC *STDMETHODCALLTYPE GetDesc( + D3D12_DESCRIPTOR_HEAP_DESC * RetVal) = 0; +#endif + +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_CPU_DESCRIPTOR_HANDLE STDMETHODCALLTYPE GetCPUDescriptorHandleForHeapStart( void) = 0; +#else + virtual D3D12_CPU_DESCRIPTOR_HANDLE *STDMETHODCALLTYPE GetCPUDescriptorHandleForHeapStart( + D3D12_CPU_DESCRIPTOR_HANDLE * RetVal) = 0; +#endif + +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_GPU_DESCRIPTOR_HANDLE STDMETHODCALLTYPE GetGPUDescriptorHandleForHeapStart( void) = 0; +#else + virtual D3D12_GPU_DESCRIPTOR_HANDLE *STDMETHODCALLTYPE GetGPUDescriptorHandleForHeapStart( + D3D12_GPU_DESCRIPTOR_HANDLE * RetVal) = 0; +#endif + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DescriptorHeapVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DescriptorHeap * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DescriptorHeap * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DescriptorHeap * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12DescriptorHeap * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12DescriptorHeap * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12DescriptorHeap * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12DescriptorHeap * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12DescriptorHeap * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12DescriptorHeap, GetDesc) +#if !defined(_WIN32) + D3D12_DESCRIPTOR_HEAP_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12DescriptorHeap * This); + +#else + D3D12_DESCRIPTOR_HEAP_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12DescriptorHeap * This, + D3D12_DESCRIPTOR_HEAP_DESC * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12DescriptorHeap, GetCPUDescriptorHandleForHeapStart) +#if !defined(_WIN32) + D3D12_CPU_DESCRIPTOR_HANDLE ( STDMETHODCALLTYPE *GetCPUDescriptorHandleForHeapStart )( + ID3D12DescriptorHeap * This); + +#else + D3D12_CPU_DESCRIPTOR_HANDLE *( STDMETHODCALLTYPE *GetCPUDescriptorHandleForHeapStart )( + ID3D12DescriptorHeap * This, + D3D12_CPU_DESCRIPTOR_HANDLE * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12DescriptorHeap, GetGPUDescriptorHandleForHeapStart) +#if !defined(_WIN32) + D3D12_GPU_DESCRIPTOR_HANDLE ( STDMETHODCALLTYPE *GetGPUDescriptorHandleForHeapStart )( + ID3D12DescriptorHeap * This); + +#else + D3D12_GPU_DESCRIPTOR_HANDLE *( STDMETHODCALLTYPE *GetGPUDescriptorHandleForHeapStart )( + ID3D12DescriptorHeap * This, + D3D12_GPU_DESCRIPTOR_HANDLE * RetVal); + +#endif + + END_INTERFACE + } ID3D12DescriptorHeapVtbl; + + interface ID3D12DescriptorHeap + { + CONST_VTBL struct ID3D12DescriptorHeapVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DescriptorHeap_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DescriptorHeap_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DescriptorHeap_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DescriptorHeap_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12DescriptorHeap_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12DescriptorHeap_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12DescriptorHeap_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12DescriptorHeap_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#if !defined(_WIN32) + +#define ID3D12DescriptorHeap_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) +#else +#define ID3D12DescriptorHeap_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) +#endif +#if !defined(_WIN32) + +#define ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart(This) \ + ( (This)->lpVtbl -> GetCPUDescriptorHandleForHeapStart(This) ) +#else +#define ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart(This,RetVal) \ + ( (This)->lpVtbl -> GetCPUDescriptorHandleForHeapStart(This,RetVal) ) +#endif +#if !defined(_WIN32) + +#define ID3D12DescriptorHeap_GetGPUDescriptorHandleForHeapStart(This) \ + ( (This)->lpVtbl -> GetGPUDescriptorHandleForHeapStart(This) ) +#else +#define ID3D12DescriptorHeap_GetGPUDescriptorHandleForHeapStart(This,RetVal) \ + ( (This)->lpVtbl -> GetGPUDescriptorHandleForHeapStart(This,RetVal) ) +#endif + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DescriptorHeap_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12QueryHeap_INTERFACE_DEFINED__ +#define __ID3D12QueryHeap_INTERFACE_DEFINED__ + +/* interface ID3D12QueryHeap */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12QueryHeap; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("0d9658ae-ed45-469e-a61d-970ec583cab4") + ID3D12QueryHeap : public ID3D12Pageable + { + public: + }; + + +#else /* C style interface */ + + typedef struct ID3D12QueryHeapVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12QueryHeap * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12QueryHeap * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12QueryHeap * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12QueryHeap * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12QueryHeap * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12QueryHeap * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12QueryHeap * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12QueryHeap * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + END_INTERFACE + } ID3D12QueryHeapVtbl; + + interface ID3D12QueryHeap + { + CONST_VTBL struct ID3D12QueryHeapVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12QueryHeap_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12QueryHeap_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12QueryHeap_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12QueryHeap_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12QueryHeap_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12QueryHeap_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12QueryHeap_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12QueryHeap_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12QueryHeap_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12CommandSignature_INTERFACE_DEFINED__ +#define __ID3D12CommandSignature_INTERFACE_DEFINED__ + +/* interface ID3D12CommandSignature */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12CommandSignature; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("c36a797c-ec80-4f0a-8985-a7b2475082d1") + ID3D12CommandSignature : public ID3D12Pageable + { + public: + }; + + +#else /* C style interface */ + + typedef struct ID3D12CommandSignatureVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12CommandSignature * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12CommandSignature * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12CommandSignature * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12CommandSignature * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12CommandSignature * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12CommandSignature * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12CommandSignature * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12CommandSignature * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + END_INTERFACE + } ID3D12CommandSignatureVtbl; + + interface ID3D12CommandSignature + { + CONST_VTBL struct ID3D12CommandSignatureVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12CommandSignature_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12CommandSignature_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12CommandSignature_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12CommandSignature_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12CommandSignature_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12CommandSignature_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12CommandSignature_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12CommandSignature_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12CommandSignature_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12CommandList_INTERFACE_DEFINED__ +#define __ID3D12CommandList_INTERFACE_DEFINED__ + +/* interface ID3D12CommandList */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12CommandList; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("7116d91c-e7e4-47ce-b8c6-ec8168f437e5") + ID3D12CommandList : public ID3D12DeviceChild + { + public: + virtual D3D12_COMMAND_LIST_TYPE STDMETHODCALLTYPE GetType( void) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12CommandListVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12CommandList * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12CommandList * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12CommandList * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12CommandList * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12CommandList * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12CommandList * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12CommandList * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12CommandList * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12CommandList * This); + + END_INTERFACE + } ID3D12CommandListVtbl; + + interface ID3D12CommandList + { + CONST_VTBL struct ID3D12CommandListVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12CommandList_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12CommandList_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12CommandList_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12CommandList_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12CommandList_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12CommandList_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12CommandList_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12CommandList_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12CommandList_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12CommandList_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12GraphicsCommandList_INTERFACE_DEFINED__ +#define __ID3D12GraphicsCommandList_INTERFACE_DEFINED__ + +/* interface ID3D12GraphicsCommandList */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12GraphicsCommandList; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("5b160d0f-ac1b-4185-8ba8-b3ae42a5a455") + ID3D12GraphicsCommandList : public ID3D12CommandList + { + public: + virtual HRESULT STDMETHODCALLTYPE Close( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE Reset( + _In_ ID3D12CommandAllocator *pAllocator, + _In_opt_ ID3D12PipelineState *pInitialState) = 0; + + virtual void STDMETHODCALLTYPE ClearState( + _In_opt_ ID3D12PipelineState *pPipelineState) = 0; + + virtual void STDMETHODCALLTYPE DrawInstanced( + _In_ UINT VertexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartVertexLocation, + _In_ UINT StartInstanceLocation) = 0; + + virtual void STDMETHODCALLTYPE DrawIndexedInstanced( + _In_ UINT IndexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartIndexLocation, + _In_ INT BaseVertexLocation, + _In_ UINT StartInstanceLocation) = 0; + + virtual void STDMETHODCALLTYPE Dispatch( + _In_ UINT ThreadGroupCountX, + _In_ UINT ThreadGroupCountY, + _In_ UINT ThreadGroupCountZ) = 0; + + virtual void STDMETHODCALLTYPE CopyBufferRegion( + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT64 NumBytes) = 0; + + virtual void STDMETHODCALLTYPE CopyTextureRegion( + _In_ const D3D12_TEXTURE_COPY_LOCATION *pDst, + UINT DstX, + UINT DstY, + UINT DstZ, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pSrc, + _In_opt_ const D3D12_BOX *pSrcBox) = 0; + + virtual void STDMETHODCALLTYPE CopyResource( + _In_ ID3D12Resource *pDstResource, + _In_ ID3D12Resource *pSrcResource) = 0; + + virtual void STDMETHODCALLTYPE CopyTiles( + _In_ ID3D12Resource *pTiledResource, + _In_ const D3D12_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate, + _In_ const D3D12_TILE_REGION_SIZE *pTileRegionSize, + _In_ ID3D12Resource *pBuffer, + UINT64 BufferStartOffsetInBytes, + D3D12_TILE_COPY_FLAGS Flags) = 0; + + virtual void STDMETHODCALLTYPE ResolveSubresource( + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_ DXGI_FORMAT Format) = 0; + + virtual void STDMETHODCALLTYPE IASetPrimitiveTopology( + _In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology) = 0; + + virtual void STDMETHODCALLTYPE RSSetViewports( + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, + _In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports) = 0; + + virtual void STDMETHODCALLTYPE RSSetScissorRects( + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, + _In_reads_( NumRects) const D3D12_RECT *pRects) = 0; + + virtual void STDMETHODCALLTYPE OMSetBlendFactor( + _In_reads_opt_(4) const FLOAT BlendFactor[ 4 ]) = 0; + + virtual void STDMETHODCALLTYPE OMSetStencilRef( + _In_ UINT StencilRef) = 0; + + virtual void STDMETHODCALLTYPE SetPipelineState( + _In_ ID3D12PipelineState *pPipelineState) = 0; + + virtual void STDMETHODCALLTYPE ResourceBarrier( + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers) = 0; + + virtual void STDMETHODCALLTYPE ExecuteBundle( + _In_ ID3D12GraphicsCommandList *pCommandList) = 0; + + virtual void STDMETHODCALLTYPE SetDescriptorHeaps( + _In_ UINT NumDescriptorHeaps, + _In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap *const *ppDescriptorHeaps) = 0; + + virtual void STDMETHODCALLTYPE SetComputeRootSignature( + _In_opt_ ID3D12RootSignature *pRootSignature) = 0; + + virtual void STDMETHODCALLTYPE SetGraphicsRootSignature( + _In_opt_ ID3D12RootSignature *pRootSignature) = 0; + + virtual void STDMETHODCALLTYPE SetComputeRootDescriptorTable( + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor) = 0; + + virtual void STDMETHODCALLTYPE SetGraphicsRootDescriptorTable( + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor) = 0; + + virtual void STDMETHODCALLTYPE SetComputeRoot32BitConstant( + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues) = 0; + + virtual void STDMETHODCALLTYPE SetGraphicsRoot32BitConstant( + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues) = 0; + + virtual void STDMETHODCALLTYPE SetComputeRoot32BitConstants( + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues) = 0; + + virtual void STDMETHODCALLTYPE SetGraphicsRoot32BitConstants( + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues) = 0; + + virtual void STDMETHODCALLTYPE SetComputeRootConstantBufferView( + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation) = 0; + + virtual void STDMETHODCALLTYPE SetGraphicsRootConstantBufferView( + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation) = 0; + + virtual void STDMETHODCALLTYPE SetComputeRootShaderResourceView( + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation) = 0; + + virtual void STDMETHODCALLTYPE SetGraphicsRootShaderResourceView( + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation) = 0; + + virtual void STDMETHODCALLTYPE SetComputeRootUnorderedAccessView( + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation) = 0; + + virtual void STDMETHODCALLTYPE SetGraphicsRootUnorderedAccessView( + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation) = 0; + + virtual void STDMETHODCALLTYPE IASetIndexBuffer( + _In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView) = 0; + + virtual void STDMETHODCALLTYPE IASetVertexBuffers( + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews) = 0; + + virtual void STDMETHODCALLTYPE SOSetTargets( + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews) = 0; + + virtual void STDMETHODCALLTYPE OMSetRenderTargets( + _In_ UINT NumRenderTargetDescriptors, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pRenderTargetDescriptors, + _In_ BOOL RTsSingleHandleToDescriptorRange, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pDepthStencilDescriptor) = 0; + + virtual void STDMETHODCALLTYPE ClearDepthStencilView( + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView, + _In_ D3D12_CLEAR_FLAGS ClearFlags, + _In_ FLOAT Depth, + _In_ UINT8 Stencil, + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects) = 0; + + virtual void STDMETHODCALLTYPE ClearRenderTargetView( + _In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView, + _In_ const FLOAT ColorRGBA[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects) = 0; + + virtual void STDMETHODCALLTYPE ClearUnorderedAccessViewUint( + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const UINT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects) = 0; + + virtual void STDMETHODCALLTYPE ClearUnorderedAccessViewFloat( + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const FLOAT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects) = 0; + + virtual void STDMETHODCALLTYPE DiscardResource( + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion) = 0; + + virtual void STDMETHODCALLTYPE BeginQuery( + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index) = 0; + + virtual void STDMETHODCALLTYPE EndQuery( + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index) = 0; + + virtual void STDMETHODCALLTYPE ResolveQueryData( + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset) = 0; + + virtual void STDMETHODCALLTYPE SetPredication( + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation) = 0; + + virtual void STDMETHODCALLTYPE SetMarker( + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size) = 0; + + virtual void STDMETHODCALLTYPE BeginEvent( + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size) = 0; + + virtual void STDMETHODCALLTYPE EndEvent( void) = 0; + + virtual void STDMETHODCALLTYPE ExecuteIndirect( + _In_ ID3D12CommandSignature *pCommandSignature, + _In_ UINT MaxCommandCount, + _In_ ID3D12Resource *pArgumentBuffer, + _In_ UINT64 ArgumentBufferOffset, + _In_opt_ ID3D12Resource *pCountBuffer, + _In_ UINT64 CountBufferOffset) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12GraphicsCommandListVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12GraphicsCommandList * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12GraphicsCommandList * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12GraphicsCommandList * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12GraphicsCommandList * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12GraphicsCommandList * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12GraphicsCommandList * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12GraphicsCommandList * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12GraphicsCommandList * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12GraphicsCommandList * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12GraphicsCommandList * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12GraphicsCommandList * This, + _In_ ID3D12CommandAllocator *pAllocator, + _In_opt_ ID3D12PipelineState *pInitialState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12GraphicsCommandList * This, + _In_opt_ ID3D12PipelineState *pPipelineState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawInstanced) + void ( STDMETHODCALLTYPE *DrawInstanced )( + ID3D12GraphicsCommandList * This, + _In_ UINT VertexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartVertexLocation, + _In_ UINT StartInstanceLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawIndexedInstanced) + void ( STDMETHODCALLTYPE *DrawIndexedInstanced )( + ID3D12GraphicsCommandList * This, + _In_ UINT IndexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartIndexLocation, + _In_ INT BaseVertexLocation, + _In_ UINT StartInstanceLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Dispatch) + void ( STDMETHODCALLTYPE *Dispatch )( + ID3D12GraphicsCommandList * This, + _In_ UINT ThreadGroupCountX, + _In_ UINT ThreadGroupCountY, + _In_ UINT ThreadGroupCountZ); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyBufferRegion) + void ( STDMETHODCALLTYPE *CopyBufferRegion )( + ID3D12GraphicsCommandList * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT64 NumBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTextureRegion) + void ( STDMETHODCALLTYPE *CopyTextureRegion )( + ID3D12GraphicsCommandList * This, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pDst, + UINT DstX, + UINT DstY, + UINT DstZ, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pSrc, + _In_opt_ const D3D12_BOX *pSrcBox); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyResource) + void ( STDMETHODCALLTYPE *CopyResource )( + ID3D12GraphicsCommandList * This, + _In_ ID3D12Resource *pDstResource, + _In_ ID3D12Resource *pSrcResource); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTiles) + void ( STDMETHODCALLTYPE *CopyTiles )( + ID3D12GraphicsCommandList * This, + _In_ ID3D12Resource *pTiledResource, + _In_ const D3D12_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate, + _In_ const D3D12_TILE_REGION_SIZE *pTileRegionSize, + _In_ ID3D12Resource *pBuffer, + UINT64 BufferStartOffsetInBytes, + D3D12_TILE_COPY_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveSubresource) + void ( STDMETHODCALLTYPE *ResolveSubresource )( + ID3D12GraphicsCommandList * This, + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_ DXGI_FORMAT Format); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetPrimitiveTopology) + void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )( + ID3D12GraphicsCommandList * This, + _In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetViewports) + void ( STDMETHODCALLTYPE *RSSetViewports )( + ID3D12GraphicsCommandList * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, + _In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetScissorRects) + void ( STDMETHODCALLTYPE *RSSetScissorRects )( + ID3D12GraphicsCommandList * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, + _In_reads_( NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetBlendFactor) + void ( STDMETHODCALLTYPE *OMSetBlendFactor )( + ID3D12GraphicsCommandList * This, + _In_reads_opt_(4) const FLOAT BlendFactor[ 4 ]); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetStencilRef) + void ( STDMETHODCALLTYPE *OMSetStencilRef )( + ID3D12GraphicsCommandList * This, + _In_ UINT StencilRef); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPipelineState) + void ( STDMETHODCALLTYPE *SetPipelineState )( + ID3D12GraphicsCommandList * This, + _In_ ID3D12PipelineState *pPipelineState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12GraphicsCommandList * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteBundle) + void ( STDMETHODCALLTYPE *ExecuteBundle )( + ID3D12GraphicsCommandList * This, + _In_ ID3D12GraphicsCommandList *pCommandList); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetDescriptorHeaps) + void ( STDMETHODCALLTYPE *SetDescriptorHeaps )( + ID3D12GraphicsCommandList * This, + _In_ UINT NumDescriptorHeaps, + _In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap *const *ppDescriptorHeaps); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootSignature) + void ( STDMETHODCALLTYPE *SetComputeRootSignature )( + ID3D12GraphicsCommandList * This, + _In_opt_ ID3D12RootSignature *pRootSignature); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootSignature) + void ( STDMETHODCALLTYPE *SetGraphicsRootSignature )( + ID3D12GraphicsCommandList * This, + _In_opt_ ID3D12RootSignature *pRootSignature); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetComputeRootDescriptorTable )( + ID3D12GraphicsCommandList * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetGraphicsRootDescriptorTable )( + ID3D12GraphicsCommandList * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstant )( + ID3D12GraphicsCommandList * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstant )( + ID3D12GraphicsCommandList * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstants )( + ID3D12GraphicsCommandList * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstants )( + ID3D12GraphicsCommandList * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetComputeRootConstantBufferView )( + ID3D12GraphicsCommandList * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetGraphicsRootConstantBufferView )( + ID3D12GraphicsCommandList * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetComputeRootShaderResourceView )( + ID3D12GraphicsCommandList * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetGraphicsRootShaderResourceView )( + ID3D12GraphicsCommandList * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetComputeRootUnorderedAccessView )( + ID3D12GraphicsCommandList * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetGraphicsRootUnorderedAccessView )( + ID3D12GraphicsCommandList * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetIndexBuffer) + void ( STDMETHODCALLTYPE *IASetIndexBuffer )( + ID3D12GraphicsCommandList * This, + _In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetVertexBuffers) + void ( STDMETHODCALLTYPE *IASetVertexBuffers )( + ID3D12GraphicsCommandList * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SOSetTargets) + void ( STDMETHODCALLTYPE *SOSetTargets )( + ID3D12GraphicsCommandList * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetRenderTargets) + void ( STDMETHODCALLTYPE *OMSetRenderTargets )( + ID3D12GraphicsCommandList * This, + _In_ UINT NumRenderTargetDescriptors, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pRenderTargetDescriptors, + _In_ BOOL RTsSingleHandleToDescriptorRange, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pDepthStencilDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearDepthStencilView) + void ( STDMETHODCALLTYPE *ClearDepthStencilView )( + ID3D12GraphicsCommandList * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView, + _In_ D3D12_CLEAR_FLAGS ClearFlags, + _In_ FLOAT Depth, + _In_ UINT8 Stencil, + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearRenderTargetView) + void ( STDMETHODCALLTYPE *ClearRenderTargetView )( + ID3D12GraphicsCommandList * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView, + _In_ const FLOAT ColorRGBA[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewUint) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )( + ID3D12GraphicsCommandList * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const UINT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewFloat) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )( + ID3D12GraphicsCommandList * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const FLOAT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12GraphicsCommandList * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12GraphicsCommandList * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12GraphicsCommandList * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12GraphicsCommandList * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12GraphicsCommandList * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12GraphicsCommandList * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12GraphicsCommandList * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12GraphicsCommandList * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteIndirect) + void ( STDMETHODCALLTYPE *ExecuteIndirect )( + ID3D12GraphicsCommandList * This, + _In_ ID3D12CommandSignature *pCommandSignature, + _In_ UINT MaxCommandCount, + _In_ ID3D12Resource *pArgumentBuffer, + _In_ UINT64 ArgumentBufferOffset, + _In_opt_ ID3D12Resource *pCountBuffer, + _In_ UINT64 CountBufferOffset); + + END_INTERFACE + } ID3D12GraphicsCommandListVtbl; + + interface ID3D12GraphicsCommandList + { + CONST_VTBL struct ID3D12GraphicsCommandListVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12GraphicsCommandList_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12GraphicsCommandList_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12GraphicsCommandList_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12GraphicsCommandList_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12GraphicsCommandList_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12GraphicsCommandList_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12GraphicsCommandList_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12GraphicsCommandList_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12GraphicsCommandList_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12GraphicsCommandList_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12GraphicsCommandList_Reset(This,pAllocator,pInitialState) \ + ( (This)->lpVtbl -> Reset(This,pAllocator,pInitialState) ) + +#define ID3D12GraphicsCommandList_ClearState(This,pPipelineState) \ + ( (This)->lpVtbl -> ClearState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) ) + +#define ID3D12GraphicsCommandList_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) ) + +#define ID3D12GraphicsCommandList_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ + ( (This)->lpVtbl -> Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) + +#define ID3D12GraphicsCommandList_CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) \ + ( (This)->lpVtbl -> CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) ) + +#define ID3D12GraphicsCommandList_CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) \ + ( (This)->lpVtbl -> CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) ) + +#define ID3D12GraphicsCommandList_CopyResource(This,pDstResource,pSrcResource) \ + ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) ) + +#define ID3D12GraphicsCommandList_CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) \ + ( (This)->lpVtbl -> CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) ) + +#define ID3D12GraphicsCommandList_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \ + ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) ) + +#define ID3D12GraphicsCommandList_IASetPrimitiveTopology(This,PrimitiveTopology) \ + ( (This)->lpVtbl -> IASetPrimitiveTopology(This,PrimitiveTopology) ) + +#define ID3D12GraphicsCommandList_RSSetViewports(This,NumViewports,pViewports) \ + ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) ) + +#define ID3D12GraphicsCommandList_RSSetScissorRects(This,NumRects,pRects) \ + ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList_OMSetBlendFactor(This,BlendFactor) \ + ( (This)->lpVtbl -> OMSetBlendFactor(This,BlendFactor) ) + +#define ID3D12GraphicsCommandList_OMSetStencilRef(This,StencilRef) \ + ( (This)->lpVtbl -> OMSetStencilRef(This,StencilRef) ) + +#define ID3D12GraphicsCommandList_SetPipelineState(This,pPipelineState) \ + ( (This)->lpVtbl -> SetPipelineState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12GraphicsCommandList_ExecuteBundle(This,pCommandList) \ + ( (This)->lpVtbl -> ExecuteBundle(This,pCommandList) ) + +#define ID3D12GraphicsCommandList_SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) \ + ( (This)->lpVtbl -> SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) ) + +#define ID3D12GraphicsCommandList_SetComputeRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetComputeRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList_SetGraphicsRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetGraphicsRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList_SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList_SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList_SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList_SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList_SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList_SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList_SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList_SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList_SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList_SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList_SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList_SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList_IASetIndexBuffer(This,pView) \ + ( (This)->lpVtbl -> IASetIndexBuffer(This,pView) ) + +#define ID3D12GraphicsCommandList_IASetVertexBuffers(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumViews,pViews) ) + +#define ID3D12GraphicsCommandList_SOSetTargets(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> SOSetTargets(This,StartSlot,NumViews,pViews) ) + +#define ID3D12GraphicsCommandList_OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) \ + ( (This)->lpVtbl -> OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) ) + +#define ID3D12GraphicsCommandList_ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList_ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList_ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList_ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12GraphicsCommandList_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12GraphicsCommandList_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12GraphicsCommandList_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12GraphicsCommandList_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12GraphicsCommandList_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12GraphicsCommandList_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12GraphicsCommandList_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12GraphicsCommandList_ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) \ + ( (This)->lpVtbl -> ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12GraphicsCommandList_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12GraphicsCommandList1_INTERFACE_DEFINED__ +#define __ID3D12GraphicsCommandList1_INTERFACE_DEFINED__ + +/* interface ID3D12GraphicsCommandList1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12GraphicsCommandList1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("553103fb-1fe7-4557-bb38-946d7d0e7ca7") + ID3D12GraphicsCommandList1 : public ID3D12GraphicsCommandList + { + public: + virtual void STDMETHODCALLTYPE AtomicCopyBufferUINT( + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges) = 0; + + virtual void STDMETHODCALLTYPE AtomicCopyBufferUINT64( + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges) = 0; + + virtual void STDMETHODCALLTYPE OMSetDepthBounds( + _In_ FLOAT Min, + _In_ FLOAT Max) = 0; + + virtual void STDMETHODCALLTYPE SetSamplePositions( + _In_ UINT NumSamplesPerPixel, + _In_ UINT NumPixels, + _In_reads_(NumSamplesPerPixel*NumPixels) D3D12_SAMPLE_POSITION *pSamplePositions) = 0; + + virtual void STDMETHODCALLTYPE ResolveSubresourceRegion( + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ UINT DstX, + _In_ UINT DstY, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_opt_ D3D12_RECT *pSrcRect, + _In_ DXGI_FORMAT Format, + _In_ D3D12_RESOLVE_MODE ResolveMode) = 0; + + virtual void STDMETHODCALLTYPE SetViewInstanceMask( + _In_ UINT Mask) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12GraphicsCommandList1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12GraphicsCommandList1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12GraphicsCommandList1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12GraphicsCommandList1 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12GraphicsCommandList1 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12GraphicsCommandList1 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12GraphicsCommandList1 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12GraphicsCommandList1 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12GraphicsCommandList1 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12GraphicsCommandList1 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12GraphicsCommandList1 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12GraphicsCommandList1 * This, + _In_ ID3D12CommandAllocator *pAllocator, + _In_opt_ ID3D12PipelineState *pInitialState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12GraphicsCommandList1 * This, + _In_opt_ ID3D12PipelineState *pPipelineState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawInstanced) + void ( STDMETHODCALLTYPE *DrawInstanced )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT VertexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartVertexLocation, + _In_ UINT StartInstanceLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawIndexedInstanced) + void ( STDMETHODCALLTYPE *DrawIndexedInstanced )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT IndexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartIndexLocation, + _In_ INT BaseVertexLocation, + _In_ UINT StartInstanceLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Dispatch) + void ( STDMETHODCALLTYPE *Dispatch )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT ThreadGroupCountX, + _In_ UINT ThreadGroupCountY, + _In_ UINT ThreadGroupCountZ); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyBufferRegion) + void ( STDMETHODCALLTYPE *CopyBufferRegion )( + ID3D12GraphicsCommandList1 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT64 NumBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTextureRegion) + void ( STDMETHODCALLTYPE *CopyTextureRegion )( + ID3D12GraphicsCommandList1 * This, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pDst, + UINT DstX, + UINT DstY, + UINT DstZ, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pSrc, + _In_opt_ const D3D12_BOX *pSrcBox); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyResource) + void ( STDMETHODCALLTYPE *CopyResource )( + ID3D12GraphicsCommandList1 * This, + _In_ ID3D12Resource *pDstResource, + _In_ ID3D12Resource *pSrcResource); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTiles) + void ( STDMETHODCALLTYPE *CopyTiles )( + ID3D12GraphicsCommandList1 * This, + _In_ ID3D12Resource *pTiledResource, + _In_ const D3D12_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate, + _In_ const D3D12_TILE_REGION_SIZE *pTileRegionSize, + _In_ ID3D12Resource *pBuffer, + UINT64 BufferStartOffsetInBytes, + D3D12_TILE_COPY_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveSubresource) + void ( STDMETHODCALLTYPE *ResolveSubresource )( + ID3D12GraphicsCommandList1 * This, + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_ DXGI_FORMAT Format); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetPrimitiveTopology) + void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )( + ID3D12GraphicsCommandList1 * This, + _In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetViewports) + void ( STDMETHODCALLTYPE *RSSetViewports )( + ID3D12GraphicsCommandList1 * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, + _In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetScissorRects) + void ( STDMETHODCALLTYPE *RSSetScissorRects )( + ID3D12GraphicsCommandList1 * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, + _In_reads_( NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetBlendFactor) + void ( STDMETHODCALLTYPE *OMSetBlendFactor )( + ID3D12GraphicsCommandList1 * This, + _In_reads_opt_(4) const FLOAT BlendFactor[ 4 ]); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetStencilRef) + void ( STDMETHODCALLTYPE *OMSetStencilRef )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT StencilRef); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPipelineState) + void ( STDMETHODCALLTYPE *SetPipelineState )( + ID3D12GraphicsCommandList1 * This, + _In_ ID3D12PipelineState *pPipelineState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteBundle) + void ( STDMETHODCALLTYPE *ExecuteBundle )( + ID3D12GraphicsCommandList1 * This, + _In_ ID3D12GraphicsCommandList *pCommandList); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetDescriptorHeaps) + void ( STDMETHODCALLTYPE *SetDescriptorHeaps )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT NumDescriptorHeaps, + _In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap *const *ppDescriptorHeaps); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootSignature) + void ( STDMETHODCALLTYPE *SetComputeRootSignature )( + ID3D12GraphicsCommandList1 * This, + _In_opt_ ID3D12RootSignature *pRootSignature); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootSignature) + void ( STDMETHODCALLTYPE *SetGraphicsRootSignature )( + ID3D12GraphicsCommandList1 * This, + _In_opt_ ID3D12RootSignature *pRootSignature); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetComputeRootDescriptorTable )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetGraphicsRootDescriptorTable )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstant )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstant )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstants )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstants )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetComputeRootConstantBufferView )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetGraphicsRootConstantBufferView )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetComputeRootShaderResourceView )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetGraphicsRootShaderResourceView )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetComputeRootUnorderedAccessView )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetGraphicsRootUnorderedAccessView )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetIndexBuffer) + void ( STDMETHODCALLTYPE *IASetIndexBuffer )( + ID3D12GraphicsCommandList1 * This, + _In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetVertexBuffers) + void ( STDMETHODCALLTYPE *IASetVertexBuffers )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SOSetTargets) + void ( STDMETHODCALLTYPE *SOSetTargets )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetRenderTargets) + void ( STDMETHODCALLTYPE *OMSetRenderTargets )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT NumRenderTargetDescriptors, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pRenderTargetDescriptors, + _In_ BOOL RTsSingleHandleToDescriptorRange, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pDepthStencilDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearDepthStencilView) + void ( STDMETHODCALLTYPE *ClearDepthStencilView )( + ID3D12GraphicsCommandList1 * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView, + _In_ D3D12_CLEAR_FLAGS ClearFlags, + _In_ FLOAT Depth, + _In_ UINT8 Stencil, + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearRenderTargetView) + void ( STDMETHODCALLTYPE *ClearRenderTargetView )( + ID3D12GraphicsCommandList1 * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView, + _In_ const FLOAT ColorRGBA[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewUint) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )( + ID3D12GraphicsCommandList1 * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const UINT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewFloat) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )( + ID3D12GraphicsCommandList1 * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const FLOAT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12GraphicsCommandList1 * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12GraphicsCommandList1 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12GraphicsCommandList1 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12GraphicsCommandList1 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12GraphicsCommandList1 * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12GraphicsCommandList1 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12GraphicsCommandList1 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12GraphicsCommandList1 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteIndirect) + void ( STDMETHODCALLTYPE *ExecuteIndirect )( + ID3D12GraphicsCommandList1 * This, + _In_ ID3D12CommandSignature *pCommandSignature, + _In_ UINT MaxCommandCount, + _In_ ID3D12Resource *pArgumentBuffer, + _In_ UINT64 ArgumentBufferOffset, + _In_opt_ ID3D12Resource *pCountBuffer, + _In_ UINT64 CountBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT) + void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT )( + ID3D12GraphicsCommandList1 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT64) + void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT64 )( + ID3D12GraphicsCommandList1 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, OMSetDepthBounds) + void ( STDMETHODCALLTYPE *OMSetDepthBounds )( + ID3D12GraphicsCommandList1 * This, + _In_ FLOAT Min, + _In_ FLOAT Max); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetSamplePositions) + void ( STDMETHODCALLTYPE *SetSamplePositions )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT NumSamplesPerPixel, + _In_ UINT NumPixels, + _In_reads_(NumSamplesPerPixel*NumPixels) D3D12_SAMPLE_POSITION *pSamplePositions); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, ResolveSubresourceRegion) + void ( STDMETHODCALLTYPE *ResolveSubresourceRegion )( + ID3D12GraphicsCommandList1 * This, + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ UINT DstX, + _In_ UINT DstY, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_opt_ D3D12_RECT *pSrcRect, + _In_ DXGI_FORMAT Format, + _In_ D3D12_RESOLVE_MODE ResolveMode); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetViewInstanceMask) + void ( STDMETHODCALLTYPE *SetViewInstanceMask )( + ID3D12GraphicsCommandList1 * This, + _In_ UINT Mask); + + END_INTERFACE + } ID3D12GraphicsCommandList1Vtbl; + + interface ID3D12GraphicsCommandList1 + { + CONST_VTBL struct ID3D12GraphicsCommandList1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12GraphicsCommandList1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12GraphicsCommandList1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12GraphicsCommandList1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12GraphicsCommandList1_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12GraphicsCommandList1_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12GraphicsCommandList1_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12GraphicsCommandList1_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12GraphicsCommandList1_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12GraphicsCommandList1_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12GraphicsCommandList1_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12GraphicsCommandList1_Reset(This,pAllocator,pInitialState) \ + ( (This)->lpVtbl -> Reset(This,pAllocator,pInitialState) ) + +#define ID3D12GraphicsCommandList1_ClearState(This,pPipelineState) \ + ( (This)->lpVtbl -> ClearState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList1_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) ) + +#define ID3D12GraphicsCommandList1_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) ) + +#define ID3D12GraphicsCommandList1_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ + ( (This)->lpVtbl -> Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) + +#define ID3D12GraphicsCommandList1_CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) \ + ( (This)->lpVtbl -> CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) ) + +#define ID3D12GraphicsCommandList1_CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) \ + ( (This)->lpVtbl -> CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) ) + +#define ID3D12GraphicsCommandList1_CopyResource(This,pDstResource,pSrcResource) \ + ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) ) + +#define ID3D12GraphicsCommandList1_CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) \ + ( (This)->lpVtbl -> CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) ) + +#define ID3D12GraphicsCommandList1_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \ + ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) ) + +#define ID3D12GraphicsCommandList1_IASetPrimitiveTopology(This,PrimitiveTopology) \ + ( (This)->lpVtbl -> IASetPrimitiveTopology(This,PrimitiveTopology) ) + +#define ID3D12GraphicsCommandList1_RSSetViewports(This,NumViewports,pViewports) \ + ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) ) + +#define ID3D12GraphicsCommandList1_RSSetScissorRects(This,NumRects,pRects) \ + ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList1_OMSetBlendFactor(This,BlendFactor) \ + ( (This)->lpVtbl -> OMSetBlendFactor(This,BlendFactor) ) + +#define ID3D12GraphicsCommandList1_OMSetStencilRef(This,StencilRef) \ + ( (This)->lpVtbl -> OMSetStencilRef(This,StencilRef) ) + +#define ID3D12GraphicsCommandList1_SetPipelineState(This,pPipelineState) \ + ( (This)->lpVtbl -> SetPipelineState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList1_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12GraphicsCommandList1_ExecuteBundle(This,pCommandList) \ + ( (This)->lpVtbl -> ExecuteBundle(This,pCommandList) ) + +#define ID3D12GraphicsCommandList1_SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) \ + ( (This)->lpVtbl -> SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) ) + +#define ID3D12GraphicsCommandList1_SetComputeRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetComputeRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList1_SetGraphicsRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetGraphicsRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList1_SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList1_SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList1_SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList1_SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList1_SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList1_SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList1_SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList1_SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList1_SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList1_SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList1_SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList1_SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList1_IASetIndexBuffer(This,pView) \ + ( (This)->lpVtbl -> IASetIndexBuffer(This,pView) ) + +#define ID3D12GraphicsCommandList1_IASetVertexBuffers(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumViews,pViews) ) + +#define ID3D12GraphicsCommandList1_SOSetTargets(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> SOSetTargets(This,StartSlot,NumViews,pViews) ) + +#define ID3D12GraphicsCommandList1_OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) \ + ( (This)->lpVtbl -> OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) ) + +#define ID3D12GraphicsCommandList1_ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList1_ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList1_ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList1_ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList1_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12GraphicsCommandList1_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12GraphicsCommandList1_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12GraphicsCommandList1_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12GraphicsCommandList1_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12GraphicsCommandList1_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12GraphicsCommandList1_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12GraphicsCommandList1_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12GraphicsCommandList1_ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) \ + ( (This)->lpVtbl -> ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) ) + + +#define ID3D12GraphicsCommandList1_AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ + ( (This)->lpVtbl -> AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) + +#define ID3D12GraphicsCommandList1_AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ + ( (This)->lpVtbl -> AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) + +#define ID3D12GraphicsCommandList1_OMSetDepthBounds(This,Min,Max) \ + ( (This)->lpVtbl -> OMSetDepthBounds(This,Min,Max) ) + +#define ID3D12GraphicsCommandList1_SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) \ + ( (This)->lpVtbl -> SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) ) + +#define ID3D12GraphicsCommandList1_ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) \ + ( (This)->lpVtbl -> ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) ) + +#define ID3D12GraphicsCommandList1_SetViewInstanceMask(This,Mask) \ + ( (This)->lpVtbl -> SetViewInstanceMask(This,Mask) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12GraphicsCommandList1_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0018 */ +/* [local] */ + +typedef struct D3D12_WRITEBUFFERIMMEDIATE_PARAMETER + { + D3D12_GPU_VIRTUAL_ADDRESS Dest; + UINT32 Value; + } D3D12_WRITEBUFFERIMMEDIATE_PARAMETER; + +typedef +enum D3D12_WRITEBUFFERIMMEDIATE_MODE + { + D3D12_WRITEBUFFERIMMEDIATE_MODE_DEFAULT = 0, + D3D12_WRITEBUFFERIMMEDIATE_MODE_MARKER_IN = 0x1, + D3D12_WRITEBUFFERIMMEDIATE_MODE_MARKER_OUT = 0x2 + } D3D12_WRITEBUFFERIMMEDIATE_MODE; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0018_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0018_v0_0_s_ifspec; + +#ifndef __ID3D12GraphicsCommandList2_INTERFACE_DEFINED__ +#define __ID3D12GraphicsCommandList2_INTERFACE_DEFINED__ + +/* interface ID3D12GraphicsCommandList2 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12GraphicsCommandList2; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("38C3E585-FF17-412C-9150-4FC6F9D72A28") + ID3D12GraphicsCommandList2 : public ID3D12GraphicsCommandList1 + { + public: + virtual void STDMETHODCALLTYPE WriteBufferImmediate( + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12GraphicsCommandList2Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12GraphicsCommandList2 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12GraphicsCommandList2 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12GraphicsCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12GraphicsCommandList2 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12GraphicsCommandList2 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12GraphicsCommandList2 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12GraphicsCommandList2 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12GraphicsCommandList2 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12GraphicsCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12GraphicsCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12GraphicsCommandList2 * This, + _In_ ID3D12CommandAllocator *pAllocator, + _In_opt_ ID3D12PipelineState *pInitialState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12GraphicsCommandList2 * This, + _In_opt_ ID3D12PipelineState *pPipelineState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawInstanced) + void ( STDMETHODCALLTYPE *DrawInstanced )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT VertexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartVertexLocation, + _In_ UINT StartInstanceLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawIndexedInstanced) + void ( STDMETHODCALLTYPE *DrawIndexedInstanced )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT IndexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartIndexLocation, + _In_ INT BaseVertexLocation, + _In_ UINT StartInstanceLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Dispatch) + void ( STDMETHODCALLTYPE *Dispatch )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT ThreadGroupCountX, + _In_ UINT ThreadGroupCountY, + _In_ UINT ThreadGroupCountZ); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyBufferRegion) + void ( STDMETHODCALLTYPE *CopyBufferRegion )( + ID3D12GraphicsCommandList2 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT64 NumBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTextureRegion) + void ( STDMETHODCALLTYPE *CopyTextureRegion )( + ID3D12GraphicsCommandList2 * This, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pDst, + UINT DstX, + UINT DstY, + UINT DstZ, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pSrc, + _In_opt_ const D3D12_BOX *pSrcBox); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyResource) + void ( STDMETHODCALLTYPE *CopyResource )( + ID3D12GraphicsCommandList2 * This, + _In_ ID3D12Resource *pDstResource, + _In_ ID3D12Resource *pSrcResource); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTiles) + void ( STDMETHODCALLTYPE *CopyTiles )( + ID3D12GraphicsCommandList2 * This, + _In_ ID3D12Resource *pTiledResource, + _In_ const D3D12_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate, + _In_ const D3D12_TILE_REGION_SIZE *pTileRegionSize, + _In_ ID3D12Resource *pBuffer, + UINT64 BufferStartOffsetInBytes, + D3D12_TILE_COPY_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveSubresource) + void ( STDMETHODCALLTYPE *ResolveSubresource )( + ID3D12GraphicsCommandList2 * This, + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_ DXGI_FORMAT Format); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetPrimitiveTopology) + void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )( + ID3D12GraphicsCommandList2 * This, + _In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetViewports) + void ( STDMETHODCALLTYPE *RSSetViewports )( + ID3D12GraphicsCommandList2 * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, + _In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetScissorRects) + void ( STDMETHODCALLTYPE *RSSetScissorRects )( + ID3D12GraphicsCommandList2 * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, + _In_reads_( NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetBlendFactor) + void ( STDMETHODCALLTYPE *OMSetBlendFactor )( + ID3D12GraphicsCommandList2 * This, + _In_reads_opt_(4) const FLOAT BlendFactor[ 4 ]); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetStencilRef) + void ( STDMETHODCALLTYPE *OMSetStencilRef )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT StencilRef); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPipelineState) + void ( STDMETHODCALLTYPE *SetPipelineState )( + ID3D12GraphicsCommandList2 * This, + _In_ ID3D12PipelineState *pPipelineState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteBundle) + void ( STDMETHODCALLTYPE *ExecuteBundle )( + ID3D12GraphicsCommandList2 * This, + _In_ ID3D12GraphicsCommandList *pCommandList); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetDescriptorHeaps) + void ( STDMETHODCALLTYPE *SetDescriptorHeaps )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT NumDescriptorHeaps, + _In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap *const *ppDescriptorHeaps); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootSignature) + void ( STDMETHODCALLTYPE *SetComputeRootSignature )( + ID3D12GraphicsCommandList2 * This, + _In_opt_ ID3D12RootSignature *pRootSignature); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootSignature) + void ( STDMETHODCALLTYPE *SetGraphicsRootSignature )( + ID3D12GraphicsCommandList2 * This, + _In_opt_ ID3D12RootSignature *pRootSignature); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetComputeRootDescriptorTable )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetGraphicsRootDescriptorTable )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstant )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstant )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstants )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstants )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetComputeRootConstantBufferView )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetGraphicsRootConstantBufferView )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetComputeRootShaderResourceView )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetGraphicsRootShaderResourceView )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetComputeRootUnorderedAccessView )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetGraphicsRootUnorderedAccessView )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetIndexBuffer) + void ( STDMETHODCALLTYPE *IASetIndexBuffer )( + ID3D12GraphicsCommandList2 * This, + _In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetVertexBuffers) + void ( STDMETHODCALLTYPE *IASetVertexBuffers )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SOSetTargets) + void ( STDMETHODCALLTYPE *SOSetTargets )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetRenderTargets) + void ( STDMETHODCALLTYPE *OMSetRenderTargets )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT NumRenderTargetDescriptors, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pRenderTargetDescriptors, + _In_ BOOL RTsSingleHandleToDescriptorRange, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pDepthStencilDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearDepthStencilView) + void ( STDMETHODCALLTYPE *ClearDepthStencilView )( + ID3D12GraphicsCommandList2 * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView, + _In_ D3D12_CLEAR_FLAGS ClearFlags, + _In_ FLOAT Depth, + _In_ UINT8 Stencil, + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearRenderTargetView) + void ( STDMETHODCALLTYPE *ClearRenderTargetView )( + ID3D12GraphicsCommandList2 * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView, + _In_ const FLOAT ColorRGBA[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewUint) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )( + ID3D12GraphicsCommandList2 * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const UINT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewFloat) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )( + ID3D12GraphicsCommandList2 * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const FLOAT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12GraphicsCommandList2 * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12GraphicsCommandList2 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12GraphicsCommandList2 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12GraphicsCommandList2 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12GraphicsCommandList2 * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12GraphicsCommandList2 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12GraphicsCommandList2 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12GraphicsCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteIndirect) + void ( STDMETHODCALLTYPE *ExecuteIndirect )( + ID3D12GraphicsCommandList2 * This, + _In_ ID3D12CommandSignature *pCommandSignature, + _In_ UINT MaxCommandCount, + _In_ ID3D12Resource *pArgumentBuffer, + _In_ UINT64 ArgumentBufferOffset, + _In_opt_ ID3D12Resource *pCountBuffer, + _In_ UINT64 CountBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT) + void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT )( + ID3D12GraphicsCommandList2 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT64) + void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT64 )( + ID3D12GraphicsCommandList2 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, OMSetDepthBounds) + void ( STDMETHODCALLTYPE *OMSetDepthBounds )( + ID3D12GraphicsCommandList2 * This, + _In_ FLOAT Min, + _In_ FLOAT Max); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetSamplePositions) + void ( STDMETHODCALLTYPE *SetSamplePositions )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT NumSamplesPerPixel, + _In_ UINT NumPixels, + _In_reads_(NumSamplesPerPixel*NumPixels) D3D12_SAMPLE_POSITION *pSamplePositions); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, ResolveSubresourceRegion) + void ( STDMETHODCALLTYPE *ResolveSubresourceRegion )( + ID3D12GraphicsCommandList2 * This, + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ UINT DstX, + _In_ UINT DstY, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_opt_ D3D12_RECT *pSrcRect, + _In_ DXGI_FORMAT Format, + _In_ D3D12_RESOLVE_MODE ResolveMode); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetViewInstanceMask) + void ( STDMETHODCALLTYPE *SetViewInstanceMask )( + ID3D12GraphicsCommandList2 * This, + _In_ UINT Mask); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList2, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12GraphicsCommandList2 * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); + + END_INTERFACE + } ID3D12GraphicsCommandList2Vtbl; + + interface ID3D12GraphicsCommandList2 + { + CONST_VTBL struct ID3D12GraphicsCommandList2Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12GraphicsCommandList2_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12GraphicsCommandList2_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12GraphicsCommandList2_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12GraphicsCommandList2_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12GraphicsCommandList2_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12GraphicsCommandList2_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12GraphicsCommandList2_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12GraphicsCommandList2_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12GraphicsCommandList2_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12GraphicsCommandList2_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12GraphicsCommandList2_Reset(This,pAllocator,pInitialState) \ + ( (This)->lpVtbl -> Reset(This,pAllocator,pInitialState) ) + +#define ID3D12GraphicsCommandList2_ClearState(This,pPipelineState) \ + ( (This)->lpVtbl -> ClearState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList2_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) ) + +#define ID3D12GraphicsCommandList2_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) ) + +#define ID3D12GraphicsCommandList2_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ + ( (This)->lpVtbl -> Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) + +#define ID3D12GraphicsCommandList2_CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) \ + ( (This)->lpVtbl -> CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) ) + +#define ID3D12GraphicsCommandList2_CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) \ + ( (This)->lpVtbl -> CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) ) + +#define ID3D12GraphicsCommandList2_CopyResource(This,pDstResource,pSrcResource) \ + ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) ) + +#define ID3D12GraphicsCommandList2_CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) \ + ( (This)->lpVtbl -> CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) ) + +#define ID3D12GraphicsCommandList2_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \ + ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) ) + +#define ID3D12GraphicsCommandList2_IASetPrimitiveTopology(This,PrimitiveTopology) \ + ( (This)->lpVtbl -> IASetPrimitiveTopology(This,PrimitiveTopology) ) + +#define ID3D12GraphicsCommandList2_RSSetViewports(This,NumViewports,pViewports) \ + ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) ) + +#define ID3D12GraphicsCommandList2_RSSetScissorRects(This,NumRects,pRects) \ + ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList2_OMSetBlendFactor(This,BlendFactor) \ + ( (This)->lpVtbl -> OMSetBlendFactor(This,BlendFactor) ) + +#define ID3D12GraphicsCommandList2_OMSetStencilRef(This,StencilRef) \ + ( (This)->lpVtbl -> OMSetStencilRef(This,StencilRef) ) + +#define ID3D12GraphicsCommandList2_SetPipelineState(This,pPipelineState) \ + ( (This)->lpVtbl -> SetPipelineState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList2_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12GraphicsCommandList2_ExecuteBundle(This,pCommandList) \ + ( (This)->lpVtbl -> ExecuteBundle(This,pCommandList) ) + +#define ID3D12GraphicsCommandList2_SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) \ + ( (This)->lpVtbl -> SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) ) + +#define ID3D12GraphicsCommandList2_SetComputeRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetComputeRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList2_SetGraphicsRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetGraphicsRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList2_SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList2_SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList2_SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList2_SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList2_SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList2_SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList2_SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList2_SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList2_SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList2_SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList2_SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList2_SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList2_IASetIndexBuffer(This,pView) \ + ( (This)->lpVtbl -> IASetIndexBuffer(This,pView) ) + +#define ID3D12GraphicsCommandList2_IASetVertexBuffers(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumViews,pViews) ) + +#define ID3D12GraphicsCommandList2_SOSetTargets(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> SOSetTargets(This,StartSlot,NumViews,pViews) ) + +#define ID3D12GraphicsCommandList2_OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) \ + ( (This)->lpVtbl -> OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) ) + +#define ID3D12GraphicsCommandList2_ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList2_ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList2_ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList2_ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList2_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12GraphicsCommandList2_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12GraphicsCommandList2_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12GraphicsCommandList2_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12GraphicsCommandList2_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12GraphicsCommandList2_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12GraphicsCommandList2_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12GraphicsCommandList2_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12GraphicsCommandList2_ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) \ + ( (This)->lpVtbl -> ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) ) + + +#define ID3D12GraphicsCommandList2_AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ + ( (This)->lpVtbl -> AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) + +#define ID3D12GraphicsCommandList2_AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ + ( (This)->lpVtbl -> AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) + +#define ID3D12GraphicsCommandList2_OMSetDepthBounds(This,Min,Max) \ + ( (This)->lpVtbl -> OMSetDepthBounds(This,Min,Max) ) + +#define ID3D12GraphicsCommandList2_SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) \ + ( (This)->lpVtbl -> SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) ) + +#define ID3D12GraphicsCommandList2_ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) \ + ( (This)->lpVtbl -> ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) ) + +#define ID3D12GraphicsCommandList2_SetViewInstanceMask(This,Mask) \ + ( (This)->lpVtbl -> SetViewInstanceMask(This,Mask) ) + + +#define ID3D12GraphicsCommandList2_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12GraphicsCommandList2_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12CommandQueue_INTERFACE_DEFINED__ +#define __ID3D12CommandQueue_INTERFACE_DEFINED__ + +/* interface ID3D12CommandQueue */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12CommandQueue; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("0ec870a6-5d7e-4c22-8cfc-5baae07616ed") + ID3D12CommandQueue : public ID3D12Pageable + { + public: + virtual void STDMETHODCALLTYPE UpdateTileMappings( + _In_ ID3D12Resource *pResource, + UINT NumResourceRegions, + _In_reads_opt_(NumResourceRegions) const D3D12_TILED_RESOURCE_COORDINATE *pResourceRegionStartCoordinates, + _In_reads_opt_(NumResourceRegions) const D3D12_TILE_REGION_SIZE *pResourceRegionSizes, + _In_opt_ ID3D12Heap *pHeap, + UINT NumRanges, + _In_reads_opt_(NumRanges) const D3D12_TILE_RANGE_FLAGS *pRangeFlags, + _In_reads_opt_(NumRanges) const UINT *pHeapRangeStartOffsets, + _In_reads_opt_(NumRanges) const UINT *pRangeTileCounts, + D3D12_TILE_MAPPING_FLAGS Flags) = 0; + + virtual void STDMETHODCALLTYPE CopyTileMappings( + _In_ ID3D12Resource *pDstResource, + _In_ const D3D12_TILED_RESOURCE_COORDINATE *pDstRegionStartCoordinate, + _In_ ID3D12Resource *pSrcResource, + _In_ const D3D12_TILED_RESOURCE_COORDINATE *pSrcRegionStartCoordinate, + _In_ const D3D12_TILE_REGION_SIZE *pRegionSize, + D3D12_TILE_MAPPING_FLAGS Flags) = 0; + + virtual void STDMETHODCALLTYPE ExecuteCommandLists( + _In_ UINT NumCommandLists, + _In_reads_(NumCommandLists) ID3D12CommandList *const *ppCommandLists) = 0; + + virtual void STDMETHODCALLTYPE SetMarker( + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size) = 0; + + virtual void STDMETHODCALLTYPE BeginEvent( + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size) = 0; + + virtual void STDMETHODCALLTYPE EndEvent( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE Signal( + ID3D12Fence *pFence, + UINT64 Value) = 0; + + virtual HRESULT STDMETHODCALLTYPE Wait( + ID3D12Fence *pFence, + UINT64 Value) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetTimestampFrequency( + _Out_ UINT64 *pFrequency) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetClockCalibration( + _Out_ UINT64 *pGpuTimestamp, + _Out_ UINT64 *pCpuTimestamp) = 0; + +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_COMMAND_QUEUE_DESC STDMETHODCALLTYPE GetDesc( void) = 0; +#else + virtual D3D12_COMMAND_QUEUE_DESC *STDMETHODCALLTYPE GetDesc( + D3D12_COMMAND_QUEUE_DESC * RetVal) = 0; +#endif + + }; + + +#else /* C style interface */ + + typedef struct ID3D12CommandQueueVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12CommandQueue * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12CommandQueue * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12CommandQueue * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12CommandQueue * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12CommandQueue * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12CommandQueue * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12CommandQueue * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12CommandQueue * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandQueue, UpdateTileMappings) + void ( STDMETHODCALLTYPE *UpdateTileMappings )( + ID3D12CommandQueue * This, + _In_ ID3D12Resource *pResource, + UINT NumResourceRegions, + _In_reads_opt_(NumResourceRegions) const D3D12_TILED_RESOURCE_COORDINATE *pResourceRegionStartCoordinates, + _In_reads_opt_(NumResourceRegions) const D3D12_TILE_REGION_SIZE *pResourceRegionSizes, + _In_opt_ ID3D12Heap *pHeap, + UINT NumRanges, + _In_reads_opt_(NumRanges) const D3D12_TILE_RANGE_FLAGS *pRangeFlags, + _In_reads_opt_(NumRanges) const UINT *pHeapRangeStartOffsets, + _In_reads_opt_(NumRanges) const UINT *pRangeTileCounts, + D3D12_TILE_MAPPING_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12CommandQueue, CopyTileMappings) + void ( STDMETHODCALLTYPE *CopyTileMappings )( + ID3D12CommandQueue * This, + _In_ ID3D12Resource *pDstResource, + _In_ const D3D12_TILED_RESOURCE_COORDINATE *pDstRegionStartCoordinate, + _In_ ID3D12Resource *pSrcResource, + _In_ const D3D12_TILED_RESOURCE_COORDINATE *pSrcRegionStartCoordinate, + _In_ const D3D12_TILE_REGION_SIZE *pRegionSize, + D3D12_TILE_MAPPING_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12CommandQueue, ExecuteCommandLists) + void ( STDMETHODCALLTYPE *ExecuteCommandLists )( + ID3D12CommandQueue * This, + _In_ UINT NumCommandLists, + _In_reads_(NumCommandLists) ID3D12CommandList *const *ppCommandLists); + + DECLSPEC_XFGVIRT(ID3D12CommandQueue, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12CommandQueue * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12CommandQueue, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12CommandQueue * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12CommandQueue, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12CommandQueue * This); + + DECLSPEC_XFGVIRT(ID3D12CommandQueue, Signal) + HRESULT ( STDMETHODCALLTYPE *Signal )( + ID3D12CommandQueue * This, + ID3D12Fence *pFence, + UINT64 Value); + + DECLSPEC_XFGVIRT(ID3D12CommandQueue, Wait) + HRESULT ( STDMETHODCALLTYPE *Wait )( + ID3D12CommandQueue * This, + ID3D12Fence *pFence, + UINT64 Value); + + DECLSPEC_XFGVIRT(ID3D12CommandQueue, GetTimestampFrequency) + HRESULT ( STDMETHODCALLTYPE *GetTimestampFrequency )( + ID3D12CommandQueue * This, + _Out_ UINT64 *pFrequency); + + DECLSPEC_XFGVIRT(ID3D12CommandQueue, GetClockCalibration) + HRESULT ( STDMETHODCALLTYPE *GetClockCalibration )( + ID3D12CommandQueue * This, + _Out_ UINT64 *pGpuTimestamp, + _Out_ UINT64 *pCpuTimestamp); + + DECLSPEC_XFGVIRT(ID3D12CommandQueue, GetDesc) +#if !defined(_WIN32) + D3D12_COMMAND_QUEUE_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12CommandQueue * This); + +#else + D3D12_COMMAND_QUEUE_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12CommandQueue * This, + D3D12_COMMAND_QUEUE_DESC * RetVal); + +#endif + + END_INTERFACE + } ID3D12CommandQueueVtbl; + + interface ID3D12CommandQueue + { + CONST_VTBL struct ID3D12CommandQueueVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12CommandQueue_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12CommandQueue_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12CommandQueue_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12CommandQueue_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12CommandQueue_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12CommandQueue_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12CommandQueue_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12CommandQueue_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + + +#define ID3D12CommandQueue_UpdateTileMappings(This,pResource,NumResourceRegions,pResourceRegionStartCoordinates,pResourceRegionSizes,pHeap,NumRanges,pRangeFlags,pHeapRangeStartOffsets,pRangeTileCounts,Flags) \ + ( (This)->lpVtbl -> UpdateTileMappings(This,pResource,NumResourceRegions,pResourceRegionStartCoordinates,pResourceRegionSizes,pHeap,NumRanges,pRangeFlags,pHeapRangeStartOffsets,pRangeTileCounts,Flags) ) + +#define ID3D12CommandQueue_CopyTileMappings(This,pDstResource,pDstRegionStartCoordinate,pSrcResource,pSrcRegionStartCoordinate,pRegionSize,Flags) \ + ( (This)->lpVtbl -> CopyTileMappings(This,pDstResource,pDstRegionStartCoordinate,pSrcResource,pSrcRegionStartCoordinate,pRegionSize,Flags) ) + +#define ID3D12CommandQueue_ExecuteCommandLists(This,NumCommandLists,ppCommandLists) \ + ( (This)->lpVtbl -> ExecuteCommandLists(This,NumCommandLists,ppCommandLists) ) + +#define ID3D12CommandQueue_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12CommandQueue_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12CommandQueue_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12CommandQueue_Signal(This,pFence,Value) \ + ( (This)->lpVtbl -> Signal(This,pFence,Value) ) + +#define ID3D12CommandQueue_Wait(This,pFence,Value) \ + ( (This)->lpVtbl -> Wait(This,pFence,Value) ) + +#define ID3D12CommandQueue_GetTimestampFrequency(This,pFrequency) \ + ( (This)->lpVtbl -> GetTimestampFrequency(This,pFrequency) ) + +#define ID3D12CommandQueue_GetClockCalibration(This,pGpuTimestamp,pCpuTimestamp) \ + ( (This)->lpVtbl -> GetClockCalibration(This,pGpuTimestamp,pCpuTimestamp) ) +#if !defined(_WIN32) + +#define ID3D12CommandQueue_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) +#else +#define ID3D12CommandQueue_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) +#endif + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12CommandQueue_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0020 */ +/* [local] */ + +#ifdef __midl +#ifndef LUID_DEFINED +#define LUID_DEFINED 1 +typedef struct __LUID + { + DWORD LowPart; + LONG HighPart; + } LUID; + +typedef struct __LUID *PLUID; + +#endif +#endif + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0020_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0020_v0_0_s_ifspec; + +#ifndef __ID3D12Device_INTERFACE_DEFINED__ +#define __ID3D12Device_INTERFACE_DEFINED__ + +/* interface ID3D12Device */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Device; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("189819f1-1db6-4b57-be54-1821339b85f7") + ID3D12Device : public ID3D12Object + { + public: + virtual UINT STDMETHODCALLTYPE GetNodeCount( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateCommandQueue( + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateCommandAllocator( + _In_ D3D12_COMMAND_LIST_TYPE type, + REFIID riid, + _COM_Outptr_ void **ppCommandAllocator) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateGraphicsPipelineState( + _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateComputePipelineState( + _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateCommandList( + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ ID3D12CommandAllocator *pCommandAllocator, + _In_opt_ ID3D12PipelineState *pInitialState, + REFIID riid, + _COM_Outptr_ void **ppCommandList) = 0; + + virtual HRESULT STDMETHODCALLTYPE CheckFeatureSupport( + D3D12_FEATURE Feature, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateDescriptorHeap( + _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, + REFIID riid, + _COM_Outptr_ void **ppvHeap) = 0; + + virtual UINT STDMETHODCALLTYPE GetDescriptorHandleIncrementSize( + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateRootSignature( + _In_ UINT nodeMask, + _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature, + _In_ SIZE_T blobLengthInBytes, + REFIID riid, + _COM_Outptr_ void **ppvRootSignature) = 0; + + virtual void STDMETHODCALLTYPE CreateConstantBufferView( + _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor) = 0; + + virtual void STDMETHODCALLTYPE CreateShaderResourceView( + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor) = 0; + + virtual void STDMETHODCALLTYPE CreateUnorderedAccessView( + _In_opt_ ID3D12Resource *pResource, + _In_opt_ ID3D12Resource *pCounterResource, + _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor) = 0; + + virtual void STDMETHODCALLTYPE CreateRenderTargetView( + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor) = 0; + + virtual void STDMETHODCALLTYPE CreateDepthStencilView( + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor) = 0; + + virtual void STDMETHODCALLTYPE CreateSampler( + _In_ const D3D12_SAMPLER_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor) = 0; + + virtual void STDMETHODCALLTYPE CopyDescriptors( + _In_ UINT NumDestDescriptorRanges, + _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts, + _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes, + _In_ UINT NumSrcDescriptorRanges, + _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts, + _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType) = 0; + + virtual void STDMETHODCALLTYPE CopyDescriptorsSimple( + _In_ UINT NumDescriptors, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType) = 0; + +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_RESOURCE_ALLOCATION_INFO STDMETHODCALLTYPE GetResourceAllocationInfo( + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs) = 0; +#else + virtual D3D12_RESOURCE_ALLOCATION_INFO *STDMETHODCALLTYPE GetResourceAllocationInfo( + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs) = 0; +#endif + +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_HEAP_PROPERTIES STDMETHODCALLTYPE GetCustomHeapProperties( + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType) = 0; +#else + virtual D3D12_HEAP_PROPERTIES *STDMETHODCALLTYPE GetCustomHeapProperties( + D3D12_HEAP_PROPERTIES * RetVal, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType) = 0; +#endif + + virtual HRESULT STDMETHODCALLTYPE CreateCommittedResource( + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateHeap( + _In_ const D3D12_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreatePlacedResource( + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateReservedResource( + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateSharedHandle( + _In_ ID3D12DeviceChild *pObject, + _In_opt_ const SECURITY_ATTRIBUTES *pAttributes, + DWORD Access, + _In_opt_ LPCWSTR Name, + _Out_ HANDLE *pHandle) = 0; + + virtual HRESULT STDMETHODCALLTYPE OpenSharedHandle( + _In_ HANDLE NTHandle, + REFIID riid, + _COM_Outptr_opt_ void **ppvObj) = 0; + + virtual HRESULT STDMETHODCALLTYPE OpenSharedHandleByName( + _In_ LPCWSTR Name, + DWORD Access, + /* [annotation][out] */ + _Out_ HANDLE *pNTHandle) = 0; + + virtual HRESULT STDMETHODCALLTYPE MakeResident( + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects) = 0; + + virtual HRESULT STDMETHODCALLTYPE Evict( + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateFence( + UINT64 InitialValue, + D3D12_FENCE_FLAGS Flags, + REFIID riid, + _COM_Outptr_ void **ppFence) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetDeviceRemovedReason( void) = 0; + + virtual void STDMETHODCALLTYPE GetCopyableFootprints( + _In_ const D3D12_RESOURCE_DESC *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateQueryHeap( + _In_ const D3D12_QUERY_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetStablePowerState( + BOOL Enable) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateCommandSignature( + _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc, + _In_opt_ ID3D12RootSignature *pRootSignature, + REFIID riid, + _COM_Outptr_opt_ void **ppvCommandSignature) = 0; + + virtual void STDMETHODCALLTYPE GetResourceTiling( + _In_ ID3D12Resource *pTiledResource, + _Out_opt_ UINT *pNumTilesForEntireResource, + _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc, + _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips, + _Inout_opt_ UINT *pNumSubresourceTilings, + _In_ UINT FirstSubresourceTilingToGet, + _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips) = 0; + +#if defined(_MSC_VER) || !defined(_WIN32) + virtual LUID STDMETHODCALLTYPE GetAdapterLuid( void) = 0; +#else + virtual LUID *STDMETHODCALLTYPE GetAdapterLuid( + LUID * RetVal) = 0; +#endif + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DeviceVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Device * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Device * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Device * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Device * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Device * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Device * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Device * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount) + UINT ( STDMETHODCALLTYPE *GetNodeCount )( + ID3D12Device * This); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )( + ID3D12Device * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator) + HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )( + ID3D12Device * This, + _In_ D3D12_COMMAND_LIST_TYPE type, + REFIID riid, + _COM_Outptr_ void **ppCommandAllocator); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )( + ID3D12Device * This, + _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )( + ID3D12Device * This, + _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList )( + ID3D12Device * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ ID3D12CommandAllocator *pCommandAllocator, + _In_opt_ ID3D12PipelineState *pInitialState, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport) + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D12Device * This, + D3D12_FEATURE Feature, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap) + HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )( + ID3D12Device * This, + _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize) + UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )( + ID3D12Device * This, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature) + HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )( + ID3D12Device * This, + _In_ UINT nodeMask, + _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature, + _In_ SIZE_T blobLengthInBytes, + REFIID riid, + _COM_Outptr_ void **ppvRootSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView) + void ( STDMETHODCALLTYPE *CreateConstantBufferView )( + ID3D12Device * This, + _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView) + void ( STDMETHODCALLTYPE *CreateShaderResourceView )( + ID3D12Device * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )( + ID3D12Device * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ ID3D12Resource *pCounterResource, + _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView) + void ( STDMETHODCALLTYPE *CreateRenderTargetView )( + ID3D12Device * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView) + void ( STDMETHODCALLTYPE *CreateDepthStencilView )( + ID3D12Device * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler) + void ( STDMETHODCALLTYPE *CreateSampler )( + ID3D12Device * This, + _In_ const D3D12_SAMPLER_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors) + void ( STDMETHODCALLTYPE *CopyDescriptors )( + ID3D12Device * This, + _In_ UINT NumDestDescriptorRanges, + _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts, + _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes, + _In_ UINT NumSrcDescriptorRanges, + _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts, + _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple) + void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )( + ID3D12Device * This, + _In_ UINT NumDescriptors, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device * This, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties) +#if !defined(_WIN32) + D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device * This, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#else + D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device * This, + D3D12_HEAP_PROPERTIES * RetVal, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )( + ID3D12Device * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap) + HRESULT ( STDMETHODCALLTYPE *CreateHeap )( + ID3D12Device * This, + _In_ const D3D12_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )( + ID3D12Device * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )( + ID3D12Device * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle) + HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )( + ID3D12Device * This, + _In_ ID3D12DeviceChild *pObject, + _In_opt_ const SECURITY_ATTRIBUTES *pAttributes, + DWORD Access, + _In_opt_ LPCWSTR Name, + _Out_ HANDLE *pHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )( + ID3D12Device * This, + _In_ HANDLE NTHandle, + REFIID riid, + _COM_Outptr_opt_ void **ppvObj); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )( + ID3D12Device * This, + _In_ LPCWSTR Name, + DWORD Access, + /* [annotation][out] */ + _Out_ HANDLE *pNTHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, MakeResident) + HRESULT ( STDMETHODCALLTYPE *MakeResident )( + ID3D12Device * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, Evict) + HRESULT ( STDMETHODCALLTYPE *Evict )( + ID3D12Device * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateFence) + HRESULT ( STDMETHODCALLTYPE *CreateFence )( + ID3D12Device * This, + UINT64 InitialValue, + D3D12_FENCE_FLAGS Flags, + REFIID riid, + _COM_Outptr_ void **ppFence); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason) + HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( + ID3D12Device * This); + + DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints) + void ( STDMETHODCALLTYPE *GetCopyableFootprints )( + ID3D12Device * This, + _In_ const D3D12_RESOURCE_DESC *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap) + HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )( + ID3D12Device * This, + _In_ const D3D12_QUERY_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState) + HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )( + ID3D12Device * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature) + HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )( + ID3D12Device * This, + _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc, + _In_opt_ ID3D12RootSignature *pRootSignature, + REFIID riid, + _COM_Outptr_opt_ void **ppvCommandSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling) + void ( STDMETHODCALLTYPE *GetResourceTiling )( + ID3D12Device * This, + _In_ ID3D12Resource *pTiledResource, + _Out_opt_ UINT *pNumTilesForEntireResource, + _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc, + _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips, + _Inout_opt_ UINT *pNumSubresourceTilings, + _In_ UINT FirstSubresourceTilingToGet, + _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips); + + DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid) +#if !defined(_WIN32) + LUID ( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device * This); + +#else + LUID *( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device * This, + LUID * RetVal); + +#endif + + END_INTERFACE + } ID3D12DeviceVtbl; + + interface ID3D12Device + { + CONST_VTBL struct ID3D12DeviceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Device_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Device_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Device_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Device_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Device_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Device_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Device_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Device_GetNodeCount(This) \ + ( (This)->lpVtbl -> GetNodeCount(This) ) + +#define ID3D12Device_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) ) + +#define ID3D12Device_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ + ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) ) + +#define ID3D12Device_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) ) + +#define ID3D12Device_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) ) + +#define ID3D12Device_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) ) + +#define ID3D12Device_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ + ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) ) + +#define ID3D12Device_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ + ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) ) + +#define ID3D12Device_CreateConstantBufferView(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) ) + +#define ID3D12Device_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) ) + +#define ID3D12Device_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device_CreateSampler(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) ) + +#define ID3D12Device_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) ) + +#define ID3D12Device_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) ) +#if !defined(_WIN32) + +#define ID3D12Device_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) ) +#else +#define ID3D12Device_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) ) +#endif +#if !defined(_WIN32) + +#define ID3D12Device_GetCustomHeapProperties(This,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) ) +#else +#define ID3D12Device_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) ) +#endif + +#define ID3D12Device_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) ) + +#define ID3D12Device_CreateHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ + ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) ) + +#define ID3D12Device_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ + ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) ) + +#define ID3D12Device_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ + ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) ) + +#define ID3D12Device_MakeResident(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) ) + +#define ID3D12Device_Evict(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) ) + +#define ID3D12Device_CreateFence(This,InitialValue,Flags,riid,ppFence) \ + ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) ) + +#define ID3D12Device_GetDeviceRemovedReason(This) \ + ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) + +#define ID3D12Device_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) + +#define ID3D12Device_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device_SetStablePowerState(This,Enable) \ + ( (This)->lpVtbl -> SetStablePowerState(This,Enable) ) + +#define ID3D12Device_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ + ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) ) + +#define ID3D12Device_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ + ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) ) +#if !defined(_WIN32) + +#define ID3D12Device_GetAdapterLuid(This) \ + ( (This)->lpVtbl -> GetAdapterLuid(This) ) +#else +#define ID3D12Device_GetAdapterLuid(This,RetVal) \ + ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) ) +#endif + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Device_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12PipelineLibrary_INTERFACE_DEFINED__ +#define __ID3D12PipelineLibrary_INTERFACE_DEFINED__ + +/* interface ID3D12PipelineLibrary */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12PipelineLibrary; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("c64226a8-9201-46af-b4cc-53fb9ff7414f") + ID3D12PipelineLibrary : public ID3D12DeviceChild + { + public: + virtual HRESULT STDMETHODCALLTYPE StorePipeline( + _In_opt_ LPCWSTR pName, + _In_ ID3D12PipelineState *pPipeline) = 0; + + virtual HRESULT STDMETHODCALLTYPE LoadGraphicsPipeline( + _In_ LPCWSTR pName, + _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState) = 0; + + virtual HRESULT STDMETHODCALLTYPE LoadComputePipeline( + _In_ LPCWSTR pName, + _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState) = 0; + + virtual SIZE_T STDMETHODCALLTYPE GetSerializedSize( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE Serialize( + _Out_writes_(DataSizeInBytes) void *pData, + SIZE_T DataSizeInBytes) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12PipelineLibraryVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12PipelineLibrary * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12PipelineLibrary * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12PipelineLibrary * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12PipelineLibrary * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12PipelineLibrary * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12PipelineLibrary * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12PipelineLibrary * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12PipelineLibrary * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12PipelineLibrary, StorePipeline) + HRESULT ( STDMETHODCALLTYPE *StorePipeline )( + ID3D12PipelineLibrary * This, + _In_opt_ LPCWSTR pName, + _In_ ID3D12PipelineState *pPipeline); + + DECLSPEC_XFGVIRT(ID3D12PipelineLibrary, LoadGraphicsPipeline) + HRESULT ( STDMETHODCALLTYPE *LoadGraphicsPipeline )( + ID3D12PipelineLibrary * This, + _In_ LPCWSTR pName, + _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12PipelineLibrary, LoadComputePipeline) + HRESULT ( STDMETHODCALLTYPE *LoadComputePipeline )( + ID3D12PipelineLibrary * This, + _In_ LPCWSTR pName, + _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12PipelineLibrary, GetSerializedSize) + SIZE_T ( STDMETHODCALLTYPE *GetSerializedSize )( + ID3D12PipelineLibrary * This); + + DECLSPEC_XFGVIRT(ID3D12PipelineLibrary, Serialize) + HRESULT ( STDMETHODCALLTYPE *Serialize )( + ID3D12PipelineLibrary * This, + _Out_writes_(DataSizeInBytes) void *pData, + SIZE_T DataSizeInBytes); + + END_INTERFACE + } ID3D12PipelineLibraryVtbl; + + interface ID3D12PipelineLibrary + { + CONST_VTBL struct ID3D12PipelineLibraryVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12PipelineLibrary_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12PipelineLibrary_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12PipelineLibrary_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12PipelineLibrary_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12PipelineLibrary_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12PipelineLibrary_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12PipelineLibrary_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12PipelineLibrary_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12PipelineLibrary_StorePipeline(This,pName,pPipeline) \ + ( (This)->lpVtbl -> StorePipeline(This,pName,pPipeline) ) + +#define ID3D12PipelineLibrary_LoadGraphicsPipeline(This,pName,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> LoadGraphicsPipeline(This,pName,pDesc,riid,ppPipelineState) ) + +#define ID3D12PipelineLibrary_LoadComputePipeline(This,pName,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> LoadComputePipeline(This,pName,pDesc,riid,ppPipelineState) ) + +#define ID3D12PipelineLibrary_GetSerializedSize(This) \ + ( (This)->lpVtbl -> GetSerializedSize(This) ) + +#define ID3D12PipelineLibrary_Serialize(This,pData,DataSizeInBytes) \ + ( (This)->lpVtbl -> Serialize(This,pData,DataSizeInBytes) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12PipelineLibrary_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12PipelineLibrary1_INTERFACE_DEFINED__ +#define __ID3D12PipelineLibrary1_INTERFACE_DEFINED__ + +/* interface ID3D12PipelineLibrary1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12PipelineLibrary1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("80eabf42-2568-4e5e-bd82-c37f86961dc3") + ID3D12PipelineLibrary1 : public ID3D12PipelineLibrary + { + public: + virtual HRESULT STDMETHODCALLTYPE LoadPipeline( + _In_ LPCWSTR pName, + _In_ const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12PipelineLibrary1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12PipelineLibrary1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12PipelineLibrary1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12PipelineLibrary1 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12PipelineLibrary1 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12PipelineLibrary1 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12PipelineLibrary1 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12PipelineLibrary1 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12PipelineLibrary1 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12PipelineLibrary, StorePipeline) + HRESULT ( STDMETHODCALLTYPE *StorePipeline )( + ID3D12PipelineLibrary1 * This, + _In_opt_ LPCWSTR pName, + _In_ ID3D12PipelineState *pPipeline); + + DECLSPEC_XFGVIRT(ID3D12PipelineLibrary, LoadGraphicsPipeline) + HRESULT ( STDMETHODCALLTYPE *LoadGraphicsPipeline )( + ID3D12PipelineLibrary1 * This, + _In_ LPCWSTR pName, + _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12PipelineLibrary, LoadComputePipeline) + HRESULT ( STDMETHODCALLTYPE *LoadComputePipeline )( + ID3D12PipelineLibrary1 * This, + _In_ LPCWSTR pName, + _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12PipelineLibrary, GetSerializedSize) + SIZE_T ( STDMETHODCALLTYPE *GetSerializedSize )( + ID3D12PipelineLibrary1 * This); + + DECLSPEC_XFGVIRT(ID3D12PipelineLibrary, Serialize) + HRESULT ( STDMETHODCALLTYPE *Serialize )( + ID3D12PipelineLibrary1 * This, + _Out_writes_(DataSizeInBytes) void *pData, + SIZE_T DataSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12PipelineLibrary1, LoadPipeline) + HRESULT ( STDMETHODCALLTYPE *LoadPipeline )( + ID3D12PipelineLibrary1 * This, + _In_ LPCWSTR pName, + _In_ const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + END_INTERFACE + } ID3D12PipelineLibrary1Vtbl; + + interface ID3D12PipelineLibrary1 + { + CONST_VTBL struct ID3D12PipelineLibrary1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12PipelineLibrary1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12PipelineLibrary1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12PipelineLibrary1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12PipelineLibrary1_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12PipelineLibrary1_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12PipelineLibrary1_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12PipelineLibrary1_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12PipelineLibrary1_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12PipelineLibrary1_StorePipeline(This,pName,pPipeline) \ + ( (This)->lpVtbl -> StorePipeline(This,pName,pPipeline) ) + +#define ID3D12PipelineLibrary1_LoadGraphicsPipeline(This,pName,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> LoadGraphicsPipeline(This,pName,pDesc,riid,ppPipelineState) ) + +#define ID3D12PipelineLibrary1_LoadComputePipeline(This,pName,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> LoadComputePipeline(This,pName,pDesc,riid,ppPipelineState) ) + +#define ID3D12PipelineLibrary1_GetSerializedSize(This) \ + ( (This)->lpVtbl -> GetSerializedSize(This) ) + +#define ID3D12PipelineLibrary1_Serialize(This,pData,DataSizeInBytes) \ + ( (This)->lpVtbl -> Serialize(This,pData,DataSizeInBytes) ) + + +#define ID3D12PipelineLibrary1_LoadPipeline(This,pName,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> LoadPipeline(This,pName,pDesc,riid,ppPipelineState) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12PipelineLibrary1_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0023 */ +/* [local] */ + +typedef +enum D3D12_MULTIPLE_FENCE_WAIT_FLAGS + { + D3D12_MULTIPLE_FENCE_WAIT_FLAG_NONE = 0, + D3D12_MULTIPLE_FENCE_WAIT_FLAG_ANY = 0x1, + D3D12_MULTIPLE_FENCE_WAIT_FLAG_ALL = 0 + } D3D12_MULTIPLE_FENCE_WAIT_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_MULTIPLE_FENCE_WAIT_FLAGS ); +typedef +enum D3D12_RESIDENCY_PRIORITY + { + D3D12_RESIDENCY_PRIORITY_MINIMUM = 0x28000000, + D3D12_RESIDENCY_PRIORITY_LOW = 0x50000000, + D3D12_RESIDENCY_PRIORITY_NORMAL = 0x78000000, + D3D12_RESIDENCY_PRIORITY_HIGH = 0xa0010000, + D3D12_RESIDENCY_PRIORITY_MAXIMUM = 0xc8000000 + } D3D12_RESIDENCY_PRIORITY; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0023_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0023_v0_0_s_ifspec; + +#ifndef __ID3D12Device1_INTERFACE_DEFINED__ +#define __ID3D12Device1_INTERFACE_DEFINED__ + +/* interface ID3D12Device1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Device1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("77acce80-638e-4e65-8895-c1f23386863e") + ID3D12Device1 : public ID3D12Device + { + public: + virtual HRESULT STDMETHODCALLTYPE CreatePipelineLibrary( + _In_reads_(BlobLength) const void *pLibraryBlob, + SIZE_T BlobLength, + REFIID riid, + _COM_Outptr_ void **ppPipelineLibrary) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetEventOnMultipleFenceCompletion( + _In_reads_(NumFences) ID3D12Fence *const *ppFences, + _In_reads_(NumFences) const UINT64 *pFenceValues, + UINT NumFences, + D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags, + HANDLE hEvent) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetResidencyPriority( + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Device1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Device1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Device1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Device1 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Device1 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Device1 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Device1 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Device1 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount) + UINT ( STDMETHODCALLTYPE *GetNodeCount )( + ID3D12Device1 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )( + ID3D12Device1 * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator) + HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )( + ID3D12Device1 * This, + _In_ D3D12_COMMAND_LIST_TYPE type, + REFIID riid, + _COM_Outptr_ void **ppCommandAllocator); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )( + ID3D12Device1 * This, + _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )( + ID3D12Device1 * This, + _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList )( + ID3D12Device1 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ ID3D12CommandAllocator *pCommandAllocator, + _In_opt_ ID3D12PipelineState *pInitialState, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport) + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D12Device1 * This, + D3D12_FEATURE Feature, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap) + HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )( + ID3D12Device1 * This, + _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize) + UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )( + ID3D12Device1 * This, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature) + HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )( + ID3D12Device1 * This, + _In_ UINT nodeMask, + _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature, + _In_ SIZE_T blobLengthInBytes, + REFIID riid, + _COM_Outptr_ void **ppvRootSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView) + void ( STDMETHODCALLTYPE *CreateConstantBufferView )( + ID3D12Device1 * This, + _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView) + void ( STDMETHODCALLTYPE *CreateShaderResourceView )( + ID3D12Device1 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )( + ID3D12Device1 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ ID3D12Resource *pCounterResource, + _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView) + void ( STDMETHODCALLTYPE *CreateRenderTargetView )( + ID3D12Device1 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView) + void ( STDMETHODCALLTYPE *CreateDepthStencilView )( + ID3D12Device1 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler) + void ( STDMETHODCALLTYPE *CreateSampler )( + ID3D12Device1 * This, + _In_ const D3D12_SAMPLER_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors) + void ( STDMETHODCALLTYPE *CopyDescriptors )( + ID3D12Device1 * This, + _In_ UINT NumDestDescriptorRanges, + _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts, + _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes, + _In_ UINT NumSrcDescriptorRanges, + _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts, + _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple) + void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )( + ID3D12Device1 * This, + _In_ UINT NumDescriptors, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device1 * This, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device1 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties) +#if !defined(_WIN32) + D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device1 * This, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#else + D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device1 * This, + D3D12_HEAP_PROPERTIES * RetVal, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )( + ID3D12Device1 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap) + HRESULT ( STDMETHODCALLTYPE *CreateHeap )( + ID3D12Device1 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )( + ID3D12Device1 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )( + ID3D12Device1 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle) + HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )( + ID3D12Device1 * This, + _In_ ID3D12DeviceChild *pObject, + _In_opt_ const SECURITY_ATTRIBUTES *pAttributes, + DWORD Access, + _In_opt_ LPCWSTR Name, + _Out_ HANDLE *pHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )( + ID3D12Device1 * This, + _In_ HANDLE NTHandle, + REFIID riid, + _COM_Outptr_opt_ void **ppvObj); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )( + ID3D12Device1 * This, + _In_ LPCWSTR Name, + DWORD Access, + /* [annotation][out] */ + _Out_ HANDLE *pNTHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, MakeResident) + HRESULT ( STDMETHODCALLTYPE *MakeResident )( + ID3D12Device1 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, Evict) + HRESULT ( STDMETHODCALLTYPE *Evict )( + ID3D12Device1 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateFence) + HRESULT ( STDMETHODCALLTYPE *CreateFence )( + ID3D12Device1 * This, + UINT64 InitialValue, + D3D12_FENCE_FLAGS Flags, + REFIID riid, + _COM_Outptr_ void **ppFence); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason) + HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( + ID3D12Device1 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints) + void ( STDMETHODCALLTYPE *GetCopyableFootprints )( + ID3D12Device1 * This, + _In_ const D3D12_RESOURCE_DESC *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap) + HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )( + ID3D12Device1 * This, + _In_ const D3D12_QUERY_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState) + HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )( + ID3D12Device1 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature) + HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )( + ID3D12Device1 * This, + _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc, + _In_opt_ ID3D12RootSignature *pRootSignature, + REFIID riid, + _COM_Outptr_opt_ void **ppvCommandSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling) + void ( STDMETHODCALLTYPE *GetResourceTiling )( + ID3D12Device1 * This, + _In_ ID3D12Resource *pTiledResource, + _Out_opt_ UINT *pNumTilesForEntireResource, + _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc, + _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips, + _Inout_opt_ UINT *pNumSubresourceTilings, + _In_ UINT FirstSubresourceTilingToGet, + _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips); + + DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid) +#if !defined(_WIN32) + LUID ( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device1 * This); + +#else + LUID *( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device1 * This, + LUID * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )( + ID3D12Device1 * This, + _In_reads_(BlobLength) const void *pLibraryBlob, + SIZE_T BlobLength, + REFIID riid, + _COM_Outptr_ void **ppPipelineLibrary); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion) + HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )( + ID3D12Device1 * This, + _In_reads_(NumFences) ID3D12Fence *const *ppFences, + _In_reads_(NumFences) const UINT64 *pFenceValues, + UINT NumFences, + D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags, + HANDLE hEvent); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority) + HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )( + ID3D12Device1 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities); + + END_INTERFACE + } ID3D12Device1Vtbl; + + interface ID3D12Device1 + { + CONST_VTBL struct ID3D12Device1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Device1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Device1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Device1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Device1_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Device1_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Device1_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Device1_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Device1_GetNodeCount(This) \ + ( (This)->lpVtbl -> GetNodeCount(This) ) + +#define ID3D12Device1_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) ) + +#define ID3D12Device1_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ + ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) ) + +#define ID3D12Device1_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device1_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device1_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) ) + +#define ID3D12Device1_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) ) + +#define ID3D12Device1_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) ) + +#define ID3D12Device1_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ + ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) ) + +#define ID3D12Device1_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ + ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) ) + +#define ID3D12Device1_CreateConstantBufferView(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) ) + +#define ID3D12Device1_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device1_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) ) + +#define ID3D12Device1_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device1_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device1_CreateSampler(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) ) + +#define ID3D12Device1_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) ) + +#define ID3D12Device1_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) ) +#if !defined(_WIN32) + +#define ID3D12Device1_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) ) +#else +#define ID3D12Device1_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) ) +#endif +#if !defined(_WIN32) + +#define ID3D12Device1_GetCustomHeapProperties(This,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) ) +#else +#define ID3D12Device1_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) ) +#endif + +#define ID3D12Device1_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) ) + +#define ID3D12Device1_CreateHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device1_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device1_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device1_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ + ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) ) + +#define ID3D12Device1_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ + ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) ) + +#define ID3D12Device1_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ + ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) ) + +#define ID3D12Device1_MakeResident(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) ) + +#define ID3D12Device1_Evict(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) ) + +#define ID3D12Device1_CreateFence(This,InitialValue,Flags,riid,ppFence) \ + ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) ) + +#define ID3D12Device1_GetDeviceRemovedReason(This) \ + ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) + +#define ID3D12Device1_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) + +#define ID3D12Device1_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device1_SetStablePowerState(This,Enable) \ + ( (This)->lpVtbl -> SetStablePowerState(This,Enable) ) + +#define ID3D12Device1_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ + ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) ) + +#define ID3D12Device1_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ + ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) ) +#if !defined(_WIN32) + +#define ID3D12Device1_GetAdapterLuid(This) \ + ( (This)->lpVtbl -> GetAdapterLuid(This) ) +#else +#define ID3D12Device1_GetAdapterLuid(This,RetVal) \ + ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) ) +#endif + + +#define ID3D12Device1_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \ + ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) ) + +#define ID3D12Device1_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \ + ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) ) + +#define ID3D12Device1_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \ + ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Device1_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Device2_INTERFACE_DEFINED__ +#define __ID3D12Device2_INTERFACE_DEFINED__ + +/* interface ID3D12Device2 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Device2; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("30baa41e-b15b-475c-a0bb-1af5c5b64328") + ID3D12Device2 : public ID3D12Device1 + { + public: + virtual HRESULT STDMETHODCALLTYPE CreatePipelineState( + const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Device2Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Device2 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Device2 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Device2 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Device2 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Device2 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Device2 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Device2 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount) + UINT ( STDMETHODCALLTYPE *GetNodeCount )( + ID3D12Device2 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )( + ID3D12Device2 * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator) + HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )( + ID3D12Device2 * This, + _In_ D3D12_COMMAND_LIST_TYPE type, + REFIID riid, + _COM_Outptr_ void **ppCommandAllocator); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )( + ID3D12Device2 * This, + _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )( + ID3D12Device2 * This, + _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList )( + ID3D12Device2 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ ID3D12CommandAllocator *pCommandAllocator, + _In_opt_ ID3D12PipelineState *pInitialState, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport) + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D12Device2 * This, + D3D12_FEATURE Feature, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap) + HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )( + ID3D12Device2 * This, + _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize) + UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )( + ID3D12Device2 * This, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature) + HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )( + ID3D12Device2 * This, + _In_ UINT nodeMask, + _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature, + _In_ SIZE_T blobLengthInBytes, + REFIID riid, + _COM_Outptr_ void **ppvRootSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView) + void ( STDMETHODCALLTYPE *CreateConstantBufferView )( + ID3D12Device2 * This, + _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView) + void ( STDMETHODCALLTYPE *CreateShaderResourceView )( + ID3D12Device2 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )( + ID3D12Device2 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ ID3D12Resource *pCounterResource, + _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView) + void ( STDMETHODCALLTYPE *CreateRenderTargetView )( + ID3D12Device2 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView) + void ( STDMETHODCALLTYPE *CreateDepthStencilView )( + ID3D12Device2 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler) + void ( STDMETHODCALLTYPE *CreateSampler )( + ID3D12Device2 * This, + _In_ const D3D12_SAMPLER_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors) + void ( STDMETHODCALLTYPE *CopyDescriptors )( + ID3D12Device2 * This, + _In_ UINT NumDestDescriptorRanges, + _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts, + _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes, + _In_ UINT NumSrcDescriptorRanges, + _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts, + _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple) + void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )( + ID3D12Device2 * This, + _In_ UINT NumDescriptors, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device2 * This, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device2 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties) +#if !defined(_WIN32) + D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device2 * This, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#else + D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device2 * This, + D3D12_HEAP_PROPERTIES * RetVal, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )( + ID3D12Device2 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap) + HRESULT ( STDMETHODCALLTYPE *CreateHeap )( + ID3D12Device2 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )( + ID3D12Device2 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )( + ID3D12Device2 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle) + HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )( + ID3D12Device2 * This, + _In_ ID3D12DeviceChild *pObject, + _In_opt_ const SECURITY_ATTRIBUTES *pAttributes, + DWORD Access, + _In_opt_ LPCWSTR Name, + _Out_ HANDLE *pHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )( + ID3D12Device2 * This, + _In_ HANDLE NTHandle, + REFIID riid, + _COM_Outptr_opt_ void **ppvObj); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )( + ID3D12Device2 * This, + _In_ LPCWSTR Name, + DWORD Access, + /* [annotation][out] */ + _Out_ HANDLE *pNTHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, MakeResident) + HRESULT ( STDMETHODCALLTYPE *MakeResident )( + ID3D12Device2 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, Evict) + HRESULT ( STDMETHODCALLTYPE *Evict )( + ID3D12Device2 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateFence) + HRESULT ( STDMETHODCALLTYPE *CreateFence )( + ID3D12Device2 * This, + UINT64 InitialValue, + D3D12_FENCE_FLAGS Flags, + REFIID riid, + _COM_Outptr_ void **ppFence); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason) + HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( + ID3D12Device2 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints) + void ( STDMETHODCALLTYPE *GetCopyableFootprints )( + ID3D12Device2 * This, + _In_ const D3D12_RESOURCE_DESC *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap) + HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )( + ID3D12Device2 * This, + _In_ const D3D12_QUERY_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState) + HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )( + ID3D12Device2 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature) + HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )( + ID3D12Device2 * This, + _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc, + _In_opt_ ID3D12RootSignature *pRootSignature, + REFIID riid, + _COM_Outptr_opt_ void **ppvCommandSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling) + void ( STDMETHODCALLTYPE *GetResourceTiling )( + ID3D12Device2 * This, + _In_ ID3D12Resource *pTiledResource, + _Out_opt_ UINT *pNumTilesForEntireResource, + _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc, + _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips, + _Inout_opt_ UINT *pNumSubresourceTilings, + _In_ UINT FirstSubresourceTilingToGet, + _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips); + + DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid) +#if !defined(_WIN32) + LUID ( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device2 * This); + +#else + LUID *( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device2 * This, + LUID * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )( + ID3D12Device2 * This, + _In_reads_(BlobLength) const void *pLibraryBlob, + SIZE_T BlobLength, + REFIID riid, + _COM_Outptr_ void **ppPipelineLibrary); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion) + HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )( + ID3D12Device2 * This, + _In_reads_(NumFences) ID3D12Fence *const *ppFences, + _In_reads_(NumFences) const UINT64 *pFenceValues, + UINT NumFences, + D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags, + HANDLE hEvent); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority) + HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )( + ID3D12Device2 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities); + + DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )( + ID3D12Device2 * This, + const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + END_INTERFACE + } ID3D12Device2Vtbl; + + interface ID3D12Device2 + { + CONST_VTBL struct ID3D12Device2Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Device2_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Device2_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Device2_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Device2_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Device2_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Device2_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Device2_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Device2_GetNodeCount(This) \ + ( (This)->lpVtbl -> GetNodeCount(This) ) + +#define ID3D12Device2_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) ) + +#define ID3D12Device2_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ + ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) ) + +#define ID3D12Device2_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device2_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device2_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) ) + +#define ID3D12Device2_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) ) + +#define ID3D12Device2_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) ) + +#define ID3D12Device2_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ + ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) ) + +#define ID3D12Device2_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ + ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) ) + +#define ID3D12Device2_CreateConstantBufferView(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) ) + +#define ID3D12Device2_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device2_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) ) + +#define ID3D12Device2_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device2_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device2_CreateSampler(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) ) + +#define ID3D12Device2_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) ) + +#define ID3D12Device2_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) ) +#if !defined(_WIN32) + +#define ID3D12Device2_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) ) +#else +#define ID3D12Device2_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) ) +#endif +#if !defined(_WIN32) + +#define ID3D12Device2_GetCustomHeapProperties(This,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) ) +#else +#define ID3D12Device2_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) ) +#endif + +#define ID3D12Device2_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) ) + +#define ID3D12Device2_CreateHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device2_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device2_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device2_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ + ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) ) + +#define ID3D12Device2_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ + ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) ) + +#define ID3D12Device2_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ + ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) ) + +#define ID3D12Device2_MakeResident(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) ) + +#define ID3D12Device2_Evict(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) ) + +#define ID3D12Device2_CreateFence(This,InitialValue,Flags,riid,ppFence) \ + ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) ) + +#define ID3D12Device2_GetDeviceRemovedReason(This) \ + ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) + +#define ID3D12Device2_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) + +#define ID3D12Device2_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device2_SetStablePowerState(This,Enable) \ + ( (This)->lpVtbl -> SetStablePowerState(This,Enable) ) + +#define ID3D12Device2_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ + ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) ) + +#define ID3D12Device2_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ + ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) ) +#if !defined(_WIN32) + +#define ID3D12Device2_GetAdapterLuid(This) \ + ( (This)->lpVtbl -> GetAdapterLuid(This) ) +#else +#define ID3D12Device2_GetAdapterLuid(This,RetVal) \ + ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) ) +#endif + + +#define ID3D12Device2_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \ + ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) ) + +#define ID3D12Device2_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \ + ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) ) + +#define ID3D12Device2_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \ + ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) ) + + +#define ID3D12Device2_CreatePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Device2_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0025 */ +/* [local] */ + +typedef +enum D3D12_RESIDENCY_FLAGS + { + D3D12_RESIDENCY_FLAG_NONE = 0, + D3D12_RESIDENCY_FLAG_DENY_OVERBUDGET = 0x1 + } D3D12_RESIDENCY_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_RESIDENCY_FLAGS ); + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0025_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0025_v0_0_s_ifspec; + +#ifndef __ID3D12Device3_INTERFACE_DEFINED__ +#define __ID3D12Device3_INTERFACE_DEFINED__ + +/* interface ID3D12Device3 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Device3; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("81dadc15-2bad-4392-93c5-101345c4aa98") + ID3D12Device3 : public ID3D12Device2 + { + public: + virtual HRESULT STDMETHODCALLTYPE OpenExistingHeapFromAddress( + _In_ const void *pAddress, + REFIID riid, + _COM_Outptr_ void **ppvHeap) = 0; + + virtual HRESULT STDMETHODCALLTYPE OpenExistingHeapFromFileMapping( + _In_ HANDLE hFileMapping, + REFIID riid, + _COM_Outptr_ void **ppvHeap) = 0; + + virtual HRESULT STDMETHODCALLTYPE EnqueueMakeResident( + D3D12_RESIDENCY_FLAGS Flags, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_ ID3D12Fence *pFenceToSignal, + UINT64 FenceValueToSignal) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Device3Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Device3 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Device3 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Device3 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Device3 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Device3 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Device3 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Device3 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount) + UINT ( STDMETHODCALLTYPE *GetNodeCount )( + ID3D12Device3 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )( + ID3D12Device3 * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator) + HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )( + ID3D12Device3 * This, + _In_ D3D12_COMMAND_LIST_TYPE type, + REFIID riid, + _COM_Outptr_ void **ppCommandAllocator); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )( + ID3D12Device3 * This, + _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )( + ID3D12Device3 * This, + _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList )( + ID3D12Device3 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ ID3D12CommandAllocator *pCommandAllocator, + _In_opt_ ID3D12PipelineState *pInitialState, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport) + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D12Device3 * This, + D3D12_FEATURE Feature, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap) + HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )( + ID3D12Device3 * This, + _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize) + UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )( + ID3D12Device3 * This, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature) + HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )( + ID3D12Device3 * This, + _In_ UINT nodeMask, + _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature, + _In_ SIZE_T blobLengthInBytes, + REFIID riid, + _COM_Outptr_ void **ppvRootSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView) + void ( STDMETHODCALLTYPE *CreateConstantBufferView )( + ID3D12Device3 * This, + _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView) + void ( STDMETHODCALLTYPE *CreateShaderResourceView )( + ID3D12Device3 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )( + ID3D12Device3 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ ID3D12Resource *pCounterResource, + _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView) + void ( STDMETHODCALLTYPE *CreateRenderTargetView )( + ID3D12Device3 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView) + void ( STDMETHODCALLTYPE *CreateDepthStencilView )( + ID3D12Device3 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler) + void ( STDMETHODCALLTYPE *CreateSampler )( + ID3D12Device3 * This, + _In_ const D3D12_SAMPLER_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors) + void ( STDMETHODCALLTYPE *CopyDescriptors )( + ID3D12Device3 * This, + _In_ UINT NumDestDescriptorRanges, + _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts, + _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes, + _In_ UINT NumSrcDescriptorRanges, + _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts, + _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple) + void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )( + ID3D12Device3 * This, + _In_ UINT NumDescriptors, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device3 * This, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device3 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties) +#if !defined(_WIN32) + D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device3 * This, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#else + D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device3 * This, + D3D12_HEAP_PROPERTIES * RetVal, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )( + ID3D12Device3 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap) + HRESULT ( STDMETHODCALLTYPE *CreateHeap )( + ID3D12Device3 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )( + ID3D12Device3 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )( + ID3D12Device3 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle) + HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )( + ID3D12Device3 * This, + _In_ ID3D12DeviceChild *pObject, + _In_opt_ const SECURITY_ATTRIBUTES *pAttributes, + DWORD Access, + _In_opt_ LPCWSTR Name, + _Out_ HANDLE *pHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )( + ID3D12Device3 * This, + _In_ HANDLE NTHandle, + REFIID riid, + _COM_Outptr_opt_ void **ppvObj); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )( + ID3D12Device3 * This, + _In_ LPCWSTR Name, + DWORD Access, + /* [annotation][out] */ + _Out_ HANDLE *pNTHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, MakeResident) + HRESULT ( STDMETHODCALLTYPE *MakeResident )( + ID3D12Device3 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, Evict) + HRESULT ( STDMETHODCALLTYPE *Evict )( + ID3D12Device3 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateFence) + HRESULT ( STDMETHODCALLTYPE *CreateFence )( + ID3D12Device3 * This, + UINT64 InitialValue, + D3D12_FENCE_FLAGS Flags, + REFIID riid, + _COM_Outptr_ void **ppFence); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason) + HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( + ID3D12Device3 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints) + void ( STDMETHODCALLTYPE *GetCopyableFootprints )( + ID3D12Device3 * This, + _In_ const D3D12_RESOURCE_DESC *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap) + HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )( + ID3D12Device3 * This, + _In_ const D3D12_QUERY_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState) + HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )( + ID3D12Device3 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature) + HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )( + ID3D12Device3 * This, + _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc, + _In_opt_ ID3D12RootSignature *pRootSignature, + REFIID riid, + _COM_Outptr_opt_ void **ppvCommandSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling) + void ( STDMETHODCALLTYPE *GetResourceTiling )( + ID3D12Device3 * This, + _In_ ID3D12Resource *pTiledResource, + _Out_opt_ UINT *pNumTilesForEntireResource, + _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc, + _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips, + _Inout_opt_ UINT *pNumSubresourceTilings, + _In_ UINT FirstSubresourceTilingToGet, + _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips); + + DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid) +#if !defined(_WIN32) + LUID ( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device3 * This); + +#else + LUID *( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device3 * This, + LUID * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )( + ID3D12Device3 * This, + _In_reads_(BlobLength) const void *pLibraryBlob, + SIZE_T BlobLength, + REFIID riid, + _COM_Outptr_ void **ppPipelineLibrary); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion) + HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )( + ID3D12Device3 * This, + _In_reads_(NumFences) ID3D12Fence *const *ppFences, + _In_reads_(NumFences) const UINT64 *pFenceValues, + UINT NumFences, + D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags, + HANDLE hEvent); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority) + HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )( + ID3D12Device3 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities); + + DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )( + ID3D12Device3 * This, + const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )( + ID3D12Device3 * This, + _In_ const void *pAddress, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )( + ID3D12Device3 * This, + _In_ HANDLE hFileMapping, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident) + HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )( + ID3D12Device3 * This, + D3D12_RESIDENCY_FLAGS Flags, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_ ID3D12Fence *pFenceToSignal, + UINT64 FenceValueToSignal); + + END_INTERFACE + } ID3D12Device3Vtbl; + + interface ID3D12Device3 + { + CONST_VTBL struct ID3D12Device3Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Device3_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Device3_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Device3_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Device3_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Device3_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Device3_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Device3_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Device3_GetNodeCount(This) \ + ( (This)->lpVtbl -> GetNodeCount(This) ) + +#define ID3D12Device3_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) ) + +#define ID3D12Device3_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ + ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) ) + +#define ID3D12Device3_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device3_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device3_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) ) + +#define ID3D12Device3_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) ) + +#define ID3D12Device3_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) ) + +#define ID3D12Device3_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ + ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) ) + +#define ID3D12Device3_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ + ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) ) + +#define ID3D12Device3_CreateConstantBufferView(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) ) + +#define ID3D12Device3_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device3_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) ) + +#define ID3D12Device3_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device3_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device3_CreateSampler(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) ) + +#define ID3D12Device3_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) ) + +#define ID3D12Device3_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) ) +#if !defined(_WIN32) + +#define ID3D12Device3_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) ) +#else +#define ID3D12Device3_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) ) +#endif +#if !defined(_WIN32) + +#define ID3D12Device3_GetCustomHeapProperties(This,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) ) +#else +#define ID3D12Device3_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) ) +#endif + +#define ID3D12Device3_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) ) + +#define ID3D12Device3_CreateHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device3_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device3_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device3_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ + ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) ) + +#define ID3D12Device3_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ + ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) ) + +#define ID3D12Device3_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ + ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) ) + +#define ID3D12Device3_MakeResident(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) ) + +#define ID3D12Device3_Evict(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) ) + +#define ID3D12Device3_CreateFence(This,InitialValue,Flags,riid,ppFence) \ + ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) ) + +#define ID3D12Device3_GetDeviceRemovedReason(This) \ + ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) + +#define ID3D12Device3_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) + +#define ID3D12Device3_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device3_SetStablePowerState(This,Enable) \ + ( (This)->lpVtbl -> SetStablePowerState(This,Enable) ) + +#define ID3D12Device3_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ + ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) ) + +#define ID3D12Device3_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ + ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) ) +#if !defined(_WIN32) + +#define ID3D12Device3_GetAdapterLuid(This) \ + ( (This)->lpVtbl -> GetAdapterLuid(This) ) +#else +#define ID3D12Device3_GetAdapterLuid(This,RetVal) \ + ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) ) +#endif + + +#define ID3D12Device3_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \ + ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) ) + +#define ID3D12Device3_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \ + ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) ) + +#define ID3D12Device3_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \ + ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) ) + + +#define ID3D12Device3_CreatePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) ) + + +#define ID3D12Device3_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) ) + +#define ID3D12Device3_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) ) + +#define ID3D12Device3_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \ + ( (This)->lpVtbl -> EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Device3_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0026 */ +/* [local] */ + +typedef +enum D3D12_COMMAND_LIST_FLAGS + { + D3D12_COMMAND_LIST_FLAG_NONE = 0 + } D3D12_COMMAND_LIST_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMMAND_LIST_FLAGS ); +typedef +enum D3D12_COMMAND_POOL_FLAGS + { + D3D12_COMMAND_POOL_FLAG_NONE = 0 + } D3D12_COMMAND_POOL_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMMAND_POOL_FLAGS ); +typedef +enum D3D12_COMMAND_RECORDER_FLAGS + { + D3D12_COMMAND_RECORDER_FLAG_NONE = 0 + } D3D12_COMMAND_RECORDER_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMMAND_RECORDER_FLAGS ); +typedef +enum D3D12_PROTECTED_SESSION_STATUS + { + D3D12_PROTECTED_SESSION_STATUS_OK = 0, + D3D12_PROTECTED_SESSION_STATUS_INVALID = 1 + } D3D12_PROTECTED_SESSION_STATUS; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0026_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0026_v0_0_s_ifspec; + +#ifndef __ID3D12ProtectedSession_INTERFACE_DEFINED__ +#define __ID3D12ProtectedSession_INTERFACE_DEFINED__ + +/* interface ID3D12ProtectedSession */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12ProtectedSession; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("A1533D18-0AC1-4084-85B9-89A96116806B") + ID3D12ProtectedSession : public ID3D12DeviceChild + { + public: + virtual HRESULT STDMETHODCALLTYPE GetStatusFence( + REFIID riid, + _COM_Outptr_opt_ void **ppFence) = 0; + + virtual D3D12_PROTECTED_SESSION_STATUS STDMETHODCALLTYPE GetSessionStatus( void) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12ProtectedSessionVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12ProtectedSession * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12ProtectedSession * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12ProtectedSession * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12ProtectedSession * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12ProtectedSession * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12ProtectedSession * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12ProtectedSession * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12ProtectedSession * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12ProtectedSession, GetStatusFence) + HRESULT ( STDMETHODCALLTYPE *GetStatusFence )( + ID3D12ProtectedSession * This, + REFIID riid, + _COM_Outptr_opt_ void **ppFence); + + DECLSPEC_XFGVIRT(ID3D12ProtectedSession, GetSessionStatus) + D3D12_PROTECTED_SESSION_STATUS ( STDMETHODCALLTYPE *GetSessionStatus )( + ID3D12ProtectedSession * This); + + END_INTERFACE + } ID3D12ProtectedSessionVtbl; + + interface ID3D12ProtectedSession + { + CONST_VTBL struct ID3D12ProtectedSessionVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12ProtectedSession_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12ProtectedSession_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12ProtectedSession_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12ProtectedSession_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12ProtectedSession_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12ProtectedSession_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12ProtectedSession_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12ProtectedSession_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12ProtectedSession_GetStatusFence(This,riid,ppFence) \ + ( (This)->lpVtbl -> GetStatusFence(This,riid,ppFence) ) + +#define ID3D12ProtectedSession_GetSessionStatus(This) \ + ( (This)->lpVtbl -> GetSessionStatus(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12ProtectedSession_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0027 */ +/* [local] */ + +typedef +enum D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAGS + { + D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG_NONE = 0, + D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG_SUPPORTED = 0x1 + } D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAGS ); +typedef struct D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_SUPPORT + { + UINT NodeIndex; + D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAGS Support; + } D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_SUPPORT; + +typedef +enum D3D12_PROTECTED_RESOURCE_SESSION_FLAGS + { + D3D12_PROTECTED_RESOURCE_SESSION_FLAG_NONE = 0 + } D3D12_PROTECTED_RESOURCE_SESSION_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_PROTECTED_RESOURCE_SESSION_FLAGS ); +typedef struct D3D12_PROTECTED_RESOURCE_SESSION_DESC + { + UINT NodeMask; + D3D12_PROTECTED_RESOURCE_SESSION_FLAGS Flags; + } D3D12_PROTECTED_RESOURCE_SESSION_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0027_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0027_v0_0_s_ifspec; + +#ifndef __ID3D12ProtectedResourceSession_INTERFACE_DEFINED__ +#define __ID3D12ProtectedResourceSession_INTERFACE_DEFINED__ + +/* interface ID3D12ProtectedResourceSession */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12ProtectedResourceSession; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("6CD696F4-F289-40CC-8091-5A6C0A099C3D") + ID3D12ProtectedResourceSession : public ID3D12ProtectedSession + { + public: +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_PROTECTED_RESOURCE_SESSION_DESC STDMETHODCALLTYPE GetDesc( void) = 0; +#else + virtual D3D12_PROTECTED_RESOURCE_SESSION_DESC *STDMETHODCALLTYPE GetDesc( + D3D12_PROTECTED_RESOURCE_SESSION_DESC * RetVal) = 0; +#endif + + }; + + +#else /* C style interface */ + + typedef struct ID3D12ProtectedResourceSessionVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12ProtectedResourceSession * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12ProtectedResourceSession * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12ProtectedResourceSession * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12ProtectedResourceSession * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12ProtectedResourceSession * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12ProtectedResourceSession * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12ProtectedResourceSession * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12ProtectedResourceSession * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12ProtectedSession, GetStatusFence) + HRESULT ( STDMETHODCALLTYPE *GetStatusFence )( + ID3D12ProtectedResourceSession * This, + REFIID riid, + _COM_Outptr_opt_ void **ppFence); + + DECLSPEC_XFGVIRT(ID3D12ProtectedSession, GetSessionStatus) + D3D12_PROTECTED_SESSION_STATUS ( STDMETHODCALLTYPE *GetSessionStatus )( + ID3D12ProtectedResourceSession * This); + + DECLSPEC_XFGVIRT(ID3D12ProtectedResourceSession, GetDesc) +#if !defined(_WIN32) + D3D12_PROTECTED_RESOURCE_SESSION_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12ProtectedResourceSession * This); + +#else + D3D12_PROTECTED_RESOURCE_SESSION_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12ProtectedResourceSession * This, + D3D12_PROTECTED_RESOURCE_SESSION_DESC * RetVal); + +#endif + + END_INTERFACE + } ID3D12ProtectedResourceSessionVtbl; + + interface ID3D12ProtectedResourceSession + { + CONST_VTBL struct ID3D12ProtectedResourceSessionVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12ProtectedResourceSession_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12ProtectedResourceSession_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12ProtectedResourceSession_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12ProtectedResourceSession_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12ProtectedResourceSession_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12ProtectedResourceSession_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12ProtectedResourceSession_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12ProtectedResourceSession_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12ProtectedResourceSession_GetStatusFence(This,riid,ppFence) \ + ( (This)->lpVtbl -> GetStatusFence(This,riid,ppFence) ) + +#define ID3D12ProtectedResourceSession_GetSessionStatus(This) \ + ( (This)->lpVtbl -> GetSessionStatus(This) ) + +#if !defined(_WIN32) + +#define ID3D12ProtectedResourceSession_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) +#else +#define ID3D12ProtectedResourceSession_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) +#endif + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12ProtectedResourceSession_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Device4_INTERFACE_DEFINED__ +#define __ID3D12Device4_INTERFACE_DEFINED__ + +/* interface ID3D12Device4 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Device4; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("e865df17-a9ee-46f9-a463-3098315aa2e5") + ID3D12Device4 : public ID3D12Device3 + { + public: + virtual HRESULT STDMETHODCALLTYPE CreateCommandList1( + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ D3D12_COMMAND_LIST_FLAGS flags, + REFIID riid, + _COM_Outptr_ void **ppCommandList) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateProtectedResourceSession( + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateCommittedResource1( + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateHeap1( + _In_ const D3D12_HEAP_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateReservedResource1( + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource) = 0; + +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_RESOURCE_ALLOCATION_INFO STDMETHODCALLTYPE GetResourceAllocationInfo1( + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1) = 0; +#else + virtual D3D12_RESOURCE_ALLOCATION_INFO *STDMETHODCALLTYPE GetResourceAllocationInfo1( + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1) = 0; +#endif + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Device4Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Device4 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Device4 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Device4 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Device4 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Device4 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Device4 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Device4 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount) + UINT ( STDMETHODCALLTYPE *GetNodeCount )( + ID3D12Device4 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )( + ID3D12Device4 * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator) + HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )( + ID3D12Device4 * This, + _In_ D3D12_COMMAND_LIST_TYPE type, + REFIID riid, + _COM_Outptr_ void **ppCommandAllocator); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )( + ID3D12Device4 * This, + _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )( + ID3D12Device4 * This, + _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList )( + ID3D12Device4 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ ID3D12CommandAllocator *pCommandAllocator, + _In_opt_ ID3D12PipelineState *pInitialState, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport) + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D12Device4 * This, + D3D12_FEATURE Feature, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap) + HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )( + ID3D12Device4 * This, + _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize) + UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )( + ID3D12Device4 * This, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature) + HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )( + ID3D12Device4 * This, + _In_ UINT nodeMask, + _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature, + _In_ SIZE_T blobLengthInBytes, + REFIID riid, + _COM_Outptr_ void **ppvRootSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView) + void ( STDMETHODCALLTYPE *CreateConstantBufferView )( + ID3D12Device4 * This, + _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView) + void ( STDMETHODCALLTYPE *CreateShaderResourceView )( + ID3D12Device4 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )( + ID3D12Device4 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ ID3D12Resource *pCounterResource, + _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView) + void ( STDMETHODCALLTYPE *CreateRenderTargetView )( + ID3D12Device4 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView) + void ( STDMETHODCALLTYPE *CreateDepthStencilView )( + ID3D12Device4 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler) + void ( STDMETHODCALLTYPE *CreateSampler )( + ID3D12Device4 * This, + _In_ const D3D12_SAMPLER_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors) + void ( STDMETHODCALLTYPE *CopyDescriptors )( + ID3D12Device4 * This, + _In_ UINT NumDestDescriptorRanges, + _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts, + _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes, + _In_ UINT NumSrcDescriptorRanges, + _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts, + _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple) + void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )( + ID3D12Device4 * This, + _In_ UINT NumDescriptors, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device4 * This, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device4 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties) +#if !defined(_WIN32) + D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device4 * This, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#else + D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device4 * This, + D3D12_HEAP_PROPERTIES * RetVal, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )( + ID3D12Device4 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap) + HRESULT ( STDMETHODCALLTYPE *CreateHeap )( + ID3D12Device4 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )( + ID3D12Device4 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )( + ID3D12Device4 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle) + HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )( + ID3D12Device4 * This, + _In_ ID3D12DeviceChild *pObject, + _In_opt_ const SECURITY_ATTRIBUTES *pAttributes, + DWORD Access, + _In_opt_ LPCWSTR Name, + _Out_ HANDLE *pHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )( + ID3D12Device4 * This, + _In_ HANDLE NTHandle, + REFIID riid, + _COM_Outptr_opt_ void **ppvObj); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )( + ID3D12Device4 * This, + _In_ LPCWSTR Name, + DWORD Access, + /* [annotation][out] */ + _Out_ HANDLE *pNTHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, MakeResident) + HRESULT ( STDMETHODCALLTYPE *MakeResident )( + ID3D12Device4 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, Evict) + HRESULT ( STDMETHODCALLTYPE *Evict )( + ID3D12Device4 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateFence) + HRESULT ( STDMETHODCALLTYPE *CreateFence )( + ID3D12Device4 * This, + UINT64 InitialValue, + D3D12_FENCE_FLAGS Flags, + REFIID riid, + _COM_Outptr_ void **ppFence); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason) + HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( + ID3D12Device4 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints) + void ( STDMETHODCALLTYPE *GetCopyableFootprints )( + ID3D12Device4 * This, + _In_ const D3D12_RESOURCE_DESC *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap) + HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )( + ID3D12Device4 * This, + _In_ const D3D12_QUERY_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState) + HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )( + ID3D12Device4 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature) + HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )( + ID3D12Device4 * This, + _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc, + _In_opt_ ID3D12RootSignature *pRootSignature, + REFIID riid, + _COM_Outptr_opt_ void **ppvCommandSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling) + void ( STDMETHODCALLTYPE *GetResourceTiling )( + ID3D12Device4 * This, + _In_ ID3D12Resource *pTiledResource, + _Out_opt_ UINT *pNumTilesForEntireResource, + _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc, + _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips, + _Inout_opt_ UINT *pNumSubresourceTilings, + _In_ UINT FirstSubresourceTilingToGet, + _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips); + + DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid) +#if !defined(_WIN32) + LUID ( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device4 * This); + +#else + LUID *( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device4 * This, + LUID * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )( + ID3D12Device4 * This, + _In_reads_(BlobLength) const void *pLibraryBlob, + SIZE_T BlobLength, + REFIID riid, + _COM_Outptr_ void **ppPipelineLibrary); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion) + HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )( + ID3D12Device4 * This, + _In_reads_(NumFences) ID3D12Fence *const *ppFences, + _In_reads_(NumFences) const UINT64 *pFenceValues, + UINT NumFences, + D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags, + HANDLE hEvent); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority) + HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )( + ID3D12Device4 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities); + + DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )( + ID3D12Device4 * This, + const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )( + ID3D12Device4 * This, + _In_ const void *pAddress, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )( + ID3D12Device4 * This, + _In_ HANDLE hFileMapping, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident) + HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )( + ID3D12Device4 * This, + D3D12_RESIDENCY_FLAGS Flags, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_ ID3D12Fence *pFenceToSignal, + UINT64 FenceValueToSignal); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommandList1) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList1 )( + ID3D12Device4 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ D3D12_COMMAND_LIST_FLAGS flags, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession )( + ID3D12Device4 * This, + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommittedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource1 )( + ID3D12Device4 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateHeap1) + HRESULT ( STDMETHODCALLTYPE *CreateHeap1 )( + ID3D12Device4 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateReservedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource1 )( + ID3D12Device4 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, GetResourceAllocationInfo1) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device4 * This, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device4 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#endif + + END_INTERFACE + } ID3D12Device4Vtbl; + + interface ID3D12Device4 + { + CONST_VTBL struct ID3D12Device4Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Device4_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Device4_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Device4_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Device4_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Device4_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Device4_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Device4_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Device4_GetNodeCount(This) \ + ( (This)->lpVtbl -> GetNodeCount(This) ) + +#define ID3D12Device4_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) ) + +#define ID3D12Device4_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ + ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) ) + +#define ID3D12Device4_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device4_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device4_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) ) + +#define ID3D12Device4_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) ) + +#define ID3D12Device4_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) ) + +#define ID3D12Device4_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ + ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) ) + +#define ID3D12Device4_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ + ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) ) + +#define ID3D12Device4_CreateConstantBufferView(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) ) + +#define ID3D12Device4_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device4_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) ) + +#define ID3D12Device4_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device4_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device4_CreateSampler(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) ) + +#define ID3D12Device4_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) ) + +#define ID3D12Device4_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) ) +#if !defined(_WIN32) + +#define ID3D12Device4_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) ) +#else +#define ID3D12Device4_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) ) +#endif +#if !defined(_WIN32) + +#define ID3D12Device4_GetCustomHeapProperties(This,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) ) +#else +#define ID3D12Device4_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) ) +#endif + +#define ID3D12Device4_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) ) + +#define ID3D12Device4_CreateHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device4_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device4_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device4_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ + ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) ) + +#define ID3D12Device4_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ + ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) ) + +#define ID3D12Device4_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ + ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) ) + +#define ID3D12Device4_MakeResident(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) ) + +#define ID3D12Device4_Evict(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) ) + +#define ID3D12Device4_CreateFence(This,InitialValue,Flags,riid,ppFence) \ + ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) ) + +#define ID3D12Device4_GetDeviceRemovedReason(This) \ + ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) + +#define ID3D12Device4_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) + +#define ID3D12Device4_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device4_SetStablePowerState(This,Enable) \ + ( (This)->lpVtbl -> SetStablePowerState(This,Enable) ) + +#define ID3D12Device4_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ + ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) ) + +#define ID3D12Device4_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ + ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) ) +#if !defined(_WIN32) + +#define ID3D12Device4_GetAdapterLuid(This) \ + ( (This)->lpVtbl -> GetAdapterLuid(This) ) +#else +#define ID3D12Device4_GetAdapterLuid(This,RetVal) \ + ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) ) +#endif + + +#define ID3D12Device4_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \ + ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) ) + +#define ID3D12Device4_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \ + ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) ) + +#define ID3D12Device4_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \ + ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) ) + + +#define ID3D12Device4_CreatePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) ) + + +#define ID3D12Device4_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) ) + +#define ID3D12Device4_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) ) + +#define ID3D12Device4_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \ + ( (This)->lpVtbl -> EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) ) + + +#define ID3D12Device4_CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) ) + +#define ID3D12Device4_CreateProtectedResourceSession(This,pDesc,riid,ppSession) \ + ( (This)->lpVtbl -> CreateProtectedResourceSession(This,pDesc,riid,ppSession) ) + +#define ID3D12Device4_CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) + +#define ID3D12Device4_CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) ) + +#define ID3D12Device4_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) ) +#if !defined(_WIN32) + +#define ID3D12Device4_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#else +#define ID3D12Device4_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#endif + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Device4_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0029 */ +/* [local] */ + +typedef +enum D3D12_LIFETIME_STATE + { + D3D12_LIFETIME_STATE_IN_USE = 0, + D3D12_LIFETIME_STATE_NOT_IN_USE = ( D3D12_LIFETIME_STATE_IN_USE + 1 ) + } D3D12_LIFETIME_STATE; + + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0029_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0029_v0_0_s_ifspec; + +#ifndef __ID3D12LifetimeOwner_INTERFACE_DEFINED__ +#define __ID3D12LifetimeOwner_INTERFACE_DEFINED__ + +/* interface ID3D12LifetimeOwner */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12LifetimeOwner; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("e667af9f-cd56-4f46-83ce-032e595d70a8") + ID3D12LifetimeOwner : public IUnknown + { + public: + virtual void STDMETHODCALLTYPE LifetimeStateUpdated( + D3D12_LIFETIME_STATE NewState) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12LifetimeOwnerVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12LifetimeOwner * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12LifetimeOwner * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12LifetimeOwner * This); + + DECLSPEC_XFGVIRT(ID3D12LifetimeOwner, LifetimeStateUpdated) + void ( STDMETHODCALLTYPE *LifetimeStateUpdated )( + ID3D12LifetimeOwner * This, + D3D12_LIFETIME_STATE NewState); + + END_INTERFACE + } ID3D12LifetimeOwnerVtbl; + + interface ID3D12LifetimeOwner + { + CONST_VTBL struct ID3D12LifetimeOwnerVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12LifetimeOwner_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12LifetimeOwner_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12LifetimeOwner_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12LifetimeOwner_LifetimeStateUpdated(This,NewState) \ + ( (This)->lpVtbl -> LifetimeStateUpdated(This,NewState) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12LifetimeOwner_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12SwapChainAssistant_INTERFACE_DEFINED__ +#define __ID3D12SwapChainAssistant_INTERFACE_DEFINED__ + +/* interface ID3D12SwapChainAssistant */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12SwapChainAssistant; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("f1df64b6-57fd-49cd-8807-c0eb88b45c8f") + ID3D12SwapChainAssistant : public IUnknown + { + public: +#if defined(_MSC_VER) || !defined(_WIN32) + virtual LUID STDMETHODCALLTYPE GetLUID( void) = 0; +#else + virtual LUID *STDMETHODCALLTYPE GetLUID( + LUID * RetVal) = 0; +#endif + + virtual HRESULT STDMETHODCALLTYPE GetSwapChainObject( + REFIID riid, + _COM_Outptr_ void **ppv) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetCurrentResourceAndCommandQueue( + REFIID riidResource, + _COM_Outptr_ void **ppvResource, + REFIID riidQueue, + _COM_Outptr_ void **ppvQueue) = 0; + + virtual HRESULT STDMETHODCALLTYPE InsertImplicitSync( void) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12SwapChainAssistantVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12SwapChainAssistant * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12SwapChainAssistant * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12SwapChainAssistant * This); + + DECLSPEC_XFGVIRT(ID3D12SwapChainAssistant, GetLUID) +#if !defined(_WIN32) + LUID ( STDMETHODCALLTYPE *GetLUID )( + ID3D12SwapChainAssistant * This); + +#else + LUID *( STDMETHODCALLTYPE *GetLUID )( + ID3D12SwapChainAssistant * This, + LUID * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12SwapChainAssistant, GetSwapChainObject) + HRESULT ( STDMETHODCALLTYPE *GetSwapChainObject )( + ID3D12SwapChainAssistant * This, + REFIID riid, + _COM_Outptr_ void **ppv); + + DECLSPEC_XFGVIRT(ID3D12SwapChainAssistant, GetCurrentResourceAndCommandQueue) + HRESULT ( STDMETHODCALLTYPE *GetCurrentResourceAndCommandQueue )( + ID3D12SwapChainAssistant * This, + REFIID riidResource, + _COM_Outptr_ void **ppvResource, + REFIID riidQueue, + _COM_Outptr_ void **ppvQueue); + + DECLSPEC_XFGVIRT(ID3D12SwapChainAssistant, InsertImplicitSync) + HRESULT ( STDMETHODCALLTYPE *InsertImplicitSync )( + ID3D12SwapChainAssistant * This); + + END_INTERFACE + } ID3D12SwapChainAssistantVtbl; + + interface ID3D12SwapChainAssistant + { + CONST_VTBL struct ID3D12SwapChainAssistantVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12SwapChainAssistant_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12SwapChainAssistant_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12SwapChainAssistant_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + +#if !defined(_WIN32) + +#define ID3D12SwapChainAssistant_GetLUID(This) \ + ( (This)->lpVtbl -> GetLUID(This) ) +#else +#define ID3D12SwapChainAssistant_GetLUID(This,RetVal) \ + ( (This)->lpVtbl -> GetLUID(This,RetVal) ) +#endif + +#define ID3D12SwapChainAssistant_GetSwapChainObject(This,riid,ppv) \ + ( (This)->lpVtbl -> GetSwapChainObject(This,riid,ppv) ) + +#define ID3D12SwapChainAssistant_GetCurrentResourceAndCommandQueue(This,riidResource,ppvResource,riidQueue,ppvQueue) \ + ( (This)->lpVtbl -> GetCurrentResourceAndCommandQueue(This,riidResource,ppvResource,riidQueue,ppvQueue) ) + +#define ID3D12SwapChainAssistant_InsertImplicitSync(This) \ + ( (This)->lpVtbl -> InsertImplicitSync(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12SwapChainAssistant_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12LifetimeTracker_INTERFACE_DEFINED__ +#define __ID3D12LifetimeTracker_INTERFACE_DEFINED__ + +/* interface ID3D12LifetimeTracker */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12LifetimeTracker; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("3fd03d36-4eb1-424a-a582-494ecb8ba813") + ID3D12LifetimeTracker : public ID3D12DeviceChild + { + public: + virtual HRESULT STDMETHODCALLTYPE DestroyOwnedObject( + _In_ ID3D12DeviceChild *pObject) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12LifetimeTrackerVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12LifetimeTracker * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12LifetimeTracker * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12LifetimeTracker * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12LifetimeTracker * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12LifetimeTracker * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12LifetimeTracker * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12LifetimeTracker * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12LifetimeTracker * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12LifetimeTracker, DestroyOwnedObject) + HRESULT ( STDMETHODCALLTYPE *DestroyOwnedObject )( + ID3D12LifetimeTracker * This, + _In_ ID3D12DeviceChild *pObject); + + END_INTERFACE + } ID3D12LifetimeTrackerVtbl; + + interface ID3D12LifetimeTracker + { + CONST_VTBL struct ID3D12LifetimeTrackerVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12LifetimeTracker_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12LifetimeTracker_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12LifetimeTracker_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12LifetimeTracker_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12LifetimeTracker_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12LifetimeTracker_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12LifetimeTracker_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12LifetimeTracker_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12LifetimeTracker_DestroyOwnedObject(This,pObject) \ + ( (This)->lpVtbl -> DestroyOwnedObject(This,pObject) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12LifetimeTracker_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0032 */ +/* [local] */ + +typedef +enum D3D12_META_COMMAND_PARAMETER_TYPE + { + D3D12_META_COMMAND_PARAMETER_TYPE_FLOAT = 0, + D3D12_META_COMMAND_PARAMETER_TYPE_UINT64 = 1, + D3D12_META_COMMAND_PARAMETER_TYPE_GPU_VIRTUAL_ADDRESS = 2, + D3D12_META_COMMAND_PARAMETER_TYPE_CPU_DESCRIPTOR_HANDLE_HEAP_TYPE_CBV_SRV_UAV = 3, + D3D12_META_COMMAND_PARAMETER_TYPE_GPU_DESCRIPTOR_HANDLE_HEAP_TYPE_CBV_SRV_UAV = 4 + } D3D12_META_COMMAND_PARAMETER_TYPE; + +typedef +enum D3D12_META_COMMAND_PARAMETER_FLAGS + { + D3D12_META_COMMAND_PARAMETER_FLAG_INPUT = 0x1, + D3D12_META_COMMAND_PARAMETER_FLAG_OUTPUT = 0x2 + } D3D12_META_COMMAND_PARAMETER_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_META_COMMAND_PARAMETER_FLAGS ); +typedef +enum D3D12_META_COMMAND_PARAMETER_STAGE + { + D3D12_META_COMMAND_PARAMETER_STAGE_CREATION = 0, + D3D12_META_COMMAND_PARAMETER_STAGE_INITIALIZATION = 1, + D3D12_META_COMMAND_PARAMETER_STAGE_EXECUTION = 2 + } D3D12_META_COMMAND_PARAMETER_STAGE; + +typedef struct D3D12_META_COMMAND_PARAMETER_DESC + { + LPCWSTR Name; + D3D12_META_COMMAND_PARAMETER_TYPE Type; + D3D12_META_COMMAND_PARAMETER_FLAGS Flags; + D3D12_RESOURCE_STATES RequiredResourceState; + UINT StructureOffset; + } D3D12_META_COMMAND_PARAMETER_DESC; + +typedef +enum D3D12_GRAPHICS_STATES + { + D3D12_GRAPHICS_STATE_NONE = 0, + D3D12_GRAPHICS_STATE_IA_VERTEX_BUFFERS = ( 1 << 0 ) , + D3D12_GRAPHICS_STATE_IA_INDEX_BUFFER = ( 1 << 1 ) , + D3D12_GRAPHICS_STATE_IA_PRIMITIVE_TOPOLOGY = ( 1 << 2 ) , + D3D12_GRAPHICS_STATE_DESCRIPTOR_HEAP = ( 1 << 3 ) , + D3D12_GRAPHICS_STATE_GRAPHICS_ROOT_SIGNATURE = ( 1 << 4 ) , + D3D12_GRAPHICS_STATE_COMPUTE_ROOT_SIGNATURE = ( 1 << 5 ) , + D3D12_GRAPHICS_STATE_RS_VIEWPORTS = ( 1 << 6 ) , + D3D12_GRAPHICS_STATE_RS_SCISSOR_RECTS = ( 1 << 7 ) , + D3D12_GRAPHICS_STATE_PREDICATION = ( 1 << 8 ) , + D3D12_GRAPHICS_STATE_OM_RENDER_TARGETS = ( 1 << 9 ) , + D3D12_GRAPHICS_STATE_OM_STENCIL_REF = ( 1 << 10 ) , + D3D12_GRAPHICS_STATE_OM_BLEND_FACTOR = ( 1 << 11 ) , + D3D12_GRAPHICS_STATE_PIPELINE_STATE = ( 1 << 12 ) , + D3D12_GRAPHICS_STATE_SO_TARGETS = ( 1 << 13 ) , + D3D12_GRAPHICS_STATE_OM_DEPTH_BOUNDS = ( 1 << 14 ) , + D3D12_GRAPHICS_STATE_SAMPLE_POSITIONS = ( 1 << 15 ) , + D3D12_GRAPHICS_STATE_VIEW_INSTANCE_MASK = ( 1 << 16 ) + } D3D12_GRAPHICS_STATES; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_GRAPHICS_STATES ); +typedef struct D3D12_META_COMMAND_DESC + { + GUID Id; + LPCWSTR Name; + D3D12_GRAPHICS_STATES InitializationDirtyState; + D3D12_GRAPHICS_STATES ExecutionDirtyState; + } D3D12_META_COMMAND_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0032_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0032_v0_0_s_ifspec; + +#ifndef __ID3D12StateObject_INTERFACE_DEFINED__ +#define __ID3D12StateObject_INTERFACE_DEFINED__ + +/* interface ID3D12StateObject */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12StateObject; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("47016943-fca8-4594-93ea-af258b55346d") + ID3D12StateObject : public ID3D12Pageable + { + public: + }; + + +#else /* C style interface */ + + typedef struct ID3D12StateObjectVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12StateObject * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12StateObject * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12StateObject * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12StateObject * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12StateObject * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12StateObject * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12StateObject * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12StateObject * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + END_INTERFACE + } ID3D12StateObjectVtbl; + + interface ID3D12StateObject + { + CONST_VTBL struct ID3D12StateObjectVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12StateObject_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12StateObject_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12StateObject_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12StateObject_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12StateObject_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12StateObject_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12StateObject_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12StateObject_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12StateObject_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12StateObjectProperties_INTERFACE_DEFINED__ +#define __ID3D12StateObjectProperties_INTERFACE_DEFINED__ + +/* interface ID3D12StateObjectProperties */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12StateObjectProperties; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("de5fa827-9bf9-4f26-89ff-d7f56fde3860") + ID3D12StateObjectProperties : public IUnknown + { + public: + virtual void *STDMETHODCALLTYPE GetShaderIdentifier( + _In_ LPCWSTR pExportName) = 0; + + virtual UINT64 STDMETHODCALLTYPE GetShaderStackSize( + _In_ LPCWSTR pExportName) = 0; + + virtual UINT64 STDMETHODCALLTYPE GetPipelineStackSize( void) = 0; + + virtual void STDMETHODCALLTYPE SetPipelineStackSize( + UINT64 PipelineStackSizeInBytes) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12StateObjectPropertiesVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12StateObjectProperties * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12StateObjectProperties * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12StateObjectProperties * This); + + DECLSPEC_XFGVIRT(ID3D12StateObjectProperties, GetShaderIdentifier) + void *( STDMETHODCALLTYPE *GetShaderIdentifier )( + ID3D12StateObjectProperties * This, + _In_ LPCWSTR pExportName); + + DECLSPEC_XFGVIRT(ID3D12StateObjectProperties, GetShaderStackSize) + UINT64 ( STDMETHODCALLTYPE *GetShaderStackSize )( + ID3D12StateObjectProperties * This, + _In_ LPCWSTR pExportName); + + DECLSPEC_XFGVIRT(ID3D12StateObjectProperties, GetPipelineStackSize) + UINT64 ( STDMETHODCALLTYPE *GetPipelineStackSize )( + ID3D12StateObjectProperties * This); + + DECLSPEC_XFGVIRT(ID3D12StateObjectProperties, SetPipelineStackSize) + void ( STDMETHODCALLTYPE *SetPipelineStackSize )( + ID3D12StateObjectProperties * This, + UINT64 PipelineStackSizeInBytes); + + END_INTERFACE + } ID3D12StateObjectPropertiesVtbl; + + interface ID3D12StateObjectProperties + { + CONST_VTBL struct ID3D12StateObjectPropertiesVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12StateObjectProperties_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12StateObjectProperties_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12StateObjectProperties_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12StateObjectProperties_GetShaderIdentifier(This,pExportName) \ + ( (This)->lpVtbl -> GetShaderIdentifier(This,pExportName) ) + +#define ID3D12StateObjectProperties_GetShaderStackSize(This,pExportName) \ + ( (This)->lpVtbl -> GetShaderStackSize(This,pExportName) ) + +#define ID3D12StateObjectProperties_GetPipelineStackSize(This) \ + ( (This)->lpVtbl -> GetPipelineStackSize(This) ) + +#define ID3D12StateObjectProperties_SetPipelineStackSize(This,PipelineStackSizeInBytes) \ + ( (This)->lpVtbl -> SetPipelineStackSize(This,PipelineStackSizeInBytes) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12StateObjectProperties_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0034 */ +/* [local] */ + +typedef +enum D3D12_STATE_SUBOBJECT_TYPE + { + D3D12_STATE_SUBOBJECT_TYPE_STATE_OBJECT_CONFIG = 0, + D3D12_STATE_SUBOBJECT_TYPE_GLOBAL_ROOT_SIGNATURE = 1, + D3D12_STATE_SUBOBJECT_TYPE_LOCAL_ROOT_SIGNATURE = 2, + D3D12_STATE_SUBOBJECT_TYPE_NODE_MASK = 3, + D3D12_STATE_SUBOBJECT_TYPE_DXIL_LIBRARY = 5, + D3D12_STATE_SUBOBJECT_TYPE_EXISTING_COLLECTION = 6, + D3D12_STATE_SUBOBJECT_TYPE_SUBOBJECT_TO_EXPORTS_ASSOCIATION = 7, + D3D12_STATE_SUBOBJECT_TYPE_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION = 8, + D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_SHADER_CONFIG = 9, + D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_PIPELINE_CONFIG = 10, + D3D12_STATE_SUBOBJECT_TYPE_HIT_GROUP = 11, + D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_PIPELINE_CONFIG1 = 12, + D3D12_STATE_SUBOBJECT_TYPE_MAX_VALID = ( D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_PIPELINE_CONFIG1 + 1 ) + } D3D12_STATE_SUBOBJECT_TYPE; + +typedef struct D3D12_STATE_SUBOBJECT + { + D3D12_STATE_SUBOBJECT_TYPE Type; + const void *pDesc; + } D3D12_STATE_SUBOBJECT; + +typedef +enum D3D12_STATE_OBJECT_FLAGS + { + D3D12_STATE_OBJECT_FLAG_NONE = 0, + D3D12_STATE_OBJECT_FLAG_ALLOW_LOCAL_DEPENDENCIES_ON_EXTERNAL_DEFINITIONS = 0x1, + D3D12_STATE_OBJECT_FLAG_ALLOW_EXTERNAL_DEPENDENCIES_ON_LOCAL_DEFINITIONS = 0x2, + D3D12_STATE_OBJECT_FLAG_ALLOW_STATE_OBJECT_ADDITIONS = 0x4 + } D3D12_STATE_OBJECT_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_STATE_OBJECT_FLAGS ); +typedef struct D3D12_STATE_OBJECT_CONFIG + { + D3D12_STATE_OBJECT_FLAGS Flags; + } D3D12_STATE_OBJECT_CONFIG; + +typedef struct D3D12_GLOBAL_ROOT_SIGNATURE + { + ID3D12RootSignature *pGlobalRootSignature; + } D3D12_GLOBAL_ROOT_SIGNATURE; + +typedef struct D3D12_LOCAL_ROOT_SIGNATURE + { + ID3D12RootSignature *pLocalRootSignature; + } D3D12_LOCAL_ROOT_SIGNATURE; + +typedef struct D3D12_NODE_MASK + { + UINT NodeMask; + } D3D12_NODE_MASK; + +typedef +enum D3D12_EXPORT_FLAGS + { + D3D12_EXPORT_FLAG_NONE = 0 + } D3D12_EXPORT_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_EXPORT_FLAGS ); +typedef struct D3D12_EXPORT_DESC + { + LPCWSTR Name; + _In_opt_ LPCWSTR ExportToRename; + D3D12_EXPORT_FLAGS Flags; + } D3D12_EXPORT_DESC; + +typedef struct D3D12_DXIL_LIBRARY_DESC + { + D3D12_SHADER_BYTECODE DXILLibrary; + UINT NumExports; + _In_reads_(NumExports) D3D12_EXPORT_DESC *pExports; + } D3D12_DXIL_LIBRARY_DESC; + +typedef struct D3D12_EXISTING_COLLECTION_DESC + { + ID3D12StateObject *pExistingCollection; + UINT NumExports; + _In_reads_(NumExports) D3D12_EXPORT_DESC *pExports; + } D3D12_EXISTING_COLLECTION_DESC; + +typedef struct D3D12_SUBOBJECT_TO_EXPORTS_ASSOCIATION + { + const D3D12_STATE_SUBOBJECT *pSubobjectToAssociate; + UINT NumExports; + _In_reads_(NumExports) LPCWSTR *pExports; + } D3D12_SUBOBJECT_TO_EXPORTS_ASSOCIATION; + +typedef struct D3D12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION + { + LPCWSTR SubobjectToAssociate; + UINT NumExports; + _In_reads_(NumExports) LPCWSTR *pExports; + } D3D12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION; + +typedef +enum D3D12_HIT_GROUP_TYPE + { + D3D12_HIT_GROUP_TYPE_TRIANGLES = 0, + D3D12_HIT_GROUP_TYPE_PROCEDURAL_PRIMITIVE = 0x1 + } D3D12_HIT_GROUP_TYPE; + +typedef struct D3D12_HIT_GROUP_DESC + { + LPCWSTR HitGroupExport; + D3D12_HIT_GROUP_TYPE Type; + _In_opt_ LPCWSTR AnyHitShaderImport; + _In_opt_ LPCWSTR ClosestHitShaderImport; + _In_opt_ LPCWSTR IntersectionShaderImport; + } D3D12_HIT_GROUP_DESC; + +typedef struct D3D12_RAYTRACING_SHADER_CONFIG + { + UINT MaxPayloadSizeInBytes; + UINT MaxAttributeSizeInBytes; + } D3D12_RAYTRACING_SHADER_CONFIG; + +typedef struct D3D12_RAYTRACING_PIPELINE_CONFIG + { + UINT MaxTraceRecursionDepth; + } D3D12_RAYTRACING_PIPELINE_CONFIG; + +typedef +enum D3D12_RAYTRACING_PIPELINE_FLAGS + { + D3D12_RAYTRACING_PIPELINE_FLAG_NONE = 0, + D3D12_RAYTRACING_PIPELINE_FLAG_SKIP_TRIANGLES = 0x100, + D3D12_RAYTRACING_PIPELINE_FLAG_SKIP_PROCEDURAL_PRIMITIVES = 0x200 + } D3D12_RAYTRACING_PIPELINE_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_RAYTRACING_PIPELINE_FLAGS ); +typedef struct D3D12_RAYTRACING_PIPELINE_CONFIG1 + { + UINT MaxTraceRecursionDepth; + D3D12_RAYTRACING_PIPELINE_FLAGS Flags; + } D3D12_RAYTRACING_PIPELINE_CONFIG1; + +typedef +enum D3D12_STATE_OBJECT_TYPE + { + D3D12_STATE_OBJECT_TYPE_COLLECTION = 0, + D3D12_STATE_OBJECT_TYPE_RAYTRACING_PIPELINE = 3 + } D3D12_STATE_OBJECT_TYPE; + +typedef struct D3D12_STATE_OBJECT_DESC + { + D3D12_STATE_OBJECT_TYPE Type; + UINT NumSubobjects; + _In_reads_(NumSubobjects) const D3D12_STATE_SUBOBJECT *pSubobjects; + } D3D12_STATE_OBJECT_DESC; + +typedef +enum D3D12_RAYTRACING_GEOMETRY_FLAGS + { + D3D12_RAYTRACING_GEOMETRY_FLAG_NONE = 0, + D3D12_RAYTRACING_GEOMETRY_FLAG_OPAQUE = 0x1, + D3D12_RAYTRACING_GEOMETRY_FLAG_NO_DUPLICATE_ANYHIT_INVOCATION = 0x2 + } D3D12_RAYTRACING_GEOMETRY_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_RAYTRACING_GEOMETRY_FLAGS ); +typedef +enum D3D12_RAYTRACING_GEOMETRY_TYPE + { + D3D12_RAYTRACING_GEOMETRY_TYPE_TRIANGLES = 0, + D3D12_RAYTRACING_GEOMETRY_TYPE_PROCEDURAL_PRIMITIVE_AABBS = ( D3D12_RAYTRACING_GEOMETRY_TYPE_TRIANGLES + 1 ) + } D3D12_RAYTRACING_GEOMETRY_TYPE; + +typedef +enum D3D12_RAYTRACING_INSTANCE_FLAGS + { + D3D12_RAYTRACING_INSTANCE_FLAG_NONE = 0, + D3D12_RAYTRACING_INSTANCE_FLAG_TRIANGLE_CULL_DISABLE = 0x1, + D3D12_RAYTRACING_INSTANCE_FLAG_TRIANGLE_FRONT_COUNTERCLOCKWISE = 0x2, + D3D12_RAYTRACING_INSTANCE_FLAG_FORCE_OPAQUE = 0x4, + D3D12_RAYTRACING_INSTANCE_FLAG_FORCE_NON_OPAQUE = 0x8 + } D3D12_RAYTRACING_INSTANCE_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_RAYTRACING_INSTANCE_FLAGS ); +typedef struct D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE + { + D3D12_GPU_VIRTUAL_ADDRESS StartAddress; + UINT64 StrideInBytes; + } D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE; + +typedef struct D3D12_GPU_VIRTUAL_ADDRESS_RANGE + { + D3D12_GPU_VIRTUAL_ADDRESS StartAddress; + UINT64 SizeInBytes; + } D3D12_GPU_VIRTUAL_ADDRESS_RANGE; + +typedef struct D3D12_GPU_VIRTUAL_ADDRESS_RANGE_AND_STRIDE + { + D3D12_GPU_VIRTUAL_ADDRESS StartAddress; + UINT64 SizeInBytes; + UINT64 StrideInBytes; + } D3D12_GPU_VIRTUAL_ADDRESS_RANGE_AND_STRIDE; + +typedef struct D3D12_RAYTRACING_GEOMETRY_TRIANGLES_DESC + { + D3D12_GPU_VIRTUAL_ADDRESS Transform3x4; + DXGI_FORMAT IndexFormat; + DXGI_FORMAT VertexFormat; + UINT IndexCount; + UINT VertexCount; + D3D12_GPU_VIRTUAL_ADDRESS IndexBuffer; + D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE VertexBuffer; + } D3D12_RAYTRACING_GEOMETRY_TRIANGLES_DESC; + +typedef struct D3D12_RAYTRACING_AABB + { + FLOAT MinX; + FLOAT MinY; + FLOAT MinZ; + FLOAT MaxX; + FLOAT MaxY; + FLOAT MaxZ; + } D3D12_RAYTRACING_AABB; + +typedef struct D3D12_RAYTRACING_GEOMETRY_AABBS_DESC + { + UINT64 AABBCount; + D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE AABBs; + } D3D12_RAYTRACING_GEOMETRY_AABBS_DESC; + +typedef +enum D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS + { + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_NONE = 0, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_ALLOW_UPDATE = 0x1, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_ALLOW_COMPACTION = 0x2, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_PREFER_FAST_TRACE = 0x4, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_PREFER_FAST_BUILD = 0x8, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_MINIMIZE_MEMORY = 0x10, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_PERFORM_UPDATE = 0x20 + } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS ); +typedef +enum D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE + { + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE_CLONE = 0, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE_COMPACT = 0x1, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE_VISUALIZATION_DECODE_FOR_TOOLS = 0x2, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE_SERIALIZE = 0x3, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE_DESERIALIZE = 0x4 + } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE; + +typedef +enum D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE + { + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL = 0, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL = 0x1 + } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE; + +typedef +enum D3D12_ELEMENTS_LAYOUT + { + D3D12_ELEMENTS_LAYOUT_ARRAY = 0, + D3D12_ELEMENTS_LAYOUT_ARRAY_OF_POINTERS = 0x1 + } D3D12_ELEMENTS_LAYOUT; + +typedef +enum D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TYPE + { + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_COMPACTED_SIZE = 0, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TOOLS_VISUALIZATION = 0x1, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_SERIALIZATION = 0x2, + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_CURRENT_SIZE = 0x3 + } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TYPE; + +typedef struct D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC + { + D3D12_GPU_VIRTUAL_ADDRESS DestBuffer; + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TYPE InfoType; + } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC; + +typedef struct D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_COMPACTED_SIZE_DESC + { + UINT64 CompactedSizeInBytes; + } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_COMPACTED_SIZE_DESC; + +typedef struct D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TOOLS_VISUALIZATION_DESC + { + UINT64 DecodedSizeInBytes; + } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TOOLS_VISUALIZATION_DESC; + +typedef struct D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_TOOLS_VISUALIZATION_HEADER + { + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE Type; + UINT NumDescs; + } D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_TOOLS_VISUALIZATION_HEADER; + +// Regarding D3D12_BUILD_RAY_TRACING_ACCELERATION_STRUCTURE_TOOLS_VISUALIZATION_HEADER above, +// depending on Type field, NumDescs above is followed by either: +// D3D12_RAY_TRACING_INSTANCE_DESC InstanceDescs[NumDescs] +// or D3D12_RAY_TRACING_GEOMETRY_DESC GeometryDescs[NumDescs]. +// There is 4 bytes of padding between GeometryDesc structs in the array so alignment is natural when viewed by CPU. + +typedef struct D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_SERIALIZATION_DESC + { + UINT64 SerializedSizeInBytes; + UINT64 NumBottomLevelAccelerationStructurePointers; + } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_SERIALIZATION_DESC; + +typedef struct D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER + { + GUID DriverOpaqueGUID; + BYTE DriverOpaqueVersioningData[ 16 ]; + } D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER; + +typedef +enum D3D12_SERIALIZED_DATA_TYPE + { + D3D12_SERIALIZED_DATA_RAYTRACING_ACCELERATION_STRUCTURE = 0 + } D3D12_SERIALIZED_DATA_TYPE; + +typedef +enum D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS + { + D3D12_DRIVER_MATCHING_IDENTIFIER_COMPATIBLE_WITH_DEVICE = 0, + D3D12_DRIVER_MATCHING_IDENTIFIER_UNSUPPORTED_TYPE = 0x1, + D3D12_DRIVER_MATCHING_IDENTIFIER_UNRECOGNIZED = 0x2, + D3D12_DRIVER_MATCHING_IDENTIFIER_INCOMPATIBLE_VERSION = 0x3, + D3D12_DRIVER_MATCHING_IDENTIFIER_INCOMPATIBLE_TYPE = 0x4 + } D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS; + +typedef struct D3D12_SERIALIZED_RAYTRACING_ACCELERATION_STRUCTURE_HEADER + { + D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER DriverMatchingIdentifier; + UINT64 SerializedSizeInBytesIncludingHeader; + UINT64 DeserializedSizeInBytes; + UINT64 NumBottomLevelAccelerationStructurePointersAfterHeader; + } D3D12_SERIALIZED_RAYTRACING_ACCELERATION_STRUCTURE_HEADER; + +typedef struct D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_CURRENT_SIZE_DESC + { + UINT64 CurrentSizeInBytes; + } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_CURRENT_SIZE_DESC; + +typedef struct D3D12_RAYTRACING_INSTANCE_DESC + { + FLOAT Transform[ 3 ][ 4 ]; + UINT InstanceID : 24; + UINT InstanceMask : 8; + UINT InstanceContributionToHitGroupIndex : 24; + UINT Flags : 8; + D3D12_GPU_VIRTUAL_ADDRESS AccelerationStructure; + } D3D12_RAYTRACING_INSTANCE_DESC; + +typedef struct D3D12_RAYTRACING_GEOMETRY_DESC + { + D3D12_RAYTRACING_GEOMETRY_TYPE Type; + D3D12_RAYTRACING_GEOMETRY_FLAGS Flags; + union + { + D3D12_RAYTRACING_GEOMETRY_TRIANGLES_DESC Triangles; + D3D12_RAYTRACING_GEOMETRY_AABBS_DESC AABBs; + } ; + } D3D12_RAYTRACING_GEOMETRY_DESC; + +typedef struct D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS + { + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE Type; + D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS Flags; + UINT NumDescs; + D3D12_ELEMENTS_LAYOUT DescsLayout; + union + { + D3D12_GPU_VIRTUAL_ADDRESS InstanceDescs; + const D3D12_RAYTRACING_GEOMETRY_DESC *pGeometryDescs; + const D3D12_RAYTRACING_GEOMETRY_DESC *const *ppGeometryDescs; + } ; + } D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS; + +typedef struct D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC + { + D3D12_GPU_VIRTUAL_ADDRESS DestAccelerationStructureData; + D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS Inputs; + _In_opt_ D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData; + D3D12_GPU_VIRTUAL_ADDRESS ScratchAccelerationStructureData; + } D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC; + +typedef struct D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO + { + UINT64 ResultDataMaxSizeInBytes; + UINT64 ScratchDataSizeInBytes; + UINT64 UpdateScratchDataSizeInBytes; + } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO; + +typedef +enum D3D12_RAY_FLAGS + { + D3D12_RAY_FLAG_NONE = 0, + D3D12_RAY_FLAG_FORCE_OPAQUE = 0x1, + D3D12_RAY_FLAG_FORCE_NON_OPAQUE = 0x2, + D3D12_RAY_FLAG_ACCEPT_FIRST_HIT_AND_END_SEARCH = 0x4, + D3D12_RAY_FLAG_SKIP_CLOSEST_HIT_SHADER = 0x8, + D3D12_RAY_FLAG_CULL_BACK_FACING_TRIANGLES = 0x10, + D3D12_RAY_FLAG_CULL_FRONT_FACING_TRIANGLES = 0x20, + D3D12_RAY_FLAG_CULL_OPAQUE = 0x40, + D3D12_RAY_FLAG_CULL_NON_OPAQUE = 0x80, + D3D12_RAY_FLAG_SKIP_TRIANGLES = 0x100, + D3D12_RAY_FLAG_SKIP_PROCEDURAL_PRIMITIVES = 0x200 + } D3D12_RAY_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_RAY_FLAGS ); +typedef +enum D3D12_HIT_KIND + { + D3D12_HIT_KIND_TRIANGLE_FRONT_FACE = 0xfe, + D3D12_HIT_KIND_TRIANGLE_BACK_FACE = 0xff + } D3D12_HIT_KIND; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0034_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0034_v0_0_s_ifspec; + +#ifndef __ID3D12Device5_INTERFACE_DEFINED__ +#define __ID3D12Device5_INTERFACE_DEFINED__ + +/* interface ID3D12Device5 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Device5; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("8b4f173b-2fea-4b80-8f58-4307191ab95d") + ID3D12Device5 : public ID3D12Device4 + { + public: + virtual HRESULT STDMETHODCALLTYPE CreateLifetimeTracker( + _In_ ID3D12LifetimeOwner *pOwner, + REFIID riid, + _COM_Outptr_ void **ppvTracker) = 0; + + virtual void STDMETHODCALLTYPE RemoveDevice( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE EnumerateMetaCommands( + _Inout_ UINT *pNumMetaCommands, + _Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs) = 0; + + virtual HRESULT STDMETHODCALLTYPE EnumerateMetaCommandParameters( + _In_ REFGUID CommandId, + _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage, + _Out_opt_ UINT *pTotalStructureSizeInBytes, + _Inout_ UINT *pParameterCount, + _Out_writes_opt_(*pParameterCount) D3D12_META_COMMAND_PARAMETER_DESC *pParameterDescs) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateMetaCommand( + _In_ REFGUID CommandId, + _In_ UINT NodeMask, + _In_reads_bytes_opt_(CreationParametersDataSizeInBytes) const void *pCreationParametersData, + _In_ SIZE_T CreationParametersDataSizeInBytes, + REFIID riid, + _COM_Outptr_ void **ppMetaCommand) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateStateObject( + const D3D12_STATE_OBJECT_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppStateObject) = 0; + + virtual void STDMETHODCALLTYPE GetRaytracingAccelerationStructurePrebuildInfo( + _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc, + _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo) = 0; + + virtual D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS STDMETHODCALLTYPE CheckDriverMatchingIdentifier( + _In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType, + _In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Device5Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Device5 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Device5 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Device5 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Device5 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Device5 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Device5 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Device5 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount) + UINT ( STDMETHODCALLTYPE *GetNodeCount )( + ID3D12Device5 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )( + ID3D12Device5 * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator) + HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )( + ID3D12Device5 * This, + _In_ D3D12_COMMAND_LIST_TYPE type, + REFIID riid, + _COM_Outptr_ void **ppCommandAllocator); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )( + ID3D12Device5 * This, + _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )( + ID3D12Device5 * This, + _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList )( + ID3D12Device5 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ ID3D12CommandAllocator *pCommandAllocator, + _In_opt_ ID3D12PipelineState *pInitialState, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport) + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D12Device5 * This, + D3D12_FEATURE Feature, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap) + HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )( + ID3D12Device5 * This, + _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize) + UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )( + ID3D12Device5 * This, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature) + HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )( + ID3D12Device5 * This, + _In_ UINT nodeMask, + _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature, + _In_ SIZE_T blobLengthInBytes, + REFIID riid, + _COM_Outptr_ void **ppvRootSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView) + void ( STDMETHODCALLTYPE *CreateConstantBufferView )( + ID3D12Device5 * This, + _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView) + void ( STDMETHODCALLTYPE *CreateShaderResourceView )( + ID3D12Device5 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )( + ID3D12Device5 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ ID3D12Resource *pCounterResource, + _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView) + void ( STDMETHODCALLTYPE *CreateRenderTargetView )( + ID3D12Device5 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView) + void ( STDMETHODCALLTYPE *CreateDepthStencilView )( + ID3D12Device5 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler) + void ( STDMETHODCALLTYPE *CreateSampler )( + ID3D12Device5 * This, + _In_ const D3D12_SAMPLER_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors) + void ( STDMETHODCALLTYPE *CopyDescriptors )( + ID3D12Device5 * This, + _In_ UINT NumDestDescriptorRanges, + _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts, + _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes, + _In_ UINT NumSrcDescriptorRanges, + _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts, + _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple) + void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )( + ID3D12Device5 * This, + _In_ UINT NumDescriptors, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device5 * This, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device5 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties) +#if !defined(_WIN32) + D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device5 * This, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#else + D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device5 * This, + D3D12_HEAP_PROPERTIES * RetVal, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )( + ID3D12Device5 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap) + HRESULT ( STDMETHODCALLTYPE *CreateHeap )( + ID3D12Device5 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )( + ID3D12Device5 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )( + ID3D12Device5 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle) + HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )( + ID3D12Device5 * This, + _In_ ID3D12DeviceChild *pObject, + _In_opt_ const SECURITY_ATTRIBUTES *pAttributes, + DWORD Access, + _In_opt_ LPCWSTR Name, + _Out_ HANDLE *pHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )( + ID3D12Device5 * This, + _In_ HANDLE NTHandle, + REFIID riid, + _COM_Outptr_opt_ void **ppvObj); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )( + ID3D12Device5 * This, + _In_ LPCWSTR Name, + DWORD Access, + /* [annotation][out] */ + _Out_ HANDLE *pNTHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, MakeResident) + HRESULT ( STDMETHODCALLTYPE *MakeResident )( + ID3D12Device5 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, Evict) + HRESULT ( STDMETHODCALLTYPE *Evict )( + ID3D12Device5 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateFence) + HRESULT ( STDMETHODCALLTYPE *CreateFence )( + ID3D12Device5 * This, + UINT64 InitialValue, + D3D12_FENCE_FLAGS Flags, + REFIID riid, + _COM_Outptr_ void **ppFence); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason) + HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( + ID3D12Device5 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints) + void ( STDMETHODCALLTYPE *GetCopyableFootprints )( + ID3D12Device5 * This, + _In_ const D3D12_RESOURCE_DESC *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap) + HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )( + ID3D12Device5 * This, + _In_ const D3D12_QUERY_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState) + HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )( + ID3D12Device5 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature) + HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )( + ID3D12Device5 * This, + _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc, + _In_opt_ ID3D12RootSignature *pRootSignature, + REFIID riid, + _COM_Outptr_opt_ void **ppvCommandSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling) + void ( STDMETHODCALLTYPE *GetResourceTiling )( + ID3D12Device5 * This, + _In_ ID3D12Resource *pTiledResource, + _Out_opt_ UINT *pNumTilesForEntireResource, + _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc, + _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips, + _Inout_opt_ UINT *pNumSubresourceTilings, + _In_ UINT FirstSubresourceTilingToGet, + _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips); + + DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid) +#if !defined(_WIN32) + LUID ( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device5 * This); + +#else + LUID *( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device5 * This, + LUID * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )( + ID3D12Device5 * This, + _In_reads_(BlobLength) const void *pLibraryBlob, + SIZE_T BlobLength, + REFIID riid, + _COM_Outptr_ void **ppPipelineLibrary); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion) + HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )( + ID3D12Device5 * This, + _In_reads_(NumFences) ID3D12Fence *const *ppFences, + _In_reads_(NumFences) const UINT64 *pFenceValues, + UINT NumFences, + D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags, + HANDLE hEvent); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority) + HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )( + ID3D12Device5 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities); + + DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )( + ID3D12Device5 * This, + const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )( + ID3D12Device5 * This, + _In_ const void *pAddress, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )( + ID3D12Device5 * This, + _In_ HANDLE hFileMapping, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident) + HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )( + ID3D12Device5 * This, + D3D12_RESIDENCY_FLAGS Flags, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_ ID3D12Fence *pFenceToSignal, + UINT64 FenceValueToSignal); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommandList1) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList1 )( + ID3D12Device5 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ D3D12_COMMAND_LIST_FLAGS flags, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession )( + ID3D12Device5 * This, + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommittedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource1 )( + ID3D12Device5 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateHeap1) + HRESULT ( STDMETHODCALLTYPE *CreateHeap1 )( + ID3D12Device5 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateReservedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource1 )( + ID3D12Device5 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, GetResourceAllocationInfo1) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device5 * This, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device5 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateLifetimeTracker) + HRESULT ( STDMETHODCALLTYPE *CreateLifetimeTracker )( + ID3D12Device5 * This, + _In_ ID3D12LifetimeOwner *pOwner, + REFIID riid, + _COM_Outptr_ void **ppvTracker); + + DECLSPEC_XFGVIRT(ID3D12Device5, RemoveDevice) + void ( STDMETHODCALLTYPE *RemoveDevice )( + ID3D12Device5 * This); + + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommands) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommands )( + ID3D12Device5 * This, + _Inout_ UINT *pNumMetaCommands, + _Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs); + + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommandParameters) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommandParameters )( + ID3D12Device5 * This, + _In_ REFGUID CommandId, + _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage, + _Out_opt_ UINT *pTotalStructureSizeInBytes, + _Inout_ UINT *pParameterCount, + _Out_writes_opt_(*pParameterCount) D3D12_META_COMMAND_PARAMETER_DESC *pParameterDescs); + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateMetaCommand) + HRESULT ( STDMETHODCALLTYPE *CreateMetaCommand )( + ID3D12Device5 * This, + _In_ REFGUID CommandId, + _In_ UINT NodeMask, + _In_reads_bytes_opt_(CreationParametersDataSizeInBytes) const void *pCreationParametersData, + _In_ SIZE_T CreationParametersDataSizeInBytes, + REFIID riid, + _COM_Outptr_ void **ppMetaCommand); + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateStateObject) + HRESULT ( STDMETHODCALLTYPE *CreateStateObject )( + ID3D12Device5 * This, + const D3D12_STATE_OBJECT_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppStateObject); + + DECLSPEC_XFGVIRT(ID3D12Device5, GetRaytracingAccelerationStructurePrebuildInfo) + void ( STDMETHODCALLTYPE *GetRaytracingAccelerationStructurePrebuildInfo )( + ID3D12Device5 * This, + _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc, + _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo); + + DECLSPEC_XFGVIRT(ID3D12Device5, CheckDriverMatchingIdentifier) + D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS ( STDMETHODCALLTYPE *CheckDriverMatchingIdentifier )( + ID3D12Device5 * This, + _In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType, + _In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck); + + END_INTERFACE + } ID3D12Device5Vtbl; + + interface ID3D12Device5 + { + CONST_VTBL struct ID3D12Device5Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Device5_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Device5_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Device5_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Device5_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Device5_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Device5_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Device5_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Device5_GetNodeCount(This) \ + ( (This)->lpVtbl -> GetNodeCount(This) ) + +#define ID3D12Device5_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) ) + +#define ID3D12Device5_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ + ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) ) + +#define ID3D12Device5_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device5_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device5_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) ) + +#define ID3D12Device5_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) ) + +#define ID3D12Device5_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) ) + +#define ID3D12Device5_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ + ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) ) + +#define ID3D12Device5_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ + ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) ) + +#define ID3D12Device5_CreateConstantBufferView(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) ) + +#define ID3D12Device5_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device5_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) ) + +#define ID3D12Device5_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device5_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device5_CreateSampler(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) ) + +#define ID3D12Device5_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) ) + +#define ID3D12Device5_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) ) +#if !defined(_WIN32) + +#define ID3D12Device5_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) ) +#else +#define ID3D12Device5_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) ) +#endif +#if !defined(_WIN32) + +#define ID3D12Device5_GetCustomHeapProperties(This,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) ) +#else +#define ID3D12Device5_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) ) +#endif + +#define ID3D12Device5_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) ) + +#define ID3D12Device5_CreateHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device5_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device5_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device5_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ + ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) ) + +#define ID3D12Device5_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ + ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) ) + +#define ID3D12Device5_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ + ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) ) + +#define ID3D12Device5_MakeResident(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) ) + +#define ID3D12Device5_Evict(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) ) + +#define ID3D12Device5_CreateFence(This,InitialValue,Flags,riid,ppFence) \ + ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) ) + +#define ID3D12Device5_GetDeviceRemovedReason(This) \ + ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) + +#define ID3D12Device5_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) + +#define ID3D12Device5_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device5_SetStablePowerState(This,Enable) \ + ( (This)->lpVtbl -> SetStablePowerState(This,Enable) ) + +#define ID3D12Device5_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ + ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) ) + +#define ID3D12Device5_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ + ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) ) +#if !defined(_WIN32) + +#define ID3D12Device5_GetAdapterLuid(This) \ + ( (This)->lpVtbl -> GetAdapterLuid(This) ) +#else +#define ID3D12Device5_GetAdapterLuid(This,RetVal) \ + ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) ) +#endif + + +#define ID3D12Device5_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \ + ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) ) + +#define ID3D12Device5_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \ + ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) ) + +#define ID3D12Device5_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \ + ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) ) + + +#define ID3D12Device5_CreatePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) ) + + +#define ID3D12Device5_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) ) + +#define ID3D12Device5_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) ) + +#define ID3D12Device5_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \ + ( (This)->lpVtbl -> EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) ) + + +#define ID3D12Device5_CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) ) + +#define ID3D12Device5_CreateProtectedResourceSession(This,pDesc,riid,ppSession) \ + ( (This)->lpVtbl -> CreateProtectedResourceSession(This,pDesc,riid,ppSession) ) + +#define ID3D12Device5_CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) + +#define ID3D12Device5_CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) ) + +#define ID3D12Device5_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) ) +#if !defined(_WIN32) + +#define ID3D12Device5_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#else +#define ID3D12Device5_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#endif + + +#define ID3D12Device5_CreateLifetimeTracker(This,pOwner,riid,ppvTracker) \ + ( (This)->lpVtbl -> CreateLifetimeTracker(This,pOwner,riid,ppvTracker) ) + +#define ID3D12Device5_RemoveDevice(This) \ + ( (This)->lpVtbl -> RemoveDevice(This) ) + +#define ID3D12Device5_EnumerateMetaCommands(This,pNumMetaCommands,pDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommands(This,pNumMetaCommands,pDescs) ) + +#define ID3D12Device5_EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) ) + +#define ID3D12Device5_CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) \ + ( (This)->lpVtbl -> CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) ) + +#define ID3D12Device5_CreateStateObject(This,pDesc,riid,ppStateObject) \ + ( (This)->lpVtbl -> CreateStateObject(This,pDesc,riid,ppStateObject) ) + +#define ID3D12Device5_GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) \ + ( (This)->lpVtbl -> GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) ) + +#define ID3D12Device5_CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) \ + ( (This)->lpVtbl -> CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Device5_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0035 */ +/* [local] */ + +typedef +enum D3D12_AUTO_BREADCRUMB_OP + { + D3D12_AUTO_BREADCRUMB_OP_SETMARKER = 0, + D3D12_AUTO_BREADCRUMB_OP_BEGINEVENT = 1, + D3D12_AUTO_BREADCRUMB_OP_ENDEVENT = 2, + D3D12_AUTO_BREADCRUMB_OP_DRAWINSTANCED = 3, + D3D12_AUTO_BREADCRUMB_OP_DRAWINDEXEDINSTANCED = 4, + D3D12_AUTO_BREADCRUMB_OP_EXECUTEINDIRECT = 5, + D3D12_AUTO_BREADCRUMB_OP_DISPATCH = 6, + D3D12_AUTO_BREADCRUMB_OP_COPYBUFFERREGION = 7, + D3D12_AUTO_BREADCRUMB_OP_COPYTEXTUREREGION = 8, + D3D12_AUTO_BREADCRUMB_OP_COPYRESOURCE = 9, + D3D12_AUTO_BREADCRUMB_OP_COPYTILES = 10, + D3D12_AUTO_BREADCRUMB_OP_RESOLVESUBRESOURCE = 11, + D3D12_AUTO_BREADCRUMB_OP_CLEARRENDERTARGETVIEW = 12, + D3D12_AUTO_BREADCRUMB_OP_CLEARUNORDEREDACCESSVIEW = 13, + D3D12_AUTO_BREADCRUMB_OP_CLEARDEPTHSTENCILVIEW = 14, + D3D12_AUTO_BREADCRUMB_OP_RESOURCEBARRIER = 15, + D3D12_AUTO_BREADCRUMB_OP_EXECUTEBUNDLE = 16, + D3D12_AUTO_BREADCRUMB_OP_PRESENT = 17, + D3D12_AUTO_BREADCRUMB_OP_RESOLVEQUERYDATA = 18, + D3D12_AUTO_BREADCRUMB_OP_BEGINSUBMISSION = 19, + D3D12_AUTO_BREADCRUMB_OP_ENDSUBMISSION = 20, + D3D12_AUTO_BREADCRUMB_OP_DECODEFRAME = 21, + D3D12_AUTO_BREADCRUMB_OP_PROCESSFRAMES = 22, + D3D12_AUTO_BREADCRUMB_OP_ATOMICCOPYBUFFERUINT = 23, + D3D12_AUTO_BREADCRUMB_OP_ATOMICCOPYBUFFERUINT64 = 24, + D3D12_AUTO_BREADCRUMB_OP_RESOLVESUBRESOURCEREGION = 25, + D3D12_AUTO_BREADCRUMB_OP_WRITEBUFFERIMMEDIATE = 26, + D3D12_AUTO_BREADCRUMB_OP_DECODEFRAME1 = 27, + D3D12_AUTO_BREADCRUMB_OP_SETPROTECTEDRESOURCESESSION = 28, + D3D12_AUTO_BREADCRUMB_OP_DECODEFRAME2 = 29, + D3D12_AUTO_BREADCRUMB_OP_PROCESSFRAMES1 = 30, + D3D12_AUTO_BREADCRUMB_OP_BUILDRAYTRACINGACCELERATIONSTRUCTURE = 31, + D3D12_AUTO_BREADCRUMB_OP_EMITRAYTRACINGACCELERATIONSTRUCTUREPOSTBUILDINFO = 32, + D3D12_AUTO_BREADCRUMB_OP_COPYRAYTRACINGACCELERATIONSTRUCTURE = 33, + D3D12_AUTO_BREADCRUMB_OP_DISPATCHRAYS = 34, + D3D12_AUTO_BREADCRUMB_OP_INITIALIZEMETACOMMAND = 35, + D3D12_AUTO_BREADCRUMB_OP_EXECUTEMETACOMMAND = 36, + D3D12_AUTO_BREADCRUMB_OP_ESTIMATEMOTION = 37, + D3D12_AUTO_BREADCRUMB_OP_RESOLVEMOTIONVECTORHEAP = 38, + D3D12_AUTO_BREADCRUMB_OP_SETPIPELINESTATE1 = 39, + D3D12_AUTO_BREADCRUMB_OP_INITIALIZEEXTENSIONCOMMAND = 40, + D3D12_AUTO_BREADCRUMB_OP_EXECUTEEXTENSIONCOMMAND = 41, + D3D12_AUTO_BREADCRUMB_OP_DISPATCHMESH = 42, + D3D12_AUTO_BREADCRUMB_OP_ENCODEFRAME = 43, + D3D12_AUTO_BREADCRUMB_OP_RESOLVEENCODEROUTPUTMETADATA = 44 + } D3D12_AUTO_BREADCRUMB_OP; + +typedef struct D3D12_AUTO_BREADCRUMB_NODE + { + const char *pCommandListDebugNameA; + const wchar_t *pCommandListDebugNameW; + const char *pCommandQueueDebugNameA; + const wchar_t *pCommandQueueDebugNameW; + ID3D12GraphicsCommandList *pCommandList; + ID3D12CommandQueue *pCommandQueue; + UINT32 BreadcrumbCount; + const UINT32 *pLastBreadcrumbValue; + const D3D12_AUTO_BREADCRUMB_OP *pCommandHistory; + const struct D3D12_AUTO_BREADCRUMB_NODE *pNext; + } D3D12_AUTO_BREADCRUMB_NODE; + +typedef struct D3D12_DRED_BREADCRUMB_CONTEXT + { + UINT BreadcrumbIndex; + const wchar_t *pContextString; + } D3D12_DRED_BREADCRUMB_CONTEXT; + +typedef struct D3D12_AUTO_BREADCRUMB_NODE1 + { + const char *pCommandListDebugNameA; + const wchar_t *pCommandListDebugNameW; + const char *pCommandQueueDebugNameA; + const wchar_t *pCommandQueueDebugNameW; + ID3D12GraphicsCommandList *pCommandList; + ID3D12CommandQueue *pCommandQueue; + UINT BreadcrumbCount; + const UINT *pLastBreadcrumbValue; + const D3D12_AUTO_BREADCRUMB_OP *pCommandHistory; + const struct D3D12_AUTO_BREADCRUMB_NODE1 *pNext; + UINT BreadcrumbContextsCount; + D3D12_DRED_BREADCRUMB_CONTEXT *pBreadcrumbContexts; + } D3D12_AUTO_BREADCRUMB_NODE1; + +typedef +enum D3D12_DRED_VERSION + { + D3D12_DRED_VERSION_1_0 = 0x1, + D3D12_DRED_VERSION_1_1 = 0x2, + D3D12_DRED_VERSION_1_2 = 0x3, + D3D12_DRED_VERSION_1_3 = 0x4 + } D3D12_DRED_VERSION; + +typedef +enum D3D12_DRED_FLAGS + { + D3D12_DRED_FLAG_NONE = 0, + D3D12_DRED_FLAG_FORCE_ENABLE = 1, + D3D12_DRED_FLAG_DISABLE_AUTOBREADCRUMBS = 2 + } D3D12_DRED_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_DRED_FLAGS ); +typedef +enum D3D12_DRED_ENABLEMENT + { + D3D12_DRED_ENABLEMENT_SYSTEM_CONTROLLED = 0, + D3D12_DRED_ENABLEMENT_FORCED_OFF = 1, + D3D12_DRED_ENABLEMENT_FORCED_ON = 2 + } D3D12_DRED_ENABLEMENT; + +typedef struct D3D12_DEVICE_REMOVED_EXTENDED_DATA + { + _In_ D3D12_DRED_FLAGS Flags; + _Out_ D3D12_AUTO_BREADCRUMB_NODE *pHeadAutoBreadcrumbNode; + } D3D12_DEVICE_REMOVED_EXTENDED_DATA; + +typedef +enum D3D12_DRED_ALLOCATION_TYPE + { + D3D12_DRED_ALLOCATION_TYPE_COMMAND_QUEUE = 19, + D3D12_DRED_ALLOCATION_TYPE_COMMAND_ALLOCATOR = 20, + D3D12_DRED_ALLOCATION_TYPE_PIPELINE_STATE = 21, + D3D12_DRED_ALLOCATION_TYPE_COMMAND_LIST = 22, + D3D12_DRED_ALLOCATION_TYPE_FENCE = 23, + D3D12_DRED_ALLOCATION_TYPE_DESCRIPTOR_HEAP = 24, + D3D12_DRED_ALLOCATION_TYPE_HEAP = 25, + D3D12_DRED_ALLOCATION_TYPE_QUERY_HEAP = 27, + D3D12_DRED_ALLOCATION_TYPE_COMMAND_SIGNATURE = 28, + D3D12_DRED_ALLOCATION_TYPE_PIPELINE_LIBRARY = 29, + D3D12_DRED_ALLOCATION_TYPE_VIDEO_DECODER = 30, + D3D12_DRED_ALLOCATION_TYPE_VIDEO_PROCESSOR = 32, + D3D12_DRED_ALLOCATION_TYPE_RESOURCE = 34, + D3D12_DRED_ALLOCATION_TYPE_PASS = 35, + D3D12_DRED_ALLOCATION_TYPE_CRYPTOSESSION = 36, + D3D12_DRED_ALLOCATION_TYPE_CRYPTOSESSIONPOLICY = 37, + D3D12_DRED_ALLOCATION_TYPE_PROTECTEDRESOURCESESSION = 38, + D3D12_DRED_ALLOCATION_TYPE_VIDEO_DECODER_HEAP = 39, + D3D12_DRED_ALLOCATION_TYPE_COMMAND_POOL = 40, + D3D12_DRED_ALLOCATION_TYPE_COMMAND_RECORDER = 41, + D3D12_DRED_ALLOCATION_TYPE_STATE_OBJECT = 42, + D3D12_DRED_ALLOCATION_TYPE_METACOMMAND = 43, + D3D12_DRED_ALLOCATION_TYPE_SCHEDULINGGROUP = 44, + D3D12_DRED_ALLOCATION_TYPE_VIDEO_MOTION_ESTIMATOR = 45, + D3D12_DRED_ALLOCATION_TYPE_VIDEO_MOTION_VECTOR_HEAP = 46, + D3D12_DRED_ALLOCATION_TYPE_VIDEO_EXTENSION_COMMAND = 47, + D3D12_DRED_ALLOCATION_TYPE_VIDEO_ENCODER = 48, + D3D12_DRED_ALLOCATION_TYPE_VIDEO_ENCODER_HEAP = 49, + D3D12_DRED_ALLOCATION_TYPE_INVALID = 0xffffffff + } D3D12_DRED_ALLOCATION_TYPE; + +typedef struct D3D12_DRED_ALLOCATION_NODE + { + const char *ObjectNameA; + const wchar_t *ObjectNameW; + D3D12_DRED_ALLOCATION_TYPE AllocationType; + const struct D3D12_DRED_ALLOCATION_NODE *pNext; + } D3D12_DRED_ALLOCATION_NODE; + +typedef struct D3D12_DRED_ALLOCATION_NODE1 + { + const char *ObjectNameA; + const wchar_t *ObjectNameW; + D3D12_DRED_ALLOCATION_TYPE AllocationType; + const struct D3D12_DRED_ALLOCATION_NODE1 *pNext; + const IUnknown *pObject; + } D3D12_DRED_ALLOCATION_NODE1; + +typedef struct D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT + { + _Out_ const D3D12_AUTO_BREADCRUMB_NODE *pHeadAutoBreadcrumbNode; + } D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT; + +typedef struct D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT1 + { + _Out_ const D3D12_AUTO_BREADCRUMB_NODE1 *pHeadAutoBreadcrumbNode; + } D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT1; + +typedef struct D3D12_DRED_PAGE_FAULT_OUTPUT + { + D3D12_GPU_VIRTUAL_ADDRESS PageFaultVA; + _Out_ const D3D12_DRED_ALLOCATION_NODE *pHeadExistingAllocationNode; + _Out_ const D3D12_DRED_ALLOCATION_NODE *pHeadRecentFreedAllocationNode; + } D3D12_DRED_PAGE_FAULT_OUTPUT; + +typedef struct D3D12_DRED_PAGE_FAULT_OUTPUT1 + { + D3D12_GPU_VIRTUAL_ADDRESS PageFaultVA; + _Out_ const D3D12_DRED_ALLOCATION_NODE1 *pHeadExistingAllocationNode; + _Out_ const D3D12_DRED_ALLOCATION_NODE1 *pHeadRecentFreedAllocationNode; + } D3D12_DRED_PAGE_FAULT_OUTPUT1; + +typedef +enum D3D12_DRED_PAGE_FAULT_FLAGS + { + D3D12_DRED_PAGE_FAULT_FLAGS_NONE = 0 + } D3D12_DRED_PAGE_FAULT_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_DRED_PAGE_FAULT_FLAGS ); +typedef +enum D3D12_DRED_DEVICE_STATE + { + D3D12_DRED_DEVICE_STATE_UNKNOWN = 0, + D3D12_DRED_DEVICE_STATE_HUNG = 3, + D3D12_DRED_DEVICE_STATE_FAULT = 6, + D3D12_DRED_DEVICE_STATE_PAGEFAULT = 7 + } D3D12_DRED_DEVICE_STATE; + +typedef struct D3D12_DRED_PAGE_FAULT_OUTPUT2 + { + D3D12_GPU_VIRTUAL_ADDRESS PageFaultVA; + _Out_ const D3D12_DRED_ALLOCATION_NODE1 *pHeadExistingAllocationNode; + _Out_ const D3D12_DRED_ALLOCATION_NODE1 *pHeadRecentFreedAllocationNode; + D3D12_DRED_PAGE_FAULT_FLAGS PageFaultFlags; + } D3D12_DRED_PAGE_FAULT_OUTPUT2; + +typedef struct D3D12_DEVICE_REMOVED_EXTENDED_DATA1 + { + HRESULT DeviceRemovedReason; + D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT AutoBreadcrumbsOutput; + D3D12_DRED_PAGE_FAULT_OUTPUT PageFaultOutput; + } D3D12_DEVICE_REMOVED_EXTENDED_DATA1; + +typedef struct D3D12_DEVICE_REMOVED_EXTENDED_DATA2 + { + HRESULT DeviceRemovedReason; + D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT1 AutoBreadcrumbsOutput; + D3D12_DRED_PAGE_FAULT_OUTPUT1 PageFaultOutput; + } D3D12_DEVICE_REMOVED_EXTENDED_DATA2; + +typedef struct D3D12_DEVICE_REMOVED_EXTENDED_DATA3 + { + HRESULT DeviceRemovedReason; + D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT1 AutoBreadcrumbsOutput; + D3D12_DRED_PAGE_FAULT_OUTPUT2 PageFaultOutput; + D3D12_DRED_DEVICE_STATE DeviceState; + } D3D12_DEVICE_REMOVED_EXTENDED_DATA3; + +typedef struct D3D12_VERSIONED_DEVICE_REMOVED_EXTENDED_DATA + { + D3D12_DRED_VERSION Version; + union + { + D3D12_DEVICE_REMOVED_EXTENDED_DATA Dred_1_0; + D3D12_DEVICE_REMOVED_EXTENDED_DATA1 Dred_1_1; + D3D12_DEVICE_REMOVED_EXTENDED_DATA2 Dred_1_2; + D3D12_DEVICE_REMOVED_EXTENDED_DATA3 Dred_1_3; + } ; + } D3D12_VERSIONED_DEVICE_REMOVED_EXTENDED_DATA; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0035_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0035_v0_0_s_ifspec; + +#ifndef __ID3D12DeviceRemovedExtendedDataSettings_INTERFACE_DEFINED__ +#define __ID3D12DeviceRemovedExtendedDataSettings_INTERFACE_DEFINED__ + +/* interface ID3D12DeviceRemovedExtendedDataSettings */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DeviceRemovedExtendedDataSettings; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("82BC481C-6B9B-4030-AEDB-7EE3D1DF1E63") + ID3D12DeviceRemovedExtendedDataSettings : public IUnknown + { + public: + virtual void STDMETHODCALLTYPE SetAutoBreadcrumbsEnablement( + D3D12_DRED_ENABLEMENT Enablement) = 0; + + virtual void STDMETHODCALLTYPE SetPageFaultEnablement( + D3D12_DRED_ENABLEMENT Enablement) = 0; + + virtual void STDMETHODCALLTYPE SetWatsonDumpEnablement( + D3D12_DRED_ENABLEMENT Enablement) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DeviceRemovedExtendedDataSettingsVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DeviceRemovedExtendedDataSettings * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DeviceRemovedExtendedDataSettings * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DeviceRemovedExtendedDataSettings * This); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetAutoBreadcrumbsEnablement) + void ( STDMETHODCALLTYPE *SetAutoBreadcrumbsEnablement )( + ID3D12DeviceRemovedExtendedDataSettings * This, + D3D12_DRED_ENABLEMENT Enablement); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetPageFaultEnablement) + void ( STDMETHODCALLTYPE *SetPageFaultEnablement )( + ID3D12DeviceRemovedExtendedDataSettings * This, + D3D12_DRED_ENABLEMENT Enablement); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetWatsonDumpEnablement) + void ( STDMETHODCALLTYPE *SetWatsonDumpEnablement )( + ID3D12DeviceRemovedExtendedDataSettings * This, + D3D12_DRED_ENABLEMENT Enablement); + + END_INTERFACE + } ID3D12DeviceRemovedExtendedDataSettingsVtbl; + + interface ID3D12DeviceRemovedExtendedDataSettings + { + CONST_VTBL struct ID3D12DeviceRemovedExtendedDataSettingsVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DeviceRemovedExtendedDataSettings_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DeviceRemovedExtendedDataSettings_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DeviceRemovedExtendedDataSettings_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DeviceRemovedExtendedDataSettings_SetAutoBreadcrumbsEnablement(This,Enablement) \ + ( (This)->lpVtbl -> SetAutoBreadcrumbsEnablement(This,Enablement) ) + +#define ID3D12DeviceRemovedExtendedDataSettings_SetPageFaultEnablement(This,Enablement) \ + ( (This)->lpVtbl -> SetPageFaultEnablement(This,Enablement) ) + +#define ID3D12DeviceRemovedExtendedDataSettings_SetWatsonDumpEnablement(This,Enablement) \ + ( (This)->lpVtbl -> SetWatsonDumpEnablement(This,Enablement) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DeviceRemovedExtendedDataSettings_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12DeviceRemovedExtendedDataSettings1_INTERFACE_DEFINED__ +#define __ID3D12DeviceRemovedExtendedDataSettings1_INTERFACE_DEFINED__ + +/* interface ID3D12DeviceRemovedExtendedDataSettings1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DeviceRemovedExtendedDataSettings1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("DBD5AE51-3317-4F0A-ADF9-1D7CEDCAAE0B") + ID3D12DeviceRemovedExtendedDataSettings1 : public ID3D12DeviceRemovedExtendedDataSettings + { + public: + virtual void STDMETHODCALLTYPE SetBreadcrumbContextEnablement( + D3D12_DRED_ENABLEMENT Enablement) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DeviceRemovedExtendedDataSettings1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DeviceRemovedExtendedDataSettings1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DeviceRemovedExtendedDataSettings1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DeviceRemovedExtendedDataSettings1 * This); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetAutoBreadcrumbsEnablement) + void ( STDMETHODCALLTYPE *SetAutoBreadcrumbsEnablement )( + ID3D12DeviceRemovedExtendedDataSettings1 * This, + D3D12_DRED_ENABLEMENT Enablement); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetPageFaultEnablement) + void ( STDMETHODCALLTYPE *SetPageFaultEnablement )( + ID3D12DeviceRemovedExtendedDataSettings1 * This, + D3D12_DRED_ENABLEMENT Enablement); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetWatsonDumpEnablement) + void ( STDMETHODCALLTYPE *SetWatsonDumpEnablement )( + ID3D12DeviceRemovedExtendedDataSettings1 * This, + D3D12_DRED_ENABLEMENT Enablement); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings1, SetBreadcrumbContextEnablement) + void ( STDMETHODCALLTYPE *SetBreadcrumbContextEnablement )( + ID3D12DeviceRemovedExtendedDataSettings1 * This, + D3D12_DRED_ENABLEMENT Enablement); + + END_INTERFACE + } ID3D12DeviceRemovedExtendedDataSettings1Vtbl; + + interface ID3D12DeviceRemovedExtendedDataSettings1 + { + CONST_VTBL struct ID3D12DeviceRemovedExtendedDataSettings1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DeviceRemovedExtendedDataSettings1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DeviceRemovedExtendedDataSettings1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DeviceRemovedExtendedDataSettings1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DeviceRemovedExtendedDataSettings1_SetAutoBreadcrumbsEnablement(This,Enablement) \ + ( (This)->lpVtbl -> SetAutoBreadcrumbsEnablement(This,Enablement) ) + +#define ID3D12DeviceRemovedExtendedDataSettings1_SetPageFaultEnablement(This,Enablement) \ + ( (This)->lpVtbl -> SetPageFaultEnablement(This,Enablement) ) + +#define ID3D12DeviceRemovedExtendedDataSettings1_SetWatsonDumpEnablement(This,Enablement) \ + ( (This)->lpVtbl -> SetWatsonDumpEnablement(This,Enablement) ) + + +#define ID3D12DeviceRemovedExtendedDataSettings1_SetBreadcrumbContextEnablement(This,Enablement) \ + ( (This)->lpVtbl -> SetBreadcrumbContextEnablement(This,Enablement) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DeviceRemovedExtendedDataSettings1_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12DeviceRemovedExtendedDataSettings2_INTERFACE_DEFINED__ +#define __ID3D12DeviceRemovedExtendedDataSettings2_INTERFACE_DEFINED__ + +/* interface ID3D12DeviceRemovedExtendedDataSettings2 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DeviceRemovedExtendedDataSettings2; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("61552388-01ab-4008-a436-83db189566ea") + ID3D12DeviceRemovedExtendedDataSettings2 : public ID3D12DeviceRemovedExtendedDataSettings1 + { + public: + virtual void STDMETHODCALLTYPE UseMarkersOnlyAutoBreadcrumbs( + BOOL MarkersOnly) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DeviceRemovedExtendedDataSettings2Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DeviceRemovedExtendedDataSettings2 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DeviceRemovedExtendedDataSettings2 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DeviceRemovedExtendedDataSettings2 * This); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetAutoBreadcrumbsEnablement) + void ( STDMETHODCALLTYPE *SetAutoBreadcrumbsEnablement )( + ID3D12DeviceRemovedExtendedDataSettings2 * This, + D3D12_DRED_ENABLEMENT Enablement); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetPageFaultEnablement) + void ( STDMETHODCALLTYPE *SetPageFaultEnablement )( + ID3D12DeviceRemovedExtendedDataSettings2 * This, + D3D12_DRED_ENABLEMENT Enablement); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetWatsonDumpEnablement) + void ( STDMETHODCALLTYPE *SetWatsonDumpEnablement )( + ID3D12DeviceRemovedExtendedDataSettings2 * This, + D3D12_DRED_ENABLEMENT Enablement); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings1, SetBreadcrumbContextEnablement) + void ( STDMETHODCALLTYPE *SetBreadcrumbContextEnablement )( + ID3D12DeviceRemovedExtendedDataSettings2 * This, + D3D12_DRED_ENABLEMENT Enablement); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings2, UseMarkersOnlyAutoBreadcrumbs) + void ( STDMETHODCALLTYPE *UseMarkersOnlyAutoBreadcrumbs )( + ID3D12DeviceRemovedExtendedDataSettings2 * This, + BOOL MarkersOnly); + + END_INTERFACE + } ID3D12DeviceRemovedExtendedDataSettings2Vtbl; + + interface ID3D12DeviceRemovedExtendedDataSettings2 + { + CONST_VTBL struct ID3D12DeviceRemovedExtendedDataSettings2Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DeviceRemovedExtendedDataSettings2_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DeviceRemovedExtendedDataSettings2_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DeviceRemovedExtendedDataSettings2_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DeviceRemovedExtendedDataSettings2_SetAutoBreadcrumbsEnablement(This,Enablement) \ + ( (This)->lpVtbl -> SetAutoBreadcrumbsEnablement(This,Enablement) ) + +#define ID3D12DeviceRemovedExtendedDataSettings2_SetPageFaultEnablement(This,Enablement) \ + ( (This)->lpVtbl -> SetPageFaultEnablement(This,Enablement) ) + +#define ID3D12DeviceRemovedExtendedDataSettings2_SetWatsonDumpEnablement(This,Enablement) \ + ( (This)->lpVtbl -> SetWatsonDumpEnablement(This,Enablement) ) + + +#define ID3D12DeviceRemovedExtendedDataSettings2_SetBreadcrumbContextEnablement(This,Enablement) \ + ( (This)->lpVtbl -> SetBreadcrumbContextEnablement(This,Enablement) ) + + +#define ID3D12DeviceRemovedExtendedDataSettings2_UseMarkersOnlyAutoBreadcrumbs(This,MarkersOnly) \ + ( (This)->lpVtbl -> UseMarkersOnlyAutoBreadcrumbs(This,MarkersOnly) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DeviceRemovedExtendedDataSettings2_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12DeviceRemovedExtendedData_INTERFACE_DEFINED__ +#define __ID3D12DeviceRemovedExtendedData_INTERFACE_DEFINED__ + +/* interface ID3D12DeviceRemovedExtendedData */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DeviceRemovedExtendedData; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("98931D33-5AE8-4791-AA3C-1A73A2934E71") + ID3D12DeviceRemovedExtendedData : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE GetAutoBreadcrumbsOutput( + _Out_ D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT *pOutput) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetPageFaultAllocationOutput( + _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT *pOutput) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DeviceRemovedExtendedDataVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DeviceRemovedExtendedData * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DeviceRemovedExtendedData * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DeviceRemovedExtendedData * This); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData, GetAutoBreadcrumbsOutput) + HRESULT ( STDMETHODCALLTYPE *GetAutoBreadcrumbsOutput )( + ID3D12DeviceRemovedExtendedData * This, + _Out_ D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT *pOutput); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData, GetPageFaultAllocationOutput) + HRESULT ( STDMETHODCALLTYPE *GetPageFaultAllocationOutput )( + ID3D12DeviceRemovedExtendedData * This, + _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT *pOutput); + + END_INTERFACE + } ID3D12DeviceRemovedExtendedDataVtbl; + + interface ID3D12DeviceRemovedExtendedData + { + CONST_VTBL struct ID3D12DeviceRemovedExtendedDataVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DeviceRemovedExtendedData_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DeviceRemovedExtendedData_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DeviceRemovedExtendedData_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DeviceRemovedExtendedData_GetAutoBreadcrumbsOutput(This,pOutput) \ + ( (This)->lpVtbl -> GetAutoBreadcrumbsOutput(This,pOutput) ) + +#define ID3D12DeviceRemovedExtendedData_GetPageFaultAllocationOutput(This,pOutput) \ + ( (This)->lpVtbl -> GetPageFaultAllocationOutput(This,pOutput) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DeviceRemovedExtendedData_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12DeviceRemovedExtendedData1_INTERFACE_DEFINED__ +#define __ID3D12DeviceRemovedExtendedData1_INTERFACE_DEFINED__ + +/* interface ID3D12DeviceRemovedExtendedData1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DeviceRemovedExtendedData1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9727A022-CF1D-4DDA-9EBA-EFFA653FC506") + ID3D12DeviceRemovedExtendedData1 : public ID3D12DeviceRemovedExtendedData + { + public: + virtual HRESULT STDMETHODCALLTYPE GetAutoBreadcrumbsOutput1( + _Out_ D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT1 *pOutput) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetPageFaultAllocationOutput1( + _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT1 *pOutput) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DeviceRemovedExtendedData1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DeviceRemovedExtendedData1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DeviceRemovedExtendedData1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DeviceRemovedExtendedData1 * This); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData, GetAutoBreadcrumbsOutput) + HRESULT ( STDMETHODCALLTYPE *GetAutoBreadcrumbsOutput )( + ID3D12DeviceRemovedExtendedData1 * This, + _Out_ D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT *pOutput); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData, GetPageFaultAllocationOutput) + HRESULT ( STDMETHODCALLTYPE *GetPageFaultAllocationOutput )( + ID3D12DeviceRemovedExtendedData1 * This, + _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT *pOutput); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData1, GetAutoBreadcrumbsOutput1) + HRESULT ( STDMETHODCALLTYPE *GetAutoBreadcrumbsOutput1 )( + ID3D12DeviceRemovedExtendedData1 * This, + _Out_ D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT1 *pOutput); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData1, GetPageFaultAllocationOutput1) + HRESULT ( STDMETHODCALLTYPE *GetPageFaultAllocationOutput1 )( + ID3D12DeviceRemovedExtendedData1 * This, + _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT1 *pOutput); + + END_INTERFACE + } ID3D12DeviceRemovedExtendedData1Vtbl; + + interface ID3D12DeviceRemovedExtendedData1 + { + CONST_VTBL struct ID3D12DeviceRemovedExtendedData1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DeviceRemovedExtendedData1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DeviceRemovedExtendedData1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DeviceRemovedExtendedData1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DeviceRemovedExtendedData1_GetAutoBreadcrumbsOutput(This,pOutput) \ + ( (This)->lpVtbl -> GetAutoBreadcrumbsOutput(This,pOutput) ) + +#define ID3D12DeviceRemovedExtendedData1_GetPageFaultAllocationOutput(This,pOutput) \ + ( (This)->lpVtbl -> GetPageFaultAllocationOutput(This,pOutput) ) + + +#define ID3D12DeviceRemovedExtendedData1_GetAutoBreadcrumbsOutput1(This,pOutput) \ + ( (This)->lpVtbl -> GetAutoBreadcrumbsOutput1(This,pOutput) ) + +#define ID3D12DeviceRemovedExtendedData1_GetPageFaultAllocationOutput1(This,pOutput) \ + ( (This)->lpVtbl -> GetPageFaultAllocationOutput1(This,pOutput) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DeviceRemovedExtendedData1_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12DeviceRemovedExtendedData2_INTERFACE_DEFINED__ +#define __ID3D12DeviceRemovedExtendedData2_INTERFACE_DEFINED__ + +/* interface ID3D12DeviceRemovedExtendedData2 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DeviceRemovedExtendedData2; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("67FC5816-E4CA-4915-BF18-42541272DA54") + ID3D12DeviceRemovedExtendedData2 : public ID3D12DeviceRemovedExtendedData1 + { + public: + virtual HRESULT STDMETHODCALLTYPE GetPageFaultAllocationOutput2( + _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT2 *pOutput) = 0; + + virtual D3D12_DRED_DEVICE_STATE STDMETHODCALLTYPE GetDeviceState( void) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DeviceRemovedExtendedData2Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DeviceRemovedExtendedData2 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DeviceRemovedExtendedData2 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DeviceRemovedExtendedData2 * This); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData, GetAutoBreadcrumbsOutput) + HRESULT ( STDMETHODCALLTYPE *GetAutoBreadcrumbsOutput )( + ID3D12DeviceRemovedExtendedData2 * This, + _Out_ D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT *pOutput); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData, GetPageFaultAllocationOutput) + HRESULT ( STDMETHODCALLTYPE *GetPageFaultAllocationOutput )( + ID3D12DeviceRemovedExtendedData2 * This, + _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT *pOutput); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData1, GetAutoBreadcrumbsOutput1) + HRESULT ( STDMETHODCALLTYPE *GetAutoBreadcrumbsOutput1 )( + ID3D12DeviceRemovedExtendedData2 * This, + _Out_ D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT1 *pOutput); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData1, GetPageFaultAllocationOutput1) + HRESULT ( STDMETHODCALLTYPE *GetPageFaultAllocationOutput1 )( + ID3D12DeviceRemovedExtendedData2 * This, + _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT1 *pOutput); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData2, GetPageFaultAllocationOutput2) + HRESULT ( STDMETHODCALLTYPE *GetPageFaultAllocationOutput2 )( + ID3D12DeviceRemovedExtendedData2 * This, + _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT2 *pOutput); + + DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData2, GetDeviceState) + D3D12_DRED_DEVICE_STATE ( STDMETHODCALLTYPE *GetDeviceState )( + ID3D12DeviceRemovedExtendedData2 * This); + + END_INTERFACE + } ID3D12DeviceRemovedExtendedData2Vtbl; + + interface ID3D12DeviceRemovedExtendedData2 + { + CONST_VTBL struct ID3D12DeviceRemovedExtendedData2Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DeviceRemovedExtendedData2_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DeviceRemovedExtendedData2_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DeviceRemovedExtendedData2_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DeviceRemovedExtendedData2_GetAutoBreadcrumbsOutput(This,pOutput) \ + ( (This)->lpVtbl -> GetAutoBreadcrumbsOutput(This,pOutput) ) + +#define ID3D12DeviceRemovedExtendedData2_GetPageFaultAllocationOutput(This,pOutput) \ + ( (This)->lpVtbl -> GetPageFaultAllocationOutput(This,pOutput) ) + + +#define ID3D12DeviceRemovedExtendedData2_GetAutoBreadcrumbsOutput1(This,pOutput) \ + ( (This)->lpVtbl -> GetAutoBreadcrumbsOutput1(This,pOutput) ) + +#define ID3D12DeviceRemovedExtendedData2_GetPageFaultAllocationOutput1(This,pOutput) \ + ( (This)->lpVtbl -> GetPageFaultAllocationOutput1(This,pOutput) ) + + +#define ID3D12DeviceRemovedExtendedData2_GetPageFaultAllocationOutput2(This,pOutput) \ + ( (This)->lpVtbl -> GetPageFaultAllocationOutput2(This,pOutput) ) + +#define ID3D12DeviceRemovedExtendedData2_GetDeviceState(This) \ + ( (This)->lpVtbl -> GetDeviceState(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DeviceRemovedExtendedData2_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0041 */ +/* [local] */ + +typedef +enum D3D12_BACKGROUND_PROCESSING_MODE + { + D3D12_BACKGROUND_PROCESSING_MODE_ALLOWED = 0, + D3D12_BACKGROUND_PROCESSING_MODE_ALLOW_INTRUSIVE_MEASUREMENTS = ( D3D12_BACKGROUND_PROCESSING_MODE_ALLOWED + 1 ) , + D3D12_BACKGROUND_PROCESSING_MODE_DISABLE_BACKGROUND_WORK = ( D3D12_BACKGROUND_PROCESSING_MODE_ALLOW_INTRUSIVE_MEASUREMENTS + 1 ) , + D3D12_BACKGROUND_PROCESSING_MODE_DISABLE_PROFILING_BY_SYSTEM = ( D3D12_BACKGROUND_PROCESSING_MODE_DISABLE_BACKGROUND_WORK + 1 ) + } D3D12_BACKGROUND_PROCESSING_MODE; + +typedef +enum D3D12_MEASUREMENTS_ACTION + { + D3D12_MEASUREMENTS_ACTION_KEEP_ALL = 0, + D3D12_MEASUREMENTS_ACTION_COMMIT_RESULTS = ( D3D12_MEASUREMENTS_ACTION_KEEP_ALL + 1 ) , + D3D12_MEASUREMENTS_ACTION_COMMIT_RESULTS_HIGH_PRIORITY = ( D3D12_MEASUREMENTS_ACTION_COMMIT_RESULTS + 1 ) , + D3D12_MEASUREMENTS_ACTION_DISCARD_PREVIOUS = ( D3D12_MEASUREMENTS_ACTION_COMMIT_RESULTS_HIGH_PRIORITY + 1 ) + } D3D12_MEASUREMENTS_ACTION; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0041_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0041_v0_0_s_ifspec; + +#ifndef __ID3D12Device6_INTERFACE_DEFINED__ +#define __ID3D12Device6_INTERFACE_DEFINED__ + +/* interface ID3D12Device6 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Device6; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("c70b221b-40e4-4a17-89af-025a0727a6dc") + ID3D12Device6 : public ID3D12Device5 + { + public: + virtual HRESULT STDMETHODCALLTYPE SetBackgroundProcessingMode( + D3D12_BACKGROUND_PROCESSING_MODE Mode, + D3D12_MEASUREMENTS_ACTION MeasurementsAction, + _In_opt_ HANDLE hEventToSignalUponCompletion, + _Out_opt_ BOOL *pbFurtherMeasurementsDesired) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Device6Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Device6 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Device6 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Device6 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Device6 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Device6 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Device6 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Device6 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount) + UINT ( STDMETHODCALLTYPE *GetNodeCount )( + ID3D12Device6 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )( + ID3D12Device6 * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator) + HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )( + ID3D12Device6 * This, + _In_ D3D12_COMMAND_LIST_TYPE type, + REFIID riid, + _COM_Outptr_ void **ppCommandAllocator); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )( + ID3D12Device6 * This, + _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )( + ID3D12Device6 * This, + _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList )( + ID3D12Device6 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ ID3D12CommandAllocator *pCommandAllocator, + _In_opt_ ID3D12PipelineState *pInitialState, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport) + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D12Device6 * This, + D3D12_FEATURE Feature, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap) + HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )( + ID3D12Device6 * This, + _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize) + UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )( + ID3D12Device6 * This, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature) + HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )( + ID3D12Device6 * This, + _In_ UINT nodeMask, + _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature, + _In_ SIZE_T blobLengthInBytes, + REFIID riid, + _COM_Outptr_ void **ppvRootSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView) + void ( STDMETHODCALLTYPE *CreateConstantBufferView )( + ID3D12Device6 * This, + _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView) + void ( STDMETHODCALLTYPE *CreateShaderResourceView )( + ID3D12Device6 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )( + ID3D12Device6 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ ID3D12Resource *pCounterResource, + _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView) + void ( STDMETHODCALLTYPE *CreateRenderTargetView )( + ID3D12Device6 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView) + void ( STDMETHODCALLTYPE *CreateDepthStencilView )( + ID3D12Device6 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler) + void ( STDMETHODCALLTYPE *CreateSampler )( + ID3D12Device6 * This, + _In_ const D3D12_SAMPLER_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors) + void ( STDMETHODCALLTYPE *CopyDescriptors )( + ID3D12Device6 * This, + _In_ UINT NumDestDescriptorRanges, + _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts, + _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes, + _In_ UINT NumSrcDescriptorRanges, + _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts, + _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple) + void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )( + ID3D12Device6 * This, + _In_ UINT NumDescriptors, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device6 * This, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device6 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties) +#if !defined(_WIN32) + D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device6 * This, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#else + D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device6 * This, + D3D12_HEAP_PROPERTIES * RetVal, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )( + ID3D12Device6 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap) + HRESULT ( STDMETHODCALLTYPE *CreateHeap )( + ID3D12Device6 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )( + ID3D12Device6 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )( + ID3D12Device6 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle) + HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )( + ID3D12Device6 * This, + _In_ ID3D12DeviceChild *pObject, + _In_opt_ const SECURITY_ATTRIBUTES *pAttributes, + DWORD Access, + _In_opt_ LPCWSTR Name, + _Out_ HANDLE *pHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )( + ID3D12Device6 * This, + _In_ HANDLE NTHandle, + REFIID riid, + _COM_Outptr_opt_ void **ppvObj); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )( + ID3D12Device6 * This, + _In_ LPCWSTR Name, + DWORD Access, + /* [annotation][out] */ + _Out_ HANDLE *pNTHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, MakeResident) + HRESULT ( STDMETHODCALLTYPE *MakeResident )( + ID3D12Device6 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, Evict) + HRESULT ( STDMETHODCALLTYPE *Evict )( + ID3D12Device6 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateFence) + HRESULT ( STDMETHODCALLTYPE *CreateFence )( + ID3D12Device6 * This, + UINT64 InitialValue, + D3D12_FENCE_FLAGS Flags, + REFIID riid, + _COM_Outptr_ void **ppFence); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason) + HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( + ID3D12Device6 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints) + void ( STDMETHODCALLTYPE *GetCopyableFootprints )( + ID3D12Device6 * This, + _In_ const D3D12_RESOURCE_DESC *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap) + HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )( + ID3D12Device6 * This, + _In_ const D3D12_QUERY_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState) + HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )( + ID3D12Device6 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature) + HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )( + ID3D12Device6 * This, + _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc, + _In_opt_ ID3D12RootSignature *pRootSignature, + REFIID riid, + _COM_Outptr_opt_ void **ppvCommandSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling) + void ( STDMETHODCALLTYPE *GetResourceTiling )( + ID3D12Device6 * This, + _In_ ID3D12Resource *pTiledResource, + _Out_opt_ UINT *pNumTilesForEntireResource, + _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc, + _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips, + _Inout_opt_ UINT *pNumSubresourceTilings, + _In_ UINT FirstSubresourceTilingToGet, + _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips); + + DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid) +#if !defined(_WIN32) + LUID ( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device6 * This); + +#else + LUID *( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device6 * This, + LUID * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )( + ID3D12Device6 * This, + _In_reads_(BlobLength) const void *pLibraryBlob, + SIZE_T BlobLength, + REFIID riid, + _COM_Outptr_ void **ppPipelineLibrary); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion) + HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )( + ID3D12Device6 * This, + _In_reads_(NumFences) ID3D12Fence *const *ppFences, + _In_reads_(NumFences) const UINT64 *pFenceValues, + UINT NumFences, + D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags, + HANDLE hEvent); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority) + HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )( + ID3D12Device6 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities); + + DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )( + ID3D12Device6 * This, + const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )( + ID3D12Device6 * This, + _In_ const void *pAddress, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )( + ID3D12Device6 * This, + _In_ HANDLE hFileMapping, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident) + HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )( + ID3D12Device6 * This, + D3D12_RESIDENCY_FLAGS Flags, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_ ID3D12Fence *pFenceToSignal, + UINT64 FenceValueToSignal); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommandList1) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList1 )( + ID3D12Device6 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ D3D12_COMMAND_LIST_FLAGS flags, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession )( + ID3D12Device6 * This, + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommittedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource1 )( + ID3D12Device6 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateHeap1) + HRESULT ( STDMETHODCALLTYPE *CreateHeap1 )( + ID3D12Device6 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateReservedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource1 )( + ID3D12Device6 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, GetResourceAllocationInfo1) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device6 * This, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device6 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateLifetimeTracker) + HRESULT ( STDMETHODCALLTYPE *CreateLifetimeTracker )( + ID3D12Device6 * This, + _In_ ID3D12LifetimeOwner *pOwner, + REFIID riid, + _COM_Outptr_ void **ppvTracker); + + DECLSPEC_XFGVIRT(ID3D12Device5, RemoveDevice) + void ( STDMETHODCALLTYPE *RemoveDevice )( + ID3D12Device6 * This); + + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommands) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommands )( + ID3D12Device6 * This, + _Inout_ UINT *pNumMetaCommands, + _Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs); + + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommandParameters) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommandParameters )( + ID3D12Device6 * This, + _In_ REFGUID CommandId, + _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage, + _Out_opt_ UINT *pTotalStructureSizeInBytes, + _Inout_ UINT *pParameterCount, + _Out_writes_opt_(*pParameterCount) D3D12_META_COMMAND_PARAMETER_DESC *pParameterDescs); + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateMetaCommand) + HRESULT ( STDMETHODCALLTYPE *CreateMetaCommand )( + ID3D12Device6 * This, + _In_ REFGUID CommandId, + _In_ UINT NodeMask, + _In_reads_bytes_opt_(CreationParametersDataSizeInBytes) const void *pCreationParametersData, + _In_ SIZE_T CreationParametersDataSizeInBytes, + REFIID riid, + _COM_Outptr_ void **ppMetaCommand); + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateStateObject) + HRESULT ( STDMETHODCALLTYPE *CreateStateObject )( + ID3D12Device6 * This, + const D3D12_STATE_OBJECT_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppStateObject); + + DECLSPEC_XFGVIRT(ID3D12Device5, GetRaytracingAccelerationStructurePrebuildInfo) + void ( STDMETHODCALLTYPE *GetRaytracingAccelerationStructurePrebuildInfo )( + ID3D12Device6 * This, + _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc, + _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo); + + DECLSPEC_XFGVIRT(ID3D12Device5, CheckDriverMatchingIdentifier) + D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS ( STDMETHODCALLTYPE *CheckDriverMatchingIdentifier )( + ID3D12Device6 * This, + _In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType, + _In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck); + + DECLSPEC_XFGVIRT(ID3D12Device6, SetBackgroundProcessingMode) + HRESULT ( STDMETHODCALLTYPE *SetBackgroundProcessingMode )( + ID3D12Device6 * This, + D3D12_BACKGROUND_PROCESSING_MODE Mode, + D3D12_MEASUREMENTS_ACTION MeasurementsAction, + _In_opt_ HANDLE hEventToSignalUponCompletion, + _Out_opt_ BOOL *pbFurtherMeasurementsDesired); + + END_INTERFACE + } ID3D12Device6Vtbl; + + interface ID3D12Device6 + { + CONST_VTBL struct ID3D12Device6Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Device6_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Device6_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Device6_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Device6_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Device6_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Device6_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Device6_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Device6_GetNodeCount(This) \ + ( (This)->lpVtbl -> GetNodeCount(This) ) + +#define ID3D12Device6_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) ) + +#define ID3D12Device6_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ + ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) ) + +#define ID3D12Device6_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device6_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device6_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) ) + +#define ID3D12Device6_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) ) + +#define ID3D12Device6_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) ) + +#define ID3D12Device6_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ + ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) ) + +#define ID3D12Device6_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ + ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) ) + +#define ID3D12Device6_CreateConstantBufferView(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) ) + +#define ID3D12Device6_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device6_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) ) + +#define ID3D12Device6_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device6_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device6_CreateSampler(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) ) + +#define ID3D12Device6_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) ) + +#define ID3D12Device6_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) ) +#if !defined(_WIN32) + +#define ID3D12Device6_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) ) +#else +#define ID3D12Device6_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) ) +#endif +#if !defined(_WIN32) + +#define ID3D12Device6_GetCustomHeapProperties(This,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) ) +#else +#define ID3D12Device6_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) ) +#endif + +#define ID3D12Device6_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) ) + +#define ID3D12Device6_CreateHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device6_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device6_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device6_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ + ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) ) + +#define ID3D12Device6_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ + ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) ) + +#define ID3D12Device6_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ + ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) ) + +#define ID3D12Device6_MakeResident(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) ) + +#define ID3D12Device6_Evict(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) ) + +#define ID3D12Device6_CreateFence(This,InitialValue,Flags,riid,ppFence) \ + ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) ) + +#define ID3D12Device6_GetDeviceRemovedReason(This) \ + ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) + +#define ID3D12Device6_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) + +#define ID3D12Device6_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device6_SetStablePowerState(This,Enable) \ + ( (This)->lpVtbl -> SetStablePowerState(This,Enable) ) + +#define ID3D12Device6_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ + ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) ) + +#define ID3D12Device6_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ + ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) ) +#if !defined(_WIN32) + +#define ID3D12Device6_GetAdapterLuid(This) \ + ( (This)->lpVtbl -> GetAdapterLuid(This) ) +#else +#define ID3D12Device6_GetAdapterLuid(This,RetVal) \ + ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) ) +#endif + + +#define ID3D12Device6_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \ + ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) ) + +#define ID3D12Device6_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \ + ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) ) + +#define ID3D12Device6_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \ + ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) ) + + +#define ID3D12Device6_CreatePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) ) + + +#define ID3D12Device6_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) ) + +#define ID3D12Device6_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) ) + +#define ID3D12Device6_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \ + ( (This)->lpVtbl -> EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) ) + + +#define ID3D12Device6_CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) ) + +#define ID3D12Device6_CreateProtectedResourceSession(This,pDesc,riid,ppSession) \ + ( (This)->lpVtbl -> CreateProtectedResourceSession(This,pDesc,riid,ppSession) ) + +#define ID3D12Device6_CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) + +#define ID3D12Device6_CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) ) + +#define ID3D12Device6_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) ) +#if !defined(_WIN32) + +#define ID3D12Device6_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#else +#define ID3D12Device6_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#endif + + +#define ID3D12Device6_CreateLifetimeTracker(This,pOwner,riid,ppvTracker) \ + ( (This)->lpVtbl -> CreateLifetimeTracker(This,pOwner,riid,ppvTracker) ) + +#define ID3D12Device6_RemoveDevice(This) \ + ( (This)->lpVtbl -> RemoveDevice(This) ) + +#define ID3D12Device6_EnumerateMetaCommands(This,pNumMetaCommands,pDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommands(This,pNumMetaCommands,pDescs) ) + +#define ID3D12Device6_EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) ) + +#define ID3D12Device6_CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) \ + ( (This)->lpVtbl -> CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) ) + +#define ID3D12Device6_CreateStateObject(This,pDesc,riid,ppStateObject) \ + ( (This)->lpVtbl -> CreateStateObject(This,pDesc,riid,ppStateObject) ) + +#define ID3D12Device6_GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) \ + ( (This)->lpVtbl -> GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) ) + +#define ID3D12Device6_CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) \ + ( (This)->lpVtbl -> CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) ) + + +#define ID3D12Device6_SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) \ + ( (This)->lpVtbl -> SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Device6_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0042 */ +/* [local] */ + +DEFINE_GUID(D3D12_PROTECTED_RESOURCES_SESSION_HARDWARE_PROTECTED, 0x62B0084E, 0xC70E, 0x4DAA, 0xA1, 0x09, 0x30, 0xFF, 0x8D, 0x5A, 0x04, 0x82); +typedef struct D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_TYPE_COUNT + { + UINT NodeIndex; + UINT Count; + } D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_TYPE_COUNT; + +typedef struct D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_TYPES + { + UINT NodeIndex; + UINT Count; + GUID *pTypes; + } D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_TYPES; + +typedef struct D3D12_PROTECTED_RESOURCE_SESSION_DESC1 + { + UINT NodeMask; + D3D12_PROTECTED_RESOURCE_SESSION_FLAGS Flags; + GUID ProtectionType; + } D3D12_PROTECTED_RESOURCE_SESSION_DESC1; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0042_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0042_v0_0_s_ifspec; + +#ifndef __ID3D12ProtectedResourceSession1_INTERFACE_DEFINED__ +#define __ID3D12ProtectedResourceSession1_INTERFACE_DEFINED__ + +/* interface ID3D12ProtectedResourceSession1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12ProtectedResourceSession1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("D6F12DD6-76FB-406E-8961-4296EEFC0409") + ID3D12ProtectedResourceSession1 : public ID3D12ProtectedResourceSession + { + public: +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_PROTECTED_RESOURCE_SESSION_DESC1 STDMETHODCALLTYPE GetDesc1( void) = 0; +#else + virtual D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *STDMETHODCALLTYPE GetDesc1( + D3D12_PROTECTED_RESOURCE_SESSION_DESC1 * RetVal) = 0; +#endif + + }; + + +#else /* C style interface */ + + typedef struct ID3D12ProtectedResourceSession1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12ProtectedResourceSession1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12ProtectedResourceSession1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12ProtectedResourceSession1 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12ProtectedResourceSession1 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12ProtectedResourceSession1 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12ProtectedResourceSession1 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12ProtectedResourceSession1 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12ProtectedResourceSession1 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12ProtectedSession, GetStatusFence) + HRESULT ( STDMETHODCALLTYPE *GetStatusFence )( + ID3D12ProtectedResourceSession1 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppFence); + + DECLSPEC_XFGVIRT(ID3D12ProtectedSession, GetSessionStatus) + D3D12_PROTECTED_SESSION_STATUS ( STDMETHODCALLTYPE *GetSessionStatus )( + ID3D12ProtectedResourceSession1 * This); + + DECLSPEC_XFGVIRT(ID3D12ProtectedResourceSession, GetDesc) +#if !defined(_WIN32) + D3D12_PROTECTED_RESOURCE_SESSION_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12ProtectedResourceSession1 * This); + +#else + D3D12_PROTECTED_RESOURCE_SESSION_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12ProtectedResourceSession1 * This, + D3D12_PROTECTED_RESOURCE_SESSION_DESC * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12ProtectedResourceSession1, GetDesc1) +#if !defined(_WIN32) + D3D12_PROTECTED_RESOURCE_SESSION_DESC1 ( STDMETHODCALLTYPE *GetDesc1 )( + ID3D12ProtectedResourceSession1 * This); + +#else + D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *( STDMETHODCALLTYPE *GetDesc1 )( + ID3D12ProtectedResourceSession1 * This, + D3D12_PROTECTED_RESOURCE_SESSION_DESC1 * RetVal); + +#endif + + END_INTERFACE + } ID3D12ProtectedResourceSession1Vtbl; + + interface ID3D12ProtectedResourceSession1 + { + CONST_VTBL struct ID3D12ProtectedResourceSession1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12ProtectedResourceSession1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12ProtectedResourceSession1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12ProtectedResourceSession1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12ProtectedResourceSession1_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12ProtectedResourceSession1_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12ProtectedResourceSession1_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12ProtectedResourceSession1_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12ProtectedResourceSession1_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12ProtectedResourceSession1_GetStatusFence(This,riid,ppFence) \ + ( (This)->lpVtbl -> GetStatusFence(This,riid,ppFence) ) + +#define ID3D12ProtectedResourceSession1_GetSessionStatus(This) \ + ( (This)->lpVtbl -> GetSessionStatus(This) ) + +#if !defined(_WIN32) + +#define ID3D12ProtectedResourceSession1_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) +#else +#define ID3D12ProtectedResourceSession1_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) +#endif + +#if !defined(_WIN32) + +#define ID3D12ProtectedResourceSession1_GetDesc1(This) \ + ( (This)->lpVtbl -> GetDesc1(This) ) +#else +#define ID3D12ProtectedResourceSession1_GetDesc1(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc1(This,RetVal) ) +#endif + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12ProtectedResourceSession1_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Device7_INTERFACE_DEFINED__ +#define __ID3D12Device7_INTERFACE_DEFINED__ + +/* interface ID3D12Device7 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Device7; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("5c014b53-68a1-4b9b-8bd1-dd6046b9358b") + ID3D12Device7 : public ID3D12Device6 + { + public: + virtual HRESULT STDMETHODCALLTYPE AddToStateObject( + const D3D12_STATE_OBJECT_DESC *pAddition, + ID3D12StateObject *pStateObjectToGrowFrom, + REFIID riid, + _COM_Outptr_ void **ppNewStateObject) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateProtectedResourceSession1( + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Device7Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Device7 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Device7 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Device7 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Device7 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Device7 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Device7 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Device7 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount) + UINT ( STDMETHODCALLTYPE *GetNodeCount )( + ID3D12Device7 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )( + ID3D12Device7 * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator) + HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )( + ID3D12Device7 * This, + _In_ D3D12_COMMAND_LIST_TYPE type, + REFIID riid, + _COM_Outptr_ void **ppCommandAllocator); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )( + ID3D12Device7 * This, + _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )( + ID3D12Device7 * This, + _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList )( + ID3D12Device7 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ ID3D12CommandAllocator *pCommandAllocator, + _In_opt_ ID3D12PipelineState *pInitialState, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport) + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D12Device7 * This, + D3D12_FEATURE Feature, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap) + HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )( + ID3D12Device7 * This, + _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize) + UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )( + ID3D12Device7 * This, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature) + HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )( + ID3D12Device7 * This, + _In_ UINT nodeMask, + _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature, + _In_ SIZE_T blobLengthInBytes, + REFIID riid, + _COM_Outptr_ void **ppvRootSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView) + void ( STDMETHODCALLTYPE *CreateConstantBufferView )( + ID3D12Device7 * This, + _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView) + void ( STDMETHODCALLTYPE *CreateShaderResourceView )( + ID3D12Device7 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )( + ID3D12Device7 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ ID3D12Resource *pCounterResource, + _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView) + void ( STDMETHODCALLTYPE *CreateRenderTargetView )( + ID3D12Device7 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView) + void ( STDMETHODCALLTYPE *CreateDepthStencilView )( + ID3D12Device7 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler) + void ( STDMETHODCALLTYPE *CreateSampler )( + ID3D12Device7 * This, + _In_ const D3D12_SAMPLER_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors) + void ( STDMETHODCALLTYPE *CopyDescriptors )( + ID3D12Device7 * This, + _In_ UINT NumDestDescriptorRanges, + _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts, + _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes, + _In_ UINT NumSrcDescriptorRanges, + _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts, + _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple) + void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )( + ID3D12Device7 * This, + _In_ UINT NumDescriptors, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device7 * This, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device7 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties) +#if !defined(_WIN32) + D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device7 * This, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#else + D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device7 * This, + D3D12_HEAP_PROPERTIES * RetVal, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )( + ID3D12Device7 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap) + HRESULT ( STDMETHODCALLTYPE *CreateHeap )( + ID3D12Device7 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )( + ID3D12Device7 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )( + ID3D12Device7 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle) + HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )( + ID3D12Device7 * This, + _In_ ID3D12DeviceChild *pObject, + _In_opt_ const SECURITY_ATTRIBUTES *pAttributes, + DWORD Access, + _In_opt_ LPCWSTR Name, + _Out_ HANDLE *pHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )( + ID3D12Device7 * This, + _In_ HANDLE NTHandle, + REFIID riid, + _COM_Outptr_opt_ void **ppvObj); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )( + ID3D12Device7 * This, + _In_ LPCWSTR Name, + DWORD Access, + /* [annotation][out] */ + _Out_ HANDLE *pNTHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, MakeResident) + HRESULT ( STDMETHODCALLTYPE *MakeResident )( + ID3D12Device7 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, Evict) + HRESULT ( STDMETHODCALLTYPE *Evict )( + ID3D12Device7 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateFence) + HRESULT ( STDMETHODCALLTYPE *CreateFence )( + ID3D12Device7 * This, + UINT64 InitialValue, + D3D12_FENCE_FLAGS Flags, + REFIID riid, + _COM_Outptr_ void **ppFence); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason) + HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( + ID3D12Device7 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints) + void ( STDMETHODCALLTYPE *GetCopyableFootprints )( + ID3D12Device7 * This, + _In_ const D3D12_RESOURCE_DESC *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap) + HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )( + ID3D12Device7 * This, + _In_ const D3D12_QUERY_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState) + HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )( + ID3D12Device7 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature) + HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )( + ID3D12Device7 * This, + _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc, + _In_opt_ ID3D12RootSignature *pRootSignature, + REFIID riid, + _COM_Outptr_opt_ void **ppvCommandSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling) + void ( STDMETHODCALLTYPE *GetResourceTiling )( + ID3D12Device7 * This, + _In_ ID3D12Resource *pTiledResource, + _Out_opt_ UINT *pNumTilesForEntireResource, + _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc, + _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips, + _Inout_opt_ UINT *pNumSubresourceTilings, + _In_ UINT FirstSubresourceTilingToGet, + _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips); + + DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid) +#if !defined(_WIN32) + LUID ( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device7 * This); + +#else + LUID *( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device7 * This, + LUID * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )( + ID3D12Device7 * This, + _In_reads_(BlobLength) const void *pLibraryBlob, + SIZE_T BlobLength, + REFIID riid, + _COM_Outptr_ void **ppPipelineLibrary); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion) + HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )( + ID3D12Device7 * This, + _In_reads_(NumFences) ID3D12Fence *const *ppFences, + _In_reads_(NumFences) const UINT64 *pFenceValues, + UINT NumFences, + D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags, + HANDLE hEvent); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority) + HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )( + ID3D12Device7 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities); + + DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )( + ID3D12Device7 * This, + const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )( + ID3D12Device7 * This, + _In_ const void *pAddress, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )( + ID3D12Device7 * This, + _In_ HANDLE hFileMapping, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident) + HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )( + ID3D12Device7 * This, + D3D12_RESIDENCY_FLAGS Flags, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_ ID3D12Fence *pFenceToSignal, + UINT64 FenceValueToSignal); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommandList1) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList1 )( + ID3D12Device7 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ D3D12_COMMAND_LIST_FLAGS flags, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession )( + ID3D12Device7 * This, + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommittedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource1 )( + ID3D12Device7 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateHeap1) + HRESULT ( STDMETHODCALLTYPE *CreateHeap1 )( + ID3D12Device7 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateReservedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource1 )( + ID3D12Device7 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, GetResourceAllocationInfo1) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device7 * This, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device7 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateLifetimeTracker) + HRESULT ( STDMETHODCALLTYPE *CreateLifetimeTracker )( + ID3D12Device7 * This, + _In_ ID3D12LifetimeOwner *pOwner, + REFIID riid, + _COM_Outptr_ void **ppvTracker); + + DECLSPEC_XFGVIRT(ID3D12Device5, RemoveDevice) + void ( STDMETHODCALLTYPE *RemoveDevice )( + ID3D12Device7 * This); + + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommands) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommands )( + ID3D12Device7 * This, + _Inout_ UINT *pNumMetaCommands, + _Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs); + + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommandParameters) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommandParameters )( + ID3D12Device7 * This, + _In_ REFGUID CommandId, + _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage, + _Out_opt_ UINT *pTotalStructureSizeInBytes, + _Inout_ UINT *pParameterCount, + _Out_writes_opt_(*pParameterCount) D3D12_META_COMMAND_PARAMETER_DESC *pParameterDescs); + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateMetaCommand) + HRESULT ( STDMETHODCALLTYPE *CreateMetaCommand )( + ID3D12Device7 * This, + _In_ REFGUID CommandId, + _In_ UINT NodeMask, + _In_reads_bytes_opt_(CreationParametersDataSizeInBytes) const void *pCreationParametersData, + _In_ SIZE_T CreationParametersDataSizeInBytes, + REFIID riid, + _COM_Outptr_ void **ppMetaCommand); + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateStateObject) + HRESULT ( STDMETHODCALLTYPE *CreateStateObject )( + ID3D12Device7 * This, + const D3D12_STATE_OBJECT_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppStateObject); + + DECLSPEC_XFGVIRT(ID3D12Device5, GetRaytracingAccelerationStructurePrebuildInfo) + void ( STDMETHODCALLTYPE *GetRaytracingAccelerationStructurePrebuildInfo )( + ID3D12Device7 * This, + _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc, + _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo); + + DECLSPEC_XFGVIRT(ID3D12Device5, CheckDriverMatchingIdentifier) + D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS ( STDMETHODCALLTYPE *CheckDriverMatchingIdentifier )( + ID3D12Device7 * This, + _In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType, + _In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck); + + DECLSPEC_XFGVIRT(ID3D12Device6, SetBackgroundProcessingMode) + HRESULT ( STDMETHODCALLTYPE *SetBackgroundProcessingMode )( + ID3D12Device7 * This, + D3D12_BACKGROUND_PROCESSING_MODE Mode, + D3D12_MEASUREMENTS_ACTION MeasurementsAction, + _In_opt_ HANDLE hEventToSignalUponCompletion, + _Out_opt_ BOOL *pbFurtherMeasurementsDesired); + + DECLSPEC_XFGVIRT(ID3D12Device7, AddToStateObject) + HRESULT ( STDMETHODCALLTYPE *AddToStateObject )( + ID3D12Device7 * This, + const D3D12_STATE_OBJECT_DESC *pAddition, + ID3D12StateObject *pStateObjectToGrowFrom, + REFIID riid, + _COM_Outptr_ void **ppNewStateObject); + + DECLSPEC_XFGVIRT(ID3D12Device7, CreateProtectedResourceSession1) + HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession1 )( + ID3D12Device7 * This, + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession); + + END_INTERFACE + } ID3D12Device7Vtbl; + + interface ID3D12Device7 + { + CONST_VTBL struct ID3D12Device7Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Device7_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Device7_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Device7_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Device7_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Device7_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Device7_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Device7_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Device7_GetNodeCount(This) \ + ( (This)->lpVtbl -> GetNodeCount(This) ) + +#define ID3D12Device7_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) ) + +#define ID3D12Device7_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ + ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) ) + +#define ID3D12Device7_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device7_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device7_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) ) + +#define ID3D12Device7_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) ) + +#define ID3D12Device7_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) ) + +#define ID3D12Device7_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ + ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) ) + +#define ID3D12Device7_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ + ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) ) + +#define ID3D12Device7_CreateConstantBufferView(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) ) + +#define ID3D12Device7_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device7_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) ) + +#define ID3D12Device7_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device7_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device7_CreateSampler(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) ) + +#define ID3D12Device7_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) ) + +#define ID3D12Device7_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) ) +#if !defined(_WIN32) + +#define ID3D12Device7_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) ) +#else +#define ID3D12Device7_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) ) +#endif +#if !defined(_WIN32) + +#define ID3D12Device7_GetCustomHeapProperties(This,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) ) +#else +#define ID3D12Device7_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) ) +#endif + +#define ID3D12Device7_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) ) + +#define ID3D12Device7_CreateHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device7_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device7_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device7_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ + ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) ) + +#define ID3D12Device7_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ + ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) ) + +#define ID3D12Device7_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ + ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) ) + +#define ID3D12Device7_MakeResident(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) ) + +#define ID3D12Device7_Evict(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) ) + +#define ID3D12Device7_CreateFence(This,InitialValue,Flags,riid,ppFence) \ + ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) ) + +#define ID3D12Device7_GetDeviceRemovedReason(This) \ + ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) + +#define ID3D12Device7_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) + +#define ID3D12Device7_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device7_SetStablePowerState(This,Enable) \ + ( (This)->lpVtbl -> SetStablePowerState(This,Enable) ) + +#define ID3D12Device7_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ + ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) ) + +#define ID3D12Device7_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ + ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) ) +#if !defined(_WIN32) + +#define ID3D12Device7_GetAdapterLuid(This) \ + ( (This)->lpVtbl -> GetAdapterLuid(This) ) +#else +#define ID3D12Device7_GetAdapterLuid(This,RetVal) \ + ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) ) +#endif + + +#define ID3D12Device7_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \ + ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) ) + +#define ID3D12Device7_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \ + ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) ) + +#define ID3D12Device7_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \ + ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) ) + + +#define ID3D12Device7_CreatePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) ) + + +#define ID3D12Device7_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) ) + +#define ID3D12Device7_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) ) + +#define ID3D12Device7_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \ + ( (This)->lpVtbl -> EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) ) + + +#define ID3D12Device7_CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) ) + +#define ID3D12Device7_CreateProtectedResourceSession(This,pDesc,riid,ppSession) \ + ( (This)->lpVtbl -> CreateProtectedResourceSession(This,pDesc,riid,ppSession) ) + +#define ID3D12Device7_CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) + +#define ID3D12Device7_CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) ) + +#define ID3D12Device7_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) ) +#if !defined(_WIN32) + +#define ID3D12Device7_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#else +#define ID3D12Device7_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#endif + + +#define ID3D12Device7_CreateLifetimeTracker(This,pOwner,riid,ppvTracker) \ + ( (This)->lpVtbl -> CreateLifetimeTracker(This,pOwner,riid,ppvTracker) ) + +#define ID3D12Device7_RemoveDevice(This) \ + ( (This)->lpVtbl -> RemoveDevice(This) ) + +#define ID3D12Device7_EnumerateMetaCommands(This,pNumMetaCommands,pDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommands(This,pNumMetaCommands,pDescs) ) + +#define ID3D12Device7_EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) ) + +#define ID3D12Device7_CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) \ + ( (This)->lpVtbl -> CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) ) + +#define ID3D12Device7_CreateStateObject(This,pDesc,riid,ppStateObject) \ + ( (This)->lpVtbl -> CreateStateObject(This,pDesc,riid,ppStateObject) ) + +#define ID3D12Device7_GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) \ + ( (This)->lpVtbl -> GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) ) + +#define ID3D12Device7_CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) \ + ( (This)->lpVtbl -> CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) ) + + +#define ID3D12Device7_SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) \ + ( (This)->lpVtbl -> SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) ) + + +#define ID3D12Device7_AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) \ + ( (This)->lpVtbl -> AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) ) + +#define ID3D12Device7_CreateProtectedResourceSession1(This,pDesc,riid,ppSession) \ + ( (This)->lpVtbl -> CreateProtectedResourceSession1(This,pDesc,riid,ppSession) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Device7_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Device8_INTERFACE_DEFINED__ +#define __ID3D12Device8_INTERFACE_DEFINED__ + +/* interface ID3D12Device8 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Device8; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9218E6BB-F944-4F7E-A75C-B1B2C7B701F3") + ID3D12Device8 : public ID3D12Device7 + { + public: +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_RESOURCE_ALLOCATION_INFO STDMETHODCALLTYPE GetResourceAllocationInfo2( + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1) = 0; +#else + virtual D3D12_RESOURCE_ALLOCATION_INFO *STDMETHODCALLTYPE GetResourceAllocationInfo2( + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1) = 0; +#endif + + virtual HRESULT STDMETHODCALLTYPE CreateCommittedResource2( + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreatePlacedResource1( + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource) = 0; + + virtual void STDMETHODCALLTYPE CreateSamplerFeedbackUnorderedAccessView( + _In_opt_ ID3D12Resource *pTargetedResource, + _In_opt_ ID3D12Resource *pFeedbackResource, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor) = 0; + + virtual void STDMETHODCALLTYPE GetCopyableFootprints1( + _In_ const D3D12_RESOURCE_DESC1 *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Device8Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Device8 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Device8 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Device8 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Device8 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Device8 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Device8 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Device8 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount) + UINT ( STDMETHODCALLTYPE *GetNodeCount )( + ID3D12Device8 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )( + ID3D12Device8 * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator) + HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )( + ID3D12Device8 * This, + _In_ D3D12_COMMAND_LIST_TYPE type, + REFIID riid, + _COM_Outptr_ void **ppCommandAllocator); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )( + ID3D12Device8 * This, + _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )( + ID3D12Device8 * This, + _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList )( + ID3D12Device8 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ ID3D12CommandAllocator *pCommandAllocator, + _In_opt_ ID3D12PipelineState *pInitialState, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport) + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D12Device8 * This, + D3D12_FEATURE Feature, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap) + HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )( + ID3D12Device8 * This, + _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize) + UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )( + ID3D12Device8 * This, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature) + HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )( + ID3D12Device8 * This, + _In_ UINT nodeMask, + _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature, + _In_ SIZE_T blobLengthInBytes, + REFIID riid, + _COM_Outptr_ void **ppvRootSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView) + void ( STDMETHODCALLTYPE *CreateConstantBufferView )( + ID3D12Device8 * This, + _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView) + void ( STDMETHODCALLTYPE *CreateShaderResourceView )( + ID3D12Device8 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )( + ID3D12Device8 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ ID3D12Resource *pCounterResource, + _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView) + void ( STDMETHODCALLTYPE *CreateRenderTargetView )( + ID3D12Device8 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView) + void ( STDMETHODCALLTYPE *CreateDepthStencilView )( + ID3D12Device8 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler) + void ( STDMETHODCALLTYPE *CreateSampler )( + ID3D12Device8 * This, + _In_ const D3D12_SAMPLER_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors) + void ( STDMETHODCALLTYPE *CopyDescriptors )( + ID3D12Device8 * This, + _In_ UINT NumDestDescriptorRanges, + _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts, + _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes, + _In_ UINT NumSrcDescriptorRanges, + _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts, + _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple) + void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )( + ID3D12Device8 * This, + _In_ UINT NumDescriptors, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device8 * This, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device8 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties) +#if !defined(_WIN32) + D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device8 * This, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#else + D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device8 * This, + D3D12_HEAP_PROPERTIES * RetVal, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )( + ID3D12Device8 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap) + HRESULT ( STDMETHODCALLTYPE *CreateHeap )( + ID3D12Device8 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )( + ID3D12Device8 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )( + ID3D12Device8 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle) + HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )( + ID3D12Device8 * This, + _In_ ID3D12DeviceChild *pObject, + _In_opt_ const SECURITY_ATTRIBUTES *pAttributes, + DWORD Access, + _In_opt_ LPCWSTR Name, + _Out_ HANDLE *pHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )( + ID3D12Device8 * This, + _In_ HANDLE NTHandle, + REFIID riid, + _COM_Outptr_opt_ void **ppvObj); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )( + ID3D12Device8 * This, + _In_ LPCWSTR Name, + DWORD Access, + /* [annotation][out] */ + _Out_ HANDLE *pNTHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, MakeResident) + HRESULT ( STDMETHODCALLTYPE *MakeResident )( + ID3D12Device8 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, Evict) + HRESULT ( STDMETHODCALLTYPE *Evict )( + ID3D12Device8 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateFence) + HRESULT ( STDMETHODCALLTYPE *CreateFence )( + ID3D12Device8 * This, + UINT64 InitialValue, + D3D12_FENCE_FLAGS Flags, + REFIID riid, + _COM_Outptr_ void **ppFence); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason) + HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( + ID3D12Device8 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints) + void ( STDMETHODCALLTYPE *GetCopyableFootprints )( + ID3D12Device8 * This, + _In_ const D3D12_RESOURCE_DESC *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap) + HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )( + ID3D12Device8 * This, + _In_ const D3D12_QUERY_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState) + HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )( + ID3D12Device8 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature) + HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )( + ID3D12Device8 * This, + _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc, + _In_opt_ ID3D12RootSignature *pRootSignature, + REFIID riid, + _COM_Outptr_opt_ void **ppvCommandSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling) + void ( STDMETHODCALLTYPE *GetResourceTiling )( + ID3D12Device8 * This, + _In_ ID3D12Resource *pTiledResource, + _Out_opt_ UINT *pNumTilesForEntireResource, + _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc, + _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips, + _Inout_opt_ UINT *pNumSubresourceTilings, + _In_ UINT FirstSubresourceTilingToGet, + _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips); + + DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid) +#if !defined(_WIN32) + LUID ( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device8 * This); + +#else + LUID *( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device8 * This, + LUID * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )( + ID3D12Device8 * This, + _In_reads_(BlobLength) const void *pLibraryBlob, + SIZE_T BlobLength, + REFIID riid, + _COM_Outptr_ void **ppPipelineLibrary); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion) + HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )( + ID3D12Device8 * This, + _In_reads_(NumFences) ID3D12Fence *const *ppFences, + _In_reads_(NumFences) const UINT64 *pFenceValues, + UINT NumFences, + D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags, + HANDLE hEvent); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority) + HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )( + ID3D12Device8 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities); + + DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )( + ID3D12Device8 * This, + const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )( + ID3D12Device8 * This, + _In_ const void *pAddress, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )( + ID3D12Device8 * This, + _In_ HANDLE hFileMapping, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident) + HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )( + ID3D12Device8 * This, + D3D12_RESIDENCY_FLAGS Flags, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_ ID3D12Fence *pFenceToSignal, + UINT64 FenceValueToSignal); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommandList1) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList1 )( + ID3D12Device8 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ D3D12_COMMAND_LIST_FLAGS flags, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession )( + ID3D12Device8 * This, + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommittedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource1 )( + ID3D12Device8 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateHeap1) + HRESULT ( STDMETHODCALLTYPE *CreateHeap1 )( + ID3D12Device8 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateReservedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource1 )( + ID3D12Device8 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, GetResourceAllocationInfo1) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device8 * This, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device8 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateLifetimeTracker) + HRESULT ( STDMETHODCALLTYPE *CreateLifetimeTracker )( + ID3D12Device8 * This, + _In_ ID3D12LifetimeOwner *pOwner, + REFIID riid, + _COM_Outptr_ void **ppvTracker); + + DECLSPEC_XFGVIRT(ID3D12Device5, RemoveDevice) + void ( STDMETHODCALLTYPE *RemoveDevice )( + ID3D12Device8 * This); + + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommands) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommands )( + ID3D12Device8 * This, + _Inout_ UINT *pNumMetaCommands, + _Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs); + + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommandParameters) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommandParameters )( + ID3D12Device8 * This, + _In_ REFGUID CommandId, + _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage, + _Out_opt_ UINT *pTotalStructureSizeInBytes, + _Inout_ UINT *pParameterCount, + _Out_writes_opt_(*pParameterCount) D3D12_META_COMMAND_PARAMETER_DESC *pParameterDescs); + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateMetaCommand) + HRESULT ( STDMETHODCALLTYPE *CreateMetaCommand )( + ID3D12Device8 * This, + _In_ REFGUID CommandId, + _In_ UINT NodeMask, + _In_reads_bytes_opt_(CreationParametersDataSizeInBytes) const void *pCreationParametersData, + _In_ SIZE_T CreationParametersDataSizeInBytes, + REFIID riid, + _COM_Outptr_ void **ppMetaCommand); + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateStateObject) + HRESULT ( STDMETHODCALLTYPE *CreateStateObject )( + ID3D12Device8 * This, + const D3D12_STATE_OBJECT_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppStateObject); + + DECLSPEC_XFGVIRT(ID3D12Device5, GetRaytracingAccelerationStructurePrebuildInfo) + void ( STDMETHODCALLTYPE *GetRaytracingAccelerationStructurePrebuildInfo )( + ID3D12Device8 * This, + _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc, + _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo); + + DECLSPEC_XFGVIRT(ID3D12Device5, CheckDriverMatchingIdentifier) + D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS ( STDMETHODCALLTYPE *CheckDriverMatchingIdentifier )( + ID3D12Device8 * This, + _In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType, + _In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck); + + DECLSPEC_XFGVIRT(ID3D12Device6, SetBackgroundProcessingMode) + HRESULT ( STDMETHODCALLTYPE *SetBackgroundProcessingMode )( + ID3D12Device8 * This, + D3D12_BACKGROUND_PROCESSING_MODE Mode, + D3D12_MEASUREMENTS_ACTION MeasurementsAction, + _In_opt_ HANDLE hEventToSignalUponCompletion, + _Out_opt_ BOOL *pbFurtherMeasurementsDesired); + + DECLSPEC_XFGVIRT(ID3D12Device7, AddToStateObject) + HRESULT ( STDMETHODCALLTYPE *AddToStateObject )( + ID3D12Device8 * This, + const D3D12_STATE_OBJECT_DESC *pAddition, + ID3D12StateObject *pStateObjectToGrowFrom, + REFIID riid, + _COM_Outptr_ void **ppNewStateObject); + + DECLSPEC_XFGVIRT(ID3D12Device7, CreateProtectedResourceSession1) + HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession1 )( + ID3D12Device8 * This, + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession); + + DECLSPEC_XFGVIRT(ID3D12Device8, GetResourceAllocationInfo2) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )( + ID3D12Device8 * This, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )( + ID3D12Device8 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device8, CreateCommittedResource2) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource2 )( + ID3D12Device8 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device8, CreatePlacedResource1) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource1 )( + ID3D12Device8 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device8, CreateSamplerFeedbackUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateSamplerFeedbackUnorderedAccessView )( + ID3D12Device8 * This, + _In_opt_ ID3D12Resource *pTargetedResource, + _In_opt_ ID3D12Resource *pFeedbackResource, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device8, GetCopyableFootprints1) + void ( STDMETHODCALLTYPE *GetCopyableFootprints1 )( + ID3D12Device8 * This, + _In_ const D3D12_RESOURCE_DESC1 *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); + + END_INTERFACE + } ID3D12Device8Vtbl; + + interface ID3D12Device8 + { + CONST_VTBL struct ID3D12Device8Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Device8_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Device8_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Device8_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Device8_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Device8_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Device8_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Device8_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Device8_GetNodeCount(This) \ + ( (This)->lpVtbl -> GetNodeCount(This) ) + +#define ID3D12Device8_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) ) + +#define ID3D12Device8_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ + ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) ) + +#define ID3D12Device8_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device8_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device8_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) ) + +#define ID3D12Device8_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) ) + +#define ID3D12Device8_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) ) + +#define ID3D12Device8_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ + ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) ) + +#define ID3D12Device8_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ + ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) ) + +#define ID3D12Device8_CreateConstantBufferView(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) ) + +#define ID3D12Device8_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device8_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) ) + +#define ID3D12Device8_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device8_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device8_CreateSampler(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) ) + +#define ID3D12Device8_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) ) + +#define ID3D12Device8_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) ) +#if !defined(_WIN32) + +#define ID3D12Device8_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) ) +#else +#define ID3D12Device8_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) ) +#endif +#if !defined(_WIN32) + +#define ID3D12Device8_GetCustomHeapProperties(This,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) ) +#else +#define ID3D12Device8_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) ) +#endif + +#define ID3D12Device8_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) ) + +#define ID3D12Device8_CreateHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device8_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device8_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device8_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ + ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) ) + +#define ID3D12Device8_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ + ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) ) + +#define ID3D12Device8_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ + ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) ) + +#define ID3D12Device8_MakeResident(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) ) + +#define ID3D12Device8_Evict(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) ) + +#define ID3D12Device8_CreateFence(This,InitialValue,Flags,riid,ppFence) \ + ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) ) + +#define ID3D12Device8_GetDeviceRemovedReason(This) \ + ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) + +#define ID3D12Device8_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) + +#define ID3D12Device8_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device8_SetStablePowerState(This,Enable) \ + ( (This)->lpVtbl -> SetStablePowerState(This,Enable) ) + +#define ID3D12Device8_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ + ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) ) + +#define ID3D12Device8_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ + ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) ) +#if !defined(_WIN32) + +#define ID3D12Device8_GetAdapterLuid(This) \ + ( (This)->lpVtbl -> GetAdapterLuid(This) ) +#else +#define ID3D12Device8_GetAdapterLuid(This,RetVal) \ + ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) ) +#endif + + +#define ID3D12Device8_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \ + ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) ) + +#define ID3D12Device8_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \ + ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) ) + +#define ID3D12Device8_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \ + ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) ) + + +#define ID3D12Device8_CreatePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) ) + + +#define ID3D12Device8_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) ) + +#define ID3D12Device8_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) ) + +#define ID3D12Device8_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \ + ( (This)->lpVtbl -> EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) ) + + +#define ID3D12Device8_CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) ) + +#define ID3D12Device8_CreateProtectedResourceSession(This,pDesc,riid,ppSession) \ + ( (This)->lpVtbl -> CreateProtectedResourceSession(This,pDesc,riid,ppSession) ) + +#define ID3D12Device8_CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) + +#define ID3D12Device8_CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) ) + +#define ID3D12Device8_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) ) +#if !defined(_WIN32) + +#define ID3D12Device8_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#else +#define ID3D12Device8_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#endif + + +#define ID3D12Device8_CreateLifetimeTracker(This,pOwner,riid,ppvTracker) \ + ( (This)->lpVtbl -> CreateLifetimeTracker(This,pOwner,riid,ppvTracker) ) + +#define ID3D12Device8_RemoveDevice(This) \ + ( (This)->lpVtbl -> RemoveDevice(This) ) + +#define ID3D12Device8_EnumerateMetaCommands(This,pNumMetaCommands,pDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommands(This,pNumMetaCommands,pDescs) ) + +#define ID3D12Device8_EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) ) + +#define ID3D12Device8_CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) \ + ( (This)->lpVtbl -> CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) ) + +#define ID3D12Device8_CreateStateObject(This,pDesc,riid,ppStateObject) \ + ( (This)->lpVtbl -> CreateStateObject(This,pDesc,riid,ppStateObject) ) + +#define ID3D12Device8_GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) \ + ( (This)->lpVtbl -> GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) ) + +#define ID3D12Device8_CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) \ + ( (This)->lpVtbl -> CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) ) + + +#define ID3D12Device8_SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) \ + ( (This)->lpVtbl -> SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) ) + + +#define ID3D12Device8_AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) \ + ( (This)->lpVtbl -> AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) ) + +#define ID3D12Device8_CreateProtectedResourceSession1(This,pDesc,riid,ppSession) \ + ( (This)->lpVtbl -> CreateProtectedResourceSession1(This,pDesc,riid,ppSession) ) + +#if !defined(_WIN32) + +#define ID3D12Device8_GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#else +#define ID3D12Device8_GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#endif + +#define ID3D12Device8_CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) + +#define ID3D12Device8_CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device8_CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) ) + +#define ID3D12Device8_GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Device8_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Resource1_INTERFACE_DEFINED__ +#define __ID3D12Resource1_INTERFACE_DEFINED__ + +/* interface ID3D12Resource1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Resource1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("9D5E227A-4430-4161-88B3-3ECA6BB16E19") + ID3D12Resource1 : public ID3D12Resource + { + public: + virtual HRESULT STDMETHODCALLTYPE GetProtectedResourceSession( + REFIID riid, + _COM_Outptr_opt_ void **ppProtectedSession) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Resource1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Resource1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Resource1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Resource1 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Resource1 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Resource1 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Resource1 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Resource1 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12Resource1 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12Resource, Map) + HRESULT ( STDMETHODCALLTYPE *Map )( + ID3D12Resource1 * This, + UINT Subresource, + _In_opt_ const D3D12_RANGE *pReadRange, + _Outptr_opt_result_bytebuffer_(_Inexpressible_("Dependent on resource")) void **ppData); + + DECLSPEC_XFGVIRT(ID3D12Resource, Unmap) + void ( STDMETHODCALLTYPE *Unmap )( + ID3D12Resource1 * This, + UINT Subresource, + _In_opt_ const D3D12_RANGE *pWrittenRange); + + DECLSPEC_XFGVIRT(ID3D12Resource, GetDesc) +#if !defined(_WIN32) + D3D12_RESOURCE_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12Resource1 * This); + +#else + D3D12_RESOURCE_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12Resource1 * This, + D3D12_RESOURCE_DESC * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Resource, GetGPUVirtualAddress) + D3D12_GPU_VIRTUAL_ADDRESS ( STDMETHODCALLTYPE *GetGPUVirtualAddress )( + ID3D12Resource1 * This); + + DECLSPEC_XFGVIRT(ID3D12Resource, WriteToSubresource) + HRESULT ( STDMETHODCALLTYPE *WriteToSubresource )( + ID3D12Resource1 * This, + UINT DstSubresource, + _In_opt_ const D3D12_BOX *pDstBox, + _In_ const void *pSrcData, + UINT SrcRowPitch, + UINT SrcDepthPitch); + + DECLSPEC_XFGVIRT(ID3D12Resource, ReadFromSubresource) + HRESULT ( STDMETHODCALLTYPE *ReadFromSubresource )( + ID3D12Resource1 * This, + _Out_ void *pDstData, + UINT DstRowPitch, + UINT DstDepthPitch, + UINT SrcSubresource, + _In_opt_ const D3D12_BOX *pSrcBox); + + DECLSPEC_XFGVIRT(ID3D12Resource, GetHeapProperties) + HRESULT ( STDMETHODCALLTYPE *GetHeapProperties )( + ID3D12Resource1 * This, + _Out_opt_ D3D12_HEAP_PROPERTIES *pHeapProperties, + _Out_opt_ D3D12_HEAP_FLAGS *pHeapFlags); + + DECLSPEC_XFGVIRT(ID3D12Resource1, GetProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *GetProtectedResourceSession )( + ID3D12Resource1 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppProtectedSession); + + END_INTERFACE + } ID3D12Resource1Vtbl; + + interface ID3D12Resource1 + { + CONST_VTBL struct ID3D12Resource1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Resource1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Resource1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Resource1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Resource1_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Resource1_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Resource1_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Resource1_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Resource1_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + + +#define ID3D12Resource1_Map(This,Subresource,pReadRange,ppData) \ + ( (This)->lpVtbl -> Map(This,Subresource,pReadRange,ppData) ) + +#define ID3D12Resource1_Unmap(This,Subresource,pWrittenRange) \ + ( (This)->lpVtbl -> Unmap(This,Subresource,pWrittenRange) ) +#if !defined(_WIN32) + +#define ID3D12Resource1_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) +#else +#define ID3D12Resource1_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) +#endif + +#define ID3D12Resource1_GetGPUVirtualAddress(This) \ + ( (This)->lpVtbl -> GetGPUVirtualAddress(This) ) + +#define ID3D12Resource1_WriteToSubresource(This,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) \ + ( (This)->lpVtbl -> WriteToSubresource(This,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) ) + +#define ID3D12Resource1_ReadFromSubresource(This,pDstData,DstRowPitch,DstDepthPitch,SrcSubresource,pSrcBox) \ + ( (This)->lpVtbl -> ReadFromSubresource(This,pDstData,DstRowPitch,DstDepthPitch,SrcSubresource,pSrcBox) ) + +#define ID3D12Resource1_GetHeapProperties(This,pHeapProperties,pHeapFlags) \ + ( (This)->lpVtbl -> GetHeapProperties(This,pHeapProperties,pHeapFlags) ) + + +#define ID3D12Resource1_GetProtectedResourceSession(This,riid,ppProtectedSession) \ + ( (This)->lpVtbl -> GetProtectedResourceSession(This,riid,ppProtectedSession) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Resource1_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Resource2_INTERFACE_DEFINED__ +#define __ID3D12Resource2_INTERFACE_DEFINED__ + +/* interface ID3D12Resource2 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Resource2; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("BE36EC3B-EA85-4AEB-A45A-E9D76404A495") + ID3D12Resource2 : public ID3D12Resource1 + { + public: +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_RESOURCE_DESC1 STDMETHODCALLTYPE GetDesc1( void) = 0; +#else + virtual D3D12_RESOURCE_DESC1 *STDMETHODCALLTYPE GetDesc1( + D3D12_RESOURCE_DESC1 * RetVal) = 0; +#endif + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Resource2Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Resource2 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Resource2 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Resource2 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Resource2 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Resource2 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Resource2 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Resource2 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12Resource2 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12Resource, Map) + HRESULT ( STDMETHODCALLTYPE *Map )( + ID3D12Resource2 * This, + UINT Subresource, + _In_opt_ const D3D12_RANGE *pReadRange, + _Outptr_opt_result_bytebuffer_(_Inexpressible_("Dependent on resource")) void **ppData); + + DECLSPEC_XFGVIRT(ID3D12Resource, Unmap) + void ( STDMETHODCALLTYPE *Unmap )( + ID3D12Resource2 * This, + UINT Subresource, + _In_opt_ const D3D12_RANGE *pWrittenRange); + + DECLSPEC_XFGVIRT(ID3D12Resource, GetDesc) +#if !defined(_WIN32) + D3D12_RESOURCE_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12Resource2 * This); + +#else + D3D12_RESOURCE_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12Resource2 * This, + D3D12_RESOURCE_DESC * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Resource, GetGPUVirtualAddress) + D3D12_GPU_VIRTUAL_ADDRESS ( STDMETHODCALLTYPE *GetGPUVirtualAddress )( + ID3D12Resource2 * This); + + DECLSPEC_XFGVIRT(ID3D12Resource, WriteToSubresource) + HRESULT ( STDMETHODCALLTYPE *WriteToSubresource )( + ID3D12Resource2 * This, + UINT DstSubresource, + _In_opt_ const D3D12_BOX *pDstBox, + _In_ const void *pSrcData, + UINT SrcRowPitch, + UINT SrcDepthPitch); + + DECLSPEC_XFGVIRT(ID3D12Resource, ReadFromSubresource) + HRESULT ( STDMETHODCALLTYPE *ReadFromSubresource )( + ID3D12Resource2 * This, + _Out_ void *pDstData, + UINT DstRowPitch, + UINT DstDepthPitch, + UINT SrcSubresource, + _In_opt_ const D3D12_BOX *pSrcBox); + + DECLSPEC_XFGVIRT(ID3D12Resource, GetHeapProperties) + HRESULT ( STDMETHODCALLTYPE *GetHeapProperties )( + ID3D12Resource2 * This, + _Out_opt_ D3D12_HEAP_PROPERTIES *pHeapProperties, + _Out_opt_ D3D12_HEAP_FLAGS *pHeapFlags); + + DECLSPEC_XFGVIRT(ID3D12Resource1, GetProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *GetProtectedResourceSession )( + ID3D12Resource2 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppProtectedSession); + + DECLSPEC_XFGVIRT(ID3D12Resource2, GetDesc1) +#if !defined(_WIN32) + D3D12_RESOURCE_DESC1 ( STDMETHODCALLTYPE *GetDesc1 )( + ID3D12Resource2 * This); + +#else + D3D12_RESOURCE_DESC1 *( STDMETHODCALLTYPE *GetDesc1 )( + ID3D12Resource2 * This, + D3D12_RESOURCE_DESC1 * RetVal); + +#endif + + END_INTERFACE + } ID3D12Resource2Vtbl; + + interface ID3D12Resource2 + { + CONST_VTBL struct ID3D12Resource2Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Resource2_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Resource2_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Resource2_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Resource2_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Resource2_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Resource2_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Resource2_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Resource2_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + + +#define ID3D12Resource2_Map(This,Subresource,pReadRange,ppData) \ + ( (This)->lpVtbl -> Map(This,Subresource,pReadRange,ppData) ) + +#define ID3D12Resource2_Unmap(This,Subresource,pWrittenRange) \ + ( (This)->lpVtbl -> Unmap(This,Subresource,pWrittenRange) ) +#if !defined(_WIN32) + +#define ID3D12Resource2_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) +#else +#define ID3D12Resource2_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) +#endif + +#define ID3D12Resource2_GetGPUVirtualAddress(This) \ + ( (This)->lpVtbl -> GetGPUVirtualAddress(This) ) + +#define ID3D12Resource2_WriteToSubresource(This,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) \ + ( (This)->lpVtbl -> WriteToSubresource(This,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) ) + +#define ID3D12Resource2_ReadFromSubresource(This,pDstData,DstRowPitch,DstDepthPitch,SrcSubresource,pSrcBox) \ + ( (This)->lpVtbl -> ReadFromSubresource(This,pDstData,DstRowPitch,DstDepthPitch,SrcSubresource,pSrcBox) ) + +#define ID3D12Resource2_GetHeapProperties(This,pHeapProperties,pHeapFlags) \ + ( (This)->lpVtbl -> GetHeapProperties(This,pHeapProperties,pHeapFlags) ) + + +#define ID3D12Resource2_GetProtectedResourceSession(This,riid,ppProtectedSession) \ + ( (This)->lpVtbl -> GetProtectedResourceSession(This,riid,ppProtectedSession) ) + +#if !defined(_WIN32) + +#define ID3D12Resource2_GetDesc1(This) \ + ( (This)->lpVtbl -> GetDesc1(This) ) +#else +#define ID3D12Resource2_GetDesc1(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc1(This,RetVal) ) +#endif + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Resource2_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Heap1_INTERFACE_DEFINED__ +#define __ID3D12Heap1_INTERFACE_DEFINED__ + +/* interface ID3D12Heap1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Heap1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("572F7389-2168-49E3-9693-D6DF5871BF6D") + ID3D12Heap1 : public ID3D12Heap + { + public: + virtual HRESULT STDMETHODCALLTYPE GetProtectedResourceSession( + REFIID riid, + _COM_Outptr_opt_ void **ppProtectedSession) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Heap1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Heap1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Heap1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Heap1 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Heap1 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Heap1 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Heap1 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Heap1 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12Heap1 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12Heap, GetDesc) +#if !defined(_WIN32) + D3D12_HEAP_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12Heap1 * This); + +#else + D3D12_HEAP_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12Heap1 * This, + D3D12_HEAP_DESC * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Heap1, GetProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *GetProtectedResourceSession )( + ID3D12Heap1 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppProtectedSession); + + END_INTERFACE + } ID3D12Heap1Vtbl; + + interface ID3D12Heap1 + { + CONST_VTBL struct ID3D12Heap1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Heap1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Heap1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Heap1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Heap1_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Heap1_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Heap1_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Heap1_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Heap1_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#if !defined(_WIN32) + +#define ID3D12Heap1_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) +#else +#define ID3D12Heap1_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) +#endif + + +#define ID3D12Heap1_GetProtectedResourceSession(This,riid,ppProtectedSession) \ + ( (This)->lpVtbl -> GetProtectedResourceSession(This,riid,ppProtectedSession) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Heap1_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12GraphicsCommandList3_INTERFACE_DEFINED__ +#define __ID3D12GraphicsCommandList3_INTERFACE_DEFINED__ + +/* interface ID3D12GraphicsCommandList3 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12GraphicsCommandList3; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("6FDA83A7-B84C-4E38-9AC8-C7BD22016B3D") + ID3D12GraphicsCommandList3 : public ID3D12GraphicsCommandList2 + { + public: + virtual void STDMETHODCALLTYPE SetProtectedResourceSession( + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12GraphicsCommandList3Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12GraphicsCommandList3 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12GraphicsCommandList3 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12GraphicsCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12GraphicsCommandList3 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12GraphicsCommandList3 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12GraphicsCommandList3 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12GraphicsCommandList3 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12GraphicsCommandList3 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12GraphicsCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12GraphicsCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12CommandAllocator *pAllocator, + _In_opt_ ID3D12PipelineState *pInitialState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12GraphicsCommandList3 * This, + _In_opt_ ID3D12PipelineState *pPipelineState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawInstanced) + void ( STDMETHODCALLTYPE *DrawInstanced )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT VertexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartVertexLocation, + _In_ UINT StartInstanceLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawIndexedInstanced) + void ( STDMETHODCALLTYPE *DrawIndexedInstanced )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT IndexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartIndexLocation, + _In_ INT BaseVertexLocation, + _In_ UINT StartInstanceLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Dispatch) + void ( STDMETHODCALLTYPE *Dispatch )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT ThreadGroupCountX, + _In_ UINT ThreadGroupCountY, + _In_ UINT ThreadGroupCountZ); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyBufferRegion) + void ( STDMETHODCALLTYPE *CopyBufferRegion )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT64 NumBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTextureRegion) + void ( STDMETHODCALLTYPE *CopyTextureRegion )( + ID3D12GraphicsCommandList3 * This, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pDst, + UINT DstX, + UINT DstY, + UINT DstZ, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pSrc, + _In_opt_ const D3D12_BOX *pSrcBox); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyResource) + void ( STDMETHODCALLTYPE *CopyResource )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12Resource *pDstResource, + _In_ ID3D12Resource *pSrcResource); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTiles) + void ( STDMETHODCALLTYPE *CopyTiles )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12Resource *pTiledResource, + _In_ const D3D12_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate, + _In_ const D3D12_TILE_REGION_SIZE *pTileRegionSize, + _In_ ID3D12Resource *pBuffer, + UINT64 BufferStartOffsetInBytes, + D3D12_TILE_COPY_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveSubresource) + void ( STDMETHODCALLTYPE *ResolveSubresource )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_ DXGI_FORMAT Format); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetPrimitiveTopology) + void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )( + ID3D12GraphicsCommandList3 * This, + _In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetViewports) + void ( STDMETHODCALLTYPE *RSSetViewports )( + ID3D12GraphicsCommandList3 * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, + _In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetScissorRects) + void ( STDMETHODCALLTYPE *RSSetScissorRects )( + ID3D12GraphicsCommandList3 * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, + _In_reads_( NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetBlendFactor) + void ( STDMETHODCALLTYPE *OMSetBlendFactor )( + ID3D12GraphicsCommandList3 * This, + _In_reads_opt_(4) const FLOAT BlendFactor[ 4 ]); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetStencilRef) + void ( STDMETHODCALLTYPE *OMSetStencilRef )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT StencilRef); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPipelineState) + void ( STDMETHODCALLTYPE *SetPipelineState )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12PipelineState *pPipelineState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteBundle) + void ( STDMETHODCALLTYPE *ExecuteBundle )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12GraphicsCommandList *pCommandList); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetDescriptorHeaps) + void ( STDMETHODCALLTYPE *SetDescriptorHeaps )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT NumDescriptorHeaps, + _In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap *const *ppDescriptorHeaps); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootSignature) + void ( STDMETHODCALLTYPE *SetComputeRootSignature )( + ID3D12GraphicsCommandList3 * This, + _In_opt_ ID3D12RootSignature *pRootSignature); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootSignature) + void ( STDMETHODCALLTYPE *SetGraphicsRootSignature )( + ID3D12GraphicsCommandList3 * This, + _In_opt_ ID3D12RootSignature *pRootSignature); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetComputeRootDescriptorTable )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetGraphicsRootDescriptorTable )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstant )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstant )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstants )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstants )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetComputeRootConstantBufferView )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetGraphicsRootConstantBufferView )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetComputeRootShaderResourceView )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetGraphicsRootShaderResourceView )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetComputeRootUnorderedAccessView )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetGraphicsRootUnorderedAccessView )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetIndexBuffer) + void ( STDMETHODCALLTYPE *IASetIndexBuffer )( + ID3D12GraphicsCommandList3 * This, + _In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetVertexBuffers) + void ( STDMETHODCALLTYPE *IASetVertexBuffers )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SOSetTargets) + void ( STDMETHODCALLTYPE *SOSetTargets )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetRenderTargets) + void ( STDMETHODCALLTYPE *OMSetRenderTargets )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT NumRenderTargetDescriptors, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pRenderTargetDescriptors, + _In_ BOOL RTsSingleHandleToDescriptorRange, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pDepthStencilDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearDepthStencilView) + void ( STDMETHODCALLTYPE *ClearDepthStencilView )( + ID3D12GraphicsCommandList3 * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView, + _In_ D3D12_CLEAR_FLAGS ClearFlags, + _In_ FLOAT Depth, + _In_ UINT8 Stencil, + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearRenderTargetView) + void ( STDMETHODCALLTYPE *ClearRenderTargetView )( + ID3D12GraphicsCommandList3 * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView, + _In_ const FLOAT ColorRGBA[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewUint) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )( + ID3D12GraphicsCommandList3 * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const UINT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewFloat) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )( + ID3D12GraphicsCommandList3 * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const FLOAT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12GraphicsCommandList3 * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12GraphicsCommandList3 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12GraphicsCommandList3 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12GraphicsCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteIndirect) + void ( STDMETHODCALLTYPE *ExecuteIndirect )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12CommandSignature *pCommandSignature, + _In_ UINT MaxCommandCount, + _In_ ID3D12Resource *pArgumentBuffer, + _In_ UINT64 ArgumentBufferOffset, + _In_opt_ ID3D12Resource *pCountBuffer, + _In_ UINT64 CountBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT) + void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT64) + void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT64 )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, OMSetDepthBounds) + void ( STDMETHODCALLTYPE *OMSetDepthBounds )( + ID3D12GraphicsCommandList3 * This, + _In_ FLOAT Min, + _In_ FLOAT Max); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetSamplePositions) + void ( STDMETHODCALLTYPE *SetSamplePositions )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT NumSamplesPerPixel, + _In_ UINT NumPixels, + _In_reads_(NumSamplesPerPixel*NumPixels) D3D12_SAMPLE_POSITION *pSamplePositions); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, ResolveSubresourceRegion) + void ( STDMETHODCALLTYPE *ResolveSubresourceRegion )( + ID3D12GraphicsCommandList3 * This, + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ UINT DstX, + _In_ UINT DstY, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_opt_ D3D12_RECT *pSrcRect, + _In_ DXGI_FORMAT Format, + _In_ D3D12_RESOLVE_MODE ResolveMode); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetViewInstanceMask) + void ( STDMETHODCALLTYPE *SetViewInstanceMask )( + ID3D12GraphicsCommandList3 * This, + _In_ UINT Mask); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList2, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12GraphicsCommandList3 * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList3, SetProtectedResourceSession) + void ( STDMETHODCALLTYPE *SetProtectedResourceSession )( + ID3D12GraphicsCommandList3 * This, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession); + + END_INTERFACE + } ID3D12GraphicsCommandList3Vtbl; + + interface ID3D12GraphicsCommandList3 + { + CONST_VTBL struct ID3D12GraphicsCommandList3Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12GraphicsCommandList3_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12GraphicsCommandList3_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12GraphicsCommandList3_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12GraphicsCommandList3_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12GraphicsCommandList3_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12GraphicsCommandList3_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12GraphicsCommandList3_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12GraphicsCommandList3_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12GraphicsCommandList3_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12GraphicsCommandList3_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12GraphicsCommandList3_Reset(This,pAllocator,pInitialState) \ + ( (This)->lpVtbl -> Reset(This,pAllocator,pInitialState) ) + +#define ID3D12GraphicsCommandList3_ClearState(This,pPipelineState) \ + ( (This)->lpVtbl -> ClearState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList3_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) ) + +#define ID3D12GraphicsCommandList3_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) ) + +#define ID3D12GraphicsCommandList3_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ + ( (This)->lpVtbl -> Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) + +#define ID3D12GraphicsCommandList3_CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) \ + ( (This)->lpVtbl -> CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) ) + +#define ID3D12GraphicsCommandList3_CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) \ + ( (This)->lpVtbl -> CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) ) + +#define ID3D12GraphicsCommandList3_CopyResource(This,pDstResource,pSrcResource) \ + ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) ) + +#define ID3D12GraphicsCommandList3_CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) \ + ( (This)->lpVtbl -> CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) ) + +#define ID3D12GraphicsCommandList3_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \ + ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) ) + +#define ID3D12GraphicsCommandList3_IASetPrimitiveTopology(This,PrimitiveTopology) \ + ( (This)->lpVtbl -> IASetPrimitiveTopology(This,PrimitiveTopology) ) + +#define ID3D12GraphicsCommandList3_RSSetViewports(This,NumViewports,pViewports) \ + ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) ) + +#define ID3D12GraphicsCommandList3_RSSetScissorRects(This,NumRects,pRects) \ + ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList3_OMSetBlendFactor(This,BlendFactor) \ + ( (This)->lpVtbl -> OMSetBlendFactor(This,BlendFactor) ) + +#define ID3D12GraphicsCommandList3_OMSetStencilRef(This,StencilRef) \ + ( (This)->lpVtbl -> OMSetStencilRef(This,StencilRef) ) + +#define ID3D12GraphicsCommandList3_SetPipelineState(This,pPipelineState) \ + ( (This)->lpVtbl -> SetPipelineState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList3_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12GraphicsCommandList3_ExecuteBundle(This,pCommandList) \ + ( (This)->lpVtbl -> ExecuteBundle(This,pCommandList) ) + +#define ID3D12GraphicsCommandList3_SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) \ + ( (This)->lpVtbl -> SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) ) + +#define ID3D12GraphicsCommandList3_SetComputeRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetComputeRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList3_SetGraphicsRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetGraphicsRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList3_SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList3_SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList3_SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList3_SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList3_SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList3_SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList3_SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList3_SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList3_SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList3_SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList3_SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList3_SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList3_IASetIndexBuffer(This,pView) \ + ( (This)->lpVtbl -> IASetIndexBuffer(This,pView) ) + +#define ID3D12GraphicsCommandList3_IASetVertexBuffers(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumViews,pViews) ) + +#define ID3D12GraphicsCommandList3_SOSetTargets(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> SOSetTargets(This,StartSlot,NumViews,pViews) ) + +#define ID3D12GraphicsCommandList3_OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) \ + ( (This)->lpVtbl -> OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) ) + +#define ID3D12GraphicsCommandList3_ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList3_ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList3_ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList3_ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList3_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12GraphicsCommandList3_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12GraphicsCommandList3_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12GraphicsCommandList3_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12GraphicsCommandList3_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12GraphicsCommandList3_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12GraphicsCommandList3_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12GraphicsCommandList3_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12GraphicsCommandList3_ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) \ + ( (This)->lpVtbl -> ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) ) + + +#define ID3D12GraphicsCommandList3_AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ + ( (This)->lpVtbl -> AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) + +#define ID3D12GraphicsCommandList3_AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ + ( (This)->lpVtbl -> AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) + +#define ID3D12GraphicsCommandList3_OMSetDepthBounds(This,Min,Max) \ + ( (This)->lpVtbl -> OMSetDepthBounds(This,Min,Max) ) + +#define ID3D12GraphicsCommandList3_SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) \ + ( (This)->lpVtbl -> SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) ) + +#define ID3D12GraphicsCommandList3_ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) \ + ( (This)->lpVtbl -> ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) ) + +#define ID3D12GraphicsCommandList3_SetViewInstanceMask(This,Mask) \ + ( (This)->lpVtbl -> SetViewInstanceMask(This,Mask) ) + + +#define ID3D12GraphicsCommandList3_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) + + +#define ID3D12GraphicsCommandList3_SetProtectedResourceSession(This,pProtectedResourceSession) \ + ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12GraphicsCommandList3_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0049 */ +/* [local] */ + +typedef +enum D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE + { + D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_DISCARD = 0, + D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_PRESERVE = ( D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_DISCARD + 1 ) , + D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_CLEAR = ( D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_PRESERVE + 1 ) , + D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_NO_ACCESS = ( D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_CLEAR + 1 ) + } D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE; + +typedef struct D3D12_RENDER_PASS_BEGINNING_ACCESS_CLEAR_PARAMETERS + { + D3D12_CLEAR_VALUE ClearValue; + } D3D12_RENDER_PASS_BEGINNING_ACCESS_CLEAR_PARAMETERS; + +typedef struct D3D12_RENDER_PASS_BEGINNING_ACCESS + { + D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE Type; + union + { + D3D12_RENDER_PASS_BEGINNING_ACCESS_CLEAR_PARAMETERS Clear; + } ; + } D3D12_RENDER_PASS_BEGINNING_ACCESS; + +typedef +enum D3D12_RENDER_PASS_ENDING_ACCESS_TYPE + { + D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_DISCARD = 0, + D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_PRESERVE = ( D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_DISCARD + 1 ) , + D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_RESOLVE = ( D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_PRESERVE + 1 ) , + D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_NO_ACCESS = ( D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_RESOLVE + 1 ) + } D3D12_RENDER_PASS_ENDING_ACCESS_TYPE; + +typedef struct D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_SUBRESOURCE_PARAMETERS + { + UINT SrcSubresource; + UINT DstSubresource; + UINT DstX; + UINT DstY; + D3D12_RECT SrcRect; + } D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_SUBRESOURCE_PARAMETERS; + +typedef struct D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_PARAMETERS + { + ID3D12Resource *pSrcResource; + ID3D12Resource *pDstResource; + UINT SubresourceCount; + _Field_size_full_(SubresourceCount) const D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_SUBRESOURCE_PARAMETERS *pSubresourceParameters; + DXGI_FORMAT Format; + D3D12_RESOLVE_MODE ResolveMode; + BOOL PreserveResolveSource; + } D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_PARAMETERS; + +typedef struct D3D12_RENDER_PASS_ENDING_ACCESS + { + D3D12_RENDER_PASS_ENDING_ACCESS_TYPE Type; + union + { + D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_PARAMETERS Resolve; + } ; + } D3D12_RENDER_PASS_ENDING_ACCESS; + +typedef struct D3D12_RENDER_PASS_RENDER_TARGET_DESC + { + D3D12_CPU_DESCRIPTOR_HANDLE cpuDescriptor; + D3D12_RENDER_PASS_BEGINNING_ACCESS BeginningAccess; + D3D12_RENDER_PASS_ENDING_ACCESS EndingAccess; + } D3D12_RENDER_PASS_RENDER_TARGET_DESC; + +typedef struct D3D12_RENDER_PASS_DEPTH_STENCIL_DESC + { + D3D12_CPU_DESCRIPTOR_HANDLE cpuDescriptor; + D3D12_RENDER_PASS_BEGINNING_ACCESS DepthBeginningAccess; + D3D12_RENDER_PASS_BEGINNING_ACCESS StencilBeginningAccess; + D3D12_RENDER_PASS_ENDING_ACCESS DepthEndingAccess; + D3D12_RENDER_PASS_ENDING_ACCESS StencilEndingAccess; + } D3D12_RENDER_PASS_DEPTH_STENCIL_DESC; + +typedef +enum D3D12_RENDER_PASS_FLAGS + { + D3D12_RENDER_PASS_FLAG_NONE = 0, + D3D12_RENDER_PASS_FLAG_ALLOW_UAV_WRITES = 0x1, + D3D12_RENDER_PASS_FLAG_SUSPENDING_PASS = 0x2, + D3D12_RENDER_PASS_FLAG_RESUMING_PASS = 0x4 + } D3D12_RENDER_PASS_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_RENDER_PASS_FLAGS ); + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0049_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0049_v0_0_s_ifspec; + +#ifndef __ID3D12MetaCommand_INTERFACE_DEFINED__ +#define __ID3D12MetaCommand_INTERFACE_DEFINED__ + +/* interface ID3D12MetaCommand */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12MetaCommand; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("DBB84C27-36CE-4FC9-B801-F048C46AC570") + ID3D12MetaCommand : public ID3D12Pageable + { + public: + virtual UINT64 STDMETHODCALLTYPE GetRequiredParameterResourceSize( + _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage, + _In_ UINT ParameterIndex) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12MetaCommandVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12MetaCommand * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12MetaCommand * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12MetaCommand * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12MetaCommand * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12MetaCommand * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12MetaCommand * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12MetaCommand * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12MetaCommand * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12MetaCommand, GetRequiredParameterResourceSize) + UINT64 ( STDMETHODCALLTYPE *GetRequiredParameterResourceSize )( + ID3D12MetaCommand * This, + _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage, + _In_ UINT ParameterIndex); + + END_INTERFACE + } ID3D12MetaCommandVtbl; + + interface ID3D12MetaCommand + { + CONST_VTBL struct ID3D12MetaCommandVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12MetaCommand_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12MetaCommand_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12MetaCommand_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12MetaCommand_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12MetaCommand_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12MetaCommand_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12MetaCommand_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12MetaCommand_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + + +#define ID3D12MetaCommand_GetRequiredParameterResourceSize(This,Stage,ParameterIndex) \ + ( (This)->lpVtbl -> GetRequiredParameterResourceSize(This,Stage,ParameterIndex) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12MetaCommand_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0050 */ +/* [local] */ + +typedef struct D3D12_DISPATCH_RAYS_DESC + { + D3D12_GPU_VIRTUAL_ADDRESS_RANGE RayGenerationShaderRecord; + D3D12_GPU_VIRTUAL_ADDRESS_RANGE_AND_STRIDE MissShaderTable; + D3D12_GPU_VIRTUAL_ADDRESS_RANGE_AND_STRIDE HitGroupTable; + D3D12_GPU_VIRTUAL_ADDRESS_RANGE_AND_STRIDE CallableShaderTable; + UINT Width; + UINT Height; + UINT Depth; + } D3D12_DISPATCH_RAYS_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0050_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0050_v0_0_s_ifspec; + +#ifndef __ID3D12GraphicsCommandList4_INTERFACE_DEFINED__ +#define __ID3D12GraphicsCommandList4_INTERFACE_DEFINED__ + +/* interface ID3D12GraphicsCommandList4 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12GraphicsCommandList4; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("8754318e-d3a9-4541-98cf-645b50dc4874") + ID3D12GraphicsCommandList4 : public ID3D12GraphicsCommandList3 + { + public: + virtual void STDMETHODCALLTYPE BeginRenderPass( + _In_ UINT NumRenderTargets, + _In_reads_opt_(NumRenderTargets) const D3D12_RENDER_PASS_RENDER_TARGET_DESC *pRenderTargets, + _In_opt_ const D3D12_RENDER_PASS_DEPTH_STENCIL_DESC *pDepthStencil, + D3D12_RENDER_PASS_FLAGS Flags) = 0; + + virtual void STDMETHODCALLTYPE EndRenderPass( void) = 0; + + virtual void STDMETHODCALLTYPE InitializeMetaCommand( + _In_ ID3D12MetaCommand *pMetaCommand, + _In_reads_bytes_opt_(InitializationParametersDataSizeInBytes) const void *pInitializationParametersData, + _In_ SIZE_T InitializationParametersDataSizeInBytes) = 0; + + virtual void STDMETHODCALLTYPE ExecuteMetaCommand( + _In_ ID3D12MetaCommand *pMetaCommand, + _In_reads_bytes_opt_(ExecutionParametersDataSizeInBytes) const void *pExecutionParametersData, + _In_ SIZE_T ExecutionParametersDataSizeInBytes) = 0; + + virtual void STDMETHODCALLTYPE BuildRaytracingAccelerationStructure( + _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC *pDesc, + _In_ UINT NumPostbuildInfoDescs, + _In_reads_opt_(NumPostbuildInfoDescs) const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pPostbuildInfoDescs) = 0; + + virtual void STDMETHODCALLTYPE EmitRaytracingAccelerationStructurePostbuildInfo( + _In_ const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pDesc, + _In_ UINT NumSourceAccelerationStructures, + _In_reads_( NumSourceAccelerationStructures ) const D3D12_GPU_VIRTUAL_ADDRESS *pSourceAccelerationStructureData) = 0; + + virtual void STDMETHODCALLTYPE CopyRaytracingAccelerationStructure( + _In_ D3D12_GPU_VIRTUAL_ADDRESS DestAccelerationStructureData, + _In_ D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData, + _In_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE Mode) = 0; + + virtual void STDMETHODCALLTYPE SetPipelineState1( + _In_ ID3D12StateObject *pStateObject) = 0; + + virtual void STDMETHODCALLTYPE DispatchRays( + _In_ const D3D12_DISPATCH_RAYS_DESC *pDesc) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12GraphicsCommandList4Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12GraphicsCommandList4 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12GraphicsCommandList4 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12GraphicsCommandList4 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12GraphicsCommandList4 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12GraphicsCommandList4 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12GraphicsCommandList4 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12GraphicsCommandList4 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12GraphicsCommandList4 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12GraphicsCommandList4 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12GraphicsCommandList4 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12CommandAllocator *pAllocator, + _In_opt_ ID3D12PipelineState *pInitialState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12GraphicsCommandList4 * This, + _In_opt_ ID3D12PipelineState *pPipelineState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawInstanced) + void ( STDMETHODCALLTYPE *DrawInstanced )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT VertexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartVertexLocation, + _In_ UINT StartInstanceLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawIndexedInstanced) + void ( STDMETHODCALLTYPE *DrawIndexedInstanced )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT IndexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartIndexLocation, + _In_ INT BaseVertexLocation, + _In_ UINT StartInstanceLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Dispatch) + void ( STDMETHODCALLTYPE *Dispatch )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT ThreadGroupCountX, + _In_ UINT ThreadGroupCountY, + _In_ UINT ThreadGroupCountZ); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyBufferRegion) + void ( STDMETHODCALLTYPE *CopyBufferRegion )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT64 NumBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTextureRegion) + void ( STDMETHODCALLTYPE *CopyTextureRegion )( + ID3D12GraphicsCommandList4 * This, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pDst, + UINT DstX, + UINT DstY, + UINT DstZ, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pSrc, + _In_opt_ const D3D12_BOX *pSrcBox); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyResource) + void ( STDMETHODCALLTYPE *CopyResource )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12Resource *pDstResource, + _In_ ID3D12Resource *pSrcResource); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTiles) + void ( STDMETHODCALLTYPE *CopyTiles )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12Resource *pTiledResource, + _In_ const D3D12_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate, + _In_ const D3D12_TILE_REGION_SIZE *pTileRegionSize, + _In_ ID3D12Resource *pBuffer, + UINT64 BufferStartOffsetInBytes, + D3D12_TILE_COPY_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveSubresource) + void ( STDMETHODCALLTYPE *ResolveSubresource )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_ DXGI_FORMAT Format); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetPrimitiveTopology) + void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )( + ID3D12GraphicsCommandList4 * This, + _In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetViewports) + void ( STDMETHODCALLTYPE *RSSetViewports )( + ID3D12GraphicsCommandList4 * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, + _In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetScissorRects) + void ( STDMETHODCALLTYPE *RSSetScissorRects )( + ID3D12GraphicsCommandList4 * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, + _In_reads_( NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetBlendFactor) + void ( STDMETHODCALLTYPE *OMSetBlendFactor )( + ID3D12GraphicsCommandList4 * This, + _In_reads_opt_(4) const FLOAT BlendFactor[ 4 ]); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetStencilRef) + void ( STDMETHODCALLTYPE *OMSetStencilRef )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT StencilRef); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPipelineState) + void ( STDMETHODCALLTYPE *SetPipelineState )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12PipelineState *pPipelineState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteBundle) + void ( STDMETHODCALLTYPE *ExecuteBundle )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12GraphicsCommandList *pCommandList); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetDescriptorHeaps) + void ( STDMETHODCALLTYPE *SetDescriptorHeaps )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT NumDescriptorHeaps, + _In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap *const *ppDescriptorHeaps); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootSignature) + void ( STDMETHODCALLTYPE *SetComputeRootSignature )( + ID3D12GraphicsCommandList4 * This, + _In_opt_ ID3D12RootSignature *pRootSignature); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootSignature) + void ( STDMETHODCALLTYPE *SetGraphicsRootSignature )( + ID3D12GraphicsCommandList4 * This, + _In_opt_ ID3D12RootSignature *pRootSignature); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetComputeRootDescriptorTable )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetGraphicsRootDescriptorTable )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstant )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstant )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstants )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstants )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetComputeRootConstantBufferView )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetGraphicsRootConstantBufferView )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetComputeRootShaderResourceView )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetGraphicsRootShaderResourceView )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetComputeRootUnorderedAccessView )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetGraphicsRootUnorderedAccessView )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetIndexBuffer) + void ( STDMETHODCALLTYPE *IASetIndexBuffer )( + ID3D12GraphicsCommandList4 * This, + _In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetVertexBuffers) + void ( STDMETHODCALLTYPE *IASetVertexBuffers )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SOSetTargets) + void ( STDMETHODCALLTYPE *SOSetTargets )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetRenderTargets) + void ( STDMETHODCALLTYPE *OMSetRenderTargets )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT NumRenderTargetDescriptors, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pRenderTargetDescriptors, + _In_ BOOL RTsSingleHandleToDescriptorRange, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pDepthStencilDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearDepthStencilView) + void ( STDMETHODCALLTYPE *ClearDepthStencilView )( + ID3D12GraphicsCommandList4 * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView, + _In_ D3D12_CLEAR_FLAGS ClearFlags, + _In_ FLOAT Depth, + _In_ UINT8 Stencil, + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearRenderTargetView) + void ( STDMETHODCALLTYPE *ClearRenderTargetView )( + ID3D12GraphicsCommandList4 * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView, + _In_ const FLOAT ColorRGBA[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewUint) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )( + ID3D12GraphicsCommandList4 * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const UINT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewFloat) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )( + ID3D12GraphicsCommandList4 * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const FLOAT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12GraphicsCommandList4 * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12GraphicsCommandList4 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12GraphicsCommandList4 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12GraphicsCommandList4 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteIndirect) + void ( STDMETHODCALLTYPE *ExecuteIndirect )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12CommandSignature *pCommandSignature, + _In_ UINT MaxCommandCount, + _In_ ID3D12Resource *pArgumentBuffer, + _In_ UINT64 ArgumentBufferOffset, + _In_opt_ ID3D12Resource *pCountBuffer, + _In_ UINT64 CountBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT) + void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT64) + void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT64 )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, OMSetDepthBounds) + void ( STDMETHODCALLTYPE *OMSetDepthBounds )( + ID3D12GraphicsCommandList4 * This, + _In_ FLOAT Min, + _In_ FLOAT Max); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetSamplePositions) + void ( STDMETHODCALLTYPE *SetSamplePositions )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT NumSamplesPerPixel, + _In_ UINT NumPixels, + _In_reads_(NumSamplesPerPixel*NumPixels) D3D12_SAMPLE_POSITION *pSamplePositions); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, ResolveSubresourceRegion) + void ( STDMETHODCALLTYPE *ResolveSubresourceRegion )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ UINT DstX, + _In_ UINT DstY, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_opt_ D3D12_RECT *pSrcRect, + _In_ DXGI_FORMAT Format, + _In_ D3D12_RESOLVE_MODE ResolveMode); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetViewInstanceMask) + void ( STDMETHODCALLTYPE *SetViewInstanceMask )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT Mask); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList2, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12GraphicsCommandList4 * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList3, SetProtectedResourceSession) + void ( STDMETHODCALLTYPE *SetProtectedResourceSession )( + ID3D12GraphicsCommandList4 * This, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BeginRenderPass) + void ( STDMETHODCALLTYPE *BeginRenderPass )( + ID3D12GraphicsCommandList4 * This, + _In_ UINT NumRenderTargets, + _In_reads_opt_(NumRenderTargets) const D3D12_RENDER_PASS_RENDER_TARGET_DESC *pRenderTargets, + _In_opt_ const D3D12_RENDER_PASS_DEPTH_STENCIL_DESC *pDepthStencil, + D3D12_RENDER_PASS_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EndRenderPass) + void ( STDMETHODCALLTYPE *EndRenderPass )( + ID3D12GraphicsCommandList4 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, InitializeMetaCommand) + void ( STDMETHODCALLTYPE *InitializeMetaCommand )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12MetaCommand *pMetaCommand, + _In_reads_bytes_opt_(InitializationParametersDataSizeInBytes) const void *pInitializationParametersData, + _In_ SIZE_T InitializationParametersDataSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, ExecuteMetaCommand) + void ( STDMETHODCALLTYPE *ExecuteMetaCommand )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12MetaCommand *pMetaCommand, + _In_reads_bytes_opt_(ExecutionParametersDataSizeInBytes) const void *pExecutionParametersData, + _In_ SIZE_T ExecutionParametersDataSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BuildRaytracingAccelerationStructure) + void ( STDMETHODCALLTYPE *BuildRaytracingAccelerationStructure )( + ID3D12GraphicsCommandList4 * This, + _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC *pDesc, + _In_ UINT NumPostbuildInfoDescs, + _In_reads_opt_(NumPostbuildInfoDescs) const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pPostbuildInfoDescs); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EmitRaytracingAccelerationStructurePostbuildInfo) + void ( STDMETHODCALLTYPE *EmitRaytracingAccelerationStructurePostbuildInfo )( + ID3D12GraphicsCommandList4 * This, + _In_ const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pDesc, + _In_ UINT NumSourceAccelerationStructures, + _In_reads_( NumSourceAccelerationStructures ) const D3D12_GPU_VIRTUAL_ADDRESS *pSourceAccelerationStructureData); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, CopyRaytracingAccelerationStructure) + void ( STDMETHODCALLTYPE *CopyRaytracingAccelerationStructure )( + ID3D12GraphicsCommandList4 * This, + _In_ D3D12_GPU_VIRTUAL_ADDRESS DestAccelerationStructureData, + _In_ D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData, + _In_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE Mode); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, SetPipelineState1) + void ( STDMETHODCALLTYPE *SetPipelineState1 )( + ID3D12GraphicsCommandList4 * This, + _In_ ID3D12StateObject *pStateObject); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, DispatchRays) + void ( STDMETHODCALLTYPE *DispatchRays )( + ID3D12GraphicsCommandList4 * This, + _In_ const D3D12_DISPATCH_RAYS_DESC *pDesc); + + END_INTERFACE + } ID3D12GraphicsCommandList4Vtbl; + + interface ID3D12GraphicsCommandList4 + { + CONST_VTBL struct ID3D12GraphicsCommandList4Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12GraphicsCommandList4_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12GraphicsCommandList4_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12GraphicsCommandList4_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12GraphicsCommandList4_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12GraphicsCommandList4_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12GraphicsCommandList4_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12GraphicsCommandList4_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12GraphicsCommandList4_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12GraphicsCommandList4_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12GraphicsCommandList4_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12GraphicsCommandList4_Reset(This,pAllocator,pInitialState) \ + ( (This)->lpVtbl -> Reset(This,pAllocator,pInitialState) ) + +#define ID3D12GraphicsCommandList4_ClearState(This,pPipelineState) \ + ( (This)->lpVtbl -> ClearState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList4_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) ) + +#define ID3D12GraphicsCommandList4_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) ) + +#define ID3D12GraphicsCommandList4_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ + ( (This)->lpVtbl -> Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) + +#define ID3D12GraphicsCommandList4_CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) \ + ( (This)->lpVtbl -> CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) ) + +#define ID3D12GraphicsCommandList4_CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) \ + ( (This)->lpVtbl -> CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) ) + +#define ID3D12GraphicsCommandList4_CopyResource(This,pDstResource,pSrcResource) \ + ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) ) + +#define ID3D12GraphicsCommandList4_CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) \ + ( (This)->lpVtbl -> CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) ) + +#define ID3D12GraphicsCommandList4_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \ + ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) ) + +#define ID3D12GraphicsCommandList4_IASetPrimitiveTopology(This,PrimitiveTopology) \ + ( (This)->lpVtbl -> IASetPrimitiveTopology(This,PrimitiveTopology) ) + +#define ID3D12GraphicsCommandList4_RSSetViewports(This,NumViewports,pViewports) \ + ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) ) + +#define ID3D12GraphicsCommandList4_RSSetScissorRects(This,NumRects,pRects) \ + ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList4_OMSetBlendFactor(This,BlendFactor) \ + ( (This)->lpVtbl -> OMSetBlendFactor(This,BlendFactor) ) + +#define ID3D12GraphicsCommandList4_OMSetStencilRef(This,StencilRef) \ + ( (This)->lpVtbl -> OMSetStencilRef(This,StencilRef) ) + +#define ID3D12GraphicsCommandList4_SetPipelineState(This,pPipelineState) \ + ( (This)->lpVtbl -> SetPipelineState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList4_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12GraphicsCommandList4_ExecuteBundle(This,pCommandList) \ + ( (This)->lpVtbl -> ExecuteBundle(This,pCommandList) ) + +#define ID3D12GraphicsCommandList4_SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) \ + ( (This)->lpVtbl -> SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) ) + +#define ID3D12GraphicsCommandList4_SetComputeRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetComputeRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList4_SetGraphicsRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetGraphicsRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList4_SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList4_SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList4_SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList4_SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList4_SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList4_SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList4_SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList4_SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList4_SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList4_SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList4_SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList4_SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList4_IASetIndexBuffer(This,pView) \ + ( (This)->lpVtbl -> IASetIndexBuffer(This,pView) ) + +#define ID3D12GraphicsCommandList4_IASetVertexBuffers(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumViews,pViews) ) + +#define ID3D12GraphicsCommandList4_SOSetTargets(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> SOSetTargets(This,StartSlot,NumViews,pViews) ) + +#define ID3D12GraphicsCommandList4_OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) \ + ( (This)->lpVtbl -> OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) ) + +#define ID3D12GraphicsCommandList4_ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList4_ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList4_ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList4_ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList4_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12GraphicsCommandList4_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12GraphicsCommandList4_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12GraphicsCommandList4_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12GraphicsCommandList4_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12GraphicsCommandList4_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12GraphicsCommandList4_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12GraphicsCommandList4_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12GraphicsCommandList4_ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) \ + ( (This)->lpVtbl -> ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) ) + + +#define ID3D12GraphicsCommandList4_AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ + ( (This)->lpVtbl -> AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) + +#define ID3D12GraphicsCommandList4_AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ + ( (This)->lpVtbl -> AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) + +#define ID3D12GraphicsCommandList4_OMSetDepthBounds(This,Min,Max) \ + ( (This)->lpVtbl -> OMSetDepthBounds(This,Min,Max) ) + +#define ID3D12GraphicsCommandList4_SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) \ + ( (This)->lpVtbl -> SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) ) + +#define ID3D12GraphicsCommandList4_ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) \ + ( (This)->lpVtbl -> ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) ) + +#define ID3D12GraphicsCommandList4_SetViewInstanceMask(This,Mask) \ + ( (This)->lpVtbl -> SetViewInstanceMask(This,Mask) ) + + +#define ID3D12GraphicsCommandList4_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) + + +#define ID3D12GraphicsCommandList4_SetProtectedResourceSession(This,pProtectedResourceSession) \ + ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) ) + + +#define ID3D12GraphicsCommandList4_BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) \ + ( (This)->lpVtbl -> BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) ) + +#define ID3D12GraphicsCommandList4_EndRenderPass(This) \ + ( (This)->lpVtbl -> EndRenderPass(This) ) + +#define ID3D12GraphicsCommandList4_InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) \ + ( (This)->lpVtbl -> InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) ) + +#define ID3D12GraphicsCommandList4_ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) \ + ( (This)->lpVtbl -> ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) ) + +#define ID3D12GraphicsCommandList4_BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) \ + ( (This)->lpVtbl -> BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) ) + +#define ID3D12GraphicsCommandList4_EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) \ + ( (This)->lpVtbl -> EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) ) + +#define ID3D12GraphicsCommandList4_CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) \ + ( (This)->lpVtbl -> CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) ) + +#define ID3D12GraphicsCommandList4_SetPipelineState1(This,pStateObject) \ + ( (This)->lpVtbl -> SetPipelineState1(This,pStateObject) ) + +#define ID3D12GraphicsCommandList4_DispatchRays(This,pDesc) \ + ( (This)->lpVtbl -> DispatchRays(This,pDesc) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12GraphicsCommandList4_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0051 */ +/* [local] */ + +typedef +enum D3D12_SHADER_CACHE_MODE + { + D3D12_SHADER_CACHE_MODE_MEMORY = 0, + D3D12_SHADER_CACHE_MODE_DISK = ( D3D12_SHADER_CACHE_MODE_MEMORY + 1 ) + } D3D12_SHADER_CACHE_MODE; + +typedef +enum D3D12_SHADER_CACHE_FLAGS + { + D3D12_SHADER_CACHE_FLAG_NONE = 0, + D3D12_SHADER_CACHE_FLAG_DRIVER_VERSIONED = 0x1, + D3D12_SHADER_CACHE_FLAG_USE_WORKING_DIR = 0x2 + } D3D12_SHADER_CACHE_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_SHADER_CACHE_FLAGS ); +typedef struct D3D12_SHADER_CACHE_SESSION_DESC + { + GUID Identifier; + D3D12_SHADER_CACHE_MODE Mode; + D3D12_SHADER_CACHE_FLAGS Flags; + UINT MaximumInMemoryCacheSizeBytes; + UINT MaximumInMemoryCacheEntries; + UINT MaximumValueFileSizeBytes; + UINT64 Version; + } D3D12_SHADER_CACHE_SESSION_DESC; + +typedef +enum D3D12_BARRIER_LAYOUT + { + D3D12_BARRIER_LAYOUT_UNDEFINED = 0xffffffff, + D3D12_BARRIER_LAYOUT_COMMON = 0, + D3D12_BARRIER_LAYOUT_PRESENT = 0, + D3D12_BARRIER_LAYOUT_GENERIC_READ = ( D3D12_BARRIER_LAYOUT_PRESENT + 1 ) , + D3D12_BARRIER_LAYOUT_RENDER_TARGET = ( D3D12_BARRIER_LAYOUT_GENERIC_READ + 1 ) , + D3D12_BARRIER_LAYOUT_UNORDERED_ACCESS = ( D3D12_BARRIER_LAYOUT_RENDER_TARGET + 1 ) , + D3D12_BARRIER_LAYOUT_DEPTH_STENCIL_WRITE = ( D3D12_BARRIER_LAYOUT_UNORDERED_ACCESS + 1 ) , + D3D12_BARRIER_LAYOUT_DEPTH_STENCIL_READ = ( D3D12_BARRIER_LAYOUT_DEPTH_STENCIL_WRITE + 1 ) , + D3D12_BARRIER_LAYOUT_SHADER_RESOURCE = ( D3D12_BARRIER_LAYOUT_DEPTH_STENCIL_READ + 1 ) , + D3D12_BARRIER_LAYOUT_COPY_SOURCE = ( D3D12_BARRIER_LAYOUT_SHADER_RESOURCE + 1 ) , + D3D12_BARRIER_LAYOUT_COPY_DEST = ( D3D12_BARRIER_LAYOUT_COPY_SOURCE + 1 ) , + D3D12_BARRIER_LAYOUT_RESOLVE_SOURCE = ( D3D12_BARRIER_LAYOUT_COPY_DEST + 1 ) , + D3D12_BARRIER_LAYOUT_RESOLVE_DEST = ( D3D12_BARRIER_LAYOUT_RESOLVE_SOURCE + 1 ) , + D3D12_BARRIER_LAYOUT_SHADING_RATE_SOURCE = ( D3D12_BARRIER_LAYOUT_RESOLVE_DEST + 1 ) , + D3D12_BARRIER_LAYOUT_VIDEO_DECODE_READ = ( D3D12_BARRIER_LAYOUT_SHADING_RATE_SOURCE + 1 ) , + D3D12_BARRIER_LAYOUT_VIDEO_DECODE_WRITE = ( D3D12_BARRIER_LAYOUT_VIDEO_DECODE_READ + 1 ) , + D3D12_BARRIER_LAYOUT_VIDEO_PROCESS_READ = ( D3D12_BARRIER_LAYOUT_VIDEO_DECODE_WRITE + 1 ) , + D3D12_BARRIER_LAYOUT_VIDEO_PROCESS_WRITE = ( D3D12_BARRIER_LAYOUT_VIDEO_PROCESS_READ + 1 ) , + D3D12_BARRIER_LAYOUT_VIDEO_ENCODE_READ = ( D3D12_BARRIER_LAYOUT_VIDEO_PROCESS_WRITE + 1 ) , + D3D12_BARRIER_LAYOUT_VIDEO_ENCODE_WRITE = ( D3D12_BARRIER_LAYOUT_VIDEO_ENCODE_READ + 1 ) , + D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_COMMON = ( D3D12_BARRIER_LAYOUT_VIDEO_ENCODE_WRITE + 1 ) , + D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_GENERIC_READ = ( D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_COMMON + 1 ) , + D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_UNORDERED_ACCESS = ( D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_GENERIC_READ + 1 ) , + D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_SHADER_RESOURCE = ( D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_UNORDERED_ACCESS + 1 ) , + D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_COPY_SOURCE = ( D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_SHADER_RESOURCE + 1 ) , + D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_COPY_DEST = ( D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_COPY_SOURCE + 1 ) , + D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COMMON = ( D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_COPY_DEST + 1 ) , + D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_GENERIC_READ = ( D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COMMON + 1 ) , + D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_UNORDERED_ACCESS = ( D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_GENERIC_READ + 1 ) , + D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_SHADER_RESOURCE = ( D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_UNORDERED_ACCESS + 1 ) , + D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COPY_SOURCE = ( D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_SHADER_RESOURCE + 1 ) , + D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COPY_DEST = ( D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COPY_SOURCE + 1 ) , + D3D12_BARRIER_LAYOUT_VIDEO_QUEUE_COMMON = ( D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COPY_DEST + 1 ) + } D3D12_BARRIER_LAYOUT; + +typedef +enum D3D12_BARRIER_SYNC + { + D3D12_BARRIER_SYNC_NONE = 0, + D3D12_BARRIER_SYNC_ALL = 0x1, + D3D12_BARRIER_SYNC_DRAW = 0x2, + D3D12_BARRIER_SYNC_INPUT_ASSEMBLER = 0x4, + D3D12_BARRIER_SYNC_VERTEX_SHADING = 0x8, + D3D12_BARRIER_SYNC_PIXEL_SHADING = 0x10, + D3D12_BARRIER_SYNC_DEPTH_STENCIL = 0x20, + D3D12_BARRIER_SYNC_RENDER_TARGET = 0x40, + D3D12_BARRIER_SYNC_COMPUTE_SHADING = 0x80, + D3D12_BARRIER_SYNC_RAYTRACING = 0x100, + D3D12_BARRIER_SYNC_COPY = 0x200, + D3D12_BARRIER_SYNC_RESOLVE = 0x400, + D3D12_BARRIER_SYNC_EXECUTE_INDIRECT = 0x800, + D3D12_BARRIER_SYNC_PREDICATION = 0x800, + D3D12_BARRIER_SYNC_ALL_SHADING = 0x1000, + D3D12_BARRIER_SYNC_NON_PIXEL_SHADING = 0x2000, + D3D12_BARRIER_SYNC_EMIT_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO = 0x4000, + D3D12_BARRIER_SYNC_CLEAR_UNORDERED_ACCESS_VIEW = 0x8000, + D3D12_BARRIER_SYNC_VIDEO_DECODE = 0x100000, + D3D12_BARRIER_SYNC_VIDEO_PROCESS = 0x200000, + D3D12_BARRIER_SYNC_VIDEO_ENCODE = 0x400000, + D3D12_BARRIER_SYNC_BUILD_RAYTRACING_ACCELERATION_STRUCTURE = 0x800000, + D3D12_BARRIER_SYNC_COPY_RAYTRACING_ACCELERATION_STRUCTURE = 0x1000000, + D3D12_BARRIER_SYNC_SPLIT = 0x80000000 + } D3D12_BARRIER_SYNC; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_BARRIER_SYNC ); +typedef +enum D3D12_BARRIER_ACCESS + { + D3D12_BARRIER_ACCESS_COMMON = 0, + D3D12_BARRIER_ACCESS_VERTEX_BUFFER = 0x1, + D3D12_BARRIER_ACCESS_CONSTANT_BUFFER = 0x2, + D3D12_BARRIER_ACCESS_INDEX_BUFFER = 0x4, + D3D12_BARRIER_ACCESS_RENDER_TARGET = 0x8, + D3D12_BARRIER_ACCESS_UNORDERED_ACCESS = 0x10, + D3D12_BARRIER_ACCESS_DEPTH_STENCIL_WRITE = 0x20, + D3D12_BARRIER_ACCESS_DEPTH_STENCIL_READ = 0x40, + D3D12_BARRIER_ACCESS_SHADER_RESOURCE = 0x80, + D3D12_BARRIER_ACCESS_STREAM_OUTPUT = 0x100, + D3D12_BARRIER_ACCESS_INDIRECT_ARGUMENT = 0x200, + D3D12_BARRIER_ACCESS_PREDICATION = 0x200, + D3D12_BARRIER_ACCESS_COPY_DEST = 0x400, + D3D12_BARRIER_ACCESS_COPY_SOURCE = 0x800, + D3D12_BARRIER_ACCESS_RESOLVE_DEST = 0x1000, + D3D12_BARRIER_ACCESS_RESOLVE_SOURCE = 0x2000, + D3D12_BARRIER_ACCESS_RAYTRACING_ACCELERATION_STRUCTURE_READ = 0x4000, + D3D12_BARRIER_ACCESS_RAYTRACING_ACCELERATION_STRUCTURE_WRITE = 0x8000, + D3D12_BARRIER_ACCESS_SHADING_RATE_SOURCE = 0x10000, + D3D12_BARRIER_ACCESS_VIDEO_DECODE_READ = 0x20000, + D3D12_BARRIER_ACCESS_VIDEO_DECODE_WRITE = 0x40000, + D3D12_BARRIER_ACCESS_VIDEO_PROCESS_READ = 0x80000, + D3D12_BARRIER_ACCESS_VIDEO_PROCESS_WRITE = 0x100000, + D3D12_BARRIER_ACCESS_VIDEO_ENCODE_READ = 0x200000, + D3D12_BARRIER_ACCESS_VIDEO_ENCODE_WRITE = 0x400000, + D3D12_BARRIER_ACCESS_NO_ACCESS = 0x80000000 + } D3D12_BARRIER_ACCESS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_BARRIER_ACCESS ); +typedef +enum D3D12_BARRIER_TYPE + { + D3D12_BARRIER_TYPE_GLOBAL = 0, + D3D12_BARRIER_TYPE_TEXTURE = ( D3D12_BARRIER_TYPE_GLOBAL + 1 ) , + D3D12_BARRIER_TYPE_BUFFER = ( D3D12_BARRIER_TYPE_TEXTURE + 1 ) + } D3D12_BARRIER_TYPE; + +typedef +enum D3D12_TEXTURE_BARRIER_FLAGS + { + D3D12_TEXTURE_BARRIER_FLAG_NONE = 0, + D3D12_TEXTURE_BARRIER_FLAG_DISCARD = 0x1 + } D3D12_TEXTURE_BARRIER_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_TEXTURE_BARRIER_FLAGS ); +typedef struct D3D12_BARRIER_SUBRESOURCE_RANGE + { + UINT IndexOrFirstMipLevel; + UINT NumMipLevels; + UINT FirstArraySlice; + UINT NumArraySlices; + UINT FirstPlane; + UINT NumPlanes; + } D3D12_BARRIER_SUBRESOURCE_RANGE; + +typedef struct D3D12_GLOBAL_BARRIER + { + D3D12_BARRIER_SYNC SyncBefore; + D3D12_BARRIER_SYNC SyncAfter; + D3D12_BARRIER_ACCESS AccessBefore; + D3D12_BARRIER_ACCESS AccessAfter; + } D3D12_GLOBAL_BARRIER; + +typedef struct D3D12_TEXTURE_BARRIER + { + D3D12_BARRIER_SYNC SyncBefore; + D3D12_BARRIER_SYNC SyncAfter; + D3D12_BARRIER_ACCESS AccessBefore; + D3D12_BARRIER_ACCESS AccessAfter; + D3D12_BARRIER_LAYOUT LayoutBefore; + D3D12_BARRIER_LAYOUT LayoutAfter; + _In_ ID3D12Resource *pResource; + D3D12_BARRIER_SUBRESOURCE_RANGE Subresources; + D3D12_TEXTURE_BARRIER_FLAGS Flags; + } D3D12_TEXTURE_BARRIER; + +typedef struct D3D12_BUFFER_BARRIER + { + D3D12_BARRIER_SYNC SyncBefore; + D3D12_BARRIER_SYNC SyncAfter; + D3D12_BARRIER_ACCESS AccessBefore; + D3D12_BARRIER_ACCESS AccessAfter; + _In_ ID3D12Resource *pResource; + UINT64 Offset; + UINT64 Size; + } D3D12_BUFFER_BARRIER; + +typedef struct D3D12_BARRIER_GROUP + { + D3D12_BARRIER_TYPE Type; + UINT32 NumBarriers; + union + { + _In_reads_(NumBarriers) const D3D12_GLOBAL_BARRIER *pGlobalBarriers; + _In_reads_(NumBarriers) const D3D12_TEXTURE_BARRIER *pTextureBarriers; + _In_reads_(NumBarriers) const D3D12_BUFFER_BARRIER *pBufferBarriers; + } ; + } D3D12_BARRIER_GROUP; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0051_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0051_v0_0_s_ifspec; + +#ifndef __ID3D12ShaderCacheSession_INTERFACE_DEFINED__ +#define __ID3D12ShaderCacheSession_INTERFACE_DEFINED__ + +/* interface ID3D12ShaderCacheSession */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12ShaderCacheSession; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("28e2495d-0f64-4ae4-a6ec-129255dc49a8") + ID3D12ShaderCacheSession : public ID3D12DeviceChild + { + public: + virtual HRESULT STDMETHODCALLTYPE FindValue( + /* [annotation][in] */ + _In_reads_bytes_(KeySize) const void *pKey, + UINT KeySize, + /* [annotation][out] */ + _Out_writes_bytes_(*pValueSize) void *pValue, + _Inout_ UINT *pValueSize) = 0; + + virtual HRESULT STDMETHODCALLTYPE StoreValue( + /* [annotation][in] */ + _In_reads_bytes_(KeySize) const void *pKey, + UINT KeySize, + /* [annotation][in] */ + _In_reads_bytes_(ValueSize) const void *pValue, + UINT ValueSize) = 0; + + virtual void STDMETHODCALLTYPE SetDeleteOnDestroy( void) = 0; + +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_SHADER_CACHE_SESSION_DESC STDMETHODCALLTYPE GetDesc( void) = 0; +#else + virtual D3D12_SHADER_CACHE_SESSION_DESC *STDMETHODCALLTYPE GetDesc( + D3D12_SHADER_CACHE_SESSION_DESC * RetVal) = 0; +#endif + + }; + + +#else /* C style interface */ + + typedef struct ID3D12ShaderCacheSessionVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12ShaderCacheSession * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12ShaderCacheSession * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12ShaderCacheSession * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12ShaderCacheSession * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12ShaderCacheSession * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12ShaderCacheSession * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12ShaderCacheSession * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12ShaderCacheSession * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12ShaderCacheSession, FindValue) + HRESULT ( STDMETHODCALLTYPE *FindValue )( + ID3D12ShaderCacheSession * This, + /* [annotation][in] */ + _In_reads_bytes_(KeySize) const void *pKey, + UINT KeySize, + /* [annotation][out] */ + _Out_writes_bytes_(*pValueSize) void *pValue, + _Inout_ UINT *pValueSize); + + DECLSPEC_XFGVIRT(ID3D12ShaderCacheSession, StoreValue) + HRESULT ( STDMETHODCALLTYPE *StoreValue )( + ID3D12ShaderCacheSession * This, + /* [annotation][in] */ + _In_reads_bytes_(KeySize) const void *pKey, + UINT KeySize, + /* [annotation][in] */ + _In_reads_bytes_(ValueSize) const void *pValue, + UINT ValueSize); + + DECLSPEC_XFGVIRT(ID3D12ShaderCacheSession, SetDeleteOnDestroy) + void ( STDMETHODCALLTYPE *SetDeleteOnDestroy )( + ID3D12ShaderCacheSession * This); + + DECLSPEC_XFGVIRT(ID3D12ShaderCacheSession, GetDesc) +#if !defined(_WIN32) + D3D12_SHADER_CACHE_SESSION_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12ShaderCacheSession * This); + +#else + D3D12_SHADER_CACHE_SESSION_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12ShaderCacheSession * This, + D3D12_SHADER_CACHE_SESSION_DESC * RetVal); + +#endif + + END_INTERFACE + } ID3D12ShaderCacheSessionVtbl; + + interface ID3D12ShaderCacheSession + { + CONST_VTBL struct ID3D12ShaderCacheSessionVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12ShaderCacheSession_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12ShaderCacheSession_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12ShaderCacheSession_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12ShaderCacheSession_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12ShaderCacheSession_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12ShaderCacheSession_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12ShaderCacheSession_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12ShaderCacheSession_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12ShaderCacheSession_FindValue(This,pKey,KeySize,pValue,pValueSize) \ + ( (This)->lpVtbl -> FindValue(This,pKey,KeySize,pValue,pValueSize) ) + +#define ID3D12ShaderCacheSession_StoreValue(This,pKey,KeySize,pValue,ValueSize) \ + ( (This)->lpVtbl -> StoreValue(This,pKey,KeySize,pValue,ValueSize) ) + +#define ID3D12ShaderCacheSession_SetDeleteOnDestroy(This) \ + ( (This)->lpVtbl -> SetDeleteOnDestroy(This) ) +#if !defined(_WIN32) + +#define ID3D12ShaderCacheSession_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) +#else +#define ID3D12ShaderCacheSession_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) +#endif + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12ShaderCacheSession_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0052 */ +/* [local] */ + +typedef +enum D3D12_SHADER_CACHE_KIND_FLAGS + { + D3D12_SHADER_CACHE_KIND_FLAG_IMPLICIT_D3D_CACHE_FOR_DRIVER = 0x1, + D3D12_SHADER_CACHE_KIND_FLAG_IMPLICIT_D3D_CONVERSIONS = 0x2, + D3D12_SHADER_CACHE_KIND_FLAG_IMPLICIT_DRIVER_MANAGED = 0x4, + D3D12_SHADER_CACHE_KIND_FLAG_APPLICATION_MANAGED = 0x8 + } D3D12_SHADER_CACHE_KIND_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_SHADER_CACHE_KIND_FLAGS ); +typedef +enum D3D12_SHADER_CACHE_CONTROL_FLAGS + { + D3D12_SHADER_CACHE_CONTROL_FLAG_DISABLE = 0x1, + D3D12_SHADER_CACHE_CONTROL_FLAG_ENABLE = 0x2, + D3D12_SHADER_CACHE_CONTROL_FLAG_CLEAR = 0x4 + } D3D12_SHADER_CACHE_CONTROL_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_SHADER_CACHE_CONTROL_FLAGS ); + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0052_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0052_v0_0_s_ifspec; + +#ifndef __ID3D12Device9_INTERFACE_DEFINED__ +#define __ID3D12Device9_INTERFACE_DEFINED__ + +/* interface ID3D12Device9 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Device9; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("4c80e962-f032-4f60-bc9e-ebc2cfa1d83c") + ID3D12Device9 : public ID3D12Device8 + { + public: + virtual HRESULT STDMETHODCALLTYPE CreateShaderCacheSession( + _In_ const D3D12_SHADER_CACHE_SESSION_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvSession) = 0; + + virtual HRESULT STDMETHODCALLTYPE ShaderCacheControl( + D3D12_SHADER_CACHE_KIND_FLAGS Kinds, + D3D12_SHADER_CACHE_CONTROL_FLAGS Control) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateCommandQueue1( + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID CreatorID, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Device9Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Device9 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Device9 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Device9 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Device9 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Device9 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Device9 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Device9 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount) + UINT ( STDMETHODCALLTYPE *GetNodeCount )( + ID3D12Device9 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )( + ID3D12Device9 * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator) + HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )( + ID3D12Device9 * This, + _In_ D3D12_COMMAND_LIST_TYPE type, + REFIID riid, + _COM_Outptr_ void **ppCommandAllocator); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )( + ID3D12Device9 * This, + _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )( + ID3D12Device9 * This, + _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList )( + ID3D12Device9 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ ID3D12CommandAllocator *pCommandAllocator, + _In_opt_ ID3D12PipelineState *pInitialState, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport) + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D12Device9 * This, + D3D12_FEATURE Feature, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap) + HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )( + ID3D12Device9 * This, + _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize) + UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )( + ID3D12Device9 * This, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature) + HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )( + ID3D12Device9 * This, + _In_ UINT nodeMask, + _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature, + _In_ SIZE_T blobLengthInBytes, + REFIID riid, + _COM_Outptr_ void **ppvRootSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView) + void ( STDMETHODCALLTYPE *CreateConstantBufferView )( + ID3D12Device9 * This, + _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView) + void ( STDMETHODCALLTYPE *CreateShaderResourceView )( + ID3D12Device9 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )( + ID3D12Device9 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ ID3D12Resource *pCounterResource, + _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView) + void ( STDMETHODCALLTYPE *CreateRenderTargetView )( + ID3D12Device9 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView) + void ( STDMETHODCALLTYPE *CreateDepthStencilView )( + ID3D12Device9 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler) + void ( STDMETHODCALLTYPE *CreateSampler )( + ID3D12Device9 * This, + _In_ const D3D12_SAMPLER_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors) + void ( STDMETHODCALLTYPE *CopyDescriptors )( + ID3D12Device9 * This, + _In_ UINT NumDestDescriptorRanges, + _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts, + _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes, + _In_ UINT NumSrcDescriptorRanges, + _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts, + _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple) + void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )( + ID3D12Device9 * This, + _In_ UINT NumDescriptors, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device9 * This, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device9 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties) +#if !defined(_WIN32) + D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device9 * This, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#else + D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device9 * This, + D3D12_HEAP_PROPERTIES * RetVal, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )( + ID3D12Device9 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap) + HRESULT ( STDMETHODCALLTYPE *CreateHeap )( + ID3D12Device9 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )( + ID3D12Device9 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )( + ID3D12Device9 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle) + HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )( + ID3D12Device9 * This, + _In_ ID3D12DeviceChild *pObject, + _In_opt_ const SECURITY_ATTRIBUTES *pAttributes, + DWORD Access, + _In_opt_ LPCWSTR Name, + _Out_ HANDLE *pHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )( + ID3D12Device9 * This, + _In_ HANDLE NTHandle, + REFIID riid, + _COM_Outptr_opt_ void **ppvObj); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )( + ID3D12Device9 * This, + _In_ LPCWSTR Name, + DWORD Access, + /* [annotation][out] */ + _Out_ HANDLE *pNTHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, MakeResident) + HRESULT ( STDMETHODCALLTYPE *MakeResident )( + ID3D12Device9 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, Evict) + HRESULT ( STDMETHODCALLTYPE *Evict )( + ID3D12Device9 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateFence) + HRESULT ( STDMETHODCALLTYPE *CreateFence )( + ID3D12Device9 * This, + UINT64 InitialValue, + D3D12_FENCE_FLAGS Flags, + REFIID riid, + _COM_Outptr_ void **ppFence); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason) + HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( + ID3D12Device9 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints) + void ( STDMETHODCALLTYPE *GetCopyableFootprints )( + ID3D12Device9 * This, + _In_ const D3D12_RESOURCE_DESC *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap) + HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )( + ID3D12Device9 * This, + _In_ const D3D12_QUERY_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState) + HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )( + ID3D12Device9 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature) + HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )( + ID3D12Device9 * This, + _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc, + _In_opt_ ID3D12RootSignature *pRootSignature, + REFIID riid, + _COM_Outptr_opt_ void **ppvCommandSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling) + void ( STDMETHODCALLTYPE *GetResourceTiling )( + ID3D12Device9 * This, + _In_ ID3D12Resource *pTiledResource, + _Out_opt_ UINT *pNumTilesForEntireResource, + _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc, + _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips, + _Inout_opt_ UINT *pNumSubresourceTilings, + _In_ UINT FirstSubresourceTilingToGet, + _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips); + + DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid) +#if !defined(_WIN32) + LUID ( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device9 * This); + +#else + LUID *( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device9 * This, + LUID * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )( + ID3D12Device9 * This, + _In_reads_(BlobLength) const void *pLibraryBlob, + SIZE_T BlobLength, + REFIID riid, + _COM_Outptr_ void **ppPipelineLibrary); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion) + HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )( + ID3D12Device9 * This, + _In_reads_(NumFences) ID3D12Fence *const *ppFences, + _In_reads_(NumFences) const UINT64 *pFenceValues, + UINT NumFences, + D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags, + HANDLE hEvent); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority) + HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )( + ID3D12Device9 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities); + + DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )( + ID3D12Device9 * This, + const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )( + ID3D12Device9 * This, + _In_ const void *pAddress, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )( + ID3D12Device9 * This, + _In_ HANDLE hFileMapping, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident) + HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )( + ID3D12Device9 * This, + D3D12_RESIDENCY_FLAGS Flags, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_ ID3D12Fence *pFenceToSignal, + UINT64 FenceValueToSignal); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommandList1) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList1 )( + ID3D12Device9 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ D3D12_COMMAND_LIST_FLAGS flags, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession )( + ID3D12Device9 * This, + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommittedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource1 )( + ID3D12Device9 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateHeap1) + HRESULT ( STDMETHODCALLTYPE *CreateHeap1 )( + ID3D12Device9 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateReservedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource1 )( + ID3D12Device9 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, GetResourceAllocationInfo1) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device9 * This, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device9 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateLifetimeTracker) + HRESULT ( STDMETHODCALLTYPE *CreateLifetimeTracker )( + ID3D12Device9 * This, + _In_ ID3D12LifetimeOwner *pOwner, + REFIID riid, + _COM_Outptr_ void **ppvTracker); + + DECLSPEC_XFGVIRT(ID3D12Device5, RemoveDevice) + void ( STDMETHODCALLTYPE *RemoveDevice )( + ID3D12Device9 * This); + + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommands) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommands )( + ID3D12Device9 * This, + _Inout_ UINT *pNumMetaCommands, + _Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs); + + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommandParameters) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommandParameters )( + ID3D12Device9 * This, + _In_ REFGUID CommandId, + _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage, + _Out_opt_ UINT *pTotalStructureSizeInBytes, + _Inout_ UINT *pParameterCount, + _Out_writes_opt_(*pParameterCount) D3D12_META_COMMAND_PARAMETER_DESC *pParameterDescs); + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateMetaCommand) + HRESULT ( STDMETHODCALLTYPE *CreateMetaCommand )( + ID3D12Device9 * This, + _In_ REFGUID CommandId, + _In_ UINT NodeMask, + _In_reads_bytes_opt_(CreationParametersDataSizeInBytes) const void *pCreationParametersData, + _In_ SIZE_T CreationParametersDataSizeInBytes, + REFIID riid, + _COM_Outptr_ void **ppMetaCommand); + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateStateObject) + HRESULT ( STDMETHODCALLTYPE *CreateStateObject )( + ID3D12Device9 * This, + const D3D12_STATE_OBJECT_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppStateObject); + + DECLSPEC_XFGVIRT(ID3D12Device5, GetRaytracingAccelerationStructurePrebuildInfo) + void ( STDMETHODCALLTYPE *GetRaytracingAccelerationStructurePrebuildInfo )( + ID3D12Device9 * This, + _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc, + _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo); + + DECLSPEC_XFGVIRT(ID3D12Device5, CheckDriverMatchingIdentifier) + D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS ( STDMETHODCALLTYPE *CheckDriverMatchingIdentifier )( + ID3D12Device9 * This, + _In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType, + _In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck); + + DECLSPEC_XFGVIRT(ID3D12Device6, SetBackgroundProcessingMode) + HRESULT ( STDMETHODCALLTYPE *SetBackgroundProcessingMode )( + ID3D12Device9 * This, + D3D12_BACKGROUND_PROCESSING_MODE Mode, + D3D12_MEASUREMENTS_ACTION MeasurementsAction, + _In_opt_ HANDLE hEventToSignalUponCompletion, + _Out_opt_ BOOL *pbFurtherMeasurementsDesired); + + DECLSPEC_XFGVIRT(ID3D12Device7, AddToStateObject) + HRESULT ( STDMETHODCALLTYPE *AddToStateObject )( + ID3D12Device9 * This, + const D3D12_STATE_OBJECT_DESC *pAddition, + ID3D12StateObject *pStateObjectToGrowFrom, + REFIID riid, + _COM_Outptr_ void **ppNewStateObject); + + DECLSPEC_XFGVIRT(ID3D12Device7, CreateProtectedResourceSession1) + HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession1 )( + ID3D12Device9 * This, + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession); + + DECLSPEC_XFGVIRT(ID3D12Device8, GetResourceAllocationInfo2) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )( + ID3D12Device9 * This, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )( + ID3D12Device9 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device8, CreateCommittedResource2) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource2 )( + ID3D12Device9 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device8, CreatePlacedResource1) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource1 )( + ID3D12Device9 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device8, CreateSamplerFeedbackUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateSamplerFeedbackUnorderedAccessView )( + ID3D12Device9 * This, + _In_opt_ ID3D12Resource *pTargetedResource, + _In_opt_ ID3D12Resource *pFeedbackResource, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device8, GetCopyableFootprints1) + void ( STDMETHODCALLTYPE *GetCopyableFootprints1 )( + ID3D12Device9 * This, + _In_ const D3D12_RESOURCE_DESC1 *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); + + DECLSPEC_XFGVIRT(ID3D12Device9, CreateShaderCacheSession) + HRESULT ( STDMETHODCALLTYPE *CreateShaderCacheSession )( + ID3D12Device9 * This, + _In_ const D3D12_SHADER_CACHE_SESSION_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvSession); + + DECLSPEC_XFGVIRT(ID3D12Device9, ShaderCacheControl) + HRESULT ( STDMETHODCALLTYPE *ShaderCacheControl )( + ID3D12Device9 * This, + D3D12_SHADER_CACHE_KIND_FLAGS Kinds, + D3D12_SHADER_CACHE_CONTROL_FLAGS Control); + + DECLSPEC_XFGVIRT(ID3D12Device9, CreateCommandQueue1) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue1 )( + ID3D12Device9 * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID CreatorID, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue); + + END_INTERFACE + } ID3D12Device9Vtbl; + + interface ID3D12Device9 + { + CONST_VTBL struct ID3D12Device9Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Device9_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Device9_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Device9_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Device9_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Device9_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Device9_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Device9_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Device9_GetNodeCount(This) \ + ( (This)->lpVtbl -> GetNodeCount(This) ) + +#define ID3D12Device9_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) ) + +#define ID3D12Device9_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ + ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) ) + +#define ID3D12Device9_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device9_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device9_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) ) + +#define ID3D12Device9_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) ) + +#define ID3D12Device9_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) ) + +#define ID3D12Device9_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ + ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) ) + +#define ID3D12Device9_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ + ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) ) + +#define ID3D12Device9_CreateConstantBufferView(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) ) + +#define ID3D12Device9_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device9_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) ) + +#define ID3D12Device9_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device9_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device9_CreateSampler(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) ) + +#define ID3D12Device9_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) ) + +#define ID3D12Device9_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) ) +#if !defined(_WIN32) + +#define ID3D12Device9_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) ) +#else +#define ID3D12Device9_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) ) +#endif +#if !defined(_WIN32) + +#define ID3D12Device9_GetCustomHeapProperties(This,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) ) +#else +#define ID3D12Device9_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) ) +#endif + +#define ID3D12Device9_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) ) + +#define ID3D12Device9_CreateHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device9_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device9_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device9_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ + ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) ) + +#define ID3D12Device9_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ + ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) ) + +#define ID3D12Device9_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ + ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) ) + +#define ID3D12Device9_MakeResident(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) ) + +#define ID3D12Device9_Evict(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) ) + +#define ID3D12Device9_CreateFence(This,InitialValue,Flags,riid,ppFence) \ + ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) ) + +#define ID3D12Device9_GetDeviceRemovedReason(This) \ + ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) + +#define ID3D12Device9_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) + +#define ID3D12Device9_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device9_SetStablePowerState(This,Enable) \ + ( (This)->lpVtbl -> SetStablePowerState(This,Enable) ) + +#define ID3D12Device9_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ + ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) ) + +#define ID3D12Device9_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ + ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) ) +#if !defined(_WIN32) + +#define ID3D12Device9_GetAdapterLuid(This) \ + ( (This)->lpVtbl -> GetAdapterLuid(This) ) +#else +#define ID3D12Device9_GetAdapterLuid(This,RetVal) \ + ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) ) +#endif + + +#define ID3D12Device9_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \ + ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) ) + +#define ID3D12Device9_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \ + ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) ) + +#define ID3D12Device9_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \ + ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) ) + + +#define ID3D12Device9_CreatePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) ) + + +#define ID3D12Device9_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) ) + +#define ID3D12Device9_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) ) + +#define ID3D12Device9_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \ + ( (This)->lpVtbl -> EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) ) + + +#define ID3D12Device9_CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) ) + +#define ID3D12Device9_CreateProtectedResourceSession(This,pDesc,riid,ppSession) \ + ( (This)->lpVtbl -> CreateProtectedResourceSession(This,pDesc,riid,ppSession) ) + +#define ID3D12Device9_CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) + +#define ID3D12Device9_CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) ) + +#define ID3D12Device9_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) ) +#if !defined(_WIN32) + +#define ID3D12Device9_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#else +#define ID3D12Device9_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#endif + + +#define ID3D12Device9_CreateLifetimeTracker(This,pOwner,riid,ppvTracker) \ + ( (This)->lpVtbl -> CreateLifetimeTracker(This,pOwner,riid,ppvTracker) ) + +#define ID3D12Device9_RemoveDevice(This) \ + ( (This)->lpVtbl -> RemoveDevice(This) ) + +#define ID3D12Device9_EnumerateMetaCommands(This,pNumMetaCommands,pDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommands(This,pNumMetaCommands,pDescs) ) + +#define ID3D12Device9_EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) ) + +#define ID3D12Device9_CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) \ + ( (This)->lpVtbl -> CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) ) + +#define ID3D12Device9_CreateStateObject(This,pDesc,riid,ppStateObject) \ + ( (This)->lpVtbl -> CreateStateObject(This,pDesc,riid,ppStateObject) ) + +#define ID3D12Device9_GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) \ + ( (This)->lpVtbl -> GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) ) + +#define ID3D12Device9_CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) \ + ( (This)->lpVtbl -> CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) ) + + +#define ID3D12Device9_SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) \ + ( (This)->lpVtbl -> SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) ) + + +#define ID3D12Device9_AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) \ + ( (This)->lpVtbl -> AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) ) + +#define ID3D12Device9_CreateProtectedResourceSession1(This,pDesc,riid,ppSession) \ + ( (This)->lpVtbl -> CreateProtectedResourceSession1(This,pDesc,riid,ppSession) ) + +#if !defined(_WIN32) + +#define ID3D12Device9_GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#else +#define ID3D12Device9_GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#endif + +#define ID3D12Device9_CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) + +#define ID3D12Device9_CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device9_CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) ) + +#define ID3D12Device9_GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) + + +#define ID3D12Device9_CreateShaderCacheSession(This,pDesc,riid,ppvSession) \ + ( (This)->lpVtbl -> CreateShaderCacheSession(This,pDesc,riid,ppvSession) ) + +#define ID3D12Device9_ShaderCacheControl(This,Kinds,Control) \ + ( (This)->lpVtbl -> ShaderCacheControl(This,Kinds,Control) ) + +#define ID3D12Device9_CreateCommandQueue1(This,pDesc,CreatorID,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue1(This,pDesc,CreatorID,riid,ppCommandQueue) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Device9_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Device10_INTERFACE_DEFINED__ +#define __ID3D12Device10_INTERFACE_DEFINED__ + +/* interface ID3D12Device10 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Device10; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("517f8718-aa66-49f9-b02b-a7ab89c06031") + ID3D12Device10 : public ID3D12Device9 + { + public: + virtual HRESULT STDMETHODCALLTYPE CreateCommittedResource3( + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + UINT32 NumCastableFormats, + _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreatePlacedResource2( + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + UINT32 NumCastableFormats, + _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateReservedResource2( + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + UINT32 NumCastableFormats, + _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Device10Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Device10 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Device10 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Device10 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Device10 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Device10 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Device10 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Device10 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount) + UINT ( STDMETHODCALLTYPE *GetNodeCount )( + ID3D12Device10 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )( + ID3D12Device10 * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator) + HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )( + ID3D12Device10 * This, + _In_ D3D12_COMMAND_LIST_TYPE type, + REFIID riid, + _COM_Outptr_ void **ppCommandAllocator); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )( + ID3D12Device10 * This, + _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )( + ID3D12Device10 * This, + _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList )( + ID3D12Device10 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ ID3D12CommandAllocator *pCommandAllocator, + _In_opt_ ID3D12PipelineState *pInitialState, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport) + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D12Device10 * This, + D3D12_FEATURE Feature, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap) + HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )( + ID3D12Device10 * This, + _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize) + UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )( + ID3D12Device10 * This, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature) + HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )( + ID3D12Device10 * This, + _In_ UINT nodeMask, + _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature, + _In_ SIZE_T blobLengthInBytes, + REFIID riid, + _COM_Outptr_ void **ppvRootSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView) + void ( STDMETHODCALLTYPE *CreateConstantBufferView )( + ID3D12Device10 * This, + _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView) + void ( STDMETHODCALLTYPE *CreateShaderResourceView )( + ID3D12Device10 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )( + ID3D12Device10 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ ID3D12Resource *pCounterResource, + _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView) + void ( STDMETHODCALLTYPE *CreateRenderTargetView )( + ID3D12Device10 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView) + void ( STDMETHODCALLTYPE *CreateDepthStencilView )( + ID3D12Device10 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler) + void ( STDMETHODCALLTYPE *CreateSampler )( + ID3D12Device10 * This, + _In_ const D3D12_SAMPLER_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors) + void ( STDMETHODCALLTYPE *CopyDescriptors )( + ID3D12Device10 * This, + _In_ UINT NumDestDescriptorRanges, + _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts, + _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes, + _In_ UINT NumSrcDescriptorRanges, + _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts, + _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple) + void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )( + ID3D12Device10 * This, + _In_ UINT NumDescriptors, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device10 * This, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device10 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties) +#if !defined(_WIN32) + D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device10 * This, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#else + D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device10 * This, + D3D12_HEAP_PROPERTIES * RetVal, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )( + ID3D12Device10 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap) + HRESULT ( STDMETHODCALLTYPE *CreateHeap )( + ID3D12Device10 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )( + ID3D12Device10 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )( + ID3D12Device10 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle) + HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )( + ID3D12Device10 * This, + _In_ ID3D12DeviceChild *pObject, + _In_opt_ const SECURITY_ATTRIBUTES *pAttributes, + DWORD Access, + _In_opt_ LPCWSTR Name, + _Out_ HANDLE *pHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )( + ID3D12Device10 * This, + _In_ HANDLE NTHandle, + REFIID riid, + _COM_Outptr_opt_ void **ppvObj); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )( + ID3D12Device10 * This, + _In_ LPCWSTR Name, + DWORD Access, + /* [annotation][out] */ + _Out_ HANDLE *pNTHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, MakeResident) + HRESULT ( STDMETHODCALLTYPE *MakeResident )( + ID3D12Device10 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, Evict) + HRESULT ( STDMETHODCALLTYPE *Evict )( + ID3D12Device10 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateFence) + HRESULT ( STDMETHODCALLTYPE *CreateFence )( + ID3D12Device10 * This, + UINT64 InitialValue, + D3D12_FENCE_FLAGS Flags, + REFIID riid, + _COM_Outptr_ void **ppFence); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason) + HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( + ID3D12Device10 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints) + void ( STDMETHODCALLTYPE *GetCopyableFootprints )( + ID3D12Device10 * This, + _In_ const D3D12_RESOURCE_DESC *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap) + HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )( + ID3D12Device10 * This, + _In_ const D3D12_QUERY_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState) + HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )( + ID3D12Device10 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature) + HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )( + ID3D12Device10 * This, + _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc, + _In_opt_ ID3D12RootSignature *pRootSignature, + REFIID riid, + _COM_Outptr_opt_ void **ppvCommandSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling) + void ( STDMETHODCALLTYPE *GetResourceTiling )( + ID3D12Device10 * This, + _In_ ID3D12Resource *pTiledResource, + _Out_opt_ UINT *pNumTilesForEntireResource, + _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc, + _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips, + _Inout_opt_ UINT *pNumSubresourceTilings, + _In_ UINT FirstSubresourceTilingToGet, + _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips); + + DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid) +#if !defined(_WIN32) + LUID ( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device10 * This); + +#else + LUID *( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device10 * This, + LUID * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )( + ID3D12Device10 * This, + _In_reads_(BlobLength) const void *pLibraryBlob, + SIZE_T BlobLength, + REFIID riid, + _COM_Outptr_ void **ppPipelineLibrary); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion) + HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )( + ID3D12Device10 * This, + _In_reads_(NumFences) ID3D12Fence *const *ppFences, + _In_reads_(NumFences) const UINT64 *pFenceValues, + UINT NumFences, + D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags, + HANDLE hEvent); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority) + HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )( + ID3D12Device10 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities); + + DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )( + ID3D12Device10 * This, + const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )( + ID3D12Device10 * This, + _In_ const void *pAddress, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )( + ID3D12Device10 * This, + _In_ HANDLE hFileMapping, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident) + HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )( + ID3D12Device10 * This, + D3D12_RESIDENCY_FLAGS Flags, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_ ID3D12Fence *pFenceToSignal, + UINT64 FenceValueToSignal); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommandList1) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList1 )( + ID3D12Device10 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ D3D12_COMMAND_LIST_FLAGS flags, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession )( + ID3D12Device10 * This, + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommittedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource1 )( + ID3D12Device10 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateHeap1) + HRESULT ( STDMETHODCALLTYPE *CreateHeap1 )( + ID3D12Device10 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateReservedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource1 )( + ID3D12Device10 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, GetResourceAllocationInfo1) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device10 * This, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device10 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateLifetimeTracker) + HRESULT ( STDMETHODCALLTYPE *CreateLifetimeTracker )( + ID3D12Device10 * This, + _In_ ID3D12LifetimeOwner *pOwner, + REFIID riid, + _COM_Outptr_ void **ppvTracker); + + DECLSPEC_XFGVIRT(ID3D12Device5, RemoveDevice) + void ( STDMETHODCALLTYPE *RemoveDevice )( + ID3D12Device10 * This); + + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommands) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommands )( + ID3D12Device10 * This, + _Inout_ UINT *pNumMetaCommands, + _Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs); + + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommandParameters) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommandParameters )( + ID3D12Device10 * This, + _In_ REFGUID CommandId, + _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage, + _Out_opt_ UINT *pTotalStructureSizeInBytes, + _Inout_ UINT *pParameterCount, + _Out_writes_opt_(*pParameterCount) D3D12_META_COMMAND_PARAMETER_DESC *pParameterDescs); + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateMetaCommand) + HRESULT ( STDMETHODCALLTYPE *CreateMetaCommand )( + ID3D12Device10 * This, + _In_ REFGUID CommandId, + _In_ UINT NodeMask, + _In_reads_bytes_opt_(CreationParametersDataSizeInBytes) const void *pCreationParametersData, + _In_ SIZE_T CreationParametersDataSizeInBytes, + REFIID riid, + _COM_Outptr_ void **ppMetaCommand); + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateStateObject) + HRESULT ( STDMETHODCALLTYPE *CreateStateObject )( + ID3D12Device10 * This, + const D3D12_STATE_OBJECT_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppStateObject); + + DECLSPEC_XFGVIRT(ID3D12Device5, GetRaytracingAccelerationStructurePrebuildInfo) + void ( STDMETHODCALLTYPE *GetRaytracingAccelerationStructurePrebuildInfo )( + ID3D12Device10 * This, + _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc, + _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo); + + DECLSPEC_XFGVIRT(ID3D12Device5, CheckDriverMatchingIdentifier) + D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS ( STDMETHODCALLTYPE *CheckDriverMatchingIdentifier )( + ID3D12Device10 * This, + _In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType, + _In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck); + + DECLSPEC_XFGVIRT(ID3D12Device6, SetBackgroundProcessingMode) + HRESULT ( STDMETHODCALLTYPE *SetBackgroundProcessingMode )( + ID3D12Device10 * This, + D3D12_BACKGROUND_PROCESSING_MODE Mode, + D3D12_MEASUREMENTS_ACTION MeasurementsAction, + _In_opt_ HANDLE hEventToSignalUponCompletion, + _Out_opt_ BOOL *pbFurtherMeasurementsDesired); + + DECLSPEC_XFGVIRT(ID3D12Device7, AddToStateObject) + HRESULT ( STDMETHODCALLTYPE *AddToStateObject )( + ID3D12Device10 * This, + const D3D12_STATE_OBJECT_DESC *pAddition, + ID3D12StateObject *pStateObjectToGrowFrom, + REFIID riid, + _COM_Outptr_ void **ppNewStateObject); + + DECLSPEC_XFGVIRT(ID3D12Device7, CreateProtectedResourceSession1) + HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession1 )( + ID3D12Device10 * This, + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession); + + DECLSPEC_XFGVIRT(ID3D12Device8, GetResourceAllocationInfo2) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )( + ID3D12Device10 * This, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )( + ID3D12Device10 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device8, CreateCommittedResource2) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource2 )( + ID3D12Device10 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device8, CreatePlacedResource1) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource1 )( + ID3D12Device10 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device8, CreateSamplerFeedbackUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateSamplerFeedbackUnorderedAccessView )( + ID3D12Device10 * This, + _In_opt_ ID3D12Resource *pTargetedResource, + _In_opt_ ID3D12Resource *pFeedbackResource, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device8, GetCopyableFootprints1) + void ( STDMETHODCALLTYPE *GetCopyableFootprints1 )( + ID3D12Device10 * This, + _In_ const D3D12_RESOURCE_DESC1 *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); + + DECLSPEC_XFGVIRT(ID3D12Device9, CreateShaderCacheSession) + HRESULT ( STDMETHODCALLTYPE *CreateShaderCacheSession )( + ID3D12Device10 * This, + _In_ const D3D12_SHADER_CACHE_SESSION_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvSession); + + DECLSPEC_XFGVIRT(ID3D12Device9, ShaderCacheControl) + HRESULT ( STDMETHODCALLTYPE *ShaderCacheControl )( + ID3D12Device10 * This, + D3D12_SHADER_CACHE_KIND_FLAGS Kinds, + D3D12_SHADER_CACHE_CONTROL_FLAGS Control); + + DECLSPEC_XFGVIRT(ID3D12Device9, CreateCommandQueue1) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue1 )( + ID3D12Device10 * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID CreatorID, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue); + + DECLSPEC_XFGVIRT(ID3D12Device10, CreateCommittedResource3) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource3 )( + ID3D12Device10 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + UINT32 NumCastableFormats, + _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device10, CreatePlacedResource2) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource2 )( + ID3D12Device10 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + UINT32 NumCastableFormats, + _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device10, CreateReservedResource2) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource2 )( + ID3D12Device10 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + UINT32 NumCastableFormats, + _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + END_INTERFACE + } ID3D12Device10Vtbl; + + interface ID3D12Device10 + { + CONST_VTBL struct ID3D12Device10Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Device10_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Device10_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Device10_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Device10_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Device10_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Device10_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Device10_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Device10_GetNodeCount(This) \ + ( (This)->lpVtbl -> GetNodeCount(This) ) + +#define ID3D12Device10_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) ) + +#define ID3D12Device10_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ + ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) ) + +#define ID3D12Device10_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device10_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device10_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) ) + +#define ID3D12Device10_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) ) + +#define ID3D12Device10_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) ) + +#define ID3D12Device10_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ + ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) ) + +#define ID3D12Device10_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ + ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) ) + +#define ID3D12Device10_CreateConstantBufferView(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) ) + +#define ID3D12Device10_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device10_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) ) + +#define ID3D12Device10_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device10_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device10_CreateSampler(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) ) + +#define ID3D12Device10_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) ) + +#define ID3D12Device10_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) ) +#if !defined(_WIN32) + +#define ID3D12Device10_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) ) +#else +#define ID3D12Device10_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) ) +#endif +#if !defined(_WIN32) + +#define ID3D12Device10_GetCustomHeapProperties(This,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) ) +#else +#define ID3D12Device10_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) ) +#endif + +#define ID3D12Device10_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) ) + +#define ID3D12Device10_CreateHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device10_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device10_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device10_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ + ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) ) + +#define ID3D12Device10_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ + ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) ) + +#define ID3D12Device10_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ + ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) ) + +#define ID3D12Device10_MakeResident(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) ) + +#define ID3D12Device10_Evict(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) ) + +#define ID3D12Device10_CreateFence(This,InitialValue,Flags,riid,ppFence) \ + ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) ) + +#define ID3D12Device10_GetDeviceRemovedReason(This) \ + ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) + +#define ID3D12Device10_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) + +#define ID3D12Device10_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device10_SetStablePowerState(This,Enable) \ + ( (This)->lpVtbl -> SetStablePowerState(This,Enable) ) + +#define ID3D12Device10_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ + ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) ) + +#define ID3D12Device10_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ + ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) ) +#if !defined(_WIN32) + +#define ID3D12Device10_GetAdapterLuid(This) \ + ( (This)->lpVtbl -> GetAdapterLuid(This) ) +#else +#define ID3D12Device10_GetAdapterLuid(This,RetVal) \ + ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) ) +#endif + + +#define ID3D12Device10_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \ + ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) ) + +#define ID3D12Device10_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \ + ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) ) + +#define ID3D12Device10_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \ + ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) ) + + +#define ID3D12Device10_CreatePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) ) + + +#define ID3D12Device10_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) ) + +#define ID3D12Device10_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) ) + +#define ID3D12Device10_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \ + ( (This)->lpVtbl -> EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) ) + + +#define ID3D12Device10_CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) ) + +#define ID3D12Device10_CreateProtectedResourceSession(This,pDesc,riid,ppSession) \ + ( (This)->lpVtbl -> CreateProtectedResourceSession(This,pDesc,riid,ppSession) ) + +#define ID3D12Device10_CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) + +#define ID3D12Device10_CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) ) + +#define ID3D12Device10_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) ) +#if !defined(_WIN32) + +#define ID3D12Device10_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#else +#define ID3D12Device10_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#endif + + +#define ID3D12Device10_CreateLifetimeTracker(This,pOwner,riid,ppvTracker) \ + ( (This)->lpVtbl -> CreateLifetimeTracker(This,pOwner,riid,ppvTracker) ) + +#define ID3D12Device10_RemoveDevice(This) \ + ( (This)->lpVtbl -> RemoveDevice(This) ) + +#define ID3D12Device10_EnumerateMetaCommands(This,pNumMetaCommands,pDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommands(This,pNumMetaCommands,pDescs) ) + +#define ID3D12Device10_EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) ) + +#define ID3D12Device10_CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) \ + ( (This)->lpVtbl -> CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) ) + +#define ID3D12Device10_CreateStateObject(This,pDesc,riid,ppStateObject) \ + ( (This)->lpVtbl -> CreateStateObject(This,pDesc,riid,ppStateObject) ) + +#define ID3D12Device10_GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) \ + ( (This)->lpVtbl -> GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) ) + +#define ID3D12Device10_CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) \ + ( (This)->lpVtbl -> CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) ) + + +#define ID3D12Device10_SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) \ + ( (This)->lpVtbl -> SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) ) + + +#define ID3D12Device10_AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) \ + ( (This)->lpVtbl -> AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) ) + +#define ID3D12Device10_CreateProtectedResourceSession1(This,pDesc,riid,ppSession) \ + ( (This)->lpVtbl -> CreateProtectedResourceSession1(This,pDesc,riid,ppSession) ) + +#if !defined(_WIN32) + +#define ID3D12Device10_GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#else +#define ID3D12Device10_GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#endif + +#define ID3D12Device10_CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) + +#define ID3D12Device10_CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device10_CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) ) + +#define ID3D12Device10_GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) + + +#define ID3D12Device10_CreateShaderCacheSession(This,pDesc,riid,ppvSession) \ + ( (This)->lpVtbl -> CreateShaderCacheSession(This,pDesc,riid,ppvSession) ) + +#define ID3D12Device10_ShaderCacheControl(This,Kinds,Control) \ + ( (This)->lpVtbl -> ShaderCacheControl(This,Kinds,Control) ) + +#define ID3D12Device10_CreateCommandQueue1(This,pDesc,CreatorID,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue1(This,pDesc,CreatorID,riid,ppCommandQueue) ) + + +#define ID3D12Device10_CreateCommittedResource3(This,pHeapProperties,HeapFlags,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource3(This,pHeapProperties,HeapFlags,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riidResource,ppvResource) ) + +#define ID3D12Device10_CreatePlacedResource2(This,pHeap,HeapOffset,pDesc,InitialLayout,pOptimizedClearValue,NumCastableFormats,pCastableFormats,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource2(This,pHeap,HeapOffset,pDesc,InitialLayout,pOptimizedClearValue,NumCastableFormats,pCastableFormats,riid,ppvResource) ) + +#define ID3D12Device10_CreateReservedResource2(This,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource2(This,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riid,ppvResource) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Device10_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Device11_INTERFACE_DEFINED__ +#define __ID3D12Device11_INTERFACE_DEFINED__ + +/* interface ID3D12Device11 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Device11; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("5405c344-d457-444e-b4dd-2366e45aee39") + ID3D12Device11 : public ID3D12Device10 + { + public: + virtual void STDMETHODCALLTYPE CreateSampler2( + _In_ const D3D12_SAMPLER_DESC2 *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Device11Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Device11 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Device11 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Device11 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12Device11 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12Device11 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12Device11 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12Device11 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount) + UINT ( STDMETHODCALLTYPE *GetNodeCount )( + ID3D12Device11 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )( + ID3D12Device11 * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator) + HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )( + ID3D12Device11 * This, + _In_ D3D12_COMMAND_LIST_TYPE type, + REFIID riid, + _COM_Outptr_ void **ppCommandAllocator); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )( + ID3D12Device11 * This, + _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )( + ID3D12Device11 * This, + _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList )( + ID3D12Device11 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ ID3D12CommandAllocator *pCommandAllocator, + _In_opt_ ID3D12PipelineState *pInitialState, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport) + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D12Device11 * This, + D3D12_FEATURE Feature, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap) + HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )( + ID3D12Device11 * This, + _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize) + UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )( + ID3D12Device11 * This, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature) + HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )( + ID3D12Device11 * This, + _In_ UINT nodeMask, + _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature, + _In_ SIZE_T blobLengthInBytes, + REFIID riid, + _COM_Outptr_ void **ppvRootSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView) + void ( STDMETHODCALLTYPE *CreateConstantBufferView )( + ID3D12Device11 * This, + _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView) + void ( STDMETHODCALLTYPE *CreateShaderResourceView )( + ID3D12Device11 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )( + ID3D12Device11 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ ID3D12Resource *pCounterResource, + _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView) + void ( STDMETHODCALLTYPE *CreateRenderTargetView )( + ID3D12Device11 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView) + void ( STDMETHODCALLTYPE *CreateDepthStencilView )( + ID3D12Device11 * This, + _In_opt_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler) + void ( STDMETHODCALLTYPE *CreateSampler )( + ID3D12Device11 * This, + _In_ const D3D12_SAMPLER_DESC *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors) + void ( STDMETHODCALLTYPE *CopyDescriptors )( + ID3D12Device11 * This, + _In_ UINT NumDestDescriptorRanges, + _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts, + _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes, + _In_ UINT NumSrcDescriptorRanges, + _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts, + _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple) + void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )( + ID3D12Device11 * This, + _In_ UINT NumDescriptors, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart, + _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device11 * This, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )( + ID3D12Device11 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + _In_ UINT visibleMask, + _In_ UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties) +#if !defined(_WIN32) + D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device11 * This, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#else + D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )( + ID3D12Device11 * This, + D3D12_HEAP_PROPERTIES * RetVal, + _In_ UINT nodeMask, + D3D12_HEAP_TYPE heapType); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )( + ID3D12Device11 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap) + HRESULT ( STDMETHODCALLTYPE *CreateHeap )( + ID3D12Device11 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )( + ID3D12Device11 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )( + ID3D12Device11 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle) + HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )( + ID3D12Device11 * This, + _In_ ID3D12DeviceChild *pObject, + _In_opt_ const SECURITY_ATTRIBUTES *pAttributes, + DWORD Access, + _In_opt_ LPCWSTR Name, + _Out_ HANDLE *pHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )( + ID3D12Device11 * This, + _In_ HANDLE NTHandle, + REFIID riid, + _COM_Outptr_opt_ void **ppvObj); + + DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName) + HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )( + ID3D12Device11 * This, + _In_ LPCWSTR Name, + DWORD Access, + /* [annotation][out] */ + _Out_ HANDLE *pNTHandle); + + DECLSPEC_XFGVIRT(ID3D12Device, MakeResident) + HRESULT ( STDMETHODCALLTYPE *MakeResident )( + ID3D12Device11 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, Evict) + HRESULT ( STDMETHODCALLTYPE *Evict )( + ID3D12Device11 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateFence) + HRESULT ( STDMETHODCALLTYPE *CreateFence )( + ID3D12Device11 * This, + UINT64 InitialValue, + D3D12_FENCE_FLAGS Flags, + REFIID riid, + _COM_Outptr_ void **ppFence); + + DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason) + HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )( + ID3D12Device11 * This); + + DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints) + void ( STDMETHODCALLTYPE *GetCopyableFootprints )( + ID3D12Device11 * This, + _In_ const D3D12_RESOURCE_DESC *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap) + HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )( + ID3D12Device11 * This, + _In_ const D3D12_QUERY_HEAP_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState) + HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )( + ID3D12Device11 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature) + HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )( + ID3D12Device11 * This, + _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc, + _In_opt_ ID3D12RootSignature *pRootSignature, + REFIID riid, + _COM_Outptr_opt_ void **ppvCommandSignature); + + DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling) + void ( STDMETHODCALLTYPE *GetResourceTiling )( + ID3D12Device11 * This, + _In_ ID3D12Resource *pTiledResource, + _Out_opt_ UINT *pNumTilesForEntireResource, + _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc, + _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips, + _Inout_opt_ UINT *pNumSubresourceTilings, + _In_ UINT FirstSubresourceTilingToGet, + _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips); + + DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid) +#if !defined(_WIN32) + LUID ( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device11 * This); + +#else + LUID *( STDMETHODCALLTYPE *GetAdapterLuid )( + ID3D12Device11 * This, + LUID * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )( + ID3D12Device11 * This, + _In_reads_(BlobLength) const void *pLibraryBlob, + SIZE_T BlobLength, + REFIID riid, + _COM_Outptr_ void **ppPipelineLibrary); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion) + HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )( + ID3D12Device11 * This, + _In_reads_(NumFences) ID3D12Fence *const *ppFences, + _In_reads_(NumFences) const UINT64 *pFenceValues, + UINT NumFences, + D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags, + HANDLE hEvent); + + DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority) + HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )( + ID3D12Device11 * This, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities); + + DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState) + HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )( + ID3D12Device11 * This, + const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppPipelineState); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )( + ID3D12Device11 * This, + _In_ const void *pAddress, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping) + HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )( + ID3D12Device11 * This, + _In_ HANDLE hFileMapping, + REFIID riid, + _COM_Outptr_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident) + HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )( + ID3D12Device11 * This, + D3D12_RESIDENCY_FLAGS Flags, + UINT NumObjects, + _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects, + _In_ ID3D12Fence *pFenceToSignal, + UINT64 FenceValueToSignal); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommandList1) + HRESULT ( STDMETHODCALLTYPE *CreateCommandList1 )( + ID3D12Device11 * This, + _In_ UINT nodeMask, + _In_ D3D12_COMMAND_LIST_TYPE type, + _In_ D3D12_COMMAND_LIST_FLAGS flags, + REFIID riid, + _COM_Outptr_ void **ppCommandList); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession )( + ID3D12Device11 * This, + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommittedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource1 )( + ID3D12Device11 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateHeap1) + HRESULT ( STDMETHODCALLTYPE *CreateHeap1 )( + ID3D12Device11 * This, + _In_ const D3D12_HEAP_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvHeap); + + DECLSPEC_XFGVIRT(ID3D12Device4, CreateReservedResource1) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource1 )( + ID3D12Device11 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device4, GetResourceAllocationInfo1) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device11 * This, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )( + ID3D12Device11 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateLifetimeTracker) + HRESULT ( STDMETHODCALLTYPE *CreateLifetimeTracker )( + ID3D12Device11 * This, + _In_ ID3D12LifetimeOwner *pOwner, + REFIID riid, + _COM_Outptr_ void **ppvTracker); + + DECLSPEC_XFGVIRT(ID3D12Device5, RemoveDevice) + void ( STDMETHODCALLTYPE *RemoveDevice )( + ID3D12Device11 * This); + + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommands) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommands )( + ID3D12Device11 * This, + _Inout_ UINT *pNumMetaCommands, + _Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs); + + DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommandParameters) + HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommandParameters )( + ID3D12Device11 * This, + _In_ REFGUID CommandId, + _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage, + _Out_opt_ UINT *pTotalStructureSizeInBytes, + _Inout_ UINT *pParameterCount, + _Out_writes_opt_(*pParameterCount) D3D12_META_COMMAND_PARAMETER_DESC *pParameterDescs); + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateMetaCommand) + HRESULT ( STDMETHODCALLTYPE *CreateMetaCommand )( + ID3D12Device11 * This, + _In_ REFGUID CommandId, + _In_ UINT NodeMask, + _In_reads_bytes_opt_(CreationParametersDataSizeInBytes) const void *pCreationParametersData, + _In_ SIZE_T CreationParametersDataSizeInBytes, + REFIID riid, + _COM_Outptr_ void **ppMetaCommand); + + DECLSPEC_XFGVIRT(ID3D12Device5, CreateStateObject) + HRESULT ( STDMETHODCALLTYPE *CreateStateObject )( + ID3D12Device11 * This, + const D3D12_STATE_OBJECT_DESC *pDesc, + REFIID riid, + _COM_Outptr_ void **ppStateObject); + + DECLSPEC_XFGVIRT(ID3D12Device5, GetRaytracingAccelerationStructurePrebuildInfo) + void ( STDMETHODCALLTYPE *GetRaytracingAccelerationStructurePrebuildInfo )( + ID3D12Device11 * This, + _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc, + _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo); + + DECLSPEC_XFGVIRT(ID3D12Device5, CheckDriverMatchingIdentifier) + D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS ( STDMETHODCALLTYPE *CheckDriverMatchingIdentifier )( + ID3D12Device11 * This, + _In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType, + _In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck); + + DECLSPEC_XFGVIRT(ID3D12Device6, SetBackgroundProcessingMode) + HRESULT ( STDMETHODCALLTYPE *SetBackgroundProcessingMode )( + ID3D12Device11 * This, + D3D12_BACKGROUND_PROCESSING_MODE Mode, + D3D12_MEASUREMENTS_ACTION MeasurementsAction, + _In_opt_ HANDLE hEventToSignalUponCompletion, + _Out_opt_ BOOL *pbFurtherMeasurementsDesired); + + DECLSPEC_XFGVIRT(ID3D12Device7, AddToStateObject) + HRESULT ( STDMETHODCALLTYPE *AddToStateObject )( + ID3D12Device11 * This, + const D3D12_STATE_OBJECT_DESC *pAddition, + ID3D12StateObject *pStateObjectToGrowFrom, + REFIID riid, + _COM_Outptr_ void **ppNewStateObject); + + DECLSPEC_XFGVIRT(ID3D12Device7, CreateProtectedResourceSession1) + HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession1 )( + ID3D12Device11 * This, + _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppSession); + + DECLSPEC_XFGVIRT(ID3D12Device8, GetResourceAllocationInfo2) +#if !defined(_WIN32) + D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )( + ID3D12Device11 * This, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#else + D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )( + ID3D12Device11 * This, + D3D12_RESOURCE_ALLOCATION_INFO * RetVal, + UINT visibleMask, + UINT numResourceDescs, + _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs, + _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1); + +#endif + + DECLSPEC_XFGVIRT(ID3D12Device8, CreateCommittedResource2) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource2 )( + ID3D12Device11 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device8, CreatePlacedResource1) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource1 )( + ID3D12Device11 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_RESOURCE_STATES InitialState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device8, CreateSamplerFeedbackUnorderedAccessView) + void ( STDMETHODCALLTYPE *CreateSamplerFeedbackUnorderedAccessView )( + ID3D12Device11 * This, + _In_opt_ ID3D12Resource *pTargetedResource, + _In_opt_ ID3D12Resource *pFeedbackResource, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + DECLSPEC_XFGVIRT(ID3D12Device8, GetCopyableFootprints1) + void ( STDMETHODCALLTYPE *GetCopyableFootprints1 )( + ID3D12Device11 * This, + _In_ const D3D12_RESOURCE_DESC1 *pResourceDesc, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 BaseOffset, + _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts, + _Out_writes_opt_(NumSubresources) UINT *pNumRows, + _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes, + _Out_opt_ UINT64 *pTotalBytes); + + DECLSPEC_XFGVIRT(ID3D12Device9, CreateShaderCacheSession) + HRESULT ( STDMETHODCALLTYPE *CreateShaderCacheSession )( + ID3D12Device11 * This, + _In_ const D3D12_SHADER_CACHE_SESSION_DESC *pDesc, + REFIID riid, + _COM_Outptr_opt_ void **ppvSession); + + DECLSPEC_XFGVIRT(ID3D12Device9, ShaderCacheControl) + HRESULT ( STDMETHODCALLTYPE *ShaderCacheControl )( + ID3D12Device11 * This, + D3D12_SHADER_CACHE_KIND_FLAGS Kinds, + D3D12_SHADER_CACHE_CONTROL_FLAGS Control); + + DECLSPEC_XFGVIRT(ID3D12Device9, CreateCommandQueue1) + HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue1 )( + ID3D12Device11 * This, + _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc, + REFIID CreatorID, + REFIID riid, + _COM_Outptr_ void **ppCommandQueue); + + DECLSPEC_XFGVIRT(ID3D12Device10, CreateCommittedResource3) + HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource3 )( + ID3D12Device11 * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + UINT32 NumCastableFormats, + _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats, + REFIID riidResource, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device10, CreatePlacedResource2) + HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource2 )( + ID3D12Device11 * This, + _In_ ID3D12Heap *pHeap, + UINT64 HeapOffset, + _In_ const D3D12_RESOURCE_DESC1 *pDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + UINT32 NumCastableFormats, + _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device10, CreateReservedResource2) + HRESULT ( STDMETHODCALLTYPE *CreateReservedResource2 )( + ID3D12Device11 * This, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_BARRIER_LAYOUT InitialLayout, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession, + UINT32 NumCastableFormats, + _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats, + REFIID riid, + _COM_Outptr_opt_ void **ppvResource); + + DECLSPEC_XFGVIRT(ID3D12Device11, CreateSampler2) + void ( STDMETHODCALLTYPE *CreateSampler2 )( + ID3D12Device11 * This, + _In_ const D3D12_SAMPLER_DESC2 *pDesc, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor); + + END_INTERFACE + } ID3D12Device11Vtbl; + + interface ID3D12Device11 + { + CONST_VTBL struct ID3D12Device11Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Device11_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Device11_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Device11_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Device11_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12Device11_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12Device11_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12Device11_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12Device11_GetNodeCount(This) \ + ( (This)->lpVtbl -> GetNodeCount(This) ) + +#define ID3D12Device11_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) ) + +#define ID3D12Device11_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \ + ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) ) + +#define ID3D12Device11_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device11_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) ) + +#define ID3D12Device11_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) ) + +#define ID3D12Device11_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) ) + +#define ID3D12Device11_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) ) + +#define ID3D12Device11_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \ + ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) ) + +#define ID3D12Device11_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \ + ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) ) + +#define ID3D12Device11_CreateConstantBufferView(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) ) + +#define ID3D12Device11_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device11_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) ) + +#define ID3D12Device11_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device11_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) ) + +#define ID3D12Device11_CreateSampler(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) ) + +#define ID3D12Device11_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) ) + +#define ID3D12Device11_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \ + ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) ) +#if !defined(_WIN32) + +#define ID3D12Device11_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) ) +#else +#define ID3D12Device11_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) ) +#endif +#if !defined(_WIN32) + +#define ID3D12Device11_GetCustomHeapProperties(This,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) ) +#else +#define ID3D12Device11_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \ + ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) ) +#endif + +#define ID3D12Device11_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) ) + +#define ID3D12Device11_CreateHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device11_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device11_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device11_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \ + ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) ) + +#define ID3D12Device11_OpenSharedHandle(This,NTHandle,riid,ppvObj) \ + ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) ) + +#define ID3D12Device11_OpenSharedHandleByName(This,Name,Access,pNTHandle) \ + ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) ) + +#define ID3D12Device11_MakeResident(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) ) + +#define ID3D12Device11_Evict(This,NumObjects,ppObjects) \ + ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) ) + +#define ID3D12Device11_CreateFence(This,InitialValue,Flags,riid,ppFence) \ + ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) ) + +#define ID3D12Device11_GetDeviceRemovedReason(This) \ + ( (This)->lpVtbl -> GetDeviceRemovedReason(This) ) + +#define ID3D12Device11_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) + +#define ID3D12Device11_CreateQueryHeap(This,pDesc,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) ) + +#define ID3D12Device11_SetStablePowerState(This,Enable) \ + ( (This)->lpVtbl -> SetStablePowerState(This,Enable) ) + +#define ID3D12Device11_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \ + ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) ) + +#define ID3D12Device11_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \ + ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) ) +#if !defined(_WIN32) + +#define ID3D12Device11_GetAdapterLuid(This) \ + ( (This)->lpVtbl -> GetAdapterLuid(This) ) +#else +#define ID3D12Device11_GetAdapterLuid(This,RetVal) \ + ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) ) +#endif + + +#define ID3D12Device11_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \ + ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) ) + +#define ID3D12Device11_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \ + ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) ) + +#define ID3D12Device11_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \ + ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) ) + + +#define ID3D12Device11_CreatePipelineState(This,pDesc,riid,ppPipelineState) \ + ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) ) + + +#define ID3D12Device11_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) ) + +#define ID3D12Device11_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \ + ( (This)->lpVtbl -> OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) ) + +#define ID3D12Device11_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \ + ( (This)->lpVtbl -> EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) ) + + +#define ID3D12Device11_CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) \ + ( (This)->lpVtbl -> CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) ) + +#define ID3D12Device11_CreateProtectedResourceSession(This,pDesc,riid,ppSession) \ + ( (This)->lpVtbl -> CreateProtectedResourceSession(This,pDesc,riid,ppSession) ) + +#define ID3D12Device11_CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) + +#define ID3D12Device11_CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) \ + ( (This)->lpVtbl -> CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) ) + +#define ID3D12Device11_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) ) +#if !defined(_WIN32) + +#define ID3D12Device11_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#else +#define ID3D12Device11_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#endif + + +#define ID3D12Device11_CreateLifetimeTracker(This,pOwner,riid,ppvTracker) \ + ( (This)->lpVtbl -> CreateLifetimeTracker(This,pOwner,riid,ppvTracker) ) + +#define ID3D12Device11_RemoveDevice(This) \ + ( (This)->lpVtbl -> RemoveDevice(This) ) + +#define ID3D12Device11_EnumerateMetaCommands(This,pNumMetaCommands,pDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommands(This,pNumMetaCommands,pDescs) ) + +#define ID3D12Device11_EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) \ + ( (This)->lpVtbl -> EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) ) + +#define ID3D12Device11_CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) \ + ( (This)->lpVtbl -> CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) ) + +#define ID3D12Device11_CreateStateObject(This,pDesc,riid,ppStateObject) \ + ( (This)->lpVtbl -> CreateStateObject(This,pDesc,riid,ppStateObject) ) + +#define ID3D12Device11_GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) \ + ( (This)->lpVtbl -> GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) ) + +#define ID3D12Device11_CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) \ + ( (This)->lpVtbl -> CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) ) + + +#define ID3D12Device11_SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) \ + ( (This)->lpVtbl -> SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) ) + + +#define ID3D12Device11_AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) \ + ( (This)->lpVtbl -> AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) ) + +#define ID3D12Device11_CreateProtectedResourceSession1(This,pDesc,riid,ppSession) \ + ( (This)->lpVtbl -> CreateProtectedResourceSession1(This,pDesc,riid,ppSession) ) + +#if !defined(_WIN32) + +#define ID3D12Device11_GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#else +#define ID3D12Device11_GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \ + ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) ) +#endif + +#define ID3D12Device11_CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) ) + +#define ID3D12Device11_CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) ) + +#define ID3D12Device11_CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) ) + +#define ID3D12Device11_GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \ + ( (This)->lpVtbl -> GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) ) + + +#define ID3D12Device11_CreateShaderCacheSession(This,pDesc,riid,ppvSession) \ + ( (This)->lpVtbl -> CreateShaderCacheSession(This,pDesc,riid,ppvSession) ) + +#define ID3D12Device11_ShaderCacheControl(This,Kinds,Control) \ + ( (This)->lpVtbl -> ShaderCacheControl(This,Kinds,Control) ) + +#define ID3D12Device11_CreateCommandQueue1(This,pDesc,CreatorID,riid,ppCommandQueue) \ + ( (This)->lpVtbl -> CreateCommandQueue1(This,pDesc,CreatorID,riid,ppCommandQueue) ) + + +#define ID3D12Device11_CreateCommittedResource3(This,pHeapProperties,HeapFlags,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riidResource,ppvResource) \ + ( (This)->lpVtbl -> CreateCommittedResource3(This,pHeapProperties,HeapFlags,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riidResource,ppvResource) ) + +#define ID3D12Device11_CreatePlacedResource2(This,pHeap,HeapOffset,pDesc,InitialLayout,pOptimizedClearValue,NumCastableFormats,pCastableFormats,riid,ppvResource) \ + ( (This)->lpVtbl -> CreatePlacedResource2(This,pHeap,HeapOffset,pDesc,InitialLayout,pOptimizedClearValue,NumCastableFormats,pCastableFormats,riid,ppvResource) ) + +#define ID3D12Device11_CreateReservedResource2(This,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riid,ppvResource) \ + ( (This)->lpVtbl -> CreateReservedResource2(This,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riid,ppvResource) ) + + +#define ID3D12Device11_CreateSampler2(This,pDesc,DestDescriptor) \ + ( (This)->lpVtbl -> CreateSampler2(This,pDesc,DestDescriptor) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Device11_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12VirtualizationGuestDevice_INTERFACE_DEFINED__ +#define __ID3D12VirtualizationGuestDevice_INTERFACE_DEFINED__ + +/* interface ID3D12VirtualizationGuestDevice */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VirtualizationGuestDevice; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("bc66d368-7373-4943-8757-fc87dc79e476") + ID3D12VirtualizationGuestDevice : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE ShareWithHost( + _In_ ID3D12DeviceChild *pObject, + _Out_ HANDLE *pHandle) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateFenceFd( + _In_ ID3D12Fence *pFence, + UINT64 FenceValue, + _Out_ int *pFenceFd) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VirtualizationGuestDeviceVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VirtualizationGuestDevice * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VirtualizationGuestDevice * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VirtualizationGuestDevice * This); + + DECLSPEC_XFGVIRT(ID3D12VirtualizationGuestDevice, ShareWithHost) + HRESULT ( STDMETHODCALLTYPE *ShareWithHost )( + ID3D12VirtualizationGuestDevice * This, + _In_ ID3D12DeviceChild *pObject, + _Out_ HANDLE *pHandle); + + DECLSPEC_XFGVIRT(ID3D12VirtualizationGuestDevice, CreateFenceFd) + HRESULT ( STDMETHODCALLTYPE *CreateFenceFd )( + ID3D12VirtualizationGuestDevice * This, + _In_ ID3D12Fence *pFence, + UINT64 FenceValue, + _Out_ int *pFenceFd); + + END_INTERFACE + } ID3D12VirtualizationGuestDeviceVtbl; + + interface ID3D12VirtualizationGuestDevice + { + CONST_VTBL struct ID3D12VirtualizationGuestDeviceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VirtualizationGuestDevice_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VirtualizationGuestDevice_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VirtualizationGuestDevice_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VirtualizationGuestDevice_ShareWithHost(This,pObject,pHandle) \ + ( (This)->lpVtbl -> ShareWithHost(This,pObject,pHandle) ) + +#define ID3D12VirtualizationGuestDevice_CreateFenceFd(This,pFence,FenceValue,pFenceFd) \ + ( (This)->lpVtbl -> CreateFenceFd(This,pFence,FenceValue,pFenceFd) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VirtualizationGuestDevice_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Tools_INTERFACE_DEFINED__ +#define __ID3D12Tools_INTERFACE_DEFINED__ + +/* interface ID3D12Tools */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Tools; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("7071e1f0-e84b-4b33-974f-12fa49de65c5") + ID3D12Tools : public IUnknown + { + public: + virtual void STDMETHODCALLTYPE EnableShaderInstrumentation( + BOOL bEnable) = 0; + + virtual BOOL STDMETHODCALLTYPE ShaderInstrumentationEnabled( void) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12ToolsVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Tools * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Tools * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Tools * This); + + DECLSPEC_XFGVIRT(ID3D12Tools, EnableShaderInstrumentation) + void ( STDMETHODCALLTYPE *EnableShaderInstrumentation )( + ID3D12Tools * This, + BOOL bEnable); + + DECLSPEC_XFGVIRT(ID3D12Tools, ShaderInstrumentationEnabled) + BOOL ( STDMETHODCALLTYPE *ShaderInstrumentationEnabled )( + ID3D12Tools * This); + + END_INTERFACE + } ID3D12ToolsVtbl; + + interface ID3D12Tools + { + CONST_VTBL struct ID3D12ToolsVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Tools_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Tools_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Tools_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Tools_EnableShaderInstrumentation(This,bEnable) \ + ( (This)->lpVtbl -> EnableShaderInstrumentation(This,bEnable) ) + +#define ID3D12Tools_ShaderInstrumentationEnabled(This) \ + ( (This)->lpVtbl -> ShaderInstrumentationEnabled(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Tools_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0057 */ +/* [local] */ + +typedef struct D3D12_SUBRESOURCE_DATA + { + const void *pData; + LONG_PTR RowPitch; + LONG_PTR SlicePitch; + } D3D12_SUBRESOURCE_DATA; + +typedef struct D3D12_MEMCPY_DEST + { + void *pData; + SIZE_T RowPitch; + SIZE_T SlicePitch; + } D3D12_MEMCPY_DEST; + +#if !defined( D3D12_IGNORE_SDK_LAYERS ) +#include "d3d12sdklayers.h" +#endif + +/////////////////////////////////////////////////////////////////////////// +// D3D12CreateDevice +// ------------------ +// +// pAdapter +// If NULL, D3D12CreateDevice will choose the primary adapter. +// If non-NULL, D3D12CreateDevice will use the provided adapter. +// MinimumFeatureLevel +// The minimum feature level required for successful device creation. +// riid +// The interface IID of the device to be returned. Expected: ID3D12Device. +// ppDevice +// Pointer to returned interface. May be NULL. +// +// Return Values +// Any of those documented for +// CreateDXGIFactory1 +// IDXGIFactory::EnumAdapters +// D3D12CreateDevice +// +/////////////////////////////////////////////////////////////////////////// +typedef HRESULT (WINAPI* PFN_D3D12_CREATE_DEVICE)( _In_opt_ IUnknown*, + D3D_FEATURE_LEVEL, + _In_ REFIID, _COM_Outptr_opt_ void** ); + +HRESULT WINAPI D3D12CreateDevice( + _In_opt_ IUnknown* pAdapter, + D3D_FEATURE_LEVEL MinimumFeatureLevel, + _In_ REFIID riid, // Expected: ID3D12Device + _COM_Outptr_opt_ void** ppDevice ); + + +typedef HRESULT (WINAPI* PFN_D3D12_GET_DEBUG_INTERFACE)( _In_ REFIID, _COM_Outptr_opt_ void** ); + +HRESULT WINAPI D3D12GetDebugInterface( _In_ REFIID riid, _COM_Outptr_opt_ void** ppvDebug ); + +// -------------------------------------------------------------------------------------------------------------------------------- +// D3D12EnableExperimentalFeatures +// +// Pass in a list of feature GUIDs to be enabled together. +// +// If a particular feature requires some configuration information on enablement, it will have +// a configuration struct that can be passed alongside the GUID. +// +// Some features might use an interface IID as the GUID. For these, once the feature is enabled via +// D3D12EnableExperimentalFeatures, D3D12GetDebugInterface can then be called with the IID to retrieve the interface +// for manipulating the feature. This allows for control that might not cleanly be expressed by just +// the configuration struct that D3D12EnableExperimentalFeatures provides. +// +// If this method is called and a change to existing feature enablement is made, +// all current D3D12 devices are set to DEVICE_REMOVED state, since under the covers there is really only one +// singleton device for a process. Removing the devices when configuration changes prevents +// mismatched expectations of how a device is supposed to work after it has been created from the app's point of view. +// +// The call returns E_NOINTERFACE if an unrecognized feature is passed in or Windows Developer mode is not on. +// The call returns E_INVALIDARG if the configuration of a feature is incorrect, the set of features passed +// in are known to be incompatible with each other, or other errors. +// Returns S_OK otherwise. +// +// -------------------------------------------------------------------------------------------------------------------------------- +HRESULT WINAPI D3D12EnableExperimentalFeatures( + UINT NumFeatures, + _In_count_(NumFeatures) const IID* pIIDs, + _In_opt_count_(NumFeatures) void* pConfigurationStructs, + _In_opt_count_(NumFeatures) UINT* pConfigurationStructSizes); + +// -------------------------------------------------------------------------------------------------------------------------------- +// Experimental Feature: D3D12ExperimentalShaderModels +// +// Use with D3D12EnableExperimentalFeatures to enable experimental shader model support, +// meaning shader models that haven't been finalized for use in retail. +// +// Enabling D3D12ExperimentalShaderModels needs no configuration struct, pass NULL in the pConfigurationStructs array. +// +// -------------------------------------------------------------------------------------------------------------------------------- +static const UUID D3D12ExperimentalShaderModels = { /* 76f5573e-f13a-40f5-b297-81ce9e18933f */ + 0x76f5573e, + 0xf13a, + 0x40f5, + { 0xb2, 0x97, 0x81, 0xce, 0x9e, 0x18, 0x93, 0x3f } +}; +// -------------------------------------------------------------------------------------------------------------------------------- +// Experimental Feature: D3D12TiledResourceTier4 +// +// Use with D3D12EnableExperimentalFeatures to enable tiled resource tier 4 support, +// meaning texture tile data-inheritance is allowed. +// +// Enabling D3D12TiledResourceTier4 needs no configuration struct, pass NULL in the pConfigurationStructs array. +// +// -------------------------------------------------------------------------------------------------------------------------------- +static const UUID D3D12TiledResourceTier4 = { /* c9c4725f-a81a-4f56-8c5b-c51039d694fb */ + 0xc9c4725f, + 0xa81a, + 0x4f56, + { 0x8c, 0x5b, 0xc5, 0x10, 0x39, 0xd6, 0x94, 0xfb } +}; +// -------------------------------------------------------------------------------------------------------------------------------- +// D3D12GetInterface +// +// Retrieve Global D3D12 Interface. +// + +DEFINE_GUID(CLSID_D3D12Debug, 0xf2352aeb, 0xdd84, 0x49fe, 0xb9, 0x7b, 0xa9, 0xdc, 0xfd, 0xcc, 0x1b, 0x4f); +DEFINE_GUID(CLSID_D3D12Tools, 0xe38216b1, 0x3c8c, 0x4833, 0xaa, 0x09, 0x0a, 0x06, 0xb6, 0x5d, 0x96, 0xc8); +DEFINE_GUID(CLSID_D3D12DeviceRemovedExtendedData, 0x4a75bbc4, 0x9ff4, 0x4ad8, 0x9f, 0x18, 0xab, 0xae, 0x84, 0xdc, 0x5f, 0xf2); +DEFINE_GUID(CLSID_D3D12SDKConfiguration, 0x7cda6aca, 0xa03e, 0x49c8, 0x94, 0x58, 0x03, 0x34, 0xd2, 0x0e, 0x07, 0xce); +DEFINE_GUID(CLSID_D3D12DeviceFactory, 0x114863bf, 0xc386, 0x4aee, 0xb3, 0x9d, 0x8f, 0x0b, 0xbb, 0x06, 0x29, 0x55); + +typedef HRESULT (WINAPI* PFN_D3D12_GET_INTERFACE)( _In_ REFCLSID, _In_ REFIID, _COM_Outptr_opt_ void** ); + +HRESULT WINAPI D3D12GetInterface( _In_ REFCLSID rclsid, _In_ REFIID riid, _COM_Outptr_opt_ void** ppvDebug ); + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0057_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0057_v0_0_s_ifspec; + +#ifndef __ID3D12SDKConfiguration_INTERFACE_DEFINED__ +#define __ID3D12SDKConfiguration_INTERFACE_DEFINED__ + +/* interface ID3D12SDKConfiguration */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12SDKConfiguration; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("e9eb5314-33aa-42b2-a718-d77f58b1f1c7") + ID3D12SDKConfiguration : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SetSDKVersion( + UINT SDKVersion, + _In_z_ LPCSTR SDKPath) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12SDKConfigurationVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12SDKConfiguration * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12SDKConfiguration * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12SDKConfiguration * This); + + DECLSPEC_XFGVIRT(ID3D12SDKConfiguration, SetSDKVersion) + HRESULT ( STDMETHODCALLTYPE *SetSDKVersion )( + ID3D12SDKConfiguration * This, + UINT SDKVersion, + _In_z_ LPCSTR SDKPath); + + END_INTERFACE + } ID3D12SDKConfigurationVtbl; + + interface ID3D12SDKConfiguration + { + CONST_VTBL struct ID3D12SDKConfigurationVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12SDKConfiguration_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12SDKConfiguration_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12SDKConfiguration_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12SDKConfiguration_SetSDKVersion(This,SDKVersion,SDKPath) \ + ( (This)->lpVtbl -> SetSDKVersion(This,SDKVersion,SDKPath) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12SDKConfiguration_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12SDKConfiguration1_INTERFACE_DEFINED__ +#define __ID3D12SDKConfiguration1_INTERFACE_DEFINED__ + +/* interface ID3D12SDKConfiguration1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12SDKConfiguration1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("8aaf9303-ad25-48b9-9a57-d9c37e009d9f") + ID3D12SDKConfiguration1 : public ID3D12SDKConfiguration + { + public: + virtual HRESULT STDMETHODCALLTYPE CreateDeviceFactory( + UINT SDKVersion, + _In_ LPCSTR SDKPath, + REFIID riid, + _COM_Outptr_ void **ppvFactory) = 0; + + virtual void STDMETHODCALLTYPE FreeUnusedSDKs( void) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12SDKConfiguration1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12SDKConfiguration1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12SDKConfiguration1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12SDKConfiguration1 * This); + + DECLSPEC_XFGVIRT(ID3D12SDKConfiguration, SetSDKVersion) + HRESULT ( STDMETHODCALLTYPE *SetSDKVersion )( + ID3D12SDKConfiguration1 * This, + UINT SDKVersion, + _In_z_ LPCSTR SDKPath); + + DECLSPEC_XFGVIRT(ID3D12SDKConfiguration1, CreateDeviceFactory) + HRESULT ( STDMETHODCALLTYPE *CreateDeviceFactory )( + ID3D12SDKConfiguration1 * This, + UINT SDKVersion, + _In_ LPCSTR SDKPath, + REFIID riid, + _COM_Outptr_ void **ppvFactory); + + DECLSPEC_XFGVIRT(ID3D12SDKConfiguration1, FreeUnusedSDKs) + void ( STDMETHODCALLTYPE *FreeUnusedSDKs )( + ID3D12SDKConfiguration1 * This); + + END_INTERFACE + } ID3D12SDKConfiguration1Vtbl; + + interface ID3D12SDKConfiguration1 + { + CONST_VTBL struct ID3D12SDKConfiguration1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12SDKConfiguration1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12SDKConfiguration1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12SDKConfiguration1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12SDKConfiguration1_SetSDKVersion(This,SDKVersion,SDKPath) \ + ( (This)->lpVtbl -> SetSDKVersion(This,SDKVersion,SDKPath) ) + + +#define ID3D12SDKConfiguration1_CreateDeviceFactory(This,SDKVersion,SDKPath,riid,ppvFactory) \ + ( (This)->lpVtbl -> CreateDeviceFactory(This,SDKVersion,SDKPath,riid,ppvFactory) ) + +#define ID3D12SDKConfiguration1_FreeUnusedSDKs(This) \ + ( (This)->lpVtbl -> FreeUnusedSDKs(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12SDKConfiguration1_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0059 */ +/* [local] */ + +typedef +enum D3D12_DEVICE_FACTORY_FLAGS + { + D3D12_DEVICE_FACTORY_FLAG_NONE = 0, + D3D12_DEVICE_FACTORY_FLAG_ALLOW_RETURNING_EXISTING_DEVICE = 0x1, + D3D12_DEVICE_FACTORY_FLAG_ALLOW_RETURNING_INCOMPATIBLE_EXISTING_DEVICE = 0x2, + D3D12_DEVICE_FACTORY_FLAG_DISALLOW_STORING_NEW_DEVICE_AS_SINGLETON = 0x4 + } D3D12_DEVICE_FACTORY_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_DEVICE_FACTORY_FLAGS ); + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0059_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0059_v0_0_s_ifspec; + +#ifndef __ID3D12DeviceFactory_INTERFACE_DEFINED__ +#define __ID3D12DeviceFactory_INTERFACE_DEFINED__ + +/* interface ID3D12DeviceFactory */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DeviceFactory; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("61f307d3-d34e-4e7c-8374-3ba4de23cccb") + ID3D12DeviceFactory : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE InitializeFromGlobalState( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE ApplyToGlobalState( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetFlags( + D3D12_DEVICE_FACTORY_FLAGS flags) = 0; + + virtual D3D12_DEVICE_FACTORY_FLAGS STDMETHODCALLTYPE GetFlags( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetConfigurationInterface( + REFCLSID clsid, + REFIID iid, + _COM_Outptr_ void **ppv) = 0; + + virtual HRESULT STDMETHODCALLTYPE EnableExperimentalFeatures( + UINT NumFeatures, + _In_reads_(NumFeatures) const IID *pIIDs, + _In_reads_opt_(NumFeatures) void *pConfigurationStructs, + _In_reads_opt_(NumFeatures) UINT *pConfigurationStructSizes) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateDevice( + _In_opt_ IUnknown *adapter, + D3D_FEATURE_LEVEL FeatureLevel, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DeviceFactoryVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DeviceFactory * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DeviceFactory * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DeviceFactory * This); + + DECLSPEC_XFGVIRT(ID3D12DeviceFactory, InitializeFromGlobalState) + HRESULT ( STDMETHODCALLTYPE *InitializeFromGlobalState )( + ID3D12DeviceFactory * This); + + DECLSPEC_XFGVIRT(ID3D12DeviceFactory, ApplyToGlobalState) + HRESULT ( STDMETHODCALLTYPE *ApplyToGlobalState )( + ID3D12DeviceFactory * This); + + DECLSPEC_XFGVIRT(ID3D12DeviceFactory, SetFlags) + HRESULT ( STDMETHODCALLTYPE *SetFlags )( + ID3D12DeviceFactory * This, + D3D12_DEVICE_FACTORY_FLAGS flags); + + DECLSPEC_XFGVIRT(ID3D12DeviceFactory, GetFlags) + D3D12_DEVICE_FACTORY_FLAGS ( STDMETHODCALLTYPE *GetFlags )( + ID3D12DeviceFactory * This); + + DECLSPEC_XFGVIRT(ID3D12DeviceFactory, GetConfigurationInterface) + HRESULT ( STDMETHODCALLTYPE *GetConfigurationInterface )( + ID3D12DeviceFactory * This, + REFCLSID clsid, + REFIID iid, + _COM_Outptr_ void **ppv); + + DECLSPEC_XFGVIRT(ID3D12DeviceFactory, EnableExperimentalFeatures) + HRESULT ( STDMETHODCALLTYPE *EnableExperimentalFeatures )( + ID3D12DeviceFactory * This, + UINT NumFeatures, + _In_reads_(NumFeatures) const IID *pIIDs, + _In_reads_opt_(NumFeatures) void *pConfigurationStructs, + _In_reads_opt_(NumFeatures) UINT *pConfigurationStructSizes); + + DECLSPEC_XFGVIRT(ID3D12DeviceFactory, CreateDevice) + HRESULT ( STDMETHODCALLTYPE *CreateDevice )( + ID3D12DeviceFactory * This, + _In_opt_ IUnknown *adapter, + D3D_FEATURE_LEVEL FeatureLevel, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + END_INTERFACE + } ID3D12DeviceFactoryVtbl; + + interface ID3D12DeviceFactory + { + CONST_VTBL struct ID3D12DeviceFactoryVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DeviceFactory_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DeviceFactory_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DeviceFactory_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DeviceFactory_InitializeFromGlobalState(This) \ + ( (This)->lpVtbl -> InitializeFromGlobalState(This) ) + +#define ID3D12DeviceFactory_ApplyToGlobalState(This) \ + ( (This)->lpVtbl -> ApplyToGlobalState(This) ) + +#define ID3D12DeviceFactory_SetFlags(This,flags) \ + ( (This)->lpVtbl -> SetFlags(This,flags) ) + +#define ID3D12DeviceFactory_GetFlags(This) \ + ( (This)->lpVtbl -> GetFlags(This) ) + +#define ID3D12DeviceFactory_GetConfigurationInterface(This,clsid,iid,ppv) \ + ( (This)->lpVtbl -> GetConfigurationInterface(This,clsid,iid,ppv) ) + +#define ID3D12DeviceFactory_EnableExperimentalFeatures(This,NumFeatures,pIIDs,pConfigurationStructs,pConfigurationStructSizes) \ + ( (This)->lpVtbl -> EnableExperimentalFeatures(This,NumFeatures,pIIDs,pConfigurationStructs,pConfigurationStructSizes) ) + +#define ID3D12DeviceFactory_CreateDevice(This,adapter,FeatureLevel,riid,ppvDevice) \ + ( (This)->lpVtbl -> CreateDevice(This,adapter,FeatureLevel,riid,ppvDevice) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DeviceFactory_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0060 */ +/* [local] */ + +typedef +enum D3D12_DEVICE_FLAGS + { + D3D12_DEVICE_FLAG_NONE = 0, + D3D12_DEVICE_FLAG_DEBUG_LAYER_ENABLED = 0x1, + D3D12_DEVICE_FLAG_GPU_BASED_VALIDATION_ENABLED = 0x2, + D3D12_DEVICE_FLAG_SYNCHRONIZED_COMMAND_QUEUE_VALIDATION_DISABLED = 0x4, + D3D12_DEVICE_FLAG_DRED_AUTO_BREADCRUMBS_ENABLED = 0x8, + D3D12_DEVICE_FLAG_DRED_PAGE_FAULT_REPORTING_ENABLED = 0x10, + D3D12_DEVICE_FLAG_DRED_WATSON_REPORTING_ENABLED = 0x20, + D3D12_DEVICE_FLAG_DRED_BREADCRUMB_CONTEXT_ENABLED = 0x40, + D3D12_DEVICE_FLAG_DRED_USE_MARKERS_ONLY_BREADCRUMBS = 0x80, + D3D12_DEVICE_FLAG_SHADER_INSTRUMENTATION_ENABLED = 0x100, + D3D12_DEVICE_FLAG_AUTO_DEBUG_NAME_ENABLED = 0x200, + D3D12_DEVICE_FLAG_FORCE_LEGACY_STATE_VALIDATION = 0x400 + } D3D12_DEVICE_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_DEVICE_FLAGS ); +typedef struct D3D12_DEVICE_CONFIGURATION_DESC + { + D3D12_DEVICE_FLAGS Flags; + UINT GpuBasedValidationFlags; + UINT SDKVersion; + UINT NumEnabledExperimentalFeatures; + } D3D12_DEVICE_CONFIGURATION_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0060_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0060_v0_0_s_ifspec; + +#ifndef __ID3D12DeviceConfiguration_INTERFACE_DEFINED__ +#define __ID3D12DeviceConfiguration_INTERFACE_DEFINED__ + +/* interface ID3D12DeviceConfiguration */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DeviceConfiguration; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("78dbf87b-f766-422b-a61c-c8c446bdb9ad") + ID3D12DeviceConfiguration : public IUnknown + { + public: +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_DEVICE_CONFIGURATION_DESC STDMETHODCALLTYPE GetDesc( void) = 0; +#else + virtual D3D12_DEVICE_CONFIGURATION_DESC *STDMETHODCALLTYPE GetDesc( + D3D12_DEVICE_CONFIGURATION_DESC * RetVal) = 0; +#endif + + virtual HRESULT STDMETHODCALLTYPE GetEnabledExperimentalFeatures( + _Out_writes_(NumGuids) GUID *pGuids, + UINT NumGuids) = 0; + + virtual HRESULT STDMETHODCALLTYPE SerializeVersionedRootSignature( + _In_ const D3D12_VERSIONED_ROOT_SIGNATURE_DESC *pDesc, + _COM_Outptr_ ID3DBlob **ppResult, + _Always_(_Outptr_opt_result_maybenull_) ID3DBlob **ppError) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateVersionedRootSignatureDeserializer( + _In_reads_bytes_(Size) const void *pBlob, + SIZE_T Size, + REFIID riid, + _COM_Outptr_ void **ppvDeserializer) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DeviceConfigurationVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DeviceConfiguration * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DeviceConfiguration * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DeviceConfiguration * This); + + DECLSPEC_XFGVIRT(ID3D12DeviceConfiguration, GetDesc) +#if !defined(_WIN32) + D3D12_DEVICE_CONFIGURATION_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12DeviceConfiguration * This); + +#else + D3D12_DEVICE_CONFIGURATION_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12DeviceConfiguration * This, + D3D12_DEVICE_CONFIGURATION_DESC * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12DeviceConfiguration, GetEnabledExperimentalFeatures) + HRESULT ( STDMETHODCALLTYPE *GetEnabledExperimentalFeatures )( + ID3D12DeviceConfiguration * This, + _Out_writes_(NumGuids) GUID *pGuids, + UINT NumGuids); + + DECLSPEC_XFGVIRT(ID3D12DeviceConfiguration, SerializeVersionedRootSignature) + HRESULT ( STDMETHODCALLTYPE *SerializeVersionedRootSignature )( + ID3D12DeviceConfiguration * This, + _In_ const D3D12_VERSIONED_ROOT_SIGNATURE_DESC *pDesc, + _COM_Outptr_ ID3DBlob **ppResult, + _Always_(_Outptr_opt_result_maybenull_) ID3DBlob **ppError); + + DECLSPEC_XFGVIRT(ID3D12DeviceConfiguration, CreateVersionedRootSignatureDeserializer) + HRESULT ( STDMETHODCALLTYPE *CreateVersionedRootSignatureDeserializer )( + ID3D12DeviceConfiguration * This, + _In_reads_bytes_(Size) const void *pBlob, + SIZE_T Size, + REFIID riid, + _COM_Outptr_ void **ppvDeserializer); + + END_INTERFACE + } ID3D12DeviceConfigurationVtbl; + + interface ID3D12DeviceConfiguration + { + CONST_VTBL struct ID3D12DeviceConfigurationVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DeviceConfiguration_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DeviceConfiguration_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DeviceConfiguration_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + +#if !defined(_WIN32) + +#define ID3D12DeviceConfiguration_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) +#else +#define ID3D12DeviceConfiguration_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) +#endif + +#define ID3D12DeviceConfiguration_GetEnabledExperimentalFeatures(This,pGuids,NumGuids) \ + ( (This)->lpVtbl -> GetEnabledExperimentalFeatures(This,pGuids,NumGuids) ) + +#define ID3D12DeviceConfiguration_SerializeVersionedRootSignature(This,pDesc,ppResult,ppError) \ + ( (This)->lpVtbl -> SerializeVersionedRootSignature(This,pDesc,ppResult,ppError) ) + +#define ID3D12DeviceConfiguration_CreateVersionedRootSignatureDeserializer(This,pBlob,Size,riid,ppvDeserializer) \ + ( (This)->lpVtbl -> CreateVersionedRootSignatureDeserializer(This,pBlob,Size,riid,ppvDeserializer) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DeviceConfiguration_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0061 */ +/* [local] */ + +typedef +enum D3D12_AXIS_SHADING_RATE + { + D3D12_AXIS_SHADING_RATE_1X = 0, + D3D12_AXIS_SHADING_RATE_2X = 0x1, + D3D12_AXIS_SHADING_RATE_4X = 0x2 + } D3D12_AXIS_SHADING_RATE; + +#define D3D12_SHADING_RATE_X_AXIS_SHIFT 2 +#define D3D12_SHADING_RATE_VALID_MASK 3 +#define D3D12_MAKE_COARSE_SHADING_RATE(x,y) ((x) << D3D12_SHADING_RATE_X_AXIS_SHIFT | (y)) +#define D3D12_GET_COARSE_SHADING_RATE_X_AXIS(x) (((x) >> D3D12_SHADING_RATE_X_AXIS_SHIFT) & D3D12_SHADING_RATE_VALID_MASK) +#define D3D12_GET_COARSE_SHADING_RATE_Y_AXIS(y) ((y) & D3D12_SHADING_RATE_VALID_MASK) +typedef +enum D3D12_SHADING_RATE + { + D3D12_SHADING_RATE_1X1 = 0, + D3D12_SHADING_RATE_1X2 = 0x1, + D3D12_SHADING_RATE_2X1 = 0x4, + D3D12_SHADING_RATE_2X2 = 0x5, + D3D12_SHADING_RATE_2X4 = 0x6, + D3D12_SHADING_RATE_4X2 = 0x9, + D3D12_SHADING_RATE_4X4 = 0xa + } D3D12_SHADING_RATE; + +typedef +enum D3D12_SHADING_RATE_COMBINER + { + D3D12_SHADING_RATE_COMBINER_PASSTHROUGH = 0, + D3D12_SHADING_RATE_COMBINER_OVERRIDE = 1, + D3D12_SHADING_RATE_COMBINER_MIN = 2, + D3D12_SHADING_RATE_COMBINER_MAX = 3, + D3D12_SHADING_RATE_COMBINER_SUM = 4 + } D3D12_SHADING_RATE_COMBINER; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0061_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0061_v0_0_s_ifspec; + +#ifndef __ID3D12GraphicsCommandList5_INTERFACE_DEFINED__ +#define __ID3D12GraphicsCommandList5_INTERFACE_DEFINED__ + +/* interface ID3D12GraphicsCommandList5 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12GraphicsCommandList5; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("55050859-4024-474c-87f5-6472eaee44ea") + ID3D12GraphicsCommandList5 : public ID3D12GraphicsCommandList4 + { + public: + virtual void STDMETHODCALLTYPE RSSetShadingRate( + _In_ D3D12_SHADING_RATE baseShadingRate, + _In_reads_opt_(D3D12_RS_SET_SHADING_RATE_COMBINER_COUNT) const D3D12_SHADING_RATE_COMBINER *combiners) = 0; + + virtual void STDMETHODCALLTYPE RSSetShadingRateImage( + _In_opt_ ID3D12Resource *shadingRateImage) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12GraphicsCommandList5Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12GraphicsCommandList5 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12GraphicsCommandList5 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12GraphicsCommandList5 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12GraphicsCommandList5 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12GraphicsCommandList5 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12GraphicsCommandList5 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12GraphicsCommandList5 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12GraphicsCommandList5 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12GraphicsCommandList5 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12GraphicsCommandList5 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12CommandAllocator *pAllocator, + _In_opt_ ID3D12PipelineState *pInitialState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12GraphicsCommandList5 * This, + _In_opt_ ID3D12PipelineState *pPipelineState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawInstanced) + void ( STDMETHODCALLTYPE *DrawInstanced )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT VertexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartVertexLocation, + _In_ UINT StartInstanceLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawIndexedInstanced) + void ( STDMETHODCALLTYPE *DrawIndexedInstanced )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT IndexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartIndexLocation, + _In_ INT BaseVertexLocation, + _In_ UINT StartInstanceLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Dispatch) + void ( STDMETHODCALLTYPE *Dispatch )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT ThreadGroupCountX, + _In_ UINT ThreadGroupCountY, + _In_ UINT ThreadGroupCountZ); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyBufferRegion) + void ( STDMETHODCALLTYPE *CopyBufferRegion )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT64 NumBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTextureRegion) + void ( STDMETHODCALLTYPE *CopyTextureRegion )( + ID3D12GraphicsCommandList5 * This, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pDst, + UINT DstX, + UINT DstY, + UINT DstZ, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pSrc, + _In_opt_ const D3D12_BOX *pSrcBox); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyResource) + void ( STDMETHODCALLTYPE *CopyResource )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12Resource *pDstResource, + _In_ ID3D12Resource *pSrcResource); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTiles) + void ( STDMETHODCALLTYPE *CopyTiles )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12Resource *pTiledResource, + _In_ const D3D12_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate, + _In_ const D3D12_TILE_REGION_SIZE *pTileRegionSize, + _In_ ID3D12Resource *pBuffer, + UINT64 BufferStartOffsetInBytes, + D3D12_TILE_COPY_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveSubresource) + void ( STDMETHODCALLTYPE *ResolveSubresource )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_ DXGI_FORMAT Format); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetPrimitiveTopology) + void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )( + ID3D12GraphicsCommandList5 * This, + _In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetViewports) + void ( STDMETHODCALLTYPE *RSSetViewports )( + ID3D12GraphicsCommandList5 * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, + _In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetScissorRects) + void ( STDMETHODCALLTYPE *RSSetScissorRects )( + ID3D12GraphicsCommandList5 * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, + _In_reads_( NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetBlendFactor) + void ( STDMETHODCALLTYPE *OMSetBlendFactor )( + ID3D12GraphicsCommandList5 * This, + _In_reads_opt_(4) const FLOAT BlendFactor[ 4 ]); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetStencilRef) + void ( STDMETHODCALLTYPE *OMSetStencilRef )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT StencilRef); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPipelineState) + void ( STDMETHODCALLTYPE *SetPipelineState )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12PipelineState *pPipelineState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteBundle) + void ( STDMETHODCALLTYPE *ExecuteBundle )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12GraphicsCommandList *pCommandList); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetDescriptorHeaps) + void ( STDMETHODCALLTYPE *SetDescriptorHeaps )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT NumDescriptorHeaps, + _In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap *const *ppDescriptorHeaps); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootSignature) + void ( STDMETHODCALLTYPE *SetComputeRootSignature )( + ID3D12GraphicsCommandList5 * This, + _In_opt_ ID3D12RootSignature *pRootSignature); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootSignature) + void ( STDMETHODCALLTYPE *SetGraphicsRootSignature )( + ID3D12GraphicsCommandList5 * This, + _In_opt_ ID3D12RootSignature *pRootSignature); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetComputeRootDescriptorTable )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetGraphicsRootDescriptorTable )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstant )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstant )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstants )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstants )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetComputeRootConstantBufferView )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetGraphicsRootConstantBufferView )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetComputeRootShaderResourceView )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetGraphicsRootShaderResourceView )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetComputeRootUnorderedAccessView )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetGraphicsRootUnorderedAccessView )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetIndexBuffer) + void ( STDMETHODCALLTYPE *IASetIndexBuffer )( + ID3D12GraphicsCommandList5 * This, + _In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetVertexBuffers) + void ( STDMETHODCALLTYPE *IASetVertexBuffers )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SOSetTargets) + void ( STDMETHODCALLTYPE *SOSetTargets )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetRenderTargets) + void ( STDMETHODCALLTYPE *OMSetRenderTargets )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT NumRenderTargetDescriptors, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pRenderTargetDescriptors, + _In_ BOOL RTsSingleHandleToDescriptorRange, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pDepthStencilDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearDepthStencilView) + void ( STDMETHODCALLTYPE *ClearDepthStencilView )( + ID3D12GraphicsCommandList5 * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView, + _In_ D3D12_CLEAR_FLAGS ClearFlags, + _In_ FLOAT Depth, + _In_ UINT8 Stencil, + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearRenderTargetView) + void ( STDMETHODCALLTYPE *ClearRenderTargetView )( + ID3D12GraphicsCommandList5 * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView, + _In_ const FLOAT ColorRGBA[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewUint) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )( + ID3D12GraphicsCommandList5 * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const UINT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewFloat) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )( + ID3D12GraphicsCommandList5 * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const FLOAT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12GraphicsCommandList5 * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12GraphicsCommandList5 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12GraphicsCommandList5 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12GraphicsCommandList5 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteIndirect) + void ( STDMETHODCALLTYPE *ExecuteIndirect )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12CommandSignature *pCommandSignature, + _In_ UINT MaxCommandCount, + _In_ ID3D12Resource *pArgumentBuffer, + _In_ UINT64 ArgumentBufferOffset, + _In_opt_ ID3D12Resource *pCountBuffer, + _In_ UINT64 CountBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT) + void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT64) + void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT64 )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, OMSetDepthBounds) + void ( STDMETHODCALLTYPE *OMSetDepthBounds )( + ID3D12GraphicsCommandList5 * This, + _In_ FLOAT Min, + _In_ FLOAT Max); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetSamplePositions) + void ( STDMETHODCALLTYPE *SetSamplePositions )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT NumSamplesPerPixel, + _In_ UINT NumPixels, + _In_reads_(NumSamplesPerPixel*NumPixels) D3D12_SAMPLE_POSITION *pSamplePositions); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, ResolveSubresourceRegion) + void ( STDMETHODCALLTYPE *ResolveSubresourceRegion )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ UINT DstX, + _In_ UINT DstY, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_opt_ D3D12_RECT *pSrcRect, + _In_ DXGI_FORMAT Format, + _In_ D3D12_RESOLVE_MODE ResolveMode); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetViewInstanceMask) + void ( STDMETHODCALLTYPE *SetViewInstanceMask )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT Mask); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList2, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12GraphicsCommandList5 * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList3, SetProtectedResourceSession) + void ( STDMETHODCALLTYPE *SetProtectedResourceSession )( + ID3D12GraphicsCommandList5 * This, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BeginRenderPass) + void ( STDMETHODCALLTYPE *BeginRenderPass )( + ID3D12GraphicsCommandList5 * This, + _In_ UINT NumRenderTargets, + _In_reads_opt_(NumRenderTargets) const D3D12_RENDER_PASS_RENDER_TARGET_DESC *pRenderTargets, + _In_opt_ const D3D12_RENDER_PASS_DEPTH_STENCIL_DESC *pDepthStencil, + D3D12_RENDER_PASS_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EndRenderPass) + void ( STDMETHODCALLTYPE *EndRenderPass )( + ID3D12GraphicsCommandList5 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, InitializeMetaCommand) + void ( STDMETHODCALLTYPE *InitializeMetaCommand )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12MetaCommand *pMetaCommand, + _In_reads_bytes_opt_(InitializationParametersDataSizeInBytes) const void *pInitializationParametersData, + _In_ SIZE_T InitializationParametersDataSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, ExecuteMetaCommand) + void ( STDMETHODCALLTYPE *ExecuteMetaCommand )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12MetaCommand *pMetaCommand, + _In_reads_bytes_opt_(ExecutionParametersDataSizeInBytes) const void *pExecutionParametersData, + _In_ SIZE_T ExecutionParametersDataSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BuildRaytracingAccelerationStructure) + void ( STDMETHODCALLTYPE *BuildRaytracingAccelerationStructure )( + ID3D12GraphicsCommandList5 * This, + _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC *pDesc, + _In_ UINT NumPostbuildInfoDescs, + _In_reads_opt_(NumPostbuildInfoDescs) const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pPostbuildInfoDescs); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EmitRaytracingAccelerationStructurePostbuildInfo) + void ( STDMETHODCALLTYPE *EmitRaytracingAccelerationStructurePostbuildInfo )( + ID3D12GraphicsCommandList5 * This, + _In_ const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pDesc, + _In_ UINT NumSourceAccelerationStructures, + _In_reads_( NumSourceAccelerationStructures ) const D3D12_GPU_VIRTUAL_ADDRESS *pSourceAccelerationStructureData); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, CopyRaytracingAccelerationStructure) + void ( STDMETHODCALLTYPE *CopyRaytracingAccelerationStructure )( + ID3D12GraphicsCommandList5 * This, + _In_ D3D12_GPU_VIRTUAL_ADDRESS DestAccelerationStructureData, + _In_ D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData, + _In_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE Mode); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, SetPipelineState1) + void ( STDMETHODCALLTYPE *SetPipelineState1 )( + ID3D12GraphicsCommandList5 * This, + _In_ ID3D12StateObject *pStateObject); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, DispatchRays) + void ( STDMETHODCALLTYPE *DispatchRays )( + ID3D12GraphicsCommandList5 * This, + _In_ const D3D12_DISPATCH_RAYS_DESC *pDesc); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList5, RSSetShadingRate) + void ( STDMETHODCALLTYPE *RSSetShadingRate )( + ID3D12GraphicsCommandList5 * This, + _In_ D3D12_SHADING_RATE baseShadingRate, + _In_reads_opt_(D3D12_RS_SET_SHADING_RATE_COMBINER_COUNT) const D3D12_SHADING_RATE_COMBINER *combiners); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList5, RSSetShadingRateImage) + void ( STDMETHODCALLTYPE *RSSetShadingRateImage )( + ID3D12GraphicsCommandList5 * This, + _In_opt_ ID3D12Resource *shadingRateImage); + + END_INTERFACE + } ID3D12GraphicsCommandList5Vtbl; + + interface ID3D12GraphicsCommandList5 + { + CONST_VTBL struct ID3D12GraphicsCommandList5Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12GraphicsCommandList5_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12GraphicsCommandList5_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12GraphicsCommandList5_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12GraphicsCommandList5_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12GraphicsCommandList5_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12GraphicsCommandList5_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12GraphicsCommandList5_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12GraphicsCommandList5_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12GraphicsCommandList5_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12GraphicsCommandList5_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12GraphicsCommandList5_Reset(This,pAllocator,pInitialState) \ + ( (This)->lpVtbl -> Reset(This,pAllocator,pInitialState) ) + +#define ID3D12GraphicsCommandList5_ClearState(This,pPipelineState) \ + ( (This)->lpVtbl -> ClearState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList5_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) ) + +#define ID3D12GraphicsCommandList5_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) ) + +#define ID3D12GraphicsCommandList5_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ + ( (This)->lpVtbl -> Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) + +#define ID3D12GraphicsCommandList5_CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) \ + ( (This)->lpVtbl -> CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) ) + +#define ID3D12GraphicsCommandList5_CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) \ + ( (This)->lpVtbl -> CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) ) + +#define ID3D12GraphicsCommandList5_CopyResource(This,pDstResource,pSrcResource) \ + ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) ) + +#define ID3D12GraphicsCommandList5_CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) \ + ( (This)->lpVtbl -> CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) ) + +#define ID3D12GraphicsCommandList5_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \ + ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) ) + +#define ID3D12GraphicsCommandList5_IASetPrimitiveTopology(This,PrimitiveTopology) \ + ( (This)->lpVtbl -> IASetPrimitiveTopology(This,PrimitiveTopology) ) + +#define ID3D12GraphicsCommandList5_RSSetViewports(This,NumViewports,pViewports) \ + ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) ) + +#define ID3D12GraphicsCommandList5_RSSetScissorRects(This,NumRects,pRects) \ + ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList5_OMSetBlendFactor(This,BlendFactor) \ + ( (This)->lpVtbl -> OMSetBlendFactor(This,BlendFactor) ) + +#define ID3D12GraphicsCommandList5_OMSetStencilRef(This,StencilRef) \ + ( (This)->lpVtbl -> OMSetStencilRef(This,StencilRef) ) + +#define ID3D12GraphicsCommandList5_SetPipelineState(This,pPipelineState) \ + ( (This)->lpVtbl -> SetPipelineState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList5_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12GraphicsCommandList5_ExecuteBundle(This,pCommandList) \ + ( (This)->lpVtbl -> ExecuteBundle(This,pCommandList) ) + +#define ID3D12GraphicsCommandList5_SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) \ + ( (This)->lpVtbl -> SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) ) + +#define ID3D12GraphicsCommandList5_SetComputeRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetComputeRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList5_SetGraphicsRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetGraphicsRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList5_SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList5_SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList5_SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList5_SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList5_SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList5_SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList5_SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList5_SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList5_SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList5_SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList5_SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList5_SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList5_IASetIndexBuffer(This,pView) \ + ( (This)->lpVtbl -> IASetIndexBuffer(This,pView) ) + +#define ID3D12GraphicsCommandList5_IASetVertexBuffers(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumViews,pViews) ) + +#define ID3D12GraphicsCommandList5_SOSetTargets(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> SOSetTargets(This,StartSlot,NumViews,pViews) ) + +#define ID3D12GraphicsCommandList5_OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) \ + ( (This)->lpVtbl -> OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) ) + +#define ID3D12GraphicsCommandList5_ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList5_ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList5_ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList5_ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList5_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12GraphicsCommandList5_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12GraphicsCommandList5_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12GraphicsCommandList5_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12GraphicsCommandList5_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12GraphicsCommandList5_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12GraphicsCommandList5_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12GraphicsCommandList5_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12GraphicsCommandList5_ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) \ + ( (This)->lpVtbl -> ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) ) + + +#define ID3D12GraphicsCommandList5_AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ + ( (This)->lpVtbl -> AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) + +#define ID3D12GraphicsCommandList5_AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ + ( (This)->lpVtbl -> AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) + +#define ID3D12GraphicsCommandList5_OMSetDepthBounds(This,Min,Max) \ + ( (This)->lpVtbl -> OMSetDepthBounds(This,Min,Max) ) + +#define ID3D12GraphicsCommandList5_SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) \ + ( (This)->lpVtbl -> SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) ) + +#define ID3D12GraphicsCommandList5_ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) \ + ( (This)->lpVtbl -> ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) ) + +#define ID3D12GraphicsCommandList5_SetViewInstanceMask(This,Mask) \ + ( (This)->lpVtbl -> SetViewInstanceMask(This,Mask) ) + + +#define ID3D12GraphicsCommandList5_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) + + +#define ID3D12GraphicsCommandList5_SetProtectedResourceSession(This,pProtectedResourceSession) \ + ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) ) + + +#define ID3D12GraphicsCommandList5_BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) \ + ( (This)->lpVtbl -> BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) ) + +#define ID3D12GraphicsCommandList5_EndRenderPass(This) \ + ( (This)->lpVtbl -> EndRenderPass(This) ) + +#define ID3D12GraphicsCommandList5_InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) \ + ( (This)->lpVtbl -> InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) ) + +#define ID3D12GraphicsCommandList5_ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) \ + ( (This)->lpVtbl -> ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) ) + +#define ID3D12GraphicsCommandList5_BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) \ + ( (This)->lpVtbl -> BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) ) + +#define ID3D12GraphicsCommandList5_EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) \ + ( (This)->lpVtbl -> EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) ) + +#define ID3D12GraphicsCommandList5_CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) \ + ( (This)->lpVtbl -> CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) ) + +#define ID3D12GraphicsCommandList5_SetPipelineState1(This,pStateObject) \ + ( (This)->lpVtbl -> SetPipelineState1(This,pStateObject) ) + +#define ID3D12GraphicsCommandList5_DispatchRays(This,pDesc) \ + ( (This)->lpVtbl -> DispatchRays(This,pDesc) ) + + +#define ID3D12GraphicsCommandList5_RSSetShadingRate(This,baseShadingRate,combiners) \ + ( (This)->lpVtbl -> RSSetShadingRate(This,baseShadingRate,combiners) ) + +#define ID3D12GraphicsCommandList5_RSSetShadingRateImage(This,shadingRateImage) \ + ( (This)->lpVtbl -> RSSetShadingRateImage(This,shadingRateImage) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12GraphicsCommandList5_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0062 */ +/* [local] */ + +typedef struct D3D12_DISPATCH_MESH_ARGUMENTS + { + UINT ThreadGroupCountX; + UINT ThreadGroupCountY; + UINT ThreadGroupCountZ; + } D3D12_DISPATCH_MESH_ARGUMENTS; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0062_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0062_v0_0_s_ifspec; + +#ifndef __ID3D12GraphicsCommandList6_INTERFACE_DEFINED__ +#define __ID3D12GraphicsCommandList6_INTERFACE_DEFINED__ + +/* interface ID3D12GraphicsCommandList6 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12GraphicsCommandList6; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("c3827890-e548-4cfa-96cf-5689a9370f80") + ID3D12GraphicsCommandList6 : public ID3D12GraphicsCommandList5 + { + public: + virtual void STDMETHODCALLTYPE DispatchMesh( + _In_ UINT ThreadGroupCountX, + _In_ UINT ThreadGroupCountY, + _In_ UINT ThreadGroupCountZ) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12GraphicsCommandList6Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12GraphicsCommandList6 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12GraphicsCommandList6 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12GraphicsCommandList6 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12GraphicsCommandList6 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12GraphicsCommandList6 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12GraphicsCommandList6 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12GraphicsCommandList6 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12GraphicsCommandList6 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12GraphicsCommandList6 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12GraphicsCommandList6 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12GraphicsCommandList6 * This, + _In_ ID3D12CommandAllocator *pAllocator, + _In_opt_ ID3D12PipelineState *pInitialState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12GraphicsCommandList6 * This, + _In_opt_ ID3D12PipelineState *pPipelineState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawInstanced) + void ( STDMETHODCALLTYPE *DrawInstanced )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT VertexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartVertexLocation, + _In_ UINT StartInstanceLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawIndexedInstanced) + void ( STDMETHODCALLTYPE *DrawIndexedInstanced )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT IndexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartIndexLocation, + _In_ INT BaseVertexLocation, + _In_ UINT StartInstanceLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Dispatch) + void ( STDMETHODCALLTYPE *Dispatch )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT ThreadGroupCountX, + _In_ UINT ThreadGroupCountY, + _In_ UINT ThreadGroupCountZ); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyBufferRegion) + void ( STDMETHODCALLTYPE *CopyBufferRegion )( + ID3D12GraphicsCommandList6 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT64 NumBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTextureRegion) + void ( STDMETHODCALLTYPE *CopyTextureRegion )( + ID3D12GraphicsCommandList6 * This, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pDst, + UINT DstX, + UINT DstY, + UINT DstZ, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pSrc, + _In_opt_ const D3D12_BOX *pSrcBox); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyResource) + void ( STDMETHODCALLTYPE *CopyResource )( + ID3D12GraphicsCommandList6 * This, + _In_ ID3D12Resource *pDstResource, + _In_ ID3D12Resource *pSrcResource); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTiles) + void ( STDMETHODCALLTYPE *CopyTiles )( + ID3D12GraphicsCommandList6 * This, + _In_ ID3D12Resource *pTiledResource, + _In_ const D3D12_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate, + _In_ const D3D12_TILE_REGION_SIZE *pTileRegionSize, + _In_ ID3D12Resource *pBuffer, + UINT64 BufferStartOffsetInBytes, + D3D12_TILE_COPY_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveSubresource) + void ( STDMETHODCALLTYPE *ResolveSubresource )( + ID3D12GraphicsCommandList6 * This, + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_ DXGI_FORMAT Format); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetPrimitiveTopology) + void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )( + ID3D12GraphicsCommandList6 * This, + _In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetViewports) + void ( STDMETHODCALLTYPE *RSSetViewports )( + ID3D12GraphicsCommandList6 * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, + _In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetScissorRects) + void ( STDMETHODCALLTYPE *RSSetScissorRects )( + ID3D12GraphicsCommandList6 * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, + _In_reads_( NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetBlendFactor) + void ( STDMETHODCALLTYPE *OMSetBlendFactor )( + ID3D12GraphicsCommandList6 * This, + _In_reads_opt_(4) const FLOAT BlendFactor[ 4 ]); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetStencilRef) + void ( STDMETHODCALLTYPE *OMSetStencilRef )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT StencilRef); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPipelineState) + void ( STDMETHODCALLTYPE *SetPipelineState )( + ID3D12GraphicsCommandList6 * This, + _In_ ID3D12PipelineState *pPipelineState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteBundle) + void ( STDMETHODCALLTYPE *ExecuteBundle )( + ID3D12GraphicsCommandList6 * This, + _In_ ID3D12GraphicsCommandList *pCommandList); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetDescriptorHeaps) + void ( STDMETHODCALLTYPE *SetDescriptorHeaps )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT NumDescriptorHeaps, + _In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap *const *ppDescriptorHeaps); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootSignature) + void ( STDMETHODCALLTYPE *SetComputeRootSignature )( + ID3D12GraphicsCommandList6 * This, + _In_opt_ ID3D12RootSignature *pRootSignature); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootSignature) + void ( STDMETHODCALLTYPE *SetGraphicsRootSignature )( + ID3D12GraphicsCommandList6 * This, + _In_opt_ ID3D12RootSignature *pRootSignature); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetComputeRootDescriptorTable )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetGraphicsRootDescriptorTable )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstant )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstant )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstants )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstants )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetComputeRootConstantBufferView )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetGraphicsRootConstantBufferView )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetComputeRootShaderResourceView )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetGraphicsRootShaderResourceView )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetComputeRootUnorderedAccessView )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetGraphicsRootUnorderedAccessView )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetIndexBuffer) + void ( STDMETHODCALLTYPE *IASetIndexBuffer )( + ID3D12GraphicsCommandList6 * This, + _In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetVertexBuffers) + void ( STDMETHODCALLTYPE *IASetVertexBuffers )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SOSetTargets) + void ( STDMETHODCALLTYPE *SOSetTargets )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetRenderTargets) + void ( STDMETHODCALLTYPE *OMSetRenderTargets )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT NumRenderTargetDescriptors, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pRenderTargetDescriptors, + _In_ BOOL RTsSingleHandleToDescriptorRange, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pDepthStencilDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearDepthStencilView) + void ( STDMETHODCALLTYPE *ClearDepthStencilView )( + ID3D12GraphicsCommandList6 * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView, + _In_ D3D12_CLEAR_FLAGS ClearFlags, + _In_ FLOAT Depth, + _In_ UINT8 Stencil, + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearRenderTargetView) + void ( STDMETHODCALLTYPE *ClearRenderTargetView )( + ID3D12GraphicsCommandList6 * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView, + _In_ const FLOAT ColorRGBA[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewUint) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )( + ID3D12GraphicsCommandList6 * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const UINT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewFloat) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )( + ID3D12GraphicsCommandList6 * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const FLOAT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12GraphicsCommandList6 * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12GraphicsCommandList6 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12GraphicsCommandList6 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12GraphicsCommandList6 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12GraphicsCommandList6 * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12GraphicsCommandList6 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12GraphicsCommandList6 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12GraphicsCommandList6 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteIndirect) + void ( STDMETHODCALLTYPE *ExecuteIndirect )( + ID3D12GraphicsCommandList6 * This, + _In_ ID3D12CommandSignature *pCommandSignature, + _In_ UINT MaxCommandCount, + _In_ ID3D12Resource *pArgumentBuffer, + _In_ UINT64 ArgumentBufferOffset, + _In_opt_ ID3D12Resource *pCountBuffer, + _In_ UINT64 CountBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT) + void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT )( + ID3D12GraphicsCommandList6 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT64) + void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT64 )( + ID3D12GraphicsCommandList6 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, OMSetDepthBounds) + void ( STDMETHODCALLTYPE *OMSetDepthBounds )( + ID3D12GraphicsCommandList6 * This, + _In_ FLOAT Min, + _In_ FLOAT Max); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetSamplePositions) + void ( STDMETHODCALLTYPE *SetSamplePositions )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT NumSamplesPerPixel, + _In_ UINT NumPixels, + _In_reads_(NumSamplesPerPixel*NumPixels) D3D12_SAMPLE_POSITION *pSamplePositions); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, ResolveSubresourceRegion) + void ( STDMETHODCALLTYPE *ResolveSubresourceRegion )( + ID3D12GraphicsCommandList6 * This, + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ UINT DstX, + _In_ UINT DstY, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_opt_ D3D12_RECT *pSrcRect, + _In_ DXGI_FORMAT Format, + _In_ D3D12_RESOLVE_MODE ResolveMode); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetViewInstanceMask) + void ( STDMETHODCALLTYPE *SetViewInstanceMask )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT Mask); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList2, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12GraphicsCommandList6 * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList3, SetProtectedResourceSession) + void ( STDMETHODCALLTYPE *SetProtectedResourceSession )( + ID3D12GraphicsCommandList6 * This, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BeginRenderPass) + void ( STDMETHODCALLTYPE *BeginRenderPass )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT NumRenderTargets, + _In_reads_opt_(NumRenderTargets) const D3D12_RENDER_PASS_RENDER_TARGET_DESC *pRenderTargets, + _In_opt_ const D3D12_RENDER_PASS_DEPTH_STENCIL_DESC *pDepthStencil, + D3D12_RENDER_PASS_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EndRenderPass) + void ( STDMETHODCALLTYPE *EndRenderPass )( + ID3D12GraphicsCommandList6 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, InitializeMetaCommand) + void ( STDMETHODCALLTYPE *InitializeMetaCommand )( + ID3D12GraphicsCommandList6 * This, + _In_ ID3D12MetaCommand *pMetaCommand, + _In_reads_bytes_opt_(InitializationParametersDataSizeInBytes) const void *pInitializationParametersData, + _In_ SIZE_T InitializationParametersDataSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, ExecuteMetaCommand) + void ( STDMETHODCALLTYPE *ExecuteMetaCommand )( + ID3D12GraphicsCommandList6 * This, + _In_ ID3D12MetaCommand *pMetaCommand, + _In_reads_bytes_opt_(ExecutionParametersDataSizeInBytes) const void *pExecutionParametersData, + _In_ SIZE_T ExecutionParametersDataSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BuildRaytracingAccelerationStructure) + void ( STDMETHODCALLTYPE *BuildRaytracingAccelerationStructure )( + ID3D12GraphicsCommandList6 * This, + _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC *pDesc, + _In_ UINT NumPostbuildInfoDescs, + _In_reads_opt_(NumPostbuildInfoDescs) const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pPostbuildInfoDescs); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EmitRaytracingAccelerationStructurePostbuildInfo) + void ( STDMETHODCALLTYPE *EmitRaytracingAccelerationStructurePostbuildInfo )( + ID3D12GraphicsCommandList6 * This, + _In_ const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pDesc, + _In_ UINT NumSourceAccelerationStructures, + _In_reads_( NumSourceAccelerationStructures ) const D3D12_GPU_VIRTUAL_ADDRESS *pSourceAccelerationStructureData); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, CopyRaytracingAccelerationStructure) + void ( STDMETHODCALLTYPE *CopyRaytracingAccelerationStructure )( + ID3D12GraphicsCommandList6 * This, + _In_ D3D12_GPU_VIRTUAL_ADDRESS DestAccelerationStructureData, + _In_ D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData, + _In_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE Mode); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, SetPipelineState1) + void ( STDMETHODCALLTYPE *SetPipelineState1 )( + ID3D12GraphicsCommandList6 * This, + _In_ ID3D12StateObject *pStateObject); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, DispatchRays) + void ( STDMETHODCALLTYPE *DispatchRays )( + ID3D12GraphicsCommandList6 * This, + _In_ const D3D12_DISPATCH_RAYS_DESC *pDesc); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList5, RSSetShadingRate) + void ( STDMETHODCALLTYPE *RSSetShadingRate )( + ID3D12GraphicsCommandList6 * This, + _In_ D3D12_SHADING_RATE baseShadingRate, + _In_reads_opt_(D3D12_RS_SET_SHADING_RATE_COMBINER_COUNT) const D3D12_SHADING_RATE_COMBINER *combiners); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList5, RSSetShadingRateImage) + void ( STDMETHODCALLTYPE *RSSetShadingRateImage )( + ID3D12GraphicsCommandList6 * This, + _In_opt_ ID3D12Resource *shadingRateImage); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList6, DispatchMesh) + void ( STDMETHODCALLTYPE *DispatchMesh )( + ID3D12GraphicsCommandList6 * This, + _In_ UINT ThreadGroupCountX, + _In_ UINT ThreadGroupCountY, + _In_ UINT ThreadGroupCountZ); + + END_INTERFACE + } ID3D12GraphicsCommandList6Vtbl; + + interface ID3D12GraphicsCommandList6 + { + CONST_VTBL struct ID3D12GraphicsCommandList6Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12GraphicsCommandList6_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12GraphicsCommandList6_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12GraphicsCommandList6_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12GraphicsCommandList6_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12GraphicsCommandList6_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12GraphicsCommandList6_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12GraphicsCommandList6_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12GraphicsCommandList6_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12GraphicsCommandList6_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12GraphicsCommandList6_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12GraphicsCommandList6_Reset(This,pAllocator,pInitialState) \ + ( (This)->lpVtbl -> Reset(This,pAllocator,pInitialState) ) + +#define ID3D12GraphicsCommandList6_ClearState(This,pPipelineState) \ + ( (This)->lpVtbl -> ClearState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList6_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) ) + +#define ID3D12GraphicsCommandList6_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) ) + +#define ID3D12GraphicsCommandList6_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ + ( (This)->lpVtbl -> Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) + +#define ID3D12GraphicsCommandList6_CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) \ + ( (This)->lpVtbl -> CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) ) + +#define ID3D12GraphicsCommandList6_CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) \ + ( (This)->lpVtbl -> CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) ) + +#define ID3D12GraphicsCommandList6_CopyResource(This,pDstResource,pSrcResource) \ + ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) ) + +#define ID3D12GraphicsCommandList6_CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) \ + ( (This)->lpVtbl -> CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) ) + +#define ID3D12GraphicsCommandList6_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \ + ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) ) + +#define ID3D12GraphicsCommandList6_IASetPrimitiveTopology(This,PrimitiveTopology) \ + ( (This)->lpVtbl -> IASetPrimitiveTopology(This,PrimitiveTopology) ) + +#define ID3D12GraphicsCommandList6_RSSetViewports(This,NumViewports,pViewports) \ + ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) ) + +#define ID3D12GraphicsCommandList6_RSSetScissorRects(This,NumRects,pRects) \ + ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList6_OMSetBlendFactor(This,BlendFactor) \ + ( (This)->lpVtbl -> OMSetBlendFactor(This,BlendFactor) ) + +#define ID3D12GraphicsCommandList6_OMSetStencilRef(This,StencilRef) \ + ( (This)->lpVtbl -> OMSetStencilRef(This,StencilRef) ) + +#define ID3D12GraphicsCommandList6_SetPipelineState(This,pPipelineState) \ + ( (This)->lpVtbl -> SetPipelineState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList6_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12GraphicsCommandList6_ExecuteBundle(This,pCommandList) \ + ( (This)->lpVtbl -> ExecuteBundle(This,pCommandList) ) + +#define ID3D12GraphicsCommandList6_SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) \ + ( (This)->lpVtbl -> SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) ) + +#define ID3D12GraphicsCommandList6_SetComputeRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetComputeRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList6_SetGraphicsRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetGraphicsRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList6_SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList6_SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList6_SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList6_SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList6_SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList6_SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList6_SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList6_SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList6_SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList6_SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList6_SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList6_SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList6_IASetIndexBuffer(This,pView) \ + ( (This)->lpVtbl -> IASetIndexBuffer(This,pView) ) + +#define ID3D12GraphicsCommandList6_IASetVertexBuffers(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumViews,pViews) ) + +#define ID3D12GraphicsCommandList6_SOSetTargets(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> SOSetTargets(This,StartSlot,NumViews,pViews) ) + +#define ID3D12GraphicsCommandList6_OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) \ + ( (This)->lpVtbl -> OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) ) + +#define ID3D12GraphicsCommandList6_ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList6_ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList6_ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList6_ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList6_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12GraphicsCommandList6_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12GraphicsCommandList6_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12GraphicsCommandList6_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12GraphicsCommandList6_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12GraphicsCommandList6_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12GraphicsCommandList6_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12GraphicsCommandList6_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12GraphicsCommandList6_ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) \ + ( (This)->lpVtbl -> ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) ) + + +#define ID3D12GraphicsCommandList6_AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ + ( (This)->lpVtbl -> AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) + +#define ID3D12GraphicsCommandList6_AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ + ( (This)->lpVtbl -> AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) + +#define ID3D12GraphicsCommandList6_OMSetDepthBounds(This,Min,Max) \ + ( (This)->lpVtbl -> OMSetDepthBounds(This,Min,Max) ) + +#define ID3D12GraphicsCommandList6_SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) \ + ( (This)->lpVtbl -> SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) ) + +#define ID3D12GraphicsCommandList6_ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) \ + ( (This)->lpVtbl -> ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) ) + +#define ID3D12GraphicsCommandList6_SetViewInstanceMask(This,Mask) \ + ( (This)->lpVtbl -> SetViewInstanceMask(This,Mask) ) + + +#define ID3D12GraphicsCommandList6_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) + + +#define ID3D12GraphicsCommandList6_SetProtectedResourceSession(This,pProtectedResourceSession) \ + ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) ) + + +#define ID3D12GraphicsCommandList6_BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) \ + ( (This)->lpVtbl -> BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) ) + +#define ID3D12GraphicsCommandList6_EndRenderPass(This) \ + ( (This)->lpVtbl -> EndRenderPass(This) ) + +#define ID3D12GraphicsCommandList6_InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) \ + ( (This)->lpVtbl -> InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) ) + +#define ID3D12GraphicsCommandList6_ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) \ + ( (This)->lpVtbl -> ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) ) + +#define ID3D12GraphicsCommandList6_BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) \ + ( (This)->lpVtbl -> BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) ) + +#define ID3D12GraphicsCommandList6_EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) \ + ( (This)->lpVtbl -> EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) ) + +#define ID3D12GraphicsCommandList6_CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) \ + ( (This)->lpVtbl -> CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) ) + +#define ID3D12GraphicsCommandList6_SetPipelineState1(This,pStateObject) \ + ( (This)->lpVtbl -> SetPipelineState1(This,pStateObject) ) + +#define ID3D12GraphicsCommandList6_DispatchRays(This,pDesc) \ + ( (This)->lpVtbl -> DispatchRays(This,pDesc) ) + + +#define ID3D12GraphicsCommandList6_RSSetShadingRate(This,baseShadingRate,combiners) \ + ( (This)->lpVtbl -> RSSetShadingRate(This,baseShadingRate,combiners) ) + +#define ID3D12GraphicsCommandList6_RSSetShadingRateImage(This,shadingRateImage) \ + ( (This)->lpVtbl -> RSSetShadingRateImage(This,shadingRateImage) ) + + +#define ID3D12GraphicsCommandList6_DispatchMesh(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ + ( (This)->lpVtbl -> DispatchMesh(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12GraphicsCommandList6_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12GraphicsCommandList7_INTERFACE_DEFINED__ +#define __ID3D12GraphicsCommandList7_INTERFACE_DEFINED__ + +/* interface ID3D12GraphicsCommandList7 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12GraphicsCommandList7; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("dd171223-8b61-4769-90e3-160ccde4e2c1") + ID3D12GraphicsCommandList7 : public ID3D12GraphicsCommandList6 + { + public: + virtual void STDMETHODCALLTYPE Barrier( + UINT32 NumBarrierGroups, + _In_reads_(NumBarrierGroups) const D3D12_BARRIER_GROUP *pBarrierGroups) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12GraphicsCommandList7Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12GraphicsCommandList7 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12GraphicsCommandList7 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12GraphicsCommandList7 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12GraphicsCommandList7 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12GraphicsCommandList7 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12GraphicsCommandList7 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12GraphicsCommandList7 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12GraphicsCommandList7 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12GraphicsCommandList7 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12GraphicsCommandList7 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12GraphicsCommandList7 * This, + _In_ ID3D12CommandAllocator *pAllocator, + _In_opt_ ID3D12PipelineState *pInitialState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12GraphicsCommandList7 * This, + _In_opt_ ID3D12PipelineState *pPipelineState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawInstanced) + void ( STDMETHODCALLTYPE *DrawInstanced )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT VertexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartVertexLocation, + _In_ UINT StartInstanceLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawIndexedInstanced) + void ( STDMETHODCALLTYPE *DrawIndexedInstanced )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT IndexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartIndexLocation, + _In_ INT BaseVertexLocation, + _In_ UINT StartInstanceLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Dispatch) + void ( STDMETHODCALLTYPE *Dispatch )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT ThreadGroupCountX, + _In_ UINT ThreadGroupCountY, + _In_ UINT ThreadGroupCountZ); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyBufferRegion) + void ( STDMETHODCALLTYPE *CopyBufferRegion )( + ID3D12GraphicsCommandList7 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT64 NumBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTextureRegion) + void ( STDMETHODCALLTYPE *CopyTextureRegion )( + ID3D12GraphicsCommandList7 * This, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pDst, + UINT DstX, + UINT DstY, + UINT DstZ, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pSrc, + _In_opt_ const D3D12_BOX *pSrcBox); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyResource) + void ( STDMETHODCALLTYPE *CopyResource )( + ID3D12GraphicsCommandList7 * This, + _In_ ID3D12Resource *pDstResource, + _In_ ID3D12Resource *pSrcResource); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTiles) + void ( STDMETHODCALLTYPE *CopyTiles )( + ID3D12GraphicsCommandList7 * This, + _In_ ID3D12Resource *pTiledResource, + _In_ const D3D12_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate, + _In_ const D3D12_TILE_REGION_SIZE *pTileRegionSize, + _In_ ID3D12Resource *pBuffer, + UINT64 BufferStartOffsetInBytes, + D3D12_TILE_COPY_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveSubresource) + void ( STDMETHODCALLTYPE *ResolveSubresource )( + ID3D12GraphicsCommandList7 * This, + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_ DXGI_FORMAT Format); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetPrimitiveTopology) + void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )( + ID3D12GraphicsCommandList7 * This, + _In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetViewports) + void ( STDMETHODCALLTYPE *RSSetViewports )( + ID3D12GraphicsCommandList7 * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, + _In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetScissorRects) + void ( STDMETHODCALLTYPE *RSSetScissorRects )( + ID3D12GraphicsCommandList7 * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, + _In_reads_( NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetBlendFactor) + void ( STDMETHODCALLTYPE *OMSetBlendFactor )( + ID3D12GraphicsCommandList7 * This, + _In_reads_opt_(4) const FLOAT BlendFactor[ 4 ]); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetStencilRef) + void ( STDMETHODCALLTYPE *OMSetStencilRef )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT StencilRef); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPipelineState) + void ( STDMETHODCALLTYPE *SetPipelineState )( + ID3D12GraphicsCommandList7 * This, + _In_ ID3D12PipelineState *pPipelineState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteBundle) + void ( STDMETHODCALLTYPE *ExecuteBundle )( + ID3D12GraphicsCommandList7 * This, + _In_ ID3D12GraphicsCommandList *pCommandList); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetDescriptorHeaps) + void ( STDMETHODCALLTYPE *SetDescriptorHeaps )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT NumDescriptorHeaps, + _In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap *const *ppDescriptorHeaps); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootSignature) + void ( STDMETHODCALLTYPE *SetComputeRootSignature )( + ID3D12GraphicsCommandList7 * This, + _In_opt_ ID3D12RootSignature *pRootSignature); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootSignature) + void ( STDMETHODCALLTYPE *SetGraphicsRootSignature )( + ID3D12GraphicsCommandList7 * This, + _In_opt_ ID3D12RootSignature *pRootSignature); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetComputeRootDescriptorTable )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetGraphicsRootDescriptorTable )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstant )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstant )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstants )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstants )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetComputeRootConstantBufferView )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetGraphicsRootConstantBufferView )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetComputeRootShaderResourceView )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetGraphicsRootShaderResourceView )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetComputeRootUnorderedAccessView )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetGraphicsRootUnorderedAccessView )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetIndexBuffer) + void ( STDMETHODCALLTYPE *IASetIndexBuffer )( + ID3D12GraphicsCommandList7 * This, + _In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetVertexBuffers) + void ( STDMETHODCALLTYPE *IASetVertexBuffers )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SOSetTargets) + void ( STDMETHODCALLTYPE *SOSetTargets )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetRenderTargets) + void ( STDMETHODCALLTYPE *OMSetRenderTargets )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT NumRenderTargetDescriptors, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pRenderTargetDescriptors, + _In_ BOOL RTsSingleHandleToDescriptorRange, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pDepthStencilDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearDepthStencilView) + void ( STDMETHODCALLTYPE *ClearDepthStencilView )( + ID3D12GraphicsCommandList7 * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView, + _In_ D3D12_CLEAR_FLAGS ClearFlags, + _In_ FLOAT Depth, + _In_ UINT8 Stencil, + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearRenderTargetView) + void ( STDMETHODCALLTYPE *ClearRenderTargetView )( + ID3D12GraphicsCommandList7 * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView, + _In_ const FLOAT ColorRGBA[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewUint) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )( + ID3D12GraphicsCommandList7 * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const UINT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewFloat) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )( + ID3D12GraphicsCommandList7 * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const FLOAT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12GraphicsCommandList7 * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12GraphicsCommandList7 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12GraphicsCommandList7 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12GraphicsCommandList7 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12GraphicsCommandList7 * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12GraphicsCommandList7 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12GraphicsCommandList7 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12GraphicsCommandList7 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteIndirect) + void ( STDMETHODCALLTYPE *ExecuteIndirect )( + ID3D12GraphicsCommandList7 * This, + _In_ ID3D12CommandSignature *pCommandSignature, + _In_ UINT MaxCommandCount, + _In_ ID3D12Resource *pArgumentBuffer, + _In_ UINT64 ArgumentBufferOffset, + _In_opt_ ID3D12Resource *pCountBuffer, + _In_ UINT64 CountBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT) + void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT )( + ID3D12GraphicsCommandList7 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT64) + void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT64 )( + ID3D12GraphicsCommandList7 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, OMSetDepthBounds) + void ( STDMETHODCALLTYPE *OMSetDepthBounds )( + ID3D12GraphicsCommandList7 * This, + _In_ FLOAT Min, + _In_ FLOAT Max); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetSamplePositions) + void ( STDMETHODCALLTYPE *SetSamplePositions )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT NumSamplesPerPixel, + _In_ UINT NumPixels, + _In_reads_(NumSamplesPerPixel*NumPixels) D3D12_SAMPLE_POSITION *pSamplePositions); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, ResolveSubresourceRegion) + void ( STDMETHODCALLTYPE *ResolveSubresourceRegion )( + ID3D12GraphicsCommandList7 * This, + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ UINT DstX, + _In_ UINT DstY, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_opt_ D3D12_RECT *pSrcRect, + _In_ DXGI_FORMAT Format, + _In_ D3D12_RESOLVE_MODE ResolveMode); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetViewInstanceMask) + void ( STDMETHODCALLTYPE *SetViewInstanceMask )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT Mask); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList2, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12GraphicsCommandList7 * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList3, SetProtectedResourceSession) + void ( STDMETHODCALLTYPE *SetProtectedResourceSession )( + ID3D12GraphicsCommandList7 * This, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BeginRenderPass) + void ( STDMETHODCALLTYPE *BeginRenderPass )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT NumRenderTargets, + _In_reads_opt_(NumRenderTargets) const D3D12_RENDER_PASS_RENDER_TARGET_DESC *pRenderTargets, + _In_opt_ const D3D12_RENDER_PASS_DEPTH_STENCIL_DESC *pDepthStencil, + D3D12_RENDER_PASS_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EndRenderPass) + void ( STDMETHODCALLTYPE *EndRenderPass )( + ID3D12GraphicsCommandList7 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, InitializeMetaCommand) + void ( STDMETHODCALLTYPE *InitializeMetaCommand )( + ID3D12GraphicsCommandList7 * This, + _In_ ID3D12MetaCommand *pMetaCommand, + _In_reads_bytes_opt_(InitializationParametersDataSizeInBytes) const void *pInitializationParametersData, + _In_ SIZE_T InitializationParametersDataSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, ExecuteMetaCommand) + void ( STDMETHODCALLTYPE *ExecuteMetaCommand )( + ID3D12GraphicsCommandList7 * This, + _In_ ID3D12MetaCommand *pMetaCommand, + _In_reads_bytes_opt_(ExecutionParametersDataSizeInBytes) const void *pExecutionParametersData, + _In_ SIZE_T ExecutionParametersDataSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BuildRaytracingAccelerationStructure) + void ( STDMETHODCALLTYPE *BuildRaytracingAccelerationStructure )( + ID3D12GraphicsCommandList7 * This, + _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC *pDesc, + _In_ UINT NumPostbuildInfoDescs, + _In_reads_opt_(NumPostbuildInfoDescs) const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pPostbuildInfoDescs); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EmitRaytracingAccelerationStructurePostbuildInfo) + void ( STDMETHODCALLTYPE *EmitRaytracingAccelerationStructurePostbuildInfo )( + ID3D12GraphicsCommandList7 * This, + _In_ const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pDesc, + _In_ UINT NumSourceAccelerationStructures, + _In_reads_( NumSourceAccelerationStructures ) const D3D12_GPU_VIRTUAL_ADDRESS *pSourceAccelerationStructureData); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, CopyRaytracingAccelerationStructure) + void ( STDMETHODCALLTYPE *CopyRaytracingAccelerationStructure )( + ID3D12GraphicsCommandList7 * This, + _In_ D3D12_GPU_VIRTUAL_ADDRESS DestAccelerationStructureData, + _In_ D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData, + _In_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE Mode); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, SetPipelineState1) + void ( STDMETHODCALLTYPE *SetPipelineState1 )( + ID3D12GraphicsCommandList7 * This, + _In_ ID3D12StateObject *pStateObject); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, DispatchRays) + void ( STDMETHODCALLTYPE *DispatchRays )( + ID3D12GraphicsCommandList7 * This, + _In_ const D3D12_DISPATCH_RAYS_DESC *pDesc); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList5, RSSetShadingRate) + void ( STDMETHODCALLTYPE *RSSetShadingRate )( + ID3D12GraphicsCommandList7 * This, + _In_ D3D12_SHADING_RATE baseShadingRate, + _In_reads_opt_(D3D12_RS_SET_SHADING_RATE_COMBINER_COUNT) const D3D12_SHADING_RATE_COMBINER *combiners); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList5, RSSetShadingRateImage) + void ( STDMETHODCALLTYPE *RSSetShadingRateImage )( + ID3D12GraphicsCommandList7 * This, + _In_opt_ ID3D12Resource *shadingRateImage); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList6, DispatchMesh) + void ( STDMETHODCALLTYPE *DispatchMesh )( + ID3D12GraphicsCommandList7 * This, + _In_ UINT ThreadGroupCountX, + _In_ UINT ThreadGroupCountY, + _In_ UINT ThreadGroupCountZ); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList7, Barrier) + void ( STDMETHODCALLTYPE *Barrier )( + ID3D12GraphicsCommandList7 * This, + UINT32 NumBarrierGroups, + _In_reads_(NumBarrierGroups) const D3D12_BARRIER_GROUP *pBarrierGroups); + + END_INTERFACE + } ID3D12GraphicsCommandList7Vtbl; + + interface ID3D12GraphicsCommandList7 + { + CONST_VTBL struct ID3D12GraphicsCommandList7Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12GraphicsCommandList7_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12GraphicsCommandList7_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12GraphicsCommandList7_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12GraphicsCommandList7_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12GraphicsCommandList7_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12GraphicsCommandList7_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12GraphicsCommandList7_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12GraphicsCommandList7_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12GraphicsCommandList7_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12GraphicsCommandList7_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12GraphicsCommandList7_Reset(This,pAllocator,pInitialState) \ + ( (This)->lpVtbl -> Reset(This,pAllocator,pInitialState) ) + +#define ID3D12GraphicsCommandList7_ClearState(This,pPipelineState) \ + ( (This)->lpVtbl -> ClearState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList7_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) ) + +#define ID3D12GraphicsCommandList7_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) ) + +#define ID3D12GraphicsCommandList7_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ + ( (This)->lpVtbl -> Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) + +#define ID3D12GraphicsCommandList7_CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) \ + ( (This)->lpVtbl -> CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) ) + +#define ID3D12GraphicsCommandList7_CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) \ + ( (This)->lpVtbl -> CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) ) + +#define ID3D12GraphicsCommandList7_CopyResource(This,pDstResource,pSrcResource) \ + ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) ) + +#define ID3D12GraphicsCommandList7_CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) \ + ( (This)->lpVtbl -> CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) ) + +#define ID3D12GraphicsCommandList7_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \ + ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) ) + +#define ID3D12GraphicsCommandList7_IASetPrimitiveTopology(This,PrimitiveTopology) \ + ( (This)->lpVtbl -> IASetPrimitiveTopology(This,PrimitiveTopology) ) + +#define ID3D12GraphicsCommandList7_RSSetViewports(This,NumViewports,pViewports) \ + ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) ) + +#define ID3D12GraphicsCommandList7_RSSetScissorRects(This,NumRects,pRects) \ + ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList7_OMSetBlendFactor(This,BlendFactor) \ + ( (This)->lpVtbl -> OMSetBlendFactor(This,BlendFactor) ) + +#define ID3D12GraphicsCommandList7_OMSetStencilRef(This,StencilRef) \ + ( (This)->lpVtbl -> OMSetStencilRef(This,StencilRef) ) + +#define ID3D12GraphicsCommandList7_SetPipelineState(This,pPipelineState) \ + ( (This)->lpVtbl -> SetPipelineState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList7_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12GraphicsCommandList7_ExecuteBundle(This,pCommandList) \ + ( (This)->lpVtbl -> ExecuteBundle(This,pCommandList) ) + +#define ID3D12GraphicsCommandList7_SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) \ + ( (This)->lpVtbl -> SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) ) + +#define ID3D12GraphicsCommandList7_SetComputeRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetComputeRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList7_SetGraphicsRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetGraphicsRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList7_SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList7_SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList7_SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList7_SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList7_SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList7_SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList7_SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList7_SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList7_SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList7_SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList7_SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList7_SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList7_IASetIndexBuffer(This,pView) \ + ( (This)->lpVtbl -> IASetIndexBuffer(This,pView) ) + +#define ID3D12GraphicsCommandList7_IASetVertexBuffers(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumViews,pViews) ) + +#define ID3D12GraphicsCommandList7_SOSetTargets(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> SOSetTargets(This,StartSlot,NumViews,pViews) ) + +#define ID3D12GraphicsCommandList7_OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) \ + ( (This)->lpVtbl -> OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) ) + +#define ID3D12GraphicsCommandList7_ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList7_ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList7_ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList7_ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList7_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12GraphicsCommandList7_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12GraphicsCommandList7_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12GraphicsCommandList7_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12GraphicsCommandList7_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12GraphicsCommandList7_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12GraphicsCommandList7_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12GraphicsCommandList7_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12GraphicsCommandList7_ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) \ + ( (This)->lpVtbl -> ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) ) + + +#define ID3D12GraphicsCommandList7_AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ + ( (This)->lpVtbl -> AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) + +#define ID3D12GraphicsCommandList7_AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ + ( (This)->lpVtbl -> AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) + +#define ID3D12GraphicsCommandList7_OMSetDepthBounds(This,Min,Max) \ + ( (This)->lpVtbl -> OMSetDepthBounds(This,Min,Max) ) + +#define ID3D12GraphicsCommandList7_SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) \ + ( (This)->lpVtbl -> SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) ) + +#define ID3D12GraphicsCommandList7_ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) \ + ( (This)->lpVtbl -> ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) ) + +#define ID3D12GraphicsCommandList7_SetViewInstanceMask(This,Mask) \ + ( (This)->lpVtbl -> SetViewInstanceMask(This,Mask) ) + + +#define ID3D12GraphicsCommandList7_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) + + +#define ID3D12GraphicsCommandList7_SetProtectedResourceSession(This,pProtectedResourceSession) \ + ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) ) + + +#define ID3D12GraphicsCommandList7_BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) \ + ( (This)->lpVtbl -> BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) ) + +#define ID3D12GraphicsCommandList7_EndRenderPass(This) \ + ( (This)->lpVtbl -> EndRenderPass(This) ) + +#define ID3D12GraphicsCommandList7_InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) \ + ( (This)->lpVtbl -> InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) ) + +#define ID3D12GraphicsCommandList7_ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) \ + ( (This)->lpVtbl -> ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) ) + +#define ID3D12GraphicsCommandList7_BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) \ + ( (This)->lpVtbl -> BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) ) + +#define ID3D12GraphicsCommandList7_EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) \ + ( (This)->lpVtbl -> EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) ) + +#define ID3D12GraphicsCommandList7_CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) \ + ( (This)->lpVtbl -> CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) ) + +#define ID3D12GraphicsCommandList7_SetPipelineState1(This,pStateObject) \ + ( (This)->lpVtbl -> SetPipelineState1(This,pStateObject) ) + +#define ID3D12GraphicsCommandList7_DispatchRays(This,pDesc) \ + ( (This)->lpVtbl -> DispatchRays(This,pDesc) ) + + +#define ID3D12GraphicsCommandList7_RSSetShadingRate(This,baseShadingRate,combiners) \ + ( (This)->lpVtbl -> RSSetShadingRate(This,baseShadingRate,combiners) ) + +#define ID3D12GraphicsCommandList7_RSSetShadingRateImage(This,shadingRateImage) \ + ( (This)->lpVtbl -> RSSetShadingRateImage(This,shadingRateImage) ) + + +#define ID3D12GraphicsCommandList7_DispatchMesh(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ + ( (This)->lpVtbl -> DispatchMesh(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) + + +#define ID3D12GraphicsCommandList7_Barrier(This,NumBarrierGroups,pBarrierGroups) \ + ( (This)->lpVtbl -> Barrier(This,NumBarrierGroups,pBarrierGroups) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12GraphicsCommandList7_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12GraphicsCommandList8_INTERFACE_DEFINED__ +#define __ID3D12GraphicsCommandList8_INTERFACE_DEFINED__ + +/* interface ID3D12GraphicsCommandList8 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12GraphicsCommandList8; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("ee936ef9-599d-4d28-938e-23c4ad05ce51") + ID3D12GraphicsCommandList8 : public ID3D12GraphicsCommandList7 + { + public: + virtual void STDMETHODCALLTYPE OMSetFrontAndBackStencilRef( + _In_ UINT FrontStencilRef, + _In_ UINT BackStencilRef) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12GraphicsCommandList8Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12GraphicsCommandList8 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12GraphicsCommandList8 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12GraphicsCommandList8 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12GraphicsCommandList8 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12GraphicsCommandList8 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12GraphicsCommandList8 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12GraphicsCommandList8 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12GraphicsCommandList8 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12GraphicsCommandList8 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12GraphicsCommandList8 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12GraphicsCommandList8 * This, + _In_ ID3D12CommandAllocator *pAllocator, + _In_opt_ ID3D12PipelineState *pInitialState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12GraphicsCommandList8 * This, + _In_opt_ ID3D12PipelineState *pPipelineState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawInstanced) + void ( STDMETHODCALLTYPE *DrawInstanced )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT VertexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartVertexLocation, + _In_ UINT StartInstanceLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawIndexedInstanced) + void ( STDMETHODCALLTYPE *DrawIndexedInstanced )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT IndexCountPerInstance, + _In_ UINT InstanceCount, + _In_ UINT StartIndexLocation, + _In_ INT BaseVertexLocation, + _In_ UINT StartInstanceLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Dispatch) + void ( STDMETHODCALLTYPE *Dispatch )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT ThreadGroupCountX, + _In_ UINT ThreadGroupCountY, + _In_ UINT ThreadGroupCountZ); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyBufferRegion) + void ( STDMETHODCALLTYPE *CopyBufferRegion )( + ID3D12GraphicsCommandList8 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT64 NumBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTextureRegion) + void ( STDMETHODCALLTYPE *CopyTextureRegion )( + ID3D12GraphicsCommandList8 * This, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pDst, + UINT DstX, + UINT DstY, + UINT DstZ, + _In_ const D3D12_TEXTURE_COPY_LOCATION *pSrc, + _In_opt_ const D3D12_BOX *pSrcBox); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyResource) + void ( STDMETHODCALLTYPE *CopyResource )( + ID3D12GraphicsCommandList8 * This, + _In_ ID3D12Resource *pDstResource, + _In_ ID3D12Resource *pSrcResource); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTiles) + void ( STDMETHODCALLTYPE *CopyTiles )( + ID3D12GraphicsCommandList8 * This, + _In_ ID3D12Resource *pTiledResource, + _In_ const D3D12_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate, + _In_ const D3D12_TILE_REGION_SIZE *pTileRegionSize, + _In_ ID3D12Resource *pBuffer, + UINT64 BufferStartOffsetInBytes, + D3D12_TILE_COPY_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveSubresource) + void ( STDMETHODCALLTYPE *ResolveSubresource )( + ID3D12GraphicsCommandList8 * This, + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_ DXGI_FORMAT Format); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetPrimitiveTopology) + void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )( + ID3D12GraphicsCommandList8 * This, + _In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetViewports) + void ( STDMETHODCALLTYPE *RSSetViewports )( + ID3D12GraphicsCommandList8 * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports, + _In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetScissorRects) + void ( STDMETHODCALLTYPE *RSSetScissorRects )( + ID3D12GraphicsCommandList8 * This, + _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects, + _In_reads_( NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetBlendFactor) + void ( STDMETHODCALLTYPE *OMSetBlendFactor )( + ID3D12GraphicsCommandList8 * This, + _In_reads_opt_(4) const FLOAT BlendFactor[ 4 ]); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetStencilRef) + void ( STDMETHODCALLTYPE *OMSetStencilRef )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT StencilRef); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPipelineState) + void ( STDMETHODCALLTYPE *SetPipelineState )( + ID3D12GraphicsCommandList8 * This, + _In_ ID3D12PipelineState *pPipelineState); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteBundle) + void ( STDMETHODCALLTYPE *ExecuteBundle )( + ID3D12GraphicsCommandList8 * This, + _In_ ID3D12GraphicsCommandList *pCommandList); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetDescriptorHeaps) + void ( STDMETHODCALLTYPE *SetDescriptorHeaps )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT NumDescriptorHeaps, + _In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap *const *ppDescriptorHeaps); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootSignature) + void ( STDMETHODCALLTYPE *SetComputeRootSignature )( + ID3D12GraphicsCommandList8 * This, + _In_opt_ ID3D12RootSignature *pRootSignature); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootSignature) + void ( STDMETHODCALLTYPE *SetGraphicsRootSignature )( + ID3D12GraphicsCommandList8 * This, + _In_opt_ ID3D12RootSignature *pRootSignature); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetComputeRootDescriptorTable )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootDescriptorTable) + void ( STDMETHODCALLTYPE *SetGraphicsRootDescriptorTable )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstant )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstant) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstant )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT RootParameterIndex, + _In_ UINT SrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstants )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstants) + void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstants )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT RootParameterIndex, + _In_ UINT Num32BitValuesToSet, + _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData, + _In_ UINT DestOffsetIn32BitValues); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetComputeRootConstantBufferView )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootConstantBufferView) + void ( STDMETHODCALLTYPE *SetGraphicsRootConstantBufferView )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetComputeRootShaderResourceView )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootShaderResourceView) + void ( STDMETHODCALLTYPE *SetGraphicsRootShaderResourceView )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetComputeRootUnorderedAccessView )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootUnorderedAccessView) + void ( STDMETHODCALLTYPE *SetGraphicsRootUnorderedAccessView )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT RootParameterIndex, + _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetIndexBuffer) + void ( STDMETHODCALLTYPE *IASetIndexBuffer )( + ID3D12GraphicsCommandList8 * This, + _In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetVertexBuffers) + void ( STDMETHODCALLTYPE *IASetVertexBuffers )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SOSetTargets) + void ( STDMETHODCALLTYPE *SOSetTargets )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT StartSlot, + _In_ UINT NumViews, + _In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetRenderTargets) + void ( STDMETHODCALLTYPE *OMSetRenderTargets )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT NumRenderTargetDescriptors, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pRenderTargetDescriptors, + _In_ BOOL RTsSingleHandleToDescriptorRange, + _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pDepthStencilDescriptor); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearDepthStencilView) + void ( STDMETHODCALLTYPE *ClearDepthStencilView )( + ID3D12GraphicsCommandList8 * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView, + _In_ D3D12_CLEAR_FLAGS ClearFlags, + _In_ FLOAT Depth, + _In_ UINT8 Stencil, + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearRenderTargetView) + void ( STDMETHODCALLTYPE *ClearRenderTargetView )( + ID3D12GraphicsCommandList8 * This, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView, + _In_ const FLOAT ColorRGBA[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewUint) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )( + ID3D12GraphicsCommandList8 * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const UINT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewFloat) + void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )( + ID3D12GraphicsCommandList8 * This, + _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap, + _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle, + _In_ ID3D12Resource *pResource, + _In_ const FLOAT Values[ 4 ], + _In_ UINT NumRects, + _In_reads_(NumRects) const D3D12_RECT *pRects); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12GraphicsCommandList8 * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12GraphicsCommandList8 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12GraphicsCommandList8 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12GraphicsCommandList8 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12GraphicsCommandList8 * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12GraphicsCommandList8 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12GraphicsCommandList8 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12GraphicsCommandList8 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteIndirect) + void ( STDMETHODCALLTYPE *ExecuteIndirect )( + ID3D12GraphicsCommandList8 * This, + _In_ ID3D12CommandSignature *pCommandSignature, + _In_ UINT MaxCommandCount, + _In_ ID3D12Resource *pArgumentBuffer, + _In_ UINT64 ArgumentBufferOffset, + _In_opt_ ID3D12Resource *pCountBuffer, + _In_ UINT64 CountBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT) + void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT )( + ID3D12GraphicsCommandList8 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT64) + void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT64 )( + ID3D12GraphicsCommandList8 * This, + _In_ ID3D12Resource *pDstBuffer, + UINT64 DstOffset, + _In_ ID3D12Resource *pSrcBuffer, + UINT64 SrcOffset, + UINT Dependencies, + _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources, + _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, OMSetDepthBounds) + void ( STDMETHODCALLTYPE *OMSetDepthBounds )( + ID3D12GraphicsCommandList8 * This, + _In_ FLOAT Min, + _In_ FLOAT Max); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetSamplePositions) + void ( STDMETHODCALLTYPE *SetSamplePositions )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT NumSamplesPerPixel, + _In_ UINT NumPixels, + _In_reads_(NumSamplesPerPixel*NumPixels) D3D12_SAMPLE_POSITION *pSamplePositions); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, ResolveSubresourceRegion) + void ( STDMETHODCALLTYPE *ResolveSubresourceRegion )( + ID3D12GraphicsCommandList8 * This, + _In_ ID3D12Resource *pDstResource, + _In_ UINT DstSubresource, + _In_ UINT DstX, + _In_ UINT DstY, + _In_ ID3D12Resource *pSrcResource, + _In_ UINT SrcSubresource, + _In_opt_ D3D12_RECT *pSrcRect, + _In_ DXGI_FORMAT Format, + _In_ D3D12_RESOLVE_MODE ResolveMode); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetViewInstanceMask) + void ( STDMETHODCALLTYPE *SetViewInstanceMask )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT Mask); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList2, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12GraphicsCommandList8 * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList3, SetProtectedResourceSession) + void ( STDMETHODCALLTYPE *SetProtectedResourceSession )( + ID3D12GraphicsCommandList8 * This, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BeginRenderPass) + void ( STDMETHODCALLTYPE *BeginRenderPass )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT NumRenderTargets, + _In_reads_opt_(NumRenderTargets) const D3D12_RENDER_PASS_RENDER_TARGET_DESC *pRenderTargets, + _In_opt_ const D3D12_RENDER_PASS_DEPTH_STENCIL_DESC *pDepthStencil, + D3D12_RENDER_PASS_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EndRenderPass) + void ( STDMETHODCALLTYPE *EndRenderPass )( + ID3D12GraphicsCommandList8 * This); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, InitializeMetaCommand) + void ( STDMETHODCALLTYPE *InitializeMetaCommand )( + ID3D12GraphicsCommandList8 * This, + _In_ ID3D12MetaCommand *pMetaCommand, + _In_reads_bytes_opt_(InitializationParametersDataSizeInBytes) const void *pInitializationParametersData, + _In_ SIZE_T InitializationParametersDataSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, ExecuteMetaCommand) + void ( STDMETHODCALLTYPE *ExecuteMetaCommand )( + ID3D12GraphicsCommandList8 * This, + _In_ ID3D12MetaCommand *pMetaCommand, + _In_reads_bytes_opt_(ExecutionParametersDataSizeInBytes) const void *pExecutionParametersData, + _In_ SIZE_T ExecutionParametersDataSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BuildRaytracingAccelerationStructure) + void ( STDMETHODCALLTYPE *BuildRaytracingAccelerationStructure )( + ID3D12GraphicsCommandList8 * This, + _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC *pDesc, + _In_ UINT NumPostbuildInfoDescs, + _In_reads_opt_(NumPostbuildInfoDescs) const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pPostbuildInfoDescs); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EmitRaytracingAccelerationStructurePostbuildInfo) + void ( STDMETHODCALLTYPE *EmitRaytracingAccelerationStructurePostbuildInfo )( + ID3D12GraphicsCommandList8 * This, + _In_ const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pDesc, + _In_ UINT NumSourceAccelerationStructures, + _In_reads_( NumSourceAccelerationStructures ) const D3D12_GPU_VIRTUAL_ADDRESS *pSourceAccelerationStructureData); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, CopyRaytracingAccelerationStructure) + void ( STDMETHODCALLTYPE *CopyRaytracingAccelerationStructure )( + ID3D12GraphicsCommandList8 * This, + _In_ D3D12_GPU_VIRTUAL_ADDRESS DestAccelerationStructureData, + _In_ D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData, + _In_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE Mode); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, SetPipelineState1) + void ( STDMETHODCALLTYPE *SetPipelineState1 )( + ID3D12GraphicsCommandList8 * This, + _In_ ID3D12StateObject *pStateObject); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, DispatchRays) + void ( STDMETHODCALLTYPE *DispatchRays )( + ID3D12GraphicsCommandList8 * This, + _In_ const D3D12_DISPATCH_RAYS_DESC *pDesc); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList5, RSSetShadingRate) + void ( STDMETHODCALLTYPE *RSSetShadingRate )( + ID3D12GraphicsCommandList8 * This, + _In_ D3D12_SHADING_RATE baseShadingRate, + _In_reads_opt_(D3D12_RS_SET_SHADING_RATE_COMBINER_COUNT) const D3D12_SHADING_RATE_COMBINER *combiners); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList5, RSSetShadingRateImage) + void ( STDMETHODCALLTYPE *RSSetShadingRateImage )( + ID3D12GraphicsCommandList8 * This, + _In_opt_ ID3D12Resource *shadingRateImage); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList6, DispatchMesh) + void ( STDMETHODCALLTYPE *DispatchMesh )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT ThreadGroupCountX, + _In_ UINT ThreadGroupCountY, + _In_ UINT ThreadGroupCountZ); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList7, Barrier) + void ( STDMETHODCALLTYPE *Barrier )( + ID3D12GraphicsCommandList8 * This, + UINT32 NumBarrierGroups, + _In_reads_(NumBarrierGroups) const D3D12_BARRIER_GROUP *pBarrierGroups); + + DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList8, OMSetFrontAndBackStencilRef) + void ( STDMETHODCALLTYPE *OMSetFrontAndBackStencilRef )( + ID3D12GraphicsCommandList8 * This, + _In_ UINT FrontStencilRef, + _In_ UINT BackStencilRef); + + END_INTERFACE + } ID3D12GraphicsCommandList8Vtbl; + + interface ID3D12GraphicsCommandList8 + { + CONST_VTBL struct ID3D12GraphicsCommandList8Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12GraphicsCommandList8_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12GraphicsCommandList8_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12GraphicsCommandList8_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12GraphicsCommandList8_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12GraphicsCommandList8_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12GraphicsCommandList8_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12GraphicsCommandList8_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12GraphicsCommandList8_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12GraphicsCommandList8_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12GraphicsCommandList8_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12GraphicsCommandList8_Reset(This,pAllocator,pInitialState) \ + ( (This)->lpVtbl -> Reset(This,pAllocator,pInitialState) ) + +#define ID3D12GraphicsCommandList8_ClearState(This,pPipelineState) \ + ( (This)->lpVtbl -> ClearState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList8_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) ) + +#define ID3D12GraphicsCommandList8_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \ + ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) ) + +#define ID3D12GraphicsCommandList8_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ + ( (This)->lpVtbl -> Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) + +#define ID3D12GraphicsCommandList8_CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) \ + ( (This)->lpVtbl -> CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) ) + +#define ID3D12GraphicsCommandList8_CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) \ + ( (This)->lpVtbl -> CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) ) + +#define ID3D12GraphicsCommandList8_CopyResource(This,pDstResource,pSrcResource) \ + ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) ) + +#define ID3D12GraphicsCommandList8_CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) \ + ( (This)->lpVtbl -> CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) ) + +#define ID3D12GraphicsCommandList8_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \ + ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) ) + +#define ID3D12GraphicsCommandList8_IASetPrimitiveTopology(This,PrimitiveTopology) \ + ( (This)->lpVtbl -> IASetPrimitiveTopology(This,PrimitiveTopology) ) + +#define ID3D12GraphicsCommandList8_RSSetViewports(This,NumViewports,pViewports) \ + ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) ) + +#define ID3D12GraphicsCommandList8_RSSetScissorRects(This,NumRects,pRects) \ + ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList8_OMSetBlendFactor(This,BlendFactor) \ + ( (This)->lpVtbl -> OMSetBlendFactor(This,BlendFactor) ) + +#define ID3D12GraphicsCommandList8_OMSetStencilRef(This,StencilRef) \ + ( (This)->lpVtbl -> OMSetStencilRef(This,StencilRef) ) + +#define ID3D12GraphicsCommandList8_SetPipelineState(This,pPipelineState) \ + ( (This)->lpVtbl -> SetPipelineState(This,pPipelineState) ) + +#define ID3D12GraphicsCommandList8_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12GraphicsCommandList8_ExecuteBundle(This,pCommandList) \ + ( (This)->lpVtbl -> ExecuteBundle(This,pCommandList) ) + +#define ID3D12GraphicsCommandList8_SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) \ + ( (This)->lpVtbl -> SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) ) + +#define ID3D12GraphicsCommandList8_SetComputeRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetComputeRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList8_SetGraphicsRootSignature(This,pRootSignature) \ + ( (This)->lpVtbl -> SetGraphicsRootSignature(This,pRootSignature) ) + +#define ID3D12GraphicsCommandList8_SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList8_SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \ + ( (This)->lpVtbl -> SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) ) + +#define ID3D12GraphicsCommandList8_SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList8_SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList8_SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList8_SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \ + ( (This)->lpVtbl -> SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) ) + +#define ID3D12GraphicsCommandList8_SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList8_SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList8_SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList8_SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList8_SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList8_SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \ + ( (This)->lpVtbl -> SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) ) + +#define ID3D12GraphicsCommandList8_IASetIndexBuffer(This,pView) \ + ( (This)->lpVtbl -> IASetIndexBuffer(This,pView) ) + +#define ID3D12GraphicsCommandList8_IASetVertexBuffers(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumViews,pViews) ) + +#define ID3D12GraphicsCommandList8_SOSetTargets(This,StartSlot,NumViews,pViews) \ + ( (This)->lpVtbl -> SOSetTargets(This,StartSlot,NumViews,pViews) ) + +#define ID3D12GraphicsCommandList8_OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) \ + ( (This)->lpVtbl -> OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) ) + +#define ID3D12GraphicsCommandList8_ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList8_ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList8_ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList8_ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \ + ( (This)->lpVtbl -> ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) ) + +#define ID3D12GraphicsCommandList8_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12GraphicsCommandList8_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12GraphicsCommandList8_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12GraphicsCommandList8_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12GraphicsCommandList8_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12GraphicsCommandList8_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12GraphicsCommandList8_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12GraphicsCommandList8_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12GraphicsCommandList8_ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) \ + ( (This)->lpVtbl -> ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) ) + + +#define ID3D12GraphicsCommandList8_AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ + ( (This)->lpVtbl -> AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) + +#define ID3D12GraphicsCommandList8_AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \ + ( (This)->lpVtbl -> AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) ) + +#define ID3D12GraphicsCommandList8_OMSetDepthBounds(This,Min,Max) \ + ( (This)->lpVtbl -> OMSetDepthBounds(This,Min,Max) ) + +#define ID3D12GraphicsCommandList8_SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) \ + ( (This)->lpVtbl -> SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) ) + +#define ID3D12GraphicsCommandList8_ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) \ + ( (This)->lpVtbl -> ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) ) + +#define ID3D12GraphicsCommandList8_SetViewInstanceMask(This,Mask) \ + ( (This)->lpVtbl -> SetViewInstanceMask(This,Mask) ) + + +#define ID3D12GraphicsCommandList8_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) + + +#define ID3D12GraphicsCommandList8_SetProtectedResourceSession(This,pProtectedResourceSession) \ + ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) ) + + +#define ID3D12GraphicsCommandList8_BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) \ + ( (This)->lpVtbl -> BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) ) + +#define ID3D12GraphicsCommandList8_EndRenderPass(This) \ + ( (This)->lpVtbl -> EndRenderPass(This) ) + +#define ID3D12GraphicsCommandList8_InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) \ + ( (This)->lpVtbl -> InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) ) + +#define ID3D12GraphicsCommandList8_ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) \ + ( (This)->lpVtbl -> ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) ) + +#define ID3D12GraphicsCommandList8_BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) \ + ( (This)->lpVtbl -> BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) ) + +#define ID3D12GraphicsCommandList8_EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) \ + ( (This)->lpVtbl -> EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) ) + +#define ID3D12GraphicsCommandList8_CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) \ + ( (This)->lpVtbl -> CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) ) + +#define ID3D12GraphicsCommandList8_SetPipelineState1(This,pStateObject) \ + ( (This)->lpVtbl -> SetPipelineState1(This,pStateObject) ) + +#define ID3D12GraphicsCommandList8_DispatchRays(This,pDesc) \ + ( (This)->lpVtbl -> DispatchRays(This,pDesc) ) + + +#define ID3D12GraphicsCommandList8_RSSetShadingRate(This,baseShadingRate,combiners) \ + ( (This)->lpVtbl -> RSSetShadingRate(This,baseShadingRate,combiners) ) + +#define ID3D12GraphicsCommandList8_RSSetShadingRateImage(This,shadingRateImage) \ + ( (This)->lpVtbl -> RSSetShadingRateImage(This,shadingRateImage) ) + + +#define ID3D12GraphicsCommandList8_DispatchMesh(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \ + ( (This)->lpVtbl -> DispatchMesh(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) ) + + +#define ID3D12GraphicsCommandList8_Barrier(This,NumBarrierGroups,pBarrierGroups) \ + ( (This)->lpVtbl -> Barrier(This,NumBarrierGroups,pBarrierGroups) ) + + +#define ID3D12GraphicsCommandList8_OMSetFrontAndBackStencilRef(This,FrontStencilRef,BackStencilRef) \ + ( (This)->lpVtbl -> OMSetFrontAndBackStencilRef(This,FrontStencilRef,BackStencilRef) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12GraphicsCommandList8_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12_0000_0065 */ +/* [local] */ + +#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES) */ +#pragma endregion +DEFINE_GUID(IID_ID3D12Object,0xc4fec28f,0x7966,0x4e95,0x9f,0x94,0xf4,0x31,0xcb,0x56,0xc3,0xb8); +DEFINE_GUID(IID_ID3D12DeviceChild,0x905db94b,0xa00c,0x4140,0x9d,0xf5,0x2b,0x64,0xca,0x9e,0xa3,0x57); +DEFINE_GUID(IID_ID3D12RootSignature,0xc54a6b66,0x72df,0x4ee8,0x8b,0xe5,0xa9,0x46,0xa1,0x42,0x92,0x14); +DEFINE_GUID(IID_ID3D12RootSignatureDeserializer,0x34AB647B,0x3CC8,0x46AC,0x84,0x1B,0xC0,0x96,0x56,0x45,0xC0,0x46); +DEFINE_GUID(IID_ID3D12VersionedRootSignatureDeserializer,0x7F91CE67,0x090C,0x4BB7,0xB7,0x8E,0xED,0x8F,0xF2,0xE3,0x1D,0xA0); +DEFINE_GUID(IID_ID3D12Pageable,0x63ee58fb,0x1268,0x4835,0x86,0xda,0xf0,0x08,0xce,0x62,0xf0,0xd6); +DEFINE_GUID(IID_ID3D12Heap,0x6b3b2502,0x6e51,0x45b3,0x90,0xee,0x98,0x84,0x26,0x5e,0x8d,0xf3); +DEFINE_GUID(IID_ID3D12Resource,0x696442be,0xa72e,0x4059,0xbc,0x79,0x5b,0x5c,0x98,0x04,0x0f,0xad); +DEFINE_GUID(IID_ID3D12CommandAllocator,0x6102dee4,0xaf59,0x4b09,0xb9,0x99,0xb4,0x4d,0x73,0xf0,0x9b,0x24); +DEFINE_GUID(IID_ID3D12Fence,0x0a753dcf,0xc4d8,0x4b91,0xad,0xf6,0xbe,0x5a,0x60,0xd9,0x5a,0x76); +DEFINE_GUID(IID_ID3D12Fence1,0x433685fe,0xe22b,0x4ca0,0xa8,0xdb,0xb5,0xb4,0xf4,0xdd,0x0e,0x4a); +DEFINE_GUID(IID_ID3D12PipelineState,0x765a30f3,0xf624,0x4c6f,0xa8,0x28,0xac,0xe9,0x48,0x62,0x24,0x45); +DEFINE_GUID(IID_ID3D12DescriptorHeap,0x8efb471d,0x616c,0x4f49,0x90,0xf7,0x12,0x7b,0xb7,0x63,0xfa,0x51); +DEFINE_GUID(IID_ID3D12QueryHeap,0x0d9658ae,0xed45,0x469e,0xa6,0x1d,0x97,0x0e,0xc5,0x83,0xca,0xb4); +DEFINE_GUID(IID_ID3D12CommandSignature,0xc36a797c,0xec80,0x4f0a,0x89,0x85,0xa7,0xb2,0x47,0x50,0x82,0xd1); +DEFINE_GUID(IID_ID3D12CommandList,0x7116d91c,0xe7e4,0x47ce,0xb8,0xc6,0xec,0x81,0x68,0xf4,0x37,0xe5); +DEFINE_GUID(IID_ID3D12GraphicsCommandList,0x5b160d0f,0xac1b,0x4185,0x8b,0xa8,0xb3,0xae,0x42,0xa5,0xa4,0x55); +DEFINE_GUID(IID_ID3D12GraphicsCommandList1,0x553103fb,0x1fe7,0x4557,0xbb,0x38,0x94,0x6d,0x7d,0x0e,0x7c,0xa7); +DEFINE_GUID(IID_ID3D12GraphicsCommandList2,0x38C3E585,0xFF17,0x412C,0x91,0x50,0x4F,0xC6,0xF9,0xD7,0x2A,0x28); +DEFINE_GUID(IID_ID3D12CommandQueue,0x0ec870a6,0x5d7e,0x4c22,0x8c,0xfc,0x5b,0xaa,0xe0,0x76,0x16,0xed); +DEFINE_GUID(IID_ID3D12Device,0x189819f1,0x1db6,0x4b57,0xbe,0x54,0x18,0x21,0x33,0x9b,0x85,0xf7); +DEFINE_GUID(IID_ID3D12PipelineLibrary,0xc64226a8,0x9201,0x46af,0xb4,0xcc,0x53,0xfb,0x9f,0xf7,0x41,0x4f); +DEFINE_GUID(IID_ID3D12PipelineLibrary1,0x80eabf42,0x2568,0x4e5e,0xbd,0x82,0xc3,0x7f,0x86,0x96,0x1d,0xc3); +DEFINE_GUID(IID_ID3D12Device1,0x77acce80,0x638e,0x4e65,0x88,0x95,0xc1,0xf2,0x33,0x86,0x86,0x3e); +DEFINE_GUID(IID_ID3D12Device2,0x30baa41e,0xb15b,0x475c,0xa0,0xbb,0x1a,0xf5,0xc5,0xb6,0x43,0x28); +DEFINE_GUID(IID_ID3D12Device3,0x81dadc15,0x2bad,0x4392,0x93,0xc5,0x10,0x13,0x45,0xc4,0xaa,0x98); +DEFINE_GUID(IID_ID3D12ProtectedSession,0xA1533D18,0x0AC1,0x4084,0x85,0xB9,0x89,0xA9,0x61,0x16,0x80,0x6B); +DEFINE_GUID(IID_ID3D12ProtectedResourceSession,0x6CD696F4,0xF289,0x40CC,0x80,0x91,0x5A,0x6C,0x0A,0x09,0x9C,0x3D); +DEFINE_GUID(IID_ID3D12Device4,0xe865df17,0xa9ee,0x46f9,0xa4,0x63,0x30,0x98,0x31,0x5a,0xa2,0xe5); +DEFINE_GUID(IID_ID3D12LifetimeOwner,0xe667af9f,0xcd56,0x4f46,0x83,0xce,0x03,0x2e,0x59,0x5d,0x70,0xa8); +DEFINE_GUID(IID_ID3D12SwapChainAssistant,0xf1df64b6,0x57fd,0x49cd,0x88,0x07,0xc0,0xeb,0x88,0xb4,0x5c,0x8f); +DEFINE_GUID(IID_ID3D12LifetimeTracker,0x3fd03d36,0x4eb1,0x424a,0xa5,0x82,0x49,0x4e,0xcb,0x8b,0xa8,0x13); +DEFINE_GUID(IID_ID3D12StateObject,0x47016943,0xfca8,0x4594,0x93,0xea,0xaf,0x25,0x8b,0x55,0x34,0x6d); +DEFINE_GUID(IID_ID3D12StateObjectProperties,0xde5fa827,0x9bf9,0x4f26,0x89,0xff,0xd7,0xf5,0x6f,0xde,0x38,0x60); +DEFINE_GUID(IID_ID3D12Device5,0x8b4f173b,0x2fea,0x4b80,0x8f,0x58,0x43,0x07,0x19,0x1a,0xb9,0x5d); +DEFINE_GUID(IID_ID3D12DeviceRemovedExtendedDataSettings,0x82BC481C,0x6B9B,0x4030,0xAE,0xDB,0x7E,0xE3,0xD1,0xDF,0x1E,0x63); +DEFINE_GUID(IID_ID3D12DeviceRemovedExtendedDataSettings1,0xDBD5AE51,0x3317,0x4F0A,0xAD,0xF9,0x1D,0x7C,0xED,0xCA,0xAE,0x0B); +DEFINE_GUID(IID_ID3D12DeviceRemovedExtendedDataSettings2,0x61552388,0x01ab,0x4008,0xa4,0x36,0x83,0xdb,0x18,0x95,0x66,0xea); +DEFINE_GUID(IID_ID3D12DeviceRemovedExtendedData,0x98931D33,0x5AE8,0x4791,0xAA,0x3C,0x1A,0x73,0xA2,0x93,0x4E,0x71); +DEFINE_GUID(IID_ID3D12DeviceRemovedExtendedData1,0x9727A022,0xCF1D,0x4DDA,0x9E,0xBA,0xEF,0xFA,0x65,0x3F,0xC5,0x06); +DEFINE_GUID(IID_ID3D12DeviceRemovedExtendedData2,0x67FC5816,0xE4CA,0x4915,0xBF,0x18,0x42,0x54,0x12,0x72,0xDA,0x54); +DEFINE_GUID(IID_ID3D12Device6,0xc70b221b,0x40e4,0x4a17,0x89,0xaf,0x02,0x5a,0x07,0x27,0xa6,0xdc); +DEFINE_GUID(IID_ID3D12ProtectedResourceSession1,0xD6F12DD6,0x76FB,0x406E,0x89,0x61,0x42,0x96,0xEE,0xFC,0x04,0x09); +DEFINE_GUID(IID_ID3D12Device7,0x5c014b53,0x68a1,0x4b9b,0x8b,0xd1,0xdd,0x60,0x46,0xb9,0x35,0x8b); +DEFINE_GUID(IID_ID3D12Device8,0x9218E6BB,0xF944,0x4F7E,0xA7,0x5C,0xB1,0xB2,0xC7,0xB7,0x01,0xF3); +DEFINE_GUID(IID_ID3D12Resource1,0x9D5E227A,0x4430,0x4161,0x88,0xB3,0x3E,0xCA,0x6B,0xB1,0x6E,0x19); +DEFINE_GUID(IID_ID3D12Resource2,0xBE36EC3B,0xEA85,0x4AEB,0xA4,0x5A,0xE9,0xD7,0x64,0x04,0xA4,0x95); +DEFINE_GUID(IID_ID3D12Heap1,0x572F7389,0x2168,0x49E3,0x96,0x93,0xD6,0xDF,0x58,0x71,0xBF,0x6D); +DEFINE_GUID(IID_ID3D12GraphicsCommandList3,0x6FDA83A7,0xB84C,0x4E38,0x9A,0xC8,0xC7,0xBD,0x22,0x01,0x6B,0x3D); +DEFINE_GUID(IID_ID3D12MetaCommand,0xDBB84C27,0x36CE,0x4FC9,0xB8,0x01,0xF0,0x48,0xC4,0x6A,0xC5,0x70); +DEFINE_GUID(IID_ID3D12GraphicsCommandList4,0x8754318e,0xd3a9,0x4541,0x98,0xcf,0x64,0x5b,0x50,0xdc,0x48,0x74); +DEFINE_GUID(IID_ID3D12ShaderCacheSession,0x28e2495d,0x0f64,0x4ae4,0xa6,0xec,0x12,0x92,0x55,0xdc,0x49,0xa8); +DEFINE_GUID(IID_ID3D12Device9,0x4c80e962,0xf032,0x4f60,0xbc,0x9e,0xeb,0xc2,0xcf,0xa1,0xd8,0x3c); +DEFINE_GUID(IID_ID3D12Device10,0x517f8718,0xaa66,0x49f9,0xb0,0x2b,0xa7,0xab,0x89,0xc0,0x60,0x31); +DEFINE_GUID(IID_ID3D12Device11,0x5405c344,0xd457,0x444e,0xb4,0xdd,0x23,0x66,0xe4,0x5a,0xee,0x39); +DEFINE_GUID(IID_ID3D12VirtualizationGuestDevice,0xbc66d368,0x7373,0x4943,0x87,0x57,0xfc,0x87,0xdc,0x79,0xe4,0x76); +DEFINE_GUID(IID_ID3D12Tools,0x7071e1f0,0xe84b,0x4b33,0x97,0x4f,0x12,0xfa,0x49,0xde,0x65,0xc5); +DEFINE_GUID(IID_ID3D12SDKConfiguration,0xe9eb5314,0x33aa,0x42b2,0xa7,0x18,0xd7,0x7f,0x58,0xb1,0xf1,0xc7); +DEFINE_GUID(IID_ID3D12SDKConfiguration1,0x8aaf9303,0xad25,0x48b9,0x9a,0x57,0xd9,0xc3,0x7e,0x00,0x9d,0x9f); +DEFINE_GUID(IID_ID3D12DeviceFactory,0x61f307d3,0xd34e,0x4e7c,0x83,0x74,0x3b,0xa4,0xde,0x23,0xcc,0xcb); +DEFINE_GUID(IID_ID3D12DeviceConfiguration,0x78dbf87b,0xf766,0x422b,0xa6,0x1c,0xc8,0xc4,0x46,0xbd,0xb9,0xad); +DEFINE_GUID(IID_ID3D12GraphicsCommandList5,0x55050859,0x4024,0x474c,0x87,0xf5,0x64,0x72,0xea,0xee,0x44,0xea); +DEFINE_GUID(IID_ID3D12GraphicsCommandList6,0xc3827890,0xe548,0x4cfa,0x96,0xcf,0x56,0x89,0xa9,0x37,0x0f,0x80); +DEFINE_GUID(IID_ID3D12GraphicsCommandList7,0xdd171223,0x8b61,0x4769,0x90,0xe3,0x16,0x0c,0xcd,0xe4,0xe2,0xc1); +DEFINE_GUID(IID_ID3D12GraphicsCommandList8,0xee936ef9,0x599d,0x4d28,0x93,0x8e,0x23,0xc4,0xad,0x05,0xce,0x51); + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0065_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0065_v0_0_s_ifspec; + +/* Additional Prototypes for ALL interfaces */ + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/thirdparty/directx_headers/d3d12compatibility.h b/thirdparty/directx_headers/d3d12compatibility.h new file mode 100644 index 0000000000..1a9430e5c9 --- /dev/null +++ b/thirdparty/directx_headers/d3d12compatibility.h @@ -0,0 +1,739 @@ +/*------------------------------------------------------------------------------------- + * + * Copyright (c) Microsoft Corporation + * Licensed under the MIT license + * + *-------------------------------------------------------------------------------------*/ + + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 8.01.0628 */ + + + +/* verify that the <rpcndr.h> version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 500 +#endif + +/* verify that the <rpcsal.h> version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCSAL_H_VERSION__ +#define __REQUIRED_RPCSAL_H_VERSION__ 100 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of <rpcndr.h> +#endif /* __RPCNDR_H_VERSION__ */ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __d3d12compatibility_h__ +#define __d3d12compatibility_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +#ifndef DECLSPEC_XFGVIRT +#if defined(_CONTROL_FLOW_GUARD_XFG) +#define DECLSPEC_XFGVIRT(base, func) __declspec(xfg_virtual(base, func)) +#else +#define DECLSPEC_XFGVIRT(base, func) +#endif +#endif + +/* Forward Declarations */ + +#ifndef __ID3D12CompatibilityDevice_FWD_DEFINED__ +#define __ID3D12CompatibilityDevice_FWD_DEFINED__ +typedef interface ID3D12CompatibilityDevice ID3D12CompatibilityDevice; + +#endif /* __ID3D12CompatibilityDevice_FWD_DEFINED__ */ + + +#ifndef __D3D11On12CreatorID_FWD_DEFINED__ +#define __D3D11On12CreatorID_FWD_DEFINED__ +typedef interface D3D11On12CreatorID D3D11On12CreatorID; + +#endif /* __D3D11On12CreatorID_FWD_DEFINED__ */ + + +#ifndef __D3D9On12CreatorID_FWD_DEFINED__ +#define __D3D9On12CreatorID_FWD_DEFINED__ +typedef interface D3D9On12CreatorID D3D9On12CreatorID; + +#endif /* __D3D9On12CreatorID_FWD_DEFINED__ */ + + +#ifndef __OpenGLOn12CreatorID_FWD_DEFINED__ +#define __OpenGLOn12CreatorID_FWD_DEFINED__ +typedef interface OpenGLOn12CreatorID OpenGLOn12CreatorID; + +#endif /* __OpenGLOn12CreatorID_FWD_DEFINED__ */ + + +#ifndef __OpenCLOn12CreatorID_FWD_DEFINED__ +#define __OpenCLOn12CreatorID_FWD_DEFINED__ +typedef interface OpenCLOn12CreatorID OpenCLOn12CreatorID; + +#endif /* __OpenCLOn12CreatorID_FWD_DEFINED__ */ + + +#ifndef __DirectMLTensorFlowCreatorID_FWD_DEFINED__ +#define __DirectMLTensorFlowCreatorID_FWD_DEFINED__ +typedef interface DirectMLTensorFlowCreatorID DirectMLTensorFlowCreatorID; + +#endif /* __DirectMLTensorFlowCreatorID_FWD_DEFINED__ */ + + +#ifndef __DirectMLPyTorchCreatorID_FWD_DEFINED__ +#define __DirectMLPyTorchCreatorID_FWD_DEFINED__ +typedef interface DirectMLPyTorchCreatorID DirectMLPyTorchCreatorID; + +#endif /* __DirectMLPyTorchCreatorID_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "oaidl.h" +#include "ocidl.h" +#include "d3d11on12.h" + +#ifdef __cplusplus +extern "C"{ +#endif + + +/* interface __MIDL_itf_d3d12compatibility_0000_0000 */ +/* [local] */ + +#include <winapifamily.h> +#pragma region Desktop Family +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES) +typedef +enum D3D12_COMPATIBILITY_SHARED_FLAGS + { + D3D12_COMPATIBILITY_SHARED_FLAG_NONE = 0, + D3D12_COMPATIBILITY_SHARED_FLAG_NON_NT_HANDLE = 0x1, + D3D12_COMPATIBILITY_SHARED_FLAG_KEYED_MUTEX = 0x2, + D3D12_COMPATIBILITY_SHARED_FLAG_9_ON_12 = 0x4 + } D3D12_COMPATIBILITY_SHARED_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMPATIBILITY_SHARED_FLAGS ); +typedef +enum D3D12_REFLECT_SHARED_PROPERTY + { + D3D12_REFLECT_SHARED_PROPERTY_D3D11_RESOURCE_FLAGS = 0, + D3D12_REFELCT_SHARED_PROPERTY_COMPATIBILITY_SHARED_FLAGS = ( D3D12_REFLECT_SHARED_PROPERTY_D3D11_RESOURCE_FLAGS + 1 ) , + D3D12_REFLECT_SHARED_PROPERTY_NON_NT_SHARED_HANDLE = ( D3D12_REFELCT_SHARED_PROPERTY_COMPATIBILITY_SHARED_FLAGS + 1 ) + } D3D12_REFLECT_SHARED_PROPERTY; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12compatibility_0000_0000_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12compatibility_0000_0000_v0_0_s_ifspec; + +#ifndef __ID3D12CompatibilityDevice_INTERFACE_DEFINED__ +#define __ID3D12CompatibilityDevice_INTERFACE_DEFINED__ + +/* interface ID3D12CompatibilityDevice */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12CompatibilityDevice; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("8f1c0e3c-fae3-4a82-b098-bfe1708207ff") + ID3D12CompatibilityDevice : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE CreateSharedResource( + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ const D3D11_RESOURCE_FLAGS *pFlags11, + D3D12_COMPATIBILITY_SHARED_FLAGS CompatibilityFlags, + _In_opt_ ID3D12LifetimeTracker *pLifetimeTracker, + _In_opt_ ID3D12SwapChainAssistant *pOwningSwapchain, + REFIID riid, + _COM_Outptr_opt_ void **ppResource) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateSharedHeap( + _In_ const D3D12_HEAP_DESC *pHeapDesc, + D3D12_COMPATIBILITY_SHARED_FLAGS CompatibilityFlags, + REFIID riid, + _COM_Outptr_opt_ void **ppHeap) = 0; + + virtual HRESULT STDMETHODCALLTYPE ReflectSharedProperties( + _In_ ID3D12Object *pHeapOrResource, + D3D12_REFLECT_SHARED_PROPERTY ReflectType, + _Out_writes_bytes_(DataSize) void *pData, + UINT DataSize) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12CompatibilityDeviceVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12CompatibilityDevice * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12CompatibilityDevice * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12CompatibilityDevice * This); + + DECLSPEC_XFGVIRT(ID3D12CompatibilityDevice, CreateSharedResource) + HRESULT ( STDMETHODCALLTYPE *CreateSharedResource )( + ID3D12CompatibilityDevice * This, + _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties, + D3D12_HEAP_FLAGS HeapFlags, + _In_ const D3D12_RESOURCE_DESC *pDesc, + D3D12_RESOURCE_STATES InitialResourceState, + _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue, + _In_opt_ const D3D11_RESOURCE_FLAGS *pFlags11, + D3D12_COMPATIBILITY_SHARED_FLAGS CompatibilityFlags, + _In_opt_ ID3D12LifetimeTracker *pLifetimeTracker, + _In_opt_ ID3D12SwapChainAssistant *pOwningSwapchain, + REFIID riid, + _COM_Outptr_opt_ void **ppResource); + + DECLSPEC_XFGVIRT(ID3D12CompatibilityDevice, CreateSharedHeap) + HRESULT ( STDMETHODCALLTYPE *CreateSharedHeap )( + ID3D12CompatibilityDevice * This, + _In_ const D3D12_HEAP_DESC *pHeapDesc, + D3D12_COMPATIBILITY_SHARED_FLAGS CompatibilityFlags, + REFIID riid, + _COM_Outptr_opt_ void **ppHeap); + + DECLSPEC_XFGVIRT(ID3D12CompatibilityDevice, ReflectSharedProperties) + HRESULT ( STDMETHODCALLTYPE *ReflectSharedProperties )( + ID3D12CompatibilityDevice * This, + _In_ ID3D12Object *pHeapOrResource, + D3D12_REFLECT_SHARED_PROPERTY ReflectType, + _Out_writes_bytes_(DataSize) void *pData, + UINT DataSize); + + END_INTERFACE + } ID3D12CompatibilityDeviceVtbl; + + interface ID3D12CompatibilityDevice + { + CONST_VTBL struct ID3D12CompatibilityDeviceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12CompatibilityDevice_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12CompatibilityDevice_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12CompatibilityDevice_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12CompatibilityDevice_CreateSharedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pFlags11,CompatibilityFlags,pLifetimeTracker,pOwningSwapchain,riid,ppResource) \ + ( (This)->lpVtbl -> CreateSharedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pFlags11,CompatibilityFlags,pLifetimeTracker,pOwningSwapchain,riid,ppResource) ) + +#define ID3D12CompatibilityDevice_CreateSharedHeap(This,pHeapDesc,CompatibilityFlags,riid,ppHeap) \ + ( (This)->lpVtbl -> CreateSharedHeap(This,pHeapDesc,CompatibilityFlags,riid,ppHeap) ) + +#define ID3D12CompatibilityDevice_ReflectSharedProperties(This,pHeapOrResource,ReflectType,pData,DataSize) \ + ( (This)->lpVtbl -> ReflectSharedProperties(This,pHeapOrResource,ReflectType,pData,DataSize) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12CompatibilityDevice_INTERFACE_DEFINED__ */ + + +#ifndef __D3D11On12CreatorID_INTERFACE_DEFINED__ +#define __D3D11On12CreatorID_INTERFACE_DEFINED__ + +/* interface D3D11On12CreatorID */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_D3D11On12CreatorID; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("edbf5678-2960-4e81-8429-99d4b2630c4e") + D3D11On12CreatorID : public IUnknown + { + public: + }; + + +#else /* C style interface */ + + typedef struct D3D11On12CreatorIDVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + D3D11On12CreatorID * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + D3D11On12CreatorID * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + D3D11On12CreatorID * This); + + END_INTERFACE + } D3D11On12CreatorIDVtbl; + + interface D3D11On12CreatorID + { + CONST_VTBL struct D3D11On12CreatorIDVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define D3D11On12CreatorID_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define D3D11On12CreatorID_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define D3D11On12CreatorID_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __D3D11On12CreatorID_INTERFACE_DEFINED__ */ + + +#ifndef __D3D9On12CreatorID_INTERFACE_DEFINED__ +#define __D3D9On12CreatorID_INTERFACE_DEFINED__ + +/* interface D3D9On12CreatorID */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_D3D9On12CreatorID; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("fffcbb7f-15d3-42a2-841e-9d8d32f37ddd") + D3D9On12CreatorID : public IUnknown + { + public: + }; + + +#else /* C style interface */ + + typedef struct D3D9On12CreatorIDVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + D3D9On12CreatorID * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + D3D9On12CreatorID * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + D3D9On12CreatorID * This); + + END_INTERFACE + } D3D9On12CreatorIDVtbl; + + interface D3D9On12CreatorID + { + CONST_VTBL struct D3D9On12CreatorIDVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define D3D9On12CreatorID_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define D3D9On12CreatorID_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define D3D9On12CreatorID_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __D3D9On12CreatorID_INTERFACE_DEFINED__ */ + + +#ifndef __OpenGLOn12CreatorID_INTERFACE_DEFINED__ +#define __OpenGLOn12CreatorID_INTERFACE_DEFINED__ + +/* interface OpenGLOn12CreatorID */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_OpenGLOn12CreatorID; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("6bb3cd34-0d19-45ab-97ed-d720ba3dfc80") + OpenGLOn12CreatorID : public IUnknown + { + public: + }; + + +#else /* C style interface */ + + typedef struct OpenGLOn12CreatorIDVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + OpenGLOn12CreatorID * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + OpenGLOn12CreatorID * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + OpenGLOn12CreatorID * This); + + END_INTERFACE + } OpenGLOn12CreatorIDVtbl; + + interface OpenGLOn12CreatorID + { + CONST_VTBL struct OpenGLOn12CreatorIDVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define OpenGLOn12CreatorID_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define OpenGLOn12CreatorID_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define OpenGLOn12CreatorID_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __OpenGLOn12CreatorID_INTERFACE_DEFINED__ */ + + +#ifndef __OpenCLOn12CreatorID_INTERFACE_DEFINED__ +#define __OpenCLOn12CreatorID_INTERFACE_DEFINED__ + +/* interface OpenCLOn12CreatorID */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_OpenCLOn12CreatorID; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("3f76bb74-91b5-4a88-b126-20ca0331cd60") + OpenCLOn12CreatorID : public IUnknown + { + public: + }; + + +#else /* C style interface */ + + typedef struct OpenCLOn12CreatorIDVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + OpenCLOn12CreatorID * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + OpenCLOn12CreatorID * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + OpenCLOn12CreatorID * This); + + END_INTERFACE + } OpenCLOn12CreatorIDVtbl; + + interface OpenCLOn12CreatorID + { + CONST_VTBL struct OpenCLOn12CreatorIDVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define OpenCLOn12CreatorID_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define OpenCLOn12CreatorID_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define OpenCLOn12CreatorID_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __OpenCLOn12CreatorID_INTERFACE_DEFINED__ */ + + +#ifndef __DirectMLTensorFlowCreatorID_INTERFACE_DEFINED__ +#define __DirectMLTensorFlowCreatorID_INTERFACE_DEFINED__ + +/* interface DirectMLTensorFlowCreatorID */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_DirectMLTensorFlowCreatorID; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("cb7490ac-8a0f-44ec-9b7b-6f4cafe8e9ab") + DirectMLTensorFlowCreatorID : public IUnknown + { + public: + }; + + +#else /* C style interface */ + + typedef struct DirectMLTensorFlowCreatorIDVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + DirectMLTensorFlowCreatorID * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + DirectMLTensorFlowCreatorID * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + DirectMLTensorFlowCreatorID * This); + + END_INTERFACE + } DirectMLTensorFlowCreatorIDVtbl; + + interface DirectMLTensorFlowCreatorID + { + CONST_VTBL struct DirectMLTensorFlowCreatorIDVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define DirectMLTensorFlowCreatorID_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define DirectMLTensorFlowCreatorID_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define DirectMLTensorFlowCreatorID_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __DirectMLTensorFlowCreatorID_INTERFACE_DEFINED__ */ + + +#ifndef __DirectMLPyTorchCreatorID_INTERFACE_DEFINED__ +#define __DirectMLPyTorchCreatorID_INTERFACE_DEFINED__ + +/* interface DirectMLPyTorchCreatorID */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_DirectMLPyTorchCreatorID; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("af029192-fba1-4b05-9116-235e06560354") + DirectMLPyTorchCreatorID : public IUnknown + { + public: + }; + + +#else /* C style interface */ + + typedef struct DirectMLPyTorchCreatorIDVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + DirectMLPyTorchCreatorID * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + DirectMLPyTorchCreatorID * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + DirectMLPyTorchCreatorID * This); + + END_INTERFACE + } DirectMLPyTorchCreatorIDVtbl; + + interface DirectMLPyTorchCreatorID + { + CONST_VTBL struct DirectMLPyTorchCreatorIDVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define DirectMLPyTorchCreatorID_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define DirectMLPyTorchCreatorID_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define DirectMLPyTorchCreatorID_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __DirectMLPyTorchCreatorID_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12compatibility_0000_0007 */ +/* [local] */ + +#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES) */ +#pragma endregion +DEFINE_GUID(IID_ID3D12CompatibilityDevice,0x8f1c0e3c,0xfae3,0x4a82,0xb0,0x98,0xbf,0xe1,0x70,0x82,0x07,0xff); +DEFINE_GUID(IID_D3D11On12CreatorID,0xedbf5678,0x2960,0x4e81,0x84,0x29,0x99,0xd4,0xb2,0x63,0x0c,0x4e); +DEFINE_GUID(IID_D3D9On12CreatorID,0xfffcbb7f,0x15d3,0x42a2,0x84,0x1e,0x9d,0x8d,0x32,0xf3,0x7d,0xdd); +DEFINE_GUID(IID_OpenGLOn12CreatorID,0x6bb3cd34,0x0d19,0x45ab,0x97,0xed,0xd7,0x20,0xba,0x3d,0xfc,0x80); +DEFINE_GUID(IID_OpenCLOn12CreatorID,0x3f76bb74,0x91b5,0x4a88,0xb1,0x26,0x20,0xca,0x03,0x31,0xcd,0x60); +DEFINE_GUID(IID_DirectMLTensorFlowCreatorID,0xcb7490ac,0x8a0f,0x44ec,0x9b,0x7b,0x6f,0x4c,0xaf,0xe8,0xe9,0xab); +DEFINE_GUID(IID_DirectMLPyTorchCreatorID,0xaf029192,0xfba1,0x4b05,0x91,0x16,0x23,0x5e,0x06,0x56,0x03,0x54); + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12compatibility_0000_0007_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12compatibility_0000_0007_v0_0_s_ifspec; + +/* Additional Prototypes for ALL interfaces */ + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/thirdparty/directx_headers/d3d12sdklayers.h b/thirdparty/directx_headers/d3d12sdklayers.h new file mode 100644 index 0000000000..b25a8f6e5d --- /dev/null +++ b/thirdparty/directx_headers/d3d12sdklayers.h @@ -0,0 +1,4110 @@ +/*------------------------------------------------------------------------------------- + * + * Copyright (c) Microsoft Corporation + * Licensed under the MIT license + * + *-------------------------------------------------------------------------------------*/ + + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 8.01.0628 */ + + + +/* verify that the <rpcndr.h> version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 500 +#endif + +/* verify that the <rpcsal.h> version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCSAL_H_VERSION__ +#define __REQUIRED_RPCSAL_H_VERSION__ 100 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of <rpcndr.h> +#endif /* __RPCNDR_H_VERSION__ */ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __d3d12sdklayers_h__ +#define __d3d12sdklayers_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +#ifndef DECLSPEC_XFGVIRT +#if defined(_CONTROL_FLOW_GUARD_XFG) +#define DECLSPEC_XFGVIRT(base, func) __declspec(xfg_virtual(base, func)) +#else +#define DECLSPEC_XFGVIRT(base, func) +#endif +#endif + +/* Forward Declarations */ + +#ifndef __ID3D12Debug_FWD_DEFINED__ +#define __ID3D12Debug_FWD_DEFINED__ +typedef interface ID3D12Debug ID3D12Debug; + +#endif /* __ID3D12Debug_FWD_DEFINED__ */ + + +#ifndef __ID3D12Debug1_FWD_DEFINED__ +#define __ID3D12Debug1_FWD_DEFINED__ +typedef interface ID3D12Debug1 ID3D12Debug1; + +#endif /* __ID3D12Debug1_FWD_DEFINED__ */ + + +#ifndef __ID3D12Debug2_FWD_DEFINED__ +#define __ID3D12Debug2_FWD_DEFINED__ +typedef interface ID3D12Debug2 ID3D12Debug2; + +#endif /* __ID3D12Debug2_FWD_DEFINED__ */ + + +#ifndef __ID3D12Debug3_FWD_DEFINED__ +#define __ID3D12Debug3_FWD_DEFINED__ +typedef interface ID3D12Debug3 ID3D12Debug3; + +#endif /* __ID3D12Debug3_FWD_DEFINED__ */ + + +#ifndef __ID3D12Debug4_FWD_DEFINED__ +#define __ID3D12Debug4_FWD_DEFINED__ +typedef interface ID3D12Debug4 ID3D12Debug4; + +#endif /* __ID3D12Debug4_FWD_DEFINED__ */ + + +#ifndef __ID3D12Debug5_FWD_DEFINED__ +#define __ID3D12Debug5_FWD_DEFINED__ +typedef interface ID3D12Debug5 ID3D12Debug5; + +#endif /* __ID3D12Debug5_FWD_DEFINED__ */ + + +#ifndef __ID3D12Debug6_FWD_DEFINED__ +#define __ID3D12Debug6_FWD_DEFINED__ +typedef interface ID3D12Debug6 ID3D12Debug6; + +#endif /* __ID3D12Debug6_FWD_DEFINED__ */ + + +#ifndef __ID3D12DebugDevice1_FWD_DEFINED__ +#define __ID3D12DebugDevice1_FWD_DEFINED__ +typedef interface ID3D12DebugDevice1 ID3D12DebugDevice1; + +#endif /* __ID3D12DebugDevice1_FWD_DEFINED__ */ + + +#ifndef __ID3D12DebugDevice_FWD_DEFINED__ +#define __ID3D12DebugDevice_FWD_DEFINED__ +typedef interface ID3D12DebugDevice ID3D12DebugDevice; + +#endif /* __ID3D12DebugDevice_FWD_DEFINED__ */ + + +#ifndef __ID3D12DebugDevice2_FWD_DEFINED__ +#define __ID3D12DebugDevice2_FWD_DEFINED__ +typedef interface ID3D12DebugDevice2 ID3D12DebugDevice2; + +#endif /* __ID3D12DebugDevice2_FWD_DEFINED__ */ + + +#ifndef __ID3D12DebugCommandQueue_FWD_DEFINED__ +#define __ID3D12DebugCommandQueue_FWD_DEFINED__ +typedef interface ID3D12DebugCommandQueue ID3D12DebugCommandQueue; + +#endif /* __ID3D12DebugCommandQueue_FWD_DEFINED__ */ + + +#ifndef __ID3D12DebugCommandQueue1_FWD_DEFINED__ +#define __ID3D12DebugCommandQueue1_FWD_DEFINED__ +typedef interface ID3D12DebugCommandQueue1 ID3D12DebugCommandQueue1; + +#endif /* __ID3D12DebugCommandQueue1_FWD_DEFINED__ */ + + +#ifndef __ID3D12DebugCommandList1_FWD_DEFINED__ +#define __ID3D12DebugCommandList1_FWD_DEFINED__ +typedef interface ID3D12DebugCommandList1 ID3D12DebugCommandList1; + +#endif /* __ID3D12DebugCommandList1_FWD_DEFINED__ */ + + +#ifndef __ID3D12DebugCommandList_FWD_DEFINED__ +#define __ID3D12DebugCommandList_FWD_DEFINED__ +typedef interface ID3D12DebugCommandList ID3D12DebugCommandList; + +#endif /* __ID3D12DebugCommandList_FWD_DEFINED__ */ + + +#ifndef __ID3D12DebugCommandList2_FWD_DEFINED__ +#define __ID3D12DebugCommandList2_FWD_DEFINED__ +typedef interface ID3D12DebugCommandList2 ID3D12DebugCommandList2; + +#endif /* __ID3D12DebugCommandList2_FWD_DEFINED__ */ + + +#ifndef __ID3D12DebugCommandList3_FWD_DEFINED__ +#define __ID3D12DebugCommandList3_FWD_DEFINED__ +typedef interface ID3D12DebugCommandList3 ID3D12DebugCommandList3; + +#endif /* __ID3D12DebugCommandList3_FWD_DEFINED__ */ + + +#ifndef __ID3D12SharingContract_FWD_DEFINED__ +#define __ID3D12SharingContract_FWD_DEFINED__ +typedef interface ID3D12SharingContract ID3D12SharingContract; + +#endif /* __ID3D12SharingContract_FWD_DEFINED__ */ + + +#ifndef __ID3D12InfoQueue_FWD_DEFINED__ +#define __ID3D12InfoQueue_FWD_DEFINED__ +typedef interface ID3D12InfoQueue ID3D12InfoQueue; + +#endif /* __ID3D12InfoQueue_FWD_DEFINED__ */ + + +#ifndef __ID3D12InfoQueue1_FWD_DEFINED__ +#define __ID3D12InfoQueue1_FWD_DEFINED__ +typedef interface ID3D12InfoQueue1 ID3D12InfoQueue1; + +#endif /* __ID3D12InfoQueue1_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "oaidl.h" +#include "ocidl.h" +#include "d3d12.h" + +#ifdef __cplusplus +extern "C"{ +#endif + + +/* interface __MIDL_itf_d3d12sdklayers_0000_0000 */ +/* [local] */ + +#include <winapifamily.h> +#pragma region App Family +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES) + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0000_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0000_v0_0_s_ifspec; + +#ifndef __ID3D12Debug_INTERFACE_DEFINED__ +#define __ID3D12Debug_INTERFACE_DEFINED__ + +/* interface ID3D12Debug */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Debug; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("344488b7-6846-474b-b989-f027448245e0") + ID3D12Debug : public IUnknown + { + public: + virtual void STDMETHODCALLTYPE EnableDebugLayer( void) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DebugVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Debug * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Debug * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Debug * This); + + DECLSPEC_XFGVIRT(ID3D12Debug, EnableDebugLayer) + void ( STDMETHODCALLTYPE *EnableDebugLayer )( + ID3D12Debug * This); + + END_INTERFACE + } ID3D12DebugVtbl; + + interface ID3D12Debug + { + CONST_VTBL struct ID3D12DebugVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Debug_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Debug_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Debug_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Debug_EnableDebugLayer(This) \ + ( (This)->lpVtbl -> EnableDebugLayer(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Debug_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12sdklayers_0000_0001 */ +/* [local] */ + +typedef +enum D3D12_GPU_BASED_VALIDATION_FLAGS + { + D3D12_GPU_BASED_VALIDATION_FLAGS_NONE = 0, + D3D12_GPU_BASED_VALIDATION_FLAGS_DISABLE_STATE_TRACKING = 0x1 + } D3D12_GPU_BASED_VALIDATION_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_GPU_BASED_VALIDATION_FLAGS) + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0001_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0001_v0_0_s_ifspec; + +#ifndef __ID3D12Debug1_INTERFACE_DEFINED__ +#define __ID3D12Debug1_INTERFACE_DEFINED__ + +/* interface ID3D12Debug1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Debug1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("affaa4ca-63fe-4d8e-b8ad-159000af4304") + ID3D12Debug1 : public IUnknown + { + public: + virtual void STDMETHODCALLTYPE EnableDebugLayer( void) = 0; + + virtual void STDMETHODCALLTYPE SetEnableGPUBasedValidation( + BOOL Enable) = 0; + + virtual void STDMETHODCALLTYPE SetEnableSynchronizedCommandQueueValidation( + BOOL Enable) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Debug1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Debug1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Debug1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Debug1 * This); + + DECLSPEC_XFGVIRT(ID3D12Debug1, EnableDebugLayer) + void ( STDMETHODCALLTYPE *EnableDebugLayer )( + ID3D12Debug1 * This); + + DECLSPEC_XFGVIRT(ID3D12Debug1, SetEnableGPUBasedValidation) + void ( STDMETHODCALLTYPE *SetEnableGPUBasedValidation )( + ID3D12Debug1 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Debug1, SetEnableSynchronizedCommandQueueValidation) + void ( STDMETHODCALLTYPE *SetEnableSynchronizedCommandQueueValidation )( + ID3D12Debug1 * This, + BOOL Enable); + + END_INTERFACE + } ID3D12Debug1Vtbl; + + interface ID3D12Debug1 + { + CONST_VTBL struct ID3D12Debug1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Debug1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Debug1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Debug1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Debug1_EnableDebugLayer(This) \ + ( (This)->lpVtbl -> EnableDebugLayer(This) ) + +#define ID3D12Debug1_SetEnableGPUBasedValidation(This,Enable) \ + ( (This)->lpVtbl -> SetEnableGPUBasedValidation(This,Enable) ) + +#define ID3D12Debug1_SetEnableSynchronizedCommandQueueValidation(This,Enable) \ + ( (This)->lpVtbl -> SetEnableSynchronizedCommandQueueValidation(This,Enable) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Debug1_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Debug2_INTERFACE_DEFINED__ +#define __ID3D12Debug2_INTERFACE_DEFINED__ + +/* interface ID3D12Debug2 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Debug2; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("93a665c4-a3b2-4e5d-b692-a26ae14e3374") + ID3D12Debug2 : public IUnknown + { + public: + virtual void STDMETHODCALLTYPE SetGPUBasedValidationFlags( + D3D12_GPU_BASED_VALIDATION_FLAGS Flags) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Debug2Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Debug2 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Debug2 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Debug2 * This); + + DECLSPEC_XFGVIRT(ID3D12Debug2, SetGPUBasedValidationFlags) + void ( STDMETHODCALLTYPE *SetGPUBasedValidationFlags )( + ID3D12Debug2 * This, + D3D12_GPU_BASED_VALIDATION_FLAGS Flags); + + END_INTERFACE + } ID3D12Debug2Vtbl; + + interface ID3D12Debug2 + { + CONST_VTBL struct ID3D12Debug2Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Debug2_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Debug2_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Debug2_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Debug2_SetGPUBasedValidationFlags(This,Flags) \ + ( (This)->lpVtbl -> SetGPUBasedValidationFlags(This,Flags) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Debug2_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Debug3_INTERFACE_DEFINED__ +#define __ID3D12Debug3_INTERFACE_DEFINED__ + +/* interface ID3D12Debug3 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Debug3; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("5cf4e58f-f671-4ff1-a542-3686e3d153d1") + ID3D12Debug3 : public ID3D12Debug + { + public: + virtual void STDMETHODCALLTYPE SetEnableGPUBasedValidation( + BOOL Enable) = 0; + + virtual void STDMETHODCALLTYPE SetEnableSynchronizedCommandQueueValidation( + BOOL Enable) = 0; + + virtual void STDMETHODCALLTYPE SetGPUBasedValidationFlags( + D3D12_GPU_BASED_VALIDATION_FLAGS Flags) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Debug3Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Debug3 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Debug3 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Debug3 * This); + + DECLSPEC_XFGVIRT(ID3D12Debug, EnableDebugLayer) + void ( STDMETHODCALLTYPE *EnableDebugLayer )( + ID3D12Debug3 * This); + + DECLSPEC_XFGVIRT(ID3D12Debug3, SetEnableGPUBasedValidation) + void ( STDMETHODCALLTYPE *SetEnableGPUBasedValidation )( + ID3D12Debug3 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Debug3, SetEnableSynchronizedCommandQueueValidation) + void ( STDMETHODCALLTYPE *SetEnableSynchronizedCommandQueueValidation )( + ID3D12Debug3 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Debug3, SetGPUBasedValidationFlags) + void ( STDMETHODCALLTYPE *SetGPUBasedValidationFlags )( + ID3D12Debug3 * This, + D3D12_GPU_BASED_VALIDATION_FLAGS Flags); + + END_INTERFACE + } ID3D12Debug3Vtbl; + + interface ID3D12Debug3 + { + CONST_VTBL struct ID3D12Debug3Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Debug3_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Debug3_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Debug3_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Debug3_EnableDebugLayer(This) \ + ( (This)->lpVtbl -> EnableDebugLayer(This) ) + + +#define ID3D12Debug3_SetEnableGPUBasedValidation(This,Enable) \ + ( (This)->lpVtbl -> SetEnableGPUBasedValidation(This,Enable) ) + +#define ID3D12Debug3_SetEnableSynchronizedCommandQueueValidation(This,Enable) \ + ( (This)->lpVtbl -> SetEnableSynchronizedCommandQueueValidation(This,Enable) ) + +#define ID3D12Debug3_SetGPUBasedValidationFlags(This,Flags) \ + ( (This)->lpVtbl -> SetGPUBasedValidationFlags(This,Flags) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Debug3_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Debug4_INTERFACE_DEFINED__ +#define __ID3D12Debug4_INTERFACE_DEFINED__ + +/* interface ID3D12Debug4 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Debug4; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("014b816e-9ec5-4a2f-a845-ffbe441ce13a") + ID3D12Debug4 : public ID3D12Debug3 + { + public: + virtual void STDMETHODCALLTYPE DisableDebugLayer( void) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Debug4Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Debug4 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Debug4 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Debug4 * This); + + DECLSPEC_XFGVIRT(ID3D12Debug, EnableDebugLayer) + void ( STDMETHODCALLTYPE *EnableDebugLayer )( + ID3D12Debug4 * This); + + DECLSPEC_XFGVIRT(ID3D12Debug3, SetEnableGPUBasedValidation) + void ( STDMETHODCALLTYPE *SetEnableGPUBasedValidation )( + ID3D12Debug4 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Debug3, SetEnableSynchronizedCommandQueueValidation) + void ( STDMETHODCALLTYPE *SetEnableSynchronizedCommandQueueValidation )( + ID3D12Debug4 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Debug3, SetGPUBasedValidationFlags) + void ( STDMETHODCALLTYPE *SetGPUBasedValidationFlags )( + ID3D12Debug4 * This, + D3D12_GPU_BASED_VALIDATION_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12Debug4, DisableDebugLayer) + void ( STDMETHODCALLTYPE *DisableDebugLayer )( + ID3D12Debug4 * This); + + END_INTERFACE + } ID3D12Debug4Vtbl; + + interface ID3D12Debug4 + { + CONST_VTBL struct ID3D12Debug4Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Debug4_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Debug4_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Debug4_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Debug4_EnableDebugLayer(This) \ + ( (This)->lpVtbl -> EnableDebugLayer(This) ) + + +#define ID3D12Debug4_SetEnableGPUBasedValidation(This,Enable) \ + ( (This)->lpVtbl -> SetEnableGPUBasedValidation(This,Enable) ) + +#define ID3D12Debug4_SetEnableSynchronizedCommandQueueValidation(This,Enable) \ + ( (This)->lpVtbl -> SetEnableSynchronizedCommandQueueValidation(This,Enable) ) + +#define ID3D12Debug4_SetGPUBasedValidationFlags(This,Flags) \ + ( (This)->lpVtbl -> SetGPUBasedValidationFlags(This,Flags) ) + + +#define ID3D12Debug4_DisableDebugLayer(This) \ + ( (This)->lpVtbl -> DisableDebugLayer(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Debug4_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Debug5_INTERFACE_DEFINED__ +#define __ID3D12Debug5_INTERFACE_DEFINED__ + +/* interface ID3D12Debug5 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Debug5; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("548d6b12-09fa-40e0-9069-5dcd589a52c9") + ID3D12Debug5 : public ID3D12Debug4 + { + public: + virtual void STDMETHODCALLTYPE SetEnableAutoName( + BOOL Enable) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Debug5Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Debug5 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Debug5 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Debug5 * This); + + DECLSPEC_XFGVIRT(ID3D12Debug, EnableDebugLayer) + void ( STDMETHODCALLTYPE *EnableDebugLayer )( + ID3D12Debug5 * This); + + DECLSPEC_XFGVIRT(ID3D12Debug3, SetEnableGPUBasedValidation) + void ( STDMETHODCALLTYPE *SetEnableGPUBasedValidation )( + ID3D12Debug5 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Debug3, SetEnableSynchronizedCommandQueueValidation) + void ( STDMETHODCALLTYPE *SetEnableSynchronizedCommandQueueValidation )( + ID3D12Debug5 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Debug3, SetGPUBasedValidationFlags) + void ( STDMETHODCALLTYPE *SetGPUBasedValidationFlags )( + ID3D12Debug5 * This, + D3D12_GPU_BASED_VALIDATION_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12Debug4, DisableDebugLayer) + void ( STDMETHODCALLTYPE *DisableDebugLayer )( + ID3D12Debug5 * This); + + DECLSPEC_XFGVIRT(ID3D12Debug5, SetEnableAutoName) + void ( STDMETHODCALLTYPE *SetEnableAutoName )( + ID3D12Debug5 * This, + BOOL Enable); + + END_INTERFACE + } ID3D12Debug5Vtbl; + + interface ID3D12Debug5 + { + CONST_VTBL struct ID3D12Debug5Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Debug5_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Debug5_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Debug5_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Debug5_EnableDebugLayer(This) \ + ( (This)->lpVtbl -> EnableDebugLayer(This) ) + + +#define ID3D12Debug5_SetEnableGPUBasedValidation(This,Enable) \ + ( (This)->lpVtbl -> SetEnableGPUBasedValidation(This,Enable) ) + +#define ID3D12Debug5_SetEnableSynchronizedCommandQueueValidation(This,Enable) \ + ( (This)->lpVtbl -> SetEnableSynchronizedCommandQueueValidation(This,Enable) ) + +#define ID3D12Debug5_SetGPUBasedValidationFlags(This,Flags) \ + ( (This)->lpVtbl -> SetGPUBasedValidationFlags(This,Flags) ) + + +#define ID3D12Debug5_DisableDebugLayer(This) \ + ( (This)->lpVtbl -> DisableDebugLayer(This) ) + + +#define ID3D12Debug5_SetEnableAutoName(This,Enable) \ + ( (This)->lpVtbl -> SetEnableAutoName(This,Enable) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Debug5_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12Debug6_INTERFACE_DEFINED__ +#define __ID3D12Debug6_INTERFACE_DEFINED__ + +/* interface ID3D12Debug6 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12Debug6; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("82a816d6-5d01-4157-97d0-4975463fd1ed") + ID3D12Debug6 : public ID3D12Debug5 + { + public: + virtual void STDMETHODCALLTYPE SetForceLegacyBarrierValidation( + BOOL Enable) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12Debug6Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12Debug6 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12Debug6 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12Debug6 * This); + + DECLSPEC_XFGVIRT(ID3D12Debug, EnableDebugLayer) + void ( STDMETHODCALLTYPE *EnableDebugLayer )( + ID3D12Debug6 * This); + + DECLSPEC_XFGVIRT(ID3D12Debug3, SetEnableGPUBasedValidation) + void ( STDMETHODCALLTYPE *SetEnableGPUBasedValidation )( + ID3D12Debug6 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Debug3, SetEnableSynchronizedCommandQueueValidation) + void ( STDMETHODCALLTYPE *SetEnableSynchronizedCommandQueueValidation )( + ID3D12Debug6 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Debug3, SetGPUBasedValidationFlags) + void ( STDMETHODCALLTYPE *SetGPUBasedValidationFlags )( + ID3D12Debug6 * This, + D3D12_GPU_BASED_VALIDATION_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12Debug4, DisableDebugLayer) + void ( STDMETHODCALLTYPE *DisableDebugLayer )( + ID3D12Debug6 * This); + + DECLSPEC_XFGVIRT(ID3D12Debug5, SetEnableAutoName) + void ( STDMETHODCALLTYPE *SetEnableAutoName )( + ID3D12Debug6 * This, + BOOL Enable); + + DECLSPEC_XFGVIRT(ID3D12Debug6, SetForceLegacyBarrierValidation) + void ( STDMETHODCALLTYPE *SetForceLegacyBarrierValidation )( + ID3D12Debug6 * This, + BOOL Enable); + + END_INTERFACE + } ID3D12Debug6Vtbl; + + interface ID3D12Debug6 + { + CONST_VTBL struct ID3D12Debug6Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12Debug6_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12Debug6_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12Debug6_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12Debug6_EnableDebugLayer(This) \ + ( (This)->lpVtbl -> EnableDebugLayer(This) ) + + +#define ID3D12Debug6_SetEnableGPUBasedValidation(This,Enable) \ + ( (This)->lpVtbl -> SetEnableGPUBasedValidation(This,Enable) ) + +#define ID3D12Debug6_SetEnableSynchronizedCommandQueueValidation(This,Enable) \ + ( (This)->lpVtbl -> SetEnableSynchronizedCommandQueueValidation(This,Enable) ) + +#define ID3D12Debug6_SetGPUBasedValidationFlags(This,Flags) \ + ( (This)->lpVtbl -> SetGPUBasedValidationFlags(This,Flags) ) + + +#define ID3D12Debug6_DisableDebugLayer(This) \ + ( (This)->lpVtbl -> DisableDebugLayer(This) ) + + +#define ID3D12Debug6_SetEnableAutoName(This,Enable) \ + ( (This)->lpVtbl -> SetEnableAutoName(This,Enable) ) + + +#define ID3D12Debug6_SetForceLegacyBarrierValidation(This,Enable) \ + ( (This)->lpVtbl -> SetForceLegacyBarrierValidation(This,Enable) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12Debug6_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12sdklayers_0000_0007 */ +/* [local] */ + +DEFINE_GUID(WKPDID_D3DAutoDebugObjectNameW, 0xd4902e36, 0x757a, 0x4942, 0x95, 0x94, 0xb6, 0x76, 0x9a, 0xfa, 0x43, 0xcd); +typedef +enum D3D12_RLDO_FLAGS + { + D3D12_RLDO_NONE = 0, + D3D12_RLDO_SUMMARY = 0x1, + D3D12_RLDO_DETAIL = 0x2, + D3D12_RLDO_IGNORE_INTERNAL = 0x4 + } D3D12_RLDO_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_RLDO_FLAGS) +typedef +enum D3D12_DEBUG_DEVICE_PARAMETER_TYPE + { + D3D12_DEBUG_DEVICE_PARAMETER_FEATURE_FLAGS = 0, + D3D12_DEBUG_DEVICE_PARAMETER_GPU_BASED_VALIDATION_SETTINGS = ( D3D12_DEBUG_DEVICE_PARAMETER_FEATURE_FLAGS + 1 ) , + D3D12_DEBUG_DEVICE_PARAMETER_GPU_SLOWDOWN_PERFORMANCE_FACTOR = ( D3D12_DEBUG_DEVICE_PARAMETER_GPU_BASED_VALIDATION_SETTINGS + 1 ) + } D3D12_DEBUG_DEVICE_PARAMETER_TYPE; + +typedef +enum D3D12_DEBUG_FEATURE + { + D3D12_DEBUG_FEATURE_NONE = 0, + D3D12_DEBUG_FEATURE_ALLOW_BEHAVIOR_CHANGING_DEBUG_AIDS = 0x1, + D3D12_DEBUG_FEATURE_CONSERVATIVE_RESOURCE_STATE_TRACKING = 0x2, + D3D12_DEBUG_FEATURE_DISABLE_VIRTUALIZED_BUNDLES_VALIDATION = 0x4, + D3D12_DEBUG_FEATURE_EMULATE_WINDOWS7 = 0x8 + } D3D12_DEBUG_FEATURE; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_DEBUG_FEATURE) +typedef +enum D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE + { + D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_NONE = 0, + D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_STATE_TRACKING_ONLY = ( D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_NONE + 1 ) , + D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_UNGUARDED_VALIDATION = ( D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_STATE_TRACKING_ONLY + 1 ) , + D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_GUARDED_VALIDATION = ( D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_UNGUARDED_VALIDATION + 1 ) , + NUM_D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODES = ( D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_GUARDED_VALIDATION + 1 ) + } D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE; + +typedef +enum D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAGS + { + D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAG_NONE = 0, + D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAG_FRONT_LOAD_CREATE_TRACKING_ONLY_SHADERS = 0x1, + D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAG_FRONT_LOAD_CREATE_UNGUARDED_VALIDATION_SHADERS = 0x2, + D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAG_FRONT_LOAD_CREATE_GUARDED_VALIDATION_SHADERS = 0x4, + D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAGS_VALID_MASK = 0x7 + } D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAGS) +typedef struct D3D12_DEBUG_DEVICE_GPU_BASED_VALIDATION_SETTINGS + { + UINT MaxMessagesPerCommandList; + D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE DefaultShaderPatchMode; + D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAGS PipelineStateCreateFlags; + } D3D12_DEBUG_DEVICE_GPU_BASED_VALIDATION_SETTINGS; + +typedef struct D3D12_DEBUG_DEVICE_GPU_SLOWDOWN_PERFORMANCE_FACTOR + { + FLOAT SlowdownFactor; + } D3D12_DEBUG_DEVICE_GPU_SLOWDOWN_PERFORMANCE_FACTOR; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0007_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0007_v0_0_s_ifspec; + +#ifndef __ID3D12DebugDevice1_INTERFACE_DEFINED__ +#define __ID3D12DebugDevice1_INTERFACE_DEFINED__ + +/* interface ID3D12DebugDevice1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DebugDevice1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("a9b71770-d099-4a65-a698-3dee10020f88") + ID3D12DebugDevice1 : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SetDebugParameter( + D3D12_DEBUG_DEVICE_PARAMETER_TYPE Type, + _In_reads_bytes_(DataSize) const void *pData, + UINT DataSize) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetDebugParameter( + D3D12_DEBUG_DEVICE_PARAMETER_TYPE Type, + _Out_writes_bytes_(DataSize) void *pData, + UINT DataSize) = 0; + + virtual HRESULT STDMETHODCALLTYPE ReportLiveDeviceObjects( + D3D12_RLDO_FLAGS Flags) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DebugDevice1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DebugDevice1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DebugDevice1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DebugDevice1 * This); + + DECLSPEC_XFGVIRT(ID3D12DebugDevice1, SetDebugParameter) + HRESULT ( STDMETHODCALLTYPE *SetDebugParameter )( + ID3D12DebugDevice1 * This, + D3D12_DEBUG_DEVICE_PARAMETER_TYPE Type, + _In_reads_bytes_(DataSize) const void *pData, + UINT DataSize); + + DECLSPEC_XFGVIRT(ID3D12DebugDevice1, GetDebugParameter) + HRESULT ( STDMETHODCALLTYPE *GetDebugParameter )( + ID3D12DebugDevice1 * This, + D3D12_DEBUG_DEVICE_PARAMETER_TYPE Type, + _Out_writes_bytes_(DataSize) void *pData, + UINT DataSize); + + DECLSPEC_XFGVIRT(ID3D12DebugDevice1, ReportLiveDeviceObjects) + HRESULT ( STDMETHODCALLTYPE *ReportLiveDeviceObjects )( + ID3D12DebugDevice1 * This, + D3D12_RLDO_FLAGS Flags); + + END_INTERFACE + } ID3D12DebugDevice1Vtbl; + + interface ID3D12DebugDevice1 + { + CONST_VTBL struct ID3D12DebugDevice1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DebugDevice1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DebugDevice1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DebugDevice1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DebugDevice1_SetDebugParameter(This,Type,pData,DataSize) \ + ( (This)->lpVtbl -> SetDebugParameter(This,Type,pData,DataSize) ) + +#define ID3D12DebugDevice1_GetDebugParameter(This,Type,pData,DataSize) \ + ( (This)->lpVtbl -> GetDebugParameter(This,Type,pData,DataSize) ) + +#define ID3D12DebugDevice1_ReportLiveDeviceObjects(This,Flags) \ + ( (This)->lpVtbl -> ReportLiveDeviceObjects(This,Flags) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DebugDevice1_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12DebugDevice_INTERFACE_DEFINED__ +#define __ID3D12DebugDevice_INTERFACE_DEFINED__ + +/* interface ID3D12DebugDevice */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DebugDevice; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("3febd6dd-4973-4787-8194-e45f9e28923e") + ID3D12DebugDevice : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SetFeatureMask( + D3D12_DEBUG_FEATURE Mask) = 0; + + virtual D3D12_DEBUG_FEATURE STDMETHODCALLTYPE GetFeatureMask( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE ReportLiveDeviceObjects( + D3D12_RLDO_FLAGS Flags) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DebugDeviceVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DebugDevice * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DebugDevice * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DebugDevice * This); + + DECLSPEC_XFGVIRT(ID3D12DebugDevice, SetFeatureMask) + HRESULT ( STDMETHODCALLTYPE *SetFeatureMask )( + ID3D12DebugDevice * This, + D3D12_DEBUG_FEATURE Mask); + + DECLSPEC_XFGVIRT(ID3D12DebugDevice, GetFeatureMask) + D3D12_DEBUG_FEATURE ( STDMETHODCALLTYPE *GetFeatureMask )( + ID3D12DebugDevice * This); + + DECLSPEC_XFGVIRT(ID3D12DebugDevice, ReportLiveDeviceObjects) + HRESULT ( STDMETHODCALLTYPE *ReportLiveDeviceObjects )( + ID3D12DebugDevice * This, + D3D12_RLDO_FLAGS Flags); + + END_INTERFACE + } ID3D12DebugDeviceVtbl; + + interface ID3D12DebugDevice + { + CONST_VTBL struct ID3D12DebugDeviceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DebugDevice_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DebugDevice_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DebugDevice_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DebugDevice_SetFeatureMask(This,Mask) \ + ( (This)->lpVtbl -> SetFeatureMask(This,Mask) ) + +#define ID3D12DebugDevice_GetFeatureMask(This) \ + ( (This)->lpVtbl -> GetFeatureMask(This) ) + +#define ID3D12DebugDevice_ReportLiveDeviceObjects(This,Flags) \ + ( (This)->lpVtbl -> ReportLiveDeviceObjects(This,Flags) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DebugDevice_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12DebugDevice2_INTERFACE_DEFINED__ +#define __ID3D12DebugDevice2_INTERFACE_DEFINED__ + +/* interface ID3D12DebugDevice2 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DebugDevice2; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("60eccbc1-378d-4df1-894c-f8ac5ce4d7dd") + ID3D12DebugDevice2 : public ID3D12DebugDevice + { + public: + virtual HRESULT STDMETHODCALLTYPE SetDebugParameter( + D3D12_DEBUG_DEVICE_PARAMETER_TYPE Type, + _In_reads_bytes_(DataSize) const void *pData, + UINT DataSize) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetDebugParameter( + D3D12_DEBUG_DEVICE_PARAMETER_TYPE Type, + _Out_writes_bytes_(DataSize) void *pData, + UINT DataSize) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DebugDevice2Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DebugDevice2 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DebugDevice2 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DebugDevice2 * This); + + DECLSPEC_XFGVIRT(ID3D12DebugDevice, SetFeatureMask) + HRESULT ( STDMETHODCALLTYPE *SetFeatureMask )( + ID3D12DebugDevice2 * This, + D3D12_DEBUG_FEATURE Mask); + + DECLSPEC_XFGVIRT(ID3D12DebugDevice, GetFeatureMask) + D3D12_DEBUG_FEATURE ( STDMETHODCALLTYPE *GetFeatureMask )( + ID3D12DebugDevice2 * This); + + DECLSPEC_XFGVIRT(ID3D12DebugDevice, ReportLiveDeviceObjects) + HRESULT ( STDMETHODCALLTYPE *ReportLiveDeviceObjects )( + ID3D12DebugDevice2 * This, + D3D12_RLDO_FLAGS Flags); + + DECLSPEC_XFGVIRT(ID3D12DebugDevice2, SetDebugParameter) + HRESULT ( STDMETHODCALLTYPE *SetDebugParameter )( + ID3D12DebugDevice2 * This, + D3D12_DEBUG_DEVICE_PARAMETER_TYPE Type, + _In_reads_bytes_(DataSize) const void *pData, + UINT DataSize); + + DECLSPEC_XFGVIRT(ID3D12DebugDevice2, GetDebugParameter) + HRESULT ( STDMETHODCALLTYPE *GetDebugParameter )( + ID3D12DebugDevice2 * This, + D3D12_DEBUG_DEVICE_PARAMETER_TYPE Type, + _Out_writes_bytes_(DataSize) void *pData, + UINT DataSize); + + END_INTERFACE + } ID3D12DebugDevice2Vtbl; + + interface ID3D12DebugDevice2 + { + CONST_VTBL struct ID3D12DebugDevice2Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DebugDevice2_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DebugDevice2_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DebugDevice2_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DebugDevice2_SetFeatureMask(This,Mask) \ + ( (This)->lpVtbl -> SetFeatureMask(This,Mask) ) + +#define ID3D12DebugDevice2_GetFeatureMask(This) \ + ( (This)->lpVtbl -> GetFeatureMask(This) ) + +#define ID3D12DebugDevice2_ReportLiveDeviceObjects(This,Flags) \ + ( (This)->lpVtbl -> ReportLiveDeviceObjects(This,Flags) ) + + +#define ID3D12DebugDevice2_SetDebugParameter(This,Type,pData,DataSize) \ + ( (This)->lpVtbl -> SetDebugParameter(This,Type,pData,DataSize) ) + +#define ID3D12DebugDevice2_GetDebugParameter(This,Type,pData,DataSize) \ + ( (This)->lpVtbl -> GetDebugParameter(This,Type,pData,DataSize) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DebugDevice2_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12sdklayers_0000_0010 */ +/* [local] */ + +DEFINE_GUID(DXGI_DEBUG_D3D12, 0xcf59a98c, 0xa950, 0x4326, 0x91, 0xef, 0x9b, 0xba, 0xa1, 0x7b, 0xfd, 0x95); + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0010_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0010_v0_0_s_ifspec; + +#ifndef __ID3D12DebugCommandQueue_INTERFACE_DEFINED__ +#define __ID3D12DebugCommandQueue_INTERFACE_DEFINED__ + +/* interface ID3D12DebugCommandQueue */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DebugCommandQueue; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("09e0bf36-54ac-484f-8847-4baeeab6053a") + ID3D12DebugCommandQueue : public IUnknown + { + public: + virtual BOOL STDMETHODCALLTYPE AssertResourceState( + _In_ ID3D12Resource *pResource, + UINT Subresource, + UINT State) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DebugCommandQueueVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DebugCommandQueue * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DebugCommandQueue * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DebugCommandQueue * This); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandQueue, AssertResourceState) + BOOL ( STDMETHODCALLTYPE *AssertResourceState )( + ID3D12DebugCommandQueue * This, + _In_ ID3D12Resource *pResource, + UINT Subresource, + UINT State); + + END_INTERFACE + } ID3D12DebugCommandQueueVtbl; + + interface ID3D12DebugCommandQueue + { + CONST_VTBL struct ID3D12DebugCommandQueueVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DebugCommandQueue_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DebugCommandQueue_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DebugCommandQueue_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DebugCommandQueue_AssertResourceState(This,pResource,Subresource,State) \ + ( (This)->lpVtbl -> AssertResourceState(This,pResource,Subresource,State) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DebugCommandQueue_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12DebugCommandQueue1_INTERFACE_DEFINED__ +#define __ID3D12DebugCommandQueue1_INTERFACE_DEFINED__ + +/* interface ID3D12DebugCommandQueue1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DebugCommandQueue1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("16be35a2-bfd6-49f2-bcae-eaae4aff862d") + ID3D12DebugCommandQueue1 : public ID3D12DebugCommandQueue + { + public: + virtual void STDMETHODCALLTYPE AssertResourceAccess( + _In_ ID3D12Resource *pResource, + UINT Subresource, + D3D12_BARRIER_ACCESS Access) = 0; + + virtual void STDMETHODCALLTYPE AssertTextureLayout( + _In_ ID3D12Resource *pResource, + UINT Subresource, + D3D12_BARRIER_LAYOUT Layout) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DebugCommandQueue1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DebugCommandQueue1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DebugCommandQueue1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DebugCommandQueue1 * This); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandQueue, AssertResourceState) + BOOL ( STDMETHODCALLTYPE *AssertResourceState )( + ID3D12DebugCommandQueue1 * This, + _In_ ID3D12Resource *pResource, + UINT Subresource, + UINT State); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandQueue1, AssertResourceAccess) + void ( STDMETHODCALLTYPE *AssertResourceAccess )( + ID3D12DebugCommandQueue1 * This, + _In_ ID3D12Resource *pResource, + UINT Subresource, + D3D12_BARRIER_ACCESS Access); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandQueue1, AssertTextureLayout) + void ( STDMETHODCALLTYPE *AssertTextureLayout )( + ID3D12DebugCommandQueue1 * This, + _In_ ID3D12Resource *pResource, + UINT Subresource, + D3D12_BARRIER_LAYOUT Layout); + + END_INTERFACE + } ID3D12DebugCommandQueue1Vtbl; + + interface ID3D12DebugCommandQueue1 + { + CONST_VTBL struct ID3D12DebugCommandQueue1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DebugCommandQueue1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DebugCommandQueue1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DebugCommandQueue1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DebugCommandQueue1_AssertResourceState(This,pResource,Subresource,State) \ + ( (This)->lpVtbl -> AssertResourceState(This,pResource,Subresource,State) ) + + +#define ID3D12DebugCommandQueue1_AssertResourceAccess(This,pResource,Subresource,Access) \ + ( (This)->lpVtbl -> AssertResourceAccess(This,pResource,Subresource,Access) ) + +#define ID3D12DebugCommandQueue1_AssertTextureLayout(This,pResource,Subresource,Layout) \ + ( (This)->lpVtbl -> AssertTextureLayout(This,pResource,Subresource,Layout) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DebugCommandQueue1_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12sdklayers_0000_0012 */ +/* [local] */ + +typedef +enum D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE + { + D3D12_DEBUG_COMMAND_LIST_PARAMETER_GPU_BASED_VALIDATION_SETTINGS = 0 + } D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE; + +typedef struct D3D12_DEBUG_COMMAND_LIST_GPU_BASED_VALIDATION_SETTINGS + { + D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE ShaderPatchMode; + } D3D12_DEBUG_COMMAND_LIST_GPU_BASED_VALIDATION_SETTINGS; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0012_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0012_v0_0_s_ifspec; + +#ifndef __ID3D12DebugCommandList1_INTERFACE_DEFINED__ +#define __ID3D12DebugCommandList1_INTERFACE_DEFINED__ + +/* interface ID3D12DebugCommandList1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DebugCommandList1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("102ca951-311b-4b01-b11f-ecb83e061b37") + ID3D12DebugCommandList1 : public IUnknown + { + public: + virtual BOOL STDMETHODCALLTYPE AssertResourceState( + _In_ ID3D12Resource *pResource, + UINT Subresource, + UINT State) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetDebugParameter( + D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type, + _In_reads_bytes_(DataSize) const void *pData, + UINT DataSize) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetDebugParameter( + D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type, + _Out_writes_bytes_(DataSize) void *pData, + UINT DataSize) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DebugCommandList1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DebugCommandList1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DebugCommandList1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DebugCommandList1 * This); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandList1, AssertResourceState) + BOOL ( STDMETHODCALLTYPE *AssertResourceState )( + ID3D12DebugCommandList1 * This, + _In_ ID3D12Resource *pResource, + UINT Subresource, + UINT State); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandList1, SetDebugParameter) + HRESULT ( STDMETHODCALLTYPE *SetDebugParameter )( + ID3D12DebugCommandList1 * This, + D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type, + _In_reads_bytes_(DataSize) const void *pData, + UINT DataSize); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandList1, GetDebugParameter) + HRESULT ( STDMETHODCALLTYPE *GetDebugParameter )( + ID3D12DebugCommandList1 * This, + D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type, + _Out_writes_bytes_(DataSize) void *pData, + UINT DataSize); + + END_INTERFACE + } ID3D12DebugCommandList1Vtbl; + + interface ID3D12DebugCommandList1 + { + CONST_VTBL struct ID3D12DebugCommandList1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DebugCommandList1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DebugCommandList1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DebugCommandList1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DebugCommandList1_AssertResourceState(This,pResource,Subresource,State) \ + ( (This)->lpVtbl -> AssertResourceState(This,pResource,Subresource,State) ) + +#define ID3D12DebugCommandList1_SetDebugParameter(This,Type,pData,DataSize) \ + ( (This)->lpVtbl -> SetDebugParameter(This,Type,pData,DataSize) ) + +#define ID3D12DebugCommandList1_GetDebugParameter(This,Type,pData,DataSize) \ + ( (This)->lpVtbl -> GetDebugParameter(This,Type,pData,DataSize) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DebugCommandList1_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12DebugCommandList_INTERFACE_DEFINED__ +#define __ID3D12DebugCommandList_INTERFACE_DEFINED__ + +/* interface ID3D12DebugCommandList */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DebugCommandList; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("09e0bf36-54ac-484f-8847-4baeeab6053f") + ID3D12DebugCommandList : public IUnknown + { + public: + virtual BOOL STDMETHODCALLTYPE AssertResourceState( + _In_ ID3D12Resource *pResource, + UINT Subresource, + UINT State) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetFeatureMask( + D3D12_DEBUG_FEATURE Mask) = 0; + + virtual D3D12_DEBUG_FEATURE STDMETHODCALLTYPE GetFeatureMask( void) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DebugCommandListVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DebugCommandList * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DebugCommandList * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DebugCommandList * This); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandList, AssertResourceState) + BOOL ( STDMETHODCALLTYPE *AssertResourceState )( + ID3D12DebugCommandList * This, + _In_ ID3D12Resource *pResource, + UINT Subresource, + UINT State); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandList, SetFeatureMask) + HRESULT ( STDMETHODCALLTYPE *SetFeatureMask )( + ID3D12DebugCommandList * This, + D3D12_DEBUG_FEATURE Mask); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandList, GetFeatureMask) + D3D12_DEBUG_FEATURE ( STDMETHODCALLTYPE *GetFeatureMask )( + ID3D12DebugCommandList * This); + + END_INTERFACE + } ID3D12DebugCommandListVtbl; + + interface ID3D12DebugCommandList + { + CONST_VTBL struct ID3D12DebugCommandListVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DebugCommandList_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DebugCommandList_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DebugCommandList_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DebugCommandList_AssertResourceState(This,pResource,Subresource,State) \ + ( (This)->lpVtbl -> AssertResourceState(This,pResource,Subresource,State) ) + +#define ID3D12DebugCommandList_SetFeatureMask(This,Mask) \ + ( (This)->lpVtbl -> SetFeatureMask(This,Mask) ) + +#define ID3D12DebugCommandList_GetFeatureMask(This) \ + ( (This)->lpVtbl -> GetFeatureMask(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DebugCommandList_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12DebugCommandList2_INTERFACE_DEFINED__ +#define __ID3D12DebugCommandList2_INTERFACE_DEFINED__ + +/* interface ID3D12DebugCommandList2 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DebugCommandList2; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("aeb575cf-4e06-48be-ba3b-c450fc96652e") + ID3D12DebugCommandList2 : public ID3D12DebugCommandList + { + public: + virtual HRESULT STDMETHODCALLTYPE SetDebugParameter( + D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type, + _In_reads_bytes_(DataSize) const void *pData, + UINT DataSize) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetDebugParameter( + D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type, + _Out_writes_bytes_(DataSize) void *pData, + UINT DataSize) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DebugCommandList2Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DebugCommandList2 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DebugCommandList2 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DebugCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandList, AssertResourceState) + BOOL ( STDMETHODCALLTYPE *AssertResourceState )( + ID3D12DebugCommandList2 * This, + _In_ ID3D12Resource *pResource, + UINT Subresource, + UINT State); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandList, SetFeatureMask) + HRESULT ( STDMETHODCALLTYPE *SetFeatureMask )( + ID3D12DebugCommandList2 * This, + D3D12_DEBUG_FEATURE Mask); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandList, GetFeatureMask) + D3D12_DEBUG_FEATURE ( STDMETHODCALLTYPE *GetFeatureMask )( + ID3D12DebugCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandList2, SetDebugParameter) + HRESULT ( STDMETHODCALLTYPE *SetDebugParameter )( + ID3D12DebugCommandList2 * This, + D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type, + _In_reads_bytes_(DataSize) const void *pData, + UINT DataSize); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandList2, GetDebugParameter) + HRESULT ( STDMETHODCALLTYPE *GetDebugParameter )( + ID3D12DebugCommandList2 * This, + D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type, + _Out_writes_bytes_(DataSize) void *pData, + UINT DataSize); + + END_INTERFACE + } ID3D12DebugCommandList2Vtbl; + + interface ID3D12DebugCommandList2 + { + CONST_VTBL struct ID3D12DebugCommandList2Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DebugCommandList2_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DebugCommandList2_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DebugCommandList2_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DebugCommandList2_AssertResourceState(This,pResource,Subresource,State) \ + ( (This)->lpVtbl -> AssertResourceState(This,pResource,Subresource,State) ) + +#define ID3D12DebugCommandList2_SetFeatureMask(This,Mask) \ + ( (This)->lpVtbl -> SetFeatureMask(This,Mask) ) + +#define ID3D12DebugCommandList2_GetFeatureMask(This) \ + ( (This)->lpVtbl -> GetFeatureMask(This) ) + + +#define ID3D12DebugCommandList2_SetDebugParameter(This,Type,pData,DataSize) \ + ( (This)->lpVtbl -> SetDebugParameter(This,Type,pData,DataSize) ) + +#define ID3D12DebugCommandList2_GetDebugParameter(This,Type,pData,DataSize) \ + ( (This)->lpVtbl -> GetDebugParameter(This,Type,pData,DataSize) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DebugCommandList2_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12DebugCommandList3_INTERFACE_DEFINED__ +#define __ID3D12DebugCommandList3_INTERFACE_DEFINED__ + +/* interface ID3D12DebugCommandList3 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12DebugCommandList3; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("197d5e15-4d37-4d34-af78-724cd70fdb1f") + ID3D12DebugCommandList3 : public ID3D12DebugCommandList2 + { + public: + virtual void STDMETHODCALLTYPE AssertResourceAccess( + _In_ ID3D12Resource *pResource, + UINT Subresource, + D3D12_BARRIER_ACCESS Access) = 0; + + virtual void STDMETHODCALLTYPE AssertTextureLayout( + _In_ ID3D12Resource *pResource, + UINT Subresource, + D3D12_BARRIER_LAYOUT Layout) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12DebugCommandList3Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12DebugCommandList3 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12DebugCommandList3 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12DebugCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandList, AssertResourceState) + BOOL ( STDMETHODCALLTYPE *AssertResourceState )( + ID3D12DebugCommandList3 * This, + _In_ ID3D12Resource *pResource, + UINT Subresource, + UINT State); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandList, SetFeatureMask) + HRESULT ( STDMETHODCALLTYPE *SetFeatureMask )( + ID3D12DebugCommandList3 * This, + D3D12_DEBUG_FEATURE Mask); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandList, GetFeatureMask) + D3D12_DEBUG_FEATURE ( STDMETHODCALLTYPE *GetFeatureMask )( + ID3D12DebugCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandList2, SetDebugParameter) + HRESULT ( STDMETHODCALLTYPE *SetDebugParameter )( + ID3D12DebugCommandList3 * This, + D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type, + _In_reads_bytes_(DataSize) const void *pData, + UINT DataSize); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandList2, GetDebugParameter) + HRESULT ( STDMETHODCALLTYPE *GetDebugParameter )( + ID3D12DebugCommandList3 * This, + D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type, + _Out_writes_bytes_(DataSize) void *pData, + UINT DataSize); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandList3, AssertResourceAccess) + void ( STDMETHODCALLTYPE *AssertResourceAccess )( + ID3D12DebugCommandList3 * This, + _In_ ID3D12Resource *pResource, + UINT Subresource, + D3D12_BARRIER_ACCESS Access); + + DECLSPEC_XFGVIRT(ID3D12DebugCommandList3, AssertTextureLayout) + void ( STDMETHODCALLTYPE *AssertTextureLayout )( + ID3D12DebugCommandList3 * This, + _In_ ID3D12Resource *pResource, + UINT Subresource, + D3D12_BARRIER_LAYOUT Layout); + + END_INTERFACE + } ID3D12DebugCommandList3Vtbl; + + interface ID3D12DebugCommandList3 + { + CONST_VTBL struct ID3D12DebugCommandList3Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12DebugCommandList3_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12DebugCommandList3_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12DebugCommandList3_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12DebugCommandList3_AssertResourceState(This,pResource,Subresource,State) \ + ( (This)->lpVtbl -> AssertResourceState(This,pResource,Subresource,State) ) + +#define ID3D12DebugCommandList3_SetFeatureMask(This,Mask) \ + ( (This)->lpVtbl -> SetFeatureMask(This,Mask) ) + +#define ID3D12DebugCommandList3_GetFeatureMask(This) \ + ( (This)->lpVtbl -> GetFeatureMask(This) ) + + +#define ID3D12DebugCommandList3_SetDebugParameter(This,Type,pData,DataSize) \ + ( (This)->lpVtbl -> SetDebugParameter(This,Type,pData,DataSize) ) + +#define ID3D12DebugCommandList3_GetDebugParameter(This,Type,pData,DataSize) \ + ( (This)->lpVtbl -> GetDebugParameter(This,Type,pData,DataSize) ) + + +#define ID3D12DebugCommandList3_AssertResourceAccess(This,pResource,Subresource,Access) \ + ( (This)->lpVtbl -> AssertResourceAccess(This,pResource,Subresource,Access) ) + +#define ID3D12DebugCommandList3_AssertTextureLayout(This,pResource,Subresource,Layout) \ + ( (This)->lpVtbl -> AssertTextureLayout(This,pResource,Subresource,Layout) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12DebugCommandList3_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12SharingContract_INTERFACE_DEFINED__ +#define __ID3D12SharingContract_INTERFACE_DEFINED__ + +/* interface ID3D12SharingContract */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12SharingContract; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("0adf7d52-929c-4e61-addb-ffed30de66ef") + ID3D12SharingContract : public IUnknown + { + public: + virtual void STDMETHODCALLTYPE Present( + _In_ ID3D12Resource *pResource, + UINT Subresource, + _In_ HWND window) = 0; + + virtual void STDMETHODCALLTYPE SharedFenceSignal( + _In_ ID3D12Fence *pFence, + UINT64 FenceValue) = 0; + + virtual void STDMETHODCALLTYPE BeginCapturableWork( + _In_ REFGUID guid) = 0; + + virtual void STDMETHODCALLTYPE EndCapturableWork( + _In_ REFGUID guid) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12SharingContractVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12SharingContract * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12SharingContract * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12SharingContract * This); + + DECLSPEC_XFGVIRT(ID3D12SharingContract, Present) + void ( STDMETHODCALLTYPE *Present )( + ID3D12SharingContract * This, + _In_ ID3D12Resource *pResource, + UINT Subresource, + _In_ HWND window); + + DECLSPEC_XFGVIRT(ID3D12SharingContract, SharedFenceSignal) + void ( STDMETHODCALLTYPE *SharedFenceSignal )( + ID3D12SharingContract * This, + _In_ ID3D12Fence *pFence, + UINT64 FenceValue); + + DECLSPEC_XFGVIRT(ID3D12SharingContract, BeginCapturableWork) + void ( STDMETHODCALLTYPE *BeginCapturableWork )( + ID3D12SharingContract * This, + _In_ REFGUID guid); + + DECLSPEC_XFGVIRT(ID3D12SharingContract, EndCapturableWork) + void ( STDMETHODCALLTYPE *EndCapturableWork )( + ID3D12SharingContract * This, + _In_ REFGUID guid); + + END_INTERFACE + } ID3D12SharingContractVtbl; + + interface ID3D12SharingContract + { + CONST_VTBL struct ID3D12SharingContractVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12SharingContract_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12SharingContract_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12SharingContract_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12SharingContract_Present(This,pResource,Subresource,window) \ + ( (This)->lpVtbl -> Present(This,pResource,Subresource,window) ) + +#define ID3D12SharingContract_SharedFenceSignal(This,pFence,FenceValue) \ + ( (This)->lpVtbl -> SharedFenceSignal(This,pFence,FenceValue) ) + +#define ID3D12SharingContract_BeginCapturableWork(This,guid) \ + ( (This)->lpVtbl -> BeginCapturableWork(This,guid) ) + +#define ID3D12SharingContract_EndCapturableWork(This,guid) \ + ( (This)->lpVtbl -> EndCapturableWork(This,guid) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12SharingContract_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12sdklayers_0000_0017 */ +/* [local] */ + +typedef +enum D3D12_MESSAGE_CATEGORY + { + D3D12_MESSAGE_CATEGORY_APPLICATION_DEFINED = 0, + D3D12_MESSAGE_CATEGORY_MISCELLANEOUS = ( D3D12_MESSAGE_CATEGORY_APPLICATION_DEFINED + 1 ) , + D3D12_MESSAGE_CATEGORY_INITIALIZATION = ( D3D12_MESSAGE_CATEGORY_MISCELLANEOUS + 1 ) , + D3D12_MESSAGE_CATEGORY_CLEANUP = ( D3D12_MESSAGE_CATEGORY_INITIALIZATION + 1 ) , + D3D12_MESSAGE_CATEGORY_COMPILATION = ( D3D12_MESSAGE_CATEGORY_CLEANUP + 1 ) , + D3D12_MESSAGE_CATEGORY_STATE_CREATION = ( D3D12_MESSAGE_CATEGORY_COMPILATION + 1 ) , + D3D12_MESSAGE_CATEGORY_STATE_SETTING = ( D3D12_MESSAGE_CATEGORY_STATE_CREATION + 1 ) , + D3D12_MESSAGE_CATEGORY_STATE_GETTING = ( D3D12_MESSAGE_CATEGORY_STATE_SETTING + 1 ) , + D3D12_MESSAGE_CATEGORY_RESOURCE_MANIPULATION = ( D3D12_MESSAGE_CATEGORY_STATE_GETTING + 1 ) , + D3D12_MESSAGE_CATEGORY_EXECUTION = ( D3D12_MESSAGE_CATEGORY_RESOURCE_MANIPULATION + 1 ) , + D3D12_MESSAGE_CATEGORY_SHADER = ( D3D12_MESSAGE_CATEGORY_EXECUTION + 1 ) + } D3D12_MESSAGE_CATEGORY; + +typedef +enum D3D12_MESSAGE_SEVERITY + { + D3D12_MESSAGE_SEVERITY_CORRUPTION = 0, + D3D12_MESSAGE_SEVERITY_ERROR = ( D3D12_MESSAGE_SEVERITY_CORRUPTION + 1 ) , + D3D12_MESSAGE_SEVERITY_WARNING = ( D3D12_MESSAGE_SEVERITY_ERROR + 1 ) , + D3D12_MESSAGE_SEVERITY_INFO = ( D3D12_MESSAGE_SEVERITY_WARNING + 1 ) , + D3D12_MESSAGE_SEVERITY_MESSAGE = ( D3D12_MESSAGE_SEVERITY_INFO + 1 ) + } D3D12_MESSAGE_SEVERITY; + +typedef +enum D3D12_MESSAGE_ID + { + D3D12_MESSAGE_ID_UNKNOWN = 0, + D3D12_MESSAGE_ID_STRING_FROM_APPLICATION = 1, + D3D12_MESSAGE_ID_CORRUPTED_THIS = 2, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER1 = 3, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER2 = 4, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER3 = 5, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER4 = 6, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER5 = 7, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER6 = 8, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER7 = 9, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER8 = 10, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER9 = 11, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER10 = 12, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER11 = 13, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER12 = 14, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER13 = 15, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER14 = 16, + D3D12_MESSAGE_ID_CORRUPTED_PARAMETER15 = 17, + D3D12_MESSAGE_ID_CORRUPTED_MULTITHREADING = 18, + D3D12_MESSAGE_ID_MESSAGE_REPORTING_OUTOFMEMORY = 19, + D3D12_MESSAGE_ID_GETPRIVATEDATA_MOREDATA = 20, + D3D12_MESSAGE_ID_SETPRIVATEDATA_INVALIDFREEDATA = 21, + D3D12_MESSAGE_ID_SETPRIVATEDATA_CHANGINGPARAMS = 24, + D3D12_MESSAGE_ID_SETPRIVATEDATA_OUTOFMEMORY = 25, + D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_UNRECOGNIZEDFORMAT = 26, + D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDESC = 27, + D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFORMAT = 28, + D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDVIDEOPLANESLICE = 29, + D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDPLANESLICE = 30, + D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDIMENSIONS = 31, + D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDRESOURCE = 32, + D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_UNRECOGNIZEDFORMAT = 35, + D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_UNSUPPORTEDFORMAT = 36, + D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDESC = 37, + D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDFORMAT = 38, + D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDVIDEOPLANESLICE = 39, + D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDPLANESLICE = 40, + D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDIMENSIONS = 41, + D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDRESOURCE = 42, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_UNRECOGNIZEDFORMAT = 45, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDESC = 46, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFORMAT = 47, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDIMENSIONS = 48, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDRESOURCE = 49, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_OUTOFMEMORY = 52, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_TOOMANYELEMENTS = 53, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDFORMAT = 54, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INCOMPATIBLEFORMAT = 55, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOT = 56, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDINPUTSLOTCLASS = 57, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_STEPRATESLOTCLASSMISMATCH = 58, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOTCLASSCHANGE = 59, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSTEPRATECHANGE = 60, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDALIGNMENT = 61, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_DUPLICATESEMANTIC = 62, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_UNPARSEABLEINPUTSIGNATURE = 63, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_NULLSEMANTIC = 64, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_MISSINGELEMENT = 65, + D3D12_MESSAGE_ID_CREATEVERTEXSHADER_OUTOFMEMORY = 66, + D3D12_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERBYTECODE = 67, + D3D12_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERTYPE = 68, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADER_OUTOFMEMORY = 69, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERBYTECODE = 70, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERTYPE = 71, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTOFMEMORY = 72, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERBYTECODE = 73, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERTYPE = 74, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMENTRIES = 75, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSTREAMSTRIDEUNUSED = 76, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSLOT0EXPECTED = 79, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSLOT = 80, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_ONLYONEELEMENTPERSLOT = 81, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCOMPONENTCOUNT = 82, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTARTCOMPONENTANDCOMPONENTCOUNT = 83, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDGAPDEFINITION = 84, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_REPEATEDOUTPUT = 85, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSTREAMSTRIDE = 86, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGSEMANTIC = 87, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MASKMISMATCH = 88, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_CANTHAVEONLYGAPS = 89, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DECLTOOCOMPLEX = 90, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGOUTPUTSIGNATURE = 91, + D3D12_MESSAGE_ID_CREATEPIXELSHADER_OUTOFMEMORY = 92, + D3D12_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERBYTECODE = 93, + D3D12_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERTYPE = 94, + D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFILLMODE = 95, + D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDCULLMODE = 96, + D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDDEPTHBIASCLAMP = 97, + D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDSLOPESCALEDDEPTHBIAS = 98, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHWRITEMASK = 100, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHFUNC = 101, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFAILOP = 102, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILZFAILOP = 103, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILPASSOP = 104, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFUNC = 105, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFAILOP = 106, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILZFAILOP = 107, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILPASSOP = 108, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFUNC = 109, + D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLEND = 111, + D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLEND = 112, + D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOP = 113, + D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLENDALPHA = 114, + D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLENDALPHA = 115, + D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOPALPHA = 116, + D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDRENDERTARGETWRITEMASK = 117, + D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_INVALID = 135, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_ROOT_SIGNATURE_NOT_SET = 200, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_ROOT_SIGNATURE_MISMATCH = 201, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_BUFFER_NOT_SET = 202, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_BUFFER_STRIDE_TOO_SMALL = 209, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_BUFFER_TOO_SMALL = 210, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INDEX_BUFFER_NOT_SET = 211, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INDEX_BUFFER_FORMAT_INVALID = 212, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INDEX_BUFFER_TOO_SMALL = 213, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INVALID_PRIMITIVETOPOLOGY = 219, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_STRIDE_UNALIGNED = 221, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INDEX_OFFSET_UNALIGNED = 222, + D3D12_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_AT_FAULT = 232, + D3D12_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_POSSIBLY_AT_FAULT = 233, + D3D12_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_NOT_AT_FAULT = 234, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_TRAILING_DIGIT_IN_SEMANTIC = 239, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_TRAILING_DIGIT_IN_SEMANTIC = 240, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_TYPE_MISMATCH = 245, + D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_EMPTY_LAYOUT = 253, + D3D12_MESSAGE_ID_LIVE_OBJECT_SUMMARY = 255, + D3D12_MESSAGE_ID_LIVE_DEVICE = 274, + D3D12_MESSAGE_ID_LIVE_SWAPCHAIN = 275, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFLAGS = 276, + D3D12_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDCLASSLINKAGE = 277, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDCLASSLINKAGE = 278, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTREAMTORASTERIZER = 280, + D3D12_MESSAGE_ID_CREATEPIXELSHADER_INVALIDCLASSLINKAGE = 283, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTREAM = 284, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDENTRIES = 285, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDSTRIDES = 286, + D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMSTRIDES = 287, + D3D12_MESSAGE_ID_CREATEHULLSHADER_OUTOFMEMORY = 289, + D3D12_MESSAGE_ID_CREATEHULLSHADER_INVALIDSHADERBYTECODE = 290, + D3D12_MESSAGE_ID_CREATEHULLSHADER_INVALIDSHADERTYPE = 291, + D3D12_MESSAGE_ID_CREATEHULLSHADER_INVALIDCLASSLINKAGE = 292, + D3D12_MESSAGE_ID_CREATEDOMAINSHADER_OUTOFMEMORY = 294, + D3D12_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDSHADERBYTECODE = 295, + D3D12_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDSHADERTYPE = 296, + D3D12_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDCLASSLINKAGE = 297, + D3D12_MESSAGE_ID_RESOURCE_UNMAP_NOTMAPPED = 310, + D3D12_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_MISMATCHED_DATA_SIZE = 318, + D3D12_MESSAGE_ID_CREATECOMPUTESHADER_OUTOFMEMORY = 321, + D3D12_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDSHADERBYTECODE = 322, + D3D12_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDCLASSLINKAGE = 323, + D3D12_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_DOUBLEFLOATOPSNOTSUPPORTED = 331, + D3D12_MESSAGE_ID_DEVICE_CREATEHULLSHADER_DOUBLEFLOATOPSNOTSUPPORTED = 332, + D3D12_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_DOUBLEFLOATOPSNOTSUPPORTED = 333, + D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_DOUBLEFLOATOPSNOTSUPPORTED = 334, + D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DOUBLEFLOATOPSNOTSUPPORTED = 335, + D3D12_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_DOUBLEFLOATOPSNOTSUPPORTED = 336, + D3D12_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_DOUBLEFLOATOPSNOTSUPPORTED = 337, + D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDRESOURCE = 340, + D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDESC = 341, + D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDFORMAT = 342, + D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDVIDEOPLANESLICE = 343, + D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDPLANESLICE = 344, + D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDIMENSIONS = 345, + D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_UNRECOGNIZEDFORMAT = 346, + D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDFLAGS = 354, + D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFORCEDSAMPLECOUNT = 401, + D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDLOGICOPS = 403, + D3D12_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = 410, + D3D12_MESSAGE_ID_DEVICE_CREATEHULLSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = 412, + D3D12_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = 414, + D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = 416, + D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DOUBLEEXTENSIONSNOTSUPPORTED = 418, + D3D12_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = 420, + D3D12_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_DOUBLEEXTENSIONSNOTSUPPORTED = 422, + D3D12_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_UAVSNOTSUPPORTED = 425, + D3D12_MESSAGE_ID_DEVICE_CREATEHULLSHADER_UAVSNOTSUPPORTED = 426, + D3D12_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_UAVSNOTSUPPORTED = 427, + D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_UAVSNOTSUPPORTED = 428, + D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UAVSNOTSUPPORTED = 429, + D3D12_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_UAVSNOTSUPPORTED = 430, + D3D12_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_UAVSNOTSUPPORTED = 431, + D3D12_MESSAGE_ID_DEVICE_CLEARVIEW_INVALIDSOURCERECT = 447, + D3D12_MESSAGE_ID_DEVICE_CLEARVIEW_EMPTYRECT = 448, + D3D12_MESSAGE_ID_UPDATETILEMAPPINGS_INVALID_PARAMETER = 493, + D3D12_MESSAGE_ID_COPYTILEMAPPINGS_INVALID_PARAMETER = 494, + D3D12_MESSAGE_ID_CREATEDEVICE_INVALIDARGS = 506, + D3D12_MESSAGE_ID_CREATEDEVICE_WARNING = 507, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_TYPE = 519, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_NULL_POINTER = 520, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_SUBRESOURCE = 521, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_RESERVED_BITS = 522, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_MISSING_BIND_FLAGS = 523, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_MISMATCHING_MISC_FLAGS = 524, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_MATCHING_STATES = 525, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_COMBINATION = 526, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_BEFORE_AFTER_MISMATCH = 527, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_RESOURCE = 528, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_SAMPLE_COUNT = 529, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_FLAGS = 530, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_COMBINED_FLAGS = 531, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_FLAGS_FOR_FORMAT = 532, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_SPLIT_BARRIER = 533, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_UNMATCHED_END = 534, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_UNMATCHED_BEGIN = 535, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_FLAG = 536, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_COMMAND_LIST_TYPE = 537, + D3D12_MESSAGE_ID_INVALID_SUBRESOURCE_STATE = 538, + D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_CONTENTION = 540, + D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_RESET = 541, + D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_RESET_BUNDLE = 542, + D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_CANNOT_RESET = 543, + D3D12_MESSAGE_ID_COMMAND_LIST_OPEN = 544, + D3D12_MESSAGE_ID_INVALID_BUNDLE_API = 546, + D3D12_MESSAGE_ID_COMMAND_LIST_CLOSED = 547, + D3D12_MESSAGE_ID_WRONG_COMMAND_ALLOCATOR_TYPE = 549, + D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_SYNC = 552, + D3D12_MESSAGE_ID_COMMAND_LIST_SYNC = 553, + D3D12_MESSAGE_ID_SET_DESCRIPTOR_HEAP_INVALID = 554, + D3D12_MESSAGE_ID_CREATE_COMMANDQUEUE = 557, + D3D12_MESSAGE_ID_CREATE_COMMANDALLOCATOR = 558, + D3D12_MESSAGE_ID_CREATE_PIPELINESTATE = 559, + D3D12_MESSAGE_ID_CREATE_COMMANDLIST12 = 560, + D3D12_MESSAGE_ID_CREATE_RESOURCE = 562, + D3D12_MESSAGE_ID_CREATE_DESCRIPTORHEAP = 563, + D3D12_MESSAGE_ID_CREATE_ROOTSIGNATURE = 564, + D3D12_MESSAGE_ID_CREATE_LIBRARY = 565, + D3D12_MESSAGE_ID_CREATE_HEAP = 566, + D3D12_MESSAGE_ID_CREATE_MONITOREDFENCE = 567, + D3D12_MESSAGE_ID_CREATE_QUERYHEAP = 568, + D3D12_MESSAGE_ID_CREATE_COMMANDSIGNATURE = 569, + D3D12_MESSAGE_ID_LIVE_COMMANDQUEUE = 570, + D3D12_MESSAGE_ID_LIVE_COMMANDALLOCATOR = 571, + D3D12_MESSAGE_ID_LIVE_PIPELINESTATE = 572, + D3D12_MESSAGE_ID_LIVE_COMMANDLIST12 = 573, + D3D12_MESSAGE_ID_LIVE_RESOURCE = 575, + D3D12_MESSAGE_ID_LIVE_DESCRIPTORHEAP = 576, + D3D12_MESSAGE_ID_LIVE_ROOTSIGNATURE = 577, + D3D12_MESSAGE_ID_LIVE_LIBRARY = 578, + D3D12_MESSAGE_ID_LIVE_HEAP = 579, + D3D12_MESSAGE_ID_LIVE_MONITOREDFENCE = 580, + D3D12_MESSAGE_ID_LIVE_QUERYHEAP = 581, + D3D12_MESSAGE_ID_LIVE_COMMANDSIGNATURE = 582, + D3D12_MESSAGE_ID_DESTROY_COMMANDQUEUE = 583, + D3D12_MESSAGE_ID_DESTROY_COMMANDALLOCATOR = 584, + D3D12_MESSAGE_ID_DESTROY_PIPELINESTATE = 585, + D3D12_MESSAGE_ID_DESTROY_COMMANDLIST12 = 586, + D3D12_MESSAGE_ID_DESTROY_RESOURCE = 588, + D3D12_MESSAGE_ID_DESTROY_DESCRIPTORHEAP = 589, + D3D12_MESSAGE_ID_DESTROY_ROOTSIGNATURE = 590, + D3D12_MESSAGE_ID_DESTROY_LIBRARY = 591, + D3D12_MESSAGE_ID_DESTROY_HEAP = 592, + D3D12_MESSAGE_ID_DESTROY_MONITOREDFENCE = 593, + D3D12_MESSAGE_ID_DESTROY_QUERYHEAP = 594, + D3D12_MESSAGE_ID_DESTROY_COMMANDSIGNATURE = 595, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDDIMENSIONS = 597, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDMISCFLAGS = 599, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDARG_RETURN = 602, + D3D12_MESSAGE_ID_CREATERESOURCE_OUTOFMEMORY_RETURN = 603, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDDESC = 604, + D3D12_MESSAGE_ID_POSSIBLY_INVALID_SUBRESOURCE_STATE = 607, + D3D12_MESSAGE_ID_INVALID_USE_OF_NON_RESIDENT_RESOURCE = 608, + D3D12_MESSAGE_ID_POSSIBLE_INVALID_USE_OF_NON_RESIDENT_RESOURCE = 609, + D3D12_MESSAGE_ID_BUNDLE_PIPELINE_STATE_MISMATCH = 610, + D3D12_MESSAGE_ID_PRIMITIVE_TOPOLOGY_MISMATCH_PIPELINE_STATE = 611, + D3D12_MESSAGE_ID_RENDER_TARGET_FORMAT_MISMATCH_PIPELINE_STATE = 613, + D3D12_MESSAGE_ID_RENDER_TARGET_SAMPLE_DESC_MISMATCH_PIPELINE_STATE = 614, + D3D12_MESSAGE_ID_DEPTH_STENCIL_FORMAT_MISMATCH_PIPELINE_STATE = 615, + D3D12_MESSAGE_ID_DEPTH_STENCIL_SAMPLE_DESC_MISMATCH_PIPELINE_STATE = 616, + D3D12_MESSAGE_ID_CREATESHADER_INVALIDBYTECODE = 622, + D3D12_MESSAGE_ID_CREATEHEAP_NULLDESC = 623, + D3D12_MESSAGE_ID_CREATEHEAP_INVALIDSIZE = 624, + D3D12_MESSAGE_ID_CREATEHEAP_UNRECOGNIZEDHEAPTYPE = 625, + D3D12_MESSAGE_ID_CREATEHEAP_UNRECOGNIZEDCPUPAGEPROPERTIES = 626, + D3D12_MESSAGE_ID_CREATEHEAP_UNRECOGNIZEDMEMORYPOOL = 627, + D3D12_MESSAGE_ID_CREATEHEAP_INVALIDPROPERTIES = 628, + D3D12_MESSAGE_ID_CREATEHEAP_INVALIDALIGNMENT = 629, + D3D12_MESSAGE_ID_CREATEHEAP_UNRECOGNIZEDMISCFLAGS = 630, + D3D12_MESSAGE_ID_CREATEHEAP_INVALIDMISCFLAGS = 631, + D3D12_MESSAGE_ID_CREATEHEAP_INVALIDARG_RETURN = 632, + D3D12_MESSAGE_ID_CREATEHEAP_OUTOFMEMORY_RETURN = 633, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_NULLHEAPPROPERTIES = 634, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_UNRECOGNIZEDHEAPTYPE = 635, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_UNRECOGNIZEDCPUPAGEPROPERTIES = 636, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_UNRECOGNIZEDMEMORYPOOL = 637, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_INVALIDHEAPPROPERTIES = 638, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_UNRECOGNIZEDHEAPMISCFLAGS = 639, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_INVALIDHEAPMISCFLAGS = 640, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_INVALIDARG_RETURN = 641, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_OUTOFMEMORY_RETURN = 642, + D3D12_MESSAGE_ID_GETCUSTOMHEAPPROPERTIES_UNRECOGNIZEDHEAPTYPE = 643, + D3D12_MESSAGE_ID_GETCUSTOMHEAPPROPERTIES_INVALIDHEAPTYPE = 644, + D3D12_MESSAGE_ID_CREATE_DESCRIPTOR_HEAP_INVALID_DESC = 645, + D3D12_MESSAGE_ID_INVALID_DESCRIPTOR_HANDLE = 646, + D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALID_CONSERVATIVERASTERMODE = 647, + D3D12_MESSAGE_ID_CREATE_CONSTANT_BUFFER_VIEW_INVALID_RESOURCE = 649, + D3D12_MESSAGE_ID_CREATE_CONSTANT_BUFFER_VIEW_INVALID_DESC = 650, + D3D12_MESSAGE_ID_CREATE_UNORDEREDACCESS_VIEW_INVALID_COUNTER_USAGE = 652, + D3D12_MESSAGE_ID_COPY_DESCRIPTORS_INVALID_RANGES = 653, + D3D12_MESSAGE_ID_COPY_DESCRIPTORS_WRITE_ONLY_DESCRIPTOR = 654, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_RTV_FORMAT_NOT_UNKNOWN = 655, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_RENDER_TARGET_COUNT = 656, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_VERTEX_SHADER_NOT_SET = 657, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INPUTLAYOUT_NOT_SET = 658, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_HS_DS_SIGNATURE_MISMATCH = 659, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_REGISTERINDEX = 660, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_COMPONENTTYPE = 661, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_REGISTERMASK = 662, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_SYSTEMVALUE = 663, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_NEVERWRITTEN_ALWAYSREADS = 664, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_MINPRECISION = 665, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND = 666, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HS_XOR_DS_MISMATCH = 667, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HULL_SHADER_INPUT_TOPOLOGY_MISMATCH = 668, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HS_DS_CONTROL_POINT_COUNT_MISMATCH = 669, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HS_DS_TESSELLATOR_DOMAIN_MISMATCH = 670, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_USE_OF_CENTER_MULTISAMPLE_PATTERN = 671, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_USE_OF_FORCED_SAMPLE_COUNT = 672, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_PRIMITIVETOPOLOGY = 673, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_SYSTEMVALUE = 674, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_OM_DUAL_SOURCE_BLENDING_CAN_ONLY_HAVE_RENDER_TARGET_0 = 675, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_OM_RENDER_TARGET_DOES_NOT_SUPPORT_BLENDING = 676, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_PS_OUTPUT_TYPE_MISMATCH = 677, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_OM_RENDER_TARGET_DOES_NOT_SUPPORT_LOGIC_OPS = 678, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_RENDERTARGETVIEW_NOT_SET = 679, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_DEPTHSTENCILVIEW_NOT_SET = 680, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_GS_INPUT_PRIMITIVE_MISMATCH = 681, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_POSITION_NOT_PRESENT = 682, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_MISSING_ROOT_SIGNATURE_FLAGS = 683, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_INDEX_BUFFER_PROPERTIES = 684, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_SAMPLE_DESC = 685, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HS_ROOT_SIGNATURE_MISMATCH = 686, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_DS_ROOT_SIGNATURE_MISMATCH = 687, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_VS_ROOT_SIGNATURE_MISMATCH = 688, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_GS_ROOT_SIGNATURE_MISMATCH = 689, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_PS_ROOT_SIGNATURE_MISMATCH = 690, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_MISSING_ROOT_SIGNATURE = 691, + D3D12_MESSAGE_ID_EXECUTE_BUNDLE_OPEN_BUNDLE = 692, + D3D12_MESSAGE_ID_EXECUTE_BUNDLE_DESCRIPTOR_HEAP_MISMATCH = 693, + D3D12_MESSAGE_ID_EXECUTE_BUNDLE_TYPE = 694, + D3D12_MESSAGE_ID_DRAW_EMPTY_SCISSOR_RECTANGLE = 695, + D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_BLOB_NOT_FOUND = 696, + D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_DESERIALIZE_FAILED = 697, + D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_INVALID_CONFIGURATION = 698, + D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_NOT_SUPPORTED_ON_DEVICE = 699, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_NULLRESOURCEPROPERTIES = 700, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_NULLHEAP = 701, + D3D12_MESSAGE_ID_GETRESOURCEALLOCATIONINFO_INVALIDRDESCS = 702, + D3D12_MESSAGE_ID_MAKERESIDENT_NULLOBJECTARRAY = 703, + D3D12_MESSAGE_ID_EVICT_NULLOBJECTARRAY = 705, + D3D12_MESSAGE_ID_SET_DESCRIPTOR_TABLE_INVALID = 708, + D3D12_MESSAGE_ID_SET_ROOT_CONSTANT_INVALID = 709, + D3D12_MESSAGE_ID_SET_ROOT_CONSTANT_BUFFER_VIEW_INVALID = 710, + D3D12_MESSAGE_ID_SET_ROOT_SHADER_RESOURCE_VIEW_INVALID = 711, + D3D12_MESSAGE_ID_SET_ROOT_UNORDERED_ACCESS_VIEW_INVALID = 712, + D3D12_MESSAGE_ID_SET_VERTEX_BUFFERS_INVALID_DESC = 713, + D3D12_MESSAGE_ID_SET_INDEX_BUFFER_INVALID_DESC = 715, + D3D12_MESSAGE_ID_SET_STREAM_OUTPUT_BUFFERS_INVALID_DESC = 717, + D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDDIMENSIONALITY = 718, + D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDLAYOUT = 719, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDDIMENSIONALITY = 720, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDALIGNMENT = 721, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDMIPLEVELS = 722, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDSAMPLEDESC = 723, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDLAYOUT = 724, + D3D12_MESSAGE_ID_SET_INDEX_BUFFER_INVALID = 725, + D3D12_MESSAGE_ID_SET_VERTEX_BUFFERS_INVALID = 726, + D3D12_MESSAGE_ID_SET_STREAM_OUTPUT_BUFFERS_INVALID = 727, + D3D12_MESSAGE_ID_SET_RENDER_TARGETS_INVALID = 728, + D3D12_MESSAGE_ID_CREATEQUERY_HEAP_INVALID_PARAMETERS = 729, + D3D12_MESSAGE_ID_BEGIN_END_QUERY_INVALID_PARAMETERS = 731, + D3D12_MESSAGE_ID_CLOSE_COMMAND_LIST_OPEN_QUERY = 732, + D3D12_MESSAGE_ID_RESOLVE_QUERY_DATA_INVALID_PARAMETERS = 733, + D3D12_MESSAGE_ID_SET_PREDICATION_INVALID_PARAMETERS = 734, + D3D12_MESSAGE_ID_TIMESTAMPS_NOT_SUPPORTED = 735, + D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDFORMAT = 737, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDFORMAT = 738, + D3D12_MESSAGE_ID_GETCOPYABLEFOOTPRINTS_INVALIDSUBRESOURCERANGE = 739, + D3D12_MESSAGE_ID_GETCOPYABLEFOOTPRINTS_INVALIDBASEOFFSET = 740, + D3D12_MESSAGE_ID_GETCOPYABLELAYOUT_INVALIDSUBRESOURCERANGE = 739, + D3D12_MESSAGE_ID_GETCOPYABLELAYOUT_INVALIDBASEOFFSET = 740, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_HEAP = 741, + D3D12_MESSAGE_ID_CREATE_SAMPLER_INVALID = 742, + D3D12_MESSAGE_ID_CREATECOMMANDSIGNATURE_INVALID = 743, + D3D12_MESSAGE_ID_EXECUTE_INDIRECT_INVALID_PARAMETERS = 744, + D3D12_MESSAGE_ID_GETGPUVIRTUALADDRESS_INVALID_RESOURCE_DIMENSION = 745, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDCLEARVALUE = 815, + D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDCLEARVALUEFORMAT = 816, + D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDCLEARVALUEFORMAT = 817, + D3D12_MESSAGE_ID_CREATERESOURCE_CLEARVALUEDENORMFLUSH = 818, + D3D12_MESSAGE_ID_CLEARRENDERTARGETVIEW_MISMATCHINGCLEARVALUE = 820, + D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_MISMATCHINGCLEARVALUE = 821, + D3D12_MESSAGE_ID_MAP_INVALIDHEAP = 822, + D3D12_MESSAGE_ID_UNMAP_INVALIDHEAP = 823, + D3D12_MESSAGE_ID_MAP_INVALIDRESOURCE = 824, + D3D12_MESSAGE_ID_UNMAP_INVALIDRESOURCE = 825, + D3D12_MESSAGE_ID_MAP_INVALIDSUBRESOURCE = 826, + D3D12_MESSAGE_ID_UNMAP_INVALIDSUBRESOURCE = 827, + D3D12_MESSAGE_ID_MAP_INVALIDRANGE = 828, + D3D12_MESSAGE_ID_UNMAP_INVALIDRANGE = 829, + D3D12_MESSAGE_ID_MAP_INVALIDDATAPOINTER = 832, + D3D12_MESSAGE_ID_MAP_INVALIDARG_RETURN = 833, + D3D12_MESSAGE_ID_MAP_OUTOFMEMORY_RETURN = 834, + D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_BUNDLENOTSUPPORTED = 835, + D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_COMMANDLISTMISMATCH = 836, + D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_OPENCOMMANDLIST = 837, + D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_FAILEDCOMMANDLIST = 838, + D3D12_MESSAGE_ID_COPYBUFFERREGION_NULLDST = 839, + D3D12_MESSAGE_ID_COPYBUFFERREGION_INVALIDDSTRESOURCEDIMENSION = 840, + D3D12_MESSAGE_ID_COPYBUFFERREGION_DSTRANGEOUTOFBOUNDS = 841, + D3D12_MESSAGE_ID_COPYBUFFERREGION_NULLSRC = 842, + D3D12_MESSAGE_ID_COPYBUFFERREGION_INVALIDSRCRESOURCEDIMENSION = 843, + D3D12_MESSAGE_ID_COPYBUFFERREGION_SRCRANGEOUTOFBOUNDS = 844, + D3D12_MESSAGE_ID_COPYBUFFERREGION_INVALIDCOPYFLAGS = 845, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_NULLDST = 846, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_UNRECOGNIZEDDSTTYPE = 847, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTRESOURCEDIMENSION = 848, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTRESOURCE = 849, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTSUBRESOURCE = 850, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTOFFSET = 851, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_UNRECOGNIZEDDSTFORMAT = 852, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTFORMAT = 853, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTDIMENSIONS = 854, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTROWPITCH = 855, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTPLACEMENT = 856, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTDSPLACEDFOOTPRINTFORMAT = 857, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_DSTREGIONOUTOFBOUNDS = 858, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_NULLSRC = 859, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_UNRECOGNIZEDSRCTYPE = 860, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCRESOURCEDIMENSION = 861, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCRESOURCE = 862, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCSUBRESOURCE = 863, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCOFFSET = 864, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_UNRECOGNIZEDSRCFORMAT = 865, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCFORMAT = 866, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCDIMENSIONS = 867, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCROWPITCH = 868, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCPLACEMENT = 869, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCDSPLACEDFOOTPRINTFORMAT = 870, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_SRCREGIONOUTOFBOUNDS = 871, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTCOORDINATES = 872, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCBOX = 873, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_FORMATMISMATCH = 874, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_EMPTYBOX = 875, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDCOPYFLAGS = 876, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALID_SUBRESOURCE_INDEX = 877, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALID_FORMAT = 878, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_RESOURCE_MISMATCH = 879, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALID_SAMPLE_COUNT = 880, + D3D12_MESSAGE_ID_CREATECOMPUTEPIPELINESTATE_INVALID_SHADER = 881, + D3D12_MESSAGE_ID_CREATECOMPUTEPIPELINESTATE_CS_ROOT_SIGNATURE_MISMATCH = 882, + D3D12_MESSAGE_ID_CREATECOMPUTEPIPELINESTATE_MISSING_ROOT_SIGNATURE = 883, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_INVALIDCACHEDBLOB = 884, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CACHEDBLOBADAPTERMISMATCH = 885, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CACHEDBLOBDRIVERVERSIONMISMATCH = 886, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CACHEDBLOBDESCMISMATCH = 887, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CACHEDBLOBIGNORED = 888, + D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_INVALIDHEAP = 889, + D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_INVALIDRESOURCE = 890, + D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_INVALIDBOX = 891, + D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_INVALIDSUBRESOURCE = 892, + D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_EMPTYBOX = 893, + D3D12_MESSAGE_ID_READFROMSUBRESOURCE_INVALIDHEAP = 894, + D3D12_MESSAGE_ID_READFROMSUBRESOURCE_INVALIDRESOURCE = 895, + D3D12_MESSAGE_ID_READFROMSUBRESOURCE_INVALIDBOX = 896, + D3D12_MESSAGE_ID_READFROMSUBRESOURCE_INVALIDSUBRESOURCE = 897, + D3D12_MESSAGE_ID_READFROMSUBRESOURCE_EMPTYBOX = 898, + D3D12_MESSAGE_ID_TOO_MANY_NODES_SPECIFIED = 899, + D3D12_MESSAGE_ID_INVALID_NODE_INDEX = 900, + D3D12_MESSAGE_ID_GETHEAPPROPERTIES_INVALIDRESOURCE = 901, + D3D12_MESSAGE_ID_NODE_MASK_MISMATCH = 902, + D3D12_MESSAGE_ID_COMMAND_LIST_OUTOFMEMORY = 903, + D3D12_MESSAGE_ID_COMMAND_LIST_MULTIPLE_SWAPCHAIN_BUFFER_REFERENCES = 904, + D3D12_MESSAGE_ID_COMMAND_LIST_TOO_MANY_SWAPCHAIN_REFERENCES = 905, + D3D12_MESSAGE_ID_COMMAND_QUEUE_TOO_MANY_SWAPCHAIN_REFERENCES = 906, + D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_WRONGSWAPCHAINBUFFERREFERENCE = 907, + D3D12_MESSAGE_ID_COMMAND_LIST_SETRENDERTARGETS_INVALIDNUMRENDERTARGETS = 908, + D3D12_MESSAGE_ID_CREATE_QUEUE_INVALID_TYPE = 909, + D3D12_MESSAGE_ID_CREATE_QUEUE_INVALID_FLAGS = 910, + D3D12_MESSAGE_ID_CREATESHAREDRESOURCE_INVALIDFLAGS = 911, + D3D12_MESSAGE_ID_CREATESHAREDRESOURCE_INVALIDFORMAT = 912, + D3D12_MESSAGE_ID_CREATESHAREDHEAP_INVALIDFLAGS = 913, + D3D12_MESSAGE_ID_REFLECTSHAREDPROPERTIES_UNRECOGNIZEDPROPERTIES = 914, + D3D12_MESSAGE_ID_REFLECTSHAREDPROPERTIES_INVALIDSIZE = 915, + D3D12_MESSAGE_ID_REFLECTSHAREDPROPERTIES_INVALIDOBJECT = 916, + D3D12_MESSAGE_ID_KEYEDMUTEX_INVALIDOBJECT = 917, + D3D12_MESSAGE_ID_KEYEDMUTEX_INVALIDKEY = 918, + D3D12_MESSAGE_ID_KEYEDMUTEX_WRONGSTATE = 919, + D3D12_MESSAGE_ID_CREATE_QUEUE_INVALID_PRIORITY = 920, + D3D12_MESSAGE_ID_OBJECT_DELETED_WHILE_STILL_IN_USE = 921, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_INVALID_FLAGS = 922, + D3D12_MESSAGE_ID_HEAP_ADDRESS_RANGE_HAS_NO_RESOURCE = 923, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_RENDER_TARGET_DELETED = 924, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_ALL_RENDER_TARGETS_HAVE_UNKNOWN_FORMAT = 925, + D3D12_MESSAGE_ID_HEAP_ADDRESS_RANGE_INTERSECTS_MULTIPLE_BUFFERS = 926, + D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_GPU_WRITTEN_READBACK_RESOURCE_MAPPED = 927, + D3D12_MESSAGE_ID_UNMAP_RANGE_NOT_EMPTY = 929, + D3D12_MESSAGE_ID_MAP_INVALID_NULLRANGE = 930, + D3D12_MESSAGE_ID_UNMAP_INVALID_NULLRANGE = 931, + D3D12_MESSAGE_ID_NO_GRAPHICS_API_SUPPORT = 932, + D3D12_MESSAGE_ID_NO_COMPUTE_API_SUPPORT = 933, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_RESOURCE_FLAGS_NOT_SUPPORTED = 934, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_ROOT_ARGUMENT_UNINITIALIZED = 935, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_DESCRIPTOR_HEAP_INDEX_OUT_OF_BOUNDS = 936, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_DESCRIPTOR_TABLE_REGISTER_INDEX_OUT_OF_BOUNDS = 937, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_DESCRIPTOR_UNINITIALIZED = 938, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_DESCRIPTOR_TYPE_MISMATCH = 939, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_SRV_RESOURCE_DIMENSION_MISMATCH = 940, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_UAV_RESOURCE_DIMENSION_MISMATCH = 941, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_INCOMPATIBLE_RESOURCE_STATE = 942, + D3D12_MESSAGE_ID_COPYRESOURCE_NULLDST = 943, + D3D12_MESSAGE_ID_COPYRESOURCE_INVALIDDSTRESOURCE = 944, + D3D12_MESSAGE_ID_COPYRESOURCE_NULLSRC = 945, + D3D12_MESSAGE_ID_COPYRESOURCE_INVALIDSRCRESOURCE = 946, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_NULLDST = 947, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALIDDSTRESOURCE = 948, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_NULLSRC = 949, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALIDSRCRESOURCE = 950, + D3D12_MESSAGE_ID_PIPELINE_STATE_TYPE_MISMATCH = 951, + D3D12_MESSAGE_ID_COMMAND_LIST_DISPATCH_ROOT_SIGNATURE_NOT_SET = 952, + D3D12_MESSAGE_ID_COMMAND_LIST_DISPATCH_ROOT_SIGNATURE_MISMATCH = 953, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_ZERO_BARRIERS = 954, + D3D12_MESSAGE_ID_BEGIN_END_EVENT_MISMATCH = 955, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_POSSIBLE_BEFORE_AFTER_MISMATCH = 956, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_MISMATCHING_BEGIN_END = 957, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_INVALID_RESOURCE = 958, + D3D12_MESSAGE_ID_USE_OF_ZERO_REFCOUNT_OBJECT = 959, + D3D12_MESSAGE_ID_OBJECT_EVICTED_WHILE_STILL_IN_USE = 960, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_ROOT_DESCRIPTOR_ACCESS_OUT_OF_BOUNDS = 961, + D3D12_MESSAGE_ID_CREATEPIPELINELIBRARY_INVALIDLIBRARYBLOB = 962, + D3D12_MESSAGE_ID_CREATEPIPELINELIBRARY_DRIVERVERSIONMISMATCH = 963, + D3D12_MESSAGE_ID_CREATEPIPELINELIBRARY_ADAPTERVERSIONMISMATCH = 964, + D3D12_MESSAGE_ID_CREATEPIPELINELIBRARY_UNSUPPORTED = 965, + D3D12_MESSAGE_ID_CREATE_PIPELINELIBRARY = 966, + D3D12_MESSAGE_ID_LIVE_PIPELINELIBRARY = 967, + D3D12_MESSAGE_ID_DESTROY_PIPELINELIBRARY = 968, + D3D12_MESSAGE_ID_STOREPIPELINE_NONAME = 969, + D3D12_MESSAGE_ID_STOREPIPELINE_DUPLICATENAME = 970, + D3D12_MESSAGE_ID_LOADPIPELINE_NAMENOTFOUND = 971, + D3D12_MESSAGE_ID_LOADPIPELINE_INVALIDDESC = 972, + D3D12_MESSAGE_ID_PIPELINELIBRARY_SERIALIZE_NOTENOUGHMEMORY = 973, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_PS_OUTPUT_RT_OUTPUT_MISMATCH = 974, + D3D12_MESSAGE_ID_SETEVENTONMULTIPLEFENCECOMPLETION_INVALIDFLAGS = 975, + D3D12_MESSAGE_ID_CREATE_QUEUE_VIDEO_NOT_SUPPORTED = 976, + D3D12_MESSAGE_ID_CREATE_COMMAND_ALLOCATOR_VIDEO_NOT_SUPPORTED = 977, + D3D12_MESSAGE_ID_CREATEQUERY_HEAP_VIDEO_DECODE_STATISTICS_NOT_SUPPORTED = 978, + D3D12_MESSAGE_ID_CREATE_VIDEODECODECOMMANDLIST = 979, + D3D12_MESSAGE_ID_CREATE_VIDEODECODER = 980, + D3D12_MESSAGE_ID_CREATE_VIDEODECODESTREAM = 981, + D3D12_MESSAGE_ID_LIVE_VIDEODECODECOMMANDLIST = 982, + D3D12_MESSAGE_ID_LIVE_VIDEODECODER = 983, + D3D12_MESSAGE_ID_LIVE_VIDEODECODESTREAM = 984, + D3D12_MESSAGE_ID_DESTROY_VIDEODECODECOMMANDLIST = 985, + D3D12_MESSAGE_ID_DESTROY_VIDEODECODER = 986, + D3D12_MESSAGE_ID_DESTROY_VIDEODECODESTREAM = 987, + D3D12_MESSAGE_ID_DECODE_FRAME_INVALID_PARAMETERS = 988, + D3D12_MESSAGE_ID_DEPRECATED_API = 989, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_MISMATCHING_COMMAND_LIST_TYPE = 990, + D3D12_MESSAGE_ID_COMMAND_LIST_DESCRIPTOR_TABLE_NOT_SET = 991, + D3D12_MESSAGE_ID_COMMAND_LIST_ROOT_CONSTANT_BUFFER_VIEW_NOT_SET = 992, + D3D12_MESSAGE_ID_COMMAND_LIST_ROOT_SHADER_RESOURCE_VIEW_NOT_SET = 993, + D3D12_MESSAGE_ID_COMMAND_LIST_ROOT_UNORDERED_ACCESS_VIEW_NOT_SET = 994, + D3D12_MESSAGE_ID_DISCARD_INVALID_SUBRESOURCE_RANGE = 995, + D3D12_MESSAGE_ID_DISCARD_ONE_SUBRESOURCE_FOR_MIPS_WITH_RECTS = 996, + D3D12_MESSAGE_ID_DISCARD_NO_RECTS_FOR_NON_TEXTURE2D = 997, + D3D12_MESSAGE_ID_COPY_ON_SAME_SUBRESOURCE = 998, + D3D12_MESSAGE_ID_SETRESIDENCYPRIORITY_INVALID_PAGEABLE = 999, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_UNSUPPORTED = 1000, + D3D12_MESSAGE_ID_STATIC_DESCRIPTOR_INVALID_DESCRIPTOR_CHANGE = 1001, + D3D12_MESSAGE_ID_DATA_STATIC_DESCRIPTOR_INVALID_DATA_CHANGE = 1002, + D3D12_MESSAGE_ID_DATA_STATIC_WHILE_SET_AT_EXECUTE_DESCRIPTOR_INVALID_DATA_CHANGE = 1003, + D3D12_MESSAGE_ID_EXECUTE_BUNDLE_STATIC_DESCRIPTOR_DATA_STATIC_NOT_SET = 1004, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_RESOURCE_ACCESS_OUT_OF_BOUNDS = 1005, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_SAMPLER_MODE_MISMATCH = 1006, + D3D12_MESSAGE_ID_CREATE_FENCE_INVALID_FLAGS = 1007, + D3D12_MESSAGE_ID_RESOURCE_BARRIER_DUPLICATE_SUBRESOURCE_TRANSITIONS = 1008, + D3D12_MESSAGE_ID_SETRESIDENCYPRIORITY_INVALID_PRIORITY = 1009, + D3D12_MESSAGE_ID_CREATE_DESCRIPTOR_HEAP_LARGE_NUM_DESCRIPTORS = 1013, + D3D12_MESSAGE_ID_BEGIN_EVENT = 1014, + D3D12_MESSAGE_ID_END_EVENT = 1015, + D3D12_MESSAGE_ID_CREATEDEVICE_DEBUG_LAYER_STARTUP_OPTIONS = 1016, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_DEPTHBOUNDSTEST_UNSUPPORTED = 1017, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_DUPLICATE_SUBOBJECT = 1018, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_UNKNOWN_SUBOBJECT = 1019, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_ZERO_SIZE_STREAM = 1020, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_INVALID_STREAM = 1021, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CANNOT_DEDUCE_TYPE = 1022, + D3D12_MESSAGE_ID_COMMAND_LIST_STATIC_DESCRIPTOR_RESOURCE_DIMENSION_MISMATCH = 1023, + D3D12_MESSAGE_ID_CREATE_COMMAND_QUEUE_INSUFFICIENT_PRIVILEGE_FOR_GLOBAL_REALTIME = 1024, + D3D12_MESSAGE_ID_CREATE_COMMAND_QUEUE_INSUFFICIENT_HARDWARE_SUPPORT_FOR_GLOBAL_REALTIME = 1025, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_ARCHITECTURE = 1026, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_NULL_DST = 1027, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_DST_RESOURCE_DIMENSION = 1028, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_DST_RANGE_OUT_OF_BOUNDS = 1029, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_NULL_SRC = 1030, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_SRC_RESOURCE_DIMENSION = 1031, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_SRC_RANGE_OUT_OF_BOUNDS = 1032, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_OFFSET_ALIGNMENT = 1033, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_NULL_DEPENDENT_RESOURCES = 1034, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_NULL_DEPENDENT_SUBRESOURCE_RANGES = 1035, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_DEPENDENT_RESOURCE = 1036, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_DEPENDENT_SUBRESOURCE_RANGE = 1037, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_DEPENDENT_SUBRESOURCE_OUT_OF_BOUNDS = 1038, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_DEPENDENT_RANGE_OUT_OF_BOUNDS = 1039, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_ZERO_DEPENDENCIES = 1040, + D3D12_MESSAGE_ID_DEVICE_CREATE_SHARED_HANDLE_INVALIDARG = 1041, + D3D12_MESSAGE_ID_DESCRIPTOR_HANDLE_WITH_INVALID_RESOURCE = 1042, + D3D12_MESSAGE_ID_SETDEPTHBOUNDS_INVALIDARGS = 1043, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_RESOURCE_STATE_IMPRECISE = 1044, + D3D12_MESSAGE_ID_COMMAND_LIST_PIPELINE_STATE_NOT_SET = 1045, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_MODEL_MISMATCH = 1046, + D3D12_MESSAGE_ID_OBJECT_ACCESSED_WHILE_STILL_IN_USE = 1047, + D3D12_MESSAGE_ID_PROGRAMMABLE_MSAA_UNSUPPORTED = 1048, + D3D12_MESSAGE_ID_SETSAMPLEPOSITIONS_INVALIDARGS = 1049, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCEREGION_INVALID_RECT = 1050, + D3D12_MESSAGE_ID_CREATE_VIDEODECODECOMMANDQUEUE = 1051, + D3D12_MESSAGE_ID_CREATE_VIDEOPROCESSCOMMANDLIST = 1052, + D3D12_MESSAGE_ID_CREATE_VIDEOPROCESSCOMMANDQUEUE = 1053, + D3D12_MESSAGE_ID_LIVE_VIDEODECODECOMMANDQUEUE = 1054, + D3D12_MESSAGE_ID_LIVE_VIDEOPROCESSCOMMANDLIST = 1055, + D3D12_MESSAGE_ID_LIVE_VIDEOPROCESSCOMMANDQUEUE = 1056, + D3D12_MESSAGE_ID_DESTROY_VIDEODECODECOMMANDQUEUE = 1057, + D3D12_MESSAGE_ID_DESTROY_VIDEOPROCESSCOMMANDLIST = 1058, + D3D12_MESSAGE_ID_DESTROY_VIDEOPROCESSCOMMANDQUEUE = 1059, + D3D12_MESSAGE_ID_CREATE_VIDEOPROCESSOR = 1060, + D3D12_MESSAGE_ID_CREATE_VIDEOPROCESSSTREAM = 1061, + D3D12_MESSAGE_ID_LIVE_VIDEOPROCESSOR = 1062, + D3D12_MESSAGE_ID_LIVE_VIDEOPROCESSSTREAM = 1063, + D3D12_MESSAGE_ID_DESTROY_VIDEOPROCESSOR = 1064, + D3D12_MESSAGE_ID_DESTROY_VIDEOPROCESSSTREAM = 1065, + D3D12_MESSAGE_ID_PROCESS_FRAME_INVALID_PARAMETERS = 1066, + D3D12_MESSAGE_ID_COPY_INVALIDLAYOUT = 1067, + D3D12_MESSAGE_ID_CREATE_CRYPTO_SESSION = 1068, + D3D12_MESSAGE_ID_CREATE_CRYPTO_SESSION_POLICY = 1069, + D3D12_MESSAGE_ID_CREATE_PROTECTED_RESOURCE_SESSION = 1070, + D3D12_MESSAGE_ID_LIVE_CRYPTO_SESSION = 1071, + D3D12_MESSAGE_ID_LIVE_CRYPTO_SESSION_POLICY = 1072, + D3D12_MESSAGE_ID_LIVE_PROTECTED_RESOURCE_SESSION = 1073, + D3D12_MESSAGE_ID_DESTROY_CRYPTO_SESSION = 1074, + D3D12_MESSAGE_ID_DESTROY_CRYPTO_SESSION_POLICY = 1075, + D3D12_MESSAGE_ID_DESTROY_PROTECTED_RESOURCE_SESSION = 1076, + D3D12_MESSAGE_ID_PROTECTED_RESOURCE_SESSION_UNSUPPORTED = 1077, + D3D12_MESSAGE_ID_FENCE_INVALIDOPERATION = 1078, + D3D12_MESSAGE_ID_CREATEQUERY_HEAP_COPY_QUEUE_TIMESTAMPS_NOT_SUPPORTED = 1079, + D3D12_MESSAGE_ID_SAMPLEPOSITIONS_MISMATCH_DEFERRED = 1080, + D3D12_MESSAGE_ID_SAMPLEPOSITIONS_MISMATCH_RECORDTIME_ASSUMEDFROMFIRSTUSE = 1081, + D3D12_MESSAGE_ID_SAMPLEPOSITIONS_MISMATCH_RECORDTIME_ASSUMEDFROMCLEAR = 1082, + D3D12_MESSAGE_ID_CREATE_VIDEODECODERHEAP = 1083, + D3D12_MESSAGE_ID_LIVE_VIDEODECODERHEAP = 1084, + D3D12_MESSAGE_ID_DESTROY_VIDEODECODERHEAP = 1085, + D3D12_MESSAGE_ID_OPENEXISTINGHEAP_INVALIDARG_RETURN = 1086, + D3D12_MESSAGE_ID_OPENEXISTINGHEAP_OUTOFMEMORY_RETURN = 1087, + D3D12_MESSAGE_ID_OPENEXISTINGHEAP_INVALIDADDRESS = 1088, + D3D12_MESSAGE_ID_OPENEXISTINGHEAP_INVALIDHANDLE = 1089, + D3D12_MESSAGE_ID_WRITEBUFFERIMMEDIATE_INVALID_DEST = 1090, + D3D12_MESSAGE_ID_WRITEBUFFERIMMEDIATE_INVALID_MODE = 1091, + D3D12_MESSAGE_ID_WRITEBUFFERIMMEDIATE_INVALID_ALIGNMENT = 1092, + D3D12_MESSAGE_ID_WRITEBUFFERIMMEDIATE_NOT_SUPPORTED = 1093, + D3D12_MESSAGE_ID_SETVIEWINSTANCEMASK_INVALIDARGS = 1094, + D3D12_MESSAGE_ID_VIEW_INSTANCING_UNSUPPORTED = 1095, + D3D12_MESSAGE_ID_VIEW_INSTANCING_INVALIDARGS = 1096, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_MISMATCH_DECODE_REFERENCE_ONLY_FLAG = 1097, + D3D12_MESSAGE_ID_COPYRESOURCE_MISMATCH_DECODE_REFERENCE_ONLY_FLAG = 1098, + D3D12_MESSAGE_ID_CREATE_VIDEO_DECODE_HEAP_CAPS_FAILURE = 1099, + D3D12_MESSAGE_ID_CREATE_VIDEO_DECODE_HEAP_CAPS_UNSUPPORTED = 1100, + D3D12_MESSAGE_ID_VIDEO_DECODE_SUPPORT_INVALID_INPUT = 1101, + D3D12_MESSAGE_ID_CREATE_VIDEO_DECODER_UNSUPPORTED = 1102, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_METADATA_ERROR = 1103, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_VIEW_INSTANCING_VERTEX_SIZE_EXCEEDED = 1104, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_RUNTIME_INTERNAL_ERROR = 1105, + D3D12_MESSAGE_ID_NO_VIDEO_API_SUPPORT = 1106, + D3D12_MESSAGE_ID_VIDEO_PROCESS_SUPPORT_INVALID_INPUT = 1107, + D3D12_MESSAGE_ID_CREATE_VIDEO_PROCESSOR_CAPS_FAILURE = 1108, + D3D12_MESSAGE_ID_VIDEO_PROCESS_SUPPORT_UNSUPPORTED_FORMAT = 1109, + D3D12_MESSAGE_ID_VIDEO_DECODE_FRAME_INVALID_ARGUMENT = 1110, + D3D12_MESSAGE_ID_ENQUEUE_MAKE_RESIDENT_INVALID_FLAGS = 1111, + D3D12_MESSAGE_ID_OPENEXISTINGHEAP_UNSUPPORTED = 1112, + D3D12_MESSAGE_ID_VIDEO_PROCESS_FRAMES_INVALID_ARGUMENT = 1113, + D3D12_MESSAGE_ID_VIDEO_DECODE_SUPPORT_UNSUPPORTED = 1114, + D3D12_MESSAGE_ID_CREATE_COMMANDRECORDER = 1115, + D3D12_MESSAGE_ID_LIVE_COMMANDRECORDER = 1116, + D3D12_MESSAGE_ID_DESTROY_COMMANDRECORDER = 1117, + D3D12_MESSAGE_ID_CREATE_COMMAND_RECORDER_VIDEO_NOT_SUPPORTED = 1118, + D3D12_MESSAGE_ID_CREATE_COMMAND_RECORDER_INVALID_SUPPORT_FLAGS = 1119, + D3D12_MESSAGE_ID_CREATE_COMMAND_RECORDER_INVALID_FLAGS = 1120, + D3D12_MESSAGE_ID_CREATE_COMMAND_RECORDER_MORE_RECORDERS_THAN_LOGICAL_PROCESSORS = 1121, + D3D12_MESSAGE_ID_CREATE_COMMANDPOOL = 1122, + D3D12_MESSAGE_ID_LIVE_COMMANDPOOL = 1123, + D3D12_MESSAGE_ID_DESTROY_COMMANDPOOL = 1124, + D3D12_MESSAGE_ID_CREATE_COMMAND_POOL_INVALID_FLAGS = 1125, + D3D12_MESSAGE_ID_CREATE_COMMAND_LIST_VIDEO_NOT_SUPPORTED = 1126, + D3D12_MESSAGE_ID_COMMAND_RECORDER_SUPPORT_FLAGS_MISMATCH = 1127, + D3D12_MESSAGE_ID_COMMAND_RECORDER_CONTENTION = 1128, + D3D12_MESSAGE_ID_COMMAND_RECORDER_USAGE_WITH_CREATECOMMANDLIST_COMMAND_LIST = 1129, + D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_USAGE_WITH_CREATECOMMANDLIST1_COMMAND_LIST = 1130, + D3D12_MESSAGE_ID_CANNOT_EXECUTE_EMPTY_COMMAND_LIST = 1131, + D3D12_MESSAGE_ID_CANNOT_RESET_COMMAND_POOL_WITH_OPEN_COMMAND_LISTS = 1132, + D3D12_MESSAGE_ID_CANNOT_USE_COMMAND_RECORDER_WITHOUT_CURRENT_TARGET = 1133, + D3D12_MESSAGE_ID_CANNOT_CHANGE_COMMAND_RECORDER_TARGET_WHILE_RECORDING = 1134, + D3D12_MESSAGE_ID_COMMAND_POOL_SYNC = 1135, + D3D12_MESSAGE_ID_EVICT_UNDERFLOW = 1136, + D3D12_MESSAGE_ID_CREATE_META_COMMAND = 1137, + D3D12_MESSAGE_ID_LIVE_META_COMMAND = 1138, + D3D12_MESSAGE_ID_DESTROY_META_COMMAND = 1139, + D3D12_MESSAGE_ID_COPYBUFFERREGION_INVALID_DST_RESOURCE = 1140, + D3D12_MESSAGE_ID_COPYBUFFERREGION_INVALID_SRC_RESOURCE = 1141, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_DST_RESOURCE = 1142, + D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_SRC_RESOURCE = 1143, + D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_NULL_BUFFER = 1144, + D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_NULL_RESOURCE_DESC = 1145, + D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_UNSUPPORTED = 1146, + D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_INVALID_BUFFER_DIMENSION = 1147, + D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_INVALID_BUFFER_FLAGS = 1148, + D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_INVALID_BUFFER_OFFSET = 1149, + D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_INVALID_RESOURCE_DIMENSION = 1150, + D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_INVALID_RESOURCE_FLAGS = 1151, + D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_OUTOFMEMORY_RETURN = 1152, + D3D12_MESSAGE_ID_CANNOT_CREATE_GRAPHICS_AND_VIDEO_COMMAND_RECORDER = 1153, + D3D12_MESSAGE_ID_UPDATETILEMAPPINGS_POSSIBLY_MISMATCHING_PROPERTIES = 1154, + D3D12_MESSAGE_ID_CREATE_COMMAND_LIST_INVALID_COMMAND_LIST_TYPE = 1155, + D3D12_MESSAGE_ID_CLEARUNORDEREDACCESSVIEW_INCOMPATIBLE_WITH_STRUCTURED_BUFFERS = 1156, + D3D12_MESSAGE_ID_COMPUTE_ONLY_DEVICE_OPERATION_UNSUPPORTED = 1157, + D3D12_MESSAGE_ID_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INVALID = 1158, + D3D12_MESSAGE_ID_EMIT_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_INVALID = 1159, + D3D12_MESSAGE_ID_COPY_RAYTRACING_ACCELERATION_STRUCTURE_INVALID = 1160, + D3D12_MESSAGE_ID_DISPATCH_RAYS_INVALID = 1161, + D3D12_MESSAGE_ID_GET_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO_INVALID = 1162, + D3D12_MESSAGE_ID_CREATE_LIFETIMETRACKER = 1163, + D3D12_MESSAGE_ID_LIVE_LIFETIMETRACKER = 1164, + D3D12_MESSAGE_ID_DESTROY_LIFETIMETRACKER = 1165, + D3D12_MESSAGE_ID_DESTROYOWNEDOBJECT_OBJECTNOTOWNED = 1166, + D3D12_MESSAGE_ID_CREATE_TRACKEDWORKLOAD = 1167, + D3D12_MESSAGE_ID_LIVE_TRACKEDWORKLOAD = 1168, + D3D12_MESSAGE_ID_DESTROY_TRACKEDWORKLOAD = 1169, + D3D12_MESSAGE_ID_RENDER_PASS_ERROR = 1170, + D3D12_MESSAGE_ID_META_COMMAND_ID_INVALID = 1171, + D3D12_MESSAGE_ID_META_COMMAND_UNSUPPORTED_PARAMS = 1172, + D3D12_MESSAGE_ID_META_COMMAND_FAILED_ENUMERATION = 1173, + D3D12_MESSAGE_ID_META_COMMAND_PARAMETER_SIZE_MISMATCH = 1174, + D3D12_MESSAGE_ID_UNINITIALIZED_META_COMMAND = 1175, + D3D12_MESSAGE_ID_META_COMMAND_INVALID_GPU_VIRTUAL_ADDRESS = 1176, + D3D12_MESSAGE_ID_CREATE_VIDEOENCODECOMMANDLIST = 1177, + D3D12_MESSAGE_ID_LIVE_VIDEOENCODECOMMANDLIST = 1178, + D3D12_MESSAGE_ID_DESTROY_VIDEOENCODECOMMANDLIST = 1179, + D3D12_MESSAGE_ID_CREATE_VIDEOENCODECOMMANDQUEUE = 1180, + D3D12_MESSAGE_ID_LIVE_VIDEOENCODECOMMANDQUEUE = 1181, + D3D12_MESSAGE_ID_DESTROY_VIDEOENCODECOMMANDQUEUE = 1182, + D3D12_MESSAGE_ID_CREATE_VIDEOMOTIONESTIMATOR = 1183, + D3D12_MESSAGE_ID_LIVE_VIDEOMOTIONESTIMATOR = 1184, + D3D12_MESSAGE_ID_DESTROY_VIDEOMOTIONESTIMATOR = 1185, + D3D12_MESSAGE_ID_CREATE_VIDEOMOTIONVECTORHEAP = 1186, + D3D12_MESSAGE_ID_LIVE_VIDEOMOTIONVECTORHEAP = 1187, + D3D12_MESSAGE_ID_DESTROY_VIDEOMOTIONVECTORHEAP = 1188, + D3D12_MESSAGE_ID_MULTIPLE_TRACKED_WORKLOADS = 1189, + D3D12_MESSAGE_ID_MULTIPLE_TRACKED_WORKLOAD_PAIRS = 1190, + D3D12_MESSAGE_ID_OUT_OF_ORDER_TRACKED_WORKLOAD_PAIR = 1191, + D3D12_MESSAGE_ID_CANNOT_ADD_TRACKED_WORKLOAD = 1192, + D3D12_MESSAGE_ID_INCOMPLETE_TRACKED_WORKLOAD_PAIR = 1193, + D3D12_MESSAGE_ID_CREATE_STATE_OBJECT_ERROR = 1194, + D3D12_MESSAGE_ID_GET_SHADER_IDENTIFIER_ERROR = 1195, + D3D12_MESSAGE_ID_GET_SHADER_STACK_SIZE_ERROR = 1196, + D3D12_MESSAGE_ID_GET_PIPELINE_STACK_SIZE_ERROR = 1197, + D3D12_MESSAGE_ID_SET_PIPELINE_STACK_SIZE_ERROR = 1198, + D3D12_MESSAGE_ID_GET_SHADER_IDENTIFIER_SIZE_INVALID = 1199, + D3D12_MESSAGE_ID_CHECK_DRIVER_MATCHING_IDENTIFIER_INVALID = 1200, + D3D12_MESSAGE_ID_CHECK_DRIVER_MATCHING_IDENTIFIER_DRIVER_REPORTED_ISSUE = 1201, + D3D12_MESSAGE_ID_RENDER_PASS_INVALID_RESOURCE_BARRIER = 1202, + D3D12_MESSAGE_ID_RENDER_PASS_DISALLOWED_API_CALLED = 1203, + D3D12_MESSAGE_ID_RENDER_PASS_CANNOT_NEST_RENDER_PASSES = 1204, + D3D12_MESSAGE_ID_RENDER_PASS_CANNOT_END_WITHOUT_BEGIN = 1205, + D3D12_MESSAGE_ID_RENDER_PASS_CANNOT_CLOSE_COMMAND_LIST = 1206, + D3D12_MESSAGE_ID_RENDER_PASS_GPU_WORK_WHILE_SUSPENDED = 1207, + D3D12_MESSAGE_ID_RENDER_PASS_MISMATCHING_SUSPEND_RESUME = 1208, + D3D12_MESSAGE_ID_RENDER_PASS_NO_PRIOR_SUSPEND_WITHIN_EXECUTECOMMANDLISTS = 1209, + D3D12_MESSAGE_ID_RENDER_PASS_NO_SUBSEQUENT_RESUME_WITHIN_EXECUTECOMMANDLISTS = 1210, + D3D12_MESSAGE_ID_TRACKED_WORKLOAD_COMMAND_QUEUE_MISMATCH = 1211, + D3D12_MESSAGE_ID_TRACKED_WORKLOAD_NOT_SUPPORTED = 1212, + D3D12_MESSAGE_ID_RENDER_PASS_MISMATCHING_NO_ACCESS = 1213, + D3D12_MESSAGE_ID_RENDER_PASS_UNSUPPORTED_RESOLVE = 1214, + D3D12_MESSAGE_ID_CLEARUNORDEREDACCESSVIEW_INVALID_RESOURCE_PTR = 1215, + D3D12_MESSAGE_ID_WINDOWS7_FENCE_OUTOFORDER_SIGNAL = 1216, + D3D12_MESSAGE_ID_WINDOWS7_FENCE_OUTOFORDER_WAIT = 1217, + D3D12_MESSAGE_ID_VIDEO_CREATE_MOTION_ESTIMATOR_INVALID_ARGUMENT = 1218, + D3D12_MESSAGE_ID_VIDEO_CREATE_MOTION_VECTOR_HEAP_INVALID_ARGUMENT = 1219, + D3D12_MESSAGE_ID_ESTIMATE_MOTION_INVALID_ARGUMENT = 1220, + D3D12_MESSAGE_ID_RESOLVE_MOTION_VECTOR_HEAP_INVALID_ARGUMENT = 1221, + D3D12_MESSAGE_ID_GETGPUVIRTUALADDRESS_INVALID_HEAP_TYPE = 1222, + D3D12_MESSAGE_ID_SET_BACKGROUND_PROCESSING_MODE_INVALID_ARGUMENT = 1223, + D3D12_MESSAGE_ID_CREATE_COMMAND_LIST_INVALID_COMMAND_LIST_TYPE_FOR_FEATURE_LEVEL = 1224, + D3D12_MESSAGE_ID_CREATE_VIDEOEXTENSIONCOMMAND = 1225, + D3D12_MESSAGE_ID_LIVE_VIDEOEXTENSIONCOMMAND = 1226, + D3D12_MESSAGE_ID_DESTROY_VIDEOEXTENSIONCOMMAND = 1227, + D3D12_MESSAGE_ID_INVALID_VIDEO_EXTENSION_COMMAND_ID = 1228, + D3D12_MESSAGE_ID_VIDEO_EXTENSION_COMMAND_INVALID_ARGUMENT = 1229, + D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_NOT_UNIQUE_IN_DXIL_LIBRARY = 1230, + D3D12_MESSAGE_ID_VARIABLE_SHADING_RATE_NOT_ALLOWED_WITH_TIR = 1231, + D3D12_MESSAGE_ID_GEOMETRY_SHADER_OUTPUTTING_BOTH_VIEWPORT_ARRAY_INDEX_AND_SHADING_RATE_NOT_SUPPORTED_ON_DEVICE = 1232, + D3D12_MESSAGE_ID_RSSETSHADING_RATE_INVALID_SHADING_RATE = 1233, + D3D12_MESSAGE_ID_RSSETSHADING_RATE_SHADING_RATE_NOT_PERMITTED_BY_CAP = 1234, + D3D12_MESSAGE_ID_RSSETSHADING_RATE_INVALID_COMBINER = 1235, + D3D12_MESSAGE_ID_RSSETSHADINGRATEIMAGE_REQUIRES_TIER_2 = 1236, + D3D12_MESSAGE_ID_RSSETSHADINGRATE_REQUIRES_TIER_1 = 1237, + D3D12_MESSAGE_ID_SHADING_RATE_IMAGE_INCORRECT_FORMAT = 1238, + D3D12_MESSAGE_ID_SHADING_RATE_IMAGE_INCORRECT_ARRAY_SIZE = 1239, + D3D12_MESSAGE_ID_SHADING_RATE_IMAGE_INCORRECT_MIP_LEVEL = 1240, + D3D12_MESSAGE_ID_SHADING_RATE_IMAGE_INCORRECT_SAMPLE_COUNT = 1241, + D3D12_MESSAGE_ID_SHADING_RATE_IMAGE_INCORRECT_SAMPLE_QUALITY = 1242, + D3D12_MESSAGE_ID_NON_RETAIL_SHADER_MODEL_WONT_VALIDATE = 1243, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_AS_ROOT_SIGNATURE_MISMATCH = 1244, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_MS_ROOT_SIGNATURE_MISMATCH = 1245, + D3D12_MESSAGE_ID_ADD_TO_STATE_OBJECT_ERROR = 1246, + D3D12_MESSAGE_ID_CREATE_PROTECTED_RESOURCE_SESSION_INVALID_ARGUMENT = 1247, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_MS_PSO_DESC_MISMATCH = 1248, + D3D12_MESSAGE_ID_CREATEPIPELINESTATE_MS_INCOMPLETE_TYPE = 1249, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_AS_NOT_MS_MISMATCH = 1250, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_MS_NOT_PS_MISMATCH = 1251, + D3D12_MESSAGE_ID_NONZERO_SAMPLER_FEEDBACK_MIP_REGION_WITH_INCOMPATIBLE_FORMAT = 1252, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INPUTLAYOUT_SHADER_MISMATCH = 1253, + D3D12_MESSAGE_ID_EMPTY_DISPATCH = 1254, + D3D12_MESSAGE_ID_RESOURCE_FORMAT_REQUIRES_SAMPLER_FEEDBACK_CAPABILITY = 1255, + D3D12_MESSAGE_ID_SAMPLER_FEEDBACK_MAP_INVALID_MIP_REGION = 1256, + D3D12_MESSAGE_ID_SAMPLER_FEEDBACK_MAP_INVALID_DIMENSION = 1257, + D3D12_MESSAGE_ID_SAMPLER_FEEDBACK_MAP_INVALID_SAMPLE_COUNT = 1258, + D3D12_MESSAGE_ID_SAMPLER_FEEDBACK_MAP_INVALID_SAMPLE_QUALITY = 1259, + D3D12_MESSAGE_ID_SAMPLER_FEEDBACK_MAP_INVALID_LAYOUT = 1260, + D3D12_MESSAGE_ID_SAMPLER_FEEDBACK_MAP_REQUIRES_UNORDERED_ACCESS_FLAG = 1261, + D3D12_MESSAGE_ID_SAMPLER_FEEDBACK_CREATE_UAV_NULL_ARGUMENTS = 1262, + D3D12_MESSAGE_ID_SAMPLER_FEEDBACK_UAV_REQUIRES_SAMPLER_FEEDBACK_CAPABILITY = 1263, + D3D12_MESSAGE_ID_SAMPLER_FEEDBACK_CREATE_UAV_REQUIRES_FEEDBACK_MAP_FORMAT = 1264, + D3D12_MESSAGE_ID_CREATEMESHSHADER_INVALIDSHADERBYTECODE = 1265, + D3D12_MESSAGE_ID_CREATEMESHSHADER_OUTOFMEMORY = 1266, + D3D12_MESSAGE_ID_CREATEMESHSHADERWITHSTREAMOUTPUT_INVALIDSHADERTYPE = 1267, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_SAMPLER_FEEDBACK_TRANSCODE_INVALID_FORMAT = 1268, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_SAMPLER_FEEDBACK_INVALID_MIP_LEVEL_COUNT = 1269, + D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_SAMPLER_FEEDBACK_TRANSCODE_ARRAY_SIZE_MISMATCH = 1270, + D3D12_MESSAGE_ID_SAMPLER_FEEDBACK_CREATE_UAV_MISMATCHING_TARGETED_RESOURCE = 1271, + D3D12_MESSAGE_ID_CREATEMESHSHADER_OUTPUTEXCEEDSMAXSIZE = 1272, + D3D12_MESSAGE_ID_CREATEMESHSHADER_GROUPSHAREDEXCEEDSMAXSIZE = 1273, + D3D12_MESSAGE_ID_VERTEX_SHADER_OUTPUTTING_BOTH_VIEWPORT_ARRAY_INDEX_AND_SHADING_RATE_NOT_SUPPORTED_ON_DEVICE = 1274, + D3D12_MESSAGE_ID_MESH_SHADER_OUTPUTTING_BOTH_VIEWPORT_ARRAY_INDEX_AND_SHADING_RATE_NOT_SUPPORTED_ON_DEVICE = 1275, + D3D12_MESSAGE_ID_CREATEMESHSHADER_MISMATCHEDASMSPAYLOADSIZE = 1276, + D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_UNBOUNDED_STATIC_DESCRIPTORS = 1277, + D3D12_MESSAGE_ID_CREATEAMPLIFICATIONSHADER_INVALIDSHADERBYTECODE = 1278, + D3D12_MESSAGE_ID_CREATEAMPLIFICATIONSHADER_OUTOFMEMORY = 1279, + D3D12_MESSAGE_ID_CREATE_SHADERCACHESESSION = 1280, + D3D12_MESSAGE_ID_LIVE_SHADERCACHESESSION = 1281, + D3D12_MESSAGE_ID_DESTROY_SHADERCACHESESSION = 1282, + D3D12_MESSAGE_ID_CREATESHADERCACHESESSION_INVALIDARGS = 1283, + D3D12_MESSAGE_ID_CREATESHADERCACHESESSION_DISABLED = 1284, + D3D12_MESSAGE_ID_CREATESHADERCACHESESSION_ALREADYOPEN = 1285, + D3D12_MESSAGE_ID_SHADERCACHECONTROL_DEVELOPERMODE = 1286, + D3D12_MESSAGE_ID_SHADERCACHECONTROL_INVALIDFLAGS = 1287, + D3D12_MESSAGE_ID_SHADERCACHECONTROL_STATEALREADYSET = 1288, + D3D12_MESSAGE_ID_SHADERCACHECONTROL_IGNOREDFLAG = 1289, + D3D12_MESSAGE_ID_SHADERCACHESESSION_STOREVALUE_ALREADYPRESENT = 1290, + D3D12_MESSAGE_ID_SHADERCACHESESSION_STOREVALUE_HASHCOLLISION = 1291, + D3D12_MESSAGE_ID_SHADERCACHESESSION_STOREVALUE_CACHEFULL = 1292, + D3D12_MESSAGE_ID_SHADERCACHESESSION_FINDVALUE_NOTFOUND = 1293, + D3D12_MESSAGE_ID_SHADERCACHESESSION_CORRUPT = 1294, + D3D12_MESSAGE_ID_SHADERCACHESESSION_DISABLED = 1295, + D3D12_MESSAGE_ID_OVERSIZED_DISPATCH = 1296, + D3D12_MESSAGE_ID_CREATE_VIDEOENCODER = 1297, + D3D12_MESSAGE_ID_LIVE_VIDEOENCODER = 1298, + D3D12_MESSAGE_ID_DESTROY_VIDEOENCODER = 1299, + D3D12_MESSAGE_ID_CREATE_VIDEOENCODERHEAP = 1300, + D3D12_MESSAGE_ID_LIVE_VIDEOENCODERHEAP = 1301, + D3D12_MESSAGE_ID_DESTROY_VIDEOENCODERHEAP = 1302, + D3D12_MESSAGE_ID_COPYTEXTUREREGION_MISMATCH_ENCODE_REFERENCE_ONLY_FLAG = 1303, + D3D12_MESSAGE_ID_COPYRESOURCE_MISMATCH_ENCODE_REFERENCE_ONLY_FLAG = 1304, + D3D12_MESSAGE_ID_ENCODE_FRAME_INVALID_PARAMETERS = 1305, + D3D12_MESSAGE_ID_ENCODE_FRAME_UNSUPPORTED_PARAMETERS = 1306, + D3D12_MESSAGE_ID_RESOLVE_ENCODER_OUTPUT_METADATA_INVALID_PARAMETERS = 1307, + D3D12_MESSAGE_ID_RESOLVE_ENCODER_OUTPUT_METADATA_UNSUPPORTED_PARAMETERS = 1308, + D3D12_MESSAGE_ID_CREATE_VIDEO_ENCODER_INVALID_PARAMETERS = 1309, + D3D12_MESSAGE_ID_CREATE_VIDEO_ENCODER_UNSUPPORTED_PARAMETERS = 1310, + D3D12_MESSAGE_ID_CREATE_VIDEO_ENCODER_HEAP_INVALID_PARAMETERS = 1311, + D3D12_MESSAGE_ID_CREATE_VIDEO_ENCODER_HEAP_UNSUPPORTED_PARAMETERS = 1312, + D3D12_MESSAGE_ID_CREATECOMMANDLIST_NULL_COMMANDALLOCATOR = 1313, + D3D12_MESSAGE_ID_CLEAR_UNORDERED_ACCESS_VIEW_INVALID_DESCRIPTOR_HANDLE = 1314, + D3D12_MESSAGE_ID_DESCRIPTOR_HEAP_NOT_SHADER_VISIBLE = 1315, + D3D12_MESSAGE_ID_CREATEBLENDSTATE_BLENDOP_WARNING = 1316, + D3D12_MESSAGE_ID_CREATEBLENDSTATE_BLENDOPALPHA_WARNING = 1317, + D3D12_MESSAGE_ID_WRITE_COMBINE_PERFORMANCE_WARNING = 1318, + D3D12_MESSAGE_ID_RESOLVE_QUERY_INVALID_QUERY_STATE = 1319, + D3D12_MESSAGE_ID_SETPRIVATEDATA_NO_ACCESS = 1320, + D3D12_MESSAGE_ID_COMMAND_LIST_STATIC_DESCRIPTOR_SAMPLER_MODE_MISMATCH = 1321, + D3D12_MESSAGE_ID_GETCOPYABLEFOOTPRINTS_UNSUPPORTED_BUFFER_WIDTH = 1322, + D3D12_MESSAGE_ID_CREATEMESHSHADER_TOPOLOGY_MISMATCH = 1323, + D3D12_MESSAGE_ID_VRS_SUM_COMBINER_REQUIRES_CAPABILITY = 1324, + D3D12_MESSAGE_ID_SETTING_SHADING_RATE_FROM_MS_REQUIRES_CAPABILITY = 1325, + D3D12_MESSAGE_ID_SHADERCACHESESSION_SHADERCACHEDELETE_NOTSUPPORTED = 1326, + D3D12_MESSAGE_ID_SHADERCACHECONTROL_SHADERCACHECLEAR_NOTSUPPORTED = 1327, + D3D12_MESSAGE_ID_CREATERESOURCE_STATE_IGNORED = 1328, + D3D12_MESSAGE_ID_UNUSED_CROSS_EXECUTE_SPLIT_BARRIER = 1329, + D3D12_MESSAGE_ID_DEVICE_OPEN_SHARED_HANDLE_ACCESS_DENIED = 1330, + D3D12_MESSAGE_ID_INCOMPATIBLE_BARRIER_VALUES = 1331, + D3D12_MESSAGE_ID_INCOMPATIBLE_BARRIER_ACCESS = 1332, + D3D12_MESSAGE_ID_INCOMPATIBLE_BARRIER_SYNC = 1333, + D3D12_MESSAGE_ID_INCOMPATIBLE_BARRIER_LAYOUT = 1334, + D3D12_MESSAGE_ID_INCOMPATIBLE_BARRIER_TYPE = 1335, + D3D12_MESSAGE_ID_OUT_OF_BOUNDS_BARRIER_SUBRESOURCE_RANGE = 1336, + D3D12_MESSAGE_ID_INCOMPATIBLE_BARRIER_RESOURCE_DIMENSION = 1337, + D3D12_MESSAGE_ID_SET_SCISSOR_RECTS_INVALID_RECT = 1338, + D3D12_MESSAGE_ID_SHADING_RATE_SOURCE_REQUIRES_DIMENSION_TEXTURE2D = 1339, + D3D12_MESSAGE_ID_BUFFER_BARRIER_SUBREGION_OUT_OF_BOUNDS = 1340, + D3D12_MESSAGE_ID_UNSUPPORTED_BARRIER_LAYOUT = 1341, + D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_INVALID_PARAMETERS = 1342, + D3D12_MESSAGE_ID_ENHANCED_BARRIERS_NOT_SUPPORTED = 1343, + D3D12_MESSAGE_ID_CAST_TARGET_TEXEL_SIZE_MISMATCH = 1344, + D3D12_MESSAGE_ID_CAST_TO_PLANAR_NOT_SUPORTED = 1345, + D3D12_MESSAGE_ID_LEGACY_BARRIER_VALIDATION_FORCED_ON = 1346, + D3D12_MESSAGE_ID_EMPTY_ROOT_DESCRIPTOR_TABLE = 1347, + D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_ELEMENT_OFFSET_UNALIGNED = 1348, + D3D12_MESSAGE_ID_ALPHA_BLEND_FACTOR_NOT_SUPPORTED = 1349, + D3D12_MESSAGE_ID_BARRIER_INTEROP_INVALID_LAYOUT = 1350, + D3D12_MESSAGE_ID_BARRIER_INTEROP_INVALID_STATE = 1351, + D3D12_MESSAGE_ID_GRAPHICS_PIPELINE_STATE_DESC_ZERO_SAMPLE_MASK = 1352, + D3D12_MESSAGE_ID_INDEPENDENT_STENCIL_REF_NOT_SUPPORTED = 1353, + D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INDEPENDENT_MASKS_UNSUPPORTED = 1354, + D3D12_MESSAGE_ID_TEXTURE_BARRIER_SUBRESOURCES_OUT_OF_BOUNDS = 1355, + D3D12_MESSAGE_ID_NON_OPTIMAL_BARRIER_ONLY_EXECUTE_COMMAND_LISTS = 1356, + D3D12_MESSAGE_ID_EXECUTE_INDIRECT_ZERO_COMMAND_COUNT = 1357, + D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_INCOMPATIBLE_TEXTURE_LAYOUT = 1358, + D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_DYNAMIC_INDEX_BUFFER_STRIP_CUT_NOT_SUPPORTED = 1359, + D3D12_MESSAGE_ID_PRIMITIVE_TOPOLOGY_TRIANGLE_FANS_NOT_SUPPORTED = 1360, + D3D12_MESSAGE_ID_CREATE_SAMPLER_COMPARISON_FUNC_IGNORED = 1361, + D3D12_MESSAGE_ID_D3D12_MESSAGES_END = ( D3D12_MESSAGE_ID_CREATE_SAMPLER_COMPARISON_FUNC_IGNORED + 1 ) + } D3D12_MESSAGE_ID; + +typedef struct D3D12_MESSAGE + { + D3D12_MESSAGE_CATEGORY Category; + D3D12_MESSAGE_SEVERITY Severity; + D3D12_MESSAGE_ID ID; + _Field_size_(DescriptionByteLength) const char *pDescription; + SIZE_T DescriptionByteLength; + } D3D12_MESSAGE; + +typedef struct D3D12_INFO_QUEUE_FILTER_DESC + { + UINT NumCategories; + _Field_size_(NumCategories) D3D12_MESSAGE_CATEGORY *pCategoryList; + UINT NumSeverities; + _Field_size_(NumSeverities) D3D12_MESSAGE_SEVERITY *pSeverityList; + UINT NumIDs; + _Field_size_(NumIDs) D3D12_MESSAGE_ID *pIDList; + } D3D12_INFO_QUEUE_FILTER_DESC; + +typedef struct D3D12_INFO_QUEUE_FILTER + { + D3D12_INFO_QUEUE_FILTER_DESC AllowList; + D3D12_INFO_QUEUE_FILTER_DESC DenyList; + } D3D12_INFO_QUEUE_FILTER; + +#define D3D12_INFO_QUEUE_DEFAULT_MESSAGE_COUNT_LIMIT 1024 + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0017_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0017_v0_0_s_ifspec; + +#ifndef __ID3D12InfoQueue_INTERFACE_DEFINED__ +#define __ID3D12InfoQueue_INTERFACE_DEFINED__ + +/* interface ID3D12InfoQueue */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12InfoQueue; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("0742a90b-c387-483f-b946-30a7e4e61458") + ID3D12InfoQueue : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE SetMessageCountLimit( + _In_ UINT64 MessageCountLimit) = 0; + + virtual void STDMETHODCALLTYPE ClearStoredMessages( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetMessage( + _In_ UINT64 MessageIndex, + _Out_writes_bytes_opt_(*pMessageByteLength) D3D12_MESSAGE *pMessage, + _Inout_ SIZE_T *pMessageByteLength) = 0; + + virtual UINT64 STDMETHODCALLTYPE GetNumMessagesAllowedByStorageFilter( void) = 0; + + virtual UINT64 STDMETHODCALLTYPE GetNumMessagesDeniedByStorageFilter( void) = 0; + + virtual UINT64 STDMETHODCALLTYPE GetNumStoredMessages( void) = 0; + + virtual UINT64 STDMETHODCALLTYPE GetNumStoredMessagesAllowedByRetrievalFilter( void) = 0; + + virtual UINT64 STDMETHODCALLTYPE GetNumMessagesDiscardedByMessageCountLimit( void) = 0; + + virtual UINT64 STDMETHODCALLTYPE GetMessageCountLimit( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE AddStorageFilterEntries( + _In_ D3D12_INFO_QUEUE_FILTER *pFilter) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetStorageFilter( + _Out_writes_bytes_opt_(*pFilterByteLength) D3D12_INFO_QUEUE_FILTER *pFilter, + _Inout_ SIZE_T *pFilterByteLength) = 0; + + virtual void STDMETHODCALLTYPE ClearStorageFilter( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE PushEmptyStorageFilter( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE PushCopyOfStorageFilter( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE PushStorageFilter( + _In_ D3D12_INFO_QUEUE_FILTER *pFilter) = 0; + + virtual void STDMETHODCALLTYPE PopStorageFilter( void) = 0; + + virtual UINT STDMETHODCALLTYPE GetStorageFilterStackSize( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE AddRetrievalFilterEntries( + _In_ D3D12_INFO_QUEUE_FILTER *pFilter) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetRetrievalFilter( + _Out_writes_bytes_opt_(*pFilterByteLength) D3D12_INFO_QUEUE_FILTER *pFilter, + _Inout_ SIZE_T *pFilterByteLength) = 0; + + virtual void STDMETHODCALLTYPE ClearRetrievalFilter( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE PushEmptyRetrievalFilter( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE PushCopyOfRetrievalFilter( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE PushRetrievalFilter( + _In_ D3D12_INFO_QUEUE_FILTER *pFilter) = 0; + + virtual void STDMETHODCALLTYPE PopRetrievalFilter( void) = 0; + + virtual UINT STDMETHODCALLTYPE GetRetrievalFilterStackSize( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE AddMessage( + _In_ D3D12_MESSAGE_CATEGORY Category, + _In_ D3D12_MESSAGE_SEVERITY Severity, + _In_ D3D12_MESSAGE_ID ID, + _In_ LPCSTR pDescription) = 0; + + virtual HRESULT STDMETHODCALLTYPE AddApplicationMessage( + _In_ D3D12_MESSAGE_SEVERITY Severity, + _In_ LPCSTR pDescription) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetBreakOnCategory( + _In_ D3D12_MESSAGE_CATEGORY Category, + _In_ BOOL bEnable) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetBreakOnSeverity( + _In_ D3D12_MESSAGE_SEVERITY Severity, + _In_ BOOL bEnable) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetBreakOnID( + _In_ D3D12_MESSAGE_ID ID, + _In_ BOOL bEnable) = 0; + + virtual BOOL STDMETHODCALLTYPE GetBreakOnCategory( + _In_ D3D12_MESSAGE_CATEGORY Category) = 0; + + virtual BOOL STDMETHODCALLTYPE GetBreakOnSeverity( + _In_ D3D12_MESSAGE_SEVERITY Severity) = 0; + + virtual BOOL STDMETHODCALLTYPE GetBreakOnID( + _In_ D3D12_MESSAGE_ID ID) = 0; + + virtual void STDMETHODCALLTYPE SetMuteDebugOutput( + _In_ BOOL bMute) = 0; + + virtual BOOL STDMETHODCALLTYPE GetMuteDebugOutput( void) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12InfoQueueVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12InfoQueue * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12InfoQueue * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12InfoQueue * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, SetMessageCountLimit) + HRESULT ( STDMETHODCALLTYPE *SetMessageCountLimit )( + ID3D12InfoQueue * This, + _In_ UINT64 MessageCountLimit); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, ClearStoredMessages) + void ( STDMETHODCALLTYPE *ClearStoredMessages )( + ID3D12InfoQueue * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetMessage) + HRESULT ( STDMETHODCALLTYPE *GetMessage )( + ID3D12InfoQueue * This, + _In_ UINT64 MessageIndex, + _Out_writes_bytes_opt_(*pMessageByteLength) D3D12_MESSAGE *pMessage, + _Inout_ SIZE_T *pMessageByteLength); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetNumMessagesAllowedByStorageFilter) + UINT64 ( STDMETHODCALLTYPE *GetNumMessagesAllowedByStorageFilter )( + ID3D12InfoQueue * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetNumMessagesDeniedByStorageFilter) + UINT64 ( STDMETHODCALLTYPE *GetNumMessagesDeniedByStorageFilter )( + ID3D12InfoQueue * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetNumStoredMessages) + UINT64 ( STDMETHODCALLTYPE *GetNumStoredMessages )( + ID3D12InfoQueue * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetNumStoredMessagesAllowedByRetrievalFilter) + UINT64 ( STDMETHODCALLTYPE *GetNumStoredMessagesAllowedByRetrievalFilter )( + ID3D12InfoQueue * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetNumMessagesDiscardedByMessageCountLimit) + UINT64 ( STDMETHODCALLTYPE *GetNumMessagesDiscardedByMessageCountLimit )( + ID3D12InfoQueue * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetMessageCountLimit) + UINT64 ( STDMETHODCALLTYPE *GetMessageCountLimit )( + ID3D12InfoQueue * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, AddStorageFilterEntries) + HRESULT ( STDMETHODCALLTYPE *AddStorageFilterEntries )( + ID3D12InfoQueue * This, + _In_ D3D12_INFO_QUEUE_FILTER *pFilter); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetStorageFilter) + HRESULT ( STDMETHODCALLTYPE *GetStorageFilter )( + ID3D12InfoQueue * This, + _Out_writes_bytes_opt_(*pFilterByteLength) D3D12_INFO_QUEUE_FILTER *pFilter, + _Inout_ SIZE_T *pFilterByteLength); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, ClearStorageFilter) + void ( STDMETHODCALLTYPE *ClearStorageFilter )( + ID3D12InfoQueue * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, PushEmptyStorageFilter) + HRESULT ( STDMETHODCALLTYPE *PushEmptyStorageFilter )( + ID3D12InfoQueue * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, PushCopyOfStorageFilter) + HRESULT ( STDMETHODCALLTYPE *PushCopyOfStorageFilter )( + ID3D12InfoQueue * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, PushStorageFilter) + HRESULT ( STDMETHODCALLTYPE *PushStorageFilter )( + ID3D12InfoQueue * This, + _In_ D3D12_INFO_QUEUE_FILTER *pFilter); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, PopStorageFilter) + void ( STDMETHODCALLTYPE *PopStorageFilter )( + ID3D12InfoQueue * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetStorageFilterStackSize) + UINT ( STDMETHODCALLTYPE *GetStorageFilterStackSize )( + ID3D12InfoQueue * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, AddRetrievalFilterEntries) + HRESULT ( STDMETHODCALLTYPE *AddRetrievalFilterEntries )( + ID3D12InfoQueue * This, + _In_ D3D12_INFO_QUEUE_FILTER *pFilter); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetRetrievalFilter) + HRESULT ( STDMETHODCALLTYPE *GetRetrievalFilter )( + ID3D12InfoQueue * This, + _Out_writes_bytes_opt_(*pFilterByteLength) D3D12_INFO_QUEUE_FILTER *pFilter, + _Inout_ SIZE_T *pFilterByteLength); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, ClearRetrievalFilter) + void ( STDMETHODCALLTYPE *ClearRetrievalFilter )( + ID3D12InfoQueue * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, PushEmptyRetrievalFilter) + HRESULT ( STDMETHODCALLTYPE *PushEmptyRetrievalFilter )( + ID3D12InfoQueue * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, PushCopyOfRetrievalFilter) + HRESULT ( STDMETHODCALLTYPE *PushCopyOfRetrievalFilter )( + ID3D12InfoQueue * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, PushRetrievalFilter) + HRESULT ( STDMETHODCALLTYPE *PushRetrievalFilter )( + ID3D12InfoQueue * This, + _In_ D3D12_INFO_QUEUE_FILTER *pFilter); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, PopRetrievalFilter) + void ( STDMETHODCALLTYPE *PopRetrievalFilter )( + ID3D12InfoQueue * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetRetrievalFilterStackSize) + UINT ( STDMETHODCALLTYPE *GetRetrievalFilterStackSize )( + ID3D12InfoQueue * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, AddMessage) + HRESULT ( STDMETHODCALLTYPE *AddMessage )( + ID3D12InfoQueue * This, + _In_ D3D12_MESSAGE_CATEGORY Category, + _In_ D3D12_MESSAGE_SEVERITY Severity, + _In_ D3D12_MESSAGE_ID ID, + _In_ LPCSTR pDescription); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, AddApplicationMessage) + HRESULT ( STDMETHODCALLTYPE *AddApplicationMessage )( + ID3D12InfoQueue * This, + _In_ D3D12_MESSAGE_SEVERITY Severity, + _In_ LPCSTR pDescription); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, SetBreakOnCategory) + HRESULT ( STDMETHODCALLTYPE *SetBreakOnCategory )( + ID3D12InfoQueue * This, + _In_ D3D12_MESSAGE_CATEGORY Category, + _In_ BOOL bEnable); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, SetBreakOnSeverity) + HRESULT ( STDMETHODCALLTYPE *SetBreakOnSeverity )( + ID3D12InfoQueue * This, + _In_ D3D12_MESSAGE_SEVERITY Severity, + _In_ BOOL bEnable); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, SetBreakOnID) + HRESULT ( STDMETHODCALLTYPE *SetBreakOnID )( + ID3D12InfoQueue * This, + _In_ D3D12_MESSAGE_ID ID, + _In_ BOOL bEnable); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetBreakOnCategory) + BOOL ( STDMETHODCALLTYPE *GetBreakOnCategory )( + ID3D12InfoQueue * This, + _In_ D3D12_MESSAGE_CATEGORY Category); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetBreakOnSeverity) + BOOL ( STDMETHODCALLTYPE *GetBreakOnSeverity )( + ID3D12InfoQueue * This, + _In_ D3D12_MESSAGE_SEVERITY Severity); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetBreakOnID) + BOOL ( STDMETHODCALLTYPE *GetBreakOnID )( + ID3D12InfoQueue * This, + _In_ D3D12_MESSAGE_ID ID); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, SetMuteDebugOutput) + void ( STDMETHODCALLTYPE *SetMuteDebugOutput )( + ID3D12InfoQueue * This, + _In_ BOOL bMute); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetMuteDebugOutput) + BOOL ( STDMETHODCALLTYPE *GetMuteDebugOutput )( + ID3D12InfoQueue * This); + + END_INTERFACE + } ID3D12InfoQueueVtbl; + + interface ID3D12InfoQueue + { + CONST_VTBL struct ID3D12InfoQueueVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12InfoQueue_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12InfoQueue_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12InfoQueue_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12InfoQueue_SetMessageCountLimit(This,MessageCountLimit) \ + ( (This)->lpVtbl -> SetMessageCountLimit(This,MessageCountLimit) ) + +#define ID3D12InfoQueue_ClearStoredMessages(This) \ + ( (This)->lpVtbl -> ClearStoredMessages(This) ) + +#define ID3D12InfoQueue_GetMessage(This,MessageIndex,pMessage,pMessageByteLength) \ + ( (This)->lpVtbl -> GetMessage(This,MessageIndex,pMessage,pMessageByteLength) ) + +#define ID3D12InfoQueue_GetNumMessagesAllowedByStorageFilter(This) \ + ( (This)->lpVtbl -> GetNumMessagesAllowedByStorageFilter(This) ) + +#define ID3D12InfoQueue_GetNumMessagesDeniedByStorageFilter(This) \ + ( (This)->lpVtbl -> GetNumMessagesDeniedByStorageFilter(This) ) + +#define ID3D12InfoQueue_GetNumStoredMessages(This) \ + ( (This)->lpVtbl -> GetNumStoredMessages(This) ) + +#define ID3D12InfoQueue_GetNumStoredMessagesAllowedByRetrievalFilter(This) \ + ( (This)->lpVtbl -> GetNumStoredMessagesAllowedByRetrievalFilter(This) ) + +#define ID3D12InfoQueue_GetNumMessagesDiscardedByMessageCountLimit(This) \ + ( (This)->lpVtbl -> GetNumMessagesDiscardedByMessageCountLimit(This) ) + +#define ID3D12InfoQueue_GetMessageCountLimit(This) \ + ( (This)->lpVtbl -> GetMessageCountLimit(This) ) + +#define ID3D12InfoQueue_AddStorageFilterEntries(This,pFilter) \ + ( (This)->lpVtbl -> AddStorageFilterEntries(This,pFilter) ) + +#define ID3D12InfoQueue_GetStorageFilter(This,pFilter,pFilterByteLength) \ + ( (This)->lpVtbl -> GetStorageFilter(This,pFilter,pFilterByteLength) ) + +#define ID3D12InfoQueue_ClearStorageFilter(This) \ + ( (This)->lpVtbl -> ClearStorageFilter(This) ) + +#define ID3D12InfoQueue_PushEmptyStorageFilter(This) \ + ( (This)->lpVtbl -> PushEmptyStorageFilter(This) ) + +#define ID3D12InfoQueue_PushCopyOfStorageFilter(This) \ + ( (This)->lpVtbl -> PushCopyOfStorageFilter(This) ) + +#define ID3D12InfoQueue_PushStorageFilter(This,pFilter) \ + ( (This)->lpVtbl -> PushStorageFilter(This,pFilter) ) + +#define ID3D12InfoQueue_PopStorageFilter(This) \ + ( (This)->lpVtbl -> PopStorageFilter(This) ) + +#define ID3D12InfoQueue_GetStorageFilterStackSize(This) \ + ( (This)->lpVtbl -> GetStorageFilterStackSize(This) ) + +#define ID3D12InfoQueue_AddRetrievalFilterEntries(This,pFilter) \ + ( (This)->lpVtbl -> AddRetrievalFilterEntries(This,pFilter) ) + +#define ID3D12InfoQueue_GetRetrievalFilter(This,pFilter,pFilterByteLength) \ + ( (This)->lpVtbl -> GetRetrievalFilter(This,pFilter,pFilterByteLength) ) + +#define ID3D12InfoQueue_ClearRetrievalFilter(This) \ + ( (This)->lpVtbl -> ClearRetrievalFilter(This) ) + +#define ID3D12InfoQueue_PushEmptyRetrievalFilter(This) \ + ( (This)->lpVtbl -> PushEmptyRetrievalFilter(This) ) + +#define ID3D12InfoQueue_PushCopyOfRetrievalFilter(This) \ + ( (This)->lpVtbl -> PushCopyOfRetrievalFilter(This) ) + +#define ID3D12InfoQueue_PushRetrievalFilter(This,pFilter) \ + ( (This)->lpVtbl -> PushRetrievalFilter(This,pFilter) ) + +#define ID3D12InfoQueue_PopRetrievalFilter(This) \ + ( (This)->lpVtbl -> PopRetrievalFilter(This) ) + +#define ID3D12InfoQueue_GetRetrievalFilterStackSize(This) \ + ( (This)->lpVtbl -> GetRetrievalFilterStackSize(This) ) + +#define ID3D12InfoQueue_AddMessage(This,Category,Severity,ID,pDescription) \ + ( (This)->lpVtbl -> AddMessage(This,Category,Severity,ID,pDescription) ) + +#define ID3D12InfoQueue_AddApplicationMessage(This,Severity,pDescription) \ + ( (This)->lpVtbl -> AddApplicationMessage(This,Severity,pDescription) ) + +#define ID3D12InfoQueue_SetBreakOnCategory(This,Category,bEnable) \ + ( (This)->lpVtbl -> SetBreakOnCategory(This,Category,bEnable) ) + +#define ID3D12InfoQueue_SetBreakOnSeverity(This,Severity,bEnable) \ + ( (This)->lpVtbl -> SetBreakOnSeverity(This,Severity,bEnable) ) + +#define ID3D12InfoQueue_SetBreakOnID(This,ID,bEnable) \ + ( (This)->lpVtbl -> SetBreakOnID(This,ID,bEnable) ) + +#define ID3D12InfoQueue_GetBreakOnCategory(This,Category) \ + ( (This)->lpVtbl -> GetBreakOnCategory(This,Category) ) + +#define ID3D12InfoQueue_GetBreakOnSeverity(This,Severity) \ + ( (This)->lpVtbl -> GetBreakOnSeverity(This,Severity) ) + +#define ID3D12InfoQueue_GetBreakOnID(This,ID) \ + ( (This)->lpVtbl -> GetBreakOnID(This,ID) ) + +#define ID3D12InfoQueue_SetMuteDebugOutput(This,bMute) \ + ( (This)->lpVtbl -> SetMuteDebugOutput(This,bMute) ) + +#define ID3D12InfoQueue_GetMuteDebugOutput(This) \ + ( (This)->lpVtbl -> GetMuteDebugOutput(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12InfoQueue_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12sdklayers_0000_0018 */ +/* [local] */ + +typedef +enum D3D12_MESSAGE_CALLBACK_FLAGS + { + D3D12_MESSAGE_CALLBACK_FLAG_NONE = 0, + D3D12_MESSAGE_CALLBACK_IGNORE_FILTERS = 0x1 + } D3D12_MESSAGE_CALLBACK_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_MESSAGE_CALLBACK_FLAGS) +typedef void ( __stdcall *D3D12MessageFunc )( + D3D12_MESSAGE_CATEGORY Category, + D3D12_MESSAGE_SEVERITY Severity, + D3D12_MESSAGE_ID ID, + LPCSTR pDescription, + void *pContext); + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0018_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0018_v0_0_s_ifspec; + +#ifndef __ID3D12InfoQueue1_INTERFACE_DEFINED__ +#define __ID3D12InfoQueue1_INTERFACE_DEFINED__ + +/* interface ID3D12InfoQueue1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12InfoQueue1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("2852dd88-b484-4c0c-b6b1-67168500e600") + ID3D12InfoQueue1 : public ID3D12InfoQueue + { + public: + virtual HRESULT STDMETHODCALLTYPE RegisterMessageCallback( + _In_ D3D12MessageFunc CallbackFunc, + _In_ D3D12_MESSAGE_CALLBACK_FLAGS CallbackFilterFlags, + _In_ void *pContext, + _Inout_ DWORD *pCallbackCookie) = 0; + + virtual HRESULT STDMETHODCALLTYPE UnregisterMessageCallback( + _In_ DWORD CallbackCookie) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12InfoQueue1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12InfoQueue1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12InfoQueue1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12InfoQueue1 * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, SetMessageCountLimit) + HRESULT ( STDMETHODCALLTYPE *SetMessageCountLimit )( + ID3D12InfoQueue1 * This, + _In_ UINT64 MessageCountLimit); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, ClearStoredMessages) + void ( STDMETHODCALLTYPE *ClearStoredMessages )( + ID3D12InfoQueue1 * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetMessage) + HRESULT ( STDMETHODCALLTYPE *GetMessage )( + ID3D12InfoQueue1 * This, + _In_ UINT64 MessageIndex, + _Out_writes_bytes_opt_(*pMessageByteLength) D3D12_MESSAGE *pMessage, + _Inout_ SIZE_T *pMessageByteLength); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetNumMessagesAllowedByStorageFilter) + UINT64 ( STDMETHODCALLTYPE *GetNumMessagesAllowedByStorageFilter )( + ID3D12InfoQueue1 * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetNumMessagesDeniedByStorageFilter) + UINT64 ( STDMETHODCALLTYPE *GetNumMessagesDeniedByStorageFilter )( + ID3D12InfoQueue1 * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetNumStoredMessages) + UINT64 ( STDMETHODCALLTYPE *GetNumStoredMessages )( + ID3D12InfoQueue1 * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetNumStoredMessagesAllowedByRetrievalFilter) + UINT64 ( STDMETHODCALLTYPE *GetNumStoredMessagesAllowedByRetrievalFilter )( + ID3D12InfoQueue1 * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetNumMessagesDiscardedByMessageCountLimit) + UINT64 ( STDMETHODCALLTYPE *GetNumMessagesDiscardedByMessageCountLimit )( + ID3D12InfoQueue1 * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetMessageCountLimit) + UINT64 ( STDMETHODCALLTYPE *GetMessageCountLimit )( + ID3D12InfoQueue1 * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, AddStorageFilterEntries) + HRESULT ( STDMETHODCALLTYPE *AddStorageFilterEntries )( + ID3D12InfoQueue1 * This, + _In_ D3D12_INFO_QUEUE_FILTER *pFilter); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetStorageFilter) + HRESULT ( STDMETHODCALLTYPE *GetStorageFilter )( + ID3D12InfoQueue1 * This, + _Out_writes_bytes_opt_(*pFilterByteLength) D3D12_INFO_QUEUE_FILTER *pFilter, + _Inout_ SIZE_T *pFilterByteLength); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, ClearStorageFilter) + void ( STDMETHODCALLTYPE *ClearStorageFilter )( + ID3D12InfoQueue1 * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, PushEmptyStorageFilter) + HRESULT ( STDMETHODCALLTYPE *PushEmptyStorageFilter )( + ID3D12InfoQueue1 * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, PushCopyOfStorageFilter) + HRESULT ( STDMETHODCALLTYPE *PushCopyOfStorageFilter )( + ID3D12InfoQueue1 * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, PushStorageFilter) + HRESULT ( STDMETHODCALLTYPE *PushStorageFilter )( + ID3D12InfoQueue1 * This, + _In_ D3D12_INFO_QUEUE_FILTER *pFilter); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, PopStorageFilter) + void ( STDMETHODCALLTYPE *PopStorageFilter )( + ID3D12InfoQueue1 * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetStorageFilterStackSize) + UINT ( STDMETHODCALLTYPE *GetStorageFilterStackSize )( + ID3D12InfoQueue1 * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, AddRetrievalFilterEntries) + HRESULT ( STDMETHODCALLTYPE *AddRetrievalFilterEntries )( + ID3D12InfoQueue1 * This, + _In_ D3D12_INFO_QUEUE_FILTER *pFilter); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetRetrievalFilter) + HRESULT ( STDMETHODCALLTYPE *GetRetrievalFilter )( + ID3D12InfoQueue1 * This, + _Out_writes_bytes_opt_(*pFilterByteLength) D3D12_INFO_QUEUE_FILTER *pFilter, + _Inout_ SIZE_T *pFilterByteLength); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, ClearRetrievalFilter) + void ( STDMETHODCALLTYPE *ClearRetrievalFilter )( + ID3D12InfoQueue1 * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, PushEmptyRetrievalFilter) + HRESULT ( STDMETHODCALLTYPE *PushEmptyRetrievalFilter )( + ID3D12InfoQueue1 * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, PushCopyOfRetrievalFilter) + HRESULT ( STDMETHODCALLTYPE *PushCopyOfRetrievalFilter )( + ID3D12InfoQueue1 * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, PushRetrievalFilter) + HRESULT ( STDMETHODCALLTYPE *PushRetrievalFilter )( + ID3D12InfoQueue1 * This, + _In_ D3D12_INFO_QUEUE_FILTER *pFilter); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, PopRetrievalFilter) + void ( STDMETHODCALLTYPE *PopRetrievalFilter )( + ID3D12InfoQueue1 * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetRetrievalFilterStackSize) + UINT ( STDMETHODCALLTYPE *GetRetrievalFilterStackSize )( + ID3D12InfoQueue1 * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, AddMessage) + HRESULT ( STDMETHODCALLTYPE *AddMessage )( + ID3D12InfoQueue1 * This, + _In_ D3D12_MESSAGE_CATEGORY Category, + _In_ D3D12_MESSAGE_SEVERITY Severity, + _In_ D3D12_MESSAGE_ID ID, + _In_ LPCSTR pDescription); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, AddApplicationMessage) + HRESULT ( STDMETHODCALLTYPE *AddApplicationMessage )( + ID3D12InfoQueue1 * This, + _In_ D3D12_MESSAGE_SEVERITY Severity, + _In_ LPCSTR pDescription); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, SetBreakOnCategory) + HRESULT ( STDMETHODCALLTYPE *SetBreakOnCategory )( + ID3D12InfoQueue1 * This, + _In_ D3D12_MESSAGE_CATEGORY Category, + _In_ BOOL bEnable); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, SetBreakOnSeverity) + HRESULT ( STDMETHODCALLTYPE *SetBreakOnSeverity )( + ID3D12InfoQueue1 * This, + _In_ D3D12_MESSAGE_SEVERITY Severity, + _In_ BOOL bEnable); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, SetBreakOnID) + HRESULT ( STDMETHODCALLTYPE *SetBreakOnID )( + ID3D12InfoQueue1 * This, + _In_ D3D12_MESSAGE_ID ID, + _In_ BOOL bEnable); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetBreakOnCategory) + BOOL ( STDMETHODCALLTYPE *GetBreakOnCategory )( + ID3D12InfoQueue1 * This, + _In_ D3D12_MESSAGE_CATEGORY Category); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetBreakOnSeverity) + BOOL ( STDMETHODCALLTYPE *GetBreakOnSeverity )( + ID3D12InfoQueue1 * This, + _In_ D3D12_MESSAGE_SEVERITY Severity); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetBreakOnID) + BOOL ( STDMETHODCALLTYPE *GetBreakOnID )( + ID3D12InfoQueue1 * This, + _In_ D3D12_MESSAGE_ID ID); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, SetMuteDebugOutput) + void ( STDMETHODCALLTYPE *SetMuteDebugOutput )( + ID3D12InfoQueue1 * This, + _In_ BOOL bMute); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetMuteDebugOutput) + BOOL ( STDMETHODCALLTYPE *GetMuteDebugOutput )( + ID3D12InfoQueue1 * This); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue1, RegisterMessageCallback) + HRESULT ( STDMETHODCALLTYPE *RegisterMessageCallback )( + ID3D12InfoQueue1 * This, + _In_ D3D12MessageFunc CallbackFunc, + _In_ D3D12_MESSAGE_CALLBACK_FLAGS CallbackFilterFlags, + _In_ void *pContext, + _Inout_ DWORD *pCallbackCookie); + + DECLSPEC_XFGVIRT(ID3D12InfoQueue1, UnregisterMessageCallback) + HRESULT ( STDMETHODCALLTYPE *UnregisterMessageCallback )( + ID3D12InfoQueue1 * This, + _In_ DWORD CallbackCookie); + + END_INTERFACE + } ID3D12InfoQueue1Vtbl; + + interface ID3D12InfoQueue1 + { + CONST_VTBL struct ID3D12InfoQueue1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12InfoQueue1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12InfoQueue1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12InfoQueue1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12InfoQueue1_SetMessageCountLimit(This,MessageCountLimit) \ + ( (This)->lpVtbl -> SetMessageCountLimit(This,MessageCountLimit) ) + +#define ID3D12InfoQueue1_ClearStoredMessages(This) \ + ( (This)->lpVtbl -> ClearStoredMessages(This) ) + +#define ID3D12InfoQueue1_GetMessage(This,MessageIndex,pMessage,pMessageByteLength) \ + ( (This)->lpVtbl -> GetMessage(This,MessageIndex,pMessage,pMessageByteLength) ) + +#define ID3D12InfoQueue1_GetNumMessagesAllowedByStorageFilter(This) \ + ( (This)->lpVtbl -> GetNumMessagesAllowedByStorageFilter(This) ) + +#define ID3D12InfoQueue1_GetNumMessagesDeniedByStorageFilter(This) \ + ( (This)->lpVtbl -> GetNumMessagesDeniedByStorageFilter(This) ) + +#define ID3D12InfoQueue1_GetNumStoredMessages(This) \ + ( (This)->lpVtbl -> GetNumStoredMessages(This) ) + +#define ID3D12InfoQueue1_GetNumStoredMessagesAllowedByRetrievalFilter(This) \ + ( (This)->lpVtbl -> GetNumStoredMessagesAllowedByRetrievalFilter(This) ) + +#define ID3D12InfoQueue1_GetNumMessagesDiscardedByMessageCountLimit(This) \ + ( (This)->lpVtbl -> GetNumMessagesDiscardedByMessageCountLimit(This) ) + +#define ID3D12InfoQueue1_GetMessageCountLimit(This) \ + ( (This)->lpVtbl -> GetMessageCountLimit(This) ) + +#define ID3D12InfoQueue1_AddStorageFilterEntries(This,pFilter) \ + ( (This)->lpVtbl -> AddStorageFilterEntries(This,pFilter) ) + +#define ID3D12InfoQueue1_GetStorageFilter(This,pFilter,pFilterByteLength) \ + ( (This)->lpVtbl -> GetStorageFilter(This,pFilter,pFilterByteLength) ) + +#define ID3D12InfoQueue1_ClearStorageFilter(This) \ + ( (This)->lpVtbl -> ClearStorageFilter(This) ) + +#define ID3D12InfoQueue1_PushEmptyStorageFilter(This) \ + ( (This)->lpVtbl -> PushEmptyStorageFilter(This) ) + +#define ID3D12InfoQueue1_PushCopyOfStorageFilter(This) \ + ( (This)->lpVtbl -> PushCopyOfStorageFilter(This) ) + +#define ID3D12InfoQueue1_PushStorageFilter(This,pFilter) \ + ( (This)->lpVtbl -> PushStorageFilter(This,pFilter) ) + +#define ID3D12InfoQueue1_PopStorageFilter(This) \ + ( (This)->lpVtbl -> PopStorageFilter(This) ) + +#define ID3D12InfoQueue1_GetStorageFilterStackSize(This) \ + ( (This)->lpVtbl -> GetStorageFilterStackSize(This) ) + +#define ID3D12InfoQueue1_AddRetrievalFilterEntries(This,pFilter) \ + ( (This)->lpVtbl -> AddRetrievalFilterEntries(This,pFilter) ) + +#define ID3D12InfoQueue1_GetRetrievalFilter(This,pFilter,pFilterByteLength) \ + ( (This)->lpVtbl -> GetRetrievalFilter(This,pFilter,pFilterByteLength) ) + +#define ID3D12InfoQueue1_ClearRetrievalFilter(This) \ + ( (This)->lpVtbl -> ClearRetrievalFilter(This) ) + +#define ID3D12InfoQueue1_PushEmptyRetrievalFilter(This) \ + ( (This)->lpVtbl -> PushEmptyRetrievalFilter(This) ) + +#define ID3D12InfoQueue1_PushCopyOfRetrievalFilter(This) \ + ( (This)->lpVtbl -> PushCopyOfRetrievalFilter(This) ) + +#define ID3D12InfoQueue1_PushRetrievalFilter(This,pFilter) \ + ( (This)->lpVtbl -> PushRetrievalFilter(This,pFilter) ) + +#define ID3D12InfoQueue1_PopRetrievalFilter(This) \ + ( (This)->lpVtbl -> PopRetrievalFilter(This) ) + +#define ID3D12InfoQueue1_GetRetrievalFilterStackSize(This) \ + ( (This)->lpVtbl -> GetRetrievalFilterStackSize(This) ) + +#define ID3D12InfoQueue1_AddMessage(This,Category,Severity,ID,pDescription) \ + ( (This)->lpVtbl -> AddMessage(This,Category,Severity,ID,pDescription) ) + +#define ID3D12InfoQueue1_AddApplicationMessage(This,Severity,pDescription) \ + ( (This)->lpVtbl -> AddApplicationMessage(This,Severity,pDescription) ) + +#define ID3D12InfoQueue1_SetBreakOnCategory(This,Category,bEnable) \ + ( (This)->lpVtbl -> SetBreakOnCategory(This,Category,bEnable) ) + +#define ID3D12InfoQueue1_SetBreakOnSeverity(This,Severity,bEnable) \ + ( (This)->lpVtbl -> SetBreakOnSeverity(This,Severity,bEnable) ) + +#define ID3D12InfoQueue1_SetBreakOnID(This,ID,bEnable) \ + ( (This)->lpVtbl -> SetBreakOnID(This,ID,bEnable) ) + +#define ID3D12InfoQueue1_GetBreakOnCategory(This,Category) \ + ( (This)->lpVtbl -> GetBreakOnCategory(This,Category) ) + +#define ID3D12InfoQueue1_GetBreakOnSeverity(This,Severity) \ + ( (This)->lpVtbl -> GetBreakOnSeverity(This,Severity) ) + +#define ID3D12InfoQueue1_GetBreakOnID(This,ID) \ + ( (This)->lpVtbl -> GetBreakOnID(This,ID) ) + +#define ID3D12InfoQueue1_SetMuteDebugOutput(This,bMute) \ + ( (This)->lpVtbl -> SetMuteDebugOutput(This,bMute) ) + +#define ID3D12InfoQueue1_GetMuteDebugOutput(This) \ + ( (This)->lpVtbl -> GetMuteDebugOutput(This) ) + + +#define ID3D12InfoQueue1_RegisterMessageCallback(This,CallbackFunc,CallbackFilterFlags,pContext,pCallbackCookie) \ + ( (This)->lpVtbl -> RegisterMessageCallback(This,CallbackFunc,CallbackFilterFlags,pContext,pCallbackCookie) ) + +#define ID3D12InfoQueue1_UnregisterMessageCallback(This,CallbackCookie) \ + ( (This)->lpVtbl -> UnregisterMessageCallback(This,CallbackCookie) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12InfoQueue1_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12sdklayers_0000_0019 */ +/* [local] */ + +#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES) */ +#pragma endregion +DEFINE_GUID(IID_ID3D12Debug,0x344488b7,0x6846,0x474b,0xb9,0x89,0xf0,0x27,0x44,0x82,0x45,0xe0); +DEFINE_GUID(IID_ID3D12Debug1,0xaffaa4ca,0x63fe,0x4d8e,0xb8,0xad,0x15,0x90,0x00,0xaf,0x43,0x04); +DEFINE_GUID(IID_ID3D12Debug2,0x93a665c4,0xa3b2,0x4e5d,0xb6,0x92,0xa2,0x6a,0xe1,0x4e,0x33,0x74); +DEFINE_GUID(IID_ID3D12Debug3,0x5cf4e58f,0xf671,0x4ff1,0xa5,0x42,0x36,0x86,0xe3,0xd1,0x53,0xd1); +DEFINE_GUID(IID_ID3D12Debug4,0x014b816e,0x9ec5,0x4a2f,0xa8,0x45,0xff,0xbe,0x44,0x1c,0xe1,0x3a); +DEFINE_GUID(IID_ID3D12Debug5,0x548d6b12,0x09fa,0x40e0,0x90,0x69,0x5d,0xcd,0x58,0x9a,0x52,0xc9); +DEFINE_GUID(IID_ID3D12Debug6,0x82a816d6,0x5d01,0x4157,0x97,0xd0,0x49,0x75,0x46,0x3f,0xd1,0xed); +DEFINE_GUID(IID_ID3D12DebugDevice1,0xa9b71770,0xd099,0x4a65,0xa6,0x98,0x3d,0xee,0x10,0x02,0x0f,0x88); +DEFINE_GUID(IID_ID3D12DebugDevice,0x3febd6dd,0x4973,0x4787,0x81,0x94,0xe4,0x5f,0x9e,0x28,0x92,0x3e); +DEFINE_GUID(IID_ID3D12DebugDevice2,0x60eccbc1,0x378d,0x4df1,0x89,0x4c,0xf8,0xac,0x5c,0xe4,0xd7,0xdd); +DEFINE_GUID(IID_ID3D12DebugCommandQueue,0x09e0bf36,0x54ac,0x484f,0x88,0x47,0x4b,0xae,0xea,0xb6,0x05,0x3a); +DEFINE_GUID(IID_ID3D12DebugCommandQueue1,0x16be35a2,0xbfd6,0x49f2,0xbc,0xae,0xea,0xae,0x4a,0xff,0x86,0x2d); +DEFINE_GUID(IID_ID3D12DebugCommandList1,0x102ca951,0x311b,0x4b01,0xb1,0x1f,0xec,0xb8,0x3e,0x06,0x1b,0x37); +DEFINE_GUID(IID_ID3D12DebugCommandList,0x09e0bf36,0x54ac,0x484f,0x88,0x47,0x4b,0xae,0xea,0xb6,0x05,0x3f); +DEFINE_GUID(IID_ID3D12DebugCommandList2,0xaeb575cf,0x4e06,0x48be,0xba,0x3b,0xc4,0x50,0xfc,0x96,0x65,0x2e); +DEFINE_GUID(IID_ID3D12DebugCommandList3,0x197d5e15,0x4d37,0x4d34,0xaf,0x78,0x72,0x4c,0xd7,0x0f,0xdb,0x1f); +DEFINE_GUID(IID_ID3D12SharingContract,0x0adf7d52,0x929c,0x4e61,0xad,0xdb,0xff,0xed,0x30,0xde,0x66,0xef); +DEFINE_GUID(IID_ID3D12InfoQueue,0x0742a90b,0xc387,0x483f,0xb9,0x46,0x30,0xa7,0xe4,0xe6,0x14,0x58); +DEFINE_GUID(IID_ID3D12InfoQueue1,0x2852dd88,0xb484,0x4c0c,0xb6,0xb1,0x67,0x16,0x85,0x00,0xe6,0x00); + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0019_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0019_v0_0_s_ifspec; + +/* Additional Prototypes for ALL interfaces */ + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/thirdparty/directx_headers/d3d12shader.h b/thirdparty/directx_headers/d3d12shader.h new file mode 100644 index 0000000000..0acf584e32 --- /dev/null +++ b/thirdparty/directx_headers/d3d12shader.h @@ -0,0 +1,490 @@ +////////////////////////////////////////////////////////////////////////////// +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. +// +// File: D3D12Shader.h +// Content: D3D12 Shader Types and APIs +// +////////////////////////////////////////////////////////////////////////////// + +#ifndef __D3D12SHADER_H__ +#define __D3D12SHADER_H__ + +#include "d3dcommon.h" + +typedef enum D3D12_SHADER_VERSION_TYPE +{ + D3D12_SHVER_PIXEL_SHADER = 0, + D3D12_SHVER_VERTEX_SHADER = 1, + D3D12_SHVER_GEOMETRY_SHADER = 2, + + // D3D11 Shaders + D3D12_SHVER_HULL_SHADER = 3, + D3D12_SHVER_DOMAIN_SHADER = 4, + D3D12_SHVER_COMPUTE_SHADER = 5, + + // D3D12 Shaders + D3D12_SHVER_LIBRARY = 6, + + D3D12_SHVER_RAY_GENERATION_SHADER = 7, + D3D12_SHVER_INTERSECTION_SHADER = 8, + D3D12_SHVER_ANY_HIT_SHADER = 9, + D3D12_SHVER_CLOSEST_HIT_SHADER = 10, + D3D12_SHVER_MISS_SHADER = 11, + D3D12_SHVER_CALLABLE_SHADER = 12, + + D3D12_SHVER_MESH_SHADER = 13, + D3D12_SHVER_AMPLIFICATION_SHADER = 14, + + D3D12_SHVER_RESERVED0 = 0xFFF0, +} D3D12_SHADER_VERSION_TYPE; + +#define D3D12_SHVER_GET_TYPE(_Version) \ + (((_Version) >> 16) & 0xffff) +#define D3D12_SHVER_GET_MAJOR(_Version) \ + (((_Version) >> 4) & 0xf) +#define D3D12_SHVER_GET_MINOR(_Version) \ + (((_Version) >> 0) & 0xf) + +// Slot ID for library function return +#define D3D_RETURN_PARAMETER_INDEX (-1) + +typedef D3D_RESOURCE_RETURN_TYPE D3D12_RESOURCE_RETURN_TYPE; + +typedef D3D_CBUFFER_TYPE D3D12_CBUFFER_TYPE; + + +typedef struct _D3D12_SIGNATURE_PARAMETER_DESC +{ + LPCSTR SemanticName; // Name of the semantic + UINT SemanticIndex; // Index of the semantic + UINT Register; // Number of member variables + D3D_NAME SystemValueType;// A predefined system value, or D3D_NAME_UNDEFINED if not applicable + D3D_REGISTER_COMPONENT_TYPE ComponentType; // Scalar type (e.g. uint, float, etc.) + BYTE Mask; // Mask to indicate which components of the register + // are used (combination of D3D10_COMPONENT_MASK values) + BYTE ReadWriteMask; // Mask to indicate whether a given component is + // never written (if this is an output signature) or + // always read (if this is an input signature). + // (combination of D3D_MASK_* values) + UINT Stream; // Stream index + D3D_MIN_PRECISION MinPrecision; // Minimum desired interpolation precision +} D3D12_SIGNATURE_PARAMETER_DESC; + +typedef struct _D3D12_SHADER_BUFFER_DESC +{ + LPCSTR Name; // Name of the constant buffer + D3D_CBUFFER_TYPE Type; // Indicates type of buffer content + UINT Variables; // Number of member variables + UINT Size; // Size of CB (in bytes) + UINT uFlags; // Buffer description flags +} D3D12_SHADER_BUFFER_DESC; + +typedef struct _D3D12_SHADER_VARIABLE_DESC +{ + LPCSTR Name; // Name of the variable + UINT StartOffset; // Offset in constant buffer's backing store + UINT Size; // Size of variable (in bytes) + UINT uFlags; // Variable flags + LPVOID DefaultValue; // Raw pointer to default value + UINT StartTexture; // First texture index (or -1 if no textures used) + UINT TextureSize; // Number of texture slots possibly used. + UINT StartSampler; // First sampler index (or -1 if no textures used) + UINT SamplerSize; // Number of sampler slots possibly used. +} D3D12_SHADER_VARIABLE_DESC; + +typedef struct _D3D12_SHADER_TYPE_DESC +{ + D3D_SHADER_VARIABLE_CLASS Class; // Variable class (e.g. object, matrix, etc.) + D3D_SHADER_VARIABLE_TYPE Type; // Variable type (e.g. float, sampler, etc.) + UINT Rows; // Number of rows (for matrices, 1 for other numeric, 0 if not applicable) + UINT Columns; // Number of columns (for vectors & matrices, 1 for other numeric, 0 if not applicable) + UINT Elements; // Number of elements (0 if not an array) + UINT Members; // Number of members (0 if not a structure) + UINT Offset; // Offset from the start of structure (0 if not a structure member) + LPCSTR Name; // Name of type, can be NULL +} D3D12_SHADER_TYPE_DESC; + +typedef D3D_TESSELLATOR_DOMAIN D3D12_TESSELLATOR_DOMAIN; + +typedef D3D_TESSELLATOR_PARTITIONING D3D12_TESSELLATOR_PARTITIONING; + +typedef D3D_TESSELLATOR_OUTPUT_PRIMITIVE D3D12_TESSELLATOR_OUTPUT_PRIMITIVE; + +typedef struct _D3D12_SHADER_DESC +{ + UINT Version; // Shader version + LPCSTR Creator; // Creator string + UINT Flags; // Shader compilation/parse flags + + UINT ConstantBuffers; // Number of constant buffers + UINT BoundResources; // Number of bound resources + UINT InputParameters; // Number of parameters in the input signature + UINT OutputParameters; // Number of parameters in the output signature + + UINT InstructionCount; // Number of emitted instructions + UINT TempRegisterCount; // Number of temporary registers used + UINT TempArrayCount; // Number of temporary arrays used + UINT DefCount; // Number of constant defines + UINT DclCount; // Number of declarations (input + output) + UINT TextureNormalInstructions; // Number of non-categorized texture instructions + UINT TextureLoadInstructions; // Number of texture load instructions + UINT TextureCompInstructions; // Number of texture comparison instructions + UINT TextureBiasInstructions; // Number of texture bias instructions + UINT TextureGradientInstructions; // Number of texture gradient instructions + UINT FloatInstructionCount; // Number of floating point arithmetic instructions used + UINT IntInstructionCount; // Number of signed integer arithmetic instructions used + UINT UintInstructionCount; // Number of unsigned integer arithmetic instructions used + UINT StaticFlowControlCount; // Number of static flow control instructions used + UINT DynamicFlowControlCount; // Number of dynamic flow control instructions used + UINT MacroInstructionCount; // Number of macro instructions used + UINT ArrayInstructionCount; // Number of array instructions used + UINT CutInstructionCount; // Number of cut instructions used + UINT EmitInstructionCount; // Number of emit instructions used + D3D_PRIMITIVE_TOPOLOGY GSOutputTopology; // Geometry shader output topology + UINT GSMaxOutputVertexCount; // Geometry shader maximum output vertex count + D3D_PRIMITIVE InputPrimitive; // GS/HS input primitive + UINT PatchConstantParameters; // Number of parameters in the patch constant signature + UINT cGSInstanceCount; // Number of Geometry shader instances + UINT cControlPoints; // Number of control points in the HS->DS stage + D3D_TESSELLATOR_OUTPUT_PRIMITIVE HSOutputPrimitive; // Primitive output by the tessellator + D3D_TESSELLATOR_PARTITIONING HSPartitioning; // Partitioning mode of the tessellator + D3D_TESSELLATOR_DOMAIN TessellatorDomain; // Domain of the tessellator (quad, tri, isoline) + // instruction counts + UINT cBarrierInstructions; // Number of barrier instructions in a compute shader + UINT cInterlockedInstructions; // Number of interlocked instructions + UINT cTextureStoreInstructions; // Number of texture writes +} D3D12_SHADER_DESC; + +typedef struct _D3D12_SHADER_INPUT_BIND_DESC +{ + LPCSTR Name; // Name of the resource + D3D_SHADER_INPUT_TYPE Type; // Type of resource (e.g. texture, cbuffer, etc.) + UINT BindPoint; // Starting bind point + UINT BindCount; // Number of contiguous bind points (for arrays) + + UINT uFlags; // Input binding flags + D3D_RESOURCE_RETURN_TYPE ReturnType; // Return type (if texture) + D3D_SRV_DIMENSION Dimension; // Dimension (if texture) + UINT NumSamples; // Number of samples (0 if not MS texture) + UINT Space; // Register space + UINT uID; // Range ID in the bytecode +} D3D12_SHADER_INPUT_BIND_DESC; + +#define D3D_SHADER_REQUIRES_DOUBLES 0x00000001 +#define D3D_SHADER_REQUIRES_EARLY_DEPTH_STENCIL 0x00000002 +#define D3D_SHADER_REQUIRES_UAVS_AT_EVERY_STAGE 0x00000004 +#define D3D_SHADER_REQUIRES_64_UAVS 0x00000008 +#define D3D_SHADER_REQUIRES_MINIMUM_PRECISION 0x00000010 +#define D3D_SHADER_REQUIRES_11_1_DOUBLE_EXTENSIONS 0x00000020 +#define D3D_SHADER_REQUIRES_11_1_SHADER_EXTENSIONS 0x00000040 +#define D3D_SHADER_REQUIRES_LEVEL_9_COMPARISON_FILTERING 0x00000080 +#define D3D_SHADER_REQUIRES_TILED_RESOURCES 0x00000100 +#define D3D_SHADER_REQUIRES_STENCIL_REF 0x00000200 +#define D3D_SHADER_REQUIRES_INNER_COVERAGE 0x00000400 +#define D3D_SHADER_REQUIRES_TYPED_UAV_LOAD_ADDITIONAL_FORMATS 0x00000800 +#define D3D_SHADER_REQUIRES_ROVS 0x00001000 +#define D3D_SHADER_REQUIRES_VIEWPORT_AND_RT_ARRAY_INDEX_FROM_ANY_SHADER_FEEDING_RASTERIZER 0x00002000 +#define D3D_SHADER_REQUIRES_WAVE_OPS 0x00004000 +#define D3D_SHADER_REQUIRES_INT64_OPS 0x00008000 +#define D3D_SHADER_REQUIRES_VIEW_ID 0x00010000 +#define D3D_SHADER_REQUIRES_BARYCENTRICS 0x00020000 +#define D3D_SHADER_REQUIRES_NATIVE_16BIT_OPS 0x00040000 +#define D3D_SHADER_REQUIRES_SHADING_RATE 0x00080000 +#define D3D_SHADER_REQUIRES_RAYTRACING_TIER_1_1 0x00100000 +#define D3D_SHADER_REQUIRES_SAMPLER_FEEDBACK 0x00200000 +#define D3D_SHADER_REQUIRES_ATOMIC_INT64_ON_TYPED_RESOURCE 0x00400000 +#define D3D_SHADER_REQUIRES_ATOMIC_INT64_ON_GROUP_SHARED 0x00800000 +#define D3D_SHADER_REQUIRES_DERIVATIVES_IN_MESH_AND_AMPLIFICATION_SHADERS 0x01000000 +#define D3D_SHADER_REQUIRES_RESOURCE_DESCRIPTOR_HEAP_INDEXING 0x02000000 +#define D3D_SHADER_REQUIRES_SAMPLER_DESCRIPTOR_HEAP_INDEXING 0x04000000 +#define D3D_SHADER_REQUIRES_WAVE_MMA 0x08000000 +#define D3D_SHADER_REQUIRES_ATOMIC_INT64_ON_DESCRIPTOR_HEAP_RESOURCE 0x10000000 +#define D3D_SHADER_FEATURE_ADVANCED_TEXTURE_OPS 0x20000000 +#define D3D_SHADER_FEATURE_WRITEABLE_MSAA_TEXTURES 0x40000000 + + +typedef struct _D3D12_LIBRARY_DESC +{ + LPCSTR Creator; // The name of the originator of the library. + UINT Flags; // Compilation flags. + UINT FunctionCount; // Number of functions exported from the library. +} D3D12_LIBRARY_DESC; + +typedef struct _D3D12_FUNCTION_DESC +{ + UINT Version; // Shader version + LPCSTR Creator; // Creator string + UINT Flags; // Shader compilation/parse flags + + UINT ConstantBuffers; // Number of constant buffers + UINT BoundResources; // Number of bound resources + + UINT InstructionCount; // Number of emitted instructions + UINT TempRegisterCount; // Number of temporary registers used + UINT TempArrayCount; // Number of temporary arrays used + UINT DefCount; // Number of constant defines + UINT DclCount; // Number of declarations (input + output) + UINT TextureNormalInstructions; // Number of non-categorized texture instructions + UINT TextureLoadInstructions; // Number of texture load instructions + UINT TextureCompInstructions; // Number of texture comparison instructions + UINT TextureBiasInstructions; // Number of texture bias instructions + UINT TextureGradientInstructions; // Number of texture gradient instructions + UINT FloatInstructionCount; // Number of floating point arithmetic instructions used + UINT IntInstructionCount; // Number of signed integer arithmetic instructions used + UINT UintInstructionCount; // Number of unsigned integer arithmetic instructions used + UINT StaticFlowControlCount; // Number of static flow control instructions used + UINT DynamicFlowControlCount; // Number of dynamic flow control instructions used + UINT MacroInstructionCount; // Number of macro instructions used + UINT ArrayInstructionCount; // Number of array instructions used + UINT MovInstructionCount; // Number of mov instructions used + UINT MovcInstructionCount; // Number of movc instructions used + UINT ConversionInstructionCount; // Number of type conversion instructions used + UINT BitwiseInstructionCount; // Number of bitwise arithmetic instructions used + D3D_FEATURE_LEVEL MinFeatureLevel; // Min target of the function byte code + UINT64 RequiredFeatureFlags; // Required feature flags + + LPCSTR Name; // Function name + INT FunctionParameterCount; // Number of logical parameters in the function signature (not including return) + BOOL HasReturn; // TRUE, if function returns a value, false - it is a subroutine + BOOL Has10Level9VertexShader; // TRUE, if there is a 10L9 VS blob + BOOL Has10Level9PixelShader; // TRUE, if there is a 10L9 PS blob +} D3D12_FUNCTION_DESC; + +typedef struct _D3D12_PARAMETER_DESC +{ + LPCSTR Name; // Parameter name. + LPCSTR SemanticName; // Parameter semantic name (+index). + D3D_SHADER_VARIABLE_TYPE Type; // Element type. + D3D_SHADER_VARIABLE_CLASS Class; // Scalar/Vector/Matrix. + UINT Rows; // Rows are for matrix parameters. + UINT Columns; // Components or Columns in matrix. + D3D_INTERPOLATION_MODE InterpolationMode; // Interpolation mode. + D3D_PARAMETER_FLAGS Flags; // Parameter modifiers. + + UINT FirstInRegister; // The first input register for this parameter. + UINT FirstInComponent; // The first input register component for this parameter. + UINT FirstOutRegister; // The first output register for this parameter. + UINT FirstOutComponent; // The first output register component for this parameter. +} D3D12_PARAMETER_DESC; + + +////////////////////////////////////////////////////////////////////////////// +// Interfaces //////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +typedef interface ID3D12ShaderReflectionType ID3D12ShaderReflectionType; +typedef interface ID3D12ShaderReflectionType *LPD3D12SHADERREFLECTIONTYPE; + +typedef interface ID3D12ShaderReflectionVariable ID3D12ShaderReflectionVariable; +typedef interface ID3D12ShaderReflectionVariable *LPD3D12SHADERREFLECTIONVARIABLE; + +typedef interface ID3D12ShaderReflectionConstantBuffer ID3D12ShaderReflectionConstantBuffer; +typedef interface ID3D12ShaderReflectionConstantBuffer *LPD3D12SHADERREFLECTIONCONSTANTBUFFER; + +typedef interface ID3D12ShaderReflection ID3D12ShaderReflection; +typedef interface ID3D12ShaderReflection *LPD3D12SHADERREFLECTION; + +typedef interface ID3D12LibraryReflection ID3D12LibraryReflection; +typedef interface ID3D12LibraryReflection *LPD3D12LIBRARYREFLECTION; + +typedef interface ID3D12FunctionReflection ID3D12FunctionReflection; +typedef interface ID3D12FunctionReflection *LPD3D12FUNCTIONREFLECTION; + +typedef interface ID3D12FunctionParameterReflection ID3D12FunctionParameterReflection; +typedef interface ID3D12FunctionParameterReflection *LPD3D12FUNCTIONPARAMETERREFLECTION; + + +// {E913C351-783D-48CA-A1D1-4F306284AD56} +interface DECLSPEC_UUID("E913C351-783D-48CA-A1D1-4F306284AD56") ID3D12ShaderReflectionType; +DEFINE_GUID(IID_ID3D12ShaderReflectionType, +0xe913c351, 0x783d, 0x48ca, 0xa1, 0xd1, 0x4f, 0x30, 0x62, 0x84, 0xad, 0x56); + +#undef INTERFACE +#define INTERFACE ID3D12ShaderReflectionType + +DECLARE_INTERFACE(ID3D12ShaderReflectionType) +{ + STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_SHADER_TYPE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D12ShaderReflectionType*, GetMemberTypeByIndex)(THIS_ _In_ UINT Index) PURE; + STDMETHOD_(ID3D12ShaderReflectionType*, GetMemberTypeByName)(THIS_ _In_ LPCSTR Name) PURE; + STDMETHOD_(LPCSTR, GetMemberTypeName)(THIS_ _In_ UINT Index) PURE; + + STDMETHOD(IsEqual)(THIS_ _In_ ID3D12ShaderReflectionType* pType) PURE; + STDMETHOD_(ID3D12ShaderReflectionType*, GetSubType)(THIS) PURE; + STDMETHOD_(ID3D12ShaderReflectionType*, GetBaseClass)(THIS) PURE; + STDMETHOD_(UINT, GetNumInterfaces)(THIS) PURE; + STDMETHOD_(ID3D12ShaderReflectionType*, GetInterfaceByIndex)(THIS_ _In_ UINT uIndex) PURE; + STDMETHOD(IsOfType)(THIS_ _In_ ID3D12ShaderReflectionType* pType) PURE; + STDMETHOD(ImplementsInterface)(THIS_ _In_ ID3D12ShaderReflectionType* pBase) PURE; +}; + +// {8337A8A6-A216-444A-B2F4-314733A73AEA} +interface DECLSPEC_UUID("8337A8A6-A216-444A-B2F4-314733A73AEA") ID3D12ShaderReflectionVariable; +DEFINE_GUID(IID_ID3D12ShaderReflectionVariable, +0x8337a8a6, 0xa216, 0x444a, 0xb2, 0xf4, 0x31, 0x47, 0x33, 0xa7, 0x3a, 0xea); + +#undef INTERFACE +#define INTERFACE ID3D12ShaderReflectionVariable + +DECLARE_INTERFACE(ID3D12ShaderReflectionVariable) +{ + STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_SHADER_VARIABLE_DESC *pDesc) PURE; + + STDMETHOD_(ID3D12ShaderReflectionType*, GetType)(THIS) PURE; + STDMETHOD_(ID3D12ShaderReflectionConstantBuffer*, GetBuffer)(THIS) PURE; + + STDMETHOD_(UINT, GetInterfaceSlot)(THIS_ _In_ UINT uArrayIndex) PURE; +}; + +// {C59598B4-48B3-4869-B9B1-B1618B14A8B7} +interface DECLSPEC_UUID("C59598B4-48B3-4869-B9B1-B1618B14A8B7") ID3D12ShaderReflectionConstantBuffer; +DEFINE_GUID(IID_ID3D12ShaderReflectionConstantBuffer, +0xc59598b4, 0x48b3, 0x4869, 0xb9, 0xb1, 0xb1, 0x61, 0x8b, 0x14, 0xa8, 0xb7); + +#undef INTERFACE +#define INTERFACE ID3D12ShaderReflectionConstantBuffer + +DECLARE_INTERFACE(ID3D12ShaderReflectionConstantBuffer) +{ + STDMETHOD(GetDesc)(THIS_ D3D12_SHADER_BUFFER_DESC *pDesc) PURE; + + STDMETHOD_(ID3D12ShaderReflectionVariable*, GetVariableByIndex)(THIS_ _In_ UINT Index) PURE; + STDMETHOD_(ID3D12ShaderReflectionVariable*, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE; +}; + +// The ID3D12ShaderReflection IID may change from SDK version to SDK version +// if the reflection API changes. This prevents new code with the new API +// from working with an old binary. Recompiling with the new header +// will pick up the new IID. + +// {5A58797D-A72C-478D-8BA2-EFC6B0EFE88E} +interface DECLSPEC_UUID("5A58797D-A72C-478D-8BA2-EFC6B0EFE88E") ID3D12ShaderReflection; +DEFINE_GUID(IID_ID3D12ShaderReflection, +0x5a58797d, 0xa72c, 0x478d, 0x8b, 0xa2, 0xef, 0xc6, 0xb0, 0xef, 0xe8, 0x8e); + +#undef INTERFACE +#define INTERFACE ID3D12ShaderReflection + +DECLARE_INTERFACE_(ID3D12ShaderReflection, IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid, + _Out_ LPVOID *ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_SHADER_DESC *pDesc) PURE; + + STDMETHOD_(ID3D12ShaderReflectionConstantBuffer*, GetConstantBufferByIndex)(THIS_ _In_ UINT Index) PURE; + STDMETHOD_(ID3D12ShaderReflectionConstantBuffer*, GetConstantBufferByName)(THIS_ _In_ LPCSTR Name) PURE; + + STDMETHOD(GetResourceBindingDesc)(THIS_ _In_ UINT ResourceIndex, + _Out_ D3D12_SHADER_INPUT_BIND_DESC *pDesc) PURE; + + STDMETHOD(GetInputParameterDesc)(THIS_ _In_ UINT ParameterIndex, + _Out_ D3D12_SIGNATURE_PARAMETER_DESC *pDesc) PURE; + STDMETHOD(GetOutputParameterDesc)(THIS_ _In_ UINT ParameterIndex, + _Out_ D3D12_SIGNATURE_PARAMETER_DESC *pDesc) PURE; + STDMETHOD(GetPatchConstantParameterDesc)(THIS_ _In_ UINT ParameterIndex, + _Out_ D3D12_SIGNATURE_PARAMETER_DESC *pDesc) PURE; + + STDMETHOD_(ID3D12ShaderReflectionVariable*, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE; + + STDMETHOD(GetResourceBindingDescByName)(THIS_ _In_ LPCSTR Name, + _Out_ D3D12_SHADER_INPUT_BIND_DESC *pDesc) PURE; + + STDMETHOD_(UINT, GetMovInstructionCount)(THIS) PURE; + STDMETHOD_(UINT, GetMovcInstructionCount)(THIS) PURE; + STDMETHOD_(UINT, GetConversionInstructionCount)(THIS) PURE; + STDMETHOD_(UINT, GetBitwiseInstructionCount)(THIS) PURE; + + STDMETHOD_(D3D_PRIMITIVE, GetGSInputPrimitive)(THIS) PURE; + STDMETHOD_(BOOL, IsSampleFrequencyShader)(THIS) PURE; + + STDMETHOD_(UINT, GetNumInterfaceSlots)(THIS) PURE; + STDMETHOD(GetMinFeatureLevel)(THIS_ _Out_ enum D3D_FEATURE_LEVEL* pLevel) PURE; + + STDMETHOD_(UINT, GetThreadGroupSize)(THIS_ + _Out_opt_ UINT* pSizeX, + _Out_opt_ UINT* pSizeY, + _Out_opt_ UINT* pSizeZ) PURE; + + STDMETHOD_(UINT64, GetRequiresFlags)(THIS) PURE; +}; + +// {8E349D19-54DB-4A56-9DC9-119D87BDB804} +interface DECLSPEC_UUID("8E349D19-54DB-4A56-9DC9-119D87BDB804") ID3D12LibraryReflection; +DEFINE_GUID(IID_ID3D12LibraryReflection, +0x8e349d19, 0x54db, 0x4a56, 0x9d, 0xc9, 0x11, 0x9d, 0x87, 0xbd, 0xb8, 0x4); + +#undef INTERFACE +#define INTERFACE ID3D12LibraryReflection + +DECLARE_INTERFACE_(ID3D12LibraryReflection, IUnknown) +{ + STDMETHOD(QueryInterface)(THIS_ _In_ REFIID iid, _Out_ LPVOID * ppv) PURE; + STDMETHOD_(ULONG, AddRef)(THIS) PURE; + STDMETHOD_(ULONG, Release)(THIS) PURE; + + STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_LIBRARY_DESC * pDesc) PURE; + + STDMETHOD_(ID3D12FunctionReflection *, GetFunctionByIndex)(THIS_ _In_ INT FunctionIndex) PURE; +}; + +// {1108795C-2772-4BA9-B2A8-D464DC7E2799} +interface DECLSPEC_UUID("1108795C-2772-4BA9-B2A8-D464DC7E2799") ID3D12FunctionReflection; +DEFINE_GUID(IID_ID3D12FunctionReflection, +0x1108795c, 0x2772, 0x4ba9, 0xb2, 0xa8, 0xd4, 0x64, 0xdc, 0x7e, 0x27, 0x99); + +#undef INTERFACE +#define INTERFACE ID3D12FunctionReflection + +DECLARE_INTERFACE(ID3D12FunctionReflection) +{ + STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_FUNCTION_DESC * pDesc) PURE; + + STDMETHOD_(ID3D12ShaderReflectionConstantBuffer *, GetConstantBufferByIndex)(THIS_ _In_ UINT BufferIndex) PURE; + STDMETHOD_(ID3D12ShaderReflectionConstantBuffer *, GetConstantBufferByName)(THIS_ _In_ LPCSTR Name) PURE; + + STDMETHOD(GetResourceBindingDesc)(THIS_ _In_ UINT ResourceIndex, + _Out_ D3D12_SHADER_INPUT_BIND_DESC * pDesc) PURE; + + STDMETHOD_(ID3D12ShaderReflectionVariable *, GetVariableByName)(THIS_ _In_ LPCSTR Name) PURE; + + STDMETHOD(GetResourceBindingDescByName)(THIS_ _In_ LPCSTR Name, + _Out_ D3D12_SHADER_INPUT_BIND_DESC * pDesc) PURE; + + // Use D3D_RETURN_PARAMETER_INDEX to get description of the return value. + STDMETHOD_(ID3D12FunctionParameterReflection *, GetFunctionParameter)(THIS_ _In_ INT ParameterIndex) PURE; +}; + +// {EC25F42D-7006-4F2B-B33E-02CC3375733F} +interface DECLSPEC_UUID("EC25F42D-7006-4F2B-B33E-02CC3375733F") ID3D12FunctionParameterReflection; +DEFINE_GUID(IID_ID3D12FunctionParameterReflection, +0xec25f42d, 0x7006, 0x4f2b, 0xb3, 0x3e, 0x2, 0xcc, 0x33, 0x75, 0x73, 0x3f); + +#undef INTERFACE +#define INTERFACE ID3D12FunctionParameterReflection + +DECLARE_INTERFACE(ID3D12FunctionParameterReflection) +{ + STDMETHOD(GetDesc)(THIS_ _Out_ D3D12_PARAMETER_DESC * pDesc) PURE; +}; + + +////////////////////////////////////////////////////////////////////////////// +// APIs ////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////////// + +#ifdef __cplusplus +extern "C" { +#endif //__cplusplus + +#ifdef __cplusplus +} +#endif //__cplusplus + +#endif //__D3D12SHADER_H__ + diff --git a/thirdparty/directx_headers/d3d12video.h b/thirdparty/directx_headers/d3d12video.h new file mode 100644 index 0000000000..add372e381 --- /dev/null +++ b/thirdparty/directx_headers/d3d12video.h @@ -0,0 +1,8584 @@ +/*------------------------------------------------------------------------------------- + * + * Copyright (c) Microsoft Corporation + * Licensed under the MIT license + * + *-------------------------------------------------------------------------------------*/ + + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 8.01.0628 */ + + + +/* verify that the <rpcndr.h> version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 500 +#endif + +/* verify that the <rpcsal.h> version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCSAL_H_VERSION__ +#define __REQUIRED_RPCSAL_H_VERSION__ 100 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of <rpcndr.h> +#endif /* __RPCNDR_H_VERSION__ */ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __d3d12video_h__ +#define __d3d12video_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +#ifndef DECLSPEC_XFGVIRT +#if defined(_CONTROL_FLOW_GUARD_XFG) +#define DECLSPEC_XFGVIRT(base, func) __declspec(xfg_virtual(base, func)) +#else +#define DECLSPEC_XFGVIRT(base, func) +#endif +#endif + +/* Forward Declarations */ + +#ifndef __ID3D12VideoDecoderHeap_FWD_DEFINED__ +#define __ID3D12VideoDecoderHeap_FWD_DEFINED__ +typedef interface ID3D12VideoDecoderHeap ID3D12VideoDecoderHeap; + +#endif /* __ID3D12VideoDecoderHeap_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoDevice_FWD_DEFINED__ +#define __ID3D12VideoDevice_FWD_DEFINED__ +typedef interface ID3D12VideoDevice ID3D12VideoDevice; + +#endif /* __ID3D12VideoDevice_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoDecoder_FWD_DEFINED__ +#define __ID3D12VideoDecoder_FWD_DEFINED__ +typedef interface ID3D12VideoDecoder ID3D12VideoDecoder; + +#endif /* __ID3D12VideoDecoder_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoProcessor_FWD_DEFINED__ +#define __ID3D12VideoProcessor_FWD_DEFINED__ +typedef interface ID3D12VideoProcessor ID3D12VideoProcessor; + +#endif /* __ID3D12VideoProcessor_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoDecodeCommandList_FWD_DEFINED__ +#define __ID3D12VideoDecodeCommandList_FWD_DEFINED__ +typedef interface ID3D12VideoDecodeCommandList ID3D12VideoDecodeCommandList; + +#endif /* __ID3D12VideoDecodeCommandList_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoProcessCommandList_FWD_DEFINED__ +#define __ID3D12VideoProcessCommandList_FWD_DEFINED__ +typedef interface ID3D12VideoProcessCommandList ID3D12VideoProcessCommandList; + +#endif /* __ID3D12VideoProcessCommandList_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoDecodeCommandList1_FWD_DEFINED__ +#define __ID3D12VideoDecodeCommandList1_FWD_DEFINED__ +typedef interface ID3D12VideoDecodeCommandList1 ID3D12VideoDecodeCommandList1; + +#endif /* __ID3D12VideoDecodeCommandList1_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoProcessCommandList1_FWD_DEFINED__ +#define __ID3D12VideoProcessCommandList1_FWD_DEFINED__ +typedef interface ID3D12VideoProcessCommandList1 ID3D12VideoProcessCommandList1; + +#endif /* __ID3D12VideoProcessCommandList1_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoMotionEstimator_FWD_DEFINED__ +#define __ID3D12VideoMotionEstimator_FWD_DEFINED__ +typedef interface ID3D12VideoMotionEstimator ID3D12VideoMotionEstimator; + +#endif /* __ID3D12VideoMotionEstimator_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoMotionVectorHeap_FWD_DEFINED__ +#define __ID3D12VideoMotionVectorHeap_FWD_DEFINED__ +typedef interface ID3D12VideoMotionVectorHeap ID3D12VideoMotionVectorHeap; + +#endif /* __ID3D12VideoMotionVectorHeap_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoDevice1_FWD_DEFINED__ +#define __ID3D12VideoDevice1_FWD_DEFINED__ +typedef interface ID3D12VideoDevice1 ID3D12VideoDevice1; + +#endif /* __ID3D12VideoDevice1_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoEncodeCommandList_FWD_DEFINED__ +#define __ID3D12VideoEncodeCommandList_FWD_DEFINED__ +typedef interface ID3D12VideoEncodeCommandList ID3D12VideoEncodeCommandList; + +#endif /* __ID3D12VideoEncodeCommandList_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoDecoder1_FWD_DEFINED__ +#define __ID3D12VideoDecoder1_FWD_DEFINED__ +typedef interface ID3D12VideoDecoder1 ID3D12VideoDecoder1; + +#endif /* __ID3D12VideoDecoder1_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoDecoderHeap1_FWD_DEFINED__ +#define __ID3D12VideoDecoderHeap1_FWD_DEFINED__ +typedef interface ID3D12VideoDecoderHeap1 ID3D12VideoDecoderHeap1; + +#endif /* __ID3D12VideoDecoderHeap1_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoProcessor1_FWD_DEFINED__ +#define __ID3D12VideoProcessor1_FWD_DEFINED__ +typedef interface ID3D12VideoProcessor1 ID3D12VideoProcessor1; + +#endif /* __ID3D12VideoProcessor1_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoExtensionCommand_FWD_DEFINED__ +#define __ID3D12VideoExtensionCommand_FWD_DEFINED__ +typedef interface ID3D12VideoExtensionCommand ID3D12VideoExtensionCommand; + +#endif /* __ID3D12VideoExtensionCommand_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoDevice2_FWD_DEFINED__ +#define __ID3D12VideoDevice2_FWD_DEFINED__ +typedef interface ID3D12VideoDevice2 ID3D12VideoDevice2; + +#endif /* __ID3D12VideoDevice2_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoDecodeCommandList2_FWD_DEFINED__ +#define __ID3D12VideoDecodeCommandList2_FWD_DEFINED__ +typedef interface ID3D12VideoDecodeCommandList2 ID3D12VideoDecodeCommandList2; + +#endif /* __ID3D12VideoDecodeCommandList2_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoDecodeCommandList3_FWD_DEFINED__ +#define __ID3D12VideoDecodeCommandList3_FWD_DEFINED__ +typedef interface ID3D12VideoDecodeCommandList3 ID3D12VideoDecodeCommandList3; + +#endif /* __ID3D12VideoDecodeCommandList3_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoProcessCommandList2_FWD_DEFINED__ +#define __ID3D12VideoProcessCommandList2_FWD_DEFINED__ +typedef interface ID3D12VideoProcessCommandList2 ID3D12VideoProcessCommandList2; + +#endif /* __ID3D12VideoProcessCommandList2_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoProcessCommandList3_FWD_DEFINED__ +#define __ID3D12VideoProcessCommandList3_FWD_DEFINED__ +typedef interface ID3D12VideoProcessCommandList3 ID3D12VideoProcessCommandList3; + +#endif /* __ID3D12VideoProcessCommandList3_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoEncodeCommandList1_FWD_DEFINED__ +#define __ID3D12VideoEncodeCommandList1_FWD_DEFINED__ +typedef interface ID3D12VideoEncodeCommandList1 ID3D12VideoEncodeCommandList1; + +#endif /* __ID3D12VideoEncodeCommandList1_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoEncoder_FWD_DEFINED__ +#define __ID3D12VideoEncoder_FWD_DEFINED__ +typedef interface ID3D12VideoEncoder ID3D12VideoEncoder; + +#endif /* __ID3D12VideoEncoder_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoEncoderHeap_FWD_DEFINED__ +#define __ID3D12VideoEncoderHeap_FWD_DEFINED__ +typedef interface ID3D12VideoEncoderHeap ID3D12VideoEncoderHeap; + +#endif /* __ID3D12VideoEncoderHeap_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoDevice3_FWD_DEFINED__ +#define __ID3D12VideoDevice3_FWD_DEFINED__ +typedef interface ID3D12VideoDevice3 ID3D12VideoDevice3; + +#endif /* __ID3D12VideoDevice3_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoEncodeCommandList2_FWD_DEFINED__ +#define __ID3D12VideoEncodeCommandList2_FWD_DEFINED__ +typedef interface ID3D12VideoEncodeCommandList2 ID3D12VideoEncodeCommandList2; + +#endif /* __ID3D12VideoEncodeCommandList2_FWD_DEFINED__ */ + + +#ifndef __ID3D12VideoEncodeCommandList3_FWD_DEFINED__ +#define __ID3D12VideoEncodeCommandList3_FWD_DEFINED__ +typedef interface ID3D12VideoEncodeCommandList3 ID3D12VideoEncodeCommandList3; + +#endif /* __ID3D12VideoEncodeCommandList3_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "oaidl.h" +#include "ocidl.h" +#include "dxgicommon.h" +#include "d3d12.h" + +#ifdef __cplusplus +extern "C"{ +#endif + + +/* interface __MIDL_itf_d3d12video_0000_0000 */ +/* [local] */ + +#include <winapifamily.h> +#pragma region App Family +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES) +typedef +enum D3D12_VIDEO_FIELD_TYPE + { + D3D12_VIDEO_FIELD_TYPE_NONE = 0, + D3D12_VIDEO_FIELD_TYPE_INTERLACED_TOP_FIELD_FIRST = 1, + D3D12_VIDEO_FIELD_TYPE_INTERLACED_BOTTOM_FIELD_FIRST = 2 + } D3D12_VIDEO_FIELD_TYPE; + +typedef +enum D3D12_VIDEO_FRAME_STEREO_FORMAT + { + D3D12_VIDEO_FRAME_STEREO_FORMAT_NONE = 0, + D3D12_VIDEO_FRAME_STEREO_FORMAT_MONO = 1, + D3D12_VIDEO_FRAME_STEREO_FORMAT_HORIZONTAL = 2, + D3D12_VIDEO_FRAME_STEREO_FORMAT_VERTICAL = 3, + D3D12_VIDEO_FRAME_STEREO_FORMAT_SEPARATE = 4 + } D3D12_VIDEO_FRAME_STEREO_FORMAT; + +typedef struct D3D12_VIDEO_FORMAT + { + DXGI_FORMAT Format; + DXGI_COLOR_SPACE_TYPE ColorSpace; + } D3D12_VIDEO_FORMAT; + +typedef struct D3D12_VIDEO_SAMPLE + { + UINT Width; + UINT Height; + D3D12_VIDEO_FORMAT Format; + } D3D12_VIDEO_SAMPLE; + +typedef +enum D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE + { + D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE_NONE = 0, + D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE_FIELD_BASED = 1 + } D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE; + +typedef +enum D3D12_FEATURE_VIDEO + { + D3D12_FEATURE_VIDEO_DECODE_SUPPORT = 0, + D3D12_FEATURE_VIDEO_DECODE_PROFILES = 1, + D3D12_FEATURE_VIDEO_DECODE_FORMATS = 2, + D3D12_FEATURE_VIDEO_DECODE_CONVERSION_SUPPORT = 3, + D3D12_FEATURE_VIDEO_PROCESS_SUPPORT = 5, + D3D12_FEATURE_VIDEO_PROCESS_MAX_INPUT_STREAMS = 6, + D3D12_FEATURE_VIDEO_PROCESS_REFERENCE_INFO = 7, + D3D12_FEATURE_VIDEO_DECODER_HEAP_SIZE = 8, + D3D12_FEATURE_VIDEO_PROCESSOR_SIZE = 9, + D3D12_FEATURE_VIDEO_DECODE_PROFILE_COUNT = 10, + D3D12_FEATURE_VIDEO_DECODE_FORMAT_COUNT = 11, + D3D12_FEATURE_VIDEO_ARCHITECTURE = 17, + D3D12_FEATURE_VIDEO_DECODE_HISTOGRAM = 18, + D3D12_FEATURE_VIDEO_FEATURE_AREA_SUPPORT = 19, + D3D12_FEATURE_VIDEO_MOTION_ESTIMATOR = 20, + D3D12_FEATURE_VIDEO_MOTION_ESTIMATOR_SIZE = 21, + D3D12_FEATURE_VIDEO_EXTENSION_COMMAND_COUNT = 22, + D3D12_FEATURE_VIDEO_EXTENSION_COMMANDS = 23, + D3D12_FEATURE_VIDEO_EXTENSION_COMMAND_PARAMETER_COUNT = 24, + D3D12_FEATURE_VIDEO_EXTENSION_COMMAND_PARAMETERS = 25, + D3D12_FEATURE_VIDEO_EXTENSION_COMMAND_SUPPORT = 26, + D3D12_FEATURE_VIDEO_EXTENSION_COMMAND_SIZE = 27, + D3D12_FEATURE_VIDEO_DECODE_PROTECTED_RESOURCES = 28, + D3D12_FEATURE_VIDEO_PROCESS_PROTECTED_RESOURCES = 29, + D3D12_FEATURE_VIDEO_MOTION_ESTIMATOR_PROTECTED_RESOURCES = 30, + D3D12_FEATURE_VIDEO_DECODER_HEAP_SIZE1 = 31, + D3D12_FEATURE_VIDEO_PROCESSOR_SIZE1 = 32, + D3D12_FEATURE_VIDEO_ENCODER_CODEC = 33, + D3D12_FEATURE_VIDEO_ENCODER_PROFILE_LEVEL = 34, + D3D12_FEATURE_VIDEO_ENCODER_OUTPUT_RESOLUTION_RATIOS_COUNT = 35, + D3D12_FEATURE_VIDEO_ENCODER_OUTPUT_RESOLUTION = 36, + D3D12_FEATURE_VIDEO_ENCODER_INPUT_FORMAT = 37, + D3D12_FEATURE_VIDEO_ENCODER_RATE_CONTROL_MODE = 38, + D3D12_FEATURE_VIDEO_ENCODER_INTRA_REFRESH_MODE = 39, + D3D12_FEATURE_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE = 40, + D3D12_FEATURE_VIDEO_ENCODER_HEAP_SIZE = 41, + D3D12_FEATURE_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT = 42, + D3D12_FEATURE_VIDEO_ENCODER_SUPPORT = 43, + D3D12_FEATURE_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT = 44, + D3D12_FEATURE_VIDEO_ENCODER_RESOURCE_REQUIREMENTS = 45 + } D3D12_FEATURE_VIDEO; + +typedef +enum D3D12_BITSTREAM_ENCRYPTION_TYPE + { + D3D12_BITSTREAM_ENCRYPTION_TYPE_NONE = 0 + } D3D12_BITSTREAM_ENCRYPTION_TYPE; + +typedef struct D3D12_VIDEO_DECODE_CONFIGURATION + { + GUID DecodeProfile; + D3D12_BITSTREAM_ENCRYPTION_TYPE BitstreamEncryption; + D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE InterlaceType; + } D3D12_VIDEO_DECODE_CONFIGURATION; + +typedef struct D3D12_VIDEO_DECODER_DESC + { + UINT NodeMask; + D3D12_VIDEO_DECODE_CONFIGURATION Configuration; + } D3D12_VIDEO_DECODER_DESC; + +typedef struct D3D12_VIDEO_DECODER_HEAP_DESC + { + UINT NodeMask; + D3D12_VIDEO_DECODE_CONFIGURATION Configuration; + UINT DecodeWidth; + UINT DecodeHeight; + DXGI_FORMAT Format; + DXGI_RATIONAL FrameRate; + UINT BitRate; + UINT MaxDecodePictureBufferCount; + } D3D12_VIDEO_DECODER_HEAP_DESC; + +typedef struct D3D12_VIDEO_SIZE_RANGE + { + UINT MaxWidth; + UINT MaxHeight; + UINT MinWidth; + UINT MinHeight; + } D3D12_VIDEO_SIZE_RANGE; + +typedef +enum D3D12_VIDEO_PROCESS_FILTER + { + D3D12_VIDEO_PROCESS_FILTER_BRIGHTNESS = 0, + D3D12_VIDEO_PROCESS_FILTER_CONTRAST = 1, + D3D12_VIDEO_PROCESS_FILTER_HUE = 2, + D3D12_VIDEO_PROCESS_FILTER_SATURATION = 3, + D3D12_VIDEO_PROCESS_FILTER_NOISE_REDUCTION = 4, + D3D12_VIDEO_PROCESS_FILTER_EDGE_ENHANCEMENT = 5, + D3D12_VIDEO_PROCESS_FILTER_ANAMORPHIC_SCALING = 6, + D3D12_VIDEO_PROCESS_FILTER_STEREO_ADJUSTMENT = 7 + } D3D12_VIDEO_PROCESS_FILTER; + +typedef +enum D3D12_VIDEO_PROCESS_FILTER_FLAGS + { + D3D12_VIDEO_PROCESS_FILTER_FLAG_NONE = 0, + D3D12_VIDEO_PROCESS_FILTER_FLAG_BRIGHTNESS = ( 1 << D3D12_VIDEO_PROCESS_FILTER_BRIGHTNESS ) , + D3D12_VIDEO_PROCESS_FILTER_FLAG_CONTRAST = ( 1 << D3D12_VIDEO_PROCESS_FILTER_CONTRAST ) , + D3D12_VIDEO_PROCESS_FILTER_FLAG_HUE = ( 1 << D3D12_VIDEO_PROCESS_FILTER_HUE ) , + D3D12_VIDEO_PROCESS_FILTER_FLAG_SATURATION = ( 1 << D3D12_VIDEO_PROCESS_FILTER_SATURATION ) , + D3D12_VIDEO_PROCESS_FILTER_FLAG_NOISE_REDUCTION = ( 1 << D3D12_VIDEO_PROCESS_FILTER_NOISE_REDUCTION ) , + D3D12_VIDEO_PROCESS_FILTER_FLAG_EDGE_ENHANCEMENT = ( 1 << D3D12_VIDEO_PROCESS_FILTER_EDGE_ENHANCEMENT ) , + D3D12_VIDEO_PROCESS_FILTER_FLAG_ANAMORPHIC_SCALING = ( 1 << D3D12_VIDEO_PROCESS_FILTER_ANAMORPHIC_SCALING ) , + D3D12_VIDEO_PROCESS_FILTER_FLAG_STEREO_ADJUSTMENT = ( 1 << D3D12_VIDEO_PROCESS_FILTER_STEREO_ADJUSTMENT ) + } D3D12_VIDEO_PROCESS_FILTER_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_FILTER_FLAGS ); +typedef +enum D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS + { + D3D12_VIDEO_PROCESS_DEINTERLACE_FLAG_NONE = 0, + D3D12_VIDEO_PROCESS_DEINTERLACE_FLAG_BOB = 0x1, + D3D12_VIDEO_PROCESS_DEINTERLACE_FLAG_CUSTOM = 0x80000000 + } D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS ); +typedef struct D3D12_VIDEO_PROCESS_ALPHA_BLENDING + { + BOOL Enable; + FLOAT Alpha; + } D3D12_VIDEO_PROCESS_ALPHA_BLENDING; + +typedef struct D3D12_VIDEO_PROCESS_LUMA_KEY + { + BOOL Enable; + FLOAT Lower; + FLOAT Upper; + } D3D12_VIDEO_PROCESS_LUMA_KEY; + +typedef struct D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC + { + DXGI_FORMAT Format; + DXGI_COLOR_SPACE_TYPE ColorSpace; + DXGI_RATIONAL SourceAspectRatio; + DXGI_RATIONAL DestinationAspectRatio; + DXGI_RATIONAL FrameRate; + D3D12_VIDEO_SIZE_RANGE SourceSizeRange; + D3D12_VIDEO_SIZE_RANGE DestinationSizeRange; + BOOL EnableOrientation; + D3D12_VIDEO_PROCESS_FILTER_FLAGS FilterFlags; + D3D12_VIDEO_FRAME_STEREO_FORMAT StereoFormat; + D3D12_VIDEO_FIELD_TYPE FieldType; + D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS DeinterlaceMode; + BOOL EnableAlphaBlending; + D3D12_VIDEO_PROCESS_LUMA_KEY LumaKey; + UINT NumPastFrames; + UINT NumFutureFrames; + BOOL EnableAutoProcessing; + } D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC; + +typedef +enum D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE + { + D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE_OPAQUE = 0, + D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE_BACKGROUND = 1, + D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE_DESTINATION = 2, + D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE_SOURCE_STREAM = 3 + } D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE; + +typedef struct D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC + { + DXGI_FORMAT Format; + DXGI_COLOR_SPACE_TYPE ColorSpace; + D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE AlphaFillMode; + UINT AlphaFillModeSourceStreamIndex; + FLOAT BackgroundColor[ 4 ]; + DXGI_RATIONAL FrameRate; + BOOL EnableStereo; + } D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0000_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0000_v0_0_s_ifspec; + +#ifndef __ID3D12VideoDecoderHeap_INTERFACE_DEFINED__ +#define __ID3D12VideoDecoderHeap_INTERFACE_DEFINED__ + +/* interface ID3D12VideoDecoderHeap */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoDecoderHeap; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("0946B7C9-EBF6-4047-BB73-8683E27DBB1F") + ID3D12VideoDecoderHeap : public ID3D12Pageable + { + public: +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_VIDEO_DECODER_HEAP_DESC STDMETHODCALLTYPE GetDesc( void) = 0; +#else + virtual D3D12_VIDEO_DECODER_HEAP_DESC *STDMETHODCALLTYPE GetDesc( + D3D12_VIDEO_DECODER_HEAP_DESC * RetVal) = 0; +#endif + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoDecoderHeapVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoDecoderHeap * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoDecoderHeap * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoDecoderHeap * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoDecoderHeap * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoDecoderHeap * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoDecoderHeap * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoDecoderHeap * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoDecoderHeap * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12VideoDecoderHeap, GetDesc) +#if !defined(_WIN32) + D3D12_VIDEO_DECODER_HEAP_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12VideoDecoderHeap * This); + +#else + D3D12_VIDEO_DECODER_HEAP_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12VideoDecoderHeap * This, + D3D12_VIDEO_DECODER_HEAP_DESC * RetVal); + +#endif + + END_INTERFACE + } ID3D12VideoDecoderHeapVtbl; + + interface ID3D12VideoDecoderHeap + { + CONST_VTBL struct ID3D12VideoDecoderHeapVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoDecoderHeap_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoDecoderHeap_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoDecoderHeap_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoDecoderHeap_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoDecoderHeap_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoDecoderHeap_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoDecoderHeap_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoDecoderHeap_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#if !defined(_WIN32) + +#define ID3D12VideoDecoderHeap_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) +#else +#define ID3D12VideoDecoderHeap_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) +#endif + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoDecoderHeap_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12VideoDevice_INTERFACE_DEFINED__ +#define __ID3D12VideoDevice_INTERFACE_DEFINED__ + +/* interface ID3D12VideoDevice */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoDevice; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("1F052807-0B46-4ACC-8A89-364F793718A4") + ID3D12VideoDevice : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE CheckFeatureSupport( + D3D12_FEATURE_VIDEO FeatureVideo, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateVideoDecoder( + _In_ const D3D12_VIDEO_DECODER_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoDecoder) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateVideoDecoderHeap( + _In_ const D3D12_VIDEO_DECODER_HEAP_DESC *pVideoDecoderHeapDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoDecoderHeap) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateVideoProcessor( + UINT NodeMask, + _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *pOutputStreamDesc, + UINT NumInputStreamDescs, + _In_reads_(NumInputStreamDescs) const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoProcessor) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoDeviceVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoDevice * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoDevice * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoDevice * This); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice, CheckFeatureSupport) + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D12VideoDevice * This, + D3D12_FEATURE_VIDEO FeatureVideo, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice, CreateVideoDecoder) + HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoder )( + ID3D12VideoDevice * This, + _In_ const D3D12_VIDEO_DECODER_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoDecoder); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice, CreateVideoDecoderHeap) + HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoderHeap )( + ID3D12VideoDevice * This, + _In_ const D3D12_VIDEO_DECODER_HEAP_DESC *pVideoDecoderHeapDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoDecoderHeap); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice, CreateVideoProcessor) + HRESULT ( STDMETHODCALLTYPE *CreateVideoProcessor )( + ID3D12VideoDevice * This, + UINT NodeMask, + _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *pOutputStreamDesc, + UINT NumInputStreamDescs, + _In_reads_(NumInputStreamDescs) const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoProcessor); + + END_INTERFACE + } ID3D12VideoDeviceVtbl; + + interface ID3D12VideoDevice + { + CONST_VTBL struct ID3D12VideoDeviceVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoDevice_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoDevice_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoDevice_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoDevice_CheckFeatureSupport(This,FeatureVideo,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,FeatureVideo,pFeatureSupportData,FeatureSupportDataSize) ) + +#define ID3D12VideoDevice_CreateVideoDecoder(This,pDesc,riid,ppVideoDecoder) \ + ( (This)->lpVtbl -> CreateVideoDecoder(This,pDesc,riid,ppVideoDecoder) ) + +#define ID3D12VideoDevice_CreateVideoDecoderHeap(This,pVideoDecoderHeapDesc,riid,ppVideoDecoderHeap) \ + ( (This)->lpVtbl -> CreateVideoDecoderHeap(This,pVideoDecoderHeapDesc,riid,ppVideoDecoderHeap) ) + +#define ID3D12VideoDevice_CreateVideoProcessor(This,NodeMask,pOutputStreamDesc,NumInputStreamDescs,pInputStreamDescs,riid,ppVideoProcessor) \ + ( (This)->lpVtbl -> CreateVideoProcessor(This,NodeMask,pOutputStreamDesc,NumInputStreamDescs,pInputStreamDescs,riid,ppVideoProcessor) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoDevice_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12VideoDecoder_INTERFACE_DEFINED__ +#define __ID3D12VideoDecoder_INTERFACE_DEFINED__ + +/* interface ID3D12VideoDecoder */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoDecoder; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("C59B6BDC-7720-4074-A136-17A156037470") + ID3D12VideoDecoder : public ID3D12Pageable + { + public: +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_VIDEO_DECODER_DESC STDMETHODCALLTYPE GetDesc( void) = 0; +#else + virtual D3D12_VIDEO_DECODER_DESC *STDMETHODCALLTYPE GetDesc( + D3D12_VIDEO_DECODER_DESC * RetVal) = 0; +#endif + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoDecoderVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoDecoder * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoDecoder * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoDecoder * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoDecoder * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoDecoder * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoDecoder * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoDecoder * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoDecoder * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12VideoDecoder, GetDesc) +#if !defined(_WIN32) + D3D12_VIDEO_DECODER_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12VideoDecoder * This); + +#else + D3D12_VIDEO_DECODER_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12VideoDecoder * This, + D3D12_VIDEO_DECODER_DESC * RetVal); + +#endif + + END_INTERFACE + } ID3D12VideoDecoderVtbl; + + interface ID3D12VideoDecoder + { + CONST_VTBL struct ID3D12VideoDecoderVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoDecoder_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoDecoder_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoDecoder_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoDecoder_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoDecoder_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoDecoder_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoDecoder_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoDecoder_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#if !defined(_WIN32) + +#define ID3D12VideoDecoder_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) +#else +#define ID3D12VideoDecoder_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) +#endif + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoDecoder_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12video_0000_0003 */ +/* [local] */ + +typedef +enum D3D12_VIDEO_DECODE_TIER + { + D3D12_VIDEO_DECODE_TIER_NOT_SUPPORTED = 0, + D3D12_VIDEO_DECODE_TIER_1 = 1, + D3D12_VIDEO_DECODE_TIER_2 = 2, + D3D12_VIDEO_DECODE_TIER_3 = 3 + } D3D12_VIDEO_DECODE_TIER; + +typedef +enum D3D12_VIDEO_DECODE_SUPPORT_FLAGS + { + D3D12_VIDEO_DECODE_SUPPORT_FLAG_NONE = 0, + D3D12_VIDEO_DECODE_SUPPORT_FLAG_SUPPORTED = 0x1 + } D3D12_VIDEO_DECODE_SUPPORT_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_DECODE_SUPPORT_FLAGS ); +typedef +enum D3D12_VIDEO_DECODE_CONFIGURATION_FLAGS + { + D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_NONE = 0, + D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_HEIGHT_ALIGNMENT_MULTIPLE_32_REQUIRED = 0x1, + D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_POST_PROCESSING_SUPPORTED = 0x2, + D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_REFERENCE_ONLY_ALLOCATIONS_REQUIRED = 0x4, + D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_ALLOW_RESOLUTION_CHANGE_ON_NON_KEY_FRAME = 0x8 + } D3D12_VIDEO_DECODE_CONFIGURATION_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_DECODE_CONFIGURATION_FLAGS ); +typedef +enum D3D12_VIDEO_DECODE_STATUS + { + D3D12_VIDEO_DECODE_STATUS_OK = 0, + D3D12_VIDEO_DECODE_STATUS_CONTINUE = 1, + D3D12_VIDEO_DECODE_STATUS_CONTINUE_SKIP_DISPLAY = 2, + D3D12_VIDEO_DECODE_STATUS_RESTART = 3, + D3D12_VIDEO_DECODE_STATUS_RATE_EXCEEDED = 4 + } D3D12_VIDEO_DECODE_STATUS; + +typedef +enum D3D12_VIDEO_DECODE_ARGUMENT_TYPE + { + D3D12_VIDEO_DECODE_ARGUMENT_TYPE_PICTURE_PARAMETERS = 0, + D3D12_VIDEO_DECODE_ARGUMENT_TYPE_INVERSE_QUANTIZATION_MATRIX = 1, + D3D12_VIDEO_DECODE_ARGUMENT_TYPE_SLICE_CONTROL = 2, + D3D12_VIDEO_DECODE_ARGUMENT_TYPE_MAX_VALID = 3 + } D3D12_VIDEO_DECODE_ARGUMENT_TYPE; + +typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_SUPPORT + { + UINT NodeIndex; + D3D12_VIDEO_DECODE_CONFIGURATION Configuration; + UINT Width; + UINT Height; + DXGI_FORMAT DecodeFormat; + DXGI_RATIONAL FrameRate; + UINT BitRate; + D3D12_VIDEO_DECODE_SUPPORT_FLAGS SupportFlags; + D3D12_VIDEO_DECODE_CONFIGURATION_FLAGS ConfigurationFlags; + D3D12_VIDEO_DECODE_TIER DecodeTier; + } D3D12_FEATURE_DATA_VIDEO_DECODE_SUPPORT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_PROFILE_COUNT + { + UINT NodeIndex; + UINT ProfileCount; + } D3D12_FEATURE_DATA_VIDEO_DECODE_PROFILE_COUNT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_PROFILES + { + UINT NodeIndex; + UINT ProfileCount; + _Field_size_full_(ProfileCount) GUID *pProfiles; + } D3D12_FEATURE_DATA_VIDEO_DECODE_PROFILES; + +typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_FORMAT_COUNT + { + UINT NodeIndex; + D3D12_VIDEO_DECODE_CONFIGURATION Configuration; + UINT FormatCount; + } D3D12_FEATURE_DATA_VIDEO_DECODE_FORMAT_COUNT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_FORMATS + { + UINT NodeIndex; + D3D12_VIDEO_DECODE_CONFIGURATION Configuration; + UINT FormatCount; + _Field_size_full_(FormatCount) DXGI_FORMAT *pOutputFormats; + } D3D12_FEATURE_DATA_VIDEO_DECODE_FORMATS; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ARCHITECTURE + { + BOOL IOCoherent; + } D3D12_FEATURE_DATA_VIDEO_ARCHITECTURE; + +typedef +enum D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT + { + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_Y = 0, + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_U = 1, + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_V = 2, + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_R = 0, + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_G = 1, + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_B = 2, + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_A = 3 + } D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT; + +typedef +enum D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAGS + { + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_NONE = 0, + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_Y = ( 1 << D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_Y ) , + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_U = ( 1 << D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_U ) , + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_V = ( 1 << D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_V ) , + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_R = ( 1 << D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_R ) , + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_G = ( 1 << D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_G ) , + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_B = ( 1 << D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_B ) , + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_A = ( 1 << D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_A ) + } D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAGS ); +typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_HISTOGRAM + { + UINT NodeIndex; + GUID DecodeProfile; + UINT Width; + UINT Height; + DXGI_FORMAT DecodeFormat; + D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAGS Components; + UINT BinCount; + UINT CounterBitDepth; + } D3D12_FEATURE_DATA_VIDEO_DECODE_HISTOGRAM; + +typedef +enum D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAGS + { + D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAG_NONE = 0, + D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAG_SUPPORTED = 0x1 + } D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAGS ); +typedef +enum D3D12_VIDEO_SCALE_SUPPORT_FLAGS + { + D3D12_VIDEO_SCALE_SUPPORT_FLAG_NONE = 0, + D3D12_VIDEO_SCALE_SUPPORT_FLAG_POW2_ONLY = 0x1, + D3D12_VIDEO_SCALE_SUPPORT_FLAG_EVEN_DIMENSIONS_ONLY = 0x2 + } D3D12_VIDEO_SCALE_SUPPORT_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_SCALE_SUPPORT_FLAGS ); +typedef struct D3D12_VIDEO_SCALE_SUPPORT + { + D3D12_VIDEO_SIZE_RANGE OutputSizeRange; + D3D12_VIDEO_SCALE_SUPPORT_FLAGS Flags; + } D3D12_VIDEO_SCALE_SUPPORT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_CONVERSION_SUPPORT + { + UINT NodeIndex; + D3D12_VIDEO_DECODE_CONFIGURATION Configuration; + D3D12_VIDEO_SAMPLE DecodeSample; + D3D12_VIDEO_FORMAT OutputFormat; + DXGI_RATIONAL FrameRate; + UINT BitRate; + D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAGS SupportFlags; + D3D12_VIDEO_SCALE_SUPPORT ScaleSupport; + } D3D12_FEATURE_DATA_VIDEO_DECODE_CONVERSION_SUPPORT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_DECODER_HEAP_SIZE + { + D3D12_VIDEO_DECODER_HEAP_DESC VideoDecoderHeapDesc; + UINT64 MemoryPoolL0Size; + UINT64 MemoryPoolL1Size; + } D3D12_FEATURE_DATA_VIDEO_DECODER_HEAP_SIZE; + +typedef struct D3D12_FEATURE_DATA_VIDEO_PROCESSOR_SIZE + { + UINT NodeMask; + const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *pOutputStreamDesc; + UINT NumInputStreamDescs; + const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs; + UINT64 MemoryPoolL0Size; + UINT64 MemoryPoolL1Size; + } D3D12_FEATURE_DATA_VIDEO_PROCESSOR_SIZE; + +typedef struct D3D12_QUERY_DATA_VIDEO_DECODE_STATISTICS + { + UINT64 Status; + UINT64 NumMacroblocksAffected; + DXGI_RATIONAL FrameRate; + UINT BitRate; + } D3D12_QUERY_DATA_VIDEO_DECODE_STATISTICS; + +typedef struct D3D12_VIDEO_DECODE_FRAME_ARGUMENT + { + D3D12_VIDEO_DECODE_ARGUMENT_TYPE Type; + UINT Size; + _Field_size_bytes_full_(Size) void *pData; + } D3D12_VIDEO_DECODE_FRAME_ARGUMENT; + +typedef struct D3D12_VIDEO_DECODE_REFERENCE_FRAMES + { + UINT NumTexture2Ds; + _Field_size_full_(NumTexture2Ds) ID3D12Resource **ppTexture2Ds; + _Field_size_full_(NumTexture2Ds) UINT *pSubresources; + _Field_size_full_opt_(NumTexture2Ds) ID3D12VideoDecoderHeap **ppHeaps; + } D3D12_VIDEO_DECODE_REFERENCE_FRAMES; + +typedef struct D3D12_VIDEO_DECODE_COMPRESSED_BITSTREAM + { + ID3D12Resource *pBuffer; + UINT64 Offset; + UINT64 Size; + } D3D12_VIDEO_DECODE_COMPRESSED_BITSTREAM; + +typedef struct D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS + { + BOOL Enable; + ID3D12Resource *pReferenceTexture2D; + UINT ReferenceSubresource; + DXGI_COLOR_SPACE_TYPE OutputColorSpace; + DXGI_COLOR_SPACE_TYPE DecodeColorSpace; + } D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS; + +typedef struct D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS + { + UINT NumFrameArguments; + D3D12_VIDEO_DECODE_FRAME_ARGUMENT FrameArguments[ 10 ]; + D3D12_VIDEO_DECODE_REFERENCE_FRAMES ReferenceFrames; + D3D12_VIDEO_DECODE_COMPRESSED_BITSTREAM CompressedBitstream; + ID3D12VideoDecoderHeap *pHeap; + } D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS; + +typedef struct D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS + { + ID3D12Resource *pOutputTexture2D; + UINT OutputSubresource; + D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS ConversionArguments; + } D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0003_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0003_v0_0_s_ifspec; + +#ifndef __ID3D12VideoProcessor_INTERFACE_DEFINED__ +#define __ID3D12VideoProcessor_INTERFACE_DEFINED__ + +/* interface ID3D12VideoProcessor */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoProcessor; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("304FDB32-BEDE-410A-8545-943AC6A46138") + ID3D12VideoProcessor : public ID3D12Pageable + { + public: + virtual UINT STDMETHODCALLTYPE GetNodeMask( void) = 0; + + virtual UINT STDMETHODCALLTYPE GetNumInputStreamDescs( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetInputStreamDescs( + UINT NumInputStreamDescs, + _Out_writes_(NumInputStreamDescs) D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs) = 0; + +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC STDMETHODCALLTYPE GetOutputStreamDesc( void) = 0; +#else + virtual D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *STDMETHODCALLTYPE GetOutputStreamDesc( + D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC * RetVal) = 0; +#endif + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoProcessorVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoProcessor * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoProcessor * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoProcessor * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoProcessor * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoProcessor * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoProcessor * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoProcessor * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoProcessor * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessor, GetNodeMask) + UINT ( STDMETHODCALLTYPE *GetNodeMask )( + ID3D12VideoProcessor * This); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessor, GetNumInputStreamDescs) + UINT ( STDMETHODCALLTYPE *GetNumInputStreamDescs )( + ID3D12VideoProcessor * This); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessor, GetInputStreamDescs) + HRESULT ( STDMETHODCALLTYPE *GetInputStreamDescs )( + ID3D12VideoProcessor * This, + UINT NumInputStreamDescs, + _Out_writes_(NumInputStreamDescs) D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessor, GetOutputStreamDesc) +#if !defined(_WIN32) + D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC ( STDMETHODCALLTYPE *GetOutputStreamDesc )( + ID3D12VideoProcessor * This); + +#else + D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *( STDMETHODCALLTYPE *GetOutputStreamDesc )( + ID3D12VideoProcessor * This, + D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC * RetVal); + +#endif + + END_INTERFACE + } ID3D12VideoProcessorVtbl; + + interface ID3D12VideoProcessor + { + CONST_VTBL struct ID3D12VideoProcessorVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoProcessor_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoProcessor_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoProcessor_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoProcessor_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoProcessor_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoProcessor_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoProcessor_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoProcessor_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + + +#define ID3D12VideoProcessor_GetNodeMask(This) \ + ( (This)->lpVtbl -> GetNodeMask(This) ) + +#define ID3D12VideoProcessor_GetNumInputStreamDescs(This) \ + ( (This)->lpVtbl -> GetNumInputStreamDescs(This) ) + +#define ID3D12VideoProcessor_GetInputStreamDescs(This,NumInputStreamDescs,pInputStreamDescs) \ + ( (This)->lpVtbl -> GetInputStreamDescs(This,NumInputStreamDescs,pInputStreamDescs) ) +#if !defined(_WIN32) + +#define ID3D12VideoProcessor_GetOutputStreamDesc(This) \ + ( (This)->lpVtbl -> GetOutputStreamDesc(This) ) +#else +#define ID3D12VideoProcessor_GetOutputStreamDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetOutputStreamDesc(This,RetVal) ) +#endif + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoProcessor_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12video_0000_0004 */ +/* [local] */ + +typedef +enum D3D12_VIDEO_PROCESS_FEATURE_FLAGS + { + D3D12_VIDEO_PROCESS_FEATURE_FLAG_NONE = 0, + D3D12_VIDEO_PROCESS_FEATURE_FLAG_ALPHA_FILL = 0x1, + D3D12_VIDEO_PROCESS_FEATURE_FLAG_LUMA_KEY = 0x2, + D3D12_VIDEO_PROCESS_FEATURE_FLAG_STEREO = 0x4, + D3D12_VIDEO_PROCESS_FEATURE_FLAG_ROTATION = 0x8, + D3D12_VIDEO_PROCESS_FEATURE_FLAG_FLIP = 0x10, + D3D12_VIDEO_PROCESS_FEATURE_FLAG_ALPHA_BLENDING = 0x20, + D3D12_VIDEO_PROCESS_FEATURE_FLAG_PIXEL_ASPECT_RATIO = 0x40 + } D3D12_VIDEO_PROCESS_FEATURE_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_FEATURE_FLAGS ); +typedef +enum D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAGS + { + D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_NONE = 0, + D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_DENOISE = 0x1, + D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_DERINGING = 0x2, + D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_EDGE_ENHANCEMENT = 0x4, + D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_COLOR_CORRECTION = 0x8, + D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_FLESH_TONE_MAPPING = 0x10, + D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_IMAGE_STABILIZATION = 0x20, + D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_SUPER_RESOLUTION = 0x40, + D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_ANAMORPHIC_SCALING = 0x80, + D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_CUSTOM = 0x80000000 + } D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAGS ); +typedef +enum D3D12_VIDEO_PROCESS_ORIENTATION + { + D3D12_VIDEO_PROCESS_ORIENTATION_DEFAULT = 0, + D3D12_VIDEO_PROCESS_ORIENTATION_FLIP_HORIZONTAL = 1, + D3D12_VIDEO_PROCESS_ORIENTATION_CLOCKWISE_90 = 2, + D3D12_VIDEO_PROCESS_ORIENTATION_CLOCKWISE_90_FLIP_HORIZONTAL = 3, + D3D12_VIDEO_PROCESS_ORIENTATION_CLOCKWISE_180 = 4, + D3D12_VIDEO_PROCESS_ORIENTATION_FLIP_VERTICAL = 5, + D3D12_VIDEO_PROCESS_ORIENTATION_CLOCKWISE_270 = 6, + D3D12_VIDEO_PROCESS_ORIENTATION_CLOCKWISE_270_FLIP_HORIZONTAL = 7 + } D3D12_VIDEO_PROCESS_ORIENTATION; + +typedef +enum D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAGS + { + D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAG_NONE = 0, + D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAG_FRAME_DISCONTINUITY = 0x1, + D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAG_FRAME_REPEAT = 0x2 + } D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAGS ); +typedef struct D3D12_VIDEO_PROCESS_FILTER_RANGE + { + INT Minimum; + INT Maximum; + INT Default; + FLOAT Multiplier; + } D3D12_VIDEO_PROCESS_FILTER_RANGE; + +typedef +enum D3D12_VIDEO_PROCESS_SUPPORT_FLAGS + { + D3D12_VIDEO_PROCESS_SUPPORT_FLAG_NONE = 0, + D3D12_VIDEO_PROCESS_SUPPORT_FLAG_SUPPORTED = 0x1 + } D3D12_VIDEO_PROCESS_SUPPORT_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_SUPPORT_FLAGS ); +typedef struct D3D12_FEATURE_DATA_VIDEO_PROCESS_SUPPORT + { + UINT NodeIndex; + D3D12_VIDEO_SAMPLE InputSample; + D3D12_VIDEO_FIELD_TYPE InputFieldType; + D3D12_VIDEO_FRAME_STEREO_FORMAT InputStereoFormat; + DXGI_RATIONAL InputFrameRate; + D3D12_VIDEO_FORMAT OutputFormat; + D3D12_VIDEO_FRAME_STEREO_FORMAT OutputStereoFormat; + DXGI_RATIONAL OutputFrameRate; + D3D12_VIDEO_PROCESS_SUPPORT_FLAGS SupportFlags; + D3D12_VIDEO_SCALE_SUPPORT ScaleSupport; + D3D12_VIDEO_PROCESS_FEATURE_FLAGS FeatureSupport; + D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS DeinterlaceSupport; + D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAGS AutoProcessingSupport; + D3D12_VIDEO_PROCESS_FILTER_FLAGS FilterSupport; + D3D12_VIDEO_PROCESS_FILTER_RANGE FilterRangeSupport[ 32 ]; + } D3D12_FEATURE_DATA_VIDEO_PROCESS_SUPPORT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_PROCESS_MAX_INPUT_STREAMS + { + UINT NodeIndex; + UINT MaxInputStreams; + } D3D12_FEATURE_DATA_VIDEO_PROCESS_MAX_INPUT_STREAMS; + +typedef struct D3D12_FEATURE_DATA_VIDEO_PROCESS_REFERENCE_INFO + { + UINT NodeIndex; + D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS DeinterlaceMode; + D3D12_VIDEO_PROCESS_FILTER_FLAGS Filters; + D3D12_VIDEO_PROCESS_FEATURE_FLAGS FeatureSupport; + DXGI_RATIONAL InputFrameRate; + DXGI_RATIONAL OutputFrameRate; + BOOL EnableAutoProcessing; + UINT PastFrames; + UINT FutureFrames; + } D3D12_FEATURE_DATA_VIDEO_PROCESS_REFERENCE_INFO; + +typedef struct D3D12_VIDEO_PROCESS_REFERENCE_SET + { + UINT NumPastFrames; + ID3D12Resource **ppPastFrames; + UINT *pPastSubresources; + UINT NumFutureFrames; + ID3D12Resource **ppFutureFrames; + UINT *pFutureSubresources; + } D3D12_VIDEO_PROCESS_REFERENCE_SET; + +typedef struct D3D12_VIDEO_PROCESS_TRANSFORM + { + D3D12_RECT SourceRectangle; + D3D12_RECT DestinationRectangle; + D3D12_VIDEO_PROCESS_ORIENTATION Orientation; + } D3D12_VIDEO_PROCESS_TRANSFORM; + +typedef struct D3D12_VIDEO_PROCESS_INPUT_STREAM_RATE + { + UINT OutputIndex; + UINT InputFrameOrField; + } D3D12_VIDEO_PROCESS_INPUT_STREAM_RATE; + +typedef struct D3D12_VIDEO_PROCESS_INPUT_STREAM + { + ID3D12Resource *pTexture2D; + UINT Subresource; + D3D12_VIDEO_PROCESS_REFERENCE_SET ReferenceSet; + } D3D12_VIDEO_PROCESS_INPUT_STREAM; + +typedef struct D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS + { + D3D12_VIDEO_PROCESS_INPUT_STREAM InputStream[ 2 ]; + D3D12_VIDEO_PROCESS_TRANSFORM Transform; + D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAGS Flags; + D3D12_VIDEO_PROCESS_INPUT_STREAM_RATE RateInfo; + INT FilterLevels[ 32 ]; + D3D12_VIDEO_PROCESS_ALPHA_BLENDING AlphaBlending; + } D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS; + +typedef struct D3D12_VIDEO_PROCESS_OUTPUT_STREAM + { + ID3D12Resource *pTexture2D; + UINT Subresource; + } D3D12_VIDEO_PROCESS_OUTPUT_STREAM; + +typedef struct D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS + { + D3D12_VIDEO_PROCESS_OUTPUT_STREAM OutputStream[ 2 ]; + D3D12_RECT TargetRectangle; + } D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0004_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0004_v0_0_s_ifspec; + +#ifndef __ID3D12VideoDecodeCommandList_INTERFACE_DEFINED__ +#define __ID3D12VideoDecodeCommandList_INTERFACE_DEFINED__ + +/* interface ID3D12VideoDecodeCommandList */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoDecodeCommandList; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("3B60536E-AD29-4E64-A269-F853837E5E53") + ID3D12VideoDecodeCommandList : public ID3D12CommandList + { + public: + virtual HRESULT STDMETHODCALLTYPE Close( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE Reset( + _In_ ID3D12CommandAllocator *pAllocator) = 0; + + virtual void STDMETHODCALLTYPE ClearState( void) = 0; + + virtual void STDMETHODCALLTYPE ResourceBarrier( + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers) = 0; + + virtual void STDMETHODCALLTYPE DiscardResource( + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion) = 0; + + virtual void STDMETHODCALLTYPE BeginQuery( + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index) = 0; + + virtual void STDMETHODCALLTYPE EndQuery( + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index) = 0; + + virtual void STDMETHODCALLTYPE ResolveQueryData( + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset) = 0; + + virtual void STDMETHODCALLTYPE SetPredication( + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation) = 0; + + virtual void STDMETHODCALLTYPE SetMarker( + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size) = 0; + + virtual void STDMETHODCALLTYPE BeginEvent( + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size) = 0; + + virtual void STDMETHODCALLTYPE EndEvent( void) = 0; + + virtual void STDMETHODCALLTYPE DecodeFrame( + _In_ ID3D12VideoDecoder *pDecoder, + _In_ const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS *pOutputArguments, + _In_ const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *pInputArguments) = 0; + + virtual void STDMETHODCALLTYPE WriteBufferImmediate( + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoDecodeCommandListVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoDecodeCommandList * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoDecodeCommandList * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoDecodeCommandList * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoDecodeCommandList * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoDecodeCommandList * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoDecodeCommandList * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoDecodeCommandList * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoDecodeCommandList * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12VideoDecodeCommandList * This); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12VideoDecodeCommandList * This); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12VideoDecodeCommandList * This, + _In_ ID3D12CommandAllocator *pAllocator); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12VideoDecodeCommandList * This); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12VideoDecodeCommandList * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12VideoDecodeCommandList * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12VideoDecodeCommandList * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12VideoDecodeCommandList * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12VideoDecodeCommandList * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12VideoDecodeCommandList * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12VideoDecodeCommandList * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12VideoDecodeCommandList * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12VideoDecodeCommandList * This); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, DecodeFrame) + void ( STDMETHODCALLTYPE *DecodeFrame )( + ID3D12VideoDecodeCommandList * This, + _In_ ID3D12VideoDecoder *pDecoder, + _In_ const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS *pOutputArguments, + _In_ const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *pInputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12VideoDecodeCommandList * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); + + END_INTERFACE + } ID3D12VideoDecodeCommandListVtbl; + + interface ID3D12VideoDecodeCommandList + { + CONST_VTBL struct ID3D12VideoDecodeCommandListVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoDecodeCommandList_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoDecodeCommandList_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoDecodeCommandList_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoDecodeCommandList_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoDecodeCommandList_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoDecodeCommandList_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoDecodeCommandList_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoDecodeCommandList_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12VideoDecodeCommandList_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12VideoDecodeCommandList_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12VideoDecodeCommandList_Reset(This,pAllocator) \ + ( (This)->lpVtbl -> Reset(This,pAllocator) ) + +#define ID3D12VideoDecodeCommandList_ClearState(This) \ + ( (This)->lpVtbl -> ClearState(This) ) + +#define ID3D12VideoDecodeCommandList_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12VideoDecodeCommandList_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12VideoDecodeCommandList_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoDecodeCommandList_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoDecodeCommandList_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12VideoDecodeCommandList_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12VideoDecodeCommandList_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12VideoDecodeCommandList_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12VideoDecodeCommandList_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12VideoDecodeCommandList_DecodeFrame(This,pDecoder,pOutputArguments,pInputArguments) \ + ( (This)->lpVtbl -> DecodeFrame(This,pDecoder,pOutputArguments,pInputArguments) ) + +#define ID3D12VideoDecodeCommandList_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoDecodeCommandList_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12VideoProcessCommandList_INTERFACE_DEFINED__ +#define __ID3D12VideoProcessCommandList_INTERFACE_DEFINED__ + +/* interface ID3D12VideoProcessCommandList */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoProcessCommandList; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("AEB2543A-167F-4682-ACC8-D159ED4A6209") + ID3D12VideoProcessCommandList : public ID3D12CommandList + { + public: + virtual HRESULT STDMETHODCALLTYPE Close( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE Reset( + _In_ ID3D12CommandAllocator *pAllocator) = 0; + + virtual void STDMETHODCALLTYPE ClearState( void) = 0; + + virtual void STDMETHODCALLTYPE ResourceBarrier( + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers) = 0; + + virtual void STDMETHODCALLTYPE DiscardResource( + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion) = 0; + + virtual void STDMETHODCALLTYPE BeginQuery( + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index) = 0; + + virtual void STDMETHODCALLTYPE EndQuery( + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index) = 0; + + virtual void STDMETHODCALLTYPE ResolveQueryData( + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset) = 0; + + virtual void STDMETHODCALLTYPE SetPredication( + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation) = 0; + + virtual void STDMETHODCALLTYPE SetMarker( + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size) = 0; + + virtual void STDMETHODCALLTYPE BeginEvent( + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size) = 0; + + virtual void STDMETHODCALLTYPE EndEvent( void) = 0; + + virtual void STDMETHODCALLTYPE ProcessFrames( + _In_ ID3D12VideoProcessor *pVideoProcessor, + _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS *pOutputArguments, + UINT NumInputStreams, + _In_reads_(NumInputStreams) const D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS *pInputArguments) = 0; + + virtual void STDMETHODCALLTYPE WriteBufferImmediate( + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoProcessCommandListVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoProcessCommandList * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoProcessCommandList * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoProcessCommandList * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoProcessCommandList * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoProcessCommandList * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoProcessCommandList * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoProcessCommandList * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoProcessCommandList * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12VideoProcessCommandList * This); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12VideoProcessCommandList * This); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12VideoProcessCommandList * This, + _In_ ID3D12CommandAllocator *pAllocator); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12VideoProcessCommandList * This); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12VideoProcessCommandList * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12VideoProcessCommandList * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12VideoProcessCommandList * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12VideoProcessCommandList * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12VideoProcessCommandList * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12VideoProcessCommandList * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12VideoProcessCommandList * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12VideoProcessCommandList * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12VideoProcessCommandList * This); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ProcessFrames) + void ( STDMETHODCALLTYPE *ProcessFrames )( + ID3D12VideoProcessCommandList * This, + _In_ ID3D12VideoProcessor *pVideoProcessor, + _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS *pOutputArguments, + UINT NumInputStreams, + _In_reads_(NumInputStreams) const D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS *pInputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12VideoProcessCommandList * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); + + END_INTERFACE + } ID3D12VideoProcessCommandListVtbl; + + interface ID3D12VideoProcessCommandList + { + CONST_VTBL struct ID3D12VideoProcessCommandListVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoProcessCommandList_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoProcessCommandList_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoProcessCommandList_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoProcessCommandList_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoProcessCommandList_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoProcessCommandList_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoProcessCommandList_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoProcessCommandList_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12VideoProcessCommandList_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12VideoProcessCommandList_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12VideoProcessCommandList_Reset(This,pAllocator) \ + ( (This)->lpVtbl -> Reset(This,pAllocator) ) + +#define ID3D12VideoProcessCommandList_ClearState(This) \ + ( (This)->lpVtbl -> ClearState(This) ) + +#define ID3D12VideoProcessCommandList_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12VideoProcessCommandList_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12VideoProcessCommandList_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoProcessCommandList_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoProcessCommandList_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12VideoProcessCommandList_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12VideoProcessCommandList_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12VideoProcessCommandList_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12VideoProcessCommandList_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12VideoProcessCommandList_ProcessFrames(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) \ + ( (This)->lpVtbl -> ProcessFrames(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) ) + +#define ID3D12VideoProcessCommandList_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoProcessCommandList_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12video_0000_0006 */ +/* [local] */ + +typedef struct D3D12_VIDEO_DECODE_OUTPUT_HISTOGRAM + { + UINT64 Offset; + ID3D12Resource *pBuffer; + } D3D12_VIDEO_DECODE_OUTPUT_HISTOGRAM; + +typedef struct D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS1 + { + BOOL Enable; + ID3D12Resource *pReferenceTexture2D; + UINT ReferenceSubresource; + DXGI_COLOR_SPACE_TYPE OutputColorSpace; + DXGI_COLOR_SPACE_TYPE DecodeColorSpace; + UINT OutputWidth; + UINT OutputHeight; + } D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS1; + +typedef struct D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS1 + { + ID3D12Resource *pOutputTexture2D; + UINT OutputSubresource; + D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS1 ConversionArguments; + D3D12_VIDEO_DECODE_OUTPUT_HISTOGRAM Histograms[ 4 ]; + } D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS1; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0006_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0006_v0_0_s_ifspec; + +#ifndef __ID3D12VideoDecodeCommandList1_INTERFACE_DEFINED__ +#define __ID3D12VideoDecodeCommandList1_INTERFACE_DEFINED__ + +/* interface ID3D12VideoDecodeCommandList1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoDecodeCommandList1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("D52F011B-B56E-453C-A05A-A7F311C8F472") + ID3D12VideoDecodeCommandList1 : public ID3D12VideoDecodeCommandList + { + public: + virtual void STDMETHODCALLTYPE DecodeFrame1( + _In_ ID3D12VideoDecoder *pDecoder, + _In_ const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS1 *pOutputArguments, + _In_ const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *pInputArguments) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoDecodeCommandList1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoDecodeCommandList1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoDecodeCommandList1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoDecodeCommandList1 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoDecodeCommandList1 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoDecodeCommandList1 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoDecodeCommandList1 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoDecodeCommandList1 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoDecodeCommandList1 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12VideoDecodeCommandList1 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12VideoDecodeCommandList1 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12VideoDecodeCommandList1 * This, + _In_ ID3D12CommandAllocator *pAllocator); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12VideoDecodeCommandList1 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12VideoDecodeCommandList1 * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12VideoDecodeCommandList1 * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12VideoDecodeCommandList1 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12VideoDecodeCommandList1 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12VideoDecodeCommandList1 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12VideoDecodeCommandList1 * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12VideoDecodeCommandList1 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12VideoDecodeCommandList1 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12VideoDecodeCommandList1 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, DecodeFrame) + void ( STDMETHODCALLTYPE *DecodeFrame )( + ID3D12VideoDecodeCommandList1 * This, + _In_ ID3D12VideoDecoder *pDecoder, + _In_ const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS *pOutputArguments, + _In_ const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *pInputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12VideoDecodeCommandList1 * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList1, DecodeFrame1) + void ( STDMETHODCALLTYPE *DecodeFrame1 )( + ID3D12VideoDecodeCommandList1 * This, + _In_ ID3D12VideoDecoder *pDecoder, + _In_ const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS1 *pOutputArguments, + _In_ const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *pInputArguments); + + END_INTERFACE + } ID3D12VideoDecodeCommandList1Vtbl; + + interface ID3D12VideoDecodeCommandList1 + { + CONST_VTBL struct ID3D12VideoDecodeCommandList1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoDecodeCommandList1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoDecodeCommandList1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoDecodeCommandList1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoDecodeCommandList1_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoDecodeCommandList1_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoDecodeCommandList1_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoDecodeCommandList1_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoDecodeCommandList1_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12VideoDecodeCommandList1_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12VideoDecodeCommandList1_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12VideoDecodeCommandList1_Reset(This,pAllocator) \ + ( (This)->lpVtbl -> Reset(This,pAllocator) ) + +#define ID3D12VideoDecodeCommandList1_ClearState(This) \ + ( (This)->lpVtbl -> ClearState(This) ) + +#define ID3D12VideoDecodeCommandList1_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12VideoDecodeCommandList1_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12VideoDecodeCommandList1_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoDecodeCommandList1_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoDecodeCommandList1_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12VideoDecodeCommandList1_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12VideoDecodeCommandList1_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12VideoDecodeCommandList1_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12VideoDecodeCommandList1_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12VideoDecodeCommandList1_DecodeFrame(This,pDecoder,pOutputArguments,pInputArguments) \ + ( (This)->lpVtbl -> DecodeFrame(This,pDecoder,pOutputArguments,pInputArguments) ) + +#define ID3D12VideoDecodeCommandList1_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) + + +#define ID3D12VideoDecodeCommandList1_DecodeFrame1(This,pDecoder,pOutputArguments,pInputArguments) \ + ( (This)->lpVtbl -> DecodeFrame1(This,pDecoder,pOutputArguments,pInputArguments) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoDecodeCommandList1_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12video_0000_0007 */ +/* [local] */ + +typedef struct D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS1 + { + D3D12_VIDEO_PROCESS_INPUT_STREAM InputStream[ 2 ]; + D3D12_VIDEO_PROCESS_TRANSFORM Transform; + D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAGS Flags; + D3D12_VIDEO_PROCESS_INPUT_STREAM_RATE RateInfo; + INT FilterLevels[ 32 ]; + D3D12_VIDEO_PROCESS_ALPHA_BLENDING AlphaBlending; + D3D12_VIDEO_FIELD_TYPE FieldType; + } D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS1; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0007_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0007_v0_0_s_ifspec; + +#ifndef __ID3D12VideoProcessCommandList1_INTERFACE_DEFINED__ +#define __ID3D12VideoProcessCommandList1_INTERFACE_DEFINED__ + +/* interface ID3D12VideoProcessCommandList1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoProcessCommandList1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("542C5C4D-7596-434F-8C93-4EFA6766F267") + ID3D12VideoProcessCommandList1 : public ID3D12VideoProcessCommandList + { + public: + virtual void STDMETHODCALLTYPE ProcessFrames1( + _In_ ID3D12VideoProcessor *pVideoProcessor, + _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS *pOutputArguments, + UINT NumInputStreams, + _In_reads_(NumInputStreams) const D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS1 *pInputArguments) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoProcessCommandList1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoProcessCommandList1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoProcessCommandList1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoProcessCommandList1 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoProcessCommandList1 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoProcessCommandList1 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoProcessCommandList1 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoProcessCommandList1 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoProcessCommandList1 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12VideoProcessCommandList1 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12VideoProcessCommandList1 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12VideoProcessCommandList1 * This, + _In_ ID3D12CommandAllocator *pAllocator); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12VideoProcessCommandList1 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12VideoProcessCommandList1 * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12VideoProcessCommandList1 * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12VideoProcessCommandList1 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12VideoProcessCommandList1 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12VideoProcessCommandList1 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12VideoProcessCommandList1 * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12VideoProcessCommandList1 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12VideoProcessCommandList1 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12VideoProcessCommandList1 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ProcessFrames) + void ( STDMETHODCALLTYPE *ProcessFrames )( + ID3D12VideoProcessCommandList1 * This, + _In_ ID3D12VideoProcessor *pVideoProcessor, + _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS *pOutputArguments, + UINT NumInputStreams, + _In_reads_(NumInputStreams) const D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS *pInputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12VideoProcessCommandList1 * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList1, ProcessFrames1) + void ( STDMETHODCALLTYPE *ProcessFrames1 )( + ID3D12VideoProcessCommandList1 * This, + _In_ ID3D12VideoProcessor *pVideoProcessor, + _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS *pOutputArguments, + UINT NumInputStreams, + _In_reads_(NumInputStreams) const D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS1 *pInputArguments); + + END_INTERFACE + } ID3D12VideoProcessCommandList1Vtbl; + + interface ID3D12VideoProcessCommandList1 + { + CONST_VTBL struct ID3D12VideoProcessCommandList1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoProcessCommandList1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoProcessCommandList1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoProcessCommandList1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoProcessCommandList1_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoProcessCommandList1_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoProcessCommandList1_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoProcessCommandList1_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoProcessCommandList1_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12VideoProcessCommandList1_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12VideoProcessCommandList1_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12VideoProcessCommandList1_Reset(This,pAllocator) \ + ( (This)->lpVtbl -> Reset(This,pAllocator) ) + +#define ID3D12VideoProcessCommandList1_ClearState(This) \ + ( (This)->lpVtbl -> ClearState(This) ) + +#define ID3D12VideoProcessCommandList1_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12VideoProcessCommandList1_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12VideoProcessCommandList1_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoProcessCommandList1_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoProcessCommandList1_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12VideoProcessCommandList1_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12VideoProcessCommandList1_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12VideoProcessCommandList1_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12VideoProcessCommandList1_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12VideoProcessCommandList1_ProcessFrames(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) \ + ( (This)->lpVtbl -> ProcessFrames(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) ) + +#define ID3D12VideoProcessCommandList1_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) + + +#define ID3D12VideoProcessCommandList1_ProcessFrames1(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) \ + ( (This)->lpVtbl -> ProcessFrames1(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoProcessCommandList1_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12video_0000_0008 */ +/* [local] */ + +typedef +enum D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE + { + D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_8X8 = 0, + D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_16X16 = 1 + } D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE; + +typedef +enum D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAGS + { + D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAG_NONE = 0, + D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAG_8X8 = ( 1 << D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_8X8 ) , + D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAG_16X16 = ( 1 << D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_16X16 ) + } D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAGS ); +typedef +enum D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION + { + D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_QUARTER_PEL = 0 + } D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION; + +typedef +enum D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_FLAGS + { + D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_FLAG_NONE = 0, + D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_FLAG_QUARTER_PEL = ( 1 << D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_QUARTER_PEL ) + } D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS( D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_FLAGS ); +typedef struct D3D12_FEATURE_DATA_VIDEO_FEATURE_AREA_SUPPORT + { + UINT NodeIndex; + BOOL VideoDecodeSupport; + BOOL VideoProcessSupport; + BOOL VideoEncodeSupport; + } D3D12_FEATURE_DATA_VIDEO_FEATURE_AREA_SUPPORT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_MOTION_ESTIMATOR + { + UINT NodeIndex; + DXGI_FORMAT InputFormat; + D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAGS BlockSizeFlags; + D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_FLAGS PrecisionFlags; + D3D12_VIDEO_SIZE_RANGE SizeRange; + } D3D12_FEATURE_DATA_VIDEO_MOTION_ESTIMATOR; + +typedef struct D3D12_FEATURE_DATA_VIDEO_MOTION_ESTIMATOR_SIZE + { + UINT NodeIndex; + DXGI_FORMAT InputFormat; + D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE BlockSize; + D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION Precision; + D3D12_VIDEO_SIZE_RANGE SizeRange; + BOOL Protected; + UINT64 MotionVectorHeapMemoryPoolL0Size; + UINT64 MotionVectorHeapMemoryPoolL1Size; + UINT64 MotionEstimatorMemoryPoolL0Size; + UINT64 MotionEstimatorMemoryPoolL1Size; + } D3D12_FEATURE_DATA_VIDEO_MOTION_ESTIMATOR_SIZE; + +typedef struct D3D12_VIDEO_MOTION_ESTIMATOR_DESC + { + UINT NodeMask; + DXGI_FORMAT InputFormat; + D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE BlockSize; + D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION Precision; + D3D12_VIDEO_SIZE_RANGE SizeRange; + } D3D12_VIDEO_MOTION_ESTIMATOR_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0008_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0008_v0_0_s_ifspec; + +#ifndef __ID3D12VideoMotionEstimator_INTERFACE_DEFINED__ +#define __ID3D12VideoMotionEstimator_INTERFACE_DEFINED__ + +/* interface ID3D12VideoMotionEstimator */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoMotionEstimator; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("33FDAE0E-098B-428F-87BB-34B695DE08F8") + ID3D12VideoMotionEstimator : public ID3D12Pageable + { + public: +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_VIDEO_MOTION_ESTIMATOR_DESC STDMETHODCALLTYPE GetDesc( void) = 0; +#else + virtual D3D12_VIDEO_MOTION_ESTIMATOR_DESC *STDMETHODCALLTYPE GetDesc( + D3D12_VIDEO_MOTION_ESTIMATOR_DESC * RetVal) = 0; +#endif + + virtual HRESULT STDMETHODCALLTYPE GetProtectedResourceSession( + REFIID riid, + _COM_Outptr_opt_ void **ppProtectedSession) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoMotionEstimatorVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoMotionEstimator * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoMotionEstimator * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoMotionEstimator * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoMotionEstimator * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoMotionEstimator * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoMotionEstimator * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoMotionEstimator * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoMotionEstimator * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12VideoMotionEstimator, GetDesc) +#if !defined(_WIN32) + D3D12_VIDEO_MOTION_ESTIMATOR_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12VideoMotionEstimator * This); + +#else + D3D12_VIDEO_MOTION_ESTIMATOR_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12VideoMotionEstimator * This, + D3D12_VIDEO_MOTION_ESTIMATOR_DESC * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12VideoMotionEstimator, GetProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *GetProtectedResourceSession )( + ID3D12VideoMotionEstimator * This, + REFIID riid, + _COM_Outptr_opt_ void **ppProtectedSession); + + END_INTERFACE + } ID3D12VideoMotionEstimatorVtbl; + + interface ID3D12VideoMotionEstimator + { + CONST_VTBL struct ID3D12VideoMotionEstimatorVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoMotionEstimator_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoMotionEstimator_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoMotionEstimator_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoMotionEstimator_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoMotionEstimator_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoMotionEstimator_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoMotionEstimator_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoMotionEstimator_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#if !defined(_WIN32) + +#define ID3D12VideoMotionEstimator_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) +#else +#define ID3D12VideoMotionEstimator_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) +#endif + +#define ID3D12VideoMotionEstimator_GetProtectedResourceSession(This,riid,ppProtectedSession) \ + ( (This)->lpVtbl -> GetProtectedResourceSession(This,riid,ppProtectedSession) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoMotionEstimator_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12video_0000_0009 */ +/* [local] */ + +typedef struct D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC + { + UINT NodeMask; + DXGI_FORMAT InputFormat; + D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE BlockSize; + D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION Precision; + D3D12_VIDEO_SIZE_RANGE SizeRange; + } D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0009_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0009_v0_0_s_ifspec; + +#ifndef __ID3D12VideoMotionVectorHeap_INTERFACE_DEFINED__ +#define __ID3D12VideoMotionVectorHeap_INTERFACE_DEFINED__ + +/* interface ID3D12VideoMotionVectorHeap */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoMotionVectorHeap; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("5BE17987-743A-4061-834B-23D22DAEA505") + ID3D12VideoMotionVectorHeap : public ID3D12Pageable + { + public: +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC STDMETHODCALLTYPE GetDesc( void) = 0; +#else + virtual D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC *STDMETHODCALLTYPE GetDesc( + D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC * RetVal) = 0; +#endif + + virtual HRESULT STDMETHODCALLTYPE GetProtectedResourceSession( + REFIID riid, + _COM_Outptr_opt_ void **ppProtectedSession) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoMotionVectorHeapVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoMotionVectorHeap * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoMotionVectorHeap * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoMotionVectorHeap * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoMotionVectorHeap * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoMotionVectorHeap * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoMotionVectorHeap * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoMotionVectorHeap * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoMotionVectorHeap * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12VideoMotionVectorHeap, GetDesc) +#if !defined(_WIN32) + D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12VideoMotionVectorHeap * This); + +#else + D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12VideoMotionVectorHeap * This, + D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12VideoMotionVectorHeap, GetProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *GetProtectedResourceSession )( + ID3D12VideoMotionVectorHeap * This, + REFIID riid, + _COM_Outptr_opt_ void **ppProtectedSession); + + END_INTERFACE + } ID3D12VideoMotionVectorHeapVtbl; + + interface ID3D12VideoMotionVectorHeap + { + CONST_VTBL struct ID3D12VideoMotionVectorHeapVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoMotionVectorHeap_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoMotionVectorHeap_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoMotionVectorHeap_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoMotionVectorHeap_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoMotionVectorHeap_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoMotionVectorHeap_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoMotionVectorHeap_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoMotionVectorHeap_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#if !defined(_WIN32) + +#define ID3D12VideoMotionVectorHeap_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) +#else +#define ID3D12VideoMotionVectorHeap_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) +#endif + +#define ID3D12VideoMotionVectorHeap_GetProtectedResourceSession(This,riid,ppProtectedSession) \ + ( (This)->lpVtbl -> GetProtectedResourceSession(This,riid,ppProtectedSession) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoMotionVectorHeap_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12VideoDevice1_INTERFACE_DEFINED__ +#define __ID3D12VideoDevice1_INTERFACE_DEFINED__ + +/* interface ID3D12VideoDevice1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoDevice1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("981611AD-A144-4C83-9890-F30E26D658AB") + ID3D12VideoDevice1 : public ID3D12VideoDevice + { + public: + virtual HRESULT STDMETHODCALLTYPE CreateVideoMotionEstimator( + _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoMotionEstimator) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateVideoMotionVectorHeap( + _In_ const D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoMotionVectorHeap) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoDevice1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoDevice1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoDevice1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoDevice1 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice, CheckFeatureSupport) + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D12VideoDevice1 * This, + D3D12_FEATURE_VIDEO FeatureVideo, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice, CreateVideoDecoder) + HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoder )( + ID3D12VideoDevice1 * This, + _In_ const D3D12_VIDEO_DECODER_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoDecoder); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice, CreateVideoDecoderHeap) + HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoderHeap )( + ID3D12VideoDevice1 * This, + _In_ const D3D12_VIDEO_DECODER_HEAP_DESC *pVideoDecoderHeapDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoDecoderHeap); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice, CreateVideoProcessor) + HRESULT ( STDMETHODCALLTYPE *CreateVideoProcessor )( + ID3D12VideoDevice1 * This, + UINT NodeMask, + _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *pOutputStreamDesc, + UINT NumInputStreamDescs, + _In_reads_(NumInputStreamDescs) const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoProcessor); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice1, CreateVideoMotionEstimator) + HRESULT ( STDMETHODCALLTYPE *CreateVideoMotionEstimator )( + ID3D12VideoDevice1 * This, + _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoMotionEstimator); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice1, CreateVideoMotionVectorHeap) + HRESULT ( STDMETHODCALLTYPE *CreateVideoMotionVectorHeap )( + ID3D12VideoDevice1 * This, + _In_ const D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoMotionVectorHeap); + + END_INTERFACE + } ID3D12VideoDevice1Vtbl; + + interface ID3D12VideoDevice1 + { + CONST_VTBL struct ID3D12VideoDevice1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoDevice1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoDevice1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoDevice1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoDevice1_CheckFeatureSupport(This,FeatureVideo,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,FeatureVideo,pFeatureSupportData,FeatureSupportDataSize) ) + +#define ID3D12VideoDevice1_CreateVideoDecoder(This,pDesc,riid,ppVideoDecoder) \ + ( (This)->lpVtbl -> CreateVideoDecoder(This,pDesc,riid,ppVideoDecoder) ) + +#define ID3D12VideoDevice1_CreateVideoDecoderHeap(This,pVideoDecoderHeapDesc,riid,ppVideoDecoderHeap) \ + ( (This)->lpVtbl -> CreateVideoDecoderHeap(This,pVideoDecoderHeapDesc,riid,ppVideoDecoderHeap) ) + +#define ID3D12VideoDevice1_CreateVideoProcessor(This,NodeMask,pOutputStreamDesc,NumInputStreamDescs,pInputStreamDescs,riid,ppVideoProcessor) \ + ( (This)->lpVtbl -> CreateVideoProcessor(This,NodeMask,pOutputStreamDesc,NumInputStreamDescs,pInputStreamDescs,riid,ppVideoProcessor) ) + + +#define ID3D12VideoDevice1_CreateVideoMotionEstimator(This,pDesc,pProtectedResourceSession,riid,ppVideoMotionEstimator) \ + ( (This)->lpVtbl -> CreateVideoMotionEstimator(This,pDesc,pProtectedResourceSession,riid,ppVideoMotionEstimator) ) + +#define ID3D12VideoDevice1_CreateVideoMotionVectorHeap(This,pDesc,pProtectedResourceSession,riid,ppVideoMotionVectorHeap) \ + ( (This)->lpVtbl -> CreateVideoMotionVectorHeap(This,pDesc,pProtectedResourceSession,riid,ppVideoMotionVectorHeap) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoDevice1_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12video_0000_0011 */ +/* [local] */ + +typedef struct D3D12_RESOURCE_COORDINATE + { + UINT64 X; + UINT Y; + UINT Z; + UINT SubresourceIndex; + } D3D12_RESOURCE_COORDINATE; + +typedef struct D3D12_VIDEO_MOTION_ESTIMATOR_OUTPUT + { + ID3D12VideoMotionVectorHeap *pMotionVectorHeap; + } D3D12_VIDEO_MOTION_ESTIMATOR_OUTPUT; + +typedef struct D3D12_VIDEO_MOTION_ESTIMATOR_INPUT + { + ID3D12Resource *pInputTexture2D; + UINT InputSubresourceIndex; + ID3D12Resource *pReferenceTexture2D; + UINT ReferenceSubresourceIndex; + ID3D12VideoMotionVectorHeap *pHintMotionVectorHeap; + } D3D12_VIDEO_MOTION_ESTIMATOR_INPUT; + +typedef struct D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT + { + ID3D12Resource *pMotionVectorTexture2D; + D3D12_RESOURCE_COORDINATE MotionVectorCoordinate; + } D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT; + +typedef struct D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_INPUT + { + ID3D12VideoMotionVectorHeap *pMotionVectorHeap; + UINT PixelWidth; + UINT PixelHeight; + } D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_INPUT; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0011_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0011_v0_0_s_ifspec; + +#ifndef __ID3D12VideoEncodeCommandList_INTERFACE_DEFINED__ +#define __ID3D12VideoEncodeCommandList_INTERFACE_DEFINED__ + +/* interface ID3D12VideoEncodeCommandList */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoEncodeCommandList; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("8455293A-0CBD-4831-9B39-FBDBAB724723") + ID3D12VideoEncodeCommandList : public ID3D12CommandList + { + public: + virtual HRESULT STDMETHODCALLTYPE Close( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE Reset( + _In_ ID3D12CommandAllocator *pAllocator) = 0; + + virtual void STDMETHODCALLTYPE ClearState( void) = 0; + + virtual void STDMETHODCALLTYPE ResourceBarrier( + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers) = 0; + + virtual void STDMETHODCALLTYPE DiscardResource( + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion) = 0; + + virtual void STDMETHODCALLTYPE BeginQuery( + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index) = 0; + + virtual void STDMETHODCALLTYPE EndQuery( + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index) = 0; + + virtual void STDMETHODCALLTYPE ResolveQueryData( + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset) = 0; + + virtual void STDMETHODCALLTYPE SetPredication( + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation) = 0; + + virtual void STDMETHODCALLTYPE SetMarker( + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size) = 0; + + virtual void STDMETHODCALLTYPE BeginEvent( + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size) = 0; + + virtual void STDMETHODCALLTYPE EndEvent( void) = 0; + + virtual void STDMETHODCALLTYPE EstimateMotion( + _In_ ID3D12VideoMotionEstimator *pMotionEstimator, + _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_OUTPUT *pOutputArguments, + _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_INPUT *pInputArguments) = 0; + + virtual void STDMETHODCALLTYPE ResolveMotionVectorHeap( + const D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT *pOutputArguments, + const D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_INPUT *pInputArguments) = 0; + + virtual void STDMETHODCALLTYPE WriteBufferImmediate( + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes) = 0; + + virtual void STDMETHODCALLTYPE SetProtectedResourceSession( + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoEncodeCommandListVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoEncodeCommandList * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoEncodeCommandList * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoEncodeCommandList * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoEncodeCommandList * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoEncodeCommandList * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoEncodeCommandList * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoEncodeCommandList * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoEncodeCommandList * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12VideoEncodeCommandList * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12VideoEncodeCommandList * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12VideoEncodeCommandList * This, + _In_ ID3D12CommandAllocator *pAllocator); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12VideoEncodeCommandList * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12VideoEncodeCommandList * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12VideoEncodeCommandList * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12VideoEncodeCommandList * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12VideoEncodeCommandList * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12VideoEncodeCommandList * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12VideoEncodeCommandList * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12VideoEncodeCommandList * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12VideoEncodeCommandList * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12VideoEncodeCommandList * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, EstimateMotion) + void ( STDMETHODCALLTYPE *EstimateMotion )( + ID3D12VideoEncodeCommandList * This, + _In_ ID3D12VideoMotionEstimator *pMotionEstimator, + _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_OUTPUT *pOutputArguments, + _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_INPUT *pInputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ResolveMotionVectorHeap) + void ( STDMETHODCALLTYPE *ResolveMotionVectorHeap )( + ID3D12VideoEncodeCommandList * This, + const D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT *pOutputArguments, + const D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_INPUT *pInputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12VideoEncodeCommandList * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, SetProtectedResourceSession) + void ( STDMETHODCALLTYPE *SetProtectedResourceSession )( + ID3D12VideoEncodeCommandList * This, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession); + + END_INTERFACE + } ID3D12VideoEncodeCommandListVtbl; + + interface ID3D12VideoEncodeCommandList + { + CONST_VTBL struct ID3D12VideoEncodeCommandListVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoEncodeCommandList_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoEncodeCommandList_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoEncodeCommandList_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoEncodeCommandList_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoEncodeCommandList_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoEncodeCommandList_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoEncodeCommandList_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoEncodeCommandList_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12VideoEncodeCommandList_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12VideoEncodeCommandList_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12VideoEncodeCommandList_Reset(This,pAllocator) \ + ( (This)->lpVtbl -> Reset(This,pAllocator) ) + +#define ID3D12VideoEncodeCommandList_ClearState(This) \ + ( (This)->lpVtbl -> ClearState(This) ) + +#define ID3D12VideoEncodeCommandList_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12VideoEncodeCommandList_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12VideoEncodeCommandList_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoEncodeCommandList_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoEncodeCommandList_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12VideoEncodeCommandList_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12VideoEncodeCommandList_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12VideoEncodeCommandList_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12VideoEncodeCommandList_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12VideoEncodeCommandList_EstimateMotion(This,pMotionEstimator,pOutputArguments,pInputArguments) \ + ( (This)->lpVtbl -> EstimateMotion(This,pMotionEstimator,pOutputArguments,pInputArguments) ) + +#define ID3D12VideoEncodeCommandList_ResolveMotionVectorHeap(This,pOutputArguments,pInputArguments) \ + ( (This)->lpVtbl -> ResolveMotionVectorHeap(This,pOutputArguments,pInputArguments) ) + +#define ID3D12VideoEncodeCommandList_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) + +#define ID3D12VideoEncodeCommandList_SetProtectedResourceSession(This,pProtectedResourceSession) \ + ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoEncodeCommandList_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12video_0000_0012 */ +/* [local] */ + +typedef +enum D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAGS + { + D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAG_NONE = 0, + D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAG_SUPPORTED = 0x1 + } D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAGS ); +typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_PROTECTED_RESOURCES + { + UINT NodeIndex; + D3D12_VIDEO_DECODE_CONFIGURATION Configuration; + D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAGS SupportFlags; + } D3D12_FEATURE_DATA_VIDEO_DECODE_PROTECTED_RESOURCES; + +typedef struct D3D12_FEATURE_DATA_VIDEO_PROCESS_PROTECTED_RESOURCES + { + UINT NodeIndex; + D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAGS SupportFlags; + } D3D12_FEATURE_DATA_VIDEO_PROCESS_PROTECTED_RESOURCES; + +typedef struct D3D12_FEATURE_DATA_VIDEO_MOTION_ESTIMATOR_PROTECTED_RESOURCES + { + UINT NodeIndex; + D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAGS SupportFlags; + } D3D12_FEATURE_DATA_VIDEO_MOTION_ESTIMATOR_PROTECTED_RESOURCES; + +typedef struct D3D12_FEATURE_DATA_VIDEO_DECODER_HEAP_SIZE1 + { + D3D12_VIDEO_DECODER_HEAP_DESC VideoDecoderHeapDesc; + BOOL Protected; + UINT64 MemoryPoolL0Size; + UINT64 MemoryPoolL1Size; + } D3D12_FEATURE_DATA_VIDEO_DECODER_HEAP_SIZE1; + +typedef struct D3D12_FEATURE_DATA_VIDEO_PROCESSOR_SIZE1 + { + UINT NodeMask; + const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *pOutputStreamDesc; + UINT NumInputStreamDescs; + const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs; + BOOL Protected; + UINT64 MemoryPoolL0Size; + UINT64 MemoryPoolL1Size; + } D3D12_FEATURE_DATA_VIDEO_PROCESSOR_SIZE1; + +typedef +enum D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE + { + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE_CREATION = 0, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE_INITIALIZATION = 1, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE_EXECUTION = 2, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE_CAPS_INPUT = 3, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE_CAPS_OUTPUT = 4, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE_DEVICE_EXECUTE_INPUT = 5, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE_DEVICE_EXECUTE_OUTPUT = 6 + } D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE; + +typedef +enum D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE + { + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_UINT8 = 0, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_UINT16 = 1, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_UINT32 = 2, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_UINT64 = 3, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_SINT8 = 4, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_SINT16 = 5, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_SINT32 = 6, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_SINT64 = 7, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_FLOAT = 8, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_DOUBLE = 9, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_RESOURCE = 10 + } D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE; + +typedef +enum D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_FLAGS + { + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_FLAG_NONE = 0, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_FLAG_READ = 0x1, + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_FLAG_WRITE = 0x2 + } D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_FLAGS ); +typedef struct D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_COUNT + { + UINT NodeIndex; + UINT CommandCount; + } D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_COUNT; + +typedef struct D3D12_VIDEO_EXTENSION_COMMAND_INFO + { + GUID CommandId; + LPCWSTR Name; + D3D12_COMMAND_LIST_SUPPORT_FLAGS CommandListSupportFlags; + } D3D12_VIDEO_EXTENSION_COMMAND_INFO; + +typedef struct D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMANDS + { + UINT NodeIndex; + UINT CommandCount; + _Field_size_full_(CommandCount) D3D12_VIDEO_EXTENSION_COMMAND_INFO *pCommandInfos; + } D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMANDS; + +typedef struct D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_PARAMETER_COUNT + { + GUID CommandId; + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE Stage; + UINT ParameterCount; + UINT ParameterPacking; + } D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_PARAMETER_COUNT; + +typedef struct D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_INFO + { + LPCWSTR Name; + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE Type; + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_FLAGS Flags; + } D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_INFO; + +typedef struct D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_PARAMETERS + { + GUID CommandId; + D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE Stage; + UINT ParameterCount; + _Field_size_full_(ParameterCount) D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_INFO *pParameterInfos; + } D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_PARAMETERS; + +typedef struct D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_SUPPORT + { + UINT NodeIndex; + GUID CommandId; + _Field_size_bytes_full_opt_(InputDataSizeInBytes) const void *pInputData; + SIZE_T InputDataSizeInBytes; + _Field_size_bytes_full_opt_(OutputDataSizeInBytes) void *pOutputData; + SIZE_T OutputDataSizeInBytes; + } D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_SUPPORT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_SIZE + { + UINT NodeIndex; + GUID CommandId; + _Field_size_bytes_full_(CreationParametersDataSizeInBytes) const void *pCreationParameters; + SIZE_T CreationParametersSizeInBytes; + UINT64 MemoryPoolL0Size; + UINT64 MemoryPoolL1Size; + } D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_SIZE; + +typedef struct D3D12_VIDEO_EXTENSION_COMMAND_DESC + { + UINT NodeMask; + GUID CommandId; + } D3D12_VIDEO_EXTENSION_COMMAND_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0012_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0012_v0_0_s_ifspec; + +#ifndef __ID3D12VideoDecoder1_INTERFACE_DEFINED__ +#define __ID3D12VideoDecoder1_INTERFACE_DEFINED__ + +/* interface ID3D12VideoDecoder1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoDecoder1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("79A2E5FB-CCD2-469A-9FDE-195D10951F7E") + ID3D12VideoDecoder1 : public ID3D12VideoDecoder + { + public: + virtual HRESULT STDMETHODCALLTYPE GetProtectedResourceSession( + REFIID riid, + _COM_Outptr_opt_ void **ppProtectedSession) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoDecoder1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoDecoder1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoDecoder1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoDecoder1 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoDecoder1 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoDecoder1 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoDecoder1 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoDecoder1 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoDecoder1 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12VideoDecoder, GetDesc) +#if !defined(_WIN32) + D3D12_VIDEO_DECODER_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12VideoDecoder1 * This); + +#else + D3D12_VIDEO_DECODER_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12VideoDecoder1 * This, + D3D12_VIDEO_DECODER_DESC * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12VideoDecoder1, GetProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *GetProtectedResourceSession )( + ID3D12VideoDecoder1 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppProtectedSession); + + END_INTERFACE + } ID3D12VideoDecoder1Vtbl; + + interface ID3D12VideoDecoder1 + { + CONST_VTBL struct ID3D12VideoDecoder1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoDecoder1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoDecoder1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoDecoder1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoDecoder1_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoDecoder1_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoDecoder1_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoDecoder1_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoDecoder1_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#if !defined(_WIN32) + +#define ID3D12VideoDecoder1_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) +#else +#define ID3D12VideoDecoder1_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) +#endif + + +#define ID3D12VideoDecoder1_GetProtectedResourceSession(This,riid,ppProtectedSession) \ + ( (This)->lpVtbl -> GetProtectedResourceSession(This,riid,ppProtectedSession) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoDecoder1_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12VideoDecoderHeap1_INTERFACE_DEFINED__ +#define __ID3D12VideoDecoderHeap1_INTERFACE_DEFINED__ + +/* interface ID3D12VideoDecoderHeap1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoDecoderHeap1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("DA1D98C5-539F-41B2-BF6B-1198A03B6D26") + ID3D12VideoDecoderHeap1 : public ID3D12VideoDecoderHeap + { + public: + virtual HRESULT STDMETHODCALLTYPE GetProtectedResourceSession( + REFIID riid, + _COM_Outptr_opt_ void **ppProtectedSession) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoDecoderHeap1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoDecoderHeap1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoDecoderHeap1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoDecoderHeap1 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoDecoderHeap1 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoDecoderHeap1 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoDecoderHeap1 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoDecoderHeap1 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoDecoderHeap1 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12VideoDecoderHeap, GetDesc) +#if !defined(_WIN32) + D3D12_VIDEO_DECODER_HEAP_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12VideoDecoderHeap1 * This); + +#else + D3D12_VIDEO_DECODER_HEAP_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12VideoDecoderHeap1 * This, + D3D12_VIDEO_DECODER_HEAP_DESC * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12VideoDecoderHeap1, GetProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *GetProtectedResourceSession )( + ID3D12VideoDecoderHeap1 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppProtectedSession); + + END_INTERFACE + } ID3D12VideoDecoderHeap1Vtbl; + + interface ID3D12VideoDecoderHeap1 + { + CONST_VTBL struct ID3D12VideoDecoderHeap1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoDecoderHeap1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoDecoderHeap1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoDecoderHeap1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoDecoderHeap1_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoDecoderHeap1_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoDecoderHeap1_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoDecoderHeap1_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoDecoderHeap1_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#if !defined(_WIN32) + +#define ID3D12VideoDecoderHeap1_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) +#else +#define ID3D12VideoDecoderHeap1_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) +#endif + + +#define ID3D12VideoDecoderHeap1_GetProtectedResourceSession(This,riid,ppProtectedSession) \ + ( (This)->lpVtbl -> GetProtectedResourceSession(This,riid,ppProtectedSession) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoDecoderHeap1_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12VideoProcessor1_INTERFACE_DEFINED__ +#define __ID3D12VideoProcessor1_INTERFACE_DEFINED__ + +/* interface ID3D12VideoProcessor1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoProcessor1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("F3CFE615-553F-425C-86D8-EE8C1B1FB01C") + ID3D12VideoProcessor1 : public ID3D12VideoProcessor + { + public: + virtual HRESULT STDMETHODCALLTYPE GetProtectedResourceSession( + REFIID riid, + _COM_Outptr_opt_ void **ppProtectedSession) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoProcessor1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoProcessor1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoProcessor1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoProcessor1 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoProcessor1 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoProcessor1 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoProcessor1 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoProcessor1 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoProcessor1 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessor, GetNodeMask) + UINT ( STDMETHODCALLTYPE *GetNodeMask )( + ID3D12VideoProcessor1 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessor, GetNumInputStreamDescs) + UINT ( STDMETHODCALLTYPE *GetNumInputStreamDescs )( + ID3D12VideoProcessor1 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessor, GetInputStreamDescs) + HRESULT ( STDMETHODCALLTYPE *GetInputStreamDescs )( + ID3D12VideoProcessor1 * This, + UINT NumInputStreamDescs, + _Out_writes_(NumInputStreamDescs) D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessor, GetOutputStreamDesc) +#if !defined(_WIN32) + D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC ( STDMETHODCALLTYPE *GetOutputStreamDesc )( + ID3D12VideoProcessor1 * This); + +#else + D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *( STDMETHODCALLTYPE *GetOutputStreamDesc )( + ID3D12VideoProcessor1 * This, + D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12VideoProcessor1, GetProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *GetProtectedResourceSession )( + ID3D12VideoProcessor1 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppProtectedSession); + + END_INTERFACE + } ID3D12VideoProcessor1Vtbl; + + interface ID3D12VideoProcessor1 + { + CONST_VTBL struct ID3D12VideoProcessor1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoProcessor1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoProcessor1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoProcessor1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoProcessor1_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoProcessor1_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoProcessor1_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoProcessor1_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoProcessor1_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + + +#define ID3D12VideoProcessor1_GetNodeMask(This) \ + ( (This)->lpVtbl -> GetNodeMask(This) ) + +#define ID3D12VideoProcessor1_GetNumInputStreamDescs(This) \ + ( (This)->lpVtbl -> GetNumInputStreamDescs(This) ) + +#define ID3D12VideoProcessor1_GetInputStreamDescs(This,NumInputStreamDescs,pInputStreamDescs) \ + ( (This)->lpVtbl -> GetInputStreamDescs(This,NumInputStreamDescs,pInputStreamDescs) ) +#if !defined(_WIN32) + +#define ID3D12VideoProcessor1_GetOutputStreamDesc(This) \ + ( (This)->lpVtbl -> GetOutputStreamDesc(This) ) +#else +#define ID3D12VideoProcessor1_GetOutputStreamDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetOutputStreamDesc(This,RetVal) ) +#endif + + +#define ID3D12VideoProcessor1_GetProtectedResourceSession(This,riid,ppProtectedSession) \ + ( (This)->lpVtbl -> GetProtectedResourceSession(This,riid,ppProtectedSession) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoProcessor1_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12VideoExtensionCommand_INTERFACE_DEFINED__ +#define __ID3D12VideoExtensionCommand_INTERFACE_DEFINED__ + +/* interface ID3D12VideoExtensionCommand */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoExtensionCommand; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("554E41E8-AE8E-4A8C-B7D2-5B4F274A30E4") + ID3D12VideoExtensionCommand : public ID3D12Pageable + { + public: +#if defined(_MSC_VER) || !defined(_WIN32) + virtual D3D12_VIDEO_EXTENSION_COMMAND_DESC STDMETHODCALLTYPE GetDesc( void) = 0; +#else + virtual D3D12_VIDEO_EXTENSION_COMMAND_DESC *STDMETHODCALLTYPE GetDesc( + D3D12_VIDEO_EXTENSION_COMMAND_DESC * RetVal) = 0; +#endif + + virtual HRESULT STDMETHODCALLTYPE GetProtectedResourceSession( + REFIID riid, + _COM_Outptr_opt_ void **ppProtectedSession) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoExtensionCommandVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoExtensionCommand * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoExtensionCommand * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoExtensionCommand * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoExtensionCommand * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoExtensionCommand * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoExtensionCommand * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoExtensionCommand * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoExtensionCommand * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12VideoExtensionCommand, GetDesc) +#if !defined(_WIN32) + D3D12_VIDEO_EXTENSION_COMMAND_DESC ( STDMETHODCALLTYPE *GetDesc )( + ID3D12VideoExtensionCommand * This); + +#else + D3D12_VIDEO_EXTENSION_COMMAND_DESC *( STDMETHODCALLTYPE *GetDesc )( + ID3D12VideoExtensionCommand * This, + D3D12_VIDEO_EXTENSION_COMMAND_DESC * RetVal); + +#endif + + DECLSPEC_XFGVIRT(ID3D12VideoExtensionCommand, GetProtectedResourceSession) + HRESULT ( STDMETHODCALLTYPE *GetProtectedResourceSession )( + ID3D12VideoExtensionCommand * This, + REFIID riid, + _COM_Outptr_opt_ void **ppProtectedSession); + + END_INTERFACE + } ID3D12VideoExtensionCommandVtbl; + + interface ID3D12VideoExtensionCommand + { + CONST_VTBL struct ID3D12VideoExtensionCommandVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoExtensionCommand_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoExtensionCommand_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoExtensionCommand_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoExtensionCommand_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoExtensionCommand_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoExtensionCommand_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoExtensionCommand_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoExtensionCommand_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#if !defined(_WIN32) + +#define ID3D12VideoExtensionCommand_GetDesc(This) \ + ( (This)->lpVtbl -> GetDesc(This) ) +#else +#define ID3D12VideoExtensionCommand_GetDesc(This,RetVal) \ + ( (This)->lpVtbl -> GetDesc(This,RetVal) ) +#endif + +#define ID3D12VideoExtensionCommand_GetProtectedResourceSession(This,riid,ppProtectedSession) \ + ( (This)->lpVtbl -> GetProtectedResourceSession(This,riid,ppProtectedSession) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoExtensionCommand_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12VideoDevice2_INTERFACE_DEFINED__ +#define __ID3D12VideoDevice2_INTERFACE_DEFINED__ + +/* interface ID3D12VideoDevice2 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoDevice2; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("F019AC49-F838-4A95-9B17-579437C8F513") + ID3D12VideoDevice2 : public ID3D12VideoDevice1 + { + public: + virtual HRESULT STDMETHODCALLTYPE CreateVideoDecoder1( + _In_ const D3D12_VIDEO_DECODER_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoDecoder) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateVideoDecoderHeap1( + _In_ const D3D12_VIDEO_DECODER_HEAP_DESC *pVideoDecoderHeapDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoDecoderHeap) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateVideoProcessor1( + UINT NodeMask, + _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *pOutputStreamDesc, + UINT NumInputStreamDescs, + _In_reads_(NumInputStreamDescs) const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoProcessor) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateVideoExtensionCommand( + _In_ const D3D12_VIDEO_EXTENSION_COMMAND_DESC *pDesc, + _In_reads_bytes_(CreationParametersDataSizeInBytes) const void *pCreationParameters, + SIZE_T CreationParametersDataSizeInBytes, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoExtensionCommand) = 0; + + virtual HRESULT STDMETHODCALLTYPE ExecuteExtensionCommand( + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(ExecutionParametersSizeInBytes) const void *pExecutionParameters, + SIZE_T ExecutionParametersSizeInBytes, + _Out_writes_bytes_(OutputDataSizeInBytes) void *pOutputData, + SIZE_T OutputDataSizeInBytes) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoDevice2Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoDevice2 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoDevice2 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoDevice2 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice, CheckFeatureSupport) + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D12VideoDevice2 * This, + D3D12_FEATURE_VIDEO FeatureVideo, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice, CreateVideoDecoder) + HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoder )( + ID3D12VideoDevice2 * This, + _In_ const D3D12_VIDEO_DECODER_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoDecoder); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice, CreateVideoDecoderHeap) + HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoderHeap )( + ID3D12VideoDevice2 * This, + _In_ const D3D12_VIDEO_DECODER_HEAP_DESC *pVideoDecoderHeapDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoDecoderHeap); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice, CreateVideoProcessor) + HRESULT ( STDMETHODCALLTYPE *CreateVideoProcessor )( + ID3D12VideoDevice2 * This, + UINT NodeMask, + _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *pOutputStreamDesc, + UINT NumInputStreamDescs, + _In_reads_(NumInputStreamDescs) const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoProcessor); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice1, CreateVideoMotionEstimator) + HRESULT ( STDMETHODCALLTYPE *CreateVideoMotionEstimator )( + ID3D12VideoDevice2 * This, + _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoMotionEstimator); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice1, CreateVideoMotionVectorHeap) + HRESULT ( STDMETHODCALLTYPE *CreateVideoMotionVectorHeap )( + ID3D12VideoDevice2 * This, + _In_ const D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoMotionVectorHeap); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice2, CreateVideoDecoder1) + HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoder1 )( + ID3D12VideoDevice2 * This, + _In_ const D3D12_VIDEO_DECODER_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoDecoder); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice2, CreateVideoDecoderHeap1) + HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoderHeap1 )( + ID3D12VideoDevice2 * This, + _In_ const D3D12_VIDEO_DECODER_HEAP_DESC *pVideoDecoderHeapDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoDecoderHeap); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice2, CreateVideoProcessor1) + HRESULT ( STDMETHODCALLTYPE *CreateVideoProcessor1 )( + ID3D12VideoDevice2 * This, + UINT NodeMask, + _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *pOutputStreamDesc, + UINT NumInputStreamDescs, + _In_reads_(NumInputStreamDescs) const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoProcessor); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice2, CreateVideoExtensionCommand) + HRESULT ( STDMETHODCALLTYPE *CreateVideoExtensionCommand )( + ID3D12VideoDevice2 * This, + _In_ const D3D12_VIDEO_EXTENSION_COMMAND_DESC *pDesc, + _In_reads_bytes_(CreationParametersDataSizeInBytes) const void *pCreationParameters, + SIZE_T CreationParametersDataSizeInBytes, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoExtensionCommand); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice2, ExecuteExtensionCommand) + HRESULT ( STDMETHODCALLTYPE *ExecuteExtensionCommand )( + ID3D12VideoDevice2 * This, + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(ExecutionParametersSizeInBytes) const void *pExecutionParameters, + SIZE_T ExecutionParametersSizeInBytes, + _Out_writes_bytes_(OutputDataSizeInBytes) void *pOutputData, + SIZE_T OutputDataSizeInBytes); + + END_INTERFACE + } ID3D12VideoDevice2Vtbl; + + interface ID3D12VideoDevice2 + { + CONST_VTBL struct ID3D12VideoDevice2Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoDevice2_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoDevice2_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoDevice2_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoDevice2_CheckFeatureSupport(This,FeatureVideo,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,FeatureVideo,pFeatureSupportData,FeatureSupportDataSize) ) + +#define ID3D12VideoDevice2_CreateVideoDecoder(This,pDesc,riid,ppVideoDecoder) \ + ( (This)->lpVtbl -> CreateVideoDecoder(This,pDesc,riid,ppVideoDecoder) ) + +#define ID3D12VideoDevice2_CreateVideoDecoderHeap(This,pVideoDecoderHeapDesc,riid,ppVideoDecoderHeap) \ + ( (This)->lpVtbl -> CreateVideoDecoderHeap(This,pVideoDecoderHeapDesc,riid,ppVideoDecoderHeap) ) + +#define ID3D12VideoDevice2_CreateVideoProcessor(This,NodeMask,pOutputStreamDesc,NumInputStreamDescs,pInputStreamDescs,riid,ppVideoProcessor) \ + ( (This)->lpVtbl -> CreateVideoProcessor(This,NodeMask,pOutputStreamDesc,NumInputStreamDescs,pInputStreamDescs,riid,ppVideoProcessor) ) + + +#define ID3D12VideoDevice2_CreateVideoMotionEstimator(This,pDesc,pProtectedResourceSession,riid,ppVideoMotionEstimator) \ + ( (This)->lpVtbl -> CreateVideoMotionEstimator(This,pDesc,pProtectedResourceSession,riid,ppVideoMotionEstimator) ) + +#define ID3D12VideoDevice2_CreateVideoMotionVectorHeap(This,pDesc,pProtectedResourceSession,riid,ppVideoMotionVectorHeap) \ + ( (This)->lpVtbl -> CreateVideoMotionVectorHeap(This,pDesc,pProtectedResourceSession,riid,ppVideoMotionVectorHeap) ) + + +#define ID3D12VideoDevice2_CreateVideoDecoder1(This,pDesc,pProtectedResourceSession,riid,ppVideoDecoder) \ + ( (This)->lpVtbl -> CreateVideoDecoder1(This,pDesc,pProtectedResourceSession,riid,ppVideoDecoder) ) + +#define ID3D12VideoDevice2_CreateVideoDecoderHeap1(This,pVideoDecoderHeapDesc,pProtectedResourceSession,riid,ppVideoDecoderHeap) \ + ( (This)->lpVtbl -> CreateVideoDecoderHeap1(This,pVideoDecoderHeapDesc,pProtectedResourceSession,riid,ppVideoDecoderHeap) ) + +#define ID3D12VideoDevice2_CreateVideoProcessor1(This,NodeMask,pOutputStreamDesc,NumInputStreamDescs,pInputStreamDescs,pProtectedResourceSession,riid,ppVideoProcessor) \ + ( (This)->lpVtbl -> CreateVideoProcessor1(This,NodeMask,pOutputStreamDesc,NumInputStreamDescs,pInputStreamDescs,pProtectedResourceSession,riid,ppVideoProcessor) ) + +#define ID3D12VideoDevice2_CreateVideoExtensionCommand(This,pDesc,pCreationParameters,CreationParametersDataSizeInBytes,pProtectedResourceSession,riid,ppVideoExtensionCommand) \ + ( (This)->lpVtbl -> CreateVideoExtensionCommand(This,pDesc,pCreationParameters,CreationParametersDataSizeInBytes,pProtectedResourceSession,riid,ppVideoExtensionCommand) ) + +#define ID3D12VideoDevice2_ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes,pOutputData,OutputDataSizeInBytes) \ + ( (This)->lpVtbl -> ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes,pOutputData,OutputDataSizeInBytes) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoDevice2_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12VideoDecodeCommandList2_INTERFACE_DEFINED__ +#define __ID3D12VideoDecodeCommandList2_INTERFACE_DEFINED__ + +/* interface ID3D12VideoDecodeCommandList2 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoDecodeCommandList2; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("6e120880-c114-4153-8036-d247051e1729") + ID3D12VideoDecodeCommandList2 : public ID3D12VideoDecodeCommandList1 + { + public: + virtual void STDMETHODCALLTYPE SetProtectedResourceSession( + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession) = 0; + + virtual void STDMETHODCALLTYPE InitializeExtensionCommand( + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(InitializationParametersSizeInBytes) const void *pInitializationParameters, + SIZE_T InitializationParametersSizeInBytes) = 0; + + virtual void STDMETHODCALLTYPE ExecuteExtensionCommand( + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(ExecutionParametersSizeInBytes) const void *pExecutionParameters, + SIZE_T ExecutionParametersSizeInBytes) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoDecodeCommandList2Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoDecodeCommandList2 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoDecodeCommandList2 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoDecodeCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoDecodeCommandList2 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoDecodeCommandList2 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoDecodeCommandList2 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoDecodeCommandList2 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoDecodeCommandList2 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12VideoDecodeCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12VideoDecodeCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12VideoDecodeCommandList2 * This, + _In_ ID3D12CommandAllocator *pAllocator); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12VideoDecodeCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12VideoDecodeCommandList2 * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12VideoDecodeCommandList2 * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12VideoDecodeCommandList2 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12VideoDecodeCommandList2 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12VideoDecodeCommandList2 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12VideoDecodeCommandList2 * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12VideoDecodeCommandList2 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12VideoDecodeCommandList2 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12VideoDecodeCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, DecodeFrame) + void ( STDMETHODCALLTYPE *DecodeFrame )( + ID3D12VideoDecodeCommandList2 * This, + _In_ ID3D12VideoDecoder *pDecoder, + _In_ const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS *pOutputArguments, + _In_ const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *pInputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12VideoDecodeCommandList2 * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList1, DecodeFrame1) + void ( STDMETHODCALLTYPE *DecodeFrame1 )( + ID3D12VideoDecodeCommandList2 * This, + _In_ ID3D12VideoDecoder *pDecoder, + _In_ const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS1 *pOutputArguments, + _In_ const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *pInputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList2, SetProtectedResourceSession) + void ( STDMETHODCALLTYPE *SetProtectedResourceSession )( + ID3D12VideoDecodeCommandList2 * This, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList2, InitializeExtensionCommand) + void ( STDMETHODCALLTYPE *InitializeExtensionCommand )( + ID3D12VideoDecodeCommandList2 * This, + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(InitializationParametersSizeInBytes) const void *pInitializationParameters, + SIZE_T InitializationParametersSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList2, ExecuteExtensionCommand) + void ( STDMETHODCALLTYPE *ExecuteExtensionCommand )( + ID3D12VideoDecodeCommandList2 * This, + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(ExecutionParametersSizeInBytes) const void *pExecutionParameters, + SIZE_T ExecutionParametersSizeInBytes); + + END_INTERFACE + } ID3D12VideoDecodeCommandList2Vtbl; + + interface ID3D12VideoDecodeCommandList2 + { + CONST_VTBL struct ID3D12VideoDecodeCommandList2Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoDecodeCommandList2_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoDecodeCommandList2_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoDecodeCommandList2_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoDecodeCommandList2_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoDecodeCommandList2_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoDecodeCommandList2_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoDecodeCommandList2_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoDecodeCommandList2_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12VideoDecodeCommandList2_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12VideoDecodeCommandList2_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12VideoDecodeCommandList2_Reset(This,pAllocator) \ + ( (This)->lpVtbl -> Reset(This,pAllocator) ) + +#define ID3D12VideoDecodeCommandList2_ClearState(This) \ + ( (This)->lpVtbl -> ClearState(This) ) + +#define ID3D12VideoDecodeCommandList2_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12VideoDecodeCommandList2_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12VideoDecodeCommandList2_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoDecodeCommandList2_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoDecodeCommandList2_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12VideoDecodeCommandList2_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12VideoDecodeCommandList2_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12VideoDecodeCommandList2_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12VideoDecodeCommandList2_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12VideoDecodeCommandList2_DecodeFrame(This,pDecoder,pOutputArguments,pInputArguments) \ + ( (This)->lpVtbl -> DecodeFrame(This,pDecoder,pOutputArguments,pInputArguments) ) + +#define ID3D12VideoDecodeCommandList2_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) + + +#define ID3D12VideoDecodeCommandList2_DecodeFrame1(This,pDecoder,pOutputArguments,pInputArguments) \ + ( (This)->lpVtbl -> DecodeFrame1(This,pDecoder,pOutputArguments,pInputArguments) ) + + +#define ID3D12VideoDecodeCommandList2_SetProtectedResourceSession(This,pProtectedResourceSession) \ + ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) ) + +#define ID3D12VideoDecodeCommandList2_InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) \ + ( (This)->lpVtbl -> InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) ) + +#define ID3D12VideoDecodeCommandList2_ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) \ + ( (This)->lpVtbl -> ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoDecodeCommandList2_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12VideoDecodeCommandList3_INTERFACE_DEFINED__ +#define __ID3D12VideoDecodeCommandList3_INTERFACE_DEFINED__ + +/* interface ID3D12VideoDecodeCommandList3 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoDecodeCommandList3; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("2aee8c37-9562-42da-8abf-61efeb2e4513") + ID3D12VideoDecodeCommandList3 : public ID3D12VideoDecodeCommandList2 + { + public: + virtual void STDMETHODCALLTYPE Barrier( + UINT32 NumBarrierGroups, + _In_reads_(NumBarrierGroups) const D3D12_BARRIER_GROUP *pBarrierGroups) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoDecodeCommandList3Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoDecodeCommandList3 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoDecodeCommandList3 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoDecodeCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoDecodeCommandList3 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoDecodeCommandList3 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoDecodeCommandList3 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoDecodeCommandList3 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoDecodeCommandList3 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12VideoDecodeCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12VideoDecodeCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12VideoDecodeCommandList3 * This, + _In_ ID3D12CommandAllocator *pAllocator); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12VideoDecodeCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12VideoDecodeCommandList3 * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12VideoDecodeCommandList3 * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12VideoDecodeCommandList3 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12VideoDecodeCommandList3 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12VideoDecodeCommandList3 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12VideoDecodeCommandList3 * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12VideoDecodeCommandList3 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12VideoDecodeCommandList3 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12VideoDecodeCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, DecodeFrame) + void ( STDMETHODCALLTYPE *DecodeFrame )( + ID3D12VideoDecodeCommandList3 * This, + _In_ ID3D12VideoDecoder *pDecoder, + _In_ const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS *pOutputArguments, + _In_ const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *pInputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12VideoDecodeCommandList3 * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList1, DecodeFrame1) + void ( STDMETHODCALLTYPE *DecodeFrame1 )( + ID3D12VideoDecodeCommandList3 * This, + _In_ ID3D12VideoDecoder *pDecoder, + _In_ const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS1 *pOutputArguments, + _In_ const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *pInputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList2, SetProtectedResourceSession) + void ( STDMETHODCALLTYPE *SetProtectedResourceSession )( + ID3D12VideoDecodeCommandList3 * This, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList2, InitializeExtensionCommand) + void ( STDMETHODCALLTYPE *InitializeExtensionCommand )( + ID3D12VideoDecodeCommandList3 * This, + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(InitializationParametersSizeInBytes) const void *pInitializationParameters, + SIZE_T InitializationParametersSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList2, ExecuteExtensionCommand) + void ( STDMETHODCALLTYPE *ExecuteExtensionCommand )( + ID3D12VideoDecodeCommandList3 * This, + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(ExecutionParametersSizeInBytes) const void *pExecutionParameters, + SIZE_T ExecutionParametersSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList3, Barrier) + void ( STDMETHODCALLTYPE *Barrier )( + ID3D12VideoDecodeCommandList3 * This, + UINT32 NumBarrierGroups, + _In_reads_(NumBarrierGroups) const D3D12_BARRIER_GROUP *pBarrierGroups); + + END_INTERFACE + } ID3D12VideoDecodeCommandList3Vtbl; + + interface ID3D12VideoDecodeCommandList3 + { + CONST_VTBL struct ID3D12VideoDecodeCommandList3Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoDecodeCommandList3_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoDecodeCommandList3_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoDecodeCommandList3_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoDecodeCommandList3_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoDecodeCommandList3_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoDecodeCommandList3_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoDecodeCommandList3_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoDecodeCommandList3_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12VideoDecodeCommandList3_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12VideoDecodeCommandList3_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12VideoDecodeCommandList3_Reset(This,pAllocator) \ + ( (This)->lpVtbl -> Reset(This,pAllocator) ) + +#define ID3D12VideoDecodeCommandList3_ClearState(This) \ + ( (This)->lpVtbl -> ClearState(This) ) + +#define ID3D12VideoDecodeCommandList3_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12VideoDecodeCommandList3_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12VideoDecodeCommandList3_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoDecodeCommandList3_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoDecodeCommandList3_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12VideoDecodeCommandList3_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12VideoDecodeCommandList3_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12VideoDecodeCommandList3_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12VideoDecodeCommandList3_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12VideoDecodeCommandList3_DecodeFrame(This,pDecoder,pOutputArguments,pInputArguments) \ + ( (This)->lpVtbl -> DecodeFrame(This,pDecoder,pOutputArguments,pInputArguments) ) + +#define ID3D12VideoDecodeCommandList3_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) + + +#define ID3D12VideoDecodeCommandList3_DecodeFrame1(This,pDecoder,pOutputArguments,pInputArguments) \ + ( (This)->lpVtbl -> DecodeFrame1(This,pDecoder,pOutputArguments,pInputArguments) ) + + +#define ID3D12VideoDecodeCommandList3_SetProtectedResourceSession(This,pProtectedResourceSession) \ + ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) ) + +#define ID3D12VideoDecodeCommandList3_InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) \ + ( (This)->lpVtbl -> InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) ) + +#define ID3D12VideoDecodeCommandList3_ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) \ + ( (This)->lpVtbl -> ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) ) + + +#define ID3D12VideoDecodeCommandList3_Barrier(This,NumBarrierGroups,pBarrierGroups) \ + ( (This)->lpVtbl -> Barrier(This,NumBarrierGroups,pBarrierGroups) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoDecodeCommandList3_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12VideoProcessCommandList2_INTERFACE_DEFINED__ +#define __ID3D12VideoProcessCommandList2_INTERFACE_DEFINED__ + +/* interface ID3D12VideoProcessCommandList2 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoProcessCommandList2; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("db525ae4-6ad6-473c-baa7-59b2e37082e4") + ID3D12VideoProcessCommandList2 : public ID3D12VideoProcessCommandList1 + { + public: + virtual void STDMETHODCALLTYPE SetProtectedResourceSession( + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession) = 0; + + virtual void STDMETHODCALLTYPE InitializeExtensionCommand( + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(InitializationParametersSizeInBytes) const void *pInitializationParameters, + SIZE_T InitializationParametersSizeInBytes) = 0; + + virtual void STDMETHODCALLTYPE ExecuteExtensionCommand( + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(ExecutionParametersSizeInBytes) const void *pExecutionParameters, + SIZE_T ExecutionParametersSizeInBytes) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoProcessCommandList2Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoProcessCommandList2 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoProcessCommandList2 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoProcessCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoProcessCommandList2 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoProcessCommandList2 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoProcessCommandList2 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoProcessCommandList2 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoProcessCommandList2 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12VideoProcessCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12VideoProcessCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12VideoProcessCommandList2 * This, + _In_ ID3D12CommandAllocator *pAllocator); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12VideoProcessCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12VideoProcessCommandList2 * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12VideoProcessCommandList2 * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12VideoProcessCommandList2 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12VideoProcessCommandList2 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12VideoProcessCommandList2 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12VideoProcessCommandList2 * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12VideoProcessCommandList2 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12VideoProcessCommandList2 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12VideoProcessCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ProcessFrames) + void ( STDMETHODCALLTYPE *ProcessFrames )( + ID3D12VideoProcessCommandList2 * This, + _In_ ID3D12VideoProcessor *pVideoProcessor, + _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS *pOutputArguments, + UINT NumInputStreams, + _In_reads_(NumInputStreams) const D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS *pInputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12VideoProcessCommandList2 * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList1, ProcessFrames1) + void ( STDMETHODCALLTYPE *ProcessFrames1 )( + ID3D12VideoProcessCommandList2 * This, + _In_ ID3D12VideoProcessor *pVideoProcessor, + _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS *pOutputArguments, + UINT NumInputStreams, + _In_reads_(NumInputStreams) const D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS1 *pInputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList2, SetProtectedResourceSession) + void ( STDMETHODCALLTYPE *SetProtectedResourceSession )( + ID3D12VideoProcessCommandList2 * This, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList2, InitializeExtensionCommand) + void ( STDMETHODCALLTYPE *InitializeExtensionCommand )( + ID3D12VideoProcessCommandList2 * This, + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(InitializationParametersSizeInBytes) const void *pInitializationParameters, + SIZE_T InitializationParametersSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList2, ExecuteExtensionCommand) + void ( STDMETHODCALLTYPE *ExecuteExtensionCommand )( + ID3D12VideoProcessCommandList2 * This, + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(ExecutionParametersSizeInBytes) const void *pExecutionParameters, + SIZE_T ExecutionParametersSizeInBytes); + + END_INTERFACE + } ID3D12VideoProcessCommandList2Vtbl; + + interface ID3D12VideoProcessCommandList2 + { + CONST_VTBL struct ID3D12VideoProcessCommandList2Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoProcessCommandList2_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoProcessCommandList2_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoProcessCommandList2_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoProcessCommandList2_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoProcessCommandList2_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoProcessCommandList2_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoProcessCommandList2_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoProcessCommandList2_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12VideoProcessCommandList2_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12VideoProcessCommandList2_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12VideoProcessCommandList2_Reset(This,pAllocator) \ + ( (This)->lpVtbl -> Reset(This,pAllocator) ) + +#define ID3D12VideoProcessCommandList2_ClearState(This) \ + ( (This)->lpVtbl -> ClearState(This) ) + +#define ID3D12VideoProcessCommandList2_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12VideoProcessCommandList2_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12VideoProcessCommandList2_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoProcessCommandList2_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoProcessCommandList2_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12VideoProcessCommandList2_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12VideoProcessCommandList2_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12VideoProcessCommandList2_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12VideoProcessCommandList2_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12VideoProcessCommandList2_ProcessFrames(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) \ + ( (This)->lpVtbl -> ProcessFrames(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) ) + +#define ID3D12VideoProcessCommandList2_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) + + +#define ID3D12VideoProcessCommandList2_ProcessFrames1(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) \ + ( (This)->lpVtbl -> ProcessFrames1(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) ) + + +#define ID3D12VideoProcessCommandList2_SetProtectedResourceSession(This,pProtectedResourceSession) \ + ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) ) + +#define ID3D12VideoProcessCommandList2_InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) \ + ( (This)->lpVtbl -> InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) ) + +#define ID3D12VideoProcessCommandList2_ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) \ + ( (This)->lpVtbl -> ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoProcessCommandList2_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12VideoProcessCommandList3_INTERFACE_DEFINED__ +#define __ID3D12VideoProcessCommandList3_INTERFACE_DEFINED__ + +/* interface ID3D12VideoProcessCommandList3 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoProcessCommandList3; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("1a0a4ca4-9f08-40ce-9558-b411fd2666ff") + ID3D12VideoProcessCommandList3 : public ID3D12VideoProcessCommandList2 + { + public: + virtual void STDMETHODCALLTYPE Barrier( + UINT32 NumBarrierGroups, + _In_reads_(NumBarrierGroups) const D3D12_BARRIER_GROUP *pBarrierGroups) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoProcessCommandList3Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoProcessCommandList3 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoProcessCommandList3 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoProcessCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoProcessCommandList3 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoProcessCommandList3 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoProcessCommandList3 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoProcessCommandList3 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoProcessCommandList3 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12VideoProcessCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12VideoProcessCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12VideoProcessCommandList3 * This, + _In_ ID3D12CommandAllocator *pAllocator); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12VideoProcessCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12VideoProcessCommandList3 * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12VideoProcessCommandList3 * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12VideoProcessCommandList3 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12VideoProcessCommandList3 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12VideoProcessCommandList3 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12VideoProcessCommandList3 * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12VideoProcessCommandList3 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12VideoProcessCommandList3 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12VideoProcessCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ProcessFrames) + void ( STDMETHODCALLTYPE *ProcessFrames )( + ID3D12VideoProcessCommandList3 * This, + _In_ ID3D12VideoProcessor *pVideoProcessor, + _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS *pOutputArguments, + UINT NumInputStreams, + _In_reads_(NumInputStreams) const D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS *pInputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12VideoProcessCommandList3 * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList1, ProcessFrames1) + void ( STDMETHODCALLTYPE *ProcessFrames1 )( + ID3D12VideoProcessCommandList3 * This, + _In_ ID3D12VideoProcessor *pVideoProcessor, + _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS *pOutputArguments, + UINT NumInputStreams, + _In_reads_(NumInputStreams) const D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS1 *pInputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList2, SetProtectedResourceSession) + void ( STDMETHODCALLTYPE *SetProtectedResourceSession )( + ID3D12VideoProcessCommandList3 * This, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList2, InitializeExtensionCommand) + void ( STDMETHODCALLTYPE *InitializeExtensionCommand )( + ID3D12VideoProcessCommandList3 * This, + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(InitializationParametersSizeInBytes) const void *pInitializationParameters, + SIZE_T InitializationParametersSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList2, ExecuteExtensionCommand) + void ( STDMETHODCALLTYPE *ExecuteExtensionCommand )( + ID3D12VideoProcessCommandList3 * This, + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(ExecutionParametersSizeInBytes) const void *pExecutionParameters, + SIZE_T ExecutionParametersSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList3, Barrier) + void ( STDMETHODCALLTYPE *Barrier )( + ID3D12VideoProcessCommandList3 * This, + UINT32 NumBarrierGroups, + _In_reads_(NumBarrierGroups) const D3D12_BARRIER_GROUP *pBarrierGroups); + + END_INTERFACE + } ID3D12VideoProcessCommandList3Vtbl; + + interface ID3D12VideoProcessCommandList3 + { + CONST_VTBL struct ID3D12VideoProcessCommandList3Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoProcessCommandList3_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoProcessCommandList3_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoProcessCommandList3_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoProcessCommandList3_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoProcessCommandList3_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoProcessCommandList3_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoProcessCommandList3_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoProcessCommandList3_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12VideoProcessCommandList3_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12VideoProcessCommandList3_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12VideoProcessCommandList3_Reset(This,pAllocator) \ + ( (This)->lpVtbl -> Reset(This,pAllocator) ) + +#define ID3D12VideoProcessCommandList3_ClearState(This) \ + ( (This)->lpVtbl -> ClearState(This) ) + +#define ID3D12VideoProcessCommandList3_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12VideoProcessCommandList3_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12VideoProcessCommandList3_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoProcessCommandList3_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoProcessCommandList3_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12VideoProcessCommandList3_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12VideoProcessCommandList3_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12VideoProcessCommandList3_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12VideoProcessCommandList3_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12VideoProcessCommandList3_ProcessFrames(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) \ + ( (This)->lpVtbl -> ProcessFrames(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) ) + +#define ID3D12VideoProcessCommandList3_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) + + +#define ID3D12VideoProcessCommandList3_ProcessFrames1(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) \ + ( (This)->lpVtbl -> ProcessFrames1(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) ) + + +#define ID3D12VideoProcessCommandList3_SetProtectedResourceSession(This,pProtectedResourceSession) \ + ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) ) + +#define ID3D12VideoProcessCommandList3_InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) \ + ( (This)->lpVtbl -> InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) ) + +#define ID3D12VideoProcessCommandList3_ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) \ + ( (This)->lpVtbl -> ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) ) + + +#define ID3D12VideoProcessCommandList3_Barrier(This,NumBarrierGroups,pBarrierGroups) \ + ( (This)->lpVtbl -> Barrier(This,NumBarrierGroups,pBarrierGroups) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoProcessCommandList3_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12VideoEncodeCommandList1_INTERFACE_DEFINED__ +#define __ID3D12VideoEncodeCommandList1_INTERFACE_DEFINED__ + +/* interface ID3D12VideoEncodeCommandList1 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoEncodeCommandList1; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("94971eca-2bdb-4769-88cf-3675ea757ebc") + ID3D12VideoEncodeCommandList1 : public ID3D12VideoEncodeCommandList + { + public: + virtual void STDMETHODCALLTYPE InitializeExtensionCommand( + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(InitializationParametersSizeInBytes) const void *pInitializationParameters, + SIZE_T InitializationParametersSizeInBytes) = 0; + + virtual void STDMETHODCALLTYPE ExecuteExtensionCommand( + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(ExecutionParametersSizeInBytes) const void *pExecutionParameters, + SIZE_T ExecutionParametersSizeInBytes) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoEncodeCommandList1Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoEncodeCommandList1 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoEncodeCommandList1 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoEncodeCommandList1 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoEncodeCommandList1 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoEncodeCommandList1 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoEncodeCommandList1 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoEncodeCommandList1 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoEncodeCommandList1 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12VideoEncodeCommandList1 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12VideoEncodeCommandList1 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12VideoEncodeCommandList1 * This, + _In_ ID3D12CommandAllocator *pAllocator); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12VideoEncodeCommandList1 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12VideoEncodeCommandList1 * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12VideoEncodeCommandList1 * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12VideoEncodeCommandList1 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12VideoEncodeCommandList1 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12VideoEncodeCommandList1 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12VideoEncodeCommandList1 * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12VideoEncodeCommandList1 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12VideoEncodeCommandList1 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12VideoEncodeCommandList1 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, EstimateMotion) + void ( STDMETHODCALLTYPE *EstimateMotion )( + ID3D12VideoEncodeCommandList1 * This, + _In_ ID3D12VideoMotionEstimator *pMotionEstimator, + _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_OUTPUT *pOutputArguments, + _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_INPUT *pInputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ResolveMotionVectorHeap) + void ( STDMETHODCALLTYPE *ResolveMotionVectorHeap )( + ID3D12VideoEncodeCommandList1 * This, + const D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT *pOutputArguments, + const D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_INPUT *pInputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12VideoEncodeCommandList1 * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, SetProtectedResourceSession) + void ( STDMETHODCALLTYPE *SetProtectedResourceSession )( + ID3D12VideoEncodeCommandList1 * This, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList1, InitializeExtensionCommand) + void ( STDMETHODCALLTYPE *InitializeExtensionCommand )( + ID3D12VideoEncodeCommandList1 * This, + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(InitializationParametersSizeInBytes) const void *pInitializationParameters, + SIZE_T InitializationParametersSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList1, ExecuteExtensionCommand) + void ( STDMETHODCALLTYPE *ExecuteExtensionCommand )( + ID3D12VideoEncodeCommandList1 * This, + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(ExecutionParametersSizeInBytes) const void *pExecutionParameters, + SIZE_T ExecutionParametersSizeInBytes); + + END_INTERFACE + } ID3D12VideoEncodeCommandList1Vtbl; + + interface ID3D12VideoEncodeCommandList1 + { + CONST_VTBL struct ID3D12VideoEncodeCommandList1Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoEncodeCommandList1_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoEncodeCommandList1_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoEncodeCommandList1_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoEncodeCommandList1_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoEncodeCommandList1_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoEncodeCommandList1_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoEncodeCommandList1_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoEncodeCommandList1_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12VideoEncodeCommandList1_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12VideoEncodeCommandList1_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12VideoEncodeCommandList1_Reset(This,pAllocator) \ + ( (This)->lpVtbl -> Reset(This,pAllocator) ) + +#define ID3D12VideoEncodeCommandList1_ClearState(This) \ + ( (This)->lpVtbl -> ClearState(This) ) + +#define ID3D12VideoEncodeCommandList1_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12VideoEncodeCommandList1_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12VideoEncodeCommandList1_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoEncodeCommandList1_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoEncodeCommandList1_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12VideoEncodeCommandList1_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12VideoEncodeCommandList1_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12VideoEncodeCommandList1_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12VideoEncodeCommandList1_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12VideoEncodeCommandList1_EstimateMotion(This,pMotionEstimator,pOutputArguments,pInputArguments) \ + ( (This)->lpVtbl -> EstimateMotion(This,pMotionEstimator,pOutputArguments,pInputArguments) ) + +#define ID3D12VideoEncodeCommandList1_ResolveMotionVectorHeap(This,pOutputArguments,pInputArguments) \ + ( (This)->lpVtbl -> ResolveMotionVectorHeap(This,pOutputArguments,pInputArguments) ) + +#define ID3D12VideoEncodeCommandList1_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) + +#define ID3D12VideoEncodeCommandList1_SetProtectedResourceSession(This,pProtectedResourceSession) \ + ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) ) + + +#define ID3D12VideoEncodeCommandList1_InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) \ + ( (This)->lpVtbl -> InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) ) + +#define ID3D12VideoEncodeCommandList1_ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) \ + ( (This)->lpVtbl -> ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoEncodeCommandList1_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12video_0000_0022 */ +/* [local] */ + +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MPEG2, 0xee27417f, 0x5e28, 0x4e65, 0xbe, 0xea, 0x1d, 0x26, 0xb5, 0x08, 0xad, 0xc9); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MPEG1_AND_MPEG2, 0x86695f12, 0x340e, 0x4f04, 0x9f, 0xd3, 0x92, 0x53, 0xdd, 0x32, 0x74, 0x60); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_H264, 0x1b81be68, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_H264_STEREO_PROGRESSIVE, 0xd79be8da, 0x0cf1, 0x4c81, 0xb8, 0x2a, 0x69, 0xa4, 0xe2, 0x36, 0xf4, 0x3d); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_H264_STEREO, 0xf9aaccbb, 0xc2b6, 0x4cfc, 0x87, 0x79, 0x57, 0x07, 0xb1, 0x76, 0x05, 0x52); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_H264_MULTIVIEW, 0x705b9d82, 0x76cf, 0x49d6, 0xb7, 0xe6, 0xac, 0x88, 0x72, 0xdb, 0x01, 0x3c); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_VC1, 0x1b81beA3, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_VC1_D2010, 0x1b81beA4, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MPEG4PT2_SIMPLE, 0xefd64d74, 0xc9e8,0x41d7,0xa5,0xe9,0xe9,0xb0,0xe3,0x9f,0xa3,0x19); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MPEG4PT2_ADVSIMPLE_NOGMC, 0xed418a9f, 0x010d, 0x4eda, 0x9a, 0xe3, 0x9a, 0x65, 0x35, 0x8d, 0x8d, 0x2e); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN, 0x5b11d51b, 0x2f4c, 0x4452, 0xbc, 0xc3, 0x09, 0xf2, 0xa1, 0x16, 0x0c, 0xc0); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN10, 0x107af0e0, 0xef1a, 0x4d19, 0xab, 0xa8, 0x67, 0xa1, 0x63, 0x07, 0x3d, 0x13); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_VP9, 0x463707f8, 0xa1d0, 0x4585, 0x87, 0x6d, 0x83, 0xaa, 0x6d, 0x60, 0xb8, 0x9e); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_VP9_10BIT_PROFILE2, 0xa4c749ef, 0x6ecf, 0x48aa, 0x84, 0x48, 0x50, 0xa7, 0xa1, 0x16, 0x5f, 0xf7); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_VP8, 0x90b899ea, 0x3a62, 0x4705, 0x88, 0xb3, 0x8d, 0xf0, 0x4b, 0x27, 0x44, 0xe7); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_AV1_PROFILE0, 0xb8be4ccb, 0xcf53, 0x46ba, 0x8d, 0x59, 0xd6, 0xb8, 0xa6, 0xda, 0x5d, 0x2a); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_AV1_PROFILE1, 0x6936ff0f, 0x45b1, 0x4163, 0x9c, 0xc1, 0x64, 0x6e, 0xf6, 0x94, 0x61, 0x08); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_AV1_PROFILE2, 0x0c5f2aa1, 0xe541, 0x4089, 0xbb, 0x7b, 0x98, 0x11, 0x0a, 0x19, 0xd7, 0xc8); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_AV1_12BIT_PROFILE2, 0x17127009, 0xa00f, 0x4ce1, 0x99, 0x4e, 0xbf, 0x40, 0x81, 0xf6, 0xf3, 0xf0); +DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_AV1_12BIT_PROFILE2_420, 0x2d80bed6, 0x9cac, 0x4835, 0x9e, 0x91, 0x32, 0x7b, 0xbc, 0x4f, 0x9e, 0xe8); +typedef +enum D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE + { + D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE_ABSOLUTE_QP_MAP = 0, + D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE_CQP = 1, + D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE_CBR = 2, + D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE_VBR = 3, + D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE_QVBR = 4 + } D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE; + +typedef +enum D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAGS + { + D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_NONE = 0, + D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_DELTA_QP = 0x1, + D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_FRAME_ANALYSIS = 0x2, + D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_QP_RANGE = 0x4, + D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_INITIAL_QP = 0x8, + D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_MAX_FRAME_SIZE = 0x10, + D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_VBV_SIZES = 0x20 + } D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAGS); +typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CQP + { + UINT ConstantQP_FullIntracodedFrame; + UINT ConstantQP_InterPredictedFrame_PrevRefOnly; + UINT ConstantQP_InterPredictedFrame_BiDirectionalRef; + } D3D12_VIDEO_ENCODER_RATE_CONTROL_CQP; + +typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CBR + { + UINT InitialQP; + UINT MinQP; + UINT MaxQP; + UINT64 MaxFrameBitSize; + UINT64 TargetBitRate; + UINT64 VBVCapacity; + UINT64 InitialVBVFullness; + } D3D12_VIDEO_ENCODER_RATE_CONTROL_CBR; + +typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_VBR + { + UINT InitialQP; + UINT MinQP; + UINT MaxQP; + UINT64 MaxFrameBitSize; + UINT64 TargetAvgBitRate; + UINT64 PeakBitRate; + UINT64 VBVCapacity; + UINT64 InitialVBVFullness; + } D3D12_VIDEO_ENCODER_RATE_CONTROL_VBR; + +typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_QVBR + { + UINT InitialQP; + UINT MinQP; + UINT MaxQP; + UINT64 MaxFrameBitSize; + UINT64 TargetAvgBitRate; + UINT64 PeakBitRate; + UINT ConstantQualityTarget; + } D3D12_VIDEO_ENCODER_RATE_CONTROL_QVBR; + +typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS + { + UINT DataSize; + union + { + const D3D12_VIDEO_ENCODER_RATE_CONTROL_CQP *pConfiguration_CQP; + const D3D12_VIDEO_ENCODER_RATE_CONTROL_CBR *pConfiguration_CBR; + const D3D12_VIDEO_ENCODER_RATE_CONTROL_VBR *pConfiguration_VBR; + const D3D12_VIDEO_ENCODER_RATE_CONTROL_QVBR *pConfiguration_QVBR; + } ; + } D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS; + +typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL + { + D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE Mode; + D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAGS Flags; + D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS ConfigParams; + DXGI_RATIONAL TargetFrameRate; + } D3D12_VIDEO_ENCODER_RATE_CONTROL; + +typedef +enum D3D12_VIDEO_ENCODER_CODEC + { + D3D12_VIDEO_ENCODER_CODEC_H264 = 0, + D3D12_VIDEO_ENCODER_CODEC_HEVC = 1 + } D3D12_VIDEO_ENCODER_CODEC; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC + { + UINT NodeIndex; + D3D12_VIDEO_ENCODER_CODEC Codec; + BOOL IsSupported; + } D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC; + +typedef +enum D3D12_VIDEO_ENCODER_PROFILE_H264 + { + D3D12_VIDEO_ENCODER_PROFILE_H264_MAIN = 0, + D3D12_VIDEO_ENCODER_PROFILE_H264_HIGH = 1, + D3D12_VIDEO_ENCODER_PROFILE_H264_HIGH_10 = 2 + } D3D12_VIDEO_ENCODER_PROFILE_H264; + +typedef +enum D3D12_VIDEO_ENCODER_PROFILE_HEVC + { + D3D12_VIDEO_ENCODER_PROFILE_HEVC_MAIN = 0, + D3D12_VIDEO_ENCODER_PROFILE_HEVC_MAIN10 = 1 + } D3D12_VIDEO_ENCODER_PROFILE_HEVC; + +typedef struct D3D12_VIDEO_ENCODER_PROFILE_DESC + { + UINT DataSize; + union + { + D3D12_VIDEO_ENCODER_PROFILE_H264 *pH264Profile; + D3D12_VIDEO_ENCODER_PROFILE_HEVC *pHEVCProfile; + } ; + } D3D12_VIDEO_ENCODER_PROFILE_DESC; + +typedef +enum D3D12_VIDEO_ENCODER_LEVELS_H264 + { + D3D12_VIDEO_ENCODER_LEVELS_H264_1 = 0, + D3D12_VIDEO_ENCODER_LEVELS_H264_1b = 1, + D3D12_VIDEO_ENCODER_LEVELS_H264_11 = 2, + D3D12_VIDEO_ENCODER_LEVELS_H264_12 = 3, + D3D12_VIDEO_ENCODER_LEVELS_H264_13 = 4, + D3D12_VIDEO_ENCODER_LEVELS_H264_2 = 5, + D3D12_VIDEO_ENCODER_LEVELS_H264_21 = 6, + D3D12_VIDEO_ENCODER_LEVELS_H264_22 = 7, + D3D12_VIDEO_ENCODER_LEVELS_H264_3 = 8, + D3D12_VIDEO_ENCODER_LEVELS_H264_31 = 9, + D3D12_VIDEO_ENCODER_LEVELS_H264_32 = 10, + D3D12_VIDEO_ENCODER_LEVELS_H264_4 = 11, + D3D12_VIDEO_ENCODER_LEVELS_H264_41 = 12, + D3D12_VIDEO_ENCODER_LEVELS_H264_42 = 13, + D3D12_VIDEO_ENCODER_LEVELS_H264_5 = 14, + D3D12_VIDEO_ENCODER_LEVELS_H264_51 = 15, + D3D12_VIDEO_ENCODER_LEVELS_H264_52 = 16, + D3D12_VIDEO_ENCODER_LEVELS_H264_6 = 17, + D3D12_VIDEO_ENCODER_LEVELS_H264_61 = 18, + D3D12_VIDEO_ENCODER_LEVELS_H264_62 = 19 + } D3D12_VIDEO_ENCODER_LEVELS_H264; + +typedef +enum D3D12_VIDEO_ENCODER_TIER_HEVC + { + D3D12_VIDEO_ENCODER_TIER_HEVC_MAIN = 0, + D3D12_VIDEO_ENCODER_TIER_HEVC_HIGH = 1 + } D3D12_VIDEO_ENCODER_TIER_HEVC; + +typedef +enum D3D12_VIDEO_ENCODER_LEVELS_HEVC + { + D3D12_VIDEO_ENCODER_LEVELS_HEVC_1 = 0, + D3D12_VIDEO_ENCODER_LEVELS_HEVC_2 = 1, + D3D12_VIDEO_ENCODER_LEVELS_HEVC_21 = 2, + D3D12_VIDEO_ENCODER_LEVELS_HEVC_3 = 3, + D3D12_VIDEO_ENCODER_LEVELS_HEVC_31 = 4, + D3D12_VIDEO_ENCODER_LEVELS_HEVC_4 = 5, + D3D12_VIDEO_ENCODER_LEVELS_HEVC_41 = 6, + D3D12_VIDEO_ENCODER_LEVELS_HEVC_5 = 7, + D3D12_VIDEO_ENCODER_LEVELS_HEVC_51 = 8, + D3D12_VIDEO_ENCODER_LEVELS_HEVC_52 = 9, + D3D12_VIDEO_ENCODER_LEVELS_HEVC_6 = 10, + D3D12_VIDEO_ENCODER_LEVELS_HEVC_61 = 11, + D3D12_VIDEO_ENCODER_LEVELS_HEVC_62 = 12 + } D3D12_VIDEO_ENCODER_LEVELS_HEVC; + +typedef struct D3D12_VIDEO_ENCODER_LEVEL_TIER_CONSTRAINTS_HEVC + { + D3D12_VIDEO_ENCODER_LEVELS_HEVC Level; + D3D12_VIDEO_ENCODER_TIER_HEVC Tier; + } D3D12_VIDEO_ENCODER_LEVEL_TIER_CONSTRAINTS_HEVC; + +typedef struct D3D12_VIDEO_ENCODER_LEVEL_SETTING + { + UINT DataSize; + union + { + D3D12_VIDEO_ENCODER_LEVELS_H264 *pH264LevelSetting; + D3D12_VIDEO_ENCODER_LEVEL_TIER_CONSTRAINTS_HEVC *pHEVCLevelSetting; + } ; + } D3D12_VIDEO_ENCODER_LEVEL_SETTING; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_PROFILE_LEVEL + { + UINT NodeIndex; + D3D12_VIDEO_ENCODER_CODEC Codec; + D3D12_VIDEO_ENCODER_PROFILE_DESC Profile; + BOOL IsSupported; + D3D12_VIDEO_ENCODER_LEVEL_SETTING MinSupportedLevel; + D3D12_VIDEO_ENCODER_LEVEL_SETTING MaxSupportedLevel; + } D3D12_FEATURE_DATA_VIDEO_ENCODER_PROFILE_LEVEL; + +typedef struct D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC + { + UINT Width; + UINT Height; + } D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC; + +typedef struct D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_RATIO_DESC + { + UINT WidthRatio; + UINT HeightRatio; + } D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_RATIO_DESC; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_OUTPUT_RESOLUTION_RATIOS_COUNT + { + UINT NodeIndex; + D3D12_VIDEO_ENCODER_CODEC Codec; + UINT ResolutionRatiosCount; + } D3D12_FEATURE_DATA_VIDEO_ENCODER_OUTPUT_RESOLUTION_RATIOS_COUNT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_OUTPUT_RESOLUTION + { + UINT NodeIndex; + D3D12_VIDEO_ENCODER_CODEC Codec; + UINT ResolutionRatiosCount; + BOOL IsSupported; + D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC MinResolutionSupported; + D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC MaxResolutionSupported; + UINT ResolutionWidthMultipleRequirement; + UINT ResolutionHeightMultipleRequirement; + _Field_size_full_(ResolutionRatiosCount) D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_RATIO_DESC *pResolutionRatios; + } D3D12_FEATURE_DATA_VIDEO_ENCODER_OUTPUT_RESOLUTION; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_INPUT_FORMAT + { + UINT NodeIndex; + D3D12_VIDEO_ENCODER_CODEC Codec; + D3D12_VIDEO_ENCODER_PROFILE_DESC Profile; + DXGI_FORMAT Format; + BOOL IsSupported; + } D3D12_FEATURE_DATA_VIDEO_ENCODER_INPUT_FORMAT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_RATE_CONTROL_MODE + { + UINT NodeIndex; + D3D12_VIDEO_ENCODER_CODEC Codec; + D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE RateControlMode; + BOOL IsSupported; + } D3D12_FEATURE_DATA_VIDEO_ENCODER_RATE_CONTROL_MODE; + +typedef +enum D3D12_VIDEO_ENCODER_INTRA_REFRESH_MODE + { + D3D12_VIDEO_ENCODER_INTRA_REFRESH_MODE_NONE = 0, + D3D12_VIDEO_ENCODER_INTRA_REFRESH_MODE_ROW_BASED = 1 + } D3D12_VIDEO_ENCODER_INTRA_REFRESH_MODE; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_INTRA_REFRESH_MODE + { + UINT NodeIndex; + D3D12_VIDEO_ENCODER_CODEC Codec; + D3D12_VIDEO_ENCODER_PROFILE_DESC Profile; + D3D12_VIDEO_ENCODER_LEVEL_SETTING Level; + D3D12_VIDEO_ENCODER_INTRA_REFRESH_MODE IntraRefreshMode; + BOOL IsSupported; + } D3D12_FEATURE_DATA_VIDEO_ENCODER_INTRA_REFRESH_MODE; + +typedef +enum D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE + { + D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_FULL_FRAME = 0, + D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_BYTES_PER_SUBREGION = 1, + D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_SQUARE_UNITS_PER_SUBREGION_ROW_UNALIGNED = 2, + D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_UNIFORM_PARTITIONING_ROWS_PER_SUBREGION = 3, + D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_UNIFORM_PARTITIONING_SUBREGIONS_PER_FRAME = 4 + } D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE + { + UINT NodeIndex; + D3D12_VIDEO_ENCODER_CODEC Codec; + D3D12_VIDEO_ENCODER_PROFILE_DESC Profile; + D3D12_VIDEO_ENCODER_LEVEL_SETTING Level; + D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE SubregionMode; + BOOL IsSupported; + } D3D12_FEATURE_DATA_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE; + +typedef +enum D3D12_VIDEO_ENCODER_HEAP_FLAGS + { + D3D12_VIDEO_ENCODER_HEAP_FLAG_NONE = 0 + } D3D12_VIDEO_ENCODER_HEAP_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_HEAP_FLAGS); +typedef struct D3D12_VIDEO_ENCODER_HEAP_DESC + { + UINT NodeMask; + D3D12_VIDEO_ENCODER_HEAP_FLAGS Flags; + D3D12_VIDEO_ENCODER_CODEC EncodeCodec; + D3D12_VIDEO_ENCODER_PROFILE_DESC EncodeProfile; + D3D12_VIDEO_ENCODER_LEVEL_SETTING EncodeLevel; + UINT ResolutionsListCount; + _Field_size_full_(ResolutionsListCount) const D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC *pResolutionList; + } D3D12_VIDEO_ENCODER_HEAP_DESC; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_HEAP_SIZE + { + D3D12_VIDEO_ENCODER_HEAP_DESC HeapDesc; + BOOL IsSupported; + UINT64 MemoryPoolL0Size; + UINT64 MemoryPoolL1Size; + } D3D12_FEATURE_DATA_VIDEO_ENCODER_HEAP_SIZE; + +typedef +enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAGS + { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_NONE = 0, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_CABAC_ENCODING_SUPPORT = 0x1, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_INTRA_SLICE_CONSTRAINED_ENCODING_SUPPORT = 0x2, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_BFRAME_LTR_COMBINED_SUPPORT = 0x4, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_ADAPTIVE_8x8_TRANSFORM_ENCODING_SUPPORT = 0x8, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_DIRECT_SPATIAL_ENCODING_SUPPORT = 0x10, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_DIRECT_TEMPORAL_ENCODING_SUPPORT = 0x20, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_CONSTRAINED_INTRAPREDICTION_SUPPORT = 0x40 + } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAGS); +typedef +enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODES + { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_0_ALL_LUMA_CHROMA_SLICE_BLOCK_EDGES_ALWAYS_FILTERED = 0, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_1_DISABLE_ALL_SLICE_BLOCK_EDGES = 1, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_2_DISABLE_SLICE_BOUNDARIES_BLOCKS = 2, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_3_USE_TWO_STAGE_DEBLOCKING = 3, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_4_DISABLE_CHROMA_BLOCK_EDGES = 4, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_5_DISABLE_CHROMA_BLOCK_EDGES_AND_LUMA_BOUNDARIES = 5, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_6_DISABLE_CHROMA_BLOCK_EDGES_AND_USE_LUMA_TWO_STAGE_DEBLOCKING = 6 + } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODES; + +typedef +enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAGS + { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAG_NONE = 0, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAG_0_ALL_LUMA_CHROMA_SLICE_BLOCK_EDGES_ALWAYS_FILTERED = ( 1 << D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_0_ALL_LUMA_CHROMA_SLICE_BLOCK_EDGES_ALWAYS_FILTERED ) , + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAG_1_DISABLE_ALL_SLICE_BLOCK_EDGES = ( 1 << D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_1_DISABLE_ALL_SLICE_BLOCK_EDGES ) , + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAG_2_DISABLE_SLICE_BOUNDARIES_BLOCKS = ( 1 << D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_2_DISABLE_SLICE_BOUNDARIES_BLOCKS ) , + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAG_3_USE_TWO_STAGE_DEBLOCKING = ( 1 << D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_3_USE_TWO_STAGE_DEBLOCKING ) , + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAG_4_DISABLE_CHROMA_BLOCK_EDGES = ( 1 << D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_4_DISABLE_CHROMA_BLOCK_EDGES ) , + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAG_5_DISABLE_CHROMA_BLOCK_EDGES_AND_LUMA_BOUNDARIES = ( 1 << D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_5_DISABLE_CHROMA_BLOCK_EDGES_AND_LUMA_BOUNDARIES ) , + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAG_6_DISABLE_CHROMA_BLOCK_EDGES_AND_USE_LUMA_TWO_STAGE_DEBLOCKING = ( 1 << D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_6_DISABLE_CHROMA_BLOCK_EDGES_AND_USE_LUMA_TWO_STAGE_DEBLOCKING ) + } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAGS); +typedef struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264 + { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAGS SupportFlags; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAGS DisableDeblockingFilterSupportedModes; + } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264; + +typedef +enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAGS + { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_NONE = 0, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_BFRAME_LTR_COMBINED_SUPPORT = 0x1, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_INTRA_SLICE_CONSTRAINED_ENCODING_SUPPORT = 0x2, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_CONSTRAINED_INTRAPREDICTION_SUPPORT = 0x4, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_SAO_FILTER_SUPPORT = 0x8, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_ASYMETRIC_MOTION_PARTITION_SUPPORT = 0x10, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_ASYMETRIC_MOTION_PARTITION_REQUIRED = 0x20, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_TRANSFORM_SKIP_SUPPORT = 0x40, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_DISABLING_LOOP_FILTER_ACROSS_SLICES_SUPPORT = 0x80, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_P_FRAMES_IMPLEMENTED_AS_LOW_DELAY_B_FRAMES = 0x100 + } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAGS); +typedef +enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE + { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE_8x8 = 0, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE_16x16 = 1, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE_32x32 = 2, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE_64x64 = 3 + } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE; + +typedef +enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE + { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE_4x4 = 0, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE_8x8 = 1, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE_16x16 = 2, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE_32x32 = 3 + } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE; + +typedef struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC + { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAGS SupportFlags; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE MinLumaCodingUnitSize; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE MaxLumaCodingUnitSize; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE MinLumaTransformUnitSize; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE MaxLumaTransformUnitSize; + UCHAR max_transform_hierarchy_depth_inter; + UCHAR max_transform_hierarchy_depth_intra; + } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC; + +typedef struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT + { + UINT DataSize; + union + { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264 *pH264Support; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC *pHEVCSupport; + } ; + } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT + { + UINT NodeIndex; + D3D12_VIDEO_ENCODER_CODEC Codec; + D3D12_VIDEO_ENCODER_PROFILE_DESC Profile; + BOOL IsSupported; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT CodecSupportLimits; + } D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT; + +typedef struct D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT_H264 + { + UINT MaxL0ReferencesForP; + UINT MaxL0ReferencesForB; + UINT MaxL1ReferencesForB; + UINT MaxLongTermReferences; + UINT MaxDPBCapacity; + } D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT_H264; + +typedef struct D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT_HEVC + { + UINT MaxL0ReferencesForP; + UINT MaxL0ReferencesForB; + UINT MaxL1ReferencesForB; + UINT MaxLongTermReferences; + UINT MaxDPBCapacity; + } D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT_HEVC; + +typedef struct D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT + { + UINT DataSize; + union + { + D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT_H264 *pH264Support; + D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT_HEVC *pHEVCSupport; + } ; + } D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT + { + UINT NodeIndex; + D3D12_VIDEO_ENCODER_CODEC Codec; + D3D12_VIDEO_ENCODER_PROFILE_DESC Profile; + BOOL IsSupported; + D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT PictureSupport; + } D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT; + +typedef +enum D3D12_VIDEO_ENCODER_SUPPORT_FLAGS + { + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_NONE = 0, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_GENERAL_SUPPORT_OK = 0x1, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RATE_CONTROL_RECONFIGURATION_AVAILABLE = 0x2, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RESOLUTION_RECONFIGURATION_AVAILABLE = 0x4, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RATE_CONTROL_VBV_SIZE_CONFIG_AVAILABLE = 0x8, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RATE_CONTROL_FRAME_ANALYSIS_AVAILABLE = 0x10, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RECONSTRUCTED_FRAMES_REQUIRE_TEXTURE_ARRAYS = 0x20, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RATE_CONTROL_DELTA_QP_AVAILABLE = 0x40, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_SUBREGION_LAYOUT_RECONFIGURATION_AVAILABLE = 0x80, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RATE_CONTROL_ADJUSTABLE_QP_RANGE_AVAILABLE = 0x100, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RATE_CONTROL_INITIAL_QP_AVAILABLE = 0x200, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RATE_CONTROL_MAX_FRAME_SIZE_AVAILABLE = 0x400, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_SEQUENCE_GOP_RECONFIGURATION_AVAILABLE = 0x800, + D3D12_VIDEO_ENCODER_SUPPORT_FLAG_MOTION_ESTIMATION_PRECISION_MODE_LIMIT_AVAILABLE = 0x1000 + } D3D12_VIDEO_ENCODER_SUPPORT_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_SUPPORT_FLAGS); +typedef +enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAGS + { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAG_NONE = 0, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAG_USE_CONSTRAINED_INTRAPREDICTION = 0x1, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAG_USE_ADAPTIVE_8x8_TRANSFORM = 0x2, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAG_ENABLE_CABAC_ENCODING = 0x4, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAG_ALLOW_REQUEST_INTRA_CONSTRAINED_SLICES = 0x8 + } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAGS); +typedef +enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_DIRECT_MODES + { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_DIRECT_MODES_DISABLED = 0, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_DIRECT_MODES_TEMPORAL = 1, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_DIRECT_MODES_SPATIAL = 2 + } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_DIRECT_MODES; + +typedef struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264 + { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAGS ConfigurationFlags; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_DIRECT_MODES DirectModeConfig; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODES DisableDeblockingFilterConfig; + } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264; + +typedef +enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAGS + { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_NONE = 0, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_DISABLE_LOOP_FILTER_ACROSS_SLICES = 0x1, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_ALLOW_REQUEST_INTRA_CONSTRAINED_SLICES = 0x2, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_ENABLE_SAO_FILTER = 0x4, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_ENABLE_LONG_TERM_REFERENCES = 0x8, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_USE_ASYMETRIC_MOTION_PARTITION = 0x10, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_ENABLE_TRANSFORM_SKIPPING = 0x20, + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_USE_CONSTRAINED_INTRAPREDICTION = 0x40 + } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAGS); +typedef struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC + { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAGS ConfigurationFlags; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE MinLumaCodingUnitSize; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE MaxLumaCodingUnitSize; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE MinLumaTransformUnitSize; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE MaxLumaTransformUnitSize; + UCHAR max_transform_hierarchy_depth_inter; + UCHAR max_transform_hierarchy_depth_intra; + } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC; + +typedef struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION + { + UINT DataSize; + union + { + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264 *pH264Config; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC *pHEVCConfig; + } ; + } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION; + +typedef struct D3D12_VIDEO_ENCODER_INTRA_REFRESH + { + D3D12_VIDEO_ENCODER_INTRA_REFRESH_MODE Mode; + UINT IntraRefreshDuration; + } D3D12_VIDEO_ENCODER_INTRA_REFRESH; + +typedef +enum D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE + { + D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE_MAXIMUM = 0, + D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE_FULL_PIXEL = 1, + D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE_HALF_PIXEL = 2, + D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE_QUARTER_PIXEL = 3 + } D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOLUTION_SUPPORT_LIMITS + { + UINT MaxSubregionsNumber; + UINT MaxIntraRefreshFrameDuration; + UINT SubregionBlockPixelsSize; + UINT QPMapRegionPixelsSize; + } D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOLUTION_SUPPORT_LIMITS; + +typedef +enum D3D12_VIDEO_ENCODER_VALIDATION_FLAGS + { + D3D12_VIDEO_ENCODER_VALIDATION_FLAG_NONE = 0, + D3D12_VIDEO_ENCODER_VALIDATION_FLAG_CODEC_NOT_SUPPORTED = 0x1, + D3D12_VIDEO_ENCODER_VALIDATION_FLAG_INPUT_FORMAT_NOT_SUPPORTED = 0x8, + D3D12_VIDEO_ENCODER_VALIDATION_FLAG_CODEC_CONFIGURATION_NOT_SUPPORTED = 0x10, + D3D12_VIDEO_ENCODER_VALIDATION_FLAG_RATE_CONTROL_MODE_NOT_SUPPORTED = 0x20, + D3D12_VIDEO_ENCODER_VALIDATION_FLAG_RATE_CONTROL_CONFIGURATION_NOT_SUPPORTED = 0x40, + D3D12_VIDEO_ENCODER_VALIDATION_FLAG_INTRA_REFRESH_MODE_NOT_SUPPORTED = 0x80, + D3D12_VIDEO_ENCODER_VALIDATION_FLAG_SUBREGION_LAYOUT_MODE_NOT_SUPPORTED = 0x100, + D3D12_VIDEO_ENCODER_VALIDATION_FLAG_RESOLUTION_NOT_SUPPORTED_IN_LIST = 0x200, + D3D12_VIDEO_ENCODER_VALIDATION_FLAG_GOP_STRUCTURE_NOT_SUPPORTED = 0x800 + } D3D12_VIDEO_ENCODER_VALIDATION_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_VALIDATION_FLAGS); +typedef struct D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_H264 + { + UINT GOPLength; + UINT PPicturePeriod; + UCHAR pic_order_cnt_type; + UCHAR log2_max_frame_num_minus4; + UCHAR log2_max_pic_order_cnt_lsb_minus4; + } D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_H264; + +typedef struct D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_HEVC + { + UINT GOPLength; + UINT PPicturePeriod; + UCHAR log2_max_pic_order_cnt_lsb_minus4; + } D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_HEVC; + +typedef struct D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE + { + UINT DataSize; + union + { + D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_H264 *pH264GroupOfPictures; + D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_HEVC *pHEVCGroupOfPictures; + } ; + } D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT + { + UINT NodeIndex; + D3D12_VIDEO_ENCODER_CODEC Codec; + DXGI_FORMAT InputFormat; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION CodecConfiguration; + D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE CodecGopSequence; + D3D12_VIDEO_ENCODER_RATE_CONTROL RateControl; + D3D12_VIDEO_ENCODER_INTRA_REFRESH_MODE IntraRefresh; + D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE SubregionFrameEncoding; + UINT ResolutionsListCount; + const D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC *pResolutionList; + UINT MaxReferenceFramesInDPB; + D3D12_VIDEO_ENCODER_VALIDATION_FLAGS ValidationFlags; + D3D12_VIDEO_ENCODER_SUPPORT_FLAGS SupportFlags; + D3D12_VIDEO_ENCODER_PROFILE_DESC SuggestedProfile; + D3D12_VIDEO_ENCODER_LEVEL_SETTING SuggestedLevel; + _Field_size_full_(ResolutionsListCount) D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOLUTION_SUPPORT_LIMITS *pResolutionDependentSupport; + } D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT; + +typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOURCE_REQUIREMENTS + { + UINT NodeIndex; + D3D12_VIDEO_ENCODER_CODEC Codec; + D3D12_VIDEO_ENCODER_PROFILE_DESC Profile; + DXGI_FORMAT InputFormat; + D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC PictureTargetResolution; + BOOL IsSupported; + UINT CompressedBitstreamBufferAccessAlignment; + UINT EncoderMetadataBufferAccessAlignment; + UINT MaxEncoderOutputMetadataBufferSize; + } D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOURCE_REQUIREMENTS; + +typedef +enum D3D12_VIDEO_ENCODER_FLAGS + { + D3D12_VIDEO_ENCODER_FLAG_NONE = 0 + } D3D12_VIDEO_ENCODER_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_FLAGS); +typedef struct D3D12_VIDEO_ENCODER_DESC + { + UINT NodeMask; + D3D12_VIDEO_ENCODER_FLAGS Flags; + D3D12_VIDEO_ENCODER_CODEC EncodeCodec; + D3D12_VIDEO_ENCODER_PROFILE_DESC EncodeProfile; + DXGI_FORMAT InputFormat; + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION CodecConfiguration; + D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE MaxMotionEstimationPrecision; + } D3D12_VIDEO_ENCODER_DESC; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0022_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0022_v0_0_s_ifspec; + +#ifndef __ID3D12VideoEncoder_INTERFACE_DEFINED__ +#define __ID3D12VideoEncoder_INTERFACE_DEFINED__ + +/* interface ID3D12VideoEncoder */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoEncoder; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("2E0D212D-8DF9-44A6-A770-BB289B182737") + ID3D12VideoEncoder : public ID3D12Pageable + { + public: + virtual UINT STDMETHODCALLTYPE GetNodeMask( void) = 0; + + virtual D3D12_VIDEO_ENCODER_FLAGS STDMETHODCALLTYPE GetEncoderFlags( void) = 0; + + virtual D3D12_VIDEO_ENCODER_CODEC STDMETHODCALLTYPE GetCodec( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetCodecProfile( + _Inout_ D3D12_VIDEO_ENCODER_PROFILE_DESC dstProfile) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetCodecConfiguration( + _Inout_ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION dstCodecConfig) = 0; + + virtual DXGI_FORMAT STDMETHODCALLTYPE GetInputFormat( void) = 0; + + virtual D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE STDMETHODCALLTYPE GetMaxMotionEstimationPrecision( void) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoEncoderVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoEncoder * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoEncoder * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoEncoder * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoEncoder * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoEncoder * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoEncoder * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoEncoder * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoEncoder * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12VideoEncoder, GetNodeMask) + UINT ( STDMETHODCALLTYPE *GetNodeMask )( + ID3D12VideoEncoder * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncoder, GetEncoderFlags) + D3D12_VIDEO_ENCODER_FLAGS ( STDMETHODCALLTYPE *GetEncoderFlags )( + ID3D12VideoEncoder * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncoder, GetCodec) + D3D12_VIDEO_ENCODER_CODEC ( STDMETHODCALLTYPE *GetCodec )( + ID3D12VideoEncoder * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncoder, GetCodecProfile) + HRESULT ( STDMETHODCALLTYPE *GetCodecProfile )( + ID3D12VideoEncoder * This, + _Inout_ D3D12_VIDEO_ENCODER_PROFILE_DESC dstProfile); + + DECLSPEC_XFGVIRT(ID3D12VideoEncoder, GetCodecConfiguration) + HRESULT ( STDMETHODCALLTYPE *GetCodecConfiguration )( + ID3D12VideoEncoder * This, + _Inout_ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION dstCodecConfig); + + DECLSPEC_XFGVIRT(ID3D12VideoEncoder, GetInputFormat) + DXGI_FORMAT ( STDMETHODCALLTYPE *GetInputFormat )( + ID3D12VideoEncoder * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncoder, GetMaxMotionEstimationPrecision) + D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE ( STDMETHODCALLTYPE *GetMaxMotionEstimationPrecision )( + ID3D12VideoEncoder * This); + + END_INTERFACE + } ID3D12VideoEncoderVtbl; + + interface ID3D12VideoEncoder + { + CONST_VTBL struct ID3D12VideoEncoderVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoEncoder_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoEncoder_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoEncoder_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoEncoder_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoEncoder_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoEncoder_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoEncoder_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoEncoder_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + + +#define ID3D12VideoEncoder_GetNodeMask(This) \ + ( (This)->lpVtbl -> GetNodeMask(This) ) + +#define ID3D12VideoEncoder_GetEncoderFlags(This) \ + ( (This)->lpVtbl -> GetEncoderFlags(This) ) + +#define ID3D12VideoEncoder_GetCodec(This) \ + ( (This)->lpVtbl -> GetCodec(This) ) + +#define ID3D12VideoEncoder_GetCodecProfile(This,dstProfile) \ + ( (This)->lpVtbl -> GetCodecProfile(This,dstProfile) ) + +#define ID3D12VideoEncoder_GetCodecConfiguration(This,dstCodecConfig) \ + ( (This)->lpVtbl -> GetCodecConfiguration(This,dstCodecConfig) ) + +#define ID3D12VideoEncoder_GetInputFormat(This) \ + ( (This)->lpVtbl -> GetInputFormat(This) ) + +#define ID3D12VideoEncoder_GetMaxMotionEstimationPrecision(This) \ + ( (This)->lpVtbl -> GetMaxMotionEstimationPrecision(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoEncoder_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12VideoEncoderHeap_INTERFACE_DEFINED__ +#define __ID3D12VideoEncoderHeap_INTERFACE_DEFINED__ + +/* interface ID3D12VideoEncoderHeap */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoEncoderHeap; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("22B35D96-876A-44C0-B25E-FB8C9C7F1C4A") + ID3D12VideoEncoderHeap : public ID3D12Pageable + { + public: + virtual UINT STDMETHODCALLTYPE GetNodeMask( void) = 0; + + virtual D3D12_VIDEO_ENCODER_HEAP_FLAGS STDMETHODCALLTYPE GetEncoderHeapFlags( void) = 0; + + virtual D3D12_VIDEO_ENCODER_CODEC STDMETHODCALLTYPE GetCodec( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetCodecProfile( + _Inout_ D3D12_VIDEO_ENCODER_PROFILE_DESC dstProfile) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetCodecLevel( + _Inout_ D3D12_VIDEO_ENCODER_LEVEL_SETTING dstLevel) = 0; + + virtual UINT STDMETHODCALLTYPE GetResolutionListCount( void) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetResolutionList( + const UINT ResolutionsListCount, + _Out_writes_(ResolutionsListCount) D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC *pResolutionList) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoEncoderHeapVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoEncoderHeap * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoEncoderHeap * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoEncoderHeap * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoEncoderHeap * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoEncoderHeap * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoEncoderHeap * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoEncoderHeap * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoEncoderHeap * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12VideoEncoderHeap, GetNodeMask) + UINT ( STDMETHODCALLTYPE *GetNodeMask )( + ID3D12VideoEncoderHeap * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncoderHeap, GetEncoderHeapFlags) + D3D12_VIDEO_ENCODER_HEAP_FLAGS ( STDMETHODCALLTYPE *GetEncoderHeapFlags )( + ID3D12VideoEncoderHeap * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncoderHeap, GetCodec) + D3D12_VIDEO_ENCODER_CODEC ( STDMETHODCALLTYPE *GetCodec )( + ID3D12VideoEncoderHeap * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncoderHeap, GetCodecProfile) + HRESULT ( STDMETHODCALLTYPE *GetCodecProfile )( + ID3D12VideoEncoderHeap * This, + _Inout_ D3D12_VIDEO_ENCODER_PROFILE_DESC dstProfile); + + DECLSPEC_XFGVIRT(ID3D12VideoEncoderHeap, GetCodecLevel) + HRESULT ( STDMETHODCALLTYPE *GetCodecLevel )( + ID3D12VideoEncoderHeap * This, + _Inout_ D3D12_VIDEO_ENCODER_LEVEL_SETTING dstLevel); + + DECLSPEC_XFGVIRT(ID3D12VideoEncoderHeap, GetResolutionListCount) + UINT ( STDMETHODCALLTYPE *GetResolutionListCount )( + ID3D12VideoEncoderHeap * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncoderHeap, GetResolutionList) + HRESULT ( STDMETHODCALLTYPE *GetResolutionList )( + ID3D12VideoEncoderHeap * This, + const UINT ResolutionsListCount, + _Out_writes_(ResolutionsListCount) D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC *pResolutionList); + + END_INTERFACE + } ID3D12VideoEncoderHeapVtbl; + + interface ID3D12VideoEncoderHeap + { + CONST_VTBL struct ID3D12VideoEncoderHeapVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoEncoderHeap_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoEncoderHeap_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoEncoderHeap_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoEncoderHeap_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoEncoderHeap_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoEncoderHeap_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoEncoderHeap_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoEncoderHeap_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + + +#define ID3D12VideoEncoderHeap_GetNodeMask(This) \ + ( (This)->lpVtbl -> GetNodeMask(This) ) + +#define ID3D12VideoEncoderHeap_GetEncoderHeapFlags(This) \ + ( (This)->lpVtbl -> GetEncoderHeapFlags(This) ) + +#define ID3D12VideoEncoderHeap_GetCodec(This) \ + ( (This)->lpVtbl -> GetCodec(This) ) + +#define ID3D12VideoEncoderHeap_GetCodecProfile(This,dstProfile) \ + ( (This)->lpVtbl -> GetCodecProfile(This,dstProfile) ) + +#define ID3D12VideoEncoderHeap_GetCodecLevel(This,dstLevel) \ + ( (This)->lpVtbl -> GetCodecLevel(This,dstLevel) ) + +#define ID3D12VideoEncoderHeap_GetResolutionListCount(This) \ + ( (This)->lpVtbl -> GetResolutionListCount(This) ) + +#define ID3D12VideoEncoderHeap_GetResolutionList(This,ResolutionsListCount,pResolutionList) \ + ( (This)->lpVtbl -> GetResolutionList(This,ResolutionsListCount,pResolutionList) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoEncoderHeap_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12VideoDevice3_INTERFACE_DEFINED__ +#define __ID3D12VideoDevice3_INTERFACE_DEFINED__ + +/* interface ID3D12VideoDevice3 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoDevice3; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("4243ADB4-3A32-4666-973C-0CCC5625DC44") + ID3D12VideoDevice3 : public ID3D12VideoDevice2 + { + public: + virtual HRESULT STDMETHODCALLTYPE CreateVideoEncoder( + _In_ const D3D12_VIDEO_ENCODER_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoEncoder) = 0; + + virtual HRESULT STDMETHODCALLTYPE CreateVideoEncoderHeap( + _In_ const D3D12_VIDEO_ENCODER_HEAP_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoEncoderHeap) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoDevice3Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoDevice3 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoDevice3 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoDevice3 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice, CheckFeatureSupport) + HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )( + ID3D12VideoDevice3 * This, + D3D12_FEATURE_VIDEO FeatureVideo, + _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData, + UINT FeatureSupportDataSize); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice, CreateVideoDecoder) + HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoder )( + ID3D12VideoDevice3 * This, + _In_ const D3D12_VIDEO_DECODER_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoDecoder); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice, CreateVideoDecoderHeap) + HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoderHeap )( + ID3D12VideoDevice3 * This, + _In_ const D3D12_VIDEO_DECODER_HEAP_DESC *pVideoDecoderHeapDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoDecoderHeap); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice, CreateVideoProcessor) + HRESULT ( STDMETHODCALLTYPE *CreateVideoProcessor )( + ID3D12VideoDevice3 * This, + UINT NodeMask, + _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *pOutputStreamDesc, + UINT NumInputStreamDescs, + _In_reads_(NumInputStreamDescs) const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoProcessor); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice1, CreateVideoMotionEstimator) + HRESULT ( STDMETHODCALLTYPE *CreateVideoMotionEstimator )( + ID3D12VideoDevice3 * This, + _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoMotionEstimator); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice1, CreateVideoMotionVectorHeap) + HRESULT ( STDMETHODCALLTYPE *CreateVideoMotionVectorHeap )( + ID3D12VideoDevice3 * This, + _In_ const D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoMotionVectorHeap); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice2, CreateVideoDecoder1) + HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoder1 )( + ID3D12VideoDevice3 * This, + _In_ const D3D12_VIDEO_DECODER_DESC *pDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoDecoder); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice2, CreateVideoDecoderHeap1) + HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoderHeap1 )( + ID3D12VideoDevice3 * This, + _In_ const D3D12_VIDEO_DECODER_HEAP_DESC *pVideoDecoderHeapDesc, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoDecoderHeap); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice2, CreateVideoProcessor1) + HRESULT ( STDMETHODCALLTYPE *CreateVideoProcessor1 )( + ID3D12VideoDevice3 * This, + UINT NodeMask, + _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *pOutputStreamDesc, + UINT NumInputStreamDescs, + _In_reads_(NumInputStreamDescs) const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoProcessor); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice2, CreateVideoExtensionCommand) + HRESULT ( STDMETHODCALLTYPE *CreateVideoExtensionCommand )( + ID3D12VideoDevice3 * This, + _In_ const D3D12_VIDEO_EXTENSION_COMMAND_DESC *pDesc, + _In_reads_bytes_(CreationParametersDataSizeInBytes) const void *pCreationParameters, + SIZE_T CreationParametersDataSizeInBytes, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoExtensionCommand); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice2, ExecuteExtensionCommand) + HRESULT ( STDMETHODCALLTYPE *ExecuteExtensionCommand )( + ID3D12VideoDevice3 * This, + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(ExecutionParametersSizeInBytes) const void *pExecutionParameters, + SIZE_T ExecutionParametersSizeInBytes, + _Out_writes_bytes_(OutputDataSizeInBytes) void *pOutputData, + SIZE_T OutputDataSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice3, CreateVideoEncoder) + HRESULT ( STDMETHODCALLTYPE *CreateVideoEncoder )( + ID3D12VideoDevice3 * This, + _In_ const D3D12_VIDEO_ENCODER_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoEncoder); + + DECLSPEC_XFGVIRT(ID3D12VideoDevice3, CreateVideoEncoderHeap) + HRESULT ( STDMETHODCALLTYPE *CreateVideoEncoderHeap )( + ID3D12VideoDevice3 * This, + _In_ const D3D12_VIDEO_ENCODER_HEAP_DESC *pDesc, + _In_ REFIID riid, + _COM_Outptr_ void **ppVideoEncoderHeap); + + END_INTERFACE + } ID3D12VideoDevice3Vtbl; + + interface ID3D12VideoDevice3 + { + CONST_VTBL struct ID3D12VideoDevice3Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoDevice3_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoDevice3_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoDevice3_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoDevice3_CheckFeatureSupport(This,FeatureVideo,pFeatureSupportData,FeatureSupportDataSize) \ + ( (This)->lpVtbl -> CheckFeatureSupport(This,FeatureVideo,pFeatureSupportData,FeatureSupportDataSize) ) + +#define ID3D12VideoDevice3_CreateVideoDecoder(This,pDesc,riid,ppVideoDecoder) \ + ( (This)->lpVtbl -> CreateVideoDecoder(This,pDesc,riid,ppVideoDecoder) ) + +#define ID3D12VideoDevice3_CreateVideoDecoderHeap(This,pVideoDecoderHeapDesc,riid,ppVideoDecoderHeap) \ + ( (This)->lpVtbl -> CreateVideoDecoderHeap(This,pVideoDecoderHeapDesc,riid,ppVideoDecoderHeap) ) + +#define ID3D12VideoDevice3_CreateVideoProcessor(This,NodeMask,pOutputStreamDesc,NumInputStreamDescs,pInputStreamDescs,riid,ppVideoProcessor) \ + ( (This)->lpVtbl -> CreateVideoProcessor(This,NodeMask,pOutputStreamDesc,NumInputStreamDescs,pInputStreamDescs,riid,ppVideoProcessor) ) + + +#define ID3D12VideoDevice3_CreateVideoMotionEstimator(This,pDesc,pProtectedResourceSession,riid,ppVideoMotionEstimator) \ + ( (This)->lpVtbl -> CreateVideoMotionEstimator(This,pDesc,pProtectedResourceSession,riid,ppVideoMotionEstimator) ) + +#define ID3D12VideoDevice3_CreateVideoMotionVectorHeap(This,pDesc,pProtectedResourceSession,riid,ppVideoMotionVectorHeap) \ + ( (This)->lpVtbl -> CreateVideoMotionVectorHeap(This,pDesc,pProtectedResourceSession,riid,ppVideoMotionVectorHeap) ) + + +#define ID3D12VideoDevice3_CreateVideoDecoder1(This,pDesc,pProtectedResourceSession,riid,ppVideoDecoder) \ + ( (This)->lpVtbl -> CreateVideoDecoder1(This,pDesc,pProtectedResourceSession,riid,ppVideoDecoder) ) + +#define ID3D12VideoDevice3_CreateVideoDecoderHeap1(This,pVideoDecoderHeapDesc,pProtectedResourceSession,riid,ppVideoDecoderHeap) \ + ( (This)->lpVtbl -> CreateVideoDecoderHeap1(This,pVideoDecoderHeapDesc,pProtectedResourceSession,riid,ppVideoDecoderHeap) ) + +#define ID3D12VideoDevice3_CreateVideoProcessor1(This,NodeMask,pOutputStreamDesc,NumInputStreamDescs,pInputStreamDescs,pProtectedResourceSession,riid,ppVideoProcessor) \ + ( (This)->lpVtbl -> CreateVideoProcessor1(This,NodeMask,pOutputStreamDesc,NumInputStreamDescs,pInputStreamDescs,pProtectedResourceSession,riid,ppVideoProcessor) ) + +#define ID3D12VideoDevice3_CreateVideoExtensionCommand(This,pDesc,pCreationParameters,CreationParametersDataSizeInBytes,pProtectedResourceSession,riid,ppVideoExtensionCommand) \ + ( (This)->lpVtbl -> CreateVideoExtensionCommand(This,pDesc,pCreationParameters,CreationParametersDataSizeInBytes,pProtectedResourceSession,riid,ppVideoExtensionCommand) ) + +#define ID3D12VideoDevice3_ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes,pOutputData,OutputDataSizeInBytes) \ + ( (This)->lpVtbl -> ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes,pOutputData,OutputDataSizeInBytes) ) + + +#define ID3D12VideoDevice3_CreateVideoEncoder(This,pDesc,riid,ppVideoEncoder) \ + ( (This)->lpVtbl -> CreateVideoEncoder(This,pDesc,riid,ppVideoEncoder) ) + +#define ID3D12VideoDevice3_CreateVideoEncoderHeap(This,pDesc,riid,ppVideoEncoderHeap) \ + ( (This)->lpVtbl -> CreateVideoEncoderHeap(This,pDesc,riid,ppVideoEncoderHeap) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoDevice3_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12video_0000_0025 */ +/* [local] */ + +typedef +enum D3D12_VIDEO_ENCODER_FRAME_TYPE_H264 + { + D3D12_VIDEO_ENCODER_FRAME_TYPE_H264_I_FRAME = 0, + D3D12_VIDEO_ENCODER_FRAME_TYPE_H264_P_FRAME = 1, + D3D12_VIDEO_ENCODER_FRAME_TYPE_H264_B_FRAME = 2, + D3D12_VIDEO_ENCODER_FRAME_TYPE_H264_IDR_FRAME = 3 + } D3D12_VIDEO_ENCODER_FRAME_TYPE_H264; + +typedef struct D3D12_VIDEO_ENCODER_REFERENCE_PICTURE_DESCRIPTOR_H264 + { + UINT ReconstructedPictureResourceIndex; + BOOL IsLongTermReference; + UINT LongTermPictureIdx; + UINT PictureOrderCountNumber; + UINT FrameDecodingOrderNumber; + UINT TemporalLayerIndex; + } D3D12_VIDEO_ENCODER_REFERENCE_PICTURE_DESCRIPTOR_H264; + +typedef +enum D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAGS + { + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAG_NONE = 0, + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAG_REQUEST_INTRA_CONSTRAINED_SLICES = 0x1 + } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAGS); +typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_MARKING_OPERATION + { + UCHAR memory_management_control_operation; + UINT difference_of_pic_nums_minus1; + UINT long_term_pic_num; + UINT long_term_frame_idx; + UINT max_long_term_frame_idx_plus1; + } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_MARKING_OPERATION; + +typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_LIST_MODIFICATION_OPERATION + { + UCHAR modification_of_pic_nums_idc; + UINT abs_diff_pic_num_minus1; + UINT long_term_pic_num; + } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_LIST_MODIFICATION_OPERATION; + +typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264 + { + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAGS Flags; + D3D12_VIDEO_ENCODER_FRAME_TYPE_H264 FrameType; + UINT pic_parameter_set_id; + UINT idr_pic_id; + UINT PictureOrderCountNumber; + UINT FrameDecodingOrderNumber; + UINT TemporalLayerIndex; + UINT List0ReferenceFramesCount; + _Field_size_full_(List0ReferenceFramesCount) UINT *pList0ReferenceFrames; + UINT List1ReferenceFramesCount; + _Field_size_full_(List1ReferenceFramesCount) UINT *pList1ReferenceFrames; + UINT ReferenceFramesReconPictureDescriptorsCount; + _Field_size_full_(ReferenceFramesReconPictureDescriptorsCount) D3D12_VIDEO_ENCODER_REFERENCE_PICTURE_DESCRIPTOR_H264 *pReferenceFramesReconPictureDescriptors; + UCHAR adaptive_ref_pic_marking_mode_flag; + UINT RefPicMarkingOperationsCommandsCount; + _Field_size_full_(RefPicMarkingOperationsCommandsCount) D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_MARKING_OPERATION *pRefPicMarkingOperationsCommands; + UINT List0RefPicModificationsCount; + _Field_size_full_(List0RefPicModificationsCount) D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_LIST_MODIFICATION_OPERATION *pList0RefPicModifications; + UINT List1RefPicModificationsCount; + _Field_size_full_(List1RefPicModificationsCount) D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_LIST_MODIFICATION_OPERATION *pList1RefPicModifications; + UINT QPMapValuesCount; + _Field_size_full_(QPMapValuesCount) INT8 *pRateControlQPMap; + } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264; + +typedef +enum D3D12_VIDEO_ENCODER_FRAME_TYPE_HEVC + { + D3D12_VIDEO_ENCODER_FRAME_TYPE_HEVC_I_FRAME = 0, + D3D12_VIDEO_ENCODER_FRAME_TYPE_HEVC_P_FRAME = 1, + D3D12_VIDEO_ENCODER_FRAME_TYPE_HEVC_B_FRAME = 2, + D3D12_VIDEO_ENCODER_FRAME_TYPE_HEVC_IDR_FRAME = 3 + } D3D12_VIDEO_ENCODER_FRAME_TYPE_HEVC; + +typedef struct D3D12_VIDEO_ENCODER_REFERENCE_PICTURE_DESCRIPTOR_HEVC + { + UINT ReconstructedPictureResourceIndex; + BOOL IsRefUsedByCurrentPic; + BOOL IsLongTermReference; + UINT PictureOrderCountNumber; + UINT TemporalLayerIndex; + } D3D12_VIDEO_ENCODER_REFERENCE_PICTURE_DESCRIPTOR_HEVC; + +typedef +enum D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAGS + { + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAG_NONE = 0, + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAG_REQUEST_INTRA_CONSTRAINED_SLICES = 0x1 + } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAGS); +typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC + { + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAGS Flags; + D3D12_VIDEO_ENCODER_FRAME_TYPE_HEVC FrameType; + UINT slice_pic_parameter_set_id; + UINT PictureOrderCountNumber; + UINT TemporalLayerIndex; + UINT List0ReferenceFramesCount; + _Field_size_full_(List0ReferenceFramesCount) UINT *pList0ReferenceFrames; + UINT List1ReferenceFramesCount; + _Field_size_full_(List1ReferenceFramesCount) UINT *pList1ReferenceFrames; + UINT ReferenceFramesReconPictureDescriptorsCount; + _Field_size_full_(ReferenceFramesReconPictureDescriptorsCount) D3D12_VIDEO_ENCODER_REFERENCE_PICTURE_DESCRIPTOR_HEVC *pReferenceFramesReconPictureDescriptors; + UINT List0RefPicModificationsCount; + _Field_size_full_(List0RefPicModificationsCount) UINT *pList0RefPicModifications; + UINT List1RefPicModificationsCount; + _Field_size_full_(List1RefPicModificationsCount) UINT *pList1RefPicModifications; + UINT QPMapValuesCount; + _Field_size_full_(QPMapValuesCount) INT8 *pRateControlQPMap; + } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC; + +typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA + { + UINT DataSize; + union + { + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264 *pH264PicData; + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC *pHEVCPicData; + } ; + } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA; + +typedef struct D3D12_VIDEO_ENCODE_REFERENCE_FRAMES + { + UINT NumTexture2Ds; + _Field_size_full_(NumTexture2Ds) ID3D12Resource **ppTexture2Ds; + _Field_size_full_(NumTexture2Ds) UINT *pSubresources; + } D3D12_VIDEO_ENCODE_REFERENCE_FRAMES; + +typedef +enum D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAGS + { + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAG_NONE = 0, + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAG_USED_AS_REFERENCE_PICTURE = 0x1 + } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAGS); +typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC + { + UINT IntraRefreshFrameIndex; + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAGS Flags; + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA PictureControlCodecData; + D3D12_VIDEO_ENCODE_REFERENCE_FRAMES ReferenceFrames; + } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC; + +typedef +enum D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAGS + { + D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAG_NONE = 0, + D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAG_RESOLUTION_CHANGE = 0x1, + D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAG_RATE_CONTROL_CHANGE = 0x2, + D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAG_SUBREGION_LAYOUT_CHANGE = 0x4, + D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAG_REQUEST_INTRA_REFRESH = 0x8, + D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAG_GOP_SEQUENCE_CHANGE = 0x10 + } D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAGS); +typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES + { + union + { + UINT MaxBytesPerSlice; + UINT NumberOfCodingUnitsPerSlice; + UINT NumberOfRowsPerSlice; + UINT NumberOfSlicesPerFrame; + } ; + } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES; + +typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA + { + UINT DataSize; + union + { + const D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES *pSlicesPartition_H264; + const D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES *pSlicesPartition_HEVC; + } ; + } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA; + +typedef struct D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC + { + D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAGS Flags; + D3D12_VIDEO_ENCODER_INTRA_REFRESH IntraRefreshConfig; + D3D12_VIDEO_ENCODER_RATE_CONTROL RateControl; + D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC PictureTargetResolution; + D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE SelectedLayoutMode; + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA FrameSubregionsLayoutData; + D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE CodecGopSequence; + } D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC; + +typedef struct D3D12_VIDEO_ENCODER_ENCODEFRAME_INPUT_ARGUMENTS + { + D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC SequenceControlDesc; + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC PictureControlDesc; + ID3D12Resource *pInputFrame; + UINT InputFrameSubresource; + UINT CurrentFrameBitstreamMetadataSize; + } D3D12_VIDEO_ENCODER_ENCODEFRAME_INPUT_ARGUMENTS; + +typedef struct D3D12_VIDEO_ENCODER_COMPRESSED_BITSTREAM + { + ID3D12Resource *pBuffer; + UINT64 FrameStartOffset; + } D3D12_VIDEO_ENCODER_COMPRESSED_BITSTREAM; + +typedef struct D3D12_VIDEO_ENCODER_RECONSTRUCTED_PICTURE + { + ID3D12Resource *pReconstructedPicture; + UINT ReconstructedPictureSubresource; + } D3D12_VIDEO_ENCODER_RECONSTRUCTED_PICTURE; + +typedef struct D3D12_VIDEO_ENCODER_FRAME_SUBREGION_METADATA + { + UINT64 bSize; + UINT64 bStartOffset; + UINT64 bHeaderSize; + } D3D12_VIDEO_ENCODER_FRAME_SUBREGION_METADATA; + +typedef +enum D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAGS + { + D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAG_NO_ERROR = 0, + D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAG_CODEC_PICTURE_CONTROL_NOT_SUPPORTED = 0x1, + D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAG_SUBREGION_LAYOUT_CONFIGURATION_NOT_SUPPORTED = 0x2, + D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAG_INVALID_REFERENCE_PICTURES = 0x4, + D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAG_RECONFIGURATION_REQUEST_NOT_SUPPORTED = 0x8, + D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAG_INVALID_METADATA_BUFFER_SOURCE = 0x10 + } D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAGS; + +DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAGS); +typedef struct D3D12_VIDEO_ENCODER_OUTPUT_METADATA_STATISTICS + { + UINT64 AverageQP; + UINT64 IntraCodingUnitsCount; + UINT64 InterCodingUnitsCount; + UINT64 SkipCodingUnitsCount; + UINT64 AverageMotionEstimationXDirection; + UINT64 AverageMotionEstimationYDirection; + } D3D12_VIDEO_ENCODER_OUTPUT_METADATA_STATISTICS; + +typedef struct D3D12_VIDEO_ENCODER_OUTPUT_METADATA + { + UINT64 EncodeErrorFlags; + D3D12_VIDEO_ENCODER_OUTPUT_METADATA_STATISTICS EncodeStats; + UINT64 EncodedBitstreamWrittenBytesCount; + UINT64 WrittenSubregionsCount; + } D3D12_VIDEO_ENCODER_OUTPUT_METADATA; + +typedef struct D3D12_VIDEO_ENCODER_ENCODE_OPERATION_METADATA_BUFFER + { + ID3D12Resource *pBuffer; + UINT64 Offset; + } D3D12_VIDEO_ENCODER_ENCODE_OPERATION_METADATA_BUFFER; + +typedef struct D3D12_VIDEO_ENCODER_RESOLVE_METADATA_INPUT_ARGUMENTS + { + D3D12_VIDEO_ENCODER_CODEC EncoderCodec; + D3D12_VIDEO_ENCODER_PROFILE_DESC EncoderProfile; + DXGI_FORMAT EncoderInputFormat; + D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC EncodedPictureEffectiveResolution; + D3D12_VIDEO_ENCODER_ENCODE_OPERATION_METADATA_BUFFER HWLayoutMetadata; + } D3D12_VIDEO_ENCODER_RESOLVE_METADATA_INPUT_ARGUMENTS; + +typedef struct D3D12_VIDEO_ENCODER_RESOLVE_METADATA_OUTPUT_ARGUMENTS + { + D3D12_VIDEO_ENCODER_ENCODE_OPERATION_METADATA_BUFFER ResolvedLayoutMetadata; + } D3D12_VIDEO_ENCODER_RESOLVE_METADATA_OUTPUT_ARGUMENTS; + +typedef struct D3D12_VIDEO_ENCODER_ENCODEFRAME_OUTPUT_ARGUMENTS + { + D3D12_VIDEO_ENCODER_COMPRESSED_BITSTREAM Bitstream; + D3D12_VIDEO_ENCODER_RECONSTRUCTED_PICTURE ReconstructedPicture; + D3D12_VIDEO_ENCODER_ENCODE_OPERATION_METADATA_BUFFER EncoderOutputMetadata; + } D3D12_VIDEO_ENCODER_ENCODEFRAME_OUTPUT_ARGUMENTS; + + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0025_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0025_v0_0_s_ifspec; + +#ifndef __ID3D12VideoEncodeCommandList2_INTERFACE_DEFINED__ +#define __ID3D12VideoEncodeCommandList2_INTERFACE_DEFINED__ + +/* interface ID3D12VideoEncodeCommandList2 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoEncodeCommandList2; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("895491e2-e701-46a9-9a1f-8d3480ed867a") + ID3D12VideoEncodeCommandList2 : public ID3D12VideoEncodeCommandList1 + { + public: + virtual void STDMETHODCALLTYPE EncodeFrame( + _In_ ID3D12VideoEncoder *pEncoder, + _In_ ID3D12VideoEncoderHeap *pHeap, + _In_ const D3D12_VIDEO_ENCODER_ENCODEFRAME_INPUT_ARGUMENTS *pInputArguments, + _In_ const D3D12_VIDEO_ENCODER_ENCODEFRAME_OUTPUT_ARGUMENTS *pOutputArguments) = 0; + + virtual void STDMETHODCALLTYPE ResolveEncoderOutputMetadata( + _In_ const D3D12_VIDEO_ENCODER_RESOLVE_METADATA_INPUT_ARGUMENTS *pInputArguments, + _In_ const D3D12_VIDEO_ENCODER_RESOLVE_METADATA_OUTPUT_ARGUMENTS *pOutputArguments) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoEncodeCommandList2Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoEncodeCommandList2 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoEncodeCommandList2 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoEncodeCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoEncodeCommandList2 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoEncodeCommandList2 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoEncodeCommandList2 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoEncodeCommandList2 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoEncodeCommandList2 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12VideoEncodeCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12VideoEncodeCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12VideoEncodeCommandList2 * This, + _In_ ID3D12CommandAllocator *pAllocator); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12VideoEncodeCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12VideoEncodeCommandList2 * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12VideoEncodeCommandList2 * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12VideoEncodeCommandList2 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12VideoEncodeCommandList2 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12VideoEncodeCommandList2 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12VideoEncodeCommandList2 * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12VideoEncodeCommandList2 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12VideoEncodeCommandList2 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12VideoEncodeCommandList2 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, EstimateMotion) + void ( STDMETHODCALLTYPE *EstimateMotion )( + ID3D12VideoEncodeCommandList2 * This, + _In_ ID3D12VideoMotionEstimator *pMotionEstimator, + _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_OUTPUT *pOutputArguments, + _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_INPUT *pInputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ResolveMotionVectorHeap) + void ( STDMETHODCALLTYPE *ResolveMotionVectorHeap )( + ID3D12VideoEncodeCommandList2 * This, + const D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT *pOutputArguments, + const D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_INPUT *pInputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12VideoEncodeCommandList2 * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, SetProtectedResourceSession) + void ( STDMETHODCALLTYPE *SetProtectedResourceSession )( + ID3D12VideoEncodeCommandList2 * This, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList1, InitializeExtensionCommand) + void ( STDMETHODCALLTYPE *InitializeExtensionCommand )( + ID3D12VideoEncodeCommandList2 * This, + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(InitializationParametersSizeInBytes) const void *pInitializationParameters, + SIZE_T InitializationParametersSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList1, ExecuteExtensionCommand) + void ( STDMETHODCALLTYPE *ExecuteExtensionCommand )( + ID3D12VideoEncodeCommandList2 * This, + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(ExecutionParametersSizeInBytes) const void *pExecutionParameters, + SIZE_T ExecutionParametersSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList2, EncodeFrame) + void ( STDMETHODCALLTYPE *EncodeFrame )( + ID3D12VideoEncodeCommandList2 * This, + _In_ ID3D12VideoEncoder *pEncoder, + _In_ ID3D12VideoEncoderHeap *pHeap, + _In_ const D3D12_VIDEO_ENCODER_ENCODEFRAME_INPUT_ARGUMENTS *pInputArguments, + _In_ const D3D12_VIDEO_ENCODER_ENCODEFRAME_OUTPUT_ARGUMENTS *pOutputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList2, ResolveEncoderOutputMetadata) + void ( STDMETHODCALLTYPE *ResolveEncoderOutputMetadata )( + ID3D12VideoEncodeCommandList2 * This, + _In_ const D3D12_VIDEO_ENCODER_RESOLVE_METADATA_INPUT_ARGUMENTS *pInputArguments, + _In_ const D3D12_VIDEO_ENCODER_RESOLVE_METADATA_OUTPUT_ARGUMENTS *pOutputArguments); + + END_INTERFACE + } ID3D12VideoEncodeCommandList2Vtbl; + + interface ID3D12VideoEncodeCommandList2 + { + CONST_VTBL struct ID3D12VideoEncodeCommandList2Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoEncodeCommandList2_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoEncodeCommandList2_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoEncodeCommandList2_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoEncodeCommandList2_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoEncodeCommandList2_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoEncodeCommandList2_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoEncodeCommandList2_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoEncodeCommandList2_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12VideoEncodeCommandList2_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12VideoEncodeCommandList2_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12VideoEncodeCommandList2_Reset(This,pAllocator) \ + ( (This)->lpVtbl -> Reset(This,pAllocator) ) + +#define ID3D12VideoEncodeCommandList2_ClearState(This) \ + ( (This)->lpVtbl -> ClearState(This) ) + +#define ID3D12VideoEncodeCommandList2_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12VideoEncodeCommandList2_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12VideoEncodeCommandList2_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoEncodeCommandList2_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoEncodeCommandList2_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12VideoEncodeCommandList2_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12VideoEncodeCommandList2_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12VideoEncodeCommandList2_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12VideoEncodeCommandList2_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12VideoEncodeCommandList2_EstimateMotion(This,pMotionEstimator,pOutputArguments,pInputArguments) \ + ( (This)->lpVtbl -> EstimateMotion(This,pMotionEstimator,pOutputArguments,pInputArguments) ) + +#define ID3D12VideoEncodeCommandList2_ResolveMotionVectorHeap(This,pOutputArguments,pInputArguments) \ + ( (This)->lpVtbl -> ResolveMotionVectorHeap(This,pOutputArguments,pInputArguments) ) + +#define ID3D12VideoEncodeCommandList2_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) + +#define ID3D12VideoEncodeCommandList2_SetProtectedResourceSession(This,pProtectedResourceSession) \ + ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) ) + + +#define ID3D12VideoEncodeCommandList2_InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) \ + ( (This)->lpVtbl -> InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) ) + +#define ID3D12VideoEncodeCommandList2_ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) \ + ( (This)->lpVtbl -> ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) ) + + +#define ID3D12VideoEncodeCommandList2_EncodeFrame(This,pEncoder,pHeap,pInputArguments,pOutputArguments) \ + ( (This)->lpVtbl -> EncodeFrame(This,pEncoder,pHeap,pInputArguments,pOutputArguments) ) + +#define ID3D12VideoEncodeCommandList2_ResolveEncoderOutputMetadata(This,pInputArguments,pOutputArguments) \ + ( (This)->lpVtbl -> ResolveEncoderOutputMetadata(This,pInputArguments,pOutputArguments) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoEncodeCommandList2_INTERFACE_DEFINED__ */ + + +#ifndef __ID3D12VideoEncodeCommandList3_INTERFACE_DEFINED__ +#define __ID3D12VideoEncodeCommandList3_INTERFACE_DEFINED__ + +/* interface ID3D12VideoEncodeCommandList3 */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D12VideoEncodeCommandList3; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("7f027b22-1515-4e85-aa0d-026486580576") + ID3D12VideoEncodeCommandList3 : public ID3D12VideoEncodeCommandList2 + { + public: + virtual void STDMETHODCALLTYPE Barrier( + UINT32 NumBarrierGroups, + _In_reads_(NumBarrierGroups) const D3D12_BARRIER_GROUP *pBarrierGroups) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D12VideoEncodeCommandList3Vtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D12VideoEncodeCommandList3 * This, + REFIID riid, + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D12VideoEncodeCommandList3 * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D12VideoEncodeCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData) + HRESULT ( STDMETHODCALLTYPE *GetPrivateData )( + ID3D12VideoEncodeCommandList3 * This, + _In_ REFGUID guid, + _Inout_ UINT *pDataSize, + _Out_writes_bytes_opt_( *pDataSize ) void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData) + HRESULT ( STDMETHODCALLTYPE *SetPrivateData )( + ID3D12VideoEncodeCommandList3 * This, + _In_ REFGUID guid, + _In_ UINT DataSize, + _In_reads_bytes_opt_( DataSize ) const void *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface) + HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )( + ID3D12VideoEncodeCommandList3 * This, + _In_ REFGUID guid, + _In_opt_ const IUnknown *pData); + + DECLSPEC_XFGVIRT(ID3D12Object, SetName) + HRESULT ( STDMETHODCALLTYPE *SetName )( + ID3D12VideoEncodeCommandList3 * This, + _In_z_ LPCWSTR Name); + + DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice) + HRESULT ( STDMETHODCALLTYPE *GetDevice )( + ID3D12VideoEncodeCommandList3 * This, + REFIID riid, + _COM_Outptr_opt_ void **ppvDevice); + + DECLSPEC_XFGVIRT(ID3D12CommandList, GetType) + D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )( + ID3D12VideoEncodeCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, Close) + HRESULT ( STDMETHODCALLTYPE *Close )( + ID3D12VideoEncodeCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, Reset) + HRESULT ( STDMETHODCALLTYPE *Reset )( + ID3D12VideoEncodeCommandList3 * This, + _In_ ID3D12CommandAllocator *pAllocator); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ClearState) + void ( STDMETHODCALLTYPE *ClearState )( + ID3D12VideoEncodeCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ResourceBarrier) + void ( STDMETHODCALLTYPE *ResourceBarrier )( + ID3D12VideoEncodeCommandList3 * This, + _In_ UINT NumBarriers, + _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, DiscardResource) + void ( STDMETHODCALLTYPE *DiscardResource )( + ID3D12VideoEncodeCommandList3 * This, + _In_ ID3D12Resource *pResource, + _In_opt_ const D3D12_DISCARD_REGION *pRegion); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, BeginQuery) + void ( STDMETHODCALLTYPE *BeginQuery )( + ID3D12VideoEncodeCommandList3 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, EndQuery) + void ( STDMETHODCALLTYPE *EndQuery )( + ID3D12VideoEncodeCommandList3 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT Index); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ResolveQueryData) + void ( STDMETHODCALLTYPE *ResolveQueryData )( + ID3D12VideoEncodeCommandList3 * This, + _In_ ID3D12QueryHeap *pQueryHeap, + _In_ D3D12_QUERY_TYPE Type, + _In_ UINT StartIndex, + _In_ UINT NumQueries, + _In_ ID3D12Resource *pDestinationBuffer, + _In_ UINT64 AlignedDestinationBufferOffset); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, SetPredication) + void ( STDMETHODCALLTYPE *SetPredication )( + ID3D12VideoEncodeCommandList3 * This, + _In_opt_ ID3D12Resource *pBuffer, + _In_ UINT64 AlignedBufferOffset, + _In_ D3D12_PREDICATION_OP Operation); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, SetMarker) + void ( STDMETHODCALLTYPE *SetMarker )( + ID3D12VideoEncodeCommandList3 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, BeginEvent) + void ( STDMETHODCALLTYPE *BeginEvent )( + ID3D12VideoEncodeCommandList3 * This, + UINT Metadata, + _In_reads_bytes_opt_(Size) const void *pData, + UINT Size); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, EndEvent) + void ( STDMETHODCALLTYPE *EndEvent )( + ID3D12VideoEncodeCommandList3 * This); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, EstimateMotion) + void ( STDMETHODCALLTYPE *EstimateMotion )( + ID3D12VideoEncodeCommandList3 * This, + _In_ ID3D12VideoMotionEstimator *pMotionEstimator, + _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_OUTPUT *pOutputArguments, + _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_INPUT *pInputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ResolveMotionVectorHeap) + void ( STDMETHODCALLTYPE *ResolveMotionVectorHeap )( + ID3D12VideoEncodeCommandList3 * This, + const D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT *pOutputArguments, + const D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_INPUT *pInputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, WriteBufferImmediate) + void ( STDMETHODCALLTYPE *WriteBufferImmediate )( + ID3D12VideoEncodeCommandList3 * This, + UINT Count, + _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams, + _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, SetProtectedResourceSession) + void ( STDMETHODCALLTYPE *SetProtectedResourceSession )( + ID3D12VideoEncodeCommandList3 * This, + _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList1, InitializeExtensionCommand) + void ( STDMETHODCALLTYPE *InitializeExtensionCommand )( + ID3D12VideoEncodeCommandList3 * This, + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(InitializationParametersSizeInBytes) const void *pInitializationParameters, + SIZE_T InitializationParametersSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList1, ExecuteExtensionCommand) + void ( STDMETHODCALLTYPE *ExecuteExtensionCommand )( + ID3D12VideoEncodeCommandList3 * This, + _In_ ID3D12VideoExtensionCommand *pExtensionCommand, + _In_reads_bytes_(ExecutionParametersSizeInBytes) const void *pExecutionParameters, + SIZE_T ExecutionParametersSizeInBytes); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList2, EncodeFrame) + void ( STDMETHODCALLTYPE *EncodeFrame )( + ID3D12VideoEncodeCommandList3 * This, + _In_ ID3D12VideoEncoder *pEncoder, + _In_ ID3D12VideoEncoderHeap *pHeap, + _In_ const D3D12_VIDEO_ENCODER_ENCODEFRAME_INPUT_ARGUMENTS *pInputArguments, + _In_ const D3D12_VIDEO_ENCODER_ENCODEFRAME_OUTPUT_ARGUMENTS *pOutputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList2, ResolveEncoderOutputMetadata) + void ( STDMETHODCALLTYPE *ResolveEncoderOutputMetadata )( + ID3D12VideoEncodeCommandList3 * This, + _In_ const D3D12_VIDEO_ENCODER_RESOLVE_METADATA_INPUT_ARGUMENTS *pInputArguments, + _In_ const D3D12_VIDEO_ENCODER_RESOLVE_METADATA_OUTPUT_ARGUMENTS *pOutputArguments); + + DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList3, Barrier) + void ( STDMETHODCALLTYPE *Barrier )( + ID3D12VideoEncodeCommandList3 * This, + UINT32 NumBarrierGroups, + _In_reads_(NumBarrierGroups) const D3D12_BARRIER_GROUP *pBarrierGroups); + + END_INTERFACE + } ID3D12VideoEncodeCommandList3Vtbl; + + interface ID3D12VideoEncodeCommandList3 + { + CONST_VTBL struct ID3D12VideoEncodeCommandList3Vtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D12VideoEncodeCommandList3_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D12VideoEncodeCommandList3_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D12VideoEncodeCommandList3_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D12VideoEncodeCommandList3_GetPrivateData(This,guid,pDataSize,pData) \ + ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) ) + +#define ID3D12VideoEncodeCommandList3_SetPrivateData(This,guid,DataSize,pData) \ + ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) ) + +#define ID3D12VideoEncodeCommandList3_SetPrivateDataInterface(This,guid,pData) \ + ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) ) + +#define ID3D12VideoEncodeCommandList3_SetName(This,Name) \ + ( (This)->lpVtbl -> SetName(This,Name) ) + + +#define ID3D12VideoEncodeCommandList3_GetDevice(This,riid,ppvDevice) \ + ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) ) + + +#define ID3D12VideoEncodeCommandList3_GetType(This) \ + ( (This)->lpVtbl -> GetType(This) ) + + +#define ID3D12VideoEncodeCommandList3_Close(This) \ + ( (This)->lpVtbl -> Close(This) ) + +#define ID3D12VideoEncodeCommandList3_Reset(This,pAllocator) \ + ( (This)->lpVtbl -> Reset(This,pAllocator) ) + +#define ID3D12VideoEncodeCommandList3_ClearState(This) \ + ( (This)->lpVtbl -> ClearState(This) ) + +#define ID3D12VideoEncodeCommandList3_ResourceBarrier(This,NumBarriers,pBarriers) \ + ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) ) + +#define ID3D12VideoEncodeCommandList3_DiscardResource(This,pResource,pRegion) \ + ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) ) + +#define ID3D12VideoEncodeCommandList3_BeginQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoEncodeCommandList3_EndQuery(This,pQueryHeap,Type,Index) \ + ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) ) + +#define ID3D12VideoEncodeCommandList3_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \ + ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) ) + +#define ID3D12VideoEncodeCommandList3_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \ + ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) ) + +#define ID3D12VideoEncodeCommandList3_SetMarker(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) ) + +#define ID3D12VideoEncodeCommandList3_BeginEvent(This,Metadata,pData,Size) \ + ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) ) + +#define ID3D12VideoEncodeCommandList3_EndEvent(This) \ + ( (This)->lpVtbl -> EndEvent(This) ) + +#define ID3D12VideoEncodeCommandList3_EstimateMotion(This,pMotionEstimator,pOutputArguments,pInputArguments) \ + ( (This)->lpVtbl -> EstimateMotion(This,pMotionEstimator,pOutputArguments,pInputArguments) ) + +#define ID3D12VideoEncodeCommandList3_ResolveMotionVectorHeap(This,pOutputArguments,pInputArguments) \ + ( (This)->lpVtbl -> ResolveMotionVectorHeap(This,pOutputArguments,pInputArguments) ) + +#define ID3D12VideoEncodeCommandList3_WriteBufferImmediate(This,Count,pParams,pModes) \ + ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) ) + +#define ID3D12VideoEncodeCommandList3_SetProtectedResourceSession(This,pProtectedResourceSession) \ + ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) ) + + +#define ID3D12VideoEncodeCommandList3_InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) \ + ( (This)->lpVtbl -> InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) ) + +#define ID3D12VideoEncodeCommandList3_ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) \ + ( (This)->lpVtbl -> ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) ) + + +#define ID3D12VideoEncodeCommandList3_EncodeFrame(This,pEncoder,pHeap,pInputArguments,pOutputArguments) \ + ( (This)->lpVtbl -> EncodeFrame(This,pEncoder,pHeap,pInputArguments,pOutputArguments) ) + +#define ID3D12VideoEncodeCommandList3_ResolveEncoderOutputMetadata(This,pInputArguments,pOutputArguments) \ + ( (This)->lpVtbl -> ResolveEncoderOutputMetadata(This,pInputArguments,pOutputArguments) ) + + +#define ID3D12VideoEncodeCommandList3_Barrier(This,NumBarrierGroups,pBarrierGroups) \ + ( (This)->lpVtbl -> Barrier(This,NumBarrierGroups,pBarrierGroups) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D12VideoEncodeCommandList3_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3d12video_0000_0027 */ +/* [local] */ + +#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES) */ +#pragma endregion +DEFINE_GUID(IID_ID3D12VideoDecoderHeap,0x0946B7C9,0xEBF6,0x4047,0xBB,0x73,0x86,0x83,0xE2,0x7D,0xBB,0x1F); +DEFINE_GUID(IID_ID3D12VideoDevice,0x1F052807,0x0B46,0x4ACC,0x8A,0x89,0x36,0x4F,0x79,0x37,0x18,0xA4); +DEFINE_GUID(IID_ID3D12VideoDecoder,0xC59B6BDC,0x7720,0x4074,0xA1,0x36,0x17,0xA1,0x56,0x03,0x74,0x70); +DEFINE_GUID(IID_ID3D12VideoProcessor,0x304FDB32,0xBEDE,0x410A,0x85,0x45,0x94,0x3A,0xC6,0xA4,0x61,0x38); +DEFINE_GUID(IID_ID3D12VideoDecodeCommandList,0x3B60536E,0xAD29,0x4E64,0xA2,0x69,0xF8,0x53,0x83,0x7E,0x5E,0x53); +DEFINE_GUID(IID_ID3D12VideoProcessCommandList,0xAEB2543A,0x167F,0x4682,0xAC,0xC8,0xD1,0x59,0xED,0x4A,0x62,0x09); +DEFINE_GUID(IID_ID3D12VideoDecodeCommandList1,0xD52F011B,0xB56E,0x453C,0xA0,0x5A,0xA7,0xF3,0x11,0xC8,0xF4,0x72); +DEFINE_GUID(IID_ID3D12VideoProcessCommandList1,0x542C5C4D,0x7596,0x434F,0x8C,0x93,0x4E,0xFA,0x67,0x66,0xF2,0x67); +DEFINE_GUID(IID_ID3D12VideoMotionEstimator,0x33FDAE0E,0x098B,0x428F,0x87,0xBB,0x34,0xB6,0x95,0xDE,0x08,0xF8); +DEFINE_GUID(IID_ID3D12VideoMotionVectorHeap,0x5BE17987,0x743A,0x4061,0x83,0x4B,0x23,0xD2,0x2D,0xAE,0xA5,0x05); +DEFINE_GUID(IID_ID3D12VideoDevice1,0x981611AD,0xA144,0x4C83,0x98,0x90,0xF3,0x0E,0x26,0xD6,0x58,0xAB); +DEFINE_GUID(IID_ID3D12VideoEncodeCommandList,0x8455293A,0x0CBD,0x4831,0x9B,0x39,0xFB,0xDB,0xAB,0x72,0x47,0x23); +DEFINE_GUID(IID_ID3D12VideoDecoder1,0x79A2E5FB,0xCCD2,0x469A,0x9F,0xDE,0x19,0x5D,0x10,0x95,0x1F,0x7E); +DEFINE_GUID(IID_ID3D12VideoDecoderHeap1,0xDA1D98C5,0x539F,0x41B2,0xBF,0x6B,0x11,0x98,0xA0,0x3B,0x6D,0x26); +DEFINE_GUID(IID_ID3D12VideoProcessor1,0xF3CFE615,0x553F,0x425C,0x86,0xD8,0xEE,0x8C,0x1B,0x1F,0xB0,0x1C); +DEFINE_GUID(IID_ID3D12VideoExtensionCommand,0x554E41E8,0xAE8E,0x4A8C,0xB7,0xD2,0x5B,0x4F,0x27,0x4A,0x30,0xE4); +DEFINE_GUID(IID_ID3D12VideoDevice2,0xF019AC49,0xF838,0x4A95,0x9B,0x17,0x57,0x94,0x37,0xC8,0xF5,0x13); +DEFINE_GUID(IID_ID3D12VideoDecodeCommandList2,0x6e120880,0xc114,0x4153,0x80,0x36,0xd2,0x47,0x05,0x1e,0x17,0x29); +DEFINE_GUID(IID_ID3D12VideoDecodeCommandList3,0x2aee8c37,0x9562,0x42da,0x8a,0xbf,0x61,0xef,0xeb,0x2e,0x45,0x13); +DEFINE_GUID(IID_ID3D12VideoProcessCommandList2,0xdb525ae4,0x6ad6,0x473c,0xba,0xa7,0x59,0xb2,0xe3,0x70,0x82,0xe4); +DEFINE_GUID(IID_ID3D12VideoProcessCommandList3,0x1a0a4ca4,0x9f08,0x40ce,0x95,0x58,0xb4,0x11,0xfd,0x26,0x66,0xff); +DEFINE_GUID(IID_ID3D12VideoEncodeCommandList1,0x94971eca,0x2bdb,0x4769,0x88,0xcf,0x36,0x75,0xea,0x75,0x7e,0xbc); +DEFINE_GUID(IID_ID3D12VideoEncoder,0x2E0D212D,0x8DF9,0x44A6,0xA7,0x70,0xBB,0x28,0x9B,0x18,0x27,0x37); +DEFINE_GUID(IID_ID3D12VideoEncoderHeap,0x22B35D96,0x876A,0x44C0,0xB2,0x5E,0xFB,0x8C,0x9C,0x7F,0x1C,0x4A); +DEFINE_GUID(IID_ID3D12VideoDevice3,0x4243ADB4,0x3A32,0x4666,0x97,0x3C,0x0C,0xCC,0x56,0x25,0xDC,0x44); +DEFINE_GUID(IID_ID3D12VideoEncodeCommandList2,0x895491e2,0xe701,0x46a9,0x9a,0x1f,0x8d,0x34,0x80,0xed,0x86,0x7a); +DEFINE_GUID(IID_ID3D12VideoEncodeCommandList3,0x7f027b22,0x1515,0x4e85,0xaa,0x0d,0x02,0x64,0x86,0x58,0x05,0x76); + + +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0027_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0027_v0_0_s_ifspec; + +/* Additional Prototypes for ALL interfaces */ + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/thirdparty/directx_headers/d3dcommon.h b/thirdparty/directx_headers/d3dcommon.h new file mode 100644 index 0000000000..33e7762374 --- /dev/null +++ b/thirdparty/directx_headers/d3dcommon.h @@ -0,0 +1,1116 @@ +/*------------------------------------------------------------------------------------- + * + * Copyright (c) Microsoft Corporation + * Licensed under the MIT license + * + *-------------------------------------------------------------------------------------*/ + + +/* this ALWAYS GENERATED file contains the definitions for the interfaces */ + + + /* File created by MIDL compiler version 8.01.0628 */ +/* @@MIDL_FILE_HEADING( ) */ + + + +/* verify that the <rpcndr.h> version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCNDR_H_VERSION__ +#define __REQUIRED_RPCNDR_H_VERSION__ 500 +#endif + +/* verify that the <rpcsal.h> version is high enough to compile this file*/ +#ifndef __REQUIRED_RPCSAL_H_VERSION__ +#define __REQUIRED_RPCSAL_H_VERSION__ 100 +#endif + +#include "rpc.h" +#include "rpcndr.h" + +#ifndef __RPCNDR_H_VERSION__ +#error this stub requires an updated version of <rpcndr.h> +#endif /* __RPCNDR_H_VERSION__ */ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#ifndef __d3dcommon_h__ +#define __d3dcommon_h__ + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#pragma once +#endif + +#ifndef DECLSPEC_XFGVIRT +#if defined(_CONTROL_FLOW_GUARD_XFG) +#define DECLSPEC_XFGVIRT(base, func) __declspec(xfg_virtual(base, func)) +#else +#define DECLSPEC_XFGVIRT(base, func) +#endif +#endif + +/* Forward Declarations */ + +#ifndef __ID3D10Blob_FWD_DEFINED__ +#define __ID3D10Blob_FWD_DEFINED__ +typedef interface ID3D10Blob ID3D10Blob; + +#endif /* __ID3D10Blob_FWD_DEFINED__ */ + + +#ifndef __ID3DDestructionNotifier_FWD_DEFINED__ +#define __ID3DDestructionNotifier_FWD_DEFINED__ +typedef interface ID3DDestructionNotifier ID3DDestructionNotifier; + +#endif /* __ID3DDestructionNotifier_FWD_DEFINED__ */ + + +/* header files for imported files */ +#include "oaidl.h" +#include "ocidl.h" + +#ifdef __cplusplus +extern "C"{ +#endif + + +/* interface __MIDL_itf_d3dcommon_0000_0000 */ +/* [local] */ + +typedef +enum D3D_DRIVER_TYPE + { + D3D_DRIVER_TYPE_UNKNOWN = 0, + D3D_DRIVER_TYPE_HARDWARE = ( D3D_DRIVER_TYPE_UNKNOWN + 1 ) , + D3D_DRIVER_TYPE_REFERENCE = ( D3D_DRIVER_TYPE_HARDWARE + 1 ) , + D3D_DRIVER_TYPE_NULL = ( D3D_DRIVER_TYPE_REFERENCE + 1 ) , + D3D_DRIVER_TYPE_SOFTWARE = ( D3D_DRIVER_TYPE_NULL + 1 ) , + D3D_DRIVER_TYPE_WARP = ( D3D_DRIVER_TYPE_SOFTWARE + 1 ) + } D3D_DRIVER_TYPE; + +typedef +enum D3D_FEATURE_LEVEL + { + D3D_FEATURE_LEVEL_1_0_CORE = 0x1000, + D3D_FEATURE_LEVEL_9_1 = 0x9100, + D3D_FEATURE_LEVEL_9_2 = 0x9200, + D3D_FEATURE_LEVEL_9_3 = 0x9300, + D3D_FEATURE_LEVEL_10_0 = 0xa000, + D3D_FEATURE_LEVEL_10_1 = 0xa100, + D3D_FEATURE_LEVEL_11_0 = 0xb000, + D3D_FEATURE_LEVEL_11_1 = 0xb100, + D3D_FEATURE_LEVEL_12_0 = 0xc000, + D3D_FEATURE_LEVEL_12_1 = 0xc100, + D3D_FEATURE_LEVEL_12_2 = 0xc200 + } D3D_FEATURE_LEVEL; + +#define D3D_FL9_1_REQ_TEXTURE1D_U_DIMENSION 2048 +#define D3D_FL9_3_REQ_TEXTURE1D_U_DIMENSION 4096 +#define D3D_FL9_1_REQ_TEXTURE2D_U_OR_V_DIMENSION 2048 +#define D3D_FL9_3_REQ_TEXTURE2D_U_OR_V_DIMENSION 4096 +#define D3D_FL9_1_REQ_TEXTURECUBE_DIMENSION 512 +#define D3D_FL9_3_REQ_TEXTURECUBE_DIMENSION 4096 +#define D3D_FL9_1_REQ_TEXTURE3D_U_V_OR_W_DIMENSION 256 +#define D3D_FL9_1_DEFAULT_MAX_ANISOTROPY 2 +#define D3D_FL9_1_IA_PRIMITIVE_MAX_COUNT 65535 +#define D3D_FL9_2_IA_PRIMITIVE_MAX_COUNT 1048575 +#define D3D_FL9_1_SIMULTANEOUS_RENDER_TARGET_COUNT 1 +#define D3D_FL9_3_SIMULTANEOUS_RENDER_TARGET_COUNT 4 +#define D3D_FL9_1_MAX_TEXTURE_REPEAT 128 +#define D3D_FL9_2_MAX_TEXTURE_REPEAT 2048 +#define D3D_FL9_3_MAX_TEXTURE_REPEAT 8192 +typedef +enum D3D_PRIMITIVE_TOPOLOGY + { + D3D_PRIMITIVE_TOPOLOGY_UNDEFINED = 0, + D3D_PRIMITIVE_TOPOLOGY_POINTLIST = 1, + D3D_PRIMITIVE_TOPOLOGY_LINELIST = 2, + D3D_PRIMITIVE_TOPOLOGY_LINESTRIP = 3, + D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST = 4, + D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP = 5, + D3D_PRIMITIVE_TOPOLOGY_TRIANGLEFAN = 6, + D3D_PRIMITIVE_TOPOLOGY_LINELIST_ADJ = 10, + D3D_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ = 11, + D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ = 12, + D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ = 13, + D3D_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST = 33, + D3D_PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST = 34, + D3D_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST = 35, + D3D_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST = 36, + D3D_PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST = 37, + D3D_PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST = 38, + D3D_PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST = 39, + D3D_PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST = 40, + D3D_PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST = 41, + D3D_PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST = 42, + D3D_PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST = 43, + D3D_PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST = 44, + D3D_PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST = 45, + D3D_PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST = 46, + D3D_PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST = 47, + D3D_PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST = 48, + D3D_PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST = 49, + D3D_PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST = 50, + D3D_PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST = 51, + D3D_PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST = 52, + D3D_PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST = 53, + D3D_PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST = 54, + D3D_PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST = 55, + D3D_PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST = 56, + D3D_PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST = 57, + D3D_PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST = 58, + D3D_PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST = 59, + D3D_PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST = 60, + D3D_PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST = 61, + D3D_PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST = 62, + D3D_PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST = 63, + D3D_PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST = 64, + D3D10_PRIMITIVE_TOPOLOGY_UNDEFINED = D3D_PRIMITIVE_TOPOLOGY_UNDEFINED, + D3D10_PRIMITIVE_TOPOLOGY_POINTLIST = D3D_PRIMITIVE_TOPOLOGY_POINTLIST, + D3D10_PRIMITIVE_TOPOLOGY_LINELIST = D3D_PRIMITIVE_TOPOLOGY_LINELIST, + D3D10_PRIMITIVE_TOPOLOGY_LINESTRIP = D3D_PRIMITIVE_TOPOLOGY_LINESTRIP, + D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST, + D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP = D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP, + D3D10_PRIMITIVE_TOPOLOGY_LINELIST_ADJ = D3D_PRIMITIVE_TOPOLOGY_LINELIST_ADJ, + D3D10_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ = D3D_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ, + D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ, + D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ = D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ, + D3D11_PRIMITIVE_TOPOLOGY_UNDEFINED = D3D_PRIMITIVE_TOPOLOGY_UNDEFINED, + D3D11_PRIMITIVE_TOPOLOGY_POINTLIST = D3D_PRIMITIVE_TOPOLOGY_POINTLIST, + D3D11_PRIMITIVE_TOPOLOGY_LINELIST = D3D_PRIMITIVE_TOPOLOGY_LINELIST, + D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP = D3D_PRIMITIVE_TOPOLOGY_LINESTRIP, + D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST, + D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP = D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP, + D3D11_PRIMITIVE_TOPOLOGY_LINELIST_ADJ = D3D_PRIMITIVE_TOPOLOGY_LINELIST_ADJ, + D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ = D3D_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ, + D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ = D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ, + D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ = D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ, + D3D11_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_1_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_2_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_4_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_5_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_6_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_7_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_8_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_9_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_10_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_11_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_12_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_13_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_14_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_15_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_16_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_17_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_18_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_19_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_20_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_21_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_22_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_23_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_24_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_25_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_26_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_27_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_28_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_29_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_30_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_31_CONTROL_POINT_PATCHLIST, + D3D11_PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST = D3D_PRIMITIVE_TOPOLOGY_32_CONTROL_POINT_PATCHLIST + } D3D_PRIMITIVE_TOPOLOGY; + +typedef +enum D3D_PRIMITIVE + { + D3D_PRIMITIVE_UNDEFINED = 0, + D3D_PRIMITIVE_POINT = 1, + D3D_PRIMITIVE_LINE = 2, + D3D_PRIMITIVE_TRIANGLE = 3, + D3D_PRIMITIVE_LINE_ADJ = 6, + D3D_PRIMITIVE_TRIANGLE_ADJ = 7, + D3D_PRIMITIVE_1_CONTROL_POINT_PATCH = 8, + D3D_PRIMITIVE_2_CONTROL_POINT_PATCH = 9, + D3D_PRIMITIVE_3_CONTROL_POINT_PATCH = 10, + D3D_PRIMITIVE_4_CONTROL_POINT_PATCH = 11, + D3D_PRIMITIVE_5_CONTROL_POINT_PATCH = 12, + D3D_PRIMITIVE_6_CONTROL_POINT_PATCH = 13, + D3D_PRIMITIVE_7_CONTROL_POINT_PATCH = 14, + D3D_PRIMITIVE_8_CONTROL_POINT_PATCH = 15, + D3D_PRIMITIVE_9_CONTROL_POINT_PATCH = 16, + D3D_PRIMITIVE_10_CONTROL_POINT_PATCH = 17, + D3D_PRIMITIVE_11_CONTROL_POINT_PATCH = 18, + D3D_PRIMITIVE_12_CONTROL_POINT_PATCH = 19, + D3D_PRIMITIVE_13_CONTROL_POINT_PATCH = 20, + D3D_PRIMITIVE_14_CONTROL_POINT_PATCH = 21, + D3D_PRIMITIVE_15_CONTROL_POINT_PATCH = 22, + D3D_PRIMITIVE_16_CONTROL_POINT_PATCH = 23, + D3D_PRIMITIVE_17_CONTROL_POINT_PATCH = 24, + D3D_PRIMITIVE_18_CONTROL_POINT_PATCH = 25, + D3D_PRIMITIVE_19_CONTROL_POINT_PATCH = 26, + D3D_PRIMITIVE_20_CONTROL_POINT_PATCH = 27, + D3D_PRIMITIVE_21_CONTROL_POINT_PATCH = 28, + D3D_PRIMITIVE_22_CONTROL_POINT_PATCH = 29, + D3D_PRIMITIVE_23_CONTROL_POINT_PATCH = 30, + D3D_PRIMITIVE_24_CONTROL_POINT_PATCH = 31, + D3D_PRIMITIVE_25_CONTROL_POINT_PATCH = 32, + D3D_PRIMITIVE_26_CONTROL_POINT_PATCH = 33, + D3D_PRIMITIVE_27_CONTROL_POINT_PATCH = 34, + D3D_PRIMITIVE_28_CONTROL_POINT_PATCH = 35, + D3D_PRIMITIVE_29_CONTROL_POINT_PATCH = 36, + D3D_PRIMITIVE_30_CONTROL_POINT_PATCH = 37, + D3D_PRIMITIVE_31_CONTROL_POINT_PATCH = 38, + D3D_PRIMITIVE_32_CONTROL_POINT_PATCH = 39, + D3D10_PRIMITIVE_UNDEFINED = D3D_PRIMITIVE_UNDEFINED, + D3D10_PRIMITIVE_POINT = D3D_PRIMITIVE_POINT, + D3D10_PRIMITIVE_LINE = D3D_PRIMITIVE_LINE, + D3D10_PRIMITIVE_TRIANGLE = D3D_PRIMITIVE_TRIANGLE, + D3D10_PRIMITIVE_LINE_ADJ = D3D_PRIMITIVE_LINE_ADJ, + D3D10_PRIMITIVE_TRIANGLE_ADJ = D3D_PRIMITIVE_TRIANGLE_ADJ, + D3D11_PRIMITIVE_UNDEFINED = D3D_PRIMITIVE_UNDEFINED, + D3D11_PRIMITIVE_POINT = D3D_PRIMITIVE_POINT, + D3D11_PRIMITIVE_LINE = D3D_PRIMITIVE_LINE, + D3D11_PRIMITIVE_TRIANGLE = D3D_PRIMITIVE_TRIANGLE, + D3D11_PRIMITIVE_LINE_ADJ = D3D_PRIMITIVE_LINE_ADJ, + D3D11_PRIMITIVE_TRIANGLE_ADJ = D3D_PRIMITIVE_TRIANGLE_ADJ, + D3D11_PRIMITIVE_1_CONTROL_POINT_PATCH = D3D_PRIMITIVE_1_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_2_CONTROL_POINT_PATCH = D3D_PRIMITIVE_2_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_3_CONTROL_POINT_PATCH = D3D_PRIMITIVE_3_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_4_CONTROL_POINT_PATCH = D3D_PRIMITIVE_4_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_5_CONTROL_POINT_PATCH = D3D_PRIMITIVE_5_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_6_CONTROL_POINT_PATCH = D3D_PRIMITIVE_6_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_7_CONTROL_POINT_PATCH = D3D_PRIMITIVE_7_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_8_CONTROL_POINT_PATCH = D3D_PRIMITIVE_8_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_9_CONTROL_POINT_PATCH = D3D_PRIMITIVE_9_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_10_CONTROL_POINT_PATCH = D3D_PRIMITIVE_10_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_11_CONTROL_POINT_PATCH = D3D_PRIMITIVE_11_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_12_CONTROL_POINT_PATCH = D3D_PRIMITIVE_12_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_13_CONTROL_POINT_PATCH = D3D_PRIMITIVE_13_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_14_CONTROL_POINT_PATCH = D3D_PRIMITIVE_14_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_15_CONTROL_POINT_PATCH = D3D_PRIMITIVE_15_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_16_CONTROL_POINT_PATCH = D3D_PRIMITIVE_16_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_17_CONTROL_POINT_PATCH = D3D_PRIMITIVE_17_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_18_CONTROL_POINT_PATCH = D3D_PRIMITIVE_18_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_19_CONTROL_POINT_PATCH = D3D_PRIMITIVE_19_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_20_CONTROL_POINT_PATCH = D3D_PRIMITIVE_20_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_21_CONTROL_POINT_PATCH = D3D_PRIMITIVE_21_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_22_CONTROL_POINT_PATCH = D3D_PRIMITIVE_22_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_23_CONTROL_POINT_PATCH = D3D_PRIMITIVE_23_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_24_CONTROL_POINT_PATCH = D3D_PRIMITIVE_24_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_25_CONTROL_POINT_PATCH = D3D_PRIMITIVE_25_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_26_CONTROL_POINT_PATCH = D3D_PRIMITIVE_26_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_27_CONTROL_POINT_PATCH = D3D_PRIMITIVE_27_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_28_CONTROL_POINT_PATCH = D3D_PRIMITIVE_28_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_29_CONTROL_POINT_PATCH = D3D_PRIMITIVE_29_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_30_CONTROL_POINT_PATCH = D3D_PRIMITIVE_30_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_31_CONTROL_POINT_PATCH = D3D_PRIMITIVE_31_CONTROL_POINT_PATCH, + D3D11_PRIMITIVE_32_CONTROL_POINT_PATCH = D3D_PRIMITIVE_32_CONTROL_POINT_PATCH + } D3D_PRIMITIVE; + +typedef +enum D3D_SRV_DIMENSION + { + D3D_SRV_DIMENSION_UNKNOWN = 0, + D3D_SRV_DIMENSION_BUFFER = 1, + D3D_SRV_DIMENSION_TEXTURE1D = 2, + D3D_SRV_DIMENSION_TEXTURE1DARRAY = 3, + D3D_SRV_DIMENSION_TEXTURE2D = 4, + D3D_SRV_DIMENSION_TEXTURE2DARRAY = 5, + D3D_SRV_DIMENSION_TEXTURE2DMS = 6, + D3D_SRV_DIMENSION_TEXTURE2DMSARRAY = 7, + D3D_SRV_DIMENSION_TEXTURE3D = 8, + D3D_SRV_DIMENSION_TEXTURECUBE = 9, + D3D_SRV_DIMENSION_TEXTURECUBEARRAY = 10, + D3D_SRV_DIMENSION_BUFFEREX = 11, + D3D10_SRV_DIMENSION_UNKNOWN = D3D_SRV_DIMENSION_UNKNOWN, + D3D10_SRV_DIMENSION_BUFFER = D3D_SRV_DIMENSION_BUFFER, + D3D10_SRV_DIMENSION_TEXTURE1D = D3D_SRV_DIMENSION_TEXTURE1D, + D3D10_SRV_DIMENSION_TEXTURE1DARRAY = D3D_SRV_DIMENSION_TEXTURE1DARRAY, + D3D10_SRV_DIMENSION_TEXTURE2D = D3D_SRV_DIMENSION_TEXTURE2D, + D3D10_SRV_DIMENSION_TEXTURE2DARRAY = D3D_SRV_DIMENSION_TEXTURE2DARRAY, + D3D10_SRV_DIMENSION_TEXTURE2DMS = D3D_SRV_DIMENSION_TEXTURE2DMS, + D3D10_SRV_DIMENSION_TEXTURE2DMSARRAY = D3D_SRV_DIMENSION_TEXTURE2DMSARRAY, + D3D10_SRV_DIMENSION_TEXTURE3D = D3D_SRV_DIMENSION_TEXTURE3D, + D3D10_SRV_DIMENSION_TEXTURECUBE = D3D_SRV_DIMENSION_TEXTURECUBE, + D3D10_1_SRV_DIMENSION_UNKNOWN = D3D_SRV_DIMENSION_UNKNOWN, + D3D10_1_SRV_DIMENSION_BUFFER = D3D_SRV_DIMENSION_BUFFER, + D3D10_1_SRV_DIMENSION_TEXTURE1D = D3D_SRV_DIMENSION_TEXTURE1D, + D3D10_1_SRV_DIMENSION_TEXTURE1DARRAY = D3D_SRV_DIMENSION_TEXTURE1DARRAY, + D3D10_1_SRV_DIMENSION_TEXTURE2D = D3D_SRV_DIMENSION_TEXTURE2D, + D3D10_1_SRV_DIMENSION_TEXTURE2DARRAY = D3D_SRV_DIMENSION_TEXTURE2DARRAY, + D3D10_1_SRV_DIMENSION_TEXTURE2DMS = D3D_SRV_DIMENSION_TEXTURE2DMS, + D3D10_1_SRV_DIMENSION_TEXTURE2DMSARRAY = D3D_SRV_DIMENSION_TEXTURE2DMSARRAY, + D3D10_1_SRV_DIMENSION_TEXTURE3D = D3D_SRV_DIMENSION_TEXTURE3D, + D3D10_1_SRV_DIMENSION_TEXTURECUBE = D3D_SRV_DIMENSION_TEXTURECUBE, + D3D10_1_SRV_DIMENSION_TEXTURECUBEARRAY = D3D_SRV_DIMENSION_TEXTURECUBEARRAY, + D3D11_SRV_DIMENSION_UNKNOWN = D3D_SRV_DIMENSION_UNKNOWN, + D3D11_SRV_DIMENSION_BUFFER = D3D_SRV_DIMENSION_BUFFER, + D3D11_SRV_DIMENSION_TEXTURE1D = D3D_SRV_DIMENSION_TEXTURE1D, + D3D11_SRV_DIMENSION_TEXTURE1DARRAY = D3D_SRV_DIMENSION_TEXTURE1DARRAY, + D3D11_SRV_DIMENSION_TEXTURE2D = D3D_SRV_DIMENSION_TEXTURE2D, + D3D11_SRV_DIMENSION_TEXTURE2DARRAY = D3D_SRV_DIMENSION_TEXTURE2DARRAY, + D3D11_SRV_DIMENSION_TEXTURE2DMS = D3D_SRV_DIMENSION_TEXTURE2DMS, + D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY = D3D_SRV_DIMENSION_TEXTURE2DMSARRAY, + D3D11_SRV_DIMENSION_TEXTURE3D = D3D_SRV_DIMENSION_TEXTURE3D, + D3D11_SRV_DIMENSION_TEXTURECUBE = D3D_SRV_DIMENSION_TEXTURECUBE, + D3D11_SRV_DIMENSION_TEXTURECUBEARRAY = D3D_SRV_DIMENSION_TEXTURECUBEARRAY, + D3D11_SRV_DIMENSION_BUFFEREX = D3D_SRV_DIMENSION_BUFFEREX + } D3D_SRV_DIMENSION; + +#define D3D_SHADER_FEATURE_DOUBLES 0x00001 +#define D3D_SHADER_FEATURE_COMPUTE_SHADERS_PLUS_RAW_AND_STRUCTURED_BUFFERS_VIA_SHADER_4_X 0x00002 +#define D3D_SHADER_FEATURE_UAVS_AT_EVERY_STAGE 0x00004 +#define D3D_SHADER_FEATURE_64_UAVS 0x00008 +#define D3D_SHADER_FEATURE_MINIMUM_PRECISION 0x00010 +#define D3D_SHADER_FEATURE_11_1_DOUBLE_EXTENSIONS 0x00020 +#define D3D_SHADER_FEATURE_11_1_SHADER_EXTENSIONS 0x00040 +#define D3D_SHADER_FEATURE_LEVEL_9_COMPARISON_FILTERING 0x00080 +#define D3D_SHADER_FEATURE_TILED_RESOURCES 0x00100 +#define D3D_SHADER_FEATURE_STENCIL_REF 0x00200 +#define D3D_SHADER_FEATURE_INNER_COVERAGE 0x00400 +#define D3D_SHADER_FEATURE_TYPED_UAV_LOAD_ADDITIONAL_FORMATS 0x00800 +#define D3D_SHADER_FEATURE_ROVS 0x01000 +#define D3D_SHADER_FEATURE_VIEWPORT_AND_RT_ARRAY_INDEX_FROM_ANY_SHADER_FEEDING_RASTERIZER 0x02000 +#define D3D_SHADER_FEATURE_WAVE_OPS 0x04000 +#define D3D_SHADER_FEATURE_INT64_OPS 0x08000 +#define D3D_SHADER_FEATURE_VIEW_ID 0x10000 +#define D3D_SHADER_FEATURE_BARYCENTRICS 0x20000 +#define D3D_SHADER_FEATURE_NATIVE_16BIT_OPS 0x40000 +#define D3D_SHADER_FEATURE_SHADING_RATE 0x80000 +#define D3D_SHADER_FEATURE_RAYTRACING_TIER_1_1 0x100000 +#define D3D_SHADER_FEATURE_SAMPLER_FEEDBACK 0x200000 +#define D3D_SHADER_FEATURE_ATOMIC_INT64_ON_TYPED_RESOURCE 0x400000 +#define D3D_SHADER_FEATURE_ATOMIC_INT64_ON_GROUP_SHARED 0x800000 +#define D3D_SHADER_FEATURE_DERIVATIVES_IN_MESH_AND_AMPLIFICATION_SHADERS 0x1000000 +#define D3D_SHADER_FEATURE_RESOURCE_DESCRIPTOR_HEAP_INDEXING 0x2000000 +#define D3D_SHADER_FEATURE_SAMPLER_DESCRIPTOR_HEAP_INDEXING 0x4000000 +#define D3D_SHADER_FEATURE_WAVE_MMA 0x8000000 +#define D3D_SHADER_FEATURE_ATOMIC_INT64_ON_DESCRIPTOR_HEAP_RESOURCE 0x10000000 +#define D3D_SHADER_FEATURE_ADVANCED_TEXTURE_OPS 0x20000000 +#define D3D_SHADER_FEATURE_WRITEABLE_MSAA_TEXTURES 0x40000000 +typedef struct _D3D_SHADER_MACRO + { + LPCSTR Name; + LPCSTR Definition; + } D3D_SHADER_MACRO; + +typedef struct _D3D_SHADER_MACRO *LPD3D_SHADER_MACRO; + +DEFINE_GUID(IID_ID3D10Blob, 0x8ba5fb08, 0x5195, 0x40e2, 0xac, 0x58, 0xd, 0x98, 0x9c, 0x3a, 0x1, 0x2); + + +extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0000_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0000_v0_0_s_ifspec; + +#ifndef __ID3D10Blob_INTERFACE_DEFINED__ +#define __ID3D10Blob_INTERFACE_DEFINED__ + +/* interface ID3D10Blob */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3D10Blob; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("8BA5FB08-5195-40e2-AC58-0D989C3A0102") + ID3D10Blob : public IUnknown + { + public: + virtual LPVOID STDMETHODCALLTYPE GetBufferPointer( void) = 0; + + virtual SIZE_T STDMETHODCALLTYPE GetBufferSize( void) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3D10BlobVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3D10Blob * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3D10Blob * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3D10Blob * This); + + DECLSPEC_XFGVIRT(ID3D10Blob, GetBufferPointer) + LPVOID ( STDMETHODCALLTYPE *GetBufferPointer )( + ID3D10Blob * This); + + DECLSPEC_XFGVIRT(ID3D10Blob, GetBufferSize) + SIZE_T ( STDMETHODCALLTYPE *GetBufferSize )( + ID3D10Blob * This); + + END_INTERFACE + } ID3D10BlobVtbl; + + interface ID3D10Blob + { + CONST_VTBL struct ID3D10BlobVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3D10Blob_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3D10Blob_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3D10Blob_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3D10Blob_GetBufferPointer(This) \ + ( (This)->lpVtbl -> GetBufferPointer(This) ) + +#define ID3D10Blob_GetBufferSize(This) \ + ( (This)->lpVtbl -> GetBufferSize(This) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3D10Blob_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3dcommon_0000_0001 */ +/* [local] */ + +typedef interface ID3D10Blob* LPD3D10BLOB; +typedef ID3D10Blob ID3DBlob; + +typedef ID3DBlob* LPD3DBLOB; +#define IID_ID3DBlob IID_ID3D10Blob +typedef void ( __stdcall *PFN_DESTRUCTION_CALLBACK )( + void *pData); + + + +extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0001_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0001_v0_0_s_ifspec; + +#ifndef __ID3DDestructionNotifier_INTERFACE_DEFINED__ +#define __ID3DDestructionNotifier_INTERFACE_DEFINED__ + +/* interface ID3DDestructionNotifier */ +/* [unique][local][object][uuid] */ + + +EXTERN_C const IID IID_ID3DDestructionNotifier; + +#if defined(__cplusplus) && !defined(CINTERFACE) + + MIDL_INTERFACE("a06eb39a-50da-425b-8c31-4eecd6c270f3") + ID3DDestructionNotifier : public IUnknown + { + public: + virtual HRESULT STDMETHODCALLTYPE RegisterDestructionCallback( + /* [annotation] */ + _In_ PFN_DESTRUCTION_CALLBACK callbackFn, + /* [annotation] */ + _In_ void *pData, + /* [annotation] */ + _Out_ UINT *pCallbackID) = 0; + + virtual HRESULT STDMETHODCALLTYPE UnregisterDestructionCallback( + /* [annotation] */ + _In_ UINT callbackID) = 0; + + }; + + +#else /* C style interface */ + + typedef struct ID3DDestructionNotifierVtbl + { + BEGIN_INTERFACE + + DECLSPEC_XFGVIRT(IUnknown, QueryInterface) + HRESULT ( STDMETHODCALLTYPE *QueryInterface )( + ID3DDestructionNotifier * This, + /* [in] */ REFIID riid, + /* [annotation][iid_is][out] */ + _COM_Outptr_ void **ppvObject); + + DECLSPEC_XFGVIRT(IUnknown, AddRef) + ULONG ( STDMETHODCALLTYPE *AddRef )( + ID3DDestructionNotifier * This); + + DECLSPEC_XFGVIRT(IUnknown, Release) + ULONG ( STDMETHODCALLTYPE *Release )( + ID3DDestructionNotifier * This); + + DECLSPEC_XFGVIRT(ID3DDestructionNotifier, RegisterDestructionCallback) + HRESULT ( STDMETHODCALLTYPE *RegisterDestructionCallback )( + ID3DDestructionNotifier * This, + /* [annotation] */ + _In_ PFN_DESTRUCTION_CALLBACK callbackFn, + /* [annotation] */ + _In_ void *pData, + /* [annotation] */ + _Out_ UINT *pCallbackID); + + DECLSPEC_XFGVIRT(ID3DDestructionNotifier, UnregisterDestructionCallback) + HRESULT ( STDMETHODCALLTYPE *UnregisterDestructionCallback )( + ID3DDestructionNotifier * This, + /* [annotation] */ + _In_ UINT callbackID); + + END_INTERFACE + } ID3DDestructionNotifierVtbl; + + interface ID3DDestructionNotifier + { + CONST_VTBL struct ID3DDestructionNotifierVtbl *lpVtbl; + }; + + + +#ifdef COBJMACROS + + +#define ID3DDestructionNotifier_QueryInterface(This,riid,ppvObject) \ + ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) + +#define ID3DDestructionNotifier_AddRef(This) \ + ( (This)->lpVtbl -> AddRef(This) ) + +#define ID3DDestructionNotifier_Release(This) \ + ( (This)->lpVtbl -> Release(This) ) + + +#define ID3DDestructionNotifier_RegisterDestructionCallback(This,callbackFn,pData,pCallbackID) \ + ( (This)->lpVtbl -> RegisterDestructionCallback(This,callbackFn,pData,pCallbackID) ) + +#define ID3DDestructionNotifier_UnregisterDestructionCallback(This,callbackID) \ + ( (This)->lpVtbl -> UnregisterDestructionCallback(This,callbackID) ) + +#endif /* COBJMACROS */ + + +#endif /* C style interface */ + + + + +#endif /* __ID3DDestructionNotifier_INTERFACE_DEFINED__ */ + + +/* interface __MIDL_itf_d3dcommon_0000_0002 */ +/* [local] */ + +typedef +enum _D3D_INCLUDE_TYPE + { + D3D_INCLUDE_LOCAL = 0, + D3D_INCLUDE_SYSTEM = ( D3D_INCLUDE_LOCAL + 1 ) , + D3D10_INCLUDE_LOCAL = D3D_INCLUDE_LOCAL, + D3D10_INCLUDE_SYSTEM = D3D_INCLUDE_SYSTEM, + D3D_INCLUDE_FORCE_DWORD = 0x7fffffff + } D3D_INCLUDE_TYPE; + +typedef interface ID3DInclude ID3DInclude; +#undef INTERFACE +#define INTERFACE ID3DInclude +DECLARE_INTERFACE(ID3DInclude) +{ + STDMETHOD(Open)(THIS_ D3D_INCLUDE_TYPE IncludeType, LPCSTR pFileName, LPCVOID pParentData, LPCVOID *ppData, UINT *pBytes) PURE; + STDMETHOD(Close)(THIS_ LPCVOID pData) PURE; +}; +typedef ID3DInclude* LPD3DINCLUDE; +typedef +enum _D3D_SHADER_VARIABLE_CLASS + { + D3D_SVC_SCALAR = 0, + D3D_SVC_VECTOR = ( D3D_SVC_SCALAR + 1 ) , + D3D_SVC_MATRIX_ROWS = ( D3D_SVC_VECTOR + 1 ) , + D3D_SVC_MATRIX_COLUMNS = ( D3D_SVC_MATRIX_ROWS + 1 ) , + D3D_SVC_OBJECT = ( D3D_SVC_MATRIX_COLUMNS + 1 ) , + D3D_SVC_STRUCT = ( D3D_SVC_OBJECT + 1 ) , + D3D_SVC_INTERFACE_CLASS = ( D3D_SVC_STRUCT + 1 ) , + D3D_SVC_INTERFACE_POINTER = ( D3D_SVC_INTERFACE_CLASS + 1 ) , + D3D10_SVC_SCALAR = D3D_SVC_SCALAR, + D3D10_SVC_VECTOR = D3D_SVC_VECTOR, + D3D10_SVC_MATRIX_ROWS = D3D_SVC_MATRIX_ROWS, + D3D10_SVC_MATRIX_COLUMNS = D3D_SVC_MATRIX_COLUMNS, + D3D10_SVC_OBJECT = D3D_SVC_OBJECT, + D3D10_SVC_STRUCT = D3D_SVC_STRUCT, + D3D11_SVC_INTERFACE_CLASS = D3D_SVC_INTERFACE_CLASS, + D3D11_SVC_INTERFACE_POINTER = D3D_SVC_INTERFACE_POINTER, + D3D_SVC_FORCE_DWORD = 0x7fffffff + } D3D_SHADER_VARIABLE_CLASS; + +typedef +enum _D3D_SHADER_VARIABLE_FLAGS + { + D3D_SVF_USERPACKED = 1, + D3D_SVF_USED = 2, + D3D_SVF_INTERFACE_POINTER = 4, + D3D_SVF_INTERFACE_PARAMETER = 8, + D3D10_SVF_USERPACKED = D3D_SVF_USERPACKED, + D3D10_SVF_USED = D3D_SVF_USED, + D3D11_SVF_INTERFACE_POINTER = D3D_SVF_INTERFACE_POINTER, + D3D11_SVF_INTERFACE_PARAMETER = D3D_SVF_INTERFACE_PARAMETER, + D3D_SVF_FORCE_DWORD = 0x7fffffff + } D3D_SHADER_VARIABLE_FLAGS; + +typedef +enum _D3D_SHADER_VARIABLE_TYPE + { + D3D_SVT_VOID = 0, + D3D_SVT_BOOL = 1, + D3D_SVT_INT = 2, + D3D_SVT_FLOAT = 3, + D3D_SVT_STRING = 4, + D3D_SVT_TEXTURE = 5, + D3D_SVT_TEXTURE1D = 6, + D3D_SVT_TEXTURE2D = 7, + D3D_SVT_TEXTURE3D = 8, + D3D_SVT_TEXTURECUBE = 9, + D3D_SVT_SAMPLER = 10, + D3D_SVT_SAMPLER1D = 11, + D3D_SVT_SAMPLER2D = 12, + D3D_SVT_SAMPLER3D = 13, + D3D_SVT_SAMPLERCUBE = 14, + D3D_SVT_PIXELSHADER = 15, + D3D_SVT_VERTEXSHADER = 16, + D3D_SVT_PIXELFRAGMENT = 17, + D3D_SVT_VERTEXFRAGMENT = 18, + D3D_SVT_UINT = 19, + D3D_SVT_UINT8 = 20, + D3D_SVT_GEOMETRYSHADER = 21, + D3D_SVT_RASTERIZER = 22, + D3D_SVT_DEPTHSTENCIL = 23, + D3D_SVT_BLEND = 24, + D3D_SVT_BUFFER = 25, + D3D_SVT_CBUFFER = 26, + D3D_SVT_TBUFFER = 27, + D3D_SVT_TEXTURE1DARRAY = 28, + D3D_SVT_TEXTURE2DARRAY = 29, + D3D_SVT_RENDERTARGETVIEW = 30, + D3D_SVT_DEPTHSTENCILVIEW = 31, + D3D_SVT_TEXTURE2DMS = 32, + D3D_SVT_TEXTURE2DMSARRAY = 33, + D3D_SVT_TEXTURECUBEARRAY = 34, + D3D_SVT_HULLSHADER = 35, + D3D_SVT_DOMAINSHADER = 36, + D3D_SVT_INTERFACE_POINTER = 37, + D3D_SVT_COMPUTESHADER = 38, + D3D_SVT_DOUBLE = 39, + D3D_SVT_RWTEXTURE1D = 40, + D3D_SVT_RWTEXTURE1DARRAY = 41, + D3D_SVT_RWTEXTURE2D = 42, + D3D_SVT_RWTEXTURE2DARRAY = 43, + D3D_SVT_RWTEXTURE3D = 44, + D3D_SVT_RWBUFFER = 45, + D3D_SVT_BYTEADDRESS_BUFFER = 46, + D3D_SVT_RWBYTEADDRESS_BUFFER = 47, + D3D_SVT_STRUCTURED_BUFFER = 48, + D3D_SVT_RWSTRUCTURED_BUFFER = 49, + D3D_SVT_APPEND_STRUCTURED_BUFFER = 50, + D3D_SVT_CONSUME_STRUCTURED_BUFFER = 51, + D3D_SVT_MIN8FLOAT = 52, + D3D_SVT_MIN10FLOAT = 53, + D3D_SVT_MIN16FLOAT = 54, + D3D_SVT_MIN12INT = 55, + D3D_SVT_MIN16INT = 56, + D3D_SVT_MIN16UINT = 57, + D3D_SVT_INT16 = 58, + D3D_SVT_UINT16 = 59, + D3D_SVT_FLOAT16 = 60, + D3D_SVT_INT64 = 61, + D3D_SVT_UINT64 = 62, + D3D10_SVT_VOID = D3D_SVT_VOID, + D3D10_SVT_BOOL = D3D_SVT_BOOL, + D3D10_SVT_INT = D3D_SVT_INT, + D3D10_SVT_FLOAT = D3D_SVT_FLOAT, + D3D10_SVT_STRING = D3D_SVT_STRING, + D3D10_SVT_TEXTURE = D3D_SVT_TEXTURE, + D3D10_SVT_TEXTURE1D = D3D_SVT_TEXTURE1D, + D3D10_SVT_TEXTURE2D = D3D_SVT_TEXTURE2D, + D3D10_SVT_TEXTURE3D = D3D_SVT_TEXTURE3D, + D3D10_SVT_TEXTURECUBE = D3D_SVT_TEXTURECUBE, + D3D10_SVT_SAMPLER = D3D_SVT_SAMPLER, + D3D10_SVT_SAMPLER1D = D3D_SVT_SAMPLER1D, + D3D10_SVT_SAMPLER2D = D3D_SVT_SAMPLER2D, + D3D10_SVT_SAMPLER3D = D3D_SVT_SAMPLER3D, + D3D10_SVT_SAMPLERCUBE = D3D_SVT_SAMPLERCUBE, + D3D10_SVT_PIXELSHADER = D3D_SVT_PIXELSHADER, + D3D10_SVT_VERTEXSHADER = D3D_SVT_VERTEXSHADER, + D3D10_SVT_PIXELFRAGMENT = D3D_SVT_PIXELFRAGMENT, + D3D10_SVT_VERTEXFRAGMENT = D3D_SVT_VERTEXFRAGMENT, + D3D10_SVT_UINT = D3D_SVT_UINT, + D3D10_SVT_UINT8 = D3D_SVT_UINT8, + D3D10_SVT_GEOMETRYSHADER = D3D_SVT_GEOMETRYSHADER, + D3D10_SVT_RASTERIZER = D3D_SVT_RASTERIZER, + D3D10_SVT_DEPTHSTENCIL = D3D_SVT_DEPTHSTENCIL, + D3D10_SVT_BLEND = D3D_SVT_BLEND, + D3D10_SVT_BUFFER = D3D_SVT_BUFFER, + D3D10_SVT_CBUFFER = D3D_SVT_CBUFFER, + D3D10_SVT_TBUFFER = D3D_SVT_TBUFFER, + D3D10_SVT_TEXTURE1DARRAY = D3D_SVT_TEXTURE1DARRAY, + D3D10_SVT_TEXTURE2DARRAY = D3D_SVT_TEXTURE2DARRAY, + D3D10_SVT_RENDERTARGETVIEW = D3D_SVT_RENDERTARGETVIEW, + D3D10_SVT_DEPTHSTENCILVIEW = D3D_SVT_DEPTHSTENCILVIEW, + D3D10_SVT_TEXTURE2DMS = D3D_SVT_TEXTURE2DMS, + D3D10_SVT_TEXTURE2DMSARRAY = D3D_SVT_TEXTURE2DMSARRAY, + D3D10_SVT_TEXTURECUBEARRAY = D3D_SVT_TEXTURECUBEARRAY, + D3D11_SVT_HULLSHADER = D3D_SVT_HULLSHADER, + D3D11_SVT_DOMAINSHADER = D3D_SVT_DOMAINSHADER, + D3D11_SVT_INTERFACE_POINTER = D3D_SVT_INTERFACE_POINTER, + D3D11_SVT_COMPUTESHADER = D3D_SVT_COMPUTESHADER, + D3D11_SVT_DOUBLE = D3D_SVT_DOUBLE, + D3D11_SVT_RWTEXTURE1D = D3D_SVT_RWTEXTURE1D, + D3D11_SVT_RWTEXTURE1DARRAY = D3D_SVT_RWTEXTURE1DARRAY, + D3D11_SVT_RWTEXTURE2D = D3D_SVT_RWTEXTURE2D, + D3D11_SVT_RWTEXTURE2DARRAY = D3D_SVT_RWTEXTURE2DARRAY, + D3D11_SVT_RWTEXTURE3D = D3D_SVT_RWTEXTURE3D, + D3D11_SVT_RWBUFFER = D3D_SVT_RWBUFFER, + D3D11_SVT_BYTEADDRESS_BUFFER = D3D_SVT_BYTEADDRESS_BUFFER, + D3D11_SVT_RWBYTEADDRESS_BUFFER = D3D_SVT_RWBYTEADDRESS_BUFFER, + D3D11_SVT_STRUCTURED_BUFFER = D3D_SVT_STRUCTURED_BUFFER, + D3D11_SVT_RWSTRUCTURED_BUFFER = D3D_SVT_RWSTRUCTURED_BUFFER, + D3D11_SVT_APPEND_STRUCTURED_BUFFER = D3D_SVT_APPEND_STRUCTURED_BUFFER, + D3D11_SVT_CONSUME_STRUCTURED_BUFFER = D3D_SVT_CONSUME_STRUCTURED_BUFFER, + D3D_SVT_FORCE_DWORD = 0x7fffffff + } D3D_SHADER_VARIABLE_TYPE; + +typedef +enum _D3D_SHADER_INPUT_FLAGS + { + D3D_SIF_USERPACKED = 0x1, + D3D_SIF_COMPARISON_SAMPLER = 0x2, + D3D_SIF_TEXTURE_COMPONENT_0 = 0x4, + D3D_SIF_TEXTURE_COMPONENT_1 = 0x8, + D3D_SIF_TEXTURE_COMPONENTS = 0xc, + D3D_SIF_UNUSED = 0x10, + D3D10_SIF_USERPACKED = D3D_SIF_USERPACKED, + D3D10_SIF_COMPARISON_SAMPLER = D3D_SIF_COMPARISON_SAMPLER, + D3D10_SIF_TEXTURE_COMPONENT_0 = D3D_SIF_TEXTURE_COMPONENT_0, + D3D10_SIF_TEXTURE_COMPONENT_1 = D3D_SIF_TEXTURE_COMPONENT_1, + D3D10_SIF_TEXTURE_COMPONENTS = D3D_SIF_TEXTURE_COMPONENTS, + D3D_SIF_FORCE_DWORD = 0x7fffffff + } D3D_SHADER_INPUT_FLAGS; + +typedef +enum _D3D_SHADER_INPUT_TYPE + { + D3D_SIT_CBUFFER = 0, + D3D_SIT_TBUFFER = ( D3D_SIT_CBUFFER + 1 ) , + D3D_SIT_TEXTURE = ( D3D_SIT_TBUFFER + 1 ) , + D3D_SIT_SAMPLER = ( D3D_SIT_TEXTURE + 1 ) , + D3D_SIT_UAV_RWTYPED = ( D3D_SIT_SAMPLER + 1 ) , + D3D_SIT_STRUCTURED = ( D3D_SIT_UAV_RWTYPED + 1 ) , + D3D_SIT_UAV_RWSTRUCTURED = ( D3D_SIT_STRUCTURED + 1 ) , + D3D_SIT_BYTEADDRESS = ( D3D_SIT_UAV_RWSTRUCTURED + 1 ) , + D3D_SIT_UAV_RWBYTEADDRESS = ( D3D_SIT_BYTEADDRESS + 1 ) , + D3D_SIT_UAV_APPEND_STRUCTURED = ( D3D_SIT_UAV_RWBYTEADDRESS + 1 ) , + D3D_SIT_UAV_CONSUME_STRUCTURED = ( D3D_SIT_UAV_APPEND_STRUCTURED + 1 ) , + D3D_SIT_UAV_RWSTRUCTURED_WITH_COUNTER = ( D3D_SIT_UAV_CONSUME_STRUCTURED + 1 ) , + D3D_SIT_RTACCELERATIONSTRUCTURE = ( D3D_SIT_UAV_RWSTRUCTURED_WITH_COUNTER + 1 ) , + D3D_SIT_UAV_FEEDBACKTEXTURE = ( D3D_SIT_RTACCELERATIONSTRUCTURE + 1 ) , + D3D10_SIT_CBUFFER = D3D_SIT_CBUFFER, + D3D10_SIT_TBUFFER = D3D_SIT_TBUFFER, + D3D10_SIT_TEXTURE = D3D_SIT_TEXTURE, + D3D10_SIT_SAMPLER = D3D_SIT_SAMPLER, + D3D11_SIT_UAV_RWTYPED = D3D_SIT_UAV_RWTYPED, + D3D11_SIT_STRUCTURED = D3D_SIT_STRUCTURED, + D3D11_SIT_UAV_RWSTRUCTURED = D3D_SIT_UAV_RWSTRUCTURED, + D3D11_SIT_BYTEADDRESS = D3D_SIT_BYTEADDRESS, + D3D11_SIT_UAV_RWBYTEADDRESS = D3D_SIT_UAV_RWBYTEADDRESS, + D3D11_SIT_UAV_APPEND_STRUCTURED = D3D_SIT_UAV_APPEND_STRUCTURED, + D3D11_SIT_UAV_CONSUME_STRUCTURED = D3D_SIT_UAV_CONSUME_STRUCTURED, + D3D11_SIT_UAV_RWSTRUCTURED_WITH_COUNTER = D3D_SIT_UAV_RWSTRUCTURED_WITH_COUNTER + } D3D_SHADER_INPUT_TYPE; + +typedef +enum _D3D_SHADER_CBUFFER_FLAGS + { + D3D_CBF_USERPACKED = 1, + D3D10_CBF_USERPACKED = D3D_CBF_USERPACKED, + D3D_CBF_FORCE_DWORD = 0x7fffffff + } D3D_SHADER_CBUFFER_FLAGS; + +typedef +enum _D3D_CBUFFER_TYPE + { + D3D_CT_CBUFFER = 0, + D3D_CT_TBUFFER = ( D3D_CT_CBUFFER + 1 ) , + D3D_CT_INTERFACE_POINTERS = ( D3D_CT_TBUFFER + 1 ) , + D3D_CT_RESOURCE_BIND_INFO = ( D3D_CT_INTERFACE_POINTERS + 1 ) , + D3D10_CT_CBUFFER = D3D_CT_CBUFFER, + D3D10_CT_TBUFFER = D3D_CT_TBUFFER, + D3D11_CT_CBUFFER = D3D_CT_CBUFFER, + D3D11_CT_TBUFFER = D3D_CT_TBUFFER, + D3D11_CT_INTERFACE_POINTERS = D3D_CT_INTERFACE_POINTERS, + D3D11_CT_RESOURCE_BIND_INFO = D3D_CT_RESOURCE_BIND_INFO + } D3D_CBUFFER_TYPE; + +typedef +enum D3D_NAME + { + D3D_NAME_UNDEFINED = 0, + D3D_NAME_POSITION = 1, + D3D_NAME_CLIP_DISTANCE = 2, + D3D_NAME_CULL_DISTANCE = 3, + D3D_NAME_RENDER_TARGET_ARRAY_INDEX = 4, + D3D_NAME_VIEWPORT_ARRAY_INDEX = 5, + D3D_NAME_VERTEX_ID = 6, + D3D_NAME_PRIMITIVE_ID = 7, + D3D_NAME_INSTANCE_ID = 8, + D3D_NAME_IS_FRONT_FACE = 9, + D3D_NAME_SAMPLE_INDEX = 10, + D3D_NAME_FINAL_QUAD_EDGE_TESSFACTOR = 11, + D3D_NAME_FINAL_QUAD_INSIDE_TESSFACTOR = 12, + D3D_NAME_FINAL_TRI_EDGE_TESSFACTOR = 13, + D3D_NAME_FINAL_TRI_INSIDE_TESSFACTOR = 14, + D3D_NAME_FINAL_LINE_DETAIL_TESSFACTOR = 15, + D3D_NAME_FINAL_LINE_DENSITY_TESSFACTOR = 16, + D3D_NAME_BARYCENTRICS = 23, + D3D_NAME_SHADINGRATE = 24, + D3D_NAME_CULLPRIMITIVE = 25, + D3D_NAME_TARGET = 64, + D3D_NAME_DEPTH = 65, + D3D_NAME_COVERAGE = 66, + D3D_NAME_DEPTH_GREATER_EQUAL = 67, + D3D_NAME_DEPTH_LESS_EQUAL = 68, + D3D_NAME_STENCIL_REF = 69, + D3D_NAME_INNER_COVERAGE = 70, + D3D10_NAME_UNDEFINED = D3D_NAME_UNDEFINED, + D3D10_NAME_POSITION = D3D_NAME_POSITION, + D3D10_NAME_CLIP_DISTANCE = D3D_NAME_CLIP_DISTANCE, + D3D10_NAME_CULL_DISTANCE = D3D_NAME_CULL_DISTANCE, + D3D10_NAME_RENDER_TARGET_ARRAY_INDEX = D3D_NAME_RENDER_TARGET_ARRAY_INDEX, + D3D10_NAME_VIEWPORT_ARRAY_INDEX = D3D_NAME_VIEWPORT_ARRAY_INDEX, + D3D10_NAME_VERTEX_ID = D3D_NAME_VERTEX_ID, + D3D10_NAME_PRIMITIVE_ID = D3D_NAME_PRIMITIVE_ID, + D3D10_NAME_INSTANCE_ID = D3D_NAME_INSTANCE_ID, + D3D10_NAME_IS_FRONT_FACE = D3D_NAME_IS_FRONT_FACE, + D3D10_NAME_SAMPLE_INDEX = D3D_NAME_SAMPLE_INDEX, + D3D10_NAME_TARGET = D3D_NAME_TARGET, + D3D10_NAME_DEPTH = D3D_NAME_DEPTH, + D3D10_NAME_COVERAGE = D3D_NAME_COVERAGE, + D3D11_NAME_FINAL_QUAD_EDGE_TESSFACTOR = D3D_NAME_FINAL_QUAD_EDGE_TESSFACTOR, + D3D11_NAME_FINAL_QUAD_INSIDE_TESSFACTOR = D3D_NAME_FINAL_QUAD_INSIDE_TESSFACTOR, + D3D11_NAME_FINAL_TRI_EDGE_TESSFACTOR = D3D_NAME_FINAL_TRI_EDGE_TESSFACTOR, + D3D11_NAME_FINAL_TRI_INSIDE_TESSFACTOR = D3D_NAME_FINAL_TRI_INSIDE_TESSFACTOR, + D3D11_NAME_FINAL_LINE_DETAIL_TESSFACTOR = D3D_NAME_FINAL_LINE_DETAIL_TESSFACTOR, + D3D11_NAME_FINAL_LINE_DENSITY_TESSFACTOR = D3D_NAME_FINAL_LINE_DENSITY_TESSFACTOR, + D3D11_NAME_DEPTH_GREATER_EQUAL = D3D_NAME_DEPTH_GREATER_EQUAL, + D3D11_NAME_DEPTH_LESS_EQUAL = D3D_NAME_DEPTH_LESS_EQUAL, + D3D11_NAME_STENCIL_REF = D3D_NAME_STENCIL_REF, + D3D11_NAME_INNER_COVERAGE = D3D_NAME_INNER_COVERAGE, + D3D12_NAME_BARYCENTRICS = D3D_NAME_BARYCENTRICS, + D3D12_NAME_SHADINGRATE = D3D_NAME_SHADINGRATE, + D3D12_NAME_CULLPRIMITIVE = D3D_NAME_CULLPRIMITIVE + } D3D_NAME; + +typedef +enum D3D_RESOURCE_RETURN_TYPE + { + D3D_RETURN_TYPE_UNORM = 1, + D3D_RETURN_TYPE_SNORM = 2, + D3D_RETURN_TYPE_SINT = 3, + D3D_RETURN_TYPE_UINT = 4, + D3D_RETURN_TYPE_FLOAT = 5, + D3D_RETURN_TYPE_MIXED = 6, + D3D_RETURN_TYPE_DOUBLE = 7, + D3D_RETURN_TYPE_CONTINUED = 8, + D3D10_RETURN_TYPE_UNORM = D3D_RETURN_TYPE_UNORM, + D3D10_RETURN_TYPE_SNORM = D3D_RETURN_TYPE_SNORM, + D3D10_RETURN_TYPE_SINT = D3D_RETURN_TYPE_SINT, + D3D10_RETURN_TYPE_UINT = D3D_RETURN_TYPE_UINT, + D3D10_RETURN_TYPE_FLOAT = D3D_RETURN_TYPE_FLOAT, + D3D10_RETURN_TYPE_MIXED = D3D_RETURN_TYPE_MIXED, + D3D11_RETURN_TYPE_UNORM = D3D_RETURN_TYPE_UNORM, + D3D11_RETURN_TYPE_SNORM = D3D_RETURN_TYPE_SNORM, + D3D11_RETURN_TYPE_SINT = D3D_RETURN_TYPE_SINT, + D3D11_RETURN_TYPE_UINT = D3D_RETURN_TYPE_UINT, + D3D11_RETURN_TYPE_FLOAT = D3D_RETURN_TYPE_FLOAT, + D3D11_RETURN_TYPE_MIXED = D3D_RETURN_TYPE_MIXED, + D3D11_RETURN_TYPE_DOUBLE = D3D_RETURN_TYPE_DOUBLE, + D3D11_RETURN_TYPE_CONTINUED = D3D_RETURN_TYPE_CONTINUED + } D3D_RESOURCE_RETURN_TYPE; + +typedef +enum D3D_REGISTER_COMPONENT_TYPE + { + D3D_REGISTER_COMPONENT_UNKNOWN = 0, + D3D_REGISTER_COMPONENT_UINT32 = 1, + D3D_REGISTER_COMPONENT_SINT32 = 2, + D3D_REGISTER_COMPONENT_FLOAT32 = 3, + D3D10_REGISTER_COMPONENT_UNKNOWN = D3D_REGISTER_COMPONENT_UNKNOWN, + D3D10_REGISTER_COMPONENT_UINT32 = D3D_REGISTER_COMPONENT_UINT32, + D3D10_REGISTER_COMPONENT_SINT32 = D3D_REGISTER_COMPONENT_SINT32, + D3D10_REGISTER_COMPONENT_FLOAT32 = D3D_REGISTER_COMPONENT_FLOAT32 + } D3D_REGISTER_COMPONENT_TYPE; + +typedef +enum D3D_TESSELLATOR_DOMAIN + { + D3D_TESSELLATOR_DOMAIN_UNDEFINED = 0, + D3D_TESSELLATOR_DOMAIN_ISOLINE = 1, + D3D_TESSELLATOR_DOMAIN_TRI = 2, + D3D_TESSELLATOR_DOMAIN_QUAD = 3, + D3D11_TESSELLATOR_DOMAIN_UNDEFINED = D3D_TESSELLATOR_DOMAIN_UNDEFINED, + D3D11_TESSELLATOR_DOMAIN_ISOLINE = D3D_TESSELLATOR_DOMAIN_ISOLINE, + D3D11_TESSELLATOR_DOMAIN_TRI = D3D_TESSELLATOR_DOMAIN_TRI, + D3D11_TESSELLATOR_DOMAIN_QUAD = D3D_TESSELLATOR_DOMAIN_QUAD + } D3D_TESSELLATOR_DOMAIN; + +typedef +enum D3D_TESSELLATOR_PARTITIONING + { + D3D_TESSELLATOR_PARTITIONING_UNDEFINED = 0, + D3D_TESSELLATOR_PARTITIONING_INTEGER = 1, + D3D_TESSELLATOR_PARTITIONING_POW2 = 2, + D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD = 3, + D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN = 4, + D3D11_TESSELLATOR_PARTITIONING_UNDEFINED = D3D_TESSELLATOR_PARTITIONING_UNDEFINED, + D3D11_TESSELLATOR_PARTITIONING_INTEGER = D3D_TESSELLATOR_PARTITIONING_INTEGER, + D3D11_TESSELLATOR_PARTITIONING_POW2 = D3D_TESSELLATOR_PARTITIONING_POW2, + D3D11_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD = D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD, + D3D11_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN = D3D_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN + } D3D_TESSELLATOR_PARTITIONING; + +typedef +enum D3D_TESSELLATOR_OUTPUT_PRIMITIVE + { + D3D_TESSELLATOR_OUTPUT_UNDEFINED = 0, + D3D_TESSELLATOR_OUTPUT_POINT = 1, + D3D_TESSELLATOR_OUTPUT_LINE = 2, + D3D_TESSELLATOR_OUTPUT_TRIANGLE_CW = 3, + D3D_TESSELLATOR_OUTPUT_TRIANGLE_CCW = 4, + D3D11_TESSELLATOR_OUTPUT_UNDEFINED = D3D_TESSELLATOR_OUTPUT_UNDEFINED, + D3D11_TESSELLATOR_OUTPUT_POINT = D3D_TESSELLATOR_OUTPUT_POINT, + D3D11_TESSELLATOR_OUTPUT_LINE = D3D_TESSELLATOR_OUTPUT_LINE, + D3D11_TESSELLATOR_OUTPUT_TRIANGLE_CW = D3D_TESSELLATOR_OUTPUT_TRIANGLE_CW, + D3D11_TESSELLATOR_OUTPUT_TRIANGLE_CCW = D3D_TESSELLATOR_OUTPUT_TRIANGLE_CCW + } D3D_TESSELLATOR_OUTPUT_PRIMITIVE; + +typedef +enum D3D_MIN_PRECISION + { + D3D_MIN_PRECISION_DEFAULT = 0, + D3D_MIN_PRECISION_FLOAT_16 = 1, + D3D_MIN_PRECISION_FLOAT_2_8 = 2, + D3D_MIN_PRECISION_RESERVED = 3, + D3D_MIN_PRECISION_SINT_16 = 4, + D3D_MIN_PRECISION_UINT_16 = 5, + D3D_MIN_PRECISION_ANY_16 = 0xf0, + D3D_MIN_PRECISION_ANY_10 = 0xf1 + } D3D_MIN_PRECISION; + +typedef +enum D3D_INTERPOLATION_MODE + { + D3D_INTERPOLATION_UNDEFINED = 0, + D3D_INTERPOLATION_CONSTANT = 1, + D3D_INTERPOLATION_LINEAR = 2, + D3D_INTERPOLATION_LINEAR_CENTROID = 3, + D3D_INTERPOLATION_LINEAR_NOPERSPECTIVE = 4, + D3D_INTERPOLATION_LINEAR_NOPERSPECTIVE_CENTROID = 5, + D3D_INTERPOLATION_LINEAR_SAMPLE = 6, + D3D_INTERPOLATION_LINEAR_NOPERSPECTIVE_SAMPLE = 7 + } D3D_INTERPOLATION_MODE; + +typedef +enum _D3D_PARAMETER_FLAGS + { + D3D_PF_NONE = 0, + D3D_PF_IN = 0x1, + D3D_PF_OUT = 0x2, + D3D_PF_FORCE_DWORD = 0x7fffffff + } D3D_PARAMETER_FLAGS; + +typedef +enum D3D_FORMAT_LAYOUT + { + D3DFL_STANDARD = 0, + D3DFL_CUSTOM = -1 + } D3D_FORMAT_LAYOUT; + +typedef +enum D3D_FORMAT_TYPE_LEVEL + { + D3DFTL_NO_TYPE = 0, + D3DFTL_PARTIAL_TYPE = -2, + D3DFTL_FULL_TYPE = -1 + } D3D_FORMAT_TYPE_LEVEL; + +typedef +enum D3D_FORMAT_COMPONENT_NAME + { + D3DFCN_R = -4, + D3DFCN_G = -3, + D3DFCN_B = -2, + D3DFCN_A = -1, + D3DFCN_D = 0, + D3DFCN_S = 1, + D3DFCN_X = 2 + } D3D_FORMAT_COMPONENT_NAME; + +typedef +enum D3D_FORMAT_COMPONENT_INTERPRETATION + { + D3DFCI_TYPELESS = 0, + D3DFCI_FLOAT = -4, + D3DFCI_SNORM = -3, + D3DFCI_UNORM = -2, + D3DFCI_SINT = -1, + D3DFCI_UINT = 1, + D3DFCI_UNORM_SRGB = 2, + D3DFCI_BIASED_FIXED_2_8 = 3 + } D3D_FORMAT_COMPONENT_INTERPRETATION; + +DEFINE_GUID(WKPDID_D3DDebugObjectName,0x429b8c22,0x9188,0x4b0c,0x87,0x42,0xac,0xb0,0xbf,0x85,0xc2,0x00); +DEFINE_GUID(WKPDID_D3DDebugObjectNameW,0x4cca5fd8,0x921f,0x42c8,0x85,0x66,0x70,0xca,0xf2,0xa9,0xb7,0x41); +DEFINE_GUID(WKPDID_CommentStringW,0xd0149dc0,0x90e8,0x4ec8,0x81, 0x44, 0xe9, 0x00, 0xad, 0x26, 0x6b, 0xb2); +DEFINE_GUID(WKPDID_D3D12UniqueObjectId, 0x1b39de15, 0xec04, 0x4bae, 0xba, 0x4d, 0x8c, 0xef, 0x79, 0xfc, 0x04, 0xc1); +#define D3D_SET_OBJECT_NAME_N_A(pObject, Chars, pName) (pObject)->SetPrivateData(WKPDID_D3DDebugObjectName, Chars, pName) +#define D3D_SET_OBJECT_NAME_A(pObject, pName) D3D_SET_OBJECT_NAME_N_A(pObject, lstrlenA(pName), pName) +#define D3D_SET_OBJECT_NAME_N_W(pObject, Chars, pName) (pObject)->SetPrivateData(WKPDID_D3DDebugObjectNameW, Chars*2, pName) +#define D3D_SET_OBJECT_NAME_W(pObject, pName) D3D_SET_OBJECT_NAME_N_W(pObject, wcslen(pName), pName) +#define D3D_COMPONENT_MASK_X 1 +#define D3D_COMPONENT_MASK_Y 2 +#define D3D_COMPONENT_MASK_Z 4 +#define D3D_COMPONENT_MASK_W 8 +DEFINE_GUID(D3D_TEXTURE_LAYOUT_ROW_MAJOR,0xb5dc234f,0x72bb,0x4bec,0x97,0x05,0x8c,0xf2,0x58,0xdf,0x6b,0x6c); +DEFINE_GUID(D3D_TEXTURE_LAYOUT_64KB_STANDARD_SWIZZLE,0x4c0f29e3,0x3f5f,0x4d35,0x84,0xc9,0xbc,0x09,0x83,0xb6,0x2c,0x28); + + +extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0002_v0_0_c_ifspec; +extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0002_v0_0_s_ifspec; + +/* Additional Prototypes for ALL interfaces */ + +/* end of Additional Prototypes */ + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/thirdparty/directx_headers/d3dx12.h b/thirdparty/directx_headers/d3dx12.h new file mode 100644 index 0000000000..bbe273d333 --- /dev/null +++ b/thirdparty/directx_headers/d3dx12.h @@ -0,0 +1,5459 @@ +//********************************************************* +// +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License (MIT). +// +//********************************************************* + +#ifndef __D3DX12_H__ +#define __D3DX12_H__ + +#include "d3d12.h" + +#if defined( __cplusplus ) + +struct CD3DX12_DEFAULT {}; +extern const DECLSPEC_SELECTANY CD3DX12_DEFAULT D3D12_DEFAULT; + +//------------------------------------------------------------------------------------------------ +inline bool operator==( const D3D12_VIEWPORT& l, const D3D12_VIEWPORT& r ) noexcept +{ + return l.TopLeftX == r.TopLeftX && l.TopLeftY == r.TopLeftY && l.Width == r.Width && + l.Height == r.Height && l.MinDepth == r.MinDepth && l.MaxDepth == r.MaxDepth; +} + +//------------------------------------------------------------------------------------------------ +inline bool operator!=( const D3D12_VIEWPORT& l, const D3D12_VIEWPORT& r ) noexcept +{ return !( l == r ); } + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_RECT : public D3D12_RECT +{ + CD3DX12_RECT() = default; + explicit CD3DX12_RECT( const D3D12_RECT& o ) noexcept : + D3D12_RECT( o ) + {} + explicit CD3DX12_RECT( + LONG Left, + LONG Top, + LONG Right, + LONG Bottom ) noexcept + { + left = Left; + top = Top; + right = Right; + bottom = Bottom; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_VIEWPORT : public D3D12_VIEWPORT +{ + CD3DX12_VIEWPORT() = default; + explicit CD3DX12_VIEWPORT( const D3D12_VIEWPORT& o ) noexcept : + D3D12_VIEWPORT( o ) + {} + explicit CD3DX12_VIEWPORT( + FLOAT topLeftX, + FLOAT topLeftY, + FLOAT width, + FLOAT height, + FLOAT minDepth = D3D12_MIN_DEPTH, + FLOAT maxDepth = D3D12_MAX_DEPTH ) noexcept + { + TopLeftX = topLeftX; + TopLeftY = topLeftY; + Width = width; + Height = height; + MinDepth = minDepth; + MaxDepth = maxDepth; + } + explicit CD3DX12_VIEWPORT( + _In_ ID3D12Resource* pResource, + UINT mipSlice = 0, + FLOAT topLeftX = 0.0f, + FLOAT topLeftY = 0.0f, + FLOAT minDepth = D3D12_MIN_DEPTH, + FLOAT maxDepth = D3D12_MAX_DEPTH ) noexcept + { + const auto Desc = pResource->GetDesc(); + const UINT64 SubresourceWidth = Desc.Width >> mipSlice; + const UINT64 SubresourceHeight = Desc.Height >> mipSlice; + switch (Desc.Dimension) + { + case D3D12_RESOURCE_DIMENSION_BUFFER: + TopLeftX = topLeftX; + TopLeftY = 0.0f; + Width = float(Desc.Width) - topLeftX; + Height = 1.0f; + break; + case D3D12_RESOURCE_DIMENSION_TEXTURE1D: + TopLeftX = topLeftX; + TopLeftY = 0.0f; + Width = (SubresourceWidth ? float(SubresourceWidth) : 1.0f) - topLeftX; + Height = 1.0f; + break; + case D3D12_RESOURCE_DIMENSION_TEXTURE2D: + case D3D12_RESOURCE_DIMENSION_TEXTURE3D: + TopLeftX = topLeftX; + TopLeftY = topLeftY; + Width = (SubresourceWidth ? float(SubresourceWidth) : 1.0f) - topLeftX; + Height = (SubresourceHeight ? float(SubresourceHeight) : 1.0f) - topLeftY; + break; + default: break; + } + + MinDepth = minDepth; + MaxDepth = maxDepth; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_BOX : public D3D12_BOX +{ + CD3DX12_BOX() = default; + explicit CD3DX12_BOX( const D3D12_BOX& o ) noexcept : + D3D12_BOX( o ) + {} + explicit CD3DX12_BOX( + LONG Left, + LONG Right ) noexcept + { + left = static_cast<UINT>(Left); + top = 0; + front = 0; + right = static_cast<UINT>(Right); + bottom = 1; + back = 1; + } + explicit CD3DX12_BOX( + LONG Left, + LONG Top, + LONG Right, + LONG Bottom ) noexcept + { + left = static_cast<UINT>(Left); + top = static_cast<UINT>(Top); + front = 0; + right = static_cast<UINT>(Right); + bottom = static_cast<UINT>(Bottom); + back = 1; + } + explicit CD3DX12_BOX( + LONG Left, + LONG Top, + LONG Front, + LONG Right, + LONG Bottom, + LONG Back ) noexcept + { + left = static_cast<UINT>(Left); + top = static_cast<UINT>(Top); + front = static_cast<UINT>(Front); + right = static_cast<UINT>(Right); + bottom = static_cast<UINT>(Bottom); + back = static_cast<UINT>(Back); + } +}; +inline bool operator==( const D3D12_BOX& l, const D3D12_BOX& r ) noexcept +{ + return l.left == r.left && l.top == r.top && l.front == r.front && + l.right == r.right && l.bottom == r.bottom && l.back == r.back; +} +inline bool operator!=( const D3D12_BOX& l, const D3D12_BOX& r ) noexcept +{ return !( l == r ); } + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_DEPTH_STENCIL_DESC : public D3D12_DEPTH_STENCIL_DESC +{ + CD3DX12_DEPTH_STENCIL_DESC() = default; + explicit CD3DX12_DEPTH_STENCIL_DESC( const D3D12_DEPTH_STENCIL_DESC& o ) noexcept : + D3D12_DEPTH_STENCIL_DESC( o ) + {} + explicit CD3DX12_DEPTH_STENCIL_DESC( CD3DX12_DEFAULT ) noexcept + { + DepthEnable = TRUE; + DepthWriteMask = D3D12_DEPTH_WRITE_MASK_ALL; + DepthFunc = D3D12_COMPARISON_FUNC_LESS; + StencilEnable = FALSE; + StencilReadMask = D3D12_DEFAULT_STENCIL_READ_MASK; + StencilWriteMask = D3D12_DEFAULT_STENCIL_WRITE_MASK; + const D3D12_DEPTH_STENCILOP_DESC defaultStencilOp = + { D3D12_STENCIL_OP_KEEP, D3D12_STENCIL_OP_KEEP, D3D12_STENCIL_OP_KEEP, D3D12_COMPARISON_FUNC_ALWAYS }; + FrontFace = defaultStencilOp; + BackFace = defaultStencilOp; + } + explicit CD3DX12_DEPTH_STENCIL_DESC( + BOOL depthEnable, + D3D12_DEPTH_WRITE_MASK depthWriteMask, + D3D12_COMPARISON_FUNC depthFunc, + BOOL stencilEnable, + UINT8 stencilReadMask, + UINT8 stencilWriteMask, + D3D12_STENCIL_OP frontStencilFailOp, + D3D12_STENCIL_OP frontStencilDepthFailOp, + D3D12_STENCIL_OP frontStencilPassOp, + D3D12_COMPARISON_FUNC frontStencilFunc, + D3D12_STENCIL_OP backStencilFailOp, + D3D12_STENCIL_OP backStencilDepthFailOp, + D3D12_STENCIL_OP backStencilPassOp, + D3D12_COMPARISON_FUNC backStencilFunc ) noexcept + { + DepthEnable = depthEnable; + DepthWriteMask = depthWriteMask; + DepthFunc = depthFunc; + StencilEnable = stencilEnable; + StencilReadMask = stencilReadMask; + StencilWriteMask = stencilWriteMask; + FrontFace.StencilFailOp = frontStencilFailOp; + FrontFace.StencilDepthFailOp = frontStencilDepthFailOp; + FrontFace.StencilPassOp = frontStencilPassOp; + FrontFace.StencilFunc = frontStencilFunc; + BackFace.StencilFailOp = backStencilFailOp; + BackFace.StencilDepthFailOp = backStencilDepthFailOp; + BackFace.StencilPassOp = backStencilPassOp; + BackFace.StencilFunc = backStencilFunc; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_DEPTH_STENCIL_DESC1 : public D3D12_DEPTH_STENCIL_DESC1 +{ + CD3DX12_DEPTH_STENCIL_DESC1() = default; + explicit CD3DX12_DEPTH_STENCIL_DESC1( const D3D12_DEPTH_STENCIL_DESC1& o ) noexcept : + D3D12_DEPTH_STENCIL_DESC1( o ) + {} + explicit CD3DX12_DEPTH_STENCIL_DESC1( const D3D12_DEPTH_STENCIL_DESC& o ) noexcept + { + DepthEnable = o.DepthEnable; + DepthWriteMask = o.DepthWriteMask; + DepthFunc = o.DepthFunc; + StencilEnable = o.StencilEnable; + StencilReadMask = o.StencilReadMask; + StencilWriteMask = o.StencilWriteMask; + FrontFace.StencilFailOp = o.FrontFace.StencilFailOp; + FrontFace.StencilDepthFailOp = o.FrontFace.StencilDepthFailOp; + FrontFace.StencilPassOp = o.FrontFace.StencilPassOp; + FrontFace.StencilFunc = o.FrontFace.StencilFunc; + BackFace.StencilFailOp = o.BackFace.StencilFailOp; + BackFace.StencilDepthFailOp = o.BackFace.StencilDepthFailOp; + BackFace.StencilPassOp = o.BackFace.StencilPassOp; + BackFace.StencilFunc = o.BackFace.StencilFunc; + DepthBoundsTestEnable = FALSE; + } + explicit CD3DX12_DEPTH_STENCIL_DESC1( CD3DX12_DEFAULT ) noexcept + { + DepthEnable = TRUE; + DepthWriteMask = D3D12_DEPTH_WRITE_MASK_ALL; + DepthFunc = D3D12_COMPARISON_FUNC_LESS; + StencilEnable = FALSE; + StencilReadMask = D3D12_DEFAULT_STENCIL_READ_MASK; + StencilWriteMask = D3D12_DEFAULT_STENCIL_WRITE_MASK; + const D3D12_DEPTH_STENCILOP_DESC defaultStencilOp = + { D3D12_STENCIL_OP_KEEP, D3D12_STENCIL_OP_KEEP, D3D12_STENCIL_OP_KEEP, D3D12_COMPARISON_FUNC_ALWAYS }; + FrontFace = defaultStencilOp; + BackFace = defaultStencilOp; + DepthBoundsTestEnable = FALSE; + } + explicit CD3DX12_DEPTH_STENCIL_DESC1( + BOOL depthEnable, + D3D12_DEPTH_WRITE_MASK depthWriteMask, + D3D12_COMPARISON_FUNC depthFunc, + BOOL stencilEnable, + UINT8 stencilReadMask, + UINT8 stencilWriteMask, + D3D12_STENCIL_OP frontStencilFailOp, + D3D12_STENCIL_OP frontStencilDepthFailOp, + D3D12_STENCIL_OP frontStencilPassOp, + D3D12_COMPARISON_FUNC frontStencilFunc, + D3D12_STENCIL_OP backStencilFailOp, + D3D12_STENCIL_OP backStencilDepthFailOp, + D3D12_STENCIL_OP backStencilPassOp, + D3D12_COMPARISON_FUNC backStencilFunc, + BOOL depthBoundsTestEnable ) noexcept + { + DepthEnable = depthEnable; + DepthWriteMask = depthWriteMask; + DepthFunc = depthFunc; + StencilEnable = stencilEnable; + StencilReadMask = stencilReadMask; + StencilWriteMask = stencilWriteMask; + FrontFace.StencilFailOp = frontStencilFailOp; + FrontFace.StencilDepthFailOp = frontStencilDepthFailOp; + FrontFace.StencilPassOp = frontStencilPassOp; + FrontFace.StencilFunc = frontStencilFunc; + BackFace.StencilFailOp = backStencilFailOp; + BackFace.StencilDepthFailOp = backStencilDepthFailOp; + BackFace.StencilPassOp = backStencilPassOp; + BackFace.StencilFunc = backStencilFunc; + DepthBoundsTestEnable = depthBoundsTestEnable; + } + operator D3D12_DEPTH_STENCIL_DESC() const noexcept + { + D3D12_DEPTH_STENCIL_DESC D; + D.DepthEnable = DepthEnable; + D.DepthWriteMask = DepthWriteMask; + D.DepthFunc = DepthFunc; + D.StencilEnable = StencilEnable; + D.StencilReadMask = StencilReadMask; + D.StencilWriteMask = StencilWriteMask; + D.FrontFace.StencilFailOp = FrontFace.StencilFailOp; + D.FrontFace.StencilDepthFailOp = FrontFace.StencilDepthFailOp; + D.FrontFace.StencilPassOp = FrontFace.StencilPassOp; + D.FrontFace.StencilFunc = FrontFace.StencilFunc; + D.BackFace.StencilFailOp = BackFace.StencilFailOp; + D.BackFace.StencilDepthFailOp = BackFace.StencilDepthFailOp; + D.BackFace.StencilPassOp = BackFace.StencilPassOp; + D.BackFace.StencilFunc = BackFace.StencilFunc; + return D; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_DEPTH_STENCIL_DESC2 : public D3D12_DEPTH_STENCIL_DESC2 +{ + CD3DX12_DEPTH_STENCIL_DESC2() = default; + explicit CD3DX12_DEPTH_STENCIL_DESC2( const D3D12_DEPTH_STENCIL_DESC2& o ) noexcept : + D3D12_DEPTH_STENCIL_DESC2( o ) + {} + explicit CD3DX12_DEPTH_STENCIL_DESC2( const D3D12_DEPTH_STENCIL_DESC1& o ) noexcept + { + DepthEnable = o.DepthEnable; + DepthWriteMask = o.DepthWriteMask; + DepthFunc = o.DepthFunc; + StencilEnable = o.StencilEnable; + FrontFace.StencilFailOp = o.FrontFace.StencilFailOp; + FrontFace.StencilDepthFailOp = o.FrontFace.StencilDepthFailOp; + FrontFace.StencilPassOp = o.FrontFace.StencilPassOp; + FrontFace.StencilFunc = o.FrontFace.StencilFunc; + FrontFace.StencilReadMask = o.StencilReadMask; + FrontFace.StencilWriteMask = o.StencilWriteMask; + + BackFace.StencilFailOp = o.BackFace.StencilFailOp; + BackFace.StencilDepthFailOp = o.BackFace.StencilDepthFailOp; + BackFace.StencilPassOp = o.BackFace.StencilPassOp; + BackFace.StencilFunc = o.BackFace.StencilFunc; + BackFace.StencilReadMask = o.StencilReadMask; + BackFace.StencilWriteMask = o.StencilWriteMask; + DepthBoundsTestEnable = o.DepthBoundsTestEnable; + } + explicit CD3DX12_DEPTH_STENCIL_DESC2( const D3D12_DEPTH_STENCIL_DESC& o ) noexcept + { + DepthEnable = o.DepthEnable; + DepthWriteMask = o.DepthWriteMask; + DepthFunc = o.DepthFunc; + StencilEnable = o.StencilEnable; + + FrontFace.StencilFailOp = o.FrontFace.StencilFailOp; + FrontFace.StencilDepthFailOp = o.FrontFace.StencilDepthFailOp; + FrontFace.StencilPassOp = o.FrontFace.StencilPassOp; + FrontFace.StencilFunc = o.FrontFace.StencilFunc; + FrontFace.StencilReadMask = o.StencilReadMask; + FrontFace.StencilWriteMask = o.StencilWriteMask; + + BackFace.StencilFailOp = o.BackFace.StencilFailOp; + BackFace.StencilDepthFailOp = o.BackFace.StencilDepthFailOp; + BackFace.StencilPassOp = o.BackFace.StencilPassOp; + BackFace.StencilFunc = o.BackFace.StencilFunc; + BackFace.StencilReadMask = o.StencilReadMask; + BackFace.StencilWriteMask = o.StencilWriteMask; + + DepthBoundsTestEnable = FALSE; + } + explicit CD3DX12_DEPTH_STENCIL_DESC2( CD3DX12_DEFAULT ) noexcept + { + DepthEnable = TRUE; + DepthWriteMask = D3D12_DEPTH_WRITE_MASK_ALL; + DepthFunc = D3D12_COMPARISON_FUNC_LESS; + StencilEnable = FALSE; + const D3D12_DEPTH_STENCILOP_DESC1 defaultStencilOp = + { D3D12_STENCIL_OP_KEEP, D3D12_STENCIL_OP_KEEP, D3D12_STENCIL_OP_KEEP, D3D12_COMPARISON_FUNC_ALWAYS, D3D12_DEFAULT_STENCIL_READ_MASK, D3D12_DEFAULT_STENCIL_WRITE_MASK }; + FrontFace = defaultStencilOp; + BackFace = defaultStencilOp; + DepthBoundsTestEnable = FALSE; + } + explicit CD3DX12_DEPTH_STENCIL_DESC2( + BOOL depthEnable, + D3D12_DEPTH_WRITE_MASK depthWriteMask, + D3D12_COMPARISON_FUNC depthFunc, + BOOL stencilEnable, + D3D12_STENCIL_OP frontStencilFailOp, + D3D12_STENCIL_OP frontStencilDepthFailOp, + D3D12_STENCIL_OP frontStencilPassOp, + D3D12_COMPARISON_FUNC frontStencilFunc, + UINT8 frontStencilReadMask, + UINT8 frontStencilWriteMask, + D3D12_STENCIL_OP backStencilFailOp, + D3D12_STENCIL_OP backStencilDepthFailOp, + D3D12_STENCIL_OP backStencilPassOp, + D3D12_COMPARISON_FUNC backStencilFunc, + UINT8 backStencilReadMask, + UINT8 backStencilWriteMask, + BOOL depthBoundsTestEnable ) noexcept + { + DepthEnable = depthEnable; + DepthWriteMask = depthWriteMask; + DepthFunc = depthFunc; + StencilEnable = stencilEnable; + + FrontFace.StencilFailOp = frontStencilFailOp; + FrontFace.StencilDepthFailOp = frontStencilDepthFailOp; + FrontFace.StencilPassOp = frontStencilPassOp; + FrontFace.StencilFunc = frontStencilFunc; + FrontFace.StencilReadMask = frontStencilReadMask; + FrontFace.StencilWriteMask = frontStencilWriteMask; + + BackFace.StencilFailOp = backStencilFailOp; + BackFace.StencilDepthFailOp = backStencilDepthFailOp; + BackFace.StencilPassOp = backStencilPassOp; + BackFace.StencilFunc = backStencilFunc; + BackFace.StencilReadMask = backStencilReadMask; + BackFace.StencilWriteMask = backStencilWriteMask; + + DepthBoundsTestEnable = depthBoundsTestEnable; + } + + operator D3D12_DEPTH_STENCIL_DESC() const noexcept + { + D3D12_DEPTH_STENCIL_DESC D; + D.DepthEnable = DepthEnable; + D.DepthWriteMask = DepthWriteMask; + D.DepthFunc = DepthFunc; + D.StencilEnable = StencilEnable; + D.StencilReadMask = FrontFace.StencilReadMask; + D.StencilWriteMask = FrontFace.StencilWriteMask; + D.FrontFace.StencilFailOp = FrontFace.StencilFailOp; + D.FrontFace.StencilDepthFailOp = FrontFace.StencilDepthFailOp; + D.FrontFace.StencilPassOp = FrontFace.StencilPassOp; + D.FrontFace.StencilFunc = FrontFace.StencilFunc; + D.BackFace.StencilFailOp = BackFace.StencilFailOp; + D.BackFace.StencilDepthFailOp = BackFace.StencilDepthFailOp; + D.BackFace.StencilPassOp = BackFace.StencilPassOp; + D.BackFace.StencilFunc = BackFace.StencilFunc; + return D; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_BLEND_DESC : public D3D12_BLEND_DESC +{ + CD3DX12_BLEND_DESC() = default; + explicit CD3DX12_BLEND_DESC( const D3D12_BLEND_DESC& o ) noexcept : + D3D12_BLEND_DESC( o ) + {} + explicit CD3DX12_BLEND_DESC( CD3DX12_DEFAULT ) noexcept + { + AlphaToCoverageEnable = FALSE; + IndependentBlendEnable = FALSE; + const D3D12_RENDER_TARGET_BLEND_DESC defaultRenderTargetBlendDesc = + { + FALSE,FALSE, + D3D12_BLEND_ONE, D3D12_BLEND_ZERO, D3D12_BLEND_OP_ADD, + D3D12_BLEND_ONE, D3D12_BLEND_ZERO, D3D12_BLEND_OP_ADD, + D3D12_LOGIC_OP_NOOP, + D3D12_COLOR_WRITE_ENABLE_ALL, + }; + for (UINT i = 0; i < D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT; ++i) + RenderTarget[ i ] = defaultRenderTargetBlendDesc; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_RASTERIZER_DESC : public D3D12_RASTERIZER_DESC +{ + CD3DX12_RASTERIZER_DESC() = default; + explicit CD3DX12_RASTERIZER_DESC( const D3D12_RASTERIZER_DESC& o ) noexcept : + D3D12_RASTERIZER_DESC( o ) + {} + explicit CD3DX12_RASTERIZER_DESC( CD3DX12_DEFAULT ) noexcept + { + FillMode = D3D12_FILL_MODE_SOLID; + CullMode = D3D12_CULL_MODE_BACK; + FrontCounterClockwise = FALSE; + DepthBias = D3D12_DEFAULT_DEPTH_BIAS; + DepthBiasClamp = D3D12_DEFAULT_DEPTH_BIAS_CLAMP; + SlopeScaledDepthBias = D3D12_DEFAULT_SLOPE_SCALED_DEPTH_BIAS; + DepthClipEnable = TRUE; + MultisampleEnable = FALSE; + AntialiasedLineEnable = FALSE; + ForcedSampleCount = 0; + ConservativeRaster = D3D12_CONSERVATIVE_RASTERIZATION_MODE_OFF; + } + explicit CD3DX12_RASTERIZER_DESC( + D3D12_FILL_MODE fillMode, + D3D12_CULL_MODE cullMode, + BOOL frontCounterClockwise, + INT depthBias, + FLOAT depthBiasClamp, + FLOAT slopeScaledDepthBias, + BOOL depthClipEnable, + BOOL multisampleEnable, + BOOL antialiasedLineEnable, + UINT forcedSampleCount, + D3D12_CONSERVATIVE_RASTERIZATION_MODE conservativeRaster) noexcept + { + FillMode = fillMode; + CullMode = cullMode; + FrontCounterClockwise = frontCounterClockwise; + DepthBias = depthBias; + DepthBiasClamp = depthBiasClamp; + SlopeScaledDepthBias = slopeScaledDepthBias; + DepthClipEnable = depthClipEnable; + MultisampleEnable = multisampleEnable; + AntialiasedLineEnable = antialiasedLineEnable; + ForcedSampleCount = forcedSampleCount; + ConservativeRaster = conservativeRaster; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_RESOURCE_ALLOCATION_INFO : public D3D12_RESOURCE_ALLOCATION_INFO +{ + CD3DX12_RESOURCE_ALLOCATION_INFO() = default; + explicit CD3DX12_RESOURCE_ALLOCATION_INFO( const D3D12_RESOURCE_ALLOCATION_INFO& o ) noexcept : + D3D12_RESOURCE_ALLOCATION_INFO( o ) + {} + CD3DX12_RESOURCE_ALLOCATION_INFO( + UINT64 size, + UINT64 alignment ) noexcept + { + SizeInBytes = size; + Alignment = alignment; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_HEAP_PROPERTIES : public D3D12_HEAP_PROPERTIES +{ + CD3DX12_HEAP_PROPERTIES() = default; + explicit CD3DX12_HEAP_PROPERTIES(const D3D12_HEAP_PROPERTIES &o) noexcept : + D3D12_HEAP_PROPERTIES(o) + {} + CD3DX12_HEAP_PROPERTIES( + D3D12_CPU_PAGE_PROPERTY cpuPageProperty, + D3D12_MEMORY_POOL memoryPoolPreference, + UINT creationNodeMask = 1, + UINT nodeMask = 1 ) noexcept + { + Type = D3D12_HEAP_TYPE_CUSTOM; + CPUPageProperty = cpuPageProperty; + MemoryPoolPreference = memoryPoolPreference; + CreationNodeMask = creationNodeMask; + VisibleNodeMask = nodeMask; + } + explicit CD3DX12_HEAP_PROPERTIES( + D3D12_HEAP_TYPE type, + UINT creationNodeMask = 1, + UINT nodeMask = 1 ) noexcept + { + Type = type; + CPUPageProperty = D3D12_CPU_PAGE_PROPERTY_UNKNOWN; + MemoryPoolPreference = D3D12_MEMORY_POOL_UNKNOWN; + CreationNodeMask = creationNodeMask; + VisibleNodeMask = nodeMask; + } + bool IsCPUAccessible() const noexcept + { + return Type == D3D12_HEAP_TYPE_UPLOAD || Type == D3D12_HEAP_TYPE_READBACK || (Type == D3D12_HEAP_TYPE_CUSTOM && + (CPUPageProperty == D3D12_CPU_PAGE_PROPERTY_WRITE_COMBINE || CPUPageProperty == D3D12_CPU_PAGE_PROPERTY_WRITE_BACK)); + } +}; +inline bool operator==( const D3D12_HEAP_PROPERTIES& l, const D3D12_HEAP_PROPERTIES& r ) noexcept +{ + return l.Type == r.Type && l.CPUPageProperty == r.CPUPageProperty && + l.MemoryPoolPreference == r.MemoryPoolPreference && + l.CreationNodeMask == r.CreationNodeMask && + l.VisibleNodeMask == r.VisibleNodeMask; +} +inline bool operator!=( const D3D12_HEAP_PROPERTIES& l, const D3D12_HEAP_PROPERTIES& r ) noexcept +{ return !( l == r ); } + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_HEAP_DESC : public D3D12_HEAP_DESC +{ + CD3DX12_HEAP_DESC() = default; + explicit CD3DX12_HEAP_DESC(const D3D12_HEAP_DESC &o) noexcept : + D3D12_HEAP_DESC(o) + {} + CD3DX12_HEAP_DESC( + UINT64 size, + D3D12_HEAP_PROPERTIES properties, + UINT64 alignment = 0, + D3D12_HEAP_FLAGS flags = D3D12_HEAP_FLAG_NONE ) noexcept + { + SizeInBytes = size; + Properties = properties; + Alignment = alignment; + Flags = flags; + } + CD3DX12_HEAP_DESC( + UINT64 size, + D3D12_HEAP_TYPE type, + UINT64 alignment = 0, + D3D12_HEAP_FLAGS flags = D3D12_HEAP_FLAG_NONE ) noexcept + { + SizeInBytes = size; + Properties = CD3DX12_HEAP_PROPERTIES( type ); + Alignment = alignment; + Flags = flags; + } + CD3DX12_HEAP_DESC( + UINT64 size, + D3D12_CPU_PAGE_PROPERTY cpuPageProperty, + D3D12_MEMORY_POOL memoryPoolPreference, + UINT64 alignment = 0, + D3D12_HEAP_FLAGS flags = D3D12_HEAP_FLAG_NONE ) noexcept + { + SizeInBytes = size; + Properties = CD3DX12_HEAP_PROPERTIES( cpuPageProperty, memoryPoolPreference ); + Alignment = alignment; + Flags = flags; + } + CD3DX12_HEAP_DESC( + const D3D12_RESOURCE_ALLOCATION_INFO& resAllocInfo, + D3D12_HEAP_PROPERTIES properties, + D3D12_HEAP_FLAGS flags = D3D12_HEAP_FLAG_NONE ) noexcept + { + SizeInBytes = resAllocInfo.SizeInBytes; + Properties = properties; + Alignment = resAllocInfo.Alignment; + Flags = flags; + } + CD3DX12_HEAP_DESC( + const D3D12_RESOURCE_ALLOCATION_INFO& resAllocInfo, + D3D12_HEAP_TYPE type, + D3D12_HEAP_FLAGS flags = D3D12_HEAP_FLAG_NONE ) noexcept + { + SizeInBytes = resAllocInfo.SizeInBytes; + Properties = CD3DX12_HEAP_PROPERTIES( type ); + Alignment = resAllocInfo.Alignment; + Flags = flags; + } + CD3DX12_HEAP_DESC( + const D3D12_RESOURCE_ALLOCATION_INFO& resAllocInfo, + D3D12_CPU_PAGE_PROPERTY cpuPageProperty, + D3D12_MEMORY_POOL memoryPoolPreference, + D3D12_HEAP_FLAGS flags = D3D12_HEAP_FLAG_NONE ) noexcept + { + SizeInBytes = resAllocInfo.SizeInBytes; + Properties = CD3DX12_HEAP_PROPERTIES( cpuPageProperty, memoryPoolPreference ); + Alignment = resAllocInfo.Alignment; + Flags = flags; + } + bool IsCPUAccessible() const noexcept + { return static_cast< const CD3DX12_HEAP_PROPERTIES* >( &Properties )->IsCPUAccessible(); } +}; +inline bool operator==( const D3D12_HEAP_DESC& l, const D3D12_HEAP_DESC& r ) noexcept +{ + return l.SizeInBytes == r.SizeInBytes && + l.Properties == r.Properties && + l.Alignment == r.Alignment && + l.Flags == r.Flags; +} +inline bool operator!=( const D3D12_HEAP_DESC& l, const D3D12_HEAP_DESC& r ) noexcept +{ return !( l == r ); } + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_CLEAR_VALUE : public D3D12_CLEAR_VALUE +{ + CD3DX12_CLEAR_VALUE() = default; + explicit CD3DX12_CLEAR_VALUE(const D3D12_CLEAR_VALUE &o) noexcept : + D3D12_CLEAR_VALUE(o) + {} + CD3DX12_CLEAR_VALUE( + DXGI_FORMAT format, + const FLOAT color[4] ) noexcept + { + Format = format; + memcpy( Color, color, sizeof( Color ) ); + } + CD3DX12_CLEAR_VALUE( + DXGI_FORMAT format, + FLOAT depth, + UINT8 stencil ) noexcept + { + Format = format; + memset( &Color, 0, sizeof( Color ) ); + /* Use memcpy to preserve NAN values */ + memcpy( &DepthStencil.Depth, &depth, sizeof( depth ) ); + DepthStencil.Stencil = stencil; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_RANGE : public D3D12_RANGE +{ + CD3DX12_RANGE() = default; + explicit CD3DX12_RANGE(const D3D12_RANGE &o) noexcept : + D3D12_RANGE(o) + {} + CD3DX12_RANGE( + SIZE_T begin, + SIZE_T end ) noexcept + { + Begin = begin; + End = end; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_RANGE_UINT64 : public D3D12_RANGE_UINT64 +{ + CD3DX12_RANGE_UINT64() = default; + explicit CD3DX12_RANGE_UINT64(const D3D12_RANGE_UINT64 &o) noexcept : + D3D12_RANGE_UINT64(o) + {} + CD3DX12_RANGE_UINT64( + UINT64 begin, + UINT64 end ) noexcept + { + Begin = begin; + End = end; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_SUBRESOURCE_RANGE_UINT64 : public D3D12_SUBRESOURCE_RANGE_UINT64 +{ + CD3DX12_SUBRESOURCE_RANGE_UINT64() = default; + explicit CD3DX12_SUBRESOURCE_RANGE_UINT64(const D3D12_SUBRESOURCE_RANGE_UINT64 &o) noexcept : + D3D12_SUBRESOURCE_RANGE_UINT64(o) + {} + CD3DX12_SUBRESOURCE_RANGE_UINT64( + UINT subresource, + const D3D12_RANGE_UINT64& range ) noexcept + { + Subresource = subresource; + Range = range; + } + CD3DX12_SUBRESOURCE_RANGE_UINT64( + UINT subresource, + UINT64 begin, + UINT64 end ) noexcept + { + Subresource = subresource; + Range.Begin = begin; + Range.End = end; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_SHADER_BYTECODE : public D3D12_SHADER_BYTECODE +{ + CD3DX12_SHADER_BYTECODE() = default; + explicit CD3DX12_SHADER_BYTECODE(const D3D12_SHADER_BYTECODE &o) noexcept : + D3D12_SHADER_BYTECODE(o) + {} + CD3DX12_SHADER_BYTECODE( + _In_ ID3DBlob* pShaderBlob ) noexcept + { + pShaderBytecode = pShaderBlob->GetBufferPointer(); + BytecodeLength = pShaderBlob->GetBufferSize(); + } + CD3DX12_SHADER_BYTECODE( + const void* _pShaderBytecode, + SIZE_T bytecodeLength ) noexcept + { + pShaderBytecode = _pShaderBytecode; + BytecodeLength = bytecodeLength; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_TILED_RESOURCE_COORDINATE : public D3D12_TILED_RESOURCE_COORDINATE +{ + CD3DX12_TILED_RESOURCE_COORDINATE() = default; + explicit CD3DX12_TILED_RESOURCE_COORDINATE(const D3D12_TILED_RESOURCE_COORDINATE &o) noexcept : + D3D12_TILED_RESOURCE_COORDINATE(o) + {} + CD3DX12_TILED_RESOURCE_COORDINATE( + UINT x, + UINT y, + UINT z, + UINT subresource ) noexcept + { + X = x; + Y = y; + Z = z; + Subresource = subresource; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_TILE_REGION_SIZE : public D3D12_TILE_REGION_SIZE +{ + CD3DX12_TILE_REGION_SIZE() = default; + explicit CD3DX12_TILE_REGION_SIZE(const D3D12_TILE_REGION_SIZE &o) noexcept : + D3D12_TILE_REGION_SIZE(o) + {} + CD3DX12_TILE_REGION_SIZE( + UINT numTiles, + BOOL useBox, + UINT width, + UINT16 height, + UINT16 depth ) noexcept + { + NumTiles = numTiles; + UseBox = useBox; + Width = width; + Height = height; + Depth = depth; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_SUBRESOURCE_TILING : public D3D12_SUBRESOURCE_TILING +{ + CD3DX12_SUBRESOURCE_TILING() = default; + explicit CD3DX12_SUBRESOURCE_TILING(const D3D12_SUBRESOURCE_TILING &o) noexcept : + D3D12_SUBRESOURCE_TILING(o) + {} + CD3DX12_SUBRESOURCE_TILING( + UINT widthInTiles, + UINT16 heightInTiles, + UINT16 depthInTiles, + UINT startTileIndexInOverallResource ) noexcept + { + WidthInTiles = widthInTiles; + HeightInTiles = heightInTiles; + DepthInTiles = depthInTiles; + StartTileIndexInOverallResource = startTileIndexInOverallResource; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_TILE_SHAPE : public D3D12_TILE_SHAPE +{ + CD3DX12_TILE_SHAPE() = default; + explicit CD3DX12_TILE_SHAPE(const D3D12_TILE_SHAPE &o) noexcept : + D3D12_TILE_SHAPE(o) + {} + CD3DX12_TILE_SHAPE( + UINT widthInTexels, + UINT heightInTexels, + UINT depthInTexels ) noexcept + { + WidthInTexels = widthInTexels; + HeightInTexels = heightInTexels; + DepthInTexels = depthInTexels; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_RESOURCE_BARRIER : public D3D12_RESOURCE_BARRIER +{ + CD3DX12_RESOURCE_BARRIER() = default; + explicit CD3DX12_RESOURCE_BARRIER(const D3D12_RESOURCE_BARRIER &o) noexcept : + D3D12_RESOURCE_BARRIER(o) + {} + static inline CD3DX12_RESOURCE_BARRIER Transition( + _In_ ID3D12Resource* pResource, + D3D12_RESOURCE_STATES stateBefore, + D3D12_RESOURCE_STATES stateAfter, + UINT subresource = D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES, + D3D12_RESOURCE_BARRIER_FLAGS flags = D3D12_RESOURCE_BARRIER_FLAG_NONE) noexcept + { + CD3DX12_RESOURCE_BARRIER result = {}; + D3D12_RESOURCE_BARRIER &barrier = result; + result.Type = D3D12_RESOURCE_BARRIER_TYPE_TRANSITION; + result.Flags = flags; + barrier.Transition.pResource = pResource; + barrier.Transition.StateBefore = stateBefore; + barrier.Transition.StateAfter = stateAfter; + barrier.Transition.Subresource = subresource; + return result; + } + static inline CD3DX12_RESOURCE_BARRIER Aliasing( + _In_ ID3D12Resource* pResourceBefore, + _In_ ID3D12Resource* pResourceAfter) noexcept + { + CD3DX12_RESOURCE_BARRIER result = {}; + D3D12_RESOURCE_BARRIER &barrier = result; + result.Type = D3D12_RESOURCE_BARRIER_TYPE_ALIASING; + barrier.Aliasing.pResourceBefore = pResourceBefore; + barrier.Aliasing.pResourceAfter = pResourceAfter; + return result; + } + static inline CD3DX12_RESOURCE_BARRIER UAV( + _In_ ID3D12Resource* pResource) noexcept + { + CD3DX12_RESOURCE_BARRIER result = {}; + D3D12_RESOURCE_BARRIER &barrier = result; + result.Type = D3D12_RESOURCE_BARRIER_TYPE_UAV; + barrier.UAV.pResource = pResource; + return result; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_PACKED_MIP_INFO : public D3D12_PACKED_MIP_INFO +{ + CD3DX12_PACKED_MIP_INFO() = default; + explicit CD3DX12_PACKED_MIP_INFO(const D3D12_PACKED_MIP_INFO &o) noexcept : + D3D12_PACKED_MIP_INFO(o) + {} + CD3DX12_PACKED_MIP_INFO( + UINT8 numStandardMips, + UINT8 numPackedMips, + UINT numTilesForPackedMips, + UINT startTileIndexInOverallResource ) noexcept + { + NumStandardMips = numStandardMips; + NumPackedMips = numPackedMips; + NumTilesForPackedMips = numTilesForPackedMips; + StartTileIndexInOverallResource = startTileIndexInOverallResource; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_SUBRESOURCE_FOOTPRINT : public D3D12_SUBRESOURCE_FOOTPRINT +{ + CD3DX12_SUBRESOURCE_FOOTPRINT() = default; + explicit CD3DX12_SUBRESOURCE_FOOTPRINT(const D3D12_SUBRESOURCE_FOOTPRINT &o) noexcept : + D3D12_SUBRESOURCE_FOOTPRINT(o) + {} + CD3DX12_SUBRESOURCE_FOOTPRINT( + DXGI_FORMAT format, + UINT width, + UINT height, + UINT depth, + UINT rowPitch ) noexcept + { + Format = format; + Width = width; + Height = height; + Depth = depth; + RowPitch = rowPitch; + } + explicit CD3DX12_SUBRESOURCE_FOOTPRINT( + const D3D12_RESOURCE_DESC& resDesc, + UINT rowPitch ) noexcept + { + Format = resDesc.Format; + Width = UINT( resDesc.Width ); + Height = resDesc.Height; + Depth = (resDesc.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D ? resDesc.DepthOrArraySize : 1u); + RowPitch = rowPitch; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_TEXTURE_COPY_LOCATION : public D3D12_TEXTURE_COPY_LOCATION +{ + CD3DX12_TEXTURE_COPY_LOCATION() = default; + explicit CD3DX12_TEXTURE_COPY_LOCATION(const D3D12_TEXTURE_COPY_LOCATION &o) noexcept : + D3D12_TEXTURE_COPY_LOCATION(o) + {} + CD3DX12_TEXTURE_COPY_LOCATION(_In_ ID3D12Resource* pRes) noexcept + { + pResource = pRes; + Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX; + PlacedFootprint = {}; + } + CD3DX12_TEXTURE_COPY_LOCATION(_In_ ID3D12Resource* pRes, D3D12_PLACED_SUBRESOURCE_FOOTPRINT const& Footprint) noexcept + { + pResource = pRes; + Type = D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT; + PlacedFootprint = Footprint; + } + CD3DX12_TEXTURE_COPY_LOCATION(_In_ ID3D12Resource* pRes, UINT Sub) noexcept + { + pResource = pRes; + Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX; + PlacedFootprint = {}; + SubresourceIndex = Sub; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_DESCRIPTOR_RANGE : public D3D12_DESCRIPTOR_RANGE +{ + CD3DX12_DESCRIPTOR_RANGE() = default; + explicit CD3DX12_DESCRIPTOR_RANGE(const D3D12_DESCRIPTOR_RANGE &o) noexcept : + D3D12_DESCRIPTOR_RANGE(o) + {} + CD3DX12_DESCRIPTOR_RANGE( + D3D12_DESCRIPTOR_RANGE_TYPE rangeType, + UINT numDescriptors, + UINT baseShaderRegister, + UINT registerSpace = 0, + UINT offsetInDescriptorsFromTableStart = + D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND) noexcept + { + Init(rangeType, numDescriptors, baseShaderRegister, registerSpace, offsetInDescriptorsFromTableStart); + } + + inline void Init( + D3D12_DESCRIPTOR_RANGE_TYPE rangeType, + UINT numDescriptors, + UINT baseShaderRegister, + UINT registerSpace = 0, + UINT offsetInDescriptorsFromTableStart = + D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND) noexcept + { + Init(*this, rangeType, numDescriptors, baseShaderRegister, registerSpace, offsetInDescriptorsFromTableStart); + } + + static inline void Init( + _Out_ D3D12_DESCRIPTOR_RANGE &range, + D3D12_DESCRIPTOR_RANGE_TYPE rangeType, + UINT numDescriptors, + UINT baseShaderRegister, + UINT registerSpace = 0, + UINT offsetInDescriptorsFromTableStart = + D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND) noexcept + { + range.RangeType = rangeType; + range.NumDescriptors = numDescriptors; + range.BaseShaderRegister = baseShaderRegister; + range.RegisterSpace = registerSpace; + range.OffsetInDescriptorsFromTableStart = offsetInDescriptorsFromTableStart; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_ROOT_DESCRIPTOR_TABLE : public D3D12_ROOT_DESCRIPTOR_TABLE +{ + CD3DX12_ROOT_DESCRIPTOR_TABLE() = default; + explicit CD3DX12_ROOT_DESCRIPTOR_TABLE(const D3D12_ROOT_DESCRIPTOR_TABLE &o) noexcept : + D3D12_ROOT_DESCRIPTOR_TABLE(o) + {} + CD3DX12_ROOT_DESCRIPTOR_TABLE( + UINT numDescriptorRanges, + _In_reads_opt_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE* _pDescriptorRanges) noexcept + { + Init(numDescriptorRanges, _pDescriptorRanges); + } + + inline void Init( + UINT numDescriptorRanges, + _In_reads_opt_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE* _pDescriptorRanges) noexcept + { + Init(*this, numDescriptorRanges, _pDescriptorRanges); + } + + static inline void Init( + _Out_ D3D12_ROOT_DESCRIPTOR_TABLE &rootDescriptorTable, + UINT numDescriptorRanges, + _In_reads_opt_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE* _pDescriptorRanges) noexcept + { + rootDescriptorTable.NumDescriptorRanges = numDescriptorRanges; + rootDescriptorTable.pDescriptorRanges = _pDescriptorRanges; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_ROOT_CONSTANTS : public D3D12_ROOT_CONSTANTS +{ + CD3DX12_ROOT_CONSTANTS() = default; + explicit CD3DX12_ROOT_CONSTANTS(const D3D12_ROOT_CONSTANTS &o) noexcept : + D3D12_ROOT_CONSTANTS(o) + {} + CD3DX12_ROOT_CONSTANTS( + UINT num32BitValues, + UINT shaderRegister, + UINT registerSpace = 0) noexcept + { + Init(num32BitValues, shaderRegister, registerSpace); + } + + inline void Init( + UINT num32BitValues, + UINT shaderRegister, + UINT registerSpace = 0) noexcept + { + Init(*this, num32BitValues, shaderRegister, registerSpace); + } + + static inline void Init( + _Out_ D3D12_ROOT_CONSTANTS &rootConstants, + UINT num32BitValues, + UINT shaderRegister, + UINT registerSpace = 0) noexcept + { + rootConstants.Num32BitValues = num32BitValues; + rootConstants.ShaderRegister = shaderRegister; + rootConstants.RegisterSpace = registerSpace; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_ROOT_DESCRIPTOR : public D3D12_ROOT_DESCRIPTOR +{ + CD3DX12_ROOT_DESCRIPTOR() = default; + explicit CD3DX12_ROOT_DESCRIPTOR(const D3D12_ROOT_DESCRIPTOR &o) noexcept : + D3D12_ROOT_DESCRIPTOR(o) + {} + CD3DX12_ROOT_DESCRIPTOR( + UINT shaderRegister, + UINT registerSpace = 0) noexcept + { + Init(shaderRegister, registerSpace); + } + + inline void Init( + UINT shaderRegister, + UINT registerSpace = 0) noexcept + { + Init(*this, shaderRegister, registerSpace); + } + + static inline void Init(_Out_ D3D12_ROOT_DESCRIPTOR &table, UINT shaderRegister, UINT registerSpace = 0) noexcept + { + table.ShaderRegister = shaderRegister; + table.RegisterSpace = registerSpace; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_ROOT_PARAMETER : public D3D12_ROOT_PARAMETER +{ + CD3DX12_ROOT_PARAMETER() = default; + explicit CD3DX12_ROOT_PARAMETER(const D3D12_ROOT_PARAMETER &o) noexcept : + D3D12_ROOT_PARAMETER(o) + {} + + static inline void InitAsDescriptorTable( + _Out_ D3D12_ROOT_PARAMETER &rootParam, + UINT numDescriptorRanges, + _In_reads_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE* pDescriptorRanges, + D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept + { + rootParam.ParameterType = D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE; + rootParam.ShaderVisibility = visibility; + CD3DX12_ROOT_DESCRIPTOR_TABLE::Init(rootParam.DescriptorTable, numDescriptorRanges, pDescriptorRanges); + } + + static inline void InitAsConstants( + _Out_ D3D12_ROOT_PARAMETER &rootParam, + UINT num32BitValues, + UINT shaderRegister, + UINT registerSpace = 0, + D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept + { + rootParam.ParameterType = D3D12_ROOT_PARAMETER_TYPE_32BIT_CONSTANTS; + rootParam.ShaderVisibility = visibility; + CD3DX12_ROOT_CONSTANTS::Init(rootParam.Constants, num32BitValues, shaderRegister, registerSpace); + } + + static inline void InitAsConstantBufferView( + _Out_ D3D12_ROOT_PARAMETER &rootParam, + UINT shaderRegister, + UINT registerSpace = 0, + D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept + { + rootParam.ParameterType = D3D12_ROOT_PARAMETER_TYPE_CBV; + rootParam.ShaderVisibility = visibility; + CD3DX12_ROOT_DESCRIPTOR::Init(rootParam.Descriptor, shaderRegister, registerSpace); + } + + static inline void InitAsShaderResourceView( + _Out_ D3D12_ROOT_PARAMETER &rootParam, + UINT shaderRegister, + UINT registerSpace = 0, + D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept + { + rootParam.ParameterType = D3D12_ROOT_PARAMETER_TYPE_SRV; + rootParam.ShaderVisibility = visibility; + CD3DX12_ROOT_DESCRIPTOR::Init(rootParam.Descriptor, shaderRegister, registerSpace); + } + + static inline void InitAsUnorderedAccessView( + _Out_ D3D12_ROOT_PARAMETER &rootParam, + UINT shaderRegister, + UINT registerSpace = 0, + D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept + { + rootParam.ParameterType = D3D12_ROOT_PARAMETER_TYPE_UAV; + rootParam.ShaderVisibility = visibility; + CD3DX12_ROOT_DESCRIPTOR::Init(rootParam.Descriptor, shaderRegister, registerSpace); + } + + inline void InitAsDescriptorTable( + UINT numDescriptorRanges, + _In_reads_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE* pDescriptorRanges, + D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept + { + InitAsDescriptorTable(*this, numDescriptorRanges, pDescriptorRanges, visibility); + } + + inline void InitAsConstants( + UINT num32BitValues, + UINT shaderRegister, + UINT registerSpace = 0, + D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept + { + InitAsConstants(*this, num32BitValues, shaderRegister, registerSpace, visibility); + } + + inline void InitAsConstantBufferView( + UINT shaderRegister, + UINT registerSpace = 0, + D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept + { + InitAsConstantBufferView(*this, shaderRegister, registerSpace, visibility); + } + + inline void InitAsShaderResourceView( + UINT shaderRegister, + UINT registerSpace = 0, + D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept + { + InitAsShaderResourceView(*this, shaderRegister, registerSpace, visibility); + } + + inline void InitAsUnorderedAccessView( + UINT shaderRegister, + UINT registerSpace = 0, + D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept + { + InitAsUnorderedAccessView(*this, shaderRegister, registerSpace, visibility); + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_STATIC_SAMPLER_DESC : public D3D12_STATIC_SAMPLER_DESC +{ + CD3DX12_STATIC_SAMPLER_DESC() = default; + explicit CD3DX12_STATIC_SAMPLER_DESC(const D3D12_STATIC_SAMPLER_DESC &o) noexcept : + D3D12_STATIC_SAMPLER_DESC(o) + {} + CD3DX12_STATIC_SAMPLER_DESC( + UINT shaderRegister, + D3D12_FILTER filter = D3D12_FILTER_ANISOTROPIC, + D3D12_TEXTURE_ADDRESS_MODE addressU = D3D12_TEXTURE_ADDRESS_MODE_WRAP, + D3D12_TEXTURE_ADDRESS_MODE addressV = D3D12_TEXTURE_ADDRESS_MODE_WRAP, + D3D12_TEXTURE_ADDRESS_MODE addressW = D3D12_TEXTURE_ADDRESS_MODE_WRAP, + FLOAT mipLODBias = 0, + UINT maxAnisotropy = 16, + D3D12_COMPARISON_FUNC comparisonFunc = D3D12_COMPARISON_FUNC_LESS_EQUAL, + D3D12_STATIC_BORDER_COLOR borderColor = D3D12_STATIC_BORDER_COLOR_OPAQUE_WHITE, + FLOAT minLOD = 0.f, + FLOAT maxLOD = D3D12_FLOAT32_MAX, + D3D12_SHADER_VISIBILITY shaderVisibility = D3D12_SHADER_VISIBILITY_ALL, + UINT registerSpace = 0) noexcept + { + Init( + shaderRegister, + filter, + addressU, + addressV, + addressW, + mipLODBias, + maxAnisotropy, + comparisonFunc, + borderColor, + minLOD, + maxLOD, + shaderVisibility, + registerSpace); + } + + static inline void Init( + _Out_ D3D12_STATIC_SAMPLER_DESC &samplerDesc, + UINT shaderRegister, + D3D12_FILTER filter = D3D12_FILTER_ANISOTROPIC, + D3D12_TEXTURE_ADDRESS_MODE addressU = D3D12_TEXTURE_ADDRESS_MODE_WRAP, + D3D12_TEXTURE_ADDRESS_MODE addressV = D3D12_TEXTURE_ADDRESS_MODE_WRAP, + D3D12_TEXTURE_ADDRESS_MODE addressW = D3D12_TEXTURE_ADDRESS_MODE_WRAP, + FLOAT mipLODBias = 0, + UINT maxAnisotropy = 16, + D3D12_COMPARISON_FUNC comparisonFunc = D3D12_COMPARISON_FUNC_LESS_EQUAL, + D3D12_STATIC_BORDER_COLOR borderColor = D3D12_STATIC_BORDER_COLOR_OPAQUE_WHITE, + FLOAT minLOD = 0.f, + FLOAT maxLOD = D3D12_FLOAT32_MAX, + D3D12_SHADER_VISIBILITY shaderVisibility = D3D12_SHADER_VISIBILITY_ALL, + UINT registerSpace = 0) noexcept + { + samplerDesc.ShaderRegister = shaderRegister; + samplerDesc.Filter = filter; + samplerDesc.AddressU = addressU; + samplerDesc.AddressV = addressV; + samplerDesc.AddressW = addressW; + samplerDesc.MipLODBias = mipLODBias; + samplerDesc.MaxAnisotropy = maxAnisotropy; + samplerDesc.ComparisonFunc = comparisonFunc; + samplerDesc.BorderColor = borderColor; + samplerDesc.MinLOD = minLOD; + samplerDesc.MaxLOD = maxLOD; + samplerDesc.ShaderVisibility = shaderVisibility; + samplerDesc.RegisterSpace = registerSpace; + } + inline void Init( + UINT shaderRegister, + D3D12_FILTER filter = D3D12_FILTER_ANISOTROPIC, + D3D12_TEXTURE_ADDRESS_MODE addressU = D3D12_TEXTURE_ADDRESS_MODE_WRAP, + D3D12_TEXTURE_ADDRESS_MODE addressV = D3D12_TEXTURE_ADDRESS_MODE_WRAP, + D3D12_TEXTURE_ADDRESS_MODE addressW = D3D12_TEXTURE_ADDRESS_MODE_WRAP, + FLOAT mipLODBias = 0, + UINT maxAnisotropy = 16, + D3D12_COMPARISON_FUNC comparisonFunc = D3D12_COMPARISON_FUNC_LESS_EQUAL, + D3D12_STATIC_BORDER_COLOR borderColor = D3D12_STATIC_BORDER_COLOR_OPAQUE_WHITE, + FLOAT minLOD = 0.f, + FLOAT maxLOD = D3D12_FLOAT32_MAX, + D3D12_SHADER_VISIBILITY shaderVisibility = D3D12_SHADER_VISIBILITY_ALL, + UINT registerSpace = 0) noexcept + { + Init( + *this, + shaderRegister, + filter, + addressU, + addressV, + addressW, + mipLODBias, + maxAnisotropy, + comparisonFunc, + borderColor, + minLOD, + maxLOD, + shaderVisibility, + registerSpace); + } + +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_ROOT_SIGNATURE_DESC : public D3D12_ROOT_SIGNATURE_DESC +{ + CD3DX12_ROOT_SIGNATURE_DESC() = default; + explicit CD3DX12_ROOT_SIGNATURE_DESC(const D3D12_ROOT_SIGNATURE_DESC &o) noexcept : + D3D12_ROOT_SIGNATURE_DESC(o) + {} + CD3DX12_ROOT_SIGNATURE_DESC( + UINT numParameters, + _In_reads_opt_(numParameters) const D3D12_ROOT_PARAMETER* _pParameters, + UINT numStaticSamplers = 0, + _In_reads_opt_(numStaticSamplers) const D3D12_STATIC_SAMPLER_DESC* _pStaticSamplers = nullptr, + D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE) noexcept + { + Init(numParameters, _pParameters, numStaticSamplers, _pStaticSamplers, flags); + } + CD3DX12_ROOT_SIGNATURE_DESC(CD3DX12_DEFAULT) noexcept + { + Init(0, nullptr, 0, nullptr, D3D12_ROOT_SIGNATURE_FLAG_NONE); + } + + inline void Init( + UINT numParameters, + _In_reads_opt_(numParameters) const D3D12_ROOT_PARAMETER* _pParameters, + UINT numStaticSamplers = 0, + _In_reads_opt_(numStaticSamplers) const D3D12_STATIC_SAMPLER_DESC* _pStaticSamplers = nullptr, + D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE) noexcept + { + Init(*this, numParameters, _pParameters, numStaticSamplers, _pStaticSamplers, flags); + } + + static inline void Init( + _Out_ D3D12_ROOT_SIGNATURE_DESC &desc, + UINT numParameters, + _In_reads_opt_(numParameters) const D3D12_ROOT_PARAMETER* _pParameters, + UINT numStaticSamplers = 0, + _In_reads_opt_(numStaticSamplers) const D3D12_STATIC_SAMPLER_DESC* _pStaticSamplers = nullptr, + D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE) noexcept + { + desc.NumParameters = numParameters; + desc.pParameters = _pParameters; + desc.NumStaticSamplers = numStaticSamplers; + desc.pStaticSamplers = _pStaticSamplers; + desc.Flags = flags; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_DESCRIPTOR_RANGE1 : public D3D12_DESCRIPTOR_RANGE1 +{ + CD3DX12_DESCRIPTOR_RANGE1() = default; + explicit CD3DX12_DESCRIPTOR_RANGE1(const D3D12_DESCRIPTOR_RANGE1 &o) noexcept : + D3D12_DESCRIPTOR_RANGE1(o) + {} + CD3DX12_DESCRIPTOR_RANGE1( + D3D12_DESCRIPTOR_RANGE_TYPE rangeType, + UINT numDescriptors, + UINT baseShaderRegister, + UINT registerSpace = 0, + D3D12_DESCRIPTOR_RANGE_FLAGS flags = D3D12_DESCRIPTOR_RANGE_FLAG_NONE, + UINT offsetInDescriptorsFromTableStart = + D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND) noexcept + { + Init(rangeType, numDescriptors, baseShaderRegister, registerSpace, flags, offsetInDescriptorsFromTableStart); + } + + inline void Init( + D3D12_DESCRIPTOR_RANGE_TYPE rangeType, + UINT numDescriptors, + UINT baseShaderRegister, + UINT registerSpace = 0, + D3D12_DESCRIPTOR_RANGE_FLAGS flags = D3D12_DESCRIPTOR_RANGE_FLAG_NONE, + UINT offsetInDescriptorsFromTableStart = + D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND) noexcept + { + Init(*this, rangeType, numDescriptors, baseShaderRegister, registerSpace, flags, offsetInDescriptorsFromTableStart); + } + + static inline void Init( + _Out_ D3D12_DESCRIPTOR_RANGE1 &range, + D3D12_DESCRIPTOR_RANGE_TYPE rangeType, + UINT numDescriptors, + UINT baseShaderRegister, + UINT registerSpace = 0, + D3D12_DESCRIPTOR_RANGE_FLAGS flags = D3D12_DESCRIPTOR_RANGE_FLAG_NONE, + UINT offsetInDescriptorsFromTableStart = + D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND) noexcept + { + range.RangeType = rangeType; + range.NumDescriptors = numDescriptors; + range.BaseShaderRegister = baseShaderRegister; + range.RegisterSpace = registerSpace; + range.Flags = flags; + range.OffsetInDescriptorsFromTableStart = offsetInDescriptorsFromTableStart; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_ROOT_DESCRIPTOR_TABLE1 : public D3D12_ROOT_DESCRIPTOR_TABLE1 +{ + CD3DX12_ROOT_DESCRIPTOR_TABLE1() = default; + explicit CD3DX12_ROOT_DESCRIPTOR_TABLE1(const D3D12_ROOT_DESCRIPTOR_TABLE1 &o) noexcept : + D3D12_ROOT_DESCRIPTOR_TABLE1(o) + {} + CD3DX12_ROOT_DESCRIPTOR_TABLE1( + UINT numDescriptorRanges, + _In_reads_opt_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE1* _pDescriptorRanges) noexcept + { + Init(numDescriptorRanges, _pDescriptorRanges); + } + + inline void Init( + UINT numDescriptorRanges, + _In_reads_opt_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE1* _pDescriptorRanges) noexcept + { + Init(*this, numDescriptorRanges, _pDescriptorRanges); + } + + static inline void Init( + _Out_ D3D12_ROOT_DESCRIPTOR_TABLE1 &rootDescriptorTable, + UINT numDescriptorRanges, + _In_reads_opt_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE1* _pDescriptorRanges) noexcept + { + rootDescriptorTable.NumDescriptorRanges = numDescriptorRanges; + rootDescriptorTable.pDescriptorRanges = _pDescriptorRanges; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_ROOT_DESCRIPTOR1 : public D3D12_ROOT_DESCRIPTOR1 +{ + CD3DX12_ROOT_DESCRIPTOR1() = default; + explicit CD3DX12_ROOT_DESCRIPTOR1(const D3D12_ROOT_DESCRIPTOR1 &o) noexcept : + D3D12_ROOT_DESCRIPTOR1(o) + {} + CD3DX12_ROOT_DESCRIPTOR1( + UINT shaderRegister, + UINT registerSpace = 0, + D3D12_ROOT_DESCRIPTOR_FLAGS flags = D3D12_ROOT_DESCRIPTOR_FLAG_NONE) noexcept + { + Init(shaderRegister, registerSpace, flags); + } + + inline void Init( + UINT shaderRegister, + UINT registerSpace = 0, + D3D12_ROOT_DESCRIPTOR_FLAGS flags = D3D12_ROOT_DESCRIPTOR_FLAG_NONE) noexcept + { + Init(*this, shaderRegister, registerSpace, flags); + } + + static inline void Init( + _Out_ D3D12_ROOT_DESCRIPTOR1 &table, + UINT shaderRegister, + UINT registerSpace = 0, + D3D12_ROOT_DESCRIPTOR_FLAGS flags = D3D12_ROOT_DESCRIPTOR_FLAG_NONE) noexcept + { + table.ShaderRegister = shaderRegister; + table.RegisterSpace = registerSpace; + table.Flags = flags; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_ROOT_PARAMETER1 : public D3D12_ROOT_PARAMETER1 +{ + CD3DX12_ROOT_PARAMETER1() = default; + explicit CD3DX12_ROOT_PARAMETER1(const D3D12_ROOT_PARAMETER1 &o) noexcept : + D3D12_ROOT_PARAMETER1(o) + {} + + static inline void InitAsDescriptorTable( + _Out_ D3D12_ROOT_PARAMETER1 &rootParam, + UINT numDescriptorRanges, + _In_reads_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE1* pDescriptorRanges, + D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept + { + rootParam.ParameterType = D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE; + rootParam.ShaderVisibility = visibility; + CD3DX12_ROOT_DESCRIPTOR_TABLE1::Init(rootParam.DescriptorTable, numDescriptorRanges, pDescriptorRanges); + } + + static inline void InitAsConstants( + _Out_ D3D12_ROOT_PARAMETER1 &rootParam, + UINT num32BitValues, + UINT shaderRegister, + UINT registerSpace = 0, + D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept + { + rootParam.ParameterType = D3D12_ROOT_PARAMETER_TYPE_32BIT_CONSTANTS; + rootParam.ShaderVisibility = visibility; + CD3DX12_ROOT_CONSTANTS::Init(rootParam.Constants, num32BitValues, shaderRegister, registerSpace); + } + + static inline void InitAsConstantBufferView( + _Out_ D3D12_ROOT_PARAMETER1 &rootParam, + UINT shaderRegister, + UINT registerSpace = 0, + D3D12_ROOT_DESCRIPTOR_FLAGS flags = D3D12_ROOT_DESCRIPTOR_FLAG_NONE, + D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept + { + rootParam.ParameterType = D3D12_ROOT_PARAMETER_TYPE_CBV; + rootParam.ShaderVisibility = visibility; + CD3DX12_ROOT_DESCRIPTOR1::Init(rootParam.Descriptor, shaderRegister, registerSpace, flags); + } + + static inline void InitAsShaderResourceView( + _Out_ D3D12_ROOT_PARAMETER1 &rootParam, + UINT shaderRegister, + UINT registerSpace = 0, + D3D12_ROOT_DESCRIPTOR_FLAGS flags = D3D12_ROOT_DESCRIPTOR_FLAG_NONE, + D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept + { + rootParam.ParameterType = D3D12_ROOT_PARAMETER_TYPE_SRV; + rootParam.ShaderVisibility = visibility; + CD3DX12_ROOT_DESCRIPTOR1::Init(rootParam.Descriptor, shaderRegister, registerSpace, flags); + } + + static inline void InitAsUnorderedAccessView( + _Out_ D3D12_ROOT_PARAMETER1 &rootParam, + UINT shaderRegister, + UINT registerSpace = 0, + D3D12_ROOT_DESCRIPTOR_FLAGS flags = D3D12_ROOT_DESCRIPTOR_FLAG_NONE, + D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept + { + rootParam.ParameterType = D3D12_ROOT_PARAMETER_TYPE_UAV; + rootParam.ShaderVisibility = visibility; + CD3DX12_ROOT_DESCRIPTOR1::Init(rootParam.Descriptor, shaderRegister, registerSpace, flags); + } + + inline void InitAsDescriptorTable( + UINT numDescriptorRanges, + _In_reads_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE1* pDescriptorRanges, + D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept + { + InitAsDescriptorTable(*this, numDescriptorRanges, pDescriptorRanges, visibility); + } + + inline void InitAsConstants( + UINT num32BitValues, + UINT shaderRegister, + UINT registerSpace = 0, + D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept + { + InitAsConstants(*this, num32BitValues, shaderRegister, registerSpace, visibility); + } + + inline void InitAsConstantBufferView( + UINT shaderRegister, + UINT registerSpace = 0, + D3D12_ROOT_DESCRIPTOR_FLAGS flags = D3D12_ROOT_DESCRIPTOR_FLAG_NONE, + D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept + { + InitAsConstantBufferView(*this, shaderRegister, registerSpace, flags, visibility); + } + + inline void InitAsShaderResourceView( + UINT shaderRegister, + UINT registerSpace = 0, + D3D12_ROOT_DESCRIPTOR_FLAGS flags = D3D12_ROOT_DESCRIPTOR_FLAG_NONE, + D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept + { + InitAsShaderResourceView(*this, shaderRegister, registerSpace, flags, visibility); + } + + inline void InitAsUnorderedAccessView( + UINT shaderRegister, + UINT registerSpace = 0, + D3D12_ROOT_DESCRIPTOR_FLAGS flags = D3D12_ROOT_DESCRIPTOR_FLAG_NONE, + D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL) noexcept + { + InitAsUnorderedAccessView(*this, shaderRegister, registerSpace, flags, visibility); + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC : public D3D12_VERSIONED_ROOT_SIGNATURE_DESC +{ + CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC() = default; + explicit CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC(const D3D12_VERSIONED_ROOT_SIGNATURE_DESC &o) noexcept : + D3D12_VERSIONED_ROOT_SIGNATURE_DESC(o) + {} + explicit CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC(const D3D12_ROOT_SIGNATURE_DESC &o) noexcept + { + Version = D3D_ROOT_SIGNATURE_VERSION_1_0; + Desc_1_0 = o; + } + explicit CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC(const D3D12_ROOT_SIGNATURE_DESC1 &o) noexcept + { + Version = D3D_ROOT_SIGNATURE_VERSION_1_1; + Desc_1_1 = o; + } + CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC( + UINT numParameters, + _In_reads_opt_(numParameters) const D3D12_ROOT_PARAMETER* _pParameters, + UINT numStaticSamplers = 0, + _In_reads_opt_(numStaticSamplers) const D3D12_STATIC_SAMPLER_DESC* _pStaticSamplers = nullptr, + D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE) noexcept + { + Init_1_0(numParameters, _pParameters, numStaticSamplers, _pStaticSamplers, flags); + } + CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC( + UINT numParameters, + _In_reads_opt_(numParameters) const D3D12_ROOT_PARAMETER1* _pParameters, + UINT numStaticSamplers = 0, + _In_reads_opt_(numStaticSamplers) const D3D12_STATIC_SAMPLER_DESC* _pStaticSamplers = nullptr, + D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE) noexcept + { + Init_1_1(numParameters, _pParameters, numStaticSamplers, _pStaticSamplers, flags); + } + CD3DX12_VERSIONED_ROOT_SIGNATURE_DESC(CD3DX12_DEFAULT) noexcept + { + Init_1_1(0, nullptr, 0, nullptr, D3D12_ROOT_SIGNATURE_FLAG_NONE); + } + + inline void Init_1_0( + UINT numParameters, + _In_reads_opt_(numParameters) const D3D12_ROOT_PARAMETER* _pParameters, + UINT numStaticSamplers = 0, + _In_reads_opt_(numStaticSamplers) const D3D12_STATIC_SAMPLER_DESC* _pStaticSamplers = nullptr, + D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE) noexcept + { + Init_1_0(*this, numParameters, _pParameters, numStaticSamplers, _pStaticSamplers, flags); + } + + static inline void Init_1_0( + _Out_ D3D12_VERSIONED_ROOT_SIGNATURE_DESC &desc, + UINT numParameters, + _In_reads_opt_(numParameters) const D3D12_ROOT_PARAMETER* _pParameters, + UINT numStaticSamplers = 0, + _In_reads_opt_(numStaticSamplers) const D3D12_STATIC_SAMPLER_DESC* _pStaticSamplers = nullptr, + D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE) noexcept + { + desc.Version = D3D_ROOT_SIGNATURE_VERSION_1_0; + desc.Desc_1_0.NumParameters = numParameters; + desc.Desc_1_0.pParameters = _pParameters; + desc.Desc_1_0.NumStaticSamplers = numStaticSamplers; + desc.Desc_1_0.pStaticSamplers = _pStaticSamplers; + desc.Desc_1_0.Flags = flags; + } + + inline void Init_1_1( + UINT numParameters, + _In_reads_opt_(numParameters) const D3D12_ROOT_PARAMETER1* _pParameters, + UINT numStaticSamplers = 0, + _In_reads_opt_(numStaticSamplers) const D3D12_STATIC_SAMPLER_DESC* _pStaticSamplers = nullptr, + D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE) noexcept + { + Init_1_1(*this, numParameters, _pParameters, numStaticSamplers, _pStaticSamplers, flags); + } + + static inline void Init_1_1( + _Out_ D3D12_VERSIONED_ROOT_SIGNATURE_DESC &desc, + UINT numParameters, + _In_reads_opt_(numParameters) const D3D12_ROOT_PARAMETER1* _pParameters, + UINT numStaticSamplers = 0, + _In_reads_opt_(numStaticSamplers) const D3D12_STATIC_SAMPLER_DESC* _pStaticSamplers = nullptr, + D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE) noexcept + { + desc.Version = D3D_ROOT_SIGNATURE_VERSION_1_1; + desc.Desc_1_1.NumParameters = numParameters; + desc.Desc_1_1.pParameters = _pParameters; + desc.Desc_1_1.NumStaticSamplers = numStaticSamplers; + desc.Desc_1_1.pStaticSamplers = _pStaticSamplers; + desc.Desc_1_1.Flags = flags; + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_CPU_DESCRIPTOR_HANDLE : public D3D12_CPU_DESCRIPTOR_HANDLE +{ + CD3DX12_CPU_DESCRIPTOR_HANDLE() = default; + explicit CD3DX12_CPU_DESCRIPTOR_HANDLE(const D3D12_CPU_DESCRIPTOR_HANDLE &o) noexcept : + D3D12_CPU_DESCRIPTOR_HANDLE(o) + {} + CD3DX12_CPU_DESCRIPTOR_HANDLE(CD3DX12_DEFAULT) noexcept { ptr = 0; } + CD3DX12_CPU_DESCRIPTOR_HANDLE(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE &other, INT offsetScaledByIncrementSize) noexcept + { + InitOffsetted(other, offsetScaledByIncrementSize); + } + CD3DX12_CPU_DESCRIPTOR_HANDLE(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE &other, INT offsetInDescriptors, UINT descriptorIncrementSize) noexcept + { + InitOffsetted(other, offsetInDescriptors, descriptorIncrementSize); + } + CD3DX12_CPU_DESCRIPTOR_HANDLE& Offset(INT offsetInDescriptors, UINT descriptorIncrementSize) noexcept + { + ptr = SIZE_T(INT64(ptr) + INT64(offsetInDescriptors) * INT64(descriptorIncrementSize)); + return *this; + } + CD3DX12_CPU_DESCRIPTOR_HANDLE& Offset(INT offsetScaledByIncrementSize) noexcept + { + ptr = SIZE_T(INT64(ptr) + INT64(offsetScaledByIncrementSize)); + return *this; + } + bool operator==(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE& other) const noexcept + { + return (ptr == other.ptr); + } + bool operator!=(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE& other) const noexcept + { + return (ptr != other.ptr); + } + CD3DX12_CPU_DESCRIPTOR_HANDLE &operator=(const D3D12_CPU_DESCRIPTOR_HANDLE &other) noexcept + { + ptr = other.ptr; + return *this; + } + + inline void InitOffsetted(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE &base, INT offsetScaledByIncrementSize) noexcept + { + InitOffsetted(*this, base, offsetScaledByIncrementSize); + } + + inline void InitOffsetted(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE &base, INT offsetInDescriptors, UINT descriptorIncrementSize) noexcept + { + InitOffsetted(*this, base, offsetInDescriptors, descriptorIncrementSize); + } + + static inline void InitOffsetted(_Out_ D3D12_CPU_DESCRIPTOR_HANDLE &handle, _In_ const D3D12_CPU_DESCRIPTOR_HANDLE &base, INT offsetScaledByIncrementSize) noexcept + { + handle.ptr = SIZE_T(INT64(base.ptr) + INT64(offsetScaledByIncrementSize)); + } + + static inline void InitOffsetted(_Out_ D3D12_CPU_DESCRIPTOR_HANDLE &handle, _In_ const D3D12_CPU_DESCRIPTOR_HANDLE &base, INT offsetInDescriptors, UINT descriptorIncrementSize) noexcept + { + handle.ptr = SIZE_T(INT64(base.ptr) + INT64(offsetInDescriptors) * INT64(descriptorIncrementSize)); + } +}; + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_GPU_DESCRIPTOR_HANDLE : public D3D12_GPU_DESCRIPTOR_HANDLE +{ + CD3DX12_GPU_DESCRIPTOR_HANDLE() = default; + explicit CD3DX12_GPU_DESCRIPTOR_HANDLE(const D3D12_GPU_DESCRIPTOR_HANDLE &o) noexcept : + D3D12_GPU_DESCRIPTOR_HANDLE(o) + {} + CD3DX12_GPU_DESCRIPTOR_HANDLE(CD3DX12_DEFAULT) noexcept { ptr = 0; } + CD3DX12_GPU_DESCRIPTOR_HANDLE(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE &other, INT offsetScaledByIncrementSize) noexcept + { + InitOffsetted(other, offsetScaledByIncrementSize); + } + CD3DX12_GPU_DESCRIPTOR_HANDLE(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE &other, INT offsetInDescriptors, UINT descriptorIncrementSize) noexcept + { + InitOffsetted(other, offsetInDescriptors, descriptorIncrementSize); + } + CD3DX12_GPU_DESCRIPTOR_HANDLE& Offset(INT offsetInDescriptors, UINT descriptorIncrementSize) noexcept + { + ptr = UINT64(INT64(ptr) + INT64(offsetInDescriptors) * INT64(descriptorIncrementSize)); + return *this; + } + CD3DX12_GPU_DESCRIPTOR_HANDLE& Offset(INT offsetScaledByIncrementSize) noexcept + { + ptr = UINT64(INT64(ptr) + INT64(offsetScaledByIncrementSize)); + return *this; + } + inline bool operator==(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE& other) const noexcept + { + return (ptr == other.ptr); + } + inline bool operator!=(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE& other) const noexcept + { + return (ptr != other.ptr); + } + CD3DX12_GPU_DESCRIPTOR_HANDLE &operator=(const D3D12_GPU_DESCRIPTOR_HANDLE &other) noexcept + { + ptr = other.ptr; + return *this; + } + + inline void InitOffsetted(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE &base, INT offsetScaledByIncrementSize) noexcept + { + InitOffsetted(*this, base, offsetScaledByIncrementSize); + } + + inline void InitOffsetted(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE &base, INT offsetInDescriptors, UINT descriptorIncrementSize) noexcept + { + InitOffsetted(*this, base, offsetInDescriptors, descriptorIncrementSize); + } + + static inline void InitOffsetted(_Out_ D3D12_GPU_DESCRIPTOR_HANDLE &handle, _In_ const D3D12_GPU_DESCRIPTOR_HANDLE &base, INT offsetScaledByIncrementSize) noexcept + { + handle.ptr = UINT64(INT64(base.ptr) + INT64(offsetScaledByIncrementSize)); + } + + static inline void InitOffsetted(_Out_ D3D12_GPU_DESCRIPTOR_HANDLE &handle, _In_ const D3D12_GPU_DESCRIPTOR_HANDLE &base, INT offsetInDescriptors, UINT descriptorIncrementSize) noexcept + { + handle.ptr = UINT64(INT64(base.ptr) + INT64(offsetInDescriptors) * INT64(descriptorIncrementSize)); + } +}; + +//------------------------------------------------------------------------------------------------ +constexpr UINT D3D12CalcSubresource( UINT MipSlice, UINT ArraySlice, UINT PlaneSlice, UINT MipLevels, UINT ArraySize ) noexcept +{ + return MipSlice + ArraySlice * MipLevels + PlaneSlice * MipLevels * ArraySize; +} + +//------------------------------------------------------------------------------------------------ +template <typename T, typename U, typename V> +inline void D3D12DecomposeSubresource( UINT Subresource, UINT MipLevels, UINT ArraySize, _Out_ T& MipSlice, _Out_ U& ArraySlice, _Out_ V& PlaneSlice ) noexcept +{ + MipSlice = static_cast<T>(Subresource % MipLevels); + ArraySlice = static_cast<U>((Subresource / MipLevels) % ArraySize); + PlaneSlice = static_cast<V>(Subresource / (MipLevels * ArraySize)); +} + +//------------------------------------------------------------------------------------------------ +inline UINT8 D3D12GetFormatPlaneCount( + _In_ ID3D12Device* pDevice, + DXGI_FORMAT Format + ) noexcept +{ + D3D12_FEATURE_DATA_FORMAT_INFO formatInfo = { Format, 0 }; + if (FAILED(pDevice->CheckFeatureSupport(D3D12_FEATURE_FORMAT_INFO, &formatInfo, sizeof(formatInfo)))) + { + return 0; + } + return formatInfo.PlaneCount; +} + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_RESOURCE_DESC : public D3D12_RESOURCE_DESC +{ + CD3DX12_RESOURCE_DESC() = default; + explicit CD3DX12_RESOURCE_DESC( const D3D12_RESOURCE_DESC& o ) noexcept : + D3D12_RESOURCE_DESC( o ) + {} + CD3DX12_RESOURCE_DESC( + D3D12_RESOURCE_DIMENSION dimension, + UINT64 alignment, + UINT64 width, + UINT height, + UINT16 depthOrArraySize, + UINT16 mipLevels, + DXGI_FORMAT format, + UINT sampleCount, + UINT sampleQuality, + D3D12_TEXTURE_LAYOUT layout, + D3D12_RESOURCE_FLAGS flags ) noexcept + { + Dimension = dimension; + Alignment = alignment; + Width = width; + Height = height; + DepthOrArraySize = depthOrArraySize; + MipLevels = mipLevels; + Format = format; + SampleDesc.Count = sampleCount; + SampleDesc.Quality = sampleQuality; + Layout = layout; + Flags = flags; + } + static inline CD3DX12_RESOURCE_DESC Buffer( + const D3D12_RESOURCE_ALLOCATION_INFO& resAllocInfo, + D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE ) noexcept + { + return CD3DX12_RESOURCE_DESC( D3D12_RESOURCE_DIMENSION_BUFFER, resAllocInfo.Alignment, resAllocInfo.SizeInBytes, + 1, 1, 1, DXGI_FORMAT_UNKNOWN, 1, 0, D3D12_TEXTURE_LAYOUT_ROW_MAJOR, flags ); + } + static inline CD3DX12_RESOURCE_DESC Buffer( + UINT64 width, + D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE, + UINT64 alignment = 0 ) noexcept + { + return CD3DX12_RESOURCE_DESC( D3D12_RESOURCE_DIMENSION_BUFFER, alignment, width, 1, 1, 1, + DXGI_FORMAT_UNKNOWN, 1, 0, D3D12_TEXTURE_LAYOUT_ROW_MAJOR, flags ); + } + static inline CD3DX12_RESOURCE_DESC Tex1D( + DXGI_FORMAT format, + UINT64 width, + UINT16 arraySize = 1, + UINT16 mipLevels = 0, + D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE, + D3D12_TEXTURE_LAYOUT layout = D3D12_TEXTURE_LAYOUT_UNKNOWN, + UINT64 alignment = 0 ) noexcept + { + return CD3DX12_RESOURCE_DESC( D3D12_RESOURCE_DIMENSION_TEXTURE1D, alignment, width, 1, arraySize, + mipLevels, format, 1, 0, layout, flags ); + } + static inline CD3DX12_RESOURCE_DESC Tex2D( + DXGI_FORMAT format, + UINT64 width, + UINT height, + UINT16 arraySize = 1, + UINT16 mipLevels = 0, + UINT sampleCount = 1, + UINT sampleQuality = 0, + D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE, + D3D12_TEXTURE_LAYOUT layout = D3D12_TEXTURE_LAYOUT_UNKNOWN, + UINT64 alignment = 0 ) noexcept + { + return CD3DX12_RESOURCE_DESC( D3D12_RESOURCE_DIMENSION_TEXTURE2D, alignment, width, height, arraySize, + mipLevels, format, sampleCount, sampleQuality, layout, flags ); + } + static inline CD3DX12_RESOURCE_DESC Tex3D( + DXGI_FORMAT format, + UINT64 width, + UINT height, + UINT16 depth, + UINT16 mipLevels = 0, + D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE, + D3D12_TEXTURE_LAYOUT layout = D3D12_TEXTURE_LAYOUT_UNKNOWN, + UINT64 alignment = 0 ) noexcept + { + return CD3DX12_RESOURCE_DESC( D3D12_RESOURCE_DIMENSION_TEXTURE3D, alignment, width, height, depth, + mipLevels, format, 1, 0, layout, flags ); + } + inline UINT16 Depth() const noexcept + { return (Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D ? DepthOrArraySize : 1u); } + inline UINT16 ArraySize() const noexcept + { return (Dimension != D3D12_RESOURCE_DIMENSION_TEXTURE3D ? DepthOrArraySize : 1u); } + inline UINT8 PlaneCount(_In_ ID3D12Device* pDevice) const noexcept + { return D3D12GetFormatPlaneCount(pDevice, Format); } + inline UINT Subresources(_In_ ID3D12Device* pDevice) const noexcept + { return static_cast<UINT>(MipLevels) * ArraySize() * PlaneCount(pDevice); } + inline UINT CalcSubresource(UINT MipSlice, UINT ArraySlice, UINT PlaneSlice) noexcept + { return D3D12CalcSubresource(MipSlice, ArraySlice, PlaneSlice, MipLevels, ArraySize()); } +}; +inline bool operator==( const D3D12_RESOURCE_DESC& l, const D3D12_RESOURCE_DESC& r ) noexcept +{ + return l.Dimension == r.Dimension && + l.Alignment == r.Alignment && + l.Width == r.Width && + l.Height == r.Height && + l.DepthOrArraySize == r.DepthOrArraySize && + l.MipLevels == r.MipLevels && + l.Format == r.Format && + l.SampleDesc.Count == r.SampleDesc.Count && + l.SampleDesc.Quality == r.SampleDesc.Quality && + l.Layout == r.Layout && + l.Flags == r.Flags; +} +inline bool operator!=( const D3D12_RESOURCE_DESC& l, const D3D12_RESOURCE_DESC& r ) noexcept +{ return !( l == r ); } + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_RESOURCE_DESC1 : public D3D12_RESOURCE_DESC1 +{ + CD3DX12_RESOURCE_DESC1() = default; + explicit CD3DX12_RESOURCE_DESC1( const D3D12_RESOURCE_DESC1& o ) noexcept : + D3D12_RESOURCE_DESC1( o ) + {} + explicit CD3DX12_RESOURCE_DESC1( const D3D12_RESOURCE_DESC& o ) noexcept + { + Dimension = o.Dimension; + Alignment = o.Alignment; + Width = o.Width; + Height = o.Height; + DepthOrArraySize = o.DepthOrArraySize; + MipLevels = o.MipLevels; + Format = o.Format; + SampleDesc = o.SampleDesc; + Layout = o.Layout; + Flags = o.Flags; + SamplerFeedbackMipRegion = {}; + } + CD3DX12_RESOURCE_DESC1( + D3D12_RESOURCE_DIMENSION dimension, + UINT64 alignment, + UINT64 width, + UINT height, + UINT16 depthOrArraySize, + UINT16 mipLevels, + DXGI_FORMAT format, + UINT sampleCount, + UINT sampleQuality, + D3D12_TEXTURE_LAYOUT layout, + D3D12_RESOURCE_FLAGS flags, + UINT samplerFeedbackMipRegionWidth = 0, + UINT samplerFeedbackMipRegionHeight = 0, + UINT samplerFeedbackMipRegionDepth = 0) noexcept + { + Dimension = dimension; + Alignment = alignment; + Width = width; + Height = height; + DepthOrArraySize = depthOrArraySize; + MipLevels = mipLevels; + Format = format; + SampleDesc.Count = sampleCount; + SampleDesc.Quality = sampleQuality; + Layout = layout; + Flags = flags; + SamplerFeedbackMipRegion.Width = samplerFeedbackMipRegionWidth; + SamplerFeedbackMipRegion.Height = samplerFeedbackMipRegionHeight; + SamplerFeedbackMipRegion.Depth = samplerFeedbackMipRegionDepth; + } + static inline CD3DX12_RESOURCE_DESC1 Buffer( + const D3D12_RESOURCE_ALLOCATION_INFO& resAllocInfo, + D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE ) noexcept + { + return CD3DX12_RESOURCE_DESC1( D3D12_RESOURCE_DIMENSION_BUFFER, resAllocInfo.Alignment, resAllocInfo.SizeInBytes, + 1, 1, 1, DXGI_FORMAT_UNKNOWN, 1, 0, D3D12_TEXTURE_LAYOUT_ROW_MAJOR, flags, 0, 0, 0 ); + } + static inline CD3DX12_RESOURCE_DESC1 Buffer( + UINT64 width, + D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE, + UINT64 alignment = 0 ) noexcept + { + return CD3DX12_RESOURCE_DESC1( D3D12_RESOURCE_DIMENSION_BUFFER, alignment, width, 1, 1, 1, + DXGI_FORMAT_UNKNOWN, 1, 0, D3D12_TEXTURE_LAYOUT_ROW_MAJOR, flags, 0, 0, 0 ); + } + static inline CD3DX12_RESOURCE_DESC1 Tex1D( + DXGI_FORMAT format, + UINT64 width, + UINT16 arraySize = 1, + UINT16 mipLevels = 0, + D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE, + D3D12_TEXTURE_LAYOUT layout = D3D12_TEXTURE_LAYOUT_UNKNOWN, + UINT64 alignment = 0 ) noexcept + { + return CD3DX12_RESOURCE_DESC1( D3D12_RESOURCE_DIMENSION_TEXTURE1D, alignment, width, 1, arraySize, + mipLevels, format, 1, 0, layout, flags, 0, 0, 0 ); + } + static inline CD3DX12_RESOURCE_DESC1 Tex2D( + DXGI_FORMAT format, + UINT64 width, + UINT height, + UINT16 arraySize = 1, + UINT16 mipLevels = 0, + UINT sampleCount = 1, + UINT sampleQuality = 0, + D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE, + D3D12_TEXTURE_LAYOUT layout = D3D12_TEXTURE_LAYOUT_UNKNOWN, + UINT64 alignment = 0, + UINT samplerFeedbackMipRegionWidth = 0, + UINT samplerFeedbackMipRegionHeight = 0, + UINT samplerFeedbackMipRegionDepth = 0) noexcept + { + return CD3DX12_RESOURCE_DESC1( D3D12_RESOURCE_DIMENSION_TEXTURE2D, alignment, width, height, arraySize, + mipLevels, format, sampleCount, sampleQuality, layout, flags, samplerFeedbackMipRegionWidth, + samplerFeedbackMipRegionHeight, samplerFeedbackMipRegionDepth ); + } + static inline CD3DX12_RESOURCE_DESC1 Tex3D( + DXGI_FORMAT format, + UINT64 width, + UINT height, + UINT16 depth, + UINT16 mipLevels = 0, + D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE, + D3D12_TEXTURE_LAYOUT layout = D3D12_TEXTURE_LAYOUT_UNKNOWN, + UINT64 alignment = 0 ) noexcept + { + return CD3DX12_RESOURCE_DESC1( D3D12_RESOURCE_DIMENSION_TEXTURE3D, alignment, width, height, depth, + mipLevels, format, 1, 0, layout, flags, 0, 0, 0 ); + } + inline UINT16 Depth() const noexcept + { return (Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D ? DepthOrArraySize : 1u); } + inline UINT16 ArraySize() const noexcept + { return (Dimension != D3D12_RESOURCE_DIMENSION_TEXTURE3D ? DepthOrArraySize : 1u); } + inline UINT8 PlaneCount(_In_ ID3D12Device* pDevice) const noexcept + { return D3D12GetFormatPlaneCount(pDevice, Format); } + inline UINT Subresources(_In_ ID3D12Device* pDevice) const noexcept + { return static_cast<UINT>(MipLevels) * ArraySize() * PlaneCount(pDevice); } + inline UINT CalcSubresource(UINT MipSlice, UINT ArraySlice, UINT PlaneSlice) noexcept + { return D3D12CalcSubresource(MipSlice, ArraySlice, PlaneSlice, MipLevels, ArraySize()); } +}; +inline bool operator==( const D3D12_RESOURCE_DESC1& l, const D3D12_RESOURCE_DESC1& r ) noexcept +{ + return l.Dimension == r.Dimension && + l.Alignment == r.Alignment && + l.Width == r.Width && + l.Height == r.Height && + l.DepthOrArraySize == r.DepthOrArraySize && + l.MipLevels == r.MipLevels && + l.Format == r.Format && + l.SampleDesc.Count == r.SampleDesc.Count && + l.SampleDesc.Quality == r.SampleDesc.Quality && + l.Layout == r.Layout && + l.Flags == r.Flags && + l.SamplerFeedbackMipRegion.Width == r.SamplerFeedbackMipRegion.Width && + l.SamplerFeedbackMipRegion.Height == r.SamplerFeedbackMipRegion.Height && + l.SamplerFeedbackMipRegion.Depth == r.SamplerFeedbackMipRegion.Depth; +} +inline bool operator!=( const D3D12_RESOURCE_DESC1& l, const D3D12_RESOURCE_DESC1& r ) noexcept +{ return !( l == r ); } + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_VIEW_INSTANCING_DESC : public D3D12_VIEW_INSTANCING_DESC +{ + CD3DX12_VIEW_INSTANCING_DESC() = default; + explicit CD3DX12_VIEW_INSTANCING_DESC( const D3D12_VIEW_INSTANCING_DESC& o ) noexcept : + D3D12_VIEW_INSTANCING_DESC( o ) + {} + explicit CD3DX12_VIEW_INSTANCING_DESC( CD3DX12_DEFAULT ) noexcept + { + ViewInstanceCount = 0; + pViewInstanceLocations = nullptr; + Flags = D3D12_VIEW_INSTANCING_FLAG_NONE; + } + explicit CD3DX12_VIEW_INSTANCING_DESC( + UINT InViewInstanceCount, + const D3D12_VIEW_INSTANCE_LOCATION* InViewInstanceLocations, + D3D12_VIEW_INSTANCING_FLAGS InFlags) noexcept + { + ViewInstanceCount = InViewInstanceCount; + pViewInstanceLocations = InViewInstanceLocations; + Flags = InFlags; + } +}; + +//------------------------------------------------------------------------------------------------ +// Row-by-row memcpy +inline void MemcpySubresource( + _In_ const D3D12_MEMCPY_DEST* pDest, + _In_ const D3D12_SUBRESOURCE_DATA* pSrc, + SIZE_T RowSizeInBytes, + UINT NumRows, + UINT NumSlices) noexcept +{ + for (UINT z = 0; z < NumSlices; ++z) + { + auto pDestSlice = static_cast<BYTE*>(pDest->pData) + pDest->SlicePitch * z; + auto pSrcSlice = static_cast<const BYTE*>(pSrc->pData) + pSrc->SlicePitch * LONG_PTR(z); + for (UINT y = 0; y < NumRows; ++y) + { + memcpy(pDestSlice + pDest->RowPitch * y, + pSrcSlice + pSrc->RowPitch * LONG_PTR(y), + RowSizeInBytes); + } + } +} + +//------------------------------------------------------------------------------------------------ +// Row-by-row memcpy +inline void MemcpySubresource( + _In_ const D3D12_MEMCPY_DEST* pDest, + _In_ const void* pResourceData, + _In_ const D3D12_SUBRESOURCE_INFO* pSrc, + SIZE_T RowSizeInBytes, + UINT NumRows, + UINT NumSlices) noexcept +{ + for (UINT z = 0; z < NumSlices; ++z) + { + auto pDestSlice = static_cast<BYTE*>(pDest->pData) + pDest->SlicePitch * z; + auto pSrcSlice = (static_cast<const BYTE*>(pResourceData) + pSrc->Offset) + pSrc->DepthPitch * ULONG_PTR(z); + for (UINT y = 0; y < NumRows; ++y) + { + memcpy(pDestSlice + pDest->RowPitch * y, + pSrcSlice + pSrc->RowPitch * ULONG_PTR(y), + RowSizeInBytes); + } + } +} + +//------------------------------------------------------------------------------------------------ +// Returns required size of a buffer to be used for data upload +inline UINT64 GetRequiredIntermediateSize( + _In_ ID3D12Resource* pDestinationResource, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources) noexcept +{ + const auto Desc = pDestinationResource->GetDesc(); + UINT64 RequiredSize = 0; + + ID3D12Device* pDevice = nullptr; + pDestinationResource->GetDevice(IID_ID3D12Device, reinterpret_cast<void**>(&pDevice)); + pDevice->GetCopyableFootprints(&Desc, FirstSubresource, NumSubresources, 0, nullptr, nullptr, nullptr, &RequiredSize); + pDevice->Release(); + + return RequiredSize; +} + +//------------------------------------------------------------------------------------------------ +// All arrays must be populated (e.g. by calling GetCopyableFootprints) +inline UINT64 UpdateSubresources( + _In_ ID3D12GraphicsCommandList* pCmdList, + _In_ ID3D12Resource* pDestinationResource, + _In_ ID3D12Resource* pIntermediate, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 RequiredSize, + _In_reads_(NumSubresources) const D3D12_PLACED_SUBRESOURCE_FOOTPRINT* pLayouts, + _In_reads_(NumSubresources) const UINT* pNumRows, + _In_reads_(NumSubresources) const UINT64* pRowSizesInBytes, + _In_reads_(NumSubresources) const D3D12_SUBRESOURCE_DATA* pSrcData) noexcept +{ + // Minor validation + const auto IntermediateDesc = pIntermediate->GetDesc(); + const auto DestinationDesc = pDestinationResource->GetDesc(); + if (IntermediateDesc.Dimension != D3D12_RESOURCE_DIMENSION_BUFFER || + IntermediateDesc.Width < RequiredSize + pLayouts[0].Offset || + RequiredSize > SIZE_T(-1) || + (DestinationDesc.Dimension == D3D12_RESOURCE_DIMENSION_BUFFER && + (FirstSubresource != 0 || NumSubresources != 1))) + { + return 0; + } + + BYTE* pData; + HRESULT hr = pIntermediate->Map(0, nullptr, reinterpret_cast<void**>(&pData)); + if (FAILED(hr)) + { + return 0; + } + + for (UINT i = 0; i < NumSubresources; ++i) + { + if (pRowSizesInBytes[i] > SIZE_T(-1)) return 0; + D3D12_MEMCPY_DEST DestData = { pData + pLayouts[i].Offset, pLayouts[i].Footprint.RowPitch, SIZE_T(pLayouts[i].Footprint.RowPitch) * SIZE_T(pNumRows[i]) }; + MemcpySubresource(&DestData, &pSrcData[i], static_cast<SIZE_T>(pRowSizesInBytes[i]), pNumRows[i], pLayouts[i].Footprint.Depth); + } + pIntermediate->Unmap(0, nullptr); + + if (DestinationDesc.Dimension == D3D12_RESOURCE_DIMENSION_BUFFER) + { + pCmdList->CopyBufferRegion( + pDestinationResource, 0, pIntermediate, pLayouts[0].Offset, pLayouts[0].Footprint.Width); + } + else + { + for (UINT i = 0; i < NumSubresources; ++i) + { + const CD3DX12_TEXTURE_COPY_LOCATION Dst(pDestinationResource, i + FirstSubresource); + const CD3DX12_TEXTURE_COPY_LOCATION Src(pIntermediate, pLayouts[i]); + pCmdList->CopyTextureRegion(&Dst, 0, 0, 0, &Src, nullptr); + } + } + return RequiredSize; +} + +//------------------------------------------------------------------------------------------------ +// All arrays must be populated (e.g. by calling GetCopyableFootprints) +inline UINT64 UpdateSubresources( + _In_ ID3D12GraphicsCommandList* pCmdList, + _In_ ID3D12Resource* pDestinationResource, + _In_ ID3D12Resource* pIntermediate, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + UINT64 RequiredSize, + _In_reads_(NumSubresources) const D3D12_PLACED_SUBRESOURCE_FOOTPRINT* pLayouts, + _In_reads_(NumSubresources) const UINT* pNumRows, + _In_reads_(NumSubresources) const UINT64* pRowSizesInBytes, + _In_ const void* pResourceData, + _In_reads_(NumSubresources) const D3D12_SUBRESOURCE_INFO* pSrcData) noexcept +{ + // Minor validation + const auto IntermediateDesc = pIntermediate->GetDesc(); + const auto DestinationDesc = pDestinationResource->GetDesc(); + if (IntermediateDesc.Dimension != D3D12_RESOURCE_DIMENSION_BUFFER || + IntermediateDesc.Width < RequiredSize + pLayouts[0].Offset || + RequiredSize > SIZE_T(-1) || + (DestinationDesc.Dimension == D3D12_RESOURCE_DIMENSION_BUFFER && + (FirstSubresource != 0 || NumSubresources != 1))) + { + return 0; + } + + BYTE* pData; + HRESULT hr = pIntermediate->Map(0, nullptr, reinterpret_cast<void**>(&pData)); + if (FAILED(hr)) + { + return 0; + } + + for (UINT i = 0; i < NumSubresources; ++i) + { + if (pRowSizesInBytes[i] > SIZE_T(-1)) return 0; + D3D12_MEMCPY_DEST DestData = { pData + pLayouts[i].Offset, pLayouts[i].Footprint.RowPitch, SIZE_T(pLayouts[i].Footprint.RowPitch) * SIZE_T(pNumRows[i]) }; + MemcpySubresource(&DestData, pResourceData, &pSrcData[i], static_cast<SIZE_T>(pRowSizesInBytes[i]), pNumRows[i], pLayouts[i].Footprint.Depth); + } + pIntermediate->Unmap(0, nullptr); + + if (DestinationDesc.Dimension == D3D12_RESOURCE_DIMENSION_BUFFER) + { + pCmdList->CopyBufferRegion( + pDestinationResource, 0, pIntermediate, pLayouts[0].Offset, pLayouts[0].Footprint.Width); + } + else + { + for (UINT i = 0; i < NumSubresources; ++i) + { + const CD3DX12_TEXTURE_COPY_LOCATION Dst(pDestinationResource, i + FirstSubresource); + const CD3DX12_TEXTURE_COPY_LOCATION Src(pIntermediate, pLayouts[i]); + pCmdList->CopyTextureRegion(&Dst, 0, 0, 0, &Src, nullptr); + } + } + return RequiredSize; +} + +//------------------------------------------------------------------------------------------------ +// Heap-allocating UpdateSubresources implementation +inline UINT64 UpdateSubresources( + _In_ ID3D12GraphicsCommandList* pCmdList, + _In_ ID3D12Resource* pDestinationResource, + _In_ ID3D12Resource* pIntermediate, + UINT64 IntermediateOffset, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + _In_reads_(NumSubresources) const D3D12_SUBRESOURCE_DATA* pSrcData) noexcept +{ + UINT64 RequiredSize = 0; + const auto MemToAlloc = static_cast<UINT64>(sizeof(D3D12_PLACED_SUBRESOURCE_FOOTPRINT) + sizeof(UINT) + sizeof(UINT64)) * NumSubresources; + if (MemToAlloc > SIZE_MAX) + { + return 0; + } + void* pMem = HeapAlloc(GetProcessHeap(), 0, static_cast<SIZE_T>(MemToAlloc)); + if (pMem == nullptr) + { + return 0; + } + auto pLayouts = static_cast<D3D12_PLACED_SUBRESOURCE_FOOTPRINT*>(pMem); + auto pRowSizesInBytes = reinterpret_cast<UINT64*>(pLayouts + NumSubresources); + auto pNumRows = reinterpret_cast<UINT*>(pRowSizesInBytes + NumSubresources); + + const auto Desc = pDestinationResource->GetDesc(); + ID3D12Device* pDevice = nullptr; + pDestinationResource->GetDevice(IID_ID3D12Device, reinterpret_cast<void**>(&pDevice)); + pDevice->GetCopyableFootprints(&Desc, FirstSubresource, NumSubresources, IntermediateOffset, pLayouts, pNumRows, pRowSizesInBytes, &RequiredSize); + pDevice->Release(); + + const UINT64 Result = UpdateSubresources(pCmdList, pDestinationResource, pIntermediate, FirstSubresource, NumSubresources, RequiredSize, pLayouts, pNumRows, pRowSizesInBytes, pSrcData); + HeapFree(GetProcessHeap(), 0, pMem); + return Result; +} + +//------------------------------------------------------------------------------------------------ +// Heap-allocating UpdateSubresources implementation +inline UINT64 UpdateSubresources( + _In_ ID3D12GraphicsCommandList* pCmdList, + _In_ ID3D12Resource* pDestinationResource, + _In_ ID3D12Resource* pIntermediate, + UINT64 IntermediateOffset, + _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource, + _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources, + _In_ const void* pResourceData, + _In_reads_(NumSubresources) const D3D12_SUBRESOURCE_INFO* pSrcData) noexcept +{ + UINT64 RequiredSize = 0; + const auto MemToAlloc = static_cast<UINT64>(sizeof(D3D12_PLACED_SUBRESOURCE_FOOTPRINT) + sizeof(UINT) + sizeof(UINT64)) * NumSubresources; + if (MemToAlloc > SIZE_MAX) + { + return 0; + } + void* pMem = HeapAlloc(GetProcessHeap(), 0, static_cast<SIZE_T>(MemToAlloc)); + if (pMem == nullptr) + { + return 0; + } + auto pLayouts = static_cast<D3D12_PLACED_SUBRESOURCE_FOOTPRINT*>(pMem); + auto pRowSizesInBytes = reinterpret_cast<UINT64*>(pLayouts + NumSubresources); + auto pNumRows = reinterpret_cast<UINT*>(pRowSizesInBytes + NumSubresources); + + const auto Desc = pDestinationResource->GetDesc(); + ID3D12Device* pDevice = nullptr; + pDestinationResource->GetDevice(IID_ID3D12Device, reinterpret_cast<void**>(&pDevice)); + pDevice->GetCopyableFootprints(&Desc, FirstSubresource, NumSubresources, IntermediateOffset, pLayouts, pNumRows, pRowSizesInBytes, &RequiredSize); + pDevice->Release(); + + const UINT64 Result = UpdateSubresources(pCmdList, pDestinationResource, pIntermediate, FirstSubresource, NumSubresources, RequiredSize, pLayouts, pNumRows, pRowSizesInBytes, pResourceData, pSrcData); + HeapFree(GetProcessHeap(), 0, pMem); + return Result; +} + +//------------------------------------------------------------------------------------------------ +// Stack-allocating UpdateSubresources implementation +template <UINT MaxSubresources> +inline UINT64 UpdateSubresources( + _In_ ID3D12GraphicsCommandList* pCmdList, + _In_ ID3D12Resource* pDestinationResource, + _In_ ID3D12Resource* pIntermediate, + UINT64 IntermediateOffset, + _In_range_(0,MaxSubresources) UINT FirstSubresource, + _In_range_(1,MaxSubresources-FirstSubresource) UINT NumSubresources, + _In_reads_(NumSubresources) const D3D12_SUBRESOURCE_DATA* pSrcData) noexcept +{ + UINT64 RequiredSize = 0; + D3D12_PLACED_SUBRESOURCE_FOOTPRINT Layouts[MaxSubresources]; + UINT NumRows[MaxSubresources]; + UINT64 RowSizesInBytes[MaxSubresources]; + + const auto Desc = pDestinationResource->GetDesc(); + ID3D12Device* pDevice = nullptr; + pDestinationResource->GetDevice(IID_ID3D12Device, reinterpret_cast<void**>(&pDevice)); + pDevice->GetCopyableFootprints(&Desc, FirstSubresource, NumSubresources, IntermediateOffset, Layouts, NumRows, RowSizesInBytes, &RequiredSize); + pDevice->Release(); + + return UpdateSubresources(pCmdList, pDestinationResource, pIntermediate, FirstSubresource, NumSubresources, RequiredSize, Layouts, NumRows, RowSizesInBytes, pSrcData); +} + +//------------------------------------------------------------------------------------------------ +// Stack-allocating UpdateSubresources implementation +template <UINT MaxSubresources> +inline UINT64 UpdateSubresources( + _In_ ID3D12GraphicsCommandList* pCmdList, + _In_ ID3D12Resource* pDestinationResource, + _In_ ID3D12Resource* pIntermediate, + UINT64 IntermediateOffset, + _In_range_(0,MaxSubresources) UINT FirstSubresource, + _In_range_(1,MaxSubresources-FirstSubresource) UINT NumSubresources, + _In_ const void* pResourceData, + _In_reads_(NumSubresources) const D3D12_SUBRESOURCE_INFO* pSrcData) noexcept +{ + UINT64 RequiredSize = 0; + D3D12_PLACED_SUBRESOURCE_FOOTPRINT Layouts[MaxSubresources]; + UINT NumRows[MaxSubresources]; + UINT64 RowSizesInBytes[MaxSubresources]; + + const auto Desc = pDestinationResource->GetDesc(); + ID3D12Device* pDevice = nullptr; + pDestinationResource->GetDevice(IID_ID3D12Device, reinterpret_cast<void**>(&pDevice)); + pDevice->GetCopyableFootprints(&Desc, FirstSubresource, NumSubresources, IntermediateOffset, Layouts, NumRows, RowSizesInBytes, &RequiredSize); + pDevice->Release(); + + return UpdateSubresources(pCmdList, pDestinationResource, pIntermediate, FirstSubresource, NumSubresources, RequiredSize, Layouts, NumRows, RowSizesInBytes, pResourceData, pSrcData); +} + +//------------------------------------------------------------------------------------------------ +constexpr bool D3D12IsLayoutOpaque( D3D12_TEXTURE_LAYOUT Layout ) noexcept +{ return Layout == D3D12_TEXTURE_LAYOUT_UNKNOWN || Layout == D3D12_TEXTURE_LAYOUT_64KB_UNDEFINED_SWIZZLE; } + +//------------------------------------------------------------------------------------------------ +template <typename t_CommandListType> +inline ID3D12CommandList * const * CommandListCast(t_CommandListType * const * pp) noexcept +{ + // This cast is useful for passing strongly typed command list pointers into + // ExecuteCommandLists. + // This cast is valid as long as the const-ness is respected. D3D12 APIs do + // respect the const-ness of their arguments. + return reinterpret_cast<ID3D12CommandList * const *>(pp); +} + +//------------------------------------------------------------------------------------------------ +// D3D12 exports a new method for serializing root signatures in the Windows 10 Anniversary Update. +// To help enable root signature 1.1 features when they are available and not require maintaining +// two code paths for building root signatures, this helper method reconstructs a 1.0 signature when +// 1.1 is not supported. +inline HRESULT D3DX12SerializeVersionedRootSignature( + _In_ const D3D12_VERSIONED_ROOT_SIGNATURE_DESC* pRootSignatureDesc, + D3D_ROOT_SIGNATURE_VERSION MaxVersion, + _Outptr_ ID3DBlob** ppBlob, + _Always_(_Outptr_opt_result_maybenull_) ID3DBlob** ppErrorBlob) noexcept +{ + if (ppErrorBlob != nullptr) + { + *ppErrorBlob = nullptr; + } + + switch (MaxVersion) + { + case D3D_ROOT_SIGNATURE_VERSION_1_0: + switch (pRootSignatureDesc->Version) + { + case D3D_ROOT_SIGNATURE_VERSION_1_0: + return D3D12SerializeRootSignature(&pRootSignatureDesc->Desc_1_0, D3D_ROOT_SIGNATURE_VERSION_1, ppBlob, ppErrorBlob); + + case D3D_ROOT_SIGNATURE_VERSION_1_1: + { + HRESULT hr = S_OK; + const D3D12_ROOT_SIGNATURE_DESC1& desc_1_1 = pRootSignatureDesc->Desc_1_1; + + const SIZE_T ParametersSize = sizeof(D3D12_ROOT_PARAMETER) * desc_1_1.NumParameters; + void* pParameters = (ParametersSize > 0) ? HeapAlloc(GetProcessHeap(), 0, ParametersSize) : nullptr; + if (ParametersSize > 0 && pParameters == nullptr) + { + hr = E_OUTOFMEMORY; + } + auto pParameters_1_0 = static_cast<D3D12_ROOT_PARAMETER*>(pParameters); + + if (SUCCEEDED(hr)) + { + for (UINT n = 0; n < desc_1_1.NumParameters; n++) + { + __analysis_assume(ParametersSize == sizeof(D3D12_ROOT_PARAMETER) * desc_1_1.NumParameters); + pParameters_1_0[n].ParameterType = desc_1_1.pParameters[n].ParameterType; + pParameters_1_0[n].ShaderVisibility = desc_1_1.pParameters[n].ShaderVisibility; + + switch (desc_1_1.pParameters[n].ParameterType) + { + case D3D12_ROOT_PARAMETER_TYPE_32BIT_CONSTANTS: + pParameters_1_0[n].Constants.Num32BitValues = desc_1_1.pParameters[n].Constants.Num32BitValues; + pParameters_1_0[n].Constants.RegisterSpace = desc_1_1.pParameters[n].Constants.RegisterSpace; + pParameters_1_0[n].Constants.ShaderRegister = desc_1_1.pParameters[n].Constants.ShaderRegister; + break; + + case D3D12_ROOT_PARAMETER_TYPE_CBV: + case D3D12_ROOT_PARAMETER_TYPE_SRV: + case D3D12_ROOT_PARAMETER_TYPE_UAV: + pParameters_1_0[n].Descriptor.RegisterSpace = desc_1_1.pParameters[n].Descriptor.RegisterSpace; + pParameters_1_0[n].Descriptor.ShaderRegister = desc_1_1.pParameters[n].Descriptor.ShaderRegister; + break; + + case D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE: + const D3D12_ROOT_DESCRIPTOR_TABLE1& table_1_1 = desc_1_1.pParameters[n].DescriptorTable; + + const SIZE_T DescriptorRangesSize = sizeof(D3D12_DESCRIPTOR_RANGE) * table_1_1.NumDescriptorRanges; + void* pDescriptorRanges = (DescriptorRangesSize > 0 && SUCCEEDED(hr)) ? HeapAlloc(GetProcessHeap(), 0, DescriptorRangesSize) : nullptr; + if (DescriptorRangesSize > 0 && pDescriptorRanges == nullptr) + { + hr = E_OUTOFMEMORY; + } + auto pDescriptorRanges_1_0 = static_cast<D3D12_DESCRIPTOR_RANGE*>(pDescriptorRanges); + + if (SUCCEEDED(hr)) + { + for (UINT x = 0; x < table_1_1.NumDescriptorRanges; x++) + { + __analysis_assume(DescriptorRangesSize == sizeof(D3D12_DESCRIPTOR_RANGE) * table_1_1.NumDescriptorRanges); + pDescriptorRanges_1_0[x].BaseShaderRegister = table_1_1.pDescriptorRanges[x].BaseShaderRegister; + pDescriptorRanges_1_0[x].NumDescriptors = table_1_1.pDescriptorRanges[x].NumDescriptors; + pDescriptorRanges_1_0[x].OffsetInDescriptorsFromTableStart = table_1_1.pDescriptorRanges[x].OffsetInDescriptorsFromTableStart; + pDescriptorRanges_1_0[x].RangeType = table_1_1.pDescriptorRanges[x].RangeType; + pDescriptorRanges_1_0[x].RegisterSpace = table_1_1.pDescriptorRanges[x].RegisterSpace; + } + } + + D3D12_ROOT_DESCRIPTOR_TABLE& table_1_0 = pParameters_1_0[n].DescriptorTable; + table_1_0.NumDescriptorRanges = table_1_1.NumDescriptorRanges; + table_1_0.pDescriptorRanges = pDescriptorRanges_1_0; + } + } + } + + if (SUCCEEDED(hr)) + { + const CD3DX12_ROOT_SIGNATURE_DESC desc_1_0(desc_1_1.NumParameters, pParameters_1_0, desc_1_1.NumStaticSamplers, desc_1_1.pStaticSamplers, desc_1_1.Flags); + hr = D3D12SerializeRootSignature(&desc_1_0, D3D_ROOT_SIGNATURE_VERSION_1, ppBlob, ppErrorBlob); + } + + if (pParameters) + { + for (UINT n = 0; n < desc_1_1.NumParameters; n++) + { + if (desc_1_1.pParameters[n].ParameterType == D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE) + { + auto pDescriptorRanges_1_0 = pParameters_1_0[n].DescriptorTable.pDescriptorRanges; + HeapFree(GetProcessHeap(), 0, reinterpret_cast<void*>(const_cast<D3D12_DESCRIPTOR_RANGE*>(pDescriptorRanges_1_0))); + } + } + HeapFree(GetProcessHeap(), 0, pParameters); + } + return hr; + } + } + break; + + case D3D_ROOT_SIGNATURE_VERSION_1_1: + return D3D12SerializeVersionedRootSignature(pRootSignatureDesc, ppBlob, ppErrorBlob); + } + + return E_INVALIDARG; +} + +//------------------------------------------------------------------------------------------------ +struct CD3DX12_RT_FORMAT_ARRAY : public D3D12_RT_FORMAT_ARRAY +{ + CD3DX12_RT_FORMAT_ARRAY() = default; + explicit CD3DX12_RT_FORMAT_ARRAY(const D3D12_RT_FORMAT_ARRAY& o) noexcept + : D3D12_RT_FORMAT_ARRAY(o) + {} + explicit CD3DX12_RT_FORMAT_ARRAY(_In_reads_(NumFormats) const DXGI_FORMAT* pFormats, UINT NumFormats) noexcept + { + NumRenderTargets = NumFormats; + memcpy(RTFormats, pFormats, sizeof(RTFormats)); + // assumes ARRAY_SIZE(pFormats) == ARRAY_SIZE(RTFormats) + } +}; + +//------------------------------------------------------------------------------------------------ +// Pipeline State Stream Helpers +//------------------------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------------------------ +// Stream Subobjects, i.e. elements of a stream + +struct DefaultSampleMask { operator UINT() noexcept { return UINT_MAX; } }; +struct DefaultSampleDesc { operator DXGI_SAMPLE_DESC() noexcept { return DXGI_SAMPLE_DESC{1, 0}; } }; + +#pragma warning(push) +#pragma warning(disable : 4324) +template <typename InnerStructType, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE Type, typename DefaultArg = InnerStructType> +class alignas(void*) CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT +{ +private: + D3D12_PIPELINE_STATE_SUBOBJECT_TYPE pssType; + InnerStructType pssInner; +public: + CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT() noexcept : pssType(Type), pssInner(DefaultArg()) {} + CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT(InnerStructType const& i) noexcept : pssType(Type), pssInner(i) {} + CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT& operator=(InnerStructType const& i) noexcept { pssType = Type; pssInner = i; return *this; } + operator InnerStructType const&() const noexcept { return pssInner; } + operator InnerStructType&() noexcept { return pssInner; } + InnerStructType* operator&() noexcept { return &pssInner; } + InnerStructType const* operator&() const noexcept { return &pssInner; } +}; +#pragma warning(pop) +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_PIPELINE_STATE_FLAGS, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_FLAGS> CD3DX12_PIPELINE_STATE_STREAM_FLAGS; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< UINT, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_NODE_MASK> CD3DX12_PIPELINE_STATE_STREAM_NODE_MASK; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< ID3D12RootSignature*, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_ROOT_SIGNATURE> CD3DX12_PIPELINE_STATE_STREAM_ROOT_SIGNATURE; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_INPUT_LAYOUT_DESC, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_INPUT_LAYOUT> CD3DX12_PIPELINE_STATE_STREAM_INPUT_LAYOUT; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_INDEX_BUFFER_STRIP_CUT_VALUE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_IB_STRIP_CUT_VALUE> CD3DX12_PIPELINE_STATE_STREAM_IB_STRIP_CUT_VALUE; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_PRIMITIVE_TOPOLOGY_TYPE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_PRIMITIVE_TOPOLOGY> CD3DX12_PIPELINE_STATE_STREAM_PRIMITIVE_TOPOLOGY; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_SHADER_BYTECODE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_VS> CD3DX12_PIPELINE_STATE_STREAM_VS; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_SHADER_BYTECODE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_GS> CD3DX12_PIPELINE_STATE_STREAM_GS; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_STREAM_OUTPUT_DESC, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_STREAM_OUTPUT> CD3DX12_PIPELINE_STATE_STREAM_STREAM_OUTPUT; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_SHADER_BYTECODE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_HS> CD3DX12_PIPELINE_STATE_STREAM_HS; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_SHADER_BYTECODE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DS> CD3DX12_PIPELINE_STATE_STREAM_DS; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_SHADER_BYTECODE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_PS> CD3DX12_PIPELINE_STATE_STREAM_PS; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_SHADER_BYTECODE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_AS> CD3DX12_PIPELINE_STATE_STREAM_AS; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_SHADER_BYTECODE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MS> CD3DX12_PIPELINE_STATE_STREAM_MS; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_SHADER_BYTECODE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_CS> CD3DX12_PIPELINE_STATE_STREAM_CS; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< CD3DX12_BLEND_DESC, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_BLEND, CD3DX12_DEFAULT> CD3DX12_PIPELINE_STATE_STREAM_BLEND_DESC; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< CD3DX12_DEPTH_STENCIL_DESC, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL, CD3DX12_DEFAULT> CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< CD3DX12_DEPTH_STENCIL_DESC1, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL1, CD3DX12_DEFAULT> CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL1; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< CD3DX12_DEPTH_STENCIL_DESC2, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL2, CD3DX12_DEFAULT> CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL2; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< DXGI_FORMAT, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL_FORMAT> CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL_FORMAT; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< CD3DX12_RASTERIZER_DESC, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RASTERIZER, CD3DX12_DEFAULT> CD3DX12_PIPELINE_STATE_STREAM_RASTERIZER; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_RT_FORMAT_ARRAY, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RENDER_TARGET_FORMATS> CD3DX12_PIPELINE_STATE_STREAM_RENDER_TARGET_FORMATS; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< DXGI_SAMPLE_DESC, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_SAMPLE_DESC, DefaultSampleDesc> CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_DESC; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< UINT, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_SAMPLE_MASK, DefaultSampleMask> CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_MASK; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< D3D12_CACHED_PIPELINE_STATE, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_CACHED_PSO> CD3DX12_PIPELINE_STATE_STREAM_CACHED_PSO; +typedef CD3DX12_PIPELINE_STATE_STREAM_SUBOBJECT< CD3DX12_VIEW_INSTANCING_DESC, D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_VIEW_INSTANCING, CD3DX12_DEFAULT> CD3DX12_PIPELINE_STATE_STREAM_VIEW_INSTANCING; + +//------------------------------------------------------------------------------------------------ +// Stream Parser Helpers + +struct ID3DX12PipelineParserCallbacks +{ + // Subobject Callbacks + virtual void FlagsCb(D3D12_PIPELINE_STATE_FLAGS) {} + virtual void NodeMaskCb(UINT) {} + virtual void RootSignatureCb(ID3D12RootSignature*) {} + virtual void InputLayoutCb(const D3D12_INPUT_LAYOUT_DESC&) {} + virtual void IBStripCutValueCb(D3D12_INDEX_BUFFER_STRIP_CUT_VALUE) {} + virtual void PrimitiveTopologyTypeCb(D3D12_PRIMITIVE_TOPOLOGY_TYPE) {} + virtual void VSCb(const D3D12_SHADER_BYTECODE&) {} + virtual void GSCb(const D3D12_SHADER_BYTECODE&) {} + virtual void StreamOutputCb(const D3D12_STREAM_OUTPUT_DESC&) {} + virtual void HSCb(const D3D12_SHADER_BYTECODE&) {} + virtual void DSCb(const D3D12_SHADER_BYTECODE&) {} + virtual void PSCb(const D3D12_SHADER_BYTECODE&) {} + virtual void CSCb(const D3D12_SHADER_BYTECODE&) {} + virtual void ASCb(const D3D12_SHADER_BYTECODE&) {} + virtual void MSCb(const D3D12_SHADER_BYTECODE&) {} + virtual void BlendStateCb(const D3D12_BLEND_DESC&) {} + virtual void DepthStencilStateCb(const D3D12_DEPTH_STENCIL_DESC&) {} + virtual void DepthStencilState1Cb(const D3D12_DEPTH_STENCIL_DESC1&) {} + virtual void DepthStencilState2Cb(const D3D12_DEPTH_STENCIL_DESC2&) {} + virtual void DSVFormatCb(DXGI_FORMAT) {} + virtual void RasterizerStateCb(const D3D12_RASTERIZER_DESC&) {} + virtual void RTVFormatsCb(const D3D12_RT_FORMAT_ARRAY&) {} + virtual void SampleDescCb(const DXGI_SAMPLE_DESC&) {} + virtual void SampleMaskCb(UINT) {} + virtual void ViewInstancingCb(const D3D12_VIEW_INSTANCING_DESC&) {} + virtual void CachedPSOCb(const D3D12_CACHED_PIPELINE_STATE&) {} + + // Error Callbacks + virtual void ErrorBadInputParameter(UINT /*ParameterIndex*/) {} + virtual void ErrorDuplicateSubobject(D3D12_PIPELINE_STATE_SUBOBJECT_TYPE /*DuplicateType*/) {} + virtual void ErrorUnknownSubobject(UINT /*UnknownTypeValue*/) {} + + virtual ~ID3DX12PipelineParserCallbacks() = default; +}; + +struct D3DX12_MESH_SHADER_PIPELINE_STATE_DESC +{ + ID3D12RootSignature* pRootSignature; + D3D12_SHADER_BYTECODE AS; + D3D12_SHADER_BYTECODE MS; + D3D12_SHADER_BYTECODE PS; + D3D12_BLEND_DESC BlendState; + UINT SampleMask; + D3D12_RASTERIZER_DESC RasterizerState; + D3D12_DEPTH_STENCIL_DESC DepthStencilState; + D3D12_PRIMITIVE_TOPOLOGY_TYPE PrimitiveTopologyType; + UINT NumRenderTargets; + DXGI_FORMAT RTVFormats[ D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT ]; + DXGI_FORMAT DSVFormat; + DXGI_SAMPLE_DESC SampleDesc; + UINT NodeMask; + D3D12_CACHED_PIPELINE_STATE CachedPSO; + D3D12_PIPELINE_STATE_FLAGS Flags; +}; + + +// Use CD3DX12_PIPELINE_STATE_STREAM3 for D3D12_DEPTH_STENCIL_DESC2 when CheckFeatureSupport returns true for Options14::IndependentFrontAndBackStencilSupported is true +// Use CD3DX12_PIPELINE_STATE_STREAM2 for OS Build 19041+ (where there is a new mesh shader pipeline). +// Use CD3DX12_PIPELINE_STATE_STREAM1 for OS Build 16299+ (where there is a new view instancing subobject). +// Use CD3DX12_PIPELINE_STATE_STREAM for OS Build 15063+ support. +struct CD3DX12_PIPELINE_STATE_STREAM3 +{ + CD3DX12_PIPELINE_STATE_STREAM3() = default; + // Mesh and amplification shaders must be set manually, since they do not have representation in D3D12_GRAPHICS_PIPELINE_STATE_DESC + CD3DX12_PIPELINE_STATE_STREAM3(const D3D12_GRAPHICS_PIPELINE_STATE_DESC& Desc) noexcept + : Flags(Desc.Flags) + , NodeMask(Desc.NodeMask) + , pRootSignature(Desc.pRootSignature) + , InputLayout(Desc.InputLayout) + , IBStripCutValue(Desc.IBStripCutValue) + , PrimitiveTopologyType(Desc.PrimitiveTopologyType) + , VS(Desc.VS) + , GS(Desc.GS) + , StreamOutput(Desc.StreamOutput) + , HS(Desc.HS) + , DS(Desc.DS) + , PS(Desc.PS) + , BlendState(CD3DX12_BLEND_DESC(Desc.BlendState)) + , DepthStencilState(CD3DX12_DEPTH_STENCIL_DESC2(Desc.DepthStencilState)) + , DSVFormat(Desc.DSVFormat) + , RasterizerState(CD3DX12_RASTERIZER_DESC(Desc.RasterizerState)) + , RTVFormats(CD3DX12_RT_FORMAT_ARRAY(Desc.RTVFormats, Desc.NumRenderTargets)) + , SampleDesc(Desc.SampleDesc) + , SampleMask(Desc.SampleMask) + , CachedPSO(Desc.CachedPSO) + , ViewInstancingDesc(CD3DX12_VIEW_INSTANCING_DESC(CD3DX12_DEFAULT())) + {} + CD3DX12_PIPELINE_STATE_STREAM3(const D3DX12_MESH_SHADER_PIPELINE_STATE_DESC& Desc) noexcept + : Flags(Desc.Flags) + , NodeMask(Desc.NodeMask) + , pRootSignature(Desc.pRootSignature) + , PrimitiveTopologyType(Desc.PrimitiveTopologyType) + , PS(Desc.PS) + , AS(Desc.AS) + , MS(Desc.MS) + , BlendState(CD3DX12_BLEND_DESC(Desc.BlendState)) + , DepthStencilState(CD3DX12_DEPTH_STENCIL_DESC2(Desc.DepthStencilState)) + , DSVFormat(Desc.DSVFormat) + , RasterizerState(CD3DX12_RASTERIZER_DESC(Desc.RasterizerState)) + , RTVFormats(CD3DX12_RT_FORMAT_ARRAY(Desc.RTVFormats, Desc.NumRenderTargets)) + , SampleDesc(Desc.SampleDesc) + , SampleMask(Desc.SampleMask) + , CachedPSO(Desc.CachedPSO) + , ViewInstancingDesc(CD3DX12_VIEW_INSTANCING_DESC(CD3DX12_DEFAULT())) + {} + CD3DX12_PIPELINE_STATE_STREAM3(const D3D12_COMPUTE_PIPELINE_STATE_DESC& Desc) noexcept + : Flags(Desc.Flags) + , NodeMask(Desc.NodeMask) + , pRootSignature(Desc.pRootSignature) + , CS(CD3DX12_SHADER_BYTECODE(Desc.CS)) + , CachedPSO(Desc.CachedPSO) + { + static_cast<D3D12_DEPTH_STENCIL_DESC2&>(DepthStencilState).DepthEnable = false; + } + CD3DX12_PIPELINE_STATE_STREAM_FLAGS Flags; + CD3DX12_PIPELINE_STATE_STREAM_NODE_MASK NodeMask; + CD3DX12_PIPELINE_STATE_STREAM_ROOT_SIGNATURE pRootSignature; + CD3DX12_PIPELINE_STATE_STREAM_INPUT_LAYOUT InputLayout; + CD3DX12_PIPELINE_STATE_STREAM_IB_STRIP_CUT_VALUE IBStripCutValue; + CD3DX12_PIPELINE_STATE_STREAM_PRIMITIVE_TOPOLOGY PrimitiveTopologyType; + CD3DX12_PIPELINE_STATE_STREAM_VS VS; + CD3DX12_PIPELINE_STATE_STREAM_GS GS; + CD3DX12_PIPELINE_STATE_STREAM_STREAM_OUTPUT StreamOutput; + CD3DX12_PIPELINE_STATE_STREAM_HS HS; + CD3DX12_PIPELINE_STATE_STREAM_DS DS; + CD3DX12_PIPELINE_STATE_STREAM_PS PS; + CD3DX12_PIPELINE_STATE_STREAM_AS AS; + CD3DX12_PIPELINE_STATE_STREAM_MS MS; + CD3DX12_PIPELINE_STATE_STREAM_CS CS; + CD3DX12_PIPELINE_STATE_STREAM_BLEND_DESC BlendState; + CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL2 DepthStencilState; + CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL_FORMAT DSVFormat; + CD3DX12_PIPELINE_STATE_STREAM_RASTERIZER RasterizerState; + CD3DX12_PIPELINE_STATE_STREAM_RENDER_TARGET_FORMATS RTVFormats; + CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_DESC SampleDesc; + CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_MASK SampleMask; + CD3DX12_PIPELINE_STATE_STREAM_CACHED_PSO CachedPSO; + CD3DX12_PIPELINE_STATE_STREAM_VIEW_INSTANCING ViewInstancingDesc; + + D3D12_GRAPHICS_PIPELINE_STATE_DESC GraphicsDescV0() const noexcept + { + D3D12_GRAPHICS_PIPELINE_STATE_DESC D; + D.Flags = this->Flags; + D.NodeMask = this->NodeMask; + D.pRootSignature = this->pRootSignature; + D.InputLayout = this->InputLayout; + D.IBStripCutValue = this->IBStripCutValue; + D.PrimitiveTopologyType = this->PrimitiveTopologyType; + D.VS = this->VS; + D.GS = this->GS; + D.StreamOutput = this->StreamOutput; + D.HS = this->HS; + D.DS = this->DS; + D.PS = this->PS; + D.BlendState = this->BlendState; + D.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC2(D3D12_DEPTH_STENCIL_DESC2(this->DepthStencilState)); + D.DSVFormat = this->DSVFormat; + D.RasterizerState = this->RasterizerState; + D.NumRenderTargets = D3D12_RT_FORMAT_ARRAY(this->RTVFormats).NumRenderTargets; + memcpy(D.RTVFormats, D3D12_RT_FORMAT_ARRAY(this->RTVFormats).RTFormats, sizeof(D.RTVFormats)); + D.SampleDesc = this->SampleDesc; + D.SampleMask = this->SampleMask; + D.CachedPSO = this->CachedPSO; + return D; + } + D3D12_COMPUTE_PIPELINE_STATE_DESC ComputeDescV0() const noexcept + { + D3D12_COMPUTE_PIPELINE_STATE_DESC D; + D.Flags = this->Flags; + D.NodeMask = this->NodeMask; + D.pRootSignature = this->pRootSignature; + D.CS = this->CS; + D.CachedPSO = this->CachedPSO; + return D; + } +}; + + +// CD3DX12_PIPELINE_STATE_STREAM2 Works on OS Build 19041+ (where there is a new mesh shader pipeline). +// Use CD3DX12_PIPELINE_STATE_STREAM1 for OS Build 16299+ (where there is a new view instancing subobject). +// Use CD3DX12_PIPELINE_STATE_STREAM for OS Build 15063+ support. +struct CD3DX12_PIPELINE_STATE_STREAM2 +{ + CD3DX12_PIPELINE_STATE_STREAM2() = default; + // Mesh and amplification shaders must be set manually, since they do not have representation in D3D12_GRAPHICS_PIPELINE_STATE_DESC + CD3DX12_PIPELINE_STATE_STREAM2(const D3D12_GRAPHICS_PIPELINE_STATE_DESC& Desc) noexcept + : Flags(Desc.Flags) + , NodeMask(Desc.NodeMask) + , pRootSignature(Desc.pRootSignature) + , InputLayout(Desc.InputLayout) + , IBStripCutValue(Desc.IBStripCutValue) + , PrimitiveTopologyType(Desc.PrimitiveTopologyType) + , VS(Desc.VS) + , GS(Desc.GS) + , StreamOutput(Desc.StreamOutput) + , HS(Desc.HS) + , DS(Desc.DS) + , PS(Desc.PS) + , BlendState(CD3DX12_BLEND_DESC(Desc.BlendState)) + , DepthStencilState(CD3DX12_DEPTH_STENCIL_DESC1(Desc.DepthStencilState)) + , DSVFormat(Desc.DSVFormat) + , RasterizerState(CD3DX12_RASTERIZER_DESC(Desc.RasterizerState)) + , RTVFormats(CD3DX12_RT_FORMAT_ARRAY(Desc.RTVFormats, Desc.NumRenderTargets)) + , SampleDesc(Desc.SampleDesc) + , SampleMask(Desc.SampleMask) + , CachedPSO(Desc.CachedPSO) + , ViewInstancingDesc(CD3DX12_VIEW_INSTANCING_DESC(CD3DX12_DEFAULT())) + {} + CD3DX12_PIPELINE_STATE_STREAM2(const D3DX12_MESH_SHADER_PIPELINE_STATE_DESC& Desc) noexcept + : Flags(Desc.Flags) + , NodeMask(Desc.NodeMask) + , pRootSignature(Desc.pRootSignature) + , PrimitiveTopologyType(Desc.PrimitiveTopologyType) + , PS(Desc.PS) + , AS(Desc.AS) + , MS(Desc.MS) + , BlendState(CD3DX12_BLEND_DESC(Desc.BlendState)) + , DepthStencilState(CD3DX12_DEPTH_STENCIL_DESC1(Desc.DepthStencilState)) + , DSVFormat(Desc.DSVFormat) + , RasterizerState(CD3DX12_RASTERIZER_DESC(Desc.RasterizerState)) + , RTVFormats(CD3DX12_RT_FORMAT_ARRAY(Desc.RTVFormats, Desc.NumRenderTargets)) + , SampleDesc(Desc.SampleDesc) + , SampleMask(Desc.SampleMask) + , CachedPSO(Desc.CachedPSO) + , ViewInstancingDesc(CD3DX12_VIEW_INSTANCING_DESC(CD3DX12_DEFAULT())) + {} + CD3DX12_PIPELINE_STATE_STREAM2(const D3D12_COMPUTE_PIPELINE_STATE_DESC& Desc) noexcept + : Flags(Desc.Flags) + , NodeMask(Desc.NodeMask) + , pRootSignature(Desc.pRootSignature) + , CS(CD3DX12_SHADER_BYTECODE(Desc.CS)) + , CachedPSO(Desc.CachedPSO) + { + static_cast<D3D12_DEPTH_STENCIL_DESC1&>(DepthStencilState).DepthEnable = false; + } + CD3DX12_PIPELINE_STATE_STREAM_FLAGS Flags; + CD3DX12_PIPELINE_STATE_STREAM_NODE_MASK NodeMask; + CD3DX12_PIPELINE_STATE_STREAM_ROOT_SIGNATURE pRootSignature; + CD3DX12_PIPELINE_STATE_STREAM_INPUT_LAYOUT InputLayout; + CD3DX12_PIPELINE_STATE_STREAM_IB_STRIP_CUT_VALUE IBStripCutValue; + CD3DX12_PIPELINE_STATE_STREAM_PRIMITIVE_TOPOLOGY PrimitiveTopologyType; + CD3DX12_PIPELINE_STATE_STREAM_VS VS; + CD3DX12_PIPELINE_STATE_STREAM_GS GS; + CD3DX12_PIPELINE_STATE_STREAM_STREAM_OUTPUT StreamOutput; + CD3DX12_PIPELINE_STATE_STREAM_HS HS; + CD3DX12_PIPELINE_STATE_STREAM_DS DS; + CD3DX12_PIPELINE_STATE_STREAM_PS PS; + CD3DX12_PIPELINE_STATE_STREAM_AS AS; + CD3DX12_PIPELINE_STATE_STREAM_MS MS; + CD3DX12_PIPELINE_STATE_STREAM_CS CS; + CD3DX12_PIPELINE_STATE_STREAM_BLEND_DESC BlendState; + CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL1 DepthStencilState; + CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL_FORMAT DSVFormat; + CD3DX12_PIPELINE_STATE_STREAM_RASTERIZER RasterizerState; + CD3DX12_PIPELINE_STATE_STREAM_RENDER_TARGET_FORMATS RTVFormats; + CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_DESC SampleDesc; + CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_MASK SampleMask; + CD3DX12_PIPELINE_STATE_STREAM_CACHED_PSO CachedPSO; + CD3DX12_PIPELINE_STATE_STREAM_VIEW_INSTANCING ViewInstancingDesc; + D3D12_GRAPHICS_PIPELINE_STATE_DESC GraphicsDescV0() const noexcept + { + D3D12_GRAPHICS_PIPELINE_STATE_DESC D; + D.Flags = this->Flags; + D.NodeMask = this->NodeMask; + D.pRootSignature = this->pRootSignature; + D.InputLayout = this->InputLayout; + D.IBStripCutValue = this->IBStripCutValue; + D.PrimitiveTopologyType = this->PrimitiveTopologyType; + D.VS = this->VS; + D.GS = this->GS; + D.StreamOutput = this->StreamOutput; + D.HS = this->HS; + D.DS = this->DS; + D.PS = this->PS; + D.BlendState = this->BlendState; + D.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC1(D3D12_DEPTH_STENCIL_DESC1(this->DepthStencilState)); + D.DSVFormat = this->DSVFormat; + D.RasterizerState = this->RasterizerState; + D.NumRenderTargets = D3D12_RT_FORMAT_ARRAY(this->RTVFormats).NumRenderTargets; + memcpy(D.RTVFormats, D3D12_RT_FORMAT_ARRAY(this->RTVFormats).RTFormats, sizeof(D.RTVFormats)); + D.SampleDesc = this->SampleDesc; + D.SampleMask = this->SampleMask; + D.CachedPSO = this->CachedPSO; + return D; + } + D3D12_COMPUTE_PIPELINE_STATE_DESC ComputeDescV0() const noexcept + { + D3D12_COMPUTE_PIPELINE_STATE_DESC D; + D.Flags = this->Flags; + D.NodeMask = this->NodeMask; + D.pRootSignature = this->pRootSignature; + D.CS = this->CS; + D.CachedPSO = this->CachedPSO; + return D; + } +}; + +// CD3DX12_PIPELINE_STATE_STREAM1 Works on OS Build 16299+ (where there is a new view instancing subobject). +// Use CD3DX12_PIPELINE_STATE_STREAM for OS Build 15063+ support. +struct CD3DX12_PIPELINE_STATE_STREAM1 +{ + CD3DX12_PIPELINE_STATE_STREAM1() = default; + // Mesh and amplification shaders must be set manually, since they do not have representation in D3D12_GRAPHICS_PIPELINE_STATE_DESC + CD3DX12_PIPELINE_STATE_STREAM1(const D3D12_GRAPHICS_PIPELINE_STATE_DESC& Desc) noexcept + : Flags(Desc.Flags) + , NodeMask(Desc.NodeMask) + , pRootSignature(Desc.pRootSignature) + , InputLayout(Desc.InputLayout) + , IBStripCutValue(Desc.IBStripCutValue) + , PrimitiveTopologyType(Desc.PrimitiveTopologyType) + , VS(Desc.VS) + , GS(Desc.GS) + , StreamOutput(Desc.StreamOutput) + , HS(Desc.HS) + , DS(Desc.DS) + , PS(Desc.PS) + , BlendState(CD3DX12_BLEND_DESC(Desc.BlendState)) + , DepthStencilState(CD3DX12_DEPTH_STENCIL_DESC1(Desc.DepthStencilState)) + , DSVFormat(Desc.DSVFormat) + , RasterizerState(CD3DX12_RASTERIZER_DESC(Desc.RasterizerState)) + , RTVFormats(CD3DX12_RT_FORMAT_ARRAY(Desc.RTVFormats, Desc.NumRenderTargets)) + , SampleDesc(Desc.SampleDesc) + , SampleMask(Desc.SampleMask) + , CachedPSO(Desc.CachedPSO) + , ViewInstancingDesc(CD3DX12_VIEW_INSTANCING_DESC(CD3DX12_DEFAULT())) + {} + CD3DX12_PIPELINE_STATE_STREAM1(const D3DX12_MESH_SHADER_PIPELINE_STATE_DESC& Desc) noexcept + : Flags(Desc.Flags) + , NodeMask(Desc.NodeMask) + , pRootSignature(Desc.pRootSignature) + , PrimitiveTopologyType(Desc.PrimitiveTopologyType) + , PS(Desc.PS) + , BlendState(CD3DX12_BLEND_DESC(Desc.BlendState)) + , DepthStencilState(CD3DX12_DEPTH_STENCIL_DESC1(Desc.DepthStencilState)) + , DSVFormat(Desc.DSVFormat) + , RasterizerState(CD3DX12_RASTERIZER_DESC(Desc.RasterizerState)) + , RTVFormats(CD3DX12_RT_FORMAT_ARRAY(Desc.RTVFormats, Desc.NumRenderTargets)) + , SampleDesc(Desc.SampleDesc) + , SampleMask(Desc.SampleMask) + , CachedPSO(Desc.CachedPSO) + , ViewInstancingDesc(CD3DX12_VIEW_INSTANCING_DESC(CD3DX12_DEFAULT())) + {} + CD3DX12_PIPELINE_STATE_STREAM1(const D3D12_COMPUTE_PIPELINE_STATE_DESC& Desc) noexcept + : Flags(Desc.Flags) + , NodeMask(Desc.NodeMask) + , pRootSignature(Desc.pRootSignature) + , CS(CD3DX12_SHADER_BYTECODE(Desc.CS)) + , CachedPSO(Desc.CachedPSO) + { + static_cast<D3D12_DEPTH_STENCIL_DESC1&>(DepthStencilState).DepthEnable = false; + } + CD3DX12_PIPELINE_STATE_STREAM_FLAGS Flags; + CD3DX12_PIPELINE_STATE_STREAM_NODE_MASK NodeMask; + CD3DX12_PIPELINE_STATE_STREAM_ROOT_SIGNATURE pRootSignature; + CD3DX12_PIPELINE_STATE_STREAM_INPUT_LAYOUT InputLayout; + CD3DX12_PIPELINE_STATE_STREAM_IB_STRIP_CUT_VALUE IBStripCutValue; + CD3DX12_PIPELINE_STATE_STREAM_PRIMITIVE_TOPOLOGY PrimitiveTopologyType; + CD3DX12_PIPELINE_STATE_STREAM_VS VS; + CD3DX12_PIPELINE_STATE_STREAM_GS GS; + CD3DX12_PIPELINE_STATE_STREAM_STREAM_OUTPUT StreamOutput; + CD3DX12_PIPELINE_STATE_STREAM_HS HS; + CD3DX12_PIPELINE_STATE_STREAM_DS DS; + CD3DX12_PIPELINE_STATE_STREAM_PS PS; + CD3DX12_PIPELINE_STATE_STREAM_CS CS; + CD3DX12_PIPELINE_STATE_STREAM_BLEND_DESC BlendState; + CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL1 DepthStencilState; + CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL_FORMAT DSVFormat; + CD3DX12_PIPELINE_STATE_STREAM_RASTERIZER RasterizerState; + CD3DX12_PIPELINE_STATE_STREAM_RENDER_TARGET_FORMATS RTVFormats; + CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_DESC SampleDesc; + CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_MASK SampleMask; + CD3DX12_PIPELINE_STATE_STREAM_CACHED_PSO CachedPSO; + CD3DX12_PIPELINE_STATE_STREAM_VIEW_INSTANCING ViewInstancingDesc; + D3D12_GRAPHICS_PIPELINE_STATE_DESC GraphicsDescV0() const noexcept + { + D3D12_GRAPHICS_PIPELINE_STATE_DESC D; + D.Flags = this->Flags; + D.NodeMask = this->NodeMask; + D.pRootSignature = this->pRootSignature; + D.InputLayout = this->InputLayout; + D.IBStripCutValue = this->IBStripCutValue; + D.PrimitiveTopologyType = this->PrimitiveTopologyType; + D.VS = this->VS; + D.GS = this->GS; + D.StreamOutput = this->StreamOutput; + D.HS = this->HS; + D.DS = this->DS; + D.PS = this->PS; + D.BlendState = this->BlendState; + D.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC1(D3D12_DEPTH_STENCIL_DESC1(this->DepthStencilState)); + D.DSVFormat = this->DSVFormat; + D.RasterizerState = this->RasterizerState; + D.NumRenderTargets = D3D12_RT_FORMAT_ARRAY(this->RTVFormats).NumRenderTargets; + memcpy(D.RTVFormats, D3D12_RT_FORMAT_ARRAY(this->RTVFormats).RTFormats, sizeof(D.RTVFormats)); + D.SampleDesc = this->SampleDesc; + D.SampleMask = this->SampleMask; + D.CachedPSO = this->CachedPSO; + return D; + } + D3D12_COMPUTE_PIPELINE_STATE_DESC ComputeDescV0() const noexcept + { + D3D12_COMPUTE_PIPELINE_STATE_DESC D; + D.Flags = this->Flags; + D.NodeMask = this->NodeMask; + D.pRootSignature = this->pRootSignature; + D.CS = this->CS; + D.CachedPSO = this->CachedPSO; + return D; + } +}; + + +struct CD3DX12_PIPELINE_MESH_STATE_STREAM +{ + CD3DX12_PIPELINE_MESH_STATE_STREAM() = default; + CD3DX12_PIPELINE_MESH_STATE_STREAM(const D3DX12_MESH_SHADER_PIPELINE_STATE_DESC& Desc) noexcept + : Flags(Desc.Flags) + , NodeMask(Desc.NodeMask) + , pRootSignature(Desc.pRootSignature) + , PS(Desc.PS) + , AS(Desc.AS) + , MS(Desc.MS) + , BlendState(CD3DX12_BLEND_DESC(Desc.BlendState)) + , DepthStencilState(CD3DX12_DEPTH_STENCIL_DESC1(Desc.DepthStencilState)) + , DSVFormat(Desc.DSVFormat) + , RasterizerState(CD3DX12_RASTERIZER_DESC(Desc.RasterizerState)) + , RTVFormats(CD3DX12_RT_FORMAT_ARRAY(Desc.RTVFormats, Desc.NumRenderTargets)) + , SampleDesc(Desc.SampleDesc) + , SampleMask(Desc.SampleMask) + , CachedPSO(Desc.CachedPSO) + , ViewInstancingDesc(CD3DX12_VIEW_INSTANCING_DESC(CD3DX12_DEFAULT())) + {} + CD3DX12_PIPELINE_STATE_STREAM_FLAGS Flags; + CD3DX12_PIPELINE_STATE_STREAM_NODE_MASK NodeMask; + CD3DX12_PIPELINE_STATE_STREAM_ROOT_SIGNATURE pRootSignature; + CD3DX12_PIPELINE_STATE_STREAM_PS PS; + CD3DX12_PIPELINE_STATE_STREAM_AS AS; + CD3DX12_PIPELINE_STATE_STREAM_MS MS; + CD3DX12_PIPELINE_STATE_STREAM_BLEND_DESC BlendState; + CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL1 DepthStencilState; + CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL_FORMAT DSVFormat; + CD3DX12_PIPELINE_STATE_STREAM_RASTERIZER RasterizerState; + CD3DX12_PIPELINE_STATE_STREAM_RENDER_TARGET_FORMATS RTVFormats; + CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_DESC SampleDesc; + CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_MASK SampleMask; + CD3DX12_PIPELINE_STATE_STREAM_CACHED_PSO CachedPSO; + CD3DX12_PIPELINE_STATE_STREAM_VIEW_INSTANCING ViewInstancingDesc; + D3DX12_MESH_SHADER_PIPELINE_STATE_DESC MeshShaderDescV0() const noexcept + { + D3DX12_MESH_SHADER_PIPELINE_STATE_DESC D; + D.Flags = this->Flags; + D.NodeMask = this->NodeMask; + D.pRootSignature = this->pRootSignature; + D.PS = this->PS; + D.AS = this->AS; + D.MS = this->MS; + D.BlendState = this->BlendState; + D.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC1(D3D12_DEPTH_STENCIL_DESC1(this->DepthStencilState)); + D.DSVFormat = this->DSVFormat; + D.RasterizerState = this->RasterizerState; + D.NumRenderTargets = D3D12_RT_FORMAT_ARRAY(this->RTVFormats).NumRenderTargets; + memcpy(D.RTVFormats, D3D12_RT_FORMAT_ARRAY(this->RTVFormats).RTFormats, sizeof(D.RTVFormats)); + D.SampleDesc = this->SampleDesc; + D.SampleMask = this->SampleMask; + D.CachedPSO = this->CachedPSO; + return D; + } +}; + +// CD3DX12_PIPELINE_STATE_STREAM works on OS Build 15063+ but does not support new subobject(s) added in OS Build 16299+. +// See CD3DX12_PIPELINE_STATE_STREAM1 for instance. +struct CD3DX12_PIPELINE_STATE_STREAM +{ + CD3DX12_PIPELINE_STATE_STREAM() = default; + CD3DX12_PIPELINE_STATE_STREAM(const D3D12_GRAPHICS_PIPELINE_STATE_DESC& Desc) noexcept + : Flags(Desc.Flags) + , NodeMask(Desc.NodeMask) + , pRootSignature(Desc.pRootSignature) + , InputLayout(Desc.InputLayout) + , IBStripCutValue(Desc.IBStripCutValue) + , PrimitiveTopologyType(Desc.PrimitiveTopologyType) + , VS(Desc.VS) + , GS(Desc.GS) + , StreamOutput(Desc.StreamOutput) + , HS(Desc.HS) + , DS(Desc.DS) + , PS(Desc.PS) + , BlendState(CD3DX12_BLEND_DESC(Desc.BlendState)) + , DepthStencilState(CD3DX12_DEPTH_STENCIL_DESC1(Desc.DepthStencilState)) + , DSVFormat(Desc.DSVFormat) + , RasterizerState(CD3DX12_RASTERIZER_DESC(Desc.RasterizerState)) + , RTVFormats(CD3DX12_RT_FORMAT_ARRAY(Desc.RTVFormats, Desc.NumRenderTargets)) + , SampleDesc(Desc.SampleDesc) + , SampleMask(Desc.SampleMask) + , CachedPSO(Desc.CachedPSO) + {} + CD3DX12_PIPELINE_STATE_STREAM(const D3D12_COMPUTE_PIPELINE_STATE_DESC& Desc) noexcept + : Flags(Desc.Flags) + , NodeMask(Desc.NodeMask) + , pRootSignature(Desc.pRootSignature) + , CS(CD3DX12_SHADER_BYTECODE(Desc.CS)) + , CachedPSO(Desc.CachedPSO) + {} + CD3DX12_PIPELINE_STATE_STREAM_FLAGS Flags; + CD3DX12_PIPELINE_STATE_STREAM_NODE_MASK NodeMask; + CD3DX12_PIPELINE_STATE_STREAM_ROOT_SIGNATURE pRootSignature; + CD3DX12_PIPELINE_STATE_STREAM_INPUT_LAYOUT InputLayout; + CD3DX12_PIPELINE_STATE_STREAM_IB_STRIP_CUT_VALUE IBStripCutValue; + CD3DX12_PIPELINE_STATE_STREAM_PRIMITIVE_TOPOLOGY PrimitiveTopologyType; + CD3DX12_PIPELINE_STATE_STREAM_VS VS; + CD3DX12_PIPELINE_STATE_STREAM_GS GS; + CD3DX12_PIPELINE_STATE_STREAM_STREAM_OUTPUT StreamOutput; + CD3DX12_PIPELINE_STATE_STREAM_HS HS; + CD3DX12_PIPELINE_STATE_STREAM_DS DS; + CD3DX12_PIPELINE_STATE_STREAM_PS PS; + CD3DX12_PIPELINE_STATE_STREAM_CS CS; + CD3DX12_PIPELINE_STATE_STREAM_BLEND_DESC BlendState; + CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL1 DepthStencilState; + CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL_FORMAT DSVFormat; + CD3DX12_PIPELINE_STATE_STREAM_RASTERIZER RasterizerState; + CD3DX12_PIPELINE_STATE_STREAM_RENDER_TARGET_FORMATS RTVFormats; + CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_DESC SampleDesc; + CD3DX12_PIPELINE_STATE_STREAM_SAMPLE_MASK SampleMask; + CD3DX12_PIPELINE_STATE_STREAM_CACHED_PSO CachedPSO; + D3D12_GRAPHICS_PIPELINE_STATE_DESC GraphicsDescV0() const noexcept + { + D3D12_GRAPHICS_PIPELINE_STATE_DESC D; + D.Flags = this->Flags; + D.NodeMask = this->NodeMask; + D.pRootSignature = this->pRootSignature; + D.InputLayout = this->InputLayout; + D.IBStripCutValue = this->IBStripCutValue; + D.PrimitiveTopologyType = this->PrimitiveTopologyType; + D.VS = this->VS; + D.GS = this->GS; + D.StreamOutput = this->StreamOutput; + D.HS = this->HS; + D.DS = this->DS; + D.PS = this->PS; + D.BlendState = this->BlendState; + D.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC1(D3D12_DEPTH_STENCIL_DESC1(this->DepthStencilState)); + D.DSVFormat = this->DSVFormat; + D.RasterizerState = this->RasterizerState; + D.NumRenderTargets = D3D12_RT_FORMAT_ARRAY(this->RTVFormats).NumRenderTargets; + memcpy(D.RTVFormats, D3D12_RT_FORMAT_ARRAY(this->RTVFormats).RTFormats, sizeof(D.RTVFormats)); + D.SampleDesc = this->SampleDesc; + D.SampleMask = this->SampleMask; + D.CachedPSO = this->CachedPSO; + return D; + } + D3D12_COMPUTE_PIPELINE_STATE_DESC ComputeDescV0() const noexcept + { + D3D12_COMPUTE_PIPELINE_STATE_DESC D; + D.Flags = this->Flags; + D.NodeMask = this->NodeMask; + D.pRootSignature = this->pRootSignature; + D.CS = this->CS; + D.CachedPSO = this->CachedPSO; + return D; + } +}; + +struct CD3DX12_PIPELINE_STATE_STREAM2_PARSE_HELPER : public ID3DX12PipelineParserCallbacks +{ + CD3DX12_PIPELINE_STATE_STREAM2 PipelineStream; + CD3DX12_PIPELINE_STATE_STREAM2_PARSE_HELPER() noexcept + : SeenDSS(false) + { + // Adjust defaults to account for absent members. + PipelineStream.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE; + + // Depth disabled if no DSV format specified. + static_cast<D3D12_DEPTH_STENCIL_DESC1&>(PipelineStream.DepthStencilState).DepthEnable = false; + } + + // ID3DX12PipelineParserCallbacks + void FlagsCb(D3D12_PIPELINE_STATE_FLAGS Flags) override {PipelineStream.Flags = Flags;} + void NodeMaskCb(UINT NodeMask) override {PipelineStream.NodeMask = NodeMask;} + void RootSignatureCb(ID3D12RootSignature* pRootSignature) override {PipelineStream.pRootSignature = pRootSignature;} + void InputLayoutCb(const D3D12_INPUT_LAYOUT_DESC& InputLayout) override {PipelineStream.InputLayout = InputLayout;} + void IBStripCutValueCb(D3D12_INDEX_BUFFER_STRIP_CUT_VALUE IBStripCutValue) override {PipelineStream.IBStripCutValue = IBStripCutValue;} + void PrimitiveTopologyTypeCb(D3D12_PRIMITIVE_TOPOLOGY_TYPE PrimitiveTopologyType) override {PipelineStream.PrimitiveTopologyType = PrimitiveTopologyType;} + void VSCb(const D3D12_SHADER_BYTECODE& VS) override {PipelineStream.VS = VS;} + void GSCb(const D3D12_SHADER_BYTECODE& GS) override {PipelineStream.GS = GS;} + void StreamOutputCb(const D3D12_STREAM_OUTPUT_DESC& StreamOutput) override {PipelineStream.StreamOutput = StreamOutput;} + void HSCb(const D3D12_SHADER_BYTECODE& HS) override {PipelineStream.HS = HS;} + void DSCb(const D3D12_SHADER_BYTECODE& DS) override {PipelineStream.DS = DS;} + void PSCb(const D3D12_SHADER_BYTECODE& PS) override {PipelineStream.PS = PS;} + void CSCb(const D3D12_SHADER_BYTECODE& CS) override {PipelineStream.CS = CS;} + void ASCb(const D3D12_SHADER_BYTECODE& AS) override {PipelineStream.AS = AS;} + void MSCb(const D3D12_SHADER_BYTECODE& MS) override {PipelineStream.MS = MS;} + void BlendStateCb(const D3D12_BLEND_DESC& BlendState) override {PipelineStream.BlendState = CD3DX12_BLEND_DESC(BlendState);} + void DepthStencilStateCb(const D3D12_DEPTH_STENCIL_DESC& DepthStencilState) override + { + PipelineStream.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC1(DepthStencilState); + SeenDSS = true; + } + void DepthStencilState1Cb(const D3D12_DEPTH_STENCIL_DESC1& DepthStencilState) override + { + PipelineStream.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC1(DepthStencilState); + SeenDSS = true; + } + void DSVFormatCb(DXGI_FORMAT DSVFormat) override + { + PipelineStream.DSVFormat = DSVFormat; + if (!SeenDSS && DSVFormat != DXGI_FORMAT_UNKNOWN) + { + // Re-enable depth for the default state. + static_cast<D3D12_DEPTH_STENCIL_DESC1&>(PipelineStream.DepthStencilState).DepthEnable = true; + } + } + void RasterizerStateCb(const D3D12_RASTERIZER_DESC& RasterizerState) override {PipelineStream.RasterizerState = CD3DX12_RASTERIZER_DESC(RasterizerState);} + void RTVFormatsCb(const D3D12_RT_FORMAT_ARRAY& RTVFormats) override {PipelineStream.RTVFormats = RTVFormats;} + void SampleDescCb(const DXGI_SAMPLE_DESC& SampleDesc) override {PipelineStream.SampleDesc = SampleDesc;} + void SampleMaskCb(UINT SampleMask) override {PipelineStream.SampleMask = SampleMask;} + void ViewInstancingCb(const D3D12_VIEW_INSTANCING_DESC& ViewInstancingDesc) override {PipelineStream.ViewInstancingDesc = CD3DX12_VIEW_INSTANCING_DESC(ViewInstancingDesc);} + void CachedPSOCb(const D3D12_CACHED_PIPELINE_STATE& CachedPSO) override {PipelineStream.CachedPSO = CachedPSO;} + +private: + bool SeenDSS; +}; + + +struct CD3DX12_PIPELINE_STATE_STREAM3_PARSE_HELPER : public ID3DX12PipelineParserCallbacks +{ + CD3DX12_PIPELINE_STATE_STREAM3 PipelineStream; + CD3DX12_PIPELINE_STATE_STREAM3_PARSE_HELPER() noexcept + : SeenDSS(false) + { + // Adjust defaults to account for absent members. + PipelineStream.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE; + + // Depth disabled if no DSV format specified. + static_cast<D3D12_DEPTH_STENCIL_DESC2&>(PipelineStream.DepthStencilState).DepthEnable = false; + } + + // ID3DX12PipelineParserCallbacks + void FlagsCb(D3D12_PIPELINE_STATE_FLAGS Flags) override { PipelineStream.Flags = Flags; } + void NodeMaskCb(UINT NodeMask) override { PipelineStream.NodeMask = NodeMask; } + void RootSignatureCb(ID3D12RootSignature* pRootSignature) override { PipelineStream.pRootSignature = pRootSignature; } + void InputLayoutCb(const D3D12_INPUT_LAYOUT_DESC& InputLayout) override { PipelineStream.InputLayout = InputLayout; } + void IBStripCutValueCb(D3D12_INDEX_BUFFER_STRIP_CUT_VALUE IBStripCutValue) override { PipelineStream.IBStripCutValue = IBStripCutValue; } + void PrimitiveTopologyTypeCb(D3D12_PRIMITIVE_TOPOLOGY_TYPE PrimitiveTopologyType) override { PipelineStream.PrimitiveTopologyType = PrimitiveTopologyType; } + void VSCb(const D3D12_SHADER_BYTECODE& VS) override { PipelineStream.VS = VS; } + void GSCb(const D3D12_SHADER_BYTECODE& GS) override { PipelineStream.GS = GS; } + void StreamOutputCb(const D3D12_STREAM_OUTPUT_DESC& StreamOutput) override { PipelineStream.StreamOutput = StreamOutput; } + void HSCb(const D3D12_SHADER_BYTECODE& HS) override { PipelineStream.HS = HS; } + void DSCb(const D3D12_SHADER_BYTECODE& DS) override { PipelineStream.DS = DS; } + void PSCb(const D3D12_SHADER_BYTECODE& PS) override { PipelineStream.PS = PS; } + void CSCb(const D3D12_SHADER_BYTECODE& CS) override { PipelineStream.CS = CS; } + void ASCb(const D3D12_SHADER_BYTECODE& AS) override { PipelineStream.AS = AS; } + void MSCb(const D3D12_SHADER_BYTECODE& MS) override { PipelineStream.MS = MS; } + void BlendStateCb(const D3D12_BLEND_DESC& BlendState) override { PipelineStream.BlendState = CD3DX12_BLEND_DESC(BlendState); } + void DepthStencilStateCb(const D3D12_DEPTH_STENCIL_DESC& DepthStencilState) override + { + PipelineStream.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC2(DepthStencilState); + SeenDSS = true; + } + void DepthStencilState1Cb(const D3D12_DEPTH_STENCIL_DESC1& DepthStencilState) override + { + PipelineStream.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC2(DepthStencilState); + SeenDSS = true; + } + void DepthStencilState2Cb(const D3D12_DEPTH_STENCIL_DESC2& DepthStencilState) override + { + PipelineStream.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC2(DepthStencilState); + SeenDSS = true; + } + void DSVFormatCb(DXGI_FORMAT DSVFormat) override + { + PipelineStream.DSVFormat = DSVFormat; + if (!SeenDSS && DSVFormat != DXGI_FORMAT_UNKNOWN) + { + // Re-enable depth for the default state. + static_cast<D3D12_DEPTH_STENCIL_DESC2&>(PipelineStream.DepthStencilState).DepthEnable = true; + } + } + void RasterizerStateCb(const D3D12_RASTERIZER_DESC& RasterizerState) override { PipelineStream.RasterizerState = CD3DX12_RASTERIZER_DESC(RasterizerState); } + void RTVFormatsCb(const D3D12_RT_FORMAT_ARRAY& RTVFormats) override { PipelineStream.RTVFormats = RTVFormats; } + void SampleDescCb(const DXGI_SAMPLE_DESC& SampleDesc) override { PipelineStream.SampleDesc = SampleDesc; } + void SampleMaskCb(UINT SampleMask) override { PipelineStream.SampleMask = SampleMask; } + void ViewInstancingCb(const D3D12_VIEW_INSTANCING_DESC& ViewInstancingDesc) override { PipelineStream.ViewInstancingDesc = CD3DX12_VIEW_INSTANCING_DESC(ViewInstancingDesc); } + void CachedPSOCb(const D3D12_CACHED_PIPELINE_STATE& CachedPSO) override { PipelineStream.CachedPSO = CachedPSO; } + +private: + bool SeenDSS; +}; + +struct CD3DX12_PIPELINE_STATE_STREAM_PARSE_HELPER : public ID3DX12PipelineParserCallbacks +{ + CD3DX12_PIPELINE_STATE_STREAM1 PipelineStream; + CD3DX12_PIPELINE_STATE_STREAM_PARSE_HELPER() noexcept + : SeenDSS(false) + { + // Adjust defaults to account for absent members. + PipelineStream.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE; + + // Depth disabled if no DSV format specified. + static_cast<D3D12_DEPTH_STENCIL_DESC1&>(PipelineStream.DepthStencilState).DepthEnable = false; + } + + // ID3DX12PipelineParserCallbacks + void FlagsCb(D3D12_PIPELINE_STATE_FLAGS Flags) override {PipelineStream.Flags = Flags;} + void NodeMaskCb(UINT NodeMask) override {PipelineStream.NodeMask = NodeMask;} + void RootSignatureCb(ID3D12RootSignature* pRootSignature) override {PipelineStream.pRootSignature = pRootSignature;} + void InputLayoutCb(const D3D12_INPUT_LAYOUT_DESC& InputLayout) override {PipelineStream.InputLayout = InputLayout;} + void IBStripCutValueCb(D3D12_INDEX_BUFFER_STRIP_CUT_VALUE IBStripCutValue) override {PipelineStream.IBStripCutValue = IBStripCutValue;} + void PrimitiveTopologyTypeCb(D3D12_PRIMITIVE_TOPOLOGY_TYPE PrimitiveTopologyType) override {PipelineStream.PrimitiveTopologyType = PrimitiveTopologyType;} + void VSCb(const D3D12_SHADER_BYTECODE& VS) override {PipelineStream.VS = VS;} + void GSCb(const D3D12_SHADER_BYTECODE& GS) override {PipelineStream.GS = GS;} + void StreamOutputCb(const D3D12_STREAM_OUTPUT_DESC& StreamOutput) override {PipelineStream.StreamOutput = StreamOutput;} + void HSCb(const D3D12_SHADER_BYTECODE& HS) override {PipelineStream.HS = HS;} + void DSCb(const D3D12_SHADER_BYTECODE& DS) override {PipelineStream.DS = DS;} + void PSCb(const D3D12_SHADER_BYTECODE& PS) override {PipelineStream.PS = PS;} + void CSCb(const D3D12_SHADER_BYTECODE& CS) override {PipelineStream.CS = CS;} + void BlendStateCb(const D3D12_BLEND_DESC& BlendState) override {PipelineStream.BlendState = CD3DX12_BLEND_DESC(BlendState);} + void DepthStencilStateCb(const D3D12_DEPTH_STENCIL_DESC& DepthStencilState) override + { + PipelineStream.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC1(DepthStencilState); + SeenDSS = true; + } + void DepthStencilState1Cb(const D3D12_DEPTH_STENCIL_DESC1& DepthStencilState) override + { + PipelineStream.DepthStencilState = CD3DX12_DEPTH_STENCIL_DESC1(DepthStencilState); + SeenDSS = true; + } + void DSVFormatCb(DXGI_FORMAT DSVFormat) override + { + PipelineStream.DSVFormat = DSVFormat; + if (!SeenDSS && DSVFormat != DXGI_FORMAT_UNKNOWN) + { + // Re-enable depth for the default state. + static_cast<D3D12_DEPTH_STENCIL_DESC1&>(PipelineStream.DepthStencilState).DepthEnable = true; + } + } + void RasterizerStateCb(const D3D12_RASTERIZER_DESC& RasterizerState) override {PipelineStream.RasterizerState = CD3DX12_RASTERIZER_DESC(RasterizerState);} + void RTVFormatsCb(const D3D12_RT_FORMAT_ARRAY& RTVFormats) override {PipelineStream.RTVFormats = RTVFormats;} + void SampleDescCb(const DXGI_SAMPLE_DESC& SampleDesc) override {PipelineStream.SampleDesc = SampleDesc;} + void SampleMaskCb(UINT SampleMask) override {PipelineStream.SampleMask = SampleMask;} + void ViewInstancingCb(const D3D12_VIEW_INSTANCING_DESC& ViewInstancingDesc) override {PipelineStream.ViewInstancingDesc = CD3DX12_VIEW_INSTANCING_DESC(ViewInstancingDesc);} + void CachedPSOCb(const D3D12_CACHED_PIPELINE_STATE& CachedPSO) override {PipelineStream.CachedPSO = CachedPSO;} + +private: + bool SeenDSS; +}; + +inline D3D12_PIPELINE_STATE_SUBOBJECT_TYPE D3DX12GetBaseSubobjectType(D3D12_PIPELINE_STATE_SUBOBJECT_TYPE SubobjectType) noexcept +{ + switch (SubobjectType) + { + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL1: + return D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL2: + return D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL; + default: + return SubobjectType; + } +} + +inline HRESULT D3DX12ParsePipelineStream(const D3D12_PIPELINE_STATE_STREAM_DESC& Desc, ID3DX12PipelineParserCallbacks* pCallbacks) +{ + if (pCallbacks == nullptr) + { + return E_INVALIDARG; + } + + if (Desc.SizeInBytes == 0 || Desc.pPipelineStateSubobjectStream == nullptr) + { + pCallbacks->ErrorBadInputParameter(1); // first parameter issue + return E_INVALIDARG; + } + + bool SubobjectSeen[D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MAX_VALID] = {}; + for (SIZE_T CurOffset = 0, SizeOfSubobject = 0; CurOffset < Desc.SizeInBytes; CurOffset += SizeOfSubobject) + { + BYTE* pStream = static_cast<BYTE*>(Desc.pPipelineStateSubobjectStream)+CurOffset; + auto SubobjectType = *reinterpret_cast<D3D12_PIPELINE_STATE_SUBOBJECT_TYPE*>(pStream); + if (SubobjectType < 0 || SubobjectType >= D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MAX_VALID) + { + pCallbacks->ErrorUnknownSubobject(SubobjectType); + return E_INVALIDARG; + } + if (SubobjectSeen[D3DX12GetBaseSubobjectType(SubobjectType)]) + { + pCallbacks->ErrorDuplicateSubobject(SubobjectType); + return E_INVALIDARG; // disallow subobject duplicates in a stream + } + SubobjectSeen[SubobjectType] = true; + switch (SubobjectType) + { + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_ROOT_SIGNATURE: + pCallbacks->RootSignatureCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::pRootSignature)*>(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::pRootSignature); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_VS: + pCallbacks->VSCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::VS)*>(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::VS); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_PS: + pCallbacks->PSCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::PS)*>(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::PS); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DS: + pCallbacks->DSCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::DS)*>(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::DS); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_HS: + pCallbacks->HSCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::HS)*>(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::HS); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_GS: + pCallbacks->GSCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::GS)*>(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::GS); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_CS: + pCallbacks->CSCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::CS)*>(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::CS); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_AS: + pCallbacks->ASCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM2::AS)*>(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM2::AS); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MS: + pCallbacks->MSCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM2::MS)*>(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM2::MS); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_STREAM_OUTPUT: + pCallbacks->StreamOutputCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::StreamOutput)*>(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::StreamOutput); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_BLEND: + pCallbacks->BlendStateCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::BlendState)*>(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::BlendState); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_SAMPLE_MASK: + pCallbacks->SampleMaskCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::SampleMask)*>(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::SampleMask); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RASTERIZER: + pCallbacks->RasterizerStateCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::RasterizerState)*>(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::RasterizerState); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL: + pCallbacks->DepthStencilStateCb(*reinterpret_cast<CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL*>(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM_DEPTH_STENCIL); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL1: + pCallbacks->DepthStencilState1Cb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::DepthStencilState)*>(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::DepthStencilState); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL2: + pCallbacks->DepthStencilState2Cb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM3::DepthStencilState)*>(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM3::DepthStencilState); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_INPUT_LAYOUT: + pCallbacks->InputLayoutCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::InputLayout)*>(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::InputLayout); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_IB_STRIP_CUT_VALUE: + pCallbacks->IBStripCutValueCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::IBStripCutValue)*>(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::IBStripCutValue); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_PRIMITIVE_TOPOLOGY: + pCallbacks->PrimitiveTopologyTypeCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::PrimitiveTopologyType)*>(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::PrimitiveTopologyType); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_RENDER_TARGET_FORMATS: + pCallbacks->RTVFormatsCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::RTVFormats)*>(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::RTVFormats); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL_FORMAT: + pCallbacks->DSVFormatCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::DSVFormat)*>(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::DSVFormat); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_SAMPLE_DESC: + pCallbacks->SampleDescCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::SampleDesc)*>(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::SampleDesc); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_NODE_MASK: + pCallbacks->NodeMaskCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::NodeMask)*>(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::NodeMask); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_CACHED_PSO: + pCallbacks->CachedPSOCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::CachedPSO)*>(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::CachedPSO); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_FLAGS: + pCallbacks->FlagsCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM::Flags)*>(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM::Flags); + break; + case D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_VIEW_INSTANCING: + pCallbacks->ViewInstancingCb(*reinterpret_cast<decltype(CD3DX12_PIPELINE_STATE_STREAM1::ViewInstancingDesc)*>(pStream)); + SizeOfSubobject = sizeof(CD3DX12_PIPELINE_STATE_STREAM1::ViewInstancingDesc); + break; + default: + pCallbacks->ErrorUnknownSubobject(SubobjectType); + return E_INVALIDARG; + } + } + + return S_OK; +} + +//------------------------------------------------------------------------------------------------ +inline bool operator==( const D3D12_CLEAR_VALUE &a, const D3D12_CLEAR_VALUE &b) noexcept +{ + if (a.Format != b.Format) return false; + if (a.Format == DXGI_FORMAT_D24_UNORM_S8_UINT + || a.Format == DXGI_FORMAT_D16_UNORM + || a.Format == DXGI_FORMAT_D32_FLOAT + || a.Format == DXGI_FORMAT_D32_FLOAT_S8X24_UINT) + { + return (a.DepthStencil.Depth == b.DepthStencil.Depth) && + (a.DepthStencil.Stencil == b.DepthStencil.Stencil); + } else { + return (a.Color[0] == b.Color[0]) && + (a.Color[1] == b.Color[1]) && + (a.Color[2] == b.Color[2]) && + (a.Color[3] == b.Color[3]); + } +} +inline bool operator==( const D3D12_RENDER_PASS_BEGINNING_ACCESS_CLEAR_PARAMETERS &a, const D3D12_RENDER_PASS_BEGINNING_ACCESS_CLEAR_PARAMETERS &b) noexcept +{ + return a.ClearValue == b.ClearValue; +} +inline bool operator==( const D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_PARAMETERS &a, const D3D12_RENDER_PASS_ENDING_ACCESS_RESOLVE_PARAMETERS &b) noexcept +{ + if (a.pSrcResource != b.pSrcResource) return false; + if (a.pDstResource != b.pDstResource) return false; + if (a.SubresourceCount != b.SubresourceCount) return false; + if (a.Format != b.Format) return false; + if (a.ResolveMode != b.ResolveMode) return false; + if (a.PreserveResolveSource != b.PreserveResolveSource) return false; + return true; +} +inline bool operator==( const D3D12_RENDER_PASS_BEGINNING_ACCESS &a, const D3D12_RENDER_PASS_BEGINNING_ACCESS &b) noexcept +{ + if (a.Type != b.Type) return false; + if (a.Type == D3D12_RENDER_PASS_BEGINNING_ACCESS_TYPE_CLEAR && !(a.Clear == b.Clear)) return false; + return true; +} +inline bool operator==( const D3D12_RENDER_PASS_ENDING_ACCESS &a, const D3D12_RENDER_PASS_ENDING_ACCESS &b) noexcept +{ + if (a.Type != b.Type) return false; + if (a.Type == D3D12_RENDER_PASS_ENDING_ACCESS_TYPE_RESOLVE && !(a.Resolve == b.Resolve)) return false; + return true; +} +inline bool operator==( const D3D12_RENDER_PASS_RENDER_TARGET_DESC &a, const D3D12_RENDER_PASS_RENDER_TARGET_DESC &b) noexcept +{ + if (a.cpuDescriptor.ptr != b.cpuDescriptor.ptr) return false; + if (!(a.BeginningAccess == b.BeginningAccess)) return false; + if (!(a.EndingAccess == b.EndingAccess)) return false; + return true; +} +inline bool operator==( const D3D12_RENDER_PASS_DEPTH_STENCIL_DESC &a, const D3D12_RENDER_PASS_DEPTH_STENCIL_DESC &b) noexcept +{ + if (a.cpuDescriptor.ptr != b.cpuDescriptor.ptr) return false; + if (!(a.DepthBeginningAccess == b.DepthBeginningAccess)) return false; + if (!(a.StencilBeginningAccess == b.StencilBeginningAccess)) return false; + if (!(a.DepthEndingAccess == b.DepthEndingAccess)) return false; + if (!(a.StencilEndingAccess == b.StencilEndingAccess)) return false; + return true; +} + + +#ifndef D3DX12_NO_STATE_OBJECT_HELPERS + +//================================================================================================ +// D3DX12 State Object Creation Helpers +// +// Helper classes for creating new style state objects out of an arbitrary set of subobjects. +// Uses STL +// +// Start by instantiating CD3DX12_STATE_OBJECT_DESC (see its public methods). +// One of its methods is CreateSubobject(), which has a comment showing a couple of options for +// defining subobjects using the helper classes for each subobject (CD3DX12_DXIL_LIBRARY_SUBOBJECT +// etc.). The subobject helpers each have methods specific to the subobject for configuring its +// contents. +// +//================================================================================================ +#include <list> +#include <memory> +#include <string> +#include <vector> +#ifndef D3DX12_USE_ATL +#include <wrl/client.h> +#define D3DX12_COM_PTR Microsoft::WRL::ComPtr +#define D3DX12_COM_PTR_GET(x) x.Get() +#define D3DX12_COM_PTR_ADDRESSOF(x) x.GetAddressOf() +#else +#include <atlbase.h> +#define D3DX12_COM_PTR ATL::CComPtr +#define D3DX12_COM_PTR_GET(x) x.p +#define D3DX12_COM_PTR_ADDRESSOF(x) &x.p +#endif + +//------------------------------------------------------------------------------------------------ +class CD3DX12_STATE_OBJECT_DESC +{ +public: + CD3DX12_STATE_OBJECT_DESC() noexcept + { + Init(D3D12_STATE_OBJECT_TYPE_COLLECTION); + } + CD3DX12_STATE_OBJECT_DESC(D3D12_STATE_OBJECT_TYPE Type) noexcept + { + Init(Type); + } + void SetStateObjectType(D3D12_STATE_OBJECT_TYPE Type) noexcept { m_Desc.Type = Type; } + operator const D3D12_STATE_OBJECT_DESC&() + { + // Do final preparation work + m_RepointedAssociations.clear(); + m_SubobjectArray.clear(); + m_SubobjectArray.reserve(m_Desc.NumSubobjects); + // Flatten subobjects into an array (each flattened subobject still has a + // member that's a pointer to its desc that's not flattened) + for (auto Iter = m_SubobjectList.begin(); + Iter != m_SubobjectList.end(); Iter++) + { + m_SubobjectArray.push_back(*Iter); + // Store new location in array so we can redirect pointers contained in subobjects + Iter->pSubobjectArrayLocation = &m_SubobjectArray.back(); + } + // For subobjects with pointer fields, create a new copy of those subobject definitions + // with fixed pointers + for (UINT i = 0; i < m_Desc.NumSubobjects; i++) + { + if (m_SubobjectArray[i].Type == D3D12_STATE_SUBOBJECT_TYPE_SUBOBJECT_TO_EXPORTS_ASSOCIATION) + { + auto pOriginalSubobjectAssociation = + static_cast<const D3D12_SUBOBJECT_TO_EXPORTS_ASSOCIATION*>(m_SubobjectArray[i].pDesc); + D3D12_SUBOBJECT_TO_EXPORTS_ASSOCIATION Repointed = *pOriginalSubobjectAssociation; + auto pWrapper = + static_cast<const SUBOBJECT_WRAPPER*>(pOriginalSubobjectAssociation->pSubobjectToAssociate); + Repointed.pSubobjectToAssociate = pWrapper->pSubobjectArrayLocation; + m_RepointedAssociations.push_back(Repointed); + m_SubobjectArray[i].pDesc = &m_RepointedAssociations.back(); + } + } + // Below: using ugly way to get pointer in case .data() is not defined + m_Desc.pSubobjects = m_Desc.NumSubobjects ? &m_SubobjectArray[0] : nullptr; + return m_Desc; + } + operator const D3D12_STATE_OBJECT_DESC*() + { + // Cast calls the above final preparation work + return &static_cast<const D3D12_STATE_OBJECT_DESC&>(*this); + } + + // CreateSubobject creates a sububject helper (e.g. CD3DX12_HIT_GROUP_SUBOBJECT) + // whose lifetime is owned by this class. + // e.g. + // + // CD3DX12_STATE_OBJECT_DESC Collection1(D3D12_STATE_OBJECT_TYPE_COLLECTION); + // auto Lib0 = Collection1.CreateSubobject<CD3DX12_DXIL_LIBRARY_SUBOBJECT>(); + // Lib0->SetDXILLibrary(&pMyAppDxilLibs[0]); + // Lib0->DefineExport(L"rayGenShader0"); // in practice these export listings might be + // // data/engine driven + // etc. + // + // Alternatively, users can instantiate sububject helpers explicitly, such as via local + // variables instead, passing the state object desc that should point to it into the helper + // constructor (or call mySubobjectHelper.AddToStateObject(Collection1)). + // In this alternative scenario, the user must keep the subobject alive as long as the state + // object it is associated with is alive, else its pointer references will be stale. + // e.g. + // + // CD3DX12_STATE_OBJECT_DESC RaytracingState2(D3D12_STATE_OBJECT_TYPE_RAYTRACING_PIPELINE); + // CD3DX12_DXIL_LIBRARY_SUBOBJECT LibA(RaytracingState2); + // LibA.SetDXILLibrary(&pMyAppDxilLibs[4]); // not manually specifying exports + // // - meaning all exports in the libraries + // // are exported + // etc. + + template<typename T> + T* CreateSubobject() + { + T* pSubobject = new T(*this); + m_OwnedSubobjectHelpers.emplace_back(pSubobject); + return pSubobject; + } + +private: + D3D12_STATE_SUBOBJECT* TrackSubobject(D3D12_STATE_SUBOBJECT_TYPE Type, void* pDesc) + { + SUBOBJECT_WRAPPER Subobject; + Subobject.pSubobjectArrayLocation = nullptr; + Subobject.Type = Type; + Subobject.pDesc = pDesc; + m_SubobjectList.push_back(Subobject); + m_Desc.NumSubobjects++; + return &m_SubobjectList.back(); + } + void Init(D3D12_STATE_OBJECT_TYPE Type) noexcept + { + SetStateObjectType(Type); + m_Desc.pSubobjects = nullptr; + m_Desc.NumSubobjects = 0; + m_SubobjectList.clear(); + m_SubobjectArray.clear(); + m_RepointedAssociations.clear(); + } + typedef struct SUBOBJECT_WRAPPER : public D3D12_STATE_SUBOBJECT + { + D3D12_STATE_SUBOBJECT* pSubobjectArrayLocation; // new location when flattened into array + // for repointing pointers in subobjects + } SUBOBJECT_WRAPPER; + D3D12_STATE_OBJECT_DESC m_Desc; + std::list<SUBOBJECT_WRAPPER> m_SubobjectList; // Pointers to list nodes handed out so + // these can be edited live + std::vector<D3D12_STATE_SUBOBJECT> m_SubobjectArray; // Built at the end, copying list contents + + std::list<D3D12_SUBOBJECT_TO_EXPORTS_ASSOCIATION> + m_RepointedAssociations; // subobject type that contains pointers to other subobjects, + // repointed to flattened array + + class StringContainer + { + public: + LPCWSTR LocalCopy(LPCWSTR string, bool bSingleString = false) + { + if (string) + { + if (bSingleString) + { + m_Strings.clear(); + m_Strings.push_back(string); + } + else + { + m_Strings.push_back(string); + } + return m_Strings.back().c_str(); + } + else + { + return nullptr; + } + } + void clear() noexcept { m_Strings.clear(); } + private: + std::list<std::wstring> m_Strings; + }; + + class SUBOBJECT_HELPER_BASE + { + public: + SUBOBJECT_HELPER_BASE() noexcept { Init(); } + virtual ~SUBOBJECT_HELPER_BASE() = default; + virtual D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept = 0; + void AddToStateObject(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + m_pSubobject = ContainingStateObject.TrackSubobject(Type(), Data()); + } + protected: + virtual void* Data() noexcept = 0; + void Init() noexcept { m_pSubobject = nullptr; } + D3D12_STATE_SUBOBJECT* m_pSubobject; + }; + +#if(__cplusplus >= 201103L) + std::list<std::unique_ptr<const SUBOBJECT_HELPER_BASE>> m_OwnedSubobjectHelpers; +#else + class OWNED_HELPER + { + public: + OWNED_HELPER(const SUBOBJECT_HELPER_BASE* pHelper) noexcept { m_pHelper = pHelper; } + ~OWNED_HELPER() { delete m_pHelper; } + const SUBOBJECT_HELPER_BASE* m_pHelper; + }; + + std::list<OWNED_HELPER> m_OwnedSubobjectHelpers; +#endif + + friend class CD3DX12_DXIL_LIBRARY_SUBOBJECT; + friend class CD3DX12_EXISTING_COLLECTION_SUBOBJECT; + friend class CD3DX12_SUBOBJECT_TO_EXPORTS_ASSOCIATION_SUBOBJECT; + friend class CD3DX12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION; + friend class CD3DX12_HIT_GROUP_SUBOBJECT; + friend class CD3DX12_RAYTRACING_SHADER_CONFIG_SUBOBJECT; + friend class CD3DX12_RAYTRACING_PIPELINE_CONFIG_SUBOBJECT; + friend class CD3DX12_RAYTRACING_PIPELINE_CONFIG1_SUBOBJECT; + friend class CD3DX12_GLOBAL_ROOT_SIGNATURE_SUBOBJECT; + friend class CD3DX12_LOCAL_ROOT_SIGNATURE_SUBOBJECT; + friend class CD3DX12_STATE_OBJECT_CONFIG_SUBOBJECT; + friend class CD3DX12_NODE_MASK_SUBOBJECT; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_DXIL_LIBRARY_SUBOBJECT + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_DXIL_LIBRARY_SUBOBJECT() noexcept + { + Init(); + } + CD3DX12_DXIL_LIBRARY_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + void SetDXILLibrary(const D3D12_SHADER_BYTECODE* pCode) noexcept + { + static const D3D12_SHADER_BYTECODE Default = {}; + m_Desc.DXILLibrary = pCode ? *pCode : Default; + } + void DefineExport( + LPCWSTR Name, + LPCWSTR ExportToRename = nullptr, + D3D12_EXPORT_FLAGS Flags = D3D12_EXPORT_FLAG_NONE) + { + D3D12_EXPORT_DESC Export; + Export.Name = m_Strings.LocalCopy(Name); + Export.ExportToRename = m_Strings.LocalCopy(ExportToRename); + Export.Flags = Flags; + m_Exports.push_back(Export); + m_Desc.pExports = &m_Exports[0]; // using ugly way to get pointer in case .data() is not defined + m_Desc.NumExports = static_cast<UINT>(m_Exports.size()); + } + template<size_t N> + void DefineExports(LPCWSTR(&Exports)[N]) + { + for (UINT i = 0; i < N; i++) + { + DefineExport(Exports[i]); + } + } + void DefineExports(const LPCWSTR* Exports, UINT N) + { + for (UINT i = 0; i < N; i++) + { + DefineExport(Exports[i]); + } + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_DXIL_LIBRARY; + } + operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; } + operator const D3D12_DXIL_LIBRARY_DESC&() const noexcept { return m_Desc; } +private: + void Init() noexcept + { + SUBOBJECT_HELPER_BASE::Init(); + m_Desc = {}; + m_Strings.clear(); + m_Exports.clear(); + } + void* Data() noexcept override { return &m_Desc; } + D3D12_DXIL_LIBRARY_DESC m_Desc; + CD3DX12_STATE_OBJECT_DESC::StringContainer m_Strings; + std::vector<D3D12_EXPORT_DESC> m_Exports; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_EXISTING_COLLECTION_SUBOBJECT + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_EXISTING_COLLECTION_SUBOBJECT() noexcept + { + Init(); + } + CD3DX12_EXISTING_COLLECTION_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + void SetExistingCollection(ID3D12StateObject*pExistingCollection) noexcept + { + m_Desc.pExistingCollection = pExistingCollection; + m_CollectionRef = pExistingCollection; + } + void DefineExport( + LPCWSTR Name, + LPCWSTR ExportToRename = nullptr, + D3D12_EXPORT_FLAGS Flags = D3D12_EXPORT_FLAG_NONE) + { + D3D12_EXPORT_DESC Export; + Export.Name = m_Strings.LocalCopy(Name); + Export.ExportToRename = m_Strings.LocalCopy(ExportToRename); + Export.Flags = Flags; + m_Exports.push_back(Export); + m_Desc.pExports = &m_Exports[0]; // using ugly way to get pointer in case .data() is not defined + m_Desc.NumExports = static_cast<UINT>(m_Exports.size()); + } + template<size_t N> + void DefineExports(LPCWSTR(&Exports)[N]) + { + for (UINT i = 0; i < N; i++) + { + DefineExport(Exports[i]); + } + } + void DefineExports(const LPCWSTR* Exports, UINT N) + { + for (UINT i = 0; i < N; i++) + { + DefineExport(Exports[i]); + } + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_EXISTING_COLLECTION; + } + operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; } + operator const D3D12_EXISTING_COLLECTION_DESC&() const noexcept { return m_Desc; } +private: + void Init() noexcept + { + SUBOBJECT_HELPER_BASE::Init(); + m_Desc = {}; + m_CollectionRef = nullptr; + m_Strings.clear(); + m_Exports.clear(); + } + void* Data() noexcept override { return &m_Desc; } + D3D12_EXISTING_COLLECTION_DESC m_Desc; + D3DX12_COM_PTR<ID3D12StateObject> m_CollectionRef; + CD3DX12_STATE_OBJECT_DESC::StringContainer m_Strings; + std::vector<D3D12_EXPORT_DESC> m_Exports; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_SUBOBJECT_TO_EXPORTS_ASSOCIATION_SUBOBJECT + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_SUBOBJECT_TO_EXPORTS_ASSOCIATION_SUBOBJECT() noexcept + { + Init(); + } + CD3DX12_SUBOBJECT_TO_EXPORTS_ASSOCIATION_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + void SetSubobjectToAssociate(const D3D12_STATE_SUBOBJECT& SubobjectToAssociate) noexcept + { + m_Desc.pSubobjectToAssociate = &SubobjectToAssociate; + } + void AddExport(LPCWSTR Export) + { + m_Desc.NumExports++; + m_Exports.push_back(m_Strings.LocalCopy(Export)); + m_Desc.pExports = &m_Exports[0]; // using ugly way to get pointer in case .data() is not defined + } + template<size_t N> + void AddExports(LPCWSTR (&Exports)[N]) + { + for (UINT i = 0; i < N; i++) + { + AddExport(Exports[i]); + } + } + void AddExports(const LPCWSTR* Exports, UINT N) + { + for (UINT i = 0; i < N; i++) + { + AddExport(Exports[i]); + } + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_SUBOBJECT_TO_EXPORTS_ASSOCIATION; + } + operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; } + operator const D3D12_SUBOBJECT_TO_EXPORTS_ASSOCIATION&() const noexcept { return m_Desc; } +private: + void Init() noexcept + { + SUBOBJECT_HELPER_BASE::Init(); + m_Desc = {}; + m_Strings.clear(); + m_Exports.clear(); + } + void* Data() noexcept override { return &m_Desc; } + D3D12_SUBOBJECT_TO_EXPORTS_ASSOCIATION m_Desc; + CD3DX12_STATE_OBJECT_DESC::StringContainer m_Strings; + std::vector<LPCWSTR> m_Exports; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION() noexcept + { + Init(); + } + CD3DX12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + void SetSubobjectNameToAssociate(LPCWSTR SubobjectToAssociate) + { + m_Desc.SubobjectToAssociate = m_SubobjectName.LocalCopy(SubobjectToAssociate, true); + } + void AddExport(LPCWSTR Export) + { + m_Desc.NumExports++; + m_Exports.push_back(m_Strings.LocalCopy(Export)); + m_Desc.pExports = &m_Exports[0]; // using ugly way to get pointer in case .data() is not defined + } + template<size_t N> + void AddExports(LPCWSTR (&Exports)[N]) + { + for (UINT i = 0; i < N; i++) + { + AddExport(Exports[i]); + } + } + void AddExports(const LPCWSTR* Exports, UINT N) + { + for (UINT i = 0; i < N; i++) + { + AddExport(Exports[i]); + } + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION; + } + operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; } + operator const D3D12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION&() const noexcept { return m_Desc; } +private: + void Init() noexcept + { + SUBOBJECT_HELPER_BASE::Init(); + m_Desc = {}; + m_Strings.clear(); + m_SubobjectName.clear(); + m_Exports.clear(); + } + void* Data() noexcept override { return &m_Desc; } + D3D12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION m_Desc; + CD3DX12_STATE_OBJECT_DESC::StringContainer m_Strings; + CD3DX12_STATE_OBJECT_DESC::StringContainer m_SubobjectName; + std::vector<LPCWSTR> m_Exports; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_HIT_GROUP_SUBOBJECT + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_HIT_GROUP_SUBOBJECT() noexcept + { + Init(); + } + CD3DX12_HIT_GROUP_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + void SetHitGroupExport(LPCWSTR exportName) + { + m_Desc.HitGroupExport = m_Strings[0].LocalCopy(exportName, true); + } + void SetHitGroupType(D3D12_HIT_GROUP_TYPE Type) noexcept { m_Desc.Type = Type; } + void SetAnyHitShaderImport(LPCWSTR importName) + { + m_Desc.AnyHitShaderImport = m_Strings[1].LocalCopy(importName, true); + } + void SetClosestHitShaderImport(LPCWSTR importName) + { + m_Desc.ClosestHitShaderImport = m_Strings[2].LocalCopy(importName, true); + } + void SetIntersectionShaderImport(LPCWSTR importName) + { + m_Desc.IntersectionShaderImport = m_Strings[3].LocalCopy(importName, true); + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_HIT_GROUP; + } + operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; } + operator const D3D12_HIT_GROUP_DESC&() const noexcept { return m_Desc; } +private: + void Init() noexcept + { + SUBOBJECT_HELPER_BASE::Init(); + m_Desc = {}; + for (UINT i = 0; i < m_NumStrings; i++) + { + m_Strings[i].clear(); + } + } + void* Data() noexcept override { return &m_Desc; } + D3D12_HIT_GROUP_DESC m_Desc; + static constexpr UINT m_NumStrings = 4; + CD3DX12_STATE_OBJECT_DESC::StringContainer + m_Strings[m_NumStrings]; // one string for every entrypoint name +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_RAYTRACING_SHADER_CONFIG_SUBOBJECT + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_RAYTRACING_SHADER_CONFIG_SUBOBJECT() noexcept + { + Init(); + } + CD3DX12_RAYTRACING_SHADER_CONFIG_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + void Config(UINT MaxPayloadSizeInBytes, UINT MaxAttributeSizeInBytes) noexcept + { + m_Desc.MaxPayloadSizeInBytes = MaxPayloadSizeInBytes; + m_Desc.MaxAttributeSizeInBytes = MaxAttributeSizeInBytes; + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_SHADER_CONFIG; + } + operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; } + operator const D3D12_RAYTRACING_SHADER_CONFIG&() const noexcept { return m_Desc; } +private: + void Init() noexcept + { + SUBOBJECT_HELPER_BASE::Init(); + m_Desc = {}; + } + void* Data() noexcept override { return &m_Desc; } + D3D12_RAYTRACING_SHADER_CONFIG m_Desc; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_RAYTRACING_PIPELINE_CONFIG_SUBOBJECT + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_RAYTRACING_PIPELINE_CONFIG_SUBOBJECT() noexcept + { + Init(); + } + CD3DX12_RAYTRACING_PIPELINE_CONFIG_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + void Config(UINT MaxTraceRecursionDepth) noexcept + { + m_Desc.MaxTraceRecursionDepth = MaxTraceRecursionDepth; + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_PIPELINE_CONFIG; + } + operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; } + operator const D3D12_RAYTRACING_PIPELINE_CONFIG&() const noexcept { return m_Desc; } +private: + void Init() noexcept + { + SUBOBJECT_HELPER_BASE::Init(); + m_Desc = {}; + } + void* Data() noexcept override { return &m_Desc; } + D3D12_RAYTRACING_PIPELINE_CONFIG m_Desc; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_RAYTRACING_PIPELINE_CONFIG1_SUBOBJECT + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_RAYTRACING_PIPELINE_CONFIG1_SUBOBJECT() noexcept + { + Init(); + } + CD3DX12_RAYTRACING_PIPELINE_CONFIG1_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + void Config(UINT MaxTraceRecursionDepth, D3D12_RAYTRACING_PIPELINE_FLAGS Flags) noexcept + { + m_Desc.MaxTraceRecursionDepth = MaxTraceRecursionDepth; + m_Desc.Flags = Flags; + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_PIPELINE_CONFIG1; + } + operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; } + operator const D3D12_RAYTRACING_PIPELINE_CONFIG1&() const noexcept { return m_Desc; } +private: + void Init() noexcept + { + SUBOBJECT_HELPER_BASE::Init(); + m_Desc = {}; + } + void* Data() noexcept override { return &m_Desc; } + D3D12_RAYTRACING_PIPELINE_CONFIG1 m_Desc; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_GLOBAL_ROOT_SIGNATURE_SUBOBJECT + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_GLOBAL_ROOT_SIGNATURE_SUBOBJECT() noexcept + { + Init(); + } + CD3DX12_GLOBAL_ROOT_SIGNATURE_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + void SetRootSignature(ID3D12RootSignature* pRootSig) noexcept + { + m_pRootSig = pRootSig; + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_GLOBAL_ROOT_SIGNATURE; + } + operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; } + operator ID3D12RootSignature*() const noexcept { return D3DX12_COM_PTR_GET(m_pRootSig); } +private: + void Init() noexcept + { + SUBOBJECT_HELPER_BASE::Init(); + m_pRootSig = nullptr; + } + void* Data() noexcept override { return D3DX12_COM_PTR_ADDRESSOF(m_pRootSig); } + D3DX12_COM_PTR<ID3D12RootSignature> m_pRootSig; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_LOCAL_ROOT_SIGNATURE_SUBOBJECT + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_LOCAL_ROOT_SIGNATURE_SUBOBJECT() noexcept + { + Init(); + } + CD3DX12_LOCAL_ROOT_SIGNATURE_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + void SetRootSignature(ID3D12RootSignature* pRootSig) noexcept + { + m_pRootSig = pRootSig; + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_LOCAL_ROOT_SIGNATURE; + } + operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; } + operator ID3D12RootSignature*() const noexcept { return D3DX12_COM_PTR_GET(m_pRootSig); } +private: + void Init() noexcept + { + SUBOBJECT_HELPER_BASE::Init(); + m_pRootSig = nullptr; + } + void* Data() noexcept override { return D3DX12_COM_PTR_ADDRESSOF(m_pRootSig); } + D3DX12_COM_PTR<ID3D12RootSignature> m_pRootSig; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_STATE_OBJECT_CONFIG_SUBOBJECT + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_STATE_OBJECT_CONFIG_SUBOBJECT() noexcept + { + Init(); + } + CD3DX12_STATE_OBJECT_CONFIG_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + void SetFlags(D3D12_STATE_OBJECT_FLAGS Flags) noexcept + { + m_Desc.Flags = Flags; + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_STATE_OBJECT_CONFIG; + } + operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; } + operator const D3D12_STATE_OBJECT_CONFIG&() const noexcept { return m_Desc; } +private: + void Init() noexcept + { + SUBOBJECT_HELPER_BASE::Init(); + m_Desc = {}; + } + void* Data() noexcept override { return &m_Desc; } + D3D12_STATE_OBJECT_CONFIG m_Desc; +}; + +//------------------------------------------------------------------------------------------------ +class CD3DX12_NODE_MASK_SUBOBJECT + : public CD3DX12_STATE_OBJECT_DESC::SUBOBJECT_HELPER_BASE +{ +public: + CD3DX12_NODE_MASK_SUBOBJECT() noexcept + { + Init(); + } + CD3DX12_NODE_MASK_SUBOBJECT(CD3DX12_STATE_OBJECT_DESC& ContainingStateObject) + { + Init(); + AddToStateObject(ContainingStateObject); + } + void SetNodeMask(UINT NodeMask) noexcept + { + m_Desc.NodeMask = NodeMask; + } + D3D12_STATE_SUBOBJECT_TYPE Type() const noexcept override + { + return D3D12_STATE_SUBOBJECT_TYPE_NODE_MASK; + } + operator const D3D12_STATE_SUBOBJECT&() const noexcept { return *m_pSubobject; } + operator const D3D12_NODE_MASK&() const noexcept { return m_Desc; } +private: + void Init() noexcept + { + SUBOBJECT_HELPER_BASE::Init(); + m_Desc = {}; + } + void* Data() noexcept override { return &m_Desc; } + D3D12_NODE_MASK m_Desc; +}; + +#endif // !D3DX12_NO_STATE_OBJECT_HELPERS + + +//================================================================================================ +// D3DX12 Enhanced Barrier Helpers +//================================================================================================ + +class CD3DX12_BARRIER_SUBRESOURCE_RANGE : public D3D12_BARRIER_SUBRESOURCE_RANGE +{ +public: + CD3DX12_BARRIER_SUBRESOURCE_RANGE() = default; + CD3DX12_BARRIER_SUBRESOURCE_RANGE(const D3D12_BARRIER_SUBRESOURCE_RANGE &o) noexcept : + D3D12_BARRIER_SUBRESOURCE_RANGE(o) + {} + explicit CD3DX12_BARRIER_SUBRESOURCE_RANGE(UINT Subresource) noexcept : + D3D12_BARRIER_SUBRESOURCE_RANGE{ Subresource, 0, 0, 0, 0, 0 } + {} + CD3DX12_BARRIER_SUBRESOURCE_RANGE( + UINT FirstMipLevel, + UINT NumMips, + UINT FirstArraySlice, + UINT NumArraySlices, + UINT FirstPlane = 0, + UINT NumPlanes = 1) noexcept : + D3D12_BARRIER_SUBRESOURCE_RANGE + { + FirstMipLevel, + NumMips, + FirstArraySlice, + NumArraySlices, + FirstPlane, + NumPlanes + } + {} +}; + +class CD3DX12_GLOBAL_BARRIER : public D3D12_GLOBAL_BARRIER +{ +public: + CD3DX12_GLOBAL_BARRIER() = default; + CD3DX12_GLOBAL_BARRIER(const D3D12_GLOBAL_BARRIER &o) noexcept : D3D12_GLOBAL_BARRIER(o){} + CD3DX12_GLOBAL_BARRIER( + D3D12_BARRIER_SYNC syncBefore, + D3D12_BARRIER_SYNC syncAfter, + D3D12_BARRIER_ACCESS accessBefore, + D3D12_BARRIER_ACCESS accessAfter) noexcept : D3D12_GLOBAL_BARRIER { + syncBefore, + syncAfter, + accessBefore, + accessAfter + } + {} +}; + +class CD3DX12_BUFFER_BARRIER : public D3D12_BUFFER_BARRIER +{ +public: + CD3DX12_BUFFER_BARRIER() = default; + CD3DX12_BUFFER_BARRIER(const D3D12_BUFFER_BARRIER &o) noexcept : D3D12_BUFFER_BARRIER(o){} + CD3DX12_BUFFER_BARRIER( + D3D12_BARRIER_SYNC syncBefore, + D3D12_BARRIER_SYNC syncAfter, + D3D12_BARRIER_ACCESS accessBefore, + D3D12_BARRIER_ACCESS accessAfter, + ID3D12Resource *pRes) noexcept : D3D12_BUFFER_BARRIER { + syncBefore, + syncAfter, + accessBefore, + accessAfter, + pRes, + 0, ULLONG_MAX + } + {} +}; + +class CD3DX12_TEXTURE_BARRIER : public D3D12_TEXTURE_BARRIER +{ +public: + CD3DX12_TEXTURE_BARRIER() = default; + CD3DX12_TEXTURE_BARRIER(const D3D12_TEXTURE_BARRIER &o) noexcept : D3D12_TEXTURE_BARRIER(o){} + CD3DX12_TEXTURE_BARRIER( + D3D12_BARRIER_SYNC syncBefore, + D3D12_BARRIER_SYNC syncAfter, + D3D12_BARRIER_ACCESS accessBefore, + D3D12_BARRIER_ACCESS accessAfter, + D3D12_BARRIER_LAYOUT layoutBefore, + D3D12_BARRIER_LAYOUT layoutAfter, + ID3D12Resource *pRes, + const D3D12_BARRIER_SUBRESOURCE_RANGE &subresources, + D3D12_TEXTURE_BARRIER_FLAGS flag = D3D12_TEXTURE_BARRIER_FLAG_NONE) noexcept : D3D12_TEXTURE_BARRIER { + syncBefore, + syncAfter, + accessBefore, + accessAfter, + layoutBefore, + layoutAfter, + pRes, + subresources, + flag + } + {} +}; + +class CD3DX12_BARRIER_GROUP : public D3D12_BARRIER_GROUP +{ +public: + CD3DX12_BARRIER_GROUP() = default; + CD3DX12_BARRIER_GROUP(const D3D12_BARRIER_GROUP &o) noexcept : D3D12_BARRIER_GROUP(o){} + CD3DX12_BARRIER_GROUP(UINT32 numBarriers, const D3D12_BUFFER_BARRIER *pBarriers) noexcept + { + Type = D3D12_BARRIER_TYPE_BUFFER; + NumBarriers = numBarriers; + pBufferBarriers = pBarriers; + } + CD3DX12_BARRIER_GROUP(UINT32 numBarriers, const D3D12_TEXTURE_BARRIER *pBarriers) noexcept + { + Type = D3D12_BARRIER_TYPE_TEXTURE; + NumBarriers = numBarriers; + pTextureBarriers = pBarriers; + } + CD3DX12_BARRIER_GROUP(UINT32 numBarriers, const D3D12_GLOBAL_BARRIER *pBarriers) noexcept + { + Type = D3D12_BARRIER_TYPE_GLOBAL; + NumBarriers = numBarriers; + pGlobalBarriers = pBarriers; + } +}; + + +#ifndef D3DX12_NO_CHECK_FEATURE_SUPPORT_CLASS + +//================================================================================================ +// D3DX12 Check Feature Support +//================================================================================================ + +#include <vector> + +class CD3DX12FeatureSupport +{ +public: // Function declaration + // Default constructor that creates an empty object + CD3DX12FeatureSupport() noexcept; + + // Initialize data from the given device + HRESULT Init(ID3D12Device* pDevice); + + // Retreives the status of the object. If an error occurred in the initialization process, the function returns the error code. + HRESULT GetStatus() const noexcept { return m_hStatus; } + + // Getter functions for each feature class + // D3D12_OPTIONS + BOOL DoublePrecisionFloatShaderOps() const noexcept; + BOOL OutputMergerLogicOp() const noexcept; + D3D12_SHADER_MIN_PRECISION_SUPPORT MinPrecisionSupport() const noexcept; + D3D12_TILED_RESOURCES_TIER TiledResourcesTier() const noexcept; + D3D12_RESOURCE_BINDING_TIER ResourceBindingTier() const noexcept; + BOOL PSSpecifiedStencilRefSupported() const noexcept; + BOOL TypedUAVLoadAdditionalFormats() const noexcept; + BOOL ROVsSupported() const noexcept; + D3D12_CONSERVATIVE_RASTERIZATION_TIER ConservativeRasterizationTier() const noexcept; + BOOL StandardSwizzle64KBSupported() const noexcept; + BOOL CrossAdapterRowMajorTextureSupported() const noexcept; + BOOL VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation() const noexcept; + D3D12_RESOURCE_HEAP_TIER ResourceHeapTier() const noexcept; + D3D12_CROSS_NODE_SHARING_TIER CrossNodeSharingTier() const noexcept; + UINT MaxGPUVirtualAddressBitsPerResource() const noexcept; + + // FEATURE_LEVELS + D3D_FEATURE_LEVEL MaxSupportedFeatureLevel() const noexcept; + + // FORMAT_SUPPORT + HRESULT FormatSupport(DXGI_FORMAT Format, D3D12_FORMAT_SUPPORT1& Support1, D3D12_FORMAT_SUPPORT2& Support2) const; + + // MUTLTISAMPLE_QUALITY_LEVELS + HRESULT MultisampleQualityLevels(DXGI_FORMAT Format, UINT SampleCount, D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS Flags, UINT& NumQualityLevels) const; + + // FORMAT_INFO + HRESULT FormatInfo(DXGI_FORMAT Format, UINT8& PlaneCount) const; + + // GPU_VIRTUAL_ADDRESS_SUPPORT + UINT MaxGPUVirtualAddressBitsPerProcess() const noexcept; + + // SHADER_MODEL + D3D_SHADER_MODEL HighestShaderModel() const noexcept; + + // D3D12_OPTIONS1 + BOOL WaveOps() const noexcept; + UINT WaveLaneCountMin() const noexcept; + UINT WaveLaneCountMax() const noexcept; + UINT TotalLaneCount() const noexcept; + BOOL ExpandedComputeResourceStates() const noexcept; + BOOL Int64ShaderOps() const noexcept; + + // PROTECTED_RESOURCE_SESSION_SUPPORT + D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAGS ProtectedResourceSessionSupport(UINT NodeIndex = 0) const; + + // ROOT_SIGNATURE + D3D_ROOT_SIGNATURE_VERSION HighestRootSignatureVersion() const noexcept; + + // ARCHITECTURE1 + BOOL TileBasedRenderer(UINT NodeIndex = 0) const; + BOOL UMA(UINT NodeIndex = 0) const; + BOOL CacheCoherentUMA(UINT NodeIndex = 0) const; + BOOL IsolatedMMU(UINT NodeIndex = 0) const; + + // D3D12_OPTIONS2 + BOOL DepthBoundsTestSupported() const noexcept; + D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER ProgrammableSamplePositionsTier() const noexcept; + + // SHADER_CACHE + D3D12_SHADER_CACHE_SUPPORT_FLAGS ShaderCacheSupportFlags() const noexcept; + + // COMMAND_QUEUE_PRIORITY + BOOL CommandQueuePrioritySupported(D3D12_COMMAND_LIST_TYPE CommandListType, UINT Priority); + + // D3D12_OPTIONS3 + BOOL CopyQueueTimestampQueriesSupported() const noexcept; + BOOL CastingFullyTypedFormatSupported() const noexcept; + D3D12_COMMAND_LIST_SUPPORT_FLAGS WriteBufferImmediateSupportFlags() const noexcept; + D3D12_VIEW_INSTANCING_TIER ViewInstancingTier() const noexcept; + BOOL BarycentricsSupported() const noexcept; + + // EXISTING_HEAPS + BOOL ExistingHeapsSupported() const noexcept; + + // D3D12_OPTIONS4 + BOOL MSAA64KBAlignedTextureSupported() const noexcept; + D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER SharedResourceCompatibilityTier() const noexcept; + BOOL Native16BitShaderOpsSupported() const noexcept; + + // SERIALIZATION + D3D12_HEAP_SERIALIZATION_TIER HeapSerializationTier(UINT NodeIndex = 0) const; + + // CROSS_NODE + // CrossNodeSharingTier handled in D3D12Options + BOOL CrossNodeAtomicShaderInstructions() const noexcept; + + // D3D12_OPTIONS5 + BOOL SRVOnlyTiledResourceTier3() const noexcept; + D3D12_RENDER_PASS_TIER RenderPassesTier() const noexcept; + D3D12_RAYTRACING_TIER RaytracingTier() const noexcept; + + // DISPLAYABLE + BOOL DisplayableTexture() const noexcept; + // SharedResourceCompatibilityTier handled in D3D12Options4 + + // D3D12_OPTIONS6 + BOOL AdditionalShadingRatesSupported() const noexcept; + BOOL PerPrimitiveShadingRateSupportedWithViewportIndexing() const noexcept; + D3D12_VARIABLE_SHADING_RATE_TIER VariableShadingRateTier() const noexcept; + UINT ShadingRateImageTileSize() const noexcept; + BOOL BackgroundProcessingSupported() const noexcept; + + // QUERY_META_COMMAND + HRESULT QueryMetaCommand(D3D12_FEATURE_DATA_QUERY_META_COMMAND& dQueryMetaCommand) const; + + // D3D12_OPTIONS7 + D3D12_MESH_SHADER_TIER MeshShaderTier() const noexcept; + D3D12_SAMPLER_FEEDBACK_TIER SamplerFeedbackTier() const noexcept; + + // PROTECTED_RESOURCE_SESSION_TYPE_COUNT + UINT ProtectedResourceSessionTypeCount(UINT NodeIndex = 0) const; + + // PROTECTED_RESOURCE_SESSION_TYPES + std::vector<GUID> ProtectedResourceSessionTypes(UINT NodeIndex = 0) const; + + // D3D12_OPTIONS8 + BOOL UnalignedBlockTexturesSupported() const noexcept; + + // D3D12_OPTIONS9 + BOOL MeshShaderPipelineStatsSupported() const noexcept; + BOOL MeshShaderSupportsFullRangeRenderTargetArrayIndex() const noexcept; + BOOL AtomicInt64OnTypedResourceSupported() const noexcept; + BOOL AtomicInt64OnGroupSharedSupported() const noexcept; + BOOL DerivativesInMeshAndAmplificationShadersSupported() const noexcept; + D3D12_WAVE_MMA_TIER WaveMMATier() const noexcept; + + // D3D12_OPTIONS10 + BOOL VariableRateShadingSumCombinerSupported() const noexcept; + BOOL MeshShaderPerPrimitiveShadingRateSupported() const noexcept; + + // D3D12_OPTIONS11 + BOOL AtomicInt64OnDescriptorHeapResourceSupported() const noexcept; + + // D3D12_OPTIONS12 + D3D12_TRI_STATE MSPrimitivesPipelineStatisticIncludesCulledPrimitives() const noexcept; + BOOL EnhancedBarriersSupported() const noexcept; + BOOL RelaxedFormatCastingSupported() const noexcept; + + // D3D12_OPTIONS13 + BOOL UnrestrictedBufferTextureCopyPitchSupported() const noexcept; + BOOL UnrestrictedVertexElementAlignmentSupported() const noexcept; + BOOL InvertedViewportHeightFlipsYSupported() const noexcept; + BOOL InvertedViewportDepthFlipsZSupported() const noexcept; + BOOL TextureCopyBetweenDimensionsSupported() const noexcept; + BOOL AlphaBlendFactorSupported() const noexcept; + + // D3D12_OPTIONS14 + BOOL AdvancedTextureOpsSupported() const noexcept; + BOOL WriteableMSAATexturesSupported() const noexcept; + BOOL IndependentFrontAndBackStencilRefMaskSupported() const noexcept; + + // D3D12_OPTIONS15 + BOOL TriangleFanSupported() const noexcept; + BOOL DynamicIndexBufferStripCutSupported() const noexcept; + +private: // Private structs and helpers declaration + struct ProtectedResourceSessionTypesLocal : D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_TYPES + { + std::vector<GUID> TypeVec; + }; + + // Helper function to decide the highest shader model supported by the system + // Stores the result in m_dShaderModel + // Must be updated whenever a new shader model is added to the d3d12.h header + HRESULT QueryHighestShaderModel(); + + // Helper function to decide the highest root signature supported + // Must be updated whenever a new root signature version is added to the d3d12.h header + HRESULT QueryHighestRootSignatureVersion(); + + // Helper funcion to decide the highest feature level + HRESULT QueryHighestFeatureLevel(); + + // Helper function to initialize local protected resource session types structs + HRESULT QueryProtectedResourceSessionTypes(UINT NodeIndex, UINT Count); + +private: // Member data + // Pointer to the underlying device + ID3D12Device* m_pDevice; + + // Stores the error code from initialization + HRESULT m_hStatus; + + // Feature support data structs + D3D12_FEATURE_DATA_D3D12_OPTIONS m_dOptions; + D3D_FEATURE_LEVEL m_eMaxFeatureLevel; + D3D12_FEATURE_DATA_GPU_VIRTUAL_ADDRESS_SUPPORT m_dGPUVASupport; + D3D12_FEATURE_DATA_SHADER_MODEL m_dShaderModel; + D3D12_FEATURE_DATA_D3D12_OPTIONS1 m_dOptions1; + std::vector<D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_SUPPORT> m_dProtectedResourceSessionSupport; + D3D12_FEATURE_DATA_ROOT_SIGNATURE m_dRootSignature; + std::vector<D3D12_FEATURE_DATA_ARCHITECTURE1> m_dArchitecture1; + D3D12_FEATURE_DATA_D3D12_OPTIONS2 m_dOptions2; + D3D12_FEATURE_DATA_SHADER_CACHE m_dShaderCache; + D3D12_FEATURE_DATA_COMMAND_QUEUE_PRIORITY m_dCommandQueuePriority; + D3D12_FEATURE_DATA_D3D12_OPTIONS3 m_dOptions3; + D3D12_FEATURE_DATA_EXISTING_HEAPS m_dExistingHeaps; + D3D12_FEATURE_DATA_D3D12_OPTIONS4 m_dOptions4; + std::vector<D3D12_FEATURE_DATA_SERIALIZATION> m_dSerialization; // Cat2 NodeIndex + D3D12_FEATURE_DATA_CROSS_NODE m_dCrossNode; + D3D12_FEATURE_DATA_D3D12_OPTIONS5 m_dOptions5; + D3D12_FEATURE_DATA_DISPLAYABLE m_dDisplayable; + D3D12_FEATURE_DATA_D3D12_OPTIONS6 m_dOptions6; + D3D12_FEATURE_DATA_D3D12_OPTIONS7 m_dOptions7; + std::vector<D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_TYPE_COUNT> m_dProtectedResourceSessionTypeCount; // Cat2 NodeIndex + std::vector<ProtectedResourceSessionTypesLocal> m_dProtectedResourceSessionTypes; // Cat3 + D3D12_FEATURE_DATA_D3D12_OPTIONS8 m_dOptions8; + D3D12_FEATURE_DATA_D3D12_OPTIONS9 m_dOptions9; + D3D12_FEATURE_DATA_D3D12_OPTIONS10 m_dOptions10; + D3D12_FEATURE_DATA_D3D12_OPTIONS11 m_dOptions11; + D3D12_FEATURE_DATA_D3D12_OPTIONS12 m_dOptions12; + D3D12_FEATURE_DATA_D3D12_OPTIONS13 m_dOptions13; + D3D12_FEATURE_DATA_D3D12_OPTIONS14 m_dOptions14; + D3D12_FEATURE_DATA_D3D12_OPTIONS15 m_dOptions15; +}; + +// Implementations for CD3DX12FeatureSupport functions + +// Macro to set up a getter function for each entry in feature support data +// The getter function will have the same name as the feature option name +#define FEATURE_SUPPORT_GET(RETTYPE,FEATURE,OPTION) \ +inline RETTYPE CD3DX12FeatureSupport::OPTION() const noexcept \ +{ \ + return FEATURE.OPTION; \ +} + +// Macro to set up a getter function for each entry in feature support data +// Also specifies the name for the function which can be different from the feature name +#define FEATURE_SUPPORT_GET_NAME(RETTYPE,FEATURE,OPTION,NAME) \ +inline RETTYPE CD3DX12FeatureSupport::NAME() const noexcept \ +{\ + return FEATURE.OPTION; \ +} + +// Macro to set up a getter function for feature data indexed by the graphics node ID +// The default parameter is 0, or the first availabe graphics device node +#define FEATURE_SUPPORT_GET_NODE_INDEXED(RETTYPE,FEATURE,OPTION) \ +inline RETTYPE CD3DX12FeatureSupport::OPTION(UINT NodeIndex) const \ +{\ + return FEATURE[NodeIndex].OPTION; \ +} + +// Macro to set up a getter function for feature data indexed by NodeIndex +// Allows a custom name for the getter function +#define FEATURE_SUPPORT_GET_NODE_INDEXED_NAME(RETTYPE,FEATURE,OPTION,NAME) \ +inline RETTYPE CD3DX12FeatureSupport::NAME(UINT NodeIndex) const \ +{\ + return FEATURE[NodeIndex].OPTION; \ +} + +inline CD3DX12FeatureSupport::CD3DX12FeatureSupport() noexcept +: m_pDevice(nullptr) +, m_hStatus(E_INVALIDARG) +, m_dOptions{} +, m_eMaxFeatureLevel{} +, m_dGPUVASupport{} +, m_dShaderModel{} +, m_dOptions1{} +, m_dRootSignature{} +, m_dOptions2{} +, m_dShaderCache{} +, m_dCommandQueuePriority{} +, m_dOptions3{} +, m_dExistingHeaps{} +, m_dOptions4{} +, m_dCrossNode{} +, m_dOptions5{} +, m_dDisplayable{} +, m_dOptions6{} +, m_dOptions7{} +, m_dOptions8{} +, m_dOptions9{} +, m_dOptions10{} +, m_dOptions11{} +, m_dOptions12{} +, m_dOptions13{} +, m_dOptions14{} +, m_dOptions15{} +{} + +inline HRESULT CD3DX12FeatureSupport::Init(ID3D12Device* pDevice) +{ + if (!pDevice) + { + m_hStatus = E_INVALIDARG; + return m_hStatus; + } + + m_pDevice = pDevice; + + // Initialize static feature support data structures + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS, &m_dOptions, sizeof(m_dOptions)))) + { + m_dOptions.DoublePrecisionFloatShaderOps = false; + m_dOptions.OutputMergerLogicOp = false; + m_dOptions.MinPrecisionSupport = D3D12_SHADER_MIN_PRECISION_SUPPORT_NONE; + m_dOptions.TiledResourcesTier = D3D12_TILED_RESOURCES_TIER_NOT_SUPPORTED; + m_dOptions.ResourceBindingTier = static_cast<D3D12_RESOURCE_BINDING_TIER>(0); + m_dOptions.PSSpecifiedStencilRefSupported = false; + m_dOptions.TypedUAVLoadAdditionalFormats = false; + m_dOptions.ROVsSupported = false; + m_dOptions.ConservativeRasterizationTier = D3D12_CONSERVATIVE_RASTERIZATION_TIER_NOT_SUPPORTED; + m_dOptions.MaxGPUVirtualAddressBitsPerResource = 0; + m_dOptions.StandardSwizzle64KBSupported = false; + m_dOptions.CrossNodeSharingTier = D3D12_CROSS_NODE_SHARING_TIER_NOT_SUPPORTED; + m_dOptions.CrossAdapterRowMajorTextureSupported = false; + m_dOptions.VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation = false; + m_dOptions.ResourceHeapTier = static_cast<D3D12_RESOURCE_HEAP_TIER>(0); + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_GPU_VIRTUAL_ADDRESS_SUPPORT, &m_dGPUVASupport, sizeof(m_dGPUVASupport)))) + { + m_dGPUVASupport.MaxGPUVirtualAddressBitsPerProcess = 0; + m_dGPUVASupport.MaxGPUVirtualAddressBitsPerResource = 0; + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS1, &m_dOptions1, sizeof(m_dOptions1)))) + { + m_dOptions1.WaveOps = false; + m_dOptions1.WaveLaneCountMax = 0; + m_dOptions1.WaveLaneCountMin = 0; + m_dOptions1.TotalLaneCount = 0; + m_dOptions1.ExpandedComputeResourceStates = 0; + m_dOptions1.Int64ShaderOps = 0; + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS2, &m_dOptions2, sizeof(m_dOptions2)))) + { + m_dOptions2.DepthBoundsTestSupported = false; + m_dOptions2.ProgrammableSamplePositionsTier = D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER_NOT_SUPPORTED; + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_SHADER_CACHE, &m_dShaderCache, sizeof(m_dShaderCache)))) + { + m_dShaderCache.SupportFlags = D3D12_SHADER_CACHE_SUPPORT_NONE; + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS3, &m_dOptions3, sizeof(m_dOptions3)))) + { + m_dOptions3.CopyQueueTimestampQueriesSupported = false; + m_dOptions3.CastingFullyTypedFormatSupported = false; + m_dOptions3.WriteBufferImmediateSupportFlags = D3D12_COMMAND_LIST_SUPPORT_FLAG_NONE; + m_dOptions3.ViewInstancingTier = D3D12_VIEW_INSTANCING_TIER_NOT_SUPPORTED; + m_dOptions3.BarycentricsSupported = false; + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_EXISTING_HEAPS, &m_dExistingHeaps, sizeof(m_dExistingHeaps)))) + { + m_dExistingHeaps.Supported = false; + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS4, &m_dOptions4, sizeof(m_dOptions4)))) + { + m_dOptions4.MSAA64KBAlignedTextureSupported = false; + m_dOptions4.Native16BitShaderOpsSupported = false; + m_dOptions4.SharedResourceCompatibilityTier = D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_0; + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_CROSS_NODE, &m_dCrossNode, sizeof(m_dCrossNode)))) + { + m_dCrossNode.SharingTier = D3D12_CROSS_NODE_SHARING_TIER_NOT_SUPPORTED; + m_dCrossNode.AtomicShaderInstructions = false; + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS5, &m_dOptions5, sizeof(m_dOptions5)))) + { + m_dOptions5.SRVOnlyTiledResourceTier3 = false; + m_dOptions5.RenderPassesTier = D3D12_RENDER_PASS_TIER_0; + m_dOptions5.RaytracingTier = D3D12_RAYTRACING_TIER_NOT_SUPPORTED; + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_DISPLAYABLE, &m_dDisplayable, sizeof(m_dDisplayable)))) + { + m_dDisplayable.DisplayableTexture = false; + m_dDisplayable.SharedResourceCompatibilityTier = D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_0; + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS6, &m_dOptions6, sizeof(m_dOptions6)))) + { + m_dOptions6.AdditionalShadingRatesSupported = false; + m_dOptions6.PerPrimitiveShadingRateSupportedWithViewportIndexing = false; + m_dOptions6.VariableShadingRateTier = D3D12_VARIABLE_SHADING_RATE_TIER_NOT_SUPPORTED; + m_dOptions6.ShadingRateImageTileSize = 0; + m_dOptions6.BackgroundProcessingSupported = false; + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS7, &m_dOptions7, sizeof(m_dOptions7)))) + { + m_dOptions7.MeshShaderTier = D3D12_MESH_SHADER_TIER_NOT_SUPPORTED; + m_dOptions7.SamplerFeedbackTier = D3D12_SAMPLER_FEEDBACK_TIER_NOT_SUPPORTED; + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS8, &m_dOptions8, sizeof(m_dOptions8)))) + { + m_dOptions8.UnalignedBlockTexturesSupported = false; + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS9, &m_dOptions9, sizeof(m_dOptions9)))) + { + m_dOptions9.MeshShaderPipelineStatsSupported = false; + m_dOptions9.MeshShaderSupportsFullRangeRenderTargetArrayIndex = false; + m_dOptions9.AtomicInt64OnGroupSharedSupported = false; + m_dOptions9.AtomicInt64OnTypedResourceSupported = false; + m_dOptions9.DerivativesInMeshAndAmplificationShadersSupported = false; + m_dOptions9.WaveMMATier = D3D12_WAVE_MMA_TIER_NOT_SUPPORTED; + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS10, &m_dOptions10, sizeof(m_dOptions10)))) + { + m_dOptions10.MeshShaderPerPrimitiveShadingRateSupported = false; + m_dOptions10.VariableRateShadingSumCombinerSupported = false; + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS11, &m_dOptions11, sizeof(m_dOptions11)))) + { + m_dOptions11.AtomicInt64OnDescriptorHeapResourceSupported = false; + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS12, &m_dOptions12, sizeof(m_dOptions12)))) + { + m_dOptions12.MSPrimitivesPipelineStatisticIncludesCulledPrimitives = D3D12_TRI_STATE::D3D12_TRI_STATE_UNKNOWN; + m_dOptions12.EnhancedBarriersSupported = false; + m_dOptions12.RelaxedFormatCastingSupported = false; + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS13, &m_dOptions13, sizeof(m_dOptions13)))) + { + m_dOptions13.UnrestrictedBufferTextureCopyPitchSupported = false; + m_dOptions13.UnrestrictedVertexElementAlignmentSupported = false; + m_dOptions13.InvertedViewportHeightFlipsYSupported = false; + m_dOptions13.InvertedViewportDepthFlipsZSupported = false; + m_dOptions13.TextureCopyBetweenDimensionsSupported = false; + m_dOptions13.AlphaBlendFactorSupported = false; + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS14, &m_dOptions14, sizeof(m_dOptions14)))) + { + m_dOptions14.AdvancedTextureOpsSupported = false; + m_dOptions14.WriteableMSAATexturesSupported = false; + m_dOptions14.IndependentFrontAndBackStencilRefMaskSupported = false; + } + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS15, &m_dOptions15, sizeof(m_dOptions15)))) + { + m_dOptions15.TriangleFanSupported = false; + m_dOptions15.DynamicIndexBufferStripCutSupported = false; + } + + // Initialize per-node feature support data structures + const UINT uNodeCount = m_pDevice->GetNodeCount(); + m_dProtectedResourceSessionSupport.resize(uNodeCount); + m_dArchitecture1.resize(uNodeCount); + m_dSerialization.resize(uNodeCount); + m_dProtectedResourceSessionTypeCount.resize(uNodeCount); + m_dProtectedResourceSessionTypes.resize(uNodeCount); + for (UINT NodeIndex = 0; NodeIndex < uNodeCount; NodeIndex++) + { + m_dProtectedResourceSessionSupport[NodeIndex].NodeIndex = NodeIndex; + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_PROTECTED_RESOURCE_SESSION_SUPPORT, &m_dProtectedResourceSessionSupport[NodeIndex], sizeof(m_dProtectedResourceSessionSupport[NodeIndex])))) + { + m_dProtectedResourceSessionSupport[NodeIndex].Support = D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG_NONE; + } + + m_dArchitecture1[NodeIndex].NodeIndex = NodeIndex; + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_ARCHITECTURE1, &m_dArchitecture1[NodeIndex], sizeof(m_dArchitecture1[NodeIndex])))) + { + D3D12_FEATURE_DATA_ARCHITECTURE dArchLocal = {}; + dArchLocal.NodeIndex = NodeIndex; + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_ARCHITECTURE, &dArchLocal, sizeof(dArchLocal)))) + { + dArchLocal.TileBasedRenderer = false; + dArchLocal.UMA = false; + dArchLocal.CacheCoherentUMA = false; + } + + m_dArchitecture1[NodeIndex].TileBasedRenderer = dArchLocal.TileBasedRenderer; + m_dArchitecture1[NodeIndex].UMA = dArchLocal.UMA; + m_dArchitecture1[NodeIndex].CacheCoherentUMA = dArchLocal.CacheCoherentUMA; + m_dArchitecture1[NodeIndex].IsolatedMMU = false; + } + + m_dSerialization[NodeIndex].NodeIndex = NodeIndex; + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_SERIALIZATION, &m_dSerialization[NodeIndex], sizeof(m_dSerialization[NodeIndex])))) + { + m_dSerialization[NodeIndex].HeapSerializationTier = D3D12_HEAP_SERIALIZATION_TIER_0; + } + + m_dProtectedResourceSessionTypeCount[NodeIndex].NodeIndex = NodeIndex; + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_PROTECTED_RESOURCE_SESSION_TYPE_COUNT, &m_dProtectedResourceSessionTypeCount[NodeIndex], sizeof(m_dProtectedResourceSessionTypeCount[NodeIndex])))) + { + m_dProtectedResourceSessionTypeCount[NodeIndex].Count = 0; + } + + // Special procedure to initialize local protected resource session types structs + // Must wait until session type count initialized + QueryProtectedResourceSessionTypes(NodeIndex, m_dProtectedResourceSessionTypeCount[NodeIndex].Count); + } + + // Initialize features that requires highest version check + if (FAILED(m_hStatus = QueryHighestShaderModel())) + { + return m_hStatus; + } + + if (FAILED(m_hStatus = QueryHighestRootSignatureVersion())) + { + return m_hStatus; + } + + // Initialize Feature Levels data + if (FAILED(m_hStatus = QueryHighestFeatureLevel())) + { + return m_hStatus; + } + + return m_hStatus; +} + +// 0: D3D12_OPTIONS +FEATURE_SUPPORT_GET(BOOL, m_dOptions, DoublePrecisionFloatShaderOps); +FEATURE_SUPPORT_GET(BOOL, m_dOptions, OutputMergerLogicOp); +FEATURE_SUPPORT_GET(D3D12_SHADER_MIN_PRECISION_SUPPORT, m_dOptions, MinPrecisionSupport); +FEATURE_SUPPORT_GET(D3D12_TILED_RESOURCES_TIER, m_dOptions, TiledResourcesTier); +FEATURE_SUPPORT_GET(D3D12_RESOURCE_BINDING_TIER, m_dOptions, ResourceBindingTier); +FEATURE_SUPPORT_GET(BOOL, m_dOptions, PSSpecifiedStencilRefSupported); +FEATURE_SUPPORT_GET(BOOL, m_dOptions, TypedUAVLoadAdditionalFormats); +FEATURE_SUPPORT_GET(BOOL, m_dOptions, ROVsSupported); +FEATURE_SUPPORT_GET(D3D12_CONSERVATIVE_RASTERIZATION_TIER, m_dOptions, ConservativeRasterizationTier); +FEATURE_SUPPORT_GET(BOOL, m_dOptions, StandardSwizzle64KBSupported); +FEATURE_SUPPORT_GET(BOOL, m_dOptions, CrossAdapterRowMajorTextureSupported); +FEATURE_SUPPORT_GET(BOOL, m_dOptions, VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation); +FEATURE_SUPPORT_GET(D3D12_RESOURCE_HEAP_TIER, m_dOptions, ResourceHeapTier); + +// Special procedure for handling caps that is also part of other features +inline D3D12_CROSS_NODE_SHARING_TIER CD3DX12FeatureSupport::CrossNodeSharingTier() const noexcept +{ + if (m_dCrossNode.SharingTier > D3D12_CROSS_NODE_SHARING_TIER_NOT_SUPPORTED) + { + return m_dCrossNode.SharingTier; + } + else + { + return m_dOptions.CrossNodeSharingTier; + } +} + +inline UINT CD3DX12FeatureSupport::MaxGPUVirtualAddressBitsPerResource() const noexcept +{ + if (m_dOptions.MaxGPUVirtualAddressBitsPerResource > 0) + { + return m_dOptions.MaxGPUVirtualAddressBitsPerResource; + } + else + { + return m_dGPUVASupport.MaxGPUVirtualAddressBitsPerResource; + } +} + +// 1: Architecture +// Combined with Architecture1 + +// 2: Feature Levels +// Simply returns the highest supported feature level +inline D3D_FEATURE_LEVEL CD3DX12FeatureSupport::MaxSupportedFeatureLevel() const noexcept +{ + return m_eMaxFeatureLevel; +} + +// 3: Feature Format Support +inline HRESULT CD3DX12FeatureSupport::FormatSupport(DXGI_FORMAT Format, D3D12_FORMAT_SUPPORT1& Support1, D3D12_FORMAT_SUPPORT2& Support2) const +{ + D3D12_FEATURE_DATA_FORMAT_SUPPORT dFormatSupport; + dFormatSupport.Format = Format; + + // It is possible that the function call returns an error + HRESULT result = m_pDevice->CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT, &dFormatSupport, sizeof(D3D12_FEATURE_DATA_FORMAT_SUPPORT)); + + Support1 = dFormatSupport.Support1; + Support2 = dFormatSupport.Support2; // Two outputs. Probably better just to take in the struct as an argument? + + return result; +} + +// 4: Multisample Quality Levels +inline HRESULT CD3DX12FeatureSupport::MultisampleQualityLevels(DXGI_FORMAT Format, UINT SampleCount, D3D12_MULTISAMPLE_QUALITY_LEVEL_FLAGS Flags, UINT& NumQualityLevels) const +{ + D3D12_FEATURE_DATA_MULTISAMPLE_QUALITY_LEVELS dMultisampleQualityLevels; + dMultisampleQualityLevels.Format = Format; + dMultisampleQualityLevels.SampleCount = SampleCount; + dMultisampleQualityLevels.Flags = Flags; + + HRESULT result = m_pDevice->CheckFeatureSupport(D3D12_FEATURE_MULTISAMPLE_QUALITY_LEVELS, &dMultisampleQualityLevels, sizeof(D3D12_FEATURE_DATA_MULTISAMPLE_QUALITY_LEVELS)); + + if (SUCCEEDED(result)) + { + NumQualityLevels = dMultisampleQualityLevels.NumQualityLevels; + } + else + { + NumQualityLevels = 0; + } + + return result; +} + +// 5: Format Info +inline HRESULT CD3DX12FeatureSupport::FormatInfo(DXGI_FORMAT Format, UINT8& PlaneCount) const +{ + D3D12_FEATURE_DATA_FORMAT_INFO dFormatInfo; + dFormatInfo.Format = Format; + + HRESULT result = m_pDevice->CheckFeatureSupport(D3D12_FEATURE_FORMAT_INFO, &dFormatInfo, sizeof(D3D12_FEATURE_DATA_FORMAT_INFO)); + if (FAILED(result)) + { + PlaneCount = 0; + } + else + { + PlaneCount = dFormatInfo.PlaneCount; + } + return result; +} + +// 6: GPU Virtual Address Support +// MaxGPUVirtualAddressBitsPerResource handled in D3D12Options +FEATURE_SUPPORT_GET(UINT, m_dGPUVASupport, MaxGPUVirtualAddressBitsPerProcess); + +// 7: Shader Model +inline D3D_SHADER_MODEL CD3DX12FeatureSupport::HighestShaderModel() const noexcept +{ + return m_dShaderModel.HighestShaderModel; +} + +// 8: D3D12 Options1 +FEATURE_SUPPORT_GET(BOOL, m_dOptions1, WaveOps); +FEATURE_SUPPORT_GET(UINT, m_dOptions1, WaveLaneCountMin); +FEATURE_SUPPORT_GET(UINT, m_dOptions1, WaveLaneCountMax); +FEATURE_SUPPORT_GET(UINT, m_dOptions1, TotalLaneCount); +FEATURE_SUPPORT_GET(BOOL, m_dOptions1, ExpandedComputeResourceStates); +FEATURE_SUPPORT_GET(BOOL, m_dOptions1, Int64ShaderOps); + +// 10: Protected Resource Session Support +inline D3D12_PROTECTED_RESOURCE_SESSION_SUPPORT_FLAGS CD3DX12FeatureSupport::ProtectedResourceSessionSupport(UINT NodeIndex) const +{ + return m_dProtectedResourceSessionSupport[NodeIndex].Support; +} + +// 12: Root Signature +inline D3D_ROOT_SIGNATURE_VERSION CD3DX12FeatureSupport::HighestRootSignatureVersion() const noexcept +{ + return m_dRootSignature.HighestVersion; +} + +// 16: Architecture1 +// Same data fields can be queried from m_dArchitecture +FEATURE_SUPPORT_GET_NODE_INDEXED(BOOL, m_dArchitecture1, TileBasedRenderer); +FEATURE_SUPPORT_GET_NODE_INDEXED(BOOL, m_dArchitecture1, UMA); +FEATURE_SUPPORT_GET_NODE_INDEXED(BOOL, m_dArchitecture1, CacheCoherentUMA); +FEATURE_SUPPORT_GET_NODE_INDEXED(BOOL, m_dArchitecture1, IsolatedMMU); + +// 18: D3D12 Options2 +FEATURE_SUPPORT_GET(BOOL, m_dOptions2, DepthBoundsTestSupported); +FEATURE_SUPPORT_GET(D3D12_PROGRAMMABLE_SAMPLE_POSITIONS_TIER, m_dOptions2, ProgrammableSamplePositionsTier); + +// 19: Shader Cache +FEATURE_SUPPORT_GET_NAME(D3D12_SHADER_CACHE_SUPPORT_FLAGS, m_dShaderCache, SupportFlags, ShaderCacheSupportFlags); + +// 20: Command Queue Priority +inline BOOL CD3DX12FeatureSupport::CommandQueuePrioritySupported(D3D12_COMMAND_LIST_TYPE CommandListType, UINT Priority) +{ + m_dCommandQueuePriority.CommandListType = CommandListType; + m_dCommandQueuePriority.Priority = Priority; + + if (FAILED(m_pDevice->CheckFeatureSupport(D3D12_FEATURE_COMMAND_QUEUE_PRIORITY, &m_dCommandQueuePriority, sizeof(D3D12_FEATURE_DATA_COMMAND_QUEUE_PRIORITY)))) + { + return false; + } + + return m_dCommandQueuePriority.PriorityForTypeIsSupported; +} + +// 21: D3D12 Options3 +FEATURE_SUPPORT_GET(BOOL, m_dOptions3, CopyQueueTimestampQueriesSupported); +FEATURE_SUPPORT_GET(BOOL, m_dOptions3, CastingFullyTypedFormatSupported); +FEATURE_SUPPORT_GET(D3D12_COMMAND_LIST_SUPPORT_FLAGS, m_dOptions3, WriteBufferImmediateSupportFlags); +FEATURE_SUPPORT_GET(D3D12_VIEW_INSTANCING_TIER, m_dOptions3, ViewInstancingTier); +FEATURE_SUPPORT_GET(BOOL, m_dOptions3, BarycentricsSupported); + +// 22: Existing Heaps +FEATURE_SUPPORT_GET_NAME(BOOL, m_dExistingHeaps, Supported, ExistingHeapsSupported); + +// 23: D3D12 Options4 +FEATURE_SUPPORT_GET(BOOL, m_dOptions4, MSAA64KBAlignedTextureSupported); +FEATURE_SUPPORT_GET(D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER, m_dOptions4, SharedResourceCompatibilityTier); +FEATURE_SUPPORT_GET(BOOL, m_dOptions4, Native16BitShaderOpsSupported); + +// 24: Serialization +FEATURE_SUPPORT_GET_NODE_INDEXED(D3D12_HEAP_SERIALIZATION_TIER, m_dSerialization, HeapSerializationTier); + +// 25: Cross Node +// CrossNodeSharingTier handled in D3D12Options +FEATURE_SUPPORT_GET_NAME(BOOL, m_dCrossNode, AtomicShaderInstructions, CrossNodeAtomicShaderInstructions); + +// 27: D3D12 Options5 +FEATURE_SUPPORT_GET(BOOL, m_dOptions5, SRVOnlyTiledResourceTier3); +FEATURE_SUPPORT_GET(D3D12_RENDER_PASS_TIER, m_dOptions5, RenderPassesTier); +FEATURE_SUPPORT_GET(D3D12_RAYTRACING_TIER, m_dOptions5, RaytracingTier); + +// 28: Displayable +FEATURE_SUPPORT_GET(BOOL, m_dDisplayable, DisplayableTexture); +// SharedResourceCompatibilityTier handled in D3D12Options4 + +// 30: D3D12 Options6 +FEATURE_SUPPORT_GET(BOOL, m_dOptions6, AdditionalShadingRatesSupported); +FEATURE_SUPPORT_GET(BOOL, m_dOptions6, PerPrimitiveShadingRateSupportedWithViewportIndexing); +FEATURE_SUPPORT_GET(D3D12_VARIABLE_SHADING_RATE_TIER, m_dOptions6, VariableShadingRateTier); +FEATURE_SUPPORT_GET(UINT, m_dOptions6, ShadingRateImageTileSize); +FEATURE_SUPPORT_GET(BOOL, m_dOptions6, BackgroundProcessingSupported); + +// 31: Query Meta Command +// Keep the original call routine +inline HRESULT CD3DX12FeatureSupport::QueryMetaCommand(D3D12_FEATURE_DATA_QUERY_META_COMMAND& dQueryMetaCommand) const +{ + return m_pDevice->CheckFeatureSupport(D3D12_FEATURE_QUERY_META_COMMAND, &dQueryMetaCommand, sizeof(D3D12_FEATURE_DATA_QUERY_META_COMMAND)); +} + +// 32: D3D12 Options7 +FEATURE_SUPPORT_GET(D3D12_MESH_SHADER_TIER, m_dOptions7, MeshShaderTier); +FEATURE_SUPPORT_GET(D3D12_SAMPLER_FEEDBACK_TIER, m_dOptions7, SamplerFeedbackTier); + +// 33: Protected Resource Session Type Count +FEATURE_SUPPORT_GET_NODE_INDEXED_NAME(UINT, m_dProtectedResourceSessionTypeCount, Count, ProtectedResourceSessionTypeCount); + +// 34: Protected Resource Session Types +FEATURE_SUPPORT_GET_NODE_INDEXED_NAME(std::vector<GUID>, m_dProtectedResourceSessionTypes, TypeVec, ProtectedResourceSessionTypes); + +// 36: Options8 +FEATURE_SUPPORT_GET(BOOL, m_dOptions8, UnalignedBlockTexturesSupported); + +// 37: Options9 +FEATURE_SUPPORT_GET(BOOL, m_dOptions9, MeshShaderPipelineStatsSupported); +FEATURE_SUPPORT_GET(BOOL, m_dOptions9, MeshShaderSupportsFullRangeRenderTargetArrayIndex); +FEATURE_SUPPORT_GET(BOOL, m_dOptions9, AtomicInt64OnTypedResourceSupported); +FEATURE_SUPPORT_GET(BOOL, m_dOptions9, AtomicInt64OnGroupSharedSupported); +FEATURE_SUPPORT_GET(BOOL, m_dOptions9, DerivativesInMeshAndAmplificationShadersSupported); +FEATURE_SUPPORT_GET(D3D12_WAVE_MMA_TIER, m_dOptions9, WaveMMATier); + +// 39: Options10 +FEATURE_SUPPORT_GET(BOOL, m_dOptions10, VariableRateShadingSumCombinerSupported); +FEATURE_SUPPORT_GET(BOOL, m_dOptions10, MeshShaderPerPrimitiveShadingRateSupported); + +// 40: Options11 +FEATURE_SUPPORT_GET(BOOL, m_dOptions11, AtomicInt64OnDescriptorHeapResourceSupported); + +// 41: Options12 +FEATURE_SUPPORT_GET(D3D12_TRI_STATE, m_dOptions12, MSPrimitivesPipelineStatisticIncludesCulledPrimitives); +FEATURE_SUPPORT_GET(BOOL, m_dOptions12, EnhancedBarriersSupported); +FEATURE_SUPPORT_GET(BOOL, m_dOptions12, RelaxedFormatCastingSupported); + +// 42: Options13 +FEATURE_SUPPORT_GET(BOOL, m_dOptions13, UnrestrictedBufferTextureCopyPitchSupported); +FEATURE_SUPPORT_GET(BOOL, m_dOptions13, UnrestrictedVertexElementAlignmentSupported); +FEATURE_SUPPORT_GET(BOOL, m_dOptions13, InvertedViewportHeightFlipsYSupported); +FEATURE_SUPPORT_GET(BOOL, m_dOptions13, InvertedViewportDepthFlipsZSupported); +FEATURE_SUPPORT_GET(BOOL, m_dOptions13, TextureCopyBetweenDimensionsSupported); +FEATURE_SUPPORT_GET(BOOL, m_dOptions13, AlphaBlendFactorSupported); + +// 43: Options14 +FEATURE_SUPPORT_GET(BOOL, m_dOptions14, AdvancedTextureOpsSupported); +FEATURE_SUPPORT_GET(BOOL, m_dOptions14, WriteableMSAATexturesSupported); +FEATURE_SUPPORT_GET(BOOL, m_dOptions14, IndependentFrontAndBackStencilRefMaskSupported); + +// 44: Options15 +FEATURE_SUPPORT_GET(BOOL, m_dOptions15, TriangleFanSupported); +FEATURE_SUPPORT_GET(BOOL, m_dOptions15, DynamicIndexBufferStripCutSupported); + +// Helper function to decide the highest shader model supported by the system +// Stores the result in m_dShaderModel +// Must be updated whenever a new shader model is added to the d3d12.h header +inline HRESULT CD3DX12FeatureSupport::QueryHighestShaderModel() +{ + // Check support in descending order + HRESULT result; + + const D3D_SHADER_MODEL allModelVersions[] = + { + D3D_SHADER_MODEL_6_8, + D3D_SHADER_MODEL_6_7, + D3D_SHADER_MODEL_6_6, + D3D_SHADER_MODEL_6_5, + D3D_SHADER_MODEL_6_4, + D3D_SHADER_MODEL_6_3, + D3D_SHADER_MODEL_6_2, + D3D_SHADER_MODEL_6_1, + D3D_SHADER_MODEL_6_0, + D3D_SHADER_MODEL_5_1 + }; + constexpr size_t numModelVersions = sizeof(allModelVersions) / sizeof(D3D_SHADER_MODEL); + + for (size_t i = 0; i < numModelVersions; i++) + { + m_dShaderModel.HighestShaderModel = allModelVersions[i]; + result = m_pDevice->CheckFeatureSupport(D3D12_FEATURE_SHADER_MODEL, &m_dShaderModel, sizeof(D3D12_FEATURE_DATA_SHADER_MODEL)); + if (result != E_INVALIDARG) + { + // Indicates that the version is recognizable by the runtime and stored in the struct + // Also terminate on unexpected error code + if (FAILED(result)) + { + m_dShaderModel.HighestShaderModel = static_cast<D3D_SHADER_MODEL>(0); + } + return result; + } + } + + // Shader model may not be supported. Continue the rest initializations + m_dShaderModel.HighestShaderModel = static_cast<D3D_SHADER_MODEL>(0); + return S_OK; +} + +// Helper function to decide the highest root signature supported +// Must be updated whenever a new root signature version is added to the d3d12.h header +inline HRESULT CD3DX12FeatureSupport::QueryHighestRootSignatureVersion() +{ + HRESULT result; + + const D3D_ROOT_SIGNATURE_VERSION allRootSignatureVersions[] = + { + D3D_ROOT_SIGNATURE_VERSION_1_1, + D3D_ROOT_SIGNATURE_VERSION_1_0, + D3D_ROOT_SIGNATURE_VERSION_1, + }; + constexpr size_t numRootSignatureVersions = sizeof(allRootSignatureVersions) / sizeof(D3D_ROOT_SIGNATURE_VERSION); + + for (size_t i = 0; i < numRootSignatureVersions; i++) + { + m_dRootSignature.HighestVersion = allRootSignatureVersions[i]; + result = m_pDevice->CheckFeatureSupport(D3D12_FEATURE_ROOT_SIGNATURE, &m_dRootSignature, sizeof(D3D12_FEATURE_DATA_ROOT_SIGNATURE)); + if (result != E_INVALIDARG) + { + if (FAILED(result)) + { + m_dRootSignature.HighestVersion = static_cast<D3D_ROOT_SIGNATURE_VERSION>(0); + } + // If succeeded, the highest version is already written into the member struct + return result; + } + } + + // No version left. Set to invalid value and continue. + m_dRootSignature.HighestVersion = static_cast<D3D_ROOT_SIGNATURE_VERSION>(0); + return S_OK; +} + +// Helper funcion to decide the highest feature level +inline HRESULT CD3DX12FeatureSupport::QueryHighestFeatureLevel() +{ + HRESULT result; + + // Check against a list of all feature levels present in d3dcommon.h + // Needs to be updated for future feature levels + const D3D_FEATURE_LEVEL allLevels[] = + { + D3D_FEATURE_LEVEL_12_2, + D3D_FEATURE_LEVEL_12_1, + D3D_FEATURE_LEVEL_12_0, + D3D_FEATURE_LEVEL_11_1, + D3D_FEATURE_LEVEL_11_0, + D3D_FEATURE_LEVEL_10_1, + D3D_FEATURE_LEVEL_10_0, + D3D_FEATURE_LEVEL_9_3, + D3D_FEATURE_LEVEL_9_2, + D3D_FEATURE_LEVEL_9_1, + D3D_FEATURE_LEVEL_1_0_CORE + }; + + D3D12_FEATURE_DATA_FEATURE_LEVELS dFeatureLevel; + dFeatureLevel.NumFeatureLevels = static_cast<UINT>(sizeof(allLevels) / sizeof(D3D_FEATURE_LEVEL)); + dFeatureLevel.pFeatureLevelsRequested = allLevels; + + result = m_pDevice->CheckFeatureSupport(D3D12_FEATURE_FEATURE_LEVELS, &dFeatureLevel, sizeof(D3D12_FEATURE_DATA_FEATURE_LEVELS)); + if (SUCCEEDED(result)) + { + m_eMaxFeatureLevel = dFeatureLevel.MaxSupportedFeatureLevel; + } + else + { + m_eMaxFeatureLevel = static_cast<D3D_FEATURE_LEVEL>(0); + + if (result == DXGI_ERROR_UNSUPPORTED) + { + // Indicates that none supported. Continue initialization + result = S_OK; + } + } + return result; +} + +// Helper function to initialize local protected resource session types structs +inline HRESULT CD3DX12FeatureSupport::QueryProtectedResourceSessionTypes(UINT NodeIndex, UINT Count) +{ + auto& CurrentPRSTypes = m_dProtectedResourceSessionTypes[NodeIndex]; + CurrentPRSTypes.NodeIndex = NodeIndex; + CurrentPRSTypes.Count = Count; + CurrentPRSTypes.TypeVec.resize(CurrentPRSTypes.Count); + CurrentPRSTypes.pTypes = CurrentPRSTypes.TypeVec.data(); + + HRESULT result = m_pDevice->CheckFeatureSupport(D3D12_FEATURE_PROTECTED_RESOURCE_SESSION_TYPES, &m_dProtectedResourceSessionTypes[NodeIndex], sizeof(D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_TYPES)); + if (FAILED(result)) + { + // Resize TypeVec to empty + CurrentPRSTypes.TypeVec.clear(); + } + + return result; +} + +#undef FEATURE_SUPPORT_GET +#undef FEATURE_SUPPORT_GET_NAME +#undef FEATURE_SUPPORT_GET_NODE_INDEXED +#undef FEATURE_SUPPORT_GET_NODE_INDEXED_NAME + +// end CD3DX12FeatureSupport + +#endif // !D3DX12_NO_CHECK_FEATURE_SUPPORT_CLASS + +#undef D3DX12_COM_PTR +#undef D3DX12_COM_PTR_GET +#undef D3DX12_COM_PTR_ADDRESSOF + +#endif // defined( __cplusplus ) + +#endif //__D3DX12_H__ + diff --git a/thirdparty/directx_headers/dxcore.h b/thirdparty/directx_headers/dxcore.h new file mode 100644 index 0000000000..4244eaa60f --- /dev/null +++ b/thirdparty/directx_headers/dxcore.h @@ -0,0 +1,41 @@ +/************************************************************ +* * +* Copyright (c) Microsoft Corporation. * +* Licensed under the MIT license. * +* * +************************************************************/ + +#ifndef _DXCOREEXTMODULE_H_ +#define _DXCOREEXTMODULE_H_ + +#include <winapifamily.h> +#include "dxcore_interface.h" + +#pragma region Application Family or OneCore Family +#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM) + +#if (_WIN32_WINNT >= _WIN32_WINNT_WIN10) + +STDAPI +DXCoreCreateAdapterFactory( + REFIID riid, + _COM_Outptr_ void** ppvFactory +); + +template <class T> +HRESULT +DXCoreCreateAdapterFactory( + _COM_Outptr_ T** ppvFactory +) +{ + return DXCoreCreateAdapterFactory(IID_PPV_ARGS(ppvFactory)); +} + +#endif // (_WIN32_WINNT >= _WIN32_WINNT_WIN10) + +#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM) */ +#pragma endregion + +#endif // _DXCOREEXTMODULE_H_ + + diff --git a/thirdparty/directx_headers/dxcore_interface.h b/thirdparty/directx_headers/dxcore_interface.h new file mode 100644 index 0000000000..b487fe13fb --- /dev/null +++ b/thirdparty/directx_headers/dxcore_interface.h @@ -0,0 +1,316 @@ +// +// DXCore Interface +// Copyright (C) Microsoft Corporation. +// Licensed under the MIT license. +// + +#ifndef __dxcore_interface_h__ +#define __dxcore_interface_h__ + +#ifndef COM_NO_WINDOWS_H +#include "windows.h" +#include "ole2.h" +#endif /*COM_NO_WINDOWS_H*/ + +#include <stdint.h> + +#ifdef __cplusplus + +#define _FACDXCORE 0x880 +#define MAKE_DXCORE_HRESULT( code ) MAKE_HRESULT( 1, _FACDXCORE, code ) + +enum class DXCoreAdapterProperty : uint32_t +{ + InstanceLuid = 0, + DriverVersion = 1, + DriverDescription = 2, + HardwareID = 3, // Use HardwareIDParts instead, if available. + KmdModelVersion = 4, + ComputePreemptionGranularity = 5, + GraphicsPreemptionGranularity = 6, + DedicatedAdapterMemory = 7, + DedicatedSystemMemory = 8, + SharedSystemMemory = 9, + AcgCompatible = 10, + IsHardware = 11, + IsIntegrated = 12, + IsDetachable = 13, + HardwareIDParts = 14 +}; + +enum class DXCoreAdapterState : uint32_t +{ + IsDriverUpdateInProgress = 0, + AdapterMemoryBudget = 1 +}; + +enum class DXCoreSegmentGroup : uint32_t +{ + Local = 0, + NonLocal = 1 +}; + +enum class DXCoreNotificationType : uint32_t +{ + AdapterListStale = 0, + AdapterNoLongerValid = 1, + AdapterBudgetChange = 2, + AdapterHardwareContentProtectionTeardown = 3 +}; + +enum class DXCoreAdapterPreference : uint32_t +{ + Hardware = 0, + MinimumPower = 1, + HighPerformance = 2 +}; + +struct DXCoreHardwareID +{ + uint32_t vendorID; + uint32_t deviceID; + uint32_t subSysID; + uint32_t revision; +}; + +struct DXCoreHardwareIDParts +{ + uint32_t vendorID; + uint32_t deviceID; + uint32_t subSystemID; + uint32_t subVendorID; + uint32_t revisionID; +}; + +struct DXCoreAdapterMemoryBudgetNodeSegmentGroup +{ + uint32_t nodeIndex; + DXCoreSegmentGroup segmentGroup; +}; + +struct DXCoreAdapterMemoryBudget +{ + uint64_t budget; + uint64_t currentUsage; + uint64_t availableForReservation; + uint64_t currentReservation; +}; + +typedef void (STDMETHODCALLTYPE *PFN_DXCORE_NOTIFICATION_CALLBACK)( + DXCoreNotificationType notificationType, + _In_ IUnknown *object, + _In_opt_ void *context); + +static_assert(sizeof(bool) == 1, "bool assumed as one byte"); + +DEFINE_GUID(IID_IDXCoreAdapterFactory, 0x78ee5945, 0xc36e, 0x4b13, 0xa6, 0x69, 0x00, 0x5d, 0xd1, 0x1c, 0x0f, 0x06); +DEFINE_GUID(IID_IDXCoreAdapterList, 0x526c7776, 0x40e9, 0x459b, 0xb7, 0x11, 0xf3, 0x2a, 0xd7, 0x6d, 0xfc, 0x28); +DEFINE_GUID(IID_IDXCoreAdapter, 0xf0db4c7f, 0xfe5a, 0x42a2, 0xbd, 0x62, 0xf2, 0xa6, 0xcf, 0x6f, 0xc8, 0x3e); +DEFINE_GUID(DXCORE_ADAPTER_ATTRIBUTE_D3D11_GRAPHICS, 0x8c47866b, 0x7583, 0x450d, 0xf0, 0xf0, 0x6b, 0xad, 0xa8, 0x95, 0xaf, 0x4b); +DEFINE_GUID(DXCORE_ADAPTER_ATTRIBUTE_D3D12_GRAPHICS, 0x0c9ece4d, 0x2f6e, 0x4f01, 0x8c, 0x96, 0xe8, 0x9e, 0x33, 0x1b, 0x47, 0xb1); +DEFINE_GUID(DXCORE_ADAPTER_ATTRIBUTE_D3D12_CORE_COMPUTE, 0x248e2800, 0xa793, 0x4724, 0xab, 0xaa, 0x23, 0xa6, 0xde, 0x1b, 0xe0, 0x90); + +/* interface IDXCoreAdapter */ +MIDL_INTERFACE("f0db4c7f-fe5a-42a2-bd62-f2a6cf6fc83e") +IDXCoreAdapter : public IUnknown +{ +public: + virtual bool STDMETHODCALLTYPE IsValid() = 0; + + virtual bool STDMETHODCALLTYPE IsAttributeSupported( + REFGUID attributeGUID) = 0; + + virtual bool STDMETHODCALLTYPE IsPropertySupported( + DXCoreAdapterProperty property) = 0; + + virtual HRESULT STDMETHODCALLTYPE GetProperty( + DXCoreAdapterProperty property, + size_t bufferSize, + _Out_writes_bytes_(bufferSize) void *propertyData) = 0; + + template <class T> + HRESULT GetProperty( + DXCoreAdapterProperty property, + _Out_writes_bytes_(sizeof(T)) T *propertyData) + { + return GetProperty(property, + sizeof(T), + (void*)propertyData); + } + + virtual HRESULT STDMETHODCALLTYPE GetPropertySize( + DXCoreAdapterProperty property, + _Out_ size_t *bufferSize) = 0; + + virtual bool STDMETHODCALLTYPE IsQueryStateSupported( + DXCoreAdapterState property) = 0; + + virtual HRESULT STDMETHODCALLTYPE QueryState( + DXCoreAdapterState state, + size_t inputStateDetailsSize, + _In_reads_bytes_opt_(inputStateDetailsSize) const void *inputStateDetails, + size_t outputBufferSize, + _Out_writes_bytes_(outputBufferSize) void *outputBuffer) = 0; + + template <class T1, class T2> + HRESULT QueryState( + DXCoreAdapterState state, + _In_reads_bytes_opt_(sizeof(T1)) const T1 *inputStateDetails, + _Out_writes_bytes_(sizeof(T2)) T2 *outputBuffer) + { + return QueryState(state, + sizeof(T1), + (const void*)inputStateDetails, + sizeof(T2), + (void*)outputBuffer); + } + + template <class T> + HRESULT QueryState( + DXCoreAdapterState state, + _Out_writes_bytes_(sizeof(T)) T *outputBuffer) + { + return QueryState(state, + 0, + nullptr, + sizeof(T), + (void*)outputBuffer); + } + + virtual bool STDMETHODCALLTYPE IsSetStateSupported( + DXCoreAdapterState property) = 0; + + virtual HRESULT STDMETHODCALLTYPE SetState( + DXCoreAdapterState state, + size_t inputStateDetailsSize, + _In_reads_bytes_opt_(inputStateDetailsSize) const void *inputStateDetails, + size_t inputDataSize, + _In_reads_bytes_(inputDataSize) const void *inputData) = 0; + + template <class T1, class T2> + HRESULT SetState( + DXCoreAdapterState state, + const T1 *inputStateDetails, + const T2 *inputData) + { + return SetState(state, + sizeof(T1), + (const void*)inputStateDetails, + sizeof(T2), + (const void*)inputData); + } + + virtual HRESULT STDMETHODCALLTYPE GetFactory( + REFIID riid, + _COM_Outptr_ void** ppvFactory + ) = 0; + + template <class T> + HRESULT GetFactory( + _COM_Outptr_ T** ppvFactory + ) + { + return GetFactory(IID_PPV_ARGS(ppvFactory)); + } +}; + +/* interface IDXCoreAdapterList */ +MIDL_INTERFACE("526c7776-40e9-459b-b711-f32ad76dfc28") +IDXCoreAdapterList : public IUnknown +{ +public: + virtual HRESULT STDMETHODCALLTYPE GetAdapter( + uint32_t index, + REFIID riid, + _COM_Outptr_ void **ppvAdapter) = 0; + + template<class T> + HRESULT STDMETHODCALLTYPE GetAdapter( + uint32_t index, + _COM_Outptr_ T **ppvAdapter) + { + return GetAdapter(index, + IID_PPV_ARGS(ppvAdapter)); + } + + virtual uint32_t STDMETHODCALLTYPE GetAdapterCount() = 0; + + virtual bool STDMETHODCALLTYPE IsStale() = 0; + + virtual HRESULT STDMETHODCALLTYPE GetFactory( + REFIID riid, + _COM_Outptr_ void** ppvFactory + ) = 0; + + template <class T> + HRESULT GetFactory( + _COM_Outptr_ T** ppvFactory + ) + { + return GetFactory(IID_PPV_ARGS(ppvFactory)); + } + + virtual HRESULT STDMETHODCALLTYPE Sort( + uint32_t numPreferences, + _In_reads_(numPreferences) const DXCoreAdapterPreference* preferences) = 0; + + virtual bool STDMETHODCALLTYPE IsAdapterPreferenceSupported( + DXCoreAdapterPreference preference) = 0; +}; + +/* interface IDXCoreAdapterFactory */ +MIDL_INTERFACE("78ee5945-c36e-4b13-a669-005dd11c0f06") +IDXCoreAdapterFactory : public IUnknown +{ +public: + + virtual HRESULT STDMETHODCALLTYPE CreateAdapterList( + uint32_t numAttributes, + _In_reads_(numAttributes) const GUID *filterAttributes, + REFIID riid, + _COM_Outptr_ void **ppvAdapterList) = 0; + + template<class T> + HRESULT STDMETHODCALLTYPE CreateAdapterList( + uint32_t numAttributes, + _In_reads_(numAttributes) const GUID *filterAttributes, + _COM_Outptr_ T **ppvAdapterList) + { + return CreateAdapterList(numAttributes, + filterAttributes, + IID_PPV_ARGS(ppvAdapterList)); + } + + virtual HRESULT STDMETHODCALLTYPE GetAdapterByLuid( + const LUID &adapterLUID, + REFIID riid, + _COM_Outptr_ void **ppvAdapter) = 0; + + template<class T> + HRESULT STDMETHODCALLTYPE GetAdapterByLuid( + const LUID &adapterLUID, + _COM_Outptr_ T **ppvAdapter) + { + return GetAdapterByLuid(adapterLUID, + IID_PPV_ARGS(ppvAdapter)); + } + + virtual bool STDMETHODCALLTYPE IsNotificationTypeSupported( + DXCoreNotificationType notificationType) = 0; + + virtual HRESULT STDMETHODCALLTYPE RegisterEventNotification( + _In_ IUnknown *dxCoreObject, + DXCoreNotificationType notificationType, + _In_ PFN_DXCORE_NOTIFICATION_CALLBACK callbackFunction, + _In_opt_ void *callbackContext, + _Out_ uint32_t *eventCookie) = 0; + + virtual HRESULT STDMETHODCALLTYPE UnregisterEventNotification( + uint32_t eventCookie) = 0; +}; + +#endif // __cplusplus + +#endif // __dxcore_interface_h__ + + diff --git a/thirdparty/directx_headers/dxgicommon.h b/thirdparty/directx_headers/dxgicommon.h new file mode 100644 index 0000000000..f83aa01e61 --- /dev/null +++ b/thirdparty/directx_headers/dxgicommon.h @@ -0,0 +1,57 @@ +// +// Copyright (C) Microsoft Corporation. +// Licensed under the MIT license +// + +#ifndef __dxgicommon_h__ +#define __dxgicommon_h__ + + +typedef struct DXGI_RATIONAL +{ + UINT Numerator; + UINT Denominator; +} DXGI_RATIONAL; + +// The following values are used with DXGI_SAMPLE_DESC::Quality: +#define DXGI_STANDARD_MULTISAMPLE_QUALITY_PATTERN 0xffffffff +#define DXGI_CENTER_MULTISAMPLE_QUALITY_PATTERN 0xfffffffe + +typedef struct DXGI_SAMPLE_DESC +{ + UINT Count; + UINT Quality; +} DXGI_SAMPLE_DESC; + +typedef enum DXGI_COLOR_SPACE_TYPE +{ + DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 = 0, + DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 = 1, + DXGI_COLOR_SPACE_RGB_STUDIO_G22_NONE_P709 = 2, + DXGI_COLOR_SPACE_RGB_STUDIO_G22_NONE_P2020 = 3, + DXGI_COLOR_SPACE_RESERVED = 4, + DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 = 5, + DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 = 6, + DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P601 = 7, + DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 = 8, + DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P709 = 9, + DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 = 10, + DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 = 11, + DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 = 12, + DXGI_COLOR_SPACE_YCBCR_STUDIO_G2084_LEFT_P2020 = 13, + DXGI_COLOR_SPACE_RGB_STUDIO_G2084_NONE_P2020 = 14, + DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_TOPLEFT_P2020 = 15, + DXGI_COLOR_SPACE_YCBCR_STUDIO_G2084_TOPLEFT_P2020 = 16, + DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P2020 = 17, + DXGI_COLOR_SPACE_YCBCR_STUDIO_GHLG_TOPLEFT_P2020 = 18, + DXGI_COLOR_SPACE_YCBCR_FULL_GHLG_TOPLEFT_P2020 = 19, + DXGI_COLOR_SPACE_RGB_STUDIO_G24_NONE_P709 = 20, + DXGI_COLOR_SPACE_RGB_STUDIO_G24_NONE_P2020 = 21, + DXGI_COLOR_SPACE_YCBCR_STUDIO_G24_LEFT_P709 = 22, + DXGI_COLOR_SPACE_YCBCR_STUDIO_G24_LEFT_P2020 = 23, + DXGI_COLOR_SPACE_YCBCR_STUDIO_G24_TOPLEFT_P2020 = 24, + DXGI_COLOR_SPACE_CUSTOM = 0xFFFFFFFF +} DXGI_COLOR_SPACE_TYPE; + +#endif // __dxgicommon_h__ + diff --git a/thirdparty/directx_headers/dxgiformat.h b/thirdparty/directx_headers/dxgiformat.h new file mode 100644 index 0000000000..52aae1b2be --- /dev/null +++ b/thirdparty/directx_headers/dxgiformat.h @@ -0,0 +1,142 @@ +// +// Copyright (C) Microsoft Corporation. +// Licensed under the MIT license +// + +#ifndef __dxgiformat_h__ +#define __dxgiformat_h__ + +#define DXGI_FORMAT_DEFINED 1 + +typedef enum DXGI_FORMAT +{ + DXGI_FORMAT_UNKNOWN = 0, + DXGI_FORMAT_R32G32B32A32_TYPELESS = 1, + DXGI_FORMAT_R32G32B32A32_FLOAT = 2, + DXGI_FORMAT_R32G32B32A32_UINT = 3, + DXGI_FORMAT_R32G32B32A32_SINT = 4, + DXGI_FORMAT_R32G32B32_TYPELESS = 5, + DXGI_FORMAT_R32G32B32_FLOAT = 6, + DXGI_FORMAT_R32G32B32_UINT = 7, + DXGI_FORMAT_R32G32B32_SINT = 8, + DXGI_FORMAT_R16G16B16A16_TYPELESS = 9, + DXGI_FORMAT_R16G16B16A16_FLOAT = 10, + DXGI_FORMAT_R16G16B16A16_UNORM = 11, + DXGI_FORMAT_R16G16B16A16_UINT = 12, + DXGI_FORMAT_R16G16B16A16_SNORM = 13, + DXGI_FORMAT_R16G16B16A16_SINT = 14, + DXGI_FORMAT_R32G32_TYPELESS = 15, + DXGI_FORMAT_R32G32_FLOAT = 16, + DXGI_FORMAT_R32G32_UINT = 17, + DXGI_FORMAT_R32G32_SINT = 18, + DXGI_FORMAT_R32G8X24_TYPELESS = 19, + DXGI_FORMAT_D32_FLOAT_S8X24_UINT = 20, + DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS = 21, + DXGI_FORMAT_X32_TYPELESS_G8X24_UINT = 22, + DXGI_FORMAT_R10G10B10A2_TYPELESS = 23, + DXGI_FORMAT_R10G10B10A2_UNORM = 24, + DXGI_FORMAT_R10G10B10A2_UINT = 25, + DXGI_FORMAT_R11G11B10_FLOAT = 26, + DXGI_FORMAT_R8G8B8A8_TYPELESS = 27, + DXGI_FORMAT_R8G8B8A8_UNORM = 28, + DXGI_FORMAT_R8G8B8A8_UNORM_SRGB = 29, + DXGI_FORMAT_R8G8B8A8_UINT = 30, + DXGI_FORMAT_R8G8B8A8_SNORM = 31, + DXGI_FORMAT_R8G8B8A8_SINT = 32, + DXGI_FORMAT_R16G16_TYPELESS = 33, + DXGI_FORMAT_R16G16_FLOAT = 34, + DXGI_FORMAT_R16G16_UNORM = 35, + DXGI_FORMAT_R16G16_UINT = 36, + DXGI_FORMAT_R16G16_SNORM = 37, + DXGI_FORMAT_R16G16_SINT = 38, + DXGI_FORMAT_R32_TYPELESS = 39, + DXGI_FORMAT_D32_FLOAT = 40, + DXGI_FORMAT_R32_FLOAT = 41, + DXGI_FORMAT_R32_UINT = 42, + DXGI_FORMAT_R32_SINT = 43, + DXGI_FORMAT_R24G8_TYPELESS = 44, + DXGI_FORMAT_D24_UNORM_S8_UINT = 45, + DXGI_FORMAT_R24_UNORM_X8_TYPELESS = 46, + DXGI_FORMAT_X24_TYPELESS_G8_UINT = 47, + DXGI_FORMAT_R8G8_TYPELESS = 48, + DXGI_FORMAT_R8G8_UNORM = 49, + DXGI_FORMAT_R8G8_UINT = 50, + DXGI_FORMAT_R8G8_SNORM = 51, + DXGI_FORMAT_R8G8_SINT = 52, + DXGI_FORMAT_R16_TYPELESS = 53, + DXGI_FORMAT_R16_FLOAT = 54, + DXGI_FORMAT_D16_UNORM = 55, + DXGI_FORMAT_R16_UNORM = 56, + DXGI_FORMAT_R16_UINT = 57, + DXGI_FORMAT_R16_SNORM = 58, + DXGI_FORMAT_R16_SINT = 59, + DXGI_FORMAT_R8_TYPELESS = 60, + DXGI_FORMAT_R8_UNORM = 61, + DXGI_FORMAT_R8_UINT = 62, + DXGI_FORMAT_R8_SNORM = 63, + DXGI_FORMAT_R8_SINT = 64, + DXGI_FORMAT_A8_UNORM = 65, + DXGI_FORMAT_R1_UNORM = 66, + DXGI_FORMAT_R9G9B9E5_SHAREDEXP = 67, + DXGI_FORMAT_R8G8_B8G8_UNORM = 68, + DXGI_FORMAT_G8R8_G8B8_UNORM = 69, + DXGI_FORMAT_BC1_TYPELESS = 70, + DXGI_FORMAT_BC1_UNORM = 71, + DXGI_FORMAT_BC1_UNORM_SRGB = 72, + DXGI_FORMAT_BC2_TYPELESS = 73, + DXGI_FORMAT_BC2_UNORM = 74, + DXGI_FORMAT_BC2_UNORM_SRGB = 75, + DXGI_FORMAT_BC3_TYPELESS = 76, + DXGI_FORMAT_BC3_UNORM = 77, + DXGI_FORMAT_BC3_UNORM_SRGB = 78, + DXGI_FORMAT_BC4_TYPELESS = 79, + DXGI_FORMAT_BC4_UNORM = 80, + DXGI_FORMAT_BC4_SNORM = 81, + DXGI_FORMAT_BC5_TYPELESS = 82, + DXGI_FORMAT_BC5_UNORM = 83, + DXGI_FORMAT_BC5_SNORM = 84, + DXGI_FORMAT_B5G6R5_UNORM = 85, + DXGI_FORMAT_B5G5R5A1_UNORM = 86, + DXGI_FORMAT_B8G8R8A8_UNORM = 87, + DXGI_FORMAT_B8G8R8X8_UNORM = 88, + DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM = 89, + DXGI_FORMAT_B8G8R8A8_TYPELESS = 90, + DXGI_FORMAT_B8G8R8A8_UNORM_SRGB = 91, + DXGI_FORMAT_B8G8R8X8_TYPELESS = 92, + DXGI_FORMAT_B8G8R8X8_UNORM_SRGB = 93, + DXGI_FORMAT_BC6H_TYPELESS = 94, + DXGI_FORMAT_BC6H_UF16 = 95, + DXGI_FORMAT_BC6H_SF16 = 96, + DXGI_FORMAT_BC7_TYPELESS = 97, + DXGI_FORMAT_BC7_UNORM = 98, + DXGI_FORMAT_BC7_UNORM_SRGB = 99, + DXGI_FORMAT_AYUV = 100, + DXGI_FORMAT_Y410 = 101, + DXGI_FORMAT_Y416 = 102, + DXGI_FORMAT_NV12 = 103, + DXGI_FORMAT_P010 = 104, + DXGI_FORMAT_P016 = 105, + DXGI_FORMAT_420_OPAQUE = 106, + DXGI_FORMAT_YUY2 = 107, + DXGI_FORMAT_Y210 = 108, + DXGI_FORMAT_Y216 = 109, + DXGI_FORMAT_NV11 = 110, + DXGI_FORMAT_AI44 = 111, + DXGI_FORMAT_IA44 = 112, + DXGI_FORMAT_P8 = 113, + DXGI_FORMAT_A8P8 = 114, + DXGI_FORMAT_B4G4R4A4_UNORM = 115, + + DXGI_FORMAT_P208 = 130, + DXGI_FORMAT_V208 = 131, + DXGI_FORMAT_V408 = 132, + + + DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE = 189, + DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE = 190, + + + DXGI_FORMAT_FORCE_UINT = 0xffffffff +} DXGI_FORMAT; + +#endif // __dxgiformat_h__ diff --git a/thirdparty/etcpak/ProcessRgtc.cpp b/thirdparty/etcpak/ProcessRgtc.cpp new file mode 100644 index 0000000000..3a283b743b --- /dev/null +++ b/thirdparty/etcpak/ProcessRgtc.cpp @@ -0,0 +1,106 @@ +// -- GODOT start -- + +#include "ForceInline.hpp" +#include "ProcessRgtc.hpp" + +#include <assert.h> +#include <string.h> + +static const uint8_t AlphaIndexTable[8] = { 1, 7, 6, 5, 4, 3, 2, 0 }; + +static etcpak_force_inline uint64_t ProcessAlpha( const uint8_t* src ) +{ + uint8_t solid8 = *src; + uint16_t solid16 = uint16_t( solid8 ) | ( uint16_t( solid8 ) << 8 ); + uint32_t solid32 = uint32_t( solid16 ) | ( uint32_t( solid16 ) << 16 ); + uint64_t solid64 = uint64_t( solid32 ) | ( uint64_t( solid32 ) << 32 ); + if( memcmp( src, &solid64, 8 ) == 0 && memcmp( src+8, &solid64, 8 ) == 0 ) + { + return solid8; + } + + uint8_t min = src[0]; + uint8_t max = min; + for( int i=1; i<16; i++ ) + { + const auto v = src[i]; + if( v > max ) max = v; + else if( v < min ) min = v; + } + + uint32_t range = ( 8 << 13 ) / ( 1 + max - min ); + uint64_t data = 0; + for( int i=0; i<16; i++ ) + { + uint8_t a = src[i] - min; + uint64_t idx = AlphaIndexTable[( a * range ) >> 13]; + data |= idx << (i*3); + } + + return max | ( min << 8 ) | ( data << 16 ); +} + +void CompressRgtcR(const uint32_t *src, uint64_t *dst, uint32_t blocks, size_t width) +{ + int i = 0; + auto ptr = dst; + do + { + uint32_t rgba[4 * 4]; + uint8_t r[4 * 4]; + + auto tmp = (char *)rgba; + memcpy(tmp, src + width * 0, 4 * 4); + memcpy(tmp + 4 * 4, src + width * 1, 4 * 4); + memcpy(tmp + 8 * 4, src + width * 2, 4 * 4); + memcpy(tmp + 12 * 4, src + width * 3, 4 * 4); + src += 4; + if (++i == width / 4) + { + src += width * 3; + i = 0; + } + + for (int i = 0; i < 16; i++) + { + r[i] = rgba[i] & 0x000000FF; + } + *ptr++ = ProcessAlpha(r); + } + while (--blocks); +} + +void CompressRgtcRG(const uint32_t *src, uint64_t *dst, uint32_t blocks, size_t width) +{ + int i = 0; + auto ptr = dst; + do + { + uint32_t rgba[4 * 4]; + uint8_t r[4 * 4]; + uint8_t g[4 * 4]; + + auto tmp = (char *)rgba; + memcpy(tmp, src + width * 0, 4 * 4); + memcpy(tmp + 4 * 4, src + width * 1, 4 * 4); + memcpy(tmp + 8 * 4, src + width * 2, 4 * 4); + memcpy(tmp + 12 * 4, src + width * 3, 4 * 4); + src += 4; + if (++i == width / 4) + { + src += width * 3; + i = 0; + } + + for (int i = 0; i < 16; i++) + { + r[i] = rgba[i] & 0x000000FF; + g[i] = (rgba[i] & 0x0000FF00) >> 8; + } + *ptr++ = ProcessAlpha(r); + *ptr++ = ProcessAlpha(g); + } + while (--blocks); +} + +// -- GODOT end -- diff --git a/thirdparty/etcpak/ProcessRgtc.hpp b/thirdparty/etcpak/ProcessRgtc.hpp new file mode 100644 index 0000000000..0905b7d9ad --- /dev/null +++ b/thirdparty/etcpak/ProcessRgtc.hpp @@ -0,0 +1,14 @@ +// -- GODOT start -- + +#ifndef __PROCESSRGTC_HPP__ +#define __PROCESSRGTC_HPP__ + +#include <stddef.h> +#include <stdint.h> + +void CompressRgtcR(const uint32_t *src, uint64_t *dst, uint32_t blocks, size_t width); +void CompressRgtcRG(const uint32_t *src, uint64_t *dst, uint32_t blocks, size_t width); + +#endif + +// -- GODOT end -- diff --git a/thirdparty/meshoptimizer/LICENSE.md b/thirdparty/meshoptimizer/LICENSE.md index b673c248b2..962ed41ffb 100644 --- a/thirdparty/meshoptimizer/LICENSE.md +++ b/thirdparty/meshoptimizer/LICENSE.md @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2016-2022 Arseny Kapoulkine +Copyright (c) 2016-2023 Arseny Kapoulkine Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/thirdparty/meshoptimizer/indexcodec.cpp b/thirdparty/meshoptimizer/indexcodec.cpp index e4495b8586..4cc2fea63a 100644 --- a/thirdparty/meshoptimizer/indexcodec.cpp +++ b/thirdparty/meshoptimizer/indexcodec.cpp @@ -13,7 +13,7 @@ namespace meshopt const unsigned char kIndexHeader = 0xe0; const unsigned char kSequenceHeader = 0xd0; -static int gEncodeIndexVersion = 0; +static int gEncodeIndexVersion = 1; typedef unsigned int VertexFifo[16]; typedef unsigned int EdgeFifo[16][2]; diff --git a/thirdparty/meshoptimizer/indexgenerator.cpp b/thirdparty/meshoptimizer/indexgenerator.cpp index cad808a2b1..f6728345a9 100644 --- a/thirdparty/meshoptimizer/indexgenerator.cpp +++ b/thirdparty/meshoptimizer/indexgenerator.cpp @@ -157,7 +157,7 @@ static T* hashLookup(T* table, size_t buckets, const Hash& hash, const T& key, c } assert(false && "Hash table is full"); // unreachable - return 0; + return NULL; } static void buildPositionRemap(unsigned int* remap, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, meshopt_Allocator& allocator) @@ -178,6 +178,22 @@ static void buildPositionRemap(unsigned int* remap, const float* vertex_position remap[index] = *entry; } + + allocator.deallocate(vertex_table); +} + +template <size_t BlockSize> +static void remapVertices(void* destination, const void* vertices, size_t vertex_count, size_t vertex_size, const unsigned int* remap) +{ + size_t block_size = BlockSize == 0 ? vertex_size : BlockSize; + assert(block_size == vertex_size); + + for (size_t i = 0; i < vertex_count; ++i) + if (remap[i] != ~0u) + { + assert(remap[i] < vertex_count); + memcpy(static_cast<unsigned char*>(destination) + remap[i] * block_size, static_cast<const unsigned char*>(vertices) + i * block_size, block_size); + } } } // namespace meshopt @@ -288,6 +304,8 @@ size_t meshopt_generateVertexRemapMulti(unsigned int* destination, const unsigne void meshopt_remapVertexBuffer(void* destination, const void* vertices, size_t vertex_count, size_t vertex_size, const unsigned int* remap) { + using namespace meshopt; + assert(vertex_size > 0 && vertex_size <= 256); meshopt_Allocator allocator; @@ -300,14 +318,23 @@ void meshopt_remapVertexBuffer(void* destination, const void* vertices, size_t v vertices = vertices_copy; } - for (size_t i = 0; i < vertex_count; ++i) + // specialize the loop for common vertex sizes to ensure memcpy is compiled as an inlined intrinsic + switch (vertex_size) { - if (remap[i] != ~0u) - { - assert(remap[i] < vertex_count); + case 4: + return remapVertices<4>(destination, vertices, vertex_count, vertex_size, remap); - memcpy(static_cast<unsigned char*>(destination) + remap[i] * vertex_size, static_cast<const unsigned char*>(vertices) + i * vertex_size, vertex_size); - } + case 8: + return remapVertices<8>(destination, vertices, vertex_count, vertex_size, remap); + + case 12: + return remapVertices<12>(destination, vertices, vertex_count, vertex_size, remap); + + case 16: + return remapVertices<16>(destination, vertices, vertex_count, vertex_size, remap); + + default: + return remapVertices<0>(destination, vertices, vertex_count, vertex_size, remap); } } diff --git a/thirdparty/meshoptimizer/meshoptimizer.h b/thirdparty/meshoptimizer/meshoptimizer.h index 46d28d3ea3..dbafd4e6e4 100644 --- a/thirdparty/meshoptimizer/meshoptimizer.h +++ b/thirdparty/meshoptimizer/meshoptimizer.h @@ -1,7 +1,7 @@ /** - * meshoptimizer - version 0.18 + * meshoptimizer - version 0.20 * - * Copyright (C) 2016-2022, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com) + * Copyright (C) 2016-2023, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com) * Report bugs and download new versions at https://github.com/zeux/meshoptimizer * * This library is distributed under the MIT License. See notice at the end of this file. @@ -12,7 +12,7 @@ #include <stddef.h> /* Version macro; major * 1000 + minor * 10 + patch */ -#define MESHOPTIMIZER_VERSION 180 /* 0.18 */ +#define MESHOPTIMIZER_VERSION 200 /* 0.20 */ /* If no API is defined, assume default */ #ifndef MESHOPTIMIZER_API @@ -67,6 +67,7 @@ MESHOPTIMIZER_API size_t meshopt_generateVertexRemap(unsigned int* destination, * * destination must contain enough space for the resulting remap table (vertex_count elements) * indices can be NULL if the input is unindexed + * stream_count must be <= 16 */ MESHOPTIMIZER_API size_t meshopt_generateVertexRemapMulti(unsigned int* destination, const unsigned int* indices, size_t index_count, size_t vertex_count, const struct meshopt_Stream* streams, size_t stream_count); @@ -103,6 +104,7 @@ MESHOPTIMIZER_API void meshopt_generateShadowIndexBuffer(unsigned int* destinati * Note that binary equivalence considers all size bytes in each stream, including padding which should be zero-initialized. * * destination must contain enough space for the resulting index buffer (index_count elements) + * stream_count must be <= 16 */ MESHOPTIMIZER_API void meshopt_generateShadowIndexBufferMulti(unsigned int* destination, const unsigned int* indices, size_t index_count, size_t vertex_count, const struct meshopt_Stream* streams, size_t stream_count); @@ -304,13 +306,22 @@ MESHOPTIMIZER_EXPERIMENTAL void meshopt_decodeFilterExp(void* buffer, size_t cou * Input data must contain 4 floats for every quaternion (count*4 total). * * meshopt_encodeFilterExp encodes arbitrary (finite) floating-point data with 8-bit exponent and K-bit integer mantissa (1 <= K <= 24). - * Mantissa is shared between all components of a given vector as defined by stride; stride must be divisible by 4. + * Exponent can be shared between all components of a given vector as defined by stride or all values of a given component; stride must be divisible by 4. * Input data must contain stride/4 floats for every vector (count*stride/4 total). - * When individual (scalar) encoding is desired, simply pass stride=4 and adjust count accordingly. */ +enum meshopt_EncodeExpMode +{ + /* When encoding exponents, use separate values for each component (maximum quality) */ + meshopt_EncodeExpSeparate, + /* When encoding exponents, use shared value for all components of each vector (better compression) */ + meshopt_EncodeExpSharedVector, + /* When encoding exponents, use shared value for each component of all vectors (best compression) */ + meshopt_EncodeExpSharedComponent, +}; + MESHOPTIMIZER_EXPERIMENTAL void meshopt_encodeFilterOct(void* destination, size_t count, size_t stride, int bits, const float* data); MESHOPTIMIZER_EXPERIMENTAL void meshopt_encodeFilterQuat(void* destination, size_t count, size_t stride, int bits, const float* data); -MESHOPTIMIZER_EXPERIMENTAL void meshopt_encodeFilterExp(void* destination, size_t count, size_t stride, int bits, const float* data); +MESHOPTIMIZER_EXPERIMENTAL void meshopt_encodeFilterExp(void* destination, size_t count, size_t stride, int bits, const float* data, enum meshopt_EncodeExpMode mode); /** * Simplification options @@ -322,11 +333,6 @@ enum }; /** - * Experimental: Mesh simplifier with attribute metric; attributes follow xyz position data atm (vertex data must contain 3 + attribute_count floats per vertex) - */ -MESHOPTIMIZER_EXPERIMENTAL size_t meshopt_simplifyWithAttributes(unsigned int* destination, const unsigned int* indices, size_t index_count, const float* vertex_data, size_t vertex_count, size_t vertex_stride, size_t target_index_count, float target_error, unsigned int options, float* result_error, const float* attributes, const float* attribute_weights, size_t attribute_count); - -/** * Mesh simplifier * Reduces the number of triangles in the mesh, attempting to preserve mesh appearance as much as possible * The algorithm tries to preserve mesh topology and can stop short of the target goal based on topology constraints or target error. @@ -344,6 +350,18 @@ MESHOPTIMIZER_EXPERIMENTAL size_t meshopt_simplifyWithAttributes(unsigned int* d MESHOPTIMIZER_API size_t meshopt_simplify(unsigned int* destination, const unsigned int* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, size_t target_index_count, float target_error, unsigned int options, float* result_error); /** + * Experimental: Mesh simplifier with attribute metric + * The algorithm ehnahces meshopt_simplify by incorporating attribute values into the error metric used to prioritize simplification order; see meshopt_simplify documentation for details. + * Note that the number of attributes affects memory requirements and running time; this algorithm requires ~1.5x more memory and time compared to meshopt_simplify when using 4 scalar attributes. + * + * vertex_attributes should have attribute_count floats for each vertex + * attribute_weights should have attribute_count floats in total; the weights determine relative priority of attributes between each other and wrt position. The recommended weight range is [1e-3..1e-1], assuming attribute data is in [0..1] range. + * attribute_count must be <= 16 + * TODO target_error/result_error currently use combined distance+attribute error; this may change in the future + */ +MESHOPTIMIZER_EXPERIMENTAL size_t meshopt_simplifyWithAttributes(unsigned int* destination, const unsigned int* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, const float* vertex_attributes, size_t vertex_attributes_stride, const float* attribute_weights, size_t attribute_count, size_t target_index_count, float target_error, unsigned int options, float* result_error); + +/** * Experimental: Mesh simplifier (sloppy) * Reduces the number of triangles in the mesh, sacrificing mesh appearance for simplification performance * The algorithm doesn't preserve mesh topology but can stop short of the target goal based on target error. @@ -367,8 +385,9 @@ MESHOPTIMIZER_EXPERIMENTAL size_t meshopt_simplifySloppy(unsigned int* destinati * * destination must contain enough space for the target index buffer (target_vertex_count elements) * vertex_positions should have float3 position in the first 12 bytes of each vertex + * vertex_colors should can be NULL; when it's not NULL, it should have float3 color in the first 12 bytes of each vertex */ -MESHOPTIMIZER_EXPERIMENTAL size_t meshopt_simplifyPoints(unsigned int* destination, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, size_t target_vertex_count); +MESHOPTIMIZER_EXPERIMENTAL size_t meshopt_simplifyPoints(unsigned int* destination, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, const float* vertex_colors, size_t vertex_colors_stride, float color_weight, size_t target_vertex_count); /** * Returns the error scaling factor used by the simplifier to convert between absolute and relative extents @@ -497,7 +516,7 @@ struct meshopt_Bounds * For backface culling with orthographic projection, use the following formula to reject backfacing clusters: * dot(view, cone_axis) >= cone_cutoff * - * For perspective projection, you can the formula that needs cone apex in addition to axis & cutoff: + * For perspective projection, you can use the formula that needs cone apex in addition to axis & cutoff: * dot(normalize(cone_apex - camera_position), cone_axis) >= cone_cutoff * * Alternatively, you can use the formula that doesn't need cone apex and uses bounding sphere instead: @@ -506,7 +525,8 @@ struct meshopt_Bounds * dot(center - camera_position, cone_axis) >= cone_cutoff * length(center - camera_position) + radius * * The formula that uses the apex is slightly more accurate but needs the apex; if you are already using bounding sphere - * to do frustum/occlusion culling, the formula that doesn't use the apex may be preferable. + * to do frustum/occlusion culling, the formula that doesn't use the apex may be preferable (for derivation see + * Real-Time Rendering 4th Edition, section 19.3). * * vertex_positions should have float3 position in the first 12 bytes of each vertex * index_count/3 should be less than or equal to 512 (the function assumes clusters of limited size) @@ -515,13 +535,14 @@ MESHOPTIMIZER_API struct meshopt_Bounds meshopt_computeClusterBounds(const unsig MESHOPTIMIZER_API struct meshopt_Bounds meshopt_computeMeshletBounds(const unsigned int* meshlet_vertices, const unsigned char* meshlet_triangles, size_t triangle_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride); /** - * Experimental: Spatial sorter + * Spatial sorter * Generates a remap table that can be used to reorder points for spatial locality. * Resulting remap table maps old vertices to new vertices and can be used in meshopt_remapVertexBuffer. * * destination must contain enough space for the resulting remap table (vertex_count elements) + * vertex_positions should have float3 position in the first 12 bytes of each vertex */ -MESHOPTIMIZER_EXPERIMENTAL void meshopt_spatialSortRemap(unsigned int* destination, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride); +MESHOPTIMIZER_API void meshopt_spatialSortRemap(unsigned int* destination, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride); /** * Experimental: Spatial sorter @@ -561,19 +582,25 @@ inline int meshopt_quantizeUnorm(float v, int N); inline int meshopt_quantizeSnorm(float v, int N); /** - * Quantize a float into half-precision floating point value + * Quantize a float into half-precision (as defined by IEEE-754 fp16) floating point value * Generates +-inf for overflow, preserves NaN, flushes denormals to zero, rounds to nearest * Representable magnitude range: [6e-5; 65504] * Maximum relative reconstruction error: 5e-4 */ -inline unsigned short meshopt_quantizeHalf(float v); +MESHOPTIMIZER_API unsigned short meshopt_quantizeHalf(float v); /** - * Quantize a float into a floating point value with a limited number of significant mantissa bits + * Quantize a float into a floating point value with a limited number of significant mantissa bits, preserving the IEEE-754 fp32 binary representation * Generates +-inf for overflow, preserves NaN, flushes denormals to zero, rounds to nearest * Assumes N is in a valid mantissa precision range, which is 1..23 */ -inline float meshopt_quantizeFloat(float v, int N); +MESHOPTIMIZER_API float meshopt_quantizeFloat(float v, int N); + +/** + * Reverse quantization of a half-precision (as defined by IEEE-754 fp16) floating point value + * Preserves Inf/NaN, flushes denormals to zero + */ +MESHOPTIMIZER_API float meshopt_dequantizeHalf(unsigned short h); #endif /** @@ -620,9 +647,11 @@ inline size_t meshopt_encodeIndexSequence(unsigned char* buffer, size_t buffer_s template <typename T> inline int meshopt_decodeIndexSequence(T* destination, size_t index_count, const unsigned char* buffer, size_t buffer_size); template <typename T> -inline size_t meshopt_simplify(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, size_t target_index_count, float target_error, unsigned int options = 0, float* result_error = 0); +inline size_t meshopt_simplify(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, size_t target_index_count, float target_error, unsigned int options = 0, float* result_error = NULL); +template <typename T> +inline size_t meshopt_simplifyWithAttributes(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, const float* vertex_attributes, size_t vertex_attributes_stride, const float* attribute_weights, size_t attribute_count, size_t target_index_count, float target_error, unsigned int options = 0, float* result_error = NULL); template <typename T> -inline size_t meshopt_simplifySloppy(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, size_t target_index_count, float target_error, float* result_error = 0); +inline size_t meshopt_simplifySloppy(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, size_t target_index_count, float target_error, float* result_error = NULL); template <typename T> inline size_t meshopt_stripify(T* destination, const T* indices, size_t index_count, size_t vertex_count, T restart_index); template <typename T> @@ -666,50 +695,6 @@ inline int meshopt_quantizeSnorm(float v, int N) return int(v * scale + round); } - -inline unsigned short meshopt_quantizeHalf(float v) -{ - union { float f; unsigned int ui; } u = {v}; - unsigned int ui = u.ui; - - int s = (ui >> 16) & 0x8000; - int em = ui & 0x7fffffff; - - /* bias exponent and round to nearest; 112 is relative exponent bias (127-15) */ - int h = (em - (112 << 23) + (1 << 12)) >> 13; - - /* underflow: flush to zero; 113 encodes exponent -14 */ - h = (em < (113 << 23)) ? 0 : h; - - /* overflow: infinity; 143 encodes exponent 16 */ - h = (em >= (143 << 23)) ? 0x7c00 : h; - - /* NaN; note that we convert all types of NaN to qNaN */ - h = (em > (255 << 23)) ? 0x7e00 : h; - - return (unsigned short)(s | h); -} - -inline float meshopt_quantizeFloat(float v, int N) -{ - union { float f; unsigned int ui; } u = {v}; - unsigned int ui = u.ui; - - const int mask = (1 << (23 - N)) - 1; - const int round = (1 << (23 - N)) >> 1; - - int e = ui & 0x7f800000; - unsigned int rui = (ui + round) & ~mask; - - /* round all numbers except inf/nan; this is important to make sure nan doesn't overflow into -0 */ - ui = e == 0x7f800000 ? ui : rui; - - /* flush denormals to zero */ - ui = e == 0 ? 0 : ui; - - u.ui = ui; - return u.f; -} #endif /* Internal implementation helpers */ @@ -746,6 +731,13 @@ public: return result; } + void deallocate(void* ptr) + { + assert(count > 0 && blocks[count - 1] == ptr); + Storage::deallocate(ptr); + count--; + } + private: void* blocks[24]; size_t count; @@ -770,7 +762,7 @@ struct meshopt_IndexAdapter<T, false> meshopt_IndexAdapter(T* result_, const T* input, size_t count_) : result(result_) - , data(0) + , data(NULL) , count(count_) { size_t size = count > size_t(-1) / sizeof(unsigned int) ? size_t(-1) : count * sizeof(unsigned int); @@ -810,33 +802,33 @@ struct meshopt_IndexAdapter<T, true> template <typename T> inline size_t meshopt_generateVertexRemap(unsigned int* destination, const T* indices, size_t index_count, const void* vertices, size_t vertex_count, size_t vertex_size) { - meshopt_IndexAdapter<T> in(0, indices, indices ? index_count : 0); + meshopt_IndexAdapter<T> in(NULL, indices, indices ? index_count : 0); - return meshopt_generateVertexRemap(destination, indices ? in.data : 0, index_count, vertices, vertex_count, vertex_size); + return meshopt_generateVertexRemap(destination, indices ? in.data : NULL, index_count, vertices, vertex_count, vertex_size); } template <typename T> inline size_t meshopt_generateVertexRemapMulti(unsigned int* destination, const T* indices, size_t index_count, size_t vertex_count, const meshopt_Stream* streams, size_t stream_count) { - meshopt_IndexAdapter<T> in(0, indices, indices ? index_count : 0); + meshopt_IndexAdapter<T> in(NULL, indices, indices ? index_count : 0); - return meshopt_generateVertexRemapMulti(destination, indices ? in.data : 0, index_count, vertex_count, streams, stream_count); + return meshopt_generateVertexRemapMulti(destination, indices ? in.data : NULL, index_count, vertex_count, streams, stream_count); } template <typename T> inline void meshopt_remapIndexBuffer(T* destination, const T* indices, size_t index_count, const unsigned int* remap) { - meshopt_IndexAdapter<T> in(0, indices, indices ? index_count : 0); + meshopt_IndexAdapter<T> in(NULL, indices, indices ? index_count : 0); meshopt_IndexAdapter<T> out(destination, 0, index_count); - meshopt_remapIndexBuffer(out.data, indices ? in.data : 0, index_count, remap); + meshopt_remapIndexBuffer(out.data, indices ? in.data : NULL, index_count, remap); } template <typename T> inline void meshopt_generateShadowIndexBuffer(T* destination, const T* indices, size_t index_count, const void* vertices, size_t vertex_count, size_t vertex_size, size_t vertex_stride) { - meshopt_IndexAdapter<T> in(0, indices, index_count); - meshopt_IndexAdapter<T> out(destination, 0, index_count); + meshopt_IndexAdapter<T> in(NULL, indices, index_count); + meshopt_IndexAdapter<T> out(destination, NULL, index_count); meshopt_generateShadowIndexBuffer(out.data, in.data, index_count, vertices, vertex_count, vertex_size, vertex_stride); } @@ -844,8 +836,8 @@ inline void meshopt_generateShadowIndexBuffer(T* destination, const T* indices, template <typename T> inline void meshopt_generateShadowIndexBufferMulti(T* destination, const T* indices, size_t index_count, size_t vertex_count, const meshopt_Stream* streams, size_t stream_count) { - meshopt_IndexAdapter<T> in(0, indices, index_count); - meshopt_IndexAdapter<T> out(destination, 0, index_count); + meshopt_IndexAdapter<T> in(NULL, indices, index_count); + meshopt_IndexAdapter<T> out(destination, NULL, index_count); meshopt_generateShadowIndexBufferMulti(out.data, in.data, index_count, vertex_count, streams, stream_count); } @@ -853,8 +845,8 @@ inline void meshopt_generateShadowIndexBufferMulti(T* destination, const T* indi template <typename T> inline void meshopt_generateAdjacencyIndexBuffer(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride) { - meshopt_IndexAdapter<T> in(0, indices, index_count); - meshopt_IndexAdapter<T> out(destination, 0, index_count * 2); + meshopt_IndexAdapter<T> in(NULL, indices, index_count); + meshopt_IndexAdapter<T> out(destination, NULL, index_count * 2); meshopt_generateAdjacencyIndexBuffer(out.data, in.data, index_count, vertex_positions, vertex_count, vertex_positions_stride); } @@ -862,8 +854,8 @@ inline void meshopt_generateAdjacencyIndexBuffer(T* destination, const T* indice template <typename T> inline void meshopt_generateTessellationIndexBuffer(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride) { - meshopt_IndexAdapter<T> in(0, indices, index_count); - meshopt_IndexAdapter<T> out(destination, 0, index_count * 4); + meshopt_IndexAdapter<T> in(NULL, indices, index_count); + meshopt_IndexAdapter<T> out(destination, NULL, index_count * 4); meshopt_generateTessellationIndexBuffer(out.data, in.data, index_count, vertex_positions, vertex_count, vertex_positions_stride); } @@ -871,8 +863,8 @@ inline void meshopt_generateTessellationIndexBuffer(T* destination, const T* ind template <typename T> inline void meshopt_optimizeVertexCache(T* destination, const T* indices, size_t index_count, size_t vertex_count) { - meshopt_IndexAdapter<T> in(0, indices, index_count); - meshopt_IndexAdapter<T> out(destination, 0, index_count); + meshopt_IndexAdapter<T> in(NULL, indices, index_count); + meshopt_IndexAdapter<T> out(destination, NULL, index_count); meshopt_optimizeVertexCache(out.data, in.data, index_count, vertex_count); } @@ -880,8 +872,8 @@ inline void meshopt_optimizeVertexCache(T* destination, const T* indices, size_t template <typename T> inline void meshopt_optimizeVertexCacheStrip(T* destination, const T* indices, size_t index_count, size_t vertex_count) { - meshopt_IndexAdapter<T> in(0, indices, index_count); - meshopt_IndexAdapter<T> out(destination, 0, index_count); + meshopt_IndexAdapter<T> in(NULL, indices, index_count); + meshopt_IndexAdapter<T> out(destination, NULL, index_count); meshopt_optimizeVertexCacheStrip(out.data, in.data, index_count, vertex_count); } @@ -889,8 +881,8 @@ inline void meshopt_optimizeVertexCacheStrip(T* destination, const T* indices, s template <typename T> inline void meshopt_optimizeVertexCacheFifo(T* destination, const T* indices, size_t index_count, size_t vertex_count, unsigned int cache_size) { - meshopt_IndexAdapter<T> in(0, indices, index_count); - meshopt_IndexAdapter<T> out(destination, 0, index_count); + meshopt_IndexAdapter<T> in(NULL, indices, index_count); + meshopt_IndexAdapter<T> out(destination, NULL, index_count); meshopt_optimizeVertexCacheFifo(out.data, in.data, index_count, vertex_count, cache_size); } @@ -898,8 +890,8 @@ inline void meshopt_optimizeVertexCacheFifo(T* destination, const T* indices, si template <typename T> inline void meshopt_optimizeOverdraw(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, float threshold) { - meshopt_IndexAdapter<T> in(0, indices, index_count); - meshopt_IndexAdapter<T> out(destination, 0, index_count); + meshopt_IndexAdapter<T> in(NULL, indices, index_count); + meshopt_IndexAdapter<T> out(destination, NULL, index_count); meshopt_optimizeOverdraw(out.data, in.data, index_count, vertex_positions, vertex_count, vertex_positions_stride, threshold); } @@ -907,7 +899,7 @@ inline void meshopt_optimizeOverdraw(T* destination, const T* indices, size_t in template <typename T> inline size_t meshopt_optimizeVertexFetchRemap(unsigned int* destination, const T* indices, size_t index_count, size_t vertex_count) { - meshopt_IndexAdapter<T> in(0, indices, index_count); + meshopt_IndexAdapter<T> in(NULL, indices, index_count); return meshopt_optimizeVertexFetchRemap(destination, in.data, index_count, vertex_count); } @@ -923,7 +915,7 @@ inline size_t meshopt_optimizeVertexFetch(void* destination, T* indices, size_t template <typename T> inline size_t meshopt_encodeIndexBuffer(unsigned char* buffer, size_t buffer_size, const T* indices, size_t index_count) { - meshopt_IndexAdapter<T> in(0, indices, index_count); + meshopt_IndexAdapter<T> in(NULL, indices, index_count); return meshopt_encodeIndexBuffer(buffer, buffer_size, in.data, index_count); } @@ -940,7 +932,7 @@ inline int meshopt_decodeIndexBuffer(T* destination, size_t index_count, const u template <typename T> inline size_t meshopt_encodeIndexSequence(unsigned char* buffer, size_t buffer_size, const T* indices, size_t index_count) { - meshopt_IndexAdapter<T> in(0, indices, index_count); + meshopt_IndexAdapter<T> in(NULL, indices, index_count); return meshopt_encodeIndexSequence(buffer, buffer_size, in.data, index_count); } @@ -957,17 +949,26 @@ inline int meshopt_decodeIndexSequence(T* destination, size_t index_count, const template <typename T> inline size_t meshopt_simplify(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, size_t target_index_count, float target_error, unsigned int options, float* result_error) { - meshopt_IndexAdapter<T> in(0, indices, index_count); - meshopt_IndexAdapter<T> out(destination, 0, index_count); + meshopt_IndexAdapter<T> in(NULL, indices, index_count); + meshopt_IndexAdapter<T> out(destination, NULL, index_count); return meshopt_simplify(out.data, in.data, index_count, vertex_positions, vertex_count, vertex_positions_stride, target_index_count, target_error, options, result_error); } template <typename T> +inline size_t meshopt_simplifyWithAttributes(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, const float* vertex_attributes, size_t vertex_attributes_stride, const float* attribute_weights, size_t attribute_count, size_t target_index_count, float target_error, unsigned int options, float* result_error) +{ + meshopt_IndexAdapter<T> in(NULL, indices, index_count); + meshopt_IndexAdapter<T> out(destination, NULL, index_count); + + return meshopt_simplifyWithAttributes(out.data, in.data, index_count, vertex_positions, vertex_count, vertex_positions_stride, vertex_attributes, vertex_attributes_stride, attribute_weights, attribute_count, target_index_count, target_error, options, result_error); +} + +template <typename T> inline size_t meshopt_simplifySloppy(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, size_t target_index_count, float target_error, float* result_error) { - meshopt_IndexAdapter<T> in(0, indices, index_count); - meshopt_IndexAdapter<T> out(destination, 0, index_count); + meshopt_IndexAdapter<T> in(NULL, indices, index_count); + meshopt_IndexAdapter<T> out(destination, NULL, index_count); return meshopt_simplifySloppy(out.data, in.data, index_count, vertex_positions, vertex_count, vertex_positions_stride, target_index_count, target_error, result_error); } @@ -975,8 +976,8 @@ inline size_t meshopt_simplifySloppy(T* destination, const T* indices, size_t in template <typename T> inline size_t meshopt_stripify(T* destination, const T* indices, size_t index_count, size_t vertex_count, T restart_index) { - meshopt_IndexAdapter<T> in(0, indices, index_count); - meshopt_IndexAdapter<T> out(destination, 0, (index_count / 3) * 5); + meshopt_IndexAdapter<T> in(NULL, indices, index_count); + meshopt_IndexAdapter<T> out(destination, NULL, (index_count / 3) * 5); return meshopt_stripify(out.data, in.data, index_count, vertex_count, unsigned(restart_index)); } @@ -984,8 +985,8 @@ inline size_t meshopt_stripify(T* destination, const T* indices, size_t index_co template <typename T> inline size_t meshopt_unstripify(T* destination, const T* indices, size_t index_count, T restart_index) { - meshopt_IndexAdapter<T> in(0, indices, index_count); - meshopt_IndexAdapter<T> out(destination, 0, (index_count - 2) * 3); + meshopt_IndexAdapter<T> in(NULL, indices, index_count); + meshopt_IndexAdapter<T> out(destination, NULL, (index_count - 2) * 3); return meshopt_unstripify(out.data, in.data, index_count, unsigned(restart_index)); } @@ -993,7 +994,7 @@ inline size_t meshopt_unstripify(T* destination, const T* indices, size_t index_ template <typename T> inline meshopt_VertexCacheStatistics meshopt_analyzeVertexCache(const T* indices, size_t index_count, size_t vertex_count, unsigned int cache_size, unsigned int warp_size, unsigned int buffer_size) { - meshopt_IndexAdapter<T> in(0, indices, index_count); + meshopt_IndexAdapter<T> in(NULL, indices, index_count); return meshopt_analyzeVertexCache(in.data, index_count, vertex_count, cache_size, warp_size, buffer_size); } @@ -1001,7 +1002,7 @@ inline meshopt_VertexCacheStatistics meshopt_analyzeVertexCache(const T* indices template <typename T> inline meshopt_OverdrawStatistics meshopt_analyzeOverdraw(const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride) { - meshopt_IndexAdapter<T> in(0, indices, index_count); + meshopt_IndexAdapter<T> in(NULL, indices, index_count); return meshopt_analyzeOverdraw(in.data, index_count, vertex_positions, vertex_count, vertex_positions_stride); } @@ -1009,7 +1010,7 @@ inline meshopt_OverdrawStatistics meshopt_analyzeOverdraw(const T* indices, size template <typename T> inline meshopt_VertexFetchStatistics meshopt_analyzeVertexFetch(const T* indices, size_t index_count, size_t vertex_count, size_t vertex_size) { - meshopt_IndexAdapter<T> in(0, indices, index_count); + meshopt_IndexAdapter<T> in(NULL, indices, index_count); return meshopt_analyzeVertexFetch(in.data, index_count, vertex_count, vertex_size); } @@ -1017,7 +1018,7 @@ inline meshopt_VertexFetchStatistics meshopt_analyzeVertexFetch(const T* indices template <typename T> inline size_t meshopt_buildMeshlets(meshopt_Meshlet* meshlets, unsigned int* meshlet_vertices, unsigned char* meshlet_triangles, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, size_t max_vertices, size_t max_triangles, float cone_weight) { - meshopt_IndexAdapter<T> in(0, indices, index_count); + meshopt_IndexAdapter<T> in(NULL, indices, index_count); return meshopt_buildMeshlets(meshlets, meshlet_vertices, meshlet_triangles, in.data, index_count, vertex_positions, vertex_count, vertex_positions_stride, max_vertices, max_triangles, cone_weight); } @@ -1025,7 +1026,7 @@ inline size_t meshopt_buildMeshlets(meshopt_Meshlet* meshlets, unsigned int* mes template <typename T> inline size_t meshopt_buildMeshletsScan(meshopt_Meshlet* meshlets, unsigned int* meshlet_vertices, unsigned char* meshlet_triangles, const T* indices, size_t index_count, size_t vertex_count, size_t max_vertices, size_t max_triangles) { - meshopt_IndexAdapter<T> in(0, indices, index_count); + meshopt_IndexAdapter<T> in(NULL, indices, index_count); return meshopt_buildMeshletsScan(meshlets, meshlet_vertices, meshlet_triangles, in.data, index_count, vertex_count, max_vertices, max_triangles); } @@ -1033,7 +1034,7 @@ inline size_t meshopt_buildMeshletsScan(meshopt_Meshlet* meshlets, unsigned int* template <typename T> inline meshopt_Bounds meshopt_computeClusterBounds(const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride) { - meshopt_IndexAdapter<T> in(0, indices, index_count); + meshopt_IndexAdapter<T> in(NULL, indices, index_count); return meshopt_computeClusterBounds(in.data, index_count, vertex_positions, vertex_count, vertex_positions_stride); } @@ -1041,15 +1042,15 @@ inline meshopt_Bounds meshopt_computeClusterBounds(const T* indices, size_t inde template <typename T> inline void meshopt_spatialSortTriangles(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride) { - meshopt_IndexAdapter<T> in(0, indices, index_count); - meshopt_IndexAdapter<T> out(destination, 0, index_count); + meshopt_IndexAdapter<T> in(NULL, indices, index_count); + meshopt_IndexAdapter<T> out(destination, NULL, index_count); meshopt_spatialSortTriangles(out.data, in.data, index_count, vertex_positions, vertex_count, vertex_positions_stride); } #endif /** - * Copyright (c) 2016-2022 Arseny Kapoulkine + * Copyright (c) 2016-2023 Arseny Kapoulkine * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation diff --git a/thirdparty/meshoptimizer/patches/attribute-aware-simplify-distance-only-metric.patch b/thirdparty/meshoptimizer/patches/attribute-aware-simplify-distance-only-metric.patch deleted file mode 100644 index 5cac985dc5..0000000000 --- a/thirdparty/meshoptimizer/patches/attribute-aware-simplify-distance-only-metric.patch +++ /dev/null @@ -1,176 +0,0 @@ -diff --git a/thirdparty/meshoptimizer/simplifier.cpp b/thirdparty/meshoptimizer/simplifier.cpp -index d8d4a67391..3847afc736 100644 ---- a/thirdparty/meshoptimizer/simplifier.cpp -+++ b/thirdparty/meshoptimizer/simplifier.cpp -@@ -20,7 +20,7 @@ - #define TRACESTATS(i) (void)0 - #endif - --#define ATTRIBUTES 8 -+#define ATTRIBUTES 3 - - // This work is based on: - // Michael Garland and Paul S. Heckbert. Surface simplification using quadric error metrics. 1997 -@@ -458,6 +458,7 @@ struct Collapse - float error; - unsigned int errorui; - }; -+ float distance_error; - }; - - static float normalize(Vector3& v) -@@ -538,6 +539,34 @@ static float quadricError(const Quadric& Q, const Vector3& v) - return fabsf(r) * s; - } - -+static float quadricErrorNoAttributes(const Quadric& Q, const Vector3& v) -+{ -+ float rx = Q.b0; -+ float ry = Q.b1; -+ float rz = Q.b2; -+ -+ rx += Q.a10 * v.y; -+ ry += Q.a21 * v.z; -+ rz += Q.a20 * v.x; -+ -+ rx *= 2; -+ ry *= 2; -+ rz *= 2; -+ -+ rx += Q.a00 * v.x; -+ ry += Q.a11 * v.y; -+ rz += Q.a22 * v.z; -+ -+ float r = Q.c; -+ r += rx * v.x; -+ r += ry * v.y; -+ r += rz * v.z; -+ -+ float s = Q.w == 0.f ? 0.f : 1.f / Q.w; -+ -+ return fabsf(r) * s; -+} -+ - static void quadricFromPlane(Quadric& Q, float a, float b, float c, float d, float w) - { - float aw = a * w; -@@ -693,7 +722,7 @@ static void quadricUpdateAttributes(Quadric& Q, const Vector3& p0, const Vector3 - } - #endif - --static void fillFaceQuadrics(Quadric* vertex_quadrics, const unsigned int* indices, size_t index_count, const Vector3* vertex_positions, const unsigned int* remap) -+static void fillFaceQuadrics(Quadric* vertex_quadrics, Quadric* vertex_no_attrib_quadrics, const unsigned int* indices, size_t index_count, const Vector3* vertex_positions, const unsigned int* remap) - { - for (size_t i = 0; i < index_count; i += 3) - { -@@ -703,6 +732,9 @@ static void fillFaceQuadrics(Quadric* vertex_quadrics, const unsigned int* indic - - Quadric Q; - quadricFromTriangle(Q, vertex_positions[i0], vertex_positions[i1], vertex_positions[i2], 1.f); -+ quadricAdd(vertex_no_attrib_quadrics[remap[i0]], Q); -+ quadricAdd(vertex_no_attrib_quadrics[remap[i1]], Q); -+ quadricAdd(vertex_no_attrib_quadrics[remap[i2]], Q); - - #if ATTRIBUTES - quadricUpdateAttributes(Q, vertex_positions[i0], vertex_positions[i1], vertex_positions[i2], Q.w); -@@ -713,7 +745,7 @@ static void fillFaceQuadrics(Quadric* vertex_quadrics, const unsigned int* indic - } - } - --static void fillEdgeQuadrics(Quadric* vertex_quadrics, const unsigned int* indices, size_t index_count, const Vector3* vertex_positions, const unsigned int* remap, const unsigned char* vertex_kind, const unsigned int* loop, const unsigned int* loopback) -+static void fillEdgeQuadrics(Quadric* vertex_quadrics, Quadric* vertex_no_attrib_quadrics, const unsigned int* indices, size_t index_count, const Vector3* vertex_positions, const unsigned int* remap, const unsigned char* vertex_kind, const unsigned int* loop, const unsigned int* loopback) - { - for (size_t i = 0; i < index_count; i += 3) - { -@@ -757,6 +789,9 @@ static void fillEdgeQuadrics(Quadric* vertex_quadrics, const unsigned int* indic - - quadricAdd(vertex_quadrics[remap[i0]], Q); - quadricAdd(vertex_quadrics[remap[i1]], Q); -+ -+ quadricAdd(vertex_no_attrib_quadrics[remap[i0]], Q); -+ quadricAdd(vertex_no_attrib_quadrics[remap[i1]], Q); - } - } - } -@@ -861,7 +896,7 @@ static size_t pickEdgeCollapses(Collapse* collapses, const unsigned int* indices - return collapse_count; - } - --static void rankEdgeCollapses(Collapse* collapses, size_t collapse_count, const Vector3* vertex_positions, const Quadric* vertex_quadrics, const unsigned int* remap) -+static void rankEdgeCollapses(Collapse* collapses, size_t collapse_count, const Vector3* vertex_positions, const Quadric* vertex_quadrics, const Quadric* vertex_no_attrib_quadrics, const unsigned int* remap) - { - for (size_t i = 0; i < collapse_count; ++i) - { -@@ -881,10 +916,14 @@ static void rankEdgeCollapses(Collapse* collapses, size_t collapse_count, const - float ei = quadricError(qi, vertex_positions[i1]); - float ej = quadricError(qj, vertex_positions[j1]); - -+ const Quadric& naqi = vertex_no_attrib_quadrics[remap[i0]]; -+ const Quadric& naqj = vertex_no_attrib_quadrics[remap[j0]]; -+ - // pick edge direction with minimal error - c.v0 = ei <= ej ? i0 : j0; - c.v1 = ei <= ej ? i1 : j1; - c.error = ei <= ej ? ei : ej; -+ c.distance_error = ei <= ej ? quadricErrorNoAttributes(naqi, vertex_positions[i1]) : quadricErrorNoAttributes(naqj, vertex_positions[j1]); - } - } - -@@ -981,7 +1020,7 @@ static void sortEdgeCollapses(unsigned int* sort_order, const Collapse* collapse - } - } - --static size_t performEdgeCollapses(unsigned int* collapse_remap, unsigned char* collapse_locked, Quadric* vertex_quadrics, const Collapse* collapses, size_t collapse_count, const unsigned int* collapse_order, const unsigned int* remap, const unsigned int* wedge, const unsigned char* vertex_kind, const Vector3* vertex_positions, const EdgeAdjacency& adjacency, size_t triangle_collapse_goal, float error_limit, float& result_error) -+static size_t performEdgeCollapses(unsigned int* collapse_remap, unsigned char* collapse_locked, Quadric* vertex_quadrics, Quadric* vertex_no_attrib_quadrics, const Collapse* collapses, size_t collapse_count, const unsigned int* collapse_order, const unsigned int* remap, const unsigned int* wedge, const unsigned char* vertex_kind, const Vector3* vertex_positions, const EdgeAdjacency& adjacency, size_t triangle_collapse_goal, float error_limit, float& result_error) - { - size_t edge_collapses = 0; - size_t triangle_collapses = 0; -@@ -1043,6 +1082,7 @@ static size_t performEdgeCollapses(unsigned int* collapse_remap, unsigned char* - assert(collapse_remap[r1] == r1); - - quadricAdd(vertex_quadrics[r1], vertex_quadrics[r0]); -+ quadricAdd(vertex_no_attrib_quadrics[r1], vertex_no_attrib_quadrics[r0]); - - if (vertex_kind[i0] == Kind_Complex) - { -@@ -1080,7 +1120,7 @@ static size_t performEdgeCollapses(unsigned int* collapse_remap, unsigned char* - triangle_collapses += (vertex_kind[i0] == Kind_Border) ? 1 : 2; - edge_collapses++; - -- result_error = result_error < c.error ? c.error : result_error; -+ result_error = result_error < c.distance_error ? c.distance_error : result_error; - } - - #if TRACE -@@ -1469,9 +1509,11 @@ size_t meshopt_simplifyWithAttributes(unsigned int* destination, const unsigned - - Quadric* vertex_quadrics = allocator.allocate<Quadric>(vertex_count); - memset(vertex_quadrics, 0, vertex_count * sizeof(Quadric)); -+ Quadric* vertex_no_attrib_quadrics = allocator.allocate<Quadric>(vertex_count); -+ memset(vertex_no_attrib_quadrics, 0, vertex_count * sizeof(Quadric)); - -- fillFaceQuadrics(vertex_quadrics, indices, index_count, vertex_positions, remap); -- fillEdgeQuadrics(vertex_quadrics, indices, index_count, vertex_positions, remap, vertex_kind, loop, loopback); -+ fillFaceQuadrics(vertex_quadrics, vertex_no_attrib_quadrics, indices, index_count, vertex_positions, remap); -+ fillEdgeQuadrics(vertex_quadrics, vertex_no_attrib_quadrics, indices, index_count, vertex_positions, remap, vertex_kind, loop, loopback); - - if (result != indices) - memcpy(result, indices, index_count * sizeof(unsigned int)); -@@ -1502,7 +1544,7 @@ size_t meshopt_simplifyWithAttributes(unsigned int* destination, const unsigned - if (edge_collapse_count == 0) - break; - -- rankEdgeCollapses(edge_collapses, edge_collapse_count, vertex_positions, vertex_quadrics, remap); -+ rankEdgeCollapses(edge_collapses, edge_collapse_count, vertex_positions, vertex_quadrics, vertex_no_attrib_quadrics, remap); - - #if TRACE > 1 - dumpEdgeCollapses(edge_collapses, edge_collapse_count, vertex_kind); -@@ -1521,7 +1563,7 @@ size_t meshopt_simplifyWithAttributes(unsigned int* destination, const unsigned - printf("pass %d: ", int(pass_count++)); - #endif - -- size_t collapses = performEdgeCollapses(collapse_remap, collapse_locked, vertex_quadrics, edge_collapses, edge_collapse_count, collapse_order, remap, wedge, vertex_kind, vertex_positions, adjacency, triangle_collapse_goal, error_limit, result_error); -+ size_t collapses = performEdgeCollapses(collapse_remap, collapse_locked, vertex_quadrics, vertex_no_attrib_quadrics, edge_collapses, edge_collapse_count, collapse_order, remap, wedge, vertex_kind, vertex_positions, adjacency, triangle_collapse_goal, error_limit, result_error); - - // no edges can be collapsed any more due to hitting the error limit or triangle collapse limit - if (collapses == 0) diff --git a/thirdparty/meshoptimizer/patches/attribute-aware-simplify.patch b/thirdparty/meshoptimizer/patches/attribute-aware-simplify.patch deleted file mode 100644 index c065026a7d..0000000000 --- a/thirdparty/meshoptimizer/patches/attribute-aware-simplify.patch +++ /dev/null @@ -1,263 +0,0 @@ -diff --git a/thirdparty/meshoptimizer/meshoptimizer.h b/thirdparty/meshoptimizer/meshoptimizer.h -index d95725dd71..46d28d3ea3 100644 ---- a/thirdparty/meshoptimizer/meshoptimizer.h -+++ b/thirdparty/meshoptimizer/meshoptimizer.h -@@ -321,6 +321,11 @@ enum - meshopt_SimplifyLockBorder = 1 << 0, - }; - -+/** -+ * Experimental: Mesh simplifier with attribute metric; attributes follow xyz position data atm (vertex data must contain 3 + attribute_count floats per vertex) -+ */ -+MESHOPTIMIZER_EXPERIMENTAL size_t meshopt_simplifyWithAttributes(unsigned int* destination, const unsigned int* indices, size_t index_count, const float* vertex_data, size_t vertex_count, size_t vertex_stride, size_t target_index_count, float target_error, unsigned int options, float* result_error, const float* attributes, const float* attribute_weights, size_t attribute_count); -+ - /** - * Mesh simplifier - * Reduces the number of triangles in the mesh, attempting to preserve mesh appearance as much as possible -diff --git a/thirdparty/meshoptimizer/simplifier.cpp b/thirdparty/meshoptimizer/simplifier.cpp -index 5f0e9bac31..797329b010 100644 ---- a/thirdparty/meshoptimizer/simplifier.cpp -+++ b/thirdparty/meshoptimizer/simplifier.cpp -@@ -20,6 +20,8 @@ - #define TRACESTATS(i) (void)0 - #endif - -+#define ATTRIBUTES 8 -+ - // This work is based on: - // Michael Garland and Paul S. Heckbert. Surface simplification using quadric error metrics. 1997 - // Michael Garland. Quadric-based polygonal surface simplification. 1999 -@@ -376,6 +378,10 @@ static void classifyVertices(unsigned char* result, unsigned int* loop, unsigned - struct Vector3 - { - float x, y, z; -+ -+#if ATTRIBUTES -+ float a[ATTRIBUTES]; -+#endif - }; - - static float rescalePositions(Vector3* result, const float* vertex_positions_data, size_t vertex_count, size_t vertex_positions_stride) -@@ -432,6 +438,13 @@ struct Quadric - float a10, a20, a21; - float b0, b1, b2, c; - float w; -+ -+#if ATTRIBUTES -+ float gx[ATTRIBUTES]; -+ float gy[ATTRIBUTES]; -+ float gz[ATTRIBUTES]; -+ float gw[ATTRIBUTES]; -+#endif - }; - - struct Collapse -@@ -474,6 +487,16 @@ static void quadricAdd(Quadric& Q, const Quadric& R) - Q.b2 += R.b2; - Q.c += R.c; - Q.w += R.w; -+ -+#if ATTRIBUTES -+ for (int k = 0; k < ATTRIBUTES; ++k) -+ { -+ Q.gx[k] += R.gx[k]; -+ Q.gy[k] += R.gy[k]; -+ Q.gz[k] += R.gz[k]; -+ Q.gw[k] += R.gw[k]; -+ } -+#endif - } - - static float quadricError(const Quadric& Q, const Vector3& v) -@@ -499,6 +522,17 @@ static float quadricError(const Quadric& Q, const Vector3& v) - r += ry * v.y; - r += rz * v.z; - -+#if ATTRIBUTES -+ // see quadricUpdateAttributes for general derivation; here we need to add the parts of (eval(pos) - attr)^2 that depend on attr -+ for (int k = 0; k < ATTRIBUTES; ++k) -+ { -+ float a = v.a[k]; -+ -+ r += a * a * Q.w; -+ r -= 2 * a * (v.x * Q.gx[k] + v.y * Q.gy[k] + v.z * Q.gz[k] + Q.gw[k]); -+ } -+#endif -+ - float s = Q.w == 0.f ? 0.f : 1.f / Q.w; - - return fabsf(r) * s; -@@ -522,6 +556,13 @@ static void quadricFromPlane(Quadric& Q, float a, float b, float c, float d, flo - Q.b2 = c * dw; - Q.c = d * dw; - Q.w = w; -+ -+#if ATTRIBUTES -+ memset(Q.gx, 0, sizeof(Q.gx)); -+ memset(Q.gy, 0, sizeof(Q.gy)); -+ memset(Q.gz, 0, sizeof(Q.gz)); -+ memset(Q.gw, 0, sizeof(Q.gw)); -+#endif - } - - static void quadricFromPoint(Quadric& Q, float x, float y, float z, float w) -@@ -574,6 +615,84 @@ static void quadricFromTriangleEdge(Quadric& Q, const Vector3& p0, const Vector3 - quadricFromPlane(Q, normal.x, normal.y, normal.z, -distance, length * weight); - } - -+#if ATTRIBUTES -+static void quadricUpdateAttributes(Quadric& Q, const Vector3& p0, const Vector3& p1, const Vector3& p2, float w) -+{ -+ // for each attribute we want to encode the following function into the quadric: -+ // (eval(pos) - attr)^2 -+ // where eval(pos) interpolates attribute across the triangle like so: -+ // eval(pos) = pos.x * gx + pos.y * gy + pos.z * gz + gw -+ // where gx/gy/gz/gw are gradients -+ Vector3 p10 = {p1.x - p0.x, p1.y - p0.y, p1.z - p0.z}; -+ Vector3 p20 = {p2.x - p0.x, p2.y - p0.y, p2.z - p0.z}; -+ -+ // we compute gradients using barycentric coordinates; barycentric coordinates can be computed as follows: -+ // v = (d11 * d20 - d01 * d21) / denom -+ // w = (d00 * d21 - d01 * d20) / denom -+ // u = 1 - v - w -+ // here v0, v1 are triangle edge vectors, v2 is a vector from point to triangle corner, and dij = dot(vi, vj) -+ const Vector3& v0 = p10; -+ const Vector3& v1 = p20; -+ float d00 = v0.x * v0.x + v0.y * v0.y + v0.z * v0.z; -+ float d01 = v0.x * v1.x + v0.y * v1.y + v0.z * v1.z; -+ float d11 = v1.x * v1.x + v1.y * v1.y + v1.z * v1.z; -+ float denom = d00 * d11 - d01 * d01; -+ float denomr = denom == 0 ? 0.f : 1.f / denom; -+ -+ // precompute gradient factors -+ // these are derived by directly computing derivative of eval(pos) = a0 * u + a1 * v + a2 * w and factoring out common factors that are shared between attributes -+ float gx1 = (d11 * v0.x - d01 * v1.x) * denomr; -+ float gx2 = (d00 * v1.x - d01 * v0.x) * denomr; -+ float gy1 = (d11 * v0.y - d01 * v1.y) * denomr; -+ float gy2 = (d00 * v1.y - d01 * v0.y) * denomr; -+ float gz1 = (d11 * v0.z - d01 * v1.z) * denomr; -+ float gz2 = (d00 * v1.z - d01 * v0.z) * denomr; -+ -+ for (int k = 0; k < ATTRIBUTES; ++k) -+ { -+ float a0 = p0.a[k], a1 = p1.a[k], a2 = p2.a[k]; -+ -+ // compute gradient of eval(pos) for x/y/z/w -+ // the formulas below are obtained by directly computing derivative of eval(pos) = a0 * u + a1 * v + a2 * w -+ float gx = gx1 * (a1 - a0) + gx2 * (a2 - a0); -+ float gy = gy1 * (a1 - a0) + gy2 * (a2 - a0); -+ float gz = gz1 * (a1 - a0) + gz2 * (a2 - a0); -+ float gw = a0 - p0.x * gx - p0.y * gy - p0.z * gz; -+ -+ // quadric encodes (eval(pos)-attr)^2; this means that the resulting expansion needs to compute, for example, pos.x * pos.y * K -+ // since quadrics already encode factors for pos.x * pos.y, we can accumulate almost everything in basic quadric fields -+ Q.a00 += w * (gx * gx); -+ Q.a11 += w * (gy * gy); -+ Q.a22 += w * (gz * gz); -+ -+ Q.a10 += w * (gy * gx); -+ Q.a20 += w * (gz * gx); -+ Q.a21 += w * (gz * gy); -+ -+ Q.b0 += w * (gx * gw); -+ Q.b1 += w * (gy * gw); -+ Q.b2 += w * (gz * gw); -+ -+ Q.c += w * (gw * gw); -+ -+ // the only remaining sum components are ones that depend on attr; these will be addded during error evaluation, see quadricError -+ Q.gx[k] = w * gx; -+ Q.gy[k] = w * gy; -+ Q.gz[k] = w * gz; -+ Q.gw[k] = w * gw; -+ -+#if TRACE > 2 -+ printf("attr%d: %e %e %e\n", -+ k, -+ (gx * p0.x + gy * p0.y + gz * p0.z + gw - a0), -+ (gx * p1.x + gy * p1.y + gz * p1.z + gw - a1), -+ (gx * p2.x + gy * p2.y + gz * p2.z + gw - a2) -+ ); -+#endif -+ } -+} -+#endif -+ - static void fillFaceQuadrics(Quadric* vertex_quadrics, const unsigned int* indices, size_t index_count, const Vector3* vertex_positions, const unsigned int* remap) - { - for (size_t i = 0; i < index_count; i += 3) -@@ -585,6 +704,9 @@ static void fillFaceQuadrics(Quadric* vertex_quadrics, const unsigned int* indic - Quadric Q; - quadricFromTriangle(Q, vertex_positions[i0], vertex_positions[i1], vertex_positions[i2], 1.f); - -+#if ATTRIBUTES -+ quadricUpdateAttributes(Q, vertex_positions[i0], vertex_positions[i1], vertex_positions[i2], Q.w); -+#endif - quadricAdd(vertex_quadrics[remap[i0]], Q); - quadricAdd(vertex_quadrics[remap[i1]], Q); - quadricAdd(vertex_quadrics[remap[i2]], Q); -@@ -1278,14 +1400,20 @@ MESHOPTIMIZER_API unsigned int* meshopt_simplifyDebugLoopBack = 0; - #endif - - size_t meshopt_simplify(unsigned int* destination, const unsigned int* indices, size_t index_count, const float* vertex_positions_data, size_t vertex_count, size_t vertex_positions_stride, size_t target_index_count, float target_error, unsigned int options, float* out_result_error) -+{ -+ return meshopt_simplifyWithAttributes(destination, indices, index_count, vertex_positions_data, vertex_count, vertex_positions_stride, target_index_count, target_error, options, out_result_error, 0, 0, 0); -+} -+ -+size_t meshopt_simplifyWithAttributes(unsigned int* destination, const unsigned int* indices, size_t index_count, const float* vertex_data, size_t vertex_count, size_t vertex_stride, size_t target_index_count, float target_error, unsigned int options, float* out_result_error, const float* attributes, const float* attribute_weights, size_t attribute_count) - { - using namespace meshopt; - - assert(index_count % 3 == 0); -- assert(vertex_positions_stride >= 12 && vertex_positions_stride <= 256); -- assert(vertex_positions_stride % sizeof(float) == 0); -+ assert(vertex_stride >= 12 && vertex_stride <= 256); -+ assert(vertex_stride % sizeof(float) == 0); - assert(target_index_count <= index_count); - assert((options & ~(meshopt_SimplifyLockBorder)) == 0); -+ assert(attribute_count <= ATTRIBUTES); - - meshopt_Allocator allocator; - -@@ -1299,7 +1427,7 @@ size_t meshopt_simplify(unsigned int* destination, const unsigned int* indices, - // build position remap that maps each vertex to the one with identical position - unsigned int* remap = allocator.allocate<unsigned int>(vertex_count); - unsigned int* wedge = allocator.allocate<unsigned int>(vertex_count); -- buildPositionRemap(remap, wedge, vertex_positions_data, vertex_count, vertex_positions_stride, allocator); -+ buildPositionRemap(remap, wedge, vertex_data, vertex_count, vertex_stride, allocator); - - // classify vertices; vertex kind determines collapse rules, see kCanCollapse - unsigned char* vertex_kind = allocator.allocate<unsigned char>(vertex_count); -@@ -1323,7 +1451,21 @@ size_t meshopt_simplify(unsigned int* destination, const unsigned int* indices, - #endif - - Vector3* vertex_positions = allocator.allocate<Vector3>(vertex_count); -- rescalePositions(vertex_positions, vertex_positions_data, vertex_count, vertex_positions_stride); -+ rescalePositions(vertex_positions, vertex_data, vertex_count, vertex_stride); -+ -+#if ATTRIBUTES -+ for (size_t i = 0; i < vertex_count; ++i) -+ { -+ memset(vertex_positions[i].a, 0, sizeof(vertex_positions[i].a)); -+ -+ for (size_t k = 0; k < attribute_count; ++k) -+ { -+ float a = attributes[i * attribute_count + k]; -+ -+ vertex_positions[i].a[k] = a * attribute_weights[k]; -+ } -+ } -+#endif - - Quadric* vertex_quadrics = allocator.allocate<Quadric>(vertex_count); - memset(vertex_quadrics, 0, vertex_count * sizeof(Quadric)); -@@ -1415,7 +1557,9 @@ size_t meshopt_simplify(unsigned int* destination, const unsigned int* indices, - - // result_error is quadratic; we need to remap it back to linear - if (out_result_error) -+ { - *out_result_error = sqrtf(result_error); -+ } - - return result_count; - } diff --git a/thirdparty/meshoptimizer/patches/distance-only-metric.patch b/thirdparty/meshoptimizer/patches/distance-only-metric.patch new file mode 100644 index 0000000000..651bdba5ef --- /dev/null +++ b/thirdparty/meshoptimizer/patches/distance-only-metric.patch @@ -0,0 +1,39 @@ +diff --git a/thirdparty/meshoptimizer/simplifier.cpp b/thirdparty/meshoptimizer/simplifier.cpp +index 5ba8570076..6f8b0e520e 100644 +--- a/thirdparty/meshoptimizer/simplifier.cpp ++++ b/thirdparty/meshoptimizer/simplifier.cpp +@@ -476,6 +476,8 @@ struct Collapse + float error; + unsigned int errorui; + }; ++ ++ float distance_error; + }; + + static float normalize(Vector3& v) +@@ -941,6 +943,8 @@ static void rankEdgeCollapses(Collapse* collapses, size_t collapse_count, const + float ei = quadricError(vertex_quadrics[remap[i0]], vertex_positions[i1]); + float ej = quadricError(vertex_quadrics[remap[j0]], vertex_positions[j1]); + ++ float dei = ei, dej = ej; ++ + if (attribute_count) + { + ei += quadricError(attribute_quadrics[remap[i0]], &attribute_gradients[remap[i0] * attribute_count], attribute_count, vertex_positions[i1], &vertex_attributes[i1 * attribute_count]); +@@ -951,6 +955,7 @@ static void rankEdgeCollapses(Collapse* collapses, size_t collapse_count, const + c.v0 = ei <= ej ? i0 : j0; + c.v1 = ei <= ej ? i1 : j1; + c.error = ei <= ej ? ei : ej; ++ c.distance_error = ei <= ej ? dei : dej; + } + } + +@@ -1097,7 +1102,7 @@ static size_t performEdgeCollapses(unsigned int* collapse_remap, unsigned char* + triangle_collapses += (vertex_kind[i0] == Kind_Border) ? 1 : 2; + edge_collapses++; + +- result_error = result_error < c.error ? c.error : result_error; ++ result_error = result_error < c.distance_error ? c.distance_error : result_error; + } + + #if TRACE diff --git a/thirdparty/meshoptimizer/quantization.cpp b/thirdparty/meshoptimizer/quantization.cpp new file mode 100644 index 0000000000..09a314d602 --- /dev/null +++ b/thirdparty/meshoptimizer/quantization.cpp @@ -0,0 +1,70 @@ +// This file is part of meshoptimizer library; see meshoptimizer.h for version/license details +#include "meshoptimizer.h" + +#include <assert.h> + +unsigned short meshopt_quantizeHalf(float v) +{ + union { float f; unsigned int ui; } u = {v}; + unsigned int ui = u.ui; + + int s = (ui >> 16) & 0x8000; + int em = ui & 0x7fffffff; + + // bias exponent and round to nearest; 112 is relative exponent bias (127-15) + int h = (em - (112 << 23) + (1 << 12)) >> 13; + + // underflow: flush to zero; 113 encodes exponent -14 + h = (em < (113 << 23)) ? 0 : h; + + // overflow: infinity; 143 encodes exponent 16 + h = (em >= (143 << 23)) ? 0x7c00 : h; + + // NaN; note that we convert all types of NaN to qNaN + h = (em > (255 << 23)) ? 0x7e00 : h; + + return (unsigned short)(s | h); +} + +float meshopt_quantizeFloat(float v, int N) +{ + assert(N >= 0 && N <= 23); + + union { float f; unsigned int ui; } u = {v}; + unsigned int ui = u.ui; + + const int mask = (1 << (23 - N)) - 1; + const int round = (1 << (23 - N)) >> 1; + + int e = ui & 0x7f800000; + unsigned int rui = (ui + round) & ~mask; + + // round all numbers except inf/nan; this is important to make sure nan doesn't overflow into -0 + ui = e == 0x7f800000 ? ui : rui; + + // flush denormals to zero + ui = e == 0 ? 0 : ui; + + u.ui = ui; + return u.f; +} + +float meshopt_dequantizeHalf(unsigned short h) +{ + unsigned int s = unsigned(h & 0x8000) << 16; + int em = h & 0x7fff; + + // bias exponent and pad mantissa with 0; 112 is relative exponent bias (127-15) + int r = (em + (112 << 10)) << 13; + + // denormal: flush to zero + r = (em < (1 << 10)) ? 0 : r; + + // infinity/NaN; note that we preserve NaN payload as a byproduct of unifying inf/nan cases + // 112 is an exponent bias fixup; since we already applied it once, applying it twice converts 31 to 255 + r += (em >= (31 << 10)) ? (112 << 23) : 0; + + union { float f; unsigned int ui; } u; + u.ui = s | r; + return u.f; +} diff --git a/thirdparty/meshoptimizer/simplifier.cpp b/thirdparty/meshoptimizer/simplifier.cpp index 391a77861a..6f8b0e520e 100644 --- a/thirdparty/meshoptimizer/simplifier.cpp +++ b/thirdparty/meshoptimizer/simplifier.cpp @@ -20,14 +20,13 @@ #define TRACESTATS(i) (void)0 #endif -#define ATTRIBUTES 3 - // This work is based on: // Michael Garland and Paul S. Heckbert. Surface simplification using quadric error metrics. 1997 // Michael Garland. Quadric-based polygonal surface simplification. 1999 // Peter Lindstrom. Out-of-Core Simplification of Large Polygonal Models. 2000 // Matthias Teschner, Bruno Heidelberger, Matthias Mueller, Danat Pomeranets, Markus Gross. Optimized Spatial Hashing for Collision Detection of Deformable Objects. 2003 // Peter Van Sandt, Yannis Chronis, Jignesh M. Patel. Efficiently Searching In-Memory Sorted Arrays: Revenge of the Interpolation Search? 2019 +// Hugues Hoppe. New Quadric Metric for Simplifying Meshes with Appearance Attributes. 1999 namespace meshopt { @@ -39,31 +38,31 @@ struct EdgeAdjacency unsigned int prev; }; - unsigned int* counts; unsigned int* offsets; Edge* data; }; static void prepareEdgeAdjacency(EdgeAdjacency& adjacency, size_t index_count, size_t vertex_count, meshopt_Allocator& allocator) { - adjacency.counts = allocator.allocate<unsigned int>(vertex_count); - adjacency.offsets = allocator.allocate<unsigned int>(vertex_count); + adjacency.offsets = allocator.allocate<unsigned int>(vertex_count + 1); adjacency.data = allocator.allocate<EdgeAdjacency::Edge>(index_count); } static void updateEdgeAdjacency(EdgeAdjacency& adjacency, const unsigned int* indices, size_t index_count, size_t vertex_count, const unsigned int* remap) { size_t face_count = index_count / 3; + unsigned int* offsets = adjacency.offsets + 1; + EdgeAdjacency::Edge* data = adjacency.data; // fill edge counts - memset(adjacency.counts, 0, vertex_count * sizeof(unsigned int)); + memset(offsets, 0, vertex_count * sizeof(unsigned int)); for (size_t i = 0; i < index_count; ++i) { unsigned int v = remap ? remap[indices[i]] : indices[i]; assert(v < vertex_count); - adjacency.counts[v]++; + offsets[v]++; } // fill offset table @@ -71,8 +70,9 @@ static void updateEdgeAdjacency(EdgeAdjacency& adjacency, const unsigned int* in for (size_t i = 0; i < vertex_count; ++i) { - adjacency.offsets[i] = offset; - offset += adjacency.counts[i]; + unsigned int count = offsets[i]; + offsets[i] = offset; + offset += count; } assert(offset == index_count); @@ -89,26 +89,22 @@ static void updateEdgeAdjacency(EdgeAdjacency& adjacency, const unsigned int* in c = remap[c]; } - adjacency.data[adjacency.offsets[a]].next = b; - adjacency.data[adjacency.offsets[a]].prev = c; - adjacency.offsets[a]++; + data[offsets[a]].next = b; + data[offsets[a]].prev = c; + offsets[a]++; - adjacency.data[adjacency.offsets[b]].next = c; - adjacency.data[adjacency.offsets[b]].prev = a; - adjacency.offsets[b]++; + data[offsets[b]].next = c; + data[offsets[b]].prev = a; + offsets[b]++; - adjacency.data[adjacency.offsets[c]].next = a; - adjacency.data[adjacency.offsets[c]].prev = b; - adjacency.offsets[c]++; + data[offsets[c]].next = a; + data[offsets[c]].prev = b; + offsets[c]++; } - // fix offsets that have been disturbed by the previous pass - for (size_t i = 0; i < vertex_count; ++i) - { - assert(adjacency.offsets[i] >= adjacency.counts[i]); - - adjacency.offsets[i] -= adjacency.counts[i]; - } + // finalize offsets + adjacency.offsets[0] = 0; + assert(adjacency.offsets[vertex_count] == index_count); } struct PositionHasher @@ -168,7 +164,7 @@ static T* hashLookup2(T* table, size_t buckets, const Hash& hash, const T& key, } assert(false && "Hash table is full"); // unreachable - return 0; + return NULL; } static void buildPositionRemap(unsigned int* remap, unsigned int* wedge, const float* vertex_positions_data, size_t vertex_count, size_t vertex_positions_stride, meshopt_Allocator& allocator) @@ -205,6 +201,8 @@ static void buildPositionRemap(unsigned int* remap, unsigned int* wedge, const f wedge[i] = wedge[r]; wedge[r] = unsigned(i); } + + allocator.deallocate(table); } enum VertexKind @@ -244,7 +242,7 @@ const unsigned char kHasOpposite[Kind_Count][Kind_Count] = { static bool hasEdge(const EdgeAdjacency& adjacency, unsigned int a, unsigned int b) { - unsigned int count = adjacency.counts[a]; + unsigned int count = adjacency.offsets[a + 1] - adjacency.offsets[a]; const EdgeAdjacency::Edge* edges = adjacency.data + adjacency.offsets[a]; for (size_t i = 0; i < count; ++i) @@ -269,7 +267,7 @@ static void classifyVertices(unsigned char* result, unsigned int* loop, unsigned { unsigned int vertex = unsigned(i); - unsigned int count = adjacency.counts[vertex]; + unsigned int count = adjacency.offsets[vertex + 1] - adjacency.offsets[vertex]; const EdgeAdjacency::Edge* edges = adjacency.data + adjacency.offsets[vertex]; for (size_t j = 0; j < count; ++j) @@ -378,10 +376,6 @@ static void classifyVertices(unsigned char* result, unsigned int* loop, unsigned struct Vector3 { float x, y, z; - -#if ATTRIBUTES - float a[ATTRIBUTES]; -#endif }; static float rescalePositions(Vector3* result, const float* vertex_positions_data, size_t vertex_count, size_t vertex_positions_stride) @@ -432,19 +426,43 @@ static float rescalePositions(Vector3* result, const float* vertex_positions_dat return extent; } +static void rescaleAttributes(float* result, const float* vertex_attributes_data, size_t vertex_count, size_t vertex_attributes_stride, const float* attribute_weights, size_t attribute_count) +{ + size_t vertex_attributes_stride_float = vertex_attributes_stride / sizeof(float); + + for (size_t i = 0; i < vertex_count; ++i) + { + for (size_t k = 0; k < attribute_count; ++k) + { + float a = vertex_attributes_data[i * vertex_attributes_stride_float + k]; + + result[i * attribute_count + k] = a * attribute_weights[k]; + } + } +} + +static const size_t kMaxAttributes = 16; + struct Quadric { + // a00*x^2 + a11*y^2 + a22*z^2 + 2*(a10*xy + a20*xz + a21*yz) + b0*x + b1*y + b2*z + c float a00, a11, a22; float a10, a20, a21; float b0, b1, b2, c; float w; +}; -#if ATTRIBUTES - float gx[ATTRIBUTES]; - float gy[ATTRIBUTES]; - float gz[ATTRIBUTES]; - float gw[ATTRIBUTES]; -#endif +struct QuadricGrad +{ + // gx*x + gy*y + gz*z + gw + float gx, gy, gz, gw; +}; + +struct Reservoir +{ + float x, y, z; + float r, g, b; + float w; }; struct Collapse @@ -458,6 +476,7 @@ struct Collapse float error; unsigned int errorui; }; + float distance_error; }; @@ -488,16 +507,17 @@ static void quadricAdd(Quadric& Q, const Quadric& R) Q.b2 += R.b2; Q.c += R.c; Q.w += R.w; +} -#if ATTRIBUTES - for (int k = 0; k < ATTRIBUTES; ++k) +static void quadricAdd(QuadricGrad* G, const QuadricGrad* R, size_t attribute_count) +{ + for (size_t k = 0; k < attribute_count; ++k) { - Q.gx[k] += R.gx[k]; - Q.gy[k] += R.gy[k]; - Q.gz[k] += R.gz[k]; - Q.gw[k] += R.gw[k]; + G[k].gx += R[k].gx; + G[k].gy += R[k].gy; + G[k].gz += R[k].gz; + G[k].gw += R[k].gw; } -#endif } static float quadricError(const Quadric& Q, const Vector3& v) @@ -523,23 +543,12 @@ static float quadricError(const Quadric& Q, const Vector3& v) r += ry * v.y; r += rz * v.z; -#if ATTRIBUTES - // see quadricUpdateAttributes for general derivation; here we need to add the parts of (eval(pos) - attr)^2 that depend on attr - for (int k = 0; k < ATTRIBUTES; ++k) - { - float a = v.a[k]; - - r += a * a * Q.w; - r -= 2 * a * (v.x * Q.gx[k] + v.y * Q.gy[k] + v.z * Q.gz[k] + Q.gw[k]); - } -#endif - float s = Q.w == 0.f ? 0.f : 1.f / Q.w; return fabsf(r) * s; } -static float quadricErrorNoAttributes(const Quadric& Q, const Vector3& v) +static float quadricError(const Quadric& Q, const QuadricGrad* G, size_t attribute_count, const Vector3& v, const float* va) { float rx = Q.b0; float ry = Q.b1; @@ -562,7 +571,18 @@ static float quadricErrorNoAttributes(const Quadric& Q, const Vector3& v) r += ry * v.y; r += rz * v.z; - float s = Q.w == 0.f ? 0.f : 1.f / Q.w; + // see quadricFromAttributes for general derivation; here we need to add the parts of (eval(pos) - attr)^2 that depend on attr + for (size_t k = 0; k < attribute_count; ++k) + { + float a = va[k]; + float g = v.x * G[k].gx + v.y * G[k].gy + v.z * G[k].gz + G[k].gw; + + r += a * a * Q.w; + r -= 2 * a * g; + } + + // TODO: weight normalization is breaking attribute error somehow + float s = 1;// Q.w == 0.f ? 0.f : 1.f / Q.w; return fabsf(r) * s; } @@ -585,29 +605,6 @@ static void quadricFromPlane(Quadric& Q, float a, float b, float c, float d, flo Q.b2 = c * dw; Q.c = d * dw; Q.w = w; - -#if ATTRIBUTES - memset(Q.gx, 0, sizeof(Q.gx)); - memset(Q.gy, 0, sizeof(Q.gy)); - memset(Q.gz, 0, sizeof(Q.gz)); - memset(Q.gw, 0, sizeof(Q.gw)); -#endif -} - -static void quadricFromPoint(Quadric& Q, float x, float y, float z, float w) -{ - // we need to encode (x - X) ^ 2 + (y - Y)^2 + (z - Z)^2 into the quadric - Q.a00 = w; - Q.a11 = w; - Q.a22 = w; - Q.a10 = 0.f; - Q.a20 = 0.f; - Q.a21 = 0.f; - Q.b0 = -2.f * x * w; - Q.b1 = -2.f * y * w; - Q.b2 = -2.f * z * w; - Q.c = (x * x + y * y + z * z) * w; - Q.w = w; } static void quadricFromTriangle(Quadric& Q, const Vector3& p0, const Vector3& p1, const Vector3& p2, float weight) @@ -644,8 +641,7 @@ static void quadricFromTriangleEdge(Quadric& Q, const Vector3& p0, const Vector3 quadricFromPlane(Q, normal.x, normal.y, normal.z, -distance, length * weight); } -#if ATTRIBUTES -static void quadricUpdateAttributes(Quadric& Q, const Vector3& p0, const Vector3& p1, const Vector3& p2, float w) +static void quadricFromAttributes(Quadric& Q, QuadricGrad* G, const Vector3& p0, const Vector3& p1, const Vector3& p2, const float* va0, const float* va1, const float* va2, size_t attribute_count) { // for each attribute we want to encode the following function into the quadric: // (eval(pos) - attr)^2 @@ -655,6 +651,11 @@ static void quadricUpdateAttributes(Quadric& Q, const Vector3& p0, const Vector3 Vector3 p10 = {p1.x - p0.x, p1.y - p0.y, p1.z - p0.z}; Vector3 p20 = {p2.x - p0.x, p2.y - p0.y, p2.z - p0.z}; + // weight is scaled linearly with edge length + Vector3 normal = {p10.y * p20.z - p10.z * p20.y, p10.z * p20.x - p10.x * p20.z, p10.x * p20.y - p10.y * p20.x}; + float area = sqrtf(normal.x * normal.x + normal.y * normal.y + normal.z * normal.z); + float w = sqrtf(area); // TODO this needs more experimentation + // we compute gradients using barycentric coordinates; barycentric coordinates can be computed as follows: // v = (d11 * d20 - d01 * d21) / denom // w = (d00 * d21 - d01 * d20) / denom @@ -677,9 +678,13 @@ static void quadricUpdateAttributes(Quadric& Q, const Vector3& p0, const Vector3 float gz1 = (d11 * v0.z - d01 * v1.z) * denomr; float gz2 = (d00 * v1.z - d01 * v0.z) * denomr; - for (int k = 0; k < ATTRIBUTES; ++k) + memset(&Q, 0, sizeof(Quadric)); + + Q.w = w; + + for (size_t k = 0; k < attribute_count; ++k) { - float a0 = p0.a[k], a1 = p1.a[k], a2 = p2.a[k]; + float a0 = va0[k], a1 = va1[k], a2 = va2[k]; // compute gradient of eval(pos) for x/y/z/w // the formulas below are obtained by directly computing derivative of eval(pos) = a0 * u + a1 * v + a2 * w @@ -705,24 +710,14 @@ static void quadricUpdateAttributes(Quadric& Q, const Vector3& p0, const Vector3 Q.c += w * (gw * gw); // the only remaining sum components are ones that depend on attr; these will be addded during error evaluation, see quadricError - Q.gx[k] = w * gx; - Q.gy[k] = w * gy; - Q.gz[k] = w * gz; - Q.gw[k] = w * gw; - -#if TRACE > 2 - printf("attr%d: %e %e %e\n", - k, - (gx * p0.x + gy * p0.y + gz * p0.z + gw - a0), - (gx * p1.x + gy * p1.y + gz * p1.z + gw - a1), - (gx * p2.x + gy * p2.y + gz * p2.z + gw - a2) - ); -#endif + G[k].gx = w * gx; + G[k].gy = w * gy; + G[k].gz = w * gz; + G[k].gw = w * gw; } } -#endif -static void fillFaceQuadrics(Quadric* vertex_quadrics, Quadric* vertex_no_attrib_quadrics, const unsigned int* indices, size_t index_count, const Vector3* vertex_positions, const unsigned int* remap) +static void fillFaceQuadrics(Quadric* vertex_quadrics, const unsigned int* indices, size_t index_count, const Vector3* vertex_positions, const unsigned int* remap) { for (size_t i = 0; i < index_count; i += 3) { @@ -732,24 +727,18 @@ static void fillFaceQuadrics(Quadric* vertex_quadrics, Quadric* vertex_no_attrib Quadric Q; quadricFromTriangle(Q, vertex_positions[i0], vertex_positions[i1], vertex_positions[i2], 1.f); - quadricAdd(vertex_no_attrib_quadrics[remap[i0]], Q); - quadricAdd(vertex_no_attrib_quadrics[remap[i1]], Q); - quadricAdd(vertex_no_attrib_quadrics[remap[i2]], Q); -#if ATTRIBUTES - quadricUpdateAttributes(Q, vertex_positions[i0], vertex_positions[i1], vertex_positions[i2], Q.w); -#endif quadricAdd(vertex_quadrics[remap[i0]], Q); quadricAdd(vertex_quadrics[remap[i1]], Q); quadricAdd(vertex_quadrics[remap[i2]], Q); } } -static void fillEdgeQuadrics(Quadric* vertex_quadrics, Quadric* vertex_no_attrib_quadrics, const unsigned int* indices, size_t index_count, const Vector3* vertex_positions, const unsigned int* remap, const unsigned char* vertex_kind, const unsigned int* loop, const unsigned int* loopback) +static void fillEdgeQuadrics(Quadric* vertex_quadrics, const unsigned int* indices, size_t index_count, const Vector3* vertex_positions, const unsigned int* remap, const unsigned char* vertex_kind, const unsigned int* loop, const unsigned int* loopback) { for (size_t i = 0; i < index_count; i += 3) { - static const int next[3] = {1, 2, 0}; + static const int next[4] = {1, 2, 0, 1}; for (int e = 0; e < 3; ++e) { @@ -775,7 +764,7 @@ static void fillEdgeQuadrics(Quadric* vertex_quadrics, Quadric* vertex_no_attrib if (kHasOpposite[k0][k1] && remap[i1] > remap[i0]) continue; - unsigned int i2 = indices[i + next[next[e]]]; + unsigned int i2 = indices[i + next[e + 1]]; // we try hard to maintain border edge geometry; seam edges can move more freely // due to topological restrictions on collapses, seam quadrics slightly improves collapse structure but aren't critical @@ -789,13 +778,33 @@ static void fillEdgeQuadrics(Quadric* vertex_quadrics, Quadric* vertex_no_attrib quadricAdd(vertex_quadrics[remap[i0]], Q); quadricAdd(vertex_quadrics[remap[i1]], Q); - - quadricAdd(vertex_no_attrib_quadrics[remap[i0]], Q); - quadricAdd(vertex_no_attrib_quadrics[remap[i1]], Q); } } } +static void fillAttributeQuadrics(Quadric* attribute_quadrics, QuadricGrad* attribute_gradients, const unsigned int* indices, size_t index_count, const Vector3* vertex_positions, const float* vertex_attributes, size_t attribute_count, const unsigned int* remap) +{ + for (size_t i = 0; i < index_count; i += 3) + { + unsigned int i0 = indices[i + 0]; + unsigned int i1 = indices[i + 1]; + unsigned int i2 = indices[i + 2]; + + Quadric QA; + QuadricGrad G[kMaxAttributes]; + quadricFromAttributes(QA, G, vertex_positions[i0], vertex_positions[i1], vertex_positions[i2], &vertex_attributes[i0 * attribute_count], &vertex_attributes[i1 * attribute_count], &vertex_attributes[i2 * attribute_count], attribute_count); + + // TODO: This blends together attribute weights across attribute discontinuities, which is probably not a great idea + quadricAdd(attribute_quadrics[remap[i0]], QA); + quadricAdd(attribute_quadrics[remap[i1]], QA); + quadricAdd(attribute_quadrics[remap[i2]], QA); + + quadricAdd(&attribute_gradients[remap[i0] * attribute_count], G, attribute_count); + quadricAdd(&attribute_gradients[remap[i1] * attribute_count], G, attribute_count); + quadricAdd(&attribute_gradients[remap[i2] * attribute_count], G, attribute_count); + } +} + // does triangle ABC flip when C is replaced with D? static bool hasTriangleFlip(const Vector3& a, const Vector3& b, const Vector3& c, const Vector3& d) { @@ -806,7 +815,7 @@ static bool hasTriangleFlip(const Vector3& a, const Vector3& b, const Vector3& c Vector3 nbc = {eb.y * ec.z - eb.z * ec.y, eb.z * ec.x - eb.x * ec.z, eb.x * ec.y - eb.y * ec.x}; Vector3 nbd = {eb.y * ed.z - eb.z * ed.y, eb.z * ed.x - eb.x * ed.z, eb.x * ed.y - eb.y * ed.x}; - return nbc.x * nbd.x + nbc.y * nbd.y + nbc.z * nbd.z < 0; + return nbc.x * nbd.x + nbc.y * nbd.y + nbc.z * nbd.z <= 0; } static bool hasTriangleFlips(const EdgeAdjacency& adjacency, const Vector3* vertex_positions, const unsigned int* collapse_remap, unsigned int i0, unsigned int i1) @@ -818,16 +827,15 @@ static bool hasTriangleFlips(const EdgeAdjacency& adjacency, const Vector3* vert const Vector3& v1 = vertex_positions[i1]; const EdgeAdjacency::Edge* edges = &adjacency.data[adjacency.offsets[i0]]; - size_t count = adjacency.counts[i0]; + size_t count = adjacency.offsets[i0 + 1] - adjacency.offsets[i0]; for (size_t i = 0; i < count; ++i) { unsigned int a = collapse_remap[edges[i].next]; unsigned int b = collapse_remap[edges[i].prev]; - // skip triangles that get collapsed - // note: this is mathematically redundant as if either of these is true, the dot product in hasTriangleFlip should be 0 - if (a == i1 || b == i1) + // skip triangles that will get collapsed by i0->i1 collapse or already got collapsed previously + if (a == i1 || b == i1 || a == b) continue; // early-out when at least one triangle flips due to a collapse @@ -838,7 +846,25 @@ static bool hasTriangleFlips(const EdgeAdjacency& adjacency, const Vector3* vert return false; } -static size_t pickEdgeCollapses(Collapse* collapses, const unsigned int* indices, size_t index_count, const unsigned int* remap, const unsigned char* vertex_kind, const unsigned int* loop) +static size_t boundEdgeCollapses(const EdgeAdjacency& adjacency, size_t vertex_count, size_t index_count, unsigned char* vertex_kind) +{ + size_t dual_count = 0; + + for (size_t i = 0; i < vertex_count; ++i) + { + unsigned char k = vertex_kind[i]; + unsigned int e = adjacency.offsets[i + 1] - adjacency.offsets[i]; + + dual_count += (k == Kind_Manifold || k == Kind_Seam) ? e : 0; + } + + assert(dual_count <= index_count); + + // pad capacity by 3 so that we can check for overflow once per triangle instead of once per edge + return (index_count - dual_count / 2) + 3; +} + +static size_t pickEdgeCollapses(Collapse* collapses, size_t collapse_capacity, const unsigned int* indices, size_t index_count, const unsigned int* remap, const unsigned char* vertex_kind, const unsigned int* loop) { size_t collapse_count = 0; @@ -846,6 +872,10 @@ static size_t pickEdgeCollapses(Collapse* collapses, const unsigned int* indices { static const int next[3] = {1, 2, 0}; + // this should never happen as boundEdgeCollapses should give an upper bound for the collapse count, but in an unlikely event it does we can just drop extra collapses + if (collapse_count + 3 > collapse_capacity) + break; + for (int e = 0; e < 3; ++e) { unsigned int i0 = indices[i + e]; @@ -896,7 +926,7 @@ static size_t pickEdgeCollapses(Collapse* collapses, const unsigned int* indices return collapse_count; } -static void rankEdgeCollapses(Collapse* collapses, size_t collapse_count, const Vector3* vertex_positions, const Quadric* vertex_quadrics, const Quadric* vertex_no_attrib_quadrics, const unsigned int* remap) +static void rankEdgeCollapses(Collapse* collapses, size_t collapse_count, const Vector3* vertex_positions, const float* vertex_attributes, const Quadric* vertex_quadrics, const Quadric* attribute_quadrics, const QuadricGrad* attribute_gradients, size_t attribute_count, const unsigned int* remap) { for (size_t i = 0; i < collapse_count; ++i) { @@ -910,78 +940,25 @@ static void rankEdgeCollapses(Collapse* collapses, size_t collapse_count, const unsigned int j0 = c.bidi ? i1 : i0; unsigned int j1 = c.bidi ? i0 : i1; - const Quadric& qi = vertex_quadrics[remap[i0]]; - const Quadric& qj = vertex_quadrics[remap[j0]]; + float ei = quadricError(vertex_quadrics[remap[i0]], vertex_positions[i1]); + float ej = quadricError(vertex_quadrics[remap[j0]], vertex_positions[j1]); - float ei = quadricError(qi, vertex_positions[i1]); - float ej = quadricError(qj, vertex_positions[j1]); + float dei = ei, dej = ej; - const Quadric& naqi = vertex_no_attrib_quadrics[remap[i0]]; - const Quadric& naqj = vertex_no_attrib_quadrics[remap[j0]]; + if (attribute_count) + { + ei += quadricError(attribute_quadrics[remap[i0]], &attribute_gradients[remap[i0] * attribute_count], attribute_count, vertex_positions[i1], &vertex_attributes[i1 * attribute_count]); + ej += quadricError(attribute_quadrics[remap[j0]], &attribute_gradients[remap[j0] * attribute_count], attribute_count, vertex_positions[j1], &vertex_attributes[j1 * attribute_count]); + } // pick edge direction with minimal error c.v0 = ei <= ej ? i0 : j0; c.v1 = ei <= ej ? i1 : j1; c.error = ei <= ej ? ei : ej; - c.distance_error = ei <= ej ? quadricErrorNoAttributes(naqi, vertex_positions[i1]) : quadricErrorNoAttributes(naqj, vertex_positions[j1]); + c.distance_error = ei <= ej ? dei : dej; } } -#if TRACE > 1 -static void dumpEdgeCollapses(const Collapse* collapses, size_t collapse_count, const unsigned char* vertex_kind) -{ - size_t ckinds[Kind_Count][Kind_Count] = {}; - float cerrors[Kind_Count][Kind_Count] = {}; - - for (int k0 = 0; k0 < Kind_Count; ++k0) - for (int k1 = 0; k1 < Kind_Count; ++k1) - cerrors[k0][k1] = FLT_MAX; - - for (size_t i = 0; i < collapse_count; ++i) - { - unsigned int i0 = collapses[i].v0; - unsigned int i1 = collapses[i].v1; - - unsigned char k0 = vertex_kind[i0]; - unsigned char k1 = vertex_kind[i1]; - - ckinds[k0][k1]++; - cerrors[k0][k1] = (collapses[i].error < cerrors[k0][k1]) ? collapses[i].error : cerrors[k0][k1]; - } - - for (int k0 = 0; k0 < Kind_Count; ++k0) - for (int k1 = 0; k1 < Kind_Count; ++k1) - if (ckinds[k0][k1]) - printf("collapses %d -> %d: %d, min error %e\n", k0, k1, int(ckinds[k0][k1]), ckinds[k0][k1] ? sqrtf(cerrors[k0][k1]) : 0.f); -} - -static void dumpLockedCollapses(const unsigned int* indices, size_t index_count, const unsigned char* vertex_kind) -{ - size_t locked_collapses[Kind_Count][Kind_Count] = {}; - - for (size_t i = 0; i < index_count; i += 3) - { - static const int next[3] = {1, 2, 0}; - - for (int e = 0; e < 3; ++e) - { - unsigned int i0 = indices[i + e]; - unsigned int i1 = indices[i + next[e]]; - - unsigned char k0 = vertex_kind[i0]; - unsigned char k1 = vertex_kind[i1]; - - locked_collapses[k0][k1] += !kCanCollapse[k0][k1] && !kCanCollapse[k1][k0]; - } - } - - for (int k0 = 0; k0 < Kind_Count; ++k0) - for (int k1 = 0; k1 < Kind_Count; ++k1) - if (locked_collapses[k0][k1]) - printf("locked collapses %d -> %d: %d\n", k0, k1, int(locked_collapses[k0][k1])); -} -#endif - static void sortEdgeCollapses(unsigned int* sort_order, const Collapse* collapses, size_t collapse_count) { const int sort_bits = 11; @@ -1020,7 +997,7 @@ static void sortEdgeCollapses(unsigned int* sort_order, const Collapse* collapse } } -static size_t performEdgeCollapses(unsigned int* collapse_remap, unsigned char* collapse_locked, Quadric* vertex_quadrics, Quadric* vertex_no_attrib_quadrics, const Collapse* collapses, size_t collapse_count, const unsigned int* collapse_order, const unsigned int* remap, const unsigned int* wedge, const unsigned char* vertex_kind, const Vector3* vertex_positions, const EdgeAdjacency& adjacency, size_t triangle_collapse_goal, float error_limit, float& result_error) +static size_t performEdgeCollapses(unsigned int* collapse_remap, unsigned char* collapse_locked, Quadric* vertex_quadrics, Quadric* attribute_quadrics, QuadricGrad* attribute_gradients, size_t attribute_count, const Collapse* collapses, size_t collapse_count, const unsigned int* collapse_order, const unsigned int* remap, const unsigned int* wedge, const unsigned char* vertex_kind, const Vector3* vertex_positions, const EdgeAdjacency& adjacency, size_t triangle_collapse_goal, float error_limit, float& result_error) { size_t edge_collapses = 0; size_t triangle_collapses = 0; @@ -1082,7 +1059,12 @@ static size_t performEdgeCollapses(unsigned int* collapse_remap, unsigned char* assert(collapse_remap[r1] == r1); quadricAdd(vertex_quadrics[r1], vertex_quadrics[r0]); - quadricAdd(vertex_no_attrib_quadrics[r1], vertex_no_attrib_quadrics[r0]); + + if (attribute_count) + { + quadricAdd(attribute_quadrics[r1], attribute_quadrics[r0]); + quadricAdd(&attribute_gradients[r1 * attribute_count], &attribute_gradients[r0 * attribute_count], attribute_count); + } if (vertex_kind[i0] == Kind_Complex) { @@ -1346,17 +1328,41 @@ static void fillCellQuadrics(Quadric* cell_quadrics, const unsigned int* indices } } -static void fillCellQuadrics(Quadric* cell_quadrics, const Vector3* vertex_positions, size_t vertex_count, const unsigned int* vertex_cells) +static void fillCellReservoirs(Reservoir* cell_reservoirs, size_t cell_count, const Vector3* vertex_positions, const float* vertex_colors, size_t vertex_colors_stride, size_t vertex_count, const unsigned int* vertex_cells) { + static const float dummy_color[] = { 0.f, 0.f, 0.f }; + + size_t vertex_colors_stride_float = vertex_colors_stride / sizeof(float); + for (size_t i = 0; i < vertex_count; ++i) { - unsigned int c = vertex_cells[i]; + unsigned int cell = vertex_cells[i]; const Vector3& v = vertex_positions[i]; + Reservoir& r = cell_reservoirs[cell]; - Quadric Q; - quadricFromPoint(Q, v.x, v.y, v.z, 1.f); + const float* color = vertex_colors ? &vertex_colors[i * vertex_colors_stride_float] : dummy_color; + + r.x += v.x; + r.y += v.y; + r.z += v.z; + r.r += color[0]; + r.g += color[1]; + r.b += color[2]; + r.w += 1.f; + } + + for (size_t i = 0; i < cell_count; ++i) + { + Reservoir& r = cell_reservoirs[i]; - quadricAdd(cell_quadrics[c], Q); + float iw = r.w == 0.f ? 0.f : 1.f / r.w; + + r.x *= iw; + r.y *= iw; + r.z *= iw; + r.r *= iw; + r.g *= iw; + r.b *= iw; } } @@ -1377,6 +1383,34 @@ static void fillCellRemap(unsigned int* cell_remap, float* cell_errors, size_t c } } +static void fillCellRemap(unsigned int* cell_remap, float* cell_errors, size_t cell_count, const unsigned int* vertex_cells, const Reservoir* cell_reservoirs, const Vector3* vertex_positions, const float* vertex_colors, size_t vertex_colors_stride, float color_weight, size_t vertex_count) +{ + static const float dummy_color[] = { 0.f, 0.f, 0.f }; + + size_t vertex_colors_stride_float = vertex_colors_stride / sizeof(float); + + memset(cell_remap, -1, cell_count * sizeof(unsigned int)); + + for (size_t i = 0; i < vertex_count; ++i) + { + unsigned int cell = vertex_cells[i]; + const Vector3& v = vertex_positions[i]; + const Reservoir& r = cell_reservoirs[cell]; + + const float* color = vertex_colors ? &vertex_colors[i * vertex_colors_stride_float] : dummy_color; + + float pos_error = (v.x - r.x) * (v.x - r.x) + (v.y - r.y) * (v.y - r.y) + (v.z - r.z) * (v.z - r.z); + float col_error = (color[0] - r.r) * (color[0] - r.r) + (color[1] - r.g) * (color[1] - r.g) + (color[2] - r.b) * (color[2] - r.b); + float error = pos_error + color_weight * col_error; + + if (cell_remap[cell] == ~0u || cell_errors[cell] > error) + { + cell_remap[cell] = unsigned(i); + cell_errors[cell] = error; + } + } +} + static size_t filterTriangles(unsigned int* destination, unsigned int* tritable, size_t tritable_size, const unsigned int* indices, size_t index_count, const unsigned int* vertex_cells, const unsigned int* cell_remap) { TriangleHasher hasher = {destination}; @@ -1434,26 +1468,23 @@ static float interpolate(float y, float x0, float y0, float x1, float y1, float #ifndef NDEBUG // Note: this is only exposed for debug visualization purposes; do *not* use these in debug builds -MESHOPTIMIZER_API unsigned char* meshopt_simplifyDebugKind = 0; -MESHOPTIMIZER_API unsigned int* meshopt_simplifyDebugLoop = 0; -MESHOPTIMIZER_API unsigned int* meshopt_simplifyDebugLoopBack = 0; +MESHOPTIMIZER_API unsigned char* meshopt_simplifyDebugKind = NULL; +MESHOPTIMIZER_API unsigned int* meshopt_simplifyDebugLoop = NULL; +MESHOPTIMIZER_API unsigned int* meshopt_simplifyDebugLoopBack = NULL; #endif -size_t meshopt_simplify(unsigned int* destination, const unsigned int* indices, size_t index_count, const float* vertex_positions_data, size_t vertex_count, size_t vertex_positions_stride, size_t target_index_count, float target_error, unsigned int options, float* out_result_error) -{ - return meshopt_simplifyWithAttributes(destination, indices, index_count, vertex_positions_data, vertex_count, vertex_positions_stride, target_index_count, target_error, options, out_result_error, 0, 0, 0); -} - -size_t meshopt_simplifyWithAttributes(unsigned int* destination, const unsigned int* indices, size_t index_count, const float* vertex_data, size_t vertex_count, size_t vertex_stride, size_t target_index_count, float target_error, unsigned int options, float* out_result_error, const float* attributes, const float* attribute_weights, size_t attribute_count) +size_t meshopt_simplifyEdge(unsigned int* destination, const unsigned int* indices, size_t index_count, const float* vertex_positions_data, size_t vertex_count, size_t vertex_positions_stride, const float* vertex_attributes_data, size_t vertex_attributes_stride, const float* attribute_weights, size_t attribute_count, size_t target_index_count, float target_error, unsigned int options, float* out_result_error) { using namespace meshopt; assert(index_count % 3 == 0); - assert(vertex_stride >= 12 && vertex_stride <= 256); - assert(vertex_stride % sizeof(float) == 0); + assert(vertex_positions_stride >= 12 && vertex_positions_stride <= 256); + assert(vertex_positions_stride % sizeof(float) == 0); assert(target_index_count <= index_count); assert((options & ~(meshopt_SimplifyLockBorder)) == 0); - assert(attribute_count <= ATTRIBUTES); + assert(vertex_attributes_stride >= attribute_count * sizeof(float) && vertex_attributes_stride <= 256); + assert(vertex_attributes_stride % sizeof(float) == 0); + assert(attribute_count <= kMaxAttributes); meshopt_Allocator allocator; @@ -1467,7 +1498,7 @@ size_t meshopt_simplifyWithAttributes(unsigned int* destination, const unsigned // build position remap that maps each vertex to the one with identical position unsigned int* remap = allocator.allocate<unsigned int>(vertex_count); unsigned int* wedge = allocator.allocate<unsigned int>(vertex_count); - buildPositionRemap(remap, wedge, vertex_data, vertex_count, vertex_stride, allocator); + buildPositionRemap(remap, wedge, vertex_positions_data, vertex_count, vertex_positions_stride, allocator); // classify vertices; vertex kind determines collapse rules, see kCanCollapse unsigned char* vertex_kind = allocator.allocate<unsigned char>(vertex_count); @@ -1491,29 +1522,36 @@ size_t meshopt_simplifyWithAttributes(unsigned int* destination, const unsigned #endif Vector3* vertex_positions = allocator.allocate<Vector3>(vertex_count); - rescalePositions(vertex_positions, vertex_data, vertex_count, vertex_stride); - -#if ATTRIBUTES - for (size_t i = 0; i < vertex_count; ++i) - { - memset(vertex_positions[i].a, 0, sizeof(vertex_positions[i].a)); + rescalePositions(vertex_positions, vertex_positions_data, vertex_count, vertex_positions_stride); - for (size_t k = 0; k < attribute_count; ++k) - { - float a = attributes[i * attribute_count + k]; + float* vertex_attributes = NULL; - vertex_positions[i].a[k] = a * attribute_weights[k]; - } + if (attribute_count) + { + vertex_attributes = allocator.allocate<float>(vertex_count * attribute_count); + rescaleAttributes(vertex_attributes, vertex_attributes_data, vertex_count, vertex_attributes_stride, attribute_weights, attribute_count); } -#endif Quadric* vertex_quadrics = allocator.allocate<Quadric>(vertex_count); memset(vertex_quadrics, 0, vertex_count * sizeof(Quadric)); - Quadric* vertex_no_attrib_quadrics = allocator.allocate<Quadric>(vertex_count); - memset(vertex_no_attrib_quadrics, 0, vertex_count * sizeof(Quadric)); - fillFaceQuadrics(vertex_quadrics, vertex_no_attrib_quadrics, indices, index_count, vertex_positions, remap); - fillEdgeQuadrics(vertex_quadrics, vertex_no_attrib_quadrics, indices, index_count, vertex_positions, remap, vertex_kind, loop, loopback); + Quadric* attribute_quadrics = NULL; + QuadricGrad* attribute_gradients = NULL; + + if (attribute_count) + { + attribute_quadrics = allocator.allocate<Quadric>(vertex_count); + memset(attribute_quadrics, 0, vertex_count * sizeof(Quadric)); + + attribute_gradients = allocator.allocate<QuadricGrad>(vertex_count * attribute_count); + memset(attribute_gradients, 0, vertex_count * attribute_count * sizeof(QuadricGrad)); + } + + fillFaceQuadrics(vertex_quadrics, indices, index_count, vertex_positions, remap); + fillEdgeQuadrics(vertex_quadrics, indices, index_count, vertex_positions, remap, vertex_kind, loop, loopback); + + if (attribute_count) + fillAttributeQuadrics(attribute_quadrics, attribute_gradients, indices, index_count, vertex_positions, vertex_attributes, attribute_count, remap); if (result != indices) memcpy(result, indices, index_count * sizeof(unsigned int)); @@ -1522,8 +1560,10 @@ size_t meshopt_simplifyWithAttributes(unsigned int* destination, const unsigned size_t pass_count = 0; #endif - Collapse* edge_collapses = allocator.allocate<Collapse>(index_count); - unsigned int* collapse_order = allocator.allocate<unsigned int>(index_count); + size_t collapse_capacity = boundEdgeCollapses(adjacency, vertex_count, index_count, vertex_kind); + + Collapse* edge_collapses = allocator.allocate<Collapse>(collapse_capacity); + unsigned int* collapse_order = allocator.allocate<unsigned int>(collapse_capacity); unsigned int* collapse_remap = allocator.allocate<unsigned int>(vertex_count); unsigned char* collapse_locked = allocator.allocate<unsigned char>(vertex_count); @@ -1538,17 +1578,14 @@ size_t meshopt_simplifyWithAttributes(unsigned int* destination, const unsigned // note: throughout the simplification process adjacency structure reflects welded topology for result-in-progress updateEdgeAdjacency(adjacency, result, result_count, vertex_count, remap); - size_t edge_collapse_count = pickEdgeCollapses(edge_collapses, result, result_count, remap, vertex_kind, loop); + size_t edge_collapse_count = pickEdgeCollapses(edge_collapses, collapse_capacity, result, result_count, remap, vertex_kind, loop); + assert(edge_collapse_count <= collapse_capacity); // no edges can be collapsed any more due to topology restrictions if (edge_collapse_count == 0) break; - rankEdgeCollapses(edge_collapses, edge_collapse_count, vertex_positions, vertex_quadrics, vertex_no_attrib_quadrics, remap); - -#if TRACE > 1 - dumpEdgeCollapses(edge_collapses, edge_collapse_count, vertex_kind); -#endif + rankEdgeCollapses(edge_collapses, edge_collapse_count, vertex_positions, vertex_attributes, vertex_quadrics, attribute_quadrics, attribute_gradients, attribute_count, remap); sortEdgeCollapses(collapse_order, edge_collapses, edge_collapse_count); @@ -1563,7 +1600,7 @@ size_t meshopt_simplifyWithAttributes(unsigned int* destination, const unsigned printf("pass %d: ", int(pass_count++)); #endif - size_t collapses = performEdgeCollapses(collapse_remap, collapse_locked, vertex_quadrics, vertex_no_attrib_quadrics, edge_collapses, edge_collapse_count, collapse_order, remap, wedge, vertex_kind, vertex_positions, adjacency, triangle_collapse_goal, error_limit, result_error); + size_t collapses = performEdgeCollapses(collapse_remap, collapse_locked, vertex_quadrics, attribute_quadrics, attribute_gradients, attribute_count, edge_collapses, edge_collapse_count, collapse_order, remap, wedge, vertex_kind, vertex_positions, adjacency, triangle_collapse_goal, error_limit, result_error); // no edges can be collapsed any more due to hitting the error limit or triangle collapse limit if (collapses == 0) @@ -1582,10 +1619,6 @@ size_t meshopt_simplifyWithAttributes(unsigned int* destination, const unsigned printf("result: %d triangles, error: %e; total %d passes\n", int(result_count), sqrtf(result_error), int(pass_count)); #endif -#if TRACE > 1 - dumpLockedCollapses(result, result_count, vertex_kind); -#endif - #ifndef NDEBUG if (meshopt_simplifyDebugKind) memcpy(meshopt_simplifyDebugKind, vertex_kind, vertex_count); @@ -1599,13 +1632,21 @@ size_t meshopt_simplifyWithAttributes(unsigned int* destination, const unsigned // result_error is quadratic; we need to remap it back to linear if (out_result_error) - { *out_result_error = sqrtf(result_error); - } return result_count; } +size_t meshopt_simplify(unsigned int* destination, const unsigned int* indices, size_t index_count, const float* vertex_positions_data, size_t vertex_count, size_t vertex_positions_stride, size_t target_index_count, float target_error, unsigned int options, float* out_result_error) +{ + return meshopt_simplifyEdge(destination, indices, index_count, vertex_positions_data, vertex_count, vertex_positions_stride, NULL, 0, NULL, 0, target_index_count, target_error, options, out_result_error); +} + +size_t meshopt_simplifyWithAttributes(unsigned int* destination, const unsigned int* indices, size_t index_count, const float* vertex_positions_data, size_t vertex_count, size_t vertex_positions_stride, const float* vertex_attributes_data, size_t vertex_attributes_stride, const float* attribute_weights, size_t attribute_count, size_t target_index_count, float target_error, unsigned int options, float* out_result_error) +{ + return meshopt_simplifyEdge(destination, indices, index_count, vertex_positions_data, vertex_count, vertex_positions_stride, vertex_attributes_data, vertex_attributes_stride, attribute_weights, attribute_count, target_index_count, target_error, options, out_result_error); +} + size_t meshopt_simplifySloppy(unsigned int* destination, const unsigned int* indices, size_t index_count, const float* vertex_positions_data, size_t vertex_count, size_t vertex_positions_stride, size_t target_index_count, float target_error, float* out_result_error) { using namespace meshopt; @@ -1738,12 +1779,15 @@ size_t meshopt_simplifySloppy(unsigned int* destination, const unsigned int* ind return write; } -size_t meshopt_simplifyPoints(unsigned int* destination, const float* vertex_positions_data, size_t vertex_count, size_t vertex_positions_stride, size_t target_vertex_count) +size_t meshopt_simplifyPoints(unsigned int* destination, const float* vertex_positions_data, size_t vertex_count, size_t vertex_positions_stride, const float* vertex_colors, size_t vertex_colors_stride, float color_weight, size_t target_vertex_count) { using namespace meshopt; assert(vertex_positions_stride >= 12 && vertex_positions_stride <= 256); assert(vertex_positions_stride % sizeof(float) == 0); + assert(vertex_colors_stride == 0 || (vertex_colors_stride >= 12 && vertex_colors_stride <= 256)); + assert(vertex_colors_stride % sizeof(float) == 0); + assert(vertex_colors == NULL || vertex_colors_stride != 0); assert(target_vertex_count <= vertex_count); size_t target_cell_count = target_vertex_count; @@ -1827,24 +1871,30 @@ size_t meshopt_simplifyPoints(unsigned int* destination, const float* vertex_pos computeVertexIds(vertex_ids, vertex_positions, vertex_count, min_grid); size_t cell_count = fillVertexCells(table, table_size, vertex_cells, vertex_ids, vertex_count); - // build a quadric for each target cell - Quadric* cell_quadrics = allocator.allocate<Quadric>(cell_count); - memset(cell_quadrics, 0, cell_count * sizeof(Quadric)); + // accumulate points into a reservoir for each target cell + Reservoir* cell_reservoirs = allocator.allocate<Reservoir>(cell_count); + memset(cell_reservoirs, 0, cell_count * sizeof(Reservoir)); - fillCellQuadrics(cell_quadrics, vertex_positions, vertex_count, vertex_cells); + fillCellReservoirs(cell_reservoirs, cell_count, vertex_positions, vertex_colors, vertex_colors_stride, vertex_count, vertex_cells); // for each target cell, find the vertex with the minimal error unsigned int* cell_remap = allocator.allocate<unsigned int>(cell_count); float* cell_errors = allocator.allocate<float>(cell_count); - fillCellRemap(cell_remap, cell_errors, cell_count, vertex_cells, cell_quadrics, vertex_positions, vertex_count); + fillCellRemap(cell_remap, cell_errors, cell_count, vertex_cells, cell_reservoirs, vertex_positions, vertex_colors, vertex_colors_stride, color_weight * color_weight, vertex_count); // copy results to the output assert(cell_count <= target_vertex_count); memcpy(destination, cell_remap, sizeof(unsigned int) * cell_count); #if TRACE - printf("result: %d cells\n", int(cell_count)); + // compute error + float result_error = 0.f; + + for (size_t i = 0; i < cell_count; ++i) + result_error = result_error < cell_errors[i] ? cell_errors[i] : result_error; + + printf("result: %d cells, %e error\n", int(cell_count), sqrtf(result_error)); #endif return cell_count; diff --git a/thirdparty/meshoptimizer/vcacheoptimizer.cpp b/thirdparty/meshoptimizer/vcacheoptimizer.cpp index ce8fd3a887..d4b08ba340 100644 --- a/thirdparty/meshoptimizer/vcacheoptimizer.cpp +++ b/thirdparty/meshoptimizer/vcacheoptimizer.cpp @@ -221,9 +221,9 @@ void meshopt_optimizeVertexCacheTable(unsigned int* destination, const unsigned triangle_scores[i] = vertex_scores[a] + vertex_scores[b] + vertex_scores[c]; } - unsigned int cache_holder[2 * (kCacheSizeMax + 3)]; + unsigned int cache_holder[2 * (kCacheSizeMax + 4)]; unsigned int* cache = cache_holder; - unsigned int* cache_new = cache_holder + kCacheSizeMax + 3; + unsigned int* cache_new = cache_holder + kCacheSizeMax + 4; size_t cache_count = 0; unsigned int current_triangle = 0; @@ -260,10 +260,8 @@ void meshopt_optimizeVertexCacheTable(unsigned int* destination, const unsigned { unsigned int index = cache[i]; - if (index != a && index != b && index != c) - { - cache_new[cache_write++] = index; - } + cache_new[cache_write] = index; + cache_write += (index != a && index != b && index != c); } unsigned int* cache_temp = cache; @@ -305,6 +303,10 @@ void meshopt_optimizeVertexCacheTable(unsigned int* destination, const unsigned { unsigned int index = cache[i]; + // no need to update scores if we are never going to use this vertex + if (adjacency.counts[index] == 0) + continue; + int cache_position = i >= cache_size ? -1 : int(i); // update vertex score @@ -325,11 +327,8 @@ void meshopt_optimizeVertexCacheTable(unsigned int* destination, const unsigned float tri_score = triangle_scores[tri] + score_diff; assert(tri_score > 0); - if (best_score < tri_score) - { - best_triangle = tri; - best_score = tri_score; - } + best_triangle = best_score < tri_score ? tri : best_triangle; + best_score = best_score < tri_score ? tri_score : best_score; triangle_scores[tri] = tri_score; } diff --git a/thirdparty/meshoptimizer/vertexcodec.cpp b/thirdparty/meshoptimizer/vertexcodec.cpp index 4bd11121d2..8ab0662d88 100644 --- a/thirdparty/meshoptimizer/vertexcodec.cpp +++ b/thirdparty/meshoptimizer/vertexcodec.cpp @@ -44,6 +44,10 @@ // When targeting Wasm SIMD we can't use runtime cpuid checks so we unconditionally enable SIMD #if defined(__wasm_simd128__) #define SIMD_WASM +// Prevent compiling other variant when wasm simd compilation is active +#undef SIMD_NEON +#undef SIMD_SSE +#undef SIMD_AVX #endif #ifndef SIMD_TARGET @@ -83,19 +87,17 @@ #endif #ifdef SIMD_WASM -#undef __DEPRECATED -#pragma clang diagnostic ignored "-Wdeprecated-declarations" #include <wasm_simd128.h> #endif #ifdef SIMD_WASM -#define wasmx_splat_v32x4(v, i) wasm_v32x4_shuffle(v, v, i, i, i, i) -#define wasmx_unpacklo_v8x16(a, b) wasm_v8x16_shuffle(a, b, 0, 16, 1, 17, 2, 18, 3, 19, 4, 20, 5, 21, 6, 22, 7, 23) -#define wasmx_unpackhi_v8x16(a, b) wasm_v8x16_shuffle(a, b, 8, 24, 9, 25, 10, 26, 11, 27, 12, 28, 13, 29, 14, 30, 15, 31) -#define wasmx_unpacklo_v16x8(a, b) wasm_v16x8_shuffle(a, b, 0, 8, 1, 9, 2, 10, 3, 11) -#define wasmx_unpackhi_v16x8(a, b) wasm_v16x8_shuffle(a, b, 4, 12, 5, 13, 6, 14, 7, 15) -#define wasmx_unpacklo_v64x2(a, b) wasm_v64x2_shuffle(a, b, 0, 2) -#define wasmx_unpackhi_v64x2(a, b) wasm_v64x2_shuffle(a, b, 1, 3) +#define wasmx_splat_v32x4(v, i) wasm_i32x4_shuffle(v, v, i, i, i, i) +#define wasmx_unpacklo_v8x16(a, b) wasm_i8x16_shuffle(a, b, 0, 16, 1, 17, 2, 18, 3, 19, 4, 20, 5, 21, 6, 22, 7, 23) +#define wasmx_unpackhi_v8x16(a, b) wasm_i8x16_shuffle(a, b, 8, 24, 9, 25, 10, 26, 11, 27, 12, 28, 13, 29, 14, 30, 15, 31) +#define wasmx_unpacklo_v16x8(a, b) wasm_i16x8_shuffle(a, b, 0, 8, 1, 9, 2, 10, 3, 11) +#define wasmx_unpackhi_v16x8(a, b) wasm_i16x8_shuffle(a, b, 4, 12, 5, 13, 6, 14, 7, 15) +#define wasmx_unpacklo_v64x2(a, b) wasm_i64x2_shuffle(a, b, 0, 2) +#define wasmx_unpackhi_v64x2(a, b) wasm_i64x2_shuffle(a, b, 1, 3) #endif namespace meshopt @@ -218,7 +220,7 @@ static unsigned char* encodeBytes(unsigned char* data, unsigned char* data_end, size_t header_size = (buffer_size / kByteGroupSize + 3) / 4; if (size_t(data_end - data) < header_size) - return 0; + return NULL; data += header_size; @@ -227,7 +229,7 @@ static unsigned char* encodeBytes(unsigned char* data, unsigned char* data_end, for (size_t i = 0; i < buffer_size; i += kByteGroupSize) { if (size_t(data_end - data) < kByteGroupDecodeLimit) - return 0; + return NULL; int best_bits = 8; size_t best_size = encodeBytesGroupMeasure(buffer + i, 8); @@ -286,7 +288,7 @@ static unsigned char* encodeVertexBlock(unsigned char* data, unsigned char* data data = encodeBytes(data, data_end, buffer, (vertex_count + kByteGroupSize - 1) & ~(kByteGroupSize - 1)); if (!data) - return 0; + return NULL; } memcpy(last_vertex, &vertex_data[vertex_size * (vertex_count - 1)], vertex_size); @@ -294,7 +296,7 @@ static unsigned char* encodeVertexBlock(unsigned char* data, unsigned char* data return data; } -#if defined(SIMD_FALLBACK) || (!defined(SIMD_SSE) && !defined(SIMD_NEON) && !defined(SIMD_AVX)) +#if defined(SIMD_FALLBACK) || (!defined(SIMD_SSE) && !defined(SIMD_NEON) && !defined(SIMD_AVX) && !defined(SIMD_WASM)) static const unsigned char* decodeBytesGroup(const unsigned char* data, unsigned char* buffer, int bitslog2) { #define READ() byte = *data++ @@ -354,14 +356,14 @@ static const unsigned char* decodeBytes(const unsigned char* data, const unsigne size_t header_size = (buffer_size / kByteGroupSize + 3) / 4; if (size_t(data_end - data) < header_size) - return 0; + return NULL; data += header_size; for (size_t i = 0; i < buffer_size; i += kByteGroupSize) { if (size_t(data_end - data) < kByteGroupDecodeLimit) - return 0; + return NULL; size_t header_offset = i / kByteGroupSize; @@ -386,7 +388,7 @@ static const unsigned char* decodeVertexBlock(const unsigned char* data, const u { data = decodeBytes(data, data_end, buffer, vertex_count_aligned); if (!data) - return 0; + return NULL; size_t vertex_offset = k; @@ -757,7 +759,7 @@ static v128_t decodeShuffleMask(unsigned char mask0, unsigned char mask1) v128_t sm1 = wasm_v128_load(&kDecodeBytesGroupShuffle[mask1]); v128_t sm1off = wasm_v128_load(&kDecodeBytesGroupCount[mask0]); - sm1off = wasm_v8x16_shuffle(sm1off, sm1off, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); + sm1off = wasm_i8x16_shuffle(sm1off, sm1off, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); v128_t sm1r = wasm_i8x16_add(sm1, sm1off); @@ -777,9 +779,6 @@ static void wasmMoveMask(v128_t mask, unsigned char& mask0, unsigned char& mask1 SIMD_TARGET static const unsigned char* decodeBytesGroupSimd(const unsigned char* data, unsigned char* buffer, int bitslog2) { - unsigned char byte, enc, encv; - const unsigned char* data_var; - switch (bitslog2) { case 0: @@ -807,7 +806,7 @@ static const unsigned char* decodeBytesGroupSimd(const unsigned char* data, unsi v128_t shuf = decodeShuffleMask(mask0, mask1); - v128_t result = wasm_v128_bitselect(wasm_v8x16_swizzle(rest, shuf), sel, mask); + v128_t result = wasm_v128_bitselect(wasm_i8x16_swizzle(rest, shuf), sel, mask); wasm_v128_store(buffer, result); @@ -829,7 +828,7 @@ static const unsigned char* decodeBytesGroupSimd(const unsigned char* data, unsi v128_t shuf = decodeShuffleMask(mask0, mask1); - v128_t result = wasm_v128_bitselect(wasm_v8x16_swizzle(rest, shuf), sel, mask); + v128_t result = wasm_v128_bitselect(wasm_i8x16_swizzle(rest, shuf), sel, mask); wasm_v128_store(buffer, result); @@ -939,7 +938,7 @@ static const unsigned char* decodeBytesSimd(const unsigned char* data, const uns size_t header_size = (buffer_size / kByteGroupSize + 3) / 4; if (size_t(data_end - data) < header_size) - return 0; + return NULL; data += header_size; @@ -961,7 +960,7 @@ static const unsigned char* decodeBytesSimd(const unsigned char* data, const uns for (; i < buffer_size; i += kByteGroupSize) { if (size_t(data_end - data) < kByteGroupDecodeLimit) - return 0; + return NULL; size_t header_offset = i / kByteGroupSize; @@ -989,7 +988,7 @@ static const unsigned char* decodeVertexBlockSimd(const unsigned char* data, con { data = decodeBytesSimd(data, data_end, buffer + j * vertex_count_aligned, vertex_count_aligned); if (!data) - return 0; + return NULL; } #if defined(SIMD_SSE) || defined(SIMD_AVX) @@ -1183,7 +1182,7 @@ int meshopt_decodeVertexBuffer(void* destination, size_t vertex_count, size_t ve assert(vertex_size > 0 && vertex_size <= 256); assert(vertex_size % 4 == 0); - const unsigned char* (*decode)(const unsigned char*, const unsigned char*, unsigned char*, size_t, size_t, unsigned char[256]) = 0; + const unsigned char* (*decode)(const unsigned char*, const unsigned char*, unsigned char*, size_t, size_t, unsigned char[256]) = NULL; #if defined(SIMD_SSE) && defined(SIMD_FALLBACK) decode = (cpuid & (1 << 9)) ? decodeVertexBlockSimd : decodeVertexBlock; diff --git a/thirdparty/meshoptimizer/vertexfilter.cpp b/thirdparty/meshoptimizer/vertexfilter.cpp index 14a73b1ddd..4b5f444f04 100644 --- a/thirdparty/meshoptimizer/vertexfilter.cpp +++ b/thirdparty/meshoptimizer/vertexfilter.cpp @@ -30,6 +30,9 @@ // When targeting Wasm SIMD we can't use runtime cpuid checks so we unconditionally enable SIMD #if defined(__wasm_simd128__) #define SIMD_WASM +// Prevent compiling other variant when wasm simd compilation is active +#undef SIMD_NEON +#undef SIMD_SSE #endif #endif // !MESHOPTIMIZER_NO_SIMD @@ -63,6 +66,10 @@ #define wasmx_unziphi_v32x4(a, b) wasm_v32x4_shuffle(a, b, 1, 3, 5, 7) #endif +#ifndef __has_builtin +#define __has_builtin(x) 0 +#endif + namespace meshopt { @@ -185,9 +192,7 @@ inline uint64_t rotateleft64(uint64_t v, int x) { #if defined(_MSC_VER) && !defined(__clang__) return _rotl64(v, x); -// Apple's Clang 8 is actually vanilla Clang 3.9, there we need to look for -// version 11 instead: https://en.wikipedia.org/wiki/Xcode#Toolchain_versions -#elif defined(__clang__) && ((!defined(__apple_build_version__) && __clang_major__ >= 8) || __clang_major__ >= 11) +#elif defined(__clang__) && __has_builtin(__builtin_rotateleft64) return __builtin_rotateleft64(v, x); #else return (v << (x & 63)) | (v >> ((64 - x) & 63)); @@ -791,6 +796,33 @@ static void decodeFilterExpSimd(unsigned int* data, size_t count) } #endif +// optimized variant of frexp +inline int optlog2(float v) +{ + union + { + float f; + unsigned int ui; + } u; + + u.f = v; + // +1 accounts for implicit 1. in mantissa; denormalized numbers will end up clamped to min_exp by calling code + return u.ui == 0 ? 0 : int((u.ui >> 23) & 0xff) - 127 + 1; +} + +// optimized variant of ldexp +inline float optexp2(int e) +{ + union + { + float f; + unsigned int ui; + } u; + + u.ui = unsigned(e + 127) << 23; + return u.f; +} + } // namespace meshopt void meshopt_decodeFilterOct(void* buffer, size_t count, size_t stride) @@ -918,39 +950,78 @@ void meshopt_encodeFilterQuat(void* destination_, size_t count, size_t stride, i } } -void meshopt_encodeFilterExp(void* destination_, size_t count, size_t stride, int bits, const float* data) +void meshopt_encodeFilterExp(void* destination_, size_t count, size_t stride, int bits, const float* data, enum meshopt_EncodeExpMode mode) { - assert(stride > 0 && stride % 4 == 0); + using namespace meshopt; + + assert(stride > 0 && stride % 4 == 0 && stride <= 256); assert(bits >= 1 && bits <= 24); unsigned int* destination = static_cast<unsigned int*>(destination_); size_t stride_float = stride / sizeof(float); + int component_exp[64]; + assert(stride_float <= sizeof(component_exp) / sizeof(int)); + + const int min_exp = -100; + + if (mode == meshopt_EncodeExpSharedComponent) + { + for (size_t j = 0; j < stride_float; ++j) + component_exp[j] = min_exp; + + for (size_t i = 0; i < count; ++i) + { + const float* v = &data[i * stride_float]; + + // use maximum exponent to encode values; this guarantees that mantissa is [-1, 1] + for (size_t j = 0; j < stride_float; ++j) + { + int e = optlog2(v[j]); + + component_exp[j] = (component_exp[j] < e) ? e : component_exp[j]; + } + } + } + for (size_t i = 0; i < count; ++i) { const float* v = &data[i * stride_float]; unsigned int* d = &destination[i * stride_float]; - // use maximum exponent to encode values; this guarantees that mantissa is [-1, 1] - int exp = -100; + int vector_exp = min_exp; - for (size_t j = 0; j < stride_float; ++j) + if (mode == meshopt_EncodeExpSharedVector) { - int e; - frexp(v[j], &e); + // use maximum exponent to encode values; this guarantees that mantissa is [-1, 1] + for (size_t j = 0; j < stride_float; ++j) + { + int e = optlog2(v[j]); - exp = (exp < e) ? e : exp; + vector_exp = (vector_exp < e) ? e : vector_exp; + } } + else if (mode == meshopt_EncodeExpSeparate) + { + for (size_t j = 0; j < stride_float; ++j) + { + int e = optlog2(v[j]); - // note that we additionally scale the mantissa to make it a K-bit signed integer (K-1 bits for magnitude) - exp -= (bits - 1); - - // compute renormalized rounded mantissa for each component - int mmask = (1 << 24) - 1; + component_exp[j] = (min_exp < e) ? e : min_exp; + } + } for (size_t j = 0; j < stride_float; ++j) { - int m = int(ldexp(v[j], -exp) + (v[j] >= 0 ? 0.5f : -0.5f)); + int exp = (mode == meshopt_EncodeExpSharedVector) ? vector_exp : component_exp[j]; + + // note that we additionally scale the mantissa to make it a K-bit signed integer (K-1 bits for magnitude) + exp -= (bits - 1); + + // compute renormalized rounded mantissa for each component + int mmask = (1 << 24) - 1; + + int m = int(v[j] * optexp2(-exp) + (v[j] >= 0 ? 0.5f : -0.5f)); d[j] = (m & mmask) | (unsigned(exp) << 24); } diff --git a/thirdparty/mingw-std-threads/LICENSE b/thirdparty/mingw-std-threads/LICENSE new file mode 100644 index 0000000000..ac525cf203 --- /dev/null +++ b/thirdparty/mingw-std-threads/LICENSE @@ -0,0 +1,24 @@ +Copyright (c) 2016, Mega Limited +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/thirdparty/mingw-std-threads/godot.patch b/thirdparty/mingw-std-threads/godot.patch new file mode 100644 index 0000000000..9d772a2e53 --- /dev/null +++ b/thirdparty/mingw-std-threads/godot.patch @@ -0,0 +1,189 @@ +diff --git a/thirdparty/mingw-std-threads/mingw.condition_variable.h b/thirdparty/mingw-std-threads/mingw.condition_variable.h +index 50c5ebd6df..d099fad2ec 100644 +--- a/thirdparty/mingw-std-threads/mingw.condition_variable.h ++++ b/thirdparty/mingw-std-threads/mingw.condition_variable.h +@@ -58,7 +58,7 @@ + + namespace mingw_stdthread + { +-#if defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) ++#if defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) && !defined(__clang__) + enum class cv_status { no_timeout, timeout }; + #else + using std::cv_status; +@@ -87,12 +87,12 @@ public: + : mSemaphore(CreateSemaphoreA(NULL, 0, 0xFFFF, NULL)) + { + if (mSemaphore == NULL) +- throw std::system_error(GetLastError(), std::generic_category()); ++ __builtin_trap(); + mWakeEvent = CreateEvent(NULL, FALSE, FALSE, NULL); + if (mWakeEvent == NULL) + { + CloseHandle(mSemaphore); +- throw std::system_error(GetLastError(), std::generic_category()); ++ __builtin_trap(); + } + } + ~condition_variable_any() +@@ -132,7 +132,7 @@ private: + else + { + using namespace std; +- throw system_error(make_error_code(errc::protocol_error)); ++ __builtin_trap(); + } + } + public: +@@ -547,7 +547,7 @@ namespace std + // was none. Direct specification (std::), however, would be unaffected. + // Take the safe option, and include only in the presence of MinGW's win32 + // implementation. +-#if defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) ++#if defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) && !defined(__clang__) + using mingw_stdthread::cv_status; + using mingw_stdthread::condition_variable; + using mingw_stdthread::condition_variable_any; +diff --git a/thirdparty/mingw-std-threads/mingw.mutex.h b/thirdparty/mingw-std-threads/mingw.mutex.h +index 03efa13f8b..1e881e6c7d 100644 +--- a/thirdparty/mingw-std-threads/mingw.mutex.h ++++ b/thirdparty/mingw-std-threads/mingw.mutex.h +@@ -132,7 +132,7 @@ struct _OwnerThread + fprintf(stderr, "FATAL: Recursive locking of non-recursive mutex\ + detected. Throwing system exception\n"); + fflush(stderr); +- throw system_error(make_error_code(errc::resource_deadlock_would_occur)); ++ __builtin_trap(); + } + DWORD checkOwnerBeforeLock() const + { +@@ -364,13 +364,13 @@ public: + #endif + if ((ret != kWaitObject0) && (ret != kWaitAbandoned)) + { +- throw std::system_error(GetLastError(), std::system_category()); ++ __builtin_trap(); + } + } + void unlock() + { + if (!ReleaseMutex(mHandle)) +- throw std::system_error(GetLastError(), std::system_category()); ++ __builtin_trap(); + } + bool try_lock() + { +@@ -480,7 +480,7 @@ namespace std + // was none. Direct specification (std::), however, would be unaffected. + // Take the safe option, and include only in the presence of MinGW's win32 + // implementation. +-#if defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) ++#if defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) && !defined(__clang__) + using mingw_stdthread::recursive_mutex; + using mingw_stdthread::mutex; + using mingw_stdthread::recursive_timed_mutex; +diff --git a/thirdparty/mingw-std-threads/mingw.shared_mutex.h b/thirdparty/mingw-std-threads/mingw.shared_mutex.h +index ff1ac65135..ddc46bb826 100644 +--- a/thirdparty/mingw-std-threads/mingw.shared_mutex.h ++++ b/thirdparty/mingw-std-threads/mingw.shared_mutex.h +@@ -134,7 +134,7 @@ public: + using namespace std; + #ifndef NDEBUG + if (!(mCounter.fetch_sub(1, memory_order_release) & static_cast<counter_type>(~kWriteBit))) +- throw system_error(make_error_code(errc::operation_not_permitted)); ++ __builtin_trap(); + #else + mCounter.fetch_sub(1, memory_order_release); + #endif +@@ -187,7 +187,7 @@ public: + using namespace std; + #ifndef NDEBUG + if (mCounter.load(memory_order_relaxed) != kWriteBit) +- throw system_error(make_error_code(errc::operation_not_permitted)); ++ __builtin_trap(); + #endif + mCounter.store(0, memory_order_release); + } +@@ -317,9 +317,9 @@ class shared_lock + { + using namespace std; + if (mMutex == nullptr) +- throw system_error(make_error_code(errc::operation_not_permitted)); ++ __builtin_trap(); + if (mOwns) +- throw system_error(make_error_code(errc::resource_deadlock_would_occur)); ++ __builtin_trap(); + } + public: + typedef Mutex mutex_type; +@@ -432,7 +432,7 @@ public: + { + using namespace std; + if (!mOwns) +- throw system_error(make_error_code(errc::operation_not_permitted)); ++ __builtin_trap(); + mMutex->unlock_shared(); + mOwns = false; + } +@@ -484,10 +484,10 @@ namespace std + // was none. Direct specification (std::), however, would be unaffected. + // Take the safe option, and include only in the presence of MinGW's win32 + // implementation. +-#if (__cplusplus < 201703L) || (defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS)) ++#if (__cplusplus < 201703L) || (defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) && !defined(__clang__)) + using mingw_stdthread::shared_mutex; + #endif +-#if (__cplusplus < 201402L) || (defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS)) ++#if (__cplusplus < 201402L) || (defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) && !defined(__clang__)) + using mingw_stdthread::shared_timed_mutex; + using mingw_stdthread::shared_lock; + #elif !defined(MINGW_STDTHREAD_REDUNDANCY_WARNING) // Skip repetition +diff --git a/thirdparty/mingw-std-threads/mingw.thread.h b/thirdparty/mingw-std-threads/mingw.thread.h +index bcdd1a36a8..60d2200db2 100644 +--- a/thirdparty/mingw-std-threads/mingw.thread.h ++++ b/thirdparty/mingw-std-threads/mingw.thread.h +@@ -193,10 +193,9 @@ public: + if (int_handle == 0) + { + mHandle = kInvalidHandle; +- int errnum = errno; + delete call; + // Note: Should only throw EINVAL, EAGAIN, EACCES +- throw std::system_error(errnum, std::generic_category()); ++ __builtin_trap(); + } else { + mThreadId.mId = id_receiver; + mHandle = reinterpret_cast<HANDLE>(int_handle); +@@ -213,11 +212,11 @@ public: + { + using namespace std; + if (get_id() == id(GetCurrentThreadId())) +- throw system_error(make_error_code(errc::resource_deadlock_would_occur)); ++ __builtin_trap(); + if (mHandle == kInvalidHandle) +- throw system_error(make_error_code(errc::no_such_process)); ++ __builtin_trap(); + if (!joinable()) +- throw system_error(make_error_code(errc::invalid_argument)); ++ __builtin_trap(); + WaitForSingleObject(mHandle, kInfinite); + CloseHandle(mHandle); + mHandle = kInvalidHandle; +@@ -266,7 +265,7 @@ moving another thread to it.\n"); + if (!joinable()) + { + using namespace std; +- throw system_error(make_error_code(errc::invalid_argument)); ++ __builtin_trap(); + } + if (mHandle != kInvalidHandle) + { +@@ -326,7 +325,7 @@ namespace std + // was none. Direct specification (std::), however, would be unaffected. + // Take the safe option, and include only in the presence of MinGW's win32 + // implementation. +-#if defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) ++#if defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) && !defined(__clang__) + using mingw_stdthread::thread; + // Remove ambiguity immediately, to avoid problems arising from the above. + //using std::thread; diff --git a/thirdparty/mingw-std-threads/mingw.condition_variable.h b/thirdparty/mingw-std-threads/mingw.condition_variable.h new file mode 100644 index 0000000000..d099fad2ec --- /dev/null +++ b/thirdparty/mingw-std-threads/mingw.condition_variable.h @@ -0,0 +1,564 @@ +/** +* @file condition_variable.h +* @brief std::condition_variable implementation for MinGW +* +* (c) 2013-2016 by Mega Limited, Auckland, New Zealand +* @author Alexander Vassilev +* +* @copyright Simplified (2-clause) BSD License. +* You should have received a copy of the license along with this +* program. +* +* This code is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +* @note +* This file may become part of the mingw-w64 runtime package. If/when this happens, +* the appropriate license will be added, i.e. this code will become dual-licensed, +* and the current BSD 2-clause license will stay. +*/ + +#ifndef MINGW_CONDITIONAL_VARIABLE_H +#define MINGW_CONDITIONAL_VARIABLE_H + +#if !defined(__cplusplus) || (__cplusplus < 201103L) +#error A C++11 compiler is required! +#endif +// Use the standard classes for std::, if available. +#include <condition_variable> + +#include <cassert> +#include <chrono> +#include <system_error> + +#include <sdkddkver.h> // Detect Windows version. +#if (WINVER < _WIN32_WINNT_VISTA) +#include <atomic> +#endif +#if (defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)) +#pragma message "The Windows API that MinGW-w32 provides is not fully compatible\ + with Microsoft's API. We'll try to work around this, but we can make no\ + guarantees. This problem does not exist in MinGW-w64." +#include <windows.h> // No further granularity can be expected. +#else +#if (WINVER < _WIN32_WINNT_VISTA) +#include <windef.h> +#include <winbase.h> // For CreateSemaphore +#include <handleapi.h> +#endif +#include <synchapi.h> +#endif + +#include "mingw.mutex.h" +#include "mingw.shared_mutex.h" + +#if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0501) +#error To use the MinGW-std-threads library, you will need to define the macro _WIN32_WINNT to be 0x0501 (Windows XP) or higher. +#endif + +namespace mingw_stdthread +{ +#if defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) && !defined(__clang__) +enum class cv_status { no_timeout, timeout }; +#else +using std::cv_status; +#endif +namespace xp +{ +// Include the XP-compatible condition_variable classes only if actually +// compiling for XP. The XP-compatible classes are slower than the newer +// versions, and depend on features not compatible with Windows Phone 8. +#if (WINVER < _WIN32_WINNT_VISTA) +class condition_variable_any +{ + recursive_mutex mMutex {}; + std::atomic<int> mNumWaiters {0}; + HANDLE mSemaphore; + HANDLE mWakeEvent {}; +public: + using native_handle_type = HANDLE; + native_handle_type native_handle() + { + return mSemaphore; + } + condition_variable_any(const condition_variable_any&) = delete; + condition_variable_any& operator=(const condition_variable_any&) = delete; + condition_variable_any() + : mSemaphore(CreateSemaphoreA(NULL, 0, 0xFFFF, NULL)) + { + if (mSemaphore == NULL) + __builtin_trap(); + mWakeEvent = CreateEvent(NULL, FALSE, FALSE, NULL); + if (mWakeEvent == NULL) + { + CloseHandle(mSemaphore); + __builtin_trap(); + } + } + ~condition_variable_any() + { + CloseHandle(mWakeEvent); + CloseHandle(mSemaphore); + } +private: + template <class M> + bool wait_impl(M& lock, DWORD timeout) + { + { + lock_guard<recursive_mutex> guard(mMutex); + mNumWaiters++; + } + lock.unlock(); + DWORD ret = WaitForSingleObject(mSemaphore, timeout); + + mNumWaiters--; + SetEvent(mWakeEvent); + lock.lock(); + if (ret == WAIT_OBJECT_0) + return true; + else if (ret == WAIT_TIMEOUT) + return false; +//2 possible cases: +//1)The point in notify_all() where we determine the count to +//increment the semaphore with has not been reached yet: +//we just need to decrement mNumWaiters, but setting the event does not hurt +// +//2)Semaphore has just been released with mNumWaiters just before +//we decremented it. This means that the semaphore count +//after all waiters finish won't be 0 - because not all waiters +//woke up by acquiring the semaphore - we woke up by a timeout. +//The notify_all() must handle this gracefully +// + else + { + using namespace std; + __builtin_trap(); + } + } +public: + template <class M> + void wait(M& lock) + { + wait_impl(lock, INFINITE); + } + template <class M, class Predicate> + void wait(M& lock, Predicate pred) + { + while(!pred()) + { + wait(lock); + }; + } + + void notify_all() noexcept + { + lock_guard<recursive_mutex> lock(mMutex); //block any further wait requests until all current waiters are unblocked + if (mNumWaiters.load() <= 0) + return; + + ReleaseSemaphore(mSemaphore, mNumWaiters, NULL); + while(mNumWaiters > 0) + { + auto ret = WaitForSingleObject(mWakeEvent, 1000); + if (ret == WAIT_FAILED || ret == WAIT_ABANDONED) + std::terminate(); + } + assert(mNumWaiters == 0); +//in case some of the waiters timed out just after we released the +//semaphore by mNumWaiters, it won't be zero now, because not all waiters +//woke up by acquiring the semaphore. So we must zero the semaphore before +//we accept waiters for the next event +//See _wait_impl for details + while(WaitForSingleObject(mSemaphore, 0) == WAIT_OBJECT_0); + } + void notify_one() noexcept + { + lock_guard<recursive_mutex> lock(mMutex); + int targetWaiters = mNumWaiters.load() - 1; + if (targetWaiters <= -1) + return; + ReleaseSemaphore(mSemaphore, 1, NULL); + while(mNumWaiters > targetWaiters) + { + auto ret = WaitForSingleObject(mWakeEvent, 1000); + if (ret == WAIT_FAILED || ret == WAIT_ABANDONED) + std::terminate(); + } + assert(mNumWaiters == targetWaiters); + } + template <class M, class Rep, class Period> + cv_status wait_for(M& lock, + const std::chrono::duration<Rep, Period>& rel_time) + { + using namespace std::chrono; + auto timeout = duration_cast<milliseconds>(rel_time).count(); + DWORD waittime = (timeout < INFINITE) ? ((timeout < 0) ? 0 : static_cast<DWORD>(timeout)) : (INFINITE - 1); + bool ret = wait_impl(lock, waittime) || (timeout >= INFINITE); + return ret?cv_status::no_timeout:cv_status::timeout; + } + + template <class M, class Rep, class Period, class Predicate> + bool wait_for(M& lock, + const std::chrono::duration<Rep, Period>& rel_time, Predicate pred) + { + return wait_until(lock, std::chrono::steady_clock::now()+rel_time, pred); + } + template <class M, class Clock, class Duration> + cv_status wait_until (M& lock, + const std::chrono::time_point<Clock,Duration>& abs_time) + { + return wait_for(lock, abs_time - Clock::now()); + } + template <class M, class Clock, class Duration, class Predicate> + bool wait_until (M& lock, + const std::chrono::time_point<Clock, Duration>& abs_time, + Predicate pred) + { + while (!pred()) + { + if (wait_until(lock, abs_time) == cv_status::timeout) + { + return pred(); + } + } + return true; + } +}; +class condition_variable: condition_variable_any +{ + using base = condition_variable_any; +public: + using base::native_handle_type; + using base::native_handle; + using base::base; + using base::notify_all; + using base::notify_one; + void wait(unique_lock<mutex> &lock) + { + base::wait(lock); + } + template <class Predicate> + void wait(unique_lock<mutex>& lock, Predicate pred) + { + base::wait(lock, pred); + } + template <class Rep, class Period> + cv_status wait_for(unique_lock<mutex>& lock, const std::chrono::duration<Rep, Period>& rel_time) + { + return base::wait_for(lock, rel_time); + } + template <class Rep, class Period, class Predicate> + bool wait_for(unique_lock<mutex>& lock, const std::chrono::duration<Rep, Period>& rel_time, Predicate pred) + { + return base::wait_for(lock, rel_time, pred); + } + template <class Clock, class Duration> + cv_status wait_until (unique_lock<mutex>& lock, const std::chrono::time_point<Clock,Duration>& abs_time) + { + return base::wait_until(lock, abs_time); + } + template <class Clock, class Duration, class Predicate> + bool wait_until (unique_lock<mutex>& lock, const std::chrono::time_point<Clock, Duration>& abs_time, Predicate pred) + { + return base::wait_until(lock, abs_time, pred); + } +}; +#endif // Compiling for XP +} // Namespace mingw_stdthread::xp + +#if (WINVER >= _WIN32_WINNT_VISTA) +namespace vista +{ +// If compiling for Vista or higher, use the native condition variable. +class condition_variable +{ + static constexpr DWORD kInfinite = 0xffffffffl; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" + CONDITION_VARIABLE cvariable_ = CONDITION_VARIABLE_INIT; +#pragma GCC diagnostic pop + + friend class condition_variable_any; + +#if STDMUTEX_RECURSION_CHECKS + template<typename MTX> + inline static void before_wait (MTX * pmutex) + { + pmutex->mOwnerThread.checkSetOwnerBeforeUnlock(); + } + template<typename MTX> + inline static void after_wait (MTX * pmutex) + { + pmutex->mOwnerThread.setOwnerAfterLock(GetCurrentThreadId()); + } +#else + inline static void before_wait (void *) { } + inline static void after_wait (void *) { } +#endif + + bool wait_impl (unique_lock<xp::mutex> & lock, DWORD time) + { + using mutex_handle_type = typename xp::mutex::native_handle_type; + static_assert(std::is_same<mutex_handle_type, PCRITICAL_SECTION>::value, + "Native Win32 condition variable requires std::mutex to \ +use native Win32 critical section objects."); + xp::mutex * pmutex = lock.release(); + before_wait(pmutex); + BOOL success = SleepConditionVariableCS(&cvariable_, + pmutex->native_handle(), + time); + after_wait(pmutex); + lock = unique_lock<xp::mutex>(*pmutex, adopt_lock); + return success; + } + + bool wait_unique (windows7::mutex * pmutex, DWORD time) + { + before_wait(pmutex); + BOOL success = SleepConditionVariableSRW( native_handle(), + pmutex->native_handle(), + time, +// CONDITION_VARIABLE_LOCKMODE_SHARED has a value not specified by +// Microsoft's Dev Center, but is known to be (convertible to) a ULONG. To +// ensure that the value passed to this function is not equal to Microsoft's +// constant, we can either use a static_assert, or simply generate an +// appropriate value. + !CONDITION_VARIABLE_LOCKMODE_SHARED); + after_wait(pmutex); + return success; + } + bool wait_impl (unique_lock<windows7::mutex> & lock, DWORD time) + { + windows7::mutex * pmutex = lock.release(); + bool success = wait_unique(pmutex, time); + lock = unique_lock<windows7::mutex>(*pmutex, adopt_lock); + return success; + } +public: + using native_handle_type = PCONDITION_VARIABLE; + native_handle_type native_handle (void) + { + return &cvariable_; + } + + condition_variable (void) = default; + ~condition_variable (void) = default; + + condition_variable (const condition_variable &) = delete; + condition_variable & operator= (const condition_variable &) = delete; + + void notify_one (void) noexcept + { + WakeConditionVariable(&cvariable_); + } + + void notify_all (void) noexcept + { + WakeAllConditionVariable(&cvariable_); + } + + void wait (unique_lock<mutex> & lock) + { + wait_impl(lock, kInfinite); + } + + template<class Predicate> + void wait (unique_lock<mutex> & lock, Predicate pred) + { + while (!pred()) + wait(lock); + } + + template <class Rep, class Period> + cv_status wait_for(unique_lock<mutex>& lock, + const std::chrono::duration<Rep, Period>& rel_time) + { + using namespace std::chrono; + auto timeout = duration_cast<milliseconds>(rel_time).count(); + DWORD waittime = (timeout < kInfinite) ? ((timeout < 0) ? 0 : static_cast<DWORD>(timeout)) : (kInfinite - 1); + bool result = wait_impl(lock, waittime) || (timeout >= kInfinite); + return result ? cv_status::no_timeout : cv_status::timeout; + } + + template <class Rep, class Period, class Predicate> + bool wait_for(unique_lock<mutex>& lock, + const std::chrono::duration<Rep, Period>& rel_time, + Predicate pred) + { + return wait_until(lock, + std::chrono::steady_clock::now() + rel_time, + std::move(pred)); + } + template <class Clock, class Duration> + cv_status wait_until (unique_lock<mutex>& lock, + const std::chrono::time_point<Clock,Duration>& abs_time) + { + return wait_for(lock, abs_time - Clock::now()); + } + template <class Clock, class Duration, class Predicate> + bool wait_until (unique_lock<mutex>& lock, + const std::chrono::time_point<Clock, Duration>& abs_time, + Predicate pred) + { + while (!pred()) + { + if (wait_until(lock, abs_time) == cv_status::timeout) + { + return pred(); + } + } + return true; + } +}; + +class condition_variable_any +{ + static constexpr DWORD kInfinite = 0xffffffffl; + using native_shared_mutex = windows7::shared_mutex; + + condition_variable internal_cv_ {}; +// When available, the SRW-based mutexes should be faster than the +// CriticalSection-based mutexes. Only try_lock will be unavailable in Vista, +// and try_lock is not used by condition_variable_any. + windows7::mutex internal_mutex_ {}; + + template<class L> + bool wait_impl (L & lock, DWORD time) + { + unique_lock<decltype(internal_mutex_)> internal_lock(internal_mutex_); + lock.unlock(); + bool success = internal_cv_.wait_impl(internal_lock, time); + lock.lock(); + return success; + } +// If the lock happens to be called on a native Windows mutex, skip any extra +// contention. + inline bool wait_impl (unique_lock<mutex> & lock, DWORD time) + { + return internal_cv_.wait_impl(lock, time); + } +// Some shared_mutex functionality is available even in Vista, but it's not +// until Windows 7 that a full implementation is natively possible. The class +// itself is defined, with missing features, at the Vista feature level. + bool wait_impl (unique_lock<native_shared_mutex> & lock, DWORD time) + { + native_shared_mutex * pmutex = lock.release(); + bool success = internal_cv_.wait_unique(pmutex, time); + lock = unique_lock<native_shared_mutex>(*pmutex, adopt_lock); + return success; + } + bool wait_impl (shared_lock<native_shared_mutex> & lock, DWORD time) + { + native_shared_mutex * pmutex = lock.release(); + BOOL success = SleepConditionVariableSRW(native_handle(), + pmutex->native_handle(), time, + CONDITION_VARIABLE_LOCKMODE_SHARED); + lock = shared_lock<native_shared_mutex>(*pmutex, adopt_lock); + return success; + } +public: + using native_handle_type = typename condition_variable::native_handle_type; + + native_handle_type native_handle (void) + { + return internal_cv_.native_handle(); + } + + void notify_one (void) noexcept + { + internal_cv_.notify_one(); + } + + void notify_all (void) noexcept + { + internal_cv_.notify_all(); + } + + condition_variable_any (void) = default; + ~condition_variable_any (void) = default; + + template<class L> + void wait (L & lock) + { + wait_impl(lock, kInfinite); + } + + template<class L, class Predicate> + void wait (L & lock, Predicate pred) + { + while (!pred()) + wait(lock); + } + + template <class L, class Rep, class Period> + cv_status wait_for(L& lock, const std::chrono::duration<Rep,Period>& period) + { + using namespace std::chrono; + auto timeout = duration_cast<milliseconds>(period).count(); + DWORD waittime = (timeout < kInfinite) ? ((timeout < 0) ? 0 : static_cast<DWORD>(timeout)) : (kInfinite - 1); + bool result = wait_impl(lock, waittime) || (timeout >= kInfinite); + return result ? cv_status::no_timeout : cv_status::timeout; + } + + template <class L, class Rep, class Period, class Predicate> + bool wait_for(L& lock, const std::chrono::duration<Rep, Period>& period, + Predicate pred) + { + return wait_until(lock, std::chrono::steady_clock::now() + period, + std::move(pred)); + } + template <class L, class Clock, class Duration> + cv_status wait_until (L& lock, + const std::chrono::time_point<Clock,Duration>& abs_time) + { + return wait_for(lock, abs_time - Clock::now()); + } + template <class L, class Clock, class Duration, class Predicate> + bool wait_until (L& lock, + const std::chrono::time_point<Clock, Duration>& abs_time, + Predicate pred) + { + while (!pred()) + { + if (wait_until(lock, abs_time) == cv_status::timeout) + { + return pred(); + } + } + return true; + } +}; +} // Namespace vista +#endif +#if WINVER < 0x0600 +using xp::condition_variable; +using xp::condition_variable_any; +#else +using vista::condition_variable; +using vista::condition_variable_any; +#endif +} // Namespace mingw_stdthread + +// Push objects into std, but only if they are not already there. +namespace std +{ +// Because of quirks of the compiler, the common "using namespace std;" +// directive would flatten the namespaces and introduce ambiguity where there +// was none. Direct specification (std::), however, would be unaffected. +// Take the safe option, and include only in the presence of MinGW's win32 +// implementation. +#if defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) && !defined(__clang__) +using mingw_stdthread::cv_status; +using mingw_stdthread::condition_variable; +using mingw_stdthread::condition_variable_any; +#elif !defined(MINGW_STDTHREAD_REDUNDANCY_WARNING) // Skip repetition +#define MINGW_STDTHREAD_REDUNDANCY_WARNING +#pragma message "This version of MinGW seems to include a win32 port of\ + pthreads, and probably already has C++11 std threading classes implemented,\ + based on pthreads. These classes, found in namespace std, are not overridden\ + by the mingw-std-thread library. If you would still like to use this\ + implementation (as it is more lightweight), use the classes provided in\ + namespace mingw_stdthread." +#endif +} +#endif // MINGW_CONDITIONAL_VARIABLE_H diff --git a/thirdparty/mingw-std-threads/mingw.invoke.h b/thirdparty/mingw-std-threads/mingw.invoke.h new file mode 100644 index 0000000000..d5c9dd38bb --- /dev/null +++ b/thirdparty/mingw-std-threads/mingw.invoke.h @@ -0,0 +1,109 @@ +/// \file mingw.invoke.h +/// \brief Lightweight `invoke` implementation, for C++11 and C++14. +/// +/// (c) 2018-2019 by Nathaniel J. McClatchey, San Jose, CA, United States +/// \author Nathaniel J. McClatchey, PhD +/// +/// \copyright Simplified (2-clause) BSD License. +/// +/// \note This file may become part of the mingw-w64 runtime package. If/when +/// this happens, the appropriate license will be added, i.e. this code will +/// become dual-licensed, and the current BSD 2-clause license will stay. + +#ifndef MINGW_INVOKE_H_ +#define MINGW_INVOKE_H_ + +#include <type_traits> // For std::result_of, etc. +#include <utility> // For std::forward +#include <functional> // For std::reference_wrapper + +namespace mingw_stdthread +{ +namespace detail +{ +// For compatibility, implement std::invoke for C++11 and C++14 +#if __cplusplus < 201703L + template<bool PMemFunc, bool PMemData> + struct Invoker + { + template<class F, class... Args> + inline static typename std::result_of<F(Args...)>::type invoke (F&& f, Args&&... args) + { + return std::forward<F>(f)(std::forward<Args>(args)...); + } + }; + template<bool> + struct InvokerHelper; + + template<> + struct InvokerHelper<false> + { + template<class T1> + inline static auto get (T1&& t1) -> decltype(*std::forward<T1>(t1)) + { + return *std::forward<T1>(t1); + } + + template<class T1> + inline static auto get (const std::reference_wrapper<T1>& t1) -> decltype(t1.get()) + { + return t1.get(); + } + }; + + template<> + struct InvokerHelper<true> + { + template<class T1> + inline static auto get (T1&& t1) -> decltype(std::forward<T1>(t1)) + { + return std::forward<T1>(t1); + } + }; + + template<> + struct Invoker<true, false> + { + template<class T, class F, class T1, class... Args> + inline static auto invoke (F T::* f, T1&& t1, Args&&... args) ->\ + decltype((InvokerHelper<std::is_base_of<T,typename std::decay<T1>::type>::value>::get(std::forward<T1>(t1)).*f)(std::forward<Args>(args)...)) + { + return (InvokerHelper<std::is_base_of<T,typename std::decay<T1>::type>::value>::get(std::forward<T1>(t1)).*f)(std::forward<Args>(args)...); + } + }; + + template<> + struct Invoker<false, true> + { + template<class T, class F, class T1, class... Args> + inline static auto invoke (F T::* f, T1&& t1, Args&&... args) ->\ + decltype(InvokerHelper<std::is_base_of<T,typename std::decay<T1>::type>::value>::get(t1).*f) + { + return InvokerHelper<std::is_base_of<T,typename std::decay<T1>::type>::value>::get(t1).*f; + } + }; + + template<class F, class... Args> + struct InvokeResult + { + typedef Invoker<std::is_member_function_pointer<typename std::remove_reference<F>::type>::value, + std::is_member_object_pointer<typename std::remove_reference<F>::type>::value && + (sizeof...(Args) == 1)> invoker; + inline static auto invoke (F&& f, Args&&... args) -> decltype(invoker::invoke(std::forward<F>(f), std::forward<Args>(args)...)) + { + return invoker::invoke(std::forward<F>(f), std::forward<Args>(args)...); + } + }; + + template<class F, class...Args> + auto invoke (F&& f, Args&&... args) -> decltype(InvokeResult<F, Args...>::invoke(std::forward<F>(f), std::forward<Args>(args)...)) + { + return InvokeResult<F, Args...>::invoke(std::forward<F>(f), std::forward<Args>(args)...); + } +#else + using std::invoke; +#endif +} // Namespace "detail" +} // Namespace "mingw_stdthread" + +#endif diff --git a/thirdparty/mingw-std-threads/mingw.mutex.h b/thirdparty/mingw-std-threads/mingw.mutex.h new file mode 100644 index 0000000000..1e881e6c7d --- /dev/null +++ b/thirdparty/mingw-std-threads/mingw.mutex.h @@ -0,0 +1,500 @@ +/** +* @file mingw.mutex.h +* @brief std::mutex et al implementation for MinGW +** (c) 2013-2016 by Mega Limited, Auckland, New Zealand +* @author Alexander Vassilev +* +* @copyright Simplified (2-clause) BSD License. +* You should have received a copy of the license along with this +* program. +* +* This code is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +* @note +* This file may become part of the mingw-w64 runtime package. If/when this happens, +* the appropriate license will be added, i.e. this code will become dual-licensed, +* and the current BSD 2-clause license will stay. +*/ + +#ifndef WIN32STDMUTEX_H +#define WIN32STDMUTEX_H + +#if !defined(__cplusplus) || (__cplusplus < 201103L) +#error A C++11 compiler is required! +#endif +// Recursion checks on non-recursive locks have some performance penalty, and +// the C++ standard does not mandate them. The user might want to explicitly +// enable or disable such checks. If the user has no preference, enable such +// checks in debug builds, but not in release builds. +#ifdef STDMUTEX_RECURSION_CHECKS +#elif defined(NDEBUG) +#define STDMUTEX_RECURSION_CHECKS 0 +#else +#define STDMUTEX_RECURSION_CHECKS 1 +#endif + +#include <chrono> +#include <system_error> +#include <atomic> +#include <mutex> //need for call_once() + +#if STDMUTEX_RECURSION_CHECKS || !defined(NDEBUG) +#include <cstdio> +#endif + +#include <sdkddkver.h> // Detect Windows version. + +#if (defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)) +#pragma message "The Windows API that MinGW-w32 provides is not fully compatible\ + with Microsoft's API. We'll try to work around this, but we can make no\ + guarantees. This problem does not exist in MinGW-w64." +#include <windows.h> // No further granularity can be expected. +#else +#if STDMUTEX_RECURSION_CHECKS +#include <processthreadsapi.h> // For GetCurrentThreadId +#endif +#include <synchapi.h> // For InitializeCriticalSection, etc. +#include <errhandlingapi.h> // For GetLastError +#include <handleapi.h> +#endif + +// Need for the implementation of invoke +#include "mingw.invoke.h" + +#if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0501) +#error To use the MinGW-std-threads library, you will need to define the macro _WIN32_WINNT to be 0x0501 (Windows XP) or higher. +#endif + +namespace mingw_stdthread +{ +// The _NonRecursive class has mechanisms that do not play nice with direct +// manipulation of the native handle. This forward declaration is part of +// a friend class declaration. +#if STDMUTEX_RECURSION_CHECKS +namespace vista +{ +class condition_variable; +} +#endif +// To make this namespace equivalent to the thread-related subset of std, +// pull in the classes and class templates supplied by std but not by this +// implementation. +using std::lock_guard; +using std::unique_lock; +using std::adopt_lock_t; +using std::defer_lock_t; +using std::try_to_lock_t; +using std::adopt_lock; +using std::defer_lock; +using std::try_to_lock; + +class recursive_mutex +{ + CRITICAL_SECTION mHandle; +public: + typedef LPCRITICAL_SECTION native_handle_type; + native_handle_type native_handle() {return &mHandle;} + recursive_mutex() noexcept : mHandle() + { + InitializeCriticalSection(&mHandle); + } + recursive_mutex (const recursive_mutex&) = delete; + recursive_mutex& operator=(const recursive_mutex&) = delete; + ~recursive_mutex() noexcept + { + DeleteCriticalSection(&mHandle); + } + void lock() + { + EnterCriticalSection(&mHandle); + } + void unlock() + { + LeaveCriticalSection(&mHandle); + } + bool try_lock() + { + return (TryEnterCriticalSection(&mHandle)!=0); + } +}; + +#if STDMUTEX_RECURSION_CHECKS +struct _OwnerThread +{ +// If this is to be read before locking, then the owner-thread variable must +// be atomic to prevent a torn read from spuriously causing errors. + std::atomic<DWORD> mOwnerThread; + constexpr _OwnerThread () noexcept : mOwnerThread(0) {} + static void on_deadlock (void) + { + using namespace std; + fprintf(stderr, "FATAL: Recursive locking of non-recursive mutex\ + detected. Throwing system exception\n"); + fflush(stderr); + __builtin_trap(); + } + DWORD checkOwnerBeforeLock() const + { + DWORD self = GetCurrentThreadId(); + if (mOwnerThread.load(std::memory_order_relaxed) == self) + on_deadlock(); + return self; + } + void setOwnerAfterLock(DWORD id) + { + mOwnerThread.store(id, std::memory_order_relaxed); + } + void checkSetOwnerBeforeUnlock() + { + DWORD self = GetCurrentThreadId(); + if (mOwnerThread.load(std::memory_order_relaxed) != self) + on_deadlock(); + mOwnerThread.store(0, std::memory_order_relaxed); + } +}; +#endif + +// Though the Slim Reader-Writer (SRW) locks used here are not complete until +// Windows 7, implementing partial functionality in Vista will simplify the +// interaction with condition variables. + +//Define SRWLOCK_INIT. + +#if !defined(SRWLOCK_INIT) +#pragma message "SRWLOCK_INIT macro is not defined. Defining automatically." +#define SRWLOCK_INIT {0} +#endif + +#if defined(_WIN32) && (WINVER >= _WIN32_WINNT_VISTA) +namespace windows7 +{ +class mutex +{ + SRWLOCK mHandle; +// Track locking thread for error checking. +#if STDMUTEX_RECURSION_CHECKS + friend class vista::condition_variable; + _OwnerThread mOwnerThread {}; +#endif +public: + typedef PSRWLOCK native_handle_type; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" + constexpr mutex () noexcept : mHandle(SRWLOCK_INIT) { } +#pragma GCC diagnostic pop + mutex (const mutex&) = delete; + mutex & operator= (const mutex&) = delete; + void lock (void) + { +// Note: Undefined behavior if called recursively. +#if STDMUTEX_RECURSION_CHECKS + DWORD self = mOwnerThread.checkOwnerBeforeLock(); +#endif + AcquireSRWLockExclusive(&mHandle); +#if STDMUTEX_RECURSION_CHECKS + mOwnerThread.setOwnerAfterLock(self); +#endif + } + void unlock (void) + { +#if STDMUTEX_RECURSION_CHECKS + mOwnerThread.checkSetOwnerBeforeUnlock(); +#endif + ReleaseSRWLockExclusive(&mHandle); + } +// TryAcquireSRW functions are a Windows 7 feature. +#if (WINVER >= _WIN32_WINNT_WIN7) + bool try_lock (void) + { +#if STDMUTEX_RECURSION_CHECKS + DWORD self = mOwnerThread.checkOwnerBeforeLock(); +#endif + BOOL ret = TryAcquireSRWLockExclusive(&mHandle); +#if STDMUTEX_RECURSION_CHECKS + if (ret) + mOwnerThread.setOwnerAfterLock(self); +#endif + return ret; + } +#endif + native_handle_type native_handle (void) + { + return &mHandle; + } +}; +} // Namespace windows7 +#endif // Compiling for Vista +namespace xp +{ +class mutex +{ + CRITICAL_SECTION mHandle; + std::atomic_uchar mState; +// Track locking thread for error checking. +#if STDMUTEX_RECURSION_CHECKS + friend class vista::condition_variable; + _OwnerThread mOwnerThread {}; +#endif +public: + typedef PCRITICAL_SECTION native_handle_type; + constexpr mutex () noexcept : mHandle(), mState(2) { } + mutex (const mutex&) = delete; + mutex & operator= (const mutex&) = delete; + ~mutex() noexcept + { +// Undefined behavior if the mutex is held (locked) by any thread. +// Undefined behavior if a thread terminates while holding ownership of the +// mutex. + DeleteCriticalSection(&mHandle); + } + void lock (void) + { + unsigned char state = mState.load(std::memory_order_acquire); + while (state) { + if ((state == 2) && mState.compare_exchange_weak(state, 1, std::memory_order_acquire)) + { + InitializeCriticalSection(&mHandle); + mState.store(0, std::memory_order_release); + break; + } + if (state == 1) + { + Sleep(0); + state = mState.load(std::memory_order_acquire); + } + } +#if STDMUTEX_RECURSION_CHECKS + DWORD self = mOwnerThread.checkOwnerBeforeLock(); +#endif + EnterCriticalSection(&mHandle); +#if STDMUTEX_RECURSION_CHECKS + mOwnerThread.setOwnerAfterLock(self); +#endif + } + void unlock (void) + { +#if STDMUTEX_RECURSION_CHECKS + mOwnerThread.checkSetOwnerBeforeUnlock(); +#endif + LeaveCriticalSection(&mHandle); + } + bool try_lock (void) + { + unsigned char state = mState.load(std::memory_order_acquire); + if ((state == 2) && mState.compare_exchange_strong(state, 1, std::memory_order_acquire)) + { + InitializeCriticalSection(&mHandle); + mState.store(0, std::memory_order_release); + } + if (state == 1) + return false; +#if STDMUTEX_RECURSION_CHECKS + DWORD self = mOwnerThread.checkOwnerBeforeLock(); +#endif + BOOL ret = TryEnterCriticalSection(&mHandle); +#if STDMUTEX_RECURSION_CHECKS + if (ret) + mOwnerThread.setOwnerAfterLock(self); +#endif + return ret; + } + native_handle_type native_handle (void) + { + return &mHandle; + } +}; +} // Namespace "xp" +#if (WINVER >= _WIN32_WINNT_WIN7) +using windows7::mutex; +#else +using xp::mutex; +#endif + +class recursive_timed_mutex +{ + static constexpr DWORD kWaitAbandoned = 0x00000080l; + static constexpr DWORD kWaitObject0 = 0x00000000l; + static constexpr DWORD kInfinite = 0xffffffffl; + inline bool try_lock_internal (DWORD ms) noexcept + { + DWORD ret = WaitForSingleObject(mHandle, ms); +#ifndef NDEBUG + if (ret == kWaitAbandoned) + { + using namespace std; + fprintf(stderr, "FATAL: Thread terminated while holding a mutex."); + terminate(); + } +#endif + return (ret == kWaitObject0) || (ret == kWaitAbandoned); + } +protected: + HANDLE mHandle; +// Track locking thread for error checking of non-recursive timed_mutex. For +// standard compliance, this must be defined in same class and at the same +// access-control level as every other variable in the timed_mutex. +#if STDMUTEX_RECURSION_CHECKS + friend class vista::condition_variable; + _OwnerThread mOwnerThread {}; +#endif +public: + typedef HANDLE native_handle_type; + native_handle_type native_handle() const {return mHandle;} + recursive_timed_mutex(const recursive_timed_mutex&) = delete; + recursive_timed_mutex& operator=(const recursive_timed_mutex&) = delete; + recursive_timed_mutex(): mHandle(CreateMutex(NULL, FALSE, NULL)) {} + ~recursive_timed_mutex() + { + CloseHandle(mHandle); + } + void lock() + { + DWORD ret = WaitForSingleObject(mHandle, kInfinite); +// If (ret == WAIT_ABANDONED), then the thread that held ownership was +// terminated. Behavior is undefined, but Windows will pass ownership to this +// thread. +#ifndef NDEBUG + if (ret == kWaitAbandoned) + { + using namespace std; + fprintf(stderr, "FATAL: Thread terminated while holding a mutex."); + terminate(); + } +#endif + if ((ret != kWaitObject0) && (ret != kWaitAbandoned)) + { + __builtin_trap(); + } + } + void unlock() + { + if (!ReleaseMutex(mHandle)) + __builtin_trap(); + } + bool try_lock() + { + return try_lock_internal(0); + } + template <class Rep, class Period> + bool try_lock_for(const std::chrono::duration<Rep,Period>& dur) + { + using namespace std::chrono; + auto timeout = duration_cast<milliseconds>(dur).count(); + while (timeout > 0) + { + constexpr auto kMaxStep = static_cast<decltype(timeout)>(kInfinite-1); + auto step = (timeout < kMaxStep) ? timeout : kMaxStep; + if (try_lock_internal(static_cast<DWORD>(step))) + return true; + timeout -= step; + } + return false; + } + template <class Clock, class Duration> + bool try_lock_until(const std::chrono::time_point<Clock,Duration>& timeout_time) + { + return try_lock_for(timeout_time - Clock::now()); + } +}; + +// Override if, and only if, it is necessary for error-checking. +#if STDMUTEX_RECURSION_CHECKS +class timed_mutex: recursive_timed_mutex +{ +public: + timed_mutex() = default; + timed_mutex(const timed_mutex&) = delete; + timed_mutex& operator=(const timed_mutex&) = delete; + void lock() + { + DWORD self = mOwnerThread.checkOwnerBeforeLock(); + recursive_timed_mutex::lock(); + mOwnerThread.setOwnerAfterLock(self); + } + void unlock() + { + mOwnerThread.checkSetOwnerBeforeUnlock(); + recursive_timed_mutex::unlock(); + } + template <class Rep, class Period> + bool try_lock_for(const std::chrono::duration<Rep,Period>& dur) + { + DWORD self = mOwnerThread.checkOwnerBeforeLock(); + bool ret = recursive_timed_mutex::try_lock_for(dur); + if (ret) + mOwnerThread.setOwnerAfterLock(self); + return ret; + } + template <class Clock, class Duration> + bool try_lock_until(const std::chrono::time_point<Clock,Duration>& timeout_time) + { + return try_lock_for(timeout_time - Clock::now()); + } + bool try_lock () + { + return try_lock_for(std::chrono::milliseconds(0)); + } +}; +#else +typedef recursive_timed_mutex timed_mutex; +#endif + +class once_flag +{ +// When available, the SRW-based mutexes should be faster than the +// CriticalSection-based mutexes. Only try_lock will be unavailable in Vista, +// and try_lock is not used by once_flag. +#if (_WIN32_WINNT == _WIN32_WINNT_VISTA) + windows7::mutex mMutex; +#else + mutex mMutex; +#endif + std::atomic_bool mHasRun; + once_flag(const once_flag&) = delete; + once_flag& operator=(const once_flag&) = delete; + template<class Callable, class... Args> + friend void call_once(once_flag& once, Callable&& f, Args&&... args); +public: + constexpr once_flag() noexcept: mMutex(), mHasRun(false) {} +}; + +template<class Callable, class... Args> +void call_once(once_flag& flag, Callable&& func, Args&&... args) +{ + if (flag.mHasRun.load(std::memory_order_acquire)) + return; + lock_guard<decltype(flag.mMutex)> lock(flag.mMutex); + if (flag.mHasRun.load(std::memory_order_relaxed)) + return; + detail::invoke(std::forward<Callable>(func),std::forward<Args>(args)...); + flag.mHasRun.store(true, std::memory_order_release); +} +} // Namespace mingw_stdthread + +// Push objects into std, but only if they are not already there. +namespace std +{ +// Because of quirks of the compiler, the common "using namespace std;" +// directive would flatten the namespaces and introduce ambiguity where there +// was none. Direct specification (std::), however, would be unaffected. +// Take the safe option, and include only in the presence of MinGW's win32 +// implementation. +#if defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) && !defined(__clang__) +using mingw_stdthread::recursive_mutex; +using mingw_stdthread::mutex; +using mingw_stdthread::recursive_timed_mutex; +using mingw_stdthread::timed_mutex; +using mingw_stdthread::once_flag; +using mingw_stdthread::call_once; +#elif !defined(MINGW_STDTHREAD_REDUNDANCY_WARNING) // Skip repetition +#define MINGW_STDTHREAD_REDUNDANCY_WARNING +#pragma message "This version of MinGW seems to include a win32 port of\ + pthreads, and probably already has C++11 std threading classes implemented,\ + based on pthreads. These classes, found in namespace std, are not overridden\ + by the mingw-std-thread library. If you would still like to use this\ + implementation (as it is more lightweight), use the classes provided in\ + namespace mingw_stdthread." +#endif +} +#endif // WIN32STDMUTEX_H diff --git a/thirdparty/mingw-std-threads/mingw.shared_mutex.h b/thirdparty/mingw-std-threads/mingw.shared_mutex.h new file mode 100644 index 0000000000..ddc46bb826 --- /dev/null +++ b/thirdparty/mingw-std-threads/mingw.shared_mutex.h @@ -0,0 +1,503 @@ +/// \file mingw.shared_mutex.h +/// \brief Standard-compliant shared_mutex for MinGW +/// +/// (c) 2017 by Nathaniel J. McClatchey, Athens OH, United States +/// \author Nathaniel J. McClatchey +/// +/// \copyright Simplified (2-clause) BSD License. +/// +/// \note This file may become part of the mingw-w64 runtime package. If/when +/// this happens, the appropriate license will be added, i.e. this code will +/// become dual-licensed, and the current BSD 2-clause license will stay. +/// \note Target Windows version is determined by WINVER, which is determined in +/// <windows.h> from _WIN32_WINNT, which can itself be set by the user. + +// Notes on the namespaces: +// - The implementation can be accessed directly in the namespace +// mingw_stdthread. +// - Objects will be brought into namespace std by a using directive. This +// will cause objects declared in std (such as MinGW's implementation) to +// hide this implementation's definitions. +// - To avoid poluting the namespace with implementation details, all objects +// to be pushed into std will be placed in mingw_stdthread::visible. +// The end result is that if MinGW supplies an object, it is automatically +// used. If MinGW does not supply an object, this implementation's version will +// instead be used. + +#ifndef MINGW_SHARED_MUTEX_H_ +#define MINGW_SHARED_MUTEX_H_ + +#if !defined(__cplusplus) || (__cplusplus < 201103L) +#error A C++11 compiler is required! +#endif + +#include <cassert> +// For descriptive errors. +#include <system_error> +// Implementing a shared_mutex without OS support will require atomic read- +// modify-write capacity. +#include <atomic> +// For timing in shared_lock and shared_timed_mutex. +#include <chrono> +#include <limits> + +// Use MinGW's shared_lock class template, if it's available. Requires C++14. +// If unavailable (eg. because this library is being used in C++11), then an +// implementation of shared_lock is provided by this header. +#if (__cplusplus >= 201402L) +#include <shared_mutex> +#endif + +// For defer_lock_t, adopt_lock_t, and try_to_lock_t +#include "mingw.mutex.h" +// For this_thread::yield. +//#include "mingw.thread.h" + +// Might be able to use native Slim Reader-Writer (SRW) locks. +#ifdef _WIN32 +#include <sdkddkver.h> // Detect Windows version. +#if (defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)) +#pragma message "The Windows API that MinGW-w32 provides is not fully compatible\ + with Microsoft's API. We'll try to work around this, but we can make no\ + guarantees. This problem does not exist in MinGW-w64." +#include <windows.h> // No further granularity can be expected. +#else +#include <synchapi.h> +#endif +#endif + +namespace mingw_stdthread +{ +// Define a portable atomics-based shared_mutex +namespace portable +{ +class shared_mutex +{ + typedef uint_fast16_t counter_type; + std::atomic<counter_type> mCounter {0}; + static constexpr counter_type kWriteBit = 1 << (std::numeric_limits<counter_type>::digits - 1); + +#if STDMUTEX_RECURSION_CHECKS +// Runtime checker for verifying owner threads. Note: Exclusive mode only. + _OwnerThread mOwnerThread {}; +#endif +public: + typedef shared_mutex * native_handle_type; + + shared_mutex () = default; + +// No form of copying or moving should be allowed. + shared_mutex (const shared_mutex&) = delete; + shared_mutex & operator= (const shared_mutex&) = delete; + + ~shared_mutex () + { +// Terminate if someone tries to destroy an owned mutex. + assert(mCounter.load(std::memory_order_relaxed) == 0); + } + + void lock_shared (void) + { + counter_type expected = mCounter.load(std::memory_order_relaxed); + do + { +// Delay if writing or if too many readers are attempting to read. + if (expected >= kWriteBit - 1) + { + using namespace std; + expected = mCounter.load(std::memory_order_relaxed); + continue; + } + if (mCounter.compare_exchange_weak(expected, + static_cast<counter_type>(expected + 1), + std::memory_order_acquire, + std::memory_order_relaxed)) + break; + } + while (true); + } + + bool try_lock_shared (void) + { + counter_type expected = mCounter.load(std::memory_order_relaxed) & static_cast<counter_type>(~kWriteBit); + if (expected + 1 == kWriteBit) + return false; + else + return mCounter.compare_exchange_strong( expected, + static_cast<counter_type>(expected + 1), + std::memory_order_acquire, + std::memory_order_relaxed); + } + + void unlock_shared (void) + { + using namespace std; +#ifndef NDEBUG + if (!(mCounter.fetch_sub(1, memory_order_release) & static_cast<counter_type>(~kWriteBit))) + __builtin_trap(); +#else + mCounter.fetch_sub(1, memory_order_release); +#endif + } + +// Behavior is undefined if a lock was previously acquired. + void lock (void) + { +#if STDMUTEX_RECURSION_CHECKS + DWORD self = mOwnerThread.checkOwnerBeforeLock(); +#endif + using namespace std; +// Might be able to use relaxed memory order... +// Wait for the write-lock to be unlocked, then claim the write slot. + counter_type current; + while ((current = mCounter.fetch_or(kWriteBit, std::memory_order_acquire)) & kWriteBit); + //this_thread::yield(); +// Wait for readers to finish up. + while (current != kWriteBit) + { + //this_thread::yield(); + current = mCounter.load(std::memory_order_acquire); + } +#if STDMUTEX_RECURSION_CHECKS + mOwnerThread.setOwnerAfterLock(self); +#endif + } + + bool try_lock (void) + { +#if STDMUTEX_RECURSION_CHECKS + DWORD self = mOwnerThread.checkOwnerBeforeLock(); +#endif + counter_type expected = 0; + bool ret = mCounter.compare_exchange_strong(expected, kWriteBit, + std::memory_order_acquire, + std::memory_order_relaxed); +#if STDMUTEX_RECURSION_CHECKS + if (ret) + mOwnerThread.setOwnerAfterLock(self); +#endif + return ret; + } + + void unlock (void) + { +#if STDMUTEX_RECURSION_CHECKS + mOwnerThread.checkSetOwnerBeforeUnlock(); +#endif + using namespace std; +#ifndef NDEBUG + if (mCounter.load(memory_order_relaxed) != kWriteBit) + __builtin_trap(); +#endif + mCounter.store(0, memory_order_release); + } + + native_handle_type native_handle (void) + { + return this; + } +}; + +} // Namespace portable + +// The native shared_mutex implementation primarily uses features of Windows +// Vista, but the features used for try_lock and try_lock_shared were not +// introduced until Windows 7. To allow limited use while compiling for Vista, +// I define the class without try_* functions in that case. +// Only fully-featured implementations will be placed into namespace std. +#if defined(_WIN32) && (WINVER >= _WIN32_WINNT_VISTA) +namespace vista +{ +class condition_variable_any; +} + +namespace windows7 +{ +// We already #include "mingw.mutex.h". May as well reduce redundancy. +class shared_mutex : windows7::mutex +{ +// Allow condition_variable_any (and only condition_variable_any) to treat a +// shared_mutex as its base class. + friend class vista::condition_variable_any; +public: + using windows7::mutex::native_handle_type; + using windows7::mutex::lock; + using windows7::mutex::unlock; + using windows7::mutex::native_handle; + + void lock_shared (void) + { + AcquireSRWLockShared(native_handle()); + } + + void unlock_shared (void) + { + ReleaseSRWLockShared(native_handle()); + } + +// TryAcquireSRW functions are a Windows 7 feature. +#if (WINVER >= _WIN32_WINNT_WIN7) + bool try_lock_shared (void) + { + return TryAcquireSRWLockShared(native_handle()) != 0; + } + + using windows7::mutex::try_lock; +#endif +}; + +} // Namespace windows7 +#endif // Compiling for Vista +#if (defined(_WIN32) && (WINVER >= _WIN32_WINNT_WIN7)) +using windows7::shared_mutex; +#else +using portable::shared_mutex; +#endif + +class shared_timed_mutex : shared_mutex +{ + typedef shared_mutex Base; +public: + using Base::lock; + using Base::try_lock; + using Base::unlock; + using Base::lock_shared; + using Base::try_lock_shared; + using Base::unlock_shared; + + template< class Clock, class Duration > + bool try_lock_until ( const std::chrono::time_point<Clock,Duration>& cutoff ) + { + do + { + if (try_lock()) + return true; + } + while (std::chrono::steady_clock::now() < cutoff); + return false; + } + + template< class Rep, class Period > + bool try_lock_for (const std::chrono::duration<Rep,Period>& rel_time) + { + return try_lock_until(std::chrono::steady_clock::now() + rel_time); + } + + template< class Clock, class Duration > + bool try_lock_shared_until ( const std::chrono::time_point<Clock,Duration>& cutoff ) + { + do + { + if (try_lock_shared()) + return true; + } + while (std::chrono::steady_clock::now() < cutoff); + return false; + } + + template< class Rep, class Period > + bool try_lock_shared_for (const std::chrono::duration<Rep,Period>& rel_time) + { + return try_lock_shared_until(std::chrono::steady_clock::now() + rel_time); + } +}; + +#if __cplusplus >= 201402L +using std::shared_lock; +#else +// If not supplied by shared_mutex (eg. because C++14 is not supported), I +// supply the various helper classes that the header should have defined. +template<class Mutex> +class shared_lock +{ + Mutex * mMutex; + bool mOwns; +// Reduce code redundancy + void verify_lockable (void) + { + using namespace std; + if (mMutex == nullptr) + __builtin_trap(); + if (mOwns) + __builtin_trap(); + } +public: + typedef Mutex mutex_type; + + shared_lock (void) noexcept + : mMutex(nullptr), mOwns(false) + { + } + + shared_lock (shared_lock<Mutex> && other) noexcept + : mMutex(other.mutex_), mOwns(other.owns_) + { + other.mMutex = nullptr; + other.mOwns = false; + } + + explicit shared_lock (mutex_type & m) + : mMutex(&m), mOwns(true) + { + mMutex->lock_shared(); + } + + shared_lock (mutex_type & m, defer_lock_t) noexcept + : mMutex(&m), mOwns(false) + { + } + + shared_lock (mutex_type & m, adopt_lock_t) + : mMutex(&m), mOwns(true) + { + } + + shared_lock (mutex_type & m, try_to_lock_t) + : mMutex(&m), mOwns(m.try_lock_shared()) + { + } + + template< class Rep, class Period > + shared_lock( mutex_type& m, const std::chrono::duration<Rep,Period>& timeout_duration ) + : mMutex(&m), mOwns(m.try_lock_shared_for(timeout_duration)) + { + } + + template< class Clock, class Duration > + shared_lock( mutex_type& m, const std::chrono::time_point<Clock,Duration>& timeout_time ) + : mMutex(&m), mOwns(m.try_lock_shared_until(timeout_time)) + { + } + + shared_lock& operator= (shared_lock<Mutex> && other) noexcept + { + if (&other != this) + { + if (mOwns) + mMutex->unlock_shared(); + mMutex = other.mMutex; + mOwns = other.mOwns; + other.mMutex = nullptr; + other.mOwns = false; + } + return *this; + } + + + ~shared_lock (void) + { + if (mOwns) + mMutex->unlock_shared(); + } + + shared_lock (const shared_lock<Mutex> &) = delete; + shared_lock& operator= (const shared_lock<Mutex> &) = delete; + +// Shared locking + void lock (void) + { + verify_lockable(); + mMutex->lock_shared(); + mOwns = true; + } + + bool try_lock (void) + { + verify_lockable(); + mOwns = mMutex->try_lock_shared(); + return mOwns; + } + + template< class Clock, class Duration > + bool try_lock_until( const std::chrono::time_point<Clock,Duration>& cutoff ) + { + verify_lockable(); + do + { + mOwns = mMutex->try_lock_shared(); + if (mOwns) + return mOwns; + } + while (std::chrono::steady_clock::now() < cutoff); + return false; + } + + template< class Rep, class Period > + bool try_lock_for (const std::chrono::duration<Rep,Period>& rel_time) + { + return try_lock_until(std::chrono::steady_clock::now() + rel_time); + } + + void unlock (void) + { + using namespace std; + if (!mOwns) + __builtin_trap(); + mMutex->unlock_shared(); + mOwns = false; + } + +// Modifiers + void swap (shared_lock<Mutex> & other) noexcept + { + using namespace std; + swap(mMutex, other.mMutex); + swap(mOwns, other.mOwns); + } + + mutex_type * release (void) noexcept + { + mutex_type * ptr = mMutex; + mMutex = nullptr; + mOwns = false; + return ptr; + } +// Observers + mutex_type * mutex (void) const noexcept + { + return mMutex; + } + + bool owns_lock (void) const noexcept + { + return mOwns; + } + + explicit operator bool () const noexcept + { + return owns_lock(); + } +}; + +template< class Mutex > +void swap( shared_lock<Mutex>& lhs, shared_lock<Mutex>& rhs ) noexcept +{ + lhs.swap(rhs); +} +#endif // C++11 +} // Namespace mingw_stdthread + +namespace std +{ +// Because of quirks of the compiler, the common "using namespace std;" +// directive would flatten the namespaces and introduce ambiguity where there +// was none. Direct specification (std::), however, would be unaffected. +// Take the safe option, and include only in the presence of MinGW's win32 +// implementation. +#if (__cplusplus < 201703L) || (defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) && !defined(__clang__)) +using mingw_stdthread::shared_mutex; +#endif +#if (__cplusplus < 201402L) || (defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) && !defined(__clang__)) +using mingw_stdthread::shared_timed_mutex; +using mingw_stdthread::shared_lock; +#elif !defined(MINGW_STDTHREAD_REDUNDANCY_WARNING) // Skip repetition +#define MINGW_STDTHREAD_REDUNDANCY_WARNING +#pragma message "This version of MinGW seems to include a win32 port of\ + pthreads, and probably already has C++ std threading classes implemented,\ + based on pthreads. These classes, found in namespace std, are not overridden\ + by the mingw-std-thread library. If you would still like to use this\ + implementation (as it is more lightweight), use the classes provided in\ + namespace mingw_stdthread." +#endif +} // Namespace std +#endif // MINGW_SHARED_MUTEX_H_ diff --git a/thirdparty/mingw-std-threads/mingw.thread.h b/thirdparty/mingw-std-threads/mingw.thread.h new file mode 100644 index 0000000000..60d2200db2 --- /dev/null +++ b/thirdparty/mingw-std-threads/mingw.thread.h @@ -0,0 +1,359 @@ +/** +* @file mingw.thread.h +* @brief std::thread implementation for MinGW +* (c) 2013-2016 by Mega Limited, Auckland, New Zealand +* @author Alexander Vassilev +* +* @copyright Simplified (2-clause) BSD License. +* You should have received a copy of the license along with this +* program. +* +* This code is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +* @note +* This file may become part of the mingw-w64 runtime package. If/when this happens, +* the appropriate license will be added, i.e. this code will become dual-licensed, +* and the current BSD 2-clause license will stay. +*/ + +#ifndef WIN32STDTHREAD_H +#define WIN32STDTHREAD_H + +#if !defined(__cplusplus) || (__cplusplus < 201103L) +#error A C++11 compiler is required! +#endif + +// Use the standard classes for std::, if available. +#include <thread> + +#include <cstddef> // For std::size_t +#include <cerrno> // Detect error type. +#include <exception> // For std::terminate +#include <system_error> // For std::system_error +#include <functional> // For std::hash +#include <tuple> // For std::tuple +#include <chrono> // For sleep timing. +#include <memory> // For std::unique_ptr +#include <iosfwd> // Stream output for thread ids. +#include <utility> // For std::swap, std::forward + +#include "mingw.invoke.h" + +#if (defined(__MINGW32__) && !defined(__MINGW64_VERSION_MAJOR)) +#pragma message "The Windows API that MinGW-w32 provides is not fully compatible\ + with Microsoft's API. We'll try to work around this, but we can make no\ + guarantees. This problem does not exist in MinGW-w64." +#include <windows.h> // No further granularity can be expected. +#else +#include <synchapi.h> // For WaitForSingleObject +#include <handleapi.h> // For CloseHandle, etc. +#include <sysinfoapi.h> // For GetNativeSystemInfo +#include <processthreadsapi.h> // For GetCurrentThreadId +#endif +#include <process.h> // For _beginthreadex + +#ifndef NDEBUG +#include <cstdio> +#endif + +#if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0501) +#error To use the MinGW-std-threads library, you will need to define the macro _WIN32_WINNT to be 0x0501 (Windows XP) or higher. +#endif + +// Instead of INVALID_HANDLE_VALUE, _beginthreadex returns 0. +namespace mingw_stdthread +{ +namespace detail +{ + template<std::size_t...> + struct IntSeq {}; + + template<std::size_t N, std::size_t... S> + struct GenIntSeq : GenIntSeq<N-1, N-1, S...> { }; + + template<std::size_t... S> + struct GenIntSeq<0, S...> { typedef IntSeq<S...> type; }; + +// Use a template specialization to avoid relying on compiler optimization +// when determining the parameter integer sequence. + template<class Func, class T, typename... Args> + class ThreadFuncCall; +// We can't define the Call struct in the function - the standard forbids template methods in that case + template<class Func, std::size_t... S, typename... Args> + class ThreadFuncCall<Func, detail::IntSeq<S...>, Args...> + { + static_assert(sizeof...(S) == sizeof...(Args), "Args must match."); + using Tuple = std::tuple<typename std::decay<Args>::type...>; + typename std::decay<Func>::type mFunc; + Tuple mArgs; + + public: + ThreadFuncCall(Func&& aFunc, Args&&... aArgs) + : mFunc(std::forward<Func>(aFunc)), + mArgs(std::forward<Args>(aArgs)...) + { + } + + void callFunc() + { + detail::invoke(std::move(mFunc), std::move(std::get<S>(mArgs)) ...); + } + }; + +// Allow construction of threads without exposing implementation. + class ThreadIdTool; +} // Namespace "detail" + +class thread +{ +public: + class id + { + DWORD mId = 0; + friend class thread; + friend class std::hash<id>; + friend class detail::ThreadIdTool; + explicit id(DWORD aId) noexcept : mId(aId){} + public: + id (void) noexcept = default; + friend bool operator==(id x, id y) noexcept {return x.mId == y.mId; } + friend bool operator!=(id x, id y) noexcept {return x.mId != y.mId; } + friend bool operator< (id x, id y) noexcept {return x.mId < y.mId; } + friend bool operator<=(id x, id y) noexcept {return x.mId <= y.mId; } + friend bool operator> (id x, id y) noexcept {return x.mId > y.mId; } + friend bool operator>=(id x, id y) noexcept {return x.mId >= y.mId; } + + template<class _CharT, class _Traits> + friend std::basic_ostream<_CharT, _Traits>& + operator<<(std::basic_ostream<_CharT, _Traits>& __out, id __id) + { + if (__id.mId == 0) + { + return __out << "(invalid std::thread::id)"; + } + else + { + return __out << __id.mId; + } + } + }; +private: + static constexpr HANDLE kInvalidHandle = nullptr; + static constexpr DWORD kInfinite = 0xffffffffl; + HANDLE mHandle; + id mThreadId; + + template <class Call> + static unsigned __stdcall threadfunc(void* arg) + { + std::unique_ptr<Call> call(static_cast<Call*>(arg)); + call->callFunc(); + return 0; + } + + static unsigned int _hardware_concurrency_helper() noexcept + { + SYSTEM_INFO sysinfo; +// This is one of the few functions used by the library which has a nearly- +// equivalent function defined in earlier versions of Windows. Include the +// workaround, just as a reminder that it does exist. +#if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0501) + ::GetNativeSystemInfo(&sysinfo); +#else + ::GetSystemInfo(&sysinfo); +#endif + return sysinfo.dwNumberOfProcessors; + } +public: + typedef HANDLE native_handle_type; + id get_id() const noexcept {return mThreadId;} + native_handle_type native_handle() const {return mHandle;} + thread(): mHandle(kInvalidHandle), mThreadId(){} + + thread(thread&& other) + :mHandle(other.mHandle), mThreadId(other.mThreadId) + { + other.mHandle = kInvalidHandle; + other.mThreadId = id{}; + } + + thread(const thread &other)=delete; + + template<class Func, typename... Args> + explicit thread(Func&& func, Args&&... args) : mHandle(), mThreadId() + { + using ArgSequence = typename detail::GenIntSeq<sizeof...(Args)>::type; + using Call = detail::ThreadFuncCall<Func, ArgSequence, Args...>; + auto call = new Call( + std::forward<Func>(func), std::forward<Args>(args)...); + unsigned id_receiver; + auto int_handle = _beginthreadex(NULL, 0, threadfunc<Call>, + static_cast<LPVOID>(call), 0, &id_receiver); + if (int_handle == 0) + { + mHandle = kInvalidHandle; + delete call; +// Note: Should only throw EINVAL, EAGAIN, EACCES + __builtin_trap(); + } else { + mThreadId.mId = id_receiver; + mHandle = reinterpret_cast<HANDLE>(int_handle); + } + } + + bool joinable() const {return mHandle != kInvalidHandle;} + +// Note: Due to lack of synchronization, this function has a race condition +// if called concurrently, which leads to undefined behavior. The same applies +// to all other member functions of this class, but this one is mentioned +// explicitly. + void join() + { + using namespace std; + if (get_id() == id(GetCurrentThreadId())) + __builtin_trap(); + if (mHandle == kInvalidHandle) + __builtin_trap(); + if (!joinable()) + __builtin_trap(); + WaitForSingleObject(mHandle, kInfinite); + CloseHandle(mHandle); + mHandle = kInvalidHandle; + mThreadId = id{}; + } + + ~thread() + { + if (joinable()) + { +#ifndef NDEBUG + std::printf("Error: Must join() or detach() a thread before \ +destroying it.\n"); +#endif + std::terminate(); + } + } + thread& operator=(const thread&) = delete; + thread& operator=(thread&& other) noexcept + { + if (joinable()) + { +#ifndef NDEBUG + std::printf("Error: Must join() or detach() a thread before \ +moving another thread to it.\n"); +#endif + std::terminate(); + } + swap(std::forward<thread>(other)); + return *this; + } + void swap(thread&& other) noexcept + { + std::swap(mHandle, other.mHandle); + std::swap(mThreadId.mId, other.mThreadId.mId); + } + + static unsigned int hardware_concurrency() noexcept + { + static unsigned int cached = _hardware_concurrency_helper(); + return cached; + } + + void detach() + { + if (!joinable()) + { + using namespace std; + __builtin_trap(); + } + if (mHandle != kInvalidHandle) + { + CloseHandle(mHandle); + mHandle = kInvalidHandle; + } + mThreadId = id{}; + } +}; + +namespace detail +{ + class ThreadIdTool + { + public: + static thread::id make_id (DWORD base_id) noexcept + { + return thread::id(base_id); + } + }; +} // Namespace "detail" + +namespace this_thread +{ + inline thread::id get_id() noexcept + { + return detail::ThreadIdTool::make_id(GetCurrentThreadId()); + } + inline void yield() noexcept {Sleep(0);} + template< class Rep, class Period > + void sleep_for( const std::chrono::duration<Rep,Period>& sleep_duration) + { + static constexpr DWORD kInfinite = 0xffffffffl; + using namespace std::chrono; + using rep = milliseconds::rep; + rep ms = duration_cast<milliseconds>(sleep_duration).count(); + while (ms > 0) + { + constexpr rep kMaxRep = static_cast<rep>(kInfinite - 1); + auto sleepTime = (ms < kMaxRep) ? ms : kMaxRep; + Sleep(static_cast<DWORD>(sleepTime)); + ms -= sleepTime; + } + } + template <class Clock, class Duration> + void sleep_until(const std::chrono::time_point<Clock,Duration>& sleep_time) + { + sleep_for(sleep_time-Clock::now()); + } +} +} // Namespace mingw_stdthread + +namespace std +{ +// Because of quirks of the compiler, the common "using namespace std;" +// directive would flatten the namespaces and introduce ambiguity where there +// was none. Direct specification (std::), however, would be unaffected. +// Take the safe option, and include only in the presence of MinGW's win32 +// implementation. +#if defined(__MINGW32__ ) && !defined(_GLIBCXX_HAS_GTHREADS) && !defined(__clang__) +using mingw_stdthread::thread; +// Remove ambiguity immediately, to avoid problems arising from the above. +//using std::thread; +namespace this_thread +{ +using namespace mingw_stdthread::this_thread; +} +#elif !defined(MINGW_STDTHREAD_REDUNDANCY_WARNING) // Skip repetition +#define MINGW_STDTHREAD_REDUNDANCY_WARNING +#pragma message "This version of MinGW seems to include a win32 port of\ + pthreads, and probably already has C++11 std threading classes implemented,\ + based on pthreads. These classes, found in namespace std, are not overridden\ + by the mingw-std-thread library. If you would still like to use this\ + implementation (as it is more lightweight), use the classes provided in\ + namespace mingw_stdthread." +#endif + +// Specialize hash for this implementation's thread::id, even if the +// std::thread::id already has a hash. +template<> +struct hash<mingw_stdthread::thread::id> +{ + typedef mingw_stdthread::thread::id argument_type; + typedef size_t result_type; + size_t operator() (const argument_type & i) const noexcept + { + return i.mId; + } +}; +} +#endif // WIN32STDTHREAD_H diff --git a/thirdparty/minizip/patches/CVE-2023-45853.patch b/thirdparty/minizip/patches/CVE-2023-45853.patch new file mode 100644 index 0000000000..784c57766f --- /dev/null +++ b/thirdparty/minizip/patches/CVE-2023-45853.patch @@ -0,0 +1,36 @@ +From 73331a6a0481067628f065ffe87bb1d8f787d10c Mon Sep 17 00:00:00 2001 +From: Hans Wennborg <hans@chromium.org> +Date: Fri, 18 Aug 2023 11:05:33 +0200 +Subject: [PATCH] Reject overflows of zip header fields in minizip. + +This checks the lengths of the file name, extra field, and comment +that would be put in the zip headers, and rejects them if they are +too long. They are each limited to 65535 bytes in length by the zip +format. This also avoids possible buffer overflows if the provided +fields are too long. +--- + contrib/minizip/zip.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/contrib/minizip/zip.c b/contrib/minizip/zip.c +index 3d3d4cadd..0446109b2 100644 +--- a/contrib/minizip/zip.c ++++ b/contrib/minizip/zip.c +@@ -1043,6 +1043,17 @@ extern int ZEXPORT zipOpenNewFileInZip4_64(zipFile file, const char* filename, c + return ZIP_PARAMERROR; + #endif + ++ // The filename and comment length must fit in 16 bits. ++ if ((filename!=NULL) && (strlen(filename)>0xffff)) ++ return ZIP_PARAMERROR; ++ if ((comment!=NULL) && (strlen(comment)>0xffff)) ++ return ZIP_PARAMERROR; ++ // The extra field length must fit in 16 bits. If the member also requires ++ // a Zip64 extra block, that will also need to fit within that 16-bit ++ // length, but that will be checked for later. ++ if ((size_extrafield_local>0xffff) || (size_extrafield_global>0xffff)) ++ return ZIP_PARAMERROR; ++ + zi = (zip64_internal*)file; + + if (zi->in_opened_file_inzip == 1) diff --git a/thirdparty/minizip/zip.c b/thirdparty/minizip/zip.c index e859f9e42f..d76c643dfb 100644 --- a/thirdparty/minizip/zip.c +++ b/thirdparty/minizip/zip.c @@ -1045,6 +1045,17 @@ extern int ZEXPORT zipOpenNewFileInZip4_64(zipFile file, const char* filename, c return ZIP_PARAMERROR; #endif + // The filename and comment length must fit in 16 bits. + if ((filename!=NULL) && (strlen(filename)>0xffff)) + return ZIP_PARAMERROR; + if ((comment!=NULL) && (strlen(comment)>0xffff)) + return ZIP_PARAMERROR; + // The extra field length must fit in 16 bits. If the member also requires + // a Zip64 extra block, that will also need to fit within that 16-bit + // length, but that will be checked for later. + if ((size_extrafield_local>0xffff) || (size_extrafield_global>0xffff)) + return ZIP_PARAMERROR; + zi = (zip64_internal*)file; if (zi->in_opened_file_inzip == 1) diff --git a/thirdparty/squish/colourblock.cpp b/thirdparty/squish/colourblock.cpp index 3d87adaa77..f14c9362bd 100644 --- a/thirdparty/squish/colourblock.cpp +++ b/thirdparty/squish/colourblock.cpp @@ -24,9 +24,9 @@ -------------------------------------------------------------------------- */ #include "colourblock.h" -// -- Godot start -- +// -- GODOT start -- #include "alpha.h" -// -- Godot end -- +// -- GODOT end -- namespace squish { @@ -214,7 +214,18 @@ void DecompressColour( u8* rgba, void const* block, bool isDxt1 ) } } -// -- Godot start -- +// -- GODOT start -- +void DecompressColourBc4( u8* rgba, void const* block) +{ + DecompressAlphaDxt5(rgba,block); + for ( int i = 0; i < 16; ++i ) { + rgba[i*4] = rgba[i*4 + 3]; + rgba[i*4 + 1] = 0; + rgba[i*4 + 2] = 0; + rgba[i*4 + 3] = 255; + } +} + void DecompressColourBc5( u8* rgba, void const* block) { void const* rblock = block; diff --git a/thirdparty/squish/colourblock.h b/thirdparty/squish/colourblock.h index 3cb9b7e3b9..e1eb9e4917 100644 --- a/thirdparty/squish/colourblock.h +++ b/thirdparty/squish/colourblock.h @@ -36,6 +36,7 @@ void WriteColourBlock4( Vec3::Arg start, Vec3::Arg end, u8 const* indices, void* void DecompressColour( u8* rgba, void const* block, bool isDxt1 ); // -- GODOT start -- +void DecompressColourBc4( u8* rgba, void const* block ); void DecompressColourBc5( u8* rgba, void const* block ); // -- GODOT end -- diff --git a/thirdparty/squish/godot-changes.patch b/thirdparty/squish/godot-changes.patch index ef7bafb4b4..555fbc51d0 100644 --- a/thirdparty/squish/godot-changes.patch +++ b/thirdparty/squish/godot-changes.patch @@ -100,3 +100,112 @@ index 1d22a64ad..fd11a147d 100644 // decompress alpha separately if necessary if( ( flags & kDxt3 ) != 0 ) + +diff --git a/thirdparty/squish/colourblock.cpp b/thirdparty/squish/colourblock.cpp +index 49401358bc..f14c9362bd 100644 +--- a/thirdparty/squish/colourblock.cpp ++++ b/thirdparty/squish/colourblock.cpp +@@ -24,9 +24,9 @@ + -------------------------------------------------------------------------- */ + + #include "colourblock.h" +-// -- Godot start -- ++// -- GODOT start -- + #include "alpha.h" +-// -- Godot end -- ++// -- GODOT end -- + + namespace squish { + +diff --git a/thirdparty/squish/godot-changes.patch b/thirdparty/squish/godot-changes.patch +index ef7bafb4b4..655a8cffc2 100644 +--- a/thirdparty/squish/godot-changes.patch ++++ b/thirdparty/squish/godot-changes.patch +@@ -1,22 +1,33 @@ + diff --git a/thirdparty/squish/colourblock.cpp b/thirdparty/squish/colourblock.cpp +-index af8b98036..3d87adaa7 100644 ++index af8b980365..f14c9362bd 100644 + --- a/thirdparty/squish/colourblock.cpp + +++ b/thirdparty/squish/colourblock.cpp + @@ -24,6 +24,9 @@ + -------------------------------------------------------------------------- */ + + #include "colourblock.h" +-+// -- Godot start -- +++// -- GODOT start -- + +#include "alpha.h" +-+// -- Godot end -- +++// -- GODOT end -- + + namespace squish { + +-@@ -211,4 +214,23 @@ void DecompressColour( u8* rgba, void const* block, bool isDxt1 ) ++@@ -211,4 +214,34 @@ void DecompressColour( u8* rgba, void const* block, bool isDxt1 ) + } + } + +-+// -- Godot start -- +++// -- GODOT start -- +++void DecompressColourBc4( u8* rgba, void const* block) +++{ +++ DecompressAlphaDxt5(rgba,block); +++ for ( int i = 0; i < 16; ++i ) { +++ rgba[i*4] = rgba[i*4 + 3]; +++ rgba[i*4 + 1] = 0; +++ rgba[i*4 + 2] = 0; +++ rgba[i*4 + 3] = 255; +++ } +++} +++ + +void DecompressColourBc5( u8* rgba, void const* block) + +{ + + void const* rblock = block; +@@ -37,21 +48,22 @@ index af8b98036..3d87adaa7 100644 + + + } // namespace squish + diff --git a/thirdparty/squish/colourblock.h b/thirdparty/squish/colourblock.h +-index fee2cd7c5..3cb9b7e3b 100644 ++index fee2cd7c5d..e1eb9e4917 100644 + --- a/thirdparty/squish/colourblock.h + +++ b/thirdparty/squish/colourblock.h +-@@ -35,6 +35,9 @@ void WriteColourBlock3( Vec3::Arg start, Vec3::Arg end, u8 const* indices, void* ++@@ -35,6 +35,10 @@ void WriteColourBlock3( Vec3::Arg start, Vec3::Arg end, u8 const* indices, void* + void WriteColourBlock4( Vec3::Arg start, Vec3::Arg end, u8 const* indices, void* block ); + + void DecompressColour( u8* rgba, void const* block, bool isDxt1 ); + +// -- GODOT start -- +++void DecompressColourBc4( u8* rgba, void const* block ); + +void DecompressColourBc5( u8* rgba, void const* block ); + +// -- GODOT end -- + + } // namespace squish + + diff --git a/thirdparty/squish/config.h b/thirdparty/squish/config.h +-index 92edefe96..05f8d7259 100644 ++index 92edefe966..05f8d72598 100644 + --- a/thirdparty/squish/config.h + +++ b/thirdparty/squish/config.h + @@ -32,6 +32,26 @@ +@@ -82,17 +94,19 @@ index 92edefe96..05f8d7259 100644 + #define SQUISH_USE_SSE 0 + #endif + diff --git a/thirdparty/squish/squish.cpp b/thirdparty/squish/squish.cpp +-index 1d22a64ad..fd11a147d 100644 ++index 1d22a64ad6..086ba11cd0 100644 + --- a/thirdparty/squish/squish.cpp + +++ b/thirdparty/squish/squish.cpp +-@@ -135,7 +135,13 @@ void Decompress( u8* rgba, void const* block, int flags ) ++@@ -135,7 +135,15 @@ void Decompress( u8* rgba, void const* block, int flags ) + colourBlock = reinterpret_cast< u8 const* >( block ) + 8; + + // decompress colour + - DecompressColour( rgba, colourBlock, ( flags & kDxt1 ) != 0 ); + + // -- GODOT start -- + + //DecompressColour( rgba, colourBlock, ( flags & kDxt1 ) != 0 ); +-+ if(( flags & ( kBc5 ) ) != 0) +++ if(( flags & ( kBc4 ) ) != 0) +++ DecompressColourBc4( rgba, colourBlock); +++ else if(( flags & ( kBc5 ) ) != 0) + + DecompressColourBc5( rgba, colourBlock); + + else + + DecompressColour( rgba, colourBlock, ( flags & kDxt1 ) != 0 );
\ No newline at end of file diff --git a/thirdparty/squish/squish.cpp b/thirdparty/squish/squish.cpp index fd11a147de..1de1da3e52 100644 --- a/thirdparty/squish/squish.cpp +++ b/thirdparty/squish/squish.cpp @@ -137,7 +137,9 @@ void Decompress( u8* rgba, void const* block, int flags ) // decompress colour // -- GODOT start -- //DecompressColour( rgba, colourBlock, ( flags & kDxt1 ) != 0 ); - if(( flags & ( kBc5 ) ) != 0) + if(( flags & ( kBc4 ) ) != 0) + DecompressColourBc4( rgba, colourBlock); + else if(( flags & ( kBc5 ) ) != 0) DecompressColourBc5( rgba, colourBlock); else DecompressColour( rgba, colourBlock, ( flags & kDxt1 ) != 0 ); diff --git a/version.py b/version.py index 61870c5bcd..99e56eca90 100644 --- a/version.py +++ b/version.py @@ -1,9 +1,9 @@ short_name = "godot" name = "Godot Engine" major = 4 -minor = 2 +minor = 3 patch = 0 -status = "beta" +status = "dev" module_config = "" year = 2023 website = "https://godotengine.org" |