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
27 # The .hidden directive is only supported in ELF executables so in APPLE builds, the directive is removed
59 mov rax, [rdi + ICD_TERM_OFFSET_PHYS_DEV_TERM] # Store the loader_icd_term* in rax
60 cmp qword ptr [rax + (DISPATCH_OFFSET_ICD_TERM + (PTR_SIZE * \num))], 0 # Check if the next function in the chain is NULL
61 je terminError\num # Go to the error section if it is NULL
62 mov rdi, [rdi + PHYS_DEV_OFFSET_PHYS_DEV_TERM] # Load the unwrapped VkPhysicalDevice into the first arg
63 jmp [rax + (DISPATCH_OFFSET_ICD_TERM + (PTR_SIZE * \num))] # Jump to the next function in the chain
65 sub rsp, 56 # Create the stack frame
66 mov rdi, [rax + INSTANCE_OFFSET_ICD_TERM] # Load the loader_instance into rdi (first arg)
67 lea rsi, [VULKAN_LOADER_ERROR_BIT] # Write the error logging bit to rsi (second arg)
69 lea rcx, [rip + termin_error_string] # Load the error string into rcx (fourth arg)
70 mov r8, [rdi + (FUNCTION_OFFSET_INSTANCE + (CHAR_PTR_SIZE * \num))] # Load the func name into r8 (fifth arg)
71 call loader_log # Log the error message before we crash
72 add rsp, 56 # Clean up the stack frame
84 mov rax, [rdi] # Dereference the handle to get the dispatch table
85 jmp [rax + (EXT_OFFSET_DEVICE_DISPATCH + (PTR_SIZE * \num))] # Jump to the appropriate call chain
97 mov eax, [esp + 4] # Load the wrapped VkPhysicalDevice into eax
98 mov ecx, [eax + PHYS_DEV_OFFSET_PHYS_DEV_TRAMP] # Load the unwrapped VkPhysicalDevice into ecx
99 mov [esp + 4], ecx # Overwrite the wrapped VkPhysicalDevice with the unwrapped one (on the stack)
100 mov eax, [eax] # Dereference the wrapped VkPhysicalDevice to get the dispatch table in eax
101 jmp [eax + (PHYS_DEV_OFFSET_INST_DISPATCH + (PTR_SIZE * \num))] # Dereference the wrapped VkPhysicalDevice to get the dispatch table in eax
111 mov ecx, [esp + 4] # Move the wrapped VkPhysicalDevice into ecx
112 mov eax, [ecx + ICD_TERM_OFFSET_PHYS_DEV_TERM] # Store the loader_icd_term* in eax
113 cmp dword ptr [eax + (DISPATCH_OFFSET_ICD_TERM + (PTR_SIZE * \num))], 0 # Check if the next function in the chain is NULL
114 je terminError\num # Go to the error section if it is NULL
115 mov ecx, [ecx + PHYS_DEV_OFFSET_PHYS_DEV_TERM] # Unwrap the VkPhysicalDevice in ecx
116 mov [esp + 4], ecx # Copy the unwrapped VkPhysicalDevice into the first arg
117 jmp [eax + (DISPATCH_OFFSET_ICD_TERM + (PTR_SIZE * \num))] # Jump to the next function in the chain
119 mov eax, dword ptr [eax + INSTANCE_OFFSET_ICD_TERM] # Load the loader_instance into eax
120 push dword ptr [eax + (FUNCTION_OFFSET_INSTANCE + (CHAR_PTR_SIZE * \num))] # Push the func name (fourth arg)
122 push VULKAN_LOADER_ERROR_BIT # Push the error logging bit (second arg)
123 push eax # Push the loader_instance (first arg)
124 call loader_log_asm_function_not_supported # Log the error message before we crash
125 add esp, 20 # Clean up the args
137 mov eax, dword ptr [esp + 4] # Dereference the handle to get the dispatch table
138 mov eax, dword ptr [eax] # Dereference the chain_device to get the loader_dispatch
139 jmp dword ptr [eax + (EXT_OFFSET_DEVICE_DISPATCH + (PTR_SIZE * \num))] # Jump to the appropriate call chain