Skip to content

Commit

Permalink
Update Vulkan
Browse files Browse the repository at this point in the history
  • Loading branch information
durswd committed Aug 19, 2023
1 parent 2d6c0bb commit 82ae1f2
Show file tree
Hide file tree
Showing 150 changed files with 7,303 additions and 6,046 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,6 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
if (BUILD_VULKAN)
set_target_properties (EP_glslang PROPERTIES FOLDER Thirdparty/glslang)
set_target_properties (EP_SPIRV-Cross PROPERTIES FOLDER Thirdparty/glslang)
set_target_properties (glslang-build-info PROPERTIES FOLDER Thirdparty/glslang)
set_target_properties (GenericCodeGen PROPERTIES FOLDER Thirdparty/glslang)
set_target_properties (glslang PROPERTIES FOLDER Thirdparty/glslang)
set_target_properties (MachineIndependent PROPERTIES FOLDER Thirdparty/glslang)
Expand Down
2 changes: 1 addition & 1 deletion Dev/Cpp/3rdParty/LLGI
Submodule LLGI updated 32 files
+48 −7 CMakeLists.txt
+5 −6 src/CMakeLists.txt
+15 −0 src/DX12/LLGI.BaseDX12.cpp
+1 −4 src/DX12/LLGI.CommandListDX12.cpp
+3 −0 src/LLGI.Base.h
+12 −0 src/Metal/LLGI.Metal_Impl.mm
+3 −0 src/Vulkan/LLGI.BaseVulkan.cpp
+2 −112 src/Vulkan/LLGI.CompilerVulkan.cpp
+6 −4 src_test/Shaders/GLSL_GL/vtf.vert
+1 −1 src_test/Shaders/GLSL_VULKAN/simple_mrt_texture_rectangle.frag
+1 −1 src_test/Shaders/GLSL_VULKAN/simple_texture_rectangle.frag
+3 −3 src_test/Shaders/GLSL_VULKAN/textures.frag
+5 −3 src_test/Shaders/GLSL_VULKAN/vtf.vert
+4 −2 src_test/Shaders/Metal/vtf.vert
+ src_test/Shaders/SPIRV/basic.comp.spv
+ src_test/Shaders/SPIRV/instancing.vert.spv
+ src_test/Shaders/SPIRV/simple_compute_rectangle.frag.spv
+ src_test/Shaders/SPIRV/simple_compute_rectangle.vert.spv
+ src_test/Shaders/SPIRV/simple_constant_rectangle.frag.spv
+ src_test/Shaders/SPIRV/simple_constant_rectangle.vert.spv
+ src_test/Shaders/SPIRV/simple_mrt_texture_rectangle.frag.spv
+ src_test/Shaders/SPIRV/simple_rectangle.frag.spv
+ src_test/Shaders/SPIRV/simple_rectangle.vert.spv
+ src_test/Shaders/SPIRV/simple_texture_rectangle.frag.spv
+ src_test/Shaders/SPIRV/simple_texture_rectangle.vert.spv
+ src_test/Shaders/SPIRV/textures.frag.spv
+ src_test/Shaders/SPIRV/vtf.vert.spv
+1 −1 thirdparty/glslang
+1 −2 tools/ShaderTranspilerCore/CMakeLists.txt
+0 −497 tools/ShaderTranspilerCore/ResourceLimits.cpp
+0 −58 tools/ShaderTranspilerCore/ResourceLimits.h
+7 −6 tools/ShaderTranspilerCore/ShaderTranspilerCore.cpp
2 changes: 1 addition & 1 deletion Dev/Cpp/3rdParty/glslang
Submodule glslang updated 1453 files
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ struct AdvancedParameter

cbuffer PS_ConstantBuffer : register(b1)
{
float4 _377_g_scale : packoffset(c0);
float4 _377_mUVInversedBack : packoffset(c1);
float4 _377_fFlipbookParameter : packoffset(c2);
float4 _377_fUVDistortionParameter : packoffset(c3);
float4 _377_fBlendTextureParameter : packoffset(c4);
float4 _377_softParticleParam : packoffset(c5);
float4 _377_reconstructionParam1 : packoffset(c6);
float4 _377_reconstructionParam2 : packoffset(c7);
float4 _393_g_scale : packoffset(c0);
float4 _393_mUVInversedBack : packoffset(c1);
float4 _393_fFlipbookParameter : packoffset(c2);
float4 _393_fUVDistortionParameter : packoffset(c3);
float4 _393_fBlendTextureParameter : packoffset(c4);
float4 _393_softParticleParam : packoffset(c5);
float4 _393_reconstructionParam1 : packoffset(c6);
float4 _393_reconstructionParam2 : packoffset(c7);
};

Texture2D<float4> _uvDistortionTex : register(t3);
Expand Down Expand Up @@ -161,29 +161,41 @@ void ApplyTextureBlending(inout float4 dstColor, float4 blendColor, float blendT
{
if (blendType == 0.0f)
{
float3 _172 = (blendColor.xyz * blendColor.w) + (dstColor.xyz * (1.0f - blendColor.w));
dstColor = float4(_172.x, _172.y, _172.z, dstColor.w);
float4 _169 = dstColor;
float3 _172 = (blendColor.xyz * blendColor.w) + (_169.xyz * (1.0f - blendColor.w));
dstColor.x = _172.x;
dstColor.y = _172.y;
dstColor.z = _172.z;
}
else
{
if (blendType == 1.0f)
{
float3 _184 = dstColor.xyz + (blendColor.xyz * blendColor.w);
dstColor = float4(_184.x, _184.y, _184.z, dstColor.w);
float4 _187 = dstColor;
float3 _189 = _187.xyz + (blendColor.xyz * blendColor.w);
dstColor.x = _189.x;
dstColor.y = _189.y;
dstColor.z = _189.z;
}
else
{
if (blendType == 2.0f)
{
float3 _197 = dstColor.xyz - (blendColor.xyz * blendColor.w);
dstColor = float4(_197.x, _197.y, _197.z, dstColor.w);
float4 _204 = dstColor;
float3 _206 = _204.xyz - (blendColor.xyz * blendColor.w);
dstColor.x = _206.x;
dstColor.y = _206.y;
dstColor.z = _206.z;
}
else
{
if (blendType == 3.0f)
{
float3 _210 = dstColor.xyz * (blendColor.xyz * blendColor.w);
dstColor = float4(_210.x, _210.y, _210.z, dstColor.w);
float4 _221 = dstColor;
float3 _223 = _221.xyz * (blendColor.xyz * blendColor.w);
dstColor.x = _223.x;
dstColor.y = _223.y;
dstColor.z = _223.z;
}
}
}
Expand Down Expand Up @@ -211,29 +223,29 @@ float4 _main(PS_Input Input)
PS_Input param = Input;
AdvancedParameter advancedParam = DisolveAdvancedParameter(param);
float2 param_1 = advancedParam.UVDistortionUV;
float2 param_2 = _377_fUVDistortionParameter.zw;
float2 param_2 = _393_fUVDistortionParameter.zw;
bool param_3 = false;
float2 UVOffset = UVDistortionOffset(_uvDistortionTex, sampler_uvDistortionTex, param_1, param_2, param_3);
UVOffset *= _377_fUVDistortionParameter.x;
UVOffset *= _393_fUVDistortionParameter.x;
float4 Output = _colorTex.Sample(sampler_colorTex, float2(Input.UV_Others.xy) + UVOffset);
Output.w *= Input.Color.w;
float4 param_4 = Output;
float param_5 = advancedParam.FlipbookRate;
bool param_6 = false;
ApplyFlipbook(param_4, _colorTex, sampler_colorTex, _377_fFlipbookParameter, Input.Color, advancedParam.FlipbookNextIndexUV + UVOffset, param_5, param_6);
ApplyFlipbook(param_4, _colorTex, sampler_colorTex, _393_fFlipbookParameter, Input.Color, advancedParam.FlipbookNextIndexUV + UVOffset, param_5, param_6);
Output = param_4;
float4 AlphaTexColor = _alphaTex.Sample(sampler_alphaTex, advancedParam.AlphaUV + UVOffset);
Output.w *= (AlphaTexColor.x * AlphaTexColor.w);
float2 param_7 = advancedParam.BlendUVDistortionUV;
float2 param_8 = _377_fUVDistortionParameter.zw;
float2 param_8 = _393_fUVDistortionParameter.zw;
bool param_9 = false;
float2 BlendUVOffset = UVDistortionOffset(_blendUVDistortionTex, sampler_blendUVDistortionTex, param_7, param_8, param_9);
BlendUVOffset *= _377_fUVDistortionParameter.y;
BlendUVOffset *= _393_fUVDistortionParameter.y;
float4 BlendTextureColor = _blendTex.Sample(sampler_blendTex, advancedParam.BlendUV + BlendUVOffset);
float4 BlendAlphaTextureColor = _blendAlphaTex.Sample(sampler_blendAlphaTex, advancedParam.BlendAlphaUV + BlendUVOffset);
BlendTextureColor.w *= (BlendAlphaTextureColor.x * BlendAlphaTextureColor.w);
float4 param_10 = Output;
ApplyTextureBlending(param_10, BlendTextureColor, _377_fBlendTextureParameter.x);
ApplyTextureBlending(param_10, BlendTextureColor, _393_fBlendTextureParameter.x);
Output = param_10;
if (Output.w <= max(0.0f, advancedParam.AlphaThreshold))
{
Expand All @@ -242,25 +254,27 @@ float4 _main(PS_Input Input)
float2 pos = Input.PosP.xy / Input.PosP.w.xx;
float2 posR = Input.ProjTangent.xy / Input.ProjTangent.w.xx;
float2 posU = Input.ProjBinormal.xy / Input.ProjBinormal.w.xx;
float xscale = (((Output.x * 2.0f) - 1.0f) * Input.Color.x) * _377_g_scale.x;
float yscale = (((Output.y * 2.0f) - 1.0f) * Input.Color.y) * _377_g_scale.x;
float xscale = (((Output.x * 2.0f) - 1.0f) * Input.Color.x) * _393_g_scale.x;
float yscale = (((Output.y * 2.0f) - 1.0f) * Input.Color.y) * _393_g_scale.x;
float2 uv = (pos + ((posR - pos) * xscale)) + ((posU - pos) * yscale);
uv.x = (uv.x + 1.0f) * 0.5f;
uv.y = 1.0f - ((uv.y + 1.0f) * 0.5f);
uv.y = _377_mUVInversedBack.x + (_377_mUVInversedBack.y * uv.y);
uv.y = _393_mUVInversedBack.x + (_393_mUVInversedBack.y * uv.y);
float3 color = float3(_backTex.Sample(sampler_backTex, uv).xyz);
Output = float4(color.x, color.y, color.z, Output.w);
Output.x = color.x;
Output.y = color.y;
Output.z = color.z;
float4 screenPos = Input.PosP / Input.PosP.w.xxxx;
float2 screenUV = (screenPos.xy + 1.0f.xx) / 2.0f.xx;
screenUV.y = 1.0f - screenUV.y;
if (_377_softParticleParam.w != 0.0f)
if (_393_softParticleParam.w != 0.0f)
{
float backgroundZ = _depthTex.Sample(sampler_depthTex, screenUV).x;
float param_11 = backgroundZ;
float param_12 = screenPos.z;
float4 param_13 = _377_softParticleParam;
float4 param_14 = _377_reconstructionParam1;
float4 param_15 = _377_reconstructionParam2;
float4 param_13 = _393_softParticleParam;
float4 param_14 = _393_reconstructionParam1;
float4 param_15 = _393_reconstructionParam2;
Output.w *= SoftParticle(param_11, param_12, param_13, param_14, param_15);
}
return Output;
Expand All @@ -278,8 +292,8 @@ void frag_main()
Input.Alpha_Dist_UV = Input_Alpha_Dist_UV;
Input.Blend_Alpha_Dist_UV = Input_Blend_Alpha_Dist_UV;
Input.Blend_FBNextIndex_UV = Input_Blend_FBNextIndex_UV;
float4 _686 = _main(Input);
_entryPointOutput = _686;
float4 _706 = _main(Input);
_entryPointOutput = _706;
}

SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct VS_Input
uint Index;
};

static const VS_Output _510 = { 0.0f.xxxx, 0.0f.xxxx, 0.0f.xxxx, 0.0f.xxxx, 0.0f.xxxx, 0.0f.xxxx, 0.0f.xxxx, 0.0f.xxxx, 0.0f.xxxx };
static const VS_Output _511 = { 0.0f.xxxx, 0.0f.xxxx, 0.0f.xxxx, 0.0f.xxxx, 0.0f.xxxx, 0.0f.xxxx, 0.0f.xxxx, 0.0f.xxxx, 0.0f.xxxx };

cbuffer VS_ConstantBuffer : register(b0)
{
Expand Down Expand Up @@ -215,7 +215,8 @@ void CalculateAndStoreAdvancedParameter(float2 uv, float2 uv1, float4 alphaUV, f
ApplyFlipbookVS(param, param_1, param_2, param_3, param_4, param_5, param_6);
flipbookRate = param;
flipbookNextIndexUV = param_1;
vsoutput.Blend_FBNextIndex_UV = float4(vsoutput.Blend_FBNextIndex_UV.x, vsoutput.Blend_FBNextIndex_UV.y, flipbookNextIndexUV.x, flipbookNextIndexUV.y);
vsoutput.Blend_FBNextIndex_UV.z = flipbookNextIndexUV.x;
vsoutput.Blend_FBNextIndex_UV.w = flipbookNextIndexUV.y;
vsoutput.UV_Others.z = flipbookRate;
vsoutput.UV_Others.w = modelAlphaThreshold;
vsoutput.Alpha_Dist_UV.y = _372_mUVInversed.x + (_372_mUVInversed.y * vsoutput.Alpha_Dist_UV.y);
Expand All @@ -238,15 +239,16 @@ VS_Output _main(VS_Input Input)
float4 modelColor = _372_fModelColor[index] * Input.Color;
float flipbookIndexAndNextRate = _372_fFlipbookIndexAndNextRate[index].x;
float modelAlphaThreshold = _372_fModelAlphaThreshold[index].x;
VS_Output Output = _510;
VS_Output Output = _511;
float4 localPosition = float4(Input.Pos.x, Input.Pos.y, Input.Pos.z, 1.0f);
float4 worldPos = mul(mModel, localPosition);
Output.PosVS = mul(_372_mCameraProj, worldPos);
float2 outputUV = Input.UV;
outputUV.x = (outputUV.x * uv.z) + uv.x;
outputUV.y = (outputUV.y * uv.w) + uv.y;
outputUV.y = _372_mUVInversed.x + (_372_mUVInversed.y * outputUV.y);
Output.UV_Others = float4(outputUV.x, outputUV.y, Output.UV_Others.z, Output.UV_Others.w);
Output.UV_Others.x = outputUV.x;
Output.UV_Others.y = outputUV.y;
float4 localNormal = float4(Input.Normal.x, Input.Normal.y, Input.Normal.z, 0.0f);
float4 localBinormal = float4(Input.Binormal.x, Input.Binormal.y, Input.Binormal.z, 0.0f);
float4 localTangent = float4(Input.Tangent.x, Input.Tangent.y, Input.Tangent.z, 0.0f);
Expand Down
Loading

0 comments on commit 82ae1f2

Please sign in to comment.