75 Commits

Author SHA1 Message Date
Kbz-8 5df699c547 working on python bindings 2025-10-22 08:25:00 +02:00
Kbz-8 0d0d2d4451 fixing strings management 2025-10-16 10:36:31 +02:00
Kbz-8 73d31c196e adding python bindings base 2025-10-15 22:32:21 +02:00
kbz_8 d6a7450bdd 143 headless mode (#150) 2025-09-24 19:49:32 +02:00
Kbz-8 5a0a2fccfe updating kvf 2025-09-24 19:39:22 +02:00
Kbz-8 7722e26095 updating readme 2025-09-24 19:22:45 +02:00
Kbz-8 d6f472cf6c fixing physical device selection under swiftshaders 2025-09-24 19:11:53 +02:00
Kbz-8 7ebce77bb3 fixing unit tests CI 2025-09-24 16:32:55 +02:00
Kbz-8 61d7c6ce95 fixing unit tests CI 2025-09-24 16:27:59 +02:00
Kbz-8 c24f1ade64 fixing unit tests CI 2025-09-24 16:24:06 +02:00
Kbz-8 083e3db912 fixing unit tests CI 2025-09-24 15:48:08 +02:00
Kbz-8 1704776df1 fixing unit tests CI 2025-09-24 11:06:05 +02:00
Kbz-8 bae90e5603 fixing unit tests CI 2025-09-24 10:57:29 +02:00
Kbz-8 6766777dca fixing unit tests CI 2025-09-24 10:56:22 +02:00
Kbz-8 baf5a963f3 fixing unit tests CI 2025-09-24 10:55:06 +02:00
Kbz-8 36119a1643 fixing unit tests CI 2025-09-24 10:48:08 +02:00
Kbz-8 5767be94f8 fixing unit tests CI 2025-09-24 10:37:03 +02:00
Kbz-8 a2ba022c01 fixing unit tests CI 2025-09-24 10:26:28 +02:00
Kbz-8 bada4ea193 adding unit test CI 2025-09-24 10:15:54 +02:00
Kbz-8 8c68564be2 adding headless mode 2025-09-24 09:54:44 +02:00
kbz_8 973b177abf update dependencies (#144)
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action
2025-07-03 10:58:06 +02:00
Kbz-8 a27dada134 [BOT] update dependencies 2025-06-29 00:51:34 +00:00
Kbz-8 26eab93f9f starting to work on headless support 2025-06-24 07:10:02 +02:00
kbz_8 ea9bd71245 Merge branch 'master' into indev 2025-06-23 20:41:57 +02:00
Kbz-8 be3030977a fixing image set pixel 2025-06-23 20:40:42 +02:00
Kbz-8 2fcc9cfaa0 Merge branch 'master' of github.com:seekrs/MacroLibX 2025-06-23 20:35:45 +02:00
Kbz-8 bc1da5a177 fixing image set pixel 2025-06-23 20:35:36 +02:00
kbz_8 d189342d6c update dependencies (#140)
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action
2025-06-01 11:16:11 +02:00
Kbz-8 efa56f3c05 [BOT] update dependencies 2025-06-01 00:54:50 +00:00
kbz_8 b71ee5411c update dependencies (#139)
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action
2025-05-18 12:54:08 +02:00
Kbz-8 4fa376bca3 [BOT] update dependencies 2025-05-18 00:46:40 +00:00
kbz_8 a5f8999b8d update dependencies (#138)
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action
2025-05-11 13:35:22 +02:00
Kbz-8 da48596af4 [BOT] update dependencies 2025-05-11 00:45:50 +00:00
kbz_8 4a5722539e update dependencies (#137)
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action
2025-05-05 15:47:10 +02:00
Kbz-8 1856934053 [BOT] update dependencies 2025-04-20 00:44:40 +00:00
kbz_8 63f04e5dbd update dependencies (#136)
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action
2025-04-17 16:49:02 +02:00
Kbz-8 5de7ce6adc [BOT] update dependencies 2025-04-06 00:43:23 +00:00
kbz_8 7f7fd835e1 update dependencies (#135)
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action
2025-03-23 15:00:05 +01:00
Kbz-8 e493fad120 [BOT] update dependencies 2025-03-23 00:42:57 +00:00
kbz_8 58c44a1cff add rules in valgrind.supp (#134)
Hello,

Following my use of this library for my cub3D project, I noticed some
Valgrind issues that are not handled by the valgrind.supp file.
2025-03-19 11:31:27 +01:00
Jérémy Lorette 00da9ebd7e add rules in valgrind.supp 2025-03-19 08:33:20 +01:00
kbz_8 c54aff0397 Indev (#133) 2025-03-17 11:34:58 +01:00
Kbz-8 49a66e1abc fixing bug 2025-03-17 11:24:43 +01:00
Kbz-8 a2996191d3 yes 2025-03-14 12:41:51 +01:00
kbz_8 30cc6cb0d5 adding bindings (#132) 2025-03-13 17:11:33 +01:00
kbz_8 ad27df221b Merge branch 'master' into indev 2025-03-13 17:06:23 +01:00
Kbz-8 96bb8c94f5 adding bindings 2025-03-13 16:58:10 +01:00
kbz_8 7991b045f3 Indev (#131) 2025-03-13 00:47:48 +01:00
Kbz-8 8c27a1eb20 Merge branch 'indev' of github.com:seekrs/MacroLibX into indev 2025-03-13 00:43:47 +01:00
Kbz-8 0c177eaaa7 removing unnecessary mode in CIs 2025-03-13 00:43:34 +01:00
Kbz-8 ff77f3bf9c adding hidden bindings 2025-03-13 00:40:16 +01:00
Kbz-8 5c1cfdea60 Merge branch 'indev' of github.com:seekrs/MacroLibX into indev 2025-03-13 00:39:22 +01:00
Kbz-8 0a9d423eeb adding hidden bindings 2025-03-13 00:39:01 +01:00
kbz_8 ce291c9c47 Indev (#130) 2025-03-12 23:09:01 +01:00
kbz_8 2dd27f9411 Merge branch 'master' into indev 2025-03-12 23:03:14 +01:00
Kbz-8 91c87e2b7a adding secret bindings 2025-03-12 22:57:29 +01:00
Kbz-8 ac05312375 Merge branch 'indev' of github.com:seekrs/MacroLibX into indev 2025-03-12 21:38:20 +01:00
Kbz-8 d47f71804b yes 2025-03-12 21:37:59 +01:00
kbz_8 970a1b4575 update dependencies (#129)
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action
2025-03-10 08:49:06 +01:00
Kbz-8 ae9b0beac9 [BOT] update dependencies 2025-03-09 00:34:15 +00:00
kbz_8 b0c8a09697 Indev (#128) 2025-03-08 19:01:54 +01:00
kbz_8 785fb0808e Merge branch 'master' into indev 2025-03-08 18:53:58 +01:00
kbz_8 37bb97b4d1 update dependencies (#124)
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action
2025-02-24 08:13:09 +01:00
kbz_8 65aa97ceb5 fix(Renderer/Image.cpp): bad moving_y bounds checking (#126) 2025-02-24 08:12:50 +01:00
kbz_8 ba60f93434 Revert "🐛 fix(Renderer/Image.cpp): bad moving_y bounds checking" (#125)
Reverts seekrs/MacroLibX#123
2025-02-24 08:12:05 +01:00
kbz_8 c06a0fb1de Revert "🐛 fix(Renderer/Image.cpp): bad moving_y bounds checking" 2025-02-24 08:11:18 +01:00
kbz_8 cc0e674f3a 🐛 fix(Renderer/Image.cpp): bad moving_y bounds checking (#123)
moved moving_y++ line
2025-02-24 08:11:10 +01:00
Kbz-8 e13ea28ae6 [BOT] update dependencies 2025-02-23 00:40:25 +00:00
Arkturius 312ca527be 🐛 fix(Renderer/Image.cpp): bad moving_y bounds checking 2025-02-22 16:39:09 +01:00
kbz_8 580352f970 update dependencies (#122)
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action
2025-02-10 08:05:01 +01:00
Kbz-8 278ea3e756 [BOT] update dependencies 2025-02-09 00:39:34 +00:00
kbz_8 cadfce3e7b update dependencies (#121)
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action
2025-02-02 17:19:08 +01:00
Kbz-8 5c1771a711 [BOT] update dependencies 2025-02-02 00:38:46 +00:00
kbz_8 876be807e2 update dependencies (#120)
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action
2025-01-26 10:18:23 +01:00
Kbz-8 5c18ceeb16 [BOT] update dependencies 2025-01-26 00:37:34 +00:00
74 changed files with 171430 additions and 153110 deletions
-1
View File
@@ -15,7 +15,6 @@ jobs:
matrix: matrix:
os: [ubuntu-24.04] os: [ubuntu-24.04]
arch: [x86_64] arch: [x86_64]
mode: [release]
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, 'ci skip')" if: "!contains(github.event.head_commit.message, 'ci skip')"
-1
View File
@@ -15,7 +15,6 @@ jobs:
matrix: matrix:
os: [ubuntu-24.04] os: [ubuntu-24.04]
arch: [x86_64] arch: [x86_64]
mode: [release]
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, 'ci skip')" if: "!contains(github.event.head_commit.message, 'ci skip')"
-1
View File
@@ -15,7 +15,6 @@ jobs:
matrix: matrix:
os: [macOS-latest] os: [macOS-latest]
arch: [x86_64] arch: [x86_64]
mode: [release]
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, 'ci skip')" if: "!contains(github.event.head_commit.message, 'ci skip')"
+78
View File
@@ -0,0 +1,78 @@
name: Unit tests
on:
pull_request:
push:
paths-ignore:
- '.gitignore'
- 'LICENSE'
- 'README.md'
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04]
arch: [x86_64]
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, 'ci skip')"
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: NcStudios/VulkanCI@v1.0
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get -y install mesa-common-dev clang libsdl2-2.0-0 libsdl2-dev build-essential libvulkan-dev
# Build the lib
- name: Build MacroLibX
run: make -j DEBUG=true
# Force xmake to a specific folder (for cache)
- name: Set xmake env
run: echo "XMAKE_GLOBALDIR=${{ runner.workspace }}/xmake-global" >> $GITHUB_ENV
# Install xmake
- name: Setup xmake
if: ${{ matrix.confs.plat != 'mingw' }}
uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: latest
actions-cache-folder: .xmake-cache-W${{ steps.cache_key.outputs.key }}
# Update xmake repository (in order to have the file that will be cached)
- name: Update xmake repository
run: xmake repo --update
# Fetch xmake dephash
- name: Retrieve dependencies hash
id: dep_hash
run: echo "hash=$(xmake l utils.ci.packageskey)" >> $GITHUB_OUTPUT
- name: Install unit tester
run: git clone https://github.com/seekrs/MacroUnitTest.git ../MacroUnitTest
# Setup compilation mode and install project dependencies
- name: Configure xmake and install dependencies
run: |
cd ../MacroUnitTest
xmake config --toolchain=clang --ccache=n --yes
# Save dependencies
- name: Save cached xmake dependencies
if: ${{ !steps.restore-depcache.outputs.cache-hit }}
uses: actions/cache/save@v4
with:
path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages
key: ${{ steps.restore-depcache.outputs.cache-primary-key }}
- name: Build and run unit tester
run: |
cd ../MacroUnitTest
xmake run MacroUnitTest --headless --path="${{ runner.workspace }}/MacroLibX/libmlx.so"
+2
View File
@@ -23,3 +23,5 @@
objs/ objs/
build/ build/
example/Test example/Test
macrolibpy/__pycache__
example/__pycache__
+3
View File
@@ -8,6 +8,9 @@
<div align="center"> <div align="center">
<a href="https://github.com/seekrs/MacroLibX/actions/workflows/windows.yml"><img src="https://github.com/seekrs/MacroLibX/actions/workflows/windows.yml/badge.svg"></a> <a href="https://github.com/seekrs/MacroLibX/actions/workflows/windows.yml"><img src="https://github.com/seekrs/MacroLibX/actions/workflows/windows.yml/badge.svg"></a>
</div> </div>
<div align="center">
<a href="https://github.com/seekrs/MacroLibX/actions/workflows/tests.yml"><img src="https://github.com/seekrs/MacroLibX/actions/workflows/tests.yml/badge.svg"></a>
</div>
</div> </div>
###### MacroLibX, a rewrite of 42 School's MiniLibX using SDL2 and Vulkan. ###### MacroLibX, a rewrite of 42 School's MiniLibX using SDL2 and Vulkan.
+85
View File
@@ -0,0 +1,85 @@
import macrolibpy as mlpy
import pathlib
import os
import math
current_path = pathlib.Path(__file__).parent.resolve()
mlx = mlpy.Context.create()
win = mlx.new_window(400, 400, "My window")
mlx.set_fps_goal(60)
logo_png = mlx.new_image_from_file(os.path.join(current_path, "42_logo.png"))[0]
logo_bmp = mlx.new_image_from_file(os.path.join(current_path, "42_logo.bmp"))[0]
logo_jpg = mlx.new_image_from_file(os.path.join(current_path, "42_logo.jpg"))[0]
win.pixel_put(200, 10, 0xFF0FFFF)
win.put_image(logo_png, 0, 0)
mlx.set_font_scale(os.path.join(current_path, "font.ttf"), 16.0)
win.string_put(20, 20, 0x0020FFFF, "that text will disappear")
custom_img = mlx.new_image(100, 100)
i, j, k = 0, 0, 0
while i < (100 * 100) * 4:
if j >= 100:
j = 0
k += 1
if i < 10000 or i > 20000:
custom_img.set_pixel(j, k, (k << 24) | (j << 16) | (i << 8) | 0x99)
i += 4
j += 1
def onevent(ev):
if ev == 0:
mlx.loop_end()
THRESHOLD = 200
CIRCLE_RADIUS = 50
CIRCLE_DIAMETER = CIRCLE_RADIUS + CIRCLE_RADIUS
def onupdate():
if onupdate.i > THRESHOLD:
win.clear(0x334D4DFF)
win.put_transformed_image(logo_bmp, 220, 40, 0.5, 0.5, onupdate.i)
if onupdate.i >= THRESHOLD + THRESHOLD / 4:
mlx.set_font_scale("default", 16.0)
else:
mlx.set_font_scale("default", 6.0)
win.string_put(160, 120, 0xFF2066FF, "this text should be behind")
win.put_image(logo_png, 100, 100)
win.put_image(custom_img, 150, 60)
mlx.set_font("default")
win.string_put(20, 50, 0xFFFFFFFF, "that's a text")
color = 0
for j in range(0, 400):
win.pixel_put(j, j, 0x0000FFFF + (color << 24))
win.pixel_put(399 - j, j, 0x0000FFFF)
color += (color < 255)
if onupdate.i < THRESHOLD:
win.put_transformed_image(logo_jpg, 210, 150, 0.5, 2.0, 0.0)
else:
win.put_transformed_image(logo_jpg, 210, 150, abs(math.sin(onupdate.i / 100.0)), abs(math.cos(onupdate.i / 100.0) * 2.0), 0.0)
mlx.set_font_scale("default", 8.0)
win.string_put(210, 175, 0xFFAF2BFF, "hidden")
win.pixel_put_region(200, 170, CIRCLE_DIAMETER, CIRCLE_DIAMETER, onupdate.pixels_circle)
onupdate.i += 1
onupdate.i = 0
onupdate.pixels_circle = [pixel for pixel in range(0, CIRCLE_DIAMETER * CIRCLE_DIAMETER)]
i = 0
for j in range(0, CIRCLE_DIAMETER):
for k in range(0, CIRCLE_DIAMETER):
if((CIRCLE_RADIUS - j) * (CIRCLE_RADIUS - j) + (CIRCLE_RADIUS - k) * (CIRCLE_RADIUS - k) < CIRCLE_RADIUS * CIRCLE_RADIUS):
onupdate.pixels_circle[i] = 0xA10000FF + ((j * k * i) << 8)
i += 1
win.on_event(mlpy.EventType.WINDOW_EVENT, onevent)
mlx.add_loop_hook(onupdate)
mlx.loop()
View File
+28
View File
@@ -0,0 +1,28 @@
#include <stdio.h>
#include <stddef.h>
#include "../../includes/mlx.h"
#include "../../includes/mlx_extended.h"
#include <vulkan/vulkan_core.h>
typedef VkInstance (*PFN_mlx_get_vk_instance)(mlx_context mlx);
int main(void)
{
mlx_context mlx = mlx_init();
mlx_window_create_info info = { 0 };
info.title = "My window";
info.width = 400;
info.height = 400;
info.is_resizable = true;
mlx_window win = mlx_new_window(mlx, &info);
PFN_mlx_get_vk_instance mlx_get_vk_instance = (PFN_mlx_get_vk_instance)mlx_get_proc_addr(mlx, "mlx_get_vk_instance");
printf("%p\n", mlx_get_vk_instance(mlx));
mlx_destroy_window(mlx, win);
mlx_destroy_context(mlx);
return 0;
}
+11
View File
@@ -0,0 +1,11 @@
#!/bin/bash
if [ -e a.out ]; then
rm a.out
fi
if [ $(uname -s) = 'Darwin' ]; then
clang main.c ../../libmlx.dylib -L /opt/homebrew/lib -lSDL2 -lm -g;
else
clang main.c ../../libmlx.so -lSDL2 -g -Wall -Wextra -Werror -lm;
fi
+4
View File
@@ -0,0 +1,4 @@
#!/bin/bash
bash ./build.sh
./a.out
+5 -5
View File
@@ -6,7 +6,7 @@
/* By: maldavid <contact@kbz8.me> +#+ +:+ +#+ */ /* By: maldavid <contact@kbz8.me> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/04 16:56:35 by maldavid #+# #+# */ /* Created: 2022/10/04 16:56:35 by maldavid #+# #+# */
/* Updated: 2025/01/05 22:44:22 by maldavid ### ########.fr */ /* Updated: 2025/03/12 22:26:32 by maldavid ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@@ -71,7 +71,7 @@ typedef union mlx_color
/** /**
* @brief Initializes the MLX internal application * @brief Initializes the MLX internal application
* *
* @return (mlx_context) An opaque handler to the internal MLX application or NULL (0x0) in case of error * @return (mlx_context) An opaque handler to the internal MLX application or MLX_NULL_HANDLE (0x0) in case of error
*/ */
MLX_API mlx_context mlx_init(); MLX_API mlx_context mlx_init();
@@ -122,7 +122,7 @@ typedef struct mlx_window_create_info
* @param mlx Internal MLX application * @param mlx Internal MLX application
* @param info Pointer to a descriptor structure * @param info Pointer to a descriptor structure
* *
* @return (mlx_widnow) An opaque handler to the internal MLX window or NULL (0x0) in case of error * @return (mlx_window) An opaque handler to the internal MLX window or MLX_NULL_HANDLE (0x0) in case of error
*/ */
MLX_API mlx_window mlx_new_window(mlx_context mlx, const mlx_window_create_info* info); MLX_API mlx_window mlx_new_window(mlx_context mlx, const mlx_window_create_info* info);
@@ -328,7 +328,7 @@ MLX_API void mlx_pixel_put(mlx_context mlx, mlx_window win, int x, int y, mlx_co
* @param width Width of the image * @param width Width of the image
* @param height Height of the image * @param height Height of the image
* *
* @return (mlx_image) An opaque handler to the internal image or NULL (0x0) in case of error * @return (mlx_image) An opaque handler to the internal image or MLX_NULL_HANDLE (0x0) in case of error
*/ */
MLX_API mlx_image mlx_new_image(mlx_context mlx, int width, int height); MLX_API mlx_image mlx_new_image(mlx_context mlx, int width, int height);
@@ -340,7 +340,7 @@ MLX_API mlx_image mlx_new_image(mlx_context mlx, int width, int height);
* @param width Get the width of the image * @param width Get the width of the image
* @param heigth Get the height of the image * @param heigth Get the height of the image
* *
* @return (mlx_image) An opaque handler to the internal image or NULL (0x0) in case of error * @return (mlx_image) An opaque handler to the internal image or MLX_NULL_HANDLE (0x0) in case of error
*/ */
MLX_API mlx_image mlx_new_image_from_file(mlx_context mlx, char* filename, int* width, int* height); MLX_API mlx_image mlx_new_image_from_file(mlx_context mlx, char* filename, int* width, int* height);
+10 -1
View File
@@ -6,7 +6,7 @@
/* By: maldavid <contact@kbz8.me> +#+ +:+ +#+ */ /* By: maldavid <contact@kbz8.me> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/12/14 16:17:10 by maldavid #+# #+# */ /* Created: 2024/12/14 16:17:10 by maldavid #+# #+# */
/* Updated: 2025/01/08 12:37:15 by maldavid ### ########.fr */ /* Updated: 2025/03/12 22:03:45 by maldavid ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@@ -171,6 +171,15 @@ MLX_API void mlx_set_image_region(mlx_context mlx, mlx_image image, int x, int y
*/ */
MLX_API void mlx_put_transformed_image_to_window(mlx_context mlx, mlx_window win, mlx_image image, int x, int y, float scale_x, float scale_y, float angle); MLX_API void mlx_put_transformed_image_to_window(mlx_context mlx, mlx_window win, mlx_image image, int x, int y, float scale_x, float scale_y, float angle);
/**
* @brief Get direct pointers to hidden functions
*
* @param mlx Internal MLX application
*
* @return (mlx_function) A function pointer or NULL (0x0) in case of error
*/
MLX_API mlx_function mlx_get_proc_addr(mlx_context mlx, const char* name);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
+4 -1
View File
@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */ /* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/10 08:49:17 by maldavid #+# #+# */ /* Created: 2023/11/10 08:49:17 by maldavid #+# #+# */
/* Updated: 2025/01/07 00:17:45 by maldavid ### ########.fr */ /* Updated: 2025/03/12 22:01:07 by maldavid ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@@ -202,6 +202,9 @@
#define MLX_VERSION_PATCH(version) ((uint32_t)(version) & 0xFFFU) #define MLX_VERSION_PATCH(version) ((uint32_t)(version) & 0xFFFU)
#define MLX_DEFINE_HANDLE(object) typedef struct object##_handler* object #define MLX_DEFINE_HANDLE(object) typedef struct object##_handler* object
#define MLX_NULL_HANDLE NULL
typedef void (*mlx_function)(void);
#define MLX_VERSION MLX_MAKE_VERSION(2, 0, 0) #define MLX_VERSION MLX_MAKE_VERSION(2, 0, 0)
#define MLX_TARGET_VULKAN_API_VERSION MLX_MAKE_VERSION(1, 0, 0) #define MLX_TARGET_VULKAN_API_VERSION MLX_MAKE_VERSION(1, 0, 0)
+368
View File
@@ -0,0 +1,368 @@
"""
macrolibpy — thin, Pythonic bindings over MacroLibX.
"""
from __future__ import annotations
from enum import IntEnum
from typing import Callable, Optional, Any, List
import os, sys
from cffi import FFI
import pathlib
__all__ = ["Context", "Window", "Image", "Event"]
ffi = FFI()
# NOTE: This is a curated declaration set focused on the core API
ffi.cdef(
r"""
typedef unsigned char uint8_t;
typedef unsigned int uint32_t;
typedef void (*mlx_function)(void);
typedef struct mlx_context_handler* mlx_context;
typedef struct mlx_window_handler* mlx_window;
typedef struct mlx_image_handler* mlx_image;
typedef struct mlx_color
{
uint32_t rgba;
} mlx_color;
typedef enum mlx_event_type
{
MLX_KEYDOWN = 0,
MLX_KEYUP = 1,
MLX_MOUSEDOWN = 2,
MLX_MOUSEUP = 3,
MLX_MOUSEWHEEL = 4,
MLX_WINDOW_EVENT = 5
} mlx_event_type;
typedef struct mlx_window_create_info
{
mlx_image render_target;
const char* title;
int width;
int height;
_Bool is_fullscreen;
_Bool is_resizable;
} mlx_window_create_info;
mlx_context mlx_init();
void mlx_set_fps_goal(mlx_context mlx, int fps);
void mlx_destroy_context(mlx_context mlx);
mlx_window mlx_new_window(mlx_context mlx, const mlx_window_create_info* info);
void mlx_destroy_window(mlx_context mlx, mlx_window win);
void mlx_set_window_position(mlx_context mlx, mlx_window win, int x, int y);
void mlx_set_window_size(mlx_context mlx, mlx_window win, int width, int height);
void mlx_set_window_title(mlx_context mlx, mlx_window win, const char* title);
void mlx_set_window_fullscreen(mlx_context mlx, mlx_window win, _Bool enable);
void mlx_get_window_position(mlx_context mlx, mlx_window win, int* x, int* y);
void mlx_get_window_size(mlx_context mlx, mlx_window win, int* x, int* y);
void mlx_clear_window(mlx_context mlx, mlx_window win, mlx_color color);
void mlx_get_screen_size(mlx_context mlx, mlx_window win, int* w, int* h);
void mlx_add_loop_hook(mlx_context mlx, void(*f)(void*), void* param);
void mlx_loop(mlx_context mlx);
void mlx_loop_end(mlx_context mlx);
void mlx_mouse_show(mlx_context mlx);
void mlx_mouse_hide(mlx_context mlx);
void mlx_mouse_move(mlx_context mlx, mlx_window win, int x, int y);
void mlx_mouse_get_pos(mlx_context mlx, int* x, int* y);
void mlx_on_event(mlx_context mlx, mlx_window win, mlx_event_type event, void(*f)(int, void*), void* param);
void mlx_pixel_put(mlx_context mlx, mlx_window win, int x, int y, mlx_color color);
mlx_image mlx_new_image(mlx_context mlx, int width, int height);
mlx_image mlx_new_image_from_file(mlx_context mlx, char* filename, int* width, int* height);
void mlx_destroy_image(mlx_context mlx, mlx_image image);
mlx_color mlx_get_image_pixel(mlx_context mlx, mlx_image image, int x, int y);
void mlx_set_image_pixel(mlx_context mlx, mlx_image image, int x, int y, mlx_color color);
void mlx_put_image_to_window(mlx_context mlx, mlx_window win, mlx_image image, int x, int y);
void mlx_string_put(mlx_context mlx, mlx_window win, int x, int y, mlx_color color, char* str);
void mlx_set_font(mlx_context mlx, char* filepath);
void mlx_set_font_scale(mlx_context mlx, char* filepath, float scale);
void mlx_set_window_max_size(mlx_context mlx, mlx_window win, int x, int y);
void mlx_set_window_min_size(mlx_context mlx, mlx_window win, int x, int y);
void mlx_maximise_window(mlx_context mlx, mlx_window win);
void mlx_minimize_window(mlx_context mlx, mlx_window win);
void mlx_restore_window(mlx_context mlx, mlx_window win);
void mlx_pixel_put_array(mlx_context mlx, mlx_window win, int x, int y, mlx_color* pixels, size_t pixels_number);
void mlx_pixel_put_region(mlx_context mlx, mlx_window win, int x, int y, int w, int h, mlx_color* pixels);
void mlx_get_image_region(mlx_context mlx, mlx_image image, int x, int y, int w, int h, mlx_color* dst);
void mlx_set_image_region(mlx_context mlx, mlx_image image, int x, int y, int w, int h, mlx_color* pixels);
void mlx_put_transformed_image_to_window(mlx_context mlx, mlx_window win, mlx_image image, int x, int y, float scale_x, float scale_y, float angle);
"""
)
def _candidateLibNames() -> List[str]:
if sys.platform.startswith("linux"):
return ["libmlx.so"]
if sys.platform == "darwin":
return ["libmlx.dylib"]
if sys.platform.startswith("win"):
# depending on build system, either of these may exist
return ["mlx.dll", "libmlx.dll"]
return []
def _candidateSdl2Names() -> List[str]:
if sys.platform.startswith("linux"):
# Try common SONAMEs (distro dependent)
return ["libSDL2-2.0.so.0", "libSDL2.so.0", "libSDL2.so"]
if sys.platform == "darwin":
return ["libSDL2-2.0.0.dylib", "libSDL2.dylib"]
if sys.platform.startswith("win"):
return ["SDL2.dll"]
return []
def _loadLibrary(candidates: List[str]):
last_err: Optional[BaseException] = None
RTLD_NOW = 2
RTLD_GLOBAL = 0x100
for path in candidates:
try:
return ffi.dlopen(path, RTLD_NOW | RTLD_GLOBAL)
except OSError as e:
last_err = e
raise OSError(
f"Could not load library:\n"
f"\tTried: {candidates}.\n"
f"\tLast error: {last_err}"
)
def _dlopenMlx():
_loadLibrary(_candidateSdl2Names())
candidates: List[str] = []
for name in _candidateLibNames():
candidates.append(os.path.join(pathlib.Path(__file__).parent.parent.resolve(), name))
return _loadLibrary(candidates)
lib = _dlopenMlx()
class EventType(IntEnum):
KEYDOWN = 0
KEYUP = 1
MOUSEDOWN = 2
MOUSEUP = 3
MOUSEWHEEL = 4
WINDOW_EVENT = 5
class MlxError(RuntimeError):
pass
# Keep Python references to cffi callbacks alive
_alive_callbacks: List[Any] = []
def _makeLoopCallback(pyfunc: Callable[[], None]):
@ffi.callback("void(void*)")
def cfunc(userdata):
pyfunc()
_alive_callbacks.append(cfunc)
return cfunc
def _makeEventCallback(pyfunc: Callable[[int], None]):
@ffi.callback("void(int, void*)")
def cfunc(event, userdata):
pyfunc(int(event))
_alive_callbacks.append(cfunc)
return cfunc
def _rgbaToColor(rgba: int):
c = ffi.new("mlx_color*")
c[0].rgba = int(rgba) & 0xFFFFFFFF
return c[0]
class Context:
__slots__ = ("_ctx",)
def __init__(self, _ptr) -> None:
self._ctx = _ptr
@classmethod
def create(cls) -> "Context":
ctx = lib.mlx_init()
if ctx == ffi.NULL:
raise MlxError("mlx_init failed")
return cls(ctx)
def set_fps_goal(self, fps: int) -> None:
lib.mlx_set_fps_goal(self._ctx, int(fps))
def add_loop_hook(self, fn: Callable[[], None]) -> None:
lib.mlx_add_loop_hook(self._ctx, _makeLoopCallback(fn), ffi.NULL)
def new_window(
self,
width: int,
height: int,
title: str,
resizable: bool = True,
fullscreen: bool = False,
) -> "Window":
ffi_title = ffi.new("char[]", title.encode('ascii', 'replace'))
info = ffi.new("mlx_window_create_info*")
info.render_target = ffi.NULL
info.title = ffi_title
info.width = int(width)
info.height = int(height)
info.is_fullscreen = bool(fullscreen)
info.is_resizable = bool(resizable)
win = lib.mlx_new_window(self._ctx, info)
if win == ffi.NULL:
raise MlxError("mlx_new_window failed")
return Window(self, win)
def new_image(self, width: int, height: int) -> "Image":
img = lib.mlx_new_image(self._ctx, int(width), int(height))
if img == ffi.NULL:
raise MlxError("mlx_new_image failed")
return Image(self, img)
def new_image_from_file(self, path: str) -> Tuple["Image", int, int]:
w = ffi.new("int[]", 1);
h = ffi.new("int[]", 1);
ffi_path = ffi.new("char[]", path.encode('ascii'))
img = lib.mlx_new_image_from_file(self._ctx, ffi_path, w, h)
if img == ffi.NULL:
raise MlxError("mlx_new_image failed")
return (Image(self, img), w, h)
def loop(self) -> None:
lib.mlx_loop(self._ctx)
def loop_end(self) -> None:
lib.mlx_loop_end(self._ctx)
def destroy(self) -> None:
if getattr(self, "_ctx", None):
lib.mlx_destroy_context(self._ctx)
self._ctx = ffi.NULL
def mouse_show(self) -> None:
lib.mlx_mouse_show(self._ctx)
def mouse_hide(self) -> None:
lib.mlx_mouse_hide(self._ctx)
def mouse_move(self, x: int, y: int) -> None:
lib.mlx_mouse_move(self._ctx, int(x), int(y))
def get_mouse_position(self) -> Tuple[int, int]:
x = ffi.new("int[]", 1);
y = ffi.new("int[]", 1);
lib.mlx_mouse_get_pos(self._ctx, x, y)
return (x[0], y[0])
def set_font(self, path: str) -> None:
ffi_path = ffi.new("char[]", path.encode('ascii'))
lib.mlx_set_font(self._ctx, ffi_path)
def set_font_scale(self, path: str, scale: float) -> None:
ffi_path = ffi.new("char[]", path.encode('ascii'))
lib.mlx_set_font_scale(self._ctx, ffi_path, float(scale))
def __del__(self):
try:
self.destroy()
except Exception:
pass
class Window:
__slots__ = ("_ctx", "_win")
def __init__(self, ctx: Context, win) -> None:
self._ctx = ctx
self._win = win
def set_title(self, title: str) -> None:
ffi_title = ffi.new("char[]", title.encode('ascii', 'replace'))
lib.mlx_set_window_title(self._ctx._ctx, self._win, ffi_title)
def set_position(self, x: int, y: int) -> None:
lib.mlx_set_window_position(self._ctx._ctx, self._win, int(x), int(y))
def set_size(self, w: int, h: int) -> None:
lib.mlx_set_window_size(self._ctx._ctx, self._win, int(w), int(h))
def set_fullscreen(self, enable: bool) -> None:
lib.mlx_set_window_fullscreen(self._ctx._ctx, self._win, bool(enable))
def get_position(self) -> Tuple[int, int]:
x = ffi.new("int[]", 1);
y = ffi.new("int[]", 1);
lib.mlx_get_window_position(self._ctx._ctx, self._win, x, y)
return (x[0], y[0])
def get_size(self) -> Tuple[int, int]:
w = ffi.new("int[]", 1);
h = ffi.new("int[]", 1);
lib.mlx_get_window_size(self._ctx._ctx, self._win, w, h)
return (w[0], h[0])
def get_screen_size(self) -> Tuple[int, int]:
w = ffi.new("int[]", 1);
h = ffi.new("int[]", 1);
lib.mlx_get_screen_size(self._ctx._ctx, self._win, w, h)
return (w[0], h[0])
def clear(self, rgba: int = 0) -> None:
lib.mlx_clear_window(self._ctx._ctx, self._win, _rgbaToColor(rgba))
def pixel_put(self, x: int, y: int, rgba: int) -> None:
lib.mlx_pixel_put(self._ctx._ctx, self._win, int(x), int(y), _rgbaToColor(rgba))
def pixel_put_array(self, x: int, y: int, rgba: list[int]) -> None:
ffi_pixels = ffi.new("mlx_color[]", [_rgbaToColor(pixel) for pixel in rgba])
lib.mlx_pixel_put_array(self._ctx._ctx, self._win, int(x), int(y), ffi_pixels, int(rgba.len()))
def pixel_put_region(self, x: int, y: int, w: int, h: int, rgba: list[int]) -> None:
ffi_pixels = ffi.new("mlx_color[]", [_rgbaToColor(pixel) for pixel in rgba])
lib.mlx_pixel_put_region(self._ctx._ctx, self._win, int(x), int(y), int(w), int(h), ffi_pixels)
def put_image(self, image: "Image", x: int, y: int) -> None:
lib.mlx_put_image_to_window(self._ctx._ctx, self._win, image._img, int(x), int(y))
def put_transformed_image(self, image: "Image", x: int, y: int, scale_x: float, scale_y: float, angle: float) -> None:
lib.mlx_put_transformed_image_to_window(self._ctx._ctx, self._win, image._img, int(x), int(y), float(scale_x), float(scale_y), float(angle))
def string_put(self, x: int, y: int, rgba: int, text: str) -> None:
ffi_text = ffi.new("char[]", text.encode('ascii', 'replace'))
lib.mlx_string_put(self._ctx._ctx, self._win, int(x), int(y), _rgbaToColor(rgba), ffi_text)
def on_event(self, event_type: EventType | int, fn: Callable[[int], None]) -> None:
lib.mlx_on_event(self._ctx._ctx, self._win, int(event_type), _makeEventCallback(fn), ffi.NULL)
def destroy(self) -> None:
if getattr(self, "_win", None):
lib.mlx_destroy_window(self._ctx._ctx, self._win)
self._win = ffi.NULL
def __del__(self):
try:
self.destroy()
except Exception:
pass
class Image:
__slots__ = ("_ctx", "_img")
def __init__(self, ctx: Context, img) -> None:
self._ctx = ctx
self._img = img
def set_pixel(self, x: int, y: int, rgba: int) -> None:
lib.mlx_set_image_pixel(self._ctx._ctx, self._img, int(x), int(y), _rgbaToColor(rgba))
def get_pixel(self, x: int, y: int) -> int:
return lib.mlx_get_image_pixel(self._ctx._ctx, self._img, int(x), int(y))
def destroy(self) -> None:
if getattr(self, "_img", None):
lib.mlx_destroy_image(self._ctx._ctx, self._img)
self._img = ffi.NULL
def __del__(self):
try:
self.destroy()
except Exception:
pass
+13
View File
@@ -32,16 +32,29 @@ namespace mlx
inline void TryEraseSpritesInScene(NonOwningPtr<Texture> texture) noexcept; inline void TryEraseSpritesInScene(NonOwningPtr<Texture> texture) noexcept;
inline void AddPreRenderHook(void(*f)(VkCommandBuffer, void*), void* param);
[[nodiscard]] MLX_FORCEINLINE bool HasWindow() const noexcept { return m_has_window; } [[nodiscard]] MLX_FORCEINLINE bool HasWindow() const noexcept { return m_has_window; }
[[nodiscard]] MLX_FORCEINLINE Renderer& GetRenderer() { return m_renderer; } [[nodiscard]] MLX_FORCEINLINE Renderer& GetRenderer() { return m_renderer; }
[[nodiscard]] MLX_FORCEINLINE Scene& GetScene() { return *p_scene; } [[nodiscard]] MLX_FORCEINLINE Scene& GetScene() { return *p_scene; }
~GraphicsSupport(); ~GraphicsSupport();
private:
struct Hook
{
std::function<void(VkCommandBuffer, void*)> fn;
void* param;
Hook(std::function<void(VkCommandBuffer, void*)> fn, void* param) : fn(fn), param(param) {}
};
private: private:
Renderer m_renderer; Renderer m_renderer;
SceneRenderer m_scene_renderer; SceneRenderer m_scene_renderer;
PutPixelManager m_put_pixel_manager; PutPixelManager m_put_pixel_manager;
std::vector<Hook> m_hooks;
std::shared_ptr<Window> p_window; std::shared_ptr<Window> p_window;
std::unique_ptr<Scene> p_scene; std::unique_ptr<Scene> p_scene;
+5
View File
@@ -8,4 +8,9 @@ namespace mlx
MLX_PROFILE_FUNCTION(); MLX_PROFILE_FUNCTION();
p_scene->TryEraseSpriteFromTexture(texture); p_scene->TryEraseSpriteFromTexture(texture);
} }
void GraphicsSupport::AddPreRenderHook(void(*f)(VkCommandBuffer, void*), void* param)
{
m_hooks.emplace_back(f, param);
}
} }
+4
View File
@@ -14,7 +14,10 @@ namespace mlx
Handle CreateWindow(const mlx_window_create_info* info, std::int32_t& id, bool hidden); Handle CreateWindow(const mlx_window_create_info* info, std::int32_t& id, bool hidden);
void DestroyWindow(Handle window) noexcept; void DestroyWindow(Handle window) noexcept;
SDL_Window* GetRawWindow(Handle window) noexcept;
void InputsFetcher(std::function<void(mlx_event_type, int, int)> functor); void InputsFetcher(std::function<void(mlx_event_type, int, int)> functor);
void SetInputBinding(std::function<void(SDL_Event*)> functor);
VkSurfaceKHR CreateVulkanSurface(Handle window, VkInstance instance) const noexcept; VkSurfaceKHR CreateVulkanSurface(Handle window, VkInstance instance) const noexcept;
std::vector<const char*> GetRequiredVulkanInstanceExtentions(Handle window) const noexcept; std::vector<const char*> GetRequiredVulkanInstanceExtentions(Handle window) const noexcept;
@@ -50,6 +53,7 @@ namespace mlx
private: private:
static SDLManager* s_instance; static SDLManager* s_instance;
std::function<void(SDL_Event*)> m_binding_hook;
std::unordered_set<Handle> m_windows_registry; std::unordered_set<Handle> m_windows_registry;
bool m_drop_sdl_responsability = false; bool m_drop_sdl_responsability = false;
}; };
+1 -3
View File
@@ -7,9 +7,7 @@ namespace mlx
{ {
public: public:
UUID(); UUID();
UUID(std::uint64_t uuid); inline operator std::uint64_t() const noexcept { return m_uuid; }
inline operator std::uint64_t() const { return m_uuid; }
private: private:
std::uint64_t m_uuid; std::uint64_t m_uuid;
+2
View File
@@ -38,6 +38,8 @@ namespace mlx
MLX_FORCEINLINE std::vector<const char*> GetRequiredVulkanInstanceExtentions() const noexcept { return SDLManager::Get().GetRequiredVulkanInstanceExtentions(p_window); } MLX_FORCEINLINE std::vector<const char*> GetRequiredVulkanInstanceExtentions() const noexcept { return SDLManager::Get().GetRequiredVulkanInstanceExtentions(p_window); }
MLX_FORCEINLINE Vec2ui GetVulkanDrawableSize() const noexcept { return SDLManager::Get().GetVulkanDrawableSize(p_window); } MLX_FORCEINLINE Vec2ui GetVulkanDrawableSize() const noexcept { return SDLManager::Get().GetVulkanDrawableSize(p_window); }
[[nodiscard]] inline Handle GetRawHandle() const noexcept { return p_window; }
void Destroy() noexcept; void Destroy() noexcept;
~Window() { Destroy(); } ~Window() { Destroy(); }
+162 -1
View File
@@ -2,11 +2,11 @@
#include <Core/Application.h> #include <Core/Application.h>
#include <Core/SDLManager.h> #include <Core/SDLManager.h>
#include <Renderer/RenderCore.h>
#include <mlx.h> #include <mlx.h>
#include <mlx_extended.h> #include <mlx_extended.h>
#include <Core/Memory.h> #include <Core/Memory.h>
#include <Core/Handles.h> #include <Core/Handles.h>
#include <Renderer/RenderCore.h>
static mlx::Application* __internal_application_ptr = nullptr; static mlx::Application* __internal_application_ptr = nullptr;
@@ -427,4 +427,165 @@ extern "C"
return; return;
gs->TexturePut(texture, x, y, scale_x, scale_y, angle); gs->TexturePut(texture, x, y, scale_x, scale_y, angle);
} }
// Hidden bindings
VkInstance mlx_get_vk_instance(mlx_context mlx)
{
MLX_CHECK_APPLICATION_POINTER(mlx);
return mlx::RenderCore::Get().GetInstance();
}
VkPhysicalDevice mlx_get_vk_physical_device(mlx_context mlx)
{
MLX_CHECK_APPLICATION_POINTER(mlx);
return mlx::RenderCore::Get().GetPhysicalDevice();
}
VkDevice mlx_get_vk_device(mlx_context mlx)
{
MLX_CHECK_APPLICATION_POINTER(mlx);
return mlx::RenderCore::Get().GetDevice();
}
VkQueue mlx_get_vk_graphics_queue(mlx_context mlx)
{
MLX_CHECK_APPLICATION_POINTER(mlx);
return kvfGetDeviceQueue(mlx::RenderCore::Get().GetDevice(), KVF_GRAPHICS_QUEUE);
}
unsigned int mlx_get_vk_graphics_queue_family(mlx_context mlx)
{
MLX_CHECK_APPLICATION_POINTER(mlx);
return kvfGetDeviceQueueFamily(mlx::RenderCore::Get().GetDevice(), KVF_GRAPHICS_QUEUE);
}
mlx_function mlx_get_vk_fn(mlx_context mlx, const char* name)
{
MLX_CHECK_APPLICATION_POINTER(mlx);
#define MLX_VULKAN_GLOBAL_FUNCTION(fn) if(std::strcmp(name, #fn) == 0) return reinterpret_cast<mlx_function>(mlx::RenderCore::Get().fn);
#define MLX_VULKAN_INSTANCE_FUNCTION(fn) if(std::strcmp(name, #fn) == 0) return reinterpret_cast<mlx_function>(mlx::RenderCore::Get().fn);
#define MLX_VULKAN_DEVICE_FUNCTION(fn) if(std::strcmp(name, #fn) == 0) return reinterpret_cast<mlx_function>(mlx::RenderCore::Get().fn);
#include <Renderer/Vulkan/VulkanDefs.h>
#undef MLX_VULKAN_GLOBAL_FUNCTION
#undef MLX_VULKAN_INSTANCE_FUNCTION
#undef MLX_VULKAN_DEVICE_FUNCTION
return nullptr;
}
VkSurfaceKHR mlx_get_vk_surface(mlx_context mlx, mlx_window win)
{
MLX_CHECK_APPLICATION_POINTER(mlx);
mlx::NonOwningPtr<mlx::GraphicsSupport> gs = mlx->app->GetGraphicsSupport(win);
if(!gs)
return nullptr;
return gs->GetRenderer().GetSwapchain().GetSurface();
}
VkImage mlx_get_vk_swapchain_image(mlx_context mlx, mlx_window win, unsigned int index)
{
MLX_CHECK_APPLICATION_POINTER(mlx);
mlx::NonOwningPtr<mlx::GraphicsSupport> gs = mlx->app->GetGraphicsSupport(win);
if(!gs || index > gs->GetRenderer().GetSwapchain().GetImagesCount())
return nullptr;
return gs->GetRenderer().GetSwapchain().GetSwapchainImages()[index].Get();
}
unsigned int mlx_get_vk_swapchain_image_count(mlx_context mlx, mlx_window win)
{
MLX_CHECK_APPLICATION_POINTER(mlx);
mlx::NonOwningPtr<mlx::GraphicsSupport> gs = mlx->app->GetGraphicsSupport(win);
if(!gs)
return 0;
return gs->GetRenderer().GetSwapchain().GetImagesCount();
}
VkImageView mlx_get_vk_swapchain_image_view(mlx_context mlx, mlx_window win, unsigned int index)
{
MLX_CHECK_APPLICATION_POINTER(mlx);
mlx::NonOwningPtr<mlx::GraphicsSupport> gs = mlx->app->GetGraphicsSupport(win);
if(!gs || index > gs->GetRenderer().GetSwapchain().GetImagesCount())
return nullptr;
return gs->GetRenderer().GetSwapchain().GetSwapchainImages()[index].GetImageView();
}
unsigned int mlx_get_current_vk_swapchain_image_index(mlx_context mlx, mlx_window win)
{
MLX_CHECK_APPLICATION_POINTER(mlx);
mlx::NonOwningPtr<mlx::GraphicsSupport> gs = mlx->app->GetGraphicsSupport(win);
if(!gs)
return -1;
return gs->GetRenderer().GetSwapchain().GetImageIndex();
}
VkExtent2D mlx_get_vk_swapchain_extent(mlx_context mlx, mlx_window win)
{
MLX_CHECK_APPLICATION_POINTER(mlx);
mlx::NonOwningPtr<mlx::GraphicsSupport> gs = mlx->app->GetGraphicsSupport(win);
if(!gs)
return {};
return kvfGetSwapchainImagesSize(gs->GetRenderer().GetSwapchain().Get());
}
VkFormat mlx_get_vk_swapchain_format(mlx_context mlx, mlx_window win)
{
MLX_CHECK_APPLICATION_POINTER(mlx);
mlx::NonOwningPtr<mlx::GraphicsSupport> gs = mlx->app->GetGraphicsSupport(win);
if(!gs)
return VK_FORMAT_UNDEFINED;
return kvfGetSwapchainImagesFormat(gs->GetRenderer().GetSwapchain().Get());
}
void* mlx_get_window_handle(mlx_context mlx, mlx_window win)
{
MLX_CHECK_APPLICATION_POINTER(mlx);
mlx::NonOwningPtr<mlx::GraphicsSupport> gs = mlx->app->GetGraphicsSupport(win);
if(!gs || !gs->HasWindow())
return nullptr;
return mlx::SDLManager::Get().GetRawWindow(gs->GetWindow()->GetRawHandle());
}
void mlx_set_sdl_input_hook(mlx_context mlx, void(*f)(void*))
{
MLX_CHECK_APPLICATION_POINTER(mlx);
mlx::SDLManager::Get().SetInputBinding(f);
}
void mlx_add_pre_render_hook(mlx_context mlx, mlx_window win, void(*f)(VkCommandBuffer, void*), void* param)
{
MLX_CHECK_APPLICATION_POINTER(mlx);
mlx::NonOwningPtr<mlx::GraphicsSupport> gs = mlx->app->GetGraphicsSupport(win);
if(!gs)
return;
gs->AddPreRenderHook(f, param);
}
mlx_function mlx_get_proc_addr(mlx_context mlx, const char* name)
{
MLX_CHECK_APPLICATION_POINTER(mlx);
#define MLX_MAKE_ENTRY(fn) { #fn, reinterpret_cast<mlx_function>(fn) }
std::unordered_map<std::string, mlx_function> entries = {
MLX_MAKE_ENTRY(mlx_get_vk_instance),
MLX_MAKE_ENTRY(mlx_get_vk_surface),
MLX_MAKE_ENTRY(mlx_set_sdl_input_hook),
MLX_MAKE_ENTRY(mlx_get_vk_physical_device),
MLX_MAKE_ENTRY(mlx_get_vk_graphics_queue),
MLX_MAKE_ENTRY(mlx_get_vk_graphics_queue_family),
MLX_MAKE_ENTRY(mlx_get_vk_device),
MLX_MAKE_ENTRY(mlx_get_vk_fn),
MLX_MAKE_ENTRY(mlx_get_window_handle),
MLX_MAKE_ENTRY(mlx_get_vk_swapchain_image_count),
MLX_MAKE_ENTRY(mlx_get_vk_swapchain_extent),
MLX_MAKE_ENTRY(mlx_get_vk_swapchain_format),
MLX_MAKE_ENTRY(mlx_get_vk_swapchain_image),
MLX_MAKE_ENTRY(mlx_get_vk_swapchain_image_view),
MLX_MAKE_ENTRY(mlx_get_current_vk_swapchain_image_index),
MLX_MAKE_ENTRY(mlx_add_pre_render_hook),
};
auto it = entries.find(std::string{ name });
if(it != entries.end())
return it->second;
return nullptr;
}
} }
+5
View File
@@ -38,6 +38,11 @@ namespace mlx
m_renderer.BeginFrame(); m_renderer.BeginFrame();
m_draw_layer = 0; m_draw_layer = 0;
m_scene_renderer.Render(*p_scene, m_renderer); m_scene_renderer.Render(*p_scene, m_renderer);
for(const auto& hook : m_hooks)
{
if(hook.fn)
hook.fn(m_renderer.GetActiveCommandBuffer(), hook.param);
}
m_renderer.EndFrame(); m_renderer.EndFrame();
#ifdef GRAPHICS_MEMORY_DUMP #ifdef GRAPHICS_MEMORY_DUMP
// Dump memory usage to file every two seconds // Dump memory usage to file every two seconds
+2 -2
View File
@@ -22,8 +22,8 @@ namespace mlx
using namespace std::literals; using namespace std::literals;
#ifndef DEBUG #ifndef DEBUG
if(type == LogType::Debug) if(type == LogType::Debug && std::getenv("MLX_DEBUG_LOGS") == nullptr)
return; return;
#endif #endif
std::string code_infos; std::string code_infos;
+18 -1
View File
@@ -22,7 +22,7 @@ namespace mlx
MLX_PROFILE_FUNCTION(); MLX_PROFILE_FUNCTION();
s_instance = this; s_instance = this;
m_drop_sdl_responsability = SDL_WasInit(SDL_INIT_VIDEO); m_drop_sdl_responsability = SDL_WasInit(SDL_INIT_VIDEO) || std::getenv("MLX_HEADLESS_MODE") != nullptr;
if(m_drop_sdl_responsability) // is case the mlx is running in a sandbox like MacroUnitTester where SDL is already init if(m_drop_sdl_responsability) // is case the mlx is running in a sandbox like MacroUnitTester where SDL is already init
return; return;
SDL_SetMemoryFunctions(MemManager::Get().Malloc, MemManager::Get().Calloc, MemManager::Get().Realloc, MemManager::Get().Free); SDL_SetMemoryFunctions(MemManager::Get().Malloc, MemManager::Get().Calloc, MemManager::Get().Realloc, MemManager::Get().Free);
@@ -31,6 +31,8 @@ namespace mlx
SDL_SetHint(SDL_HINT_VIDEODRIVER, "wayland,x11"); SDL_SetHint(SDL_HINT_VIDEODRIVER, "wayland,x11");
#endif #endif
//SDL_SetHintWithPriority(SDL_HINT_SHUTDOWN_DBUS_ON_QUIT, "1", SDL_HINT_OVERRIDE);
if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_EVENTS | SDL_INIT_TIMER) != 0) if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_EVENTS | SDL_INIT_TIMER) != 0)
FatalError("SDL: unable to init all subsystems; %", SDL_GetError()); FatalError("SDL: unable to init all subsystems; %", SDL_GetError());
DebugLog("SDL Manager initialized"); DebugLog("SDL Manager initialized");
@@ -78,6 +80,12 @@ namespace mlx
delete infos; delete infos;
} }
SDL_Window* SDLManager::GetRawWindow(Handle window) noexcept
{
Internal::WindowInfos* infos = static_cast<Internal::WindowInfos*>(window);
return infos->window;
}
VkSurfaceKHR SDLManager::CreateVulkanSurface(Handle window, VkInstance instance) const noexcept VkSurfaceKHR SDLManager::CreateVulkanSurface(Handle window, VkInstance instance) const noexcept
{ {
VkSurfaceKHR surface; VkSurfaceKHR surface;
@@ -216,6 +224,11 @@ namespace mlx
return y; return y;
} }
void SDLManager::SetInputBinding(std::function<void(SDL_Event*)> functor)
{
m_binding_hook = std::move(functor);
}
void SDLManager::InputsFetcher(std::function<void(mlx_event_type, int, int)> functor) void SDLManager::InputsFetcher(std::function<void(mlx_event_type, int, int)> functor)
{ {
SDL_Event event; SDL_Event event;
@@ -252,6 +265,7 @@ namespace mlx
case SDL_WINDOWEVENT_FOCUS_GAINED: functor(MLX_WINDOW_EVENT, id, 5); break; case SDL_WINDOWEVENT_FOCUS_GAINED: functor(MLX_WINDOW_EVENT, id, 5); break;
case SDL_WINDOWEVENT_LEAVE: functor(MLX_WINDOW_EVENT, id, 6); break; case SDL_WINDOWEVENT_LEAVE: functor(MLX_WINDOW_EVENT, id, 6); break;
case SDL_WINDOWEVENT_FOCUS_LOST: functor(MLX_WINDOW_EVENT, id, 7); break; case SDL_WINDOWEVENT_FOCUS_LOST: functor(MLX_WINDOW_EVENT, id, 7); break;
case SDL_WINDOWEVENT_SIZE_CHANGED: functor(MLX_WINDOW_EVENT, id, 8); break;
default : break; default : break;
} }
@@ -260,6 +274,9 @@ namespace mlx
default: break; default: break;
} }
if(m_binding_hook)
m_binding_hook(&event);
} }
} }
+9 -2
View File
@@ -7,7 +7,14 @@ namespace mlx
static std::random_device random_device; static std::random_device random_device;
static std::mt19937_64 engine(random_device()); static std::mt19937_64 engine(random_device());
static std::uniform_int_distribution<std::uint64_t> uniform_distribution; static std::uniform_int_distribution<std::uint64_t> uniform_distribution;
static std::unordered_set<std::uint64_t> registry;
UUID::UUID() : m_uuid(uniform_distribution(engine)) {} UUID::UUID()
UUID::UUID(std::uint64_t uuid) : m_uuid(uuid) {} {
do
{
m_uuid = uniform_distribution(engine);
} while(registry.contains(m_uuid));
registry.emplace(m_uuid);
}
} }
+11 -1
View File
@@ -1,11 +1,19 @@
#include <PreCompiled.h> #include <PreCompiled.h>
#include <mlx.h>
#include <Platform/Inputs.h> #include <Platform/Inputs.h>
#include <Core/SDLManager.h> #include <Core/SDLManager.h>
#include <Core/EventBus.h>
namespace mlx namespace mlx
{ {
namespace Internal
{
struct ResizeEventBroadcast : public EventBase
{
Event What() const override { return Event::ResizeEventCode; }
};
}
void Inputs::FetchInputs() void Inputs::FetchInputs()
{ {
SDLManager::Get().InputsFetcher([this](mlx_event_type event, int window_id, int code) SDLManager::Get().InputsFetcher([this](mlx_event_type event, int window_id, int code)
@@ -14,6 +22,8 @@ namespace mlx
return; return;
if(!m_events_hooks.contains(window_id) || m_events_hooks[window_id][event].empty()) if(!m_events_hooks.contains(window_id) || m_events_hooks[window_id][event].empty())
return; return;
if(event == MLX_WINDOW_EVENT && code == 8)
EventBus::SendBroadcast(Internal::ResizeEventBroadcast{});
for(const auto& hook : m_events_hooks[window_id][event]) for(const auto& hook : m_events_hooks[window_id][event])
{ {
if(hook.fn) if(hook.fn)
+1 -1
View File
@@ -81,7 +81,7 @@ namespace mlx
VkCommandBuffer cmd = kvfCreateCommandBuffer(RenderCore::Get().GetDevice()); VkCommandBuffer cmd = kvfCreateCommandBuffer(RenderCore::Get().GetDevice());
kvfBeginCommandBuffer(cmd, VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT); kvfBeginCommandBuffer(cmd, VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT);
kvfCopyBufferToBuffer(cmd, m_buffer, buffer.Get(), m_size); kvfCopyBufferToBuffer(cmd, m_buffer, buffer.Get(), m_size, 0, 0);
kvfEndCommandBuffer(cmd); kvfEndCommandBuffer(cmd);
VkFence fence = kvfCreateFence(RenderCore::Get().GetDevice()); VkFence fence = kvfCreateFence(RenderCore::Get().GetDevice());
kvfSubmitSingleTimeCommandBuffer(RenderCore::Get().GetDevice(), cmd, KVF_GRAPHICS_QUEUE, fence); kvfSubmitSingleTimeCommandBuffer(RenderCore::Get().GetDevice(), cmd, KVF_GRAPHICS_QUEUE, fence);
+5 -2
View File
@@ -112,10 +112,13 @@ namespace mlx
return set; return set;
} }
void DescriptorPool::ReturnDescriptorSet(std::shared_ptr<class DescriptorSet> set) void DescriptorPool::ReturnDescriptorSet(std::shared_ptr<DescriptorSet> set)
{ {
auto it = std::find_if(m_used_sets.begin(), m_used_sets.end(), [&](std::shared_ptr<DescriptorSet> rhs_set) //std::size_t i = 0;
auto it = std::find_if(m_used_sets.begin(), m_used_sets.end(), [&](const std::shared_ptr<DescriptorSet>& rhs_set)
{ {
//i++;
//std::cout << m_used_sets.size() << " " << i << std::endl;
return set == rhs_set; return set == rhs_set;
}); });
if(it == m_used_sets.end()) if(it == m_used_sets.end())
+7 -7
View File
@@ -218,7 +218,7 @@ namespace mlx
void Texture::SetPixel(int x, int y, mlx_color color) noexcept void Texture::SetPixel(int x, int y, mlx_color color) noexcept
{ {
MLX_PROFILE_FUNCTION(); MLX_PROFILE_FUNCTION();
if(x < 0 || y < 0 || static_cast<std::uint32_t>(x) > m_width || static_cast<std::uint32_t>(y) > m_height) if(x < 0 || y < 0 || static_cast<std::uint32_t>(x) >= m_width || static_cast<std::uint32_t>(y) >= m_height)
return; return;
if(!m_staging_buffer.has_value()) if(!m_staging_buffer.has_value())
OpenCPUBuffer(); OpenCPUBuffer();
@@ -232,7 +232,7 @@ namespace mlx
void Texture::SetRegion(int x, int y, int w, int h, mlx_color* pixels) noexcept void Texture::SetRegion(int x, int y, int w, int h, mlx_color* pixels) noexcept
{ {
MLX_PROFILE_FUNCTION(); MLX_PROFILE_FUNCTION();
if(x < 0 || y < 0 || static_cast<std::uint32_t>(x) > m_width || static_cast<std::uint32_t>(y) > m_height) if(x < 0 || y < 0 || static_cast<std::uint32_t>(x) >= m_width || static_cast<std::uint32_t>(y) >= m_height)
return; return;
if(w < 0 || h < 0) if(w < 0 || h < 0)
return; return;
@@ -243,9 +243,9 @@ namespace mlx
if(moving_x >= static_cast<std::uint32_t>(x + w) || moving_x >= m_width) if(moving_x >= static_cast<std::uint32_t>(x + w) || moving_x >= m_width)
{ {
moving_x = x; moving_x = x;
moving_y++;
if(moving_y >= static_cast<std::uint32_t>(y + h) || moving_y >= m_height) if(moving_y >= static_cast<std::uint32_t>(y + h) || moving_y >= m_height)
break; break;
moving_y++;
} }
if constexpr(std::endian::native == std::endian::little) if constexpr(std::endian::native == std::endian::little)
m_staging_buffer->GetMap<mlx_color*>()[(moving_y * m_width) + moving_x] = ReverseColor(pixels[i]); m_staging_buffer->GetMap<mlx_color*>()[(moving_y * m_width) + moving_x] = ReverseColor(pixels[i]);
@@ -258,7 +258,7 @@ namespace mlx
void Texture::SetLinearRegion(int x, int y, std::size_t len, mlx_color* pixels) noexcept void Texture::SetLinearRegion(int x, int y, std::size_t len, mlx_color* pixels) noexcept
{ {
MLX_PROFILE_FUNCTION(); MLX_PROFILE_FUNCTION();
if(x < 0 || y < 0 || static_cast<std::uint32_t>(x) > m_width || static_cast<std::uint32_t>(y) > m_height) if(x < 0 || y < 0 || static_cast<std::uint32_t>(x) >= m_width || static_cast<std::uint32_t>(y) >= m_height)
return; return;
if(!m_staging_buffer.has_value()) if(!m_staging_buffer.has_value())
OpenCPUBuffer(); OpenCPUBuffer();
@@ -282,7 +282,7 @@ namespace mlx
mlx_color Texture::GetPixel(int x, int y) noexcept mlx_color Texture::GetPixel(int x, int y) noexcept
{ {
MLX_PROFILE_FUNCTION(); MLX_PROFILE_FUNCTION();
if(x < 0 || y < 0 || static_cast<std::uint32_t>(x) > m_width || static_cast<std::uint32_t>(y) > m_height) if(x < 0 || y < 0 || static_cast<std::uint32_t>(x) >= m_width || static_cast<std::uint32_t>(y) >= m_height)
return { .rgba = 0x00000000 }; return { .rgba = 0x00000000 };
if(!m_staging_buffer.has_value()) if(!m_staging_buffer.has_value())
OpenCPUBuffer(); OpenCPUBuffer();
@@ -295,7 +295,7 @@ namespace mlx
void Texture::GetRegion(int x, int y, int w, int h, mlx_color* dst) noexcept void Texture::GetRegion(int x, int y, int w, int h, mlx_color* dst) noexcept
{ {
MLX_PROFILE_FUNCTION(); MLX_PROFILE_FUNCTION();
if(x < 0 || y < 0 || static_cast<std::uint32_t>(x) > m_width || static_cast<std::uint32_t>(y) > m_height) if(x < 0 || y < 0 || static_cast<std::uint32_t>(x) >= m_width || static_cast<std::uint32_t>(y) >= m_height)
return; return;
if(!m_staging_buffer.has_value()) if(!m_staging_buffer.has_value())
OpenCPUBuffer(); OpenCPUBuffer();
@@ -304,9 +304,9 @@ namespace mlx
if(moving_x >= static_cast<std::uint32_t>(x + w) || moving_x >= m_width) if(moving_x >= static_cast<std::uint32_t>(x + w) || moving_x >= m_width)
{ {
moving_x = x; moving_x = x;
moving_y++;
if(moving_y >= static_cast<std::uint32_t>(y + h) || moving_y >= m_height) if(moving_y >= static_cast<std::uint32_t>(y + h) || moving_y >= m_height)
break; break;
moving_y++;
} }
if constexpr(std::endian::native == std::endian::little) if constexpr(std::endian::native == std::endian::little)
dst[i] = ReverseColor(m_staging_buffer->GetMap<mlx_color*>()[(moving_y * m_width) + moving_x]); dst[i] = ReverseColor(m_staging_buffer->GetMap<mlx_color*>()[(moving_y * m_width) + moving_x]);
+32 -14
View File
@@ -87,15 +87,24 @@ namespace mlx
kvfSetValidationErrorCallback(&ValidationErrorCallback); kvfSetValidationErrorCallback(&ValidationErrorCallback);
kvfSetValidationWarningCallback(&WarningCallback); kvfSetValidationWarningCallback(&WarningCallback);
mlx_window_create_info info{}; std::vector<const char*> instance_extensions;
info.title = ""; VkSurfaceKHR surface = VK_NULL_HANDLE;
info.width = 1; std::unique_ptr<Window> window;
info.height = 1;
Window window(&info, true); bool is_headless = std::getenv("MLX_HEADLESS_MODE") != nullptr;
std::vector<const char*> instance_extensions = window.GetRequiredVulkanInstanceExtentions();
#ifdef MLX_PLAT_MACOS if(!is_headless)
instance_extensions.push_back(VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME); {
#endif mlx_window_create_info info{};
info.title = "";
info.width = 1;
info.height = 1;
window = std::make_unique<Window>(&info, true);
instance_extensions = window->GetRequiredVulkanInstanceExtentions();
#ifdef MLX_PLAT_MACOS
instance_extensions.push_back(VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME);
#endif
}
m_instance = kvfCreateInstance(instance_extensions.data(), instance_extensions.size()); m_instance = kvfCreateInstance(instance_extensions.data(), instance_extensions.size());
DebugLog("Vulkan: instance created"); DebugLog("Vulkan: instance created");
@@ -103,25 +112,34 @@ namespace mlx
loader->LoadInstance(m_instance); loader->LoadInstance(m_instance);
LoadKVFInstanceVulkanFunctionPointers(); LoadKVFInstanceVulkanFunctionPointers();
VkSurfaceKHR surface = window.CreateVulkanSurface(m_instance); if(!is_headless)
{
surface = window->CreateVulkanSurface(m_instance);
m_physical_device = kvfPickGoodDefaultPhysicalDevice(m_instance, surface);
}
else
m_physical_device = kvfPickGoodPhysicalDevice(m_instance, VK_NULL_HANDLE, nullptr, 0);
m_physical_device = kvfPickGoodDefaultPhysicalDevice(m_instance, surface); Verify(m_physical_device != VK_NULL_HANDLE, "Could not find a suitable physical device");
// just for style // just for style
VkPhysicalDeviceProperties props; VkPhysicalDeviceProperties props;
vkGetPhysicalDeviceProperties(m_physical_device, &props); vkGetPhysicalDeviceProperties(m_physical_device, &props);
DebugLog("Vulkan: physical device picked '%'", props.deviceName); DebugLog("Vulkan: physical device picked '%'", props.deviceName);
const char* device_extensions[] = { VK_KHR_SWAPCHAIN_EXTENSION_NAME }; std::vector<const char*> device_extensions;
if(!is_headless)
device_extensions.push_back(VK_KHR_SWAPCHAIN_EXTENSION_NAME);
VkPhysicalDeviceFeatures features{}; VkPhysicalDeviceFeatures features{};
vkGetPhysicalDeviceFeatures(m_physical_device, &features); vkGetPhysicalDeviceFeatures(m_physical_device, &features);
m_device = kvfCreateDevice(m_physical_device, device_extensions, sizeof(device_extensions) / sizeof(device_extensions[0]), &features); m_device = kvfCreateDevice(m_physical_device, device_extensions.data(), device_extensions.size(), &features);
DebugLog("Vulkan: logical device created"); DebugLog("Vulkan: logical device created");
loader->LoadDevice(m_device); loader->LoadDevice(m_device);
LoadKVFDeviceVulkanFunctionPointers(); LoadKVFDeviceVulkanFunctionPointers();
vkDestroySurfaceKHR(m_instance, surface, nullptr); if(surface != VK_NULL_HANDLE)
vkDestroySurfaceKHR(m_instance, surface, nullptr);
VkAllocationCallbacks callbacks; VkAllocationCallbacks callbacks;
callbacks.pUserData = nullptr; callbacks.pUserData = nullptr;
+10 -2
View File
@@ -16,7 +16,6 @@ namespace mlx
}; };
} }
std::string VulkanFormatName(VkFormat format) std::string VulkanFormatName(VkFormat format)
{ {
#define STRINGIFY(x) case x: return #x #define STRINGIFY(x) case x: return #x
@@ -159,7 +158,16 @@ namespace mlx
void Swapchain::Init(NonOwningPtr<Window> window) void Swapchain::Init(NonOwningPtr<Window> window)
{ {
p_window = window; p_window = window;
std::function<void(const EventBase&)> functor = [this](const EventBase& event)
{
if(event.What() == Event::ResizeEventCode && !m_resize)
m_resize = true;
};
EventBus::RegisterListener({ functor, "mlx_swapchain_" + std::to_string(reinterpret_cast<std::uintptr_t>(this)) });
CreateSwapchain(); CreateSwapchain();
m_resize = false;
} }
void Swapchain::AquireFrame(VkSemaphore signal) void Swapchain::AquireFrame(VkSemaphore signal)
@@ -170,6 +178,7 @@ namespace mlx
Destroy(); Destroy();
CreateSwapchain(); CreateSwapchain();
EventBus::SendBroadcast(Internal::ResizeEventBroadcast{}); EventBus::SendBroadcast(Internal::ResizeEventBroadcast{});
m_resize = false;
} }
VkResult result = RenderCore::Get().vkAcquireNextImageKHR(RenderCore::Get().GetDevice(), m_swapchain, UINT64_MAX, signal, VK_NULL_HANDLE, &m_current_image_index); VkResult result = RenderCore::Get().vkAcquireNextImageKHR(RenderCore::Get().GetDevice(), m_swapchain, UINT64_MAX, signal, VK_NULL_HANDLE, &m_current_image_index);
@@ -245,7 +254,6 @@ namespace mlx
kvfSubmitSingleTimeCommandBuffer(RenderCore::Get().GetDevice(), cmd, KVF_GRAPHICS_QUEUE, fence); kvfSubmitSingleTimeCommandBuffer(RenderCore::Get().GetDevice(), cmd, KVF_GRAPHICS_QUEUE, fence);
kvfDestroyFence(RenderCore::Get().GetDevice(), fence); kvfDestroyFence(RenderCore::Get().GetDevice(), fence);
kvfDestroyCommandBuffer(RenderCore::Get().GetDevice(), cmd); kvfDestroyCommandBuffer(RenderCore::Get().GetDevice(), cmd);
m_resize = false;
DebugLog("Vulkan: swapchain created with format %", VulkanFormatName(format)); DebugLog("Vulkan: swapchain created with format %", VulkanFormatName(format));
} }
} }
@@ -28,6 +28,10 @@ namespace mlx
{ {
static inline PFN_vkVoidFunction vkGetInstanceProcAddrStub(Handle context, const char* name) static inline PFN_vkVoidFunction vkGetInstanceProcAddrStub(Handle context, const char* name)
{ {
bool is_headless = std::getenv("MLX_HEADLESS_MODE") != nullptr;
if(is_headless && std::string_view(name).find("KHR") != std::string_view::npos)
return nullptr;
PFN_vkVoidFunction function = RenderCore::Get().vkGetInstanceProcAddr(static_cast<VkInstance>(context), name); PFN_vkVoidFunction function = RenderCore::Get().vkGetInstanceProcAddr(static_cast<VkInstance>(context), name);
if(!function) if(!function)
FatalError("Vulkan Loader: could not load '%'", name); FatalError("Vulkan Loader: could not load '%'", name);
@@ -37,6 +41,10 @@ namespace mlx
static inline PFN_vkVoidFunction vkGetDeviceProcAddrStub(Handle context, const char* name) static inline PFN_vkVoidFunction vkGetDeviceProcAddrStub(Handle context, const char* name)
{ {
bool is_headless = std::getenv("MLX_HEADLESS_MODE") != nullptr;
if(is_headless && std::string_view(name).find("KHR") != std::string_view::npos)
return nullptr;
PFN_vkVoidFunction function = RenderCore::Get().vkGetDeviceProcAddr(static_cast<VkDevice>(context), name); PFN_vkVoidFunction function = RenderCore::Get().vkGetDeviceProcAddr(static_cast<VkDevice>(context), name);
if(!function) if(!function)
FatalError("Vulkan Loader: could not load '%'", name); FatalError("Vulkan Loader: could not load '%'", name);
+9 -9
View File
@@ -51,7 +51,7 @@
#ifndef KBZ_8_VULKAN_FRAMEWORK_H #ifndef KBZ_8_VULKAN_FRAMEWORK_H
#define KBZ_8_VULKAN_FRAMEWORK_H #define KBZ_8_VULKAN_FRAMEWORK_H
#ifdef KVF_IMPL_VK_NO_PROTOTYPES #if defined(KVF_IMPL_VK_NO_PROTOTYPES) && !defined(VK_NO_PROTOTYPES)
#define VK_NO_PROTOTYPES #define VK_NO_PROTOTYPES
#endif #endif
@@ -159,7 +159,7 @@ VkSampler kvfCreateSampler(VkDevice device, VkFilter filters, VkSamplerAddressMo
void kvfDestroySampler(VkDevice device, VkSampler sampler); void kvfDestroySampler(VkDevice device, VkSampler sampler);
VkBuffer kvfCreateBuffer(VkDevice device, VkBufferUsageFlags usage, VkDeviceSize size); VkBuffer kvfCreateBuffer(VkDevice device, VkBufferUsageFlags usage, VkDeviceSize size);
void kvfCopyBufferToBuffer(VkCommandBuffer cmd, VkBuffer dst, VkBuffer src, size_t size); void kvfCopyBufferToBuffer(VkCommandBuffer cmd, VkBuffer dst, VkBuffer src, size_t size, size_t src_offset, size_t dst_offset);
void kvfCopyBufferToImage(VkCommandBuffer cmd, VkImage dst, VkBuffer src, size_t buffer_offset, VkImageAspectFlagBits aspect, VkExtent3D extent); void kvfCopyBufferToImage(VkCommandBuffer cmd, VkImage dst, VkBuffer src, size_t buffer_offset, VkImageAspectFlagBits aspect, VkExtent3D extent);
void kvfDestroyBuffer(VkDevice device, VkBuffer buffer); void kvfDestroyBuffer(VkDevice device, VkBuffer buffer);
@@ -374,12 +374,12 @@ void kvfCheckVk(VkResult result);
#ifdef KVF_DESCRIPTOR_POOL_CAPACITY #ifdef KVF_DESCRIPTOR_POOL_CAPACITY
#undef KVF_DESCRIPTOR_POOL_CAPACITY #undef KVF_DESCRIPTOR_POOL_CAPACITY
#endif #endif
#define KVF_DESCRIPTOR_POOL_CAPACITY 512 #define KVF_DESCRIPTOR_POOL_CAPACITY 1024
#ifdef KVF_COMMAND_POOL_CAPACITY #ifdef KVF_COMMAND_POOL_CAPACITY
#undef KVF_COMMAND_POOL_CAPACITY #undef KVF_COMMAND_POOL_CAPACITY
#endif #endif
#define KVF_COMMAND_POOL_CAPACITY 512 #define KVF_COMMAND_POOL_CAPACITY 1024
typedef struct typedef struct
{ {
@@ -560,6 +560,7 @@ void __kvfCompleteDevice(VkPhysicalDevice physical, VkDevice device)
kvf_device->device = device; kvf_device->device = device;
kvf_device->cmd_pool = pool; kvf_device->cmd_pool = pool;
kvf_device->callbacks = NULL;
kvf_device->sets_pools = NULL; kvf_device->sets_pools = NULL;
kvf_device->sets_pools_size = 0; kvf_device->sets_pools_size = 0;
kvf_device->cmd_buffers_size = 0; kvf_device->cmd_buffers_size = 0;
@@ -1474,9 +1475,6 @@ int32_t __kvfScorePhysicalDevice(VkPhysicalDevice device, VkSurfaceKHR surface,
if(device_props.deviceType == VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU) if(device_props.deviceType == VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU)
score += 1000; score += 1000;
if(!device_features.geometryShader)
return -1;
score += device_props.limits.maxImageDimension2D; score += device_props.limits.maxImageDimension2D;
score += device_props.limits.maxBoundDescriptorSets; score += device_props.limits.maxBoundDescriptorSets;
@@ -2277,7 +2275,7 @@ VkBuffer kvfCreateBuffer(VkDevice device, VkBufferUsageFlags usage, VkDeviceSize
return buffer; return buffer;
} }
void kvfCopyBufferToBuffer(VkCommandBuffer cmd, VkBuffer dst, VkBuffer src, size_t size) void kvfCopyBufferToBuffer(VkCommandBuffer cmd, VkBuffer dst, VkBuffer src, size_t size, size_t src_offset, size_t dst_offset)
{ {
KVF_ASSERT(cmd != VK_NULL_HANDLE); KVF_ASSERT(cmd != VK_NULL_HANDLE);
KVF_ASSERT(dst != VK_NULL_HANDLE); KVF_ASSERT(dst != VK_NULL_HANDLE);
@@ -2288,6 +2286,8 @@ void kvfCopyBufferToBuffer(VkCommandBuffer cmd, VkBuffer dst, VkBuffer src, size
#endif #endif
VkBufferCopy copy_region = {}; VkBufferCopy copy_region = {};
copy_region.size = size; copy_region.size = size;
copy_region.srcOffset = src_offset;
copy_region.dstOffset = dst_offset;
KVF_GET_DEVICE_FUNCTION(vkCmdCopyBuffer)(cmd, src, dst, 1, &copy_region); KVF_GET_DEVICE_FUNCTION(vkCmdCopyBuffer)(cmd, src, dst, 1, &copy_region);
} }
@@ -2543,7 +2543,7 @@ VkAttachmentDescription kvfBuildAttachmentDescription(KvfImageType type, VkForma
__KvfSwapchain* kvf_swapchain = __kvfGetKvfSwapchainFromVkSwapchainKHR(swapchain); __KvfSwapchain* kvf_swapchain = __kvfGetKvfSwapchainFromVkSwapchainKHR(swapchain);
KVF_ASSERT(kvf_swapchain != NULL); KVF_ASSERT(kvf_swapchain != NULL);
KVF_ASSERT(kvf_swapchain->images_count != 0); KVF_ASSERT(kvf_swapchain->images_count != 0);
return kvfBuildAttachmentDescription(KVF_IMAGE_COLOR, kvf_swapchain->images_format, VK_IMAGE_LAYOUT_UNDEFINED,VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, clear, VK_SAMPLE_COUNT_1_BIT); return kvfBuildAttachmentDescription(KVF_IMAGE_COLOR, kvf_swapchain->images_format, VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, clear, VK_SAMPLE_COUNT_1_BIT);
} }
#endif #endif
+151
View File
@@ -0,0 +1,151 @@
#ifndef VULKAN_VIDEO_CODEC_VP9STD_H_
#define VULKAN_VIDEO_CODEC_VP9STD_H_ 1
/*
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#ifdef __cplusplus
extern "C" {
#endif
// vulkan_video_codec_vp9std is a preprocessor guard. Do not pass it to API calls.
#define vulkan_video_codec_vp9std 1
#include "vulkan_video_codecs_common.h"
#define STD_VIDEO_VP9_NUM_REF_FRAMES 8
#define STD_VIDEO_VP9_REFS_PER_FRAME 3
#define STD_VIDEO_VP9_MAX_REF_FRAMES 4
#define STD_VIDEO_VP9_LOOP_FILTER_ADJUSTMENTS 2
#define STD_VIDEO_VP9_MAX_SEGMENTS 8
#define STD_VIDEO_VP9_SEG_LVL_MAX 4
#define STD_VIDEO_VP9_MAX_SEGMENTATION_TREE_PROBS 7
#define STD_VIDEO_VP9_MAX_SEGMENTATION_PRED_PROB 3
typedef enum StdVideoVP9Profile {
STD_VIDEO_VP9_PROFILE_0 = 0,
STD_VIDEO_VP9_PROFILE_1 = 1,
STD_VIDEO_VP9_PROFILE_2 = 2,
STD_VIDEO_VP9_PROFILE_3 = 3,
STD_VIDEO_VP9_PROFILE_INVALID = 0x7FFFFFFF,
STD_VIDEO_VP9_PROFILE_MAX_ENUM = 0x7FFFFFFF
} StdVideoVP9Profile;
typedef enum StdVideoVP9Level {
STD_VIDEO_VP9_LEVEL_1_0 = 0,
STD_VIDEO_VP9_LEVEL_1_1 = 1,
STD_VIDEO_VP9_LEVEL_2_0 = 2,
STD_VIDEO_VP9_LEVEL_2_1 = 3,
STD_VIDEO_VP9_LEVEL_3_0 = 4,
STD_VIDEO_VP9_LEVEL_3_1 = 5,
STD_VIDEO_VP9_LEVEL_4_0 = 6,
STD_VIDEO_VP9_LEVEL_4_1 = 7,
STD_VIDEO_VP9_LEVEL_5_0 = 8,
STD_VIDEO_VP9_LEVEL_5_1 = 9,
STD_VIDEO_VP9_LEVEL_5_2 = 10,
STD_VIDEO_VP9_LEVEL_6_0 = 11,
STD_VIDEO_VP9_LEVEL_6_1 = 12,
STD_VIDEO_VP9_LEVEL_6_2 = 13,
STD_VIDEO_VP9_LEVEL_INVALID = 0x7FFFFFFF,
STD_VIDEO_VP9_LEVEL_MAX_ENUM = 0x7FFFFFFF
} StdVideoVP9Level;
typedef enum StdVideoVP9FrameType {
STD_VIDEO_VP9_FRAME_TYPE_KEY = 0,
STD_VIDEO_VP9_FRAME_TYPE_NON_KEY = 1,
STD_VIDEO_VP9_FRAME_TYPE_INVALID = 0x7FFFFFFF,
STD_VIDEO_VP9_FRAME_TYPE_MAX_ENUM = 0x7FFFFFFF
} StdVideoVP9FrameType;
typedef enum StdVideoVP9ReferenceName {
STD_VIDEO_VP9_REFERENCE_NAME_INTRA_FRAME = 0,
STD_VIDEO_VP9_REFERENCE_NAME_LAST_FRAME = 1,
STD_VIDEO_VP9_REFERENCE_NAME_GOLDEN_FRAME = 2,
STD_VIDEO_VP9_REFERENCE_NAME_ALTREF_FRAME = 3,
STD_VIDEO_VP9_REFERENCE_NAME_INVALID = 0x7FFFFFFF,
STD_VIDEO_VP9_REFERENCE_NAME_MAX_ENUM = 0x7FFFFFFF
} StdVideoVP9ReferenceName;
typedef enum StdVideoVP9InterpolationFilter {
STD_VIDEO_VP9_INTERPOLATION_FILTER_EIGHTTAP = 0,
STD_VIDEO_VP9_INTERPOLATION_FILTER_EIGHTTAP_SMOOTH = 1,
STD_VIDEO_VP9_INTERPOLATION_FILTER_EIGHTTAP_SHARP = 2,
STD_VIDEO_VP9_INTERPOLATION_FILTER_BILINEAR = 3,
STD_VIDEO_VP9_INTERPOLATION_FILTER_SWITCHABLE = 4,
STD_VIDEO_VP9_INTERPOLATION_FILTER_INVALID = 0x7FFFFFFF,
STD_VIDEO_VP9_INTERPOLATION_FILTER_MAX_ENUM = 0x7FFFFFFF
} StdVideoVP9InterpolationFilter;
typedef enum StdVideoVP9ColorSpace {
STD_VIDEO_VP9_COLOR_SPACE_UNKNOWN = 0,
STD_VIDEO_VP9_COLOR_SPACE_BT_601 = 1,
STD_VIDEO_VP9_COLOR_SPACE_BT_709 = 2,
STD_VIDEO_VP9_COLOR_SPACE_SMPTE_170 = 3,
STD_VIDEO_VP9_COLOR_SPACE_SMPTE_240 = 4,
STD_VIDEO_VP9_COLOR_SPACE_BT_2020 = 5,
STD_VIDEO_VP9_COLOR_SPACE_RESERVED = 6,
STD_VIDEO_VP9_COLOR_SPACE_RGB = 7,
STD_VIDEO_VP9_COLOR_SPACE_INVALID = 0x7FFFFFFF,
STD_VIDEO_VP9_COLOR_SPACE_MAX_ENUM = 0x7FFFFFFF
} StdVideoVP9ColorSpace;
typedef struct StdVideoVP9ColorConfigFlags {
uint32_t color_range : 1;
uint32_t reserved : 31;
} StdVideoVP9ColorConfigFlags;
typedef struct StdVideoVP9ColorConfig {
StdVideoVP9ColorConfigFlags flags;
uint8_t BitDepth;
uint8_t subsampling_x;
uint8_t subsampling_y;
uint8_t reserved1;
StdVideoVP9ColorSpace color_space;
} StdVideoVP9ColorConfig;
typedef struct StdVideoVP9LoopFilterFlags {
uint32_t loop_filter_delta_enabled : 1;
uint32_t loop_filter_delta_update : 1;
uint32_t reserved : 30;
} StdVideoVP9LoopFilterFlags;
typedef struct StdVideoVP9LoopFilter {
StdVideoVP9LoopFilterFlags flags;
uint8_t loop_filter_level;
uint8_t loop_filter_sharpness;
uint8_t update_ref_delta;
int8_t loop_filter_ref_deltas[STD_VIDEO_VP9_MAX_REF_FRAMES];
uint8_t update_mode_delta;
int8_t loop_filter_mode_deltas[STD_VIDEO_VP9_LOOP_FILTER_ADJUSTMENTS];
} StdVideoVP9LoopFilter;
typedef struct StdVideoVP9SegmentationFlags {
uint32_t segmentation_update_map : 1;
uint32_t segmentation_temporal_update : 1;
uint32_t segmentation_update_data : 1;
uint32_t segmentation_abs_or_delta_update : 1;
uint32_t reserved : 28;
} StdVideoVP9SegmentationFlags;
typedef struct StdVideoVP9Segmentation {
StdVideoVP9SegmentationFlags flags;
uint8_t segmentation_tree_probs[STD_VIDEO_VP9_MAX_SEGMENTATION_TREE_PROBS];
uint8_t segmentation_pred_prob[STD_VIDEO_VP9_MAX_SEGMENTATION_PRED_PROB];
uint8_t FeatureEnabled[STD_VIDEO_VP9_MAX_SEGMENTS];
int16_t FeatureData[STD_VIDEO_VP9_MAX_SEGMENTS][STD_VIDEO_VP9_SEG_LVL_MAX];
} StdVideoVP9Segmentation;
#ifdef __cplusplus
}
#endif
#endif
+68
View File
@@ -0,0 +1,68 @@
#ifndef VULKAN_VIDEO_CODEC_VP9STD_DECODE_H_
#define VULKAN_VIDEO_CODEC_VP9STD_DECODE_H_ 1
/*
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#ifdef __cplusplus
extern "C" {
#endif
// vulkan_video_codec_vp9std_decode is a preprocessor guard. Do not pass it to API calls.
#define vulkan_video_codec_vp9std_decode 1
#include "vulkan_video_codec_vp9std.h"
#define VK_STD_VULKAN_VIDEO_CODEC_VP9_DECODE_API_VERSION_1_0_0 VK_MAKE_VIDEO_STD_VERSION(1, 0, 0)
#define VK_STD_VULKAN_VIDEO_CODEC_VP9_DECODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_VP9_DECODE_API_VERSION_1_0_0
#define VK_STD_VULKAN_VIDEO_CODEC_VP9_DECODE_EXTENSION_NAME "VK_STD_vulkan_video_codec_vp9_decode"
typedef struct StdVideoDecodeVP9PictureInfoFlags {
uint32_t error_resilient_mode : 1;
uint32_t intra_only : 1;
uint32_t allow_high_precision_mv : 1;
uint32_t refresh_frame_context : 1;
uint32_t frame_parallel_decoding_mode : 1;
uint32_t segmentation_enabled : 1;
uint32_t show_frame : 1;
uint32_t UsePrevFrameMvs : 1;
uint32_t reserved : 24;
} StdVideoDecodeVP9PictureInfoFlags;
typedef struct StdVideoDecodeVP9PictureInfo {
StdVideoDecodeVP9PictureInfoFlags flags;
StdVideoVP9Profile profile;
StdVideoVP9FrameType frame_type;
uint8_t frame_context_idx;
uint8_t reset_frame_context;
uint8_t refresh_frame_flags;
uint8_t ref_frame_sign_bias_mask;
StdVideoVP9InterpolationFilter interpolation_filter;
uint8_t base_q_idx;
int8_t delta_q_y_dc;
int8_t delta_q_uv_dc;
int8_t delta_q_uv_ac;
uint8_t tile_cols_log2;
uint8_t tile_rows_log2;
uint16_t reserved1[3];
const StdVideoVP9ColorConfig* pColorConfig;
const StdVideoVP9LoopFilter* pLoopFilter;
const StdVideoVP9Segmentation* pSegmentation;
} StdVideoDecodeVP9PictureInfo;
#ifdef __cplusplus
}
#endif
#endif
+784 -361
View File
File diff suppressed because it is too large Load Diff
+4244 -3660
View File
File diff suppressed because it is too large Load Diff
+4
View File
@@ -96,4 +96,8 @@
#include "vulkan_beta.h" #include "vulkan_beta.h"
#endif #endif
#ifdef VK_USE_PLATFORM_OHOS
#include "vulkan_ohos.h"
#endif
#endif // VULKAN_H_ #endif // VULKAN_H_
+10915 -18448
View File
File diff suppressed because it is too large Load Diff
+6
View File
@@ -35,12 +35,14 @@ typedef struct VkAndroidSurfaceCreateInfoKHR {
typedef VkResult (VKAPI_PTR *PFN_vkCreateAndroidSurfaceKHR)(VkInstance instance, const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); typedef VkResult (VKAPI_PTR *PFN_vkCreateAndroidSurfaceKHR)(VkInstance instance, const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
#ifndef VK_NO_PROTOTYPES #ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateAndroidSurfaceKHR( VKAPI_ATTR VkResult VKAPI_CALL vkCreateAndroidSurfaceKHR(
VkInstance instance, VkInstance instance,
const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, const VkAndroidSurfaceCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface); VkSurfaceKHR* pSurface);
#endif #endif
#endif
// VK_ANDROID_external_memory_android_hardware_buffer is a preprocessor guard. Do not pass it to API calls. // VK_ANDROID_external_memory_android_hardware_buffer is a preprocessor guard. Do not pass it to API calls.
@@ -109,16 +111,20 @@ typedef VkResult (VKAPI_PTR *PFN_vkGetAndroidHardwareBufferPropertiesANDROID)(Vk
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryAndroidHardwareBufferANDROID)(VkDevice device, const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, struct AHardwareBuffer** pBuffer); typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryAndroidHardwareBufferANDROID)(VkDevice device, const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, struct AHardwareBuffer** pBuffer);
#ifndef VK_NO_PROTOTYPES #ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetAndroidHardwareBufferPropertiesANDROID( VKAPI_ATTR VkResult VKAPI_CALL vkGetAndroidHardwareBufferPropertiesANDROID(
VkDevice device, VkDevice device,
const struct AHardwareBuffer* buffer, const struct AHardwareBuffer* buffer,
VkAndroidHardwareBufferPropertiesANDROID* pProperties); VkAndroidHardwareBufferPropertiesANDROID* pProperties);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryAndroidHardwareBufferANDROID( VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryAndroidHardwareBufferANDROID(
VkDevice device, VkDevice device,
const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo,
struct AHardwareBuffer** pBuffer); struct AHardwareBuffer** pBuffer);
#endif #endif
#endif
// VK_ANDROID_external_format_resolve is a preprocessor guard. Do not pass it to API calls. // VK_ANDROID_external_format_resolve is a preprocessor guard. Do not pass it to API calls.
+119 -1
View File
@@ -120,7 +120,7 @@ typedef struct VkPipelineShaderStageNodeCreateInfoAMDX {
uint32_t index; uint32_t index;
} VkPipelineShaderStageNodeCreateInfoAMDX; } VkPipelineShaderStageNodeCreateInfoAMDX;
typedef VkResult (VKAPI_PTR *PFN_vkCreateExecutionGraphPipelinesAMDX)(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkExecutionGraphPipelineCreateInfoAMDX* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines); typedef VkResult (VKAPI_PTR *PFN_vkCreateExecutionGraphPipelinesAMDX)(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkExecutionGraphPipelineCreateInfoAMDX* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines);
typedef VkResult (VKAPI_PTR *PFN_vkGetExecutionGraphPipelineScratchSizeAMDX)(VkDevice device, VkPipeline executionGraph, VkExecutionGraphPipelineScratchSizeAMDX* pSizeInfo); typedef VkResult (VKAPI_PTR *PFN_vkGetExecutionGraphPipelineScratchSizeAMDX)(VkDevice device, VkPipeline executionGraph, VkExecutionGraphPipelineScratchSizeAMDX* pSizeInfo);
typedef VkResult (VKAPI_PTR *PFN_vkGetExecutionGraphPipelineNodeIndexAMDX)(VkDevice device, VkPipeline executionGraph, const VkPipelineShaderStageNodeCreateInfoAMDX* pNodeInfo, uint32_t* pNodeIndex); typedef VkResult (VKAPI_PTR *PFN_vkGetExecutionGraphPipelineNodeIndexAMDX)(VkDevice device, VkPipeline executionGraph, const VkPipelineShaderStageNodeCreateInfoAMDX* pNodeInfo, uint32_t* pNodeIndex);
typedef void (VKAPI_PTR *PFN_vkCmdInitializeGraphScratchMemoryAMDX)(VkCommandBuffer commandBuffer, VkPipeline executionGraph, VkDeviceAddress scratch, VkDeviceSize scratchSize); typedef void (VKAPI_PTR *PFN_vkCmdInitializeGraphScratchMemoryAMDX)(VkCommandBuffer commandBuffer, VkPipeline executionGraph, VkDeviceAddress scratch, VkDeviceSize scratchSize);
@@ -129,6 +129,7 @@ typedef void (VKAPI_PTR *PFN_vkCmdDispatchGraphIndirectAMDX)(VkCommandBuffer
typedef void (VKAPI_PTR *PFN_vkCmdDispatchGraphIndirectCountAMDX)(VkCommandBuffer commandBuffer, VkDeviceAddress scratch, VkDeviceSize scratchSize, VkDeviceAddress countInfo); typedef void (VKAPI_PTR *PFN_vkCmdDispatchGraphIndirectCountAMDX)(VkCommandBuffer commandBuffer, VkDeviceAddress scratch, VkDeviceSize scratchSize, VkDeviceAddress countInfo);
#ifndef VK_NO_PROTOTYPES #ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateExecutionGraphPipelinesAMDX( VKAPI_ATTR VkResult VKAPI_CALL vkCreateExecutionGraphPipelinesAMDX(
VkDevice device, VkDevice device,
VkPipelineCache pipelineCache, VkPipelineCache pipelineCache,
@@ -136,42 +137,159 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateExecutionGraphPipelinesAMDX(
const VkExecutionGraphPipelineCreateInfoAMDX* pCreateInfos, const VkExecutionGraphPipelineCreateInfoAMDX* pCreateInfos,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkPipeline* pPipelines); VkPipeline* pPipelines);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetExecutionGraphPipelineScratchSizeAMDX( VKAPI_ATTR VkResult VKAPI_CALL vkGetExecutionGraphPipelineScratchSizeAMDX(
VkDevice device, VkDevice device,
VkPipeline executionGraph, VkPipeline executionGraph,
VkExecutionGraphPipelineScratchSizeAMDX* pSizeInfo); VkExecutionGraphPipelineScratchSizeAMDX* pSizeInfo);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetExecutionGraphPipelineNodeIndexAMDX( VKAPI_ATTR VkResult VKAPI_CALL vkGetExecutionGraphPipelineNodeIndexAMDX(
VkDevice device, VkDevice device,
VkPipeline executionGraph, VkPipeline executionGraph,
const VkPipelineShaderStageNodeCreateInfoAMDX* pNodeInfo, const VkPipelineShaderStageNodeCreateInfoAMDX* pNodeInfo,
uint32_t* pNodeIndex); uint32_t* pNodeIndex);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR void VKAPI_CALL vkCmdInitializeGraphScratchMemoryAMDX( VKAPI_ATTR void VKAPI_CALL vkCmdInitializeGraphScratchMemoryAMDX(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkPipeline executionGraph, VkPipeline executionGraph,
VkDeviceAddress scratch, VkDeviceAddress scratch,
VkDeviceSize scratchSize); VkDeviceSize scratchSize);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR void VKAPI_CALL vkCmdDispatchGraphAMDX( VKAPI_ATTR void VKAPI_CALL vkCmdDispatchGraphAMDX(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkDeviceAddress scratch, VkDeviceAddress scratch,
VkDeviceSize scratchSize, VkDeviceSize scratchSize,
const VkDispatchGraphCountInfoAMDX* pCountInfo); const VkDispatchGraphCountInfoAMDX* pCountInfo);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR void VKAPI_CALL vkCmdDispatchGraphIndirectAMDX( VKAPI_ATTR void VKAPI_CALL vkCmdDispatchGraphIndirectAMDX(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkDeviceAddress scratch, VkDeviceAddress scratch,
VkDeviceSize scratchSize, VkDeviceSize scratchSize,
const VkDispatchGraphCountInfoAMDX* pCountInfo); const VkDispatchGraphCountInfoAMDX* pCountInfo);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR void VKAPI_CALL vkCmdDispatchGraphIndirectCountAMDX( VKAPI_ATTR void VKAPI_CALL vkCmdDispatchGraphIndirectCountAMDX(
VkCommandBuffer commandBuffer, VkCommandBuffer commandBuffer,
VkDeviceAddress scratch, VkDeviceAddress scratch,
VkDeviceSize scratchSize, VkDeviceSize scratchSize,
VkDeviceAddress countInfo); VkDeviceAddress countInfo);
#endif #endif
#endif
// VK_NV_cuda_kernel_launch is a preprocessor guard. Do not pass it to API calls.
#define VK_NV_cuda_kernel_launch 1
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCudaModuleNV)
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCudaFunctionNV)
#define VK_NV_CUDA_KERNEL_LAUNCH_SPEC_VERSION 2
#define VK_NV_CUDA_KERNEL_LAUNCH_EXTENSION_NAME "VK_NV_cuda_kernel_launch"
typedef struct VkCudaModuleCreateInfoNV {
VkStructureType sType;
const void* pNext;
size_t dataSize;
const void* pData;
} VkCudaModuleCreateInfoNV;
typedef struct VkCudaFunctionCreateInfoNV {
VkStructureType sType;
const void* pNext;
VkCudaModuleNV module;
const char* pName;
} VkCudaFunctionCreateInfoNV;
typedef struct VkCudaLaunchInfoNV {
VkStructureType sType;
const void* pNext;
VkCudaFunctionNV function;
uint32_t gridDimX;
uint32_t gridDimY;
uint32_t gridDimZ;
uint32_t blockDimX;
uint32_t blockDimY;
uint32_t blockDimZ;
uint32_t sharedMemBytes;
size_t paramCount;
const void* const * pParams;
size_t extraCount;
const void* const * pExtras;
} VkCudaLaunchInfoNV;
typedef struct VkPhysicalDeviceCudaKernelLaunchFeaturesNV {
VkStructureType sType;
void* pNext;
VkBool32 cudaKernelLaunchFeatures;
} VkPhysicalDeviceCudaKernelLaunchFeaturesNV;
typedef struct VkPhysicalDeviceCudaKernelLaunchPropertiesNV {
VkStructureType sType;
void* pNext;
uint32_t computeCapabilityMinor;
uint32_t computeCapabilityMajor;
} VkPhysicalDeviceCudaKernelLaunchPropertiesNV;
typedef VkResult (VKAPI_PTR *PFN_vkCreateCudaModuleNV)(VkDevice device, const VkCudaModuleCreateInfoNV* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkCudaModuleNV* pModule);
typedef VkResult (VKAPI_PTR *PFN_vkGetCudaModuleCacheNV)(VkDevice device, VkCudaModuleNV module, size_t* pCacheSize, void* pCacheData);
typedef VkResult (VKAPI_PTR *PFN_vkCreateCudaFunctionNV)(VkDevice device, const VkCudaFunctionCreateInfoNV* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkCudaFunctionNV* pFunction);
typedef void (VKAPI_PTR *PFN_vkDestroyCudaModuleNV)(VkDevice device, VkCudaModuleNV module, const VkAllocationCallbacks* pAllocator);
typedef void (VKAPI_PTR *PFN_vkDestroyCudaFunctionNV)(VkDevice device, VkCudaFunctionNV function, const VkAllocationCallbacks* pAllocator);
typedef void (VKAPI_PTR *PFN_vkCmdCudaLaunchKernelNV)(VkCommandBuffer commandBuffer, const VkCudaLaunchInfoNV* pLaunchInfo);
#ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateCudaModuleNV(
VkDevice device,
const VkCudaModuleCreateInfoNV* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkCudaModuleNV* pModule);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetCudaModuleCacheNV(
VkDevice device,
VkCudaModuleNV module,
size_t* pCacheSize,
void* pCacheData);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateCudaFunctionNV(
VkDevice device,
const VkCudaFunctionCreateInfoNV* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkCudaFunctionNV* pFunction);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR void VKAPI_CALL vkDestroyCudaModuleNV(
VkDevice device,
VkCudaModuleNV module,
const VkAllocationCallbacks* pAllocator);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR void VKAPI_CALL vkDestroyCudaFunctionNV(
VkDevice device,
VkCudaFunctionNV function,
const VkAllocationCallbacks* pAllocator);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR void VKAPI_CALL vkCmdCudaLaunchKernelNV(
VkCommandBuffer commandBuffer,
const VkCudaLaunchInfoNV* pLaunchInfo);
#endif
#endif
// VK_NV_displacement_micromap is a preprocessor guard. Do not pass it to API calls. // VK_NV_displacement_micromap is a preprocessor guard. Do not pass it to API calls.
+2753 -146
View File
File diff suppressed because it is too large Load Diff
+4
View File
@@ -36,17 +36,21 @@ typedef VkResult (VKAPI_PTR *PFN_vkCreateDirectFBSurfaceEXT)(VkInstance instance
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceDirectFBPresentationSupportEXT)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, IDirectFB* dfb); typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceDirectFBPresentationSupportEXT)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, IDirectFB* dfb);
#ifndef VK_NO_PROTOTYPES #ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateDirectFBSurfaceEXT( VKAPI_ATTR VkResult VKAPI_CALL vkCreateDirectFBSurfaceEXT(
VkInstance instance, VkInstance instance,
const VkDirectFBSurfaceCreateInfoEXT* pCreateInfo, const VkDirectFBSurfaceCreateInfoEXT* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface); VkSurfaceKHR* pSurface);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceDirectFBPresentationSupportEXT( VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceDirectFBPresentationSupportEXT(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex, uint32_t queueFamilyIndex,
IDirectFB* dfb); IDirectFB* dfb);
#endif #endif
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }
+7244 -5058
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+4570 -3099
View File
File diff suppressed because one or more lines are too long
+20
View File
@@ -34,12 +34,14 @@ typedef struct VkImagePipeSurfaceCreateInfoFUCHSIA {
typedef VkResult (VKAPI_PTR *PFN_vkCreateImagePipeSurfaceFUCHSIA)(VkInstance instance, const VkImagePipeSurfaceCreateInfoFUCHSIA* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); typedef VkResult (VKAPI_PTR *PFN_vkCreateImagePipeSurfaceFUCHSIA)(VkInstance instance, const VkImagePipeSurfaceCreateInfoFUCHSIA* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
#ifndef VK_NO_PROTOTYPES #ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateImagePipeSurfaceFUCHSIA( VKAPI_ATTR VkResult VKAPI_CALL vkCreateImagePipeSurfaceFUCHSIA(
VkInstance instance, VkInstance instance,
const VkImagePipeSurfaceCreateInfoFUCHSIA* pCreateInfo, const VkImagePipeSurfaceCreateInfoFUCHSIA* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface); VkSurfaceKHR* pSurface);
#endif #endif
#endif
// VK_FUCHSIA_external_memory is a preprocessor guard. Do not pass it to API calls. // VK_FUCHSIA_external_memory is a preprocessor guard. Do not pass it to API calls.
@@ -70,17 +72,21 @@ typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryZirconHandleFUCHSIA)(VkDevice device
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryZirconHandlePropertiesFUCHSIA)(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, zx_handle_t zirconHandle, VkMemoryZirconHandlePropertiesFUCHSIA* pMemoryZirconHandleProperties); typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryZirconHandlePropertiesFUCHSIA)(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, zx_handle_t zirconHandle, VkMemoryZirconHandlePropertiesFUCHSIA* pMemoryZirconHandleProperties);
#ifndef VK_NO_PROTOTYPES #ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryZirconHandleFUCHSIA( VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryZirconHandleFUCHSIA(
VkDevice device, VkDevice device,
const VkMemoryGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo, const VkMemoryGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo,
zx_handle_t* pZirconHandle); zx_handle_t* pZirconHandle);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryZirconHandlePropertiesFUCHSIA( VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryZirconHandlePropertiesFUCHSIA(
VkDevice device, VkDevice device,
VkExternalMemoryHandleTypeFlagBits handleType, VkExternalMemoryHandleTypeFlagBits handleType,
zx_handle_t zirconHandle, zx_handle_t zirconHandle,
VkMemoryZirconHandlePropertiesFUCHSIA* pMemoryZirconHandleProperties); VkMemoryZirconHandlePropertiesFUCHSIA* pMemoryZirconHandleProperties);
#endif #endif
#endif
// VK_FUCHSIA_external_semaphore is a preprocessor guard. Do not pass it to API calls. // VK_FUCHSIA_external_semaphore is a preprocessor guard. Do not pass it to API calls.
@@ -107,15 +113,19 @@ typedef VkResult (VKAPI_PTR *PFN_vkImportSemaphoreZirconHandleFUCHSIA)(VkDevice
typedef VkResult (VKAPI_PTR *PFN_vkGetSemaphoreZirconHandleFUCHSIA)(VkDevice device, const VkSemaphoreGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo, zx_handle_t* pZirconHandle); typedef VkResult (VKAPI_PTR *PFN_vkGetSemaphoreZirconHandleFUCHSIA)(VkDevice device, const VkSemaphoreGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo, zx_handle_t* pZirconHandle);
#ifndef VK_NO_PROTOTYPES #ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkImportSemaphoreZirconHandleFUCHSIA( VKAPI_ATTR VkResult VKAPI_CALL vkImportSemaphoreZirconHandleFUCHSIA(
VkDevice device, VkDevice device,
const VkImportSemaphoreZirconHandleInfoFUCHSIA* pImportSemaphoreZirconHandleInfo); const VkImportSemaphoreZirconHandleInfoFUCHSIA* pImportSemaphoreZirconHandleInfo);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreZirconHandleFUCHSIA( VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreZirconHandleFUCHSIA(
VkDevice device, VkDevice device,
const VkSemaphoreGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo, const VkSemaphoreGetZirconHandleInfoFUCHSIA* pGetZirconHandleInfo,
zx_handle_t* pZirconHandle); zx_handle_t* pZirconHandle);
#endif #endif
#endif
// VK_FUCHSIA_buffer_collection is a preprocessor guard. Do not pass it to API calls. // VK_FUCHSIA_buffer_collection is a preprocessor guard. Do not pass it to API calls.
@@ -228,32 +238,42 @@ typedef void (VKAPI_PTR *PFN_vkDestroyBufferCollectionFUCHSIA)(VkDevice device,
typedef VkResult (VKAPI_PTR *PFN_vkGetBufferCollectionPropertiesFUCHSIA)(VkDevice device, VkBufferCollectionFUCHSIA collection, VkBufferCollectionPropertiesFUCHSIA* pProperties); typedef VkResult (VKAPI_PTR *PFN_vkGetBufferCollectionPropertiesFUCHSIA)(VkDevice device, VkBufferCollectionFUCHSIA collection, VkBufferCollectionPropertiesFUCHSIA* pProperties);
#ifndef VK_NO_PROTOTYPES #ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateBufferCollectionFUCHSIA( VKAPI_ATTR VkResult VKAPI_CALL vkCreateBufferCollectionFUCHSIA(
VkDevice device, VkDevice device,
const VkBufferCollectionCreateInfoFUCHSIA* pCreateInfo, const VkBufferCollectionCreateInfoFUCHSIA* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkBufferCollectionFUCHSIA* pCollection); VkBufferCollectionFUCHSIA* pCollection);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkSetBufferCollectionImageConstraintsFUCHSIA( VKAPI_ATTR VkResult VKAPI_CALL vkSetBufferCollectionImageConstraintsFUCHSIA(
VkDevice device, VkDevice device,
VkBufferCollectionFUCHSIA collection, VkBufferCollectionFUCHSIA collection,
const VkImageConstraintsInfoFUCHSIA* pImageConstraintsInfo); const VkImageConstraintsInfoFUCHSIA* pImageConstraintsInfo);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkSetBufferCollectionBufferConstraintsFUCHSIA( VKAPI_ATTR VkResult VKAPI_CALL vkSetBufferCollectionBufferConstraintsFUCHSIA(
VkDevice device, VkDevice device,
VkBufferCollectionFUCHSIA collection, VkBufferCollectionFUCHSIA collection,
const VkBufferConstraintsInfoFUCHSIA* pBufferConstraintsInfo); const VkBufferConstraintsInfoFUCHSIA* pBufferConstraintsInfo);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR void VKAPI_CALL vkDestroyBufferCollectionFUCHSIA( VKAPI_ATTR void VKAPI_CALL vkDestroyBufferCollectionFUCHSIA(
VkDevice device, VkDevice device,
VkBufferCollectionFUCHSIA collection, VkBufferCollectionFUCHSIA collection,
const VkAllocationCallbacks* pAllocator); const VkAllocationCallbacks* pAllocator);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetBufferCollectionPropertiesFUCHSIA( VKAPI_ATTR VkResult VKAPI_CALL vkGetBufferCollectionPropertiesFUCHSIA(
VkDevice device, VkDevice device,
VkBufferCollectionFUCHSIA collection, VkBufferCollectionFUCHSIA collection,
VkBufferCollectionPropertiesFUCHSIA* pProperties); VkBufferCollectionPropertiesFUCHSIA* pProperties);
#endif #endif
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }
+12944 -14857
View File
File diff suppressed because it is too large Load Diff
+2
View File
@@ -34,12 +34,14 @@ typedef struct VkStreamDescriptorSurfaceCreateInfoGGP {
typedef VkResult (VKAPI_PTR *PFN_vkCreateStreamDescriptorSurfaceGGP)(VkInstance instance, const VkStreamDescriptorSurfaceCreateInfoGGP* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); typedef VkResult (VKAPI_PTR *PFN_vkCreateStreamDescriptorSurfaceGGP)(VkInstance instance, const VkStreamDescriptorSurfaceCreateInfoGGP* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
#ifndef VK_NO_PROTOTYPES #ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateStreamDescriptorSurfaceGGP( VKAPI_ATTR VkResult VKAPI_CALL vkCreateStreamDescriptorSurfaceGGP(
VkInstance instance, VkInstance instance,
const VkStreamDescriptorSurfaceCreateInfoGGP* pCreateInfo, const VkStreamDescriptorSurfaceCreateInfoGGP* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface); VkSurfaceKHR* pSurface);
#endif #endif
#endif
// VK_GGP_frame_token is a preprocessor guard. Do not pass it to API calls. // VK_GGP_frame_token is a preprocessor guard. Do not pass it to API calls.
+7624 -8070
View File
File diff suppressed because it is too large Load Diff
+10326 -10190
View File
File diff suppressed because it is too large Load Diff
+10 -9
View File
@@ -5,6 +5,7 @@
// This header is generated from the Khronos Vulkan XML API Registry. // This header is generated from the Khronos Vulkan XML API Registry.
#ifndef VULKAN_HPP_MACROS_HPP #ifndef VULKAN_HPP_MACROS_HPP
#define VULKAN_HPP_MACROS_HPP #define VULKAN_HPP_MACROS_HPP
@@ -79,11 +80,11 @@
# define __has_include( x ) false # define __has_include( x ) false
#endif #endif
#if ( 201907 <= __cpp_lib_three_way_comparison ) && __has_include( <compare> ) && !defined( VULKAN_HPP_NO_SPACESHIP_OPERATOR ) #if defined( __cpp_lib_three_way_comparison ) && ( 201907 <= __cpp_lib_three_way_comparison ) && __has_include( <compare> ) && !defined( VULKAN_HPP_NO_SPACESHIP_OPERATOR )
# define VULKAN_HPP_HAS_SPACESHIP_OPERATOR # define VULKAN_HPP_HAS_SPACESHIP_OPERATOR
#endif #endif
#if ( 201803 <= __cpp_lib_span ) #if defined( __cpp_lib_span ) && ( 201803 <= __cpp_lib_span )
# define VULKAN_HPP_SUPPORT_SPAN # define VULKAN_HPP_SUPPORT_SPAN
#endif #endif
@@ -92,12 +93,11 @@
#endif #endif
#ifndef VK_USE_64_BIT_PTR_DEFINES #ifndef VK_USE_64_BIT_PTR_DEFINES
# if defined( __LP64__ ) || defined( _WIN64 ) || ( defined( __x86_64__ ) && !defined( __ILP32__ ) ) || defined( _M_X64 ) || defined( __ia64 ) || \ #if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__) ) || defined(_M_X64) || defined(__ia64) || defined (_M_IA64) || defined(__aarch64__) || defined(__powerpc64__) || (defined(__riscv) && __riscv_xlen == 64)
defined( _M_IA64 ) || defined( __aarch64__ ) || defined( __powerpc64__ ) || ( defined( __riscv ) && __riscv_xlen == 64 ) #define VK_USE_64_BIT_PTR_DEFINES 1
# define VK_USE_64_BIT_PTR_DEFINES 1 #else
# else #define VK_USE_64_BIT_PTR_DEFINES 0
# define VK_USE_64_BIT_PTR_DEFINES 0 #endif
# endif
#endif #endif
// 32-bit vulkan is not typesafe for non-dispatchable handles, so don't allow copy constructors on this platform by default. // 32-bit vulkan is not typesafe for non-dispatchable handles, so don't allow copy constructors on this platform by default.
@@ -259,7 +259,7 @@ namespace VULKAN_HPP_NAMESPACE
{ {
namespace detail namespace detail
{ {
class DispatchLoaderDynamic; class DispatchLoaderDynamic;
#if !defined( VULKAN_HPP_DEFAULT_DISPATCHER ) #if !defined( VULKAN_HPP_DEFAULT_DISPATCHER )
# if VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 1 # if VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 1
@@ -323,4 +323,5 @@ namespace VULKAN_HPP_NAMESPACE
# define VULKAN_HPP_RAII_CREATE_NOEXCEPT # define VULKAN_HPP_RAII_CREATE_NOEXCEPT
#endif #endif
#endif #endif
+2
View File
@@ -34,12 +34,14 @@ typedef struct VkIOSSurfaceCreateInfoMVK {
typedef VkResult (VKAPI_PTR *PFN_vkCreateIOSSurfaceMVK)(VkInstance instance, const VkIOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); typedef VkResult (VKAPI_PTR *PFN_vkCreateIOSSurfaceMVK)(VkInstance instance, const VkIOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
#ifndef VK_NO_PROTOTYPES #ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateIOSSurfaceMVK( VKAPI_ATTR VkResult VKAPI_CALL vkCreateIOSSurfaceMVK(
VkInstance instance, VkInstance instance,
const VkIOSSurfaceCreateInfoMVK* pCreateInfo, const VkIOSSurfaceCreateInfoMVK* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface); VkSurfaceKHR* pSurface);
#endif #endif
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }
+2
View File
@@ -34,12 +34,14 @@ typedef struct VkMacOSSurfaceCreateInfoMVK {
typedef VkResult (VKAPI_PTR *PFN_vkCreateMacOSSurfaceMVK)(VkInstance instance, const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); typedef VkResult (VKAPI_PTR *PFN_vkCreateMacOSSurfaceMVK)(VkInstance instance, const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
#ifndef VK_NO_PROTOTYPES #ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateMacOSSurfaceMVK( VKAPI_ATTR VkResult VKAPI_CALL vkCreateMacOSSurfaceMVK(
VkInstance instance, VkInstance instance,
const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, const VkMacOSSurfaceCreateInfoMVK* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface); VkSurfaceKHR* pSurface);
#endif #endif
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }
+49
View File
@@ -40,12 +40,14 @@ typedef struct VkMetalSurfaceCreateInfoEXT {
typedef VkResult (VKAPI_PTR *PFN_vkCreateMetalSurfaceEXT)(VkInstance instance, const VkMetalSurfaceCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); typedef VkResult (VKAPI_PTR *PFN_vkCreateMetalSurfaceEXT)(VkInstance instance, const VkMetalSurfaceCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
#ifndef VK_NO_PROTOTYPES #ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateMetalSurfaceEXT( VKAPI_ATTR VkResult VKAPI_CALL vkCreateMetalSurfaceEXT(
VkInstance instance, VkInstance instance,
const VkMetalSurfaceCreateInfoEXT* pCreateInfo, const VkMetalSurfaceCreateInfoEXT* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface); VkSurfaceKHR* pSurface);
#endif #endif
#endif
// VK_EXT_metal_objects is a preprocessor guard. Do not pass it to API calls. // VK_EXT_metal_objects is a preprocessor guard. Do not pass it to API calls.
@@ -183,10 +185,57 @@ typedef struct VkImportMetalSharedEventInfoEXT {
typedef void (VKAPI_PTR *PFN_vkExportMetalObjectsEXT)(VkDevice device, VkExportMetalObjectsInfoEXT* pMetalObjectsInfo); typedef void (VKAPI_PTR *PFN_vkExportMetalObjectsEXT)(VkDevice device, VkExportMetalObjectsInfoEXT* pMetalObjectsInfo);
#ifndef VK_NO_PROTOTYPES #ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR void VKAPI_CALL vkExportMetalObjectsEXT( VKAPI_ATTR void VKAPI_CALL vkExportMetalObjectsEXT(
VkDevice device, VkDevice device,
VkExportMetalObjectsInfoEXT* pMetalObjectsInfo); VkExportMetalObjectsInfoEXT* pMetalObjectsInfo);
#endif #endif
#endif
// VK_EXT_external_memory_metal is a preprocessor guard. Do not pass it to API calls.
#define VK_EXT_external_memory_metal 1
#define VK_EXT_EXTERNAL_MEMORY_METAL_SPEC_VERSION 1
#define VK_EXT_EXTERNAL_MEMORY_METAL_EXTENSION_NAME "VK_EXT_external_memory_metal"
typedef struct VkImportMemoryMetalHandleInfoEXT {
VkStructureType sType;
const void* pNext;
VkExternalMemoryHandleTypeFlagBits handleType;
void* handle;
} VkImportMemoryMetalHandleInfoEXT;
typedef struct VkMemoryMetalHandlePropertiesEXT {
VkStructureType sType;
void* pNext;
uint32_t memoryTypeBits;
} VkMemoryMetalHandlePropertiesEXT;
typedef struct VkMemoryGetMetalHandleInfoEXT {
VkStructureType sType;
const void* pNext;
VkDeviceMemory memory;
VkExternalMemoryHandleTypeFlagBits handleType;
} VkMemoryGetMetalHandleInfoEXT;
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryMetalHandleEXT)(VkDevice device, const VkMemoryGetMetalHandleInfoEXT* pGetMetalHandleInfo, void** pHandle);
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryMetalHandlePropertiesEXT)(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, const void* pHandle, VkMemoryMetalHandlePropertiesEXT* pMemoryMetalHandleProperties);
#ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryMetalHandleEXT(
VkDevice device,
const VkMemoryGetMetalHandleInfoEXT* pGetMetalHandleInfo,
void** pHandle);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryMetalHandlePropertiesEXT(
VkDevice device,
VkExternalMemoryHandleTypeFlagBits handleType,
const void* pHandle,
VkMemoryMetalHandlePropertiesEXT* pMemoryMetalHandleProperties);
#endif
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }
+53
View File
@@ -0,0 +1,53 @@
#ifndef VULKAN_OHOS_H_
#define VULKAN_OHOS_H_ 1
/*
** Copyright 2015-2025 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
/*
** This header is generated from the Khronos Vulkan XML API Registry.
**
*/
#ifdef __cplusplus
extern "C" {
#endif
// VK_OHOS_surface is a preprocessor guard. Do not pass it to API calls.
#define VK_OHOS_surface 1
typedef struct NativeWindow OHNativeWindow;
#define VK_OHOS_SURFACE_SPEC_VERSION 1
#define VK_OHOS_SURFACE_EXTENSION_NAME "VK_OHOS_surface"
typedef VkFlags VkSurfaceCreateFlagsOHOS;
typedef struct VkOHSurfaceCreateInfoOHOS {
VkStructureType sType;
const void* pNext;
VkSurfaceCreateFlagsOHOS flags;
OHNativeWindow* window;
} VkOHSurfaceCreateInfoOHOS;
typedef VkOHSurfaceCreateInfoOHOS VkSurfaceCreateInfoOHOS;
typedef VkResult (VKAPI_PTR *PFN_vkCreateSurfaceOHOS)(VkInstance instance, const VkSurfaceCreateInfoOHOS* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
#ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateSurfaceOHOS(
VkInstance instance,
const VkSurfaceCreateInfoOHOS* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface);
#endif
#endif
#ifdef __cplusplus
}
#endif
#endif
+22792 -22582
View File
File diff suppressed because it is too large Load Diff
+6
View File
@@ -36,17 +36,21 @@ typedef VkResult (VKAPI_PTR *PFN_vkCreateScreenSurfaceQNX)(VkInstance instance,
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceScreenPresentationSupportQNX)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, struct _screen_window* window); typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceScreenPresentationSupportQNX)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, struct _screen_window* window);
#ifndef VK_NO_PROTOTYPES #ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateScreenSurfaceQNX( VKAPI_ATTR VkResult VKAPI_CALL vkCreateScreenSurfaceQNX(
VkInstance instance, VkInstance instance,
const VkScreenSurfaceCreateInfoQNX* pCreateInfo, const VkScreenSurfaceCreateInfoQNX* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface); VkSurfaceKHR* pSurface);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceScreenPresentationSupportQNX( VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceScreenPresentationSupportQNX(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex, uint32_t queueFamilyIndex,
struct _screen_window* window); struct _screen_window* window);
#endif #endif
#endif
// VK_QNX_external_memory_screen_buffer is a preprocessor guard. Do not pass it to API calls. // VK_QNX_external_memory_screen_buffer is a preprocessor guard. Do not pass it to API calls.
@@ -95,11 +99,13 @@ typedef struct VkPhysicalDeviceExternalMemoryScreenBufferFeaturesQNX {
typedef VkResult (VKAPI_PTR *PFN_vkGetScreenBufferPropertiesQNX)(VkDevice device, const struct _screen_buffer* buffer, VkScreenBufferPropertiesQNX* pProperties); typedef VkResult (VKAPI_PTR *PFN_vkGetScreenBufferPropertiesQNX)(VkDevice device, const struct _screen_buffer* buffer, VkScreenBufferPropertiesQNX* pProperties);
#ifndef VK_NO_PROTOTYPES #ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetScreenBufferPropertiesQNX( VKAPI_ATTR VkResult VKAPI_CALL vkGetScreenBufferPropertiesQNX(
VkDevice device, VkDevice device,
const struct _screen_buffer* buffer, const struct _screen_buffer* buffer,
VkScreenBufferPropertiesQNX* pProperties); VkScreenBufferPropertiesQNX* pProperties);
#endif #endif
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }
+607 -650
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+70468 -49577
View File
File diff suppressed because one or more lines are too long
+6539 -5983
View File
File diff suppressed because it is too large Load Diff
+2
View File
@@ -34,12 +34,14 @@ typedef struct VkViSurfaceCreateInfoNN {
typedef VkResult (VKAPI_PTR *PFN_vkCreateViSurfaceNN)(VkInstance instance, const VkViSurfaceCreateInfoNN* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); typedef VkResult (VKAPI_PTR *PFN_vkCreateViSurfaceNN)(VkInstance instance, const VkViSurfaceCreateInfoNN* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
#ifndef VK_NO_PROTOTYPES #ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateViSurfaceNN( VKAPI_ATTR VkResult VKAPI_CALL vkCreateViSurfaceNN(
VkInstance instance, VkInstance instance,
const VkViSurfaceCreateInfoNN* pCreateInfo, const VkViSurfaceCreateInfoNN* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface); VkSurfaceKHR* pSurface);
#endif #endif
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }
+171
View File
@@ -0,0 +1,171 @@
// Copyright 2021-2025 The Khronos Group Inc.
// SPDX-License-Identifier: Apache-2.0 OR MIT
//
// This header is generated from the Khronos Vulkan XML API Registry.
// Note: This module is still in an experimental state.
// Any feedback is welcome on https://github.com/KhronosGroup/Vulkan-Hpp/issues.
module;
#include <vulkan/vulkan_hpp_macros.hpp>
#if defined( __cpp_lib_modules ) && !defined( VULKAN_HPP_ENABLE_STD_MODULE )
# define VULKAN_HPP_ENABLE_STD_MODULE
#endif
#include <vulkan/vulkan_video.hpp>
export module vulkan_video_hpp;
export namespace VULKAN_HPP_NAMESPACE
{
namespace VULKAN_HPP_VIDEO_NAMESPACE
{
//=============
//=== ENUMs ===
//=============
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::AV1ChromaSamplePosition;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::AV1ColorPrimaries;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::AV1FrameRestorationType;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::AV1FrameType;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::AV1InterpolationFilter;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::AV1Level;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::AV1MatrixCoefficients;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::AV1Profile;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::AV1ReferenceName;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::AV1TransferCharacteristics;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::AV1TxMode;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::DecodeH264FieldOrderCount;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H264AspectRatioIdc;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H264CabacInitIdc;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H264ChromaFormatIdc;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H264DisableDeblockingFilterIdc;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H264LevelIdc;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H264MemMgmtControlOp;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H264ModificationOfPicNumsIdc;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H264NonVclNaluType;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H264PictureType;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H264PocType;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H264ProfileIdc;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H264SliceType;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H264WeightedBipredIdc;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H265AspectRatioIdc;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H265ChromaFormatIdc;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H265LevelIdc;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H265PictureType;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H265ProfileIdc;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H265SliceType;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::VP9ColorSpace;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::VP9FrameType;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::VP9InterpolationFilter;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::VP9Level;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::VP9Profile;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::VP9ReferenceName;
//===============
//=== STRUCTS ===
//===============
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::AV1CDEF;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::AV1ColorConfig;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::AV1ColorConfigFlags;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::AV1FilmGrain;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::AV1FilmGrainFlags;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::AV1GlobalMotion;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::AV1LoopFilter;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::AV1LoopFilterFlags;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::AV1LoopRestoration;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::AV1Quantization;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::AV1QuantizationFlags;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::AV1Segmentation;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::AV1SequenceHeader;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::AV1SequenceHeaderFlags;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::AV1TileInfo;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::AV1TileInfoFlags;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::AV1TimingInfo;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::AV1TimingInfoFlags;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::DecodeAV1PictureInfo;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::DecodeAV1PictureInfoFlags;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::DecodeAV1ReferenceInfo;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::DecodeAV1ReferenceInfoFlags;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::DecodeH264PictureInfo;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::DecodeH264PictureInfoFlags;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::DecodeH264ReferenceInfo;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::DecodeH264ReferenceInfoFlags;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::DecodeH265PictureInfo;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::DecodeH265PictureInfoFlags;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::DecodeH265ReferenceInfo;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::DecodeH265ReferenceInfoFlags;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::DecodeVP9PictureInfo;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::DecodeVP9PictureInfoFlags;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::EncodeAV1DecoderModelInfo;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::EncodeAV1ExtensionHeader;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::EncodeAV1OperatingPointInfo;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::EncodeAV1OperatingPointInfoFlags;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::EncodeAV1PictureInfo;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::EncodeAV1PictureInfoFlags;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::EncodeAV1ReferenceInfo;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::EncodeAV1ReferenceInfoFlags;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::EncodeH264PictureInfo;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::EncodeH264PictureInfoFlags;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::EncodeH264ReferenceInfo;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::EncodeH264ReferenceInfoFlags;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::EncodeH264ReferenceListsInfo;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::EncodeH264ReferenceListsInfoFlags;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::EncodeH264RefListModEntry;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::EncodeH264RefPicMarkingEntry;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::EncodeH264SliceHeader;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::EncodeH264SliceHeaderFlags;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::EncodeH264WeightTable;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::EncodeH264WeightTableFlags;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::EncodeH265LongTermRefPics;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::EncodeH265PictureInfo;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::EncodeH265PictureInfoFlags;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::EncodeH265ReferenceInfo;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::EncodeH265ReferenceInfoFlags;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::EncodeH265ReferenceListsInfo;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::EncodeH265ReferenceListsInfoFlags;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::EncodeH265SliceSegmentHeader;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::EncodeH265SliceSegmentHeaderFlags;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::EncodeH265WeightTable;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::EncodeH265WeightTableFlags;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H264HrdParameters;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H264PictureParameterSet;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H264PpsFlags;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H264ScalingLists;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H264SequenceParameterSet;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H264SequenceParameterSetVui;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H264SpsFlags;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H264SpsVuiFlags;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H265DecPicBufMgr;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H265HrdFlags;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H265HrdParameters;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H265LongTermRefPicsSps;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H265PictureParameterSet;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H265PpsFlags;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H265PredictorPaletteEntries;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H265ProfileTierLevel;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H265ProfileTierLevelFlags;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H265ScalingLists;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H265SequenceParameterSet;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H265SequenceParameterSetVui;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H265ShortTermRefPicSet;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H265ShortTermRefPicSetFlags;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H265SpsFlags;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H265SpsVuiFlags;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H265SubLayerHrdParameters;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H265VideoParameterSet;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::H265VpsFlags;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::VP9ColorConfig;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::VP9ColorConfigFlags;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::VP9LoopFilter;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::VP9LoopFilterFlags;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::VP9Segmentation;
using VULKAN_HPP_NAMESPACE::VULKAN_HPP_VIDEO_NAMESPACE::VP9SegmentationFlags;
} // namespace VULKAN_HPP_VIDEO_NAMESPACE
} // namespace VULKAN_HPP_NAMESPACE
+1357 -4
View File
File diff suppressed because it is too large Load Diff
+4
View File
@@ -36,17 +36,21 @@ typedef VkResult (VKAPI_PTR *PFN_vkCreateWaylandSurfaceKHR)(VkInstance instance,
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, struct wl_display* display); typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, struct wl_display* display);
#ifndef VK_NO_PROTOTYPES #ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateWaylandSurfaceKHR( VKAPI_ATTR VkResult VKAPI_CALL vkCreateWaylandSurfaceKHR(
VkInstance instance, VkInstance instance,
const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface); VkSurfaceKHR* pSurface);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceWaylandPresentationSupportKHR( VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceWaylandPresentationSupportKHR(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex, uint32_t queueFamilyIndex,
struct wl_display* display); struct wl_display* display);
#endif #endif
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }
+30
View File
@@ -36,16 +36,20 @@ typedef VkResult (VKAPI_PTR *PFN_vkCreateWin32SurfaceKHR)(VkInstance instance, c
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex); typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex);
#ifndef VK_NO_PROTOTYPES #ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateWin32SurfaceKHR( VKAPI_ATTR VkResult VKAPI_CALL vkCreateWin32SurfaceKHR(
VkInstance instance, VkInstance instance,
const VkWin32SurfaceCreateInfoKHR* pCreateInfo, const VkWin32SurfaceCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface); VkSurfaceKHR* pSurface);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceWin32PresentationSupportKHR( VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceWin32PresentationSupportKHR(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex); uint32_t queueFamilyIndex);
#endif #endif
#endif
// VK_KHR_external_memory_win32 is a preprocessor guard. Do not pass it to API calls. // VK_KHR_external_memory_win32 is a preprocessor guard. Do not pass it to API calls.
@@ -85,17 +89,21 @@ typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandleKHR)(VkDevice device, con
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandlePropertiesKHR)(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE handle, VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties); typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandlePropertiesKHR)(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE handle, VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties);
#ifndef VK_NO_PROTOTYPES #ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandleKHR( VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandleKHR(
VkDevice device, VkDevice device,
const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo, const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo,
HANDLE* pHandle); HANDLE* pHandle);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandlePropertiesKHR( VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandlePropertiesKHR(
VkDevice device, VkDevice device,
VkExternalMemoryHandleTypeFlagBits handleType, VkExternalMemoryHandleTypeFlagBits handleType,
HANDLE handle, HANDLE handle,
VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties); VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties);
#endif #endif
#endif
// VK_KHR_win32_keyed_mutex is a preprocessor guard. Do not pass it to API calls. // VK_KHR_win32_keyed_mutex is a preprocessor guard. Do not pass it to API calls.
@@ -158,15 +166,19 @@ typedef VkResult (VKAPI_PTR *PFN_vkImportSemaphoreWin32HandleKHR)(VkDevice devic
typedef VkResult (VKAPI_PTR *PFN_vkGetSemaphoreWin32HandleKHR)(VkDevice device, const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle); typedef VkResult (VKAPI_PTR *PFN_vkGetSemaphoreWin32HandleKHR)(VkDevice device, const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle);
#ifndef VK_NO_PROTOTYPES #ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkImportSemaphoreWin32HandleKHR( VKAPI_ATTR VkResult VKAPI_CALL vkImportSemaphoreWin32HandleKHR(
VkDevice device, VkDevice device,
const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo); const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreWin32HandleKHR( VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreWin32HandleKHR(
VkDevice device, VkDevice device,
const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo,
HANDLE* pHandle); HANDLE* pHandle);
#endif #endif
#endif
// VK_KHR_external_fence_win32 is a preprocessor guard. Do not pass it to API calls. // VK_KHR_external_fence_win32 is a preprocessor guard. Do not pass it to API calls.
@@ -202,15 +214,19 @@ typedef VkResult (VKAPI_PTR *PFN_vkImportFenceWin32HandleKHR)(VkDevice device, c
typedef VkResult (VKAPI_PTR *PFN_vkGetFenceWin32HandleKHR)(VkDevice device, const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle); typedef VkResult (VKAPI_PTR *PFN_vkGetFenceWin32HandleKHR)(VkDevice device, const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle);
#ifndef VK_NO_PROTOTYPES #ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkImportFenceWin32HandleKHR( VKAPI_ATTR VkResult VKAPI_CALL vkImportFenceWin32HandleKHR(
VkDevice device, VkDevice device,
const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo); const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetFenceWin32HandleKHR( VKAPI_ATTR VkResult VKAPI_CALL vkGetFenceWin32HandleKHR(
VkDevice device, VkDevice device,
const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo,
HANDLE* pHandle); HANDLE* pHandle);
#endif #endif
#endif
// VK_NV_external_memory_win32 is a preprocessor guard. Do not pass it to API calls. // VK_NV_external_memory_win32 is a preprocessor guard. Do not pass it to API calls.
@@ -234,12 +250,14 @@ typedef struct VkExportMemoryWin32HandleInfoNV {
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandleNV)(VkDevice device, VkDeviceMemory memory, VkExternalMemoryHandleTypeFlagsNV handleType, HANDLE* pHandle); typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryWin32HandleNV)(VkDevice device, VkDeviceMemory memory, VkExternalMemoryHandleTypeFlagsNV handleType, HANDLE* pHandle);
#ifndef VK_NO_PROTOTYPES #ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandleNV( VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryWin32HandleNV(
VkDevice device, VkDevice device,
VkDeviceMemory memory, VkDeviceMemory memory,
VkExternalMemoryHandleTypeFlagsNV handleType, VkExternalMemoryHandleTypeFlagsNV handleType,
HANDLE* pHandle); HANDLE* pHandle);
#endif #endif
#endif
// VK_NV_win32_keyed_mutex is a preprocessor guard. Do not pass it to API calls. // VK_NV_win32_keyed_mutex is a preprocessor guard. Do not pass it to API calls.
@@ -296,25 +314,33 @@ typedef VkResult (VKAPI_PTR *PFN_vkReleaseFullScreenExclusiveModeEXT)(VkDevice d
typedef VkResult (VKAPI_PTR *PFN_vkGetDeviceGroupSurfacePresentModes2EXT)(VkDevice device, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, VkDeviceGroupPresentModeFlagsKHR* pModes); typedef VkResult (VKAPI_PTR *PFN_vkGetDeviceGroupSurfacePresentModes2EXT)(VkDevice device, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, VkDeviceGroupPresentModeFlagsKHR* pModes);
#ifndef VK_NO_PROTOTYPES #ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfacePresentModes2EXT( VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfacePresentModes2EXT(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
uint32_t* pPresentModeCount, uint32_t* pPresentModeCount,
VkPresentModeKHR* pPresentModes); VkPresentModeKHR* pPresentModes);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkAcquireFullScreenExclusiveModeEXT( VKAPI_ATTR VkResult VKAPI_CALL vkAcquireFullScreenExclusiveModeEXT(
VkDevice device, VkDevice device,
VkSwapchainKHR swapchain); VkSwapchainKHR swapchain);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkReleaseFullScreenExclusiveModeEXT( VKAPI_ATTR VkResult VKAPI_CALL vkReleaseFullScreenExclusiveModeEXT(
VkDevice device, VkDevice device,
VkSwapchainKHR swapchain); VkSwapchainKHR swapchain);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetDeviceGroupSurfacePresentModes2EXT( VKAPI_ATTR VkResult VKAPI_CALL vkGetDeviceGroupSurfacePresentModes2EXT(
VkDevice device, VkDevice device,
const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo,
VkDeviceGroupPresentModeFlagsKHR* pModes); VkDeviceGroupPresentModeFlagsKHR* pModes);
#endif #endif
#endif
// VK_NV_acquire_winrt_display is a preprocessor guard. Do not pass it to API calls. // VK_NV_acquire_winrt_display is a preprocessor guard. Do not pass it to API calls.
@@ -325,15 +351,19 @@ typedef VkResult (VKAPI_PTR *PFN_vkAcquireWinrtDisplayNV)(VkPhysicalDevice physi
typedef VkResult (VKAPI_PTR *PFN_vkGetWinrtDisplayNV)(VkPhysicalDevice physicalDevice, uint32_t deviceRelativeId, VkDisplayKHR* pDisplay); typedef VkResult (VKAPI_PTR *PFN_vkGetWinrtDisplayNV)(VkPhysicalDevice physicalDevice, uint32_t deviceRelativeId, VkDisplayKHR* pDisplay);
#ifndef VK_NO_PROTOTYPES #ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkAcquireWinrtDisplayNV( VKAPI_ATTR VkResult VKAPI_CALL vkAcquireWinrtDisplayNV(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
VkDisplayKHR display); VkDisplayKHR display);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetWinrtDisplayNV( VKAPI_ATTR VkResult VKAPI_CALL vkGetWinrtDisplayNV(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
uint32_t deviceRelativeId, uint32_t deviceRelativeId,
VkDisplayKHR* pDisplay); VkDisplayKHR* pDisplay);
#endif #endif
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }
+4
View File
@@ -36,18 +36,22 @@ typedef VkResult (VKAPI_PTR *PFN_vkCreateXcbSurfaceKHR)(VkInstance instance, con
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, xcb_connection_t* connection, xcb_visualid_t visual_id); typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, xcb_connection_t* connection, xcb_visualid_t visual_id);
#ifndef VK_NO_PROTOTYPES #ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateXcbSurfaceKHR( VKAPI_ATTR VkResult VKAPI_CALL vkCreateXcbSurfaceKHR(
VkInstance instance, VkInstance instance,
const VkXcbSurfaceCreateInfoKHR* pCreateInfo, const VkXcbSurfaceCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface); VkSurfaceKHR* pSurface);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceXcbPresentationSupportKHR( VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceXcbPresentationSupportKHR(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex, uint32_t queueFamilyIndex,
xcb_connection_t* connection, xcb_connection_t* connection,
xcb_visualid_t visual_id); xcb_visualid_t visual_id);
#endif #endif
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }
+4
View File
@@ -36,18 +36,22 @@ typedef VkResult (VKAPI_PTR *PFN_vkCreateXlibSurfaceKHR)(VkInstance instance, co
typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, Display* dpy, VisualID visualID); typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, Display* dpy, VisualID visualID);
#ifndef VK_NO_PROTOTYPES #ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreateXlibSurfaceKHR( VKAPI_ATTR VkResult VKAPI_CALL vkCreateXlibSurfaceKHR(
VkInstance instance, VkInstance instance,
const VkXlibSurfaceCreateInfoKHR* pCreateInfo, const VkXlibSurfaceCreateInfoKHR* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkSurfaceKHR* pSurface); VkSurfaceKHR* pSurface);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceXlibPresentationSupportKHR( VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceXlibPresentationSupportKHR(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex, uint32_t queueFamilyIndex,
Display* dpy, Display* dpy,
VisualID visualID); VisualID visualID);
#endif #endif
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }
+4
View File
@@ -27,17 +27,21 @@ typedef VkResult (VKAPI_PTR *PFN_vkAcquireXlibDisplayEXT)(VkPhysicalDevice physi
typedef VkResult (VKAPI_PTR *PFN_vkGetRandROutputDisplayEXT)(VkPhysicalDevice physicalDevice, Display* dpy, RROutput rrOutput, VkDisplayKHR* pDisplay); typedef VkResult (VKAPI_PTR *PFN_vkGetRandROutputDisplayEXT)(VkPhysicalDevice physicalDevice, Display* dpy, RROutput rrOutput, VkDisplayKHR* pDisplay);
#ifndef VK_NO_PROTOTYPES #ifndef VK_NO_PROTOTYPES
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkAcquireXlibDisplayEXT( VKAPI_ATTR VkResult VKAPI_CALL vkAcquireXlibDisplayEXT(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
Display* dpy, Display* dpy,
VkDisplayKHR display); VkDisplayKHR display);
#endif
#ifndef VK_ONLY_EXPORTED_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetRandROutputDisplayEXT( VKAPI_ATTR VkResult VKAPI_CALL vkGetRandROutputDisplayEXT(
VkPhysicalDevice physicalDevice, VkPhysicalDevice physicalDevice,
Display* dpy, Display* dpy,
RROutput rrOutput, RROutput rrOutput,
VkDisplayKHR* pDisplay); VkDisplayKHR* pDisplay);
#endif #endif
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }
+63
View File
@@ -158,3 +158,66 @@
obj:*libdbus-1.so* obj:*libdbus-1.so*
... ...
} }
{
vulkan_lvp_leaks
Memcheck:Leak
fun:*
...
obj:*libvulkan_lvp.so*
...
}
{
vulkan_intel_leaks
Memcheck:Leak
fun:*
...
obj:*libvulkan_intel.so*
...
}
{
vulkan_base_leaks
Memcheck:Leak
fun:*
...
obj:*libvulkan.so*
...
}
{
vulkan_mesa_leaks
Memcheck:Leak
fun:*
...
obj:*libVkLayer_MESA_device_select.so*
...
}
{
vulkan_read_errors
Memcheck:Addr1
...
obj:*libvulkan*
...
}
{
vulkan_read_errors_intel
Memcheck:Addr1
...
obj:*libvulkan_intel.so*
...
}
{
nvidia_thread_read_errors
Memcheck:Addr1
...
obj:*libnvidia-glcore.so*
...
fun:start_thread
...
}
{
nvidia_specific_thread_error
Memcheck:Addr1
obj:*libnvidia-glcore.so.550.120*
obj:*libnvidia-glcore.so.550.120*
fun:start_thread
fun:clone
}
+3 -3
View File
@@ -1,6 +1,6 @@
-- Global settings -- Global settings
add_requires("libsdl", { configs = { sdlmain = false } }) add_requires("libsdl2", { configs = { sdlmain = false } })
add_rules("mode.debug", "mode.release", "mode.releasedbg") add_rules("mode.debug", "mode.release", "mode.releasedbg")
set_languages("cxx20", "c11") set_languages("cxx20", "c11")
@@ -63,7 +63,7 @@ target("mlx")
add_files("runtime/Sources/**.cpp") add_files("runtime/Sources/**.cpp")
add_packages("libsdl") add_packages("libsdl2")
if is_mode("debug") then if is_mode("debug") then
add_defines("DEBUG") add_defines("DEBUG")
@@ -98,5 +98,5 @@ target("Test")
add_defines("SDL_MAIN_HANDLED") add_defines("SDL_MAIN_HANDLED")
add_packages("libsdl") add_packages("libsdl2")
target_end() target_end()