gpt4 book ai didi

c# - WPF 应用程序和 DirectX 光栅化器中的访问冲突异常

转载 作者:行者123 更新时间:2023-12-03 17:20:28 31 4
gpt4 key购买 nike

我有一个 WPF 应用程序,经过一些琐碎的操作(打开和关闭某些应用程序控件)后崩溃了。当我打开故障转储文件时,我看到异常是

FAULTING_IP: 
rgb9rast!D3D8RGBRast::CRGBContext::PackGenVertex+b4
000007fe`f7625b88 428b0c10 mov ecx,dword ptr [rax+r10]

EXCEPTION_RECORD: ffffffffffffffff -- (.exr 0xffffffffffffffff)
ExceptionAddress: 000007fef7625b88 (rgb9rast!D3D8RGBRast::CRGBContext::PackGenVertex+0x00000000000000b4)
ExceptionCode: c0000005 (Access violation)
ExceptionFlags: 00000000
NumberParameters: 2
Parameter[0]: 0000000000000000
Parameter[1]: 000000009f011620
Attempt to read from address 000000009f011620

这表明 Directx 光栅化中的访问冲突错误和错误的线程堆栈跟踪是(我省略了调用地址)
rgb9rast!D3D8RGBRast::CRGBContext::PackGenVertex+0xb4
rgb9rast!D3D8RGBRast::CRGBContext::DoDrawOneGenIndexedPrimitive+0x72b
rgb9rast!D3D8RGBRast::CRGBContext::DP2DrawIndexedPrimitive2+0x1d4
rgb9rast!DX8SDDIFW::SDP2MFnParser::ParseDP2<DX8SDDIFW::CStdDrawPrimitives2<D3D8RGBRast::CRGBContext,D3D8RGBRast::CRGBStateSet,D3D8RGBRast::static_hash_map<unsigned long,D3D8RGBRast::CRGBStateSet,32,D3D8RGBRast::hash<unsigned long>,std::equal_to<unsigned long>,D3D8RGBRast::allocator<std::pair<unsigned long const ,D3D8RGBRast::CRGBStateSet> > >,DX8SDDIFW::CDP2DataWrap<D3D8RGBRast::SDP2NextCmdExt>,D3D8RGBRast::block<long (__cdecl D3D8RGBRast::CRGBContext::*)(DX8SDDIFW::CDP2DataWrap<D3D8RGBRast::SDP2NextCmdExt> & __ptr64,_D3DHAL_DP2COMMAND const * __ptr64,void const * __ptr64) __ptr64,89>,D3D8RGBRast::block<long (__cdecl D3D8RGBRast::CRGBContext::*)(_D3DHAL_DP2COMMAND const * __ptr64,void * __ptr64) __ptr64,89> >::TMFnCaller,D3D8RGBRast::block<long (__cdecl D3D8RGBRast::CRGBContext::*)(DX8SDDIFW::CDP2DataWrap<D3D8RGBRast::SDP2NextCmdExt> & __ptr64,_D3DHAL_DP2COMMAND const * __ptr64,void const * __ptr64) __ptr64,89>,DX8SDDIFW::CConstDP2CmdIterator<D3D8RGBRast::SDP2NextCmdExt> >+0x69
rgb9rast!DX8SDDIFW::CStdDrawPrimitives2<D3D8RGBRast::CRGBContext,D3D8RGBRast::CRGBStateSet,D3D8RGBRast::static_hash_map<unsigned long,D3D8RGBRast::CRGBStateSet,32,D3D8RGBRast::hash<unsigned long>,std::equal_to<unsigned long>,D3D8RGBRast::allocator<std::pair<unsigned long const ,D3D8RGBRast::CRGBStateSet> > >,DX8SDDIFW::CDP2DataWrap<D3D8RGBRast::SDP2NextCmdExt>,D3D8RGBRast::block<long (__cdecl D3D8RGBRast::CRGBContext::*)(DX8SDDIFW::CDP2DataWrap<D3D8RGBRast::SDP2NextCmdExt> & __ptr64,_D3DHAL_DP2COMMAND const * __ptr64,void const * __ptr64) __ptr64,89>,D3D8RGBRast::block<long (__cdecl D3D8RGBRast::CRGBContext::*)(_D3DHAL_DP2COMMAND const * __ptr64,void * __ptr64) __ptr64,89> >::DrawPrimitives2+0x345
rgb9rast!DX8SDDIFW::CSubDriver<D3D8RGBRast::CRGBDriver,D3D8RGBRast::CRGBContext,D3D8RGBRast::CRGBSurfAllocator,D3D8RGBRast::CRGBPerDDrawData,D3D8RGBRast::set<D3D8RGBRast::CRGBContext * __ptr64,std::less<D3D8RGBRast::CRGBContext * __ptr64>,D3D8RGBRast::allocator<D3D8RGBRast::CRGBContext * __ptr64> >,D3D8RGBRast::map<_DDRAWI_DIRECTDRAW_LCL * __ptr64,D3D8RGBRast::CRGBPerDDrawData,std::less<_DDRAWI_DIRECTDRAW_LCL * __ptr64>,D3D8RGBRast::allocator<std::pair<_DDRAWI_DIRECTDRAW_LCL * __ptr64 const,D3D8RGBRast::CRGBPerDDrawData> > >,D3D8RGBRast::set<D3D8RGBRast::IRGBSurface * __ptr64,std::less<D3D8RGBRast::IRGBSurface * __ptr64>,D3D8RGBRast::allocator<D3D8RGBRast::IRGBSurface * __ptr64> >,DX8SDDIFW::SFakeEntryPointHook<D3D8RGBRast::CRGBDriver> >::DrawPrimitives2+0x26
d3d9!SwDrawPrimitives2+0x7c
d3d9!CD3DDDIDX8::FlushStates+0x161
d3d9!CD3DBase::FlushStatesNoThrow+0x22
d3d9!CVertexBuffer::Lock+0xce
d3d9!CVertexBufferMT::Lock+0x7e
d3d9!CTLStream::Lock+0x6d
d3d9!CD3DDDIDX8::StartPrimTL+0x3b
d3d9!CD3DDDIDX8::ProcessIndexedPrimitiveC+0xa0
d3d9!CD3DBase::DrawIndexedPrimitive+0x489
wpfgfx_v0400!CD3DDeviceLevel1::DrawIndexedTriangleList+0x49
wpfgfx_v0400!CHw3DGeometryRenderer<unsigned long>::Render+0x152
wpfgfx_v0400!CHwShader::FixedFunctionDrawMesh3D+0x158
wpfgfx_v0400!CHwShader::DrawMesh3D+0x88
wpfgfx_v0400!CHwSurfaceRenderTarget::DrawMesh3D+0x1fb
wpfgfx_v0400!CHw3DSoftwareSurface::DrawMesh3D+0x38
wpfgfx_v0400!CSwRenderTargetSurface::DrawMesh3D+0x49
wpfgfx_v0400!CMetaRenderTarget::DrawMesh3D+0xee
wpfgfx_v0400!CModelRenderWalker::RealizeMaterialAndRender+0x17a
wpfgfx_v0400!CModelRenderWalker::ProcessMaterialAndRender+0x160
wpfgfx_v0400!CModelRenderWalker::RenderGeometryModel3D+0x11b
wpfgfx_v0400!CModelRenderWalker::PreSubgraph+0x19
wpfgfx_v0400!CModelIterator::Walk+0x64
wpfgfx_v0400!CModelRenderWalker::RenderModels+0x70
wpfgfx_v0400!CRender3DContext::PreSubgraph+0xd3
wpfgfx_v0400!CGraphIterator::Walk+0x4b
wpfgfx_v0400!CRender3DContext::Render+0xd9
wpfgfx_v0400!CDrawingContext::Render3D+0x277
wpfgfx_v0400!CMilViewport3DVisual::RenderContent+0x50
wpfgfx_v0400!CDrawingContext::PreSubgraph+0x766
wpfgfx_v0400!CGraphIterator::Walk+0x4b
wpfgfx_v0400!CDrawingContext::DrawVisualTree+0x23d
wpfgfx_v0400!CDrawingContext::Render+0x393
wpfgfx_v0400!CSlaveHWndRenderTarget::Render+0x206
wpfgfx_v0400!CRenderTargetManager::Render+0x4d
wpfgfx_v0400!CComposition::Render+0x28
wpfgfx_v0400!CComposition::ProcessComposition+0x13a
wpfgfx_v0400!CComposition::Compose+0x51
wpfgfx_v0400!CPartitionThread::RenderPartition+0x28
wpfgfx_v0400!CPartitionThread::Run+0x61
wpfgfx_v0400!CPartitionThread::ThreadMain+0x1c
kernel32!BaseThreadInitThunk+0xd
ntdll!RtlUserThreadStart+0x1d

这仅发生在我检查应用程序的某些 PC 上。都有 .Net 4.5 和 Directx 11。这是什么原因?在调试/调查转储文件时,我看不到任何可能导致该问题的托管代码。唯一的提示是我在应用程序中有一些 3D 内容,这可能与应用程序中的某些 3D 渲染方法有关错误的线程堆栈跟踪。

最佳答案

DirectX Rasterize(如果我没记错的话是 9 及以上)确定三角形的绘制方式。给定三角形的三个点 - 您可以顺时针或逆时针绘制它们,也可以确定三角形的表面是朝内还是朝外 - 这提供了交点。
它还提供设置 Multisample 和 AntialiasedLine 的功能——这些功能(高处理)允许渲染更平滑的线条。请记住,直线在 2D 屏幕中并不真正存在 - 您可能熟悉计算机图形或锯齿中的楼梯效果。
现在当我们使用 DirectX 时,我们实际上是在对计算机图形卡的 GPU 进行编程。因此显卡必须支持 DirectX - 当然取决于版本。
检查您的电脑硬件并确定 onbard 或 PCI 显卡是否符合 DirectX11。
您也可以调整您的 WPF 应用程序渲染设置 - 如果您愿意,可以将其调低或将其全部关闭 here
更多信息:
来自 MSDN documentation :
备注 ProcessRenderMode 指定首选项,不一定更改实际渲染模式。系统的其他部分可能会覆盖此首选项并强制系统进入软件渲染。
您可以通过在窗口搜索框中使用 dxdiag 来检查系统 DirectX 信息(我认为是 Window 7 及更高版本)。

关于c# - WPF 应用程序和 DirectX 光栅化器中的访问冲突异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24868065/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com