|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#pragma once |
|
#include "common.h" |
|
|
|
|
|
|
|
|
|
#define AA_DISCONTINUITY_KERNEL_BLOCK_WIDTH 32 |
|
#define AA_DISCONTINUITY_KERNEL_BLOCK_HEIGHT 8 |
|
#define AA_ANALYSIS_KERNEL_THREADS_PER_BLOCK 256 |
|
#define AA_MESH_KERNEL_THREADS_PER_BLOCK 256 |
|
#define AA_HASH_ELEMENTS_PER_TRIANGLE(alloc) ((alloc) >= (2 << 25) ? 4 : 8) // With more than 16777216 triangles (alloc >= 33554432) use smallest possible value of 4 to conserve memory, otherwise use 8 for fewer collisions. |
|
#define AA_LOG_HASH_ELEMENTS_PER_TRIANGLE(alloc) ((alloc) >= (2 << 25) ? 2 : 3) |
|
#define AA_GRAD_KERNEL_THREADS_PER_BLOCK 256 |
|
|
|
|
|
|
|
|
|
struct AntialiasKernelParams |
|
{ |
|
const float* color; |
|
const float* rasterOut; |
|
const int* tri; |
|
const float* pos; |
|
float* output; |
|
const float* dy; |
|
float* gradColor; |
|
float* gradPos; |
|
int4* workBuffer; |
|
uint4* evHash; |
|
int allocTriangles; |
|
int numTriangles; |
|
int numVertices; |
|
int width; |
|
int height; |
|
int n; |
|
int channels; |
|
float xh, yh; |
|
int instance_mode; |
|
int tri_const; |
|
}; |
|
|
|
|
|
|