MCPcopy Create free account
hub / github.com/InoriRus/Kyty / update_func

Function update_func

source/emulator/src/Graphics/Objects/RenderTexture.cpp:35–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35static void update_func(GraphicContext* ctx, const uint64_t* params, void* obj, const uint64_t* vaddr, const uint64_t* size, int vaddr_num)
36{
37 KYTY_PROFILER_BLOCK("RenderTextureObject::update_func");
38
39 EXIT_IF(obj == nullptr);
40 EXIT_IF(ctx == nullptr);
41 EXIT_IF(params == nullptr);
42 EXIT_IF(vaddr == nullptr || size == nullptr || vaddr_num != 1);
43
44 auto* vk_obj = static_cast<RenderTextureVulkanImage*>(obj);
45
46 bool tiled = (params[RenderTextureObject::PARAM_TILED] != 0);
47 // bool neo = (params[RenderTextureObject::PARAM_NEO] != 0);
48 auto pitch = params[RenderTextureObject::PARAM_PITCH];
49 auto width = params[RenderTextureObject::PARAM_WIDTH];
50 // auto height = params[RenderTextureObject::PARAM_HEIGHT];
51
52 vk_obj->layout = VK_IMAGE_LAYOUT_UNDEFINED;
53
54 if (tiled && buffer_is_tiled(*vaddr, *size))
55 {
56 EXIT_NOT_IMPLEMENTED(width != pitch);
57 auto* temp_buf = new uint8_t[*size];
58 KYTY_NOT_IMPLEMENTED;
59 // TODO()
60 // TileConvertTiledToLinear(temp_buf, reinterpret_cast<void*>(*vaddr), TileMode::VideoOutTiled, width, height, neo);
61 // UtilFillImage(ctx, vk_obj, temp_buf, *size, pitch);
62 delete[] temp_buf;
63 } else
64 {
65 UtilFillImage(ctx, vk_obj, reinterpret_cast<void*>(*vaddr), *size, pitch,
66 static_cast<uint64_t>(VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL));
67 }
68}
69
70static void update2_func(GraphicContext* ctx, CommandBuffer* buffer, const uint64_t* params, void* obj, GpuMemoryScenario scenario,
71 const Vector<GpuMemoryObject>& objects)

Callers 1

create_funcFunction · 0.70

Calls 2

UtilFillImageFunction · 0.85
buffer_is_tiledFunction · 0.70

Tested by

no test coverage detected