Overv / VulkanTutorial

Tutorial for the Vulkan graphics and compute API
https://vulkan-tutorial.com
Creative Commons Attribution Share Alike 4.0 International
3.12k stars 513 forks source link

Fix VkSamplerCreateInfo type assignments #180

Closed pablode closed 4 years ago

pablode commented 4 years ago

I've noticed that four members of the VkSamplerCreateInfo struct are floats, but assigned integer values in various places. Although implicit type conversion will be performed at compile time, I think this should be changed because of two reasons:

  1. Assigning integer values to the members may lead to the assumption that the members itself are of an integer type. This wrong assumption may lead to trouble (missing casts, invalid bitwise operations).
  2. The member types are an important semantic clue (f.i. one could assume that maxAnisotropy might represent a number of samples, whereas this idea does not seem probable when looking at a float assignment).

The definition of VkSamplerCreateInfo as of Vulkan 1.2 can be found here.

Overv commented 4 years ago

Nice! Thank you for thoroughly updating all of the files.