mirror of
https://github.com/fumiama/gozel.git
synced 2026-06-12 04:20:28 +08:00
feat(examples): add image_scale (#7)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
26
ze/sampler.go
Normal file
26
ze/sampler.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package ze
|
||||
|
||||
import "github.com/fumiama/gozel/gozel"
|
||||
|
||||
// SamplerHandle (ze_sampler_handle_t) Handle of driver's sampler object
|
||||
type SamplerHandle gozel.ZeSamplerHandle
|
||||
|
||||
// SamplerCreate Creates sampler on the context.
|
||||
func (h ContextHandle) SamplerCreate(
|
||||
hDevice DeviceHandle, addressmode gozel.ZeSamplerAddressMode,
|
||||
filtermode gozel.ZeSamplerFilterMode, isnormalized gozel.ZeBool,
|
||||
) (sh SamplerHandle, err error) {
|
||||
_, err = gozel.ZeSamplerCreate(gozel.ZeContextHandle(h), gozel.ZeDeviceHandle(hDevice), &gozel.ZeSamplerDesc{
|
||||
Stype: gozel.ZE_STRUCTURE_TYPE_SAMPLER_DESC,
|
||||
Addressmode: addressmode,
|
||||
Filtermode: filtermode,
|
||||
Isnormalized: isnormalized,
|
||||
}, (*gozel.ZeSamplerHandle)(&sh))
|
||||
return
|
||||
}
|
||||
|
||||
// Destroy Destroys sampler object.
|
||||
func (h SamplerHandle) Destroy() error {
|
||||
_, err := gozel.ZeSamplerDestroy(gozel.ZeSamplerHandle(h))
|
||||
return err
|
||||
}
|
||||
Reference in New Issue
Block a user