This question pertains specifically to using NVidia Cg with DX11.
I'm trying to write a simple terrain tesselation shader that tesselates a quad patch and applies a heightmap in the domain shader for vertex displacent. I'm passing in the heightmap as a 2D texture and using the following line to sample the texture.
pos.z = tex2D(heightmapTexture, texUV).r;
But this doesn't compile and I get the following error.
error C1115: unable to find compatible overloaded function "Sample(sampler2D, float2)"
Is this the correct syntax for sampling a texture in the domain shader, or is this not currently supported?
I've been trying to understand how a graphics card can use up system RAM and after reading up various resources online, I've come to understand that this can happen in the following 2 ways. I'm a little fuzzy after all the reading, and I wanted to make sure that I understand this correctly. Also, please let me know if I missed anything.
1) If you have a 32bit OS and have 4GB of system RAM installed, you will not be able to use all of the 4GB. Instead you can only address 4GB minus the amount of VRAM in your graphics card. This is because in a 32bit OS, you can address a maximum of 4GB (2^32 bytes) of memory. Since, the addresses of the local VRAM memory on graphics cards are memory mapped, they need to be within this 4GB limit. So, if a graphics card has 1GB of memory, we will only be able to use 3GB of system RAM even if we have 4GB installed. If the amount of RAM is less that 4GB, then this is not a problem because the VRAM will be mapped to the upper range of the 4GB limit which is not addressed by the system RAM. Also, this is not a problem for a 64bit OS since, the amount of addressable memory is not limited to 4GB (it can be 2^64 bytes theoretically).
The graphics card is not actually 'using' the system RAM in this case, but in fact we're losing usable RAM because of address space limitations.
2) If render resources are put into the D3D managed pool, they they are basically duplicated in memory, i.e. they exist both in VRAM and a portion of the system RAM mapped by the graphics card for its own use called AGP memory. However, this is not the case if we use the default pool.
In this case, the graphics card can use up system RAM regardless of the OS type. If however, we have a 32 bit OS with 4GB of RAM and are using the managed pool for our resources, then we have to take a double hit for the system memory.
These are the two ways that a graphics card can 'eat into' system RAM. Please correct me if I'm wrong. Also, in the second case, how large a chunk is used for the AGP memory. Is it as large as the VRAM? Thanks is advance.