diff options
| author | bunnei <bunneidev@gmail.com> | 2015-09-05 16:19:52 -0400 |
|---|---|---|
| committer | bunnei <bunneidev@gmail.com> | 2015-09-05 16:19:52 -0400 |
| commit | 51e91dfd8608126b2cb409fa2e8513f28fbf293b (patch) | |
| tree | f76ddff71ac10838e6429815d8267c82b602737f /src/video_core/renderer_opengl/gl_rasterizer.h | |
| parent | cc19a766563f718fd62548dbb9166919cff1a8c3 (diff) | |
| parent | b044c047c48469be479ba2633ae14eff8643041e (diff) | |
Merge pull request #1104 from yuriks/opengl-samplers
OpenGL: Use Sampler Objects to decouple sampler config from textures
Diffstat (limited to 'src/video_core/renderer_opengl/gl_rasterizer.h')
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.h | 19 |
1 files changed, 19 insertions, 0 deletions
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<SamplerInfo, 3> texture_samplers; TextureInfo fb_color_texture; DepthTextureInfo fb_depth_texture; OGLShader shader; |
