Skip to content

Commit

Permalink
build: Set march to IvyBridge for supported platforms build: Enable s…
Browse files Browse the repository at this point in the history
…pecific instructions (AVX / SSE4.2) instead of using march
  • Loading branch information
Xcedf committed Jan 1, 2025
1 parent 867a4a7 commit 5571743
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ case "$platform" in # Adjust compilation options based on platform
sys_cflags='-Wno-error=redundant-decls'
opts="$opts --disable-werror"
postbuild='package_linux'
if [ "$target_arch" == "x86_64" ]; then
sys_cflags="$sys_cflags -msse4.2 -mavx"
fi
;;
Darwin)
echo "Compiling for MacOS for $target_arch..."
Expand Down Expand Up @@ -233,7 +236,7 @@ case "$platform" in # Adjust compilation options based on platform
;;
CYGWIN*|MINGW*|MSYS*)
echo 'Compiling for Windows...'
sys_cflags='-Wno-error'
sys_cflags='-Wno-error -msse4.2 -mavx'
CFLAGS="${CFLAGS} -lIphlpapi -lCrypt32" # workaround for linking libs on mingw
opts="$opts --disable-fortify-source"
postbuild='package_windows' # set the above function to be called after build
Expand All @@ -242,7 +245,7 @@ case "$platform" in # Adjust compilation options based on platform
win64-cross)
echo 'Cross-compiling for Windows...'
export AR=${AR:-$CROSSAR}
sys_cflags='-Wno-error'
sys_cflags='-Wno-error -msse4.2 -mavx'
opts="$opts --cross-prefix=$CROSSPREFIX --static --disable-fortify-source"
postbuild='package_wincross' # set the above function to be called after build
target="qemu-system-i386w.exe"
Expand Down
4 changes: 2 additions & 2 deletions hw/xbox/nv2a/pgraph/vk/shaders.c
Original file line number Diff line number Diff line change
Expand Up @@ -646,8 +646,8 @@ static void shader_update_constants(PGRAPHState *pg, ShaderBinding *binding,
uint32_t v[2];
v[0] = pgraph_reg_r(pg, NV_PGRAPH_ZCLIPMIN);
v[1] = pgraph_reg_r(pg, NV_PGRAPH_ZCLIPMAX);
float zclip_min = *(float *)&v[0] / zmax * 2.0 - 1.0;
float zclip_max = *(float *)&v[1] / zmax * 2.0 - 1.0;
float zclip_min = *(float *)&v[0]; // zmax * 2.0 - 1.0;
float zclip_max = *(float *)&v[1]; // zmax * 2.0 - 1.0;

if (binding->clip_range_loc != -1) {
uniform4f(&binding->vertex->uniforms, binding->clip_range_loc, 0,
Expand Down

0 comments on commit 5571743

Please sign in to comment.