Vulkan: Force align verts to 4 on Apple devices.

This commit is contained in:
Unknown W. Brackets 2023-01-18 07:24:18 -08:00
parent 40abcdb689
commit 8d4007ce3f
3 changed files with 3 additions and 1 deletions

View File

@ -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();

View File

@ -324,6 +324,7 @@ struct VertexDecoderOptions {
bool expandAllWeightsToFloat;
bool expand8BitNormalsToFloat;
bool applySkinInDecode;
bool alignOutputToWord;
};
class VertexDecoder {

View File

@ -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.