mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-30 05:18:13 +08:00
Fixed pixel shader for palettized textures using pixelart scaling
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -152,7 +152,7 @@ float4 GetInputColor(PixelShaderInput input)
|
||||
rgba = texture1.Sample(sampler1, float2((index + 0.5) / 256, 0.5));
|
||||
} else if (texture_type == TEXTURETYPE_PALETTE_PIXELART) {
|
||||
float2 uv = GetPixelArtUV(input);
|
||||
float index = texture0.Sample(sampler0, uv).r * 255;
|
||||
float index = texture0.SampleGrad(sampler0, uv, ddx(input.tex), ddy(input.tex)).r * 255;
|
||||
rgba = texture1.Sample(sampler1, float2((index + 0.5) / 256, 0.5));
|
||||
} else if (texture_type == TEXTURETYPE_NV12) {
|
||||
float3 yuv;
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
//
|
||||
// Name Type Format Dim HLSL Bind Count
|
||||
// ------------------------------ ---------- ------- ----------- -------------- ------
|
||||
// theSampler sampler NA NA s0 1
|
||||
// theTexture texture float4 2d t0 1
|
||||
// sampler0 sampler NA NA s0 1
|
||||
// texture0 texture float4 2d t0 1
|
||||
// Constants cbuffer NA NA cb0 1
|
||||
//
|
||||
//
|
||||
@@ -94,15 +94,15 @@ ret
|
||||
|
||||
const BYTE g_main[] =
|
||||
{
|
||||
68, 88, 66, 67, 59, 235,
|
||||
166, 93, 21, 32, 225, 129,
|
||||
78, 220, 127, 97, 218, 34,
|
||||
222, 113, 1, 0, 0, 0,
|
||||
164, 5, 0, 0, 6, 0,
|
||||
68, 88, 66, 67, 98, 171,
|
||||
127, 123, 23, 170, 245, 47,
|
||||
35, 199, 24, 186, 200, 109,
|
||||
190, 201, 1, 0, 0, 0,
|
||||
160, 5, 0, 0, 6, 0,
|
||||
0, 0, 56, 0, 0, 0,
|
||||
220, 0, 0, 0, 168, 1,
|
||||
0, 0, 36, 2, 0, 0,
|
||||
252, 4, 0, 0, 112, 5,
|
||||
248, 4, 0, 0, 108, 5,
|
||||
0, 0, 65, 111, 110, 57,
|
||||
156, 0, 0, 0, 156, 0,
|
||||
0, 0, 0, 2, 255, 255,
|
||||
@@ -186,153 +186,152 @@ const BYTE g_main[] =
|
||||
0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0,
|
||||
0, 0, 82, 68, 69, 70,
|
||||
208, 2, 0, 0, 1, 0,
|
||||
0, 0, 156, 0, 0, 0,
|
||||
204, 2, 0, 0, 1, 0,
|
||||
0, 0, 152, 0, 0, 0,
|
||||
3, 0, 0, 0, 28, 0,
|
||||
0, 0, 0, 4, 255, 255,
|
||||
0, 1, 0, 0, 168, 2,
|
||||
0, 1, 0, 0, 164, 2,
|
||||
0, 0, 124, 0, 0, 0,
|
||||
3, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0,
|
||||
0, 0, 1, 0, 0, 0,
|
||||
1, 0, 0, 0, 135, 0,
|
||||
1, 0, 0, 0, 133, 0,
|
||||
0, 0, 2, 0, 0, 0,
|
||||
5, 0, 0, 0, 4, 0,
|
||||
0, 0, 255, 255, 255, 255,
|
||||
0, 0, 0, 0, 1, 0,
|
||||
0, 0, 13, 0, 0, 0,
|
||||
146, 0, 0, 0, 0, 0,
|
||||
142, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0,
|
||||
1, 0, 0, 0, 1, 0,
|
||||
0, 0, 116, 104, 101, 83,
|
||||
97, 109, 112, 108, 101, 114,
|
||||
0, 116, 104, 101, 84, 101,
|
||||
120, 116, 117, 114, 101, 0,
|
||||
67, 111, 110, 115, 116, 97,
|
||||
110, 116, 115, 0, 146, 0,
|
||||
0, 0, 13, 0, 0, 0,
|
||||
180, 0, 0, 0, 112, 0,
|
||||
0, 0, 115, 97, 109, 112,
|
||||
108, 101, 114, 48, 0, 116,
|
||||
101, 120, 116, 117, 114, 101,
|
||||
48, 0, 67, 111, 110, 115,
|
||||
116, 97, 110, 116, 115, 0,
|
||||
142, 0, 0, 0, 13, 0,
|
||||
0, 0, 176, 0, 0, 0,
|
||||
112, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 236, 1,
|
||||
0, 0, 0, 0, 0, 0,
|
||||
4, 0, 0, 0, 0, 0,
|
||||
0, 0, 252, 1, 0, 0,
|
||||
0, 0, 0, 0, 12, 2,
|
||||
232, 1, 0, 0, 0, 0,
|
||||
0, 0, 4, 0, 0, 0,
|
||||
4, 0, 0, 0, 0, 0,
|
||||
0, 0, 252, 1, 0, 0,
|
||||
0, 0, 0, 0, 25, 2,
|
||||
0, 0, 8, 0, 0, 0,
|
||||
4, 0, 0, 0, 0, 0,
|
||||
0, 0, 252, 1, 0, 0,
|
||||
0, 0, 0, 0, 36, 2,
|
||||
0, 0, 12, 0, 0, 0,
|
||||
4, 0, 0, 0, 2, 0,
|
||||
0, 0, 252, 1, 0, 0,
|
||||
0, 0, 0, 0, 48, 2,
|
||||
0, 0, 16, 0, 0, 0,
|
||||
16, 0, 0, 0, 0, 0,
|
||||
0, 0, 60, 2, 0, 0,
|
||||
0, 0, 0, 0, 76, 2,
|
||||
0, 0, 32, 0, 0, 0,
|
||||
4, 0, 0, 0, 0, 0,
|
||||
0, 0, 252, 1, 0, 0,
|
||||
0, 0, 0, 0, 91, 2,
|
||||
0, 0, 36, 0, 0, 0,
|
||||
4, 0, 0, 0, 0, 0,
|
||||
0, 0, 252, 1, 0, 0,
|
||||
0, 0, 0, 0, 107, 2,
|
||||
0, 0, 40, 0, 0, 0,
|
||||
4, 0, 0, 0, 0, 0,
|
||||
0, 0, 252, 1, 0, 0,
|
||||
0, 0, 0, 0, 123, 2,
|
||||
0, 0, 44, 0, 0, 0,
|
||||
4, 0, 0, 0, 0, 0,
|
||||
0, 0, 252, 1, 0, 0,
|
||||
0, 0, 0, 0, 139, 2,
|
||||
0, 0, 48, 0, 0, 0,
|
||||
16, 0, 0, 0, 0, 0,
|
||||
0, 0, 60, 2, 0, 0,
|
||||
0, 0, 0, 0, 147, 2,
|
||||
0, 0, 64, 0, 0, 0,
|
||||
16, 0, 0, 0, 0, 0,
|
||||
0, 0, 60, 2, 0, 0,
|
||||
0, 0, 0, 0, 154, 2,
|
||||
0, 0, 80, 0, 0, 0,
|
||||
16, 0, 0, 0, 0, 0,
|
||||
0, 0, 60, 2, 0, 0,
|
||||
0, 0, 0, 0, 161, 2,
|
||||
0, 0, 96, 0, 0, 0,
|
||||
16, 0, 0, 0, 0, 0,
|
||||
0, 0, 60, 2, 0, 0,
|
||||
0, 0, 0, 0, 115, 99,
|
||||
82, 71, 66, 95, 111, 117,
|
||||
116, 112, 117, 116, 0, 171,
|
||||
171, 171, 0, 0, 3, 0,
|
||||
1, 0, 1, 0, 0, 0,
|
||||
0, 0, 0, 0, 248, 1,
|
||||
0, 0, 0, 0, 0, 0,
|
||||
116, 101, 120, 116, 117, 114,
|
||||
101, 95, 116, 121, 112, 101,
|
||||
0, 105, 110, 112, 117, 116,
|
||||
95, 116, 121, 112, 101, 0,
|
||||
99, 111, 108, 111, 114, 95,
|
||||
115, 99, 97, 108, 101, 0,
|
||||
116, 101, 120, 101, 108, 95,
|
||||
115, 105, 122, 101, 0, 171,
|
||||
1, 0, 3, 0, 1, 0,
|
||||
4, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 116, 111,
|
||||
110, 101, 109, 97, 112, 95,
|
||||
109, 101, 116, 104, 111, 100,
|
||||
8, 2, 0, 0, 4, 0,
|
||||
0, 0, 4, 0, 0, 0,
|
||||
0, 0, 0, 0, 248, 1,
|
||||
0, 0, 0, 0, 0, 0,
|
||||
21, 2, 0, 0, 8, 0,
|
||||
0, 0, 4, 0, 0, 0,
|
||||
0, 0, 0, 0, 248, 1,
|
||||
0, 0, 0, 0, 0, 0,
|
||||
32, 2, 0, 0, 12, 0,
|
||||
0, 0, 4, 0, 0, 0,
|
||||
2, 0, 0, 0, 248, 1,
|
||||
0, 0, 0, 0, 0, 0,
|
||||
44, 2, 0, 0, 16, 0,
|
||||
0, 0, 16, 0, 0, 0,
|
||||
0, 0, 0, 0, 56, 2,
|
||||
0, 0, 0, 0, 0, 0,
|
||||
72, 2, 0, 0, 32, 0,
|
||||
0, 0, 4, 0, 0, 0,
|
||||
0, 0, 0, 0, 248, 1,
|
||||
0, 0, 0, 0, 0, 0,
|
||||
87, 2, 0, 0, 36, 0,
|
||||
0, 0, 4, 0, 0, 0,
|
||||
0, 0, 0, 0, 248, 1,
|
||||
0, 0, 0, 0, 0, 0,
|
||||
103, 2, 0, 0, 40, 0,
|
||||
0, 0, 4, 0, 0, 0,
|
||||
0, 0, 0, 0, 248, 1,
|
||||
0, 0, 0, 0, 0, 0,
|
||||
119, 2, 0, 0, 44, 0,
|
||||
0, 0, 4, 0, 0, 0,
|
||||
0, 0, 0, 0, 248, 1,
|
||||
0, 0, 0, 0, 0, 0,
|
||||
135, 2, 0, 0, 48, 0,
|
||||
0, 0, 16, 0, 0, 0,
|
||||
0, 0, 0, 0, 56, 2,
|
||||
0, 0, 0, 0, 0, 0,
|
||||
143, 2, 0, 0, 64, 0,
|
||||
0, 0, 16, 0, 0, 0,
|
||||
0, 0, 0, 0, 56, 2,
|
||||
0, 0, 0, 0, 0, 0,
|
||||
150, 2, 0, 0, 80, 0,
|
||||
0, 0, 16, 0, 0, 0,
|
||||
0, 0, 0, 0, 56, 2,
|
||||
0, 0, 0, 0, 0, 0,
|
||||
157, 2, 0, 0, 96, 0,
|
||||
0, 0, 16, 0, 0, 0,
|
||||
0, 0, 0, 0, 56, 2,
|
||||
0, 0, 0, 0, 0, 0,
|
||||
115, 99, 82, 71, 66, 95,
|
||||
111, 117, 116, 112, 117, 116,
|
||||
0, 171, 171, 171, 0, 0,
|
||||
3, 0, 1, 0, 1, 0,
|
||||
0, 0, 0, 0, 0, 0,
|
||||
0, 0, 116, 101, 120, 116,
|
||||
117, 114, 101, 95, 116, 121,
|
||||
112, 101, 0, 105, 110, 112,
|
||||
117, 116, 95, 116, 121, 112,
|
||||
101, 0, 99, 111, 108, 111,
|
||||
114, 95, 115, 99, 97, 108,
|
||||
101, 0, 116, 101, 120, 101,
|
||||
108, 95, 115, 105, 122, 101,
|
||||
0, 171, 1, 0, 3, 0,
|
||||
1, 0, 4, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0,
|
||||
116, 111, 110, 101, 109, 97,
|
||||
112, 95, 109, 101, 116, 104,
|
||||
111, 100, 0, 116, 111, 110,
|
||||
101, 109, 97, 112, 95, 102,
|
||||
97, 99, 116, 111, 114, 49,
|
||||
0, 116, 111, 110, 101, 109,
|
||||
97, 112, 95, 102, 97, 99,
|
||||
116, 111, 114, 49, 0, 116,
|
||||
111, 110, 101, 109, 97, 112,
|
||||
95, 102, 97, 99, 116, 111,
|
||||
114, 50, 0, 115, 100, 114,
|
||||
95, 119, 104, 105, 116, 101,
|
||||
95, 112, 111, 105, 110, 116,
|
||||
0, 89, 111, 102, 102, 115,
|
||||
101, 116, 0, 82, 99, 111,
|
||||
101, 102, 102, 0, 71, 99,
|
||||
111, 101, 102, 102, 0, 66,
|
||||
116, 111, 114, 50, 0, 115,
|
||||
100, 114, 95, 119, 104, 105,
|
||||
116, 101, 95, 112, 111, 105,
|
||||
110, 116, 0, 89, 111, 102,
|
||||
102, 115, 101, 116, 0, 82,
|
||||
99, 111, 101, 102, 102, 0,
|
||||
77, 105, 99, 114, 111, 115,
|
||||
111, 102, 116, 32, 40, 82,
|
||||
41, 32, 72, 76, 83, 76,
|
||||
32, 83, 104, 97, 100, 101,
|
||||
114, 32, 67, 111, 109, 112,
|
||||
105, 108, 101, 114, 32, 49,
|
||||
48, 46, 49, 0, 73, 83,
|
||||
71, 78, 108, 0, 0, 0,
|
||||
3, 0, 0, 0, 8, 0,
|
||||
0, 0, 80, 0, 0, 0,
|
||||
0, 0, 0, 0, 1, 0,
|
||||
71, 99, 111, 101, 102, 102,
|
||||
0, 66, 99, 111, 101, 102,
|
||||
102, 0, 77, 105, 99, 114,
|
||||
111, 115, 111, 102, 116, 32,
|
||||
40, 82, 41, 32, 72, 76,
|
||||
83, 76, 32, 83, 104, 97,
|
||||
100, 101, 114, 32, 67, 111,
|
||||
109, 112, 105, 108, 101, 114,
|
||||
32, 49, 48, 46, 49, 0,
|
||||
73, 83, 71, 78, 108, 0,
|
||||
0, 0, 3, 0, 0, 0,
|
||||
0, 0, 0, 0, 15, 0,
|
||||
0, 0, 92, 0, 0, 0,
|
||||
8, 0, 0, 0, 80, 0,
|
||||
0, 0, 0, 0, 0, 0,
|
||||
0, 0, 3, 0, 0, 0,
|
||||
1, 0, 0, 0, 3, 3,
|
||||
0, 0, 101, 0, 0, 0,
|
||||
1, 0, 0, 0, 3, 0,
|
||||
0, 0, 0, 0, 0, 0,
|
||||
0, 0, 3, 0, 0, 0,
|
||||
2, 0, 0, 0, 15, 15,
|
||||
0, 0, 83, 86, 95, 80,
|
||||
79, 83, 73, 84, 73, 79,
|
||||
78, 0, 84, 69, 88, 67,
|
||||
79, 79, 82, 68, 0, 67,
|
||||
79, 76, 79, 82, 0, 171,
|
||||
79, 83, 71, 78, 44, 0,
|
||||
0, 0, 1, 0, 0, 0,
|
||||
8, 0, 0, 0, 32, 0,
|
||||
15, 0, 0, 0, 92, 0,
|
||||
0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 3, 0,
|
||||
0, 0, 1, 0, 0, 0,
|
||||
3, 3, 0, 0, 101, 0,
|
||||
0, 0, 0, 0, 0, 0,
|
||||
15, 0, 0, 0, 83, 86,
|
||||
95, 84, 65, 82, 71, 69,
|
||||
84, 0, 171, 171
|
||||
0, 0, 0, 0, 3, 0,
|
||||
0, 0, 2, 0, 0, 0,
|
||||
15, 15, 0, 0, 83, 86,
|
||||
95, 80, 79, 83, 73, 84,
|
||||
73, 79, 78, 0, 84, 69,
|
||||
88, 67, 79, 79, 82, 68,
|
||||
0, 67, 79, 76, 79, 82,
|
||||
0, 171, 79, 83, 71, 78,
|
||||
44, 0, 0, 0, 1, 0,
|
||||
0, 0, 8, 0, 0, 0,
|
||||
32, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0,
|
||||
3, 0, 0, 0, 0, 0,
|
||||
0, 0, 15, 0, 0, 0,
|
||||
83, 86, 95, 84, 65, 82,
|
||||
71, 69, 84, 0, 171, 171
|
||||
};
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
Texture2D theTexture : register(t0);
|
||||
SamplerState theSampler : register(s0);
|
||||
|
||||
#include "D3D11_PixelShader_Common.hlsli"
|
||||
|
||||
float4 main(PixelShaderInput input) : SV_TARGET
|
||||
{
|
||||
return GetOutputColor(theTexture.Sample(theSampler, input.tex)) * input.color;
|
||||
return GetOutputColor(texture0.Sample(sampler0, input.tex)) * input.color;
|
||||
}
|
||||
|
||||
@@ -2192,10 +2192,6 @@ static void D3D11_SetupShaderConstants(SDL_Renderer *renderer, const SDL_RenderC
|
||||
case SDL_PIXELFORMAT_INDEX8:
|
||||
if (cmd->data.draw.texture_scale_mode == SDL_SCALEMODE_PIXELART) {
|
||||
constants->texture_type = TEXTURETYPE_PALETTE_PIXELART;
|
||||
constants->texture_width = texture->w;
|
||||
constants->texture_height = texture->h;
|
||||
constants->texel_width = 1.0f / constants->texture_width;
|
||||
constants->texel_height = 1.0f / constants->texture_height;
|
||||
} else {
|
||||
constants->texture_type = TEXTURETYPE_PALETTE;
|
||||
}
|
||||
@@ -2221,10 +2217,6 @@ static void D3D11_SetupShaderConstants(SDL_Renderer *renderer, const SDL_RenderC
|
||||
default:
|
||||
if (cmd->data.draw.texture_scale_mode == SDL_SCALEMODE_PIXELART) {
|
||||
constants->texture_type = TEXTURETYPE_RGB_PIXELART;
|
||||
constants->texture_width = texture->w;
|
||||
constants->texture_height = texture->h;
|
||||
constants->texel_width = 1.0f / constants->texture_width;
|
||||
constants->texel_height = 1.0f / constants->texture_height;
|
||||
} else {
|
||||
constants->texture_type = TEXTURETYPE_RGB;
|
||||
}
|
||||
@@ -2239,6 +2231,13 @@ static void D3D11_SetupShaderConstants(SDL_Renderer *renderer, const SDL_RenderC
|
||||
break;
|
||||
}
|
||||
|
||||
if (cmd->data.draw.texture_scale_mode == SDL_SCALEMODE_PIXELART) {
|
||||
constants->texture_width = texture->w;
|
||||
constants->texture_height = texture->h;
|
||||
constants->texel_width = 1.0f / constants->texture_width;
|
||||
constants->texel_height = 1.0f / constants->texture_height;
|
||||
}
|
||||
|
||||
constants->sdr_white_point = texture->SDR_white_point;
|
||||
|
||||
if (renderer->target) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -153,7 +153,7 @@ float4 GetInputColor(PixelShaderInput input)
|
||||
rgba = texture1.Sample(sampler1, float2((index + 0.5) / 256, 0.5));
|
||||
} else if (texture_type == TEXTURETYPE_PALETTE_PIXELART) {
|
||||
float2 uv = GetPixelArtUV(input);
|
||||
float index = texture0.Sample(sampler0, uv).r * 255;
|
||||
float index = texture0.SampleGrad(sampler0, uv, ddx(input.tex), ddy(input.tex)).r * 255;
|
||||
rgba = texture1.Sample(sampler1, float2((index + 0.5) / 256, 0.5));
|
||||
} else if (texture_type == TEXTURETYPE_NV12) {
|
||||
float3 yuv;
|
||||
|
||||
@@ -275,7 +275,7 @@ fragment float4 SDL_Palette_fragment(CopyVertexOutput vert [[stage_in]],
|
||||
rgba = tex1.sample(s1, float2((index + 0.5) / 256, 0.5));
|
||||
} else if (c.texture_type == TEXTURETYPE_PALETTE_PIXELART) {
|
||||
float2 uv = GetPixelArtUV(vert.texcoord, c.texel_size);
|
||||
float index = tex0.sample(s0, uv).r * 255;
|
||||
float index = tex0.sample(s0, uv, gradient2d(dfdx(vert.texcoord), dfdy(vert.texcoord))).r * 255;
|
||||
rgba = tex1.sample(s1, float2((index + 0.5) / 256, 0.5));
|
||||
} else {
|
||||
// Unexpected texture type, use magenta error color
|
||||
|
||||
+2099
-2091
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+1622
-1610
File diff suppressed because it is too large
Load Diff
+2099
-2091
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
// 1115.0.0
|
||||
// 1113.1.1
|
||||
#pragma once
|
||||
static const uint32_t VULKAN_PixelShader_Colors[] = {
|
||||
const uint32_t VULKAN_PixelShader_Colors[] = {
|
||||
0x07230203,0x00010000,0x0008000b,0x000000a4,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000049,0x0000004d,0x00030010,
|
||||
@@ -15,13 +15,13 @@ static const uint32_t VULKAN_PixelShader_Colors[] = {
|
||||
0x5f70616d,0x74636166,0x0032726f,0x00070006,0x00000018,0x00000008,0x5f726473,0x74696877,
|
||||
0x6f705f65,0x00746e69,0x00030005,0x0000001a,0x00000000,0x00050005,0x00000049,0x75706e69,
|
||||
0x6f632e74,0x00726f6c,0x00070005,0x0000004d,0x746e6540,0x6f507972,0x4f746e69,0x75707475,
|
||||
0x00000074,0x00030047,0x00000018,0x00000002,0x00050048,0x00000018,0x00000000,0x00000023,
|
||||
0x00000000,0x00050048,0x00000018,0x00000001,0x00000023,0x00000004,0x00050048,0x00000018,
|
||||
0x00000002,0x00000023,0x00000008,0x00050048,0x00000018,0x00000003,0x00000023,0x0000000c,
|
||||
0x00050048,0x00000018,0x00000004,0x00000023,0x00000010,0x00050048,0x00000018,0x00000005,
|
||||
0x00000023,0x00000020,0x00050048,0x00000018,0x00000006,0x00000023,0x00000024,0x00050048,
|
||||
0x00000018,0x00000007,0x00000023,0x00000028,0x00050048,0x00000018,0x00000008,0x00000023,
|
||||
0x0000002c,0x00040047,0x0000001a,0x00000021,0x00000000,0x00040047,0x0000001a,0x00000022,
|
||||
0x00000074,0x00050048,0x00000018,0x00000000,0x00000023,0x00000000,0x00050048,0x00000018,
|
||||
0x00000001,0x00000023,0x00000004,0x00050048,0x00000018,0x00000002,0x00000023,0x00000008,
|
||||
0x00050048,0x00000018,0x00000003,0x00000023,0x0000000c,0x00050048,0x00000018,0x00000004,
|
||||
0x00000023,0x00000010,0x00050048,0x00000018,0x00000005,0x00000023,0x00000020,0x00050048,
|
||||
0x00000018,0x00000006,0x00000023,0x00000024,0x00050048,0x00000018,0x00000007,0x00000023,
|
||||
0x00000028,0x00050048,0x00000018,0x00000008,0x00000023,0x0000002c,0x00030047,0x00000018,
|
||||
0x00000002,0x00040047,0x0000001a,0x00000022,0x00000000,0x00040047,0x0000001a,0x00000021,
|
||||
0x00000000,0x00040047,0x00000049,0x0000001e,0x00000001,0x00040047,0x0000004d,0x0000001e,
|
||||
0x00000000,0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,0x00030016,0x00000006,
|
||||
0x00000020,0x00040017,0x00000007,0x00000006,0x00000004,0x00040017,0x00000015,0x00000006,
|
||||
|
||||
@@ -141,7 +141,7 @@ float4 GetInputColor(PixelShaderInput input)
|
||||
rgba = texture1.Sample(sampler1, float2((index + 0.5) / 256, 0.5));
|
||||
} else if (texture_type == TEXTURETYPE_PALETTE_PIXELART) {
|
||||
float2 uv = GetPixelArtUV(input);
|
||||
float index = texture0.Sample(sampler0, uv).r * 255;
|
||||
float index = texture0.SampleGrad(sampler0, uv, ddx(input.tex), ddy(input.tex)).r * 255;
|
||||
rgba = texture1.Sample(sampler1, float2((index + 0.5) / 256, 0.5));
|
||||
} else {
|
||||
// Error!
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// 1115.0.0
|
||||
// 1113.1.1
|
||||
#pragma once
|
||||
static const uint32_t VULKAN_PixelShader_Textures[] = {
|
||||
const uint32_t VULKAN_PixelShader_Textures[] = {
|
||||
0x07230203,0x00010000,0x0008000b,0x000000ab,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x0008000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x0000004c,0x0000004f,0x00000053,
|
||||
@@ -16,15 +16,15 @@ static const uint32_t VULKAN_PixelShader_Textures[] = {
|
||||
0x74696877,0x6f705f65,0x00746e69,0x00030005,0x0000001a,0x00000000,0x00050005,0x00000036,
|
||||
0x74786574,0x30657275,0x00000000,0x00050005,0x0000004c,0x75706e69,0x65742e74,0x00000078,
|
||||
0x00050005,0x0000004f,0x75706e69,0x6f632e74,0x00726f6c,0x00070005,0x00000053,0x746e6540,
|
||||
0x6f507972,0x4f746e69,0x75707475,0x00000074,0x00030047,0x00000018,0x00000002,0x00050048,
|
||||
0x00000018,0x00000000,0x00000023,0x00000000,0x00050048,0x00000018,0x00000001,0x00000023,
|
||||
0x00000004,0x00050048,0x00000018,0x00000002,0x00000023,0x00000008,0x00050048,0x00000018,
|
||||
0x00000003,0x00000023,0x0000000c,0x00050048,0x00000018,0x00000004,0x00000023,0x00000010,
|
||||
0x00050048,0x00000018,0x00000005,0x00000023,0x00000020,0x00050048,0x00000018,0x00000006,
|
||||
0x00000023,0x00000024,0x00050048,0x00000018,0x00000007,0x00000023,0x00000028,0x00050048,
|
||||
0x00000018,0x00000008,0x00000023,0x0000002c,0x00040047,0x0000001a,0x00000021,0x00000000,
|
||||
0x00040047,0x0000001a,0x00000022,0x00000000,0x00040047,0x00000036,0x00000021,0x00000001,
|
||||
0x00040047,0x00000036,0x00000022,0x00000000,0x00040047,0x0000004c,0x0000001e,0x00000000,
|
||||
0x6f507972,0x4f746e69,0x75707475,0x00000074,0x00050048,0x00000018,0x00000000,0x00000023,
|
||||
0x00000000,0x00050048,0x00000018,0x00000001,0x00000023,0x00000004,0x00050048,0x00000018,
|
||||
0x00000002,0x00000023,0x00000008,0x00050048,0x00000018,0x00000003,0x00000023,0x0000000c,
|
||||
0x00050048,0x00000018,0x00000004,0x00000023,0x00000010,0x00050048,0x00000018,0x00000005,
|
||||
0x00000023,0x00000020,0x00050048,0x00000018,0x00000006,0x00000023,0x00000024,0x00050048,
|
||||
0x00000018,0x00000007,0x00000023,0x00000028,0x00050048,0x00000018,0x00000008,0x00000023,
|
||||
0x0000002c,0x00030047,0x00000018,0x00000002,0x00040047,0x0000001a,0x00000022,0x00000000,
|
||||
0x00040047,0x0000001a,0x00000021,0x00000000,0x00040047,0x00000036,0x00000022,0x00000000,
|
||||
0x00040047,0x00000036,0x00000021,0x00000001,0x00040047,0x0000004c,0x0000001e,0x00000000,
|
||||
0x00040047,0x0000004f,0x0000001e,0x00000001,0x00040047,0x00000053,0x0000001e,0x00000000,
|
||||
0x00020013,0x00000002,0x00030021,0x00000003,0x00000002,0x00030016,0x00000006,0x00000020,
|
||||
0x00040017,0x00000007,0x00000006,0x00000004,0x00040017,0x0000000d,0x00000006,0x00000002,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// 1115.0.0
|
||||
// 1113.1.1
|
||||
#pragma once
|
||||
static const uint32_t VULKAN_VertexShader[] = {
|
||||
const uint32_t VULKAN_VertexShader[] = {
|
||||
0x07230203,0x00010000,0x0008000b,0x000000af,0x00000000,0x00020011,0x00000001,0x0006000b,
|
||||
0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001,
|
||||
0x000c000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000003f,0x00000043,0x00000047,
|
||||
@@ -14,11 +14,11 @@ static const uint32_t VULKAN_VertexShader[] = {
|
||||
0x75707475,0x6f702e74,0x00000073,0x00080005,0x0000005b,0x746e6540,0x6f507972,0x4f746e69,
|
||||
0x75707475,0x65742e74,0x00000078,0x00080005,0x0000005e,0x746e6540,0x6f507972,0x4f746e69,
|
||||
0x75707475,0x6f632e74,0x00726f6c,0x00090005,0x00000062,0x746e6540,0x6f507972,0x4f746e69,
|
||||
0x75707475,0x6f702e74,0x53746e69,0x00657a69,0x00030047,0x0000001e,0x00000002,0x00040048,
|
||||
0x0000001e,0x00000000,0x00000005,0x00050048,0x0000001e,0x00000000,0x00000007,0x00000010,
|
||||
0x00050048,0x0000001e,0x00000000,0x00000023,0x00000000,0x00040048,0x0000001e,0x00000001,
|
||||
0x00000005,0x00050048,0x0000001e,0x00000001,0x00000007,0x00000010,0x00050048,0x0000001e,
|
||||
0x00000001,0x00000023,0x00000040,0x00040047,0x0000003f,0x0000001e,0x00000000,0x00040047,
|
||||
0x75707475,0x6f702e74,0x53746e69,0x00657a69,0x00040048,0x0000001e,0x00000000,0x00000005,
|
||||
0x00050048,0x0000001e,0x00000000,0x00000023,0x00000000,0x00050048,0x0000001e,0x00000000,
|
||||
0x00000007,0x00000010,0x00040048,0x0000001e,0x00000001,0x00000005,0x00050048,0x0000001e,
|
||||
0x00000001,0x00000023,0x00000040,0x00050048,0x0000001e,0x00000001,0x00000007,0x00000010,
|
||||
0x00030047,0x0000001e,0x00000002,0x00040047,0x0000003f,0x0000001e,0x00000000,0x00040047,
|
||||
0x00000043,0x0000001e,0x00000001,0x00040047,0x00000047,0x0000001e,0x00000002,0x00040047,
|
||||
0x00000058,0x0000000b,0x00000000,0x00040047,0x0000005b,0x0000001e,0x00000000,0x00040047,
|
||||
0x0000005e,0x0000001e,0x00000001,0x00040047,0x00000062,0x0000000b,0x00000001,0x00020013,
|
||||
|
||||
Reference in New Issue
Block a user