diff options
| author | 2021-01-24 17:36:43 -0500 | |
|---|---|---|
| committer | 2021-01-24 17:36:43 -0500 | |
| commit | df0d8c45d28832d08746e7c1a98782f05cdfcf7b (patch) | |
| tree | 0c0ce16e34704b6f3318c7f62c931a144dad83a5 /src | |
| parent | Merge pull request #5363 from ReinUsesLisp/vk-image-usage (diff) | |
| parent | cmake: Enforce -Warray-bounds and -Wmissing-field-initializers globally (diff) | |
| download | yuzu-df0d8c45d28832d08746e7c1a98782f05cdfcf7b.tar.gz yuzu-df0d8c45d28832d08746e7c1a98782f05cdfcf7b.tar.xz yuzu-df0d8c45d28832d08746e7c1a98782f05cdfcf7b.zip | |
Merge pull request #5807 from ReinUsesLisp/vc-warnings
video_core: Silence the remaining gcc warnings and enforce them
Diffstat (limited to 'src')
| -rw-r--r-- | src/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/video_core/engines/maxwell_3d.cpp | 68 | ||||
| -rw-r--r-- | src/video_core/engines/maxwell_3d.h | 2 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/maxwell_to_vk.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/maxwell_to_vk.h | 2 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp | 1 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_texture_cache.h | 2 | ||||
| -rw-r--r-- | src/video_core/shader/async_shaders.cpp | 18 | ||||
| -rw-r--r-- | src/video_core/texture_cache/util.cpp | 59 | ||||
| -rw-r--r-- | src/video_core/vulkan_common/vulkan_debug_callback.cpp | 1 |
10 files changed, 95 insertions, 62 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 478246b6f..1cfd3bbc9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt | |||
| @@ -64,8 +64,10 @@ if (MSVC) | |||
| 64 | else() | 64 | else() |
| 65 | add_compile_options( | 65 | add_compile_options( |
| 66 | -Wall | 66 | -Wall |
| 67 | -Werror=array-bounds | ||
| 67 | -Werror=implicit-fallthrough | 68 | -Werror=implicit-fallthrough |
| 68 | -Werror=missing-declarations | 69 | -Werror=missing-declarations |
| 70 | -Werror=missing-field-initializers | ||
| 69 | -Werror=reorder | 71 | -Werror=reorder |
| 70 | -Werror=switch | 72 | -Werror=switch |
| 71 | -Werror=uninitialized | 73 | -Werror=uninitialized |
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp index 9be651e24..116ad1722 100644 --- a/src/video_core/engines/maxwell_3d.cpp +++ b/src/video_core/engines/maxwell_3d.cpp | |||
| @@ -179,22 +179,22 @@ void Maxwell3D::ProcessMethodCall(u32 method, u32 argument, u32 nonshadow_argume | |||
| 179 | return ProcessMacroBind(argument); | 179 | return ProcessMacroBind(argument); |
| 180 | case MAXWELL3D_REG_INDEX(firmware[4]): | 180 | case MAXWELL3D_REG_INDEX(firmware[4]): |
| 181 | return ProcessFirmwareCall4(); | 181 | return ProcessFirmwareCall4(); |
| 182 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[0]): | 182 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data): |
| 183 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[1]): | 183 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data) + 1: |
| 184 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[2]): | 184 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data) + 2: |
| 185 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[3]): | 185 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data) + 3: |
| 186 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[4]): | 186 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data) + 4: |
| 187 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[5]): | 187 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data) + 5: |
| 188 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[6]): | 188 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data) + 6: |
| 189 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[7]): | 189 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data) + 7: |
| 190 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[8]): | 190 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data) + 8: |
| 191 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[9]): | 191 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data) + 9: |
| 192 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[10]): | 192 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data) + 10: |
| 193 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[11]): | 193 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data) + 11: |
| 194 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[12]): | 194 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data) + 12: |
| 195 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[13]): | 195 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data) + 13: |
| 196 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[14]): | 196 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data) + 14: |
| 197 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[15]): | 197 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data) + 15: |
| 198 | return StartCBData(method); | 198 | return StartCBData(method); |
| 199 | case MAXWELL3D_REG_INDEX(cb_bind[0]): | 199 | case MAXWELL3D_REG_INDEX(cb_bind[0]): |
| 200 | return ProcessCBBind(0); | 200 | return ProcessCBBind(0); |
| @@ -287,22 +287,22 @@ void Maxwell3D::CallMultiMethod(u32 method, const u32* base_start, u32 amount, | |||
| 287 | return; | 287 | return; |
| 288 | } | 288 | } |
| 289 | switch (method) { | 289 | switch (method) { |
| 290 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[0]): | 290 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data): |
| 291 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[1]): | 291 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data) + 1: |
| 292 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[2]): | 292 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data) + 2: |
| 293 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[3]): | 293 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data) + 3: |
| 294 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[4]): | 294 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data) + 4: |
| 295 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[5]): | 295 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data) + 5: |
| 296 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[6]): | 296 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data) + 6: |
| 297 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[7]): | 297 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data) + 7: |
| 298 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[8]): | 298 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data) + 8: |
| 299 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[9]): | 299 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data) + 9: |
| 300 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[10]): | 300 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data) + 10: |
| 301 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[11]): | 301 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data) + 11: |
| 302 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[12]): | 302 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data) + 12: |
| 303 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[13]): | 303 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data) + 13: |
| 304 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[14]): | 304 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data) + 14: |
| 305 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[15]): | 305 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data) + 15: |
| 306 | ProcessCBMultiData(method, base_start, amount); | 306 | ProcessCBMultiData(method, base_start, amount); |
| 307 | break; | 307 | break; |
| 308 | default: | 308 | default: |
| @@ -592,7 +592,7 @@ void Maxwell3D::ProcessCBData(u32 value) { | |||
| 592 | } | 592 | } |
| 593 | 593 | ||
| 594 | void Maxwell3D::StartCBData(u32 method) { | 594 | void Maxwell3D::StartCBData(u32 method) { |
| 595 | constexpr u32 first_cb_data = MAXWELL3D_REG_INDEX(const_buffer.cb_data[0]); | 595 | constexpr u32 first_cb_data = MAXWELL3D_REG_INDEX(const_buffer.cb_data); |
| 596 | cb_data_state.start_pos = regs.const_buffer.cb_pos; | 596 | cb_data_state.start_pos = regs.const_buffer.cb_pos; |
| 597 | cb_data_state.id = method - first_cb_data; | 597 | cb_data_state.id = method - first_cb_data; |
| 598 | cb_data_state.current = method; | 598 | cb_data_state.current = method; |
| @@ -605,7 +605,7 @@ void Maxwell3D::ProcessCBMultiData(u32 method, const u32* start_base, u32 amount | |||
| 605 | if (cb_data_state.current != null_cb_data) { | 605 | if (cb_data_state.current != null_cb_data) { |
| 606 | FinishCBData(); | 606 | FinishCBData(); |
| 607 | } | 607 | } |
| 608 | constexpr u32 first_cb_data = MAXWELL3D_REG_INDEX(const_buffer.cb_data[0]); | 608 | constexpr u32 first_cb_data = MAXWELL3D_REG_INDEX(const_buffer.cb_data); |
| 609 | cb_data_state.start_pos = regs.const_buffer.cb_pos; | 609 | cb_data_state.start_pos = regs.const_buffer.cb_pos; |
| 610 | cb_data_state.id = method - first_cb_data; | 610 | cb_data_state.id = method - first_cb_data; |
| 611 | cb_data_state.current = method; | 611 | cb_data_state.current = method; |
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index 326b32228..002d1b3f9 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h | |||
| @@ -1337,7 +1337,7 @@ public: | |||
| 1337 | u32 cb_address_high; | 1337 | u32 cb_address_high; |
| 1338 | u32 cb_address_low; | 1338 | u32 cb_address_low; |
| 1339 | u32 cb_pos; | 1339 | u32 cb_pos; |
| 1340 | u32 cb_data[NumCBData]; | 1340 | std::array<u32, NumCBData> cb_data; |
| 1341 | 1341 | ||
| 1342 | GPUVAddr BufferAddress() const { | 1342 | GPUVAddr BufferAddress() const { |
| 1343 | return static_cast<GPUVAddr>( | 1343 | return static_cast<GPUVAddr>( |
diff --git a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp index b4473f194..85121d9fd 100644 --- a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp +++ b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp | |||
| @@ -676,7 +676,7 @@ VkFrontFace FrontFace(Maxwell::FrontFace front_face) { | |||
| 676 | return {}; | 676 | return {}; |
| 677 | } | 677 | } |
| 678 | 678 | ||
| 679 | VkCullModeFlags CullFace(Maxwell::CullFace cull_face) { | 679 | VkCullModeFlagBits CullFace(Maxwell::CullFace cull_face) { |
| 680 | switch (cull_face) { | 680 | switch (cull_face) { |
| 681 | case Maxwell::CullFace::Front: | 681 | case Maxwell::CullFace::Front: |
| 682 | return VK_CULL_MODE_FRONT_BIT; | 682 | return VK_CULL_MODE_FRONT_BIT; |
diff --git a/src/video_core/renderer_vulkan/maxwell_to_vk.h b/src/video_core/renderer_vulkan/maxwell_to_vk.h index e59e6b6e2..7c34b47dc 100644 --- a/src/video_core/renderer_vulkan/maxwell_to_vk.h +++ b/src/video_core/renderer_vulkan/maxwell_to_vk.h | |||
| @@ -63,7 +63,7 @@ VkBlendFactor BlendFactor(Maxwell::Blend::Factor factor); | |||
| 63 | 63 | ||
| 64 | VkFrontFace FrontFace(Maxwell::FrontFace front_face); | 64 | VkFrontFace FrontFace(Maxwell::FrontFace front_face); |
| 65 | 65 | ||
| 66 | VkCullModeFlags CullFace(Maxwell::CullFace cull_face); | 66 | VkCullModeFlagBits CullFace(Maxwell::CullFace cull_face); |
| 67 | 67 | ||
| 68 | VkComponentSwizzle SwizzleSource(Tegra::Texture::SwizzleSource swizzle); | 68 | VkComponentSwizzle SwizzleSource(Tegra::Texture::SwizzleSource swizzle); |
| 69 | 69 | ||
diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index a5214d0bc..485cb43f2 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp | |||
| @@ -181,6 +181,7 @@ std::vector<vk::ShaderModule> VKGraphicsPipeline::CreateShaderModules( | |||
| 181 | .pNext = nullptr, | 181 | .pNext = nullptr, |
| 182 | .flags = 0, | 182 | .flags = 0, |
| 183 | .codeSize = 0, | 183 | .codeSize = 0, |
| 184 | .pCode = nullptr, | ||
| 184 | }; | 185 | }; |
| 185 | 186 | ||
| 186 | std::vector<vk::ShaderModule> shader_modules; | 187 | std::vector<vk::ShaderModule> shader_modules; |
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.h b/src/video_core/renderer_vulkan/vk_texture_cache.h index a55d405d1..8d29361a1 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.h +++ b/src/video_core/renderer_vulkan/vk_texture_cache.h | |||
| @@ -72,7 +72,7 @@ struct TextureCacheRuntime { | |||
| 72 | MemoryAllocator& memory_allocator; | 72 | MemoryAllocator& memory_allocator; |
| 73 | StagingBufferPool& staging_buffer_pool; | 73 | StagingBufferPool& staging_buffer_pool; |
| 74 | BlitImageHelper& blit_image_helper; | 74 | BlitImageHelper& blit_image_helper; |
| 75 | std::unordered_map<RenderPassKey, vk::RenderPass> renderpass_cache; | 75 | std::unordered_map<RenderPassKey, vk::RenderPass> renderpass_cache{}; |
| 76 | 76 | ||
| 77 | void Finish(); | 77 | void Finish(); |
| 78 | 78 | ||
diff --git a/src/video_core/shader/async_shaders.cpp b/src/video_core/shader/async_shaders.cpp index 9707136e9..3b40db9bc 100644 --- a/src/video_core/shader/async_shaders.cpp +++ b/src/video_core/shader/async_shaders.cpp | |||
| @@ -129,6 +129,15 @@ void AsyncShaders::QueueOpenGLShader(const OpenGL::Device& device, | |||
| 129 | .compiler_settings = compiler_settings, | 129 | .compiler_settings = compiler_settings, |
| 130 | .registry = registry, | 130 | .registry = registry, |
| 131 | .cpu_address = cpu_addr, | 131 | .cpu_address = cpu_addr, |
| 132 | .pp_cache = nullptr, | ||
| 133 | .vk_device = nullptr, | ||
| 134 | .scheduler = nullptr, | ||
| 135 | .descriptor_pool = nullptr, | ||
| 136 | .update_descriptor_queue = nullptr, | ||
| 137 | .bindings{}, | ||
| 138 | .program{}, | ||
| 139 | .key{}, | ||
| 140 | .num_color_buffers = 0, | ||
| 132 | }); | 141 | }); |
| 133 | cv.notify_one(); | 142 | cv.notify_one(); |
| 134 | } | 143 | } |
| @@ -143,6 +152,15 @@ void AsyncShaders::QueueVulkanShader(Vulkan::VKPipelineCache* pp_cache, | |||
| 143 | std::unique_lock lock(queue_mutex); | 152 | std::unique_lock lock(queue_mutex); |
| 144 | pending_queue.push({ | 153 | pending_queue.push({ |
| 145 | .backend = Backend::Vulkan, | 154 | .backend = Backend::Vulkan, |
| 155 | .device = nullptr, | ||
| 156 | .shader_type{}, | ||
| 157 | .uid = 0, | ||
| 158 | .code{}, | ||
| 159 | .code_b{}, | ||
| 160 | .main_offset = 0, | ||
| 161 | .compiler_settings{}, | ||
| 162 | .registry{}, | ||
| 163 | .cpu_address = 0, | ||
| 146 | .pp_cache = pp_cache, | 164 | .pp_cache = pp_cache, |
| 147 | .vk_device = &device, | 165 | .vk_device = &device, |
| 148 | .scheduler = &scheduler, | 166 | .scheduler = &scheduler, |
diff --git a/src/video_core/texture_cache/util.cpp b/src/video_core/texture_cache/util.cpp index b23424523..bb2cdef81 100644 --- a/src/video_core/texture_cache/util.cpp +++ b/src/video_core/texture_cache/util.cpp | |||
| @@ -1193,25 +1193,35 @@ u32 MapSizeBytes(const ImageBase& image) { | |||
| 1193 | } | 1193 | } |
| 1194 | } | 1194 | } |
| 1195 | 1195 | ||
| 1196 | using P = PixelFormat; | 1196 | static_assert(CalculateLevelSize(LevelInfo{{1920, 1080, 1}, {0, 2, 0}, {1, 1}, 2, 0}, 0) == |
| 1197 | 1197 | 0x7f8000); | |
| 1198 | static_assert(CalculateLevelSize(LevelInfo{{1920, 1080}, {0, 2, 0}, {1, 1}, 2, 0}, 0) == 0x7f8000); | 1198 | static_assert(CalculateLevelSize(LevelInfo{{32, 32, 1}, {0, 0, 4}, {1, 1}, 4, 0}, 0) == 0x4000); |
| 1199 | static_assert(CalculateLevelSize(LevelInfo{{32, 32}, {0, 0, 4}, {1, 1}, 4, 0}, 0) == 0x4000); | 1199 | |
| 1200 | 1200 | static_assert(CalculateLevelOffset(PixelFormat::R8_SINT, {1920, 1080, 1}, {0, 2, 0}, 1, 0, 7) == | |
| 1201 | static_assert(CalculateLevelOffset(P::R8_SINT, {1920, 1080}, {0, 2}, 1, 0, 7) == 0x2afc00); | 1201 | 0x2afc00); |
| 1202 | static_assert(CalculateLevelOffset(P::ASTC_2D_12X12_UNORM, {8192, 4096}, {0, 2}, 1, 0, 12) == | 1202 | static_assert(CalculateLevelOffset(PixelFormat::ASTC_2D_12X12_UNORM, {8192, 4096, 1}, {0, 2, 0}, 1, |
| 1203 | 0x50d200); | 1203 | 0, 12) == 0x50d200); |
| 1204 | 1204 | ||
| 1205 | static_assert(CalculateLevelOffset(P::A8B8G8R8_UNORM, {1024, 1024}, {0, 4}, 1, 0, 0) == 0); | 1205 | static_assert(CalculateLevelOffset(PixelFormat::A8B8G8R8_UNORM, {1024, 1024, 1}, {0, 4, 0}, 1, 0, |
| 1206 | static_assert(CalculateLevelOffset(P::A8B8G8R8_UNORM, {1024, 1024}, {0, 4}, 1, 0, 1) == 0x400000); | 1206 | 0) == 0); |
| 1207 | static_assert(CalculateLevelOffset(P::A8B8G8R8_UNORM, {1024, 1024}, {0, 4}, 1, 0, 2) == 0x500000); | 1207 | static_assert(CalculateLevelOffset(PixelFormat::A8B8G8R8_UNORM, {1024, 1024, 1}, {0, 4, 0}, 1, 0, |
| 1208 | static_assert(CalculateLevelOffset(P::A8B8G8R8_UNORM, {1024, 1024}, {0, 4}, 1, 0, 3) == 0x540000); | 1208 | 1) == 0x400000); |
| 1209 | static_assert(CalculateLevelOffset(P::A8B8G8R8_UNORM, {1024, 1024}, {0, 4}, 1, 0, 4) == 0x550000); | 1209 | static_assert(CalculateLevelOffset(PixelFormat::A8B8G8R8_UNORM, {1024, 1024, 1}, {0, 4, 0}, 1, 0, |
| 1210 | static_assert(CalculateLevelOffset(P::A8B8G8R8_UNORM, {1024, 1024}, {0, 4}, 1, 0, 5) == 0x554000); | 1210 | 2) == 0x500000); |
| 1211 | static_assert(CalculateLevelOffset(P::A8B8G8R8_UNORM, {1024, 1024}, {0, 4}, 1, 0, 6) == 0x555000); | 1211 | static_assert(CalculateLevelOffset(PixelFormat::A8B8G8R8_UNORM, {1024, 1024, 1}, {0, 4, 0}, 1, 0, |
| 1212 | static_assert(CalculateLevelOffset(P::A8B8G8R8_UNORM, {1024, 1024}, {0, 4}, 1, 0, 7) == 0x555400); | 1212 | 3) == 0x540000); |
| 1213 | static_assert(CalculateLevelOffset(P::A8B8G8R8_UNORM, {1024, 1024}, {0, 4}, 1, 0, 8) == 0x555600); | 1213 | static_assert(CalculateLevelOffset(PixelFormat::A8B8G8R8_UNORM, {1024, 1024, 1}, {0, 4, 0}, 1, 0, |
| 1214 | static_assert(CalculateLevelOffset(P::A8B8G8R8_UNORM, {1024, 1024}, {0, 4}, 1, 0, 9) == 0x555800); | 1214 | 4) == 0x550000); |
| 1215 | static_assert(CalculateLevelOffset(PixelFormat::A8B8G8R8_UNORM, {1024, 1024, 1}, {0, 4, 0}, 1, 0, | ||
| 1216 | 5) == 0x554000); | ||
| 1217 | static_assert(CalculateLevelOffset(PixelFormat::A8B8G8R8_UNORM, {1024, 1024, 1}, {0, 4, 0}, 1, 0, | ||
| 1218 | 6) == 0x555000); | ||
| 1219 | static_assert(CalculateLevelOffset(PixelFormat::A8B8G8R8_UNORM, {1024, 1024, 1}, {0, 4, 0}, 1, 0, | ||
| 1220 | 7) == 0x555400); | ||
| 1221 | static_assert(CalculateLevelOffset(PixelFormat::A8B8G8R8_UNORM, {1024, 1024, 1}, {0, 4, 0}, 1, 0, | ||
| 1222 | 8) == 0x555600); | ||
| 1223 | static_assert(CalculateLevelOffset(PixelFormat::A8B8G8R8_UNORM, {1024, 1024, 1}, {0, 4, 0}, 1, 0, | ||
| 1224 | 9) == 0x555800); | ||
| 1215 | 1225 | ||
| 1216 | constexpr u32 ValidateLayerSize(PixelFormat format, u32 width, u32 height, u32 block_height, | 1226 | constexpr u32 ValidateLayerSize(PixelFormat format, u32 width, u32 height, u32 block_height, |
| 1217 | u32 tile_width_spacing, u32 level) { | 1227 | u32 tile_width_spacing, u32 level) { |
| @@ -1221,13 +1231,14 @@ constexpr u32 ValidateLayerSize(PixelFormat format, u32 width, u32 height, u32 b | |||
| 1221 | return AlignLayerSize(offset, size, block, DefaultBlockHeight(format), tile_width_spacing); | 1231 | return AlignLayerSize(offset, size, block, DefaultBlockHeight(format), tile_width_spacing); |
| 1222 | } | 1232 | } |
| 1223 | 1233 | ||
| 1224 | static_assert(ValidateLayerSize(P::ASTC_2D_12X12_UNORM, 8192, 4096, 2, 0, 12) == 0x50d800); | 1234 | static_assert(ValidateLayerSize(PixelFormat::ASTC_2D_12X12_UNORM, 8192, 4096, 2, 0, 12) == |
| 1225 | static_assert(ValidateLayerSize(P::A8B8G8R8_UNORM, 1024, 1024, 2, 0, 10) == 0x556000); | 1235 | 0x50d800); |
| 1226 | static_assert(ValidateLayerSize(P::BC3_UNORM, 128, 128, 2, 0, 8) == 0x6000); | 1236 | static_assert(ValidateLayerSize(PixelFormat::A8B8G8R8_UNORM, 1024, 1024, 2, 0, 10) == 0x556000); |
| 1237 | static_assert(ValidateLayerSize(PixelFormat::BC3_UNORM, 128, 128, 2, 0, 8) == 0x6000); | ||
| 1227 | 1238 | ||
| 1228 | static_assert(ValidateLayerSize(P::A8B8G8R8_UNORM, 518, 572, 4, 3, 1) == 0x190000, | 1239 | static_assert(ValidateLayerSize(PixelFormat::A8B8G8R8_UNORM, 518, 572, 4, 3, 1) == 0x190000, |
| 1229 | "Tile width spacing is not working"); | 1240 | "Tile width spacing is not working"); |
| 1230 | static_assert(ValidateLayerSize(P::BC5_UNORM, 1024, 1024, 3, 4, 11) == 0x160000, | 1241 | static_assert(ValidateLayerSize(PixelFormat::BC5_UNORM, 1024, 1024, 3, 4, 11) == 0x160000, |
| 1231 | "Compressed tile width spacing is not working"); | 1242 | "Compressed tile width spacing is not working"); |
| 1232 | 1243 | ||
| 1233 | } // namespace VideoCommon | 1244 | } // namespace VideoCommon |
diff --git a/src/video_core/vulkan_common/vulkan_debug_callback.cpp b/src/video_core/vulkan_common/vulkan_debug_callback.cpp index ea7af8ad4..5c64c9bf7 100644 --- a/src/video_core/vulkan_common/vulkan_debug_callback.cpp +++ b/src/video_core/vulkan_common/vulkan_debug_callback.cpp | |||
| @@ -39,6 +39,7 @@ vk::DebugUtilsMessenger CreateDebugCallback(const vk::Instance& instance) { | |||
| 39 | VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT | | 39 | VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT | |
| 40 | VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT, | 40 | VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT, |
| 41 | .pfnUserCallback = Callback, | 41 | .pfnUserCallback = Callback, |
| 42 | .pUserData = nullptr, | ||
| 42 | }); | 43 | }); |
| 43 | } | 44 | } |
| 44 | 45 | ||