mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-24 08:10:22 +01:00
mesa/st: move st strings handling into mesa
Reviewed-by: Emma Anholt <emma@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14257>
This commit is contained in:
parent
8956b7f38f
commit
d4af7d2519
4 changed files with 14 additions and 108 deletions
|
|
@ -34,10 +34,11 @@
|
|||
#include "macros.h"
|
||||
#include "version.h"
|
||||
#include "spirv_extensions.h"
|
||||
|
||||
#include "state_tracker/st_cb_strings.h"
|
||||
#include "api_exec_decl.h"
|
||||
|
||||
#include "pipe/p_context.h"
|
||||
#include "pipe/p_screen.h"
|
||||
|
||||
/**
|
||||
* Return the string for a glGetString(GL_SHADING_LANGUAGE_VERSION) query.
|
||||
*/
|
||||
|
|
@ -135,19 +136,21 @@ _mesa_GetString( GLenum name )
|
|||
return (const GLubyte *) ctx->Const.RendererOverride;
|
||||
}
|
||||
|
||||
/* this is a required driver function */
|
||||
{
|
||||
/* Give the driver the chance to handle this query */
|
||||
const GLubyte *str = st_get_string(ctx, name);
|
||||
if (str)
|
||||
return str;
|
||||
}
|
||||
struct pipe_screen *screen = ctx->pipe->screen;
|
||||
|
||||
switch (name) {
|
||||
case GL_VENDOR:
|
||||
case GL_VENDOR: {
|
||||
const GLubyte *str = (const GLubyte *)screen->get_vendor(screen);
|
||||
if (str)
|
||||
return str;
|
||||
return (const GLubyte *) vendor;
|
||||
case GL_RENDERER:
|
||||
}
|
||||
case GL_RENDERER: {
|
||||
const GLubyte *str = (const GLubyte *)screen->get_name(screen);
|
||||
if (str)
|
||||
return str;
|
||||
return (const GLubyte *) renderer;
|
||||
}
|
||||
case GL_VERSION:
|
||||
return (const GLubyte *) ctx->VersionString;
|
||||
case GL_EXTENSIONS:
|
||||
|
|
|
|||
|
|
@ -365,8 +365,6 @@ files_libmesa = files(
|
|||
'state_tracker/st_cb_readpixels.h',
|
||||
'state_tracker/st_cb_semaphoreobjects.c',
|
||||
'state_tracker/st_cb_semaphoreobjects.h',
|
||||
'state_tracker/st_cb_strings.c',
|
||||
'state_tracker/st_cb_strings.h',
|
||||
'state_tracker/st_cb_syncobj.c',
|
||||
'state_tracker/st_cb_syncobj.h',
|
||||
'state_tracker/st_cb_texture.c',
|
||||
|
|
|
|||
|
|
@ -1,60 +0,0 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2007 VMware, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
||||
* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
|
||||
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* Keith Whitwell <keithw@vmware.com>
|
||||
* Brian Paul
|
||||
*/
|
||||
|
||||
#include "main/glheader.h"
|
||||
#include "main/macros.h"
|
||||
#include "pipe/p_context.h"
|
||||
#include "pipe/p_screen.h"
|
||||
#include "util/u_string.h"
|
||||
#include "st_context.h"
|
||||
#include "st_cb_strings.h"
|
||||
|
||||
const GLubyte *
|
||||
st_get_string(struct gl_context * ctx, GLenum name)
|
||||
{
|
||||
struct st_context *st = st_context(ctx);
|
||||
struct pipe_screen *screen = st->screen;
|
||||
|
||||
switch (name) {
|
||||
case GL_VENDOR: {
|
||||
return (GLubyte *) screen->get_vendor(screen);
|
||||
}
|
||||
|
||||
case GL_RENDERER:
|
||||
return (GLubyte *) screen->get_name(screen);
|
||||
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2007 VMware, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
||||
* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
|
||||
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef ST_CB_STRINGS_H
|
||||
#define ST_CB_STRINGS_H
|
||||
|
||||
const GLubyte *st_get_string(struct gl_context * ctx, GLenum name);
|
||||
|
||||
#endif /* ST_CB_STRINGS_H */
|
||||
|
||||
Loading…
Add table
Reference in a new issue