Skip to content

Commit

Permalink
nv2a: Add CPU emulation of nv2a vertex shader
Browse files Browse the repository at this point in the history
  • Loading branch information
abaire authored and mborgerson committed Jun 25, 2022
1 parent 1e31a77 commit 8043abc
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitmodules
Expand Up @@ -82,3 +82,6 @@
[submodule "tomlplusplus"]
path = tomlplusplus
url = https://github.com/marzer/tomlplusplus
[submodule "hw/xbox/nv2a/thirdparty/nv2a_vsh_cpu"]
path = hw/xbox/nv2a/thirdparty/nv2a_vsh_cpu
url = https://github.com/abaire/nv2a_vsh_cpu.git
2 changes: 1 addition & 1 deletion configure
Expand Up @@ -261,7 +261,7 @@ else
git_submodules_action="ignore"
fi

git_submodules="ui/keycodemapdb ui/thirdparty/imgui ui/thirdparty/implot util/xxHash tomlplusplus genconfig"
git_submodules="ui/keycodemapdb ui/thirdparty/imgui ui/thirdparty/implot util/xxHash tomlplusplus genconfig hw/xbox/nv2a/thirdparty/nv2a_vsh_cpu"
git="git"

# Don't accept a target_list environment variable.
Expand Down
3 changes: 3 additions & 0 deletions hw/xbox/nv2a/meson.build
Expand Up @@ -22,3 +22,6 @@ specific_ss.add(files(
's3tc.c',
))
subdir('gl')

subdir('thirdparty')
specific_ss.add(nv2a_vsh_cpu)
12 changes: 12 additions & 0 deletions hw/xbox/nv2a/thirdparty/meson.build
@@ -0,0 +1,12 @@
nv2a_vsh_cpu_files = files(
'nv2a_vsh_cpu/src/nv2a_vsh_cpu.c',
'nv2a_vsh_cpu/src/nv2a_vsh_disassembler.c',
'nv2a_vsh_cpu/src/nv2a_vsh_emulator.c',
'nv2a_vsh_cpu/src/nv2a_vsh_emulator_execution_state.c',
)

libnv2a_vsh_cpu = static_library('nv2a_vsh_cpu',
sources: nv2a_vsh_cpu_files,
include_directories: ['.', 'nv2a_vsh_cpu/src'])
nv2a_vsh_cpu = declare_dependency(link_with: libnv2a_vsh_cpu,
include_directories: ['nv2a_vsh_cpu/src'])
1 change: 1 addition & 0 deletions hw/xbox/nv2a/thirdparty/nv2a_vsh_cpu
Submodule nv2a_vsh_cpu added at 89e6ec
24 changes: 24 additions & 0 deletions licenses/nv2a_vsh_cpu.license.txt
@@ -0,0 +1,24 @@
This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.

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 NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS 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.

For more information, please refer to <https://unlicense.org>
1 change: 1 addition & 0 deletions scripts/archive-source.sh
Expand Up @@ -29,6 +29,7 @@ sub_file="${sub_tdir}/submodule.tar"
submodules="dtc slirp meson ui/keycodemapdb"
submodules="$submodules tests/fp/berkeley-softfloat-3 tests/fp/berkeley-testfloat-3"
submodules="$submodules ui/thirdparty/imgui ui/thirdparty/implot util/xxHash tomlplusplus genconfig" # xemu extras
submodules="$submodules hw/xbox/nv2a/thirdparty/nv2a_vsh_cpu"
sub_deinit=""

function cleanup() {
Expand Down
6 changes: 6 additions & 0 deletions scripts/gen-license.py
Expand Up @@ -225,6 +225,12 @@ def head(self):
version='6926f5a0a78f22d42b074a0ab8032e07736babd4'
),

Lib('nv2a_vsh_cpu', 'https://github.com/abaire/nv2a_vsh_cpu',
unlicense, 'https://raw.githubusercontent.com/abaire/nv2a_vsh_cpu/main/LICENSE',
ships_static=all_platforms,
submodule=Submodule('hw/xbox/nv2a/thirdparty/nv2a_vsh_cpu')
),

#
# Data files included with xemu
#
Expand Down

0 comments on commit 8043abc

Please sign in to comment.