summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorKeith Whitwell <keithw@vmware.com>2009-02-10 19:22:57 +0000
committerKeith Whitwell <keithw@vmware.com>2009-02-10 19:22:57 +0000
commit9c9ba66fbae8089e9423f6b09ad1091cccf9b006 (patch)
tree81ecce3d6b19e5b77fcf31e5f081e1c546f398b9 /src/gallium/state_trackers
parentebb864da9e98003be9ea388013ae4385d341e46f (diff)
parent1e8177ee178b131afa86d874b062a8ae3fae0cca (diff)
Merge commit 'origin/gallium-0.2' into gallium-0.2
Conflicts: src/gallium/state_trackers/wgl/icd/stw_icd.c
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/g3dvl/vl_basic_csc.c10
-rw-r--r--src/gallium/state_trackers/g3dvl/vl_context.c2
-rw-r--r--src/gallium/state_trackers/g3dvl/vl_r16snorm_mc_buf.c10
-rw-r--r--src/gallium/state_trackers/g3dvl/vl_surface.c10
-rw-r--r--src/gallium/state_trackers/wgl/icd/stw_icd.c15
-rw-r--r--src/gallium/state_trackers/wgl/shared/stw_pixelformat.c8
6 files changed, 32 insertions, 23 deletions
diff --git a/src/gallium/state_trackers/g3dvl/vl_basic_csc.c b/src/gallium/state_trackers/g3dvl/vl_basic_csc.c
index 122c42ed0e..187a13a560 100644
--- a/src/gallium/state_trackers/g3dvl/vl_basic_csc.c
+++ b/src/gallium/state_trackers/g3dvl/vl_basic_csc.c
@@ -544,7 +544,7 @@ static int vlCreateDataBufs
* to display a rendered surface
* Quad is rendered as a tri strip
*/
- csc->vertex_bufs[0].pitch = sizeof(struct vlVertex2f);
+ csc->vertex_bufs[0].stride = sizeof(struct vlVertex2f);
csc->vertex_bufs[0].max_index = 3;
csc->vertex_bufs[0].buffer_offset = 0;
csc->vertex_bufs[0].buffer = pipe_buffer_create
@@ -573,7 +573,7 @@ static int vlCreateDataBufs
* Create our texcoord buffer and texcoord buffer element
* Texcoord buffer contains the TCs for mapping the rendered surface to the 4 vertices
*/
- csc->vertex_bufs[1].pitch = sizeof(struct vlVertex2f);
+ csc->vertex_bufs[1].stride = sizeof(struct vlVertex2f);
csc->vertex_bufs[1].max_index = 3;
csc->vertex_bufs[1].buffer_offset = 0;
csc->vertex_bufs[1].buffer = pipe_buffer_create
@@ -602,26 +602,24 @@ static int vlCreateDataBufs
* Create our vertex shader's constant buffer
* Const buffer contains scaling and translation vectors
*/
- csc->vs_const_buf.size = sizeof(struct vlVertexShaderConsts);
csc->vs_const_buf.buffer = pipe_buffer_create
(
pipe->screen,
1,
PIPE_BUFFER_USAGE_CONSTANT | PIPE_BUFFER_USAGE_DISCARD,
- csc->vs_const_buf.size
+ sizeof(struct vlVertexShaderConsts)
);
/*
* Create our fragment shader's constant buffer
* Const buffer contains the color conversion matrix and bias vectors
*/
- csc->fs_const_buf.size = sizeof(struct vlFragmentShaderConsts);
csc->fs_const_buf.buffer = pipe_buffer_create
(
pipe->screen,
1,
PIPE_BUFFER_USAGE_CONSTANT,
- csc->fs_const_buf.size
+ sizeof(struct vlFragmentShaderConsts)
);
/*
diff --git a/src/gallium/state_trackers/g3dvl/vl_context.c b/src/gallium/state_trackers/g3dvl/vl_context.c
index c4c4e23c15..65ddb9f01e 100644
--- a/src/gallium/state_trackers/g3dvl/vl_context.c
+++ b/src/gallium/state_trackers/g3dvl/vl_context.c
@@ -86,7 +86,7 @@ static int vlInitCommon(struct vlContext *context)
}
dsa.alpha.enabled = 0;
dsa.alpha.func = PIPE_FUNC_ALWAYS;
- dsa.alpha.ref = 0;
+ dsa.alpha.ref_value = 0;
context->dsa = pipe->create_depth_stencil_alpha_state(pipe, &dsa);
pipe->bind_depth_stencil_alpha_state(pipe, context->dsa);
diff --git a/src/gallium/state_trackers/g3dvl/vl_r16snorm_mc_buf.c b/src/gallium/state_trackers/g3dvl/vl_r16snorm_mc_buf.c
index d53482f579..2176bb86d8 100644
--- a/src/gallium/state_trackers/g3dvl/vl_r16snorm_mc_buf.c
+++ b/src/gallium/state_trackers/g3dvl/vl_r16snorm_mc_buf.c
@@ -911,7 +911,7 @@ static int vlCreateDataBufs
mc->macroblocks_per_picture = mbw * mbh;
/* Create our vertex buffers */
- mc->vertex_bufs.ycbcr.pitch = sizeof(struct vlVertex2f) * 4;
+ mc->vertex_bufs.ycbcr.stride = sizeof(struct vlVertex2f) * 4;
mc->vertex_bufs.ycbcr.max_index = 24 * mc->macroblocks_per_picture - 1;
mc->vertex_bufs.ycbcr.buffer_offset = 0;
mc->vertex_bufs.ycbcr.buffer = pipe_buffer_create
@@ -924,7 +924,7 @@ static int vlCreateDataBufs
for (i = 1; i < 3; ++i)
{
- mc->vertex_bufs.all[i].pitch = sizeof(struct vlVertex2f) * 2;
+ mc->vertex_bufs.all[i].stride = sizeof(struct vlVertex2f) * 2;
mc->vertex_bufs.all[i].max_index = 24 * mc->macroblocks_per_picture - 1;
mc->vertex_bufs.all[i].buffer_offset = 0;
mc->vertex_bufs.all[i].buffer = pipe_buffer_create
@@ -985,22 +985,20 @@ static int vlCreateDataBufs
mc->vertex_elems[7].src_format = PIPE_FORMAT_R32G32_FLOAT;
/* Create our constant buffer */
- mc->vs_const_buf.size = sizeof(struct vlVertexShaderConsts);
mc->vs_const_buf.buffer = pipe_buffer_create
(
pipe->screen,
DEFAULT_BUF_ALIGNMENT,
PIPE_BUFFER_USAGE_CONSTANT | PIPE_BUFFER_USAGE_DISCARD,
- mc->vs_const_buf.size
+ sizeof(struct vlVertexShaderConsts)
);
- mc->fs_const_buf.size = sizeof(struct vlFragmentShaderConsts);
mc->fs_const_buf.buffer = pipe_buffer_create
(
pipe->screen,
DEFAULT_BUF_ALIGNMENT,
PIPE_BUFFER_USAGE_CONSTANT,
- mc->fs_const_buf.size
+ sizeof(struct vlFragmentShaderConsts)
);
memcpy
diff --git a/src/gallium/state_trackers/g3dvl/vl_surface.c b/src/gallium/state_trackers/g3dvl/vl_surface.c
index 0fa7b25b92..92388f7978 100644
--- a/src/gallium/state_trackers/g3dvl/vl_surface.c
+++ b/src/gallium/state_trackers/g3dvl/vl_surface.c
@@ -152,9 +152,9 @@ int vlPutPicture
bind_pipe_drawable(pipe, drawable);
- pipe->winsys->flush_frontbuffer
+ pipe->screen->flush_frontbuffer
(
- pipe->winsys,
+ pipe->screen,
csc->vlGetFrameBuffer(csc),
pipe->priv
);
@@ -172,13 +172,13 @@ int vlSurfaceGetStatus
assert(surface->context);
assert(status);
- if (surface->render_fence && !surface->context->pipe->winsys->fence_signalled(surface->context->pipe->winsys, surface->render_fence, 0))
+ if (surface->render_fence && !surface->context->pipe->screen->fence_signalled(surface->context->pipe->screen, surface->render_fence, 0))
{
*status = vlResourceStatusRendering;
return 0;
}
- if (surface->disp_fence && !surface->context->pipe->winsys->fence_signalled(surface->context->pipe->winsys, surface->disp_fence, 0))
+ if (surface->disp_fence && !surface->context->pipe->screen->fence_signalled(surface->context->pipe->screen, surface->disp_fence, 0))
{
*status = vlResourceStatusDisplaying;
return 0;
@@ -211,7 +211,7 @@ int vlSurfaceSync
assert(surface->context);
assert(surface->render_fence);
- surface->context->pipe->winsys->fence_finish(surface->context->pipe->winsys, surface->render_fence, 0);
+ surface->context->pipe->screen->fence_finish(surface->context->pipe->screen, surface->render_fence, 0);
return 0;
}
diff --git a/src/gallium/state_trackers/wgl/icd/stw_icd.c b/src/gallium/state_trackers/wgl/icd/stw_icd.c
index 2cefc5c812..e4f3c669e2 100644
--- a/src/gallium/state_trackers/wgl/icd/stw_icd.c
+++ b/src/gallium/state_trackers/wgl/icd/stw_icd.c
@@ -101,6 +101,9 @@ lookup_context( struct stw_icd *icd,
dhglrc >= DRV_CONTEXT_MAX)
return NULL;
+ if (icd == NULL)
+ return NULL;
+
return icd->ctx_array[dhglrc - 1].ctx;
}
@@ -221,7 +224,7 @@ DrvDescribePixelFormat(
r = stw_pixelformat_describe( hdc, iPixelFormat, cjpfd, ppfd );
- debug_printf( "%s( 0x%p, %d, %u, 0x%p ) = %d\n",
+ debug_printf( "%s( %p, %d, %u, %p ) = %d\n",
__FUNCTION__, hdc, iPixelFormat, cjpfd, ppfd, r );
return r;
@@ -248,7 +251,7 @@ DrvGetProcAddress(
r = stw_get_proc_address( lpszProc );
- debug_printf( "%s( \", __FUNCTION__%s\" ) = 0x%p\n", lpszProc, r );
+ debug_printf( "%s( \", __FUNCTION__%s\" ) = %p\n", lpszProc, r );
return r;
}
@@ -298,7 +301,7 @@ DrvSetCallbackProcs(
INT nProcs,
PROC *pProcs )
{
- debug_printf( "%s( %d, 0x%p )\n", __FUNCTION__, nProcs, pProcs );
+ debug_printf( "%s( %d, %p )\n", __FUNCTION__, nProcs, pProcs );
return;
}
@@ -709,7 +712,7 @@ DrvSetPixelFormat(
r = stw_pixelformat_set( hdc, iPixelFormat );
- debug_printf( "%s( 0x%p, %d ) = %s\n", __FUNCTION__, hdc, iPixelFormat, r ? "TRUE" : "FALSE" );
+ debug_printf( "%s( %p, %d ) = %s\n", __FUNCTION__, hdc, iPixelFormat, r ? "TRUE" : "FALSE" );
return r;
}
@@ -728,7 +731,7 @@ BOOL APIENTRY
DrvSwapBuffers(
HDC hdc )
{
- debug_printf( "%s( 0x%p )\n", __FUNCTION__, hdc );
+ debug_printf( "%s( %p )\n", __FUNCTION__, hdc );
return stw_swap_buffers( hdc );
}
@@ -749,5 +752,7 @@ DrvValidateVersion(
{
debug_printf( "%s( %u )\n", __FUNCTION__, ulVersion );
+ /* TODO: get the expected version from the winsys */
+
return ulVersion == 1;
}
diff --git a/src/gallium/state_trackers/wgl/shared/stw_pixelformat.c b/src/gallium/state_trackers/wgl/shared/stw_pixelformat.c
index 12b5ac6d91..84b7b287b9 100644
--- a/src/gallium/state_trackers/wgl/shared/stw_pixelformat.c
+++ b/src/gallium/state_trackers/wgl/shared/stw_pixelformat.c
@@ -256,6 +256,14 @@ stw_pixelformat_set(
return FALSE;
currentpixelformat = iPixelFormat;
+
+ /* Some applications mistakenly use the undocumented wglSetPixelFormat
+ * function instead of SetPixelFormat, so we call SetPixelFormat here to
+ * avoid opengl32.dll's wglCreateContext to fail */
+ if (GetPixelFormat(hdc) == 0) {
+ SetPixelFormat(hdc, iPixelFormat, NULL);
+ }
+
return TRUE;
}