From 0f39a2cc7699427d54d7b4aa9ce037420353c2d5 Mon Sep 17 00:00:00 2001 From: Jannik Vogel Date: Wed, 20 Feb 2019 01:37:13 +0100 Subject: [PATCH 1/8] nv2a: Slot 0 of SET_VERTEX_DATA specifies a vertex --- hw/xbox/nv2a/nv2a_pgraph.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/hw/xbox/nv2a/nv2a_pgraph.c b/hw/xbox/nv2a/nv2a_pgraph.c index 1e8645e949..99a0470e4d 100644 --- a/hw/xbox/nv2a/nv2a_pgraph.c +++ b/hw/xbox/nv2a/nv2a_pgraph.c @@ -2177,7 +2177,6 @@ static void pgraph_method(NV2AState *d, attribute->inline_value[3] = 1.0; if (slot == 0) { pgraph_finish_inline_buffer_vertex(pg); - assert(false); /* FIXME: Untested */ } break; } @@ -2192,7 +2191,6 @@ static void pgraph_method(NV2AState *d, attribute->inline_value[3] = ((parameter >> 24) & 0xFF) / 255.0; if (slot == 0) { pgraph_finish_inline_buffer_vertex(pg); - assert(false); /* FIXME: Untested */ } break; } @@ -2211,7 +2209,6 @@ static void pgraph_method(NV2AState *d, * 2.0 + 1) / 65535.0; if ((slot == 0) && (part == 1)) { pgraph_finish_inline_buffer_vertex(pg); - assert(false); /* FIXME: Untested */ } break; } From f3b7fefde4c34b1c3a944bb7ef276ff7d1e9ccae Mon Sep 17 00:00:00 2001 From: Jannik Vogel Date: Mon, 18 Feb 2019 22:59:41 +0100 Subject: [PATCH 2/8] vsh: Fix skinning mode order --- hw/xbox/nv2a/nv2a_shaders.c | 8 ++++---- hw/xbox/nv2a/nv2a_vsh.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/xbox/nv2a/nv2a_shaders.c b/hw/xbox/nv2a/nv2a_shaders.c index 72836549ac..cbe5406fc2 100644 --- a/hw/xbox/nv2a/nv2a_shaders.c +++ b/hw/xbox/nv2a/nv2a_shaders.c @@ -372,14 +372,14 @@ GLSL_DEFINE(sceneAmbientColor, GLSL_LTCTXA(NV_IGRAPH_XF_LTCTXA_FR_AMB) ".xyz") mix = false; count = 0; break; case SKINNING_1WEIGHTS: mix = true; count = 2; break; - case SKINNING_2WEIGHTS: - mix = true; count = 3; break; - case SKINNING_3WEIGHTS: - mix = true; count = 4; break; case SKINNING_2WEIGHTS2MATRICES: mix = false; count = 2; break; + case SKINNING_2WEIGHTS: + mix = true; count = 3; break; case SKINNING_3WEIGHTS3MATRICES: mix = false; count = 3; break; + case SKINNING_3WEIGHTS: + mix = true; count = 4; break; case SKINNING_4WEIGHTS4MATRICES: mix = false; count = 4; break; default: diff --git a/hw/xbox/nv2a/nv2a_vsh.h b/hw/xbox/nv2a/nv2a_vsh.h index 771b887dd9..c12cff5700 100644 --- a/hw/xbox/nv2a/nv2a_vsh.h +++ b/hw/xbox/nv2a/nv2a_vsh.h @@ -63,10 +63,10 @@ enum VshFoggen { enum VshSkinning { SKINNING_OFF, SKINNING_1WEIGHTS, - SKINNING_2WEIGHTS, - SKINNING_3WEIGHTS, SKINNING_2WEIGHTS2MATRICES, + SKINNING_2WEIGHTS, SKINNING_3WEIGHTS3MATRICES, + SKINNING_3WEIGHTS, SKINNING_4WEIGHTS4MATRICES, }; From c331854c554734df666d9cb84724dc8a03b78931 Mon Sep 17 00:00:00 2001 From: Jannik Vogel Date: Mon, 18 Feb 2019 22:58:27 +0100 Subject: [PATCH 3/8] vsh: Support generated weights in skinning --- hw/xbox/nv2a/nv2a_shaders.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/hw/xbox/nv2a/nv2a_shaders.c b/hw/xbox/nv2a/nv2a_shaders.c index cbe5406fc2..e7daa53485 100644 --- a/hw/xbox/nv2a/nv2a_shaders.c +++ b/hw/xbox/nv2a/nv2a_shaders.c @@ -246,18 +246,24 @@ static void append_skinning_code(QString* str, bool mix, } else { qstring_append_fmt(str, "%s %s = %s(0.0);\n", type, output, type); if (mix) { - /* Tweening */ - if (count == 2) { - qstring_append_fmt(str, - "%s += mix((%s * %s1).%s,\n" - " (%s * %s0).%s, weight.x);\n", - output, - input, matrix, swizzle, - input, matrix, swizzle); - } else { - /* FIXME: Not sure how blend weights are calculated */ - assert(false); + /* Generated final weight (like GL_WEIGHT_SUM_UNITY_ARB) */ + qstring_append(str, "{\n" + " float weight_i;\n" + " float weight_n = 1.0;\n"); + int i; + for (i = 0; i < count; i++) { + if (i < (count - 1)) { + char c = "xyzw"[i]; + qstring_append_fmt(str, " weight_i = weight.%c;\n" + " weight_n -= weight_i;\n", + c); + } else { + qstring_append(str, " weight_i = weight_n;\n"); + } + qstring_append_fmt(str, " %s += (%s * %s%d).%s * weight_i;\n", + output, input, matrix, i, swizzle); } + qstring_append(str, "}\n"); } else { /* Individual matrices */ int i; From 1026f0e42f914a52e5ebb2ea65262130fe8fa6d8 Mon Sep 17 00:00:00 2001 From: Jannik Vogel Date: Mon, 18 Feb 2019 22:59:15 +0100 Subject: [PATCH 4/8] vsh: Minor improvements to individually weighted skinning --- hw/xbox/nv2a/nv2a_shaders.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/xbox/nv2a/nv2a_shaders.c b/hw/xbox/nv2a/nv2a_shaders.c index e7daa53485..9684e148eb 100644 --- a/hw/xbox/nv2a/nv2a_shaders.c +++ b/hw/xbox/nv2a/nv2a_shaders.c @@ -265,13 +265,12 @@ static void append_skinning_code(QString* str, bool mix, } qstring_append(str, "}\n"); } else { - /* Individual matrices */ + /* Individual weights */ int i; for (i = 0; i < count; i++) { char c = "xyzw"[i]; - qstring_append_fmt(str, "%s += (%s * %s%d * weight.%c).%s;\n", - output, input, matrix, i, c, - swizzle); + qstring_append_fmt(str, "%s += (%s * %s%d).%s * weight.%c;\n", + output, input, matrix, i, swizzle, c); } assert(false); /* FIXME: Untested */ } From e90b18616a555af82befe7018cdd6e31d600dba1 Mon Sep 17 00:00:00 2001 From: Luke Usher Date: Tue, 26 Mar 2019 09:44:42 +0000 Subject: [PATCH 5/8] nvnet: Guest MAC address should not be initialized by hardware This is set by the running application, so the default value remains unused. --- hw/xbox/nvnet.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/hw/xbox/nvnet.c b/hw/xbox/nvnet.c index f239730ec6..c1090717b1 100644 --- a/hw/xbox/nvnet.c +++ b/hw/xbox/nvnet.c @@ -829,13 +829,6 @@ static void nvnet_realize(PCIDevice *pci_dev, Error **errp) s->nic = qemu_new_nic(&net_nvnet_info, &s->conf, object_get_typename(OBJECT(s)), dev->id, s); assert(s->nic); - - s->regs[NvRegMacAddrA + 0x00] = s->conf.macaddr.a[0]; - s->regs[NvRegMacAddrA + 0x01] = s->conf.macaddr.a[1]; - s->regs[NvRegMacAddrA + 0x02] = s->conf.macaddr.a[2]; - s->regs[NvRegMacAddrA + 0x03] = s->conf.macaddr.a[3]; - s->regs[NvRegMacAddrB + 0x00] = s->conf.macaddr.a[4]; - s->regs[NvRegMacAddrB + 0x01] = s->conf.macaddr.a[5]; } static void nvnet_uninit(PCIDevice *dev) From 729e52662fcadc04bb790465e99c3779e6e88393 Mon Sep 17 00:00:00 2001 From: Stefan Schmidt Date: Thu, 25 Apr 2019 00:25:21 +0200 Subject: [PATCH 6/8] build.sh: Disable GlusterFS support --- build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build.sh b/build.sh index da2253997d..16abefd9a5 100755 --- a/build.sh +++ b/build.sh @@ -87,6 +87,7 @@ set -x # Print commands from now on --disable-spice \ --disable-user \ --disable-stack-protector \ + --disable-glusterfs \ ${user_opts} time make -j"${job_count}" 2>&1 | tee build.log From 5ac51875af99d902f0244e35918fc875c8a72b46 Mon Sep 17 00:00:00 2001 From: Jannik Vogel Date: Sat, 25 May 2019 11:33:12 +0200 Subject: [PATCH 7/8] build: Disable unused features --- build.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/build.sh b/build.sh index 16abefd9a5..fa49295dee 100755 --- a/build.sh +++ b/build.sh @@ -71,15 +71,18 @@ set -x # Print commands from now on ${debug_opts} \ ${sys_opts} \ --target-list=i386-softmmu \ + --enable-trace-backends="nop" \ --enable-sdl \ --with-sdlabi=2.0 \ --disable-curl \ --disable-vnc \ + --disable-vnc-sasl \ --disable-docs \ --disable-tools \ --disable-guest-agent \ --disable-tpm \ --disable-live-block-migration \ + --disable-rdma \ --disable-replication \ --disable-capstone \ --disable-fdt \ @@ -88,6 +91,29 @@ set -x # Print commands from now on --disable-user \ --disable-stack-protector \ --disable-glusterfs \ + --disable-bluez \ + --disable-gtk \ + --disable-curses \ + --disable-gnutls \ + --disable-nettle \ + --disable-gcrypt \ + --disable-crypto-afalg \ + --disable-virglrenderer \ + --disable-vhost-net \ + --disable-vhost-crypto \ + --disable-vhost-vsock \ + --disable-vhost-user \ + --disable-virtfs \ + --disable-libssh2 \ + --disable-snappy \ + --disable-bzip2 \ + --disable-vde \ + --disable-libxml2 \ + --disable-seccomp \ + --disable-numa \ + --disable-lzo \ + --disable-smartcard \ + --disable-usb-redir \ ${user_opts} time make -j"${job_count}" 2>&1 | tee build.log From c3ee5fcf6445b1f7fc0f7252fc1f9a4e7c17c9fc Mon Sep 17 00:00:00 2001 From: Jannik Vogel Date: Sat, 25 May 2019 22:37:22 +0200 Subject: [PATCH 8/8] hacks for MSVS/clang compilation --- hw/usb/dev-storage.c | 2 +- hw/usb/hcd-xhci.c | 4 ++-- include/sysemu/dma.h | 2 +- include/sysemu/os-win32.h | 2 +- replay/replay-internal.h | 2 +- stubs/replay.c | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/hw/usb/dev-storage.c b/hw/usb/dev-storage.c index 45a9487cdb..65e915b8f7 100644 --- a/hw/usb/dev-storage.c +++ b/hw/usb/dev-storage.c @@ -659,7 +659,7 @@ static const VMStateDescription vmstate_usb_msd = { .minimum_version_id = 1, .fields = (VMStateField[]) { VMSTATE_USB_DEVICE(dev, MSDState), - VMSTATE_UINT32(mode, MSDState), + //VMSTATE_UINT32(mode, MSDState), VMSTATE_UINT32(scsi_len, MSDState), VMSTATE_UINT32(scsi_off, MSDState), VMSTATE_UINT32(data_len, MSDState), diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index 8f1a01a405..6e5c5385d7 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -3564,8 +3564,8 @@ static const VMStateDescription vmstate_xhci_event = { .name = "xhci-event", .version_id = 1, .fields = (VMStateField[]) { - VMSTATE_UINT32(type, XHCIEvent), - VMSTATE_UINT32(ccode, XHCIEvent), + //VMSTATE_UINT32(type, XHCIEvent), + //VMSTATE_UINT32(ccode, XHCIEvent), VMSTATE_UINT64(ptr, XHCIEvent), VMSTATE_UINT32(length, XHCIEvent), VMSTATE_UINT32(flags, XHCIEvent), diff --git a/include/sysemu/dma.h b/include/sysemu/dma.h index 5da3c4e3c5..a411f328c1 100644 --- a/include/sysemu/dma.h +++ b/include/sysemu/dma.h @@ -13,7 +13,7 @@ #include "exec/memory.h" #include "exec/address-spaces.h" #include "hw/hw.h" -#include "block/block.h" +#include #include "block/accounting.h" typedef struct ScatterGatherEntry ScatterGatherEntry; diff --git a/include/sysemu/os-win32.h b/include/sysemu/os-win32.h index ff18b23db1..2bfe4cc7bc 100644 --- a/include/sysemu/os-win32.h +++ b/include/sysemu/os-win32.h @@ -30,7 +30,7 @@ #include #include -#if defined(_WIN64) +#if 0 // defined(_WIN64) /* On w64, setjmp is implemented by _setjmp which needs a second parameter. * If this parameter is NULL, longjump does no stack unwinding. * That is what we need for QEMU. Passing the value of register rsp (default) diff --git a/replay/replay-internal.h b/replay/replay-internal.h index ac4b27b674..d12f47b5fd 100644 --- a/replay/replay-internal.h +++ b/replay/replay-internal.h @@ -132,7 +132,7 @@ bool replay_next_event_is(int event); /*! Reads next clock value from the file. If clock kind read from the file is different from the parameter, the value is not used. */ -void replay_read_next_clock(unsigned int kind); +void replay_read_next_clock(ReplayClockKind kind); /* Asynchronous events queue */ diff --git a/stubs/replay.c b/stubs/replay.c index 04279abb2c..7a1483181c 100644 --- a/stubs/replay.c +++ b/stubs/replay.c @@ -4,13 +4,13 @@ ReplayMode replay_mode; -int64_t replay_save_clock(unsigned int kind, int64_t clock) +int64_t replay_save_clock(ReplayClockKind kind, int64_t clock) { abort(); return 0; } -int64_t replay_read_clock(unsigned int kind) +int64_t replay_read_clock(ReplayClockKind kind) { abort(); return 0;