Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
flycast
Commits
ddb617ae
Unverified
Commit
ddb617ae
authored
Mar 22, 2021
by
Libretro-Admin
Committed by
GitHub
Mar 22, 2021
Browse files
Merge pull request #1058 from bslenul/master
Revert the KoFXI Mali fix again
parents
431d8d37
baf03f93
Pipeline
#19288
passed with stages
in 12 minutes and 14 seconds
Changes
4
Pipelines
5
Hide whitespace changes
Inline
Side-by-side
core/rend/gl4/gl4.h
View file @
ddb617ae
...
...
@@ -251,7 +251,7 @@ extern struct gl4ShaderUniforms_t
float
fog_clamp_min
[
4
];
float
fog_clamp_max
[
4
];
glm
::
mat4
normal_mat
;
in
t
palette_index
;
floa
t
palette_index
;
struct
{
bool
enabled
;
...
...
@@ -316,7 +316,7 @@ extern struct gl4ShaderUniforms_t
glUniformMatrix4fv
(
s
->
normal_matrix
,
1
,
GL_FALSE
,
&
normal_mat
[
0
][
0
]);
if
(
s
->
palette_index
!=
-
1
)
glUniform1
i
(
s
->
palette_index
,
palette_index
);
glUniform1
f
(
s
->
palette_index
,
palette_index
);
}
}
gl4ShaderUniforms
;
...
...
core/rend/gl4/gldraw.cpp
View file @
ddb617ae
...
...
@@ -145,9 +145,9 @@ static void SetGPState(const PolyParam* gp)
if
(
palette
)
{
if
(
gp
->
tcw
.
PixelFmt
==
PixelPal4
)
gl4ShaderUniforms
.
palette_index
=
gp
->
tcw
.
PalSelect
<<
4
;
gl4ShaderUniforms
.
palette_index
=
float
(
gp
->
tcw
.
PalSelect
<<
4
)
/
1023.
f
;
else
gl4ShaderUniforms
.
palette_index
=
(
gp
->
tcw
.
PalSelect
>>
4
)
<<
8
;
gl4ShaderUniforms
.
palette_index
=
float
(
(
gp
->
tcw
.
PalSelect
>>
4
)
<<
8
)
/
1023.
f
;
}
gl4ShaderUniforms
.
tsp0
=
gp
->
tsp
;
...
...
core/rend/gl4/gles.cpp
View file @
ddb617ae
...
...
@@ -107,7 +107,7 @@ uniform float trilinear_alpha;
uniform vec4 fog_clamp_min;
uniform vec4 fog_clamp_max;
uniform sampler2D palette;
uniform
in
t palette_index;
uniform
floa
t palette_index;
uniform ivec2 blend_mode[2];
#if pp_TwoVolumes == 1
...
...
@@ -148,9 +148,8 @@ vec4 fog_clamp(vec4 col)
vec4 palettePixel(sampler2D tex, vec2 coords)
{
int color_idx = int(floor(texture(tex, coords).r * 255.0 + 0.5)) + palette_index;
vec2 c = vec2(float(color_idx % 32) / 31.0, float(color_idx / 32) / 31.0);
return texture(palette, c);
vec4 c = vec4(texture(tex, coords).r * 255.0 / 1023.0 + palette_index, 0.5, 0.0, 0.0);
return texture(palette, c.xy);
}
#endif
...
...
core/rend/gles/gles.cpp
View file @
ddb617ae
...
...
@@ -194,8 +194,7 @@ highp vec4 fog_clamp(highp vec4 col)
lowp vec4 palettePixel(highp vec2 coords)
{
highp int color_idx = int(floor(texture(tex, coords).FOG_CHANNEL * 255.0 + 0.5)) + palette_index;
highp vec2 c = vec2(mod(float(color_idx), 32.0) / 31.0, float(color_idx / 32) / 31.0);
highp vec2 c = vec2((texture(tex, coords).FOG_CHANNEL * 255.0 + float(palette_index)) / 1023.0, 0.5);
return texture(palette, c);
}
...
...
@@ -754,7 +753,7 @@ void UpdatePaletteTexture(GLenum texture_slot)
glcache
.
BindTexture
(
GL_TEXTURE_2D
,
paletteTextureId
);
glPixelStorei
(
GL_UNPACK_ALIGNMENT
,
1
);
glTexImage2D
(
GL_TEXTURE_2D
,
0
,
GL_RGBA
,
32
,
32
,
0
,
GL_RGBA
,
GL_UNSIGNED_BYTE
,
palette32_ram
);
glTexImage2D
(
GL_TEXTURE_2D
,
0
,
GL_RGBA
,
1024
,
1
,
0
,
GL_RGBA
,
GL_UNSIGNED_BYTE
,
palette32_ram
);
glCheck
();
glActiveTexture
(
GL_TEXTURE0
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment