I have an application that uses HLMS and when I try to run it in debug mode I'm getting the following error:
Code: Select all
System.Exception: 'Unmanaged exception:
OGRE EXCEPTION(3:RenderingAPIException): D3D11 device cannot Clear State
Error Description:ID3D11DeviceContext::DrawIndexedInstanced: The Shader Resource View dimension declared in the shader code (TEXTURE2D) is not an array type but the view bound to slot 4 of the Pixel Shader unit has ArraySize 10. This mismatch is invalid if the shader actually uses the view (e.g. it is not skipped due to shader code branching).I have done some tests and it seems to be related to the resolution of my texture on the material. I'm getting this error when the texture is exactly 1024px x 1024px, and it seems to work fine on other resolutions.
Has anyone else experienced this?
This is my material json settings file :
Code: Select all
{
"samplers" :
{
"sampler0" :
{
"min" : "linear",
"mag" : "linear",
"mip" : "linear",
"u" : "wrap",
"v" : "wrap",
"w" : "wrap",
"miplodbias" : 0.0,
"max_anisotropic" : 1.0,
"compare_function" : "disabled",
"min_lod" : -1e+07,
"max_lod" : 1e+07
}
},
"macroblocks" :
{
"macroblock0" :
{
"scissor_test" : false,
"depth_check" : true,
"depth_write" : true,
"depth_function" : "less_equal",
"depth_bias_constant" : 0,
"depth_bias_slope_scale" : 0,
"cull_mode" : "clockwise",
"polygon_mode" : "solid"
}
},
"blendblocks" :
{
"blendblock0" :
{
"alpha_to_coverage" : false,
"blendmask" : "rgba",
"separate_blend" : false,
"src_blend_factor" : "one",
"dst_blend_factor" : "one_minus_src_alpha",
"blend_operation" : "add"
}
},
"pbs" :
{
"testMaterial" :
{
"macroblock" : "macroblock0",
"blendblock" : "blendblock0",
"shadow_const_bias" : 0.01,
"workflow" :"metallic",
"diffuse" :
{
"value" : [0.886275, 0.564706, 0.0],
"uv" : 0,
"texture" : "texture.jpg",
"sampler" : "sampler0"
},
"roughness" :
{
"value" : 0.6
},
"metalness" :
{
"value" : 0.1
}
}
}
}