diff --git a/src/xenia/app/xenia_main.cc b/src/xenia/app/xenia_main.cc index ce013ec22..c715e733e 100644 --- a/src/xenia/app/xenia_main.cc +++ b/src/xenia/app/xenia_main.cc @@ -210,7 +210,7 @@ int xenia_main(const std::vector& args) { std::wstring abs_path = xe::to_absolute_path(path); result = emulator->LaunchPath(abs_path); if (XFAILED(result)) { - XELOGE("Failed to launch target: %.8X", result); + xe::FatalError("Failed to launch target: %.8X", result); emulator.reset(); emulator_window.reset(); return 1; diff --git a/src/xenia/apu/xma_context.cc b/src/xenia/apu/xma_context.cc index f20aa4361..2fd40a928 100644 --- a/src/xenia/apu/xma_context.cc +++ b/src/xenia/apu/xma_context.cc @@ -225,6 +225,11 @@ bool XmaContext::ValidFrameOffset(uint8_t* block, size_t size_bytes, size_t frame_offset_bits) { uint32_t packet_num = GetFramePacketNumber(block, size_bytes, frame_offset_bits); + if (packet_num == -1) { + // Invalid packet number + return false; + } + uint8_t* packet = block + (packet_num * kBytesPerPacket); size_t relative_offset_bits = frame_offset_bits % (kBytesPerPacket * 8); diff --git a/src/xenia/gpu/spirv_shader_translator.cc b/src/xenia/gpu/spirv_shader_translator.cc index efdcf924e..f646f8920 100644 --- a/src/xenia/gpu/spirv_shader_translator.cc +++ b/src/xenia/gpu/spirv_shader_translator.cc @@ -1263,7 +1263,10 @@ void SpirvShaderTranslator::ProcessVertexFetchInstruction( assert_unhandled_case(vertex_components); } - spv::Id vertex = 0; + auto vertex_ptr = vertex_binding_map_[instr.operands[1].storage_index] + [instr.attributes.offset]; + assert_not_zero(vertex_ptr); + spv::Id vertex = b.createLoad(vertex_ptr); switch (instr.attributes.data_format) { case VertexFormat::k_8_8_8_8: case VertexFormat::k_2_10_10_10: @@ -1277,13 +1280,9 @@ void SpirvShaderTranslator::ProcessVertexFetchInstruction( case VertexFormat::k_32_FLOAT: case VertexFormat::k_32_32_FLOAT: case VertexFormat::k_32_32_32_FLOAT: - case VertexFormat::k_32_32_32_32_FLOAT: + case VertexFormat::k_32_32_32_32_FLOAT: { // These are handled, for now. - auto vertex_ptr = vertex_binding_map_[instr.operands[1].storage_index] - [instr.attributes.offset]; - assert_not_zero(vertex_ptr); - vertex = b.createLoad(vertex_ptr); - break; + } break; case VertexFormat::k_10_11_11: { // This needs to be converted. diff --git a/src/xenia/gpu/vulkan/buffer_cache.cc b/src/xenia/gpu/vulkan/buffer_cache.cc index 5050e7469..e5d60e402 100644 --- a/src/xenia/gpu/vulkan/buffer_cache.cc +++ b/src/xenia/gpu/vulkan/buffer_cache.cc @@ -70,32 +70,30 @@ VkResult BufferCache::Initialize() { // Create the descriptor set layout used for our uniform buffer. // As it is a static binding that uses dynamic offsets during draws we can // create this once and reuse it forever. - VkDescriptorSetLayoutBinding vertex_uniform_binding; - vertex_uniform_binding.binding = 0; - vertex_uniform_binding.descriptorType = - VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC; - vertex_uniform_binding.descriptorCount = 1; - vertex_uniform_binding.stageFlags = VK_SHADER_STAGE_VERTEX_BIT; - vertex_uniform_binding.pImmutableSamplers = nullptr; - VkDescriptorSetLayoutBinding fragment_uniform_binding; - fragment_uniform_binding.binding = 1; - fragment_uniform_binding.descriptorType = - VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC; - fragment_uniform_binding.descriptorCount = 1; - fragment_uniform_binding.stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT; - fragment_uniform_binding.pImmutableSamplers = nullptr; - VkDescriptorSetLayoutCreateInfo descriptor_set_layout_info; + VkDescriptorSetLayoutBinding bindings[2] = {}; + + // Vertex constants + bindings[0].binding = 0; + bindings[0].descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC; + bindings[0].descriptorCount = 1; + bindings[0].stageFlags = VK_SHADER_STAGE_VERTEX_BIT; + bindings[0].pImmutableSamplers = nullptr; + + // Fragment constants + bindings[1].binding = 1; + bindings[1].descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC; + bindings[1].descriptorCount = 1; + bindings[1].stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT; + bindings[1].pImmutableSamplers = nullptr; + + VkDescriptorSetLayoutCreateInfo descriptor_set_layout_info = {}; descriptor_set_layout_info.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO; descriptor_set_layout_info.pNext = nullptr; descriptor_set_layout_info.flags = 0; - VkDescriptorSetLayoutBinding uniform_bindings[] = { - vertex_uniform_binding, - fragment_uniform_binding, - }; descriptor_set_layout_info.bindingCount = - static_cast(xe::countof(uniform_bindings)); - descriptor_set_layout_info.pBindings = uniform_bindings; + static_cast(xe::countof(bindings)); + descriptor_set_layout_info.pBindings = bindings; status = vkCreateDescriptorSetLayout(*device_, &descriptor_set_layout_info, nullptr, &descriptor_set_layout_); if (status != VK_SUCCESS) { diff --git a/src/xenia/ui/vulkan/vulkan_device.cc b/src/xenia/ui/vulkan/vulkan_device.cc index ab06860a5..992ff6d8a 100644 --- a/src/xenia/ui/vulkan/vulkan_device.cc +++ b/src/xenia/ui/vulkan/vulkan_device.cc @@ -100,6 +100,7 @@ bool VulkanDevice::Initialize(DeviceInfo device_info) { } ENABLE_AND_EXPECT(shaderClipDistance); ENABLE_AND_EXPECT(shaderCullDistance); + ENABLE_AND_EXPECT(shaderStorageImageExtendedFormats); ENABLE_AND_EXPECT(shaderTessellationAndGeometryPointSize); ENABLE_AND_EXPECT(geometryShader); ENABLE_AND_EXPECT(depthClamp);