|
|
@ -397,6 +397,7 @@ CachedSurfaceView::CachedSurfaceView(CachedSurface& surface, const ViewParams& p
|
|
|
|
const bool is_proxy)
|
|
|
|
const bool is_proxy)
|
|
|
|
: VideoCommon::ViewBase(params), surface{surface}, is_proxy{is_proxy} {
|
|
|
|
: VideoCommon::ViewBase(params), surface{surface}, is_proxy{is_proxy} {
|
|
|
|
target = GetTextureTarget(params.target);
|
|
|
|
target = GetTextureTarget(params.target);
|
|
|
|
|
|
|
|
format = GetFormatTuple(surface.GetSurfaceParams().pixel_format).internal_format;
|
|
|
|
if (!is_proxy) {
|
|
|
|
if (!is_proxy) {
|
|
|
|
texture_view = CreateTextureView();
|
|
|
|
texture_view = CreateTextureView();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -467,17 +468,12 @@ void CachedSurfaceView::ApplySwizzle(SwizzleSource x_source, SwizzleSource y_sou
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
OGLTextureView CachedSurfaceView::CreateTextureView() const {
|
|
|
|
OGLTextureView CachedSurfaceView::CreateTextureView() const {
|
|
|
|
const auto& owner_params = surface.GetSurfaceParams();
|
|
|
|
|
|
|
|
OGLTextureView texture_view;
|
|
|
|
OGLTextureView texture_view;
|
|
|
|
texture_view.Create();
|
|
|
|
texture_view.Create();
|
|
|
|
|
|
|
|
|
|
|
|
const GLuint handle{texture_view.handle};
|
|
|
|
glTextureView(texture_view.handle, target, surface.texture.handle, format, params.base_level,
|
|
|
|
const FormatTuple& tuple{GetFormatTuple(owner_params.pixel_format)};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
glTextureView(handle, target, surface.texture.handle, tuple.internal_format, params.base_level,
|
|
|
|
|
|
|
|
params.num_levels, params.base_layer, params.num_layers);
|
|
|
|
params.num_levels, params.base_layer, params.num_layers);
|
|
|
|
|
|
|
|
ApplyTextureDefaults(surface.GetSurfaceParams(), texture_view.handle);
|
|
|
|
ApplyTextureDefaults(owner_params, handle);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return texture_view;
|
|
|
|
return texture_view;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -521,9 +517,7 @@ void TextureCacheOpenGL::ImageBlit(View& src_view, View& dst_view,
|
|
|
|
const auto& dst_params{dst_view->GetSurfaceParams()};
|
|
|
|
const auto& dst_params{dst_view->GetSurfaceParams()};
|
|
|
|
|
|
|
|
|
|
|
|
OpenGLState prev_state{OpenGLState::GetCurState()};
|
|
|
|
OpenGLState prev_state{OpenGLState::GetCurState()};
|
|
|
|
SCOPE_EXIT({
|
|
|
|
SCOPE_EXIT({ prev_state.Apply(); });
|
|
|
|
prev_state.Apply();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
OpenGLState state;
|
|
|
|
OpenGLState state;
|
|
|
|
state.draw.read_framebuffer = src_framebuffer.handle;
|
|
|
|
state.draw.read_framebuffer = src_framebuffer.handle;
|
|
|
|