renderer_vulkan: Fix pipeline cache crashes
This commit is contained in:
@ -534,12 +534,13 @@ void PipelineCache::LoadDiskCache() {
|
||||
instance.GetVendorID(), instance.GetDeviceID());
|
||||
vk::PipelineCacheCreateInfo cache_info = {.initialDataSize = 0, .pInitialData = nullptr};
|
||||
|
||||
std::vector<u8> cache_data;
|
||||
FileUtil::IOFile cache_file{cache_file_path, "r"};
|
||||
if (cache_file.IsOpen()) {
|
||||
LOG_INFO(Render_Vulkan, "Loading pipeline cache");
|
||||
|
||||
const u32 cache_file_size = cache_file.GetSize();
|
||||
auto cache_data = std::vector<u8>(cache_file_size);
|
||||
cache_data.resize(cache_file_size);
|
||||
if (cache_file.ReadBytes(cache_data.data(), cache_file_size)) {
|
||||
if (!IsCacheValid(cache_data.data(), cache_file_size)) {
|
||||
LOG_WARNING(Render_Vulkan, "Pipeline cache provided invalid, deleting");
|
||||
|
@ -439,7 +439,7 @@ void RasterizerVulkan::SetupVertexArray(u32 vs_input_size, u32 vs_input_index_mi
|
||||
// Loop one more time to find unused attributes and assign them to the default one
|
||||
// This needs to happen because i = 2 might be assigned to location = 3 so the loop
|
||||
// above would skip setting it
|
||||
for (std::size_t i = 0; i < 16; i++) {
|
||||
for (u32 i = 0; i < 16; i++) {
|
||||
// If the attribute is just disabled, shove the default attribute to avoid
|
||||
// errors if the shader ever decides to use it. The pipeline cache can discard
|
||||
// this if needed since it has access to the usage mask from the code generator
|
||||
|
Reference in New Issue
Block a user