Skip to content

Commit

Permalink
vulkaninfo: Make queue families report present support
Browse files Browse the repository at this point in the history
  • Loading branch information
krOoze authored and jeremyk-lunarg committed Jan 22, 2019
1 parent c59c650 commit 3a7c6a8
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions vulkaninfo/vulkaninfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -1842,7 +1842,7 @@ static void AppDumpSurfaceExtension(struct AppInstance *inst, struct AppGpu *gpu
*format_count += AppDumpSurfaceFormats(inst, &gpus[i], out);
*present_mode_count += AppDumpSurfacePresentModes(inst, &gpus[i], out);
AppDumpSurfaceCapabilities(inst, &gpus[i], out);
AppDestroySurface(inst);

if (html_output) {
fprintf(out, "\t\t\t\t</details>\n");
} else if (human_readable_output) {
Expand Down Expand Up @@ -3296,6 +3296,11 @@ static void AppGpuDumpQueueProps(const struct AppGpu *gpu, uint32_t id, FILE *ou
props = *props_const;
}

VkBool32 supports_present = VK_FALSE;
if (gpu->inst->surface) {
VkResult err = vkGetPhysicalDeviceSurfaceSupportKHR(gpu->obj, id, gpu->inst->surface, &supports_present);
}

if (html_output) {
fprintf(out, "\t\t\t\t\t<details><summary>VkQueueFamilyProperties[<div class='val'>%d</div>]</summary>\n", id);
fprintf(out, "\t\t\t\t\t\t<details><summary>queueFlags = ");
Expand Down Expand Up @@ -3329,13 +3334,16 @@ static void AppGpuDumpQueueProps(const struct AppGpu *gpu, uint32_t id, FILE *ou
fprintf(out, "\t\t\t\t\t\t<details><summary>timestampValidBits = <div class='val'>%u</div></summary></details>\n", props.timestampValidBits);
fprintf(out, "\t\t\t\t\t\t<details><summary>minImageTransferGranularity = (<div class='val'>%d</div>, <div class='val'>%d</div>, <div class='val'>%d</div>)</summary></details>\n",
props.minImageTransferGranularity.width, props.minImageTransferGranularity.height, props.minImageTransferGranularity.depth);
fprintf(out, "\t\t\t\t\t\t<details><summary>present support = <div class='val'>%s</div></summary></details>\n",
supports_present ? "true" : "false");
fprintf(out, "\t\t\t\t\t</details>\n");
} else if (human_readable_output) {
printf("\n");
printf("\tqueueCount = %u\n", props.queueCount);
printf("\ttimestampValidBits = %u\n", props.timestampValidBits);
printf("\tminImageTransferGranularity = (%d, %d, %d)\n", props.minImageTransferGranularity.width,
props.minImageTransferGranularity.height, props.minImageTransferGranularity.depth);
printf("\tpresent support = %s\n", supports_present ? "true" : "false");
}
if (json_output) {
printf("\t\t{\n");
Expand All @@ -3346,7 +3354,8 @@ static void AppGpuDumpQueueProps(const struct AppGpu *gpu, uint32_t id, FILE *ou
printf("\t\t\t},\n");
printf("\t\t\t\"queueCount\": %u,\n", props.queueCount);
printf("\t\t\t\"queueFlags\": %u,\n", props.queueFlags);
printf("\t\t\t\"timestampValidBits\": %u\n", props.timestampValidBits);
printf("\t\t\t\"timestampValidBits\": %u,\n", props.timestampValidBits);
printf("\t\t\t\"present_support\": %s\n", supports_present ? "\"true\"" : "\"false\"");
printf("\t\t}");
}

Expand Down Expand Up @@ -3788,7 +3797,7 @@ void print_usage(char *argv0) {
int main(int argc, char **argv) {
uint32_t gpu_count;
VkResult err;
struct AppInstance inst;
struct AppInstance inst = {0};
FILE *out = stdout;

#ifdef _WIN32
Expand Down Expand Up @@ -4142,6 +4151,7 @@ int main(int argc, char **argv) {
free(gpus);
free(objs);

AppDestroySurface(&inst);
AppDestroyInstance(&inst);

if (html_output) {
Expand Down

0 comments on commit 3a7c6a8

Please sign in to comment.