mirror of
https://github.com/italicsjenga/portability.git
synced 2025-02-17 06:37:43 +11:00
Merge #65
65: Fill out more sampler properties r=kvark a=msiglreith Fixes texture mapping and HDR sample Co-authored-by: msiglreith <m.siglreith@gmail.com>
This commit is contained in:
commit
9ae74be774
1 changed files with 13 additions and 6 deletions
|
@ -1846,7 +1846,6 @@ pub extern "C" fn gfxCreateSampler(
|
||||||
pSampler: *mut VkSampler,
|
pSampler: *mut VkSampler,
|
||||||
) -> VkResult {
|
) -> VkResult {
|
||||||
let info = unsafe { &*pCreateInfo };
|
let info = unsafe { &*pCreateInfo };
|
||||||
//TODO: fill all the sampler properties
|
|
||||||
let gfx_info = hal::image::SamplerInfo {
|
let gfx_info = hal::image::SamplerInfo {
|
||||||
min_filter: conv::map_filter(info.minFilter),
|
min_filter: conv::map_filter(info.minFilter),
|
||||||
mag_filter: conv::map_filter(info.magFilter),
|
mag_filter: conv::map_filter(info.magFilter),
|
||||||
|
@ -1856,11 +1855,19 @@ pub extern "C" fn gfxCreateSampler(
|
||||||
conv::map_wrap_mode(info.addressModeV),
|
conv::map_wrap_mode(info.addressModeV),
|
||||||
conv::map_wrap_mode(info.addressModeW),
|
conv::map_wrap_mode(info.addressModeW),
|
||||||
),
|
),
|
||||||
lod_bias: 0.0.into(),
|
lod_bias: info.mipLodBias.into(),
|
||||||
lod_range: 0.0.into() .. 1.0.into(),
|
lod_range: info.minLod.into() .. info.maxLod.into(),
|
||||||
comparison: None,
|
comparison: if info.compareEnable == VK_TRUE {
|
||||||
border: [0.0; 4].into(),
|
Some(conv::map_compare_op(info.compareOp))
|
||||||
anisotropic: hal::image::Anisotropic::Off,
|
} else {
|
||||||
|
None
|
||||||
|
},
|
||||||
|
border: [0.0; 4].into(), // TODO
|
||||||
|
anisotropic: if info.anisotropyEnable == VK_TRUE {
|
||||||
|
hal::image::Anisotropic::On(info.maxAnisotropy as _)
|
||||||
|
} else {
|
||||||
|
hal::image::Anisotropic::Off
|
||||||
|
},
|
||||||
};
|
};
|
||||||
let sampler = gpu.device.create_sampler(gfx_info);
|
let sampler = gpu.device.create_sampler(gfx_info);
|
||||||
unsafe { *pSampler = Handle::new(sampler); }
|
unsafe { *pSampler = Handle::new(sampler); }
|
||||||
|
|
Loading…
Add table
Reference in a new issue