|
218 | 218 | <param index="6" name="clear_depth" type="float" default="1.0" />
|
219 | 219 | <param index="7" name="clear_stencil" type="int" default="0" />
|
220 | 220 | <param index="8" name="region" type="Rect2" default="Rect2(0, 0, 0, 0)" />
|
| 221 | + <param index="9" name="breadcrumb" type="int" default="0" /> |
221 | 222 | <description>
|
222 | 223 | Starts a list of raster drawing commands created with the [code]draw_*[/code] methods. The returned value should be passed to other [code]draw_list_*[/code] functions.
|
223 | 224 | Multiple draw lists cannot be created at the same time; you must finish the previous draw list first using [method draw_list_end].
|
224 | 225 | A simple drawing operation might look like this (code is not a complete example):
|
225 | 226 | [codeblock]
|
226 | 227 | var rd = RenderingDevice.new()
|
227 | 228 | var clear_colors = PackedColorArray([Color(0, 0, 0, 0), Color(0, 0, 0, 0), Color(0, 0, 0, 0)])
|
228 |
| - var draw_list = rd.draw_list_begin(framebuffers[i], RenderingDevice.INITIAL_ACTION_CLEAR, RenderingDevice.FINAL_ACTION_READ, RenderingDevice.INITIAL_ACTION_CLEAR, RenderingDevice.FINAL_ACTION_DISCARD, clear_colors) |
| 229 | + var draw_list = rd.draw_list_begin(framebuffers[i], RenderingDevice.INITIAL_ACTION_CLEAR, RenderingDevice.FINAL_ACTION_READ, RenderingDevice.INITIAL_ACTION_CLEAR, RenderingDevice.FINAL_ACTION_DISCARD, clear_colors, RenderingDevice.OPAQUE_PASS) |
229 | 230 |
|
230 | 231 | # Draw opaque.
|
231 | 232 | rd.draw_list_bind_render_pipeline(draw_list, raster_pipeline)
|
|
240 | 241 |
|
241 | 242 | rd.draw_list_end()
|
242 | 243 | [/codeblock]
|
| 244 | + The [param breadcrumb] parameter can be an arbitrary 32-bit integer that is useful to diagnose GPU crashes. If Godot is built in dev or debug mode; when the GPU crashes Godot will dump all shaders that were being executed at the time of the crash and the breadcrumb is useful to diagnose what passes did those shaders belong to. |
| 245 | + It does not affect rendering behavior and can be set to 0. It is recommended to use [enum BreadcrumbMarker] enumerations for consistency but it's not required. It is also possible to use bitwise operations to add extra data. e.g. |
| 246 | + [codeblock] |
| 247 | + rd.draw_list_begin(fb[i], RenderingDevice.INITIAL_ACTION_CLEAR, RenderingDevice.FINAL_ACTION_READ, RenderingDevice.INITIAL_ACTION_CLEAR, RenderingDevice.FINAL_ACTION_DISCARD, clear_colors, RenderingDevice.OPAQUE_PASS | 5) |
| 248 | + [/codeblock] |
243 | 249 | </description>
|
244 | 250 | </method>
|
245 | 251 | <method name="draw_list_begin_for_screen">
|
|
487 | 493 | Returns the index of the last frame rendered that has rendering timestamps available for querying.
|
488 | 494 | </description>
|
489 | 495 | </method>
|
| 496 | + <method name="get_device_allocation_count" qualifiers="const"> |
| 497 | + <return type="int" /> |
| 498 | + <description> |
| 499 | + Returns how many allocations the GPU has performed for internal driver structures. |
| 500 | + This is only used by Vulkan in Debug builds and can return 0 when this information is not tracked or unknown. |
| 501 | + </description> |
| 502 | + </method> |
| 503 | + <method name="get_device_allocs_by_object_type" qualifiers="const"> |
| 504 | + <return type="int" /> |
| 505 | + <param index="0" name="type" type="int" /> |
| 506 | + <description> |
| 507 | + Same as [method get_device_allocation_count] but filtered for a given object type. |
| 508 | + The type argument must be in range [code][0; get_tracked_object_type_count - 1][/code]. If [method get_tracked_object_type_count] is 0, then type argument is ignored and always returns 0. |
| 509 | + This is only used by Vulkan in Debug builds and can return 0 when this information is not tracked or unknown. |
| 510 | + </description> |
| 511 | + </method> |
| 512 | + <method name="get_device_memory_by_object_type" qualifiers="const"> |
| 513 | + <return type="int" /> |
| 514 | + <param index="0" name="type" type="int" /> |
| 515 | + <description> |
| 516 | + Same as [method get_device_total_memory] but filtered for a given object type. |
| 517 | + The type argument must be in range [code][0; get_tracked_object_type_count - 1][/code]. If [method get_tracked_object_type_count] is 0, then type argument is ignored and always returns 0. |
| 518 | + This is only used by Vulkan in Debug builds and can return 0 when this information is not tracked or unknown. |
| 519 | + </description> |
| 520 | + </method> |
490 | 521 | <method name="get_device_name" qualifiers="const">
|
491 | 522 | <return type="String" />
|
492 | 523 | <description>
|
|
499 | 530 | Returns the universally unique identifier for the pipeline cache. This is used to cache shader files on disk, which avoids shader recompilations on subsequent engine runs. This UUID varies depending on the graphics card model, but also the driver version. Therefore, updating graphics drivers will invalidate the shader cache.
|
500 | 531 | </description>
|
501 | 532 | </method>
|
| 533 | + <method name="get_device_total_memory" qualifiers="const"> |
| 534 | + <return type="int" /> |
| 535 | + <description> |
| 536 | + Returns how much bytes the GPU is using. |
| 537 | + This is only used by Vulkan in Debug builds and can return 0 when this information is not tracked or unknown. |
| 538 | + </description> |
| 539 | + </method> |
502 | 540 | <method name="get_device_vendor_name" qualifiers="const">
|
503 | 541 | <return type="String" />
|
504 | 542 | <description>
|
505 | 543 | Returns the vendor of the video adapter (e.g. "NVIDIA Corporation"). Equivalent to [method RenderingServer.get_video_adapter_vendor]. See also [method get_device_name].
|
506 | 544 | </description>
|
507 | 545 | </method>
|
| 546 | + <method name="get_driver_allocation_count" qualifiers="const"> |
| 547 | + <return type="int" /> |
| 548 | + <description> |
| 549 | + Returns how many allocations the GPU driver has performed for internal driver structures. |
| 550 | + This is only used by Vulkan in Debug builds and can return 0 when this information is not tracked or unknown. |
| 551 | + </description> |
| 552 | + </method> |
| 553 | + <method name="get_driver_allocs_by_object_type" qualifiers="const"> |
| 554 | + <return type="int" /> |
| 555 | + <param index="0" name="type" type="int" /> |
| 556 | + <description> |
| 557 | + Same as [method get_driver_allocation_count] but filtered for a given object type. |
| 558 | + The type argument must be in range [code][0; get_tracked_object_type_count - 1][/code]. If [method get_tracked_object_type_count] is 0, then type argument is ignored and always returns 0. |
| 559 | + This is only used by Vulkan in Debug builds and can return 0 when this information is not tracked or unknown. |
| 560 | + </description> |
| 561 | + </method> |
| 562 | + <method name="get_driver_memory_by_object_type" qualifiers="const"> |
| 563 | + <return type="int" /> |
| 564 | + <param index="0" name="type" type="int" /> |
| 565 | + <description> |
| 566 | + Same as [method get_driver_total_memory] but filtered for a given object type. |
| 567 | + The type argument must be in range [code][0; get_tracked_object_type_count - 1][/code]. If [method get_tracked_object_type_count] is 0, then type argument is ignored and always returns 0. |
| 568 | + This is only used by Vulkan in Debug builds and can return 0 when this information is not tracked or unknown. |
| 569 | + </description> |
| 570 | + </method> |
508 | 571 | <method name="get_driver_resource">
|
509 | 572 | <return type="int" />
|
510 | 573 | <param index="0" name="resource" type="int" enum="RenderingDevice.DriverResource" />
|
|
514 | 577 | Returns the unique identifier of the driver [param resource] for the specified [param rid]. Some driver resource types ignore the specified [param rid] (see [enum DriverResource] descriptions). [param index] is always ignored but must be specified anyway.
|
515 | 578 | </description>
|
516 | 579 | </method>
|
| 580 | + <method name="get_driver_total_memory" qualifiers="const"> |
| 581 | + <return type="int" /> |
| 582 | + <description> |
| 583 | + Returns how much bytes the GPU driver is using for internal driver structures. |
| 584 | + This is only used by Vulkan in Debug builds and can return 0 when this information is not tracked or unknown. |
| 585 | + </description> |
| 586 | + </method> |
517 | 587 | <method name="get_frame_delay" qualifiers="const">
|
518 | 588 | <return type="int" />
|
519 | 589 | <description>
|
|
527 | 597 | Returns the memory usage in bytes corresponding to the given [param type]. When using Vulkan, these statistics are calculated by [url=https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator]Vulkan Memory Allocator[/url].
|
528 | 598 | </description>
|
529 | 599 | </method>
|
| 600 | + <method name="get_perf_report" qualifiers="const"> |
| 601 | + <return type="String" /> |
| 602 | + <description> |
| 603 | + Returns a string with a performance report from the past frame. Updates every frame. |
| 604 | + </description> |
| 605 | + </method> |
| 606 | + <method name="get_tracked_object_name" qualifiers="const"> |
| 607 | + <return type="String" /> |
| 608 | + <param index="0" name="type_index" type="int" /> |
| 609 | + <description> |
| 610 | + Returns the name of the type of object for the given [param type_index]. This value must be in range [code][0; get_tracked_object_type_count - 1][/code]. If [method get_tracked_object_type_count] is 0, then type argument is ignored and always returns the same string. |
| 611 | + The return value is important because it gives meaning to the types passed to [method get_driver_memory_by_object_type], [method get_driver_allocs_by_object_type], [method get_device_memory_by_object_type], and [method get_device_allocs_by_object_type]. Examples of strings it can return (not exhaustive): |
| 612 | + - DEVICE_MEMORY |
| 613 | + - PIPELINE_CACHE |
| 614 | + - SWAPCHAIN_KHR |
| 615 | + - COMMAND_POOL |
| 616 | + Thus if e.g. [code]get_tracked_object_name(5)[/code] returns "COMMAND_POOL", then [code]get_device_memory_by_object_type(5)[/code] returns the bytes used by the GPU for command pools. |
| 617 | + This is only used by Vulkan in Debug builds. |
| 618 | + </description> |
| 619 | + </method> |
| 620 | + <method name="get_tracked_object_type_count" qualifiers="const"> |
| 621 | + <return type="int" /> |
| 622 | + <description> |
| 623 | + Returns how many types of trackable objects are. |
| 624 | + This is only used by Vulkan in Debug builds. |
| 625 | + </description> |
| 626 | + </method> |
530 | 627 | <method name="index_array_create">
|
531 | 628 | <return type="RID" />
|
532 | 629 | <param index="0" name="index_buffer" type="RID" />
|
|
2362 | 2459 | <constant name="INVALID_FORMAT_ID" value="-1">
|
2363 | 2460 | Returned by functions that return a format ID if a value is invalid.
|
2364 | 2461 | </constant>
|
| 2462 | + <constant name="NONE" value="0" enum="BreadcrumbMarker"> |
| 2463 | + </constant> |
| 2464 | + <constant name="REFLECTION_PROBES" value="65536" enum="BreadcrumbMarker"> |
| 2465 | + </constant> |
| 2466 | + <constant name="SKY_PASS" value="131072" enum="BreadcrumbMarker"> |
| 2467 | + </constant> |
| 2468 | + <constant name="LIGHTMAPPER_PASS" value="196608" enum="BreadcrumbMarker"> |
| 2469 | + </constant> |
| 2470 | + <constant name="SHADOW_PASS_DIRECTIONAL" value="262144" enum="BreadcrumbMarker"> |
| 2471 | + </constant> |
| 2472 | + <constant name="SHADOW_PASS_CUBE" value="327680" enum="BreadcrumbMarker"> |
| 2473 | + </constant> |
| 2474 | + <constant name="OPAQUE_PASS" value="393216" enum="BreadcrumbMarker"> |
| 2475 | + </constant> |
| 2476 | + <constant name="ALPHA_PASS" value="458752" enum="BreadcrumbMarker"> |
| 2477 | + </constant> |
| 2478 | + <constant name="TRANSPARENT_PASS" value="524288" enum="BreadcrumbMarker"> |
| 2479 | + </constant> |
| 2480 | + <constant name="POST_PROCESSING_PASS" value="589824" enum="BreadcrumbMarker"> |
| 2481 | + </constant> |
| 2482 | + <constant name="BLIT_PASS" value="655360" enum="BreadcrumbMarker"> |
| 2483 | + </constant> |
| 2484 | + <constant name="UI_PASS" value="720896" enum="BreadcrumbMarker"> |
| 2485 | + </constant> |
| 2486 | + <constant name="DEBUG_PASS" value="786432" enum="BreadcrumbMarker"> |
| 2487 | + </constant> |
2365 | 2488 | </constants>
|
2366 | 2489 | </class>
|
0 commit comments