I just upgraded my app to a WP8.1 Universal App ( I can't test with a 8.0 app anymore ), I've got the latest update for my Lumia 520 and it seems there's a rather weird error only when running in release mode !
Any call to ID3D11Device->CreateRasterizerState returns E_OUTOFMEMORY
This is a sample description, just in case, first a wireframe RS :
FillMode D3D11_FILL_WIREFRAME (2) D3D11_FILL_MODE
CullMode D3D11_CULL_NONE (1) D3D11_CULL_MODE
FrontCounterClockwise 1 int
DepthBias 0 int
DepthBiasClamp 0.000000000 float
SlopeScaledDepthBias 2.00000000 float
DepthClipEnable 0 int
ScissorEnable 0 int
MultisampleEnable 0 int
AntialiasedLineEnable 0 int
then if I don't create that, it fails in a scissor rect RS :
FillMode D3D11_FILL_SOLID (3) D3D11_FILL_MODE
CullMode D3D11_CULL_NONE (1) D3D11_CULL_MODE
FrontCounterClockwise 1 int
DepthBias 0 int
DepthBiasClamp 0.000000000 float
SlopeScaledDepthBias 2.00000000 float
DepthClipEnable 0 int
ScissorEnable 1 int
MultisampleEnable 1 int
AntialiasedLineEnable 0 int
After which all subsequent operations (loading shaders and textures) perform properly.
In Debug Mode, everything runs ok. My issue with this is that my scissor rects don't appear properly in release mode. Here's the test Appx : https://drive.google.com/file/d/0BwDjq7lQ5oRBbE9ndkwwelp4YU0/view?usp=sh...
My second issue with this GPU is that creating multisampled textures and using them as render targets results in a crash at the next DXGIDevice->Present call. I will admit I'm using 2 render targets, one with a RGBA8 Samples=4 and the other is R32F Samples = 1. I know all the samples from all render targets should be equal but since the Adreno 305 doesn't support Samples >1 on R32F (where I'm trying to output depth) the draw call should either fail or pretend that all samples =1, definetely not crash. For your reference this is the debug message I get from trying to create a R32F Samples =4 texture :
D3D11 ERROR: ID3D11Device::CreateTexture2D: The Sample descriptor is invalid for a D3D10.0 level driver. DXGI_SAMPLE_DESC::Count (value = 4) must be between 1 and 32, inclusively. For 4 samples, the current graphics implementation only supports DXGI_SAMPLE_DESC::Quality (value = 0) less than 0. <-- if 0 is shown here for Quality, this means the graphics implementation doesn't support this number of samples. Use CheckMultisampleQualityLevels to detect what the graphics implementation supports. [ STATE_CREATION ERROR #93: CREATETEXTURE2D_INVALIDSAMPLES]
It's really curious that it says it's a D3D10.0 Level driver. Is there any way to access the 10_0 feature set since CreateDevice returns just 9_3 ?
..a few comments
1) For the rasterizer state, DepthClipEnable should be true for 9.x devices.
2) Can you provide a code snippet for your CreateDevice call?
3) It looks like the runtime is warning you about invalid API use which should be fixed. Otherwise, behavior is "undefined", including crashes.
4) We understand the message about the 10_0 driver, but 10.0 can not be supported on an Adreno 3x device.
Thanks for the reply. So it turns out that not even the run-time checks if DepthClipEnable is 0 or 1 because it was pretty much a random value and the Qualcomm driver didn't recognize it and refused to create the RasterizerState. Still though, it should've thrown E_INVALIDARG instead of E_OUTOFMEMORY so I know there's something wrong with the parameters.
Device creation code :
UINT DeviceFlags = 0;
#ifdef _DEBUG
DeviceFlags |= D3D11_CREATE_DEVICE_DEBUG;
#endif
int Offset = 0;
D3D_FEATURE_LEVEL AllFeatureLevels[] =
{
D3D_FEATURE_LEVEL_11_1,
D3D_FEATURE_LEVEL_11_0,
D3D_FEATURE_LEVEL_10_1,
D3D_FEATURE_LEVEL_10_0,
D3D_FEATURE_LEVEL_9_3,
D3D_FEATURE_LEVEL_9_2,
D3D_FEATURE_LEVEL_9_1,
};
int MaxFeatureLevels = sizeof(AllFeatureLevels) / sizeof(D3D_FEATURE_LEVEL_9_1);
DeviceFlags |= D3D11_CREATE_DEVICE_BGRA_SUPPORT;
Result = D3D11CreateDevice( nullptr, // Specify nullptr to use the default adapter.
D3D_DRIVER_TYPE_HARDWARE,
nullptr,
DeviceFlags, // Set set debug and Direct2D compatibility flags.
AllFeatureLevels, MaxFeatureLevels,
D3D11_SDK_VERSION, // Always set this to D3D11_SDK_VERSION for Windows Store apps.
&Device, // Returns the Direct3D device created.
&FeatureSet, // Returns feature level of device created.
&Context // Returns the device immediate context.
);