+++ /dev/null
-bin_to_bmp
-simple_client
-simple_server
-shdr_info
-shdr_dump
-shdr_disable
-ctx_info
-ctx_rule
-tex_dump
-tex_info
-*.bmp
-*.bin
+++ /dev/null
-# progs/rbug/Makefile
-
-TOP = ../..
-include $(TOP)/configs/current
-
-INCLUDES = \
- -I. \
- -I$(TOP)/src/gallium/include \
- -I$(TOP)/src/gallium/auxiliary \
- -I$(TOP)/src/gallium/drivers \
- $(PROG_INCLUDES)
-
-LINKS = \
- $(GALLIUM_AUXILIARIES) \
- $(PROG_LINKS)
-
-SOURCES = \
- bin_to_bmp.c \
- simple_client.c \
- simple_server.c \
- shdr_info.c \
- shdr_dump.c \
- shdr_disable.c \
- ctx_info.c \
- ctx_rule.c \
- tex_info.c \
- tex_dump.c
-
-
-OBJECTS = $(SOURCES:.c=.o)
-
-PROGS = $(OBJECTS:.o=)
-
-##### TARGETS #####
-
-default: $(OBJECTS) $(PROGS)
-
-clean:
- -rm -f $(PROGS)
- -rm -f *.o
-
-##### RULES #####
-
-$(OBJECTS): %.o: %.c
- $(CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $(PROG_DEFINES) $< -o $@
-
-$(PROGS): %: %.o
- $(CC) $(LDFLAGS) $< $(LINKS) -lm -o $@
+++ /dev/null
- REMOTE DEBUGGING CLI APPLICATIONS
-
-
-= About =
-
-This directory contains a Gallium3D remote debugging cli applications.
-
-
-= Build Instructions =
-
-To build, build a normal gallium build and from this directory do the following.
-
- make
-
-= Usage =
-
-Make sure that you driver has trace integration, see
-src/gallium/driver/rbug/README for more information about that. Then from on
-the computer that you want to debug do:
-
- export GALLIUM_RBUG=true
-
- <launch app>
-
-From the debugging computer launch apps form this directory. Currently ip
-addresses are hardcoded and you need to edit the application, but that will
-change in the future. For a more advanced gui application see:
-
- http://cgit.freedesktop.org/mesa/rbug-gui
-
-
-= Testing =
-
-The two apps simple_client and simple_server. Are unit testing of the
-connection and (de)marsheler. Just run the server first and then the client:
-
- ./simple_server &
- ./simple_client
-
-
---
-Jakob Bornecrantz <jakob@vmware.com>
+++ /dev/null
-/*
- * Copyright 2009 VMware, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, and/or sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * VMWARE AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include <stdio.h>
-
-#include "pipe/p_compiler.h"
-#include "pipe/p_format.h"
-#include "pipe/p_state.h"
-#include "util/u_format.h"
-#include "util/u_memory.h"
-#include "util/u_debug.h"
-#include "util/u_format.h"
-#include "util/u_network.h"
-#include "util/u_string.h"
-#include "util/u_tile.h"
-
-static uint8_t* rbug_read(const char *filename, unsigned size);
-static void dump(unsigned src_width, unsigned src_height,
- unsigned src_stride, enum pipe_format src_format,
- uint8_t *data, unsigned src_size);
-
-int main(int argc, char** argv)
-{
- /* change these */
- unsigned width = 64;
- unsigned height = 64;
- unsigned stride = width * 4;
- unsigned size = stride * height;
- const char *filename = "mybin.bin";
- enum pipe_format format = PIPE_FORMAT_B8G8R8A8_UNORM;
-
- dump(width, height, stride, format, rbug_read(filename, size), size);
-
- return 0;
-}
-
-static void dump(unsigned width, unsigned height,
- unsigned src_stride, enum pipe_format src_format,
- uint8_t *data, unsigned src_size)
-{
- enum pipe_format dst_format = PIPE_FORMAT_R32G32B32A32_FLOAT;
- unsigned dst_stride;
- unsigned dst_size;
- float *rgba;
- int i;
- char filename[512];
-
- {
- assert(src_stride >= util_format_get_stride(src_format, width));
- }
- {
- dst_stride = util_format_get_stride(dst_format, width);
- dst_size = util_format_get_2d_size(dst_format, dst_stride, width);
- rgba = MALLOC(dst_size);
- }
-
- util_snprintf(filename, 512, "%s.bmp", util_format_name(src_format));
-
- if (util_format_is_compressed(src_format)) {
- debug_printf("skipping: %s\n", filename);
- return;
- }
-
- debug_printf("saving: %s\n", filename);
-
- for (i = 0; i < height; i++) {
- pipe_tile_raw_to_rgba(src_format, data + src_stride * i,
- width, 1,
- &rgba[width*4*i], dst_stride);
- }
-
- debug_dump_float_rgba_bmp(filename, width, height, rgba, width);
-
- FREE(rgba);
-}
-
-static uint8_t* rbug_read(const char *filename, unsigned size)
-{
- uint8_t *data;
- FILE *file = fopen(filename, "rb");
-
- data = MALLOC(size);
-
- fread(data, 1, size, file);
- fclose(file);
-
- return data;
-}
+++ /dev/null
-/*
- * Copyright 2009 VMware, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, and/or sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * VMWARE AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "pipe/p_compiler.h"
-#include "pipe/p_format.h"
-#include "util/u_memory.h"
-#include "util/u_debug.h"
-#include "util/u_network.h"
-
-#include "rbug/rbug.h"
-
-static void talk()
-{
- int c = u_socket_connect("localhost", 13370);
- struct rbug_connection *con = rbug_from_socket(c);
- struct rbug_header *header;
- struct rbug_proto_context_list_reply *list;
- struct rbug_proto_context_info_reply *info;
- int i;
-
- assert(c >= 0);
- assert(con);
- debug_printf("Connection get!\n");
-
- debug_printf("Sending get contexts\n");
- rbug_send_context_list(con, NULL);
-
- debug_printf("Waiting for contexts\n");
- header = rbug_get_message(con, NULL);
- assert(header->opcode == RBUG_OP_CONTEXT_LIST_REPLY);
- list = (struct rbug_proto_context_list_reply *)header;
-
- debug_printf("Got contexts:\n");
- for (i = 0; i < list->contexts_len; i++) {
-#if 0
- rbug_send_contexts_info(con, list->contexts[i], NULL);
-
- header = rbug_get_message(con, NULL);
- assert(header->opcode == RBUG_OP_CONTEXT_INFO_REPLY);
- info = (struct rbug_proto_context_info_reply *)header;
-#else
- (void)info;
- header = NULL;
-#endif
-
- debug_printf("%llu\n",
- (unsigned long long)list->contexts[i]);
- rbug_free_header(header);
- }
-
- rbug_free_header(&list->header);
- rbug_disconnect(con);
-}
-
-int main(int argc, char** argv)
-{
- talk();
- return 0;
-}
+++ /dev/null
-/*
- * Copyright 2009 VMware, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, and/or sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * VMWARE AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include <stdio.h>
-
-#include "pipe/p_compiler.h"
-#include "pipe/p_format.h"
-#include "util/u_memory.h"
-#include "util/u_debug.h"
-#include "util/u_network.h"
-
-#include "rbug/rbug.h"
-
-static void talk(rbug_context_t ctx, rbug_shader_t shdr)
-{
- int c = u_socket_connect("localhost", 13370);
- struct rbug_connection *con;
- struct rbug_header *header;
-
- if (c < 0)
- c = u_socket_connect("localhost", 13370);
-
- con = rbug_from_socket(c);
- assert(c >= 0);
- assert(con);
- debug_printf("Connection get!\n");
-
- rbug_send_context_draw_rule(con, ctx, 0, shdr, 0, 0, RBUG_BLOCK_AFTER, NULL);
-
- rbug_send_ping(con, NULL);
-
- debug_printf("Sent waiting for reply\n");
- header = rbug_get_message(con, NULL);
-
- if (header->opcode != RBUG_OP_PING_REPLY)
- debug_printf("Error\n");
- else
- debug_printf("Ok!\n");
-
- rbug_free_header(header);
- rbug_disconnect(con);
-}
-
-static void print_usage()
-{
- printf("Usage ctx_rule <context> <fragment>\n");
- exit(-1);
-}
-
-int main(int argc, char** argv)
-{
- long ctx;
- long shdr;
-
- if (argc < 3)
- print_usage();
-
- ctx = atol(argv[1]);
- shdr = atol(argv[2]);
-
- if (ctx <= 0 && ctx <= 0)
- print_usage();
-
- talk((uint64_t)ctx, (uint64_t)shdr);
-
- return 0;
-}
+++ /dev/null
-/*
- * Copyright 2009 VMware, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, and/or sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * VMWARE AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include <stdio.h>
-
-#include "pipe/p_compiler.h"
-#include "pipe/p_format.h"
-#include "util/u_memory.h"
-#include "util/u_debug.h"
-#include "util/u_network.h"
-
-#include "rbug/rbug.h"
-
-static void talk(rbug_context_t ctx, rbug_shader_t shdr)
-{
- int c = u_socket_connect("localhost", 13370);
- struct rbug_connection *con = rbug_from_socket(c);
- struct rbug_header *header;
-
- assert(c >= 0);
- assert(con);
- debug_printf("Connection get!\n");
-
- rbug_send_shader_disable(con, ctx, shdr, true, NULL);
-
- rbug_send_ping(con, NULL);
-
- debug_printf("Sent waiting for reply\n");
- header = rbug_get_message(con, NULL);
-
- if (header->opcode != RBUG_OP_PING_REPLY)
- debug_printf("Error\n");
- else
- debug_printf("Ok!\n");
-
- rbug_free_header(header);
- rbug_disconnect(con);
-}
-
-static void print_usage()
-{
- printf("Usage shdr_disable <context> <shader>\n");
- exit(-1);
-}
-
-int main(int argc, char** argv)
-{
- long ctx;
- long shdr;
-
- if (argc < 3)
- print_usage();
-
- ctx = atol(argv[1]);
- shdr = atol(argv[2]);
-
- if (ctx <= 0 && ctx <= 0)
- print_usage();
-
- talk((uint64_t)ctx, (uint64_t)shdr);
-
- return 0;
-}
+++ /dev/null
-/*
- * Copyright 2009 VMware, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, and/or sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * VMWARE AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "pipe/p_compiler.h"
-#include "pipe/p_format.h"
-#include "util/u_memory.h"
-#include "util/u_debug.h"
-#include "util/u_network.h"
-
-#include "rbug/rbug.h"
-
-#include "tgsi/tgsi_dump.h"
-
-static void shader_info(struct rbug_connection *con, rbug_context_t ctx)
-{
- struct rbug_header *header;
- struct rbug_proto_shader_list_reply *list;
- struct rbug_proto_shader_info_reply *info;
- int i;
-
- debug_printf("Sending get shaders to %llu\n", (unsigned long long)ctx);
- rbug_send_shader_list(con, ctx, NULL);
-
- debug_printf("Waiting for shaders from %llu\n", (unsigned long long)ctx);
- header = rbug_get_message(con, NULL);
- assert(header->opcode == RBUG_OP_SHADER_LIST_REPLY);
- list = (struct rbug_proto_shader_list_reply *)header;
-
- debug_printf("Got shaders:\n");
- for (i = 0; i < list->shaders_len; i++) {
- rbug_send_shader_info(con, ctx, list->shaders[i], NULL);
-
- header = rbug_get_message(con, NULL);
- assert(header->opcode == RBUG_OP_SHADER_INFO_REPLY);
- info = (struct rbug_proto_shader_info_reply *)header;
-
- debug_printf("#####################################################\n");
- debug_printf("ctx: %llu shdr: %llu disabled %u\n",
- (unsigned long long)ctx,
- (unsigned long long)list->shaders[i],
- info->disabled);
-
- /* just to be sure */
- assert(sizeof(struct tgsi_token) == 4);
-
- debug_printf("-----------------------------------------------------\n");
- tgsi_dump((struct tgsi_token *)info->original, 0);
-
- if (info->replaced_len > 0) {
- debug_printf("-----------------------------------------------------\n");
- tgsi_dump((struct tgsi_token *)info->replaced, 0);
- }
-
- rbug_free_header(header);
- }
-
- debug_printf("#####################################################\n");
- rbug_free_header(&list->header);
-}
-
-static void talk()
-{
- int c = u_socket_connect("localhost", 13370);
- struct rbug_connection *con = rbug_from_socket(c);
- struct rbug_header *header;
- struct rbug_proto_context_list_reply *list;
- int i;
-
- assert(c >= 0);
- assert(con);
- debug_printf("Connection get!\n");
-
- debug_printf("Sending get contexts\n");
- rbug_send_context_list(con, NULL);
-
- debug_printf("Waiting for contexts\n");
- header = rbug_get_message(con, NULL);
- assert(header->opcode == RBUG_OP_CONTEXT_LIST_REPLY);
- list = (struct rbug_proto_context_list_reply *)header;
-
- debug_printf("Got contexts:\n");
- for (i = 0; i < list->contexts_len; i++) {
- shader_info(con, list->contexts[i]);
- }
-
- rbug_free_header(&list->header);
- rbug_disconnect(con);
-}
-
-int main(int argc, char** argv)
-{
- talk();
- return 0;
-}
+++ /dev/null
-/*
- * Copyright 2009 VMware, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, and/or sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * VMWARE AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "pipe/p_compiler.h"
-#include "pipe/p_format.h"
-#include "util/u_memory.h"
-#include "util/u_debug.h"
-#include "util/u_network.h"
-
-#include "rbug/rbug.h"
-
-static void shader_info(struct rbug_connection *con, rbug_context_t ctx)
-{
- struct rbug_header *header;
- struct rbug_proto_shader_list_reply *list;
- struct rbug_proto_shader_info_reply *info;
- int i;
-
- rbug_send_shader_list(con, ctx, NULL);
-
- header = rbug_get_message(con, NULL);
- assert(header->opcode == RBUG_OP_SHADER_LIST_REPLY);
- list = (struct rbug_proto_shader_list_reply *)header;
-
- debug_printf(" context | shader | disabled |\n");
- for (i = 0; i < list->shaders_len; i++) {
- rbug_send_shader_info(con, ctx, list->shaders[i], NULL);
-
- header = rbug_get_message(con, NULL);
- assert(header->opcode == RBUG_OP_SHADER_INFO_REPLY);
- info = (struct rbug_proto_shader_info_reply *)header;
-
- debug_printf("%15llu | %15llu | %15u |\n",
- (unsigned long long)ctx,
- (unsigned long long)list->shaders[i],
- (unsigned)info->disabled);
-
- rbug_free_header(header);
- }
-
- rbug_free_header(&list->header);
-}
-
-static void talk()
-{
- int c = u_socket_connect("localhost", 13370);
- struct rbug_connection *con = rbug_from_socket(c);
- struct rbug_header *header;
- struct rbug_proto_context_list_reply *list;
- int i;
-
- assert(c >= 0);
- assert(con);
- debug_printf("Connection get!\n");
-
- debug_printf("Sending get contexts\n");
- rbug_send_context_list(con, NULL);
-
- debug_printf("Waiting for contexts\n");
- header = rbug_get_message(con, NULL);
- assert(header->opcode == RBUG_OP_CONTEXT_LIST_REPLY);
- list = (struct rbug_proto_context_list_reply *)header;
-
- debug_printf("Got contexts:\n");
- for (i = 0; i < list->contexts_len; i++) {
- shader_info(con, list->contexts[i]);
- }
-
- rbug_free_header(&list->header);
- rbug_disconnect(con);
-}
-
-int main(int argc, char** argv)
-{
- talk();
- return 0;
-}
+++ /dev/null
-/*
- * Copyright 2009 VMware, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, and/or sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * VMWARE AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "pipe/p_compiler.h"
-#include "util/u_memory.h"
-#include "util/u_debug.h"
-#include "util/u_network.h"
-
-#include "rbug/rbug.h"
-
-static void talk()
-{
- int c = u_socket_connect("localhost", 13370);
- struct rbug_connection *con = rbug_from_socket(c);
- struct rbug_header *header;
- struct rbug_proto_texture_list_reply *list;
- int i;
-
- assert(c >= 0);
- assert(con);
- debug_printf("Connection get!\n");
-
- debug_printf("Sending get textures\n");
- rbug_send_texture_list(con, NULL);
-
- debug_printf("Waiting for textures\n");
- header = rbug_get_message(con, NULL);
- assert(header->opcode == RBUG_OP_TEXTURE_LIST_REPLY);
- list = (struct rbug_proto_texture_list_reply *)header;
-
- debug_printf("Got textures:\n");
- for (i = 0; i < list->textures_len; i++)
- debug_printf("\ttex %llu\n", (unsigned long long)list->textures[i]);
-
- rbug_free_header(header);
- rbug_disconnect(con);
-}
-
-int main(int argc, char** argv)
-{
- talk();
- return 0;
-}
+++ /dev/null
-/*
- * Copyright 2009 VMware, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, and/or sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * VMWARE AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "pipe/p_compiler.h"
-#include "util/u_memory.h"
-#include "util/u_debug.h"
-#include "util/u_network.h"
-
-#include "rbug/rbug.h"
-
-static void rbug_wait()
-{
- int s = u_socket_listen_on_port(13370);
- int c = u_socket_accept(s);
- struct rbug_connection *con = rbug_from_socket(c);
- struct rbug_header *header;
- rbug_texture_t texs[2];
- uint32_t serial;
- texs[0] = 1337;
- texs[1] = 7331;
-
- assert(s >= 0);
- assert(c >= 0);
- assert(con);
- debug_printf("Connection get!\n");
-
- debug_printf("Waiting for get textures\n");
- header = rbug_get_message(con, &serial);
- assert(header);
- assert(header->opcode == RBUG_OP_TEXTURE_LIST);
- rbug_free_header(header);
-
- rbug_send_texture_list_reply(con, serial, texs, 2, NULL);
- rbug_disconnect(con);
-}
-
-int main(int argc, char** argv)
-{
- rbug_wait();
- return 0;
-}
+++ /dev/null
-/*
- * Copyright 2009 VMware, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, and/or sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * VMWARE AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "pipe/p_compiler.h"
-#include "pipe/p_format.h"
-#include "pipe/p_state.h"
-#include "util/u_memory.h"
-#include "util/u_debug.h"
-#include "util/u_format.h"
-#include "util/u_network.h"
-#include "util/u_string.h"
-#include "util/u_tile.h"
-#include "rbug/rbug.h"
-
-static void dump(rbug_texture_t tex,
- struct rbug_proto_texture_info_reply *info,
- struct rbug_proto_texture_read_reply *read,
- int mip)
-{
- enum pipe_format format = info->format;
- uint8_t *data = read->data;
- unsigned width = info->width[mip];
- unsigned height = info->height[mip];
- unsigned dst_stride = width * 4 * 4;
- unsigned src_stride = read->stride;
- float *rgba = MALLOC(dst_stride * height);
- int i;
- char filename[512];
-
- util_snprintf(filename, 512, "%llu_%s_%u.bmp",
- (unsigned long long)tex, util_format_name(info->format), mip);
-
- if (util_format_is_compressed(info->format)) {
- debug_printf("skipping: %s\n", filename);
- return;
- }
-
- debug_printf("saving: %s\n", filename);
-
- for (i = 0; i < height; i++) {
- pipe_tile_raw_to_rgba(format, data + src_stride * i,
- width, 1,
- &rgba[width*4*i], dst_stride);
- }
-
- debug_dump_float_rgba_bmp(filename, width, height, rgba, width);
-
- FREE(rgba);
-}
-
-static void talk()
-{
- int c = u_socket_connect("localhost", 13370);
- struct rbug_connection *con = rbug_from_socket(c);
- struct rbug_header *header;
- struct rbug_header *header2;
- struct rbug_proto_texture_list_reply *list;
- struct rbug_proto_texture_info_reply *info;
- struct rbug_proto_texture_read_reply *read;
- int i, j;
-
- assert(c >= 0);
- assert(con);
- debug_printf("Connection get!\n");
-
- debug_printf("Sending get textures\n");
- rbug_send_texture_list(con, NULL);
-
- debug_printf("Waiting for textures\n");
- header = rbug_get_message(con, NULL);
- assert(header->opcode == RBUG_OP_TEXTURE_LIST_REPLY);
- list = (struct rbug_proto_texture_list_reply *)header;
-
- debug_printf("Got textures:\n");
- for (i = 0; i < list->textures_len; i++) {
- rbug_send_texture_info(con, list->textures[i], NULL);
-
- header = rbug_get_message(con, NULL);
- assert(header->opcode == RBUG_OP_TEXTURE_INFO_REPLY);
- info = (struct rbug_proto_texture_info_reply *)header;
-
- for (j = 0; j <= info->last_level; j++) {
- rbug_send_texture_read(con, list->textures[i],
- 0, j, 0,
- 0, 0, info->width[j], info->height[j],
- NULL);
-
- header2 = rbug_get_message(con, NULL);
- assert(header2->opcode == RBUG_OP_TEXTURE_READ_REPLY);
- read = (struct rbug_proto_texture_read_reply *)header2;
-
- dump(list->textures[i], info, read, j);
-
- rbug_free_header(header2);
- }
-
- rbug_free_header(header);
-
- }
- rbug_free_header(&list->header);
- rbug_disconnect(con);
-}
-
-int main(int argc, char** argv)
-{
- talk();
- return 0;
-}
+++ /dev/null
-/*
- * Copyright 2009 VMware, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * on the rights to use, copy, modify, merge, publish, distribute, sub
- * license, and/or sell copies of the Software, and to permit persons to whom
- * the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * VMWARE AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#include "pipe/p_compiler.h"
-#include "pipe/p_format.h"
-#include "util/u_format.h"
-#include "util/u_memory.h"
-#include "util/u_debug.h"
-#include "util/u_network.h"
-
-#include "rbug/rbug.h"
-
-static void talk()
-{
- int c = u_socket_connect("localhost", 13370);
- struct rbug_connection *con = rbug_from_socket(c);
- struct rbug_header *header;
- struct rbug_proto_texture_list_reply *list;
- struct rbug_proto_texture_info_reply *info;
- int i;
-
- assert(c >= 0);
- assert(con);
- debug_printf("Connection get!\n");
-
- debug_printf("Sending get textures\n");
- rbug_send_texture_list(con, NULL);
-
- debug_printf("Waiting for textures\n");
- header = rbug_get_message(con, NULL);
- assert(header->opcode == RBUG_OP_TEXTURE_LIST_REPLY);
- list = (struct rbug_proto_texture_list_reply *)header;
-
- debug_printf("Got textures:\n");
- for (i = 0; i < list->textures_len; i++) {
- rbug_send_texture_info(con, list->textures[i], NULL);
-
- header = rbug_get_message(con, NULL);
- assert(header->opcode == RBUG_OP_TEXTURE_INFO_REPLY);
- info = (struct rbug_proto_texture_info_reply *)header;
-
- debug_printf("%llu %s %u x %u x %u, block(%ux%u %u), last_level: %u, nr_samples: %u, usage: %u\n",
- (unsigned long long)list->textures[i], util_format_name(info->format),
- info->width[0], info->height[0], info->depth[0],
- info->blockw, info->blockh, info->blocksize,
- info->last_level, info->nr_samples, info->tex_usage);
- rbug_free_header(header);
- }
-
- rbug_free_header(&list->header);
- rbug_disconnect(con);
-}
-
-int main(int argc, char** argv)
-{
- talk();
- return 0;
-}