Lines Matching refs:the
6 ; Licensed under the Apache License, Version 2.0 (the "License");
7 ; you may not use this file except in compliance with the License.
8 ; You may obtain a copy of the License at
13 ; distributed under the License is distributed on an "AS IS" BASIS,
15 ; See the License for the specific language governing permissions and
16 ; limitations under the License.
22 ; This code is used to pass on device (including physical device) extensions through the call chain. It must do this without
23 ; creating a stack frame, because the actual parameters of the call are not known. Since the first parameter is known to be a
24 ; VkPhysicalDevice or a dispatchable object it can unwrap the object, possibly overwriting the wrapped physical device, and then
25 ; jump to the next function in the call chain
28 ; Struct member offsets are defined in the format "XX_OFFSET_YY" where XX indicates the member within the struct and YY indicates
29 ; the struct type that it is a member of. Data type sizes are defined in the format "XX_SIZE" where XX indicates the data type.
38 mov rax, qword ptr [rcx] ; Dereference the wrapped VkPhysicalDevice to get the dispatch table in rax
39 mov rcx, qword ptr [rcx + PHYS_DEV_OFFSET_PHYS_DEV_TRAMP] ; Load the unwrapped VkPhysicalDevice into rcx
40 jmp qword ptr [rax + (PHYS_DEV_OFFSET_INST_DISPATCH + (PTR_SIZE * num))] ; Jump to the next function in the chain, preserving the args in other registers
46 mov rax, qword ptr [rcx + ICD_TERM_OFFSET_PHYS_DEV_TERM] ; Store the loader_icd_term* in rax
47 cmp qword ptr [rax + (DISPATCH_OFFSET_ICD_TERM + (PTR_SIZE * num))], 0 ; Check if the next function in the chain is NULL
48 je terminError&num& ; Go to the error section if it is NULL
49 mov rcx, qword ptr [rcx + PHYS_DEV_OFFSET_PHYS_DEV_TERM] ; Load the unwrapped VkPhysicalDevice into the first arg
50 jmp qword ptr [rax + (DISPATCH_OFFSET_ICD_TERM + (PTR_SIZE * num))] ; Jump to the next function in the chain
52 sub rsp, 56 ; Create the stack frame
53 mov rcx, qword ptr [rax + INSTANCE_OFFSET_ICD_TERM] ; Load the loader_instance into rcx (first arg)
54 mov rax, qword ptr [rcx + (FUNCTION_OFFSET_INSTANCE + (CHAR_PTR_SIZE * num))] ; Load the func name into rax
55 lea r9, termin_error_string ; Load the error string into r9 (fourth arg)
57 mov qword ptr [rsp + 32], rax ; Move the func name onto the stack (fifth arg)
58 lea edx, [r8 + VULKAN_LOADER_ERROR_BIT] ; Write the error logging bit to rdx (second arg)
59 call loader_log ; Log the error message before we crash
60 add rsp, 56 ; Clean up the stack frame
68 mov rax, qword ptr [rcx] ; Dereference the handle to get the dispatch table
69 jmp qword ptr [rax + (EXT_OFFSET_DEVICE_DISPATCH + (PTR_SIZE * num))] ; Jump to the appropriate call chain
78 mov eax, dword ptr [esp + 4] ; Load the wrapped VkPhysicalDevice into eax
79 mov ecx, [eax + PHYS_DEV_OFFSET_PHYS_DEV_TRAMP] ; Load the unwrapped VkPhysicalDevice into ecx
80 mov [esp + 4], ecx ; Overwrite the wrapped VkPhysicalDevice with the unwrapped one (on the stack)
81 mov eax, [eax] ; Dereference the wrapped VkPhysicalDevice to get the dispatch table in eax
82 jmp dword ptr [eax + (PHYS_DEV_OFFSET_INST_DISPATCH + (PTR_SIZE * num))] ; Jump to the next function in the chain, preserving the args on the stack
88 mov ecx, dword ptr [esp + 4] ; Move the wrapped VkPhysicalDevice into ecx
89 mov eax, dword ptr [ecx + ICD_TERM_OFFSET_PHYS_DEV_TERM] ; Store the loader_icd_term* in eax
90 cmp dword ptr [eax + (DISPATCH_OFFSET_ICD_TERM + (PTR_SIZE * num))], 0 ; Check if the next function in the chain is NULL
91 je terminError&num& ; Go to the error section if it is NULL
92 mov ecx, dword ptr [ecx + PHYS_DEV_OFFSET_PHYS_DEV_TERM] ; Unwrap the VkPhysicalDevice in ecx
93 mov dword ptr [esp + 4], ecx ; Copy the unwrapped VkPhysicalDevice into the first arg
94 jmp dword ptr [eax + (DISPATCH_OFFSET_ICD_TERM + (PTR_SIZE * num))] ; Jump to the next function in the chain
96 mov eax, dword ptr [eax + INSTANCE_OFFSET_ICD_TERM] ; Load the loader_instance into eax
97 push dword ptr [eax + (FUNCTION_OFFSET_INSTANCE + (CHAR_PTR_SIZE * num))] ; Push the func name (fifth arg)
98 push offset termin_error_string ; Push the error string (fourth arg)
100 push VULKAN_LOADER_ERROR_BIT ; Push the error logging bit (second arg)
101 push eax ; Push the loader_instance (first arg)
102 call _loader_log ; Log the error message before we crash
103 add esp, 20 ; Clean up the args
111 mov eax, dword ptr [esp + 4] ; Dereference the handle to get VkDevice chain_device
112 mov eax, dword ptr [eax] ; Dereference the chain_device to get the loader_dispatch
113 jmp dword ptr [eax + (EXT_OFFSET_DEVICE_DISPATCH + (PTR_SIZE * num))] ; Jump to the appropriate call chain