summarylogtreecommitdiffstats
path: root/patch.diff
diff options
context:
space:
mode:
Diffstat (limited to 'patch.diff')
-rw-r--r--patch.diff139
1 files changed, 139 insertions, 0 deletions
diff --git a/patch.diff b/patch.diff
new file mode 100644
index 00000000000..fc397be5d14
--- /dev/null
+++ b/patch.diff
@@ -0,0 +1,139 @@
+ renderdoc/CMakeLists.txt | 3 +++
+ renderdoc/driver/vulkan/vk_replay.cpp | 33 ++++++++++++++++++++++++++++++---
+ renderdoc/maths/half_convert.h | 9 +++++++--
+ renderdoc/serialise/utf8printf.cpp | 19 +++++++++++++++----
+ 4 files changed, 55 insertions(+), 9 deletions(-)
+
+diff --git a/renderdoc/CMakeLists.txt b/renderdoc/CMakeLists.txt
+index 0a7eed3..0051a2d 100644
+--- a/renderdoc/CMakeLists.txt
++++ b/renderdoc/CMakeLists.txt
+@@ -138,6 +138,9 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+ PROPERTIES COMPILE_FLAGS "-Wno-extra -Wno-unused-function")
+ endif()
+
++set_source_files_properties(3rdparty/jpeg-compressor/jpgd.cpp
++ PROPERTIES COMPILE_FLAGS "-Wno-shift-negative-value")
++
+ add_library(rdoc OBJECT ${sources})
+ target_compile_definitions(rdoc ${RDOC_DEFINITIONS})
+ target_include_directories(rdoc ${RDOC_INCLUDES})
+diff --git a/renderdoc/driver/vulkan/vk_replay.cpp b/renderdoc/driver/vulkan/vk_replay.cpp
+index d0b5738..6e9eb18 100644
+--- a/renderdoc/driver/vulkan/vk_replay.cpp
++++ b/renderdoc/driver/vulkan/vk_replay.cpp
+@@ -1584,7 +1584,8 @@ void VulkanReplay::RenderMesh(uint32_t eventID, const vector<MeshFormat> &second
+ MeshUBOData *data = (MeshUBOData *)GetDebugManager()->m_MeshUBO.Map(vt, dev, &uboOffs);
+
+ data->mvp = ModelViewProj;
+- data->color = (Vec4f &)cfg.prevMeshColour;
++ data->color = Vec4f(cfg.prevMeshColour.x, cfg.prevMeshColour.y, cfg.prevMeshColour.z,
++ cfg.prevMeshColour.w);
+ data->homogenousInput = cfg.position.unproject;
+ data->pointSpriteSize = Vec2f(0.0f, 0.0f);
+ data->displayFormat = MESHDISPLAY_SOLID;
+@@ -3257,7 +3258,20 @@ void VulkanReplay::SavePipelineState()
+ dst.bindings[b].binds[a].res = rm->GetOriginalID(c.m_BufferView[viewid].buffer);
+ dst.bindings[b].binds[a].offset = c.m_BufferView[viewid].offset;
+ if(dynamicOffset)
+- dst.bindings[b].binds[a].offset += *(uint32_t *)&info[a].imageInfo.imageLayout;
++ {
++ union
++ {
++ VkImageLayout l;
++ uint32_t u;
++ } offs;
++
++ RDCCOMPILE_ASSERT(sizeof(VkImageLayout) == sizeof(uint32_t),
++ "VkImageLayout isn't 32-bit sized");
++
++ offs.l = info[a].imageInfo.imageLayout;
++
++ dst.bindings[b].binds[a].offset += offs.u;
++ }
+ dst.bindings[b].binds[a].size = c.m_BufferView[viewid].size;
+ }
+ else
+@@ -3280,7 +3294,20 @@ void VulkanReplay::SavePipelineState()
+
+ dst.bindings[b].binds[a].offset = info[a].bufferInfo.offset;
+ if(dynamicOffset)
+- dst.bindings[b].binds[a].offset += *(uint32_t *)&info[a].imageInfo.imageLayout;
++ {
++ union
++ {
++ VkImageLayout l;
++ uint32_t u;
++ } offs;
++
++ RDCCOMPILE_ASSERT(sizeof(VkImageLayout) == sizeof(uint32_t),
++ "VkImageLayout isn't 32-bit sized");
++
++ offs.l = info[a].imageInfo.imageLayout;
++
++ dst.bindings[b].binds[a].offset += offs.u;
++ }
+
+ dst.bindings[b].binds[a].size = info[a].bufferInfo.range;
+ }
+diff --git a/renderdoc/maths/half_convert.h b/renderdoc/maths/half_convert.h
+index b6f63d5..4577345 100644
+--- a/renderdoc/maths/half_convert.h
++++ b/renderdoc/maths/half_convert.h
+@@ -121,7 +121,12 @@ inline float ConvertFromHalf(uint16_t comp)
+ }
+ else //if(exponent = 0x1f)
+ {
+- int nan = 0x7F800001;
+- return *(float*)&nan;
++ union
++ {
++ int i;
++ float f;
++ } nan;
++ nan.i = 0x7F800001;
++ return nan.f;
+ }
+ }
+diff --git a/renderdoc/serialise/utf8printf.cpp b/renderdoc/serialise/utf8printf.cpp
+index b9b7aa8..8aa949d 100644
+--- a/renderdoc/serialise/utf8printf.cpp
++++ b/renderdoc/serialise/utf8printf.cpp
+@@ -115,22 +115,33 @@ void PrintInteger(bool typeUnsigned, uint64_t argu, int base, uint64_t numbits,
+ {
+ int64_t argi = 0;
+
++ union
++ {
++ uint64_t *u64;
++ signed int *i;
++ signed char *c;
++ signed short *s;
++ int64_t *i64;
++ } typepun;
++
++ typepun.u64 = &argu;
++
+ // cast the appropriate size to signed version
+ switch(formatter.Length)
+ {
+ default:
+ case None:
+ case Long:
+- argi = (int64_t)*(signed int*)&argu;
++ argi = (int64_t)*typepun.i;
+ break;
+ case HalfHalf:
+- argi = (int64_t)*(signed char*)&argu;
++ argi = (int64_t)*typepun.c;
+ break;
+ case Half:
+- argi = (int64_t)*(signed short*)&argu;
++ argi = (int64_t)*typepun.s;
+ break;
+ case LongLong:
+- argi = (int64_t)*(int64_t*)&argu;
++ argi = (int64_t)*typepun.i64;
+ break;
+ }
+