[GSoC 2012] Complete the DirectX 11 render system

Threads related to Google Summer of Code
Post Reply
User avatar
Wolfmanfx
OGRE Team Member
OGRE Team Member
Posts: 1525
Joined: Fri Feb 03, 2006 10:37 pm
Location: Austria - Leoben
x 1
Contact:

Re: [GSoC 2012] Complete the DirectX 11 render system

Post by Wolfmanfx » Fri Aug 10, 2012 9:45 pm

0 x

User avatar
robert_sasu
Google Summer of Code Student
Google Summer of Code Student
Posts: 238
Joined: Mon Apr 02, 2012 11:07 am

Re: [GSoC 2012] Complete the DirectX 11 render system

Post by robert_sasu » Fri Aug 10, 2012 9:49 pm

I was reading the same page at this moment. What is important is that with dynamic shader linkage, developers can more easily author larger, flexible shaders and permute out specialized, optimized versions for use at run time during specific rendering.
It seems like there is a need for dynamic shader linkage because of the combinatorial explosion of the shaders.
So in essence the language design of the HLSL language is driven by the fact that we have too many shaders and someone assumes that we can't cope with the shear quantity. To fix this we need dynamic shader
0 x
Google Summer of Code 2013 Student
Topic: "DirectX 11 & Tessellation samples"
Project links: Project thread, WIKI page, Code fork for the project
Mentor: Assaf Raman

User avatar
Wolfmanfx
OGRE Team Member
OGRE Team Member
Posts: 1525
Joined: Fri Feb 03, 2006 10:37 pm
Location: Austria - Leoben
x 1
Contact:

Re: [GSoC 2012] Complete the DirectX 11 render system

Post by Wolfmanfx » Fri Aug 10, 2012 9:54 pm

I think its not a bad feature to have OOP and virtual functions / late binding when I program my shaders by hand but i am not sure if its good for rtss because you do not need to take care about shader explosion its done by rtss and not by a human and you get "optimized code".
0 x

User avatar
robert_sasu
Google Summer of Code Student
Google Summer of Code Student
Posts: 238
Joined: Mon Apr 02, 2012 11:07 am

Re: [GSoC 2012] Complete the DirectX 11 render system

Post by robert_sasu » Fri Aug 10, 2012 10:38 pm

I thought I will put the dynamic linkage not in the RTSS, just in the DirectX 11 Render System (anyway, it has a good effect just when using shader model 5.0) and in HLSL.
0 x
Google Summer of Code 2013 Student
Topic: "DirectX 11 & Tessellation samples"
Project links: Project thread, WIKI page, Code fork for the project
Mentor: Assaf Raman

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: [GSoC 2012] Complete the DirectX 11 render system

Post by Assaf Raman » Sat Aug 11, 2012 11:19 am

Yes, do it outside the RTSS, and create a new sample to demonstrate it.
0 x
Watch out for my OGRE related tweets here.

User avatar
Eugene
OGRE Team Member
OGRE Team Member
Posts: 182
Joined: Mon Mar 24, 2008 4:54 pm
Location: Odessa, Ukraine

Re: [GSoC 2012] Complete the DirectX 11 render system

Post by Eugene » Sun Aug 12, 2012 3:41 am

Wolfmanfx wrote:I think its not a bad feature to have OOP and virtual functions / late binding when I program my shaders by hand but i am not sure if its good for rtss because you do not need to take care about shader explosion its done by rtss and not by a human and you get "optimized code".
RTSS in it`s current form is not appropriate for WinRT mode, as runtime shader compilation is forbidden. So if RTSS can be tweaked to dynamically link final shader from some amount of the precompiled building blocks - it would solve this problem.
0 x

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: [GSoC 2012] Complete the DirectX 11 render system

Post by Assaf Raman » Sun Aug 12, 2012 9:25 am

@robert_sasu - Well, after thinking about it more, before continuing to new features - like the dynamic linkage, as we only have one more week for the project, I want to focus this week on cleaning the code up and merging it back to the main trunk.
Talk to me over Skype and we will work out the details.
0 x
Watch out for my OGRE related tweets here.

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: [GSoC 2012] Complete the DirectX 11 render system

Post by Assaf Raman » Sun Aug 12, 2012 9:32 am

Can you fill this form and send it to e-mail at the end of the forum - so we can merge your work to the main repo?

Post on this thread after doing it - so I will know that you have.
0 x
Watch out for my OGRE related tweets here.

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: [GSoC 2012] Complete the DirectX 11 render system

Post by Assaf Raman » Sun Aug 12, 2012 10:09 am

Part of the "todo" list for this week:
1. Remove unused code - (ex: D3D11Tessellation)
2. Add comment to your new code if needed.
3. Make sure Cg compiles shader model 5 shaders. (Ex - look at line 46 in src\PlugIns\CgProgramManager\src\OgreCgProgram.cpp).
4. Finish tessellation sample - add controls to control some tessellation parameters you will also add. Add new thumbnail image to the sample. Make sure that the sample only work with the d3d11 render system - else shows a message - like other render system specific samples.
5. Work with the guys on this thread to see that the relevant code from their fork is merged.
6. Create a new fork of the current OGRE trunk, merge your fork into it, this will make the merge to the trunk easy for me.

Lets try to finish it all before the weekend - so it will not be last minute for me to merge your code into the trunk.
0 x
Watch out for my OGRE related tweets here.

User avatar
robert_sasu
Google Summer of Code Student
Google Summer of Code Student
Posts: 238
Joined: Mon Apr 02, 2012 11:07 am

Re: [GSoC 2012] Complete the DirectX 11 render system

Post by robert_sasu » Sun Aug 12, 2012 11:49 am

1. I will remove the unused code (D3D11Tessellation), by ignoring/forgetting it by hg. Later I will include also this to my fork after I will be ready for these algorithms, as I said I want to continue to work (I like really much this project).
2. Comments are generally done for all of my new code.
3. I will look at the Cg compiler today and add changes if needed.
4. Tessellation sample is too simple now, I need a little bit to think about how to add some control parameters (I have an idea after finishing the dynamic linkage).
5. I have completed merging Eugene's work, but I am not really sure how I will do merge Cygon's work (and he wrote in the other thread that he would willing to do it, also probably started working as I understood his replies.)
6. I will create the fork tomorrow, after tasks 1, 3 are done.

I am willing to continue this project and finish the proposed features outside the GSoC. After doing these 6 tasks and creating the fork on OGRE trunk I would like to continue to work with the dynamic linkage, tessellation sample and RTSS . After I will resolve to have a machine where I can test multi-device support, I will definitely finish also that :).

About the form do I have to sign manually, so printing it, signing it and scanning it after that ?
0 x
Google Summer of Code 2013 Student
Topic: "DirectX 11 & Tessellation samples"
Project links: Project thread, WIKI page, Code fork for the project
Mentor: Assaf Raman

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: [GSoC 2012] Complete the DirectX 11 render system

Post by Assaf Raman » Sun Aug 12, 2012 1:35 pm

Print, sign, then scan or take a clear photo with the cell phone.
0 x
Watch out for my OGRE related tweets here.

User avatar
robert_sasu
Google Summer of Code Student
Google Summer of Code Student
Posts: 238
Joined: Mon Apr 02, 2012 11:07 am

Re: [GSoC 2012] Complete the DirectX 11 render system

Post by robert_sasu » Sun Aug 12, 2012 7:05 pm

Here is the license agreement signed :)

I tried to close and delete a branch from my repo (d3d11-multiWindows). I tried with hg strip and hg close but neither of them worked for me. Can anyone help me out of this ? :)
0 x
Google Summer of Code 2013 Student
Topic: "DirectX 11 & Tessellation samples"
Project links: Project thread, WIKI page, Code fork for the project
Mentor: Assaf Raman

CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
Contact:

Re: [GSoC 2012] Complete the DirectX 11 render system

Post by CABAListic » Sun Aug 12, 2012 7:34 pm

robert_sasu wrote: I tried to close and delete a branch from my repo (d3d11-multiWindows). I tried with hg strip and hg close but neither of them worked for me. Can anyone help me out of this ? :)
This isn't really something that hg is designed for, because once something is in the repository history, it's meant to stay. Branches included. You might try to clone the repository from the revision before you created the branch, then try and use transplant to cherry-pick all the revisions after that one that you want to keep (i.e. those not on the branch). I haven't actually done this, so I can't give you detailed instructions, but something along these lines should work.
0 x

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: [GSoC 2012] Complete the DirectX 11 render system

Post by Assaf Raman » Mon Aug 13, 2012 7:19 am

I committed a lot of WinRT fixes to this project fork. I also wrote the code for caching shader reflections - as shader reflection is not available for WinRT application that are in the Microsoft store (according to rumors).
WinRT still doesn't run - but I am almost there in getting it to run.
0 x
Watch out for my OGRE related tweets here.

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: [GSoC 2012] Complete the DirectX 11 render system

Post by Assaf Raman » Mon Aug 13, 2012 9:15 am

It seems that running on VMWare will not help me with WinRT development - as it doesn't support DirectX 10 or 11.
But - From what I can tell - the code should work.
0 x
Watch out for my OGRE related tweets here.

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: [GSoC 2012] Complete the DirectX 11 render system

Post by Assaf Raman » Mon Aug 13, 2012 9:49 am

Trying the WARP driver.
0 x
Watch out for my OGRE related tweets here.

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: [GSoC 2012] Complete the DirectX 11 render system

Post by Assaf Raman » Mon Aug 13, 2012 10:05 am

Yes, with WARP driver D3D11 works with Win8 WinRT on VMWare.
So - the WinRT part of the project seems to be done as far as I can see it. Don't waste any time on it.

If you can - go over the OGRE samples one by one (not using WinRT - use the normal windows build) and try to make all of them work, leave the BSP sample to be the last - it is less important for us.
0 x
Watch out for my OGRE related tweets here.

User avatar
robert_sasu
Google Summer of Code Student
Google Summer of Code Student
Posts: 238
Joined: Mon Apr 02, 2012 11:07 am

Re: [GSoC 2012] Complete the DirectX 11 render system

Post by robert_sasu » Mon Aug 13, 2012 10:15 am

I have worked with all of the samples: BSP, dual quaternion, isosurf and new instancing are not working. The profile in most of RTSS's shaders supports vs_3_0, but dx11's capabilities contains vs_4_0, vs_4_1, and vs_5_0, so I think this is the problem for these samples.
0 x
Google Summer of Code 2013 Student
Topic: "DirectX 11 & Tessellation samples"
Project links: Project thread, WIKI page, Code fork for the project
Mentor: Assaf Raman

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: [GSoC 2012] Complete the DirectX 11 render system

Post by Assaf Raman » Mon Aug 13, 2012 10:50 am

good, fix it then
0 x
Watch out for my OGRE related tweets here.

User avatar
Eugene
OGRE Team Member
OGRE Team Member
Posts: 182
Joined: Mon Mar 24, 2008 4:54 pm
Location: Odessa, Ukraine

Re: [GSoC 2012] Complete the DirectX 11 render system

Post by Eugene » Mon Aug 13, 2012 12:04 pm

robert_sasu wrote:I have worked with all of the samples: BSP, dual quaternion, isosurf and new instancing are not working. The profile in most of RTSS's shaders supports vs_3_0, but dx11's capabilities contains vs_4_0, vs_4_1, and vs_5_0, so I think this is the problem for these samples.
There is code that compiles shaders designed for profile vs_2_0, vs_2_x, vs_3_0 using first compatible profile - vs_4_0 and compatibility flag to accept legacy syntax. This is how I worked around fact that RTSS shaders were designed for lower unsupported on WinRT profiles. Look at D3D11HLSLProgram::getCompatibleTarget(). So it may be the question of specifying "enable_backward_compatibility" flag in material declarations.
0 x

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: [GSoC 2012] Complete the DirectX 11 render system

Post by Assaf Raman » Mon Aug 13, 2012 12:10 pm

I know it, it doesn't work that good.
BTW: I think that only SM2 is supported on windows 8 arm and on windows phone 8.
I guess I will make the D3D9 SM2 RTSS generator work with it, I think I am work it out, I will use d3d9 interface to reflect the shader parameters and vars.
0 x
Watch out for my OGRE related tweets here.

User avatar
Eugene
OGRE Team Member
OGRE Team Member
Posts: 182
Joined: Mon Mar 24, 2008 4:54 pm
Location: Odessa, Ukraine

Re: [GSoC 2012] Complete the DirectX 11 render system

Post by Eugene » Mon Aug 13, 2012 12:28 pm

Assaf Raman wrote:I know it, it doesn't work that good.
BTW: I think that only SM2 is supported on windows 8 arm and on windows phone 8.
I guess I will make the D3D9 SM2 RTSS generator work with it, I think I am work it out, I will use d3d9 interface to reflect the shader parameters and vars.
No-no-no. I researched this area and here are the results:
1. Support for SM4.0 is mandated on D3D11, but it`s allowed to support it with reduced feature set, like "Shader Model 4 Level 9_3" (/4_0_level_9_3 command line option to fxc.exe). Its the way Windows 8 ARM will go.
2. Drivers from ATI and NVidia support SM2.0 shaders on D3D11 as vendor extension - but it`s not required and Intel`s drivers don`t do this. Shader is successfully compiled as SM2.0 shader but than just don`t work. This is why "getCompatibleTarget()" code was created in the first place.

Therefore shaders must be compiled as SM4.0 (to be runnable on Intel) and may be with "enable_backward_compatibility" flag if SM2.0 syntax was used for them.
0 x

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: [GSoC 2012] Complete the DirectX 11 render system

Post by Assaf Raman » Mon Aug 13, 2012 12:49 pm

Can you use SM5 on your windows 8 in a WinRT application?
0 x
Watch out for my OGRE related tweets here.

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: [GSoC 2012] Complete the DirectX 11 render system

Post by Assaf Raman » Mon Aug 13, 2012 1:05 pm

Can the RTSS work with Feature_Level_9 out of the box?
0 x
Watch out for my OGRE related tweets here.

User avatar
Eugene
OGRE Team Member
OGRE Team Member
Posts: 182
Joined: Mon Mar 24, 2008 4:54 pm
Location: Odessa, Ukraine

Re: [GSoC 2012] Complete the DirectX 11 render system

Post by Eugene » Mon Aug 13, 2012 1:09 pm

Assaf Raman wrote:So - the WinRT part of the project seems to be done as far as I can see it.
There are some bugs reintroduced that were fixed in winrt branch. Diff with WinRT branch to see all of them clearly.

1. In D3D11RenderSystem::_initialize() pSelectedDevice is leaked for mDriverType == DT_SOFTWARE or DT_WARP. It`s AddRef-ed and should be released for those driver types.
2. In D3D11RenderSystem::_clearFrameBuffer() local variable numberOfViews is initialized via getCustomAttribute call but than incremented additionally in the while loop so it would hold doubled value and buffer would be overruned if more than 4 render targets are used.
3. In D3D11Texture::_create2DTex() was bug that decremented numMips variable by two for compressed formats even if autogenerated amount was requested (i.e. zero value used). This leads to (-2) value passed to the texture creation API with immediate crash on debug runtime. This bug was hidden by the fact that most compressed formats were .dds files that were loaded using another code path, D3DX. But on WinRT D3DX is not available, and problem was revealed. I carefully changed mipmap count handling code to simplify it and avoid this problem, and it is here now, but old code snippets were remerged into it so the result is really crazy now. Look at diff to see what needs to be deleted to fix it.
0 x

Post Reply