mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-22 23:36:20 +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
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;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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
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;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,34 +1,34 @@
|
||||
#if 0
|
||||
Disassembly failed
|
||||
#endif
|
||||
|
||||
const unsigned char g_AdvancedRS[] = {
|
||||
0x44, 0x58, 0x42, 0x43, 0x7e, 0x10, 0xf2, 0x34, 0x1f, 0x5f, 0x2b, 0x22,
|
||||
0xbb, 0xe0, 0xa0, 0x5c, 0x42, 0x31, 0x4c, 0x01, 0x01, 0x00, 0x00, 0x00,
|
||||
0x50, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00,
|
||||
0x52, 0x54, 0x53, 0x30, 0x24, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x07, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x24, 0x01, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x05, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x05, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x05, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x05, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x05, 0x00, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x8c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
|
||||
0x01, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00,
|
||||
0xec, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff
|
||||
};
|
||||
#if 0
|
||||
Disassembly failed
|
||||
#endif
|
||||
|
||||
const unsigned char g_AdvancedRS[] = {
|
||||
0x44, 0x58, 0x42, 0x43, 0x7e, 0x10, 0xf2, 0x34, 0x1f, 0x5f, 0x2b, 0x22,
|
||||
0xbb, 0xe0, 0xa0, 0x5c, 0x42, 0x31, 0x4c, 0x01, 0x01, 0x00, 0x00, 0x00,
|
||||
0x50, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00,
|
||||
0x52, 0x54, 0x53, 0x30, 0x24, 0x01, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x07, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x24, 0x01, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x05, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x05, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x05, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x05, 0x00, 0x00, 0x00, 0xe4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x05, 0x00, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x8c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
|
||||
0x01, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00,
|
||||
0xec, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff
|
||||
};
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
#if 0
|
||||
Disassembly failed
|
||||
#endif
|
||||
|
||||
const unsigned char g_ColorRS[] = {
|
||||
0x44, 0x58, 0x42, 0x43, 0x0c, 0xbe, 0x22, 0x40, 0x4f, 0xd2, 0x56, 0x49,
|
||||
0x31, 0xaa, 0x69, 0x8d, 0x8d, 0xaf, 0x83, 0x2a, 0x01, 0x00, 0x00, 0x00,
|
||||
0x74, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00,
|
||||
0x52, 0x54, 0x53, 0x30, 0x48, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x48, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00
|
||||
};
|
||||
#if 0
|
||||
Disassembly failed
|
||||
#endif
|
||||
|
||||
const unsigned char g_ColorRS[] = {
|
||||
0x44, 0x58, 0x42, 0x43, 0x0c, 0xbe, 0x22, 0x40, 0x4f, 0xd2, 0x56, 0x49,
|
||||
0x31, 0xaa, 0x69, 0x8d, 0x8d, 0xaf, 0x83, 0x2a, 0x01, 0x00, 0x00, 0x00,
|
||||
0x74, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00,
|
||||
0x52, 0x54, 0x53, 0x30, 0x48, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x02, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x48, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00
|
||||
};
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
#if 0
|
||||
Disassembly failed
|
||||
#endif
|
||||
|
||||
const unsigned char g_TextureRS[] = {
|
||||
0x44, 0x58, 0x42, 0x43, 0xf1, 0x21, 0x00, 0x8f, 0xd4, 0x37, 0xfc, 0xfe,
|
||||
0x90, 0xa2, 0xbe, 0x02, 0x82, 0xec, 0xc4, 0xf2, 0x01, 0x00, 0x00, 0x00,
|
||||
0xcc, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00,
|
||||
0x52, 0x54, 0x53, 0x30, 0xa0, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x04, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0xa0, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x05, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x05, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff
|
||||
};
|
||||
#if 0
|
||||
Disassembly failed
|
||||
#endif
|
||||
|
||||
const unsigned char g_TextureRS[] = {
|
||||
0x44, 0x58, 0x42, 0x43, 0xf1, 0x21, 0x00, 0x8f, 0xd4, 0x37, 0xfc, 0xfe,
|
||||
0x90, 0xa2, 0xbe, 0x02, 0x82, 0xec, 0xc4, 0xf2, 0x01, 0x00, 0x00, 0x00,
|
||||
0xcc, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00,
|
||||
0x52, 0x54, 0x53, 0x30, 0xa0, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
|
||||
0x04, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0xa0, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x05, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x05, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00,
|
||||
0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff
|
||||
};
|
||||
|
||||
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
@@ -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