Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When trying to create a texture, my call to D3DX11CreateShaderResourceViewFromFile keeps returning E_FAIL. To me that's about as generic as it gets, and I can't figure the problem out. The code looks like this:

//Create the texture
result = D3DX11CreateShaderResourceViewFromFile(device, textureFile, NULL, NULL, &m_baseTexture, NULL);
    gGlobalData->GetConsole()->PrintWarningWithName(textureFile, TEXT("Failed to create texture from file"));
    return false;

textureFile has the correct path, and m_baseTexture is NULL. The documentation says that when E_FAIL is returned, it means that the debug layer is enabled but not installed. I do have the debug layer on, but when I set it to "Forced Off" in the control panel I get the same error. So what's the problem?

share|improve this question

closed as off-topic by Josh Petrie Apr 7 '14 at 16:16

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about debugging a problem in your project must present a concise selection of code and context so as to allow a reader to diagnose the issue without needing to read all of your code or to engage in extensive back-and-forth dialog. For more information, see this meta thread." – Josh Petrie
If this question can be reworded to fit the rules in the help center, please edit the question.

did you create your device using these device flags D3D11_CREATE_DEVICE_DEBUG | D3D11_RLDO_DETAIL ? – dotminic Mar 13 '12 at 8:55
@dotminic Yes, I did – smoth190 Mar 13 '12 at 18:48