
// CommonStrokeTessellatorControlPrivate.hpp - internal common declarations for control shader portion of polar stroking on CPU

#ifndef __CommonStrokeTessellatorControlPrivate_hpp__
#define __CommonStrokeTessellatorControlPrivate_hpp__

#include "CommonStrokeTessellatorPrivate.hpp"

// Macros for simulating shared variables in tessellation control shader.
// Use PER_THREAD in situations like:
//   something[TID] = this[TID+1] - that[TID];
// Use PER_THREAD_COUNT in situations where input is an input
// array, sized smaller than NUM_THREADS, like (this avoids out-of-bounds
// array reads on the CPU; not a problem on the GPU):
//   something[TID] = input[TID];
// Use PER_THREAD_REVERSE in situations where like:
//   something[TID] = this[TID-1] - that[TID];
// Use FOR_THREAD in situations like:
//   if (TID == n) something[TID] = value;
# define PER_THREAD for (int TID=0; TID<NUM_THREADS; TID++)
# define PER_THREAD_COUNT(num) assert((num) <= NUM_THREADS); for (int TID=0; TID<(num); TID++)
# define PER_THREAD_REVERSE for (int TID=NUM_THREADS-1; TID>=0; TID--)
# define FOR_THREAD(thread) for (int TID=(thread); TID==(thread); TID++)
# if defined(_MSC_VER)
#  pragma warning(disable : 6296)  // Ill-defined for-loop.  Loop body only executed once.
   // Because FOR_THREAD(0) is used to execute on a single thread.
# endif

#endif // __CommonStrokeTessellatorControlPrivate_hpp__
