move ellipse component type to specialization
This commit is contained in:
parent
e420ab1ef7
commit
e86f4cdd45
2 changed files with 13 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
|||
#version 450
|
||||
|
||||
int PTK_COMPONENT_TYPE_ELLIPSE = 3;
|
||||
layout(constant_id = 0) const int PTK_COMPONENT_TYPE_ELLIPSE = 0;
|
||||
|
||||
layout(location = 0) in vec3 fragColor;
|
||||
layout(location = 1) flat in int shapeType;
|
||||
|
|
|
@ -756,6 +756,17 @@ bool create_graphics_pipeline(void) {
|
|||
return false;
|
||||
}
|
||||
|
||||
VkSpecializationInfo spec_info = {
|
||||
.mapEntryCount = 1,
|
||||
.pMapEntries = &(VkSpecializationMapEntry){
|
||||
.constantID = 0,
|
||||
.offset = 0,
|
||||
.size = sizeof(int),
|
||||
},
|
||||
.dataSize = sizeof(int),
|
||||
.pData = &(int){PTK_COMPONENT_TYPE_ELLIPSE},
|
||||
};
|
||||
|
||||
VkPipelineShaderStageCreateInfo shader_stages[] = {
|
||||
(VkPipelineShaderStageCreateInfo){
|
||||
.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO,
|
||||
|
@ -773,7 +784,7 @@ bool create_graphics_pipeline(void) {
|
|||
.stage = VK_SHADER_STAGE_FRAGMENT_BIT,
|
||||
.module = frag_shader_module.value,
|
||||
.pName = "main",
|
||||
.pSpecializationInfo = NULL,
|
||||
.pSpecializationInfo = &spec_info,
|
||||
},
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue