wip

Junkui Zhang created

Change summary

crates/gpui/src/platform/windows/directx_renderer.rs | 4 ++--
crates/gpui/src/platform/windows/shaders.hlsl        | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)

Detailed changes

crates/gpui/src/platform/windows/directx_renderer.rs 🔗

@@ -19,7 +19,8 @@ use windows::{
 use crate::*;
 
 const RENDER_TARGET_FORMAT: DXGI_FORMAT = DXGI_FORMAT_B8G8R8A8_UNORM;
-const BACK_BUFFER_FORMAT: DXGI_FORMAT = DXGI_FORMAT_B8G8R8A8_UNORM_SRGB;
+// const BACK_BUFFER_FORMAT: DXGI_FORMAT = DXGI_FORMAT_B8G8R8A8_UNORM_SRGB;
+const BACK_BUFFER_FORMAT: DXGI_FORMAT = DXGI_FORMAT_B8G8R8A8_UNORM;
 
 pub(crate) struct DirectXRenderer {
     atlas: Arc<DirectXAtlas>,
@@ -1200,7 +1201,6 @@ fn set_rasterizer_state(device: &ID3D11Device, device_context: &ID3D11DeviceCont
     let desc = D3D11_RASTERIZER_DESC {
         FillMode: D3D11_FILL_SOLID,
         CullMode: D3D11_CULL_NONE,
-        // FrontCounterClockwise: true.into(),
         FrontCounterClockwise: false.into(),
         DepthBias: 0,
         DepthBiasClamp: 0.0,

crates/gpui/src/platform/windows/shaders.hlsl 🔗

@@ -342,8 +342,8 @@ float4 gradient_color(Background background,
             }
 
             // Get the t value for the linear gradient with the color stop percentages.
-            float2 half_size = float2(bounds.size.x, bounds.size.y) / 2.;
-            float2 center = float2(bounds.origin.x, bounds.origin.y) + half_size;
+            float2 half_size = bounds.size * 0.5;
+            float2 center = bounds.origin + half_size;
             float2 center_to_point = position - center;
             float t = dot(center_to_point, direction) / length(direction);
             // Check the direct to determine the use x or y