mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-20 10:54:16 +01:00
[hud] Visualize inactive chunks
This commit is contained in:
parent
2c8fe59924
commit
c4cddebb89
@ -1122,8 +1122,11 @@ namespace dxvk::hud {
|
||||
draw.w = size.x;
|
||||
draw.h = size.y;
|
||||
draw.pageMask = chunk.pageMaskOffset;
|
||||
draw.pageCount = chunk.pageCount;
|
||||
draw.pageCountAndActiveBit = chunk.pageCount;
|
||||
draw.color = color;
|
||||
|
||||
if (chunk.active)
|
||||
draw.pageCountAndActiveBit |= 1u << 15;
|
||||
}
|
||||
|
||||
|
||||
|
@ -540,7 +540,7 @@ namespace dxvk::hud {
|
||||
int16_t w;
|
||||
int16_t h;
|
||||
uint16_t pageMask;
|
||||
uint16_t pageCount;
|
||||
uint16_t pageCountAndActiveBit;
|
||||
uint32_t color;
|
||||
};
|
||||
|
||||
|
@ -11,10 +11,20 @@ uniform push_data_t {
|
||||
float scale;
|
||||
};
|
||||
|
||||
layout(location = 0) flat in uint v_active;
|
||||
|
||||
layout(location = 0) out vec4 o_color;
|
||||
|
||||
void main() {
|
||||
o_color = vec4(0.0f, 0.0f, 0.0f, 0.75f);
|
||||
|
||||
if (v_active == 0u) {
|
||||
uvec2 pos = uvec2(gl_FragCoord.xy);
|
||||
|
||||
if (((pos.x + pos.y) & 7u) < 2u)
|
||||
o_color.xyz = vec3(0.25f);
|
||||
}
|
||||
|
||||
o_color.a *= opacity;
|
||||
o_color = linear_to_output(o_color);
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ layout(location = 0) in vec2 v_coord;
|
||||
layout(location = 1, component = 0) flat in uint v_color;
|
||||
layout(location = 1, component = 1) flat in uint v_mask_index;
|
||||
layout(location = 1, component = 2) flat in uint v_page_count;
|
||||
layout(location = 1, component = 3) flat in uint v_active;
|
||||
|
||||
layout(location = 0) out vec4 o_color;
|
||||
|
||||
|
@ -26,6 +26,8 @@ vec2 unpack_u16(uint v) {
|
||||
return vec2(float(lo >> 16), float(hi >> 16));
|
||||
}
|
||||
|
||||
layout(location = 0) out uint o_active;
|
||||
|
||||
void main() {
|
||||
draw_info_t draw = draw_infos[gl_InstanceIndex];
|
||||
|
||||
@ -43,5 +45,6 @@ void main() {
|
||||
vec2 pixel_pos = pos + size * coord + (2.0f * coord - 1.0f);
|
||||
vec2 scaled_pos = 2.0f * (pixel_pos / surface_size_f) - 1.0f;
|
||||
|
||||
o_active = bitfieldExtract(draw.packed_range, 31, 1);
|
||||
gl_Position = vec4(scaled_pos, 0.0f, 1.0f);
|
||||
}
|
||||
|
@ -24,6 +24,7 @@ layout(location = 0) out vec2 o_coord;
|
||||
layout(location = 1, component = 0) out uint o_color;
|
||||
layout(location = 1, component = 1) out uint o_mask_index;
|
||||
layout(location = 1, component = 2) out uint o_page_count;
|
||||
layout(location = 1, component = 3) out uint o_active;
|
||||
|
||||
vec2 unpack_u16(uint v) {
|
||||
// Inputs may be signed
|
||||
@ -42,7 +43,8 @@ void main() {
|
||||
o_coord = coord;
|
||||
o_color = draw.color;
|
||||
o_mask_index = bitfieldExtract(draw.packed_range, 0, 16);
|
||||
o_page_count = bitfieldExtract(draw.packed_range, 16, 16);
|
||||
o_page_count = bitfieldExtract(draw.packed_range, 16, 15);
|
||||
o_active = bitfieldExtract(draw.packed_range, 31, 1);
|
||||
|
||||
vec2 surface_size_f = vec2(surface_size) / scale;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user