Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hrydgard
GitHub Repository: hrydgard/ppsspp
Path: blob/master/GPU/Vulkan/GPU_Vulkan.cpp
5663 views
1
2
// Copyright (c) 2015- PPSSPP Project.
3
4
// This program is free software: you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation, version 2.0 or later versions.
7
8
// This program is distributed in the hope that it will be useful,
9
// but WITHOUT ANY WARRANTY; without even the implied warranty of
10
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
// GNU General Public License 2.0 for more details.
12
13
// A copy of the GPL 2.0 should have been included with the program.
14
// If not, see http://www.gnu.org/licenses/
15
16
// Official git repository and contact information can be found at
17
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
18
19
#include <thread>
20
21
#include "Common/Profiler/Profiler.h"
22
23
#include "Common/Log.h"
24
#include "Common/TimeUtil.h"
25
#include "Common/File/FileUtil.h"
26
#include "Common/GraphicsContext.h"
27
#include "Common/StringUtils.h"
28
29
#include "Core/Config.h"
30
#include "Core/Reporting.h"
31
#include "Core/System.h"
32
#include "Core/ELF/ParamSFO.h"
33
34
#include "GPU/GPUState.h"
35
#include "GPU/Common/FramebufferManagerCommon.h"
36
#include "GPU/Vulkan/ShaderManagerVulkan.h"
37
#include "GPU/Vulkan/GPU_Vulkan.h"
38
#include "GPU/Vulkan/FramebufferManagerVulkan.h"
39
#include "GPU/Vulkan/DrawEngineVulkan.h"
40
#include "GPU/Vulkan/TextureCacheVulkan.h"
41
#include "Common/GPU/Vulkan/VulkanRenderManager.h"
42
#include "Common/GPU/Vulkan/VulkanQueueRunner.h"
43
44
GPU_Vulkan::GPU_Vulkan(GraphicsContext *gfxCtx, Draw::DrawContext *draw)
45
: GPUCommonHW(gfxCtx, draw), drawEngine_(draw) {
46
_assert_(draw);
47
48
gstate_c.SetUseFlags(CheckGPUFeatures());
49
50
VulkanContext *vulkan = (VulkanContext *)gfxCtx->GetAPIContext();
51
52
vulkan->SetProfilerEnabledPtr(&g_Config.bGpuLogProfiler);
53
54
shaderManagerVulkan_ = new ShaderManagerVulkan(draw);
55
pipelineManager_ = new PipelineManagerVulkan(vulkan);
56
framebufferManagerVulkan_ = new FramebufferManagerVulkan(draw);
57
framebufferManager_ = framebufferManagerVulkan_;
58
textureCacheVulkan_ = new TextureCacheVulkan(draw, framebufferManager_->GetDraw2D(), vulkan);
59
textureCache_ = textureCacheVulkan_;
60
drawEngineCommon_ = &drawEngine_;
61
shaderManager_ = shaderManagerVulkan_;
62
63
drawEngine_.SetGPUCommon(this);
64
drawEngine_.SetTextureCache(textureCacheVulkan_);
65
drawEngine_.SetFramebufferManager(framebufferManagerVulkan_);
66
drawEngine_.SetShaderManager(shaderManagerVulkan_);
67
drawEngine_.SetPipelineManager(pipelineManager_);
68
drawEngine_.Init();
69
framebufferManagerVulkan_->SetTextureCache(textureCacheVulkan_);
70
framebufferManagerVulkan_->SetDrawEngine(&drawEngine_);
71
framebufferManagerVulkan_->SetShaderManager(shaderManagerVulkan_);
72
textureCacheVulkan_->SetFramebufferManager(framebufferManagerVulkan_);
73
textureCacheVulkan_->SetShaderManager(shaderManagerVulkan_);
74
textureCacheVulkan_->SetDrawEngine(&drawEngine_);
75
76
// Sanity check gstate
77
if ((int *)&gstate.transferstart - (int *)&gstate != 0xEA) {
78
ERROR_LOG(Log::G3D, "gstate has drifted out of sync!");
79
}
80
81
BuildReportingInfo();
82
83
textureCache_->NotifyConfigChanged();
84
85
drawEngine_.InitDeviceObjects(); // Creates important things like the pipeline layout. Required for loading the disk cache.
86
87
// Load shader cache.
88
std::string discID = g_paramSFO.GetDiscID();
89
if (discID.size()) {
90
File::CreateFullPath(GetSysDirectory(DIRECTORY_APP_CACHE));
91
shaderCachePath_ = GetSysDirectory(DIRECTORY_APP_CACHE) / (discID + ".vkshadercache");
92
LoadCache(shaderCachePath_);
93
}
94
95
InitDeviceObjects();
96
}
97
98
void GPU_Vulkan::FinishInitOnMainThread() {
99
// This can end up stopping/starting the vulkan render manager.
100
framebufferManagerVulkan_->Init(msaaLevel_);
101
}
102
103
void GPU_Vulkan::LoadCache(const Path &filename) {
104
_dbg_assert_(draw_);
105
if (!g_Config.bShaderCache) {
106
WARN_LOG(Log::G3D, "Shader cache disabled. Not loading.");
107
return;
108
}
109
110
// Actually precompiled by IsReady() since we're single-threaded.
111
FILE *f = File::OpenCFile(filename, "rb");
112
if (!f)
113
return;
114
115
// First compile shaders to SPIR-V, then load the pipeline cache and recreate the pipelines.
116
// It's when recreating the pipelines that the pipeline cache is useful - in the ideal case,
117
// it can just memcpy the finished shader binaries out of the pipeline cache file.
118
bool result = ShaderManagerVulkan::LoadCacheFlags(f, &drawEngine_);
119
if (!result) {
120
WARN_LOG(Log::G3D, "ShaderManagerVulkan failed to load cache header.");
121
}
122
if (result) {
123
// Reload use flags in case LoadCacheFlags() changed them.
124
if (drawEngineCommon_->EverUsedExactEqualDepth()) {
125
sawExactEqualDepth_ = true;
126
}
127
gstate_c.SetUseFlags(CheckGPUFeatures());
128
result = shaderManagerVulkan_->LoadCache(f);
129
if (!result) {
130
WARN_LOG(Log::G3D, "ShaderManagerVulkan failed to load cache.");
131
}
132
}
133
if (result) {
134
// WARNING: See comment in LoadPipelineCache if you are tempted to flip the second parameter to true.
135
result = pipelineManager_->LoadPipelineCache(f, false, shaderManagerVulkan_, draw_, drawEngine_.GetPipelineLayout(), msaaLevel_);
136
}
137
fclose(f);
138
139
// Now, since we're on the loader thread, we can just block here until all pipelines are actually created.
140
// This makes it so that the on-screen spinner keeps spinning until we are done.
141
double start = time_now_d();
142
VulkanRenderManager *rm = (VulkanRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER);
143
int maxTasksSeen = rm->WaitForPipelines();
144
double seconds = time_now_d() - start;
145
INFO_LOG(Log::G3D, "Waited %0.1fms for at least %d pipeline tasks to finish compiling.", seconds * 1000.0, maxTasksSeen);
146
147
if (!result) {
148
WARN_LOG(Log::G3D, "Incompatible Vulkan pipeline cache - rebuilding.");
149
// Bad cache file for this GPU/Driver/etc. Delete it.
150
File::Delete(filename);
151
} else {
152
INFO_LOG(Log::G3D, "Loaded Vulkan pipeline cache.");
153
}
154
}
155
156
void GPU_Vulkan::SaveCache(const Path &filename) {
157
if (!g_Config.bShaderCache) {
158
INFO_LOG(Log::G3D, "Shader cache disabled. Not saving.");
159
return;
160
}
161
162
if (!draw_) {
163
// Already got the lost message, we're in shutdown.
164
WARN_LOG(Log::G3D, "Not saving shaders - shutting down from in-game.");
165
return;
166
}
167
168
FILE *f = File::OpenCFile(filename, "wb");
169
if (!f)
170
return;
171
shaderManagerVulkan_->SaveCache(f, &drawEngine_);
172
// WARNING: See comment in LoadCache if you are tempted to flip the second parameter to true.
173
pipelineManager_->SavePipelineCache(f, false, shaderManagerVulkan_, draw_);
174
INFO_LOG(Log::G3D, "Saved Vulkan pipeline cache");
175
fclose(f);
176
}
177
178
GPU_Vulkan::~GPU_Vulkan() {
179
if (draw_) {
180
VulkanRenderManager *rm = (VulkanRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER);
181
// This now also does a hard sync with the render thread, so that we can safely delete our pipeline layout below.
182
rm->StopThreads();
183
rm->CheckNothingPending();
184
}
185
186
SaveCache(shaderCachePath_);
187
188
// StopThreads should have ensured that no pipelines are queued to compile at this point. So we can tear it down.
189
delete pipelineManager_;
190
pipelineManager_ = nullptr;
191
192
// Note: We save the cache in DeviceLost
193
DestroyDeviceObjects();
194
drawEngine_.DeviceLost();
195
shaderManager_->ClearShaders();
196
197
// other managers are deleted in ~GPUCommonHW.
198
if (draw_) {
199
VulkanRenderManager *rm = (VulkanRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER);
200
rm->StartThreads();
201
}
202
}
203
204
u32 GPU_Vulkan::CheckGPUFeatures() const {
205
uint32_t features = GPUCommonHW::CheckGPUFeatures();
206
207
VulkanContext *vulkan = (VulkanContext *)draw_->GetNativeObject(Draw::NativeObject::CONTEXT);
208
209
// Could simplify this, but it's good as documentation.
210
switch (vulkan->GetPhysicalDeviceProperties().properties.vendorID) {
211
case VULKAN_VENDOR_AMD:
212
// Accurate depth is required on AMD (due to reverse-Z driver bug) so we ignore the compat flag to disable it on those. See #9545
213
features |= GPU_USE_ACCURATE_DEPTH;
214
break;
215
case VULKAN_VENDOR_QUALCOMM:
216
// Accurate depth is required on Adreno too (seems to also have a reverse-Z driver bug).
217
features |= GPU_USE_ACCURATE_DEPTH;
218
break;
219
case VULKAN_VENDOR_ARM:
220
{
221
// This check is probably not exactly accurate. But old drivers had problems with reverse-Z, just like AMD and Qualcomm.
222
223
// NOTE: Galaxy S8 has version 16 but still seems to have some problems with accurate depth.
224
225
// TODO: Move this check to thin3d_vulkan.
226
227
bool driverTooOld = IsHashMaliDriverVersion(vulkan->GetPhysicalDeviceProperties().properties)
228
|| VK_VERSION_MAJOR(vulkan->GetPhysicalDeviceProperties().properties.driverVersion) < 14;
229
230
if (!PSP_CoreParameter().compat.flags().DisableAccurateDepth || driverTooOld) {
231
features |= GPU_USE_ACCURATE_DEPTH;
232
} else {
233
features &= ~GPU_USE_ACCURATE_DEPTH;
234
}
235
break;
236
}
237
case VULKAN_VENDOR_IMGTEC:
238
// We ignore the disable flag on IMGTec. Another reverse-Z bug (plus, not really any reason to bother). See #17044
239
features |= GPU_USE_ACCURATE_DEPTH;
240
break;
241
default:
242
// On other GPUs we'll just assume we don't need inaccurate depth, leaving ARM Mali as the odd one out.
243
features |= GPU_USE_ACCURATE_DEPTH;
244
break;
245
}
246
247
// Might enable this later - in the first round we are mostly looking at depth/stencil/discard.
248
// if (!g_Config.bEnableVendorBugChecks)
249
// features |= GPU_USE_ACCURATE_DEPTH;
250
251
// Mandatory features on Vulkan, which may be checked in "centralized" code
252
features |= GPU_USE_TEXTURE_LOD_CONTROL;
253
features |= GPU_USE_INSTANCE_RENDERING;
254
features |= GPU_USE_VERTEX_TEXTURE_FETCH;
255
features |= GPU_USE_TEXTURE_FLOAT;
256
257
// Fall back to geometry shader culling if we can't do vertex range culling.
258
// Checking accurate depth here because the old depth path is uncommon and not well tested for this.
259
if (draw_->GetDeviceCaps().geometryShaderSupported && (features & GPU_USE_ACCURATE_DEPTH) != 0) {
260
const bool useGeometry = g_Config.bUseGeometryShader && !draw_->GetBugs().Has(Draw::Bugs::GEOMETRY_SHADERS_SLOW_OR_BROKEN);
261
const bool vertexSupported = draw_->GetDeviceCaps().clipDistanceSupported && draw_->GetDeviceCaps().cullDistanceSupported;
262
if (useGeometry && (!vertexSupported || (features & GPU_USE_VS_RANGE_CULLING) == 0)) {
263
// Switch to culling via the geometry shader if not fully supported in vertex.
264
features |= GPU_USE_GS_CULLING;
265
features &= ~GPU_USE_VS_RANGE_CULLING;
266
}
267
}
268
269
if (!draw_->GetBugs().Has(Draw::Bugs::PVR_BAD_16BIT_TEXFORMATS)) {
270
// These are VULKAN_4444_FORMAT and friends.
271
// Note that we are now using the correct set of formats - the only cases where some may be missing
272
// are non-conformant implementations like MoltenVK.
273
uint32_t fmt4444 = draw_->GetDataFormatSupport(Draw::DataFormat::B4G4R4A4_UNORM_PACK16);
274
uint32_t fmt1555 = draw_->GetDataFormatSupport(Draw::DataFormat::A1R5G5B5_UNORM_PACK16);
275
uint32_t fmt565 = draw_->GetDataFormatSupport(Draw::DataFormat::R5G6B5_UNORM_PACK16);
276
if ((fmt4444 & Draw::FMT_TEXTURE) && (fmt565 & Draw::FMT_TEXTURE) && (fmt1555 & Draw::FMT_TEXTURE)) {
277
features |= GPU_USE_16BIT_FORMATS;
278
} else {
279
INFO_LOG(Log::G3D, "Deficient texture format support: 4444: %d 1555: %d 565: %d", fmt4444, fmt1555, fmt565);
280
}
281
}
282
283
if (g_Config.bStereoRendering && draw_->GetDeviceCaps().multiViewSupported) {
284
features |= GPU_USE_SINGLE_PASS_STEREO;
285
features |= GPU_USE_SIMPLE_STEREO_PERSPECTIVE;
286
287
if (features & GPU_USE_GS_CULLING) {
288
// Many devices that support stereo and GS don't support GS during stereo.
289
features &= ~GPU_USE_GS_CULLING;
290
features |= GPU_USE_VS_RANGE_CULLING;
291
}
292
}
293
294
// Attempt to workaround #17386
295
if (draw_->GetBugs().Has(Draw::Bugs::UNIFORM_INDEXING_BROKEN)) {
296
features &= ~GPU_USE_LIGHT_UBERSHADER;
297
}
298
299
features |= GPU_USE_FRAMEBUFFER_ARRAYS;
300
return CheckGPUFeaturesLate(features);
301
}
302
303
void GPU_Vulkan::BeginHostFrame(const DisplayLayoutConfig &config) {
304
GPUCommonHW::BeginHostFrame(config);
305
306
drawEngine_.BeginFrame();
307
textureCache_->StartFrame();
308
309
VulkanContext *vulkan = (VulkanContext *)draw_->GetNativeObject(Draw::NativeObject::CONTEXT);
310
int curFrame = vulkan->GetCurFrame();
311
312
framebufferManager_->BeginFrame(config);
313
314
shaderManagerVulkan_->DirtyLastShader();
315
gstate_c.Dirty(DIRTY_ALL);
316
317
if (gstate_c.useFlagsChanged) {
318
// TODO: It'd be better to recompile them in the background, probably?
319
// This most likely means that saw equal depth changed.
320
WARN_LOG(Log::G3D, "Shader use flags changed, clearing all shaders and depth buffers");
321
// TODO: Not all shaders need to be recompiled. In fact, quite few? Of course, depends on
322
// the use flag change.. This is a major frame rate hitch in the start of a race in Outrun.
323
shaderManager_->ClearShaders();
324
pipelineManager_->Clear();
325
framebufferManager_->ClearAllDepthBuffers();
326
gstate_c.useFlagsChanged = false;
327
}
328
329
if (dumpNextFrame_) {
330
NOTICE_LOG(Log::G3D, "DUMPING THIS FRAME");
331
dumpThisFrame_ = true;
332
dumpNextFrame_ = false;
333
} else if (dumpThisFrame_) {
334
dumpThisFrame_ = false;
335
}
336
}
337
338
void GPU_Vulkan::EndHostFrame() {
339
VulkanContext *vulkan = (VulkanContext *)draw_->GetNativeObject(Draw::NativeObject::CONTEXT);
340
341
drawEngine_.EndFrame();
342
343
GPUCommonHW::EndHostFrame();
344
}
345
346
// Needs to be called on GPU thread, not reporting thread.
347
void GPU_Vulkan::BuildReportingInfo() {
348
VulkanContext *vulkan = (VulkanContext *)draw_->GetNativeObject(Draw::NativeObject::CONTEXT);
349
const auto &props = vulkan->GetPhysicalDeviceProperties().properties;
350
const auto &available = vulkan->GetDeviceFeatures().available;
351
352
#define CHECK_BOOL_FEATURE(n) do { if (available.standard.n) { featureNames += ", " #n; } } while (false)
353
#define CHECK_BOOL_FEATURE_MULTIVIEW(n) do { if (available.multiview.n) { featureNames += ", " #n; } } while (false)
354
355
std::string featureNames = "";
356
CHECK_BOOL_FEATURE(fullDrawIndexUint32);
357
CHECK_BOOL_FEATURE(geometryShader);
358
CHECK_BOOL_FEATURE(sampleRateShading);
359
CHECK_BOOL_FEATURE(dualSrcBlend);
360
CHECK_BOOL_FEATURE(logicOp);
361
CHECK_BOOL_FEATURE(multiDrawIndirect);
362
CHECK_BOOL_FEATURE(drawIndirectFirstInstance);
363
CHECK_BOOL_FEATURE(depthClamp);
364
CHECK_BOOL_FEATURE(depthBiasClamp);
365
CHECK_BOOL_FEATURE(depthBounds);
366
CHECK_BOOL_FEATURE(samplerAnisotropy);
367
CHECK_BOOL_FEATURE(textureCompressionETC2);
368
CHECK_BOOL_FEATURE(textureCompressionASTC_LDR);
369
CHECK_BOOL_FEATURE(textureCompressionBC);
370
CHECK_BOOL_FEATURE(occlusionQueryPrecise);
371
CHECK_BOOL_FEATURE(pipelineStatisticsQuery);
372
CHECK_BOOL_FEATURE(fragmentStoresAndAtomics);
373
CHECK_BOOL_FEATURE(shaderTessellationAndGeometryPointSize);
374
CHECK_BOOL_FEATURE(shaderStorageImageMultisample);
375
CHECK_BOOL_FEATURE(shaderSampledImageArrayDynamicIndexing);
376
CHECK_BOOL_FEATURE(shaderClipDistance);
377
CHECK_BOOL_FEATURE(shaderCullDistance);
378
CHECK_BOOL_FEATURE(shaderInt64);
379
CHECK_BOOL_FEATURE(shaderInt16);
380
CHECK_BOOL_FEATURE_MULTIVIEW(multiview);
381
CHECK_BOOL_FEATURE_MULTIVIEW(multiviewGeometryShader);
382
383
#undef CHECK_BOOL_FEATURE
384
385
if (!featureNames.empty()) {
386
featureNames = featureNames.substr(2);
387
}
388
389
reportingPrimaryInfo_ = props.deviceName;
390
reportingFullInfo_ = StringFromFormat("v%08x driver v%08x (%s), vendorID=%d, deviceID=%d (features: %s)", props.apiVersion, props.driverVersion, props.deviceName, props.vendorID, props.deviceID, featureNames.c_str());
391
392
Reporting::UpdateConfig();
393
}
394
395
void GPU_Vulkan::FinishDeferred() {
396
drawEngine_.FinishDeferred();
397
}
398
399
void GPU_Vulkan::InitDeviceObjects() {
400
INFO_LOG(Log::G3D, "GPU_Vulkan::InitDeviceObjects");
401
402
uint32_t hacks = 0;
403
if (PSP_CoreParameter().compat.flags().MGS2AcidHack)
404
hacks |= QUEUE_HACK_MGS2_ACID;
405
if (PSP_CoreParameter().compat.flags().SonicRivalsHack)
406
hacks |= QUEUE_HACK_SONIC;
407
408
// Always on.
409
hacks |= QUEUE_HACK_RENDERPASS_MERGE;
410
411
if (hacks) {
412
VulkanRenderManager *rm = (VulkanRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER);
413
rm->GetQueueRunner()->EnableHacks(hacks);
414
}
415
}
416
417
void GPU_Vulkan::DestroyDeviceObjects() {
418
INFO_LOG(Log::G3D, "GPU_Vulkan::DestroyDeviceObjects");
419
// Need to turn off hacks when shutting down the GPU. Don't want them running in the menu.
420
if (draw_) {
421
VulkanRenderManager *rm = (VulkanRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER);
422
if (rm)
423
rm->GetQueueRunner()->EnableHacks(0);
424
}
425
}
426
427
void GPU_Vulkan::CheckRenderResized(const DisplayLayoutConfig &config) {
428
if (renderResized_) {
429
GPUCommonHW::CheckRenderResized(config);
430
pipelineManager_->InvalidateMSAAPipelines();
431
framebufferManager_->ReleasePipelines();
432
}
433
}
434
435
void GPU_Vulkan::DeviceLost() {
436
// draw_ is normally actually still valid here in Vulkan. But we null it out in GPUCommonHW::DeviceLost so we don't try to use it again.
437
// So, we have to save it here to be able to call ReleaseCompileQueue().
438
Draw::DrawContext *draw = draw_;
439
if (draw) {
440
VulkanRenderManager *rm = (VulkanRenderManager *)draw->GetNativeObject(Draw::NativeObject::RENDER_MANAGER);
441
rm->StopThreads();
442
}
443
444
if (shaderCachePath_.Valid()) {
445
SaveCache(shaderCachePath_);
446
}
447
DestroyDeviceObjects();
448
pipelineManager_->DeviceLost();
449
450
GPUCommonHW::DeviceLost();
451
452
if (draw) {
453
VulkanRenderManager *rm = (VulkanRenderManager *)draw->GetNativeObject(Draw::NativeObject::RENDER_MANAGER);
454
rm->StartThreads();
455
}
456
}
457
458
void GPU_Vulkan::DeviceRestore(Draw::DrawContext *draw) {
459
GPUCommonHW::DeviceRestore(draw); // this updates draw_.
460
461
VulkanContext *vulkan = (VulkanContext *)draw_->GetNativeObject(Draw::NativeObject::CONTEXT);
462
pipelineManager_->DeviceRestore(vulkan);
463
464
InitDeviceObjects();
465
}
466
467
void GPU_Vulkan::GetStats(char *buffer, size_t bufsize) {
468
size_t offset = FormatGPUStatsCommon(buffer, bufsize);
469
buffer += offset;
470
bufsize -= offset;
471
if ((int)bufsize < 0)
472
return;
473
const DrawEngineVulkanStats &drawStats = drawEngine_.GetStats();
474
char texStats[256];
475
textureCacheVulkan_->GetStats(texStats, sizeof(texStats));
476
snprintf(buffer, bufsize,
477
"Vertex, Fragment, Pipelines loaded: %i, %i, %i\n"
478
"Pushbuffer space used: Vtx %d, Idx %d\n"
479
"%s\n",
480
shaderManagerVulkan_->GetNumVertexShaders(),
481
shaderManagerVulkan_->GetNumFragmentShaders(),
482
pipelineManager_->GetNumPipelines(),
483
drawStats.pushVertexSpaceUsed,
484
drawStats.pushIndexSpaceUsed,
485
texStats
486
);
487
}
488
489
std::vector<std::string> GPU_Vulkan::DebugGetShaderIDs(DebugShaderType type) {
490
switch (type) {
491
case SHADER_TYPE_PIPELINE:
492
return pipelineManager_->DebugGetObjectIDs(type);
493
case SHADER_TYPE_SAMPLER:
494
return textureCacheVulkan_->DebugGetSamplerIDs();
495
default:
496
return GPUCommonHW::DebugGetShaderIDs(type);
497
}
498
}
499
500
std::string GPU_Vulkan::DebugGetShaderString(std::string id, DebugShaderType type, DebugShaderStringType stringType) {
501
switch (type) {
502
case SHADER_TYPE_PIPELINE:
503
return pipelineManager_->DebugGetObjectString(id, type, stringType, shaderManagerVulkan_);
504
case SHADER_TYPE_SAMPLER:
505
return textureCacheVulkan_->DebugGetSamplerString(id, stringType);
506
default:
507
return GPUCommonHW::DebugGetShaderString(id, type, stringType);
508
}
509
}
510
511