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

nir: Add 'SAMPLER_' prefix to enums

parent 8e717c31
......@@ -302,11 +302,11 @@ static const char *
get_constant_sampler_addressing_mode(enum cl_sampler_addressing_mode mode)
{
switch (mode) {
case ADDRESSING_MODE_NONE: return "none";
case ADDRESSING_MODE_CLAMP_TO_EDGE: return "clamp_to_edge";
case ADDRESSING_MODE_CLAMP: return "clamp";
case ADDRESSING_MODE_REPEAT: return "repeat";
case ADDRESSING_MODE_REPEAT_MIRRORED: return "repeat_mirrored";
case SAMPLER_ADDRESSING_MODE_NONE: return "none";
case SAMPLER_ADDRESSING_MODE_CLAMP_TO_EDGE: return "clamp_to_edge";
case SAMPLER_ADDRESSING_MODE_CLAMP: return "clamp";
case SAMPLER_ADDRESSING_MODE_REPEAT: return "repeat";
case SAMPLER_ADDRESSING_MODE_REPEAT_MIRRORED: return "repeat_mirrored";
default: unreachable("Invalid addressing mode");
}
}
......@@ -315,8 +315,8 @@ static const char *
get_constant_sampler_filter_mode(enum cl_sampler_filter_mode mode)
{
switch (mode) {
case FILTER_MODE_NEAREST: return "nearest";
case FILTER_MODE_LINEAR: return "linear";
case SAMPLER_FILTER_MODE_NEAREST: return "nearest";
case SAMPLER_FILTER_MODE_LINEAR: return "linear";
default: unreachable("Invalid filter mode");
}
}
......
......@@ -901,16 +901,16 @@ enum float_controls
* These values match the meanings described in the SPIR-V spec.
*/
enum cl_sampler_addressing_mode {
ADDRESSING_MODE_NONE = 0,
ADDRESSING_MODE_CLAMP_TO_EDGE = 1,
ADDRESSING_MODE_CLAMP = 2,
ADDRESSING_MODE_REPEAT = 3,
ADDRESSING_MODE_REPEAT_MIRRORED = 4,
SAMPLER_ADDRESSING_MODE_NONE = 0,
SAMPLER_ADDRESSING_MODE_CLAMP_TO_EDGE = 1,
SAMPLER_ADDRESSING_MODE_CLAMP = 2,
SAMPLER_ADDRESSING_MODE_REPEAT = 3,
SAMPLER_ADDRESSING_MODE_REPEAT_MIRRORED = 4,
};
enum cl_sampler_filter_mode {
FILTER_MODE_NEAREST = 0,
FILTER_MODE_LINEAR = 1,
SAMPLER_FILTER_MODE_NEAREST = 0,
SAMPLER_FILTER_MODE_LINEAR = 1,
};
#ifdef __cplusplus
......
......@@ -1033,13 +1033,13 @@ wrap_from_cl_addressing(unsigned addressing_mode)
switch (addressing_mode)
{
default:
case ADDRESSING_MODE_NONE:
case ADDRESSING_MODE_CLAMP:
case SAMPLER_ADDRESSING_MODE_NONE:
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
return (enum pipe_tex_wrap)-1;
case ADDRESSING_MODE_CLAMP_TO_EDGE: return PIPE_TEX_WRAP_CLAMP_TO_EDGE;
case ADDRESSING_MODE_REPEAT: return PIPE_TEX_WRAP_REPEAT;
case ADDRESSING_MODE_REPEAT_MIRRORED: return PIPE_TEX_WRAP_MIRROR_REPEAT;
case SAMPLER_ADDRESSING_MODE_CLAMP_TO_EDGE: return PIPE_TEX_WRAP_CLAMP_TO_EDGE;
case SAMPLER_ADDRESSING_MODE_REPEAT: return PIPE_TEX_WRAP_REPEAT;
case SAMPLER_ADDRESSING_MODE_REPEAT_MIRRORED: return PIPE_TEX_WRAP_MIRROR_REPEAT;
}
}
......@@ -1397,7 +1397,7 @@ clc_to_dxil(struct clc_context *ctx,
int_sampler_states[sampler_id].is_nonnormalized_coords =
!var->constant_initializer->values[1].u32;
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++;
}
}
......
Markdown is supported
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