diff options
Diffstat (limited to 'mp/src/public/materialsystem')
| -rw-r--r-- | mp/src/public/materialsystem/imaterialsystem.h | 15 | ||||
| -rw-r--r-- | mp/src/public/materialsystem/materialsystem_config.h | 7 |
2 files changed, 20 insertions, 2 deletions
diff --git a/mp/src/public/materialsystem/imaterialsystem.h b/mp/src/public/materialsystem/imaterialsystem.h index 9a16b9db..812eb262 100644 --- a/mp/src/public/materialsystem/imaterialsystem.h +++ b/mp/src/public/materialsystem/imaterialsystem.h @@ -524,7 +524,8 @@ enum RenderTargetSizeMode_t RT_SIZE_FULL_FRAME_BUFFER=4, // Same size as frame buffer, or next lower power of 2 if we can't do that. RT_SIZE_OFFSCREEN=5, // Target of specified size, don't mess with dimensions RT_SIZE_FULL_FRAME_BUFFER_ROUNDED_UP=6, // Same size as the frame buffer, rounded up if necessary for systems that can't do non-power of two textures. - RT_SIZE_REPLAY_SCREENSHOT = 7 // Rounded down to power of 2, essentially... + RT_SIZE_REPLAY_SCREENSHOT = 7, // Rounded down to power of 2, essentially... + RT_SIZE_LITERAL = 8 // Use the size passed in. Don't clamp it to the frame buffer size. Really. }; typedef void (*MaterialBufferReleaseFunc_t)( ); @@ -1028,6 +1029,16 @@ public: #ifdef DX_TO_GL_ABSTRACTION virtual void DoStartupShaderPreloading( void ) = 0; #endif + + // Sets the override sizes for all render target size tests. These replace the frame buffer size. + // Set them when you are rendering primarily to something larger than the frame buffer (as in VR mode). + virtual void SetRenderTargetFrameBufferSizeOverrides( int nWidth, int nHeight ) = 0; + + // Returns the (possibly overridden) framebuffer size for render target sizing. + virtual void GetRenderTargetFrameBufferDimensions( int & nWidth, int & nHeight ) = 0; + + // returns the display device name that matches the adapter index we were started with + virtual char *GetDisplayDeviceName() const = 0; }; @@ -1482,7 +1493,7 @@ public: // Returns whether a pointer is render data. NOTE: passing NULL returns true virtual bool IsRenderData( const void *pData ) const = 0; virtual void PrintfVA( char *fmt, va_list vargs ) = 0; - virtual void Printf( PRINTF_FORMAT_STRING char *fmt, ... ) = 0; + virtual void Printf( PRINTF_FORMAT_STRING const char *fmt, ... ) = 0; virtual float Knob( char *knobname, float *setvalue = NULL ) = 0; // Allows us to override the alpha write setting of a material virtual void OverrideAlphaWriteEnable( bool bEnable, bool bAlphaWriteEnable ) = 0; diff --git a/mp/src/public/materialsystem/materialsystem_config.h b/mp/src/public/materialsystem/materialsystem_config.h index b0fe3a27..2908d2ce 100644 --- a/mp/src/public/materialsystem/materialsystem_config.h +++ b/mp/src/public/materialsystem/materialsystem_config.h @@ -33,6 +33,7 @@ enum MaterialSystem_Config_Flags_t MATSYS_VIDCFG_FLAGS_SCALE_TO_OUTPUT_RESOLUTION = ( 1 << 14 ), MATSYS_VIDCFG_FLAGS_USING_MULTIPLE_WINDOWS = ( 1 << 15 ), MATSYS_VIDCFG_FLAGS_DISABLE_PHONG = ( 1 << 16 ), + MATSYS_VIDCFG_FLAGS_VR_MODE = ( 1 << 17 ), }; struct MaterialSystemHardwareIdentifier_t @@ -64,6 +65,7 @@ struct MaterialSystem_Config_t bool ScaleToOutputResolution() const { return ( m_Flags & MATSYS_VIDCFG_FLAGS_SCALE_TO_OUTPUT_RESOLUTION ) != 0; } bool UsingMultipleWindows() const { return ( m_Flags & MATSYS_VIDCFG_FLAGS_USING_MULTIPLE_WINDOWS ) != 0; } bool UsePhong() const { return ( m_Flags & MATSYS_VIDCFG_FLAGS_DISABLE_PHONG ) == 0; } + bool VRMode() const { return ( m_Flags & MATSYS_VIDCFG_FLAGS_VR_MODE) != 0; } bool ShadowDepthTexture() const { return m_bShadowDepthTexture; } bool MotionBlur() const { return m_bMotionBlur; } bool SupportFlashlight() const { return m_bSupportFlashlight; } @@ -140,6 +142,8 @@ struct MaterialSystem_Config_t bool m_bMotionBlur; bool m_bSupportFlashlight; + int m_nVRModeAdapter; + MaterialSystem_Config_t() { memset( this, 0, sizeof( *this ) ); @@ -160,6 +164,7 @@ struct MaterialSystem_Config_t SetFlag( MATSYS_VIDCFG_FLAGS_SCALE_TO_OUTPUT_RESOLUTION, false ); SetFlag( MATSYS_VIDCFG_FLAGS_USING_MULTIPLE_WINDOWS, false ); SetFlag( MATSYS_VIDCFG_FLAGS_DISABLE_PHONG, false ); + SetFlag( MATSYS_VIDCFG_FLAGS_VR_MODE, false ); m_VideoMode.m_Width = 640; m_VideoMode.m_Height = 480; @@ -182,6 +187,8 @@ struct MaterialSystem_Config_t m_bMotionBlur = false; m_bSupportFlashlight = true; + m_nVRModeAdapter = -1; + // misc defaults bAllowCheats = false; bCompressedTextures = true; |