projects
/
mesa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
svga: update svga_winsys interface for GBS
[mesa.git]
/
src
/
gallium
/
drivers
/
svga
/
svga_pipe_fs.c
diff --git
a/src/gallium/drivers/svga/svga_pipe_fs.c
b/src/gallium/drivers/svga/svga_pipe_fs.c
index 32f07fb2616c744fc4e74b525c5c823ebd35effd..75299c50db714268ed2f06ae3b2cc02f75b8b307 100644
(file)
--- a/
src/gallium/drivers/svga/svga_pipe_fs.c
+++ b/
src/gallium/drivers/svga/svga_pipe_fs.c
@@
-23,31
+23,26
@@
*
**********************************************************/
*
**********************************************************/
-#include "
pipe/p
_inlines.h"
+#include "
util/u
_inlines.h"
#include "util/u_math.h"
#include "util/u_memory.h"
#include "util/u_bitmask.h"
#include "tgsi/tgsi_parse.h"
#include "util/u_math.h"
#include "util/u_memory.h"
#include "util/u_bitmask.h"
#include "tgsi/tgsi_parse.h"
-#include "
tgsi/tgsi_
text.h"
+#include "
draw/draw_con
text.h"
-#include "svga_screen.h"
#include "svga_context.h"
#include "svga_tgsi.h"
#include "svga_hw_reg.h"
#include "svga_cmd.h"
#include "svga_debug.h"
#include "svga_context.h"
#include "svga_tgsi.h"
#include "svga_hw_reg.h"
#include "svga_cmd.h"
#include "svga_debug.h"
+#include "svga_shader.h"
-/***********************************************************************
- * Fragment shaders
- */
-
static void *
svga_create_fs_state(struct pipe_context *pipe,
const struct pipe_shader_state *templ)
{
struct svga_context *svga = svga_context(pipe);
static void *
svga_create_fs_state(struct pipe_context *pipe,
const struct pipe_shader_state *templ)
{
struct svga_context *svga = svga_context(pipe);
- struct svga_screen *svgascreen = svga_screen(pipe->screen);
struct svga_fragment_shader *fs;
fs = CALLOC_STRUCT(svga_fragment_shader);
struct svga_fragment_shader *fs;
fs = CALLOC_STRUCT(svga_fragment_shader);
@@
-61,8
+56,13
@@
svga_create_fs_state(struct pipe_context *pipe,
tgsi_scan_shader(fs->base.tokens, &fs->base.info);
fs->base.id = svga->debug.shader_id++;
tgsi_scan_shader(fs->base.tokens, &fs->base.info);
fs->base.id = svga->debug.shader_id++;
- fs->base.use_sm30 = svgascreen->use_ps30;
-
+
+ fs->generic_inputs = svga_get_generic_inputs_mask(&fs->base.info);
+
+ svga_remap_generics(fs->generic_inputs, fs->generic_remap_table);
+
+ fs->draw_shader = draw_create_fragment_shader(svga->swtnl.draw, templ);
+
if (SVGA_DEBUG & DEBUG_TGSI || 0) {
debug_printf("%s id: %u, inputs: %u, outputs: %u\n",
__FUNCTION__, fs->base.id,
if (SVGA_DEBUG & DEBUG_TGSI || 0) {
debug_printf("%s id: %u, inputs: %u, outputs: %u\n",
__FUNCTION__, fs->base.id,
@@
-72,6
+72,7
@@
svga_create_fs_state(struct pipe_context *pipe,
return fs;
}
return fs;
}
+
static void
svga_bind_fs_state(struct pipe_context *pipe, void *shader)
{
static void
svga_bind_fs_state(struct pipe_context *pipe, void *shader)
{
@@
-82,39
+83,30
@@
svga_bind_fs_state(struct pipe_context *pipe, void *shader)
svga->dirty |= SVGA_NEW_FS;
}
svga->dirty |= SVGA_NEW_FS;
}
-static
-void svga_delete_fs_state(struct pipe_context *pipe, void *shader)
+
+static void
+svga_delete_fs_state(struct pipe_context *pipe, void *shader)
{
struct svga_context *svga = svga_context(pipe);
struct svga_fragment_shader *fs = (struct svga_fragment_shader *) shader;
{
struct svga_context *svga = svga_context(pipe);
struct svga_fragment_shader *fs = (struct svga_fragment_shader *) shader;
- struct svga_shader_
result *resul
t, *tmp;
+ struct svga_shader_
variant *varian
t, *tmp;
enum pipe_error ret;
enum pipe_error ret;
- svga_hwtnl_flush_retry(
svga
);
+ svga_hwtnl_flush_retry(
svga
);
- for (result = fs->base.results; result; result = tmp ) {
- tmp = result->next;
+ draw_delete_fragment_shader(svga->swtnl.draw, fs->draw_shader);
- ret = SVGA3D_DestroyShader(svga->swc,
- result->id,
- SVGA3D_SHADERTYPE_PS );
- if(ret != PIPE_OK) {
- svga_context_flush(svga, NULL);
- ret = SVGA3D_DestroyShader(svga->swc,
- result->id,
- SVGA3D_SHADERTYPE_PS );
- assert(ret == PIPE_OK);
- }
+ for (variant = fs->base.variants; variant; variant = tmp) {
+ tmp = variant->next;
- util_bitmask_clear( svga->fs_bm, result->id );
-
- svga_destroy_shader_result( result );
+ ret = svga_destroy_shader_variant(svga, SVGA3D_SHADERTYPE_PS, variant);
+ (void) ret; /* PIPE_ERROR_ not handled yet */
/*
/*
- * Remove stale references to this
result to ensure a new resul
t on the
+ * Remove stale references to this
variant to ensure a new varian
t on the
* same address will be detected as a change.
*/
* same address will be detected as a change.
*/
- if
(resul
t == svga->state.hw_draw.fs)
+ if
(varian
t == svga->state.hw_draw.fs)
svga->state.hw_draw.fs = NULL;
}
svga->state.hw_draw.fs = NULL;
}
@@
-123,10
+115,10
@@
void svga_delete_fs_state(struct pipe_context *pipe, void *shader)
}
}
-void svga_init_fs_functions( struct svga_context *svga )
+void
+svga_init_fs_functions(struct svga_context *svga)
{
svga->pipe.create_fs_state = svga_create_fs_state;
svga->pipe.bind_fs_state = svga_bind_fs_state;
svga->pipe.delete_fs_state = svga_delete_fs_state;
}
{
svga->pipe.create_fs_state = svga_create_fs_state;
svga->pipe.bind_fs_state = svga_bind_fs_state;
svga->pipe.delete_fs_state = svga_delete_fs_state;
}
-