Originally posted by aaahaaap
View Post
Now back to applications are stupid. You will see application send to API the same Shader source thousands of times. Instead of build once use many. Shaders go though quite a heavy compiler process.
DXBC enters wined3d. Wined3d has to process this to GLSL this is not light. Then GLSL is process to a internal IR for GLSL optimisations(that hopefully in future will be replaced with SPIR-V) then is process again to NIR/something the video card driver processes. Then this is processed again to be something the graphics card accepts and then this can be processed again on the video card it self.
Vulkan drivers get to be 1 step shorter. Now working out if something is in shader cache normal end up having to hash the input this is cpu overhead and latency..
Like it or not most of the reason for graphics drivers requiring a cache is that applications are not being smart and reusing the shaders they have already built.
Yes using opengl its possible to do a binary upload of a shader with glProgramBinary. I don't know if you can do this with Vulkan all the design documents suggest not. Yes a binary upload with opengl skips straight over to the binary format for the video card this is magically skip over the LLVM compiler and hashing.
Welcome to nightmare the reality is wined3d using opengl does the functionality to-do a disc cache well with opengl but it not implemented. Vulkan that DXBC and other are using be missing it because that functionality may not be in vulkan yet. If it need functionality they may be needing to talk to khronos to get a Vulkan extension.
The reality here is the wined3d developers might be right this is why if someone had the skilled and could implement out wined3d to use the new opengl functions it might be the fastest solution. Yes vulkan is newer but it does not provide the features to allow coder to 100 percent replace the functionality in opengl at this stage and its why attempting to implement opengl program on top of Vulkan can be hard to impossible at times.
Leave a comment: