Merge pull request #785 from asuessenbach/release

fix some warnings (errors) on release build.
This commit is contained in:
Andreas Süßenbach 2020-10-20 14:25:44 +02:00 committed by GitHub
commit 2ccc36b26b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 25 additions and 7 deletions

View File

@ -11456,6 +11456,7 @@ namespace std
{
#ifdef VULKAN_HPP_NO_EXCEPTIONS
ignore(message);
ignore(successCodes); // just in case VULKAN_HPP_ASSERT_ON_RESULT is empty
VULKAN_HPP_ASSERT_ON_RESULT( std::find( successCodes.begin(), successCodes.end(), result ) != successCodes.end() );
#else
if ( std::find( successCodes.begin(), successCodes.end(), result ) == successCodes.end() )
@ -11471,6 +11472,7 @@ namespace std
{
#ifdef VULKAN_HPP_NO_EXCEPTIONS
ignore(message);
ignore(successCodes); // just in case VULKAN_HPP_ASSERT_ON_RESULT is empty
VULKAN_HPP_ASSERT_ON_RESULT( std::find( successCodes.begin(), successCodes.end(), result ) != successCodes.end() );
#else
if ( std::find( successCodes.begin(), successCodes.end(), result ) == successCodes.end() )
@ -11508,6 +11510,7 @@ namespace std
{
# ifdef VULKAN_HPP_NO_EXCEPTIONS
ignore( message );
ignore(successCodes); // just in case VULKAN_HPP_ASSERT_ON_RESULT is empty
VULKAN_HPP_ASSERT_ON_RESULT( std::find( successCodes.begin(), successCodes.end(), result ) != successCodes.end() );
# else
if ( std::find( successCodes.begin(), successCodes.end(), result ) == successCodes.end() )
@ -11544,6 +11547,7 @@ namespace std
{
# ifdef VULKAN_HPP_NO_EXCEPTIONS
ignore( message );
ignore(successCodes); // just in case VULKAN_HPP_ASSERT_ON_RESULT is empty
VULKAN_HPP_ASSERT_ON_RESULT( std::find( successCodes.begin(), successCodes.end(), result ) != successCodes.end() );
# else
if ( std::find( successCodes.begin(), successCodes.end(), result ) == successCodes.end() )

View File

@ -91,8 +91,10 @@ namespace vk
std::string const & shaderText )
{
std::vector<unsigned int> shaderSPV;
bool ok = GLSLtoSPV( shaderStage, shaderText, shaderSPV );
assert( ok );
if ( !GLSLtoSPV( shaderStage, shaderText, shaderSPV ) )
{
throw std::runtime_error( "Could not convert glsl shader to spir-v -> terminating" );
}
return device->createShaderModuleUnique( vk::ShaderModuleCreateInfo( vk::ShaderModuleCreateFlags(), shaderSPV ) );
}

View File

@ -1016,7 +1016,7 @@ namespace vk
MonochromeImageGenerator::MonochromeImageGenerator( std::array<unsigned char, 3> const & rgb ) : m_rgb( rgb ) {}
void MonochromeImageGenerator::operator()( void * data, vk::Extent2D & extent ) const
void MonochromeImageGenerator::operator()( void * data, vk::Extent2D const & extent ) const
{
// fill in with the monochrome color
unsigned char * pImageMemory = static_cast<unsigned char *>( data );
@ -1041,10 +1041,10 @@ namespace vk
assert( m_channels == 4 );
}
void PixelsImageGenerator::operator()( void * data, vk::Extent2D & extent ) const
void PixelsImageGenerator::operator()( void * data, vk::Extent2D const & extent ) const
{
assert( extent == m_extent );
memcpy( data, m_pixels, m_extent.width * m_extent.height * m_channels );
memcpy( data, m_pixels, extent.width * extent.height * m_channels );
}
TextureData::TextureData( vk::PhysicalDevice const & physicalDevice,

View File

@ -245,7 +245,7 @@ namespace vk
public:
MonochromeImageGenerator( std::array<unsigned char, 3> const & rgb );
void operator()( void * data, vk::Extent2D & extent ) const;
void operator()( void * data, vk::Extent2D const & extent ) const;
private:
std::array<unsigned char, 3> const & m_rgb;
@ -256,7 +256,7 @@ namespace vk
public:
PixelsImageGenerator( vk::Extent2D const & extent, size_t channels, unsigned char const * pixels );
void operator()( void * data, vk::Extent2D & extent ) const;
void operator()( void * data, vk::Extent2D const & extent ) const;
private:
vk::Extent2D m_extent;

View File

@ -15,6 +15,14 @@
// VulkanHpp Samples : Hash
// Compile test on using std::hash on handles
#if defined( _MSC_VER )
# pragma warning( disable : 4189 ) // local variable is initialized but not referenced
#elif defined( __GNUC__ )
# pragma GCC diagnostic ignored "-Wunused-variable"
#else
// unknow compiler... just ignore the warnings for yourselves ;)
#endif
#include "vulkan/vulkan.hpp"
#include <iostream>

View File

@ -16696,6 +16696,7 @@ namespace VULKAN_HPP_NAMESPACE
{
#ifdef VULKAN_HPP_NO_EXCEPTIONS
ignore( message );
ignore( successCodes ); // just in case VULKAN_HPP_ASSERT_ON_RESULT is empty
VULKAN_HPP_ASSERT_ON_RESULT( std::find( successCodes.begin(), successCodes.end(), result ) != successCodes.end() );
#else
if ( std::find( successCodes.begin(), successCodes.end(), result ) == successCodes.end() )
@ -16712,6 +16713,7 @@ namespace VULKAN_HPP_NAMESPACE
{
#ifdef VULKAN_HPP_NO_EXCEPTIONS
ignore( message );
ignore( successCodes ); // just in case VULKAN_HPP_ASSERT_ON_RESULT is empty
VULKAN_HPP_ASSERT_ON_RESULT( std::find( successCodes.begin(), successCodes.end(), result ) != successCodes.end() );
#else
if ( std::find( successCodes.begin(), successCodes.end(), result ) == successCodes.end() )
@ -16750,6 +16752,7 @@ namespace VULKAN_HPP_NAMESPACE
{
# ifdef VULKAN_HPP_NO_EXCEPTIONS
ignore( message );
ignore( successCodes ); // just in case VULKAN_HPP_ASSERT_ON_RESULT is empty
VULKAN_HPP_ASSERT_ON_RESULT( std::find( successCodes.begin(), successCodes.end(), result ) != successCodes.end() );
# else
if ( std::find( successCodes.begin(), successCodes.end(), result ) == successCodes.end() )
@ -16786,6 +16789,7 @@ namespace VULKAN_HPP_NAMESPACE
{
# ifdef VULKAN_HPP_NO_EXCEPTIONS
ignore( message );
ignore( successCodes ); // just in case VULKAN_HPP_ASSERT_ON_RESULT is empty
VULKAN_HPP_ASSERT_ON_RESULT( std::find( successCodes.begin(), successCodes.end(), result ) != successCodes.end() );
# else
if ( std::find( successCodes.begin(), successCodes.end(), result ) == successCodes.end() )