-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from kusma/emit-render-targets
render targets + more
- Loading branch information
Showing
12 changed files
with
234 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
#include <stdio.h> | ||
|
||
#include "util/u_memory.h" | ||
|
||
#include "tgsi/tgsi_dump.h" | ||
|
||
#include "tegra_context.h" | ||
#include "tegra_screen.h" | ||
#include "tegra_program.h" | ||
|
||
#define unimplemented() printf("TODO: %s()\n", __func__) | ||
|
||
|
||
static void * | ||
tegra_create_vs_state(struct pipe_context *pcontext, | ||
const struct pipe_shader_state *template) | ||
{ | ||
struct tegra_vs_state *so = CALLOC_STRUCT(tegra_vs_state); | ||
if (!so) | ||
return NULL; | ||
|
||
so->base = *template; | ||
|
||
if (tegra_debug & TEGRA_DEBUG_TGSI) { | ||
fprintf(stderr, "DEBUG: TGSI:\n"); | ||
tgsi_dump(template->tokens, 0); | ||
fprintf(stderr, "\n"); | ||
} | ||
|
||
return so; | ||
} | ||
|
||
static void tegra_bind_vs_state(struct pipe_context *pcontext, void *so) | ||
{ | ||
unimplemented(); | ||
} | ||
|
||
static void tegra_delete_vs_state(struct pipe_context *pcontext, void *so) | ||
{ | ||
FREE(so); | ||
} | ||
|
||
static void * | ||
tegra_create_fs_state(struct pipe_context *pcontext, | ||
const struct pipe_shader_state *template) | ||
{ | ||
struct tegra_fs_state *so = CALLOC_STRUCT(tegra_fs_state); | ||
if (!so) | ||
return NULL; | ||
|
||
so->base = *template; | ||
|
||
return so; | ||
} | ||
|
||
static void tegra_bind_fs_state(struct pipe_context *pcontext, void *so) | ||
{ | ||
unimplemented(); | ||
} | ||
|
||
static void tegra_delete_fs_state(struct pipe_context *pcontext, void *so) | ||
{ | ||
FREE(so); | ||
} | ||
|
||
void tegra_context_program_init(struct pipe_context *pcontext) | ||
{ | ||
pcontext->create_vs_state = tegra_create_vs_state; | ||
pcontext->bind_vs_state = tegra_bind_vs_state; | ||
pcontext->delete_vs_state = tegra_delete_vs_state; | ||
|
||
pcontext->create_fs_state = tegra_create_fs_state; | ||
pcontext->bind_fs_state = tegra_bind_fs_state; | ||
pcontext->delete_fs_state = tegra_delete_fs_state; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#ifndef TEGRA_PROGRAM_H | ||
#define TEGRA_PROGRAM_H | ||
|
||
#include "pipe/p_context.h" | ||
#include "pipe/p_state.h" | ||
|
||
struct tegra_vs_state { | ||
struct pipe_shader_state base; | ||
}; | ||
|
||
struct tegra_fs_state { | ||
struct pipe_shader_state base; | ||
}; | ||
|
||
void tegra_context_program_init(struct pipe_context *pcontext); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.