diff options
Diffstat (limited to 'src/gallium/state_trackers')
7 files changed, 9 insertions, 22 deletions
diff --git a/src/gallium/state_trackers/d3d1x/dxgi/src/dxgi_native.cpp b/src/gallium/state_trackers/d3d1x/dxgi/src/dxgi_native.cpp index 2828389cebf..5d581aa2e3f 100644 --- a/src/gallium/state_trackers/d3d1x/dxgi/src/dxgi_native.cpp +++ b/src/gallium/state_trackers/d3d1x/dxgi/src/dxgi_native.cpp @@ -754,6 +754,7 @@ struct dxgi_blitter memset(&rs_state, 0, sizeof(rs_state)); rs_state.cull_face = PIPE_FACE_NONE; rs_state.gl_rasterization_rules = 1; + rs_state.depth_clip = 1; rs_state.flatshade = 1; rasterizer = pipe->create_rasterizer_state(pipe, &rs_state); diff --git a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_context.h b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_context.h index a64e8d195a9..da3cc237c7b 100644 --- a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_context.h +++ b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_context.h @@ -75,7 +75,6 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl<threadsafe> float blend_color[4]; unsigned sample_mask; unsigned stencil_ref; - bool depth_clamp; void* default_input_layout; void* default_rasterizer; @@ -169,7 +168,6 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl<threadsafe> memset(blend_color, 0, sizeof(blend_color)); sample_mask = ~0; stencil_ref = 0; - depth_clamp = 0; // derived state primitive_mode = 0; @@ -194,6 +192,7 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl<threadsafe> rasterizerd.flatshade_first = 1; rasterizerd.line_width = 1.0f; rasterizerd.point_size = 1.0f; + rasterizerd.depth_clip = TRUE; default_rasterizer = pipe->create_rasterizer_state(pipe, &rasterizerd); struct pipe_depth_stencil_alpha_state depth_stencild; @@ -938,14 +937,6 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl<threadsafe> } #endif - void set_clip() - { - pipe_clip_state clip; - clip.nr = 0; - clip.depth_clamp = depth_clamp; - pipe->set_clip_state(pipe, &clip); - } - virtual void STDMETHODCALLTYPE RSSetState( ID3D11RasterizerState *new_rasterizer_state) { @@ -954,12 +945,6 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl<threadsafe> { rasterizer_state = new_rasterizer_state; pipe->bind_rasterizer_state(pipe, new_rasterizer_state ? ((GalliumD3D11RasterizerState*)new_rasterizer_state)->object : default_rasterizer); - bool new_depth_clamp = new_rasterizer_state ? ((GalliumD3D11RasterizerState*)new_rasterizer_state)->depth_clamp : false; - if(depth_clamp != new_depth_clamp) - { - depth_clamp = new_depth_clamp; - set_clip(); - } } } @@ -1688,7 +1673,6 @@ struct GalliumD3D10Device : public GalliumD3D10ScreenImpl<threadsafe> pipe->set_stream_output_targets(pipe, num_so_targets, so_targets, ~0); set_framebuffer(); set_viewport(); - set_clip(); set_render_condition(); update_flags |= UPDATE_VERTEX_BUFFERS | (1 << (UPDATE_SAMPLERS_SHIFT + D3D11_STAGE_PS)) | (1 << (UPDATE_VIEWS_SHIFT + D3D11_STAGE_PS)); diff --git a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_objects.h b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_objects.h index e1ef7b807be..faeb30617b9 100644 --- a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_objects.h +++ b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_objects.h @@ -210,10 +210,8 @@ struct GalliumD3D10BlendState : public GalliumD3D10BlendStateBase struct GalliumD3D11RasterizerState : public GalliumD3D11RasterizerStateBase { - bool depth_clamp; - - GalliumD3D11RasterizerState(GalliumD3D11Screen* device, void* object, const D3D11_RASTERIZER_DESC& desc, bool depth_clamp) - : GalliumD3D11RasterizerStateBase(device, object, desc), depth_clamp(depth_clamp) + GalliumD3D11RasterizerState(GalliumD3D11Screen* device, void* object, const D3D11_RASTERIZER_DESC& desc) + : GalliumD3D11RasterizerStateBase(device, object, desc) {} }; diff --git a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h index e64e1f6b3fc..31e59bf38b1 100644 --- a/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h +++ b/src/gallium/state_trackers/d3d1x/gd3d11/d3d11_screen.h @@ -578,6 +578,7 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen state.offset_scale = rasterizer_desc->SlopeScaledDepthBias; state.offset_units = rasterizer_desc->DepthBias; state.offset_clamp = rasterizer_desc->DepthBiasClamp; + state.depth_clip = rasterizer_desc->DepthClipEnable; state.scissor = !!rasterizer_desc->ScissorEnable; state.multisample = !!rasterizer_desc->MultisampleEnable; state.line_smooth = !!rasterizer_desc->AntialiasedLineEnable; @@ -595,7 +596,7 @@ struct GalliumD3D11ScreenImpl : public GalliumD3D11Screen if(!object) return E_FAIL; - *out_rasterizer_state = new GalliumD3D11RasterizerState(this, object, *rasterizer_desc, !rasterizer_desc->DepthClipEnable); + *out_rasterizer_state = new GalliumD3D11RasterizerState(this, object, *rasterizer_desc); return S_OK; } diff --git a/src/gallium/state_trackers/vega/renderer.c b/src/gallium/state_trackers/vega/renderer.c index e4c1fd5e3a3..add1eec0038 100644 --- a/src/gallium/state_trackers/vega/renderer.c +++ b/src/gallium/state_trackers/vega/renderer.c @@ -1187,6 +1187,7 @@ struct renderer * renderer_create(struct vg_context *owner) raster = &renderer->g3d.rasterizer; memset(raster, 0, sizeof(*raster)); raster->gl_rasterization_rules = 1; + raster->depth_clip = 1; cso_set_rasterizer(renderer->cso, raster); /* fixed at 0 */ diff --git a/src/gallium/state_trackers/xa/xa_renderer.c b/src/gallium/state_trackers/xa/xa_renderer.c index 5496fc04bfe..7052f396c3a 100644 --- a/src/gallium/state_trackers/xa/xa_renderer.c +++ b/src/gallium/state_trackers/xa/xa_renderer.c @@ -130,6 +130,7 @@ renderer_init_state(struct xa_context *r) /* XXX: move to renderer_init_state? */ memset(&raster, 0, sizeof(struct pipe_rasterizer_state)); raster.gl_rasterization_rules = 1; + raster.depth_clip = 1; cso_set_rasterizer(r->cso, &raster); /* vertex elements state */ diff --git a/src/gallium/state_trackers/xorg/xorg_renderer.c b/src/gallium/state_trackers/xorg/xorg_renderer.c index 6b799af90c8..eba72d81908 100644 --- a/src/gallium/state_trackers/xorg/xorg_renderer.c +++ b/src/gallium/state_trackers/xorg/xorg_renderer.c @@ -107,6 +107,7 @@ renderer_init_state(struct xorg_renderer *r) /* XXX: move to renderer_init_state? */ memset(&raster, 0, sizeof(struct pipe_rasterizer_state)); raster.gl_rasterization_rules = 1; + raster.depth_clip = 1; cso_set_rasterizer(r->cso, &raster); /* vertex elements state */ |