mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-04 08:22:32 +00:00
host_shaders: Simplifying a calculation
This commit is contained in:
parent
0aaeea4837
commit
ad723492d0
@ -31,10 +31,10 @@ const uint lut_64bpp[16] = {
|
|||||||
0x37363332, 0x3f3e3b3a,
|
0x37363332, 0x3f3e3b3a,
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MICRO_TILE_DIM (8)
|
#define MICRO_TILE_DIM 8
|
||||||
#define MICRO_TILE_SZ (512)
|
#define MICRO_TILE_SZ 512
|
||||||
#define TEXELS_PER_ELEMENT (1)
|
#define TEXELS_PER_ELEMENT 1
|
||||||
#define BPP (64)
|
#define BPP 64
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
uint x = gl_GlobalInvocationID.x % info.pitch;
|
uint x = gl_GlobalInvocationID.x % info.pitch;
|
||||||
|
@ -64,10 +64,10 @@ const uint lut_32bpp[][16] = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MICRO_TILE_DIM (8)
|
#define MICRO_TILE_DIM 8
|
||||||
#define MICRO_TILE_SZ (1024)
|
#define MICRO_TILE_SZ 1024
|
||||||
#define TEXELS_PER_ELEMENT (1)
|
#define TEXELS_PER_ELEMENT 1
|
||||||
#define BPP (32)
|
#define BPP 32
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
uint x = gl_GlobalInvocationID.x % info.pitch;
|
uint x = gl_GlobalInvocationID.x % info.pitch;
|
||||||
|
@ -63,10 +63,10 @@ const uint lut_64bpp[][16] = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MICRO_TILE_DIM (8)
|
#define MICRO_TILE_DIM 8
|
||||||
#define MICRO_TILE_SZ (2048)
|
#define MICRO_TILE_SZ 2048
|
||||||
#define TEXELS_PER_ELEMENT (1)
|
#define TEXELS_PER_ELEMENT 1
|
||||||
#define BPP (64)
|
#define BPP 64
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
uint x = gl_GlobalInvocationID.x % info.pitch;
|
uint x = gl_GlobalInvocationID.x % info.pitch;
|
||||||
|
@ -63,10 +63,10 @@ const uint lut_8bpp[][16] = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MICRO_TILE_DIM (8)
|
#define MICRO_TILE_DIM 8
|
||||||
#define MICRO_TILE_SZ (256)
|
#define MICRO_TILE_SZ 256
|
||||||
#define TEXELS_PER_ELEMENT (1)
|
#define TEXELS_PER_ELEMENT 1
|
||||||
#define BPP (8)
|
#define BPP 8
|
||||||
|
|
||||||
shared uint scratch[16];
|
shared uint scratch[16];
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ const uint rmort[16] = {
|
|||||||
0x57475646, 0x77677666,
|
0x57475646, 0x77677666,
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MICRO_TILE_DIM (8)
|
#define MICRO_TILE_DIM 8
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
uint block_ofs = 4 * gl_GlobalInvocationID.x;
|
uint block_ofs = 4 * gl_GlobalInvocationID.x;
|
||||||
|
@ -32,8 +32,8 @@ const uint rmort[16] = {
|
|||||||
0x57475646, 0x77677666,
|
0x57475646, 0x77677666,
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MICRO_TILE_DIM (8)
|
#define MICRO_TILE_DIM 8
|
||||||
#define TEXELS_PER_ELEMENT (1)
|
#define TEXELS_PER_ELEMENT 1
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
uint tile_base = gl_GlobalInvocationID.x - gl_LocalInvocationID.x; // WG*16
|
uint tile_base = gl_GlobalInvocationID.x - gl_LocalInvocationID.x; // WG*16
|
||||||
|
@ -32,7 +32,7 @@ const uint rmort[16] = {
|
|||||||
0x57475646, 0x77677666,
|
0x57475646, 0x77677666,
|
||||||
};
|
};
|
||||||
|
|
||||||
#define MICRO_TILE_DIM (8)
|
#define MICRO_TILE_DIM 8
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
uint block_ofs = 2 * gl_GlobalInvocationID.x;
|
uint block_ofs = 2 * gl_GlobalInvocationID.x;
|
||||||
|
@ -16,7 +16,7 @@ layout(push_constant) uniform settings {
|
|||||||
const float cutoff = 0.0031308, a = 1.055, b = 0.055, d = 12.92;
|
const float cutoff = 0.0031308, a = 1.055, b = 0.055, d = 12.92;
|
||||||
vec3 gamma(vec3 rgb) {
|
vec3 gamma(vec3 rgb) {
|
||||||
return mix(
|
return mix(
|
||||||
a * pow(rgb, vec3(1.0 / (2.4 + 1.0 - pp.gamma))) - b,
|
a * pow(rgb, vec3(1.0 / (3.4 - pp.gamma))) - b,
|
||||||
d * rgb / pp.gamma,
|
d * rgb / pp.gamma,
|
||||||
lessThan(rgb, vec3(cutoff))
|
lessThan(rgb, vec3(cutoff))
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user