This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This algorithm replaces zeros with whatever number came before them in an array. | |
// This code assumes the total data size (c_dataSize) is a multiple of 1024 the modern thread group size limit. | |
// It's an exercise for the reader to support odd lengths. :) | |
// What should the behavior be if the very first element in the sequence starts with zero? | |
// Set lastValue initial value to determine that behavior. | |
RWTexture2D<float> data; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <chrono> | |
struct XorShift128State | |
{ | |
uint32_t a, b, c, d; | |
}; | |
/* The state array must be initialized to not be all zero */ | |
uint32_t xorshift128(XorShift128State *state) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <memory> | |
#include <vector> | |
struct XMVECTOR | |
{ | |
float x, y, z, w; | |
}; | |
template <typename T, unsigned int Alignment = 16> | |
class AlignedAllocator : public std::allocator<T> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
context3D.setProgramConstantsFromVector(Context3DProgramType.FRAGMENT, 0, Vector.<Number>([ | |
1, | |
0, | |
Math.PI, | |
2 * Math.PI, | |
1e-10, | |
Math.PI / 2, | |
0, // not used | |
0, // not used |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This requires Windows XP or newer. | |
#include <stdio.h> | |
#include <tchar.h> | |
#include <windows.h> | |
unsigned int flags = FILE_NOTIFY_CHANGE_LAST_WRITE | | |
FILE_NOTIFY_CHANGE_SIZE | | |
FILE_NOTIFY_CHANGE_DIR_NAME | | |
FILE_NOTIFY_CHANGE_FILE_NAME; |