mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2024-11-25 04:50:04 +00:00
Refactor reducer options (#2709)
Avoids polluting the global namespace with a constant, and moves constructor to .cpp file as is done for spirv-reduce's options.
This commit is contained in:
parent
a6bfc26e5f
commit
5a93e07392
@ -17,6 +17,14 @@
|
||||
|
||||
#include "source/spirv_reducer_options.h"
|
||||
|
||||
namespace {
|
||||
// The default maximum number of steps the reducer will take before giving up.
|
||||
const uint32_t kDefaultStepLimit = 250;
|
||||
} // namespace
|
||||
|
||||
spv_reducer_options_t::spv_reducer_options_t()
|
||||
: step_limit(kDefaultStepLimit), fail_on_validation_error(false) {}
|
||||
|
||||
SPIRV_TOOLS_EXPORT spv_reducer_options spvReducerOptionsCreate() {
|
||||
return new spv_reducer_options_t();
|
||||
}
|
||||
|
@ -20,14 +20,10 @@
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
// The default maximum number of steps for the reducer to run before giving up.
|
||||
const uint32_t kDefaultStepLimit = 250;
|
||||
|
||||
// Manages command line options passed to the SPIR-V Reducer. New struct
|
||||
// members may be added for any new option.
|
||||
struct spv_reducer_options_t {
|
||||
spv_reducer_options_t()
|
||||
: step_limit(kDefaultStepLimit), fail_on_validation_error(false) {}
|
||||
spv_reducer_options_t();
|
||||
|
||||
// See spvReducerOptionsSetStepLimit.
|
||||
uint32_t step_limit;
|
||||
|
Loading…
Reference in New Issue
Block a user