6757527: D3D: serious rendering issues on Nvidia boards with driver version 178.13 on Vista
Reviewed-by: campbell
This commit is contained in:
parent
e7b4bb5f00
commit
72f1136161
@ -221,12 +221,17 @@ D3DBL_CopyImageToIntXrgbSurface(SurfaceDataRasInfo *pSrcInfo,
|
||||
" srctype=%d rect={%-4d, %-4d, %-4d, %-4d}",
|
||||
srctype, r.left, r.top, r.right, r.bottom);
|
||||
|
||||
if (pDesc->Usage == D3DUSAGE_DYNAMIC &&
|
||||
dstx == 0 && dstx == 0 &&
|
||||
srcWidth == pDesc->Width && srcHeight == pDesc->Height)
|
||||
{
|
||||
if (pDesc->Usage == D3DUSAGE_DYNAMIC) {
|
||||
// it is safe to lock with discard because we don't care about the
|
||||
// contents of dynamic textures, and some drivers are happier if
|
||||
// dynamic textures are always locked with DISCARD
|
||||
dwLockFlags |= D3DLOCK_DISCARD;
|
||||
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);
|
||||
@ -243,7 +248,9 @@ D3DBL_CopyImageToIntXrgbSurface(SurfaceDataRasInfo *pSrcInfo,
|
||||
void *pSrcBase = PtrCoord(pSrcInfo->rasBase,
|
||||
srcx, pSrcInfo->pixelStride,
|
||||
srcy, pSrcInfo->scanStride);
|
||||
void *pDstBase = lockedRect.pBits;
|
||||
void *pDstBase = PtrCoord(lockedRect.pBits,
|
||||
dstx, dstInfo.pixelStride,
|
||||
dsty, dstInfo.scanStride);
|
||||
|
||||
switch (srctype) {
|
||||
case ST_INT_ARGB:
|
||||
|
@ -1174,11 +1174,10 @@ D3DContext::UploadTileToTexture(D3DResource *pTextureRes, void *pixels,
|
||||
" rect={%-4d, %-4d, %-4d, %-4d}",
|
||||
r.left, r.top, r.right, r.bottom);
|
||||
|
||||
// REMIND: we should also check for dstx, dsty being 0 here,
|
||||
// but they're always 0 in dynamic texture case
|
||||
if (pDesc->Usage == D3DUSAGE_DYNAMIC &&
|
||||
srcWidth == pDesc->Width && srcHeight == pDesc->Height)
|
||||
{
|
||||
if (pDesc->Usage == D3DUSAGE_DYNAMIC) {
|
||||
// it is safe to lock with discard because we don't care about the
|
||||
// contents of dynamic textures and dstx,dsty for this case is
|
||||
// always 0,0 because we are uploading into a tile texture
|
||||
dwLockFlags |= D3DLOCK_DISCARD;
|
||||
pR = NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user