Skip to content

Tessellation #1528

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 30 commits into from
Dec 14, 2024
Merged

Tessellation #1528

merged 30 commits into from
Dec 14, 2024

Conversation

baggins183
Copy link
Contributor

@baggins183 baggins183 commented Nov 13, 2024

Opening PR for testing, not close to merge

Only post results from this fork
https://github.com/baggins183/shadPS4/tree/tess

I know about the "Failed to create graphics pipeline" error on AMD, so dont post about that unless youve debugged the vkCreateGraphicsPipelines call and found something or can spot problems in the code.

Needs testing in other games that have tessellation shaders.

Also for BB, if someone can narrow down the hs_* and vs_* (domain) shaders responsible for blood splatter on clothes, or snow at cainhurst, that would help. Ive done some Cainhurst debugging with no luck so far. I can't confirm if its a tess problem or not.

@baggins183
Copy link
Contributor Author

for amd bros who are crashing it would be interesting to know if some pipelines using tessellation shaders do compile successfully or if all of them cause the vkCreateGraphicsPipelines error

@baggins183
Copy link
Contributor Author

baggins183 commented Nov 15, 2024

I think if you can get a shad_log that has 2 or more "compiling hs shader"s that would be good.
If you are also crashing with failed to create graphics pipelines

@Brave-Valiant
Copy link

Thank you for your efforts, mr. Baggins. Here is my log:
shad_log.txt

@Mast3rwaf1z
Copy link

Linux AMD GPU:
This pr works perfectly on the RADV driver (ignoring the unrelated issues RADV has with the emulator already), but with the AMDGPU_PRO driver (which is the only way to play on the emulator on AMD on linux atm afaik) , the emulator will not load the game at all on the appimages, and when i compile it myself it gets to the title screen but doesn't load into the game.

I think if you can get a shad_log that has 2 or more "compiling hs shader"s that would be good.

0 lines in all 3 log files, my guess is it might be platform specific?

Logs:

the ones where i get ingame are too large to upload here. I have attached when i'm running BB using AMDGPU_PRO, using https://github.com/ngoquang2708/shadPS4/tree/linux-hack-tess, which is based on your branch
appimage.log

@baggins183
Copy link
Contributor Author

baggins183 commented Nov 16, 2024

0 lines in all 3 log files, my guess is it might be platform specific?

No, if you hit tessellation shaders you would see this in the log. Check your log filter and that u have sync logging.

You dont have to use and shouldnt report problems with forks. It looks like that fork is out of date

@Foul-Tarnished
Copy link

Does this have #1538 ?
A rebase would help with testing BB I guess?

@baggins183
Copy link
Contributor Author

rebased

@baggins183
Copy link
Contributor Author

rebased

for AMD crashes on failed to create graphics pipelines id actually recommend skipping the last "hs shader" hash you see your log (adding the hash to shouldSkipShader) to see if there are other tess pipelines that compile successfully.
If like i said you see >=2 "Compiling hs shader"s in your log then let me know, because that would mean some compile successfully and theres an isolated issue with certain shaders.

example:
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:461: Compiling hs shader 0xbc234799

@GHU7924
Copy link

GHU7924 commented Nov 17, 2024

Build 664e61f
I have a save in Forsaken Cainhurst Castle.
I did a little run there.

you see >=2 "Compiling hs shader"s in your log then let me know

Unfortunately, I did not see this in my log.

I had two lines of shaders or more:

[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:462: Compiling vs shader 0x9951d199
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:462: Compiling vs shader 0x44072322

[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:462: Compiling vs shader 0xa400228b
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:462: Compiling vs shader 0x6dfebc16

[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:462: Compiling vs shader 0x4f23790e
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:462: Compiling vs shader 0x89e9d10c

[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:462: Compiling vs shader 0x354a5593
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:462: Compiling vs shader 0x1403cd3e

[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:462: Compiling vs shader 0xcda960c8
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:462: Compiling vs shader 0xa48adba4
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:462: Compiling vs shader 0x4519e09d

[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:462: Compiling vs shader 0x228a5307
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:462: Compiling vs shader 0x7e259f22
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:462: Compiling vs shader 0x2b2ea138
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:462: Compiling vs shader 0x4aaa195a
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:462: Compiling vs shader 0xa6a38f2c
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:462: Compiling vs shader 0x6f4d9f1a

[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:462: Compiling vs shader 0x3deaa573 (permutation)
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:462: Compiling vs shader 0xb10c4f55 (permutation)
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:462: Compiling vs shader 0xc77a0097
[Render.Vulkan] vk_pipeline_cache.cpp:CompileModule:462: Compiling vs shader 0xc77a0097 (permutation)

And so forth.
P.S. If I didn't tell you something new and useful, then I apologize.

@baggins183
Copy link
Contributor Author

if you were crashing before and this did or didnt fix it let me know your gpu, driver, and OS. Also whether your on proprietary or radv drivers or whatever.

@baggins183
Copy link
Contributor Author

also make sure your game is unmodded. I dont know anything about sfx mods

@artixomag
Copy link

Amd Gpu 6700 XT with driver 24.20.19 on Windows, the new tess build works and displays all the effects.

@baggins183
Copy link
Contributor Author

just a rebase

@Randomuser8219
Copy link
Contributor

i think we should rebase again considering the recent progress on main

@rafael-57
Copy link
Contributor

If you're going to rebase, since more-kernel has been merged, this hack shouldn't be needed anymore
image

@Foul-Tarnished
Copy link

Is there a way to skip shaders with this PR ?
For #1547 workaround

@rafael-57
Copy link
Contributor

rafael-57 commented Nov 25, 2024

It seems people merged this on top of current main and found that tess works in Dark Souls 3 too:
https://discord.com/channels/1080089157554155590/1275172743146639494/1310291883339288577
https://discord.com/channels/1080089157554155590/1275172743146639494/1310308828407005287

Without tess. lots of effects don't work.

So yeah it's a very similar game to BB, but at least we've found another game that uses tess. :D

@MajorP93
Copy link
Contributor

@baggins183 Due to the recent changes to main I think it would make sense to rebase again. Thanks a lot in advance!

@rafael-57
Copy link
Contributor

rafael-57 commented Nov 30, 2024

For Bloodborne, people on discord noticed that some particle effects are not displayed even with this PR :o

  1. Black particles during warp - Numity (https://youtu.be/Z4HjrmczFss?si=y8f_64tO9L_8ixtF&t=2205)
  2. Snow particles in Cainhurst - Roamic
  3. Some particles during viscerals - Numity (not sure about this)

Not sure if it's related to tess, but since all other particle effects were I thought I would post here.

@Virgula0
Copy link
Contributor

For Bloodborne, Numity on discord noticed that some particle effects are not displayed still :o

  1. Black particles during warp: https://youtu.be/Z4HjrmczFss?si=y8f_64tO9L_8ixtF&t=2207
  2. Blood particles during a visceral attack
  3. Snow particles in Cainhurst (noticed by Roamic)

Not sure if it's related to tess, but since all other particle effects where I thought I would post here.

I would add fire particles missing too

image

Again here not sure if related to tess

@rafael-57
Copy link
Contributor

For Bloodborne, Numity on discord noticed that some particle effects are not displayed still :o

  1. Black particles during warp: https://youtu.be/Z4HjrmczFss?si=y8f_64tO9L_8ixtF&t=2207
  2. Blood particles during a visceral attack
  3. Snow particles in Cainhurst (noticed by Roamic)

Not sure if it's related to tess, but since all other particle effects where I thought I would post here.

I would add fire particles missing too

image

Again here not sure if related to tess

It doesn't look like you're using this tess. branch. Fire effects have been fixed for a while with it.

@Virgula0
Copy link
Contributor

Virgula0 commented Nov 30, 2024

@rafael-57

It doesn't look like you're using this tess. branch. Fire effects have been fixed for a while with it.

Oh I didn't know they were fixed already on this branch. Gonna test as soon as possible.

@Virgula0
Copy link
Contributor

Virgula0 commented Dec 2, 2024

@rafael-57

It doesn't look like you're using this tess. branch. Fire effects have been fixed for a while with it.

Oh I didn't know they were fixed already on this branch. Gonna test as soon as possible.

I can confirm that this PR already solved this

@Foul-Tarnished
Copy link

Why is this PR still as draft ?
Need more work or testing ?

@baggins183 baggins183 marked this pull request as ready for review December 14, 2024 08:39
Copy link
Contributor

@raphaelthegreat raphaelthegreat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work!

@raphaelthegreat raphaelthegreat merged commit 3c0c921 into shadps4-emu:main Dec 14, 2024
10 checks passed
diegolix29 pushed a commit to diegolix29/shadPS4 that referenced this pull request Dec 15, 2024
* shader_recompiler: Tessellation WIP

* fix compiler errors after merge

DONT MERGE set log file to /dev/null

DONT MERGE linux pthread bb fix

save work

DONT MERGE dump ir

save more work

fix mistake with ES shader

skip list

add input patch control points dynamic state

random stuff

* WIP Tessellation partial implementation. Squash commits

* test: make local/tcs use attr arrays

* attr arrays in TCS/TES

* dont define empty attr arrays

* switch to special opcodes for tess tcs/tes reads and tcs writes

* impl tcs/tes read attr insts

* rebase fix

* save some work

* save work probably broken and slow

* put Vertex LogicalStage after TCS and TES to fix bindings

* more refactors

* refactor pattern matching and optimize modulos (disabled)

* enable modulo opt

* copyright

* rebase fixes

* remove some prints

* remove some stuff

* Add TCS/TES support for shader patching and use LogicalStage

* refactor and handle wider DS instructions

* get rid of GetAttributes for special tess constants reads. Immediately replace some upon seeing readconstbuffer. Gets rid of some extra passes over IR

* stop relying on GNMX HsConstants struct. Change runtime_info.hs_info and some regs

* delete some more stuff

* update comments for current implementation

* some cleanup

* uint error

* more cleanup

* remove patch control points dynamic state (because runtime_info already depends on it)

* fix potential problem with determining passthrough

---------

Co-authored-by: IndecisiveTurtle <[email protected]>
@baggins183 baggins183 deleted the tess branch December 16, 2024 03:47
Xcedf added a commit to Xcedf/shadPS4 that referenced this pull request Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.