Sign in to follow this  

[MDX] PC Crash when I set my index buffer to Integer

This topic is 4381 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

It's weird... if i switch my prog from short to int, my computer freeze.. after it's blackscreen and finally, Reboot by itself or not.. some time i have to reset it myself. Anyone know why? [Edit] I tested with a small code and it crash on the line: device.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 5, 0, 2); I really don't understand...

Share this post


Link to post
Share on other sites
Well, some more code on how you create your index buffers would help us understand your problem better, as the line you posted depends on that code. My guess is that either your Graphics card doesn't support 32bit indices (though I don't know if that is common) or that something is wrong with the indices themselves... I've had the latter happen on me a few times before, with the exact same results.

Either way, more code and/or info on your video card would be useful.

Share this post


Link to post
Share on other sites
Video card on this computer is a Radeon 7000 ... The application need to work on low spec computers...

I think it's the video card..

Quote:

ADEON 7000 SERIES Capabilities:

PixelShaderCaps: NumberInstructionSlots: 0
StaticFlowControlDepth: 0
NumberTemps: 0
DynamicFlowControlDepth: 0
SupportsNoTextureInstructionLimit: False
SupportsNoDependentReadLimit: False
SupportsGradientInstructions: False
SupportsArbitrarySwizzle: False
SupportsPredication: False
MaxDynamicFlowControlDepth: 24
MinDynamicFlowControlDepth: 0
MaxNumberTemps: 32
MinNumberTemps: 12
MaxStaticFlowControlDepth: 4
MinStaticFlowControlDepth: 0
MaxNumberInstructionSlots: 512
MinNumberInstructionSlots: 96

VertexShaderCaps: StaticFlowControlDepth: 0
NumberTemps: 0
DynamicFlowControlDepth: 0
SupportsPredication: False
MaxDynamicFlowControlDepth: 24
MinDynamicFlowControlDepth: 0
MaxNumberTemps: 32
MinNumberTemps: 12
MaxStaticFlowControlDepth: 4
MinStaticFlowControlDepth: 1

MaxPixelShader30InstructionSlots: 0
MaxVertexShader30InstructionSlots: 0
PixelShaderVersion: 0.0
VertexShaderVersion: 1.1
DeclTypes: SupportsFloat16Four: False
SupportsFloat16Two: False
SupportsDec3N: False
SupportsUDec3: False
SupportsUShort4N: False
SupportsUShort2N: False
SupportsShort4N: False
SupportsShort2N: False
SupportsUByte4N: False
SupportsUByte4: True

VertexProcessingCaps: SupportsNoTextureGenerationNonLocalViewer: False
SupportsTextureGenerationSphereMap: False
SupportsTweening: True
SupportsLocalViewer: True
SupportsPositionalLights: True
SupportsDirectionalLights: True
SupportsMaterialSource: True
SupportsTextureGeneration: True

VertexFormatCaps: SupportsPointSize: True
SupportsDoNotStripElements: False
SupportsTextureCoordinateCountMask: True

TextureOperationCaps: SupportsLerp: True
SupportsMultiplyAdd: True
SupportsDotProduct3: True
SupportsBumpEnvironmentMapLuminance: False
SupportsBumpEnvironmentMap: True
SupportsModulateInvColorAddAlpha: True
SupportsModulateInvAlphaAddColor: True
SupportsModulateColorAddAlpha: True
SupportsModulateAlphaAddColor: True
SupportsPreModulate: False
SupportsBlendCurrentAlpha: True
SupportsBlendTextureAlphaPM: True
SupportsBlendFactorAlpha: True
SupportsBlendTextureAlpha: True
SupportsBlendDiffuseAlpha: True
SupportsAddSmooth: True
SupportsSubtract: True
SupportsAddSigned2X: True
SupportsAddSigned: True
SupportsAdd: True
SupportsModulate4X: True
SupportsModulate2X: True
SupportsModulate: True
SupportsSelectArgument2: True
SupportsSelectArgument1: True
SupportsDisable: True

StencilCaps: SupportsTwoSided: False
SupportsDecrement: True
SupportsIncrement: True
SupportsInvert: True
SupportsDecrementSaturation: True
SupportsIncrementSaturation: True
SupportsReplace: True
SupportsZero: True
SupportsKeep: True

VolumeTextureAddressCaps: SupportsMirrorOnce: True
SupportsIndependentUV: True
SupportsBorder: False
SupportsClamp: True
SupportsMirror: True
SupportsWrap: True

TextureAddressCaps: SupportsMirrorOnce: True
SupportsIndependentUV: True
SupportsBorder: False
SupportsClamp: True
SupportsMirror: True
SupportsWrap: True

VolumeTextureFilterCaps: SupportsMinifyGaussianQuad: False
SupportsMinifyPyramidalQuad: False
SupportsMagnifyGaussianQuad: False
SupportsMagnifyPyramidalQuad: False
SupportsMagnifyAnisotropic: False
SupportsMagnifyLinear: True
SupportsMagnifyPoint: True
SupportsMipMapLinear: False
SupportsMipMapPoint: False
SupportsMinifyAnisotropic: False
SupportsMinifyLinear: True
SupportsMinifyPoint: True

CubeTextureFilterCaps: SupportsMinifyGaussianQuad: False
SupportsMinifyPyramidalQuad: False
SupportsMagnifyGaussianQuad: False
SupportsMagnifyPyramidalQuad: False
SupportsMagnifyAnisotropic: False
SupportsMagnifyLinear: True
SupportsMagnifyPoint: True
SupportsMipMapLinear: False
SupportsMipMapPoint: False
SupportsMinifyAnisotropic: False
SupportsMinifyLinear: True
SupportsMinifyPoint: True

TextureFilterCaps: SupportsMinifyGaussianQuad: False
SupportsMinifyPyramidalQuad: False
SupportsMagnifyGaussianQuad: False
SupportsMagnifyPyramidalQuad: False
SupportsMagnifyAnisotropic: False
SupportsMagnifyLinear: True
SupportsMagnifyPoint: True
SupportsMipMapLinear: True
SupportsMipMapPoint: True
SupportsMinifyAnisotropic: True
SupportsMinifyLinear: True
SupportsMinifyPoint: True

VertexTextureFilterCaps: SupportsMinifyGaussianQuad: False
SupportsMinifyPyramidalQuad: False
SupportsMagnifyGaussianQuad: False
SupportsMagnifyPyramidalQuad: False
SupportsMagnifyAnisotropic: False
SupportsMagnifyLinear: False
SupportsMagnifyPoint: False
SupportsMipMapLinear: False
SupportsMipMapPoint: False
SupportsMinifyAnisotropic: False
SupportsMinifyLinear: False
SupportsMinifyPoint: False

StretchRectangleFilterCaps: SupportsMinifyGaussianQuad: False
SupportsMinifyPyramidalQuad: False
SupportsMagnifyGaussianQuad: False
SupportsMagnifyPyramidalQuad: False
SupportsMagnifyAnisotropic: False
SupportsMagnifyLinear: False
SupportsMagnifyPoint: False
SupportsMipMapLinear: False
SupportsMipMapPoint: False
SupportsMinifyAnisotropic: False
SupportsMinifyLinear: False
SupportsMinifyPoint: False

TextureCaps: SupportsNoProjectedBumpEnvironment: False
SupportsVolumeMapPower2: True
SupportsCubeMapPower2: True
SupportsMipCubeMap: False
SupportsMipVolumeMap: False
SupportsMipMap: True
SupportsVolumeMap: True
SupportsCubeMap: True
SupportsProjected: True
SupportsNonPower2Conditional: True
SupportsAlphaPalette: False
SupportsTextureRepeatNotScaledBySize: True
SupportsSquareOnly: False
SupportsAlpha: True
SupportsPower2: True
SupportsPerspective: True

NumberOfAdaptersInGroup: 1
AdapterOrdinalInGroup: 0
MasterAdapterOrdinal: 0
MaxVertexShaderConst: 192
MaxSimultaneousTextures: 3
MaxTextureBlendStages: 8
ShadeCaps: SupportsFogGouraud: True
SupportsAlphaGouraudBlend: True
SupportsSpecularGouraudRgb: True
SupportsColorGouraudRgb: True

LineCaps: SupportsAntiAlias: True
SupportsFog: True
SupportsAlphaCompare: True
SupportsBlend: True
SupportsZBufferTest: True
SupportsTextureMapping: True

NumberSimultaneousRts: 1
PixelShader1xMaxValue: 0
MaxStreamStride: 252
MaxStreams: 12
MaxVertexIndex: 65535
MaxPrimitiveCount: 65535
MaxPointSize: 256
MaxVertexBlendMatrixIndex: 37
MaxVertexBlendMatrices: 4
MaxUserClipPlanes: 6
MaxActiveLights: 8
ExtentsAdjust: 0
GuardBandBottom: 0
GuardBandRight: 0
GuardBandTop: 0
GuardBandLeft: 0
MaxVertexW: 1E+10
MaxAnisotropy: 16
MaxTextureAspectRatio: 2048
MaxTextureRepeat: 2048
MaxVolumeExtent: 256
MaxTextureHeight: 2048
MaxTextureWidth: 2048
DestinationBlendCaps: SupportsBlendFactor: False
SupportsBothInverseSourceAlpha: True
SupportsBothSourceAlpha: True
SupportsSourceAlphaSat: False
SupportsInverseDestinationColor: True
SupportsDestinationColor: True
SupportsInverseDestinationAlpha: True
SupportsDestinationAlpha: True
SupportsInverseSourceAlpha: True
SupportsSourceAlpha: True
SupportsInverseSourceColor: True
SupportsSourceColor: True
SupportsOne: True
SupportsZero: True

SourceBlendCaps: SupportsBlendFactor: False
SupportsBothInverseSourceAlpha: True
SupportsBothSourceAlpha: True
SupportsSourceAlphaSat: True
SupportsInverseDestinationColor: True
SupportsDestinationColor: True
SupportsInverseDestinationAlpha: True
SupportsDestinationAlpha: True
SupportsInverseSourceAlpha: True
SupportsSourceAlpha: True
SupportsInverseSourceColor: True
SupportsSourceColor: True
SupportsOne: True
SupportsZero: True

AlphaCompareCaps: SupportsAlways: True
SupportsGreaterEqual: True
SupportsNotEqual: True
SupportsGreater: True
SupportsLessEqual: True
SupportsEqual: True
SupportsLess: True
SupportsNever: True

ZCompareCaps: SupportsAlways: True
SupportsGreaterEqual: True
SupportsNotEqual: True
SupportsGreater: True
SupportsLessEqual: True
SupportsEqual: True
SupportsLess: True
SupportsNever: True

RasterCaps: SupportsMultisampleToggle: False
SupportsDepthBias: True
SupportsSlopeScaleDepthBias: True
SupportsScissorTest: True
SupportsColorPerspective: False
SupportsZFog: False
SupportsWFog: False
SupportsWBuffer: False
SupportsAnisotropy: True
SupportsFogRange: True
SupportsZBufferLessHsr: False
SupportsMipMapLevelOfDetailBias: True
SupportsFogTable: False
SupportsFogVertex: True
SupportsZBufferTest: True
SupportsDither: True

PrimitiveMiscCaps: HasFogVertexClamped: True
SupportsMultipleRenderTargetsPostPixelShaderBlending: False
SupportsMultipleRenderTargetsIndependentBitDepths: False
SupportsSeparateAlphaBlend: False
SupportsFogAndSpecularAlpha: False
SupportsPerStageConstant: False
SupportsIndependentWriteMasks: False
IsNullReference: False
SupportsBlendOperation: False
SupportsTextureStageStateArgumentTemp: True
SupportsClipTransformedVertices: False
SupportsClipPlaneScaledPoints: False
SupportsColorWrite: True
SupportsCullCounterClockwise: True
SupportsCullClockwise: True
SupportsCullNone: True
SupportsMaskZ: True

DeviceCaps: VertexElementScanSharesStreamOffset: True
CanStretchRectangleFromTextures: True
SupportsAdaptiveTessellateNPatch: False
SupportsAdaptiveTessellateRtPatch: False
SupportsDMapNPatch: False
SupportsStreamOffset: True
SupportsPreSampledDMapNPatch: False
SupportsNPatches: False
SupportsRtPatchHandleZero: False
SupportsRtPatches: False
SupportsQuinticRtPatches: False
SupportsPureDevice: True
SupportsHardwareRasterization: True
CanDrawSystemToNonLocal: True
SupportsHardwareTransformAndLight: True
SupportsDrawPrimitives2Ex: True
SupportsSeparateTextureMemories: False
SupportsDrawPrimitives2: True
SupportsTextureNonLocalVideoMemory: True
CanRenderAfterFlip: True
SupportsDrawPrimitivesTransformedVertex: True
SupportsTextureVideoMemory: True
SupportsTextureSystemMemory: False
SupportsTransformedVertexVideoMemory: True
SupportsTransformedVertexSystemMemory: True
SupportsExecuteVideoMemory: True
SupportsExecuteSystemMemory: True

CursorCaps: SupportsLowResolution: False
SupportsColor: True

PresentationIntervals: -2147483647
DriverCaps: SupportsCopyToSystemMemory: True
SupportsCopyToVideoMemory: True
SupportsLinearToSrgbPresentation: False
SupportsAlphaFullscreenFlipOrDiscard: True
CanAutoGenerateMipMap: True
SupportsDynamicTextures: True
CanManageResource: False
CanCalibrateGamma: False
SupportsFullscreenGamma: True
ReadScanLine: True

AdapterOrdinal: 0
DeviceType: Hardware
MaxNPatchTessellationLevel: 0


My code:


private int[] indices;
private IndexBuffer ib;

private void IndicesDeclaration()
{
ib = new IndexBuffer(typeof(int), 6, device, Usage.WriteOnly, Pool.Default);
indices = new int[6];

indices[0]=3;
indices[1]=1;
indices[2]=0;
indices[3]=4;
indices[4]=2;
indices[5]=1;

ib.SetData(indices, 0, LockFlags.None);
}

protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
{
device.Clear(ClearFlags.Target, Color.DarkSlateBlue , 1.0f, 0);

device.BeginScene();
device.VertexFormat = CustomVertex.PositionColored.Format;
device.SetStreamSource(0, vb, 0);
device.Indices = ib;
//device.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, 5, 0, 2);
device.EndScene();
device.Present();
this.Invalidate();
angle += 0.05f;
}

Share this post


Link to post
Share on other sites
I confirm.. it's the video card!

MaxVertexIndex: 65535
MaxPrimitiveCount: 65535

= 16 bit!!! Damn

Is there a way to see wich video cards support 32 bits ?

Share this post


Link to post
Share on other sites
Quote:
Is there a way to see wich video cards support 32 bits ?


Check out the "Graphics Card Capabilities" sample in the SDK Samplebrowser... Unforunately it got hidden away in the C++ section as a sample, so you'll have to check 'C++' and 'Samples' in the browser to see it. This contains a list of much hardware available today with all the capabilities it has for DirectX.

Share this post


Link to post
Share on other sites
Sign in to follow this