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