I am building an application using SlimDx where I have a collection of graphics cards connected and a lot of SRAM memory. For best performance I want to have complete control of what textures are loaded into each of the graphics cards.
To do that, the plan is to load textures from disk into system memory (SRAM). Then as needed, copy textures from SRAM into VRAM for the graphics cards that will benefit from having the textures in local VRAM.
In theory this sounded perfectly doable with SlimDx. You will load textures from SRAM into VRAM using this method.
public static Texture FromMemory(
Device device,
byte[] memory
)
The method asks for a list of bytes. I am not sure how you will define that list in C#, so this is question #1.
The second and more complicated question is how to load the textures from disk into SRAM. The most applicable method I could find is this one:
public static Texture FromFile(
Device device,
string fileName
)
The problem here is that it asks for a specific device. Obviously I wanted to be able to store textures in SRAM and then later decide which textures I want to send to device 1 and which textures to send to device 2 etc. If I am forced to load all textures into a SRAM memmory slot reserved for each GPU will not only slow down loading significantly, it will also waste SRAM resources as all textures are now represented once for each GPU. On my system I will have many GPU's connected so this will be problematic.
My question #2 is: How can I load textures into SRAM without tying them to a specific device, and thus later allow myself to load them directly into the device using the FromMemory method mentioned above?