aboutsummaryrefslogtreecommitdiff
path: root/generator.py
AgeCommit message (Collapse)Author
2016-06-17Only set scripts that starts with a hashbang as executableAlexander F Rødseth
Remove executable bit from files like README.md Change-Id: I6a2a86e8312616c175845f0a3b777515a58c52b9
2016-06-01layers: More noautovalidity processing for structsDustin Graves
Apply 'noautovalidity' code generation logic to struct members. Previously, struct pointers tagged as noautovalidity were ignored by the code generator, but the members of non-NULL struct pointers were still processed. Now both the struct pointer and the struct members are ignored when the struct pointer has the 'noautovalidity' attribute. Change-Id: I14bc231210f2440fb8bb3df8c73ef165100f0daa
2016-05-24threading: drop vk prefix for layer functionsChia-I Wu
Drop VK_LAYER_EXPORT as well.
2016-05-24threading: put layer functions into a namespaceChia-I Wu
Put all layer fucntions/data into threading namespace. I had to add some wrappers to make everything work. This also removes vkEnumerateInstance*Properties from procmap. procmap is used in vkGetDeviceProcAddr and it should not contain vkEnumerateInstance*Properties in the first place.
2016-05-17layers: Ignore 'noautovalidity' params w/codgenDustin Graves
Add special handling to the parameter_validation layer's code generator for vk.xml parameters with the 'noautovalidty' attribute: - Ignore vk.xml parameters with the 'noautovalidity' attribute when generating code for the parameter_validation layer. - Implement custom validation routines for parameters with 'noautovalidity' tags. Issues-Addressed: GitHub 515 Change-Id: I1bd28cc79233fb8b040d6e107ed5e2176a84edb5
2016-05-11layers: Sync XML registry files from Vulkan-DocsDustin Graves
Sync the vk.xml and related Python scripts with the latest revisions from Vulkan-Docs: - Update local copy of vk.xml from Vulkan-Docs - Merge minor changes to genvk.py and generator.py from Vulkan-Docs to local copies - Add debug marker function pointers to VkLayerDispatchTable - Update parameter_validation code generation to support use of types across API features; The core API feature needs to be aware of a structure defined by the AMD_rasterization_order feature for the purpose of pNext validation - Modify thread_check code generation to add TODO messages for debug marker support Change-Id: I4d5b98683592f4ef404cb46e5b0f6ad519912382
2016-05-09layers: Add parameter_validation namespaceDustin Graves
Add parameter_validation namespace for utility functions. Namespace will be extended to include core layer functions in a future update. Change-Id: I0929f5caacbf3e1b4509f051ea020566cce44e3e
2016-05-05Add an output directory option to genvk.py.Jamie Madill
Currently for the threading utils and parameter checker generator, the script is hard-coded to write to the current directory. Add an option to add a custom output directory. Change-Id: Id1b72a934ead74d2f6c01ad4e581af83067d3f49
2016-04-28layers: Add 0 check for VkFlags array elementsDustin Graves
- Add parameter validation for the case where the elements in an array of VkFlags values must not be 0 - Replace the template parameter in the VkFlags validation functions with the VkFlags base type. Change-Id: Ie85d4d048b21e73409ff817425a1db64570e1b2f
2016-04-28layers: Add VkFlags parameter validationDustin Graves
Add parameter validation for VkFlags derived types to the parameter_validation layer's code generation scripts. The following validation checks are performed: - If a VkFlags parameter is not marked as optional in the XML, a message is generated when the parameter is 0. - If a VkFlags parameter is not 0, a message is generated if it combines bits that are not defined by its associated flag bits enumeration. - If a VkFlags parameter does not have an associated flag bits enumeration it is treated as a reserved value that must be 0. Change-Id: I6daed360cde46e2a27c84deda1e0798621f92d50
2016-04-28layers: Merge enum array NULL/value checksDustin Graves
- Merge the NULL checks and enumeration value checks performed for arrays of enumeration values into a single function call. This is consistent with the validation for arrays of other types. - Reduce duplicate array checking code. Change-Id: I8c4e05542bb2f52f5623fe6c7ed3629b9b2680e0
2016-04-26layers: Add missing compute stage sType checkDustin Graves
The parameter_validation code generator was only generating sType checks for pointers to structures. There is one case where a non-pointer struct parameter needs to be validated: the VkComputePipelineCreateInfo::stage member of the vkCreateComputePipelines pCreateInfos parameter. The code generator has been updated to handle this case. Change-Id: I1e695fcc875574eae94912ceb6338428d7ed8b49
2016-04-20layers: Add handle NULL checks to codegenDustin Graves
Add support for validating that required handle parameters are not specified as VK_NULL_HANDLE to the parameter validation layer's code generator. - Add new parameter validation utility functions to validate required handles and arrays of handles. - Add new parameter validation layer entrypoints for functions that previously had no parameters to validate. - Add handle validation logic to the parameter validation code generator. Change-Id: I7a5680954245db4c1b12587f78e30e17c3903d6c
2016-04-19misc: Update licenses to Apache 2.0Jon Ashburn
Change-Id: Id447f4c8c53d33f9192940bdd3ae727b7b738a97
2016-04-18layers: Make logicOp param validation conditionalDustin Graves
- Only validate that VkPipelineColorBlendStateCreateInfo::logicOp is a valid VkLogicOp enumeration value when VkPipelineColorBlendStateCreateInfo::logicOpEnable is set to VK_TRUE. - Remove redundant VkPipelineColorBlendStateCreateInfo validation (hand written code replaced by generated code). Change-Id: I075c58342678219c5ed1dd5c401e0da2cea53232
2016-04-18layers: Improved generated struct validation codeDustin Graves
Improvements to the parameter validation code generator, primarily to eliminate string concatenations performed when processing structs. A validation function was being produced for each struct, which received a string specifying the name of the struct parameter. This string was then concatenated with the names of the struct members. The struct validation code is no longer in a separate function, and a single string containing the full names of each struct member (eg. pCreateInfo->pApplicationInfo) is created at code generation time. Change-Id: I2800bfbc26247e4e4c6f8c885c0e7c4b8b3776a2
2016-04-18layers: Simplify generated param validation codeDustin Graves
- Remove unnecessary conditional checks for input vs. output parameters from the generated C++ code. - Split some generator code into smaller functions. Change-Id: I32e47d417ab884e5cc0fc7af40cb5657b39c176d
2016-04-07Change from using lxml to xml.etreeMike Stroyan
Use xml.etree for xml parsing for greater portability. Change-Id: Ic9b3b487e9b363a89d134d048db9fa79fbd66f6f
2016-04-06layers: Fix unsafe bool mix warnings (part 2)Dustin Graves
Fixes the MSVS warnings regarding unsafe mix of VkBool32 and bool for the device_limits, image, parameter_validation, and threading layers. Converts all Boolean usage internal to the layers to bool/true/false. The VK_TRUE and VK_FALSE values continue to be used with the Vulkan API components. Change-Id: I612d3f26050fadcd77ffca4d8723a7c734613816
2016-04-04layers: Fix paramcheck struct array NULL indexingDustin Graves
Fixes an issue where the generated parameter_validation code could index a NULL pointer to an array of structs. Change-Id: If78f1c97ea256911d857b0b8009b38e6ca6f2581
2016-04-01layers: Fix param checker struct array handlingDustin Graves
Fix parameter validation issue with arrays of structs, where only the first item in the array was processed. Validation messages for arrays of structs will currently print the array variable name with the letter 'i' as the array index instead of the actual index number, producing a value like 'pCreateInfos[i]'. This will be fixed by a future update. Change-Id: I2cb773c23c6515a20ac8cb066e7cc61028e569f8
2016-04-01layers: Codegen VkBool32/enum parameter validationDustin Graves
Now generating the VkBool32 and enum checks: - Warns if a VkBool32 parameter is neither VK_TRUE nor VK_FALSE - Warns if an enum token value falls outside of the enum's begin/end range and the token was not added by an extension. Only checkes enum's that have a begin/end range. Detection of tokens added by extensions is based on the base_value defined in appendic C.10 of the Vulkan specification. Change-Id: Id49ace52fea8a35972f96d54247b98aba182c09e
2016-04-01layers: 1.0.7 update for XML Registry filesDustin Graves
Update local copies of generator.py, genvk.py, and vk.xml with the latest versions from Vulkan-Docs. Change-Id: Id2a3da34374fb1c39532cd3c124461eb953f6b89
2016-04-01layers: Fix signed/unsigned comparison warnings in thread_check.hMichael Mc Donnell
Change-Id: I3a5e8e64deed53b3817be1fe8e1e2b32c08691a7
2016-03-21layers: Rename param_checker to parameter_validationMark Lobodzinski
Also, param_check.h -> parameter_validation.h and .json files changed. Change-Id: I9db10563bcc2640fe6b90588d3c80c4fe50a8a83
2016-03-11layers: Add pNext parameter checkingDustin Graves
Validate pNext based on the validextensionstructs tag from the XML registry. If the tag provides a list of valid structures, walk the pNext list and check each node's sType value agains the VkStructureType value associated with the structs from the list. If no valid structure list is provided, ensure that pNext is NULL. Invalid struct types produce errors similar to the following: ERROR: [PARAMCHECK] Code 1 : vkCreateImage: pCreateInfo->pNext chain includes a structure with unexpected VkStructureType VK_STRUCTURE_TYPE_APPLICATION_INFO; Allowed structures are [VkInstanceCreateInfo, VkDeviceCreateInfo] Change-Id: I2c2471a068cb304120c66cb4156331999f8548cd
2016-03-08layers: Add string array parameter checkingDustin Graves
The param_checker layer had previously peformed a NULL check on the pointer to a string array, but had not performed a NULL check for the individual strings in the array. This adds NULL checks for the individual strings. Change-Id: Id4527f670086187e8cd1f146027bfdfd1e134b7b
2016-03-08layers: Add func pointer NULL checksDustin Graves
Add code generated NULL checks for function pointers. This enables parameter checking for the VkAllocationCallbacks struct, with param_checker additions for the vkDestroy functions that receive VkAllocationCallbacks parameters. Change-Id: I9910c52026aa584bb013ee5015b5cb04b2d6ddcd
2016-03-07layers: Add param checks for CreateInstance/DeviceDustin Graves
Add parameter checks for vkCreateDevice and vkCreateInstance. Includes a local fix for GitHub Vulkan-Docs issue #104 to prevent false positives from being generated for the pCreateInfo->pEnabledFeatures == NULL case. Change-Id: I1f3642e7e18c8bfb32b0996b6e2e57a5f9d8e011
2016-03-07layers: Add NULL/sType checks for struct membersDustin Graves
Add param_checker support for validating struct members. Messages are logged for the following conditions, based on conditions specified in vk.xml: - A pointer is NULL and is not marked as optional in the XML - An array is NULL and is not marked as optional in the XML, unless its count is 0 - An array count is 0 and is not marked as optional in the XML - A structure's sType value does not match the value specified in the XML Addresses GL105, GL109, GH82 Change-Id: I7063fe2582b30fdfc0006fe945a0f9c84a2aa66a
2016-03-07layers: Handle indirection in param_checkerDustin Graves
Code was being generated for param_checker that looked like: validate_pointer(pAllocInfo); validate_array(pAllocInfo->count, array); Where validate_array could dereference a NULL pointer. The code generator was updated to insert NULL checks for this case: validate_pointer(pAllocInfo); if (pAllocInfo != NULL) { validate_array(pAllocInfo->count, array); } Change-Id: I1eda66530dbff2e95d604a20d122179be172bedf
2016-02-18layers: MR243: Add param checker code generationDustin Graves
Generate param checker code to verify that required pointer/array parameters are not NULL and that structures with sType fields have the correct VkStructureType value. The checks are generated from the Vulkan XML API registry based on the optional parameter tag and sType comments.
2016-02-10layers: Enable Wall and Werror.Michael Lentine
2016-02-05layers: Add threading layer generationMike Stroyan
Generate threading layer wrappers in thread_check.h. Change path for generated vulkan.h.
2016-02-05layers: bring xml and scripts from documentationMike Stroyan
These are repo git@gitlab.khronos.org:vulkan/vulkan.git from commit 51ffe091889e08ca5196c5635363a5358c85ff82