Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
400 additions
and
147 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#include "calcfirstder.cl" | ||
|
||
__constant sampler_t sampler = | ||
CLK_NORMALIZED_COORDS_FALSE | ||
| CLK_ADDRESS_CLAMP_TO_EDGE | ||
| CLK_FILTER_NEAREST; | ||
|
||
__kernel void processNineCellWindow( | ||
__read_only image2d_t inputImage, | ||
image2d_t outputImage, | ||
__global float *rasterParams | ||
) { | ||
|
||
|
||
// 0=width, 1=height | ||
int2 currentPosition = (int2)(get_global_id(0), get_global_id(1)); | ||
float4 currentPixel = (ufloat4)(0.0f); | ||
float4 calculatedPixel = (float4)(1.0f); | ||
|
||
currentPixel = read_imageuf(inputImage, sampler, currentPosition); | ||
calculatedPixel = currentPixel; | ||
write_imageuf(outputImage, currentPosition, calculatedPixel); | ||
} | ||
|
||
|
||
const sampler_t smp = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_LINEAR; | ||
|
||
void kernel copy(__read_only image2d_t in, image2d_t out) | ||
{ | ||
int x = get_global_id(0); | ||
int y = get_global_id(1); | ||
int2 pos = (int2)(x, y); | ||
uint4 pixel = read_imageui(in, smp, pos); | ||
write_imageui(out, pos, pixel); | ||
} |
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 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 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 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
Oops, something went wrong.