max_stars_repo_path
stringlengths
9
64
max_stars_repo_name
stringlengths
11
48
max_stars_count
float64
0
1.34k
id
stringlengths
6
7
content
stringlengths
60
400k
score
float64
0.5
1
label
stringclasses
2 values
linux-2.6.35.3/drivers/mxc/security/sahara2/include/sah_kernel.h
isabella232/wireless-media-drive
10
7113385
<filename>linux-2.6.35.3/drivers/mxc/security/sahara2/include/sah_kernel.h /* * Copyright (C) 2004-2010 Freescale Semiconductor, Inc. All Rights Reserved. */ /* * The code contained herein is licensed under the GNU General Public * License. You may obtain a copy of the GNU General Public License * Version 2 or later at the following locations: * * http://www.opensource.org/licenses/gpl-license.html * http://www.gnu.org/copyleft/gpl.html */ /* * @file sah_kernel.h * * @brief Provides definitions for items that user-space and kernel-space share. */ /****************************************************************************** * * This file needs to be PORTED to a non-Linux platform */ #ifndef SAH_KERNEL_H #define SAH_KERNEL_H #if defined(__KERNEL__) #if defined(CONFIG_ARCH_MXC91321) || defined(CONFIG_ARCH_MXC91231) \ || defined(CONFIG_ARCH_MX27) || defined(CONFIG_ARCH_MXC92323) #include <mach/hardware.h> #define SAHA_BASE_ADDR SAHARA_BASE_ADDR #define SAHARA_IRQ MXC_INT_SAHARA #elif defined(CONFIG_ARCH_MX5) #include <mach/hardware.h> #define SAHA_BASE_ADDR SAHARA_BASE_ADDR #define SAHARA_IRQ MXC_INT_SAHARA_H0 #else #include <mach/mx2.h> #endif #endif /* KERNEL */ /* IO Controls */ /* The magic number 'k' is reserved for the SPARC architecture. (See <kernel * source root>/Documentation/ioctl-number.txt. * * Note: Numbers 8-13 were used in a previous version of the API and should * be avoided. */ #define SAH_IOC_MAGIC 'k' #define SAHARA_HWRESET _IO(SAH_IOC_MAGIC, 0) #define SAHARA_SET_HA _IO(SAH_IOC_MAGIC, 1) #define SAHARA_CHK_TEST_MODE _IOR(SAH_IOC_MAGIC,2, int) #define SAHARA_DAR _IO(SAH_IOC_MAGIC, 3) #define SAHARA_GET_RESULTS _IO(SAH_IOC_MAGIC, 4) #define SAHARA_REGISTER _IO(SAH_IOC_MAGIC, 5) #define SAHARA_DEREGISTER _IO(SAH_IOC_MAGIC, 6) /* 7 */ /* 8 */ /* 9 */ /* 10 */ /* 11 */ /* 12 */ /* 13 */ #define SAHARA_SCC_DROP_PERMS _IOWR(SAH_IOC_MAGIC, 14, scc_partition_info_t) #define SAHARA_SCC_SFREE _IOWR(SAH_IOC_MAGIC, 15, scc_partition_info_t) #define SAHARA_SK_ALLOC _IOWR(SAH_IOC_MAGIC, 16, scc_slot_t) #define SAHARA_SK_DEALLOC _IOWR(SAH_IOC_MAGIC, 17, scc_slot_t) #define SAHARA_SK_LOAD _IOWR(SAH_IOC_MAGIC, 18, scc_slot_t) #define SAHARA_SK_UNLOAD _IOWR(SAH_IOC_MAGIC, 19, scc_slot_t) #define SAHARA_SK_SLOT_ENC _IOWR(SAH_IOC_MAGIC, 20, scc_slot_t) #define SAHARA_SK_SLOT_DEC _IOWR(SAH_IOC_MAGIC, 21, scc_slot_t) #define SAHARA_SCC_ENCRYPT _IOWR(SAH_IOC_MAGIC, 22, scc_region_t) #define SAHARA_SCC_DECRYPT _IOWR(SAH_IOC_MAGIC, 23, scc_region_t) #define SAHARA_GET_CAPS _IOWR(SAH_IOC_MAGIC, 24, fsl_shw_pco_t) #define SAHARA_SCC_SSTATUS _IOWR(SAH_IOC_MAGIC, 25, scc_partition_info_t) #define SAHARA_SK_READ _IOWR(SAH_IOC_MAGIC, 29, scc_slot_t) /*! This is the name that will appear in /proc/interrupts */ #define SAHARA_NAME "SAHARA" /*! * SAHARA IRQ number. See page 9-239 of TLICS - Motorola Semiconductors H.K. * TAHITI-Lite IC Specification, Rev 1.1, Feb 2003. * * TAHITI has two blocks of 32 interrupts. The SAHARA IRQ is number 27 * in the second block. This means that the SAHARA IRQ is 27 + 32 = 59. */ #ifndef SAHARA_IRQ #define SAHARA_IRQ (27+32) #endif /*! * Device file definition. The #ifndef is here to support the unit test code * by allowing it to specify a different test device. */ #ifndef SAHARA_DEVICE_SHORT #define SAHARA_DEVICE_SHORT "sahara" #endif #ifndef SAHARA_DEVICE #define SAHARA_DEVICE "/dev/"SAHARA_DEVICE_SHORT #endif #endif /* SAH_KERNEL_H */ /* End of sah_kernel.h */
0.992188
high
Pod/Classes/SVGPathSegmentClosePath.h
cotkjaer/SilverbackScalableVectorGraphics
1
2508913
// // SVGPathElementSegmentClosePath.h // Pods // // Created by <NAME> on 16/12/14. // // #import "SVGPathSegment.h" @interface SVGPathSegmentClosePath : SVGPathSegment @end
0.664063
low
soundgen.c
bharadwaj-raju/SoundGen
2
4171057
#include <stdlib.h> #include <unistd.h> #include <string.h> #include <stdio.h> #include <math.h> #include "wavfile.h" #define TRUE 1 #define FALSE 0 struct Tone { float duration; float frequency; float amplitude_perc; }; short * calculate_tone(double duration, double frequency, double amplitude) { int n_samples = (int) WAVFILE_SAMPLES_PER_SECOND * duration; int volume = (int) 32768 * (amplitude / 100); short * waveform = malloc(sizeof(short) * n_samples); for (int i=0; i<n_samples;i++) { double t = (double) i / WAVFILE_SAMPLES_PER_SECOND; waveform[i] = (int) volume * sin(frequency * t * 2 * M_PI); } return waveform; } int main(int argc, char * argv[]) { int opt_play = FALSE; if (argc < 3) { printf("Not enough arguments.\n"); printf("Usage: %s tones_file wav_output_file [--play]\n", argv[0]); return 1; } if (argc == 3) { if (access(argv[1], F_OK) == -1) { printf("File %s does not exist.\n", argv[1]); return 1; } } if (argc > 3) { if (strcmp(argv[3], "--play") == 0) { opt_play = TRUE; } } FILE * tones_fp = fopen(argv[1], "r"); if (tones_fp == NULL) { printf("Could not open file %s for reading.\n", argv[1]); return 1; } char line[512]; char **lines = NULL; int n_tones = 0; while (fgets(line, sizeof(line), tones_fp)) { lines = (char **) realloc(lines, (n_tones+1) * sizeof(char *)); lines[n_tones++] = strdup(line); } struct Tone tones[n_tones]; float d, f, a = 0.0; char sd[256], sf[256], sa[256]; float total_duration = 0.0; for (int i=0; i<n_tones; i++) { sscanf(lines[i], "%s %s %s\n", sd, sf, sa); d = atof(sd); f = atof(sf); a = atof(sa); tones[i].duration = d; tones[i].frequency = f; tones[i].amplitude_perc = a; total_duration += d; free(lines[i]); } int total_samples = (int) (total_duration * WAVFILE_SAMPLES_PER_SECOND); short * final_waveform = malloc(total_samples * sizeof(short)); printf("%d\n", total_samples); int samples_done = 0; for (int i=0; i<n_tones; i++) { int n_samples = (int) WAVFILE_SAMPLES_PER_SECOND * tones[i].duration; short * wavepart = calculate_tone(tones[i].duration, tones[i].frequency, tones[i].amplitude_perc); memcpy(final_waveform + samples_done, wavepart, n_samples * sizeof(short)); samples_done += n_samples; printf("Tone %d: d=%f f=%f a=%f n_samp=%d samp_done=%d\n", i, tones[i].duration, tones[i].frequency, tones[i].amplitude_perc, n_samples, samples_done); free(wavepart); } FILE * out_fp = wavfile_open(argv[2]); if (out_fp == NULL) { printf("Could not open file %s for writing.\n", argv[2]); return 1; } wavfile_write(out_fp, final_waveform, total_samples); wavfile_close(out_fp); fclose(tones_fp); free(final_waveform); free(lines); char commandbuffer[512]; sprintf(commandbuffer, "aplay '%500s'", argv[2]); if (opt_play == TRUE) { system(commandbuffer); } }
0.984375
high
include/Audio/AudioPlayer.h
Sytten/ARMUS
1
7366577
/* ============================================================================ Name : AudioPlayer Author : <NAME> Modified on: 2015-11-29 Description : Wrapper on the libarmus API calls ============================================================================ */ #ifndef AUDIOPLAYER_H_ #define AUDIOPLAYER_H_ #include <libarmus.h> #include "Audio/Notes.h" /** * Using the sent parameter, plays the good audio file * @param notes Value that will select the good audio file, recommended to be used with Audio/Notes.h defines * @return The audio playfile system stream ID */ unsigned int PlayNote(int notes); /** * Stops the stream at the parameters ID * @param ID Stream ID to stop */ void StopNote(unsigned int ID); #endif /*CHOOSINGNTOES_H_*/
0.722656
high
SQMagnet/SQMagnet/Main/SQNavigationController.h
13701777868/iOS-Extension-Objective-C
264
1095345
// // SQNavigationController.h // SQMagnet // // Created by 朱双泉 on 2019/7/12. // Copyright © 2019 Castie!. All rights reserved. // #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN @interface SQNavigationController : UINavigationController @end NS_ASSUME_NONNULL_END
0.613281
high
groups/bsl/bslalg/bslalg_hashtableanchor.h
emeryberger/bde
1
3759480
// bslalg_hashtableanchor.h -*-C++-*- #ifndef INCLUDED_BSLALG_HASHTABLEANCHOR #define INCLUDED_BSLALG_HASHTABLEANCHOR #include <bsls_ident.h> BSLS_IDENT("$Id: $") //@PURPOSE: Provide a type holding the constituent parts of a hash table. // //@CLASSES: // bslalg::HashTableAnchor: (in-core) bucket-array and node list // //@SEE_ALSO: bslstl_hashtable, bslalg_hashtableimputil // //@DESCRIPTION: This component provides a single, complex-constrained // *in*-*core* (value-semantic) attribute class, 'bslalg::HashTableAnchor', // that is used to hold (not own) the array of buckets and the list of nodes // that form the key data elements of a hash-table. This class is typically // used with the utilities provided in 'bslstl_hashtableimputil'. Note that // the decision to store nodes in a linked list (i.e., resolving collisions // through chaining) is intended to facilitate a hash-table implementation // meeting the requirements of a C++11 standard unordered container. // ///Attributes ///---------- //.. // Name Type Simple Constraints // ------------------ ------------------- ------------------ // bucketArrayAddress HashTableBucket * none // // bucketArraySize size_t none // // listRootAddress BidirectionalLink * none // // // Complex Constraint // ------------------------------------------------------------------------- // 'bucketArrayAddress' must refer to a contiguous sequence of valid // 'bslalg::HashTableBucket' objects of at least the specified // 'bucketArraySize' or both 'bucketArrayAddress' and 'bucketArraySize' must // be 0. //.. // //: o 'listRootAddress': address of the head of the linked list of nodes //: holding the elements contained in a hash table //: //: o 'bucketArrayAddress': address of the first element of the sequence of //: 'HashTableBucket' objects, each of which refers to the first and last //: node (from 'listRootAddress') in that bucket //: //: o 'bucketArraySize': the number of (contiguous) buckets in the array of //: buckets at 'bucketArrayAddress' // ///Usage ///----- // This section illustrates intended use of this component. // // Suppose we want to create a hash table that keeps track of pointers. // Pointers can be added ('insert'ed) or removed ('erase'd) from the table, and // the table will keep track, at any time, of whether a pointer is currently // stored in the table using the 'count' method. It will also be able to // return the total number of objects stored in the table (the 'size' method). // Redundant 'insert's have no effect -- a given pointer may only be stored in // the table once. // // First, we create our class: //.. // class PtrHashSet : public bslalg::HashTableAnchor { // // PRIVATE TYPES // typedef bsls::Types::UintPtr UintPtr; // typedef bslalg::BidirectionalNode<void *> Node; // typedef bslalg::HashTableBucket Bucket; // typedef bslalg::BidirectionalLinkListUtil Util; // // // DATA // double d_maxLoadFactor; // unsigned d_numNodes; // bslma::Allocator *d_allocator_p; // // // PRIVATE MANIPULATORS // void grow(); // // Roughly double the number of buckets, such that the number of // // buckets shall always be '2^N - 1'. // // // PRIVATE ACCESSORS // bool checkInvariants() const; // // Perform sanity checks on this table, returning 'true' if all the // // tests pass and 'false' otherwise. Note that many of the checks // // are done with the 'ASSERTV' macro and will cause messages to be // // written to the console. // // bool find(Node **node, Bucket **bucket, const void *ptr) const; // // If the specified value 'ptr' is stored in this table, return // // pointers to its node and bucket in the specified 'node' and // // 'bucket'. If it is not in this table, return the bucket it // // should be in, and a pointer to the first node, if any, in that // // bucket. If the bucket is empty, return with // // '*node == listRootAddress()'. Return 'true' if 'ptr' was found // // in the table and 'false' otherwise. Note that it is permissible // // to pass 0 to 'node' and / or 'bucket', in which case these // // arguments are ignored. // // private: // // NOT IMPLEMENTED // PtrHashSet(const PtrHashSet&, bslma::Allocator *); // PtrHashSet& operator=(const PtrHashSet&); // // public: // // CREATORS // explicit // PtrHashSet(bslma::Allocator *allocator = 0); // // Create a 'PtrHashSet', using the specified 'allocator'. If no // // allocator is specified, use the default allocator. // // ~PtrHashSet(); // // Destroy this 'PtrHashSet', freeing all its memory. // // // MANIPULATORS // bool insert(void *ptr); // // If the specfied 'ptr' is not in this hash table, add it, // // returning 'true'. If it is already in the table, return 'false' // // with no action taken. // // bool erase(void *ptr); // // If the specfied 'ptr' is in this hash table, remove it, // // returning 'true'. If it is not found in the table, return // // 'false' with no action taken. // // // ACCESSORS // native_std::size_t count(void *ptr) const; // // Return 1 if the specified value 'ptr' is in this table and 0 // // otherwise. // // native_std::size_t size() const; // // Return the number of discrete values that are stored in this // // table. // }; // // // PRIVATE MANIPULATORS // void PtrHashSet::grow() // { // // 'bucketArraySize' will always be '2^N - 1', so that when pointers // // are aligned by some 2^N they're likely to be relatively prime. // // native_std::size_t newBucketArraySize = bucketArraySize() * 2 + 1; // native_std::size_t newBucketArraySizeInBytes = // newBucketArraySize * sizeof(Bucket); // memset(bucketArrayAddress(), 0x5a, size() * sizeof(Bucket)); // d_allocator_p->deallocate(bucketArrayAddress()); // setBucketArrayAddressAndSize( // (Bucket *) d_allocator_p->allocate(newBucketArraySizeInBytes), // newBucketArraySize); // memset(bucketArrayAddress(), 0, newBucketArraySizeInBytes); // Node *newListRootAddress = 0; // // unsigned numNodes = 0; // for (Node *node = (Node *) listRootAddress(); node; ++numNodes) { // Node *rippedOut = node; // node = (Node *) node->nextLink(); // // native_std::size_t index = // (UintPtr) rippedOut->value() % bucketArraySize(); // Bucket& bucket = bucketArrayAddress()[index]; // if (bucket.first()) { // if (0 == bucket.first()->previousLink()) { // newListRootAddress = rippedOut; // } // Util::insertLinkBeforeTarget(rippedOut, bucket.first()); // bucket.setFirst(rippedOut); // } // else { // Util::insertLinkBeforeTarget(rippedOut, // newListRootAddress); // newListRootAddress = rippedOut; // bucket.setFirstAndLast(rippedOut, rippedOut); // } // } // assert(size() == numNodes); // // setListRootAddress(newListRootAddress); // // checkInvariants(); // } // // // PRIVATE ACCESSORS // bool PtrHashSet::checkInvariants() const // { // bool ok; // // unsigned numNodes = 0; // Node *prev = 0; // for (Node *node = (Node *) listRootAddress(); node; // prev = node, node = (Node *) node->nextLink()) { // ok = node->previousLink() == prev; // assert(ok && "node->previousLink() == prev"); // if (!ok) return false; // RETURN // ++numNodes; // } // ok = size() == numNodes; // assert(ok && "size() == numNodes"); // if (!ok) return false; // RETURN // // numNodes = 0; // for (unsigned i = 0; i < bucketArraySize(); ++i) { // Bucket& bucket = bucketArrayAddress()[i]; // if (bucket.first()) { // ++numNodes; // for (Node *node = (Node *) bucket.first(); // bucket.last() != node; // node = (Node *) node->nextLink()) { // ++numNodes; // } // } // else { // ok = !bucket.last(); // assert(ok && "!bucket.last()"); // if (!ok) return false; // RETURN // } // } // ok = size() == numNodes; // assert(ok && "size() == numNodes"); // // return ok; // } // // bool PtrHashSet::find(Node **node, Bucket **bucket, const void *ptr) const // { // Node *dummyNodePtr; // Bucket *dummyBucketPtr; // if (!node ) node = &dummyNodePtr; // if (!bucket) bucket = &dummyBucketPtr; // // Node *& nodePtrRef = *node; // unsigned index = (UintPtr) ptr % bucketArraySize(); // Bucket& bucketRef = bucketArrayAddress()[index]; // *bucket = &bucketRef; // if (bucketRef.first()) { // Node *begin = (Node *) bucketRef.first(); // Node * const end = (Node *) bucketRef.last()->nextLink(); // for (Node *n = begin; end != n; n = (Node *) n->nextLink()) { // if (n->value() == ptr) { // // found // // nodePtrRef = n; // return true; // RETURN // } // } // // not found // // nodePtrRef = begin; // return false; // RETURN // } // // empty bucket // // nodePtrRef = (Node *) listRootAddress(); // return false; // } // // // CREATORS // PtrHashSet::PtrHashSet(bslma::Allocator *allocator) // : HashTableAnchor(0, 0, 0) // , d_maxLoadFactor(0.4) // , d_numNodes(0) // { // enum { NUM_BUCKETS = 3 }; // // d_allocator_p = bslma::Default::allocator(allocator); // native_std::size_t bucketArraySizeInBytes = // NUM_BUCKETS * sizeof(Bucket); // setBucketArrayAddressAndSize( // (Bucket *) d_allocator_p->allocate(bucketArraySizeInBytes), // NUM_BUCKETS); // memset(bucketArrayAddress(), 0, bucketArraySizeInBytes); // } // // PtrHashSet::~PtrHashSet() // { // BSLS_ASSERT_SAFE(checkInvariants()); // // for (Node *node = (Node *) listRootAddress(); node; ) { // Node *toDelete = node; // node = (Node *) node->nextLink(); // // memset(toDelete, 0x5a, sizeof(*toDelete)); // d_allocator_p->deallocate(toDelete); // } // // d_allocator_p->deallocate(bucketArrayAddress()); // } // // // MANIPULATORS // bool PtrHashSet::erase(void *ptr) // { // Bucket *bucket; // Node *node; // // if (!find(&node, &bucket, ptr)) { // return false; // RETURN // } // // if (bucket->first() == node) { // if (bucket->last() == node) { // bucket->reset(); // } // else { // bucket->setFirst(node->nextLink()); // } // } // else if (bucket->last() == node) { // bucket->setLast(node->previousLink()); // } // // --d_numNodes; // Util::unlink(node); // // d_allocator_p->deallocate(node); // // checkInvariants(); // // return true; // } // // bool PtrHashSet::insert(void *ptr) // { // Bucket *bucket; // Node *insertionPoint; // // if (find(&insertionPoint, &bucket, ptr)) { // // Already in set, do nothing. // // return false; // RETURN // } // // if (bucketArraySize() * d_maxLoadFactor < d_numNodes + 1) { // grow(); // bool found = find(&insertionPoint, &bucket, ptr); // BSLS_ASSERT_SAFE(!found); // } // // ++d_numNodes; // Node *node = (Node *) d_allocator_p->allocate(sizeof(Node)); // // Util::insertLinkBeforeTarget(node, insertionPoint); // node->value() = ptr; // if (listRootAddress() == insertionPoint) { // BSLS_ASSERT_SAFE(0 == node->previousLink()); // setListRootAddress(node); // } // // if (bucket->first()) { // BSLS_ASSERT_SAFE(bucket->first() == insertionPoint); // // bucket->setFirst(node); // } // else { // BSLS_ASSERT_SAFE(!bucket->last()); // // bucket->setFirstAndLast(node, node); // } // // assert(count(ptr)); // // checkInvariants(); // // return true; // } // // // ACCESSORS // native_std::size_t PtrHashSet::count(void *ptr) const // { // return find(0, 0, ptr); // } // // native_std::size_t PtrHashSet::size() const // { // return d_numNodes; // } //.. // Then, in 'main', we create a test allocator for use in this example to // ensure that no memory is leaked: //.. // bslma::TestAllocator ta("test", veryVeryVeryVerbose); //.. // Next, we declare our table using that allocator: //.. // PtrHashSet phs(&ta); //.. // Then, we create an area of memory from which our pointers will come: //.. // enum { SEGMENT_LENGTH = 1000 }; // char *pc = (char *) ta.allocate(SEGMENT_LENGTH); //.. // Next, we iterate through the length of the segment, insert those pointers // for which 'ptr - pc == N * 7' is true. We keep a count of the number of // items we insert into the table in the variable 'sevens': //.. // unsigned sevens = 0; // for (int i = 0; i < SEGMENT_LENGTH; i += 7) { // ++sevens; // bool status = phs.insert(&pc[i]); // assert(status); // } //.. // Then, we verify the number of objects we've placed in the table: //.. // assert(phs.size() == sevens); //.. // Next, we iterate through ALL pointers in the 'pc' array, using the 'count' // method to verify that the ones we expect are in the table: //.. // for (int i = 0; i < SEGMENT_LENGTH; ++i) { // assert(phs.count(&pc[i]) == (0 == i % 7)); // } //.. // Then, we iterate, deleting all elements from the table for which // 'ptr - pc == 3 * N' is true. We keep a count of the number of elements that // were deleted from the table in the variable 'killed': //.. // unsigned killed = 0; // for (int i = 0; i < SEGMENT_LENGTH; i += 3) { // const bool deleted = phs.erase(&pc[i]); // assert(deleted == (0 == i % 7)); // killed += deleted; // } //.. // Next, we verify the number of remaining elements in the table: //.. // assert(killed < sevens); // assert(phs.size() == sevens - killed); //.. // Then, in verbose mode we print our tallies: //.. // if (verbose) { // printf("sevens = %u, killed = %u, phs.size() = %u\n", sevens, // killed, (unsigned) phs.size()); // } //.. // Now, we iterate through every element of the 'pc' array, verifying that the // surviving elements are exactly those for which 'ptr - pc' was divisible by 7 // and not by 3: //.. // for (int i = 0; i < SEGMENT_LENGTH; ++i) { // const bool present = phs.count(&pc[i]); // assert(present == ((0 == i % 7) && (0 != i % 3))); // } //.. // Finally, we clean up our 'pc' array: //.. // ta.deallocate(pc); //.. #include <bslscm_version.h> #include <bslalg_bidirectionallink.h> #include <bslalg_scalarprimitives.h> #include <bslmf_istriviallycopyable.h> #include <bslmf_nestedtraitdeclaration.h> #include <bsls_assert.h> #include <bsls_nativestd.h> #include <cstddef> namespace BloombergLP { namespace bslalg { struct HashTableBucket; // This is known to be a POD struct. // ============================= // class bslalg::HashTableAnchor // ============================= class HashTableAnchor { // This complex constrained *in*-*core* (value-semantic) attribute class // characterizes the key data elements of a hash table. See the // "Attributes" section under @DESCRIPTION in the component-level // documentation for/ information on the class attributes. Note that the // class invariant is the identically the complex constraint of this // component. // // This class: //: o supports a complete set of *value-semantic* operations //: o except for 'bdex' serialization and default construction //: o is *in-core* //: o is *exception-neutral* (agnostic) //: o is *alias-safe* //: o is 'const' *thread-safe* // For terminology see 'bsldoc_glossary'. // DATA HashTableBucket *d_bucketArrayAddress_p; // address of the array of // buckets (held, not owned) native_std::size_t d_bucketArraySize; // size of 'd_bucketArray' BidirectionalLink *d_listRootAddress_p; // head of the list of // elements in the hash-table // (held, not owned) public: // TRAITS BSLMF_NESTED_TRAIT_DECLARATION(HashTableAnchor, bsl::is_trivially_copyable); // CREATORS HashTableAnchor(HashTableBucket *bucketArrayAddress, native_std::size_t bucketArraySize, BidirectionalLink *listRootAddress); // Create a 'bslalg::HashTableAnchor' object having the specified // 'bucketArrayAddress', 'bucketArraySize', and 'listRootAddress' // attributes. The behavior is undefined unless 'bucketArrayAddress' // refers to a contiguous sequence of valid 'bslalg::HashTableBucket' // objects of at least 'bucketArraySize' or unless both // 'bucketArrayAddress' and 'bucketArraySize' are 0. HashTableAnchor(const HashTableAnchor& original); // Create a 'bslalg::HashTableAnchor' object having the same value // as the specified 'original' object. // ~bslalg::HashTableAnchor(); = default // Destroy this object. // MANIPULATORS bslalg::HashTableAnchor& operator=(const bslalg::HashTableAnchor& rhs); // Assign to this object the value of the specified 'rhs' object, and // return a reference providing modifiable access to this object. void setBucketArrayAddressAndSize(HashTableBucket *bucketArrayAddress, native_std::size_t bucketArraySize); // Set the bucket array address and bucket array size attributes of // this object to the specified 'bucketArrayAddress' and // 'bucketArraySize' values. The behavior is undefined unless // 'bucketArrayAddress' refers to a contiguous sequence of valid // 'bslalg::HashTableBucket' objects of at least 'bucketArraySize', or // unless both 'bucketArrayAddress' and 'bucketArraySize' are 0. void setListRootAddress(BidirectionalLink *value); // Set the 'listRootAddress' attribute of this object to the // specified 'value'. // Aspects void swap(HashTableAnchor& other); // Efficiently exchange the value of this object with the value of the // specified 'other' object. This method provides the no-throw // exception-safety guarantee. // ACCESSORS HashTableBucket *bucketArrayAddress() const; // Return the value of the 'bucketArrayAddress' attribute of this // object. native_std::size_t bucketArraySize() const; // Return the value of the 'bucketArraySize' attribute of this object. BidirectionalLink *listRootAddress() const; // Return the value 'listRootAddress' attribute of this object. }; // FREE OPERATORS bool operator==(const HashTableAnchor& lhs, const HashTableAnchor& rhs); // Return 'true' if the specified 'lhs' and 'rhs' objects have the same // value, and 'false' otherwise. Two 'bslalg::HashTableAnchor' objects // have the same value if all of the corresponding values of their // 'bucketArrayAddress', 'bucketArraySize', and 'listRootAddress' // attributes are the same. bool operator!=(const HashTableAnchor& lhs, const HashTableAnchor& rhs); // Return 'true' if the specified 'lhs' and 'rhs' objects do not have the // same value, and 'false' otherwise. Two 'bslalg::HashTableAnchor' // objects do not have the same value if any of the corresponding values of // their 'bucketArrayAddress', 'bucketArraySize', or 'listRootAddress' // attributes are not the same. // FREE FUNCTIONS void swap(HashTableAnchor& a, HashTableAnchor& b); // Efficiently exchange the values of the specified 'a' and 'b' objects. // This function provides the no-throw exception-safety guarantee. The // behavior is undefined unless the two objects were created with the same // allocator. // ============================================================================ // INLINE FUNCTION DEFINITIONS // ============================================================================ // ----------------------------- // class bslalg::HashTableAnchor // ----------------------------- // CREATORS inline HashTableAnchor::HashTableAnchor(bslalg::HashTableBucket *bucketArrayAddress, native_std::size_t bucketArraySize, bslalg::BidirectionalLink *listRootAddress) : d_bucketArrayAddress_p(bucketArrayAddress) , d_bucketArraySize(bucketArraySize) , d_listRootAddress_p(listRootAddress) { BSLS_ASSERT_SAFE( (!bucketArrayAddress && !bucketArraySize) || (bucketArrayAddress && 0 < bucketArraySize)); BSLS_ASSERT_SAFE(!listRootAddress || !(listRootAddress->previousLink())); } inline HashTableAnchor::HashTableAnchor(const HashTableAnchor& original) : d_bucketArrayAddress_p(original.d_bucketArrayAddress_p) , d_bucketArraySize(original.d_bucketArraySize) , d_listRootAddress_p(original.d_listRootAddress_p) { } // MANIPULATORS inline HashTableAnchor& HashTableAnchor::operator=(const HashTableAnchor& rhs) { d_bucketArrayAddress_p = rhs.d_bucketArrayAddress_p; d_bucketArraySize = rhs.d_bucketArraySize; d_listRootAddress_p = rhs.d_listRootAddress_p; return *this; } inline void HashTableAnchor::setBucketArrayAddressAndSize( HashTableBucket *bucketArrayAddress, native_std::size_t bucketArraySize) { BSLS_ASSERT_SAFE(( bucketArrayAddress && 0 < bucketArraySize) || (!bucketArrayAddress && !bucketArraySize)); d_bucketArrayAddress_p = bucketArrayAddress; d_bucketArraySize = bucketArraySize; } inline void HashTableAnchor::setListRootAddress(BidirectionalLink *value) { BSLS_ASSERT_SAFE(!value || !value->previousLink()); d_listRootAddress_p = value; } // Aspects inline void HashTableAnchor::swap(HashTableAnchor& other) { bslalg::ScalarPrimitives::swap(*this, other); } // ACCESSORS inline BidirectionalLink *HashTableAnchor::listRootAddress() const { return d_listRootAddress_p; } inline std::size_t HashTableAnchor::bucketArraySize() const { return d_bucketArraySize; } inline HashTableBucket *HashTableAnchor::bucketArrayAddress() const { return d_bucketArrayAddress_p; } } // close package namespace // FREE OPERATORS inline void bslalg::swap(bslalg::HashTableAnchor& a, bslalg::HashTableAnchor& b) { a.swap(b); } inline bool bslalg::operator==(const bslalg::HashTableAnchor& lhs, const bslalg::HashTableAnchor& rhs) { return lhs.bucketArrayAddress() == rhs.bucketArrayAddress() && lhs.bucketArraySize() == rhs.bucketArraySize() && lhs.listRootAddress() == rhs.listRootAddress(); } inline bool bslalg::operator!=(const bslalg::HashTableAnchor& lhs, const bslalg::HashTableAnchor& rhs) { return lhs.bucketArrayAddress() != rhs.bucketArrayAddress() || lhs.bucketArraySize() != rhs.bucketArraySize() || lhs.listRootAddress() != rhs.listRootAddress(); } } // close enterprise namespace #endif // ---------------------------------------------------------------------------- // Copyright 2013 Bloomberg Finance L.P. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // ----------------------------- END-OF-FILE ----------------------------------
1
high
bin/varnishd/storage/storage_persistent_silo.c
konstantin-f/varnish-cache
0
685001
<filename>bin/varnishd/storage/storage_persistent_silo.c<gh_stars>0 /*- * Copyright (c) 2008-2011 Varnish Software AS * All rights reserved. * * Author: <NAME> <<EMAIL>> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * Persistent storage method * * XXX: Before we start the client or maybe after it stops, we should give the * XXX: stevedores a chance to examine their storage for consistency. * */ #include "config.h" #include "cache/cache.h" #include <stdio.h> #include <stdlib.h> #include "storage/storage.h" #include "storage/storage_simple.h" #include "hash/hash_slinger.h" #include "vsha256.h" #include "vend.h" #include "vtim.h" #include "storage/storage_persistent.h" /* * We use the top bit to mark objects still needing fixup * In theory this may need to be platform dependent */ #define NEED_FIXUP (1U << 31) /*-------------------------------------------------------------------- * Write the segmentlist back to the silo. * * We write the first copy, sync it synchronously, then write the * second copy and sync it synchronously. * * Provided the kernel doesn't lie, that means we will always have * at least one valid copy on in the silo. */ static void smp_save_seg(const struct smp_sc *sc, struct smp_signspace *spc) { struct smp_segptr *ss; struct smp_seg *sg; uint64_t length; Lck_AssertHeld(&sc->mtx); smp_reset_signspace(spc); ss = SIGNSPACE_DATA(spc); length = 0; VTAILQ_FOREACH(sg, &sc->segments, list) { assert(sg->p.offset < sc->mediasize); assert(sg->p.offset + sg->p.length <= sc->mediasize); *ss = sg->p; ss++; length += sizeof *ss; } smp_append_signspace(spc, length); smp_sync_sign(&spc->ctx); } void smp_save_segs(struct smp_sc *sc) { struct smp_seg *sg, *sg2; Lck_AssertHeld(&sc->mtx); /* * Remove empty segments from the front of the list * before we write the segments to disk. */ VTAILQ_FOREACH_SAFE(sg, &sc->segments, list, sg2) { if (sg->nobj > 0) break; if (sg == sc->cur_seg) continue; VTAILQ_REMOVE(&sc->segments, sg, list); AN(VTAILQ_EMPTY(&sg->objcores)); FREE_OBJ(sg); } smp_save_seg(sc, &sc->seg1); smp_save_seg(sc, &sc->seg2); } /*-------------------------------------------------------------------- * Load segments * * The overall objective is to register the existence of an object, based * only on the minimally sized struct smp_object, without causing the * main object to be faulted in. * * XXX: We can test this by mprotecting the main body of the segment * XXX: until the first fixup happens, or even just over this loop, * XXX: However: the requires that the smp_objects starter further * XXX: into the segment than a page so that they do not get hit * XXX: by the protection. */ void smp_load_seg(struct worker *wrk, const struct smp_sc *sc, struct smp_seg *sg) { struct smp_object *so; struct objcore *oc; struct ban *ban; uint32_t no; double t_now = VTIM_real(); struct smp_signctx ctx[1]; ASSERT_SILO_THREAD(sc); CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); CHECK_OBJ_NOTNULL(sg, SMP_SEG_MAGIC); assert(sg->flags & SMP_SEG_MUSTLOAD); sg->flags &= ~SMP_SEG_MUSTLOAD; AN(sg->p.offset); if (sg->p.objlist == 0) return; smp_def_sign(sc, ctx, sg->p.offset, "SEGHEAD"); if (smp_chk_sign(ctx)) return; /* test SEGTAIL */ /* test OBJIDX */ so = (void*)(sc->base + sg->p.objlist); sg->objs = so; no = sg->p.lobjlist; /* Clear the bogus "hold" count */ sg->nobj = 0; for (;no > 0; so++,no--) { if (EXP_WHEN(so) < t_now) continue; ban = BAN_FindBan(so->ban); AN(ban); oc = ObjNew(wrk); oc->stobj->stevedore = sc->parent; smp_init_oc(oc, sg, no); VTAILQ_INSERT_TAIL(&sg->objcores, oc, lru_list); oc->stobj->priv2 |= NEED_FIXUP; EXP_COPY(oc, so); sg->nobj++; oc->refcnt++; HSH_Insert(wrk, so->hash, oc, ban); AN(oc->ban); HSH_DerefBoc(wrk, oc); // XXX Keep it an stream resurrection? (void)HSH_DerefObjCore(wrk, &oc, HSH_RUSH_POLICY); wrk->stats->n_vampireobject++; } Pool_Sumstat(wrk); sg->flags |= SMP_SEG_LOADED; } /*-------------------------------------------------------------------- * Create a new segment */ void smp_new_seg(struct smp_sc *sc) { struct smp_seg tmpsg; struct smp_seg *sg; AZ(sc->cur_seg); Lck_AssertHeld(&sc->mtx); /* XXX: find where it goes in silo */ INIT_OBJ(&tmpsg, SMP_SEG_MAGIC); tmpsg.sc = sc; tmpsg.p.offset = sc->free_offset; /* XXX: align */ assert(tmpsg.p.offset >= sc->ident->stuff[SMP_SPC_STUFF]); assert(tmpsg.p.offset < sc->mediasize); tmpsg.p.length = sc->aim_segl; tmpsg.p.length = RDN2(tmpsg.p.length, 8); if (smp_segend(&tmpsg) > sc->mediasize) /* XXX: Consider truncation in this case */ tmpsg.p.offset = sc->ident->stuff[SMP_SPC_STUFF]; assert(smp_segend(&tmpsg) <= sc->mediasize); sg = VTAILQ_FIRST(&sc->segments); if (sg != NULL && tmpsg.p.offset <= sg->p.offset) { if (smp_segend(&tmpsg) > sg->p.offset) /* No more space, return (cur_seg will be NULL) */ /* XXX: Consider truncation instead of failing */ return; assert(smp_segend(&tmpsg) <= sg->p.offset); } if (tmpsg.p.offset == sc->ident->stuff[SMP_SPC_STUFF]) printf("Wrapped silo\n"); ALLOC_OBJ(sg, SMP_SEG_MAGIC); if (sg == NULL) return; *sg = tmpsg; VTAILQ_INIT(&sg->objcores); sg->p.offset = IRNUP(sc, sg->p.offset); sg->p.length -= sg->p.offset - tmpsg.p.offset; sg->p.length = IRNDN(sc, sg->p.length); assert(sg->p.offset + sg->p.length <= tmpsg.p.offset + tmpsg.p.length); sc->free_offset = sg->p.offset + sg->p.length; VTAILQ_INSERT_TAIL(&sc->segments, sg, list); /* Neuter the new segment in case there is an old one there */ AN(sg->p.offset); smp_def_sign(sc, sg->ctx, sg->p.offset, "SEGHEAD"); smp_reset_sign(sg->ctx); smp_sync_sign(sg->ctx); /* Set up our allocation points */ sc->cur_seg = sg; sc->next_bot = sg->p.offset + IRNUP(sc, SMP_SIGN_SPACE); sc->next_top = smp_segend(sg); sc->next_top -= IRNUP(sc, SMP_SIGN_SPACE); IASSERTALIGN(sc, sc->next_bot); IASSERTALIGN(sc, sc->next_top); sg->objs = (void*)(sc->base + sc->next_top); } /*-------------------------------------------------------------------- * Close a segment */ void smp_close_seg(struct smp_sc *sc, struct smp_seg *sg) { uint64_t left, dst, len; void *dp; Lck_AssertHeld(&sc->mtx); CHECK_OBJ_NOTNULL(sg, SMP_SEG_MAGIC); assert(sg == sc->cur_seg); AN(sg->p.offset); sc->cur_seg = NULL; if (sg->nalloc == 0) { /* If segment is empty, delete instead */ VTAILQ_REMOVE(&sc->segments, sg, list); assert(sg->p.offset >= sc->ident->stuff[SMP_SPC_STUFF]); assert(sg->p.offset < sc->mediasize); sc->free_offset = sg->p.offset; AN(VTAILQ_EMPTY(&sg->objcores)); FREE_OBJ(sg); return; } /* * If there is enough space left, that we can move the smp_objects * down without overwriting the present copy, we will do so to * compact the segment. */ left = smp_spaceleft(sc, sg); len = sizeof(struct smp_object) * sg->p.lobjlist; if (len < left) { dst = sc->next_bot + IRNUP(sc, SMP_SIGN_SPACE); dp = sc->base + dst; assert((uintptr_t)dp + len < (uintptr_t)sg->objs); memcpy(dp, sg->objs, len); sc->next_top = dst; sg->objs = dp; sg->p.length = (sc->next_top - sg->p.offset) + len + IRNUP(sc, SMP_SIGN_SPACE); (void)smp_spaceleft(sc, sg); /* for the asserts */ } /* Update the segment header */ sg->p.objlist = sc->next_top; /* Write the (empty) OBJIDX signature */ sc->next_top -= IRNUP(sc, SMP_SIGN_SPACE); assert(sc->next_top >= sc->next_bot); smp_def_sign(sc, sg->ctx, sc->next_top, "OBJIDX"); smp_reset_sign(sg->ctx); smp_sync_sign(sg->ctx); /* Write the (empty) SEGTAIL signature */ smp_def_sign(sc, sg->ctx, sg->p.offset + sg->p.length - IRNUP(sc, SMP_SIGN_SPACE), "SEGTAIL"); smp_reset_sign(sg->ctx); smp_sync_sign(sg->ctx); /* Save segment list */ smp_save_segs(sc); sc->free_offset = smp_segend(sg); } /*--------------------------------------------------------------------- */ static struct smp_object * smp_find_so(const struct smp_seg *sg, unsigned priv2) { struct smp_object *so; priv2 &= ~NEED_FIXUP; assert(priv2 > 0); assert(priv2 <= sg->p.lobjlist); so = &sg->objs[sg->p.lobjlist - priv2]; return (so); } /*--------------------------------------------------------------------- * Check if a given storage structure is valid to use */ static int smp_loaded_st(const struct smp_sc *sc, const struct smp_seg *sg, const struct storage *st) { struct smp_seg *sg2; const uint8_t *pst; uint64_t o; (void)sg; /* XXX: faster: Start search from here */ pst = (const void *)st; if (pst < (sc->base + sc->ident->stuff[SMP_SPC_STUFF])) return (0x01); /* Before silo payload start */ if (pst > (sc->base + sc->ident->stuff[SMP_END_STUFF])) return (0x02); /* After silo end */ o = pst - sc->base; /* Find which segment contains the storage structure */ VTAILQ_FOREACH(sg2, &sc->segments, list) if (o > sg2->p.offset && (o + sizeof(*st)) < sg2->p.objlist) break; if (sg2 == NULL) return (0x04); /* No claiming segment */ if (!(sg2->flags & SMP_SEG_LOADED)) return (0x08); /* Claiming segment not loaded */ /* It is now safe to access the storage structure */ if (st->magic != STORAGE_MAGIC) return (0x10); /* Not enough magic */ if (o + st->space >= sg2->p.objlist) return (0x20); /* Allocation not inside segment */ if (st->len > st->space) return (0x40); /* Plain bad... */ /* * XXX: We could patch up st->stevedore and st->priv here * XXX: but if things go right, we will never need them. */ return (0); } /*--------------------------------------------------------------------- * objcore methods for persistent objects */ struct object * __match_proto__(sml_getobj_f) smp_sml_getobj(struct worker *wrk, struct objcore *oc) { struct object *o; struct smp_seg *sg; struct smp_object *so; struct storage *st; uint64_t l; int bad; CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC); AN(oc->stobj->stevedore); CAST_OBJ_NOTNULL(sg, oc->stobj->priv, SMP_SEG_MAGIC); so = smp_find_so(sg, oc->stobj->priv2); o = (void*)(sg->sc->base + so->ptr); /* * The object may not be in this segment since we allocate it * In a separate operation than the smp_object. We could check * that it is in a later segment, but that would be complicated. * XXX: For now, be happy if it is inside the silo */ ASSERT_PTR_IN_SILO(sg->sc, o); CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC); /* * If this flag is not set, it will not be, and the lock is not * needed to test it. */ if (!(oc->stobj->priv2 & NEED_FIXUP)) return (o); Lck_Lock(&sg->sc->mtx); /* Check again, we might have raced. */ if (oc->stobj->priv2 & NEED_FIXUP) { /* We trust caller to have a refcnt for us */ bad = 0; l = 0; VTAILQ_FOREACH(st, &o->list, list) { bad |= smp_loaded_st(sg->sc, sg, st); if (bad) break; l += st->len; } if (l != vbe64dec(o->fa_len)) bad |= 0x100; if (bad) { EXP_ZERO(oc); EXP_ZERO(so); } sg->nfixed++; wrk->stats->n_object++; wrk->stats->n_vampireobject--; oc->stobj->priv2 &= ~NEED_FIXUP; } Lck_Unlock(&sg->sc->mtx); return (o); } void __match_proto__(objfree_f) smp_oc_objfree(struct worker *wrk, struct objcore *oc) { struct smp_seg *sg; struct smp_object *so; CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC); CAST_OBJ_NOTNULL(sg, oc->stobj->priv, SMP_SEG_MAGIC); so = smp_find_so(sg, oc->stobj->priv2); Lck_Lock(&sg->sc->mtx); EXP_ZERO(so); so->ptr = 0; assert(sg->nobj > 0); sg->nobj--; if (oc->stobj->priv2 & NEED_FIXUP) { wrk->stats->n_vampireobject--; } else { assert(sg->nfixed > 0); sg->nfixed--; wrk->stats->n_object--; } VTAILQ_REMOVE(&sg->objcores, oc, lru_list); Lck_Unlock(&sg->sc->mtx); memset(oc->stobj, 0, sizeof oc->stobj); } /*--------------------------------------------------------------------*/ void smp_init_oc(struct objcore *oc, struct smp_seg *sg, unsigned objidx) { AZ(objidx & NEED_FIXUP); oc->stobj->priv = sg; oc->stobj->priv2 = objidx; } /*--------------------------------------------------------------------*/ void __match_proto__(obj_event_f) smp_oc_event(struct worker *wrk, void *priv, struct objcore *oc, unsigned ev) { struct stevedore *st; struct smp_seg *sg; struct smp_object *so; CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC); CAST_OBJ_NOTNULL(st, priv, STEVEDORE_MAGIC); CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC); if (oc->stobj->stevedore != st) return; CAST_OBJ_NOTNULL(sg, oc->stobj->priv, SMP_SEG_MAGIC); CHECK_OBJ_NOTNULL(sg->sc, SMP_SC_MAGIC); so = smp_find_so(sg, oc->stobj->priv2); if (sg == sg->sc->cur_seg) { /* Lock necessary, we might race close_seg */ Lck_Lock(&sg->sc->mtx); if (ev & (OEV_BANCHG|OEV_INSERT)) so->ban = BAN_Time(oc->ban); if (ev & (OEV_TTLCHG|OEV_INSERT)) EXP_COPY(so, oc); Lck_Unlock(&sg->sc->mtx); } else { if (ev & (OEV_BANCHG|OEV_INSERT)) so->ban = BAN_Time(oc->ban); if (ev & (OEV_TTLCHG|OEV_INSERT)) EXP_COPY(so, oc); } }
0.996094
high
Algorithms/linked list/singly linked list.c
TeacherManoj0131/HacktoberFest2020-Contributions
256
8483840
<gh_stars>100-1000 #include <stdio.h> #include <stdlib.h> struct node { int key; struct node* link; }; typedef struct node NODE; struct list { NODE *head; }; typedef struct list LIST; void init(LIST*); void read_priority(LIST*); void insert_at_pos(LIST*); void insert_at_head(LIST*); void insert_at_tail(LIST*); void delete_priority(LIST*); void delete_at_pos(LIST*); void delete_head(LIST*); void delete_tail(LIST*); void delete_first_occurence(LIST*); void delete_last_occurence(LIST*); void delete_all_occurence(LIST*); void display(LIST*); void display_recursive(NODE*); void find(LIST*); int count(LIST*); void merge(LIST*, LIST*); void merge_sorted(LIST*, LIST*); void union_lists(LIST*,LIST*,LIST*); void intersection(LIST*,LIST*,LIST*); void reverse(LIST*); void destroy(LIST*); int main() { LIST *l = (LIST*)malloc(sizeof(LIST)); init(l); int n; printf("Enter number of nodes for list 1 : "); scanf("%d",&n); for (int i = 0;i<n;i++) read_priority(l); display(l); reverse(l); display(l); //insert_at_tail(l); //insert_at_pos(l); //insert_at_head(l); //insert_at_tail(l); //delete_priority(l); //delete_head(l); //delete_tail(l); //delete_at_pos(l); //delete_first_occurence(l); //delete_last_occurence(l); //delete_all_occurence(l); //printf("Number of nodes = %d\n", count(l)); //find(l); //display_recursive(l->head); #if 0 LIST *l2 = (LIST*)malloc(sizeof(LIST)); init(l2); printf("Enter number of nodes for list 2 : "); scanf("%d",&n); for (int i = 0;i<n;i++) read_priority(l2); display(l2); #endif #if 0 LIST *l3 = (LIST*)malloc(sizeof(LIST)); LIST *l4 = (LIST*)malloc(sizeof(LIST)); init(l3); init(l4); union_lists(l,l2,l3); intersection(l,l2,l4); display(l3); display(l4); #endif destroy(l); } void init(LIST* l) { l->head = NULL; } void read_priority(LIST* l) { NODE* node = (NODE*)malloc(sizeof(NODE)); node->link = NULL; printf("Enter value : "); scanf("%d", &(node->key)); if (l->head == NULL) { l->head = node; } else { NODE *prev = NULL; NODE *pres = l->head; while (pres!=NULL && pres->key<node->key) { prev = pres; pres = pres->link; } if (prev==NULL) { node->link = l->head; l->head = node; } else { prev->link = node; node->link = pres; } } } void display(LIST* l) { NODE* node = l->head; while(node!=NULL) { printf("%d ",node->key); node = node->link; } printf("\n"); } void display_recursive(NODE *node) { if(node!=NULL) { printf("%d ",node->key); display_recursive(node->link); } } void insert_at_pos(LIST* l) { //printf("Inserting at position\n"); NODE* node = (NODE*)malloc(sizeof(NODE)); node->link = NULL; printf("Enter value : "); scanf("%d", &(node->key)); printf("Enter a position : "); int pos; scanf("%d", &pos); if(l->head==NULL) { l->head = node; } else { NODE *prev = NULL; NODE *pres = l->head; int ctr = 0; while(pres!=NULL && ctr<pos) { prev = pres; pres = pres->link; ctr++; } if (prev == NULL) { node->link = l->head; l->head = node; } else { prev->link = node; node->link = pres; } } } void insert_at_head(LIST* l) { //printf("Inserting at head\n"); NODE *node = (NODE*)malloc(sizeof(NODE)); node->link = NULL; printf("Enter value : "); scanf("%d", &(node->key)); if(l->head == NULL) l->head = node; else { node->link = l->head; l->head = node; } } void insert_at_tail(LIST *l) { //printf("Inserting at tail\n"); NODE *node = (NODE*)malloc(sizeof(NODE)); node->link = NULL; printf("Enter value : "); scanf("%d", &(node->key)); if(l->head == NULL) l->head = node; else { NODE *prev = NULL; NODE *pres = l->head; while (pres!=NULL) { prev = pres; pres = pres->link; } prev->link = node; node->link = pres; //pres is null } } void delete_priority(LIST *l) { if(l->head != NULL) { NODE* prev = NULL; NODE* pres = l->head; NODE* max = NULL; int mval = l->head->key; while(pres!=NULL) { if(pres->key>mval) { max = prev; mval = pres->key; } prev = pres; pres = pres->link; } if (max == NULL) { NODE *temp = l->head; l->head = l->head->link; free(temp); } else { NODE* temp = max->link; max->link = max->link->link; free(temp); } } } void delete_at_pos(LIST* l) { int pos; printf("Enter position to delete at : "); scanf("%d", &pos); if(l->head!=NULL) { NODE* prev = NULL; NODE* pres = l->head; int ctr = 0; while(pres!=NULL && ctr<pos) { prev = pres; pres = pres->link; ctr++; } if (prev==NULL) { l->head = pres->link; free(pres); } else { prev->link = pres->link; free(pres); } } } void delete_tail(LIST *l) { NODE *prev = NULL; NODE *pres = l->head; if (pres == NULL) printf("EMPTY\n"); else { while (pres->link!=NULL) { prev = pres; pres = pres->link; } if(prev==NULL) l->head = NULL; else prev->link = NULL; free(pres); } } void delete_head(LIST *l) { if(l->head != NULL) { NODE *temp = l->head; l->head = l->head->link; free(temp); } } void delete_first_occurence(LIST *l) { if (l->head != NULL) { printf("Enter element to delete : "); int val; scanf("%d", &val); NODE* prev = NULL; NODE* pres = l->head; while(pres!=NULL) { if (pres->key == val) { if (prev == NULL) { NODE *temp = l->head; l->head = l->head->link; free(temp); } else { prev->link = pres->link; free(pres); } break; } prev = pres; pres = pres->link; } } } void delete_last_occurence(LIST *l) { if(l->head!=NULL) { int pos = 0, ctr = 0; printf("Enter element to delete : "); int val; scanf("%d", &val); NODE* prev = NULL; NODE* pres = l->head; while(pres!=NULL) { if(pres->key == val) pos = ctr; prev = pres; pres = pres->link; ctr+=1; } prev = NULL; pres = l->head; ctr = 0; while(pres!=NULL && ctr<pos) { prev = pres; pres = pres->link; ctr++; } if (prev==NULL) { l->head = pres->link; free(pres); } else { prev->link = pres->link; free(pres); } } } void delete_all_occurence(LIST *l) { if(l->head != NULL) { printf("Enter element to delete : "); int val; scanf("%d", &val); NODE* prev = NULL; NODE* pres = l->head; while(pres!=NULL) { if(pres->key == val) { if(prev==NULL) { pres=pres->link; l->head = pres; } else { pres = pres->link; prev->link = pres; } } else { prev = pres; pres = pres->link; } } } } int count(LIST *l) { int ctr = 0; if (l->head == NULL) return 0; else { NODE *node = l->head; while (node!=NULL) { ctr++; node = node->link; } return ctr; } } void destroy(LIST *l) { NODE *prev = NULL; NODE *pres = l->head; while(pres!=NULL) { prev = pres; pres = pres->link; free(prev); } } void find(LIST *l) { printf("Enter element to find : "); int s; scanf("%d", &s); int pos = -1; if(l->head == NULL) printf("Index = %d\n", pos); else { int ctr = 0; NODE* prev = NULL; NODE* pres = l->head; while(pres!=NULL) { if(s==pres->key) pos = ctr; prev = pres; pres = pres->link; ctr++; } printf("Index = %d\n", pos); } } void merge(LIST *l1, LIST *l2) { if(l1->head==NULL) { if(l2->head!=NULL) { l1->head=l2->head; l2->head=NULL; } } else { NODE *prev = NULL; NODE *pres = l1->head; while(pres!=NULL) { prev = pres; pres=pres->link; } prev->link = l2->head; l2->head=NULL; } } void merge_sorted(LIST *l1, LIST *l2) { if (l1->head!=NULL && l2->head!=NULL) { NODE *prev = NULL; NODE *pres = l2->head; NODE *temp1 = NULL; NODE *temp2 = l1->head; while(pres!=NULL) { NODE *node = (NODE*)malloc(sizeof(NODE)); node->key = pres->key; node->link = NULL; temp1 = NULL; temp2 = l1->head; while(temp2!=NULL && temp2->key<=node->key) { temp1 = temp2; temp2=temp2->link; } if (temp1==NULL) { node->link = l1->head; l1->head = node; } else { temp1->link = node; node->link = temp2; } pres = pres->link; } } } void insert(LIST *l, int val) { NODE* node = (NODE*)malloc(sizeof(NODE)); node->link = NULL; node->key = val; if (l->head == NULL) { l->head = node; } else { NODE *prev = NULL; NODE *pres = l->head; while (pres!=NULL && pres->key<node->key) { prev = pres; pres = pres->link; } if (prev==NULL) { node->link = l->head; l->head = node; } else { prev->link = node; node->link = pres; } } } void check(LIST *l1,LIST *l3) { NODE *pres1 = l1->head; while(pres1!=NULL) { NODE *pres2 = l3->head; int ctr = 0; while(pres2!=NULL) { if (pres1->key==pres2->key) ctr++; pres2 = pres2->link; } if (ctr==0) { insert(l3,pres1->key); } pres1 = pres1->link; } } void union_lists(LIST* l1, LIST *l2, LIST *l3) { check(l1,l3); check(l2,l3); } void intersection(LIST *l1, LIST *l2, LIST *l3) { NODE *node1 = l1->head; int flag; while(node1!=NULL) { flag = 0; NODE *node2 = l2->head; while(node2!=NULL) { if (node2->key==node1->key) { flag = 1; break; } node2 = node2->link; } if (flag==1) { insert(l3,node1->key); } node1=node1->link; } } void reverse(LIST *l) { NODE *pres = l->head; NODE *prev = NULL; NODE *temp = NULL; while(pres!=NULL) { temp = pres->link; pres->link = prev; prev = pres; pres = temp; } l->head = prev; }
0.976563
high
08_Structs/src/main.c
rjbernaldo/c-programming-for-beginners
1
3875897
<filename>08_Structs/src/main.c #include <stdio.h> #include <string.h> #define NUMBER_OF_CDS 1 typedef struct cd CD; typedef char Str50[50]; struct cd { Str50 name[50]; Str50 artist[50]; int trackcount; int rating; }; CD cd_collection[NUMBER_OF_CDS]; void create_cd_collection() { strcpy(cd_collection[0].name, "Name"); strcpy(cd_collection[0].artist, "Artist"); cd_collection[0].trackcount = 1; cd_collection[0].rating = 10; } void display_cd_collection() { int i; CD thiscd; for (i = 0; i < NUMBER_OF_CDS; i++) { thiscd = cd_collection[i]; printf("CD #%d: %s - %s - %d - %d", i, thiscd.name, thiscd.artist, thiscd.trackcount, thiscd.rating); } } int main() { create_cd_collection(); display_cd_collection(); }
0.972656
high
examples/STM32_LAN8720/FullyFeatured_STM32_LAN8720/defines.h
khoih-prog/AsyncMQTT_Generic
4
2337889
/**************************************************************************************************************************** defines.h defines.h AsyncMqttClient_Generic is a library for ESP32, ESP8266, Protenta_H7, STM32F7, etc. with current AsyncTCP support Based on and modified from : 1) async-mqtt-client (https://github.com/marvinroger/async-mqtt-client) Built by <NAME> https://github.com/khoih-prog/AsyncMqttClient_Generic *****************************************************************************************************************************/ #ifndef defines_h #define defines_h #if !( defined(ARDUINO_BLACK_F407VE) || defined(ARDUINO_BLACK_F407VG) || defined(ARDUINO_BLACK_F407ZE) || defined(ARDUINO_BLACK_F407ZG) || \ defined(ARDUINO_BLUE_F407VE_Mini) || defined(ARDUINO_DIYMORE_F407VGT) || defined(ARDUINO_FK407M1) || defined(ARDUINO_NUCLEO_F429ZI) || \ defined(ARDUINO_DISCO_F746NG) || defined(ARDUINO_NUCLEO_F746ZG) || defined(ARDUINO_NUCLEO_F756ZG) || defined(ARDUINO_NUCLEO_H743ZI) ) //#error This code is designed to run on some STM32F407XX NUCLEO-F429ZI, STM32F746 and STM32F756 platform! Please check your Tools->Board setting. #endif // Use from 0 to 4. Higher number, more debugging messages and memory usage. #define _ASYNC_MQTT_LOGLEVEL_ 1 #define USING_LAN8720 true #if defined(STM32F0) #warning STM32F0 board selected #define BOARD_TYPE "STM32F0" #elif defined(STM32F1) #warning STM32F1 board selected #define BOARD_TYPE "STM32F1" #elif defined(STM32F2) #warning STM32F2 board selected #define BOARD_TYPE "STM32F2" #elif defined(STM32F3) #warning STM32F3 board selected #define BOARD_TYPE "STM32F3" #elif defined(STM32F4) #warning STM32F4 board selected #define BOARD_TYPE "STM32F4" #elif defined(STM32F7) #warning STM32F7 board selected #define BOARD_TYPE "STM32F7" #elif defined(STM32L0) #warning STM32L0 board selected #define BOARD_TYPE "STM32L0" #elif defined(STM32L1) #warning STM32L1 board selected #define BOARD_TYPE "STM32L1" #elif defined(STM32L4) #warning STM32L4 board selected #define BOARD_TYPE "STM32L4" #elif defined(STM32H7) #warning STM32H7 board selected #define BOARD_TYPE "STM32H7" #elif defined(STM32G0) #warning STM32G0 board selected #define BOARD_TYPE "STM32G0" #elif defined(STM32G4) #warning STM32G4 board selected #define BOARD_TYPE "STM32G4" #elif defined(STM32WB) #warning STM32WB board selected #define BOARD_TYPE "STM32WB" #elif defined(STM32MP1) #warning STM32MP1 board selected #define BOARD_TYPE "STM32MP1" #else #warning STM32 unknown board selected #define BOARD_TYPE "STM32 Unknown" #endif #ifndef BOARD_NAME #define BOARD_NAME BOARD_TYPE #endif #define SHIELD_TYPE "LAN8720 Ethernet" #include <LwIP.h> #include <STM32Ethernet.h> //#include <AsyncWebServer_STM32.h> // Enter a MAC address and IP address for your controller below. #define NUMBER_OF_MAC 20 byte mac[][NUMBER_OF_MAC] = { { 0xDE, 0xAD, 0xBE, 0xEF, 0x32, 0x01 }, { 0xDE, 0xAD, 0xBE, 0xEF, 0x32, 0x02 }, { 0xDE, 0xAD, 0xBE, 0xEF, 0x32, 0x03 }, { 0xDE, 0xAD, 0xBE, 0xEF, 0x32, 0x04 }, { 0xDE, 0xAD, 0xBE, 0xEF, 0x32, 0x05 }, { 0xDE, 0xAD, 0xBE, 0xEF, 0x32, 0x06 }, { 0xDE, 0xAD, 0xBE, 0xEF, 0x32, 0x07 }, { 0xDE, 0xAD, 0xBE, 0xEF, 0x32, 0x08 }, { 0xDE, 0xAD, 0xBE, 0xEF, 0x32, 0x09 }, { 0xDE, 0xAD, 0xBE, 0xEF, 0x32, 0x0A }, { 0xDE, 0xAD, 0xBE, 0xEF, 0x32, 0x0B }, { 0xDE, 0xAD, 0xBE, 0xEF, 0x32, 0x0C }, { 0xDE, 0xAD, 0xBE, 0xEF, 0x32, 0x0D }, { 0xDE, 0xAD, 0xBE, 0xEF, 0x32, 0x0E }, { 0xDE, 0xAD, 0xBE, 0xEF, 0x32, 0x0F }, { 0xDE, 0xAD, 0xBE, 0xEF, 0x32, 0x10 }, { 0xDE, 0xAD, 0xBE, 0xEF, 0x32, 0x11 }, { 0xDE, 0xAD, 0xBE, 0xEF, 0x32, 0x12 }, { 0xDE, 0xAD, 0xBE, 0xEF, 0x32, 0x13 }, { 0xDE, 0xAD, 0xBE, 0xEF, 0x32, 0x14 }, }; // Select the IP address according to your local network IPAddress ip(192, 168, 2, 232); #endif //defines_h
0.972656
high
tests/demo/Demo.h
kan-xyz/Arc
4
5533425
#pragma once namespace Demo { void Demo(); }
0.929688
low
Libraries/LibJS/Interpreter.h
jcs/serenity
9
3330856
<reponame>jcs/serenity /* * Copyright (c) 2020, <NAME> <<EMAIL>> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #pragma once #include <AK/FlyString.h> #include <AK/HashMap.h> #include <AK/String.h> #include <AK/Vector.h> #include <LibJS/Forward.h> #include <LibJS/Heap/Heap.h> #include <LibJS/Runtime/Exception.h> #include <LibJS/Runtime/Value.h> namespace JS { enum class ScopeType { None, Function, Block, Try, Breakable, Continuable, }; struct Variable { Value value; DeclarationKind declaration_kind; }; struct ScopeFrame { ScopeType type; NonnullRefPtr<ScopeNode> scope_node; HashMap<FlyString, Variable> variables; }; struct CallFrame { Value this_value; Vector<Value> arguments; }; struct Argument { FlyString name; Value value; }; typedef Vector<Argument, 8> ArgumentVector; class Interpreter { public: template<typename GlobalObjectType, typename... Args> static NonnullOwnPtr<Interpreter> create(Args&&... args) { auto interpreter = adopt_own(*new Interpreter); interpreter->m_global_object = interpreter->heap().allocate<GlobalObjectType>(forward<Args>(args)...); return interpreter; } ~Interpreter(); Value run(const Statement&, ArgumentVector = {}, ScopeType = ScopeType::Block); GlobalObject& global_object(); const GlobalObject& global_object() const; Heap& heap() { return m_heap; } void unwind(ScopeType type) { m_unwind_until = type; } void stop_unwind() { m_unwind_until = ScopeType::None; } bool should_unwind_until(ScopeType type) const { return m_unwind_until == type; } bool should_unwind() const { return m_unwind_until != ScopeType::None; } Optional<Value> get_variable(const FlyString& name); void set_variable(const FlyString& name, Value, bool first_assignment = false); void declare_variable(const FlyString& name, DeclarationKind); void gather_roots(Badge<Heap>, HashTable<Cell*>&); void enter_scope(const ScopeNode&, ArgumentVector, ScopeType); void exit_scope(const ScopeNode&); Value call(Function*, Value this_value = {}, const Vector<Value>& arguments = {}); CallFrame& push_call_frame() { m_call_stack.append({ js_undefined(), {} }); return m_call_stack.last(); } void pop_call_frame() { m_call_stack.take_last(); } const CallFrame& call_frame() { return m_call_stack.last(); } size_t argument_count() const { if (m_call_stack.is_empty()) return 0; return m_call_stack.last().arguments.size(); } Value argument(size_t index) const { if (m_call_stack.is_empty()) return {}; auto& arguments = m_call_stack.last().arguments; return index < arguments.size() ? arguments[index] : js_undefined(); } Value this_value() const { if (m_call_stack.is_empty()) return m_global_object; return m_call_stack.last().this_value; } Shape* empty_object_shape() { return m_empty_object_shape; } Object* string_prototype() { return m_string_prototype; } Object* object_prototype() { return m_object_prototype; } Object* array_prototype() { return m_array_prototype; } Object* error_prototype() { return m_error_prototype; } Object* date_prototype() { return m_date_prototype; } Object* function_prototype() { return m_function_prototype; } Object* number_prototype() { return m_number_prototype; } Object* boolean_prototype() { return m_boolean_prototype; } Exception* exception() { return m_exception; } void clear_exception() { m_exception = nullptr; } template<typename T, typename... Args> Value throw_exception(Args&&... args) { return throw_exception(heap().allocate<T>(forward<Args>(args)...)); } Value throw_exception(Exception*); Value throw_exception(Value value) { return throw_exception(heap().allocate<Exception>(value)); } Value last_value() const { return m_last_value; } private: Interpreter(); Heap m_heap; Value m_last_value; Vector<ScopeFrame> m_scope_stack; Vector<CallFrame> m_call_stack; Shape* m_empty_object_shape { nullptr }; Object* m_global_object { nullptr }; Object* m_string_prototype { nullptr }; Object* m_object_prototype { nullptr }; Object* m_array_prototype { nullptr }; Object* m_error_prototype { nullptr }; Object* m_date_prototype { nullptr }; Object* m_function_prototype { nullptr }; Object* m_number_prototype { nullptr }; Object* m_boolean_prototype { nullptr }; Exception* m_exception { nullptr }; ScopeType m_unwind_until { ScopeType::None }; }; }
1
high
JFilewraper/JCompressfile.h
WhiteGroup/JAV-AV-Engine
15
1659440
<reponame>WhiteGroup/JAV-AV-Engine #ifndef JCOMPRESSFILEH #define JCOMPRESSFILEH #include "Jfile.h" #include "IUnCompersser.h" class JCompressFile : public JFile { public : JCompressFile(); void SetCompressor(IUnCompersser *inposIUnCompersser); JString GetDisplayName () ; void SetDisplayName (JString i_strDisplayName) ; void GetShortName(JString &o_strShortPath , UINT32 MaxLenght) ; BOOLEAN Close(); BOOLEAN CloseHandle(); void SetFileAsVirus(); void SetFileAsWorm(); ~JCompressFile(); #ifdef JFILEKERNEL BOOLEAN OpenTempFile(JString &Name); static BOOLEAN DeleteForTemp(JString &Name); #endif private : JString m_strDisPlayName ; IUnCompersser *posIUnCompersser; BOOLEAN bIsInfected, bIsWorm; }; #endif
0.949219
high
ModelViewer/CropVectorsPage.h
scharlton2/modelviewer-mf6
1
4988400
#if !defined(AFX_CROPVECTORSPAGE_H__2447BF73_04BC_40D3_B68F_5B93BC61F475__INCLUDED_) #define AFX_CROPVECTORSPAGE_H__2447BF73_04BC_40D3_B68F_5B93BC61F475__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // CropVectorsPage.h : header file // class CMvDoc; class CVectorDlg; ///////////////////////////////////////////////////////////////////////////// // CCropVectorsPage dialog class CCropVectorsPage : public CPropertyPage { DECLARE_DYNCREATE(CCropVectorsPage) // Construction public: double m_XDelta; double m_XMax; double m_XMin; double m_YDelta; double m_YMax; double m_YMin; double m_ZDelta; double m_ZMax; double m_ZMin; int m_CropAngle; void OnDefault(); void Activate(BOOL b); void Reinitialize(); void Apply(); BOOL CustomUpdateData(BOOL b); CCropVectorsPage(); ~CCropVectorsPage(); CMvDoc* m_pDoc; // Dialog Data //{{AFX_DATA(CCropVectorsPage) enum { IDD = IDD_CROP_VECTORS }; // NOTE - ClassWizard will add data members here. // DO NOT EDIT what you see in these blocks of generated code ! //}}AFX_DATA // Overrides // ClassWizard generate virtual function overrides //{{AFX_VIRTUAL(CCropVectorsPage) public: protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL // CVectorDlg *m_Parent; BOOL m_ExchangeData; BOOL m_IsActive; // Implementation protected: // Generated message map functions //{{AFX_MSG(CCropVectorsPage) afx_msg void OnDeltaposXminSpin(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnDeltaposXmaxSpin(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnDeltaposYminSpin(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnDeltaposYmaxSpin(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnDeltaposZminSpin(NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnDeltaposZmaxSpin(NMHDR* pNMHDR, LRESULT* pResult); virtual BOOL OnInitDialog(); afx_msg void OnDeltaposCropAngleSpin(NMHDR* pNMHDR, LRESULT* pResult); //}}AFX_MSG DECLARE_MESSAGE_MAP() void AssignDefaultValues(); }; //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_CROPVECTORSPAGE_H__2447BF73_04BC_40D3_B68F_5B93BC61F475__INCLUDED_)
0.929688
high
src/yars/configuration/data/DataRecording.h
kzahedi/YARS
4
6517136
<gh_stars>1-10 #ifndef __DATA_RECORDING_H__ #define __DATA_RECORDING_H__ # define YARS_STRING_RECORDING (char*)"recording" # define YARS_STRING_RECORDING_DEFINITION (char*)"recording_definition" #include <yars/configuration/data/DataNode.h> #include <yars/configuration/data/DataParameter.h> #include <yars/configuration/data/DataActuator.h> #include <yars/types/Matrix.h> #include <yars/types/Domain.h> #include <map> #include <vector> #include <string> typedef __Domain<unsigned long> RecordingInterval; using namespace std; class DataRecording : public DataNode, public std::vector<RecordingInterval> { public: DataRecording(DataNode *parent); virtual ~DataRecording() { }; static void createXsd(XsdSpecification *spec); void add(DataParseElement *element); void resetTo(const DataRecording*); DataRecording* copy(); // returns true if current time step is within a recoding interval bool record(); }; #endif // __DATA_RECORDING_H__
0.976563
high
text/library/gpuimageplus/src/main/jni/include/cgeGLFunctions.h
qwertyezi/test
0
312688
<filename>text/library/gpuimageplus/src/main/jni/include/cgeGLFunctions.h /* * cgeGLFunctions.h * * Created on: 2013-12-5 * Author: <NAME> * Mail: <EMAIL> */ #ifndef _CGEGLFUNCTIONS_H_ #define _CGEGLFUNCTIONS_H_ #include "cgeCommonDefine.h" #include <cassert> #if defined(_CGE_DISABLE_GLOBALCONTEXT_) && _CGE_DISABLE_GLOBALCONTEXT_ #define CGE_ENABLE_GLOBAL_GLCONTEXT(...) #define CGE_DISABLE_GLOBAL_GLCONTEXT(...) #else #define CGE_ENABLE_GLOBAL_GLCONTEXT(...) cgeEnableGlobalGLContext() #define CGE_DISABLE_GLOBAL_GLCONTEXT(...) cgeDisableGlobalGLContext() #endif namespace CGE { #if !(defined(_CGE_DISABLE_GLOBALCONTEXT_) && _CGE_DISABLE_GLOBALCONTEXT_) typedef bool (*CGEEnableGLContextFunction)(void*); typedef bool (*CGEDisableGLContextFunction)(void*); void cgeSetGLContextEnableFunction(CGEEnableGLContextFunction func, void* param); void cgeSetGLContextDisableFunction(CGEDisableGLContextFunction func, void* param); void* cgeGetGLEnableParam(); void* cgeGetGLDisableParam(); void cgeStopGlobalGLEnableFunction(); void cgeRestoreGlobalGLEnableFunction(); void cgeEnableGlobalGLContext(); void cgeDisableGlobalGLContext(); #endif // CGEBufferLoadFun 的返回值将作为 CGEBufferUnloadFun 的第一个参数 // CGEBufferLoadFun 的参数 arg 将作为 CGEBufferUnloadFun 的第二个参数 typedef void* (*CGEBufferLoadFun)(const char* sourceName, void** bufferData, GLint* w, GLint* h, CGEBufferFormat* fmt, void* arg); typedef bool (*CGEBufferUnloadFun)(void* arg1, void* arg2); //加载纹理回调, 注, 为了保持接口简洁性, 回调返回的纹理单元将由调用者负责释放 //返回的纹理不应该为 glDeleteTextures 无法处理的特殊纹理类型. typedef GLuint (*CGETextureLoadFun)(const char* sourceName, GLint* w, GLint* h, void* arg); //You can set a common function for loading textures void cgeSetCommonLoadFunction(CGEBufferLoadFun fun, void* arg); void cgeSetCommonUnloadFunction(CGEBufferUnloadFun fun, void* arg); void* cgeLoadResourceCommon(const char* sourceName, void** bufferData, GLint* w, GLint* h, GLenum* format, GLenum* type); CGEBufferLoadFun cgeGetCommonLoadFunc(); void* cgeGetCommonLoadArg(); bool cgeUnloadResourceCommon(void* bufferArg); CGEBufferUnloadFun cgeGetCommonUnloadFunc(); void* cgeGetCommonUnloadArg(); char* cgeGetScaledBufferInSize(const void* buffer, int& w, int& h, int channel, int maxSizeX, int maxSizeY); char* cgeGetScaledBufferOutofSize(const void* buffer, int& w, int& h, int channel, int minSizeX, int minSizeY); inline GLint cgeGetMaxTextureSize() { GLint n; glGetIntegerv(GL_MAX_TEXTURE_SIZE, &n); return n-1; } class SharedTexture { public: SharedTexture() : m_textureID(0), m_refCount(nullptr), width(0), height(0) {} SharedTexture(GLuint textureID, int w, int h); SharedTexture(const SharedTexture& other) : m_textureID(0), m_refCount(nullptr) { *this = other; } ~SharedTexture(); inline SharedTexture& operator =(const SharedTexture& other) { assert(this != &other && other.m_textureID != 0); if(m_refCount != nullptr && --*m_refCount <= 0) { clear(); } m_textureID = other.m_textureID; m_refCount = other.m_refCount; if (m_refCount) { ++*m_refCount; CGE_LOG_INFO("CGESharedTexture assgin: textureID %d, refCount: %d\n", m_textureID, *m_refCount); } width = other.width; height = other.height; return *this; } inline GLuint texID() const { return m_textureID; } inline void bindToIndex(GLint index) const { glActiveTexture(GL_TEXTURE0 + index); glBindTexture(GL_TEXTURE_2D, m_textureID); } void forceRelease(bool bDelTexture); //特殊用法, 与 forceRelease 配对使用 inline void forceAssignTextureID(GLuint texID) { m_textureID = texID; } public: int width; //public, for easy accessing. int height; protected: void clear(); private: GLuint m_textureID; mutable int* m_refCount; }; class FrameBuffer { public: FrameBuffer() { glGenFramebuffers(1, &m_framebuffer); } ~FrameBuffer() { glDeleteFramebuffers(1, &m_framebuffer); } inline void bind() const { glBindFramebuffer(GL_FRAMEBUFFER, m_framebuffer); } inline void bindTexture2D(const SharedTexture& texture, GLenum attachment = GL_COLOR_ATTACHMENT0) const { bindTexture2D(texture.texID(), texture.width, texture.height, attachment); } inline void bindTexture2D(const SharedTexture& texture, GLsizei x, GLsizei y, GLsizei w, GLsizei h, GLenum attachment = GL_COLOR_ATTACHMENT0) const { bindTexture2D(texture.texID(), x, y, w, h, attachment); } inline void bindTexture2D(GLuint texID, GLsizei w, GLsizei h, GLenum attachment = GL_COLOR_ATTACHMENT0) const { bindTexture2D(texID, 0, 0, w, h, attachment); } inline void bindTexture2D(GLuint texID, GLenum attachment = GL_COLOR_ATTACHMENT0) const { bind(); glFramebufferTexture2D(GL_FRAMEBUFFER, attachment, GL_TEXTURE_2D, texID, 0); CGE_LOG_CODE( if(glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) { CGE_LOG_ERROR("CGE::FrameBuffer::bindTexture2D - Frame buffer is not valid!"); } ) } inline void bindTexture2D(GLuint texID, GLsizei x, GLsizei y, GLsizei w, GLsizei h, GLenum attachment = GL_COLOR_ATTACHMENT0) const { bindTexture2D(texID, attachment); glViewport(x, y, w, h); } inline GLuint getID() { return m_framebuffer; } private: GLuint m_framebuffer; }; struct CGESizei { CGESizei(): width(0), height(0) {} CGESizei(int w, int h) : width(w), height(h) {} void set(int w, int h) { width = w; height = h; } bool operator ==(const CGESizei &other) const { return width == other.width && height == other.height; } bool operator !=(const CGESizei &other) const { return width != other.width || height != other.height; } GLint width; GLint height; }; struct CGESizef { CGESizef() : width(0.0f), height(0.0f) {} CGESizef(float w, float h) : width(w), height(h) {} void set(float w, float h) { width = w; height = h; } GLfloat width; GLfloat height; }; #ifndef CGE_MIN template<typename Type> inline Type CGE_MIN(Type a, Type b) { return a < b ? a : b; } #endif #ifndef CGE_MAX template<typename Type> inline Type CGE_MAX(Type a, Type b) { return a > b ? a : b; } #endif #ifndef CGE_MID template<typename Type> inline Type CGE_MID(Type n, Type vMin, Type vMax) { if(n < vMin) n = vMin; else if(n > vMax) n = vMax; return n; } #endif #ifndef CGE_MIX template<typename OpType, typename MixType> inline auto CGE_MIX(OpType a, OpType b, MixType value) -> decltype(a - a * value + b * value) { return a - a * value + b * value; } #endif struct CGELuminance { enum { CalcPrecision = 16 }; enum { Weight = (1<<CalcPrecision) }; enum { RWeight = int(0.299*Weight), GWeight = int(0.587*Weight), BWeight = int(0.114*Weight) }; static inline int RGB888(int r, int g, int b) { return (r * RWeight + g * GWeight + b * BWeight) >> CalcPrecision; } //color 从低位到高位的顺序为r-g-b, 传参时需要注意大小端问题 static inline int RGB565(unsigned short color) { const int r = (color & 31) << 3; const int g = ((color >> 5) & 63) << 2; const int b = ((color >> 11) & 31) << 3; return RGB888(r, g, b); } }; } ////////////////////////////////////////////////////////////////////////// #include <vector> #include <ctime> #include <memory> #include "cgeShaderFunctions.h" #include "cgeImageHandler.h" #include "CGEImageFilter.h" #endif /* _CGEGLFUNCTIONS_H_ */
0.996094
high
executor/operator/ref/kernel/add_n/ref_addn_uint8.c
wangshankun/Tengine_Atlas
25
1841424
static int ref_addn_uint8(uint8_t** input, uint8_t* output, const ref_addn_param* param) { int input_size = param->input_size; int in_num = param->in_num; float* out_f32 = ( float* )malloc(input_size); memset(out_f32, 0, input_size); for(int i = 0; i < in_num; ++i) { uint8_t* input_data = input[i]; float input_scale = param->in_scale[i]; int zero_point = param->in_zero[i]; for(int j = 0; j < input_size; ++j) { out_f32[j] += (input_data[j] * input_scale + zero_point); } } for(int j = 0; j < input_size; ++j) { int s32_out = round(out_f32[j] / param->out_scale) + param->out_zero; if(s32_out > 255) s32_out = 255; if(s32_out < 0) s32_out = 0; output[j] = s32_out; } free(out_f32); out_f32 = NULL; return 0; }
0.992188
high
Cinegy.Srt.Wrapper/Cinegy.Srt.Wrapper.h
Cinegy/Cinegy.SRT
16
3503528
// Cinegy.Srt.Wrapper.h #pragma once using namespace System; using namespace msclr::interop; namespace Cinegy { namespace Srt { public delegate void OnDataEventHandler(const char* data, size_t dataSize); public ref class SrtReceiver { public: //Helper(void); void SrtReceiver::Run(); void SrtReceiver::Stop(); int GetPort() { return _port; }; void SetPort(int value) { _port = value; } void SetHostname(String^ value) { _strHostname = _strHostname->Copy(value); } String^ GetHostname() { return _strHostname; } event OnDataEventHandler ^ OnDataReceived; private: int _port; String^ _strHostname; void FireOnDataEvent(const char* data, size_t size) { OnDataReceived(data, size); } }; } }
0.992188
high
C/useafterfree/sbrk.c
mudongliang/Language_Programming
0
5032248
/************************************************************************* > File Name: sbrk.c > Author: mudongliang > Mail: <EMAIL> > Created Time: Mon 23 Nov 2015 03:51:48 PM CST ************************************************************************/ #include<stdio.h> #include<unistd.h> #include<sys/types.h> int main() { void *curr_brk, *tmp_brk = NULL; printf("Welcome to sbrk example : %d\n", getpid()); tmp_brk = curr_brk = sbrk(0); printf("Program Break Location1: %p\n", curr_brk); getchar(); brk(curr_brk+0x1000); curr_brk = sbrk(0); printf("Program break Location2: %p\n", curr_brk); getchar(); brk(tmp_brk); curr_brk = sbrk(0); printf("Program break Location3: %p\n", curr_brk); getchar(); return 0; }
0.5
low
headers/os/package/GlobalWritableFileInfo.h
Kirishikesan/haiku
1,338
2027984
<reponame>Kirishikesan/haiku<gh_stars>1000+ /* * Copyright 2013, Haiku, Inc. * Distributed under the terms of the MIT License. */ #ifndef _PACKAGE__GLOBAL_WRITABLE_FILE_INFO_H_ #define _PACKAGE__GLOBAL_WRITABLE_FILE_INFO_H_ #include <package/WritableFileUpdateType.h> #include <String.h> namespace BPackageKit { namespace BHPKG { struct BGlobalWritableFileInfoData; } class BGlobalWritableFileInfo { public: BGlobalWritableFileInfo(); BGlobalWritableFileInfo( const BHPKG::BGlobalWritableFileInfoData& infoData); BGlobalWritableFileInfo(const BString& path, BWritableFileUpdateType updateType, bool isDirectory); ~BGlobalWritableFileInfo(); status_t InitCheck() const; const BString& Path() const; bool IsIncluded() const; BWritableFileUpdateType UpdateType() const; bool IsDirectory() const; void SetTo(const BString& path, BWritableFileUpdateType updateType, bool isDirectory); private: BString fPath; BWritableFileUpdateType fUpdateType; bool fIsDirectory; }; } // namespace BPackageKit #endif // _PACKAGE__GLOBAL_WRITABLE_FILE_INFO_H_
0.996094
high
3dEngine/src/resources/Resource.h
petitg1987/urchinEngine
18
490000
#pragma once #include <string> namespace urchin { class Resource { public: virtual ~Resource() = default; const std::string& getId() const; void setId(const std::string&); const std::string& getName() const; void setName(const std::string&); private: std::string id; std::string name; }; }
0.980469
high
eglibc-2.15/sysdeps/unix/sysv/sigaction.c
huhong789/shortcut
47
2152136
<filename>eglibc-2.15/sysdeps/unix/sysv/sigaction.c<gh_stars>10-100 /* Copyright (C) 1992,1994,1995,1996,1997,2002 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #include <sysdep.h> #include <errno.h> #include <stddef.h> #include <signal.h> /* If ACT is not NULL, change the action for SIG to *ACT. If OACT is not NULL, put the old action for SIG in *OACT. */ int __sigaction (sig, act, oact) int sig; const struct sigaction *act; struct sigaction *oact; { sighandler_t handler; int save; if (sig <= 0 || sig >= NSIG) { __set_errno (EINVAL); return -1; } if (act == NULL) { if (oact == NULL) return 0; /* Race condition, but this is the only way to do it. */ handler = signal (sig, SIG_IGN); if (handler == SIG_ERR) return -1; save = errno; (void) signal (sig, handler); __set_errno (save); } else { int i; if (act->sa_flags != 0) { unimplemented: __set_errno (ENOSYS); return -1; } for (i = 1; i < NSIG; ++i) if (__sigismember (&act->sa_mask, i)) goto unimplemented; handler = signal (sig, act->sa_handler); if (handler == SIG_ERR) return -1; } if (oact != NULL) { oact->sa_handler = handler; __sigemptyset (&oact->sa_mask); oact->sa_flags = 0; } return 0; } libc_hidden_def (__sigaction) weak_alias (__sigaction, sigaction)
0.980469
high
ul_exec_libc.c
mgood7123/userlandexec
1
6012897
<gh_stars>1-10 // #include <libstatic/libstatic.h> #include <errno.h> // extern long errno; #define PGSZ 0x1000 #include <elf.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <string.h> #include <sys/syscall.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/mman.h> #include <stdlib.h> #include <stdio.h> #include <unistd.h> #include <limits.h> #include <assert.h> #include <string.h> #include <errno.h> #include <libgen.h> #include <sys/stat.h> #include <sys/types.h> #include <unistd.h> extern char **environ; // "look deep into yourself, Clarice" -- <NAME> char findyourself_save_pwd[PATH_MAX]; char findyourself_save_argv0[PATH_MAX]; char findyourself_save_path[PATH_MAX]; char findyourself_path_separator='/'; char findyourself_path_separator_as_string[2]="/"; char findyourself_path_list_separator[8]=":"; // could be ":; " char findyourself_debug=0; int findyourself_initialized=0; void findyourself_init(char *argv0) { getcwd(findyourself_save_pwd, sizeof(findyourself_save_pwd)); strncpy(findyourself_save_argv0, argv0, sizeof(findyourself_save_argv0)); findyourself_save_argv0[sizeof(findyourself_save_argv0)-1]=0; strncpy(findyourself_save_path, getenv("PATH"), sizeof(findyourself_save_path)); findyourself_save_path[sizeof(findyourself_save_path)-1]=0; findyourself_initialized=1; } int find_yourself(char *result, size_t size_of_result) { char newpath[PATH_MAX+256]; char newpath2[PATH_MAX+256]; assert(findyourself_initialized); result[0]=0; if(findyourself_save_argv0[0]==findyourself_path_separator) { if(findyourself_debug) printf(" absolute path\n"); realpath(findyourself_save_argv0, newpath); if(findyourself_debug) printf(" newpath=\"%s\"\n", newpath); if(!access(newpath, F_OK)) { strncpy(result, newpath, size_of_result); result[size_of_result-1]=0; return(0); } else { perror("access failed 1"); } } else if( strchr(findyourself_save_argv0, findyourself_path_separator )) { if(findyourself_debug) printf(" relative path to pwd\n"); strncpy(newpath2, findyourself_save_pwd, sizeof(newpath2)); newpath2[sizeof(newpath2)-1]=0; strncat(newpath2, findyourself_path_separator_as_string, sizeof(newpath2)); newpath2[sizeof(newpath2)-1]=0; strncat(newpath2, findyourself_save_argv0, sizeof(newpath2)); newpath2[sizeof(newpath2)-1]=0; realpath(newpath2, newpath); if(findyourself_debug) printf(" newpath=\"%s\"\n", newpath); if(!access(newpath, F_OK)) { strncpy(result, newpath, size_of_result); result[size_of_result-1]=0; return(0); } else { perror("access failed 2"); } } else { if(findyourself_debug) printf(" searching $PATH\n"); char *saveptr; char *pathitem; for(pathitem=strtok_r(findyourself_save_path, findyourself_path_list_separator, &saveptr); pathitem; pathitem=strtok_r(NULL, findyourself_path_list_separator, &saveptr) ) { if(findyourself_debug>=2) printf("pathitem=\"%s\"\n", pathitem); strncpy(newpath2, pathitem, sizeof(newpath2)); newpath2[sizeof(newpath2)-1]=0; strncat(newpath2, findyourself_path_separator_as_string, sizeof(newpath2)); newpath2[sizeof(newpath2)-1]=0; strncat(newpath2, findyourself_save_argv0, sizeof(newpath2)); newpath2[sizeof(newpath2)-1]=0; realpath(newpath2, newpath); if(findyourself_debug) printf(" newpath=\"%s\"\n", newpath); if(!access(newpath, F_OK)) { strncpy(result, newpath, size_of_result); result[size_of_result-1]=0; return(0); } } // end for perror("access failed 3"); } // end else // if we get here, we have tried all three methods on argv[0] and still haven't succeeded. Include fallback methods here. return(1); } // #include <ulexec.h> unsigned long file_size(char *filename) { char sbuf[144]; unsigned long ret; if (0 > (long)(ret = stat(filename, (void *)&sbuf))) { printf("stat problem: %l\n", errno); } else { ret = *(unsigned long *)(sbuf+48); } return ret; } void brk_(unsigned long addr) { asm volatile ("syscall" : : "a" (__NR_brk), "D" (addr)); } struct saved_block { int size; int cnt; char *block; }; void release_args(struct saved_block *args); struct saved_block *save_elfauxv(char **envp); struct saved_block *save_argv(int argc, char **argv); void *stack_setup( struct saved_block *args, struct saved_block *envp, struct saved_block *auxvp, Elf64_Ehdr *ehdr, Elf64_Ehdr *ldso ); #define JMP_ADDR(x) asm("\tjmp *%0\n" :: "r" (x)) #define SET_STACK(x) asm("\tmovq %0, %%rsp\n" :: "r"(x)) #define ROUNDUP(x, y) ((((x)+((y)-1))/(y))*(y)) #define ALIGN(k, v) (((k)+((v)-1))&(~((v)-1))) #define ALIGNDOWN(k, v) ((unsigned long)(k)&(~((unsigned long)(v)-1))) #define ALLOCATE(size) \ mmap(0, (size), PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) void print_maps(void) { char rbuf[1024]; int fd, cc; fd = open("/proc/self/maps", 0, 0); while (0 < (cc = read(fd, rbuf, sizeof(rbuf)))) write(1, rbuf, cc); close(fd); } void error_msg(char *msg) { char buf[32]; printf("%s, %d\n", msg, errno); } void print_address(char *phrase, void *address) { printf("%s, 0x%08x\n", phrase, address); } void * memcopy(void *dest, const void *src, unsigned long n) { unsigned long i; unsigned char *d = (unsigned char *)dest; unsigned char *s = (unsigned char *)src; for (i = 0; i < n; ++i) d[i] = s[i]; return dest; } void copy_in(char *filename, void *address) { int fd, cc; off_t offset = 0; char buf[1024]; if (0 > (fd = open(filename, 0, 0))) { error_msg("opening dynamically-loaded file failed"); exit(2); } while (0 < (cc = read(fd, buf, sizeof(buf)))) { memcpy((address + offset), buf, cc); offset += cc; } close(fd); } void * map_file(char *file_to_map) { struct stat sb; void *mapped; if (0 > stat(file_to_map, &sb)) { error_msg("map_file stat() failed "); exit(1); } mapped = mmap(NULL, sb.st_size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0); if (mapped == (void *)-1) { error_msg("map_file mmap() failed "); exit(1); } copy_in(file_to_map, mapped); return mapped; } void unmap(char *progname) { char buf[1024], *p; char rbuf[2048]; int cc, fd; fd = open("/proc/self/maps", 0, 0); p = &buf[0]; while (0 < (cc = read(fd, rbuf, sizeof(rbuf)))) { int i; for (i = 0; i < cc; ++i) { int c = rbuf[i]; if ('\n' != c) *p++ = c; else { *p = '\0'; /* When a line from /proc/self/maps shows up as having been * mapped in from this running program, ld.so or libc, unmap it. * This will keep the exec'd program's address space a lot * cleaner. But even a 32-bit address space can hold 2 copies * of glibc without ill effects, so you don't really have to * munmap() anything other than the program calling ul_exec() */ if (strstr(buf, progname) || /* strstr(buf, "libdl") || strstr(buf, "/usr/lib/ld-") || strstr(buf, "/lib64/ld-") || */strstr(buf, "libc")) { char *u; char *first, *second; unsigned long low, high; u = strchr(buf, ' '); *u = '\0'; first = buf; second = strchr(first, '-'); *second = '\0'; ++second; low = strtoul(first, NULL, 0x10); high = strtoul(second, NULL, 0x10); printf("before unap:\n"); // print_maps(); munmap((void *)low, high-low); printf("after unap:\n"); // print_maps(); } p = &buf[0]; } } } close(fd); } /* call with argc as positive value for main's argv, * call with argc == 0 for env. */ struct saved_block * save_argv(int argc, char **argv) { struct saved_block *r = NULL; int i, len; char *str; if (argc > 0) for (i = 0, len = 0; i < argc; ++i) len += strlen(argv[i]) + 1; else { argc = 0; char **p = argv; while (*p) { len += strlen(*p) + 1; ++p; /* move past ASCII Nul */ ++argc; } } r = ALLOCATE(sizeof(*r)); r->size = len; r->cnt = argc; r->block = ALLOCATE(len); /* Do it this way because the values of argv[] may not actually * exist as contiguous strings. We will make them contiguous. */ for (i = 0, str = r->block; i < argc; i++) { int j; for (j = 0; argv[i][j]; ++j) str[j] = argv[i][j]; str[j] = '\0'; str += (j + 1); } return r; } void release_args(struct saved_block *args) { munmap((void *)args->block, args->size); munmap((void *)args, sizeof(*args)); } struct saved_block * save_elfauxv(char **envp) { struct saved_block *r; unsigned long *p; int cnt; Elf64_auxv_t *q; p = (unsigned long *)envp; while (*p != 0) ++p; ++p; /* skip null word after env */ for (cnt = 0, q = (Elf64_auxv_t *)p; q->a_type != AT_NULL; ++q) ++cnt; ++cnt; /* The AT_NULL final entry */ r = ALLOCATE(sizeof(*r)); r->size = sizeof(*q) * cnt; r->cnt = cnt; r->block = ALLOCATE(r->size); memcpy((void *)r->block, (void *)p, r->size); return r; } /* Returns value for %rsp, the new "bottom of the stack */ void * stack_setup( struct saved_block *args, struct saved_block *envp, struct saved_block *auxvp, Elf64_Ehdr *ehdr, Elf64_Ehdr *ldso ) { Elf64_auxv_t *aux, *excfn = NULL; char **av, **ev; char *addr, *str, *rsp; unsigned long *ptr; int i, j; char newstack[16384]; /* Align new stack. */ rsp = (char *)ALIGN(((unsigned long)&newstack[150]), 16); /* * After returning from * stack_setup(), don't do anything that uses the call stack: that * will roach this newly-constructed stack. */ ptr = (unsigned long *)rsp; *ptr++ = args->cnt; /* set argc */ av = (char **)ptr; ptr += args->cnt; /* skip over argv[] */ *ptr++ = 0; ev = (char **)ptr; ptr += envp->cnt; /* skip over envp[] */ *ptr++ = 0; aux = (Elf64_auxv_t *)ptr; ptr = (unsigned long *)ROUNDUP((unsigned long)ptr + auxvp->size, sizeof(unsigned long)); /* copy ELF auxilliary vector table */ addr = (char *)aux; for (j = 0; j < auxvp->size; ++j) addr[j] = auxvp->block[j]; /* Fix up a few entries: kernel will have set up the AUXV * for the user-land exec program, mapped in at a low address. * need to fix up a few AUXV entries for the "real" program. */ for (i = 0; i < auxvp->cnt; ++i) { switch (aux[i].a_type) { case AT_PHDR: aux[i].a_un.a_val = (unsigned long)((char *)ehdr + ehdr->e_phoff); break; case AT_PHNUM: aux[i].a_un.a_val = ehdr->e_phnum; break; case AT_BASE: aux[i].a_un.a_val = (unsigned long)ldso; break; case AT_ENTRY: aux[i].a_un.a_val = (unsigned long)ehdr->e_entry; break; #ifdef AT_EXECFN case AT_EXECFN: excfn = &(aux[i]); break; #endif } } *ptr++ = 0; /* Copy argv strings onto stack */ addr = (char *)ptr; str = args->block; for (i = 0; i < args->cnt; ++i) { av[i] = addr; for (j = 0; *str; ++j) *addr++ = *str++; *addr++ = *str++; /* ASCII Nul */ } ptr = (unsigned long *)ROUNDUP((unsigned long)addr, sizeof(unsigned long)); *ptr = 0; /* Copy envp strings onto stack */ addr = (char *)ptr; str = envp->block; for (i = 0; i < envp->cnt; ++i) { ev[i] = addr; for (j = 0; *str; ++j) *addr++ = *str++; *addr++ = *str++; /* ASCII Nul */ } ptr = (unsigned long *)ROUNDUP((unsigned long)addr, sizeof(unsigned long)); *ptr = 0; /* Executable name at top of stack */ if (excfn) { addr = (char *)ptr; str = args->block; excfn->a_un.a_val = (unsigned long)addr; for (j = 0; *str; ++j) *addr++ = *str++; *addr++ = *str++; /* ASCII Nul */ ptr = (unsigned long *)ROUNDUP((unsigned long)addr, sizeof(unsigned long)); } release_args(args); release_args(envp); release_args(auxvp); return ((void *)rsp); } int read_(const char *src, char **dest, int len) { char *p = malloc(len + 1); memcpy(p, src, len); p[len] = 0; *dest = p; return len; } void lseek_string(char **src, int len, int offset) { char *p = malloc(len); memcpy(p, *src+offset, len); *src = p; } #define QUOTE_0_TERMINATED 0x01 #define QUOTE_OMIT_LEADING_TRAILING_QUOTES 0x02 #define QUOTE_OMIT_TRAILING_0 0x08 #define QUOTE_FORCE_HEX 0x10 #define QUOTE_FORCE_LEN 9999 int string_quote(const char *instr, char *outstr, const unsigned int size, const unsigned int style) { const unsigned char *ustr = (const unsigned char *) instr; char *s = outstr; unsigned int i; int usehex, uselen, c; int xflag = 0; usehex = 0; uselen = 0; if ((style == 9999)) { uselen = 1; } else if ((xflag > 1) || (style & QUOTE_FORCE_HEX)) { usehex = 1; } else if (xflag) { /* Check for presence of symbol which require to hex-quote the whole string. */ for (i = 0; i < size; ++i) { c = ustr[i]; /* Check for NUL-terminated string. */ if (c == 0x100) break; /* Force hex unless c is printable or whitespace */ if (c > 0x7e) { usehex = 1; break; } /* In ASCII isspace is only these chars: "\t\n\v\f\r". * They happen to have ASCII codes 9,10,11,12,13. */ if (c < ' ' && (unsigned)(c - 9) >= 5) { usehex = 1; break; } } } if (!(style & QUOTE_OMIT_LEADING_TRAILING_QUOTES)) *s++ = '\"'; if (usehex == 1) { /* Hex-quote the whole string. */ for (i = 0; i < size; ++i) { c = ustr[i]; /* Check for NUL-terminated string. */ if (c == 0x100) goto asciz_ended; // print hex in " 00 00" format instead of "\x00\x00" format // *s++ = '\\'; *s++ = ' '; *s++ = "0123456789abcdef"[c >> 4]; *s++ = "0123456789abcdef"[c & 0xf]; } } else if (uselen == 1) { /* Hex-quote the whole string. */ for (i = 0; i < size; ++i) { c = ustr[i]; /* Check for NUL-terminated string. */ if (c == 0x100) goto asciz_ended; *s++ = '1'; } } else { for (i = 0; i < size; ++i) { c = ustr[i]; /* Check for NUL-terminated string. */ if (c == 0x100) goto asciz_ended; if ((i == (size - 1)) && (style & QUOTE_OMIT_TRAILING_0) && (c == '\0')) goto asciz_ended; int pass_one = 0; int pass_two = 0; int pass_three = 0; int pass_four = 0; if (c == '\f') { *s++ = '\\'; *s++ = 'f'; pass_one = 1; pass_three = 1; pass_four= 1; } if (pass_one == 0) { if (c == '%'/*FOR PRINTF*/) { *s++ = '%'; *s++ = '%'; pass_two = 1; pass_three = 1; pass_four= 1; } else { pass_two = 1; } } if (pass_two == 0) { if (c == '\"') { /*FOR PRINTF/SHELL*/ *s++ = '\\'; *s++ = '\"'; pass_three = 1; pass_four= 1; } else if (c == '\\') { /*FOR PRINTF/SHELL*/ *s++ = '\\'; *s++ = '\\'; pass_three = 1; pass_four= 1; } else if (c == '`'/*FOR PRINTF*/|| c == '$'/*FOR BASH*/) { // *s++ = '\\'; *s++ = c; pass_three = 1; pass_four= 1; } else if (c == '\''/*FOR PRINTF*/) { // *s++ = '\\'; // *s++ = 'x'; // *s++ = '2'; *s++ = c; pass_three = 1; pass_four= 1; } else if (c == '!'/*FOR BASH*/ || c == '-'/*FOR PRINTF*/) { // *s++ = '"'; // *s++ = '\''; *s++ = c; // *s++ = '\''; // *s++ = '"'; pass_three = 1; pass_four= 1; } else if (c == '%'/*FOR PRINTF*/) { *s++ = '%'; *s++ = '%'; *s++ = '%'; *s++ = '%'; pass_three = 1; pass_four= 1; } } if (pass_three == 0) { if (c == '\n') { *s++ = '\\'; *s++ = 'n'; pass_four = 1; } else if (c == '\r') { *s++ = '\\'; *s++ = 'r'; pass_four = 1; } else if (c == '\t') { *s++ = '\\'; *s++ = 't'; pass_four = 1; } else if (c == '\v') { *s++ = '\\'; *s++ = 'v'; pass_four = 1; } } if (pass_four == 0) { if (c >= ' ' && c <= 0x7e) *s++ = c; else { /* Print \octal */ *s++ = '\\'; if (i + 1 < size && ustr[i + 1] >= '0' && ustr[i + 1] <= '9' ) { /* Print \ooo */ *s++ = '0' + (c >> 6); *s++ = '0' + ((c >> 3) & 0x7); } else { /* Print \[[o]o]o */ if ((c >> 3) != 0) { if ((c >> 6) != 0) *s++ = '0' + (c >> 6); *s++ = '0' + ((c >> 3) & 0x7); } } *s++ = '0' + (c & 0x7); } } } } if (!(style & QUOTE_OMIT_LEADING_TRAILING_QUOTES)) *s++ = '\"'; *s = '\0'; /* Return zero if we printed entire ASCIZ string (didn't truncate it) */ if (style & QUOTE_0_TERMINATED && ustr[i] == '\0') { /* We didn't see NUL yet (otherwise we'd jump to 'asciz_ended') * but next char is NUL. */ return 0; } return 1; asciz_ended: if (!(style & QUOTE_OMIT_LEADING_TRAILING_QUOTES)) *s++ = '\"'; *s = '\0'; /* Return zero: we printed entire ASCIZ string (didn't truncate it) */ return 0; } #ifndef ALLOCA_CUTOFF # define ALLOCA_CUTOFF 4032 #endif #define use_alloca(n) ((n) <= ALLOCA_CUTOFF) /* * Quote string `str' of length `size' and print the result. * * If QUOTE_0_TERMINATED `style' flag is set, * treat `str' as a NUL-terminated string and * quote at most (`size' - 1) bytes. * * If QUOTE_OMIT_LEADING_TRAILING_QUOTES `style' flag is set, * do not add leading and trailing quoting symbols. * * Returns 0 if QUOTE_0_TERMINATED is set and NUL was seen, 1 otherwise. * Note that if QUOTE_0_TERMINATED is not set, always returns 1. */ char * print_quoted_string(const char *str, unsigned int size, const unsigned int style, const char * return_type) { char *buf; char *outstr; unsigned int alloc_size; int rc; if (size && style & QUOTE_0_TERMINATED) --size; alloc_size = 4 * size; if (alloc_size / 4 != size) { error_msg("Out of memory"); printf("???"); return "-1"; } alloc_size += 1 + (style & QUOTE_OMIT_LEADING_TRAILING_QUOTES ? 0 : 2); if (use_alloca(alloc_size)) { outstr = alloca(alloc_size); buf = NULL; } else { outstr = buf = malloc(alloc_size); if (!buf) { error_msg("Out of memory"); printf("???"); return "-1"; } } // rc = string_quote(str, outstr, size, style); string_quote(str, outstr, size, style); if ( return_type == "return") { return outstr; } else if ( return_type == "print") { printf(outstr); } free(buf); // return rc; } void * load_elf(char *mapped, int anywhere, Elf64_Ehdr **elf_ehdr, Elf64_Ehdr **ldso_ehdr, void * mapped_b) { Elf64_Ehdr *hdr; Elf64_Phdr *pdr, *interp = NULL; int i; void *text_segment = NULL; void *entry_point = NULL; unsigned long initial_vaddr = 0; unsigned long brk_addr = 0; char buf[128]; unsigned int mapflags = MAP_PRIVATE|MAP_ANONYMOUS; if (!anywhere) mapflags |= MAP_FIXED; /* Just addresses in mapped-in file. */ hdr = (Elf64_Ehdr *)mapped; pdr = (Elf64_Phdr *)(mapped + hdr->e_phoff); entry_point = (void *)hdr->e_entry; for (i = 0; i < hdr->e_phnum; ++i, ++pdr) { unsigned int protflags = 0; unsigned long map_addr = 0, rounded_len, k; unsigned long unaligned_map_addr = 0; void *segment; if (pdr->p_type == 0x03) /* PT_INTERP */ { interp = pdr; continue; } if (pdr->p_type != PT_LOAD) /* Segment not "loadable" */ continue; if (text_segment != 0 && anywhere) { unaligned_map_addr = (unsigned long)text_segment + ((unsigned long)pdr->p_vaddr - (unsigned long)initial_vaddr) ; map_addr = ALIGNDOWN((unsigned long)unaligned_map_addr, 0x1000); mapflags |= MAP_FIXED; } else if (!anywhere) { map_addr = ALIGNDOWN(pdr->p_vaddr, 0x1000); } else { map_addr = 0UL; } if (!anywhere && initial_vaddr == 0) initial_vaddr = pdr->p_vaddr; /* mmap() freaks out if you give it a non-multiple of pagesize */ rounded_len = (unsigned long)pdr->p_memsz + ((unsigned long)pdr->p_vaddr % 0x1000); rounded_len = ROUNDUP(rounded_len, 0x1000); segment = mmap( (void *)map_addr, rounded_len, PROT_WRITE, mapflags, -1, 0 ); if (segment == (void *) -1) { printf("Failed to mmap()"); exit(3); } printf("anywhere = %d\n", anywhere); memcopy( !anywhere? (void *)pdr->p_vaddr: (void *)((unsigned long)segment + ((unsigned long)pdr->p_vaddr % 0x1000)), mapped + pdr->p_offset, pdr->p_filesz ); if (!text_segment) { *elf_ehdr = segment; text_segment = segment; initial_vaddr = pdr->p_vaddr; if (anywhere) entry_point = (void *)((unsigned long)entry_point - (unsigned long)pdr->p_vaddr + (unsigned long)text_segment); } if (pdr->p_flags & PF_R) protflags |= PROT_READ; if (pdr->p_flags & PF_W) protflags |= PROT_WRITE; if (pdr->p_flags & PF_X) protflags |= PROT_EXEC; mprotect(segment, rounded_len, protflags); k = pdr->p_vaddr + pdr->p_memsz; if (k > brk_addr) brk_addr = k; } if (interp) { Elf64_Ehdr *junk_ehdr = NULL; printf("LOAD_ELF mapping %p\n", mapped_b); entry_point = load_elf(mapped_b, 1, ldso_ehdr, &junk_ehdr, NULL); } if (!anywhere) brk_(ROUNDUP(brk_addr, 0x1000)); return (void *)entry_point; } char *strjoinb(const char *_a, const char *_b) { size_t na = strlen(_a); size_t nb = strlen(_b); char *p = malloc(na + nb + 1); memcpy(p, _a, na); memcpy(p + na, _b, nb); p[na + nb] = 0; return p; } int shift_split(char * argv[], char * program[], char * args[], int * ac) { // shift function modified for this purpose char ** args_tmp = malloc(1 * sizeof(*args_tmp)); for(int i=0; i<99; i++) { if (argv[i] == NULL) { printf("end of argument list\n"); break; } if (i == 0) { } else if (i == 1) { printf("program[%d] = %s\n", *ac, argv[i]); program[0] = argv[i]; *ac = *ac+1; } else { printf("args[%d] = %s\n", *ac-1, argv[i]); args[i-2] = argv[i]; *ac = *ac+1; } } return 0; } int split (char *str, char c, char ***arr) { int count = 1; int token_len = 1; int i = 0; char *p; char *t; p = str; while (*p != '\0') { if (*p == c) count++; p++; } *arr = (char**) malloc(sizeof(char*) * count); if (*arr == NULL) exit(1); p = str; while (*p != '\0') { if (*p == c) { (*arr)[i] = (char*) malloc( sizeof(char) * token_len ); if ((*arr)[i] == NULL) exit(1); token_len = 0; i++; } p++; token_len++; } (*arr)[i] = (char*) malloc( sizeof(char) * token_len ); if ((*arr)[i] == NULL) exit(1); i = 0; p = str; t = ((*arr)[i]); while (*p != '\0') { if (*p != c && *p != '\0') { *t = *p; t++; } else { *t = '\0'; i++; t = ((*arr)[i]); } p++; } return count; } // not used but kept incase needed, a version of lseek_string that has an offset multiplier as so this does not need to be specified multiple times, eg if offset is 64 and multiplier is 2 the offset is then 128, this is intended for loops and related void lseek_stringb(char **src, int len, int offset, int offsetT) { char *p = malloc(len); int off; off=((len*offsetT)); memcpy(p, *src+offset+off, len); *src = p; } char *strjoin(const char *_a, const char *_b, int _a_len, int len) { size_t na = _a_len; size_t nb = len; char *p = malloc(na + nb + 1); memcpy(p, _a, na); memcpy(p + na, _b, nb); p[na + nb] = 0; return p; } int stream__(char *file, char **p, int *q, int LINES_TO_READ) { const char *filename = file; int fd = open(filename, O_RDONLY); if (fd < 0) { printf("cannot open \"%s\", returned %i\n", filename, fd); return -1; } char * array; char ch; size_t lines = 1; // Read the file byte by byte int bytes=1; int count=1; array = malloc(sizeof(char) * 2048); char *array_tmp; while (read(fd, &ch, 1) == 1) { printf("\rbytes read: %'i", bytes); if (count == 1024) { array_tmp = realloc(array, bytes+1024); if (array_tmp == NULL) { printf("failed to allocate array to new size"); free(array); exit(1); } else { array = array_tmp; } count=1; } array[bytes-1] = ch; if (ch == '\n') { if (lines == LINES_TO_READ) { break; } lines++; } count++; bytes++; } bytes--; array_tmp = realloc(array, bytes); if (array_tmp == NULL) { printf("failed to allocate array to new size"); free(array); exit(1); } else { array = array_tmp; } printf("\rbytes read: %'i\n", bytes); *p = array; *q = bytes; return bytes; } // not used but kept incase needed, a version of stream__ that only outputs the last line read int stream__o(char *file, char **p, int *q, int LINES_TO_READ) { const char *filename = file; int fd = open(filename, O_RDONLY); if (fd < 0) { printf("cannot open \"%s\", returned %i\n", filename, fd); return -1; } char * array; char * array_tmp; char * array_lines; char * array_lines_tmp; char ch; size_t lines = 1; // Read the file byte by byte int bytes=1; int count=1; array = malloc(sizeof(char) * 2048); while (read(fd, &ch, 1) == 1) { printf("\rbytes read: %'i", bytes); if (count == 1024) { array_tmp = realloc(array, bytes+1024); if (array_tmp == NULL) { printf("failed to allocate array to new size"); free(array); exit(1); } else { array = array_tmp; } count=1; } array[bytes-1] = ch; if (ch == '\n') { printf("attempting to reset array\n"); if (lines == LINES_TO_READ) { break; } else { // reset array to as if we just executed this function int y; for (y=0; y<bytes; y++) { array[y] = 0; } free(array); array = malloc(sizeof(char) * 2048); bytes=1; count=1; } lines++; } // count++; bytes++; } bytes--; array_tmp = realloc(array, bytes); if (array_tmp == NULL) { printf("failed to allocate array to new size"); free(array); exit(1); } else { array = array_tmp; } printf("\rbytes read: %'i\n", bytes); *p = array; *q = bytes; return bytes; } // reads a entire file int read__(char *file, char **p, size_t *q) { int fd; size_t len = 0; char *o; if (!(fd = open(file, O_RDONLY))) { fprintf(stderr, "open() failure\n"); return (1); } len = lseek(fd, 0, SEEK_END); lseek(fd, 0, 0); if (!(o = malloc(len))) { fprintf(stderr, "failure to malloc()\n"); } if ((read(fd, o, len)) == -1) { fprintf(stderr, "failure to read()\n"); } int cl = close(fd); if (cl < 0) { printf("cannot close \"%s\", returned %i\n", file, cl); return -1; } *p = o; *q = len; return len; } void * stack_setupb( struct saved_block *args, struct saved_block *envp, struct saved_block *auxvp, Elf64_Ehdr *ehdr, Elf64_Ehdr *ldso ) { Elf64_auxv_t *aux, *excfn = NULL; char **av, **ev; char *addr, *str, *rsp; unsigned long *ptr; int i, j; char newstack[16384]; /* Align new stack. */ rsp = (char *)ALIGN(((unsigned long)&newstack[150]), 16); /* * After returning from * stack_setup(), don't do anything that uses the call stack: that * will roach this newly-constructed stack. */ ptr = (unsigned long *)rsp; *ptr++ = args->cnt; /* set argc */ av = (char **)ptr; ptr += args->cnt; /* skip over argv[] */ *ptr++ = 0; ev = (char **)ptr; ptr += envp->cnt; /* skip over envp[] */ *ptr++ = 0; aux = (Elf64_auxv_t *)ptr; ptr = (unsigned long *)ROUNDUP((unsigned long)ptr + auxvp->size, sizeof(unsigned long)); /* copy ELF auxilliary vector table */ addr = (char *)aux; for (j = 0; j < auxvp->size; ++j) addr[j] = auxvp->block[j]; /* Fix up a few entries: kernel will have set up the AUXV * for the user-land exec program, mapped in at a low address. * need to fix up a few AUXV entries for the "real" program. */ for (i = 0; i < auxvp->cnt; ++i) { switch (aux[i].a_type) { case AT_PHDR: aux[i].a_un.a_val = (unsigned long)((char *)ehdr + ehdr->e_phoff); break; case AT_PHNUM: aux[i].a_un.a_val = ehdr->e_phnum; break; case AT_BASE: aux[i].a_un.a_val = (unsigned long)ldso; break; case AT_ENTRY: aux[i].a_un.a_val = (unsigned long)ehdr->e_entry; break; #ifdef AT_EXECFN case AT_EXECFN: excfn = &(aux[i]); break; #endif } } *ptr++ = 0; /* Copy argv strings onto stack */ addr = (char *)ptr; str = args->block; for (i = 0; i < args->cnt; ++i) { av[i] = addr; for (j = 0; *str; ++j) *addr++ = *str++; *addr++ = *str++; /* ASCII Nul */ } ptr = (unsigned long *)ROUNDUP((unsigned long)addr, sizeof(unsigned long)); *ptr = 0; /* Copy envp strings onto stack */ addr = (char *)ptr; str = envp->block; for (i = 0; i < envp->cnt; ++i) { ev[i] = addr; for (j = 0; *str; ++j) *addr++ = *str++; *addr++ = *str++; /* ASCII Nul */ } ptr = (unsigned long *)ROUNDUP((unsigned long)addr, sizeof(unsigned long)); *ptr = 0; /* Executable name at top of stack */ if (excfn) { addr = (char *)ptr; str = args->block; excfn->a_un.a_val = (unsigned long)addr; for (j = 0; *str; ++j) *addr++ = *str++; *addr++ = *str++; /* ASCII Nul */ ptr = (unsigned long *)ROUNDUP((unsigned long)addr, sizeof(unsigned long)); } release_args(args); release_args(envp); release_args(auxvp); return ((void *)rsp); } #include <sys/auxv.h> void die(const char *s) { perror(s); exit(errno); } void set_auxv(char * value) { char buf[1024]; int fd = -1; ssize_t r = 0; Elf64_auxv_t *auxv = NULL; snprintf(buf, sizeof(buf), "/proc/self/auxv"); if ((fd = open(buf, O_RDONLY)) < 0) die("[-] open"); if ((r = read(fd, buf, sizeof(buf))) < 0) die("[-] read"); close(fd); for (auxv = (Elf64_auxv_t *)buf; auxv->a_type != AT_NULL && (char *)auxv < buf + r; ++auxv) { switch (auxv->a_type) { case AT_EXECFN: printf("old AT_EXECFN:\t%s\n", (void *)auxv->a_un.a_val); auxv->a_un.a_val = value; printf("new AT_EXECFN:\t%s\n", (void *)auxv->a_un.a_val); break; default: break; } } } char * get_full_path() { findyourself_init((char *)getauxval(AT_EXECFN)); char * auxAT = (char *)getauxval(AT_EXECFN); char newpath[PATH_MAX]; find_yourself(newpath, sizeof(newpath)); if(1 || strcmp((char *)getauxval(AT_EXECFN),newpath)) { } char *fullpath = strdup( newpath ); char *directorypath = dirname( strdup( newpath ) ); printf("current = %s\nfullpath = %s\ndirname = %s\n", auxAT, fullpath, directorypath); return fullpath; } #define _dl_printf printf #define strchrb strchr #define strcpyb strcpy #define strncpyb strncpy #define strncatb strncat #define strstrb strstr int * resolve(char * path) { _dl_printf("called resolve()\n"); if(!access(path, F_OK)) { } else { return -1; } char * pathb = (char *)malloc(strlen(path) + 1); char * strcpyb(char *dest, const char *src); strcpyb(pathb,path); char save_pwd[PATH_MAX]; getcwd(save_pwd, sizeof(save_pwd)); char path_separator='/'; char relpathdot_separator[4]="/./"; char relpathdotdor_separator[5]="/../"; char newpathb[PATH_MAX+256]; char newpathc[PATH_MAX+256]; char linkb[PATH_MAX+256]; char linkd[PATH_MAX+256]; char tmp_pwd[PATH_MAX]; char current_pwd[PATH_MAX]; getcwd(current_pwd, sizeof(current_pwd)); #include <sys/types.h> #include <sys/stat.h> char* resolvedir(const char * pathb) { _dl_printf("chdir(%s)\n", pathb); chdir(pathb); _dl_printf("getcwd(%s, sizeof(%s))\n", tmp_pwd, tmp_pwd); getcwd(tmp_pwd, sizeof(tmp_pwd)); _dl_printf("%s points to %s\n\n", pathb, tmp_pwd); _dl_printf("chdir(%s)\n", current_pwd); chdir(current_pwd); _dl_printf("return %s\n", tmp_pwd); return tmp_pwd; } char* resolvefile(char * pathb) { _dl_printf("strncpyb(%s, %s, sizeof(%s)\n", linkb, pathb, linkb); strncpyb(linkb, pathb, sizeof(linkb)); _dl_printf("linkb[sizeof(%s)-1]=0\n", linkb); linkb[sizeof(linkb)-1]=0; _dl_printf("strncpyb(%s, %s, sizeof(%s)\n", linkd, pathb, linkb); strncpyb(linkd, pathb, sizeof(linkb)); _dl_printf("linkb[sizeof(%s)-1]=0\n", linkb); linkb[sizeof(linkb)-1]=0; _dl_printf("dirname(%s)\n", linkd); dirname(linkd); _dl_printf("strncatb(%s, \"/\", sizeof(%s));\n", linkd, linkd); strncatb(linkd, "/", sizeof(linkd)); _dl_printf("linkd[sizeof(%s)-1]=0\n", linkd); linkd[sizeof(linkd)-1]=0; _dl_printf("chdir(%s)\n", linkd); chdir(linkd); _dl_printf("getcwd(%s, sizeof(%s))\n", tmp_pwd, tmp_pwd); getcwd(tmp_pwd, sizeof(tmp_pwd)); _dl_printf("strncatb(%s, \"/\", sizeof(%s));\n", tmp_pwd, tmp_pwd); strncatb(tmp_pwd, "/", sizeof(tmp_pwd)); _dl_printf("tmp_pwd[sizeof(%s)-1]=0\n", tmp_pwd); tmp_pwd[sizeof(tmp_pwd)-1]=0; _dl_printf("strncpyb(%s, %s, sizeof(%s));\n", linkb, basename(pathb), linkb); strncpyb(linkb, basename(pathb), sizeof(linkb)); _dl_printf("linkb[sizeof(%s)-1]=0\n", linkb); linkb[sizeof(linkb)-1]=0; _dl_printf("strncatb(%s, %s, sizeof(%s));\n", tmp_pwd, linkb, tmp_pwd); strncatb(tmp_pwd, linkb, sizeof(tmp_pwd)); _dl_printf("tmp_pwd[sizeof(%s)-1]=0\n", tmp_pwd); tmp_pwd[sizeof(tmp_pwd)-1]=0; _dl_printf("%s points to %s\n\n", pathb, tmp_pwd); _dl_printf("chdir(%s)\n", current_pwd); chdir(current_pwd); _dl_printf("return %s\n", tmp_pwd); return tmp_pwd; } #include <sys/types.h> #include <sys/stat.h> char * getlink(const char * link) { struct stat p_statbuf; if (lstat(link,&p_statbuf)==0) { _dl_printf("%s type is <int>\n",link, S_ISLNK(p_statbuf.st_mode)); if (S_ISLNK(p_statbuf.st_mode)==1) { _dl_printf("%s is symbolic link \n", link); } else { _dl_printf("%s is not symbolic link \n", link); return 0; } } struct stat sb; char *linkname; ssize_t r; if (lstat(link, &sb) == -1) { _exit(EXIT_FAILURE); } linkname = malloc(sb.st_size + 1); if (linkname == NULL) { _exit(EXIT_FAILURE); } r = readlink(link, linkname, sb.st_size + 1); if (r < 0) { _exit(EXIT_FAILURE); } if (r > sb.st_size) { _exit(EXIT_FAILURE); } linkname[sb.st_size] = '\0'; _dl_printf("\"%s\" points to '%s'\n", link, linkname); path = linkname; char * checkifsymlink(const char * tlink) { struct stat p_statbuf; if (lstat(tlink,&p_statbuf)==0) { _dl_printf("%s type is <int>\n",tlink, S_ISLNK(p_statbuf.st_mode)); if (S_ISLNK(p_statbuf.st_mode)==1) { _dl_printf("%s is symbolic link \n", tlink); _dl_printf("called getlink()\n"); getlink(tlink); } else { _dl_printf("%s is not symbolic link \n", tlink); return 0; } } return 0; } _dl_printf("called checkifsymlink()\n"); checkifsymlink(path); return 0; } _dl_printf("called getlink()\n"); getlink(path); char * testtype(const char * patha) { int is_regular_file(const char *patha) { struct stat path_stat; stat(patha, &path_stat); return S_ISREG(path_stat.st_mode); } int isDirectory(const char *patha) { struct stat statbuf; if (stat(patha, &statbuf) != 0) return 0; return S_ISDIR(statbuf.st_mode); } if (is_regular_file(patha)==1) { _dl_printf("%s is file \n", patha); if (path[0]==path_separator) { if ( strstrb(path, relpathdot_separator )) { _dl_printf("%s is an absolute path which contains a dot relative path\n", path); _dl_printf("called Rresolvefile()\n"); return resolvefile(path); } else if ( strstrb(path, relpathdotdor_separator )) { _dl_printf("%s is an absolute path which contains a dot dot relative path\n", path); _dl_printf("called resolvefile()\n"); return resolvefile(path); } else { _dl_printf("%s is an absolute path with no relative paths\n", path); return path; } } else if ( strchrb(path, path_separator )) { _dl_printf("%s is a relative path\n", path); strncpyb(newpathb, current_pwd, sizeof(newpathb)); newpathb[sizeof(newpathb)-1]=0; strncatb(newpathb, "/", sizeof(newpathb)); newpathb[sizeof(newpathb)-1]=0; strncatb(newpathb, path, sizeof(newpathb)); newpathb[sizeof(newpathb)-1]=0; _dl_printf("called resolvefile()\n"); printf("need to re execute\n"); char * new_aux = resolvefile(newpathb); printf("executing with %s\n\n\n\n", new_aux); int ret = execv(new_aux, NULL); printf("ret = %d\n\n", ret); return "ERROR"; } else { _dl_printf("could not determine path type of %s\n", path); return "NULL"; } } else if (isDirectory(patha)==1) { _dl_printf("%s is a directory \n", patha); if (path[0]==path_separator) { if ( strstrb(path, relpathdot_separator )) { _dl_printf("%s is an absolute path which contains a dot relative path\n", path); _dl_printf("called resolvedir()\n"); resolvedir(path); } else if ( strstrb(path, relpathdotdor_separator )) { _dl_printf("%s is an absolute path which contains a dot dot relative path\n", path); _dl_printf("called resolvedir()\n"); resolvedir(path); } else { _dl_printf("%s is an absolute path with no relative paths\n", path); return path; } } else if ( strchrb(path, path_separator )) { _dl_printf("%s is a relative path\n", path); _dl_printf("strncpyb(%s, %s, sizeof(%s));\n", newpathc, current_pwd, newpathc); strncpyb(newpathc, current_pwd, sizeof(newpathc)); _dl_printf("newpath2[sizeof(%s)-1]=0;\n", newpathc); newpathc[sizeof(newpathc)-1]=0; _dl_printf("strncatb(%s, %s, sizeof(%s));\n", newpathc, "/", newpathc); strncatb(newpathc, "/", sizeof(newpathc)); _dl_printf("newpathc[sizeof(%s)-1]=0;\n", newpathc); newpathc[sizeof(newpathc)-1]=0; _dl_printf("strncatb(%s, %s, sizeof(%s));\n", newpathc, path, newpathc); strncatb(newpathc, path, sizeof(newpathc)); _dl_printf("newpathc[sizeof(%s)-1]=0;\n", newpathc); newpathc[sizeof(newpathc)-1]=0; _dl_printf("called resolvedir()\n"); return resolvedir(newpathc); } else { _dl_printf("could not determine path type of %s\n", path); return "NULL"; } } return "FAILED"; } _dl_printf("called testtype()\n"); return testtype(path); } void * setaux(int *argc, char ** argv, void * value, unsigned long type) { // printf("type = %d\n", type); #define AUX_CNT 32 // AT_SYSINFO_EHDR: 0x7fffdb375000 // AT_HWCAP: 178bfbff // AT_PAGESZ: 4096 // AT_CLKTCK: 100 // AT_PHDR: 0x400040 // AT_PHENT: 56 // AT_PHNUM: 10 // AT_BASE: 0x7ff5e3c1c000 // AT_FLAGS: 0x0 // AT_ENTRY: 0x4032e0 // AT_UID: 1000 // AT_EUID: 1000 // AT_GID: 1001 // AT_EGID: 1001 // AT_SECURE: 0 // AT_RANDOM: 0x7fffdb34a379 // AT_HWCAP2: 0x0 // AT_EXECFN: /usr/bin/gcc // AT_PLATFORM: x86_64 size_t i; int num = -1; void * AUXV_TYPE; char * AUXV_NAME; for (i=argc+1; argv[i]; i++); for (int ii=0; ii<=(void *)(argv+i+1)[0]+(2*20); ii+=2) { // 20 extra incase auxv does not have the same vectors for every machine (could have more than +4) size_t tmp = (void *)(argv+i+1+ii)[0]; switch(tmp) { case 0: AUXV_NAME = "AT_NULL"; AUXV_TYPE = ""; // printf("AUXV_NAME = %s, AUXV_TYPE = %s\n", AUXV_NAME, AUXV_TYPE); num = 0; break; case 1: AUXV_NAME = "AT_IGNORE"; AUXV_TYPE = ""; // printf("AUXV_NAME = %s, AUXV_TYPE = %s\n", AUXV_NAME, AUXV_TYPE); num = 1; break; case 2: AUXV_NAME = "AT_EXECFD"; AUXV_TYPE = ""; // printf("AUXV_NAME = %s, AUXV_TYPE = %s\n", AUXV_NAME, AUXV_TYPE); num = 2; break; case 3: AUXV_NAME = "AT_PHDR"; AUXV_TYPE = "ADDRESS"; // printf("AUXV_NAME = %s, AUXV_TYPE = %s\n", AUXV_NAME, AUXV_TYPE); num = 3; break; case 4: AUXV_NAME = "AT_PHENT"; AUXV_TYPE = "INT"; // printf("AUXV_NAME = %s, AUXV_TYPE = %s\n", AUXV_NAME, AUXV_TYPE); num = 4; break; case 5: AUXV_NAME = "AT_PHNUM"; AUXV_TYPE = "INT"; // printf("AUXV_NAME = %s, AUXV_TYPE = %s\n", AUXV_NAME, AUXV_TYPE); num = 5; break; case 6: AUXV_NAME = "AT_PAGESZ"; AUXV_TYPE = "INT"; // printf("AUXV_NAME = %s, AUXV_TYPE = %s\n", AUXV_NAME, AUXV_TYPE); num = 6; break; case 7: AUXV_NAME = "AT_BASE"; AUXV_TYPE = "ADDRESS"; // printf("AUXV_NAME = %s, AUXV_TYPE = %s\n", AUXV_NAME, AUXV_TYPE); num = 7; break; case 8: AUXV_NAME = "AT_FLAGS"; AUXV_TYPE = "ADDRESS"; // printf("AUXV_NAME = %s, AUXV_TYPE = %s\n", AUXV_NAME, AUXV_TYPE); num = 8; break; case 9: AUXV_NAME = "AT_ENTRY"; AUXV_TYPE = "ADDRESS"; // printf("AUXV_NAME = %s, AUXV_TYPE = %s\n", AUXV_NAME, AUXV_TYPE); num = 9; break; case 10: AUXV_NAME = "AT_NOTELF"; AUXV_TYPE = ""; // printf("AUXV_NAME = %s, AUXV_TYPE = %s\n", AUXV_NAME, AUXV_TYPE); num = 10; break; case 11: AUXV_NAME = "AT_UID"; AUXV_TYPE = "INT"; // printf("AUXV_NAME = %s, AUXV_TYPE = %s\n", AUXV_NAME, AUXV_TYPE); num = 11; break; case 12: AUXV_NAME = "AT_EUID"; AUXV_TYPE = "INT"; // printf("AUXV_NAME = %s, AUXV_TYPE = %s\n", AUXV_NAME, AUXV_TYPE); num = 12; break; case 13: AUXV_NAME = "AT_GID"; AUXV_TYPE = "INT"; // printf("AUXV_NAME = %s, AUXV_TYPE = %s\n", AUXV_NAME, AUXV_TYPE); num = 13; break; case 14: AUXV_NAME = "AT_EGID"; AUXV_TYPE = "INT"; // printf("AUXV_NAME = %s, AUXV_TYPE = %s\n", AUXV_NAME, AUXV_TYPE); num = 14; break; case 15: AUXV_NAME = "AT_PLATFORM"; AUXV_TYPE = "CHAR*"; // printf("AUXV_NAME = %s, AUXV_TYPE = %s\n", AUXV_NAME, AUXV_TYPE); num = 15; break; case 16: AUXV_NAME = "AT_HWCAP"; AUXV_TYPE = "ADDRESS"; // printf("AUXV_NAME = %s, AUXV_TYPE = %s\n", AUXV_NAME, AUXV_TYPE); num = 16; break; case 17: AUXV_NAME = "AT_CLKTCK"; AUXV_TYPE = "INT"; // printf("AUXV_NAME = %s, AUXV_TYPE = %s\n", AUXV_NAME, AUXV_TYPE); num = 17; break; case 18: AUXV_NAME = "AT_FPUCW"; AUXV_TYPE = ""; // printf("AUXV_NAME = %s, AUXV_TYPE = %s\n", AUXV_NAME, AUXV_TYPE); num = 18; break; case 19: AUXV_NAME = "AT_DCACHEBSIZE"; AUXV_TYPE = ""; // printf("AUXV_NAME = %s, AUXV_TYPE = %s\n", AUXV_NAME, AUXV_TYPE); num = 19; break; case 20: AUXV_NAME = "AT_ICACHEBSIZE"; AUXV_TYPE = ""; // printf("AUXV_NAME = %s, AUXV_TYPE = %s\n", AUXV_NAME, AUXV_TYPE); num = 20; break; case 21: AUXV_NAME = "AT_UCACHEBSIZE"; AUXV_TYPE = ""; // printf("AUXV_NAME = %s, AUXV_TYPE = %s\n", AUXV_NAME, AUXV_TYPE); num = 21; break; case 22: AUXV_NAME = "AT_IGNOREPPC"; AUXV_TYPE = ""; // printf("AUXV_NAME = %s, AUXV_TYPE = %s\n", AUXV_NAME, AUXV_TYPE); num = 22; break; case 23: AUXV_NAME = "AT_SECURE"; AUXV_TYPE = "INT"; // printf("AUXV_NAME = %s, AUXV_TYPE = %s\n", AUXV_NAME, AUXV_TYPE); num = 23; break; case 24: AUXV_NAME = "AT_BASE_PLATFORM"; AUXV_TYPE = ""; // printf("AUXV_NAME = %s, AUXV_TYPE = %s\n", AUXV_NAME, AUXV_TYPE); num = 24; break; case 25: AUXV_NAME = "AT_RANDOM"; AUXV_TYPE = ""; // printf("AUXV_NAME = %s, AUXV_TYPE = %s\n", AUXV_NAME, AUXV_TYPE); num = 25; break; case 26: AUXV_NAME = "AT_HWCAP2"; AUXV_TYPE = "ADDRESS"; // printf("AUXV_NAME = %s, AUXV_TYPE = %s\n", AUXV_NAME, AUXV_TYPE); num = 26; break; case 31: AUXV_NAME = "AT_EXECFN"; AUXV_TYPE = "CHAR*"; // printf("AUXV_NAME = %s, AUXV_TYPE = %s\n", AUXV_NAME, AUXV_TYPE); num = 31; break; case 32: AUXV_NAME = "AT_SYSINFO"; AUXV_TYPE = ""; // printf("AUXV_NAME = %s, AUXV_TYPE = %s\n", AUXV_NAME, AUXV_TYPE); num = 32; break; case 33: AUXV_NAME = "AT_SYSINFO_EHDR"; AUXV_TYPE = "ADDRESS"; // printf("AUXV_NAME = %s, AUXV_TYPE = %s\n", AUXV_NAME, AUXV_TYPE); num = 33; break; case 34: AUXV_NAME = "AT_L1I_CACHESHAPE"; AUXV_TYPE = ""; // printf("AUXV_NAME = %s, AUXV_TYPE = %s\n", AUXV_NAME, AUXV_TYPE); num = 34; break; case 35: AUXV_NAME = "AT_L1D_CACHESHAPE"; AUXV_TYPE = ""; // printf("AUXV_NAME = %s, AUXV_TYPE = %s\n", AUXV_NAME, AUXV_TYPE); num = 35; break; case 36: AUXV_NAME = "AT_L2_CACHESHAPE"; AUXV_TYPE = ""; // printf("AUXV_NAME = %s, AUXV_TYPE = %s\n", AUXV_NAME, AUXV_TYPE); num = 36; break; case 37: AUXV_NAME = "AT_L3_CACHESHAPE"; AUXV_TYPE = ""; // printf("AUXV_NAME = %s, AUXV_TYPE = %s\n", AUXV_NAME, AUXV_TYPE); num = 37; break; default: AUXV_NAME = "UNDEFINED"; AUXV_TYPE = ""; // printf("AUXV_NAME = %s, AUXV_TYPE = %s\n", AUXV_NAME, AUXV_TYPE); num = -1; break; } if (num == type) { // printf("changing %s (type %s)\n", AUXV_NAME, AUXV_TYPE); // printf("address of (void *)(argv+%d+1+%d)[1] = %p\n", i, ii, (void *)&(argv+i+1+ii)[1]); #include <sys/auxv.h> if (AUXV_TYPE == "CHAR*") { printf("calling getauxval: "); printf("%s = %s\n", AUXV_NAME, (char *)getauxval(type)); char * string = value; char *j = (void *)(argv+i+1+ii)[1]; int len = strlen((void *)(argv+i+1+ii)[1]); int len_ = strlen(string); // printf("j = %s\n(void *)(argv+i+1+%d)[1] = %s\n", j, ii, (void *)(argv+i+1+ii)[1]); // printf("attempting to modify %s\n", AUXV_NAME); for (int g = 0; g<=len_; g++) { *j = string[g]; j+=1; } for (int g = 0; g<=len-len_; g++) { // NULL the rest of the string *j = '\0'; j+=1; } // printf("j = %s\n(void *)(argv+i+1+%d)[1] = %s\n", j, ii, (void *)(argv+i+1+ii)[1]); printf("calling getauxval: "); printf("%s = %s\n", AUXV_NAME, (char *)getauxval(type)); } else if (AUXV_TYPE == "INT") { printf("calling getauxval: "); printf("%s = %d\n", AUXV_NAME, (char *)getauxval(type)); // printf("(void *)(argv+i+1+%d)[1] (auxv) =\n", ii); // print_quoted_string_catraw((void *)(argv+i+1+ii)[1], 1, QUOTE_OMIT_TRAILING_0|QUOTE_OMIT_LEADING_TRAILING_QUOTES); // printf("\n"); // printf("(void *)(argv+i+1+%d)[1] = %p\n", ii, (void *)(argv+i+1+ii)[1]); // printf("attempting to modify %s\n", AUXV_NAME); (argv+i+1+ii)[1] = value; // printf("(void *)(argv+i+1+%d)[1] = %p\n", ii, (void *)(argv+i+1+ii)[1]); printf("calling getauxval: "); printf("%s = %d\n", AUXV_NAME, (char *)getauxval(type)); } else if (AUXV_TYPE == "ADDRESS") { printf("calling getauxval: "); printf("%s = %p\n", AUXV_NAME, (char *)getauxval(type)); // printf("(void *)(argv+i+1+%d)[1] = %p\n", ii, (void *)(argv+i+1+ii)[1]); // printf("attempting to modify %s\n", AUXV_NAME); (argv+i+1+ii)[1] = value; // printf("(void *)(argv+i+1+%d)[1] = %p\n", ii, (void *)(argv+i+1+ii)[1]); printf("calling getauxval: "); printf("%s = %p\n", AUXV_NAME, (char *)getauxval(type)); } } } type = -1; } // execve implimentation void ulexec(char * pro, char * args, char **env) { print_maps(); char * current_aux = (char *)getauxval(AT_EXECFN); // printf("returned %s\n", resolve(current_aux)); printf("AT_EXECFN = %s\n", current_aux); printf ("current_aux[0] = %c\n", current_aux[0]); printf("need to re execute\n"); char * new_aux = get_full_path(); printf("executing with %s\n\n", new_aux); // setaux(argc, argv, "", AT_EXECFN); // int ret = execv(new_aux, NULL); // printf("ret = %d\n\n", ret); printf("safe to continue\n\n"); int arg_c = 0; char ** program_to_execute = malloc(1 * sizeof(*program_to_execute)); printf("allocating %d\n", 1 * sizeof(*program_to_execute)); program_to_execute[0] = "placeholder"; char ** program_arguments = malloc(1 * sizeof(*program_arguments)); printf("allocating %d\n", 1 * sizeof(*program_arguments)); program_arguments[0] = "placeholder"; char ** program_program_arguments = malloc(1 * sizeof(*program_program_arguments)); program_program_arguments[0] = "placeholder"; // shift_split(av, program_to_execute, program_arguments, program_program_arguments, &arg_c); char * s = strjoinb(pro, " "); s = strjoinb(s, args); int c = 0; char **arr = NULL; c = split(s, ' ', &arr); printf("found %d tokens.\n", c-1); for (int i = 0; i < c; i++) { program_program_arguments[i] = arr[i]; printf("program_program_arguments[%d] = %s\n", i, program_program_arguments[i]); } program_to_execute[0] = program_program_arguments[0]; printf("program_to_execute[%d] = %s\n", 0, program_to_execute[0]); for (int i = 1; i < c; i++) { program_arguments[i-1] = arr[i]; printf("program_arguments[%d] = %s\n", i-1, program_arguments[i-1]); } printf("number of arguments: \n%d\nprogram: \n%s\n", c, program_to_execute[0]); for (int i = 0; i<=arg_c-2; i++) printf("program args: %d = \n%s\n", i, program_arguments[i]); // print_maps(); int how_to_map = 0; void *entry_point; struct stat sb; Elf64_Ehdr *ldso_ehdr; struct saved_block *argvb, *envb, *elfauxvb; int trim_args, i; void *stack_bottom; how_to_map = 0; trim_args = 1; // if (file_to_unmap) // unmap(file_to_unmap);#include <sys/mman.h> void * mapped_interp; const char * filename = program_to_execute[0]; int fd = open(filename, O_RDONLY); if (fd < 0) { printf("cannot open \"%s\", returned %i\n", filename, fd); } size_t len = 0; len = lseek(fd, 0, SEEK_END); lseek(fd, 0, 0); void * mapped = mmap (NULL, len, PROT_READ, MAP_PRIVATE, fd, 0); if (mapped == MAP_FAILED) { printf ("map failed\n"); exit; } else { printf ("map (%s) succeded with address: 0x%08x\n", filename, mapped); } // mapped = map_file(av[1]); // elf_ehdr = (Elf64_Ehdr *)mapped; printf("aquiring header\n"); Elf64_Ehdr * elf_ehdr = (Elf64_Ehdr *) mapped; // phdr = (Elf64_Phdr *)((unsigned long)elf_ehdr + elf_ehdr->e_phoff); printf("aquiring program header\n"); Elf64_Phdr *phdr = (Elf64_Phdr *)((unsigned long)elf_ehdr + elf_ehdr->e_phoff); printf("searching for PT_LOAD and PT_INTERP\n"); void * mapped_i; for (i = 0; i < elf_ehdr->e_phnum; ++i) { if (phdr[i].p_type == PT_LOAD && phdr[i].p_vaddr == 0) { how_to_map = 1; /* map it anywhere, like ld.so, or PIC code. */ printf("mapping anywhere\n"); break; } if (phdr[i].p_type == PT_INTERP) { printf("ATTEMPING TO READ\n"); char * tmp99; read_(mapped, &tmp99, (phdr[i].p_memsz + phdr[i].p_offset)); lseek_string(&tmp99, phdr[i].p_memsz, phdr[i].p_offset); print_quoted_string(tmp99, phdr[i].p_memsz, QUOTE_OMIT_TRAILING_0|QUOTE_OMIT_LEADING_TRAILING_QUOTES, "print"); printf("\nREAD\n"); const char * filename = print_quoted_string(tmp99, phdr[i].p_memsz, QUOTE_OMIT_TRAILING_0|QUOTE_OMIT_LEADING_TRAILING_QUOTES, "return"); int fd = open(filename, O_RDONLY); // usually /lib64/ld-linux-x86-64.so.2 if (fd < 0) { printf ("cannot open \""); print_quoted_string(tmp99, phdr[i].p_memsz, QUOTE_OMIT_TRAILING_0|QUOTE_OMIT_LEADING_TRAILING_QUOTES, "print"); printf("\", returned %i\n", fd); } size_t len = 0; len = lseek(fd, 0, SEEK_END); lseek(fd, 0, 0); mapped_i = mmap (NULL, len, PROT_READ, MAP_PRIVATE, fd, 0); if (mapped_i == MAP_FAILED) { printf ("map ("); print_quoted_string(tmp99, phdr[i].p_memsz, QUOTE_OMIT_TRAILING_0|QUOTE_OMIT_LEADING_TRAILING_QUOTES, "print"); printf(") failed\n"); exit; } else { printf ("map ("); print_quoted_string(tmp99, phdr[i].p_memsz, QUOTE_OMIT_TRAILING_0|QUOTE_OMIT_LEADING_TRAILING_QUOTES, "print"); printf(") succeded with address: 0x%08x\n", mapped_i); } } } printf("loading\n"); entry_point = load_elf(mapped, how_to_map, &elf_ehdr, &ldso_ehdr, mapped_i); printf("unmapping\n"); munmap(mapped, sb.st_size); printf("argvb = save_argv(%d, %s);\n", c, program_program_arguments[0]); argvb = save_argv(c, &program_program_arguments[0]); printf("saving envb\n"); envb = save_argv(0, env); printf("saving elfauxvb\n"); elfauxvb = save_elfauxv(env); printf("stack_setup()\n"); stack_bottom = stack_setup(argvb, envb, elfauxvb, elf_ehdr, ldso_ehdr); printf("SET_STACK()\n"); SET_STACK(stack_bottom); printf("printing maps before executing\n"); print_maps(); printf("jumping to %p\n", entry_point); JMP_ADDR(entry_point); } // executes an exeutable using the packaged interpreter void ulexec_array(void * mapped, void * mapped_interpreter, char * args, char **env) { print_maps(); int arg_c = 0; char ** program_arguments = malloc(1 * sizeof(*program_arguments)); printf("allocating %d\n", 1 * sizeof(*program_arguments)); program_arguments[0] = "placeholder"; int c = 0; char **arr = NULL; c = split(args, ' ', &arr); printf("found %d tokens.\n", c); for (int i = 0; i < c; i++) { program_arguments[i+1] = arr[i]; printf("program_arguments[%d] = %s\n", i+1, program_arguments[i+1]); } for (int i = 0; i<=arg_c-2; i++) printf("program args: %d = \n%s\n", i, program_arguments[i]); int how_to_map = 0; void *entry_point; struct stat sb; Elf64_Ehdr *ldso_ehdr; struct saved_block *argvb, *envb, *elfauxvb; int trim_args, i; void *stack_bottom; how_to_map = 0; trim_args = 1; // if (file_to_unmap) // unmap(file_to_unmap); void * mapped_interp; // mapped = map_file(av[1]); // elf_ehdr = (Elf64_Ehdr *)mapped; printf("aquiring header\n"); Elf64_Ehdr * elf_ehdr = (Elf64_Ehdr *) mapped; // phdr = (Elf64_Phdr *)((unsigned long)elf_ehdr + elf_ehdr->e_phoff); printf("aquiring program header\n"); Elf64_Phdr *phdr = (Elf64_Phdr *)((unsigned long)elf_ehdr + elf_ehdr->e_phoff); printf("searching for PT_LOAD and PT_INTERP\n"); void * mapped_i; if (mapped_interpreter == NULL) { printf("mapped = null\n"); for (i = 0; i < elf_ehdr->e_phnum; ++i) { if (phdr[i].p_type == PT_LOAD && phdr[i].p_vaddr == 0) { how_to_map = 1; /* map it anywhere, like ld.so, or PIC code. */ printf("mapping anywhere\n"); break; } if (phdr[i].p_type == PT_INTERP) { printf("ATTEMPING TO READ\n"); char * tmp99; read_(mapped, &tmp99, (phdr[i].p_memsz + phdr[i].p_offset)); lseek_string(&tmp99, phdr[i].p_memsz, phdr[i].p_offset); print_quoted_string(tmp99, phdr[i].p_memsz, QUOTE_OMIT_TRAILING_0|QUOTE_OMIT_LEADING_TRAILING_QUOTES, "print"); printf("\nREAD\n"); const char * filename = print_quoted_string(tmp99, phdr[i].p_memsz, QUOTE_OMIT_TRAILING_0|QUOTE_OMIT_LEADING_TRAILING_QUOTES, "return"); int fd = open(filename, O_RDONLY); // opens the system's ld.so and uses it if an interpreter is not provided in the 2nd argument of ulexec_array if (fd < 0) { printf ("cannot open \""); print_quoted_string(tmp99, phdr[i].p_memsz, QUOTE_OMIT_TRAILING_0|QUOTE_OMIT_LEADING_TRAILING_QUOTES, "print"); printf("\", returned %i\n", fd); } size_t len = 0; len = lseek(fd, 0, SEEK_END); lseek(fd, 0, 0); mapped_i = mmap (NULL, len, PROT_READ, MAP_PRIVATE, fd, 0); if (mapped_i == MAP_FAILED) { printf ("map ("); print_quoted_string(tmp99, phdr[i].p_memsz, QUOTE_OMIT_TRAILING_0|QUOTE_OMIT_LEADING_TRAILING_QUOTES, "print"); printf(") failed\n"); exit; } else { printf ("map ("); print_quoted_string(tmp99, phdr[i].p_memsz, QUOTE_OMIT_TRAILING_0|QUOTE_OMIT_LEADING_TRAILING_QUOTES, "print"); printf(") succeded with address: 0x%08x\n", mapped_i); } } } } else { mapped_i = mapped_interpreter; } printf("loading %p\n", mapped_i); entry_point = load_elf(mapped, how_to_map, &elf_ehdr, &ldso_ehdr, mapped_i); printf("unmapping\n"); munmap(mapped, sb.st_size); printf("argvb = save_argv(%d, %s);\n", c+1, program_arguments[0]); argvb = save_argv(c+1, &program_arguments[0]); envb = save_argv(0, env); elfauxvb = save_elfauxv(env); stack_bottom = stack_setup(argvb, envb, elfauxvb, elf_ehdr, ldso_ehdr); SET_STACK(stack_bottom); // printf("printing maps before executing\n"); // print_maps(); printf("jumping to %p\n", entry_point); JMP_ADDR(entry_point); } // executes using system's interpreter int ulexecb(void * array, char ** env) { print_maps(); int i = 0; print_quoted_string(array, 16, QUOTE_FORCE_HEX, "print"); printf("hai\n"); # include <elf.h> printf(" )\n"); Elf64_Ehdr * _elf_header = (Elf64_Ehdr *) array; printf("hai again\n"); printf("ELF Identifier\t %s (", _elf_header->e_ident); print_quoted_string(_elf_header->e_ident, sizeof(_elf_header->e_ident), QUOTE_FORCE_HEX|QUOTE_OMIT_LEADING_TRAILING_QUOTES, "print"); printf(" )\n"); if(!strncmp((char*)_elf_header->e_ident, "\177ELF", 4)) { // ELF Header: // Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 // Class: ELF64 // Data: 2's complement, little endian // Version: 1 (current) // OS/ABI: UNIX - System V // ABI Version: 0 // Type: EXEC (Executable file) // Machine: Advanced Micro Devices X86-64 // Version: 0x1 // Entry point address: 0x400820 // Start of program headers: 64 (bytes into file) // Start of section headers: 11408 (bytes into file) // Flags: 0x0 // Size of this header: 64 (bytes) // Size of program headers: 56 (bytes) // Number of program headers: 9 // Size of section headers: 64 (bytes) // Number of section headers: 30 // Section header string table index: 29 // printf("ELF Identifier\t %s (", _elf_header->e_ident); print_quoted_string(_elf_header->e_ident, sizeof(_elf_header->e_ident), QUOTE_FORCE_HEX|QUOTE_OMIT_LEADING_TRAILING_QUOTES, "print"); printf(" )\n"); printf("Architecture\t "); switch(_elf_header->e_ident[EI_CLASS]) { case ELFCLASSNONE: printf("None\n"); break; case ELFCLASS32: printf("32-bit\n"); break; case ELFCLASS64: printf("64-bit\n"); break; case ELFCLASSNUM: printf("NUM ( unspecified )\n"); break; default: printf("Unknown CLASS\n"); break; } printf("Data Type\t "); switch(_elf_header->e_ident[EI_DATA]) { case ELFDATANONE: printf("None\n"); break; case ELFDATA2LSB: printf("2's complement, little endian\n"); break; case ELFDATA2MSB: printf("2's complement, big endian\n"); break; case ELFDATANUM: printf("NUM ( unspecified )\n"); break; default: printf("Unknown \n"); break; } printf("Version\t\t "); switch(_elf_header->e_ident[EI_VERSION]) { case EV_NONE: printf("None\n"); break; case EV_CURRENT: printf("Current\n"); break; case EV_NUM: printf("NUM ( Unspecified )\n"); break; default: printf("Unknown \n"); break; } printf("OS ABI\t\t "); switch(_elf_header->e_ident[EI_OSABI]) { case ELFOSABI_NONE: printf("UNIX System V ABI\n"); break; // case ELFOSABI_SYSV: // printf("SYSV\n"); // break; // case ELFOSABI_HPUX: printf("HP-UX\n"); break; case ELFOSABI_NETBSD: printf("NetBSD\n"); break; case ELFOSABI_GNU: printf("GNU\n"); break; // case ELFOSABI_LINUX: // printf("Linux\n"); // break; // case ELFOSABI_SOLARIS: printf("Sun Solaris\n"); break; case ELFOSABI_AIX: printf("ABM AIX\n"); break; case ELFOSABI_FREEBSD: printf("FreeBSD\n"); break; case ELFOSABI_TRU64: printf("Compaq Tru64\n"); break; case ELFOSABI_MODESTO: printf("Novell Modesto\n"); break; case ELFOSABI_OPENBSD: printf("OpenBSD\n"); break; // case ELFOSABI_ARM_AEABI: // printf("ARM EABI\n"); // break; case ELFOSABI_ARM: printf("ARM\n"); break; case ELFOSABI_STANDALONE: printf("Standalone (embedded) application\n"); break; default: printf("Unknown \n"); break; } printf("File Type\t "); switch(_elf_header->e_type) { case ET_NONE: printf("None\n"); break; case ET_REL: printf("Relocatable file\n"); break; case ET_EXEC: printf("Executable file\n"); break; case ET_DYN: printf("Shared object file\n"); break; case ET_CORE: printf("Core file\n"); break; case ET_NUM: printf("Number of defined types\n"); break; case ET_LOOS: printf("OS-specific range start\n"); break; case ET_HIOS: printf("OS-specific range end\n"); break; case ET_LOPROC: printf("Processor-specific range start\n"); break; case ET_HIPROC: printf("Processor-specific range end\n"); break; default: printf("Unknown \n"); break; } printf("Machine\t\t "); switch(_elf_header->e_machine) { case EM_NONE: printf("None\n"); break; case EM_386: printf("INTEL x86\n"); break; case EM_X86_64: printf("AMD x86-64 architecture\n"); break; case EM_ARM: printf("ARM\n"); break; default: printf("Unknown\n"); break; } /* Entry point */ int entry=_elf_header->e_entry; printf("Entry point\t 0x%08x Step 3. and jump to e_entry\n", _elf_header->e_entry); /* ELF header size in bytes */ printf("ELF header size\t 0x%08x\n", _elf_header->e_ehsize); /* Program Header */ printf("Program Header\t 0x%08x (%d entries with a total of %d bytes)\n", _elf_header->e_phoff, _elf_header->e_phnum, _elf_header->e_phentsize ); // for static, obtain the following: everything in the structure Elf64_Phdr, then `, PT_LOAD, PT_DYNAMIC, then e_entry Elf64_Phdr *elf_program_header = (Elf64_Phdr *)((unsigned long)_elf_header + _elf_header->e_phoff); char * exe = ""; int lenexe = 0; int lentotal = 0; for (i = 0; i < _elf_header->e_phnum; ++i) { // printf("dl_iterate_phdr =\n"); // dl_iterate_phdr(callback, NULL); printf("p_type;\t\t\t/* Segment type */\t\t= "); switch(elf_program_header[i].p_type) { case PT_NULL: printf("PT_NULL\t\t/* Program header table entry unused */\n"); break; case PT_LOAD: printf("PT_LOAD\t\t/* Loadable program segment */ Step 2. then parse and process all PT_LOAD segments\n"); break; case PT_DYNAMIC: printf("PT_DYNAMIC\t\t/* Dynamic linking information */ Step 2.5 keep in mind that static-PIE binaries are dynamic ELF objects though, so to load those you need to parse the PT_DYNAMIC stuff\n"); break; case PT_INTERP: printf("PT_INTERP\t\t/* Program interpreter */\n"); break; case PT_NOTE: printf("PT_NOTE\t\t/* Auxiliary information */\n"); break; case PT_SHLIB: printf("PT_SHLIB\t\t/* Reserved */\n"); break; case PT_PHDR: printf("PT_PHDR\t\t/* Entry for header table itself */ Step 1. if the first entry is a PT_PHDR, use that as the program header table\n"); break; case PT_TLS: printf("PT_TLS\t\t/* Thread-local storage segment */\n"); break; case PT_NUM: printf("PT_NUM\t\t/* Number of defined types */\n"); break; case PT_LOOS: printf("PT_LOOS\t\t/* Start of OS-specific */\n"); break; case PT_GNU_EH_FRAME: printf("PT_GNU_EH_FRAME\t/* GCC .eh_frame_hdr segment */\n"); break; case PT_GNU_STACK: printf("PT_GNU_STACK\t\t/* Indicates stack executability */\n"); break; case PT_GNU_RELRO: printf("PT_GNU_RELRO\t\t/* Read-only after relocation */\n"); break; case PT_SUNWBSS: printf("PT_SUNWBSS\t\t/* Sun Specific segment */\n"); break; case PT_SUNWSTACK: printf("PT_SUNWSTACK\t\t/* Stack segment */\n"); break; case PT_HIOS: printf("PT_HIOS\t\t/* End of OS-specific */\n"); break; case PT_LOPROC: printf("PT_LOPROC\t\t/* Start of processor-specific */\n"); break; case PT_HIPROC: printf("PT_HIPROC\t\t/* End of processor-specific */\n"); break; default: printf("Unknown\n"); break; } // read_pload (dst address in memory, how many bytes to read, offset in the file) read_pload(ph->p_paddr, ph->p_memsz, ph->p_offset); char * tmp99; if (elf_program_header[i].p_type == PT_LOAD) { lentotal = lentotal + elf_program_header[i].p_memsz; exe = strjoin(exe, tmp99, lenexe, lentotal); // print_quoted_string(exe, lentotal, 0, "print"); printf("\n"); lenexe = lentotal; } else { printf("ATTEMPING TO READ\n"); read_(array, &tmp99, (elf_program_header[i].p_memsz + elf_program_header[i].p_offset)); lseek_string(&tmp99, elf_program_header[i].p_memsz, elf_program_header[i].p_offset); print_quoted_string(tmp99, elf_program_header[i].p_memsz, 0, "print"); printf("\nREAD\n"); } // could this [ // read_pload (dst address in memory, how many bytes to read, offset in the file) read_pload(ph->p_paddr, ph->p_memsz, ph->p_offset); ] be shortened to [ read_pload(mapped_file, ph->p_memsz, (ph->p_paddr + ph->p_offset); ] ? https://stackoverflow.com/a/29326748/8680581 printf("p_flags;\t\t/* Segment flags */\t\t= 0x%08x\np_offset;\t\t/* Segment file offset */\t= 0x%08x\np_vaddr;\t\t/* Segment virtual address */\t= 0x%08x\np_paddr;\t\t/* Segment physical address */\t= 0x%08x\np_filesz;\t\t/* Segment size in file */\t= 0x%08x\np_memsz;\t\t/* Segment size in memory */\t= 0x%08x\np_align;\t\t/* Segment alignment */\t\t= 0x%08x\n\n\n", elf_program_header[i].p_flags, elf_program_header[i].p_offset, elf_program_header[i].p_vaddr, elf_program_header[i].p_paddr, elf_program_header[i].p_filesz, elf_program_header[i].p_memsz, elf_program_header[i].p_align); printf("p_flags = 0x%08x, p_offset = 0x%08x, p_vaddr = 0x%08x, p_paddr = 0x%08x, p_filesz = 0x%08x, p_memsz = 0x%08x, p_align = 0x%08x\n\n\n", elf_program_header[i].p_flags, elf_program_header[i].p_offset, elf_program_header[i].p_vaddr, elf_program_header[i].p_paddr, elf_program_header[i].p_filesz, elf_program_header[i].p_memsz, elf_program_header[i].p_align); } // rest MAY be irrelivant for static executable execution // printf("Section Header\t \ _elf_header->e_shstrndx 0x%08x (\ _elf_header->e_shnum = %d entries with a total of \ _elf_header->e_shentsize = %d (should match %d) bytes, offset is \ _elf_header->e_shoff = 0x%08x)\n",\ _elf_header->e_shstrndx,\ _elf_header->e_shnum,\ _elf_header->e_shentsize,\ sizeof(Elf64_Shdr),\ _elf_header->e_shoff,\ (char *)array + _elf_header->e_shoff\ ); Elf64_Shdr *_symbol_table; // read section header table void read_section_header_table_(const char * arrayb, Elf64_Ehdr * eh, Elf64_Shdr * sh_table[]) { *sh_table = (Elf64_Shdr *)(arrayb + eh->e_shoff); if(!_symbol_table) { printf("Failed to read table\n"); } } char * read_section_(char * ar, Elf64_Shdr sh) { char * buff = (char *)(ar + sh.sh_offset); return buff ; } char * print_section_headers_(char * sourcePtr, Elf64_Ehdr * eh, Elf64_Shdr sh_table[]) { printf ("\n"); printf("eh->e_shstrndx = 0x%x\n", eh->e_shstrndx); char * sh_str; sh_str = read_section_(sourcePtr, sh_table[eh->e_shstrndx]); // will fail untill section header table can be read printf("\t========================================"); printf("========================================\n"); printf("\tidx offset load-addr size algn type flags section\n"); printf("\t========================================"); printf("========================================\n"); for(i=0; i<eh->e_shnum; i++) { // will fail untill section header table can be read printf("\t%03d ", i); printf("0x%08x ", _symbol_table[i].sh_offset); // p_offset printf("0x%08x ", _symbol_table[i].sh_addr); // p_paddr or p_vaddr printf("0x%08x ", _symbol_table[i].sh_size); // p_filesz or p_memsz printf("%4d ", _symbol_table[i].sh_addralign); // p_align // for some reason sh_flags ans sh_type are swiched around printf("0x%08x ", _symbol_table[i].sh_flags); // p_flags printf("0x%08x ", _symbol_table[i].sh_type); // Unknown printf("%s\t", (sh_str + sh_table[i].sh_name)); printf("\n"); } printf("\t========================================"); printf("========================================\n"); printf("\n"); } void print_symbol_table(char * arrayc, Elf64_Ehdr eh, Elf64_Shdr sh_table[], uint64_t symbol_table) { char *str_tbl; Elf64_Sym* sym_tbl; uint64_t i, symbol_count; sym_tbl = (Elf64_Sym*)read_section_(arrayc, sh_table[symbol_table]); /* Read linked string-table * Section containing the string table having names of * symbols of this section */ uint64_t str_tbl_ndx = sh_table[symbol_table].sh_link; printf("str_tbl_ndx = 0x%x\n", str_tbl_ndx); str_tbl = read_section_(arrayc, sh_table[str_tbl_ndx]); symbol_count = (sh_table[symbol_table].sh_size/sizeof(Elf64_Sym)); printf("%d symbols\n", symbol_count); for(i=0; i< symbol_count; i++) { printf("PART0 sym_tbl[i].st_value = 0x%08x\n", sym_tbl[i].st_value); printf("PART1 ELF64_ST_BIND(sym_tbl[%d].st_info) = 0x%02x\n", i, ELF64_ST_BIND(sym_tbl[i].st_info)); printf("PART2 ELF64_ST_TYPE(sym_tbl[%d].st_info) = 0x%02x\n", i, ELF64_ST_TYPE(sym_tbl[i].st_info)); printf("PART3 (str_tbl + sym_tbl[%d].st_name) = %s\n\n", i, (str_tbl + sym_tbl[i].st_name)); } } void print_symbols(char * arrayd, Elf64_Ehdr * eh, Elf64_Shdr sh_table[]) { for(i=0; i<eh->e_shnum; i++) { if ((sh_table[i].sh_type==SHT_SYMTAB) || (sh_table[i].sh_type==SHT_DYNSYM)) { printf("\n[Section %03d]", i); print_symbol_table(arrayd, *eh, sh_table, i); } } } // // ## dynamic // p_flags; /* Segment flags */ = 0x00000006 // p_offset; /* Segment file offset */ = 0x00003e20 // p_vaddr; /* Segment virtual address */ = 0x00603e20 // p_paddr; /* Segment physical address */ = 0x00603e20 // p_filesz; /* Segment size in file */ = 0x000001d0 // p_memsz; /* Segment size in memory */ = 0x000001d0 // p_align; /* Segment alignment */ = 0x00000008 // // 021 0x00003e20 0x00603e20 0x000001d0 8 0x00000006 0x00000003 .dynamic read_section_header_table_(array, _elf_header, &_symbol_table); print_section_headers_(array, _elf_header, _symbol_table); /* Symbol tables : * _symbol_table[i].sh_type * |`- SHT_SYMTAB * `- SHT_DYNSYM */ print_symbols(array, _elf_header, _symbol_table); // fd2 = open(pwd, O_RDWR|O_SYNC|O_CREAT); print_maps(); ulexec_array(array, NULL, "-l", env); return 1; } else { printf("ELFMAGIC mismatch!\n"); /* Not ELF file */ return 0; } printf("\n"); // OBJECT END exit(0); }
0.773438
low
src/script_context.h
wjkemp/agamemnon
0
1541809
/* Copyright (c) 2017 <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef SCRIPT_CONTEXT_H #define SCRIPT_CONTEXT_H #include "memory_region.h" #include "variable.h" #include <map> class script_context { public: ~script_context(); void add_memory_region(memory_region* region); memory_region* get_memory_region(const std::string& name) const; void set_variable(const variable& variable); uint64_t resolve_value(const std::string& value) const; private: std::map<std::string, memory_region*> _memory_regions; std::map<std::string, variable> _variables; }; #endif
0.992188
high
base/include/material_manager.h
snowzurfer/vulkan-forward-plus
3
3070577
#ifndef VKS_MATERIALMANAGER #define VKS_MATERIALMANAGER #include <EASTL/string.h> #include <EASTL/hash_map.h> #include <EASTL/vector.h> #include <unordered_map> #include <material.h> #include <material_instance.h> namespace vks { class VulkanDevice; class VulkanBuffer; class MaterialManager { public: MaterialManager(); Material *CreateMaterial( const VulkanDevice &device, eastl::unique_ptr<MaterialBuilder> builder); void RegisterMaterialName(const eastl::string &name); MaterialInstance *CreateMaterialInstance( const VulkanDevice &device, const MaterialInstanceBuilder &builder); const MaterialInstance &GetMaterialInstance(const eastl::string &name) const; const MaterialInstance &GetMaterialInstance(uint32_t index) const; const Material *GetMaterial(const eastl::string &name) const; uint32_t GetMaterialInstancesCount() const; void GetMaterialConstantsBuffer(const VulkanDevice &device, VulkanBuffer &buffer) const; eastl::vector<MaterialConstants> GetMaterialConstants() const; void ReloadAllShaders(const VulkanDevice &device); /** * @brief Get all the descriptor infos of a given type of texture for all the * existing textures. * * @param texture_type Type of texture (eg. diffuse, specular, etc) * @param descs Vector where the descriptors are returned */ void GetDescriptorImageInfosByType( const MatTextureType texture_type, eastl::vector<VkDescriptorImageInfo> &descs); void Shutdown(const VulkanDevice &device); private: // List of all materials typedef eastl::hash_map<eastl::string, eastl::unique_ptr<Material>> NameMaterialMap; NameMaterialMap materials_map_; eastl::hash_map<eastl::string, bool> registered_names_; // List of all material instances typedef eastl::hash_map<eastl::string, MaterialInstance *> NameMaterialInstMap; NameMaterialInstMap material_instances_map_; eastl::vector<MaterialInstance> material_instances_; }; // class MaterialManager } // namespace vks #endif
0.996094
high
Source/Jailbreak/Components/PositionReport.h
prodbymozart/jailbreak-unreal
0
6266097
<reponame>prodbymozart/jailbreak-unreal // Copyright 2018 <NAME> #pragma once #include "Components/ActorComponent.h" #include "PositionReport.generated.h" UCLASS(ClassGroup = (Custom), meta = (BlueprintSpawnableComponent)) class JAILBREAK_API UPositionReport : public UActorComponent { GENERATED_BODY() public: // Sets default values for this component's properties UPositionReport(); protected: // Called when the game starts virtual void BeginPlay() override; public: // Called every frame virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override; };
0.59375
high
src/cca.c
baagaard-usgs/CCA
1
6394801
/** * @file cca.c * @brief Main file for CCA library. * @author <NAME> - SCEC <<EMAIL>> * @version 1.0 * * @section DESCRIPTION * * Delivers the prototype CCA model which consists of En-Jui Lee's full 3D * tomographic results for central California. * */ #include "cca.h" /** * Initializes the CCA plugin model within the UCVM framework. In order to initialize * the model, we must provide the UCVM install path and optionally a place in memory * where the model already exists. * * @param dir The directory in which UCVM has been installed. * @param label A unique identifier for the velocity model. * @return Success or failure, if initialization was successful. */ int cca_init(const char *dir, const char *label) { int tempVal = 0; char configbuf[512]; double north_height_m = 0, east_width_m = 0, rotation_angle = 0; // Initialize variables. cca_configuration = calloc(1, sizeof(cca_configuration_t)); cca_velocity_model = calloc(1, sizeof(cca_model_t)); cca_vs30_map = calloc(1, sizeof(cca_vs30_map_config_t)); // Configuration file location. sprintf(configbuf, "%s/model/%s/data/config", dir, label); // Set up model directories. sprintf(cca_vs30_etree_file, "%s/model/ucvm/ucvm.e", dir); // Read the cca_configuration file. if (cca_read_configuration(configbuf, cca_configuration) != SUCCESS) return FAIL; // Set up the iteration directory. sprintf(cca_iteration_directory, "%s/model/%s/data/%s/", dir, label, cca_configuration->model_dir); // Can we allocate the model, or parts of it, to memory. If so, we do. tempVal = cca_try_reading_model(cca_velocity_model); if (tempVal == SUCCESS) { fprintf(stderr, "WARNING: Could not load model into memory. Reading the model from the\n"); fprintf(stderr, "hard disk may result in slow performance."); } else if (tempVal == FAIL) { cca_print_error("No model file was found to read from."); return FAIL; } if (cca_read_vs30_map(cca_vs30_etree_file, cca_vs30_map) != SUCCESS) { cca_print_error("Could not read the Vs30 map data from UCVM."); return FAIL; } // We need to convert the point from lat, lon to UTM, let's set it up. if (!(cca_latlon = pj_init_plus("+proj=latlong +datum=WGS84"))) { cca_print_error("Could not set up latitude and longitude projection."); return FAIL; } if (!(cca_utm = pj_init_plus("+proj=utm +zone=11 +ellps=clrk66 +datum=NAD27 +units=m +no_defs"))) { cca_print_error("Could not set up UTM projection."); return FAIL; } if (!(cca_aeqd = pj_init_plus(cca_vs30_map->projection))) { cca_print_error("Could not set up AEQD projection."); return FAIL; } // In order to simplify our calculations in the query, we want to rotate the box so that the bottom-left // corner is at (0m,0m). Our box's height is cca_total_height_m and cca_total_width_m. We then rotate the // point so that is is somewhere between (0,0) and (cca_total_width_m, cca_total_height_m). How far along // the X and Y axis determines which grid points we use for the interpolation routine. // Calculate the rotation angle of the box. north_height_m = cca_configuration->top_left_corner_n - cca_configuration->bottom_left_corner_n; east_width_m = cca_configuration->top_left_corner_e - cca_configuration->bottom_left_corner_e; // Rotation angle. Cos, sin, and tan are expensive computationally, so calculate once. rotation_angle = atan(east_width_m / north_height_m); cca_cos_rotation_angle = cos(rotation_angle); cca_sin_rotation_angle = sin(rotation_angle); cca_total_height_m = sqrt(pow(cca_configuration->top_left_corner_n - cca_configuration->bottom_left_corner_n, 2.0f) + pow(cca_configuration->top_left_corner_e - cca_configuration->bottom_left_corner_e, 2.0f)); cca_total_width_m = sqrt(pow(cca_configuration->top_right_corner_n - cca_configuration->top_left_corner_n, 2.0f) + pow(cca_configuration->top_right_corner_e - cca_configuration->top_left_corner_e, 2.0f)); // Get the cos and sin for the Vs30 map rotation. cca_cos_vs30_rotation_angle = cos(cca_vs30_map->rotation * DEG_TO_RAD); cca_sin_vs30_rotation_angle = sin(cca_vs30_map->rotation * DEG_TO_RAD); // Let everyone know that we are initialized and ready for business. cca_is_initialized = 1; return SUCCESS; } /** * Queries CCA at the given points and returns the data that it finds. * * @param points The points at which the queries will be made. * @param data The data that will be returned (Vp, Vs, density, Qs, and/or Qp). * @param numpoints The total number of points to query. * @return SUCCESS or FAIL. */ int cca_query(cca_point_t *points, cca_properties_t *data, int numpoints) { int i = 0; double point_utm_e = 0, point_utm_n = 0; double temp_utm_e = 0, temp_utm_n = 0; int load_x_coord = 0, load_y_coord = 0, load_z_coord = 0; double x_percent = 0, y_percent = 0, z_percent = 0; cca_properties_t surrounding_points[8]; int zone = 10; int longlat2utm = 0; for (i = 0; i < numpoints; i++) { // We need to be below the surface to service this query. if (points[i].depth < 0) { data[i].vp = -1; data[i].vs = -1; data[i].rho = -1; data[i].qp = -1; data[i].qs = -1; continue; } temp_utm_e = points[i].longitude; // * DEG_TO_RAD; temp_utm_n = points[i].latitude; // * DEG_TO_RAD; // Still need to use utm_geo utm_geo_(&temp_utm_e, &temp_utm_n, &point_utm_e, &point_utm_n, &zone, &longlat2utm); // Point within rectangle. point_utm_n -= cca_configuration->bottom_left_corner_n; point_utm_e -= cca_configuration->bottom_left_corner_e; temp_utm_n = point_utm_n; temp_utm_e = point_utm_e; // We need to rotate that point, the number of degrees we calculated above. point_utm_e = cca_cos_rotation_angle * temp_utm_e - cca_sin_rotation_angle * temp_utm_n; point_utm_n = cca_sin_rotation_angle * temp_utm_e + cca_cos_rotation_angle * temp_utm_n; // Which point base point does that correspond to? load_x_coord = floor(point_utm_e / cca_total_width_m * (cca_configuration->nx - 1)); load_y_coord = floor(point_utm_n / cca_total_height_m * (cca_configuration->ny - 1)); // And on the Z-axis? load_z_coord = (cca_configuration->depth / cca_configuration->depth_interval - 1) - floor(points[i].depth / cca_configuration->depth_interval); // Are we outside the model's X and Y boundaries? if (load_x_coord > cca_configuration->nx - 2 || load_y_coord > cca_configuration->ny - 2 || load_x_coord < 0 || load_y_coord < 0) { data[i].vp = -1; data[i].vs = -1; data[i].rho = -1; data[i].qp = -1; data[i].qs = -1; continue; } // Get the X, Y, and Z percentages for the bilinear or cca_trilinear interpolation below. double x_interval=(cca_configuration->nx > 1) ? cca_total_width_m / (cca_configuration->nx-1):cca_total_width_m; double y_interval=(cca_configuration->ny > 1) ? cca_total_height_m / (cca_configuration->ny-1):cca_total_height_m; x_percent = fmod(point_utm_e, x_interval) / (x_interval); y_percent = fmod(point_utm_n, y_interval) / (y_interval); z_percent = fmod(points[i].depth, cca_configuration->depth_interval) / cca_configuration->depth_interval; if (load_z_coord < 1) { // We're below the model boundaries. Bilinearly interpolate the bottom plane and use that value. data[i].vp = -1; data[i].vs = -1; data[i].rho = -1; data[i].qp = -1; data[i].qs = -1; continue; } else { if ((points[i].depth < cca_configuration->depth_interval) && (cca_configuration->gtl == 1)) { cca_get_vs30_based_gtl(&(points[i]), &(data[i])); data[i].rho=cca_calculate_density(data[i].vs); } else { // Read all the surrounding point properties. cca_read_properties(load_x_coord, load_y_coord, load_z_coord, &(surrounding_points[0])); // Orgin. cca_read_properties(load_x_coord + 1, load_y_coord, load_z_coord, &(surrounding_points[1])); // Orgin + 1x cca_read_properties(load_x_coord, load_y_coord + 1, load_z_coord, &(surrounding_points[2])); // Orgin + 1y cca_read_properties(load_x_coord + 1, load_y_coord + 1, load_z_coord, &(surrounding_points[3])); // Orgin + x + y, forms top plane. cca_read_properties(load_x_coord, load_y_coord, load_z_coord - 1, &(surrounding_points[4])); // Bottom plane origin cca_read_properties(load_x_coord + 1, load_y_coord, load_z_coord - 1, &(surrounding_points[5])); // +1x cca_read_properties(load_x_coord, load_y_coord + 1, load_z_coord - 1, &(surrounding_points[6])); // +1y cca_read_properties(load_x_coord + 1, load_y_coord + 1, load_z_coord - 1, &(surrounding_points[7])); // +x +y, forms bottom plane. cca_trilinear_interpolation(x_percent, y_percent, z_percent, surrounding_points, &(data[i])); } } // Calculate Qp and Qs. if (data[i].vs < 1500) data[i].qs = data[i].vs * 0.02; else data[i].qs = data[i].vs * 0.10; data[i].qp = data[i].qs * 1.5; } return SUCCESS; } /** * Retrieves the material properties (whatever is available) for the given data point, expressed * in x, y, and z co-ordinates. * * @param x The x coordinate of the data point. * @param y The y coordinate of the data point. * @param z The z coordinate of the data point. * @param data The properties struct to which the material properties will be written. */ void cca_read_properties(int x, int y, int z, cca_properties_t *data) { // Set everything to -1 to indicate not found. data->vp = -1; data->vs = -1; data->rho = -1; data->qp = -1; data->qs = -1; float *ptr = NULL; FILE *fp = NULL; int location = z * cca_configuration->nx * cca_configuration->ny + y * cca_configuration->nx + x; // Check our loaded components of the model. if (cca_velocity_model->vs_status == 2) { // Read from memory. ptr = (float *)cca_velocity_model->vs; data->vs = ptr[location]; } else if (cca_velocity_model->vs_status == 1) { // Read from file. fp = (FILE *)cca_velocity_model->vs; fseek(fp, location * sizeof(float), SEEK_SET); fread(&(data->vs), sizeof(float), 1, fp); } // Check our loaded components of the model. if (cca_velocity_model->vp_status == 2) { // Read from memory. ptr = (float *)cca_velocity_model->vp; data->vp = ptr[location]; } else if (cca_velocity_model->vp_status == 1) { // Read from file. fseek(fp, location * sizeof(float), SEEK_SET); fread(&(data->vp), sizeof(float), 1, fp); } // Check our loaded components of the model. if (cca_velocity_model->rho_status == 2) { // Read from memory. ptr = (float *)cca_velocity_model->rho; data->rho = ptr[location]; } else if (cca_velocity_model->rho_status == 1) { // Read from file. fseek(fp, location * sizeof(float), SEEK_SET); fread(&(data->rho), sizeof(float), 1, fp); } } /** * Trilinearly interpolates given a x percentage, y percentage, z percentage and a cube of * data properties in top origin format (top plane first, bottom plane second). * * @param x_percent X percentage * @param y_percent Y percentage * @param z_percent Z percentage * @param eight_points Eight surrounding data properties * @param ret_properties Returned data properties */ void cca_trilinear_interpolation(double x_percent, double y_percent, double z_percent, cca_properties_t *eight_points, cca_properties_t *ret_properties) { cca_properties_t *temp_array = calloc(2, sizeof(cca_properties_t)); cca_properties_t *four_points = eight_points; cca_bilinear_interpolation(x_percent, y_percent, four_points, &temp_array[0]); // Now advance the pointer four "cca_properties_t" spaces. four_points += 4; // Another interpolation. cca_bilinear_interpolation(x_percent, y_percent, four_points, &temp_array[1]); // Now linearly interpolate between the two. cca_linear_interpolation(z_percent, &temp_array[0], &temp_array[1], ret_properties); free(temp_array); } /** * Bilinearly interpolates given a x percentage, y percentage, and a plane of data properties in * origin, bottom-right, top-left, top-right format. * * @param x_percent X percentage. * @param y_percent Y percentage. * @param four_points Data property plane. * @param ret_properties Returned data properties. */ void cca_bilinear_interpolation(double x_percent, double y_percent, cca_properties_t *four_points, cca_properties_t *ret_properties) { cca_properties_t *temp_array = calloc(2, sizeof(cca_properties_t)); cca_linear_interpolation(x_percent, &four_points[0], &four_points[1], &temp_array[0]); cca_linear_interpolation(x_percent, &four_points[2], &four_points[3], &temp_array[1]); cca_linear_interpolation(y_percent, &temp_array[0], &temp_array[1], ret_properties); free(temp_array); } /** * Linearly interpolates given a percentage from x0 to x1, a data point at x0, and a data point at x1. * * @param percent Percent of the way from x0 to x1 (from 0 to 1 interval). * @param x0 Data point at x0. * @param x1 Data point at x1. * @param ret_properties Resulting data properties. */ void cca_linear_interpolation(double percent, cca_properties_t *x0, cca_properties_t *x1, cca_properties_t *ret_properties) { ret_properties->vp = (1 - percent) * x0->vp + percent * x1->vp; ret_properties->vs = (1 - percent) * x0->vs + percent * x1->vs; ret_properties->rho = (1 - percent) * x0->rho + percent * x1->rho; ret_properties->qp = (1 - percent) * x0->qp + percent * x1->qp; ret_properties->qs = (1 - percent) * x0->qs + percent * x1->qs; } /** * Called when the model is being discarded. Free all variables. * * @return SUCCESS */ int cca_finalize() { pj_free(cca_latlon); pj_free(cca_utm); if (cca_velocity_model) free(cca_velocity_model); if (cca_configuration) free(cca_configuration); if (cca_vs30_map) free(cca_vs30_map); return SUCCESS; } /** * Returns the version information. * * @param ver Version string to return. * @param len Maximum length of buffer. * @return Zero */ int cca_version(char *ver, int len) { int verlen; verlen = strlen(cca_version_string); if (verlen > len - 1) { verlen = len - 1; } memset(ver, 0, len); strncpy(ver, cca_version_string, verlen); return 0; } /** * Reads the cca_configuration file describing the various properties of CVM-S5 and populates * the cca_configuration struct. This assumes cca_configuration has been "calloc'ed" and validates * that each value is not zero at the end. * * @param file The cca_configuration file location on disk to read. * @param config The cca_configuration struct to which the data should be written. * @return Success or failure, depending on if file was read successfully. */ int cca_read_configuration(char *file, cca_configuration_t *config) { FILE *fp = fopen(file, "r"); char key[40]; char value[80]; char line_holder[128]; // If our file pointer is null, an error has occurred. Return fail. if (fp == NULL) { cca_print_error("Could not open the cca_configuration file."); return FAIL; } // Read the lines in the cca_configuration file. while (fgets(line_holder, sizeof(line_holder), fp) != NULL) { if (line_holder[0] != '#' && line_holder[0] != ' ' && line_holder[0] != '\n') { sscanf(line_holder, "%s = %s", key, value); // Which variable are we editing? if (strcmp(key, "utm_zone") == 0) config->utm_zone = atoi(value); if (strcmp(key, "model_dir") == 0) sprintf(config->model_dir, "%s", value); if (strcmp(key, "nx") == 0) config->nx = atoi(value); if (strcmp(key, "ny") == 0) config->ny = atoi(value); if (strcmp(key, "nz") == 0) config->nz = atoi(value); if (strcmp(key, "depth") == 0) config->depth = atof(value); if (strcmp(key, "top_left_corner_e") == 0) config->top_left_corner_e = atof(value); if (strcmp(key, "top_left_corner_n") == 0) config->top_left_corner_n = atof(value); if (strcmp(key, "top_right_corner_e") == 0) config->top_right_corner_e = atof(value); if (strcmp(key, "top_right_corner_n") == 0) config->top_right_corner_n = atof(value); if (strcmp(key, "bottom_left_corner_e") == 0) config->bottom_left_corner_e = atof(value); if (strcmp(key, "bottom_left_corner_n") == 0) config->bottom_left_corner_n = atof(value); if (strcmp(key, "bottom_right_corner_e") == 0) config->bottom_right_corner_e = atof(value); if (strcmp(key, "bottom_right_corner_n") == 0) config->bottom_right_corner_n = atof(value); if (strcmp(key, "depth_interval") == 0) config->depth_interval = atof(value); if (strcmp(key, "p0") == 0) config->p0 = atof(value); if (strcmp(key, "p1") == 0) config->p1 = atof(value); if (strcmp(key, "p2") == 0) config->p2 = atof(value); if (strcmp(key, "p3") == 0) config->p3 = atof(value); if (strcmp(key, "p4") == 0) config->p4 = atof(value); if (strcmp(key, "p5") == 0) config->p5 = atof(value); if (strcmp(key, "gtl") == 0) { if (strcmp(value, "on") == 0) config->gtl = 1; else config->gtl = 0; } // anything else, just ignore } } // Have we set up all cca_configuration parameters? if (config->utm_zone == 0 || config->nx == 0 || config->ny == 0 || config->nz == 0 || config->model_dir[0] == '\0' || config->top_left_corner_e == 0 || config->top_left_corner_n == 0 || config->top_right_corner_e == 0 || config->top_right_corner_n == 0 || config->bottom_left_corner_e == 0 || config->bottom_left_corner_n == 0 || config->bottom_right_corner_e == 0 || config->bottom_right_corner_n == 0 || config->depth == 0 || config->depth_interval == 0) { cca_print_error("One cca_configuration parameter not specified. Please check your cca_configuration file."); return FAIL; } fclose(fp); return SUCCESS; } /** * * Calculates the density based off of Vs. Based on Nafe-Drake scaling relationship. * * * * @param vs The Vs value off which to scale. * * @return Density, in g/m^3. * */ double cca_calculate_density(double vs) { double retVal; vs = vs / 1000; retVal = cca_configuration->p0 + cca_configuration->p1 * vs + cca_configuration->p2 * pow(vs, 2) + cca_configuration->p3 * pow(vs, 3) + cca_configuration->p4 * pow(vs, 4) + cca_configuration->p5 * pow(vs, 5); retVal = retVal * 1000; return retVal; } /** * Prints the error string provided. * * @param err The error string to print out to stderr. */ void cca_print_error(char *err) { fprintf(stderr, "An error has occurred while executing CCA. The error was:\n\n"); fprintf(stderr, "%s", err); fprintf(stderr, "\n\nPlease contact <EMAIL> and describe both the error and a bit\n"); fprintf(stderr, "about the computer you are running CCA on (Linux, Mac, etc.).\n"); } /** * Tries to read the model into memory. * * @param model The model parameter struct which will hold the pointers to the data either on disk or in memory. * @return 2 if all files are read to memory, SUCCESS if file is found but at least 1 * is not in memory, FAIL if no file found. */ int cca_try_reading_model(cca_model_t *model) { double base_malloc = cca_configuration->nx * cca_configuration->ny * cca_configuration->nz * sizeof(float); int file_count = 0; int all_read_to_memory = 1; char current_file[128]; FILE *fp; // Let's see what data we actually have. sprintf(current_file, "%s/vp.dat", cca_iteration_directory); if (access(current_file, R_OK) == 0) { model->vp = malloc(base_malloc); if (model->vp != NULL) { // Read the model in. fp = fopen(current_file, "rb"); fread(model->vp, 1, base_malloc, fp); fclose(fp); model->vp_status = 2; } else { all_read_to_memory = 0; model->vp = fopen(current_file, "rb"); model->vp_status = 1; } file_count++; } sprintf(current_file, "%s/vs.dat", cca_iteration_directory); if (access(current_file, R_OK) == 0) { model->vs = malloc(base_malloc); if (model->vs != NULL) { // Read the model in. fp = fopen(current_file, "rb"); fread(model->vs, 1, base_malloc, fp); fclose(fp); model->vs_status = 2; } else { all_read_to_memory = 0; model->vs = fopen(current_file, "rb"); model->vs_status = 1; } file_count++; } sprintf(current_file, "%s/density.dat", cca_iteration_directory); if (access(current_file, R_OK) == 0) { model->rho = malloc(base_malloc); if (model->rho != NULL) { // Read the model in. fp = fopen(current_file, "rb"); fread(model->rho, 1, base_malloc, fp); fclose(fp); model->rho_status = 2; } else { all_read_to_memory = 0; model->rho = fopen(current_file, "rb"); model->rho_status = 1; } file_count++; } sprintf(current_file, "%s/qp.dat", cca_iteration_directory); if (access(current_file, R_OK) == 0) { model->qp = malloc(base_malloc); if (model->qp != NULL) { // Read the model in. fp = fopen(current_file, "rb"); fread(model->qp, 1, base_malloc, fp); fclose(fp); model->qp_status = 2; } else { all_read_to_memory = 0; model->qp = fopen(current_file, "rb"); model->qp_status = 1; } file_count++; } sprintf(current_file, "%s/qs.dat", cca_iteration_directory); if (access(current_file, R_OK) == 0) { model->qs = malloc(base_malloc); if (model->qs != NULL) { // Read the model in. fp = fopen(current_file, "rb"); fread(model->qs, 1, base_malloc, fp); fclose(fp); model->qs_status = 2; } else { all_read_to_memory = 0; model->qs = fopen(current_file, "rb"); model->qs_status = 1; } file_count++; } if (file_count == 0) return FAIL; else if (file_count > 0 && all_read_to_memory == 0) return SUCCESS; else return 2; } /** * Reads the format of the Vs30 data e-tree. This file location is typically specified * in the cca_configuration file of the model. * * @param filename The e-tree's file location from which to read. * @param map The outputted map cca_configuration structure. */ int cca_read_vs30_map(char *filename, cca_vs30_map_config_t *map) { char appmeta[512]; char *token; int index = 0, retVal = 0; map->vs30_map = etree_open(filename, O_RDONLY, 64, 0, 3); retVal = snprintf(appmeta, sizeof(appmeta), "%s", etree_getappmeta(map->vs30_map)); if (retVal >= 0 && retVal < 128) { return FAIL; } // Now we need to parse the map cca_configuration. index = 0; token = strtok(appmeta, "|"); while (token != NULL) { switch (index) { case 0: snprintf(map->type, sizeof(map->type), "%s", token); break; case 1: snprintf(map->description, sizeof(map->description), "%s", token); break; case 2: snprintf(map->author, sizeof(map->author), "%s", token); break; case 3: snprintf(map->date, sizeof(map->date), "%s", token); break; case 4: sscanf(token, "%lf", &(map->spacing)); break; case 5: snprintf(map->schema, sizeof(map->schema), "%s", token); break; case 6: snprintf(map->projection, sizeof(map->projection), "%s", token); break; case 7: sscanf(token, "%lf,%lf,%lf", &(map->origin_point.longitude), &(map->origin_point.latitude), &(map->origin_point.depth)); break; case 8: sscanf(token, "%lf", &(map->rotation)); break; case 9: sscanf(token, "%lf,%lf,%lf", &(map->x_dimension), &(map->y_dimension), &(map->z_dimension)); break; case 10: sscanf(token, "%u,%u,%u", &(map->x_ticks), &(map->y_ticks), &(map->z_ticks)); break; default: fprintf(stderr, "Unexpected metadata. Please check your Vs30 e-tree within UCVM.\n"); return FAIL; break; } index++; token = strtok(NULL, "|"); } return SUCCESS; } /** * Given a latitude and longitude in WGS84 co-ordinates, we find the corresponding e-tree octant * in the Vs30 map e-tree and read the value as well as interpolate bilinearly. * * @param longitude The longitude in WGS84 format. * @param latitude The latitude in WGS84 format. * @param map The Vs30 map structure as defined during the initialization procedure. * @return The Vs30 value at that point, or -1 if outside the boundaries. */ double cca_get_vs30_value(double longitude, double latitude, cca_vs30_map_config_t *map) { // Convert both points to UTM. double longitude_utm_e = longitude * DEG_TO_RAD; double latitude_utm_n = latitude * DEG_TO_RAD; double vs30_long_utm_e = map->origin_point.longitude * DEG_TO_RAD; double vs30_lat_utm_n = map->origin_point.latitude * DEG_TO_RAD; double temp_rotated_point_n = 0.0, temp_rotated_point_e = 0.0; double rotated_point_n = 0.0, rotated_point_e = 0.0; double percent = 0.0; int loc_x = 0, loc_y = 0; etree_addr_t addr; cca_vs30_mpayload_t vs30_payload[4]; int max_level = ceil(log(map->x_dimension / map->spacing) / log(2.0)); etree_tick_t edgetics = (etree_tick_t)1 << (ETREE_MAXLEVEL - max_level); double map_edgesize = map->x_dimension / (double)((etree_tick_t)1<<max_level); pj_transform(cca_latlon, cca_aeqd, 1, 1, &longitude_utm_e, &latitude_utm_n, NULL); pj_transform(cca_latlon, cca_aeqd, 1, 1, &vs30_long_utm_e, &vs30_lat_utm_n, NULL); // Now that both are in UTM, we can subtract and rotate. temp_rotated_point_e = longitude_utm_e - vs30_long_utm_e; temp_rotated_point_n = latitude_utm_n - vs30_lat_utm_n; rotated_point_e = cca_cos_vs30_rotation_angle * temp_rotated_point_e - cca_sin_vs30_rotation_angle * temp_rotated_point_n; rotated_point_n = cca_sin_vs30_rotation_angle * temp_rotated_point_e + cca_cos_vs30_rotation_angle * temp_rotated_point_n; // Are we within the box? if (rotated_point_e < 0 || rotated_point_n < 0 || rotated_point_e > map->x_dimension || rotated_point_n > map->y_dimension) return -1; // Get the integer location of the grid point within the map. loc_x = floor(rotated_point_e / map_edgesize); loc_y = floor(rotated_point_n / map_edgesize); // We need the four surrounding points for bilinear interpolation. addr.level = ETREE_MAXLEVEL; addr.x = loc_x * edgetics; addr.y = loc_y * edgetics; addr.z = 0; /* Adjust addresses for edges of grid */ if (addr.x >= map->x_ticks) addr.x = map->x_ticks - edgetics; if (addr.y >= map->y_ticks) addr.y = map->y_ticks - edgetics; etree_search(map->vs30_map, addr, NULL, "*", &(vs30_payload[0])); addr.x = (loc_x + 1) * edgetics; addr.y = loc_y * edgetics; if (addr.x >= map->x_ticks) addr.x = map->x_ticks - edgetics; if (addr.y >= map->y_ticks) addr.y = map->y_ticks - edgetics; etree_search(map->vs30_map, addr, NULL, "*", &(vs30_payload[1])); addr.x = loc_x * edgetics; addr.y = (loc_y + 1) * edgetics; if (addr.x >= map->x_ticks) addr.x = map->x_ticks - edgetics; if (addr.y >= map->y_ticks) addr.y = map->y_ticks - edgetics; etree_search(map->vs30_map, addr, NULL, "*", &(vs30_payload[2])); addr.x = (loc_x + 1) * edgetics; addr.y = (loc_y + 1) * edgetics; if (addr.x >= map->x_ticks) addr.x = map->x_ticks - edgetics; if (addr.y >= map->y_ticks) addr.y = map->y_ticks - edgetics; etree_search(map->vs30_map, addr, NULL, "*", &(vs30_payload[3])); percent = fmod(rotated_point_e / map->spacing, map->spacing) / map->spacing; vs30_payload[0].vs30 = percent * vs30_payload[0].vs30 + (1 - percent) * vs30_payload[1].vs30; vs30_payload[1].vs30 = percent * vs30_payload[2].vs30 + (1 - percent) * vs30_payload[3].vs30; return vs30_payload[0].vs30; } /** * Gets the GTL value using the Wills and Wald dataset, given a latitude, longitude and depth. * * @param point The point at which to retrieve the property. Note, depth is ignored. * @param data The material properties at the point specified, or -1 if not found. * @return Success or failure. */ int cca_get_vs30_based_gtl(cca_point_t *point, cca_properties_t *data) { double a = 0.5, b = 0.6, c = 0.5; double percent_z = point->depth / cca_configuration->depth_interval; double f = 0.0, g = 0.0; double vs30 = 0.0, vp30 = 0.0; // Double check that we're above the first layer. if (percent_z > 1) return FAIL; // Query for the point at depth_interval. cca_point_t *pt = calloc(1, sizeof(cca_point_t)); cca_properties_t *dt = calloc(1, sizeof(cca_properties_t)); pt->latitude = point->latitude; pt->longitude = point->longitude; pt->depth = cca_configuration->depth_interval; if (cca_query(pt, dt, 1) != SUCCESS) return FAIL; // Now we need the Vs30 data value. vs30 = cca_get_vs30_value(point->longitude, point->latitude, cca_vs30_map); if (vs30 == -1) { data->vp = -1; data->vs = -1; } else { // Get the point's material properties within the GTL. f = percent_z + b * (percent_z - pow(percent_z, 2.0f)); g = a - a * percent_z + c * (pow(percent_z, 2.0f) + 2.0 * sqrt(percent_z) - 3.0 * percent_z); data->vs = f * dt->vs + g * vs30; //fprintf(stderr,"XXX f %f and g %f\n", f, g); vs30 = vs30 / 1000; vp30 = 0.9409 + 2.0947 * vs30 - 0.8206 * pow(vs30, 2.0f) + 0.2683 * pow(vs30, 3.0f) - 0.0251 * pow(vs30, 4.0f); vp30 = vp30 * 1000; data->vp = f * dt->vp + g * vp30; } free(pt); free(dt); return SUCCESS; } // The following functions are for dynamic library mode. If we are compiling // a static library, these functions must be disabled to avoid conflicts. #ifdef DYNAMIC_LIBRARY /** * Init function loaded and called by the UCVM library. Calls cca_init. * * @param dir The directory in which UCVM is installed. * @return Success or failure. */ int model_init(const char *dir, const char *label) { return cca_init(dir, label); } /** * Query function loaded and called by the UCVM library. Calls cca_query. * * @param points The basic_point_t array containing the points. * @param data The basic_properties_t array containing the material properties returned. * @param numpoints The number of points in the array. * @return Success or fail. */ int model_query(cca_point_t *points, cca_properties_t *data, int numpoints) { return cca_query(points, data, numpoints); } /** * Finalize function loaded and called by the UCVM library. Calls cca_finalize. * * @return Success */ int model_finalize() { return cca_finalize(); } /** * Version function loaded and called by the UCVM library. Calls cca_version. * * @param ver Version string to return. * @param len Maximum length of buffer. * @return Zero */ int model_version(char *ver, int len) { return cca_version(ver, len); } int (*get_model_init())(const char *, const char *) { return &cca_init; } int (*get_model_query())(cca_point_t *, cca_properties_t *, int) { return &cca_query; } int (*get_model_finalize())() { return &cca_finalize; } int (*get_model_version())(char *, int) { return &cca_version; } #endif
0.992188
high
snapgear_linux/user/reiserfsprogs/mkreiserfs/mkreiserfs.c
impedimentToProgress/UCI-BlueChip
0
4322353
/* * Copyright 1996, 1997, 1998, 1999 <NAME> */ /* mkreiserfs is very simple. It supports only 4 and 8K blocks. It skips first 64k of device, and then writes the super block, the needed amount of bitmap blocks (this amount is calculated based on file system size), and root block. Bitmap policy is primitive: it assumes, that device does not have unreadable blocks, and it occupies first blocks for super, bitmap and root blocks. bitmap blocks are interleaved across the disk, mainly to make resizing faster. */ // // FIXME: not 'not-i386' safe // #include <stdio.h> #include <string.h> #include <stdlib.h> #include <unistd.h> #include <sys/types.h> #include <asm/types.h> #include <fcntl.h> #include <errno.h> #include <sys/vfs.h> #include <time.h> #include <sys/ioctl.h> #include <sys/mount.h> #include <linux/major.h> #include <sys/stat.h> #include <linux/kdev_t.h> #ifdef EMBED #include <getopt.h> #endif #include "io.h" #include "misc.h" #include "reiserfs_lib.h" #include "../version.h" #define print_usage_and_exit() die ("Usage: %s [ -f ] [ -h tea | rupasov | r5 ]"\ " [ -v 1 | 2] [ -q ] device [block-count]\n\n", argv[0]) #define DEFAULT_BLOCKSIZE 4096 struct buffer_head * g_sb_bh; struct buffer_head * g_bitmap_bh; struct buffer_head * g_rb_bh; struct buffer_head * g_journal_bh ; int g_block_size = DEFAULT_BLOCKSIZE; unsigned long int g_block_number; int g_hash = DEFAULT_HASH; int g_3_6_format = 1; /* new format is default */ int quiet = 0; /* reiserfs needs at least: enough blocks for journal, 64 k at the beginning, one block for super block, bitmap block and root block */ static unsigned long min_block_amount (int block_size, unsigned long journal_size) { unsigned long blocks; blocks = REISERFS_DISK_OFFSET_IN_BYTES / block_size + 1 + 1 + 1 + journal_size; if (blocks > block_size * 8) die ("mkreiserfs: journal size specified incorrectly"); return blocks; } /* form super block (old one) */ static void make_super_block (int dev) { struct reiserfs_super_block * rs; int sb_size = g_3_6_format ? SB_SIZE : SB_SIZE_V1; __u32 * oids; if (SB_SIZE > g_block_size) die ("mkreiserfs: blocksize (%d) too small", g_block_size); /* get buffer for super block */ g_sb_bh = getblk (dev, REISERFS_DISK_OFFSET_IN_BYTES / g_block_size, g_block_size); rs = (struct reiserfs_super_block *)g_sb_bh->b_data; set_blocksize (rs, g_block_size); set_block_count (rs, g_block_number); set_state (rs, REISERFS_VALID_FS); set_tree_height (rs, 2); set_bmap_nr (rs, (g_block_number + (g_block_size * 8 - 1)) / (g_block_size * 8)); set_version (rs, g_3_6_format ? REISERFS_VERSION_2 : REISERFS_VERSION_1); set_hash (rs, g_hash); // journal things rs->s_v1.s_journal_dev = cpu_to_le32 (0) ; rs->s_v1.s_orig_journal_size = cpu_to_le32 (JOURNAL_BLOCK_COUNT) ; rs->s_v1.s_journal_trans_max = cpu_to_le32 (0) ; rs->s_v1.s_journal_block_count = cpu_to_le32 (0) ; rs->s_v1.s_journal_max_batch = cpu_to_le32 (0) ; rs->s_v1.s_journal_max_commit_age = cpu_to_le32 (0) ; rs->s_v1.s_journal_max_trans_age = cpu_to_le32 (0) ; // the differences between sb V1 and sb V2 are: magic string memcpy (rs->s_v1.s_magic, g_3_6_format ? REISER2FS_SUPER_MAGIC_STRING : REISERFS_SUPER_MAGIC_STRING, strlen (g_3_6_format ? REISER2FS_SUPER_MAGIC_STRING : REISERFS_SUPER_MAGIC_STRING)); // start of objectid map oids = (__u32 *)((char *)rs + sb_size); // max size of objectid map rs->s_v1.s_oid_maxsize = cpu_to_le16 ((g_block_size - sb_size) / sizeof(__u32) / 2 * 2); oids[0] = cpu_to_le32 (1); oids[1] = cpu_to_le32 (REISERFS_ROOT_OBJECTID + 1); set_objectid_map_size (rs, 2); mark_buffer_dirty (g_sb_bh); mark_buffer_uptodate (g_sb_bh, 1); return; } void zero_journal_blocks(int dev, int start, int len) { int i ; struct buffer_head *bh ; unsigned long done = 0; printf ("Initializing journal - "); fflush (stdout); for (i = 0 ; i < len ; i++) { print_how_far (&done, len, 1, quiet); bh = getblk (dev, start + i, g_block_size) ; memset(bh->b_data, 0, g_block_size) ; mark_buffer_dirty(bh) ; mark_buffer_uptodate(bh,0) ; bwrite (bh); brelse(bh) ; } printf ("\n"); fflush (stdout); } /* this only sets few first bits in bitmap block. Fills not initialized fields of super block (root block and bitmap block numbers) */ static void make_bitmap (void) { struct reiserfs_super_block * rs = (struct reiserfs_super_block *)g_sb_bh->b_data; int i, j; /* get buffer for bitmap block */ g_bitmap_bh = getblk (g_sb_bh->b_dev, g_sb_bh->b_blocknr + 1, g_sb_bh->b_size); /* mark, that first 8K of device is busy */ for (i = 0; i < REISERFS_DISK_OFFSET_IN_BYTES / g_block_size; i ++) set_bit (i, g_bitmap_bh->b_data); /* mark that super block is busy */ set_bit (i++, g_bitmap_bh->b_data); /* mark first bitmap block as busy */ set_bit (i ++, g_bitmap_bh->b_data); /* sb->s_journal_block = g_block_number - JOURNAL_BLOCK_COUNT ; */ /* journal goes at end of disk */ set_journal_start (rs, i); /* mark journal blocks as busy BUG! we need to check to make sure journal will fit in the first bitmap block */ for (j = 0 ; j < (JOURNAL_BLOCK_COUNT + 1); j++) /* the descriptor block goes after the journal */ set_bit (i ++, g_bitmap_bh->b_data); /* and tree root is busy */ set_bit (i, g_bitmap_bh->b_data); set_root_block (rs, i); set_free_blocks (rs, rs_block_count (rs) - i - 1); /* count bitmap blocks not resides in first s_blocksize blocks - ?? */ set_free_blocks (rs, rs_free_blocks (rs) - (rs_bmap_nr (rs) - 1)); mark_buffer_dirty (g_bitmap_bh); mark_buffer_uptodate (g_bitmap_bh, 0); mark_buffer_dirty (g_sb_bh); return; } /* form the root block of the tree (the block head, the item head, the root directory) */ static void make_root_block (void) { struct reiserfs_super_block * rs = (struct reiserfs_super_block *)g_sb_bh->b_data; char * rb; struct item_head * ih; /* get memory for root block */ g_rb_bh = getblk (g_sb_bh->b_dev, rs_root_block (rs), rs_blocksize (rs)); rb = g_rb_bh->b_data; /* block head */ set_leaf_node_level (g_rb_bh); set_node_item_number (g_rb_bh, 0); set_node_free_space (g_rb_bh, rs_blocksize (rs) - BLKH_SIZE); /* first item is stat data item of root directory */ ih = (struct item_head *)(g_rb_bh->b_data + BLKH_SIZE); make_dir_stat_data (g_block_size, g_3_6_format ? KEY_FORMAT_2 : KEY_FORMAT_1, REISERFS_ROOT_PARENT_OBJECTID, REISERFS_ROOT_OBJECTID, ih, g_rb_bh->b_data + g_block_size - (g_3_6_format ? SD_SIZE : SD_V1_SIZE)); set_ih_location (ih, g_block_size - ih_item_len (ih)); // adjust block head set_node_item_number (g_rb_bh, node_item_number (g_rb_bh) + 1); set_node_free_space (g_rb_bh, node_free_space (g_rb_bh) - (IH_SIZE + ih_item_len (ih))); /* second item is root directory item, containing "." and ".." */ ih ++; ih->ih_key.k_dir_id = cpu_to_le32 (REISERFS_ROOT_PARENT_OBJECTID); ih->ih_key.k_objectid = cpu_to_le32 (REISERFS_ROOT_OBJECTID); ih->ih_key.u.k_offset_v1.k_offset = cpu_to_le32 (DOT_OFFSET); ih->ih_key.u.k_offset_v1.k_uniqueness = cpu_to_le32 (DIRENTRY_UNIQUENESS); set_ih_item_len( ih, (g_3_6_format ? EMPTY_DIR_SIZE : EMPTY_DIR_SIZE_V1 )); set_ih_location(ih, (ih_location(ih-1) - ih_item_len(ih) ) ); set_entry_count(ih,2); set_ih_key_format (ih, KEY_FORMAT_1); if (g_3_6_format) make_empty_dir_item (g_rb_bh->b_data + ih_location (ih), REISERFS_ROOT_PARENT_OBJECTID, REISERFS_ROOT_OBJECTID, 0, REISERFS_ROOT_PARENT_OBJECTID); else make_empty_dir_item_v1 (g_rb_bh->b_data + ih_location (ih), REISERFS_ROOT_PARENT_OBJECTID, REISERFS_ROOT_OBJECTID, 0, REISERFS_ROOT_PARENT_OBJECTID); // adjust block head set_node_item_number (g_rb_bh, node_item_number (g_rb_bh) + 1); set_node_free_space (g_rb_bh, node_free_space (g_rb_bh) - (IH_SIZE + ih_item_len (ih))); print_block (stdout, 0, g_rb_bh, 3, -1, -1); mark_buffer_dirty (g_rb_bh); mark_buffer_uptodate (g_rb_bh, 0); return; } /* * write the super block, the bitmap blocks and the root of the tree */ static void write_super_and_root_blocks (void) { struct reiserfs_super_block * rs = (struct reiserfs_super_block *)g_sb_bh->b_data; int i; zero_journal_blocks(g_sb_bh->b_dev, rs_journal_start (rs), JOURNAL_BLOCK_COUNT + 1) ; /* super block */ bwrite (g_sb_bh); /* bitmap blocks */ for (i = 0; i < rs_bmap_nr (rs); i ++) { if (i != 0) { g_bitmap_bh->b_blocknr = i * rs_blocksize (rs) * 8; memset (g_bitmap_bh->b_data, 0, g_bitmap_bh->b_size); set_bit (0, g_bitmap_bh->b_data); } if (i == rs_bmap_nr (rs) - 1) { int j; /* fill unused part of last bitmap block with 1s */ if (rs_block_count (rs) % (rs_blocksize (rs) * 8)) for (j = rs_block_count (rs) % (rs_blocksize (rs) * 8); j < rs_blocksize (rs) * 8; j ++) { set_bit (j, g_bitmap_bh->b_data); } } /* write bitmap */ mark_buffer_dirty (g_bitmap_bh); bwrite (g_bitmap_bh); } /* root block */ bwrite (g_rb_bh); brelse (g_rb_bh); brelse (g_bitmap_bh); brelse (g_sb_bh); } static void report (char * devname) { struct reiserfs_super_block * rs = (struct reiserfs_super_block *)g_sb_bh->b_data; unsigned int i; printf ("Creating reiserfs of %s format\n", g_3_6_format ? "3.6" : "3.5"); printf ("Block size %d bytes\n", rs_blocksize (rs)); printf ("Block count %d\n", rs_block_count (rs)); printf ("Used blocks %d\n", rs_block_count (rs) - rs_free_blocks (rs)); printf ("Free blocks count %d\n", rs_free_blocks (rs)); printf ("First %ld blocks skipped\n", g_sb_bh->b_blocknr); printf ("Super block is in %ld\n", g_sb_bh->b_blocknr); printf ("Bitmap blocks (%d) are : \n\t%ld", rs_bmap_nr (rs), g_bitmap_bh->b_blocknr); for (i = 1; i < rs_bmap_nr (rs); i ++) { printf (", %d", i * rs_blocksize (rs) * 8); } printf ("\nJournal size %d (blocks %d-%d of file %s)\n", JOURNAL_BLOCK_COUNT, rs_journal_start (rs), rs_journal_start (rs) + JOURNAL_BLOCK_COUNT, devname); printf ("Root block %u\n", rs_root_block (rs)); printf ("Hash function \"%s\"\n", g_hash == TEA_HASH ? "tea" : ((g_hash == YURA_HASH) ? "rupasov" : "r5")); fflush (stdout); } /* wipe out first 2 k of a device and both possible reiserfs super block */ static void invalidate_other_formats (int dev) { struct buffer_head * bh; bh = getblk (dev, 0, 2048); mark_buffer_uptodate (bh, 1); mark_buffer_dirty (bh); bwrite (bh); brelse (bh); bh = getblk(dev, REISERFS_OLD_DISK_OFFSET_IN_BYTES / 1024, 1024) ; mark_buffer_uptodate (bh, 1); mark_buffer_dirty (bh); bwrite (bh); brelse (bh); bh = getblk(dev, REISERFS_DISK_OFFSET_IN_BYTES / 1024, 1024) ; mark_buffer_uptodate (bh, 1); mark_buffer_dirty (bh); bwrite (bh); brelse (bh); } static void set_hash_function (char * str) { if (!strcmp (str, "tea")) g_hash = TEA_HASH; else if (!strcmp (str, "rupasov")) g_hash = YURA_HASH; else if (!strcmp (str, "r5")) g_hash = R5_HASH; else printf ("mkreiserfs: wrong hash type specified. Using default\n"); } static void set_reiserfs_version (char * str) { if (!strcmp (str, "1")) g_3_6_format = 0; else if (!strcmp (str, "2")) g_3_6_format = 1; else printf ("mkreiserfs: wrong reiserfs version specified. Using default 3.5 format\n"); } int main (int argc, char **argv) { char *tmp; int dev; int force = 0; struct stat st; char * device_name; int c; print_banner ("mkreiserfs"); if (argc < 2) print_usage_and_exit (); while ( ( c = getopt( argc, argv, "fh:v:q" ) ) != EOF ) switch( c ) { case 'f' : /* force if file is not a block device or fs is mounted. Confirm still required */ force = 1; break; case 'h': set_hash_function (optarg); break; case 'v': set_reiserfs_version (optarg); break; case 'q': quiet = 1; break; default : print_usage_and_exit (); } device_name = argv [optind]; /* get block number for file system */ if (optind == argc - 2) { g_block_number = strtol (argv[optind + 1], &tmp, 0); if (*tmp == 0) { /* The string is integer */ if (g_block_number > count_blocks (device_name, g_block_size, -1)) die ("mkreiserfs: specified block number (%d) is too high", g_block_number); } else { die ("mkreiserfs: bad block count : %s\n", argv[optind + 1]); } } else if (optind == argc - 1) { /* number of blocks is not specified */ g_block_number = count_blocks (device_name, g_block_size, -1); tmp = ""; } else print_usage_and_exit (); /*g_block_number = g_block_number / 8 * 8;*/ if (g_block_number < min_block_amount (g_block_size, JOURNAL_BLOCK_COUNT + 1)) die ("mkreiserfs: can not create filesystem on that small device (%lu blocks).\n" "It should have at least %lu blocks", g_block_number, min_block_amount (g_block_size, JOURNAL_BLOCK_COUNT + 1)); if (is_mounted (device_name)) { printf ("mkreiserfs: '%s' contains a mounted file system\n", device_name); if (!force) exit (1); if (!user_confirmed ("Forced to continue, but please confirm (y/n)", "y\n")) exit (1); } dev = open (device_name, O_RDWR); if (dev == -1) die ("mkreiserfs: can not open '%s': %s", device_name, strerror (errno)); if (fstat (dev, &st) < 0) die ("mkreiserfs: unable to stat %s", device_name); if (!S_ISBLK (st.st_mode)) { printf ("mkreiserfs: %s is not a block special device.\n", device_name); if (!force) { exit (1); } if (!user_confirmed ("Forced to continue, but please confirm (y/n)", "y\n")) exit (1); } else { // from e2progs-1.18/misc/mke2fs.c if ((MAJOR (st.st_rdev) == HD_MAJOR && MINOR (st.st_rdev)%64 == 0) || (SCSI_BLK_MAJOR (MAJOR(st.st_rdev)) && MINOR (st.st_rdev) % 16 == 0)) { printf ("mkreiserfs: %s is entire device, not just one partition! Continue? (y/n) ", device_name); if (!user_confirmed ("Continue (y/n)", "y\n")) exit (1); } } /* these fill buffers (super block, first bitmap, root block) with reiserfs structures */ make_super_block (dev); make_bitmap (); make_root_block (); report (device_name); printf ("ATTENTION: YOU SHOULD REBOOT AFTER FDISK!\n\t ALL DATA WILL BE LOST ON '%s'! ", device_name); if (!user_confirmed ("(y/n)", "y\n")) die ("mkreiserfs: Disk was not formatted"); invalidate_other_formats (dev); write_super_and_root_blocks (); check_and_free_buffer_mem (); printf ("Syncing.."); fflush (stdout); close(dev) ; sync (); printf ("\n\nReiserFS core development sponsored by SuSE Labs (suse.com)\n\n" "Journaling sponsored by MP3.com.\n\n" //"Item handlers sponsored by Ecila.com\n\n "To learn about the programmers and ReiserFS, please go to\n" "http://www.devlinux.com/namesys\n\nHave fun.\n\n"); fflush (stdout); return 0; }
0.996094
high
aoj/Volume00/0064/solve.c
tobyapi/online-judge-solutions
0
5984497
#include<stdio.h> #include<string.h> int main(void){ int ans,i,x; char str[100]; memset(str,'a',sizeof(str)); ans=0; while(~scanf("%s",str)){ for(i=0;i<strlen(str);i++) if(str[i]<='9' && str[i]>='0'){ for(x=0;str[i]<='9'&&str[i]>='0'&&i<strlen(str);i++){ x*=10; x+=str[i]-'0'; } i--; ans+=x; } } printf("%d\n",ans); return 0; }
0.65625
low
layers/generated/chassis.h
MarijnS95/Vulkan-ValidationLayers
0
7513265
<gh_stars>0 // This file is ***GENERATED***. Do Not Edit. // See layer_chassis_generator.py for modifications. /* Copyright (c) 2015-2020 The Khronos Group Inc. * Copyright (c) 2015-2020 Valve Corporation * Copyright (c) 2015-2020 LunarG, Inc. * Copyright (c) 2015-2020 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Author: <NAME> <<EMAIL>> */ #pragma once #include <atomic> #include <mutex> #include <cinttypes> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unordered_map> #include <unordered_set> #include <algorithm> #include <memory> #include "vk_loader_platform.h" #include "vulkan/vulkan.h" #include "vk_layer_settings_ext.h" #include "vk_layer_config.h" #include "vk_layer_data.h" #include "vk_layer_logging.h" #include "vk_object_types.h" #include "vulkan/vk_layer.h" #include "vk_enum_string_helper.h" #include "vk_layer_extension_utils.h" #include "vk_layer_utils.h" #include "vulkan/vk_layer.h" #include "vk_dispatch_table_helper.h" #include "vk_extension_helper.h" #include "vk_safe_struct.h" #include "vk_typemap_helper.h" extern std::atomic<uint64_t> global_unique_id; // To avoid re-hashing unique ids on each use, we precompute the hash and store the // hash's LSBs in the high 24 bits. struct HashedUint64 { static const int HASHED_UINT64_SHIFT = 40; size_t operator()(const uint64_t &t) const { return t >> HASHED_UINT64_SHIFT; } static uint64_t hash(uint64_t id) { uint64_t h = (uint64_t)std::hash<uint64_t>()(id); id |= h << HASHED_UINT64_SHIFT; return id; } }; extern vl_concurrent_unordered_map<uint64_t, uint64_t, 4, HashedUint64> unique_id_mapping; VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL GetPhysicalDeviceProcAddr( VkInstance instance, const char* funcName); VKAPI_ATTR VkResult VKAPI_CALL CreateInstance( const VkInstanceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkInstance* pInstance); VKAPI_ATTR void VKAPI_CALL DestroyInstance( VkInstance instance, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR VkResult VKAPI_CALL EnumeratePhysicalDevices( VkInstance instance, uint32_t* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices); VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceFeatures( VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures* pFeatures); VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceFormatProperties( VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties* pFormatProperties); VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceImageFormatProperties( VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties* pImageFormatProperties); VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceProperties( VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties* pProperties); VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceQueueFamilyProperties( VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties* pQueueFamilyProperties); VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceMemoryProperties( VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties* pMemoryProperties); VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL GetInstanceProcAddr( VkInstance instance, const char* pName); VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL GetDeviceProcAddr( VkDevice device, const char* pName); VKAPI_ATTR VkResult VKAPI_CALL CreateDevice( VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDevice* pDevice); VKAPI_ATTR void VKAPI_CALL DestroyDevice( VkDevice device, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR VkResult VKAPI_CALL EnumerateInstanceExtensionProperties( const char* pLayerName, uint32_t* pPropertyCount, VkExtensionProperties* pProperties); VKAPI_ATTR VkResult VKAPI_CALL EnumerateDeviceExtensionProperties( VkPhysicalDevice physicalDevice, const char* pLayerName, uint32_t* pPropertyCount, VkExtensionProperties* pProperties); VKAPI_ATTR VkResult VKAPI_CALL EnumerateInstanceLayerProperties( uint32_t* pPropertyCount, VkLayerProperties* pProperties); VKAPI_ATTR VkResult VKAPI_CALL EnumerateDeviceLayerProperties( VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkLayerProperties* pProperties); VKAPI_ATTR void VKAPI_CALL GetDeviceQueue( VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue* pQueue); VKAPI_ATTR VkResult VKAPI_CALL QueueSubmit( VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits, VkFence fence); VKAPI_ATTR VkResult VKAPI_CALL QueueWaitIdle( VkQueue queue); VKAPI_ATTR VkResult VKAPI_CALL DeviceWaitIdle( VkDevice device); VKAPI_ATTR VkResult VKAPI_CALL AllocateMemory( VkDevice device, const VkMemoryAllocateInfo* pAllocateInfo, const VkAllocationCallbacks* pAllocator, VkDeviceMemory* pMemory); VKAPI_ATTR void VKAPI_CALL FreeMemory( VkDevice device, VkDeviceMemory memory, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR VkResult VKAPI_CALL MapMemory( VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void** ppData); VKAPI_ATTR void VKAPI_CALL UnmapMemory( VkDevice device, VkDeviceMemory memory); VKAPI_ATTR VkResult VKAPI_CALL FlushMappedMemoryRanges( VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges); VKAPI_ATTR VkResult VKAPI_CALL InvalidateMappedMemoryRanges( VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges); VKAPI_ATTR void VKAPI_CALL GetDeviceMemoryCommitment( VkDevice device, VkDeviceMemory memory, VkDeviceSize* pCommittedMemoryInBytes); VKAPI_ATTR VkResult VKAPI_CALL BindBufferMemory( VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset); VKAPI_ATTR VkResult VKAPI_CALL BindImageMemory( VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset); VKAPI_ATTR void VKAPI_CALL GetBufferMemoryRequirements( VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements); VKAPI_ATTR void VKAPI_CALL GetImageMemoryRequirements( VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements); VKAPI_ATTR void VKAPI_CALL GetImageSparseMemoryRequirements( VkDevice device, VkImage image, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements* pSparseMemoryRequirements); VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceSparseImageFormatProperties( VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t* pPropertyCount, VkSparseImageFormatProperties* pProperties); VKAPI_ATTR VkResult VKAPI_CALL QueueBindSparse( VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo* pBindInfo, VkFence fence); VKAPI_ATTR VkResult VKAPI_CALL CreateFence( VkDevice device, const VkFenceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence); VKAPI_ATTR void VKAPI_CALL DestroyFence( VkDevice device, VkFence fence, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR VkResult VKAPI_CALL ResetFences( VkDevice device, uint32_t fenceCount, const VkFence* pFences); VKAPI_ATTR VkResult VKAPI_CALL GetFenceStatus( VkDevice device, VkFence fence); VKAPI_ATTR VkResult VKAPI_CALL WaitForFences( VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkBool32 waitAll, uint64_t timeout); VKAPI_ATTR VkResult VKAPI_CALL CreateSemaphore( VkDevice device, const VkSemaphoreCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSemaphore* pSemaphore); VKAPI_ATTR void VKAPI_CALL DestroySemaphore( VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR VkResult VKAPI_CALL CreateEvent( VkDevice device, const VkEventCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkEvent* pEvent); VKAPI_ATTR void VKAPI_CALL DestroyEvent( VkDevice device, VkEvent event, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR VkResult VKAPI_CALL GetEventStatus( VkDevice device, VkEvent event); VKAPI_ATTR VkResult VKAPI_CALL SetEvent( VkDevice device, VkEvent event); VKAPI_ATTR VkResult VKAPI_CALL ResetEvent( VkDevice device, VkEvent event); VKAPI_ATTR VkResult VKAPI_CALL CreateQueryPool( VkDevice device, const VkQueryPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkQueryPool* pQueryPool); VKAPI_ATTR void VKAPI_CALL DestroyQueryPool( VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR VkResult VKAPI_CALL GetQueryPoolResults( VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, size_t dataSize, void* pData, VkDeviceSize stride, VkQueryResultFlags flags); VKAPI_ATTR VkResult VKAPI_CALL CreateBuffer( VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer); VKAPI_ATTR void VKAPI_CALL DestroyBuffer( VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR VkResult VKAPI_CALL CreateBufferView( VkDevice device, const VkBufferViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBufferView* pView); VKAPI_ATTR void VKAPI_CALL DestroyBufferView( VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR VkResult VKAPI_CALL CreateImage( VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImage* pImage); VKAPI_ATTR void VKAPI_CALL DestroyImage( VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR void VKAPI_CALL GetImageSubresourceLayout( VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout); VKAPI_ATTR VkResult VKAPI_CALL CreateImageView( VkDevice device, const VkImageViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImageView* pView); VKAPI_ATTR void VKAPI_CALL DestroyImageView( VkDevice device, VkImageView imageView, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR VkResult VKAPI_CALL CreateShaderModule( VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkShaderModule* pShaderModule); VKAPI_ATTR void VKAPI_CALL DestroyShaderModule( VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR VkResult VKAPI_CALL CreatePipelineCache( VkDevice device, const VkPipelineCacheCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineCache* pPipelineCache); VKAPI_ATTR void VKAPI_CALL DestroyPipelineCache( VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR VkResult VKAPI_CALL GetPipelineCacheData( VkDevice device, VkPipelineCache pipelineCache, size_t* pDataSize, void* pData); VKAPI_ATTR VkResult VKAPI_CALL MergePipelineCaches( VkDevice device, VkPipelineCache dstCache, uint32_t srcCacheCount, const VkPipelineCache* pSrcCaches); VKAPI_ATTR VkResult VKAPI_CALL CreateGraphicsPipelines( VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkGraphicsPipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines); VKAPI_ATTR VkResult VKAPI_CALL CreateComputePipelines( VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkComputePipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines); VKAPI_ATTR void VKAPI_CALL DestroyPipeline( VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR VkResult VKAPI_CALL CreatePipelineLayout( VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineLayout* pPipelineLayout); VKAPI_ATTR void VKAPI_CALL DestroyPipelineLayout( VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR VkResult VKAPI_CALL CreateSampler( VkDevice device, const VkSamplerCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSampler* pSampler); VKAPI_ATTR void VKAPI_CALL DestroySampler( VkDevice device, VkSampler sampler, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR VkResult VKAPI_CALL CreateDescriptorSetLayout( VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorSetLayout* pSetLayout); VKAPI_ATTR void VKAPI_CALL DestroyDescriptorSetLayout( VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR VkResult VKAPI_CALL CreateDescriptorPool( VkDevice device, const VkDescriptorPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorPool* pDescriptorPool); VKAPI_ATTR void VKAPI_CALL DestroyDescriptorPool( VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR VkResult VKAPI_CALL ResetDescriptorPool( VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags); VKAPI_ATTR VkResult VKAPI_CALL AllocateDescriptorSets( VkDevice device, const VkDescriptorSetAllocateInfo* pAllocateInfo, VkDescriptorSet* pDescriptorSets); VKAPI_ATTR VkResult VKAPI_CALL FreeDescriptorSets( VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets); VKAPI_ATTR void VKAPI_CALL UpdateDescriptorSets( VkDevice device, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t descriptorCopyCount, const VkCopyDescriptorSet* pDescriptorCopies); VKAPI_ATTR VkResult VKAPI_CALL CreateFramebuffer( VkDevice device, const VkFramebufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFramebuffer* pFramebuffer); VKAPI_ATTR void VKAPI_CALL DestroyFramebuffer( VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR VkResult VKAPI_CALL CreateRenderPass( VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass); VKAPI_ATTR void VKAPI_CALL DestroyRenderPass( VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR void VKAPI_CALL GetRenderAreaGranularity( VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity); VKAPI_ATTR VkResult VKAPI_CALL CreateCommandPool( VkDevice device, const VkCommandPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkCommandPool* pCommandPool); VKAPI_ATTR void VKAPI_CALL DestroyCommandPool( VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR VkResult VKAPI_CALL ResetCommandPool( VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags); VKAPI_ATTR VkResult VKAPI_CALL AllocateCommandBuffers( VkDevice device, const VkCommandBufferAllocateInfo* pAllocateInfo, VkCommandBuffer* pCommandBuffers); VKAPI_ATTR void VKAPI_CALL FreeCommandBuffers( VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, const VkCommandBuffer* pCommandBuffers); VKAPI_ATTR VkResult VKAPI_CALL BeginCommandBuffer( VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo* pBeginInfo); VKAPI_ATTR VkResult VKAPI_CALL EndCommandBuffer( VkCommandBuffer commandBuffer); VKAPI_ATTR VkResult VKAPI_CALL ResetCommandBuffer( VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags); VKAPI_ATTR void VKAPI_CALL CmdBindPipeline( VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline); VKAPI_ATTR void VKAPI_CALL CmdSetViewport( VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewport* pViewports); VKAPI_ATTR void VKAPI_CALL CmdSetScissor( VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, const VkRect2D* pScissors); VKAPI_ATTR void VKAPI_CALL CmdSetLineWidth( VkCommandBuffer commandBuffer, float lineWidth); VKAPI_ATTR void VKAPI_CALL CmdSetDepthBias( VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor); VKAPI_ATTR void VKAPI_CALL CmdSetBlendConstants( VkCommandBuffer commandBuffer, const float blendConstants[4]); VKAPI_ATTR void VKAPI_CALL CmdSetDepthBounds( VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds); VKAPI_ATTR void VKAPI_CALL CmdSetStencilCompareMask( VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t compareMask); VKAPI_ATTR void VKAPI_CALL CmdSetStencilWriteMask( VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t writeMask); VKAPI_ATTR void VKAPI_CALL CmdSetStencilReference( VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t reference); VKAPI_ATTR void VKAPI_CALL CmdBindDescriptorSets( VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets); VKAPI_ATTR void VKAPI_CALL CmdBindIndexBuffer( VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType); VKAPI_ATTR void VKAPI_CALL CmdBindVertexBuffers( VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets); VKAPI_ATTR void VKAPI_CALL CmdDraw( VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance); VKAPI_ATTR void VKAPI_CALL CmdDrawIndexed( VkCommandBuffer commandBuffer, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance); VKAPI_ATTR void VKAPI_CALL CmdDrawIndirect( VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); VKAPI_ATTR void VKAPI_CALL CmdDrawIndexedIndirect( VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); VKAPI_ATTR void VKAPI_CALL CmdDispatch( VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); VKAPI_ATTR void VKAPI_CALL CmdDispatchIndirect( VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset); VKAPI_ATTR void VKAPI_CALL CmdCopyBuffer( VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferCopy* pRegions); VKAPI_ATTR void VKAPI_CALL CmdCopyImage( VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageCopy* pRegions); VKAPI_ATTR void VKAPI_CALL CmdBlitImage( VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageBlit* pRegions, VkFilter filter); VKAPI_ATTR void VKAPI_CALL CmdCopyBufferToImage( VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkBufferImageCopy* pRegions); VKAPI_ATTR void VKAPI_CALL CmdCopyImageToBuffer( VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferImageCopy* pRegions); VKAPI_ATTR void VKAPI_CALL CmdUpdateBuffer( VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize dataSize, const void* pData); VKAPI_ATTR void VKAPI_CALL CmdFillBuffer( VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data); VKAPI_ATTR void VKAPI_CALL CmdClearColorImage( VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rangeCount, const VkImageSubresourceRange* pRanges); VKAPI_ATTR void VKAPI_CALL CmdClearDepthStencilImage( VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges); VKAPI_ATTR void VKAPI_CALL CmdClearAttachments( VkCommandBuffer commandBuffer, uint32_t attachmentCount, const VkClearAttachment* pAttachments, uint32_t rectCount, const VkClearRect* pRects); VKAPI_ATTR void VKAPI_CALL CmdResolveImage( VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageResolve* pRegions); VKAPI_ATTR void VKAPI_CALL CmdSetEvent( VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask); VKAPI_ATTR void VKAPI_CALL CmdResetEvent( VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask); VKAPI_ATTR void VKAPI_CALL CmdWaitEvents( VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent* pEvents, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers); VKAPI_ATTR void VKAPI_CALL CmdPipelineBarrier( VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers); VKAPI_ATTR void VKAPI_CALL CmdBeginQuery( VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags); VKAPI_ATTR void VKAPI_CALL CmdEndQuery( VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query); VKAPI_ATTR void VKAPI_CALL CmdResetQueryPool( VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount); VKAPI_ATTR void VKAPI_CALL CmdWriteTimestamp( VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, uint32_t query); VKAPI_ATTR void VKAPI_CALL CmdCopyQueryPoolResults( VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize stride, VkQueryResultFlags flags); VKAPI_ATTR void VKAPI_CALL CmdPushConstants( VkCommandBuffer commandBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size, const void* pValues); VKAPI_ATTR void VKAPI_CALL CmdBeginRenderPass( VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, VkSubpassContents contents); VKAPI_ATTR void VKAPI_CALL CmdNextSubpass( VkCommandBuffer commandBuffer, VkSubpassContents contents); VKAPI_ATTR void VKAPI_CALL CmdEndRenderPass( VkCommandBuffer commandBuffer); VKAPI_ATTR void VKAPI_CALL CmdExecuteCommands( VkCommandBuffer commandBuffer, uint32_t commandBufferCount, const VkCommandBuffer* pCommandBuffers); VKAPI_ATTR VkResult VKAPI_CALL BindBufferMemory2( VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo* pBindInfos); VKAPI_ATTR VkResult VKAPI_CALL BindImageMemory2( VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo* pBindInfos); VKAPI_ATTR void VKAPI_CALL GetDeviceGroupPeerMemoryFeatures( VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, VkPeerMemoryFeatureFlags* pPeerMemoryFeatures); VKAPI_ATTR void VKAPI_CALL CmdSetDeviceMask( VkCommandBuffer commandBuffer, uint32_t deviceMask); VKAPI_ATTR void VKAPI_CALL CmdDispatchBase( VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); VKAPI_ATTR VkResult VKAPI_CALL EnumeratePhysicalDeviceGroups( VkInstance instance, uint32_t* pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties); VKAPI_ATTR void VKAPI_CALL GetImageMemoryRequirements2( VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements); VKAPI_ATTR void VKAPI_CALL GetBufferMemoryRequirements2( VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements); VKAPI_ATTR void VKAPI_CALL GetImageSparseMemoryRequirements2( VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements); VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceFeatures2( VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2* pFeatures); VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceProperties2( VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2* pProperties); VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceFormatProperties2( VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties2* pFormatProperties); VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceImageFormatProperties2( VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, VkImageFormatProperties2* pImageFormatProperties); VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceQueueFamilyProperties2( VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties2* pQueueFamilyProperties); VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceMemoryProperties2( VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2* pMemoryProperties); VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceSparseImageFormatProperties2( VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, uint32_t* pPropertyCount, VkSparseImageFormatProperties2* pProperties); VKAPI_ATTR void VKAPI_CALL TrimCommandPool( VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags); VKAPI_ATTR void VKAPI_CALL GetDeviceQueue2( VkDevice device, const VkDeviceQueueInfo2* pQueueInfo, VkQueue* pQueue); VKAPI_ATTR VkResult VKAPI_CALL CreateSamplerYcbcrConversion( VkDevice device, const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSamplerYcbcrConversion* pYcbcrConversion); VKAPI_ATTR void VKAPI_CALL DestroySamplerYcbcrConversion( VkDevice device, VkSamplerYcbcrConversion ycbcrConversion, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR VkResult VKAPI_CALL CreateDescriptorUpdateTemplate( VkDevice device, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate); VKAPI_ATTR void VKAPI_CALL DestroyDescriptorUpdateTemplate( VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR void VKAPI_CALL UpdateDescriptorSetWithTemplate( VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData); VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceExternalBufferProperties( VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, VkExternalBufferProperties* pExternalBufferProperties); VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceExternalFenceProperties( VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, VkExternalFenceProperties* pExternalFenceProperties); VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceExternalSemaphoreProperties( VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, VkExternalSemaphoreProperties* pExternalSemaphoreProperties); VKAPI_ATTR void VKAPI_CALL GetDescriptorSetLayoutSupport( VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayoutSupport* pSupport); VKAPI_ATTR void VKAPI_CALL CmdDrawIndirectCount( VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride); VKAPI_ATTR void VKAPI_CALL CmdDrawIndexedIndirectCount( VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride); VKAPI_ATTR VkResult VKAPI_CALL CreateRenderPass2( VkDevice device, const VkRenderPassCreateInfo2* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass); VKAPI_ATTR void VKAPI_CALL CmdBeginRenderPass2( VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, const VkSubpassBeginInfo* pSubpassBeginInfo); VKAPI_ATTR void VKAPI_CALL CmdNextSubpass2( VkCommandBuffer commandBuffer, const VkSubpassBeginInfo* pSubpassBeginInfo, const VkSubpassEndInfo* pSubpassEndInfo); VKAPI_ATTR void VKAPI_CALL CmdEndRenderPass2( VkCommandBuffer commandBuffer, const VkSubpassEndInfo* pSubpassEndInfo); VKAPI_ATTR void VKAPI_CALL ResetQueryPool( VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount); VKAPI_ATTR VkResult VKAPI_CALL GetSemaphoreCounterValue( VkDevice device, VkSemaphore semaphore, uint64_t* pValue); VKAPI_ATTR VkResult VKAPI_CALL WaitSemaphores( VkDevice device, const VkSemaphoreWaitInfo* pWaitInfo, uint64_t timeout); VKAPI_ATTR VkResult VKAPI_CALL SignalSemaphore( VkDevice device, const VkSemaphoreSignalInfo* pSignalInfo); VKAPI_ATTR VkDeviceAddress VKAPI_CALL GetBufferDeviceAddress( VkDevice device, const VkBufferDeviceAddressInfo* pInfo); VKAPI_ATTR uint64_t VKAPI_CALL GetBufferOpaqueCaptureAddress( VkDevice device, const VkBufferDeviceAddressInfo* pInfo); VKAPI_ATTR uint64_t VKAPI_CALL GetDeviceMemoryOpaqueCaptureAddress( VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfo* pInfo); VKAPI_ATTR void VKAPI_CALL DestroySurfaceKHR( VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceSupportKHR( VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, VkSurfaceKHR surface, VkBool32* pSupported); VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceCapabilitiesKHR( VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR* pSurfaceCapabilities); VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceFormatsKHR( VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pSurfaceFormatCount, VkSurfaceFormatKHR* pSurfaceFormats); VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfacePresentModesKHR( VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pPresentModeCount, VkPresentModeKHR* pPresentModes); VKAPI_ATTR VkResult VKAPI_CALL CreateSwapchainKHR( VkDevice device, const VkSwapchainCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchain); VKAPI_ATTR void VKAPI_CALL DestroySwapchainKHR( VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR VkResult VKAPI_CALL GetSwapchainImagesKHR( VkDevice device, VkSwapchainKHR swapchain, uint32_t* pSwapchainImageCount, VkImage* pSwapchainImages); VKAPI_ATTR VkResult VKAPI_CALL AcquireNextImageKHR( VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t* pImageIndex); VKAPI_ATTR VkResult VKAPI_CALL QueuePresentKHR( VkQueue queue, const VkPresentInfoKHR* pPresentInfo); VKAPI_ATTR VkResult VKAPI_CALL GetDeviceGroupPresentCapabilitiesKHR( VkDevice device, VkDeviceGroupPresentCapabilitiesKHR* pDeviceGroupPresentCapabilities); VKAPI_ATTR VkResult VKAPI_CALL GetDeviceGroupSurfacePresentModesKHR( VkDevice device, VkSurfaceKHR surface, VkDeviceGroupPresentModeFlagsKHR* pModes); VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDevicePresentRectanglesKHR( VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pRectCount, VkRect2D* pRects); VKAPI_ATTR VkResult VKAPI_CALL AcquireNextImage2KHR( VkDevice device, const VkAcquireNextImageInfoKHR* pAcquireInfo, uint32_t* pImageIndex); VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceDisplayPropertiesKHR( VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkDisplayPropertiesKHR* pProperties); VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceDisplayPlanePropertiesKHR( VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkDisplayPlanePropertiesKHR* pProperties); VKAPI_ATTR VkResult VKAPI_CALL GetDisplayPlaneSupportedDisplaysKHR( VkPhysicalDevice physicalDevice, uint32_t planeIndex, uint32_t* pDisplayCount, VkDisplayKHR* pDisplays); VKAPI_ATTR VkResult VKAPI_CALL GetDisplayModePropertiesKHR( VkPhysicalDevice physicalDevice, VkDisplayKHR display, uint32_t* pPropertyCount, VkDisplayModePropertiesKHR* pProperties); VKAPI_ATTR VkResult VKAPI_CALL CreateDisplayModeKHR( VkPhysicalDevice physicalDevice, VkDisplayKHR display, const VkDisplayModeCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDisplayModeKHR* pMode); VKAPI_ATTR VkResult VKAPI_CALL GetDisplayPlaneCapabilitiesKHR( VkPhysicalDevice physicalDevice, VkDisplayModeKHR mode, uint32_t planeIndex, VkDisplayPlaneCapabilitiesKHR* pCapabilities); VKAPI_ATTR VkResult VKAPI_CALL CreateDisplayPlaneSurfaceKHR( VkInstance instance, const VkDisplaySurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); VKAPI_ATTR VkResult VKAPI_CALL CreateSharedSwapchainsKHR( VkDevice device, uint32_t swapchainCount, const VkSwapchainCreateInfoKHR* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchains); #ifdef VK_USE_PLATFORM_XLIB_KHR VKAPI_ATTR VkResult VKAPI_CALL CreateXlibSurfaceKHR( VkInstance instance, const VkXlibSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); VKAPI_ATTR VkBool32 VKAPI_CALL GetPhysicalDeviceXlibPresentationSupportKHR( VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, Display* dpy, VisualID visualID); #endif // VK_USE_PLATFORM_XLIB_KHR #ifdef VK_USE_PLATFORM_XCB_KHR VKAPI_ATTR VkResult VKAPI_CALL CreateXcbSurfaceKHR( VkInstance instance, const VkXcbSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); VKAPI_ATTR VkBool32 VKAPI_CALL GetPhysicalDeviceXcbPresentationSupportKHR( VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, xcb_connection_t* connection, xcb_visualid_t visual_id); #endif // VK_USE_PLATFORM_XCB_KHR #ifdef VK_USE_PLATFORM_WAYLAND_KHR VKAPI_ATTR VkResult VKAPI_CALL CreateWaylandSurfaceKHR( VkInstance instance, const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); VKAPI_ATTR VkBool32 VKAPI_CALL GetPhysicalDeviceWaylandPresentationSupportKHR( VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, struct wl_display* display); #endif // VK_USE_PLATFORM_WAYLAND_KHR #ifdef VK_USE_PLATFORM_ANDROID_KHR VKAPI_ATTR VkResult VKAPI_CALL CreateAndroidSurfaceKHR( VkInstance instance, const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); #endif // VK_USE_PLATFORM_ANDROID_KHR #ifdef VK_USE_PLATFORM_WIN32_KHR VKAPI_ATTR VkResult VKAPI_CALL CreateWin32SurfaceKHR( VkInstance instance, const VkWin32SurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); VKAPI_ATTR VkBool32 VKAPI_CALL GetPhysicalDeviceWin32PresentationSupportKHR( VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex); #endif // VK_USE_PLATFORM_WIN32_KHR VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceFeatures2KHR( VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2* pFeatures); VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceProperties2KHR( VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2* pProperties); VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceFormatProperties2KHR( VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties2* pFormatProperties); VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceImageFormatProperties2KHR( VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, VkImageFormatProperties2* pImageFormatProperties); VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceQueueFamilyProperties2KHR( VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties2* pQueueFamilyProperties); VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceMemoryProperties2KHR( VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2* pMemoryProperties); VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceSparseImageFormatProperties2KHR( VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, uint32_t* pPropertyCount, VkSparseImageFormatProperties2* pProperties); VKAPI_ATTR void VKAPI_CALL GetDeviceGroupPeerMemoryFeaturesKHR( VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, VkPeerMemoryFeatureFlags* pPeerMemoryFeatures); VKAPI_ATTR void VKAPI_CALL CmdSetDeviceMaskKHR( VkCommandBuffer commandBuffer, uint32_t deviceMask); VKAPI_ATTR void VKAPI_CALL CmdDispatchBaseKHR( VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ); VKAPI_ATTR void VKAPI_CALL TrimCommandPoolKHR( VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags); VKAPI_ATTR VkResult VKAPI_CALL EnumeratePhysicalDeviceGroupsKHR( VkInstance instance, uint32_t* pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties); VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceExternalBufferPropertiesKHR( VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, VkExternalBufferProperties* pExternalBufferProperties); #ifdef VK_USE_PLATFORM_WIN32_KHR VKAPI_ATTR VkResult VKAPI_CALL GetMemoryWin32HandleKHR( VkDevice device, const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle); VKAPI_ATTR VkResult VKAPI_CALL GetMemoryWin32HandlePropertiesKHR( VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE handle, VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties); #endif // VK_USE_PLATFORM_WIN32_KHR VKAPI_ATTR VkResult VKAPI_CALL GetMemoryFdKHR( VkDevice device, const VkMemoryGetFdInfoKHR* pGetFdInfo, int* pFd); VKAPI_ATTR VkResult VKAPI_CALL GetMemoryFdPropertiesKHR( VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, int fd, VkMemoryFdPropertiesKHR* pMemoryFdProperties); #ifdef VK_USE_PLATFORM_WIN32_KHR #endif // VK_USE_PLATFORM_WIN32_KHR VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceExternalSemaphorePropertiesKHR( VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, VkExternalSemaphoreProperties* pExternalSemaphoreProperties); #ifdef VK_USE_PLATFORM_WIN32_KHR VKAPI_ATTR VkResult VKAPI_CALL ImportSemaphoreWin32HandleKHR( VkDevice device, const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo); VKAPI_ATTR VkResult VKAPI_CALL GetSemaphoreWin32HandleKHR( VkDevice device, const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle); #endif // VK_USE_PLATFORM_WIN32_KHR VKAPI_ATTR VkResult VKAPI_CALL ImportSemaphoreFdKHR( VkDevice device, const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo); VKAPI_ATTR VkResult VKAPI_CALL GetSemaphoreFdKHR( VkDevice device, const VkSemaphoreGetFdInfoKHR* pGetFdInfo, int* pFd); VKAPI_ATTR void VKAPI_CALL CmdPushDescriptorSetKHR( VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites); VKAPI_ATTR void VKAPI_CALL CmdPushDescriptorSetWithTemplateKHR( VkCommandBuffer commandBuffer, VkDescriptorUpdateTemplate descriptorUpdateTemplate, VkPipelineLayout layout, uint32_t set, const void* pData); VKAPI_ATTR VkResult VKAPI_CALL CreateDescriptorUpdateTemplateKHR( VkDevice device, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate); VKAPI_ATTR void VKAPI_CALL DestroyDescriptorUpdateTemplateKHR( VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR void VKAPI_CALL UpdateDescriptorSetWithTemplateKHR( VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData); VKAPI_ATTR VkResult VKAPI_CALL CreateRenderPass2KHR( VkDevice device, const VkRenderPassCreateInfo2* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass); VKAPI_ATTR void VKAPI_CALL CmdBeginRenderPass2KHR( VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, const VkSubpassBeginInfo* pSubpassBeginInfo); VKAPI_ATTR void VKAPI_CALL CmdNextSubpass2KHR( VkCommandBuffer commandBuffer, const VkSubpassBeginInfo* pSubpassBeginInfo, const VkSubpassEndInfo* pSubpassEndInfo); VKAPI_ATTR void VKAPI_CALL CmdEndRenderPass2KHR( VkCommandBuffer commandBuffer, const VkSubpassEndInfo* pSubpassEndInfo); VKAPI_ATTR VkResult VKAPI_CALL GetSwapchainStatusKHR( VkDevice device, VkSwapchainKHR swapchain); VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceExternalFencePropertiesKHR( VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, VkExternalFenceProperties* pExternalFenceProperties); #ifdef VK_USE_PLATFORM_WIN32_KHR VKAPI_ATTR VkResult VKAPI_CALL ImportFenceWin32HandleKHR( VkDevice device, const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo); VKAPI_ATTR VkResult VKAPI_CALL GetFenceWin32HandleKHR( VkDevice device, const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle); #endif // VK_USE_PLATFORM_WIN32_KHR VKAPI_ATTR VkResult VKAPI_CALL ImportFenceFdKHR( VkDevice device, const VkImportFenceFdInfoKHR* pImportFenceFdInfo); VKAPI_ATTR VkResult VKAPI_CALL GetFenceFdKHR( VkDevice device, const VkFenceGetFdInfoKHR* pGetFdInfo, int* pFd); VKAPI_ATTR VkResult VKAPI_CALL EnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR( VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, uint32_t* pCounterCount, VkPerformanceCounterKHR* pCounters, VkPerformanceCounterDescriptionKHR* pCounterDescriptions); VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR( VkPhysicalDevice physicalDevice, const VkQueryPoolPerformanceCreateInfoKHR* pPerformanceQueryCreateInfo, uint32_t* pNumPasses); VKAPI_ATTR VkResult VKAPI_CALL AcquireProfilingLockKHR( VkDevice device, const VkAcquireProfilingLockInfoKHR* pInfo); VKAPI_ATTR void VKAPI_CALL ReleaseProfilingLockKHR( VkDevice device); VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceCapabilities2KHR( VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, VkSurfaceCapabilities2KHR* pSurfaceCapabilities); VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceFormats2KHR( VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, uint32_t* pSurfaceFormatCount, VkSurfaceFormat2KHR* pSurfaceFormats); VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceDisplayProperties2KHR( VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkDisplayProperties2KHR* pProperties); VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceDisplayPlaneProperties2KHR( VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkDisplayPlaneProperties2KHR* pProperties); VKAPI_ATTR VkResult VKAPI_CALL GetDisplayModeProperties2KHR( VkPhysicalDevice physicalDevice, VkDisplayKHR display, uint32_t* pPropertyCount, VkDisplayModeProperties2KHR* pProperties); VKAPI_ATTR VkResult VKAPI_CALL GetDisplayPlaneCapabilities2KHR( VkPhysicalDevice physicalDevice, const VkDisplayPlaneInfo2KHR* pDisplayPlaneInfo, VkDisplayPlaneCapabilities2KHR* pCapabilities); VKAPI_ATTR void VKAPI_CALL GetImageMemoryRequirements2KHR( VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements); VKAPI_ATTR void VKAPI_CALL GetBufferMemoryRequirements2KHR( VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements); VKAPI_ATTR void VKAPI_CALL GetImageSparseMemoryRequirements2KHR( VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements); VKAPI_ATTR VkResult VKAPI_CALL CreateSamplerYcbcrConversionKHR( VkDevice device, const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSamplerYcbcrConversion* pYcbcrConversion); VKAPI_ATTR void VKAPI_CALL DestroySamplerYcbcrConversionKHR( VkDevice device, VkSamplerYcbcrConversion ycbcrConversion, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR VkResult VKAPI_CALL BindBufferMemory2KHR( VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo* pBindInfos); VKAPI_ATTR VkResult VKAPI_CALL BindImageMemory2KHR( VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo* pBindInfos); #ifdef VK_ENABLE_BETA_EXTENSIONS #endif // VK_ENABLE_BETA_EXTENSIONS VKAPI_ATTR void VKAPI_CALL GetDescriptorSetLayoutSupportKHR( VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayoutSupport* pSupport); VKAPI_ATTR void VKAPI_CALL CmdDrawIndirectCountKHR( VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride); VKAPI_ATTR void VKAPI_CALL CmdDrawIndexedIndirectCountKHR( VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride); VKAPI_ATTR VkResult VKAPI_CALL GetSemaphoreCounterValueKHR( VkDevice device, VkSemaphore semaphore, uint64_t* pValue); VKAPI_ATTR VkResult VKAPI_CALL WaitSemaphoresKHR( VkDevice device, const VkSemaphoreWaitInfo* pWaitInfo, uint64_t timeout); VKAPI_ATTR VkResult VKAPI_CALL SignalSemaphoreKHR( VkDevice device, const VkSemaphoreSignalInfo* pSignalInfo); VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceFragmentShadingRatesKHR( VkPhysicalDevice physicalDevice, uint32_t* pFragmentShadingRateCount, VkPhysicalDeviceFragmentShadingRateKHR* pFragmentShadingRates); VKAPI_ATTR void VKAPI_CALL CmdSetFragmentShadingRateKHR( VkCommandBuffer commandBuffer, const VkExtent2D* pFragmentSize, const VkFragmentShadingRateCombinerOpKHR combinerOps[2]); VKAPI_ATTR VkDeviceAddress VKAPI_CALL GetBufferDeviceAddressKHR( VkDevice device, const VkBufferDeviceAddressInfo* pInfo); VKAPI_ATTR uint64_t VKAPI_CALL GetBufferOpaqueCaptureAddressKHR( VkDevice device, const VkBufferDeviceAddressInfo* pInfo); VKAPI_ATTR uint64_t VKAPI_CALL GetDeviceMemoryOpaqueCaptureAddressKHR( VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfo* pInfo); VKAPI_ATTR VkResult VKAPI_CALL CreateDeferredOperationKHR( VkDevice device, const VkAllocationCallbacks* pAllocator, VkDeferredOperationKHR* pDeferredOperation); VKAPI_ATTR void VKAPI_CALL DestroyDeferredOperationKHR( VkDevice device, VkDeferredOperationKHR operation, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR uint32_t VKAPI_CALL GetDeferredOperationMaxConcurrencyKHR( VkDevice device, VkDeferredOperationKHR operation); VKAPI_ATTR VkResult VKAPI_CALL GetDeferredOperationResultKHR( VkDevice device, VkDeferredOperationKHR operation); VKAPI_ATTR VkResult VKAPI_CALL DeferredOperationJoinKHR( VkDevice device, VkDeferredOperationKHR operation); VKAPI_ATTR VkResult VKAPI_CALL GetPipelineExecutablePropertiesKHR( VkDevice device, const VkPipelineInfoKHR* pPipelineInfo, uint32_t* pExecutableCount, VkPipelineExecutablePropertiesKHR* pProperties); VKAPI_ATTR VkResult VKAPI_CALL GetPipelineExecutableStatisticsKHR( VkDevice device, const VkPipelineExecutableInfoKHR* pExecutableInfo, uint32_t* pStatisticCount, VkPipelineExecutableStatisticKHR* pStatistics); VKAPI_ATTR VkResult VKAPI_CALL GetPipelineExecutableInternalRepresentationsKHR( VkDevice device, const VkPipelineExecutableInfoKHR* pExecutableInfo, uint32_t* pInternalRepresentationCount, VkPipelineExecutableInternalRepresentationKHR* pInternalRepresentations); VKAPI_ATTR void VKAPI_CALL CmdCopyBuffer2KHR( VkCommandBuffer commandBuffer, const VkCopyBufferInfo2KHR* pCopyBufferInfo); VKAPI_ATTR void VKAPI_CALL CmdCopyImage2KHR( VkCommandBuffer commandBuffer, const VkCopyImageInfo2KHR* pCopyImageInfo); VKAPI_ATTR void VKAPI_CALL CmdCopyBufferToImage2KHR( VkCommandBuffer commandBuffer, const VkCopyBufferToImageInfo2KHR* pCopyBufferToImageInfo); VKAPI_ATTR void VKAPI_CALL CmdCopyImageToBuffer2KHR( VkCommandBuffer commandBuffer, const VkCopyImageToBufferInfo2KHR* pCopyImageToBufferInfo); VKAPI_ATTR void VKAPI_CALL CmdBlitImage2KHR( VkCommandBuffer commandBuffer, const VkBlitImageInfo2KHR* pBlitImageInfo); VKAPI_ATTR void VKAPI_CALL CmdResolveImage2KHR( VkCommandBuffer commandBuffer, const VkResolveImageInfo2KHR* pResolveImageInfo); VKAPI_ATTR VkResult VKAPI_CALL CreateDebugReportCallbackEXT( VkInstance instance, const VkDebugReportCallbackCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDebugReportCallbackEXT* pCallback); VKAPI_ATTR void VKAPI_CALL DestroyDebugReportCallbackEXT( VkInstance instance, VkDebugReportCallbackEXT callback, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR void VKAPI_CALL DebugReportMessageEXT( VkInstance instance, VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const char* pLayerPrefix, const char* pMessage); VKAPI_ATTR VkResult VKAPI_CALL DebugMarkerSetObjectTagEXT( VkDevice device, const VkDebugMarkerObjectTagInfoEXT* pTagInfo); VKAPI_ATTR VkResult VKAPI_CALL DebugMarkerSetObjectNameEXT( VkDevice device, const VkDebugMarkerObjectNameInfoEXT* pNameInfo); VKAPI_ATTR void VKAPI_CALL CmdDebugMarkerBeginEXT( VkCommandBuffer commandBuffer, const VkDebugMarkerMarkerInfoEXT* pMarkerInfo); VKAPI_ATTR void VKAPI_CALL CmdDebugMarkerEndEXT( VkCommandBuffer commandBuffer); VKAPI_ATTR void VKAPI_CALL CmdDebugMarkerInsertEXT( VkCommandBuffer commandBuffer, const VkDebugMarkerMarkerInfoEXT* pMarkerInfo); VKAPI_ATTR void VKAPI_CALL CmdBindTransformFeedbackBuffersEXT( VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets, const VkDeviceSize* pSizes); VKAPI_ATTR void VKAPI_CALL CmdBeginTransformFeedbackEXT( VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer, uint32_t counterBufferCount, const VkBuffer* pCounterBuffers, const VkDeviceSize* pCounterBufferOffsets); VKAPI_ATTR void VKAPI_CALL CmdEndTransformFeedbackEXT( VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer, uint32_t counterBufferCount, const VkBuffer* pCounterBuffers, const VkDeviceSize* pCounterBufferOffsets); VKAPI_ATTR void VKAPI_CALL CmdBeginQueryIndexedEXT( VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags, uint32_t index); VKAPI_ATTR void VKAPI_CALL CmdEndQueryIndexedEXT( VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, uint32_t index); VKAPI_ATTR void VKAPI_CALL CmdDrawIndirectByteCountEXT( VkCommandBuffer commandBuffer, uint32_t instanceCount, uint32_t firstInstance, VkBuffer counterBuffer, VkDeviceSize counterBufferOffset, uint32_t counterOffset, uint32_t vertexStride); VKAPI_ATTR uint32_t VKAPI_CALL GetImageViewHandleNVX( VkDevice device, const VkImageViewHandleInfoNVX* pInfo); VKAPI_ATTR VkResult VKAPI_CALL GetImageViewAddressNVX( VkDevice device, VkImageView imageView, VkImageViewAddressPropertiesNVX* pProperties); VKAPI_ATTR void VKAPI_CALL CmdDrawIndirectCountAMD( VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride); VKAPI_ATTR void VKAPI_CALL CmdDrawIndexedIndirectCountAMD( VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride); VKAPI_ATTR VkResult VKAPI_CALL GetShaderInfoAMD( VkDevice device, VkPipeline pipeline, VkShaderStageFlagBits shaderStage, VkShaderInfoTypeAMD infoType, size_t* pInfoSize, void* pInfo); #ifdef VK_USE_PLATFORM_GGP VKAPI_ATTR VkResult VKAPI_CALL CreateStreamDescriptorSurfaceGGP( VkInstance instance, const VkStreamDescriptorSurfaceCreateInfoGGP* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); #endif // VK_USE_PLATFORM_GGP VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceExternalImageFormatPropertiesNV( VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkExternalMemoryHandleTypeFlagsNV externalHandleType, VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties); #ifdef VK_USE_PLATFORM_WIN32_KHR VKAPI_ATTR VkResult VKAPI_CALL GetMemoryWin32HandleNV( VkDevice device, VkDeviceMemory memory, VkExternalMemoryHandleTypeFlagsNV handleType, HANDLE* pHandle); #endif // VK_USE_PLATFORM_WIN32_KHR #ifdef VK_USE_PLATFORM_WIN32_KHR #endif // VK_USE_PLATFORM_WIN32_KHR #ifdef VK_USE_PLATFORM_VI_NN VKAPI_ATTR VkResult VKAPI_CALL CreateViSurfaceNN( VkInstance instance, const VkViSurfaceCreateInfoNN* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); #endif // VK_USE_PLATFORM_VI_NN VKAPI_ATTR void VKAPI_CALL CmdBeginConditionalRenderingEXT( VkCommandBuffer commandBuffer, const VkConditionalRenderingBeginInfoEXT* pConditionalRenderingBegin); VKAPI_ATTR void VKAPI_CALL CmdEndConditionalRenderingEXT( VkCommandBuffer commandBuffer); VKAPI_ATTR void VKAPI_CALL CmdSetViewportWScalingNV( VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewportWScalingNV* pViewportWScalings); VKAPI_ATTR VkResult VKAPI_CALL ReleaseDisplayEXT( VkPhysicalDevice physicalDevice, VkDisplayKHR display); #ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT VKAPI_ATTR VkResult VKAPI_CALL AcquireXlibDisplayEXT( VkPhysicalDevice physicalDevice, Display* dpy, VkDisplayKHR display); VKAPI_ATTR VkResult VKAPI_CALL GetRandROutputDisplayEXT( VkPhysicalDevice physicalDevice, Display* dpy, RROutput rrOutput, VkDisplayKHR* pDisplay); #endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceCapabilities2EXT( VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilities2EXT* pSurfaceCapabilities); VKAPI_ATTR VkResult VKAPI_CALL DisplayPowerControlEXT( VkDevice device, VkDisplayKHR display, const VkDisplayPowerInfoEXT* pDisplayPowerInfo); VKAPI_ATTR VkResult VKAPI_CALL RegisterDeviceEventEXT( VkDevice device, const VkDeviceEventInfoEXT* pDeviceEventInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence); VKAPI_ATTR VkResult VKAPI_CALL RegisterDisplayEventEXT( VkDevice device, VkDisplayKHR display, const VkDisplayEventInfoEXT* pDisplayEventInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence); VKAPI_ATTR VkResult VKAPI_CALL GetSwapchainCounterEXT( VkDevice device, VkSwapchainKHR swapchain, VkSurfaceCounterFlagBitsEXT counter, uint64_t* pCounterValue); VKAPI_ATTR VkResult VKAPI_CALL GetRefreshCycleDurationGOOGLE( VkDevice device, VkSwapchainKHR swapchain, VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties); VKAPI_ATTR VkResult VKAPI_CALL GetPastPresentationTimingGOOGLE( VkDevice device, VkSwapchainKHR swapchain, uint32_t* pPresentationTimingCount, VkPastPresentationTimingGOOGLE* pPresentationTimings); VKAPI_ATTR void VKAPI_CALL CmdSetDiscardRectangleEXT( VkCommandBuffer commandBuffer, uint32_t firstDiscardRectangle, uint32_t discardRectangleCount, const VkRect2D* pDiscardRectangles); VKAPI_ATTR void VKAPI_CALL SetHdrMetadataEXT( VkDevice device, uint32_t swapchainCount, const VkSwapchainKHR* pSwapchains, const VkHdrMetadataEXT* pMetadata); #ifdef VK_USE_PLATFORM_IOS_MVK VKAPI_ATTR VkResult VKAPI_CALL CreateIOSSurfaceMVK( VkInstance instance, const VkIOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); #endif // VK_USE_PLATFORM_IOS_MVK #ifdef VK_USE_PLATFORM_MACOS_MVK VKAPI_ATTR VkResult VKAPI_CALL CreateMacOSSurfaceMVK( VkInstance instance, const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); #endif // VK_USE_PLATFORM_MACOS_MVK VKAPI_ATTR VkResult VKAPI_CALL SetDebugUtilsObjectNameEXT( VkDevice device, const VkDebugUtilsObjectNameInfoEXT* pNameInfo); VKAPI_ATTR VkResult VKAPI_CALL SetDebugUtilsObjectTagEXT( VkDevice device, const VkDebugUtilsObjectTagInfoEXT* pTagInfo); VKAPI_ATTR void VKAPI_CALL QueueBeginDebugUtilsLabelEXT( VkQueue queue, const VkDebugUtilsLabelEXT* pLabelInfo); VKAPI_ATTR void VKAPI_CALL QueueEndDebugUtilsLabelEXT( VkQueue queue); VKAPI_ATTR void VKAPI_CALL QueueInsertDebugUtilsLabelEXT( VkQueue queue, const VkDebugUtilsLabelEXT* pLabelInfo); VKAPI_ATTR void VKAPI_CALL CmdBeginDebugUtilsLabelEXT( VkCommandBuffer commandBuffer, const VkDebugUtilsLabelEXT* pLabelInfo); VKAPI_ATTR void VKAPI_CALL CmdEndDebugUtilsLabelEXT( VkCommandBuffer commandBuffer); VKAPI_ATTR void VKAPI_CALL CmdInsertDebugUtilsLabelEXT( VkCommandBuffer commandBuffer, const VkDebugUtilsLabelEXT* pLabelInfo); VKAPI_ATTR VkResult VKAPI_CALL CreateDebugUtilsMessengerEXT( VkInstance instance, const VkDebugUtilsMessengerCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDebugUtilsMessengerEXT* pMessenger); VKAPI_ATTR void VKAPI_CALL DestroyDebugUtilsMessengerEXT( VkInstance instance, VkDebugUtilsMessengerEXT messenger, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR void VKAPI_CALL SubmitDebugUtilsMessageEXT( VkInstance instance, VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, VkDebugUtilsMessageTypeFlagsEXT messageTypes, const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData); #ifdef VK_USE_PLATFORM_ANDROID_KHR VKAPI_ATTR VkResult VKAPI_CALL GetAndroidHardwareBufferPropertiesANDROID( VkDevice device, const struct AHardwareBuffer* buffer, VkAndroidHardwareBufferPropertiesANDROID* pProperties); VKAPI_ATTR VkResult VKAPI_CALL GetMemoryAndroidHardwareBufferANDROID( VkDevice device, const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, struct AHardwareBuffer** pBuffer); #endif // VK_USE_PLATFORM_ANDROID_KHR VKAPI_ATTR void VKAPI_CALL CmdSetSampleLocationsEXT( VkCommandBuffer commandBuffer, const VkSampleLocationsInfoEXT* pSampleLocationsInfo); VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceMultisamplePropertiesEXT( VkPhysicalDevice physicalDevice, VkSampleCountFlagBits samples, VkMultisamplePropertiesEXT* pMultisampleProperties); VKAPI_ATTR VkResult VKAPI_CALL GetImageDrmFormatModifierPropertiesEXT( VkDevice device, VkImage image, VkImageDrmFormatModifierPropertiesEXT* pProperties); VKAPI_ATTR VkResult VKAPI_CALL CreateValidationCacheEXT( VkDevice device, const VkValidationCacheCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkValidationCacheEXT* pValidationCache); VKAPI_ATTR void VKAPI_CALL DestroyValidationCacheEXT( VkDevice device, VkValidationCacheEXT validationCache, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR VkResult VKAPI_CALL MergeValidationCachesEXT( VkDevice device, VkValidationCacheEXT dstCache, uint32_t srcCacheCount, const VkValidationCacheEXT* pSrcCaches); VKAPI_ATTR VkResult VKAPI_CALL GetValidationCacheDataEXT( VkDevice device, VkValidationCacheEXT validationCache, size_t* pDataSize, void* pData); VKAPI_ATTR void VKAPI_CALL CmdBindShadingRateImageNV( VkCommandBuffer commandBuffer, VkImageView imageView, VkImageLayout imageLayout); VKAPI_ATTR void VKAPI_CALL CmdSetViewportShadingRatePaletteNV( VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkShadingRatePaletteNV* pShadingRatePalettes); VKAPI_ATTR void VKAPI_CALL CmdSetCoarseSampleOrderNV( VkCommandBuffer commandBuffer, VkCoarseSampleOrderTypeNV sampleOrderType, uint32_t customSampleOrderCount, const VkCoarseSampleOrderCustomNV* pCustomSampleOrders); VKAPI_ATTR VkResult VKAPI_CALL CreateAccelerationStructureNV( VkDevice device, const VkAccelerationStructureCreateInfoNV* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkAccelerationStructureNV* pAccelerationStructure); VKAPI_ATTR void VKAPI_CALL DestroyAccelerationStructureNV( VkDevice device, VkAccelerationStructureNV accelerationStructure, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR void VKAPI_CALL GetAccelerationStructureMemoryRequirementsNV( VkDevice device, const VkAccelerationStructureMemoryRequirementsInfoNV* pInfo, VkMemoryRequirements2KHR* pMemoryRequirements); VKAPI_ATTR VkResult VKAPI_CALL BindAccelerationStructureMemoryNV( VkDevice device, uint32_t bindInfoCount, const VkBindAccelerationStructureMemoryInfoNV* pBindInfos); VKAPI_ATTR void VKAPI_CALL CmdBuildAccelerationStructureNV( VkCommandBuffer commandBuffer, const VkAccelerationStructureInfoNV* pInfo, VkBuffer instanceData, VkDeviceSize instanceOffset, VkBool32 update, VkAccelerationStructureNV dst, VkAccelerationStructureNV src, VkBuffer scratch, VkDeviceSize scratchOffset); VKAPI_ATTR void VKAPI_CALL CmdCopyAccelerationStructureNV( VkCommandBuffer commandBuffer, VkAccelerationStructureNV dst, VkAccelerationStructureNV src, VkCopyAccelerationStructureModeKHR mode); VKAPI_ATTR void VKAPI_CALL CmdTraceRaysNV( VkCommandBuffer commandBuffer, VkBuffer raygenShaderBindingTableBuffer, VkDeviceSize raygenShaderBindingOffset, VkBuffer missShaderBindingTableBuffer, VkDeviceSize missShaderBindingOffset, VkDeviceSize missShaderBindingStride, VkBuffer hitShaderBindingTableBuffer, VkDeviceSize hitShaderBindingOffset, VkDeviceSize hitShaderBindingStride, VkBuffer callableShaderBindingTableBuffer, VkDeviceSize callableShaderBindingOffset, VkDeviceSize callableShaderBindingStride, uint32_t width, uint32_t height, uint32_t depth); VKAPI_ATTR VkResult VKAPI_CALL CreateRayTracingPipelinesNV( VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkRayTracingPipelineCreateInfoNV* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines); VKAPI_ATTR VkResult VKAPI_CALL GetRayTracingShaderGroupHandlesKHR( VkDevice device, VkPipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, void* pData); VKAPI_ATTR VkResult VKAPI_CALL GetRayTracingShaderGroupHandlesNV( VkDevice device, VkPipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, void* pData); VKAPI_ATTR VkResult VKAPI_CALL GetAccelerationStructureHandleNV( VkDevice device, VkAccelerationStructureNV accelerationStructure, size_t dataSize, void* pData); VKAPI_ATTR void VKAPI_CALL CmdWriteAccelerationStructuresPropertiesNV( VkCommandBuffer commandBuffer, uint32_t accelerationStructureCount, const VkAccelerationStructureNV* pAccelerationStructures, VkQueryType queryType, VkQueryPool queryPool, uint32_t firstQuery); VKAPI_ATTR VkResult VKAPI_CALL CompileDeferredNV( VkDevice device, VkPipeline pipeline, uint32_t shader); VKAPI_ATTR VkResult VKAPI_CALL GetMemoryHostPointerPropertiesEXT( VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, const void* pHostPointer, VkMemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties); VKAPI_ATTR void VKAPI_CALL CmdWriteBufferMarkerAMD( VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkBuffer dstBuffer, VkDeviceSize dstOffset, uint32_t marker); VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceCalibrateableTimeDomainsEXT( VkPhysicalDevice physicalDevice, uint32_t* pTimeDomainCount, VkTimeDomainEXT* pTimeDomains); VKAPI_ATTR VkResult VKAPI_CALL GetCalibratedTimestampsEXT( VkDevice device, uint32_t timestampCount, const VkCalibratedTimestampInfoEXT* pTimestampInfos, uint64_t* pTimestamps, uint64_t* pMaxDeviation); #ifdef VK_USE_PLATFORM_GGP #endif // VK_USE_PLATFORM_GGP VKAPI_ATTR void VKAPI_CALL CmdDrawMeshTasksNV( VkCommandBuffer commandBuffer, uint32_t taskCount, uint32_t firstTask); VKAPI_ATTR void VKAPI_CALL CmdDrawMeshTasksIndirectNV( VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride); VKAPI_ATTR void VKAPI_CALL CmdDrawMeshTasksIndirectCountNV( VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride); VKAPI_ATTR void VKAPI_CALL CmdSetExclusiveScissorNV( VkCommandBuffer commandBuffer, uint32_t firstExclusiveScissor, uint32_t exclusiveScissorCount, const VkRect2D* pExclusiveScissors); VKAPI_ATTR void VKAPI_CALL CmdSetCheckpointNV( VkCommandBuffer commandBuffer, const void* pCheckpointMarker); VKAPI_ATTR void VKAPI_CALL GetQueueCheckpointDataNV( VkQueue queue, uint32_t* pCheckpointDataCount, VkCheckpointDataNV* pCheckpointData); VKAPI_ATTR VkResult VKAPI_CALL InitializePerformanceApiINTEL( VkDevice device, const VkInitializePerformanceApiInfoINTEL* pInitializeInfo); VKAPI_ATTR void VKAPI_CALL UninitializePerformanceApiINTEL( VkDevice device); VKAPI_ATTR VkResult VKAPI_CALL CmdSetPerformanceMarkerINTEL( VkCommandBuffer commandBuffer, const VkPerformanceMarkerInfoINTEL* pMarkerInfo); VKAPI_ATTR VkResult VKAPI_CALL CmdSetPerformanceStreamMarkerINTEL( VkCommandBuffer commandBuffer, const VkPerformanceStreamMarkerInfoINTEL* pMarkerInfo); VKAPI_ATTR VkResult VKAPI_CALL CmdSetPerformanceOverrideINTEL( VkCommandBuffer commandBuffer, const VkPerformanceOverrideInfoINTEL* pOverrideInfo); VKAPI_ATTR VkResult VKAPI_CALL AcquirePerformanceConfigurationINTEL( VkDevice device, const VkPerformanceConfigurationAcquireInfoINTEL* pAcquireInfo, VkPerformanceConfigurationINTEL* pConfiguration); VKAPI_ATTR VkResult VKAPI_CALL ReleasePerformanceConfigurationINTEL( VkDevice device, VkPerformanceConfigurationINTEL configuration); VKAPI_ATTR VkResult VKAPI_CALL QueueSetPerformanceConfigurationINTEL( VkQueue queue, VkPerformanceConfigurationINTEL configuration); VKAPI_ATTR VkResult VKAPI_CALL GetPerformanceParameterINTEL( VkDevice device, VkPerformanceParameterTypeINTEL parameter, VkPerformanceValueINTEL* pValue); VKAPI_ATTR void VKAPI_CALL SetLocalDimmingAMD( VkDevice device, VkSwapchainKHR swapChain, VkBool32 localDimmingEnable); #ifdef VK_USE_PLATFORM_FUCHSIA VKAPI_ATTR VkResult VKAPI_CALL CreateImagePipeSurfaceFUCHSIA( VkInstance instance, const VkImagePipeSurfaceCreateInfoFUCHSIA* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); #endif // VK_USE_PLATFORM_FUCHSIA #ifdef VK_USE_PLATFORM_METAL_EXT VKAPI_ATTR VkResult VKAPI_CALL CreateMetalSurfaceEXT( VkInstance instance, const VkMetalSurfaceCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); #endif // VK_USE_PLATFORM_METAL_EXT VKAPI_ATTR VkDeviceAddress VKAPI_CALL GetBufferDeviceAddressEXT( VkDevice device, const VkBufferDeviceAddressInfo* pInfo); VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceToolPropertiesEXT( VkPhysicalDevice physicalDevice, uint32_t* pToolCount, VkPhysicalDeviceToolPropertiesEXT* pToolProperties); VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceCooperativeMatrixPropertiesNV( VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkCooperativeMatrixPropertiesNV* pProperties); VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV( VkPhysicalDevice physicalDevice, uint32_t* pCombinationCount, VkFramebufferMixedSamplesCombinationNV* pCombinations); #ifdef VK_USE_PLATFORM_WIN32_KHR VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfacePresentModes2EXT( VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, uint32_t* pPresentModeCount, VkPresentModeKHR* pPresentModes); VKAPI_ATTR VkResult VKAPI_CALL AcquireFullScreenExclusiveModeEXT( VkDevice device, VkSwapchainKHR swapchain); VKAPI_ATTR VkResult VKAPI_CALL ReleaseFullScreenExclusiveModeEXT( VkDevice device, VkSwapchainKHR swapchain); VKAPI_ATTR VkResult VKAPI_CALL GetDeviceGroupSurfacePresentModes2EXT( VkDevice device, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, VkDeviceGroupPresentModeFlagsKHR* pModes); #endif // VK_USE_PLATFORM_WIN32_KHR VKAPI_ATTR VkResult VKAPI_CALL CreateHeadlessSurfaceEXT( VkInstance instance, const VkHeadlessSurfaceCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); VKAPI_ATTR void VKAPI_CALL CmdSetLineStippleEXT( VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, uint16_t lineStipplePattern); VKAPI_ATTR void VKAPI_CALL ResetQueryPoolEXT( VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount); VKAPI_ATTR void VKAPI_CALL CmdSetCullModeEXT( VkCommandBuffer commandBuffer, VkCullModeFlags cullMode); VKAPI_ATTR void VKAPI_CALL CmdSetFrontFaceEXT( VkCommandBuffer commandBuffer, VkFrontFace frontFace); VKAPI_ATTR void VKAPI_CALL CmdSetPrimitiveTopologyEXT( VkCommandBuffer commandBuffer, VkPrimitiveTopology primitiveTopology); VKAPI_ATTR void VKAPI_CALL CmdSetViewportWithCountEXT( VkCommandBuffer commandBuffer, uint32_t viewportCount, const VkViewport* pViewports); VKAPI_ATTR void VKAPI_CALL CmdSetScissorWithCountEXT( VkCommandBuffer commandBuffer, uint32_t scissorCount, const VkRect2D* pScissors); VKAPI_ATTR void VKAPI_CALL CmdBindVertexBuffers2EXT( VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets, const VkDeviceSize* pSizes, const VkDeviceSize* pStrides); VKAPI_ATTR void VKAPI_CALL CmdSetDepthTestEnableEXT( VkCommandBuffer commandBuffer, VkBool32 depthTestEnable); VKAPI_ATTR void VKAPI_CALL CmdSetDepthWriteEnableEXT( VkCommandBuffer commandBuffer, VkBool32 depthWriteEnable); VKAPI_ATTR void VKAPI_CALL CmdSetDepthCompareOpEXT( VkCommandBuffer commandBuffer, VkCompareOp depthCompareOp); VKAPI_ATTR void VKAPI_CALL CmdSetDepthBoundsTestEnableEXT( VkCommandBuffer commandBuffer, VkBool32 depthBoundsTestEnable); VKAPI_ATTR void VKAPI_CALL CmdSetStencilTestEnableEXT( VkCommandBuffer commandBuffer, VkBool32 stencilTestEnable); VKAPI_ATTR void VKAPI_CALL CmdSetStencilOpEXT( VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, VkStencilOp failOp, VkStencilOp passOp, VkStencilOp depthFailOp, VkCompareOp compareOp); VKAPI_ATTR void VKAPI_CALL GetGeneratedCommandsMemoryRequirementsNV( VkDevice device, const VkGeneratedCommandsMemoryRequirementsInfoNV* pInfo, VkMemoryRequirements2* pMemoryRequirements); VKAPI_ATTR void VKAPI_CALL CmdPreprocessGeneratedCommandsNV( VkCommandBuffer commandBuffer, const VkGeneratedCommandsInfoNV* pGeneratedCommandsInfo); VKAPI_ATTR void VKAPI_CALL CmdExecuteGeneratedCommandsNV( VkCommandBuffer commandBuffer, VkBool32 isPreprocessed, const VkGeneratedCommandsInfoNV* pGeneratedCommandsInfo); VKAPI_ATTR void VKAPI_CALL CmdBindPipelineShaderGroupNV( VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline, uint32_t groupIndex); VKAPI_ATTR VkResult VKAPI_CALL CreateIndirectCommandsLayoutNV( VkDevice device, const VkIndirectCommandsLayoutCreateInfoNV* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkIndirectCommandsLayoutNV* pIndirectCommandsLayout); VKAPI_ATTR void VKAPI_CALL DestroyIndirectCommandsLayoutNV( VkDevice device, VkIndirectCommandsLayoutNV indirectCommandsLayout, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR VkResult VKAPI_CALL CreatePrivateDataSlotEXT( VkDevice device, const VkPrivateDataSlotCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPrivateDataSlotEXT* pPrivateDataSlot); VKAPI_ATTR void VKAPI_CALL DestroyPrivateDataSlotEXT( VkDevice device, VkPrivateDataSlotEXT privateDataSlot, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR VkResult VKAPI_CALL SetPrivateDataEXT( VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlotEXT privateDataSlot, uint64_t data); VKAPI_ATTR void VKAPI_CALL GetPrivateDataEXT( VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlotEXT privateDataSlot, uint64_t* pData); VKAPI_ATTR void VKAPI_CALL CmdSetFragmentShadingRateEnumNV( VkCommandBuffer commandBuffer, VkFragmentShadingRateNV shadingRate, const VkFragmentShadingRateCombinerOpKHR combinerOps[2]); #ifdef VK_USE_PLATFORM_DIRECTFB_EXT VKAPI_ATTR VkResult VKAPI_CALL CreateDirectFBSurfaceEXT( VkInstance instance, const VkDirectFBSurfaceCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); VKAPI_ATTR VkBool32 VKAPI_CALL GetPhysicalDeviceDirectFBPresentationSupportEXT( VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, IDirectFB* dfb); #endif // VK_USE_PLATFORM_DIRECTFB_EXT VKAPI_ATTR VkResult VKAPI_CALL CreateAccelerationStructureKHR( VkDevice device, const VkAccelerationStructureCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkAccelerationStructureKHR* pAccelerationStructure); VKAPI_ATTR void VKAPI_CALL DestroyAccelerationStructureKHR( VkDevice device, VkAccelerationStructureKHR accelerationStructure, const VkAllocationCallbacks* pAllocator); VKAPI_ATTR void VKAPI_CALL CmdBuildAccelerationStructuresKHR( VkCommandBuffer commandBuffer, uint32_t infoCount, const VkAccelerationStructureBuildGeometryInfoKHR* pInfos, const VkAccelerationStructureBuildRangeInfoKHR* const* ppBuildRangeInfos); VKAPI_ATTR void VKAPI_CALL CmdBuildAccelerationStructuresIndirectKHR( VkCommandBuffer commandBuffer, uint32_t infoCount, const VkAccelerationStructureBuildGeometryInfoKHR* pInfos, const VkDeviceAddress* pIndirectDeviceAddresses, const uint32_t* pIndirectStrides, const uint32_t* const* ppMaxPrimitiveCounts); VKAPI_ATTR VkResult VKAPI_CALL BuildAccelerationStructuresKHR( VkDevice device, VkDeferredOperationKHR deferredOperation, uint32_t infoCount, const VkAccelerationStructureBuildGeometryInfoKHR* pInfos, const VkAccelerationStructureBuildRangeInfoKHR* const* ppBuildRangeInfos); VKAPI_ATTR VkResult VKAPI_CALL CopyAccelerationStructureKHR( VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyAccelerationStructureInfoKHR* pInfo); VKAPI_ATTR VkResult VKAPI_CALL CopyAccelerationStructureToMemoryKHR( VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyAccelerationStructureToMemoryInfoKHR* pInfo); VKAPI_ATTR VkResult VKAPI_CALL CopyMemoryToAccelerationStructureKHR( VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyMemoryToAccelerationStructureInfoKHR* pInfo); VKAPI_ATTR VkResult VKAPI_CALL WriteAccelerationStructuresPropertiesKHR( VkDevice device, uint32_t accelerationStructureCount, const VkAccelerationStructureKHR* pAccelerationStructures, VkQueryType queryType, size_t dataSize, void* pData, size_t stride); VKAPI_ATTR void VKAPI_CALL CmdCopyAccelerationStructureKHR( VkCommandBuffer commandBuffer, const VkCopyAccelerationStructureInfoKHR* pInfo); VKAPI_ATTR void VKAPI_CALL CmdCopyAccelerationStructureToMemoryKHR( VkCommandBuffer commandBuffer, const VkCopyAccelerationStructureToMemoryInfoKHR* pInfo); VKAPI_ATTR void VKAPI_CALL CmdCopyMemoryToAccelerationStructureKHR( VkCommandBuffer commandBuffer, const VkCopyMemoryToAccelerationStructureInfoKHR* pInfo); VKAPI_ATTR VkDeviceAddress VKAPI_CALL GetAccelerationStructureDeviceAddressKHR( VkDevice device, const VkAccelerationStructureDeviceAddressInfoKHR* pInfo); VKAPI_ATTR void VKAPI_CALL CmdWriteAccelerationStructuresPropertiesKHR( VkCommandBuffer commandBuffer, uint32_t accelerationStructureCount, const VkAccelerationStructureKHR* pAccelerationStructures, VkQueryType queryType, VkQueryPool queryPool, uint32_t firstQuery); VKAPI_ATTR void VKAPI_CALL GetDeviceAccelerationStructureCompatibilityKHR( VkDevice device, const VkAccelerationStructureVersionInfoKHR* pVersionInfo, VkAccelerationStructureCompatibilityKHR* pCompatibility); VKAPI_ATTR void VKAPI_CALL GetAccelerationStructureBuildSizesKHR( VkDevice device, VkAccelerationStructureBuildTypeKHR buildType, const VkAccelerationStructureBuildGeometryInfoKHR* pBuildInfo, const uint32_t* pMaxPrimitiveCounts, VkAccelerationStructureBuildSizesInfoKHR* pSizeInfo); VKAPI_ATTR void VKAPI_CALL CmdTraceRaysKHR( VkCommandBuffer commandBuffer, const VkStridedDeviceAddressRegionKHR* pRaygenShaderBindingTable, const VkStridedDeviceAddressRegionKHR* pMissShaderBindingTable, const VkStridedDeviceAddressRegionKHR* pHitShaderBindingTable, const VkStridedDeviceAddressRegionKHR* pCallableShaderBindingTable, uint32_t width, uint32_t height, uint32_t depth); VKAPI_ATTR VkResult VKAPI_CALL CreateRayTracingPipelinesKHR( VkDevice device, VkDeferredOperationKHR deferredOperation, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkRayTracingPipelineCreateInfoKHR* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines); VKAPI_ATTR VkResult VKAPI_CALL GetRayTracingCaptureReplayShaderGroupHandlesKHR( VkDevice device, VkPipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, void* pData); VKAPI_ATTR void VKAPI_CALL CmdTraceRaysIndirectKHR( VkCommandBuffer commandBuffer, const VkStridedDeviceAddressRegionKHR* pRaygenShaderBindingTable, const VkStridedDeviceAddressRegionKHR* pMissShaderBindingTable, const VkStridedDeviceAddressRegionKHR* pHitShaderBindingTable, const VkStridedDeviceAddressRegionKHR* pCallableShaderBindingTable, VkDeviceAddress indirectDeviceAddress); VKAPI_ATTR VkDeviceSize VKAPI_CALL GetRayTracingShaderGroupStackSizeKHR( VkDevice device, VkPipeline pipeline, uint32_t group, VkShaderGroupShaderKHR groupShader); VKAPI_ATTR void VKAPI_CALL CmdSetRayTracingPipelineStackSizeKHR( VkCommandBuffer commandBuffer, uint32_t pipelineStackSize); // Layer object type identifiers enum LayerObjectTypeId { LayerObjectTypeInstance, // Container for an instance dispatch object LayerObjectTypeDevice, // Container for a device dispatch object LayerObjectTypeThreading, // Instance or device threading layer object LayerObjectTypeParameterValidation, // Instance or device parameter validation layer object LayerObjectTypeObjectTracker, // Instance or device object tracker layer object LayerObjectTypeCoreValidation, // Instance or device core validation layer object LayerObjectTypeBestPractices, // Instance or device best practices layer object LayerObjectTypeGpuAssisted, // Instance or device gpu assisted validation layer object LayerObjectTypeDebugPrintf, // Instance or device shader debug printf layer object LayerObjectTypeCommandCounter, // Command Counter validation object, child of corechecks LayerObjectTypeSyncValidation, // Instance or device synchronization validation layer object LayerObjectTypeMaxEnum, // Max enum count }; struct TEMPLATE_STATE { VkDescriptorUpdateTemplate desc_update_template; safe_VkDescriptorUpdateTemplateCreateInfo create_info; bool destroyed; TEMPLATE_STATE(VkDescriptorUpdateTemplate update_template, safe_VkDescriptorUpdateTemplateCreateInfo *pCreateInfo) : desc_update_template(update_template), create_info(*pCreateInfo), destroyed(false) {} }; class LAYER_PHYS_DEV_PROPERTIES { public: VkPhysicalDeviceProperties properties; std::vector<VkQueueFamilyProperties> queue_family_properties; }; typedef enum ValidationCheckDisables { VALIDATION_CHECK_DISABLE_COMMAND_BUFFER_STATE, VALIDATION_CHECK_DISABLE_OBJECT_IN_USE, VALIDATION_CHECK_DISABLE_IDLE_DESCRIPTOR_SET, VALIDATION_CHECK_DISABLE_PUSH_CONSTANT_RANGE, VALIDATION_CHECK_DISABLE_QUERY_VALIDATION, VALIDATION_CHECK_DISABLE_IMAGE_LAYOUT_VALIDATION, } ValidationCheckDisables; typedef enum ValidationCheckEnables { VALIDATION_CHECK_ENABLE_VENDOR_SPECIFIC_ARM, VALIDATION_CHECK_ENABLE_VENDOR_SPECIFIC_ALL, } ValidationCheckEnables; typedef enum VkValidationFeatureEnable { VK_VALIDATION_FEATURE_ENABLE_SYNCHRONIZATION_VALIDATION, } VkValidationFeatureEnable; // CHECK_DISABLED and CHECK_ENABLED vectors are containers for bools that can opt in or out of specific classes of validation // checks. Enum values can be specified via the vk_layer_settings.txt config file or at CreateInstance time via the // VK_EXT_validation_features extension that can selectively disable or enable checks. typedef enum DisableFlags { command_buffer_state, object_in_use, idle_descriptor_set, push_constant_range, query_validation, image_layout_validation, object_tracking, core_checks, thread_safety, stateless_checks, handle_wrapping, shader_validation, // Insert new disables above this line kMaxDisableFlags, } DisableFlags; typedef enum EnableFlags { gpu_validation, gpu_validation_reserve_binding_slot, best_practices, vendor_specific_arm, debug_printf, sync_validation, // Insert new enables above this line kMaxEnableFlags, } EnableFlags; typedef std::array<bool, kMaxDisableFlags> CHECK_DISABLED; typedef std::array<bool, kMaxEnableFlags> CHECK_ENABLED; // Layer chassis validation object base class definition class ValidationObject { public: uint32_t api_version; debug_report_data* report_data = nullptr; VkLayerInstanceDispatchTable instance_dispatch_table; VkLayerDispatchTable device_dispatch_table; InstanceExtensions instance_extensions; DeviceExtensions device_extensions = {}; CHECK_DISABLED disabled = {}; CHECK_ENABLED enabled = {}; VkInstance instance = VK_NULL_HANDLE; VkPhysicalDevice physical_device = VK_NULL_HANDLE; VkDevice device = VK_NULL_HANDLE; LAYER_PHYS_DEV_PROPERTIES phys_dev_properties = {}; std::vector<ValidationObject*> object_dispatch; LayerObjectTypeId container_type; std::string layer_name = "CHASSIS"; // Constructor ValidationObject(){}; // Destructor virtual ~ValidationObject() {}; ReadWriteLock validation_object_mutex; virtual read_lock_guard_t read_lock() { return read_lock_guard_t(validation_object_mutex); } virtual write_lock_guard_t write_lock() { return write_lock_guard_t(validation_object_mutex); } void RegisterValidationObject(bool vo_enabled, uint32_t instance_api_version, debug_report_data* instance_report_data, std::vector<ValidationObject*> &dispatch_list) { if (vo_enabled) { api_version = instance_api_version; report_data = instance_report_data; dispatch_list.emplace_back(this); } } void FinalizeInstanceValidationObject(ValidationObject *framework) { instance_dispatch_table = framework->instance_dispatch_table; enabled = framework->enabled; disabled = framework->disabled; } virtual void InitDeviceValidationObject(bool add_obj, ValidationObject *inst_obj, ValidationObject *dev_obj) { if (add_obj) { dev_obj->object_dispatch.emplace_back(this); device = dev_obj->device; physical_device = dev_obj->physical_device; instance = inst_obj->instance; report_data = inst_obj->report_data; device_dispatch_table = dev_obj->device_dispatch_table; api_version = dev_obj->api_version; disabled = inst_obj->disabled; enabled = inst_obj->enabled; instance_dispatch_table = inst_obj->instance_dispatch_table; instance_extensions = inst_obj->instance_extensions; device_extensions = dev_obj->device_extensions; } } ValidationObject* GetValidationObject(std::vector<ValidationObject*>& object_dispatch, LayerObjectTypeId object_type) { for (auto validation_object : object_dispatch) { if (validation_object->container_type == object_type) { return validation_object; } } return nullptr; }; // Debug Logging Helpers bool LogError(const LogObjectList &objects, const std::string &vuid_text, const char *format, ...) const { std::unique_lock<std::mutex> lock(report_data->debug_output_mutex); // Avoid logging cost if msg is to be ignored if (!(report_data->active_severities & VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT) || !(report_data->active_types & VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT)) { return false; } va_list argptr; va_start(argptr, format); char *str; if (-1 == vasprintf(&str, format, argptr)) { str = nullptr; } va_end(argptr); return LogMsgLocked(report_data, kErrorBit, objects, vuid_text, str); }; template <typename HANDLE_T> bool LogError(HANDLE_T src_object, const std::string &vuid_text, const char *format, ...) const { std::unique_lock<std::mutex> lock(report_data->debug_output_mutex); // Avoid logging cost if msg is to be ignored if (!(report_data->active_severities & VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT) || !(report_data->active_types & VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT)) { return false; } va_list argptr; va_start(argptr, format); char *str; if (-1 == vasprintf(&str, format, argptr)) { str = nullptr; } va_end(argptr); LogObjectList single_object(src_object); return LogMsgLocked(report_data, kErrorBit, single_object, vuid_text, str); }; bool LogWarning(const LogObjectList &objects, const std::string &vuid_text, const char *format, ...) const { std::unique_lock<std::mutex> lock(report_data->debug_output_mutex); // Avoid logging cost if msg is to be ignored if (!(report_data->active_severities & VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT) || !(report_data->active_types & VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT)) { return false; } va_list argptr; va_start(argptr, format); char *str; if (-1 == vasprintf(&str, format, argptr)) { str = nullptr; } va_end(argptr); return LogMsgLocked(report_data, kWarningBit, objects, vuid_text, str); }; template <typename HANDLE_T> bool LogWarning(HANDLE_T src_object, const std::string &vuid_text, const char *format, ...) const { std::unique_lock<std::mutex> lock(report_data->debug_output_mutex); // Avoid logging cost if msg is to be ignored if (!(report_data->active_severities & VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT) || !(report_data->active_types & VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT)) { return false; } va_list argptr; va_start(argptr, format); char *str; if (-1 == vasprintf(&str, format, argptr)) { str = nullptr; } va_end(argptr); LogObjectList single_object(src_object); return LogMsgLocked(report_data, kWarningBit, single_object, vuid_text, str); }; bool LogPerformanceWarning(const LogObjectList &objects, const std::string &vuid_text, const char *format, ...) const { std::unique_lock<std::mutex> lock(report_data->debug_output_mutex); // Avoid logging cost if msg is to be ignored if (!(report_data->active_severities & VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT) || !(report_data->active_types & VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT)) { return false; } va_list argptr; va_start(argptr, format); char *str; if (-1 == vasprintf(&str, format, argptr)) { str = nullptr; } va_end(argptr); return LogMsgLocked(report_data, kPerformanceWarningBit, objects, vuid_text, str); }; template <typename HANDLE_T> bool LogPerformanceWarning(HANDLE_T src_object, const std::string &vuid_text, const char *format, ...) const { std::unique_lock<std::mutex> lock(report_data->debug_output_mutex); // Avoid logging cost if msg is to be ignored if (!(report_data->active_severities & VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT) || !(report_data->active_types & VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT)) { return false; } va_list argptr; va_start(argptr, format); char *str; if (-1 == vasprintf(&str, format, argptr)) { str = nullptr; } va_end(argptr); LogObjectList single_object(src_object); return LogMsgLocked(report_data, kPerformanceWarningBit, single_object, vuid_text, str); }; bool LogInfo(const LogObjectList &objects, const std::string &vuid_text, const char *format, ...) const { std::unique_lock<std::mutex> lock(report_data->debug_output_mutex); // Avoid logging cost if msg is to be ignored if (!(report_data->active_severities & VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT) || !(report_data->active_types & VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT)) { return false; } va_list argptr; va_start(argptr, format); char *str; if (-1 == vasprintf(&str, format, argptr)) { str = nullptr; } va_end(argptr); return LogMsgLocked(report_data, kInformationBit, objects, vuid_text, str); }; template <typename HANDLE_T> bool LogInfo(HANDLE_T src_object, const std::string &vuid_text, const char *format, ...) const { std::unique_lock<std::mutex> lock(report_data->debug_output_mutex); // Avoid logging cost if msg is to be ignored if (!(report_data->active_severities & VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT) || !(report_data->active_types & VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT)) { return false; } va_list argptr; va_start(argptr, format); char *str; if (-1 == vasprintf(&str, format, argptr)) { str = nullptr; } va_end(argptr); LogObjectList single_object(src_object); return LogMsgLocked(report_data, kInformationBit, single_object, vuid_text, str); }; // Handle Wrapping Data // Reverse map display handles vl_concurrent_unordered_map<VkDisplayKHR, uint64_t, 0> display_id_reverse_mapping; // Wrapping Descriptor Template Update structures requires access to the template createinfo structs std::unordered_map<uint64_t, std::unique_ptr<TEMPLATE_STATE>> desc_template_createinfo_map; struct SubpassesUsageStates { std::unordered_set<uint32_t> subpasses_using_color_attachment; std::unordered_set<uint32_t> subpasses_using_depthstencil_attachment; }; // Uses unwrapped handles std::unordered_map<VkRenderPass, SubpassesUsageStates> renderpasses_states; // Map of wrapped swapchain handles to arrays of wrapped swapchain image IDs // Each swapchain has an immutable list of wrapped swapchain image IDs -- always return these IDs if they exist std::unordered_map<VkSwapchainKHR, std::vector<VkImage>> swapchain_wrapped_image_handle_map; // Map of wrapped descriptor pools to set of wrapped descriptor sets allocated from each pool std::unordered_map<VkDescriptorPool, std::unordered_set<VkDescriptorSet>> pool_descriptor_sets_map; // Unwrap a handle. template <typename HandleType> HandleType Unwrap(HandleType wrappedHandle) { auto iter = unique_id_mapping.find(reinterpret_cast<uint64_t const &>(wrappedHandle)); if (iter == unique_id_mapping.end()) return (HandleType)0; return (HandleType)iter->second; } // Wrap a newly created handle with a new unique ID, and return the new ID. template <typename HandleType> HandleType WrapNew(HandleType newlyCreatedHandle) { auto unique_id = global_unique_id++; unique_id = HashedUint64::hash(unique_id); unique_id_mapping.insert_or_assign(unique_id, reinterpret_cast<uint64_t const &>(newlyCreatedHandle)); return (HandleType)unique_id; } // Specialized handling for VkDisplayKHR. Adds an entry to enable reverse-lookup. VkDisplayKHR WrapDisplay(VkDisplayKHR newlyCreatedHandle, ValidationObject *map_data) { auto unique_id = global_unique_id++; unique_id = HashedUint64::hash(unique_id); unique_id_mapping.insert_or_assign(unique_id, reinterpret_cast<uint64_t const &>(newlyCreatedHandle)); map_data->display_id_reverse_mapping.insert_or_assign(newlyCreatedHandle, unique_id); return (VkDisplayKHR)unique_id; } // VkDisplayKHR objects don't have a single point of creation, so we need to see if one already exists in the map before // creating another. VkDisplayKHR MaybeWrapDisplay(VkDisplayKHR handle, ValidationObject *map_data) { // See if this display is already known auto it = map_data->display_id_reverse_mapping.find(handle); if (it != map_data->display_id_reverse_mapping.end()) return (VkDisplayKHR)it->second; // Unknown, so wrap return WrapDisplay(handle, map_data); } // Pre/post hook point declarations virtual bool PreCallValidateCreateInstance(const VkInstanceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkInstance* pInstance) const { return false; }; virtual void PreCallRecordCreateInstance(const VkInstanceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkInstance* pInstance) {}; virtual void PostCallRecordCreateInstance(const VkInstanceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkInstance* pInstance, VkResult result) {}; virtual bool PreCallValidateDestroyInstance(VkInstance instance, const VkAllocationCallbacks* pAllocator) const { return false; }; virtual void PreCallRecordDestroyInstance(VkInstance instance, const VkAllocationCallbacks* pAllocator) {}; virtual void PostCallRecordDestroyInstance(VkInstance instance, const VkAllocationCallbacks* pAllocator) {}; virtual bool PreCallValidateEnumeratePhysicalDevices(VkInstance instance, uint32_t* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices) const { return false; }; virtual void PreCallRecordEnumeratePhysicalDevices(VkInstance instance, uint32_t* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices) {}; virtual void PostCallRecordEnumeratePhysicalDevices(VkInstance instance, uint32_t* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices, VkResult result) {}; virtual bool PreCallValidateGetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures* pFeatures) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures* pFeatures) {}; virtual void PostCallRecordGetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures* pFeatures) {}; virtual bool PreCallValidateGetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties* pFormatProperties) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties* pFormatProperties) {}; virtual void PostCallRecordGetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties* pFormatProperties) {}; virtual bool PreCallValidateGetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties* pImageFormatProperties) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties* pImageFormatProperties) {}; virtual void PostCallRecordGetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties* pImageFormatProperties, VkResult result) {}; virtual bool PreCallValidateGetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties* pProperties) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties* pProperties) {}; virtual void PostCallRecordGetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties* pProperties) {}; virtual bool PreCallValidateGetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties* pQueueFamilyProperties) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties* pQueueFamilyProperties) {}; virtual void PostCallRecordGetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties* pQueueFamilyProperties) {}; virtual bool PreCallValidateGetPhysicalDeviceMemoryProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties* pMemoryProperties) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceMemoryProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties* pMemoryProperties) {}; virtual void PostCallRecordGetPhysicalDeviceMemoryProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties* pMemoryProperties) {}; virtual bool PreCallValidateGetInstanceProcAddr(VkInstance instance, const char* pName) const { return false; }; virtual void PreCallRecordGetInstanceProcAddr(VkInstance instance, const char* pName) {}; virtual void PostCallRecordGetInstanceProcAddr(VkInstance instance, const char* pName) {}; virtual bool PreCallValidateGetDeviceProcAddr(VkDevice device, const char* pName) const { return false; }; virtual void PreCallRecordGetDeviceProcAddr(VkDevice device, const char* pName) {}; virtual void PostCallRecordGetDeviceProcAddr(VkDevice device, const char* pName) {}; virtual bool PreCallValidateCreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDevice* pDevice) const { return false; }; virtual void PreCallRecordCreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDevice* pDevice) {}; virtual void PostCallRecordCreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDevice* pDevice, VkResult result) {}; virtual bool PreCallValidateDestroyDevice(VkDevice device, const VkAllocationCallbacks* pAllocator) const { return false; }; virtual void PreCallRecordDestroyDevice(VkDevice device, const VkAllocationCallbacks* pAllocator) {}; virtual void PostCallRecordDestroyDevice(VkDevice device, const VkAllocationCallbacks* pAllocator) {}; virtual bool PreCallValidateEnumerateInstanceExtensionProperties(const char* pLayerName, uint32_t* pPropertyCount, VkExtensionProperties* pProperties) const { return false; }; virtual void PreCallRecordEnumerateInstanceExtensionProperties(const char* pLayerName, uint32_t* pPropertyCount, VkExtensionProperties* pProperties) {}; virtual void PostCallRecordEnumerateInstanceExtensionProperties(const char* pLayerName, uint32_t* pPropertyCount, VkExtensionProperties* pProperties, VkResult result) {}; virtual bool PreCallValidateEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char* pLayerName, uint32_t* pPropertyCount, VkExtensionProperties* pProperties) const { return false; }; virtual void PreCallRecordEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char* pLayerName, uint32_t* pPropertyCount, VkExtensionProperties* pProperties) {}; virtual void PostCallRecordEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char* pLayerName, uint32_t* pPropertyCount, VkExtensionProperties* pProperties, VkResult result) {}; virtual bool PreCallValidateEnumerateInstanceLayerProperties(uint32_t* pPropertyCount, VkLayerProperties* pProperties) const { return false; }; virtual void PreCallRecordEnumerateInstanceLayerProperties(uint32_t* pPropertyCount, VkLayerProperties* pProperties) {}; virtual void PostCallRecordEnumerateInstanceLayerProperties(uint32_t* pPropertyCount, VkLayerProperties* pProperties, VkResult result) {}; virtual bool PreCallValidateEnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkLayerProperties* pProperties) const { return false; }; virtual void PreCallRecordEnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkLayerProperties* pProperties) {}; virtual void PostCallRecordEnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkLayerProperties* pProperties, VkResult result) {}; virtual bool PreCallValidateGetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue* pQueue) const { return false; }; virtual void PreCallRecordGetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue* pQueue) {}; virtual void PostCallRecordGetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue* pQueue) {}; virtual bool PreCallValidateQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits, VkFence fence) const { return false; }; virtual void PreCallRecordQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits, VkFence fence) {}; virtual void PostCallRecordQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits, VkFence fence, VkResult result) {}; virtual bool PreCallValidateQueueWaitIdle(VkQueue queue) const { return false; }; virtual void PreCallRecordQueueWaitIdle(VkQueue queue) {}; virtual void PostCallRecordQueueWaitIdle(VkQueue queue, VkResult result) {}; virtual bool PreCallValidateDeviceWaitIdle(VkDevice device) const { return false; }; virtual void PreCallRecordDeviceWaitIdle(VkDevice device) {}; virtual void PostCallRecordDeviceWaitIdle(VkDevice device, VkResult result) {}; virtual bool PreCallValidateAllocateMemory(VkDevice device, const VkMemoryAllocateInfo* pAllocateInfo, const VkAllocationCallbacks* pAllocator, VkDeviceMemory* pMemory) const { return false; }; virtual void PreCallRecordAllocateMemory(VkDevice device, const VkMemoryAllocateInfo* pAllocateInfo, const VkAllocationCallbacks* pAllocator, VkDeviceMemory* pMemory) {}; virtual void PostCallRecordAllocateMemory(VkDevice device, const VkMemoryAllocateInfo* pAllocateInfo, const VkAllocationCallbacks* pAllocator, VkDeviceMemory* pMemory, VkResult result) {}; virtual bool PreCallValidateFreeMemory(VkDevice device, VkDeviceMemory memory, const VkAllocationCallbacks* pAllocator) const { return false; }; virtual void PreCallRecordFreeMemory(VkDevice device, VkDeviceMemory memory, const VkAllocationCallbacks* pAllocator) {}; virtual void PostCallRecordFreeMemory(VkDevice device, VkDeviceMemory memory, const VkAllocationCallbacks* pAllocator) {}; virtual bool PreCallValidateMapMemory(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void** ppData) const { return false; }; virtual void PreCallRecordMapMemory(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void** ppData) {}; virtual void PostCallRecordMapMemory(VkDevice device, VkDeviceMemory memory, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void** ppData, VkResult result) {}; virtual bool PreCallValidateUnmapMemory(VkDevice device, VkDeviceMemory memory) const { return false; }; virtual void PreCallRecordUnmapMemory(VkDevice device, VkDeviceMemory memory) {}; virtual void PostCallRecordUnmapMemory(VkDevice device, VkDeviceMemory memory) {}; virtual bool PreCallValidateFlushMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges) const { return false; }; virtual void PreCallRecordFlushMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges) {}; virtual void PostCallRecordFlushMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges, VkResult result) {}; virtual bool PreCallValidateInvalidateMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges) const { return false; }; virtual void PreCallRecordInvalidateMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges) {}; virtual void PostCallRecordInvalidateMappedMemoryRanges(VkDevice device, uint32_t memoryRangeCount, const VkMappedMemoryRange* pMemoryRanges, VkResult result) {}; virtual bool PreCallValidateGetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory, VkDeviceSize* pCommittedMemoryInBytes) const { return false; }; virtual void PreCallRecordGetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory, VkDeviceSize* pCommittedMemoryInBytes) {}; virtual void PostCallRecordGetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory, VkDeviceSize* pCommittedMemoryInBytes) {}; virtual bool PreCallValidateBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset) const { return false; }; virtual void PreCallRecordBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset) {}; virtual void PostCallRecordBindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory memory, VkDeviceSize memoryOffset, VkResult result) {}; virtual bool PreCallValidateBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset) const { return false; }; virtual void PreCallRecordBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset) {}; virtual void PostCallRecordBindImageMemory(VkDevice device, VkImage image, VkDeviceMemory memory, VkDeviceSize memoryOffset, VkResult result) {}; virtual bool PreCallValidateGetBufferMemoryRequirements(VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements) const { return false; }; virtual void PreCallRecordGetBufferMemoryRequirements(VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements) {}; virtual void PostCallRecordGetBufferMemoryRequirements(VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements) {}; virtual bool PreCallValidateGetImageMemoryRequirements(VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements) const { return false; }; virtual void PreCallRecordGetImageMemoryRequirements(VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements) {}; virtual void PostCallRecordGetImageMemoryRequirements(VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements) {}; virtual bool PreCallValidateGetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements* pSparseMemoryRequirements) const { return false; }; virtual void PreCallRecordGetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements* pSparseMemoryRequirements) {}; virtual void PostCallRecordGetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements* pSparseMemoryRequirements) {}; virtual bool PreCallValidateGetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t* pPropertyCount, VkSparseImageFormatProperties* pProperties) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t* pPropertyCount, VkSparseImageFormatProperties* pProperties) {}; virtual void PostCallRecordGetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkSampleCountFlagBits samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t* pPropertyCount, VkSparseImageFormatProperties* pProperties) {}; virtual bool PreCallValidateQueueBindSparse(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo* pBindInfo, VkFence fence) const { return false; }; virtual void PreCallRecordQueueBindSparse(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo* pBindInfo, VkFence fence) {}; virtual void PostCallRecordQueueBindSparse(VkQueue queue, uint32_t bindInfoCount, const VkBindSparseInfo* pBindInfo, VkFence fence, VkResult result) {}; virtual bool PreCallValidateCreateFence(VkDevice device, const VkFenceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence) const { return false; }; virtual void PreCallRecordCreateFence(VkDevice device, const VkFenceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence) {}; virtual void PostCallRecordCreateFence(VkDevice device, const VkFenceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence, VkResult result) {}; virtual bool PreCallValidateDestroyFence(VkDevice device, VkFence fence, const VkAllocationCallbacks* pAllocator) const { return false; }; virtual void PreCallRecordDestroyFence(VkDevice device, VkFence fence, const VkAllocationCallbacks* pAllocator) {}; virtual void PostCallRecordDestroyFence(VkDevice device, VkFence fence, const VkAllocationCallbacks* pAllocator) {}; virtual bool PreCallValidateResetFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences) const { return false; }; virtual void PreCallRecordResetFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences) {}; virtual void PostCallRecordResetFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkResult result) {}; virtual bool PreCallValidateGetFenceStatus(VkDevice device, VkFence fence) const { return false; }; virtual void PreCallRecordGetFenceStatus(VkDevice device, VkFence fence) {}; virtual void PostCallRecordGetFenceStatus(VkDevice device, VkFence fence, VkResult result) {}; virtual bool PreCallValidateWaitForFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkBool32 waitAll, uint64_t timeout) const { return false; }; virtual void PreCallRecordWaitForFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkBool32 waitAll, uint64_t timeout) {}; virtual void PostCallRecordWaitForFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkBool32 waitAll, uint64_t timeout, VkResult result) {}; virtual bool PreCallValidateCreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSemaphore* pSemaphore) const { return false; }; virtual void PreCallRecordCreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSemaphore* pSemaphore) {}; virtual void PostCallRecordCreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSemaphore* pSemaphore, VkResult result) {}; virtual bool PreCallValidateDestroySemaphore(VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks* pAllocator) const { return false; }; virtual void PreCallRecordDestroySemaphore(VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks* pAllocator) {}; virtual void PostCallRecordDestroySemaphore(VkDevice device, VkSemaphore semaphore, const VkAllocationCallbacks* pAllocator) {}; virtual bool PreCallValidateCreateEvent(VkDevice device, const VkEventCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkEvent* pEvent) const { return false; }; virtual void PreCallRecordCreateEvent(VkDevice device, const VkEventCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkEvent* pEvent) {}; virtual void PostCallRecordCreateEvent(VkDevice device, const VkEventCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkEvent* pEvent, VkResult result) {}; virtual bool PreCallValidateDestroyEvent(VkDevice device, VkEvent event, const VkAllocationCallbacks* pAllocator) const { return false; }; virtual void PreCallRecordDestroyEvent(VkDevice device, VkEvent event, const VkAllocationCallbacks* pAllocator) {}; virtual void PostCallRecordDestroyEvent(VkDevice device, VkEvent event, const VkAllocationCallbacks* pAllocator) {}; virtual bool PreCallValidateGetEventStatus(VkDevice device, VkEvent event) const { return false; }; virtual void PreCallRecordGetEventStatus(VkDevice device, VkEvent event) {}; virtual void PostCallRecordGetEventStatus(VkDevice device, VkEvent event, VkResult result) {}; virtual bool PreCallValidateSetEvent(VkDevice device, VkEvent event) const { return false; }; virtual void PreCallRecordSetEvent(VkDevice device, VkEvent event) {}; virtual void PostCallRecordSetEvent(VkDevice device, VkEvent event, VkResult result) {}; virtual bool PreCallValidateResetEvent(VkDevice device, VkEvent event) const { return false; }; virtual void PreCallRecordResetEvent(VkDevice device, VkEvent event) {}; virtual void PostCallRecordResetEvent(VkDevice device, VkEvent event, VkResult result) {}; virtual bool PreCallValidateCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkQueryPool* pQueryPool) const { return false; }; virtual void PreCallRecordCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkQueryPool* pQueryPool) {}; virtual void PostCallRecordCreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkQueryPool* pQueryPool, VkResult result) {}; virtual bool PreCallValidateDestroyQueryPool(VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks* pAllocator) const { return false; }; virtual void PreCallRecordDestroyQueryPool(VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks* pAllocator) {}; virtual void PostCallRecordDestroyQueryPool(VkDevice device, VkQueryPool queryPool, const VkAllocationCallbacks* pAllocator) {}; virtual bool PreCallValidateGetQueryPoolResults(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, size_t dataSize, void* pData, VkDeviceSize stride, VkQueryResultFlags flags) const { return false; }; virtual void PreCallRecordGetQueryPoolResults(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, size_t dataSize, void* pData, VkDeviceSize stride, VkQueryResultFlags flags) {}; virtual void PostCallRecordGetQueryPoolResults(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, size_t dataSize, void* pData, VkDeviceSize stride, VkQueryResultFlags flags, VkResult result) {}; virtual bool PreCallValidateCreateBuffer(VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer) const { return false; }; virtual void PreCallRecordCreateBuffer(VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer) {}; virtual void PostCallRecordCreateBuffer(VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer, VkResult result) {}; virtual bool PreCallValidateDestroyBuffer(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator) const { return false; }; virtual void PreCallRecordDestroyBuffer(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator) {}; virtual void PostCallRecordDestroyBuffer(VkDevice device, VkBuffer buffer, const VkAllocationCallbacks* pAllocator) {}; virtual bool PreCallValidateCreateBufferView(VkDevice device, const VkBufferViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBufferView* pView) const { return false; }; virtual void PreCallRecordCreateBufferView(VkDevice device, const VkBufferViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBufferView* pView) {}; virtual void PostCallRecordCreateBufferView(VkDevice device, const VkBufferViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBufferView* pView, VkResult result) {}; virtual bool PreCallValidateDestroyBufferView(VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks* pAllocator) const { return false; }; virtual void PreCallRecordDestroyBufferView(VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks* pAllocator) {}; virtual void PostCallRecordDestroyBufferView(VkDevice device, VkBufferView bufferView, const VkAllocationCallbacks* pAllocator) {}; virtual bool PreCallValidateCreateImage(VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImage* pImage) const { return false; }; virtual void PreCallRecordCreateImage(VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImage* pImage) {}; virtual void PostCallRecordCreateImage(VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImage* pImage, VkResult result) {}; virtual bool PreCallValidateDestroyImage(VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator) const { return false; }; virtual void PreCallRecordDestroyImage(VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator) {}; virtual void PostCallRecordDestroyImage(VkDevice device, VkImage image, const VkAllocationCallbacks* pAllocator) {}; virtual bool PreCallValidateGetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout) const { return false; }; virtual void PreCallRecordGetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout) {}; virtual void PostCallRecordGetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout) {}; virtual bool PreCallValidateCreateImageView(VkDevice device, const VkImageViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImageView* pView) const { return false; }; virtual void PreCallRecordCreateImageView(VkDevice device, const VkImageViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImageView* pView) {}; virtual void PostCallRecordCreateImageView(VkDevice device, const VkImageViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImageView* pView, VkResult result) {}; virtual bool PreCallValidateDestroyImageView(VkDevice device, VkImageView imageView, const VkAllocationCallbacks* pAllocator) const { return false; }; virtual void PreCallRecordDestroyImageView(VkDevice device, VkImageView imageView, const VkAllocationCallbacks* pAllocator) {}; virtual void PostCallRecordDestroyImageView(VkDevice device, VkImageView imageView, const VkAllocationCallbacks* pAllocator) {}; virtual bool PreCallValidateCreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkShaderModule* pShaderModule) const { return false; }; virtual void PreCallRecordCreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkShaderModule* pShaderModule) {}; virtual void PostCallRecordCreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkShaderModule* pShaderModule, VkResult result) {}; virtual bool PreCallValidateDestroyShaderModule(VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks* pAllocator) const { return false; }; virtual void PreCallRecordDestroyShaderModule(VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks* pAllocator) {}; virtual void PostCallRecordDestroyShaderModule(VkDevice device, VkShaderModule shaderModule, const VkAllocationCallbacks* pAllocator) {}; virtual bool PreCallValidateCreatePipelineCache(VkDevice device, const VkPipelineCacheCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineCache* pPipelineCache) const { return false; }; virtual void PreCallRecordCreatePipelineCache(VkDevice device, const VkPipelineCacheCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineCache* pPipelineCache) {}; virtual void PostCallRecordCreatePipelineCache(VkDevice device, const VkPipelineCacheCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineCache* pPipelineCache, VkResult result) {}; virtual bool PreCallValidateDestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks* pAllocator) const { return false; }; virtual void PreCallRecordDestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks* pAllocator) {}; virtual void PostCallRecordDestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache, const VkAllocationCallbacks* pAllocator) {}; virtual bool PreCallValidateGetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, size_t* pDataSize, void* pData) const { return false; }; virtual void PreCallRecordGetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, size_t* pDataSize, void* pData) {}; virtual void PostCallRecordGetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, size_t* pDataSize, void* pData, VkResult result) {}; virtual bool PreCallValidateMergePipelineCaches(VkDevice device, VkPipelineCache dstCache, uint32_t srcCacheCount, const VkPipelineCache* pSrcCaches) const { return false; }; virtual void PreCallRecordMergePipelineCaches(VkDevice device, VkPipelineCache dstCache, uint32_t srcCacheCount, const VkPipelineCache* pSrcCaches) {}; virtual void PostCallRecordMergePipelineCaches(VkDevice device, VkPipelineCache dstCache, uint32_t srcCacheCount, const VkPipelineCache* pSrcCaches, VkResult result) {}; virtual bool PreCallValidateCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkGraphicsPipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines) const { return false; }; virtual void PreCallRecordCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkGraphicsPipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines) {}; virtual void PostCallRecordCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkGraphicsPipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, VkResult result) {}; virtual bool PreCallValidateCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkComputePipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines) const { return false; }; virtual void PreCallRecordCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkComputePipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines) {}; virtual void PostCallRecordCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkComputePipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, VkResult result) {}; virtual bool PreCallValidateDestroyPipeline(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks* pAllocator) const { return false; }; virtual void PreCallRecordDestroyPipeline(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks* pAllocator) {}; virtual void PostCallRecordDestroyPipeline(VkDevice device, VkPipeline pipeline, const VkAllocationCallbacks* pAllocator) {}; virtual bool PreCallValidateCreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineLayout* pPipelineLayout) const { return false; }; virtual void PreCallRecordCreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineLayout* pPipelineLayout) {}; virtual void PostCallRecordCreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineLayout* pPipelineLayout, VkResult result) {}; virtual bool PreCallValidateDestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks* pAllocator) const { return false; }; virtual void PreCallRecordDestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks* pAllocator) {}; virtual void PostCallRecordDestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout, const VkAllocationCallbacks* pAllocator) {}; virtual bool PreCallValidateCreateSampler(VkDevice device, const VkSamplerCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSampler* pSampler) const { return false; }; virtual void PreCallRecordCreateSampler(VkDevice device, const VkSamplerCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSampler* pSampler) {}; virtual void PostCallRecordCreateSampler(VkDevice device, const VkSamplerCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSampler* pSampler, VkResult result) {}; virtual bool PreCallValidateDestroySampler(VkDevice device, VkSampler sampler, const VkAllocationCallbacks* pAllocator) const { return false; }; virtual void PreCallRecordDestroySampler(VkDevice device, VkSampler sampler, const VkAllocationCallbacks* pAllocator) {}; virtual void PostCallRecordDestroySampler(VkDevice device, VkSampler sampler, const VkAllocationCallbacks* pAllocator) {}; virtual bool PreCallValidateCreateDescriptorSetLayout(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorSetLayout* pSetLayout) const { return false; }; virtual void PreCallRecordCreateDescriptorSetLayout(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorSetLayout* pSetLayout) {}; virtual void PostCallRecordCreateDescriptorSetLayout(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorSetLayout* pSetLayout, VkResult result) {}; virtual bool PreCallValidateDestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks* pAllocator) const { return false; }; virtual void PreCallRecordDestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks* pAllocator) {}; virtual void PostCallRecordDestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout, const VkAllocationCallbacks* pAllocator) {}; virtual bool PreCallValidateCreateDescriptorPool(VkDevice device, const VkDescriptorPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorPool* pDescriptorPool) const { return false; }; virtual void PreCallRecordCreateDescriptorPool(VkDevice device, const VkDescriptorPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorPool* pDescriptorPool) {}; virtual void PostCallRecordCreateDescriptorPool(VkDevice device, const VkDescriptorPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorPool* pDescriptorPool, VkResult result) {}; virtual bool PreCallValidateDestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks* pAllocator) const { return false; }; virtual void PreCallRecordDestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks* pAllocator) {}; virtual void PostCallRecordDestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, const VkAllocationCallbacks* pAllocator) {}; virtual bool PreCallValidateResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags) const { return false; }; virtual void PreCallRecordResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags) {}; virtual void PostCallRecordResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorPoolResetFlags flags, VkResult result) {}; virtual bool PreCallValidateAllocateDescriptorSets(VkDevice device, const VkDescriptorSetAllocateInfo* pAllocateInfo, VkDescriptorSet* pDescriptorSets) const { return false; }; virtual void PreCallRecordAllocateDescriptorSets(VkDevice device, const VkDescriptorSetAllocateInfo* pAllocateInfo, VkDescriptorSet* pDescriptorSets) {}; virtual void PostCallRecordAllocateDescriptorSets(VkDevice device, const VkDescriptorSetAllocateInfo* pAllocateInfo, VkDescriptorSet* pDescriptorSets, VkResult result) {}; virtual bool PreCallValidateFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets) const { return false; }; virtual void PreCallRecordFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets) {}; virtual void PostCallRecordFreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets, VkResult result) {}; virtual bool PreCallValidateUpdateDescriptorSets(VkDevice device, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t descriptorCopyCount, const VkCopyDescriptorSet* pDescriptorCopies) const { return false; }; virtual void PreCallRecordUpdateDescriptorSets(VkDevice device, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t descriptorCopyCount, const VkCopyDescriptorSet* pDescriptorCopies) {}; virtual void PostCallRecordUpdateDescriptorSets(VkDevice device, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t descriptorCopyCount, const VkCopyDescriptorSet* pDescriptorCopies) {}; virtual bool PreCallValidateCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFramebuffer* pFramebuffer) const { return false; }; virtual void PreCallRecordCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFramebuffer* pFramebuffer) {}; virtual void PostCallRecordCreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkFramebuffer* pFramebuffer, VkResult result) {}; virtual bool PreCallValidateDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks* pAllocator) const { return false; }; virtual void PreCallRecordDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks* pAllocator) {}; virtual void PostCallRecordDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer, const VkAllocationCallbacks* pAllocator) {}; virtual bool PreCallValidateCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass) const { return false; }; virtual void PreCallRecordCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass) {}; virtual void PostCallRecordCreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass, VkResult result) {}; virtual bool PreCallValidateDestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* pAllocator) const { return false; }; virtual void PreCallRecordDestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* pAllocator) {}; virtual void PostCallRecordDestroyRenderPass(VkDevice device, VkRenderPass renderPass, const VkAllocationCallbacks* pAllocator) {}; virtual bool PreCallValidateGetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity) const { return false; }; virtual void PreCallRecordGetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity) {}; virtual void PostCallRecordGetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity) {}; virtual bool PreCallValidateCreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkCommandPool* pCommandPool) const { return false; }; virtual void PreCallRecordCreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkCommandPool* pCommandPool) {}; virtual void PostCallRecordCreateCommandPool(VkDevice device, const VkCommandPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkCommandPool* pCommandPool, VkResult result) {}; virtual bool PreCallValidateDestroyCommandPool(VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks* pAllocator) const { return false; }; virtual void PreCallRecordDestroyCommandPool(VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks* pAllocator) {}; virtual void PostCallRecordDestroyCommandPool(VkDevice device, VkCommandPool commandPool, const VkAllocationCallbacks* pAllocator) {}; virtual bool PreCallValidateResetCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags) const { return false; }; virtual void PreCallRecordResetCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags) {}; virtual void PostCallRecordResetCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolResetFlags flags, VkResult result) {}; virtual bool PreCallValidateAllocateCommandBuffers(VkDevice device, const VkCommandBufferAllocateInfo* pAllocateInfo, VkCommandBuffer* pCommandBuffers) const { return false; }; virtual void PreCallRecordAllocateCommandBuffers(VkDevice device, const VkCommandBufferAllocateInfo* pAllocateInfo, VkCommandBuffer* pCommandBuffers) {}; virtual void PostCallRecordAllocateCommandBuffers(VkDevice device, const VkCommandBufferAllocateInfo* pAllocateInfo, VkCommandBuffer* pCommandBuffers, VkResult result) {}; virtual bool PreCallValidateFreeCommandBuffers(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, const VkCommandBuffer* pCommandBuffers) const { return false; }; virtual void PreCallRecordFreeCommandBuffers(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, const VkCommandBuffer* pCommandBuffers) {}; virtual void PostCallRecordFreeCommandBuffers(VkDevice device, VkCommandPool commandPool, uint32_t commandBufferCount, const VkCommandBuffer* pCommandBuffers) {}; virtual bool PreCallValidateBeginCommandBuffer(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo* pBeginInfo) const { return false; }; virtual void PreCallRecordBeginCommandBuffer(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo* pBeginInfo) {}; virtual void PostCallRecordBeginCommandBuffer(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo* pBeginInfo, VkResult result) {}; virtual bool PreCallValidateEndCommandBuffer(VkCommandBuffer commandBuffer) const { return false; }; virtual void PreCallRecordEndCommandBuffer(VkCommandBuffer commandBuffer) {}; virtual void PostCallRecordEndCommandBuffer(VkCommandBuffer commandBuffer, VkResult result) {}; virtual bool PreCallValidateResetCommandBuffer(VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags) const { return false; }; virtual void PreCallRecordResetCommandBuffer(VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags) {}; virtual void PostCallRecordResetCommandBuffer(VkCommandBuffer commandBuffer, VkCommandBufferResetFlags flags, VkResult result) {}; virtual bool PreCallValidateCmdBindPipeline(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline) const { return false; }; virtual void PreCallRecordCmdBindPipeline(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline) {}; virtual void PostCallRecordCmdBindPipeline(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline) {}; virtual bool PreCallValidateCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewport* pViewports) const { return false; }; virtual void PreCallRecordCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewport* pViewports) {}; virtual void PostCallRecordCmdSetViewport(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewport* pViewports) {}; virtual bool PreCallValidateCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, const VkRect2D* pScissors) const { return false; }; virtual void PreCallRecordCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, const VkRect2D* pScissors) {}; virtual void PostCallRecordCmdSetScissor(VkCommandBuffer commandBuffer, uint32_t firstScissor, uint32_t scissorCount, const VkRect2D* pScissors) {}; virtual bool PreCallValidateCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth) const { return false; }; virtual void PreCallRecordCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth) {}; virtual void PostCallRecordCmdSetLineWidth(VkCommandBuffer commandBuffer, float lineWidth) {}; virtual bool PreCallValidateCmdSetDepthBias(VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor) const { return false; }; virtual void PreCallRecordCmdSetDepthBias(VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor) {}; virtual void PostCallRecordCmdSetDepthBias(VkCommandBuffer commandBuffer, float depthBiasConstantFactor, float depthBiasClamp, float depthBiasSlopeFactor) {}; virtual bool PreCallValidateCmdSetBlendConstants(VkCommandBuffer commandBuffer, const float blendConstants[4]) const { return false; }; virtual void PreCallRecordCmdSetBlendConstants(VkCommandBuffer commandBuffer, const float blendConstants[4]) {}; virtual void PostCallRecordCmdSetBlendConstants(VkCommandBuffer commandBuffer, const float blendConstants[4]) {}; virtual bool PreCallValidateCmdSetDepthBounds(VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds) const { return false; }; virtual void PreCallRecordCmdSetDepthBounds(VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds) {}; virtual void PostCallRecordCmdSetDepthBounds(VkCommandBuffer commandBuffer, float minDepthBounds, float maxDepthBounds) {}; virtual bool PreCallValidateCmdSetStencilCompareMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t compareMask) const { return false; }; virtual void PreCallRecordCmdSetStencilCompareMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t compareMask) {}; virtual void PostCallRecordCmdSetStencilCompareMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t compareMask) {}; virtual bool PreCallValidateCmdSetStencilWriteMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t writeMask) const { return false; }; virtual void PreCallRecordCmdSetStencilWriteMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t writeMask) {}; virtual void PostCallRecordCmdSetStencilWriteMask(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t writeMask) {}; virtual bool PreCallValidateCmdSetStencilReference(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t reference) const { return false; }; virtual void PreCallRecordCmdSetStencilReference(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t reference) {}; virtual void PostCallRecordCmdSetStencilReference(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, uint32_t reference) {}; virtual bool PreCallValidateCmdBindDescriptorSets(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets) const { return false; }; virtual void PreCallRecordCmdBindDescriptorSets(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets) {}; virtual void PostCallRecordCmdBindDescriptorSets(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t descriptorSetCount, const VkDescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets) {}; virtual bool PreCallValidateCmdBindIndexBuffer(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType) const { return false; }; virtual void PreCallRecordCmdBindIndexBuffer(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType) {}; virtual void PostCallRecordCmdBindIndexBuffer(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType) {}; virtual bool PreCallValidateCmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets) const { return false; }; virtual void PreCallRecordCmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets) {}; virtual void PostCallRecordCmdBindVertexBuffers(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets) {}; virtual bool PreCallValidateCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) const { return false; }; virtual void PreCallRecordCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) {}; virtual void PostCallRecordCmdDraw(VkCommandBuffer commandBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) {}; virtual bool PreCallValidateCmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance) const { return false; }; virtual void PreCallRecordCmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance) {}; virtual void PostCallRecordCmdDrawIndexed(VkCommandBuffer commandBuffer, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance) {}; virtual bool PreCallValidateCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride) const { return false; }; virtual void PreCallRecordCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride) {}; virtual void PostCallRecordCmdDrawIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride) {}; virtual bool PreCallValidateCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride) const { return false; }; virtual void PreCallRecordCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride) {}; virtual void PostCallRecordCmdDrawIndexedIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride) {}; virtual bool PreCallValidateCmdDispatch(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ) const { return false; }; virtual void PreCallRecordCmdDispatch(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ) {}; virtual void PostCallRecordCmdDispatch(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ) {}; virtual bool PreCallValidateCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset) const { return false; }; virtual void PreCallRecordCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset) {}; virtual void PostCallRecordCmdDispatchIndirect(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset) {}; virtual bool PreCallValidateCmdCopyBuffer(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferCopy* pRegions) const { return false; }; virtual void PreCallRecordCmdCopyBuffer(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferCopy* pRegions) {}; virtual void PostCallRecordCmdCopyBuffer(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferCopy* pRegions) {}; virtual bool PreCallValidateCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageCopy* pRegions) const { return false; }; virtual void PreCallRecordCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageCopy* pRegions) {}; virtual void PostCallRecordCmdCopyImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageCopy* pRegions) {}; virtual bool PreCallValidateCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageBlit* pRegions, VkFilter filter) const { return false; }; virtual void PreCallRecordCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageBlit* pRegions, VkFilter filter) {}; virtual void PostCallRecordCmdBlitImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageBlit* pRegions, VkFilter filter) {}; virtual bool PreCallValidateCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkBufferImageCopy* pRegions) const { return false; }; virtual void PreCallRecordCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkBufferImageCopy* pRegions) {}; virtual void PostCallRecordCmdCopyBufferToImage(VkCommandBuffer commandBuffer, VkBuffer srcBuffer, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkBufferImageCopy* pRegions) {}; virtual bool PreCallValidateCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferImageCopy* pRegions) const { return false; }; virtual void PreCallRecordCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferImageCopy* pRegions) {}; virtual void PostCallRecordCmdCopyImageToBuffer(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkBuffer dstBuffer, uint32_t regionCount, const VkBufferImageCopy* pRegions) {}; virtual bool PreCallValidateCmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize dataSize, const void* pData) const { return false; }; virtual void PreCallRecordCmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize dataSize, const void* pData) {}; virtual void PostCallRecordCmdUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize dataSize, const void* pData) {}; virtual bool PreCallValidateCmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data) const { return false; }; virtual void PreCallRecordCmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data) {}; virtual void PostCallRecordCmdFillBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize size, uint32_t data) {}; virtual bool PreCallValidateCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rangeCount, const VkImageSubresourceRange* pRanges) const { return false; }; virtual void PreCallRecordCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rangeCount, const VkImageSubresourceRange* pRanges) {}; virtual void PostCallRecordCmdClearColorImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rangeCount, const VkImageSubresourceRange* pRanges) {}; virtual bool PreCallValidateCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges) const { return false; }; virtual void PreCallRecordCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges) {}; virtual void PostCallRecordCmdClearDepthStencilImage(VkCommandBuffer commandBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges) {}; virtual bool PreCallValidateCmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount, const VkClearAttachment* pAttachments, uint32_t rectCount, const VkClearRect* pRects) const { return false; }; virtual void PreCallRecordCmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount, const VkClearAttachment* pAttachments, uint32_t rectCount, const VkClearRect* pRects) {}; virtual void PostCallRecordCmdClearAttachments(VkCommandBuffer commandBuffer, uint32_t attachmentCount, const VkClearAttachment* pAttachments, uint32_t rectCount, const VkClearRect* pRects) {}; virtual bool PreCallValidateCmdResolveImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageResolve* pRegions) const { return false; }; virtual void PreCallRecordCmdResolveImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageResolve* pRegions) {}; virtual void PostCallRecordCmdResolveImage(VkCommandBuffer commandBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage dstImage, VkImageLayout dstImageLayout, uint32_t regionCount, const VkImageResolve* pRegions) {}; virtual bool PreCallValidateCmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask) const { return false; }; virtual void PreCallRecordCmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask) {}; virtual void PostCallRecordCmdSetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask) {}; virtual bool PreCallValidateCmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask) const { return false; }; virtual void PreCallRecordCmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask) {}; virtual void PostCallRecordCmdResetEvent(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags stageMask) {}; virtual bool PreCallValidateCmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent* pEvents, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers) const { return false; }; virtual void PreCallRecordCmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent* pEvents, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers) {}; virtual void PostCallRecordCmdWaitEvents(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent* pEvents, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers) {}; virtual bool PreCallValidateCmdPipelineBarrier(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers) const { return false; }; virtual void PreCallRecordCmdPipelineBarrier(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers) {}; virtual void PostCallRecordCmdPipelineBarrier(VkCommandBuffer commandBuffer, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, uint32_t memoryBarrierCount, const VkMemoryBarrier* pMemoryBarriers, uint32_t bufferMemoryBarrierCount, const VkBufferMemoryBarrier* pBufferMemoryBarriers, uint32_t imageMemoryBarrierCount, const VkImageMemoryBarrier* pImageMemoryBarriers) {}; virtual bool PreCallValidateCmdBeginQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags) const { return false; }; virtual void PreCallRecordCmdBeginQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags) {}; virtual void PostCallRecordCmdBeginQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags) {}; virtual bool PreCallValidateCmdEndQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query) const { return false; }; virtual void PreCallRecordCmdEndQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query) {}; virtual void PostCallRecordCmdEndQuery(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query) {}; virtual bool PreCallValidateCmdResetQueryPool(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount) const { return false; }; virtual void PreCallRecordCmdResetQueryPool(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount) {}; virtual void PostCallRecordCmdResetQueryPool(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount) {}; virtual bool PreCallValidateCmdWriteTimestamp(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, uint32_t query) const { return false; }; virtual void PreCallRecordCmdWriteTimestamp(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, uint32_t query) {}; virtual void PostCallRecordCmdWriteTimestamp(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkQueryPool queryPool, uint32_t query) {}; virtual bool PreCallValidateCmdCopyQueryPoolResults(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize stride, VkQueryResultFlags flags) const { return false; }; virtual void PreCallRecordCmdCopyQueryPoolResults(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize stride, VkQueryResultFlags flags) {}; virtual void PostCallRecordCmdCopyQueryPoolResults(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize stride, VkQueryResultFlags flags) {}; virtual bool PreCallValidateCmdPushConstants(VkCommandBuffer commandBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size, const void* pValues) const { return false; }; virtual void PreCallRecordCmdPushConstants(VkCommandBuffer commandBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size, const void* pValues) {}; virtual void PostCallRecordCmdPushConstants(VkCommandBuffer commandBuffer, VkPipelineLayout layout, VkShaderStageFlags stageFlags, uint32_t offset, uint32_t size, const void* pValues) {}; virtual bool PreCallValidateCmdBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, VkSubpassContents contents) const { return false; }; virtual void PreCallRecordCmdBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, VkSubpassContents contents) {}; virtual void PostCallRecordCmdBeginRenderPass(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, VkSubpassContents contents) {}; virtual bool PreCallValidateCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents) const { return false; }; virtual void PreCallRecordCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents) {}; virtual void PostCallRecordCmdNextSubpass(VkCommandBuffer commandBuffer, VkSubpassContents contents) {}; virtual bool PreCallValidateCmdEndRenderPass(VkCommandBuffer commandBuffer) const { return false; }; virtual void PreCallRecordCmdEndRenderPass(VkCommandBuffer commandBuffer) {}; virtual void PostCallRecordCmdEndRenderPass(VkCommandBuffer commandBuffer) {}; virtual bool PreCallValidateCmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBufferCount, const VkCommandBuffer* pCommandBuffers) const { return false; }; virtual void PreCallRecordCmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBufferCount, const VkCommandBuffer* pCommandBuffers) {}; virtual void PostCallRecordCmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBufferCount, const VkCommandBuffer* pCommandBuffers) {}; virtual bool PreCallValidateBindBufferMemory2(VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo* pBindInfos) const { return false; }; virtual void PreCallRecordBindBufferMemory2(VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo* pBindInfos) {}; virtual void PostCallRecordBindBufferMemory2(VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo* pBindInfos, VkResult result) {}; virtual bool PreCallValidateBindImageMemory2(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo* pBindInfos) const { return false; }; virtual void PreCallRecordBindImageMemory2(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo* pBindInfos) {}; virtual void PostCallRecordBindImageMemory2(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo* pBindInfos, VkResult result) {}; virtual bool PreCallValidateGetDeviceGroupPeerMemoryFeatures(VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, VkPeerMemoryFeatureFlags* pPeerMemoryFeatures) const { return false; }; virtual void PreCallRecordGetDeviceGroupPeerMemoryFeatures(VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, VkPeerMemoryFeatureFlags* pPeerMemoryFeatures) {}; virtual void PostCallRecordGetDeviceGroupPeerMemoryFeatures(VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, VkPeerMemoryFeatureFlags* pPeerMemoryFeatures) {}; virtual bool PreCallValidateCmdSetDeviceMask(VkCommandBuffer commandBuffer, uint32_t deviceMask) const { return false; }; virtual void PreCallRecordCmdSetDeviceMask(VkCommandBuffer commandBuffer, uint32_t deviceMask) {}; virtual void PostCallRecordCmdSetDeviceMask(VkCommandBuffer commandBuffer, uint32_t deviceMask) {}; virtual bool PreCallValidateCmdDispatchBase(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ) const { return false; }; virtual void PreCallRecordCmdDispatchBase(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ) {}; virtual void PostCallRecordCmdDispatchBase(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ) {}; virtual bool PreCallValidateEnumeratePhysicalDeviceGroups(VkInstance instance, uint32_t* pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties) const { return false; }; virtual void PreCallRecordEnumeratePhysicalDeviceGroups(VkInstance instance, uint32_t* pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties) {}; virtual void PostCallRecordEnumeratePhysicalDeviceGroups(VkInstance instance, uint32_t* pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties, VkResult result) {}; virtual bool PreCallValidateGetImageMemoryRequirements2(VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements) const { return false; }; virtual void PreCallRecordGetImageMemoryRequirements2(VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements) {}; virtual void PostCallRecordGetImageMemoryRequirements2(VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements) {}; virtual bool PreCallValidateGetBufferMemoryRequirements2(VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements) const { return false; }; virtual void PreCallRecordGetBufferMemoryRequirements2(VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements) {}; virtual void PostCallRecordGetBufferMemoryRequirements2(VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements) {}; virtual bool PreCallValidateGetImageSparseMemoryRequirements2(VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) const { return false; }; virtual void PreCallRecordGetImageSparseMemoryRequirements2(VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) {}; virtual void PostCallRecordGetImageSparseMemoryRequirements2(VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) {}; virtual bool PreCallValidateGetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2* pFeatures) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2* pFeatures) {}; virtual void PostCallRecordGetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2* pFeatures) {}; virtual bool PreCallValidateGetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2* pProperties) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2* pProperties) {}; virtual void PostCallRecordGetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2* pProperties) {}; virtual bool PreCallValidateGetPhysicalDeviceFormatProperties2(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties2* pFormatProperties) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceFormatProperties2(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties2* pFormatProperties) {}; virtual void PostCallRecordGetPhysicalDeviceFormatProperties2(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties2* pFormatProperties) {}; virtual bool PreCallValidateGetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, VkImageFormatProperties2* pImageFormatProperties) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, VkImageFormatProperties2* pImageFormatProperties) {}; virtual void PostCallRecordGetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, VkImageFormatProperties2* pImageFormatProperties, VkResult result) {}; virtual bool PreCallValidateGetPhysicalDeviceQueueFamilyProperties2(VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties2* pQueueFamilyProperties) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceQueueFamilyProperties2(VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties2* pQueueFamilyProperties) {}; virtual void PostCallRecordGetPhysicalDeviceQueueFamilyProperties2(VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties2* pQueueFamilyProperties) {}; virtual bool PreCallValidateGetPhysicalDeviceMemoryProperties2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2* pMemoryProperties) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceMemoryProperties2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2* pMemoryProperties) {}; virtual void PostCallRecordGetPhysicalDeviceMemoryProperties2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2* pMemoryProperties) {}; virtual bool PreCallValidateGetPhysicalDeviceSparseImageFormatProperties2(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, uint32_t* pPropertyCount, VkSparseImageFormatProperties2* pProperties) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceSparseImageFormatProperties2(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, uint32_t* pPropertyCount, VkSparseImageFormatProperties2* pProperties) {}; virtual void PostCallRecordGetPhysicalDeviceSparseImageFormatProperties2(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, uint32_t* pPropertyCount, VkSparseImageFormatProperties2* pProperties) {}; virtual bool PreCallValidateTrimCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags) const { return false; }; virtual void PreCallRecordTrimCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags) {}; virtual void PostCallRecordTrimCommandPool(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags) {}; virtual bool PreCallValidateGetDeviceQueue2(VkDevice device, const VkDeviceQueueInfo2* pQueueInfo, VkQueue* pQueue) const { return false; }; virtual void PreCallRecordGetDeviceQueue2(VkDevice device, const VkDeviceQueueInfo2* pQueueInfo, VkQueue* pQueue) {}; virtual void PostCallRecordGetDeviceQueue2(VkDevice device, const VkDeviceQueueInfo2* pQueueInfo, VkQueue* pQueue) {}; virtual bool PreCallValidateCreateSamplerYcbcrConversion(VkDevice device, const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSamplerYcbcrConversion* pYcbcrConversion) const { return false; }; virtual void PreCallRecordCreateSamplerYcbcrConversion(VkDevice device, const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSamplerYcbcrConversion* pYcbcrConversion) {}; virtual void PostCallRecordCreateSamplerYcbcrConversion(VkDevice device, const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSamplerYcbcrConversion* pYcbcrConversion, VkResult result) {}; virtual bool PreCallValidateDestroySamplerYcbcrConversion(VkDevice device, VkSamplerYcbcrConversion ycbcrConversion, const VkAllocationCallbacks* pAllocator) const { return false; }; virtual void PreCallRecordDestroySamplerYcbcrConversion(VkDevice device, VkSamplerYcbcrConversion ycbcrConversion, const VkAllocationCallbacks* pAllocator) {}; virtual void PostCallRecordDestroySamplerYcbcrConversion(VkDevice device, VkSamplerYcbcrConversion ycbcrConversion, const VkAllocationCallbacks* pAllocator) {}; virtual bool PreCallValidateCreateDescriptorUpdateTemplate(VkDevice device, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate) const { return false; }; virtual void PreCallRecordCreateDescriptorUpdateTemplate(VkDevice device, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate) {}; virtual void PostCallRecordCreateDescriptorUpdateTemplate(VkDevice device, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate, VkResult result) {}; virtual bool PreCallValidateDestroyDescriptorUpdateTemplate(VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const VkAllocationCallbacks* pAllocator) const { return false; }; virtual void PreCallRecordDestroyDescriptorUpdateTemplate(VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const VkAllocationCallbacks* pAllocator) {}; virtual void PostCallRecordDestroyDescriptorUpdateTemplate(VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const VkAllocationCallbacks* pAllocator) {}; virtual bool PreCallValidateUpdateDescriptorSetWithTemplate(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData) const { return false; }; virtual void PreCallRecordUpdateDescriptorSetWithTemplate(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData) {}; virtual void PostCallRecordUpdateDescriptorSetWithTemplate(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData) {}; virtual bool PreCallValidateGetPhysicalDeviceExternalBufferProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, VkExternalBufferProperties* pExternalBufferProperties) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceExternalBufferProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, VkExternalBufferProperties* pExternalBufferProperties) {}; virtual void PostCallRecordGetPhysicalDeviceExternalBufferProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, VkExternalBufferProperties* pExternalBufferProperties) {}; virtual bool PreCallValidateGetPhysicalDeviceExternalFenceProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, VkExternalFenceProperties* pExternalFenceProperties) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceExternalFenceProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, VkExternalFenceProperties* pExternalFenceProperties) {}; virtual void PostCallRecordGetPhysicalDeviceExternalFenceProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, VkExternalFenceProperties* pExternalFenceProperties) {}; virtual bool PreCallValidateGetPhysicalDeviceExternalSemaphoreProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, VkExternalSemaphoreProperties* pExternalSemaphoreProperties) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceExternalSemaphoreProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, VkExternalSemaphoreProperties* pExternalSemaphoreProperties) {}; virtual void PostCallRecordGetPhysicalDeviceExternalSemaphoreProperties(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, VkExternalSemaphoreProperties* pExternalSemaphoreProperties) {}; virtual bool PreCallValidateGetDescriptorSetLayoutSupport(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayoutSupport* pSupport) const { return false; }; virtual void PreCallRecordGetDescriptorSetLayoutSupport(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayoutSupport* pSupport) {}; virtual void PostCallRecordGetDescriptorSetLayoutSupport(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayoutSupport* pSupport) {}; virtual bool PreCallValidateCmdDrawIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) const { return false; }; virtual void PreCallRecordCmdDrawIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) {}; virtual void PostCallRecordCmdDrawIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) {}; virtual bool PreCallValidateCmdDrawIndexedIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) const { return false; }; virtual void PreCallRecordCmdDrawIndexedIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) {}; virtual void PostCallRecordCmdDrawIndexedIndirectCount(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) {}; virtual bool PreCallValidateCreateRenderPass2(VkDevice device, const VkRenderPassCreateInfo2* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass) const { return false; }; virtual void PreCallRecordCreateRenderPass2(VkDevice device, const VkRenderPassCreateInfo2* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass) {}; virtual void PostCallRecordCreateRenderPass2(VkDevice device, const VkRenderPassCreateInfo2* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass, VkResult result) {}; virtual bool PreCallValidateCmdBeginRenderPass2(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, const VkSubpassBeginInfo* pSubpassBeginInfo) const { return false; }; virtual void PreCallRecordCmdBeginRenderPass2(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, const VkSubpassBeginInfo* pSubpassBeginInfo) {}; virtual void PostCallRecordCmdBeginRenderPass2(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, const VkSubpassBeginInfo* pSubpassBeginInfo) {}; virtual bool PreCallValidateCmdNextSubpass2(VkCommandBuffer commandBuffer, const VkSubpassBeginInfo* pSubpassBeginInfo, const VkSubpassEndInfo* pSubpassEndInfo) const { return false; }; virtual void PreCallRecordCmdNextSubpass2(VkCommandBuffer commandBuffer, const VkSubpassBeginInfo* pSubpassBeginInfo, const VkSubpassEndInfo* pSubpassEndInfo) {}; virtual void PostCallRecordCmdNextSubpass2(VkCommandBuffer commandBuffer, const VkSubpassBeginInfo* pSubpassBeginInfo, const VkSubpassEndInfo* pSubpassEndInfo) {}; virtual bool PreCallValidateCmdEndRenderPass2(VkCommandBuffer commandBuffer, const VkSubpassEndInfo* pSubpassEndInfo) const { return false; }; virtual void PreCallRecordCmdEndRenderPass2(VkCommandBuffer commandBuffer, const VkSubpassEndInfo* pSubpassEndInfo) {}; virtual void PostCallRecordCmdEndRenderPass2(VkCommandBuffer commandBuffer, const VkSubpassEndInfo* pSubpassEndInfo) {}; virtual bool PreCallValidateResetQueryPool(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount) const { return false; }; virtual void PreCallRecordResetQueryPool(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount) {}; virtual void PostCallRecordResetQueryPool(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount) {}; virtual bool PreCallValidateGetSemaphoreCounterValue(VkDevice device, VkSemaphore semaphore, uint64_t* pValue) const { return false; }; virtual void PreCallRecordGetSemaphoreCounterValue(VkDevice device, VkSemaphore semaphore, uint64_t* pValue) {}; virtual void PostCallRecordGetSemaphoreCounterValue(VkDevice device, VkSemaphore semaphore, uint64_t* pValue, VkResult result) {}; virtual bool PreCallValidateWaitSemaphores(VkDevice device, const VkSemaphoreWaitInfo* pWaitInfo, uint64_t timeout) const { return false; }; virtual void PreCallRecordWaitSemaphores(VkDevice device, const VkSemaphoreWaitInfo* pWaitInfo, uint64_t timeout) {}; virtual void PostCallRecordWaitSemaphores(VkDevice device, const VkSemaphoreWaitInfo* pWaitInfo, uint64_t timeout, VkResult result) {}; virtual bool PreCallValidateSignalSemaphore(VkDevice device, const VkSemaphoreSignalInfo* pSignalInfo) const { return false; }; virtual void PreCallRecordSignalSemaphore(VkDevice device, const VkSemaphoreSignalInfo* pSignalInfo) {}; virtual void PostCallRecordSignalSemaphore(VkDevice device, const VkSemaphoreSignalInfo* pSignalInfo, VkResult result) {}; virtual bool PreCallValidateGetBufferDeviceAddress(VkDevice device, const VkBufferDeviceAddressInfo* pInfo) const { return false; }; virtual void PreCallRecordGetBufferDeviceAddress(VkDevice device, const VkBufferDeviceAddressInfo* pInfo) {}; virtual void PostCallRecordGetBufferDeviceAddress(VkDevice device, const VkBufferDeviceAddressInfo* pInfo, VkDeviceAddress result) {}; virtual bool PreCallValidateGetBufferOpaqueCaptureAddress(VkDevice device, const VkBufferDeviceAddressInfo* pInfo) const { return false; }; virtual void PreCallRecordGetBufferOpaqueCaptureAddress(VkDevice device, const VkBufferDeviceAddressInfo* pInfo) {}; virtual void PostCallRecordGetBufferOpaqueCaptureAddress(VkDevice device, const VkBufferDeviceAddressInfo* pInfo) {}; virtual bool PreCallValidateGetDeviceMemoryOpaqueCaptureAddress(VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfo* pInfo) const { return false; }; virtual void PreCallRecordGetDeviceMemoryOpaqueCaptureAddress(VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfo* pInfo) {}; virtual void PostCallRecordGetDeviceMemoryOpaqueCaptureAddress(VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfo* pInfo) {}; virtual bool PreCallValidateDestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks* pAllocator) const { return false; }; virtual void PreCallRecordDestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks* pAllocator) {}; virtual void PostCallRecordDestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks* pAllocator) {}; virtual bool PreCallValidateGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, VkSurfaceKHR surface, VkBool32* pSupported) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, VkSurfaceKHR surface, VkBool32* pSupported) {}; virtual void PostCallRecordGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, VkSurfaceKHR surface, VkBool32* pSupported, VkResult result) {}; virtual bool PreCallValidateGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) {}; virtual void PostCallRecordGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilitiesKHR* pSurfaceCapabilities, VkResult result) {}; virtual bool PreCallValidateGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pSurfaceFormatCount, VkSurfaceFormatKHR* pSurfaceFormats) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pSurfaceFormatCount, VkSurfaceFormatKHR* pSurfaceFormats) {}; virtual void PostCallRecordGetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pSurfaceFormatCount, VkSurfaceFormatKHR* pSurfaceFormats, VkResult result) {}; virtual bool PreCallValidateGetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pPresentModeCount, VkPresentModeKHR* pPresentModes) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pPresentModeCount, VkPresentModeKHR* pPresentModes) {}; virtual void PostCallRecordGetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pPresentModeCount, VkPresentModeKHR* pPresentModes, VkResult result) {}; virtual bool PreCallValidateCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchain) const { return false; }; virtual void PreCallRecordCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchain) {}; virtual void PostCallRecordCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchain, VkResult result) {}; virtual bool PreCallValidateDestroySwapchainKHR(VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks* pAllocator) const { return false; }; virtual void PreCallRecordDestroySwapchainKHR(VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks* pAllocator) {}; virtual void PostCallRecordDestroySwapchainKHR(VkDevice device, VkSwapchainKHR swapchain, const VkAllocationCallbacks* pAllocator) {}; virtual bool PreCallValidateGetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain, uint32_t* pSwapchainImageCount, VkImage* pSwapchainImages) const { return false; }; virtual void PreCallRecordGetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain, uint32_t* pSwapchainImageCount, VkImage* pSwapchainImages) {}; virtual void PostCallRecordGetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain, uint32_t* pSwapchainImageCount, VkImage* pSwapchainImages, VkResult result) {}; virtual bool PreCallValidateAcquireNextImageKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t* pImageIndex) const { return false; }; virtual void PreCallRecordAcquireNextImageKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t* pImageIndex) {}; virtual void PostCallRecordAcquireNextImageKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, VkFence fence, uint32_t* pImageIndex, VkResult result) {}; virtual bool PreCallValidateQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR* pPresentInfo) const { return false; }; virtual void PreCallRecordQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR* pPresentInfo) {}; virtual void PostCallRecordQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR* pPresentInfo, VkResult result) {}; virtual bool PreCallValidateGetDeviceGroupPresentCapabilitiesKHR(VkDevice device, VkDeviceGroupPresentCapabilitiesKHR* pDeviceGroupPresentCapabilities) const { return false; }; virtual void PreCallRecordGetDeviceGroupPresentCapabilitiesKHR(VkDevice device, VkDeviceGroupPresentCapabilitiesKHR* pDeviceGroupPresentCapabilities) {}; virtual void PostCallRecordGetDeviceGroupPresentCapabilitiesKHR(VkDevice device, VkDeviceGroupPresentCapabilitiesKHR* pDeviceGroupPresentCapabilities, VkResult result) {}; virtual bool PreCallValidateGetDeviceGroupSurfacePresentModesKHR(VkDevice device, VkSurfaceKHR surface, VkDeviceGroupPresentModeFlagsKHR* pModes) const { return false; }; virtual void PreCallRecordGetDeviceGroupSurfacePresentModesKHR(VkDevice device, VkSurfaceKHR surface, VkDeviceGroupPresentModeFlagsKHR* pModes) {}; virtual void PostCallRecordGetDeviceGroupSurfacePresentModesKHR(VkDevice device, VkSurfaceKHR surface, VkDeviceGroupPresentModeFlagsKHR* pModes, VkResult result) {}; virtual bool PreCallValidateGetPhysicalDevicePresentRectanglesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pRectCount, VkRect2D* pRects) const { return false; }; virtual void PreCallRecordGetPhysicalDevicePresentRectanglesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pRectCount, VkRect2D* pRects) {}; virtual void PostCallRecordGetPhysicalDevicePresentRectanglesKHR(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, uint32_t* pRectCount, VkRect2D* pRects, VkResult result) {}; virtual bool PreCallValidateAcquireNextImage2KHR(VkDevice device, const VkAcquireNextImageInfoKHR* pAcquireInfo, uint32_t* pImageIndex) const { return false; }; virtual void PreCallRecordAcquireNextImage2KHR(VkDevice device, const VkAcquireNextImageInfoKHR* pAcquireInfo, uint32_t* pImageIndex) {}; virtual void PostCallRecordAcquireNextImage2KHR(VkDevice device, const VkAcquireNextImageInfoKHR* pAcquireInfo, uint32_t* pImageIndex, VkResult result) {}; virtual bool PreCallValidateGetPhysicalDeviceDisplayPropertiesKHR(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkDisplayPropertiesKHR* pProperties) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceDisplayPropertiesKHR(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkDisplayPropertiesKHR* pProperties) {}; virtual void PostCallRecordGetPhysicalDeviceDisplayPropertiesKHR(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkDisplayPropertiesKHR* pProperties, VkResult result) {}; virtual bool PreCallValidateGetPhysicalDeviceDisplayPlanePropertiesKHR(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkDisplayPlanePropertiesKHR* pProperties) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceDisplayPlanePropertiesKHR(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkDisplayPlanePropertiesKHR* pProperties) {}; virtual void PostCallRecordGetPhysicalDeviceDisplayPlanePropertiesKHR(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkDisplayPlanePropertiesKHR* pProperties, VkResult result) {}; virtual bool PreCallValidateGetDisplayPlaneSupportedDisplaysKHR(VkPhysicalDevice physicalDevice, uint32_t planeIndex, uint32_t* pDisplayCount, VkDisplayKHR* pDisplays) const { return false; }; virtual void PreCallRecordGetDisplayPlaneSupportedDisplaysKHR(VkPhysicalDevice physicalDevice, uint32_t planeIndex, uint32_t* pDisplayCount, VkDisplayKHR* pDisplays) {}; virtual void PostCallRecordGetDisplayPlaneSupportedDisplaysKHR(VkPhysicalDevice physicalDevice, uint32_t planeIndex, uint32_t* pDisplayCount, VkDisplayKHR* pDisplays, VkResult result) {}; virtual bool PreCallValidateGetDisplayModePropertiesKHR(VkPhysicalDevice physicalDevice, VkDisplayKHR display, uint32_t* pPropertyCount, VkDisplayModePropertiesKHR* pProperties) const { return false; }; virtual void PreCallRecordGetDisplayModePropertiesKHR(VkPhysicalDevice physicalDevice, VkDisplayKHR display, uint32_t* pPropertyCount, VkDisplayModePropertiesKHR* pProperties) {}; virtual void PostCallRecordGetDisplayModePropertiesKHR(VkPhysicalDevice physicalDevice, VkDisplayKHR display, uint32_t* pPropertyCount, VkDisplayModePropertiesKHR* pProperties, VkResult result) {}; virtual bool PreCallValidateCreateDisplayModeKHR(VkPhysicalDevice physicalDevice, VkDisplayKHR display, const VkDisplayModeCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDisplayModeKHR* pMode) const { return false; }; virtual void PreCallRecordCreateDisplayModeKHR(VkPhysicalDevice physicalDevice, VkDisplayKHR display, const VkDisplayModeCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDisplayModeKHR* pMode) {}; virtual void PostCallRecordCreateDisplayModeKHR(VkPhysicalDevice physicalDevice, VkDisplayKHR display, const VkDisplayModeCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDisplayModeKHR* pMode, VkResult result) {}; virtual bool PreCallValidateGetDisplayPlaneCapabilitiesKHR(VkPhysicalDevice physicalDevice, VkDisplayModeKHR mode, uint32_t planeIndex, VkDisplayPlaneCapabilitiesKHR* pCapabilities) const { return false; }; virtual void PreCallRecordGetDisplayPlaneCapabilitiesKHR(VkPhysicalDevice physicalDevice, VkDisplayModeKHR mode, uint32_t planeIndex, VkDisplayPlaneCapabilitiesKHR* pCapabilities) {}; virtual void PostCallRecordGetDisplayPlaneCapabilitiesKHR(VkPhysicalDevice physicalDevice, VkDisplayModeKHR mode, uint32_t planeIndex, VkDisplayPlaneCapabilitiesKHR* pCapabilities, VkResult result) {}; virtual bool PreCallValidateCreateDisplayPlaneSurfaceKHR(VkInstance instance, const VkDisplaySurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) const { return false; }; virtual void PreCallRecordCreateDisplayPlaneSurfaceKHR(VkInstance instance, const VkDisplaySurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) {}; virtual void PostCallRecordCreateDisplayPlaneSurfaceKHR(VkInstance instance, const VkDisplaySurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, VkResult result) {}; virtual bool PreCallValidateCreateSharedSwapchainsKHR(VkDevice device, uint32_t swapchainCount, const VkSwapchainCreateInfoKHR* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchains) const { return false; }; virtual void PreCallRecordCreateSharedSwapchainsKHR(VkDevice device, uint32_t swapchainCount, const VkSwapchainCreateInfoKHR* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchains) {}; virtual void PostCallRecordCreateSharedSwapchainsKHR(VkDevice device, uint32_t swapchainCount, const VkSwapchainCreateInfoKHR* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkSwapchainKHR* pSwapchains, VkResult result) {}; #ifdef VK_USE_PLATFORM_XLIB_KHR virtual bool PreCallValidateCreateXlibSurfaceKHR(VkInstance instance, const VkXlibSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) const { return false; }; virtual void PreCallRecordCreateXlibSurfaceKHR(VkInstance instance, const VkXlibSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) {}; virtual void PostCallRecordCreateXlibSurfaceKHR(VkInstance instance, const VkXlibSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, VkResult result) {}; #endif #ifdef VK_USE_PLATFORM_XLIB_KHR virtual bool PreCallValidateGetPhysicalDeviceXlibPresentationSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, Display* dpy, VisualID visualID) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceXlibPresentationSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, Display* dpy, VisualID visualID) {}; virtual void PostCallRecordGetPhysicalDeviceXlibPresentationSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, Display* dpy, VisualID visualID) {}; #endif #ifdef VK_USE_PLATFORM_XCB_KHR virtual bool PreCallValidateCreateXcbSurfaceKHR(VkInstance instance, const VkXcbSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) const { return false; }; virtual void PreCallRecordCreateXcbSurfaceKHR(VkInstance instance, const VkXcbSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) {}; virtual void PostCallRecordCreateXcbSurfaceKHR(VkInstance instance, const VkXcbSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, VkResult result) {}; #endif #ifdef VK_USE_PLATFORM_XCB_KHR virtual bool PreCallValidateGetPhysicalDeviceXcbPresentationSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, xcb_connection_t* connection, xcb_visualid_t visual_id) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceXcbPresentationSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, xcb_connection_t* connection, xcb_visualid_t visual_id) {}; virtual void PostCallRecordGetPhysicalDeviceXcbPresentationSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, xcb_connection_t* connection, xcb_visualid_t visual_id) {}; #endif #ifdef VK_USE_PLATFORM_WAYLAND_KHR virtual bool PreCallValidateCreateWaylandSurfaceKHR(VkInstance instance, const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) const { return false; }; virtual void PreCallRecordCreateWaylandSurfaceKHR(VkInstance instance, const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) {}; virtual void PostCallRecordCreateWaylandSurfaceKHR(VkInstance instance, const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, VkResult result) {}; #endif #ifdef VK_USE_PLATFORM_WAYLAND_KHR virtual bool PreCallValidateGetPhysicalDeviceWaylandPresentationSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, struct wl_display* display) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceWaylandPresentationSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, struct wl_display* display) {}; virtual void PostCallRecordGetPhysicalDeviceWaylandPresentationSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, struct wl_display* display) {}; #endif #ifdef VK_USE_PLATFORM_ANDROID_KHR virtual bool PreCallValidateCreateAndroidSurfaceKHR(VkInstance instance, const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) const { return false; }; virtual void PreCallRecordCreateAndroidSurfaceKHR(VkInstance instance, const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) {}; virtual void PostCallRecordCreateAndroidSurfaceKHR(VkInstance instance, const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, VkResult result) {}; #endif #ifdef VK_USE_PLATFORM_WIN32_KHR virtual bool PreCallValidateCreateWin32SurfaceKHR(VkInstance instance, const VkWin32SurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) const { return false; }; virtual void PreCallRecordCreateWin32SurfaceKHR(VkInstance instance, const VkWin32SurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) {}; virtual void PostCallRecordCreateWin32SurfaceKHR(VkInstance instance, const VkWin32SurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, VkResult result) {}; #endif #ifdef VK_USE_PLATFORM_WIN32_KHR virtual bool PreCallValidateGetPhysicalDeviceWin32PresentationSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceWin32PresentationSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex) {}; virtual void PostCallRecordGetPhysicalDeviceWin32PresentationSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex) {}; #endif virtual bool PreCallValidateGetPhysicalDeviceFeatures2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2* pFeatures) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceFeatures2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2* pFeatures) {}; virtual void PostCallRecordGetPhysicalDeviceFeatures2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2* pFeatures) {}; virtual bool PreCallValidateGetPhysicalDeviceProperties2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2* pProperties) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceProperties2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2* pProperties) {}; virtual void PostCallRecordGetPhysicalDeviceProperties2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties2* pProperties) {}; virtual bool PreCallValidateGetPhysicalDeviceFormatProperties2KHR(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties2* pFormatProperties) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceFormatProperties2KHR(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties2* pFormatProperties) {}; virtual void PostCallRecordGetPhysicalDeviceFormatProperties2KHR(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties2* pFormatProperties) {}; virtual bool PreCallValidateGetPhysicalDeviceImageFormatProperties2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, VkImageFormatProperties2* pImageFormatProperties) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceImageFormatProperties2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, VkImageFormatProperties2* pImageFormatProperties) {}; virtual void PostCallRecordGetPhysicalDeviceImageFormatProperties2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo, VkImageFormatProperties2* pImageFormatProperties, VkResult result) {}; virtual bool PreCallValidateGetPhysicalDeviceQueueFamilyProperties2KHR(VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties2* pQueueFamilyProperties) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceQueueFamilyProperties2KHR(VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties2* pQueueFamilyProperties) {}; virtual void PostCallRecordGetPhysicalDeviceQueueFamilyProperties2KHR(VkPhysicalDevice physicalDevice, uint32_t* pQueueFamilyPropertyCount, VkQueueFamilyProperties2* pQueueFamilyProperties) {}; virtual bool PreCallValidateGetPhysicalDeviceMemoryProperties2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2* pMemoryProperties) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceMemoryProperties2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2* pMemoryProperties) {}; virtual void PostCallRecordGetPhysicalDeviceMemoryProperties2KHR(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties2* pMemoryProperties) {}; virtual bool PreCallValidateGetPhysicalDeviceSparseImageFormatProperties2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, uint32_t* pPropertyCount, VkSparseImageFormatProperties2* pProperties) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceSparseImageFormatProperties2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, uint32_t* pPropertyCount, VkSparseImageFormatProperties2* pProperties) {}; virtual void PostCallRecordGetPhysicalDeviceSparseImageFormatProperties2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSparseImageFormatInfo2* pFormatInfo, uint32_t* pPropertyCount, VkSparseImageFormatProperties2* pProperties) {}; virtual bool PreCallValidateGetDeviceGroupPeerMemoryFeaturesKHR(VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, VkPeerMemoryFeatureFlags* pPeerMemoryFeatures) const { return false; }; virtual void PreCallRecordGetDeviceGroupPeerMemoryFeaturesKHR(VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, VkPeerMemoryFeatureFlags* pPeerMemoryFeatures) {}; virtual void PostCallRecordGetDeviceGroupPeerMemoryFeaturesKHR(VkDevice device, uint32_t heapIndex, uint32_t localDeviceIndex, uint32_t remoteDeviceIndex, VkPeerMemoryFeatureFlags* pPeerMemoryFeatures) {}; virtual bool PreCallValidateCmdSetDeviceMaskKHR(VkCommandBuffer commandBuffer, uint32_t deviceMask) const { return false; }; virtual void PreCallRecordCmdSetDeviceMaskKHR(VkCommandBuffer commandBuffer, uint32_t deviceMask) {}; virtual void PostCallRecordCmdSetDeviceMaskKHR(VkCommandBuffer commandBuffer, uint32_t deviceMask) {}; virtual bool PreCallValidateCmdDispatchBaseKHR(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ) const { return false; }; virtual void PreCallRecordCmdDispatchBaseKHR(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ) {}; virtual void PostCallRecordCmdDispatchBaseKHR(VkCommandBuffer commandBuffer, uint32_t baseGroupX, uint32_t baseGroupY, uint32_t baseGroupZ, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ) {}; virtual bool PreCallValidateTrimCommandPoolKHR(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags) const { return false; }; virtual void PreCallRecordTrimCommandPoolKHR(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags) {}; virtual void PostCallRecordTrimCommandPoolKHR(VkDevice device, VkCommandPool commandPool, VkCommandPoolTrimFlags flags) {}; virtual bool PreCallValidateEnumeratePhysicalDeviceGroupsKHR(VkInstance instance, uint32_t* pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties) const { return false; }; virtual void PreCallRecordEnumeratePhysicalDeviceGroupsKHR(VkInstance instance, uint32_t* pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties) {}; virtual void PostCallRecordEnumeratePhysicalDeviceGroupsKHR(VkInstance instance, uint32_t* pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties* pPhysicalDeviceGroupProperties, VkResult result) {}; virtual bool PreCallValidateGetPhysicalDeviceExternalBufferPropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, VkExternalBufferProperties* pExternalBufferProperties) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceExternalBufferPropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, VkExternalBufferProperties* pExternalBufferProperties) {}; virtual void PostCallRecordGetPhysicalDeviceExternalBufferPropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalBufferInfo* pExternalBufferInfo, VkExternalBufferProperties* pExternalBufferProperties) {}; #ifdef VK_USE_PLATFORM_WIN32_KHR virtual bool PreCallValidateGetMemoryWin32HandleKHR(VkDevice device, const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle) const { return false; }; virtual void PreCallRecordGetMemoryWin32HandleKHR(VkDevice device, const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle) {}; virtual void PostCallRecordGetMemoryWin32HandleKHR(VkDevice device, const VkMemoryGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle, VkResult result) {}; #endif #ifdef VK_USE_PLATFORM_WIN32_KHR virtual bool PreCallValidateGetMemoryWin32HandlePropertiesKHR(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE handle, VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties) const { return false; }; virtual void PreCallRecordGetMemoryWin32HandlePropertiesKHR(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE handle, VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties) {}; virtual void PostCallRecordGetMemoryWin32HandlePropertiesKHR(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE handle, VkMemoryWin32HandlePropertiesKHR* pMemoryWin32HandleProperties, VkResult result) {}; #endif virtual bool PreCallValidateGetMemoryFdKHR(VkDevice device, const VkMemoryGetFdInfoKHR* pGetFdInfo, int* pFd) const { return false; }; virtual void PreCallRecordGetMemoryFdKHR(VkDevice device, const VkMemoryGetFdInfoKHR* pGetFdInfo, int* pFd) {}; virtual void PostCallRecordGetMemoryFdKHR(VkDevice device, const VkMemoryGetFdInfoKHR* pGetFdInfo, int* pFd, VkResult result) {}; virtual bool PreCallValidateGetMemoryFdPropertiesKHR(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, int fd, VkMemoryFdPropertiesKHR* pMemoryFdProperties) const { return false; }; virtual void PreCallRecordGetMemoryFdPropertiesKHR(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, int fd, VkMemoryFdPropertiesKHR* pMemoryFdProperties) {}; virtual void PostCallRecordGetMemoryFdPropertiesKHR(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, int fd, VkMemoryFdPropertiesKHR* pMemoryFdProperties, VkResult result) {}; virtual bool PreCallValidateGetPhysicalDeviceExternalSemaphorePropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, VkExternalSemaphoreProperties* pExternalSemaphoreProperties) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceExternalSemaphorePropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, VkExternalSemaphoreProperties* pExternalSemaphoreProperties) {}; virtual void PostCallRecordGetPhysicalDeviceExternalSemaphorePropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalSemaphoreInfo* pExternalSemaphoreInfo, VkExternalSemaphoreProperties* pExternalSemaphoreProperties) {}; #ifdef VK_USE_PLATFORM_WIN32_KHR virtual bool PreCallValidateImportSemaphoreWin32HandleKHR(VkDevice device, const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo) const { return false; }; virtual void PreCallRecordImportSemaphoreWin32HandleKHR(VkDevice device, const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo) {}; virtual void PostCallRecordImportSemaphoreWin32HandleKHR(VkDevice device, const VkImportSemaphoreWin32HandleInfoKHR* pImportSemaphoreWin32HandleInfo, VkResult result) {}; #endif #ifdef VK_USE_PLATFORM_WIN32_KHR virtual bool PreCallValidateGetSemaphoreWin32HandleKHR(VkDevice device, const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle) const { return false; }; virtual void PreCallRecordGetSemaphoreWin32HandleKHR(VkDevice device, const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle) {}; virtual void PostCallRecordGetSemaphoreWin32HandleKHR(VkDevice device, const VkSemaphoreGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle, VkResult result) {}; #endif virtual bool PreCallValidateImportSemaphoreFdKHR(VkDevice device, const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo) const { return false; }; virtual void PreCallRecordImportSemaphoreFdKHR(VkDevice device, const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo) {}; virtual void PostCallRecordImportSemaphoreFdKHR(VkDevice device, const VkImportSemaphoreFdInfoKHR* pImportSemaphoreFdInfo, VkResult result) {}; virtual bool PreCallValidateGetSemaphoreFdKHR(VkDevice device, const VkSemaphoreGetFdInfoKHR* pGetFdInfo, int* pFd) const { return false; }; virtual void PreCallRecordGetSemaphoreFdKHR(VkDevice device, const VkSemaphoreGetFdInfoKHR* pGetFdInfo, int* pFd) {}; virtual void PostCallRecordGetSemaphoreFdKHR(VkDevice device, const VkSemaphoreGetFdInfoKHR* pGetFdInfo, int* pFd, VkResult result) {}; virtual bool PreCallValidateCmdPushDescriptorSetKHR(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites) const { return false; }; virtual void PreCallRecordCmdPushDescriptorSetKHR(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites) {}; virtual void PostCallRecordCmdPushDescriptorSetKHR(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set, uint32_t descriptorWriteCount, const VkWriteDescriptorSet* pDescriptorWrites) {}; virtual bool PreCallValidateCmdPushDescriptorSetWithTemplateKHR(VkCommandBuffer commandBuffer, VkDescriptorUpdateTemplate descriptorUpdateTemplate, VkPipelineLayout layout, uint32_t set, const void* pData) const { return false; }; virtual void PreCallRecordCmdPushDescriptorSetWithTemplateKHR(VkCommandBuffer commandBuffer, VkDescriptorUpdateTemplate descriptorUpdateTemplate, VkPipelineLayout layout, uint32_t set, const void* pData) {}; virtual void PostCallRecordCmdPushDescriptorSetWithTemplateKHR(VkCommandBuffer commandBuffer, VkDescriptorUpdateTemplate descriptorUpdateTemplate, VkPipelineLayout layout, uint32_t set, const void* pData) {}; virtual bool PreCallValidateCreateDescriptorUpdateTemplateKHR(VkDevice device, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate) const { return false; }; virtual void PreCallRecordCreateDescriptorUpdateTemplateKHR(VkDevice device, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate) {}; virtual void PostCallRecordCreateDescriptorUpdateTemplateKHR(VkDevice device, const VkDescriptorUpdateTemplateCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDescriptorUpdateTemplate* pDescriptorUpdateTemplate, VkResult result) {}; virtual bool PreCallValidateDestroyDescriptorUpdateTemplateKHR(VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const VkAllocationCallbacks* pAllocator) const { return false; }; virtual void PreCallRecordDestroyDescriptorUpdateTemplateKHR(VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const VkAllocationCallbacks* pAllocator) {}; virtual void PostCallRecordDestroyDescriptorUpdateTemplateKHR(VkDevice device, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const VkAllocationCallbacks* pAllocator) {}; virtual bool PreCallValidateUpdateDescriptorSetWithTemplateKHR(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData) const { return false; }; virtual void PreCallRecordUpdateDescriptorSetWithTemplateKHR(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData) {}; virtual void PostCallRecordUpdateDescriptorSetWithTemplateKHR(VkDevice device, VkDescriptorSet descriptorSet, VkDescriptorUpdateTemplate descriptorUpdateTemplate, const void* pData) {}; virtual bool PreCallValidateCreateRenderPass2KHR(VkDevice device, const VkRenderPassCreateInfo2* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass) const { return false; }; virtual void PreCallRecordCreateRenderPass2KHR(VkDevice device, const VkRenderPassCreateInfo2* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass) {}; virtual void PostCallRecordCreateRenderPass2KHR(VkDevice device, const VkRenderPassCreateInfo2* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkRenderPass* pRenderPass, VkResult result) {}; virtual bool PreCallValidateCmdBeginRenderPass2KHR(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, const VkSubpassBeginInfo* pSubpassBeginInfo) const { return false; }; virtual void PreCallRecordCmdBeginRenderPass2KHR(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, const VkSubpassBeginInfo* pSubpassBeginInfo) {}; virtual void PostCallRecordCmdBeginRenderPass2KHR(VkCommandBuffer commandBuffer, const VkRenderPassBeginInfo* pRenderPassBegin, const VkSubpassBeginInfo* pSubpassBeginInfo) {}; virtual bool PreCallValidateCmdNextSubpass2KHR(VkCommandBuffer commandBuffer, const VkSubpassBeginInfo* pSubpassBeginInfo, const VkSubpassEndInfo* pSubpassEndInfo) const { return false; }; virtual void PreCallRecordCmdNextSubpass2KHR(VkCommandBuffer commandBuffer, const VkSubpassBeginInfo* pSubpassBeginInfo, const VkSubpassEndInfo* pSubpassEndInfo) {}; virtual void PostCallRecordCmdNextSubpass2KHR(VkCommandBuffer commandBuffer, const VkSubpassBeginInfo* pSubpassBeginInfo, const VkSubpassEndInfo* pSubpassEndInfo) {}; virtual bool PreCallValidateCmdEndRenderPass2KHR(VkCommandBuffer commandBuffer, const VkSubpassEndInfo* pSubpassEndInfo) const { return false; }; virtual void PreCallRecordCmdEndRenderPass2KHR(VkCommandBuffer commandBuffer, const VkSubpassEndInfo* pSubpassEndInfo) {}; virtual void PostCallRecordCmdEndRenderPass2KHR(VkCommandBuffer commandBuffer, const VkSubpassEndInfo* pSubpassEndInfo) {}; virtual bool PreCallValidateGetSwapchainStatusKHR(VkDevice device, VkSwapchainKHR swapchain) const { return false; }; virtual void PreCallRecordGetSwapchainStatusKHR(VkDevice device, VkSwapchainKHR swapchain) {}; virtual void PostCallRecordGetSwapchainStatusKHR(VkDevice device, VkSwapchainKHR swapchain, VkResult result) {}; virtual bool PreCallValidateGetPhysicalDeviceExternalFencePropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, VkExternalFenceProperties* pExternalFenceProperties) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceExternalFencePropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, VkExternalFenceProperties* pExternalFenceProperties) {}; virtual void PostCallRecordGetPhysicalDeviceExternalFencePropertiesKHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceExternalFenceInfo* pExternalFenceInfo, VkExternalFenceProperties* pExternalFenceProperties) {}; #ifdef VK_USE_PLATFORM_WIN32_KHR virtual bool PreCallValidateImportFenceWin32HandleKHR(VkDevice device, const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo) const { return false; }; virtual void PreCallRecordImportFenceWin32HandleKHR(VkDevice device, const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo) {}; virtual void PostCallRecordImportFenceWin32HandleKHR(VkDevice device, const VkImportFenceWin32HandleInfoKHR* pImportFenceWin32HandleInfo, VkResult result) {}; #endif #ifdef VK_USE_PLATFORM_WIN32_KHR virtual bool PreCallValidateGetFenceWin32HandleKHR(VkDevice device, const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle) const { return false; }; virtual void PreCallRecordGetFenceWin32HandleKHR(VkDevice device, const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle) {}; virtual void PostCallRecordGetFenceWin32HandleKHR(VkDevice device, const VkFenceGetWin32HandleInfoKHR* pGetWin32HandleInfo, HANDLE* pHandle, VkResult result) {}; #endif virtual bool PreCallValidateImportFenceFdKHR(VkDevice device, const VkImportFenceFdInfoKHR* pImportFenceFdInfo) const { return false; }; virtual void PreCallRecordImportFenceFdKHR(VkDevice device, const VkImportFenceFdInfoKHR* pImportFenceFdInfo) {}; virtual void PostCallRecordImportFenceFdKHR(VkDevice device, const VkImportFenceFdInfoKHR* pImportFenceFdInfo, VkResult result) {}; virtual bool PreCallValidateGetFenceFdKHR(VkDevice device, const VkFenceGetFdInfoKHR* pGetFdInfo, int* pFd) const { return false; }; virtual void PreCallRecordGetFenceFdKHR(VkDevice device, const VkFenceGetFdInfoKHR* pGetFdInfo, int* pFd) {}; virtual void PostCallRecordGetFenceFdKHR(VkDevice device, const VkFenceGetFdInfoKHR* pGetFdInfo, int* pFd, VkResult result) {}; virtual bool PreCallValidateEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, uint32_t* pCounterCount, VkPerformanceCounterKHR* pCounters, VkPerformanceCounterDescriptionKHR* pCounterDescriptions) const { return false; }; virtual void PreCallRecordEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, uint32_t* pCounterCount, VkPerformanceCounterKHR* pCounters, VkPerformanceCounterDescriptionKHR* pCounterDescriptions) {}; virtual void PostCallRecordEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, uint32_t* pCounterCount, VkPerformanceCounterKHR* pCounters, VkPerformanceCounterDescriptionKHR* pCounterDescriptions, VkResult result) {}; virtual bool PreCallValidateGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR(VkPhysicalDevice physicalDevice, const VkQueryPoolPerformanceCreateInfoKHR* pPerformanceQueryCreateInfo, uint32_t* pNumPasses) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR(VkPhysicalDevice physicalDevice, const VkQueryPoolPerformanceCreateInfoKHR* pPerformanceQueryCreateInfo, uint32_t* pNumPasses) {}; virtual void PostCallRecordGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR(VkPhysicalDevice physicalDevice, const VkQueryPoolPerformanceCreateInfoKHR* pPerformanceQueryCreateInfo, uint32_t* pNumPasses) {}; virtual bool PreCallValidateAcquireProfilingLockKHR(VkDevice device, const VkAcquireProfilingLockInfoKHR* pInfo) const { return false; }; virtual void PreCallRecordAcquireProfilingLockKHR(VkDevice device, const VkAcquireProfilingLockInfoKHR* pInfo) {}; virtual void PostCallRecordAcquireProfilingLockKHR(VkDevice device, const VkAcquireProfilingLockInfoKHR* pInfo, VkResult result) {}; virtual bool PreCallValidateReleaseProfilingLockKHR(VkDevice device) const { return false; }; virtual void PreCallRecordReleaseProfilingLockKHR(VkDevice device) {}; virtual void PostCallRecordReleaseProfilingLockKHR(VkDevice device) {}; virtual bool PreCallValidateGetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, VkSurfaceCapabilities2KHR* pSurfaceCapabilities) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, VkSurfaceCapabilities2KHR* pSurfaceCapabilities) {}; virtual void PostCallRecordGetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, VkSurfaceCapabilities2KHR* pSurfaceCapabilities, VkResult result) {}; virtual bool PreCallValidateGetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, uint32_t* pSurfaceFormatCount, VkSurfaceFormat2KHR* pSurfaceFormats) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, uint32_t* pSurfaceFormatCount, VkSurfaceFormat2KHR* pSurfaceFormats) {}; virtual void PostCallRecordGetPhysicalDeviceSurfaceFormats2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, uint32_t* pSurfaceFormatCount, VkSurfaceFormat2KHR* pSurfaceFormats, VkResult result) {}; virtual bool PreCallValidateGetPhysicalDeviceDisplayProperties2KHR(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkDisplayProperties2KHR* pProperties) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceDisplayProperties2KHR(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkDisplayProperties2KHR* pProperties) {}; virtual void PostCallRecordGetPhysicalDeviceDisplayProperties2KHR(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkDisplayProperties2KHR* pProperties, VkResult result) {}; virtual bool PreCallValidateGetPhysicalDeviceDisplayPlaneProperties2KHR(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkDisplayPlaneProperties2KHR* pProperties) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceDisplayPlaneProperties2KHR(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkDisplayPlaneProperties2KHR* pProperties) {}; virtual void PostCallRecordGetPhysicalDeviceDisplayPlaneProperties2KHR(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkDisplayPlaneProperties2KHR* pProperties, VkResult result) {}; virtual bool PreCallValidateGetDisplayModeProperties2KHR(VkPhysicalDevice physicalDevice, VkDisplayKHR display, uint32_t* pPropertyCount, VkDisplayModeProperties2KHR* pProperties) const { return false; }; virtual void PreCallRecordGetDisplayModeProperties2KHR(VkPhysicalDevice physicalDevice, VkDisplayKHR display, uint32_t* pPropertyCount, VkDisplayModeProperties2KHR* pProperties) {}; virtual void PostCallRecordGetDisplayModeProperties2KHR(VkPhysicalDevice physicalDevice, VkDisplayKHR display, uint32_t* pPropertyCount, VkDisplayModeProperties2KHR* pProperties, VkResult result) {}; virtual bool PreCallValidateGetDisplayPlaneCapabilities2KHR(VkPhysicalDevice physicalDevice, const VkDisplayPlaneInfo2KHR* pDisplayPlaneInfo, VkDisplayPlaneCapabilities2KHR* pCapabilities) const { return false; }; virtual void PreCallRecordGetDisplayPlaneCapabilities2KHR(VkPhysicalDevice physicalDevice, const VkDisplayPlaneInfo2KHR* pDisplayPlaneInfo, VkDisplayPlaneCapabilities2KHR* pCapabilities) {}; virtual void PostCallRecordGetDisplayPlaneCapabilities2KHR(VkPhysicalDevice physicalDevice, const VkDisplayPlaneInfo2KHR* pDisplayPlaneInfo, VkDisplayPlaneCapabilities2KHR* pCapabilities, VkResult result) {}; virtual bool PreCallValidateGetImageMemoryRequirements2KHR(VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements) const { return false; }; virtual void PreCallRecordGetImageMemoryRequirements2KHR(VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements) {}; virtual void PostCallRecordGetImageMemoryRequirements2KHR(VkDevice device, const VkImageMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements) {}; virtual bool PreCallValidateGetBufferMemoryRequirements2KHR(VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements) const { return false; }; virtual void PreCallRecordGetBufferMemoryRequirements2KHR(VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements) {}; virtual void PostCallRecordGetBufferMemoryRequirements2KHR(VkDevice device, const VkBufferMemoryRequirementsInfo2* pInfo, VkMemoryRequirements2* pMemoryRequirements) {}; virtual bool PreCallValidateGetImageSparseMemoryRequirements2KHR(VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) const { return false; }; virtual void PreCallRecordGetImageSparseMemoryRequirements2KHR(VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) {}; virtual void PostCallRecordGetImageSparseMemoryRequirements2KHR(VkDevice device, const VkImageSparseMemoryRequirementsInfo2* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements) {}; virtual bool PreCallValidateCreateSamplerYcbcrConversionKHR(VkDevice device, const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSamplerYcbcrConversion* pYcbcrConversion) const { return false; }; virtual void PreCallRecordCreateSamplerYcbcrConversionKHR(VkDevice device, const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSamplerYcbcrConversion* pYcbcrConversion) {}; virtual void PostCallRecordCreateSamplerYcbcrConversionKHR(VkDevice device, const VkSamplerYcbcrConversionCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSamplerYcbcrConversion* pYcbcrConversion, VkResult result) {}; virtual bool PreCallValidateDestroySamplerYcbcrConversionKHR(VkDevice device, VkSamplerYcbcrConversion ycbcrConversion, const VkAllocationCallbacks* pAllocator) const { return false; }; virtual void PreCallRecordDestroySamplerYcbcrConversionKHR(VkDevice device, VkSamplerYcbcrConversion ycbcrConversion, const VkAllocationCallbacks* pAllocator) {}; virtual void PostCallRecordDestroySamplerYcbcrConversionKHR(VkDevice device, VkSamplerYcbcrConversion ycbcrConversion, const VkAllocationCallbacks* pAllocator) {}; virtual bool PreCallValidateBindBufferMemory2KHR(VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo* pBindInfos) const { return false; }; virtual void PreCallRecordBindBufferMemory2KHR(VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo* pBindInfos) {}; virtual void PostCallRecordBindBufferMemory2KHR(VkDevice device, uint32_t bindInfoCount, const VkBindBufferMemoryInfo* pBindInfos, VkResult result) {}; virtual bool PreCallValidateBindImageMemory2KHR(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo* pBindInfos) const { return false; }; virtual void PreCallRecordBindImageMemory2KHR(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo* pBindInfos) {}; virtual void PostCallRecordBindImageMemory2KHR(VkDevice device, uint32_t bindInfoCount, const VkBindImageMemoryInfo* pBindInfos, VkResult result) {}; virtual bool PreCallValidateGetDescriptorSetLayoutSupportKHR(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayoutSupport* pSupport) const { return false; }; virtual void PreCallRecordGetDescriptorSetLayoutSupportKHR(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayoutSupport* pSupport) {}; virtual void PostCallRecordGetDescriptorSetLayoutSupportKHR(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayoutSupport* pSupport) {}; virtual bool PreCallValidateCmdDrawIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) const { return false; }; virtual void PreCallRecordCmdDrawIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) {}; virtual void PostCallRecordCmdDrawIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) {}; virtual bool PreCallValidateCmdDrawIndexedIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) const { return false; }; virtual void PreCallRecordCmdDrawIndexedIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) {}; virtual void PostCallRecordCmdDrawIndexedIndirectCountKHR(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) {}; virtual bool PreCallValidateGetSemaphoreCounterValueKHR(VkDevice device, VkSemaphore semaphore, uint64_t* pValue) const { return false; }; virtual void PreCallRecordGetSemaphoreCounterValueKHR(VkDevice device, VkSemaphore semaphore, uint64_t* pValue) {}; virtual void PostCallRecordGetSemaphoreCounterValueKHR(VkDevice device, VkSemaphore semaphore, uint64_t* pValue, VkResult result) {}; virtual bool PreCallValidateWaitSemaphoresKHR(VkDevice device, const VkSemaphoreWaitInfo* pWaitInfo, uint64_t timeout) const { return false; }; virtual void PreCallRecordWaitSemaphoresKHR(VkDevice device, const VkSemaphoreWaitInfo* pWaitInfo, uint64_t timeout) {}; virtual void PostCallRecordWaitSemaphoresKHR(VkDevice device, const VkSemaphoreWaitInfo* pWaitInfo, uint64_t timeout, VkResult result) {}; virtual bool PreCallValidateSignalSemaphoreKHR(VkDevice device, const VkSemaphoreSignalInfo* pSignalInfo) const { return false; }; virtual void PreCallRecordSignalSemaphoreKHR(VkDevice device, const VkSemaphoreSignalInfo* pSignalInfo) {}; virtual void PostCallRecordSignalSemaphoreKHR(VkDevice device, const VkSemaphoreSignalInfo* pSignalInfo, VkResult result) {}; virtual bool PreCallValidateGetPhysicalDeviceFragmentShadingRatesKHR(VkPhysicalDevice physicalDevice, uint32_t* pFragmentShadingRateCount, VkPhysicalDeviceFragmentShadingRateKHR* pFragmentShadingRates) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceFragmentShadingRatesKHR(VkPhysicalDevice physicalDevice, uint32_t* pFragmentShadingRateCount, VkPhysicalDeviceFragmentShadingRateKHR* pFragmentShadingRates) {}; virtual void PostCallRecordGetPhysicalDeviceFragmentShadingRatesKHR(VkPhysicalDevice physicalDevice, uint32_t* pFragmentShadingRateCount, VkPhysicalDeviceFragmentShadingRateKHR* pFragmentShadingRates, VkResult result) {}; virtual bool PreCallValidateCmdSetFragmentShadingRateKHR(VkCommandBuffer commandBuffer, const VkExtent2D* pFragmentSize, const VkFragmentShadingRateCombinerOpKHR combinerOps[2]) const { return false; }; virtual void PreCallRecordCmdSetFragmentShadingRateKHR(VkCommandBuffer commandBuffer, const VkExtent2D* pFragmentSize, const VkFragmentShadingRateCombinerOpKHR combinerOps[2]) {}; virtual void PostCallRecordCmdSetFragmentShadingRateKHR(VkCommandBuffer commandBuffer, const VkExtent2D* pFragmentSize, const VkFragmentShadingRateCombinerOpKHR combinerOps[2]) {}; virtual bool PreCallValidateGetBufferDeviceAddressKHR(VkDevice device, const VkBufferDeviceAddressInfo* pInfo) const { return false; }; virtual void PreCallRecordGetBufferDeviceAddressKHR(VkDevice device, const VkBufferDeviceAddressInfo* pInfo) {}; virtual void PostCallRecordGetBufferDeviceAddressKHR(VkDevice device, const VkBufferDeviceAddressInfo* pInfo, VkDeviceAddress result) {}; virtual bool PreCallValidateGetBufferOpaqueCaptureAddressKHR(VkDevice device, const VkBufferDeviceAddressInfo* pInfo) const { return false; }; virtual void PreCallRecordGetBufferOpaqueCaptureAddressKHR(VkDevice device, const VkBufferDeviceAddressInfo* pInfo) {}; virtual void PostCallRecordGetBufferOpaqueCaptureAddressKHR(VkDevice device, const VkBufferDeviceAddressInfo* pInfo) {}; virtual bool PreCallValidateGetDeviceMemoryOpaqueCaptureAddressKHR(VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfo* pInfo) const { return false; }; virtual void PreCallRecordGetDeviceMemoryOpaqueCaptureAddressKHR(VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfo* pInfo) {}; virtual void PostCallRecordGetDeviceMemoryOpaqueCaptureAddressKHR(VkDevice device, const VkDeviceMemoryOpaqueCaptureAddressInfo* pInfo) {}; virtual bool PreCallValidateCreateDeferredOperationKHR(VkDevice device, const VkAllocationCallbacks* pAllocator, VkDeferredOperationKHR* pDeferredOperation) const { return false; }; virtual void PreCallRecordCreateDeferredOperationKHR(VkDevice device, const VkAllocationCallbacks* pAllocator, VkDeferredOperationKHR* pDeferredOperation) {}; virtual void PostCallRecordCreateDeferredOperationKHR(VkDevice device, const VkAllocationCallbacks* pAllocator, VkDeferredOperationKHR* pDeferredOperation, VkResult result) {}; virtual bool PreCallValidateDestroyDeferredOperationKHR(VkDevice device, VkDeferredOperationKHR operation, const VkAllocationCallbacks* pAllocator) const { return false; }; virtual void PreCallRecordDestroyDeferredOperationKHR(VkDevice device, VkDeferredOperationKHR operation, const VkAllocationCallbacks* pAllocator) {}; virtual void PostCallRecordDestroyDeferredOperationKHR(VkDevice device, VkDeferredOperationKHR operation, const VkAllocationCallbacks* pAllocator) {}; virtual bool PreCallValidateGetDeferredOperationMaxConcurrencyKHR(VkDevice device, VkDeferredOperationKHR operation) const { return false; }; virtual void PreCallRecordGetDeferredOperationMaxConcurrencyKHR(VkDevice device, VkDeferredOperationKHR operation) {}; virtual void PostCallRecordGetDeferredOperationMaxConcurrencyKHR(VkDevice device, VkDeferredOperationKHR operation) {}; virtual bool PreCallValidateGetDeferredOperationResultKHR(VkDevice device, VkDeferredOperationKHR operation) const { return false; }; virtual void PreCallRecordGetDeferredOperationResultKHR(VkDevice device, VkDeferredOperationKHR operation) {}; virtual void PostCallRecordGetDeferredOperationResultKHR(VkDevice device, VkDeferredOperationKHR operation, VkResult result) {}; virtual bool PreCallValidateDeferredOperationJoinKHR(VkDevice device, VkDeferredOperationKHR operation) const { return false; }; virtual void PreCallRecordDeferredOperationJoinKHR(VkDevice device, VkDeferredOperationKHR operation) {}; virtual void PostCallRecordDeferredOperationJoinKHR(VkDevice device, VkDeferredOperationKHR operation, VkResult result) {}; virtual bool PreCallValidateGetPipelineExecutablePropertiesKHR(VkDevice device, const VkPipelineInfoKHR* pPipelineInfo, uint32_t* pExecutableCount, VkPipelineExecutablePropertiesKHR* pProperties) const { return false; }; virtual void PreCallRecordGetPipelineExecutablePropertiesKHR(VkDevice device, const VkPipelineInfoKHR* pPipelineInfo, uint32_t* pExecutableCount, VkPipelineExecutablePropertiesKHR* pProperties) {}; virtual void PostCallRecordGetPipelineExecutablePropertiesKHR(VkDevice device, const VkPipelineInfoKHR* pPipelineInfo, uint32_t* pExecutableCount, VkPipelineExecutablePropertiesKHR* pProperties, VkResult result) {}; virtual bool PreCallValidateGetPipelineExecutableStatisticsKHR(VkDevice device, const VkPipelineExecutableInfoKHR* pExecutableInfo, uint32_t* pStatisticCount, VkPipelineExecutableStatisticKHR* pStatistics) const { return false; }; virtual void PreCallRecordGetPipelineExecutableStatisticsKHR(VkDevice device, const VkPipelineExecutableInfoKHR* pExecutableInfo, uint32_t* pStatisticCount, VkPipelineExecutableStatisticKHR* pStatistics) {}; virtual void PostCallRecordGetPipelineExecutableStatisticsKHR(VkDevice device, const VkPipelineExecutableInfoKHR* pExecutableInfo, uint32_t* pStatisticCount, VkPipelineExecutableStatisticKHR* pStatistics, VkResult result) {}; virtual bool PreCallValidateGetPipelineExecutableInternalRepresentationsKHR(VkDevice device, const VkPipelineExecutableInfoKHR* pExecutableInfo, uint32_t* pInternalRepresentationCount, VkPipelineExecutableInternalRepresentationKHR* pInternalRepresentations) const { return false; }; virtual void PreCallRecordGetPipelineExecutableInternalRepresentationsKHR(VkDevice device, const VkPipelineExecutableInfoKHR* pExecutableInfo, uint32_t* pInternalRepresentationCount, VkPipelineExecutableInternalRepresentationKHR* pInternalRepresentations) {}; virtual void PostCallRecordGetPipelineExecutableInternalRepresentationsKHR(VkDevice device, const VkPipelineExecutableInfoKHR* pExecutableInfo, uint32_t* pInternalRepresentationCount, VkPipelineExecutableInternalRepresentationKHR* pInternalRepresentations, VkResult result) {}; virtual bool PreCallValidateCmdCopyBuffer2KHR(VkCommandBuffer commandBuffer, const VkCopyBufferInfo2KHR* pCopyBufferInfo) const { return false; }; virtual void PreCallRecordCmdCopyBuffer2KHR(VkCommandBuffer commandBuffer, const VkCopyBufferInfo2KHR* pCopyBufferInfo) {}; virtual void PostCallRecordCmdCopyBuffer2KHR(VkCommandBuffer commandBuffer, const VkCopyBufferInfo2KHR* pCopyBufferInfo) {}; virtual bool PreCallValidateCmdCopyImage2KHR(VkCommandBuffer commandBuffer, const VkCopyImageInfo2KHR* pCopyImageInfo) const { return false; }; virtual void PreCallRecordCmdCopyImage2KHR(VkCommandBuffer commandBuffer, const VkCopyImageInfo2KHR* pCopyImageInfo) {}; virtual void PostCallRecordCmdCopyImage2KHR(VkCommandBuffer commandBuffer, const VkCopyImageInfo2KHR* pCopyImageInfo) {}; virtual bool PreCallValidateCmdCopyBufferToImage2KHR(VkCommandBuffer commandBuffer, const VkCopyBufferToImageInfo2KHR* pCopyBufferToImageInfo) const { return false; }; virtual void PreCallRecordCmdCopyBufferToImage2KHR(VkCommandBuffer commandBuffer, const VkCopyBufferToImageInfo2KHR* pCopyBufferToImageInfo) {}; virtual void PostCallRecordCmdCopyBufferToImage2KHR(VkCommandBuffer commandBuffer, const VkCopyBufferToImageInfo2KHR* pCopyBufferToImageInfo) {}; virtual bool PreCallValidateCmdCopyImageToBuffer2KHR(VkCommandBuffer commandBuffer, const VkCopyImageToBufferInfo2KHR* pCopyImageToBufferInfo) const { return false; }; virtual void PreCallRecordCmdCopyImageToBuffer2KHR(VkCommandBuffer commandBuffer, const VkCopyImageToBufferInfo2KHR* pCopyImageToBufferInfo) {}; virtual void PostCallRecordCmdCopyImageToBuffer2KHR(VkCommandBuffer commandBuffer, const VkCopyImageToBufferInfo2KHR* pCopyImageToBufferInfo) {}; virtual bool PreCallValidateCmdBlitImage2KHR(VkCommandBuffer commandBuffer, const VkBlitImageInfo2KHR* pBlitImageInfo) const { return false; }; virtual void PreCallRecordCmdBlitImage2KHR(VkCommandBuffer commandBuffer, const VkBlitImageInfo2KHR* pBlitImageInfo) {}; virtual void PostCallRecordCmdBlitImage2KHR(VkCommandBuffer commandBuffer, const VkBlitImageInfo2KHR* pBlitImageInfo) {}; virtual bool PreCallValidateCmdResolveImage2KHR(VkCommandBuffer commandBuffer, const VkResolveImageInfo2KHR* pResolveImageInfo) const { return false; }; virtual void PreCallRecordCmdResolveImage2KHR(VkCommandBuffer commandBuffer, const VkResolveImageInfo2KHR* pResolveImageInfo) {}; virtual void PostCallRecordCmdResolveImage2KHR(VkCommandBuffer commandBuffer, const VkResolveImageInfo2KHR* pResolveImageInfo) {}; virtual bool PreCallValidateCreateDebugReportCallbackEXT(VkInstance instance, const VkDebugReportCallbackCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDebugReportCallbackEXT* pCallback) const { return false; }; virtual void PreCallRecordCreateDebugReportCallbackEXT(VkInstance instance, const VkDebugReportCallbackCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDebugReportCallbackEXT* pCallback) {}; virtual void PostCallRecordCreateDebugReportCallbackEXT(VkInstance instance, const VkDebugReportCallbackCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDebugReportCallbackEXT* pCallback, VkResult result) {}; virtual bool PreCallValidateDestroyDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackEXT callback, const VkAllocationCallbacks* pAllocator) const { return false; }; virtual void PreCallRecordDestroyDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackEXT callback, const VkAllocationCallbacks* pAllocator) {}; virtual void PostCallRecordDestroyDebugReportCallbackEXT(VkInstance instance, VkDebugReportCallbackEXT callback, const VkAllocationCallbacks* pAllocator) {}; virtual bool PreCallValidateDebugReportMessageEXT(VkInstance instance, VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const char* pLayerPrefix, const char* pMessage) const { return false; }; virtual void PreCallRecordDebugReportMessageEXT(VkInstance instance, VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const char* pLayerPrefix, const char* pMessage) {}; virtual void PostCallRecordDebugReportMessageEXT(VkInstance instance, VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, uint64_t object, size_t location, int32_t messageCode, const char* pLayerPrefix, const char* pMessage) {}; virtual bool PreCallValidateDebugMarkerSetObjectTagEXT(VkDevice device, const VkDebugMarkerObjectTagInfoEXT* pTagInfo) const { return false; }; virtual void PreCallRecordDebugMarkerSetObjectTagEXT(VkDevice device, const VkDebugMarkerObjectTagInfoEXT* pTagInfo) {}; virtual void PostCallRecordDebugMarkerSetObjectTagEXT(VkDevice device, const VkDebugMarkerObjectTagInfoEXT* pTagInfo, VkResult result) {}; virtual bool PreCallValidateDebugMarkerSetObjectNameEXT(VkDevice device, const VkDebugMarkerObjectNameInfoEXT* pNameInfo) const { return false; }; virtual void PreCallRecordDebugMarkerSetObjectNameEXT(VkDevice device, const VkDebugMarkerObjectNameInfoEXT* pNameInfo) {}; virtual void PostCallRecordDebugMarkerSetObjectNameEXT(VkDevice device, const VkDebugMarkerObjectNameInfoEXT* pNameInfo, VkResult result) {}; virtual bool PreCallValidateCmdDebugMarkerBeginEXT(VkCommandBuffer commandBuffer, const VkDebugMarkerMarkerInfoEXT* pMarkerInfo) const { return false; }; virtual void PreCallRecordCmdDebugMarkerBeginEXT(VkCommandBuffer commandBuffer, const VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {}; virtual void PostCallRecordCmdDebugMarkerBeginEXT(VkCommandBuffer commandBuffer, const VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {}; virtual bool PreCallValidateCmdDebugMarkerEndEXT(VkCommandBuffer commandBuffer) const { return false; }; virtual void PreCallRecordCmdDebugMarkerEndEXT(VkCommandBuffer commandBuffer) {}; virtual void PostCallRecordCmdDebugMarkerEndEXT(VkCommandBuffer commandBuffer) {}; virtual bool PreCallValidateCmdDebugMarkerInsertEXT(VkCommandBuffer commandBuffer, const VkDebugMarkerMarkerInfoEXT* pMarkerInfo) const { return false; }; virtual void PreCallRecordCmdDebugMarkerInsertEXT(VkCommandBuffer commandBuffer, const VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {}; virtual void PostCallRecordCmdDebugMarkerInsertEXT(VkCommandBuffer commandBuffer, const VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {}; virtual bool PreCallValidateCmdBindTransformFeedbackBuffersEXT(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets, const VkDeviceSize* pSizes) const { return false; }; virtual void PreCallRecordCmdBindTransformFeedbackBuffersEXT(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets, const VkDeviceSize* pSizes) {}; virtual void PostCallRecordCmdBindTransformFeedbackBuffersEXT(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets, const VkDeviceSize* pSizes) {}; virtual bool PreCallValidateCmdBeginTransformFeedbackEXT(VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer, uint32_t counterBufferCount, const VkBuffer* pCounterBuffers, const VkDeviceSize* pCounterBufferOffsets) const { return false; }; virtual void PreCallRecordCmdBeginTransformFeedbackEXT(VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer, uint32_t counterBufferCount, const VkBuffer* pCounterBuffers, const VkDeviceSize* pCounterBufferOffsets) {}; virtual void PostCallRecordCmdBeginTransformFeedbackEXT(VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer, uint32_t counterBufferCount, const VkBuffer* pCounterBuffers, const VkDeviceSize* pCounterBufferOffsets) {}; virtual bool PreCallValidateCmdEndTransformFeedbackEXT(VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer, uint32_t counterBufferCount, const VkBuffer* pCounterBuffers, const VkDeviceSize* pCounterBufferOffsets) const { return false; }; virtual void PreCallRecordCmdEndTransformFeedbackEXT(VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer, uint32_t counterBufferCount, const VkBuffer* pCounterBuffers, const VkDeviceSize* pCounterBufferOffsets) {}; virtual void PostCallRecordCmdEndTransformFeedbackEXT(VkCommandBuffer commandBuffer, uint32_t firstCounterBuffer, uint32_t counterBufferCount, const VkBuffer* pCounterBuffers, const VkDeviceSize* pCounterBufferOffsets) {}; virtual bool PreCallValidateCmdBeginQueryIndexedEXT(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags, uint32_t index) const { return false; }; virtual void PreCallRecordCmdBeginQueryIndexedEXT(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags, uint32_t index) {}; virtual void PostCallRecordCmdBeginQueryIndexedEXT(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, VkQueryControlFlags flags, uint32_t index) {}; virtual bool PreCallValidateCmdEndQueryIndexedEXT(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, uint32_t index) const { return false; }; virtual void PreCallRecordCmdEndQueryIndexedEXT(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, uint32_t index) {}; virtual void PostCallRecordCmdEndQueryIndexedEXT(VkCommandBuffer commandBuffer, VkQueryPool queryPool, uint32_t query, uint32_t index) {}; virtual bool PreCallValidateCmdDrawIndirectByteCountEXT(VkCommandBuffer commandBuffer, uint32_t instanceCount, uint32_t firstInstance, VkBuffer counterBuffer, VkDeviceSize counterBufferOffset, uint32_t counterOffset, uint32_t vertexStride) const { return false; }; virtual void PreCallRecordCmdDrawIndirectByteCountEXT(VkCommandBuffer commandBuffer, uint32_t instanceCount, uint32_t firstInstance, VkBuffer counterBuffer, VkDeviceSize counterBufferOffset, uint32_t counterOffset, uint32_t vertexStride) {}; virtual void PostCallRecordCmdDrawIndirectByteCountEXT(VkCommandBuffer commandBuffer, uint32_t instanceCount, uint32_t firstInstance, VkBuffer counterBuffer, VkDeviceSize counterBufferOffset, uint32_t counterOffset, uint32_t vertexStride) {}; virtual bool PreCallValidateGetImageViewHandleNVX(VkDevice device, const VkImageViewHandleInfoNVX* pInfo) const { return false; }; virtual void PreCallRecordGetImageViewHandleNVX(VkDevice device, const VkImageViewHandleInfoNVX* pInfo) {}; virtual void PostCallRecordGetImageViewHandleNVX(VkDevice device, const VkImageViewHandleInfoNVX* pInfo) {}; virtual bool PreCallValidateGetImageViewAddressNVX(VkDevice device, VkImageView imageView, VkImageViewAddressPropertiesNVX* pProperties) const { return false; }; virtual void PreCallRecordGetImageViewAddressNVX(VkDevice device, VkImageView imageView, VkImageViewAddressPropertiesNVX* pProperties) {}; virtual void PostCallRecordGetImageViewAddressNVX(VkDevice device, VkImageView imageView, VkImageViewAddressPropertiesNVX* pProperties, VkResult result) {}; virtual bool PreCallValidateCmdDrawIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) const { return false; }; virtual void PreCallRecordCmdDrawIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) {}; virtual void PostCallRecordCmdDrawIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) {}; virtual bool PreCallValidateCmdDrawIndexedIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) const { return false; }; virtual void PreCallRecordCmdDrawIndexedIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) {}; virtual void PostCallRecordCmdDrawIndexedIndirectCountAMD(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) {}; virtual bool PreCallValidateGetShaderInfoAMD(VkDevice device, VkPipeline pipeline, VkShaderStageFlagBits shaderStage, VkShaderInfoTypeAMD infoType, size_t* pInfoSize, void* pInfo) const { return false; }; virtual void PreCallRecordGetShaderInfoAMD(VkDevice device, VkPipeline pipeline, VkShaderStageFlagBits shaderStage, VkShaderInfoTypeAMD infoType, size_t* pInfoSize, void* pInfo) {}; virtual void PostCallRecordGetShaderInfoAMD(VkDevice device, VkPipeline pipeline, VkShaderStageFlagBits shaderStage, VkShaderInfoTypeAMD infoType, size_t* pInfoSize, void* pInfo, VkResult result) {}; #ifdef VK_USE_PLATFORM_GGP virtual bool PreCallValidateCreateStreamDescriptorSurfaceGGP(VkInstance instance, const VkStreamDescriptorSurfaceCreateInfoGGP* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) const { return false; }; virtual void PreCallRecordCreateStreamDescriptorSurfaceGGP(VkInstance instance, const VkStreamDescriptorSurfaceCreateInfoGGP* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) {}; virtual void PostCallRecordCreateStreamDescriptorSurfaceGGP(VkInstance instance, const VkStreamDescriptorSurfaceCreateInfoGGP* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, VkResult result) {}; #endif virtual bool PreCallValidateGetPhysicalDeviceExternalImageFormatPropertiesNV(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkExternalMemoryHandleTypeFlagsNV externalHandleType, VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceExternalImageFormatPropertiesNV(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkExternalMemoryHandleTypeFlagsNV externalHandleType, VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties) {}; virtual void PostCallRecordGetPhysicalDeviceExternalImageFormatPropertiesNV(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkExternalMemoryHandleTypeFlagsNV externalHandleType, VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties, VkResult result) {}; #ifdef VK_USE_PLATFORM_WIN32_KHR virtual bool PreCallValidateGetMemoryWin32HandleNV(VkDevice device, VkDeviceMemory memory, VkExternalMemoryHandleTypeFlagsNV handleType, HANDLE* pHandle) const { return false; }; virtual void PreCallRecordGetMemoryWin32HandleNV(VkDevice device, VkDeviceMemory memory, VkExternalMemoryHandleTypeFlagsNV handleType, HANDLE* pHandle) {}; virtual void PostCallRecordGetMemoryWin32HandleNV(VkDevice device, VkDeviceMemory memory, VkExternalMemoryHandleTypeFlagsNV handleType, HANDLE* pHandle, VkResult result) {}; #endif #ifdef VK_USE_PLATFORM_VI_NN virtual bool PreCallValidateCreateViSurfaceNN(VkInstance instance, const VkViSurfaceCreateInfoNN* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) const { return false; }; virtual void PreCallRecordCreateViSurfaceNN(VkInstance instance, const VkViSurfaceCreateInfoNN* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) {}; virtual void PostCallRecordCreateViSurfaceNN(VkInstance instance, const VkViSurfaceCreateInfoNN* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, VkResult result) {}; #endif virtual bool PreCallValidateCmdBeginConditionalRenderingEXT(VkCommandBuffer commandBuffer, const VkConditionalRenderingBeginInfoEXT* pConditionalRenderingBegin) const { return false; }; virtual void PreCallRecordCmdBeginConditionalRenderingEXT(VkCommandBuffer commandBuffer, const VkConditionalRenderingBeginInfoEXT* pConditionalRenderingBegin) {}; virtual void PostCallRecordCmdBeginConditionalRenderingEXT(VkCommandBuffer commandBuffer, const VkConditionalRenderingBeginInfoEXT* pConditionalRenderingBegin) {}; virtual bool PreCallValidateCmdEndConditionalRenderingEXT(VkCommandBuffer commandBuffer) const { return false; }; virtual void PreCallRecordCmdEndConditionalRenderingEXT(VkCommandBuffer commandBuffer) {}; virtual void PostCallRecordCmdEndConditionalRenderingEXT(VkCommandBuffer commandBuffer) {}; virtual bool PreCallValidateCmdSetViewportWScalingNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewportWScalingNV* pViewportWScalings) const { return false; }; virtual void PreCallRecordCmdSetViewportWScalingNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewportWScalingNV* pViewportWScalings) {}; virtual void PostCallRecordCmdSetViewportWScalingNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewportWScalingNV* pViewportWScalings) {}; virtual bool PreCallValidateReleaseDisplayEXT(VkPhysicalDevice physicalDevice, VkDisplayKHR display) const { return false; }; virtual void PreCallRecordReleaseDisplayEXT(VkPhysicalDevice physicalDevice, VkDisplayKHR display) {}; virtual void PostCallRecordReleaseDisplayEXT(VkPhysicalDevice physicalDevice, VkDisplayKHR display, VkResult result) {}; #ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT virtual bool PreCallValidateAcquireXlibDisplayEXT(VkPhysicalDevice physicalDevice, Display* dpy, VkDisplayKHR display) const { return false; }; virtual void PreCallRecordAcquireXlibDisplayEXT(VkPhysicalDevice physicalDevice, Display* dpy, VkDisplayKHR display) {}; virtual void PostCallRecordAcquireXlibDisplayEXT(VkPhysicalDevice physicalDevice, Display* dpy, VkDisplayKHR display, VkResult result) {}; #endif #ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT virtual bool PreCallValidateGetRandROutputDisplayEXT(VkPhysicalDevice physicalDevice, Display* dpy, RROutput rrOutput, VkDisplayKHR* pDisplay) const { return false; }; virtual void PreCallRecordGetRandROutputDisplayEXT(VkPhysicalDevice physicalDevice, Display* dpy, RROutput rrOutput, VkDisplayKHR* pDisplay) {}; virtual void PostCallRecordGetRandROutputDisplayEXT(VkPhysicalDevice physicalDevice, Display* dpy, RROutput rrOutput, VkDisplayKHR* pDisplay, VkResult result) {}; #endif virtual bool PreCallValidateGetPhysicalDeviceSurfaceCapabilities2EXT(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilities2EXT* pSurfaceCapabilities) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceSurfaceCapabilities2EXT(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilities2EXT* pSurfaceCapabilities) {}; virtual void PostCallRecordGetPhysicalDeviceSurfaceCapabilities2EXT(VkPhysicalDevice physicalDevice, VkSurfaceKHR surface, VkSurfaceCapabilities2EXT* pSurfaceCapabilities, VkResult result) {}; virtual bool PreCallValidateDisplayPowerControlEXT(VkDevice device, VkDisplayKHR display, const VkDisplayPowerInfoEXT* pDisplayPowerInfo) const { return false; }; virtual void PreCallRecordDisplayPowerControlEXT(VkDevice device, VkDisplayKHR display, const VkDisplayPowerInfoEXT* pDisplayPowerInfo) {}; virtual void PostCallRecordDisplayPowerControlEXT(VkDevice device, VkDisplayKHR display, const VkDisplayPowerInfoEXT* pDisplayPowerInfo, VkResult result) {}; virtual bool PreCallValidateRegisterDeviceEventEXT(VkDevice device, const VkDeviceEventInfoEXT* pDeviceEventInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence) const { return false; }; virtual void PreCallRecordRegisterDeviceEventEXT(VkDevice device, const VkDeviceEventInfoEXT* pDeviceEventInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence) {}; virtual void PostCallRecordRegisterDeviceEventEXT(VkDevice device, const VkDeviceEventInfoEXT* pDeviceEventInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence, VkResult result) {}; virtual bool PreCallValidateRegisterDisplayEventEXT(VkDevice device, VkDisplayKHR display, const VkDisplayEventInfoEXT* pDisplayEventInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence) const { return false; }; virtual void PreCallRecordRegisterDisplayEventEXT(VkDevice device, VkDisplayKHR display, const VkDisplayEventInfoEXT* pDisplayEventInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence) {}; virtual void PostCallRecordRegisterDisplayEventEXT(VkDevice device, VkDisplayKHR display, const VkDisplayEventInfoEXT* pDisplayEventInfo, const VkAllocationCallbacks* pAllocator, VkFence* pFence, VkResult result) {}; virtual bool PreCallValidateGetSwapchainCounterEXT(VkDevice device, VkSwapchainKHR swapchain, VkSurfaceCounterFlagBitsEXT counter, uint64_t* pCounterValue) const { return false; }; virtual void PreCallRecordGetSwapchainCounterEXT(VkDevice device, VkSwapchainKHR swapchain, VkSurfaceCounterFlagBitsEXT counter, uint64_t* pCounterValue) {}; virtual void PostCallRecordGetSwapchainCounterEXT(VkDevice device, VkSwapchainKHR swapchain, VkSurfaceCounterFlagBitsEXT counter, uint64_t* pCounterValue, VkResult result) {}; virtual bool PreCallValidateGetRefreshCycleDurationGOOGLE(VkDevice device, VkSwapchainKHR swapchain, VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties) const { return false; }; virtual void PreCallRecordGetRefreshCycleDurationGOOGLE(VkDevice device, VkSwapchainKHR swapchain, VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties) {}; virtual void PostCallRecordGetRefreshCycleDurationGOOGLE(VkDevice device, VkSwapchainKHR swapchain, VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties, VkResult result) {}; virtual bool PreCallValidateGetPastPresentationTimingGOOGLE(VkDevice device, VkSwapchainKHR swapchain, uint32_t* pPresentationTimingCount, VkPastPresentationTimingGOOGLE* pPresentationTimings) const { return false; }; virtual void PreCallRecordGetPastPresentationTimingGOOGLE(VkDevice device, VkSwapchainKHR swapchain, uint32_t* pPresentationTimingCount, VkPastPresentationTimingGOOGLE* pPresentationTimings) {}; virtual void PostCallRecordGetPastPresentationTimingGOOGLE(VkDevice device, VkSwapchainKHR swapchain, uint32_t* pPresentationTimingCount, VkPastPresentationTimingGOOGLE* pPresentationTimings, VkResult result) {}; virtual bool PreCallValidateCmdSetDiscardRectangleEXT(VkCommandBuffer commandBuffer, uint32_t firstDiscardRectangle, uint32_t discardRectangleCount, const VkRect2D* pDiscardRectangles) const { return false; }; virtual void PreCallRecordCmdSetDiscardRectangleEXT(VkCommandBuffer commandBuffer, uint32_t firstDiscardRectangle, uint32_t discardRectangleCount, const VkRect2D* pDiscardRectangles) {}; virtual void PostCallRecordCmdSetDiscardRectangleEXT(VkCommandBuffer commandBuffer, uint32_t firstDiscardRectangle, uint32_t discardRectangleCount, const VkRect2D* pDiscardRectangles) {}; virtual bool PreCallValidateSetHdrMetadataEXT(VkDevice device, uint32_t swapchainCount, const VkSwapchainKHR* pSwapchains, const VkHdrMetadataEXT* pMetadata) const { return false; }; virtual void PreCallRecordSetHdrMetadataEXT(VkDevice device, uint32_t swapchainCount, const VkSwapchainKHR* pSwapchains, const VkHdrMetadataEXT* pMetadata) {}; virtual void PostCallRecordSetHdrMetadataEXT(VkDevice device, uint32_t swapchainCount, const VkSwapchainKHR* pSwapchains, const VkHdrMetadataEXT* pMetadata) {}; #ifdef VK_USE_PLATFORM_IOS_MVK virtual bool PreCallValidateCreateIOSSurfaceMVK(VkInstance instance, const VkIOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) const { return false; }; virtual void PreCallRecordCreateIOSSurfaceMVK(VkInstance instance, const VkIOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) {}; virtual void PostCallRecordCreateIOSSurfaceMVK(VkInstance instance, const VkIOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, VkResult result) {}; #endif #ifdef VK_USE_PLATFORM_MACOS_MVK virtual bool PreCallValidateCreateMacOSSurfaceMVK(VkInstance instance, const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) const { return false; }; virtual void PreCallRecordCreateMacOSSurfaceMVK(VkInstance instance, const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) {}; virtual void PostCallRecordCreateMacOSSurfaceMVK(VkInstance instance, const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, VkResult result) {}; #endif virtual bool PreCallValidateSetDebugUtilsObjectNameEXT(VkDevice device, const VkDebugUtilsObjectNameInfoEXT* pNameInfo) const { return false; }; virtual void PreCallRecordSetDebugUtilsObjectNameEXT(VkDevice device, const VkDebugUtilsObjectNameInfoEXT* pNameInfo) {}; virtual void PostCallRecordSetDebugUtilsObjectNameEXT(VkDevice device, const VkDebugUtilsObjectNameInfoEXT* pNameInfo, VkResult result) {}; virtual bool PreCallValidateSetDebugUtilsObjectTagEXT(VkDevice device, const VkDebugUtilsObjectTagInfoEXT* pTagInfo) const { return false; }; virtual void PreCallRecordSetDebugUtilsObjectTagEXT(VkDevice device, const VkDebugUtilsObjectTagInfoEXT* pTagInfo) {}; virtual void PostCallRecordSetDebugUtilsObjectTagEXT(VkDevice device, const VkDebugUtilsObjectTagInfoEXT* pTagInfo, VkResult result) {}; virtual bool PreCallValidateQueueBeginDebugUtilsLabelEXT(VkQueue queue, const VkDebugUtilsLabelEXT* pLabelInfo) const { return false; }; virtual void PreCallRecordQueueBeginDebugUtilsLabelEXT(VkQueue queue, const VkDebugUtilsLabelEXT* pLabelInfo) {}; virtual void PostCallRecordQueueBeginDebugUtilsLabelEXT(VkQueue queue, const VkDebugUtilsLabelEXT* pLabelInfo) {}; virtual bool PreCallValidateQueueEndDebugUtilsLabelEXT(VkQueue queue) const { return false; }; virtual void PreCallRecordQueueEndDebugUtilsLabelEXT(VkQueue queue) {}; virtual void PostCallRecordQueueEndDebugUtilsLabelEXT(VkQueue queue) {}; virtual bool PreCallValidateQueueInsertDebugUtilsLabelEXT(VkQueue queue, const VkDebugUtilsLabelEXT* pLabelInfo) const { return false; }; virtual void PreCallRecordQueueInsertDebugUtilsLabelEXT(VkQueue queue, const VkDebugUtilsLabelEXT* pLabelInfo) {}; virtual void PostCallRecordQueueInsertDebugUtilsLabelEXT(VkQueue queue, const VkDebugUtilsLabelEXT* pLabelInfo) {}; virtual bool PreCallValidateCmdBeginDebugUtilsLabelEXT(VkCommandBuffer commandBuffer, const VkDebugUtilsLabelEXT* pLabelInfo) const { return false; }; virtual void PreCallRecordCmdBeginDebugUtilsLabelEXT(VkCommandBuffer commandBuffer, const VkDebugUtilsLabelEXT* pLabelInfo) {}; virtual void PostCallRecordCmdBeginDebugUtilsLabelEXT(VkCommandBuffer commandBuffer, const VkDebugUtilsLabelEXT* pLabelInfo) {}; virtual bool PreCallValidateCmdEndDebugUtilsLabelEXT(VkCommandBuffer commandBuffer) const { return false; }; virtual void PreCallRecordCmdEndDebugUtilsLabelEXT(VkCommandBuffer commandBuffer) {}; virtual void PostCallRecordCmdEndDebugUtilsLabelEXT(VkCommandBuffer commandBuffer) {}; virtual bool PreCallValidateCmdInsertDebugUtilsLabelEXT(VkCommandBuffer commandBuffer, const VkDebugUtilsLabelEXT* pLabelInfo) const { return false; }; virtual void PreCallRecordCmdInsertDebugUtilsLabelEXT(VkCommandBuffer commandBuffer, const VkDebugUtilsLabelEXT* pLabelInfo) {}; virtual void PostCallRecordCmdInsertDebugUtilsLabelEXT(VkCommandBuffer commandBuffer, const VkDebugUtilsLabelEXT* pLabelInfo) {}; virtual bool PreCallValidateCreateDebugUtilsMessengerEXT(VkInstance instance, const VkDebugUtilsMessengerCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDebugUtilsMessengerEXT* pMessenger) const { return false; }; virtual void PreCallRecordCreateDebugUtilsMessengerEXT(VkInstance instance, const VkDebugUtilsMessengerCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDebugUtilsMessengerEXT* pMessenger) {}; virtual void PostCallRecordCreateDebugUtilsMessengerEXT(VkInstance instance, const VkDebugUtilsMessengerCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDebugUtilsMessengerEXT* pMessenger, VkResult result) {}; virtual bool PreCallValidateDestroyDebugUtilsMessengerEXT(VkInstance instance, VkDebugUtilsMessengerEXT messenger, const VkAllocationCallbacks* pAllocator) const { return false; }; virtual void PreCallRecordDestroyDebugUtilsMessengerEXT(VkInstance instance, VkDebugUtilsMessengerEXT messenger, const VkAllocationCallbacks* pAllocator) {}; virtual void PostCallRecordDestroyDebugUtilsMessengerEXT(VkInstance instance, VkDebugUtilsMessengerEXT messenger, const VkAllocationCallbacks* pAllocator) {}; virtual bool PreCallValidateSubmitDebugUtilsMessageEXT(VkInstance instance, VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, VkDebugUtilsMessageTypeFlagsEXT messageTypes, const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData) const { return false; }; virtual void PreCallRecordSubmitDebugUtilsMessageEXT(VkInstance instance, VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, VkDebugUtilsMessageTypeFlagsEXT messageTypes, const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData) {}; virtual void PostCallRecordSubmitDebugUtilsMessageEXT(VkInstance instance, VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, VkDebugUtilsMessageTypeFlagsEXT messageTypes, const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData) {}; #ifdef VK_USE_PLATFORM_ANDROID_KHR virtual bool PreCallValidateGetAndroidHardwareBufferPropertiesANDROID(VkDevice device, const struct AHardwareBuffer* buffer, VkAndroidHardwareBufferPropertiesANDROID* pProperties) const { return false; }; virtual void PreCallRecordGetAndroidHardwareBufferPropertiesANDROID(VkDevice device, const struct AHardwareBuffer* buffer, VkAndroidHardwareBufferPropertiesANDROID* pProperties) {}; virtual void PostCallRecordGetAndroidHardwareBufferPropertiesANDROID(VkDevice device, const struct AHardwareBuffer* buffer, VkAndroidHardwareBufferPropertiesANDROID* pProperties, VkResult result) {}; #endif #ifdef VK_USE_PLATFORM_ANDROID_KHR virtual bool PreCallValidateGetMemoryAndroidHardwareBufferANDROID(VkDevice device, const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, struct AHardwareBuffer** pBuffer) const { return false; }; virtual void PreCallRecordGetMemoryAndroidHardwareBufferANDROID(VkDevice device, const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, struct AHardwareBuffer** pBuffer) {}; virtual void PostCallRecordGetMemoryAndroidHardwareBufferANDROID(VkDevice device, const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, struct AHardwareBuffer** pBuffer, VkResult result) {}; #endif virtual bool PreCallValidateCmdSetSampleLocationsEXT(VkCommandBuffer commandBuffer, const VkSampleLocationsInfoEXT* pSampleLocationsInfo) const { return false; }; virtual void PreCallRecordCmdSetSampleLocationsEXT(VkCommandBuffer commandBuffer, const VkSampleLocationsInfoEXT* pSampleLocationsInfo) {}; virtual void PostCallRecordCmdSetSampleLocationsEXT(VkCommandBuffer commandBuffer, const VkSampleLocationsInfoEXT* pSampleLocationsInfo) {}; virtual bool PreCallValidateGetPhysicalDeviceMultisamplePropertiesEXT(VkPhysicalDevice physicalDevice, VkSampleCountFlagBits samples, VkMultisamplePropertiesEXT* pMultisampleProperties) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceMultisamplePropertiesEXT(VkPhysicalDevice physicalDevice, VkSampleCountFlagBits samples, VkMultisamplePropertiesEXT* pMultisampleProperties) {}; virtual void PostCallRecordGetPhysicalDeviceMultisamplePropertiesEXT(VkPhysicalDevice physicalDevice, VkSampleCountFlagBits samples, VkMultisamplePropertiesEXT* pMultisampleProperties) {}; virtual bool PreCallValidateGetImageDrmFormatModifierPropertiesEXT(VkDevice device, VkImage image, VkImageDrmFormatModifierPropertiesEXT* pProperties) const { return false; }; virtual void PreCallRecordGetImageDrmFormatModifierPropertiesEXT(VkDevice device, VkImage image, VkImageDrmFormatModifierPropertiesEXT* pProperties) {}; virtual void PostCallRecordGetImageDrmFormatModifierPropertiesEXT(VkDevice device, VkImage image, VkImageDrmFormatModifierPropertiesEXT* pProperties, VkResult result) {}; virtual bool PreCallValidateCmdBindShadingRateImageNV(VkCommandBuffer commandBuffer, VkImageView imageView, VkImageLayout imageLayout) const { return false; }; virtual void PreCallRecordCmdBindShadingRateImageNV(VkCommandBuffer commandBuffer, VkImageView imageView, VkImageLayout imageLayout) {}; virtual void PostCallRecordCmdBindShadingRateImageNV(VkCommandBuffer commandBuffer, VkImageView imageView, VkImageLayout imageLayout) {}; virtual bool PreCallValidateCmdSetViewportShadingRatePaletteNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkShadingRatePaletteNV* pShadingRatePalettes) const { return false; }; virtual void PreCallRecordCmdSetViewportShadingRatePaletteNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkShadingRatePaletteNV* pShadingRatePalettes) {}; virtual void PostCallRecordCmdSetViewportShadingRatePaletteNV(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkShadingRatePaletteNV* pShadingRatePalettes) {}; virtual bool PreCallValidateCmdSetCoarseSampleOrderNV(VkCommandBuffer commandBuffer, VkCoarseSampleOrderTypeNV sampleOrderType, uint32_t customSampleOrderCount, const VkCoarseSampleOrderCustomNV* pCustomSampleOrders) const { return false; }; virtual void PreCallRecordCmdSetCoarseSampleOrderNV(VkCommandBuffer commandBuffer, VkCoarseSampleOrderTypeNV sampleOrderType, uint32_t customSampleOrderCount, const VkCoarseSampleOrderCustomNV* pCustomSampleOrders) {}; virtual void PostCallRecordCmdSetCoarseSampleOrderNV(VkCommandBuffer commandBuffer, VkCoarseSampleOrderTypeNV sampleOrderType, uint32_t customSampleOrderCount, const VkCoarseSampleOrderCustomNV* pCustomSampleOrders) {}; virtual bool PreCallValidateCreateAccelerationStructureNV(VkDevice device, const VkAccelerationStructureCreateInfoNV* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkAccelerationStructureNV* pAccelerationStructure) const { return false; }; virtual void PreCallRecordCreateAccelerationStructureNV(VkDevice device, const VkAccelerationStructureCreateInfoNV* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkAccelerationStructureNV* pAccelerationStructure) {}; virtual void PostCallRecordCreateAccelerationStructureNV(VkDevice device, const VkAccelerationStructureCreateInfoNV* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkAccelerationStructureNV* pAccelerationStructure, VkResult result) {}; virtual bool PreCallValidateDestroyAccelerationStructureNV(VkDevice device, VkAccelerationStructureNV accelerationStructure, const VkAllocationCallbacks* pAllocator) const { return false; }; virtual void PreCallRecordDestroyAccelerationStructureNV(VkDevice device, VkAccelerationStructureNV accelerationStructure, const VkAllocationCallbacks* pAllocator) {}; virtual void PostCallRecordDestroyAccelerationStructureNV(VkDevice device, VkAccelerationStructureNV accelerationStructure, const VkAllocationCallbacks* pAllocator) {}; virtual bool PreCallValidateGetAccelerationStructureMemoryRequirementsNV(VkDevice device, const VkAccelerationStructureMemoryRequirementsInfoNV* pInfo, VkMemoryRequirements2KHR* pMemoryRequirements) const { return false; }; virtual void PreCallRecordGetAccelerationStructureMemoryRequirementsNV(VkDevice device, const VkAccelerationStructureMemoryRequirementsInfoNV* pInfo, VkMemoryRequirements2KHR* pMemoryRequirements) {}; virtual void PostCallRecordGetAccelerationStructureMemoryRequirementsNV(VkDevice device, const VkAccelerationStructureMemoryRequirementsInfoNV* pInfo, VkMemoryRequirements2KHR* pMemoryRequirements) {}; virtual bool PreCallValidateBindAccelerationStructureMemoryNV(VkDevice device, uint32_t bindInfoCount, const VkBindAccelerationStructureMemoryInfoNV* pBindInfos) const { return false; }; virtual void PreCallRecordBindAccelerationStructureMemoryNV(VkDevice device, uint32_t bindInfoCount, const VkBindAccelerationStructureMemoryInfoNV* pBindInfos) {}; virtual void PostCallRecordBindAccelerationStructureMemoryNV(VkDevice device, uint32_t bindInfoCount, const VkBindAccelerationStructureMemoryInfoNV* pBindInfos, VkResult result) {}; virtual bool PreCallValidateCmdBuildAccelerationStructureNV(VkCommandBuffer commandBuffer, const VkAccelerationStructureInfoNV* pInfo, VkBuffer instanceData, VkDeviceSize instanceOffset, VkBool32 update, VkAccelerationStructureNV dst, VkAccelerationStructureNV src, VkBuffer scratch, VkDeviceSize scratchOffset) const { return false; }; virtual void PreCallRecordCmdBuildAccelerationStructureNV(VkCommandBuffer commandBuffer, const VkAccelerationStructureInfoNV* pInfo, VkBuffer instanceData, VkDeviceSize instanceOffset, VkBool32 update, VkAccelerationStructureNV dst, VkAccelerationStructureNV src, VkBuffer scratch, VkDeviceSize scratchOffset) {}; virtual void PostCallRecordCmdBuildAccelerationStructureNV(VkCommandBuffer commandBuffer, const VkAccelerationStructureInfoNV* pInfo, VkBuffer instanceData, VkDeviceSize instanceOffset, VkBool32 update, VkAccelerationStructureNV dst, VkAccelerationStructureNV src, VkBuffer scratch, VkDeviceSize scratchOffset) {}; virtual bool PreCallValidateCmdCopyAccelerationStructureNV(VkCommandBuffer commandBuffer, VkAccelerationStructureNV dst, VkAccelerationStructureNV src, VkCopyAccelerationStructureModeKHR mode) const { return false; }; virtual void PreCallRecordCmdCopyAccelerationStructureNV(VkCommandBuffer commandBuffer, VkAccelerationStructureNV dst, VkAccelerationStructureNV src, VkCopyAccelerationStructureModeKHR mode) {}; virtual void PostCallRecordCmdCopyAccelerationStructureNV(VkCommandBuffer commandBuffer, VkAccelerationStructureNV dst, VkAccelerationStructureNV src, VkCopyAccelerationStructureModeKHR mode) {}; virtual bool PreCallValidateCmdTraceRaysNV(VkCommandBuffer commandBuffer, VkBuffer raygenShaderBindingTableBuffer, VkDeviceSize raygenShaderBindingOffset, VkBuffer missShaderBindingTableBuffer, VkDeviceSize missShaderBindingOffset, VkDeviceSize missShaderBindingStride, VkBuffer hitShaderBindingTableBuffer, VkDeviceSize hitShaderBindingOffset, VkDeviceSize hitShaderBindingStride, VkBuffer callableShaderBindingTableBuffer, VkDeviceSize callableShaderBindingOffset, VkDeviceSize callableShaderBindingStride, uint32_t width, uint32_t height, uint32_t depth) const { return false; }; virtual void PreCallRecordCmdTraceRaysNV(VkCommandBuffer commandBuffer, VkBuffer raygenShaderBindingTableBuffer, VkDeviceSize raygenShaderBindingOffset, VkBuffer missShaderBindingTableBuffer, VkDeviceSize missShaderBindingOffset, VkDeviceSize missShaderBindingStride, VkBuffer hitShaderBindingTableBuffer, VkDeviceSize hitShaderBindingOffset, VkDeviceSize hitShaderBindingStride, VkBuffer callableShaderBindingTableBuffer, VkDeviceSize callableShaderBindingOffset, VkDeviceSize callableShaderBindingStride, uint32_t width, uint32_t height, uint32_t depth) {}; virtual void PostCallRecordCmdTraceRaysNV(VkCommandBuffer commandBuffer, VkBuffer raygenShaderBindingTableBuffer, VkDeviceSize raygenShaderBindingOffset, VkBuffer missShaderBindingTableBuffer, VkDeviceSize missShaderBindingOffset, VkDeviceSize missShaderBindingStride, VkBuffer hitShaderBindingTableBuffer, VkDeviceSize hitShaderBindingOffset, VkDeviceSize hitShaderBindingStride, VkBuffer callableShaderBindingTableBuffer, VkDeviceSize callableShaderBindingOffset, VkDeviceSize callableShaderBindingStride, uint32_t width, uint32_t height, uint32_t depth) {}; virtual bool PreCallValidateCreateRayTracingPipelinesNV(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkRayTracingPipelineCreateInfoNV* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines) const { return false; }; virtual void PreCallRecordCreateRayTracingPipelinesNV(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkRayTracingPipelineCreateInfoNV* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines) {}; virtual void PostCallRecordCreateRayTracingPipelinesNV(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkRayTracingPipelineCreateInfoNV* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, VkResult result) {}; virtual bool PreCallValidateGetRayTracingShaderGroupHandlesKHR(VkDevice device, VkPipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, void* pData) const { return false; }; virtual void PreCallRecordGetRayTracingShaderGroupHandlesKHR(VkDevice device, VkPipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, void* pData) {}; virtual void PostCallRecordGetRayTracingShaderGroupHandlesKHR(VkDevice device, VkPipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, void* pData, VkResult result) {}; virtual bool PreCallValidateGetRayTracingShaderGroupHandlesNV(VkDevice device, VkPipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, void* pData) const { return false; }; virtual void PreCallRecordGetRayTracingShaderGroupHandlesNV(VkDevice device, VkPipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, void* pData) {}; virtual void PostCallRecordGetRayTracingShaderGroupHandlesNV(VkDevice device, VkPipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, void* pData, VkResult result) {}; virtual bool PreCallValidateGetAccelerationStructureHandleNV(VkDevice device, VkAccelerationStructureNV accelerationStructure, size_t dataSize, void* pData) const { return false; }; virtual void PreCallRecordGetAccelerationStructureHandleNV(VkDevice device, VkAccelerationStructureNV accelerationStructure, size_t dataSize, void* pData) {}; virtual void PostCallRecordGetAccelerationStructureHandleNV(VkDevice device, VkAccelerationStructureNV accelerationStructure, size_t dataSize, void* pData, VkResult result) {}; virtual bool PreCallValidateCmdWriteAccelerationStructuresPropertiesNV(VkCommandBuffer commandBuffer, uint32_t accelerationStructureCount, const VkAccelerationStructureNV* pAccelerationStructures, VkQueryType queryType, VkQueryPool queryPool, uint32_t firstQuery) const { return false; }; virtual void PreCallRecordCmdWriteAccelerationStructuresPropertiesNV(VkCommandBuffer commandBuffer, uint32_t accelerationStructureCount, const VkAccelerationStructureNV* pAccelerationStructures, VkQueryType queryType, VkQueryPool queryPool, uint32_t firstQuery) {}; virtual void PostCallRecordCmdWriteAccelerationStructuresPropertiesNV(VkCommandBuffer commandBuffer, uint32_t accelerationStructureCount, const VkAccelerationStructureNV* pAccelerationStructures, VkQueryType queryType, VkQueryPool queryPool, uint32_t firstQuery) {}; virtual bool PreCallValidateCompileDeferredNV(VkDevice device, VkPipeline pipeline, uint32_t shader) const { return false; }; virtual void PreCallRecordCompileDeferredNV(VkDevice device, VkPipeline pipeline, uint32_t shader) {}; virtual void PostCallRecordCompileDeferredNV(VkDevice device, VkPipeline pipeline, uint32_t shader, VkResult result) {}; virtual bool PreCallValidateGetMemoryHostPointerPropertiesEXT(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, const void* pHostPointer, VkMemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties) const { return false; }; virtual void PreCallRecordGetMemoryHostPointerPropertiesEXT(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, const void* pHostPointer, VkMemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties) {}; virtual void PostCallRecordGetMemoryHostPointerPropertiesEXT(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, const void* pHostPointer, VkMemoryHostPointerPropertiesEXT* pMemoryHostPointerProperties, VkResult result) {}; virtual bool PreCallValidateCmdWriteBufferMarkerAMD(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkBuffer dstBuffer, VkDeviceSize dstOffset, uint32_t marker) const { return false; }; virtual void PreCallRecordCmdWriteBufferMarkerAMD(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkBuffer dstBuffer, VkDeviceSize dstOffset, uint32_t marker) {}; virtual void PostCallRecordCmdWriteBufferMarkerAMD(VkCommandBuffer commandBuffer, VkPipelineStageFlagBits pipelineStage, VkBuffer dstBuffer, VkDeviceSize dstOffset, uint32_t marker) {}; virtual bool PreCallValidateGetPhysicalDeviceCalibrateableTimeDomainsEXT(VkPhysicalDevice physicalDevice, uint32_t* pTimeDomainCount, VkTimeDomainEXT* pTimeDomains) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceCalibrateableTimeDomainsEXT(VkPhysicalDevice physicalDevice, uint32_t* pTimeDomainCount, VkTimeDomainEXT* pTimeDomains) {}; virtual void PostCallRecordGetPhysicalDeviceCalibrateableTimeDomainsEXT(VkPhysicalDevice physicalDevice, uint32_t* pTimeDomainCount, VkTimeDomainEXT* pTimeDomains, VkResult result) {}; virtual bool PreCallValidateGetCalibratedTimestampsEXT(VkDevice device, uint32_t timestampCount, const VkCalibratedTimestampInfoEXT* pTimestampInfos, uint64_t* pTimestamps, uint64_t* pMaxDeviation) const { return false; }; virtual void PreCallRecordGetCalibratedTimestampsEXT(VkDevice device, uint32_t timestampCount, const VkCalibratedTimestampInfoEXT* pTimestampInfos, uint64_t* pTimestamps, uint64_t* pMaxDeviation) {}; virtual void PostCallRecordGetCalibratedTimestampsEXT(VkDevice device, uint32_t timestampCount, const VkCalibratedTimestampInfoEXT* pTimestampInfos, uint64_t* pTimestamps, uint64_t* pMaxDeviation, VkResult result) {}; virtual bool PreCallValidateCmdDrawMeshTasksNV(VkCommandBuffer commandBuffer, uint32_t taskCount, uint32_t firstTask) const { return false; }; virtual void PreCallRecordCmdDrawMeshTasksNV(VkCommandBuffer commandBuffer, uint32_t taskCount, uint32_t firstTask) {}; virtual void PostCallRecordCmdDrawMeshTasksNV(VkCommandBuffer commandBuffer, uint32_t taskCount, uint32_t firstTask) {}; virtual bool PreCallValidateCmdDrawMeshTasksIndirectNV(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride) const { return false; }; virtual void PreCallRecordCmdDrawMeshTasksIndirectNV(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride) {}; virtual void PostCallRecordCmdDrawMeshTasksIndirectNV(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride) {}; virtual bool PreCallValidateCmdDrawMeshTasksIndirectCountNV(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) const { return false; }; virtual void PreCallRecordCmdDrawMeshTasksIndirectCountNV(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) {}; virtual void PostCallRecordCmdDrawMeshTasksIndirectCountNV(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride) {}; virtual bool PreCallValidateCmdSetExclusiveScissorNV(VkCommandBuffer commandBuffer, uint32_t firstExclusiveScissor, uint32_t exclusiveScissorCount, const VkRect2D* pExclusiveScissors) const { return false; }; virtual void PreCallRecordCmdSetExclusiveScissorNV(VkCommandBuffer commandBuffer, uint32_t firstExclusiveScissor, uint32_t exclusiveScissorCount, const VkRect2D* pExclusiveScissors) {}; virtual void PostCallRecordCmdSetExclusiveScissorNV(VkCommandBuffer commandBuffer, uint32_t firstExclusiveScissor, uint32_t exclusiveScissorCount, const VkRect2D* pExclusiveScissors) {}; virtual bool PreCallValidateCmdSetCheckpointNV(VkCommandBuffer commandBuffer, const void* pCheckpointMarker) const { return false; }; virtual void PreCallRecordCmdSetCheckpointNV(VkCommandBuffer commandBuffer, const void* pCheckpointMarker) {}; virtual void PostCallRecordCmdSetCheckpointNV(VkCommandBuffer commandBuffer, const void* pCheckpointMarker) {}; virtual bool PreCallValidateGetQueueCheckpointDataNV(VkQueue queue, uint32_t* pCheckpointDataCount, VkCheckpointDataNV* pCheckpointData) const { return false; }; virtual void PreCallRecordGetQueueCheckpointDataNV(VkQueue queue, uint32_t* pCheckpointDataCount, VkCheckpointDataNV* pCheckpointData) {}; virtual void PostCallRecordGetQueueCheckpointDataNV(VkQueue queue, uint32_t* pCheckpointDataCount, VkCheckpointDataNV* pCheckpointData) {}; virtual bool PreCallValidateInitializePerformanceApiINTEL(VkDevice device, const VkInitializePerformanceApiInfoINTEL* pInitializeInfo) const { return false; }; virtual void PreCallRecordInitializePerformanceApiINTEL(VkDevice device, const VkInitializePerformanceApiInfoINTEL* pInitializeInfo) {}; virtual void PostCallRecordInitializePerformanceApiINTEL(VkDevice device, const VkInitializePerformanceApiInfoINTEL* pInitializeInfo, VkResult result) {}; virtual bool PreCallValidateUninitializePerformanceApiINTEL(VkDevice device) const { return false; }; virtual void PreCallRecordUninitializePerformanceApiINTEL(VkDevice device) {}; virtual void PostCallRecordUninitializePerformanceApiINTEL(VkDevice device) {}; virtual bool PreCallValidateCmdSetPerformanceMarkerINTEL(VkCommandBuffer commandBuffer, const VkPerformanceMarkerInfoINTEL* pMarkerInfo) const { return false; }; virtual void PreCallRecordCmdSetPerformanceMarkerINTEL(VkCommandBuffer commandBuffer, const VkPerformanceMarkerInfoINTEL* pMarkerInfo) {}; virtual void PostCallRecordCmdSetPerformanceMarkerINTEL(VkCommandBuffer commandBuffer, const VkPerformanceMarkerInfoINTEL* pMarkerInfo, VkResult result) {}; virtual bool PreCallValidateCmdSetPerformanceStreamMarkerINTEL(VkCommandBuffer commandBuffer, const VkPerformanceStreamMarkerInfoINTEL* pMarkerInfo) const { return false; }; virtual void PreCallRecordCmdSetPerformanceStreamMarkerINTEL(VkCommandBuffer commandBuffer, const VkPerformanceStreamMarkerInfoINTEL* pMarkerInfo) {}; virtual void PostCallRecordCmdSetPerformanceStreamMarkerINTEL(VkCommandBuffer commandBuffer, const VkPerformanceStreamMarkerInfoINTEL* pMarkerInfo, VkResult result) {}; virtual bool PreCallValidateCmdSetPerformanceOverrideINTEL(VkCommandBuffer commandBuffer, const VkPerformanceOverrideInfoINTEL* pOverrideInfo) const { return false; }; virtual void PreCallRecordCmdSetPerformanceOverrideINTEL(VkCommandBuffer commandBuffer, const VkPerformanceOverrideInfoINTEL* pOverrideInfo) {}; virtual void PostCallRecordCmdSetPerformanceOverrideINTEL(VkCommandBuffer commandBuffer, const VkPerformanceOverrideInfoINTEL* pOverrideInfo, VkResult result) {}; virtual bool PreCallValidateAcquirePerformanceConfigurationINTEL(VkDevice device, const VkPerformanceConfigurationAcquireInfoINTEL* pAcquireInfo, VkPerformanceConfigurationINTEL* pConfiguration) const { return false; }; virtual void PreCallRecordAcquirePerformanceConfigurationINTEL(VkDevice device, const VkPerformanceConfigurationAcquireInfoINTEL* pAcquireInfo, VkPerformanceConfigurationINTEL* pConfiguration) {}; virtual void PostCallRecordAcquirePerformanceConfigurationINTEL(VkDevice device, const VkPerformanceConfigurationAcquireInfoINTEL* pAcquireInfo, VkPerformanceConfigurationINTEL* pConfiguration, VkResult result) {}; virtual bool PreCallValidateReleasePerformanceConfigurationINTEL(VkDevice device, VkPerformanceConfigurationINTEL configuration) const { return false; }; virtual void PreCallRecordReleasePerformanceConfigurationINTEL(VkDevice device, VkPerformanceConfigurationINTEL configuration) {}; virtual void PostCallRecordReleasePerformanceConfigurationINTEL(VkDevice device, VkPerformanceConfigurationINTEL configuration, VkResult result) {}; virtual bool PreCallValidateQueueSetPerformanceConfigurationINTEL(VkQueue queue, VkPerformanceConfigurationINTEL configuration) const { return false; }; virtual void PreCallRecordQueueSetPerformanceConfigurationINTEL(VkQueue queue, VkPerformanceConfigurationINTEL configuration) {}; virtual void PostCallRecordQueueSetPerformanceConfigurationINTEL(VkQueue queue, VkPerformanceConfigurationINTEL configuration, VkResult result) {}; virtual bool PreCallValidateGetPerformanceParameterINTEL(VkDevice device, VkPerformanceParameterTypeINTEL parameter, VkPerformanceValueINTEL* pValue) const { return false; }; virtual void PreCallRecordGetPerformanceParameterINTEL(VkDevice device, VkPerformanceParameterTypeINTEL parameter, VkPerformanceValueINTEL* pValue) {}; virtual void PostCallRecordGetPerformanceParameterINTEL(VkDevice device, VkPerformanceParameterTypeINTEL parameter, VkPerformanceValueINTEL* pValue, VkResult result) {}; virtual bool PreCallValidateSetLocalDimmingAMD(VkDevice device, VkSwapchainKHR swapChain, VkBool32 localDimmingEnable) const { return false; }; virtual void PreCallRecordSetLocalDimmingAMD(VkDevice device, VkSwapchainKHR swapChain, VkBool32 localDimmingEnable) {}; virtual void PostCallRecordSetLocalDimmingAMD(VkDevice device, VkSwapchainKHR swapChain, VkBool32 localDimmingEnable) {}; #ifdef VK_USE_PLATFORM_FUCHSIA virtual bool PreCallValidateCreateImagePipeSurfaceFUCHSIA(VkInstance instance, const VkImagePipeSurfaceCreateInfoFUCHSIA* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) const { return false; }; virtual void PreCallRecordCreateImagePipeSurfaceFUCHSIA(VkInstance instance, const VkImagePipeSurfaceCreateInfoFUCHSIA* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) {}; virtual void PostCallRecordCreateImagePipeSurfaceFUCHSIA(VkInstance instance, const VkImagePipeSurfaceCreateInfoFUCHSIA* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, VkResult result) {}; #endif #ifdef VK_USE_PLATFORM_METAL_EXT virtual bool PreCallValidateCreateMetalSurfaceEXT(VkInstance instance, const VkMetalSurfaceCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) const { return false; }; virtual void PreCallRecordCreateMetalSurfaceEXT(VkInstance instance, const VkMetalSurfaceCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) {}; virtual void PostCallRecordCreateMetalSurfaceEXT(VkInstance instance, const VkMetalSurfaceCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, VkResult result) {}; #endif virtual bool PreCallValidateGetBufferDeviceAddressEXT(VkDevice device, const VkBufferDeviceAddressInfo* pInfo) const { return false; }; virtual void PreCallRecordGetBufferDeviceAddressEXT(VkDevice device, const VkBufferDeviceAddressInfo* pInfo) {}; virtual void PostCallRecordGetBufferDeviceAddressEXT(VkDevice device, const VkBufferDeviceAddressInfo* pInfo, VkDeviceAddress result) {}; virtual bool PreCallValidateGetPhysicalDeviceToolPropertiesEXT(VkPhysicalDevice physicalDevice, uint32_t* pToolCount, VkPhysicalDeviceToolPropertiesEXT* pToolProperties) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceToolPropertiesEXT(VkPhysicalDevice physicalDevice, uint32_t* pToolCount, VkPhysicalDeviceToolPropertiesEXT* pToolProperties) {}; virtual void PostCallRecordGetPhysicalDeviceToolPropertiesEXT(VkPhysicalDevice physicalDevice, uint32_t* pToolCount, VkPhysicalDeviceToolPropertiesEXT* pToolProperties, VkResult result) {}; virtual bool PreCallValidateGetPhysicalDeviceCooperativeMatrixPropertiesNV(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkCooperativeMatrixPropertiesNV* pProperties) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceCooperativeMatrixPropertiesNV(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkCooperativeMatrixPropertiesNV* pProperties) {}; virtual void PostCallRecordGetPhysicalDeviceCooperativeMatrixPropertiesNV(VkPhysicalDevice physicalDevice, uint32_t* pPropertyCount, VkCooperativeMatrixPropertiesNV* pProperties, VkResult result) {}; virtual bool PreCallValidateGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV(VkPhysicalDevice physicalDevice, uint32_t* pCombinationCount, VkFramebufferMixedSamplesCombinationNV* pCombinations) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV(VkPhysicalDevice physicalDevice, uint32_t* pCombinationCount, VkFramebufferMixedSamplesCombinationNV* pCombinations) {}; virtual void PostCallRecordGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV(VkPhysicalDevice physicalDevice, uint32_t* pCombinationCount, VkFramebufferMixedSamplesCombinationNV* pCombinations, VkResult result) {}; #ifdef VK_USE_PLATFORM_WIN32_KHR virtual bool PreCallValidateGetPhysicalDeviceSurfacePresentModes2EXT(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, uint32_t* pPresentModeCount, VkPresentModeKHR* pPresentModes) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceSurfacePresentModes2EXT(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, uint32_t* pPresentModeCount, VkPresentModeKHR* pPresentModes) {}; virtual void PostCallRecordGetPhysicalDeviceSurfacePresentModes2EXT(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, uint32_t* pPresentModeCount, VkPresentModeKHR* pPresentModes, VkResult result) {}; #endif #ifdef VK_USE_PLATFORM_WIN32_KHR virtual bool PreCallValidateAcquireFullScreenExclusiveModeEXT(VkDevice device, VkSwapchainKHR swapchain) const { return false; }; virtual void PreCallRecordAcquireFullScreenExclusiveModeEXT(VkDevice device, VkSwapchainKHR swapchain) {}; virtual void PostCallRecordAcquireFullScreenExclusiveModeEXT(VkDevice device, VkSwapchainKHR swapchain, VkResult result) {}; #endif #ifdef VK_USE_PLATFORM_WIN32_KHR virtual bool PreCallValidateReleaseFullScreenExclusiveModeEXT(VkDevice device, VkSwapchainKHR swapchain) const { return false; }; virtual void PreCallRecordReleaseFullScreenExclusiveModeEXT(VkDevice device, VkSwapchainKHR swapchain) {}; virtual void PostCallRecordReleaseFullScreenExclusiveModeEXT(VkDevice device, VkSwapchainKHR swapchain, VkResult result) {}; #endif #ifdef VK_USE_PLATFORM_WIN32_KHR virtual bool PreCallValidateGetDeviceGroupSurfacePresentModes2EXT(VkDevice device, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, VkDeviceGroupPresentModeFlagsKHR* pModes) const { return false; }; virtual void PreCallRecordGetDeviceGroupSurfacePresentModes2EXT(VkDevice device, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, VkDeviceGroupPresentModeFlagsKHR* pModes) {}; virtual void PostCallRecordGetDeviceGroupSurfacePresentModes2EXT(VkDevice device, const VkPhysicalDeviceSurfaceInfo2KHR* pSurfaceInfo, VkDeviceGroupPresentModeFlagsKHR* pModes, VkResult result) {}; #endif virtual bool PreCallValidateCreateHeadlessSurfaceEXT(VkInstance instance, const VkHeadlessSurfaceCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) const { return false; }; virtual void PreCallRecordCreateHeadlessSurfaceEXT(VkInstance instance, const VkHeadlessSurfaceCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) {}; virtual void PostCallRecordCreateHeadlessSurfaceEXT(VkInstance instance, const VkHeadlessSurfaceCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, VkResult result) {}; virtual bool PreCallValidateCmdSetLineStippleEXT(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, uint16_t lineStipplePattern) const { return false; }; virtual void PreCallRecordCmdSetLineStippleEXT(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, uint16_t lineStipplePattern) {}; virtual void PostCallRecordCmdSetLineStippleEXT(VkCommandBuffer commandBuffer, uint32_t lineStippleFactor, uint16_t lineStipplePattern) {}; virtual bool PreCallValidateResetQueryPoolEXT(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount) const { return false; }; virtual void PreCallRecordResetQueryPoolEXT(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount) {}; virtual void PostCallRecordResetQueryPoolEXT(VkDevice device, VkQueryPool queryPool, uint32_t firstQuery, uint32_t queryCount) {}; virtual bool PreCallValidateCmdSetCullModeEXT(VkCommandBuffer commandBuffer, VkCullModeFlags cullMode) const { return false; }; virtual void PreCallRecordCmdSetCullModeEXT(VkCommandBuffer commandBuffer, VkCullModeFlags cullMode) {}; virtual void PostCallRecordCmdSetCullModeEXT(VkCommandBuffer commandBuffer, VkCullModeFlags cullMode) {}; virtual bool PreCallValidateCmdSetFrontFaceEXT(VkCommandBuffer commandBuffer, VkFrontFace frontFace) const { return false; }; virtual void PreCallRecordCmdSetFrontFaceEXT(VkCommandBuffer commandBuffer, VkFrontFace frontFace) {}; virtual void PostCallRecordCmdSetFrontFaceEXT(VkCommandBuffer commandBuffer, VkFrontFace frontFace) {}; virtual bool PreCallValidateCmdSetPrimitiveTopologyEXT(VkCommandBuffer commandBuffer, VkPrimitiveTopology primitiveTopology) const { return false; }; virtual void PreCallRecordCmdSetPrimitiveTopologyEXT(VkCommandBuffer commandBuffer, VkPrimitiveTopology primitiveTopology) {}; virtual void PostCallRecordCmdSetPrimitiveTopologyEXT(VkCommandBuffer commandBuffer, VkPrimitiveTopology primitiveTopology) {}; virtual bool PreCallValidateCmdSetViewportWithCountEXT(VkCommandBuffer commandBuffer, uint32_t viewportCount, const VkViewport* pViewports) const { return false; }; virtual void PreCallRecordCmdSetViewportWithCountEXT(VkCommandBuffer commandBuffer, uint32_t viewportCount, const VkViewport* pViewports) {}; virtual void PostCallRecordCmdSetViewportWithCountEXT(VkCommandBuffer commandBuffer, uint32_t viewportCount, const VkViewport* pViewports) {}; virtual bool PreCallValidateCmdSetScissorWithCountEXT(VkCommandBuffer commandBuffer, uint32_t scissorCount, const VkRect2D* pScissors) const { return false; }; virtual void PreCallRecordCmdSetScissorWithCountEXT(VkCommandBuffer commandBuffer, uint32_t scissorCount, const VkRect2D* pScissors) {}; virtual void PostCallRecordCmdSetScissorWithCountEXT(VkCommandBuffer commandBuffer, uint32_t scissorCount, const VkRect2D* pScissors) {}; virtual bool PreCallValidateCmdBindVertexBuffers2EXT(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets, const VkDeviceSize* pSizes, const VkDeviceSize* pStrides) const { return false; }; virtual void PreCallRecordCmdBindVertexBuffers2EXT(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets, const VkDeviceSize* pSizes, const VkDeviceSize* pStrides) {}; virtual void PostCallRecordCmdBindVertexBuffers2EXT(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets, const VkDeviceSize* pSizes, const VkDeviceSize* pStrides) {}; virtual bool PreCallValidateCmdSetDepthTestEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthTestEnable) const { return false; }; virtual void PreCallRecordCmdSetDepthTestEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthTestEnable) {}; virtual void PostCallRecordCmdSetDepthTestEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthTestEnable) {}; virtual bool PreCallValidateCmdSetDepthWriteEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthWriteEnable) const { return false; }; virtual void PreCallRecordCmdSetDepthWriteEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthWriteEnable) {}; virtual void PostCallRecordCmdSetDepthWriteEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthWriteEnable) {}; virtual bool PreCallValidateCmdSetDepthCompareOpEXT(VkCommandBuffer commandBuffer, VkCompareOp depthCompareOp) const { return false; }; virtual void PreCallRecordCmdSetDepthCompareOpEXT(VkCommandBuffer commandBuffer, VkCompareOp depthCompareOp) {}; virtual void PostCallRecordCmdSetDepthCompareOpEXT(VkCommandBuffer commandBuffer, VkCompareOp depthCompareOp) {}; virtual bool PreCallValidateCmdSetDepthBoundsTestEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthBoundsTestEnable) const { return false; }; virtual void PreCallRecordCmdSetDepthBoundsTestEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthBoundsTestEnable) {}; virtual void PostCallRecordCmdSetDepthBoundsTestEnableEXT(VkCommandBuffer commandBuffer, VkBool32 depthBoundsTestEnable) {}; virtual bool PreCallValidateCmdSetStencilTestEnableEXT(VkCommandBuffer commandBuffer, VkBool32 stencilTestEnable) const { return false; }; virtual void PreCallRecordCmdSetStencilTestEnableEXT(VkCommandBuffer commandBuffer, VkBool32 stencilTestEnable) {}; virtual void PostCallRecordCmdSetStencilTestEnableEXT(VkCommandBuffer commandBuffer, VkBool32 stencilTestEnable) {}; virtual bool PreCallValidateCmdSetStencilOpEXT(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, VkStencilOp failOp, VkStencilOp passOp, VkStencilOp depthFailOp, VkCompareOp compareOp) const { return false; }; virtual void PreCallRecordCmdSetStencilOpEXT(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, VkStencilOp failOp, VkStencilOp passOp, VkStencilOp depthFailOp, VkCompareOp compareOp) {}; virtual void PostCallRecordCmdSetStencilOpEXT(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, VkStencilOp failOp, VkStencilOp passOp, VkStencilOp depthFailOp, VkCompareOp compareOp) {}; virtual bool PreCallValidateGetGeneratedCommandsMemoryRequirementsNV(VkDevice device, const VkGeneratedCommandsMemoryRequirementsInfoNV* pInfo, VkMemoryRequirements2* pMemoryRequirements) const { return false; }; virtual void PreCallRecordGetGeneratedCommandsMemoryRequirementsNV(VkDevice device, const VkGeneratedCommandsMemoryRequirementsInfoNV* pInfo, VkMemoryRequirements2* pMemoryRequirements) {}; virtual void PostCallRecordGetGeneratedCommandsMemoryRequirementsNV(VkDevice device, const VkGeneratedCommandsMemoryRequirementsInfoNV* pInfo, VkMemoryRequirements2* pMemoryRequirements) {}; virtual bool PreCallValidateCmdPreprocessGeneratedCommandsNV(VkCommandBuffer commandBuffer, const VkGeneratedCommandsInfoNV* pGeneratedCommandsInfo) const { return false; }; virtual void PreCallRecordCmdPreprocessGeneratedCommandsNV(VkCommandBuffer commandBuffer, const VkGeneratedCommandsInfoNV* pGeneratedCommandsInfo) {}; virtual void PostCallRecordCmdPreprocessGeneratedCommandsNV(VkCommandBuffer commandBuffer, const VkGeneratedCommandsInfoNV* pGeneratedCommandsInfo) {}; virtual bool PreCallValidateCmdExecuteGeneratedCommandsNV(VkCommandBuffer commandBuffer, VkBool32 isPreprocessed, const VkGeneratedCommandsInfoNV* pGeneratedCommandsInfo) const { return false; }; virtual void PreCallRecordCmdExecuteGeneratedCommandsNV(VkCommandBuffer commandBuffer, VkBool32 isPreprocessed, const VkGeneratedCommandsInfoNV* pGeneratedCommandsInfo) {}; virtual void PostCallRecordCmdExecuteGeneratedCommandsNV(VkCommandBuffer commandBuffer, VkBool32 isPreprocessed, const VkGeneratedCommandsInfoNV* pGeneratedCommandsInfo) {}; virtual bool PreCallValidateCmdBindPipelineShaderGroupNV(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline, uint32_t groupIndex) const { return false; }; virtual void PreCallRecordCmdBindPipelineShaderGroupNV(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline, uint32_t groupIndex) {}; virtual void PostCallRecordCmdBindPipelineShaderGroupNV(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline, uint32_t groupIndex) {}; virtual bool PreCallValidateCreateIndirectCommandsLayoutNV(VkDevice device, const VkIndirectCommandsLayoutCreateInfoNV* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkIndirectCommandsLayoutNV* pIndirectCommandsLayout) const { return false; }; virtual void PreCallRecordCreateIndirectCommandsLayoutNV(VkDevice device, const VkIndirectCommandsLayoutCreateInfoNV* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkIndirectCommandsLayoutNV* pIndirectCommandsLayout) {}; virtual void PostCallRecordCreateIndirectCommandsLayoutNV(VkDevice device, const VkIndirectCommandsLayoutCreateInfoNV* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkIndirectCommandsLayoutNV* pIndirectCommandsLayout, VkResult result) {}; virtual bool PreCallValidateDestroyIndirectCommandsLayoutNV(VkDevice device, VkIndirectCommandsLayoutNV indirectCommandsLayout, const VkAllocationCallbacks* pAllocator) const { return false; }; virtual void PreCallRecordDestroyIndirectCommandsLayoutNV(VkDevice device, VkIndirectCommandsLayoutNV indirectCommandsLayout, const VkAllocationCallbacks* pAllocator) {}; virtual void PostCallRecordDestroyIndirectCommandsLayoutNV(VkDevice device, VkIndirectCommandsLayoutNV indirectCommandsLayout, const VkAllocationCallbacks* pAllocator) {}; virtual bool PreCallValidateCreatePrivateDataSlotEXT(VkDevice device, const VkPrivateDataSlotCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPrivateDataSlotEXT* pPrivateDataSlot) const { return false; }; virtual void PreCallRecordCreatePrivateDataSlotEXT(VkDevice device, const VkPrivateDataSlotCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPrivateDataSlotEXT* pPrivateDataSlot) {}; virtual void PostCallRecordCreatePrivateDataSlotEXT(VkDevice device, const VkPrivateDataSlotCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPrivateDataSlotEXT* pPrivateDataSlot, VkResult result) {}; virtual bool PreCallValidateDestroyPrivateDataSlotEXT(VkDevice device, VkPrivateDataSlotEXT privateDataSlot, const VkAllocationCallbacks* pAllocator) const { return false; }; virtual void PreCallRecordDestroyPrivateDataSlotEXT(VkDevice device, VkPrivateDataSlotEXT privateDataSlot, const VkAllocationCallbacks* pAllocator) {}; virtual void PostCallRecordDestroyPrivateDataSlotEXT(VkDevice device, VkPrivateDataSlotEXT privateDataSlot, const VkAllocationCallbacks* pAllocator) {}; virtual bool PreCallValidateSetPrivateDataEXT(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlotEXT privateDataSlot, uint64_t data) const { return false; }; virtual void PreCallRecordSetPrivateDataEXT(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlotEXT privateDataSlot, uint64_t data) {}; virtual void PostCallRecordSetPrivateDataEXT(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlotEXT privateDataSlot, uint64_t data, VkResult result) {}; virtual bool PreCallValidateGetPrivateDataEXT(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlotEXT privateDataSlot, uint64_t* pData) const { return false; }; virtual void PreCallRecordGetPrivateDataEXT(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlotEXT privateDataSlot, uint64_t* pData) {}; virtual void PostCallRecordGetPrivateDataEXT(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlotEXT privateDataSlot, uint64_t* pData) {}; virtual bool PreCallValidateCmdSetFragmentShadingRateEnumNV(VkCommandBuffer commandBuffer, VkFragmentShadingRateNV shadingRate, const VkFragmentShadingRateCombinerOpKHR combinerOps[2]) const { return false; }; virtual void PreCallRecordCmdSetFragmentShadingRateEnumNV(VkCommandBuffer commandBuffer, VkFragmentShadingRateNV shadingRate, const VkFragmentShadingRateCombinerOpKHR combinerOps[2]) {}; virtual void PostCallRecordCmdSetFragmentShadingRateEnumNV(VkCommandBuffer commandBuffer, VkFragmentShadingRateNV shadingRate, const VkFragmentShadingRateCombinerOpKHR combinerOps[2]) {}; #ifdef VK_USE_PLATFORM_DIRECTFB_EXT virtual bool PreCallValidateCreateDirectFBSurfaceEXT(VkInstance instance, const VkDirectFBSurfaceCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) const { return false; }; virtual void PreCallRecordCreateDirectFBSurfaceEXT(VkInstance instance, const VkDirectFBSurfaceCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) {}; virtual void PostCallRecordCreateDirectFBSurfaceEXT(VkInstance instance, const VkDirectFBSurfaceCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface, VkResult result) {}; #endif #ifdef VK_USE_PLATFORM_DIRECTFB_EXT virtual bool PreCallValidateGetPhysicalDeviceDirectFBPresentationSupportEXT(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, IDirectFB* dfb) const { return false; }; virtual void PreCallRecordGetPhysicalDeviceDirectFBPresentationSupportEXT(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, IDirectFB* dfb) {}; virtual void PostCallRecordGetPhysicalDeviceDirectFBPresentationSupportEXT(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, IDirectFB* dfb) {}; #endif virtual bool PreCallValidateCreateAccelerationStructureKHR(VkDevice device, const VkAccelerationStructureCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkAccelerationStructureKHR* pAccelerationStructure) const { return false; }; virtual void PreCallRecordCreateAccelerationStructureKHR(VkDevice device, const VkAccelerationStructureCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkAccelerationStructureKHR* pAccelerationStructure) {}; virtual void PostCallRecordCreateAccelerationStructureKHR(VkDevice device, const VkAccelerationStructureCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkAccelerationStructureKHR* pAccelerationStructure, VkResult result) {}; virtual bool PreCallValidateDestroyAccelerationStructureKHR(VkDevice device, VkAccelerationStructureKHR accelerationStructure, const VkAllocationCallbacks* pAllocator) const { return false; }; virtual void PreCallRecordDestroyAccelerationStructureKHR(VkDevice device, VkAccelerationStructureKHR accelerationStructure, const VkAllocationCallbacks* pAllocator) {}; virtual void PostCallRecordDestroyAccelerationStructureKHR(VkDevice device, VkAccelerationStructureKHR accelerationStructure, const VkAllocationCallbacks* pAllocator) {}; virtual bool PreCallValidateCmdBuildAccelerationStructuresKHR(VkCommandBuffer commandBuffer, uint32_t infoCount, const VkAccelerationStructureBuildGeometryInfoKHR* pInfos, const VkAccelerationStructureBuildRangeInfoKHR* const* ppBuildRangeInfos) const { return false; }; virtual void PreCallRecordCmdBuildAccelerationStructuresKHR(VkCommandBuffer commandBuffer, uint32_t infoCount, const VkAccelerationStructureBuildGeometryInfoKHR* pInfos, const VkAccelerationStructureBuildRangeInfoKHR* const* ppBuildRangeInfos) {}; virtual void PostCallRecordCmdBuildAccelerationStructuresKHR(VkCommandBuffer commandBuffer, uint32_t infoCount, const VkAccelerationStructureBuildGeometryInfoKHR* pInfos, const VkAccelerationStructureBuildRangeInfoKHR* const* ppBuildRangeInfos) {}; virtual bool PreCallValidateCmdBuildAccelerationStructuresIndirectKHR(VkCommandBuffer commandBuffer, uint32_t infoCount, const VkAccelerationStructureBuildGeometryInfoKHR* pInfos, const VkDeviceAddress* pIndirectDeviceAddresses, const uint32_t* pIndirectStrides, const uint32_t* const* ppMaxPrimitiveCounts) const { return false; }; virtual void PreCallRecordCmdBuildAccelerationStructuresIndirectKHR(VkCommandBuffer commandBuffer, uint32_t infoCount, const VkAccelerationStructureBuildGeometryInfoKHR* pInfos, const VkDeviceAddress* pIndirectDeviceAddresses, const uint32_t* pIndirectStrides, const uint32_t* const* ppMaxPrimitiveCounts) {}; virtual void PostCallRecordCmdBuildAccelerationStructuresIndirectKHR(VkCommandBuffer commandBuffer, uint32_t infoCount, const VkAccelerationStructureBuildGeometryInfoKHR* pInfos, const VkDeviceAddress* pIndirectDeviceAddresses, const uint32_t* pIndirectStrides, const uint32_t* const* ppMaxPrimitiveCounts) {}; virtual bool PreCallValidateBuildAccelerationStructuresKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, uint32_t infoCount, const VkAccelerationStructureBuildGeometryInfoKHR* pInfos, const VkAccelerationStructureBuildRangeInfoKHR* const* ppBuildRangeInfos) const { return false; }; virtual void PreCallRecordBuildAccelerationStructuresKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, uint32_t infoCount, const VkAccelerationStructureBuildGeometryInfoKHR* pInfos, const VkAccelerationStructureBuildRangeInfoKHR* const* ppBuildRangeInfos) {}; virtual void PostCallRecordBuildAccelerationStructuresKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, uint32_t infoCount, const VkAccelerationStructureBuildGeometryInfoKHR* pInfos, const VkAccelerationStructureBuildRangeInfoKHR* const* ppBuildRangeInfos, VkResult result) {}; virtual bool PreCallValidateCopyAccelerationStructureKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyAccelerationStructureInfoKHR* pInfo) const { return false; }; virtual void PreCallRecordCopyAccelerationStructureKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyAccelerationStructureInfoKHR* pInfo) {}; virtual void PostCallRecordCopyAccelerationStructureKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyAccelerationStructureInfoKHR* pInfo, VkResult result) {}; virtual bool PreCallValidateCopyAccelerationStructureToMemoryKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyAccelerationStructureToMemoryInfoKHR* pInfo) const { return false; }; virtual void PreCallRecordCopyAccelerationStructureToMemoryKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyAccelerationStructureToMemoryInfoKHR* pInfo) {}; virtual void PostCallRecordCopyAccelerationStructureToMemoryKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyAccelerationStructureToMemoryInfoKHR* pInfo, VkResult result) {}; virtual bool PreCallValidateCopyMemoryToAccelerationStructureKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyMemoryToAccelerationStructureInfoKHR* pInfo) const { return false; }; virtual void PreCallRecordCopyMemoryToAccelerationStructureKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyMemoryToAccelerationStructureInfoKHR* pInfo) {}; virtual void PostCallRecordCopyMemoryToAccelerationStructureKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyMemoryToAccelerationStructureInfoKHR* pInfo, VkResult result) {}; virtual bool PreCallValidateWriteAccelerationStructuresPropertiesKHR(VkDevice device, uint32_t accelerationStructureCount, const VkAccelerationStructureKHR* pAccelerationStructures, VkQueryType queryType, size_t dataSize, void* pData, size_t stride) const { return false; }; virtual void PreCallRecordWriteAccelerationStructuresPropertiesKHR(VkDevice device, uint32_t accelerationStructureCount, const VkAccelerationStructureKHR* pAccelerationStructures, VkQueryType queryType, size_t dataSize, void* pData, size_t stride) {}; virtual void PostCallRecordWriteAccelerationStructuresPropertiesKHR(VkDevice device, uint32_t accelerationStructureCount, const VkAccelerationStructureKHR* pAccelerationStructures, VkQueryType queryType, size_t dataSize, void* pData, size_t stride, VkResult result) {}; virtual bool PreCallValidateCmdCopyAccelerationStructureKHR(VkCommandBuffer commandBuffer, const VkCopyAccelerationStructureInfoKHR* pInfo) const { return false; }; virtual void PreCallRecordCmdCopyAccelerationStructureKHR(VkCommandBuffer commandBuffer, const VkCopyAccelerationStructureInfoKHR* pInfo) {}; virtual void PostCallRecordCmdCopyAccelerationStructureKHR(VkCommandBuffer commandBuffer, const VkCopyAccelerationStructureInfoKHR* pInfo) {}; virtual bool PreCallValidateCmdCopyAccelerationStructureToMemoryKHR(VkCommandBuffer commandBuffer, const VkCopyAccelerationStructureToMemoryInfoKHR* pInfo) const { return false; }; virtual void PreCallRecordCmdCopyAccelerationStructureToMemoryKHR(VkCommandBuffer commandBuffer, const VkCopyAccelerationStructureToMemoryInfoKHR* pInfo) {}; virtual void PostCallRecordCmdCopyAccelerationStructureToMemoryKHR(VkCommandBuffer commandBuffer, const VkCopyAccelerationStructureToMemoryInfoKHR* pInfo) {}; virtual bool PreCallValidateCmdCopyMemoryToAccelerationStructureKHR(VkCommandBuffer commandBuffer, const VkCopyMemoryToAccelerationStructureInfoKHR* pInfo) const { return false; }; virtual void PreCallRecordCmdCopyMemoryToAccelerationStructureKHR(VkCommandBuffer commandBuffer, const VkCopyMemoryToAccelerationStructureInfoKHR* pInfo) {}; virtual void PostCallRecordCmdCopyMemoryToAccelerationStructureKHR(VkCommandBuffer commandBuffer, const VkCopyMemoryToAccelerationStructureInfoKHR* pInfo) {}; virtual bool PreCallValidateGetAccelerationStructureDeviceAddressKHR(VkDevice device, const VkAccelerationStructureDeviceAddressInfoKHR* pInfo) const { return false; }; virtual void PreCallRecordGetAccelerationStructureDeviceAddressKHR(VkDevice device, const VkAccelerationStructureDeviceAddressInfoKHR* pInfo) {}; virtual void PostCallRecordGetAccelerationStructureDeviceAddressKHR(VkDevice device, const VkAccelerationStructureDeviceAddressInfoKHR* pInfo, VkDeviceAddress result) {}; virtual bool PreCallValidateCmdWriteAccelerationStructuresPropertiesKHR(VkCommandBuffer commandBuffer, uint32_t accelerationStructureCount, const VkAccelerationStructureKHR* pAccelerationStructures, VkQueryType queryType, VkQueryPool queryPool, uint32_t firstQuery) const { return false; }; virtual void PreCallRecordCmdWriteAccelerationStructuresPropertiesKHR(VkCommandBuffer commandBuffer, uint32_t accelerationStructureCount, const VkAccelerationStructureKHR* pAccelerationStructures, VkQueryType queryType, VkQueryPool queryPool, uint32_t firstQuery) {}; virtual void PostCallRecordCmdWriteAccelerationStructuresPropertiesKHR(VkCommandBuffer commandBuffer, uint32_t accelerationStructureCount, const VkAccelerationStructureKHR* pAccelerationStructures, VkQueryType queryType, VkQueryPool queryPool, uint32_t firstQuery) {}; virtual bool PreCallValidateGetDeviceAccelerationStructureCompatibilityKHR(VkDevice device, const VkAccelerationStructureVersionInfoKHR* pVersionInfo, VkAccelerationStructureCompatibilityKHR* pCompatibility) const { return false; }; virtual void PreCallRecordGetDeviceAccelerationStructureCompatibilityKHR(VkDevice device, const VkAccelerationStructureVersionInfoKHR* pVersionInfo, VkAccelerationStructureCompatibilityKHR* pCompatibility) {}; virtual void PostCallRecordGetDeviceAccelerationStructureCompatibilityKHR(VkDevice device, const VkAccelerationStructureVersionInfoKHR* pVersionInfo, VkAccelerationStructureCompatibilityKHR* pCompatibility) {}; virtual bool PreCallValidateGetAccelerationStructureBuildSizesKHR(VkDevice device, VkAccelerationStructureBuildTypeKHR buildType, const VkAccelerationStructureBuildGeometryInfoKHR* pBuildInfo, const uint32_t* pMaxPrimitiveCounts, VkAccelerationStructureBuildSizesInfoKHR* pSizeInfo) const { return false; }; virtual void PreCallRecordGetAccelerationStructureBuildSizesKHR(VkDevice device, VkAccelerationStructureBuildTypeKHR buildType, const VkAccelerationStructureBuildGeometryInfoKHR* pBuildInfo, const uint32_t* pMaxPrimitiveCounts, VkAccelerationStructureBuildSizesInfoKHR* pSizeInfo) {}; virtual void PostCallRecordGetAccelerationStructureBuildSizesKHR(VkDevice device, VkAccelerationStructureBuildTypeKHR buildType, const VkAccelerationStructureBuildGeometryInfoKHR* pBuildInfo, const uint32_t* pMaxPrimitiveCounts, VkAccelerationStructureBuildSizesInfoKHR* pSizeInfo) {}; virtual bool PreCallValidateCmdTraceRaysKHR(VkCommandBuffer commandBuffer, const VkStridedDeviceAddressRegionKHR* pRaygenShaderBindingTable, const VkStridedDeviceAddressRegionKHR* pMissShaderBindingTable, const VkStridedDeviceAddressRegionKHR* pHitShaderBindingTable, const VkStridedDeviceAddressRegionKHR* pCallableShaderBindingTable, uint32_t width, uint32_t height, uint32_t depth) const { return false; }; virtual void PreCallRecordCmdTraceRaysKHR(VkCommandBuffer commandBuffer, const VkStridedDeviceAddressRegionKHR* pRaygenShaderBindingTable, const VkStridedDeviceAddressRegionKHR* pMissShaderBindingTable, const VkStridedDeviceAddressRegionKHR* pHitShaderBindingTable, const VkStridedDeviceAddressRegionKHR* pCallableShaderBindingTable, uint32_t width, uint32_t height, uint32_t depth) {}; virtual void PostCallRecordCmdTraceRaysKHR(VkCommandBuffer commandBuffer, const VkStridedDeviceAddressRegionKHR* pRaygenShaderBindingTable, const VkStridedDeviceAddressRegionKHR* pMissShaderBindingTable, const VkStridedDeviceAddressRegionKHR* pHitShaderBindingTable, const VkStridedDeviceAddressRegionKHR* pCallableShaderBindingTable, uint32_t width, uint32_t height, uint32_t depth) {}; virtual bool PreCallValidateCreateRayTracingPipelinesKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkRayTracingPipelineCreateInfoKHR* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines) const { return false; }; virtual void PreCallRecordCreateRayTracingPipelinesKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkRayTracingPipelineCreateInfoKHR* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines) {}; virtual void PostCallRecordCreateRayTracingPipelinesKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkRayTracingPipelineCreateInfoKHR* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, VkResult result) {}; virtual bool PreCallValidateGetRayTracingCaptureReplayShaderGroupHandlesKHR(VkDevice device, VkPipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, void* pData) const { return false; }; virtual void PreCallRecordGetRayTracingCaptureReplayShaderGroupHandlesKHR(VkDevice device, VkPipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, void* pData) {}; virtual void PostCallRecordGetRayTracingCaptureReplayShaderGroupHandlesKHR(VkDevice device, VkPipeline pipeline, uint32_t firstGroup, uint32_t groupCount, size_t dataSize, void* pData, VkResult result) {}; virtual bool PreCallValidateCmdTraceRaysIndirectKHR(VkCommandBuffer commandBuffer, const VkStridedDeviceAddressRegionKHR* pRaygenShaderBindingTable, const VkStridedDeviceAddressRegionKHR* pMissShaderBindingTable, const VkStridedDeviceAddressRegionKHR* pHitShaderBindingTable, const VkStridedDeviceAddressRegionKHR* pCallableShaderBindingTable, VkDeviceAddress indirectDeviceAddress) const { return false; }; virtual void PreCallRecordCmdTraceRaysIndirectKHR(VkCommandBuffer commandBuffer, const VkStridedDeviceAddressRegionKHR* pRaygenShaderBindingTable, const VkStridedDeviceAddressRegionKHR* pMissShaderBindingTable, const VkStridedDeviceAddressRegionKHR* pHitShaderBindingTable, const VkStridedDeviceAddressRegionKHR* pCallableShaderBindingTable, VkDeviceAddress indirectDeviceAddress) {}; virtual void PostCallRecordCmdTraceRaysIndirectKHR(VkCommandBuffer commandBuffer, const VkStridedDeviceAddressRegionKHR* pRaygenShaderBindingTable, const VkStridedDeviceAddressRegionKHR* pMissShaderBindingTable, const VkStridedDeviceAddressRegionKHR* pHitShaderBindingTable, const VkStridedDeviceAddressRegionKHR* pCallableShaderBindingTable, VkDeviceAddress indirectDeviceAddress) {}; virtual bool PreCallValidateGetRayTracingShaderGroupStackSizeKHR(VkDevice device, VkPipeline pipeline, uint32_t group, VkShaderGroupShaderKHR groupShader) const { return false; }; virtual void PreCallRecordGetRayTracingShaderGroupStackSizeKHR(VkDevice device, VkPipeline pipeline, uint32_t group, VkShaderGroupShaderKHR groupShader) {}; virtual void PostCallRecordGetRayTracingShaderGroupStackSizeKHR(VkDevice device, VkPipeline pipeline, uint32_t group, VkShaderGroupShaderKHR groupShader) {}; virtual bool PreCallValidateCmdSetRayTracingPipelineStackSizeKHR(VkCommandBuffer commandBuffer, uint32_t pipelineStackSize) const { return false; }; virtual void PreCallRecordCmdSetRayTracingPipelineStackSizeKHR(VkCommandBuffer commandBuffer, uint32_t pipelineStackSize) {}; virtual void PostCallRecordCmdSetRayTracingPipelineStackSizeKHR(VkCommandBuffer commandBuffer, uint32_t pipelineStackSize) {}; virtual VkResult CoreLayerCreateValidationCacheEXT(VkDevice device, const VkValidationCacheCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkValidationCacheEXT* pValidationCache) { return VK_SUCCESS; }; virtual void CoreLayerDestroyValidationCacheEXT(VkDevice device, VkValidationCacheEXT validationCache, const VkAllocationCallbacks* pAllocator) {}; virtual VkResult CoreLayerMergeValidationCachesEXT(VkDevice device, VkValidationCacheEXT dstCache, uint32_t srcCacheCount, const VkValidationCacheEXT* pSrcCaches) { return VK_SUCCESS; }; virtual VkResult CoreLayerGetValidationCacheDataEXT(VkDevice device, VkValidationCacheEXT validationCache, size_t* pDataSize, void* pData) { return VK_SUCCESS; }; // Allow additional state parameter for CreateGraphicsPipelines virtual bool PreCallValidateCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkGraphicsPipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, void* cgpl_state) const { return PreCallValidateCreateGraphicsPipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines); }; virtual void PreCallRecordCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkGraphicsPipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, void* cgpl_state) { PreCallRecordCreateGraphicsPipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines); }; virtual void PostCallRecordCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkGraphicsPipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, VkResult result, void* cgpl_state) { PostCallRecordCreateGraphicsPipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines, result); }; // Allow additional state parameter for CreateComputePipelines virtual bool PreCallValidateCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkComputePipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, void* pipe_state) const { return PreCallValidateCreateComputePipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines); }; virtual void PreCallRecordCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkComputePipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, void* ccpl_state) { PreCallRecordCreateComputePipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines); }; virtual void PostCallRecordCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkComputePipelineCreateInfo* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, VkResult result, void* pipe_state) { PostCallRecordCreateComputePipelines(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines, result); }; // Allow additional state parameter for CreateRayTracingPipelinesNV virtual bool PreCallValidateCreateRayTracingPipelinesNV(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkRayTracingPipelineCreateInfoNV* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, void* pipe_state) const { return PreCallValidateCreateRayTracingPipelinesNV(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines); }; virtual void PreCallRecordCreateRayTracingPipelinesNV(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkRayTracingPipelineCreateInfoNV* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, void* ccpl_state) { PreCallRecordCreateRayTracingPipelinesNV(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines); }; virtual void PostCallRecordCreateRayTracingPipelinesNV(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkRayTracingPipelineCreateInfoNV* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, VkResult result, void* pipe_state) { PostCallRecordCreateRayTracingPipelinesNV(device, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines, result); }; // Allow additional state parameter for CreateRayTracingPipelinesKHR virtual bool PreCallValidateCreateRayTracingPipelinesKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkRayTracingPipelineCreateInfoKHR* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, void* pipe_state) const { return PreCallValidateCreateRayTracingPipelinesKHR(device, deferredOperation, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines); }; virtual void PreCallRecordCreateRayTracingPipelinesKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkRayTracingPipelineCreateInfoKHR* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, void* ccpl_state) { PreCallRecordCreateRayTracingPipelinesKHR(device, deferredOperation, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines); }; virtual void PostCallRecordCreateRayTracingPipelinesKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkRayTracingPipelineCreateInfoKHR* pCreateInfos, const VkAllocationCallbacks* pAllocator, VkPipeline* pPipelines, VkResult result, void* pipe_state) { PostCallRecordCreateRayTracingPipelinesKHR(device, deferredOperation, pipelineCache, createInfoCount, pCreateInfos, pAllocator, pPipelines, result); }; // Allow modification of a down-chain parameter for CreatePipelineLayout virtual void PreCallRecordCreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPipelineLayout* pPipelineLayout, void *cpl_state) { PreCallRecordCreatePipelineLayout(device, pCreateInfo, pAllocator, pPipelineLayout); }; // Enable the CreateShaderModule API to take an extra argument for state preservation and paramter modification virtual bool PreCallValidateCreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkShaderModule* pShaderModule, void* csm_state) const { return PreCallValidateCreateShaderModule(device, pCreateInfo, pAllocator, pShaderModule); }; virtual void PreCallRecordCreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkShaderModule* pShaderModule, void* csm_state) { PreCallRecordCreateShaderModule(device, pCreateInfo, pAllocator, pShaderModule); }; virtual void PostCallRecordCreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkShaderModule* pShaderModule, VkResult result, void* csm_state) { PostCallRecordCreateShaderModule(device, pCreateInfo, pAllocator, pShaderModule, result); }; // Allow AllocateDescriptorSets to use some local stack storage for performance purposes virtual bool PreCallValidateAllocateDescriptorSets(VkDevice device, const VkDescriptorSetAllocateInfo* pAllocateInfo, VkDescriptorSet* pDescriptorSets, void* ads_state) const { return PreCallValidateAllocateDescriptorSets(device, pAllocateInfo, pDescriptorSets); }; virtual void PostCallRecordAllocateDescriptorSets(VkDevice device, const VkDescriptorSetAllocateInfo* pAllocateInfo, VkDescriptorSet* pDescriptorSets, VkResult result, void* ads_state) { PostCallRecordAllocateDescriptorSets(device, pAllocateInfo, pDescriptorSets, result); }; // Allow modification of a down-chain parameter for CreateBuffer virtual void PreCallRecordCreateBuffer(VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer, void *cb_state) { PreCallRecordCreateBuffer(device, pCreateInfo, pAllocator, pBuffer); }; // Modify a parameter to CreateDevice virtual void PreCallRecordCreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDevice* pDevice, void *modified_create_info) { PreCallRecordCreateDevice(physicalDevice, pCreateInfo, pAllocator, pDevice); }; }; extern small_unordered_map<void*, ValidationObject*, 2> layer_data_map;
0.996094
high
Pods/Headers/ReactiveCocoa/RACCommand.h
brynbellomy/BrynKit
5
2908785
<filename>Pods/Headers/ReactiveCocoa/RACCommand.h<gh_stars>1-10 // // RACCommand.h // ReactiveCocoa // // Created by <NAME> on 3/3/12. // Copyright (c) 2012 GitHub, Inc. All rights reserved. // #import <Foundation/Foundation.h> #import <ReactiveCocoa/RACSignal.h> // A command is a signal triggered in response to some action, typically // UI-related. // // Each `next` sent by a RACCommand corresponds to a value passed to -execute:. @interface RACCommand : RACSignal // Whether or not this command can currently execute. // // This property will be NO if: // // - The command was created with a `canExecuteSignal`, and the latest value // sent on the signal was NO, or // - `allowsConcurrentExecution` is NO and `executing` is YES. // // It will be YES in all other cases. // // This property is both KVO- and KVC-compliant. @property (atomic, readonly) BOOL canExecute; // Whether the command allows multiple invocations of -execute: to proceed // concurrently. // // The default value for this property is NO. @property (atomic) BOOL allowsConcurrentExecution; // Whether the command is currently executing. // // This will be YES while any thread is running the -execute: method, or while // any signal returned from -addSignalBlock: has not yet finished. @property (atomic, getter = isExecuting, readonly) BOOL executing; // A signal of NSErrors received from all of the signals returned from // -addSignalBlock:, delivered onto the main thread. // // Note that the NSErrors on this signal are sent as `next` events, _not_ // `error` events (which would terminate any subscriptions). // // This can be used, for example, to show an alert whenever an error occurs in // the asynchronous work triggered by the command. @property (nonatomic, strong, readonly) RACSignal *errors; // Creates a command that can always be executed. + (instancetype)command; // Creates a command and initializes it with -initWithCanExecuteSignal:. + (instancetype)commandWithCanExecuteSignal:(RACSignal *)canExecuteSignal; // Initializes a command that can be executed conditionally. // // This is the designated initializer for this class. // // canExecuteSignal - A signal of BOOLs which indicate whether the command // should be enabled. `canExecute` will be based on the latest // value sent from this signal. Before any values are sent, // `canExecute` will default to YES. This argument may be // nil. // // Returns the initialized command. - (id)initWithCanExecuteSignal:(RACSignal *)canExecuteSignal; // Adds a block to invoke each time the receiver is executed. // // signalBlock - A block that returns a signal. The returned signal must not be // nil, and will be subscribed to synchronously from -execute:. If // the returned signal errors out, the `NSError` will be sent as // a value on `errors`. `executing` will remain YES until the // returned signal completes or errors. This argument must not be // nil. // // Returns a signal of the signals returned from successive invocations of // `signalBlock`. Each individual signal will be multicast to a replay subject. - (RACSignal *)addSignalBlock:(RACSignal * (^)(id value))signalBlock; // If `canExecute` is YES, this method will: // // - Set `executing` to YES. // - Send `value` to the receiver's subscribers. // - Execute each block added with -addSignalBlock: and subscribe to all of // the returned signals. // - Once all the signals returned from the `signalBlock`s have completed or // errored, set `executing` back to NO. // // Returns whether the command executed (i.e., whether `canExecute` was YES). - (BOOL)execute:(id)value; @end @interface RACCommand (Deprecated) - (void)sendNext:(id)value __attribute__((deprecated("Commands should not be manually controlled"))); - (void)sendError:(NSError *)error __attribute__((deprecated("Commands should not be manually controlled"))); - (void)sendCompleted __attribute__((deprecated("Commands should not be manually controlled"))); - (void)didSubscribeWithDisposable:(RACDisposable *)disposable __attribute__((deprecated("Commands should not be manually controlled"))); + (instancetype)subject __attribute__((deprecated("Use +command instead"))); @end
0.996094
high
tensorflow/core/kernels/cwise_ops_sycl_common.h
uve/tensorflow
0
6104313
/* Copyright 2016 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #if !TENSORFLOW_USE_SYCL #error This file must only be included when building TensorFlow with SYCL support #endif #ifndef TENSORFLOW_CORE_KERNELS_CWISE_OPS_SYCL_COMMON_H_ #define TENSORFLOW_CORE_KERNELS_CWISE_OPS_SYCL_COMMON_H_ #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/core/framework/register_types.h" #include "tensorflow/core/kernels/cwise_ops.h" #include "tensorflow/core/platform/types.h" namespace tensorflow { namespace functor { typedef Eigen::SyclDevice SYCLDevice; template <typename OUT, typename RHS> void Assign(const SYCLDevice& d, OUT out, RHS rhs) { out.device(d) = rhs; } // Partial specialization of UnaryFunctor<Device=SYCLDevice, Functor>. template <typename Functor> struct UnaryFunctor<SYCLDevice, Functor> { void operator()(const SYCLDevice& d, typename Functor::tout_type out, typename Functor::tin_type in) { To32Bit(out).device(d) = To32Bit(in).unaryExpr(typename Functor::func()); } }; // Partial specialization of BinaryFunctor<Device=SYCLDevice, Functor>. template <typename Functor, int NDIMS, bool has_errors> struct BinaryFunctor<SYCLDevice, Functor, NDIMS, has_errors> { void operator()(const SYCLDevice& d, typename Functor::tout_type out, typename Functor::tin_type in0, typename Functor::tin_type in1, bool* error) { To32Bit(out).device(d) = To32Bit(in0).binaryExpr(To32Bit(in1), typename Functor::func()); } void Left(const SYCLDevice& d, typename Functor::tout_type out, typename Functor::tscalar_type scalar, typename Functor::tin_type in, bool* error) { typedef typename Functor::func Binary; constexpr int NumDims = Functor::tin_type::NumDimensions; static_assert(NumDims == 1, "Unexpected size"); Eigen::Sizes<1> scalar_dim; out.device(d) = scalar.reshape(scalar_dim) .broadcast(in.dimensions()) .binaryExpr(in, Binary()); } void Right(const SYCLDevice& d, typename Functor::tout_type out, typename Functor::tin_type in, typename Functor::tscalar_type scalar, bool* error) { typedef typename Functor::func Binary; constexpr int NumDims = Functor::tin_type::NumDimensions; static_assert(NumDims == 1, "Unexpected size"); Eigen::Sizes<1> scalar_dim; out.device(d) = in.binaryExpr( scalar.reshape(scalar_dim).broadcast(in.dimensions()), Binary()); } void BCast(const SYCLDevice& d, typename TTypes<typename Functor::out_type, NDIMS>::Tensor out, typename TTypes<typename Functor::in_type, NDIMS>::ConstTensor in0, typename Eigen::array<Eigen::DenseIndex, NDIMS> bcast0, typename TTypes<typename Functor::in_type, NDIMS>::ConstTensor in1, typename Eigen::array<Eigen::DenseIndex, NDIMS> bcast1, bool* error) { typedef typename Functor::in_type T; typename Functor::func func; if ((NDIMS == 2) && Functor::use_bcast_optimization && use_bcast_optimization<T>::value) { const bool bcast0_all_one = AllOne<NDIMS>(bcast0); const bool bcast1_all_one = AllOne<NDIMS>(bcast1); if (bcast0_all_one && !bcast1_all_one) { To32Bit(out).device(d) = To32Bit(in0).binaryExpr(To32Bit(in1).broadcast(bcast1), func); return; } if (!bcast0_all_one && bcast1_all_one) { To32Bit(out).device(d) = To32Bit(in0).broadcast(bcast0).binaryExpr(To32Bit(in1), func); return; } } To32Bit(out).device(d) = To32Bit(in0).broadcast(bcast0).binaryExpr( To32Bit(in1).broadcast(bcast1), func); } }; // Macros to explicitly instantiate kernels on GPU for multiple types // (T0, T1, etc.) for UnaryFunctor (e.g., functor::sqrt). #define DEFINE_UNARY1(F, T) template struct UnaryFunctor<SYCLDevice, F<T> > #define DEFINE_UNARY2(F, T0, T1) \ DEFINE_UNARY1(F, T0); \ DEFINE_UNARY1(F, T1) #define DEFINE_UNARY3(F, T0, T1, T2) \ DEFINE_UNARY2(F, T0, T1); \ DEFINE_UNARY1(F, T2) #define DEFINE_UNARY4(F, T0, T1, T2, T3) \ DEFINE_UNARY2(F, T0, T1); \ DEFINE_UNARY2(F, T2, T3) #define DEFINE_UNARY5(F, T0, T1, T2, T3, T4) \ DEFINE_UNARY2(F, T0, T1); \ DEFINE_UNARY3(F, T2, T3, T4) // Macros to explicitly instantiate kernels on GPU for multiple types // (T0, T1, etc.) for BinaryFunctor. #define DEFINE_BINARY1(F, T) \ template struct BinaryFunctor<SYCLDevice, F<T>, 1>; \ template struct BinaryFunctor<SYCLDevice, F<T>, 2>; \ template struct BinaryFunctor<SYCLDevice, F<T>, 3> #define DEFINE_BINARY2(F, T0, T1) \ DEFINE_BINARY1(F, T0); \ DEFINE_BINARY1(F, T1) #define DEFINE_BINARY3(F, T0, T1, T2) \ DEFINE_BINARY2(F, T0, T1); \ DEFINE_BINARY1(F, T2) #define DEFINE_BINARY4(F, T0, T1, T2, T3) \ DEFINE_BINARY2(F, T0, T1); \ DEFINE_BINARY2(F, T2, T3) #define DEFINE_BINARY5(F, T0, T1, T2, T3, T4) \ DEFINE_BINARY2(F, T0, T1); \ DEFINE_BINARY3(F, T2, T3, T4) #define DEFINE_BINARY6(F, T0, T1, T2, T3, T4, T5) \ DEFINE_BINARY3(F, T0, T1, T2); \ DEFINE_BINARY3(F, T3, T4, T5) #define DEFINE_BINARY7(F, T0, T1, T2, T3, T4, T5, T6) \ DEFINE_BINARY3(F, T0, T1, T2); \ DEFINE_BINARY4(F, T3, T4, T5, T6) #define DEFINE_BINARY8(F, T0, T1, T2, T3, T4, T5, T6, T7) \ DEFINE_BINARY4(F, T0, T1, T2, T3); \ DEFINE_BINARY4(F, T4, T5, T6, T7) #define DEFINE_BINARY9(F, T0, T1, T2, T3, T4, T5, T6, T7, T8) \ DEFINE_BINARY4(F, T0, T1, T2, T3); \ DEFINE_BINARY5(F, T4, T5, T6, T7, T8) #define DEFINE_BINARY10(F, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) \ DEFINE_BINARY5(F, T0, T1, T2, T3, T4); \ DEFINE_BINARY5(F, T5, T6, T7, T8, T9) } // end namespace functor } // end namespace tensorflow #endif // TENSORFLOW_CORE_KERNELS_CWISE_OPS_SYCL_COMMON_H_
0.996094
high