mirror of https://github.com/xemu-project/xemu.git
nv2a/psh: Handle 3D textures in PROJECT2D mode
This commit is contained in:
parent
6e3dfb36d8
commit
a143f66ce4
|
@ -576,11 +576,15 @@ static const char *get_sampler_type(enum PS_TEXTUREMODES mode, const PshState *s
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
case PS_TEXTUREMODES_PROJECT2D:
|
case PS_TEXTUREMODES_PROJECT2D:
|
||||||
assert(state->dim_tex[i] == 2);
|
if (state->dim_tex[i] == 2) {
|
||||||
if (state->tex_x8y24[i] && state->vulkan) {
|
if (state->tex_x8y24[i] && state->vulkan) {
|
||||||
return "usampler2D";
|
return "usampler2D";
|
||||||
|
}
|
||||||
|
return sampler2D;
|
||||||
}
|
}
|
||||||
return sampler2D;
|
if (state->dim_tex[i] == 3) return sampler3D;
|
||||||
|
assert(!"Unhandled texture dimensions");
|
||||||
|
return NULL;
|
||||||
|
|
||||||
case PS_TEXTUREMODES_BUMPENVMAP:
|
case PS_TEXTUREMODES_BUMPENVMAP:
|
||||||
case PS_TEXTUREMODES_BUMPENVMAP_LUM:
|
case PS_TEXTUREMODES_BUMPENVMAP_LUM:
|
||||||
|
@ -712,6 +716,7 @@ static void apply_border_adjustment(const struct PixelShader *ps, MString *vars,
|
||||||
|
|
||||||
static void apply_convolution_filter(const struct PixelShader *ps, MString *vars, int tex)
|
static void apply_convolution_filter(const struct PixelShader *ps, MString *vars, int tex)
|
||||||
{
|
{
|
||||||
|
assert(ps->state.dim_tex[tex] == 2);
|
||||||
// FIXME: Quincunx
|
// FIXME: Quincunx
|
||||||
|
|
||||||
g_autofree gchar *normalize_tex_coords = g_strdup_printf("norm%d", tex);
|
g_autofree gchar *normalize_tex_coords = g_strdup_printf("norm%d", tex);
|
||||||
|
@ -956,8 +961,15 @@ static MString* psh_convert(struct PixelShader *ps)
|
||||||
(ps->state.conv_tex[i] == CONVOLUTION_FILTER_QUINCUNX))) {
|
(ps->state.conv_tex[i] == CONVOLUTION_FILTER_QUINCUNX))) {
|
||||||
apply_convolution_filter(ps, vars, i);
|
apply_convolution_filter(ps, vars, i);
|
||||||
} else {
|
} else {
|
||||||
mstring_append_fmt(vars, "vec4 t%d = textureProj(texSamp%d, %s(pT%d.xyw));\n",
|
if (ps->state.dim_tex[i] == 2) {
|
||||||
i, i, tex_remap, i);
|
mstring_append_fmt(vars, "vec4 t%d = textureProj(texSamp%d, %s(pT%d.xyw));\n",
|
||||||
|
i, i, tex_remap, i);
|
||||||
|
} else if (ps->state.dim_tex[i] == 3) {
|
||||||
|
mstring_append_fmt(vars, "vec4 t%d = textureProj(texSamp%d, vec4(pT%d.xy, 0.0, pT%d.w));\n",
|
||||||
|
i, i, i, i);
|
||||||
|
} else {
|
||||||
|
assert(!"Unhandled texture dimensions");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue