IGCIT / Intel-GPU-Community-Issue-Tracker-IGCIT

IGCIT is a Community-driven issue tracker for Intel GPUs.
GNU General Public License v3.0
112 stars 3 forks source link

Support Request for VK_KHR_fragment_shader_barycentric on Intel Arc GPUs for hybrid rendering #751

Open BeRo1985 opened 3 months ago

BeRo1985 commented 3 months ago

Application [Required]

PasVulkan

Processor / Processor Number [Required]

Don't matter here

Graphic Card [Required]

Intel Arc (all)

Rendering API [Required]

Windows Build Number [Required]

Other Windows build number

Don't matter here

Describe the feature [Required]

Dear Intel Developer Support,

I am reaching out as the sole developer and creator of the PasVulkan project, a venture dedicated to exploring and pushing the limits of hybrid rendering techniques and hardware raytracing. During my work on this project, I have identified a critical issue that significantly impacts rendering accuracy, specifically regarding Ray Anti-Self-Intersection Offsetting inside the hybrid rendering approach.

In my detailed testing and comparison, I found that using the VK_KHR_fragment_shader_barycentric extension greatly enhances the accuracy of geometric normal calculations, a key component in achieving precise rendering results. The code implementation using this extension is as follows:

#extension GL_EXT_fragment_shader_barycentric : enable
layout(location = 0) pervertexEXT in vec3 wsPos[];
vec3 geometricNormal = normalize(cross(wsPos[1] - wsPos[0], wsPos[2] - wsPos[0]));

This method has proven to be more effective than the conventional approach of calculating geometric normals via derivatives:

layout(location = 0) in vec3 wsPos;
vec3 geometricNormal = normalize(cross(dFdx(wsPos), dFdy(wsPos)));

However, I've encountered a substantial roadblock: Intel Arc GPUs currently do not support the VK_KHR_fragment_shader_barycentric extension. This lack of support is notably perplexing, given the extension's availability and support across competing hardware platforms, including NVIDIA and AMD GPUs, which are also capable of hardware ray tracing.

The absence of support for this extension in Intel Arc GPUs necessitates additional, less efficient workarounds, such as the implementation of an extra geometry shader or a forced shift to mesh shaders for accurate geometric normal calculations inside the shaders itself. These workarounds are not only cumbersome but also detract from the streamlined efficiency and potential performance gains that could be realized with direct support for the VK_KHR_fragment_shader_barycentric extension.

Therefore, I kindly request that Intel consider adding support for the VK_KHR_fragment_shader_barycentric extension in Intel Arc GPUs. Such support would greatly benefit the hybrid rendering by allowing for more accurate and efficient rendering techniques. It would also ensure that developers have access to a broader range of tools and extensions that facilitate cutting-edge graphic rendering developments.

I appreciate your time and consideration of this request and look forward to any possibility of future support or dialogue regarding this matter.

Best regards, Benjamin Rosseaux

Additional notes

No response

Karen-Intel commented 2 months ago

Hi @BeRo1985 thank you so much for reaching out

Help, can you share a small -homebrew code- to exemplify the issue? It will help us a lot to prove the point and open a case with the driver team. Can you help us with that? I'll be on the lookout :)

Karen

Karen-Intel commented 1 month ago

Hi @BeRo1985 any update in providing the homebrew code we need to proceed with this request? We'll wait a couple days for your reply, otherwise we'll have to close this case.

Thanks

Karen

BeRo1985 commented 1 month ago

Unfortunately, I haven't had time to create a compact example yet, as I'm currently heavily involved in a game title project with a custom in-house engine. However, I will try to create a simple example in the next few weeks. I think that in order to speed things up, that I will most likely use an existing small Triangle Vulkan code example as a template, which I will then modify so that it uses VK_KHR_fragment_shader_barycentric in a well demonstrative way.

Karen-Intel commented 1 month ago

@BeRo1985 thank you!

I'll be monitoring this thread :)

Karen