提交 0bec267e 编写于 作者: J jp9000

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.
上级 51d33843
......@@ -322,8 +322,12 @@ static void strip_mipmap_filter(GLint *filter)
static inline void apply_swizzle(struct gs_texture *tex)
{
if (tex->format == GS_A8)
gl_tex_param_i(tex->gl_target, GL_TEXTURE_SWIZZLE_R, GL_ALPHA);
if (tex->format == GS_A8) {
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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册