gl/vk: Enable vertex texture fetch - #2127
Conversation
|
@kd-11, thanks for your PR! By analyzing the annotation information on this pull request, we identified @vlj, @raven02 and @Nekotekina to be potential reviewers |
|
@raven02 Please check for regressions. The vertex texture sample works, |
|
Spurious build failure with appveyor. |
|
Nice @kd-11 .Will check it for regression once the appveyor build ok |
|
Hatsune Miku Dreamy Theater, 2nd, and extend can now boot ps: someone should restart appveyor, since it didn't had any build errors (at least i can't see any), and also VS builds fine |
|
I tested a bit as well and looks okay for most games. Fix #1850 |
|
Thats good news. Will update with vulkan and dx12 support. |
|
Fixed opengl vertex issue, it seems rsx decode returns 0x7fffffff when restart index is 0xffffffff. For some reason bit 31 is 0 when it shouldn't be. D3D12 vertex textures is still WIP. I'm almost certain I messed up the descriptor bindings somehow and I'm short on time to keep digging. @vlj please take a look (I get the invalid parameter error) @raven02 please test for vulkan and ogl regressions Some more work needs to go into the decompiler itself to get the vertex index being sampled. The dst opcode structure still contains some unknowns. I'll have to ask from those familiar with rsx internals (@vlj) or refer to nouveau docs for the ISA. If anyone has insight into this feel free to chip in. Should probably be a 2-bit encoding in one of the Dx sections. |
| CELL_GCM_TEXTURE_MAX_ANISO_16 = 7, | ||
|
|
||
| // Texture Filter | ||
| CELL_GCM_TEXTURE_FILTER_NONE = 0, |
There was a problem hiding this comment.
Vertex textures do not specify filtering. In the geforce 7 era, filtering vertex textures was not supported at all. I checked this, and on the vertex_texture sample, texture filter modes are set to 0.
EDIT: I could optionally remove that enum and make calls to vertex_texture::min/mag_filter() always return CELL_GCM_TEXTURE_FILTER_NEAREST.
There was a problem hiding this comment.
Whatever they do, CELL_GCM_TEXTURE_FILTER_NONE simply doesn't exist. We didn't invent these constants, it's confusing. And note my recent issue about gcm_enums, this problem seems relevant that the values are checked in the situation they shouldn't.
|
Tested for some games with both GL and Vulkan backend .It looks good. |
|
@kd-11 |
|
I'll have to revert some texture format changes on vulkan/gl. |
|
@SakataGintokiYT Are the vulkan/gl issues regressions? If so, @raven02 I'll need your help to figure out which texture format I botched here. I only changed swizzles for X32/16 and W32_Z32_Y32_X32 which were wrong based on inspection of shader code using the textures. |
4df75d4 to
d2da682
Compare
|
@SakataGintokiYT , is master also broken the Naruto as well ? as i found some games already broken with master and not related to this vertex texture enhancement. |
|
Thanks for checking this out .It would be nice if you can cross check which commit start the breaking so we can fix the regression . |
|
Naruto games only work in DX12 . Never work correctly on Vulkan and OGL so it's not a regression |
9391c8b to
d54b802
Compare
|
I've removed dx12 part for now. The shaders and upload code is fine, but the resource binding/descriptor stuff is causing a mismatch. See https://github.com/kd-11/rpcs3/tree/dx12 Travis-Ci and appveyor are crashing before compilation starts, I'm not sure why. Should be good to go as part 1 for now as it shouldn't cause any regressions. |
|
Need someone to restart appveyor |
remove old logging method that overwrites single file
revert inadvertent decompiler update
|
Appveyor failing again during pre-compilation setup |
|
@Nekotekina , please help to restart the appveyor. |
* Porting of DH's user clip implementation in gl * Tweak clang-format * rsx: Move inline array to draw_clause structure. * rsx: Use variant based draw commands. * rsx: Dump DRAW_ARRAYS and DRAW_INDEX_ARRAYS. * GL: old recompiler clean up (#2142) * RSX texture refactor (#2144) * gl/vk: Enable vertex texture fetch (#2127) * gl: Enable vertex textures * rsx: use textureLod instead of generic texture sample * rsx: handle uploading of W32_X32_Y32_Z32 * gl: Re-enable proper shader logging remove old logging method that overwrites single file * gl: Declare texture_coord_scale for vertex samplers * gl: texture remap fixes; enable remap for vertex textures * gl: offset texture indices to base layer 16 * rsx: Fix W32_Z32_Y32_X32_FLOAT subresource layout * vk: Enable vertex textures * rsx: define special calls for vertex texture fetch * gl: improved vertex texture fetch setup * vk: Fix texture formats and component mapping * vk: Implement vertex texture fetch functions properly * vk/gl: proper fix for primitive restart index revert inadvertent decompiler update * gl: Disable filtering for vertex textures * Hopefully fix appveyor build (#2148) * GL/Vulkan: Bug fixes and improvements; alphakill for vulkan (#2146) * vk: Zero-initialize some more structs * gl: Clean up fragment program generation code * vk: Enable alpha kill * vk: Fix surface clear; redirect output for surface_type:b * vk: Tie renderpass to program object to avoid incompatible passes * vk: Properly compute descriptor pool size (#2150) * rsx: Set default attribute format to float. * rsx: vertex attribute size is 1 again for CMP, let backend handles this formats properties. * rsx: Move printing function in a separate header/cpp * Porting of DH's user clip implementation in gl




Enable vertex textures.
Most of the rsx side was already done, so adding to the renderer should not be a big deal.
However, currently, the decompiler only addresses vertex texture 0.
This PR enables vertex texture fetch in GL backend only (for now)