Hello, Im using sdl3 GPU and converting glsl to spir-V. I’m using the glsl extention GL_EXT_fragment_shader_barycentric.
Written in glsl like this:
#extension GL_EXT_fragment_shader_barycentric : enable
The extension seems to work fine, looking at what I am rendering, but even so I get this error message: (btw, this error message pops up when i create a shader with sdl.CreateGPUShader())
Validation Error: [ VUID-VkShaderModuleCreateInfo-pCode-08740 ] | MessageID = 0x6e224e9
vkCreateShaderModule(): SPIR-V Capability FragmentBarycentricKHR was declared, but one of the following requirements is required (VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR::fragmentShaderBarycentric OR VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV::fragmentShaderBarycentric).
The Vulkan spec states: If pCode is a pointer to SPIR-V code, and pCode declares any of the capabilities listed in the SPIR-V Environment appendix, one of the corresponding requirements must be satisfied (https://docs.vulkan.org/spec/latest/chapters/shaders.html#VUID-VkShaderModuleCreateInfo-pCode-08740)
Validation Error: [ VUID-VkShaderModuleCreateInfo-pCode-08742 ] | MessageID = 0xfc68be96
vkCreateShaderModule(): SPIR-V Extension SPV_KHR_fragment_shader_barycentric was declared, but one of the following requirements is required (VK_KHR_fragment_shader_barycentric).
The Vulkan spec states: If pCode is a pointer to SPIR-V code, and pCode declares any of the SPIR-V extensions listed in the SPIR-V Environment appendix, one of the corresponding requirements must be satisfied (https://docs.vulkan.org/spec/latest/chapters/shaders.html#VUID-VkShaderModuleCreateInfo-pCode-08742)
So I want to get rid of this error message, so in Odin-lang, I try to use sdl.CreateGPUDeviceWithProperties(), and bring in some properties
make_properties :: proc() -> sdl.PropertiesID {
barycentric_features := vk.PhysicalDeviceFragmentShaderBarycentricFeaturesKHR {
sType = vk.StructureType.PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR,
pNext = nil,
fragmentShaderBarycentric = true,
}
ext_name := cstring("VK_KHR_fragment_shader_barycentric")
dExtension_list := [1]cstring{ ext_name }
vk_options := sdl.GPUVulkanOptions {
vulkan_api_version = vk.API_VERSION_1_0, // Feature list requires Vulkan 1.1+
feature_list = &barycentric_features,
device_extension_count = 1,
device_extension_names = &dExtension_list[0],
}
props := sdl.CreateProperties()
fmt.assertf(sdl.SetPointerProperty(props, sdl.PROP_GPU_DEVICE_CREATE_VULKAN_OPTIONS_POINTER, &vk_options),
"Could not add on properties", sdl.GetError())
return props
}
I do this both when I create the GPU-device, and with the properties property in the createShaderInfo struct. The rendering works as expected, but I STILL get the error messages. So I go into khronos’s website, I have no idea what they mean with:
-“if pCode is a pointer to SPIR-V code, and pCode declares any of the capabilities listed in the SPIR-V Environment appendix, one of the corresponding requirements must be satisfied”
and I try to add on the instance extension: vk.KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, specified in the extention appendicies “https://docs.vulkan.org/spec/latest/appendices/extensions.html#VK_KHR_fragment_shader_barycentric”, but the error message still pops up. Does anybody know what I’m doing wrong???