early-access version 3089
This commit is contained in:
@@ -29,17 +29,17 @@ constexpr std::array PROGRAM_LUT{
|
||||
[[nodiscard]] GLenum GetTextureBufferFormat(GLenum gl_format) {
|
||||
switch (gl_format) {
|
||||
case GL_RGBA8_SNORM:
|
||||
return GL_RGBA8;
|
||||
return GL_RGBA8I;
|
||||
case GL_R8_SNORM:
|
||||
return GL_R8;
|
||||
return GL_R8I;
|
||||
case GL_RGBA16_SNORM:
|
||||
return GL_RGBA16;
|
||||
return GL_RGBA16I;
|
||||
case GL_R16_SNORM:
|
||||
return GL_R16;
|
||||
return GL_R16I;
|
||||
case GL_RG16_SNORM:
|
||||
return GL_RG16;
|
||||
return GL_RG16I;
|
||||
case GL_RG8_SNORM:
|
||||
return GL_RG8;
|
||||
return GL_RG8I;
|
||||
default:
|
||||
return gl_format;
|
||||
}
|
||||
@@ -96,9 +96,6 @@ GLuint Buffer::View(u32 offset, u32 size, PixelFormat format) {
|
||||
texture.Create(GL_TEXTURE_BUFFER);
|
||||
const GLenum gl_format{MaxwellToGL::GetFormatTuple(format).internal_format};
|
||||
const GLenum texture_format{GetTextureBufferFormat(gl_format)};
|
||||
if (texture_format != gl_format) {
|
||||
LOG_WARNING(Render_OpenGL, "Emulating SNORM texture buffer with UNORM.");
|
||||
}
|
||||
glTextureBufferRange(texture.handle, texture_format, buffer.handle, offset, size);
|
||||
views.push_back({
|
||||
.offset = offset,
|
||||
|
@@ -503,6 +503,17 @@ void GraphicsPipeline::ConfigureImpl(bool is_indexed) {
|
||||
float_image_scaling_mask, down_factor, 0.0f);
|
||||
}
|
||||
}
|
||||
if (info.uses_render_area) {
|
||||
const auto render_area_width(static_cast<GLfloat>(regs.surface_clip.width));
|
||||
const auto render_area_height(static_cast<GLfloat>(regs.surface_clip.height));
|
||||
if (use_assembly) {
|
||||
glProgramLocalParameter4fARB(AssemblyStage(stage), 1, render_area_width,
|
||||
render_area_height, 0.0f, 0.0f);
|
||||
} else {
|
||||
glProgramUniform4f(source_programs[stage].handle, 1, render_area_width,
|
||||
render_area_height, 0.0f, 0.0f);
|
||||
}
|
||||
}
|
||||
}};
|
||||
if constexpr (Spec::enabled_stages[0]) {
|
||||
prepare_stage(0);
|
||||
|
@@ -618,6 +618,16 @@ void RasterizerOpenGL::SyncViewport() {
|
||||
}
|
||||
flags[Dirty::Viewport0 + index] = false;
|
||||
|
||||
if (!regs.viewport_scale_offset_enabled) {
|
||||
const auto x = static_cast<GLfloat>(regs.surface_clip.x);
|
||||
const auto y = static_cast<GLfloat>(regs.surface_clip.y);
|
||||
const auto width = static_cast<GLfloat>(regs.surface_clip.width);
|
||||
const auto height = static_cast<GLfloat>(regs.surface_clip.height);
|
||||
glViewportIndexedf(static_cast<GLuint>(index), x, y, width != 0.0f ? width : 1.0f,
|
||||
height != 0.0f ? height : 1.0f);
|
||||
continue;
|
||||
}
|
||||
|
||||
const auto& src = regs.viewport_transform[index];
|
||||
GLfloat x = conv(src.translate_x - src.scale_x);
|
||||
GLfloat y = conv(src.translate_y - src.scale_y);
|
||||
|
@@ -49,7 +49,7 @@ using VideoCommon::LoadPipelines;
|
||||
using VideoCommon::SerializePipeline;
|
||||
using Context = ShaderContext::Context;
|
||||
|
||||
constexpr u32 CACHE_VERSION = 6;
|
||||
constexpr u32 CACHE_VERSION = 7;
|
||||
|
||||
template <typename Container>
|
||||
auto MakeSpan(Container& container) {
|
||||
@@ -76,7 +76,7 @@ Shader::RuntimeInfo MakeRuntimeInfo(const GraphicsPipelineKey& key,
|
||||
}
|
||||
break;
|
||||
case Shader::Stage::TessellationEval:
|
||||
// invert the face
|
||||
// Flip the face, as opengl's drawing is also flipped
|
||||
info.tess_clockwise = key.tessellation_clockwise == 0;
|
||||
info.tess_primitive = [&key] {
|
||||
switch (key.tessellation_primitive) {
|
||||
@@ -219,6 +219,7 @@ ShaderCache::ShaderCache(RasterizerOpenGL& rasterizer_, Core::Frontend::EmuWindo
|
||||
.support_float16 = false,
|
||||
.support_int64 = device.HasShaderInt64(),
|
||||
.needs_demote_reorder = device.IsAmd(),
|
||||
.support_snorm_render_buffer = false,
|
||||
} {
|
||||
if (use_asynchronous_shaders) {
|
||||
workers = CreateWorkers();
|
||||
|
@@ -70,8 +70,8 @@ void SetupDirtyViewports(Tables& tables) {
|
||||
FillBlock(tables[1], OFF(viewport_transform), NUM(viewport_transform), Viewports);
|
||||
FillBlock(tables[1], OFF(viewports), NUM(viewports), Viewports);
|
||||
|
||||
tables[0][OFF(viewport_scale_offset_enbled)] = ViewportTransform;
|
||||
tables[1][OFF(viewport_scale_offset_enbled)] = Viewports;
|
||||
tables[0][OFF(viewport_scale_offset_enabled)] = ViewportTransform;
|
||||
tables[1][OFF(viewport_scale_offset_enabled)] = Viewports;
|
||||
}
|
||||
|
||||
void SetupDirtyScissors(Tables& tables) {
|
||||
|
Reference in New Issue
Block a user