mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Debug-name shader modules with their shader desc strings
This commit is contained in:
parent
2791ab3226
commit
a2eaad5445
1 changed files with 6 additions and 3 deletions
|
@ -44,7 +44,7 @@
|
|||
|
||||
// Most drivers treat vkCreateShaderModule as pretty much a memcpy. What actually
|
||||
// takes time here, and makes this worthy of parallelization, is GLSLtoSPV.
|
||||
Promise<VkShaderModule> *CompileShaderModuleAsync(VulkanContext *vulkan, VkShaderStageFlagBits stage, const char *code) {
|
||||
static Promise<VkShaderModule> *CompileShaderModuleAsync(VulkanContext *vulkan, VkShaderStageFlagBits stage, const char *code, const char *tag) {
|
||||
auto compile = [=] {
|
||||
PROFILE_THIS_SCOPE("shadercomp");
|
||||
|
||||
|
@ -75,6 +75,9 @@ Promise<VkShaderModule> *CompileShaderModuleAsync(VulkanContext *vulkan, VkShade
|
|||
#ifdef SHADERLOG
|
||||
OutputDebugStringA("OK");
|
||||
#endif
|
||||
if (tag) {
|
||||
vulkan->SetDebugName(shaderModule, VK_OBJECT_TYPE_SHADER_MODULE, tag);
|
||||
}
|
||||
}
|
||||
|
||||
return shaderModule;
|
||||
|
@ -92,7 +95,7 @@ Promise<VkShaderModule> *CompileShaderModuleAsync(VulkanContext *vulkan, VkShade
|
|||
VulkanFragmentShader::VulkanFragmentShader(VulkanContext *vulkan, FShaderID id, FragmentShaderFlags flags, const char *code)
|
||||
: vulkan_(vulkan), id_(id), flags_(flags) {
|
||||
source_ = code;
|
||||
module_ = CompileShaderModuleAsync(vulkan, VK_SHADER_STAGE_FRAGMENT_BIT, source_.c_str());
|
||||
module_ = CompileShaderModuleAsync(vulkan, VK_SHADER_STAGE_FRAGMENT_BIT, source_.c_str(), FragmentShaderDesc(id).c_str());
|
||||
if (!module_) {
|
||||
failed_ = true;
|
||||
} else {
|
||||
|
@ -122,7 +125,7 @@ std::string VulkanFragmentShader::GetShaderString(DebugShaderStringType type) co
|
|||
VulkanVertexShader::VulkanVertexShader(VulkanContext *vulkan, VShaderID id, const char *code, bool useHWTransform)
|
||||
: vulkan_(vulkan), useHWTransform_(useHWTransform), id_(id) {
|
||||
source_ = code;
|
||||
module_ = CompileShaderModuleAsync(vulkan, VK_SHADER_STAGE_VERTEX_BIT, source_.c_str());
|
||||
module_ = CompileShaderModuleAsync(vulkan, VK_SHADER_STAGE_VERTEX_BIT, source_.c_str(), VertexShaderDesc(id).c_str());
|
||||
if (!module_) {
|
||||
failed_ = true;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue