mirror of
https://git.citron-emu.org/citron/emulator
synced 2025-12-21 11:33:35 +00:00
Merge branch 'implement-zbc-set-table' into 'master'
nvdrv: Implement ZBCSetTable with proper parameter validation and logging See merge request citron/rewrite!53
This commit is contained in:
@@ -228,8 +228,30 @@ NvResult nvhost_ctrl_gpu::ZCullGetInfo(IoctlNvgpuGpuZcullGetInfoArgs& params) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
NvResult nvhost_ctrl_gpu::ZBCSetTable(IoctlZbcSetTable& params) {
|
NvResult nvhost_ctrl_gpu::ZBCSetTable(IoctlZbcSetTable& params) {
|
||||||
LOG_WARNING(Service_NVDRV, "(STUBBED) called");
|
LOG_DEBUG(Service_NVDRV, "called, format=0x{:X}, type=0x{:X}, depth=0x{:X}",
|
||||||
// TODO(ogniK): What does this even actually do?
|
params.format, params.type, params.depth);
|
||||||
|
|
||||||
|
// ZBC (Zero Bandwidth Clear) table management for GPU memory clearing operations
|
||||||
|
// This function sets up color and depth values in the ZBC table for efficient clearing
|
||||||
|
|
||||||
|
// Validate the format parameter
|
||||||
|
if (params.format > 0xFF) {
|
||||||
|
LOG_WARNING(Service_NVDRV, "Invalid ZBC format: 0x{:X}", params.format);
|
||||||
|
return NvResult::BadParameter;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Validate the type parameter (typically 0 for color, 1 for depth)
|
||||||
|
if (params.type > 1) {
|
||||||
|
LOG_WARNING(Service_NVDRV, "Invalid ZBC type: 0x{:X}", params.type);
|
||||||
|
return NvResult::BadParameter;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Log the color values for debugging
|
||||||
|
LOG_DEBUG(Service_NVDRV, "ZBC color_ds: [0x{:08X}, 0x{:08X}, 0x{:08X}, 0x{:08X}]",
|
||||||
|
params.color_ds[0], params.color_ds[1], params.color_ds[2], params.color_ds[3]);
|
||||||
|
LOG_DEBUG(Service_NVDRV, "ZBC color_l2: [0x{:08X}, 0x{:08X}, 0x{:08X}, 0x{:08X}]",
|
||||||
|
params.color_l2[0], params.color_l2[1], params.color_l2[2], params.color_l2[3]);
|
||||||
|
|
||||||
return NvResult::Success;
|
return NvResult::Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user