我有两个片段着色器(用GLSL编写),两者都带有一组采样器。其他绑定是相同的,但是,数组之间的大小不同:
layout (binding = 2) uniform sampler2D tex[4];
VS
VkDescriptorSetLayout
我可以使用与此参数匹配的VkDescriptorSetLayoutBinding
创建VkDescriptorSetLayoutBinding parameter;
memset(¶meter, 0, sizeof(VkDescriptorSetLayoutBinding));
parameter.binding = 2;
parameter.descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER;
parameter.descriptorCount = 4;
parameter.stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT;
// go on to call vkCreateDescriptorSetLayout with this VkDescriptorSetBinding (and others)
:
VkDescriptorSetLayout
创建的VkDescriptorSet
将正确运行以绑定到两个着色器。
两个问题:
未使用的描述符的唯一含义是任何public function actionGet_loyalty() {
$model = \common\models\staffs\TblStaff::find()->all();
$string = "<table class='table table-striped'><tr><th>Name</th><th>Number of Years</th></tr>";
foreach ($model as $row) {
//What I added
foreach($row->tblStaff2 as $value){
$first_day = $value->first_day_service;
//Here is where it stopped
$midname = ucwords($row->midname);
$name = ucwords($row->firstname) . " " . $midname[0] . ". " . ucwords($row->lastname);
$string.="<tr>"
. "<td>" . $name . "</td>"
. "<td>" . $first_day . "</td>"
. "</tr>";
}
}
$string.="</table>";
return $string;
}
是否大于必要(在第一个着色器的数组的情况下)?
额外分配的描述符是否是一个大的性能和/或内存问题?