diff --git a/.gitignore b/.gitignore index 1f55b7ab7..83f64f145 100644 --- a/.gitignore +++ b/.gitignore @@ -47,6 +47,8 @@ tests/core/test_linalg_glsl_math tests/core/test_noise tests/core/test_varint tests/core/test_xml +tests/core/test_core_slice +tests/core/test_core_thread tests/vendor/vendor_botan # Visual Studio 2015 cache/options directory .vs/ @@ -312,3 +314,6 @@ shared/ examples/bug/ build.sh !core/debug/ + +# RAD debugger project file +*.raddbg \ No newline at end of file diff --git a/bin/lld-link.exe b/bin/lld-link.exe new file mode 100644 index 000000000..da6527264 Binary files /dev/null and b/bin/lld-link.exe differ diff --git a/bin/wasm-ld.exe b/bin/wasm-ld.exe new file mode 100644 index 000000000..da6527264 Binary files /dev/null and b/bin/wasm-ld.exe differ diff --git a/core/builtin/builtin.odin b/core/builtin/builtin.odin index 211db9770..5cba3c8ea 100644 --- a/core/builtin/builtin.odin +++ b/core/builtin/builtin.odin @@ -110,7 +110,7 @@ typeid_of :: proc($T: typeid) -> typeid --- swizzle :: proc(x: [N]T, indices: ..int) -> [len(indices)]T --- complex :: proc(real, imag: Float) -> Complex_Type --- -quaternion :: proc(real, imag, jmag, kmag: Float) -> Quaternion_Type --- +quaternion :: proc(imag, jmag, kmag, real: Float) -> Quaternion_Type --- // fields must be named real :: proc(value: Complex_Or_Quaternion) -> Float --- imag :: proc(value: Complex_Or_Quaternion) -> Float --- jmag :: proc(value: Quaternion) -> Float --- diff --git a/core/bytes/bytes.odin b/core/bytes/bytes.odin index d39f01b06..208949fd8 100644 --- a/core/bytes/bytes.odin +++ b/core/bytes/bytes.odin @@ -895,7 +895,7 @@ split_multi_iterator :: proc(s: ^[]byte, substrs: [][]byte, skip_empty := false) -// scrub scruvs invalid utf-8 characters and replaces them with the replacement string +// Scrubs invalid utf-8 characters and replaces them with the replacement string // Adjacent invalid bytes are only replaced once scrub :: proc(s: []byte, replacement: []byte, allocator := context.allocator) -> []byte { str := s diff --git a/core/c/libc/stdio.odin b/core/c/libc/stdio.odin index 94007595c..39969e4a8 100644 --- a/core/c/libc/stdio.odin +++ b/core/c/libc/stdio.odin @@ -1,5 +1,7 @@ package libc +import "core:io" + when ODIN_OS == .Windows { foreign import libc { "system:libucrt.lib", @@ -218,3 +220,102 @@ foreign libc { ferror :: proc(stream: ^FILE) -> int --- perror :: proc(s: cstring) --- } + +to_stream :: proc(file: ^FILE) -> io.Stream { + stream_proc :: proc(stream_data: rawptr, mode: io.Stream_Mode, p: []byte, offset: i64, whence: io.Seek_From) -> (n: i64, err: io.Error) { + unknown_or_eof :: proc(f: ^FILE) -> io.Error { + switch { + case ferror(f) != 0: + return .Unknown + case feof(f) != 0: + return .EOF + case: + return nil + } + } + + file := (^FILE)(stream_data) + switch mode { + case .Close: + if fclose(file) != 0 { + return 0, unknown_or_eof(file) + } + + case .Flush: + if fflush(file) != 0 { + return 0, unknown_or_eof(file) + } + + case .Read: + n = i64(fread(raw_data(p), size_of(byte), len(p), file)) + if n == 0 { err = unknown_or_eof(file) } + + case .Read_At: + curr := ftell(file) + if curr == -1 { + return 0, unknown_or_eof(file) + } + + if fseek(file, long(offset), SEEK_SET) != 0 { + return 0, unknown_or_eof(file) + } + + defer fseek(file, long(curr), SEEK_SET) + + n = i64(fread(raw_data(p), size_of(byte), len(p), file)) + if n == 0 { err = unknown_or_eof(file) } + + case .Write: + n = i64(fwrite(raw_data(p), size_of(byte), len(p), file)) + if n == 0 { err = unknown_or_eof(file) } + + case .Write_At: + curr := ftell(file) + if curr == -1 { + return 0, unknown_or_eof(file) + } + + if fseek(file, long(offset), SEEK_SET) != 0 { + return 0, unknown_or_eof(file) + } + + defer fseek(file, long(curr), SEEK_SET) + + n = i64(fwrite(raw_data(p), size_of(byte), len(p), file)) + if n == 0 { err = unknown_or_eof(file) } + + case .Seek: + if fseek(file, long(offset), int(whence)) != 0 { + return 0, unknown_or_eof(file) + } + + case .Size: + curr := ftell(file) + if curr == -1 { + return 0, unknown_or_eof(file) + } + defer fseek(file, curr, SEEK_SET) + + if fseek(file, 0, SEEK_END) != 0 { + return 0, unknown_or_eof(file) + } + + n = i64(ftell(file)) + if n == -1 { + return 0, unknown_or_eof(file) + } + + case .Destroy: + return 0, .Empty + + case .Query: + return io.query_utility({ .Close, .Flush, .Read, .Read_At, .Write, .Write_At, .Seek, .Size }) + } + return + } + + return { + data = file, + procedure = stream_proc, + } +} diff --git a/core/compress/common.odin b/core/compress/common.odin index e1cfb4cb5..b343ce493 100644 --- a/core/compress/common.odin +++ b/core/compress/common.odin @@ -20,10 +20,9 @@ import "core:runtime" */ -/* - When a decompression routine doesn't stream its output, but writes to a buffer, - we pre-allocate an output buffer to speed up decompression. The default is 1 MiB. -*/ + +// When a decompression routine doesn't stream its output, but writes to a buffer, +// we pre-allocate an output buffer to speed up decompression. The default is 1 MiB. COMPRESS_OUTPUT_ALLOCATE_MIN :: int(#config(COMPRESS_OUTPUT_ALLOCATE_MIN, 1 << 20)) /* @@ -34,16 +33,14 @@ COMPRESS_OUTPUT_ALLOCATE_MIN :: int(#config(COMPRESS_OUTPUT_ALLOCATE_MIN, 1 << 2 */ when size_of(uintptr) == 8 { - /* - For 64-bit platforms, we set the default max buffer size to 4 GiB, - which is GZIP and PKZIP's max payload size. - */ + + // For 64-bit platforms, we set the default max buffer size to 4 GiB, + // which is GZIP and PKZIP's max payload size. COMPRESS_OUTPUT_ALLOCATE_MAX :: int(#config(COMPRESS_OUTPUT_ALLOCATE_MAX, 1 << 32)) } else { - /* - For 32-bit platforms, we set the default max buffer size to 512 MiB. - */ - COMPRESS_OUTPUT_ALLOCATE_MAX :: int(#config(COMPRESS_OUTPUT_ALLOCATE_MAX, 1 << 29)) + + // For 32-bit platforms, we set the default max buffer size to 512 MiB. + COMPRESS_OUTPUT_ALLOCATE_MAX :: int(#config(COMPRESS_OUTPUT_ALLOCATE_MAX, 1 << 29)) } @@ -69,9 +66,8 @@ General_Error :: enum { Incompatible_Options, Unimplemented, - /* - Memory errors - */ + // Memory errors + Allocation_Failed, Resize_Failed, } @@ -86,17 +82,16 @@ GZIP_Error :: enum { Payload_Length_Invalid, Payload_CRC_Invalid, - /* - GZIP's payload can be a maximum of max(u32le), or 4 GiB. - If you tell it you expect it to contain more, that's obviously an error. - */ - Payload_Size_Exceeds_Max_Payload, - /* - For buffered instead of streamed output, the payload size can't exceed - the max set by the `COMPRESS_OUTPUT_ALLOCATE_MAX` switch in compress/common.odin. + // GZIP's payload can be a maximum of max(u32le), or 4 GiB. + // If you tell it you expect it to contain more, that's obviously an error. + + Payload_Size_Exceeds_Max_Payload, + + // For buffered instead of streamed output, the payload size can't exceed + // the max set by the `COMPRESS_OUTPUT_ALLOCATE_MAX` switch in compress/common.odin. + // + // You can tweak this setting using `-define:COMPRESS_OUTPUT_ALLOCATE_MAX=size_in_bytes` - You can tweak this setting using `-define:COMPRESS_OUTPUT_ALLOCATE_MAX=size_in_bytes` - */ Output_Exceeds_COMPRESS_OUTPUT_ALLOCATE_MAX, } @@ -137,9 +132,8 @@ Context_Memory_Input :: struct #packed { code_buffer: u64, num_bits: u64, - /* - If we know the data size, we can optimize the reads and writes. - */ + // If we know the data size, we can optimize the reads and writes. + size_packed: i64, size_unpacked: i64, } @@ -159,18 +153,16 @@ Context_Stream_Input :: struct #packed { code_buffer: u64, num_bits: u64, - /* - If we know the data size, we can optimize the reads and writes. - */ + // If we know the data size, we can optimize the reads and writes. + size_packed: i64, size_unpacked: i64, - /* - Flags: - `input_fully_in_memory` - true = This tells us we read input from `input_data` exclusively. [] = EOF. - false = Try to refill `input_data` from the `input` stream. - */ + // Flags: + // `input_fully_in_memory` + // true = This tells us we read input from `input_data` exclusively. [] = EOF. + // false = Try to refill `input_data` from the `input` stream. + input_fully_in_memory: b8, padding: [1]u8, @@ -214,7 +206,7 @@ read_slice_from_memory :: #force_inline proc(z: ^Context_Memory_Input, size: int @(optimization_mode="speed") read_slice_from_stream :: #force_inline proc(z: ^Context_Stream_Input, size: int) -> (res: []u8, err: io.Error) { // TODO: REMOVE ALL USE OF context.temp_allocator here - // the is literally no need for it + // there is literally no need for it b := make([]u8, size, context.temp_allocator) _ = io.read(z.input, b[:]) or_return return b, nil @@ -248,10 +240,8 @@ read_u8_from_stream :: #force_inline proc(z: ^Context_Stream_Input) -> (res: u8, read_u8 :: proc{read_u8_from_memory, read_u8_from_stream} -/* - You would typically only use this at the end of Inflate, to drain bits from the code buffer - preferentially. -*/ +// You would typically only use this at the end of Inflate, to drain bits from the code buffer +// preferentially. @(optimization_mode="speed") read_u8_prefer_code_buffer_lsb :: #force_inline proc(z: ^$C) -> (res: u8, err: io.Error) { if z.num_bits >= 8 { diff --git a/core/container/priority_queue/priority_queue.odin b/core/container/priority_queue/priority_queue.odin index 0c5c4931d..0c43816e1 100644 --- a/core/container/priority_queue/priority_queue.odin +++ b/core/container/priority_queue/priority_queue.odin @@ -140,3 +140,18 @@ remove :: proc(pq: ^$Q/Priority_Queue($T), i: int) -> (value: T, ok: bool) { return } +peek_safe :: proc(pq: $Q/Priority_Queue($T), loc := #caller_location) -> (res: T, ok: bool) { + if builtin.len(pq.queue) > 0 { + return pq.queue[0], true + } + return +} + +peek :: proc(pq: $Q/Priority_Queue($T), loc := #caller_location) -> (res: T) { + assert(condition=builtin.len(pq.queue)>0, loc=loc) + + if builtin.len(pq.queue) > 0 { + return pq.queue[0] + } + return +} \ No newline at end of file diff --git a/core/dynlib/doc.odin b/core/dynlib/doc.odin index 812fb02d5..849e03a71 100644 --- a/core/dynlib/doc.odin +++ b/core/dynlib/doc.odin @@ -1,7 +1,11 @@ +//+build ignore /* Package core:dynlib implements loading of shared libraries/DLLs and their symbols. The behaviour of dynamically loaded libraries is specific to the target platform of the program. For in depth detail on the underlying behaviour please refer to your target platform's documentation. + +See `example` directory for an example library exporting 3 symbols and a host program loading them automatically +by defining a symbol table struct. */ -package dynlib +package dynlib \ No newline at end of file diff --git a/core/dynlib/example/example.odin b/core/dynlib/example/example.odin new file mode 100644 index 000000000..f12233b0a --- /dev/null +++ b/core/dynlib/example/example.odin @@ -0,0 +1,45 @@ +package example + +import "core:dynlib" +import "core:fmt" + +Symbols :: struct { + // `foo_` is prefixed, so we look for the symbol `foo_add`. + add: proc "c" (int, int) -> int, + // We use the tag here to override the symbol to look for, namely `bar_sub`. + sub: proc "c" (int, int) -> int `dynlib:"bar_sub"`, + + // Exported global (if exporting an i32, the type must be ^i32 because the symbol is a pointer to the export.) + // If it's not a pointer or procedure type, we'll skip the struct field. + hellope: ^i32, + + // Handle to free library. + // We can have more than one of these so we can match symbols for more than one DLL with one struct. + _my_lib_handle: dynlib.Library, +} + +main :: proc() { + sym: Symbols + + // Load symbols from `lib.dll` into Symbols struct. + // Each struct field is prefixed with `foo_` before lookup in the DLL's symbol table. + // The library's Handle (to unload) will be stored in `sym._my_lib_handle`. This way you can load multiple DLLs in one struct. + count, ok := dynlib.initialize_symbols(&sym, "lib.dll", "foo_", "_my_lib_handle") + defer dynlib.unload_library(sym._my_lib_handle) + fmt.printf("(Initial DLL Load) ok: %v. %v symbols loaded from lib.dll (%p).\n", ok, count, sym._my_lib_handle) + + if count > 0 { + fmt.println("42 + 42 =", sym.add(42, 42)) + fmt.println("84 - 13 =", sym.sub(84, 13)) + fmt.println("hellope =", sym.hellope^) + } + + count, ok = dynlib.initialize_symbols(&sym, "lib.dll", "foo_", "_my_lib_handle") + fmt.printf("(DLL Reload) ok: %v. %v symbols loaded from lib.dll (%p).\n", ok, count, sym._my_lib_handle) + + if count > 0 { + fmt.println("42 + 42 =", sym.add(42, 42)) + fmt.println("84 - 13 =", sym.sub(84, 13)) + fmt.println("hellope =", sym.hellope^) + } +} \ No newline at end of file diff --git a/core/dynlib/example/lib.odin b/core/dynlib/example/lib.odin new file mode 100644 index 000000000..25687a653 --- /dev/null +++ b/core/dynlib/example/lib.odin @@ -0,0 +1,14 @@ +package library + +@(export) +foo_add :: proc "c" (a, b: int) -> (res: int) { + return a + b +} + +@(export) +bar_sub :: proc "c" (a, b: int) -> (res: int) { + return a - b +} + +@(export) +foo_hellope: i32 = 42 \ No newline at end of file diff --git a/core/dynlib/lib.odin b/core/dynlib/lib.odin index b5cb16e3c..e9ee77d2c 100644 --- a/core/dynlib/lib.odin +++ b/core/dynlib/lib.odin @@ -1,5 +1,12 @@ package dynlib +import "core:intrinsics" +import "core:reflect" +import "core:runtime" +_ :: intrinsics +_ :: reflect +_ :: runtime + /* A handle to a dynamically loaded library. */ @@ -12,11 +19,11 @@ library available to resolve references in subsequently loaded libraries. The paramater `global_symbols` is only used for the platforms `linux`, `darwin`, `freebsd` and `openbsd`. On `windows` this paramater is ignored. -The underlying behaviour is platform specific. -On `linux`, `darwin`, `freebsd` and `openbsd` refer to `dlopen`. +The underlying behaviour is platform specific. +On `linux`, `darwin`, `freebsd` and `openbsd` refer to `dlopen`. On `windows` refer to `LoadLibraryW`. -**Implicit Allocators** +**Implicit Allocators** `context.temp_allocator` Example: @@ -27,6 +34,7 @@ Example: LIBRARY_PATH :: "my_library.dll" library, ok := dynlib.load_library(LIBRARY_PATH) if ! ok { + fmt.eprintln(dynlib.last_error()) return } fmt.println("The library %q was successfully loaded", LIBRARY_PATH) @@ -39,8 +47,8 @@ load_library :: proc(path: string, global_symbols := false) -> (library: Library /* Unloads a dynamic library. -The underlying behaviour is platform specific. -On `linux`, `darwin`, `freebsd` and `openbsd` refer to `dlclose`. +The underlying behaviour is platform specific. +On `linux`, `darwin`, `freebsd` and `openbsd` refer to `dlclose`. On `windows` refer to `FreeLibrary`. Example: @@ -51,10 +59,12 @@ Example: LIBRARY_PATH :: "my_library.dll" library, ok := dynlib.load_library(LIBRARY_PATH) if ! ok { + fmt.eprintln(dynlib.last_error()) return } did_unload := dynlib.unload_library(library) if ! did_unload { + fmt.eprintln(dynlib.last_error()) return } fmt.println("The library %q was successfully unloaded", LIBRARY_PATH) @@ -67,11 +77,11 @@ unload_library :: proc(library: Library) -> (did_unload: bool) { /* Loads the address of a procedure/variable from a dynamic library. -The underlying behaviour is platform specific. -On `linux`, `darwin`, `freebsd` and `openbsd` refer to `dlsym`. +The underlying behaviour is platform specific. +On `linux`, `darwin`, `freebsd` and `openbsd` refer to `dlsym`. On `windows` refer to `GetProcAddress`. -**Implicit Allocators** +**Implicit Allocators** `context.temp_allocator` Example: @@ -82,13 +92,101 @@ Example: LIBRARY_PATH :: "my_library.dll" library, ok := dynlib.load_library(LIBRARY_PATH) if ! ok { + fmt.eprintln(dynlib.last_error()) return } a, found_a := dynlib.symbol_address(library, "a") - if found_a do fmt.printf("The symbol %q was found at the address %v", "a", a) + if found_a { + fmt.printf("The symbol %q was found at the address %v", "a", a) + } else { + fmt.eprintln(dynlib.last_error()) + } } */ symbol_address :: proc(library: Library, symbol: string) -> (ptr: rawptr, found: bool) #optional_ok { return _symbol_address(library, symbol) } + +/* +Scans a dynamic library for symbols matching a struct's members, assigning found procedure pointers to the corresponding entry. +Optionally takes a symbol prefix added to the struct's member name to construct the symbol looked up in the library. +Optionally also takes the struct member to assign the library handle to, `__handle` by default. + +This allows using one struct to hold library handles and symbol pointers for more than 1 dynamic library. + +Loading the same library twice unloads the previous incarnation, allowing for straightforward hot reload support. + +Returns: +* `-1, false` if the library could not be loaded. +* The number of symbols assigned on success. `ok` = true if `count` > 0 + +See doc.odin for an example. +*/ +initialize_symbols :: proc(symbol_table: ^$T, library_path: string, symbol_prefix := "", handle_field_name := "__handle") -> (count: int, ok: bool) where intrinsics.type_is_struct(T) { + assert(symbol_table != nil) + handle: Library + + if handle, ok = load_library(library_path); !ok { + return -1, false + } + + // `symbol_table` must be a struct because of the where clause, so this can't fail. + ti := runtime.type_info_base(type_info_of(T)) + s, _ := ti.variant.(runtime.Type_Info_Struct) + + // Buffer to concatenate the prefix + symbol name. + prefixed_symbol_buf: [2048]u8 = --- + + sym_ptr: rawptr + for field_name, i in s.names { + // Calculate address of struct member + field_ptr := rawptr(uintptr(rawptr(symbol_table)) + uintptr(s.offsets[i])) + + // If we've come across the struct member for the handle, store it and continue scanning for other symbols. + if field_name == handle_field_name { + // We appear to be hot reloading. Unload previous incarnation of the library. + if old_handle := (^Library)(field_ptr)^; old_handle != nil { + if ok = unload_library(old_handle); !ok { + return count, ok + } + } + (^Library)(field_ptr)^ = handle + continue + } + + // We're not the library handle, so the field needs to be a pointer type, be it a procedure pointer or an exported global. + if !(reflect.is_procedure(s.types[i]) || reflect.is_pointer(s.types[i])) { + continue + } + + // Let's look up or construct the symbol name to find in the library + prefixed_name: string + + // Do we have a symbol override tag? + if override, tag_ok := reflect.struct_tag_lookup(reflect.Struct_Tag(s.tags[i]), "dynlib"); tag_ok { + prefixed_name = string(override) + } + + // No valid symbol override tag found, fall back to `name`. + if len(prefixed_name) == 0 { + offset := copy(prefixed_symbol_buf[:], symbol_prefix) + copy(prefixed_symbol_buf[offset:], field_name) + prefixed_name = string(prefixed_symbol_buf[:len(symbol_prefix) + len(field_name)]) + } + + // Assign procedure (or global) pointer if found. + if sym_ptr, ok = symbol_address(handle, prefixed_name); ok { + (^rawptr)(field_ptr)^ = sym_ptr + count += 1 + } + } + return count, count > 0 +} + +/* +Returns an error message for the last failed procedure call. +*/ +last_error :: proc() -> string { + return _last_error() +} diff --git a/core/dynlib/lib_js.odin b/core/dynlib/lib_js.odin index ace1b0939..866874ee8 100644 --- a/core/dynlib/lib_js.odin +++ b/core/dynlib/lib_js.odin @@ -13,3 +13,7 @@ _unload_library :: proc(library: Library) -> bool { _symbol_address :: proc(library: Library, symbol: string) -> (ptr: rawptr, found: bool) { return nil, false } + +_last_error :: proc() -> string { + return "" +} diff --git a/core/dynlib/lib_unix.odin b/core/dynlib/lib_unix.odin index b0cc37e99..97f70b576 100644 --- a/core/dynlib/lib_unix.odin +++ b/core/dynlib/lib_unix.odin @@ -22,3 +22,8 @@ _symbol_address :: proc(library: Library, symbol: string) -> (ptr: rawptr, found found = ptr != nil return } + +_last_error :: proc() -> string { + err := os.dlerror() + return "unknown" if err == "" else err +} diff --git a/core/dynlib/lib_windows.odin b/core/dynlib/lib_windows.odin index 67880df4b..9a1b5f998 100644 --- a/core/dynlib/lib_windows.odin +++ b/core/dynlib/lib_windows.odin @@ -5,6 +5,7 @@ package dynlib import win32 "core:sys/windows" import "core:strings" import "core:runtime" +import "core:reflect" _load_library :: proc(path: string, global_symbols := false) -> (Library, bool) { // NOTE(bill): 'global_symbols' is here only for consistency with POSIX which has RTLD_GLOBAL @@ -27,3 +28,9 @@ _symbol_address :: proc(library: Library, symbol: string) -> (ptr: rawptr, found found = ptr != nil return } + +_last_error :: proc() -> string { + err := win32.System_Error(win32.GetLastError()) + err_msg := reflect.enum_string(err) + return "unknown" if err_msg == "" else err_msg +} diff --git a/core/encoding/json/marshal.odin b/core/encoding/json/marshal.odin index 85eca50b6..ab2af9561 100644 --- a/core/encoding/json/marshal.odin +++ b/core/encoding/json/marshal.odin @@ -7,6 +7,7 @@ import "core:strconv" import "core:strings" import "core:reflect" import "core:io" +import "core:slice" Marshal_Data_Error :: enum { None, @@ -18,29 +19,40 @@ Marshal_Error :: union #shared_nil { io.Error, } -// careful with MJSON maps & non quotes usage as keys without whitespace will lead to bad results +// careful with MJSON maps & non quotes usage as keys with whitespace will lead to bad results Marshal_Options :: struct { // output based on spec spec: Specification, - // use line breaks & tab|spaces + // Use line breaks & tabs/spaces pretty: bool, - // spacing + // Use spaces for indentation instead of tabs use_spaces: bool, + + // Given use_spaces true, use this many spaces per indent level. 0 means 4 spaces. spaces: int, - // state - indentation: int, - - // option to output uint in JSON5 & MJSON + // Output uint as hex in JSON5 & MJSON write_uint_as_hex: bool, - // mjson output options + // If spec is MJSON and this is true, then keys will be quoted. + // + // WARNING: If your keys contain whitespace and this is false, then the + // output will be bad. mjson_keys_use_quotes: bool, + + // If spec is MJSON and this is true, then use '=' as delimiter between + // keys and values, otherwise ':' is used. mjson_keys_use_equal_sign: bool, - // mjson state + // When outputting a map, sort the output by key. + // + // NOTE: This will temp allocate and sort a list for each map. + sort_maps_by_key: bool, + + // Internal state + indentation: int, mjson_skipped_first_braces_start: bool, mjson_skipped_first_braces_end: bool, } @@ -50,6 +62,9 @@ marshal :: proc(v: any, opt: Marshal_Options = {}, allocator := context.allocato defer if err != nil { strings.builder_destroy(&b) } + + // temp guard in case we are sorting map keys, which will use temp allocations + runtime.DEFAULT_TEMP_ALLOCATOR_TEMP_GUARD(ignore = allocator == context.temp_allocator) opt := opt marshal_to_builder(&b, v, &opt) or_return @@ -263,36 +278,81 @@ marshal_to_writer :: proc(w: io.Writer, v: any, opt: ^Marshal_Options) -> (err: map_cap := uintptr(runtime.map_cap(m^)) ks, vs, hs, _, _ := runtime.map_kvh_data_dynamic(m^, info.map_info) - i := 0 - for bucket_index in 0.. bool { return i.key < j.key }) + + for s, i in sorted { + opt_write_iteration(w, opt, i) or_return + opt_write_key(w, opt, s.key) or_return + marshal_to_writer(w, s.value, opt) or_return + } } } @@ -424,8 +484,9 @@ opt_write_key :: proc(w: io.Writer, opt: ^Marshal_Options, name: string) -> (err // insert start byte and increase indentation on pretty opt_write_start :: proc(w: io.Writer, opt: ^Marshal_Options, c: byte) -> (err: io.Error) { - // skip mjson starting braces - if opt.spec == .MJSON && !opt.mjson_skipped_first_braces_start { + // Skip MJSON starting braces. We make sure to only do this for c == '{', + // skipping a starting '[' is not allowed. + if opt.spec == .MJSON && !opt.mjson_skipped_first_braces_start && opt.indentation == 0 && c == '{' { opt.mjson_skipped_first_braces_start = true return } @@ -473,11 +534,9 @@ opt_write_iteration :: proc(w: io.Writer, opt: ^Marshal_Options, iteration: int) // decrease indent, write spacing and insert end byte opt_write_end :: proc(w: io.Writer, opt: ^Marshal_Options, c: byte) -> (err: io.Error) { - if opt.spec == .MJSON && opt.mjson_skipped_first_braces_start && !opt.mjson_skipped_first_braces_end { - if opt.indentation == 0 { - opt.mjson_skipped_first_braces_end = true - return - } + if opt.spec == .MJSON && opt.mjson_skipped_first_braces_start && !opt.mjson_skipped_first_braces_end && opt.indentation == 0 && c == '}' { + opt.mjson_skipped_first_braces_end = true + return } opt.indentation -= 1 diff --git a/core/encoding/json/types.odin b/core/encoding/json/types.odin index 089fd9c9b..20c806236 100644 --- a/core/encoding/json/types.odin +++ b/core/encoding/json/types.odin @@ -1,5 +1,7 @@ package json +import "core:strings" + /* JSON strict JSON @@ -104,4 +106,27 @@ destroy_value :: proc(value: Value, allocator := context.allocator) { case String: delete(v) } +} + +clone_value :: proc(value: Value, allocator := context.allocator) -> Value { + context.allocator = allocator + + #partial switch &v in value { + case Object: + new_o := make(Object, len(v)) + for key, elem in v { + new_o[strings.clone(key)] = clone_value(elem) + } + return new_o + case Array: + new_a := make(Array, len(v)) + for elem, idx in v { + new_a[idx] = clone_value(elem) + } + return new_a + case String: + return strings.clone(v) + } + + return value } \ No newline at end of file diff --git a/core/encoding/json/unmarshal.odin b/core/encoding/json/unmarshal.odin index afcc43c0c..c1905f6b0 100644 --- a/core/encoding/json/unmarshal.odin +++ b/core/encoding/json/unmarshal.odin @@ -137,9 +137,9 @@ assign_float :: proc(val: any, f: $T) -> bool { case complex64: dst = complex(f32(f), 0) case complex128: dst = complex(f64(f), 0) - case quaternion64: dst = quaternion(f16(f), 0, 0, 0) - case quaternion128: dst = quaternion(f32(f), 0, 0, 0) - case quaternion256: dst = quaternion(f64(f), 0, 0, 0) + case quaternion64: dst = quaternion(w=f16(f), x=0, y=0, z=0) + case quaternion128: dst = quaternion(w=f32(f), x=0, y=0, z=0) + case quaternion256: dst = quaternion(w=f64(f), x=0, y=0, z=0) case: return false } diff --git a/core/encoding/xml/debug_print.odin b/core/encoding/xml/debug_print.odin index b97617a8a..2607bec23 100644 --- a/core/encoding/xml/debug_print.odin +++ b/core/encoding/xml/debug_print.odin @@ -1,3 +1,5 @@ +package xml + /* An XML 1.0 / 1.1 parser @@ -9,7 +11,7 @@ List of contributors: Jeroen van Rijn: Initial implementation. */ -package xml + import "core:io" import "core:fmt" @@ -81,4 +83,4 @@ print_element :: proc(writer: io.Writer, doc: ^Document, element_id: Element_ID, } return written, .None -} \ No newline at end of file +} diff --git a/core/encoding/xml/example/xml_example.odin b/core/encoding/xml/example/xml_example.odin index aebb8d0ea..9648143db 100644 --- a/core/encoding/xml/example/xml_example.odin +++ b/core/encoding/xml/example/xml_example.odin @@ -20,7 +20,7 @@ example :: proc() { xml.destroy(docs[round]) } - DOC :: #load("../../../../tests/core/assets/XML/unicode.xml") + DOC :: #load("../../../../tests/core/assets/XML/utf8.xml") input := DOC for round in 0.. (res: Element_ID, found: bool) { @@ -47,4 +49,4 @@ find_attribute_val_by_key :: proc(doc: ^Document, parent_id: Element_ID, key: st if attr.key == key { return attr.val, true } } return "", false -} \ No newline at end of file +} diff --git a/core/encoding/xml/tokenizer.odin b/core/encoding/xml/tokenizer.odin index cd055475c..a223a75d6 100644 --- a/core/encoding/xml/tokenizer.odin +++ b/core/encoding/xml/tokenizer.odin @@ -1,3 +1,5 @@ +package xml + /* An XML 1.0 / 1.1 parser @@ -9,7 +11,7 @@ List of contributors: Jeroen van Rijn: Initial implementation. */ -package xml + import "core:fmt" import "core:unicode" @@ -433,4 +435,4 @@ scan :: proc(t: ^Tokenizer) -> Token { lit = string(t.src[offset : t.offset]) } return Token{kind, lit, pos} -} \ No newline at end of file +} diff --git a/core/encoding/xml/xml_reader.odin b/core/encoding/xml/xml_reader.odin index f4f8a4b05..562d519d5 100644 --- a/core/encoding/xml/xml_reader.odin +++ b/core/encoding/xml/xml_reader.odin @@ -1,28 +1,28 @@ /* - An XML 1.0 / 1.1 parser + XML 1.0 / 1.1 parser - Copyright 2021-2022 Jeroen van Rijn . - Made available under Odin's BSD-3 license. + 2021-2022 Jeroen van Rijn . + available under Odin's BSD-3 license. - A from-scratch XML implementation, loosely modelled on the [spec](https://www.w3.org/TR/2006/REC-xml11-20060816). + from-scratch XML implementation, loosely modelled on the [spec](https://www.w3.org/TR/2006/REC-xml11-20060816). - Features: - - Supports enough of the XML 1.0/1.1 spec to handle the 99.9% of XML documents in common current usage. - - Simple to understand and use. Small. +Features: +- Supports enough of the XML 1.0/1.1 spec to handle the 99.9% of XML documents in common current usage. +- Simple to understand and use. Small. - Caveats: - - We do NOT support HTML in this package, as that may or may not be valid XML. - If it works, great. If it doesn't, that's not considered a bug. +Caveats: +- We do NOT support HTML in this package, as that may or may not be valid XML. + If it works, great. If it doesn't, that's not considered a bug. - - We do NOT support UTF-16. If you have a UTF-16 XML file, please convert it to UTF-8 first. Also, our condolences. - - <[!ELEMENT and <[!ATTLIST are not supported, and will be either ignored or return an error depending on the parser options. +- We do NOT support UTF-16. If you have a UTF-16 XML file, please convert it to UTF-8 first. Also, our condolences. +- <[!ELEMENT and <[!ATTLIST are not supported, and will be either ignored or return an error depending on the parser options. - MAYBE: - - XML writer? - - Serialize/deserialize Odin types? +MAYBE: +- XML writer? +- Serialize/deserialize Odin types? - List of contributors: - Jeroen van Rijn: Initial implementation. +List of contributors: +- Jeroen van Rijn: Initial implementation. */ package xml // An XML 1.0 / 1.1 parser @@ -43,48 +43,32 @@ DEFAULT_OPTIONS :: Options{ } Option_Flag :: enum { - /* - If the caller says that input may be modified, we can perform in-situ parsing. - If this flag isn't provided, the XML parser first duplicates the input so that it can. - */ + // If the caller says that input may be modified, we can perform in-situ parsing. + // If this flag isn't provided, the XML parser first duplicates the input so that it can. Input_May_Be_Modified, - /* - Document MUST start with ` (doc: ^Document, err: Error) { data := data context.allocator = allocator opts := validate_options(options) or_return - /* - If `.Input_May_Be_Modified` is not specified, we duplicate the input so that we can modify it in-place. - */ + // If `.Input_May_Be_Modified` is not specified, we duplicate the input so that we can modify it in-place. if .Input_May_Be_Modified not_in opts.flags { data = bytes.clone(data) } @@ -252,10 +209,8 @@ parse_bytes :: proc(data: []u8, options := DEFAULT_OPTIONS, path := "", error_ha element, parent: Element_ID open: Token - /* - If a DOCTYPE is present, the root tag has to match. - If an expected DOCTYPE is given in options (i.e. it's non-empty), the DOCTYPE (if present) and root tag have to match. - */ + // If a DOCTYPE is present, the root tag has to match. + // If an expected DOCTYPE is given in options (i.e. it's non-empty), the DOCTYPE (if present) and root tag have to match. expected_doctype := options.expected_doctype loop: for { @@ -263,17 +218,13 @@ parse_bytes :: proc(data: []u8, options := DEFAULT_OPTIONS, path := "", error_ha // NOTE(Jeroen): This is faster as a switch. switch t.ch { case '<': - /* - Consume peeked `<` - */ + // Consume peeked `<` advance_rune(t) open = scan(t) // NOTE(Jeroen): We're not using a switch because this if-else chain ordered by likelihood is 2.5% faster at -o:size and -o:speed. if likely(open.kind, Token_Kind.Ident) == .Ident { - /* - e.g. 0 && expected_doctype != open.text { error(t, t.offset, "Root Tag doesn't match DOCTYPE. Expected: %v, got: %v\n", expected_doctype, open.text) @@ -298,23 +247,17 @@ parse_bytes :: proc(data: []u8, options := DEFAULT_OPTIONS, path := "", error_ha } } - /* - One of these should follow: - - `>`, which means we've just opened this tag and expect a later element to close it. - - `/>`, which means this is an 'empty' or self-closing tag. - */ + // One of these should follow: + // - `>`, which means we've just opened this tag and expect a later element to close it. + // - `/>`, which means this is an 'empty' or self-closing tag. end_token := scan(t) #partial switch end_token.kind { case .Gt: - /* - We're now the new parent. - */ + // We're now the new parent. parent = element case .Slash: - /* - Empty tag. Close it. - */ + // Empty tag. Close it. expect(t, .Gt) or_return parent = doc.elements[element].parent element = parent @@ -325,9 +268,7 @@ parse_bytes :: proc(data: []u8, options := DEFAULT_OPTIONS, path := "", error_ha } } else if open.kind == .Slash { - /* - Close tag. - */ + // Close tag. ident := expect(t, .Ident) or_return _ = expect(t, .Gt) or_return @@ -339,9 +280,7 @@ parse_bytes :: proc(data: []u8, options := DEFAULT_OPTIONS, path := "", error_ha element = parent } else if open.kind == .Exclaim { - /* - . - The grammar does not allow a comment to end in ---> - */ + // Comment: . + // The grammar does not allow a comment to end in ---> expect(t, .Dash) comment := scan_comment(t) or_return @@ -395,23 +332,17 @@ parse_bytes :: proc(data: []u8, options := DEFAULT_OPTIONS, path := "", error_ha } } else if open.kind == .Question { - /* - 0 { - /* - We've already seen a prologue. - */ + // We've already seen a prologue. return doc, .Too_Many_Prologs } else { - /* - Could be ` (err: Error) { doc.encoding = .LATIN_1 case: - /* - Unrecognized encoding, assume UTF-8. - */ + // Unrecognized encoding, assume UTF-8. error(t, offset, "[parse_prologue] Warning: Unrecognized encoding: %v\n", attr.val) } @@ -658,11 +583,11 @@ skip_element :: proc(t: ^Tokenizer) -> (err: Error) { parse_doctype :: proc(doc: ^Document) -> (err: Error) { /* - + - - ]> + + ]> */ assert(doc != nil) context.allocator = doc.allocator @@ -675,9 +600,7 @@ parse_doctype :: proc(doc: ^Document) -> (err: Error) { offset := t.offset skip_element(t) or_return - /* - -1 because the current offset is that of the closing tag, so the rest of the DOCTYPE tag ends just before it. - */ + // -1 because the current offset is that of the closing tag, so the rest of the DOCTYPE tag ends just before it. doc.doctype.rest = string(t.src[offset : t.offset - 1]) return .None } @@ -700,4 +623,4 @@ new_element :: proc(doc: ^Document) -> (id: Element_ID) { cur := doc.element_count doc.element_count += 1 return cur -} \ No newline at end of file +} diff --git a/core/fmt/fmt.odin b/core/fmt/fmt.odin index c9e284edc..25012eb65 100644 --- a/core/fmt/fmt.odin +++ b/core/fmt/fmt.odin @@ -253,18 +253,24 @@ bprintf :: proc(buf: []byte, fmt: string, args: ..any) -> string { // - args: A variadic list of arguments to be formatted // - loc: The location of the caller // -// Returns: True if the condition is met, otherwise triggers a runtime assertion with a formatted message -// -assertf :: proc(condition: bool, fmt: string, args: ..any, loc := #caller_location) -> bool { +@(disabled=ODIN_DISABLE_ASSERT) +assertf :: proc(condition: bool, fmt: string, args: ..any, loc := #caller_location) { if !condition { - p := context.assertion_failure_proc - if p == nil { - p = runtime.default_assertion_failure_proc + // NOTE(dragos): We are using the same trick as in builtin.assert + // to improve performance to make the CPU not + // execute speculatively, making it about an order of + // magnitude faster + @(cold) + internal :: proc(loc: runtime.Source_Code_Location, fmt: string, args: ..any) { + p := context.assertion_failure_proc + if p == nil { + p = runtime.default_assertion_failure_proc + } + message := tprintf(fmt, ..args) + p("Runtime assertion", message, loc) } - message := tprintf(fmt, ..args) - p("Runtime assertion", message, loc) + internal(loc, fmt, ..args) } - return condition } // Runtime panic with a formatted message // @@ -948,24 +954,10 @@ _fmt_int :: proc(fi: ^Info, u: u64, base: int, is_signed: bool, bit_size: int, d start := 0 flags: strconv.Int_Flags - if fi.hash && !fi.zero { flags |= {.Prefix} } - if fi.plus { flags |= {.Plus} } + if fi.hash { flags |= {.Prefix} } + if fi.plus { flags |= {.Plus} } s := strconv.append_bits(buf[start:], u, base, is_signed, bit_size, digits, flags) - if fi.hash && fi.zero && fi.indent == 0 { - c: byte = 0 - switch base { - case 2: c = 'b' - case 8: c = 'o' - case 12: c = 'z' - case 16: c = 'x' - } - if c != 0 { - io.write_byte(fi.writer, '0', &fi.n) - io.write_byte(fi.writer, c, &fi.n) - } - } - prev_zero := fi.zero defer fi.zero = prev_zero fi.zero = false diff --git a/core/log/log.odin b/core/log/log.odin index 021a46000..b4039caa0 100644 --- a/core/log/log.odin +++ b/core/log/log.odin @@ -116,6 +116,42 @@ panicf :: proc(fmt_str: string, args: ..any, location := #caller_location) -> ! runtime.panic("log.panicf", location) } +@(disabled=ODIN_DISABLE_ASSERT) +assert :: proc(condition: bool, message := "", loc := #caller_location) { + if !condition { + @(cold) + internal :: proc(message: string, loc: runtime.Source_Code_Location) { + p := context.assertion_failure_proc + if p == nil { + p = runtime.default_assertion_failure_proc + } + log(.Fatal, message, location=loc) + p("runtime assertion", message, loc) + } + internal(message, loc) + } +} + +@(disabled=ODIN_DISABLE_ASSERT) +assertf :: proc(condition: bool, fmt_str: string, args: ..any, loc := #caller_location) { + if !condition { + // NOTE(dragos): We are using the same trick as in builtin.assert + // to improve performance to make the CPU not + // execute speculatively, making it about an order of + // magnitude faster + @(cold) + internal :: proc(loc: runtime.Source_Code_Location, fmt_str: string, args: ..any) { + p := context.assertion_failure_proc + if p == nil { + p = runtime.default_assertion_failure_proc + } + message := fmt.tprintf(fmt_str, ..args) + log(.Fatal, message, location=loc) + p("Runtime assertion", message, loc) + } + internal(loc, fmt_str, ..args) + } +} diff --git a/core/log/log_allocator.odin b/core/log/log_allocator.odin index 360562f01..322c2e717 100644 --- a/core/log/log_allocator.odin +++ b/core/log/log_allocator.odin @@ -96,6 +96,15 @@ log_allocator_proc :: proc(allocator_data: rawptr, mode: runtime.Allocator_Mode, str := fmt.bprintf(buf[:], format, la.prefix, padding, old_memory, old_size, size, alignment) context.logger.procedure(context.logger.data, la.level, str, context.logger.options, location) + case .Resize_Non_Zeroed: + format: string + switch la.size_fmt { + case .Bytes: format = "%s%s>>> ALLOCATOR(mode=.Resize_Non_Zeroed, ptr=%p, old_size=%d, size=%d, alignment=%d)" + case .Human: format = "%s%s>>> ALLOCATOR(mode=.Resize_Non_Zeroed, ptr=%p, old_size=%m, size=%m, alignment=%d)" + } + str := fmt.bprintf(buf[:], format, la.prefix, padding, old_memory, old_size, size, alignment) + context.logger.procedure(context.logger.data, la.level, str, context.logger.options, location) + case .Query_Features: str := fmt.bprintf(buf[:], "%s%sALLOCATOR(mode=.Query_Features)", la.prefix, padding) context.logger.procedure(context.logger.data, la.level, str, context.logger.options, location) diff --git a/core/math/fixed/fixed.odin b/core/math/fixed/fixed.odin index 5d63bf7be..d347e9c11 100644 --- a/core/math/fixed/fixed.odin +++ b/core/math/fixed/fixed.odin @@ -88,17 +88,19 @@ div_sat :: proc(x, y: $T/Fixed($Backing, $Fraction_Width)) -> (z: T) { @(require_results) floor :: proc(x: $T/Fixed($Backing, $Fraction_Width)) -> Backing { - return x.i >> Fraction_Width + if x.i >= 0 { + return x.i >> Fraction_Width + } else { + return (x.i - (1 << (Fraction_Width - 1)) + (1 << (Fraction_Width - 2))) >> Fraction_Width + } } @(require_results) ceil :: proc(x: $T/Fixed($Backing, $Fraction_Width)) -> Backing { - Integer :: 8*size_of(Backing) - Fraction_Width - return (x.i + (1 << Integer-1)) >> Fraction_Width + return (x.i + (1 << Fraction_Width - 1)) >> Fraction_Width } @(require_results) round :: proc(x: $T/Fixed($Backing, $Fraction_Width)) -> Backing { - Integer :: 8*size_of(Backing) - Fraction_Width - return (x.i + (1 << (Integer - 1))) >> Fraction_Width + return (x.i + (1 << (Fraction_Width - 1))) >> Fraction_Width } diff --git a/core/math/linalg/general.odin b/core/math/linalg/general.odin index b58305c63..60185d64d 100644 --- a/core/math/linalg/general.odin +++ b/core/math/linalg/general.odin @@ -70,7 +70,7 @@ outer_product :: builtin.outer_product @(require_results) quaternion_inverse :: proc "contextless" (q: $Q) -> Q where IS_QUATERNION(Q) { - return conj(q) * quaternion(1.0/dot(q, q), 0, 0, 0) + return conj(q) * quaternion(w=1.0/dot(q, q), x=0, y=0, z=0) } @@ -217,7 +217,7 @@ quaternion64_mul_vector3 :: proc "contextless" (q: $Q/quaternion64, v: $V/[3]$F/ Raw_Quaternion :: struct {xyz: [3]f16, r: f16} q := transmute(Raw_Quaternion)q - v := transmute([3]f16)v + v := v t := cross(2*q.xyz, v) return V(v + q.r*t + cross(q.xyz, t)) @@ -227,7 +227,7 @@ quaternion128_mul_vector3 :: proc "contextless" (q: $Q/quaternion128, v: $V/[3]$ Raw_Quaternion :: struct {xyz: [3]f32, r: f32} q := transmute(Raw_Quaternion)q - v := transmute([3]f32)v + v := v t := cross(2*q.xyz, v) return V(v + q.r*t + cross(q.xyz, t)) @@ -237,7 +237,7 @@ quaternion256_mul_vector3 :: proc "contextless" (q: $Q/quaternion256, v: $V/[3]$ Raw_Quaternion :: struct {xyz: [3]f64, r: f64} q := transmute(Raw_Quaternion)q - v := transmute([3]f64)v + v := v t := cross(2*q.xyz, v) return V(v + q.r*t + cross(q.xyz, t)) diff --git a/core/math/linalg/specific.odin b/core/math/linalg/specific.odin index 6607b241f..1f96eb178 100644 --- a/core/math/linalg/specific.odin +++ b/core/math/linalg/specific.odin @@ -7,96 +7,96 @@ F16_EPSILON :: 1e-3 F32_EPSILON :: 1e-7 F64_EPSILON :: 1e-15 -Vector2f16 :: distinct [2]f16 -Vector3f16 :: distinct [3]f16 -Vector4f16 :: distinct [4]f16 +Vector2f16 :: [2]f16 +Vector3f16 :: [3]f16 +Vector4f16 :: [4]f16 -Matrix1x1f16 :: distinct matrix[1, 1]f16 -Matrix1x2f16 :: distinct matrix[1, 2]f16 -Matrix1x3f16 :: distinct matrix[1, 3]f16 -Matrix1x4f16 :: distinct matrix[1, 4]f16 +Matrix1x1f16 :: matrix[1, 1]f16 +Matrix1x2f16 :: matrix[1, 2]f16 +Matrix1x3f16 :: matrix[1, 3]f16 +Matrix1x4f16 :: matrix[1, 4]f16 -Matrix2x1f16 :: distinct matrix[2, 1]f16 -Matrix2x2f16 :: distinct matrix[2, 2]f16 -Matrix2x3f16 :: distinct matrix[2, 3]f16 -Matrix2x4f16 :: distinct matrix[2, 4]f16 +Matrix2x1f16 :: matrix[2, 1]f16 +Matrix2x2f16 :: matrix[2, 2]f16 +Matrix2x3f16 :: matrix[2, 3]f16 +Matrix2x4f16 :: matrix[2, 4]f16 -Matrix3x1f16 :: distinct matrix[3, 1]f16 -Matrix3x2f16 :: distinct matrix[3, 2]f16 -Matrix3x3f16 :: distinct matrix[3, 3]f16 -Matrix3x4f16 :: distinct matrix[3, 4]f16 +Matrix3x1f16 :: matrix[3, 1]f16 +Matrix3x2f16 :: matrix[3, 2]f16 +Matrix3x3f16 :: matrix[3, 3]f16 +Matrix3x4f16 :: matrix[3, 4]f16 -Matrix4x1f16 :: distinct matrix[4, 1]f16 -Matrix4x2f16 :: distinct matrix[4, 2]f16 -Matrix4x3f16 :: distinct matrix[4, 3]f16 -Matrix4x4f16 :: distinct matrix[4, 4]f16 +Matrix4x1f16 :: matrix[4, 1]f16 +Matrix4x2f16 :: matrix[4, 2]f16 +Matrix4x3f16 :: matrix[4, 3]f16 +Matrix4x4f16 :: matrix[4, 4]f16 Matrix1f16 :: Matrix1x1f16 Matrix2f16 :: Matrix2x2f16 Matrix3f16 :: Matrix3x3f16 Matrix4f16 :: Matrix4x4f16 -Vector2f32 :: distinct [2]f32 -Vector3f32 :: distinct [3]f32 -Vector4f32 :: distinct [4]f32 +Vector2f32 :: [2]f32 +Vector3f32 :: [3]f32 +Vector4f32 :: [4]f32 -Matrix1x1f32 :: distinct matrix[1, 1]f32 -Matrix1x2f32 :: distinct matrix[1, 2]f32 -Matrix1x3f32 :: distinct matrix[1, 3]f32 -Matrix1x4f32 :: distinct matrix[1, 4]f32 +Matrix1x1f32 :: matrix[1, 1]f32 +Matrix1x2f32 :: matrix[1, 2]f32 +Matrix1x3f32 :: matrix[1, 3]f32 +Matrix1x4f32 :: matrix[1, 4]f32 -Matrix2x1f32 :: distinct matrix[2, 1]f32 -Matrix2x2f32 :: distinct matrix[2, 2]f32 -Matrix2x3f32 :: distinct matrix[2, 3]f32 -Matrix2x4f32 :: distinct matrix[2, 4]f32 +Matrix2x1f32 :: matrix[2, 1]f32 +Matrix2x2f32 :: matrix[2, 2]f32 +Matrix2x3f32 :: matrix[2, 3]f32 +Matrix2x4f32 :: matrix[2, 4]f32 -Matrix3x1f32 :: distinct matrix[3, 1]f32 -Matrix3x2f32 :: distinct matrix[3, 2]f32 -Matrix3x3f32 :: distinct matrix[3, 3]f32 -Matrix3x4f32 :: distinct matrix[3, 4]f32 +Matrix3x1f32 :: matrix[3, 1]f32 +Matrix3x2f32 :: matrix[3, 2]f32 +Matrix3x3f32 :: matrix[3, 3]f32 +Matrix3x4f32 :: matrix[3, 4]f32 -Matrix4x1f32 :: distinct matrix[4, 1]f32 -Matrix4x2f32 :: distinct matrix[4, 2]f32 -Matrix4x3f32 :: distinct matrix[4, 3]f32 -Matrix4x4f32 :: distinct matrix[4, 4]f32 +Matrix4x1f32 :: matrix[4, 1]f32 +Matrix4x2f32 :: matrix[4, 2]f32 +Matrix4x3f32 :: matrix[4, 3]f32 +Matrix4x4f32 :: matrix[4, 4]f32 Matrix1f32 :: Matrix1x1f32 Matrix2f32 :: Matrix2x2f32 Matrix3f32 :: Matrix3x3f32 Matrix4f32 :: Matrix4x4f32 -Vector2f64 :: distinct [2]f64 -Vector3f64 :: distinct [3]f64 -Vector4f64 :: distinct [4]f64 +Vector2f64 :: [2]f64 +Vector3f64 :: [3]f64 +Vector4f64 :: [4]f64 -Matrix1x1f64 :: distinct matrix[1, 1]f64 -Matrix1x2f64 :: distinct matrix[1, 2]f64 -Matrix1x3f64 :: distinct matrix[1, 3]f64 -Matrix1x4f64 :: distinct matrix[1, 4]f64 +Matrix1x1f64 :: matrix[1, 1]f64 +Matrix1x2f64 :: matrix[1, 2]f64 +Matrix1x3f64 :: matrix[1, 3]f64 +Matrix1x4f64 :: matrix[1, 4]f64 -Matrix2x1f64 :: distinct matrix[2, 1]f64 -Matrix2x2f64 :: distinct matrix[2, 2]f64 -Matrix2x3f64 :: distinct matrix[2, 3]f64 -Matrix2x4f64 :: distinct matrix[2, 4]f64 +Matrix2x1f64 :: matrix[2, 1]f64 +Matrix2x2f64 :: matrix[2, 2]f64 +Matrix2x3f64 :: matrix[2, 3]f64 +Matrix2x4f64 :: matrix[2, 4]f64 -Matrix3x1f64 :: distinct matrix[3, 1]f64 -Matrix3x2f64 :: distinct matrix[3, 2]f64 -Matrix3x3f64 :: distinct matrix[3, 3]f64 -Matrix3x4f64 :: distinct matrix[3, 4]f64 +Matrix3x1f64 :: matrix[3, 1]f64 +Matrix3x2f64 :: matrix[3, 2]f64 +Matrix3x3f64 :: matrix[3, 3]f64 +Matrix3x4f64 :: matrix[3, 4]f64 -Matrix4x1f64 :: distinct matrix[4, 1]f64 -Matrix4x2f64 :: distinct matrix[4, 2]f64 -Matrix4x3f64 :: distinct matrix[4, 3]f64 -Matrix4x4f64 :: distinct matrix[4, 4]f64 +Matrix4x1f64 :: matrix[4, 1]f64 +Matrix4x2f64 :: matrix[4, 2]f64 +Matrix4x3f64 :: matrix[4, 3]f64 +Matrix4x4f64 :: matrix[4, 4]f64 Matrix1f64 :: Matrix1x1f64 Matrix2f64 :: Matrix2x2f64 Matrix3f64 :: Matrix3x3f64 Matrix4f64 :: Matrix4x4f64 -Quaternionf16 :: distinct quaternion64 -Quaternionf32 :: distinct quaternion128 -Quaternionf64 :: distinct quaternion256 +Quaternionf16 :: quaternion64 +Quaternionf32 :: quaternion128 +Quaternionf64 :: quaternion256 MATRIX1F16_IDENTITY :: Matrix1f16(1) MATRIX2F16_IDENTITY :: Matrix2f16(1) diff --git a/core/mem/alloc.odin b/core/mem/alloc.odin index 57e82a5f8..4cea20f30 100644 --- a/core/mem/alloc.odin +++ b/core/mem/alloc.odin @@ -11,6 +11,8 @@ Allocator_Mode :: enum byte { Free_All, Resize, Query_Features, + Alloc_Non_Zeroed, + Resize_Non_Zeroed, } */ @@ -243,12 +245,26 @@ default_resize_align :: proc(old_memory: rawptr, old_size, new_size, alignment: res = raw_data(data) return } + +@(require_results) +default_resize_bytes_align_non_zeroed :: proc(old_data: []byte, new_size, alignment: int, allocator := context.allocator, loc := #caller_location) -> ([]byte, Allocator_Error) { + return _default_resize_bytes_align(old_data, new_size, alignment, false, allocator, loc) +} @(require_results) default_resize_bytes_align :: proc(old_data: []byte, new_size, alignment: int, allocator := context.allocator, loc := #caller_location) -> ([]byte, Allocator_Error) { + return _default_resize_bytes_align(old_data, new_size, alignment, true, allocator, loc) +} + +@(require_results) +_default_resize_bytes_align :: #force_inline proc(old_data: []byte, new_size, alignment: int, should_zero: bool, allocator := context.allocator, loc := #caller_location) -> ([]byte, Allocator_Error) { old_memory := raw_data(old_data) old_size := len(old_data) if old_memory == nil { - return alloc_bytes(new_size, alignment, allocator, loc) + if should_zero { + return alloc_bytes(new_size, alignment, allocator, loc) + } else { + return alloc_bytes_non_zeroed(new_size, alignment, allocator, loc) + } } if new_size == 0 { @@ -260,7 +276,13 @@ default_resize_bytes_align :: proc(old_data: []byte, new_size, alignment: int, a return old_data, .None } - new_memory, err := alloc_bytes(new_size, alignment, allocator, loc) + new_memory : []byte + err : Allocator_Error + if should_zero { + new_memory, err = alloc_bytes(new_size, alignment, allocator, loc) + } else { + new_memory, err = alloc_bytes_non_zeroed(new_size, alignment, allocator, loc) + } if new_memory == nil || err != nil { return nil, err } diff --git a/core/mem/allocators.odin b/core/mem/allocators.odin index 4f5dd8eef..76f87a450 100644 --- a/core/mem/allocators.odin +++ b/core/mem/allocators.odin @@ -85,13 +85,16 @@ arena_allocator_proc :: proc(allocator_data: rawptr, mode: Allocator_Mode, case .Free_All: arena.offset = 0 - case .Resize: - return default_resize_bytes_align(byte_slice(old_memory, old_size), size, alignment, arena_allocator(arena)) + case .Resize: + return default_resize_bytes_align(byte_slice(old_memory, old_size), size, alignment, arena_allocator(arena)) + + case .Resize_Non_Zeroed: + return default_resize_bytes_align_non_zeroed(byte_slice(old_memory, old_size), size, alignment, arena_allocator(arena)) case .Query_Features: set := (^Allocator_Mode_Set)(old_memory) if set != nil { - set^ = {.Alloc, .Alloc_Non_Zeroed, .Free_All, .Resize, .Query_Features} + set^ = {.Alloc, .Alloc_Non_Zeroed, .Free_All, .Resize, .Resize_Non_Zeroed, .Query_Features} } return nil, nil @@ -259,7 +262,7 @@ scratch_allocator_proc :: proc(allocator_data: rawptr, mode: Allocator_Mode, } clear(&s.leaked_allocations) - case .Resize: + case .Resize, .Resize_Non_Zeroed: begin := uintptr(raw_data(s.data)) end := begin + uintptr(len(s.data)) old_ptr := uintptr(old_memory) @@ -278,7 +281,7 @@ scratch_allocator_proc :: proc(allocator_data: rawptr, mode: Allocator_Mode, case .Query_Features: set := (^Allocator_Mode_Set)(old_memory) if set != nil { - set^ = {.Alloc, .Alloc_Non_Zeroed, .Free, .Free_All, .Resize, .Query_Features} + set^ = {.Alloc, .Alloc_Non_Zeroed, .Free, .Free_All, .Resize, .Resize_Non_Zeroed, .Query_Features} } return nil, nil @@ -406,9 +409,9 @@ stack_allocator_proc :: proc(allocator_data: rawptr, mode: Allocator_Mode, s.prev_offset = 0 s.curr_offset = 0 - case .Resize: + case .Resize, .Resize_Non_Zeroed: if old_memory == nil { - return raw_alloc(s, size, alignment, true) + return raw_alloc(s, size, alignment, mode == .Resize) } if size == 0 { return nil, nil @@ -434,7 +437,7 @@ stack_allocator_proc :: proc(allocator_data: rawptr, mode: Allocator_Mode, old_offset := int(curr_addr - uintptr(header.padding) - uintptr(raw_data(s.data))) if old_offset != header.prev_offset { - data, err := raw_alloc(s, size, alignment, true) + data, err := raw_alloc(s, size, alignment, mode == .Resize) if err == nil { runtime.copy(data, byte_slice(old_memory, old_size)) } @@ -455,7 +458,7 @@ stack_allocator_proc :: proc(allocator_data: rawptr, mode: Allocator_Mode, case .Query_Features: set := (^Allocator_Mode_Set)(old_memory) if set != nil { - set^ = {.Alloc, .Alloc_Non_Zeroed, .Free, .Free_All, .Resize, .Query_Features} + set^ = {.Alloc, .Alloc_Non_Zeroed, .Free, .Free_All, .Resize, .Resize_Non_Zeroed, .Query_Features} } return nil, nil case .Query_Info: @@ -565,9 +568,9 @@ small_stack_allocator_proc :: proc(allocator_data: rawptr, mode: Allocator_Mode, case .Free_All: s.offset = 0 - case .Resize: + case .Resize, .Resize_Non_Zeroed: if old_memory == nil { - return raw_alloc(s, size, align, true) + return raw_alloc(s, size, align, mode == .Resize) } if size == 0 { return nil, nil @@ -590,7 +593,7 @@ small_stack_allocator_proc :: proc(allocator_data: rawptr, mode: Allocator_Mode, return byte_slice(old_memory, size), nil } - data, err := raw_alloc(s, size, align, true) + data, err := raw_alloc(s, size, align, mode == .Resize) if err == nil { runtime.copy(data, byte_slice(old_memory, old_size)) } @@ -599,7 +602,7 @@ small_stack_allocator_proc :: proc(allocator_data: rawptr, mode: Allocator_Mode, case .Query_Features: set := (^Allocator_Mode_Set)(old_memory) if set != nil { - set^ = {.Alloc, .Alloc_Non_Zeroed, .Free, .Free_All, .Resize, .Query_Features} + set^ = {.Alloc, .Alloc_Non_Zeroed, .Free, .Free_All, .Resize, .Resize_Non_Zeroed, .Query_Features} } return nil, nil @@ -649,7 +652,7 @@ dynamic_pool_allocator_proc :: proc(allocator_data: rawptr, mode: Allocator_Mode case .Free_All: dynamic_pool_free_all(pool) return nil, nil - case .Resize: + case .Resize, .Resize_Non_Zeroed: if old_size >= size { return byte_slice(old_memory, size), nil } @@ -662,7 +665,7 @@ dynamic_pool_allocator_proc :: proc(allocator_data: rawptr, mode: Allocator_Mode case .Query_Features: set := (^Allocator_Mode_Set)(old_memory) if set != nil { - set^ = {.Alloc, .Alloc_Non_Zeroed, .Free_All, .Resize, .Query_Features, .Query_Info} + set^ = {.Alloc, .Alloc_Non_Zeroed, .Free_All, .Resize, .Resize_Non_Zeroed, .Query_Features, .Query_Info} } return nil, nil @@ -826,6 +829,10 @@ panic_allocator_proc :: proc(allocator_data: rawptr, mode: Allocator_Mode, if size > 0 { panic("mem: panic allocator, .Resize called", loc=loc) } + case .Resize_Non_Zeroed: + if size > 0 { + panic("mem: panic allocator, .Resize_Non_Zeroed called", loc=loc) + } case .Free: if old_memory != nil { panic("mem: panic allocator, .Free called", loc=loc) @@ -958,7 +965,7 @@ tracking_allocator_proc :: proc(allocator_data: rawptr, mode: Allocator_Mode, if data.clear_on_free_all { clear_map(&data.allocation_map) } - case .Resize: + case .Resize, .Resize_Non_Zeroed: if old_memory != result_ptr { delete_key(&data.allocation_map, old_memory) } diff --git a/core/mem/virtual/arena.odin b/core/mem/virtual/arena.odin index 90379e5e6..cdac3c32f 100644 --- a/core/mem/virtual/arena.odin +++ b/core/mem/virtual/arena.odin @@ -288,7 +288,7 @@ arena_allocator_proc :: proc(allocator_data: rawptr, mode: mem.Allocator_Mode, err = .Mode_Not_Implemented case .Free_All: arena_free_all(arena, location) - case .Resize: + case .Resize, .Resize_Non_Zeroed: old_data := ([^]byte)(old_memory) switch { diff --git a/core/mem/virtual/file.odin b/core/mem/virtual/file.odin new file mode 100644 index 000000000..5d7180588 --- /dev/null +++ b/core/mem/virtual/file.odin @@ -0,0 +1,47 @@ +package mem_virtual + +import "core:os" + +Map_File_Error :: enum { + None, + Open_Failure, + Stat_Failure, + Negative_Size, + Too_Large_Size, + Map_Failure, +} + +Map_File_Flag :: enum u32 { + Read, + Write, +} +Map_File_Flags :: distinct bit_set[Map_File_Flag; u32] + +map_file :: proc{ + map_file_from_path, + map_file_from_file_descriptor, +} + +map_file_from_path :: proc(filename: string, flags: Map_File_Flags) -> (data: []byte, error: Map_File_Error) { + fd, err := os.open(filename, os.O_RDWR) + if err != 0 { + return nil, .Open_Failure + } + defer os.close(fd) + + return map_file_from_file_descriptor(uintptr(fd), flags) +} + +map_file_from_file_descriptor :: proc(fd: uintptr, flags: Map_File_Flags) -> (data: []byte, error: Map_File_Error) { + size, os_err := os.file_size(os.Handle(fd)) + if os_err != 0 { + return nil, .Stat_Failure + } + if size < 0 { + return nil, .Negative_Size + } + if size != i64(int(size)) { + return nil, .Too_Large_Size + } + return _map_file(fd, size, flags) +} diff --git a/core/mem/virtual/virtual_bsd.odin b/core/mem/virtual/virtual_bsd.odin index 103e48074..7568084c0 100644 --- a/core/mem/virtual/virtual_bsd.odin +++ b/core/mem/virtual/virtual_bsd.odin @@ -22,3 +22,7 @@ _protect :: proc "contextless" (data: rawptr, size: uint, flags: Protect_Flags) _platform_memory_init :: proc() { } + +_map_file :: proc "contextless" (fd: uintptr, size: i64, flags: Map_File_Flags) -> (data: []byte, error: Map_File_Error) { + return nil, .Map_Failure +} diff --git a/core/mem/virtual/virtual_darwin.odin b/core/mem/virtual/virtual_darwin.odin index 5505149b0..5be17c0f9 100644 --- a/core/mem/virtual/virtual_darwin.odin +++ b/core/mem/virtual/virtual_darwin.odin @@ -136,7 +136,7 @@ _protect :: proc "contextless" (data: rawptr, size: uint, flags: Protect_Flags) if .Write in flags { pflags |= PROT_WRITE } if .Execute in flags { pflags |= PROT_EXEC } err := _mprotect(data, size, pflags) - return err != 0 + return err == 0 } @@ -146,3 +146,20 @@ _platform_memory_init :: proc() { // is power of two assert(DEFAULT_PAGE_SIZE != 0 && (DEFAULT_PAGE_SIZE & (DEFAULT_PAGE_SIZE-1)) == 0) } + + +_map_file :: proc "contextless" (fd: uintptr, size: i64, flags: Map_File_Flags) -> (data: []byte, error: Map_File_Error) { + prot, mflags: c.int + if .Read in flags { + prot |= PROT_READ + } + if .Write in flags { + prot |= PROT_WRITE + } + mflags |= MAP_SHARED + addr := _mmap(nil, c.size_t(size), prot, mflags, i32(fd), 0) + if addr == nil { + return nil, .Map_Failure + } + return ([^]byte)(addr)[:size], nil +} diff --git a/core/mem/virtual/virtual_linux.odin b/core/mem/virtual/virtual_linux.odin index 7ffc7643e..816a8bb84 100644 --- a/core/mem/virtual/virtual_linux.odin +++ b/core/mem/virtual/virtual_linux.odin @@ -40,7 +40,7 @@ _protect :: proc "contextless" (data: rawptr, size: uint, flags: Protect_Flags) if .Write in flags { pflags |= {.WRITE} } if .Execute in flags { pflags |= {.EXEC} } errno := linux.mprotect(data, size, pflags) - return errno != .NONE + return errno == .NONE } _platform_memory_init :: proc() { @@ -48,3 +48,21 @@ _platform_memory_init :: proc() { // is power of two assert(DEFAULT_PAGE_SIZE != 0 && (DEFAULT_PAGE_SIZE & (DEFAULT_PAGE_SIZE-1)) == 0) } + + +_map_file :: proc "contextless" (fd: uintptr, size: i64, flags: Map_File_Flags) -> (data: []byte, error: Map_File_Error) { + prot: linux.Mem_Protection + if .Read in flags { + prot += {.READ} + } + if .Write in flags { + prot += {.WRITE} + } + + flags := linux.Map_Flags{.SHARED} + addr, errno := linux.mmap(0, uint(size), prot, flags, linux.Fd(fd), offset=0) + if addr == nil || errno != nil { + return nil, .Map_Failure + } + return ([^]byte)(addr)[:size], nil +} diff --git a/core/mem/virtual/virtual_windows.odin b/core/mem/virtual/virtual_windows.odin index bbd74a925..ee47a01a8 100644 --- a/core/mem/virtual/virtual_windows.odin +++ b/core/mem/virtual/virtual_windows.odin @@ -50,19 +50,39 @@ PAGE_WRITECOPY :: 0x08 PAGE_TARGETS_INVALID :: 0x40000000 PAGE_TARGETS_NO_UPDATE :: 0x40000000 +SECTION_MAP_WRITE :: 0x0002 +SECTION_MAP_READ :: 0x0004 +FILE_MAP_WRITE :: SECTION_MAP_WRITE +FILE_MAP_READ :: SECTION_MAP_READ + ERROR_INVALID_ADDRESS :: 487 ERROR_COMMITMENT_LIMIT :: 1455 -@(default_calling_convention="stdcall") +@(default_calling_convention="system") foreign Kernel32 { GetSystemInfo :: proc(lpSystemInfo: LPSYSTEM_INFO) --- VirtualAlloc :: proc(lpAddress: rawptr, dwSize: uint, flAllocationType: u32, flProtect: u32) -> rawptr --- VirtualFree :: proc(lpAddress: rawptr, dwSize: uint, dwFreeType: u32) -> b32 --- VirtualProtect :: proc(lpAddress: rawptr, dwSize: uint, flNewProtect: u32, lpflOldProtect: ^u32) -> b32 --- GetLastError :: proc() -> u32 --- + + CreateFileMappingW :: proc( + hFile: rawptr, + lpFileMappingAttributes: rawptr, + flProtect: u32, + dwMaximumSizeHigh: u32, + dwMaximumSizeLow: u32, + lpName: [^]u16, + ) -> rawptr --- + + MapViewOfFile :: proc( + hFileMappingObject: rawptr, + dwDesiredAccess: u32, + dwFileOffsetHigh: u32, + dwFileOffsetLow: u32, + dwNumberOfBytesToMap: uint, + ) -> rawptr --- } - - _reserve :: proc "contextless" (size: uint) -> (data: []byte, err: Allocator_Error) { result := VirtualAlloc(nil, size, MEM_RESERVE, PAGE_READWRITE) if result == nil { @@ -125,3 +145,33 @@ _platform_memory_init :: proc() { // is power of two assert(DEFAULT_PAGE_SIZE != 0 && (DEFAULT_PAGE_SIZE & (DEFAULT_PAGE_SIZE-1)) == 0) } + + +_map_file :: proc "contextless" (fd: uintptr, size: i64, flags: Map_File_Flags) -> (data: []byte, error: Map_File_Error) { + page_flags: u32 + if flags == {.Read} { + page_flags = PAGE_READONLY + } else if flags == {.Write} { + page_flags = PAGE_READWRITE + } else if flags == {.Read, .Write} { + page_flags = PAGE_READWRITE + } else { + page_flags = PAGE_NOACCESS + } + maximum_size := transmute([2]u32)size + handle := CreateFileMappingW(rawptr(fd), nil, page_flags, maximum_size[1], maximum_size[0], nil) + if handle == nil { + return nil, .Map_Failure + } + + desired_access: u32 + if .Read in flags { + desired_access |= FILE_MAP_READ + } + if .Write in flags { + desired_access |= FILE_MAP_WRITE + } + + file_data := MapViewOfFile(handle, desired_access, 0, 0, uint(size)) + return ([^]byte)(file_data)[:size], nil +} diff --git a/core/odin/parser/parser.odin b/core/odin/parser/parser.odin index f11d0eb73..3383f3514 100644 --- a/core/odin/parser/parser.odin +++ b/core/odin/parser/parser.odin @@ -436,6 +436,24 @@ expect_closing_brace_of_field_list :: proc(p: ^Parser) -> tokenizer.Token { return expect_brace } +expect_closing_parentheses_of_field_list :: proc(p: ^Parser) -> tokenizer.Token { + token := p.curr_tok + if allow_token(p, .Close_Paren) { + return token + } + + if allow_token(p, .Semicolon) && !tokenizer.is_newline(token) { + str := tokenizer.token_to_string(token) + error(p, end_of_line_pos(p, p.prev_tok), "expected a comma, got %s", str) + } + + for p.curr_tok.kind != .Close_Paren && p.curr_tok.kind != .EOF && !is_non_inserted_semicolon(p.curr_tok) { + advance_token(p) + } + + return expect_token(p, .Close_Paren) +} + is_non_inserted_semicolon :: proc(tok: tokenizer.Token) -> bool { return tok.kind == .Semicolon && tok.text != "\n" } @@ -2095,7 +2113,7 @@ parse_proc_type :: proc(p: ^Parser, tok: tokenizer.Token) -> ^ast.Proc_Type { expect_token(p, .Open_Paren) params, _ := parse_field_list(p, .Close_Paren, ast.Field_Flags_Signature_Params) - expect_token(p, .Close_Paren) + expect_closing_parentheses_of_field_list(p) results, diverging := parse_results(p) is_generic := false diff --git a/core/os/file_windows.odin b/core/os/file_windows.odin index 0b0baeea3..96f6d8e8f 100644 --- a/core/os/file_windows.odin +++ b/core/os/file_windows.odin @@ -349,7 +349,7 @@ exists :: proc(path: string) -> bool { wpath := win32.utf8_to_wstring(path, context.temp_allocator) attribs := win32.GetFileAttributesW(wpath) - return i32(attribs) != win32.INVALID_FILE_ATTRIBUTES + return attribs != win32.INVALID_FILE_ATTRIBUTES } is_file :: proc(path: string) -> bool { @@ -357,7 +357,7 @@ is_file :: proc(path: string) -> bool { wpath := win32.utf8_to_wstring(path, context.temp_allocator) attribs := win32.GetFileAttributesW(wpath) - if i32(attribs) != win32.INVALID_FILE_ATTRIBUTES { + if attribs != win32.INVALID_FILE_ATTRIBUTES { return attribs & win32.FILE_ATTRIBUTE_DIRECTORY == 0 } return false @@ -368,7 +368,7 @@ is_dir :: proc(path: string) -> bool { wpath := win32.utf8_to_wstring(path, context.temp_allocator) attribs := win32.GetFileAttributesW(wpath) - if i32(attribs) != win32.INVALID_FILE_ATTRIBUTES { + if attribs != win32.INVALID_FILE_ATTRIBUTES { return attribs & win32.FILE_ATTRIBUTE_DIRECTORY != 0 } return false diff --git a/core/os/os.odin b/core/os/os.odin index 15864e47e..3210a39d0 100644 --- a/core/os/os.odin +++ b/core/os/os.odin @@ -210,15 +210,15 @@ heap_allocator_proc :: proc(allocator_data: rawptr, mode: mem.Allocator_Mode, } } - aligned_resize :: proc(p: rawptr, old_size: int, new_size: int, new_alignment: int) -> (new_memory: []byte, err: mem.Allocator_Error) { + aligned_resize :: proc(p: rawptr, old_size: int, new_size: int, new_alignment: int, zero_memory := true) -> (new_memory: []byte, err: mem.Allocator_Error) { if p == nil { return nil, nil } - new_memory = aligned_alloc(new_size, new_alignment, p) or_return + new_memory = aligned_alloc(new_size, new_alignment, p, zero_memory) or_return // NOTE: heap_resize does not zero the new memory, so we do it - if new_size > old_size { + if zero_memory && new_size > old_size { new_region := mem.raw_data(new_memory[old_size:]) mem.zero(new_region, new_size - old_size) } @@ -235,16 +235,16 @@ heap_allocator_proc :: proc(allocator_data: rawptr, mode: mem.Allocator_Mode, case .Free_All: return nil, .Mode_Not_Implemented - case .Resize: + case .Resize, .Resize_Non_Zeroed: if old_memory == nil { - return aligned_alloc(size, alignment) + return aligned_alloc(size, alignment, nil, mode == .Resize) } - return aligned_resize(old_memory, old_size, size, alignment) + return aligned_resize(old_memory, old_size, size, alignment, mode == .Resize) case .Query_Features: set := (^mem.Allocator_Mode_Set)(old_memory) if set != nil { - set^ = {.Alloc, .Alloc_Non_Zeroed, .Free, .Resize, .Query_Features} + set^ = {.Alloc, .Alloc_Non_Zeroed, .Free, .Resize, .Resize_Non_Zeroed, .Query_Features} } return nil, nil diff --git a/core/os/os2/file_windows.odin b/core/os/os2/file_windows.odin index 600ecde21..7c31defe9 100644 --- a/core/os/os2/file_windows.odin +++ b/core/os/os2/file_windows.odin @@ -454,7 +454,7 @@ _remove :: proc(name: string) -> Error { if err != err1 { a := win32.GetFileAttributesW(p) - if a == ~u32(0) { + if a == win32.INVALID_FILE_ATTRIBUTES { err = _get_platform_error() } else { if a & win32.FILE_ATTRIBUTE_DIRECTORY != 0 { @@ -704,13 +704,13 @@ _fchtimes :: proc(f: ^File, atime, mtime: time.Time) -> Error { _exists :: proc(path: string) -> bool { wpath := _fix_long_path(path) attribs := win32.GetFileAttributesW(wpath) - return i32(attribs) != win32.INVALID_FILE_ATTRIBUTES + return attribs != win32.INVALID_FILE_ATTRIBUTES } _is_file :: proc(path: string) -> bool { wpath := _fix_long_path(path) attribs := win32.GetFileAttributesW(wpath) - if i32(attribs) != win32.INVALID_FILE_ATTRIBUTES { + if attribs != win32.INVALID_FILE_ATTRIBUTES { return attribs & win32.FILE_ATTRIBUTE_DIRECTORY == 0 } return false @@ -719,7 +719,7 @@ _is_file :: proc(path: string) -> bool { _is_dir :: proc(path: string) -> bool { wpath := _fix_long_path(path) attribs := win32.GetFileAttributesW(wpath) - if i32(attribs) != win32.INVALID_FILE_ATTRIBUTES { + if attribs != win32.INVALID_FILE_ATTRIBUTES { return attribs & win32.FILE_ATTRIBUTE_DIRECTORY != 0 } return false diff --git a/core/os/os2/heap_windows.odin b/core/os/os2/heap_windows.odin index eba403c1d..4afc016a0 100644 --- a/core/os/os2/heap_windows.odin +++ b/core/os/os2/heap_windows.odin @@ -85,7 +85,7 @@ _heap_allocator_proc :: proc(allocator_data: rawptr, mode: mem.Allocator_Mode, case .Free_All: return nil, .Mode_Not_Implemented - case .Resize: + case .Resize, .Resize_Non_Zeroed: if old_memory == nil { return aligned_alloc(size, alignment, true) } diff --git a/core/runtime/core.odin b/core/runtime/core.odin index 2d176f909..740482493 100644 --- a/core/runtime/core.odin +++ b/core/runtime/core.odin @@ -18,6 +18,7 @@ // This could change at a later date if the all these data structures are // implemented within the compiler rather than in this "preload" file // +//+no-instrumentation package runtime import "core:intrinsics" @@ -306,6 +307,7 @@ Allocator_Mode :: enum byte { Query_Features, Query_Info, Alloc_Non_Zeroed, + Resize_Non_Zeroed, } Allocator_Mode_Set :: distinct bit_set[Allocator_Mode] diff --git a/core/runtime/core_builtin.odin b/core/runtime/core_builtin.odin index c3c5fd5d0..3f4ebbc74 100644 --- a/core/runtime/core_builtin.odin +++ b/core/runtime/core_builtin.odin @@ -169,10 +169,16 @@ clear :: proc{clear_dynamic_array, clear_map} @builtin reserve :: proc{reserve_dynamic_array, reserve_map} -// `resize` will try to resize memory of a passed dynamic array or map to the requested element count (setting the `len`, and possibly `cap`). +@builtin +non_zero_reserve :: proc{non_zero_reserve_dynamic_array} + +// `resize` will try to resize memory of a passed dynamic array to the requested element count (setting the `len`, and possibly `cap`). @builtin resize :: proc{resize_dynamic_array} +@builtin +non_zero_resize :: proc{non_zero_resize_dynamic_array} + // Shrinks the capacity of a dynamic array or map down to the current length, or the given capacity. @builtin shrink :: proc{shrink_dynamic_array, shrink_map} @@ -406,10 +412,7 @@ delete_key :: proc(m: ^$T/map[$K]$V, key: K) -> (deleted_key: K, deleted_value: return } - - -@builtin -append_elem :: proc(array: ^$T/[dynamic]$E, arg: E, loc := #caller_location) -> (n: int, err: Allocator_Error) #optional_allocator_error { +_append_elem :: #force_inline proc(array: ^$T/[dynamic]$E, arg: E, should_zero: bool, loc := #caller_location) -> (n: int, err: Allocator_Error) #optional_allocator_error { if array == nil { return 0, nil } @@ -420,7 +423,13 @@ append_elem :: proc(array: ^$T/[dynamic]$E, arg: E, loc := #caller_location) -> } else { if cap(array) < len(array)+1 { cap := 2 * cap(array) + max(8, 1) - err = reserve(array, cap, loc) // do not 'or_return' here as it could be a partial success + + // do not 'or_return' here as it could be a partial success + if should_zero { + err = reserve(array, cap, loc) + } else { + err = non_zero_reserve(array, cap, loc) + } } if cap(array)-len(array) > 0 { a := (^Raw_Dynamic_Array)(array) @@ -437,7 +446,16 @@ append_elem :: proc(array: ^$T/[dynamic]$E, arg: E, loc := #caller_location) -> } @builtin -append_elems :: proc(array: ^$T/[dynamic]$E, args: ..E, loc := #caller_location) -> (n: int, err: Allocator_Error) #optional_allocator_error { +append_elem :: proc(array: ^$T/[dynamic]$E, arg: E, loc := #caller_location) -> (n: int, err: Allocator_Error) #optional_allocator_error { + return _append_elem(array, arg, true, loc=loc) +} + +@builtin +non_zero_append_elem :: proc(array: ^$T/[dynamic]$E, arg: E, loc := #caller_location) -> (n: int, err: Allocator_Error) #optional_allocator_error { + return _append_elem(array, arg, false, loc=loc) +} + +_append_elems :: #force_inline proc(array: ^$T/[dynamic]$E, should_zero: bool, loc := #caller_location, args: ..E) -> (n: int, err: Allocator_Error) #optional_allocator_error { if array == nil { return 0, nil } @@ -454,7 +472,13 @@ append_elems :: proc(array: ^$T/[dynamic]$E, args: ..E, loc := #caller_location) } else { if cap(array) < len(array)+arg_len { cap := 2 * cap(array) + max(8, arg_len) - err = reserve(array, cap, loc) // do not 'or_return' here as it could be a partial success + + // do not 'or_return' here as it could be a partial success + if should_zero { + err = reserve(array, cap, loc) + } else { + err = non_zero_reserve(array, cap, loc) + } } arg_len = min(cap(array)-len(array), arg_len) if arg_len > 0 { @@ -470,11 +494,33 @@ append_elems :: proc(array: ^$T/[dynamic]$E, args: ..E, loc := #caller_location) } } +@builtin +append_elems :: proc(array: ^$T/[dynamic]$E, args: ..E, loc := #caller_location) -> (n: int, err: Allocator_Error) #optional_allocator_error { + return _append_elems(array, true, loc, ..args) +} + +@builtin +non_zero_append_elems :: proc(array: ^$T/[dynamic]$E, args: ..E, loc := #caller_location) -> (n: int, err: Allocator_Error) #optional_allocator_error { + return _append_elems(array, false, loc, ..args) +} + // The append_string built-in procedure appends a string to the end of a [dynamic]u8 like type +_append_elem_string :: proc(array: ^$T/[dynamic]$E/u8, arg: $A/string, should_zero: bool, loc := #caller_location) -> (n: int, err: Allocator_Error) #optional_allocator_error { + args := transmute([]E)arg + if should_zero { + return append_elems(array, ..args, loc=loc) + } else { + return non_zero_append_elems(array, ..args, loc=loc) + } +} + @builtin append_elem_string :: proc(array: ^$T/[dynamic]$E/u8, arg: $A/string, loc := #caller_location) -> (n: int, err: Allocator_Error) #optional_allocator_error { - args := transmute([]E)arg - return append_elems(array, ..args, loc=loc) + return _append_elem_string(array, arg, true, loc) +} +@builtin +non_zero_append_elem_string :: proc(array: ^$T/[dynamic]$E/u8, arg: $A/string, loc := #caller_location) -> (n: int, err: Allocator_Error) #optional_allocator_error { + return _append_elem_string(array, arg, false, loc) } @@ -494,6 +540,7 @@ append_string :: proc(array: ^$T/[dynamic]$E/u8, args: ..string, loc := #caller_ // The append built-in procedure appends elements to the end of a dynamic array @builtin append :: proc{append_elem, append_elems, append_elem_string} +@builtin non_zero_append :: proc{non_zero_append_elem, non_zero_append_elems, non_zero_append_elem_string} @builtin @@ -638,8 +685,7 @@ clear_dynamic_array :: proc "contextless" (array: ^$T/[dynamic]$E) { // `reserve_dynamic_array` will try to reserve memory of a passed dynamic array or map to the requested element count (setting the `cap`). // // Note: Prefer the procedure group `reserve`. -@builtin -reserve_dynamic_array :: proc(array: ^$T/[dynamic]$E, capacity: int, loc := #caller_location) -> Allocator_Error { +_reserve_dynamic_array :: #force_inline proc(array: ^$T/[dynamic]$E, capacity: int, should_zero: bool, loc := #caller_location) -> Allocator_Error { if array == nil { return nil } @@ -658,7 +704,12 @@ reserve_dynamic_array :: proc(array: ^$T/[dynamic]$E, capacity: int, loc := #cal new_size := capacity * size_of(E) allocator := a.allocator - new_data := mem_resize(a.data, old_size, new_size, align_of(E), allocator, loc) or_return + new_data: []byte + if should_zero { + new_data = mem_resize(a.data, old_size, new_size, align_of(E), allocator, loc) or_return + } else { + new_data = non_zero_mem_resize(a.data, old_size, new_size, align_of(E), allocator, loc) or_return + } if new_data == nil && new_size > 0 { return .Out_Of_Memory } @@ -668,11 +719,20 @@ reserve_dynamic_array :: proc(array: ^$T/[dynamic]$E, capacity: int, loc := #cal return nil } +@builtin +reserve_dynamic_array :: proc(array: ^$T/[dynamic]$E, capacity: int, loc := #caller_location) -> Allocator_Error { + return _reserve_dynamic_array(array, capacity, true, loc) +} + +@builtin +non_zero_reserve_dynamic_array :: proc(array: ^$T/[dynamic]$E, capacity: int, loc := #caller_location) -> Allocator_Error { + return _reserve_dynamic_array(array, capacity, false, loc) +} + // `resize_dynamic_array` will try to resize memory of a passed dynamic array or map to the requested element count (setting the `len`, and possibly `cap`). // // Note: Prefer the procedure group `resize` -@builtin -resize_dynamic_array :: proc(array: ^$T/[dynamic]$E, length: int, loc := #caller_location) -> Allocator_Error { +_resize_dynamic_array :: #force_inline proc(array: ^$T/[dynamic]$E, length: int, should_zero: bool, loc := #caller_location) -> Allocator_Error { if array == nil { return nil } @@ -692,7 +752,12 @@ resize_dynamic_array :: proc(array: ^$T/[dynamic]$E, length: int, loc := #caller new_size := length * size_of(E) allocator := a.allocator - new_data := mem_resize(a.data, old_size, new_size, align_of(E), allocator, loc) or_return + new_data : []byte + if should_zero { + new_data = mem_resize(a.data, old_size, new_size, align_of(E), allocator, loc) or_return + } else { + new_data = non_zero_mem_resize(a.data, old_size, new_size, align_of(E), allocator, loc) or_return + } if new_data == nil && new_size > 0 { return .Out_Of_Memory } @@ -703,6 +768,16 @@ resize_dynamic_array :: proc(array: ^$T/[dynamic]$E, length: int, loc := #caller return nil } +@builtin +resize_dynamic_array :: proc(array: ^$T/[dynamic]$E, length: int, loc := #caller_location) -> Allocator_Error { + return _resize_dynamic_array(array, length, true, loc=loc) +} + +@builtin +non_zero_resize_dynamic_array :: proc(array: ^$T/[dynamic]$E, length: int, loc := #caller_location) -> Allocator_Error { + return _resize_dynamic_array(array, length, false, loc=loc) +} + /* Shrinks the capacity of a dynamic array down to the current length, or the given capacity. diff --git a/core/runtime/default_allocators_arena.odin b/core/runtime/default_allocators_arena.odin index 4506acb56..1fe3c6cfc 100644 --- a/core/runtime/default_allocators_arena.odin +++ b/core/runtime/default_allocators_arena.odin @@ -195,7 +195,7 @@ arena_allocator_proc :: proc(allocator_data: rawptr, mode: Allocator_Mode, err = .Mode_Not_Implemented case .Free_All: arena_free_all(arena, location) - case .Resize: + case .Resize, .Resize_Non_Zeroed: old_data := ([^]byte)(old_memory) switch { diff --git a/core/runtime/default_allocators_nil.odin b/core/runtime/default_allocators_nil.odin index eee6a7998..c882f5196 100644 --- a/core/runtime/default_allocators_nil.odin +++ b/core/runtime/default_allocators_nil.odin @@ -10,7 +10,7 @@ nil_allocator_proc :: proc(allocator_data: rawptr, mode: Allocator_Mode, return nil, .None case .Free_All: return nil, .Mode_Not_Implemented - case .Resize: + case .Resize, .Resize_Non_Zeroed: if size == 0 { return nil, .None } @@ -55,6 +55,10 @@ panic_allocator_proc :: proc(allocator_data: rawptr, mode: Allocator_Mode, if size > 0 { panic("panic allocator, .Resize called", loc=loc) } + case .Resize_Non_Zeroed: + if size > 0 { + panic("panic allocator, .Alloc_Non_Zeroed called", loc=loc) + } case .Free: if old_memory != nil { panic("panic allocator, .Free called", loc=loc) diff --git a/core/runtime/default_allocators_windows.odin b/core/runtime/default_allocators_windows.odin index a78a4d04e..1b0f78428 100644 --- a/core/runtime/default_allocators_windows.odin +++ b/core/runtime/default_allocators_windows.odin @@ -19,7 +19,7 @@ when ODIN_DEFAULT_TO_NIL_ALLOCATOR { case .Free_All: return nil, .Mode_Not_Implemented - case .Resize: + case .Resize, .Resize_Non_Zeroed: data, err = _windows_default_resize(old_memory, old_size, size, alignment) case .Query_Features: @@ -41,4 +41,4 @@ when ODIN_DEFAULT_TO_NIL_ALLOCATOR { data = nil, } } -} \ No newline at end of file +} diff --git a/core/runtime/entry_unix.odin b/core/runtime/entry_unix.odin index 78e545c22..f494a509e 100644 --- a/core/runtime/entry_unix.odin +++ b/core/runtime/entry_unix.odin @@ -1,5 +1,6 @@ //+private //+build linux, darwin, freebsd, openbsd +//+no-instrumentation package runtime import "core:intrinsics" diff --git a/core/runtime/entry_wasm.odin b/core/runtime/entry_wasm.odin index 235d5611b..e7f3f156f 100644 --- a/core/runtime/entry_wasm.odin +++ b/core/runtime/entry_wasm.odin @@ -1,5 +1,6 @@ //+private //+build wasm32, wasm64p32 +//+no-instrumentation package runtime import "core:intrinsics" diff --git a/core/runtime/entry_windows.odin b/core/runtime/entry_windows.odin index a315c1209..b6fbe1dcc 100644 --- a/core/runtime/entry_windows.odin +++ b/core/runtime/entry_windows.odin @@ -1,12 +1,13 @@ //+private //+build windows +//+no-instrumentation package runtime import "core:intrinsics" when ODIN_BUILD_MODE == .Dynamic { @(link_name="DllMain", linkage="strong", require) - DllMain :: proc "stdcall" (hinstDLL: rawptr, fdwReason: u32, lpReserved: rawptr) -> b32 { + DllMain :: proc "system" (hinstDLL: rawptr, fdwReason: u32, lpReserved: rawptr) -> b32 { context = default_context() // Populate Windows DLL-specific global @@ -28,7 +29,7 @@ when ODIN_BUILD_MODE == .Dynamic { } else when !ODIN_TEST && !ODIN_NO_ENTRY_POINT { when ODIN_ARCH == .i386 || ODIN_NO_CRT { @(link_name="mainCRTStartup", linkage="strong", require) - mainCRTStartup :: proc "stdcall" () -> i32 { + mainCRTStartup :: proc "system" () -> i32 { context = default_context() #force_no_inline _startup_runtime() intrinsics.__entry_point() diff --git a/core/runtime/error_checks.odin b/core/runtime/error_checks.odin index 9d484979a..ea6333c29 100644 --- a/core/runtime/error_checks.odin +++ b/core/runtime/error_checks.odin @@ -1,5 +1,6 @@ package runtime +@(no_instrumentation) bounds_trap :: proc "contextless" () -> ! { when ODIN_OS == .Windows { windows_trap_array_bounds() @@ -8,6 +9,7 @@ bounds_trap :: proc "contextless" () -> ! { } } +@(no_instrumentation) type_assertion_trap :: proc "contextless" () -> ! { when ODIN_OS == .Windows { windows_trap_type_assertion() @@ -21,7 +23,7 @@ bounds_check_error :: proc "contextless" (file: string, line, column: i32, index if uint(index) < uint(count) { return } - @(cold) + @(cold, no_instrumentation) handle_error :: proc "contextless" (file: string, line, column: i32, index, count: int) -> ! { print_caller_location(Source_Code_Location{file, line, column, ""}) print_string(" Index ") @@ -34,6 +36,7 @@ bounds_check_error :: proc "contextless" (file: string, line, column: i32, index handle_error(file, line, column, index, count) } +@(no_instrumentation) slice_handle_error :: proc "contextless" (file: string, line, column: i32, lo, hi: int, len: int) -> ! { print_caller_location(Source_Code_Location{file, line, column, ""}) print_string(" Invalid slice indices ") @@ -46,6 +49,7 @@ slice_handle_error :: proc "contextless" (file: string, line, column: i32, lo, h bounds_trap() } +@(no_instrumentation) multi_pointer_slice_handle_error :: proc "contextless" (file: string, line, column: i32, lo, hi: int) -> ! { print_caller_location(Source_Code_Location{file, line, column, ""}) print_string(" Invalid slice indices ") @@ -82,7 +86,7 @@ dynamic_array_expr_error :: proc "contextless" (file: string, line, column: i32, if 0 <= low && low <= high && high <= max { return } - @(cold) + @(cold, no_instrumentation) handle_error :: proc "contextless" (file: string, line, column: i32, low, high, max: int) -> ! { print_caller_location(Source_Code_Location{file, line, column, ""}) print_string(" Invalid dynamic array indices ") @@ -103,7 +107,7 @@ matrix_bounds_check_error :: proc "contextless" (file: string, line, column: i32 uint(column_index) < uint(column_count) { return } - @(cold) + @(cold, no_instrumentation) handle_error :: proc "contextless" (file: string, line, column: i32, row_index, column_index, row_count, column_count: int) -> ! { print_caller_location(Source_Code_Location{file, line, column, ""}) print_string(" Matrix indices [") @@ -127,7 +131,7 @@ when ODIN_NO_RTTI { if ok { return } - @(cold) + @(cold, no_instrumentation) handle_error :: proc "contextless" (file: string, line, column: i32) -> ! { print_caller_location(Source_Code_Location{file, line, column, ""}) print_string(" Invalid type assertion\n") @@ -140,7 +144,7 @@ when ODIN_NO_RTTI { if ok { return } - @(cold) + @(cold, no_instrumentation) handle_error :: proc "contextless" (file: string, line, column: i32) -> ! { print_caller_location(Source_Code_Location{file, line, column, ""}) print_string(" Invalid type assertion\n") @@ -153,7 +157,7 @@ when ODIN_NO_RTTI { if ok { return } - @(cold) + @(cold, no_instrumentation) handle_error :: proc "contextless" (file: string, line, column: i32, from, to: typeid) -> ! { print_caller_location(Source_Code_Location{file, line, column, ""}) print_string(" Invalid type assertion from ") @@ -198,7 +202,7 @@ when ODIN_NO_RTTI { return id } - @(cold) + @(cold, no_instrumentation) handle_error :: proc "contextless" (file: string, line, column: i32, from, to: typeid, from_data: rawptr) -> ! { actual := variant_type(from, from_data) @@ -224,7 +228,7 @@ make_slice_error_loc :: #force_inline proc "contextless" (loc := #caller_locatio if 0 <= len { return } - @(cold) + @(cold, no_instrumentation) handle_error :: proc "contextless" (loc: Source_Code_Location, len: int) -> ! { print_caller_location(loc) print_string(" Invalid slice length for make: ") @@ -239,7 +243,7 @@ make_dynamic_array_error_loc :: #force_inline proc "contextless" (loc := #caller if 0 <= len && len <= cap { return } - @(cold) + @(cold, no_instrumentation) handle_error :: proc "contextless" (loc: Source_Code_Location, len, cap: int) -> ! { print_caller_location(loc) print_string(" Invalid dynamic array parameters for make: ") @@ -256,7 +260,7 @@ make_map_expr_error_loc :: #force_inline proc "contextless" (loc := #caller_loca if 0 <= cap { return } - @(cold) + @(cold, no_instrumentation) handle_error :: proc "contextless" (loc: Source_Code_Location, cap: int) -> ! { print_caller_location(loc) print_string(" Invalid map capacity for make: ") diff --git a/core/runtime/internal.odin b/core/runtime/internal.odin index d0e550743..d4c43ed7e 100644 --- a/core/runtime/internal.odin +++ b/core/runtime/internal.odin @@ -187,7 +187,7 @@ mem_free_all :: #force_inline proc(allocator := context.allocator, loc := #calle return } -mem_resize :: proc(ptr: rawptr, old_size, new_size: int, alignment: int = DEFAULT_ALIGNMENT, allocator := context.allocator, loc := #caller_location) -> (data: []byte, err: Allocator_Error) { +_mem_resize :: #force_inline proc(ptr: rawptr, old_size, new_size: int, alignment: int = DEFAULT_ALIGNMENT, allocator := context.allocator, should_zero: bool, loc := #caller_location) -> (data: []byte, err: Allocator_Error) { if allocator.procedure == nil { return nil, nil } @@ -198,15 +198,27 @@ mem_resize :: proc(ptr: rawptr, old_size, new_size: int, alignment: int = DEFAUL } return } else if ptr == nil { - return allocator.procedure(allocator.data, .Alloc, new_size, alignment, nil, 0, loc) + if should_zero { + return allocator.procedure(allocator.data, .Alloc, new_size, alignment, nil, 0, loc) + } else { + return allocator.procedure(allocator.data, .Alloc_Non_Zeroed, new_size, alignment, nil, 0, loc) + } } else if old_size == new_size && uintptr(ptr) % uintptr(alignment) == 0 { data = ([^]byte)(ptr)[:old_size] return } - data, err = allocator.procedure(allocator.data, .Resize, new_size, alignment, ptr, old_size, loc) + if should_zero { + data, err = allocator.procedure(allocator.data, .Resize, new_size, alignment, ptr, old_size, loc) + } else { + data, err = allocator.procedure(allocator.data, .Resize_Non_Zeroed, new_size, alignment, ptr, old_size, loc) + } if err == .Mode_Not_Implemented { - data, err = allocator.procedure(allocator.data, .Alloc, new_size, alignment, nil, 0, loc) + if should_zero { + data, err = allocator.procedure(allocator.data, .Alloc, new_size, alignment, nil, 0, loc) + } else { + data, err = allocator.procedure(allocator.data, .Alloc_Non_Zeroed, new_size, alignment, nil, 0, loc) + } if err != nil { return } @@ -216,6 +228,13 @@ mem_resize :: proc(ptr: rawptr, old_size, new_size: int, alignment: int = DEFAUL return } +mem_resize :: proc(ptr: rawptr, old_size, new_size: int, alignment: int = DEFAULT_ALIGNMENT, allocator := context.allocator, loc := #caller_location) -> (data: []byte, err: Allocator_Error) { + return _mem_resize(ptr, old_size, new_size, alignment, allocator, true, loc) +} +non_zero_mem_resize :: proc(ptr: rawptr, old_size, new_size: int, alignment: int = DEFAULT_ALIGNMENT, allocator := context.allocator, loc := #caller_location) -> (data: []byte, err: Allocator_Error) { + return _mem_resize(ptr, old_size, new_size, alignment, allocator, false, loc) +} + memory_equal :: proc "contextless" (x, y: rawptr, n: int) -> bool { switch { case n == 0: return true @@ -730,7 +749,7 @@ mul_quaternion64 :: proc "contextless" (q, r: quaternion64) -> quaternion64 { t2 := r0*q2 + r1*q3 + r2*q0 - r3*q1 t3 := r0*q3 - r1*q2 + r2*q1 + r3*q0 - return quaternion(t0, t1, t2, t3) + return quaternion(w=t0, x=t1, y=t2, z=t3) } mul_quaternion128 :: proc "contextless" (q, r: quaternion128) -> quaternion128 { @@ -742,7 +761,7 @@ mul_quaternion128 :: proc "contextless" (q, r: quaternion128) -> quaternion128 { t2 := r0*q2 + r1*q3 + r2*q0 - r3*q1 t3 := r0*q3 - r1*q2 + r2*q1 + r3*q0 - return quaternion(t0, t1, t2, t3) + return quaternion(w=t0, x=t1, y=t2, z=t3) } mul_quaternion256 :: proc "contextless" (q, r: quaternion256) -> quaternion256 { @@ -754,7 +773,7 @@ mul_quaternion256 :: proc "contextless" (q, r: quaternion256) -> quaternion256 { t2 := r0*q2 + r1*q3 + r2*q0 - r3*q1 t3 := r0*q3 - r1*q2 + r2*q1 + r3*q0 - return quaternion(t0, t1, t2, t3) + return quaternion(w=t0, x=t1, y=t2, z=t3) } quo_quaternion64 :: proc "contextless" (q, r: quaternion64) -> quaternion64 { @@ -768,7 +787,7 @@ quo_quaternion64 :: proc "contextless" (q, r: quaternion64) -> quaternion64 { t2 := (r0*q2 - r1*q3 - r2*q0 + r3*q1) * invmag2 t3 := (r0*q3 + r1*q2 + r2*q1 - r3*q0) * invmag2 - return quaternion(t0, t1, t2, t3) + return quaternion(w=t0, x=t1, y=t2, z=t3) } quo_quaternion128 :: proc "contextless" (q, r: quaternion128) -> quaternion128 { @@ -782,7 +801,7 @@ quo_quaternion128 :: proc "contextless" (q, r: quaternion128) -> quaternion128 { t2 := (r0*q2 - r1*q3 - r2*q0 + r3*q1) * invmag2 t3 := (r0*q3 + r1*q2 + r2*q1 - r3*q0) * invmag2 - return quaternion(t0, t1, t2, t3) + return quaternion(w=t0, x=t1, y=t2, z=t3) } quo_quaternion256 :: proc "contextless" (q, r: quaternion256) -> quaternion256 { @@ -796,7 +815,7 @@ quo_quaternion256 :: proc "contextless" (q, r: quaternion256) -> quaternion256 { t2 := (r0*q2 - r1*q3 - r2*q0 + r3*q1) * invmag2 t3 := (r0*q3 + r1*q2 + r2*q1 - r3*q0) * invmag2 - return quaternion(t0, t1, t2, t3) + return quaternion(w=t0, x=t1, y=t2, z=t3) } @(link_name="__truncsfhf2", linkage=RUNTIME_LINKAGE, require=RUNTIME_REQUIRE) diff --git a/core/runtime/os_specific_windows.odin b/core/runtime/os_specific_windows.odin index 9f001fa5a..4a5907466 100644 --- a/core/runtime/os_specific_windows.odin +++ b/core/runtime/os_specific_windows.odin @@ -4,7 +4,7 @@ package runtime foreign import kernel32 "system:Kernel32.lib" @(private="file") -@(default_calling_convention="stdcall") +@(default_calling_convention="system") foreign kernel32 { // NOTE(bill): The types are not using the standard names (e.g. DWORD and LPVOID) to just minimizing the dependency diff --git a/core/runtime/procs.odin b/core/runtime/procs.odin index 1b8a54c6d..454574c35 100644 --- a/core/runtime/procs.odin +++ b/core/runtime/procs.odin @@ -4,7 +4,7 @@ when ODIN_NO_CRT && ODIN_OS == .Windows { foreign import lib "system:NtDll.lib" @(private="file") - @(default_calling_convention="stdcall") + @(default_calling_convention="system") foreign lib { RtlMoveMemory :: proc(dst, s: rawptr, length: int) --- RtlFillMemory :: proc(dst: rawptr, length: int, fill: i32) --- diff --git a/core/runtime/procs_windows_amd64.odin b/core/runtime/procs_windows_amd64.odin index e430357be..ea495f5fa 100644 --- a/core/runtime/procs_windows_amd64.odin +++ b/core/runtime/procs_windows_amd64.odin @@ -1,11 +1,12 @@ //+private +//+no-instrumentation package runtime foreign import kernel32 "system:Kernel32.lib" @(private) foreign kernel32 { - RaiseException :: proc "stdcall" (dwExceptionCode, dwExceptionFlags, nNumberOfArguments: u32, lpArguments: ^uint) -> ! --- + RaiseException :: proc "system" (dwExceptionCode, dwExceptionFlags, nNumberOfArguments: u32, lpArguments: ^uint) -> ! --- } windows_trap_array_bounds :: proc "contextless" () -> ! { diff --git a/core/runtime/procs_windows_i386.odin b/core/runtime/procs_windows_i386.odin index f810197f1..10422cf07 100644 --- a/core/runtime/procs_windows_i386.odin +++ b/core/runtime/procs_windows_i386.odin @@ -1,4 +1,5 @@ //+private +//+no-instrumentation package runtime @require foreign import "system:int64.lib" @@ -12,7 +13,7 @@ windows_trap_array_bounds :: proc "contextless" () -> ! { EXCEPTION_ARRAY_BOUNDS_EXCEEDED :: 0xC000008C foreign kernel32 { - RaiseException :: proc "stdcall" (dwExceptionCode, dwExceptionFlags, nNumberOfArguments: DWORD, lpArguments: ^ULONG_PTR) -> ! --- + RaiseException :: proc "system" (dwExceptionCode, dwExceptionFlags, nNumberOfArguments: DWORD, lpArguments: ^ULONG_PTR) -> ! --- } RaiseException(EXCEPTION_ARRAY_BOUNDS_EXCEEDED, 0, 0, nil) diff --git a/core/simd/x86/adx.odin b/core/simd/x86/adx.odin index d03cffcff..5750ae627 100644 --- a/core/simd/x86/adx.odin +++ b/core/simd/x86/adx.odin @@ -37,7 +37,7 @@ when ODIN_ARCH == .amd64 { } } -@(private, default_calling_convention="c") +@(private, default_calling_convention="none") foreign _ { @(link_name="llvm.x86.addcarry.32") llvm_addcarry_u32 :: proc(a: u8, b: u32, c: u32) -> (u8, u32) --- diff --git a/core/simd/x86/fxsr.odin b/core/simd/x86/fxsr.odin index cd78de7d4..a9213fed2 100644 --- a/core/simd/x86/fxsr.odin +++ b/core/simd/x86/fxsr.odin @@ -21,7 +21,7 @@ when ODIN_ARCH == .amd64 { } } -@(private, default_calling_convention="c") +@(private, default_calling_convention="none") foreign _ { @(link_name="llvm.x86.fxsave") fxsave :: proc(p: rawptr) --- diff --git a/core/simd/x86/pclmulqdq.odin b/core/simd/x86/pclmulqdq.odin index 692fb7ce1..e827bf6b9 100644 --- a/core/simd/x86/pclmulqdq.odin +++ b/core/simd/x86/pclmulqdq.odin @@ -1,12 +1,12 @@ //+build i386, amd64 package simd_x86 -@(require_results, enable_target_feature="pclmulqdq") +@(require_results, enable_target_feature="pclmul") _mm_clmulepi64_si128 :: #force_inline proc "c" (a, b: __m128i, $IMM8: u8) -> __m128i { return pclmulqdq(a, b, u8(IMM8)) } -@(private, default_calling_convention="c") +@(private, default_calling_convention="none") foreign _ { @(link_name="llvm.x86.pclmulqdq") pclmulqdq :: proc(a, round_key: __m128i, #const imm8: u8) -> __m128i --- diff --git a/core/simd/x86/rdtsc.odin b/core/simd/x86/rdtsc.odin index 54024c3f2..8a8b13c4b 100644 --- a/core/simd/x86/rdtsc.odin +++ b/core/simd/x86/rdtsc.odin @@ -11,7 +11,7 @@ __rdtscp :: #force_inline proc "c" (aux: ^u32) -> u64 { return rdtscp(aux) } -@(private, default_calling_convention="c") +@(private, default_calling_convention="none") foreign _ { @(link_name="llvm.x86.rdtsc") rdtsc :: proc() -> u64 --- diff --git a/core/simd/x86/sha.odin b/core/simd/x86/sha.odin index f015f4b8a..bc58e8504 100644 --- a/core/simd/x86/sha.odin +++ b/core/simd/x86/sha.odin @@ -30,7 +30,7 @@ _mm_sha256rnds2_epu32 :: #force_inline proc "c" (a, b, k: __m128i) -> __m128i { return transmute(__m128i)sha256rnds2(transmute(i32x4)a, transmute(i32x4)b, transmute(i32x4)k) } -@(private, default_calling_convention="c") +@(private, default_calling_convention="none") foreign _ { @(link_name="llvm.x86.sha1msg1") sha1msg1 :: proc(a, b: i32x4) -> i32x4 --- diff --git a/core/simd/x86/sse.odin b/core/simd/x86/sse.odin index 2b70e954f..903a43dfd 100644 --- a/core/simd/x86/sse.odin +++ b/core/simd/x86/sse.odin @@ -532,7 +532,7 @@ when ODIN_ARCH == .amd64 { } -@(private, default_calling_convention="c") +@(private, default_calling_convention="none") foreign _ { @(link_name="llvm.x86.sse.add.ss") addss :: proc(a, b: __m128) -> __m128 --- diff --git a/core/simd/x86/sse2.odin b/core/simd/x86/sse2.odin index dd292712f..a597122f1 100644 --- a/core/simd/x86/sse2.odin +++ b/core/simd/x86/sse2.odin @@ -1040,7 +1040,7 @@ when ODIN_ARCH == .amd64 { } -@(private, default_calling_convention="c") +@(private, default_calling_convention="none") foreign _ { @(link_name="llvm.x86.sse2.pause") pause :: proc() --- diff --git a/core/simd/x86/sse3.odin b/core/simd/x86/sse3.odin index 7a3073c18..cf5f3b2fa 100644 --- a/core/simd/x86/sse3.odin +++ b/core/simd/x86/sse3.odin @@ -49,7 +49,7 @@ _mm_moveldup_ps :: #force_inline proc "c" (a: __m128) -> __m128 { return simd.shuffle(a, a, 0, 0, 2, 2) } -@(private, default_calling_convention="c") +@(private, default_calling_convention="none") foreign _ { @(link_name = "llvm.x86.sse3.addsub.ps") addsubps :: proc(a, b: __m128) -> __m128 --- diff --git a/core/simd/x86/sse41.odin b/core/simd/x86/sse41.odin index b35be33f2..8c306ba4c 100644 --- a/core/simd/x86/sse41.odin +++ b/core/simd/x86/sse41.odin @@ -291,7 +291,7 @@ when ODIN_ARCH == .amd64 { } -@(private, default_calling_convention="c") +@(private, default_calling_convention="none") foreign _ { @(link_name = "llvm.x86.sse41.pblendvb") pblendvb :: proc(a, b: i8x16, mask: i8x16) -> i8x16 --- diff --git a/core/simd/x86/sse42.odin b/core/simd/x86/sse42.odin index 62b4f0478..621346342 100644 --- a/core/simd/x86/sse42.odin +++ b/core/simd/x86/sse42.odin @@ -104,7 +104,7 @@ when ODIN_ARCH == .amd64 { } } -@(private, default_calling_convention="c") +@(private, default_calling_convention="none") foreign _ { // SSE 4.2 string and text comparison ops @(link_name="llvm.x86.sse42.pcmpestrm128") diff --git a/core/simd/x86/ssse3.odin b/core/simd/x86/ssse3.odin index f11ef6774..0264a1c93 100644 --- a/core/simd/x86/ssse3.odin +++ b/core/simd/x86/ssse3.odin @@ -105,7 +105,7 @@ _mm_sign_epi32 :: #force_inline proc "c" (a, b: __m128i) -> __m128i { -@(private, default_calling_convention="c") +@(private, default_calling_convention="none") foreign _ { @(link_name = "llvm.x86.ssse3.pabs.b.128") pabsb128 :: proc(a: i8x16) -> u8x16 --- diff --git a/core/slice/sort.odin b/core/slice/sort.odin index 515eddcc3..3b4119afa 100644 --- a/core/slice/sort.odin +++ b/core/slice/sort.odin @@ -62,7 +62,7 @@ _sort_by_indices :: proc(data, sorted: $T/[]$E, indices: []int) { sort_by_indices_overwrite :: proc(data: $T/[]$E, indices: []int) { assert(len(data) == len(indices)) - temp := make([]int, len(data), context.allocator) + temp := make([]E, len(data), context.allocator) defer delete(temp) for v, i in indices { temp[i] = data[v] diff --git a/core/strings/strings.odin b/core/strings/strings.odin index 539829a1a..5cee25a66 100644 --- a/core/strings/strings.odin +++ b/core/strings/strings.odin @@ -1792,7 +1792,8 @@ last_index_any :: proc(s, chars: string) -> (res: int) { if r >= utf8.RUNE_SELF { r = utf8.RUNE_ERROR } - return index_rune(chars, r) + i := index_rune(chars, r) + return i if i < 0 else 0 } if len(s) > 8 { diff --git a/core/sync/futex_windows.odin b/core/sync/futex_windows.odin index 8ddbef3ed..6a26baf5b 100644 --- a/core/sync/futex_windows.odin +++ b/core/sync/futex_windows.odin @@ -5,14 +5,14 @@ package sync import "core:time" foreign import Synchronization "system:Synchronization.lib" -@(default_calling_convention="stdcall") +@(default_calling_convention="system") foreign Synchronization { WakeByAddressSingle :: proc(Address: rawptr) --- WakeByAddressAll :: proc(Address: rawptr) --- } foreign import Ntdll "system:Ntdll.lib" -@(default_calling_convention="stdcall") +@(default_calling_convention="system") foreign Ntdll { RtlWaitOnAddress :: proc(Address: rawptr, CompareAddress: rawptr, AddressSize: uint, Timeout: ^i64) -> i32 --- RtlNtStatusToDosError :: proc(status: i32) -> u32 --- @@ -30,7 +30,7 @@ foreign Ntdll { GODDAMN MICROSOFT! */ -CustomWaitOnAddress :: proc "stdcall" (Address: rawptr, CompareAddress: rawptr, AddressSize: uint, Timeout: ^i64) -> bool { +CustomWaitOnAddress :: proc "system" (Address: rawptr, CompareAddress: rawptr, AddressSize: uint, Timeout: ^i64) -> bool { status := RtlWaitOnAddress(Address, CompareAddress, AddressSize, Timeout) if status != 0 { SetLastError(RtlNtStatusToDosError(status)) diff --git a/core/sys/info/cpu_intel.odin b/core/sys/info/cpu_intel.odin index 5a11863d4..1344c3d2a 100644 --- a/core/sys/info/cpu_intel.odin +++ b/core/sys/info/cpu_intel.odin @@ -37,11 +37,11 @@ cpu_name: Maybe(string) @(init, private) init_cpu_features :: proc "c" () { - is_set :: #force_inline proc "c" (hwc: u32, value: u32) -> bool { - return hwc&(1 << value) != 0 + is_set :: #force_inline proc "c" (bit: u32, value: u32) -> bool { + return (value>>bit) & 0x1 != 0 } - try_set :: #force_inline proc "c" (set: ^CPU_Features, feature: CPU_Feature, hwc: u32, value: u32) { - if is_set(hwc, value) { + try_set :: #force_inline proc "c" (set: ^CPU_Features, feature: CPU_Feature, bit: u32, value: u32) { + if is_set(bit, value) { set^ += {feature} } } diff --git a/core/sys/info/platform_darwin.odin b/core/sys/info/platform_darwin.odin index 7a56f1e23..4ca542b7a 100644 --- a/core/sys/info/platform_darwin.odin +++ b/core/sys/info/platform_darwin.odin @@ -138,338 +138,388 @@ Darwin_To_Release :: struct { @(private) macos_release_map: map[string]Darwin_To_Release = { // MacOS Tiger - "8A428" = {{8, 0, 0}, "macOS", {"Tiger", {10, 4, 0}}}, - "8A432" = {{8, 0, 0}, "macOS", {"Tiger", {10, 4, 0}}}, - "8B15" = {{8, 1, 0}, "macOS", {"Tiger", {10, 4, 1}}}, - "8B17" = {{8, 1, 0}, "macOS", {"Tiger", {10, 4, 1}}}, - "8C46" = {{8, 2, 0}, "macOS", {"Tiger", {10, 4, 2}}}, - "8C47" = {{8, 2, 0}, "macOS", {"Tiger", {10, 4, 2}}}, - "8E102" = {{8, 2, 0}, "macOS", {"Tiger", {10, 4, 2}}}, - "8E45" = {{8, 2, 0}, "macOS", {"Tiger", {10, 4, 2}}}, - "8E90" = {{8, 2, 0}, "macOS", {"Tiger", {10, 4, 2}}}, - "8F46" = {{8, 3, 0}, "macOS", {"Tiger", {10, 4, 3}}}, - "8G32" = {{8, 4, 0}, "macOS", {"Tiger", {10, 4, 4}}}, - "8G1165" = {{8, 4, 0}, "macOS", {"Tiger", {10, 4, 4}}}, - "8H14" = {{8, 5, 0}, "macOS", {"Tiger", {10, 4, 5}}}, - "8G1454" = {{8, 5, 0}, "macOS", {"Tiger", {10, 4, 5}}}, - "8I127" = {{8, 6, 0}, "macOS", {"Tiger", {10, 4, 6}}}, - "8I1119" = {{8, 6, 0}, "macOS", {"Tiger", {10, 4, 6}}}, - "8J135" = {{8, 7, 0}, "macOS", {"Tiger", {10, 4, 7}}}, - "8J2135a" = {{8, 7, 0}, "macOS", {"Tiger", {10, 4, 7}}}, - "8K1079" = {{8, 7, 0}, "macOS", {"Tiger", {10, 4, 7}}}, - "8N5107" = {{8, 7, 0}, "macOS", {"Tiger", {10, 4, 7}}}, - "8L127" = {{8, 8, 0}, "macOS", {"Tiger", {10, 4, 8}}}, - "8L2127" = {{8, 8, 0}, "macOS", {"Tiger", {10, 4, 8}}}, - "8P135" = {{8, 9, 0}, "macOS", {"Tiger", {10, 4, 9}}}, - "8P2137" = {{8, 9, 0}, "macOS", {"Tiger", {10, 4, 9}}}, - "8R218" = {{8, 10, 0}, "macOS", {"Tiger", {10, 4, 10}}}, - "8R2218" = {{8, 10, 0}, "macOS", {"Tiger", {10, 4, 10}}}, - "8R2232" = {{8, 10, 0}, "macOS", {"Tiger", {10, 4, 10}}}, - "8S165" = {{8, 11, 0}, "macOS", {"Tiger", {10, 4, 11}}}, - "8S2167" = {{8, 11, 0}, "macOS", {"Tiger", {10, 4, 11}}}, + "8A428" = {{8, 0, 0}, "macOS", {"Tiger", {10, 4, 0}}}, + "8A432" = {{8, 0, 0}, "macOS", {"Tiger", {10, 4, 0}}}, + "8B15" = {{8, 1, 0}, "macOS", {"Tiger", {10, 4, 1}}}, + "8B17" = {{8, 1, 0}, "macOS", {"Tiger", {10, 4, 1}}}, + "8C46" = {{8, 2, 0}, "macOS", {"Tiger", {10, 4, 2}}}, + "8C47" = {{8, 2, 0}, "macOS", {"Tiger", {10, 4, 2}}}, + "8E102" = {{8, 2, 0}, "macOS", {"Tiger", {10, 4, 2}}}, + "8E45" = {{8, 2, 0}, "macOS", {"Tiger", {10, 4, 2}}}, + "8E90" = {{8, 2, 0}, "macOS", {"Tiger", {10, 4, 2}}}, + "8F46" = {{8, 3, 0}, "macOS", {"Tiger", {10, 4, 3}}}, + "8G32" = {{8, 4, 0}, "macOS", {"Tiger", {10, 4, 4}}}, + "8G1165" = {{8, 4, 0}, "macOS", {"Tiger", {10, 4, 4}}}, + "8H14" = {{8, 5, 0}, "macOS", {"Tiger", {10, 4, 5}}}, + "8G1454" = {{8, 5, 0}, "macOS", {"Tiger", {10, 4, 5}}}, + "8I127" = {{8, 6, 0}, "macOS", {"Tiger", {10, 4, 6}}}, + "8I1119" = {{8, 6, 0}, "macOS", {"Tiger", {10, 4, 6}}}, + "8J135" = {{8, 7, 0}, "macOS", {"Tiger", {10, 4, 7}}}, + "8J2135a" = {{8, 7, 0}, "macOS", {"Tiger", {10, 4, 7}}}, + "8K1079" = {{8, 7, 0}, "macOS", {"Tiger", {10, 4, 7}}}, + "8N5107" = {{8, 7, 0}, "macOS", {"Tiger", {10, 4, 7}}}, + "8L127" = {{8, 8, 0}, "macOS", {"Tiger", {10, 4, 8}}}, + "8L2127" = {{8, 8, 0}, "macOS", {"Tiger", {10, 4, 8}}}, + "8P135" = {{8, 9, 0}, "macOS", {"Tiger", {10, 4, 9}}}, + "8P2137" = {{8, 9, 0}, "macOS", {"Tiger", {10, 4, 9}}}, + "8R218" = {{8, 10, 0}, "macOS", {"Tiger", {10, 4, 10}}}, + "8R2218" = {{8, 10, 0}, "macOS", {"Tiger", {10, 4, 10}}}, + "8R2232" = {{8, 10, 0}, "macOS", {"Tiger", {10, 4, 10}}}, + "8S165" = {{8, 11, 0}, "macOS", {"Tiger", {10, 4, 11}}}, + "8S2167" = {{8, 11, 0}, "macOS", {"Tiger", {10, 4, 11}}}, // MacOS Leopard - "9A581" = {{9, 0, 0}, "macOS", {"Leopard", {10, 5, 0}}}, - "9B18" = {{9, 1, 0}, "macOS", {"Leopard", {10, 5, 1}}}, - "9B2117" = {{9, 1, 1}, "macOS", {"Leopard", {10, 5, 1}}}, - "9C31" = {{9, 2, 0}, "macOS", {"Leopard", {10, 5, 2}}}, - "9C7010" = {{9, 2, 0}, "macOS", {"Leopard", {10, 5, 2}}}, - "9D34" = {{9, 3, 0}, "macOS", {"Leopard", {10, 5, 3}}}, - "9E17" = {{9, 4, 0}, "macOS", {"Leopard", {10, 5, 4}}}, - "9F33" = {{9, 5, 0}, "macOS", {"Leopard", {10, 5, 5}}}, - "9G55" = {{9, 6, 0}, "macOS", {"Leopard", {10, 5, 6}}}, - "9G66" = {{9, 6, 0}, "macOS", {"Leopard", {10, 5, 6}}}, - "9G71" = {{9, 6, 0}, "macOS", {"Leopard", {10, 5, 6}}}, - "9J61" = {{9, 7, 0}, "macOS", {"Leopard", {10, 5, 7}}}, - "9L30" = {{9, 8, 0}, "macOS", {"Leopard", {10, 5, 8}}}, - "9L34" = {{9, 8, 0}, "macOS", {"Leopard", {10, 5, 8}}}, + "9A581" = {{9, 0, 0}, "macOS", {"Leopard", {10, 5, 0}}}, + "9B18" = {{9, 1, 0}, "macOS", {"Leopard", {10, 5, 1}}}, + "9B2117" = {{9, 1, 1}, "macOS", {"Leopard", {10, 5, 1}}}, + "9C31" = {{9, 2, 0}, "macOS", {"Leopard", {10, 5, 2}}}, + "9C7010" = {{9, 2, 0}, "macOS", {"Leopard", {10, 5, 2}}}, + "9D34" = {{9, 3, 0}, "macOS", {"Leopard", {10, 5, 3}}}, + "9E17" = {{9, 4, 0}, "macOS", {"Leopard", {10, 5, 4}}}, + "9F33" = {{9, 5, 0}, "macOS", {"Leopard", {10, 5, 5}}}, + "9G55" = {{9, 6, 0}, "macOS", {"Leopard", {10, 5, 6}}}, + "9G66" = {{9, 6, 0}, "macOS", {"Leopard", {10, 5, 6}}}, + "9G71" = {{9, 6, 0}, "macOS", {"Leopard", {10, 5, 6}}}, + "9J61" = {{9, 7, 0}, "macOS", {"Leopard", {10, 5, 7}}}, + "9L30" = {{9, 8, 0}, "macOS", {"Leopard", {10, 5, 8}}}, + "9L34" = {{9, 8, 0}, "macOS", {"Leopard", {10, 5, 8}}}, // MacOS Snow Leopard - "10A432" = {{10, 0, 0}, "macOS", {"Snow Leopard", {10, 6, 0}}}, - "10A433" = {{10, 0, 0}, "macOS", {"Snow Leopard", {10, 6, 0}}}, - "10B504" = {{10, 1, 0}, "macOS", {"Snow Leopard", {10, 6, 1}}}, - "10C540" = {{10, 2, 0}, "macOS", {"Snow Leopard", {10, 6, 2}}}, - "10D573" = {{10, 3, 0}, "macOS", {"Snow Leopard", {10, 6, 3}}}, - "10D575" = {{10, 3, 0}, "macOS", {"Snow Leopard", {10, 6, 3}}}, - "10D578" = {{10, 3, 0}, "macOS", {"Snow Leopard", {10, 6, 3}}}, - "10F569" = {{10, 4, 0}, "macOS", {"Snow Leopard", {10, 6, 4}}}, - "10H574" = {{10, 5, 0}, "macOS", {"Snow Leopard", {10, 6, 5}}}, - "10J567" = {{10, 6, 0}, "macOS", {"Snow Leopard", {10, 6, 6}}}, - "10J869" = {{10, 7, 0}, "macOS", {"Snow Leopard", {10, 6, 7}}}, - "10J3250" = {{10, 7, 0}, "macOS", {"Snow Leopard", {10, 6, 7}}}, - "10J4138" = {{10, 7, 0}, "macOS", {"Snow Leopard", {10, 6, 7}}}, - "10K540" = {{10, 8, 0}, "macOS", {"Snow Leopard", {10, 6, 8}}}, - "10K549" = {{10, 8, 0}, "macOS", {"Snow Leopard", {10, 6, 8}}}, + "10A432" = {{10, 0, 0}, "macOS", {"Snow Leopard", {10, 6, 0}}}, + "10A433" = {{10, 0, 0}, "macOS", {"Snow Leopard", {10, 6, 0}}}, + "10B504" = {{10, 1, 0}, "macOS", {"Snow Leopard", {10, 6, 1}}}, + "10C540" = {{10, 2, 0}, "macOS", {"Snow Leopard", {10, 6, 2}}}, + "10D573" = {{10, 3, 0}, "macOS", {"Snow Leopard", {10, 6, 3}}}, + "10D575" = {{10, 3, 0}, "macOS", {"Snow Leopard", {10, 6, 3}}}, + "10D578" = {{10, 3, 0}, "macOS", {"Snow Leopard", {10, 6, 3}}}, + "10F569" = {{10, 4, 0}, "macOS", {"Snow Leopard", {10, 6, 4}}}, + "10H574" = {{10, 5, 0}, "macOS", {"Snow Leopard", {10, 6, 5}}}, + "10J567" = {{10, 6, 0}, "macOS", {"Snow Leopard", {10, 6, 6}}}, + "10J869" = {{10, 7, 0}, "macOS", {"Snow Leopard", {10, 6, 7}}}, + "10J3250" = {{10, 7, 0}, "macOS", {"Snow Leopard", {10, 6, 7}}}, + "10J4138" = {{10, 7, 0}, "macOS", {"Snow Leopard", {10, 6, 7}}}, + "10K540" = {{10, 8, 0}, "macOS", {"Snow Leopard", {10, 6, 8}}}, + "10K549" = {{10, 8, 0}, "macOS", {"Snow Leopard", {10, 6, 8}}}, // MacOS Lion - "11A511" = {{11, 0, 0}, "macOS", {"Lion", {10, 7, 0}}}, - "11A511s" = {{11, 0, 0}, "macOS", {"Lion", {10, 7, 0}}}, - "11A2061" = {{11, 0, 2}, "macOS", {"Lion", {10, 7, 0}}}, - "11A2063" = {{11, 0, 2}, "macOS", {"Lion", {10, 7, 0}}}, - "11B26" = {{11, 1, 0}, "macOS", {"Lion", {10, 7, 1}}}, - "11B2118" = {{11, 1, 0}, "macOS", {"Lion", {10, 7, 1}}}, - "11C74" = {{11, 2, 0}, "macOS", {"Lion", {10, 7, 2}}}, - "11D50" = {{11, 3, 0}, "macOS", {"Lion", {10, 7, 3}}}, - "11E53" = {{11, 4, 0}, "macOS", {"Lion", {10, 7, 4}}}, - "11G56" = {{11, 4, 2}, "macOS", {"Lion", {10, 7, 5}}}, - "11G63" = {{11, 4, 2}, "macOS", {"Lion", {10, 7, 5}}}, + "11A511" = {{11, 0, 0}, "macOS", {"Lion", {10, 7, 0}}}, + "11A511s" = {{11, 0, 0}, "macOS", {"Lion", {10, 7, 0}}}, + "11A2061" = {{11, 0, 2}, "macOS", {"Lion", {10, 7, 0}}}, + "11A2063" = {{11, 0, 2}, "macOS", {"Lion", {10, 7, 0}}}, + "11B26" = {{11, 1, 0}, "macOS", {"Lion", {10, 7, 1}}}, + "11B2118" = {{11, 1, 0}, "macOS", {"Lion", {10, 7, 1}}}, + "11C74" = {{11, 2, 0}, "macOS", {"Lion", {10, 7, 2}}}, + "11D50" = {{11, 3, 0}, "macOS", {"Lion", {10, 7, 3}}}, + "11E53" = {{11, 4, 0}, "macOS", {"Lion", {10, 7, 4}}}, + "11G56" = {{11, 4, 2}, "macOS", {"Lion", {10, 7, 5}}}, + "11G63" = {{11, 4, 2}, "macOS", {"Lion", {10, 7, 5}}}, // MacOS Mountain Lion - "12A269" = {{12, 0, 0}, "macOS", {"Mountain Lion", {10, 8, 0}}}, - "12B19" = {{12, 1, 0}, "macOS", {"Mountain Lion", {10, 8, 1}}}, - "12C54" = {{12, 2, 0}, "macOS", {"Mountain Lion", {10, 8, 2}}}, - "12C60" = {{12, 2, 0}, "macOS", {"Mountain Lion", {10, 8, 2}}}, - "12C2034" = {{12, 2, 0}, "macOS", {"Mountain Lion", {10, 8, 2}}}, - "12C3104" = {{12, 2, 0}, "macOS", {"Mountain Lion", {10, 8, 2}}}, - "12D78" = {{12, 3, 0}, "macOS", {"Mountain Lion", {10, 8, 3}}}, - "12E55" = {{12, 4, 0}, "macOS", {"Mountain Lion", {10, 8, 4}}}, - "12E3067" = {{12, 4, 0}, "macOS", {"Mountain Lion", {10, 8, 4}}}, - "12E4022" = {{12, 4, 0}, "macOS", {"Mountain Lion", {10, 8, 4}}}, - "12F37" = {{12, 5, 0}, "macOS", {"Mountain Lion", {10, 8, 5}}}, - "12F45" = {{12, 5, 0}, "macOS", {"Mountain Lion", {10, 8, 5}}}, - "12F2501" = {{12, 5, 0}, "macOS", {"Mountain Lion", {10, 8, 5}}}, - "12F2518" = {{12, 5, 0}, "macOS", {"Mountain Lion", {10, 8, 5}}}, - "12F2542" = {{12, 5, 0}, "macOS", {"Mountain Lion", {10, 8, 5}}}, - "12F2560" = {{12, 5, 0}, "macOS", {"Mountain Lion", {10, 8, 5}}}, + "12A269" = {{12, 0, 0}, "macOS", {"Mountain Lion", {10, 8, 0}}}, + "12B19" = {{12, 1, 0}, "macOS", {"Mountain Lion", {10, 8, 1}}}, + "12C54" = {{12, 2, 0}, "macOS", {"Mountain Lion", {10, 8, 2}}}, + "12C60" = {{12, 2, 0}, "macOS", {"Mountain Lion", {10, 8, 2}}}, + "12C2034" = {{12, 2, 0}, "macOS", {"Mountain Lion", {10, 8, 2}}}, + "12C3104" = {{12, 2, 0}, "macOS", {"Mountain Lion", {10, 8, 2}}}, + "12D78" = {{12, 3, 0}, "macOS", {"Mountain Lion", {10, 8, 3}}}, + "12E55" = {{12, 4, 0}, "macOS", {"Mountain Lion", {10, 8, 4}}}, + "12E3067" = {{12, 4, 0}, "macOS", {"Mountain Lion", {10, 8, 4}}}, + "12E4022" = {{12, 4, 0}, "macOS", {"Mountain Lion", {10, 8, 4}}}, + "12F37" = {{12, 5, 0}, "macOS", {"Mountain Lion", {10, 8, 5}}}, + "12F45" = {{12, 5, 0}, "macOS", {"Mountain Lion", {10, 8, 5}}}, + "12F2501" = {{12, 5, 0}, "macOS", {"Mountain Lion", {10, 8, 5}}}, + "12F2518" = {{12, 5, 0}, "macOS", {"Mountain Lion", {10, 8, 5}}}, + "12F2542" = {{12, 5, 0}, "macOS", {"Mountain Lion", {10, 8, 5}}}, + "12F2560" = {{12, 5, 0}, "macOS", {"Mountain Lion", {10, 8, 5}}}, // MacOS Mavericks - "13A603" = {{13, 0, 0}, "macOS", {"Mavericks", {10, 9, 0}}}, - "13B42" = {{13, 0, 0}, "macOS", {"Mavericks", {10, 9, 1}}}, - "13C64" = {{13, 1, 0}, "macOS", {"Mavericks", {10, 9, 2}}}, - "13C1021" = {{13, 1, 0}, "macOS", {"Mavericks", {10, 9, 2}}}, - "13D65" = {{13, 2, 0}, "macOS", {"Mavericks", {10, 9, 3}}}, - "13E28" = {{13, 3, 0}, "macOS", {"Mavericks", {10, 9, 4}}}, - "13F34" = {{13, 4, 0}, "macOS", {"Mavericks", {10, 9, 5}}}, - "13F1066" = {{13, 4, 0}, "macOS", {"Mavericks", {10, 9, 5}}}, - "13F1077" = {{13, 4, 0}, "macOS", {"Mavericks", {10, 9, 5}}}, - "13F1096" = {{13, 4, 0}, "macOS", {"Mavericks", {10, 9, 5}}}, - "13F1112" = {{13, 4, 0}, "macOS", {"Mavericks", {10, 9, 5}}}, - "13F1134" = {{13, 4, 0}, "macOS", {"Mavericks", {10, 9, 5}}}, - "13F1507" = {{13, 4, 0}, "macOS", {"Mavericks", {10, 9, 5}}}, - "13F1603" = {{13, 4, 0}, "macOS", {"Mavericks", {10, 9, 5}}}, - "13F1712" = {{13, 4, 0}, "macOS", {"Mavericks", {10, 9, 5}}}, - "13F1808" = {{13, 4, 0}, "macOS", {"Mavericks", {10, 9, 5}}}, - "13F1911" = {{13, 4, 0}, "macOS", {"Mavericks", {10, 9, 5}}}, + "13A603" = {{13, 0, 0}, "macOS", {"Mavericks", {10, 9, 0}}}, + "13B42" = {{13, 0, 0}, "macOS", {"Mavericks", {10, 9, 1}}}, + "13C64" = {{13, 1, 0}, "macOS", {"Mavericks", {10, 9, 2}}}, + "13C1021" = {{13, 1, 0}, "macOS", {"Mavericks", {10, 9, 2}}}, + "13D65" = {{13, 2, 0}, "macOS", {"Mavericks", {10, 9, 3}}}, + "13E28" = {{13, 3, 0}, "macOS", {"Mavericks", {10, 9, 4}}}, + "13F34" = {{13, 4, 0}, "macOS", {"Mavericks", {10, 9, 5}}}, + "13F1066" = {{13, 4, 0}, "macOS", {"Mavericks", {10, 9, 5}}}, + "13F1077" = {{13, 4, 0}, "macOS", {"Mavericks", {10, 9, 5}}}, + "13F1096" = {{13, 4, 0}, "macOS", {"Mavericks", {10, 9, 5}}}, + "13F1112" = {{13, 4, 0}, "macOS", {"Mavericks", {10, 9, 5}}}, + "13F1134" = {{13, 4, 0}, "macOS", {"Mavericks", {10, 9, 5}}}, + "13F1507" = {{13, 4, 0}, "macOS", {"Mavericks", {10, 9, 5}}}, + "13F1603" = {{13, 4, 0}, "macOS", {"Mavericks", {10, 9, 5}}}, + "13F1712" = {{13, 4, 0}, "macOS", {"Mavericks", {10, 9, 5}}}, + "13F1808" = {{13, 4, 0}, "macOS", {"Mavericks", {10, 9, 5}}}, + "13F1911" = {{13, 4, 0}, "macOS", {"Mavericks", {10, 9, 5}}}, // MacOS Yosemite - "14A389" = {{14, 0, 0}, "macOS", {"Yosemite", {10, 10, 0}}}, - "14B25" = {{14, 0, 0}, "macOS", {"Yosemite", {10, 10, 1}}}, - "14C109" = {{14, 1, 0}, "macOS", {"Yosemite", {10, 10, 2}}}, - "14C1510" = {{14, 1, 0}, "macOS", {"Yosemite", {10, 10, 2}}}, - "14C2043" = {{14, 1, 0}, "macOS", {"Yosemite", {10, 10, 2}}}, - "14C1514" = {{14, 1, 0}, "macOS", {"Yosemite", {10, 10, 2}}}, - "14C2513" = {{14, 1, 0}, "macOS", {"Yosemite", {10, 10, 2}}}, - "14D131" = {{14, 3, 0}, "macOS", {"Yosemite", {10, 10, 3}}}, - "14D136" = {{14, 3, 0}, "macOS", {"Yosemite", {10, 10, 3}}}, - "14E46" = {{14, 4, 0}, "macOS", {"Yosemite", {10, 10, 4}}}, - "14F27" = {{14, 5, 0}, "macOS", {"Yosemite", {10, 10, 5}}}, - "14F1021" = {{14, 5, 0}, "macOS", {"Yosemite", {10, 10, 5}}}, - "14F1505" = {{14, 5, 0}, "macOS", {"Yosemite", {10, 10, 5}}}, - "14F1509" = {{14, 5, 0}, "macOS", {"Yosemite", {10, 10, 5}}}, - "14F1605" = {{14, 5, 0}, "macOS", {"Yosemite", {10, 10, 5}}}, - "14F1713" = {{14, 5, 0}, "macOS", {"Yosemite", {10, 10, 5}}}, - "14F1808" = {{14, 5, 0}, "macOS", {"Yosemite", {10, 10, 5}}}, - "14F1909" = {{14, 5, 0}, "macOS", {"Yosemite", {10, 10, 5}}}, - "14F1912" = {{14, 5, 0}, "macOS", {"Yosemite", {10, 10, 5}}}, - "14F2009" = {{14, 5, 0}, "macOS", {"Yosemite", {10, 10, 5}}}, - "14F2109" = {{14, 5, 0}, "macOS", {"Yosemite", {10, 10, 5}}}, - "14F2315" = {{14, 5, 0}, "macOS", {"Yosemite", {10, 10, 5}}}, - "14F2411" = {{14, 5, 0}, "macOS", {"Yosemite", {10, 10, 5}}}, - "14F2511" = {{14, 5, 0}, "macOS", {"Yosemite", {10, 10, 5}}}, + "14A389" = {{14, 0, 0}, "macOS", {"Yosemite", {10, 10, 0}}}, + "14B25" = {{14, 0, 0}, "macOS", {"Yosemite", {10, 10, 1}}}, + "14C109" = {{14, 1, 0}, "macOS", {"Yosemite", {10, 10, 2}}}, + "14C1510" = {{14, 1, 0}, "macOS", {"Yosemite", {10, 10, 2}}}, + "14C2043" = {{14, 1, 0}, "macOS", {"Yosemite", {10, 10, 2}}}, + "14C1514" = {{14, 1, 0}, "macOS", {"Yosemite", {10, 10, 2}}}, + "14C2513" = {{14, 1, 0}, "macOS", {"Yosemite", {10, 10, 2}}}, + "14D131" = {{14, 3, 0}, "macOS", {"Yosemite", {10, 10, 3}}}, + "14D136" = {{14, 3, 0}, "macOS", {"Yosemite", {10, 10, 3}}}, + "14E46" = {{14, 4, 0}, "macOS", {"Yosemite", {10, 10, 4}}}, + "14F27" = {{14, 5, 0}, "macOS", {"Yosemite", {10, 10, 5}}}, + "14F1021" = {{14, 5, 0}, "macOS", {"Yosemite", {10, 10, 5}}}, + "14F1505" = {{14, 5, 0}, "macOS", {"Yosemite", {10, 10, 5}}}, + "14F1509" = {{14, 5, 0}, "macOS", {"Yosemite", {10, 10, 5}}}, + "14F1605" = {{14, 5, 0}, "macOS", {"Yosemite", {10, 10, 5}}}, + "14F1713" = {{14, 5, 0}, "macOS", {"Yosemite", {10, 10, 5}}}, + "14F1808" = {{14, 5, 0}, "macOS", {"Yosemite", {10, 10, 5}}}, + "14F1909" = {{14, 5, 0}, "macOS", {"Yosemite", {10, 10, 5}}}, + "14F1912" = {{14, 5, 0}, "macOS", {"Yosemite", {10, 10, 5}}}, + "14F2009" = {{14, 5, 0}, "macOS", {"Yosemite", {10, 10, 5}}}, + "14F2109" = {{14, 5, 0}, "macOS", {"Yosemite", {10, 10, 5}}}, + "14F2315" = {{14, 5, 0}, "macOS", {"Yosemite", {10, 10, 5}}}, + "14F2411" = {{14, 5, 0}, "macOS", {"Yosemite", {10, 10, 5}}}, + "14F2511" = {{14, 5, 0}, "macOS", {"Yosemite", {10, 10, 5}}}, // MacOS El Capitan - "15A284" = {{15, 0, 0}, "macOS", {"El Capitan", {10, 11, 0}}}, - "15B42" = {{15, 0, 0}, "macOS", {"El Capitan", {10, 11, 1}}}, - "15C50" = {{15, 2, 0}, "macOS", {"El Capitan", {10, 11, 2}}}, - "15D21" = {{15, 3, 0}, "macOS", {"El Capitan", {10, 11, 3}}}, - "15E65" = {{15, 4, 0}, "macOS", {"El Capitan", {10, 11, 4}}}, - "15F34" = {{15, 5, 0}, "macOS", {"El Capitan", {10, 11, 5}}}, - "15G31" = {{15, 6, 0}, "macOS", {"El Capitan", {10, 11, 6}}}, - "15G1004" = {{15, 6, 0}, "macOS", {"El Capitan", {10, 11, 6}}}, - "15G1011" = {{15, 6, 0}, "macOS", {"El Capitan", {10, 11, 6}}}, - "15G1108" = {{15, 6, 0}, "macOS", {"El Capitan", {10, 11, 6}}}, - "15G1212" = {{15, 6, 0}, "macOS", {"El Capitan", {10, 11, 6}}}, - "15G1217" = {{15, 6, 0}, "macOS", {"El Capitan", {10, 11, 6}}}, - "15G1421" = {{15, 6, 0}, "macOS", {"El Capitan", {10, 11, 6}}}, - "15G1510" = {{15, 6, 0}, "macOS", {"El Capitan", {10, 11, 6}}}, - "15G1611" = {{15, 6, 0}, "macOS", {"El Capitan", {10, 11, 6}}}, - "15G17023" = {{15, 6, 0}, "macOS", {"El Capitan", {10, 11, 6}}}, - "15G18013" = {{15, 6, 0}, "macOS", {"El Capitan", {10, 11, 6}}}, - "15G19009" = {{15, 6, 0}, "macOS", {"El Capitan", {10, 11, 6}}}, - "15G20015" = {{15, 6, 0}, "macOS", {"El Capitan", {10, 11, 6}}}, - "15G21013" = {{15, 6, 0}, "macOS", {"El Capitan", {10, 11, 6}}}, - "15G22010" = {{15, 6, 0}, "macOS", {"El Capitan", {10, 11, 6}}}, + "15A284" = {{15, 0, 0}, "macOS", {"El Capitan", {10, 11, 0}}}, + "15B42" = {{15, 0, 0}, "macOS", {"El Capitan", {10, 11, 1}}}, + "15C50" = {{15, 2, 0}, "macOS", {"El Capitan", {10, 11, 2}}}, + "15D21" = {{15, 3, 0}, "macOS", {"El Capitan", {10, 11, 3}}}, + "15E65" = {{15, 4, 0}, "macOS", {"El Capitan", {10, 11, 4}}}, + "15F34" = {{15, 5, 0}, "macOS", {"El Capitan", {10, 11, 5}}}, + "15G31" = {{15, 6, 0}, "macOS", {"El Capitan", {10, 11, 6}}}, + "15G1004" = {{15, 6, 0}, "macOS", {"El Capitan", {10, 11, 6}}}, + "15G1011" = {{15, 6, 0}, "macOS", {"El Capitan", {10, 11, 6}}}, + "15G1108" = {{15, 6, 0}, "macOS", {"El Capitan", {10, 11, 6}}}, + "15G1212" = {{15, 6, 0}, "macOS", {"El Capitan", {10, 11, 6}}}, + "15G1217" = {{15, 6, 0}, "macOS", {"El Capitan", {10, 11, 6}}}, + "15G1421" = {{15, 6, 0}, "macOS", {"El Capitan", {10, 11, 6}}}, + "15G1510" = {{15, 6, 0}, "macOS", {"El Capitan", {10, 11, 6}}}, + "15G1611" = {{15, 6, 0}, "macOS", {"El Capitan", {10, 11, 6}}}, + "15G17023" = {{15, 6, 0}, "macOS", {"El Capitan", {10, 11, 6}}}, + "15G18013" = {{15, 6, 0}, "macOS", {"El Capitan", {10, 11, 6}}}, + "15G19009" = {{15, 6, 0}, "macOS", {"El Capitan", {10, 11, 6}}}, + "15G20015" = {{15, 6, 0}, "macOS", {"El Capitan", {10, 11, 6}}}, + "15G21013" = {{15, 6, 0}, "macOS", {"El Capitan", {10, 11, 6}}}, + "15G22010" = {{15, 6, 0}, "macOS", {"El Capitan", {10, 11, 6}}}, // MacOS Sierra - "16A323" = {{16, 0, 0}, "macOS", {"Sierra", {10, 12, 0}}}, - "16B2555" = {{16, 1, 0}, "macOS", {"Sierra", {10, 12, 1}}}, - "16B2657" = {{16, 1, 0}, "macOS", {"Sierra", {10, 12, 1}}}, - "16C67" = {{16, 3, 0}, "macOS", {"Sierra", {10, 12, 2}}}, - "16C68" = {{16, 3, 0}, "macOS", {"Sierra", {10, 12, 2}}}, - "16D32" = {{16, 4, 0}, "macOS", {"Sierra", {10, 12, 3}}}, - "16E195" = {{16, 5, 0}, "macOS", {"Sierra", {10, 12, 4}}}, - "16F73" = {{16, 6, 0}, "macOS", {"Sierra", {10, 12, 5}}}, - "16F2073" = {{16, 6, 0}, "macOS", {"Sierra", {10, 12, 5}}}, - "16G29" = {{16, 7, 0}, "macOS", {"Sierra", {10, 12, 6}}}, - "16G1036" = {{16, 7, 0}, "macOS", {"Sierra", {10, 12, 6}}}, - "16G1114" = {{16, 7, 0}, "macOS", {"Sierra", {10, 12, 6}}}, - "16G1212" = {{16, 7, 0}, "macOS", {"Sierra", {10, 12, 6}}}, - "16G1314" = {{16, 7, 0}, "macOS", {"Sierra", {10, 12, 6}}}, - "16G1408" = {{16, 7, 0}, "macOS", {"Sierra", {10, 12, 6}}}, - "16G1510" = {{16, 7, 0}, "macOS", {"Sierra", {10, 12, 6}}}, - "16G1618" = {{16, 7, 0}, "macOS", {"Sierra", {10, 12, 6}}}, - "16G1710" = {{16, 7, 0}, "macOS", {"Sierra", {10, 12, 6}}}, - "16G1815" = {{16, 7, 0}, "macOS", {"Sierra", {10, 12, 6}}}, - "16G1917" = {{16, 7, 0}, "macOS", {"Sierra", {10, 12, 6}}}, - "16G1918" = {{16, 7, 0}, "macOS", {"Sierra", {10, 12, 6}}}, - "16G2016" = {{16, 7, 0}, "macOS", {"Sierra", {10, 12, 6}}}, - "16G2127" = {{16, 7, 0}, "macOS", {"Sierra", {10, 12, 6}}}, - "16G2128" = {{16, 7, 0}, "macOS", {"Sierra", {10, 12, 6}}}, - "16G2136" = {{16, 7, 0}, "macOS", {"Sierra", {10, 12, 6}}}, + "16A323" = {{16, 0, 0}, "macOS", {"Sierra", {10, 12, 0}}}, + "16B2555" = {{16, 1, 0}, "macOS", {"Sierra", {10, 12, 1}}}, + "16B2657" = {{16, 1, 0}, "macOS", {"Sierra", {10, 12, 1}}}, + "16C67" = {{16, 3, 0}, "macOS", {"Sierra", {10, 12, 2}}}, + "16C68" = {{16, 3, 0}, "macOS", {"Sierra", {10, 12, 2}}}, + "16D32" = {{16, 4, 0}, "macOS", {"Sierra", {10, 12, 3}}}, + "16E195" = {{16, 5, 0}, "macOS", {"Sierra", {10, 12, 4}}}, + "16F73" = {{16, 6, 0}, "macOS", {"Sierra", {10, 12, 5}}}, + "16F2073" = {{16, 6, 0}, "macOS", {"Sierra", {10, 12, 5}}}, + "16G29" = {{16, 7, 0}, "macOS", {"Sierra", {10, 12, 6}}}, + "16G1036" = {{16, 7, 0}, "macOS", {"Sierra", {10, 12, 6}}}, + "16G1114" = {{16, 7, 0}, "macOS", {"Sierra", {10, 12, 6}}}, + "16G1212" = {{16, 7, 0}, "macOS", {"Sierra", {10, 12, 6}}}, + "16G1314" = {{16, 7, 0}, "macOS", {"Sierra", {10, 12, 6}}}, + "16G1408" = {{16, 7, 0}, "macOS", {"Sierra", {10, 12, 6}}}, + "16G1510" = {{16, 7, 0}, "macOS", {"Sierra", {10, 12, 6}}}, + "16G1618" = {{16, 7, 0}, "macOS", {"Sierra", {10, 12, 6}}}, + "16G1710" = {{16, 7, 0}, "macOS", {"Sierra", {10, 12, 6}}}, + "16G1815" = {{16, 7, 0}, "macOS", {"Sierra", {10, 12, 6}}}, + "16G1917" = {{16, 7, 0}, "macOS", {"Sierra", {10, 12, 6}}}, + "16G1918" = {{16, 7, 0}, "macOS", {"Sierra", {10, 12, 6}}}, + "16G2016" = {{16, 7, 0}, "macOS", {"Sierra", {10, 12, 6}}}, + "16G2127" = {{16, 7, 0}, "macOS", {"Sierra", {10, 12, 6}}}, + "16G2128" = {{16, 7, 0}, "macOS", {"Sierra", {10, 12, 6}}}, + "16G2136" = {{16, 7, 0}, "macOS", {"Sierra", {10, 12, 6}}}, // MacOS High Sierra - "17A365" = {{17, 0, 0}, "macOS", {"High Sierra", {10, 13, 0}}}, - "17A405" = {{17, 0, 0}, "macOS", {"High Sierra", {10, 13, 0}}}, - "17B48" = {{17, 2, 0}, "macOS", {"High Sierra", {10, 13, 1}}}, - "17B1002" = {{17, 2, 0}, "macOS", {"High Sierra", {10, 13, 1}}}, - "17B1003" = {{17, 2, 0}, "macOS", {"High Sierra", {10, 13, 1}}}, - "17C88" = {{17, 3, 0}, "macOS", {"High Sierra", {10, 13, 2}}}, - "17C89" = {{17, 3, 0}, "macOS", {"High Sierra", {10, 13, 2}}}, - "17C205" = {{17, 3, 0}, "macOS", {"High Sierra", {10, 13, 2}}}, - "17C2205" = {{17, 3, 0}, "macOS", {"High Sierra", {10, 13, 2}}}, - "17D47" = {{17, 4, 0}, "macOS", {"High Sierra", {10, 13, 3}}}, - "17D2047" = {{17, 4, 0}, "macOS", {"High Sierra", {10, 13, 3}}}, - "17D102" = {{17, 4, 0}, "macOS", {"High Sierra", {10, 13, 3}}}, - "17D2102" = {{17, 4, 0}, "macOS", {"High Sierra", {10, 13, 3}}}, - "17E199" = {{17, 5, 0}, "macOS", {"High Sierra", {10, 13, 4}}}, - "17E202" = {{17, 5, 0}, "macOS", {"High Sierra", {10, 13, 4}}}, - "17F77" = {{17, 6, 0}, "macOS", {"High Sierra", {10, 13, 5}}}, - "17G65" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, - "17G2208" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, - "17G2307" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, - "17G3025" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, - "17G4015" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, - "17G5019" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, - "17G6029" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, - "17G6030" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, - "17G7024" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, - "17G8029" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, - "17G8030" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, - "17G8037" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, - "17G9016" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, - "17G10021" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, - "17G11023" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, - "17G12034" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, - "17G13033" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, - "17G13035" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, - "17G14019" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, - "17G14033" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, - "17G14042" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, + "17A365" = {{17, 0, 0}, "macOS", {"High Sierra", {10, 13, 0}}}, + "17A405" = {{17, 0, 0}, "macOS", {"High Sierra", {10, 13, 0}}}, + "17B48" = {{17, 2, 0}, "macOS", {"High Sierra", {10, 13, 1}}}, + "17B1002" = {{17, 2, 0}, "macOS", {"High Sierra", {10, 13, 1}}}, + "17B1003" = {{17, 2, 0}, "macOS", {"High Sierra", {10, 13, 1}}}, + "17C88" = {{17, 3, 0}, "macOS", {"High Sierra", {10, 13, 2}}}, + "17C89" = {{17, 3, 0}, "macOS", {"High Sierra", {10, 13, 2}}}, + "17C205" = {{17, 3, 0}, "macOS", {"High Sierra", {10, 13, 2}}}, + "17C2205" = {{17, 3, 0}, "macOS", {"High Sierra", {10, 13, 2}}}, + "17D47" = {{17, 4, 0}, "macOS", {"High Sierra", {10, 13, 3}}}, + "17D2047" = {{17, 4, 0}, "macOS", {"High Sierra", {10, 13, 3}}}, + "17D102" = {{17, 4, 0}, "macOS", {"High Sierra", {10, 13, 3}}}, + "17D2102" = {{17, 4, 0}, "macOS", {"High Sierra", {10, 13, 3}}}, + "17E199" = {{17, 5, 0}, "macOS", {"High Sierra", {10, 13, 4}}}, + "17E202" = {{17, 5, 0}, "macOS", {"High Sierra", {10, 13, 4}}}, + "17F77" = {{17, 6, 0}, "macOS", {"High Sierra", {10, 13, 5}}}, + "17G65" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, + "17G2208" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, + "17G2307" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, + "17G3025" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, + "17G4015" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, + "17G5019" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, + "17G6029" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, + "17G6030" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, + "17G7024" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, + "17G8029" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, + "17G8030" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, + "17G8037" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, + "17G9016" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, + "17G10021" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, + "17G11023" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, + "17G12034" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, + "17G13033" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, + "17G13035" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, + "17G14019" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, + "17G14033" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, + "17G14042" = {{17, 7, 0}, "macOS", {"High Sierra", {10, 13, 6}}}, // MacOS Mojave - "18A391" = {{18, 0, 0}, "macOS", {"Mojave", {10, 14, 0}}}, - "18B75" = {{18, 2, 0}, "macOS", {"Mojave", {10, 14, 1}}}, - "18B2107" = {{18, 2, 0}, "macOS", {"Mojave", {10, 14, 1}}}, - "18B3094" = {{18, 2, 0}, "macOS", {"Mojave", {10, 14, 1}}}, - "18C54" = {{18, 2, 0}, "macOS", {"Mojave", {10, 14, 2}}}, - "18D42" = {{18, 2, 0}, "macOS", {"Mojave", {10, 14, 3}}}, - "18D43" = {{18, 2, 0}, "macOS", {"Mojave", {10, 14, 3}}}, - "18D109" = {{18, 2, 0}, "macOS", {"Mojave", {10, 14, 3}}}, - "18E226" = {{18, 5, 0}, "macOS", {"Mojave", {10, 14, 4}}}, - "18E227" = {{18, 5, 0}, "macOS", {"Mojave", {10, 14, 4}}}, - "18F132" = {{18, 6, 0}, "macOS", {"Mojave", {10, 14, 5}}}, - "18G84" = {{18, 7, 0}, "macOS", {"Mojave", {10, 14, 6}}}, - "18G87" = {{18, 7, 0}, "macOS", {"Mojave", {10, 14, 6}}}, - "18G95" = {{18, 7, 0}, "macOS", {"Mojave", {10, 14, 6}}}, - "18G103" = {{18, 7, 0}, "macOS", {"Mojave", {10, 14, 6}}}, - "18G1012" = {{18, 7, 0}, "macOS", {"Mojave", {10, 14, 6}}}, - "18G2022" = {{18, 7, 0}, "macOS", {"Mojave", {10, 14, 6}}}, - "18G3020" = {{18, 7, 0}, "macOS", {"Mojave", {10, 14, 6}}}, - "18G4032" = {{18, 7, 0}, "macOS", {"Mojave", {10, 14, 6}}}, - "18G5033" = {{18, 7, 0}, "macOS", {"Mojave", {10, 14, 6}}}, - "18G6020" = {{18, 7, 0}, "macOS", {"Mojave", {10, 14, 6}}}, - "18G6032" = {{18, 7, 0}, "macOS", {"Mojave", {10, 14, 6}}}, - "18G6042" = {{18, 7, 0}, "macOS", {"Mojave", {10, 14, 6}}}, - "18G7016" = {{18, 7, 0}, "macOS", {"Mojave", {10, 14, 6}}}, - "18G8012" = {{18, 7, 0}, "macOS", {"Mojave", {10, 14, 6}}}, - "18G8022" = {{18, 7, 0}, "macOS", {"Mojave", {10, 14, 6}}}, - "18G9028" = {{18, 7, 0}, "macOS", {"Mojave", {10, 14, 6}}}, - "18G9216" = {{18, 7, 0}, "macOS", {"Mojave", {10, 14, 6}}}, - "18G9323" = {{18, 7, 0}, "macOS", {"Mojave", {10, 14, 6}}}, + "18A391" = {{18, 0, 0}, "macOS", {"Mojave", {10, 14, 0}}}, + "18B75" = {{18, 2, 0}, "macOS", {"Mojave", {10, 14, 1}}}, + "18B2107" = {{18, 2, 0}, "macOS", {"Mojave", {10, 14, 1}}}, + "18B3094" = {{18, 2, 0}, "macOS", {"Mojave", {10, 14, 1}}}, + "18C54" = {{18, 2, 0}, "macOS", {"Mojave", {10, 14, 2}}}, + "18D42" = {{18, 2, 0}, "macOS", {"Mojave", {10, 14, 3}}}, + "18D43" = {{18, 2, 0}, "macOS", {"Mojave", {10, 14, 3}}}, + "18D109" = {{18, 2, 0}, "macOS", {"Mojave", {10, 14, 3}}}, + "18E226" = {{18, 5, 0}, "macOS", {"Mojave", {10, 14, 4}}}, + "18E227" = {{18, 5, 0}, "macOS", {"Mojave", {10, 14, 4}}}, + "18F132" = {{18, 6, 0}, "macOS", {"Mojave", {10, 14, 5}}}, + "18G84" = {{18, 7, 0}, "macOS", {"Mojave", {10, 14, 6}}}, + "18G87" = {{18, 7, 0}, "macOS", {"Mojave", {10, 14, 6}}}, + "18G95" = {{18, 7, 0}, "macOS", {"Mojave", {10, 14, 6}}}, + "18G103" = {{18, 7, 0}, "macOS", {"Mojave", {10, 14, 6}}}, + "18G1012" = {{18, 7, 0}, "macOS", {"Mojave", {10, 14, 6}}}, + "18G2022" = {{18, 7, 0}, "macOS", {"Mojave", {10, 14, 6}}}, + "18G3020" = {{18, 7, 0}, "macOS", {"Mojave", {10, 14, 6}}}, + "18G4032" = {{18, 7, 0}, "macOS", {"Mojave", {10, 14, 6}}}, + "18G5033" = {{18, 7, 0}, "macOS", {"Mojave", {10, 14, 6}}}, + "18G6020" = {{18, 7, 0}, "macOS", {"Mojave", {10, 14, 6}}}, + "18G6032" = {{18, 7, 0}, "macOS", {"Mojave", {10, 14, 6}}}, + "18G6042" = {{18, 7, 0}, "macOS", {"Mojave", {10, 14, 6}}}, + "18G7016" = {{18, 7, 0}, "macOS", {"Mojave", {10, 14, 6}}}, + "18G8012" = {{18, 7, 0}, "macOS", {"Mojave", {10, 14, 6}}}, + "18G8022" = {{18, 7, 0}, "macOS", {"Mojave", {10, 14, 6}}}, + "18G9028" = {{18, 7, 0}, "macOS", {"Mojave", {10, 14, 6}}}, + "18G9216" = {{18, 7, 0}, "macOS", {"Mojave", {10, 14, 6}}}, + "18G9323" = {{18, 7, 0}, "macOS", {"Mojave", {10, 14, 6}}}, // MacOS Catalina - "19A583" = {{19, 0, 0}, "macOS", {"Catalina", {10, 15, 0}}}, - "19A602" = {{19, 0, 0}, "macOS", {"Catalina", {10, 15, 0}}}, - "19A603" = {{19, 0, 0}, "macOS", {"Catalina", {10, 15, 0}}}, - "19B88" = {{19, 0, 0}, "macOS", {"Catalina", {10, 15, 1}}}, - "19C57" = {{19, 2, 0}, "macOS", {"Catalina", {10, 15, 2}}}, - "19C58" = {{19, 2, 0}, "macOS", {"Catalina", {10, 15, 2}}}, - "19D76" = {{19, 3, 0}, "macOS", {"Catalina", {10, 15, 3}}}, - "19E266" = {{19, 4, 0}, "macOS", {"Catalina", {10, 15, 4}}}, - "19E287" = {{19, 4, 0}, "macOS", {"Catalina", {10, 15, 4}}}, - "19F96" = {{19, 5, 0}, "macOS", {"Catalina", {10, 15, 5}}}, - "19F101" = {{19, 5, 0}, "macOS", {"Catalina", {10, 15, 5}}}, - "19G73" = {{19, 6, 0}, "macOS", {"Catalina", {10, 15, 6}}}, - "19G2021" = {{19, 6, 0}, "macOS", {"Catalina", {10, 15, 6}}}, - "19H2" = {{19, 6, 0}, "macOS", {"Catalina", {10, 15, 7}}}, - "19H4" = {{19, 6, 0}, "macOS", {"Catalina", {10, 15, 7}}}, - "19H15" = {{19, 6, 0}, "macOS", {"Catalina", {10, 15, 7}}}, - "19H114" = {{19, 6, 0}, "macOS", {"Catalina", {10, 15, 7}}}, - "19H512" = {{19, 6, 0}, "macOS", {"Catalina", {10, 15, 7}}}, - "19H524" = {{19, 6, 0}, "macOS", {"Catalina", {10, 15, 7}}}, - "19H1030" = {{19, 6, 0}, "macOS", {"Catalina", {10, 15, 7}}}, - "19H1217" = {{19, 6, 0}, "macOS", {"Catalina", {10, 15, 7}}}, - "19H1323" = {{19, 6, 0}, "macOS", {"Catalina", {10, 15, 7}}}, - "19H1417" = {{19, 6, 0}, "macOS", {"Catalina", {10, 15, 7}}}, - "19H1419" = {{19, 6, 0}, "macOS", {"Catalina", {10, 15, 7}}}, - "19H1519" = {{19, 6, 0}, "macOS", {"Catalina", {10, 15, 7}}}, - "19H1615" = {{19, 6, 0}, "macOS", {"Catalina", {10, 15, 7}}}, - "19H1713" = {{19, 6, 0}, "macOS", {"Catalina", {10, 15, 7}}}, - "19H1715" = {{19, 6, 0}, "macOS", {"Catalina", {10, 15, 7}}}, - "19H1824" = {{19, 6, 0}, "macOS", {"Catalina", {10, 15, 7}}}, - "19H1922" = {{19, 6, 0}, "macOS", {"Catalina", {10, 15, 7}}}, - "19H2026" = {{19, 6, 0}, "macOS", {"Catalina", {10, 15, 7}}}, + "19A583" = {{19, 0, 0}, "macOS", {"Catalina", {10, 15, 0}}}, + "19A602" = {{19, 0, 0}, "macOS", {"Catalina", {10, 15, 0}}}, + "19A603" = {{19, 0, 0}, "macOS", {"Catalina", {10, 15, 0}}}, + "19B88" = {{19, 0, 0}, "macOS", {"Catalina", {10, 15, 1}}}, + "19C57" = {{19, 2, 0}, "macOS", {"Catalina", {10, 15, 2}}}, + "19C58" = {{19, 2, 0}, "macOS", {"Catalina", {10, 15, 2}}}, + "19D76" = {{19, 3, 0}, "macOS", {"Catalina", {10, 15, 3}}}, + "19E266" = {{19, 4, 0}, "macOS", {"Catalina", {10, 15, 4}}}, + "19E287" = {{19, 4, 0}, "macOS", {"Catalina", {10, 15, 4}}}, + "19F96" = {{19, 5, 0}, "macOS", {"Catalina", {10, 15, 5}}}, + "19F101" = {{19, 5, 0}, "macOS", {"Catalina", {10, 15, 5}}}, + "19G73" = {{19, 6, 0}, "macOS", {"Catalina", {10, 15, 6}}}, + "19G2021" = {{19, 6, 0}, "macOS", {"Catalina", {10, 15, 6}}}, + "19H2" = {{19, 6, 0}, "macOS", {"Catalina", {10, 15, 7}}}, + "19H4" = {{19, 6, 0}, "macOS", {"Catalina", {10, 15, 7}}}, + "19H15" = {{19, 6, 0}, "macOS", {"Catalina", {10, 15, 7}}}, + "19H114" = {{19, 6, 0}, "macOS", {"Catalina", {10, 15, 7}}}, + "19H512" = {{19, 6, 0}, "macOS", {"Catalina", {10, 15, 7}}}, + "19H524" = {{19, 6, 0}, "macOS", {"Catalina", {10, 15, 7}}}, + "19H1030" = {{19, 6, 0}, "macOS", {"Catalina", {10, 15, 7}}}, + "19H1217" = {{19, 6, 0}, "macOS", {"Catalina", {10, 15, 7}}}, + "19H1323" = {{19, 6, 0}, "macOS", {"Catalina", {10, 15, 7}}}, + "19H1417" = {{19, 6, 0}, "macOS", {"Catalina", {10, 15, 7}}}, + "19H1419" = {{19, 6, 0}, "macOS", {"Catalina", {10, 15, 7}}}, + "19H1519" = {{19, 6, 0}, "macOS", {"Catalina", {10, 15, 7}}}, + "19H1615" = {{19, 6, 0}, "macOS", {"Catalina", {10, 15, 7}}}, + "19H1713" = {{19, 6, 0}, "macOS", {"Catalina", {10, 15, 7}}}, + "19H1715" = {{19, 6, 0}, "macOS", {"Catalina", {10, 15, 7}}}, + "19H1824" = {{19, 6, 0}, "macOS", {"Catalina", {10, 15, 7}}}, + "19H1922" = {{19, 6, 0}, "macOS", {"Catalina", {10, 15, 7}}}, + "19H2026" = {{19, 6, 0}, "macOS", {"Catalina", {10, 15, 7}}}, // MacOS Big Sur - "20A2411" = {{20, 1, 0}, "macOS", {"Big Sur", {11, 0, 0}}}, - "20B29" = {{20, 1, 0}, "macOS", {"Big Sur", {11, 0, 1}}}, - "20B50" = {{20, 1, 0}, "macOS", {"Big Sur", {11, 0, 1}}}, - "20C69" = {{20, 2, 0}, "macOS", {"Big Sur", {11, 1, 0}}}, - "20D64" = {{20, 3, 0}, "macOS", {"Big Sur", {11, 2, 0}}}, - "20D74" = {{20, 3, 0}, "macOS", {"Big Sur", {11, 2, 1}}}, - "20D75" = {{20, 3, 0}, "macOS", {"Big Sur", {11, 2, 1}}}, - "20D80" = {{20, 3, 0}, "macOS", {"Big Sur", {11, 2, 2}}}, - "20D91" = {{20, 3, 0}, "macOS", {"Big Sur", {11, 2, 3}}}, - "20E232" = {{20, 4, 0}, "macOS", {"Big Sur", {11, 3, 0}}}, - "20E241" = {{20, 4, 0}, "macOS", {"Big Sur", {11, 3, 1}}}, - "20F71" = {{20, 5, 0}, "macOS", {"Big Sur", {11, 4, 0}}}, - "20G71" = {{20, 6, 0}, "macOS", {"Big Sur", {11, 5, 0}}}, - "20G80" = {{20, 6, 0}, "macOS", {"Big Sur", {11, 5, 1}}}, - "20G95" = {{20, 6, 0}, "macOS", {"Big Sur", {11, 5, 2}}}, - "20G165" = {{20, 6, 0}, "macOS", {"Big Sur", {11, 6, 0}}}, - "20G224" = {{20, 6, 0}, "macOS", {"Big Sur", {11, 6, 1}}}, - "20G314" = {{20, 6, 0}, "macOS", {"Big Sur", {11, 6, 2}}}, - "20G415" = {{20, 6, 0}, "macOS", {"Big Sur", {11, 6, 3}}}, - "20G417" = {{20, 6, 0}, "macOS", {"Big Sur", {11, 6, 4}}}, - "20G527" = {{20, 6, 0}, "macOS", {"Big Sur", {11, 6, 5}}}, - "20G624" = {{20, 6, 0}, "macOS", {"Big Sur", {11, 6, 6}}}, - "20G630" = {{20, 6, 0}, "macOS", {"Big Sur", {11, 6, 7}}}, - "20G730" = {{20, 6, 0}, "macOS", {"Big Sur", {11, 6, 8}}}, + "20A2411" = {{20, 1, 0}, "macOS", {"Big Sur", {11, 0, 0}}}, + "20B29" = {{20, 1, 0}, "macOS", {"Big Sur", {11, 0, 1}}}, + "20B50" = {{20, 1, 0}, "macOS", {"Big Sur", {11, 0, 1}}}, + "20C69" = {{20, 2, 0}, "macOS", {"Big Sur", {11, 1, 0}}}, + "20D64" = {{20, 3, 0}, "macOS", {"Big Sur", {11, 2, 0}}}, + "20D74" = {{20, 3, 0}, "macOS", {"Big Sur", {11, 2, 1}}}, + "20D75" = {{20, 3, 0}, "macOS", {"Big Sur", {11, 2, 1}}}, + "20D80" = {{20, 3, 0}, "macOS", {"Big Sur", {11, 2, 2}}}, + "20D91" = {{20, 3, 0}, "macOS", {"Big Sur", {11, 2, 3}}}, + "20E232" = {{20, 4, 0}, "macOS", {"Big Sur", {11, 3, 0}}}, + "20E241" = {{20, 4, 0}, "macOS", {"Big Sur", {11, 3, 1}}}, + "20F71" = {{20, 5, 0}, "macOS", {"Big Sur", {11, 4, 0}}}, + "20G71" = {{20, 6, 0}, "macOS", {"Big Sur", {11, 5, 0}}}, + "20G80" = {{20, 6, 0}, "macOS", {"Big Sur", {11, 5, 1}}}, + "20G95" = {{20, 6, 0}, "macOS", {"Big Sur", {11, 5, 2}}}, + "20G165" = {{20, 6, 0}, "macOS", {"Big Sur", {11, 6, 0}}}, + "20G224" = {{20, 6, 0}, "macOS", {"Big Sur", {11, 6, 1}}}, + "20G314" = {{20, 6, 0}, "macOS", {"Big Sur", {11, 6, 2}}}, + "20G415" = {{20, 6, 0}, "macOS", {"Big Sur", {11, 6, 3}}}, + "20G417" = {{20, 6, 0}, "macOS", {"Big Sur", {11, 6, 4}}}, + "20G527" = {{20, 6, 0}, "macOS", {"Big Sur", {11, 6, 5}}}, + "20G624" = {{20, 6, 0}, "macOS", {"Big Sur", {11, 6, 6}}}, + "20G630" = {{20, 6, 0}, "macOS", {"Big Sur", {11, 6, 7}}}, + "20G730" = {{20, 6, 0}, "macOS", {"Big Sur", {11, 6, 8}}}, + "20G817" = {{20, 6, 0}, "macOS", {"Big Sur", {11, 7, 0}}}, + "20G918" = {{20, 6, 0}, "macOS", {"Big Sur", {11, 7, 1}}}, + "20G1020" = {{20, 6, 0}, "macOS", {"Big Sur", {11, 7, 2}}}, + "20G1116" = {{20, 6, 0}, "macOS", {"Big Sur", {11, 7, 3}}}, + "20G1120" = {{20, 6, 0}, "macOS", {"Big Sur", {11, 7, 4}}}, + "20G1225" = {{20, 6, 0}, "macOS", {"Big Sur", {11, 7, 5}}}, + "20G1231" = {{20, 6, 0}, "macOS", {"Big Sur", {11, 7, 6}}}, + "20G1345" = {{20, 6, 0}, "macOS", {"Big Sur", {11, 7, 7}}}, + "20G1351" = {{20, 6, 0}, "macOS", {"Big Sur", {11, 7, 8}}}, + "20G1426" = {{20, 6, 0}, "macOS", {"Big Sur", {11, 7, 9}}}, + "20G1427" = {{20, 6, 0}, "macOS", {"Big Sur", {11, 7, 10}}}, // MacOS Monterey - "21A344" = {{21, 0, 1}, "macOS", {"Monterey", {12, 0, 0}}}, - "21A559" = {{21, 1, 0}, "macOS", {"Monterey", {12, 0, 1}}}, - "21C52" = {{21, 2, 0}, "macOS", {"Monterey", {12, 1, 0}}}, - "21D49" = {{21, 3, 0}, "macOS", {"Monterey", {12, 2, 0}}}, - "21D62" = {{21, 3, 0}, "macOS", {"Monterey", {12, 2, 1}}}, - "21E230" = {{21, 4, 0}, "macOS", {"Monterey", {12, 3, 0}}}, - "21E258" = {{21, 4, 0}, "macOS", {"Monterey", {12, 3, 1}}}, - "21F79" = {{21, 5, 0}, "macOS", {"Monterey", {12, 4, 0}}}, - "21F2081" = {{21, 5, 0}, "macOS", {"Monterey", {12, 4, 0}}}, - "21F2092" = {{21, 5, 0}, "macOS", {"Monterey", {12, 4, 0}}}, - "21G72" = {{21, 6, 0}, "macOS", {"Monterey", {12, 5, 0}}}, - "21G83" = {{21, 6, 0}, "macOS", {"Monterey", {12, 5, 1}}}, - "21G115" = {{21, 6, 0}, "macOS", {"Monterey", {12, 6, 0}}}, + "21A344" = {{21, 0, 1}, "macOS", {"Monterey", {12, 0, 0}}}, + "21A559" = {{21, 1, 0}, "macOS", {"Monterey", {12, 0, 1}}}, + "21C52" = {{21, 2, 0}, "macOS", {"Monterey", {12, 1, 0}}}, + "21D49" = {{21, 3, 0}, "macOS", {"Monterey", {12, 2, 0}}}, + "21D62" = {{21, 3, 0}, "macOS", {"Monterey", {12, 2, 1}}}, + "21E230" = {{21, 4, 0}, "macOS", {"Monterey", {12, 3, 0}}}, + "21E258" = {{21, 4, 0}, "macOS", {"Monterey", {12, 3, 1}}}, + "21F79" = {{21, 5, 0}, "macOS", {"Monterey", {12, 4, 0}}}, + "21F2081" = {{21, 5, 0}, "macOS", {"Monterey", {12, 4, 0}}}, + "21F2092" = {{21, 5, 0}, "macOS", {"Monterey", {12, 4, 0}}}, + "21G72" = {{21, 6, 0}, "macOS", {"Monterey", {12, 5, 0}}}, + "21G83" = {{21, 6, 0}, "macOS", {"Monterey", {12, 5, 1}}}, + "21G115" = {{21, 6, 0}, "macOS", {"Monterey", {12, 6, 0}}}, + "21G217" = {{21, 6, 0}, "macOS", {"Monterey", {12, 6, 1}}}, + "21G320" = {{21, 6, 0}, "macOS", {"Monterey", {12, 6, 2}}}, + "21G419" = {{21, 6, 0}, "macOS", {"Monterey", {12, 6, 3}}}, + "21G526" = {{21, 6, 0}, "macOS", {"Monterey", {12, 6, 4}}}, + "21G531" = {{21, 6, 0}, "macOS", {"Monterey", {12, 6, 5}}}, + "21G646" = {{21, 6, 0}, "macOS", {"Monterey", {12, 6, 6}}}, + "21G651" = {{21, 6, 0}, "macOS", {"Monterey", {12, 6, 7}}}, + "21G725" = {{21, 6, 0}, "macOS", {"Monterey", {12, 6, 8}}}, + "21G726" = {{21, 6, 0}, "macOS", {"Monterey", {12, 6, 9}}}, + "21G816" = {{21, 6, 0}, "macOS", {"Monterey", {12, 7, 0}}}, + "21G920" = {{21, 6, 0}, "macOS", {"Monterey", {12, 7, 1}}}, + "21G1974" = {{21, 6, 0}, "macOS", {"Monterey", {12, 7, 2}}}, + + // MacOS Ventura + "22A380" = {{22, 1, 0}, "macOS", {"Ventura", {13, 0, 0}}}, + "22A400" = {{22, 1, 0}, "macOS", {"Ventura", {13, 0, 1}}}, + "22C65" = {{22, 2, 0}, "macOS", {"Ventura", {13, 1, 0}}}, + "22D49" = {{22, 3, 0}, "macOS", {"Ventura", {13, 2, 0}}}, + "22D68" = {{22, 3, 0}, "macOS", {"Ventura", {13, 2, 1}}}, + "22E252" = {{22, 4, 0}, "macOS", {"Ventura", {13, 3, 0}}}, + "22E261" = {{22, 4, 0}, "macOS", {"Ventura", {13, 3, 1}}}, + "22F66" = {{22, 5, 0}, "macOS", {"Ventura", {13, 4, 0}}}, + "22F82" = {{22, 5, 0}, "macOS", {"Ventura", {13, 4, 1}}}, + "22E772610a" = {{22, 5, 0}, "macOS", {"Ventura", {13, 4, 1}}}, + "22F770820d" = {{22, 5, 0}, "macOS", {"Ventura", {13, 4, 1}}}, + "22G74" = {{22, 6, 0}, "macOS", {"Ventura", {13, 5, 0}}}, + "22G90" = {{22, 6, 0}, "macOS", {"Ventura", {13, 5, 1}}}, + "22G91" = {{22, 6, 0}, "macOS", {"Ventura", {13, 5, 2}}}, + "22G120" = {{22, 6, 0}, "macOS", {"Ventura", {13, 6, 0}}}, + "22G313" = {{22, 6, 0}, "macOS", {"Ventura", {13, 6, 1}}}, + "22G320" = {{22, 6, 0}, "macOS", {"Ventura", {13, 6, 2}}}, + + // MacOS Sonoma + "23A344" = {{23, 0, 0}, "macOS", {"Sonoma", {14, 0, 0}}}, + "23B74" = {{23, 1, 0}, "macOS", {"Sonoma", {14, 1, 0}}}, + "23B81" = {{23, 1, 0}, "macOS", {"Sonoma", {14, 1, 1}}}, + "23B92" = {{23, 1, 0}, "macOS", {"Sonoma", {14, 1, 2}}}, + "23C64" = {{23, 2, 0}, "macOS", {"Sonoma", {14, 2, 0}}}, + "23C71" = {{23, 2, 0}, "macOS", {"Sonoma", {14, 2, 1}}}, } @(private) diff --git a/core/sys/linux/sys.odin b/core/sys/linux/sys.odin index 27c855c3b..9a0f18e9f 100644 --- a/core/sys/linux/sys.odin +++ b/core/sys/linux/sys.odin @@ -1,4 +1,3 @@ -//+build linux package linux import "core:intrinsics" diff --git a/core/sys/linux/types.odin b/core/sys/linux/types.odin index 099c18b5c..677bac7e0 100644 --- a/core/sys/linux/types.odin +++ b/core/sys/linux/types.odin @@ -1,4 +1,3 @@ -//+build linux package linux /* diff --git a/core/sys/windows/advapi32.odin b/core/sys/windows/advapi32.odin index dc7ec1e08..163bf2a5e 100644 --- a/core/sys/windows/advapi32.odin +++ b/core/sys/windows/advapi32.odin @@ -5,7 +5,7 @@ foreign import advapi32 "system:Advapi32.lib" HCRYPTPROV :: distinct HANDLE -@(default_calling_convention="stdcall") +@(default_calling_convention="system") foreign advapi32 { @(link_name = "SystemFunction036") RtlGenRandom :: proc(RandomBuffer: ^u8, RandomBufferLength: ULONG) -> BOOLEAN --- @@ -13,13 +13,18 @@ foreign advapi32 { DesiredAccess: DWORD, TokenHandle: ^HANDLE) -> BOOL --- + OpenThreadToken :: proc(ThreadHandle: HANDLE, + DesiredAccess: DWORD, + OpenAsSelf: BOOL, + TokenHandle: ^HANDLE) -> BOOL --- + CryptAcquireContextW :: proc(hProv: ^HCRYPTPROV, szContainer, szProvider: wstring, dwProvType, dwFlags: DWORD) -> DWORD --- CryptGenRandom :: proc(hProv: HCRYPTPROV, dwLen: DWORD, buf: LPVOID) -> DWORD --- CryptReleaseContext :: proc(hProv: HCRYPTPROV, dwFlags: DWORD) -> DWORD --- } // Necessary to create a token to impersonate a user with for CreateProcessAsUser -@(default_calling_convention="stdcall") +@(default_calling_convention="system") foreign advapi32 { LogonUserW :: proc( lpszUsername: LPCWSTR, diff --git a/core/sys/windows/bcrypt.odin b/core/sys/windows/bcrypt.odin index 52eb4b1b6..d891aa92b 100644 --- a/core/sys/windows/bcrypt.odin +++ b/core/sys/windows/bcrypt.odin @@ -5,7 +5,7 @@ foreign import bcrypt "system:Bcrypt.lib" BCRYPT_USE_SYSTEM_PREFERRED_RNG: DWORD : 0x00000002 -@(default_calling_convention="stdcall") +@(default_calling_convention="system") foreign bcrypt { BCryptGenRandom :: proc(hAlgorithm: LPVOID, pBuffer: [^]u8, cbBuffer: ULONG, dwFlags: ULONG) -> LONG --- } diff --git a/core/sys/windows/bluetooth.odin b/core/sys/windows/bluetooth.odin index c2534896b..7bfb7ea96 100644 --- a/core/sys/windows/bluetooth.odin +++ b/core/sys/windows/bluetooth.odin @@ -51,7 +51,7 @@ BLUETOOTH_DEVICE_INFO :: struct { name: [BLUETOOTH_MAX_NAME_SIZE]u16, // Name of the device } -@(default_calling_convention="stdcall") +@(default_calling_convention="system") foreign bthprops { /* Version diff --git a/core/sys/windows/comctl32.odin b/core/sys/windows/comctl32.odin index 983c45d36..9c4404a9d 100644 --- a/core/sys/windows/comctl32.odin +++ b/core/sys/windows/comctl32.odin @@ -3,7 +3,7 @@ package sys_windows foreign import "system:Comctl32.lib" -@(default_calling_convention="stdcall") +@(default_calling_convention="system") foreign Comctl32 { LoadIconWithScaleDown :: proc(hinst: HINSTANCE, pszName: PCWSTR, cx: c_int, cy: c_int, phico: ^HICON) -> HRESULT --- } diff --git a/core/sys/windows/comdlg32.odin b/core/sys/windows/comdlg32.odin index 8284050f1..30d9b169c 100644 --- a/core/sys/windows/comdlg32.odin +++ b/core/sys/windows/comdlg32.odin @@ -3,7 +3,7 @@ package sys_windows foreign import "system:Comdlg32.lib" -LPOFNHOOKPROC :: #type proc "stdcall" (hdlg: HWND, msg: u32, wparam: WPARAM, lparam: LPARAM) -> UINT_PTR +LPOFNHOOKPROC :: #type proc "system" (hdlg: HWND, msg: u32, wparam: WPARAM, lparam: LPARAM) -> UINT_PTR OPENFILENAMEW :: struct { lStructSize: DWORD, @@ -31,7 +31,7 @@ OPENFILENAMEW :: struct { FlagsEx: DWORD, } -@(default_calling_convention="stdcall") +@(default_calling_convention="system") foreign Comdlg32 { GetOpenFileNameW :: proc(arg1: ^OPENFILENAMEW) -> BOOL --- GetSaveFileNameW :: proc(arg1: ^OPENFILENAMEW) -> BOOL --- diff --git a/core/sys/windows/dbghelp.odin b/core/sys/windows/dbghelp.odin index 7c63b845b..c2e506748 100644 --- a/core/sys/windows/dbghelp.odin +++ b/core/sys/windows/dbghelp.odin @@ -44,7 +44,7 @@ MINIDUMP_USER_STREAM_INFORMATION :: struct { UserStreamArray: ^MINIDUMP_USER_STREAM, } -MINIDUMP_CALLBACK_ROUTINE :: #type proc "stdcall" ( +MINIDUMP_CALLBACK_ROUTINE :: #type proc "system" ( CallbackParam: PVOID, CallbackInput: ^MINIDUMP_CALLBACK_INPUT, CallbackOutpu: ^MINIDUMP_CALLBACK_OUTPUT, @@ -228,7 +228,7 @@ MINIDUMP_TYPE :: enum u32 { ValidTypeFlags = 0x01ffffff, } -@(default_calling_convention = "stdcall") +@(default_calling_convention = "system") foreign Dbghelp { MiniDumpWriteDump :: proc( hProcess: HANDLE, diff --git a/core/sys/windows/dnsapi.odin b/core/sys/windows/dnsapi.odin index 623fa2889..dd2d1acee 100644 --- a/core/sys/windows/dnsapi.odin +++ b/core/sys/windows/dnsapi.odin @@ -3,7 +3,7 @@ package sys_windows foreign import "system:Dnsapi.lib" -@(default_calling_convention="std") +@(default_calling_convention="system") foreign Dnsapi { DnsQuery_UTF8 :: proc(name: cstring, type: u16, options: DWORD, extra: PVOID, results: ^^DNS_RECORD, reserved: PVOID) -> DNS_STATUS --- DnsRecordListFree :: proc(list: ^DNS_RECORD, options: DWORD) --- diff --git a/core/sys/windows/dwmapi.odin b/core/sys/windows/dwmapi.odin index 34616fb98..91911baae 100644 --- a/core/sys/windows/dwmapi.odin +++ b/core/sys/windows/dwmapi.odin @@ -38,7 +38,7 @@ DWMNCRENDERINGPOLICY :: enum { DWMNCRP_LAST, } -@(default_calling_convention="stdcall") +@(default_calling_convention="system") foreign dwmapi { DwmFlush :: proc() -> HRESULT --- DwmIsCompositionEnabled :: proc(pfEnabled: ^BOOL) -> HRESULT --- diff --git a/core/sys/windows/gdi32.odin b/core/sys/windows/gdi32.odin index 801e483e7..1d2be6dab 100644 --- a/core/sys/windows/gdi32.odin +++ b/core/sys/windows/gdi32.odin @@ -3,7 +3,7 @@ package sys_windows foreign import gdi32 "system:Gdi32.lib" -@(default_calling_convention="stdcall") +@(default_calling_convention="system") foreign gdi32 { GetStockObject :: proc(i: c_int) -> HGDIOBJ --- SelectObject :: proc(hdc: HDC, h: HGDIOBJ) -> HGDIOBJ --- diff --git a/core/sys/windows/hidpi.odin b/core/sys/windows/hidpi.odin index 8f1a75247..f862971f4 100644 --- a/core/sys/windows/hidpi.odin +++ b/core/sys/windows/hidpi.odin @@ -124,7 +124,7 @@ HIDP_REPORT_TYPE :: enum c.int { HIDP_STATUS_SUCCESS : NTSTATUS : 0x110000 foreign import hid "system:hid.lib" -@(default_calling_convention="stdcall") +@(default_calling_convention="system") foreign hid { HidP_GetCaps :: proc(PreparsedData: PHIDP_PREPARSED_DATA, Capabilities: PHIDP_CAPS) -> NTSTATUS --- HidP_GetButtonCaps :: proc(ReportType: HIDP_REPORT_TYPE, ButtonCaps: PHIDP_BUTTON_CAPS, ButtonCapsLength: PUSHORT, PreparsedData: PHIDP_PREPARSED_DATA) -> NTSTATUS --- diff --git a/core/sys/windows/ip_helper.odin b/core/sys/windows/ip_helper.odin index d8f93f533..4c2534c10 100644 --- a/core/sys/windows/ip_helper.odin +++ b/core/sys/windows/ip_helper.odin @@ -217,7 +217,7 @@ NL_DAD_STATE :: enum i32 { IpDadStatePreferred = 4, } -@(default_calling_convention = "std") +@(default_calling_convention = "system") foreign iphlpapi { /* The GetAdaptersAddresses function retrieves the addresses associated with the adapters on the local computer. diff --git a/core/sys/windows/kernel32.odin b/core/sys/windows/kernel32.odin index 6108f4738..390af3ab8 100644 --- a/core/sys/windows/kernel32.odin +++ b/core/sys/windows/kernel32.odin @@ -21,7 +21,7 @@ COMMON_LVB_REVERSE_VIDEO :: WORD(0x4000) COMMON_LVB_UNDERSCORE :: WORD(0x8000) COMMON_LVB_SBCSDBCS :: WORD(0x0300) -@(default_calling_convention="stdcall") +@(default_calling_convention="system") foreign kernel32 { OutputDebugStringA :: proc(lpOutputString: LPCSTR) --- // The only A thing that is allowed OutputDebugStringW :: proc(lpOutputString: LPCWSTR) --- @@ -112,7 +112,7 @@ foreign kernel32 { CreateThread :: proc( lpThreadAttributes: LPSECURITY_ATTRIBUTES, dwStackSize: SIZE_T, - lpStartAddress: proc "stdcall" (rawptr) -> DWORD, + lpStartAddress: proc "system" (rawptr) -> DWORD, lpParameter: LPVOID, dwCreationFlags: DWORD, lpThreadId: LPDWORD, @@ -121,7 +121,7 @@ foreign kernel32 { hProcess: HANDLE, lpThreadAttributes: LPSECURITY_ATTRIBUTES, dwStackSize: SIZE_T, - lpStartAddress: proc "stdcall" (rawptr) -> DWORD, + lpStartAddress: proc "system" (rawptr) -> DWORD, lpParameter: LPVOID, dwCreationFlags: DWORD, lpThreadId: LPDWORD, @@ -581,7 +581,7 @@ MEM_TOP_DOWN :: 0x100000 MEM_LARGE_PAGES :: 0x20000000 MEM_4MB_PAGES :: 0x80000000 -@(default_calling_convention="stdcall") +@(default_calling_convention="system") foreign kernel32 { VirtualAlloc :: proc( lpAddress: LPVOID, @@ -724,7 +724,7 @@ LowMemoryResourceNotification :: MEMORY_RESOURCE_NOTIFICATION_TYPE.LowMemoryRes HighMemoryResourceNotification :: MEMORY_RESOURCE_NOTIFICATION_TYPE.HighMemoryResourceNotification -@(default_calling_convention="stdcall") +@(default_calling_convention="system") foreign kernel32 { CreateMemoryResourceNotification :: proc( NotificationType: MEMORY_RESOURCE_NOTIFICATION_TYPE, @@ -740,7 +740,7 @@ FILE_CACHE_MAX_HARD_DISABLE :: DWORD(0x00000002) FILE_CACHE_MIN_HARD_ENABLE :: DWORD(0x00000004) FILE_CACHE_MIN_HARD_DISABLE :: DWORD(0x00000008) -@(default_calling_convention="stdcall") +@(default_calling_convention="system") foreign kernel32 { GetSystemFileCacheSize :: proc( lpMinimumFileCacheSize: PSIZE_T, @@ -770,7 +770,7 @@ WIN32_MEMORY_RANGE_ENTRY :: struct { PWIN32_MEMORY_RANGE_ENTRY :: ^WIN32_MEMORY_RANGE_ENTRY -@(default_calling_convention="stdcall") +@(default_calling_convention="system") foreign kernel32 { PrefetchVirtualMemory :: proc( hProcess: HANDLE, @@ -828,23 +828,23 @@ foreign kernel32 { MEHC_PATROL_SCRUBBER_PRESENT :: ULONG(0x1) -@(default_calling_convention="stdcall") +@(default_calling_convention="system") foreign kernel32 { GetMemoryErrorHandlingCapabilities :: proc( Capabilities: PULONG, ) -> BOOL --- } -@(default_calling_convention="stdcall") +@(default_calling_convention="system") foreign kernel32 { GlobalMemoryStatusEx :: proc( lpBuffer: ^MEMORYSTATUSEX, ) -> BOOL --- } -PBAD_MEMORY_CALLBACK_ROUTINE :: #type proc "stdcall" () +PBAD_MEMORY_CALLBACK_ROUTINE :: #type proc "system" () -@(default_calling_convention="stdcall") +@(default_calling_convention="system") foreign kernel32 { RegisterBadMemoryNotification :: proc( Callback: PBAD_MEMORY_CALLBACK_ROUTINE, @@ -865,7 +865,7 @@ VmOfferPriorityLow :: OFFER_PRIORITY.VmOfferPriorityLow VmOfferPriorityBelowNormal :: OFFER_PRIORITY.VmOfferPriorityBelowNormal VmOfferPriorityNormal :: OFFER_PRIORITY.VmOfferPriorityNormal -@(default_calling_convention="stdcall") +@(default_calling_convention="system") foreign kernel32 { OfferVirtualMemory :: proc( VirtualAddress: PVOID, @@ -930,7 +930,7 @@ WIN32_MEMORY_REGION_INFORMATION_u_s_Bitfield :: distinct ULONG Reserved : 32-6, }*/ -@(default_calling_convention="stdcall") +@(default_calling_convention="system") foreign one_core { QueryVirtualMemoryInformation :: proc( Process: HANDLE, @@ -955,7 +955,7 @@ foreign one_core { NUMA_NO_PREFERRED_NODE :: 0xffffffff -MapViewOfFile2 :: #force_inline proc "stdcall" ( +MapViewOfFile2 :: #force_inline proc "system" ( FileMappingHandle: HANDLE, ProcessHandle: HANDLE, Offset: ULONG64, @@ -976,7 +976,7 @@ MapViewOfFile2 :: #force_inline proc "stdcall" ( ) } -@(default_calling_convention="stdcall") +@(default_calling_convention="system") foreign kernel32 { UnmapViewOfFile2 :: proc( ProcessHandle: HANDLE, @@ -985,7 +985,7 @@ foreign kernel32 { ) -> BOOL --- } -@(default_calling_convention="stdcall") +@(default_calling_convention="system") foreign kernel32 { GetProductInfo :: proc( OSMajorVersion: DWORD, @@ -996,7 +996,7 @@ foreign kernel32 { ) -> BOOL --- } -HandlerRoutine :: proc "stdcall" (dwCtrlType: DWORD) -> BOOL +HandlerRoutine :: proc "system" (dwCtrlType: DWORD) -> BOOL PHANDLER_ROUTINE :: HandlerRoutine @@ -1137,16 +1137,16 @@ DCB :: struct { wReserved1: WORD, } -@(default_calling_convention="stdcall") +@(default_calling_convention="system") foreign kernel32 { GetCommState :: proc(handle: HANDLE, dcb: ^DCB) -> BOOL --- SetCommState :: proc(handle: HANDLE, dcb: ^DCB) -> BOOL --- } -LPFIBER_START_ROUTINE :: #type proc "stdcall" (lpFiberParameter: LPVOID) +LPFIBER_START_ROUTINE :: #type proc "system" (lpFiberParameter: LPVOID) -@(default_calling_convention = "stdcall") +@(default_calling_convention = "system") foreign kernel32 { CreateFiber :: proc(dwStackSize: SIZE_T, lpStartAddress: LPFIBER_START_ROUTINE, lpParameter: LPVOID) -> LPVOID --- DeleteFiber :: proc(lpFiber: LPVOID) --- diff --git a/core/sys/windows/netapi32.odin b/core/sys/windows/netapi32.odin index 0df277181..d9f75c623 100644 --- a/core/sys/windows/netapi32.odin +++ b/core/sys/windows/netapi32.odin @@ -3,7 +3,7 @@ package sys_windows foreign import netapi32 "system:Netapi32.lib" -@(default_calling_convention="stdcall") +@(default_calling_convention="system") foreign netapi32 { NetUserAdd :: proc( servername: wstring, diff --git a/core/sys/windows/ntdll.odin b/core/sys/windows/ntdll.odin index dda5b9711..56c24f1a2 100644 --- a/core/sys/windows/ntdll.odin +++ b/core/sys/windows/ntdll.odin @@ -3,7 +3,7 @@ package sys_windows foreign import ntdll_lib "system:ntdll.lib" -@(default_calling_convention="stdcall") +@(default_calling_convention="system") foreign ntdll_lib { RtlGetVersion :: proc(lpVersionInformation: ^OSVERSIONINFOEXW) -> NTSTATUS --- } \ No newline at end of file diff --git a/core/sys/windows/ole32.odin b/core/sys/windows/ole32.odin index 4a4b470ea..6fa398d46 100644 --- a/core/sys/windows/ole32.odin +++ b/core/sys/windows/ole32.odin @@ -1,4 +1,3 @@ -// +build windows package sys_windows foreign import "system:Ole32.lib" @@ -15,14 +14,14 @@ IUnknown :: struct { using Vtbl: ^IUnknownVtbl, } IUnknownVtbl :: struct { - QueryInterface: proc "stdcall" (This: ^IUnknown, riid: REFIID, ppvObject: ^rawptr) -> HRESULT, - AddRef: proc "stdcall" (This: ^IUnknown) -> ULONG, - Release: proc "stdcall" (This: ^IUnknown) -> ULONG, + QueryInterface: proc "system" (This: ^IUnknown, riid: REFIID, ppvObject: ^rawptr) -> HRESULT, + AddRef: proc "system" (This: ^IUnknown) -> ULONG, + Release: proc "system" (This: ^IUnknown) -> ULONG, } LPUNKNOWN :: ^IUnknown -@(default_calling_convention="stdcall") +@(default_calling_convention="system") foreign Ole32 { CoInitializeEx :: proc(reserved: rawptr, co_init: COINIT) -> HRESULT --- CoUninitialize :: proc() --- diff --git a/core/sys/windows/shell32.odin b/core/sys/windows/shell32.odin index 2d2b257df..358b8482f 100644 --- a/core/sys/windows/shell32.odin +++ b/core/sys/windows/shell32.odin @@ -3,7 +3,7 @@ package sys_windows foreign import shell32 "system:Shell32.lib" -@(default_calling_convention="stdcall") +@(default_calling_convention="system") foreign shell32 { CommandLineToArgvW :: proc(cmd_list: wstring, num_args: ^c_int) -> ^wstring --- ShellExecuteW :: proc( diff --git a/core/sys/windows/shlwapi.odin b/core/sys/windows/shlwapi.odin index 241ade8f6..bf9d2d1e8 100644 --- a/core/sys/windows/shlwapi.odin +++ b/core/sys/windows/shlwapi.odin @@ -3,7 +3,7 @@ package sys_windows foreign import shlwapi "system:shlwapi.lib" -@(default_calling_convention="stdcall") +@(default_calling_convention="system") foreign shlwapi { PathFileExistsW :: proc(pszPath: wstring) -> BOOL --- PathFindExtensionW :: proc(pszPath: wstring) -> wstring --- diff --git a/core/sys/windows/synchronization.odin b/core/sys/windows/synchronization.odin index c98730aa0..79efaab34 100644 --- a/core/sys/windows/synchronization.odin +++ b/core/sys/windows/synchronization.odin @@ -3,7 +3,7 @@ package sys_windows foreign import Synchronization "system:Synchronization.lib" -@(default_calling_convention="stdcall") +@(default_calling_convention="system") foreign Synchronization { WaitOnAddress :: proc(Address: PVOID, CompareAddress: PVOID, AddressSize: SIZE_T, dwMilliseconds: DWORD) -> BOOL --- WakeByAddressSingle :: proc(Address: PVOID) --- diff --git a/core/sys/windows/types.odin b/core/sys/windows/types.odin index 10b474866..37f953c58 100644 --- a/core/sys/windows/types.odin +++ b/core/sys/windows/types.odin @@ -1,4 +1,3 @@ -// +build windows package sys_windows import "core:c" @@ -7,9 +6,9 @@ c_char :: c.char c_uchar :: c.uchar c_int :: c.int c_uint :: c.uint -c_long :: c.long +c_long :: i32 c_longlong :: c.longlong -c_ulong :: c.ulong +c_ulong :: u32 c_ulonglong :: c.ulonglong c_short :: c.short c_ushort :: c.ushort @@ -692,13 +691,13 @@ FW_DEMIBOLD :: FW_SEMIBOLD FW_ULTRABOLD :: FW_EXTRABOLD FW_BLACK :: FW_HEAVY -PTIMERAPCROUTINE :: #type proc "stdcall" (lpArgToCompletionRoutine: LPVOID, dwTimerLowValue, dwTimerHighValue: DWORD) +PTIMERAPCROUTINE :: #type proc "system" (lpArgToCompletionRoutine: LPVOID, dwTimerLowValue, dwTimerHighValue: DWORD) -TIMERPROC :: #type proc "stdcall" (HWND, UINT, UINT_PTR, DWORD) +TIMERPROC :: #type proc "system" (HWND, UINT, UINT_PTR, DWORD) -WNDPROC :: #type proc "stdcall" (HWND, UINT, WPARAM, LPARAM) -> LRESULT +WNDPROC :: #type proc "system" (HWND, UINT, WPARAM, LPARAM) -> LRESULT -HOOKPROC :: #type proc "stdcall" (code: c_int, wParam: WPARAM, lParam: LPARAM) -> LRESULT +HOOKPROC :: #type proc "system" (code: c_int, wParam: WPARAM, lParam: LPARAM) -> LRESULT CWPRETSTRUCT :: struct { lResult: LRESULT, @@ -2177,7 +2176,7 @@ WC_ERR_INVALID_CHARS :: 128 MAX_PATH :: 0x00000104 MAX_PATH_WIDE :: 0x8000 -INVALID_FILE_ATTRIBUTES :: -1 +INVALID_FILE_ATTRIBUTES :: DWORD(0xffff_ffff) FILE_TYPE_DISK :: 0x0001 FILE_TYPE_CHAR :: 0x0002 @@ -2325,7 +2324,7 @@ MOUNT_POINT_REPARSE_BUFFER :: struct { PathBuffer: WCHAR, } -LPPROGRESS_ROUTINE :: #type proc "stdcall" ( +LPPROGRESS_ROUTINE :: #type proc "system" ( TotalFileSize: LARGE_INTEGER, TotalBytesTransferred: LARGE_INTEGER, StreamSize: LARGE_INTEGER, @@ -2495,7 +2494,7 @@ OVERLAPPED_ENTRY :: struct { dwNumberOfBytesTransferred: DWORD, } -LPOVERLAPPED_COMPLETION_ROUTINE :: #type proc "stdcall" ( +LPOVERLAPPED_COMPLETION_ROUTINE :: #type proc "system" ( dwErrorCode: DWORD, dwNumberOfBytesTransfered: DWORD, lpOverlapped: LPOVERLAPPED, @@ -2559,7 +2558,7 @@ EXCEPTION_POINTERS :: struct { ContextRecord: ^CONTEXT, } -PVECTORED_EXCEPTION_HANDLER :: #type proc "stdcall" (ExceptionInfo: ^EXCEPTION_POINTERS) -> LONG +PVECTORED_EXCEPTION_HANDLER :: #type proc "system" (ExceptionInfo: ^EXCEPTION_POINTERS) -> LONG CONSOLE_READCONSOLE_CONTROL :: struct { nLength: ULONG, @@ -2614,7 +2613,7 @@ ADDRINFOEXW :: struct { ai_next: ^ADDRINFOEXW, } -LPLOOKUPSERVICE_COMPLETION_ROUTINE :: #type proc "stdcall" ( +LPLOOKUPSERVICE_COMPLETION_ROUTINE :: #type proc "system" ( dwErrorCode: DWORD, dwNumberOfBytesTransfered: DWORD, lpOverlapped: LPOVERLAPPED, @@ -2720,16 +2719,17 @@ SECURITY_MAX_SID_SIZE :: 68 // https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-sid SID :: struct #packed { - Revision: byte, - SubAuthorityCount: byte, + Revision: byte, + SubAuthorityCount: byte, IdentifierAuthority: SID_IDENTIFIER_AUTHORITY, - SubAuthority: [15]DWORD, // Array of DWORDs + SubAuthority: [15]DWORD, // Array of DWORDs } #assert(size_of(SID) == SECURITY_MAX_SID_SIZE) SID_IDENTIFIER_AUTHORITY :: struct #packed { Value: [6]u8, } +#assert(size_of(SID_IDENTIFIER_AUTHORITY) == 6) // For NetAPI32 // https://github.com/tpn/winsdk-10/blob/master/Include/10.0.14393.0/shared/lmerr.h @@ -3427,7 +3427,7 @@ IModalWindow :: struct #raw_union { } IModalWindowVtbl :: struct { using IUnknownVtbl: IUnknownVtbl, - Show: proc "stdcall" (this: ^IModalWindow, hwndOwner: HWND) -> HRESULT, + Show: proc "system" (this: ^IModalWindow, hwndOwner: HWND) -> HRESULT, } ISequentialStream :: struct #raw_union { @@ -3436,8 +3436,8 @@ ISequentialStream :: struct #raw_union { } ISequentialStreamVtbl :: struct { using IUnknownVtbl: IUnknownVtbl, - Read: proc "stdcall" (this: ^ISequentialStream, pv: rawptr, cb: ULONG, pcbRead: ^ULONG) -> HRESULT, - Write: proc "stdcall" (this: ^ISequentialStream, pv: rawptr, cb: ULONG, pcbWritten: ^ULONG) -> HRESULT, + Read: proc "system" (this: ^ISequentialStream, pv: rawptr, cb: ULONG, pcbRead: ^ULONG) -> HRESULT, + Write: proc "system" (this: ^ISequentialStream, pv: rawptr, cb: ULONG, pcbWritten: ^ULONG) -> HRESULT, } IStream :: struct #raw_union { @@ -3446,15 +3446,15 @@ IStream :: struct #raw_union { } IStreamVtbl :: struct { using ISequentialStreamVtbl: ISequentialStreamVtbl, - Seek: proc "stdcall" (this: ^IStream, dlibMove: LARGE_INTEGER, dwOrigin: DWORD, plibNewPosition: ^ULARGE_INTEGER) -> HRESULT, - SetSize: proc "stdcall" (this: ^IStream, libNewSize: ULARGE_INTEGER) -> HRESULT, - CopyTo: proc "stdcall" (this: ^IStream, pstm: ^IStream, cb: ULARGE_INTEGER, pcbRead: ^ULARGE_INTEGER, pcbWritten: ^ULARGE_INTEGER) -> HRESULT, - Commit: proc "stdcall" (this: ^IStream, grfCommitFlags: DWORD) -> HRESULT, - Revert: proc "stdcall" (this: ^IStream) -> HRESULT, - LockRegion: proc "stdcall" (this: ^IStream, libOffset: ULARGE_INTEGER, cb: ULARGE_INTEGER, dwLockType: DWORD) -> HRESULT, - UnlockRegion: proc "stdcall" (this: ^IStream, libOffset: ULARGE_INTEGER, cb: ULARGE_INTEGER, dwLockType: DWORD) -> HRESULT, - Stat: proc "stdcall" (this: ^IStream, pstatstg: ^STATSTG, grfStatFlag: DWORD) -> HRESULT, - Clone: proc "stdcall" (this: ^IStream, ppstm: ^^IStream) -> HRESULT, + Seek: proc "system" (this: ^IStream, dlibMove: LARGE_INTEGER, dwOrigin: DWORD, plibNewPosition: ^ULARGE_INTEGER) -> HRESULT, + SetSize: proc "system" (this: ^IStream, libNewSize: ULARGE_INTEGER) -> HRESULT, + CopyTo: proc "system" (this: ^IStream, pstm: ^IStream, cb: ULARGE_INTEGER, pcbRead: ^ULARGE_INTEGER, pcbWritten: ^ULARGE_INTEGER) -> HRESULT, + Commit: proc "system" (this: ^IStream, grfCommitFlags: DWORD) -> HRESULT, + Revert: proc "system" (this: ^IStream) -> HRESULT, + LockRegion: proc "system" (this: ^IStream, libOffset: ULARGE_INTEGER, cb: ULARGE_INTEGER, dwLockType: DWORD) -> HRESULT, + UnlockRegion: proc "system" (this: ^IStream, libOffset: ULARGE_INTEGER, cb: ULARGE_INTEGER, dwLockType: DWORD) -> HRESULT, + Stat: proc "system" (this: ^IStream, pstatstg: ^STATSTG, grfStatFlag: DWORD) -> HRESULT, + Clone: proc "system" (this: ^IStream, ppstm: ^^IStream) -> HRESULT, } IPersist :: struct #raw_union { @@ -3463,7 +3463,7 @@ IPersist :: struct #raw_union { } IPersistVtbl :: struct { using IUnknownVtbl: IUnknownVtbl, - GetClassID: proc "stdcall" (this: ^IPersist, pClassID: ^CLSID) -> HRESULT, + GetClassID: proc "system" (this: ^IPersist, pClassID: ^CLSID) -> HRESULT, } IPersistStream :: struct #raw_union { @@ -3472,10 +3472,10 @@ IPersistStream :: struct #raw_union { } IPersistStreamVtbl :: struct { using IPersistVtbl: IPersistVtbl, - IsDirty: proc "stdcall" (this: ^IPersistStream) -> HRESULT, - Load: proc "stdcall" (this: ^IPersistStream, pStm: ^IStream) -> HRESULT, - Save: proc "stdcall" (this: ^IPersistStream, pStm: ^IStream, fClearDirty: BOOL) -> HRESULT, - GetSizeMax: proc "stdcall" (this: ^IPersistStream, pcbSize: ^ULARGE_INTEGER) -> HRESULT, + IsDirty: proc "system" (this: ^IPersistStream) -> HRESULT, + Load: proc "system" (this: ^IPersistStream, pStm: ^IStream) -> HRESULT, + Save: proc "system" (this: ^IPersistStream, pStm: ^IStream, fClearDirty: BOOL) -> HRESULT, + GetSizeMax: proc "system" (this: ^IPersistStream, pcbSize: ^ULARGE_INTEGER) -> HRESULT, } IMoniker :: struct #raw_union { @@ -3484,21 +3484,21 @@ IMoniker :: struct #raw_union { } IMonikerVtbl :: struct { using IPersistStreamVtbl: IPersistStreamVtbl, - BindToObject: proc "stdcall" (this: ^IMoniker, pbc: ^IBindCtx, pmkToLeft: ^IMoniker, riidResult: REFIID, ppvResult: ^rawptr) -> HRESULT, - BindToStorage: proc "stdcall" (this: ^IMoniker, pbc: ^IBindCtx, pmkToLeft: ^IMoniker, riid: REFIID, ppvObj: ^rawptr) -> HRESULT, - Reduce: proc "stdcall" (this: ^IMoniker, pbc: ^IBindCtx, dwReduceHowFar: DWORD, ppmkToLeft: ^^IMoniker, ppmkReduced: ^^IMoniker) -> HRESULT, - ComposeWith: proc "stdcall" (this: ^IMoniker, pmkRight: ^IMoniker, fOnlyIfNotGeneric: BOOL, ppmkComposite: ^^IMoniker) -> HRESULT, - Enum: proc "stdcall" (this: ^IMoniker, fForward: BOOL, ppenumMoniker: ^^IEnumMoniker) -> HRESULT, - IsEqual: proc "stdcall" (this: ^IMoniker, pmkOtherMoniker: ^IMoniker) -> HRESULT, - Hash: proc "stdcall" (this: ^IMoniker, pdwHash: ^DWORD) -> HRESULT, - IsRunning: proc "stdcall" (this: ^IMoniker, pbc: ^IBindCtx, pmkToLeft: ^IMoniker, pmkNewlyRunning: ^IMoniker) -> HRESULT, - GetTimeOfLastChange: proc "stdcall" (this: ^IMoniker, pbc: ^IBindCtx, pmkToLeft: ^IMoniker, pFileTime: ^FILETIME) -> HRESULT, - Inverse: proc "stdcall" (this: ^IMoniker, ppmk: ^^IMoniker) -> HRESULT, - CommonPrefixWith: proc "stdcall" (this: ^IMoniker, pmkOther: ^IMoniker, ppmkPrefix: ^^IMoniker) -> HRESULT, - RelativePathTo: proc "stdcall" (this: ^IMoniker, pmkOther: ^IMoniker, ppmkRelPath: ^^IMoniker) -> HRESULT, - GetDisplayName: proc "stdcall" (this: ^IMoniker, pbc: ^IBindCtx, pmkToLeft: ^IMoniker, ppszDisplayName: ^LPOLESTR) -> HRESULT, - ParseDisplayName: proc "stdcall" (this: ^IMoniker, pbc: ^IBindCtx, pmkToLeft: ^IMoniker, pszDisplayName: LPOLESTR, pchEaten: ^ULONG, ppmkOut: ^^IMoniker) -> HRESULT, - IsSystemMoniker: proc "stdcall" (this: ^IMoniker, pdwMksys: ^DWORD) -> HRESULT, + BindToObject: proc "system" (this: ^IMoniker, pbc: ^IBindCtx, pmkToLeft: ^IMoniker, riidResult: REFIID, ppvResult: ^rawptr) -> HRESULT, + BindToStorage: proc "system" (this: ^IMoniker, pbc: ^IBindCtx, pmkToLeft: ^IMoniker, riid: REFIID, ppvObj: ^rawptr) -> HRESULT, + Reduce: proc "system" (this: ^IMoniker, pbc: ^IBindCtx, dwReduceHowFar: DWORD, ppmkToLeft: ^^IMoniker, ppmkReduced: ^^IMoniker) -> HRESULT, + ComposeWith: proc "system" (this: ^IMoniker, pmkRight: ^IMoniker, fOnlyIfNotGeneric: BOOL, ppmkComposite: ^^IMoniker) -> HRESULT, + Enum: proc "system" (this: ^IMoniker, fForward: BOOL, ppenumMoniker: ^^IEnumMoniker) -> HRESULT, + IsEqual: proc "system" (this: ^IMoniker, pmkOtherMoniker: ^IMoniker) -> HRESULT, + Hash: proc "system" (this: ^IMoniker, pdwHash: ^DWORD) -> HRESULT, + IsRunning: proc "system" (this: ^IMoniker, pbc: ^IBindCtx, pmkToLeft: ^IMoniker, pmkNewlyRunning: ^IMoniker) -> HRESULT, + GetTimeOfLastChange: proc "system" (this: ^IMoniker, pbc: ^IBindCtx, pmkToLeft: ^IMoniker, pFileTime: ^FILETIME) -> HRESULT, + Inverse: proc "system" (this: ^IMoniker, ppmk: ^^IMoniker) -> HRESULT, + CommonPrefixWith: proc "system" (this: ^IMoniker, pmkOther: ^IMoniker, ppmkPrefix: ^^IMoniker) -> HRESULT, + RelativePathTo: proc "system" (this: ^IMoniker, pmkOther: ^IMoniker, ppmkRelPath: ^^IMoniker) -> HRESULT, + GetDisplayName: proc "system" (this: ^IMoniker, pbc: ^IBindCtx, pmkToLeft: ^IMoniker, ppszDisplayName: ^LPOLESTR) -> HRESULT, + ParseDisplayName: proc "system" (this: ^IMoniker, pbc: ^IBindCtx, pmkToLeft: ^IMoniker, pszDisplayName: LPOLESTR, pchEaten: ^ULONG, ppmkOut: ^^IMoniker) -> HRESULT, + IsSystemMoniker: proc "system" (this: ^IMoniker, pdwMksys: ^DWORD) -> HRESULT, } IEnumMoniker :: struct #raw_union { @@ -3507,10 +3507,10 @@ IEnumMoniker :: struct #raw_union { } IEnumMonikerVtbl :: struct { using IUnknownVtbl: IUnknownVtbl, - Next: proc "stdcall" (this: ^IEnumMoniker, celt: ULONG, rgelt: ^^IMoniker, pceltFetched: ^ULONG) -> HRESULT, - Skip: proc "stdcall" (this: ^IEnumMoniker, celt: ULONG) -> HRESULT, - Reset: proc "stdcall" (this: ^IEnumMoniker) -> HRESULT, - Clone: proc "stdcall" (this: ^IEnumMoniker, ppenum: ^^IEnumMoniker) -> HRESULT, + Next: proc "system" (this: ^IEnumMoniker, celt: ULONG, rgelt: ^^IMoniker, pceltFetched: ^ULONG) -> HRESULT, + Skip: proc "system" (this: ^IEnumMoniker, celt: ULONG) -> HRESULT, + Reset: proc "system" (this: ^IEnumMoniker) -> HRESULT, + Clone: proc "system" (this: ^IEnumMoniker, ppenum: ^^IEnumMoniker) -> HRESULT, } IRunningObjectTable :: struct #raw_union { @@ -3519,13 +3519,13 @@ IRunningObjectTable :: struct #raw_union { } IRunningObjectTableVtbl :: struct { using IUnknownVtbl: IUnknownVtbl, - Register: proc "stdcall" (this: ^IRunningObjectTable, grfFlags: DWORD, punkObject: ^IUnknown, pmkObjectName: ^IMoniker, pdwRegister: ^DWORD) -> HRESULT, - Revoke: proc "stdcall" (this: ^IRunningObjectTable, dwRegister: DWORD) -> HRESULT, - IsRunning: proc "stdcall" (this: ^IRunningObjectTable, pmkObjectName: ^IMoniker) -> HRESULT, - GetObject: proc "stdcall" (this: ^IRunningObjectTable, pmkObjectName: ^IMoniker, ppunkObject: ^^IUnknown) -> HRESULT, - NoteChangeTime: proc "stdcall" (this: ^IRunningObjectTable, dwRegister: DWORD, pfiletime: ^FILETIME) -> HRESULT, - GetTimeOfLastChange: proc "stdcall" (this: ^IRunningObjectTable, pmkObjectName: ^IMoniker, pfiletime: ^FILETIME) -> HRESULT, - EnumRunning: proc "stdcall" (this: ^IRunningObjectTable, ppenumMoniker: ^^IEnumMoniker) -> HRESULT, + Register: proc "system" (this: ^IRunningObjectTable, grfFlags: DWORD, punkObject: ^IUnknown, pmkObjectName: ^IMoniker, pdwRegister: ^DWORD) -> HRESULT, + Revoke: proc "system" (this: ^IRunningObjectTable, dwRegister: DWORD) -> HRESULT, + IsRunning: proc "system" (this: ^IRunningObjectTable, pmkObjectName: ^IMoniker) -> HRESULT, + GetObject: proc "system" (this: ^IRunningObjectTable, pmkObjectName: ^IMoniker, ppunkObject: ^^IUnknown) -> HRESULT, + NoteChangeTime: proc "system" (this: ^IRunningObjectTable, dwRegister: DWORD, pfiletime: ^FILETIME) -> HRESULT, + GetTimeOfLastChange: proc "system" (this: ^IRunningObjectTable, pmkObjectName: ^IMoniker, pfiletime: ^FILETIME) -> HRESULT, + EnumRunning: proc "system" (this: ^IRunningObjectTable, ppenumMoniker: ^^IEnumMoniker) -> HRESULT, } IEnumString :: struct #raw_union { @@ -3534,10 +3534,10 @@ IEnumString :: struct #raw_union { } IEnumStringVtbl :: struct { using IUnknownVtbl: IUnknownVtbl, - Next: proc "stdcall" (this: ^IEnumString, celt: ULONG, rgelt: ^LPOLESTR, pceltFetched: ^ULONG) -> HRESULT, - Skip: proc "stdcall" (this: ^IEnumString, celt: ULONG) -> HRESULT, - Reset: proc "stdcall" (this: ^IEnumString) -> HRESULT, - Clone: proc "stdcall" (this: ^IEnumString, ppenum: ^^IEnumString) -> HRESULT, + Next: proc "system" (this: ^IEnumString, celt: ULONG, rgelt: ^LPOLESTR, pceltFetched: ^ULONG) -> HRESULT, + Skip: proc "system" (this: ^IEnumString, celt: ULONG) -> HRESULT, + Reset: proc "system" (this: ^IEnumString) -> HRESULT, + Clone: proc "system" (this: ^IEnumString, ppenum: ^^IEnumString) -> HRESULT, } IBindCtx :: struct #raw_union { @@ -3546,16 +3546,16 @@ IBindCtx :: struct #raw_union { } IBindCtxVtbl :: struct { using IUnknownVtbl: IUnknownVtbl, - RegisterObjectBound: proc "stdcall" (this: ^IBindCtx, punk: ^IUnknown) -> HRESULT, - RevokeObjectBound: proc "stdcall" (this: ^IBindCtx, punk: ^IUnknown) -> HRESULT, - ReleaseBoundObjects: proc "stdcall" (this: ^IBindCtx) -> HRESULT, - SetBindOptions: proc "stdcall" (this: ^IBindCtx, pbindopts: ^BIND_OPTS) -> HRESULT, - GetBindOptions: proc "stdcall" (this: ^IBindCtx, pbindopts: ^BIND_OPTS) -> HRESULT, - GetRunningObjectTable: proc "stdcall" (this: ^IBindCtx, pprot: ^^IRunningObjectTable) -> HRESULT, - RegisterObjectParam: proc "stdcall" (this: ^IBindCtx, pszKey: LPOLESTR, punk: ^IUnknown) -> HRESULT, - GetObjectParam: proc "stdcall" (this: ^IBindCtx, pszKey: LPOLESTR, ppunk: ^^IUnknown) -> HRESULT, - EnumObjectParam: proc "stdcall" (this: ^IBindCtx, ppenum: ^^IEnumString) -> HRESULT, - RevokeObjectParam: proc "stdcall" (this: ^IBindCtx, pszKey: LPOLESTR) -> HRESULT, + RegisterObjectBound: proc "system" (this: ^IBindCtx, punk: ^IUnknown) -> HRESULT, + RevokeObjectBound: proc "system" (this: ^IBindCtx, punk: ^IUnknown) -> HRESULT, + ReleaseBoundObjects: proc "system" (this: ^IBindCtx) -> HRESULT, + SetBindOptions: proc "system" (this: ^IBindCtx, pbindopts: ^BIND_OPTS) -> HRESULT, + GetBindOptions: proc "system" (this: ^IBindCtx, pbindopts: ^BIND_OPTS) -> HRESULT, + GetRunningObjectTable: proc "system" (this: ^IBindCtx, pprot: ^^IRunningObjectTable) -> HRESULT, + RegisterObjectParam: proc "system" (this: ^IBindCtx, pszKey: LPOLESTR, punk: ^IUnknown) -> HRESULT, + GetObjectParam: proc "system" (this: ^IBindCtx, pszKey: LPOLESTR, ppunk: ^^IUnknown) -> HRESULT, + EnumObjectParam: proc "system" (this: ^IBindCtx, ppenum: ^^IEnumString) -> HRESULT, + RevokeObjectParam: proc "system" (this: ^IBindCtx, pszKey: LPOLESTR) -> HRESULT, } IEnumShellItems :: struct #raw_union { @@ -3564,10 +3564,10 @@ IEnumShellItems :: struct #raw_union { } IEnumShellItemsVtbl :: struct { using IUnknownVtbl: IUnknownVtbl, - Next: proc "stdcall" (this: ^IEnumShellItems, celt: ULONG, rgelt: ^^IShellItem, pceltFetched: ^ULONG) -> HRESULT, - Skip: proc "stdcall" (this: ^IEnumShellItems, celt: ULONG) -> HRESULT, - Reset: proc "stdcall" (this: ^IEnumShellItems) -> HRESULT, - Clone: proc "stdcall" (this: ^IEnumShellItems, ppenum: ^^IEnumShellItems) -> HRESULT, + Next: proc "system" (this: ^IEnumShellItems, celt: ULONG, rgelt: ^^IShellItem, pceltFetched: ^ULONG) -> HRESULT, + Skip: proc "system" (this: ^IEnumShellItems, celt: ULONG) -> HRESULT, + Reset: proc "system" (this: ^IEnumShellItems) -> HRESULT, + Clone: proc "system" (this: ^IEnumShellItems, ppenum: ^^IEnumShellItems) -> HRESULT, } IShellItem :: struct #raw_union { @@ -3576,11 +3576,11 @@ IShellItem :: struct #raw_union { } IShellItemVtbl :: struct { using IUnknownVtbl: IUnknownVtbl, - BindToHandler: proc "stdcall" (this: ^IShellItem, pbc: ^IBindCtx, bhid: REFGUID, riid: REFIID, ppv: ^rawptr) -> HRESULT, - GetParent: proc "stdcall" (this: ^IShellItem, ppsiFolder: ^^IShellItem) -> HRESULT, - GetDisplayName: proc "stdcall" (this: ^IShellItem, sigdnName: SIGDN, ppszName: ^LPWSTR) -> HRESULT, - GetAttributes: proc "stdcall" (this: ^IShellItem, sfgaoMask: SFGAOF, psfgaoAttribs: ^SFGAOF) -> HRESULT, - Compare: proc "stdcall" (this: ^IShellItem, psi: ^IShellItem, hint: SICHINTF, piOrder: ^c_int) -> HRESULT, + BindToHandler: proc "system" (this: ^IShellItem, pbc: ^IBindCtx, bhid: REFGUID, riid: REFIID, ppv: ^rawptr) -> HRESULT, + GetParent: proc "system" (this: ^IShellItem, ppsiFolder: ^^IShellItem) -> HRESULT, + GetDisplayName: proc "system" (this: ^IShellItem, sigdnName: SIGDN, ppszName: ^LPWSTR) -> HRESULT, + GetAttributes: proc "system" (this: ^IShellItem, sfgaoMask: SFGAOF, psfgaoAttribs: ^SFGAOF) -> HRESULT, + Compare: proc "system" (this: ^IShellItem, psi: ^IShellItem, hint: SICHINTF, piOrder: ^c_int) -> HRESULT, } IShellItemArray :: struct #raw_union { @@ -3589,13 +3589,13 @@ IShellItemArray :: struct #raw_union { } IShellItemArrayVtbl :: struct { using IUnknownVtbl: IUnknownVtbl, - BindToHandler: proc "stdcall" (this: ^IShellItemArray, pbc: ^IBindCtx, bhid: REFGUID, riid: REFIID, ppvOut: ^rawptr) -> HRESULT, - GetPropertyStore: proc "stdcall" (this: ^IShellItemArray, flags: GETPROPERTYSTOREFLAGS, riid: REFIID, ppv: ^rawptr) -> HRESULT, - GetPropertyDescriptionList: proc "stdcall" (this: ^IShellItemArray, keyType: REFPROPERTYKEY, riid: REFIID, ppv: ^rawptr) -> HRESULT, - GetAttributes: proc "stdcall" (this: ^IShellItemArray, AttribFlags: SIATTRIBFLAGS, sfgaoMask: SFGAOF, psfgaoAttribs: ^SFGAOF) -> HRESULT, - GetCount: proc "stdcall" (this: ^IShellItemArray, pdwNumItems: ^DWORD) -> HRESULT, - GetItemAt: proc "stdcall" (this: ^IShellItemArray, dwIndex: DWORD, ppsi: ^^IShellItem) -> HRESULT, - EnumItems: proc "stdcall" (this: ^IShellItemArray, ppenumShellItems: ^^IEnumShellItems) -> HRESULT, + BindToHandler: proc "system" (this: ^IShellItemArray, pbc: ^IBindCtx, bhid: REFGUID, riid: REFIID, ppvOut: ^rawptr) -> HRESULT, + GetPropertyStore: proc "system" (this: ^IShellItemArray, flags: GETPROPERTYSTOREFLAGS, riid: REFIID, ppv: ^rawptr) -> HRESULT, + GetPropertyDescriptionList: proc "system" (this: ^IShellItemArray, keyType: REFPROPERTYKEY, riid: REFIID, ppv: ^rawptr) -> HRESULT, + GetAttributes: proc "system" (this: ^IShellItemArray, AttribFlags: SIATTRIBFLAGS, sfgaoMask: SFGAOF, psfgaoAttribs: ^SFGAOF) -> HRESULT, + GetCount: proc "system" (this: ^IShellItemArray, pdwNumItems: ^DWORD) -> HRESULT, + GetItemAt: proc "system" (this: ^IShellItemArray, dwIndex: DWORD, ppsi: ^^IShellItem) -> HRESULT, + EnumItems: proc "system" (this: ^IShellItemArray, ppenumShellItems: ^^IEnumShellItems) -> HRESULT, } IFileDialogEvents :: struct #raw_union { @@ -3604,13 +3604,13 @@ IFileDialogEvents :: struct #raw_union { } IFileDialogEventsVtbl :: struct { using IUnknownVtbl: IUnknownVtbl, - OnFileOk: proc "stdcall" (this: ^IFileDialogEvents, pfd: ^IFileDialog) -> HRESULT, - OnFolderChanging: proc "stdcall" (this: ^IFileDialogEvents, pfd: ^IFileDialog, psiFolder: ^IShellItem) -> HRESULT, - OnFolderChange: proc "stdcall" (this: ^IFileDialogEvents, pfd: ^IFileDialog) -> HRESULT, - OnSelectionChange: proc "stdcall" (this: ^IFileDialogEvents, pfd: ^IFileDialog) -> HRESULT, - OnShareViolation: proc "stdcall" (this: ^IFileDialogEvents, pfd: ^IFileDialog, psi: ^IShellItem, pResponse: ^FDE_SHAREVIOLATION_RESPONSE) -> HRESULT, - OnTypeChange: proc "stdcall" (this: ^IFileDialogEvents, pfd: ^IFileDialog) -> HRESULT, - OnOverwrite: proc "stdcall" (this: ^IFileDialogEvents, pfd: ^IFileDialog, psi: ^IShellItem, pResponse: ^FDE_SHAREVIOLATION_RESPONSE) -> HRESULT, + OnFileOk: proc "system" (this: ^IFileDialogEvents, pfd: ^IFileDialog) -> HRESULT, + OnFolderChanging: proc "system" (this: ^IFileDialogEvents, pfd: ^IFileDialog, psiFolder: ^IShellItem) -> HRESULT, + OnFolderChange: proc "system" (this: ^IFileDialogEvents, pfd: ^IFileDialog) -> HRESULT, + OnSelectionChange: proc "system" (this: ^IFileDialogEvents, pfd: ^IFileDialog) -> HRESULT, + OnShareViolation: proc "system" (this: ^IFileDialogEvents, pfd: ^IFileDialog, psi: ^IShellItem, pResponse: ^FDE_SHAREVIOLATION_RESPONSE) -> HRESULT, + OnTypeChange: proc "system" (this: ^IFileDialogEvents, pfd: ^IFileDialog) -> HRESULT, + OnOverwrite: proc "system" (this: ^IFileDialogEvents, pfd: ^IFileDialog, psi: ^IShellItem, pResponse: ^FDE_SHAREVIOLATION_RESPONSE) -> HRESULT, } IShellItemFilter :: struct #raw_union { @@ -3619,8 +3619,8 @@ IShellItemFilter :: struct #raw_union { } IShellItemFilterVtbl :: struct { using IUnknownVtbl: IUnknownVtbl, - IncludeItem: proc "stdcall" (this: ^IShellItemFilter, psi: ^IShellItem) -> HRESULT, - GetEnumFlagsForItem: proc "stdcall" (this: ^IShellItemFilter, psi: ^IShellItem, pgrfFlags: ^SHCONTF) -> HRESULT, + IncludeItem: proc "system" (this: ^IShellItemFilter, psi: ^IShellItem) -> HRESULT, + GetEnumFlagsForItem: proc "system" (this: ^IShellItemFilter, psi: ^IShellItem, pgrfFlags: ^SHCONTF) -> HRESULT, } IFileDialog :: struct #raw_union { @@ -3629,29 +3629,29 @@ IFileDialog :: struct #raw_union { } IFileDialogVtbl :: struct { using IModalWindowVtbl: IModalWindowVtbl, - SetFileTypes: proc "stdcall" (this: ^IFileDialog, cFileTypes: UINT, rgFilterSpec: ^COMDLG_FILTERSPEC) -> HRESULT, - SetFileTypeIndex: proc "stdcall" (this: ^IFileDialog, iFileType: UINT) -> HRESULT, - GetFileTypeIndex: proc "stdcall" (this: ^IFileDialog, piFileType: ^UINT) -> HRESULT, - Advise: proc "stdcall" (this: ^IFileDialog, pfde: ^IFileDialogEvents, pdwCookie: ^DWORD) -> HRESULT, - Unadvise: proc "stdcall" (this: ^IFileDialog, dwCookie: DWORD) -> HRESULT, - SetOptions: proc "stdcall" (this: ^IFileDialog, fos: FILEOPENDIALOGOPTIONS) -> HRESULT, - GetOptions: proc "stdcall" (this: ^IFileDialog, pfos: ^FILEOPENDIALOGOPTIONS) -> HRESULT, - SetDefaultFolder: proc "stdcall" (this: ^IFileDialog, psi: ^IShellItem) -> HRESULT, - SetFolder: proc "stdcall" (this: ^IFileDialog, psi: ^IShellItem) -> HRESULT, - GetFolder: proc "stdcall" (this: ^IFileDialog, ppsi: ^^IShellItem) -> HRESULT, - GetCurrentSelection: proc "stdcall" (this: ^IFileDialog, ppsi: ^^IShellItem) -> HRESULT, - SetFileName: proc "stdcall" (this: ^IFileDialog, pszName: LPCWSTR) -> HRESULT, - GetFileName: proc "stdcall" (this: ^IFileDialog, pszName: ^LPCWSTR) -> HRESULT, - SetTitle: proc "stdcall" (this: ^IFileDialog, pszTitle: LPCWSTR) -> HRESULT, - SetOkButtonLabel: proc "stdcall" (this: ^IFileDialog, pszText: LPCWSTR) -> HRESULT, - SetFileNameLabel: proc "stdcall" (this: ^IFileDialog, pszLabel: LPCWSTR) -> HRESULT, - GetResult: proc "stdcall" (this: ^IFileDialog, ppsi: ^^IShellItem) -> HRESULT, - AddPlace: proc "stdcall" (this: ^IFileDialog, psi: ^IShellItem, fdap: FDAP) -> HRESULT, - SetDefaultExtension: proc "stdcall" (this: ^IFileDialog, pszDefaultExtension: LPCWSTR) -> HRESULT, - Close: proc "stdcall" (this: ^IFileDialog, hr: HRESULT) -> HRESULT, - SetClientGuid: proc "stdcall" (this: ^IFileDialog, guid: REFGUID) -> HRESULT, - ClearClientData: proc "stdcall" (this: ^IFileDialog) -> HRESULT, - SetFilter: proc "stdcall" (this: ^IFileDialog, pFilter: ^IShellItemFilter) -> HRESULT, + SetFileTypes: proc "system" (this: ^IFileDialog, cFileTypes: UINT, rgFilterSpec: ^COMDLG_FILTERSPEC) -> HRESULT, + SetFileTypeIndex: proc "system" (this: ^IFileDialog, iFileType: UINT) -> HRESULT, + GetFileTypeIndex: proc "system" (this: ^IFileDialog, piFileType: ^UINT) -> HRESULT, + Advise: proc "system" (this: ^IFileDialog, pfde: ^IFileDialogEvents, pdwCookie: ^DWORD) -> HRESULT, + Unadvise: proc "system" (this: ^IFileDialog, dwCookie: DWORD) -> HRESULT, + SetOptions: proc "system" (this: ^IFileDialog, fos: FILEOPENDIALOGOPTIONS) -> HRESULT, + GetOptions: proc "system" (this: ^IFileDialog, pfos: ^FILEOPENDIALOGOPTIONS) -> HRESULT, + SetDefaultFolder: proc "system" (this: ^IFileDialog, psi: ^IShellItem) -> HRESULT, + SetFolder: proc "system" (this: ^IFileDialog, psi: ^IShellItem) -> HRESULT, + GetFolder: proc "system" (this: ^IFileDialog, ppsi: ^^IShellItem) -> HRESULT, + GetCurrentSelection: proc "system" (this: ^IFileDialog, ppsi: ^^IShellItem) -> HRESULT, + SetFileName: proc "system" (this: ^IFileDialog, pszName: LPCWSTR) -> HRESULT, + GetFileName: proc "system" (this: ^IFileDialog, pszName: ^LPCWSTR) -> HRESULT, + SetTitle: proc "system" (this: ^IFileDialog, pszTitle: LPCWSTR) -> HRESULT, + SetOkButtonLabel: proc "system" (this: ^IFileDialog, pszText: LPCWSTR) -> HRESULT, + SetFileNameLabel: proc "system" (this: ^IFileDialog, pszLabel: LPCWSTR) -> HRESULT, + GetResult: proc "system" (this: ^IFileDialog, ppsi: ^^IShellItem) -> HRESULT, + AddPlace: proc "system" (this: ^IFileDialog, psi: ^IShellItem, fdap: FDAP) -> HRESULT, + SetDefaultExtension: proc "system" (this: ^IFileDialog, pszDefaultExtension: LPCWSTR) -> HRESULT, + Close: proc "system" (this: ^IFileDialog, hr: HRESULT) -> HRESULT, + SetClientGuid: proc "system" (this: ^IFileDialog, guid: REFGUID) -> HRESULT, + ClearClientData: proc "system" (this: ^IFileDialog) -> HRESULT, + SetFilter: proc "system" (this: ^IFileDialog, pFilter: ^IShellItemFilter) -> HRESULT, } IFileOpenDialog :: struct #raw_union { @@ -3660,8 +3660,8 @@ IFileOpenDialog :: struct #raw_union { } IFileOpenDialogVtbl :: struct { using IFileDialogVtbl: IFileDialogVtbl, - GetResults: proc "stdcall" (this: ^IFileOpenDialog, ppenum: ^^IShellItemArray) -> HRESULT, - GetSelectedItems: proc "stdcall" (this: ^IFileOpenDialog, ppsai: ^^IShellItemArray) -> HRESULT, + GetResults: proc "system" (this: ^IFileOpenDialog, ppenum: ^^IShellItemArray) -> HRESULT, + GetSelectedItems: proc "system" (this: ^IFileOpenDialog, ppsai: ^^IShellItemArray) -> HRESULT, } IPropertyStore :: struct #raw_union { @@ -3670,11 +3670,11 @@ IPropertyStore :: struct #raw_union { } IPropertyStoreVtbl :: struct { using IUnknownVtbl: IUnknownVtbl, - GetCount: proc "stdcall" (this: ^IPropertyStore, cProps: ^DWORD) -> HRESULT, - GetAt: proc "stdcall" (this: ^IPropertyStore, iProp: DWORD, pkey: ^PROPERTYKEY) -> HRESULT, - GetValue: proc "stdcall" (this: ^IPropertyStore, key: REFPROPERTYKEY, pv: ^PROPVARIANT) -> HRESULT, - SetValue: proc "stdcall" (this: ^IPropertyStore, key: REFPROPERTYKEY, propvar: REFPROPVARIANT) -> HRESULT, - Commit: proc "stdcall" (this: ^IPropertyStore) -> HRESULT, + GetCount: proc "system" (this: ^IPropertyStore, cProps: ^DWORD) -> HRESULT, + GetAt: proc "system" (this: ^IPropertyStore, iProp: DWORD, pkey: ^PROPERTYKEY) -> HRESULT, + GetValue: proc "system" (this: ^IPropertyStore, key: REFPROPERTYKEY, pv: ^PROPVARIANT) -> HRESULT, + SetValue: proc "system" (this: ^IPropertyStore, key: REFPROPERTYKEY, propvar: REFPROPVARIANT) -> HRESULT, + Commit: proc "system" (this: ^IPropertyStore) -> HRESULT, } IPropertyDescriptionList :: struct #raw_union { @@ -3683,8 +3683,8 @@ IPropertyDescriptionList :: struct #raw_union { } IPropertyDescriptionListVtbl :: struct { using IUnknownVtbl: IUnknownVtbl, - GetCount: proc "stdcall" (this: ^IPropertyDescriptionList, pcElem: ^UINT) -> HRESULT, - GetAt: proc "stdcall" (this: ^IPropertyDescriptionList, iElem: UINT, riid: REFIID, ppv: ^rawptr) -> HRESULT, + GetCount: proc "system" (this: ^IPropertyDescriptionList, pcElem: ^UINT) -> HRESULT, + GetAt: proc "system" (this: ^IPropertyDescriptionList, iElem: UINT, riid: REFIID, ppv: ^rawptr) -> HRESULT, } IFileOperationProgressSink :: struct #raw_union { @@ -3693,22 +3693,22 @@ IFileOperationProgressSink :: struct #raw_union { } IFileOperationProgressSinkVtbl :: struct { using IUnknownVtbl: IUnknownVtbl, - StartOperations: proc "stdcall" (this: ^IFileOperationProgressSink) -> HRESULT, - FinishOperations: proc "stdcall" (this: ^IFileOperationProgressSink, hrResult: HRESULT) -> HRESULT, - PreRenameItem: proc "stdcall" (this: ^IFileOperationProgressSink, dwFlags: DWORD, psiItem: ^IShellItem, pszNewName: LPCWSTR) -> HRESULT, - PostRenameItem: proc "stdcall" (this: ^IFileOperationProgressSink, dwFlags: DWORD, psiItem: ^IShellItem, pszNewName: LPCWSTR, hrRename: HRESULT, psiNewlyCreated: ^IShellItem) -> HRESULT, - PreMoveItem: proc "stdcall" (this: ^IFileOperationProgressSink, dwFlags: DWORD, psiItem: ^IShellItem, psiDestinationFolder: ^IShellItem, pszNewName: LPCWSTR) -> HRESULT, - PostMoveItem: proc "stdcall" (this: ^IFileOperationProgressSink, dwFlags: DWORD, psiItem: ^IShellItem, psiDestinationFolder: ^IShellItem, pszNewName: LPCWSTR, hrMove: HRESULT, psiNewlyCreated: ^IShellItem) -> HRESULT, - PreCopyItem: proc "stdcall" (this: ^IFileOperationProgressSink, dwFlags: DWORD, psiItem: ^IShellItem, psiDestinationFolder: ^IShellItem, pszNewName: LPCWSTR) -> HRESULT, - PostCopyItem: proc "stdcall" (this: ^IFileOperationProgressSink, dwFlags: DWORD, psiItem: ^IShellItem, psiDestinationFolder: ^IShellItem, pszNewName: LPCWSTR, hrMove: HRESULT, psiNewlyCreated: ^IShellItem) -> HRESULT, - PreDeleteItem: proc "stdcall" (this: ^IFileOperationProgressSink, dwFlags: DWORD, psiItem: ^IShellItem) -> HRESULT, - PostDeleteItem: proc "stdcall" (this: ^IFileOperationProgressSink, dwFlags: DWORD, psiItem: ^IShellItem, hrDelete: HRESULT, psiNewlyCreated: ^IShellItem) -> HRESULT, - PreNewItem: proc "stdcall" (this: ^IFileOperationProgressSink, dwFlags: DWORD, psiDestinationFolder: ^IShellItem, pszNewName: LPCWSTR) -> HRESULT, - PostNewItem: proc "stdcall" (this: ^IFileOperationProgressSink, dwFlags: DWORD, psiDestinationFolder: ^IShellItem, pszNewName: LPCWSTR, pszTemplateName: LPCWSTR, dwFileAttributes: DWORD, hrNew: HRESULT, psiNewItem: ^IShellItem) -> HRESULT, - UpdateProgress: proc "stdcall" (this: ^IFileOperationProgressSink, iWorkTotal: UINT, iWorkSoFar: UINT) -> HRESULT, - ResetTimer: proc "stdcall" (this: ^IFileOperationProgressSink) -> HRESULT, - PauseTimer: proc "stdcall" (this: ^IFileOperationProgressSink) -> HRESULT, - ResumeTimer: proc "stdcall" (this: ^IFileOperationProgressSink) -> HRESULT, + StartOperations: proc "system" (this: ^IFileOperationProgressSink) -> HRESULT, + FinishOperations: proc "system" (this: ^IFileOperationProgressSink, hrResult: HRESULT) -> HRESULT, + PreRenameItem: proc "system" (this: ^IFileOperationProgressSink, dwFlags: DWORD, psiItem: ^IShellItem, pszNewName: LPCWSTR) -> HRESULT, + PostRenameItem: proc "system" (this: ^IFileOperationProgressSink, dwFlags: DWORD, psiItem: ^IShellItem, pszNewName: LPCWSTR, hrRename: HRESULT, psiNewlyCreated: ^IShellItem) -> HRESULT, + PreMoveItem: proc "system" (this: ^IFileOperationProgressSink, dwFlags: DWORD, psiItem: ^IShellItem, psiDestinationFolder: ^IShellItem, pszNewName: LPCWSTR) -> HRESULT, + PostMoveItem: proc "system" (this: ^IFileOperationProgressSink, dwFlags: DWORD, psiItem: ^IShellItem, psiDestinationFolder: ^IShellItem, pszNewName: LPCWSTR, hrMove: HRESULT, psiNewlyCreated: ^IShellItem) -> HRESULT, + PreCopyItem: proc "system" (this: ^IFileOperationProgressSink, dwFlags: DWORD, psiItem: ^IShellItem, psiDestinationFolder: ^IShellItem, pszNewName: LPCWSTR) -> HRESULT, + PostCopyItem: proc "system" (this: ^IFileOperationProgressSink, dwFlags: DWORD, psiItem: ^IShellItem, psiDestinationFolder: ^IShellItem, pszNewName: LPCWSTR, hrMove: HRESULT, psiNewlyCreated: ^IShellItem) -> HRESULT, + PreDeleteItem: proc "system" (this: ^IFileOperationProgressSink, dwFlags: DWORD, psiItem: ^IShellItem) -> HRESULT, + PostDeleteItem: proc "system" (this: ^IFileOperationProgressSink, dwFlags: DWORD, psiItem: ^IShellItem, hrDelete: HRESULT, psiNewlyCreated: ^IShellItem) -> HRESULT, + PreNewItem: proc "system" (this: ^IFileOperationProgressSink, dwFlags: DWORD, psiDestinationFolder: ^IShellItem, pszNewName: LPCWSTR) -> HRESULT, + PostNewItem: proc "system" (this: ^IFileOperationProgressSink, dwFlags: DWORD, psiDestinationFolder: ^IShellItem, pszNewName: LPCWSTR, pszTemplateName: LPCWSTR, dwFileAttributes: DWORD, hrNew: HRESULT, psiNewItem: ^IShellItem) -> HRESULT, + UpdateProgress: proc "system" (this: ^IFileOperationProgressSink, iWorkTotal: UINT, iWorkSoFar: UINT) -> HRESULT, + ResetTimer: proc "system" (this: ^IFileOperationProgressSink) -> HRESULT, + PauseTimer: proc "system" (this: ^IFileOperationProgressSink) -> HRESULT, + ResumeTimer: proc "system" (this: ^IFileOperationProgressSink) -> HRESULT, } IFileSaveDialog :: struct #raw_union { @@ -3717,11 +3717,11 @@ IFileSaveDialog :: struct #raw_union { } IFileSaveDialogVtbl :: struct { using IFileDialogVtbl: IFileDialogVtbl, - SetSaveAsItem: proc "stdcall" (this: ^IFileSaveDialog, psi: ^IShellItem) -> HRESULT, - SetProperties: proc "stdcall" (this: ^IFileSaveDialog, pStore: ^IPropertyStore) -> HRESULT, - SetCollectedProperties: proc "stdcall" (this: ^IFileSaveDialog, pList: ^IPropertyDescriptionList, fAppendDefault: BOOL) -> HRESULT, - GetProperties: proc "stdcall" (this: ^IFileSaveDialog, ppStore: ^^IPropertyStore) -> HRESULT, - ApplyProperties: proc "stdcall" (this: ^IFileSaveDialog, psi: ^IShellItem, pStore: ^IPropertyStore, hwnd: HWND, pSink: ^IFileOperationProgressSink) -> HRESULT, + SetSaveAsItem: proc "system" (this: ^IFileSaveDialog, psi: ^IShellItem) -> HRESULT, + SetProperties: proc "system" (this: ^IFileSaveDialog, pStore: ^IPropertyStore) -> HRESULT, + SetCollectedProperties: proc "system" (this: ^IFileSaveDialog, pList: ^IPropertyDescriptionList, fAppendDefault: BOOL) -> HRESULT, + GetProperties: proc "system" (this: ^IFileSaveDialog, ppStore: ^^IPropertyStore) -> HRESULT, + ApplyProperties: proc "system" (this: ^IFileSaveDialog, psi: ^IShellItem, pStore: ^IPropertyStore, hwnd: HWND, pSink: ^IFileOperationProgressSink) -> HRESULT, } ITaskbarList :: struct #raw_union { @@ -3730,11 +3730,11 @@ ITaskbarList :: struct #raw_union { } ITaskbarListVtbl :: struct { using IUnknownVtbl: IUnknownVtbl, - HrInit: proc "stdcall" (this: ^ITaskbarList) -> HRESULT, - AddTab: proc "stdcall" (this: ^ITaskbarList, hwnd: HWND) -> HRESULT, - DeleteTab: proc "stdcall" (this: ^ITaskbarList, hwnd: HWND) -> HRESULT, - ActivateTab: proc "stdcall" (this: ^ITaskbarList, hwnd: HWND) -> HRESULT, - SetActiveAlt: proc "stdcall" (this: ^ITaskbarList, hwnd: HWND) -> HRESULT, + HrInit: proc "system" (this: ^ITaskbarList) -> HRESULT, + AddTab: proc "system" (this: ^ITaskbarList, hwnd: HWND) -> HRESULT, + DeleteTab: proc "system" (this: ^ITaskbarList, hwnd: HWND) -> HRESULT, + ActivateTab: proc "system" (this: ^ITaskbarList, hwnd: HWND) -> HRESULT, + SetActiveAlt: proc "system" (this: ^ITaskbarList, hwnd: HWND) -> HRESULT, } ITaskbarList2 :: struct #raw_union { @@ -3743,7 +3743,7 @@ ITaskbarList2 :: struct #raw_union { } ITaskbarList2Vtbl :: struct { using ITaskbarListVtbl: ITaskbarListVtbl, - MarkFullscreenWindow: proc "stdcall" (this: ^ITaskbarList2, hwnd: HWND, fFullscreen: BOOL) -> HRESULT, + MarkFullscreenWindow: proc "system" (this: ^ITaskbarList2, hwnd: HWND, fFullscreen: BOOL) -> HRESULT, } TBPFLAG :: enum c_int { @@ -3788,18 +3788,18 @@ ITaskbarList3 :: struct #raw_union { } ITaskbarList3Vtbl :: struct { using ITaskbarList2Vtbl: ITaskbarList2Vtbl, - SetProgressValue: proc "stdcall" (this: ^ITaskbarList3, hwnd: HWND, ullCompleted: ULONGLONG, ullTotal: ULONGLONG) -> HRESULT, - SetProgressState: proc "stdcall" (this: ^ITaskbarList3, hwnd: HWND, tbpFlags: TBPFLAG) -> HRESULT, - RegisterTab: proc "stdcall" (this: ^ITaskbarList3, hwndTab: HWND, hwndMDI: HWND) -> HRESULT, - UnregisterTab: proc "stdcall" (this: ^ITaskbarList3, hwndTab: HWND) -> HRESULT, - SetTabOrder: proc "stdcall" (this: ^ITaskbarList3, hwndTab: HWND, hwndInsertBefore: HWND) -> HRESULT, - SetTabActive: proc "stdcall" (this: ^ITaskbarList3, hwndTab: HWND, hwndMDI: HWND, dwReserved: DWORD) -> HRESULT, - ThumbBarAddButtons: proc "stdcall" (this: ^ITaskbarList3, hwnd: HWND, cButtons: UINT, pButton: LPTHUMBBUTTON) -> HRESULT, - ThumbBarUpdateButtons: proc "stdcall" (this: ^ITaskbarList3, hwnd: HWND, cButtons: UINT, pButton: LPTHUMBBUTTON) -> HRESULT, - ThumbBarSetImageList: proc "stdcall" (this: ^ITaskbarList3, hwnd: HWND, himl: HIMAGELIST) -> HRESULT, - SetOverlayIcon: proc "stdcall" (this: ^ITaskbarList3, hwnd: HWND, hIcon: HICON, pszDescription: LPCWSTR) -> HRESULT, - SetThumbnailTooltip: proc "stdcall" (this: ^ITaskbarList3, hwnd: HWND, pszTip: LPCWSTR) -> HRESULT, - SetThumbnailClip: proc "stdcall" (this: ^ITaskbarList3, hwnd: HWND, prcClip: ^RECT) -> HRESULT, + SetProgressValue: proc "system" (this: ^ITaskbarList3, hwnd: HWND, ullCompleted: ULONGLONG, ullTotal: ULONGLONG) -> HRESULT, + SetProgressState: proc "system" (this: ^ITaskbarList3, hwnd: HWND, tbpFlags: TBPFLAG) -> HRESULT, + RegisterTab: proc "system" (this: ^ITaskbarList3, hwndTab: HWND, hwndMDI: HWND) -> HRESULT, + UnregisterTab: proc "system" (this: ^ITaskbarList3, hwndTab: HWND) -> HRESULT, + SetTabOrder: proc "system" (this: ^ITaskbarList3, hwndTab: HWND, hwndInsertBefore: HWND) -> HRESULT, + SetTabActive: proc "system" (this: ^ITaskbarList3, hwndTab: HWND, hwndMDI: HWND, dwReserved: DWORD) -> HRESULT, + ThumbBarAddButtons: proc "system" (this: ^ITaskbarList3, hwnd: HWND, cButtons: UINT, pButton: LPTHUMBBUTTON) -> HRESULT, + ThumbBarUpdateButtons: proc "system" (this: ^ITaskbarList3, hwnd: HWND, cButtons: UINT, pButton: LPTHUMBBUTTON) -> HRESULT, + ThumbBarSetImageList: proc "system" (this: ^ITaskbarList3, hwnd: HWND, himl: HIMAGELIST) -> HRESULT, + SetOverlayIcon: proc "system" (this: ^ITaskbarList3, hwnd: HWND, hIcon: HICON, pszDescription: LPCWSTR) -> HRESULT, + SetThumbnailTooltip: proc "system" (this: ^ITaskbarList3, hwnd: HWND, pszTip: LPCWSTR) -> HRESULT, + SetThumbnailClip: proc "system" (this: ^ITaskbarList3, hwnd: HWND, prcClip: ^RECT) -> HRESULT, } MEMORYSTATUSEX :: struct { diff --git a/core/sys/windows/user32.odin b/core/sys/windows/user32.odin index 81884f3da..0c92adca4 100644 --- a/core/sys/windows/user32.odin +++ b/core/sys/windows/user32.odin @@ -3,7 +3,7 @@ package sys_windows foreign import user32 "system:User32.lib" -@(default_calling_convention="stdcall") +@(default_calling_convention="system") foreign user32 { GetClassInfoW :: proc(hInstance: HINSTANCE, lpClassNAme: LPCWSTR, lpWndClass: ^WNDCLASSW) -> BOOL --- GetClassInfoExW :: proc(hInsatnce: HINSTANCE, lpszClass: LPCWSTR, lpwcx: ^WNDCLASSEXW) -> BOOL --- @@ -236,7 +236,7 @@ foreign user32 { EnableMenuItem :: proc(hMenu: HMENU, uIDEnableItem: UINT, uEnable: UINT) -> BOOL --- } -CreateWindowW :: #force_inline proc "stdcall" ( +CreateWindowW :: #force_inline proc "system" ( lpClassName: LPCTSTR, lpWindowName: LPCTSTR, dwStyle: DWORD, @@ -266,7 +266,7 @@ CreateWindowW :: #force_inline proc "stdcall" ( } when ODIN_ARCH == .amd64 { - @(default_calling_convention="stdcall") + @(default_calling_convention="system") foreign user32 { GetClassLongPtrW :: proc(hWnd: HWND, nIndex: c_int) -> ULONG_PTR --- SetClassLongPtrW :: proc(hWnd: HWND, nIndex: c_int, dwNewLong: LONG_PTR) -> ULONG_PTR --- @@ -312,8 +312,8 @@ Monitor_From_Flags :: enum DWORD { MONITOR_DEFAULTTONEAREST = 0x00000002, // Returns a handle to the display monitor that is nearest to the window } -Monitor_Enum_Proc :: #type proc "stdcall" (HMONITOR, HDC, LPRECT, LPARAM) -> BOOL -Window_Enum_Proc :: #type proc "stdcall" (HWND, LPARAM) -> BOOL +Monitor_Enum_Proc :: #type proc "system" (HMONITOR, HDC, LPRECT, LPARAM) -> BOOL +Window_Enum_Proc :: #type proc "system" (HWND, LPARAM) -> BOOL USER_DEFAULT_SCREEN_DPI :: 96 DPI_AWARENESS_CONTEXT :: distinct HANDLE diff --git a/core/sys/windows/userenv.odin b/core/sys/windows/userenv.odin index 92bc09a7e..a31e363e1 100644 --- a/core/sys/windows/userenv.odin +++ b/core/sys/windows/userenv.odin @@ -3,7 +3,7 @@ package sys_windows foreign import userenv "system:Userenv.lib" -@(default_calling_convention="stdcall") +@(default_calling_convention="system") foreign userenv { GetUserProfileDirectoryW :: proc(hToken: HANDLE, lpProfileDir: LPWSTR, diff --git a/core/sys/windows/ux_theme.odin b/core/sys/windows/ux_theme.odin index 39b489bc0..7af399361 100644 --- a/core/sys/windows/ux_theme.odin +++ b/core/sys/windows/ux_theme.odin @@ -6,7 +6,7 @@ foreign import uxtheme "system:UxTheme.lib" MARGINS :: distinct [4]int PMARGINS :: ^MARGINS -@(default_calling_convention="stdcall") +@(default_calling_convention="system") foreign uxtheme { IsThemeActive :: proc() -> BOOL --- } diff --git a/core/sys/windows/wgl.odin b/core/sys/windows/wgl.odin index 77cff2fa9..d0d96d90b 100644 --- a/core/sys/windows/wgl.odin +++ b/core/sys/windows/wgl.odin @@ -66,7 +66,7 @@ GetExtensionsStringARBType :: #type proc "c" (HDC) -> cstring wglGetExtensionsStringARB: GetExtensionsStringARBType -@(default_calling_convention="stdcall") +@(default_calling_convention="system") foreign Opengl32 { wglCreateContext :: proc(hdc: HDC) -> HGLRC --- wglMakeCurrent :: proc(hdc: HDC, HGLRC: HGLRC) -> BOOL --- diff --git a/core/sys/windows/winmm.odin b/core/sys/windows/winmm.odin index 445470f6e..0807df8de 100644 --- a/core/sys/windows/winmm.odin +++ b/core/sys/windows/winmm.odin @@ -5,7 +5,7 @@ foreign import winmm "system:Winmm.lib" MMRESULT :: UINT -@(default_calling_convention="stdcall") +@(default_calling_convention="system") foreign winmm { timeGetDevCaps :: proc(ptc: LPTIMECAPS, cbtc: UINT) -> MMRESULT --- timeBeginPeriod :: proc(uPeriod: UINT) -> MMRESULT --- diff --git a/core/sys/windows/ws2_32.odin b/core/sys/windows/ws2_32.odin index 1b79be584..c60a21a36 100644 --- a/core/sys/windows/ws2_32.odin +++ b/core/sys/windows/ws2_32.odin @@ -56,7 +56,7 @@ Example Load: */ foreign import ws2_32 "system:Ws2_32.lib" -@(default_calling_convention="stdcall") +@(default_calling_convention="system") foreign ws2_32 { // [MS-Docs](https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsastartup) WSAStartup :: proc(wVersionRequested: WORD, lpWSAData: LPWSADATA) -> c_int --- diff --git a/core/testing/runner_windows.odin b/core/testing/runner_windows.odin index 17bcfce26..dbb9ed1c0 100644 --- a/core/testing/runner_windows.odin +++ b/core/testing/runner_windows.odin @@ -90,7 +90,7 @@ Thread_Os_Specific :: struct { } thread_create :: proc(procedure: Thread_Proc) -> ^Thread { - __windows_thread_entry_proc :: proc "stdcall" (t_: rawptr) -> win32.DWORD { + __windows_thread_entry_proc :: proc "system" (t_: rawptr) -> win32.DWORD { t := (^Thread)(t_) context = t.init_context.? or_else runtime.default_context() @@ -172,7 +172,7 @@ global_current_t: ^T run_internal_test :: proc(t: ^T, it: Internal_Test) { thread := thread_create(proc(thread: ^Thread) { - exception_handler_proc :: proc "stdcall" (ExceptionInfo: ^win32.EXCEPTION_POINTERS) -> win32.LONG { + exception_handler_proc :: proc "system" (ExceptionInfo: ^win32.EXCEPTION_POINTERS) -> win32.LONG { switch ExceptionInfo.ExceptionRecord.ExceptionCode { case win32.EXCEPTION_DATATYPE_MISALIGNMENT, diff --git a/core/thread/thread_windows.odin b/core/thread/thread_windows.odin index 2d6cad1ad..28b2294d1 100644 --- a/core/thread/thread_windows.odin +++ b/core/thread/thread_windows.odin @@ -21,7 +21,7 @@ _thread_priority_map := [Thread_Priority]i32{ _create :: proc(procedure: Thread_Proc, priority: Thread_Priority) -> ^Thread { win32_thread_id: win32.DWORD - __windows_thread_entry_proc :: proc "stdcall" (t_: rawptr) -> win32.DWORD { + __windows_thread_entry_proc :: proc "system" (t_: rawptr) -> win32.DWORD { t := (^Thread)(t_) t.id = sync.current_thread_id() diff --git a/default.nix b/default.nix deleted file mode 100644 index 64d20f674..000000000 --- a/default.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ pkgs ? import { } }: -let - odin-unwrapped = pkgs.llvmPackages_11.stdenv.mkDerivation (rec { - name = "odin-unwrapped"; - src = ./.; - dontConfigure = true; - nativeBuildInputs = [ pkgs.git ]; - buildPhase = '' - make debug SHELL=${pkgs.llvmPackages_11.stdenv.shell} - ''; - installPhase = '' - mkdir -p $out/bin - cp odin $out/bin/odin - cp -r core $out/bin/core - ''; - }); - path = builtins.map (path: path + "/bin") (with pkgs.llvmPackages_11; [ - bintools - llvm - clang - lld - ]); -in -pkgs.writeScriptBin "odin" '' - #!${pkgs.llvmPackages_11.stdenv.shell} - PATH="${(builtins.concatStringsSep ":" path)}" exec ${odin-unwrapped}/bin/odin $@ -'' diff --git a/examples/all/README.md b/examples/all/README.md new file mode 100644 index 000000000..72398540f --- /dev/null +++ b/examples/all/README.md @@ -0,0 +1,3 @@ +# `examples/all` for Documentation + +**NOTE:** This exists purely for the documentation generator located at \ No newline at end of file diff --git a/examples/all/all_vendor.odin b/examples/all/all_vendor.odin index 372b2dfa8..f3c90874c 100644 --- a/examples/all/all_vendor.odin +++ b/examples/all/all_vendor.odin @@ -80,4 +80,44 @@ _ :: nvg _ :: nvg_gl _ :: fontstash -_ :: xlib \ No newline at end of file +_ :: xlib + + +// NOTE: needed for doc generator + +import NS "vendor:darwin/Foundation" +import MTL "vendor:darwin/Metal" +import MTK "vendor:darwin/MetalKit" +import CA "vendor:darwin/QuartzCore" + +_ :: NS +_ :: MTL +_ :: MTK +_ :: CA + + +import D3D11 "vendor:directx/d3d11" +import D3D12 "vendor:directx/d3d12" +import DXGI "vendor:directx/dxgi" + +_ :: D3D11 +_ :: D3D12 +_ :: DXGI + + +import cm "vendor:commonmark" +_ :: cm + + +import stb_easy_font "vendor:stb/easy_font" +import stbi "vendor:stb/image" +import stbrp "vendor:stb/rect_pack" +import stbtt "vendor:stb/truetype" +import stb_vorbis "vendor:stb/vorbis" + +_ :: stb_easy_font +_ :: stbi +_ :: stbrp +_ :: stbtt +_ :: stb_vorbis + diff --git a/examples/all/all_vendor_cmark.odin b/examples/all/all_vendor_cmark.odin deleted file mode 100644 index 5faf47efc..000000000 --- a/examples/all/all_vendor_cmark.odin +++ /dev/null @@ -1,5 +0,0 @@ -//+build windows, linux -package all - -import cm "vendor:commonmark" -_ :: cm diff --git a/examples/all/all_vendor_darwin.odin b/examples/all/all_vendor_darwin.odin deleted file mode 100644 index 9aa41396c..000000000 --- a/examples/all/all_vendor_darwin.odin +++ /dev/null @@ -1,12 +0,0 @@ -//+build darwin -package all - -import NS "vendor:darwin/Foundation" -import MTL "vendor:darwin/Metal" -import MTK "vendor:darwin/MetalKit" -import CA "vendor:darwin/QuartzCore" - -_ :: NS -_ :: MTL -_ :: MTK -_ :: CA diff --git a/examples/all/all_vendor_directx.odin b/examples/all/all_vendor_directx.odin deleted file mode 100644 index 2f10d92f8..000000000 --- a/examples/all/all_vendor_directx.odin +++ /dev/null @@ -1,10 +0,0 @@ -//+build windows -package all - -import D3D11 "vendor:directx/d3d11" -import D3D12 "vendor:directx/d3d12" -import DXGI "vendor:directx/dxgi" - -_ :: D3D11 -_ :: D3D12 -_ :: DXGI diff --git a/examples/all/all_vendor_stl.odin b/examples/all/all_vendor_stl.odin deleted file mode 100644 index 9faf53c63..000000000 --- a/examples/all/all_vendor_stl.odin +++ /dev/null @@ -1,15 +0,0 @@ -//+build windows, linux -package all - -import stb_easy_font "vendor:stb/easy_font" -import stbi "vendor:stb/image" -import stbrp "vendor:stb/rect_pack" -import stbtt "vendor:stb/truetype" -import stb_vorbis "vendor:stb/vorbis" - -_ :: stb_easy_font -_ :: stbi -_ :: stbrp -_ :: stbtt -_ :: stb_vorbis - diff --git a/examples/all/all_vendor_zlib.odin b/examples/all/all_vendor_zlib.odin deleted file mode 100644 index 6004bed50..000000000 --- a/examples/all/all_vendor_zlib.odin +++ /dev/null @@ -1,5 +0,0 @@ -//+build windows, linux -package all - -import zlib "vendor:zlib" -_ :: zlib diff --git a/examples/demo/demo.odin b/examples/demo/demo.odin index b890d5778..bc6a4d9ea 100644 --- a/examples/demo/demo.odin +++ b/examples/demo/demo.odin @@ -1514,7 +1514,7 @@ quaternions :: proc() { { // Quaternion operations q := 1 + 2i + 3j + 4k - r := quaternion(5, 6, 7, 8) + r := quaternion(real=5, imag=6, jmag=7, kmag=8) t := q * r fmt.printf("(%v) * (%v) = %v\n", q, r, t) v := q / r @@ -1527,8 +1527,10 @@ quaternions :: proc() { { // The quaternion types q128: quaternion128 // 4xf32 q256: quaternion256 // 4xf64 - q128 = quaternion(1, 0, 0, 0) - q256 = 1 // quaternion(1, 0, 0, 0) + q128 = quaternion(w=1, x=0, y=0, z=0) + q256 = 1 // quaternion(x=0, y=0, z=0, w=1) + + // NOTE: The internal memory layout of a quaternion is xyzw } { // Built-in procedures q := 1 + 2i + 3j + 4k diff --git a/shell.nix b/shell.nix new file mode 100644 index 000000000..21301b9d7 --- /dev/null +++ b/shell.nix @@ -0,0 +1,11 @@ +{ pkgs ? import {} }: +pkgs.mkShell { + name = "odin"; + nativeBuildInputs = with pkgs; [ + git + clang_17 + llvmPackages_17.llvm + llvmPackages_17.bintools + ]; + shellHook="CXX=clang++"; +} diff --git a/src/bug_report.cpp b/src/bug_report.cpp index fbf616efb..ac3805919 100644 --- a/src/bug_report.cpp +++ b/src/bug_report.cpp @@ -824,6 +824,17 @@ gb_internal void report_os_info() { {"20G624", {20, 6, 0}, "macOS", {"Big Sur", {11, 6, 6}}}, {"20G630", {20, 6, 0}, "macOS", {"Big Sur", {11, 6, 7}}}, {"20G730", {20, 6, 0}, "macOS", {"Big Sur", {11, 6, 8}}}, + {"20G817", {20, 6, 0}, "macOS", {"Big Sur", {11, 7, 0}}}, + {"20G918", {20, 6, 0}, "macOS", {"Big Sur", {11, 7, 1}}}, + {"20G1020", {20, 6, 0}, "macOS", {"Big Sur", {11, 7, 2}}}, + {"20G1116", {20, 6, 0}, "macOS", {"Big Sur", {11, 7, 3}}}, + {"20G1120", {20, 6, 0}, "macOS", {"Big Sur", {11, 7, 4}}}, + {"20G1225", {20, 6, 0}, "macOS", {"Big Sur", {11, 7, 5}}}, + {"20G1231", {20, 6, 0}, "macOS", {"Big Sur", {11, 7, 6}}}, + {"20G1345", {20, 6, 0}, "macOS", {"Big Sur", {11, 7, 7}}}, + {"20G1351", {20, 6, 0}, "macOS", {"Big Sur", {11, 7, 8}}}, + {"20G1426", {20, 6, 0}, "macOS", {"Big Sur", {11, 7, 9}}}, + {"20G1427", {20, 6, 0}, "macOS", {"Big Sur", {11, 7, 10}}}, {"21A344", {21, 0, 1}, "macOS", {"Monterey", {12, 0, 0}}}, {"21A559", {21, 1, 0}, "macOS", {"Monterey", {12, 0, 1}}}, {"21C52", {21, 2, 0}, "macOS", {"Monterey", {12, 1, 0}}}, @@ -836,6 +847,42 @@ gb_internal void report_os_info() { {"21F2092", {21, 5, 0}, "macOS", {"Monterey", {12, 4, 0}}}, {"21G72", {21, 6, 0}, "macOS", {"Monterey", {12, 5, 0}}}, {"21G83", {21, 6, 0}, "macOS", {"Monterey", {12, 5, 1}}}, + {"21G115", {21, 6, 0}, "macOS", {"Monterey", {12, 6, 0}}}, + {"21G217", {21, 6, 0}, "macOS", {"Monterey", {12, 6, 1}}}, + {"21G320", {21, 6, 0}, "macOS", {"Monterey", {12, 6, 2}}}, + {"21G419", {21, 6, 0}, "macOS", {"Monterey", {12, 6, 3}}}, + {"21G526", {21, 6, 0}, "macOS", {"Monterey", {12, 6, 4}}}, + {"21G531", {21, 6, 0}, "macOS", {"Monterey", {12, 6, 5}}}, + {"21G646", {21, 6, 0}, "macOS", {"Monterey", {12, 6, 6}}}, + {"21G651", {21, 6, 0}, "macOS", {"Monterey", {12, 6, 7}}}, + {"21G725", {21, 6, 0}, "macOS", {"Monterey", {12, 6, 8}}}, + {"21G726", {21, 6, 0}, "macOS", {"Monterey", {12, 6, 9}}}, + {"21G816", {21, 6, 0}, "macOS", {"Monterey", {12, 7, 0}}}, + {"21G920", {21, 6, 0}, "macOS", {"Monterey", {12, 7, 1}}}, + {"21G1974", {21, 6, 0}, "macOS", {"Monterey", {12, 7, 2}}}, + {"22A380", {13, 0, 0}, "macOS", {"Ventura", {22, 1, 0}}}, + {"22A400", {13, 0, 1}, "macOS", {"Ventura", {22, 1, 0}}}, + {"22C65", {13, 1, 0}, "macOS", {"Ventura", {22, 2, 0}}}, + {"22D49", {13, 2, 0}, "macOS", {"Ventura", {22, 3, 0}}}, + {"22D68", {13, 2, 1}, "macOS", {"Ventura", {22, 3, 0}}}, + {"22E252", {13, 3, 0}, "macOS", {"Ventura", {22, 4, 0}}}, + {"22E261", {13, 3, 1}, "macOS", {"Ventura", {22, 4, 0}}}, + {"22F66", {13, 4, 0}, "macOS", {"Ventura", {22, 5, 0}}}, + {"22F82", {13, 4, 1}, "macOS", {"Ventura", {22, 5, 0}}}, + {"22E772610a", {13, 4, 1}, "macOS", {"Ventura", {22, 5, 0}}}, + {"22F770820d", {13, 4, 1}, "macOS", {"Ventura", {22, 5, 0}}}, + {"22G74", {13, 5, 0}, "macOS", {"Ventura", {22, 6, 0}}}, + {"22G90", {13, 5, 1}, "macOS", {"Ventura", {22, 6, 0}}}, + {"22G91", {13, 5, 2}, "macOS", {"Ventura", {22, 6, 0}}}, + {"22G120", {13, 6, 0}, "macOS", {"Ventura", {22, 6, 0}}}, + {"22G313", {13, 6, 1}, "macOS", {"Ventura", {22, 6, 0}}}, + {"22G320", {13, 6, 2}, "macOS", {"Ventura", {22, 6, 0}}}, + {"23A344", {23, 0, 0}, "macOS", {"Sonoma", {14, 0, 0}}}, + {"23B74", {23, 1, 0}, "macOS", {"Sonoma", {14, 1, 0}}}, + {"23B81", {23, 1, 0}, "macOS", {"Sonoma", {14, 1, 1}}}, + {"23B92", {23, 1, 0}, "macOS", {"Sonoma", {14, 1, 2}}}, + {"23C64", {23, 2, 0}, "macOS", {"Sonoma", {14, 2, 0}}}, + {"23C71", {23, 2, 0}, "macOS", {"Sonoma", {14, 2, 1}}}, }; @@ -867,37 +914,44 @@ gb_internal void report_os_info() { // Scan table for match on BUILD int macos_release_count = sizeof(macos_release_map) / sizeof(macos_release_map[0]); - Darwin_To_Release match = {}; - + Darwin_To_Release build_match = {}; + Darwin_To_Release kernel_match = {}; + for (int build = 0; build < macos_release_count; build++) { Darwin_To_Release rel = macos_release_map[build]; - + // Do we have an exact match on the BUILD? if (gb_strcmp(rel.build, (const char *)build_buffer) == 0) { - match = rel; + build_match = rel; break; } - + // Do we have an exact Darwin match? if (rel.darwin[0] == major && rel.darwin[1] == minor && rel.darwin[2] == patch) { - match = rel; - break; + kernel_match = rel; } - + // Major kernel version needs to match exactly, if (rel.darwin[0] == major) { // No major version match yet. - if (!match.os_name) { - match = rel; + if (!kernel_match.os_name) { + kernel_match = rel; } if (minor >= rel.darwin[1]) { - match = rel; + kernel_match = rel; if (patch >= rel.darwin[2]) { - match = rel; + kernel_match = rel; } } } } + + Darwin_To_Release match = {}; + if(!build_match.build) { + match = kernel_match; + } else { + match = build_match; + } if (match.os_name) { gb_printf("%s %s %d", match.os_name, match.release.name, match.release.version[0]); diff --git a/src/build_settings.cpp b/src/build_settings.cpp index d91a31ff2..af518bcb4 100644 --- a/src/build_settings.cpp +++ b/src/build_settings.cpp @@ -56,6 +56,19 @@ enum TargetABIKind : u16 { TargetABI_COUNT, }; +enum Windows_Subsystem : u8 { + Windows_Subsystem_BOOT_APPLICATION, + Windows_Subsystem_CONSOLE, // Default, + Windows_Subsystem_EFI_APPLICATION, + Windows_Subsystem_EFI_BOOT_SERVICE_DRIVER, + Windows_Subsystem_EFI_ROM, + Windows_Subsystem_EFI_RUNTIME_DRIVER, + Windows_Subsystem_NATIVE, + Windows_Subsystem_POSIX, + Windows_Subsystem_WINDOWS, + Windows_Subsystem_WINDOWSCE, + Windows_Subsystem_COUNT, +}; gb_global String target_os_names[TargetOs_COUNT] = { str_lit(""), @@ -120,6 +133,19 @@ gb_global TargetEndianKind target_endians[TargetArch_COUNT] = { TargetEndian_Little, }; +gb_global String windows_subsystem_names[Windows_Subsystem_COUNT] = { + str_lit("BOOT_APPLICATION"), + str_lit("CONSOLE"), // Default + str_lit("EFI_APPLICATION"), + str_lit("EFI_BOOT_SERVICE_DRIVER"), + str_lit("EFI_ROM"), + str_lit("EFI_RUNTIME_DRIVER"), + str_lit("NATIVE"), + str_lit("POSIX"), + str_lit("WINDOWS"), + str_lit("WINDOWSCE"), +}; + #ifndef ODIN_VERSION_RAW #define ODIN_VERSION_RAW "dev-unknown-unknown" #endif @@ -287,14 +313,15 @@ enum SanitizerFlags : u32 { // This stores the information for the specify architecture of this build struct BuildContext { // Constants - String ODIN_OS; // target operating system - String ODIN_ARCH; // target architecture - String ODIN_VENDOR; // compiler vendor - String ODIN_VERSION; // compiler version - String ODIN_ROOT; // Odin ROOT - String ODIN_BUILD_PROJECT_NAME; // Odin main/initial package's directory name - bool ODIN_DEBUG; // Odin in debug mode - bool ODIN_DISABLE_ASSERT; // Whether the default 'assert' et al is disabled in code or not + String ODIN_OS; // Target operating system + String ODIN_ARCH; // Target architecture + String ODIN_VENDOR; // Compiler vendor + String ODIN_VERSION; // Compiler version + String ODIN_ROOT; // Odin ROOT + String ODIN_BUILD_PROJECT_NAME; // Odin main/initial package's directory name + String ODIN_WINDOWS_SUBSYSTEM; // Empty string for non-Windows targets + bool ODIN_DEBUG; // Odin in debug mode + bool ODIN_DISABLE_ASSERT; // Whether the default 'assert' et al is disabled in code or not bool ODIN_DEFAULT_TO_NIL_ALLOCATOR; // Whether the default allocator is a "nil" allocator or not (i.e. it does nothing) bool ODIN_FOREIGN_ERROR_PROCEDURES; bool ODIN_VALGRIND_SUPPORT; @@ -361,12 +388,12 @@ struct BuildContext { bool ignore_warnings; bool warnings_as_errors; bool hide_error_line; + bool terse_errors; bool has_ansi_terminal_colours; bool ignore_lazy; bool ignore_llvm_build; - bool use_subsystem_windows; bool ignore_microsoft_magic; bool linker_map_file; @@ -581,7 +608,13 @@ gb_global TargetMetrics target_freestanding_amd64_sysv = { TargetABI_SysV, }; - +gb_global TargetMetrics target_freestanding_arm64 = { + TargetOs_freestanding, + TargetArch_arm64, + 8, 8, 8, 16, + str_lit("aarch64-none-elf"), + str_lit("e-m:o-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64"), +}; struct NamedTargetMetrics { String name; @@ -616,6 +649,7 @@ gb_global NamedTargetMetrics named_targets[] = { { str_lit("wasi_wasm64p32"), &target_wasi_wasm64p32 }, { str_lit("freestanding_amd64_sysv"), &target_freestanding_amd64_sysv }, + { str_lit("freestanding_arm64"), &target_freestanding_arm64 }, }; gb_global NamedTargetMetrics *selected_target_metrics; @@ -1274,8 +1308,6 @@ gb_internal void init_build_context(TargetMetrics *cross_target, Subtarget subta GB_ASSERT(metrics->int_size == 2*metrics->ptr_size); } - - bc->metrics = *metrics; switch (subtarget) { case Subtarget_Default: @@ -1292,14 +1324,14 @@ gb_internal void init_build_context(TargetMetrics *cross_target, Subtarget subta break; } - bc->ODIN_OS = target_os_names[metrics->os]; - bc->ODIN_ARCH = target_arch_names[metrics->arch]; - bc->endian_kind = target_endians[metrics->arch]; - bc->ptr_size = metrics->ptr_size; - bc->int_size = metrics->int_size; - bc->max_align = metrics->max_align; - bc->max_simd_align = metrics->max_simd_align; - bc->link_flags = str_lit(" "); + bc->ODIN_OS = target_os_names[metrics->os]; + bc->ODIN_ARCH = target_arch_names[metrics->arch]; + bc->endian_kind = target_endians[metrics->arch]; + bc->ptr_size = metrics->ptr_size; + bc->int_size = metrics->int_size; + bc->max_align = metrics->max_align; + bc->max_simd_align = metrics->max_simd_align; + bc->link_flags = str_lit(" "); #if defined(DEFAULT_TO_THREADED_CHECKER) bc->threaded_checker = true; @@ -1321,6 +1353,11 @@ gb_internal void init_build_context(TargetMetrics *cross_target, Subtarget subta } } + // Default to subsystem:CONSOLE on Windows targets + if (bc->ODIN_WINDOWS_SUBSYSTEM == "" && bc->metrics.os == TargetOs_windows) { + bc->ODIN_WINDOWS_SUBSYSTEM = windows_subsystem_names[Windows_Subsystem_CONSOLE]; + } + // NOTE(zangent): The linker flags to set the build architecture are different // across OSs. It doesn't make sense to allocate extra data on the heap // here, so I just #defined the linker flags to keep things concise. @@ -1492,7 +1529,7 @@ gb_internal void enable_target_feature(TokenPos pos, String const &target_featur } -gb_internal char const *target_features_set_to_cstring(gbAllocator allocator, bool with_quotes) { +gb_internal char const *target_features_set_to_cstring(gbAllocator allocator, bool with_quotes, bool with_plus) { isize len = 0; isize i = 0; for (String const &feature : build_context.target_features_set) { @@ -1501,6 +1538,7 @@ gb_internal char const *target_features_set_to_cstring(gbAllocator allocator, bo } len += feature.len; if (with_quotes) len += 2; + if (with_plus) len += 1; i += 1; } char *features = gb_alloc_array(allocator, char, len+1); @@ -1512,6 +1550,7 @@ gb_internal char const *target_features_set_to_cstring(gbAllocator allocator, bo } if (with_quotes) features[len++] = '"'; + if (with_plus) features[len++] = '+'; gb_memmove(features + len, feature.text, feature.len); len += feature.len; if (with_quotes) features[len++] = '"'; diff --git a/src/check_builtin.cpp b/src/check_builtin.cpp index b3aaab754..09ca0bc23 100644 --- a/src/check_builtin.cpp +++ b/src/check_builtin.cpp @@ -1666,7 +1666,12 @@ gb_internal bool check_builtin_procedure(CheckerContext *c, Operand *operand, As if (ce->args.count > 0) { if (ce->args[0]->kind == Ast_FieldValue) { - if (id != BuiltinProc_soa_zip) { + switch (id) { + case BuiltinProc_soa_zip: + case BuiltinProc_quaternion: + // okay + break; + default: error(call, "'field = value' calling is not allowed on built-in procedures"); return false; } @@ -2299,61 +2304,150 @@ gb_internal bool check_builtin_procedure(CheckerContext *c, Operand *operand, As } case BuiltinProc_quaternion: { - // quaternion :: proc(real, imag, jmag, kmag: float_type) -> complex_type - Operand x = *operand; - Operand y = {}; - Operand z = {}; - Operand w = {}; + bool first_is_field_value = (ce->args[0]->kind == Ast_FieldValue); + + bool fail = false; + for (Ast *arg : ce->args) { + bool mix = false; + if (first_is_field_value) { + mix = arg->kind != Ast_FieldValue; + } else { + mix = arg->kind == Ast_FieldValue; + } + if (mix) { + error(arg, "Mixture of 'field = value' and value elements in the procedure call '%.*s' is not allowed", LIT(builtin_name)); + fail = true; + break; + } + } + + if (fail) { + operand->type = t_untyped_quaternion; + operand->mode = Addressing_Constant; + operand->value = exact_value_quaternion(0.0, 0.0, 0.0, 0.0); + break; + } + + // quaternion :: proc(imag, jmag, kmag, real: float_type) -> complex_type + Operand xyzw[4] = {}; + + u32 first_index = 0; // NOTE(bill): Invalid will be the default till fixed operand->type = t_invalid; operand->mode = Addressing_Invalid; - check_expr(c, &y, ce->args[1]); - if (y.mode == Addressing_Invalid) { - return false; - } - check_expr(c, &z, ce->args[2]); - if (y.mode == Addressing_Invalid) { - return false; - } - check_expr(c, &w, ce->args[3]); - if (y.mode == Addressing_Invalid) { - return false; - } + if (first_is_field_value) { + u32 fields_set[4] = {}; // 0 unset, 1 xyzw, 2 real/etc - convert_to_typed(c, &x, y.type); if (x.mode == Addressing_Invalid) return false; - convert_to_typed(c, &y, x.type); if (y.mode == Addressing_Invalid) return false; - convert_to_typed(c, &z, x.type); if (z.mode == Addressing_Invalid) return false; - convert_to_typed(c, &w, x.type); if (w.mode == Addressing_Invalid) return false; - if (x.mode == Addressing_Constant && - y.mode == Addressing_Constant && - z.mode == Addressing_Constant && - w.mode == Addressing_Constant) { - x.value = exact_value_to_float(x.value); - y.value = exact_value_to_float(y.value); - z.value = exact_value_to_float(z.value); - w.value = exact_value_to_float(w.value); - if (is_type_numeric(x.type) && x.value.kind == ExactValue_Float) { - x.type = t_untyped_float; + auto const check_field = [&fields_set, &builtin_name](CheckerContext *c, Operand *o, Ast *arg, i32 *index) -> bool { + *index = -1; + + ast_node(field, FieldValue, arg); + String name = {}; + if (field->field->kind == Ast_Ident) { + name = field->field->Ident.token.string; + } else { + error(field->field, "Expected an identifier for field argument"); + return false; + } + + u32 style = 0; + + if (name == "x") { + *index = 0; style = 1; + } else if (name == "y") { + *index = 1; style = 1; + } else if (name == "z") { + *index = 2; style = 1; + } else if (name == "w") { + *index = 3; style = 1; + } else if (name == "imag") { + *index = 0; style = 2; + } else if (name == "jmag") { + *index = 1; style = 2; + } else if (name == "kmag") { + *index = 2; style = 2; + } else if (name == "real") { + *index = 3; style = 2; + } else { + error(field->field, "Unknown name for '%.*s', expected (w, x, y, z; or real, imag, jmag, kmag), got '%.*s'", LIT(builtin_name), LIT(name)); + return false; + } + + if (fields_set[*index]) { + error(field->field, "Previously assigned field: '%.*s'", LIT(name)); + } + fields_set[*index] = style; + + check_expr(c, o, field->value); + return o->mode != Addressing_Invalid; + }; + + Operand *refs[4] = {&xyzw[0], &xyzw[1], &xyzw[2], &xyzw[3]}; + + for (i32 i = 0; i < 4; i++) { + i32 index = -1; + Operand o = {}; + bool ok = check_field(c, &o, ce->args[i], &index); + if (!ok || index < 0) { + return false; + } + first_index = cast(u32)index; + *refs[index] = o; } - if (is_type_numeric(y.type) && y.value.kind == ExactValue_Float) { - y.type = t_untyped_float; + + for (i32 i = 0; i < 4; i++) { + GB_ASSERT(fields_set[i]); } - if (is_type_numeric(z.type) && z.value.kind == ExactValue_Float) { - z.type = t_untyped_float; + for (i32 i = 1; i < 4; i++) { + if (fields_set[i] != fields_set[i-1]) { + error(call, "Mixture of xyzw and real/etc is not allowed with '%.*s'", LIT(builtin_name)); + break; + } } - if (is_type_numeric(w.type) && w.value.kind == ExactValue_Float) { - w.type = t_untyped_float; + } else { + error(call, "'%.*s' requires that all arguments are named (w, x, y, z; or real, imag, jmag, kmag)", LIT(builtin_name)); + + for (i32 i = 0; i < 4; i++) { + check_expr(c, &xyzw[i], ce->args[i]); + if (xyzw[i].mode == Addressing_Invalid) { + return false; + } } } - if (!(are_types_identical(x.type, y.type) && are_types_identical(x.type, z.type) && are_types_identical(x.type, w.type))) { - gbString tx = type_to_string(x.type); - gbString ty = type_to_string(y.type); - gbString tz = type_to_string(z.type); - gbString tw = type_to_string(w.type); - error(call, "Mismatched types to 'quaternion', '%s' vs '%s' vs '%s' vs '%s'", tx, ty, tz, tw); + + for (u32 i = 0; i < 4; i++ ){ + u32 j = (i + first_index) % 4; + if (j == first_index) { + convert_to_typed(c, &xyzw[j], xyzw[(first_index+1)%4].type); if (xyzw[j].mode == Addressing_Invalid) return false; + } else { + convert_to_typed(c, &xyzw[j], xyzw[first_index].type); if (xyzw[j].mode == Addressing_Invalid) return false; + } + } + if (xyzw[0].mode == Addressing_Constant && + xyzw[1].mode == Addressing_Constant && + xyzw[2].mode == Addressing_Constant && + xyzw[3].mode == Addressing_Constant) { + for (i32 i = 0; i < 4; i++) { + xyzw[i].value = exact_value_to_float(xyzw[i].value); + } + for (i32 i = 0; i < 4; i++) { + if (is_type_numeric(xyzw[i].type) && xyzw[i].value.kind == ExactValue_Float) { + xyzw[i].type = t_untyped_float; + } + } + } + + if (!(are_types_identical(xyzw[0].type, xyzw[1].type) && + are_types_identical(xyzw[0].type, xyzw[2].type) && + are_types_identical(xyzw[0].type, xyzw[3].type))) { + gbString tx = type_to_string(xyzw[0].type); + gbString ty = type_to_string(xyzw[1].type); + gbString tz = type_to_string(xyzw[2].type); + gbString tw = type_to_string(xyzw[3].type); + error(call, "Mismatched types to 'quaternion', 'x=%s' vs 'y=%s' vs 'z=%s' vs 'w=%s'", tx, ty, tz, tw); gb_string_free(tw); gb_string_free(tz); gb_string_free(ty); @@ -2361,31 +2455,35 @@ gb_internal bool check_builtin_procedure(CheckerContext *c, Operand *operand, As return false; } - if (!is_type_float(x.type)) { - gbString s = type_to_string(x.type); + if (!is_type_float(xyzw[0].type)) { + gbString s = type_to_string(xyzw[0].type); error(call, "Arguments have type '%s', expected a floating point", s); gb_string_free(s); return false; } - if (is_type_endian_specific(x.type)) { - gbString s = type_to_string(x.type); + if (is_type_endian_specific(xyzw[0].type)) { + gbString s = type_to_string(xyzw[0].type); error(call, "Arguments with a specified endian are not allow, expected a normal floating point, got '%s'", s); gb_string_free(s); return false; } - if (x.mode == Addressing_Constant && y.mode == Addressing_Constant && z.mode == Addressing_Constant && w.mode == Addressing_Constant) { - f64 r = exact_value_to_float(x.value).value_float; - f64 i = exact_value_to_float(y.value).value_float; - f64 j = exact_value_to_float(z.value).value_float; - f64 k = exact_value_to_float(w.value).value_float; + + operand->mode = Addressing_Value; + + if (xyzw[0].mode == Addressing_Constant && + xyzw[1].mode == Addressing_Constant && + xyzw[2].mode == Addressing_Constant && + xyzw[3].mode == Addressing_Constant) { + f64 r = exact_value_to_float(xyzw[3].value).value_float; + f64 i = exact_value_to_float(xyzw[0].value).value_float; + f64 j = exact_value_to_float(xyzw[1].value).value_float; + f64 k = exact_value_to_float(xyzw[2].value).value_float; operand->value = exact_value_quaternion(r, i, j, k); operand->mode = Addressing_Constant; - } else { - operand->mode = Addressing_Value; } - BasicKind kind = core_type(x.type)->Basic.kind; + BasicKind kind = core_type(xyzw[first_index].type)->Basic.kind; switch (kind) { case Basic_f16: operand->type = t_quaternion64; break; case Basic_f32: operand->type = t_quaternion128; break; @@ -3092,7 +3190,7 @@ gb_internal bool check_builtin_procedure(CheckerContext *c, Operand *operand, As mix = arg->kind == Ast_FieldValue; } if (mix) { - error(arg, "Mixture of 'field = value' and value elements in the procedure call 'soa_zip' is not allowed"); + error(arg, "Mixture of 'field = value' and value elements in the procedure call '%.*s' is not allowed", LIT(builtin_name)); fail = true; break; } diff --git a/src/check_decl.cpp b/src/check_decl.cpp index 71b897a84..ed3a109c2 100644 --- a/src/check_decl.cpp +++ b/src/check_decl.cpp @@ -138,11 +138,10 @@ gb_internal void check_init_variables(CheckerContext *ctx, Entity **lhs, isize l } if (o->type && is_type_no_copy(o->type)) { - begin_error_block(); + ERROR_BLOCK(); if (check_no_copy_assignment(*o, str_lit("initialization"))) { error_line("\tInitialization of a #no_copy type must be either implicitly zero, a constant literal, or a return value from a call expression"); } - end_error_block(); } } if (rhs_count > 0 && lhs_count != rhs_count) { @@ -908,7 +907,91 @@ gb_internal void check_proc_decl(CheckerContext *ctx, Entity *e, DeclInfo *d) { break; } + e->Procedure.entry_point_only = ac.entry_point_only; e->Procedure.is_export = ac.is_export; + + bool has_instrumentation = false; + if (pl->body == nullptr) { + has_instrumentation = false; + if (ac.no_instrumentation != Instrumentation_Default) { + error(e->token, "@(no_instrumentation) is not allowed on foreign procedures"); + } + } else { + AstFile *file = e->token.pos.file_id ? global_files[e->token.pos.file_id] : nullptr; + if (file) { + has_instrumentation = (file->flags & AstFile_NoInstrumentation) == 0; + } + + switch (ac.no_instrumentation) { + case Instrumentation_Enabled: has_instrumentation = true; break; + case Instrumentation_Default: break; + case Instrumentation_Disabled: has_instrumentation = false; break; + } + } + + auto const is_valid_instrumentation_call = [](Type *type) -> bool { + if (type == nullptr || type->kind != Type_Proc) { + return false; + } + if (type->Proc.calling_convention != ProcCC_Contextless) { + return false; + } + if (type->Proc.result_count != 0) { + return false; + } + if (type->Proc.param_count != 3) { + return false; + } + Type *p0 = type->Proc.params->Tuple.variables[0]->type; + Type *p1 = type->Proc.params->Tuple.variables[1]->type; + Type *p3 = type->Proc.params->Tuple.variables[2]->type; + return is_type_rawptr(p0) && is_type_rawptr(p1) && are_types_identical(p3, t_source_code_location); + }; + + static char const *instrumentation_proc_type_str = "proc \"contextless\" (proc_address: rawptr, call_site_return_address: rawptr, loc: runtime.Source_Code_Location)"; + + if (ac.instrumentation_enter && ac.instrumentation_exit) { + error(e->token, "A procedure cannot be marked with both @(instrumentation_enter) and @(instrumentation_exit)"); + + has_instrumentation = false; + e->flags |= EntityFlag_Require; + } else if (ac.instrumentation_enter) { + if (!is_valid_instrumentation_call(e->type)) { + init_core_source_code_location(ctx->checker); + gbString s = type_to_string(e->type); + error(e->token, "@(instrumentation_enter) procedures must have the type '%s', got %s", instrumentation_proc_type_str, s); + gb_string_free(s); + } + MUTEX_GUARD(&ctx->info->instrumentation_mutex); + if (ctx->info->instrumentation_enter_entity != nullptr) { + error(e->token, "@(instrumentation_enter) has already been set"); + } else { + ctx->info->instrumentation_enter_entity = e; + } + + has_instrumentation = false; + e->flags |= EntityFlag_Require; + } else if (ac.instrumentation_exit) { + init_core_source_code_location(ctx->checker); + if (!is_valid_instrumentation_call(e->type)) { + gbString s = type_to_string(e->type); + error(e->token, "@(instrumentation_exit) procedures must have the type '%s', got %s", instrumentation_proc_type_str, s); + gb_string_free(s); + } + MUTEX_GUARD(&ctx->info->instrumentation_mutex); + if (ctx->info->instrumentation_exit_entity != nullptr) { + error(e->token, "@(instrumentation_exit) has already been set"); + } else { + ctx->info->instrumentation_exit_entity = e; + } + + has_instrumentation = false; + e->flags |= EntityFlag_Require; + } + + e->Procedure.has_instrumentation = has_instrumentation; + + e->deprecated_message = ac.deprecated_message; e->warning_message = ac.warning_message; ac.link_name = handle_link_name(ctx, e->token, ac.link_name, ac.link_prefix); @@ -1300,8 +1383,8 @@ gb_internal void check_proc_group_decl(CheckerContext *ctx, Entity *pg_entity, D continue; } - begin_error_block(); - defer (end_error_block()); + + ERROR_BLOCK(); ProcTypeOverloadKind kind = are_proc_types_overload_safe(p->type, q->type); bool both_have_where_clauses = false; diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 71accfb81..f8c5540f4 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -184,6 +184,8 @@ gb_internal void populate_check_did_you_mean_objc_entity(StringSet *set, Entity gb_internal void check_did_you_mean_objc_entity(String const &name, Entity *e, bool is_type, char const *prefix = "") { + if (build_context.terse_errors) { return; } + ERROR_BLOCK(); GB_ASSERT(e->kind == Entity_TypeName); GB_ASSERT(e->TypeName.objc_metadata != nullptr); @@ -204,6 +206,8 @@ gb_internal void check_did_you_mean_objc_entity(String const &name, Entity *e, b } gb_internal void check_did_you_mean_type(String const &name, Array const &fields, char const *prefix = "") { + if (build_context.terse_errors) { return; } + ERROR_BLOCK(); DidYouMeanAnswers d = did_you_mean_make(heap_allocator(), fields.count, name); @@ -217,6 +221,8 @@ gb_internal void check_did_you_mean_type(String const &name, Array con gb_internal void check_did_you_mean_type(String const &name, Slice const &fields, char const *prefix = "") { + if (build_context.terse_errors) { return; } + ERROR_BLOCK(); DidYouMeanAnswers d = did_you_mean_make(heap_allocator(), fields.count, name); @@ -229,6 +235,8 @@ gb_internal void check_did_you_mean_type(String const &name, Slice con } gb_internal void check_did_you_mean_scope(String const &name, Scope *scope, char const *prefix = "") { + if (build_context.terse_errors) { return; } + ERROR_BLOCK(); DidYouMeanAnswers d = did_you_mean_make(heap_allocator(), scope->elements.count, name); @@ -2203,7 +2211,6 @@ gb_internal bool check_is_expressible(CheckerContext *ctx, Operand *o, Type *typ ERROR_BLOCK(); - if (is_type_numeric(o->type) && is_type_numeric(type)) { if (!is_type_integer(o->type) && is_type_integer(type)) { error(o->expr, "'%s' truncated to '%s', got %s", a, b, s); @@ -2264,8 +2271,7 @@ gb_internal void check_old_for_or_switch_value_usage(Ast *expr) { if (e != nullptr && (e->flags & EntityFlag_OldForOrSwitchValue) != 0) { GB_ASSERT(e->kind == Entity_Variable); - begin_error_block(); - defer (end_error_block()); + ERROR_BLOCK(); if ((e->flags & EntityFlag_ForValue) != 0) { Type *parent_type = type_deref(e->Variable.for_loop_parent_type); @@ -2309,8 +2315,7 @@ gb_internal void check_unary_expr(CheckerContext *c, Operand *o, Token op, Ast * break; default: { - begin_error_block(); - defer (end_error_block()); + ERROR_BLOCK(); error(op, "Cannot take the pointer address of '%s'", str); if (e != nullptr && (e->flags & EntityFlag_ForValue) != 0) { Type *parent_type = type_deref(e->Variable.for_loop_parent_type); @@ -2983,6 +2988,9 @@ gb_internal bool check_is_castable_to(CheckerContext *c, Operand *operand, Type } // proc <-> proc if (is_type_proc(src) && is_type_proc(dst)) { + if (is_type_polymorphic(src) || is_type_polymorphic(dst)) { + return false; + } return true; } @@ -3062,7 +3070,6 @@ gb_internal void check_cast(CheckerContext *c, Operand *x, Type *type) { bool is_const_expr = x->mode == Addressing_Constant; bool can_convert = check_cast_internal(c, x, type); - if (!can_convert) { TEMPORARY_ALLOCATOR_GUARD(); gbString expr_str = expr_to_string(x->expr, temporary_allocator()); @@ -3071,7 +3078,7 @@ gb_internal void check_cast(CheckerContext *c, Operand *x, Type *type) { x->mode = Addressing_Invalid; - begin_error_block(); + ERROR_BLOCK(); error(x->expr, "Cannot cast '%s' as '%s' from '%s'", expr_str, to_type, from_type); if (is_const_expr) { gbString val_str = exact_value_to_string(x->value); @@ -3094,8 +3101,6 @@ gb_internal void check_cast(CheckerContext *c, Operand *x, Type *type) { } check_cast_error_suggestion(c, x, type); - end_error_block(); - return; } @@ -4047,8 +4052,7 @@ gb_internal void convert_to_typed(CheckerContext *c, Operand *operand, Type *tar if (check_is_assignable_to(c, operand, elem)) { if (t->Matrix.row_count != t->Matrix.column_count) { operand->mode = Addressing_Invalid; - begin_error_block(); - defer (end_error_block()); + ERROR_BLOCK(); convert_untyped_error(c, operand, target_type); error_line("\tNote: Only a square matrix types can be initialized with a scalar value\n"); @@ -4109,8 +4113,7 @@ gb_internal void convert_to_typed(CheckerContext *c, Operand *operand, Type *tar target_type = t->Union.variants[first_success_index]; break; } else if (valid_count > 1) { - begin_error_block(); - defer (end_error_block()); + ERROR_BLOCK(); GB_ASSERT(first_success_index >= 0); operand->mode = Addressing_Invalid; @@ -4136,8 +4139,7 @@ gb_internal void convert_to_typed(CheckerContext *c, Operand *operand, Type *tar } else if (is_type_untyped_uninit(operand->type)) { target_type = t_untyped_uninit; } else if (!is_type_untyped_nil(operand->type) || !type_has_nil(target_type)) { - begin_error_block(); - defer (end_error_block()); + ERROR_BLOCK(); operand->mode = Addressing_Invalid; convert_untyped_error(c, operand, target_type); @@ -4714,6 +4716,7 @@ gb_internal Entity *check_selector(CheckerContext *c, Operand *operand, Ast *nod entity = scope_lookup_current(import_scope, entity_name); bool allow_builtin = false; if (!is_entity_declared_for_selector(entity, import_scope, &allow_builtin)) { + ERROR_BLOCK(); error(node, "'%.*s' is not declared by '%.*s'", LIT(entity_name), LIT(import_name)); operand->mode = Addressing_Invalid; operand->expr = node; @@ -4914,6 +4917,8 @@ gb_internal Entity *check_selector(CheckerContext *c, Operand *operand, Ast *nod error(op_expr, "Type '%s' has no field '%s'", op_str, sel_str); } } else { + ERROR_BLOCK(); + error(op_expr, "'%s' of type '%s' has no field '%s'", op_str, type_str, sel_str); if (operand->type != nullptr && selector->kind == Ast_Ident) { @@ -6338,8 +6343,7 @@ gb_internal CallArgumentData check_call_arguments_proc_group(CheckerContext *c, }; if (valids.count == 0) { - begin_error_block(); - defer (end_error_block()); + ERROR_BLOCK(); error(operand->expr, "No procedures or ambiguous call for procedure group '%s' that match with the given arguments", expr_name); if (positional_operands.count == 0 && named_operands.count == 0) { @@ -6429,8 +6433,7 @@ gb_internal CallArgumentData check_call_arguments_proc_group(CheckerContext *c, data.result_type = t_invalid; } else if (valids.count > 1) { - begin_error_block(); - defer (end_error_block()); + ERROR_BLOCK(); error(operand->expr, "Ambiguous procedure group call '%s' that match with the given arguments", expr_name); print_argument_types(); @@ -7195,6 +7198,14 @@ gb_internal ExprKind check_call_expr(CheckerContext *c, Operand *operand, Ast *c } } add_entity_use(c, operand->expr, initial_entity); + + if (initial_entity->Procedure.entry_point_only) { + if (c->curr_proc_decl && c->curr_proc_decl->entity == c->info->entry_point) { + // Okay + } else { + error(operand->expr, "Procedures with the attribute '@(entry_point_only)' can only be called directly from the user-level entry point procedure"); + } + } } if (operand->mode != Addressing_ProcGroup) { @@ -7641,6 +7652,8 @@ gb_internal ExprKind check_implicit_selector_expr(CheckerContext *c, Operand *o, String name = ise->selector->Ident.token.string; if (is_type_enum(th)) { + ERROR_BLOCK(); + Type *bt = base_type(th); GB_ASSERT(bt->kind == Type_Enum); @@ -7884,7 +7897,7 @@ gb_internal ExprKind check_basic_directive_expr(CheckerContext *c, Operand *o, A } else { if (name == "location") { init_core_source_code_location(c->checker); - error(node, "'#%.*s' must be used in a call expression", LIT(name)); + error(node, "'#location' must be used as a call, i.e. #location(proc), where #location() defaults to the procedure in which it was used."); o->type = t_source_code_location; o->mode = Addressing_Value; } else if ( @@ -9042,8 +9055,7 @@ gb_internal ExprKind check_compound_literal(CheckerContext *c, Operand *o, Ast * } if (unhandled.count > 0) { - begin_error_block(); - defer (end_error_block()); + ERROR_BLOCK(); if (unhandled.count == 1) { error_no_newline(node, "Unhandled enumerated array case: %.*s", LIT(unhandled[0]->token.string)); @@ -9054,9 +9066,11 @@ gb_internal ExprKind check_compound_literal(CheckerContext *c, Operand *o, Ast * error_line("\t%.*s\n", LIT(f->token.string)); } } - error_line("\n"); - error_line("\tSuggestion: Was '#partial %s{...}' wanted?\n", type_to_string(type)); + if (!build_context.terse_errors) { + error_line("\n"); + error_line("\tSuggestion: Was '#partial %s{...}' wanted?\n", type_to_string(type)); + } } } @@ -9680,7 +9694,9 @@ gb_internal ExprKind check_index_expr(CheckerContext *c, Operand *o, Ast *node, if (index < 0) { gbString str = expr_to_string(o->expr); error(o->expr, "Cannot index a constant '%s'", str); - error_line("\tSuggestion: store the constant into a variable in order to index it with a variable index\n"); + if (!build_context.terse_errors) { + error_line("\tSuggestion: store the constant into a variable in order to index it with a variable index\n"); + } gb_string_free(str); o->mode = Addressing_Invalid; o->expr = node; @@ -9694,7 +9710,9 @@ gb_internal ExprKind check_index_expr(CheckerContext *c, Operand *o, Ast *node, if (!success) { gbString str = expr_to_string(o->expr); error(o->expr, "Cannot index a constant '%s' with index %lld", str, cast(long long)index); - error_line("\tSuggestion: store the constant into a variable in order to index it with a variable index\n"); + if (!build_context.terse_errors) { + error_line("\tSuggestion: store the constant into a variable in order to index it with a variable index\n"); + } gb_string_free(str); o->mode = Addressing_Invalid; o->expr = node; @@ -9882,7 +9900,9 @@ gb_internal ExprKind check_slice_expr(CheckerContext *c, Operand *o, Ast *node, if (!all_constant) { gbString str = expr_to_string(o->expr); error(o->expr, "Cannot slice '%s' with non-constant indices", str); - error_line("\tSuggestion: store the constant into a variable in order to index it with a variable index\n"); + if (!build_context.terse_errors) { + error_line("\tSuggestion: store the constant into a variable in order to index it with a variable index\n"); + } gb_string_free(str); o->mode = Addressing_Value; // NOTE(bill): Keep subsequent values going without erring o->expr = node; @@ -10238,15 +10258,15 @@ gb_internal ExprKind check_expr_base_internal(CheckerContext *c, Operand *o, Ast } else { gbString str = expr_to_string(o->expr); gbString typ = type_to_string(o->type); - begin_error_block(); + ERROR_BLOCK(); error(o->expr, "Cannot dereference '%s' of type '%s'", str, typ); if (o->type && is_type_multi_pointer(o->type)) { - error_line("\tDid you mean '%s[0]'?\n", str); + if (!build_context.terse_errors) { + error_line("\tDid you mean '%s[0]'?\n", str); + } } - end_error_block(); - gb_string_free(typ); gb_string_free(str); o->mode = Addressing_Invalid; diff --git a/src/check_stmt.cpp b/src/check_stmt.cpp index b93be734e..d56e5e212 100644 --- a/src/check_stmt.cpp +++ b/src/check_stmt.cpp @@ -1085,8 +1085,7 @@ gb_internal void check_switch_stmt(CheckerContext *ctx, Ast *node, u32 mod_flags } if (unhandled.count > 0) { - begin_error_block(); - defer (end_error_block()); + ERROR_BLOCK(); if (unhandled.count == 1) { error_no_newline(node, "Unhandled switch case: %.*s", LIT(unhandled[0]->token.string)); @@ -1813,7 +1812,7 @@ gb_internal void check_value_decl_stmt(CheckerContext *ctx, Ast *node, u32 mod_f } if (new_name_count == 0) { - begin_error_block(); + ERROR_BLOCK(); error(node, "No new declarations on the left hand side"); bool all_underscore = true; for (Ast *name : vd->names) { @@ -1831,7 +1830,6 @@ gb_internal void check_value_decl_stmt(CheckerContext *ctx, Ast *node, u32 mod_f error_line("\tSuggestion: Try changing the declaration (:=) to an assignment (=)\n"); } - end_error_block(); } Type *init_type = nullptr; diff --git a/src/check_type.cpp b/src/check_type.cpp index f11418dc0..a95026711 100644 --- a/src/check_type.cpp +++ b/src/check_type.cpp @@ -2702,14 +2702,13 @@ gb_internal bool check_type_internal(CheckerContext *ctx, Ast *e, Type **type, T check_expr_or_type(&c, &o, pt->type); if (o.mode != Addressing_Invalid && o.mode != Addressing_Type) { // NOTE(bill): call check_type_expr again to get a consistent error message - begin_error_block(); + ERROR_BLOCK(); elem = check_type_expr(&c, pt->type, nullptr); if (o.mode == Addressing_Variable) { gbString s = expr_to_string(pt->type); error_line("\tSuggestion: ^ is used for pointer types, did you mean '&%s'?\n", s); gb_string_free(s); } - end_error_block(); } else { elem = o.type; } diff --git a/src/checker.cpp b/src/checker.cpp index 79328d648..4d7514d0b 100644 --- a/src/checker.cpp +++ b/src/checker.cpp @@ -968,10 +968,11 @@ gb_internal void init_universal(void) { add_global_bool_constant("true", true); add_global_bool_constant("false", false); - add_global_string_constant("ODIN_VENDOR", bc->ODIN_VENDOR); - add_global_string_constant("ODIN_VERSION", bc->ODIN_VERSION); - add_global_string_constant("ODIN_ROOT", bc->ODIN_ROOT); + add_global_string_constant("ODIN_VENDOR", bc->ODIN_VENDOR); + add_global_string_constant("ODIN_VERSION", bc->ODIN_VERSION); + add_global_string_constant("ODIN_ROOT", bc->ODIN_ROOT); add_global_string_constant("ODIN_BUILD_PROJECT_NAME", bc->ODIN_BUILD_PROJECT_NAME); + add_global_string_constant("ODIN_WINDOWS_SUBSYSTEM", bc->ODIN_WINDOWS_SUBSYSTEM); { GlobalEnumValue values[TargetOs_COUNT] = { @@ -1084,7 +1085,7 @@ gb_internal void init_universal(void) { add_global_constant("ODIN_COMPILE_TIMESTAMP", t_untyped_integer, exact_value_i64(odin_compile_timestamp())); - add_global_bool_constant("__ODIN_LLVM_F16_SUPPORTED", lb_use_new_pass_system()); + add_global_bool_constant("__ODIN_LLVM_F16_SUPPORTED", lb_use_new_pass_system() && !is_arch_wasm()); { GlobalEnumValue values[3] = { @@ -2581,6 +2582,9 @@ gb_internal void generate_minimum_dependency_set(Checker *c, Entity *start) { str_lit("multi_pointer_slice_expr_error"), ); + add_dependency_to_set(c, c->info.instrumentation_enter_entity); + add_dependency_to_set(c, c->info.instrumentation_exit_entity); + generate_minimum_dependency_set_internal(c, start); @@ -3413,6 +3417,39 @@ gb_internal DECL_ATTRIBUTE_PROC(proc_decl_attribute) { error(elem, "Expected a string value for '%.*s'", LIT(name)); } return true; + } else if (name == "entry_point_only") { + if (value != nullptr) { + error(value, "'%.*s' expects no parameter", LIT(name)); + } + ac->entry_point_only = true; + return true; + } else if (name == "no_instrumentation") { + ExactValue ev = check_decl_attribute_value(c, value); + if (ev.kind == ExactValue_Invalid) { + ac->no_instrumentation = Instrumentation_Disabled; + } else if (ev.kind == ExactValue_Bool) { + if (ev.value_bool) { + ac->no_instrumentation = Instrumentation_Disabled; + } else { + ac->no_instrumentation = Instrumentation_Enabled; + } + } else { + error(value, "Expected either a boolean or no parameter for '%.*s'", LIT(name)); + return false; + } + return true; + } else if (name == "instrumentation_enter") { + if (value != nullptr) { + error(value, "'%.*s' expects no parameter", LIT(name)); + } + ac->instrumentation_enter = true; + return true; + } else if (name == "instrumentation_exit") { + if (value != nullptr) { + error(value, "'%.*s' expects no parameter", LIT(name)); + } + ac->instrumentation_exit = true; + return true; } return false; } @@ -4022,12 +4059,11 @@ gb_internal void check_collect_value_decl(CheckerContext *c, Ast *decl) { if (c->foreign_context.default_cc > 0) { cc = c->foreign_context.default_cc; } else if (is_arch_wasm()) { - begin_error_block(); + ERROR_BLOCK(); error(init, "For wasm related targets, it is required that you either define the" " @(default_calling_convention=) on the foreign block or" " explicitly assign it on the procedure signature"); error_line("\tSuggestion: when dealing with normal Odin code (e.g. js_wasm32), use \"contextless\"; when dealing with Emscripten like code, use \"c\"\n"); - end_error_block(); } } e->Procedure.link_prefix = c->foreign_context.link_prefix; @@ -4074,8 +4110,7 @@ gb_internal void check_collect_value_decl(CheckerContext *c, Ast *decl) { if (e->kind != Entity_Procedure) { if (fl != nullptr) { - begin_error_block(); - defer (end_error_block()); + ERROR_BLOCK(); AstKind kind = init->kind; error(name, "Only procedures and variables are allowed to be in a foreign block, got %.*s", LIT(ast_strings[kind])); @@ -6215,6 +6250,17 @@ gb_internal void check_parsed_files(Checker *c) { GB_ASSERT(c->info.entity_queue.count.load(std::memory_order_relaxed) == 0); GB_ASSERT(c->info.definition_queue.count.load(std::memory_order_relaxed) == 0); + TIME_SECTION("check instrumentation calls"); + { + if ((c->info.instrumentation_enter_entity != nullptr) ^ + (c->info.instrumentation_exit_entity != nullptr)) { + Entity *e = c->info.instrumentation_enter_entity; + if (!e) e = c->info.instrumentation_exit_entity; + error(e->token, "Both @(instrumentation_enter) and @(instrumentation_exit) must be defined"); + } + } + + TIME_SECTION("add untyped expression values"); // Add untyped expression values for (UntypedExprInfo u = {}; mpsc_dequeue(&c->global_untyped_queue, &u); /**/) { diff --git a/src/checker.hpp b/src/checker.hpp index a6a5f6788..9da0f2950 100644 --- a/src/checker.hpp +++ b/src/checker.hpp @@ -103,6 +103,12 @@ struct DeferredProcedure { }; +enum InstrumentationFlag : i32 { + Instrumentation_Enabled = -1, + Instrumentation_Default = 0, + Instrumentation_Disabled = +1, +}; + struct AttributeContext { String link_name; String link_prefix; @@ -113,19 +119,23 @@ struct AttributeContext { String deprecated_message; String warning_message; DeferredProcedure deferred_procedure; - bool is_export : 1; - bool is_static : 1; - bool require_results : 1; - bool require_declaration : 1; - bool has_disabled_proc : 1; - bool disabled_proc : 1; - bool test : 1; - bool init : 1; - bool fini : 1; - bool set_cold : 1; + bool is_export : 1; + bool is_static : 1; + bool require_results : 1; + bool require_declaration : 1; + bool has_disabled_proc : 1; + bool disabled_proc : 1; + bool test : 1; + bool init : 1; + bool fini : 1; + bool set_cold : 1; + bool entry_point_only : 1; + bool instrumentation_enter : 1; + bool instrumentation_exit : 1; u32 optimization_mode; // ProcedureOptimizationMode i64 foreign_import_priority_index; String extra_linker_flags; + InstrumentationFlag no_instrumentation; String objc_class; String objc_name; @@ -402,6 +412,10 @@ struct CheckerInfo { BlockingMutex all_procedures_mutex; Array all_procedures; + + BlockingMutex instrumentation_mutex; + Entity *instrumentation_enter_entity; + Entity *instrumentation_exit_entity; }; struct CheckerContext { diff --git a/src/entity.cpp b/src/entity.cpp index ce27da3f2..e6c46d37e 100644 --- a/src/entity.cpp +++ b/src/entity.cpp @@ -250,6 +250,8 @@ struct Entity { bool is_export : 1; bool generated_from_polymorphic : 1; bool target_feature_disabled : 1; + bool entry_point_only : 1; + bool has_instrumentation : 1; String target_feature; } Procedure; struct { diff --git a/src/exact_value.cpp b/src/exact_value.cpp index cd499272f..b744d2db0 100644 --- a/src/exact_value.cpp +++ b/src/exact_value.cpp @@ -174,7 +174,7 @@ gb_internal ExactValue exact_value_integer_from_string(String const &string) { -gb_internal f64 float_from_string(String const &string) { +gb_internal f64 float_from_string(String const &string, bool *success = nullptr) { if (string.len < 128) { char buf[128] = {}; isize n = 0; @@ -187,7 +187,13 @@ gb_internal f64 float_from_string(String const &string) { buf[n++] = cast(char)c; } buf[n] = 0; - return atof(buf); + + char *end_ptr; + f64 f = strtod(buf, &end_ptr); + if (success != nullptr) { + *success = *end_ptr == '\0'; + } + return f; } else { TEMPORARY_ALLOCATOR_GUARD(); char *buf = gb_alloc_array(temporary_allocator(), char, string.len+1); @@ -201,7 +207,13 @@ gb_internal f64 float_from_string(String const &string) { buf[n++] = cast(char)c; } buf[n] = 0; - return atof(buf); + + char *end_ptr; + f64 f = strtod(buf, &end_ptr); + if (success != nullptr) { + *success = *end_ptr == '\0'; + } + return f; } /* isize i = 0; @@ -313,7 +325,11 @@ gb_internal ExactValue exact_value_float_from_string(String string) { return exact_value_integer_from_string(string); } - f64 f = float_from_string(string); + bool success; + f64 f = float_from_string(string, &success); + if (!success) { + return {ExactValue_Invalid}; + } return exact_value_float(f); } diff --git a/src/gb/gb.h b/src/gb/gb.h index 5dae7a5c4..93d250f21 100644 --- a/src/gb/gb.h +++ b/src/gb/gb.h @@ -448,7 +448,7 @@ typedef i32 b32; // NOTE(bill): Prefer this!!! #define gb_inline __forceinline #endif #else - #define gb_inline __attribute__ ((__always_inline__)) + #define gb_inline inline __attribute__ ((__always_inline__)) #endif #endif diff --git a/src/linker.cpp b/src/linker.cpp index 7fec11ad3..b8909ac6a 100644 --- a/src/linker.cpp +++ b/src/linker.cpp @@ -233,7 +233,6 @@ gb_internal i32 linker_stage(LinkerData *gen) { String windows_sdk_bin_path = path_to_string(heap_allocator(), build_context.build_paths[BuildPath_Win_SDK_Bin_Path]); defer (gb_free(heap_allocator(), windows_sdk_bin_path.text)); - char const *subsystem_str = build_context.use_subsystem_windows ? "WINDOWS" : "CONSOLE"; if (!build_context.use_lld) { // msvc String res_path = {}; defer (gb_free(heap_allocator(), res_path.text)); @@ -265,14 +264,14 @@ gb_internal i32 linker_stage(LinkerData *gen) { result = system_exec_command_line_app("msvc-link", "\"%.*slink.exe\" %s %.*s -OUT:\"%.*s\" %s " - "/nologo /incremental:no /opt:ref /subsystem:%s " + "/nologo /incremental:no /opt:ref /subsystem:%.*s " "%.*s " "%.*s " "%s " "", LIT(vs_exe_path), object_files, LIT(res_path), LIT(output_filename), link_settings, - subsystem_str, + LIT(build_context.ODIN_WINDOWS_SUBSYSTEM), LIT(build_context.link_flags), LIT(build_context.extra_linker_flags), lib_str @@ -283,14 +282,14 @@ gb_internal i32 linker_stage(LinkerData *gen) { } else { // lld result = system_exec_command_line_app("msvc-lld-link", "\"%.*s\\bin\\lld-link\" %s -OUT:\"%.*s\" %s " - "/nologo /incremental:no /opt:ref /subsystem:%s " + "/nologo /incremental:no /opt:ref /subsystem:%.*s " "%.*s " "%.*s " "%s " "", LIT(build_context.ODIN_ROOT), object_files, LIT(output_filename), link_settings, - subsystem_str, + LIT(build_context.ODIN_WINDOWS_SUBSYSTEM), LIT(build_context.link_flags), LIT(build_context.extra_linker_flags), lib_str @@ -484,6 +483,17 @@ gb_internal i32 linker_stage(LinkerData *gen) { defer (gb_string_free(platform_lib_str)); if (build_context.metrics.os == TargetOs_darwin) { platform_lib_str = gb_string_appendc(platform_lib_str, "-Wl,-syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -L/usr/local/lib"); + + // Homebrew's default library path, checking if it exists to avoid linking warnings. + if (gb_file_exists("/opt/homebrew/lib")) { + platform_lib_str = gb_string_appendc(platform_lib_str, " -L/opt/homebrew/lib"); + } + + // MacPort's default library path, checking if it exists to avoid linking warnings. + if (gb_file_exists("/opt/local/lib")) { + platform_lib_str = gb_string_appendc(platform_lib_str, " -L/opt/local/lib"); + } + #if defined(GB_SYSTEM_OSX) if(!build_context.no_crt) { platform_lib_str = gb_string_appendc(platform_lib_str, " -lm "); diff --git a/src/llvm_backend.cpp b/src/llvm_backend.cpp index ca71a0f45..003424e0a 100644 --- a/src/llvm_backend.cpp +++ b/src/llvm_backend.cpp @@ -1497,8 +1497,6 @@ gb_internal WORKER_TASK_PROC(lb_llvm_module_pass_worker_proc) { auto passes = array_make(heap_allocator(), 0, 64); defer (array_free(&passes)); - - LLVMPassBuilderOptionsRef pb_options = LLVMCreatePassBuilderOptions(); defer (LLVMDisposePassBuilderOptions(pb_options)); @@ -2505,7 +2503,7 @@ gb_internal bool lb_generate_code(lbGenerator *gen) { LLVMCodeModel code_mode = LLVMCodeModelDefault; if (is_arch_wasm()) { code_mode = LLVMCodeModelJITDefault; - } else if (build_context.metrics.os == TargetOs_freestanding) { + } else if (is_arch_x86() && build_context.metrics.os == TargetOs_freestanding) { code_mode = LLVMCodeModelKernel; } @@ -2531,7 +2529,46 @@ gb_internal bool lb_generate_code(lbGenerator *gen) { */ if (build_context.target_features_set.entries.count != 0) { - llvm_features = target_features_set_to_cstring(permanent_allocator(), false); + // Prefix all of the features with a `+`, because we are + // enabling additional features. + char const *additional_features = target_features_set_to_cstring(permanent_allocator(), false, true); + + String f_string = make_string_c(llvm_features); + String a_string = make_string_c(additional_features); + isize f_len = f_string.len; + + if (f_len == 0) { + // The common case is that llvm_features is empty, so + // the target_features_set additions can be used as is. + llvm_features = additional_features; + } else { + // The user probably specified `-microarch:native`, so + // llvm_features is populated by LLVM's idea of what + // the host CPU supports. + // + // As far as I can tell, (which is barely better than + // wild guessing), a bitset is formed by parsing the + // string left to right. + // + // So, llvm_features + ',' + additonal_features, will + // makes the target_features_set override llvm_features. + + char *tmp = gb_alloc_array(permanent_allocator(), char, f_len + 1 + a_string.len + 1); + isize len = 0; + + // tmp = f_string + gb_memmove(tmp, f_string.text, f_string.len); + len += f_string.len; + // tmp += ',' + tmp[len++] = ','; + // tmp += a_string + gb_memmove(tmp + len, a_string.text, a_string.len); + len += a_string.len; + // tmp += NUL + tmp[len++] = 0; + + llvm_features = tmp; + } } // GB_ASSERT_MSG(LLVMTargetHasAsmBackend(target)); diff --git a/src/llvm_backend.hpp b/src/llvm_backend.hpp index 4e193bcea..fe2c2deba 100644 --- a/src/llvm_backend.hpp +++ b/src/llvm_backend.hpp @@ -563,7 +563,9 @@ gb_internal LLVMTypeRef OdinLLVMGetVectorElementType(LLVMTypeRef type); gb_internal String lb_filepath_ll_for_module(lbModule *m); +gb_internal LLVMTypeRef lb_type_internal_for_procedures_raw(lbModule *m, Type *type); +gb_internal lbValue lb_emit_source_code_location_as_global_ptr(lbProcedure *p, String const &procedure, TokenPos const &pos); gb_internal LLVMTypeRef llvm_array_type(LLVMTypeRef ElementType, uint64_t ElementCount) { #if LB_USE_NEW_PASS_SYSTEM diff --git a/src/llvm_backend_general.cpp b/src/llvm_backend_general.cpp index 54327cc54..f0f5327c6 100644 --- a/src/llvm_backend_general.cpp +++ b/src/llvm_backend_general.cpp @@ -2348,6 +2348,15 @@ gb_internal LLVMAttributeRef lb_create_enum_attribute(LLVMContextRef ctx, char c return LLVMCreateEnumAttribute(ctx, kind, value); } +gb_internal LLVMAttributeRef lb_create_string_attribute(LLVMContextRef ctx, String const &key, String const &value) { + LLVMAttributeRef attr = LLVMCreateStringAttribute( + ctx, + cast(char const *)key.text, cast(unsigned)key.len, + cast(char const *)value.text, cast(unsigned)value.len); + return attr; +} + + gb_internal void lb_add_proc_attribute_at_index(lbProcedure *p, isize index, char const *name, u64 value) { LLVMAttributeRef attr = lb_create_enum_attribute(p->module->ctx, name, value); GB_ASSERT(attr != nullptr); @@ -2361,6 +2370,10 @@ gb_internal void lb_add_proc_attribute_at_index(lbProcedure *p, isize index, cha gb_internal void lb_add_attribute_to_proc(lbModule *m, LLVMValueRef proc_value, char const *name, u64 value=0) { LLVMAddAttributeAtIndex(proc_value, LLVMAttributeIndex_FunctionIndex, lb_create_enum_attribute(m->ctx, name, value)); } +gb_internal void lb_add_attribute_to_proc_with_string(lbModule *m, LLVMValueRef proc_value, String const &name, String const &value) { + LLVMAttributeRef attr = lb_create_string_attribute(m->ctx, name, value); + LLVMAddAttributeAtIndex(proc_value, LLVMAttributeIndex_FunctionIndex, attr); +} diff --git a/src/llvm_backend_opt.cpp b/src/llvm_backend_opt.cpp index 2e03b7974..b57e74799 100644 --- a/src/llvm_backend_opt.cpp +++ b/src/llvm_backend_opt.cpp @@ -380,6 +380,86 @@ gb_internal void lb_run_remove_dead_instruction_pass(lbProcedure *p) { } } +gb_internal LLVMValueRef lb_run_instrumentation_pass_insert_call(lbProcedure *p, Entity *entity, LLVMBuilderRef dummy_builder) { + lbModule *m = p->module; + + lbValue cc = lb_find_procedure_value_from_entity(m, entity); + + LLVMValueRef args[3] = {}; + args[0] = p->value; + + LLVMValueRef returnaddress_args[1] = {}; + + returnaddress_args[0] = LLVMConstInt(LLVMInt32TypeInContext(m->ctx), 0, false); + + char const *instrinsic_name = "llvm.returnaddress"; + unsigned id = LLVMLookupIntrinsicID(instrinsic_name, gb_strlen(instrinsic_name)); + GB_ASSERT_MSG(id != 0, "Unable to find %s", instrinsic_name); + LLVMValueRef ip = LLVMGetIntrinsicDeclaration(m->mod, id, nullptr, 0); + LLVMTypeRef call_type = LLVMIntrinsicGetType(m->ctx, id, nullptr, 0); + args[1] = LLVMBuildCall2(dummy_builder, call_type, ip, returnaddress_args, gb_count_of(returnaddress_args), ""); + + Token name = {}; + if (p->entity) { + name = p->entity->token; + } + args[2] = lb_emit_source_code_location_as_global_ptr(p, name.string, name.pos).value; + + LLVMTypeRef fnp = lb_type_internal_for_procedures_raw(p->module, entity->type); + return LLVMBuildCall2(dummy_builder, fnp, cc.value, args, gb_count_of(args), ""); +} + + +gb_internal void lb_run_instrumentation_pass(lbProcedure *p) { + lbModule *m = p->module; + Entity *enter = m->info->instrumentation_enter_entity; + Entity *exit = m->info->instrumentation_exit_entity; + if (enter == nullptr || exit == nullptr) { + return; + } + if (!(p->entity && + p->entity->kind == Entity_Procedure && + p->entity->Procedure.has_instrumentation)) { + return; + } + +#define LLVM_V_NAME(x) x, cast(unsigned)(gb_count_of(x)-1) + + LLVMBuilderRef dummy_builder = LLVMCreateBuilderInContext(m->ctx); + defer (LLVMDisposeBuilder(dummy_builder)); + + LLVMBasicBlockRef entry_bb = p->entry_block->block; + LLVMPositionBuilder(dummy_builder, entry_bb, LLVMGetFirstInstruction(entry_bb)); + lb_run_instrumentation_pass_insert_call(p, enter, dummy_builder); + LLVMRemoveStringAttributeAtIndex(p->value, LLVMAttributeIndex_FunctionIndex, LLVM_V_NAME("instrument-function-entry")); + + unsigned bb_count = LLVMCountBasicBlocks(p->value); + LLVMBasicBlockRef *bbs = gb_alloc_array(temporary_allocator(), LLVMBasicBlockRef, bb_count); + LLVMGetBasicBlocks(p->value, bbs); + for (unsigned i = 0; i < bb_count; i++) { + LLVMBasicBlockRef bb = bbs[i]; + LLVMValueRef terminator = LLVMGetBasicBlockTerminator(bb); + if (terminator == nullptr || + !LLVMIsAReturnInst(terminator)) { + continue; + } + + // TODO(bill): getTerminatingMustTailCall() + // If T is preceded by a musttail call, that's the real terminator. + // if (CallInst *CI = BB.getTerminatingMustTailCall()) + // T = CI; + + + LLVMPositionBuilderBefore(dummy_builder, terminator); + lb_run_instrumentation_pass_insert_call(p, exit, dummy_builder); + } + + LLVMRemoveStringAttributeAtIndex(p->value, LLVMAttributeIndex_FunctionIndex, LLVM_V_NAME("instrument-function-exit")); + +#undef LLVM_V_NAME +} + + gb_internal void lb_run_function_pass_manager(LLVMPassManagerRef fpm, lbProcedure *p, lbFunctionPassManagerKind pass_manager_kind) { if (p == nullptr) { @@ -401,6 +481,7 @@ gb_internal void lb_run_function_pass_manager(LLVMPassManagerRef fpm, lbProcedur } break; } + lb_run_instrumentation_pass(p); LLVMRunFunctionPassManager(fpm, p->value); } @@ -552,3 +633,5 @@ gb_internal void lb_run_remove_unused_globals_pass(lbModule *m) { } } } + + diff --git a/src/llvm_backend_proc.cpp b/src/llvm_backend_proc.cpp index 1244bd377..09bebd0cf 100644 --- a/src/llvm_backend_proc.cpp +++ b/src/llvm_backend_proc.cpp @@ -329,6 +329,18 @@ gb_internal lbProcedure *lb_create_procedure(lbModule *m, Entity *entity, bool i } } + if (p->body && entity->Procedure.has_instrumentation) { + Entity *instrumentation_enter = m->info->instrumentation_enter_entity; + Entity *instrumentation_exit = m->info->instrumentation_exit_entity; + if (instrumentation_enter && instrumentation_exit) { + String enter = lb_get_entity_name(m, instrumentation_enter); + String exit = lb_get_entity_name(m, instrumentation_exit); + + lb_add_attribute_to_proc_with_string(m, p->value, make_string_c("instrument-function-entry"), enter); + lb_add_attribute_to_proc_with_string(m, p->value, make_string_c("instrument-function-exit"), exit); + } + } + lbValue proc_value = {p->value, p->type}; lb_add_entity(m, entity, proc_value); lb_add_member(m, p->name, proc_value); @@ -1826,24 +1838,41 @@ gb_internal lbValue lb_build_builtin_proc(lbProcedure *p, Ast *expr, TypeAndValu } case BuiltinProc_quaternion: { - lbValue real = lb_build_expr(p, ce->args[0]); - lbValue imag = lb_build_expr(p, ce->args[1]); - lbValue jmag = lb_build_expr(p, ce->args[2]); - lbValue kmag = lb_build_expr(p, ce->args[3]); + lbValue xyzw[4] = {}; + for (i32 i = 0; i < 4; i++) { + ast_node(f, FieldValue, ce->args[i]); + GB_ASSERT(f->field->kind == Ast_Ident); + String name = f->field->Ident.token.string; + i32 index = -1; + + // @QuaternionLayout + if (name == "x" || name == "imag") { + index = 0; + } else if (name == "y" || name == "jmag") { + index = 1; + } else if (name == "z" || name == "kmag") { + index = 2; + } else if (name == "w" || name == "real") { + index = 3; + } + GB_ASSERT(index >= 0); + + xyzw[index] = lb_build_expr(p, f->value); + } + - // @QuaternionLayout lbAddr dst_addr = lb_add_local_generated(p, tv.type, false); lbValue dst = lb_addr_get_ptr(p, dst_addr); Type *ft = base_complex_elem_type(tv.type); - real = lb_emit_conv(p, real, ft); - imag = lb_emit_conv(p, imag, ft); - jmag = lb_emit_conv(p, jmag, ft); - kmag = lb_emit_conv(p, kmag, ft); - lb_emit_store(p, lb_emit_struct_ep(p, dst, 3), real); - lb_emit_store(p, lb_emit_struct_ep(p, dst, 0), imag); - lb_emit_store(p, lb_emit_struct_ep(p, dst, 1), jmag); - lb_emit_store(p, lb_emit_struct_ep(p, dst, 2), kmag); + xyzw[0] = lb_emit_conv(p, xyzw[0], ft); + xyzw[1] = lb_emit_conv(p, xyzw[1], ft); + xyzw[2] = lb_emit_conv(p, xyzw[2], ft); + xyzw[3] = lb_emit_conv(p, xyzw[3], ft); + lb_emit_store(p, lb_emit_struct_ep(p, dst, 0), xyzw[0]); + lb_emit_store(p, lb_emit_struct_ep(p, dst, 1), xyzw[1]); + lb_emit_store(p, lb_emit_struct_ep(p, dst, 2), xyzw[2]); + lb_emit_store(p, lb_emit_struct_ep(p, dst, 3), xyzw[3]); return lb_emit_load(p, dst); } diff --git a/src/main.cpp b/src/main.cpp index 4d4e01ada..19271d667 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1160,10 +1160,12 @@ gb_internal bool parse_build_flags(Array args) { case BuildFlag_TerseErrors: build_context.hide_error_line = true; + build_context.terse_errors = true; break; case BuildFlag_VerboseErrors: gb_printf_err("-verbose-errors is not the default, -terse-errors can now disable it\n"); build_context.hide_error_line = false; + build_context.terse_errors = false; break; case BuildFlag_ErrorPosStyle: @@ -1268,16 +1270,43 @@ gb_internal bool parse_build_flags(Array args) { } case BuildFlag_Subsystem: { + // TODO(Jeroen): Parse optional "[,major[.minor]]" + GB_ASSERT(value.kind == ExactValue_String); String subsystem = value.value_string; - if (str_eq_ignore_case(subsystem, str_lit("console"))) { - build_context.use_subsystem_windows = false; - } else if (str_eq_ignore_case(subsystem, str_lit("window"))) { - build_context.use_subsystem_windows = true; - } else if (str_eq_ignore_case(subsystem, str_lit("windows"))) { - build_context.use_subsystem_windows = true; - } else { - gb_printf_err("Invalid -subsystem string, got %.*s, expected either 'console' or 'windows'\n", LIT(subsystem)); + bool subsystem_found = false; + for (int i = 0; i < Windows_Subsystem_COUNT; i++) { + if (str_eq_ignore_case(subsystem, windows_subsystem_names[i])) { + build_context.ODIN_WINDOWS_SUBSYSTEM = windows_subsystem_names[i]; + subsystem_found = true; + break; + } + } + + // WINDOW is a hidden alias for WINDOWS. Check it. + String subsystem_windows_alias = str_lit("WINDOW"); + if (!subsystem_found && str_eq_ignore_case(subsystem, subsystem_windows_alias)) { + build_context.ODIN_WINDOWS_SUBSYSTEM = windows_subsystem_names[Windows_Subsystem_WINDOWS]; + subsystem_found = true; + break; + } + + if (!subsystem_found) { + gb_printf_err("Invalid -subsystem string, got %.*s. Expected one of:\n", LIT(subsystem)); + gb_printf_err("\t"); + for (int i = 0; i < Windows_Subsystem_COUNT; i++) { + if (i > 0) { + gb_printf_err(", "); + } + gb_printf_err("%.*s", LIT(windows_subsystem_names[i])); + if (i == Windows_Subsystem_CONSOLE) { + gb_printf_err(" (default)"); + } + if (i == Windows_Subsystem_WINDOWS) { + gb_printf_err(" (or WINDOW)"); + } + } + gb_printf_err("\n"); bad_flags = true; } break; diff --git a/src/parser.cpp b/src/parser.cpp index c0498b425..2671054df 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -5919,7 +5919,7 @@ gb_internal bool parse_file(Parser *p, AstFile *f) { f->vet_flags = parse_vet_tag(tok, lc); f->vet_flags_set = true; } else if (string_starts_with(lc, str_lit("+ignore"))) { - return false; + return false; } else if (string_starts_with(lc, str_lit("+private"))) { f->flags |= AstFile_IsPrivatePkg; String command = string_trim_starts_with(lc, str_lit("+private ")); @@ -5941,6 +5941,8 @@ gb_internal bool parse_file(Parser *p, AstFile *f) { } else { f->flags |= AstFile_IsLazy; } + } else if (lc == "+no-instrumentation") { + f->flags |= AstFile_NoInstrumentation; } else { warning(tok, "Ignoring unknown tag '%.*s'", LIT(lc)); } diff --git a/src/parser.hpp b/src/parser.hpp index bce818652..cc1836ef3 100644 --- a/src/parser.hpp +++ b/src/parser.hpp @@ -76,6 +76,8 @@ enum AstFileFlag : u32 { AstFile_IsTest = 1<<3, AstFile_IsLazy = 1<<4, + + AstFile_NoInstrumentation = 1<<5, }; enum AstDelayQueueKind { diff --git a/src/threading.cpp b/src/threading.cpp index 74aa3eb7e..c283da425 100644 --- a/src/threading.cpp +++ b/src/threading.cpp @@ -210,7 +210,7 @@ gb_internal void semaphore_wait(Semaphore *s) { original_count = s->count().load(std::memory_order_relaxed); } - if (!s->count().compare_exchange_strong(original_count, original_count-1, std::memory_order_acquire, std::memory_order_acquire)) { + if (s->count().compare_exchange_strong(original_count, original_count-1, std::memory_order_acquire, std::memory_order_acquire)) { return; } } diff --git a/src/types.cpp b/src/types.cpp index 574e628c5..2f39d5caa 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -825,11 +825,13 @@ gb_internal void type_path_pop(TypePath *tp) { #define FAILURE_SIZE 0 #define FAILURE_ALIGNMENT 0 +gb_internal bool type_ptr_set_exists(PtrSet *s, Type *t); + gb_internal bool type_ptr_set_update(PtrSet *s, Type *t) { if (t == nullptr) { return true; } - if (ptr_set_exists(s, t)) { + if (type_ptr_set_exists(s, t)) { return true; } ptr_set_add(s, t); diff --git a/tests/core/strings/test_core_strings.odin b/tests/core/strings/test_core_strings.odin index fdaf3af28..3424675b3 100644 --- a/tests/core/strings/test_core_strings.odin +++ b/tests/core/strings/test_core_strings.odin @@ -67,6 +67,18 @@ test_index_any_larger_string_found :: proc(t: ^testing.T) { expect(t, index == 8, "index_any should be 8") } +@test +test_last_index_any_small_string_found :: proc(t: ^testing.T) { + index := strings.last_index_any(".", "/:.\"") + expect(t, index == 0, "last_index_any should be 0") +} + +@test +test_last_index_any_small_string_not_found :: proc(t: ^testing.T) { + index := strings.last_index_any(".", "/:\"") + expect(t, index == -1, "last_index_any should be -1") +} + Cut_Test :: struct { input: string, offset: int, diff --git a/vendor/commonmark/cmark.odin b/vendor/commonmark/cmark.odin index d6801b53a..4331e3116 100644 --- a/vendor/commonmark/cmark.odin +++ b/vendor/commonmark/cmark.odin @@ -25,6 +25,8 @@ when ODIN_OS == .Windows { foreign import lib "system:cmark" } else when ODIN_OS == .Darwin { foreign import lib "system:cmark" +} else { + foreign import lib "system:cmark" } Option :: enum c.int { @@ -509,7 +511,7 @@ cmark_allocator_proc :: proc(allocator_data: rawptr, mode: runtime.Allocator_Mod case .Free_All: return nil, .Mode_Not_Implemented - case .Resize: + case .Resize, .Resize_Non_Zeroed: new_ptr := cmark_alloc.realloc(old_memory, c.size_t(size)) res = transmute([]byte)runtime.Raw_Slice{new_ptr, size} if size > old_size { diff --git a/vendor/darwin/CoreVideo/CVDisplayLink.odin b/vendor/darwin/CoreVideo/CVDisplayLink.odin index 980a44803..fae988e0a 100644 --- a/vendor/darwin/CoreVideo/CVDisplayLink.odin +++ b/vendor/darwin/CoreVideo/CVDisplayLink.odin @@ -1,4 +1,3 @@ -//+build darwin package CoreVideo DisplayLinkRef :: distinct rawptr diff --git a/vendor/darwin/Foundation/NSApplication.odin b/vendor/darwin/Foundation/NSApplication.odin index 7b89d84b0..3fa0d28b6 100644 --- a/vendor/darwin/Foundation/NSApplication.odin +++ b/vendor/darwin/Foundation/NSApplication.odin @@ -1,4 +1,3 @@ -//+build darwin package objc_Foundation foreign import "system:Foundation.framework" diff --git a/vendor/darwin/Foundation/NSArray.odin b/vendor/darwin/Foundation/NSArray.odin index ac4aa6181..3e6520c0d 100644 --- a/vendor/darwin/Foundation/NSArray.odin +++ b/vendor/darwin/Foundation/NSArray.odin @@ -1,4 +1,3 @@ -//+build darwin package objc_Foundation import "core:intrinsics" diff --git a/vendor/darwin/Foundation/NSAutoreleasePool.odin b/vendor/darwin/Foundation/NSAutoreleasePool.odin index d3a6f490f..8eb3657b6 100644 --- a/vendor/darwin/Foundation/NSAutoreleasePool.odin +++ b/vendor/darwin/Foundation/NSAutoreleasePool.odin @@ -1,4 +1,3 @@ -//+build darwin package objc_Foundation @(objc_class="NSAutoreleasePool") diff --git a/vendor/darwin/Foundation/NSBlock.odin b/vendor/darwin/Foundation/NSBlock.odin index 29bd210de..ecb31bcfb 100644 --- a/vendor/darwin/Foundation/NSBlock.odin +++ b/vendor/darwin/Foundation/NSBlock.odin @@ -1,4 +1,3 @@ -//+build darwin package objc_Foundation import "core:intrinsics" diff --git a/vendor/darwin/Foundation/NSBundle.odin b/vendor/darwin/Foundation/NSBundle.odin index 450a6d951..25fc8df32 100644 --- a/vendor/darwin/Foundation/NSBundle.odin +++ b/vendor/darwin/Foundation/NSBundle.odin @@ -1,4 +1,3 @@ -//+build darwin package objc_Foundation @(objc_class="NSBundle") diff --git a/vendor/darwin/Foundation/NSColor.odin b/vendor/darwin/Foundation/NSColor.odin index 4c0325c1a..453b33144 100644 --- a/vendor/darwin/Foundation/NSColor.odin +++ b/vendor/darwin/Foundation/NSColor.odin @@ -1,4 +1,3 @@ -//+build darwin package objc_Foundation @(objc_class="NSColorSpace") diff --git a/vendor/darwin/Foundation/NSData.odin b/vendor/darwin/Foundation/NSData.odin index 069a59b64..04c1ce25d 100644 --- a/vendor/darwin/Foundation/NSData.odin +++ b/vendor/darwin/Foundation/NSData.odin @@ -1,4 +1,3 @@ -//+build darwin package objc_Foundation @(objc_class="NSData") diff --git a/vendor/darwin/Foundation/NSDate.odin b/vendor/darwin/Foundation/NSDate.odin index e4564e06b..f8096c698 100644 --- a/vendor/darwin/Foundation/NSDate.odin +++ b/vendor/darwin/Foundation/NSDate.odin @@ -1,4 +1,3 @@ -//+build darwin package objc_Foundation @(objc_class="NSDate") diff --git a/vendor/darwin/Foundation/NSDictionary.odin b/vendor/darwin/Foundation/NSDictionary.odin index f84954656..8af58cf62 100644 --- a/vendor/darwin/Foundation/NSDictionary.odin +++ b/vendor/darwin/Foundation/NSDictionary.odin @@ -1,4 +1,3 @@ -//+build darwin package objc_Foundation @(objc_class="NSDictionary") diff --git a/vendor/darwin/Foundation/NSEnumerator.odin b/vendor/darwin/Foundation/NSEnumerator.odin index 717e58e4c..555e58141 100644 --- a/vendor/darwin/Foundation/NSEnumerator.odin +++ b/vendor/darwin/Foundation/NSEnumerator.odin @@ -1,4 +1,3 @@ -//+build darwin package objc_Foundation import "core:c" diff --git a/vendor/darwin/Foundation/NSError.odin b/vendor/darwin/Foundation/NSError.odin index 77b556e91..1657befe2 100644 --- a/vendor/darwin/Foundation/NSError.odin +++ b/vendor/darwin/Foundation/NSError.odin @@ -1,4 +1,3 @@ -//+build darwin package objc_Foundation foreign import "system:Foundation.framework" diff --git a/vendor/darwin/Foundation/NSEvent.odin b/vendor/darwin/Foundation/NSEvent.odin index fa66c7fa6..b9f247230 100644 --- a/vendor/darwin/Foundation/NSEvent.odin +++ b/vendor/darwin/Foundation/NSEvent.odin @@ -1,4 +1,3 @@ -//+build darwin package objc_Foundation @(objc_class="NSEvent") diff --git a/vendor/darwin/Foundation/NSLock.odin b/vendor/darwin/Foundation/NSLock.odin index d9662968d..168380669 100644 --- a/vendor/darwin/Foundation/NSLock.odin +++ b/vendor/darwin/Foundation/NSLock.odin @@ -1,4 +1,3 @@ -//+build darwin package objc_Foundation Locking :: struct($T: typeid) {using _: Object} diff --git a/vendor/darwin/Foundation/NSMenu.odin b/vendor/darwin/Foundation/NSMenu.odin index 5a4f7b1f5..6ed9b9918 100644 --- a/vendor/darwin/Foundation/NSMenu.odin +++ b/vendor/darwin/Foundation/NSMenu.odin @@ -1,4 +1,3 @@ -//+build darwin package objc_Foundation import "core:builtin" diff --git a/vendor/darwin/Foundation/NSNotification.odin b/vendor/darwin/Foundation/NSNotification.odin index d319395a5..f766d0cab 100644 --- a/vendor/darwin/Foundation/NSNotification.odin +++ b/vendor/darwin/Foundation/NSNotification.odin @@ -1,4 +1,3 @@ -//+build darwin package objc_Foundation @(objc_class="NSNotification") diff --git a/vendor/darwin/Foundation/NSNumber.odin b/vendor/darwin/Foundation/NSNumber.odin index a2d3c2d16..b3124885f 100644 --- a/vendor/darwin/Foundation/NSNumber.odin +++ b/vendor/darwin/Foundation/NSNumber.odin @@ -1,4 +1,3 @@ -//+build darwin package objc_Foundation import "core:c" diff --git a/vendor/darwin/Foundation/NSObject.odin b/vendor/darwin/Foundation/NSObject.odin index 7c529aa09..fdcf05880 100644 --- a/vendor/darwin/Foundation/NSObject.odin +++ b/vendor/darwin/Foundation/NSObject.odin @@ -1,4 +1,3 @@ -//+build darwin package objc_Foundation import "core:intrinsics" diff --git a/vendor/darwin/Foundation/NSOpenPanel.odin b/vendor/darwin/Foundation/NSOpenPanel.odin index 6b5dc0b6b..ac5f9674e 100644 --- a/vendor/darwin/Foundation/NSOpenPanel.odin +++ b/vendor/darwin/Foundation/NSOpenPanel.odin @@ -1,4 +1,3 @@ -//+build darwin package objc_Foundation @(objc_class="NSOpenPanel") diff --git a/vendor/darwin/Foundation/NSPanel.odin b/vendor/darwin/Foundation/NSPanel.odin index b18ebc81e..4bdf08cdb 100644 --- a/vendor/darwin/Foundation/NSPanel.odin +++ b/vendor/darwin/Foundation/NSPanel.odin @@ -1,4 +1,3 @@ -//+build darwin package objc_Foundation ModalResponse :: enum UInteger { diff --git a/vendor/darwin/Foundation/NSPasteboard.odin b/vendor/darwin/Foundation/NSPasteboard.odin index a1e23d977..74cf7d172 100644 --- a/vendor/darwin/Foundation/NSPasteboard.odin +++ b/vendor/darwin/Foundation/NSPasteboard.odin @@ -1,4 +1,3 @@ -//+build darwin package objc_Foundation @(objc_class="NSPasteboard") diff --git a/vendor/darwin/Foundation/NSRange.odin b/vendor/darwin/Foundation/NSRange.odin index b23b170ed..dcb100e91 100644 --- a/vendor/darwin/Foundation/NSRange.odin +++ b/vendor/darwin/Foundation/NSRange.odin @@ -1,4 +1,3 @@ -//+build darwin package objc_Foundation Range :: struct { diff --git a/vendor/darwin/Foundation/NSSavePanel.odin b/vendor/darwin/Foundation/NSSavePanel.odin index b749cde53..8e4d7a07b 100644 --- a/vendor/darwin/Foundation/NSSavePanel.odin +++ b/vendor/darwin/Foundation/NSSavePanel.odin @@ -1,4 +1,3 @@ -//+build darwin package objc_Foundation @(objc_class="NSSavePanel") diff --git a/vendor/darwin/Foundation/NSScreen.odin b/vendor/darwin/Foundation/NSScreen.odin index 70270f680..a8fe44aa5 100644 --- a/vendor/darwin/Foundation/NSScreen.odin +++ b/vendor/darwin/Foundation/NSScreen.odin @@ -1,4 +1,3 @@ -//+build darwin package objc_Foundation @(objc_class="NSScreen") diff --git a/vendor/darwin/Foundation/NSSet.odin b/vendor/darwin/Foundation/NSSet.odin index 173c11f04..7fb8db6c2 100644 --- a/vendor/darwin/Foundation/NSSet.odin +++ b/vendor/darwin/Foundation/NSSet.odin @@ -1,4 +1,3 @@ -//+build darwin package objc_Foundation @(objc_class="NSSet") diff --git a/vendor/darwin/Foundation/NSString.odin b/vendor/darwin/Foundation/NSString.odin index ba8f57129..d3c6c454d 100644 --- a/vendor/darwin/Foundation/NSString.odin +++ b/vendor/darwin/Foundation/NSString.odin @@ -1,4 +1,3 @@ -//+build darwin package objc_Foundation foreign import "system:Foundation.framework" diff --git a/vendor/darwin/Foundation/NSTypes.odin b/vendor/darwin/Foundation/NSTypes.odin index 78c62e6c1..671832a2d 100644 --- a/vendor/darwin/Foundation/NSTypes.odin +++ b/vendor/darwin/Foundation/NSTypes.odin @@ -1,4 +1,3 @@ -//+build darwin package objc_Foundation import "core:intrinsics" diff --git a/vendor/darwin/Foundation/NSURL.odin b/vendor/darwin/Foundation/NSURL.odin index ab8454f56..9e9081219 100644 --- a/vendor/darwin/Foundation/NSURL.odin +++ b/vendor/darwin/Foundation/NSURL.odin @@ -1,4 +1,3 @@ -//+build darwin package objc_Foundation @(objc_class="NSURL") diff --git a/vendor/darwin/Foundation/NSUndoManager.odin b/vendor/darwin/Foundation/NSUndoManager.odin index 4a19ac254..16411dcb4 100644 --- a/vendor/darwin/Foundation/NSUndoManager.odin +++ b/vendor/darwin/Foundation/NSUndoManager.odin @@ -1,4 +1,3 @@ -//+build darwin package objc_Foundation @(objc_class="NSUndoManager") diff --git a/vendor/darwin/Foundation/NSUserActivity.odin b/vendor/darwin/Foundation/NSUserActivity.odin index 2540d0deb..3b2f956ee 100644 --- a/vendor/darwin/Foundation/NSUserActivity.odin +++ b/vendor/darwin/Foundation/NSUserActivity.odin @@ -1,4 +1,3 @@ -//+build darwin package objc_Foundation @(objc_class="NSUserActivity") diff --git a/vendor/darwin/Foundation/NSUserDefaults.odin b/vendor/darwin/Foundation/NSUserDefaults.odin index df7bb487a..a8a6d7545 100644 --- a/vendor/darwin/Foundation/NSUserDefaults.odin +++ b/vendor/darwin/Foundation/NSUserDefaults.odin @@ -1,4 +1,3 @@ -//+build darwin package objc_Foundation @(objc_class="NSUserDefaults") diff --git a/vendor/darwin/Foundation/NSWindow.odin b/vendor/darwin/Foundation/NSWindow.odin index 48c972d8e..16dd5afc3 100644 --- a/vendor/darwin/Foundation/NSWindow.odin +++ b/vendor/darwin/Foundation/NSWindow.odin @@ -1,4 +1,3 @@ -//+build darwin package objc_Foundation import "core:strings" diff --git a/vendor/darwin/Foundation/objc.odin b/vendor/darwin/Foundation/objc.odin index 3c25e6669..6469b1d1d 100644 --- a/vendor/darwin/Foundation/objc.odin +++ b/vendor/darwin/Foundation/objc.odin @@ -1,4 +1,3 @@ -//+build darwin package objc_Foundation foreign import "system:Foundation.framework" diff --git a/vendor/darwin/Metal/MetalClasses.odin b/vendor/darwin/Metal/MetalClasses.odin index c79bba702..17f22e1d3 100644 --- a/vendor/darwin/Metal/MetalClasses.odin +++ b/vendor/darwin/Metal/MetalClasses.odin @@ -1,4 +1,3 @@ -//+build darwin package objc_Metal import NS "vendor:darwin/Foundation" diff --git a/vendor/darwin/Metal/MetalEnums.odin b/vendor/darwin/Metal/MetalEnums.odin index c5c992006..ab4782da4 100644 --- a/vendor/darwin/Metal/MetalEnums.odin +++ b/vendor/darwin/Metal/MetalEnums.odin @@ -1,4 +1,3 @@ -//+build darwin package objc_Metal import NS "vendor:darwin/Foundation" diff --git a/vendor/darwin/Metal/MetalErrors.odin b/vendor/darwin/Metal/MetalErrors.odin index dd6531a1c..8bc851e33 100644 --- a/vendor/darwin/Metal/MetalErrors.odin +++ b/vendor/darwin/Metal/MetalErrors.odin @@ -1,4 +1,3 @@ -//+build darwin package objc_Metal import NS "vendor:darwin/Foundation" diff --git a/vendor/darwin/Metal/MetalProcedures.odin b/vendor/darwin/Metal/MetalProcedures.odin index 7d64e4028..dd90bd3e9 100644 --- a/vendor/darwin/Metal/MetalProcedures.odin +++ b/vendor/darwin/Metal/MetalProcedures.odin @@ -1,4 +1,3 @@ -//+build darwin package objc_Metal import NS "vendor:darwin/Foundation" diff --git a/vendor/darwin/Metal/MetalTypes.odin b/vendor/darwin/Metal/MetalTypes.odin index 9d37a976e..b14fe2886 100644 --- a/vendor/darwin/Metal/MetalTypes.odin +++ b/vendor/darwin/Metal/MetalTypes.odin @@ -1,4 +1,3 @@ -//+build darwin package objc_Metal import NS "vendor:darwin/Foundation" diff --git a/vendor/darwin/MetalKit/MetalKit.odin b/vendor/darwin/MetalKit/MetalKit.odin index 218986ddc..eb09410d1 100644 --- a/vendor/darwin/MetalKit/MetalKit.odin +++ b/vendor/darwin/MetalKit/MetalKit.odin @@ -1,4 +1,3 @@ -//+build darwin package objc_MetalKit import NS "vendor:darwin/Foundation" diff --git a/vendor/darwin/QuartzCore/QuartzCore.odin b/vendor/darwin/QuartzCore/QuartzCore.odin index 258395343..93998d95d 100644 --- a/vendor/darwin/QuartzCore/QuartzCore.odin +++ b/vendor/darwin/QuartzCore/QuartzCore.odin @@ -1,4 +1,3 @@ -//+build darwin package objc_QuartzCore import NS "vendor:darwin/Foundation" diff --git a/vendor/directx/d3d11/d3d11.odin b/vendor/directx/d3d11/d3d11.odin index d94c05d06..53d45c47c 100644 --- a/vendor/directx/d3d11/d3d11.odin +++ b/vendor/directx/d3d11/d3d11.odin @@ -24,7 +24,7 @@ IModuleInstance :: d3d_compiler.ID3D11ModuleInstance IBlob :: d3d_compiler.ID3DBlob IModule :: d3d_compiler.ID3D11Module -@(default_calling_convention="stdcall", link_prefix="D3D11") +@(default_calling_convention="system", link_prefix="D3D11") foreign d3d11 { CreateDevice :: proc( pAdapter: ^dxgi.IAdapter, @@ -707,8 +707,8 @@ ID3DDestructionNotifier :: struct #raw_union { } ID3DDestructionNotifier_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - RegisterDestructionCallback: proc "stdcall" (this: ^ID3DDestructionNotifier, callbackFn: PFN_DESTRUCTION_CALLBACK, pData: rawptr, pCallbackID: ^u32) -> HRESULT, - UnregisterDestructionCallback: proc "stdcall" (this: ^ID3DDestructionNotifier, callbackID: u32) -> HRESULT, + RegisterDestructionCallback: proc "system" (this: ^ID3DDestructionNotifier, callbackFn: PFN_DESTRUCTION_CALLBACK, pData: rawptr, pCallbackID: ^u32) -> HRESULT, + UnregisterDestructionCallback: proc "system" (this: ^ID3DDestructionNotifier, callbackID: u32) -> HRESULT, } @@ -1139,10 +1139,10 @@ IDeviceChild :: struct #raw_union { } IDeviceChild_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - GetDevice: proc "stdcall" (this: ^IDeviceChild, ppDevice: ^^IDevice), - GetPrivateData: proc "stdcall" (this: ^IDeviceChild, guid: ^GUID, pDataSize: ^u32, pData: rawptr) -> HRESULT, - SetPrivateData: proc "stdcall" (this: ^IDeviceChild, guid: ^GUID, DataSize: u32, pData: rawptr) -> HRESULT, - SetPrivateDataInterface: proc "stdcall" (this: ^IDeviceChild, guid: ^GUID, pData: ^IUnknown) -> HRESULT, + GetDevice: proc "system" (this: ^IDeviceChild, ppDevice: ^^IDevice), + GetPrivateData: proc "system" (this: ^IDeviceChild, guid: ^GUID, pDataSize: ^u32, pData: rawptr) -> HRESULT, + SetPrivateData: proc "system" (this: ^IDeviceChild, guid: ^GUID, DataSize: u32, pData: rawptr) -> HRESULT, + SetPrivateDataInterface: proc "system" (this: ^IDeviceChild, guid: ^GUID, pData: ^IUnknown) -> HRESULT, } @@ -1204,7 +1204,7 @@ IDepthStencilState :: struct #raw_union { } IDepthStencilState_VTable :: struct { using id3d11devicechild_vtable: IDeviceChild_VTable, - GetDesc: proc "stdcall" (this: ^IDepthStencilState, pDesc: ^DEPTH_STENCIL_DESC), + GetDesc: proc "system" (this: ^IDepthStencilState, pDesc: ^DEPTH_STENCIL_DESC), } @@ -1281,7 +1281,7 @@ IBlendState :: struct #raw_union { } IBlendState_VTable :: struct { using id3d11devicechild_vtable: IDeviceChild_VTable, - GetDesc: proc "stdcall" (this: ^IBlendState, pDesc: ^BLEND_DESC), + GetDesc: proc "system" (this: ^IBlendState, pDesc: ^BLEND_DESC), } @@ -1311,7 +1311,7 @@ IRasterizerState :: struct #raw_union { } IRasterizerState_VTable :: struct { using id3d11devicechild_vtable: IDeviceChild_VTable, - GetDesc: proc "stdcall" (this: ^IRasterizerState, pDesc: ^RASTERIZER_DESC), + GetDesc: proc "system" (this: ^IRasterizerState, pDesc: ^RASTERIZER_DESC), } @@ -1336,9 +1336,9 @@ IResource :: struct #raw_union { } IResource_VTable :: struct { using id3d11devicechild_vtable: IDeviceChild_VTable, - GetType: proc "stdcall" (this: ^IResource, pResourceDimension: ^RESOURCE_DIMENSION), - SetEvictionPriority: proc "stdcall" (this: ^IResource, EvictionPriority: u32), - GetEvictionPriority: proc "stdcall" (this: ^IResource) -> u32, + GetType: proc "system" (this: ^IResource, pResourceDimension: ^RESOURCE_DIMENSION), + SetEvictionPriority: proc "system" (this: ^IResource, EvictionPriority: u32), + GetEvictionPriority: proc "system" (this: ^IResource) -> u32, } @@ -1364,7 +1364,7 @@ IBuffer :: struct #raw_union { } IBuffer_VTable :: struct { using id3d11resource_vtable: IResource_VTable, - GetDesc: proc "stdcall" (this: ^IBuffer, pDesc: ^BUFFER_DESC), + GetDesc: proc "system" (this: ^IBuffer, pDesc: ^BUFFER_DESC), } @@ -1392,7 +1392,7 @@ ITexture1D :: struct #raw_union { } ITexture1D_VTable :: struct { using id3d11resource_vtable: IResource_VTable, - GetDesc: proc "stdcall" (this: ^ITexture1D, pDesc: ^TEXTURE1D_DESC), + GetDesc: proc "system" (this: ^ITexture1D, pDesc: ^TEXTURE1D_DESC), } @@ -1422,7 +1422,7 @@ ITexture2D :: struct #raw_union { } ITexture2D_VTable :: struct { using id3d11resource_vtable: IResource_VTable, - GetDesc: proc "stdcall" (this: ^ITexture2D, pDesc: ^TEXTURE2D_DESC), + GetDesc: proc "system" (this: ^ITexture2D, pDesc: ^TEXTURE2D_DESC), } @@ -1451,7 +1451,7 @@ ITexture3D :: struct #raw_union { } ITexture3D_VTable :: struct { using id3d11resource_vtable: IResource_VTable, - GetDesc: proc "stdcall" (this: ^ITexture3D, pDesc: ^TEXTURE3D_DESC), + GetDesc: proc "system" (this: ^ITexture3D, pDesc: ^TEXTURE3D_DESC), } @@ -1473,7 +1473,7 @@ IView :: struct #raw_union { } IView_VTable :: struct { using id3d11devicechild_vtable: IDeviceChild_VTable, - GetResource: proc "stdcall" (this: ^IView, ppResource: ^^IResource), + GetResource: proc "system" (this: ^IView, ppResource: ^^IResource), } @@ -1580,7 +1580,7 @@ IShaderResourceView :: struct #raw_union { } IShaderResourceView_VTable :: struct { using id3d11view_vtable: IView_VTable, - GetDesc: proc "stdcall" (this: ^IShaderResourceView, pDesc: ^SHADER_RESOURCE_VIEW_DESC), + GetDesc: proc "system" (this: ^IShaderResourceView, pDesc: ^SHADER_RESOURCE_VIEW_DESC), } @@ -1658,7 +1658,7 @@ IRenderTargetView :: struct #raw_union { } IRenderTargetView_VTable :: struct { using id3d11view_vtable: IView_VTable, - GetDesc: proc "stdcall" (this: ^IRenderTargetView, pDesc: ^RENDER_TARGET_VIEW_DESC), + GetDesc: proc "system" (this: ^IRenderTargetView, pDesc: ^RENDER_TARGET_VIEW_DESC), } @@ -1728,7 +1728,7 @@ IDepthStencilView :: struct #raw_union { } IDepthStencilView_VTable :: struct { using id3d11view_vtable: IView_VTable, - GetDesc: proc "stdcall" (this: ^IDepthStencilView, pDesc: ^DEPTH_STENCIL_VIEW_DESC), + GetDesc: proc "system" (this: ^IDepthStencilView, pDesc: ^DEPTH_STENCIL_VIEW_DESC), } @@ -1797,7 +1797,7 @@ IUnorderedAccessView :: struct #raw_union { } IUnorderedAccessView_VTable :: struct { using id3d11view_vtable: IView_VTable, - GetDesc: proc "stdcall" (this: ^IUnorderedAccessView, pDesc: ^UNORDERED_ACCESS_VIEW_DESC), + GetDesc: proc "system" (this: ^IUnorderedAccessView, pDesc: ^UNORDERED_ACCESS_VIEW_DESC), } @@ -1935,7 +1935,7 @@ ISamplerState :: struct #raw_union { } ISamplerState_VTable :: struct { using id3d11devicechild_vtable: IDeviceChild_VTable, - GetDesc: proc "stdcall" (this: ^ISamplerState, pDesc: ^SAMPLER_DESC), + GetDesc: proc "system" (this: ^ISamplerState, pDesc: ^SAMPLER_DESC), } @@ -1997,7 +1997,7 @@ IAsynchronous :: struct #raw_union { } IAsynchronous_VTable :: struct { using id3d11devicechild_vtable: IDeviceChild_VTable, - GetDataSize: proc "stdcall" (this: ^IAsynchronous) -> u32, + GetDataSize: proc "system" (this: ^IAsynchronous) -> u32, } @@ -2048,7 +2048,7 @@ IQuery :: struct #raw_union { } IQuery_VTable :: struct { using id3d11asynchronous_vtable: IAsynchronous_VTable, - GetDesc: proc "stdcall" (this: ^IQuery, pDesc: ^QUERY_DESC), + GetDesc: proc "system" (this: ^IQuery, pDesc: ^QUERY_DESC), } @@ -2118,7 +2118,7 @@ ICounter :: struct #raw_union { } ICounter_VTable :: struct { using id3d11asynchronous_vtable: IAsynchronous_VTable, - GetDesc: proc "stdcall" (this: ^ICounter, pDesc: ^COUNTER_DESC), + GetDesc: proc "system" (this: ^ICounter, pDesc: ^COUNTER_DESC), } @@ -2152,10 +2152,10 @@ IClassInstance :: struct #raw_union { } IClassInstance_VTable :: struct { using id3d11devicechild_vtable: IDeviceChild_VTable, - GetClassLinkage: proc "stdcall" (this: ^IClassInstance, ppLinkage: ^^IClassLinkage), - GetDesc: proc "stdcall" (this: ^IClassInstance, pDesc: ^CLASS_INSTANCE_DESC), - GetInstanceName: proc "stdcall" (this: ^IClassInstance, pInstanceName: cstring, pBufferLength: ^SIZE_T), - GetTypeName: proc "stdcall" (this: ^IClassInstance, pTypeName: cstring, pBufferLength: ^SIZE_T), + GetClassLinkage: proc "system" (this: ^IClassInstance, ppLinkage: ^^IClassLinkage), + GetDesc: proc "system" (this: ^IClassInstance, pDesc: ^CLASS_INSTANCE_DESC), + GetInstanceName: proc "system" (this: ^IClassInstance, pInstanceName: cstring, pBufferLength: ^SIZE_T), + GetTypeName: proc "system" (this: ^IClassInstance, pTypeName: cstring, pBufferLength: ^SIZE_T), } @@ -2168,8 +2168,8 @@ IClassLinkage :: struct #raw_union { } IClassLinkage_VTable :: struct { using id3d11devicechild_vtable: IDeviceChild_VTable, - GetClassInstance: proc "stdcall" (this: ^IClassLinkage, pClassInstanceName: cstring, InstanceIndex: u32, ppInstance: ^^IClassInstance) -> HRESULT, - CreateClassInstance: proc "stdcall" (this: ^IClassLinkage, pClassTypeName: cstring, ConstantBufferOffset: u32, ConstantVectorOffset: u32, TextureOffset: u32, SamplerOffset: u32, ppInstance: ^^IClassInstance) -> HRESULT, + GetClassInstance: proc "system" (this: ^IClassLinkage, pClassInstanceName: cstring, InstanceIndex: u32, ppInstance: ^^IClassInstance) -> HRESULT, + CreateClassInstance: proc "system" (this: ^IClassLinkage, pClassTypeName: cstring, ConstantBufferOffset: u32, ConstantVectorOffset: u32, TextureOffset: u32, SamplerOffset: u32, ppInstance: ^^IClassInstance) -> HRESULT, } @@ -2182,7 +2182,7 @@ ICommandList :: struct #raw_union { } ICommandList_VTable :: struct { using id3d11devicechild_vtable: IDeviceChild_VTable, - GetContextFlags: proc "stdcall" (this: ^ICommandList) -> u32, + GetContextFlags: proc "system" (this: ^ICommandList) -> u32, } @@ -2357,114 +2357,114 @@ IDeviceContext :: struct #raw_union { } IDeviceContext_VTable :: struct { using id3d11devicechild_vtable: IDeviceChild_VTable, - VSSetConstantBuffers: proc "stdcall" (this: ^IDeviceContext, StartSlot: u32, NumBuffers: u32, ppConstantBuffers: ^^IBuffer), - PSSetShaderResources: proc "stdcall" (this: ^IDeviceContext, StartSlot: u32, NumViews: u32, ppShaderResourceViews: ^^IShaderResourceView), - PSSetShader: proc "stdcall" (this: ^IDeviceContext, pPixelShader: ^IPixelShader, ppClassInstances: ^^IClassInstance, NumClassInstances: u32), - PSSetSamplers: proc "stdcall" (this: ^IDeviceContext, StartSlot: u32, NumSamplers: u32, ppSamplers: ^^ISamplerState), - VSSetShader: proc "stdcall" (this: ^IDeviceContext, pVertexShader: ^IVertexShader, ppClassInstances: ^^IClassInstance, NumClassInstances: u32), - DrawIndexed: proc "stdcall" (this: ^IDeviceContext, IndexCount: u32, StartIndexLocation: u32, BaseVertexLocation: i32), - Draw: proc "stdcall" (this: ^IDeviceContext, VertexCount: u32, StartVertexLocation: u32), - Map: proc "stdcall" (this: ^IDeviceContext, pResource: ^IResource, Subresource: u32, MapType: MAP, MapFlags: MAP_FLAGS, pMappedResource: ^MAPPED_SUBRESOURCE) -> HRESULT, - Unmap: proc "stdcall" (this: ^IDeviceContext, pResource: ^IResource, Subresource: u32), - PSSetConstantBuffers: proc "stdcall" (this: ^IDeviceContext, StartSlot: u32, NumBuffers: u32, ppConstantBuffers: ^^IBuffer), - IASetInputLayout: proc "stdcall" (this: ^IDeviceContext, pInputLayout: ^IInputLayout), - IASetVertexBuffers: proc "stdcall" (this: ^IDeviceContext, StartSlot: u32, NumBuffers: u32, ppVertexBuffers: ^^IBuffer, pStrides: ^u32, pOffsets: ^u32), - IASetIndexBuffer: proc "stdcall" (this: ^IDeviceContext, pIndexBuffer: ^IBuffer, Format: dxgi.FORMAT, Offset: u32), - DrawIndexedInstanced: proc "stdcall" (this: ^IDeviceContext, IndexCountPerInstance: u32, InstanceCount: u32, StartIndexLocation: u32, BaseVertexLocation: i32, StartInstanceLocation: u32), - DrawInstanced: proc "stdcall" (this: ^IDeviceContext, VertexCountPerInstance: u32, InstanceCount: u32, StartVertexLocation: u32, StartInstanceLocation: u32), - GSSetConstantBuffers: proc "stdcall" (this: ^IDeviceContext, StartSlot: u32, NumBuffers: u32, ppConstantBuffers: ^^IBuffer), - GSSetShader: proc "stdcall" (this: ^IDeviceContext, pShader: ^IGeometryShader, ppClassInstances: ^^IClassInstance, NumClassInstances: u32), - IASetPrimitiveTopology: proc "stdcall" (this: ^IDeviceContext, Topology: PRIMITIVE_TOPOLOGY), - VSSetShaderResources: proc "stdcall" (this: ^IDeviceContext, StartSlot: u32, NumViews: u32, ppShaderResourceViews: ^^IShaderResourceView), - VSSetSamplers: proc "stdcall" (this: ^IDeviceContext, StartSlot: u32, NumSamplers: u32, ppSamplers: ^^ISamplerState), - Begin: proc "stdcall" (this: ^IDeviceContext, pAsync: ^IAsynchronous), - End: proc "stdcall" (this: ^IDeviceContext, pAsync: ^IAsynchronous), - GetData: proc "stdcall" (this: ^IDeviceContext, pAsync: ^IAsynchronous, pData: rawptr, DataSize: u32, GetDataFlags: u32) -> HRESULT, - SetPredication: proc "stdcall" (this: ^IDeviceContext, pPredicate: ^IPredicate, PredicateValue: BOOL), - GSSetShaderResources: proc "stdcall" (this: ^IDeviceContext, StartSlot: u32, NumViews: u32, ppShaderResourceViews: ^^IShaderResourceView), - GSSetSamplers: proc "stdcall" (this: ^IDeviceContext, StartSlot: u32, NumSamplers: u32, ppSamplers: ^^ISamplerState), - OMSetRenderTargets: proc "stdcall" (this: ^IDeviceContext, NumViews: u32, ppRenderTargetViews: ^^IRenderTargetView, pDepthStencilView: ^IDepthStencilView), - OMSetRenderTargetsAndUnorderedAccessViews: proc "stdcall" (this: ^IDeviceContext, NumRTVs: u32, ppRenderTargetViews: ^^IRenderTargetView, pDepthStencilView: ^IDepthStencilView, UAVStartSlot: u32, NumUAVs: u32, ppUnorderedAccessViews: ^^IUnorderedAccessView, pUAVInitialCounts: ^u32), - OMSetBlendState: proc "stdcall" (this: ^IDeviceContext, pBlendState: ^IBlendState, BlendFactor: ^[4]f32, SampleMask: u32), - OMSetDepthStencilState: proc "stdcall" (this: ^IDeviceContext, pDepthStencilState: ^IDepthStencilState, StencilRef: u32), - SOSetTargets: proc "stdcall" (this: ^IDeviceContext, NumBuffers: u32, ppSOTargets: ^^IBuffer, pOffsets: ^u32), - DrawAuto: proc "stdcall" (this: ^IDeviceContext), - DrawIndexedInstancedIndirect: proc "stdcall" (this: ^IDeviceContext, pBufferForArgs: ^IBuffer, AlignedByteOffsetForArgs: u32), - DrawInstancedIndirect: proc "stdcall" (this: ^IDeviceContext, pBufferForArgs: ^IBuffer, AlignedByteOffsetForArgs: u32), - Dispatch: proc "stdcall" (this: ^IDeviceContext, ThreadGroupCountX: u32, ThreadGroupCountY: u32, ThreadGroupCountZ: u32), - DispatchIndirect: proc "stdcall" (this: ^IDeviceContext, pBufferForArgs: ^IBuffer, AlignedByteOffsetForArgs: u32), - RSSetState: proc "stdcall" (this: ^IDeviceContext, pRasterizerState: ^IRasterizerState), - RSSetViewports: proc "stdcall" (this: ^IDeviceContext, NumViewports: u32, pViewports: ^VIEWPORT), - RSSetScissorRects: proc "stdcall" (this: ^IDeviceContext, NumRects: u32, pRects: ^RECT), - CopySubresourceRegion: proc "stdcall" (this: ^IDeviceContext, pDstResource: ^IResource, DstSubresource: u32, DstX: u32, DstY: u32, DstZ: u32, pSrcResource: ^IResource, SrcSubresource: u32, pSrcBox: ^BOX), - CopyResource: proc "stdcall" (this: ^IDeviceContext, pDstResource: ^IResource, pSrcResource: ^IResource), - UpdateSubresource: proc "stdcall" (this: ^IDeviceContext, pDstResource: ^IResource, DstSubresource: u32, pDstBox: ^BOX, pSrcData: rawptr, SrcRowPitch: u32, SrcDepthPitch: u32), - CopyStructureCount: proc "stdcall" (this: ^IDeviceContext, pDstBuffer: ^IBuffer, DstAlignedByteOffset: u32, pSrcView: ^IUnorderedAccessView), - ClearRenderTargetView: proc "stdcall" (this: ^IDeviceContext, pRenderTargetView: ^IRenderTargetView, ColorRGBA: ^[4]f32), - ClearUnorderedAccessViewUint: proc "stdcall" (this: ^IDeviceContext, pUnorderedAccessView: ^IUnorderedAccessView, Values: ^[4]u32), - ClearUnorderedAccessViewFloat: proc "stdcall" (this: ^IDeviceContext, pUnorderedAccessView: ^IUnorderedAccessView, Values: ^[4]f32), - ClearDepthStencilView: proc "stdcall" (this: ^IDeviceContext, pDepthStencilView: ^IDepthStencilView, ClearFlags: CLEAR_FLAGS, Depth: f32, Stencil: u8), - GenerateMips: proc "stdcall" (this: ^IDeviceContext, pShaderResourceView: ^IShaderResourceView), - SetResourceMinLOD: proc "stdcall" (this: ^IDeviceContext, pResource: ^IResource, MinLOD: f32), - GetResourceMinLOD: proc "stdcall" (this: ^IDeviceContext, pResource: ^IResource) -> f32, - ResolveSubresource: proc "stdcall" (this: ^IDeviceContext, pDstResource: ^IResource, DstSubresource: u32, pSrcResource: ^IResource, SrcSubresource: u32, Format: dxgi.FORMAT), - ExecuteCommandList: proc "stdcall" (this: ^IDeviceContext, pCommandList: ^ICommandList, RestoreContextState: BOOL), - HSSetShaderResources: proc "stdcall" (this: ^IDeviceContext, StartSlot: u32, NumViews: u32, ppShaderResourceViews: ^^IShaderResourceView), - HSSetShader: proc "stdcall" (this: ^IDeviceContext, pHullShader: ^IHullShader, ppClassInstances: ^^IClassInstance, NumClassInstances: u32), - HSSetSamplers: proc "stdcall" (this: ^IDeviceContext, StartSlot: u32, NumSamplers: u32, ppSamplers: ^^ISamplerState), - HSSetConstantBuffers: proc "stdcall" (this: ^IDeviceContext, StartSlot: u32, NumBuffers: u32, ppConstantBuffers: ^^IBuffer), - DSSetShaderResources: proc "stdcall" (this: ^IDeviceContext, StartSlot: u32, NumViews: u32, ppShaderResourceViews: ^^IShaderResourceView), - DSSetShader: proc "stdcall" (this: ^IDeviceContext, pDomainShader: ^IDomainShader, ppClassInstances: ^^IClassInstance, NumClassInstances: u32), - DSSetSamplers: proc "stdcall" (this: ^IDeviceContext, StartSlot: u32, NumSamplers: u32, ppSamplers: ^^ISamplerState), - DSSetConstantBuffers: proc "stdcall" (this: ^IDeviceContext, StartSlot: u32, NumBuffers: u32, ppConstantBuffers: ^^IBuffer), - CSSetShaderResources: proc "stdcall" (this: ^IDeviceContext, StartSlot: u32, NumViews: u32, ppShaderResourceViews: ^^IShaderResourceView), - CSSetUnorderedAccessViews: proc "stdcall" (this: ^IDeviceContext, StartSlot: u32, NumUAVs: u32, ppUnorderedAccessViews: ^^IUnorderedAccessView, pUAVInitialCounts: ^u32), - CSSetShader: proc "stdcall" (this: ^IDeviceContext, pComputeShader: ^IComputeShader, ppClassInstances: ^^IClassInstance, NumClassInstances: u32), - CSSetSamplers: proc "stdcall" (this: ^IDeviceContext, StartSlot: u32, NumSamplers: u32, ppSamplers: ^^ISamplerState), - CSSetConstantBuffers: proc "stdcall" (this: ^IDeviceContext, StartSlot: u32, NumBuffers: u32, ppConstantBuffers: ^^IBuffer), - VSGetConstantBuffers: proc "stdcall" (this: ^IDeviceContext, StartSlot: u32, NumBuffers: u32, ppConstantBuffers: ^^IBuffer), - PSGetShaderResources: proc "stdcall" (this: ^IDeviceContext, StartSlot: u32, NumViews: u32, ppShaderResourceViews: ^^IShaderResourceView), - PSGetShader: proc "stdcall" (this: ^IDeviceContext, ppPixelShader: ^^IPixelShader, ppClassInstances: ^^IClassInstance, pNumClassInstances: ^u32), - PSGetSamplers: proc "stdcall" (this: ^IDeviceContext, StartSlot: u32, NumSamplers: u32, ppSamplers: ^^ISamplerState), - VSGetShader: proc "stdcall" (this: ^IDeviceContext, ppVertexShader: ^^IVertexShader, ppClassInstances: ^^IClassInstance, pNumClassInstances: ^u32), - PSGetConstantBuffers: proc "stdcall" (this: ^IDeviceContext, StartSlot: u32, NumBuffers: u32, ppConstantBuffers: ^^IBuffer), - IAGetInputLayout: proc "stdcall" (this: ^IDeviceContext, ppInputLayout: ^^IInputLayout), - IAGetVertexBuffers: proc "stdcall" (this: ^IDeviceContext, StartSlot: u32, NumBuffers: u32, ppVertexBuffers: ^^IBuffer, pStrides: ^u32, pOffsets: ^u32), - IAGetIndexBuffer: proc "stdcall" (this: ^IDeviceContext, pIndexBuffer: ^^IBuffer, Format: ^dxgi.FORMAT, Offset: ^u32), - GSGetConstantBuffers: proc "stdcall" (this: ^IDeviceContext, StartSlot: u32, NumBuffers: u32, ppConstantBuffers: ^^IBuffer), - GSGetShader: proc "stdcall" (this: ^IDeviceContext, ppGeometryShader: ^^IGeometryShader, ppClassInstances: ^^IClassInstance, pNumClassInstances: ^u32), - IAGetPrimitiveTopology: proc "stdcall" (this: ^IDeviceContext, pTopology: ^PRIMITIVE_TOPOLOGY), - VSGetShaderResources: proc "stdcall" (this: ^IDeviceContext, StartSlot: u32, NumViews: u32, ppShaderResourceViews: ^^IShaderResourceView), - VSGetSamplers: proc "stdcall" (this: ^IDeviceContext, StartSlot: u32, NumSamplers: u32, ppSamplers: ^^ISamplerState), - GetPredication: proc "stdcall" (this: ^IDeviceContext, ppPredicate: ^^IPredicate, pPredicateValue: ^BOOL), - GSGetShaderResources: proc "stdcall" (this: ^IDeviceContext, StartSlot: u32, NumViews: u32, ppShaderResourceViews: ^^IShaderResourceView), - GSGetSamplers: proc "stdcall" (this: ^IDeviceContext, StartSlot: u32, NumSamplers: u32, ppSamplers: ^^ISamplerState), - OMGetRenderTargets: proc "stdcall" (this: ^IDeviceContext, NumViews: u32, ppRenderTargetViews: ^^IRenderTargetView, ppDepthStencilView: ^^IDepthStencilView), - OMGetRenderTargetsAndUnorderedAccessViews: proc "stdcall" (this: ^IDeviceContext, NumRTVs: u32, ppRenderTargetViews: ^^IRenderTargetView, ppDepthStencilView: ^^IDepthStencilView, UAVStartSlot: u32, NumUAVs: u32, ppUnorderedAccessViews: ^^IUnorderedAccessView), - OMGetBlendState: proc "stdcall" (this: ^IDeviceContext, ppBlendState: ^^IBlendState, BlendFactor: ^[4]f32, pSampleMask: ^COLOR_WRITE_ENABLE_MASK), - OMGetDepthStencilState: proc "stdcall" (this: ^IDeviceContext, ppDepthStencilState: ^^IDepthStencilState, pStencilRef: ^u32), - SOGetTargets: proc "stdcall" (this: ^IDeviceContext, NumBuffers: u32, ppSOTargets: ^^IBuffer), - RSGetState: proc "stdcall" (this: ^IDeviceContext, ppRasterizerState: ^^IRasterizerState), - RSGetViewports: proc "stdcall" (this: ^IDeviceContext, pNumViewports: ^u32, pViewports: ^VIEWPORT), - RSGetScissorRects: proc "stdcall" (this: ^IDeviceContext, pNumRects: ^u32, pRects: ^RECT), - HSGetShaderResources: proc "stdcall" (this: ^IDeviceContext, StartSlot: u32, NumViews: u32, ppShaderResourceViews: ^^IShaderResourceView), - HSGetShader: proc "stdcall" (this: ^IDeviceContext, ppHullShader: ^^IHullShader, ppClassInstances: ^^IClassInstance, pNumClassInstances: ^u32), - HSGetSamplers: proc "stdcall" (this: ^IDeviceContext, StartSlot: u32, NumSamplers: u32, ppSamplers: ^^ISamplerState), - HSGetConstantBuffers: proc "stdcall" (this: ^IDeviceContext, StartSlot: u32, NumBuffers: u32, ppConstantBuffers: ^^IBuffer), - DSGetShaderResources: proc "stdcall" (this: ^IDeviceContext, StartSlot: u32, NumViews: u32, ppShaderResourceViews: ^^IShaderResourceView), - DSGetShader: proc "stdcall" (this: ^IDeviceContext, ppDomainShader: ^^IDomainShader, ppClassInstances: ^^IClassInstance, pNumClassInstances: ^u32), - DSGetSamplers: proc "stdcall" (this: ^IDeviceContext, StartSlot: u32, NumSamplers: u32, ppSamplers: ^^ISamplerState), - DSGetConstantBuffers: proc "stdcall" (this: ^IDeviceContext, StartSlot: u32, NumBuffers: u32, ppConstantBuffers: ^^IBuffer), - CSGetShaderResources: proc "stdcall" (this: ^IDeviceContext, StartSlot: u32, NumViews: u32, ppShaderResourceViews: ^^IShaderResourceView), - CSGetUnorderedAccessViews: proc "stdcall" (this: ^IDeviceContext, StartSlot: u32, NumUAVs: u32, ppUnorderedAccessViews: ^^IUnorderedAccessView), - CSGetShader: proc "stdcall" (this: ^IDeviceContext, ppComputeShader: ^^IComputeShader, ppClassInstances: ^^IClassInstance, pNumClassInstances: ^u32), - CSGetSamplers: proc "stdcall" (this: ^IDeviceContext, StartSlot: u32, NumSamplers: u32, ppSamplers: ^^ISamplerState), - CSGetConstantBuffers: proc "stdcall" (this: ^IDeviceContext, StartSlot: u32, NumBuffers: u32, ppConstantBuffers: ^^IBuffer), - ClearState: proc "stdcall" (this: ^IDeviceContext), - Flush: proc "stdcall" (this: ^IDeviceContext), - GetType: proc "stdcall" (this: ^IDeviceContext) -> DEVICE_CONTEXT_TYPE, - GetContextFlags: proc "stdcall" (this: ^IDeviceContext) -> u32, - FinishCommandList: proc "stdcall" (this: ^IDeviceContext, RestoreDeferredContextState: BOOL, ppCommandList: ^^ICommandList) -> HRESULT, + VSSetConstantBuffers: proc "system" (this: ^IDeviceContext, StartSlot: u32, NumBuffers: u32, ppConstantBuffers: ^^IBuffer), + PSSetShaderResources: proc "system" (this: ^IDeviceContext, StartSlot: u32, NumViews: u32, ppShaderResourceViews: ^^IShaderResourceView), + PSSetShader: proc "system" (this: ^IDeviceContext, pPixelShader: ^IPixelShader, ppClassInstances: ^^IClassInstance, NumClassInstances: u32), + PSSetSamplers: proc "system" (this: ^IDeviceContext, StartSlot: u32, NumSamplers: u32, ppSamplers: ^^ISamplerState), + VSSetShader: proc "system" (this: ^IDeviceContext, pVertexShader: ^IVertexShader, ppClassInstances: ^^IClassInstance, NumClassInstances: u32), + DrawIndexed: proc "system" (this: ^IDeviceContext, IndexCount: u32, StartIndexLocation: u32, BaseVertexLocation: i32), + Draw: proc "system" (this: ^IDeviceContext, VertexCount: u32, StartVertexLocation: u32), + Map: proc "system" (this: ^IDeviceContext, pResource: ^IResource, Subresource: u32, MapType: MAP, MapFlags: MAP_FLAGS, pMappedResource: ^MAPPED_SUBRESOURCE) -> HRESULT, + Unmap: proc "system" (this: ^IDeviceContext, pResource: ^IResource, Subresource: u32), + PSSetConstantBuffers: proc "system" (this: ^IDeviceContext, StartSlot: u32, NumBuffers: u32, ppConstantBuffers: ^^IBuffer), + IASetInputLayout: proc "system" (this: ^IDeviceContext, pInputLayout: ^IInputLayout), + IASetVertexBuffers: proc "system" (this: ^IDeviceContext, StartSlot: u32, NumBuffers: u32, ppVertexBuffers: ^^IBuffer, pStrides: ^u32, pOffsets: ^u32), + IASetIndexBuffer: proc "system" (this: ^IDeviceContext, pIndexBuffer: ^IBuffer, Format: dxgi.FORMAT, Offset: u32), + DrawIndexedInstanced: proc "system" (this: ^IDeviceContext, IndexCountPerInstance: u32, InstanceCount: u32, StartIndexLocation: u32, BaseVertexLocation: i32, StartInstanceLocation: u32), + DrawInstanced: proc "system" (this: ^IDeviceContext, VertexCountPerInstance: u32, InstanceCount: u32, StartVertexLocation: u32, StartInstanceLocation: u32), + GSSetConstantBuffers: proc "system" (this: ^IDeviceContext, StartSlot: u32, NumBuffers: u32, ppConstantBuffers: ^^IBuffer), + GSSetShader: proc "system" (this: ^IDeviceContext, pShader: ^IGeometryShader, ppClassInstances: ^^IClassInstance, NumClassInstances: u32), + IASetPrimitiveTopology: proc "system" (this: ^IDeviceContext, Topology: PRIMITIVE_TOPOLOGY), + VSSetShaderResources: proc "system" (this: ^IDeviceContext, StartSlot: u32, NumViews: u32, ppShaderResourceViews: ^^IShaderResourceView), + VSSetSamplers: proc "system" (this: ^IDeviceContext, StartSlot: u32, NumSamplers: u32, ppSamplers: ^^ISamplerState), + Begin: proc "system" (this: ^IDeviceContext, pAsync: ^IAsynchronous), + End: proc "system" (this: ^IDeviceContext, pAsync: ^IAsynchronous), + GetData: proc "system" (this: ^IDeviceContext, pAsync: ^IAsynchronous, pData: rawptr, DataSize: u32, GetDataFlags: u32) -> HRESULT, + SetPredication: proc "system" (this: ^IDeviceContext, pPredicate: ^IPredicate, PredicateValue: BOOL), + GSSetShaderResources: proc "system" (this: ^IDeviceContext, StartSlot: u32, NumViews: u32, ppShaderResourceViews: ^^IShaderResourceView), + GSSetSamplers: proc "system" (this: ^IDeviceContext, StartSlot: u32, NumSamplers: u32, ppSamplers: ^^ISamplerState), + OMSetRenderTargets: proc "system" (this: ^IDeviceContext, NumViews: u32, ppRenderTargetViews: ^^IRenderTargetView, pDepthStencilView: ^IDepthStencilView), + OMSetRenderTargetsAndUnorderedAccessViews: proc "system" (this: ^IDeviceContext, NumRTVs: u32, ppRenderTargetViews: ^^IRenderTargetView, pDepthStencilView: ^IDepthStencilView, UAVStartSlot: u32, NumUAVs: u32, ppUnorderedAccessViews: ^^IUnorderedAccessView, pUAVInitialCounts: ^u32), + OMSetBlendState: proc "system" (this: ^IDeviceContext, pBlendState: ^IBlendState, BlendFactor: ^[4]f32, SampleMask: u32), + OMSetDepthStencilState: proc "system" (this: ^IDeviceContext, pDepthStencilState: ^IDepthStencilState, StencilRef: u32), + SOSetTargets: proc "system" (this: ^IDeviceContext, NumBuffers: u32, ppSOTargets: ^^IBuffer, pOffsets: ^u32), + DrawAuto: proc "system" (this: ^IDeviceContext), + DrawIndexedInstancedIndirect: proc "system" (this: ^IDeviceContext, pBufferForArgs: ^IBuffer, AlignedByteOffsetForArgs: u32), + DrawInstancedIndirect: proc "system" (this: ^IDeviceContext, pBufferForArgs: ^IBuffer, AlignedByteOffsetForArgs: u32), + Dispatch: proc "system" (this: ^IDeviceContext, ThreadGroupCountX: u32, ThreadGroupCountY: u32, ThreadGroupCountZ: u32), + DispatchIndirect: proc "system" (this: ^IDeviceContext, pBufferForArgs: ^IBuffer, AlignedByteOffsetForArgs: u32), + RSSetState: proc "system" (this: ^IDeviceContext, pRasterizerState: ^IRasterizerState), + RSSetViewports: proc "system" (this: ^IDeviceContext, NumViewports: u32, pViewports: ^VIEWPORT), + RSSetScissorRects: proc "system" (this: ^IDeviceContext, NumRects: u32, pRects: ^RECT), + CopySubresourceRegion: proc "system" (this: ^IDeviceContext, pDstResource: ^IResource, DstSubresource: u32, DstX: u32, DstY: u32, DstZ: u32, pSrcResource: ^IResource, SrcSubresource: u32, pSrcBox: ^BOX), + CopyResource: proc "system" (this: ^IDeviceContext, pDstResource: ^IResource, pSrcResource: ^IResource), + UpdateSubresource: proc "system" (this: ^IDeviceContext, pDstResource: ^IResource, DstSubresource: u32, pDstBox: ^BOX, pSrcData: rawptr, SrcRowPitch: u32, SrcDepthPitch: u32), + CopyStructureCount: proc "system" (this: ^IDeviceContext, pDstBuffer: ^IBuffer, DstAlignedByteOffset: u32, pSrcView: ^IUnorderedAccessView), + ClearRenderTargetView: proc "system" (this: ^IDeviceContext, pRenderTargetView: ^IRenderTargetView, ColorRGBA: ^[4]f32), + ClearUnorderedAccessViewUint: proc "system" (this: ^IDeviceContext, pUnorderedAccessView: ^IUnorderedAccessView, Values: ^[4]u32), + ClearUnorderedAccessViewFloat: proc "system" (this: ^IDeviceContext, pUnorderedAccessView: ^IUnorderedAccessView, Values: ^[4]f32), + ClearDepthStencilView: proc "system" (this: ^IDeviceContext, pDepthStencilView: ^IDepthStencilView, ClearFlags: CLEAR_FLAGS, Depth: f32, Stencil: u8), + GenerateMips: proc "system" (this: ^IDeviceContext, pShaderResourceView: ^IShaderResourceView), + SetResourceMinLOD: proc "system" (this: ^IDeviceContext, pResource: ^IResource, MinLOD: f32), + GetResourceMinLOD: proc "system" (this: ^IDeviceContext, pResource: ^IResource) -> f32, + ResolveSubresource: proc "system" (this: ^IDeviceContext, pDstResource: ^IResource, DstSubresource: u32, pSrcResource: ^IResource, SrcSubresource: u32, Format: dxgi.FORMAT), + ExecuteCommandList: proc "system" (this: ^IDeviceContext, pCommandList: ^ICommandList, RestoreContextState: BOOL), + HSSetShaderResources: proc "system" (this: ^IDeviceContext, StartSlot: u32, NumViews: u32, ppShaderResourceViews: ^^IShaderResourceView), + HSSetShader: proc "system" (this: ^IDeviceContext, pHullShader: ^IHullShader, ppClassInstances: ^^IClassInstance, NumClassInstances: u32), + HSSetSamplers: proc "system" (this: ^IDeviceContext, StartSlot: u32, NumSamplers: u32, ppSamplers: ^^ISamplerState), + HSSetConstantBuffers: proc "system" (this: ^IDeviceContext, StartSlot: u32, NumBuffers: u32, ppConstantBuffers: ^^IBuffer), + DSSetShaderResources: proc "system" (this: ^IDeviceContext, StartSlot: u32, NumViews: u32, ppShaderResourceViews: ^^IShaderResourceView), + DSSetShader: proc "system" (this: ^IDeviceContext, pDomainShader: ^IDomainShader, ppClassInstances: ^^IClassInstance, NumClassInstances: u32), + DSSetSamplers: proc "system" (this: ^IDeviceContext, StartSlot: u32, NumSamplers: u32, ppSamplers: ^^ISamplerState), + DSSetConstantBuffers: proc "system" (this: ^IDeviceContext, StartSlot: u32, NumBuffers: u32, ppConstantBuffers: ^^IBuffer), + CSSetShaderResources: proc "system" (this: ^IDeviceContext, StartSlot: u32, NumViews: u32, ppShaderResourceViews: ^^IShaderResourceView), + CSSetUnorderedAccessViews: proc "system" (this: ^IDeviceContext, StartSlot: u32, NumUAVs: u32, ppUnorderedAccessViews: ^^IUnorderedAccessView, pUAVInitialCounts: ^u32), + CSSetShader: proc "system" (this: ^IDeviceContext, pComputeShader: ^IComputeShader, ppClassInstances: ^^IClassInstance, NumClassInstances: u32), + CSSetSamplers: proc "system" (this: ^IDeviceContext, StartSlot: u32, NumSamplers: u32, ppSamplers: ^^ISamplerState), + CSSetConstantBuffers: proc "system" (this: ^IDeviceContext, StartSlot: u32, NumBuffers: u32, ppConstantBuffers: ^^IBuffer), + VSGetConstantBuffers: proc "system" (this: ^IDeviceContext, StartSlot: u32, NumBuffers: u32, ppConstantBuffers: ^^IBuffer), + PSGetShaderResources: proc "system" (this: ^IDeviceContext, StartSlot: u32, NumViews: u32, ppShaderResourceViews: ^^IShaderResourceView), + PSGetShader: proc "system" (this: ^IDeviceContext, ppPixelShader: ^^IPixelShader, ppClassInstances: ^^IClassInstance, pNumClassInstances: ^u32), + PSGetSamplers: proc "system" (this: ^IDeviceContext, StartSlot: u32, NumSamplers: u32, ppSamplers: ^^ISamplerState), + VSGetShader: proc "system" (this: ^IDeviceContext, ppVertexShader: ^^IVertexShader, ppClassInstances: ^^IClassInstance, pNumClassInstances: ^u32), + PSGetConstantBuffers: proc "system" (this: ^IDeviceContext, StartSlot: u32, NumBuffers: u32, ppConstantBuffers: ^^IBuffer), + IAGetInputLayout: proc "system" (this: ^IDeviceContext, ppInputLayout: ^^IInputLayout), + IAGetVertexBuffers: proc "system" (this: ^IDeviceContext, StartSlot: u32, NumBuffers: u32, ppVertexBuffers: ^^IBuffer, pStrides: ^u32, pOffsets: ^u32), + IAGetIndexBuffer: proc "system" (this: ^IDeviceContext, pIndexBuffer: ^^IBuffer, Format: ^dxgi.FORMAT, Offset: ^u32), + GSGetConstantBuffers: proc "system" (this: ^IDeviceContext, StartSlot: u32, NumBuffers: u32, ppConstantBuffers: ^^IBuffer), + GSGetShader: proc "system" (this: ^IDeviceContext, ppGeometryShader: ^^IGeometryShader, ppClassInstances: ^^IClassInstance, pNumClassInstances: ^u32), + IAGetPrimitiveTopology: proc "system" (this: ^IDeviceContext, pTopology: ^PRIMITIVE_TOPOLOGY), + VSGetShaderResources: proc "system" (this: ^IDeviceContext, StartSlot: u32, NumViews: u32, ppShaderResourceViews: ^^IShaderResourceView), + VSGetSamplers: proc "system" (this: ^IDeviceContext, StartSlot: u32, NumSamplers: u32, ppSamplers: ^^ISamplerState), + GetPredication: proc "system" (this: ^IDeviceContext, ppPredicate: ^^IPredicate, pPredicateValue: ^BOOL), + GSGetShaderResources: proc "system" (this: ^IDeviceContext, StartSlot: u32, NumViews: u32, ppShaderResourceViews: ^^IShaderResourceView), + GSGetSamplers: proc "system" (this: ^IDeviceContext, StartSlot: u32, NumSamplers: u32, ppSamplers: ^^ISamplerState), + OMGetRenderTargets: proc "system" (this: ^IDeviceContext, NumViews: u32, ppRenderTargetViews: ^^IRenderTargetView, ppDepthStencilView: ^^IDepthStencilView), + OMGetRenderTargetsAndUnorderedAccessViews: proc "system" (this: ^IDeviceContext, NumRTVs: u32, ppRenderTargetViews: ^^IRenderTargetView, ppDepthStencilView: ^^IDepthStencilView, UAVStartSlot: u32, NumUAVs: u32, ppUnorderedAccessViews: ^^IUnorderedAccessView), + OMGetBlendState: proc "system" (this: ^IDeviceContext, ppBlendState: ^^IBlendState, BlendFactor: ^[4]f32, pSampleMask: ^COLOR_WRITE_ENABLE_MASK), + OMGetDepthStencilState: proc "system" (this: ^IDeviceContext, ppDepthStencilState: ^^IDepthStencilState, pStencilRef: ^u32), + SOGetTargets: proc "system" (this: ^IDeviceContext, NumBuffers: u32, ppSOTargets: ^^IBuffer), + RSGetState: proc "system" (this: ^IDeviceContext, ppRasterizerState: ^^IRasterizerState), + RSGetViewports: proc "system" (this: ^IDeviceContext, pNumViewports: ^u32, pViewports: ^VIEWPORT), + RSGetScissorRects: proc "system" (this: ^IDeviceContext, pNumRects: ^u32, pRects: ^RECT), + HSGetShaderResources: proc "system" (this: ^IDeviceContext, StartSlot: u32, NumViews: u32, ppShaderResourceViews: ^^IShaderResourceView), + HSGetShader: proc "system" (this: ^IDeviceContext, ppHullShader: ^^IHullShader, ppClassInstances: ^^IClassInstance, pNumClassInstances: ^u32), + HSGetSamplers: proc "system" (this: ^IDeviceContext, StartSlot: u32, NumSamplers: u32, ppSamplers: ^^ISamplerState), + HSGetConstantBuffers: proc "system" (this: ^IDeviceContext, StartSlot: u32, NumBuffers: u32, ppConstantBuffers: ^^IBuffer), + DSGetShaderResources: proc "system" (this: ^IDeviceContext, StartSlot: u32, NumViews: u32, ppShaderResourceViews: ^^IShaderResourceView), + DSGetShader: proc "system" (this: ^IDeviceContext, ppDomainShader: ^^IDomainShader, ppClassInstances: ^^IClassInstance, pNumClassInstances: ^u32), + DSGetSamplers: proc "system" (this: ^IDeviceContext, StartSlot: u32, NumSamplers: u32, ppSamplers: ^^ISamplerState), + DSGetConstantBuffers: proc "system" (this: ^IDeviceContext, StartSlot: u32, NumBuffers: u32, ppConstantBuffers: ^^IBuffer), + CSGetShaderResources: proc "system" (this: ^IDeviceContext, StartSlot: u32, NumViews: u32, ppShaderResourceViews: ^^IShaderResourceView), + CSGetUnorderedAccessViews: proc "system" (this: ^IDeviceContext, StartSlot: u32, NumUAVs: u32, ppUnorderedAccessViews: ^^IUnorderedAccessView), + CSGetShader: proc "system" (this: ^IDeviceContext, ppComputeShader: ^^IComputeShader, ppClassInstances: ^^IClassInstance, pNumClassInstances: ^u32), + CSGetSamplers: proc "system" (this: ^IDeviceContext, StartSlot: u32, NumSamplers: u32, ppSamplers: ^^ISamplerState), + CSGetConstantBuffers: proc "system" (this: ^IDeviceContext, StartSlot: u32, NumBuffers: u32, ppConstantBuffers: ^^IBuffer), + ClearState: proc "system" (this: ^IDeviceContext), + Flush: proc "system" (this: ^IDeviceContext), + GetType: proc "system" (this: ^IDeviceContext) -> DEVICE_CONTEXT_TYPE, + GetContextFlags: proc "system" (this: ^IDeviceContext) -> u32, + FinishCommandList: proc "system" (this: ^IDeviceContext, RestoreDeferredContextState: BOOL, ppCommandList: ^^ICommandList) -> HRESULT, } @@ -2565,8 +2565,8 @@ IVideoDecoder :: struct #raw_union { } IVideoDecoder_VTable :: struct { using id3d11devicechild_vtable: IDeviceChild_VTable, - GetCreationParameters: proc "stdcall" (this: ^IVideoDecoder, pVideoDesc: ^VIDEO_DECODER_DESC, pConfig: ^VIDEO_DECODER_CONFIG) -> HRESULT, - GetDriverHandle: proc "stdcall" (this: ^IVideoDecoder, pDriverHandle: ^HANDLE) -> HRESULT, + GetCreationParameters: proc "system" (this: ^IVideoDecoder, pVideoDesc: ^VIDEO_DECODER_DESC, pConfig: ^VIDEO_DECODER_CONFIG) -> HRESULT, + GetDriverHandle: proc "system" (this: ^IVideoDecoder, pDriverHandle: ^HANDLE) -> HRESULT, } @@ -2761,12 +2761,12 @@ IVideoProcessorEnumerator :: struct #raw_union { } IVideoProcessorEnumerator_VTable :: struct { using id3d11devicechild_vtable: IDeviceChild_VTable, - GetVideoProcessorContentDesc: proc "stdcall" (this: ^IVideoProcessorEnumerator, pContentDesc: ^VIDEO_PROCESSOR_CONTENT_DESC) -> HRESULT, - CheckVideoProcessorFormat: proc "stdcall" (this: ^IVideoProcessorEnumerator, Format: dxgi.FORMAT, pFlags: ^u32) -> HRESULT, - GetVideoProcessorCaps: proc "stdcall" (this: ^IVideoProcessorEnumerator, pCaps: ^VIDEO_PROCESSOR_CAPS) -> HRESULT, - GetVideoProcessorRateConversionCaps: proc "stdcall" (this: ^IVideoProcessorEnumerator, TypeIndex: u32, pCaps: ^VIDEO_PROCESSOR_RATE_CONVERSION_CAPS) -> HRESULT, - GetVideoProcessorCustomRate: proc "stdcall" (this: ^IVideoProcessorEnumerator, TypeIndex: u32, CustomRateIndex: u32, pRate: ^VIDEO_PROCESSOR_CUSTOM_RATE) -> HRESULT, - GetVideoProcessorFilterRange: proc "stdcall" (this: ^IVideoProcessorEnumerator, Filter: VIDEO_PROCESSOR_FILTER, pRange: ^VIDEO_PROCESSOR_FILTER_RANGE) -> HRESULT, + GetVideoProcessorContentDesc: proc "system" (this: ^IVideoProcessorEnumerator, pContentDesc: ^VIDEO_PROCESSOR_CONTENT_DESC) -> HRESULT, + CheckVideoProcessorFormat: proc "system" (this: ^IVideoProcessorEnumerator, Format: dxgi.FORMAT, pFlags: ^u32) -> HRESULT, + GetVideoProcessorCaps: proc "system" (this: ^IVideoProcessorEnumerator, pCaps: ^VIDEO_PROCESSOR_CAPS) -> HRESULT, + GetVideoProcessorRateConversionCaps: proc "system" (this: ^IVideoProcessorEnumerator, TypeIndex: u32, pCaps: ^VIDEO_PROCESSOR_RATE_CONVERSION_CAPS) -> HRESULT, + GetVideoProcessorCustomRate: proc "system" (this: ^IVideoProcessorEnumerator, TypeIndex: u32, CustomRateIndex: u32, pRate: ^VIDEO_PROCESSOR_CUSTOM_RATE) -> HRESULT, + GetVideoProcessorFilterRange: proc "system" (this: ^IVideoProcessorEnumerator, Filter: VIDEO_PROCESSOR_FILTER, pRange: ^VIDEO_PROCESSOR_FILTER_RANGE) -> HRESULT, } @@ -2872,8 +2872,8 @@ IVideoProcessor :: struct #raw_union { } IVideoProcessor_VTable :: struct { using id3d11devicechild_vtable: IDeviceChild_VTable, - GetContentDesc: proc "stdcall" (this: ^IVideoProcessor, pDesc: ^VIDEO_PROCESSOR_CONTENT_DESC), - GetRateConversionCaps: proc "stdcall" (this: ^IVideoProcessor, pCaps: ^VIDEO_PROCESSOR_RATE_CONVERSION_CAPS), + GetContentDesc: proc "system" (this: ^IVideoProcessor, pDesc: ^VIDEO_PROCESSOR_CONTENT_DESC), + GetRateConversionCaps: proc "system" (this: ^IVideoProcessor, pCaps: ^VIDEO_PROCESSOR_RATE_CONVERSION_CAPS), } @@ -2896,9 +2896,9 @@ IAuthenticatedChannel :: struct #raw_union { } IAuthenticatedChannel_VTable :: struct { using id3d11devicechild_vtable: IDeviceChild_VTable, - GetCertificateSize: proc "stdcall" (this: ^IAuthenticatedChannel, pCertificateSize: ^u32) -> HRESULT, - GetCertificate: proc "stdcall" (this: ^IAuthenticatedChannel, CertificateSize: u32, pCertificate: cstring) -> HRESULT, - GetChannelHandle: proc "stdcall" (this: ^IAuthenticatedChannel, pChannelHandle: ^HANDLE), + GetCertificateSize: proc "system" (this: ^IAuthenticatedChannel, pCertificateSize: ^u32) -> HRESULT, + GetCertificate: proc "system" (this: ^IAuthenticatedChannel, CertificateSize: u32, pCertificate: cstring) -> HRESULT, + GetChannelHandle: proc "system" (this: ^IAuthenticatedChannel, pChannelHandle: ^HANDLE), } @@ -3105,11 +3105,11 @@ ICryptoSession :: struct #raw_union { } ICryptoSession_VTable :: struct { using id3d11devicechild_vtable: IDeviceChild_VTable, - GetCryptoType: proc "stdcall" (this: ^ICryptoSession, pCryptoType: ^GUID), - GetDecoderProfile: proc "stdcall" (this: ^ICryptoSession, pDecoderProfile: ^GUID), - GetCertificateSize: proc "stdcall" (this: ^ICryptoSession, pCertificateSize: ^u32) -> HRESULT, - GetCertificate: proc "stdcall" (this: ^ICryptoSession, CertificateSize: u32, pCertificate: cstring) -> HRESULT, - GetCryptoSessionHandle: proc "stdcall" (this: ^ICryptoSession, pCryptoSessionHandle: ^HANDLE), + GetCryptoType: proc "system" (this: ^ICryptoSession, pCryptoType: ^GUID), + GetDecoderProfile: proc "system" (this: ^ICryptoSession, pDecoderProfile: ^GUID), + GetCertificateSize: proc "system" (this: ^ICryptoSession, pCertificateSize: ^u32) -> HRESULT, + GetCertificate: proc "system" (this: ^ICryptoSession, CertificateSize: u32, pCertificate: cstring) -> HRESULT, + GetCryptoSessionHandle: proc "system" (this: ^ICryptoSession, pCryptoSessionHandle: ^HANDLE), } @@ -3139,7 +3139,7 @@ IVideoDecoderOutputView :: struct #raw_union { } IVideoDecoderOutputView_VTable :: struct { using id3d11view_vtable: IView_VTable, - GetDesc: proc "stdcall" (this: ^IVideoDecoderOutputView, pDesc: ^VIDEO_DECODER_OUTPUT_VIEW_DESC), + GetDesc: proc "system" (this: ^IVideoDecoderOutputView, pDesc: ^VIDEO_DECODER_OUTPUT_VIEW_DESC), } @@ -3170,7 +3170,7 @@ IVideoProcessorInputView :: struct #raw_union { } IVideoProcessorInputView_VTable :: struct { using id3d11view_vtable: IView_VTable, - GetDesc: proc "stdcall" (this: ^IVideoProcessorInputView, pDesc: ^VIDEO_PROCESSOR_INPUT_VIEW_DESC), + GetDesc: proc "system" (this: ^IVideoProcessorInputView, pDesc: ^VIDEO_PROCESSOR_INPUT_VIEW_DESC), } @@ -3207,7 +3207,7 @@ IVideoProcessorOutputView :: struct #raw_union { } IVideoProcessorOutputView_VTable :: struct { using id3d11view_vtable: IView_VTable, - GetDesc: proc "stdcall" (this: ^IVideoProcessorOutputView, pDesc: ^VIDEO_PROCESSOR_OUTPUT_VIEW_DESC), + GetDesc: proc "system" (this: ^IVideoProcessorOutputView, pDesc: ^VIDEO_PROCESSOR_OUTPUT_VIEW_DESC), } @@ -3220,64 +3220,64 @@ IVideoContext :: struct #raw_union { } IVideoContext_VTable :: struct { using id3d11devicechild_vtable: IDeviceChild_VTable, - GetDecoderBuffer: proc "stdcall" (this: ^IVideoContext, pDecoder: ^IVideoDecoder, Type: VIDEO_DECODER_BUFFER_TYPE, pBufferSize: ^u32, ppBuffer: ^rawptr) -> HRESULT, - ReleaseDecoderBuffer: proc "stdcall" (this: ^IVideoContext, pDecoder: ^IVideoDecoder, Type: VIDEO_DECODER_BUFFER_TYPE) -> HRESULT, - DecoderBeginFrame: proc "stdcall" (this: ^IVideoContext, pDecoder: ^IVideoDecoder, pView: ^IVideoDecoderOutputView, ContentKeySize: u32, pContentKey: rawptr) -> HRESULT, - DecoderEndFrame: proc "stdcall" (this: ^IVideoContext, pDecoder: ^IVideoDecoder) -> HRESULT, - SubmitDecoderBuffers: proc "stdcall" (this: ^IVideoContext, pDecoder: ^IVideoDecoder, NumBuffers: u32, pBufferDesc: ^VIDEO_DECODER_BUFFER_DESC) -> HRESULT, - DecoderExtension: proc "stdcall" (this: ^IVideoContext, pDecoder: ^IVideoDecoder, pExtensionData: ^VIDEO_DECODER_EXTENSION) -> APP_DEPRECATED_HRESULT, - VideoProcessorSetOutputTargetRect: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, Enable: BOOL, pRect: ^RECT), - VideoProcessorSetOutputBackgroundColor: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, YCbCr: BOOL, pColor: ^VIDEO_COLOR), - VideoProcessorSetOutputColorSpace: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, pColorSpace: ^VIDEO_PROCESSOR_COLOR_SPACE), - VideoProcessorSetOutputAlphaFillMode: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, AlphaFillMode: VIDEO_PROCESSOR_ALPHA_FILL_MODE, StreamIndex: u32), - VideoProcessorSetOutputConstriction: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, Enable: BOOL, Size: SIZE), - VideoProcessorSetOutputStereoMode: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, Enable: BOOL), - VideoProcessorSetOutputExtension: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, pExtensionGuid: ^GUID, DataSize: u32, pData: rawptr) -> APP_DEPRECATED_HRESULT, - VideoProcessorGetOutputTargetRect: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, Enabled: ^BOOL, pRect: ^RECT), - VideoProcessorGetOutputBackgroundColor: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, pYCbCr: ^BOOL, pColor: ^VIDEO_COLOR), - VideoProcessorGetOutputColorSpace: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, pColorSpace: ^VIDEO_PROCESSOR_COLOR_SPACE), - VideoProcessorGetOutputAlphaFillMode: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, pAlphaFillMode: ^VIDEO_PROCESSOR_ALPHA_FILL_MODE, pStreamIndex: ^u32), - VideoProcessorGetOutputConstriction: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, pEnabled: ^BOOL, pSize: ^SIZE), - VideoProcessorGetOutputStereoMode: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, pEnabled: ^BOOL), - VideoProcessorGetOutputExtension: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, pExtensionGuid: ^GUID, DataSize: u32, pData: rawptr) -> APP_DEPRECATED_HRESULT, - VideoProcessorSetStreamFrameFormat: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, FrameFormat: VIDEO_FRAME_FORMAT), - VideoProcessorSetStreamColorSpace: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, pColorSpace: ^VIDEO_PROCESSOR_COLOR_SPACE), - VideoProcessorSetStreamOutputRate: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, OutputRate: VIDEO_PROCESSOR_OUTPUT_RATE, RepeatFrame: BOOL, pCustomRate: ^dxgi.RATIONAL), - VideoProcessorSetStreamSourceRect: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, Enable: BOOL, pRect: ^RECT), - VideoProcessorSetStreamDestRect: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, Enable: BOOL, pRect: ^RECT), - VideoProcessorSetStreamAlpha: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, Enable: BOOL, Alpha: f32), - VideoProcessorSetStreamPalette: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, Count: u32, pEntries: ^u32), - VideoProcessorSetStreamPixelAspectRatio: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, Enable: BOOL, pSourceAspectRatio: ^dxgi.RATIONAL, pDestinationAspectRatio: ^dxgi.RATIONAL), - VideoProcessorSetStreamLumaKey: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, Enable: BOOL, Lower: f32, Upper: f32), - VideoProcessorSetStreamStereoFormat: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, Enable: BOOL, Format: VIDEO_PROCESSOR_STEREO_FORMAT, LeftViewFrame0: BOOL, BaseViewFrame0: BOOL, FlipMode: VIDEO_PROCESSOR_STEREO_FLIP_MODE, MonoOffset: i32), - VideoProcessorSetStreamAutoProcessingMode: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, Enable: BOOL), - VideoProcessorSetStreamFilter: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, Filter: VIDEO_PROCESSOR_FILTER, Enable: BOOL, Level: i32), - VideoProcessorSetStreamExtension: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, pExtensionGuid: ^GUID, DataSize: u32, pData: rawptr) -> APP_DEPRECATED_HRESULT, - VideoProcessorGetStreamFrameFormat: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, pFrameFormat: ^VIDEO_FRAME_FORMAT), - VideoProcessorGetStreamColorSpace: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, pColorSpace: ^VIDEO_PROCESSOR_COLOR_SPACE), - VideoProcessorGetStreamOutputRate: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, pOutputRate: ^VIDEO_PROCESSOR_OUTPUT_RATE, pRepeatFrame: ^BOOL, pCustomRate: ^dxgi.RATIONAL), - VideoProcessorGetStreamSourceRect: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, pEnabled: ^BOOL, pRect: ^RECT), - VideoProcessorGetStreamDestRect: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, pEnabled: ^BOOL, pRect: ^RECT), - VideoProcessorGetStreamAlpha: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, pEnabled: ^BOOL, pAlpha: ^f32), - VideoProcessorGetStreamPalette: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, Count: u32, pEntries: ^u32), - VideoProcessorGetStreamPixelAspectRatio: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, pEnabled: ^BOOL, pSourceAspectRatio: ^dxgi.RATIONAL, pDestinationAspectRatio: ^dxgi.RATIONAL), - VideoProcessorGetStreamLumaKey: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, pEnabled: ^BOOL, pLower: ^f32, pUpper: ^f32), - VideoProcessorGetStreamStereoFormat: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, pEnable: ^BOOL, pFormat: ^VIDEO_PROCESSOR_STEREO_FORMAT, pLeftViewFrame0: ^BOOL, pBaseViewFrame0: ^BOOL, pFlipMode: ^VIDEO_PROCESSOR_STEREO_FLIP_MODE, MonoOffset: ^i32), - VideoProcessorGetStreamAutoProcessingMode: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, pEnabled: ^BOOL), - VideoProcessorGetStreamFilter: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, Filter: VIDEO_PROCESSOR_FILTER, pEnabled: ^BOOL, pLevel: ^i32), - VideoProcessorGetStreamExtension: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, pExtensionGuid: ^GUID, DataSize: u32, pData: rawptr) -> APP_DEPRECATED_HRESULT, - VideoProcessorBlt: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, pView: ^IVideoProcessorOutputView, OutputFrame: u32, StreamCount: u32, pStreams: ^VIDEO_PROCESSOR_STREAM) -> HRESULT, - NegotiateCryptoSessionKeyExchange: proc "stdcall" (this: ^IVideoContext, pCryptoSession: ^ICryptoSession, DataSize: u32, pData: rawptr) -> HRESULT, - EncryptionBlt: proc "stdcall" (this: ^IVideoContext, pCryptoSession: ^ICryptoSession, pSrcSurface: ^ITexture2D, pDstSurface: ^ITexture2D, IVSize: u32, pIV: rawptr), - DecryptionBlt: proc "stdcall" (this: ^IVideoContext, pCryptoSession: ^ICryptoSession, pSrcSurface: ^ITexture2D, pDstSurface: ^ITexture2D, pEncryptedBlockInfo: ^ENCRYPTED_BLOCK_INFO, ContentKeySize: u32, pContentKey: rawptr, IVSize: u32, pIV: rawptr), - StartSessionKeyRefresh: proc "stdcall" (this: ^IVideoContext, pCryptoSession: ^ICryptoSession, RandomNumberSize: u32, pRandomNumber: rawptr), - FinishSessionKeyRefresh: proc "stdcall" (this: ^IVideoContext, pCryptoSession: ^ICryptoSession), - GetEncryptionBltKey: proc "stdcall" (this: ^IVideoContext, pCryptoSession: ^ICryptoSession, KeySize: u32, pReadbackKey: rawptr) -> HRESULT, - NegotiateAuthenticatedChannelKeyExchange: proc "stdcall" (this: ^IVideoContext, pChannel: ^IAuthenticatedChannel, DataSize: u32, pData: rawptr) -> HRESULT, - QueryAuthenticatedChannel: proc "stdcall" (this: ^IVideoContext, pChannel: ^IAuthenticatedChannel, InputSize: u32, pInput: rawptr, OutputSize: u32, pOutput: rawptr) -> HRESULT, - ConfigureAuthenticatedChannel: proc "stdcall" (this: ^IVideoContext, pChannel: ^IAuthenticatedChannel, InputSize: u32, pInput: rawptr, pOutput: ^AUTHENTICATED_CONFIGURE_OUTPUT) -> HRESULT, - VideoProcessorSetStreamRotation: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, Enable: BOOL, Rotation: VIDEO_PROCESSOR_ROTATION), - VideoProcessorGetStreamRotation: proc "stdcall" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, pEnable: ^BOOL, pRotation: ^VIDEO_PROCESSOR_ROTATION), + GetDecoderBuffer: proc "system" (this: ^IVideoContext, pDecoder: ^IVideoDecoder, Type: VIDEO_DECODER_BUFFER_TYPE, pBufferSize: ^u32, ppBuffer: ^rawptr) -> HRESULT, + ReleaseDecoderBuffer: proc "system" (this: ^IVideoContext, pDecoder: ^IVideoDecoder, Type: VIDEO_DECODER_BUFFER_TYPE) -> HRESULT, + DecoderBeginFrame: proc "system" (this: ^IVideoContext, pDecoder: ^IVideoDecoder, pView: ^IVideoDecoderOutputView, ContentKeySize: u32, pContentKey: rawptr) -> HRESULT, + DecoderEndFrame: proc "system" (this: ^IVideoContext, pDecoder: ^IVideoDecoder) -> HRESULT, + SubmitDecoderBuffers: proc "system" (this: ^IVideoContext, pDecoder: ^IVideoDecoder, NumBuffers: u32, pBufferDesc: ^VIDEO_DECODER_BUFFER_DESC) -> HRESULT, + DecoderExtension: proc "system" (this: ^IVideoContext, pDecoder: ^IVideoDecoder, pExtensionData: ^VIDEO_DECODER_EXTENSION) -> APP_DEPRECATED_HRESULT, + VideoProcessorSetOutputTargetRect: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, Enable: BOOL, pRect: ^RECT), + VideoProcessorSetOutputBackgroundColor: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, YCbCr: BOOL, pColor: ^VIDEO_COLOR), + VideoProcessorSetOutputColorSpace: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, pColorSpace: ^VIDEO_PROCESSOR_COLOR_SPACE), + VideoProcessorSetOutputAlphaFillMode: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, AlphaFillMode: VIDEO_PROCESSOR_ALPHA_FILL_MODE, StreamIndex: u32), + VideoProcessorSetOutputConstriction: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, Enable: BOOL, Size: SIZE), + VideoProcessorSetOutputStereoMode: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, Enable: BOOL), + VideoProcessorSetOutputExtension: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, pExtensionGuid: ^GUID, DataSize: u32, pData: rawptr) -> APP_DEPRECATED_HRESULT, + VideoProcessorGetOutputTargetRect: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, Enabled: ^BOOL, pRect: ^RECT), + VideoProcessorGetOutputBackgroundColor: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, pYCbCr: ^BOOL, pColor: ^VIDEO_COLOR), + VideoProcessorGetOutputColorSpace: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, pColorSpace: ^VIDEO_PROCESSOR_COLOR_SPACE), + VideoProcessorGetOutputAlphaFillMode: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, pAlphaFillMode: ^VIDEO_PROCESSOR_ALPHA_FILL_MODE, pStreamIndex: ^u32), + VideoProcessorGetOutputConstriction: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, pEnabled: ^BOOL, pSize: ^SIZE), + VideoProcessorGetOutputStereoMode: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, pEnabled: ^BOOL), + VideoProcessorGetOutputExtension: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, pExtensionGuid: ^GUID, DataSize: u32, pData: rawptr) -> APP_DEPRECATED_HRESULT, + VideoProcessorSetStreamFrameFormat: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, FrameFormat: VIDEO_FRAME_FORMAT), + VideoProcessorSetStreamColorSpace: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, pColorSpace: ^VIDEO_PROCESSOR_COLOR_SPACE), + VideoProcessorSetStreamOutputRate: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, OutputRate: VIDEO_PROCESSOR_OUTPUT_RATE, RepeatFrame: BOOL, pCustomRate: ^dxgi.RATIONAL), + VideoProcessorSetStreamSourceRect: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, Enable: BOOL, pRect: ^RECT), + VideoProcessorSetStreamDestRect: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, Enable: BOOL, pRect: ^RECT), + VideoProcessorSetStreamAlpha: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, Enable: BOOL, Alpha: f32), + VideoProcessorSetStreamPalette: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, Count: u32, pEntries: ^u32), + VideoProcessorSetStreamPixelAspectRatio: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, Enable: BOOL, pSourceAspectRatio: ^dxgi.RATIONAL, pDestinationAspectRatio: ^dxgi.RATIONAL), + VideoProcessorSetStreamLumaKey: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, Enable: BOOL, Lower: f32, Upper: f32), + VideoProcessorSetStreamStereoFormat: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, Enable: BOOL, Format: VIDEO_PROCESSOR_STEREO_FORMAT, LeftViewFrame0: BOOL, BaseViewFrame0: BOOL, FlipMode: VIDEO_PROCESSOR_STEREO_FLIP_MODE, MonoOffset: i32), + VideoProcessorSetStreamAutoProcessingMode: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, Enable: BOOL), + VideoProcessorSetStreamFilter: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, Filter: VIDEO_PROCESSOR_FILTER, Enable: BOOL, Level: i32), + VideoProcessorSetStreamExtension: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, pExtensionGuid: ^GUID, DataSize: u32, pData: rawptr) -> APP_DEPRECATED_HRESULT, + VideoProcessorGetStreamFrameFormat: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, pFrameFormat: ^VIDEO_FRAME_FORMAT), + VideoProcessorGetStreamColorSpace: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, pColorSpace: ^VIDEO_PROCESSOR_COLOR_SPACE), + VideoProcessorGetStreamOutputRate: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, pOutputRate: ^VIDEO_PROCESSOR_OUTPUT_RATE, pRepeatFrame: ^BOOL, pCustomRate: ^dxgi.RATIONAL), + VideoProcessorGetStreamSourceRect: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, pEnabled: ^BOOL, pRect: ^RECT), + VideoProcessorGetStreamDestRect: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, pEnabled: ^BOOL, pRect: ^RECT), + VideoProcessorGetStreamAlpha: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, pEnabled: ^BOOL, pAlpha: ^f32), + VideoProcessorGetStreamPalette: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, Count: u32, pEntries: ^u32), + VideoProcessorGetStreamPixelAspectRatio: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, pEnabled: ^BOOL, pSourceAspectRatio: ^dxgi.RATIONAL, pDestinationAspectRatio: ^dxgi.RATIONAL), + VideoProcessorGetStreamLumaKey: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, pEnabled: ^BOOL, pLower: ^f32, pUpper: ^f32), + VideoProcessorGetStreamStereoFormat: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, pEnable: ^BOOL, pFormat: ^VIDEO_PROCESSOR_STEREO_FORMAT, pLeftViewFrame0: ^BOOL, pBaseViewFrame0: ^BOOL, pFlipMode: ^VIDEO_PROCESSOR_STEREO_FLIP_MODE, MonoOffset: ^i32), + VideoProcessorGetStreamAutoProcessingMode: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, pEnabled: ^BOOL), + VideoProcessorGetStreamFilter: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, Filter: VIDEO_PROCESSOR_FILTER, pEnabled: ^BOOL, pLevel: ^i32), + VideoProcessorGetStreamExtension: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, pExtensionGuid: ^GUID, DataSize: u32, pData: rawptr) -> APP_DEPRECATED_HRESULT, + VideoProcessorBlt: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, pView: ^IVideoProcessorOutputView, OutputFrame: u32, StreamCount: u32, pStreams: ^VIDEO_PROCESSOR_STREAM) -> HRESULT, + NegotiateCryptoSessionKeyExchange: proc "system" (this: ^IVideoContext, pCryptoSession: ^ICryptoSession, DataSize: u32, pData: rawptr) -> HRESULT, + EncryptionBlt: proc "system" (this: ^IVideoContext, pCryptoSession: ^ICryptoSession, pSrcSurface: ^ITexture2D, pDstSurface: ^ITexture2D, IVSize: u32, pIV: rawptr), + DecryptionBlt: proc "system" (this: ^IVideoContext, pCryptoSession: ^ICryptoSession, pSrcSurface: ^ITexture2D, pDstSurface: ^ITexture2D, pEncryptedBlockInfo: ^ENCRYPTED_BLOCK_INFO, ContentKeySize: u32, pContentKey: rawptr, IVSize: u32, pIV: rawptr), + StartSessionKeyRefresh: proc "system" (this: ^IVideoContext, pCryptoSession: ^ICryptoSession, RandomNumberSize: u32, pRandomNumber: rawptr), + FinishSessionKeyRefresh: proc "system" (this: ^IVideoContext, pCryptoSession: ^ICryptoSession), + GetEncryptionBltKey: proc "system" (this: ^IVideoContext, pCryptoSession: ^ICryptoSession, KeySize: u32, pReadbackKey: rawptr) -> HRESULT, + NegotiateAuthenticatedChannelKeyExchange: proc "system" (this: ^IVideoContext, pChannel: ^IAuthenticatedChannel, DataSize: u32, pData: rawptr) -> HRESULT, + QueryAuthenticatedChannel: proc "system" (this: ^IVideoContext, pChannel: ^IAuthenticatedChannel, InputSize: u32, pInput: rawptr, OutputSize: u32, pOutput: rawptr) -> HRESULT, + ConfigureAuthenticatedChannel: proc "system" (this: ^IVideoContext, pChannel: ^IAuthenticatedChannel, InputSize: u32, pInput: rawptr, pOutput: ^AUTHENTICATED_CONFIGURE_OUTPUT) -> HRESULT, + VideoProcessorSetStreamRotation: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, Enable: BOOL, Rotation: VIDEO_PROCESSOR_ROTATION), + VideoProcessorGetStreamRotation: proc "system" (this: ^IVideoContext, pVideoProcessor: ^IVideoProcessor, StreamIndex: u32, pEnable: ^BOOL, pRotation: ^VIDEO_PROCESSOR_ROTATION), } @@ -3290,23 +3290,23 @@ IVideoDevice :: struct #raw_union { } IVideoDevice_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - CreateVideoDecoder: proc "stdcall" (this: ^IVideoDevice, pVideoDesc: ^VIDEO_DECODER_DESC, pConfig: ^VIDEO_DECODER_CONFIG, ppDecoder: ^^IVideoDecoder) -> HRESULT, - CreateVideoProcessor: proc "stdcall" (this: ^IVideoDevice, pEnum: ^IVideoProcessorEnumerator, RateConversionIndex: u32, ppVideoProcessor: ^^IVideoProcessor) -> HRESULT, - CreateAuthenticatedChannel: proc "stdcall" (this: ^IVideoDevice, ChannelType: AUTHENTICATED_CHANNEL_TYPE, ppAuthenticatedChannel: ^^IAuthenticatedChannel) -> HRESULT, - CreateCryptoSession: proc "stdcall" (this: ^IVideoDevice, pCryptoType: ^GUID, pDecoderProfile: ^GUID, pKeyExchangeType: ^GUID, ppCryptoSession: ^^ICryptoSession) -> HRESULT, - CreateVideoDecoderOutputView: proc "stdcall" (this: ^IVideoDevice, pResource: ^IResource, pDesc: ^VIDEO_DECODER_OUTPUT_VIEW_DESC, ppVDOVView: ^^IVideoDecoderOutputView) -> HRESULT, - CreateVideoProcessorInputView: proc "stdcall" (this: ^IVideoDevice, pResource: ^IResource, pEnum: ^IVideoProcessorEnumerator, pDesc: ^VIDEO_PROCESSOR_INPUT_VIEW_DESC, ppVPIView: ^^IVideoProcessorInputView) -> HRESULT, - CreateVideoProcessorOutputView: proc "stdcall" (this: ^IVideoDevice, pResource: ^IResource, pEnum: ^IVideoProcessorEnumerator, pDesc: ^VIDEO_PROCESSOR_OUTPUT_VIEW_DESC, ppVPOView: ^^IVideoProcessorOutputView) -> HRESULT, - CreateVideoProcessorEnumerator: proc "stdcall" (this: ^IVideoDevice, pDesc: ^VIDEO_PROCESSOR_CONTENT_DESC, ppEnum: ^^IVideoProcessorEnumerator) -> HRESULT, - GetVideoDecoderProfileCount: proc "stdcall" (this: ^IVideoDevice) -> u32, - GetVideoDecoderProfile: proc "stdcall" (this: ^IVideoDevice, Index: u32, pDecoderProfile: ^GUID) -> HRESULT, - CheckVideoDecoderFormat: proc "stdcall" (this: ^IVideoDevice, pDecoderProfile: ^GUID, Format: dxgi.FORMAT, pSupported: ^BOOL) -> HRESULT, - GetVideoDecoderConfigCount: proc "stdcall" (this: ^IVideoDevice, pDesc: ^VIDEO_DECODER_DESC, pCount: ^u32) -> HRESULT, - GetVideoDecoderConfig: proc "stdcall" (this: ^IVideoDevice, pDesc: ^VIDEO_DECODER_DESC, Index: u32, pConfig: ^VIDEO_DECODER_CONFIG) -> HRESULT, - GetContentProtectionCaps: proc "stdcall" (this: ^IVideoDevice, pCryptoType: ^GUID, pDecoderProfile: ^GUID, pCaps: ^VIDEO_CONTENT_PROTECTION_CAPS) -> HRESULT, - CheckCryptoKeyExchange: proc "stdcall" (this: ^IVideoDevice, pCryptoType: ^GUID, pDecoderProfile: ^GUID, Index: u32, pKeyExchangeType: ^GUID) -> HRESULT, - SetPrivateData: proc "stdcall" (this: ^IVideoDevice, guid: ^GUID, DataSize: u32, pData: rawptr) -> HRESULT, - SetPrivateDataInterface: proc "stdcall" (this: ^IVideoDevice, guid: ^GUID, pData: ^IUnknown) -> HRESULT, + CreateVideoDecoder: proc "system" (this: ^IVideoDevice, pVideoDesc: ^VIDEO_DECODER_DESC, pConfig: ^VIDEO_DECODER_CONFIG, ppDecoder: ^^IVideoDecoder) -> HRESULT, + CreateVideoProcessor: proc "system" (this: ^IVideoDevice, pEnum: ^IVideoProcessorEnumerator, RateConversionIndex: u32, ppVideoProcessor: ^^IVideoProcessor) -> HRESULT, + CreateAuthenticatedChannel: proc "system" (this: ^IVideoDevice, ChannelType: AUTHENTICATED_CHANNEL_TYPE, ppAuthenticatedChannel: ^^IAuthenticatedChannel) -> HRESULT, + CreateCryptoSession: proc "system" (this: ^IVideoDevice, pCryptoType: ^GUID, pDecoderProfile: ^GUID, pKeyExchangeType: ^GUID, ppCryptoSession: ^^ICryptoSession) -> HRESULT, + CreateVideoDecoderOutputView: proc "system" (this: ^IVideoDevice, pResource: ^IResource, pDesc: ^VIDEO_DECODER_OUTPUT_VIEW_DESC, ppVDOVView: ^^IVideoDecoderOutputView) -> HRESULT, + CreateVideoProcessorInputView: proc "system" (this: ^IVideoDevice, pResource: ^IResource, pEnum: ^IVideoProcessorEnumerator, pDesc: ^VIDEO_PROCESSOR_INPUT_VIEW_DESC, ppVPIView: ^^IVideoProcessorInputView) -> HRESULT, + CreateVideoProcessorOutputView: proc "system" (this: ^IVideoDevice, pResource: ^IResource, pEnum: ^IVideoProcessorEnumerator, pDesc: ^VIDEO_PROCESSOR_OUTPUT_VIEW_DESC, ppVPOView: ^^IVideoProcessorOutputView) -> HRESULT, + CreateVideoProcessorEnumerator: proc "system" (this: ^IVideoDevice, pDesc: ^VIDEO_PROCESSOR_CONTENT_DESC, ppEnum: ^^IVideoProcessorEnumerator) -> HRESULT, + GetVideoDecoderProfileCount: proc "system" (this: ^IVideoDevice) -> u32, + GetVideoDecoderProfile: proc "system" (this: ^IVideoDevice, Index: u32, pDecoderProfile: ^GUID) -> HRESULT, + CheckVideoDecoderFormat: proc "system" (this: ^IVideoDevice, pDecoderProfile: ^GUID, Format: dxgi.FORMAT, pSupported: ^BOOL) -> HRESULT, + GetVideoDecoderConfigCount: proc "system" (this: ^IVideoDevice, pDesc: ^VIDEO_DECODER_DESC, pCount: ^u32) -> HRESULT, + GetVideoDecoderConfig: proc "system" (this: ^IVideoDevice, pDesc: ^VIDEO_DECODER_DESC, Index: u32, pConfig: ^VIDEO_DECODER_CONFIG) -> HRESULT, + GetContentProtectionCaps: proc "system" (this: ^IVideoDevice, pCryptoType: ^GUID, pDecoderProfile: ^GUID, pCaps: ^VIDEO_CONTENT_PROTECTION_CAPS) -> HRESULT, + CheckCryptoKeyExchange: proc "system" (this: ^IVideoDevice, pCryptoType: ^GUID, pDecoderProfile: ^GUID, Index: u32, pKeyExchangeType: ^GUID) -> HRESULT, + SetPrivateData: proc "system" (this: ^IVideoDevice, guid: ^GUID, DataSize: u32, pData: rawptr) -> HRESULT, + SetPrivateDataInterface: proc "system" (this: ^IVideoDevice, guid: ^GUID, pData: ^IUnknown) -> HRESULT, } @@ -3319,46 +3319,46 @@ IDevice :: struct #raw_union { } IDevice_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - CreateBuffer: proc "stdcall" (this: ^IDevice, pDesc: ^BUFFER_DESC, pInitialData: ^SUBRESOURCE_DATA, ppBuffer: ^^IBuffer) -> HRESULT, - CreateTexture1D: proc "stdcall" (this: ^IDevice, pDesc: ^TEXTURE1D_DESC, pInitialData: ^SUBRESOURCE_DATA, ppTexture1D: ^^ITexture1D) -> HRESULT, - CreateTexture2D: proc "stdcall" (this: ^IDevice, pDesc: ^TEXTURE2D_DESC, pInitialData: ^SUBRESOURCE_DATA, ppTexture2D: ^^ITexture2D) -> HRESULT, - CreateTexture3D: proc "stdcall" (this: ^IDevice, pDesc: ^TEXTURE3D_DESC, pInitialData: ^SUBRESOURCE_DATA, ppTexture3D: ^^ITexture3D) -> HRESULT, - CreateShaderResourceView: proc "stdcall" (this: ^IDevice, pResource: ^IResource, pDesc: ^SHADER_RESOURCE_VIEW_DESC, ppSRView: ^^IShaderResourceView) -> HRESULT, - CreateUnorderedAccessView: proc "stdcall" (this: ^IDevice, pResource: ^IResource, pDesc: ^UNORDERED_ACCESS_VIEW_DESC, ppUAView: ^^IUnorderedAccessView) -> HRESULT, - CreateRenderTargetView: proc "stdcall" (this: ^IDevice, pResource: ^IResource, pDesc: ^RENDER_TARGET_VIEW_DESC, ppRTView: ^^IRenderTargetView) -> HRESULT, - CreateDepthStencilView: proc "stdcall" (this: ^IDevice, pResource: ^IResource, pDesc: ^DEPTH_STENCIL_VIEW_DESC, ppDepthStencilView: ^^IDepthStencilView) -> HRESULT, - CreateInputLayout: proc "stdcall" (this: ^IDevice, pInputElementDescs: ^INPUT_ELEMENT_DESC, NumElements: u32, pShaderBytecodeWithInputSignature: rawptr, BytecodeLength: SIZE_T, ppInputLayout: ^^IInputLayout) -> HRESULT, - CreateVertexShader: proc "stdcall" (this: ^IDevice, pShaderBytecode: rawptr, BytecodeLength: SIZE_T, pClassLinkage: ^IClassLinkage, ppVertexShader: ^^IVertexShader) -> HRESULT, - CreateGeometryShader: proc "stdcall" (this: ^IDevice, pShaderBytecode: rawptr, BytecodeLength: SIZE_T, pClassLinkage: ^IClassLinkage, ppGeometryShader: ^^IGeometryShader) -> HRESULT, - CreateGeometryShaderWithStreamOutput: proc "stdcall" (this: ^IDevice, pShaderBytecode: rawptr, BytecodeLength: SIZE_T, pSODeclaration: ^SO_DECLARATION_ENTRY, NumEntries: u32, pBufferStrides: ^u32, NumStrides: u32, RasterizedStream: u32, pClassLinkage: ^IClassLinkage, ppGeometryShader: ^^IGeometryShader) -> HRESULT, - CreatePixelShader: proc "stdcall" (this: ^IDevice, pShaderBytecode: rawptr, BytecodeLength: SIZE_T, pClassLinkage: ^IClassLinkage, ppPixelShader: ^^IPixelShader) -> HRESULT, - CreateHullShader: proc "stdcall" (this: ^IDevice, pShaderBytecode: rawptr, BytecodeLength: SIZE_T, pClassLinkage: ^IClassLinkage, ppHullShader: ^^IHullShader) -> HRESULT, - CreateDomainShader: proc "stdcall" (this: ^IDevice, pShaderBytecode: rawptr, BytecodeLength: SIZE_T, pClassLinkage: ^IClassLinkage, ppDomainShader: ^^IDomainShader) -> HRESULT, - CreateComputeShader: proc "stdcall" (this: ^IDevice, pShaderBytecode: rawptr, BytecodeLength: SIZE_T, pClassLinkage: ^IClassLinkage, ppComputeShader: ^^IComputeShader) -> HRESULT, - CreateClassLinkage: proc "stdcall" (this: ^IDevice, ppLinkage: ^^IClassLinkage) -> HRESULT, - CreateBlendState: proc "stdcall" (this: ^IDevice, pBlendStateDesc: ^BLEND_DESC, ppBlendState: ^^IBlendState) -> HRESULT, - CreateDepthStencilState: proc "stdcall" (this: ^IDevice, pDepthStencilDesc: ^DEPTH_STENCIL_DESC, ppDepthStencilState: ^^IDepthStencilState) -> HRESULT, - CreateRasterizerState: proc "stdcall" (this: ^IDevice, pRasterizerDesc: ^RASTERIZER_DESC, ppRasterizerState: ^^IRasterizerState) -> HRESULT, - CreateSamplerState: proc "stdcall" (this: ^IDevice, pSamplerDesc: ^SAMPLER_DESC, ppSamplerState: ^^ISamplerState) -> HRESULT, - CreateQuery: proc "stdcall" (this: ^IDevice, pQueryDesc: ^QUERY_DESC, ppQuery: ^^IQuery) -> HRESULT, - CreatePredicate: proc "stdcall" (this: ^IDevice, pPredicateDesc: ^QUERY_DESC, ppPredicate: ^^IPredicate) -> HRESULT, - CreateCounter: proc "stdcall" (this: ^IDevice, pCounterDesc: ^COUNTER_DESC, ppCounter: ^^ICounter) -> HRESULT, - CreateDeferredContext: proc "stdcall" (this: ^IDevice, ContextFlags: u32, ppDeferredContext: ^^IDeviceContext) -> HRESULT, - OpenSharedResource: proc "stdcall" (this: ^IDevice, hResource: HANDLE, ReturnedInterface: ^IID, ppResource: ^rawptr) -> HRESULT, - CheckFormatSupport: proc "stdcall" (this: ^IDevice, Format: dxgi.FORMAT, pFormatSupport: ^u32) -> HRESULT, - CheckMultisampleQualityLevels: proc "stdcall" (this: ^IDevice, Format: dxgi.FORMAT, SampleCount: u32, pNumQualityLevels: ^u32) -> HRESULT, - CheckCounterInfo: proc "stdcall" (this: ^IDevice, pCounterInfo: ^COUNTER_INFO), - CheckCounter: proc "stdcall" (this: ^IDevice, pDesc: ^COUNTER_DESC, pType: ^COUNTER_TYPE, pActiveCounters: ^u32, szName: cstring, pNameLength: ^u32, szUnits: ^u8, pUnitsLength: ^u32, szDescription: cstring, pDescriptionLength: ^u32) -> HRESULT, - CheckFeatureSupport: proc "stdcall" (this: ^IDevice, Feature: FEATURE, pFeatureSupportData: rawptr, FeatureSupportDataSize: u32) -> HRESULT, - GetPrivateData: proc "stdcall" (this: ^IDevice, guid: ^GUID, pDataSize: ^u32, pData: rawptr) -> HRESULT, - SetPrivateData: proc "stdcall" (this: ^IDevice, guid: ^GUID, DataSize: u32, pData: rawptr) -> HRESULT, - SetPrivateDataInterface: proc "stdcall" (this: ^IDevice, guid: ^GUID, pData: ^IUnknown) -> HRESULT, - GetFeatureLevel: proc "stdcall" (this: ^IDevice) -> FEATURE_LEVEL, - GetCreationFlags: proc "stdcall" (this: ^IDevice) -> u32, - GetDeviceRemovedReason: proc "stdcall" (this: ^IDevice) -> HRESULT, - GetImmediateContext: proc "stdcall" (this: ^IDevice, ppImmediateContext: ^^IDeviceContext), - SetExceptionMode: proc "stdcall" (this: ^IDevice, RaiseFlags: RAISE_FLAGS) -> HRESULT, - GetExceptionMode: proc "stdcall" (this: ^IDevice) -> u32, + CreateBuffer: proc "system" (this: ^IDevice, pDesc: ^BUFFER_DESC, pInitialData: ^SUBRESOURCE_DATA, ppBuffer: ^^IBuffer) -> HRESULT, + CreateTexture1D: proc "system" (this: ^IDevice, pDesc: ^TEXTURE1D_DESC, pInitialData: ^SUBRESOURCE_DATA, ppTexture1D: ^^ITexture1D) -> HRESULT, + CreateTexture2D: proc "system" (this: ^IDevice, pDesc: ^TEXTURE2D_DESC, pInitialData: ^SUBRESOURCE_DATA, ppTexture2D: ^^ITexture2D) -> HRESULT, + CreateTexture3D: proc "system" (this: ^IDevice, pDesc: ^TEXTURE3D_DESC, pInitialData: ^SUBRESOURCE_DATA, ppTexture3D: ^^ITexture3D) -> HRESULT, + CreateShaderResourceView: proc "system" (this: ^IDevice, pResource: ^IResource, pDesc: ^SHADER_RESOURCE_VIEW_DESC, ppSRView: ^^IShaderResourceView) -> HRESULT, + CreateUnorderedAccessView: proc "system" (this: ^IDevice, pResource: ^IResource, pDesc: ^UNORDERED_ACCESS_VIEW_DESC, ppUAView: ^^IUnorderedAccessView) -> HRESULT, + CreateRenderTargetView: proc "system" (this: ^IDevice, pResource: ^IResource, pDesc: ^RENDER_TARGET_VIEW_DESC, ppRTView: ^^IRenderTargetView) -> HRESULT, + CreateDepthStencilView: proc "system" (this: ^IDevice, pResource: ^IResource, pDesc: ^DEPTH_STENCIL_VIEW_DESC, ppDepthStencilView: ^^IDepthStencilView) -> HRESULT, + CreateInputLayout: proc "system" (this: ^IDevice, pInputElementDescs: ^INPUT_ELEMENT_DESC, NumElements: u32, pShaderBytecodeWithInputSignature: rawptr, BytecodeLength: SIZE_T, ppInputLayout: ^^IInputLayout) -> HRESULT, + CreateVertexShader: proc "system" (this: ^IDevice, pShaderBytecode: rawptr, BytecodeLength: SIZE_T, pClassLinkage: ^IClassLinkage, ppVertexShader: ^^IVertexShader) -> HRESULT, + CreateGeometryShader: proc "system" (this: ^IDevice, pShaderBytecode: rawptr, BytecodeLength: SIZE_T, pClassLinkage: ^IClassLinkage, ppGeometryShader: ^^IGeometryShader) -> HRESULT, + CreateGeometryShaderWithStreamOutput: proc "system" (this: ^IDevice, pShaderBytecode: rawptr, BytecodeLength: SIZE_T, pSODeclaration: ^SO_DECLARATION_ENTRY, NumEntries: u32, pBufferStrides: ^u32, NumStrides: u32, RasterizedStream: u32, pClassLinkage: ^IClassLinkage, ppGeometryShader: ^^IGeometryShader) -> HRESULT, + CreatePixelShader: proc "system" (this: ^IDevice, pShaderBytecode: rawptr, BytecodeLength: SIZE_T, pClassLinkage: ^IClassLinkage, ppPixelShader: ^^IPixelShader) -> HRESULT, + CreateHullShader: proc "system" (this: ^IDevice, pShaderBytecode: rawptr, BytecodeLength: SIZE_T, pClassLinkage: ^IClassLinkage, ppHullShader: ^^IHullShader) -> HRESULT, + CreateDomainShader: proc "system" (this: ^IDevice, pShaderBytecode: rawptr, BytecodeLength: SIZE_T, pClassLinkage: ^IClassLinkage, ppDomainShader: ^^IDomainShader) -> HRESULT, + CreateComputeShader: proc "system" (this: ^IDevice, pShaderBytecode: rawptr, BytecodeLength: SIZE_T, pClassLinkage: ^IClassLinkage, ppComputeShader: ^^IComputeShader) -> HRESULT, + CreateClassLinkage: proc "system" (this: ^IDevice, ppLinkage: ^^IClassLinkage) -> HRESULT, + CreateBlendState: proc "system" (this: ^IDevice, pBlendStateDesc: ^BLEND_DESC, ppBlendState: ^^IBlendState) -> HRESULT, + CreateDepthStencilState: proc "system" (this: ^IDevice, pDepthStencilDesc: ^DEPTH_STENCIL_DESC, ppDepthStencilState: ^^IDepthStencilState) -> HRESULT, + CreateRasterizerState: proc "system" (this: ^IDevice, pRasterizerDesc: ^RASTERIZER_DESC, ppRasterizerState: ^^IRasterizerState) -> HRESULT, + CreateSamplerState: proc "system" (this: ^IDevice, pSamplerDesc: ^SAMPLER_DESC, ppSamplerState: ^^ISamplerState) -> HRESULT, + CreateQuery: proc "system" (this: ^IDevice, pQueryDesc: ^QUERY_DESC, ppQuery: ^^IQuery) -> HRESULT, + CreatePredicate: proc "system" (this: ^IDevice, pPredicateDesc: ^QUERY_DESC, ppPredicate: ^^IPredicate) -> HRESULT, + CreateCounter: proc "system" (this: ^IDevice, pCounterDesc: ^COUNTER_DESC, ppCounter: ^^ICounter) -> HRESULT, + CreateDeferredContext: proc "system" (this: ^IDevice, ContextFlags: u32, ppDeferredContext: ^^IDeviceContext) -> HRESULT, + OpenSharedResource: proc "system" (this: ^IDevice, hResource: HANDLE, ReturnedInterface: ^IID, ppResource: ^rawptr) -> HRESULT, + CheckFormatSupport: proc "system" (this: ^IDevice, Format: dxgi.FORMAT, pFormatSupport: ^u32) -> HRESULT, + CheckMultisampleQualityLevels: proc "system" (this: ^IDevice, Format: dxgi.FORMAT, SampleCount: u32, pNumQualityLevels: ^u32) -> HRESULT, + CheckCounterInfo: proc "system" (this: ^IDevice, pCounterInfo: ^COUNTER_INFO), + CheckCounter: proc "system" (this: ^IDevice, pDesc: ^COUNTER_DESC, pType: ^COUNTER_TYPE, pActiveCounters: ^u32, szName: cstring, pNameLength: ^u32, szUnits: ^u8, pUnitsLength: ^u32, szDescription: cstring, pDescriptionLength: ^u32) -> HRESULT, + CheckFeatureSupport: proc "system" (this: ^IDevice, Feature: FEATURE, pFeatureSupportData: rawptr, FeatureSupportDataSize: u32) -> HRESULT, + GetPrivateData: proc "system" (this: ^IDevice, guid: ^GUID, pDataSize: ^u32, pData: rawptr) -> HRESULT, + SetPrivateData: proc "system" (this: ^IDevice, guid: ^GUID, DataSize: u32, pData: rawptr) -> HRESULT, + SetPrivateDataInterface: proc "system" (this: ^IDevice, guid: ^GUID, pData: ^IUnknown) -> HRESULT, + GetFeatureLevel: proc "system" (this: ^IDevice) -> FEATURE_LEVEL, + GetCreationFlags: proc "system" (this: ^IDevice) -> u32, + GetDeviceRemovedReason: proc "system" (this: ^IDevice) -> HRESULT, + GetImmediateContext: proc "system" (this: ^IDevice, ppImmediateContext: ^^IDeviceContext), + SetExceptionMode: proc "system" (this: ^IDevice, RaiseFlags: RAISE_FLAGS) -> HRESULT, + GetExceptionMode: proc "system" (this: ^IDevice) -> u32, } @@ -3558,17 +3558,17 @@ IShaderReflectionType :: struct { using vtable: ^IShaderReflectionType_VTable, } IShaderReflectionType_VTable :: struct { - GetDesc: proc "stdcall" (this: ^IShaderReflectionType, pDesc: ^SHADER_TYPE_DESC) -> HRESULT, - GetMemberTypeByIndex: proc "stdcall" (this: ^IShaderReflectionType, Index: u32) -> ^IShaderReflectionType, - GetMemberTypeByName: proc "stdcall" (this: ^IShaderReflectionType, Name: cstring) -> ^IShaderReflectionType, - GetMemberTypeName: proc "stdcall" (this: ^IShaderReflectionType, Index: u32) -> cstring, - IsEqual: proc "stdcall" (this: ^IShaderReflectionType, pType: ^IShaderReflectionType) -> HRESULT, - GetSubType: proc "stdcall" (this: ^IShaderReflectionType) -> ^IShaderReflectionType, - GetBaseClass: proc "stdcall" (this: ^IShaderReflectionType) -> ^IShaderReflectionType, - GetNumInterfaces: proc "stdcall" (this: ^IShaderReflectionType) -> u32, - GetInterfaceByIndex: proc "stdcall" (this: ^IShaderReflectionType, uIndex: u32) -> ^IShaderReflectionType, - IsOfType: proc "stdcall" (this: ^IShaderReflectionType, pType: ^IShaderReflectionType) -> HRESULT, - ImplementsInterface: proc "stdcall" (this: ^IShaderReflectionType, pBase: ^IShaderReflectionType) -> HRESULT, + GetDesc: proc "system" (this: ^IShaderReflectionType, pDesc: ^SHADER_TYPE_DESC) -> HRESULT, + GetMemberTypeByIndex: proc "system" (this: ^IShaderReflectionType, Index: u32) -> ^IShaderReflectionType, + GetMemberTypeByName: proc "system" (this: ^IShaderReflectionType, Name: cstring) -> ^IShaderReflectionType, + GetMemberTypeName: proc "system" (this: ^IShaderReflectionType, Index: u32) -> cstring, + IsEqual: proc "system" (this: ^IShaderReflectionType, pType: ^IShaderReflectionType) -> HRESULT, + GetSubType: proc "system" (this: ^IShaderReflectionType) -> ^IShaderReflectionType, + GetBaseClass: proc "system" (this: ^IShaderReflectionType) -> ^IShaderReflectionType, + GetNumInterfaces: proc "system" (this: ^IShaderReflectionType) -> u32, + GetInterfaceByIndex: proc "system" (this: ^IShaderReflectionType, uIndex: u32) -> ^IShaderReflectionType, + IsOfType: proc "system" (this: ^IShaderReflectionType, pType: ^IShaderReflectionType) -> HRESULT, + ImplementsInterface: proc "system" (this: ^IShaderReflectionType, pBase: ^IShaderReflectionType) -> HRESULT, } ID3D11ShaderReflectionVariable_UUID_STRING :: "51F23923-F3E5-4BD1-91CB-606177D8DB4C" @@ -3577,10 +3577,10 @@ IShaderReflectionVariable :: struct { using vtable: ^IShaderReflectionVariable_VTable, } IShaderReflectionVariable_VTable :: struct { - GetDesc: proc "stdcall" (this: ^IShaderReflectionVariable, pDesc: ^SHADER_VARIABLE_DESC) -> HRESULT, - GetType: proc "stdcall" (this: ^IShaderReflectionVariable) -> ^IShaderReflectionType, - GetBuffer: proc "stdcall" (this: ^IShaderReflectionVariable) -> ^IShaderReflectionConstantBuffer, - GetInterfaceSlot: proc "stdcall" (this: ^IShaderReflectionVariable, uArrayIndex: u32) -> u32, + GetDesc: proc "system" (this: ^IShaderReflectionVariable, pDesc: ^SHADER_VARIABLE_DESC) -> HRESULT, + GetType: proc "system" (this: ^IShaderReflectionVariable) -> ^IShaderReflectionType, + GetBuffer: proc "system" (this: ^IShaderReflectionVariable) -> ^IShaderReflectionConstantBuffer, + GetInterfaceSlot: proc "system" (this: ^IShaderReflectionVariable, uArrayIndex: u32) -> u32, } ID3D11ShaderReflectionConstantBuffer_UUID_STRING :: "EB62D63D-93DD-4318-8AE8-C6F83AD371B8" @@ -3589,9 +3589,9 @@ IShaderReflectionConstantBuffer :: struct { using vtable: ^IShaderReflectionConstantBuffer_VTable, } IShaderReflectionConstantBuffer_VTable :: struct { - GetDesc: proc "stdcall" (this: ^IShaderReflectionConstantBuffer, pDesc: ^SHADER_BUFFER_DESC) -> HRESULT, - GetVariableByIndex: proc "stdcall" (this: ^IShaderReflectionConstantBuffer, Index: u32) -> ^IShaderReflectionVariable, - GetVariableByName: proc "stdcall" (this: ^IShaderReflectionConstantBuffer, Name: cstring) -> ^IShaderReflectionVariable, + GetDesc: proc "system" (this: ^IShaderReflectionConstantBuffer, pDesc: ^SHADER_BUFFER_DESC) -> HRESULT, + GetVariableByIndex: proc "system" (this: ^IShaderReflectionConstantBuffer, Index: u32) -> ^IShaderReflectionVariable, + GetVariableByName: proc "system" (this: ^IShaderReflectionConstantBuffer, Name: cstring) -> ^IShaderReflectionVariable, } @@ -3603,25 +3603,25 @@ IShaderReflection :: struct #raw_union { } IShaderReflection_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - GetDesc: proc "stdcall" (this: ^IShaderReflection, pDesc: ^SHADER_DESC) -> HRESULT, - GetConstantBufferByIndex: proc "stdcall" (this: ^IShaderReflection, Index: u32) -> ^IShaderReflectionConstantBuffer, - GetConstantBufferByName: proc "stdcall" (this: ^IShaderReflection, Name: cstring) -> ^IShaderReflectionConstantBuffer, - GetResourceBindingDesc: proc "stdcall" (this: ^IShaderReflection, ResourceIndex: u32, pDesc: ^SHADER_INPUT_BIND_DESC) -> HRESULT, - GetInputParameterDesc: proc "stdcall" (this: ^IShaderReflection, ParameterIndex: u32, pDesc: ^SIGNATURE_PARAMETER_DESC) -> HRESULT, - GetOutputParameterDesc: proc "stdcall" (this: ^IShaderReflection, ParameterIndex: u32, pDesc: ^SIGNATURE_PARAMETER_DESC) -> HRESULT, - GetPatchConstantParameterDesc: proc "stdcall" (this: ^IShaderReflection, ParameterIndex: u32, pDesc: ^SIGNATURE_PARAMETER_DESC) -> HRESULT, - GetVariableByName: proc "stdcall" (this: ^IShaderReflection, Name: cstring) -> ^IShaderReflectionVariable, - GetResourceBindingDescByName: proc "stdcall" (this: ^IShaderReflection, Name: cstring, pDesc: ^SHADER_INPUT_BIND_DESC) -> HRESULT, - GetMovInstructionCount: proc "stdcall" (this: ^IShaderReflection) -> u32, - GetMovcInstructionCount: proc "stdcall" (this: ^IShaderReflection) -> u32, - GetConversionInstructionCount: proc "stdcall" (this: ^IShaderReflection) -> u32, - GetBitwiseInstructionCount: proc "stdcall" (this: ^IShaderReflection) -> u32, - GetGSInputPrimitive: proc "stdcall" (this: ^IShaderReflection) -> PRIMITIVE, - IsSampleFrequencyShader: proc "stdcall" (this: ^IShaderReflection) -> BOOL, - GetNumInterfaceSlots: proc "stdcall" (this: ^IShaderReflection) -> u32, - GetMinFeatureLevel: proc "stdcall" (this: ^IShaderReflection, pLevel: ^FEATURE_LEVEL) -> HRESULT, - GetThreadGroupSize: proc "stdcall" (this: ^IShaderReflection, pSizeX: ^u32, pSizeY: ^u32, pSizeZ: ^u32) -> u32, - GetRequiresFlags: proc "stdcall" (this: ^IShaderReflection) -> SHADER_REQUIRES_FLAGS, + GetDesc: proc "system" (this: ^IShaderReflection, pDesc: ^SHADER_DESC) -> HRESULT, + GetConstantBufferByIndex: proc "system" (this: ^IShaderReflection, Index: u32) -> ^IShaderReflectionConstantBuffer, + GetConstantBufferByName: proc "system" (this: ^IShaderReflection, Name: cstring) -> ^IShaderReflectionConstantBuffer, + GetResourceBindingDesc: proc "system" (this: ^IShaderReflection, ResourceIndex: u32, pDesc: ^SHADER_INPUT_BIND_DESC) -> HRESULT, + GetInputParameterDesc: proc "system" (this: ^IShaderReflection, ParameterIndex: u32, pDesc: ^SIGNATURE_PARAMETER_DESC) -> HRESULT, + GetOutputParameterDesc: proc "system" (this: ^IShaderReflection, ParameterIndex: u32, pDesc: ^SIGNATURE_PARAMETER_DESC) -> HRESULT, + GetPatchConstantParameterDesc: proc "system" (this: ^IShaderReflection, ParameterIndex: u32, pDesc: ^SIGNATURE_PARAMETER_DESC) -> HRESULT, + GetVariableByName: proc "system" (this: ^IShaderReflection, Name: cstring) -> ^IShaderReflectionVariable, + GetResourceBindingDescByName: proc "system" (this: ^IShaderReflection, Name: cstring, pDesc: ^SHADER_INPUT_BIND_DESC) -> HRESULT, + GetMovInstructionCount: proc "system" (this: ^IShaderReflection) -> u32, + GetMovcInstructionCount: proc "system" (this: ^IShaderReflection) -> u32, + GetConversionInstructionCount: proc "system" (this: ^IShaderReflection) -> u32, + GetBitwiseInstructionCount: proc "system" (this: ^IShaderReflection) -> u32, + GetGSInputPrimitive: proc "system" (this: ^IShaderReflection) -> PRIMITIVE, + IsSampleFrequencyShader: proc "system" (this: ^IShaderReflection) -> BOOL, + GetNumInterfaceSlots: proc "system" (this: ^IShaderReflection) -> u32, + GetMinFeatureLevel: proc "system" (this: ^IShaderReflection, pLevel: ^FEATURE_LEVEL) -> HRESULT, + GetThreadGroupSize: proc "system" (this: ^IShaderReflection, pSizeX: ^u32, pSizeY: ^u32, pSizeZ: ^u32) -> u32, + GetRequiresFlags: proc "system" (this: ^IShaderReflection) -> SHADER_REQUIRES_FLAGS, } @@ -3633,8 +3633,8 @@ ILibraryReflection :: struct #raw_union { } ILibraryReflection_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - GetDesc: proc "stdcall" (this: ^ILibraryReflection, pDesc: ^LIBRARY_DESC) -> HRESULT, - GetFunctionByIndex: proc "stdcall" (this: ^ILibraryReflection, FunctionIndex: i32) -> ^IFunctionReflection, + GetDesc: proc "system" (this: ^ILibraryReflection, pDesc: ^LIBRARY_DESC) -> HRESULT, + GetFunctionByIndex: proc "system" (this: ^ILibraryReflection, FunctionIndex: i32) -> ^IFunctionReflection, } ID3D11FunctionReflection_UUID_STRING :: "207BCECB-D683-4A06-A8A3-9B149B9F73A4" @@ -3643,13 +3643,13 @@ IFunctionReflection :: struct { using vtable: ^IFunctionReflection_VTable, } IFunctionReflection_VTable :: struct { - GetDesc: proc "stdcall" (this: ^IFunctionReflection, pDesc: ^FUNCTION_DESC) -> HRESULT, - GetConstantBufferByIndex: proc "stdcall" (this: ^IFunctionReflection, BufferIndex: u32) -> ^IShaderReflectionConstantBuffer, - GetConstantBufferByName: proc "stdcall" (this: ^IFunctionReflection, Name: cstring) -> ^IShaderReflectionConstantBuffer, - GetResourceBindingDesc: proc "stdcall" (this: ^IFunctionReflection, ResourceIndex: u32, pDesc: ^SHADER_INPUT_BIND_DESC) -> HRESULT, - GetVariableByName: proc "stdcall" (this: ^IFunctionReflection, Name: cstring) -> ^IShaderReflectionVariable, - GetResourceBindingDescByName: proc "stdcall" (this: ^IFunctionReflection, Name: cstring, pDesc: ^SHADER_INPUT_BIND_DESC) -> HRESULT, - GetFunctionParameter: proc "stdcall" (this: ^IFunctionReflection, ParameterIndex: i32) -> ^IFunctionParameterReflection, + GetDesc: proc "system" (this: ^IFunctionReflection, pDesc: ^FUNCTION_DESC) -> HRESULT, + GetConstantBufferByIndex: proc "system" (this: ^IFunctionReflection, BufferIndex: u32) -> ^IShaderReflectionConstantBuffer, + GetConstantBufferByName: proc "system" (this: ^IFunctionReflection, Name: cstring) -> ^IShaderReflectionConstantBuffer, + GetResourceBindingDesc: proc "system" (this: ^IFunctionReflection, ResourceIndex: u32, pDesc: ^SHADER_INPUT_BIND_DESC) -> HRESULT, + GetVariableByName: proc "system" (this: ^IFunctionReflection, Name: cstring) -> ^IShaderReflectionVariable, + GetResourceBindingDescByName: proc "system" (this: ^IFunctionReflection, Name: cstring, pDesc: ^SHADER_INPUT_BIND_DESC) -> HRESULT, + GetFunctionParameter: proc "system" (this: ^IFunctionReflection, ParameterIndex: i32) -> ^IFunctionParameterReflection, } ID3D11FunctionParameterReflection_UUID_STRING :: "42757488-334F-47FE-982E-1A65D08CC462" @@ -3658,7 +3658,7 @@ IFunctionParameterReflection :: struct { using vtable: ^IFunctionParameterReflection_VTable, } IFunctionParameterReflection_VTable :: struct { - GetDesc: proc "stdcall" (this: ^IFunctionParameterReflection, pDesc: ^PARAMETER_DESC) -> HRESULT, + GetDesc: proc "system" (this: ^IFunctionParameterReflection, pDesc: ^PARAMETER_DESC) -> HRESULT, } @@ -3672,14 +3672,14 @@ IFunctionLinkingGraph :: struct #raw_union { } IFunctionLinkingGraph_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - CreateModuleInstance: proc "stdcall" (this: ^IFunctionLinkingGraph, ppModuleInstance: ^^IModuleInstance, ppErrorBuffer: ^^IBlob) -> HRESULT, - SetInputSignature: proc "stdcall" (this: ^IFunctionLinkingGraph, pInputParameters: ^PARAMETER_DESC, cInputParameters: u32, ppInputNode: ^^ILinkingNode) -> HRESULT, - SetOutputSignature: proc "stdcall" (this: ^IFunctionLinkingGraph, pOutputParameters: ^PARAMETER_DESC, cOutputParameters: u32, ppOutputNode: ^^ILinkingNode) -> HRESULT, - CallFunction: proc "stdcall" (this: ^IFunctionLinkingGraph, pModuleInstanceNamespace: cstring, pModuleWithFunctionPrototype: ^IModule, pFunctionName: cstring, ppCallNode: ^^ILinkingNode) -> HRESULT, - PassValue: proc "stdcall" (this: ^IFunctionLinkingGraph, pSrcNode: ^ILinkingNode, SrcParameterIndex: i32, pDstNode: ^ILinkingNode, DstParameterIndex: i32) -> HRESULT, - PassValueWithSwizzle: proc "stdcall" (this: ^IFunctionLinkingGraph, pSrcNode: ^ILinkingNode, SrcParameterIndex: i32, pSrcSwizzle: ^u8, pDstNode: ^ILinkingNode, DstParameterIndex: i32, pDstSwizzle: ^u8) -> HRESULT, - GetLastError: proc "stdcall" (this: ^IFunctionLinkingGraph, ppErrorBuffer: ^^IBlob) -> HRESULT, - GenerateHlsl: proc "stdcall" (this: ^IFunctionLinkingGraph, uFlags: u32, ppBuffer: ^^IBlob) -> HRESULT, + CreateModuleInstance: proc "system" (this: ^IFunctionLinkingGraph, ppModuleInstance: ^^IModuleInstance, ppErrorBuffer: ^^IBlob) -> HRESULT, + SetInputSignature: proc "system" (this: ^IFunctionLinkingGraph, pInputParameters: ^PARAMETER_DESC, cInputParameters: u32, ppInputNode: ^^ILinkingNode) -> HRESULT, + SetOutputSignature: proc "system" (this: ^IFunctionLinkingGraph, pOutputParameters: ^PARAMETER_DESC, cOutputParameters: u32, ppOutputNode: ^^ILinkingNode) -> HRESULT, + CallFunction: proc "system" (this: ^IFunctionLinkingGraph, pModuleInstanceNamespace: cstring, pModuleWithFunctionPrototype: ^IModule, pFunctionName: cstring, ppCallNode: ^^ILinkingNode) -> HRESULT, + PassValue: proc "system" (this: ^IFunctionLinkingGraph, pSrcNode: ^ILinkingNode, SrcParameterIndex: i32, pDstNode: ^ILinkingNode, DstParameterIndex: i32) -> HRESULT, + PassValueWithSwizzle: proc "system" (this: ^IFunctionLinkingGraph, pSrcNode: ^ILinkingNode, SrcParameterIndex: i32, pSrcSwizzle: ^u8, pDstNode: ^ILinkingNode, DstParameterIndex: i32, pDstSwizzle: ^u8) -> HRESULT, + GetLastError: proc "system" (this: ^IFunctionLinkingGraph, ppErrorBuffer: ^^IBlob) -> HRESULT, + GenerateHlsl: proc "system" (this: ^IFunctionLinkingGraph, uFlags: u32, ppBuffer: ^^IBlob) -> HRESULT, } IDebug_UUID_STRING :: "79CF2233-7536-4948-9D36-1E4692DC5760" @@ -3706,15 +3706,15 @@ DEBUG_FEATURE :: enum u32 { IDebug_VTable :: struct { using iunkown_vtable: IUnknown_VTable, - SetFeatureMask: proc "stdcall" (this: ^IDebug, mask: DEBUG_FEATURES) -> HRESULT, - GetFeatureMask: proc "stdcall" (this: ^IDebug) -> DEBUG_FEATURES, - SetPresentPerRenderOpDelay: proc "stdcall" (this: ^IDebug, Milliseconds: u32) -> HRESULT, - GetPresentPerRenderOpDelay: proc "stdcall" (this: ^IDebug) -> u32, - SetSwapChain: proc "stdcall" (this: ^IDebug, pSwapChain: ^dxgi.ISwapChain) -> HRESULT, - GetSwapChain: proc "stdcall" (this: ^IDebug, ppSwapChain: ^^dxgi.ISwapChain) -> HRESULT, - ValidateContext: proc "stdcall" (this: ^IDebug, pContext: ^IDeviceContext) -> HRESULT, - ReportLiveDeviceObjects: proc "stdcall" (this: ^IDebug, Flags: RLDO_FLAGS) -> HRESULT, - ValidateContextForDispatch: proc "stdcall" (this: ^IDebug, pContext: ^IDeviceContext) -> HRESULT, + SetFeatureMask: proc "system" (this: ^IDebug, mask: DEBUG_FEATURES) -> HRESULT, + GetFeatureMask: proc "system" (this: ^IDebug) -> DEBUG_FEATURES, + SetPresentPerRenderOpDelay: proc "system" (this: ^IDebug, Milliseconds: u32) -> HRESULT, + GetPresentPerRenderOpDelay: proc "system" (this: ^IDebug) -> u32, + SetSwapChain: proc "system" (this: ^IDebug, pSwapChain: ^dxgi.ISwapChain) -> HRESULT, + GetSwapChain: proc "system" (this: ^IDebug, ppSwapChain: ^^dxgi.ISwapChain) -> HRESULT, + ValidateContext: proc "system" (this: ^IDebug, pContext: ^IDeviceContext) -> HRESULT, + ReportLiveDeviceObjects: proc "system" (this: ^IDebug, Flags: RLDO_FLAGS) -> HRESULT, + ValidateContextForDispatch: proc "system" (this: ^IDebug, pContext: ^IDeviceContext) -> HRESULT, } IInfoQueue_UUID_STRING :: "6543DBB6-1B48-42F5-AB82-E97EC74326F6" @@ -3773,39 +3773,39 @@ MESSAGE :: struct { IInfoQueue_VTable :: struct { using iunkown_vtable: IUnknown_VTable, - AddApplicationMessage: proc "stdcall" (this: ^IInfoQueue, Severity: MESSAGE_SEVERITY, pDescription: cstring) -> HRESULT, - AddMessage: proc "stdcall" (this: ^IInfoQueue, Category: MESSAGE_CATEGORY, Severity: MESSAGE_SEVERITY, ID: MESSAGE_ID, pDescription: cstring) -> HRESULT, - AddRetrievalFilterEntries: proc "stdcall" (this: ^IInfoQueue, pFilter: ^INFO_QUEUE_FILTER) -> HRESULT, - AddStorageFilterEntries: proc "stdcall" (this: ^IInfoQueue, pFilter: ^INFO_QUEUE_FILTER) -> HRESULT, - ClearRetrievalFilter: proc "stdcall" (this: ^IInfoQueue), - ClearStorageFilter: proc "stdcall" (this: ^IInfoQueue), - ClearStoredMessages: proc "stdcall" (this: ^IInfoQueue), - GetBreakOnCategory: proc "stdcall" (this: ^IInfoQueue, Category: MESSAGE_CATEGORY) -> BOOL, - GetBreakOnID: proc "stdcall" (this: ^IInfoQueue, ID: MESSAGE_ID) -> BOOL, - GetBreakOnSeverity: proc "stdcall" (this: ^IInfoQueue, Severity: MESSAGE_SEVERITY) -> BOOL, - GetMessage: proc "stdcall" (this: ^IInfoQueue, MessageIndex: u64, pMessage: ^MESSAGE, pMessageByteLength: ^SIZE_T) -> HRESULT, - GetMessageCountLimit: proc "stdcall" (this: ^IInfoQueue) -> u64, - GetMuteDebugOutput: proc "stdcall" (this: ^IInfoQueue) -> BOOL, - GetNumMessagesAllowedByStorageFilter: proc "stdcall" (this: ^IInfoQueue) -> u64, - GetNumMessagesDeniedByStorageFilter: proc "stdcall" (this: ^IInfoQueue) -> u64, - GetNumMessagesDiscardedByMessageCountLimit: proc "stdcall" (this: ^IInfoQueue) -> u64, - GetNumStoredMessages: proc "stdcall" (this: ^IInfoQueue) -> u64, - GetNumStoredMessagesAllowedByRetrievalFilter: proc "stdcall" (this: ^IInfoQueue) -> u64, - GetRetrievalFilter: proc "stdcall" (this: ^IInfoQueue, pFilter: ^INFO_QUEUE_FILTER, pFilterByteLength: ^SIZE_T) -> HRESULT, - GetRetrievalFilterStackSize: proc "stdcall" (this: ^IInfoQueue) -> u64, - GetStorageFilter: proc "stdcall" (this: ^IInfoQueue, pFilter: ^INFO_QUEUE_FILTER, pFilterByteLength: ^SIZE_T) -> HRESULT, - GetStorageFilterStackSize: proc "stdcall" (this: ^IInfoQueue) -> u64, - PopRetrievalFilter: proc "stdcall" (this: ^IInfoQueue), - PopStorageFilter: proc "stdcall" (this: ^IInfoQueue), - PushCopyOfRetrievalFilter: proc "stdcall" (this: ^IInfoQueue) -> HRESULT, - PushCopyOfStorageFilter: proc "stdcall" (this: ^IInfoQueue) -> HRESULT, - PushEmptyRetrievalFilter: proc "stdcall" (this: ^IInfoQueue) -> HRESULT, - PushEmptyStorageFilter: proc "stdcall" (this: ^IInfoQueue) -> HRESULT, - SetBreakOnCategory: proc "stdcall" (this: ^IInfoQueue, Category: MESSAGE_CATEGORY, bEnable: BOOL) -> HRESULT, - SetBreakOnID: proc "stdcall" (this: ^IInfoQueue, ID: MESSAGE_ID, bEnable: BOOL) -> HRESULT, - SetBreakOnSeverity: proc "stdcall" (this: ^IInfoQueue, Severity: MESSAGE_SEVERITY, bEnable: BOOL) -> HRESULT, - SetMessageCountLimit: proc "stdcall" (this: ^IInfoQueue, MessageCountLimit: u64) -> HRESULT, - SetMuteDebugOutput: proc "stdcall" (this: ^IInfoQueue, bMute: BOOL), + AddApplicationMessage: proc "system" (this: ^IInfoQueue, Severity: MESSAGE_SEVERITY, pDescription: cstring) -> HRESULT, + AddMessage: proc "system" (this: ^IInfoQueue, Category: MESSAGE_CATEGORY, Severity: MESSAGE_SEVERITY, ID: MESSAGE_ID, pDescription: cstring) -> HRESULT, + AddRetrievalFilterEntries: proc "system" (this: ^IInfoQueue, pFilter: ^INFO_QUEUE_FILTER) -> HRESULT, + AddStorageFilterEntries: proc "system" (this: ^IInfoQueue, pFilter: ^INFO_QUEUE_FILTER) -> HRESULT, + ClearRetrievalFilter: proc "system" (this: ^IInfoQueue), + ClearStorageFilter: proc "system" (this: ^IInfoQueue), + ClearStoredMessages: proc "system" (this: ^IInfoQueue), + GetBreakOnCategory: proc "system" (this: ^IInfoQueue, Category: MESSAGE_CATEGORY) -> BOOL, + GetBreakOnID: proc "system" (this: ^IInfoQueue, ID: MESSAGE_ID) -> BOOL, + GetBreakOnSeverity: proc "system" (this: ^IInfoQueue, Severity: MESSAGE_SEVERITY) -> BOOL, + GetMessage: proc "system" (this: ^IInfoQueue, MessageIndex: u64, pMessage: ^MESSAGE, pMessageByteLength: ^SIZE_T) -> HRESULT, + GetMessageCountLimit: proc "system" (this: ^IInfoQueue) -> u64, + GetMuteDebugOutput: proc "system" (this: ^IInfoQueue) -> BOOL, + GetNumMessagesAllowedByStorageFilter: proc "system" (this: ^IInfoQueue) -> u64, + GetNumMessagesDeniedByStorageFilter: proc "system" (this: ^IInfoQueue) -> u64, + GetNumMessagesDiscardedByMessageCountLimit: proc "system" (this: ^IInfoQueue) -> u64, + GetNumStoredMessages: proc "system" (this: ^IInfoQueue) -> u64, + GetNumStoredMessagesAllowedByRetrievalFilter: proc "system" (this: ^IInfoQueue) -> u64, + GetRetrievalFilter: proc "system" (this: ^IInfoQueue, pFilter: ^INFO_QUEUE_FILTER, pFilterByteLength: ^SIZE_T) -> HRESULT, + GetRetrievalFilterStackSize: proc "system" (this: ^IInfoQueue) -> u64, + GetStorageFilter: proc "system" (this: ^IInfoQueue, pFilter: ^INFO_QUEUE_FILTER, pFilterByteLength: ^SIZE_T) -> HRESULT, + GetStorageFilterStackSize: proc "system" (this: ^IInfoQueue) -> u64, + PopRetrievalFilter: proc "system" (this: ^IInfoQueue), + PopStorageFilter: proc "system" (this: ^IInfoQueue), + PushCopyOfRetrievalFilter: proc "system" (this: ^IInfoQueue) -> HRESULT, + PushCopyOfStorageFilter: proc "system" (this: ^IInfoQueue) -> HRESULT, + PushEmptyRetrievalFilter: proc "system" (this: ^IInfoQueue) -> HRESULT, + PushEmptyStorageFilter: proc "system" (this: ^IInfoQueue) -> HRESULT, + SetBreakOnCategory: proc "system" (this: ^IInfoQueue, Category: MESSAGE_CATEGORY, bEnable: BOOL) -> HRESULT, + SetBreakOnID: proc "system" (this: ^IInfoQueue, ID: MESSAGE_ID, bEnable: BOOL) -> HRESULT, + SetBreakOnSeverity: proc "system" (this: ^IInfoQueue, Severity: MESSAGE_SEVERITY, bEnable: BOOL) -> HRESULT, + SetMessageCountLimit: proc "system" (this: ^IInfoQueue, MessageCountLimit: u64) -> HRESULT, + SetMuteDebugOutput: proc "system" (this: ^IInfoQueue, bMute: BOOL), } MESSAGE_ID :: enum u32 { diff --git a/vendor/directx/d3d12/d3d12.odin b/vendor/directx/d3d12/d3d12.odin index 30b543e43..c39c2c9c9 100644 --- a/vendor/directx/d3d12/d3d12.odin +++ b/vendor/directx/d3d12/d3d12.odin @@ -26,7 +26,7 @@ IModuleInstance :: d3d_compiler.ID3D11ModuleInstance IBlob :: d3d_compiler.ID3DBlob IModule :: d3d_compiler.ID3D11Module -@(default_calling_convention="stdcall", link_prefix="D3D12") +@(default_calling_convention="system", link_prefix="D3D12") foreign d3d12 { CreateDevice :: proc(pAdapter: ^IUnknown, MinimumFeatureLevel: FEATURE_LEVEL, riid: ^IID, ppDevice: ^rawptr) -> HRESULT --- CreateRootSignatureDeserializer :: proc(pSrcData: rawptr, SrcDataSizeInBytes: SIZE_T, pRootSignatureDeserializerInterface: ^IID, ppRootSignatureDeserializer: ^rawptr) -> HRESULT --- @@ -197,8 +197,8 @@ ID3DDestructionNotifier :: struct #raw_union { } ID3DDestructionNotifier_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - RegisterDestructionCallback: proc "stdcall" (this: ^ID3DDestructionNotifier, callbackFn: PFN_DESTRUCTION_CALLBACK, pData: rawptr, pCallbackID: ^u32) -> HRESULT, - UnregisterDestructionCallback: proc "stdcall" (this: ^ID3DDestructionNotifier, callbackID: u32) -> HRESULT, + RegisterDestructionCallback: proc "system" (this: ^ID3DDestructionNotifier, callbackFn: PFN_DESTRUCTION_CALLBACK, pData: rawptr, pCallbackID: ^u32) -> HRESULT, + UnregisterDestructionCallback: proc "system" (this: ^ID3DDestructionNotifier, callbackID: u32) -> HRESULT, } SHADER_VARIABLE_CLASS :: enum i32 { @@ -676,10 +676,10 @@ IObject :: struct #raw_union { } IObject_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - GetPrivateData: proc "stdcall" (this: ^IObject, guid: ^GUID, pDataSize: ^u32, pData: rawptr) -> HRESULT, - SetPrivateData: proc "stdcall" (this: ^IObject, guid: ^GUID, DataSize: u32, pData: rawptr) -> HRESULT, - SetPrivateDataInterface: proc "stdcall" (this: ^IObject, guid: ^GUID, pData: ^IUnknown) -> HRESULT, - SetName: proc "stdcall" (this: ^IObject, Name: [^]u16) -> HRESULT, + GetPrivateData: proc "system" (this: ^IObject, guid: ^GUID, pDataSize: ^u32, pData: rawptr) -> HRESULT, + SetPrivateData: proc "system" (this: ^IObject, guid: ^GUID, DataSize: u32, pData: rawptr) -> HRESULT, + SetPrivateDataInterface: proc "system" (this: ^IObject, guid: ^GUID, pData: ^IUnknown) -> HRESULT, + SetName: proc "system" (this: ^IObject, Name: [^]u16) -> HRESULT, } @@ -691,7 +691,7 @@ IDeviceChild :: struct #raw_union { } IDeviceChild_VTable :: struct { using id3d12object_vtable: IObject_VTable, - GetDevice: proc "stdcall" (this: ^IDeviceChild, riid: ^IID, ppvDevice: ^rawptr) -> HRESULT, + GetDevice: proc "system" (this: ^IDeviceChild, riid: ^IID, ppvDevice: ^rawptr) -> HRESULT, } @@ -2096,7 +2096,7 @@ IRootSignatureDeserializer :: struct #raw_union { } IRootSignatureDeserializer_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - GetRootSignatureDesc: proc "stdcall" (this: ^IRootSignatureDeserializer) -> ^ROOT_SIGNATURE_DESC, + GetRootSignatureDesc: proc "system" (this: ^IRootSignatureDeserializer) -> ^ROOT_SIGNATURE_DESC, } @@ -2108,8 +2108,8 @@ IVersionedRootSignatureDeserializer :: struct #raw_union { } IVersionedRootSignatureDeserializer_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - GetRootSignatureDescAtVersion: proc "stdcall" (this: ^IVersionedRootSignatureDeserializer, convertToVersion: ROOT_SIGNATURE_VERSION, ppDesc: ^^VERSIONED_ROOT_SIGNATURE_DESC) -> HRESULT, - GetUnconvertedRootSignatureDesc: proc "stdcall" (this: ^IVersionedRootSignatureDeserializer) -> ^VERSIONED_ROOT_SIGNATURE_DESC, + GetRootSignatureDescAtVersion: proc "system" (this: ^IVersionedRootSignatureDeserializer, convertToVersion: ROOT_SIGNATURE_VERSION, ppDesc: ^^VERSIONED_ROOT_SIGNATURE_DESC) -> HRESULT, + GetUnconvertedRootSignatureDesc: proc "system" (this: ^IVersionedRootSignatureDeserializer) -> ^VERSIONED_ROOT_SIGNATURE_DESC, } PFN_SERIALIZE_ROOT_SIGNATURE :: #type proc "c" (a0: ^ROOT_SIGNATURE_DESC, a1: ROOT_SIGNATURE_VERSION, a2: ^^IBlob, a3: ^^IBlob) -> HRESULT @@ -2283,7 +2283,7 @@ IHeap :: struct #raw_union { } IHeap_VTable :: struct { using id3d12devicechild_vtable: IDeviceChild_VTable, - GetDesc: proc "stdcall" (this: ^IHeap) -> HEAP_DESC, + GetDesc: proc "system" (this: ^IHeap) -> HEAP_DESC, } @@ -2295,13 +2295,13 @@ IResource :: struct #raw_union { } IResource_VTable :: struct { using id3d12devicechild_vtable: IDeviceChild_VTable, - Map: proc "stdcall" (this: ^IResource, Subresource: u32, pReadRange: ^RANGE, ppData: ^rawptr) -> HRESULT, - Unmap: proc "stdcall" (this: ^IResource, Subresource: u32, pWrittenRange: ^RANGE), - GetDesc: proc "stdcall" (this: ^IResource) -> RESOURCE_DESC, - GetGPUVirtualAddress: proc "stdcall" (this: ^IResource) -> GPU_VIRTUAL_ADDRESS, - WriteToSubresource: proc "stdcall" (this: ^IResource, DstSubresource: u32, pDstBox: ^BOX, pSrcData: rawptr, SrcRowPitch: u32, SrcDepthPitch: u32) -> HRESULT, - ReadFromSubresource: proc "stdcall" (this: ^IResource, pDstData: rawptr, DstRowPitch: u32, DstDepthPitch: u32, SrcSubresource: u32, pSrcBox: ^BOX) -> HRESULT, - GetHeapProperties: proc "stdcall" (this: ^IResource, pHeapProperties: ^HEAP_PROPERTIES, pHeapFlags: ^HEAP_FLAGS) -> HRESULT, + Map: proc "system" (this: ^IResource, Subresource: u32, pReadRange: ^RANGE, ppData: ^rawptr) -> HRESULT, + Unmap: proc "system" (this: ^IResource, Subresource: u32, pWrittenRange: ^RANGE), + GetDesc: proc "system" (this: ^IResource) -> RESOURCE_DESC, + GetGPUVirtualAddress: proc "system" (this: ^IResource) -> GPU_VIRTUAL_ADDRESS, + WriteToSubresource: proc "system" (this: ^IResource, DstSubresource: u32, pDstBox: ^BOX, pSrcData: rawptr, SrcRowPitch: u32, SrcDepthPitch: u32) -> HRESULT, + ReadFromSubresource: proc "system" (this: ^IResource, pDstData: rawptr, DstRowPitch: u32, DstDepthPitch: u32, SrcSubresource: u32, pSrcBox: ^BOX) -> HRESULT, + GetHeapProperties: proc "system" (this: ^IResource, pHeapProperties: ^HEAP_PROPERTIES, pHeapFlags: ^HEAP_FLAGS) -> HRESULT, } @@ -2313,7 +2313,7 @@ ICommandAllocator :: struct #raw_union { } ICommandAllocator_VTable :: struct { using id3d12devicechild_vtable: IDeviceChild_VTable, - Reset: proc "stdcall" (this: ^ICommandAllocator) -> HRESULT, + Reset: proc "system" (this: ^ICommandAllocator) -> HRESULT, } @@ -2325,9 +2325,9 @@ IFence :: struct #raw_union { } IFence_VTable :: struct { using id3d12devicechild_vtable: IDeviceChild_VTable, - GetCompletedValue: proc "stdcall" (this: ^IFence) -> u64, - SetEventOnCompletion: proc "stdcall" (this: ^IFence, Value: u64, hEvent: HANDLE) -> HRESULT, - Signal: proc "stdcall" (this: ^IFence, Value: u64) -> HRESULT, + GetCompletedValue: proc "system" (this: ^IFence) -> u64, + SetEventOnCompletion: proc "system" (this: ^IFence, Value: u64, hEvent: HANDLE) -> HRESULT, + Signal: proc "system" (this: ^IFence, Value: u64) -> HRESULT, } @@ -2339,7 +2339,7 @@ IFence1 :: struct #raw_union { } IFence1_VTable :: struct { #subtype id3d12fence_vtable: IFence_VTable, - GetCreationFlags: proc "stdcall" (this: ^IFence1) -> FENCE_FLAGS, + GetCreationFlags: proc "system" (this: ^IFence1) -> FENCE_FLAGS, } @@ -2351,7 +2351,7 @@ IPipelineState :: struct #raw_union { } IPipelineState_VTable :: struct { using id3d12devicechild_vtable: IDeviceChild_VTable, - GetCachedBlob: proc "stdcall" (this: ^IPipelineState, ppBlob: ^^IBlob) -> HRESULT, + GetCachedBlob: proc "system" (this: ^IPipelineState, ppBlob: ^^IBlob) -> HRESULT, } @@ -2363,9 +2363,9 @@ IDescriptorHeap :: struct #raw_union { } IDescriptorHeap_VTable :: struct { using id3d12devicechild_vtable: IDeviceChild_VTable, - GetDesc: proc "stdcall" (this: ^IDescriptorHeap, desc: ^DESCRIPTOR_HEAP_DESC), - GetCPUDescriptorHandleForHeapStart: proc "stdcall" (this: ^IDescriptorHeap, handle: ^CPU_DESCRIPTOR_HANDLE), - GetGPUDescriptorHandleForHeapStart: proc "stdcall" (this: ^IDescriptorHeap, handle: ^GPU_DESCRIPTOR_HANDLE), + GetDesc: proc "system" (this: ^IDescriptorHeap, desc: ^DESCRIPTOR_HEAP_DESC), + GetCPUDescriptorHandleForHeapStart: proc "system" (this: ^IDescriptorHeap, handle: ^CPU_DESCRIPTOR_HANDLE), + GetGPUDescriptorHandleForHeapStart: proc "system" (this: ^IDescriptorHeap, handle: ^GPU_DESCRIPTOR_HANDLE), } IQueryHeap_UUID_STRING :: "0d9658ae-ed45-469e-a61d-970ec583cab4" @@ -2390,7 +2390,7 @@ ICommandList :: struct #raw_union { } ICommandList_VTable :: struct { using id3d12devicechild_vtable: IDeviceChild_VTable, - GetType: proc "stdcall" (this: ^ICommandList) -> COMMAND_LIST_TYPE, + GetType: proc "system" (this: ^ICommandList) -> COMMAND_LIST_TYPE, } @@ -2402,57 +2402,57 @@ IGraphicsCommandList :: struct #raw_union { } IGraphicsCommandList_VTable :: struct { using id3d12commandlist_vtable: ICommandList_VTable, - Close: proc "stdcall" (this: ^IGraphicsCommandList) -> HRESULT, - Reset: proc "stdcall" (this: ^IGraphicsCommandList, pAllocator: ^ICommandAllocator, pInitialState: ^IPipelineState) -> HRESULT, - ClearState: proc "stdcall" (this: ^IGraphicsCommandList, pPipelineState: ^IPipelineState), - DrawInstanced: proc "stdcall" (this: ^IGraphicsCommandList, VertexCountPerInstance: u32, InstanceCount: u32, StartVertexLocation: u32, StartInstanceLocation: u32), - DrawIndexedInstanced: proc "stdcall" (this: ^IGraphicsCommandList, IndexCountPerInstance: u32, InstanceCount: u32, StartIndexLocation: u32, BaseVertexLocation: i32, StartInstanceLocation: u32), - Dispatch: proc "stdcall" (this: ^IGraphicsCommandList, ThreadGroupCountX: u32, ThreadGroupCountY: u32, ThreadGroupCountZ: u32), - CopyBufferRegion: proc "stdcall" (this: ^IGraphicsCommandList, pDstBuffer: ^IResource, DstOffset: u64, pSrcBuffer: ^IResource, SrcOffset: u64, NumBytes: u64), - CopyTextureRegion: proc "stdcall" (this: ^IGraphicsCommandList, pDst: ^TEXTURE_COPY_LOCATION, DstX: u32, DstY: u32, DstZ: u32, pSrc: ^TEXTURE_COPY_LOCATION, pSrcBox: ^BOX), - CopyResource: proc "stdcall" (this: ^IGraphicsCommandList, pDstResource: ^IResource, pSrcResource: ^IResource), - CopyTiles: proc "stdcall" (this: ^IGraphicsCommandList, pTiledResource: ^IResource, pTileRegionStartCoordinate: ^TILED_RESOURCE_COORDINATE, pTileRegionSize: ^TILE_REGION_SIZE, pBuffer: ^IResource, BufferStartOffsetInBytes: u64, Flags: TILE_COPY_FLAGS), - ResolveSubresource: proc "stdcall" (this: ^IGraphicsCommandList, pDstResource: ^IResource, DstSubresource: u32, pSrcResource: ^IResource, SrcSubresource: u32, Format: dxgi.FORMAT), - IASetPrimitiveTopology: proc "stdcall" (this: ^IGraphicsCommandList, PrimitiveTopology: PRIMITIVE_TOPOLOGY), - RSSetViewports: proc "stdcall" (this: ^IGraphicsCommandList, NumViewports: u32, pViewports: ^VIEWPORT), - RSSetScissorRects: proc "stdcall" (this: ^IGraphicsCommandList, NumRects: u32, pRects: ^RECT), - OMSetBlendFactor: proc "stdcall" (this: ^IGraphicsCommandList, BlendFactor: ^[4]f32), - OMSetStencilRef: proc "stdcall" (this: ^IGraphicsCommandList, StencilRef: u32), - SetPipelineState: proc "stdcall" (this: ^IGraphicsCommandList, pPipelineState: ^IPipelineState), - ResourceBarrier: proc "stdcall" (this: ^IGraphicsCommandList, NumBarriers: u32, pBarriers: ^RESOURCE_BARRIER), - ExecuteBundle: proc "stdcall" (this: ^IGraphicsCommandList, pCommandList: ^IGraphicsCommandList), - SetDescriptorHeaps: proc "stdcall" (this: ^IGraphicsCommandList, NumDescriptorHeaps: u32, ppDescriptorHeaps: ^^IDescriptorHeap), - SetComputeRootSignature: proc "stdcall" (this: ^IGraphicsCommandList, pRootSignature: ^IRootSignature), - SetGraphicsRootSignature: proc "stdcall" (this: ^IGraphicsCommandList, pRootSignature: ^IRootSignature), - SetComputeRootDescriptorTable: proc "stdcall" (this: ^IGraphicsCommandList, RootParameterIndex: u32, BaseDescriptor: GPU_DESCRIPTOR_HANDLE), - SetGraphicsRootDescriptorTable: proc "stdcall" (this: ^IGraphicsCommandList, RootParameterIndex: u32, BaseDescriptor: GPU_DESCRIPTOR_HANDLE), - SetComputeRoot32BitConstant: proc "stdcall" (this: ^IGraphicsCommandList, RootParameterIndex: u32, SrcData: u32, DestOffsetIn32BitValues: u32), - SetGraphicsRoot32BitConstant: proc "stdcall" (this: ^IGraphicsCommandList, RootParameterIndex: u32, SrcData: u32, DestOffsetIn32BitValues: u32), - SetComputeRoot32BitConstants: proc "stdcall" (this: ^IGraphicsCommandList, RootParameterIndex: u32, Num32BitValuesToSet: u32, pSrcData: rawptr, DestOffsetIn32BitValues: u32), - SetGraphicsRoot32BitConstants: proc "stdcall" (this: ^IGraphicsCommandList, RootParameterIndex: u32, Num32BitValuesToSet: u32, pSrcData: rawptr, DestOffsetIn32BitValues: u32), - SetComputeRootConstantBufferView: proc "stdcall" (this: ^IGraphicsCommandList, RootParameterIndex: u32, BufferLocation: GPU_VIRTUAL_ADDRESS), - SetGraphicsRootConstantBufferView: proc "stdcall" (this: ^IGraphicsCommandList, RootParameterIndex: u32, BufferLocation: GPU_VIRTUAL_ADDRESS), - SetComputeRootShaderResourceView: proc "stdcall" (this: ^IGraphicsCommandList, RootParameterIndex: u32, BufferLocation: GPU_VIRTUAL_ADDRESS), - SetGraphicsRootShaderResourceView: proc "stdcall" (this: ^IGraphicsCommandList, RootParameterIndex: u32, BufferLocation: GPU_VIRTUAL_ADDRESS), - SetComputeRootUnorderedAccessView: proc "stdcall" (this: ^IGraphicsCommandList, RootParameterIndex: u32, BufferLocation: GPU_VIRTUAL_ADDRESS), - SetGraphicsRootUnorderedAccessView: proc "stdcall" (this: ^IGraphicsCommandList, RootParameterIndex: u32, BufferLocation: GPU_VIRTUAL_ADDRESS), - IASetIndexBuffer: proc "stdcall" (this: ^IGraphicsCommandList, pView: ^INDEX_BUFFER_VIEW), - IASetVertexBuffers: proc "stdcall" (this: ^IGraphicsCommandList, StartSlot: u32, NumViews: u32, pViews: ^VERTEX_BUFFER_VIEW), - SOSetTargets: proc "stdcall" (this: ^IGraphicsCommandList, StartSlot: u32, NumViews: u32, pViews: ^STREAM_OUTPUT_BUFFER_VIEW), - OMSetRenderTargets: proc "stdcall" (this: ^IGraphicsCommandList, NumRenderTargetDescriptors: u32, pRenderTargetDescriptors: ^CPU_DESCRIPTOR_HANDLE, RTsSingleHandleToDescriptorRange: BOOL, pDepthStencilDescriptor: ^CPU_DESCRIPTOR_HANDLE), - ClearDepthStencilView: proc "stdcall" (this: ^IGraphicsCommandList, DepthStencilView: CPU_DESCRIPTOR_HANDLE, ClearFlags: CLEAR_FLAGS, Depth: f32, Stencil: u8, NumRects: u32, pRects: ^RECT), - ClearRenderTargetView: proc "stdcall" (this: ^IGraphicsCommandList, RenderTargetView: CPU_DESCRIPTOR_HANDLE, ColorRGBA: ^[4]f32, NumRects: u32, pRects: ^RECT), - ClearUnorderedAccessViewUint: proc "stdcall" (this: ^IGraphicsCommandList, ViewGPUHandleInCurrentHeap: GPU_DESCRIPTOR_HANDLE, ViewCPUHandle: CPU_DESCRIPTOR_HANDLE, pResource: ^IResource, Values: ^[4]u32, NumRects: u32, pRects: ^RECT), - ClearUnorderedAccessViewFloat: proc "stdcall" (this: ^IGraphicsCommandList, ViewGPUHandleInCurrentHeap: GPU_DESCRIPTOR_HANDLE, ViewCPUHandle: CPU_DESCRIPTOR_HANDLE, pResource: ^IResource, Values: ^[4]f32, NumRects: u32, pRects: ^RECT), - DiscardResource: proc "stdcall" (this: ^IGraphicsCommandList, pResource: ^IResource, pRegion: ^DISCARD_REGION), - BeginQuery: proc "stdcall" (this: ^IGraphicsCommandList, pQueryHeap: ^IQueryHeap, Type: QUERY_TYPE, Index: u32), - EndQuery: proc "stdcall" (this: ^IGraphicsCommandList, pQueryHeap: ^IQueryHeap, Type: QUERY_TYPE, Index: u32), - ResolveQueryData: proc "stdcall" (this: ^IGraphicsCommandList, pQueryHeap: ^IQueryHeap, Type: QUERY_TYPE, StartIndex: u32, NumQueries: u32, pDestinationBuffer: ^IResource, AlignedDestinationBufferOffset: u64), - SetPredication: proc "stdcall" (this: ^IGraphicsCommandList, pBuffer: ^IResource, AlignedBufferOffset: u64, Operation: PREDICATION_OP), - SetMarker: proc "stdcall" (this: ^IGraphicsCommandList, Metadata: u32, pData: rawptr, Size: u32), - BeginEvent: proc "stdcall" (this: ^IGraphicsCommandList, Metadata: u32, pData: rawptr, Size: u32), - EndEvent: proc "stdcall" (this: ^IGraphicsCommandList), - ExecuteIndirect: proc "stdcall" (this: ^IGraphicsCommandList, pCommandSignature: ^ICommandSignature, MaxCommandCount: u32, pArgumentBuffer: ^IResource, ArgumentBufferOffset: u64, pCountBuffer: ^IResource, CountBufferOffset: u64), + Close: proc "system" (this: ^IGraphicsCommandList) -> HRESULT, + Reset: proc "system" (this: ^IGraphicsCommandList, pAllocator: ^ICommandAllocator, pInitialState: ^IPipelineState) -> HRESULT, + ClearState: proc "system" (this: ^IGraphicsCommandList, pPipelineState: ^IPipelineState), + DrawInstanced: proc "system" (this: ^IGraphicsCommandList, VertexCountPerInstance: u32, InstanceCount: u32, StartVertexLocation: u32, StartInstanceLocation: u32), + DrawIndexedInstanced: proc "system" (this: ^IGraphicsCommandList, IndexCountPerInstance: u32, InstanceCount: u32, StartIndexLocation: u32, BaseVertexLocation: i32, StartInstanceLocation: u32), + Dispatch: proc "system" (this: ^IGraphicsCommandList, ThreadGroupCountX: u32, ThreadGroupCountY: u32, ThreadGroupCountZ: u32), + CopyBufferRegion: proc "system" (this: ^IGraphicsCommandList, pDstBuffer: ^IResource, DstOffset: u64, pSrcBuffer: ^IResource, SrcOffset: u64, NumBytes: u64), + CopyTextureRegion: proc "system" (this: ^IGraphicsCommandList, pDst: ^TEXTURE_COPY_LOCATION, DstX: u32, DstY: u32, DstZ: u32, pSrc: ^TEXTURE_COPY_LOCATION, pSrcBox: ^BOX), + CopyResource: proc "system" (this: ^IGraphicsCommandList, pDstResource: ^IResource, pSrcResource: ^IResource), + CopyTiles: proc "system" (this: ^IGraphicsCommandList, pTiledResource: ^IResource, pTileRegionStartCoordinate: ^TILED_RESOURCE_COORDINATE, pTileRegionSize: ^TILE_REGION_SIZE, pBuffer: ^IResource, BufferStartOffsetInBytes: u64, Flags: TILE_COPY_FLAGS), + ResolveSubresource: proc "system" (this: ^IGraphicsCommandList, pDstResource: ^IResource, DstSubresource: u32, pSrcResource: ^IResource, SrcSubresource: u32, Format: dxgi.FORMAT), + IASetPrimitiveTopology: proc "system" (this: ^IGraphicsCommandList, PrimitiveTopology: PRIMITIVE_TOPOLOGY), + RSSetViewports: proc "system" (this: ^IGraphicsCommandList, NumViewports: u32, pViewports: ^VIEWPORT), + RSSetScissorRects: proc "system" (this: ^IGraphicsCommandList, NumRects: u32, pRects: ^RECT), + OMSetBlendFactor: proc "system" (this: ^IGraphicsCommandList, BlendFactor: ^[4]f32), + OMSetStencilRef: proc "system" (this: ^IGraphicsCommandList, StencilRef: u32), + SetPipelineState: proc "system" (this: ^IGraphicsCommandList, pPipelineState: ^IPipelineState), + ResourceBarrier: proc "system" (this: ^IGraphicsCommandList, NumBarriers: u32, pBarriers: ^RESOURCE_BARRIER), + ExecuteBundle: proc "system" (this: ^IGraphicsCommandList, pCommandList: ^IGraphicsCommandList), + SetDescriptorHeaps: proc "system" (this: ^IGraphicsCommandList, NumDescriptorHeaps: u32, ppDescriptorHeaps: ^^IDescriptorHeap), + SetComputeRootSignature: proc "system" (this: ^IGraphicsCommandList, pRootSignature: ^IRootSignature), + SetGraphicsRootSignature: proc "system" (this: ^IGraphicsCommandList, pRootSignature: ^IRootSignature), + SetComputeRootDescriptorTable: proc "system" (this: ^IGraphicsCommandList, RootParameterIndex: u32, BaseDescriptor: GPU_DESCRIPTOR_HANDLE), + SetGraphicsRootDescriptorTable: proc "system" (this: ^IGraphicsCommandList, RootParameterIndex: u32, BaseDescriptor: GPU_DESCRIPTOR_HANDLE), + SetComputeRoot32BitConstant: proc "system" (this: ^IGraphicsCommandList, RootParameterIndex: u32, SrcData: u32, DestOffsetIn32BitValues: u32), + SetGraphicsRoot32BitConstant: proc "system" (this: ^IGraphicsCommandList, RootParameterIndex: u32, SrcData: u32, DestOffsetIn32BitValues: u32), + SetComputeRoot32BitConstants: proc "system" (this: ^IGraphicsCommandList, RootParameterIndex: u32, Num32BitValuesToSet: u32, pSrcData: rawptr, DestOffsetIn32BitValues: u32), + SetGraphicsRoot32BitConstants: proc "system" (this: ^IGraphicsCommandList, RootParameterIndex: u32, Num32BitValuesToSet: u32, pSrcData: rawptr, DestOffsetIn32BitValues: u32), + SetComputeRootConstantBufferView: proc "system" (this: ^IGraphicsCommandList, RootParameterIndex: u32, BufferLocation: GPU_VIRTUAL_ADDRESS), + SetGraphicsRootConstantBufferView: proc "system" (this: ^IGraphicsCommandList, RootParameterIndex: u32, BufferLocation: GPU_VIRTUAL_ADDRESS), + SetComputeRootShaderResourceView: proc "system" (this: ^IGraphicsCommandList, RootParameterIndex: u32, BufferLocation: GPU_VIRTUAL_ADDRESS), + SetGraphicsRootShaderResourceView: proc "system" (this: ^IGraphicsCommandList, RootParameterIndex: u32, BufferLocation: GPU_VIRTUAL_ADDRESS), + SetComputeRootUnorderedAccessView: proc "system" (this: ^IGraphicsCommandList, RootParameterIndex: u32, BufferLocation: GPU_VIRTUAL_ADDRESS), + SetGraphicsRootUnorderedAccessView: proc "system" (this: ^IGraphicsCommandList, RootParameterIndex: u32, BufferLocation: GPU_VIRTUAL_ADDRESS), + IASetIndexBuffer: proc "system" (this: ^IGraphicsCommandList, pView: ^INDEX_BUFFER_VIEW), + IASetVertexBuffers: proc "system" (this: ^IGraphicsCommandList, StartSlot: u32, NumViews: u32, pViews: ^VERTEX_BUFFER_VIEW), + SOSetTargets: proc "system" (this: ^IGraphicsCommandList, StartSlot: u32, NumViews: u32, pViews: ^STREAM_OUTPUT_BUFFER_VIEW), + OMSetRenderTargets: proc "system" (this: ^IGraphicsCommandList, NumRenderTargetDescriptors: u32, pRenderTargetDescriptors: ^CPU_DESCRIPTOR_HANDLE, RTsSingleHandleToDescriptorRange: BOOL, pDepthStencilDescriptor: ^CPU_DESCRIPTOR_HANDLE), + ClearDepthStencilView: proc "system" (this: ^IGraphicsCommandList, DepthStencilView: CPU_DESCRIPTOR_HANDLE, ClearFlags: CLEAR_FLAGS, Depth: f32, Stencil: u8, NumRects: u32, pRects: ^RECT), + ClearRenderTargetView: proc "system" (this: ^IGraphicsCommandList, RenderTargetView: CPU_DESCRIPTOR_HANDLE, ColorRGBA: ^[4]f32, NumRects: u32, pRects: ^RECT), + ClearUnorderedAccessViewUint: proc "system" (this: ^IGraphicsCommandList, ViewGPUHandleInCurrentHeap: GPU_DESCRIPTOR_HANDLE, ViewCPUHandle: CPU_DESCRIPTOR_HANDLE, pResource: ^IResource, Values: ^[4]u32, NumRects: u32, pRects: ^RECT), + ClearUnorderedAccessViewFloat: proc "system" (this: ^IGraphicsCommandList, ViewGPUHandleInCurrentHeap: GPU_DESCRIPTOR_HANDLE, ViewCPUHandle: CPU_DESCRIPTOR_HANDLE, pResource: ^IResource, Values: ^[4]f32, NumRects: u32, pRects: ^RECT), + DiscardResource: proc "system" (this: ^IGraphicsCommandList, pResource: ^IResource, pRegion: ^DISCARD_REGION), + BeginQuery: proc "system" (this: ^IGraphicsCommandList, pQueryHeap: ^IQueryHeap, Type: QUERY_TYPE, Index: u32), + EndQuery: proc "system" (this: ^IGraphicsCommandList, pQueryHeap: ^IQueryHeap, Type: QUERY_TYPE, Index: u32), + ResolveQueryData: proc "system" (this: ^IGraphicsCommandList, pQueryHeap: ^IQueryHeap, Type: QUERY_TYPE, StartIndex: u32, NumQueries: u32, pDestinationBuffer: ^IResource, AlignedDestinationBufferOffset: u64), + SetPredication: proc "system" (this: ^IGraphicsCommandList, pBuffer: ^IResource, AlignedBufferOffset: u64, Operation: PREDICATION_OP), + SetMarker: proc "system" (this: ^IGraphicsCommandList, Metadata: u32, pData: rawptr, Size: u32), + BeginEvent: proc "system" (this: ^IGraphicsCommandList, Metadata: u32, pData: rawptr, Size: u32), + EndEvent: proc "system" (this: ^IGraphicsCommandList), + ExecuteIndirect: proc "system" (this: ^IGraphicsCommandList, pCommandSignature: ^ICommandSignature, MaxCommandCount: u32, pArgumentBuffer: ^IResource, ArgumentBufferOffset: u64, pCountBuffer: ^IResource, CountBufferOffset: u64), } @@ -2464,12 +2464,12 @@ IGraphicsCommandList1 :: struct #raw_union { } IGraphicsCommandList1_VTable :: struct { using id3d12graphicscommandlist_vtable: IGraphicsCommandList_VTable, - AtomicCopyBufferUINT: proc "stdcall" (this: ^IGraphicsCommandList1, pDstBuffer: ^IResource, DstOffset: u64, pSrcBuffer: ^IResource, SrcOffset: u64, Dependencies: u32, ppDependentResources: ^^IResource, pDependentSubresourceRanges: ^SUBRESOURCE_RANGE_UINT64), - AtomicCopyBufferUINT64: proc "stdcall" (this: ^IGraphicsCommandList1, pDstBuffer: ^IResource, DstOffset: u64, pSrcBuffer: ^IResource, SrcOffset: u64, Dependencies: u32, ppDependentResources: ^^IResource, pDependentSubresourceRanges: ^SUBRESOURCE_RANGE_UINT64), - OMSetDepthBounds: proc "stdcall" (this: ^IGraphicsCommandList1, Min: f32, Max: f32), - SetSamplePositions: proc "stdcall" (this: ^IGraphicsCommandList1, NumSamplesPerPixel: u32, NumPixels: u32, pSamplePositions: ^SAMPLE_POSITION), - ResolveSubresourceRegion: proc "stdcall" (this: ^IGraphicsCommandList1, pDstResource: ^IResource, DstSubresource: u32, DstX: u32, DstY: u32, pSrcResource: ^IResource, SrcSubresource: u32, pSrcRect: ^RECT, Format: dxgi.FORMAT, ResolveMode: RESOLVE_MODE), - SetViewInstanceMask: proc "stdcall" (this: ^IGraphicsCommandList1, Mask: u32), + AtomicCopyBufferUINT: proc "system" (this: ^IGraphicsCommandList1, pDstBuffer: ^IResource, DstOffset: u64, pSrcBuffer: ^IResource, SrcOffset: u64, Dependencies: u32, ppDependentResources: ^^IResource, pDependentSubresourceRanges: ^SUBRESOURCE_RANGE_UINT64), + AtomicCopyBufferUINT64: proc "system" (this: ^IGraphicsCommandList1, pDstBuffer: ^IResource, DstOffset: u64, pSrcBuffer: ^IResource, SrcOffset: u64, Dependencies: u32, ppDependentResources: ^^IResource, pDependentSubresourceRanges: ^SUBRESOURCE_RANGE_UINT64), + OMSetDepthBounds: proc "system" (this: ^IGraphicsCommandList1, Min: f32, Max: f32), + SetSamplePositions: proc "system" (this: ^IGraphicsCommandList1, NumSamplesPerPixel: u32, NumPixels: u32, pSamplePositions: ^SAMPLE_POSITION), + ResolveSubresourceRegion: proc "system" (this: ^IGraphicsCommandList1, pDstResource: ^IResource, DstSubresource: u32, DstX: u32, DstY: u32, pSrcResource: ^IResource, SrcSubresource: u32, pSrcRect: ^RECT, Format: dxgi.FORMAT, ResolveMode: RESOLVE_MODE), + SetViewInstanceMask: proc "system" (this: ^IGraphicsCommandList1, Mask: u32), } WRITEBUFFERIMMEDIATE_PARAMETER :: struct { @@ -2492,7 +2492,7 @@ IGraphicsCommandList2 :: struct #raw_union { } IGraphicsCommandList2_VTable :: struct { using id3d12graphicscommandlist1_vtable: IGraphicsCommandList1_VTable, - WriteBufferImmediate: proc "stdcall" (this: ^IGraphicsCommandList2, Count: u32, pParams: ^WRITEBUFFERIMMEDIATE_PARAMETER, pModes: ^WRITEBUFFERIMMEDIATE_MODE), + WriteBufferImmediate: proc "system" (this: ^IGraphicsCommandList2, Count: u32, pParams: ^WRITEBUFFERIMMEDIATE_PARAMETER, pModes: ^WRITEBUFFERIMMEDIATE_MODE), } @@ -2504,17 +2504,17 @@ ICommandQueue :: struct #raw_union { } ICommandQueue_VTable :: struct { using id3d12devicechild_vtable: IDeviceChild_VTable, - UpdateTileMappings: proc "stdcall" (this: ^ICommandQueue, pResource: ^IResource, NumResourceRegions: u32, pResourceRegionStartCoordinates: ^TILED_RESOURCE_COORDINATE, pResourceRegionSizes: ^TILE_REGION_SIZE, pHeap: ^IHeap, NumRanges: u32, pRangeFlags: ^TILE_RANGE_FLAGS, pHeapRangeStartOffsets: ^u32, pRangeTileCounts: ^u32, Flags: TILE_MAPPING_FLAGS), - CopyTileMappings: proc "stdcall" (this: ^ICommandQueue, pDstResource: ^IResource, pDstRegionStartCoordinate: ^TILED_RESOURCE_COORDINATE, pSrcResource: ^IResource, pSrcRegionStartCoordinate: ^TILED_RESOURCE_COORDINATE, pRegionSize: ^TILE_REGION_SIZE, Flags: TILE_MAPPING_FLAGS), - ExecuteCommandLists: proc "stdcall" (this: ^ICommandQueue, NumCommandLists: u32, ppCommandLists: ^^ICommandList), - SetMarker: proc "stdcall" (this: ^ICommandQueue, Metadata: u32, pData: rawptr, Size: u32), - BeginEvent: proc "stdcall" (this: ^ICommandQueue, Metadata: u32, pData: rawptr, Size: u32), - EndEvent: proc "stdcall" (this: ^ICommandQueue), - Signal: proc "stdcall" (this: ^ICommandQueue, pFence: ^IFence, Value: u64) -> HRESULT, - Wait: proc "stdcall" (this: ^ICommandQueue, pFence: ^IFence, Value: u64) -> HRESULT, - GetTimestampFrequency: proc "stdcall" (this: ^ICommandQueue, pFrequency: ^u64) -> HRESULT, - GetClockCalibration: proc "stdcall" (this: ^ICommandQueue, pGpuTimestamp: ^u64, pCpuTimestamp: ^u64) -> HRESULT, - GetDesc: proc "stdcall" (this: ^ICommandQueue) -> COMMAND_QUEUE_DESC, + UpdateTileMappings: proc "system" (this: ^ICommandQueue, pResource: ^IResource, NumResourceRegions: u32, pResourceRegionStartCoordinates: ^TILED_RESOURCE_COORDINATE, pResourceRegionSizes: ^TILE_REGION_SIZE, pHeap: ^IHeap, NumRanges: u32, pRangeFlags: ^TILE_RANGE_FLAGS, pHeapRangeStartOffsets: ^u32, pRangeTileCounts: ^u32, Flags: TILE_MAPPING_FLAGS), + CopyTileMappings: proc "system" (this: ^ICommandQueue, pDstResource: ^IResource, pDstRegionStartCoordinate: ^TILED_RESOURCE_COORDINATE, pSrcResource: ^IResource, pSrcRegionStartCoordinate: ^TILED_RESOURCE_COORDINATE, pRegionSize: ^TILE_REGION_SIZE, Flags: TILE_MAPPING_FLAGS), + ExecuteCommandLists: proc "system" (this: ^ICommandQueue, NumCommandLists: u32, ppCommandLists: ^^ICommandList), + SetMarker: proc "system" (this: ^ICommandQueue, Metadata: u32, pData: rawptr, Size: u32), + BeginEvent: proc "system" (this: ^ICommandQueue, Metadata: u32, pData: rawptr, Size: u32), + EndEvent: proc "system" (this: ^ICommandQueue), + Signal: proc "system" (this: ^ICommandQueue, pFence: ^IFence, Value: u64) -> HRESULT, + Wait: proc "system" (this: ^ICommandQueue, pFence: ^IFence, Value: u64) -> HRESULT, + GetTimestampFrequency: proc "system" (this: ^ICommandQueue, pFrequency: ^u64) -> HRESULT, + GetClockCalibration: proc "system" (this: ^ICommandQueue, pGpuTimestamp: ^u64, pCpuTimestamp: ^u64) -> HRESULT, + GetDesc: proc "system" (this: ^ICommandQueue) -> COMMAND_QUEUE_DESC, } @@ -2526,43 +2526,43 @@ IDevice :: struct #raw_union { } IDevice_VTable :: struct { using id3d12object_vtable: IObject_VTable, - GetNodeCount: proc "stdcall" (this: ^IDevice) -> u32, - CreateCommandQueue: proc "stdcall" (this: ^IDevice, pDesc: ^COMMAND_QUEUE_DESC, riid: ^IID, ppCommandQueue: ^rawptr) -> HRESULT, - CreateCommandAllocator: proc "stdcall" (this: ^IDevice, type: COMMAND_LIST_TYPE, riid: ^IID, ppCommandAllocator: ^rawptr) -> HRESULT, - CreateGraphicsPipelineState: proc "stdcall" (this: ^IDevice, pDesc: ^GRAPHICS_PIPELINE_STATE_DESC, riid: ^IID, ppPipelineState: ^rawptr) -> HRESULT, - CreateComputePipelineState: proc "stdcall" (this: ^IDevice, pDesc: ^COMPUTE_PIPELINE_STATE_DESC, riid: ^IID, ppPipelineState: ^rawptr) -> HRESULT, - CreateCommandList: proc "stdcall" (this: ^IDevice, nodeMask: u32, type: COMMAND_LIST_TYPE, pCommandAllocator: ^ICommandAllocator, pInitialState: ^IPipelineState, riid: ^IID, ppCommandList: ^rawptr) -> HRESULT, - CheckFeatureSupport: proc "stdcall" (this: ^IDevice, Feature: FEATURE, pFeatureSupportData: rawptr, FeatureSupportDataSize: u32) -> HRESULT, - CreateDescriptorHeap: proc "stdcall" (this: ^IDevice, pDescriptorHeapDesc: ^DESCRIPTOR_HEAP_DESC, riid: ^IID, ppvHeap: ^rawptr) -> HRESULT, - GetDescriptorHandleIncrementSize: proc "stdcall" (this: ^IDevice, DescriptorHeapType: DESCRIPTOR_HEAP_TYPE) -> u32, - CreateRootSignature: proc "stdcall" (this: ^IDevice, nodeMask: u32, pBlobWithRootSignature: rawptr, blobLengthInBytes: SIZE_T, riid: ^IID, ppvRootSignature: ^rawptr) -> HRESULT, - CreateConstantBufferView: proc "stdcall" (this: ^IDevice, pDesc: ^CONSTANT_BUFFER_VIEW_DESC, DestDescriptor: CPU_DESCRIPTOR_HANDLE), - CreateShaderResourceView: proc "stdcall" (this: ^IDevice, pResource: ^IResource, pDesc: ^SHADER_RESOURCE_VIEW_DESC, DestDescriptor: CPU_DESCRIPTOR_HANDLE), - CreateUnorderedAccessView: proc "stdcall" (this: ^IDevice, pResource: ^IResource, pCounterResource: ^IResource, pDesc: ^UNORDERED_ACCESS_VIEW_DESC, DestDescriptor: CPU_DESCRIPTOR_HANDLE), - CreateRenderTargetView: proc "stdcall" (this: ^IDevice, pResource: ^IResource, pDesc: ^RENDER_TARGET_VIEW_DESC, DestDescriptor: CPU_DESCRIPTOR_HANDLE), - CreateDepthStencilView: proc "stdcall" (this: ^IDevice, pResource: ^IResource, pDesc: ^DEPTH_STENCIL_VIEW_DESC, DestDescriptor: CPU_DESCRIPTOR_HANDLE), - CreateSampler: proc "stdcall" (this: ^IDevice, pDesc: ^SAMPLER_DESC, DestDescriptor: CPU_DESCRIPTOR_HANDLE), - CopyDescriptors: proc "stdcall" (this: ^IDevice, NumDestDescriptorRanges: u32, pDestDescriptorRangeStarts: ^CPU_DESCRIPTOR_HANDLE, pDestDescriptorRangeSizes: ^u32, NumSrcDescriptorRanges: u32, pSrcDescriptorRangeStarts: ^CPU_DESCRIPTOR_HANDLE, pSrcDescriptorRangeSizes: ^u32, DescriptorHeapsType: DESCRIPTOR_HEAP_TYPE), - CopyDescriptorsSimple: proc "stdcall" (this: ^IDevice, NumDescriptors: u32, DestDescriptorRangeStart: CPU_DESCRIPTOR_HANDLE, SrcDescriptorRangeStart: CPU_DESCRIPTOR_HANDLE, DescriptorHeapsType: DESCRIPTOR_HEAP_TYPE), - GetResourceAllocationInfo: proc "stdcall" (this: ^IDevice, RetVal: ^RESOURCE_ALLOCATION_INFO, visibleMask: u32, numResourceDescs: u32, pResourceDescs: ^RESOURCE_DESC), - GetCustomHeapProperties: proc "stdcall" (this: ^IDevice, nodeMask: u32, heapType: HEAP_TYPE) -> HEAP_PROPERTIES, - CreateCommittedResource: proc "stdcall" (this: ^IDevice, pHeapProperties: ^HEAP_PROPERTIES, HeapFlags: HEAP_FLAGS, pDesc: ^RESOURCE_DESC, InitialResourceState: RESOURCE_STATES, pOptimizedClearValue: ^CLEAR_VALUE, riidResource: ^IID, ppvResource: ^rawptr) -> HRESULT, - CreateHeap: proc "stdcall" (this: ^IDevice, pDesc: ^HEAP_DESC, riid: ^IID, ppvHeap: ^rawptr) -> HRESULT, - CreatePlacedResource: proc "stdcall" (this: ^IDevice, pHeap: ^IHeap, HeapOffset: u64, pDesc: ^RESOURCE_DESC, InitialState: RESOURCE_STATES, pOptimizedClearValue: ^CLEAR_VALUE, riid: ^IID, ppvResource: ^rawptr) -> HRESULT, - CreateReservedResource: proc "stdcall" (this: ^IDevice, pDesc: ^RESOURCE_DESC, InitialState: RESOURCE_STATES, pOptimizedClearValue: ^CLEAR_VALUE, riid: ^IID, ppvResource: ^rawptr) -> HRESULT, - CreateSharedHandle: proc "stdcall" (this: ^IDevice, pObject: ^IDeviceChild, pAttributes: ^win32.SECURITY_ATTRIBUTES, Access: u32, Name: [^]u16, pHandle: ^HANDLE) -> HRESULT, - OpenSharedHandle: proc "stdcall" (this: ^IDevice, NTHandle: HANDLE, riid: ^IID, ppvObj: ^rawptr) -> HRESULT, - OpenSharedHandleByName: proc "stdcall" (this: ^IDevice, Name: [^]u16, Access: u32, pNTHandle: ^HANDLE) -> HRESULT, - MakeResident: proc "stdcall" (this: ^IDevice, NumObjects: u32, ppObjects: ^^IPageable) -> HRESULT, - Evict: proc "stdcall" (this: ^IDevice, NumObjects: u32, ppObjects: ^^IPageable) -> HRESULT, - CreateFence: proc "stdcall" (this: ^IDevice, InitialValue: u64, Flags: FENCE_FLAGS, riid: ^IID, ppFence: ^rawptr) -> HRESULT, - GetDeviceRemovedReason: proc "stdcall" (this: ^IDevice) -> HRESULT, - GetCopyableFootprints: proc "stdcall" (this: ^IDevice, pResourceDesc: ^RESOURCE_DESC, FirstSubresource: u32, NumSubresources: u32, BaseOffset: u64, pLayouts: ^PLACED_SUBRESOURCE_FOOTPRINT, pNumRows: ^u32, pRowSizeInBytes: ^u64, pTotalBytes: ^u64), - CreateQueryHeap: proc "stdcall" (this: ^IDevice, pDesc: ^QUERY_HEAP_DESC, riid: ^IID, ppvHeap: ^rawptr) -> HRESULT, - SetStablePowerState: proc "stdcall" (this: ^IDevice, Enable: BOOL) -> HRESULT, - CreateCommandSignature: proc "stdcall" (this: ^IDevice, pDesc: ^COMMAND_SIGNATURE_DESC, pRootSignature: ^IRootSignature, riid: ^IID, ppvCommandSignature: ^rawptr) -> HRESULT, - GetResourceTiling: proc "stdcall" (this: ^IDevice, pTiledResource: ^IResource, pNumTilesForEntireResource: ^u32, pPackedMipDesc: ^PACKED_MIP_INFO, pStandardTileShapeForNonPackedMips: ^TILE_SHAPE, pNumSubresourceTilings: ^u32, FirstSubresourceTilingToGet: u32, pSubresourceTilingsForNonPackedMips: ^SUBRESOURCE_TILING), - GetAdapterLuid: proc "stdcall" (this: ^IDevice) -> LUID, + GetNodeCount: proc "system" (this: ^IDevice) -> u32, + CreateCommandQueue: proc "system" (this: ^IDevice, pDesc: ^COMMAND_QUEUE_DESC, riid: ^IID, ppCommandQueue: ^rawptr) -> HRESULT, + CreateCommandAllocator: proc "system" (this: ^IDevice, type: COMMAND_LIST_TYPE, riid: ^IID, ppCommandAllocator: ^rawptr) -> HRESULT, + CreateGraphicsPipelineState: proc "system" (this: ^IDevice, pDesc: ^GRAPHICS_PIPELINE_STATE_DESC, riid: ^IID, ppPipelineState: ^rawptr) -> HRESULT, + CreateComputePipelineState: proc "system" (this: ^IDevice, pDesc: ^COMPUTE_PIPELINE_STATE_DESC, riid: ^IID, ppPipelineState: ^rawptr) -> HRESULT, + CreateCommandList: proc "system" (this: ^IDevice, nodeMask: u32, type: COMMAND_LIST_TYPE, pCommandAllocator: ^ICommandAllocator, pInitialState: ^IPipelineState, riid: ^IID, ppCommandList: ^rawptr) -> HRESULT, + CheckFeatureSupport: proc "system" (this: ^IDevice, Feature: FEATURE, pFeatureSupportData: rawptr, FeatureSupportDataSize: u32) -> HRESULT, + CreateDescriptorHeap: proc "system" (this: ^IDevice, pDescriptorHeapDesc: ^DESCRIPTOR_HEAP_DESC, riid: ^IID, ppvHeap: ^rawptr) -> HRESULT, + GetDescriptorHandleIncrementSize: proc "system" (this: ^IDevice, DescriptorHeapType: DESCRIPTOR_HEAP_TYPE) -> u32, + CreateRootSignature: proc "system" (this: ^IDevice, nodeMask: u32, pBlobWithRootSignature: rawptr, blobLengthInBytes: SIZE_T, riid: ^IID, ppvRootSignature: ^rawptr) -> HRESULT, + CreateConstantBufferView: proc "system" (this: ^IDevice, pDesc: ^CONSTANT_BUFFER_VIEW_DESC, DestDescriptor: CPU_DESCRIPTOR_HANDLE), + CreateShaderResourceView: proc "system" (this: ^IDevice, pResource: ^IResource, pDesc: ^SHADER_RESOURCE_VIEW_DESC, DestDescriptor: CPU_DESCRIPTOR_HANDLE), + CreateUnorderedAccessView: proc "system" (this: ^IDevice, pResource: ^IResource, pCounterResource: ^IResource, pDesc: ^UNORDERED_ACCESS_VIEW_DESC, DestDescriptor: CPU_DESCRIPTOR_HANDLE), + CreateRenderTargetView: proc "system" (this: ^IDevice, pResource: ^IResource, pDesc: ^RENDER_TARGET_VIEW_DESC, DestDescriptor: CPU_DESCRIPTOR_HANDLE), + CreateDepthStencilView: proc "system" (this: ^IDevice, pResource: ^IResource, pDesc: ^DEPTH_STENCIL_VIEW_DESC, DestDescriptor: CPU_DESCRIPTOR_HANDLE), + CreateSampler: proc "system" (this: ^IDevice, pDesc: ^SAMPLER_DESC, DestDescriptor: CPU_DESCRIPTOR_HANDLE), + CopyDescriptors: proc "system" (this: ^IDevice, NumDestDescriptorRanges: u32, pDestDescriptorRangeStarts: ^CPU_DESCRIPTOR_HANDLE, pDestDescriptorRangeSizes: ^u32, NumSrcDescriptorRanges: u32, pSrcDescriptorRangeStarts: ^CPU_DESCRIPTOR_HANDLE, pSrcDescriptorRangeSizes: ^u32, DescriptorHeapsType: DESCRIPTOR_HEAP_TYPE), + CopyDescriptorsSimple: proc "system" (this: ^IDevice, NumDescriptors: u32, DestDescriptorRangeStart: CPU_DESCRIPTOR_HANDLE, SrcDescriptorRangeStart: CPU_DESCRIPTOR_HANDLE, DescriptorHeapsType: DESCRIPTOR_HEAP_TYPE), + GetResourceAllocationInfo: proc "system" (this: ^IDevice, RetVal: ^RESOURCE_ALLOCATION_INFO, visibleMask: u32, numResourceDescs: u32, pResourceDescs: ^RESOURCE_DESC), + GetCustomHeapProperties: proc "system" (this: ^IDevice, nodeMask: u32, heapType: HEAP_TYPE) -> HEAP_PROPERTIES, + CreateCommittedResource: proc "system" (this: ^IDevice, pHeapProperties: ^HEAP_PROPERTIES, HeapFlags: HEAP_FLAGS, pDesc: ^RESOURCE_DESC, InitialResourceState: RESOURCE_STATES, pOptimizedClearValue: ^CLEAR_VALUE, riidResource: ^IID, ppvResource: ^rawptr) -> HRESULT, + CreateHeap: proc "system" (this: ^IDevice, pDesc: ^HEAP_DESC, riid: ^IID, ppvHeap: ^rawptr) -> HRESULT, + CreatePlacedResource: proc "system" (this: ^IDevice, pHeap: ^IHeap, HeapOffset: u64, pDesc: ^RESOURCE_DESC, InitialState: RESOURCE_STATES, pOptimizedClearValue: ^CLEAR_VALUE, riid: ^IID, ppvResource: ^rawptr) -> HRESULT, + CreateReservedResource: proc "system" (this: ^IDevice, pDesc: ^RESOURCE_DESC, InitialState: RESOURCE_STATES, pOptimizedClearValue: ^CLEAR_VALUE, riid: ^IID, ppvResource: ^rawptr) -> HRESULT, + CreateSharedHandle: proc "system" (this: ^IDevice, pObject: ^IDeviceChild, pAttributes: ^win32.SECURITY_ATTRIBUTES, Access: u32, Name: [^]u16, pHandle: ^HANDLE) -> HRESULT, + OpenSharedHandle: proc "system" (this: ^IDevice, NTHandle: HANDLE, riid: ^IID, ppvObj: ^rawptr) -> HRESULT, + OpenSharedHandleByName: proc "system" (this: ^IDevice, Name: [^]u16, Access: u32, pNTHandle: ^HANDLE) -> HRESULT, + MakeResident: proc "system" (this: ^IDevice, NumObjects: u32, ppObjects: ^^IPageable) -> HRESULT, + Evict: proc "system" (this: ^IDevice, NumObjects: u32, ppObjects: ^^IPageable) -> HRESULT, + CreateFence: proc "system" (this: ^IDevice, InitialValue: u64, Flags: FENCE_FLAGS, riid: ^IID, ppFence: ^rawptr) -> HRESULT, + GetDeviceRemovedReason: proc "system" (this: ^IDevice) -> HRESULT, + GetCopyableFootprints: proc "system" (this: ^IDevice, pResourceDesc: ^RESOURCE_DESC, FirstSubresource: u32, NumSubresources: u32, BaseOffset: u64, pLayouts: ^PLACED_SUBRESOURCE_FOOTPRINT, pNumRows: ^u32, pRowSizeInBytes: ^u64, pTotalBytes: ^u64), + CreateQueryHeap: proc "system" (this: ^IDevice, pDesc: ^QUERY_HEAP_DESC, riid: ^IID, ppvHeap: ^rawptr) -> HRESULT, + SetStablePowerState: proc "system" (this: ^IDevice, Enable: BOOL) -> HRESULT, + CreateCommandSignature: proc "system" (this: ^IDevice, pDesc: ^COMMAND_SIGNATURE_DESC, pRootSignature: ^IRootSignature, riid: ^IID, ppvCommandSignature: ^rawptr) -> HRESULT, + GetResourceTiling: proc "system" (this: ^IDevice, pTiledResource: ^IResource, pNumTilesForEntireResource: ^u32, pPackedMipDesc: ^PACKED_MIP_INFO, pStandardTileShapeForNonPackedMips: ^TILE_SHAPE, pNumSubresourceTilings: ^u32, FirstSubresourceTilingToGet: u32, pSubresourceTilingsForNonPackedMips: ^SUBRESOURCE_TILING), + GetAdapterLuid: proc "system" (this: ^IDevice) -> LUID, } @@ -2574,11 +2574,11 @@ IPipelineLibrary :: struct #raw_union { } IPipelineLibrary_VTable :: struct { using id3d12devicechild_vtable: IDeviceChild_VTable, - StorePipeline: proc "stdcall" (this: ^IPipelineLibrary, pName: [^]u16, pPipeline: ^IPipelineState) -> HRESULT, - LoadGraphicsPipeline: proc "stdcall" (this: ^IPipelineLibrary, pName: [^]u16, pDesc: ^GRAPHICS_PIPELINE_STATE_DESC, riid: ^IID, ppPipelineState: ^rawptr) -> HRESULT, - LoadComputePipeline: proc "stdcall" (this: ^IPipelineLibrary, pName: [^]u16, pDesc: ^COMPUTE_PIPELINE_STATE_DESC, riid: ^IID, ppPipelineState: ^rawptr) -> HRESULT, - GetSerializedSize: proc "stdcall" (this: ^IPipelineLibrary) -> SIZE_T, - Serialize: proc "stdcall" (this: ^IPipelineLibrary, pData: rawptr, DataSizeInBytes: SIZE_T) -> HRESULT, + StorePipeline: proc "system" (this: ^IPipelineLibrary, pName: [^]u16, pPipeline: ^IPipelineState) -> HRESULT, + LoadGraphicsPipeline: proc "system" (this: ^IPipelineLibrary, pName: [^]u16, pDesc: ^GRAPHICS_PIPELINE_STATE_DESC, riid: ^IID, ppPipelineState: ^rawptr) -> HRESULT, + LoadComputePipeline: proc "system" (this: ^IPipelineLibrary, pName: [^]u16, pDesc: ^COMPUTE_PIPELINE_STATE_DESC, riid: ^IID, ppPipelineState: ^rawptr) -> HRESULT, + GetSerializedSize: proc "system" (this: ^IPipelineLibrary) -> SIZE_T, + Serialize: proc "system" (this: ^IPipelineLibrary, pData: rawptr, DataSizeInBytes: SIZE_T) -> HRESULT, } @@ -2590,7 +2590,7 @@ IPipelineLibrary1 :: struct #raw_union { } IPipelineLibrary1_VTable :: struct { using id3d12pipelinelibrary_vtable: IPipelineLibrary_VTable, - LoadPipeline: proc "stdcall" (this: ^IPipelineLibrary1, pName: [^]u16, pDesc: ^PIPELINE_STATE_STREAM_DESC, riid: ^IID, ppPipelineState: ^rawptr) -> HRESULT, + LoadPipeline: proc "system" (this: ^IPipelineLibrary1, pName: [^]u16, pDesc: ^PIPELINE_STATE_STREAM_DESC, riid: ^IID, ppPipelineState: ^rawptr) -> HRESULT, } MULTIPLE_FENCE_WAIT_FLAGS :: distinct bit_set[MULTIPLE_FENCE_WAIT_FLAG; u32] @@ -2618,9 +2618,9 @@ IDevice1 :: struct #raw_union { } IDevice1_VTable :: struct { using id3d12device_vtable: IDevice_VTable, - CreatePipelineLibrary: proc "stdcall" (this: ^IDevice1, pLibraryBlob: rawptr, BlobLength: SIZE_T, riid: ^IID, ppPipelineLibrary: ^rawptr) -> HRESULT, - SetEventOnMultipleFenceCompletion: proc "stdcall" (this: ^IDevice1, ppFences: ^^IFence, pFenceValues: ^u64, NumFences: u32, Flags: MULTIPLE_FENCE_WAIT_FLAGS, hEvent: HANDLE) -> HRESULT, - SetResidencyPriority: proc "stdcall" (this: ^IDevice1, NumObjects: u32, ppObjects: ^^IPageable, pPriorities: ^RESIDENCY_PRIORITY) -> HRESULT, + CreatePipelineLibrary: proc "system" (this: ^IDevice1, pLibraryBlob: rawptr, BlobLength: SIZE_T, riid: ^IID, ppPipelineLibrary: ^rawptr) -> HRESULT, + SetEventOnMultipleFenceCompletion: proc "system" (this: ^IDevice1, ppFences: ^^IFence, pFenceValues: ^u64, NumFences: u32, Flags: MULTIPLE_FENCE_WAIT_FLAGS, hEvent: HANDLE) -> HRESULT, + SetResidencyPriority: proc "system" (this: ^IDevice1, NumObjects: u32, ppObjects: ^^IPageable, pPriorities: ^RESIDENCY_PRIORITY) -> HRESULT, } @@ -2632,7 +2632,7 @@ IDevice2 :: struct #raw_union { } IDevice2_VTable :: struct { using id3d12device1_vtable: IDevice1_VTable, - CreatePipelineState: proc "stdcall" (this: ^IDevice2, pDesc: ^PIPELINE_STATE_STREAM_DESC, riid: ^IID, ppPipelineState: ^rawptr) -> HRESULT, + CreatePipelineState: proc "system" (this: ^IDevice2, pDesc: ^PIPELINE_STATE_STREAM_DESC, riid: ^IID, ppPipelineState: ^rawptr) -> HRESULT, } RESIDENCY_FLAGS :: distinct bit_set[RESIDENCY_FLAG; u32] @@ -2649,9 +2649,9 @@ IDevice3 :: struct #raw_union { } IDevice3_VTable :: struct { using id3d12device2_vtable: IDevice2_VTable, - OpenExistingHeapFromAddress: proc "stdcall" (this: ^IDevice3, pAddress: rawptr, riid: ^IID, ppvHeap: ^rawptr) -> HRESULT, - OpenExistingHeapFromFileMapping: proc "stdcall" (this: ^IDevice3, hFileMapping: HANDLE, riid: ^IID, ppvHeap: ^rawptr) -> HRESULT, - EnqueueMakeResident: proc "stdcall" (this: ^IDevice3, Flags: RESIDENCY_FLAGS, NumObjects: u32, ppObjects: ^^IPageable, pFenceToSignal: ^IFence, FenceValueToSignal: u64) -> HRESULT, + OpenExistingHeapFromAddress: proc "system" (this: ^IDevice3, pAddress: rawptr, riid: ^IID, ppvHeap: ^rawptr) -> HRESULT, + OpenExistingHeapFromFileMapping: proc "system" (this: ^IDevice3, hFileMapping: HANDLE, riid: ^IID, ppvHeap: ^rawptr) -> HRESULT, + EnqueueMakeResident: proc "system" (this: ^IDevice3, Flags: RESIDENCY_FLAGS, NumObjects: u32, ppObjects: ^^IPageable, pFenceToSignal: ^IFence, FenceValueToSignal: u64) -> HRESULT, } COMMAND_LIST_FLAGS :: distinct bit_set[COMMAND_LIST_FLAG; u32] @@ -2680,8 +2680,8 @@ IProtectedSession :: struct #raw_union { } IProtectedSession_VTable :: struct { using id3d12devicechild_vtable: IDeviceChild_VTable, - GetStatusFence: proc "stdcall" (this: ^IProtectedSession, riid: ^IID, ppFence: ^rawptr) -> HRESULT, - GetSessionStatus: proc "stdcall" (this: ^IProtectedSession) -> PROTECTED_SESSION_STATUS, + GetStatusFence: proc "system" (this: ^IProtectedSession, riid: ^IID, ppFence: ^rawptr) -> HRESULT, + GetSessionStatus: proc "system" (this: ^IProtectedSession) -> PROTECTED_SESSION_STATUS, } PROTECTED_RESOURCE_SESSION_SUPPORT_FLAGS :: distinct bit_set[PROTECTED_RESOURCE_SESSION_SUPPORT_FLAG; u32] @@ -2712,7 +2712,7 @@ IProtectedResourceSession :: struct #raw_union { } IProtectedResourceSession_VTable :: struct { using id3d12protectedsession_vtable: IProtectedSession_VTable, - GetDesc: proc "stdcall" (this: ^IProtectedResourceSession) -> PROTECTED_RESOURCE_SESSION_DESC, + GetDesc: proc "system" (this: ^IProtectedResourceSession) -> PROTECTED_RESOURCE_SESSION_DESC, } @@ -2724,12 +2724,12 @@ IDevice4 :: struct #raw_union { } IDevice4_VTable :: struct { using id3d12device3_vtable: IDevice3_VTable, - CreateCommandList1: proc "stdcall" (this: ^IDevice4, nodeMask: u32, type: COMMAND_LIST_TYPE, flags: COMMAND_LIST_FLAGS, riid: ^IID, ppCommandList: ^rawptr) -> HRESULT, - CreateProtectedResourceSession: proc "stdcall" (this: ^IDevice4, pDesc: ^PROTECTED_RESOURCE_SESSION_DESC, riid: ^IID, ppSession: ^rawptr) -> HRESULT, - CreateCommittedResource1: proc "stdcall" (this: ^IDevice4, pHeapProperties: ^HEAP_PROPERTIES, HeapFlags: HEAP_FLAGS, pDesc: ^RESOURCE_DESC, InitialResourceState: RESOURCE_STATES, pOptimizedClearValue: ^CLEAR_VALUE, pProtectedSession: ^IProtectedResourceSession, riidResource: ^IID, ppvResource: ^rawptr) -> HRESULT, - CreateHeap1: proc "stdcall" (this: ^IDevice4, pDesc: ^HEAP_DESC, pProtectedSession: ^IProtectedResourceSession, riid: ^IID, ppvHeap: ^rawptr) -> HRESULT, - CreateReservedResource1: proc "stdcall" (this: ^IDevice4, pDesc: ^RESOURCE_DESC, InitialState: RESOURCE_STATES, pOptimizedClearValue: ^CLEAR_VALUE, pProtectedSession: ^IProtectedResourceSession, riid: ^IID, ppvResource: ^rawptr) -> HRESULT, - GetResourceAllocationInfo1: proc "stdcall" (this: ^IDevice4, RetVal: ^RESOURCE_ALLOCATION_INFO, visibleMask: u32, numResourceDescs: u32, pResourceDescs: ^RESOURCE_DESC, pResourceAllocationInfo1: ^RESOURCE_ALLOCATION_INFO1), + CreateCommandList1: proc "system" (this: ^IDevice4, nodeMask: u32, type: COMMAND_LIST_TYPE, flags: COMMAND_LIST_FLAGS, riid: ^IID, ppCommandList: ^rawptr) -> HRESULT, + CreateProtectedResourceSession: proc "system" (this: ^IDevice4, pDesc: ^PROTECTED_RESOURCE_SESSION_DESC, riid: ^IID, ppSession: ^rawptr) -> HRESULT, + CreateCommittedResource1: proc "system" (this: ^IDevice4, pHeapProperties: ^HEAP_PROPERTIES, HeapFlags: HEAP_FLAGS, pDesc: ^RESOURCE_DESC, InitialResourceState: RESOURCE_STATES, pOptimizedClearValue: ^CLEAR_VALUE, pProtectedSession: ^IProtectedResourceSession, riidResource: ^IID, ppvResource: ^rawptr) -> HRESULT, + CreateHeap1: proc "system" (this: ^IDevice4, pDesc: ^HEAP_DESC, pProtectedSession: ^IProtectedResourceSession, riid: ^IID, ppvHeap: ^rawptr) -> HRESULT, + CreateReservedResource1: proc "system" (this: ^IDevice4, pDesc: ^RESOURCE_DESC, InitialState: RESOURCE_STATES, pOptimizedClearValue: ^CLEAR_VALUE, pProtectedSession: ^IProtectedResourceSession, riid: ^IID, ppvResource: ^rawptr) -> HRESULT, + GetResourceAllocationInfo1: proc "system" (this: ^IDevice4, RetVal: ^RESOURCE_ALLOCATION_INFO, visibleMask: u32, numResourceDescs: u32, pResourceDescs: ^RESOURCE_DESC, pResourceAllocationInfo1: ^RESOURCE_ALLOCATION_INFO1), } LIFETIME_STATE :: enum i32 { @@ -2746,7 +2746,7 @@ ILifetimeOwner :: struct #raw_union { } ILifetimeOwner_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - LifetimeStateUpdated: proc "stdcall" (this: ^ILifetimeOwner, NewState: LIFETIME_STATE), + LifetimeStateUpdated: proc "system" (this: ^ILifetimeOwner, NewState: LIFETIME_STATE), } @@ -2758,10 +2758,10 @@ ISwapChainAssistant :: struct #raw_union { } ISwapChainAssistant_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - GetLUID: proc "stdcall" (this: ^ISwapChainAssistant) -> LUID, - GetSwapChainObject: proc "stdcall" (this: ^ISwapChainAssistant, riid: ^IID, ppv: ^rawptr) -> HRESULT, - GetCurrentResourceAndCommandQueue: proc "stdcall" (this: ^ISwapChainAssistant, riidResource: ^IID, ppvResource: ^rawptr, riidQueue: ^IID, ppvQueue: ^rawptr) -> HRESULT, - InsertImplicitSync: proc "stdcall" (this: ^ISwapChainAssistant) -> HRESULT, + GetLUID: proc "system" (this: ^ISwapChainAssistant) -> LUID, + GetSwapChainObject: proc "system" (this: ^ISwapChainAssistant, riid: ^IID, ppv: ^rawptr) -> HRESULT, + GetCurrentResourceAndCommandQueue: proc "system" (this: ^ISwapChainAssistant, riidResource: ^IID, ppvResource: ^rawptr, riidQueue: ^IID, ppvQueue: ^rawptr) -> HRESULT, + InsertImplicitSync: proc "system" (this: ^ISwapChainAssistant) -> HRESULT, } @@ -2773,7 +2773,7 @@ ILifetimeTracker :: struct #raw_union { } ILifetimeTracker_VTable :: struct { using id3d12devicechild_vtable: IDeviceChild_VTable, - DestroyOwnedObject: proc "stdcall" (this: ^ILifetimeTracker, pObject: ^IDeviceChild) -> HRESULT, + DestroyOwnedObject: proc "system" (this: ^ILifetimeTracker, pObject: ^IDeviceChild) -> HRESULT, } META_COMMAND_PARAMETER_TYPE :: enum i32 { @@ -2848,10 +2848,10 @@ IStateObjectProperties :: struct #raw_union { } IStateObjectProperties_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - GetShaderIdentifier: proc "stdcall" (this: ^IStateObjectProperties, pExportName: [^]u16) -> rawptr, - GetShaderStackSize: proc "stdcall" (this: ^IStateObjectProperties, pExportName: [^]u16) -> u64, - GetPipelineStackSize: proc "stdcall" (this: ^IStateObjectProperties) -> u64, - SetPipelineStackSize: proc "stdcall" (this: ^IStateObjectProperties, PipelineStackSizeInBytes: u64), + GetShaderIdentifier: proc "system" (this: ^IStateObjectProperties, pExportName: [^]u16) -> rawptr, + GetShaderStackSize: proc "system" (this: ^IStateObjectProperties, pExportName: [^]u16) -> u64, + GetPipelineStackSize: proc "system" (this: ^IStateObjectProperties) -> u64, + SetPipelineStackSize: proc "system" (this: ^IStateObjectProperties, PipelineStackSizeInBytes: u64), } STATE_SUBOBJECT_TYPE :: enum i32 { @@ -3190,14 +3190,14 @@ IDevice5 :: struct #raw_union { } IDevice5_VTable :: struct { using id3d12device4_vtable: IDevice4_VTable, - CreateLifetimeTracker: proc "stdcall" (this: ^IDevice5, pOwner: ^ILifetimeOwner, riid: ^IID, ppvTracker: ^rawptr) -> HRESULT, - RemoveDevice: proc "stdcall" (this: ^IDevice5), - EnumerateMetaCommands: proc "stdcall" (this: ^IDevice5, pNumMetaCommands: ^u32, pDescs: ^META_COMMAND_DESC) -> HRESULT, - EnumerateMetaCommandParameters: proc "stdcall" (this: ^IDevice5, CommandId: ^GUID, Stage: META_COMMAND_PARAMETER_STAGE, pTotalStructureSizeInBytes: ^u32, pParameterCount: ^u32, pParameterDescs: ^META_COMMAND_PARAMETER_DESC) -> HRESULT, - CreateMetaCommand: proc "stdcall" (this: ^IDevice5, CommandId: ^GUID, NodeMask: u32, pCreationParametersData: rawptr, CreationParametersDataSizeInBytes: SIZE_T, riid: ^IID, ppMetaCommand: ^rawptr) -> HRESULT, - CreateStateObject: proc "stdcall" (this: ^IDevice5, pDesc: ^STATE_OBJECT_DESC, riid: ^IID, ppStateObject: ^rawptr) -> HRESULT, - GetRaytracingAccelerationStructurePrebuildInfo: proc "stdcall" (this: ^IDevice5, pDesc: ^BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS, pInfo: ^RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO), - CheckDriverMatchingIdentifier: proc "stdcall" (this: ^IDevice5, SerializedDataType: SERIALIZED_DATA_TYPE, pIdentifierToCheck: ^SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER) -> DRIVER_MATCHING_IDENTIFIER_STATUS, + CreateLifetimeTracker: proc "system" (this: ^IDevice5, pOwner: ^ILifetimeOwner, riid: ^IID, ppvTracker: ^rawptr) -> HRESULT, + RemoveDevice: proc "system" (this: ^IDevice5), + EnumerateMetaCommands: proc "system" (this: ^IDevice5, pNumMetaCommands: ^u32, pDescs: ^META_COMMAND_DESC) -> HRESULT, + EnumerateMetaCommandParameters: proc "system" (this: ^IDevice5, CommandId: ^GUID, Stage: META_COMMAND_PARAMETER_STAGE, pTotalStructureSizeInBytes: ^u32, pParameterCount: ^u32, pParameterDescs: ^META_COMMAND_PARAMETER_DESC) -> HRESULT, + CreateMetaCommand: proc "system" (this: ^IDevice5, CommandId: ^GUID, NodeMask: u32, pCreationParametersData: rawptr, CreationParametersDataSizeInBytes: SIZE_T, riid: ^IID, ppMetaCommand: ^rawptr) -> HRESULT, + CreateStateObject: proc "system" (this: ^IDevice5, pDesc: ^STATE_OBJECT_DESC, riid: ^IID, ppStateObject: ^rawptr) -> HRESULT, + GetRaytracingAccelerationStructurePrebuildInfo: proc "system" (this: ^IDevice5, pDesc: ^BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS, pInfo: ^RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO), + CheckDriverMatchingIdentifier: proc "system" (this: ^IDevice5, SerializedDataType: SERIALIZED_DATA_TYPE, pIdentifierToCheck: ^SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER) -> DRIVER_MATCHING_IDENTIFIER_STATUS, } AUTO_BREADCRUMB_OP :: enum i32 { @@ -3397,9 +3397,9 @@ IDeviceRemovedExtendedDataSettings :: struct #raw_union { } IDeviceRemovedExtendedDataSettings_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - SetAutoBreadcrumbsEnablement: proc "stdcall" (this: ^IDeviceRemovedExtendedDataSettings, Enablement: DRED_ENABLEMENT), - SetPageFaultEnablement: proc "stdcall" (this: ^IDeviceRemovedExtendedDataSettings, Enablement: DRED_ENABLEMENT), - SetWatsonDumpEnablement: proc "stdcall" (this: ^IDeviceRemovedExtendedDataSettings, Enablement: DRED_ENABLEMENT), + SetAutoBreadcrumbsEnablement: proc "system" (this: ^IDeviceRemovedExtendedDataSettings, Enablement: DRED_ENABLEMENT), + SetPageFaultEnablement: proc "system" (this: ^IDeviceRemovedExtendedDataSettings, Enablement: DRED_ENABLEMENT), + SetWatsonDumpEnablement: proc "system" (this: ^IDeviceRemovedExtendedDataSettings, Enablement: DRED_ENABLEMENT), } @@ -3411,7 +3411,7 @@ IDeviceRemovedExtendedDataSettings1 :: struct #raw_union { } IDeviceRemovedExtendedDataSettings1_VTable :: struct { using id3d12deviceremovedextendeddatasettings_vtable: IDeviceRemovedExtendedDataSettings_VTable, - SetBreadcrumbContextEnablement: proc "stdcall" (this: ^IDeviceRemovedExtendedDataSettings1, Enablement: DRED_ENABLEMENT), + SetBreadcrumbContextEnablement: proc "system" (this: ^IDeviceRemovedExtendedDataSettings1, Enablement: DRED_ENABLEMENT), } @@ -3423,8 +3423,8 @@ IDeviceRemovedExtendedData :: struct #raw_union { } IDeviceRemovedExtendedData_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - GetAutoBreadcrumbsOutput: proc "stdcall" (this: ^IDeviceRemovedExtendedData, pOutput: ^DRED_AUTO_BREADCRUMBS_OUTPUT) -> HRESULT, - GetPageFaultAllocationOutput: proc "stdcall" (this: ^IDeviceRemovedExtendedData, pOutput: ^DRED_PAGE_FAULT_OUTPUT) -> HRESULT, + GetAutoBreadcrumbsOutput: proc "system" (this: ^IDeviceRemovedExtendedData, pOutput: ^DRED_AUTO_BREADCRUMBS_OUTPUT) -> HRESULT, + GetPageFaultAllocationOutput: proc "system" (this: ^IDeviceRemovedExtendedData, pOutput: ^DRED_PAGE_FAULT_OUTPUT) -> HRESULT, } @@ -3436,8 +3436,8 @@ IDeviceRemovedExtendedData1 :: struct #raw_union { } IDeviceRemovedExtendedData1_VTable :: struct { using id3d12deviceremovedextendeddata_vtable: IDeviceRemovedExtendedData_VTable, - GetAutoBreadcrumbsOutput1: proc "stdcall" (this: ^IDeviceRemovedExtendedData1, pOutput: ^DRED_AUTO_BREADCRUMBS_OUTPUT1) -> HRESULT, - GetPageFaultAllocationOutput1: proc "stdcall" (this: ^IDeviceRemovedExtendedData1, pOutput: ^DRED_PAGE_FAULT_OUTPUT1) -> HRESULT, + GetAutoBreadcrumbsOutput1: proc "system" (this: ^IDeviceRemovedExtendedData1, pOutput: ^DRED_AUTO_BREADCRUMBS_OUTPUT1) -> HRESULT, + GetPageFaultAllocationOutput1: proc "system" (this: ^IDeviceRemovedExtendedData1, pOutput: ^DRED_PAGE_FAULT_OUTPUT1) -> HRESULT, } BACKGROUND_PROCESSING_MODE :: enum i32 { @@ -3463,7 +3463,7 @@ IDevice6 :: struct #raw_union { } IDevice6_VTable :: struct { using id3d12device5_vtable: IDevice5_VTable, - SetBackgroundProcessingMode: proc "stdcall" (this: ^IDevice6, Mode: BACKGROUND_PROCESSING_MODE, MeasurementsAction: MEASUREMENTS_ACTION, hEventToSignalUponCompletion: HANDLE, pbFurtherMeasurementsDesired: ^BOOL) -> HRESULT, + SetBackgroundProcessingMode: proc "system" (this: ^IDevice6, Mode: BACKGROUND_PROCESSING_MODE, MeasurementsAction: MEASUREMENTS_ACTION, hEventToSignalUponCompletion: HANDLE, pbFurtherMeasurementsDesired: ^BOOL) -> HRESULT, } FEATURE_DATA_PROTECTED_RESOURCE_SESSION_TYPE_COUNT :: struct { @@ -3492,7 +3492,7 @@ IProtectedResourceSession1 :: struct #raw_union { } IProtectedResourceSession1_VTable :: struct { using id3d12protectedresourcesession_vtable: IProtectedResourceSession_VTable, - GetDesc1: proc "stdcall" (this: ^IProtectedResourceSession1) -> PROTECTED_RESOURCE_SESSION_DESC1, + GetDesc1: proc "system" (this: ^IProtectedResourceSession1) -> PROTECTED_RESOURCE_SESSION_DESC1, } @@ -3504,8 +3504,8 @@ IDevice7 :: struct #raw_union { } IDevice7_VTable :: struct { using id3d12device6_vtable: IDevice6_VTable, - AddToStateObject: proc "stdcall" (this: ^IDevice7, pAddition: ^STATE_OBJECT_DESC, pStateObjectToGrowFrom: ^IStateObject, riid: ^IID, ppNewStateObject: ^rawptr) -> HRESULT, - CreateProtectedResourceSession1: proc "stdcall" (this: ^IDevice7, pDesc: ^PROTECTED_RESOURCE_SESSION_DESC1, riid: ^IID, ppSession: ^rawptr) -> HRESULT, + AddToStateObject: proc "system" (this: ^IDevice7, pAddition: ^STATE_OBJECT_DESC, pStateObjectToGrowFrom: ^IStateObject, riid: ^IID, ppNewStateObject: ^rawptr) -> HRESULT, + CreateProtectedResourceSession1: proc "system" (this: ^IDevice7, pDesc: ^PROTECTED_RESOURCE_SESSION_DESC1, riid: ^IID, ppSession: ^rawptr) -> HRESULT, } @@ -3517,11 +3517,11 @@ IDevice8 :: struct #raw_union { } IDevice8_VTable :: struct { using id3d12device7_vtable: IDevice7_VTable, - GetResourceAllocationInfo2: proc "stdcall" (this: ^IDevice8, RetVal: ^RESOURCE_ALLOCATION_INFO, visibleMask: u32, numResourceDescs: u32, pResourceDescs: ^RESOURCE_DESC1, pResourceAllocationInfo1: ^RESOURCE_ALLOCATION_INFO1), - CreateCommittedResource2: proc "stdcall" (this: ^IDevice8, pHeapProperties: ^HEAP_PROPERTIES, HeapFlags: HEAP_FLAGS, pDesc: ^RESOURCE_DESC1, InitialResourceState: RESOURCE_STATES, pOptimizedClearValue: ^CLEAR_VALUE, pProtectedSession: ^IProtectedResourceSession, riidResource: ^IID, ppvResource: ^rawptr) -> HRESULT, - CreatePlacedResource1: proc "stdcall" (this: ^IDevice8, pHeap: ^IHeap, HeapOffset: u64, pDesc: ^RESOURCE_DESC1, InitialState: RESOURCE_STATES, pOptimizedClearValue: ^CLEAR_VALUE, riid: ^IID, ppvResource: ^rawptr) -> HRESULT, - CreateSamplerFeedbackUnorderedAccessView: proc "stdcall" (this: ^IDevice8, pTargetedResource: ^IResource, pFeedbackResource: ^IResource, DestDescriptor: CPU_DESCRIPTOR_HANDLE), - GetCopyableFootprints1: proc "stdcall" (this: ^IDevice8, pResourceDesc: ^RESOURCE_DESC1, FirstSubresource: u32, NumSubresources: u32, BaseOffset: u64, pLayouts: ^PLACED_SUBRESOURCE_FOOTPRINT, pNumRows: ^u32, pRowSizeInBytes: ^u64, pTotalBytes: ^u64), + GetResourceAllocationInfo2: proc "system" (this: ^IDevice8, RetVal: ^RESOURCE_ALLOCATION_INFO, visibleMask: u32, numResourceDescs: u32, pResourceDescs: ^RESOURCE_DESC1, pResourceAllocationInfo1: ^RESOURCE_ALLOCATION_INFO1), + CreateCommittedResource2: proc "system" (this: ^IDevice8, pHeapProperties: ^HEAP_PROPERTIES, HeapFlags: HEAP_FLAGS, pDesc: ^RESOURCE_DESC1, InitialResourceState: RESOURCE_STATES, pOptimizedClearValue: ^CLEAR_VALUE, pProtectedSession: ^IProtectedResourceSession, riidResource: ^IID, ppvResource: ^rawptr) -> HRESULT, + CreatePlacedResource1: proc "system" (this: ^IDevice8, pHeap: ^IHeap, HeapOffset: u64, pDesc: ^RESOURCE_DESC1, InitialState: RESOURCE_STATES, pOptimizedClearValue: ^CLEAR_VALUE, riid: ^IID, ppvResource: ^rawptr) -> HRESULT, + CreateSamplerFeedbackUnorderedAccessView: proc "system" (this: ^IDevice8, pTargetedResource: ^IResource, pFeedbackResource: ^IResource, DestDescriptor: CPU_DESCRIPTOR_HANDLE), + GetCopyableFootprints1: proc "system" (this: ^IDevice8, pResourceDesc: ^RESOURCE_DESC1, FirstSubresource: u32, NumSubresources: u32, BaseOffset: u64, pLayouts: ^PLACED_SUBRESOURCE_FOOTPRINT, pNumRows: ^u32, pRowSizeInBytes: ^u64, pTotalBytes: ^u64), } @@ -3533,7 +3533,7 @@ IResource1 :: struct #raw_union { } IResource1_VTable :: struct { using id3d12resource_vtable: IResource_VTable, - GetProtectedResourceSession: proc "stdcall" (this: ^IResource1, riid: ^IID, ppProtectedSession: ^rawptr) -> HRESULT, + GetProtectedResourceSession: proc "system" (this: ^IResource1, riid: ^IID, ppProtectedSession: ^rawptr) -> HRESULT, } @@ -3545,7 +3545,7 @@ IResource2 :: struct #raw_union { } IResource2_VTable :: struct { using id3d12resource1_vtable: IResource1_VTable, - GetDesc1: proc "stdcall" (this: ^IResource2) -> RESOURCE_DESC1, + GetDesc1: proc "system" (this: ^IResource2) -> RESOURCE_DESC1, } @@ -3557,7 +3557,7 @@ IHeap1 :: struct #raw_union { } IHeap1_VTable :: struct { using id3d12heap_vtable: IHeap_VTable, - GetProtectedResourceSession: proc "stdcall" (this: ^IHeap1, riid: ^IID, ppProtectedSession: ^rawptr) -> HRESULT, + GetProtectedResourceSession: proc "system" (this: ^IHeap1, riid: ^IID, ppProtectedSession: ^rawptr) -> HRESULT, } @@ -3569,7 +3569,7 @@ IGraphicsCommandList3 :: struct #raw_union { } IGraphicsCommandList3_VTable :: struct { using id3d12graphicscommandlist2_vtable: IGraphicsCommandList2_VTable, - SetProtectedResourceSession: proc "stdcall" (this: ^IGraphicsCommandList3, pProtectedResourceSession: ^IProtectedResourceSession), + SetProtectedResourceSession: proc "system" (this: ^IGraphicsCommandList3, pProtectedResourceSession: ^IProtectedResourceSession), } RENDER_PASS_BEGINNING_ACCESS_TYPE :: enum i32 { @@ -3652,7 +3652,7 @@ IMetaCommand :: struct #raw_union { } IMetaCommand_VTable :: struct { using id3d12devicechild_vtable: IDeviceChild_VTable, - GetRequiredParameterResourceSize: proc "stdcall" (this: ^IMetaCommand, Stage: META_COMMAND_PARAMETER_STAGE, ParameterIndex: u32) -> u64, + GetRequiredParameterResourceSize: proc "system" (this: ^IMetaCommand, Stage: META_COMMAND_PARAMETER_STAGE, ParameterIndex: u32) -> u64, } DISPATCH_RAYS_DESC :: struct { @@ -3674,15 +3674,15 @@ IGraphicsCommandList4 :: struct #raw_union { } IGraphicsCommandList4_VTable :: struct { using id3d12graphicscommandlist3_vtable: IGraphicsCommandList3_VTable, - BeginRenderPass: proc "stdcall" (this: ^IGraphicsCommandList4, NumRenderTargets: u32, pRenderTargets: ^RENDER_PASS_RENDER_TARGET_DESC, pDepthStencil: ^RENDER_PASS_DEPTH_STENCIL_DESC, Flags: RENDER_PASS_FLAGS), - EndRenderPass: proc "stdcall" (this: ^IGraphicsCommandList4), - InitializeMetaCommand: proc "stdcall" (this: ^IGraphicsCommandList4, pMetaCommand: ^IMetaCommand, pInitializationParametersData: rawptr, InitializationParametersDataSizeInBytes: SIZE_T), - ExecuteMetaCommand: proc "stdcall" (this: ^IGraphicsCommandList4, pMetaCommand: ^IMetaCommand, pExecutionParametersData: rawptr, ExecutionParametersDataSizeInBytes: SIZE_T), - BuildRaytracingAccelerationStructure: proc "stdcall" (this: ^IGraphicsCommandList4, pDesc: ^BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC, NumPostbuildInfoDescs: u32, pPostbuildInfoDescs: ^RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC), - EmitRaytracingAccelerationStructurePostbuildInfo: proc "stdcall" (this: ^IGraphicsCommandList4, pDesc: ^RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC, NumSourceAccelerationStructures: u32, pSourceAccelerationStructureData: ^GPU_VIRTUAL_ADDRESS), - CopyRaytracingAccelerationStructure: proc "stdcall" (this: ^IGraphicsCommandList4, DestAccelerationStructureData: GPU_VIRTUAL_ADDRESS, SourceAccelerationStructureData: GPU_VIRTUAL_ADDRESS, Mode: RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE), - SetPipelineState1: proc "stdcall" (this: ^IGraphicsCommandList4, pStateObject: ^IStateObject), - DispatchRays: proc "stdcall" (this: ^IGraphicsCommandList4, pDesc: ^DISPATCH_RAYS_DESC), + BeginRenderPass: proc "system" (this: ^IGraphicsCommandList4, NumRenderTargets: u32, pRenderTargets: ^RENDER_PASS_RENDER_TARGET_DESC, pDepthStencil: ^RENDER_PASS_DEPTH_STENCIL_DESC, Flags: RENDER_PASS_FLAGS), + EndRenderPass: proc "system" (this: ^IGraphicsCommandList4), + InitializeMetaCommand: proc "system" (this: ^IGraphicsCommandList4, pMetaCommand: ^IMetaCommand, pInitializationParametersData: rawptr, InitializationParametersDataSizeInBytes: SIZE_T), + ExecuteMetaCommand: proc "system" (this: ^IGraphicsCommandList4, pMetaCommand: ^IMetaCommand, pExecutionParametersData: rawptr, ExecutionParametersDataSizeInBytes: SIZE_T), + BuildRaytracingAccelerationStructure: proc "system" (this: ^IGraphicsCommandList4, pDesc: ^BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC, NumPostbuildInfoDescs: u32, pPostbuildInfoDescs: ^RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC), + EmitRaytracingAccelerationStructurePostbuildInfo: proc "system" (this: ^IGraphicsCommandList4, pDesc: ^RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC, NumSourceAccelerationStructures: u32, pSourceAccelerationStructureData: ^GPU_VIRTUAL_ADDRESS), + CopyRaytracingAccelerationStructure: proc "system" (this: ^IGraphicsCommandList4, DestAccelerationStructureData: GPU_VIRTUAL_ADDRESS, SourceAccelerationStructureData: GPU_VIRTUAL_ADDRESS, Mode: RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE), + SetPipelineState1: proc "system" (this: ^IGraphicsCommandList4, pStateObject: ^IStateObject), + DispatchRays: proc "system" (this: ^IGraphicsCommandList4, pDesc: ^DISPATCH_RAYS_DESC), } @@ -3694,8 +3694,8 @@ ITools :: struct #raw_union { } ITools_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - EnableShaderInstrumentation: proc "stdcall" (this: ^ITools, bEnable: BOOL), - ShaderInstrumentationEnabled: proc "stdcall" (this: ^ITools) -> BOOL, + EnableShaderInstrumentation: proc "system" (this: ^ITools, bEnable: BOOL), + ShaderInstrumentationEnabled: proc "system" (this: ^ITools) -> BOOL, } SUBRESOURCE_DATA :: struct { @@ -3719,7 +3719,7 @@ IDebug :: struct #raw_union { } IDebug_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - EnableDebugLayer: proc "stdcall" (this: ^IDebug), + EnableDebugLayer: proc "system" (this: ^IDebug), } GPU_BASED_VALIDATION_FLAGS :: distinct bit_set[GPU_BASED_VALIDATION_FLAG; u32] @@ -3736,9 +3736,9 @@ IDebug1 :: struct #raw_union { } IDebug1_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - EnableDebugLayer: proc "stdcall" (this: ^IDebug1), - SetEnableGPUBasedValidation: proc "stdcall" (this: ^IDebug1, Enable: BOOL), - SetEnableSynchronizedCommandQueueValidation: proc "stdcall" (this: ^IDebug1, Enable: BOOL), + EnableDebugLayer: proc "system" (this: ^IDebug1), + SetEnableGPUBasedValidation: proc "system" (this: ^IDebug1, Enable: BOOL), + SetEnableSynchronizedCommandQueueValidation: proc "system" (this: ^IDebug1, Enable: BOOL), } @@ -3749,7 +3749,7 @@ IDebug2 :: struct #raw_union { } IDebug2_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - SetGPUBasedValidationFlags: proc "stdcall" (this: ^IDebug2, Flags: GPU_BASED_VALIDATION_FLAGS), + SetGPUBasedValidationFlags: proc "system" (this: ^IDebug2, Flags: GPU_BASED_VALIDATION_FLAGS), } @@ -3761,9 +3761,9 @@ IDebug3 :: struct #raw_union { } IDebug3_VTable :: struct { using id3d12debug_vtable: IDebug_VTable, - SetEnableGPUBasedValidation: proc "stdcall" (this: ^IDebug3, Enable: BOOL), - SetEnableSynchronizedCommandQueueValidation: proc "stdcall" (this: ^IDebug3, Enable: BOOL), - SetGPUBasedValidationFlags: proc "stdcall" (this: ^IDebug3, Flags: GPU_BASED_VALIDATION_FLAGS), + SetEnableGPUBasedValidation: proc "system" (this: ^IDebug3, Enable: BOOL), + SetEnableSynchronizedCommandQueueValidation: proc "system" (this: ^IDebug3, Enable: BOOL), + SetGPUBasedValidationFlags: proc "system" (this: ^IDebug3, Flags: GPU_BASED_VALIDATION_FLAGS), } RLDO_FLAGS :: distinct bit_set[RLDO_FLAG; u32] @@ -3826,9 +3826,9 @@ IDebugDevice1 :: struct #raw_union { } IDebugDevice1_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - SetDebugParameter: proc "stdcall" (this: ^IDebugDevice1, Type: DEBUG_DEVICE_PARAMETER_TYPE, pData: rawptr, DataSize: u32) -> HRESULT, - GetDebugParameter: proc "stdcall" (this: ^IDebugDevice1, Type: DEBUG_DEVICE_PARAMETER_TYPE, pData: rawptr, DataSize: u32) -> HRESULT, - ReportLiveDeviceObjects: proc "stdcall" (this: ^IDebugDevice1, Flags: RLDO_FLAGS) -> HRESULT, + SetDebugParameter: proc "system" (this: ^IDebugDevice1, Type: DEBUG_DEVICE_PARAMETER_TYPE, pData: rawptr, DataSize: u32) -> HRESULT, + GetDebugParameter: proc "system" (this: ^IDebugDevice1, Type: DEBUG_DEVICE_PARAMETER_TYPE, pData: rawptr, DataSize: u32) -> HRESULT, + ReportLiveDeviceObjects: proc "system" (this: ^IDebugDevice1, Flags: RLDO_FLAGS) -> HRESULT, } @@ -3840,9 +3840,9 @@ IDebugDevice :: struct #raw_union { } IDebugDevice_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - SetFeatureMask: proc "stdcall" (this: ^IDebugDevice, Mask: DEBUG_FEATURE) -> HRESULT, - GetFeatureMask: proc "stdcall" (this: ^IDebugDevice) -> DEBUG_FEATURE, - ReportLiveDeviceObjects: proc "stdcall" (this: ^IDebugDevice, Flags: RLDO_FLAGS) -> HRESULT, + SetFeatureMask: proc "system" (this: ^IDebugDevice, Mask: DEBUG_FEATURE) -> HRESULT, + GetFeatureMask: proc "system" (this: ^IDebugDevice) -> DEBUG_FEATURE, + ReportLiveDeviceObjects: proc "system" (this: ^IDebugDevice, Flags: RLDO_FLAGS) -> HRESULT, } @@ -3854,8 +3854,8 @@ IDebugDevice2 :: struct #raw_union { } IDebugDevice2_VTable :: struct { using id3d12debugdevice_vtable: IDebugDevice_VTable, - SetDebugParameter: proc "stdcall" (this: ^IDebugDevice2, Type: DEBUG_DEVICE_PARAMETER_TYPE, pData: rawptr, DataSize: u32) -> HRESULT, - GetDebugParameter: proc "stdcall" (this: ^IDebugDevice2, Type: DEBUG_DEVICE_PARAMETER_TYPE, pData: rawptr, DataSize: u32) -> HRESULT, + SetDebugParameter: proc "system" (this: ^IDebugDevice2, Type: DEBUG_DEVICE_PARAMETER_TYPE, pData: rawptr, DataSize: u32) -> HRESULT, + GetDebugParameter: proc "system" (this: ^IDebugDevice2, Type: DEBUG_DEVICE_PARAMETER_TYPE, pData: rawptr, DataSize: u32) -> HRESULT, } @@ -3867,7 +3867,7 @@ IDebugCommandQueue :: struct #raw_union { } IDebugCommandQueue_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - AssertResourceState: proc "stdcall" (this: ^IDebugCommandQueue, pResource: ^IResource, Subresource: u32, State: u32) -> BOOL, + AssertResourceState: proc "system" (this: ^IDebugCommandQueue, pResource: ^IResource, Subresource: u32, State: u32) -> BOOL, } DEBUG_COMMAND_LIST_PARAMETER_TYPE :: enum i32 { @@ -3887,9 +3887,9 @@ IDebugCommandList1 :: struct #raw_union { } IDebugCommandList1_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - AssertResourceState: proc "stdcall" (this: ^IDebugCommandList1, pResource: ^IResource, Subresource: u32, State: u32) -> BOOL, - SetDebugParameter: proc "stdcall" (this: ^IDebugCommandList1, Type: DEBUG_COMMAND_LIST_PARAMETER_TYPE, pData: rawptr, DataSize: u32) -> HRESULT, - GetDebugParameter: proc "stdcall" (this: ^IDebugCommandList1, Type: DEBUG_COMMAND_LIST_PARAMETER_TYPE, pData: rawptr, DataSize: u32) -> HRESULT, + AssertResourceState: proc "system" (this: ^IDebugCommandList1, pResource: ^IResource, Subresource: u32, State: u32) -> BOOL, + SetDebugParameter: proc "system" (this: ^IDebugCommandList1, Type: DEBUG_COMMAND_LIST_PARAMETER_TYPE, pData: rawptr, DataSize: u32) -> HRESULT, + GetDebugParameter: proc "system" (this: ^IDebugCommandList1, Type: DEBUG_COMMAND_LIST_PARAMETER_TYPE, pData: rawptr, DataSize: u32) -> HRESULT, } @@ -3901,9 +3901,9 @@ IDebugCommandList :: struct #raw_union { } IDebugCommandList_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - AssertResourceState: proc "stdcall" (this: ^IDebugCommandList, pResource: ^IResource, Subresource: u32, State: u32) -> BOOL, - SetFeatureMask: proc "stdcall" (this: ^IDebugCommandList, Mask: DEBUG_FEATURE) -> HRESULT, - GetFeatureMask: proc "stdcall" (this: ^IDebugCommandList) -> DEBUG_FEATURE, + AssertResourceState: proc "system" (this: ^IDebugCommandList, pResource: ^IResource, Subresource: u32, State: u32) -> BOOL, + SetFeatureMask: proc "system" (this: ^IDebugCommandList, Mask: DEBUG_FEATURE) -> HRESULT, + GetFeatureMask: proc "system" (this: ^IDebugCommandList) -> DEBUG_FEATURE, } @@ -3915,8 +3915,8 @@ IDebugCommandList2 :: struct #raw_union { } IDebugCommandList2_VTable :: struct { using id3d12debugcommandlist_vtable: IDebugCommandList_VTable, - SetDebugParameter: proc "stdcall" (this: ^IDebugCommandList2, Type: DEBUG_COMMAND_LIST_PARAMETER_TYPE, pData: rawptr, DataSize: u32) -> HRESULT, - GetDebugParameter: proc "stdcall" (this: ^IDebugCommandList2, Type: DEBUG_COMMAND_LIST_PARAMETER_TYPE, pData: rawptr, DataSize: u32) -> HRESULT, + SetDebugParameter: proc "system" (this: ^IDebugCommandList2, Type: DEBUG_COMMAND_LIST_PARAMETER_TYPE, pData: rawptr, DataSize: u32) -> HRESULT, + GetDebugParameter: proc "system" (this: ^IDebugCommandList2, Type: DEBUG_COMMAND_LIST_PARAMETER_TYPE, pData: rawptr, DataSize: u32) -> HRESULT, } @@ -3928,10 +3928,10 @@ ISharingContract :: struct #raw_union { } ISharingContract_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - Present: proc "stdcall" (this: ^ISharingContract, pResource: ^IResource, Subresource: u32, window: HWND), - SharedFenceSignal: proc "stdcall" (this: ^ISharingContract, pFence: ^IFence, FenceValue: u64), - BeginCapturableWork: proc "stdcall" (this: ^ISharingContract, guid: ^GUID), - EndCapturableWork: proc "stdcall" (this: ^ISharingContract, guid: ^GUID), + Present: proc "system" (this: ^ISharingContract, pResource: ^IResource, Subresource: u32, window: HWND), + SharedFenceSignal: proc "system" (this: ^ISharingContract, pFence: ^IFence, FenceValue: u64), + BeginCapturableWork: proc "system" (this: ^ISharingContract, guid: ^GUID), + EndCapturableWork: proc "system" (this: ^ISharingContract, guid: ^GUID), } MESSAGE_CATEGORY :: enum i32 { @@ -4834,41 +4834,41 @@ IInfoQueue :: struct #raw_union { } IInfoQueue_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - SetMessageCountLimit: proc "stdcall" (this: ^IInfoQueue, MessageCountLimit: u64) -> HRESULT, - ClearStoredMessages: proc "stdcall" (this: ^IInfoQueue), - GetMessageA: proc "stdcall" (this: ^IInfoQueue, MessageIndex: u64, pMessage: ^MESSAGE, pMessageByteLength: ^SIZE_T) -> HRESULT, - GetNumMessagesAllowedByStorageFilter: proc "stdcall" (this: ^IInfoQueue) -> u64, - GetNumMessagesDeniedByStorageFilter: proc "stdcall" (this: ^IInfoQueue) -> u64, - GetNumStoredMessages: proc "stdcall" (this: ^IInfoQueue) -> u64, - GetNumStoredMessagesAllowedByRetrievalFilter: proc "stdcall" (this: ^IInfoQueue) -> u64, - GetNumMessagesDiscardedByMessageCountLimit: proc "stdcall" (this: ^IInfoQueue) -> u64, - GetMessageCountLimit: proc "stdcall" (this: ^IInfoQueue) -> u64, - AddStorageFilterEntries: proc "stdcall" (this: ^IInfoQueue, pFilter: ^INFO_QUEUE_FILTER) -> HRESULT, - GetStorageFilter: proc "stdcall" (this: ^IInfoQueue, pFilter: ^INFO_QUEUE_FILTER, pFilterByteLength: ^SIZE_T) -> HRESULT, - ClearStorageFilter: proc "stdcall" (this: ^IInfoQueue), - PushEmptyStorageFilter: proc "stdcall" (this: ^IInfoQueue) -> HRESULT, - PushCopyOfStorageFilter: proc "stdcall" (this: ^IInfoQueue) -> HRESULT, - PushStorageFilter: proc "stdcall" (this: ^IInfoQueue, pFilter: ^INFO_QUEUE_FILTER) -> HRESULT, - PopStorageFilter: proc "stdcall" (this: ^IInfoQueue), - GetStorageFilterStackSize: proc "stdcall" (this: ^IInfoQueue) -> u32, - AddRetrievalFilterEntries: proc "stdcall" (this: ^IInfoQueue, pFilter: ^INFO_QUEUE_FILTER) -> HRESULT, - GetRetrievalFilter: proc "stdcall" (this: ^IInfoQueue, pFilter: ^INFO_QUEUE_FILTER, pFilterByteLength: ^SIZE_T) -> HRESULT, - ClearRetrievalFilter: proc "stdcall" (this: ^IInfoQueue), - PushEmptyRetrievalFilter: proc "stdcall" (this: ^IInfoQueue) -> HRESULT, - PushCopyOfRetrievalFilter: proc "stdcall" (this: ^IInfoQueue) -> HRESULT, - PushRetrievalFilter: proc "stdcall" (this: ^IInfoQueue, pFilter: ^INFO_QUEUE_FILTER) -> HRESULT, - PopRetrievalFilter: proc "stdcall" (this: ^IInfoQueue), - GetRetrievalFilterStackSize: proc "stdcall" (this: ^IInfoQueue) -> u32, - AddMessage: proc "stdcall" (this: ^IInfoQueue, Category: MESSAGE_CATEGORY, Severity: MESSAGE_SEVERITY, ID: MESSAGE_ID, pDescription: cstring) -> HRESULT, - AddApplicationMessage: proc "stdcall" (this: ^IInfoQueue, Severity: MESSAGE_SEVERITY, pDescription: cstring) -> HRESULT, - SetBreakOnCategory: proc "stdcall" (this: ^IInfoQueue, Category: MESSAGE_CATEGORY, bEnable: BOOL) -> HRESULT, - SetBreakOnSeverity: proc "stdcall" (this: ^IInfoQueue, Severity: MESSAGE_SEVERITY, bEnable: BOOL) -> HRESULT, - SetBreakOnID: proc "stdcall" (this: ^IInfoQueue, ID: MESSAGE_ID, bEnable: BOOL) -> HRESULT, - GetBreakOnCategory: proc "stdcall" (this: ^IInfoQueue, Category: MESSAGE_CATEGORY) -> BOOL, - GetBreakOnSeverity: proc "stdcall" (this: ^IInfoQueue, Severity: MESSAGE_SEVERITY) -> BOOL, - GetBreakOnID: proc "stdcall" (this: ^IInfoQueue, ID: MESSAGE_ID) -> BOOL, - SetMuteDebugOutput: proc "stdcall" (this: ^IInfoQueue, bMute: BOOL), - GetMuteDebugOutput: proc "stdcall" (this: ^IInfoQueue) -> BOOL, + SetMessageCountLimit: proc "system" (this: ^IInfoQueue, MessageCountLimit: u64) -> HRESULT, + ClearStoredMessages: proc "system" (this: ^IInfoQueue), + GetMessageA: proc "system" (this: ^IInfoQueue, MessageIndex: u64, pMessage: ^MESSAGE, pMessageByteLength: ^SIZE_T) -> HRESULT, + GetNumMessagesAllowedByStorageFilter: proc "system" (this: ^IInfoQueue) -> u64, + GetNumMessagesDeniedByStorageFilter: proc "system" (this: ^IInfoQueue) -> u64, + GetNumStoredMessages: proc "system" (this: ^IInfoQueue) -> u64, + GetNumStoredMessagesAllowedByRetrievalFilter: proc "system" (this: ^IInfoQueue) -> u64, + GetNumMessagesDiscardedByMessageCountLimit: proc "system" (this: ^IInfoQueue) -> u64, + GetMessageCountLimit: proc "system" (this: ^IInfoQueue) -> u64, + AddStorageFilterEntries: proc "system" (this: ^IInfoQueue, pFilter: ^INFO_QUEUE_FILTER) -> HRESULT, + GetStorageFilter: proc "system" (this: ^IInfoQueue, pFilter: ^INFO_QUEUE_FILTER, pFilterByteLength: ^SIZE_T) -> HRESULT, + ClearStorageFilter: proc "system" (this: ^IInfoQueue), + PushEmptyStorageFilter: proc "system" (this: ^IInfoQueue) -> HRESULT, + PushCopyOfStorageFilter: proc "system" (this: ^IInfoQueue) -> HRESULT, + PushStorageFilter: proc "system" (this: ^IInfoQueue, pFilter: ^INFO_QUEUE_FILTER) -> HRESULT, + PopStorageFilter: proc "system" (this: ^IInfoQueue), + GetStorageFilterStackSize: proc "system" (this: ^IInfoQueue) -> u32, + AddRetrievalFilterEntries: proc "system" (this: ^IInfoQueue, pFilter: ^INFO_QUEUE_FILTER) -> HRESULT, + GetRetrievalFilter: proc "system" (this: ^IInfoQueue, pFilter: ^INFO_QUEUE_FILTER, pFilterByteLength: ^SIZE_T) -> HRESULT, + ClearRetrievalFilter: proc "system" (this: ^IInfoQueue), + PushEmptyRetrievalFilter: proc "system" (this: ^IInfoQueue) -> HRESULT, + PushCopyOfRetrievalFilter: proc "system" (this: ^IInfoQueue) -> HRESULT, + PushRetrievalFilter: proc "system" (this: ^IInfoQueue, pFilter: ^INFO_QUEUE_FILTER) -> HRESULT, + PopRetrievalFilter: proc "system" (this: ^IInfoQueue), + GetRetrievalFilterStackSize: proc "system" (this: ^IInfoQueue) -> u32, + AddMessage: proc "system" (this: ^IInfoQueue, Category: MESSAGE_CATEGORY, Severity: MESSAGE_SEVERITY, ID: MESSAGE_ID, pDescription: cstring) -> HRESULT, + AddApplicationMessage: proc "system" (this: ^IInfoQueue, Severity: MESSAGE_SEVERITY, pDescription: cstring) -> HRESULT, + SetBreakOnCategory: proc "system" (this: ^IInfoQueue, Category: MESSAGE_CATEGORY, bEnable: BOOL) -> HRESULT, + SetBreakOnSeverity: proc "system" (this: ^IInfoQueue, Severity: MESSAGE_SEVERITY, bEnable: BOOL) -> HRESULT, + SetBreakOnID: proc "system" (this: ^IInfoQueue, ID: MESSAGE_ID, bEnable: BOOL) -> HRESULT, + GetBreakOnCategory: proc "system" (this: ^IInfoQueue, Category: MESSAGE_CATEGORY) -> BOOL, + GetBreakOnSeverity: proc "system" (this: ^IInfoQueue, Severity: MESSAGE_SEVERITY) -> BOOL, + GetBreakOnID: proc "system" (this: ^IInfoQueue, ID: MESSAGE_ID) -> BOOL, + SetMuteDebugOutput: proc "system" (this: ^IInfoQueue, bMute: BOOL), + GetMuteDebugOutput: proc "system" (this: ^IInfoQueue) -> BOOL, } MESSAGE_CALLBACK_FLAGS :: distinct bit_set[MESSAGE_CALLBACK_FLAG; u32] @@ -4886,8 +4886,8 @@ IInfoQueue1 :: struct #raw_union { } IInfoQueue1_VTable :: struct { using idxgiinfoqueue_vtable: IInfoQueue_VTable, - RegisterMessageCallback: proc "stdcall" (this: ^IInfoQueue1, CallbackFunc: PFN_MESSAGE_CALLBACK, CallbackFilterFlags: MESSAGE_CALLBACK_FLAGS, pContext: rawptr, pCallbackCookie: ^u32) -> HRESULT, - UnregisterMessageCallback: proc "stdcall" (this: ^IInfoQueue1, pCallbackCookie: u32) -> HRESULT, + RegisterMessageCallback: proc "system" (this: ^IInfoQueue1, CallbackFunc: PFN_MESSAGE_CALLBACK, CallbackFilterFlags: MESSAGE_CALLBACK_FLAGS, pContext: rawptr, pCallbackCookie: ^u32) -> HRESULT, + UnregisterMessageCallback: proc "system" (this: ^IInfoQueue1, pCallbackCookie: u32) -> HRESULT, } PFN_CREATE_DEVICE :: #type proc "c" (a0: ^IUnknown, a1: FEATURE_LEVEL, a2: ^IID, a3: ^rawptr) -> HRESULT @@ -4926,8 +4926,8 @@ IGraphicsCommandList5 :: struct #raw_union { } IGraphicsCommandList5_VTable :: struct { using id3d12graphicscommandlist4_vtable: IGraphicsCommandList4_VTable, - RSSetShadingRate: proc "stdcall" (this: ^IGraphicsCommandList5, baseShadingRate: SHADING_RATE, combiners: ^SHADING_RATE_COMBINER), - RSSetShadingRateImage: proc "stdcall" (this: ^IGraphicsCommandList5, shadingRateImage: ^IResource), + RSSetShadingRate: proc "system" (this: ^IGraphicsCommandList5, baseShadingRate: SHADING_RATE, combiners: ^SHADING_RATE_COMBINER), + RSSetShadingRateImage: proc "system" (this: ^IGraphicsCommandList5, shadingRateImage: ^IResource), } DISPATCH_MESH_ARGUMENTS :: struct { @@ -4945,7 +4945,7 @@ IGraphicsCommandList6 :: struct #raw_union { } IGraphicsCommandList6_VTable :: struct { using id3d12graphicscommandlist5_vtable: IGraphicsCommandList5_VTable, - DispatchMesh: proc "stdcall" (this: ^IGraphicsCommandList6, ThreadGroupCountX: u32, ThreadGroupCountY: u32, ThreadGroupCountZ: u32), + DispatchMesh: proc "system" (this: ^IGraphicsCommandList6, ThreadGroupCountX: u32, ThreadGroupCountY: u32, ThreadGroupCountZ: u32), } SHADER_VERSION_TYPE :: enum u32 { @@ -5187,17 +5187,17 @@ IShaderReflectionType :: struct { using id3d12shaderreflectiontype_vtable: ^IShaderReflectionType_VTable, } IShaderReflectionType_VTable :: struct { - GetDesc: proc "stdcall" (this: ^IShaderReflectionType, pDesc: ^SHADER_TYPE_DESC) -> HRESULT, - GetMemberTypeByIndex: proc "stdcall" (this: ^IShaderReflectionType, Index: u32) -> ^IShaderReflectionType, - GetMemberTypeByName: proc "stdcall" (this: ^IShaderReflectionType, Name: cstring) -> ^IShaderReflectionType, - GetMemberTypeName: proc "stdcall" (this: ^IShaderReflectionType, Index: u32) -> cstring, - IsEqual: proc "stdcall" (this: ^IShaderReflectionType, pType: ^IShaderReflectionType) -> HRESULT, - GetSubType: proc "stdcall" (this: ^IShaderReflectionType) -> ^IShaderReflectionType, - GetBaseClass: proc "stdcall" (this: ^IShaderReflectionType) -> ^IShaderReflectionType, - GetNumInterfaces: proc "stdcall" (this: ^IShaderReflectionType) -> u32, - GetInterfaceByIndex: proc "stdcall" (this: ^IShaderReflectionType, uIndex: u32) -> ^IShaderReflectionType, - IsOfType: proc "stdcall" (this: ^IShaderReflectionType, pType: ^IShaderReflectionType) -> HRESULT, - ImplementsInterface: proc "stdcall" (this: ^IShaderReflectionType, pBase: ^IShaderReflectionType) -> HRESULT, + GetDesc: proc "system" (this: ^IShaderReflectionType, pDesc: ^SHADER_TYPE_DESC) -> HRESULT, + GetMemberTypeByIndex: proc "system" (this: ^IShaderReflectionType, Index: u32) -> ^IShaderReflectionType, + GetMemberTypeByName: proc "system" (this: ^IShaderReflectionType, Name: cstring) -> ^IShaderReflectionType, + GetMemberTypeName: proc "system" (this: ^IShaderReflectionType, Index: u32) -> cstring, + IsEqual: proc "system" (this: ^IShaderReflectionType, pType: ^IShaderReflectionType) -> HRESULT, + GetSubType: proc "system" (this: ^IShaderReflectionType) -> ^IShaderReflectionType, + GetBaseClass: proc "system" (this: ^IShaderReflectionType) -> ^IShaderReflectionType, + GetNumInterfaces: proc "system" (this: ^IShaderReflectionType) -> u32, + GetInterfaceByIndex: proc "system" (this: ^IShaderReflectionType, uIndex: u32) -> ^IShaderReflectionType, + IsOfType: proc "system" (this: ^IShaderReflectionType, pType: ^IShaderReflectionType) -> HRESULT, + ImplementsInterface: proc "system" (this: ^IShaderReflectionType, pBase: ^IShaderReflectionType) -> HRESULT, } IShaderReflectionVariable_UUID_STRING :: "8337A8A6-A216-444A-B2F4-314733A73AEA" @@ -5206,10 +5206,10 @@ IShaderReflectionVariable :: struct { using id3d12shaderreflectionvariable_vtable: ^IShaderReflectionVariable_VTable, } IShaderReflectionVariable_VTable :: struct { - GetDesc: proc "stdcall" (this: ^IShaderReflectionVariable, pDesc: ^SHADER_VARIABLE_DESC) -> HRESULT, - GetType: proc "stdcall" (this: ^IShaderReflectionVariable) -> ^IShaderReflectionType, - GetBuffer: proc "stdcall" (this: ^IShaderReflectionVariable) -> ^IShaderReflectionConstantBuffer, - GetInterfaceSlot: proc "stdcall" (this: ^IShaderReflectionVariable, uArrayIndex: u32) -> u32, + GetDesc: proc "system" (this: ^IShaderReflectionVariable, pDesc: ^SHADER_VARIABLE_DESC) -> HRESULT, + GetType: proc "system" (this: ^IShaderReflectionVariable) -> ^IShaderReflectionType, + GetBuffer: proc "system" (this: ^IShaderReflectionVariable) -> ^IShaderReflectionConstantBuffer, + GetInterfaceSlot: proc "system" (this: ^IShaderReflectionVariable, uArrayIndex: u32) -> u32, } IShaderReflectionConstantBuffer_UUID_STRING :: "C59598B4-48B3-4869-B9B1-B1618B14A8B7" @@ -5218,9 +5218,9 @@ IShaderReflectionConstantBuffer :: struct { using id3d12shaderreflectionconstantbuffer_vtable: ^IShaderReflectionConstantBuffer_VTable, } IShaderReflectionConstantBuffer_VTable :: struct { - GetDesc: proc "stdcall" (this: ^IShaderReflectionConstantBuffer, pDesc: ^SHADER_BUFFER_DESC) -> HRESULT, - GetVariableByIndex: proc "stdcall" (this: ^IShaderReflectionConstantBuffer, Index: u32) -> ^IShaderReflectionVariable, - GetVariableByName: proc "stdcall" (this: ^IShaderReflectionConstantBuffer, Name: cstring) -> ^IShaderReflectionVariable, + GetDesc: proc "system" (this: ^IShaderReflectionConstantBuffer, pDesc: ^SHADER_BUFFER_DESC) -> HRESULT, + GetVariableByIndex: proc "system" (this: ^IShaderReflectionConstantBuffer, Index: u32) -> ^IShaderReflectionVariable, + GetVariableByName: proc "system" (this: ^IShaderReflectionConstantBuffer, Name: cstring) -> ^IShaderReflectionVariable, } IShaderReflection_UUID_STRING :: "5A58797D-A72C-478D-8BA2-EFC6B0EFE88E" @@ -5231,25 +5231,25 @@ IShaderReflection :: struct #raw_union { } IShaderReflection_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - GetDesc: proc "stdcall" (this: ^IShaderReflection, pDesc: ^SHADER_DESC) -> HRESULT, - GetConstantBufferByIndex: proc "stdcall" (this: ^IShaderReflection, Index: u32) -> ^IShaderReflectionConstantBuffer, - GetConstantBufferByName: proc "stdcall" (this: ^IShaderReflection, Name: cstring) -> ^IShaderReflectionConstantBuffer, - GetResourceBindingDesc: proc "stdcall" (this: ^IShaderReflection, ResourceIndex: u32, pDesc: ^SHADER_INPUT_BIND_DESC) -> HRESULT, - GetInputParameterDesc: proc "stdcall" (this: ^IShaderReflection, ParameterIndex: u32, pDesc: ^SIGNATURE_PARAMETER_DESC) -> HRESULT, - GetOutputParameterDesc: proc "stdcall" (this: ^IShaderReflection, ParameterIndex: u32, pDesc: ^SIGNATURE_PARAMETER_DESC) -> HRESULT, - GetPatchConstantParameterDesc: proc "stdcall" (this: ^IShaderReflection, ParameterIndex: u32, pDesc: ^SIGNATURE_PARAMETER_DESC) -> HRESULT, - GetVariableByName: proc "stdcall" (this: ^IShaderReflection, Name: cstring) -> ^IShaderReflectionVariable, - GetResourceBindingDescByName: proc "stdcall" (this: ^IShaderReflection, Name: cstring, pDesc: ^SHADER_INPUT_BIND_DESC) -> HRESULT, - GetMovInstructionCount: proc "stdcall" (this: ^IShaderReflection) -> u32, - GetMovcInstructionCount: proc "stdcall" (this: ^IShaderReflection) -> u32, - GetConversionInstructionCount: proc "stdcall" (this: ^IShaderReflection) -> u32, - GetBitwiseInstructionCount: proc "stdcall" (this: ^IShaderReflection) -> u32, - GetGSInputPrimitive: proc "stdcall" (this: ^IShaderReflection) -> PRIMITIVE, - IsSampleFrequencyShader: proc "stdcall" (this: ^IShaderReflection) -> BOOL, - GetNumInterfaceSlots: proc "stdcall" (this: ^IShaderReflection) -> u32, - GetMinFeatureLevel: proc "stdcall" (this: ^IShaderReflection, pLevel: ^FEATURE_LEVEL) -> HRESULT, - GetThreadGroupSize: proc "stdcall" (this: ^IShaderReflection, pSizeX: ^u32, pSizeY: ^u32, pSizeZ: ^u32) -> u32, - GetRequiresFlags: proc "stdcall" (this: ^IShaderReflection) -> SHADER_REQUIRES_FLAGS, + GetDesc: proc "system" (this: ^IShaderReflection, pDesc: ^SHADER_DESC) -> HRESULT, + GetConstantBufferByIndex: proc "system" (this: ^IShaderReflection, Index: u32) -> ^IShaderReflectionConstantBuffer, + GetConstantBufferByName: proc "system" (this: ^IShaderReflection, Name: cstring) -> ^IShaderReflectionConstantBuffer, + GetResourceBindingDesc: proc "system" (this: ^IShaderReflection, ResourceIndex: u32, pDesc: ^SHADER_INPUT_BIND_DESC) -> HRESULT, + GetInputParameterDesc: proc "system" (this: ^IShaderReflection, ParameterIndex: u32, pDesc: ^SIGNATURE_PARAMETER_DESC) -> HRESULT, + GetOutputParameterDesc: proc "system" (this: ^IShaderReflection, ParameterIndex: u32, pDesc: ^SIGNATURE_PARAMETER_DESC) -> HRESULT, + GetPatchConstantParameterDesc: proc "system" (this: ^IShaderReflection, ParameterIndex: u32, pDesc: ^SIGNATURE_PARAMETER_DESC) -> HRESULT, + GetVariableByName: proc "system" (this: ^IShaderReflection, Name: cstring) -> ^IShaderReflectionVariable, + GetResourceBindingDescByName: proc "system" (this: ^IShaderReflection, Name: cstring, pDesc: ^SHADER_INPUT_BIND_DESC) -> HRESULT, + GetMovInstructionCount: proc "system" (this: ^IShaderReflection) -> u32, + GetMovcInstructionCount: proc "system" (this: ^IShaderReflection) -> u32, + GetConversionInstructionCount: proc "system" (this: ^IShaderReflection) -> u32, + GetBitwiseInstructionCount: proc "system" (this: ^IShaderReflection) -> u32, + GetGSInputPrimitive: proc "system" (this: ^IShaderReflection) -> PRIMITIVE, + IsSampleFrequencyShader: proc "system" (this: ^IShaderReflection) -> BOOL, + GetNumInterfaceSlots: proc "system" (this: ^IShaderReflection) -> u32, + GetMinFeatureLevel: proc "system" (this: ^IShaderReflection, pLevel: ^FEATURE_LEVEL) -> HRESULT, + GetThreadGroupSize: proc "system" (this: ^IShaderReflection, pSizeX: ^u32, pSizeY: ^u32, pSizeZ: ^u32) -> u32, + GetRequiresFlags: proc "system" (this: ^IShaderReflection) -> SHADER_REQUIRES_FLAGS, } ILibraryReflection_UUID_STRING :: "8E349D19-54DB-4A56-9DC9-119D87BDB804" @@ -5260,8 +5260,8 @@ ILibraryReflection :: struct #raw_union { } ILibraryReflection_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - GetDesc: proc "stdcall" (this: ^ILibraryReflection, pDesc: ^LIBRARY_DESC) -> HRESULT, - GetFunctionByIndex: proc "stdcall" (this: ^ILibraryReflection, FunctionIndex: i32) -> ^IFunctionReflection, + GetDesc: proc "system" (this: ^ILibraryReflection, pDesc: ^LIBRARY_DESC) -> HRESULT, + GetFunctionByIndex: proc "system" (this: ^ILibraryReflection, FunctionIndex: i32) -> ^IFunctionReflection, } IFunctionReflection_UUID_STRING :: "1108795C-2772-4BA9-B2A8-D464DC7E2799" @@ -5270,13 +5270,13 @@ IFunctionReflection :: struct { using id3d12functionreflection_vtable: ^IFunctionReflection_VTable, } IFunctionReflection_VTable :: struct { - GetDesc: proc "stdcall" (this: ^IFunctionReflection, pDesc: ^FUNCTION_DESC) -> HRESULT, - GetConstantBufferByIndex: proc "stdcall" (this: ^IFunctionReflection, BufferIndex: u32) -> ^IShaderReflectionConstantBuffer, - GetConstantBufferByName: proc "stdcall" (this: ^IFunctionReflection, Name: cstring) -> ^IShaderReflectionConstantBuffer, - GetResourceBindingDesc: proc "stdcall" (this: ^IFunctionReflection, ResourceIndex: u32, pDesc: ^SHADER_INPUT_BIND_DESC) -> HRESULT, - GetVariableByName: proc "stdcall" (this: ^IFunctionReflection, Name: cstring) -> ^IShaderReflectionVariable, - GetResourceBindingDescByName: proc "stdcall" (this: ^IFunctionReflection, Name: cstring, pDesc: ^SHADER_INPUT_BIND_DESC) -> HRESULT, - GetFunctionParameter: proc "stdcall" (this: ^IFunctionReflection, ParameterIndex: i32) -> ^IFunctionParameterReflection, + GetDesc: proc "system" (this: ^IFunctionReflection, pDesc: ^FUNCTION_DESC) -> HRESULT, + GetConstantBufferByIndex: proc "system" (this: ^IFunctionReflection, BufferIndex: u32) -> ^IShaderReflectionConstantBuffer, + GetConstantBufferByName: proc "system" (this: ^IFunctionReflection, Name: cstring) -> ^IShaderReflectionConstantBuffer, + GetResourceBindingDesc: proc "system" (this: ^IFunctionReflection, ResourceIndex: u32, pDesc: ^SHADER_INPUT_BIND_DESC) -> HRESULT, + GetVariableByName: proc "system" (this: ^IFunctionReflection, Name: cstring) -> ^IShaderReflectionVariable, + GetResourceBindingDescByName: proc "system" (this: ^IFunctionReflection, Name: cstring, pDesc: ^SHADER_INPUT_BIND_DESC) -> HRESULT, + GetFunctionParameter: proc "system" (this: ^IFunctionReflection, ParameterIndex: i32) -> ^IFunctionParameterReflection, } IFunctionParameterReflection_UUID_STRING :: "EC25F42D-7006-4F2B-B33E-02CC3375733F" @@ -5285,5 +5285,5 @@ IFunctionParameterReflection :: struct { using id3d12functionparameterreflection_vtable: ^IFunctionParameterReflection_VTable, } IFunctionParameterReflection_VTable :: struct { - GetDesc: proc "stdcall" (this: ^IFunctionParameterReflection, pDesc: ^PARAMETER_DESC) -> HRESULT, + GetDesc: proc "system" (this: ^IFunctionParameterReflection, pDesc: ^PARAMETER_DESC) -> HRESULT, } diff --git a/vendor/directx/d3d_compiler/d3d_compiler.odin b/vendor/directx/d3d_compiler/d3d_compiler.odin index 90af520c2..f54ba3555 100644 --- a/vendor/directx/d3d_compiler/d3d_compiler.odin +++ b/vendor/directx/d3d_compiler/d3d_compiler.odin @@ -15,7 +15,7 @@ HRESULT :: dxgi.HRESULT IUnknown :: dxgi.IUnknown IUnknown_VTable :: dxgi.IUnknown_VTable -@(default_calling_convention="stdcall", link_prefix="D3D") +@(default_calling_convention="system", link_prefix="D3D") foreign d3dcompiler { ReadFileToBlob :: proc(pFileName: [^]u16, ppContents: ^^ID3DBlob) -> HRESULT --- WriteBlobToFile :: proc(pBlob: ^ID3DBlob, pFileName: [^]u16, bOverwrite: BOOL) -> HRESULT --- @@ -124,8 +124,8 @@ ID3D10Blob :: struct #raw_union { } ID3D10Blob_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - GetBufferPointer: proc "stdcall" (this: ^ID3D10Blob) -> rawptr, - GetBufferSize: proc "stdcall" (this: ^ID3D10Blob) -> SIZE_T, + GetBufferPointer: proc "system" (this: ^ID3D10Blob) -> rawptr, + GetBufferSize: proc "system" (this: ^ID3D10Blob) -> SIZE_T, } @@ -145,8 +145,8 @@ ID3DInclude :: struct { vtable: ^ID3DInclude_VTable, } ID3DInclude_VTable :: struct { - Open: proc "stdcall" (this: ^ID3DInclude, IncludeType: INCLUDE_TYPE, pFileName: cstring, pParentData: rawptr, ppData: ^rawptr, pBytes: ^u32) -> HRESULT, - Close: proc "stdcall" (this: ^ID3DInclude, pData: rawptr) -> HRESULT, + Open: proc "system" (this: ^ID3DInclude, IncludeType: INCLUDE_TYPE, pFileName: cstring, pParentData: rawptr, ppData: ^rawptr, pBytes: ^u32) -> HRESULT, + Close: proc "system" (this: ^ID3DInclude, pData: rawptr) -> HRESULT, } // Default file includer @@ -159,7 +159,7 @@ ID3D11Module :: struct #raw_union { } ID3D11Module_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - CreateInstance: proc "stdcall" (this: ^ID3D11Module, pNamespace: cstring, ppModuleInstance: ^^ID3D11ModuleInstance) -> HRESULT, + CreateInstance: proc "system" (this: ^ID3D11Module, pNamespace: cstring, ppModuleInstance: ^^ID3D11ModuleInstance) -> HRESULT, } @@ -169,16 +169,16 @@ ID3D11ModuleInstance :: struct #raw_union { } ID3D11ModuleInstance_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - BindConstantBuffer: proc "stdcall" (this: ^ID3D11ModuleInstance, uSrcSlot: u32, uDstSlot: u32, cbDstOffset: u32) -> HRESULT, - BindConstantBufferByName: proc "stdcall" (this: ^ID3D11ModuleInstance, pName: cstring, uDstSlot: u32, cbDstOffset: u32) -> HRESULT, - BindResource: proc "stdcall" (this: ^ID3D11ModuleInstance, uSrcSlot: u32, uDstSlot: u32, uCount: u32) -> HRESULT, - BindResourceByName: proc "stdcall" (this: ^ID3D11ModuleInstance, pName: cstring, uDstSlot: u32, uCount: u32) -> HRESULT, - BindSampler: proc "stdcall" (this: ^ID3D11ModuleInstance, uSrcSlot: u32, uDstSlot: u32, uCount: u32) -> HRESULT, - BindSamplerByName: proc "stdcall" (this: ^ID3D11ModuleInstance, pName: cstring, uDstSlot: u32, uCount: u32) -> HRESULT, - BindUnorderedAccessView: proc "stdcall" (this: ^ID3D11ModuleInstance, uSrcSlot: u32, uDstSlot: u32, uCount: u32) -> HRESULT, - BindUnorderedAccessViewByName: proc "stdcall" (this: ^ID3D11ModuleInstance, pName: cstring, uDstSlot: u32, uCount: u32) -> HRESULT, - BindResourceAsUnorderedAccessView: proc "stdcall" (this: ^ID3D11ModuleInstance, uSrcSrvSlot: u32, uDstUavSlot: u32, uCount: u32) -> HRESULT, - BindResourceAsUnorderedAccessViewByName: proc "stdcall" (this: ^ID3D11ModuleInstance, pSrvName: cstring, uDstUavSlot: u32, uCount: u32) -> HRESULT, + BindConstantBuffer: proc "system" (this: ^ID3D11ModuleInstance, uSrcSlot: u32, uDstSlot: u32, cbDstOffset: u32) -> HRESULT, + BindConstantBufferByName: proc "system" (this: ^ID3D11ModuleInstance, pName: cstring, uDstSlot: u32, cbDstOffset: u32) -> HRESULT, + BindResource: proc "system" (this: ^ID3D11ModuleInstance, uSrcSlot: u32, uDstSlot: u32, uCount: u32) -> HRESULT, + BindResourceByName: proc "system" (this: ^ID3D11ModuleInstance, pName: cstring, uDstSlot: u32, uCount: u32) -> HRESULT, + BindSampler: proc "system" (this: ^ID3D11ModuleInstance, uSrcSlot: u32, uDstSlot: u32, uCount: u32) -> HRESULT, + BindSamplerByName: proc "system" (this: ^ID3D11ModuleInstance, pName: cstring, uDstSlot: u32, uCount: u32) -> HRESULT, + BindUnorderedAccessView: proc "system" (this: ^ID3D11ModuleInstance, uSrcSlot: u32, uDstSlot: u32, uCount: u32) -> HRESULT, + BindUnorderedAccessViewByName: proc "system" (this: ^ID3D11ModuleInstance, pName: cstring, uDstSlot: u32, uCount: u32) -> HRESULT, + BindResourceAsUnorderedAccessView: proc "system" (this: ^ID3D11ModuleInstance, uSrcSrvSlot: u32, uDstUavSlot: u32, uCount: u32) -> HRESULT, + BindResourceAsUnorderedAccessViewByName: proc "system" (this: ^ID3D11ModuleInstance, pSrvName: cstring, uDstUavSlot: u32, uCount: u32) -> HRESULT, } @@ -188,9 +188,9 @@ ID3D11Linker :: struct #raw_union { } ID3D11Linker_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - Link: proc "stdcall" (this: ^ID3D11Linker, pEntry: ^ID3D11ModuleInstance, pEntryName: cstring, pTargetName: cstring, uFlags: u32, ppShaderBlob: ^^ID3DBlob, ppErrorBuffer: ^^ID3DBlob) -> HRESULT, - UseLibrary: proc "stdcall" (this: ^ID3D11Linker, pLibraryMI: ^ID3D11ModuleInstance) -> HRESULT, - AddClipPlaneFromCBuffer: proc "stdcall" (this: ^ID3D11Linker, uCBufferSlot: u32, uCBufferEntry: u32) -> HRESULT, + Link: proc "system" (this: ^ID3D11Linker, pEntry: ^ID3D11ModuleInstance, pEntryName: cstring, pTargetName: cstring, uFlags: u32, ppShaderBlob: ^^ID3DBlob, ppErrorBuffer: ^^ID3DBlob) -> HRESULT, + UseLibrary: proc "system" (this: ^ID3D11Linker, pLibraryMI: ^ID3D11ModuleInstance) -> HRESULT, + AddClipPlaneFromCBuffer: proc "system" (this: ^ID3D11Linker, uCBufferSlot: u32, uCBufferEntry: u32) -> HRESULT, } diff --git a/vendor/directx/dxgi/dxgi.odin b/vendor/directx/dxgi/dxgi.odin index e8c111b21..5412747bc 100644 --- a/vendor/directx/dxgi/dxgi.odin +++ b/vendor/directx/dxgi/dxgi.odin @@ -31,12 +31,12 @@ IUnknown :: struct { using _iunknown_vtable: ^IUnknown_VTable, } IUnknown_VTable :: struct { - QueryInterface: proc "stdcall" (this: ^IUnknown, riid: ^IID, ppvObject: ^rawptr) -> HRESULT, - AddRef: proc "stdcall" (this: ^IUnknown) -> ULONG, - Release: proc "stdcall" (this: ^IUnknown) -> ULONG, + QueryInterface: proc "system" (this: ^IUnknown, riid: ^IID, ppvObject: ^rawptr) -> HRESULT, + AddRef: proc "system" (this: ^IUnknown) -> ULONG, + Release: proc "system" (this: ^IUnknown) -> ULONG, } -@(default_calling_convention="stdcall") +@(default_calling_convention="system") foreign dxgi { CreateDXGIFactory :: proc(riid: ^IID, ppFactory: ^rawptr) -> HRESULT --- CreateDXGIFactory1 :: proc(riid: ^IID, ppFactory: ^rawptr) -> HRESULT --- @@ -466,10 +466,10 @@ IObject :: struct #raw_union { } IObject_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - SetPrivateData: proc "stdcall" (this: ^IObject, Name: ^GUID, DataSize: u32, pData: rawptr) -> HRESULT, - SetPrivateDataInterface: proc "stdcall" (this: ^IObject, Name: ^GUID, pUnknown: ^IUnknown) -> HRESULT, - GetPrivateData: proc "stdcall" (this: ^IObject, Name: ^GUID, pDataSize: ^u32, pData: rawptr) -> HRESULT, - GetParent: proc "stdcall" (this: ^IObject, riid: ^IID, ppParent: ^rawptr) -> HRESULT, + SetPrivateData: proc "system" (this: ^IObject, Name: ^GUID, DataSize: u32, pData: rawptr) -> HRESULT, + SetPrivateDataInterface: proc "system" (this: ^IObject, Name: ^GUID, pUnknown: ^IUnknown) -> HRESULT, + GetPrivateData: proc "system" (this: ^IObject, Name: ^GUID, pDataSize: ^u32, pData: rawptr) -> HRESULT, + GetParent: proc "system" (this: ^IObject, riid: ^IID, ppParent: ^rawptr) -> HRESULT, } IDeviceSubObject_UUID_STRING :: "3D3E0379-F9DE-4D58-BB6C-18D62992F1A6" @@ -480,7 +480,7 @@ IDeviceSubObject :: struct #raw_union { } IDeviceSubObject_VTable :: struct { using idxgiobject_vtable: IObject_VTable, - GetDevice: proc "stdcall" (this: ^IDeviceSubObject, riid: ^IID, ppDevice: ^rawptr) -> HRESULT, + GetDevice: proc "system" (this: ^IDeviceSubObject, riid: ^IID, ppDevice: ^rawptr) -> HRESULT, } IResource_UUID_STRING :: "035F3AB4-482E-4E50-B41F-8A7F8BD8960B" @@ -491,10 +491,10 @@ IResource :: struct #raw_union { } IResource_VTable :: struct { using idxgidevicesubobject_vtable: IDeviceSubObject_VTable, - GetSharedHandle: proc "stdcall" (this: ^IResource, pSharedHandle: ^HANDLE) -> HRESULT, - GetUsage: proc "stdcall" (this: ^IResource, pUsage: ^USAGE) -> HRESULT, - SetEvictionPriority: proc "stdcall" (this: ^IResource, EvictionPriority: RESOURCE_PRIORITY) -> HRESULT, - GetEvictionPriority: proc "stdcall" (this: ^IResource, pEvictionPriority: ^RESOURCE_PRIORITY) -> HRESULT, + GetSharedHandle: proc "system" (this: ^IResource, pSharedHandle: ^HANDLE) -> HRESULT, + GetUsage: proc "system" (this: ^IResource, pUsage: ^USAGE) -> HRESULT, + SetEvictionPriority: proc "system" (this: ^IResource, EvictionPriority: RESOURCE_PRIORITY) -> HRESULT, + GetEvictionPriority: proc "system" (this: ^IResource, pEvictionPriority: ^RESOURCE_PRIORITY) -> HRESULT, } IKeyedMutex_UUID_STRING :: "9D8E1289-D7B3-465F-8126-250E349AF85D" @@ -505,8 +505,8 @@ IKeyedMutex :: struct #raw_union { } IKeyedMutex_VTable :: struct { using idxgidevicesubobject_vtable: IDeviceSubObject_VTable, - AcquireSync: proc "stdcall" (this: ^IKeyedMutex, Key: u64, dwMilliseconds: u32) -> HRESULT, - ReleaseSync: proc "stdcall" (this: ^IKeyedMutex, Key: u64) -> HRESULT, + AcquireSync: proc "system" (this: ^IKeyedMutex, Key: u64, dwMilliseconds: u32) -> HRESULT, + ReleaseSync: proc "system" (this: ^IKeyedMutex, Key: u64) -> HRESULT, } ISurface_UUID_STRING :: "CAFCB56C-6AC3-4889-BF47-9E23BBD260EC" @@ -517,9 +517,9 @@ ISurface :: struct #raw_union { } ISurface_VTable :: struct { using idxgidevicesubobject_vtable: IDeviceSubObject_VTable, - GetDesc: proc "stdcall" (this: ^ISurface, pDesc: ^SURFACE_DESC) -> HRESULT, - Map: proc "stdcall" (this: ^ISurface, pLockedRect: ^MAPPED_RECT, MapFlags: MAP) -> HRESULT, - Unmap: proc "stdcall" (this: ^ISurface) -> HRESULT, + GetDesc: proc "system" (this: ^ISurface, pDesc: ^SURFACE_DESC) -> HRESULT, + Map: proc "system" (this: ^ISurface, pLockedRect: ^MAPPED_RECT, MapFlags: MAP) -> HRESULT, + Unmap: proc "system" (this: ^ISurface) -> HRESULT, } ISurface1_UUID_STRING :: "4AE63092-6327-4C1B-80AE-BFE12EA32B86" @@ -530,8 +530,8 @@ ISurface1 :: struct #raw_union { } ISurface1_VTable :: struct { using idxgisurface_vtable: ISurface_VTable, - GetDC: proc "stdcall" (this: ^ISurface1, Discard: BOOL, phdc: ^HDC) -> HRESULT, - ReleaseDC: proc "stdcall" (this: ^ISurface1, pDirtyRect: ^RECT) -> HRESULT, + GetDC: proc "system" (this: ^ISurface1, Discard: BOOL, phdc: ^HDC) -> HRESULT, + ReleaseDC: proc "system" (this: ^ISurface1, pDirtyRect: ^RECT) -> HRESULT, } IAdapter_UUID_STRING :: "2411E7E1-12AC-4CCF-BD14-9798E8534DC0" @@ -542,9 +542,9 @@ IAdapter :: struct #raw_union { } IAdapter_VTable :: struct { using idxgiobject_vtable: IObject_VTable, - EnumOutputs: proc "stdcall" (this: ^IAdapter, Output: u32, ppOutput: ^^IOutput) -> HRESULT, - GetDesc: proc "stdcall" (this: ^IAdapter, pDesc: ^ADAPTER_DESC) -> HRESULT, - CheckInterfaceSupport: proc "stdcall" (this: ^IAdapter, InterfaceName: ^GUID, pUMDVersion: ^LARGE_INTEGER) -> HRESULT, + EnumOutputs: proc "system" (this: ^IAdapter, Output: u32, ppOutput: ^^IOutput) -> HRESULT, + GetDesc: proc "system" (this: ^IAdapter, pDesc: ^ADAPTER_DESC) -> HRESULT, + CheckInterfaceSupport: proc "system" (this: ^IAdapter, InterfaceName: ^GUID, pUMDVersion: ^LARGE_INTEGER) -> HRESULT, } IOutput_UUID_STRING :: "AE02EEDB-C735-4690-8D52-5A8DC20213AA" @@ -555,18 +555,18 @@ IOutput :: struct #raw_union { } IOutput_VTable :: struct { using idxgiobject_vtable: IObject_VTable, - GetDesc: proc "stdcall" (this: ^IOutput, pDesc: ^OUTPUT_DESC) -> HRESULT, - GetDisplayModeList: proc "stdcall" (this: ^IOutput, EnumFormat: FORMAT, Flags: ENUM_MODES, pNumModes: ^u32, pDesc: ^MODE_DESC) -> HRESULT, - FindClosestMatchingMode: proc "stdcall" (this: ^IOutput, pModeToMatch: ^MODE_DESC, pClosestMatch: ^MODE_DESC, pConcernedDevice: ^IUnknown) -> HRESULT, - WaitForVBlank: proc "stdcall" (this: ^IOutput) -> HRESULT, - TakeOwnership: proc "stdcall" (this: ^IOutput, pDevice: ^IUnknown, Exclusive: BOOL) -> HRESULT, - ReleaseOwnership: proc "stdcall" (this: ^IOutput), - GetGammaControlCapabilities: proc "stdcall" (this: ^IOutput, pGammaCaps: ^GAMMA_CONTROL_CAPABILITIES) -> HRESULT, - SetGammaControl: proc "stdcall" (this: ^IOutput, pArray: ^GAMMA_CONTROL) -> HRESULT, - GetGammaControl: proc "stdcall" (this: ^IOutput, pArray: ^GAMMA_CONTROL) -> HRESULT, - SetDisplaySurface: proc "stdcall" (this: ^IOutput, pScanoutSurface: ^ISurface) -> HRESULT, - GetDisplaySurfaceData: proc "stdcall" (this: ^IOutput, pDestination: ^ISurface) -> HRESULT, - GetFrameStatistics: proc "stdcall" (this: ^IOutput, pStats: ^FRAME_STATISTICS) -> HRESULT, + GetDesc: proc "system" (this: ^IOutput, pDesc: ^OUTPUT_DESC) -> HRESULT, + GetDisplayModeList: proc "system" (this: ^IOutput, EnumFormat: FORMAT, Flags: ENUM_MODES, pNumModes: ^u32, pDesc: ^MODE_DESC) -> HRESULT, + FindClosestMatchingMode: proc "system" (this: ^IOutput, pModeToMatch: ^MODE_DESC, pClosestMatch: ^MODE_DESC, pConcernedDevice: ^IUnknown) -> HRESULT, + WaitForVBlank: proc "system" (this: ^IOutput) -> HRESULT, + TakeOwnership: proc "system" (this: ^IOutput, pDevice: ^IUnknown, Exclusive: BOOL) -> HRESULT, + ReleaseOwnership: proc "system" (this: ^IOutput), + GetGammaControlCapabilities: proc "system" (this: ^IOutput, pGammaCaps: ^GAMMA_CONTROL_CAPABILITIES) -> HRESULT, + SetGammaControl: proc "system" (this: ^IOutput, pArray: ^GAMMA_CONTROL) -> HRESULT, + GetGammaControl: proc "system" (this: ^IOutput, pArray: ^GAMMA_CONTROL) -> HRESULT, + SetDisplaySurface: proc "system" (this: ^IOutput, pScanoutSurface: ^ISurface) -> HRESULT, + GetDisplaySurfaceData: proc "system" (this: ^IOutput, pDestination: ^ISurface) -> HRESULT, + GetFrameStatistics: proc "system" (this: ^IOutput, pStats: ^FRAME_STATISTICS) -> HRESULT, } ISwapChain_UUID_STRING :: "310D36A0-D2E7-4C0A-AA04-6A9D23B8886A" @@ -577,16 +577,16 @@ ISwapChain :: struct #raw_union { } ISwapChain_VTable :: struct { using idxgidevicesubobject_vtable: IDeviceSubObject_VTable, - Present: proc "stdcall" (this: ^ISwapChain, SyncInterval: u32, Flags: PRESENT) -> HRESULT, - GetBuffer: proc "stdcall" (this: ^ISwapChain, Buffer: u32, riid: ^IID, ppSurface: ^rawptr) -> HRESULT, - SetFullscreenState: proc "stdcall" (this: ^ISwapChain, Fullscreen: BOOL, pTarget: ^IOutput) -> HRESULT, - GetFullscreenState: proc "stdcall" (this: ^ISwapChain, pFullscreen: ^BOOL, ppTarget: ^^IOutput) -> HRESULT, - GetDesc: proc "stdcall" (this: ^ISwapChain, pDesc: ^SWAP_CHAIN_DESC) -> HRESULT, - ResizeBuffers: proc "stdcall" (this: ^ISwapChain, BufferCount: u32, Width: u32, Height: u32, NewFormat: FORMAT, SwapChainFlags: SWAP_CHAIN) -> HRESULT, - ResizeTarget: proc "stdcall" (this: ^ISwapChain, pNewTargetParameters: ^MODE_DESC) -> HRESULT, - GetContainingOutput: proc "stdcall" (this: ^ISwapChain, ppOutput: ^^IOutput) -> HRESULT, - GetFrameStatistics: proc "stdcall" (this: ^ISwapChain, pStats: ^FRAME_STATISTICS) -> HRESULT, - GetLastPresentCount: proc "stdcall" (this: ^ISwapChain, pLastPresentCount: ^u32) -> HRESULT, + Present: proc "system" (this: ^ISwapChain, SyncInterval: u32, Flags: PRESENT) -> HRESULT, + GetBuffer: proc "system" (this: ^ISwapChain, Buffer: u32, riid: ^IID, ppSurface: ^rawptr) -> HRESULT, + SetFullscreenState: proc "system" (this: ^ISwapChain, Fullscreen: BOOL, pTarget: ^IOutput) -> HRESULT, + GetFullscreenState: proc "system" (this: ^ISwapChain, pFullscreen: ^BOOL, ppTarget: ^^IOutput) -> HRESULT, + GetDesc: proc "system" (this: ^ISwapChain, pDesc: ^SWAP_CHAIN_DESC) -> HRESULT, + ResizeBuffers: proc "system" (this: ^ISwapChain, BufferCount: u32, Width: u32, Height: u32, NewFormat: FORMAT, SwapChainFlags: SWAP_CHAIN) -> HRESULT, + ResizeTarget: proc "system" (this: ^ISwapChain, pNewTargetParameters: ^MODE_DESC) -> HRESULT, + GetContainingOutput: proc "system" (this: ^ISwapChain, ppOutput: ^^IOutput) -> HRESULT, + GetFrameStatistics: proc "system" (this: ^ISwapChain, pStats: ^FRAME_STATISTICS) -> HRESULT, + GetLastPresentCount: proc "system" (this: ^ISwapChain, pLastPresentCount: ^u32) -> HRESULT, } IFactory_UUID_STRING :: "7B7166EC-21C7-44AE-B21A-C9AE321AE369" @@ -597,11 +597,11 @@ IFactory :: struct #raw_union { } IFactory_VTable :: struct { using idxgiobject_vtable: IObject_VTable, - EnumAdapters: proc "stdcall" (this: ^IFactory, Adapter: u32, ppAdapter: ^^IAdapter) -> HRESULT, - MakeWindowAssociation: proc "stdcall" (this: ^IFactory, WindowHandle: HWND, Flags: MWA) -> HRESULT, - GetWindowAssociation: proc "stdcall" (this: ^IFactory, pWindowHandle: ^HWND) -> HRESULT, - CreateSwapChain: proc "stdcall" (this: ^IFactory, pDevice: ^IUnknown, pDesc: ^SWAP_CHAIN_DESC, ppSwapChain: ^^ISwapChain) -> HRESULT, - CreateSoftwareAdapter: proc "stdcall" (this: ^IFactory, Module: HMODULE, ppAdapter: ^^IAdapter) -> HRESULT, + EnumAdapters: proc "system" (this: ^IFactory, Adapter: u32, ppAdapter: ^^IAdapter) -> HRESULT, + MakeWindowAssociation: proc "system" (this: ^IFactory, WindowHandle: HWND, Flags: MWA) -> HRESULT, + GetWindowAssociation: proc "system" (this: ^IFactory, pWindowHandle: ^HWND) -> HRESULT, + CreateSwapChain: proc "system" (this: ^IFactory, pDevice: ^IUnknown, pDesc: ^SWAP_CHAIN_DESC, ppSwapChain: ^^ISwapChain) -> HRESULT, + CreateSoftwareAdapter: proc "system" (this: ^IFactory, Module: HMODULE, ppAdapter: ^^IAdapter) -> HRESULT, } IDevice_UUID_STRING :: "54EC77FA-1377-44E6-8C32-88FD5F44C84C" IDevice_UUID := &IID{0x54EC77FA, 0x1377, 0x44E6, {0x8C, 0x32, 0x88, 0xFD, 0x5F, 0x44, 0xC8, 0x4C}} @@ -611,11 +611,11 @@ IDevice :: struct #raw_union { } IDevice_VTable :: struct { using idxgiobject_vtable: IObject_VTable, - GetAdapter: proc "stdcall" (this: ^IDevice, pAdapter: ^^IAdapter) -> HRESULT, - CreateSurface: proc "stdcall" (this: ^IDevice, pDesc: ^SURFACE_DESC, NumSurfaces: u32, Usage: USAGE, pSharedResource: ^SHARED_RESOURCE, ppSurface: ^^ISurface) -> HRESULT, - QueryResourceResidency: proc "stdcall" (this: ^IDevice, ppResources: ^^IUnknown, pResidencyStatus: ^RESIDENCY, NumResources: u32) -> HRESULT, - SetGPUThreadPriority: proc "stdcall" (this: ^IDevice, Priority: i32) -> HRESULT, - GetGPUThreadPriority: proc "stdcall" (this: ^IDevice, pPriority: ^i32) -> HRESULT, + GetAdapter: proc "system" (this: ^IDevice, pAdapter: ^^IAdapter) -> HRESULT, + CreateSurface: proc "system" (this: ^IDevice, pDesc: ^SURFACE_DESC, NumSurfaces: u32, Usage: USAGE, pSharedResource: ^SHARED_RESOURCE, ppSurface: ^^ISurface) -> HRESULT, + QueryResourceResidency: proc "system" (this: ^IDevice, ppResources: ^^IUnknown, pResidencyStatus: ^RESIDENCY, NumResources: u32) -> HRESULT, + SetGPUThreadPriority: proc "system" (this: ^IDevice, Priority: i32) -> HRESULT, + GetGPUThreadPriority: proc "system" (this: ^IDevice, pPriority: ^i32) -> HRESULT, } ADAPTER_FLAG :: enum u32 { // TODO: convert to bit_set NONE = 0x0, @@ -651,8 +651,8 @@ IFactory1 :: struct #raw_union { } IFactory1_VTable :: struct { using idxgifactory_vtable: IFactory_VTable, - EnumAdapters1: proc "stdcall" (this: ^IFactory1, Adapter: u32, ppAdapter: ^^IAdapter1) -> HRESULT, - IsCurrent: proc "stdcall" (this: ^IFactory1) -> BOOL, + EnumAdapters1: proc "system" (this: ^IFactory1, Adapter: u32, ppAdapter: ^^IAdapter1) -> HRESULT, + IsCurrent: proc "system" (this: ^IFactory1) -> BOOL, } IAdapter1_UUID_STRING :: "29038F61-3839-4626-91FD-086879011A05" @@ -663,7 +663,7 @@ IAdapter1 :: struct #raw_union { } IAdapter1_VTable :: struct { using idxgiadapter_vtable: IAdapter_VTable, - GetDesc1: proc "stdcall" (this: ^IAdapter1, pDesc: ^ADAPTER_DESC1) -> HRESULT, + GetDesc1: proc "system" (this: ^IAdapter1, pDesc: ^ADAPTER_DESC1) -> HRESULT, } IDevice1_UUID_STRING :: "77DB970F-6276-48BA-BA28-070143B4392C" @@ -674,8 +674,8 @@ IDevice1 :: struct #raw_union { } IDevice1_VTable :: struct { using idxgidevice_vtable: IDevice_VTable, - SetMaximumFrameLatency: proc "stdcall" (this: ^IDevice1, MaxLatency: u32) -> HRESULT, - GetMaximumFrameLatency: proc "stdcall" (this: ^IDevice1, pMaxLatency: ^u32) -> HRESULT, + SetMaximumFrameLatency: proc "system" (this: ^IDevice1, MaxLatency: u32) -> HRESULT, + GetMaximumFrameLatency: proc "system" (this: ^IDevice1, pMaxLatency: ^u32) -> HRESULT, } IDisplayControl_UUID_STRING :: "EA9DBF1A-C88E-4486-854A-98AA0138F30C" @@ -686,8 +686,8 @@ IDisplayControl :: struct #raw_union { } IDisplayControl_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - IsStereoEnabled: proc "stdcall" (this: ^IDisplayControl) -> BOOL, - SetStereoEnabled: proc "stdcall" (this: ^IDisplayControl, enabled: BOOL), + IsStereoEnabled: proc "system" (this: ^IDisplayControl) -> BOOL, + SetStereoEnabled: proc "system" (this: ^IDisplayControl, enabled: BOOL), } OUTDUPL_MOVE_RECT :: struct { SourcePoint: POINT, @@ -739,14 +739,14 @@ IOutputDuplication :: struct #raw_union { } IOutputDuplication_VTable :: struct { using idxgiobject_vtable: IObject_VTable, - GetDesc: proc "stdcall" (this: ^IOutputDuplication, pDesc: ^OUTDUPL_DESC), - AcquireNextFrame: proc "stdcall" (this: ^IOutputDuplication, TimeoutInMilliseconds: u32, pFrameInfo: ^OUTDUPL_FRAME_INFO, ppDesktopResource: ^^IResource) -> HRESULT, - GetFrameDirtyRects: proc "stdcall" (this: ^IOutputDuplication, DirtyRectsBufferSize: u32, pDirtyRectsBuffer: ^RECT, pDirtyRectsBufferSizeRequired: ^u32) -> HRESULT, - GetFrameMoveRects: proc "stdcall" (this: ^IOutputDuplication, MoveRectsBufferSize: u32, pMoveRectBuffer: ^OUTDUPL_MOVE_RECT, pMoveRectsBufferSizeRequired: ^u32) -> HRESULT, - GetFramePointerShape: proc "stdcall" (this: ^IOutputDuplication, PointerShapeBufferSize: u32, pPointerShapeBuffer: rawptr, pPointerShapeBufferSizeRequired: ^u32, pPointerShapeInfo: ^OUTDUPL_POINTER_SHAPE_INFO) -> HRESULT, - MapDesktopSurface: proc "stdcall" (this: ^IOutputDuplication, pLockedRect: ^MAPPED_RECT) -> HRESULT, - UnMapDesktopSurface: proc "stdcall" (this: ^IOutputDuplication) -> HRESULT, - ReleaseFrame: proc "stdcall" (this: ^IOutputDuplication) -> HRESULT, + GetDesc: proc "system" (this: ^IOutputDuplication, pDesc: ^OUTDUPL_DESC), + AcquireNextFrame: proc "system" (this: ^IOutputDuplication, TimeoutInMilliseconds: u32, pFrameInfo: ^OUTDUPL_FRAME_INFO, ppDesktopResource: ^^IResource) -> HRESULT, + GetFrameDirtyRects: proc "system" (this: ^IOutputDuplication, DirtyRectsBufferSize: u32, pDirtyRectsBuffer: ^RECT, pDirtyRectsBufferSizeRequired: ^u32) -> HRESULT, + GetFrameMoveRects: proc "system" (this: ^IOutputDuplication, MoveRectsBufferSize: u32, pMoveRectBuffer: ^OUTDUPL_MOVE_RECT, pMoveRectsBufferSizeRequired: ^u32) -> HRESULT, + GetFramePointerShape: proc "system" (this: ^IOutputDuplication, PointerShapeBufferSize: u32, pPointerShapeBuffer: rawptr, pPointerShapeBufferSizeRequired: ^u32, pPointerShapeInfo: ^OUTDUPL_POINTER_SHAPE_INFO) -> HRESULT, + MapDesktopSurface: proc "system" (this: ^IOutputDuplication, pLockedRect: ^MAPPED_RECT) -> HRESULT, + UnMapDesktopSurface: proc "system" (this: ^IOutputDuplication) -> HRESULT, + ReleaseFrame: proc "system" (this: ^IOutputDuplication) -> HRESULT, } ALPHA_MODE :: enum i32 { UNSPECIFIED = 0, @@ -765,7 +765,7 @@ ISurface2 :: struct #raw_union { } ISurface2_VTable :: struct { using idxgisurface1_vtable: ISurface1_VTable, - GetResource: proc "stdcall" (this: ^ISurface2, riid: ^IID, ppParentResource: ^rawptr, pSubresourceIndex: ^u32) -> HRESULT, + GetResource: proc "system" (this: ^ISurface2, riid: ^IID, ppParentResource: ^rawptr, pSubresourceIndex: ^u32) -> HRESULT, } IResource1_UUID_STRING :: "30961379-4609-4A41-998E-54FE567EE0C1" @@ -776,8 +776,8 @@ IResource1 :: struct #raw_union { } IResource1_VTable :: struct { using idxgiresource_vtable: IResource_VTable, - CreateSubresourceSurface: proc "stdcall" (this: ^IResource1, index: u32, ppSurface: ^^ISurface2) -> HRESULT, - CreateSharedHandle: proc "stdcall" (this: ^IResource1, pAttributes: ^win32.SECURITY_ATTRIBUTES, dwAccess: SHARED_RESOURCE_RW, lpName: ^i16, pHandle: ^HANDLE) -> HRESULT, + CreateSubresourceSurface: proc "system" (this: ^IResource1, index: u32, ppSurface: ^^ISurface2) -> HRESULT, + CreateSharedHandle: proc "system" (this: ^IResource1, pAttributes: ^win32.SECURITY_ATTRIBUTES, dwAccess: SHARED_RESOURCE_RW, lpName: ^i16, pHandle: ^HANDLE) -> HRESULT, } OFFER_RESOURCE_PRIORITY :: enum i32 { LOW = 1, @@ -794,9 +794,9 @@ IDevice2 :: struct #raw_union { } IDevice2_VTable :: struct { using idxgidevice1_vtable: IDevice1_VTable, - OfferResources: proc "stdcall" (this: ^IDevice2, NumResources: u32, ppResources: ^^IResource, Priority: OFFER_RESOURCE_PRIORITY) -> HRESULT, - ReclaimResources: proc "stdcall" (this: ^IDevice2, NumResources: u32, ppResources: ^^IResource, pDiscarded: ^BOOL) -> HRESULT, - EnqueueSetEvent: proc "stdcall" (this: ^IDevice2, hEvent: HANDLE) -> HRESULT, + OfferResources: proc "system" (this: ^IDevice2, NumResources: u32, ppResources: ^^IResource, Priority: OFFER_RESOURCE_PRIORITY) -> HRESULT, + ReclaimResources: proc "system" (this: ^IDevice2, NumResources: u32, ppResources: ^^IResource, pDiscarded: ^BOOL) -> HRESULT, + EnqueueSetEvent: proc "system" (this: ^IDevice2, hEvent: HANDLE) -> HRESULT, } MODE_DESC1 :: struct { Width: u32, @@ -852,17 +852,17 @@ ISwapChain1 :: struct #raw_union { } ISwapChain1_VTable :: struct { using idxgiswapchain_vtable: ISwapChain_VTable, - GetDesc1: proc "stdcall" (this: ^ISwapChain1, pDesc: ^SWAP_CHAIN_DESC1) -> HRESULT, - GetFullscreenDesc: proc "stdcall" (this: ^ISwapChain1, pDesc: ^SWAP_CHAIN_FULLSCREEN_DESC) -> HRESULT, - GetHwnd: proc "stdcall" (this: ^ISwapChain1, pHwnd: ^HWND) -> HRESULT, - GetCoreWindow: proc "stdcall" (this: ^ISwapChain1, refiid: ^IID, ppUnk: ^rawptr) -> HRESULT, - Present1: proc "stdcall" (this: ^ISwapChain1, SyncInterval: u32, PresentFlags: PRESENT, pPresentParameters: ^PRESENT_PARAMETERS) -> HRESULT, - IsTemporaryMonoSupported: proc "stdcall" (this: ^ISwapChain1) -> BOOL, - GetRestrictToOutput: proc "stdcall" (this: ^ISwapChain1, ppRestrictToOutput: ^^IOutput) -> HRESULT, - SetBackgroundColor: proc "stdcall" (this: ^ISwapChain1, pColor: ^RGBA) -> HRESULT, - GetBackgroundColor: proc "stdcall" (this: ^ISwapChain1, pColor: ^RGBA) -> HRESULT, - SetRotation: proc "stdcall" (this: ^ISwapChain1, Rotation: MODE_ROTATION) -> HRESULT, - GetRotation: proc "stdcall" (this: ^ISwapChain1, pRotation: ^MODE_ROTATION) -> HRESULT, + GetDesc1: proc "system" (this: ^ISwapChain1, pDesc: ^SWAP_CHAIN_DESC1) -> HRESULT, + GetFullscreenDesc: proc "system" (this: ^ISwapChain1, pDesc: ^SWAP_CHAIN_FULLSCREEN_DESC) -> HRESULT, + GetHwnd: proc "system" (this: ^ISwapChain1, pHwnd: ^HWND) -> HRESULT, + GetCoreWindow: proc "system" (this: ^ISwapChain1, refiid: ^IID, ppUnk: ^rawptr) -> HRESULT, + Present1: proc "system" (this: ^ISwapChain1, SyncInterval: u32, PresentFlags: PRESENT, pPresentParameters: ^PRESENT_PARAMETERS) -> HRESULT, + IsTemporaryMonoSupported: proc "system" (this: ^ISwapChain1) -> BOOL, + GetRestrictToOutput: proc "system" (this: ^ISwapChain1, ppRestrictToOutput: ^^IOutput) -> HRESULT, + SetBackgroundColor: proc "system" (this: ^ISwapChain1, pColor: ^RGBA) -> HRESULT, + GetBackgroundColor: proc "system" (this: ^ISwapChain1, pColor: ^RGBA) -> HRESULT, + SetRotation: proc "system" (this: ^ISwapChain1, Rotation: MODE_ROTATION) -> HRESULT, + GetRotation: proc "system" (this: ^ISwapChain1, pRotation: ^MODE_ROTATION) -> HRESULT, } IFactory2_UUID_STRING :: "50C83A1C-E072-4C48-87B0-3630FA36A6D0" @@ -873,17 +873,17 @@ IFactory2 :: struct #raw_union { } IFactory2_VTable :: struct { using idxgifactory1_vtable: IFactory1_VTable, - IsWindowedStereoEnabled: proc "stdcall" (this: ^IFactory2) -> BOOL, - CreateSwapChainForHwnd: proc "stdcall" (this: ^IFactory2, pDevice: ^IUnknown, hWnd: HWND, pDesc: ^SWAP_CHAIN_DESC1, pFullscreenDesc: ^SWAP_CHAIN_FULLSCREEN_DESC, pRestrictToOutput: ^IOutput, ppSwapChain: ^^ISwapChain1) -> HRESULT, - CreateSwapChainForCoreWindow: proc "stdcall" (this: ^IFactory2, pDevice: ^IUnknown, pWindow: ^IUnknown, pDesc: ^SWAP_CHAIN_DESC1, pRestrictToOutput: ^IOutput, ppSwapChain: ^^ISwapChain1) -> HRESULT, - GetSharedResourceAdapterLuid: proc "stdcall" (this: ^IFactory2, hResource: HANDLE, pLuid: ^LUID) -> HRESULT, - RegisterStereoStatusWindow: proc "stdcall" (this: ^IFactory2, WindowHandle: HWND, wMsg: u32, pdwCookie: ^u32) -> HRESULT, - RegisterStereoStatusEvent: proc "stdcall" (this: ^IFactory2, hEvent: HANDLE, pdwCookie: ^u32) -> HRESULT, - UnregisterStereoStatus: proc "stdcall" (this: ^IFactory2, dwCookie: u32), - RegisterOcclusionStatusWindow: proc "stdcall" (this: ^IFactory2, WindowHandle: HWND, wMsg: u32, pdwCookie: ^u32) -> HRESULT, - RegisterOcclusionStatusEvent: proc "stdcall" (this: ^IFactory2, hEvent: HANDLE, pdwCookie: ^u32) -> HRESULT, - UnregisterOcclusionStatus: proc "stdcall" (this: ^IFactory2, dwCookie: u32), - CreateSwapChainForComposition: proc "stdcall" (this: ^IFactory2, pDevice: ^IUnknown, pDesc: ^SWAP_CHAIN_DESC1, pRestrictToOutput: ^IOutput, ppSwapChain: ^^ISwapChain1) -> HRESULT, + IsWindowedStereoEnabled: proc "system" (this: ^IFactory2) -> BOOL, + CreateSwapChainForHwnd: proc "system" (this: ^IFactory2, pDevice: ^IUnknown, hWnd: HWND, pDesc: ^SWAP_CHAIN_DESC1, pFullscreenDesc: ^SWAP_CHAIN_FULLSCREEN_DESC, pRestrictToOutput: ^IOutput, ppSwapChain: ^^ISwapChain1) -> HRESULT, + CreateSwapChainForCoreWindow: proc "system" (this: ^IFactory2, pDevice: ^IUnknown, pWindow: ^IUnknown, pDesc: ^SWAP_CHAIN_DESC1, pRestrictToOutput: ^IOutput, ppSwapChain: ^^ISwapChain1) -> HRESULT, + GetSharedResourceAdapterLuid: proc "system" (this: ^IFactory2, hResource: HANDLE, pLuid: ^LUID) -> HRESULT, + RegisterStereoStatusWindow: proc "system" (this: ^IFactory2, WindowHandle: HWND, wMsg: u32, pdwCookie: ^u32) -> HRESULT, + RegisterStereoStatusEvent: proc "system" (this: ^IFactory2, hEvent: HANDLE, pdwCookie: ^u32) -> HRESULT, + UnregisterStereoStatus: proc "system" (this: ^IFactory2, dwCookie: u32), + RegisterOcclusionStatusWindow: proc "system" (this: ^IFactory2, WindowHandle: HWND, wMsg: u32, pdwCookie: ^u32) -> HRESULT, + RegisterOcclusionStatusEvent: proc "system" (this: ^IFactory2, hEvent: HANDLE, pdwCookie: ^u32) -> HRESULT, + UnregisterOcclusionStatus: proc "system" (this: ^IFactory2, dwCookie: u32), + CreateSwapChainForComposition: proc "system" (this: ^IFactory2, pDevice: ^IUnknown, pDesc: ^SWAP_CHAIN_DESC1, pRestrictToOutput: ^IOutput, ppSwapChain: ^^ISwapChain1) -> HRESULT, } GRAPHICS_PREEMPTION_GRANULARITY :: enum i32 { DMA_BUFFER_BOUNDARY = 0, @@ -925,7 +925,7 @@ IAdapter2 :: struct #raw_union { } IAdapter2_VTable :: struct { using idxgiadapter1_vtable: IAdapter1_VTable, - GetDesc2: proc "stdcall" (this: ^IAdapter2, pDesc: ^ADAPTER_DESC2) -> HRESULT, + GetDesc2: proc "system" (this: ^IAdapter2, pDesc: ^ADAPTER_DESC2) -> HRESULT, } IOutput1_UUID_STRING :: "00CDDEA8-939B-4B83-A340-A685226666CC" @@ -936,10 +936,10 @@ IOutput1 :: struct #raw_union { } IOutput1_VTable :: struct { using idxgioutput_vtable: IOutput_VTable, - GetDisplayModeList1: proc "stdcall" (this: ^IOutput1, EnumFormat: FORMAT, Flags: ENUM_MODES, pNumModes: ^u32, pDesc: ^MODE_DESC1) -> HRESULT, - FindClosestMatchingMode1: proc "stdcall" (this: ^IOutput1, pModeToMatch: ^MODE_DESC1, pClosestMatch: ^MODE_DESC1, pConcernedDevice: ^IUnknown) -> HRESULT, - GetDisplaySurfaceData1: proc "stdcall" (this: ^IOutput1, pDestination: ^IResource) -> HRESULT, - DuplicateOutput: proc "stdcall" (this: ^IOutput1, pDevice: ^IUnknown, ppOutputDuplication: ^^IOutputDuplication) -> HRESULT, + GetDisplayModeList1: proc "system" (this: ^IOutput1, EnumFormat: FORMAT, Flags: ENUM_MODES, pNumModes: ^u32, pDesc: ^MODE_DESC1) -> HRESULT, + FindClosestMatchingMode1: proc "system" (this: ^IOutput1, pModeToMatch: ^MODE_DESC1, pClosestMatch: ^MODE_DESC1, pConcernedDevice: ^IUnknown) -> HRESULT, + GetDisplaySurfaceData1: proc "system" (this: ^IOutput1, pDestination: ^IResource) -> HRESULT, + DuplicateOutput: proc "system" (this: ^IOutput1, pDevice: ^IUnknown, ppOutputDuplication: ^^IOutputDuplication) -> HRESULT, } IDevice3_UUID_STRING :: "6007896C-3244-4AFD-BF18-A6D3BEDA5023" IDevice3_UUID := &IID{0x6007896C, 0x3244, 0x4AFD, {0xBF, 0x18, 0xA6, 0xD3, 0xBE, 0xDA, 0x50, 0x23}} @@ -949,7 +949,7 @@ IDevice3 :: struct #raw_union { } IDevice3_VTable :: struct { using idxgidevice2_vtable: IDevice2_VTable, - Trim: proc "stdcall" (this: ^IDevice3), + Trim: proc "system" (this: ^IDevice3), } MATRIX_3X2_F :: struct { _11: f32, @@ -969,13 +969,13 @@ ISwapChain2 :: struct #raw_union { } ISwapChain2_VTable :: struct { using idxgiswapchain1_vtable: ISwapChain1_VTable, - SetSourceSize: proc "stdcall" (this: ^ISwapChain2, Width: u32, Height: u32) -> HRESULT, - GetSourceSize: proc "stdcall" (this: ^ISwapChain2, pWidth: ^u32, pHeight: ^u32) -> HRESULT, - SetMaximumFrameLatency: proc "stdcall" (this: ^ISwapChain2, MaxLatency: u32) -> HRESULT, - GetMaximumFrameLatency: proc "stdcall" (this: ^ISwapChain2, pMaxLatency: ^u32) -> HRESULT, - GetFrameLatencyWaitableObject: proc "stdcall" (this: ^ISwapChain2) -> HANDLE, - SetMatrixTransform: proc "stdcall" (this: ^ISwapChain2, pMatrix: ^MATRIX_3X2_F) -> HRESULT, - GetMatrixTransform: proc "stdcall" (this: ^ISwapChain2, pMatrix: ^MATRIX_3X2_F) -> HRESULT, + SetSourceSize: proc "system" (this: ^ISwapChain2, Width: u32, Height: u32) -> HRESULT, + GetSourceSize: proc "system" (this: ^ISwapChain2, pWidth: ^u32, pHeight: ^u32) -> HRESULT, + SetMaximumFrameLatency: proc "system" (this: ^ISwapChain2, MaxLatency: u32) -> HRESULT, + GetMaximumFrameLatency: proc "system" (this: ^ISwapChain2, pMaxLatency: ^u32) -> HRESULT, + GetFrameLatencyWaitableObject: proc "system" (this: ^ISwapChain2) -> HANDLE, + SetMatrixTransform: proc "system" (this: ^ISwapChain2, pMatrix: ^MATRIX_3X2_F) -> HRESULT, + GetMatrixTransform: proc "system" (this: ^ISwapChain2, pMatrix: ^MATRIX_3X2_F) -> HRESULT, } IOutput2_UUID_STRING :: "595E39D1-2724-4663-99B1-DA969DE28364" @@ -986,7 +986,7 @@ IOutput2 :: struct #raw_union { } IOutput2_VTable :: struct { using idxgioutput1_vtable: IOutput1_VTable, - SupportsOverlays: proc "stdcall" (this: ^IOutput2) -> BOOL, + SupportsOverlays: proc "system" (this: ^IOutput2) -> BOOL, } IFactory3_UUID_STRING :: "25483823-CD46-4C7D-86CA-47AA95B837BD" @@ -997,7 +997,7 @@ IFactory3 :: struct #raw_union { } IFactory3_VTable :: struct { using idxgifactory2_vtable: IFactory2_VTable, - GetCreationFlags: proc "stdcall" (this: ^IFactory3) -> CREATE_FACTORY, + GetCreationFlags: proc "system" (this: ^IFactory3) -> CREATE_FACTORY, } DECODE_SWAP_CHAIN_DESC :: struct { Flags: SWAP_CHAIN, @@ -1019,15 +1019,15 @@ IDecodeSwapChain :: struct #raw_union { } IDecodeSwapChain_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - PresentBuffer: proc "stdcall" (this: ^IDecodeSwapChain, BufferToPresent: u32, SyncInterval: u32, Flags: PRESENT) -> HRESULT, - SetSourceRect: proc "stdcall" (this: ^IDecodeSwapChain, pRect: ^RECT) -> HRESULT, - SetTargetRect: proc "stdcall" (this: ^IDecodeSwapChain, pRect: ^RECT) -> HRESULT, - SetDestSize: proc "stdcall" (this: ^IDecodeSwapChain, Width: u32, Height: u32) -> HRESULT, - GetSourceRect: proc "stdcall" (this: ^IDecodeSwapChain, pRect: ^RECT) -> HRESULT, - GetTargetRect: proc "stdcall" (this: ^IDecodeSwapChain, pRect: ^RECT) -> HRESULT, - GetDestSize: proc "stdcall" (this: ^IDecodeSwapChain, pWidth: ^u32, pHeight: ^u32) -> HRESULT, - SetColorSpace: proc "stdcall" (this: ^IDecodeSwapChain, ColorSpace: MULTIPLANE_OVERLAY_YCbCr) -> HRESULT, - GetColorSpace: proc "stdcall" (this: ^IDecodeSwapChain) -> MULTIPLANE_OVERLAY_YCbCr, + PresentBuffer: proc "system" (this: ^IDecodeSwapChain, BufferToPresent: u32, SyncInterval: u32, Flags: PRESENT) -> HRESULT, + SetSourceRect: proc "system" (this: ^IDecodeSwapChain, pRect: ^RECT) -> HRESULT, + SetTargetRect: proc "system" (this: ^IDecodeSwapChain, pRect: ^RECT) -> HRESULT, + SetDestSize: proc "system" (this: ^IDecodeSwapChain, Width: u32, Height: u32) -> HRESULT, + GetSourceRect: proc "system" (this: ^IDecodeSwapChain, pRect: ^RECT) -> HRESULT, + GetTargetRect: proc "system" (this: ^IDecodeSwapChain, pRect: ^RECT) -> HRESULT, + GetDestSize: proc "system" (this: ^IDecodeSwapChain, pWidth: ^u32, pHeight: ^u32) -> HRESULT, + SetColorSpace: proc "system" (this: ^IDecodeSwapChain, ColorSpace: MULTIPLANE_OVERLAY_YCbCr) -> HRESULT, + GetColorSpace: proc "system" (this: ^IDecodeSwapChain) -> MULTIPLANE_OVERLAY_YCbCr, } IFactoryMedia_UUID_STRING :: "41E7D1F2-A591-4F7B-A2E5-FA9C843E1C12" @@ -1038,8 +1038,8 @@ IFactoryMedia :: struct #raw_union { } IFactoryMedia_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - CreateSwapChainForCompositionSurfaceHandle: proc "stdcall" (this: ^IFactoryMedia, pDevice: ^IUnknown, hSurface: HANDLE, pDesc: ^SWAP_CHAIN_DESC1, pRestrictToOutput: ^IOutput, ppSwapChain: ^^ISwapChain1) -> HRESULT, - CreateDecodeSwapChainForCompositionSurfaceHandle: proc "stdcall" (this: ^IFactoryMedia, pDevice: ^IUnknown, hSurface: HANDLE, pDesc: ^DECODE_SWAP_CHAIN_DESC, pYuvDecodeBuffers: ^IResource, pRestrictToOutput: ^IOutput, ppSwapChain: ^^IDecodeSwapChain) -> HRESULT, + CreateSwapChainForCompositionSurfaceHandle: proc "system" (this: ^IFactoryMedia, pDevice: ^IUnknown, hSurface: HANDLE, pDesc: ^SWAP_CHAIN_DESC1, pRestrictToOutput: ^IOutput, ppSwapChain: ^^ISwapChain1) -> HRESULT, + CreateDecodeSwapChainForCompositionSurfaceHandle: proc "system" (this: ^IFactoryMedia, pDevice: ^IUnknown, hSurface: HANDLE, pDesc: ^DECODE_SWAP_CHAIN_DESC, pYuvDecodeBuffers: ^IResource, pRestrictToOutput: ^IOutput, ppSwapChain: ^^IDecodeSwapChain) -> HRESULT, } FRAME_PRESENTATION_MODE :: enum i32 { COMPOSED = 0, @@ -1067,9 +1067,9 @@ ISwapChainMedia :: struct #raw_union { } ISwapChainMedia_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - GetFrameStatisticsMedia: proc "stdcall" (this: ^ISwapChainMedia, pStats: ^FRAME_STATISTICS_MEDIA) -> HRESULT, - SetPresentDuration: proc "stdcall" (this: ^ISwapChainMedia, Duration: u32) -> HRESULT, - CheckPresentDurationSupport: proc "stdcall" (this: ^ISwapChainMedia, DesiredPresentDuration: u32, pClosestSmallerPresentDuration: ^u32, pClosestLargerPresentDuration: ^u32) -> HRESULT, + GetFrameStatisticsMedia: proc "system" (this: ^ISwapChainMedia, pStats: ^FRAME_STATISTICS_MEDIA) -> HRESULT, + SetPresentDuration: proc "system" (this: ^ISwapChainMedia, Duration: u32) -> HRESULT, + CheckPresentDurationSupport: proc "system" (this: ^ISwapChainMedia, DesiredPresentDuration: u32, pClosestSmallerPresentDuration: ^u32, pClosestLargerPresentDuration: ^u32) -> HRESULT, } OVERLAY_SUPPORT :: distinct bit_set[OVERLAY_SUPPORT_FLAG; u32] OVERLAY_SUPPORT_FLAG :: enum u32 { @@ -1086,7 +1086,7 @@ IOutput3 :: struct #raw_union { } IOutput3_VTable :: struct { using idxgioutput2_vtable: IOutput2_VTable, - CheckOverlaySupport: proc "stdcall" (this: ^IOutput3, EnumFormat: FORMAT, pConcernedDevice: ^IUnknown, pFlags: ^OVERLAY_SUPPORT) -> HRESULT, + CheckOverlaySupport: proc "system" (this: ^IOutput3, EnumFormat: FORMAT, pConcernedDevice: ^IUnknown, pFlags: ^OVERLAY_SUPPORT) -> HRESULT, } SWAP_CHAIN_COLOR_SPACE_SUPPORT :: distinct bit_set[SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG; u32] SWAP_CHAIN_COLOR_SPACE_SUPPORT_FLAG :: enum u32 { @@ -1103,10 +1103,10 @@ ISwapChain3 :: struct #raw_union { } ISwapChain3_VTable :: struct { using idxgiswapchain2_vtable: ISwapChain2_VTable, - GetCurrentBackBufferIndex: proc "stdcall" (this: ^ISwapChain3) -> u32, - CheckColorSpaceSupport: proc "stdcall" (this: ^ISwapChain3, ColorSpace: COLOR_SPACE_TYPE, pColorSpaceSupport: ^SWAP_CHAIN_COLOR_SPACE_SUPPORT) -> HRESULT, - SetColorSpace1: proc "stdcall" (this: ^ISwapChain3, ColorSpace: COLOR_SPACE_TYPE) -> HRESULT, - ResizeBuffers1: proc "stdcall" (this: ^ISwapChain3, BufferCount: u32, Width: u32, Height: u32, Format: FORMAT, SwapChainFlags: SWAP_CHAIN, pCreationNodeMask: ^u32, ppPresentQueue: ^^IUnknown) -> HRESULT, + GetCurrentBackBufferIndex: proc "system" (this: ^ISwapChain3) -> u32, + CheckColorSpaceSupport: proc "system" (this: ^ISwapChain3, ColorSpace: COLOR_SPACE_TYPE, pColorSpaceSupport: ^SWAP_CHAIN_COLOR_SPACE_SUPPORT) -> HRESULT, + SetColorSpace1: proc "system" (this: ^ISwapChain3, ColorSpace: COLOR_SPACE_TYPE) -> HRESULT, + ResizeBuffers1: proc "system" (this: ^ISwapChain3, BufferCount: u32, Width: u32, Height: u32, Format: FORMAT, SwapChainFlags: SWAP_CHAIN, pCreationNodeMask: ^u32, ppPresentQueue: ^^IUnknown) -> HRESULT, } OVERLAY_COLOR_SPACE_SUPPORT :: distinct bit_set[OVERLAY_COLOR_SPACE_SUPPORT_FLAG; u32] OVERLAY_COLOR_SPACE_SUPPORT_FLAG :: enum u32 { @@ -1122,7 +1122,7 @@ IOutput4 :: struct #raw_union { } IOutput4_VTable :: struct { using idxgioutput3_vtable: IOutput3_VTable, - CheckOverlayColorSpaceSupport: proc "stdcall" (this: ^IOutput4, Format: FORMAT, ColorSpace: COLOR_SPACE_TYPE, pConcernedDevice: ^IUnknown, pFlags: ^OVERLAY_COLOR_SPACE_SUPPORT) -> HRESULT, + CheckOverlayColorSpaceSupport: proc "system" (this: ^IOutput4, Format: FORMAT, ColorSpace: COLOR_SPACE_TYPE, pConcernedDevice: ^IUnknown, pFlags: ^OVERLAY_COLOR_SPACE_SUPPORT) -> HRESULT, } IFactory4_UUID_STRING :: "1BC6EA02-EF36-464F-BF0C-21CA39E5168A" @@ -1133,8 +1133,8 @@ IFactory4 :: struct #raw_union { } IFactory4_VTable :: struct { using idxgifactory3_vtable: IFactory3_VTable, - EnumAdapterByLuid: proc "stdcall" (this: ^IFactory4, AdapterLuid: LUID, riid: ^IID, ppvAdapter: ^rawptr) -> HRESULT, - EnumWarpAdapter: proc "stdcall" (this: ^IFactory4, riid: ^IID, ppvAdapter: ^rawptr) -> HRESULT, + EnumAdapterByLuid: proc "system" (this: ^IFactory4, AdapterLuid: LUID, riid: ^IID, ppvAdapter: ^rawptr) -> HRESULT, + EnumWarpAdapter: proc "system" (this: ^IFactory4, riid: ^IID, ppvAdapter: ^rawptr) -> HRESULT, } MEMORY_SEGMENT_GROUP :: enum i32 { LOCAL = 0, @@ -1157,12 +1157,12 @@ IAdapter3 :: struct #raw_union { } IAdapter3_VTable :: struct { using idxgiadapter2_vtable: IAdapter2_VTable, - RegisterHardwareContentProtectionTeardownStatusEvent: proc "stdcall" (this: ^IAdapter3, hEvent: HANDLE, pdwCookie: ^u32) -> HRESULT, - UnregisterHardwareContentProtectionTeardownStatus: proc "stdcall" (this: ^IAdapter3, dwCookie: u32), - QueryVideoMemoryInfo: proc "stdcall" (this: ^IAdapter3, NodeIndex: u32, MemorySegmentGroup: MEMORY_SEGMENT_GROUP, pVideoMemoryInfo: ^QUERY_VIDEO_MEMORY_INFO) -> HRESULT, - SetVideoMemoryReservation: proc "stdcall" (this: ^IAdapter3, NodeIndex: u32, MemorySegmentGroup: MEMORY_SEGMENT_GROUP, Reservation: u64) -> HRESULT, - RegisterVideoMemoryBudgetChangeNotificationEvent: proc "stdcall" (this: ^IAdapter3, hEvent: HANDLE, pdwCookie: ^u32) -> HRESULT, - UnregisterVideoMemoryBudgetChangeNotification: proc "stdcall" (this: ^IAdapter3, dwCookie: u32), + RegisterHardwareContentProtectionTeardownStatusEvent: proc "system" (this: ^IAdapter3, hEvent: HANDLE, pdwCookie: ^u32) -> HRESULT, + UnregisterHardwareContentProtectionTeardownStatus: proc "system" (this: ^IAdapter3, dwCookie: u32), + QueryVideoMemoryInfo: proc "system" (this: ^IAdapter3, NodeIndex: u32, MemorySegmentGroup: MEMORY_SEGMENT_GROUP, pVideoMemoryInfo: ^QUERY_VIDEO_MEMORY_INFO) -> HRESULT, + SetVideoMemoryReservation: proc "system" (this: ^IAdapter3, NodeIndex: u32, MemorySegmentGroup: MEMORY_SEGMENT_GROUP, Reservation: u64) -> HRESULT, + RegisterVideoMemoryBudgetChangeNotificationEvent: proc "system" (this: ^IAdapter3, hEvent: HANDLE, pdwCookie: ^u32) -> HRESULT, + UnregisterVideoMemoryBudgetChangeNotification: proc "system" (this: ^IAdapter3, dwCookie: u32), } ERROR_ACCESS_DENIED :: HRESULT(-2005270485) //0x887A002B diff --git a/vendor/directx/dxgi/dxgidebug.odin b/vendor/directx/dxgi/dxgidebug.odin index 1dea396a7..f5d4904eb 100644 --- a/vendor/directx/dxgi/dxgidebug.odin +++ b/vendor/directx/dxgi/dxgidebug.odin @@ -77,43 +77,43 @@ IInfoQueue :: struct #raw_union { } IInfoQueue_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - SetMessageCountLimit: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID, MessageCountLimit: UINT64) -> HRESULT, - ClearStoredMessages: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID), - GetMessage: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID, MessageIndex: UINT64, pMessage: ^INFO_QUEUE_MESSAGE, pMessageByteLength: ^SIZE_T) -> HRESULT, - GetNumStoredMessagesAllowedByRetrievalFilters: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID) -> UINT64, - GetNumStoredMessages: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID) -> UINT64, - GetNumMessagesDiscardedByMessageCountLimit: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID) -> UINT64, - GetMessageCountLimit: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID) -> UINT64, - GetNumMessagesAllowedByStorageFilter: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID) -> UINT64, - GetNumMessagesDeniedByStorageFilter: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID) -> UINT64, - AddStorageFilterEntries: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID, pFilter: INFO_QUEUE_FILTER) -> HRESULT, - GetStorageFilter: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID, pFilter: ^INFO_QUEUE_FILTER, pFilterByteLength: ^SIZE_T) -> HRESULT, - ClearStorageFilter: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID), - PushEmptyStorageFilter: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID) -> HRESULT, - PushDenyAllStorageFilter: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID) -> HRESULT, - PushCopyOfStorageFilter: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID) -> HRESULT, - PushStorageFilter: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID, pFilter: ^INFO_QUEUE_FILTER) -> HRESULT, - PopStorageFilter: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID), - GetStorageFilterStackSize: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID) -> UINT, - AddRetrievalFilterEntries: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID, pFilter: ^INFO_QUEUE_FILTER) -> HRESULT, - GetRetrievalFilter: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID, pFilter: ^INFO_QUEUE_FILTER, pFilterByteLength: ^SIZE_T) -> HRESULT, - ClearRetrievalFilter: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID), - PushEmptyRetrievalFilter: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID) -> HRESULT, - PushDenyAllRetrievalFilter: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID) -> HRESULT, - PushCopyOfRetrievalFilter: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID) -> HRESULT, - PushRetrievalFilter: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID, pFilter: ^INFO_QUEUE_FILTER) -> HRESULT, - PopRetrievalFilter: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID), - GetRetrievalFilterStackSize: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID) -> UINT, - AddMessage: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID, Category: INFO_QUEUE_MESSAGE_CATEGORY, Severity: INFO_QUEUE_MESSAGE_SEVERITY, ID: INFO_QUEUE_MESSAGE_ID, pDescription: LPCSTR) -> HRESULT, - AddApplicationMessage: proc "stdcall" (this: ^IInfoQueue, Severity: INFO_QUEUE_MESSAGE_SEVERITY, pDescription: LPCSTR) -> HRESULT, - SetBreakOnCategory: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID, Category: INFO_QUEUE_MESSAGE_CATEGORY, bEnable: BOOL) -> HRESULT, - SetBreakOnSeverity: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID, Severity: INFO_QUEUE_MESSAGE_SEVERITY, bEnable: BOOL) -> HRESULT, - SetBreakOnID: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID, ID: INFO_QUEUE_MESSAGE_ID, bEnable: BOOL) -> HRESULT, - GetBreakOnCategory: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID, Category: INFO_QUEUE_MESSAGE_CATEGORY) -> BOOL, - GetBreakOnSeverity: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID, Severity: INFO_QUEUE_MESSAGE_SEVERITY) -> BOOL, - GetBreakOnID: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID, ID: INFO_QUEUE_MESSAGE_ID) -> BOOL, - SetMuteDebugOutput: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID, bMute: BOOL), - GetMuteDebugOutput: proc "stdcall" (this: ^IInfoQueue, Producer: DEBUG_ID) -> BOOL, + SetMessageCountLimit: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID, MessageCountLimit: UINT64) -> HRESULT, + ClearStoredMessages: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID), + GetMessage: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID, MessageIndex: UINT64, pMessage: ^INFO_QUEUE_MESSAGE, pMessageByteLength: ^SIZE_T) -> HRESULT, + GetNumStoredMessagesAllowedByRetrievalFilters: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID) -> UINT64, + GetNumStoredMessages: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID) -> UINT64, + GetNumMessagesDiscardedByMessageCountLimit: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID) -> UINT64, + GetMessageCountLimit: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID) -> UINT64, + GetNumMessagesAllowedByStorageFilter: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID) -> UINT64, + GetNumMessagesDeniedByStorageFilter: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID) -> UINT64, + AddStorageFilterEntries: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID, pFilter: INFO_QUEUE_FILTER) -> HRESULT, + GetStorageFilter: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID, pFilter: ^INFO_QUEUE_FILTER, pFilterByteLength: ^SIZE_T) -> HRESULT, + ClearStorageFilter: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID), + PushEmptyStorageFilter: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID) -> HRESULT, + PushDenyAllStorageFilter: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID) -> HRESULT, + PushCopyOfStorageFilter: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID) -> HRESULT, + PushStorageFilter: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID, pFilter: ^INFO_QUEUE_FILTER) -> HRESULT, + PopStorageFilter: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID), + GetStorageFilterStackSize: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID) -> UINT, + AddRetrievalFilterEntries: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID, pFilter: ^INFO_QUEUE_FILTER) -> HRESULT, + GetRetrievalFilter: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID, pFilter: ^INFO_QUEUE_FILTER, pFilterByteLength: ^SIZE_T) -> HRESULT, + ClearRetrievalFilter: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID), + PushEmptyRetrievalFilter: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID) -> HRESULT, + PushDenyAllRetrievalFilter: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID) -> HRESULT, + PushCopyOfRetrievalFilter: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID) -> HRESULT, + PushRetrievalFilter: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID, pFilter: ^INFO_QUEUE_FILTER) -> HRESULT, + PopRetrievalFilter: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID), + GetRetrievalFilterStackSize: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID) -> UINT, + AddMessage: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID, Category: INFO_QUEUE_MESSAGE_CATEGORY, Severity: INFO_QUEUE_MESSAGE_SEVERITY, ID: INFO_QUEUE_MESSAGE_ID, pDescription: LPCSTR) -> HRESULT, + AddApplicationMessage: proc "system" (this: ^IInfoQueue, Severity: INFO_QUEUE_MESSAGE_SEVERITY, pDescription: LPCSTR) -> HRESULT, + SetBreakOnCategory: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID, Category: INFO_QUEUE_MESSAGE_CATEGORY, bEnable: BOOL) -> HRESULT, + SetBreakOnSeverity: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID, Severity: INFO_QUEUE_MESSAGE_SEVERITY, bEnable: BOOL) -> HRESULT, + SetBreakOnID: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID, ID: INFO_QUEUE_MESSAGE_ID, bEnable: BOOL) -> HRESULT, + GetBreakOnCategory: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID, Category: INFO_QUEUE_MESSAGE_CATEGORY) -> BOOL, + GetBreakOnSeverity: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID, Severity: INFO_QUEUE_MESSAGE_SEVERITY) -> BOOL, + GetBreakOnID: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID, ID: INFO_QUEUE_MESSAGE_ID) -> BOOL, + SetMuteDebugOutput: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID, bMute: BOOL), + GetMuteDebugOutput: proc "system" (this: ^IInfoQueue, Producer: DEBUG_ID) -> BOOL, } IDebug_UUID_STRING :: "119E7452-DE9E-40fe-8806-88F90C12B441" @@ -124,7 +124,7 @@ IDebug :: struct #raw_union { } IDebug_VTable :: struct { using iunknown_vtable: IUnknown_VTable, - ReportLiveObjects: proc "stdcall" (this: ^IDebug, apiid: GUID, flags: DEBUG_RLO_FLAGS), + ReportLiveObjects: proc "system" (this: ^IDebug, apiid: GUID, flags: DEBUG_RLO_FLAGS), } IDebug1_UUID_STRING :: "c5a05f0c-16f2-4adf-9f4d-a8c4d58ac550" @@ -135,7 +135,7 @@ IDebug1 :: struct #raw_union { } IDebug1_VTable :: struct { using idxgidebug_vtable: IDebug_VTable, - EnableLeakTrackingForThread: proc "stdcall" (this: ^IDebug1), - DisableLeakTrackingForThread: proc "stdcall" (this: ^IDebug1), - IsLeakTrackingEnabledForThread: proc "stdcall" (this: ^IDebug1) -> BOOL, + EnableLeakTrackingForThread: proc "system" (this: ^IDebug1), + DisableLeakTrackingForThread: proc "system" (this: ^IDebug1), + IsLeakTrackingEnabledForThread: proc "system" (this: ^IDebug1) -> BOOL, } diff --git a/vendor/glfw/native_darwin.odin b/vendor/glfw/native_darwin.odin index e1a23e97d..181a53e24 100644 --- a/vendor/glfw/native_darwin.odin +++ b/vendor/glfw/native_darwin.odin @@ -2,7 +2,7 @@ package glfw -import NS "vendor:darwin/foundation" +import NS "vendor:darwin/Foundation" when GLFW_SHARED { #panic("Dynamic linking for glfw is not supported for darwin yet") diff --git a/vendor/miniaudio/common.odin b/vendor/miniaudio/common.odin index ee28e38cc..e77d265bd 100644 --- a/vendor/miniaudio/common.odin +++ b/vendor/miniaudio/common.odin @@ -10,10 +10,8 @@ when MINIAUDIO_SHARED { when ODIN_OS == .Windows { foreign import lib "lib/miniaudio.lib" -} else when ODIN_OS == .Linux { - foreign import lib "lib/miniaudio.a" } else { - foreign import lib "system:miniaudio" + foreign import lib "lib/miniaudio.a" } handle :: distinct rawptr diff --git a/vendor/miniaudio/data_conversion.odin b/vendor/miniaudio/data_conversion.odin index ffcf2fcb3..d75872665 100644 --- a/vendor/miniaudio/data_conversion.odin +++ b/vendor/miniaudio/data_conversion.odin @@ -4,10 +4,8 @@ import "core:c" when ODIN_OS == .Windows { foreign import lib "lib/miniaudio.lib" -} else when ODIN_OS == .Linux { - foreign import lib "lib/miniaudio.a" } else { - foreign import lib "system:miniaudio" + foreign import lib "lib/miniaudio.a" } /************************************************************************************************************************************************************ diff --git a/vendor/miniaudio/decoding.odin b/vendor/miniaudio/decoding.odin index 003f6f950..4433aa5a7 100644 --- a/vendor/miniaudio/decoding.odin +++ b/vendor/miniaudio/decoding.odin @@ -4,10 +4,8 @@ import "core:c" when ODIN_OS == .Windows { foreign import lib "lib/miniaudio.lib" -} else when ODIN_OS == .Linux { - foreign import lib "lib/miniaudio.a" } else { - foreign import lib "system:miniaudio" + foreign import lib "lib/miniaudio.a" } /************************************************************************************************************************************************************ diff --git a/vendor/miniaudio/device_io_procs.odin b/vendor/miniaudio/device_io_procs.odin index de60645e4..7f39eb84f 100644 --- a/vendor/miniaudio/device_io_procs.odin +++ b/vendor/miniaudio/device_io_procs.odin @@ -2,10 +2,8 @@ package miniaudio when ODIN_OS == .Windows { foreign import lib "lib/miniaudio.lib" -} else when ODIN_OS == .Linux { - foreign import lib "lib/miniaudio.a" } else { - foreign import lib "system:miniaudio" + foreign import lib "lib/miniaudio.a" } import "core:c" diff --git a/vendor/miniaudio/effects.odin b/vendor/miniaudio/effects.odin index e86d670d9..d1bf7e9e8 100644 --- a/vendor/miniaudio/effects.odin +++ b/vendor/miniaudio/effects.odin @@ -4,10 +4,8 @@ import c "core:c/libc" when ODIN_OS == .Windows { foreign import lib "lib/miniaudio.lib" -} else when ODIN_OS == .Linux { - foreign import lib "lib/miniaudio.a" } else { - foreign import lib "system:miniaudio" + foreign import lib "lib/miniaudio.a" } /* diff --git a/vendor/miniaudio/encoding.odin b/vendor/miniaudio/encoding.odin index ee396466a..f2318457c 100644 --- a/vendor/miniaudio/encoding.odin +++ b/vendor/miniaudio/encoding.odin @@ -4,10 +4,8 @@ import "core:c" when ODIN_OS == .Windows { foreign import lib "lib/miniaudio.lib" -} else when ODIN_OS == .Linux { - foreign import lib "lib/miniaudio.a" } else { - foreign import lib "system:miniaudio" + foreign import lib "lib/miniaudio.a" } /************************************************************************************************************************************************************ diff --git a/vendor/miniaudio/engine.odin b/vendor/miniaudio/engine.odin index 935d54744..0f4ba3353 100644 --- a/vendor/miniaudio/engine.odin +++ b/vendor/miniaudio/engine.odin @@ -4,10 +4,8 @@ import "core:c" when ODIN_OS == .Windows { foreign import lib "lib/miniaudio.lib" -} else when ODIN_OS == .Linux { - foreign import lib "lib/miniaudio.a" } else { - foreign import lib "system:miniaudio" + foreign import lib "lib/miniaudio.a" } /************************************************************************************************************************************************************ diff --git a/vendor/miniaudio/filtering.odin b/vendor/miniaudio/filtering.odin index b8175c372..f3bde3371 100644 --- a/vendor/miniaudio/filtering.odin +++ b/vendor/miniaudio/filtering.odin @@ -4,10 +4,8 @@ import c "core:c/libc" when ODIN_OS == .Windows { foreign import lib "lib/miniaudio.lib" -} else when ODIN_OS == .Linux { - foreign import lib "lib/miniaudio.a" } else { - foreign import lib "system:miniaudio" + foreign import lib "lib/miniaudio.a" } /************************************************************************************************************************************************************** diff --git a/vendor/miniaudio/generation.odin b/vendor/miniaudio/generation.odin index 305090c7d..f93d3afab 100644 --- a/vendor/miniaudio/generation.odin +++ b/vendor/miniaudio/generation.odin @@ -4,10 +4,8 @@ import "core:c" when ODIN_OS == .Windows { foreign import lib "lib/miniaudio.lib" -} else when ODIN_OS == .Linux { - foreign import lib "lib/miniaudio.a" } else { - foreign import lib "system:miniaudio" + foreign import lib "lib/miniaudio.a" } waveform_type :: enum c.int { diff --git a/vendor/miniaudio/job_queue.odin b/vendor/miniaudio/job_queue.odin index 99899fdbd..1b9389af7 100644 --- a/vendor/miniaudio/job_queue.odin +++ b/vendor/miniaudio/job_queue.odin @@ -4,10 +4,8 @@ import c "core:c/libc" when ODIN_OS == .Windows { foreign import lib "lib/miniaudio.lib" -} else when ODIN_OS == .Linux { - foreign import lib "lib/miniaudio.a" } else { - foreign import lib "system:miniaudio" + foreign import lib "lib/miniaudio.a" } /* diff --git a/vendor/miniaudio/logging.odin b/vendor/miniaudio/logging.odin index b03778079..6fb94f4b0 100644 --- a/vendor/miniaudio/logging.odin +++ b/vendor/miniaudio/logging.odin @@ -4,10 +4,8 @@ import c "core:c/libc" when ODIN_OS == .Windows { foreign import lib "lib/miniaudio.lib" -} else when ODIN_OS == .Linux { - foreign import lib "lib/miniaudio.a" } else { - foreign import lib "system:miniaudio" + foreign import lib "lib/miniaudio.a" } MAX_LOG_CALLBACKS :: 4 diff --git a/vendor/miniaudio/node_graph.odin b/vendor/miniaudio/node_graph.odin index c0df39c0f..531a8e6d8 100644 --- a/vendor/miniaudio/node_graph.odin +++ b/vendor/miniaudio/node_graph.odin @@ -4,10 +4,8 @@ import "core:c" when ODIN_OS == .Windows { foreign import lib "lib/miniaudio.lib" -} else when ODIN_OS == .Linux { - foreign import lib "lib/miniaudio.a" } else { - foreign import lib "system:miniaudio" + foreign import lib "lib/miniaudio.a" } /************************************************************************************************************************************************************ diff --git a/vendor/miniaudio/resource_manager.odin b/vendor/miniaudio/resource_manager.odin index e67d4a475..661ece468 100644 --- a/vendor/miniaudio/resource_manager.odin +++ b/vendor/miniaudio/resource_manager.odin @@ -4,10 +4,8 @@ import "core:c" when ODIN_OS == .Windows { foreign import lib "lib/miniaudio.lib" -} else when ODIN_OS == .Linux { - foreign import lib "lib/miniaudio.a" } else { - foreign import lib "system:miniaudio" + foreign import lib "lib/miniaudio.a" } /************************************************************************************************************************************************************ diff --git a/vendor/miniaudio/synchronization.odin b/vendor/miniaudio/synchronization.odin index 2f0b41f5d..cd4b0a5f0 100644 --- a/vendor/miniaudio/synchronization.odin +++ b/vendor/miniaudio/synchronization.odin @@ -2,10 +2,8 @@ package miniaudio when ODIN_OS == .Windows { foreign import lib "lib/miniaudio.lib" -} else when ODIN_OS == .Linux { - foreign import lib "lib/miniaudio.a" } else { - foreign import lib "system:miniaudio" + foreign import lib "lib/miniaudio.a" } @(default_calling_convention="c", link_prefix="ma_") diff --git a/vendor/miniaudio/utilities.odin b/vendor/miniaudio/utilities.odin index 708cc820e..f4db00380 100644 --- a/vendor/miniaudio/utilities.odin +++ b/vendor/miniaudio/utilities.odin @@ -4,10 +4,8 @@ import c "core:c/libc" when ODIN_OS == .Windows { foreign import lib "lib/miniaudio.lib" -} else when ODIN_OS == .Linux { - foreign import lib "lib/miniaudio.a" } else { - foreign import lib "system:miniaudio" + foreign import lib "lib/miniaudio.a" } @(default_calling_convention="c", link_prefix="ma_") diff --git a/vendor/miniaudio/vfs.odin b/vendor/miniaudio/vfs.odin index 9731c713f..475d118fc 100644 --- a/vendor/miniaudio/vfs.odin +++ b/vendor/miniaudio/vfs.odin @@ -4,10 +4,8 @@ import "core:c" when ODIN_OS == .Windows { foreign import lib "lib/miniaudio.lib" -} else when ODIN_OS == .Linux { - foreign import lib "lib/miniaudio.a" } else { - foreign import lib "system:miniaudio" + foreign import lib "lib/miniaudio.a" } /************************************************************************************************************************************************************ diff --git a/vendor/raylib/raylib.odin b/vendor/raylib/raylib.odin index 6d0ac4544..b4f0af2b3 100644 --- a/vendor/raylib/raylib.odin +++ b/vendor/raylib/raylib.odin @@ -1085,7 +1085,7 @@ foreign lib { // Misc. functions TakeScreenshot :: proc(fileName: cstring) --- // Takes a screenshot of current screen (filename extension defines format) - SetConfigFlags :: proc(flags: ConfigFlags) --- // Setup init configuration flags (view FLAGS) + SetConfigFlags :: proc(flags: ConfigFlags) --- // Setup init configuration flags (view FLAGS). NOTE: This function is expected to be called before window creation OpenURL :: proc(url: cstring) --- // Open URL with default system browser (if available) // NOTE: Following functions implemented in module [utils] @@ -1219,7 +1219,8 @@ foreign lib { //------------------------------------------------------------------------------------ SetGesturesEnabled :: proc(flags: Gestures) --- // Enable a set of gestures using flags - IsGestureDetected :: proc(gesture: Gesture) -> bool --- // Check if a gesture have been detected + // IsGestureDetected :: proc(gesture: Gesture) -> bool --- // Check if a gesture have been detected + GetGestureDetected :: proc() -> Gestures --- // Get latest detected gesture GetGestureHoldDuration :: proc() -> f32 --- // Get gesture hold time in milliseconds GetGestureDragVector :: proc() -> Vector2 --- // Get gesture drag vector @@ -1713,13 +1714,23 @@ foreign lib { // Workaround for broken IsMouseButtonUp in Raylib 5.0. when VERSION == "5.0" { - IsMouseButtonUp :: proc(button: MouseButton) -> bool { + IsMouseButtonUp :: proc "c" (button: MouseButton) -> bool { return !IsMouseButtonDown(button) } } else { #panic("Remove this this when block and everything inside it for Raylib > 5.0. It's just here to fix a bug in Raylib 5.0. See IsMouseButtonUp inside 'foreign lib {' block.") } +// Check if a gesture have been detected +IsGestureDetected :: proc "c" (gesture: Gesture) -> bool { + @(default_calling_convention="c") + foreign lib { + IsGestureDetected :: proc "c" (gesture: Gestures) -> bool --- + } + return IsGestureDetected({gesture}) +} + + // Text formatting with variables (sprintf style) TextFormat :: proc(text: cstring, args: ..any) -> cstring { @static buffers: [MAX_TEXTFORMAT_BUFFERS][MAX_TEXT_BUFFER_LENGTH]byte @@ -1763,7 +1774,7 @@ MemAllocatorProc :: proc(allocator_data: rawptr, mode: mem.Allocator_Mode, MemFree(old_memory) return nil, nil - case .Resize: + case .Resize, .Resize_Non_Zeroed: ptr := MemRealloc(old_memory, c.uint(size)) if ptr == nil { err = .Out_Of_Memory diff --git a/vendor/stb/image/stb_image.odin b/vendor/stb/image/stb_image.odin index c1e31c7b2..c7caf801e 100644 --- a/vendor/stb/image/stb_image.odin +++ b/vendor/stb/image/stb_image.odin @@ -4,9 +4,10 @@ import c "core:c/libc" #assert(size_of(c.int) == size_of(b32)) -when ODIN_OS == .Windows { foreign import stbi "../lib/stb_image.lib" } -when ODIN_OS == .Linux { foreign import stbi "../lib/stb_image.a" } -when ODIN_OS == .Darwin { foreign import stbi "../lib/darwin/stb_image.a" } + when ODIN_OS == .Windows { foreign import stbi "../lib/stb_image.lib" } +else when ODIN_OS == .Linux { foreign import stbi "../lib/stb_image.a" } +else when ODIN_OS == .Darwin { foreign import stbi "../lib/darwin/stb_image.a" } +else { foreign import stbi "system:stb_image" } #assert(size_of(b32) == size_of(c.int)) diff --git a/vendor/stb/image/stb_image_resize.odin b/vendor/stb/image/stb_image_resize.odin index 509f79fb8..c464964df 100644 --- a/vendor/stb/image/stb_image_resize.odin +++ b/vendor/stb/image/stb_image_resize.odin @@ -2,9 +2,11 @@ package stb_image import c "core:c/libc" -when ODIN_OS == .Windows { foreign import lib "../lib/stb_image_resize.lib" } -when ODIN_OS == .Linux { foreign import lib "../lib/stb_image_resize.a" } -when ODIN_OS == .Darwin { foreign import lib "../lib/darwin/stb_image_resize.a" } + when ODIN_OS == .Windows { foreign import lib "../lib/stb_image_resize.lib" } +else when ODIN_OS == .Linux { foreign import lib "../lib/stb_image_resize.a" } +else when ODIN_OS == .Darwin { foreign import lib "../lib/darwin/stb_image_resize.a" } +else { foreign import lib "system:stb_image_resize" } + ////////////////////////////////////////////////////////////////////////////// // diff --git a/vendor/stb/image/stb_image_write.odin b/vendor/stb/image/stb_image_write.odin index f830050a8..9ed97eb48 100644 --- a/vendor/stb/image/stb_image_write.odin +++ b/vendor/stb/image/stb_image_write.odin @@ -2,9 +2,10 @@ package stb_image import c "core:c/libc" -when ODIN_OS == .Windows { foreign import stbiw "../lib/stb_image_write.lib" } -when ODIN_OS == .Linux { foreign import stbiw "../lib/stb_image_write.a" } -when ODIN_OS == .Darwin { foreign import stbiw "../lib/darwin/stb_image_write.a" } + when ODIN_OS == .Windows { foreign import stbiw "../lib/stb_image_write.lib" } +else when ODIN_OS == .Linux { foreign import stbiw "../lib/stb_image_write.a" } +else when ODIN_OS == .Darwin { foreign import stbiw "../lib/darwin/stb_image_write.a" } +else { foreign import stbiw "system:stb_image_write" } write_func :: proc "c" (ctx: rawptr, data: rawptr, size: c.int) diff --git a/vendor/stb/rect_pack/stb_rect_pack.odin b/vendor/stb/rect_pack/stb_rect_pack.odin index 8abb4710a..dd70e6d8f 100644 --- a/vendor/stb/rect_pack/stb_rect_pack.odin +++ b/vendor/stb/rect_pack/stb_rect_pack.odin @@ -4,9 +4,10 @@ import c "core:c/libc" #assert(size_of(b32) == size_of(c.int)) -when ODIN_OS == .Windows { foreign import lib "../lib/stb_rect_pack.lib" } -when ODIN_OS == .Linux { foreign import lib "../lib/stb_rect_pack.a" } -when ODIN_OS == .Darwin { foreign import lib "../lib/darwin/stb_rect_pack.a" } + when ODIN_OS == .Windows { foreign import lib "../lib/stb_rect_pack.lib" } +else when ODIN_OS == .Linux { foreign import lib "../lib/stb_rect_pack.a" } +else when ODIN_OS == .Darwin { foreign import lib "../lib/darwin/stb_rect_pack.a" } +else { foreign import lib "system:stb_rect_pack" } Coord :: distinct c.int _MAXVAL :: max(Coord) diff --git a/vendor/stb/truetype/stb_truetype.odin b/vendor/stb/truetype/stb_truetype.odin index 5b0022da2..1600041de 100644 --- a/vendor/stb/truetype/stb_truetype.odin +++ b/vendor/stb/truetype/stb_truetype.odin @@ -3,9 +3,10 @@ package stb_truetype import c "core:c" import stbrp "vendor:stb/rect_pack" -when ODIN_OS == .Windows { foreign import stbtt "../lib/stb_truetype.lib" } -when ODIN_OS == .Linux { foreign import stbtt "../lib/stb_truetype.a" } -when ODIN_OS == .Darwin { foreign import stbtt "../lib/darwin/stb_truetype.a" } + when ODIN_OS == .Windows { foreign import stbtt "../lib/stb_truetype.lib" } +else when ODIN_OS == .Linux { foreign import stbtt "../lib/stb_truetype.a" } +else when ODIN_OS == .Darwin { foreign import stbtt "../lib/darwin/stb_truetype.a" } +else { foreign import stbtt "system:stb_truetype" } /////////////////////////////////////////////////////////////////////////////// diff --git a/vendor/stb/vorbis/stb_vorbis.odin b/vendor/stb/vorbis/stb_vorbis.odin index 8804dda80..0c887a473 100644 --- a/vendor/stb/vorbis/stb_vorbis.odin +++ b/vendor/stb/vorbis/stb_vorbis.odin @@ -3,9 +3,10 @@ package stb_vorbis import c "core:c/libc" -when ODIN_OS == .Windows { foreign import lib "../lib/stb_vorbis.lib" } -when ODIN_OS == .Linux { foreign import lib "../lib/stb_vorbis.a" } -when ODIN_OS == .Darwin { foreign import lib "../lib/darwin/stb_vorbis.a" } + when ODIN_OS == .Windows { foreign import lib "../lib/stb_vorbis.lib" } +else when ODIN_OS == .Linux { foreign import lib "../lib/stb_vorbis.a" } +else when ODIN_OS == .Darwin { foreign import lib "../lib/darwin/stb_vorbis.a" } +else { foreign import lib "system:stb_vorbis" }