Skip to content

Commit

Permalink
Vulkan: Force align verts to 4 on Apple devices.
Browse files Browse the repository at this point in the history
  • Loading branch information
unknownbrackets committed Jan 18, 2023
1 parent 40abcdb commit 8d4007c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion GPU/Common/VertexDecoderCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1254,7 +1254,7 @@ void VertexDecoder::SetVertexType(u32 fmt, const VertexDecoderOptions &options,
decOff += DecFmtSize(decFmt.posfmt);
}

decFmt.stride = decOff;
decFmt.stride = options.alignOutputToWord ? align(decOff, 4) : decOff;

decFmt.ComputeID();

Expand Down
1 change: 1 addition & 0 deletions GPU/Common/VertexDecoderCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ struct VertexDecoderOptions {
bool expandAllWeightsToFloat;
bool expand8BitNormalsToFloat;
bool applySkinInDecode;
bool alignOutputToWord;
};

class VertexDecoder {
Expand Down
1 change: 1 addition & 0 deletions GPU/Vulkan/DrawEngineVulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ DrawEngineVulkan::DrawEngineVulkan(Draw::DrawContext *draw)
: draw_(draw), vai_(1024) {
decOptions_.expandAllWeightsToFloat = false;
decOptions_.expand8BitNormalsToFloat = false;
decOptions_.alignOutputToWord = draw->GetDeviceCaps().vendor == Draw::GPUVendor::VENDOR_APPLE;

// Allocate nicely aligned memory. Maybe graphics drivers will appreciate it.
// All this is a LOT of memory, need to see if we can cut down somehow.
Expand Down

0 comments on commit 8d4007c

Please sign in to comment.