mirror of https://github.com/xemu-project/xemu.git
nv2a: Use width to calculate swizzled surface pitch
This commit is contained in:
parent
66b57dca9c
commit
d399643d92
|
@ -5741,7 +5741,8 @@ static void pgraph_populate_surface_binding_entry_sized(NV2AState *d,
|
||||||
entry->vram_addr = dma.address + surface->offset;
|
entry->vram_addr = dma.address + surface->offset;
|
||||||
entry->width = width;
|
entry->width = width;
|
||||||
entry->height = height;
|
entry->height = height;
|
||||||
entry->pitch = surface->pitch;
|
entry->pitch = entry->swizzle ? (entry->width * entry->fmt.bytes_per_pixel)
|
||||||
|
: surface->pitch;
|
||||||
entry->size = height * surface->pitch;
|
entry->size = height * surface->pitch;
|
||||||
entry->upload_pending = true;
|
entry->upload_pending = true;
|
||||||
entry->download_pending = false;
|
entry->download_pending = false;
|
||||||
|
@ -5751,6 +5752,8 @@ static void pgraph_populate_surface_binding_entry_sized(NV2AState *d,
|
||||||
entry->frame_time = pg->frame_time;
|
entry->frame_time = pg->frame_time;
|
||||||
entry->draw_time = pg->draw_time;
|
entry->draw_time = pg->draw_time;
|
||||||
entry->cleared = false;
|
entry->cleared = false;
|
||||||
|
|
||||||
|
assert(entry->pitch >= (entry->width * entry->fmt.bytes_per_pixel));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void pgraph_populate_surface_binding_entry(NV2AState *d, bool color,
|
static void pgraph_populate_surface_binding_entry(NV2AState *d, bool color,
|
||||||
|
|
Loading…
Reference in New Issue