ResourceProxy clarification

Nov 19, 2012 at 11:22 PM

Hi,I have one more question on the engine,it's about the ResourceProxyDX11.Is it basically like an "every-type-of-resource-container"?Could you clarify it a bit if it's not much trouble? :D

Nov 21, 2012 at 2:56 AM

You are more or less correct.  The resource proxy is intended to be able to represent any resource, and any of the resource views that are associated with the resource.  Early on in the development of the D3D11 renderer, I found myself writing many routines that were more or less the exact same for each type of view.  In addition, I wanted to have a way to reference the engine object that represented the resource too in case I had to access some description of the resource.

In the end, it worked out much better than I had planned.  The concept of the resource proxy fits better into what we consider a resource - not so much about the details of what type of resource, or what type of UAV/SRV/RTV it is being used with, but more that if we render into a texture (via RTV) and then want to use the results in a shader program (via SRV) then we should be able to refer to the resource with a single 'identifier' - which is the resource proxy.

Do you think the idea is a good one, or is there something you would like to see changed about it?  I'm always interested in other opinions, since my view of the design is a bit biased :P  Thanks for the question!

Nov 23, 2012 at 12:50 AM
Edited Nov 23, 2012 at 1:48 AM

if it only holds one resource,maybe instead of pointers to all possible Config containers,you can have a union of pointers and track which one is the current active type.If it's not too much trouble,another suggestion would be to probably add an entry in the documentation about the resource management system or maybe just list the steps of the 20-30 steps that happen in the engine's modules for each render,so the user can get an idea of how data flows in this framework,I really like the resource proxy idea,but at first I was a bit confused how all the resources are handled with integers(most beginners like me are probably used to just using direct pointers for resource references).

EDIT:I was just wondering - is getting resource references by strings ok to be used a lot,or are string comparisons too slow for massive usage?

Nov 24, 2012 at 3:35 PM

It is certainly possible to create a union of each of the resource types within the resource proxy...  In fact, the current system uses the resource class itself to determine what type of resource the proxy is representing, so it wouldn't be too much work to make that happen.  I'll take a look at the code base and see if there is any reason not to do that.  Thanks for the suggestion!

I could also write out a description of the rendering process.  The rendering process is fairly stable, so I should be able to get it written and then just do a small amount of maintenance periodically when something changes.  This might take a little time, but I'll try to get it at least started in the coming holiday season.

Getting resources based on strings is less optimal than by ID's in general, although the gap is dependent on what container you are using.  Is this something you saw from the Hieroglyph examples?  I think most if not all of them get a parameter reference by string, then just use the direct reference pointer when setting or getting a parameter...  Let me know if you see something different than that!

Nov 25, 2012 at 5:01 AM
Edited Dec 12, 2012 at 6:47 PM

For the rendering process thing you could probably use a flowgraph for an illustration,altho I haven't found a generator that works under VS 2012 yet.

EDIT:lol I apologize,I just now saw the compressed html file,the documentation and the illustrations are perfect,thanks