mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-28 16:53:40 +01:00
Vulkan: Clean up shader module tag.
This commit is contained in:
1 parent
878a049f60
commit
38e16324f0
2 files changed
+13
-5
No files matched your search
@@ -177,9 +177,9 @@ VkShaderStageFlagBits StageToVulkan(ShaderStage stage) {
|
||||
case ShaderStage::Vertex: return VK_SHADER_STAGE_VERTEX_BIT;
|
||||
case ShaderStage::Geometry: return VK_SHADER_STAGE_GEOMETRY_BIT;
|
||||
case ShaderStage::Compute: return VK_SHADER_STAGE_COMPUTE_BIT;
|
||||
default:
|
||||
case ShaderStage::Fragment: return VK_SHADER_STAGE_FRAGMENT_BIT;
|
||||
}
|
||||
return VK_SHADER_STAGE_FRAGMENT_BIT;
|
||||
}
|
||||
|
||||
// Not registering this as a resource holder, instead the pipeline is registered. It will
|
||||
|
||||
@@ -73,14 +73,22 @@ static Promise<VkShaderModule> *CompileShaderModuleAsync(VulkanContext *vulkan,
|
||||
|
||||
VkShaderModule shaderModule = VK_NULL_HANDLE;
|
||||
if (success) {
|
||||
success = vulkan->CreateShaderModule(spirv, &shaderModule, stage == VK_SHADER_STAGE_VERTEX_BIT ? "game_vertex" : "game_fragment");
|
||||
const char *createTag = tag ? tag->c_str() : nullptr;
|
||||
if (!createTag) {
|
||||
switch (stage) {
|
||||
case VK_SHADER_STAGE_VERTEX_BIT: createTag = "game_vertex"; break;
|
||||
case VK_SHADER_STAGE_FRAGMENT_BIT: createTag = "game_fragment"; break;
|
||||
case VK_SHADER_STAGE_GEOMETRY_BIT: createTag = "game_geometry"; break;
|
||||
case VK_SHADER_STAGE_COMPUTE_BIT: createTag = "game_compute"; break;
|
||||
}
|
||||
}
|
||||
|
||||
success = vulkan->CreateShaderModule(spirv, &shaderModule, createTag);
|
||||
#ifdef SHADERLOG
|
||||
OutputDebugStringA("OK");
|
||||
#endif
|
||||
if (tag) {
|
||||
vulkan->SetDebugName(shaderModule, VK_OBJECT_TYPE_SHADER_MODULE, tag->c_str());
|
||||
if (tag)
|
||||
delete tag;
|
||||
}
|
||||
}
|
||||
|
||||
return shaderModule;
|
||||
|
||||
Reference in new issue
Block a user