13 hours ago, matt77hias said:
If you want to create a shader resource view (SRV) for your complete Texture2D and your Texture2D is not typeless, just pass a nullptr for the pointer to the D3D11_SHADER_RESOURCE_VIEW_DESC. So you basically pass a pointer to your Texture2D and an address for your SRV.
I think we ended up talking about 2 different things. To me that looks like what I need to do to create a shader resource view
I thought when you said
On 10/25/2017 at 2:08 PM, matt77hias said:
You need one view at least to bind and thus use a texture in the pipeline.
I was under the impression I could do something like
//Loads the textures and returns a ID3D11Texture2D
ID3D11Texture2D* textureTruck = loadTexture("truck.png");
ID3D11Texture2D* textureBoat = loadTexture("boat.png");
//Create the shader resource view
graphicsDevice->device->CreateShaderResourceView(textureTruck, NULL, &shaderResourceView);
//Later on when I want to use a texture (Don't think this is possible. Totally made up)
graphicsDevice->device->ShaderResourceViewSetTexture(shaderResourceView, textureTruck); //Use the truck texture
//Later on switch to the boat and bind the shader view to use that texture
graphicsDevice->device->ShaderResourceViewSetTexture(shaderResourceView, textureBoat);
But like @MJP stated it looks like the above is not possible and its a 1:1 relationship between a shader resource view and a texture