Fixed Windows build

This commit is contained in:
Robert Beckebans 2020-03-22 13:22:45 +01:00
parent 98630cf6ec
commit 367d5af7a2
5 changed files with 22 additions and 12 deletions

View file

@ -362,7 +362,7 @@ if(USE_VULKAN)
# options required by November 2018 release
SET_OPTION(ENABLE_SPVREMAPPER OFF)
SET_OPTION(ENABLE_GLSLANG_BINARIES ON)
SET_OPTION(ENABLE_GLSLANG_BINARIES OFF)
SET_OPTION(ENABLE_HLSL OFF)
SET_OPTION(ENABLE_OPT ON)
SET_OPTION(SPIRV_SKIP_EXECUTABLES ON)
@ -376,7 +376,7 @@ if(USE_VULKAN)
set(GLSLANG_DIR ${CMAKE_CURRENT_SOURCE_DIR}/extern/glslang)
add_subdirectory(${GLSLANG_DIR})
include_directories(${GLSLANG_DIR})
include_directories(${GLSLANG_DIR}/glslang)
endif()
else()

View file

@ -122,11 +122,11 @@ class idDrawVert
public:
idVec3 xyz; // 12 bytes
private:
// RB: don't let the old tools code mess with these values
halfFloat_t st[2]; // 4 bytes
byte normal[4]; // 4 bytes
byte tangent[4]; // 4 bytes -- [3] is texture polarity sign
//private:
// RB: don't let the old tools code mess with these values
public:
byte color[4]; // 4 bytes
byte color2[4]; // 4 bytes -- weights for skinning

View file

@ -131,8 +131,11 @@ void RB_SetVertexColorParms( stageVertexColor_t svc );
//bool CreateGameWindow( gfxImpParms_t parms );
#if defined( USE_VULKAN )
#include <SDL.h>
#include <SDL_vulkan.h>
#if defined(__linux__)
#include <SDL.h>
#include <SDL_vulkan.h>
#endif
struct gpuInfo_t
{
@ -150,7 +153,7 @@ struct vulkanContext_t
{
// Eric: If on linux, use this to pass SDL_Window pointer to the SDL_Vulkan_* methods not in sdl_vkimp.cpp file.
#if defined(__linux__)
SDL_Window* sdlWindow = nullptr;
SDL_Window* sdlWindow = nullptr;
#endif
uint64 frameCounter;
uint32 frameParity;

View file

@ -51,6 +51,8 @@ idCVar r_syncEveryFrame( "r_syncEveryFrame", "1", CVAR_BOOL, "Don't let the GPU
idCVar r_vkEnableValidationLayers( "r_vkEnableValidationLayers", "0", CVAR_BOOL | CVAR_INIT, "" );
vulkanContext_t vkcontext;
#if defined(_WIN32)
static const int g_numInstanceExtensions = 2;
static const char* g_instanceExtensions[ g_numInstanceExtensions ] =
@ -723,11 +725,15 @@ static VkExtent2D ChooseSurfaceExtent( VkSurfaceCapabilitiesKHR& caps )
{
VkExtent2D extent;
int width;
int height;
int width = glConfig.nativeScreenWidth;
int height = glConfig.nativeScreenHeight;
#if defined(__linux__)
SDL_Vulkan_GetDrawableSize( vkcontext.sdlWindow, &width, &height );
width = CLAMP( width, caps.minImageExtent.width, caps.maxImageExtent.width );
height = CLAMP( height, caps.minImageExtent.height, caps.maxImageExtent.height );
width = idMath::ClampInt( caps.minImageExtent.width, caps.maxImageExtent.width, width );
height = idMath::ClampInt( caps.minImageExtent.height, caps.maxImageExtent.height, height );
#endif
if( caps.currentExtent.width == -1 )
{

View file

@ -407,7 +407,8 @@ namespace glslang
// These are the default resources for TBuiltInResources, used for both
// - parsing this string for the case where the user didn't supply one,
// - dumping out a template for user construction of a config file.
#if 1
#if 0
// RB: if you want to use this then you need to compile GLSLANG with ENABLE_GLSLANG_BINARIES ON
extern const TBuiltInResource DefaultTBuiltInResource;
#else