mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-08 04:08:32 +09:00
[Fix] (MG_Test/ProgramTest): fix wrong decomp source output
This commit is contained in:
@@ -1063,6 +1063,7 @@ float fog_cylindrical_distance(vec3 pos) {
|
||||
return max(distXZ, distY);
|
||||
}
|
||||
|
||||
uniform float fTime;
|
||||
|
||||
layout(std140) uniform Globals {
|
||||
ivec3 CameraBlockPos;
|
||||
@@ -1165,7 +1166,7 @@ vec4 sampleRGSS(sampler2D source, vec2 uv, vec2 pixelSize) {
|
||||
|
||||
void main() {
|
||||
vec4 color = (UseRgss == 1 ? sampleRGSS(Sampler0, texCoord0, 1.0f / TextureSize) : sampleNearest(Sampler0, texCoord0, 1.0f / TextureSize)) * vertexColor;
|
||||
color = mix(FogColor * vec4(1, 1, 1, color.a), color, ChunkVisibility);
|
||||
color = mix(FogColor * vec4(1, 1, 1, color.a * fTime), color, ChunkVisibility);
|
||||
#ifdef ALPHA_CUTOUT
|
||||
if (color.a < ALPHA_CUTOUT) {
|
||||
discard;
|
||||
@@ -1207,8 +1208,7 @@ TEST_F(ProgramTest, CompileShaderWithSamplerAsVarName) {
|
||||
|
||||
auto programObject = MG_State::pGLContext->GetCurrentProgram();
|
||||
auto& spirvs = programObject->GetGeneratedSpirv();
|
||||
auto& fragSpirv = spirvs[0]; // 0 - fragment, 1 - vertex
|
||||
char* pSrcfragOut = nullptr;
|
||||
auto& fragSpirv = spirvs[programObject->GetShaderIndexByStage(ShaderStage::Fragment)];
|
||||
MG_Util::ShaderTranspiler::SpvcSession spvcSession(fragSpirv);
|
||||
spvc_compiler_options options;
|
||||
spvcSession.CreateOptions(&options);
|
||||
@@ -1221,5 +1221,5 @@ TEST_F(ProgramTest, CompileShaderWithSamplerAsVarName) {
|
||||
|
||||
const char* result = nullptr;
|
||||
spvcSession.Compile(&result);
|
||||
printf("%s\n\n", result);
|
||||
printf("decomp from fragSpirv:\n%s\n\n", result);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user