mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-25 15:19:42 -06:00
use GL_TEXTURE_2D_ARRAY for most of our textures
This commit is contained in:
@ -206,7 +206,7 @@ static inline void GeneratePixelShader(T& out, DSTALPHA_MODE dstAlphaMode, API_T
|
||||
{
|
||||
// Declare samplers
|
||||
for (int i = 0; i < 8; ++i)
|
||||
out.Write("SAMPLER_BINDING(%d) uniform sampler2D samp%d;\n", i, i);
|
||||
out.Write("SAMPLER_BINDING(%d) uniform sampler2DArray samp%d;\n", i, i);
|
||||
}
|
||||
else // D3D
|
||||
{
|
||||
@ -931,7 +931,7 @@ static inline void SampleTexture(T& out, const char *texcoords, const char *texs
|
||||
if (ApiType == API_D3D)
|
||||
out.Write("iround(255.0 * Tex%d.Sample(samp%d,%s.xy * " I_TEXDIMS"[%d].xy)).%s;\n", texmap,texmap, texcoords, texmap, texswap);
|
||||
else
|
||||
out.Write("iround(255.0 * texture(samp%d,%s.xy * " I_TEXDIMS"[%d].xy)).%s;\n", texmap, texcoords, texmap, texswap);
|
||||
out.Write("iround(255.0 * texture(samp%d, float3(%s.xy * " I_TEXDIMS"[%d].xy, 0.0))).%s;\n", texmap, texcoords, texmap, texswap);
|
||||
}
|
||||
|
||||
static const char *tevAlphaFuncsTable[] =
|
||||
|
@ -70,7 +70,7 @@ static void WriteSwizzler(char*& p, u32 format, API_TYPE ApiType)
|
||||
if (ApiType == API_OPENGL)
|
||||
{
|
||||
WRITE(p, "#define samp0 samp9\n");
|
||||
WRITE(p, "SAMPLER_BINDING(9) uniform sampler2D samp0;\n");
|
||||
WRITE(p, "SAMPLER_BINDING(9) uniform sampler2DArray samp0;\n");
|
||||
|
||||
WRITE(p, " out vec4 ocol0;\n");
|
||||
WRITE(p, "void main()\n");
|
||||
@ -120,7 +120,7 @@ static void WriteSwizzler(char*& p, u32 format, API_TYPE ApiType)
|
||||
|
||||
static void WriteSampleColor(char*& p, const char* colorComp, const char* dest, int xoffset, API_TYPE ApiType)
|
||||
{
|
||||
WRITE(p, " %s = texture(samp0, uv0 + float2(%d, 0) * sample_offset).%s;\n",
|
||||
WRITE(p, " %s = texture(samp0, float3(uv0 + float2(%d, 0) * sample_offset, 0.0)).%s;\n",
|
||||
dest, xoffset, colorComp
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user