projects
/
mesa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r600g: re-enable single-sample fast clear
[mesa.git]
/
src
/
gallium
/
drivers
/
svga
/
svga_pipe_sampler.c
diff --git
a/src/gallium/drivers/svga/svga_pipe_sampler.c
b/src/gallium/drivers/svga/svga_pipe_sampler.c
index 0d2745e25eff9ed3e649699bec0e912bb2464c0c..effd490dd22d2c09ce46cac8d6353a3f9b474799 100644
(file)
--- a/
src/gallium/drivers/svga/svga_pipe_sampler.c
+++ b/
src/gallium/drivers/svga/svga_pipe_sampler.c
@@
-35,7
+35,7
@@
#include "svga_debug.h"
#include "svga_debug.h"
-static
INLINE
unsigned
+static
inline
unsigned
translate_wrap_mode(unsigned wrap)
{
switch (wrap) {
translate_wrap_mode(unsigned wrap)
{
switch (wrap) {
@@
-68,7
+68,7
@@
translate_wrap_mode(unsigned wrap)
}
}
}
}
-static
INLINE
unsigned translate_img_filter( unsigned filter )
+static
inline
unsigned translate_img_filter( unsigned filter )
{
switch (filter) {
case PIPE_TEX_FILTER_NEAREST: return SVGA3D_TEX_FILTER_NEAREST;
{
switch (filter) {
case PIPE_TEX_FILTER_NEAREST: return SVGA3D_TEX_FILTER_NEAREST;
@@
-79,7
+79,7
@@
static INLINE unsigned translate_img_filter( unsigned filter )
}
}
}
}
-static
INLINE
unsigned translate_mip_filter( unsigned filter )
+static
inline
unsigned translate_mip_filter( unsigned filter )
{
switch (filter) {
case PIPE_TEX_MIPFILTER_NONE: return SVGA3D_TEX_FILTER_NONE;
{
switch (filter) {
case PIPE_TEX_MIPFILTER_NONE: return SVGA3D_TEX_FILTER_NONE;
@@
-98,6
+98,9
@@
svga_create_sampler_state(struct pipe_context *pipe,
struct svga_context *svga = svga_context(pipe);
struct svga_sampler_state *cso = CALLOC_STRUCT( svga_sampler_state );
struct svga_context *svga = svga_context(pipe);
struct svga_sampler_state *cso = CALLOC_STRUCT( svga_sampler_state );
+ if (!cso)
+ return NULL;
+
cso->mipfilter = translate_mip_filter(sampler->min_mip_filter);
cso->magfilter = translate_img_filter( sampler->mag_img_filter );
cso->minfilter = translate_img_filter( sampler->min_img_filter );
cso->mipfilter = translate_mip_filter(sampler->min_mip_filter);
cso->magfilter = translate_img_filter( sampler->mag_img_filter );
cso->minfilter = translate_img_filter( sampler->min_img_filter );
@@
-162,17
+165,10
@@
svga_bind_sampler_states(struct pipe_context *pipe,
if (shader != PIPE_SHADER_FRAGMENT)
return;
if (shader != PIPE_SHADER_FRAGMENT)
return;
- /* Check for no-op */
- if (start + num <= svga->curr.num_samplers &&
- !memcmp(svga->curr.sampler + start, samplers, num * sizeof(void *))) {
- if (0) debug_printf("sampler noop\n");
- return;
- }
-
for (i = 0; i < num; i++)
svga->curr.sampler[start + i] = samplers[i];
for (i = 0; i < num; i++)
svga->curr.sampler[start + i] = samplers[i];
- /* find highest non-null sampler
_views
[] entry */
+ /* find highest non-null sampler[] entry */
{
unsigned j = MAX2(svga->curr.num_samplers, start + num);
while (j > 0 && svga->curr.sampler[j - 1] == NULL)
{
unsigned j = MAX2(svga->curr.num_samplers, start + num);
while (j > 0 && svga->curr.sampler[j - 1] == NULL)
@@
-184,14
+180,6
@@
svga_bind_sampler_states(struct pipe_context *pipe,
}
}
-static void
-svga_bind_fragment_sampler_states(struct pipe_context *pipe,
- unsigned num, void **sampler)
-{
- svga_bind_sampler_states(pipe, PIPE_SHADER_FRAGMENT, 0, num, sampler);
-}
-
-
static void svga_delete_sampler_state(struct pipe_context *pipe,
void *sampler)
{
static void svga_delete_sampler_state(struct pipe_context *pipe,
void *sampler)
{
@@
-245,14
+233,6
@@
svga_set_sampler_views(struct pipe_context *pipe,
if (shader != PIPE_SHADER_FRAGMENT)
return;
if (shader != PIPE_SHADER_FRAGMENT)
return;
- /* Check for no-op */
- if (start + num <= svga->curr.num_sampler_views &&
- !memcmp(svga->curr.sampler_views + start, views,
- num * sizeof(struct pipe_sampler_view *))) {
- if (0) debug_printf("texture noop\n");
- return;
- }
-
for (i = 0; i < num; i++) {
if (svga->curr.sampler_views[start + i] != views[i]) {
/* Note: we're using pipe_sampler_view_release() here to work around
for (i = 0; i < num; i++) {
if (svga->curr.sampler_views[start + i] != views[i]) {
/* Note: we're using pipe_sampler_view_release() here to work around
@@
-294,21
+274,12
@@
svga_set_sampler_views(struct pipe_context *pipe,
}
}
-static void
-svga_set_fragment_sampler_views(struct pipe_context *pipe,
- unsigned num,
- struct pipe_sampler_view **views)
-{
- svga_set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, num, views);
-}
-
-
void svga_init_sampler_functions( struct svga_context *svga )
{
svga->pipe.create_sampler_state = svga_create_sampler_state;
void svga_init_sampler_functions( struct svga_context *svga )
{
svga->pipe.create_sampler_state = svga_create_sampler_state;
- svga->pipe.bind_
fragment_sampler_states = svga_bind_fragment
_sampler_states;
+ svga->pipe.bind_
sampler_states = svga_bind
_sampler_states;
svga->pipe.delete_sampler_state = svga_delete_sampler_state;
svga->pipe.delete_sampler_state = svga_delete_sampler_state;
- svga->pipe.set_
fragment_sampler_views = svga_set_fragmen
t_sampler_views;
+ svga->pipe.set_
sampler_views = svga_se
t_sampler_views;
svga->pipe.create_sampler_view = svga_create_sampler_view;
svga->pipe.sampler_view_destroy = svga_sampler_view_destroy;
}
svga->pipe.create_sampler_view = svga_create_sampler_view;
svga->pipe.sampler_view_destroy = svga_sampler_view_destroy;
}