Commit 70942e2e by Nicolas Capens Committed by Nicolas Capens

Fix Vulkan build.

Initialization order mismatch is treated as an error with Clang/GCC: -Werror=reorder Bug b/118383648 Change-Id: I4e56aa3c61ce35d70a28dbdd1ab76d7ca8dae833 Reviewed-on: https://swiftshader-review.googlesource.com/c/22068Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
parent e83048e2
...@@ -12,14 +12,15 @@ ...@@ -12,14 +12,15 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#include "VkConfig.h"
#include "VkDeviceMemory.hpp" #include "VkDeviceMemory.hpp"
#include "VkConfig.h"
namespace vk namespace vk
{ {
DeviceMemory::DeviceMemory(const VkMemoryAllocateInfo* pCreateInfo, void* mem) : DeviceMemory::DeviceMemory(const VkMemoryAllocateInfo* pCreateInfo, void* mem) :
size(pCreateInfo->allocationSize), buffer(nullptr), memoryTypeIndex(pCreateInfo->memoryTypeIndex) size(pCreateInfo->allocationSize), memoryTypeIndex(pCreateInfo->memoryTypeIndex)
{ {
ASSERT(size); ASSERT(size);
} }
...@@ -53,7 +54,7 @@ VkResult DeviceMemory::allocate() ...@@ -53,7 +54,7 @@ VkResult DeviceMemory::allocate()
VkResult DeviceMemory::map(VkDeviceSize pOffset, VkDeviceSize pSize, void** ppData) VkResult DeviceMemory::map(VkDeviceSize pOffset, VkDeviceSize pSize, void** ppData)
{ {
*ppData = getOffsetPointer(pOffset); *ppData = getOffsetPointer(pOffset);
return VK_SUCCESS; return VK_SUCCESS;
} }
......
...@@ -64,6 +64,7 @@ ...@@ -64,6 +64,7 @@
<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;NOMINMAX;_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;NOMINMAX;_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<AdditionalOptions>/permissive- %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/permissive- %(AdditionalOptions)</AdditionalOptions>
<TreatSpecificWarningsAsErrors>4018;5038;4838</TreatSpecificWarningsAsErrors>
</ClCompile> </ClCompile>
<Link> <Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
...@@ -85,6 +86,7 @@ copy "$(OutDir)vk_swiftshader.dll" "$(SolutionDir)out\$(Configuration)_$(Platfor ...@@ -85,6 +86,7 @@ copy "$(OutDir)vk_swiftshader.dll" "$(SolutionDir)out\$(Configuration)_$(Platfor
<PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;NOMINMAX;DEBUGGER_WAIT_DIALOG;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;NOMINMAX;DEBUGGER_WAIT_DIALOG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<AdditionalOptions>/permissive- %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>/permissive- %(AdditionalOptions)</AdditionalOptions>
<TreatSpecificWarningsAsErrors>4018;5038;4838</TreatSpecificWarningsAsErrors>
</ClCompile> </ClCompile>
<Link> <Link>
<ModuleDefinitionFile>swiftshader_icd.def</ModuleDefinitionFile> <ModuleDefinitionFile>swiftshader_icd.def</ModuleDefinitionFile>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment