From b044c047c48469be479ba2633ae14eff8643041e Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Sun, 30 Aug 2015 10:05:56 -0300 Subject: OpenGL: Use Sampler Objects to decouple sampler config from textures Fixes #978 --- src/video_core/renderer_opengl/gl_rasterizer.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/video_core/renderer_opengl/gl_rasterizer.h') diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h index a02d5c856..24560d7f8 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.h +++ b/src/video_core/renderer_opengl/gl_rasterizer.h @@ -80,6 +80,24 @@ private: GLenum gl_type; }; + struct SamplerInfo { + using TextureConfig = Pica::Regs::TextureConfig; + + OGLSampler sampler; + + /// Creates the sampler object, initializing its state so that it's in sync with the SamplerInfo struct. + void Create(); + /// Syncs the sampler object with the config, updating any necessary state. + void SyncWithConfig(const TextureConfig& config); + + private: + TextureConfig::TextureFilter mag_filter; + TextureConfig::TextureFilter min_filter; + TextureConfig::WrapMode wrap_s; + TextureConfig::WrapMode wrap_t; + u32 border_color; + }; + /// Structure that the hardware rendered vertices are composed of struct HardwareVertex { HardwareVertex(const Pica::Shader::OutputVertex& v) { @@ -193,6 +211,7 @@ private: PAddr last_fb_depth_addr; // Hardware rasterizer + std::array texture_samplers; TextureInfo fb_color_texture; DepthTextureInfo fb_depth_texture; OGLShader shader; -- cgit v1.2.3