放弃画3d

This commit is contained in:
xsl
2025-09-18 11:40:53 +08:00
parent 203b211bde
commit cbdbdb5698
+18
View File
@@ -110,6 +110,7 @@ Java_com_khronos_vulkan_1samples_MainActivity_nativeButtonClicked(JNIEnv *env, j
}
extern void TextureLoadProcessWithVulkan(uint8_t* data, int width, int height, int rowStride, size_t dataSize);
extern void ReceiveFacePoint(float* pos, int count, int width, int height);
void processWithVulkan(uint8_t* data, int width, int height, int format,
int rowStride, size_t dataSize) {
@@ -142,4 +143,21 @@ Java_com_khronos_vulkan_1samples_MainActivity_processImageNative(JNIEnv *env, jo
// 在这里将图像数据传递给 Vulkan
// 创建 Vulkan 图像或更新现有图像
processWithVulkan(imageData, width, height, format, row_stride, capacity);
}
extern "C"
JNIEXPORT void JNICALL
Java_com_khronos_vulkan_1samples_MainActivity_passDataToNative(JNIEnv *env, jobject thiz,
jobject buffer, jint pointCount, jint width, jint height) {
// TODO: implement passDataToNative()
// 获取直接缓冲区的指针
float* pos = static_cast<float*>(env->GetDirectBufferAddress(buffer));
if (pos == nullptr) {
// 处理错误
return;
}
// 或者直接将指针传递给Vulkan
ReceiveFacePoint(pos, pointCount, width, height);
}