Iris Shaders

Iris Shaders

38M Downloads

Weird issue when parsing shaders.properties

moyongxin opened this issue ยท 0 comments

commented

What happened?

Using a tab in a profile:

profile.xxx = A:value<TAB>B

will define the macro A with "value B" and will also define B.
A sample shaderpack which may help to reproduce the issue could be found below.

Screenshots

No response

Log output

No response

Minecraft Version

Minecraft 1.20.4

Iris Version

iris-mc1.20.4-1.6.17.jar

Operating System

Windows 11

What is your GPU?

Nvidia Geforce RTX 3050 Laptop

Additional context

The shaderpack:

// shaders.properties
profile.Default = TEST_MACRO:0.5 !ANOTHER_TEST_MACRO
profile.Test1 = TEST_MACRO:1.0	ANOTHER_TEST_MACRO # There is a tab
profile.Test2 = TEST_MACRO:1.0 ANOTHER_TEST_MACRO # Here is a space
screen = <profile>

// final.vsh
#version 150
// #define ANOTHER_TEST_MACRO
#ifdef ANOTHER_TEST_MACRO
EMM....
#endif
    void
    main() {
  gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
}

// final.fsh
#version 150
#define TEST_MACRO 0.5 // [0.5, 1.0]
out vec4 fragColor;
void main() {
    fragColor = vec4(TEST_MACRO);
}

Patched shaders when using preset Test1:

// patched_shaders/001_errored_final.vsh
#version  150
 

EMM....

    void
    main() {
  gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
}

// patched_shaders/001_errored_final.fsh
#version  150

out vec4 fragColor;
void main() {
    fragColor = vec4(1.0 ANOTHER_TEST_MACRO);
}


Patched shaders when using preset Test2:

// patched_shaders/001_errored_final.vsh
#version  150
 

EMM....

    void
    main() {
  gl_Position = vec4(0.0, 0.0, 0.0, 1.0);
}

// patched_shaders/001_errored_final.fsh
#version  150

out vec4 fragColor;
void main() {
    fragColor = vec4(1.0);
}