[2.1+] Dx11 Indirect buffers disabled..?
-
- OGRE Expert User
- Posts: 1227
- Joined: Thu Dec 11, 2008 7:56 pm
- Location: Bristol, UK
- x 157
[2.1+] Dx11 Indirect buffers disabled..?
So, I have just noticed that dx11 indirect buffers is and has always been disabled. I enabled it, fixed a minor bug, and all seems to work fine. Any reason why it is disabled!?
- dark_sylinc
- OGRE Team Member
- Posts: 5299
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1280
- Contact:
Re: [2.1+] Dx11 Indirect buffers disabled..?
I am going to say: "Oh no".
What was the bugfix and what was disabling it?
What was the bugfix and what was disabling it?
-
- OGRE Expert User
- Posts: 1227
- Joined: Thu Dec 11, 2008 7:56 pm
- Location: Bristol, UK
- x 157
Re: [2.1+] Dx11 Indirect buffers disabled..?
Its disabled in the VAO manager construction.
When setting the indirect buffer it would never be set as it was looking at the member variable instead of the input variable. Oh and the VAO does not set the indirect buffer flag, I have added it, but due to the way it currently works it adds it for any 'SHADER_BUFFER' type VAO, which I am not sure if its a problem or not.
However I have an 'indrect buffer' branch which adds indirect buffer views to UAVs and allows them to be used with compute buffers, etc. I could probably create a PR in the next 48hrs for you to take a look. Some of your very recent fixes in the VCT fix issues that I was working around/fudged, so it should look pretty tidy now, apart from the VAO indirect buffer flag issue
When setting the indirect buffer it would never be set as it was looking at the member variable instead of the input variable. Oh and the VAO does not set the indirect buffer flag, I have added it, but due to the way it currently works it adds it for any 'SHADER_BUFFER' type VAO, which I am not sure if its a problem or not.
However I have an 'indrect buffer' branch which adds indirect buffer views to UAVs and allows them to be used with compute buffers, etc. I could probably create a PR in the next 48hrs for you to take a look. Some of your very recent fixes in the VCT fix issues that I was working around/fudged, so it should look pretty tidy now, apart from the VAO indirect buffer flag issue
- dark_sylinc
- OGRE Team Member
- Posts: 5299
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1280
- Contact:
Re: [2.1+] Dx11 Indirect buffers disabled..?
Analyzing your fork I remembered why it was disabled: It was intentional but not for a big reason.
The reason was that indirect buffers were not really being used (i.e. no compute shader was taking advantage of it), and from a C++ side a real indirect buffer needs to be mapped (which has OS or thread synchronization overhead), just to be used with one DrawIndirect call at a time.
In OpenGL there is no overhead thanks to persistent mapping and even if there were no persistent mapping, we can use just one API call glMultiDrawElementsIndirect to render it all.
So basically it was disabled because there was only things to lose and nothing to gain. That changes completely if you introduce an actual use for indirect buffers though.
The reason was that indirect buffers were not really being used (i.e. no compute shader was taking advantage of it), and from a C++ side a real indirect buffer needs to be mapped (which has OS or thread synchronization overhead), just to be used with one DrawIndirect call at a time.
In OpenGL there is no overhead thanks to persistent mapping and even if there were no persistent mapping, we can use just one API call glMultiDrawElementsIndirect to render it all.
So basically it was disabled because there was only things to lose and nothing to gain. That changes completely if you introduce an actual use for indirect buffers though.