OpenGL: Fix swizzle code again for alpha textures
My prior code was incorrect; I mixed up the two parameters, the GL_TEXTURE_SWIZZLE_* parameter specifies the target channel, and the value itself specifies the source channel., If that makes sense.
This commit is contained in:
parent
51d338430f
commit
0bec267e40
@ -322,8 +322,12 @@ static void strip_mipmap_filter(GLint *filter)
|
|||||||
|
|
||||||
static inline void apply_swizzle(struct gs_texture *tex)
|
static inline void apply_swizzle(struct gs_texture *tex)
|
||||||
{
|
{
|
||||||
if (tex->format == GS_A8)
|
if (tex->format == GS_A8) {
|
||||||
gl_tex_param_i(tex->gl_target, GL_TEXTURE_SWIZZLE_R, GL_ALPHA);
|
gl_tex_param_i(tex->gl_target, GL_TEXTURE_SWIZZLE_R, GL_ONE);
|
||||||
|
gl_tex_param_i(tex->gl_target, GL_TEXTURE_SWIZZLE_G, GL_ONE);
|
||||||
|
gl_tex_param_i(tex->gl_target, GL_TEXTURE_SWIZZLE_B, GL_ONE);
|
||||||
|
gl_tex_param_i(tex->gl_target, GL_TEXTURE_SWIZZLE_A, GL_RED);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool load_texture_sampler(texture_t tex, samplerstate_t ss)
|
static bool load_texture_sampler(texture_t tex, samplerstate_t ss)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user