{
struct spirv_shader *ret = NULL;
- struct ntv_context ctx = {};
+ struct ntv_context ctx = {0};
ctx.mem_ctx = ralloc_context(NULL);
ctx.builder.mem_ctx = ctx.mem_ctx;
assert(spirv_version >= SPIRV_VERSION(1, 0));
struct zink_screen *screen = zink_screen(ctx->base.screen);
struct zink_batch_state *bs = rzalloc(NULL, struct zink_batch_state);
bs->have_timelines = ctx->have_timelines;
- VkCommandPoolCreateInfo cpci = {};
+ VkCommandPoolCreateInfo cpci = {0};
cpci.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO;
cpci.queueFamilyIndex = screen->gfx_queue;
cpci.flags = VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT;
if (vkCreateCommandPool(screen->dev, &cpci, NULL, &bs->cmdpool) != VK_SUCCESS)
goto fail;
- VkCommandBufferAllocateInfo cbai = {};
+ VkCommandBufferAllocateInfo cbai = {0};
cbai.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO;
cbai.commandPool = bs->cmdpool;
cbai.level = VK_COMMAND_BUFFER_LEVEL_PRIMARY;
if (!screen->batch_descriptor_init(screen, bs))
goto fail;
- VkFenceCreateInfo fci = {};
+ VkFenceCreateInfo fci = {0};
fci.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO;
if (vkCreateFence(screen->dev, &fci, NULL, &bs->fence.fence) != VK_SUCCESS)
{
zink_reset_batch(ctx, batch);
- VkCommandBufferBeginInfo cbbi = {};
+ VkCommandBufferBeginInfo cbbi = {0};
cbbi.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO;
cbbi.flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT;
if (vkBeginCommandBuffer(batch->state->cmdbuf, &cbbi) != VK_SUCCESS)
submit_queue(void *data, int thread_index)
{
struct zink_batch_state *bs = data;
- VkSubmitInfo si = {};
+ VkSubmitInfo si = {0};
uint64_t batch_id = bs->fence.batch_id;
si.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO;
si.waitSemaphoreCount = 0;
};
si.pCommandBuffers = bs->has_barriers ? cmdbufs : &cmdbufs[1];
- VkTimelineSemaphoreSubmitInfo tsi = {};
+ VkTimelineSemaphoreSubmitInfo tsi = {0};
if (bs->have_timelines) {
tsi.sType = VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO;
si.pNext = &tsi;
static void
copy_scanout(struct zink_context *ctx, struct zink_resource *res)
{
- VkImageCopy region = {};
+ VkImageCopy region = {0};
struct pipe_box box = {0, 0, 0,
u_minify(res->base.b.width0, 0),
u_minify(res->base.b.height0, 0), res->base.b.array_size};
zink_resource_setup_transfer_layouts(ctx, src, dst);
- VkImageResolve region = {};
+ VkImageResolve region = {0};
region.srcSubresource.aspectMask = src->aspect;
region.srcSubresource.mipLevel = info->src.level;
if (info->dst.resource->target == PIPE_BUFFER)
util_range_add(info->dst.resource, &dst->valid_buffer_range,
info->dst.box.x, info->dst.box.x + info->dst.box.width);
- VkImageBlit region = {};
+ VkImageBlit region = {0};
region.srcSubresource.aspectMask = src->aspect;
region.srcSubresource.mipLevel = info->src.level;
region.srcOffsets[0].x = info->src.box.x;
++num_attachments;
}
- VkClearRect cr = {};
+ VkClearRect cr = {0};
if (scissor_state) {
cr.rect.offset.x = scissor_state->minx;
cr.rect.offset.y = scissor_state->miny;
clear_color_no_rp(struct zink_context *ctx, struct zink_resource *res, const union pipe_color_union *pcolor, unsigned level, unsigned layer, unsigned layerCount)
{
struct zink_batch *batch = zink_batch_no_rp(ctx);
- VkImageSubresourceRange range = {};
+ VkImageSubresourceRange range = {0};
range.baseMipLevel = level;
range.levelCount = 1;
range.baseArrayLayer = layer;
clear_zs_no_rp(struct zink_context *ctx, struct zink_resource *res, VkImageAspectFlags aspects, double depth, unsigned stencil, unsigned level, unsigned layer, unsigned layerCount)
{
struct zink_batch *batch = zink_batch_no_rp(ctx);
- VkImageSubresourceRange range = {};
+ VkImageSubresourceRange range = {0};
range.baseMipLevel = level;
range.levelCount = 1;
range.baseArrayLayer = layer;
clear = last_clear;
}
if (!clear) {
- struct zink_framebuffer_clear_data cd = {};
+ struct zink_framebuffer_clear_data cd = {0};
util_dynarray_append(&fb_clear->clears, struct zink_framebuffer_clear_data, cd);
clear = zink_fb_clear_element(fb_clear, zink_fb_clear_count(fb_clear) - 1);
}
update_so_info(struct zink_shader *zs, const struct pipe_stream_output_info *so_info,
uint64_t outputs_written, bool have_psiz)
{
- uint8_t reverse_map[64] = {};
+ uint8_t reverse_map[64] = {0};
unsigned slot = 0;
/* semi-copied from iris */
while (outputs_written) {
}
}
- VkShaderModuleCreateInfo smci = {};
+ VkShaderModuleCreateInfo smci = {0};
smci.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO;
smci.codeSize = spirv->num_words * sizeof(uint32_t);
smci.pCode = spirv->words;
nir_shader *nir = nirptr;
if (!screen->info.feats.features.shaderImageGatherExtended) {
- nir_lower_tex_options tex_opts = {};
+ nir_lower_tex_options tex_opts = {0};
tex_opts.lower_tg4_offsets = true;
NIR_PASS_V(nir, nir_lower_tex, &tex_opts);
}
struct zink_screen *screen = zink_screen(pctx->screen);
bool need_custom = false;
- VkSamplerCreateInfo sci = {};
- VkSamplerCustomBorderColorCreateInfoEXT cbci = {};
+ VkSamplerCreateInfo sci = {0};
+ VkSamplerCustomBorderColorCreateInfoEXT cbci = {0};
sci.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO;
sci.magFilter = zink_filter(state->mag_img_filter);
sci.minFilter = zink_filter(state->min_img_filter);
{
struct zink_screen *screen = zink_screen(ctx->base.screen);
struct zink_buffer_view *buffer_view = NULL;
- VkBufferViewCreateInfo bvci = {};
+ VkBufferViewCreateInfo bvci = {0};
bvci.sType = VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO;
bvci.buffer = res->obj->buffer;
bvci.format = zink_get_format(screen, format);
if (state->target != PIPE_BUFFER) {
VkImageViewCreateInfo ivci;
- struct pipe_surface templ = {};
+ struct pipe_surface templ = {0};
templ.u.tex.level = state->u.tex.first_level;
templ.format = state->format;
if (state->target != PIPE_TEXTURE_3D) {
zink_resource_buffer_barrier(ctx, NULL, res, access,
zink_pipeline_flags_from_stage(zink_shader_stage(p_stage)));
} else {
- struct pipe_surface tmpl = {};
+ struct pipe_surface tmpl = {0};
tmpl.format = images[i].format;
tmpl.nr_samples = 1;
tmpl.u.tex.level = images[i].u.tex.level;
get_framebuffer(struct zink_context *ctx)
{
struct zink_screen *screen = zink_screen(ctx->base.screen);
- struct pipe_surface *attachments[PIPE_MAX_COLOR_BUFS + 1] = {};
+ struct pipe_surface *attachments[PIPE_MAX_COLOR_BUFS + 1] = {0};
- struct zink_framebuffer_state state = {};
+ struct zink_framebuffer_state state = {0};
for (int i = 0; i < ctx->fb_state.nr_cbufs; i++) {
struct pipe_surface *psurf = ctx->fb_state.cbufs[i];
state.attachments[i] = psurf ? zink_surface(psurf)->image_view : VK_NULL_HANDLE;
struct zink_batch *batch = &ctx->batch;
struct pipe_framebuffer_state *fb_state = &ctx->fb_state;
- VkRenderPassBeginInfo rpbi = {};
+ VkRenderPassBeginInfo rpbi = {0};
rpbi.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO;
rpbi.renderPass = ctx->gfx_pipeline_state.render_pass->render_pass;
rpbi.renderArea.offset.x = 0;
rpbi.renderArea.extent.width = fb_state->width;
rpbi.renderArea.extent.height = fb_state->height;
- VkClearValue clears[PIPE_MAX_COLOR_BUFS + 1] = {};
+ VkClearValue clears[PIPE_MAX_COLOR_BUFS + 1] = {0};
unsigned clear_buffers = 0;
uint32_t clear_validate = 0;
for (int i = 0; i < fb_state->nr_cbufs; i++) {
util_range_add(&dst->base.b, &dst->valid_buffer_range, dstx, dstx + src_box->width);
}
- VkBufferImageCopy region = {};
+ VkBufferImageCopy region = {0};
region.bufferOffset = buf2img ? src_box->x : dstx;
region.bufferRowLength = 0;
region.bufferImageHeight = 0;
struct zink_resource *src = zink_resource(psrc);
struct zink_context *ctx = zink_context(pctx);
if (dst->base.b.target != PIPE_BUFFER && src->base.b.target != PIPE_BUFFER) {
- VkImageCopy region = {};
+ VkImageCopy region = {0};
if (util_format_get_num_planes(src->base.b.format) == 1 &&
util_format_get_num_planes(dst->base.b.format) == 1) {
/* If neither the calling command’s srcImage nor the calling command’s dstImage
util_dynarray_init(&pool->alloc_desc_sets, NULL);
- VkDescriptorPoolCreateInfo dpci = {};
+ VkDescriptorPoolCreateInfo dpci = {0};
dpci.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO;
dpci.pPoolSizes = sizes;
dpci.poolSizeCount = num_type_sizes;
descriptor_layout_create(struct zink_screen *screen, enum zink_descriptor_type t, VkDescriptorSetLayoutBinding *bindings, unsigned num_bindings)
{
VkDescriptorSetLayout dsl;
- VkDescriptorSetLayoutCreateInfo dcslci = {};
+ VkDescriptorSetLayoutCreateInfo dcslci = {0};
dcslci.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO;
dcslci.pNext = NULL;
- VkDescriptorSetLayoutBindingFlagsCreateInfo fci = {};
+ VkDescriptorSetLayoutBindingFlagsCreateInfo fci = {0};
VkDescriptorBindingFlags flags[num_bindings];
if (screen->lazy_descriptors) {
/* FIXME */
zink_descriptor_program_init(struct zink_context *ctx, struct zink_program *pg)
{
VkDescriptorSetLayoutBinding bindings[ZINK_DESCRIPTOR_TYPES][PIPE_SHADER_TYPES * 32];
- unsigned num_bindings[ZINK_DESCRIPTOR_TYPES] = {};
+ unsigned num_bindings[ZINK_DESCRIPTOR_TYPES] = {0};
- VkDescriptorPoolSize sizes[6] = {};
+ VkDescriptorPoolSize sizes[6] = {0};
int type_map[12];
unsigned num_types = 0;
memset(type_map, -1, sizeof(type_map));
sizes[i].descriptorCount *= ZINK_DEFAULT_MAX_DESCS;
bool found_descriptors = false;
- struct zink_descriptor_layout_key *layout_key[ZINK_DESCRIPTOR_TYPES] = {};
+ struct zink_descriptor_layout_key *layout_key[ZINK_DESCRIPTOR_TYPES] = {0};
for (unsigned i = ZINK_DESCRIPTOR_TYPES - 1; i < ZINK_DESCRIPTOR_TYPES; i--) {
if (!num_bindings[i]) {
if (!found_descriptors)
}
found_descriptors = true;
- VkDescriptorPoolSize type_sizes[2] = {};
+ VkDescriptorPoolSize type_sizes[2] = {0};
int num_type_sizes = 0;
switch (i) {
case ZINK_DESCRIPTOR_TYPE_UBO:
if (!num_bindings && !push_count)
return true;
- VkDescriptorUpdateTemplateCreateInfo template[2] = {};
+ VkDescriptorUpdateTemplateCreateInfo template[2] = {0};
VkDescriptorUpdateTemplateType types[2] = {
VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET,
have_push ? VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_PUSH_DESCRIPTORS_KHR : VK_DESCRIPTOR_UPDATE_TEMPLATE_TYPE_DESCRIPTOR_SET
create_pool(struct zink_screen *screen, unsigned num_type_sizes, VkDescriptorPoolSize *sizes, unsigned flags)
{
VkDescriptorPool pool;
- VkDescriptorPoolCreateInfo dpci = {};
+ VkDescriptorPoolCreateInfo dpci = {0};
dpci.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO;
dpci.pPoolSizes = sizes;
dpci.poolSizeCount = num_type_sizes;
// check for device properties
if (screen->vk.GetPhysicalDeviceProperties2) {
- VkPhysicalDeviceProperties2 props = {};
+ VkPhysicalDeviceProperties2 props = {0};
props.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
%for version in versions:
struct zink_context *ctx = zink_context(pctx);
struct zink_screen *screen = zink_screen(pctx->screen);
struct zink_batch *batch = &ctx->batch;
- VkBuffer buffers[PIPE_MAX_SO_OUTPUTS] = {};
- VkDeviceSize buffer_offsets[PIPE_MAX_SO_OUTPUTS] = {};
- VkDeviceSize buffer_sizes[PIPE_MAX_SO_OUTPUTS] = {};
+ VkBuffer buffers[PIPE_MAX_SO_OUTPUTS] = {0};
+ VkDeviceSize buffer_offsets[PIPE_MAX_SO_OUTPUTS] = {0};
+ VkDeviceSize buffer_sizes[PIPE_MAX_SO_OUTPUTS] = {0};
for (unsigned i = 0; i < ctx->num_so_targets; i++) {
struct zink_so_target *t = (struct zink_so_target *)ctx->so_targets[i];
goto out;
}
- VkFramebufferCreateInfo fci = {};
+ VkFramebufferCreateInfo fci = {0};
fci.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO;
fci.renderPass = rp->render_pass;
fci.attachmentCount = fb->state.num_attachments;
}
%endfor
- VkApplicationInfo ai = {};
+ VkApplicationInfo ai = {0};
ai.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO;
char proc_name[128];
ai.pEngineName = "mesa zink";
ai.apiVersion = instance_info->loader_version;
- VkInstanceCreateInfo ici = {};
+ VkInstanceCreateInfo ici = {0};
ici.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
ici.pApplicationInfo = &ai;
ici.ppEnabledExtensionNames = extensions;
struct zink_gfx_pipeline_state *state,
VkPrimitiveTopology primitive_topology)
{
- VkPipelineVertexInputStateCreateInfo vertex_input_state = {};
+ VkPipelineVertexInputStateCreateInfo vertex_input_state = {0};
vertex_input_state.sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO;
vertex_input_state.pVertexBindingDescriptions = state->element_state->bindings;
vertex_input_state.vertexBindingDescriptionCount = state->element_state->num_bindings;
vertex_input_state.pVertexAttributeDescriptions = state->element_state->attribs;
vertex_input_state.vertexAttributeDescriptionCount = state->element_state->num_attribs;
- VkPipelineVertexInputDivisorStateCreateInfoEXT vdiv_state = {};
+ VkPipelineVertexInputDivisorStateCreateInfoEXT vdiv_state = {0};
if (state->element_state->divisors_present) {
vertex_input_state.pNext = &vdiv_state;
vdiv_state.sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT;
vdiv_state.pVertexBindingDivisors = state->element_state->divisors;
}
- VkPipelineInputAssemblyStateCreateInfo primitive_state = {};
+ VkPipelineInputAssemblyStateCreateInfo primitive_state = {0};
primitive_state.sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO;
primitive_state.topology = primitive_topology;
switch (primitive_topology) {
primitive_state.primitiveRestartEnable = state->primitive_restart ? VK_TRUE : VK_FALSE;
}
- VkPipelineColorBlendStateCreateInfo blend_state = {};
+ VkPipelineColorBlendStateCreateInfo blend_state = {0};
blend_state.sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO;
blend_state.pAttachments = state->blend_state->attachments;
blend_state.attachmentCount = state->num_attachments;
blend_state.logicOpEnable = state->blend_state->logicop_enable;
blend_state.logicOp = state->blend_state->logicop_func;
- VkPipelineMultisampleStateCreateInfo ms_state = {};
+ VkPipelineMultisampleStateCreateInfo ms_state = {0};
ms_state.sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO;
ms_state.rasterizationSamples = state->rast_samples;
ms_state.alphaToCoverageEnable = state->blend_state->alpha_to_coverage;
ms_state.minSampleShading = 1.0;
}
- VkPipelineViewportStateCreateInfo viewport_state = {};
+ VkPipelineViewportStateCreateInfo viewport_state = {0};
viewport_state.sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO;
viewport_state.viewportCount = state->num_viewports;
viewport_state.pViewports = NULL;
viewport_state.scissorCount = state->num_viewports;
viewport_state.pScissors = NULL;
- VkPipelineRasterizationStateCreateInfo rast_state = {};
+ VkPipelineRasterizationStateCreateInfo rast_state = {0};
rast_state.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO;
rast_state.depthClampEnable = state->rast_state->depth_clamp;
rast_state.pNext = &pv_state;
}
- VkPipelineDepthStencilStateCreateInfo depth_stencil_state = {};
+ VkPipelineDepthStencilStateCreateInfo depth_stencil_state = {0};
depth_stencil_state.sType = VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO;
depth_stencil_state.depthTestEnable = state->depth_stencil_alpha_state->depth_test;
depth_stencil_state.depthCompareOp = state->depth_stencil_alpha_state->depth_compare_op;
dynamicStateEnables[state_count++] = VK_DYNAMIC_STATE_SCISSOR;
}
- VkPipelineDynamicStateCreateInfo pipelineDynamicStateCreateInfo = {};
+ VkPipelineDynamicStateCreateInfo pipelineDynamicStateCreateInfo = {0};
pipelineDynamicStateCreateInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO;
pipelineDynamicStateCreateInfo.pDynamicStates = dynamicStateEnables;
pipelineDynamicStateCreateInfo.dynamicStateCount = state_count;
- VkGraphicsPipelineCreateInfo pci = {};
+ VkGraphicsPipelineCreateInfo pci = {0};
pci.sType = VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO;
pci.layout = prog->base.layout;
pci.renderPass = state->render_pass->render_pass;
pci.pDepthStencilState = &depth_stencil_state;
pci.pDynamicState = &pipelineDynamicStateCreateInfo;
- VkPipelineTessellationStateCreateInfo tci = {};
- VkPipelineTessellationDomainOriginStateCreateInfo tdci = {};
+ VkPipelineTessellationStateCreateInfo tci = {0};
+ VkPipelineTessellationDomainOriginStateCreateInfo tdci = {0};
if (prog->shaders[PIPE_SHADER_TESS_CTRL] && prog->shaders[PIPE_SHADER_TESS_EVAL]) {
tci.sType = VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO;
tci.patchControlPoints = state->vertices_per_patch;
if (!prog->modules[i])
continue;
- VkPipelineShaderStageCreateInfo stage = {};
+ VkPipelineShaderStageCreateInfo stage = {0};
stage.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO;
stage.stage = zink_shader_stage(i);
stage.module = prog->modules[i]->shader;
VkPipeline
zink_create_compute_pipeline(struct zink_screen *screen, struct zink_compute_program *comp, struct zink_compute_pipeline_state *state)
{
- VkComputePipelineCreateInfo pci = {};
+ VkComputePipelineCreateInfo pci = {0};
pci.sType = VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO;
pci.layout = comp->base.layout;
- VkPipelineShaderStageCreateInfo stage = {};
+ VkPipelineShaderStageCreateInfo stage = {0};
stage.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO;
stage.stage = VK_SHADER_STAGE_COMPUTE_BIT;
stage.module = comp->module->shader;
stage.pName = "main";
- VkSpecializationInfo sinfo = {};
+ VkSpecializationInfo sinfo = {0};
VkSpecializationMapEntry me[3];
if (state->use_local_size) {
stage.pSpecializationInfo = &sinfo;
{
gl_shader_stage stage = zs->nir->info.stage;
enum pipe_shader_type pstage = pipe_shader_type_from_mesa(stage);
- struct zink_shader_key key = {};
+ struct zink_shader_key key = {0};
VkShaderModule mod;
struct zink_shader_module *zm;
struct zink_shader_module **default_zm = NULL;
VkPipelineLayout
zink_pipeline_layout_create(struct zink_screen *screen, struct zink_program *pg)
{
- VkPipelineLayoutCreateInfo plci = {};
+ VkPipelineLayoutCreateInfo plci = {0};
plci.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO;
plci.pSetLayouts = pg->dsl;
plci.setLayoutCount = pg->num_dsl;
- VkPushConstantRange pcr[2] = {};
+ VkPushConstantRange pcr[2] = {0};
if (pg->is_compute) {
if (((struct zink_compute_program*)pg)->shader->nir->info.stage == MESA_SHADER_KERNEL) {
pcr[0].stageFlags = VK_SHADER_STAGE_COMPUTE_BIT;
{
struct zink_screen *screen = zink_screen(pctx->screen);
struct zink_query *query = CALLOC_STRUCT(zink_query);
- VkQueryPoolCreateInfo pool_create = {};
+ VkQueryPoolCreateInfo pool_create = {0};
if (!query)
return NULL;
VkConditionalRenderingFlagsEXT begin_flags = 0;
if (ctx->render_condition.inverted)
begin_flags = VK_CONDITIONAL_RENDERING_INVERTED_BIT_EXT;
- VkConditionalRenderingBeginInfoEXT begin_info = {};
+ VkConditionalRenderingBeginInfoEXT begin_info = {0};
begin_info.sType = VK_STRUCTURE_TYPE_CONDITIONAL_RENDERING_BEGIN_INFO_EXT;
begin_info.buffer = ctx->render_condition.query->predicate->obj->buffer;
begin_info.flags = begin_flags;
struct zink_screen *screen = zink_screen(pctx->screen);
uint64_t timestamp, deviation;
assert(screen->info.have_EXT_calibrated_timestamps);
- VkCalibratedTimestampInfoEXT cti = {};
+ VkCalibratedTimestampInfoEXT cti = {0};
cti.sType = VK_STRUCTURE_TYPE_CALIBRATED_TIMESTAMP_INFO_EXT;
cti.timeDomain = VK_TIME_DOMAIN_DEVICE_EXT;
screen->vk.GetCalibratedTimestampsEXT(screen->dev, 1, &cti, ×tamp, &deviation);
[1] = {0, VK_SUBPASS_EXTERNAL, dep_pipeline, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, dep_access, 0, VK_DEPENDENCY_BY_REGION_BIT}
};
- VkSubpassDescription subpass = {};
+ VkSubpassDescription subpass = {0};
subpass.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS;
subpass.colorAttachmentCount = state->num_cbufs;
subpass.pColorAttachments = color_refs;
subpass.pDepthStencilAttachment = state->have_zsbuf ? &zs_ref : NULL;
- VkRenderPassCreateInfo rpci = {};
+ VkRenderPassCreateInfo rpci = {0};
rpci.sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO;
rpci.attachmentCount = num_attachments;
rpci.pAttachments = attachments;
static VkBufferCreateInfo
create_bci(struct zink_screen *screen, const struct pipe_resource *templ, unsigned bind)
{
- VkBufferCreateInfo bci = {};
+ VkBufferCreateInfo bci = {0};
bci.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO;
bci.size = templ->width0;
assert(bci.size > 0);
VkImageFormatProperties image_props;
VkResult ret;
if (screen->vk.GetPhysicalDeviceImageFormatProperties2) {
- VkImageFormatProperties2 props2 = {};
+ VkImageFormatProperties2 props2 = {0};
props2.sType = VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2;
- VkPhysicalDeviceImageFormatInfo2 info = {};
+ VkPhysicalDeviceImageFormatInfo2 info = {0};
info.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2;
info.format = ici->format;
info.type = ici->imageType;
static VkImageCreateInfo
create_ici(struct zink_screen *screen, const struct pipe_resource *templ, unsigned bind)
{
- VkImageCreateInfo ici = {};
+ VkImageCreateInfo ici = {0};
ici.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO;
ici.flags = bind & (PIPE_BIND_SCANOUT | PIPE_BIND_DEPTH_STENCIL) ? 0 : VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT;
if (!obj)
return NULL;
- VkMemoryRequirements reqs = {};
+ VkMemoryRequirements reqs = {0};
VkMemoryPropertyFlags flags;
bool scanout = templ->bind & PIPE_BIND_SCANOUT;
bool shared = templ->bind & PIPE_BIND_SHARED;
obj->transfer_dst = true;
} else {
VkImageCreateInfo ici = create_ici(screen, templ, templ->bind);
- VkExternalMemoryImageCreateInfo emici = {};
+ VkExternalMemoryImageCreateInfo emici = {0};
if (templ->bind & PIPE_BIND_SHARED) {
emici.sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO;
templ->usage == PIPE_USAGE_STAGING)
flags |= VK_MEMORY_PROPERTY_HOST_CACHED_BIT;
- VkMemoryAllocateInfo mai = {};
+ VkMemoryAllocateInfo mai = {0};
mai.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO;
mai.allocationSize = reqs.size;
mai.memoryTypeIndex = get_memory_type_index(screen, &reqs, flags);
mai.allocationSize = reqs.size = align(reqs.size, screen->info.props.limits.nonCoherentAtomSize);
}
- VkExportMemoryAllocateInfo emai = {};
+ VkExportMemoryAllocateInfo emai = {0};
if (templ->bind & PIPE_BIND_SHARED && shared) {
emai.sType = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO;
emai.handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT;
struct zink_resource_object *obj = res->scanout_obj ? res->scanout_obj : res->obj;
if (res->base.b.target != PIPE_BUFFER) {
- VkImageSubresource sub_res = {};
- VkSubresourceLayout sub_res_layout = {};
+ VkImageSubresource sub_res = {0};
+ VkSubresourceLayout sub_res_layout = {0};
sub_res.aspectMask = res->aspect;
if (whandle->type == WINSYS_HANDLE_TYPE_FD) {
#ifdef ZINK_USE_DMABUF
- VkMemoryGetFdInfoKHR fd_info = {};
+ VkMemoryGetFdInfoKHR fd_info = {0};
int fd;
fd_info.sType = VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR;
//TODO: remove for wsi
if (!format)
continue;
if (screen->vk.GetPhysicalDeviceFormatProperties2) {
- VkFormatProperties2 props = {};
+ VkFormatProperties2 props = {0};
props.sType = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2;
screen->vk.GetPhysicalDeviceFormatProperties2(screen->pdev, format, &props);
screen->format_props[i] = props.formatProperties;
bool
zink_screen_init_semaphore(struct zink_screen *screen)
{
- VkSemaphoreCreateInfo sci = {};
- VkSemaphoreTypeCreateInfo tci = {};
+ VkSemaphoreCreateInfo sci = {0};
+ VkSemaphoreTypeCreateInfo tci = {0};
VkSemaphore sem;
sci.pNext = &tci;
sci.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO;
bool
zink_screen_timeline_wait(struct zink_screen *screen, uint32_t batch_id, uint64_t timeout)
{
- VkSemaphoreWaitInfo wi = {};
+ VkSemaphoreWaitInfo wi = {0};
wi.sType = VK_STRUCTURE_TYPE_SEMAPHORE_WAIT_INFO;
wi.semaphoreCount = 1;
/* handle batch_id overflow */
struct zink_screen *screen = zink_screen(pscreen);
memset(info, 0, sizeof(struct pipe_memory_info));
if (screen->info.have_EXT_memory_budget && screen->vk.GetPhysicalDeviceMemoryProperties2) {
- VkPhysicalDeviceMemoryProperties2 mem = {};
+ VkPhysicalDeviceMemoryProperties2 mem = {0};
mem.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2;
- VkPhysicalDeviceMemoryBudgetPropertiesEXT budget = {};
+ VkPhysicalDeviceMemoryBudgetPropertiesEXT budget = {0};
budget.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_BUDGET_PROPERTIES_EXT;
mem.pNext = &budget;
screen->vk.GetPhysicalDeviceMemoryProperties2(screen->pdev, &mem);
{
VkDevice dev = VK_NULL_HANDLE;
- VkDeviceQueueCreateInfo qci = {};
+ VkDeviceQueueCreateInfo qci = {0};
float dummy = 0.0f;
qci.sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO;
qci.queueFamilyIndex = screen->gfx_queue;
qci.queueCount = screen->threaded && screen->max_queues > 1 ? 2 : 1;
qci.pQueuePriorities = &dummy;
- VkDeviceCreateInfo dci = {};
+ VkDeviceCreateInfo dci = {0};
dci.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO;
dci.queueCreateInfoCount = 1;
dci.pQueueCreateInfos = &qci;
const struct pipe_surface *templ,
enum pipe_texture_target target)
{
- VkImageViewCreateInfo ivci = {};
+ VkImageViewCreateInfo ivci = {0};
ivci.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO;
ivci.image = res->obj->image;
struct pipe_surface *
zink_surface_create_null(struct zink_context *ctx, enum pipe_texture_target target, unsigned width, unsigned height, unsigned samples)
{
- struct pipe_surface surf_templ = {};
+ struct pipe_surface surf_templ = {0};
struct pipe_resource *pres;
- struct pipe_resource templ = {};
+ struct pipe_resource templ = {0};
templ.width0 = width;
templ.height0 = height;
templ.depth0 = 1;