Fix shaders

This commit is contained in:
Pavel 2022-05-31 10:18:54 +03:00
parent 81cf8d5303
commit 38e689c405
5 changed files with 26 additions and 19 deletions

View File

@ -25,10 +25,10 @@ void main()
uint pack=host.data[offset];
const uvec4 shift = uvec4(16,8,0,24);
const uvec4 mask4 = uvec4(255,255,255,255);
//const uvec4 shift = uvec4(16,8,0,24);
//const uvec4 mask4 = uvec4(255,255,255,255);
uvec4 pix_int=(uvec4(pack,pack,pack,pack) >> shift) & mask4;
//uvec4 pix_int=(uvec4(pack,pack,pack,pack) >> shift) & mask4;
//0,8,16,24
//R,G, B,A
@ -36,7 +36,11 @@ void main()
//16,8,0,24
//BGRA
vec4 pixel = vec4(pix_int) / mask4;
//vec4 pixel = vec4(pix_int) / mask4;
vec4 pixel=unpackUnorm4x8(pack);
pixel=pixel.bgra;
pixel = pow(pixel, cfg.gamma);

Binary file not shown.

View File

@ -62,11 +62,14 @@ void main()
int pipe=getPipeIndex(pixelCoords);
int bank=getBankIndex(pixelCoords);
const ivec4 shmt = ivec4(7,6,6,3);
const ivec2 bmod = ivec2(1,1);
//const ivec4 shmt = ivec4(7,6,6,3);
const ivec2 shmt = ivec2(7,6);
//const ivec2 bmod = ivec2(1,1);
ivec4 mt=(pixelCoords.xyxy >> shmt);
ivec2 total_offset=(mt.xy*cfg.pitch)+(mt.zw % bmod);
//ivec4 mt=(pixelCoords.xyxy >> shmt);
ivec2 mt=(pixelCoords.xy >> shmt);
ivec2 total_offset=(mt.xy*cfg.pitch);
//+(mt.zw % bmod);
int offset = element_index | pipe | bank | ((total_offset.x+total_offset.y) << 13);

Binary file not shown.

View File

@ -1,19 +1,19 @@
@echo off
Set spirvgls=spirv\glslangValidator -g0 -V --target-env vulkan1.0
Set spirvopt=spirv\spirv-opt --eliminate-dead-branches --eliminate-local-multi-store --inline-entry-points-exhaustive --eliminate-dead-code-aggressive --scalar-replacement --simplify-instructions
%spirvgls% FLIP_CURSOR.comp -o FLIP_CURSOR.spv
%spirvopt% FLIP_CURSOR.spv -o FLIP_CURSOR.spv
For /F %%a in ('dir /B') do if "%%~xa"==".comp" (call :compil %%a %%~na)
%spirvgls% FLIP_TILE_A8R8G8B8_SRGB.comp -o FLIP_TILE_A8R8G8B8_SRGB.spv
%spirvopt% FLIP_TILE_A8R8G8B8_SRGB.spv -o FLIP_TILE_A8R8G8B8_SRGB.spv
%spirvgls% FLIP_LINE_A8R8G8B8_SRGB.comp -o FLIP_LINE_A8R8G8B8_SRGB.spv
%spirvopt% FLIP_LINE_A8R8G8B8_SRGB.spv -o FLIP_LINE_A8R8G8B8_SRGB.spv
%spirvgls% FLIP_TILE_A8R8G8B8_SRGB_NEO.comp -o FLIP_TILE_A8R8G8B8_SRGB_NEO.spv
%spirvopt% FLIP_TILE_A8R8G8B8_SRGB_NEO.spv -o FLIP_TILE_A8R8G8B8_SRGB_NEO.spv
For /F %%a in ('dir /B') do if "%%~xa"==".vert" (call :compil %%a %%~na)
pause
exit
:compil
echo %2
%spirvgls% %1 -o %2.spv
%spirvopt% %2.spv -o %2.spv
exit /b