radv: Wrap pragmas with __GNUC__ to fix MSVC

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7866>
This commit is contained in:
James Park
2020-11-26 18:57:47 -08:00
committed by Marge Bot
parent c4a516ca70
commit fe67fe688a
3 changed files with 12 additions and 0 deletions

View File

@@ -762,10 +762,14 @@ radv_alloc_shader_memory(struct radv_device *device,
list_for_each_entry(struct radv_shader_slab, slab, &device->shader_slabs, slabs) {
uint64_t offset = 0;
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wshadow"
#endif
list_for_each_entry(struct radv_shader_variant, s, &slab->shaders, slab_list) {
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
if (s->bo_offset - offset >= shader->code_size) {
shader->bo = slab->bo;
shader->bo_offset = offset;