提交 766276c8 编写于 作者: T tdv

6757527: D3D: serious rendering issues on Nvidia boards with driver version 178.13 on Vista

Reviewed-by: campbell
上级 f74ef5e2
...@@ -221,12 +221,17 @@ D3DBL_CopyImageToIntXrgbSurface(SurfaceDataRasInfo *pSrcInfo, ...@@ -221,12 +221,17 @@ D3DBL_CopyImageToIntXrgbSurface(SurfaceDataRasInfo *pSrcInfo,
" srctype=%d rect={%-4d, %-4d, %-4d, %-4d}", " srctype=%d rect={%-4d, %-4d, %-4d, %-4d}",
srctype, r.left, r.top, r.right, r.bottom); srctype, r.left, r.top, r.right, r.bottom);
if (pDesc->Usage == D3DUSAGE_DYNAMIC && if (pDesc->Usage == D3DUSAGE_DYNAMIC) {
dstx == 0 && dstx == 0 && // it is safe to lock with discard because we don't care about the
srcWidth == pDesc->Width && srcHeight == pDesc->Height) // contents of dynamic textures, and some drivers are happier if
{ // dynamic textures are always locked with DISCARD
dwLockFlags |= D3DLOCK_DISCARD; dwLockFlags |= D3DLOCK_DISCARD;
pR = NULL; pR = NULL;
} else {
// in non-DYNAMIC case we lock the exact rect so there's no need to
// offset the destination pointer
dstx = 0;
dsty = 0;
} }
res = pDstSurface->LockRect(&lockedRect, pR, dwLockFlags); res = pDstSurface->LockRect(&lockedRect, pR, dwLockFlags);
...@@ -243,7 +248,9 @@ D3DBL_CopyImageToIntXrgbSurface(SurfaceDataRasInfo *pSrcInfo, ...@@ -243,7 +248,9 @@ D3DBL_CopyImageToIntXrgbSurface(SurfaceDataRasInfo *pSrcInfo,
void *pSrcBase = PtrCoord(pSrcInfo->rasBase, void *pSrcBase = PtrCoord(pSrcInfo->rasBase,
srcx, pSrcInfo->pixelStride, srcx, pSrcInfo->pixelStride,
srcy, pSrcInfo->scanStride); srcy, pSrcInfo->scanStride);
void *pDstBase = lockedRect.pBits; void *pDstBase = PtrCoord(lockedRect.pBits,
dstx, dstInfo.pixelStride,
dsty, dstInfo.scanStride);
switch (srctype) { switch (srctype) {
case ST_INT_ARGB: case ST_INT_ARGB:
......
...@@ -1174,11 +1174,10 @@ D3DContext::UploadTileToTexture(D3DResource *pTextureRes, void *pixels, ...@@ -1174,11 +1174,10 @@ D3DContext::UploadTileToTexture(D3DResource *pTextureRes, void *pixels,
" rect={%-4d, %-4d, %-4d, %-4d}", " rect={%-4d, %-4d, %-4d, %-4d}",
r.left, r.top, r.right, r.bottom); r.left, r.top, r.right, r.bottom);
// REMIND: we should also check for dstx, dsty being 0 here, if (pDesc->Usage == D3DUSAGE_DYNAMIC) {
// but they're always 0 in dynamic texture case // it is safe to lock with discard because we don't care about the
if (pDesc->Usage == D3DUSAGE_DYNAMIC && // contents of dynamic textures and dstx,dsty for this case is
srcWidth == pDesc->Width && srcHeight == pDesc->Height) // always 0,0 because we are uploading into a tile texture
{
dwLockFlags |= D3DLOCK_DISCARD; dwLockFlags |= D3DLOCK_DISCARD;
pR = NULL; pR = NULL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册