Commit Graph

308 Commits

Author SHA1 Message Date
Mark Lobodzinski
44029ebf63 layers: Update dispatch tables for new 1.0.25 APIs
Change-Id: I001583402bc99f923a776b238a82db5a60398f03
2018-05-04 09:24:25 -06:00
Mark Lobodzinski
ea73e13195 layers: Move debug action enums from vk_layer.h
Moved debug-report related items from vk_layer.h. Enums are now in
vk_layer_logging.h and DbgFunctionNode has been moved into a new
loader header file vk_loader_layer.h.

Change-Id: I6031146ba474ff01ca039da44ad5d42d054383a3
2018-05-04 09:24:24 -06:00
Mark Lobodzinski
52a063d4fd layers: Add default layer error message config
Allows layers to output error messages even if no vk_layer_settings.txt
config file is present. Sets defaults to LOG_MSG, error, stdout.
A layer settings file will override any default values. If no settings
file is present and an app creates a debug callback, the default
callbacks will be removed and unregistered.

Change-Id: I49f37189665816df58c258b9e9629f2bf76751c8
2018-05-04 09:24:24 -06:00
Jon Ashburn
43c20176c9 misc: Update licenses to Apache 2.0
Change-Id: Id447f4c8c53d33f9192940bdd3ae727b7b738a97
2018-05-04 09:24:24 -06:00
ttyio
697fe6b9ef layers: Update typo in comment 2018-05-04 09:24:24 -06:00
Vinjn Zhang
7424dfbe4b Update vk_layer.h
Correct comment for VkLayer*CreateInfo's sType
2018-05-04 09:24:24 -06:00
Jon Ashburn
4e7a9528f9 loader: Add device callback to set dispatchable object
Change-Id: I5ca8f532e777e2cb0facf8fe5bab4c82409f8d37
2018-05-04 09:24:24 -06:00
Jon Ashburn
f54813d16e loader: Remove the device_info in the layer chain structure
Simplifies code, the loader device structure is passed down from
    trampoline code to terminator code via the pDevice parameter. It doesn't
    need to be added to this pCreatInfo pNext list structure.

    Layers which modifiy pDevice whould do it on the way up the chain not going
    down the chain.

Change-Id: Ibf7e4ffdc1a36f52b1a99389dcab25d572655aec
2018-05-04 09:24:24 -06:00
Jon Ashburn
c51485f24a loader: Add instance callback to set dispatchable objects
Change-Id: I73b8b6edfee491c53216b730c99a7ea34ade3b4e
2018-05-04 09:24:23 -06:00
Jon Ashburn
4e58a0e4d8 loader: Remove the instance_info in the layer chain structure
Simplifies code, the loader instance structure is already passed down
from trampoline code to terminator code via the pInstance parameter. It doesn't
need to be added to this pCreatInfo pNext list structure.

Layers which modifiy pInstance whould do it on the way up the chain not going
down the chain.

Change-Id: I59581b94871c094995787808cf5ae2955ad0191a
2018-05-04 09:24:23 -06:00
Jon Ashburn
ca104ab49f loader: gllvl #50, Add support for the WSI extension KHR_display
Change-Id: I8d5ecc7500beba3042a6b9147b2f3fd3055b3b1d
2018-05-04 09:24:23 -06:00
Jon Ashburn
6b485f1d3a misc: Remove lunarg_debug_marker extension
This device extensions was not completely supported in any layer. It had partial
support (intercept) in draw_state  and device_limits. This extension is being
changed and has a formal proposal in Khronos as debug_marker_ext. Removing
the existing extension since it is deprecated; once the debug_marker_ext gets
registered by Khronos, layers might want to start using the ObjectTag/ObjectName
commands to supplement error report messages in debug_report_ext. Since
debug_report_ext might get changed as part of Khronos review, don't add it yet.
2018-05-04 09:24:23 -06:00
Mark Lobodzinski
ca619321bb header: Update 1.0.3 header revision for inclusion of debug report extension
Removed vk_ext_debug_report.h (contents moved into vulkan.h)
Renamed debug report message enums
2018-05-04 09:24:23 -06:00
Karl Schultz
096f4e1df9 include: Use single-quote no paths when including sibling headers 2018-05-04 09:24:23 -06:00
Karl Schultz
0eefd1492e Remove Khronos confidential clause from license text. 2018-05-04 09:24:23 -06:00
Karl Schultz
e9e45c6f5e include: Update copyright and apply clang-format (no logic changes) 2018-05-04 09:24:22 -06:00
Jon Ashburn
8fcaf5fa29 layers: Remove obsolete VkbaseLayerObject 2018-05-04 09:24:22 -06:00
Courtney Goeltzenleuchter
e77fdadb24 loader: Remove CreateInstance and CreateDevice
The new init mechanism always uses GetInstanceProcAddr
to query the next layer's CreateInstance or CreateDevice
function. Thus no reason to cache those function pointers
in the instance dispatch table.
2018-05-04 09:24:22 -06:00
Courtney Goeltzenleuchter
1d081fd08d loader: implement new layer init method
New layer init method requires the construction of
Link information for CreateInstance and CreateDevice
that is accessible to layers via the CreateInfo.pNext pointer.
The layer can then use the Get*ProcAddr from the Link
structure to initialize their dispatch table if the
call down the chain returns successfully.
This removes the need to do special initialization work
at Get*ProcAddr time.
Layer Get*ProcAddr now return their internal function
pointers regardless of the value of instance or device.
Only need to have valid instance & device when looking
up extensions or when passing the request down the chain.
This mechanism allows us to remove object wrapping used
by the loader previously. Also simplifies the dispatch table
setup.

Conflicts:
	layers/device_limits.cpp
	layers/draw_state.cpp
	loader/loader.c
	loader/trampoline.c
2018-05-04 09:24:22 -06:00
Courtney Goeltzenleuchter
b5c860c835 loader: Add structures to support new init method
These structures will be used to extend CreateInstance
and CreateDevice to support layers. The loader will
create a chain of these structures - one per layer -
that tells the layer the Get*ProcAddr for the next
lower part.
2018-05-04 09:24:22 -06:00
Courtney Goeltzenleuchter
8bbfe41579 debug_report: MR141, Change pUserData to match type used elsewhere
Other uses of pUserData in Vulkan do not have a const qualifier,
remove it for this pUserData.
2018-05-04 09:24:22 -06:00
Courtney Goeltzenleuchter
ec1d0b277b debug_report: rename object type and error bits
Conflicts:
	demos/tri.c
	layers/device_limits.cpp
	layers/draw_state.cpp
	layers/image.cpp
	layers/mem_tracker.cpp
	layers/param_checker.cpp
	layers/vk_layer_logging.h
	loader/debug_report.c
	tests/layer_validation_tests.cpp
2018-05-04 09:24:22 -06:00
Courtney Goeltzenleuchter
39033a8239 debug_report: rename vk_lunarg_debug_report.h 2018-05-04 09:24:21 -06:00
Courtney Goeltzenleuchter
05936a934a debug_report: Add DebugReportMessage function 2018-05-04 09:24:21 -06:00
Courtney Goeltzenleuchter
3ca6b1236f debug_report: rename and update to use CreateInfo 2018-05-04 09:24:21 -06:00
Courtney Goeltzenleuchter
691cf5a57c debug_report: Rename VkDbgMsgCallback object 2018-05-04 09:24:21 -06:00
Mark Lobodzinski
d7f76a87d7 wsi: Make WSI cases more consistent, fail if not set correctly
Filled in build details for Mir, Wayland, etc.
2018-05-04 09:24:21 -06:00
Michael Lentine
05db2f0c54 android: Update build to define android platform at build time 2018-05-04 09:24:21 -06:00
Michael Lentine
810530e917 android: Fix android build.
Temporarily disable shader checker which now depends on glslang
Fix xcb guards and set the ifdef based on platform
2018-05-04 09:24:21 -06:00
Mark Lobodzinski
cde126104d wsi: Moved definition of CreateXxxSurface extension to CMakefile
Removed component-specific definitions
2018-05-04 09:24:21 -06:00
Ian Elliott
89145b9dd5 loader: Add vkGetPhysicalDevice*PresentationSupportKHR()
These queries involve trampoline and terminator functions (the latter
of which calls the ICD's function).
2018-05-04 09:24:20 -06:00
Jon Ashburn
74f08155f1 layers: add DestroySurfaceKHR to instance dispatch table 2018-05-04 09:24:20 -06:00
Ian Elliott
3dddf2dabe loader: Address Jon Ashburn's review comments.
It took a few commits (squashed down into 1) to get it correct.  Includes:

Use loader_heap_{alloc|free}().

Try to deal correctly with initializing the vkCreate*SurfaceKHR()'s.
2018-05-04 09:24:20 -06:00
Ian Elliott
70c8d1b8c3 loader: Get loader compiling. 2018-05-04 09:24:20 -06:00
Ian Elliott
03cdd37a54 WSI: Eliminate a lot of references to WSI header files.
Conflicts:
	include/vulkan/vk_layer.h
	loader/loader.h
2018-05-04 09:24:20 -06:00
David Pinedo
9f49f3c45b Layers: changed layer names to conform to spec 2018-05-04 09:24:20 -06:00
Jon Ashburn
dc8a8707bc loader: Add dynamic dispatch for unknown device extension entrypoints
GetInstancePorcAddr() is specified to return trampoline entrypoints for all
Vulkan core and extension entrypoints that are dispatched on an instance object
or a child of that instance object. However, typically, device extensions would
be unknown to the loader (don't want to rev the loader everytime an IHV creates
a new device extension).

This patch allows loader to dynamically discover device extension entrypoints
and configure generic trampoline code for these discovered device extensions.
2018-05-04 09:24:20 -06:00
David Pinedo
803896230a Moved header files from include to include/vulkan 2018-05-04 09:24:19 -06:00
Karl Schultz
09e2a11785 macOS: Add macOS support 2018-05-04 09:23:50 -06:00
Lenny Komow
8dc4305370 headers: Fix a typo in vk_icd.h
Change-Id: I9ede42e379605329ffd25a9466e0971b3ab7dd77
2018-05-04 09:23:50 -06:00
Mark Young
c253f7b760 loader: Add validation for apiVersion
Add a check to determine if the API version being requested can be
handled by the loader.  If it can't, then we return incompatible driver.
If we can, we continue along our merry way.

An addendum is that we also bumped the Loader/ICD interface version.
This was requested by Nvidia so that the ICDs know that we pay attention
to the version in the loader.  If they don't see the new Loader/ICD
interface version, they will handle the failing on all non-1.0 API
requests.

Change-Id: Icb7dd45e754c9f6a6c8186198333bacc68077b93
2018-05-04 09:23:50 -06:00
Yamakaky
1e7d756b7d headers: Add missing include to vk_icd.h 2018-05-04 09:23:49 -06:00
Mark Young
ebab9a4cd1 loader: Update the loader to 1.0.39
Add new extensions for 1.0.39.  Also, updated layers to include
minimal set of functionality for 1.0.39 extensions. Extensions include:
 - VK_KHR_get_physical_device_properties2
 - VK_KHR_shader_draw_parameters
 - VK_EXT_direct_mode_display
 - VK_EXT_display_surface_counter
 - VK_EXT_display_control

Also, redo the LoaderAndLayerIf document.

Change-Id: I10412086da7a798afe832a3892e18f606259b5af
2018-05-04 09:23:49 -06:00
Cody Northrop
8e34d8d84e android: Add Android and C++ support to a couple files
These are needed downstream in VulkanTools for Android support.
2018-05-04 09:23:49 -06:00
Piers Daniell
04f11cd232 loader: Fixes for ICD vk{Create|Destroy}SurfaceKHR
Need to keep VkIcdSurface private to the loader.

The definition may conflict with some redefinitions of
VK_DEFINE_NON_DISPATCHABLE_HANDLE and it's not necessary to make public
anyway.

Change-Id: I30e166f0ecce2fd3ea36c745dc073b705973d75f
2018-05-04 09:23:49 -06:00
Mark Young
d30f8ca53e loader: gh181 use ICD for SurfaceKHR
Use the ICD to create and destroy VkSurfaceKHR objects instead
of just performing the work in the ICD.  This only occurs if the ICD
exports the appropriate entry-points, and exposes version 3 of the
loader/icd interface.

Change-Id: I5e7bf9506318823c57ad75cf19d3f53fdfa6451e
2018-05-04 09:23:49 -06:00
Mark Lobodzinski
70144970cd headers: GH7, Fix bad variable names in vk_icd.h
Change-Id: Ic78792a71ebedbdb5bae68c47856db1c89a714af
2018-05-04 09:23:49 -06:00
Jon Ashburn
063be2d862 loader: ghlvl#180 Support a ICD interface version negotiation
Change-Id: I2e5c3717dd7fa86992f617bcc0f93de8ba60759e
2018-05-04 09:23:49 -06:00
Jon Ashburn
e32b0893ea misc: Update licenses to Apache 2.0
Change-Id: Id447f4c8c53d33f9192940bdd3ae727b7b738a97
2018-05-04 09:23:49 -06:00
Jon Ashburn
087d0a8a79 loader: gllvl #50, Add support for the WSI extension KHR_display
Change-Id: I8d5ecc7500beba3042a6b9147b2f3fd3055b3b1d
2018-05-04 09:23:48 -06:00