<div dir="ltr"><div>Hi Mikhail,</div><div><br></div><div>You are right. I managed to build the WDDM drivers and OpenGL driver without any problem.  </div><div>Currently my understanding is that chromium commands is a command packet wrapper in which OpenGL state values are packed. The packer (GuestHost\OpenGL\packer) is built as VBoxOGLpackspu.dll that VBoxOGL.dll will use, meanwhile, there is a VBox HOST process interprets and execute the OpenGL commands (HostServices\SharedOpenGL\unpacker). </div>
<div>At this point I am still unclear on some details. Can you please enlighten me on a few questions? Really appreciate!</div><div>1) The 3D application running on guest OS creates render target (surfaces) where the render result goes in, I wonder how the render target are handled across the guest OS and the Host OpenGL servie that is doing the real rendering. </div>
<div><br></div><div>2) Suppose we have a very simple D3D application which just draws a triangle, essentially, this app goes through D3D runtime and  asks the user mode driver to create context, allocate at least two buffers - vertex buffer, and render surface, I feel that only the render surface buffer creation request will go to WDDM kernel mode driver ddi function DDI function CreateAllocation, the context and vertex buffer will convert to OpenGL context and vertex buffer. If I am right, the kernel mode driver allocate the render surface and pass back the address to user mode driver, then host service gets the render target and performs rendering on it, when the user mode driver knows the rendering is completed it informs the kernel mode driver and DDI function render or present copies the render target to framebuffer to finally present the result. This is my understanding to the whole process. If I have any misunderstanding or even not close, can you please walk me through the process how the simplest d3d app manages to draw a triangle and finally presents on the screen?  </div>
<div><br></div><div>Best regards,</div><div>Dong</div><div class="gmail_extra"><br><div class="gmail_quote">

On Fri, Apr 11, 2014 at 5:25 AM, Mikhail Sennikovsky <span dir="ltr"><<a href="mailto:mikhail.sennikovsky@oracle.com" target="_blank">mikhail.sennikovsky@oracle.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">


<div style="word-wrap:break-word">Hi Dong,<div><br></div><div>We do not use ICD SDK atm, so it should be possible to build all asutt using standard WDK/SDK headers/libs & tools.</div><div>We use XPDM-complient ICD interface to implement OpenGL support on windows.</div>


<div>As for D3D,  VBox WineD3D version is using VBoxOGL directly rather than via Opengl32 + ICD.</div><div>WDDM incarnation of VBox D3D in particular is actually using VBoxOGL as a layer for packing chromium commands which are then submitted via standard 3D/WDDM DDI.</div>


<span><font color="#888888"><div><br></div><div>Mikhail</div></font></span><div><div><div><br><div><div>On Apr 11, 2014, at 7:06 AM, DONG HE <<a href="mailto:hedonghust@gmail.com" target="_blank">hedonghust@gmail.com</a>> wrote:</div>


<br><blockquote type="cite"><div dir="ltr"><div><font face="arial, sans-serif">Hi Mikhail & </font><span style="font-family:arial,sans-serif">Klaus</span><span style="font-family:arial,sans-serif">,</span></div><div>

<font face="arial, sans-serif"><br>

</font></div><div><font face="arial, sans-serif">Thanks a lot for your information. It is very helpful. </font></div><div><font face="arial, sans-serif">I had wrong impression that VBox 3D implementation is on top SVGA, which leaded me to the wrong place in the repository where has an uncompleted SVGA.</font></div>



<div><span style="font-family:arial,sans-serif">Now I kinda have a big picture how VBox D3D&OpenGL driver works. </span><br></div><div><font face="arial, sans-serif">src\VBox\Additions\WINNT\Graphics\Video\mp\wddm contains the wddm miniport driver which talks to dxgkrnl.sys</font></div>



<div><font face="arial, sans-serif">src\VBox\Additions\WINNT\Graphics\Video\disp\wddm has the wddm d3d user mode driver known as VBoxDispD3D.dll. D3D states will convert to OGL states with the help of Wine, and eventually goes to the OpenGL drivers,  VBoxOGL.dll(src/VBox/Additions/common/crOpenGL).</font></div>



<div><font face="arial, sans-serif">However, a few things are still unclear to me, such as how those modules interact exactly.</font></div><div><font face="arial, sans-serif">And the OGL driver appears to be a Windows OpenGL ICD driver. I wonder if I need a Microsoft ICD SDK to build the OpenGL driver successfully. Did anyone manage to build the WDDM driver and OpenGL driver separately before?  </font></div>



<div><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">Regards,</font></div><div><font face="arial, sans-serif">DONG</font></div><div><font face="arial, sans-serif"><br></font></div><div>



<font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">>Just to get a bit more precise info on the current 3D source code location:</font></div><div><font face="arial, sans-serif">></font></div>



<div><font face="arial, sans-serif">>Guest-side code is located in</font></div><div><font face="arial, sans-serif">>src/VBox/Additions/common/crOpenGL</font></div><div><font face="arial, sans-serif">>src/VBox/Additions/WINNT/Graphics/Video (WDDM stuff)</font></div>



<div><font face="arial, sans-serif">>src/VBox/Additions/WINNT/Graphics/Wine_new</font></div><div><font face="arial, sans-serif">></font></div><div><font face="arial, sans-serif">>Host-side code is in</font></div>



<div><font face="arial, sans-serif">>src/VBox/HostServices/SharedOpenGL</font></div><div><font face="arial, sans-serif">></font></div><div><font face="arial, sans-serif">>Gues-Host shared code is</font></div><div>



<font face="arial, sans-serif">>src/VBox/GuestHost/OpenGL</font></div><div><font face="arial, sans-serif">></font></div><div><font face="arial, sans-serif">>Hope this helps.</font></div><div><font face="arial, sans-serif">></font></div>



<div><font face="arial, sans-serif">>Mikhail</font></div><div><font face="arial, sans-serif">></font></div><div><font face="arial, sans-serif">>On 02.04.2014 21:26, Klaus Espenlaub wrote:</font></div><div><font face="arial, sans-serif">>> Hi Dong,</font></div>



<div><font face="arial, sans-serif">>></font></div><div><font face="arial, sans-serif">>> On 01.04.2014 00:53, DONG HE wrote:</font></div><div><font face="arial, sans-serif">>>> Hello VBox developers,</font></div>



<div><font face="arial, sans-serif">>>></font></div><div><font face="arial, sans-serif">>>> Recently I have great interest in figuring out how VBox implement 3D</font></div><div><font face="arial, sans-serif">>>> support for D3D and OpenGL. The learning work finally can not proceed as</font></div>



<div><font face="arial, sans-serif">>>> a few files are missing from the SVN trunk check-out, which</font></div><div><font face="arial, sans-serif">>>> are DevVGA-SVGA3d-shared.cpp, DevVGA-SVGA3d-win.cpp</font></div>



<div><font face="arial, sans-serif">>>> and DevVGA-SVGA3d-ogl.cpp.</font></div><div><font face="arial, sans-serif">>>> I wonder why those files are truncated from the repository or if they</font></div><div>



<font face="arial, sans-serif">>>> exist in some experimental branches? Please give me some ideas. Thanks!</font></div><div><font face="arial, sans-serif">>> You're looking at totally the wrong stuff. These files are totally</font></div>



<div><font face="arial, sans-serif">>> unrelated to the existing 3D support.</font></div><div><font face="arial, sans-serif">>></font></div><div><font face="arial, sans-serif">>> Check the contents of src/VBox/HostServices/SharedOpenGL for a lot of</font></div>



<div><font face="arial, sans-serif">>> the code (there are bits and pieces elsewhere).</font></div><div><font face="arial, sans-serif">>></font></div><div><font face="arial, sans-serif">>> Note that I'm not knowing any details how the whole thing works, so</font></div>



<div><font face="arial, sans-serif">>> asking me personally won't get you much further.</font></div><div><font face="arial, sans-serif">>></font></div><div><font face="arial, sans-serif">>> Klaus</font></div>



<div><font face="arial, sans-serif">>>> Regards,</font></div><div><font face="arial, sans-serif">>>> DONG</font></div></div>
</blockquote></div><br></div></div></div></div></blockquote></div><br></div></div>