Permalink
Browse files

Debugger: Fix crash in softgpu with no texaddr yet.

  • Loading branch information...
unknownbrackets committed Sep 5, 2018
1 parent 246234b commit 2388be544fa5203525859a1b9a54fd42b34a84a7
Showing with 9 additions and 6 deletions.
  1. +8 −5 GPU/Software/Rasterizer.cpp
  2. +1 −1 ext/native/thin3d/VulkanRenderManager.h
@@ -1764,17 +1764,20 @@ bool GetCurrentTexture(GPUDebugBuffer &buffer, int level)
return false;
}
int w = gstate.getTextureWidth(level);
int h = gstate.getTextureHeight(level);
buffer.Allocate(w, h, GE_FORMAT_8888, false);
GETextureFormat texfmt = gstate.getTextureFormat();
u32 texaddr = gstate.getTextureAddress(level);
int texbufw = GetTextureBufw(level, texaddr, texfmt);
u8 *texptr = Memory::GetPointer(texaddr);
int w = gstate.getTextureWidth(level);
int h = gstate.getTextureHeight(level);
if (!texaddr || !Memory::IsValidRange(texaddr, (textureBitsPerPixel[texfmt] * texbufw * h) / 8))
return false;
buffer.Allocate(w, h, GE_FORMAT_8888, false);
Sampler::Funcs sampler = Sampler::GetFuncs();
u8 *texptr = Memory::GetPointer(texaddr);
u32 *row = (u32 *)buffer.GetData();
for (int y = 0; y < h; ++y) {
for (int x = 0; x < w; ++x) {
@@ -176,7 +176,7 @@ class VulkanRenderManager {
data.draw.vbuffer = vbuffer;
data.draw.voffset = voffset;
data.draw.numUboOffsets = numUboOffsets;
assert(numUboOffsets <= ARRAY_SIZE(data.drawIndexed.uboOffsets));
assert(numUboOffsets <= ARRAY_SIZE(data.draw.uboOffsets));
for (int i = 0; i < numUboOffsets; i++)
data.draw.uboOffsets[i] = uboOffsets[i];
curRenderStep_->commands.push_back(data);

0 comments on commit 2388be5

Please sign in to comment.