Browse Source

[TEST] Removal of the 7 push constant + fixated value

lsfg-android
CamilleLaVey 4 weeks ago
parent
commit
8890b8eb2a
  1. 6
      src/video_core/host_shaders/astc_decoder.comp
  2. 5
      src/video_core/renderer_vulkan/vk_compute_pass.cpp

6
src/video_core/host_shaders/astc_decoder.comp

@ -33,7 +33,6 @@ UNIFORM(3) uint block_size;
UNIFORM(4) uint x_shift; UNIFORM(4) uint x_shift;
UNIFORM(5) uint block_height; UNIFORM(5) uint block_height;
UNIFORM(6) uint block_height_mask; UNIFORM(6) uint block_height_mask;
UNIFORM(7) uint is_srgb;
END_PUSH_CONSTANTS END_PUSH_CONSTANTS
struct EncodingData { struct EncodingData {
@ -1407,8 +1406,7 @@ void DecompressBlock(ivec3 coord) {
vec4((C0 * (uvec4(64) - weight_vec) + C1 * weight_vec + uvec4(32)) / 64); vec4((C0 * (uvec4(64) - weight_vec) + C1 * weight_vec + uvec4(32)) / 64);
p = Cf / 65535.0f; p = Cf / 65535.0f;
#ifdef VULKAN #ifdef VULKAN
// Another test
p.yzw = mix(p.yzw, SRGBToLinear(p.yzw), bvec3(is_srgb != 0u));
p.yzw = mix(p.yzw, SRGBToLinear(p.yzw), bvec3((block_height_mask & 0x80000000u) != 0u));
#endif #endif
} }
@ -1438,7 +1436,7 @@ void main() {
uint offset = 0; uint offset = 0;
offset += pos.z * layer_stride; offset += pos.z * layer_stride;
offset += (block_y >> block_height) * block_size; offset += (block_y >> block_height) * block_size;
offset += (block_y & block_height_mask) << GOB_SIZE_SHIFT;
offset += (block_y & (block_height_mask & 0x7FFFFFFFu)) << GOB_SIZE_SHIFT;
offset += (pos.x >> GOB_SIZE_X_SHIFT) << x_shift; offset += (pos.x >> GOB_SIZE_X_SHIFT) << x_shift;
offset += swizzle; offset += swizzle;

5
src/video_core/renderer_vulkan/vk_compute_pass.cpp

@ -221,7 +221,6 @@ struct AstcPushConstants {
u32 x_shift; u32 x_shift;
u32 block_height; u32 block_height;
u32 block_height_mask; u32 block_height_mask;
u32 is_srgb;
}; };
struct QueriesPrefixScanPushConstants { struct QueriesPrefixScanPushConstants {
@ -622,8 +621,8 @@ void ASTCDecoderPass::Assemble(Image& image, const StagingBufferRef& map,
.block_size = params.block_size, .block_size = params.block_size,
.x_shift = params.x_shift, .x_shift = params.x_shift,
.block_height = params.block_height, .block_height = params.block_height,
.block_height_mask = params.block_height_mask,
.is_srgb = is_srgb ? 1u : 0u,
.block_height_mask =
params.block_height_mask | (is_srgb ? 0x8000'0000u : 0u),
}; };
const VkDescriptorSet set = descriptor_allocator.Commit(); const VkDescriptorSet set = descriptor_allocator.Commit();
device.GetLogical().UpdateDescriptorSet(set, *descriptor_template, descriptor_data); device.GetLogical().UpdateDescriptorSet(set, *descriptor_template, descriptor_data);

Loading…
Cancel
Save