mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 12:52:46 +00:00
5eb1afdcb3
The prototypes for handle parsers needed to be changes because it turned out "single" was inappropriate for handles as "single" allocates memory for the parsed object, but handles must be written directly.
195 lines
4.5 KiB
Text
195 lines
4.5 KiB
Text
{
|
|
shaderModules = {
|
|
// specify shader modules to load into memory
|
|
// key is the name of the module for referecy by the pipeline
|
|
// value the path to the spv file to load
|
|
// $shader refers to the shader install path
|
|
// $builtin refers to compiled-in shaders
|
|
passthrough = $builtin/passthrough.vert;
|
|
pushcolor = $builtin/pushcolor.frag;
|
|
};
|
|
setLayouts = {
|
|
something = {
|
|
flags = 0;
|
|
bindings = (
|
|
{
|
|
binding = 0;
|
|
descriptorType = sampled_image;
|
|
descriptorCount = 1;
|
|
stageFlags = fragment;
|
|
},
|
|
{
|
|
binding = 1;
|
|
descriptorType = uniform_buffer;
|
|
descriptorCount = 1;
|
|
stageFlags = vertex;
|
|
},
|
|
);
|
|
};
|
|
};
|
|
pipelineLayouts = {
|
|
something = {
|
|
setLayouts = (something);
|
|
pushConstantRanges = (
|
|
{
|
|
stageFlags = fragment;
|
|
offset = 0;
|
|
size = "4 * 4";
|
|
},
|
|
);
|
|
};
|
|
};
|
|
pipeline = {
|
|
stages = (
|
|
{ stage = vertex; name = main; module = passthrough; },
|
|
{ stage = fragment; name = main; module = pushcolor; },
|
|
);
|
|
vertexInput = {
|
|
bindings = (
|
|
{
|
|
binding = 0;
|
|
stride = "4 * 4";
|
|
inputRate = vertex;
|
|
},
|
|
);
|
|
attributes = (
|
|
{
|
|
location = 0;
|
|
binding = 0;
|
|
format = r32g32b32a32_sfloat;
|
|
offset = 0;
|
|
},
|
|
);
|
|
};
|
|
inputAssembly = {
|
|
topology = triangle_list;
|
|
primitiveRestartEnable = 0;
|
|
};
|
|
viewport = {
|
|
viewports = (
|
|
{
|
|
x = 0; y = 0;
|
|
width = 640; height = 480;
|
|
minDepth = 0; maxDepth = 1;
|
|
}
|
|
);
|
|
scissors = (
|
|
{
|
|
offset = { x = 0; y = 0 };
|
|
extent = { width = 640; height = 480; };
|
|
},
|
|
);
|
|
};
|
|
rasterization = {
|
|
depthClampEnable = 0;
|
|
rasterizerDiscardEnable = 0;
|
|
polygonMode = fill;
|
|
cullMode = back;
|
|
frontFace = counter_clockwise;
|
|
depthBiasEnable = 0;
|
|
lineWidth = 1;
|
|
};
|
|
multisample = {
|
|
rasterizationSamples = $msaaSamples;
|
|
sampleShadingEnable = 0;
|
|
minSampleShading = 0.5f;
|
|
alphaToCoverageEnable = 0;
|
|
alphaToOneEnable = 0;
|
|
};
|
|
depthStencil = {
|
|
depthTestEnable = 1;
|
|
depthWriteEnable = 1;
|
|
depthCompareOp = less;
|
|
depthBoundsTestEnable = 0;
|
|
stencilTestEnable = 0;
|
|
};
|
|
colorBlend = {
|
|
logicOpEnable = 0;
|
|
attachments = ({
|
|
blendEnable = 0;
|
|
srcColorBlendFactor = src_color;
|
|
dstColorBlendFactor = zero;
|
|
colorBlendOp = add;
|
|
srcAlphaBlendFactor = src_alpha;
|
|
dstAlphaBlendFactor = zero;
|
|
alphaBlendOp = add;
|
|
colorWriteMask = r|g|b|a;
|
|
});
|
|
};
|
|
dynamic = {
|
|
dynamicState = ( viewport, scissor );
|
|
};
|
|
layout = something;
|
|
//renderPass = renderpass;
|
|
};
|
|
renderpass = {
|
|
attachments = (
|
|
{
|
|
flags = 0;
|
|
format = $swapchain.format;
|
|
samples = $msaaSamples;
|
|
loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR;
|
|
storeOp = VK_ATTACHMENT_STORE_OP_STORE;
|
|
stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
|
|
stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
|
|
initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
|
|
finalLayout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
|
|
},
|
|
{
|
|
flags = 0;
|
|
format = VK_FORMAT_D32_SFLOAT;
|
|
samples = $msaaSamples;
|
|
loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR;
|
|
storeOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
|
|
stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
|
|
stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
|
|
initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
|
|
finalLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
|
|
},
|
|
{
|
|
flags = 0;
|
|
format = $swapchain.format;
|
|
samples = VK_SAMPLE_COUNT_1_BIT;
|
|
loadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
|
|
storeOp = VK_ATTACHMENT_STORE_OP_STORE;
|
|
stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
|
|
stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
|
|
initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
|
|
finalLayout = VK_IMAGE_LAYOUT_PRESENT_SRC_KHR;
|
|
},
|
|
);
|
|
subpasses = (
|
|
{
|
|
pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS;
|
|
colorAttachments = (
|
|
{
|
|
attachment = 0;
|
|
layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
|
|
}
|
|
);
|
|
resolveAttachments = (
|
|
{
|
|
attachment = 2;
|
|
layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
|
|
}
|
|
);
|
|
depthStencilAttachment = {
|
|
attachment = 1;
|
|
layout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
|
|
};
|
|
preserveAttachments = ();
|
|
},
|
|
);
|
|
dependencies = (
|
|
{
|
|
srcSubpass = VK_SUBPASS_EXTERNAL;
|
|
dstSubpass = 0;
|
|
srcStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
|
|
dstStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
|
|
srcAccessMask = 0;
|
|
dstAccessMask = "VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT";
|
|
dependencyFlags = 0;
|
|
}
|
|
);
|
|
};
|
|
}
|