Commit 0c3ea157 authored by Jesse Natalie's avatar Jesse Natalie Committed by Erik Faye-Lund
Browse files

nir: Add 'SAMPLER_' prefix to enums

parent 8e717c31
...@@ -302,11 +302,11 @@ static const char * ...@@ -302,11 +302,11 @@ static const char *
get_constant_sampler_addressing_mode(enum cl_sampler_addressing_mode mode) get_constant_sampler_addressing_mode(enum cl_sampler_addressing_mode mode)
{ {
switch (mode) { switch (mode) {
case ADDRESSING_MODE_NONE: return "none"; case SAMPLER_ADDRESSING_MODE_NONE: return "none";
case ADDRESSING_MODE_CLAMP_TO_EDGE: return "clamp_to_edge"; case SAMPLER_ADDRESSING_MODE_CLAMP_TO_EDGE: return "clamp_to_edge";
case ADDRESSING_MODE_CLAMP: return "clamp"; case SAMPLER_ADDRESSING_MODE_CLAMP: return "clamp";
case ADDRESSING_MODE_REPEAT: return "repeat"; case SAMPLER_ADDRESSING_MODE_REPEAT: return "repeat";
case ADDRESSING_MODE_REPEAT_MIRRORED: return "repeat_mirrored"; case SAMPLER_ADDRESSING_MODE_REPEAT_MIRRORED: return "repeat_mirrored";
default: unreachable("Invalid addressing mode"); default: unreachable("Invalid addressing mode");
} }
} }
...@@ -315,8 +315,8 @@ static const char * ...@@ -315,8 +315,8 @@ static const char *
get_constant_sampler_filter_mode(enum cl_sampler_filter_mode mode) get_constant_sampler_filter_mode(enum cl_sampler_filter_mode mode)
{ {
switch (mode) { switch (mode) {
case FILTER_MODE_NEAREST: return "nearest"; case SAMPLER_FILTER_MODE_NEAREST: return "nearest";
case FILTER_MODE_LINEAR: return "linear"; case SAMPLER_FILTER_MODE_LINEAR: return "linear";
default: unreachable("Invalid filter mode"); default: unreachable("Invalid filter mode");
} }
} }
......
...@@ -901,16 +901,16 @@ enum float_controls ...@@ -901,16 +901,16 @@ enum float_controls
* These values match the meanings described in the SPIR-V spec. * These values match the meanings described in the SPIR-V spec.
*/ */
enum cl_sampler_addressing_mode { enum cl_sampler_addressing_mode {
ADDRESSING_MODE_NONE = 0, SAMPLER_ADDRESSING_MODE_NONE = 0,
ADDRESSING_MODE_CLAMP_TO_EDGE = 1, SAMPLER_ADDRESSING_MODE_CLAMP_TO_EDGE = 1,
ADDRESSING_MODE_CLAMP = 2, SAMPLER_ADDRESSING_MODE_CLAMP = 2,
ADDRESSING_MODE_REPEAT = 3, SAMPLER_ADDRESSING_MODE_REPEAT = 3,
ADDRESSING_MODE_REPEAT_MIRRORED = 4, SAMPLER_ADDRESSING_MODE_REPEAT_MIRRORED = 4,
}; };
enum cl_sampler_filter_mode { enum cl_sampler_filter_mode {
FILTER_MODE_NEAREST = 0, SAMPLER_FILTER_MODE_NEAREST = 0,
FILTER_MODE_LINEAR = 1, SAMPLER_FILTER_MODE_LINEAR = 1,
}; };
#ifdef __cplusplus #ifdef __cplusplus
......
...@@ -1033,13 +1033,13 @@ wrap_from_cl_addressing(unsigned addressing_mode) ...@@ -1033,13 +1033,13 @@ wrap_from_cl_addressing(unsigned addressing_mode)
switch (addressing_mode) switch (addressing_mode)
{ {
default: default:
case ADDRESSING_MODE_NONE: case SAMPLER_ADDRESSING_MODE_NONE:
case ADDRESSING_MODE_CLAMP: case SAMPLER_ADDRESSING_MODE_CLAMP:
// Since OpenCL's only border color is 0's and D3D specs out-of-bounds loads to return 0, don't apply any wrap mode // Since OpenCL's only border color is 0's and D3D specs out-of-bounds loads to return 0, don't apply any wrap mode
return (enum pipe_tex_wrap)-1; return (enum pipe_tex_wrap)-1;
case ADDRESSING_MODE_CLAMP_TO_EDGE: return PIPE_TEX_WRAP_CLAMP_TO_EDGE; case SAMPLER_ADDRESSING_MODE_CLAMP_TO_EDGE: return PIPE_TEX_WRAP_CLAMP_TO_EDGE;
case ADDRESSING_MODE_REPEAT: return PIPE_TEX_WRAP_REPEAT; case SAMPLER_ADDRESSING_MODE_REPEAT: return PIPE_TEX_WRAP_REPEAT;
case ADDRESSING_MODE_REPEAT_MIRRORED: return PIPE_TEX_WRAP_MIRROR_REPEAT; case SAMPLER_ADDRESSING_MODE_REPEAT_MIRRORED: return PIPE_TEX_WRAP_MIRROR_REPEAT;
} }
} }
...@@ -1397,7 +1397,7 @@ clc_to_dxil(struct clc_context *ctx, ...@@ -1397,7 +1397,7 @@ clc_to_dxil(struct clc_context *ctx,
int_sampler_states[sampler_id].is_nonnormalized_coords = int_sampler_states[sampler_id].is_nonnormalized_coords =
!var->constant_initializer->values[1].u32; !var->constant_initializer->values[1].u32;
int_sampler_states[sampler_id].is_linear_filtering = int_sampler_states[sampler_id].is_linear_filtering =
var->constant_initializer->values[2].u32 == FILTER_MODE_LINEAR; var->constant_initializer->values[2].u32 == SAMPLER_FILTER_MODE_LINEAR;
var->data.binding = sampler_id++; var->data.binding = sampler_id++;
} }
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment