diff --git a/include/rendering/vk_context.hpp b/include/rendering/vk_context.hpp index a9186439..4c0764a9 100644 --- a/include/rendering/vk_context.hpp +++ b/include/rendering/vk_context.hpp @@ -70,6 +70,10 @@ public: VkInstance getInstance() const { return instance; } VkPhysicalDevice getPhysicalDevice() const { return physicalDevice; } VkDevice getDevice() const { return device; } + uint32_t getGpuVendorId() const { return gpuVendorId_; } + const char* getGpuName() const { return gpuName_; } + bool isAmdGpu() const { return gpuVendorId_ == 0x1002; } + bool isNvidiaGpu() const { return gpuVendorId_ == 0x10DE; } VkQueue getGraphicsQueue() const { return graphicsQueue; } uint32_t getGraphicsQueueFamily() const { return graphicsQueueFamily; } VmaAllocator getAllocator() const { return allocator; } @@ -149,6 +153,8 @@ private: // Pipeline cache (persisted to disk for faster startup) VkPipelineCache pipelineCache_ = VK_NULL_HANDLE; + uint32_t gpuVendorId_ = 0; + char gpuName_[256] = {}; VkQueue graphicsQueue = VK_NULL_HANDLE; VkQueue presentQueue = VK_NULL_HANDLE; diff --git a/src/core/application.cpp b/src/core/application.cpp index 0599ba42..d90549a1 100644 --- a/src/core/application.cpp +++ b/src/core/application.cpp @@ -2895,10 +2895,12 @@ void Application::setupUICallbacks() { const uint32_t row = static_cast(idx); std::string dir = dbc->getString(row, 23); + std::string soundName = dbc->getString(row, 2); for (uint32_t f = 3; f <= 12; ++f) { std::string name = dbc->getString(row, f); if (name.empty()) continue; std::string path = dir.empty() ? name : dir + "\\" + name; + LOG_WARNING("PLAY_SOUND: id=", soundId, " name='", soundName, "' path=", path); audio::AudioEngine::instance().playSound2D(path); return; } @@ -2916,11 +2918,15 @@ void Application::setupUICallbacks() { const uint32_t row = static_cast(idx); std::string dir = dbc->getString(row, 23); + std::string soundName = dbc->getString(row, 2); for (uint32_t f = 3; f <= 12; ++f) { std::string name = dbc->getString(row, f); if (name.empty()) continue; std::string path = dir.empty() ? name : dir + "\\" + name; + LOG_WARNING("PLAY_OBJECT_SOUND: id=", soundId, " name='", soundName, "' path=", path, + " src=0x", std::hex, sourceGuid, std::dec); + // Play as 3D sound if source entity position is available auto entity = gameHandler->getEntityManager().getEntity(sourceGuid); if (entity) { diff --git a/src/rendering/vk_context.cpp b/src/rendering/vk_context.cpp index aa223502..5a1ae34c 100644 --- a/src/rendering/vk_context.cpp +++ b/src/rendering/vk_context.cpp @@ -196,6 +196,10 @@ bool VkContext::selectPhysicalDevice() { VkPhysicalDeviceProperties props; vkGetPhysicalDeviceProperties(physicalDevice, &props); uint32_t apiVersion = props.apiVersion; + gpuVendorId_ = props.vendorID; + std::strncpy(gpuName_, props.deviceName, sizeof(gpuName_) - 1); + gpuName_[sizeof(gpuName_) - 1] = '\0'; + LOG_INFO("GPU: ", gpuName_, " (vendor 0x", std::hex, gpuVendorId_, std::dec, ")"); VkPhysicalDeviceDepthStencilResolveProperties dsResolveProps{}; dsResolveProps.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES;