mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 17:58:26 +02:00
nouveau: more adaption..
This commit is contained in:
parent
f1c5415675
commit
72d47f1949
3 changed files with 23 additions and 4 deletions
|
|
@ -76,6 +76,7 @@ nouveau_create_buffer(__DRIscreenPrivate * driScrnPriv,
|
|||
const __GLcontextModes *glVis, GLboolean pixmapBuffer)
|
||||
{
|
||||
struct nouveau_framebuffer *nvfb;
|
||||
enum pipe_format colour, depth, stencil;
|
||||
|
||||
if (pixmapBuffer)
|
||||
return GL_FALSE;
|
||||
|
|
@ -84,7 +85,25 @@ nouveau_create_buffer(__DRIscreenPrivate * driScrnPriv,
|
|||
if (!nvfb)
|
||||
return GL_FALSE;
|
||||
|
||||
nvfb->stfb = st_create_framebuffer(glVis, GL_TRUE, (void*)nvfb);
|
||||
if (glVis->redBits == 5)
|
||||
colour = PIPE_FORMAT_R5G6B5_UNORM;
|
||||
else
|
||||
colour = PIPE_FORMAT_A8R8G8B8_UNORM;
|
||||
|
||||
if (glVis->depthBits == 16)
|
||||
depth = PIPE_FORMAT_Z16_UNORM;
|
||||
else if (glVis->depthBits == 24)
|
||||
depth = PIPE_FORMAT_Z24S8_UNORM;
|
||||
else
|
||||
depth = PIPE_FORMAT_NONE;
|
||||
|
||||
if (glVis->stencilBits == 8)
|
||||
stencil = PIPE_FORMAT_Z24S8_UNORM;
|
||||
else
|
||||
stencil = PIPE_FORMAT_NONE;
|
||||
|
||||
nvfb->stfb = st_create_framebuffer(glVis, GL_TRUE, colour, depth,
|
||||
stencil, (void*)nvfb);
|
||||
if (!nvfb->stfb) {
|
||||
free(nvfb);
|
||||
return GL_FALSE;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ nv40_is_format_supported(struct pipe_context *pipe, enum pipe_format format,
|
|||
{
|
||||
switch (type) {
|
||||
case PIPE_SURFACE:
|
||||
case PIPE_SCREEN_SURFACE:
|
||||
switch (format) {
|
||||
case PIPE_FORMAT_A8R8G8B8_UNORM:
|
||||
case PIPE_FORMAT_R5G6B5_UNORM:
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
#include "pipe/p_util.h"
|
||||
#include "pipe/p_winsys.h"
|
||||
#include "pipe/p_inlines.h"
|
||||
#include "pipe/softpipe/sp_rgba_tile.h"
|
||||
|
||||
|
||||
#define CLIP_TILE \
|
||||
|
|
@ -254,8 +255,8 @@ nv40_init_surface_functions(struct nv40_context *nv40)
|
|||
nv40->pipe.get_tex_surface = nv40_get_tex_surface;
|
||||
nv40->pipe.get_tile = nv40_get_tile;
|
||||
nv40->pipe.put_tile = nv40_put_tile;
|
||||
nv40->pipe.get_tile_rgba = nv40_get_tile_rgba;
|
||||
nv40->pipe.put_tile_rgba = nv40_put_tile_rgba;
|
||||
nv40->pipe.get_tile_rgba = softpipe_get_tile_rgba;
|
||||
nv40->pipe.put_tile_rgba = softpipe_put_tile_rgba;
|
||||
nv40->pipe.surface_data = nv40_surface_data;
|
||||
nv40->pipe.surface_copy = nv40_surface_copy;
|
||||
nv40->pipe.surface_fill = nv40_surface_fill;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue