Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/fast/interpreter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1153,9 +1153,11 @@ void Interpreter::ImportTextureRaw(int tile, bool importReplacement) {
memset(mTexUploadBuffer + resourceImageSizeBytes, 0, numLoadedBytes - resourceImageSizeBytes);
}

// Describe the buffer by what was actually packed (the loaded HD stride)
uint32_t uploadWidth = safeLineSizeBytes / 4;
uint32_t uploadHeight = safeLineSizeBytes > 0 ? safeLoadedBytes / safeLineSizeBytes : 0;
// Describe the buffer by the per-line HD stride. loaded_texture.line_size_bytes spans the
// whole image for block loads, which would collapse the upload to an Nx1 strip and corrupt
// the texture; resultNewLineSize is the true per-row stride for both block and tile loads.
uint32_t uploadWidth = resultNewLineSize / 4;
uint32_t uploadHeight = resultNewLineSize > 0 ? safeLoadedBytes / resultNewLineSize : 0;
mRapi->UploadTexture(mTexUploadBuffer, uploadWidth, uploadHeight);
}

Expand Down