1 module dcompute.driver.ocl.sampler; 2 3 import dcompute.driver.ocl; 4 struct Sampler 5 { 6 enum FilterMode 7 { 8 nearest = 0x1140, 9 linear = 0x1141, 10 } 11 12 enum AddressingMode 13 { 14 none = 0x1130, 15 clampToEdge = 0x1131, 16 clamp = 0x1132, 17 repeat = 0x1133, 18 mirroredRepeat = 0x1134, 19 } 20 static struct Info 21 { 22 @(0x1150) uint referenceCount; 23 @(0x1151) Context context; 24 @(0x1152) bool normalisedCoordinates; // CHECKME is this actually a bool? 25 @(0x1153) AddressingMode addressingMode; 26 @(0x1154) FilterMode filterMode; 27 } 28 29 cl_sampler raw; 30 31 //mixin(generateGetInfo!(Info,clGetSamplerInfo)); 32 void retain() 33 { 34 status = cast(Status)clRetainSampler(raw); 35 checkErrors(); 36 } 37 38 void release() 39 { 40 status = cast(Status)clReleaseSampler(raw); 41 checkErrors(); 42 } 43 44 }