Home | History | Annotate | Download | only in source
      1 // Copyright (c) 2018 Google LLC
      2 //
      3 // Licensed under the Apache License, Version 2.0 (the "License");
      4 // you may not use this file except in compliance with the License.
      5 // You may obtain a copy of the License at
      6 //
      7 //     http://www.apache.org/licenses/LICENSE-2.0
      8 //
      9 // Unless required by applicable law or agreed to in writing, software
     10 // distributed under the License is distributed on an "AS IS" BASIS,
     11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     12 // See the License for the specific language governing permissions and
     13 // limitations under the License.
     14 
     15 #ifndef SOURCE_SPIRV_OPTIMIZER_OPTIONS_H_
     16 #define SOURCE_SPIRV_OPTIMIZER_OPTIONS_H_
     17 
     18 #include "source/spirv_validator_options.h"
     19 #include "spirv-tools/libspirv.h"
     20 
     21 // Manages command line options passed to the SPIR-V Validator. New struct
     22 // members may be added for any new option.
     23 struct spv_optimizer_options_t {
     24   spv_optimizer_options_t()
     25       : run_validator_(true),
     26         val_options_(),
     27         max_id_bound_(kDefaultMaxIdBound) {}
     28 
     29   // When true the validator will be run before optimizations are run.
     30   bool run_validator_;
     31 
     32   // Options to pass to the validator if it is run.
     33   spv_validator_options_t val_options_;
     34 
     35   // The maximum value the id bound for a module can have.  The Spir-V spec says
     36   // this value must be at least 0x3FFFFF, but implementations can allow for a
     37   // higher value.
     38   uint32_t max_id_bound_;
     39 };
     40 #endif  // SOURCE_SPIRV_OPTIMIZER_OPTIONS_H_
     41