diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/sockets/bsd.cpp | 48 | ||||
| -rw-r--r-- | src/core/hle/service/sockets/bsd.h | 4 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 1 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_texture_cache.cpp | 40 |
4 files changed, 81 insertions, 12 deletions
diff --git a/src/core/hle/service/sockets/bsd.cpp b/src/core/hle/service/sockets/bsd.cpp index 884ad173b..f67fab2f9 100644 --- a/src/core/hle/service/sockets/bsd.cpp +++ b/src/core/hle/service/sockets/bsd.cpp | |||
| @@ -42,6 +42,26 @@ void BSD::Socket(Kernel::HLERequestContext& ctx) { | |||
| 42 | rb.Push<u32>(0); // bsd errno | 42 | rb.Push<u32>(0); // bsd errno |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | void BSD::Select(Kernel::HLERequestContext& ctx) { | ||
| 46 | LOG_WARNING(Service, "(STUBBED) called"); | ||
| 47 | |||
| 48 | IPC::ResponseBuilder rb{ctx, 4}; | ||
| 49 | |||
| 50 | rb.Push(RESULT_SUCCESS); | ||
| 51 | rb.Push<u32>(0); // ret | ||
| 52 | rb.Push<u32>(0); // bsd errno | ||
| 53 | } | ||
| 54 | |||
| 55 | void BSD::Bind(Kernel::HLERequestContext& ctx) { | ||
| 56 | LOG_WARNING(Service, "(STUBBED) called"); | ||
| 57 | |||
| 58 | IPC::ResponseBuilder rb{ctx, 4}; | ||
| 59 | |||
| 60 | rb.Push(RESULT_SUCCESS); | ||
| 61 | rb.Push<u32>(0); // ret | ||
| 62 | rb.Push<u32>(0); // bsd errno | ||
| 63 | } | ||
| 64 | |||
| 45 | void BSD::Connect(Kernel::HLERequestContext& ctx) { | 65 | void BSD::Connect(Kernel::HLERequestContext& ctx) { |
| 46 | LOG_WARNING(Service, "(STUBBED) called"); | 66 | LOG_WARNING(Service, "(STUBBED) called"); |
| 47 | 67 | ||
| @@ -52,6 +72,26 @@ void BSD::Connect(Kernel::HLERequestContext& ctx) { | |||
| 52 | rb.Push<u32>(0); // bsd errno | 72 | rb.Push<u32>(0); // bsd errno |
| 53 | } | 73 | } |
| 54 | 74 | ||
| 75 | void BSD::Listen(Kernel::HLERequestContext& ctx) { | ||
| 76 | LOG_WARNING(Service, "(STUBBED) called"); | ||
| 77 | |||
| 78 | IPC::ResponseBuilder rb{ctx, 4}; | ||
| 79 | |||
| 80 | rb.Push(RESULT_SUCCESS); | ||
| 81 | rb.Push<u32>(0); // ret | ||
| 82 | rb.Push<u32>(0); // bsd errno | ||
| 83 | } | ||
| 84 | |||
| 85 | void BSD::SetSockOpt(Kernel::HLERequestContext& ctx) { | ||
| 86 | LOG_WARNING(Service, "(STUBBED) called"); | ||
| 87 | |||
| 88 | IPC::ResponseBuilder rb{ctx, 4}; | ||
| 89 | |||
| 90 | rb.Push(RESULT_SUCCESS); | ||
| 91 | rb.Push<u32>(0); // ret | ||
| 92 | rb.Push<u32>(0); // bsd errno | ||
| 93 | } | ||
| 94 | |||
| 55 | void BSD::SendTo(Kernel::HLERequestContext& ctx) { | 95 | void BSD::SendTo(Kernel::HLERequestContext& ctx) { |
| 56 | LOG_WARNING(Service, "(STUBBED) called"); | 96 | LOG_WARNING(Service, "(STUBBED) called"); |
| 57 | 97 | ||
| @@ -80,7 +120,7 @@ BSD::BSD(const char* name) : ServiceFramework(name) { | |||
| 80 | {2, &BSD::Socket, "Socket"}, | 120 | {2, &BSD::Socket, "Socket"}, |
| 81 | {3, nullptr, "SocketExempt"}, | 121 | {3, nullptr, "SocketExempt"}, |
| 82 | {4, nullptr, "Open"}, | 122 | {4, nullptr, "Open"}, |
| 83 | {5, nullptr, "Select"}, | 123 | {5, &BSD::Select, "Select"}, |
| 84 | {6, nullptr, "Poll"}, | 124 | {6, nullptr, "Poll"}, |
| 85 | {7, nullptr, "Sysctl"}, | 125 | {7, nullptr, "Sysctl"}, |
| 86 | {8, nullptr, "Recv"}, | 126 | {8, nullptr, "Recv"}, |
| @@ -88,15 +128,15 @@ BSD::BSD(const char* name) : ServiceFramework(name) { | |||
| 88 | {10, nullptr, "Send"}, | 128 | {10, nullptr, "Send"}, |
| 89 | {11, &BSD::SendTo, "SendTo"}, | 129 | {11, &BSD::SendTo, "SendTo"}, |
| 90 | {12, nullptr, "Accept"}, | 130 | {12, nullptr, "Accept"}, |
| 91 | {13, nullptr, "Bind"}, | 131 | {13, &BSD::Bind, "Bind"}, |
| 92 | {14, &BSD::Connect, "Connect"}, | 132 | {14, &BSD::Connect, "Connect"}, |
| 93 | {15, nullptr, "GetPeerName"}, | 133 | {15, nullptr, "GetPeerName"}, |
| 94 | {16, nullptr, "GetSockName"}, | 134 | {16, nullptr, "GetSockName"}, |
| 95 | {17, nullptr, "GetSockOpt"}, | 135 | {17, nullptr, "GetSockOpt"}, |
| 96 | {18, nullptr, "Listen"}, | 136 | {18, &BSD::Listen, "Listen"}, |
| 97 | {19, nullptr, "Ioctl"}, | 137 | {19, nullptr, "Ioctl"}, |
| 98 | {20, nullptr, "Fcntl"}, | 138 | {20, nullptr, "Fcntl"}, |
| 99 | {21, nullptr, "SetSockOpt"}, | 139 | {21, &BSD::SetSockOpt, "SetSockOpt"}, |
| 100 | {22, nullptr, "Shutdown"}, | 140 | {22, nullptr, "Shutdown"}, |
| 101 | {23, nullptr, "ShutdownAllSockets"}, | 141 | {23, nullptr, "ShutdownAllSockets"}, |
| 102 | {24, nullptr, "Write"}, | 142 | {24, nullptr, "Write"}, |
diff --git a/src/core/hle/service/sockets/bsd.h b/src/core/hle/service/sockets/bsd.h index 0fe0e65c6..3098e3baf 100644 --- a/src/core/hle/service/sockets/bsd.h +++ b/src/core/hle/service/sockets/bsd.h | |||
| @@ -18,7 +18,11 @@ private: | |||
| 18 | void RegisterClient(Kernel::HLERequestContext& ctx); | 18 | void RegisterClient(Kernel::HLERequestContext& ctx); |
| 19 | void StartMonitoring(Kernel::HLERequestContext& ctx); | 19 | void StartMonitoring(Kernel::HLERequestContext& ctx); |
| 20 | void Socket(Kernel::HLERequestContext& ctx); | 20 | void Socket(Kernel::HLERequestContext& ctx); |
| 21 | void Select(Kernel::HLERequestContext& ctx); | ||
| 22 | void Bind(Kernel::HLERequestContext& ctx); | ||
| 21 | void Connect(Kernel::HLERequestContext& ctx); | 23 | void Connect(Kernel::HLERequestContext& ctx); |
| 24 | void Listen(Kernel::HLERequestContext& ctx); | ||
| 25 | void SetSockOpt(Kernel::HLERequestContext& ctx); | ||
| 22 | void SendTo(Kernel::HLERequestContext& ctx); | 26 | void SendTo(Kernel::HLERequestContext& ctx); |
| 23 | void Close(Kernel::HLERequestContext& ctx); | 27 | void Close(Kernel::HLERequestContext& ctx); |
| 24 | 28 | ||
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index 2996aaf08..6531dfe9b 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp | |||
| @@ -1019,7 +1019,6 @@ private: | |||
| 1019 | } | 1019 | } |
| 1020 | return {{"gl_ViewportIndex", Type::Int}}; | 1020 | return {{"gl_ViewportIndex", Type::Int}}; |
| 1021 | case 3: | 1021 | case 3: |
| 1022 | UNIMPLEMENTED_MSG("Requires some state changes for gl_PointSize to work in shader"); | ||
| 1023 | return {{"gl_PointSize", Type::Float}}; | 1022 | return {{"gl_PointSize", Type::Float}}; |
| 1024 | } | 1023 | } |
| 1025 | return {}; | 1024 | return {}; |
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp index e95eb069e..d4b81cd87 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.cpp +++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp | |||
| @@ -176,6 +176,19 @@ GLint GetSwizzleSource(SwizzleSource source) { | |||
| 176 | return GL_NONE; | 176 | return GL_NONE; |
| 177 | } | 177 | } |
| 178 | 178 | ||
| 179 | GLenum GetComponent(PixelFormat format, bool is_first) { | ||
| 180 | switch (format) { | ||
| 181 | case PixelFormat::Z24S8: | ||
| 182 | case PixelFormat::Z32FS8: | ||
| 183 | return is_first ? GL_DEPTH_COMPONENT : GL_STENCIL_INDEX; | ||
| 184 | case PixelFormat::S8Z24: | ||
| 185 | return is_first ? GL_STENCIL_INDEX : GL_DEPTH_COMPONENT; | ||
| 186 | default: | ||
| 187 | UNREACHABLE(); | ||
| 188 | return GL_DEPTH_COMPONENT; | ||
| 189 | } | ||
| 190 | } | ||
| 191 | |||
| 179 | void ApplyTextureDefaults(const SurfaceParams& params, GLuint texture) { | 192 | void ApplyTextureDefaults(const SurfaceParams& params, GLuint texture) { |
| 180 | if (params.IsBuffer()) { | 193 | if (params.IsBuffer()) { |
| 181 | return; | 194 | return; |
| @@ -184,7 +197,7 @@ void ApplyTextureDefaults(const SurfaceParams& params, GLuint texture) { | |||
| 184 | glTextureParameteri(texture, GL_TEXTURE_MAG_FILTER, GL_LINEAR); | 197 | glTextureParameteri(texture, GL_TEXTURE_MAG_FILTER, GL_LINEAR); |
| 185 | glTextureParameteri(texture, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); | 198 | glTextureParameteri(texture, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); |
| 186 | glTextureParameteri(texture, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); | 199 | glTextureParameteri(texture, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); |
| 187 | glTextureParameteri(texture, GL_TEXTURE_MAX_LEVEL, params.num_levels - 1); | 200 | glTextureParameteri(texture, GL_TEXTURE_MAX_LEVEL, static_cast<GLint>(params.num_levels - 1)); |
| 188 | if (params.num_levels == 1) { | 201 | if (params.num_levels == 1) { |
| 189 | glTextureParameterf(texture, GL_TEXTURE_LOD_BIAS, 1000.0f); | 202 | glTextureParameterf(texture, GL_TEXTURE_LOD_BIAS, 1000.0f); |
| 190 | } | 203 | } |
| @@ -416,11 +429,21 @@ void CachedSurfaceView::ApplySwizzle(SwizzleSource x_source, SwizzleSource y_sou | |||
| 416 | if (new_swizzle == swizzle) | 429 | if (new_swizzle == swizzle) |
| 417 | return; | 430 | return; |
| 418 | swizzle = new_swizzle; | 431 | swizzle = new_swizzle; |
| 419 | const std::array<GLint, 4> gl_swizzle = {GetSwizzleSource(x_source), GetSwizzleSource(y_source), | 432 | const std::array gl_swizzle = {GetSwizzleSource(x_source), GetSwizzleSource(y_source), |
| 420 | GetSwizzleSource(z_source), | 433 | GetSwizzleSource(z_source), GetSwizzleSource(w_source)}; |
| 421 | GetSwizzleSource(w_source)}; | ||
| 422 | const GLuint handle = GetTexture(); | 434 | const GLuint handle = GetTexture(); |
| 423 | glTextureParameteriv(handle, GL_TEXTURE_SWIZZLE_RGBA, gl_swizzle.data()); | 435 | const PixelFormat format = surface.GetSurfaceParams().pixel_format; |
| 436 | switch (format) { | ||
| 437 | case PixelFormat::Z24S8: | ||
| 438 | case PixelFormat::Z32FS8: | ||
| 439 | case PixelFormat::S8Z24: | ||
| 440 | glTextureParameteri(handle, GL_DEPTH_STENCIL_TEXTURE_MODE, | ||
| 441 | GetComponent(format, x_source == SwizzleSource::R)); | ||
| 442 | break; | ||
| 443 | default: | ||
| 444 | glTextureParameteriv(handle, GL_TEXTURE_SWIZZLE_RGBA, gl_swizzle.data()); | ||
| 445 | break; | ||
| 446 | } | ||
| 424 | } | 447 | } |
| 425 | 448 | ||
| 426 | OGLTextureView CachedSurfaceView::CreateTextureView() const { | 449 | OGLTextureView CachedSurfaceView::CreateTextureView() const { |
| @@ -529,8 +552,11 @@ void TextureCacheOpenGL::ImageBlit(View& src_view, View& dst_view, | |||
| 529 | const Common::Rectangle<u32>& dst_rect = copy_config.dst_rect; | 552 | const Common::Rectangle<u32>& dst_rect = copy_config.dst_rect; |
| 530 | const bool is_linear = copy_config.filter == Tegra::Engines::Fermi2D::Filter::Linear; | 553 | const bool is_linear = copy_config.filter == Tegra::Engines::Fermi2D::Filter::Linear; |
| 531 | 554 | ||
| 532 | glBlitFramebuffer(src_rect.left, src_rect.top, src_rect.right, src_rect.bottom, dst_rect.left, | 555 | glBlitFramebuffer(static_cast<GLint>(src_rect.left), static_cast<GLint>(src_rect.top), |
| 533 | dst_rect.top, dst_rect.right, dst_rect.bottom, buffers, | 556 | static_cast<GLint>(src_rect.right), static_cast<GLint>(src_rect.bottom), |
| 557 | static_cast<GLint>(dst_rect.left), static_cast<GLint>(dst_rect.top), | ||
| 558 | static_cast<GLint>(dst_rect.right), static_cast<GLint>(dst_rect.bottom), | ||
| 559 | buffers, | ||
| 534 | is_linear && (buffers == GL_COLOR_BUFFER_BIT) ? GL_LINEAR : GL_NEAREST); | 560 | is_linear && (buffers == GL_COLOR_BUFFER_BIT) ? GL_LINEAR : GL_NEAREST); |
| 535 | } | 561 | } |
| 536 | 562 | ||