w23 / xash3d-fwgs

Vulkan Ray Tracing fork of Xash3D FWGS engine. Intended to be merged into master at some point in the future.
160 stars 16 forks source link

Warning for 32bit builds (not supported) #670

Closed ertup0 closed 5 months ago

ertup0 commented 6 months ago

To reproduce

  1. load c1a0d
  2. Observe native opengl renderer without RT
  3. The console spews a bunch of N/A errors

Screenshots

Screenshot_34

Moar context

0x4E69676874466F78 commented 6 months ago

Please run:

  1. xash3d -ref vk -dev 3 -console -log and exit
  2. vulkaninfo --text -o vkinfo.txt (is installed with the driver)

attach engine.log and vkinfo.txt here (can be a zip file)

w23 commented 6 months ago

Judging from a combination of RT-capable HW, recent drivers, and no RT extensions exposed I'd say that you're running a 32-bit build. 32-bit drivers do not expose hardware ray tracing extensions at all. You must run an amd64 build: https://github.com/w23/xash3d-fwgs/wiki/How-to-build-a-64bit

I guess we should have a loud warning about that in the logs, so it's immediately obvious.

We also found this out the hard way. This 64-bit dependency doesn't seem to be widely advertised anywhere about hardware ray tracing.

0x4E69676874466F78 commented 6 months ago

@ertup0 were you able to run it with ray tracing?

ils8 commented 6 months ago

where is the macro for checking 2^5 vs 2^6 bit? i just followed build instructions (64bit obv...)

w23 commented 6 months ago

where is the macro for checking 2^5 vs 2^6 bit? i just followed build instructions (64bit obv...)

I'm not really sure if xash has one specifically. The major part of the task here is to figure this question out. Consult google, compiler docs, etc, and present a PR together with a description why you're doing it a certain way and how/why it will work on all targets/archs/oses/compilers this renderer supports.

ils8 commented 6 months ago

where is the macro for checking 2^5 vs 2^6 bit? i just followed build instructions (64bit obv...)

I'm not really sure if xash has one specifically. The major part of the task here is to figure this question out. Consult google, compiler docs, etc, and present a PR together with a description why you're doing it a certain way and how/why it will work on all targets/archs/oses/compilers this renderer supports.

Q_buildarch 228 in /public/build.c, but should i use r_speeds ie profiler to sren'k into log?

w23 commented 6 months ago

but should i use r_speeds ie profiler to sren'k into log?

speeds/profiler are irrelevant to this task find the place in vk_core.c where the lack of ray tracing is detected

0x4E69676874466F78 commented 6 months ago

@ils8 через vk_core.h уже доступен XASH_64BIT Тебе надо в vk_core.c внутри функции enumerateDevices (если нет места лучше, можно в теории и в R_VkInit сделать) сделать условие (!XASH_64BIT) с ошибкой в консоль/лог.

ils8 commented 6 months ago

as per discord, public/build.c l228 :Kappa:

ils8 commented 6 months ago

https://github.com/ils8/xash3d-fwgs/commit/c3307d9f89574e8b54b7479a9425d5e88b41f7d0

0x4E69676874466F78 commented 6 months ago

@ils8

ils8@c3307d9

  1. Не смешивай задачи. Сделай отдельный бранч для этой фичи.
  2. public/build.c это где я просил добавить проверку? Зачем заниматься самодурством? Это движок он к рендеру никакого отношения не имеет.
  3. и #include <stdio.h> — уже не смешно. Разберись в кодовой базе хотя бы минимально. Там же совсем рядом в vk_core.c валяются gEngine.Con_Printf( S_ERROR "").
  4. printf("AYAYAYYA %s\n", is64 ? "2^6!" : "2^5 :weak:"); — кто это будет читать ты подумал? Нужно адекватное нормальное сообщения без всякого выпендрёжа (2^6 и 2^5 это нечитаемо) и чтобы было понятно что лучевые расширения неподдерживаются в 32бит, чтобы даже овощ понял это и не пытался запустить лучи в 32бит.

Последний шанс сделать нормально, дальше я сделаю уже сам в 3 строчки.

ils8 commented 6 months ago

дальше пришло @0x4E69676874466F78

0x4E69676874466F78 commented 6 months ago

Пришло (понимание). Ну а какой ты реакции ожидал? Ты словно назло делаешь неправильно/троллишь. Я такого ещё не встречал, поэтому тон уже стал таким, да. Можешь более ответственно относиться к проекту? Безотносительно тона в сообщении выше, все мои замечания остаются в силе, будь добр исправься.

ils8 commented 6 months ago

Пришло (понимание). Ну а какой ты реакции ожидал? Ты словно назло делаешь неправильно/троллишь. Я такого ещё не встречал, поэтому тон уже стал таким, да. Можешь более ответственно относиться к проекту? Безотносительно тона в сообщении выше, все мои замечания остаются в силе, будь добр исправься.

20231203_10h22m18s_grim

ils8 commented 6 months ago

swearing at assert(XASH_64BT) too @0x4E69676874466F78

0x4E69676874466F78 commented 6 months ago

Я же тебе написал что дефайна нет в 32бит, но есть в 64бит. Редактор ругается потому что видимо кушает с 32бит или он/его расширения туповаты. Нужно проверять на сборке и не доверять слепо редакторам. Всё что от тебя требуется:

    #if !defined XASH_64BIT
    gEngine.Con_Reportf(S_ERROR "32bit build is not supported in raytracing extensions\n");
    #endif

image

ils8 commented 6 months ago

Я же тебе написал что дефайна нет в 32бит, но есть в 64бит. Редактор ругается потому что видимо кушает с 32бит или он/его расширения туповаты. Нужно проверять на сборке и не доверять слепо редакторам. Всё что от тебя требуется:

  #if !defined XASH_64BIT
  gEngine.Con_Reportf(S_ERROR "32bit build is not supported in raytracing extensions\n");
  #endif

image

как разберусь с редактором - сообщу

ils8 commented 6 months ago

Я же тебе написал что дефайна нет в 32бит, но есть в 64бит. Редактор ругается потому что видимо кушает с 32бит или он/его расширения туповаты. Нужно проверять на сборке и не доверять слепо редакторам. Всё что от тебя требуется:

  #if !defined XASH_64BIT
  gEngine.Con_Reportf(S_ERROR "32bit build is not supported in raytracing extensions\n");
  #endif

image

https://github.com/ils8/xash3d-fwgs/commit/d4b3b7c6e9201e6f45b7d962ad6a62d6f1bc4cc5

0x4E69676874466F78 commented 6 months ago

Можно ещё здесь строчку квара подменять с тем же сообщением: https://github.com/w23/xash3d-fwgs/blob/b06081047a0f3a21fc5f2715bdcc47e085c51bf6/ref/vk/vk_cvar.c#L44

0x4E69676874466F78 commented 6 months ago

@ils8 тебе надо создать новую чистую ветку (относительно vulkan апстрима) для этого изменения. https://github.com/w23/xash3d-fwgs/compare/vulkan...ils8:xash3d-fwgs:32vs64bit у тебя много лишнего захватило.