[GPU] Properly handle scaled textures and weights

Fix d3d12 logic wrt scaling weights, add vulkan impelementation for using
scaled texture offsets and fix resolution-scaled texture detection
This commit is contained in:
Herman S.
2025-12-13 08:50:29 +09:00
parent 55f0333182
commit cd7b47235d
6 changed files with 126 additions and 54 deletions

View File

@@ -34,7 +34,7 @@ class SpirvShaderTranslator : public ShaderTranslator {
// TODO(Triang3l): Change to 0xYYYYMMDD once it's out of the rapid
// prototyping stage (easier to do small granular updates with an
// incremental counter).
static constexpr uint32_t kVersion = 6;
static constexpr uint32_t kVersion = 7;
enum class DepthStencilMode : uint32_t {
kNoModifiers,
@@ -202,6 +202,10 @@ class SpirvShaderTranslator : public ShaderTranslator {
// swizzles for 2 texture fetch constants (in bits 0:11 and 12:23).
uint32_t texture_swizzles[16];
// Whether the contents of each texture in fetch constants comes from a
// resolve operation (bit per texture, 32 textures max).
uint32_t textures_resolved;
float alpha_test_reference;
uint32_t edram_32bpp_tile_pitch_dwords_scaled;
uint32_t edram_depth_base_dwords_scaled;
@@ -821,6 +825,7 @@ class SpirvShaderTranslator : public ShaderTranslator {
kSystemConstantPointScreenDiameterToNdcRadius,
kSystemConstantTextureSwizzledSigns,
kSystemConstantTextureSwizzles,
kSystemConstantTexturesResolved,
kSystemConstantAlphaTestReference,
kSystemConstantEdram32bppTilePitchDwordsScaled,
kSystemConstantEdramDepthBaseDwordsScaled,