Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

tex_info.c 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * Copyright 2009 VMware, Inc.
  3. * All Rights Reserved.
  4. *
  5. * Permission is hereby granted, free of charge, to any person obtaining a
  6. * copy of this software and associated documentation files (the "Software"),
  7. * to deal in the Software without restriction, including without limitation
  8. * on the rights to use, copy, modify, merge, publish, distribute, sub
  9. * license, and/or sell copies of the Software, and to permit persons to whom
  10. * the Software is furnished to do so, subject to the following conditions:
  11. *
  12. * The above copyright notice and this permission notice (including the next
  13. * paragraph) shall be included in all copies or substantial portions of the
  14. * Software.
  15. *
  16. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
  19. * VMWARE AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
  20. * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  21. * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  22. * USE OR OTHER DEALINGS IN THE SOFTWARE.
  23. */
  24. #include "pipe/p_compiler.h"
  25. #include "pipe/p_format.h"
  26. #include "util/u_memory.h"
  27. #include "util/u_debug.h"
  28. #include "util/u_network.h"
  29. #include "rbug/rbug.h"
  30. static void talk()
  31. {
  32. int c = u_socket_connect("localhost", 13370);
  33. struct rbug_connection *con = rbug_from_socket(c);
  34. struct rbug_header *header;
  35. struct rbug_proto_texture_list_reply *list;
  36. struct rbug_proto_texture_info_reply *info;
  37. int i;
  38. assert(c >= 0);
  39. assert(con);
  40. debug_printf("Connection get!\n");
  41. debug_printf("Sending get textures\n");
  42. rbug_send_texture_list(con, NULL);
  43. debug_printf("Waiting for textures\n");
  44. header = rbug_get_message(con, NULL);
  45. assert(header->opcode == RBUG_OP_TEXTURE_LIST_REPLY);
  46. list = (struct rbug_proto_texture_list_reply *)header;
  47. debug_printf("Got textures:\n");
  48. for (i = 0; i < list->textures_len; i++) {
  49. rbug_send_texture_info(con, list->textures[i], NULL);
  50. header = rbug_get_message(con, NULL);
  51. assert(header->opcode == RBUG_OP_TEXTURE_INFO_REPLY);
  52. info = (struct rbug_proto_texture_info_reply *)header;
  53. debug_printf("%llu %s %u x %u x %u, block(%ux%u %u), last_level: %u, nr_samples: %u, usage: %u\n",
  54. (unsigned long long)list->textures[i], pf_name(info->format),
  55. info->width[0], info->height[0], info->depth[0],
  56. info->blockw, info->blockh, info->blocksize,
  57. info->last_level, info->nr_samples, info->tex_usage);
  58. rbug_free_header(header);
  59. }
  60. rbug_free_header(&list->header);
  61. rbug_disconnect(con);
  62. }
  63. int main(int argc, char** argv)
  64. {
  65. talk();
  66. return 0;
  67. }