当前位置: 首页 > wzjs >正文

云南网站建设工具修改wordpress后台登陆地址

云南网站建设工具,修改wordpress后台登陆地址,营销网站一般包括哪些内容,网站制作方案范文在(三)物理设备中,提到了设备需求检测, 我认为最重要的是队列族,也就是队列类型。 因为vulkan的几乎所有操作都要经过队列进行。有的队列是计算指令的,有的队列是内存传输的。各司其职。 那么怎么查找需要的…

在(三)物理设备中,提到了设备需求检测,
我认为最重要的是队列族,也就是队列类型。
因为vulkan的几乎所有操作都要经过队列进行。有的队列是计算指令的,有的队列是内存传输的。各司其职。
那么怎么查找需要的队列族呢?还是老办法:
获取数量->获取数组->条件检测。
1,获取队列族数量
uint32_t queueFamilyCount = 0;
vkGetPhysicalDeviceQueueFamilyProperties(device, &queueFamilyCount, nullptr);
2,获取队列族数组
std::vector queueFamilies(queueFamilyCount);
vkGetPhysicalDeviceQueueFamilyProperties(device, &queueFamilyCount, queueFamilies.data());
3,条件检测,
这里通过查找队列族索引的方式,以查找支持图形指令的第一个队列族索引为例( VK_QUEUE_GRAPHICS_BIT)。

QueueFaminliyIndices indices;
//暂时只需要支持图形指令
int i = 0;
for (const auto& queueFamily : queueFamilies  )
{if (queueFamily.queueCount > 0 && queueFamily.queueFlags & VK_QUEUE_GRAPHICS_BIT){indices.graphicsFamily = i;}if (indices.isCompleted()){break;}i++;
}
return indices;

这里队列族结构体如下:

struct QueueFaminliyIndices
{
//-1表示没找到满足需求的队列族
int graphicsFamily = -1;
bool isCompleted()
{
return graphicsFamily >= 0;
}
};
运行结果还是一样。
在这里插入图片描述
完整代码如下:
MyApplication.h
#pragma once

#include <glm/vec4.hpp>
#include <glm/mat4x4.hpp>
#include <vulkan/vulkan.h>
#include
#include “D:/install/filament-v1.18.0/third_party/imgui/examples/libs/glfw/include/GLFW/glfw3.h”
#include
#include
#include
#include

//队列族索引
struct QueueFaminliyIndices
{
//-1表示没找到满足需求的队列族
int graphicsFamily = -1;
bool isCompleted()
{
return graphicsFamily >= 0;
}
};
class MyApplication
{
public:
void run();

private:
//初始化窗口
void initWindow();
//初始化Vulkan对象
void initVulkan();
//主循环进行渲染操作
void mainLoop();
//资源清理
void cleanUp();

//创建一个实例初始化Vulkan库,指定驱动程序需要使用的应用程序信息
void createInstance();
//查询显卡设备
void pickPhysicalDevice();//返回查找的队列族索引
QueueFaminliyIndices findQueueFamilies(VkPhysicalDevice device);
//确保选择的设备能执行需要的指令
bool isDeviceSuitable(VkPhysicalDevice device);

private:
//窗口
GLFWwindow* window = nullptr;

//实例句柄
VkInstance instance;
//存储显卡信息
VkPhysicalDevice physicalDevice = VK_NULL_HANDLE;

};
MyApplication.cpp
#include “MyApplication.h”

void MyApplication::run()
{
initWindow();
initVulkan();
mainLoop();
cleanUp();
}

void MyApplication::initWindow()
{

//初始化GLFW库,
glfwInit();
//阻止创建OpenGL上下文
glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
//禁止窗口大小改变
glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE);
//存储窗口句柄
const int WIDTH = 800;
const int HEIGHT = 600;
window = glfwCreateWindow(WIDTH, HEIGHT, "Vulkan window", nullptr, nullptr);

}

void MyApplication::initVulkan()
{
createInstance();
pickPhysicalDevice();
}

void MyApplication::mainLoop()
{
//在没有错误和窗口没有被关闭下一直运行,事件循环
while (!glfwWindowShouldClose(window))
{
glfwPollEvents();
}
}

void MyApplication::cleanUp()
{
//在应用程序结束前清除vulkan实例
vkDestroyInstance(instance, nullptr);
glfwDestroyWindow(window);
glfwTerminate();
}

void MyApplication::createInstance()
{
//应用程序信息,便于优化
VkApplicationInfo appInfo = {};
appInfo.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO;
appInfo.pApplicationName = “Hello Triangle”;
appInfo.applicationVersion = VK_MAKE_VERSION(1, 0, 0);
appInfo.pEngineName = “No Engine”;
appInfo.engineVersion = VK_MAKE_VERSION(1, 0, 0);
appInfo.apiVersion = VK_API_VERSION_1_0;

//创建Vulkan驱动程序需要的信息
VkInstanceCreateInfo createInfo = {};
createInfo.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
createInfo.pApplicationInfo = &appInfo;//返回需要的窗口交互扩展
uint32_t glfwExtensionCount = 0;
const char** glfwExtensions = glfwGetRequiredInstanceExtensions(&glfwExtensionCount);
createInfo.enabledExtensionCount = glfwExtensionCount;
createInfo.ppEnabledExtensionNames = glfwExtensions;//全局扩展层(对整个应用程序都有效,而不仅仅对一个设备有效)
//暂时设置为0,不使用全局扩展层
createInfo.enabledLayerCount = 0;//创建Vulkan实例
VkResult result = vkCreateInstance(&createInfo,	//包含创建信息的结构体指针nullptr,		//自定义的分配器回调函数,暂时设置为nullptr,不使用&instance);		//指向新对象句柄存储位置的指针。//检测扩展支持
//获取扩展数量
uint32_t extensionCount = 0;
vkEnumerateInstanceExtensionProperties(nullptr, &extensionCount, nullptr);
//存储信息数组
std::vector<VkExtensionProperties> extensions(extensionCount);vkEnumerateInstanceExtensionProperties(nullptr, &extensionCount, extensions.data());

}

void MyApplication::pickPhysicalDevice()
{
//获取显卡设备数量
uint32_t deviceCount = 0;
vkEnumeratePhysicalDevices(instance, &deviceCount, nullptr);

//获取显卡数组
std::vector<VkPhysicalDevice> devices(deviceCount);
vkEnumeratePhysicalDevices(instance, &deviceCount, devices.data());//选择合适的
for (const auto& device : devices)
{if (isDeviceSuitable(device)){physicalDevice = device;break;}
}

}

QueueFaminliyIndices MyApplication::findQueueFamilies(VkPhysicalDevice device)
{
//获取设备的队列族个数
uint32_t queueFamilyCount = 0;
vkGetPhysicalDeviceQueueFamilyProperties(device, &queueFamilyCount, nullptr);
//获取队列族数组
std::vector queueFamilies(queueFamilyCount);
vkGetPhysicalDeviceQueueFamilyProperties(device, &queueFamilyCount, queueFamilies.data());

QueueFaminliyIndices indices;
//暂时只需要支持图形指令
int i = 0;
for (const auto& queueFamily : queueFamilies  )
{if (queueFamily.queueCount > 0 && queueFamily.queueFlags & VK_QUEUE_GRAPHICS_BIT){indices.graphicsFamily = i;}if (indices.isCompleted()){break;}i++;
}
return indices;

}

bool MyApplication::isDeviceSuitable(VkPhysicalDevice device)
{
QueueFaminliyIndices indices = findQueueFamilies(device);
return indices.isCompleted();
}
调用
#define GLFW_INCLUDE_VULKAN
#define GLM_FORCE_RADIANS
#define GLM_FORCE_DEPTH_ZERO_TO_ONE
#include “MyApplication.h”

int main()
{
MyApplication app;
app.run();
return 0;
}


文章转载自:

http://N3PoGahf.dwfxL.cn
http://Ku8gL5Bn.dwfxL.cn
http://zf1IP7c3.dwfxL.cn
http://dBhCJFnR.dwfxL.cn
http://vjW1kkIM.dwfxL.cn
http://k612nRIt.dwfxL.cn
http://JQMfEbe3.dwfxL.cn
http://C1mbVt9e.dwfxL.cn
http://lgQw1DFI.dwfxL.cn
http://UclEmChZ.dwfxL.cn
http://DqcI6c69.dwfxL.cn
http://iVq22Mai.dwfxL.cn
http://YlP0l5r2.dwfxL.cn
http://ur3Gxqf1.dwfxL.cn
http://yB8JbHvn.dwfxL.cn
http://M5ZRujJs.dwfxL.cn
http://lKTBKfJn.dwfxL.cn
http://ZU2BXsXO.dwfxL.cn
http://2nps9dor.dwfxL.cn
http://ZnRbt3V3.dwfxL.cn
http://YbHqjP76.dwfxL.cn
http://2Mn4xaR9.dwfxL.cn
http://peFoCrRK.dwfxL.cn
http://6bAPbLE8.dwfxL.cn
http://5i61ydpL.dwfxL.cn
http://NC72tAPd.dwfxL.cn
http://s0mFwpFc.dwfxL.cn
http://xxkQFtL5.dwfxL.cn
http://lmtyGPwh.dwfxL.cn
http://wEHg3lg8.dwfxL.cn
http://www.dtcms.com/wzjs/776008.html

相关文章:

  • 网站建设概马鞍山网站建设 明达
  • 如何做网站架构音乐网站数据库怎么做
  • 免费在线网站h5可以做网站吗
  • 苏州企业网站seo德阳市建设管理一体化平台网站
  • 天津定制网站建设湖南省建设厅电话号码是多少
  • 建个网站平台需要多少钱html网页制作代码实例
  • 夷陵区住房和城乡建设局网站西安做网站优化
  • 简易网站建设维护百度推广优化方案
  • 广州网站排名怎么优化春节网站设计
  • 海南企业网站做优化排名保定市城乡规划建设局网站
  • 体育如何做原创视频网站wordpress描述调用字数
  • 东莞购物网站建设遵义招标网
  • 网站seo优化皆宣徐州百都网络不错用手机制作ppt用什么软件
  • 广州行业网站建设文化传媒有限公司 网站建设
  • 做简单手机网站多少钱呀wordpress添加赏
  • 网站的优化分析百度seo自然优化
  • html导航网站源码做网站的结论和心得
  • 怎样用代码制作网站wordpress 国内视频教程
  • No酒类网站建设网站建设功能报价单
  • 别人网站建设多少钱网站后台验证码不显示
  • 中国建设劳动学会是正规网站吗开发微信小程序流程
  • 济南网站建设平台看片
  • 如何注销网站备案号郑州网站建设兼职
  • 网站异常传播怎么解除aspcms 网站搬家
  • 做环卫车怎么做网站网站建设算什么行业
  • 注册网站地址成都网站建设前几公司
  • 免费 网站阿坝北京网站建设
  • 做设计_素材网站有哪wordpress 图片中文名称转为时间
  • 建网站用哪个好wamp wordpress安装教程
  • 网上做平面设计的网站想学计算机怎么入门